Skip to content

Commit b075967

Browse files
author
Mint de Wit
committed
feat: edit mode for drag operations
1 parent 1284f9f commit b075967

File tree

11 files changed

+372
-266
lines changed

11 files changed

+372
-266
lines changed

packages/blueprints-integration/src/triggers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,12 @@ export interface IShelfAction extends ITriggeredActionBase {
265265
filterChain: IGUIContextFilterLink[]
266266
}
267267

268+
export interface IEditModeAction extends ITriggeredActionBase {
269+
action: ClientActions.editMode
270+
state: true | false | 'toggle'
271+
filterChain: IGUIContextFilterLink[]
272+
}
273+
268274
export interface IGoToOnAirLineAction extends ITriggeredActionBase {
269275
action: ClientActions.goToOnAirLine
270276
filterChain: IGUIContextFilterLink[]
@@ -318,6 +324,7 @@ export type SomeAction =
318324
| IRundownPlaylistResetAction
319325
| IRundownPlaylistResyncAction
320326
| IShelfAction
327+
| IEditModeAction
321328
| IGoToOnAirLineAction
322329
| IRewindSegmentsAction
323330
| IShowEntireCurrentSegmentAction

packages/meteor-lib/src/triggers/RundownViewEventBus.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ export enum RundownViewEvents {
2929
REVEAL_IN_SHELF = 'revealInShelf',
3030
SWITCH_SHELF_TAB = 'switchShelfTab',
3131
SHELF_STATE = 'shelfState',
32+
EDIT_MODE = 'editMode',
3233
MINI_SHELF_QUEUE_ADLIB = 'miniShelfQueueAdLib',
3334
GO_TO_PART = 'goToPart',
3435
GO_TO_PART_INSTANCE = 'goToPartInstance',
@@ -74,6 +75,10 @@ export interface ShelfStateEvent extends IEventContext {
7475
state: boolean | 'toggle'
7576
}
7677

78+
export interface EditModeEvent extends IEventContext {
79+
state: boolean | 'toggle'
80+
}
81+
7782
export interface MiniShelfQueueAdLibEvent extends IEventContext {
7883
forward: boolean
7984
}
@@ -139,6 +144,7 @@ class RundownViewEventBus0 extends EventEmitter {
139144
emit(event: RundownViewEvents.SEGMENT_ZOOM_ON): boolean
140145
emit(event: RundownViewEvents.SEGMENT_ZOOM_OFF): boolean
141146
emit(event: RundownViewEvents.SHELF_STATE, e: ShelfStateEvent): boolean
147+
emit(event: RundownViewEvents.EDIT_MODE, e: EditModeEvent): boolean
142148
emit(event: RundownViewEvents.REVEAL_IN_SHELF, e: RevealInShelfEvent): boolean
143149
emit(event: RundownViewEvents.SWITCH_SHELF_TAB, e: SwitchToShelfTabEvent): boolean
144150
emit(event: RundownViewEvents.MINI_SHELF_QUEUE_ADLIB, e: MiniShelfQueueAdLibEvent): boolean
@@ -175,6 +181,7 @@ class RundownViewEventBus0 extends EventEmitter {
175181
on(event: RundownViewEvents.SEGMENT_ZOOM_OFF, listener: () => void): this
176182
on(event: RundownViewEvents.REVEAL_IN_SHELF, listener: (e: RevealInShelfEvent) => void): this
177183
on(event: RundownViewEvents.SHELF_STATE, listener: (e: ShelfStateEvent) => void): this
184+
on(event: RundownViewEvents.EDIT_MODE, listener: (e: EditModeEvent) => void): this
178185
on(event: RundownViewEvents.SWITCH_SHELF_TAB, listener: (e: SwitchToShelfTabEvent) => void): this
179186
on(event: RundownViewEvents.MINI_SHELF_QUEUE_ADLIB, listener: (e: MiniShelfQueueAdLibEvent) => void): this
180187
on(event: RundownViewEvents.GO_TO_PART, listener: (e: GoToPartEvent) => void): this

packages/meteor-lib/src/triggers/actionFactory.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,17 @@ function createShelfAction(_filterChain: IGUIContextFilterLink[], state: boolean
287287
}
288288
}
289289

290+
function createEditModeAction(_filterChain: IGUIContextFilterLink[], state: boolean | 'toggle'): ExecutableAction {
291+
return {
292+
action: ClientActions.editMode,
293+
execute: () => {
294+
RundownViewEventBus.emit(RundownViewEvents.EDIT_MODE, {
295+
state,
296+
})
297+
},
298+
}
299+
}
300+
290301
function createMiniShelfQueueAdLibAction(_filterChain: IGUIContextFilterLink[], forward: boolean): ExecutableAction {
291302
return {
292303
action: ClientActions.miniShelfQueueAdLib,
@@ -443,6 +454,8 @@ export function createAction(
443454
switch (action.action) {
444455
case ClientActions.shelf:
445456
return createShelfAction(action.filterChain, action.state)
457+
case ClientActions.editMode:
458+
return createEditModeAction(action.filterChain, action.state)
446459
case ClientActions.goToOnAirLine:
447460
return createGoToOnAirLineAction(action.filterChain)
448461
case ClientActions.rewindSegments:

packages/shared-lib/src/core/model/ShowStyle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ export enum ClientActions {
104104
'rewindSegments' = 'rewindSegments',
105105
'showEntireCurrentSegment' = 'showEntireCurrentSegment',
106106
'miniShelfQueueAdLib' = 'miniShelfQueueAdLib',
107+
'editMode' = 'editMode',
107108
}
108109

109110
export enum DeviceActions {

packages/webui/src/client/lib/ui/pieceUiClassNames.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ export function pieceUiClassNames(
1919
uiState?: {
2020
leftAnchoredWidth: number
2121
rightAnchoredWidth: number
22-
}
22+
},
23+
draggable?: boolean
2324
): string {
2425
const typeClass = layerType ? RundownUtils.getSourceLayerClassName(layerType) : ''
2526

@@ -57,5 +58,7 @@ export function pieceUiClassNames(
5758
'invert-flash': highlight,
5859

5960
'element-selected': selected,
61+
62+
'draggable-element': draggable,
6063
})
6164
}

packages/webui/src/client/styles/elementSelected.scss

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,20 @@
33
$glow-color: rgba(255, 255, 255, 0.58);
44

55
.element-selected {
6-
box-shadow: inset 0 0 15px $glow-color;
7-
animation: subtle-glow 1s ease-in-out infinite;
6+
box-shadow: inset 0 0 15px $glow-color;
7+
animation: subtle-glow 1s ease-in-out infinite;
88

9-
@keyframes subtle-glow {
10-
0%, 100% {
11-
box-shadow: inset 0 0 15px $glow-color;
12-
}
13-
50% {
14-
box-shadow: inset 0 0 25px $glow-color,
15-
inset 0 0 35px $glow-color;
16-
}
17-
}
18-
}
9+
@keyframes subtle-glow {
10+
0%,
11+
100% {
12+
box-shadow: inset 0 0 15px $glow-color;
13+
}
14+
50% {
15+
box-shadow: inset 0 0 25px $glow-color, inset 0 0 35px $glow-color;
16+
}
17+
}
18+
}
19+
20+
.draggable-element {
21+
border: dotted white 1px;
22+
}

0 commit comments

Comments
 (0)