Skip to content
13 changes: 13 additions & 0 deletions packages/blueprints-integration/src/ingest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ export enum DefaultUserOperationsTypes {
REVERT_RUNDOWN = '__sofie-revert-rundown',
UPDATE_PROPS = '__sofie-update-props',
IMPORT_MOS_ITEM = '__sofie-import-mos',
RETIME_PIECE = '__sofie-retime-piece',
}

export interface DefaultUserOperationRevertRundown {
Expand Down Expand Up @@ -161,12 +162,24 @@ export type DefaultUserOperationImportMOSItem = {
payload: any
}

export type DefaultUserOperationRetimePiece = {
id: DefaultUserOperationsTypes.RETIME_PIECE
payload: {
segmentExternalId: string
partExternalId: string

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

export type DefaultUserOperations =
| DefaultUserOperationRevertRundown
| DefaultUserOperationRevertSegment
| DefaultUserOperationRevertPart
| DefaultUserOperationEditProperties
| DefaultUserOperationImportMOSItem
| DefaultUserOperationRetimePiece

export interface UserOperationChange<TCustomBlueprintOperations extends { id: string } = never> {
/** Indicate that this change is from user operations */
Expand Down
7 changes: 7 additions & 0 deletions packages/blueprints-integration/src/triggers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ export interface IShelfAction extends ITriggeredActionBase {
filterChain: IGUIContextFilterLink[]
}

export interface IEditModeAction extends ITriggeredActionBase {
action: ClientActions.editMode
state: true | false | 'toggle'
filterChain: IGUIContextFilterLink[]
}

export interface IGoToOnAirLineAction extends ITriggeredActionBase {
action: ClientActions.goToOnAirLine
filterChain: IGUIContextFilterLink[]
Expand Down Expand Up @@ -325,6 +331,7 @@ export type SomeAction =
| IRundownPlaylistResetAction
| IRundownPlaylistResyncAction
| IShelfAction
| IEditModeAction
| IGoToOnAirLineAction
| IRewindSegmentsAction
| IShowEntireCurrentSegmentAction
Expand Down
5 changes: 5 additions & 0 deletions packages/blueprints-integration/src/userEditing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ export interface UserEditingDefinitionSofieDefault {
type: UserEditingType.SOFIE
/** Id of this operation */
id: DefaultUserOperationsTypes
/**
* If true, the operation is limited to the current part.
* Only applicable for RETIME_PIECE
*/
limitToCurrentPart?: boolean
}

export enum UserEditingType {
Expand Down
5 changes: 5 additions & 0 deletions packages/corelib/src/dataModel/UserEditingDefinitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,4 +96,9 @@ export interface CoreUserEditingDefinitionSofie {
type: UserEditingType.SOFIE
/** Id of this operation */
id: DefaultUserOperationsTypes
/**
* If true, the operation is limited to the current part.
* Only applicable for RETIME_PIECE
*/
limitToCurrentPart?: boolean
}
26 changes: 14 additions & 12 deletions packages/job-worker/src/blueprints/context/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,27 +525,28 @@ function translateUserEditsToBlueprint(
userEdits.map((userEdit) => {
switch (userEdit.type) {
case UserEditingType.ACTION:
return {
return literal<UserEditingDefinitionAction>({
type: UserEditingType.ACTION,
id: userEdit.id,
label: omit(userEdit.label, 'namespaces'),
icon: userEdit.icon,
iconInactive: userEdit.iconInactive,
isActive: userEdit.isActive,
} satisfies Complete<UserEditingDefinitionAction>
})
case UserEditingType.FORM:
return {
return literal<UserEditingDefinitionForm>({
type: UserEditingType.FORM,
id: userEdit.id,
label: omit(userEdit.label, 'namespaces'),
schema: clone(userEdit.schema),
currentValues: clone(userEdit.currentValues),
} satisfies Complete<UserEditingDefinitionForm>
})
case UserEditingType.SOFIE:
return {
return literal<UserEditingDefinitionSofieDefault>({
type: UserEditingType.SOFIE,
id: userEdit.id,
} satisfies Complete<UserEditingDefinitionSofieDefault>
limitToCurrentPart: userEdit.limitToCurrentPart,
})
default:
assertNever(userEdit)
return undefined
Expand Down Expand Up @@ -587,28 +588,29 @@ export function translateUserEditsFromBlueprint(
userEdits.map((userEdit) => {
switch (userEdit.type) {
case UserEditingType.ACTION:
return {
return literal<CoreUserEditingDefinitionAction>({
type: UserEditingType.ACTION,
id: userEdit.id,
label: wrapTranslatableMessageFromBlueprints(userEdit.label, blueprintIds),
icon: userEdit.icon,
iconInactive: userEdit.iconInactive,
isActive: userEdit.isActive,
} satisfies Complete<CoreUserEditingDefinitionAction>
})
case UserEditingType.FORM:
return {
return literal<CoreUserEditingDefinitionForm>({
type: UserEditingType.FORM,
id: userEdit.id,
label: wrapTranslatableMessageFromBlueprints(userEdit.label, blueprintIds),
schema: clone(userEdit.schema),
currentValues: clone(userEdit.currentValues),
translationNamespaces: unprotectStringArray(blueprintIds),
} satisfies Complete<CoreUserEditingDefinitionForm>
})
case UserEditingType.SOFIE:
return {
return literal<CoreUserEditingDefinitionSofie>({
type: UserEditingType.SOFIE,
id: userEdit.id,
} satisfies Complete<CoreUserEditingDefinitionSofie>
limitToCurrentPart: userEdit.limitToCurrentPart,
})
default:
assertNever(userEdit)
return undefined
Expand Down
6 changes: 6 additions & 0 deletions packages/meteor-lib/src/triggers/RundownViewEventBus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum RundownViewEvents {
REVEAL_IN_SHELF = 'revealInShelf',
SWITCH_SHELF_TAB = 'switchShelfTab',
SHELF_STATE = 'shelfState',
EDIT_MODE = 'editMode',
MINI_SHELF_QUEUE_ADLIB = 'miniShelfQueueAdLib',
GO_TO_PART = 'goToPart',
GO_TO_PART_INSTANCE = 'goToPartInstance',
Expand Down Expand Up @@ -74,6 +75,10 @@ export interface ShelfStateEvent extends IEventContext {
state: boolean | 'toggle'
}

export interface EditModeEvent extends IEventContext {
state: boolean | 'toggle'
}

export interface MiniShelfQueueAdLibEvent extends IEventContext {
forward: boolean
}
Expand Down Expand Up @@ -139,6 +144,7 @@ export interface RundownViewEventBusEvents {
[RundownViewEvents.SEGMENT_ZOOM_ON]: []
[RundownViewEvents.SEGMENT_ZOOM_OFF]: []
[RundownViewEvents.SHELF_STATE]: [e: ShelfStateEvent]
[RundownViewEvents.EDIT_MODE]: [e: EditModeEvent]
[RundownViewEvents.REVEAL_IN_SHELF]: [e: RevealInShelfEvent]
[RundownViewEvents.SWITCH_SHELF_TAB]: [e: SwitchToShelfTabEvent]
[RundownViewEvents.MINI_SHELF_QUEUE_ADLIB]: [e: MiniShelfQueueAdLibEvent]
Expand Down
13 changes: 13 additions & 0 deletions packages/meteor-lib/src/triggers/actionFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,17 @@ function createShelfAction(_filterChain: IGUIContextFilterLink[], state: boolean
}
}

function createEditModeAction(_filterChain: IGUIContextFilterLink[], state: boolean | 'toggle'): ExecutableAction {
return {
action: ClientActions.editMode,
execute: () => {
RundownViewEventBus.emit(RundownViewEvents.EDIT_MODE, {
state,
})
},
}
}

function createMiniShelfQueueAdLibAction(_filterChain: IGUIContextFilterLink[], forward: boolean): ExecutableAction {
return {
action: ClientActions.miniShelfQueueAdLib,
Expand Down Expand Up @@ -442,6 +453,8 @@ export function createAction(
switch (action.action) {
case ClientActions.shelf:
return createShelfAction(action.filterChain, action.state)
case ClientActions.editMode:
return createEditModeAction(action.filterChain, action.state)
case ClientActions.goToOnAirLine:
return createGoToOnAirLineAction(action.filterChain)
case ClientActions.rewindSegments:
Expand Down
1 change: 1 addition & 0 deletions packages/shared-lib/src/core/model/ShowStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export enum ClientActions {
'rewindSegments' = 'rewindSegments',
'showEntireCurrentSegment' = 'showEntireCurrentSegment',
'miniShelfQueueAdLib' = 'miniShelfQueueAdLib',
'editMode' = 'editMode',
}

export enum DeviceActions {
Expand Down
5 changes: 4 additions & 1 deletion packages/webui/src/client/lib/ui/pieceUiClassNames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export function pieceUiClassNames(
uiState?: {
leftAnchoredWidth: number
rightAnchoredWidth: number
}
},
draggable?: boolean
): string {
const typeClass = layerType ? RundownUtils.getSourceLayerClassName(layerType) : ''

Expand Down Expand Up @@ -57,5 +58,7 @@ export function pieceUiClassNames(
'invert-flash': highlight,

'element-selected': selected,

'draggable-element': draggable,
})
}
4 changes: 4 additions & 0 deletions packages/webui/src/client/styles/elementSelected.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ $glow-color: rgba(255, 255, 255, 0.58);
}
}
}

.draggable-element {
border: dotted white 1px;
}
Loading
Loading