Skip to content

Commit 317383a

Browse files
author
Mint de Wit
committed
feat: retime piece user action
1 parent b471208 commit 317383a

File tree

8 files changed

+493
-224
lines changed

8 files changed

+493
-224
lines changed

packages/blueprints-integration/src/ingest.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,29 @@ export interface UserOperationTarget {
124124
pieceExternalId: string | undefined
125125
}
126126

127-
export type DefaultUserOperations = {
128-
id: '__sofie-move-segment' // Future: define properly
127+
export enum SofieUserOperations {
128+
MoveSegment = '__sofie-move-segment',
129+
RetimePiece = '__sofie-retime-piece',
130+
}
131+
132+
export type DefaultUserOperations = SofieUserOperationMoveSegment | SofieUserOperationRetimePiece
133+
134+
export type SofieUserOperationMoveSegment = {
135+
id: SofieUserOperations.MoveSegment
129136
payload: Record<string, never>
130137
}
131138

139+
export type SofieUserOperationRetimePiece = {
140+
id: SofieUserOperations.RetimePiece
141+
payload: {
142+
segmentExternalId: string
143+
partExternalId: string
144+
145+
inPoint: number
146+
// note - at some point this could also include an updated duration
147+
}
148+
}
149+
132150
export interface UserOperationChange<TCustomBlueprintOperations extends { id: string } = never> {
133151
/** Indicate that this change is from user operations */
134152
source: IngestChangeType.User

packages/blueprints-integration/src/userEditing.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { JSONBlob } from '@sofie-automation/shared-lib/dist/lib/JSONBlob'
22
import type { ITranslatableMessage } from './translations'
33
import { JSONSchema } from '@sofie-automation/shared-lib/dist/lib/JSONSchemaTypes'
4+
import { SofieUserOperations } from './ingest'
45

56
/**
67
* Description of a user performed editing operation allowed on an document
@@ -37,9 +38,20 @@ export interface UserEditingDefinitionForm {
3738
currentValues: Record<string, any>
3839
}
3940

41+
/**
42+
* A Sofie based Rich UX user operation
43+
*/
44+
export interface UserEditingDefinitionSofieDefault {
45+
type: UserEditingType.SOFIE
46+
/** Id of this operation */
47+
id: SofieUserOperations
48+
}
49+
4050
export enum UserEditingType {
4151
/** Action */
4252
ACTION = 'action',
4353
/** Form of selections */
4454
FORM = 'form',
55+
/** Operation for the Built-in Sofie Rich Editing UI */
56+
SOFIE = 'sofie',
4557
}

packages/corelib/src/dataModel/UserEditingDefinitions.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
import type { UserEditingType, JSONBlob, JSONSchema } from '@sofie-automation/blueprints-integration'
1+
import type {
2+
UserEditingType,
3+
JSONBlob,
4+
JSONSchema,
5+
SofieUserOperations,
6+
} from '@sofie-automation/blueprints-integration'
27
import type { ITranslatableMessage } from '../TranslatableMessage'
38

4-
export type CoreUserEditingDefinition = CoreUserEditingDefinitionAction | CoreUserEditingDefinitionForm
9+
export type CoreUserEditingDefinition =
10+
| CoreUserEditingDefinitionAction
11+
| CoreUserEditingDefinitionForm
12+
| CoreUserEditingDefinitionSofie
513

614
export interface CoreUserEditingDefinitionAction {
715
type: UserEditingType.ACTION
@@ -28,3 +36,9 @@ export interface CoreUserEditingDefinitionForm {
2836
/** Translation namespaces to use when rendering this form */
2937
translationNamespaces: string[]
3038
}
39+
40+
export interface CoreUserEditingDefinitionSofie {
41+
type: UserEditingType.SOFIE
42+
/** Id of this operation */
43+
id: SofieUserOperations
44+
}

0 commit comments

Comments
 (0)