@chili-publish/studio-sdk 0.123.0 → 0.133.2
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/README.md +1 -1
- package/_bundles/main.js +1 -1
- package/_bundles/main.js.map +1 -1
- package/_bundles/report.html +2 -2
- package/lib/editor-engine.json +1 -1
- package/lib/package.json +1 -1
- package/lib/src/controllers/ActionController.d.ts +33 -25
- package/lib/src/controllers/ActionController.js +42 -31
- package/lib/src/controllers/ActionController.js.map +1 -1
- package/lib/src/controllers/AnimationController.d.ts +24 -24
- package/lib/src/controllers/AnimationController.js +28 -28
- package/lib/src/controllers/AnimationController.js.map +1 -1
- package/lib/src/controllers/CanvasController.d.ts +3 -2
- package/lib/src/controllers/CanvasController.js +4 -3
- package/lib/src/controllers/CanvasController.js.map +1 -1
- package/lib/src/controllers/CharacterStyleController.d.ts +23 -23
- package/lib/src/controllers/CharacterStyleController.js +26 -26
- package/lib/src/controllers/CharacterStyleController.js.map +1 -1
- package/lib/src/controllers/ColorStyleController.d.ts +22 -22
- package/lib/src/controllers/ColorStyleController.js +27 -27
- package/lib/src/controllers/ColorStyleController.js.map +1 -1
- package/lib/src/controllers/ConfigurationController.d.ts +1 -1
- package/lib/src/controllers/ConfigurationController.js +1 -1
- package/lib/src/controllers/ConnectorController.d.ts +21 -12
- package/lib/src/controllers/ConnectorController.js +28 -19
- package/lib/src/controllers/ConnectorController.js.map +1 -1
- package/lib/src/controllers/DebugController.d.ts +2 -2
- package/lib/src/controllers/DebugController.js +2 -2
- package/lib/src/controllers/DebugController.js.map +1 -1
- package/lib/src/controllers/DocumentController.d.ts +6 -6
- package/lib/src/controllers/DocumentController.js +7 -7
- package/lib/src/controllers/DocumentController.js.map +1 -1
- package/lib/src/controllers/ExperimentController.d.ts +32 -7
- package/lib/src/controllers/ExperimentController.js +42 -9
- package/lib/src/controllers/ExperimentController.js.map +1 -1
- package/lib/src/controllers/FontConnectorController.d.ts +36 -28
- package/lib/src/controllers/FontConnectorController.js +45 -37
- package/lib/src/controllers/FontConnectorController.js.map +1 -1
- package/lib/src/controllers/FontController.d.ts +15 -15
- package/lib/src/controllers/FontController.js +18 -18
- package/lib/src/controllers/FontController.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +127 -127
- package/lib/src/controllers/FrameController.js +173 -173
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/LayoutController.d.ts +37 -37
- package/lib/src/controllers/LayoutController.js +48 -48
- package/lib/src/controllers/LayoutController.js.map +1 -1
- package/lib/src/controllers/MediaConnectorController.d.ts +33 -23
- package/lib/src/controllers/MediaConnectorController.js +41 -31
- package/lib/src/controllers/MediaConnectorController.js.map +1 -1
- package/lib/src/controllers/PageController.d.ts +11 -11
- package/lib/src/controllers/PageController.js +16 -16
- package/lib/src/controllers/PageController.js.map +1 -1
- package/lib/src/controllers/ParagraphStyleController.d.ts +20 -20
- package/lib/src/controllers/ParagraphStyleController.js +23 -23
- package/lib/src/controllers/ParagraphStyleController.js.map +1 -1
- package/lib/src/controllers/ShapeController.d.ts +28 -28
- package/lib/src/controllers/ShapeController.js +43 -43
- package/lib/src/controllers/ShapeController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.d.ts +18 -18
- package/lib/src/controllers/SubscriberController.js +24 -24
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/TextStyleController.d.ts +7 -7
- package/lib/src/controllers/TextStyleController.js +7 -7
- package/lib/src/controllers/TextStyleController.js.map +1 -1
- package/lib/src/controllers/ToolController.d.ts +10 -10
- package/lib/src/controllers/ToolController.js +9 -9
- package/lib/src/controllers/ToolController.js.map +1 -1
- package/lib/src/controllers/UtilsController.d.ts +10 -4
- package/lib/src/controllers/UtilsController.js +10 -4
- package/lib/src/controllers/UtilsController.js.map +1 -1
- package/lib/src/controllers/VariableController.d.ts +78 -34
- package/lib/src/controllers/VariableController.js +106 -53
- package/lib/src/controllers/VariableController.js.map +1 -1
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.js +5 -4
- package/lib/src/index.js.map +1 -1
- package/lib/src/interactions/connector.d.ts +4 -3
- package/lib/src/interactions/connector.js +7 -3
- package/lib/src/interactions/connector.js.map +1 -1
- package/lib/src/tests/__mocks__/FrameProperties.d.ts +2 -2
- package/lib/src/tests/__mocks__/FrameProperties.js +2 -2
- package/lib/src/tests/__mocks__/FrameProperties.js.map +1 -1
- package/lib/src/tests/__mocks__/MockImageFrameSource.js +5 -5
- package/lib/src/tests/__mocks__/MockImageFrameSource.js.map +1 -1
- package/lib/src/tests/__mocks__/animations.js +1 -1
- package/lib/src/tests/__mocks__/animations.js.map +1 -1
- package/lib/src/tests/__mocks__/mockDocument.d.ts +1 -1
- package/lib/src/tests/__mocks__/mockDocument.js +1 -1
- package/lib/src/tests/__mocks__/mockDocument.js.map +1 -1
- package/lib/src/tests/controllers/ActionController.test.js +18 -9
- package/lib/src/tests/controllers/ActionController.test.js.map +1 -1
- package/lib/src/tests/controllers/AnimationController.test.js +14 -14
- package/lib/src/tests/controllers/AnimationController.test.js.map +1 -1
- package/lib/src/tests/controllers/CharacterStyleController.test.js +11 -11
- package/lib/src/tests/controllers/CharacterStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ColorStyleController.test.js +17 -17
- package/lib/src/tests/controllers/ColorStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ConnectorController.test.js +6 -6
- package/lib/src/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/DebugController.test.js +1 -1
- package/lib/src/tests/controllers/DebugController.test.js.map +1 -1
- package/lib/src/tests/controllers/DocumentController.test.js +6 -6
- package/lib/src/tests/controllers/DocumentController.test.js.map +1 -1
- package/lib/src/tests/controllers/ExperimentController.test.js +29 -1
- package/lib/src/tests/controllers/ExperimentController.test.js.map +1 -1
- package/lib/src/tests/controllers/FontConnectorController.test.js +11 -11
- package/lib/src/tests/controllers/FontController.test.js +11 -11
- package/lib/src/tests/controllers/FontController.test.js.map +1 -1
- package/lib/src/tests/controllers/FrameController.test.js +113 -113
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/LayoutController.test.js +25 -27
- package/lib/src/tests/controllers/LayoutController.test.js.map +1 -1
- package/lib/src/tests/controllers/MediaConnectorController.test.js +1 -1
- package/lib/src/tests/controllers/PageController.test.js +11 -11
- package/lib/src/tests/controllers/PageController.test.js.map +1 -1
- package/lib/src/tests/controllers/ParagraphStyleController.test.js +12 -12
- package/lib/src/tests/controllers/ParagraphStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ShapeController.test.js +26 -26
- package/lib/src/tests/controllers/ShapeController.test.js.map +1 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.js +7 -7
- package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/tests/controllers/TextStyleController.test.js +6 -6
- package/lib/src/tests/controllers/TextStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ToolController.test.js +9 -9
- package/lib/src/tests/controllers/ToolController.test.js.map +1 -1
- package/lib/src/tests/controllers/UtilsController.test.js +20 -0
- package/lib/src/tests/controllers/UtilsController.test.js.map +1 -1
- package/lib/src/tests/controllers/VariableController.test.js +62 -31
- package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/tests/interactions/connector.test.js +14 -0
- package/lib/src/tests/interactions/connector.test.js.map +1 -1
- package/lib/src/tests/utils/getClaculatedValue.test.js +2 -2
- package/lib/src/tests/utils/getClaculatedValue.test.js.map +1 -1
- package/lib/src/types/ActionTypes.d.ts +3 -3
- package/lib/src/types/AnimationTypes.d.ts +3 -3
- package/lib/src/types/CharacterStyleTypes.d.ts +2 -1
- package/lib/src/types/ColorStyleTypes.d.ts +8 -7
- package/lib/src/types/ColorStyleTypes.js +1 -1
- package/lib/src/types/ColorStyleTypes.js.map +1 -1
- package/lib/src/types/CommonTypes.d.ts +7 -5
- package/lib/src/types/ConfigurationTypes.d.ts +3 -0
- package/lib/src/types/ConnectorTypes.d.ts +5 -4
- package/lib/src/types/ConnectorTypes.js.map +1 -1
- package/lib/src/types/DocumentTypes.d.ts +23 -25
- package/lib/src/types/DocumentTypes.js.map +1 -1
- package/lib/src/types/FontConnectorTypes.d.ts +2 -1
- package/lib/src/types/FontConnectorTypes.js.map +1 -1
- package/lib/src/types/FontTypes.d.ts +5 -4
- package/lib/src/types/FrameTypes.d.ts +20 -20
- package/lib/src/types/LayoutTypes.d.ts +14 -14
- package/lib/src/types/LayoutTypes.js.map +1 -1
- package/lib/src/types/MediaConnectorTypes.d.ts +2 -1
- package/lib/src/types/MediaConnectorTypes.js.map +1 -1
- package/lib/src/types/PageTypes.d.ts +3 -3
- package/lib/src/types/ParagraphStyleTypes.d.ts +6 -5
- package/lib/src/types/TextStyleTypes.d.ts +5 -5
- package/lib/src/types/TextStyleTypes.js +1 -1
- package/lib/src/types/TextStyleTypes.js.map +1 -1
- package/lib/src/types/TextTypes.d.ts +4 -0
- package/lib/src/types/TextTypes.js +6 -0
- package/lib/src/types/TextTypes.js.map +1 -0
- package/lib/src/types/VariableTypes.d.ts +12 -11
- package/lib/src/types/VariableTypes.js +3 -2
- package/lib/src/types/VariableTypes.js.map +1 -1
- package/lib/src/utils/enums.d.ts +8 -3
- package/lib/src/utils/enums.js +19 -13
- package/lib/src/utils/enums.js.map +1 -1
- package/lib/src/utils/getCalculatedValue.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorAPI, Id } from '../types/CommonTypes';
|
|
2
|
+
import { TextType } from '../types/TextTypes';
|
|
2
3
|
/**
|
|
3
4
|
* The ExperimentController contains all SDK functions that are considered for addition,
|
|
4
5
|
* or functions we want to keep open for changing definitions. This is a sneak peak
|
|
@@ -13,27 +14,51 @@ export declare class ExperimentController {
|
|
|
13
14
|
constructor(editorAPI: EditorAPI);
|
|
14
15
|
/**
|
|
15
16
|
* This method will assign an image from a variable to the correct ImageFrame
|
|
16
|
-
* @param imageFrameId
|
|
17
|
-
* @param variableId
|
|
17
|
+
* @param imageFrameId the id of the imageFrame where an image needs to be assigned to
|
|
18
|
+
* @param variableId the id of the variable which contains the image
|
|
18
19
|
* @returns
|
|
19
20
|
*/
|
|
20
|
-
insertImageVariableToFrame: (imageFrameId: Id, variableId:
|
|
21
|
+
insertImageVariableToFrame: (imageFrameId: Id, variableId: Id) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
21
22
|
/**
|
|
22
23
|
* This method will insert a text variable in the selected frame. Calling this method
|
|
23
24
|
* requires that the selected frame is in text editing mode.
|
|
24
|
-
* @param
|
|
25
|
+
* @param id the id of the variable to be inserted.
|
|
25
26
|
* @returns
|
|
26
27
|
*/
|
|
27
|
-
insertTextVariable: (
|
|
28
|
+
insertTextVariable: (id: Id) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
28
29
|
/**
|
|
29
30
|
* This method will enter text editing mode on the provided frame.
|
|
30
|
-
* @param
|
|
31
|
+
* @param id the id frame to enter text edit mode on.
|
|
31
32
|
* @returns
|
|
32
33
|
*/
|
|
33
|
-
enterTextEditMode: (
|
|
34
|
+
enterTextEditMode: (id: Id) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
34
35
|
/**
|
|
35
36
|
* This method will exit text editing mode.
|
|
36
37
|
* @returns
|
|
37
38
|
*/
|
|
38
39
|
exitTextEditMode: () => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
40
|
+
/**
|
|
41
|
+
* This method gets the text content of a text frame.
|
|
42
|
+
* The variables contained in the text will return their values only if you
|
|
43
|
+
* are in text editing mode.
|
|
44
|
+
* @param frameId The ID of a text frame
|
|
45
|
+
* @param textType The type of the text
|
|
46
|
+
* @returns the text content
|
|
47
|
+
*/
|
|
48
|
+
getText: (frameId: string, textType: TextType) => Promise<import("../types/CommonTypes").EditorResponse<string>>;
|
|
49
|
+
/**
|
|
50
|
+
* This method sets the text content of a text frame
|
|
51
|
+
* @param frameId The ID of a text frame
|
|
52
|
+
* @param text The new text content
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
setText: (frameId: string, text: string) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
56
|
+
/**
|
|
57
|
+
* This method selects the text content of a text frame
|
|
58
|
+
* @param frameId The ID of a text frame
|
|
59
|
+
* @param startIndex The index where the selection starts
|
|
60
|
+
* @param length The length of selection from startIndex
|
|
61
|
+
* @returns
|
|
62
|
+
*/
|
|
63
|
+
selectText: (frameId: string, startIndex: number, length: number) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
39
64
|
}
|
|
@@ -38,13 +38,13 @@ export class ExperimentController {
|
|
|
38
38
|
_ExperimentController_editorAPI.set(this, void 0);
|
|
39
39
|
/**
|
|
40
40
|
* This method will assign an image from a variable to the correct ImageFrame
|
|
41
|
-
* @param imageFrameId
|
|
42
|
-
* @param variableId
|
|
41
|
+
* @param imageFrameId the id of the imageFrame where an image needs to be assigned to
|
|
42
|
+
* @param variableId the id of the variable which contains the image
|
|
43
43
|
* @returns
|
|
44
44
|
*/
|
|
45
45
|
this.insertImageVariableToFrame = (imageFrameId, variableId) => __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
const res = yield __classPrivateFieldGet(this, _ExperimentController_editorAPI, "f");
|
|
47
|
-
const src = {
|
|
47
|
+
const src = { id: variableId, type: ImageSourceTypeEnum.variable };
|
|
48
48
|
return res
|
|
49
49
|
.setImageSource(imageFrameId, JSON.stringify(src))
|
|
50
50
|
.then((result) => getEditorResponseData(result));
|
|
@@ -52,21 +52,21 @@ export class ExperimentController {
|
|
|
52
52
|
/**
|
|
53
53
|
* This method will insert a text variable in the selected frame. Calling this method
|
|
54
54
|
* requires that the selected frame is in text editing mode.
|
|
55
|
-
* @param
|
|
55
|
+
* @param id the id of the variable to be inserted.
|
|
56
56
|
* @returns
|
|
57
57
|
*/
|
|
58
|
-
this.insertTextVariable = (
|
|
58
|
+
this.insertTextVariable = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
59
59
|
const res = yield __classPrivateFieldGet(this, _ExperimentController_editorAPI, "f");
|
|
60
|
-
return res.insertTextVariable(
|
|
60
|
+
return res.insertTextVariable(id).then((result) => getEditorResponseData(result));
|
|
61
61
|
});
|
|
62
62
|
/**
|
|
63
63
|
* This method will enter text editing mode on the provided frame.
|
|
64
|
-
* @param
|
|
64
|
+
* @param id the id frame to enter text edit mode on.
|
|
65
65
|
* @returns
|
|
66
66
|
*/
|
|
67
|
-
this.enterTextEditMode = (
|
|
67
|
+
this.enterTextEditMode = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
68
68
|
const res = yield __classPrivateFieldGet(this, _ExperimentController_editorAPI, "f");
|
|
69
|
-
return res.enterTextEditMode(
|
|
69
|
+
return res.enterTextEditMode(id).then((result) => getEditorResponseData(result));
|
|
70
70
|
});
|
|
71
71
|
/**
|
|
72
72
|
* This method will exit text editing mode.
|
|
@@ -76,6 +76,39 @@ export class ExperimentController {
|
|
|
76
76
|
const res = yield __classPrivateFieldGet(this, _ExperimentController_editorAPI, "f");
|
|
77
77
|
return res.exitTextEditMode().then((result) => getEditorResponseData(result));
|
|
78
78
|
});
|
|
79
|
+
/**
|
|
80
|
+
* This method gets the text content of a text frame.
|
|
81
|
+
* The variables contained in the text will return their values only if you
|
|
82
|
+
* are in text editing mode.
|
|
83
|
+
* @param frameId The ID of a text frame
|
|
84
|
+
* @param textType The type of the text
|
|
85
|
+
* @returns the text content
|
|
86
|
+
*/
|
|
87
|
+
this.getText = (frameId, textType) => __awaiter(this, void 0, void 0, function* () {
|
|
88
|
+
const res = yield __classPrivateFieldGet(this, _ExperimentController_editorAPI, "f");
|
|
89
|
+
return res.getTextByFrameId(frameId, textType).then((result) => getEditorResponseData(result));
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* This method sets the text content of a text frame
|
|
93
|
+
* @param frameId The ID of a text frame
|
|
94
|
+
* @param text The new text content
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
this.setText = (frameId, text) => __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
const res = yield __classPrivateFieldGet(this, _ExperimentController_editorAPI, "f");
|
|
99
|
+
return res.setTextByFrameId(frameId, text).then((result) => getEditorResponseData(result));
|
|
100
|
+
});
|
|
101
|
+
/**
|
|
102
|
+
* This method selects the text content of a text frame
|
|
103
|
+
* @param frameId The ID of a text frame
|
|
104
|
+
* @param startIndex The index where the selection starts
|
|
105
|
+
* @param length The length of selection from startIndex
|
|
106
|
+
* @returns
|
|
107
|
+
*/
|
|
108
|
+
this.selectText = (frameId, startIndex, length) => __awaiter(this, void 0, void 0, function* () {
|
|
109
|
+
const res = yield __classPrivateFieldGet(this, _ExperimentController_editorAPI, "f");
|
|
110
|
+
return res.selectTextById(frameId, startIndex, length).then((result) => getEditorResponseData(result));
|
|
111
|
+
});
|
|
79
112
|
__classPrivateFieldSet(this, _ExperimentController_editorAPI, editorAPI, "f");
|
|
80
113
|
}
|
|
81
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExperimentController.js","sourceRoot":"","sources":["../../../src/controllers/ExperimentController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAA4B,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExperimentController.js","sourceRoot":"","sources":["../../../src/controllers/ExperimentController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAA4B,MAAM,qBAAqB,CAAC;AAGpF;;;;;GAKG;AACH,MAAM,OAAO,oBAAoB;IAM7B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,kDAAsB;QAStB;;;;;WAKG;QACH,+BAA0B,GAAG,CAAO,YAAgB,E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AAO,OAAe,EAAE,QAAkB,EAAE,EAAE;YACpD,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,uCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAS,MAAM,CAAC,CAAC,CAAC;QAC3G,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACH,YAAO,GAAG,CAAO,OAAe,EAAE,IAAY,EAAE,EAAE;YAC9C,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,uCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACrG,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACH,eAAU,GAAG,CAAO,OAAe,EAAE,UAAkB,EAAE,MAAc,EAAE,EAAE;YACvE,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,uCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,cAAc,CAAC,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACjH,CAAC,CAAA,CAAC;QAjFE,uBAAA,IAAI,mCAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CAiFJ"}
|
|
@@ -22,74 +22,82 @@ export declare class FontConnectorController {
|
|
|
22
22
|
/**
|
|
23
23
|
* Query a specific FontConnector for data using both standardized queryOptions and the dynamic
|
|
24
24
|
* context as parameters. This call returns an array of Font items.
|
|
25
|
-
* @param
|
|
25
|
+
* @param id unique id of the Font connector
|
|
26
26
|
* @param queryOptions stringified instance of `QueryOptions`
|
|
27
27
|
* @param context stringified `Map<string, string>` of dynamic options
|
|
28
|
+
* @returns array of font items
|
|
28
29
|
*/
|
|
29
|
-
query: (
|
|
30
|
+
query: (id: string, queryOptions: QueryOptions, context: MetaData) => Promise<EditorResponse<QueryPage<Font>>>;
|
|
30
31
|
/**
|
|
31
|
-
* Returns a single font using a specific FontConnector.
|
|
32
|
-
*
|
|
33
|
-
* The connector needs to list `detail` as a supported capability.
|
|
34
|
-
* @param connectorId unique Id of the Font connector
|
|
32
|
+
* Returns a single font using a specific FontConnector. The connector needs to list `detail` as a supported capability.
|
|
33
|
+
* @param id unique id of the Font connector
|
|
35
34
|
* @param fontId unique id of the Font
|
|
35
|
+
* @returns font details
|
|
36
36
|
*/
|
|
37
|
-
detail: (
|
|
37
|
+
detail: (id: string, fontId: string) => Promise<EditorResponse<Font>>;
|
|
38
38
|
/**
|
|
39
|
-
* The combination of a `connectorId` and `
|
|
39
|
+
* The combination of a `connectorId` and `fontId` is typically enough for a Font connector to
|
|
40
40
|
* perform the download of this asset. The `download` endpoint is capable of relaying this information to the
|
|
41
41
|
* Font connector instance running in the editor engine.
|
|
42
|
-
* @param
|
|
43
|
-
* @param
|
|
42
|
+
* @param id unique id of the Font connector
|
|
43
|
+
* @param fontId unique id of the Font to download
|
|
44
44
|
* @param downloadType hint to the Font connector about desired quality of the downloaded Font
|
|
45
45
|
* @param context dynamic map of additional options potentially used by the connector
|
|
46
|
+
* @returns
|
|
46
47
|
*/
|
|
47
|
-
download: (
|
|
48
|
+
download: (id: string, fontId: string, downloadType: FontDownloadType, context: MetaData) => Promise<Uint8Array>;
|
|
48
49
|
/**
|
|
49
50
|
* Depending on the connector capabilities, this api method allows you to upload new Font to the
|
|
50
51
|
* connector's backend.
|
|
51
|
-
* @param
|
|
52
|
-
* @param
|
|
52
|
+
* @param id unique id of the Font connector
|
|
53
|
+
* @param fontId unique id of the Font to upload
|
|
53
54
|
* @param blob byte array representation of the Font to upload
|
|
55
|
+
* @returns
|
|
54
56
|
*/
|
|
55
|
-
upload: (
|
|
57
|
+
upload: (id: string, fontId: string, blob: Uint8Array) => Promise<EditorResponse<null>>;
|
|
56
58
|
/**
|
|
57
|
-
* Depending on the connector capabilities, removes Font identified by `
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
59
|
+
* Depending on the connector capabilities, removes Font identified by `fontId` from the connector's backend storage
|
|
60
|
+
* @param id unique id of the Font connector
|
|
61
|
+
* @param fontId unique id of the Font to download
|
|
62
|
+
* @returns
|
|
60
63
|
*/
|
|
61
|
-
remove: (
|
|
64
|
+
remove: (id: string, fontId: string) => Promise<EditorResponse<null>>;
|
|
62
65
|
/**
|
|
63
|
-
* Depending on the connector capabilities, copies Font identified by `
|
|
66
|
+
* Depending on the connector capabilities, copies Font identified by `fontId` to a new Font item on the
|
|
64
67
|
* connector's backend
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
68
|
+
* @param id unique id of the Font connector
|
|
69
|
+
* @param fontId unique id of the Font to download
|
|
67
70
|
* @param newName name of the copied Font on the connector's backend
|
|
71
|
+
* @returns
|
|
68
72
|
*/
|
|
69
|
-
copy: (
|
|
73
|
+
copy: (id: string, fontId: string, newName: string) => Promise<EditorResponse<null>>;
|
|
70
74
|
/**
|
|
71
75
|
* All connectors have a certain set of queryOptions they allow to be passed in the query context. This
|
|
72
76
|
* method allows you to discover what options are available for a given connector. If you want to use any of these
|
|
73
77
|
* options, they need to be passed in the `context` parameter of the `query` api method.
|
|
74
|
-
* @param
|
|
78
|
+
* @param id unique id of the Font connector
|
|
79
|
+
* @returns query options
|
|
75
80
|
*/
|
|
76
|
-
getQueryOptions: (
|
|
81
|
+
getQueryOptions: (id: string) => Promise<EditorResponse<ConnectorOptions>>;
|
|
77
82
|
/**
|
|
78
83
|
* All connectors have a certain set of downloadOptions they allow to be passed in the download context. This
|
|
79
84
|
* method allows you to discover what options are available for a given connector. If you want to use any of these
|
|
80
85
|
* options, they need to be passed in the `context` parameter of the `download` api method.
|
|
81
|
-
* @param
|
|
86
|
+
* @param id unique id of the Font connector
|
|
87
|
+
* @returns download options
|
|
82
88
|
*/
|
|
83
|
-
getDownloadOptions: (
|
|
89
|
+
getDownloadOptions: (id: string) => Promise<EditorResponse<ConnectorOptions>>;
|
|
84
90
|
/**
|
|
85
91
|
* This method returns what capabilities the selected connector has. It gives an indication what methods can
|
|
86
92
|
* be used successfully for a certain connector.
|
|
87
|
-
* @param
|
|
93
|
+
* @param id unique id of the Font connector
|
|
94
|
+
* @returns connector capabilities
|
|
88
95
|
*/
|
|
89
|
-
getCapabilities: (
|
|
96
|
+
getCapabilities: (id: string) => Promise<EditorResponse<ConnectorCapabilities>>;
|
|
90
97
|
/**
|
|
91
98
|
* This method will parse the deprecatedFontType to the new Font type. This method will be removed once the deprecatedFontType is out of use
|
|
92
99
|
* @param deprecatedType is 0 or 1
|
|
100
|
+
* @returns MediaType value
|
|
93
101
|
*/
|
|
94
102
|
parseDeprecatedFontType: (deprecatedType: DeprecatedMediaType) => MediaType | undefined;
|
|
95
103
|
}
|
|
@@ -46,113 +46,121 @@ export class FontConnectorController {
|
|
|
46
46
|
/**
|
|
47
47
|
* Query a specific FontConnector for data using both standardized queryOptions and the dynamic
|
|
48
48
|
* context as parameters. This call returns an array of Font items.
|
|
49
|
-
* @param
|
|
49
|
+
* @param id unique id of the Font connector
|
|
50
50
|
* @param queryOptions stringified instance of `QueryOptions`
|
|
51
51
|
* @param context stringified `Map<string, string>` of dynamic options
|
|
52
|
+
* @returns array of font items
|
|
52
53
|
*/
|
|
53
|
-
this.query = (
|
|
54
|
+
this.query = (id, queryOptions, context) => __awaiter(this, void 0, void 0, function* () {
|
|
54
55
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
55
56
|
return res
|
|
56
|
-
.fontConnectorQuery(
|
|
57
|
+
.fontConnectorQuery(id, JSON.stringify(queryOptions), JSON.stringify(context))
|
|
57
58
|
.then((result) => getEditorResponseData(result));
|
|
58
59
|
});
|
|
59
60
|
/**
|
|
60
|
-
* Returns a single font using a specific FontConnector.
|
|
61
|
-
*
|
|
62
|
-
* The connector needs to list `detail` as a supported capability.
|
|
63
|
-
* @param connectorId unique Id of the Font connector
|
|
61
|
+
* Returns a single font using a specific FontConnector. The connector needs to list `detail` as a supported capability.
|
|
62
|
+
* @param id unique id of the Font connector
|
|
64
63
|
* @param fontId unique id of the Font
|
|
64
|
+
* @returns font details
|
|
65
65
|
*/
|
|
66
|
-
this.detail = (
|
|
66
|
+
this.detail = (id, fontId) => __awaiter(this, void 0, void 0, function* () {
|
|
67
67
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
68
|
-
return res.fontConnectorDetail(
|
|
68
|
+
return res.fontConnectorDetail(id, fontId).then((result) => getEditorResponseData(result));
|
|
69
69
|
});
|
|
70
70
|
/**
|
|
71
|
-
* The combination of a `connectorId` and `
|
|
71
|
+
* The combination of a `connectorId` and `fontId` is typically enough for a Font connector to
|
|
72
72
|
* perform the download of this asset. The `download` endpoint is capable of relaying this information to the
|
|
73
73
|
* Font connector instance running in the editor engine.
|
|
74
|
-
* @param
|
|
75
|
-
* @param
|
|
74
|
+
* @param id unique id of the Font connector
|
|
75
|
+
* @param fontId unique id of the Font to download
|
|
76
76
|
* @param downloadType hint to the Font connector about desired quality of the downloaded Font
|
|
77
77
|
* @param context dynamic map of additional options potentially used by the connector
|
|
78
|
+
* @returns
|
|
78
79
|
*/
|
|
79
|
-
this.download = (
|
|
80
|
+
this.download = (id, fontId, downloadType, context) => __awaiter(this, void 0, void 0, function* () {
|
|
80
81
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_blobAPI, "f");
|
|
81
82
|
return res
|
|
82
|
-
.fontConnectorDownload(
|
|
83
|
+
.fontConnectorDownload(id, fontId, downloadType, JSON.stringify(context))
|
|
83
84
|
.then((result) => { var _a; return (_a = result) !== null && _a !== void 0 ? _a : result; });
|
|
84
85
|
});
|
|
85
86
|
/**
|
|
86
87
|
* Depending on the connector capabilities, this api method allows you to upload new Font to the
|
|
87
88
|
* connector's backend.
|
|
88
|
-
* @param
|
|
89
|
-
* @param
|
|
89
|
+
* @param id unique id of the Font connector
|
|
90
|
+
* @param fontId unique id of the Font to upload
|
|
90
91
|
* @param blob byte array representation of the Font to upload
|
|
92
|
+
* @returns
|
|
91
93
|
*/
|
|
92
|
-
this.upload = (
|
|
94
|
+
this.upload = (id, fontId, blob) => __awaiter(this, void 0, void 0, function* () {
|
|
93
95
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
94
|
-
return res.fontConnectorUpload(
|
|
96
|
+
return res.fontConnectorUpload(id, fontId, blob).then((result) => getEditorResponseData(result));
|
|
95
97
|
});
|
|
96
98
|
/**
|
|
97
|
-
* Depending on the connector capabilities, removes Font identified by `
|
|
98
|
-
* @param
|
|
99
|
-
* @param
|
|
99
|
+
* Depending on the connector capabilities, removes Font identified by `fontId` from the connector's backend storage
|
|
100
|
+
* @param id unique id of the Font connector
|
|
101
|
+
* @param fontId unique id of the Font to download
|
|
102
|
+
* @returns
|
|
100
103
|
*/
|
|
101
|
-
this.remove = (
|
|
104
|
+
this.remove = (id, fontId) => __awaiter(this, void 0, void 0, function* () {
|
|
102
105
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
103
|
-
return res.fontConnectorRemove(
|
|
106
|
+
return res.fontConnectorRemove(id, fontId).then((result) => getEditorResponseData(result));
|
|
104
107
|
});
|
|
105
108
|
/**
|
|
106
|
-
* Depending on the connector capabilities, copies Font identified by `
|
|
109
|
+
* Depending on the connector capabilities, copies Font identified by `fontId` to a new Font item on the
|
|
107
110
|
* connector's backend
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
111
|
+
* @param id unique id of the Font connector
|
|
112
|
+
* @param fontId unique id of the Font to download
|
|
110
113
|
* @param newName name of the copied Font on the connector's backend
|
|
114
|
+
* @returns
|
|
111
115
|
*/
|
|
112
|
-
this.copy = (
|
|
116
|
+
this.copy = (id, fontId, newName) => __awaiter(this, void 0, void 0, function* () {
|
|
113
117
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
114
118
|
return res
|
|
115
|
-
.fontConnectorCopy(
|
|
119
|
+
.fontConnectorCopy(id, fontId, newName)
|
|
116
120
|
.then((result) => getEditorResponseData(result));
|
|
117
121
|
});
|
|
118
122
|
/**
|
|
119
123
|
* All connectors have a certain set of queryOptions they allow to be passed in the query context. This
|
|
120
124
|
* method allows you to discover what options are available for a given connector. If you want to use any of these
|
|
121
125
|
* options, they need to be passed in the `context` parameter of the `query` api method.
|
|
122
|
-
* @param
|
|
126
|
+
* @param id unique id of the Font connector
|
|
127
|
+
* @returns query options
|
|
123
128
|
*/
|
|
124
|
-
this.getQueryOptions = (
|
|
129
|
+
this.getQueryOptions = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
125
130
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
126
131
|
return res
|
|
127
|
-
.fontConnectorGetQueryOptions(
|
|
132
|
+
.fontConnectorGetQueryOptions(id)
|
|
128
133
|
.then((result) => getEditorResponseData(result));
|
|
129
134
|
});
|
|
130
135
|
/**
|
|
131
136
|
* All connectors have a certain set of downloadOptions they allow to be passed in the download context. This
|
|
132
137
|
* method allows you to discover what options are available for a given connector. If you want to use any of these
|
|
133
138
|
* options, they need to be passed in the `context` parameter of the `download` api method.
|
|
134
|
-
* @param
|
|
139
|
+
* @param id unique id of the Font connector
|
|
140
|
+
* @returns download options
|
|
135
141
|
*/
|
|
136
|
-
this.getDownloadOptions = (
|
|
142
|
+
this.getDownloadOptions = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
137
143
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
138
144
|
return res
|
|
139
|
-
.fontConnectorGetDownloadOptions(
|
|
145
|
+
.fontConnectorGetDownloadOptions(id)
|
|
140
146
|
.then((result) => getEditorResponseData(result));
|
|
141
147
|
});
|
|
142
148
|
/**
|
|
143
149
|
* This method returns what capabilities the selected connector has. It gives an indication what methods can
|
|
144
150
|
* be used successfully for a certain connector.
|
|
145
|
-
* @param
|
|
151
|
+
* @param id unique id of the Font connector
|
|
152
|
+
* @returns connector capabilities
|
|
146
153
|
*/
|
|
147
|
-
this.getCapabilities = (
|
|
154
|
+
this.getCapabilities = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
148
155
|
const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
|
|
149
156
|
return res
|
|
150
|
-
.fontConnectorGetCapabilities(
|
|
157
|
+
.fontConnectorGetCapabilities(id)
|
|
151
158
|
.then((result) => getEditorResponseData(result));
|
|
152
159
|
});
|
|
153
160
|
/**
|
|
154
161
|
* This method will parse the deprecatedFontType to the new Font type. This method will be removed once the deprecatedFontType is out of use
|
|
155
162
|
* @param deprecatedType is 0 or 1
|
|
163
|
+
* @returns MediaType value
|
|
156
164
|
*/
|
|
157
165
|
this.parseDeprecatedFontType = (deprecatedType) => {
|
|
158
166
|
if (deprecatedType === DeprecatedMediaType.file)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FontConnectorController.js","sourceRoot":"","sources":["../../../src/controllers/FontConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACH,mBAAmB,EAEnB,SAAS,GAGZ,MAAM,yBAAyB,CAAC;AAIjC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,uBAAuB;IAOhC;;OAEG;IACH,YAAY,SAAoB;QAThC;;WAEG;QACH,qDAAsB;QACtB,mDAAuB;QAUvB
|
|
1
|
+
{"version":3,"file":"FontConnectorController.js","sourceRoot":"","sources":["../../../src/controllers/FontConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACH,mBAAmB,EAEnB,SAAS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;QAC3E,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACH,uBAAkB,GAAG,CAAO,EAAU,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,0CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,+BAA+B,CAAC,EAAE,CAAC;iBACnC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAmB,MAAM,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACH,oBAAe,GAAG,CAAO,EAAU,EAAE,EAAE;YACnC,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,0CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,4BAA4B,CAAC,EAAE,CAAC;iBAChC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAwB,MAAM,CAAC,CAAC,CAAC;QAChF,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACH,4BAAuB,GAAG,CAAC,cAAmC,EAAE,EAAE;YAC9D,IAAI,cAAc,KAAK,mBAAmB,CAAC,IAAI;gBAAE,OAAO,SAAS,CAAC,IAAI,CAAC;YACvE,IAAI,cAAc,KAAK,mBAAmB,CAAC,UAAU;gBAAE,OAAO,SAAS,CAAC,UAAU,CAAC;QACvF,CAAC,CAAC;QA5IE,uBAAA,IAAI,sCAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,oCAAY,SAAuC,MAAA,CAAC;IAC5D,CAAC;CA2IJ"}
|
|
@@ -12,39 +12,39 @@ export declare class FontController {
|
|
|
12
12
|
constructor(editorAPI: EditorAPI);
|
|
13
13
|
/**
|
|
14
14
|
* This method returns the list of fonts
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns list of all fonts
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
getAll: () => Promise<import("../types/CommonTypes").EditorResponse<DocumentFont[]>>;
|
|
18
18
|
/**
|
|
19
19
|
* This method returns a font by id
|
|
20
|
-
* @param
|
|
21
|
-
* @returns
|
|
20
|
+
* @param id the id of a specific font
|
|
21
|
+
* @returns font properties
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
getById: (id: Id) => Promise<import("../types/CommonTypes").EditorResponse<DocumentFont>>;
|
|
24
24
|
/**
|
|
25
25
|
* This method returns the default font.
|
|
26
26
|
* Be aware that the default font will not change during the entire lifetime of the SDK session.
|
|
27
27
|
* It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.
|
|
28
|
-
* @returns
|
|
28
|
+
* @returns font properties
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
getDefault: () => Promise<import("../types/CommonTypes").EditorResponse<DocumentFont>>;
|
|
31
31
|
/**
|
|
32
32
|
* This method removes a font
|
|
33
|
-
* @param id
|
|
33
|
+
* @param id the id of a specific font
|
|
34
34
|
* @returns
|
|
35
35
|
*/
|
|
36
|
-
|
|
36
|
+
remove: (id: Id) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
37
37
|
/**
|
|
38
38
|
* This method adds a font
|
|
39
|
-
* @param
|
|
40
|
-
* @param font
|
|
39
|
+
* @param id unique id of the font connector
|
|
40
|
+
* @param font the font object
|
|
41
41
|
* @returns
|
|
42
42
|
*/
|
|
43
|
-
|
|
43
|
+
add: (id: Id, font: AddDocumentFont) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
44
44
|
/**
|
|
45
45
|
* Check if the font is used anywhere in the document
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
46
|
+
* @param id the id of the font to check
|
|
47
|
+
* @returns whether the font is used
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
isUsed: (id: string) => Promise<import("../types/CommonTypes").EditorResponse<boolean>>;
|
|
50
50
|
}
|
|
@@ -35,58 +35,58 @@ export class FontController {
|
|
|
35
35
|
_FontController_editorAPI.set(this, void 0);
|
|
36
36
|
/**
|
|
37
37
|
* This method returns the list of fonts
|
|
38
|
-
* @returns
|
|
38
|
+
* @returns list of all fonts
|
|
39
39
|
*/
|
|
40
|
-
this.
|
|
40
|
+
this.getAll = () => __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
const res = yield __classPrivateFieldGet(this, _FontController_editorAPI, "f");
|
|
42
42
|
return res.getFonts().then((result) => getEditorResponseData(result));
|
|
43
43
|
});
|
|
44
44
|
/**
|
|
45
45
|
* This method returns a font by id
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
46
|
+
* @param id the id of a specific font
|
|
47
|
+
* @returns font properties
|
|
48
48
|
*/
|
|
49
|
-
this.
|
|
49
|
+
this.getById = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
const res = yield __classPrivateFieldGet(this, _FontController_editorAPI, "f");
|
|
51
|
-
return res.getFontById(
|
|
51
|
+
return res.getFontById(id).then((result) => getEditorResponseData(result));
|
|
52
52
|
});
|
|
53
53
|
/**
|
|
54
54
|
* This method returns the default font.
|
|
55
55
|
* Be aware that the default font will not change during the entire lifetime of the SDK session.
|
|
56
56
|
* It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.
|
|
57
|
-
* @returns
|
|
57
|
+
* @returns font properties
|
|
58
58
|
*/
|
|
59
|
-
this.
|
|
59
|
+
this.getDefault = () => __awaiter(this, void 0, void 0, function* () {
|
|
60
60
|
const res = yield __classPrivateFieldGet(this, _FontController_editorAPI, "f");
|
|
61
61
|
return res.getDefaultFont().then((result) => getEditorResponseData(result));
|
|
62
62
|
});
|
|
63
63
|
/**
|
|
64
64
|
* This method removes a font
|
|
65
|
-
* @param id
|
|
65
|
+
* @param id the id of a specific font
|
|
66
66
|
* @returns
|
|
67
67
|
*/
|
|
68
|
-
this.
|
|
68
|
+
this.remove = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
69
69
|
const res = yield __classPrivateFieldGet(this, _FontController_editorAPI, "f");
|
|
70
70
|
return res.removeFont(id).then((result) => getEditorResponseData(result));
|
|
71
71
|
});
|
|
72
72
|
/**
|
|
73
73
|
* This method adds a font
|
|
74
|
-
* @param
|
|
75
|
-
* @param font
|
|
74
|
+
* @param id unique id of the font connector
|
|
75
|
+
* @param font the font object
|
|
76
76
|
* @returns
|
|
77
77
|
*/
|
|
78
|
-
this.
|
|
78
|
+
this.add = (id, font) => __awaiter(this, void 0, void 0, function* () {
|
|
79
79
|
const res = yield __classPrivateFieldGet(this, _FontController_editorAPI, "f");
|
|
80
|
-
return res.addFont(
|
|
80
|
+
return res.addFont(id, JSON.stringify(font)).then((result) => getEditorResponseData(result));
|
|
81
81
|
});
|
|
82
82
|
/**
|
|
83
83
|
* Check if the font is used anywhere in the document
|
|
84
|
-
* @param
|
|
85
|
-
* @returns
|
|
84
|
+
* @param id the id of the font to check
|
|
85
|
+
* @returns whether the font is used
|
|
86
86
|
*/
|
|
87
|
-
this.
|
|
87
|
+
this.isUsed = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
88
88
|
const res = yield __classPrivateFieldGet(this, _FontController_editorAPI, "f");
|
|
89
|
-
return res.isFontUsed(
|
|
89
|
+
return res.isFontUsed(id).then((result) => getEditorResponseData(result));
|
|
90
90
|
});
|
|
91
91
|
__classPrivateFieldSet(this, _FontController_editorAPI, editorAPI, "f");
|
|
92
92
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FontController.js","sourceRoot":"","sources":["../../../src/controllers/FontController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;GAGG;AACH,MAAM,OAAO,cAAc;IAMvB;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,4CAAsB;QAStB;;;WAGG;QACH,
|
|
1
|
+
{"version":3,"file":"FontController.js","sourceRoot":"","sources":["../../../src/controllers/FontController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,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