1
1
import type { JSONBlob } from '@sofie-automation/shared-lib/dist/lib/JSONBlob'
2
2
import type { ITranslatableMessage } from './translations'
3
- import type { JSONSchema } from '@sofie-automation/shared-lib/dist/lib/JSONSchemaTypes'
3
+ import { JSONSchema } from '@sofie-automation/shared-lib/dist/lib/JSONSchemaTypes'
4
+ import { SourceLayerType } from './content'
4
5
5
6
/**
6
7
* Description of a user performed editing operation allowed on an document
@@ -16,8 +17,10 @@ export interface UserEditingDefinitionAction {
16
17
id : string
17
18
/** Label to show to the user for this operation */
18
19
label : ITranslatableMessage
19
- /** Icon to show to when this action is 'active' */
20
+ /** Icon to show when this action is 'active' */
20
21
svgIcon ?: string
22
+ /** Icon to show when this action is 'disabled' */
23
+ svgIconInactive ?: string
21
24
/** Whether this action should be indicated as being active */
22
25
isActive ?: boolean
23
26
}
@@ -40,6 +43,53 @@ export interface UserEditingDefinitionForm {
40
43
export enum UserEditingType {
41
44
/** Action */
42
45
ACTION = 'action' ,
43
- /** Form of selections */
46
+ /** Form */
44
47
FORM = 'form' ,
45
48
}
49
+
50
+ export interface UserEditingSourceLayer {
51
+ sourceLayerLabel : string
52
+ sourceLayerType : SourceLayerType
53
+ schema : JSONBlob < JSONSchema >
54
+ defaultValue ?: Record < string , any >
55
+ }
56
+
57
+ export interface UserEditingProperties {
58
+ /**
59
+ * These properties are dependent on the (primary) piece type, the user will get the option
60
+ * to select the type of piece (from the SourceLayerTypes i.e. Camera or Split etc.) and then
61
+ * be presented the corresponding form
62
+ *
63
+ * example:
64
+ * {
65
+ * schema: {
66
+ * camera: '{ "type": "object", "properties": { "input": { "type": "number" } } }',
67
+ * split: '{ "type": "object", ... }',
68
+ * },
69
+ * currentValue: {
70
+ * type: 'camera',
71
+ * value: {
72
+ * input: 3
73
+ * },
74
+ * }
75
+ * }
76
+ */
77
+ pieceTypeProperties ?: {
78
+ schema : Record < string , UserEditingSourceLayer >
79
+ currentValue : { type : string ; value : Record < string , any > }
80
+ }
81
+
82
+ /**
83
+ * These are properties that are available to edit regardless of the piece type, examples
84
+ * could be whether it an element is locked from NRCS updates
85
+ *
86
+ * if you do not want the piece type to be changed, then use only this field.
87
+ */
88
+ globalProperties ?: { schema : JSONBlob < JSONSchema > ; currentValue : Record < string , any > }
89
+
90
+ /**
91
+ * A list of id's of operations to be exposed on the properties panel as buttons. These operations
92
+ * must be available on the element
93
+ */
94
+ operations ?: UserEditingDefinitionAction [ ]
95
+ }
0 commit comments