@chili-publish/studio-sdk 1.46.2 → 1.48.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 +3 -3
- 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 +12 -0
- package/lib/src/controllers/FrameController.cjs.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +27 -1
- package/lib/src/controllers/FrameController.es.js +12 -0
- package/lib/src/controllers/FrameController.es.js.map +1 -1
- package/lib/src/controllers/ShapeController.cjs.js +4 -0
- package/lib/src/controllers/ShapeController.cjs.js.map +1 -1
- package/lib/src/controllers/ShapeController.d.ts +15 -0
- package/lib/src/controllers/ShapeController.es.js +4 -0
- package/lib/src/controllers/ShapeController.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/controllers/VariableController.cjs.js +13 -1
- package/lib/src/controllers/VariableController.cjs.js.map +1 -1
- package/lib/src/controllers/VariableController.d.ts +13 -0
- package/lib/src/controllers/VariableController.es.js +13 -1
- package/lib/src/controllers/VariableController.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 +7 -1
- 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.d.ts +1 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariableController.es.js","sources":["../../../src/controllers/VariableController.ts"],"sourcesContent":["import { EditorAPI, EditorResponse, Id, PrivateData } from '../types/CommonTypes';\nimport { ConnectorRegistration } from '../types/ConnectorTypes';\nimport {\n BidirectionalDataPage,\n BidirectionalDataPageItem,\n DataItem,\n DataSourceVariableDataModel,\n Dictionary,\n} from '@chili-studio/connector-types';\nimport {\n DataSourceVariableDisplayOptionsType,\n DateRestriction,\n DateVariablePropertiesDeltaUpdate,\n Day,\n ListVariable,\n ListVariableItem,\n Locale,\n NumberVariablePropertiesDeltaUpdate,\n PrefixSuffixDeltaUpdate,\n RowId,\n Variable,\n VariableType,\n VariableUsagesReport,\n VariableVisibility,\n VariableVisibilityType,\n DataSourceVariableSourceType,\n} from '../types/VariableTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ConnectorCompatibilityTools } from '../utils/ConnectorCompatibilityTools';\nimport { EditorDataPage } from '../types/DataConnectorTypes';\nimport { DataItemMappingTools, EngineDataItem } from '../utils/DataItemMappingTools';\nimport { throwEditorResponseError, throwVariableException } from '../exceptions';\nimport { isInjectedDataSourceVariable } from '../utils/VariableHelper';\nimport { StructuredTextTextFlowDefinition } from '../types/RichTextRuleTypes';\n\nclass NumberVariable {\n #editorAPI: EditorAPI;\n\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * @experimental Sets the minimum value for a number variable\n * @param id the id of the variable to update\n * @param minimum the minimum value or null to remove the minimum value\n * @returns\n */\n setMinimum = async (id: string, minimum: number | null) => {\n const update = { minValue: { value: minimum } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the maximum value for a number variable\n * @param id the id of the variable to update\n * @param maximum the maximum value or null to remove the maximum value\n * @returns\n */\n setMaximum = async (id: string, maximum: number | null) => {\n const update = { maxValue: { value: maximum } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the visibility of the stepper for a number variable\n * @param id the id of the variable to update\n * @param showStep true to show the stepper, false to hide it\n * @returns\n */\n setShowStepper = async (id: string, showStepper: boolean) => {\n const update = { showStepper: { value: showStepper } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the step size for a number variable\n * @param id the id of the variable to update\n * @param stepSize the step size. Must be > 0\n * @returns\n */\n setStepSize = async (id: string, stepSize: number) => {\n const update = { stepSize: { value: stepSize } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the thousands separator for a number variable\n * @param id the id of the variable to update\n * @param thousandsSeparator the thousands separator to use\n * @returns\n */\n setThousandsSeparator = async (id: string, thousandsSeparator: '' | '.' | ',' | ' ') => {\n const update = { thousandsSeparator: { value: thousandsSeparator } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the decimal separator for a number variable\n * @param id the id of the variable to update\n * @param decimalSeparator the decimal separator to use\n * @returns\n */\n setDecimalSeparator = async (id: string, decimalSeparator: '' | '.' | ',' | ' ') => {\n const update = { decimalSeparator: { value: decimalSeparator } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets or clears the decimal character style for a number variable\n * @param id the id of the variable to update\n * @param characterStyleId the id of the character style to use/clear for the decimals\n * @returns\n */\n setDecimalCharacterStyle = async (id: string, characterStyleId: string | null) => {\n const update = { decimalCharacterStyleId: { value: characterStyleId } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the number of decimals for a number variable\n * @param id the id of the variable to update\n * @param numberOfDecimals the number of decimals to use\n * @returns\n */\n setNumberOfDecimals = async (id: string, numberOfDecimals: 0 | 1 | 2 | 3 | 4) => {\n const update = { numberOfDecimals: { value: numberOfDecimals } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n private async applyPropertiesUpdate(id: string, update: NumberVariablePropertiesDeltaUpdate) {\n const res = await this.#editorAPI;\n const result = await res.updateNumberVariableProperties(id, JSON.stringify(update));\n return getEditorResponseData<null>(result);\n }\n}\n\nclass DateVariable {\n #editorAPI: EditorAPI;\n\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * @experimental This method sets the display format for a date variable.\n *\n * The `displayFormat` is using ICU formatting (Unicode).\n *\n * Supported date formats:\n * - Day -> `d`, `dd`\n * - Month -> `M`, `MM`, `MMM`, `MMMM`\n * - Year -> `yy`, `yyyy`\n * - Day of week -> `ccc`, `cccc`\n *\n * Examples for an input date of `10-12-1815`:\n * - Format `dd/MM/yyyy` will display `12/10/1815`\n * - Format `d.M.yy` will display `12.10.15`\n * - Format `d MMM yyyy` will display `12 Oct 1815` for the `en_US` language\n * - Format `MMMM d, yyyy` will display `October 12, 1815` for the `en_US` language\n * - Format `ccc, MMM d, yyyy` will display `Thu, Oct 12, 1815` for the `en_US` language\n * - Format `cccc, MMMM d, yyyy` will display `Thursday, October 12, 1815` for the `en_US` language\n * - Format `cccc, MMMM d, yyyy` will display `donderdag, oktober 12, 1815` for the `nl` language\n *\n * Patterns which output words such as `MMM`, `MMMM`, `ccc` and `cccc` will\n * differ depending on chosen language (default is `en_US`).\n *\n * @param id The id of the date variable to update\n * @param displayFormat The display format for the date variable\n */\n setDisplayFormat = async (id: string, displayFormat: string) => {\n const update = { displayFormat: { value: displayFormat } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets the locale for a date variable.\n *\n * @param id The id of the date variable to update\n * @param locale The locale for the date variable (`'en_US'`, `'fi'`, `'fr'`...)\n */\n setLocale = async (id: string, locale: Locale) => {\n const update = { locale: { value: locale } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets or clears the start date for a date variable.\n * @param id The id of the date variable to update\n * @param date The start date for the date variable\n */\n setStartDate = async (id: string, date: DateRestriction | null) => {\n const update = { startDate: { value: date } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets or clears the end date for a date variable.\n * @param id The id of the date variable to update\n * @param date The end date for the date variable\n */\n setEndDate = async (id: string, date: DateRestriction | null) => {\n const update = { endDate: { value: date } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets or clears the excluded days for a date variable.\n * @param id The id of the date variable to update\n * @param excludedDays The excluded days for the date variable\n */\n setExcludedDays = async (id: string, excludedDays: Day[] | null) => {\n const update = { excludedDays: { value: excludedDays } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n private async applyPropertiesUpdate(id: string, update: DateVariablePropertiesDeltaUpdate) {\n const res = await this.#editorAPI;\n const result = await res.updateDateVariableProperties(id, JSON.stringify(update));\n return getEditorResponseData<null>(result);\n }\n}\n\nclass DataSourceVariable {\n #editorAPI: EditorAPI;\n #dataItemMappingTools: DataItemMappingTools;\n\n constructor(editorAPI: EditorAPI, dataItemMappingTools: DataItemMappingTools) {\n this.#editorAPI = editorAPI;\n this.#dataItemMappingTools = dataItemMappingTools;\n }\n\n /**\n * Sets the value for a data source variable.\n *\n * @param id the id of the data source variable to update\n * @param value the value to set for the data source variable. This can be a list of records, when we set the data for the data source variable in injected data mode\n * or a single record id, when we have to change the selected record value .\n * @returns\n */\n setValue = async (id: string, value: RowId | DataItem[]) => {\n const res = await this.#editorAPI;\n let engineValue: string | EngineDataItem[];\n if (Array.isArray(value)) {\n engineValue = value.map((item) => this.#dataItemMappingTools.mapDataItemToEngine(item));\n } else {\n engineValue = value;\n }\n return res.setVariableValue(id, engineValue).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets how the data source variable is displayed in the UI (table or list with optional display column).\n * @param variableId The id of the data source variable to update\n * @param displayOptionsType Whether to show the full table or a single column (list)\n * @param displayColumn Column name when displayOptionsType is list\n * @returns\n */\n setDisplayOptions(\n variableId: string,\n displayOptionsType: DataSourceVariableDisplayOptionsType.table,\n ): Promise<EditorResponse<null>>;\n setDisplayOptions(\n variableId: string,\n displayOptionsType: DataSourceVariableDisplayOptionsType.list,\n displayColumn: string,\n ): Promise<EditorResponse<null>>;\n async setDisplayOptions(\n variableId: string,\n displayOptionsType: DataSourceVariableDisplayOptionsType,\n displayColumn?: string,\n ) {\n const res = await this.#editorAPI;\n return res\n .setDataSourceVariableDisplayOptions(variableId, displayOptionsType, displayColumn ?? undefined)\n .then((result) => getEditorResponseData<null>(result));\n }\n\n /**\n * Get the injected data from a data source variable. This only works for data source variables\n * that are in injected data mode. If no data is set, an empty list will be returned.\n * @param variableId the id of the variable\n * @returns a DataPage with an array of data objects\n */\n getInjectedData = async (variableId: string): Promise<EditorResponse<BidirectionalDataPage>> => {\n const res = await this.#editorAPI;\n return res\n .getInjectedDataSourceVariableData(variableId)\n .then((result) => getEditorResponseData<EditorDataPage<EngineDataItem>>(result))\n .then((resp) => {\n const update: EditorResponse<BidirectionalDataPage> = { ...resp, parsedData: null };\n if (resp.parsedData) {\n update.parsedData = {\n ...resp.parsedData,\n data: resp.parsedData.data.map((e: EngineDataItem) =>\n this.#dataItemMappingTools.mapEngineToDataItem(e),\n ),\n };\n }\n return update;\n });\n };\n\n /**\n * Get a single item from injected data of a data source variable. This only works for data source variables\n * that are in injected data mode.\n * @param variableId the id of the variable\n * @param itemId the id of the item to get\n * @returns a BidirectionalDataPageItem with the item and empty navigation tokens\n */\n getInjectedItemById = async (\n variableId: string,\n itemId: string,\n ): Promise<EditorResponse<BidirectionalDataPageItem>> => {\n const res = await this.#editorAPI;\n\n const variable = await res\n .getVariableById(variableId)\n .then((result) => getEditorResponseData<Variable>(result));\n\n if (!isInjectedDataSourceVariable(variable.parsedData)) {\n throwEditorResponseError({\n success: false,\n status: 400,\n error: `Variable is not an injected data source variable`,\n parsedData: null,\n });\n }\n\n const itemIdPropertyName = variable.parsedData.value.itemIdPropertyName;\n\n const injectedData = await this.getInjectedData(variableId);\n\n const item = injectedData.parsedData?.data.find(\n (item) => item[itemIdPropertyName]?.toString() === itemId.toString(),\n );\n\n if (!item) {\n throwEditorResponseError({\n success: false,\n status: 404,\n error: `Item not found in injected data for variable ${variableId}`,\n parsedData: null,\n });\n }\n return {\n success: true,\n status: 200,\n parsedData: {\n data: item,\n continuationToken: null,\n previousPageToken: null,\n },\n };\n };\n\n /**\n * Sets the model for a data source variable. This only works for data source variables\n * that are in injected data mode.\n *\n * @param variableId the id of the data source variable to update\n * @param value the model to set for the data source variable\n * @returns\n */\n setInjectedModel = async (variableId: string, value: DataSourceVariableDataModel) => {\n const model = value.properties;\n const itemIdPropertyName = value.itemIdPropertyName;\n const res = await this.#editorAPI;\n return res\n .setInjectedDataSourceVariableModel(variableId, JSON.stringify(model), itemIdPropertyName)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets the source type for a data source variable.\n *\n * @param variableId the id of the data source variable to update\n * @param sourceType the source type to set for the data source variable\n * @returns\n */\n setSourceType = async (variableId: string, sourceType: DataSourceVariableSourceType) => {\n const res = await this.#editorAPI;\n return res\n .setDataSourceVariableSourceType(variableId, sourceType)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets the connector for a data source variable. This only works for data source variables\n * that are in connector source type.\n *\n * @param variableId the id of the data source variable to update\n * @param registration the connector registration to set for the data source variable\n * @returns The new id of the connector\n */\n setConnector = async (variableId: string, registration: ConnectorRegistration) => {\n const res = await this.#editorAPI;\n const connectorCompatibilityTools = new ConnectorCompatibilityTools();\n const connectorRegistration = connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\n return res\n .setDataSourceVariableConnector(variableId, JSON.stringify(connectorRegistration))\n .then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * Removes the connector for a data source variable. This only works for data source variables\n * that are in connector source type.\n *\n * @param variableId the id of the data source variable to update\n * @returns\n */\n removeConnector = async (variableId: string) => {\n const res = await this.#editorAPI;\n return res\n .setDataSourceVariableConnector(variableId, null)\n .then((result) => getEditorResponseData<null>(result));\n };\n}\n\n/**\n * The VariableController is responsible for all communication regarding the variables.\n * Methods inside this controller can be called by `window.SDK.variable.{method-name}`\n */\nexport class VariableController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n number: NumberVariable;\n date: DateVariable;\n /**\n * @experimental\n * This controller is experimental and might change in future releases.\n * Use at your own risk.\n */\n dataSource: DataSourceVariable;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI, dataItemMappingTools: DataItemMappingTools) {\n this.#editorAPI = editorAPI;\n this.number = new NumberVariable(this.#editorAPI);\n this.date = new DateVariable(this.#editorAPI);\n this.dataSource = new DataSourceVariable(this.#editorAPI, dataItemMappingTools);\n }\n\n /**\n * This method returns the list of variables\n * @returns\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res\n .getVariables()\n .then((result) => getEditorResponseData<Variable[]>(result))\n .then((resp) => {\n const update = resp;\n if (update.parsedData) {\n update.parsedData = this.makeVariablesBackwardsCompatible(update.parsedData);\n }\n return update;\n });\n };\n\n /**\n * This method returns a variable by id\n * @param id the id of a specific variable\n * @returns\n */\n getById = async (id: string) => {\n const res = await this.#editorAPI;\n return res\n .getVariableById(id)\n .then((result) => getEditorResponseData<Variable>(result))\n .then((resp) => {\n const update = resp;\n if (update.parsedData) {\n update.parsedData = this.makeVariableBackwardsCompatible(update.parsedData);\n }\n return update;\n });\n };\n\n /**\n * This method returns a variable by name\n * @param name the name of a specific variable\n * @returns\n */\n getByName = async (name: string) => {\n const res = await this.#editorAPI;\n return res\n .getVariableByName(name)\n .then((result) => getEditorResponseData<Variable>(result))\n .then((resp) => {\n const update = resp;\n if (update.parsedData) {\n update.parsedData = this.makeVariableBackwardsCompatible(update.parsedData);\n }\n return update;\n });\n };\n\n /**\n * This method creates a new variable\n * @param parentId parent id of the created variable\n * @param type type of the created variable\n * @returns the new created variable id\n */\n create = async (parentId: string, type: VariableType) => {\n const res = await this.#editorAPI;\n return res.addVariable(parentId, type).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method removes a list of variables.\n *\n * All connectors linked to the variables will be unregistered.\n * @param ids list of the variables to be removed\n * @returns\n */\n remove = async (ids: string[]) => {\n const res = await this.#editorAPI;\n return res.removeVariables(ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new name for a variable\n * @param id id of the variable\n * @param name name of the variable\n * @returns\n */\n rename = async (id: string, name: string) => {\n const res = await this.#editorAPI;\n return res.setVariableName(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new label for a variable\n * @param id id of the variable\n * @param label label of the variable\n * @returns\n */\n setLabel = async (id: string, label: string | null) => {\n const res = await this.#editorAPI;\n return res.setVariableLabel(id, label).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Internal private method to set/reset a placeholder for a variable\n */\n #setPlaceholder = async (id: string, placeholder: string | null) => {\n const res = await this.#editorAPI;\n return res.setVariablePlaceholder(id, placeholder).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new placeholder for a variable\n * @param id id of the variable\n * @param placeholder placeholder of the variable\n * @returns\n */\n setPlaceholder = async (id: string, placeholder: string) => {\n return this.#setPlaceholder(id, placeholder);\n };\n\n /**\n * This method resets a placeholder for a variable\n * @param id id of the variable\n * @returns\n */\n resetPlaceholder = async (id: string) => {\n return this.#setPlaceholder(id, null);\n };\n\n /**\n * Internal private method to set/reset a help text for a variable\n */\n #setHelpText = async (id: string, helpText: string | null) => {\n const res = await this.#editorAPI;\n return res.setVariableHelpText(id, helpText).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new help text for a variable\n * @param id id of the variable\n * @param helpText placeholder of the variable\n * @returns\n */\n setHelpText = async (id: string, helpText: string) => {\n return this.#setHelpText(id, helpText);\n };\n\n /**\n * This method resets a help text for a variable\n * @param id id of the variable\n * @returns\n */\n resetHelpText = async (id: string) => {\n return this.#setHelpText(id, null);\n };\n\n /**\n * This method sets a new type for a variable\n * @param id id of the variable\n * @param type type of the variable\n * @returns\n */\n setType = async (id: string, type: VariableType) => {\n const res = await this.#editorAPI;\n return res.setVariableType(id, type).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the rule set id for a rich text variable\n * @param id id of the variable\n * @param ruleSetId id of the rule set\n * @returns\n */\n setRuleSetId = async (id: string, ruleSetId: string) => {\n const res = await this.#editorAPI;\n return res.setVariableRuleSetId(id, ruleSetId).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the items of the list variable\n *\n * The items need to be unique and are not case sensitive.\n *\n * @param id the id of the list variable\n * @param items the items of the list\n * @returns\n */\n setListVariable = async (id: Id, items: string[]) => {\n const res = await this.#editorAPI;\n return res\n .setListVariableItems(\n id,\n items.map((item) => JSON.stringify(<ListVariableItem>{ value: item })),\n )\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new value for a variable\n *\n * If the value is some text to be set on a ShortTextVariable, it must not\n * contain any type of line breaks.\n *\n * If the value is passing a context on an image variable value, it will be\n * available from the connector.\n *\n * @param id the id of the variable\n * @param value the new value of the variable\n * @returns\n */\n setValue = async (id: Id, value: string | boolean | number | null) => {\n const res = await this.#editorAPI;\n return res\n .setVariableValue(id, value)\n .then((result) => getEditorResponseData<null>(result, (r) => throwVariableException(r, { id })));\n };\n\n /**\n * This method creates a copy of a variable\n * @returns\n */\n duplicate = async (id: string) => {\n const res = await this.#editorAPI;\n return res.duplicateVariable(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method aggregates the provided variables into a new group\n * @param name name of the new group\n * @param ids list of variable ids to group together\n * @returns group id\n */\n groupVariables = async (name: string, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.groupVariables(name, ids).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method dissolves the specified group\n * @param id id of the variable group\n * @returns\n */\n ungroupVariables = async (id: string) => {\n const res = await this.#editorAPI;\n return res.ungroupVariable(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method moves a variable's position\n * @param order new order of variable\n * @param id id of the variable\n * @param parentId parent id of the created variable\n * @returns\n */\n move = async (order: number, id: string, parentId: string) => {\n const res = await this.#editorAPI;\n return res.moveVariable(id, parentId, order).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method changes positions of variables\n * @param order new order of variable\n * @param ids Array of the variable IDs\n * @param parentId parent id of the variables\n * @returns\n */\n moveVariables = async (order: number, ids: string[], parentId: string) => {\n const res = await this.#editorAPI;\n return res.moveVariables(ids, parentId, order).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated Use `setVariableVisibility` instead.\n * This method redirects to `setVariableVisibility` and sets visibility config for a variable by id.\n * @param id variable id\n * @param isVisible visibility flag\n * @returns\n */\n setIsVisible = async (id: string, isVisible: boolean) => {\n const config = isVisible\n ? { type: VariableVisibilityType.visible }\n : { type: VariableVisibilityType.invisible };\n\n return this.setVariableVisibility(id, config as VariableVisibility);\n };\n\n /**\n * @deprecated Use `setVariableVisibility` instead.\n * This method redirects to `setVariableVisibility` and sets visibility config for a variable by id.\n * @param id variable id\n * @param isHidden visibility flag\n * @returns\n */\n setIsHidden = async (id: string, isHidden: boolean) => {\n const config = isHidden ? { type: VariableVisibilityType.invisible } : { type: VariableVisibilityType.visible };\n\n return this.setVariableVisibility(id, config as VariableVisibility);\n };\n\n /**\n * This method sets visibility config for a variable by id\n * @param id variable id\n * @param config visibility config\n * @returns\n */\n setVariableVisibility = async (id: string, config: VariableVisibility) => {\n const res = await this.#editorAPI;\n return res\n .setVariableVisibility(id, JSON.stringify(config))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets which layouts are considered for variable visibility\n * @param layoutIdList nullable layout id list.\n * Pass null to reset to follow selected layout.\n * @returns\n */\n setLayoutsForVariableVisibility = async (layoutIdList?: Id[] | null) => {\n const res = await this.#editorAPI;\n return res\n .setLayoutsForVariableVisibility(layoutIdList ? JSON.stringify(layoutIdList) : null)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets isRequired flag for a variable\n * @returns\n */\n setIsRequired = async (id: string, isRequired: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsRequired(id, isRequired).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets removeParagraphIfEmpty flag for a variable\n * @param id The id of the variable to update\n * @param removeParagraphIfEmpty Set to true to remove the paragraph if it is empty, or false to keep it\n * @returns\n */\n setRemoveParagraphIfEmpty = async (id: string, removeParagraphIfEmpty: boolean) => {\n const res = await this.#editorAPI;\n return res\n .setVariableRemoveParagraphIfEmpty(id, removeParagraphIfEmpty)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets maxCharacters limit on a text variable\n * @param id The id of the variable to update\n * @param maxCharacters Sets the max number of characters for that variable\n * maxCharacters > 0 && maxCharacters <= 100000000 or it can be set to null\n * @returns\n */\n setVariableCharacterLimit = async (id: string, maxCharacters: number | null) => {\n const res = await this.#editorAPI;\n return res.setVariableCharacterLimit(id, maxCharacters).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets isReadonly flag for a variable\n * @returns\n */\n setIsReadonly = async (id: string, isReadonly: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsReadonly(id, isReadonly).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets the image variable connector id.\n * @param id The id of the image variable\n * @returns The id of the connector\n */\n getImageVariableConnectorId = async (id: string) => {\n const res = await this.#editorAPI;\n return res.getImageVariableConnectorId(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method sets the image variable connector. Setting a connector will\n * automatically remove the assetId linked to the connector if present.\n * If a connector was the source of the variable, it will be unregistered.\n * @param id The id of the image variable to update\n * @param registration registration object containing all details about the connector\n * @returns The new id of the connector\n */\n setImageVariableConnector = async (id: string, registration: ConnectorRegistration) => {\n const res = await this.#editorAPI;\n const connectorCompatibilityTools = new ConnectorCompatibilityTools();\n const connectorRegistration = connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\n\n return res\n .setImageVariableConnector(id, JSON.stringify(connectorRegistration))\n .then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method sets the value of an image variable along with its context in a single atomic operation\n * @param id the id of the image variable to update\n * @param value the new value of the image variable\n * @param context the context dictionary\n * @returns\n */\n setImageVariableValueWithContext = async (id: string, value: string | null, context: Dictionary) => {\n const res = await this.#editorAPI;\n return res\n .setImageVariableValueWithContext(id, value, JSON.stringify(context))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated use `setValue` instead and pass `null` as the value argument.\n *\n * This method removes the variable source\n * @param id the id of the variable to update\n */\n removeSource = async (id: string) => {\n return this.setValue(id, null);\n };\n\n /**\n * @experimental Sets the prefix for a supported variable\n * @param id the id of the variable to update\n * @param prefix the prefix to set/clear\n * @returns\n */\n setPrefix = async (id: string, prefix: string | null) => {\n const update = { prefix: { value: prefix } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * @experimental Sets the suffix for a supported variable\n * @param id the id of the variable to update\n * @param suffix the suffix to set/clear\n * @returns\n */\n setSuffix = async (id: string, suffix: string | null) => {\n const update = { suffix: { value: suffix } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * @experimental Sets the prefix character style for a supported variable\n * @param id the id of the variable to update\n * @param characterStyleId the id of the character style to use/clear for the prefix\n * @returns\n */\n setPrefixCharacterStyle = async (id: string, characterStyleId: string | null) => {\n const update = { prefixCharacterStyleId: { value: characterStyleId } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * @experimental Sets the suffix character style for a supported variable\n * @param id the id of the variable to update\n * @param characterStyleId the id of the character style to use/clear for the suffix\n * @returns\n */\n setSuffixCharacterStyle = async (id: string, characterStyleId: string | null) => {\n const update = { suffixCharacterStyleId: { value: characterStyleId } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * Sets the private data for any variable\n * @param id the id of the variable to update\n * @param privateData the private data\n * @returns\n */\n setPrivateData = async (id: string, privateData: PrivateData) => {\n const res = await this.#editorAPI;\n return res\n .setVariablePrivateData(id, JSON.stringify(privateData))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Gets the private data for any variable\n * @param id the id of the variable\n * @returns the private data\n */\n getPrivateData = async (id: string) => {\n const res = await this.#editorAPI;\n return res.getVariablePrivateData(id).then((result) => getEditorResponseData<PrivateData>(result));\n };\n\n /**\n * This method sets the allowQuery flag for an image variable\n * @param id the id of the variable\n * @param allowQuery the allowQuery flag\n * @returns\n */\n setAllowImageQuery = async (id: string, allowQuery: boolean) => {\n const res = await this.#editorAPI;\n return res.setImageVariableAllowQuery(id, allowQuery).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the allowUpload flag for an image variable\n * @param id the id of the variable\n * @param allowUpload the allowUpload flag\n * @returns\n */\n setAllowImageUpload = async (id: string, allowUpload: boolean) => {\n const res = await this.#editorAPI;\n return res.setImageVariableAllowUpload(id, allowUpload).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the minimum size (both width and height) for an image variable that will be uploaded\n * @param id the id of the variable\n * @param minWidth the minimum width\n * @param minHeight the minimum height\n * @returns\n */\n setMinImageUploadSize = async (id: string, minWidth: string | null, minHeight: string | null) => {\n const res = await this.#editorAPI;\n return res\n .setImageVariableUploadMinSize(id, minWidth, minHeight)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets the \"don't break\" flag for a short text variable. When set to true, the variable will not be split across lines.\n * @param id the id of the variable\n * @param isDontBreak the value of the \"don't break\" flag\n * @returns\n */\n setIsDontBreak = async (id: string, isDontBreak: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsDontBreak(id, isDontBreak).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method highlights the usages of a variable in\n * - pages\n * - frames\n * - actionTrigger\n * - variables\n * - outputDataSource\n * @param id the id of the variable\n * @returns the usages of the variable\n */\n highlightUsages = async (id: string): Promise<EditorResponse<VariableUsagesReport>> => {\n const res = await this.#editorAPI;\n return res.highlightVariableUsages(id).then((result) => getEditorResponseData<VariableUsagesReport>(result));\n };\n\n /**\n * This method sets the global rich text rules available for all rich text variables. This should be set\n * before a document is loaded to ensure the rules are available when they are needed.\n *\n * @param rules The rules to set, these replace the existing rules entirely.\n * @returns\n */\n setRichTextRules = async (rules: StructuredTextTextFlowDefinition[]) => {\n const res = await this.#editorAPI;\n return res.setRichTextRulesets(JSON.stringify(rules)).then((result) => getEditorResponseData<null>(result));\n };\n\n private makeVariablesBackwardsCompatible(variables: Variable[]) {\n return variables.map((variable) => {\n return this.makeVariableBackwardsCompatible(variable);\n });\n }\n\n private makeVariableBackwardsCompatible(variable: Variable) {\n if (variable.type !== VariableType.list) {\n return variable;\n }\n\n return this.makeListVariableBackwardsCompatible(variable as ListVariable);\n }\n\n private makeListVariableBackwardsCompatible(listVariable: ListVariable) {\n const updated = listVariable;\n\n const items = listVariable.items as unknown as ListVariableItem[];\n const selected = listVariable.selected as unknown as ListVariableItem | undefined;\n\n const newItems = items.map((item) => item.value);\n\n updated.items = newItems;\n updated.selected = selected?.value;\n\n return updated;\n }\n\n private async applyPrefixSuffixDeltaUpdate(id: string, update: PrefixSuffixDeltaUpdate) {\n const res = await this.#editorAPI;\n const result = await res.updateVariablePrefixSuffixProperties(id, JSON.stringify(update));\n return getEditorResponseData<null>(result);\n }\n}\n"],"names":["_editorAPI","item"],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,eAAe;AAAA,EAGjB,YAAY,WAAsB;AAFlC;AAYA,SAAA,aAAa,OAAO,IAAY,YAA2B;AACvD,YAAM,SAAS,EAAE,UAAU,EAAE,OAAO,UAAQ;AAC5C,aAAO,KAAK,sBAAsB,IAAI,MAAM;AAAA,IAChD;AAQA,SAAA,aAAa,OAAO,IAAY,YAA2B;AACvD,YAAM,SAAS,EAAE,UAAU,EAAE,OAAO,UAAQ;AAC5C,aAAO,KAAK,sBAAsB,IAAI,MAAM;AAAA,IAChD;AAQA,SAAA,iBAAiB,OAAO,IAAY,gBAAyB;AACzD,YAAM,SAAS,EAAE,aAAa,EA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AACxF,WAAO,sBAA4B,MAAM;AAAA,EAC7C;AACJ;AAtmBIA,cAAA;AA6HA;AA2BA;"}
|
|
1
|
+
{"version":3,"file":"VariableController.es.js","sources":["../../../src/controllers/VariableController.ts"],"sourcesContent":["import { EditorAPI, EditorResponse, Id, PrivateData } from '../types/CommonTypes';\nimport { ConnectorRegistration } from '../types/ConnectorTypes';\nimport {\n BidirectionalDataPage,\n BidirectionalDataPageItem,\n DataItem,\n DataSourceVariableDataModel,\n Dictionary,\n} from '@chili-studio/connector-types';\nimport {\n DataSourceVariableDisplayOptionsType,\n DateRestriction,\n DateVariablePropertiesDeltaUpdate,\n Day,\n ListVariable,\n ListVariableItem,\n Locale,\n NumberVariablePropertiesDeltaUpdate,\n PrefixSuffixDeltaUpdate,\n RowId,\n Variable,\n VariableType,\n VariableUsagesReport,\n VariableVisibility,\n VariableVisibilityType,\n DataSourceVariableSourceType,\n} from '../types/VariableTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ConnectorCompatibilityTools } from '../utils/ConnectorCompatibilityTools';\nimport { EditorDataPage } from '../types/DataConnectorTypes';\nimport { DataItemMappingTools, EngineDataItem } from '../utils/DataItemMappingTools';\nimport { throwEditorResponseError, throwVariableException } from '../exceptions';\nimport { isInjectedDataSourceVariable } from '../utils/VariableHelper';\nimport { StructuredTextTextFlowDefinition } from '../types/RichTextRuleTypes';\n\nclass NumberVariable {\n #editorAPI: EditorAPI;\n\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * @experimental Sets the minimum value for a number variable\n * @param id the id of the variable to update\n * @param minimum the minimum value or null to remove the minimum value\n * @returns\n */\n setMinimum = async (id: string, minimum: number | null) => {\n const update = { minValue: { value: minimum } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the maximum value for a number variable\n * @param id the id of the variable to update\n * @param maximum the maximum value or null to remove the maximum value\n * @returns\n */\n setMaximum = async (id: string, maximum: number | null) => {\n const update = { maxValue: { value: maximum } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the visibility of the stepper for a number variable\n * @param id the id of the variable to update\n * @param showStep true to show the stepper, false to hide it\n * @returns\n */\n setShowStepper = async (id: string, showStepper: boolean) => {\n const update = { showStepper: { value: showStepper } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the step size for a number variable\n * @param id the id of the variable to update\n * @param stepSize the step size. Must be > 0\n * @returns\n */\n setStepSize = async (id: string, stepSize: number) => {\n const update = { stepSize: { value: stepSize } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the thousands separator for a number variable\n * @param id the id of the variable to update\n * @param thousandsSeparator the thousands separator to use\n * @returns\n */\n setThousandsSeparator = async (id: string, thousandsSeparator: '' | '.' | ',' | ' ') => {\n const update = { thousandsSeparator: { value: thousandsSeparator } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the decimal separator for a number variable\n * @param id the id of the variable to update\n * @param decimalSeparator the decimal separator to use\n * @returns\n */\n setDecimalSeparator = async (id: string, decimalSeparator: '' | '.' | ',' | ' ') => {\n const update = { decimalSeparator: { value: decimalSeparator } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets or clears the decimal character style for a number variable\n * @param id the id of the variable to update\n * @param characterStyleId the id of the character style to use/clear for the decimals\n * @returns\n */\n setDecimalCharacterStyle = async (id: string, characterStyleId: string | null) => {\n const update = { decimalCharacterStyleId: { value: characterStyleId } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental Sets the number of decimals for a number variable\n * @param id the id of the variable to update\n * @param numberOfDecimals the number of decimals to use\n * @returns\n */\n setNumberOfDecimals = async (id: string, numberOfDecimals: 0 | 1 | 2 | 3 | 4) => {\n const update = { numberOfDecimals: { value: numberOfDecimals } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n private async applyPropertiesUpdate(id: string, update: NumberVariablePropertiesDeltaUpdate) {\n const res = await this.#editorAPI;\n const result = await res.updateNumberVariableProperties(id, JSON.stringify(update));\n return getEditorResponseData<null>(result);\n }\n}\n\nclass DateVariable {\n #editorAPI: EditorAPI;\n\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * @experimental This method sets the display format for a date variable.\n *\n * The `displayFormat` is using ICU formatting (Unicode).\n *\n * Supported date formats:\n * - Day -> `d`, `dd`\n * - Month -> `M`, `MM`, `MMM`, `MMMM`\n * - Year -> `yy`, `yyyy`\n * - Day of week -> `ccc`, `cccc`\n *\n * Examples for an input date of `10-12-1815`:\n * - Format `dd/MM/yyyy` will display `12/10/1815`\n * - Format `d.M.yy` will display `12.10.15`\n * - Format `d MMM yyyy` will display `12 Oct 1815` for the `en_US` language\n * - Format `MMMM d, yyyy` will display `October 12, 1815` for the `en_US` language\n * - Format `ccc, MMM d, yyyy` will display `Thu, Oct 12, 1815` for the `en_US` language\n * - Format `cccc, MMMM d, yyyy` will display `Thursday, October 12, 1815` for the `en_US` language\n * - Format `cccc, MMMM d, yyyy` will display `donderdag, oktober 12, 1815` for the `nl` language\n *\n * Patterns which output words such as `MMM`, `MMMM`, `ccc` and `cccc` will\n * differ depending on chosen language (default is `en_US`).\n *\n * @param id The id of the date variable to update\n * @param displayFormat The display format for the date variable\n */\n setDisplayFormat = async (id: string, displayFormat: string) => {\n const update = { displayFormat: { value: displayFormat } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets the locale for a date variable.\n *\n * @param id The id of the date variable to update\n * @param locale The locale for the date variable (`'en_US'`, `'fi'`, `'fr'`...)\n */\n setLocale = async (id: string, locale: Locale) => {\n const update = { locale: { value: locale } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets or clears the start date for a date variable.\n * @param id The id of the date variable to update\n * @param date The start date for the date variable\n */\n setStartDate = async (id: string, date: DateRestriction | null) => {\n const update = { startDate: { value: date } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets or clears the end date for a date variable.\n * @param id The id of the date variable to update\n * @param date The end date for the date variable\n */\n setEndDate = async (id: string, date: DateRestriction | null) => {\n const update = { endDate: { value: date } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n /**\n * @experimental This method sets or clears the excluded days for a date variable.\n * @param id The id of the date variable to update\n * @param excludedDays The excluded days for the date variable\n */\n setExcludedDays = async (id: string, excludedDays: Day[] | null) => {\n const update = { excludedDays: { value: excludedDays } };\n return this.applyPropertiesUpdate(id, update);\n };\n\n private async applyPropertiesUpdate(id: string, update: DateVariablePropertiesDeltaUpdate) {\n const res = await this.#editorAPI;\n const result = await res.updateDateVariableProperties(id, JSON.stringify(update));\n return getEditorResponseData<null>(result);\n }\n}\n\nclass DataSourceVariable {\n #editorAPI: EditorAPI;\n #dataItemMappingTools: DataItemMappingTools;\n\n constructor(editorAPI: EditorAPI, dataItemMappingTools: DataItemMappingTools) {\n this.#editorAPI = editorAPI;\n this.#dataItemMappingTools = dataItemMappingTools;\n }\n\n /**\n * Sets the value for a data source variable.\n *\n * @param id the id of the data source variable to update\n * @param value the value to set for the data source variable. This can be a list of records, when we set the data for the data source variable in injected data mode\n * or a single record id, when we have to change the selected record value .\n * @returns\n */\n setValue = async (id: string, value: RowId | DataItem[]) => {\n const res = await this.#editorAPI;\n let engineValue: string | EngineDataItem[];\n if (Array.isArray(value)) {\n engineValue = value.map((item) => this.#dataItemMappingTools.mapDataItemToEngine(item));\n } else {\n engineValue = value;\n }\n return res.setVariableValue(id, engineValue).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets how the data source variable is displayed in the UI (table or list with optional display column).\n * @param variableId The id of the data source variable to update\n * @param displayOptionsType Whether to show the full table or a single column (list)\n * @param displayColumn Column name when displayOptionsType is list\n * @returns\n */\n setDisplayOptions(\n variableId: string,\n displayOptionsType: DataSourceVariableDisplayOptionsType.table,\n ): Promise<EditorResponse<null>>;\n setDisplayOptions(\n variableId: string,\n displayOptionsType: DataSourceVariableDisplayOptionsType.list,\n displayColumn: string,\n ): Promise<EditorResponse<null>>;\n async setDisplayOptions(\n variableId: string,\n displayOptionsType: DataSourceVariableDisplayOptionsType,\n displayColumn?: string,\n ) {\n const res = await this.#editorAPI;\n return res\n .setDataSourceVariableDisplayOptions(variableId, displayOptionsType, displayColumn ?? undefined)\n .then((result) => getEditorResponseData<null>(result));\n }\n\n /**\n * Get the injected data from a data source variable. This only works for data source variables\n * that are in injected data mode. If no data is set, an empty list will be returned.\n * @param variableId the id of the variable\n * @returns a DataPage with an array of data objects\n */\n getInjectedData = async (variableId: string): Promise<EditorResponse<BidirectionalDataPage>> => {\n const res = await this.#editorAPI;\n return res\n .getInjectedDataSourceVariableData(variableId)\n .then((result) => getEditorResponseData<EditorDataPage<EngineDataItem>>(result))\n .then((resp) => {\n const update: EditorResponse<BidirectionalDataPage> = { ...resp, parsedData: null };\n if (resp.parsedData) {\n update.parsedData = {\n ...resp.parsedData,\n data: resp.parsedData.data.map((e: EngineDataItem) =>\n this.#dataItemMappingTools.mapEngineToDataItem(e),\n ),\n };\n }\n return update;\n });\n };\n\n /**\n * Get a single item from injected data of a data source variable. This only works for data source variables\n * that are in injected data mode.\n * @param variableId the id of the variable\n * @param itemId the id of the item to get\n * @returns a BidirectionalDataPageItem with the item and empty navigation tokens\n */\n getInjectedItemById = async (\n variableId: string,\n itemId: string,\n ): Promise<EditorResponse<BidirectionalDataPageItem>> => {\n const res = await this.#editorAPI;\n\n const variable = await res\n .getVariableById(variableId)\n .then((result) => getEditorResponseData<Variable>(result));\n\n if (!isInjectedDataSourceVariable(variable.parsedData)) {\n throwEditorResponseError({\n success: false,\n status: 400,\n error: `Variable is not an injected data source variable`,\n parsedData: null,\n });\n }\n\n const itemIdPropertyName = variable.parsedData.value.itemIdPropertyName;\n\n const injectedData = await this.getInjectedData(variableId);\n\n const item = injectedData.parsedData?.data.find(\n (item) => item[itemIdPropertyName]?.toString() === itemId.toString(),\n );\n\n if (!item) {\n throwEditorResponseError({\n success: false,\n status: 404,\n error: `Item not found in injected data for variable ${variableId}`,\n parsedData: null,\n });\n }\n return {\n success: true,\n status: 200,\n parsedData: {\n data: item,\n continuationToken: null,\n previousPageToken: null,\n },\n };\n };\n\n /**\n * Sets the model for a data source variable. This only works for data source variables\n * that are in injected data mode.\n *\n * @param variableId the id of the data source variable to update\n * @param value the model to set for the data source variable\n * @returns\n */\n setInjectedModel = async (variableId: string, value: DataSourceVariableDataModel) => {\n const model = value.properties;\n const itemIdPropertyName = value.itemIdPropertyName;\n const res = await this.#editorAPI;\n return res\n .setInjectedDataSourceVariableModel(variableId, JSON.stringify(model), itemIdPropertyName)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets the source type for a data source variable.\n *\n * @param variableId the id of the data source variable to update\n * @param sourceType the source type to set for the data source variable\n * @returns\n */\n setSourceType = async (variableId: string, sourceType: DataSourceVariableSourceType) => {\n const res = await this.#editorAPI;\n return res\n .setDataSourceVariableSourceType(variableId, sourceType)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets the connector for a data source variable. This only works for data source variables\n * that are in connector source type.\n *\n * @param variableId the id of the data source variable to update\n * @param registration the connector registration to set for the data source variable\n * @returns The new id of the connector\n */\n setConnector = async (variableId: string, registration: ConnectorRegistration) => {\n const res = await this.#editorAPI;\n const connectorCompatibilityTools = new ConnectorCompatibilityTools();\n const connectorRegistration = connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\n return res\n .setDataSourceVariableConnector(variableId, JSON.stringify(connectorRegistration))\n .then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * Removes the connector for a data source variable. This only works for data source variables\n * that are in connector source type.\n *\n * @param variableId the id of the data source variable to update\n * @returns\n */\n removeConnector = async (variableId: string) => {\n const res = await this.#editorAPI;\n return res\n .setDataSourceVariableConnector(variableId, null)\n .then((result) => getEditorResponseData<null>(result));\n };\n}\n\n/**\n * The VariableController is responsible for all communication regarding the variables.\n * Methods inside this controller can be called by `window.SDK.variable.{method-name}`\n */\nexport class VariableController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n number: NumberVariable;\n date: DateVariable;\n /**\n * @experimental\n * This controller is experimental and might change in future releases.\n * Use at your own risk.\n */\n dataSource: DataSourceVariable;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI, dataItemMappingTools: DataItemMappingTools) {\n this.#editorAPI = editorAPI;\n this.number = new NumberVariable(this.#editorAPI);\n this.date = new DateVariable(this.#editorAPI);\n this.dataSource = new DataSourceVariable(this.#editorAPI, dataItemMappingTools);\n }\n\n /**\n * This method returns the list of variables\n * @returns\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res\n .getVariables()\n .then((result) => getEditorResponseData<Variable[]>(result))\n .then((resp) => {\n const update = resp;\n if (update.parsedData) {\n update.parsedData = this.makeVariablesBackwardsCompatible(update.parsedData);\n }\n return update;\n });\n };\n\n /**\n * This method returns a variable by id\n * @param id the id of a specific variable\n * @returns\n */\n getById = async (id: string) => {\n const res = await this.#editorAPI;\n return res\n .getVariableById(id)\n .then((result) => getEditorResponseData<Variable>(result))\n .then((resp) => {\n const update = resp;\n if (update.parsedData) {\n update.parsedData = this.makeVariableBackwardsCompatible(update.parsedData);\n }\n return update;\n });\n };\n\n /**\n * This method returns a variable by name\n * @param name the name of a specific variable\n * @returns\n */\n getByName = async (name: string) => {\n const res = await this.#editorAPI;\n return res\n .getVariableByName(name)\n .then((result) => getEditorResponseData<Variable>(result))\n .then((resp) => {\n const update = resp;\n if (update.parsedData) {\n update.parsedData = this.makeVariableBackwardsCompatible(update.parsedData);\n }\n return update;\n });\n };\n\n /**\n * This method creates a new variable\n * @param parentId parent id of the created variable\n * @param type type of the created variable\n * @returns the new created variable id\n */\n create = async (parentId: string, type: VariableType) => {\n const res = await this.#editorAPI;\n return res.addVariable(parentId, type).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method removes a list of variables.\n *\n * All connectors linked to the variables will be unregistered.\n * @param ids list of the variables to be removed\n * @returns\n */\n remove = async (ids: string[]) => {\n const res = await this.#editorAPI;\n return res.removeVariables(ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new name for a variable\n * @param id id of the variable\n * @param name name of the variable\n * @returns\n */\n rename = async (id: string, name: string) => {\n const res = await this.#editorAPI;\n return res.setVariableName(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new label for a variable\n * @param id id of the variable\n * @param label label of the variable\n * @returns\n */\n setLabel = async (id: string, label: string | null) => {\n const res = await this.#editorAPI;\n return res.setVariableLabel(id, label).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Internal private method to set/reset a placeholder for a variable\n */\n #setPlaceholder = async (id: string, placeholder: string | null) => {\n const res = await this.#editorAPI;\n return res.setVariablePlaceholder(id, placeholder).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new placeholder for a variable\n * @param id id of the variable\n * @param placeholder placeholder of the variable\n * @returns\n */\n setPlaceholder = async (id: string, placeholder: string) => {\n return this.#setPlaceholder(id, placeholder);\n };\n\n /**\n * This method resets a placeholder for a variable\n * @param id id of the variable\n * @returns\n */\n resetPlaceholder = async (id: string) => {\n return this.#setPlaceholder(id, null);\n };\n\n /**\n * Internal private method to set/reset a help text for a variable\n */\n #setHelpText = async (id: string, helpText: string | null) => {\n const res = await this.#editorAPI;\n return res.setVariableHelpText(id, helpText).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new help text for a variable\n * @param id id of the variable\n * @param helpText placeholder of the variable\n * @returns\n */\n setHelpText = async (id: string, helpText: string) => {\n return this.#setHelpText(id, helpText);\n };\n\n /**\n * This method resets a help text for a variable\n * @param id id of the variable\n * @returns\n */\n resetHelpText = async (id: string) => {\n return this.#setHelpText(id, null);\n };\n\n /**\n * Internal private method to set/reset a description for a variable\n */\n #setDescription = async (id: string, description: string | null) => {\n const res = await this.#editorAPI;\n return res.setVariableDescription(id, description).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new description for a variable\n * @param id id of the variable\n * @param description description of the variable\n * @returns\n */\n setDescription = async (id: string, description: string) => {\n return this.#setDescription(id, description);\n };\n\n /**\n * This method resets a description for a variable\n * @param id id of the variable\n * @returns\n */\n resetDescription = async (id: string) => {\n return this.#setDescription(id, null);\n };\n\n /**\n * This method sets a new type for a variable\n * @param id id of the variable\n * @param type type of the variable\n * @returns\n */\n setType = async (id: string, type: VariableType) => {\n const res = await this.#editorAPI;\n return res.setVariableType(id, type).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the rule set id for a rich text variable\n * @param id id of the variable\n * @param ruleSetId id of the rule set\n * @returns\n */\n setRuleSetId = async (id: string, ruleSetId: string) => {\n const res = await this.#editorAPI;\n return res.setVariableRuleSetId(id, ruleSetId).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the items of the list variable\n *\n * The items need to be unique and are not case sensitive.\n *\n * @param id the id of the list variable\n * @param items the items of the list\n * @returns\n */\n setListVariable = async (id: Id, items: string[]) => {\n const res = await this.#editorAPI;\n return res\n .setListVariableItems(\n id,\n items.map((item) => JSON.stringify(<ListVariableItem>{ value: item })),\n )\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new value for a variable\n *\n * If the value is some text to be set on a ShortTextVariable, it must not\n * contain any type of line breaks.\n *\n * If the value is passing a context on an image variable value, it will be\n * available from the connector.\n *\n * @param id the id of the variable\n * @param value the new value of the variable\n * @returns\n */\n setValue = async (id: Id, value: string | boolean | number | null) => {\n const res = await this.#editorAPI;\n return res\n .setVariableValue(id, value)\n .then((result) => getEditorResponseData<null>(result, (r) => throwVariableException(r, { id })));\n };\n\n /**\n * This method creates a copy of a variable\n * @returns\n */\n duplicate = async (id: string) => {\n const res = await this.#editorAPI;\n return res.duplicateVariable(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method aggregates the provided variables into a new group\n * @param name name of the new group\n * @param ids list of variable ids to group together\n * @returns group id\n */\n groupVariables = async (name: string, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.groupVariables(name, ids).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method dissolves the specified group\n * @param id id of the variable group\n * @returns\n */\n ungroupVariables = async (id: string) => {\n const res = await this.#editorAPI;\n return res.ungroupVariable(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method moves a variable's position\n * @param order new order of variable\n * @param id id of the variable\n * @param parentId parent id of the created variable\n * @returns\n */\n move = async (order: number, id: string, parentId: string) => {\n const res = await this.#editorAPI;\n return res.moveVariable(id, parentId, order).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method changes positions of variables\n * @param order new order of variable\n * @param ids Array of the variable IDs\n * @param parentId parent id of the variables\n * @returns\n */\n moveVariables = async (order: number, ids: string[], parentId: string) => {\n const res = await this.#editorAPI;\n return res.moveVariables(ids, parentId, order).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated Use `setVariableVisibility` instead.\n * This method redirects to `setVariableVisibility` and sets visibility config for a variable by id.\n * @param id variable id\n * @param isVisible visibility flag\n * @returns\n */\n setIsVisible = async (id: string, isVisible: boolean) => {\n const config = isVisible\n ? { type: VariableVisibilityType.visible }\n : { type: VariableVisibilityType.invisible };\n\n return this.setVariableVisibility(id, config as VariableVisibility);\n };\n\n /**\n * @deprecated Use `setVariableVisibility` instead.\n * This method redirects to `setVariableVisibility` and sets visibility config for a variable by id.\n * @param id variable id\n * @param isHidden visibility flag\n * @returns\n */\n setIsHidden = async (id: string, isHidden: boolean) => {\n const config = isHidden ? { type: VariableVisibilityType.invisible } : { type: VariableVisibilityType.visible };\n\n return this.setVariableVisibility(id, config as VariableVisibility);\n };\n\n /**\n * This method sets visibility config for a variable by id\n * @param id variable id\n * @param config visibility config\n * @returns\n */\n setVariableVisibility = async (id: string, config: VariableVisibility) => {\n const res = await this.#editorAPI;\n return res\n .setVariableVisibility(id, JSON.stringify(config))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets which layouts are considered for variable visibility\n * @param layoutIdList nullable layout id list.\n * Pass null to reset to follow selected layout.\n * @returns\n */\n setLayoutsForVariableVisibility = async (layoutIdList?: Id[] | null) => {\n const res = await this.#editorAPI;\n return res\n .setLayoutsForVariableVisibility(layoutIdList ? JSON.stringify(layoutIdList) : null)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets isRequired flag for a variable\n * @returns\n */\n setIsRequired = async (id: string, isRequired: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsRequired(id, isRequired).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets removeParagraphIfEmpty flag for a variable\n * @param id The id of the variable to update\n * @param removeParagraphIfEmpty Set to true to remove the paragraph if it is empty, or false to keep it\n * @returns\n */\n setRemoveParagraphIfEmpty = async (id: string, removeParagraphIfEmpty: boolean) => {\n const res = await this.#editorAPI;\n return res\n .setVariableRemoveParagraphIfEmpty(id, removeParagraphIfEmpty)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets maxCharacters limit on a text variable\n * @param id The id of the variable to update\n * @param maxCharacters Sets the max number of characters for that variable\n * maxCharacters > 0 && maxCharacters <= 100000000 or it can be set to null\n * @returns\n */\n setVariableCharacterLimit = async (id: string, maxCharacters: number | null) => {\n const res = await this.#editorAPI;\n return res.setVariableCharacterLimit(id, maxCharacters).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets isReadonly flag for a variable\n * @returns\n */\n setIsReadonly = async (id: string, isReadonly: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsReadonly(id, isReadonly).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets the image variable connector id.\n * @param id The id of the image variable\n * @returns The id of the connector\n */\n getImageVariableConnectorId = async (id: string) => {\n const res = await this.#editorAPI;\n return res.getImageVariableConnectorId(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method sets the image variable connector. Setting a connector will\n * automatically remove the assetId linked to the connector if present.\n * If a connector was the source of the variable, it will be unregistered.\n * @param id The id of the image variable to update\n * @param registration registration object containing all details about the connector\n * @returns The new id of the connector\n */\n setImageVariableConnector = async (id: string, registration: ConnectorRegistration) => {\n const res = await this.#editorAPI;\n const connectorCompatibilityTools = new ConnectorCompatibilityTools();\n const connectorRegistration = connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\n\n return res\n .setImageVariableConnector(id, JSON.stringify(connectorRegistration))\n .then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method sets the value of an image variable along with its context in a single atomic operation\n * @param id the id of the image variable to update\n * @param value the new value of the image variable\n * @param context the context dictionary\n * @returns\n */\n setImageVariableValueWithContext = async (id: string, value: string | null, context: Dictionary) => {\n const res = await this.#editorAPI;\n return res\n .setImageVariableValueWithContext(id, value, JSON.stringify(context))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated use `setValue` instead and pass `null` as the value argument.\n *\n * This method removes the variable source\n * @param id the id of the variable to update\n */\n removeSource = async (id: string) => {\n return this.setValue(id, null);\n };\n\n /**\n * @experimental Sets the prefix for a supported variable\n * @param id the id of the variable to update\n * @param prefix the prefix to set/clear\n * @returns\n */\n setPrefix = async (id: string, prefix: string | null) => {\n const update = { prefix: { value: prefix } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * @experimental Sets the suffix for a supported variable\n * @param id the id of the variable to update\n * @param suffix the suffix to set/clear\n * @returns\n */\n setSuffix = async (id: string, suffix: string | null) => {\n const update = { suffix: { value: suffix } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * @experimental Sets the prefix character style for a supported variable\n * @param id the id of the variable to update\n * @param characterStyleId the id of the character style to use/clear for the prefix\n * @returns\n */\n setPrefixCharacterStyle = async (id: string, characterStyleId: string | null) => {\n const update = { prefixCharacterStyleId: { value: characterStyleId } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * @experimental Sets the suffix character style for a supported variable\n * @param id the id of the variable to update\n * @param characterStyleId the id of the character style to use/clear for the suffix\n * @returns\n */\n setSuffixCharacterStyle = async (id: string, characterStyleId: string | null) => {\n const update = { suffixCharacterStyleId: { value: characterStyleId } };\n return this.applyPrefixSuffixDeltaUpdate(id, update);\n };\n\n /**\n * Sets the private data for any variable\n * @param id the id of the variable to update\n * @param privateData the private data\n * @returns\n */\n setPrivateData = async (id: string, privateData: PrivateData) => {\n const res = await this.#editorAPI;\n return res\n .setVariablePrivateData(id, JSON.stringify(privateData))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Gets the private data for any variable\n * @param id the id of the variable\n * @returns the private data\n */\n getPrivateData = async (id: string) => {\n const res = await this.#editorAPI;\n return res.getVariablePrivateData(id).then((result) => getEditorResponseData<PrivateData>(result));\n };\n\n /**\n * This method sets the allowQuery flag for an image variable\n * @param id the id of the variable\n * @param allowQuery the allowQuery flag\n * @returns\n */\n setAllowImageQuery = async (id: string, allowQuery: boolean) => {\n const res = await this.#editorAPI;\n return res.setImageVariableAllowQuery(id, allowQuery).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the allowUpload flag for an image variable\n * @param id the id of the variable\n * @param allowUpload the allowUpload flag\n * @returns\n */\n setAllowImageUpload = async (id: string, allowUpload: boolean) => {\n const res = await this.#editorAPI;\n return res.setImageVariableAllowUpload(id, allowUpload).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the minimum size (both width and height) for an image variable that will be uploaded\n * @param id the id of the variable\n * @param minWidth the minimum width\n * @param minHeight the minimum height\n * @returns\n */\n setMinImageUploadSize = async (id: string, minWidth: string | null, minHeight: string | null) => {\n const res = await this.#editorAPI;\n return res\n .setImageVariableUploadMinSize(id, minWidth, minHeight)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Sets the \"don't break\" flag for a short text variable. When set to true, the variable will not be split across lines.\n * @param id the id of the variable\n * @param isDontBreak the value of the \"don't break\" flag\n * @returns\n */\n setIsDontBreak = async (id: string, isDontBreak: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsDontBreak(id, isDontBreak).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method highlights the usages of a variable in\n * - pages\n * - frames\n * - actionTrigger\n * - variables\n * - outputDataSource\n * @param id the id of the variable\n * @returns the usages of the variable\n */\n highlightUsages = async (id: string): Promise<EditorResponse<VariableUsagesReport>> => {\n const res = await this.#editorAPI;\n return res.highlightVariableUsages(id).then((result) => getEditorResponseData<VariableUsagesReport>(result));\n };\n\n /**\n * This method sets the global rich text rules available for all rich text variables. This should be set\n * before a document is loaded to ensure the rules are available when they are needed.\n *\n * @param rules The rules to set, these replace the existing rules entirely.\n * @returns\n */\n setRichTextRules = async (rules: StructuredTextTextFlowDefinition[]) => {\n const res = await this.#editorAPI;\n return res.setRichTextRulesets(JSON.stringify(rules)).then((result) => getEditorResponseData<null>(result));\n };\n\n private makeVariablesBackwardsCompatible(variables: Variable[]) {\n return variables.map((variable) => {\n return this.makeVariableBackwardsCompatible(variable);\n });\n }\n\n private makeVariableBackwardsCompatible(variable: Variable) {\n if (variable.type !== VariableType.list) {\n return variable;\n }\n\n return this.makeListVariableBackwardsCompatible(variable as ListVariable);\n }\n\n private makeListVariableBackwardsCompatible(listVariable: ListVariable) {\n const updated = listVariable;\n\n const items = listVariable.items as unknown as ListVariableItem[];\n const selected = listVariable.selected as unknown as ListVariableItem | undefined;\n\n const newItems = items.map((item) => item.value);\n\n updated.items = newItems;\n updated.selected = selected?.value;\n\n return updated;\n }\n\n private async applyPrefixSuffixDeltaUpdate(id: string, update: PrefixSuffixDeltaUpdate) {\n const res = await this.#editorAPI;\n const result = await res.updateVariablePrefixSuffixProperties(id, JSON.stringify(update));\n return getEditorResponseData<null>(result);\n }\n}\n"],"names":["_editorAPI","item"],"mappings":";;;;;;;;;;;;;AAmCA,MAAM,eAAe;AAAA,EAGjB,YAAY,WAAsB;AAFlC;A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U;AAC5C,SAAK,aAAa,IAAI,mBAAmB,mBAAKA,cAAY,oBAAoB;AAAA,EAClF;AAAA,EA6kBQ,iCAAiC,WAAuB;AAC5D,WAAO,UAAU,IAAI,CAAC,aAAa;AAC/B,aAAO,KAAK,gCAAgC,QAAQ;AAAA,IACxD,CAAC;AAAA,EACL;AAAA,EAEQ,gCAAgC,UAAoB;AACxD,QAAI,SAAS,SAAS,aAAa,MAAM;AACrC,aAAO;AAAA,IACX;AAEA,WAAO,KAAK,oCAAoC,QAAwB;AAAA,EAC5E;AAAA,EAEQ,oCAAoC,cAA4B;AACpE,UAAM,UAAU;AAEhB,UAAM,QAAQ,aAAa;AAC3B,UAAM,WAAW,aAAa;AAE9B,UAAM,WAAW,MAAM,IAAI,CAAC,SAAS,KAAK,KAAK;AAE/C,YAAQ,QAAQ;AAChB,YAAQ,WAAW,qCAAU;AAE7B,WAAO;AAAA,EACX;AAAA,EAEA,MAAc,6BAA6B,IAAY,QAAiC;AACpF,UAAM,MAAM,MAAM,mBAAKA;AACvB,UAAM,SAAS,MAAM,IAAI,qCAAqC,IAAI,KAAK,UAAU,MAAM,CAAC;AACxF,WAAO,sBAA4B,MAAM;AAAA,EAC7C;AACJ;AAjoBIA,cAAA;AA6HA;AA2BA;AA2BA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageController.cjs.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":["getEditorResponseData"],"mappings":";;;;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"PageController.cjs.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n // eslint-disable-next-line no-unused-private-class-members\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":["getEditorResponseData"],"mappings":";;;;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAexB,YAAY,WAAsB;AAXlC;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAgBA,SAAA,WAAW,OAAO,UAAkB;AAChC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,aAAa,KAAK,EAAE,KAAK,CAAC,WAAWA,yCAA4B,MAAM,CAAC;AAAA,IACvF;AAQA,SAAA,YAAY,OAAO,WAAmB;AAClC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,cAAc,MAAM,EAAE,KAAK,CAAC,WAAWA,yCAA4B,MAAM,CAAC;AAAA,IACzF;AAxBI,uBAAK,YAAa;AAClB,uBAAK,UAAW;AAAA,EACpB;AAuBJ;AArCI;AAMA;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageController.es.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"PageController.es.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n // eslint-disable-next-line no-unused-private-class-members\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAexB,YAAY,WAAsB;AAXlC;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAgBA,SAAA,WAAW,OAAO,UAAkB;AAChC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,aAAa,KAAK,EAAE,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IACvF;AAQA,SAAA,YAAY,OAAO,WAAmB;AAClC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,cAAc,MAAM,EAAE,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IACzF;AAxBI,uBAAK,YAAa;AAClB,uBAAK,UAAW;AAAA,EACpB;AAuBJ;AArCI;AAMA;"}
|
package/lib/src/sdk.cjs.js
CHANGED
|
@@ -47,7 +47,6 @@ const MethodInstrumentation = require("./utils/MethodInstrumentation.cjs.js");
|
|
|
47
47
|
const SdkEvents = require("./utils/SdkEvents.cjs.js");
|
|
48
48
|
const ENGINE_DOMAIN = "studio-cdn.chiligrafx.com";
|
|
49
49
|
const FIXED_EDITOR_LINK = `https://${ENGINE_DOMAIN}/editor/${editorEngine.default.current}/web`;
|
|
50
|
-
let connection;
|
|
51
50
|
const PENDING_INSTRUMENTATION = Symbol("pendingInstrumentation");
|
|
52
51
|
const markForInstrumentation = (controller) => {
|
|
53
52
|
Object.defineProperty(controller, PENDING_INSTRUMENTATION, {
|
|
@@ -65,13 +64,15 @@ class SDK {
|
|
|
65
64
|
* @param config The configuration object where the SDK and editor can get configured
|
|
66
65
|
*/
|
|
67
66
|
constructor(config) {
|
|
68
|
-
var _a;
|
|
67
|
+
var _a, _b;
|
|
69
68
|
this.localConfig = /* @__PURE__ */ new Map();
|
|
70
69
|
this.dataItemMappingTools = new DataItemMappingTools.DataItemMappingTools();
|
|
71
70
|
this.methodListeners = new MethodInstrumentation.MethodListenerRegistry();
|
|
71
|
+
this.teardownFrame = null;
|
|
72
72
|
this.loadEditor = () => {
|
|
73
|
-
var _a2;
|
|
74
|
-
|
|
73
|
+
var _a2, _b2, _c;
|
|
74
|
+
(_a2 = this.teardownFrame) == null ? void 0 : _a2.call(this);
|
|
75
|
+
this.teardownFrame = Connector.default(
|
|
75
76
|
this.config.editorLink || FIXED_EDITOR_LINK,
|
|
76
77
|
{
|
|
77
78
|
onActionsChanged: this.subscriber.onActionsChanged,
|
|
@@ -143,11 +144,11 @@ class SDK {
|
|
|
143
144
|
this.config.editorId,
|
|
144
145
|
this.config.studioStyling,
|
|
145
146
|
(error) => {
|
|
146
|
-
var _a3,
|
|
147
|
-
(
|
|
147
|
+
var _a3, _b3;
|
|
148
|
+
(_b3 = (_a3 = this.config).onConnectionError) == null ? void 0 : _b3.call(_a3, error);
|
|
148
149
|
}
|
|
149
150
|
);
|
|
150
|
-
this.editorAPI = connection == null ? void 0 :
|
|
151
|
+
this.editorAPI = (_b2 = this.connection) == null ? void 0 : _b2.promise.then((editorAPI) => {
|
|
151
152
|
return editorAPI;
|
|
152
153
|
});
|
|
153
154
|
this.action = this.toInstrumented(new ActionController.ActionController(this.editorAPI));
|
|
@@ -171,7 +172,9 @@ class SDK {
|
|
|
171
172
|
this.mediaConnector = this.toInstrumented(new MediaConnectorController.MediaConnectorController(this.editorAPI));
|
|
172
173
|
this.fontConnector = this.toInstrumented(new FontConnectorController.FontConnectorController(this.editorAPI));
|
|
173
174
|
this.componentConnector = this.toInstrumented(new ComponentConnectorController.ComponentConnectorController(this.editorAPI));
|
|
174
|
-
this.dataConnector = this.toInstrumented(
|
|
175
|
+
this.dataConnector = this.toInstrumented(
|
|
176
|
+
new DataConnectorController.DataConnectorController(this.editorAPI, this.dataItemMappingTools)
|
|
177
|
+
);
|
|
175
178
|
this.dataSource = this.toInstrumented(new DataSourceController.DataSourceController(this.editorAPI, this.dataItemMappingTools));
|
|
176
179
|
this.connector = this.toInstrumented(new ConnectorController.ConnectorController(this.editorAPI, this.localConfig));
|
|
177
180
|
this.variable = this.toInstrumented(new VariableController.VariableController(this.editorAPI, this.dataItemMappingTools));
|
|
@@ -194,11 +197,20 @@ class SDK {
|
|
|
194
197
|
this.configuration.updateStudioOptions(this.config.studioOptions || ConfigurationTypes.defaultStudioOptions);
|
|
195
198
|
this.configuration.setValue(
|
|
196
199
|
ConfigurationTypes.WellKnownConfigurationKeys.QueryCallCacheEnabled,
|
|
197
|
-
((
|
|
200
|
+
((_c = this.config.enableQueryCallCache) == null ? void 0 : _c.toString()) || "false"
|
|
198
201
|
);
|
|
199
202
|
};
|
|
200
203
|
this.setConnection = (newConnection) => {
|
|
201
|
-
connection = newConnection;
|
|
204
|
+
this.connection = newConnection;
|
|
205
|
+
};
|
|
206
|
+
this.destroy = () => {
|
|
207
|
+
var _a2, _b2;
|
|
208
|
+
try {
|
|
209
|
+
(_a2 = this.connection) == null ? void 0 : _a2.destroy();
|
|
210
|
+
} catch {
|
|
211
|
+
}
|
|
212
|
+
(_b2 = this.teardownFrame) == null ? void 0 : _b2.call(this);
|
|
213
|
+
this.teardownFrame = null;
|
|
202
214
|
};
|
|
203
215
|
this.toInstrumented = (controller) => {
|
|
204
216
|
markForInstrumentation(controller);
|
|
@@ -222,8 +234,7 @@ class SDK {
|
|
|
222
234
|
};
|
|
223
235
|
this.config = ConfigHelper.ConfigHelper.createRuntimeConfig(config);
|
|
224
236
|
this.sdkEvents = new SdkEvents.SdkEvents((_a = this.config.logging) == null ? void 0 : _a.logger);
|
|
225
|
-
this.
|
|
226
|
-
this.editorAPI = connection == null ? void 0 : connection.promise.then((child) => {
|
|
237
|
+
this.editorAPI = (_b = this.connection) == null ? void 0 : _b.promise.then((child) => {
|
|
227
238
|
return child;
|
|
228
239
|
});
|
|
229
240
|
this.action = this.toInstrumented(new ActionController.ActionController(this.editorAPI));
|
|
@@ -237,7 +248,9 @@ class SDK {
|
|
|
237
248
|
this.mediaConnector = this.toInstrumented(new MediaConnectorController.MediaConnectorController(this.editorAPI));
|
|
238
249
|
this.fontConnector = this.toInstrumented(new FontConnectorController.FontConnectorController(this.editorAPI));
|
|
239
250
|
this.componentConnector = this.toInstrumented(new ComponentConnectorController.ComponentConnectorController(this.editorAPI));
|
|
240
|
-
this.dataConnector = this.toInstrumented(
|
|
251
|
+
this.dataConnector = this.toInstrumented(
|
|
252
|
+
new DataConnectorController.DataConnectorController(this.editorAPI, this.dataItemMappingTools)
|
|
253
|
+
);
|
|
241
254
|
this.dataSource = this.toInstrumented(new DataSourceController.DataSourceController(this.editorAPI, this.dataItemMappingTools));
|
|
242
255
|
this.animation = this.toInstrumented(new AnimationController.AnimationController(this.editorAPI));
|
|
243
256
|
this.document = this.toInstrumented(new DocumentController.DocumentController(this.editorAPI));
|
package/lib/src/sdk.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sdk.cjs.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":["engineInfo","DataItemMappingTools","MethodListenerRegistry","Connect","_a","ActionController","LayoutController","FrameController","BarcodeController","ComponentController","AnimationController","DocumentController","LocalConfigurationDecorator","UtilsController","ToolController","PageController","DebugController","UndoManagerController","TextStyleController","ColorStyleController","GradientStyleController","ParagraphStyleController","CharacterStyleController","MediaConnectorController","FontConnectorController","ComponentConnectorController","DataConnectorController","DataSourceController","ConnectorController","VariableController","FontController","ExperimentController","CanvasController","ShapeController","ColorConversionController","InfoController","ClipboardController","BrandKitController","ComponentGridController","NextInitiator","WellKnownConfigurationKeys","packageInfo","DocumentType","defaultStudioOptions","wrapWithInvocationObserver","ConfigHelper","SdkEvents","SubscriberController"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,gBAA2D;AACjE,MAAM,oBAAoB,WAAW,aAAa,WAAWA,aAAAA,QAAW,OAAO;AAE/E,IAAI;AAMJ,MAAM,0BAA0B,OAAO,wBAAwB;AAE/D,MAAM,yBAAyB,CAAC,eAA6B;AACz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CAAC;AAEpF,SAAK,2BAAA;AAAA,EACT;AAiLJ;;"}
|
|
1
|
+
{"version":3,"file":"sdk.cjs.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":["engineInfo","DataItemMappingTools","MethodListenerRegistry","_a","Connect","_b","ActionController","LayoutController","FrameController","BarcodeController","ComponentController","AnimationController","DocumentController","LocalConfigurationDecorator","UtilsController","ToolController","PageController","DebugController","UndoManagerController","TextStyleController","ColorStyleController","GradientStyleController","ParagraphStyleController","CharacterStyleController","MediaConnectorController","FontConnectorController","ComponentConnectorController","DataConnectorController","DataSourceController","ConnectorController","VariableController","FontController","ExperimentController","CanvasController","ShapeController","ColorConversionController","InfoController","ClipboardController","BrandKitController","ComponentGridController","NextInitiator","WellKnownConfigurationKeys","packageInfo","DocumentType","defaultStudioOptions","wrapWithInvocationObserver","ConfigHelper","SdkEvents","SubscriberController"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsDA,MAAM,gBAA2D;AACjE,MAAM,oBAAoB,WAAW,aAAa,WAAWA,aAAAA,QAAW,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,IAAIC,0CAAA;AACnC,SAAQ,kBAAkB,IAAIC,6CAAA;AAE9B,SAAQ,gBAAqC;AAiE7C,SAAA,aAAa,MAAM;;AAIf,OAAAC,MAAA,KAAK,kBAAL,gBAAAA,IAAA;AACA,WAAK,gBAAgBC,UAAAA;AAAAA,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,UAC7C,wBAAwB,KAAK,WAAW;AAAA,UACxC,2BAA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