@chili-publish/studio-sdk 1.25.1 → 1.27.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 +2403 -0
- package/_bundles/main.es.js.map +1 -0
- package/_bundles/main.js +21 -2
- package/_bundles/main.js.map +1 -1
- package/connector-types/src/Connector.Shared.d.ts +30 -0
- package/connector-types/src/Connector.Shared.js +2 -0
- package/connector-types/src/Connector.Shared.js.map +1 -0
- package/connector-types/src/DataConnector.d.ts +34 -0
- package/connector-types/src/DataConnector.js +2 -0
- package/connector-types/src/DataConnector.js.map +1 -0
- package/connector-types/src/FontConnector.d.ts +20 -0
- package/connector-types/src/FontConnector.js +2 -0
- package/connector-types/src/FontConnector.js.map +1 -0
- package/connector-types/src/MediaConnector.d.ts +20 -0
- package/connector-types/src/MediaConnector.js +2 -0
- package/connector-types/src/MediaConnector.js.map +1 -0
- package/connector-types/src/index.d.ts +4 -0
- package/connector-types/src/index.js +5 -0
- package/connector-types/src/index.js.map +1 -0
- package/lib/editor-engine.json +1 -1
- package/lib/package.json +10 -18
- package/lib/src/controllers/ActionController.d.ts +13 -13
- package/lib/src/controllers/ActionController.js.map +1 -1
- package/lib/src/controllers/AnimationController.d.ts +10 -10
- package/lib/src/controllers/AnimationController.js.map +1 -1
- package/lib/src/controllers/BarcodeController.d.ts +15 -15
- package/lib/src/controllers/BarcodeController.js.map +1 -1
- package/lib/src/controllers/BrandKitController.d.ts +103 -0
- package/lib/src/controllers/BrandKitController.js +357 -0
- package/lib/src/controllers/BrandKitController.js.map +1 -0
- package/lib/src/controllers/CanvasController.d.ts +4 -4
- package/lib/src/controllers/CanvasController.js.map +1 -1
- package/lib/src/controllers/CharacterStyleController.d.ts +8 -8
- package/lib/src/controllers/CharacterStyleController.js.map +1 -1
- package/lib/src/controllers/ClipboardController.d.ts +4 -4
- package/lib/src/controllers/ClipboardController.js.map +1 -1
- package/lib/src/controllers/ColorConversionController.d.ts +1 -1
- package/lib/src/controllers/ColorConversionController.js.map +1 -1
- package/lib/src/controllers/ColorStyleController.d.ts +8 -8
- package/lib/src/controllers/ColorStyleController.js.map +1 -1
- package/lib/src/controllers/ConfigurationController.d.ts +4 -4
- package/lib/src/controllers/ConfigurationController.js.map +1 -1
- package/lib/src/controllers/ConnectorController.d.ts +3 -3
- package/lib/src/controllers/ConnectorController.js +1 -1
- package/lib/src/controllers/ConnectorController.js.map +1 -1
- package/lib/src/controllers/DataConnectorController.d.ts +4 -3
- package/lib/src/controllers/DataConnectorController.js.map +1 -1
- package/lib/src/controllers/DataSourceController.d.ts +4 -4
- package/lib/src/controllers/DataSourceController.js.map +1 -1
- package/lib/src/controllers/DebugController.d.ts +4 -4
- package/lib/src/controllers/DebugController.js.map +1 -1
- package/lib/src/controllers/DocumentController.d.ts +4 -4
- package/lib/src/controllers/DocumentController.js.map +1 -1
- package/lib/src/controllers/ExperimentController.d.ts +8 -8
- package/lib/src/controllers/ExperimentController.js.map +1 -1
- package/lib/src/controllers/FontConnectorController.d.ts +2 -2
- package/lib/src/controllers/FontConnectorController.js +1 -1
- package/lib/src/controllers/FontConnectorController.js.map +1 -1
- package/lib/src/controllers/FontController.d.ts +13 -13
- package/lib/src/controllers/FontController.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +1 -1
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/InfoController.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/MediaConnectorController.d.ts +9 -9
- package/lib/src/controllers/MediaConnectorController.js +8 -8
- package/lib/src/controllers/MediaConnectorController.js.map +1 -1
- package/lib/src/controllers/PageController.d.ts +4 -4
- package/lib/src/controllers/PageController.js +2 -2
- package/lib/src/controllers/PageController.js.map +1 -1
- package/lib/src/controllers/ParagraphStyleController.d.ts +8 -8
- package/lib/src/controllers/ParagraphStyleController.js.map +1 -1
- package/lib/src/controllers/ShapeController.d.ts +11 -11
- package/lib/src/controllers/ShapeController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.d.ts +8 -2
- package/lib/src/controllers/SubscriberController.js +11 -3
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/TextStyleController.d.ts +3 -3
- package/lib/src/controllers/TextStyleController.js.map +1 -1
- package/lib/src/controllers/ToolController.d.ts +11 -11
- package/lib/src/controllers/ToolController.js.map +1 -1
- package/lib/src/controllers/UndoManagerController.d.ts +16 -10
- package/lib/src/controllers/UndoManagerController.js +11 -3
- package/lib/src/controllers/UndoManagerController.js.map +1 -1
- package/lib/src/controllers/UtilsController.d.ts +3 -3
- package/lib/src/controllers/UtilsController.js.map +1 -1
- package/lib/src/controllers/VariableController.d.ts +50 -50
- package/lib/src/controllers/VariableController.js +3 -1
- package/lib/src/controllers/VariableController.js.map +1 -1
- package/lib/src/index.d.ts +5 -3
- package/lib/src/index.js +3 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/interactions/Connector.d.ts +5 -1
- package/lib/src/interactions/Connector.js +2 -2
- package/lib/src/interactions/Connector.js.map +1 -1
- package/lib/src/next/NextInitiator.js.map +1 -1
- package/lib/src/next/controllers/CanvasController.d.ts +1 -1
- package/lib/src/next/controllers/CanvasController.js.map +1 -1
- package/lib/src/next/controllers/ConnectorController.d.ts +3 -3
- package/lib/src/next/controllers/ConnectorController.js.map +1 -1
- package/lib/src/next/controllers/PageController.d.ts +2 -2
- package/lib/src/next/controllers/PageController.js.map +1 -1
- package/lib/src/next/controllers/SubscriberController.d.ts +5 -0
- package/lib/src/next/controllers/SubscriberController.js +7 -0
- package/lib/src/next/controllers/SubscriberController.js.map +1 -1
- package/lib/src/next/controllers/VariableController.d.ts +8 -8
- package/lib/src/next/controllers/VariableController.js +3 -1
- package/lib/src/next/controllers/VariableController.js.map +1 -1
- package/lib/src/next/index.d.ts +2 -2
- package/lib/src/next/index.js.map +1 -1
- package/lib/src/next/tests/controllers/CanvasController.test.js.map +1 -1
- package/lib/src/next/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/next/tests/controllers/PageController.test.js.map +1 -1
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js +1 -0
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/next/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/next/types/ConnectorTypes.js.map +1 -1
- package/lib/src/next/types/NextSubscribers.js.map +1 -1
- package/lib/src/next/types/PageTypes.js.map +1 -1
- package/lib/src/next/types/VariableTypes.js.map +1 -1
- package/lib/src/sdk.d.ts +3 -1
- package/lib/src/sdk.js +4 -0
- package/lib/src/sdk.js.map +1 -1
- package/lib/src/setupTests.js.map +1 -1
- package/lib/src/tests/__mocks__/Animations.js.map +1 -1
- package/lib/src/tests/__mocks__/Brandkit.js +389 -0
- package/lib/src/tests/__mocks__/Brandkit.js.map +1 -0
- package/lib/src/tests/__mocks__/Config.js.map +1 -1
- package/lib/src/tests/__mocks__/FrameProperties.js.map +1 -1
- package/lib/src/tests/__mocks__/MockImageFrameSource.js.map +1 -1
- package/lib/src/tests/__mocks__/localConfig.js.map +1 -1
- package/lib/src/tests/__mocks__/mockDocument.js.map +1 -1
- package/lib/src/tests/controllers/ActionController.test.js.map +1 -1
- package/lib/src/tests/controllers/AnimationController.test.js.map +1 -1
- package/lib/src/tests/controllers/BarcodeController.test.js.map +1 -1
- package/lib/src/tests/controllers/BrandKitController.test.js +276 -0
- package/lib/src/tests/controllers/BrandKitController.test.js.map +1 -0
- package/lib/src/tests/controllers/CanvasController.test.js.map +1 -1
- package/lib/src/tests/controllers/CharacterStyleController.test.js +22 -0
- package/lib/src/tests/controllers/CharacterStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ClipboardController.test.js.map +1 -1
- package/lib/src/tests/controllers/ColorConversionController.test.js.map +1 -1
- package/lib/src/tests/controllers/ColorStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/DataConnectorController.test.js +1 -1
- package/lib/src/tests/controllers/DataConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/DataSourceController.test.js.map +1 -1
- package/lib/src/tests/controllers/DebugController.test.js.map +1 -1
- package/lib/src/tests/controllers/DocumentController.test.js.map +1 -1
- package/lib/src/tests/controllers/ExperimentController.test.js.map +1 -1
- package/lib/src/tests/controllers/FontConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/FontController.test.js.map +1 -1
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/InfoController.test.js.map +1 -1
- package/lib/src/tests/controllers/LayoutController.test.js.map +1 -1
- package/lib/src/tests/controllers/MediaConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/PageController.test.js.map +1 -1
- package/lib/src/tests/controllers/ParagraphStyleController.test.js +25 -0
- package/lib/src/tests/controllers/ParagraphStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ShapeController.test.js.map +1 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.js +9 -3
- package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/tests/controllers/TextStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ToolController.test.js.map +1 -1
- package/lib/src/tests/controllers/UndoManagerController.test.js +2 -2
- package/lib/src/tests/controllers/UndoManagerController.test.js.map +1 -1
- package/lib/src/tests/controllers/UtilsController.test.js.map +1 -1
- package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/tests/index.test.js.map +1 -1
- package/lib/src/tests/interactions/Connector.test.js.map +1 -1
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.js.map +1 -1
- package/lib/src/tests/utils/EditorResponseData.test.js.map +1 -1
- package/lib/src/tests/utils/EventSubscription.test.js.map +1 -1
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.js.map +1 -1
- package/lib/src/tests/utils/Logging.test.js.map +1 -1
- package/lib/src/tests/utils/Round.test.js.map +1 -1
- package/lib/src/types/ActionTypes.js.map +1 -1
- package/lib/src/types/AnimationTypes.js.map +1 -1
- package/lib/src/types/BarcodeTypes.js.map +1 -1
- package/lib/src/types/BrandKitTypes.d.ts +129 -0
- package/lib/src/types/BrandKitTypes.js +2 -0
- package/lib/src/types/BrandKitTypes.js.map +1 -0
- package/lib/src/types/CharacterStyleTypes.d.ts +29 -14
- package/lib/src/types/CharacterStyleTypes.js.map +1 -1
- package/lib/src/types/ClipboardTypes.js.map +1 -1
- package/lib/src/types/ColorStyleTypes.d.ts +20 -5
- package/lib/src/types/ColorStyleTypes.js +18 -2
- package/lib/src/types/ColorStyleTypes.js.map +1 -1
- package/lib/src/types/CommonTypes.d.ts +9 -30
- package/lib/src/types/CommonTypes.js +0 -10
- package/lib/src/types/CommonTypes.js.map +1 -1
- package/lib/src/types/ConfigurationTypes.js.map +1 -1
- package/lib/src/types/ConnectorTypes.d.ts +16 -13
- package/lib/src/types/ConnectorTypes.js +10 -0
- package/lib/src/types/ConnectorTypes.js.map +1 -1
- package/lib/src/types/DataConnectorTypes.d.ts +2 -32
- package/lib/src/types/DataConnectorTypes.js.map +1 -1
- package/lib/src/types/DebugTypes.js.map +1 -1
- package/lib/src/types/DocumentTypes.d.ts +83 -4
- package/lib/src/types/DocumentTypes.js +6 -0
- package/lib/src/types/DocumentTypes.js.map +1 -1
- package/lib/src/types/EngineEditModeTypes.js.map +1 -1
- package/lib/src/types/FontConnectorTypes.d.ts +1 -19
- package/lib/src/types/FontConnectorTypes.js.map +1 -1
- package/lib/src/types/FontTypes.js.map +1 -1
- package/lib/src/types/FrameTypes.d.ts +8 -3
- package/lib/src/types/FrameTypes.js +1 -1
- package/lib/src/types/FrameTypes.js.map +1 -1
- package/lib/src/types/LayoutTypes.d.ts +18 -17
- package/lib/src/types/LayoutTypes.js.map +1 -1
- package/lib/src/types/MediaConnectorTypes.d.ts +7 -23
- package/lib/src/types/MediaConnectorTypes.js +2 -0
- package/lib/src/types/MediaConnectorTypes.js.map +1 -1
- package/lib/src/types/PageTypes.js.map +1 -1
- package/lib/src/types/ParagraphStyleTypes.d.ts +35 -17
- package/lib/src/types/ParagraphStyleTypes.js.map +1 -1
- package/lib/src/types/ShapeTypes.js.map +1 -1
- package/lib/src/types/TextStyleTypes.d.ts +8 -2
- package/lib/src/types/TextStyleTypes.js +2 -0
- package/lib/src/types/TextStyleTypes.js.map +1 -1
- package/lib/src/types/TextTypes.js.map +1 -1
- package/lib/src/types/VariableTypes.js.map +1 -1
- package/lib/src/types/ViewModeTypes.js.map +1 -1
- package/lib/src/types/ViewportTypes.js.map +1 -1
- package/lib/src/utils/BrandKitHelper.d.ts +9 -0
- package/lib/src/utils/BrandKitHelper.js +72 -0
- package/lib/src/utils/BrandKitHelper.js.map +1 -0
- package/lib/src/utils/ConfigHelper.js +1 -0
- package/lib/src/utils/ConfigHelper.js.map +1 -1
- package/lib/src/utils/ConnectorCompatibilityTools.js.map +1 -1
- package/lib/src/utils/DataItemMappingTools.js.map +1 -1
- package/lib/src/utils/EditorResponseData.d.ts +1 -1
- package/lib/src/utils/EditorResponseData.js.map +1 -1
- package/lib/src/utils/EngineCallbackHandler.js.map +1 -1
- package/lib/src/utils/EngineEvent.js.map +1 -1
- package/lib/src/utils/EngineEventTrigger.js.map +1 -1
- package/lib/src/utils/Enums.js.map +1 -1
- package/lib/src/utils/LocalConfigurationDecorator.d.ts +2 -2
- package/lib/src/utils/LocalConfigurationDecorator.js.map +1 -1
- package/lib/src/utils/MathUtils.js.map +1 -1
- package/package.json +10 -18
- package/_bundles/report.html +0 -38
- package/lib/src/next/tests/controllers/CanvasController.test.d.ts +0 -1
- package/lib/src/next/tests/controllers/ConnectorController.test.d.ts +0 -1
- package/lib/src/next/tests/controllers/PageController.test.d.ts +0 -1
- package/lib/src/next/tests/controllers/SubscriberContoller.test.d.ts +0 -1
- package/lib/src/next/tests/controllers/VariableController.test.d.ts +0 -1
- package/lib/src/setupTests.d.ts +0 -1
- package/lib/src/tests/__mocks__/Animations.d.ts +0 -2
- package/lib/src/tests/__mocks__/Config.d.ts +0 -4
- package/lib/src/tests/__mocks__/FrameProperties.d.ts +0 -52
- package/lib/src/tests/__mocks__/MockImageFrameSource.d.ts +0 -4
- package/lib/src/tests/__mocks__/localConfig.d.ts +0 -2
- package/lib/src/tests/__mocks__/mockDocument.d.ts +0 -1
- package/lib/src/tests/controllers/ActionController.test.d.ts +0 -1
- package/lib/src/tests/controllers/AnimationController.test.d.ts +0 -1
- package/lib/src/tests/controllers/BarcodeController.test.d.ts +0 -1
- package/lib/src/tests/controllers/CanvasController.test.d.ts +0 -1
- package/lib/src/tests/controllers/CharacterStyleController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ClipboardController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ColorConversionController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ColorStyleController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ConnectorController.test.d.ts +0 -1
- package/lib/src/tests/controllers/DataConnectorController.test.d.ts +0 -1
- package/lib/src/tests/controllers/DataSourceController.test.d.ts +0 -1
- package/lib/src/tests/controllers/DebugController.test.d.ts +0 -1
- package/lib/src/tests/controllers/DocumentController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ExperimentController.test.d.ts +0 -1
- package/lib/src/tests/controllers/FontConnectorController.test.d.ts +0 -1
- package/lib/src/tests/controllers/FontController.test.d.ts +0 -1
- package/lib/src/tests/controllers/FrameController.test.d.ts +0 -1
- package/lib/src/tests/controllers/InfoController.test.d.ts +0 -1
- package/lib/src/tests/controllers/LayoutController.test.d.ts +0 -1
- package/lib/src/tests/controllers/MediaConnectorController.test.d.ts +0 -1
- package/lib/src/tests/controllers/PageController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ParagraphStyleController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ShapeController.test.d.ts +0 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.d.ts +0 -1
- package/lib/src/tests/controllers/TextStyleController.test.d.ts +0 -1
- package/lib/src/tests/controllers/ToolController.test.d.ts +0 -1
- package/lib/src/tests/controllers/UndoManagerController.test.d.ts +0 -1
- package/lib/src/tests/controllers/UtilsController.test.d.ts +0 -1
- package/lib/src/tests/controllers/VariableController.test.d.ts +0 -1
- package/lib/src/tests/index.test.d.ts +0 -1
- package/lib/src/tests/interactions/Connector.test.d.ts +0 -1
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.d.ts +0 -1
- package/lib/src/tests/utils/EditorResponseData.test.d.ts +0 -1
- package/lib/src/tests/utils/EventSubscription.test.d.ts +0 -1
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.d.ts +0 -1
- package/lib/src/tests/utils/Logging.test.d.ts +0 -1
- package/lib/src/tests/utils/Round.test.d.ts +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { default as SDK } from '..';
|
|
2
|
+
import { BrandKitInternal, BrandKitMedia, StudioBrandKit } from '../types/BrandKitTypes';
|
|
3
|
+
import { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';
|
|
4
|
+
/**
|
|
5
|
+
* The BrandKitController is responsible for all communication regarding Brand Kits.
|
|
6
|
+
* Methods inside this controller can be called by `window.SDK.brandKit.{method-name}`
|
|
7
|
+
*/
|
|
8
|
+
export declare class BrandKitController {
|
|
9
|
+
#private;
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
constructor(editorAPI: EditorAPI, sdk: SDK);
|
|
14
|
+
private colorStyleController;
|
|
15
|
+
private fontController;
|
|
16
|
+
private mediaController;
|
|
17
|
+
private paragraphStyleController;
|
|
18
|
+
private characterStyleController;
|
|
19
|
+
private undoManagerController;
|
|
20
|
+
/**
|
|
21
|
+
* This method returns the current brand kit id.
|
|
22
|
+
* @returns current brand kit id
|
|
23
|
+
*/
|
|
24
|
+
getId: () => Promise<EditorResponse<string>>;
|
|
25
|
+
/**
|
|
26
|
+
* This method returns the current brand kit version.
|
|
27
|
+
* @returns current brand kit version
|
|
28
|
+
*/
|
|
29
|
+
getVersion: () => Promise<EditorResponse<string>>;
|
|
30
|
+
/**
|
|
31
|
+
* This method returns the current brand kit name.
|
|
32
|
+
* @returns current brand kit name
|
|
33
|
+
*/
|
|
34
|
+
getName: () => Promise<EditorResponse<string>>;
|
|
35
|
+
/**
|
|
36
|
+
* This method renames the brand kit.
|
|
37
|
+
* @param newName - The new name for the brand kit
|
|
38
|
+
* @returns
|
|
39
|
+
*/
|
|
40
|
+
rename: (newName: string) => Promise<EditorResponse<null>>;
|
|
41
|
+
/**
|
|
42
|
+
* This method updates both the brand kit id and version.
|
|
43
|
+
* @param id - The new brand kit id
|
|
44
|
+
* @param version - The new brand kit version
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
updateIdAndVersion: (id: string, version: string) => Promise<EditorResponse<null>>;
|
|
48
|
+
/**
|
|
49
|
+
* @experimental This method returns the local brandkit
|
|
50
|
+
* @returns brandkit with all assigned resources
|
|
51
|
+
*/
|
|
52
|
+
get: () => Promise<EditorResponse<StudioBrandKit>>;
|
|
53
|
+
/**
|
|
54
|
+
* This method returns all media items in the brand kit
|
|
55
|
+
* @returns list of media items in the brand kit
|
|
56
|
+
*/
|
|
57
|
+
getAllMedia: () => Promise<EditorResponse<BrandKitMedia[]>>;
|
|
58
|
+
/**
|
|
59
|
+
* This method adds a media item to the brand kit
|
|
60
|
+
* @param name - The name of the media item
|
|
61
|
+
* @param remoteConnectorId - The remote connector ID
|
|
62
|
+
* @param assetId - The asset ID of the media item
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
addMedia: (name: string, remoteConnectorId: Id, assetId: string) => Promise<EditorResponse<string>>;
|
|
66
|
+
/**
|
|
67
|
+
* This method updates an existing media item in the brand kit
|
|
68
|
+
* @param name - The name of the media item to update
|
|
69
|
+
* @param remoteConnectorId - The new remote connector ID
|
|
70
|
+
* @param assetId - The new asset ID
|
|
71
|
+
* @returns
|
|
72
|
+
*/
|
|
73
|
+
updateMedia: (name: string, remoteConnectorId: Id, assetId: string) => Promise<EditorResponse<null>>;
|
|
74
|
+
/**
|
|
75
|
+
* This method renames an existing media item in the brand kit
|
|
76
|
+
* @param name - The name of the media item to rename
|
|
77
|
+
* @param newName - The new name for the media item
|
|
78
|
+
* @returns
|
|
79
|
+
*/
|
|
80
|
+
renameMedia: (name: string, newName: string) => Promise<EditorResponse<null>>;
|
|
81
|
+
/**
|
|
82
|
+
* This method removes a media item from the brand kit
|
|
83
|
+
* @param name - The name of the media item to remove
|
|
84
|
+
* @returns
|
|
85
|
+
*/
|
|
86
|
+
removeMedia: (name: string) => Promise<EditorResponse<null>>;
|
|
87
|
+
/**
|
|
88
|
+
* @experimental This method removes a brand kit and all related resources assigned to it
|
|
89
|
+
* @returns
|
|
90
|
+
*/
|
|
91
|
+
remove: () => Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* @experimental This method updates a brand kit and all related resources assigned to it
|
|
94
|
+
* @param studioBrandKit the content of the brand kit
|
|
95
|
+
* @returns
|
|
96
|
+
*/
|
|
97
|
+
set: (studioBrandKit: StudioBrandKit) => Promise<EditorResponse<BrandKitInternal>>;
|
|
98
|
+
private setColors;
|
|
99
|
+
private setFonts;
|
|
100
|
+
private setParagraphStyles;
|
|
101
|
+
private setCharacterStyles;
|
|
102
|
+
private setMedia;
|
|
103
|
+
}
|
|
@@ -0,0 +1,357 @@
|
|
|
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 _BrandKitController_editorAPI;
|
|
22
|
+
import { getColorById, getFontKey, mapBrandKitColorToLocal, mapBrandKitStyleToLocal } from '../utils/BrandKitHelper';
|
|
23
|
+
import { getEditorResponseData } from '../utils/EditorResponseData';
|
|
24
|
+
/**
|
|
25
|
+
* The BrandKitController is responsible for all communication regarding Brand Kits.
|
|
26
|
+
* Methods inside this controller can be called by `window.SDK.brandKit.{method-name}`
|
|
27
|
+
*/
|
|
28
|
+
export class BrandKitController {
|
|
29
|
+
/**
|
|
30
|
+
* @ignore
|
|
31
|
+
*/
|
|
32
|
+
constructor(editorAPI, sdk) {
|
|
33
|
+
/**
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
_BrandKitController_editorAPI.set(this, void 0);
|
|
37
|
+
/**
|
|
38
|
+
* This method returns the current brand kit id.
|
|
39
|
+
* @returns current brand kit id
|
|
40
|
+
*/
|
|
41
|
+
this.getId = () => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
43
|
+
return res.getBrandKitId().then((result) => getEditorResponseData(result));
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* This method returns the current brand kit version.
|
|
47
|
+
* @returns current brand kit version
|
|
48
|
+
*/
|
|
49
|
+
this.getVersion = () => __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
51
|
+
return res.getBrandKitVersion().then((result) => getEditorResponseData(result));
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* This method returns the current brand kit name.
|
|
55
|
+
* @returns current brand kit name
|
|
56
|
+
*/
|
|
57
|
+
this.getName = () => __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
59
|
+
return res.getBrandKitName().then((result) => getEditorResponseData(result));
|
|
60
|
+
});
|
|
61
|
+
/**
|
|
62
|
+
* This method renames the brand kit.
|
|
63
|
+
* @param newName - The new name for the brand kit
|
|
64
|
+
* @returns
|
|
65
|
+
*/
|
|
66
|
+
this.rename = (newName) => __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
68
|
+
return res.renameBrandKit(newName).then((result) => getEditorResponseData(result));
|
|
69
|
+
});
|
|
70
|
+
/**
|
|
71
|
+
* This method updates both the brand kit id and version.
|
|
72
|
+
* @param id - The new brand kit id
|
|
73
|
+
* @param version - The new brand kit version
|
|
74
|
+
* @returns
|
|
75
|
+
*/
|
|
76
|
+
this.updateIdAndVersion = (id, version) => __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
78
|
+
return res.updateBrandKitIdAndVersion(id, version).then((result) => getEditorResponseData(result));
|
|
79
|
+
});
|
|
80
|
+
/**
|
|
81
|
+
* @experimental This method returns the local brandkit
|
|
82
|
+
* @returns brandkit with all assigned resources
|
|
83
|
+
*/
|
|
84
|
+
this.get = () => __awaiter(this, void 0, void 0, function* () {
|
|
85
|
+
const brandKitId = yield this.getId();
|
|
86
|
+
const brandKitVersion = yield this.getVersion();
|
|
87
|
+
const brandKitName = yield this.getName();
|
|
88
|
+
const colorsPromise = this.colorStyleController.getAll();
|
|
89
|
+
const fontsPromise = this.fontController.getFontFamilies();
|
|
90
|
+
const characterStylesPromise = this.characterStyleController.getAll();
|
|
91
|
+
const paragraphStylesPromise = this.paragraphStyleController.getAll();
|
|
92
|
+
const mediaPromise = this.getAllMedia();
|
|
93
|
+
const [colors, fonts, paragraphStyles, characterStyles, media] = yield Promise.all([
|
|
94
|
+
colorsPromise,
|
|
95
|
+
fontsPromise,
|
|
96
|
+
paragraphStylesPromise,
|
|
97
|
+
characterStylesPromise,
|
|
98
|
+
mediaPromise,
|
|
99
|
+
]);
|
|
100
|
+
const studioBrandKit = {
|
|
101
|
+
id: brandKitId.parsedData,
|
|
102
|
+
brandKit: {
|
|
103
|
+
id: brandKitId.parsedData,
|
|
104
|
+
name: brandKitName.parsedData,
|
|
105
|
+
lastModifiedDate: brandKitVersion.parsedData,
|
|
106
|
+
colors: colors.parsedData,
|
|
107
|
+
fonts: fonts.parsedData,
|
|
108
|
+
paragraphStyles: paragraphStyles.parsedData,
|
|
109
|
+
characterStyles: characterStyles.parsedData,
|
|
110
|
+
media: media.parsedData,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
const editorResponse = {
|
|
114
|
+
success: true,
|
|
115
|
+
data: JSON.stringify(studioBrandKit),
|
|
116
|
+
parsedData: studioBrandKit,
|
|
117
|
+
status: 200,
|
|
118
|
+
};
|
|
119
|
+
return getEditorResponseData(editorResponse);
|
|
120
|
+
});
|
|
121
|
+
/**
|
|
122
|
+
* This method returns all media items in the brand kit
|
|
123
|
+
* @returns list of media items in the brand kit
|
|
124
|
+
*/
|
|
125
|
+
this.getAllMedia = () => __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
127
|
+
return res.getAllBrandKitMedia().then((result) => getEditorResponseData(result));
|
|
128
|
+
});
|
|
129
|
+
/**
|
|
130
|
+
* This method adds a media item to the brand kit
|
|
131
|
+
* @param name - The name of the media item
|
|
132
|
+
* @param remoteConnectorId - The remote connector ID
|
|
133
|
+
* @param assetId - The asset ID of the media item
|
|
134
|
+
* @returns
|
|
135
|
+
*/
|
|
136
|
+
this.addMedia = (name, remoteConnectorId, assetId) => __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
138
|
+
return res
|
|
139
|
+
.addBrandKitMedia(name, remoteConnectorId, assetId)
|
|
140
|
+
.then((result) => getEditorResponseData(result));
|
|
141
|
+
});
|
|
142
|
+
/**
|
|
143
|
+
* This method updates an existing media item in the brand kit
|
|
144
|
+
* @param name - The name of the media item to update
|
|
145
|
+
* @param remoteConnectorId - The new remote connector ID
|
|
146
|
+
* @param assetId - The new asset ID
|
|
147
|
+
* @returns
|
|
148
|
+
*/
|
|
149
|
+
this.updateMedia = (name, remoteConnectorId, assetId) => __awaiter(this, void 0, void 0, function* () {
|
|
150
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
151
|
+
return res
|
|
152
|
+
.updateBrandKitMedia(name, remoteConnectorId, assetId)
|
|
153
|
+
.then((result) => getEditorResponseData(result));
|
|
154
|
+
});
|
|
155
|
+
/**
|
|
156
|
+
* This method renames an existing media item in the brand kit
|
|
157
|
+
* @param name - The name of the media item to rename
|
|
158
|
+
* @param newName - The new name for the media item
|
|
159
|
+
* @returns
|
|
160
|
+
*/
|
|
161
|
+
this.renameMedia = (name, newName) => __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
163
|
+
return res.renameBrandKitMedia(name, newName).then((result) => getEditorResponseData(result));
|
|
164
|
+
});
|
|
165
|
+
/**
|
|
166
|
+
* This method removes a media item from the brand kit
|
|
167
|
+
* @param name - The name of the media item to remove
|
|
168
|
+
* @returns
|
|
169
|
+
*/
|
|
170
|
+
this.removeMedia = (name) => __awaiter(this, void 0, void 0, function* () {
|
|
171
|
+
const res = yield __classPrivateFieldGet(this, _BrandKitController_editorAPI, "f");
|
|
172
|
+
return res.removeBrandKitMedia(name).then((result) => getEditorResponseData(result));
|
|
173
|
+
});
|
|
174
|
+
/**
|
|
175
|
+
* @experimental This method removes a brand kit and all related resources assigned to it
|
|
176
|
+
* @returns
|
|
177
|
+
*/
|
|
178
|
+
this.remove = () => __awaiter(this, void 0, void 0, function* () {
|
|
179
|
+
const colors = yield this.colorStyleController.getAll();
|
|
180
|
+
const colorsList = colors.parsedData || [];
|
|
181
|
+
const paragraphStyles = yield this.paragraphStyleController.getAll();
|
|
182
|
+
const paragraphStylesList = paragraphStyles.parsedData || [];
|
|
183
|
+
const characterStyles = yield this.characterStyleController.getAll();
|
|
184
|
+
const characterStylesList = characterStyles.parsedData || [];
|
|
185
|
+
const fonts = yield this.fontController.getFontFamilies();
|
|
186
|
+
const fontsList = fonts.parsedData || [];
|
|
187
|
+
const media = yield this.getAllMedia();
|
|
188
|
+
const mediaList = media.parsedData || [];
|
|
189
|
+
yield this.undoManagerController.record('brandKit.remove', (sdk) => __awaiter(this, void 0, void 0, function* () {
|
|
190
|
+
for (const color of colorsList) {
|
|
191
|
+
yield sdk.colorStyle.remove(color.id);
|
|
192
|
+
}
|
|
193
|
+
for (const style of paragraphStylesList) {
|
|
194
|
+
yield sdk.paragraphStyle.remove(style.id);
|
|
195
|
+
}
|
|
196
|
+
for (const style of characterStylesList) {
|
|
197
|
+
yield sdk.characterStyle.remove(style.id);
|
|
198
|
+
}
|
|
199
|
+
for (const font of fontsList) {
|
|
200
|
+
yield sdk.font.removeFontFamily(font.id);
|
|
201
|
+
}
|
|
202
|
+
for (const media of mediaList) {
|
|
203
|
+
yield this.removeMedia(media.name);
|
|
204
|
+
}
|
|
205
|
+
}));
|
|
206
|
+
});
|
|
207
|
+
/**
|
|
208
|
+
* @experimental This method updates a brand kit and all related resources assigned to it
|
|
209
|
+
* @param studioBrandKit the content of the brand kit
|
|
210
|
+
* @returns
|
|
211
|
+
*/
|
|
212
|
+
this.set = (studioBrandKit) => __awaiter(this, void 0, void 0, function* () {
|
|
213
|
+
let result = {
|
|
214
|
+
success: true,
|
|
215
|
+
status: 200,
|
|
216
|
+
parsedData: {
|
|
217
|
+
id: studioBrandKit.id,
|
|
218
|
+
version: studioBrandKit.brandKit.lastModifiedDate,
|
|
219
|
+
name: studioBrandKit.brandKit.name,
|
|
220
|
+
colors: [],
|
|
221
|
+
fonts: [],
|
|
222
|
+
paragraphStyles: [],
|
|
223
|
+
characterStyles: [],
|
|
224
|
+
media: [],
|
|
225
|
+
},
|
|
226
|
+
};
|
|
227
|
+
yield this.undoManagerController.record('brandKit.set', (sdk) => __awaiter(this, void 0, void 0, function* () {
|
|
228
|
+
const localColorGuidMap = yield this.setColors(studioBrandKit, sdk);
|
|
229
|
+
const localFontGuidMap = yield this.setFonts(studioBrandKit, sdk);
|
|
230
|
+
const { parsedData: localColors = [] } = yield sdk.colorStyle.getAll();
|
|
231
|
+
const { parsedData: localFonts } = yield sdk.font.getFontFamilies();
|
|
232
|
+
yield this.setParagraphStyles(studioBrandKit, sdk, {
|
|
233
|
+
localColors,
|
|
234
|
+
localFonts,
|
|
235
|
+
localColorGuidMap,
|
|
236
|
+
localFontGuidMap,
|
|
237
|
+
});
|
|
238
|
+
yield this.setCharacterStyles(studioBrandKit, sdk, {
|
|
239
|
+
localColors,
|
|
240
|
+
localFonts,
|
|
241
|
+
localColorGuidMap,
|
|
242
|
+
localFontGuidMap,
|
|
243
|
+
});
|
|
244
|
+
yield this.setMedia(studioBrandKit);
|
|
245
|
+
const { parsedData: allParagraphStyles } = yield sdk.paragraphStyle.getAll();
|
|
246
|
+
const { parsedData: allCharacterStyles } = yield sdk.characterStyle.getAll();
|
|
247
|
+
const { parsedData: allMedia } = yield this.getAllMedia();
|
|
248
|
+
yield sdk.brandKit.updateIdAndVersion(studioBrandKit.id, studioBrandKit.brandKit.lastModifiedDate);
|
|
249
|
+
yield sdk.brandKit.rename(studioBrandKit.brandKit.name);
|
|
250
|
+
result = {
|
|
251
|
+
success: true,
|
|
252
|
+
status: 200,
|
|
253
|
+
parsedData: {
|
|
254
|
+
id: studioBrandKit.id,
|
|
255
|
+
version: studioBrandKit.brandKit.lastModifiedDate,
|
|
256
|
+
name: studioBrandKit.brandKit.name,
|
|
257
|
+
colors: localColors || [],
|
|
258
|
+
fonts: localFonts || [],
|
|
259
|
+
paragraphStyles: allParagraphStyles || [],
|
|
260
|
+
characterStyles: allCharacterStyles || [],
|
|
261
|
+
media: allMedia || [],
|
|
262
|
+
},
|
|
263
|
+
};
|
|
264
|
+
}));
|
|
265
|
+
return result;
|
|
266
|
+
});
|
|
267
|
+
__classPrivateFieldSet(this, _BrandKitController_editorAPI, editorAPI, "f");
|
|
268
|
+
this.colorStyleController = sdk.colorStyle;
|
|
269
|
+
this.fontController = sdk.font;
|
|
270
|
+
this.mediaController = sdk.mediaConnector;
|
|
271
|
+
this.paragraphStyleController = sdk.paragraphStyle;
|
|
272
|
+
this.characterStyleController = sdk.characterStyle;
|
|
273
|
+
this.undoManagerController = sdk.undoManager;
|
|
274
|
+
}
|
|
275
|
+
setColors(studioBrandKit, sdk) {
|
|
276
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
277
|
+
const localColorGuidsMap = new Map();
|
|
278
|
+
for (const color of studioBrandKit.brandKit.colors || []) {
|
|
279
|
+
const { parsedData: localColorId } = yield sdk.colorStyle.create();
|
|
280
|
+
if (!localColorId)
|
|
281
|
+
continue;
|
|
282
|
+
localColorGuidsMap.set(color.guid, localColorId);
|
|
283
|
+
const localColor = mapBrandKitColorToLocal(color);
|
|
284
|
+
yield sdk.colorStyle.rename(localColorId, color.name);
|
|
285
|
+
yield sdk.colorStyle.update(localColorId, localColor);
|
|
286
|
+
}
|
|
287
|
+
return localColorGuidsMap;
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
setFonts(studioBrandKit, sdk) {
|
|
291
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
292
|
+
const fontConnectorId = studioBrandKit.fontConnectorId;
|
|
293
|
+
const guidFontFamilyIdMap = new Map();
|
|
294
|
+
for (const font of studioBrandKit.brandKit.fonts || []) {
|
|
295
|
+
const { parsedData: fontStyles = [] } = yield sdk.fontConnector.detail(fontConnectorId, font.fontFamilyId);
|
|
296
|
+
if (!(fontStyles === null || fontStyles === void 0 ? void 0 : fontStyles[0]))
|
|
297
|
+
throw new Error(`No font styles for family ID: ${font.fontFamilyId}`);
|
|
298
|
+
const { parsedData: localFontId } = yield sdk.font.addFontFamily(fontConnectorId, {
|
|
299
|
+
name: fontStyles[0].familyName,
|
|
300
|
+
fontFamilyId: font.fontFamilyId,
|
|
301
|
+
});
|
|
302
|
+
if (localFontId)
|
|
303
|
+
guidFontFamilyIdMap.set(font.fontFamilyBrandKitGuid, localFontId);
|
|
304
|
+
}
|
|
305
|
+
return guidFontFamilyIdMap;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
setParagraphStyles(studioBrandKit, sdk, resources) {
|
|
309
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
310
|
+
const { localColors, localFonts, localColorGuidMap, localFontGuidMap } = resources;
|
|
311
|
+
for (const style of studioBrandKit.brandKit.paragraphStyles || []) {
|
|
312
|
+
const localColorId = localColorGuidMap.get(style.brandKitColorGuid);
|
|
313
|
+
const fontFamilyId = localFontGuidMap.get(style.brandKitFontFamilyGuid);
|
|
314
|
+
const fontKey = getFontKey(localFonts, fontFamilyId, style.fontStyleId);
|
|
315
|
+
if (!fontFamilyId || !fontKey)
|
|
316
|
+
throw new Error(`Paragraph style could not be created with an empty font family: ${style.name}`);
|
|
317
|
+
const localColor = getColorById(localColors, localColorId);
|
|
318
|
+
if (!localColor)
|
|
319
|
+
throw new Error(`Paragraph style could not be created with an empty color: ${style.name}`);
|
|
320
|
+
const { parsedData: styleId } = yield sdk.paragraphStyle.create();
|
|
321
|
+
const paragraphStyleUpdate = mapBrandKitStyleToLocal(style, localColor, `${fontKey}`);
|
|
322
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
323
|
+
yield sdk.paragraphStyle.rename(styleId, style.name);
|
|
324
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
325
|
+
yield sdk.paragraphStyle.update(styleId, paragraphStyleUpdate);
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
setCharacterStyles(studioBrandKit, sdk, resources) {
|
|
330
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
331
|
+
const { localColors, localFonts, localColorGuidMap, localFontGuidMap } = resources;
|
|
332
|
+
for (const style of studioBrandKit.brandKit.characterStyles || []) {
|
|
333
|
+
const localColorId = style.brandKitColorGuid ? localColorGuidMap.get(style.brandKitColorGuid) : undefined;
|
|
334
|
+
const fontFamilyId = style.brandKitFontFamilyGuid
|
|
335
|
+
? localFontGuidMap.get(style.brandKitFontFamilyGuid)
|
|
336
|
+
: undefined;
|
|
337
|
+
const localColor = getColorById(localColors, localColorId);
|
|
338
|
+
const fontKey = getFontKey(localFonts, fontFamilyId, style.fontStyleId);
|
|
339
|
+
const { parsedData: styleId } = yield sdk.characterStyle.create();
|
|
340
|
+
const characterStyleUpdate = mapBrandKitStyleToLocal(style, localColor, fontKey);
|
|
341
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
342
|
+
yield sdk.characterStyle.rename(styleId, style.name);
|
|
343
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
344
|
+
yield sdk.characterStyle.update(styleId, characterStyleUpdate);
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
setMedia(studioBrandKit) {
|
|
349
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
350
|
+
for (const media of studioBrandKit.brandKit.media || []) {
|
|
351
|
+
yield this.addMedia(media.name, media.mediaConnectorId, media.mediaId);
|
|
352
|
+
}
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
_BrandKitController_editorAPI = new WeakMap();
|
|
357
|
+
//# sourceMappingURL=BrandKitController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrandKitController.js","sourceRoot":"","sources":["../../../../src/controllers/BrandKitController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACrH,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAQpE;;;GAGG;AAEH,MAAM,OAAO,kBAAkB;IAM3B;;OAEG;IACH,YAAY,SAAoB,EAAE,GAAQ;QAR1C;;WAEG;QACH,gDAAsB;QA4BtB;;;WAGG;QACH,UAAK,GAAG,GAAS,EAAE;YACf,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,qCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAS,MAAM,CAAC,CAAC,CAAC;QACvF,CAAC,CAAA,CAAC;QAEF;;;WAGG;QACH,eAAU,GAAG,GAAS,EAAE;YACpB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,qCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAS,MAAM,CAAC,CAAC,CAAC;QAC5F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B,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC1G,MAAM,YAAY,GAAG,KAAK,CAAC,sBAAsB;oBAC7C,CAAC,CAAC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,sBAAsB,CAAC;oBACpD,CAAC,CAAC,SAAS,CAAC;gBAChB,MAAM,UAAU,GAAG,YAAY,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;gBAC3D,MAAM,OAAO,GAAG,UAAU,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;gBAExE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC;gBAElE,MAAM,oBAAoB,GAAG,uBAAuB,CAChD,KAAK,EACL,UAAU,EACV,OAAO,CACV,CAAC;gBACF,oEAAoE;gBACpE,MAAM,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,OAAQ,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;gBACtD,oEAAoE;gBACpE,MAAM,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,OAAQ,EAAE,oBAAoB,CAAC,CAAC;YACpE,CAAC;QACL,CAAC;KAAA;IAEa,QAAQ,CAAC,cAA8B;;YACjD,KAAK,MAAM,KAAK,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,EAAE,CAAC;gBACtD,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;YAC3E,CAAC;QACL,CAAC;KAAA;CACJ"}
|
|
@@ -21,22 +21,22 @@ export declare class CanvasController {
|
|
|
21
21
|
* @param height
|
|
22
22
|
* @returns
|
|
23
23
|
*/
|
|
24
|
-
zoomToPage: (_id?: Id | null, left?: number | null, top?: number | null, width?: number | null, height?: number | null) => Promise<import(
|
|
24
|
+
zoomToPage: (_id?: Id | null, left?: number | null, top?: number | null, width?: number | null, height?: number | null) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
25
25
|
/**
|
|
26
26
|
* This method gets the scale factor of the canvas
|
|
27
27
|
* @returns scale factor in percents
|
|
28
28
|
*/
|
|
29
|
-
getZoomPercentage: () => Promise<import(
|
|
29
|
+
getZoomPercentage: () => Promise<import('../types/CommonTypes').EditorResponse<number>>;
|
|
30
30
|
/**
|
|
31
31
|
* This method sets the scale factor to the canvas and re-centers the page
|
|
32
32
|
* @param scaleFactor scale factor in percents
|
|
33
33
|
* @returns
|
|
34
34
|
*/
|
|
35
|
-
setZoomPercentage: (scaleFactor: number) => Promise<import(
|
|
35
|
+
setZoomPercentage: (scaleFactor: number) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
36
36
|
/**
|
|
37
37
|
* This method sets a new view mode
|
|
38
38
|
* @param viewMode view mode of the editor
|
|
39
39
|
* @returns
|
|
40
40
|
*/
|
|
41
|
-
setViewMode: (viewMode: ViewMode) => Promise<import(
|
|
41
|
+
setViewMode: (viewMode: ViewMode) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
42
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CanvasController.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"CanvasController.js","sourceRoot":"","sources":["../../../../src/controllers/CanvasController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;GAGG;AACH,MAAM,OAAO,gBAAgB;IAMzB;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,8CAAsB;QAStB;;;;;;;;;;WAUG;QACH,eAAU,GAAG,CACT,GAAe,EACf,IAAoB,EACpB,GAAmB,EACnB,KAAqB,EACrB,MAAsB,EACxB,EAAE;YACA,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;gBACpB,OAAO,CAAC,IAA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ns the list of character styles
|
|
15
15
|
* @returns list of all character styles
|
|
16
16
|
*/
|
|
17
|
-
getAll: () => Promise<import(
|
|
17
|
+
getAll: () => Promise<import('../types/CommonTypes').EditorResponse<CharacterStyle[]>>;
|
|
18
18
|
/**
|
|
19
19
|
* This method returns a character style by the id
|
|
20
20
|
* @param characterStyleId the id of a specific character style
|
|
21
21
|
* @returns character style for given id
|
|
22
22
|
*/
|
|
23
|
-
getById: (characterStyleId: Id) => Promise<import(
|
|
23
|
+
getById: (characterStyleId: Id) => Promise<import('../types/CommonTypes').EditorResponse<CharacterStyle>>;
|
|
24
24
|
/**
|
|
25
25
|
* This method creates a new character style
|
|
26
26
|
* @returns the id of new character style
|
|
27
27
|
*/
|
|
28
|
-
create: () => Promise<import(
|
|
28
|
+
create: () => Promise<import('../types/CommonTypes').EditorResponse<string>>;
|
|
29
29
|
/**
|
|
30
30
|
* This method updates a character style by the id and provided properties
|
|
31
31
|
* @param characterStyleId the id of a specific character style
|
|
32
32
|
* @param characterStyle the new character style properties
|
|
33
33
|
* @returns
|
|
34
34
|
*/
|
|
35
|
-
update: (characterStyleId: Id, characterStyle: CharacterStyleUpdate) => Promise<import(
|
|
35
|
+
update: (characterStyleId: Id, characterStyle: CharacterStyleUpdate) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
36
36
|
/**
|
|
37
37
|
* This method removes a character style by the id
|
|
38
38
|
* @param characterStyleId the id of a specific character style
|
|
39
39
|
* @returns
|
|
40
40
|
*/
|
|
41
|
-
remove: (characterStyleId: Id) => Promise<import(
|
|
41
|
+
remove: (characterStyleId: Id) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
42
42
|
/**
|
|
43
43
|
* This method duplicates a character style by the id
|
|
44
44
|
* @param characterStyleId the id of a specific character style
|
|
45
45
|
* @returns id of the duplicated character style
|
|
46
46
|
*/
|
|
47
|
-
duplicate: (characterStyleId: Id) => Promise<import(
|
|
47
|
+
duplicate: (characterStyleId: Id) => Promise<import('../types/CommonTypes').EditorResponse<string>>;
|
|
48
48
|
/**
|
|
49
49
|
* This method renames a character style by the id
|
|
50
50
|
* @param characterStyleId the id of a specific character style
|
|
51
51
|
* @param characterStyleName the new name of the character style
|
|
52
52
|
* @returns
|
|
53
53
|
*/
|
|
54
|
-
rename: (characterStyleId: Id, characterStyleName: string) => Promise<import(
|
|
54
|
+
rename: (characterStyleId: Id, characterStyleName: string) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
55
55
|
/**
|
|
56
56
|
* This method changes positions of character styles
|
|
57
57
|
* @param order the position of the character styles
|
|
58
58
|
* @param ids the list of character style ids
|
|
59
59
|
* @returns
|
|
60
60
|
*/
|
|
61
|
-
move: (order: number, ids: Id[]) => Promise<import(
|
|
61
|
+
move: (order: number, ids: Id[]) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
62
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CharacterStyleController.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"CharacterStyleController.js","sourceRoot":"","sources":["../../../../src/controllers/CharacterStyleController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE;;;GAGG;AACH,MAAM,OAAO,wBAAwB;IAMjC;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,sDAAsB;QAStB;;;WAGG;QACH,WAAM,GAAG,GAAS,EAAE;YAChB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,2CAAW,CAAC;YAClC,OAAO,GAAG,CAAC,kBAAkB,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAmB,MAAM,CAAC,CAAC,CAAC;QACtG,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACH,YAAO,GAAG,CAAO,gBAAoB,EAAE,EAAE;YACrC,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI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AAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAK,MAAM,CAAC,CAAC,CAAC;QAC7G,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACH,WAAM,GAAG,CAAO,gBAAoB,EAAE,kBAA0B,EAAE,EAAE;YAChE,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,2CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,oBAAoB,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;iBAC1D,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACH,SAAI,GAAG,CAAO,KAAa,EAAE,GAAS,EAAE,EAAE;YACtC,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,2CAAW,CAAC;YAClC,OAAO,GAAG,CAAC,mBAAmB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACrG,CAAC,CAAA,CAAC;QAxFE,uBAAA,IAAI,uCAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CAwFJ"}
|
|
@@ -15,22 +15,22 @@ export declare class ClipboardController {
|
|
|
15
15
|
* @param ids An array of all frame ids you want to copy
|
|
16
16
|
* @returns
|
|
17
17
|
*/
|
|
18
|
-
copyFrames: (ids: Id[]) => Promise<import(
|
|
18
|
+
copyFrames: (ids: Id[]) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
19
19
|
/**
|
|
20
20
|
* This method will remove the frames and store them to the OS clipboard as
|
|
21
21
|
* a json frame
|
|
22
22
|
* @param ids An array of all frame ids you want to cut
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
|
-
cutFrames: (ids: Id[]) => Promise<import(
|
|
25
|
+
cutFrames: (ids: Id[]) => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
26
26
|
/**
|
|
27
27
|
* This method will paste the OS clipboard content to the editor as frames
|
|
28
28
|
* @returns
|
|
29
29
|
*/
|
|
30
|
-
pasteFrames: () => Promise<import(
|
|
30
|
+
pasteFrames: () => Promise<import('../types/CommonTypes').EditorResponse<null>>;
|
|
31
31
|
/**
|
|
32
32
|
* This method will get the content type of the OS clipboard
|
|
33
33
|
* @returns content type
|
|
34
34
|
*/
|
|
35
|
-
getContentType: () => Promise<import(
|
|
35
|
+
getContentType: () => Promise<import('../types/CommonTypes').EditorResponse<ClipboardContentType>>;
|
|
36
36
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClipboardController.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"ClipboardController.js","sourceRoot":"","sources":["../../../../src/controllers/ClipboardController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IAM5B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,iDAAsB;QAStB;;;;WAIG;QACH,eAAU,GAAG,CAAO,GAAS,EAAE,EAAE;YAC7B,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAClC,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;YAE5C,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACjB,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;YAED,OAAO,qBAAqB,CAAO,SAAS,CAAC,CAAC;QAClD,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACH,cAAS,GAAG,CAAO,GAAS,EAAE,EAAE;YAC5B,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAClC,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAE3C,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;gBACjB,MAAM,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YACxD,CAAC;YAED,OAAO,qBAAqB,CAAO,SAAS,CAAC,CAAC;QAClD,CAAC,CAAA,CAAC;QAEF;;;WAGG;QACH,gBAAW,GAAG,GAAS,EAAE;YACrB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAElC,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;YAEpD,OAAO,qBAAqB,CAAO,MAAM,CAAC,CAAC;QAC/C,CAAC,CAAA,CAAC;QAEF;;;WAGG;QACH,mBAAc,GAAG,GAAS,EAAE;YACxB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAElC,MAAM,aAAa,GAAG,MAAM,SAAS,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC3D,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,uBAAuB,CAAC,aAAa,CAAC,CAAC;YAEhE,OAAO,qBAAqB,CAAuB,MAAM,CAAC,CAAC;QAC/D,CAAC,CAAA,CAAC;QA5DE,uBAAA,IAAI,kCAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CA4DJ"}
|
|
@@ -15,5 +15,5 @@ export declare class ColorConversionController {
|
|
|
15
15
|
* @param color the color to convert
|
|
16
16
|
* @returns the rgb representation of the given color
|
|
17
17
|
*/
|
|
18
|
-
convertToRgb: (color: Color) => Promise<import(
|
|
18
|
+
convertToRgb: (color: Color) => Promise<import('../types/CommonTypes').EditorResponse<RGBColor>>;
|
|
19
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorConversionController.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"ColorConversionController.js","sourceRoot":"","sources":["../../../../src/controllers/ColorConversionController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IAMlC;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,uDAAsB;QAStB;;;;WAIG;QACH,iBAAY,GAAG,CAAO,KAAY,EAAE,EAAE;YAClC,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,4CAAW,CAAC;YAClC,OAAO,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAW,MAAM,CAAC,CAAC,CAAC;QAC3G,CAAC,CAAA,CAAC;QAXE,uBAAA,IAAI,wCAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CAWJ"}
|