@chili-publish/studio-sdk 1.34.0 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/main.es.js +802 -688
- package/_bundles/main.es.js.map +1 -1
- package/_bundles/main.js +66 -18
- package/_bundles/main.js.map +1 -1
- package/connector-types/src/Common.d.ts +7 -0
- package/connector-types/src/Common.js +9 -0
- package/connector-types/src/Common.js.map +1 -0
- package/connector-types/src/ComponentConnector.d.ts +28 -0
- package/connector-types/src/ComponentConnector.js +3 -0
- package/connector-types/src/ComponentConnector.js.map +1 -0
- package/connector-types/src/index.d.ts +2 -0
- package/connector-types/src/index.js +2 -0
- package/connector-types/src/index.js.map +1 -1
- package/lib/editor-engine.json +1 -1
- package/lib/package.json +1 -1
- package/lib/src/controllers/BarcodeController.d.ts +17 -17
- package/lib/src/controllers/BarcodeController.js +17 -17
- package/lib/src/controllers/ComponentConnectorController.d.ts +64 -0
- package/lib/src/controllers/ComponentConnectorController.js +123 -0
- package/lib/src/controllers/ComponentConnectorController.js.map +1 -0
- package/lib/src/controllers/ComponentController.d.ts +28 -0
- package/lib/src/controllers/ComponentController.js +63 -0
- package/lib/src/controllers/ComponentController.js.map +1 -0
- package/lib/src/controllers/FrameController.d.ts +35 -3
- package/lib/src/controllers/FrameController.js +52 -3
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/LayoutController.d.ts +1 -1
- package/lib/src/controllers/LayoutController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/UtilsController.d.ts +1 -1
- package/lib/src/controllers/UtilsController.js.map +1 -1
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.js +4 -3
- package/lib/src/index.js.map +1 -1
- package/lib/src/interactions/Connector.d.ts +1 -1
- package/lib/src/interactions/Connector.js +97 -19
- package/lib/src/interactions/Connector.js.map +1 -1
- package/lib/src/next/types/ConnectorTypes.d.ts +5 -1
- package/lib/src/next/types/ConnectorTypes.js +4 -0
- package/lib/src/next/types/ConnectorTypes.js.map +1 -1
- package/lib/src/sdk.d.ts +8 -1
- package/lib/src/sdk.js +10 -1
- package/lib/src/sdk.js.map +1 -1
- package/lib/src/tests/controllers/ComponentConnectorController.test.js +73 -0
- package/lib/src/tests/controllers/ComponentConnectorController.test.js.map +1 -0
- package/lib/src/tests/controllers/ComponentController.test.js +52 -0
- package/lib/src/tests/controllers/ComponentController.test.js.map +1 -0
- package/lib/src/tests/controllers/FrameConstraintController.test.js +32 -8
- package/lib/src/tests/controllers/FrameConstraintController.test.js.map +1 -1
- package/lib/src/tests/controllers/FrameController.test.js +22 -1
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/LayoutController.test.js +1 -1
- package/lib/src/tests/controllers/LayoutController.test.js.map +1 -1
- package/lib/src/tests/controllers/UtilsController.test.js +1 -1
- package/lib/src/tests/controllers/UtilsController.test.js.map +1 -1
- package/lib/src/types/CommonTypes.d.ts +5 -0
- package/lib/src/types/CommonTypes.js.map +1 -1
- package/lib/src/types/ComponentConnectorTypes.d.ts +9 -0
- package/lib/src/types/ComponentConnectorTypes.js +10 -0
- package/lib/src/types/ComponentConnectorTypes.js.map +1 -0
- package/lib/src/types/ConfigurationTypes.d.ts +2 -2
- package/lib/src/types/ConfigurationTypes.js +2 -2
- package/lib/src/types/ConfigurationTypes.js.map +1 -1
- package/lib/src/types/ConnectorTypes.d.ts +5 -1
- package/lib/src/types/ConnectorTypes.js +4 -0
- package/lib/src/types/ConnectorTypes.js.map +1 -1
- package/lib/src/types/FrameTypes.d.ts +36 -17
- package/lib/src/types/FrameTypes.js +5 -0
- package/lib/src/types/FrameTypes.js.map +1 -1
- package/lib/src/types/LayoutTypes.d.ts +2 -7
- package/lib/src/types/LayoutTypes.js +1 -8
- package/lib/src/types/LayoutTypes.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export var MeasurementUnit;
|
|
2
|
+
(function (MeasurementUnit) {
|
|
3
|
+
MeasurementUnit["px"] = "px";
|
|
4
|
+
MeasurementUnit["mm"] = "mm";
|
|
5
|
+
MeasurementUnit["cm"] = "cm";
|
|
6
|
+
MeasurementUnit["inch"] = "inch";
|
|
7
|
+
MeasurementUnit["pt"] = "pt";
|
|
8
|
+
})(MeasurementUnit || (MeasurementUnit = {}));
|
|
9
|
+
//# sourceMappingURL=Common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Common.js","sourceRoot":"","sources":["../../../../connector-types/src/Common.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,4BAAS,CAAA;IACT,gCAAa,CAAA;IACb,4BAAS,CAAA;AACb,CAAC,EANW,eAAe,KAAf,eAAe,QAM1B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MeasurementUnit } from './Common';
|
|
2
|
+
import { QueryPage } from './Connector.Shared';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental This is still experimental and might change in future releases.
|
|
5
|
+
*/
|
|
6
|
+
export type ComponentPage = QueryPage<Component>;
|
|
7
|
+
/**
|
|
8
|
+
* @experimental This is still experimental and might change in future releases.
|
|
9
|
+
*/
|
|
10
|
+
export interface Component {
|
|
11
|
+
id: string;
|
|
12
|
+
name: string;
|
|
13
|
+
defaultComponentDimensions: {
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
unit: MeasurementUnit;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @experimental This is still experimental and might change in future releases.
|
|
21
|
+
*/
|
|
22
|
+
export type ComponentConnectorCapabilities = {
|
|
23
|
+
query: boolean;
|
|
24
|
+
detail: boolean;
|
|
25
|
+
preview: boolean;
|
|
26
|
+
filtering: boolean;
|
|
27
|
+
serverRender: boolean;
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentConnector.js","sourceRoot":"","sources":["../../../../connector-types/src/ComponentConnector.ts"],"names":[],"mappings":"AAmBC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../connector-types/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../connector-types/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC"}
|
package/lib/editor-engine.json
CHANGED
package/lib/package.json
CHANGED
|
@@ -14,76 +14,76 @@ export declare class BarcodeController {
|
|
|
14
14
|
*/
|
|
15
15
|
constructor(editorAPI: EditorAPI);
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* This method updates properties of the barcode
|
|
18
18
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
19
19
|
* @param properties A property to update
|
|
20
20
|
* @returns
|
|
21
21
|
*/
|
|
22
22
|
private setBarcodeProperties;
|
|
23
23
|
/**
|
|
24
|
-
*
|
|
24
|
+
* This method will set the background of a barcode enabled or disabled
|
|
25
25
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
26
26
|
* @param enableBackground Whether the barcode's background is visible.
|
|
27
27
|
* @returns
|
|
28
28
|
*/
|
|
29
29
|
setEnableBackground: (id: Id, enableBackground: boolean) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* This method will set the barcode background color of a specified barcode frame.
|
|
32
32
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
33
33
|
* @param backgroundColor the new barcode background color that you want to set to the barcodeFrame.
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
36
|
setBackgroundColor: (id: Id, backgroundColor: ColorUsage) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* This method will set the visibility of the barcode's bars.
|
|
39
39
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
40
40
|
* @param enableBars Whether the barcode bars are visible.
|
|
41
41
|
* @returns
|
|
42
42
|
*/
|
|
43
43
|
setEnableBars: (id: Id, enableBars: boolean) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* This method will set the bar color of a specified barcode frame.
|
|
46
46
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
47
47
|
* @param barColor the new bar color that you want to set to the barcodeFrame.
|
|
48
48
|
* @returns
|
|
49
49
|
*/
|
|
50
50
|
setBarColor: (id: Id, barColor: ColorUsage) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
51
51
|
/**
|
|
52
|
-
*
|
|
52
|
+
* This method will set the source of the barcode to the given source.
|
|
53
53
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
54
54
|
* @param source the new source that you want to set to the barcodeFrame.
|
|
55
55
|
* @returns
|
|
56
56
|
*/
|
|
57
57
|
setBarcodeSource: (id: Id, source: BarcodeSource) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
58
58
|
/**
|
|
59
|
-
*
|
|
59
|
+
* This method will remove the source from the barcode frame provided.
|
|
60
60
|
* @param id the id of the barcodeFrame that needs to have the source removed.
|
|
61
61
|
* @returns
|
|
62
62
|
*/
|
|
63
63
|
removeBarcodeSource: (id: Id) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
64
64
|
/**
|
|
65
|
-
*
|
|
65
|
+
* This method enables/disables displaying the text of the barcode.
|
|
66
66
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
67
67
|
* @param enableText true if the text should be displayed, false otherwise.
|
|
68
68
|
* @returns
|
|
69
69
|
*/
|
|
70
70
|
setEnableText: (id: Id, enableText: boolean) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* This method sets the bar height for 1-dimensional barcodes.
|
|
73
73
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
74
74
|
* @param barHeight the height of the bars in the barcode. The string value will be calculated (f.e. 1+1 will result in 2)
|
|
75
75
|
* @returns
|
|
76
76
|
*/
|
|
77
77
|
setBarHeight: (id: Id, barHeight: string) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
78
78
|
/**
|
|
79
|
-
*
|
|
79
|
+
* This method sets the magnification for 1-dimensional barcodes.
|
|
80
80
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
81
81
|
* @param magnification the magnification of the barcode. This is a decimal value where 1 denotes 100%. (f.e. 1.5 will result in 150%)
|
|
82
82
|
* @returns
|
|
83
83
|
*/
|
|
84
84
|
setMagnification: (id: Id, magnification: number) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
85
85
|
/**
|
|
86
|
-
*
|
|
86
|
+
* This method sets the quiet zone value of a specific barcode.
|
|
87
87
|
* @param id The id of the specific barcode frame
|
|
88
88
|
* @param value The quiet zone value
|
|
89
89
|
* @param position When defined will update the quiet value of a single position,
|
|
@@ -92,27 +92,27 @@ export declare class BarcodeController {
|
|
|
92
92
|
*/
|
|
93
93
|
setQuietZoneValue: (id: Id, value: string, position?: PositionEnum) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
94
94
|
/**
|
|
95
|
-
*
|
|
95
|
+
* This method sets the combined state of the quiet zone values.
|
|
96
96
|
* @param id The id of the specific barcode frame
|
|
97
97
|
* @param value Whether the quiet zone values are combined
|
|
98
98
|
*/
|
|
99
99
|
setAreQuietZoneValuesCombined: (id: Id, value: boolean) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* This method sets the character set for the barcode.
|
|
102
102
|
* @param id The id of the specific barcode frame.
|
|
103
103
|
* @param errorCorrectionLevel The error correction level to set.
|
|
104
104
|
* @returns
|
|
105
105
|
*/
|
|
106
106
|
setErrorCorrectionLevel: (id: Id, errorCorrectionLevel: BarcodeErrorCorrectionLevel) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* This method sets the character set for the barcode.
|
|
109
109
|
* @param id The id of the specific barcode frame.
|
|
110
110
|
* @param characterSet The character set to set.
|
|
111
111
|
* @returns
|
|
112
112
|
*/
|
|
113
113
|
setCharacterSet: (id: Id, characterSet: BarcodeCharacterSet) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
114
114
|
/**
|
|
115
|
-
*
|
|
115
|
+
* This method sets the flag to render the end characters of the barcode. This is not
|
|
116
116
|
* supported for all barcode types.
|
|
117
117
|
* @param id The id of the specific barcode frame.
|
|
118
118
|
* @param drawLightMarginIndicator The flag indicating if the end characters should be drawn or not
|
|
@@ -120,7 +120,7 @@ export declare class BarcodeController {
|
|
|
120
120
|
*/
|
|
121
121
|
setDrawLightMarginIndicator: (id: Id, drawLightMarginIndicator: boolean) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
122
122
|
/**
|
|
123
|
-
*
|
|
123
|
+
* This method sets the flag to render the start and end characters of the barcode. This is not
|
|
124
124
|
* supported for all barcode types.
|
|
125
125
|
* @param id The id of the specific barcode frame.
|
|
126
126
|
* @param drawStartStopChars The flag indicating if the start and stop characters should be drawn or not
|
|
@@ -128,7 +128,7 @@ export declare class BarcodeController {
|
|
|
128
128
|
*/
|
|
129
129
|
setDrawStartStopChars: (id: Id, drawStartStopChars: boolean) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
130
130
|
/**
|
|
131
|
-
*
|
|
131
|
+
* This method returns the possible configuration options which are valid for the given barcode type.
|
|
132
132
|
* @param type the barcode type for which the configuration options are requested.
|
|
133
133
|
* @returns a BarcodeConfigurationOptions object
|
|
134
134
|
*/
|
|
@@ -36,7 +36,7 @@ export class BarcodeController {
|
|
|
36
36
|
*/
|
|
37
37
|
_BarcodeController_editorAPI.set(this, void 0);
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* This method updates properties of the barcode
|
|
40
40
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
41
41
|
* @param properties A property to update
|
|
42
42
|
* @returns
|
|
@@ -48,7 +48,7 @@ export class BarcodeController {
|
|
|
48
48
|
.then((result) => getEditorResponseData(result));
|
|
49
49
|
});
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
51
|
+
* This method will set the background of a barcode enabled or disabled
|
|
52
52
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
53
53
|
* @param enableBackground Whether the barcode's background is visible.
|
|
54
54
|
* @returns
|
|
@@ -58,7 +58,7 @@ export class BarcodeController {
|
|
|
58
58
|
return this.setBarcodeProperties(id, properties);
|
|
59
59
|
});
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* This method will set the barcode background color of a specified barcode frame.
|
|
62
62
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
63
63
|
* @param backgroundColor the new barcode background color that you want to set to the barcodeFrame.
|
|
64
64
|
* @returns
|
|
@@ -68,7 +68,7 @@ export class BarcodeController {
|
|
|
68
68
|
return this.setBarcodeProperties(id, properties);
|
|
69
69
|
});
|
|
70
70
|
/**
|
|
71
|
-
*
|
|
71
|
+
* This method will set the visibility of the barcode's bars.
|
|
72
72
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
73
73
|
* @param enableBars Whether the barcode bars are visible.
|
|
74
74
|
* @returns
|
|
@@ -78,7 +78,7 @@ export class BarcodeController {
|
|
|
78
78
|
return this.setBarcodeProperties(id, properties);
|
|
79
79
|
});
|
|
80
80
|
/**
|
|
81
|
-
*
|
|
81
|
+
* This method will set the bar color of a specified barcode frame.
|
|
82
82
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
83
83
|
* @param barColor the new bar color that you want to set to the barcodeFrame.
|
|
84
84
|
* @returns
|
|
@@ -88,7 +88,7 @@ export class BarcodeController {
|
|
|
88
88
|
return this.setBarcodeProperties(id, properties);
|
|
89
89
|
});
|
|
90
90
|
/**
|
|
91
|
-
*
|
|
91
|
+
* This method will set the source of the barcode to the given source.
|
|
92
92
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
93
93
|
* @param source the new source that you want to set to the barcodeFrame.
|
|
94
94
|
* @returns
|
|
@@ -98,7 +98,7 @@ export class BarcodeController {
|
|
|
98
98
|
return res.setBarcodeSource(id, JSON.stringify(source)).then((result) => getEditorResponseData(result));
|
|
99
99
|
});
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* This method will remove the source from the barcode frame provided.
|
|
102
102
|
* @param id the id of the barcodeFrame that needs to have the source removed.
|
|
103
103
|
* @returns
|
|
104
104
|
*/
|
|
@@ -107,7 +107,7 @@ export class BarcodeController {
|
|
|
107
107
|
return res.setBarcodeSource(id, null).then((result) => getEditorResponseData(result));
|
|
108
108
|
});
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
110
|
+
* This method enables/disables displaying the text of the barcode.
|
|
111
111
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
112
112
|
* @param enableText true if the text should be displayed, false otherwise.
|
|
113
113
|
* @returns
|
|
@@ -117,7 +117,7 @@ export class BarcodeController {
|
|
|
117
117
|
return this.setBarcodeProperties(id, properties);
|
|
118
118
|
});
|
|
119
119
|
/**
|
|
120
|
-
*
|
|
120
|
+
* This method sets the bar height for 1-dimensional barcodes.
|
|
121
121
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
122
122
|
* @param barHeight the height of the bars in the barcode. The string value will be calculated (f.e. 1+1 will result in 2)
|
|
123
123
|
* @returns
|
|
@@ -127,7 +127,7 @@ export class BarcodeController {
|
|
|
127
127
|
return this.setBarcodeProperties(id, properties);
|
|
128
128
|
});
|
|
129
129
|
/**
|
|
130
|
-
*
|
|
130
|
+
* This method sets the magnification for 1-dimensional barcodes.
|
|
131
131
|
* @param id the id of the barcodeFrame that needs to be updated.
|
|
132
132
|
* @param magnification the magnification of the barcode. This is a decimal value where 1 denotes 100%. (f.e. 1.5 will result in 150%)
|
|
133
133
|
* @returns
|
|
@@ -137,7 +137,7 @@ export class BarcodeController {
|
|
|
137
137
|
return this.setBarcodeProperties(id, properties);
|
|
138
138
|
});
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
140
|
+
* This method sets the quiet zone value of a specific barcode.
|
|
141
141
|
* @param id The id of the specific barcode frame
|
|
142
142
|
* @param value The quiet zone value
|
|
143
143
|
* @param position When defined will update the quiet value of a single position,
|
|
@@ -159,7 +159,7 @@ export class BarcodeController {
|
|
|
159
159
|
.then((result) => getEditorResponseData(result));
|
|
160
160
|
});
|
|
161
161
|
/**
|
|
162
|
-
*
|
|
162
|
+
* This method sets the combined state of the quiet zone values.
|
|
163
163
|
* @param id The id of the specific barcode frame
|
|
164
164
|
* @param value Whether the quiet zone values are combined
|
|
165
165
|
*/
|
|
@@ -171,7 +171,7 @@ export class BarcodeController {
|
|
|
171
171
|
.then((result) => getEditorResponseData(result));
|
|
172
172
|
});
|
|
173
173
|
/**
|
|
174
|
-
*
|
|
174
|
+
* This method sets the character set for the barcode.
|
|
175
175
|
* @param id The id of the specific barcode frame.
|
|
176
176
|
* @param errorCorrectionLevel The error correction level to set.
|
|
177
177
|
* @returns
|
|
@@ -183,7 +183,7 @@ export class BarcodeController {
|
|
|
183
183
|
.then((result) => getEditorResponseData(result));
|
|
184
184
|
});
|
|
185
185
|
/**
|
|
186
|
-
*
|
|
186
|
+
* This method sets the character set for the barcode.
|
|
187
187
|
* @param id The id of the specific barcode frame.
|
|
188
188
|
* @param characterSet The character set to set.
|
|
189
189
|
* @returns
|
|
@@ -195,7 +195,7 @@ export class BarcodeController {
|
|
|
195
195
|
.then((result) => getEditorResponseData(result));
|
|
196
196
|
});
|
|
197
197
|
/**
|
|
198
|
-
*
|
|
198
|
+
* This method sets the flag to render the end characters of the barcode. This is not
|
|
199
199
|
* supported for all barcode types.
|
|
200
200
|
* @param id The id of the specific barcode frame.
|
|
201
201
|
* @param drawLightMarginIndicator The flag indicating if the end characters should be drawn or not
|
|
@@ -206,7 +206,7 @@ export class BarcodeController {
|
|
|
206
206
|
return this.setBarcodeProperties(id, properties);
|
|
207
207
|
});
|
|
208
208
|
/**
|
|
209
|
-
*
|
|
209
|
+
* This method sets the flag to render the start and end characters of the barcode. This is not
|
|
210
210
|
* supported for all barcode types.
|
|
211
211
|
* @param id The id of the specific barcode frame.
|
|
212
212
|
* @param drawStartStopChars The flag indicating if the start and stop characters should be drawn or not
|
|
@@ -217,7 +217,7 @@ export class BarcodeController {
|
|
|
217
217
|
return this.setBarcodeProperties(id, properties);
|
|
218
218
|
});
|
|
219
219
|
/**
|
|
220
|
-
*
|
|
220
|
+
* This method returns the possible configuration options which are valid for the given barcode type.
|
|
221
221
|
* @param type the barcode type for which the configuration options are requested.
|
|
222
222
|
* @returns a BarcodeConfigurationOptions object
|
|
223
223
|
*/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EditorAPI, EditorResponse } from '../types/CommonTypes';
|
|
2
|
+
import { Component, ComponentConnectorCapabilities, ComponentPreviewType } from '../types/ComponentConnectorTypes';
|
|
3
|
+
import { ConnectorConfigOptions, MetaData, QueryOptions, QueryPage } from '../types/ConnectorTypes';
|
|
4
|
+
/**
|
|
5
|
+
* @experimental This controller is still experimental and might change in future releases.
|
|
6
|
+
*
|
|
7
|
+
* The ComponentConnectorController is responsible for all communication regarding Component connectors.
|
|
8
|
+
* Methods inside this controller can be called by `window.SDK.componentConnector.{method-name}`
|
|
9
|
+
*
|
|
10
|
+
* The way GraFx Studio handles different sources of Component is called 'ComponentConnector'.
|
|
11
|
+
* A ComponentConnector is an implementation of a set of capabilities we need
|
|
12
|
+
* to interact with a certain Component Asset Management system.
|
|
13
|
+
* In essence, a connector is the combination of a JavaScript snippet and some metadata.
|
|
14
|
+
* The JavaScript snippet is loaded in the studio engine using a sandboxed JavaScript execution engine (QuickJs).
|
|
15
|
+
* This allows us to execute the Component connector
|
|
16
|
+
* both on web using webassembly and on the server side during output generation.
|
|
17
|
+
* This controller is an interface to the running connector instance inside the studio engine.
|
|
18
|
+
*/
|
|
19
|
+
export declare class ComponentConnectorController {
|
|
20
|
+
#private;
|
|
21
|
+
/**
|
|
22
|
+
* @ignore
|
|
23
|
+
*/
|
|
24
|
+
constructor(editorAPI: EditorAPI);
|
|
25
|
+
/**
|
|
26
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
27
|
+
* Query a specific ComponentConnector for data using both standardized queryOptions and the dynamic
|
|
28
|
+
* context as parameters.
|
|
29
|
+
* @param connectorId unique id of the Component connector
|
|
30
|
+
* @param queryOptions query options
|
|
31
|
+
* @param context context that will be available in the connector script.
|
|
32
|
+
* @returns array of component instances
|
|
33
|
+
*/
|
|
34
|
+
query: (connectorId: string, queryOptions: QueryOptions, context?: MetaData) => Promise<EditorResponse<QueryPage<Component>>>;
|
|
35
|
+
/**
|
|
36
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
37
|
+
* The combination of a `connectorId` and `componentId` is typically enough for a Component connector to
|
|
38
|
+
* perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the
|
|
39
|
+
* Component connector instance running in the editor engine.
|
|
40
|
+
* @param connectorId unique id of the Component connector
|
|
41
|
+
* @param componentId unique id of the Component to download
|
|
42
|
+
* @param previewType hint to the Component connector about desired format of the Component preview
|
|
43
|
+
* @param context dynamic map of additional options potentially used by the connector
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
preview: (connectorId: string, componentId: string, previewType: ComponentPreviewType, context?: MetaData) => Promise<Uint8Array>;
|
|
47
|
+
/**
|
|
48
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
49
|
+
* All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This
|
|
50
|
+
* method allows you to discover which mappings are available for a given connector. If you want to use any of these
|
|
51
|
+
* mappings, they will be available in the `context` parameter of any connector method.
|
|
52
|
+
* @param connectorId unique id of the component connector
|
|
53
|
+
* @returns connector mappings
|
|
54
|
+
*/
|
|
55
|
+
getConfigurationOptions: (connectorId: string) => Promise<EditorResponse<ConnectorConfigOptions>>;
|
|
56
|
+
/**
|
|
57
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
58
|
+
* This method returns what capabilities the selected connector has. It gives an indication what methods can
|
|
59
|
+
* be used successfully for a certain connector.
|
|
60
|
+
* @param connectorId unique id of the component connector
|
|
61
|
+
* @returns ComponentConnectorCapabilities
|
|
62
|
+
*/
|
|
63
|
+
getCapabilities: (connectorId: string) => Promise<EditorResponse<ComponentConnectorCapabilities>>;
|
|
64
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
14
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
15
|
+
};
|
|
16
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
17
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
18
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
|
+
};
|
|
21
|
+
var _ComponentConnectorController_editorAPI, _ComponentConnectorController_blobAPI;
|
|
22
|
+
import { getEditorResponseData, throwEditorResponseError } from '../utils/EditorResponseData';
|
|
23
|
+
/**
|
|
24
|
+
* @experimental This controller is still experimental and might change in future releases.
|
|
25
|
+
*
|
|
26
|
+
* The ComponentConnectorController is responsible for all communication regarding Component connectors.
|
|
27
|
+
* Methods inside this controller can be called by `window.SDK.componentConnector.{method-name}`
|
|
28
|
+
*
|
|
29
|
+
* The way GraFx Studio handles different sources of Component is called 'ComponentConnector'.
|
|
30
|
+
* A ComponentConnector is an implementation of a set of capabilities we need
|
|
31
|
+
* to interact with a certain Component Asset Management system.
|
|
32
|
+
* In essence, a connector is the combination of a JavaScript snippet and some metadata.
|
|
33
|
+
* The JavaScript snippet is loaded in the studio engine using a sandboxed JavaScript execution engine (QuickJs).
|
|
34
|
+
* This allows us to execute the Component connector
|
|
35
|
+
* both on web using webassembly and on the server side during output generation.
|
|
36
|
+
* This controller is an interface to the running connector instance inside the studio engine.
|
|
37
|
+
*/
|
|
38
|
+
export class ComponentConnectorController {
|
|
39
|
+
/**
|
|
40
|
+
* @ignore
|
|
41
|
+
*/
|
|
42
|
+
constructor(editorAPI) {
|
|
43
|
+
/**
|
|
44
|
+
* @ignore
|
|
45
|
+
*/
|
|
46
|
+
_ComponentConnectorController_editorAPI.set(this, void 0);
|
|
47
|
+
_ComponentConnectorController_blobAPI.set(this, void 0);
|
|
48
|
+
/**
|
|
49
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
50
|
+
* Query a specific ComponentConnector for data using both standardized queryOptions and the dynamic
|
|
51
|
+
* context as parameters.
|
|
52
|
+
* @param connectorId unique id of the Component connector
|
|
53
|
+
* @param queryOptions query options
|
|
54
|
+
* @param context context that will be available in the connector script.
|
|
55
|
+
* @returns array of component instances
|
|
56
|
+
*/
|
|
57
|
+
this.query = (connectorId_1, queryOptions_1, ...args_1) => __awaiter(this, [connectorId_1, queryOptions_1, ...args_1], void 0, function* (connectorId, queryOptions, context = {}) {
|
|
58
|
+
const res = yield __classPrivateFieldGet(this, _ComponentConnectorController_editorAPI, "f");
|
|
59
|
+
return res
|
|
60
|
+
.componentConnectorQuery(connectorId, JSON.stringify(queryOptions), JSON.stringify(context))
|
|
61
|
+
.then((result) => getEditorResponseData(result));
|
|
62
|
+
});
|
|
63
|
+
/**
|
|
64
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
65
|
+
* The combination of a `connectorId` and `componentId` is typically enough for a Component connector to
|
|
66
|
+
* perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the
|
|
67
|
+
* Component connector instance running in the editor engine.
|
|
68
|
+
* @param connectorId unique id of the Component connector
|
|
69
|
+
* @param componentId unique id of the Component to download
|
|
70
|
+
* @param previewType hint to the Component connector about desired format of the Component preview
|
|
71
|
+
* @param context dynamic map of additional options potentially used by the connector
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
this.preview = (connectorId_1, componentId_1, previewType_1, ...args_1) => __awaiter(this, [connectorId_1, componentId_1, previewType_1, ...args_1], void 0, function* (connectorId, componentId, previewType, context = {}) {
|
|
75
|
+
const res = yield __classPrivateFieldGet(this, _ComponentConnectorController_blobAPI, "f");
|
|
76
|
+
return res
|
|
77
|
+
.componentConnectorPreview(connectorId, componentId, previewType, JSON.stringify(context))
|
|
78
|
+
.then((result) => {
|
|
79
|
+
// Handle binary data (Uint8Array) directly
|
|
80
|
+
if (result instanceof Uint8Array) {
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
// Handle structured response (EditorResponse) for non-success cases
|
|
84
|
+
if (typeof result === 'object' && result !== null && 'success' in result && !result.success) {
|
|
85
|
+
throwEditorResponseError(result);
|
|
86
|
+
}
|
|
87
|
+
// Unexpected response type - throw error
|
|
88
|
+
throw new Error(`Unexpected response type: ${typeof result}.`);
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
93
|
+
* All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This
|
|
94
|
+
* method allows you to discover which mappings are available for a given connector. If you want to use any of these
|
|
95
|
+
* mappings, they will be available in the `context` parameter of any connector method.
|
|
96
|
+
* @param connectorId unique id of the component connector
|
|
97
|
+
* @returns connector mappings
|
|
98
|
+
*/
|
|
99
|
+
this.getConfigurationOptions = (connectorId) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
const res = yield __classPrivateFieldGet(this, _ComponentConnectorController_editorAPI, "f");
|
|
101
|
+
return res
|
|
102
|
+
.componentConnectorGetConfigurationOptions(connectorId)
|
|
103
|
+
.then((result) => getEditorResponseData(result));
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* @experimental This method is still experimental and might change in future releases.
|
|
107
|
+
* This method returns what capabilities the selected connector has. It gives an indication what methods can
|
|
108
|
+
* be used successfully for a certain connector.
|
|
109
|
+
* @param connectorId unique id of the component connector
|
|
110
|
+
* @returns ComponentConnectorCapabilities
|
|
111
|
+
*/
|
|
112
|
+
this.getCapabilities = (connectorId) => __awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
const res = yield __classPrivateFieldGet(this, _ComponentConnectorController_editorAPI, "f");
|
|
114
|
+
return res
|
|
115
|
+
.componentConnectorGetCapabilities(connectorId)
|
|
116
|
+
.then((result) => getEditorResponseData(result));
|
|
117
|
+
});
|
|
118
|
+
__classPrivateFieldSet(this, _ComponentConnectorController_editorAPI, editorAPI, "f");
|
|
119
|
+
__classPrivateFieldSet(this, _ComponentConnectorController_blobAPI, editorAPI, "f");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
_ComponentConnectorController_editorAPI = new WeakMap(), _ComponentConnectorController_blobAPI = new WeakMap();
|
|
123
|
+
//# sourceMappingURL=ComponentConnectorController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComponentConnectorController.js","sourceRoot":"","sources":["../../../../src/controllers/ComponentConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAIA,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAE9F;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,4BAA4B;IAOrC;;OAEG;IACH,YAAY,SAAoB;QAThC;;WAEG;QACH,0DAAsB;QACtB,wDAAuB;QAUvB;;;;;;;;WAQG;QACH,UAAK,GAAG,2CAAgF,EAAE,gFAA3E,WAAmB,EAAE,YAA0B,EAAE,UAAoB,EAAE;YAClF,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,+CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,uBAAuB,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;iBAC3F,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAuB,MAAM,CAAC,CAAC,CAAC;QAC/E,CAAC,CAAA,CAAC;QAEF;;;;;;;;;;WAUG;QACH,YAAO,GAAG,yDAKa,EAAE,8FAJrB,WAAmB,EACnB,WAAmB,EACnB,WAAiC,EACjC,UAAoB,EAAE;YAEtB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,6CAAS,CAAC;YAChC,OAAO,GAAG;iBACL,yBAAyB,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;iBACzF,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;gBACb,2CAA2C;gBAC3C,IAAI,MAAM,YAAY,UAAU,EAAE,CAAC;oBAC/B,OAAO,MAAM,CAAC;gBAClB,CAAC;gBAED,oEAAoE;gBACpE,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,SAAS,IAAI,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;oBAC1F,wBAAwB,CAAC,MAA8B,CAAC,CAAC;gBAC7D,CAAC;gBAED,yCAAyC;gBACzC,MAAM,IAAI,KAAK,CAAC,6BAA6B,OAAO,MAAM,GAAG,CAAC,CAAC;YACnE,CAAC,CAAC,CAAC;QACX,CAAC,CAAA,CAAC;QAEF;;;;;;;WAOG;QACH,4BAAuB,GAAG,CAAO,WAAmB,EAAE,EAAE;YACpD,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,+CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,yCAAyC,CAAC,WAAW,CAAC;iBACtD,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAyB,MAAM,CAAC,CAAC,CAAC;QACjF,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACH,oBAAe,GAAG,CAAO,WAAmB,EAAE,EAAE;YAC5C,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,+CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,iCAAiC,CAAC,WAAW,CAAC;iBAC9C,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAiC,MAAM,CAAC,CAAC,CAAC;QACzF,CAAC,CAAA,CAAC;QAnFE,uBAAA,IAAI,2CAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,yCAAY,SAAuC,MAAA,CAAC;IAC5D,CAAC;CAkFJ"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { EditorAPI, Id } from '../types/CommonTypes';
|
|
2
|
+
import { Variable } from '../types/VariableTypes';
|
|
3
|
+
/**
|
|
4
|
+
* @experimental This controller is experimental and may change without warning.
|
|
5
|
+
* The ComponentController is responsible for all communication regarding Component frames.
|
|
6
|
+
* Methods inside this controller can be called by `window.SDK.component.{method-name}`
|
|
7
|
+
*/
|
|
8
|
+
export declare class ComponentController {
|
|
9
|
+
#private;
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
constructor(editorAPI: EditorAPI);
|
|
14
|
+
/**
|
|
15
|
+
* @experimental This method will link (or unlink) a variable from the template to the component frame
|
|
16
|
+
* @param id the id of the componentFrame that needs to be updated.
|
|
17
|
+
* @param target the id of the variable, inside the component, that will be linked (or unlinked) to the source variable.
|
|
18
|
+
* @param source the id of the source variable from the template. If not provided, the variable will be unlinked.
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
linkVariable: (frameId: Id, target: Id, source?: Id) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
22
|
+
/**
|
|
23
|
+
* This method returns the list of variables of a component frame.
|
|
24
|
+
* @param id the id of the componentFrame.
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
getComponentVariables: (frameId: Id) => Promise<import('../types/CommonTypes').EditorResponse<Variable[]>>;
|
|
28
|
+
}
|