@chili-publish/studio-sdk 1.46.1 → 1.47.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.js +4 -4
- package/_bundles/main.js.map +1 -1
- package/lib/src/controllers/ComponentGridController.cjs.js.map +1 -1
- package/lib/src/controllers/ComponentGridController.es.js.map +1 -1
- package/lib/src/controllers/FrameController.cjs.js +8 -0
- package/lib/src/controllers/FrameController.cjs.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +14 -0
- package/lib/src/controllers/FrameController.es.js +8 -0
- package/lib/src/controllers/FrameController.es.js.map +1 -1
- package/lib/src/controllers/UtilsController.cjs.js +4 -1
- package/lib/src/controllers/UtilsController.cjs.js.map +1 -1
- package/lib/src/controllers/UtilsController.es.js +4 -1
- package/lib/src/controllers/UtilsController.es.js.map +1 -1
- package/lib/src/interactions/Connector.cjs.js +29 -10
- package/lib/src/interactions/Connector.cjs.js.map +1 -1
- package/lib/src/interactions/Connector.d.ts +2 -2
- package/lib/src/interactions/Connector.es.js +29 -10
- package/lib/src/interactions/Connector.es.js.map +1 -1
- package/lib/src/next/controllers/PageController.cjs.js +1 -0
- package/lib/src/next/controllers/PageController.cjs.js.map +1 -1
- package/lib/src/next/controllers/PageController.es.js +1 -0
- package/lib/src/next/controllers/PageController.es.js.map +1 -1
- package/lib/src/sdk/editor-engine.json.cjs.js +1 -1
- package/lib/src/sdk/editor-engine.json.es.js +1 -1
- package/lib/src/sdk/package.json.cjs.js +1 -1
- package/lib/src/sdk/package.json.es.js +1 -1
- package/lib/src/sdk.cjs.js +26 -13
- package/lib/src/sdk.cjs.js.map +1 -1
- package/lib/src/sdk.d.ts +14 -0
- package/lib/src/sdk.es.js +26 -13
- package/lib/src/sdk.es.js.map +1 -1
- package/lib/src/types/BarcodeTypes.cjs.js.map +1 -1
- package/lib/src/types/BarcodeTypes.d.ts +3 -1
- package/lib/src/types/BarcodeTypes.es.js.map +1 -1
- package/lib/src/types/BrandKitTypes.d.ts +4 -2
- package/lib/src/types/CharacterStyleTypes.d.ts +6 -2
- package/lib/src/types/ColorStyleTypes.cjs.js.map +1 -1
- package/lib/src/types/ColorStyleTypes.es.js.map +1 -1
- package/lib/src/types/ComponentGridTypes.cjs.js.map +1 -1
- package/lib/src/types/ComponentGridTypes.es.js.map +1 -1
- package/lib/src/types/ConnectorTypes.cjs.js.map +1 -1
- package/lib/src/types/ConnectorTypes.es.js.map +1 -1
- package/lib/src/types/FrameTypes.cjs.js.map +1 -1
- package/lib/src/types/FrameTypes.d.ts +5 -0
- package/lib/src/types/FrameTypes.es.js.map +1 -1
- package/lib/src/types/ParagraphStyleTypes.cjs.js.map +1 -1
- package/lib/src/types/ParagraphStyleTypes.d.ts +6 -2
- package/lib/src/types/ParagraphStyleTypes.es.js.map +1 -1
- package/lib/src/types/RichTextRuleTypes.cjs.js.map +1 -1
- package/lib/src/types/RichTextRuleTypes.es.js.map +1 -1
- package/lib/src/types/ShapeTypes.cjs.js.map +1 -1
- package/lib/src/types/ShapeTypes.d.ts +2 -0
- package/lib/src/types/ShapeTypes.es.js.map +1 -1
- package/lib/src/types/TextStyleTypes.cjs.js.map +1 -1
- package/lib/src/types/TextStyleTypes.d.ts +2 -1
- package/lib/src/types/TextStyleTypes.es.js.map +1 -1
- package/lib/src/types/VariableTypes.cjs.js.map +1 -1
- package/lib/src/types/VariableTypes.es.js.map +1 -1
- package/lib/src/utils/EngineCallbackHandler.cjs.js.map +1 -1
- package/lib/src/utils/EngineCallbackHandler.es.js.map +1 -1
- package/lib/src/utils/EngineEvent.cjs.js.map +1 -1
- package/lib/src/utils/EngineEvent.es.js.map +1 -1
- package/package.json +17 -20
package/lib/src/sdk.d.ts
CHANGED
|
@@ -95,6 +95,7 @@ export declare class SDK {
|
|
|
95
95
|
private localConfig;
|
|
96
96
|
private dataItemMappingTools;
|
|
97
97
|
private methodListeners;
|
|
98
|
+
private teardownFrame;
|
|
98
99
|
/**
|
|
99
100
|
* The SDK should be configured clientside and it exposes all controllers to work with in other applications
|
|
100
101
|
* @param config The configuration object where the SDK and editor can get configured
|
|
@@ -106,6 +107,19 @@ export declare class SDK {
|
|
|
106
107
|
*/
|
|
107
108
|
loadEditor: () => void;
|
|
108
109
|
setConnection: (newConnection: Connection) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Shuts this SDK instance down and releases the engine it loaded.
|
|
112
|
+
*
|
|
113
|
+
* This tears down the postMessage connection, removes the engine iframe from the
|
|
114
|
+
* document and drops the references the SDK itself holds. Removing the iframe is what
|
|
115
|
+
* lets the browser discard the engine realm, which is where the bulk of the memory
|
|
116
|
+
* lives (the Dart heap plus the CanvasKit and QuickJS WASM memory).
|
|
117
|
+
*
|
|
118
|
+
* Call this whenever an integration unmounts an editor it previously created with
|
|
119
|
+
* {@link loadEditor}. Without it every mount leaves a fully live engine behind.
|
|
120
|
+
* The method is safe to call more than once.
|
|
121
|
+
*/
|
|
122
|
+
destroy: () => void;
|
|
109
123
|
private toInstrumented;
|
|
110
124
|
/**
|
|
111
125
|
* Wraps every controller previously handed to `toInstrumented` with the invocation
|
package/lib/src/sdk.es.js
CHANGED
|
@@ -45,7 +45,6 @@ import { MethodListenerRegistry, wrapWithInvocationObserver } from "./utils/Meth
|
|
|
45
45
|
import { SdkEvents } from "./utils/SdkEvents.es.js";
|
|
46
46
|
const ENGINE_DOMAIN = "studio-cdn.chiligrafx.com";
|
|
47
47
|
const FIXED_EDITOR_LINK = `https://${ENGINE_DOMAIN}/editor/${engineInfo.current}/web`;
|
|
48
|
-
let connection;
|
|
49
48
|
const PENDING_INSTRUMENTATION = Symbol("pendingInstrumentation");
|
|
50
49
|
const markForInstrumentation = (controller) => {
|
|
51
50
|
Object.defineProperty(controller, PENDING_INSTRUMENTATION, {
|
|
@@ -63,13 +62,15 @@ class SDK {
|
|
|
63
62
|
* @param config The configuration object where the SDK and editor can get configured
|
|
64
63
|
*/
|
|
65
64
|
constructor(config) {
|
|
66
|
-
var _a;
|
|
65
|
+
var _a, _b;
|
|
67
66
|
this.localConfig = /* @__PURE__ */ new Map();
|
|
68
67
|
this.dataItemMappingTools = new DataItemMappingTools();
|
|
69
68
|
this.methodListeners = new MethodListenerRegistry();
|
|
69
|
+
this.teardownFrame = null;
|
|
70
70
|
this.loadEditor = () => {
|
|
71
|
-
var _a2;
|
|
72
|
-
|
|
71
|
+
var _a2, _b2, _c;
|
|
72
|
+
(_a2 = this.teardownFrame) == null ? void 0 : _a2.call(this);
|
|
73
|
+
this.teardownFrame = Connect(
|
|
73
74
|
this.config.editorLink || FIXED_EDITOR_LINK,
|
|
74
75
|
{
|
|
75
76
|
onActionsChanged: this.subscriber.onActionsChanged,
|
|
@@ -141,11 +142,11 @@ class SDK {
|
|
|
141
142
|
this.config.editorId,
|
|
142
143
|
this.config.studioStyling,
|
|
143
144
|
(error) => {
|
|
144
|
-
var _a3,
|
|
145
|
-
(
|
|
145
|
+
var _a3, _b3;
|
|
146
|
+
(_b3 = (_a3 = this.config).onConnectionError) == null ? void 0 : _b3.call(_a3, error);
|
|
146
147
|
}
|
|
147
148
|
);
|
|
148
|
-
this.editorAPI = connection == null ? void 0 :
|
|
149
|
+
this.editorAPI = (_b2 = this.connection) == null ? void 0 : _b2.promise.then((editorAPI) => {
|
|
149
150
|
return editorAPI;
|
|
150
151
|
});
|
|
151
152
|
this.action = this.toInstrumented(new ActionController(this.editorAPI));
|
|
@@ -169,7 +170,9 @@ class SDK {
|
|
|
169
170
|
this.mediaConnector = this.toInstrumented(new MediaConnectorController(this.editorAPI));
|
|
170
171
|
this.fontConnector = this.toInstrumented(new FontConnectorController(this.editorAPI));
|
|
171
172
|
this.componentConnector = this.toInstrumented(new ComponentConnectorController(this.editorAPI));
|
|
172
|
-
this.dataConnector = this.toInstrumented(
|
|
173
|
+
this.dataConnector = this.toInstrumented(
|
|
174
|
+
new DataConnectorController(this.editorAPI, this.dataItemMappingTools)
|
|
175
|
+
);
|
|
173
176
|
this.dataSource = this.toInstrumented(new DataSourceController(this.editorAPI, this.dataItemMappingTools));
|
|
174
177
|
this.connector = this.toInstrumented(new ConnectorController(this.editorAPI, this.localConfig));
|
|
175
178
|
this.variable = this.toInstrumented(new VariableController(this.editorAPI, this.dataItemMappingTools));
|
|
@@ -192,11 +195,20 @@ class SDK {
|
|
|
192
195
|
this.configuration.updateStudioOptions(this.config.studioOptions || defaultStudioOptions);
|
|
193
196
|
this.configuration.setValue(
|
|
194
197
|
WellKnownConfigurationKeys.QueryCallCacheEnabled,
|
|
195
|
-
((
|
|
198
|
+
((_c = this.config.enableQueryCallCache) == null ? void 0 : _c.toString()) || "false"
|
|
196
199
|
);
|
|
197
200
|
};
|
|
198
201
|
this.setConnection = (newConnection) => {
|
|
199
|
-
connection = newConnection;
|
|
202
|
+
this.connection = newConnection;
|
|
203
|
+
};
|
|
204
|
+
this.destroy = () => {
|
|
205
|
+
var _a2, _b2;
|
|
206
|
+
try {
|
|
207
|
+
(_a2 = this.connection) == null ? void 0 : _a2.destroy();
|
|
208
|
+
} catch {
|
|
209
|
+
}
|
|
210
|
+
(_b2 = this.teardownFrame) == null ? void 0 : _b2.call(this);
|
|
211
|
+
this.teardownFrame = null;
|
|
200
212
|
};
|
|
201
213
|
this.toInstrumented = (controller) => {
|
|
202
214
|
markForInstrumentation(controller);
|
|
@@ -220,8 +232,7 @@ class SDK {
|
|
|
220
232
|
};
|
|
221
233
|
this.config = ConfigHelper.createRuntimeConfig(config);
|
|
222
234
|
this.sdkEvents = new SdkEvents((_a = this.config.logging) == null ? void 0 : _a.logger);
|
|
223
|
-
this.
|
|
224
|
-
this.editorAPI = connection == null ? void 0 : connection.promise.then((child) => {
|
|
235
|
+
this.editorAPI = (_b = this.connection) == null ? void 0 : _b.promise.then((child) => {
|
|
225
236
|
return child;
|
|
226
237
|
});
|
|
227
238
|
this.action = this.toInstrumented(new ActionController(this.editorAPI));
|
|
@@ -235,7 +246,9 @@ class SDK {
|
|
|
235
246
|
this.mediaConnector = this.toInstrumented(new MediaConnectorController(this.editorAPI));
|
|
236
247
|
this.fontConnector = this.toInstrumented(new FontConnectorController(this.editorAPI));
|
|
237
248
|
this.componentConnector = this.toInstrumented(new ComponentConnectorController(this.editorAPI));
|
|
238
|
-
this.dataConnector = this.toInstrumented(
|
|
249
|
+
this.dataConnector = this.toInstrumented(
|
|
250
|
+
new DataConnectorController(this.editorAPI, this.dataItemMappingTools)
|
|
251
|
+
);
|
|
239
252
|
this.dataSource = this.toInstrumented(new DataSourceController(this.editorAPI, this.dataItemMappingTools));
|
|
240
253
|
this.animation = this.toInstrumented(new AnimationController(this.editorAPI));
|
|
241
254
|
this.document = this.toInstrumented(new DocumentController(this.editorAPI));
|
package/lib/src/sdk.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.es.js","sources":["../../src/sdk.ts"],"sourcesContent":["import { Connection } from 'penpal';\nimport engineInfo from '../editor-engine.json';\nimport packageInfo from '../package.json';\nimport Connect from './interactions/Connector';\nimport { defaultStudioOptions, WellKnownConfigurationKeys } from './types/ConfigurationTypes';\n\nimport type { ConfigType, EditorAPI, RuntimeConfigType } from './types/CommonTypes';\nimport { Instrumented } from './types/MethodInvocationTypes';\nimport { DocumentType } from './types/DocumentTypes';\n\nimport { ActionController } from './controllers/ActionController';\nimport { AnimationController } from './controllers/AnimationController';\nimport { BarcodeController } from './controllers/BarcodeController';\nimport { BrandKitController } from './controllers/BrandKitController';\nimport { CanvasController } from './controllers/CanvasController';\nimport { CharacterStyleController } from './controllers/CharacterStyleController';\nimport { ClipboardController } from './controllers/ClipboardController';\nimport { ColorConversionController } from './controllers/ColorConversionController';\nimport { ColorStyleController } from './controllers/ColorStyleController';\nimport { ConfigurationController } from './controllers/ConfigurationController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { DataConnectorController } from './controllers/DataConnectorController';\nimport { DataSourceController } from './controllers/DataSourceController';\nimport { DebugController } from './controllers/DebugController';\nimport { DocumentController } from './controllers/DocumentController';\nimport { ExperimentController } from './controllers/ExperimentController';\nimport { FontConnectorController } from './controllers/FontConnectorController';\nimport { FontController } from './controllers/FontController';\nimport { FrameController } from './controllers/FrameController';\nimport { InfoController } from './controllers/InfoController';\nimport { LayoutController } from './controllers/LayoutController';\nimport { MediaConnectorController } from './controllers/MediaConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { ParagraphStyleController } from './controllers/ParagraphStyleController';\nimport { ShapeController } from './controllers/ShapeController';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { TextStyleController } from './controllers/TextStyleController';\nimport { ToolController } from './controllers/ToolController';\nimport { UndoManagerController } from './controllers/UndoManagerController';\nimport { UtilsController } from './controllers/UtilsController';\nimport { VariableController } from './controllers/VariableController';\nimport { NextSubscribers } from './next';\nimport { NextInitiator } from './next/NextInitiator';\nimport { ConfigHelper } from './utils/ConfigHelper';\nimport { DataItemMappingTools } from './utils/DataItemMappingTools';\nimport { LocalConfigurationDecorator } from './utils/LocalConfigurationDecorator';\nimport { GradientStyleController } from './controllers/GradientStyleController';\nimport { ComponentConnectorController } from './controllers/ComponentConnectorController';\nimport { ComponentController } from './controllers/ComponentController';\nimport { ComponentGridController } from './controllers/ComponentGridController';\nimport { MethodListenerRegistry, wrapWithInvocationObserver } from './utils/MethodInstrumentation';\nimport { SdkEvents } from './utils/SdkEvents';\n\ndeclare const __ENGINE_DOMAIN__: string;\nconst ENGINE_DOMAIN = typeof __ENGINE_DOMAIN__ !== 'undefined' ? __ENGINE_DOMAIN__ : 'studio-cdn.chiligrafx.com';\nconst FIXED_EDITOR_LINK = `https://${ENGINE_DOMAIN}/editor/${engineInfo.current}/web`;\n\nlet connection: Connection;\n\n// Marks a freshly created controller as \"needs instrumentation\" without requiring\n// its property name to be tracked anywhere. `applyMethodInstrumentation` later scans\n// the SDK instance for properties carrying this marker and wraps them automatically,\n// so a controller can never be silently skipped just because a list wasn't updated.\nconst PENDING_INSTRUMENTATION = Symbol('pendingInstrumentation');\n\nconst markForInstrumentation = (controller: object): void => {\n Object.defineProperty(controller, PENDING_INSTRUMENTATION, {\n value: true,\n enumerable: false,\n configurable: true,\n });\n};\n\nconst isPendingInstrumentation = (value: unknown): value is object => {\n return typeof value === 'object' && value !== null && (value as Record<symbol, unknown>)[PENDING_INSTRUMENTATION] === true;\n};\n\nexport class SDK {\n config: RuntimeConfigType;\n connection: Connection;\n\n /**\n * @ignore\n */\n editorAPI: EditorAPI;\n /**\n * SDK method invocation events.\n *\n * Use this to observe which SDK controller method was called and with which parameters/result.\n * These are SDK-level events (SDK -> consumer), separate from engine subscriber events (`config.events`).\n */\n sdkEvents: SdkEvents;\n\n action: Instrumented<ActionController>;\n layout: Instrumented<LayoutController>;\n frame: Instrumented<FrameController>;\n shape: Instrumented<ShapeController>;\n barcode: Instrumented<BarcodeController>;\n /** @experimental */\n component: Instrumented<ComponentController>;\n connector: Instrumented<ConnectorController>;\n mediaConnector: Instrumented<MediaConnectorController>;\n fontConnector: Instrumented<FontConnectorController>;\n /**\n * @experimental This controller is still experimental and might change in future releases.\n */\n componentConnector: Instrumented<ComponentConnectorController>;\n dataConnector: Instrumented<DataConnectorController>;\n dataSource: Instrumented<DataSourceController>;\n animation: Instrumented<AnimationController>;\n document: Instrumented<DocumentController>;\n configuration: Instrumented<ConfigurationController>;\n variable: Instrumented<VariableController>;\n utils: Instrumented<UtilsController>;\n tool: Instrumented<ToolController>;\n page: Instrumented<PageController>;\n debug: Instrumented<DebugController>;\n undoManager: Instrumented<UndoManagerController>;\n textSelection: Instrumented<TextStyleController>;\n paragraphStyle: Instrumented<ParagraphStyleController>;\n characterStyle: Instrumented<CharacterStyleController>;\n colorStyle: Instrumented<ColorStyleController>;\n gradientStyle: Instrumented<GradientStyleController>;\n font: Instrumented<FontController>;\n experiment: Instrumented<ExperimentController>;\n canvas: Instrumented<CanvasController>;\n colorConversion: Instrumented<ColorConversionController>;\n info: Instrumented<InfoController>;\n clipboard: Instrumented<ClipboardController>;\n brandKit: Instrumented<BrandKitController>;\n componentGrid: Instrumented<ComponentGridController>;\n\n next: NextInitiator;\n\n private subscriber: SubscriberController;\n private enabledNextSubscribers: NextSubscribers | undefined;\n private localConfig = new Map<string, string>();\n private dataItemMappingTools = new DataItemMappingTools();\n private methodListeners = new MethodListenerRegistry();\n\n /**\n * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n * @param config The configuration object where the SDK and editor can get configured\n */\n constructor(config: ConfigType) {\n this.config = ConfigHelper.createRuntimeConfig(config);\n this.sdkEvents = new SdkEvents(this.config.logging?.logger);\n\n this.connection = connection;\n this.editorAPI = connection?.promise.then((child: unknown) => {\n return child;\n }) as unknown as EditorAPI;\n\n this.action = this.toInstrumented(new ActionController(this.editorAPI));\n this.layout = this.toInstrumented(new LayoutController(this.editorAPI));\n this.frame = this.toInstrumented(new FrameController(this.editorAPI));\n this.shape = this.toInstrumented(new ShapeController(this.editorAPI));\n this.barcode = this.toInstrumented(new BarcodeController(this.editorAPI));\n this.component = this.toInstrumented(new ComponentController(this.editorAPI));\n this.undoManager = this.toInstrumented(new UndoManagerController(this.editorAPI, this));\n this.connector = this.toInstrumented(new ConnectorController(this.editorAPI, this.localConfig));\n this.mediaConnector = this.toInstrumented(new MediaConnectorController(this.editorAPI));\n this.fontConnector = this.toInstrumented(new FontConnectorController(this.editorAPI));\n this.componentConnector = this.toInstrumented(new ComponentConnectorController(this.editorAPI));\n this.dataConnector = this.toInstrumented(new DataConnectorController(this.editorAPI, this.dataItemMappingTools));\n this.dataSource = this.toInstrumented(new DataSourceController(this.editorAPI, this.dataItemMappingTools));\n this.animation = this.toInstrumented(new AnimationController(this.editorAPI));\n this.document = this.toInstrumented(new DocumentController(this.editorAPI));\n\n this.configuration = this.toInstrumented(new LocalConfigurationDecorator(this.editorAPI, this.localConfig));\n this.variable = this.toInstrumented(new VariableController(this.editorAPI, this.dataItemMappingTools));\n this.utils = this.toInstrumented(new UtilsController(this.editorAPI, this.localConfig));\n this.subscriber = new SubscriberController(this.config, this.localConfig);\n this.tool = this.toInstrumented(new ToolController(this.editorAPI));\n this.page = this.toInstrumented(new PageController(this.editorAPI));\n this.debug = this.toInstrumented(new DebugController(this.editorAPI));\n // To be renamed textSelection > textStyle\n this.textSelection = this.toInstrumented(new TextStyleController(this.editorAPI));\n this.colorStyle = this.toInstrumented(new ColorStyleController(this.editorAPI));\n this.gradientStyle = this.toInstrumented(new GradientStyleController(this.editorAPI));\n this.paragraphStyle = this.toInstrumented(new ParagraphStyleController(this.editorAPI));\n this.characterStyle = this.toInstrumented(new CharacterStyleController(this.editorAPI));\n this.font = this.toInstrumented(new FontController(this.editorAPI));\n this.experiment = this.toInstrumented(new ExperimentController(this.editorAPI));\n this.canvas = this.toInstrumented(new CanvasController(this.editorAPI));\n this.colorConversion = this.toInstrumented(new ColorConversionController(this.editorAPI));\n this.info = this.toInstrumented(new InfoController());\n this.clipboard = this.toInstrumented(new ClipboardController(this.editorAPI));\n this.next = new NextInitiator(this.config, this.connection, this.editorAPI);\n this.enabledNextSubscribers = this.config.enableNextSubscribers;\n this.brandKit = this.toInstrumented(new BrandKitController(this.editorAPI, this));\n this.componentGrid = this.toInstrumented(new ComponentGridController(this.editorAPI));\n\n this.applyMethodInstrumentation();\n }\n\n /**\n * This method will initiate the editor, running this will result in the editor restarting\n * It will generate an iframe in the document\n */\n loadEditor = () => {\n Connect(\n this.config.editorLink || FIXED_EDITOR_LINK,\n {\n onActionsChanged: this.subscriber.onActionsChanged,\n onStateChanged: this.subscriber.onStateChanged,\n onAuthExpired: this.subscriber.onAuthExpired,\n onViewportRequested: this.subscriber.onViewportRequested,\n onDocumentLoaded: this.subscriber.onDocumentLoaded,\n onSelectedFramesContentChanged: this.subscriber.onSelectedFramesContentChanged,\n onSelectedFramesLayoutChanged: this.subscriber.onSelectedFramesLayoutChanged,\n onFramesLayoutChanged: this.subscriber.onFramesLayoutChanged,\n onSelectedLayoutPropertiesChanged: this.subscriber.onSelectedLayoutPropertiesChanged,\n onSelectedLayoutUnitChanged: this.subscriber.onSelectedLayoutUnitChanged,\n onPageSelectionChanged: this.subscriber.onPageSelectionChanged,\n onScrubberPositionChanged: this.subscriber.onAnimationPlaybackChanged,\n onFrameAnimationsChanged: this.subscriber.onAnimationChanged,\n onVariableListChanged: (state) => {\n if (this.enabledNextSubscribers?.onVariableListChanged) {\n this.next.subscriber.onVariableListChanged(state);\n } else {\n this.subscriber.onVariableListChanged(state);\n }\n },\n onSelectedToolChanged: this.subscriber.onSelectedToolChanged,\n onUndoStateChanged: this.subscriber.onUndoStateChanged,\n onSelectedLayoutFramesChanged: this.subscriber.onSelectedLayoutFramesChanged,\n onSelectedTextStyleChanged: this.subscriber.onSelectedTextStyleChanged,\n onColorsChanged: this.subscriber.onColorsChanged,\n onParagraphStylesChanged: this.subscriber.onParagraphStylesChanged,\n onCharacterStylesChanged: this.subscriber.onCharacterStylesChanged,\n onFontFamiliesChanged: this.subscriber.onFontFamiliesChanged,\n onSelectedLayoutIdChanged: this.subscriber.onSelectedLayoutIdChanged,\n onLayoutsChanged: this.subscriber.onLayoutsChanged,\n onConnectorEvent: this.subscriber.onConnectorEvent,\n onConnectorsChanged: (state) => {\n if (this.enabledNextSubscribers?.onConnectorsChanged) {\n this.next.subscriber.onConnectorsChanged(state);\n } else {\n this.subscriber.onConnectorsChanged(state);\n }\n },\n onZoomChanged: this.subscriber.onZoomChanged,\n onSelectedPageIdChanged: this.subscriber.onSelectedPageIdChanged,\n onPagesChanged: this.subscriber.onPagesChanged,\n onPageSnapshotInvalidated: this.subscriber.onPageSnapshotInvalidated,\n onPageSizeChanged: (state) => {\n if (this.enabledNextSubscribers?.onPageSizeChanged) {\n this.next.subscriber.onPageSizeChanged(state);\n } else {\n this.subscriber.onPageSizeChanged(state);\n }\n },\n onShapeCornerRadiusChanged: this.subscriber.onShapeCornerRadiusChanged,\n onCropActiveFrameIdChanged: this.subscriber.onCropActiveFrameIdChanged,\n onAsyncError: this.subscriber.onAsyncError,\n onViewModeChanged: this.subscriber.onViewModeChanged,\n onBarcodeValidationChanged: this.subscriber.onBarcodeValidationChanged,\n onDataSourceIdChanged: this.subscriber.onDataSourceIdChanged,\n onInjectedDataChanged: this.subscriber.onInjectedDataChanged,\n onDocumentIssueListChanged: this.subscriber.onDocumentIssueListChanged,\n onCustomUndoDataChanged: this.subscriber.onCustomUndoDataChanged,\n onEngineEditModeChanged: this.subscriber.onEngineEditModeChanged,\n onBrandKitMediaChanged: this.subscriber.onBrandKitMediaChanged,\n onCanvasFramesManipulated: this.subscriber.onCanvasFramesManipulated,\n },\n this.setConnection,\n this.config.editorId,\n this.config.studioStyling,\n (error) => {\n this.config.onConnectionError?.(error);\n },\n );\n this.editorAPI = connection?.promise.then((editorAPI: unknown) => {\n return editorAPI;\n }) as unknown as EditorAPI;\n\n this.action = this.toInstrumented(new ActionController(this.editorAPI));\n this.layout = this.toInstrumented(new LayoutController(this.editorAPI));\n this.frame = this.toInstrumented(new FrameController(this.editorAPI));\n this.barcode = this.toInstrumented(new BarcodeController(this.editorAPI));\n this.component = this.toInstrumented(new ComponentController(this.editorAPI));\n this.animation = this.toInstrumented(new AnimationController(this.editorAPI));\n this.document = this.toInstrumented(new DocumentController(this.editorAPI));\n this.configuration = this.toInstrumented(new LocalConfigurationDecorator(this.editorAPI, this.localConfig));\n this.utils = this.toInstrumented(new UtilsController(this.editorAPI, this.localConfig));\n this.tool = this.toInstrumented(new ToolController(this.editorAPI));\n this.page = this.toInstrumented(new PageController(this.editorAPI));\n this.debug = this.toInstrumented(new DebugController(this.editorAPI));\n this.undoManager = this.toInstrumented(new UndoManagerController(this.editorAPI, this));\n this.textSelection = this.toInstrumented(new TextStyleController(this.editorAPI));\n this.colorStyle = this.toInstrumented(new ColorStyleController(this.editorAPI));\n this.gradientStyle = this.toInstrumented(new GradientStyleController(this.editorAPI));\n this.paragraphStyle = this.toInstrumented(new ParagraphStyleController(this.editorAPI));\n this.characterStyle = this.toInstrumented(new CharacterStyleController(this.editorAPI));\n this.mediaConnector = this.toInstrumented(new MediaConnectorController(this.editorAPI));\n this.fontConnector = this.toInstrumented(new FontConnectorController(this.editorAPI));\n this.componentConnector = this.toInstrumented(new ComponentConnectorController(this.editorAPI));\n this.dataConnector = this.toInstrumented(new DataConnectorController(this.editorAPI, this.dataItemMappingTools));\n this.dataSource = this.toInstrumented(new DataSourceController(this.editorAPI, this.dataItemMappingTools));\n this.connector = this.toInstrumented(new ConnectorController(this.editorAPI, this.localConfig));\n this.variable = this.toInstrumented(new VariableController(this.editorAPI, this.dataItemMappingTools));\n this.font = this.toInstrumented(new FontController(this.editorAPI));\n this.experiment = this.toInstrumented(new ExperimentController(this.editorAPI));\n this.canvas = this.toInstrumented(new CanvasController(this.editorAPI));\n this.shape = this.toInstrumented(new ShapeController(this.editorAPI));\n this.colorConversion = this.toInstrumented(new ColorConversionController(this.editorAPI));\n this.info = this.toInstrumented(new InfoController());\n this.clipboard = this.toInstrumented(new ClipboardController(this.editorAPI));\n this.brandKit = this.toInstrumented(new BrandKitController(this.editorAPI, this));\n this.componentGrid = this.toInstrumented(new ComponentGridController(this.editorAPI));\n this.next = new NextInitiator(this.config, this.connection, this.editorAPI);\n\n this.applyMethodInstrumentation();\n\n // as soon as the editor loads, provide it with the SDK version\n // used to make it start. This enables engine compatibility checks\n // on the Flutter side\n this.configuration.setValue(WellKnownConfigurationKeys.GraFxStudioSdkVersion, packageInfo.version);\n\n // Makes the engine aware which document type it should render, if this call\n // isn't made, the engine will fall back to the type specified in the document.\n //\n // Loading a template JSON and setting the engine to `project` will cause\n // the document JSON structure to be converted to a project on save.\n // Using `getCurrentDocumentState` will also output the converted document.\n this.configuration.setValue(\n WellKnownConfigurationKeys.GraFxStudioDocumentType,\n this.config.documentType || DocumentType.template,\n );\n\n // Update the engine with the specified options from the config or fall back to the defaults.\n this.configuration.updateStudioOptions(this.config.studioOptions || defaultStudioOptions);\n\n // Whether the engine should cache query calls. This is disabled by default.\n this.configuration.setValue(\n WellKnownConfigurationKeys.QueryCallCacheEnabled,\n this.config.enableQueryCallCache?.toString() || 'false',\n );\n };\n\n setConnection = (newConnection: Connection) => {\n connection = newConnection;\n };\n\n private toInstrumented = <T extends object>(controller: T): Instrumented<T> => {\n markForInstrumentation(controller);\n return controller as unknown as Instrumented<T>;\n };\n\n /**\n * Wraps every controller previously handed to `toInstrumented` with the invocation\n * observer, discovering them by their marker rather than a manually maintained\n * list of property names. Any property assigned via `toInstrumented` is picked up\n * automatically, using its own property key as the controller name.\n */\n private applyMethodInstrumentation = () => {\n const sdkProperties = this as unknown as Record<string, unknown>;\n for (const propertyName of Object.keys(sdkProperties)) {\n const value = sdkProperties[propertyName];\n if (isPendingInstrumentation(value)) {\n sdkProperties[propertyName] = wrapWithInvocationObserver(\n value,\n propertyName,\n this.methodListeners,\n this.sdkEvents,\n this.config.logging?.logger,\n );\n }\n }\n };\n}\n\nexport default SDK;\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,gBAA2D;AACjE,MAAM,oBAAoB,WAAW,aAAa,WAAW,WAAW,OAAO;AAE/E,IAAI;AAMJ,MAAM,0BAA0B,OAAO,wBAAwB;AAE/D,MAAM,yBAAyB,CAAC,eAA6B;AACzD,SAAO,eAAe,YAAY,yBAAyB;AAAA,IACvD,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,cAAc;AAAA,EAAA,CACjB;AACL;AAEA,MAAM,2BAA2B,CAAC,UAAoC;AAClE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAS,MAAkC,uBAAuB,MAAM;AAC1H;AAEO,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,EAmEb,YAAY,QAAoB;;AARhC,SAAQ,kCAAkB,IAAA;AAC1B,SAAQ,uBAAuB,IAAI,qBAAA;AACnC,SAAQ,kBAAkB,IAAI,uBAAA;AA8D9B,SAAA,aAAa,MAAM;;AACf;AAAA,QACI,KAAK,OAAO,cAAc;AAAA,QAC1B;AAAA,UACI,kBAAkB,KAAK,WAAW;AAAA,UAClC,g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K,SAAS,CAAC;AAC9E,SAAK,SAAS,KAAK,eAAe,IAAI,iBAAiB,KAAK,SAAS,CAAC;AACtE,SAAK,kBAAkB,KAAK,eAAe,IAAI,0BAA0B,KAAK,SAAS,CAAC;AACxF,SAAK,OAAO,KAAK,eAAe,IAAI,gBAAgB;AACpD,SAAK,YAAY,KAAK,eAAe,IAAI,oBAAoB,KAAK,SAAS,CAAC;AAC5E,SAAK,OAAO,IAAI,cAAc,KAAK,QAAQ,KAAK,YAAY,KAAK,SAAS;AAC1E,SAAK,yBAAyB,KAAK,OAAO;AAC1C,SAAK,WAAW,KAAK,eAAe,IAAI,mBAAmB,KAAK,WAAW,IAAI,CAAC;AAChF,SAAK,gBAAgB,KAAK,eAAe,IAAI,wBAAwB,KAAK,SAAS,CAAC;AAEpF,SAAK,2BAAA;AAAA,EACT;AAiLJ;"}
|
|
1
|
+
{"version":3,"file":"sdk.es.js","sources":["../../src/sdk.ts"],"sourcesContent":["import { Connection } from 'penpal';\nimport engineInfo from '../editor-engine.json';\nimport packageInfo from '../package.json';\nimport Connect from './interactions/Connector';\nimport { defaultStudioOptions, WellKnownConfigurationKeys } from './types/ConfigurationTypes';\n\nimport type { ConfigType, EditorAPI, RuntimeConfigType } from './types/CommonTypes';\nimport { Instrumented } from './types/MethodInvocationTypes';\nimport { DocumentType } from './types/DocumentTypes';\n\nimport { ActionController } from './controllers/ActionController';\nimport { AnimationController } from './controllers/AnimationController';\nimport { BarcodeController } from './controllers/BarcodeController';\nimport { BrandKitController } from './controllers/BrandKitController';\nimport { CanvasController } from './controllers/CanvasController';\nimport { CharacterStyleController } from './controllers/CharacterStyleController';\nimport { ClipboardController } from './controllers/ClipboardController';\nimport { ColorConversionController } from './controllers/ColorConversionController';\nimport { ColorStyleController } from './controllers/ColorStyleController';\nimport { ConfigurationController } from './controllers/ConfigurationController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { DataConnectorController } from './controllers/DataConnectorController';\nimport { DataSourceController } from './controllers/DataSourceController';\nimport { DebugController } from './controllers/DebugController';\nimport { DocumentController } from './controllers/DocumentController';\nimport { ExperimentController } from './controllers/ExperimentController';\nimport { FontConnectorController } from './controllers/FontConnectorController';\nimport { FontController } from './controllers/FontController';\nimport { FrameController } from './controllers/FrameController';\nimport { InfoController } from './controllers/InfoController';\nimport { LayoutController } from './controllers/LayoutController';\nimport { MediaConnectorController } from './controllers/MediaConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { ParagraphStyleController } from './controllers/ParagraphStyleController';\nimport { ShapeController } from './controllers/ShapeController';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { TextStyleController } from './controllers/TextStyleController';\nimport { ToolController } from './controllers/ToolController';\nimport { UndoManagerController } from './controllers/UndoManagerController';\nimport { UtilsController } from './controllers/UtilsController';\nimport { VariableController } from './controllers/VariableController';\nimport { NextSubscribers } from './next';\nimport { NextInitiator } from './next/NextInitiator';\nimport { ConfigHelper } from './utils/ConfigHelper';\nimport { DataItemMappingTools } from './utils/DataItemMappingTools';\nimport { LocalConfigurationDecorator } from './utils/LocalConfigurationDecorator';\nimport { GradientStyleController } from './controllers/GradientStyleController';\nimport { ComponentConnectorController } from './controllers/ComponentConnectorController';\nimport { ComponentController } from './controllers/ComponentController';\nimport { ComponentGridController } from './controllers/ComponentGridController';\nimport { MethodListenerRegistry, wrapWithInvocationObserver } from './utils/MethodInstrumentation';\nimport { SdkEvents } from './utils/SdkEvents';\n\ndeclare const __ENGINE_DOMAIN__: string;\nconst ENGINE_DOMAIN = typeof __ENGINE_DOMAIN__ !== 'undefined' ? __ENGINE_DOMAIN__ : 'studio-cdn.chiligrafx.com';\nconst FIXED_EDITOR_LINK = `https://${ENGINE_DOMAIN}/editor/${engineInfo.current}/web`;\n\n// Marks a freshly created controller as \"needs instrumentation\" without requiring\n// its property name to be tracked anywhere. `applyMethodInstrumentation` later scans\n// the SDK instance for properties carrying this marker and wraps them automatically,\n// so a controller can never be silently skipped just because a list wasn't updated.\nconst PENDING_INSTRUMENTATION = Symbol('pendingInstrumentation');\n\nconst markForInstrumentation = (controller: object): void => {\n Object.defineProperty(controller, PENDING_INSTRUMENTATION, {\n value: true,\n enumerable: false,\n configurable: true,\n });\n};\n\nconst isPendingInstrumentation = (value: unknown): value is object => {\n return (\n typeof value === 'object' &&\n value !== null &&\n (value as Record<symbol, unknown>)[PENDING_INSTRUMENTATION] === true\n );\n};\n\nexport class SDK {\n config: RuntimeConfigType;\n // Set by `loadEditor` via `setConnection`; stays `undefined` until then.\n connection!: Connection;\n\n /**\n * @ignore\n */\n editorAPI: EditorAPI;\n /**\n * SDK method invocation events.\n *\n * Use this to observe which SDK controller method was called and with which parameters/result.\n * These are SDK-level events (SDK -> consumer), separate from engine subscriber events (`config.events`).\n */\n sdkEvents: SdkEvents;\n\n action: Instrumented<ActionController>;\n layout: Instrumented<LayoutController>;\n frame: Instrumented<FrameController>;\n shape: Instrumented<ShapeController>;\n barcode: Instrumented<BarcodeController>;\n /** @experimental */\n component: Instrumented<ComponentController>;\n connector: Instrumented<ConnectorController>;\n mediaConnector: Instrumented<MediaConnectorController>;\n fontConnector: Instrumented<FontConnectorController>;\n /**\n * @experimental This controller is still experimental and might change in future releases.\n */\n componentConnector: Instrumented<ComponentConnectorController>;\n dataConnector: Instrumented<DataConnectorController>;\n dataSource: Instrumented<DataSourceController>;\n animation: Instrumented<AnimationController>;\n document: Instrumented<DocumentController>;\n configuration: Instrumented<ConfigurationController>;\n variable: Instrumented<VariableController>;\n utils: Instrumented<UtilsController>;\n tool: Instrumented<ToolController>;\n page: Instrumented<PageController>;\n debug: Instrumented<DebugController>;\n undoManager: Instrumented<UndoManagerController>;\n textSelection: Instrumented<TextStyleController>;\n paragraphStyle: Instrumented<ParagraphStyleController>;\n characterStyle: Instrumented<CharacterStyleController>;\n colorStyle: Instrumented<ColorStyleController>;\n gradientStyle: Instrumented<GradientStyleController>;\n font: Instrumented<FontController>;\n experiment: Instrumented<ExperimentController>;\n canvas: Instrumented<CanvasController>;\n colorConversion: Instrumented<ColorConversionController>;\n info: Instrumented<InfoController>;\n clipboard: Instrumented<ClipboardController>;\n brandKit: Instrumented<BrandKitController>;\n componentGrid: Instrumented<ComponentGridController>;\n\n next: NextInitiator;\n\n private subscriber: SubscriberController;\n private enabledNextSubscribers: NextSubscribers | undefined;\n private localConfig = new Map<string, string>();\n private dataItemMappingTools = new DataItemMappingTools();\n private methodListeners = new MethodListenerRegistry();\n // Releases this instance's engine frame (iframe + listeners); set by `loadEditor`.\n private teardownFrame: (() => void) | null = null;\n\n /**\n * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n * @param config The configuration object where the SDK and editor can get configured\n */\n constructor(config: ConfigType) {\n this.config = ConfigHelper.createRuntimeConfig(config);\n this.sdkEvents = new SdkEvents(this.config.logging?.logger);\n\n // `this.connection` only exists once `loadEditor` ran, so the controllers\n // created here get no live editorAPI yet; `loadEditor` rebuilds them with one.\n this.editorAPI = this.connection?.promise.then((child: unknown) => {\n return child;\n }) as unknown as EditorAPI;\n\n this.action = this.toInstrumented(new ActionController(this.editorAPI));\n this.layout = this.toInstrumented(new LayoutController(this.editorAPI));\n this.frame = this.toInstrumented(new FrameController(this.editorAPI));\n this.shape = this.toInstrumented(new ShapeController(this.editorAPI));\n this.barcode = this.toInstrumented(new BarcodeController(this.editorAPI));\n this.component = this.toInstrumented(new ComponentController(this.editorAPI));\n this.undoManager = this.toInstrumented(new UndoManagerController(this.editorAPI, this));\n this.connector = this.toInstrumented(new ConnectorController(this.editorAPI, this.localConfig));\n this.mediaConnector = this.toInstrumented(new MediaConnectorController(this.editorAPI));\n this.fontConnector = this.toInstrumented(new FontConnectorController(this.editorAPI));\n this.componentConnector = this.toInstrumented(new ComponentConnectorController(this.editorAPI));\n this.dataConnector = this.toInstrumented(\n new DataConnectorController(this.editorAPI, this.dataItemMappingTools),\n );\n this.dataSource = this.toInstrumented(new DataSourceController(this.editorAPI, this.dataItemMappingTools));\n this.animation = this.toInstrumented(new AnimationController(this.editorAPI));\n this.document = this.toInstrumented(new DocumentController(this.editorAPI));\n\n this.configuration = this.toInstrumented(new LocalConfigurationDecorator(this.editorAPI, this.localConfig));\n this.variable = this.toInstrumented(new VariableController(this.editorAPI, this.dataItemMappingTools));\n this.utils = this.toInstrumented(new UtilsController(this.editorAPI, this.localConfig));\n this.subscriber = new SubscriberController(this.config, this.localConfig);\n this.tool = this.toInstrumented(new ToolController(this.editorAPI));\n this.page = this.toInstrumented(new PageController(this.editorAPI));\n this.debug = this.toInstrumented(new DebugController(this.editorAPI));\n // To be renamed textSelection > textStyle\n this.textSelection = this.toInstrumented(new TextStyleController(this.editorAPI));\n this.colorStyle = this.toInstrumented(new ColorStyleController(this.editorAPI));\n this.gradientStyle = this.toInstrumented(new GradientStyleController(this.editorAPI));\n this.paragraphStyle = this.toInstrumented(new ParagraphStyleController(this.editorAPI));\n this.characterStyle = this.toInstrumented(new CharacterStyleController(this.editorAPI));\n this.font = this.toInstrumented(new FontController(this.editorAPI));\n this.experiment = this.toInstrumented(new ExperimentController(this.editorAPI));\n this.canvas = this.toInstrumented(new CanvasController(this.editorAPI));\n this.colorConversion = this.toInstrumented(new ColorConversionController(this.editorAPI));\n this.info = this.toInstrumented(new InfoController());\n this.clipboard = this.toInstrumented(new ClipboardController(this.editorAPI));\n this.next = new NextInitiator(this.config, this.connection, this.editorAPI);\n this.enabledNextSubscribers = this.config.enableNextSubscribers;\n this.brandKit = this.toInstrumented(new BrandKitController(this.editorAPI, this));\n this.componentGrid = this.toInstrumented(new ComponentGridController(this.editorAPI));\n\n this.applyMethodInstrumentation();\n }\n\n /**\n * This method will initiate the editor, running this will result in the editor restarting\n * It will generate an iframe in the document\n */\n loadEditor = () => {\n // Reloading first releases this instance's previous engine frame, so a second\n // `loadEditor` can never orphan a live engine. Frames loaded by other SDK\n // instances are tracked per instance and stay untouched.\n this.teardownFrame?.();\n this.teardownFrame = Connect(\n this.config.editorLink || FIXED_EDITOR_LINK,\n {\n onActionsChanged: this.subscriber.onActionsChanged,\n onStateChanged: this.subscriber.onStateChanged,\n onAuthExpired: this.subscriber.onAuthExpired,\n onViewportRequested: this.subscriber.onViewportRequested,\n onDocumentLoaded: this.subscriber.onDocumentLoaded,\n onSelectedFramesContentChanged: this.subscriber.onSelectedFramesContentChanged,\n onSelectedFramesLayoutChanged: this.subscriber.onSelectedFramesLayoutChanged,\n onFramesLayoutChanged: this.subscriber.onFramesLayoutChanged,\n onSelectedLayoutPropertiesChanged: this.subscriber.onSelectedLayoutPropertiesChanged,\n onSelectedLayoutUnitChanged: this.subscriber.onSelectedLayoutUnitChanged,\n onPageSelectionChanged: this.subscriber.onPageSelectionChanged,\n onScrubberPositionChanged: this.subscriber.onAnimationPlaybackChanged,\n onFrameAnimationsChanged: this.subscriber.onAnimationChanged,\n onVariableListChanged: (state) => {\n if (this.enabledNextSubscribers?.onVariableListChanged) {\n this.next.subscriber.onVariableListChanged(state);\n } else {\n this.subscriber.onVariableListChanged(state);\n }\n },\n onSelectedToolChanged: this.subscriber.onSelectedToolChanged,\n onUndoStateChanged: this.subscriber.onUndoStateChanged,\n onSelectedLayoutFramesChanged: this.subscriber.onSelectedLayoutFramesChanged,\n onSelectedTextStyleChanged: this.subscriber.onSelectedTextStyleChanged,\n onColorsChanged: this.subscriber.onColorsChanged,\n onParagraphStylesChanged: this.subscriber.onParagraphStylesChanged,\n onCharacterStylesChanged: this.subscriber.onCharacterStylesChanged,\n onFontFamiliesChanged: this.subscriber.onFontFamiliesChanged,\n onSelectedLayoutIdChanged: this.subscriber.onSelectedLayoutIdChanged,\n onLayoutsChanged: this.subscriber.onLayoutsChanged,\n onConnectorEvent: this.subscriber.onConnectorEvent,\n onConnectorsChanged: (state) => {\n if (this.enabledNextSubscribers?.onConnectorsChanged) {\n this.next.subscriber.onConnectorsChanged(state);\n } else {\n this.subscriber.onConnectorsChanged(state);\n }\n },\n onZoomChanged: this.subscriber.onZoomChanged,\n onSelectedPageIdChanged: this.subscriber.onSelectedPageIdChanged,\n onPagesChanged: this.subscriber.onPagesChanged,\n onPageSnapshotInvalidated: this.subscriber.onPageSnapshotInvalidated,\n onPageSizeChanged: (state) => {\n if (this.enabledNextSubscribers?.onPageSizeChanged) {\n this.next.subscriber.onPageSizeChanged(state);\n } else {\n this.subscriber.onPageSizeChanged(state);\n }\n },\n onShapeCornerRadiusChanged: this.subscriber.onShapeCornerRadiusChanged,\n onCropActiveFrameIdChanged: this.subscriber.onCropActiveFrameIdChanged,\n onAsyncError: this.subscriber.onAsyncError,\n onViewModeChanged: this.subscriber.onViewModeChanged,\n onBarcodeValidationChanged: this.subscriber.onBarcodeValidationChanged,\n onDataSourceIdChanged: this.subscriber.onDataSourceIdChanged,\n onInjectedDataChanged: this.subscriber.onInjectedDataChanged,\n onDocumentIssueListChanged: this.subscriber.onDocumentIssueListChanged,\n onCustomUndoDataChanged: this.subscriber.onCustomUndoDataChanged,\n onEngineEditModeChanged: this.subscriber.onEngineEditModeChanged,\n onBrandKitMediaChanged: this.subscriber.onBrandKitMediaChanged,\n onCanvasFramesManipulated: this.subscriber.onCanvasFramesManipulated,\n },\n this.setConnection,\n this.config.editorId,\n this.config.studioStyling,\n (error) => {\n this.config.onConnectionError?.(error);\n },\n );\n // `Connect` invokes `setConnection` synchronously, so `this.connection`\n // already points at the fresh connection here.\n this.editorAPI = this.connection?.promise.then((editorAPI: unknown) => {\n return editorAPI;\n }) as unknown as EditorAPI;\n\n this.action = this.toInstrumented(new ActionController(this.editorAPI));\n this.layout = this.toInstrumented(new LayoutController(this.editorAPI));\n this.frame = this.toInstrumented(new FrameController(this.editorAPI));\n this.barcode = this.toInstrumented(new BarcodeController(this.editorAPI));\n this.component = this.toInstrumented(new ComponentController(this.editorAPI));\n this.animation = this.toInstrumented(new AnimationController(this.editorAPI));\n this.document = this.toInstrumented(new DocumentController(this.editorAPI));\n this.configuration = this.toInstrumented(new LocalConfigurationDecorator(this.editorAPI, this.localConfig));\n this.utils = this.toInstrumented(new UtilsController(this.editorAPI, this.localConfig));\n this.tool = this.toInstrumented(new ToolController(this.editorAPI));\n this.page = this.toInstrumented(new PageController(this.editorAPI));\n this.debug = this.toInstrumented(new DebugController(this.editorAPI));\n this.undoManager = this.toInstrumented(new UndoManagerController(this.editorAPI, this));\n this.textSelection = this.toInstrumented(new TextStyleController(this.editorAPI));\n this.colorStyle = this.toInstrumented(new ColorStyleController(this.editorAPI));\n this.gradientStyle = this.toInstrumented(new GradientStyleController(this.editorAPI));\n this.paragraphStyle = this.toInstrumented(new ParagraphStyleController(this.editorAPI));\n this.characterStyle = this.toInstrumented(new CharacterStyleController(this.editorAPI));\n this.mediaConnector = this.toInstrumented(new MediaConnectorController(this.editorAPI));\n this.fontConnector = this.toInstrumented(new FontConnectorController(this.editorAPI));\n this.componentConnector = this.toInstrumented(new ComponentConnectorController(this.editorAPI));\n this.dataConnector = this.toInstrumented(\n new DataConnectorController(this.editorAPI, this.dataItemMappingTools),\n );\n this.dataSource = this.toInstrumented(new DataSourceController(this.editorAPI, this.dataItemMappingTools));\n this.connector = this.toInstrumented(new ConnectorController(this.editorAPI, this.localConfig));\n this.variable = this.toInstrumented(new VariableController(this.editorAPI, this.dataItemMappingTools));\n this.font = this.toInstrumented(new FontController(this.editorAPI));\n this.experiment = this.toInstrumented(new ExperimentController(this.editorAPI));\n this.canvas = this.toInstrumented(new CanvasController(this.editorAPI));\n this.shape = this.toInstrumented(new ShapeController(this.editorAPI));\n this.colorConversion = this.toInstrumented(new ColorConversionController(this.editorAPI));\n this.info = this.toInstrumented(new InfoController());\n this.clipboard = this.toInstrumented(new ClipboardController(this.editorAPI));\n this.brandKit = this.toInstrumented(new BrandKitController(this.editorAPI, this));\n this.componentGrid = this.toInstrumented(new ComponentGridController(this.editorAPI));\n this.next = new NextInitiator(this.config, this.connection, this.editorAPI);\n\n this.applyMethodInstrumentation();\n\n // as soon as the editor loads, provide it with the SDK version\n // used to make it start. This enables engine compatibility checks\n // on the Flutter side\n this.configuration.setValue(WellKnownConfigurationKeys.GraFxStudioSdkVersion, packageInfo.version);\n\n // Makes the engine aware which document type it should render, if this call\n // isn't made, the engine will fall back to the type specified in the document.\n //\n // Loading a template JSON and setting the engine to `project` will cause\n // the document JSON structure to be converted to a project on save.\n // Using `getCurrentDocumentState` will also output the converted document.\n this.configuration.setValue(\n WellKnownConfigurationKeys.GraFxStudioDocumentType,\n this.config.documentType || DocumentType.template,\n );\n\n // Update the engine with the specified options from the config or fall back to the defaults.\n this.configuration.updateStudioOptions(this.config.studioOptions || defaultStudioOptions);\n\n // Whether the engine should cache query calls. This is disabled by default.\n this.configuration.setValue(\n WellKnownConfigurationKeys.QueryCallCacheEnabled,\n this.config.enableQueryCallCache?.toString() || 'false',\n );\n };\n\n setConnection = (newConnection: Connection) => {\n this.connection = newConnection;\n };\n\n /**\n * Shuts this SDK instance down and releases the engine it loaded.\n *\n * This tears down the postMessage connection, removes the engine iframe from the\n * document and drops the references the SDK itself holds. Removing the iframe is what\n * lets the browser discard the engine realm, which is where the bulk of the memory\n * lives (the Dart heap plus the CanvasKit and QuickJS WASM memory).\n *\n * Call this whenever an integration unmounts an editor it previously created with\n * {@link loadEditor}. Without it every mount leaves a fully live engine behind.\n * The method is safe to call more than once.\n */\n destroy = () => {\n try {\n this.connection?.destroy();\n } catch {\n // A connection that was already destroyed (for example by penpal's own\n // iframe-removal monitor) must not prevent the rest of the teardown.\n }\n\n // Null the handle as well: the closure closes over the iframe, so keeping it\n // would keep the removed engine realm reachable.\n this.teardownFrame?.();\n this.teardownFrame = null;\n };\n\n private toInstrumented = <T extends object>(controller: T): Instrumented<T> => {\n markForInstrumentation(controller);\n return controller as unknown as Instrumented<T>;\n };\n\n /**\n * Wraps every controller previously handed to `toInstrumented` with the invocation\n * observer, discovering them by their marker rather than a manually maintained\n * list of property names. Any property assigned via `toInstrumented` is picked up\n * automatically, using its own property key as the controller name.\n */\n private applyMethodInstrumentation = () => {\n const sdkProperties = this as unknown as Record<string, unknown>;\n for (const propertyName of Object.keys(sdkProperties)) {\n const value = sdkProperties[propertyName];\n if (isPendingInstrumentation(value)) {\n sdkProperties[propertyName] = wrapWithInvocationObserver(\n value,\n propertyName,\n this.methodListeners,\n this.sdkEvents,\n this.config.logging?.logger,\n );\n }\n }\n };\n}\n\nexport default SDK;\n"],"names":["_a","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,gBAA2D;AACjE,MAAM,oBAAoB,WAAW,aAAa,WAAW,WAAW,OAAO;AAM/E,MAAM,0BAA0B,OAAO,wBAAwB;AAE/D,MAAM,yBAAyB,CAAC,eAA6B;AACzD,SAAO,eAAe,YAAY,yBAAyB;AAAA,IACvD,OAAO;AAAA,IACP,YAAY;AAAA,IACZ,cAAc;AAAA,EAAA,CACjB;AACL;AAEA,MAAM,2BAA2B,CAAC,UAAoC;AAClE,SACI,OAAO,UAAU,YACjB,UAAU,QACT,MAAkC,uBAAuB,MAAM;AAExE;AAEO,MAAM,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,EAsEb,YAAY,QAAoB;;AAVhC,SAAQ,kCAAkB,IAAA;AAC1B,SAAQ,uBAAuB,IAAI,qBAAA;AACnC,SAAQ,kBAAkB,IAAI,uBAAA;AAE9B,SAAQ,gBAAqC;AAiE7C,SAAA,aAAa,MAAM;;AAIf,OAAAA,MAAA,KAAK,kBAAL,gBAAAA,IAAA;AACA,WAAK,gBAAgB;AAAA,QACjB,KAAK,OAAO,cAAc;AAAA,QAC1B;AAAA,UACI,kBAAkB,KAAK,WAAW;AAAA,UAClC,gBAAgB,KAAK,WAAW;AAAA,UAChC,eAAe,KAAK,WAAW;AAAA,UAC/B,qBAAqB,KAAK,WAAW;AAAA,UACrC,kBAAkB,KAAK,WAAW;AAAA,UAClC,gCAAgC,KAAK,WAAW;AAAA,UAChD,+BAA+B,KAAK,WAAW;AAAA,UAC/C,uBAAuB,KAAK,WAAW;AAAA,UACvC,mCAAmC,KAAK,WAAW;AAAA,UACnD,6BAA6B,KAAK,WAAW;AAAA,UAC7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Ae,IAAI,iBAAiB,KAAK,SAAS,CAAC;AACtE,SAAK,kBAAkB,KAAK,eAAe,IAAI,0BAA0B,KAAK,SAAS,CAAC;AACxF,SAAK,OAAO,KAAK,eAAe,IAAI,gBAAgB;AACpD,SAAK,YAAY,KAAK,eAAe,IAAI,oBAAoB,KAAK,SAAS,CAAC;AAC5E,SAAK,OAAO,IAAI,cAAc,KAAK,QAAQ,KAAK,YAAY,KAAK,SAAS;AAC1E,SAAK,yBAAyB,KAAK,OAAO;AAC1C,SAAK,WAAW,KAAK,eAAe,IAAI,mBAAmB,KAAK,WAAW,IAAI,CAAC;AAChF,SAAK,gBAAgB,KAAK,eAAe,IAAI,wBAAwB,KAAK,SAAS,CAAC;AAEpF,SAAK,2BAAA;AAAA,EACT;AAmNJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarcodeTypes.cjs.js","sources":["../../../src/types/BarcodeTypes.ts"],"sourcesContent":["import { ColorUsage } from './ColorStyleTypes';\n\nexport enum BarcodeType {\n code39 = 'code39',\n code93 = 'code93',\n code128 = 'code128',\n dataMatrix = 'dataMatrix',\n ean13 = 'ean13',\n ean8 = 'ean8',\n qr = 'qr',\n upca = 'upca',\n upce = 'upce',\n gs1128 = 'gs1128',\n}\n\nexport interface BarcodeProperties {\n enableBackground?: boolean;\n backgroundColor?: ColorUsage;\n
|
|
1
|
+
{"version":3,"file":"BarcodeTypes.cjs.js","sources":["../../../src/types/BarcodeTypes.ts"],"sourcesContent":["import { ColorUsage } from './ColorStyleTypes';\n\nexport enum BarcodeType {\n code39 = 'code39',\n code93 = 'code93',\n code128 = 'code128',\n dataMatrix = 'dataMatrix',\n ean13 = 'ean13',\n ean8 = 'ean8',\n qr = 'qr',\n upca = 'upca',\n upce = 'upce',\n gs1128 = 'gs1128',\n}\n\nexport interface BarcodeProperties {\n enableBars?: boolean;\n enableBackground?: boolean;\n backgroundColor?: ColorUsage;\n backgroundOverprint?: boolean;\n barColor?: ColorUsage;\n barcodeOverprint?: boolean;\n enableText?: boolean;\n barHeight?: string;\n magnification?: number;\n quietZone?: QuietZoneDeltaUpdate;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n drawStartStopChars?: boolean;\n}\n\nexport enum BarcodeErrorCorrectionLevel {\n low = 'low',\n medium = 'medium',\n quartile = 'quartile',\n high = 'high',\n}\n\nexport enum BarcodeCharacterSet {\n utf8 = 'utf8',\n iso8859_1 = 'iso8859_1',\n code128a = 'code128a',\n code128b = 'code128b',\n code128c = 'code128c',\n}\n\nexport interface BarcodeConfigurationOptions {\n allowedErrorCorrectionLevels?: BarcodeErrorCorrectionLevel[];\n allowedCharacterSets?: BarcodeCharacterSet[];\n allowQuietZone: boolean;\n allowBarHeight: boolean;\n allowEnableMagnification: boolean;\n allowToggleText: boolean;\n quietZoneAlwaysCombined: boolean;\n allowToggleLightMarginIndicator: boolean;\n allowToggleDrawStartAndEndChar: boolean;\n}\n\nexport type QuietZone = {\n left: number;\n top: number;\n right: number;\n bottom: number;\n areQuietZoneValuesCombined: boolean;\n};\n\nexport type QuietZoneDeltaUpdate = {\n left?: string;\n top?: string;\n right?: string;\n bottom?: string;\n areQuietZoneValuesCombined?: boolean;\n};\n\nexport type BarcodeFrameValidationResult = {\n id: string;\n validationResult: BarcodeValidationResult;\n};\n\nexport enum BarcodeValidationResult {\n success = 'success',\n empty = 'empty',\n invalidLength = 'invalidLength',\n invalidCharacters = 'invalidCharacters',\n invalidChecksum = 'invalidChecksum',\n invalidUPCE = 'invalidUPCE',\n otherError = 'otherError',\n}\n"],"names":["BarcodeType","BarcodeErrorCorrectionLevel","BarcodeCharacterSet","BarcodeValidationResult"],"mappings":";;AAEO,IAAK,gCAAAA,iBAAL;AACHA,eAAA,QAAA,IAAS;AACTA,eAAA,QAAA,IAAS;AACTA,eAAA,SAAA,IAAU;AACVA,eAAA,YAAA,IAAa;AACbA,eAAA,OAAA,IAAQ;AACRA,eAAA,MAAA,IAAO;AACPA,eAAA,IAAA,IAAK;AACLA,eAAA,MAAA,IAAO;AACPA,eAAA,MAAA,IAAO;AACPA,eAAA,QAAA,IAAS;AAVD,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AA6BL,IAAK,gDAAAC,iCAAL;AACHA,+BAAA,KAAA,IAAM;AACNA,+BAAA,QAAA,IAAS;AACTA,+BAAA,UAAA,IAAW;AACXA,+BAAA,MAAA,IAAO;AAJC,SAAAA;AAAA,GAAA,+BAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,MAAA,IAAO;AACPA,uBAAA,WAAA,IAAY;AACZA,uBAAA,UAAA,IAAW;AACXA,uBAAA,UAAA,IAAW;AACXA,uBAAA,UAAA,IAAW;AALH,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAyCL,IAAK,4CAAAC,6BAAL;AACHA,2BAAA,SAAA,IAAU;AACVA,2BAAA,OAAA,IAAQ;AACRA,2BAAA,eAAA,IAAgB;AAChBA,2BAAA,mBAAA,IAAoB;AACpBA,2BAAA,iBAAA,IAAkB;AAClBA,2BAAA,aAAA,IAAc;AACdA,2BAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;;;;;"}
|
|
@@ -12,10 +12,12 @@ export declare enum BarcodeType {
|
|
|
12
12
|
gs1128 = "gs1128"
|
|
13
13
|
}
|
|
14
14
|
export interface BarcodeProperties {
|
|
15
|
+
enableBars?: boolean;
|
|
15
16
|
enableBackground?: boolean;
|
|
16
17
|
backgroundColor?: ColorUsage;
|
|
17
|
-
|
|
18
|
+
backgroundOverprint?: boolean;
|
|
18
19
|
barColor?: ColorUsage;
|
|
20
|
+
barcodeOverprint?: boolean;
|
|
19
21
|
enableText?: boolean;
|
|
20
22
|
barHeight?: string;
|
|
21
23
|
magnification?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarcodeTypes.es.js","sources":["../../../src/types/BarcodeTypes.ts"],"sourcesContent":["import { ColorUsage } from './ColorStyleTypes';\n\nexport enum BarcodeType {\n code39 = 'code39',\n code93 = 'code93',\n code128 = 'code128',\n dataMatrix = 'dataMatrix',\n ean13 = 'ean13',\n ean8 = 'ean8',\n qr = 'qr',\n upca = 'upca',\n upce = 'upce',\n gs1128 = 'gs1128',\n}\n\nexport interface BarcodeProperties {\n enableBackground?: boolean;\n backgroundColor?: ColorUsage;\n
|
|
1
|
+
{"version":3,"file":"BarcodeTypes.es.js","sources":["../../../src/types/BarcodeTypes.ts"],"sourcesContent":["import { ColorUsage } from './ColorStyleTypes';\n\nexport enum BarcodeType {\n code39 = 'code39',\n code93 = 'code93',\n code128 = 'code128',\n dataMatrix = 'dataMatrix',\n ean13 = 'ean13',\n ean8 = 'ean8',\n qr = 'qr',\n upca = 'upca',\n upce = 'upce',\n gs1128 = 'gs1128',\n}\n\nexport interface BarcodeProperties {\n enableBars?: boolean;\n enableBackground?: boolean;\n backgroundColor?: ColorUsage;\n backgroundOverprint?: boolean;\n barColor?: ColorUsage;\n barcodeOverprint?: boolean;\n enableText?: boolean;\n barHeight?: string;\n magnification?: number;\n quietZone?: QuietZoneDeltaUpdate;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n drawStartStopChars?: boolean;\n}\n\nexport enum BarcodeErrorCorrectionLevel {\n low = 'low',\n medium = 'medium',\n quartile = 'quartile',\n high = 'high',\n}\n\nexport enum BarcodeCharacterSet {\n utf8 = 'utf8',\n iso8859_1 = 'iso8859_1',\n code128a = 'code128a',\n code128b = 'code128b',\n code128c = 'code128c',\n}\n\nexport interface BarcodeConfigurationOptions {\n allowedErrorCorrectionLevels?: BarcodeErrorCorrectionLevel[];\n allowedCharacterSets?: BarcodeCharacterSet[];\n allowQuietZone: boolean;\n allowBarHeight: boolean;\n allowEnableMagnification: boolean;\n allowToggleText: boolean;\n quietZoneAlwaysCombined: boolean;\n allowToggleLightMarginIndicator: boolean;\n allowToggleDrawStartAndEndChar: boolean;\n}\n\nexport type QuietZone = {\n left: number;\n top: number;\n right: number;\n bottom: number;\n areQuietZoneValuesCombined: boolean;\n};\n\nexport type QuietZoneDeltaUpdate = {\n left?: string;\n top?: string;\n right?: string;\n bottom?: string;\n areQuietZoneValuesCombined?: boolean;\n};\n\nexport type BarcodeFrameValidationResult = {\n id: string;\n validationResult: BarcodeValidationResult;\n};\n\nexport enum BarcodeValidationResult {\n success = 'success',\n empty = 'empty',\n invalidLength = 'invalidLength',\n invalidCharacters = 'invalidCharacters',\n invalidChecksum = 'invalidChecksum',\n invalidUPCE = 'invalidUPCE',\n otherError = 'otherError',\n}\n"],"names":["BarcodeType","BarcodeErrorCorrectionLevel","BarcodeCharacterSet","BarcodeValidationResult"],"mappings":"AAEO,IAAK,gCAAAA,iBAAL;AACHA,eAAA,QAAA,IAAS;AACTA,eAAA,QAAA,IAAS;AACTA,eAAA,SAAA,IAAU;AACVA,eAAA,YAAA,IAAa;AACbA,eAAA,OAAA,IAAQ;AACRA,eAAA,MAAA,IAAO;AACPA,eAAA,IAAA,IAAK;AACLA,eAAA,MAAA,IAAO;AACPA,eAAA,MAAA,IAAO;AACPA,eAAA,QAAA,IAAS;AAVD,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AA6BL,IAAK,gDAAAC,iCAAL;AACHA,+BAAA,KAAA,IAAM;AACNA,+BAAA,QAAA,IAAS;AACTA,+BAAA,UAAA,IAAW;AACXA,+BAAA,MAAA,IAAO;AAJC,SAAAA;AAAA,GAAA,+BAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,MAAA,IAAO;AACPA,uBAAA,WAAA,IAAY;AACZA,uBAAA,UAAA,IAAW;AACXA,uBAAA,UAAA,IAAW;AACXA,uBAAA,UAAA,IAAW;AALH,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAyCL,IAAK,4CAAAC,6BAAL;AACHA,2BAAA,SAAA,IAAU;AACVA,2BAAA,OAAA,IAAQ;AACRA,2BAAA,eAAA,IAAgB;AAChBA,2BAAA,mBAAA,IAAoB;AACpBA,2BAAA,iBAAA,IAAkB;AAClBA,2BAAA,aAAA,IAAc;AACdA,2BAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;"}
|
|
@@ -66,7 +66,8 @@ export type APIBrandKitCharacterStyle = {
|
|
|
66
66
|
textIndent?: string | null;
|
|
67
67
|
baselineShiftValue?: string | null;
|
|
68
68
|
lineHeight?: number | null;
|
|
69
|
-
|
|
69
|
+
fillOverprint?: boolean | null;
|
|
70
|
+
strokeOverprint?: boolean | null;
|
|
70
71
|
brandKitColorGuid?: string | null;
|
|
71
72
|
fillColorApplied?: boolean | null;
|
|
72
73
|
textStrokeColorGuid?: string | null;
|
|
@@ -89,7 +90,8 @@ export type APIBrandKitParagraphStyle = {
|
|
|
89
90
|
textIndent?: string | null;
|
|
90
91
|
baselineShiftValue?: string | null;
|
|
91
92
|
lineHeight: number;
|
|
92
|
-
|
|
93
|
+
fillOverprint?: boolean | null;
|
|
94
|
+
strokeOverprint?: boolean | null;
|
|
93
95
|
brandKitColorGuid: string;
|
|
94
96
|
fillColorApplied?: boolean | null;
|
|
95
97
|
textStrokeColorGuid?: string | null;
|
|
@@ -14,7 +14,8 @@ export type CharacterStyle = {
|
|
|
14
14
|
textIndent?: string;
|
|
15
15
|
baselineShiftValue?: string;
|
|
16
16
|
lineHeight?: number;
|
|
17
|
-
|
|
17
|
+
fillOverprint?: boolean;
|
|
18
|
+
strokeOverprint?: boolean;
|
|
18
19
|
color: ColorUsage;
|
|
19
20
|
strokeColor: ColorUsage;
|
|
20
21
|
backgroundColor: ColorUsage;
|
|
@@ -56,7 +57,10 @@ export type CharacterStyleUpdate = {
|
|
|
56
57
|
lineHeight?: {
|
|
57
58
|
value: number;
|
|
58
59
|
};
|
|
59
|
-
|
|
60
|
+
fillOverprint?: {
|
|
61
|
+
value: boolean;
|
|
62
|
+
};
|
|
63
|
+
strokeOverprint?: {
|
|
60
64
|
value: boolean;
|
|
61
65
|
};
|
|
62
66
|
color?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorStyleTypes.cjs.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n
|
|
1
|
+
{"version":3,"file":"ColorStyleTypes.cjs.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n RGBColor | CMYKColor | HSLColor | GrayColor | SpotColor | HexColor | SpotColorCMYK | SpotColorRGB | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n stylekit = 'brandKit',\n}\n"],"names":["APIColorType","ColorType","ColorUsageType"],"mappings":";;AAEO,IAAK,iCAAAA,kBAAL;AACHA,gBAAA,KAAA,IAAM;AACNA,gBAAA,KAAA,IAAM;AACNA,gBAAA,MAAA,IAAO;AACPA,gBAAA,UAAA,IAAW;AACXA,gBAAA,SAAA,IAAU;AACVA,gBAAA,SAAA,IAAU;AANF,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAQL,IAAK,8BAAAC,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAiIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAOXA,kBAAA,UAAA,IAAW;AAfH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorStyleTypes.es.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n
|
|
1
|
+
{"version":3,"file":"ColorStyleTypes.es.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n RGBColor | CMYKColor | HSLColor | GrayColor | SpotColor | HexColor | SpotColorCMYK | SpotColorRGB | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values\n stylekit = 'brandKit',\n}\n"],"names":["APIColorType","ColorType","ColorUsageType"],"mappings":"AAEO,IAAK,iCAAAA,kBAAL;AACHA,gBAAA,KAAA,IAAM;AACNA,gBAAA,KAAA,IAAM;AACNA,gBAAA,MAAA,IAAO;AACPA,gBAAA,UAAA,IAAW;AACXA,gBAAA,SAAA,IAAU;AACVA,gBAAA,SAAA,IAAU;AANF,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAQL,IAAK,8BAAAC,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAiIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAOXA,kBAAA,UAAA,IAAW;AAfH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentGridTypes.cjs.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings /* | More will be added later
|
|
1
|
+
{"version":3,"file":"ComponentGridTypes.cjs.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings; /* | More will be added later */\n"],"names":["ComponentGridLayoutAlgorithm"],"mappings":";;AAeO,IAAK,iDAAAA,kCAAL;AACHA,gCAAA,OAAA,IAAQ;AADA,SAAAA;AAAA,GAAA,gCAAA,CAAA,CAAA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComponentGridTypes.es.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings /* | More will be added later
|
|
1
|
+
{"version":3,"file":"ComponentGridTypes.es.js","sources":["../../../src/types/ComponentGridTypes.ts"],"sourcesContent":["export type ComponentGridSettingsDeltaUpdate = {\n numberOfColumns?: {\n value: number;\n };\n numberOfRows?: {\n value: number;\n };\n columnGap?: {\n value: string;\n };\n rowGap?: {\n value: string;\n };\n};\n\nexport enum ComponentGridLayoutAlgorithm {\n fixed = 'fixed',\n}\n\nexport type FixedComponentGridSettings = {\n type: ComponentGridLayoutAlgorithm.fixed;\n numberOfColumns: number;\n numberOfRows: number;\n columnGap: number;\n rowGap: number;\n};\n\nexport type ComponentGridSettings = FixedComponentGridSettings; /* | More will be added later */\n"],"names":["ComponentGridLayoutAlgorithm"],"mappings":"AAeO,IAAK,iDAAAA,kCAAL;AACHA,gCAAA,OAAA,IAAQ;AADA,SAAAA;AAAA,GAAA,gCAAA,CAAA,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorTypes.cjs.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedA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BAA4B;AAAA,EAOrC,YAAY,SAAkC;AAN9C,SAAA,OAAO;AAOH,SAAK,UAAU;AAAA,EACnB;AACJ;AAEO,IAAK,4CAAAC,6BAAL;AACHA,2BAAA,YAAA,IAAa;AACbA,2BAAA,WAAA,IAAY;AAFJ,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,YAAA,IAAa;AACbA,uBAAA,KAAA,IAAM;AAFE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAuCL,IAAK,mDAAAC,oCAAL;AACHA,kCAAA,cAAA,IAAe;AADP,SAAAA;AAAA,GAAA,kCAAA,CAAA,CAAA;AAIL,MAAM,mCAAmC,MAAM;AAAA,EAClD,YAAY,SAAwB,MAAsC;AACtE,UAAM,OAAO;AADmB,SAAA,OAAA;AAAA,EAEpC;AACJ;AAEO,IAAK,2CAAAC,4BAAL;AACHA,0BAAA,WAAA,IAAY;AACZA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,6BAAA,IAA8B;AAC9BA,0BAAA,iBAAA,IAAkB;AAClBA,0BAAA,MAAA,IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"ConnectorTypes.cjs.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(\n message: string,\n public type: UploadAssetValidationErrorType,\n ) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":";;AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,MAAA,IAAO;AAIPA,iBAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAUL,IAAK,2BAAAC,YAAL;AACHA,UAAA,MAAA,IAAO;AACPA,UAAA,MAAA,IAAO;AACPA,UAAA,IAAA,IAAK;AAHG,SAAAA;AAAA,GAAA,UAAA,CAAA,CA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IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorTypes.es.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":"AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA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AAC,yBAAL;AACHA,uBAAA,YAAA,IAAa;AACbA,uBAAA,KAAA,IAAM;AAFE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAuCL,IAAK,mDAAAC,oCAAL;AACHA,kCAAA,cAAA,IAAe;AADP,SAAAA;AAAA,GAAA,kCAAA,CAAA,CAAA;AAIL,MAAM,mCAAmC,MAAM;AAAA,EAClD,YAAY,SAAwB,MAAsC;AACtE,UAAM,OAAO;AADmB,SAAA,OAAA;AAAA,EAEpC;AACJ;AAEO,IAAK,2CAAAC,4BAAL;AACHA,0BAAA,WAAA,IAAY;AACZA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,6BAAA,IAA8B;AAC9BA,0BAAA,iBAAA,IAAkB;AAClBA,0BAAA,MAAA,IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ConnectorTypes.es.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(\n message: string,\n public type: UploadAssetValidationErrorType,\n ) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":"AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,MAAA,IAAO;AAIPA,iBAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAUL,IAAK,2BAAAC,YAAL;AACHA,UAAA,MAAA,IAAO;AACPA,UAAA,MAAA,IAAO;AACPA,UAAA,IAAA,IAAK;AAHG,SAAAA;AAAA,GAAA,UAAA,CAAA,CAAA;AAML,IAAK,8BAAAC,eAAL;AACHA,aAAA,WAAA,IAAY;AACZA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,6CAAAC,8BAAL;AACHA,4BAAA,MAAA,IAAO;AACPA,4BAAA,SAAA,IAAU;AACVA,4BAAA,QAAA,IAAS;AAHD,SAAAA;AAAA,GAAA,4BAAA,CA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