Skip to content

Commit

Permalink
feat: retime piece user action
Browse files Browse the repository at this point in the history
  • Loading branch information
mint-dewit committed Nov 15, 2024
1 parent b471208 commit 317383a
Show file tree
Hide file tree
Showing 8 changed files with 493 additions and 224 deletions.
22 changes: 20 additions & 2 deletions packages/blueprints-integration/src/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,29 @@ export interface UserOperationTarget {
pieceExternalId: string | undefined
}

export type DefaultUserOperations = {
id: '__sofie-move-segment' // Future: define properly
export enum SofieUserOperations {
MoveSegment = '__sofie-move-segment',
RetimePiece = '__sofie-retime-piece',
}

export type DefaultUserOperations = SofieUserOperationMoveSegment | SofieUserOperationRetimePiece

export type SofieUserOperationMoveSegment = {
id: SofieUserOperations.MoveSegment
payload: Record<string, never>
}

export type SofieUserOperationRetimePiece = {
id: SofieUserOperations.RetimePiece
payload: {
segmentExternalId: string
partExternalId: string

inPoint: number
// note - at some point this could also include an updated duration
}
}

export interface UserOperationChange<TCustomBlueprintOperations extends { id: string } = never> {
/** Indicate that this change is from user operations */
source: IngestChangeType.User
Expand Down
12 changes: 12 additions & 0 deletions packages/blueprints-integration/src/userEditing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { JSONBlob } from '@sofie-automation/shared-lib/dist/lib/JSONBlob'
import type { ITranslatableMessage } from './translations'
import { JSONSchema } from '@sofie-automation/shared-lib/dist/lib/JSONSchemaTypes'
import { SofieUserOperations } from './ingest'

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

/**
* A Sofie based Rich UX user operation
*/
export interface UserEditingDefinitionSofieDefault {
type: UserEditingType.SOFIE
/** Id of this operation */
id: SofieUserOperations
}

export enum UserEditingType {
/** Action */
ACTION = 'action',
/** Form of selections */
FORM = 'form',
/** Operation for the Built-in Sofie Rich Editing UI */
SOFIE = 'sofie',
}
18 changes: 16 additions & 2 deletions packages/corelib/src/dataModel/UserEditingDefinitions.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
import type { UserEditingType, JSONBlob, JSONSchema } from '@sofie-automation/blueprints-integration'
import type {
UserEditingType,
JSONBlob,
JSONSchema,
SofieUserOperations,
} from '@sofie-automation/blueprints-integration'
import type { ITranslatableMessage } from '../TranslatableMessage'

export type CoreUserEditingDefinition = CoreUserEditingDefinitionAction | CoreUserEditingDefinitionForm
export type CoreUserEditingDefinition =
| CoreUserEditingDefinitionAction
| CoreUserEditingDefinitionForm
| CoreUserEditingDefinitionSofie

export interface CoreUserEditingDefinitionAction {
type: UserEditingType.ACTION
Expand All @@ -28,3 +36,9 @@ export interface CoreUserEditingDefinitionForm {
/** Translation namespaces to use when rendering this form */
translationNamespaces: string[]
}

export interface CoreUserEditingDefinitionSofie {
type: UserEditingType.SOFIE
/** Id of this operation */
id: SofieUserOperations
}
Loading

0 comments on commit 317383a

Please sign in to comment.