@chili-publish/studio-sdk 1.6.2 → 1.8.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 +1 -1
- package/_bundles/main.js.map +1 -1
- package/_bundles/report.html +2 -2
- package/lib/editor-engine.json +1 -1
- package/lib/package.json +1 -1
- package/lib/src/controllers/BarcodeController.d.ts +114 -0
- package/lib/src/controllers/BarcodeController.js +245 -0
- package/lib/src/controllers/BarcodeController.js.map +1 -0
- package/lib/src/controllers/ClipboardController.js.map +1 -1
- package/lib/src/controllers/ConnectorController.d.ts +0 -9
- package/lib/src/controllers/ConnectorController.js +0 -13
- package/lib/src/controllers/ConnectorController.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +16 -2
- package/lib/src/controllers/FrameController.js +15 -2
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/LayoutController.d.ts +51 -1
- package/lib/src/controllers/LayoutController.js +77 -0
- package/lib/src/controllers/LayoutController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.d.ts +20 -0
- package/lib/src/controllers/SubscriberController.js +60 -5
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/ToolController.d.ts +14 -8
- package/lib/src/controllers/ToolController.js +16 -8
- package/lib/src/controllers/ToolController.js.map +1 -1
- package/lib/src/controllers/VariableController.d.ts +3 -0
- package/lib/src/controllers/VariableController.js +54 -4
- package/lib/src/controllers/VariableController.js.map +1 -1
- package/lib/src/index.d.ts +7 -5
- package/lib/src/index.js +3 -2
- package/lib/src/index.js.map +1 -1
- package/lib/src/interactions/connector.d.ts +3 -0
- package/lib/src/interactions/connector.js +3 -0
- package/lib/src/interactions/connector.js.map +1 -1
- package/lib/src/sdk.d.ts +3 -0
- package/lib/src/sdk.js +6 -0
- package/lib/src/sdk.js.map +1 -1
- package/lib/src/tests/__mocks__/config.js +1 -0
- package/lib/src/tests/__mocks__/config.js.map +1 -1
- package/lib/src/tests/controllers/BarcodeController.test.d.ts +1 -0
- package/lib/src/tests/controllers/BarcodeController.test.js +252 -0
- package/lib/src/tests/controllers/BarcodeController.test.js.map +1 -0
- package/lib/src/tests/controllers/ClipboardController.test.js +0 -1
- package/lib/src/tests/controllers/ClipboardController.test.js.map +1 -1
- package/lib/src/tests/controllers/ConnectorController.test.js +0 -6
- package/lib/src/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/FrameController.test.js +8 -2
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/LayoutController.test.js +92 -1
- package/lib/src/tests/controllers/LayoutController.test.js.map +1 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.js +48 -4
- package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/tests/controllers/VariableController.test.js +24 -5
- package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/types/BarcodeTypes.d.ts +74 -0
- package/lib/src/types/BarcodeTypes.js +39 -0
- package/lib/src/types/BarcodeTypes.js.map +1 -0
- package/lib/src/types/CommonTypes.d.ts +8 -2
- package/lib/src/types/CommonTypes.js.map +1 -1
- package/lib/src/types/FrameTypes.d.ts +43 -2
- package/lib/src/types/FrameTypes.js +6 -0
- package/lib/src/types/FrameTypes.js.map +1 -1
- package/lib/src/types/LayoutTypes.d.ts +24 -0
- package/lib/src/types/LayoutTypes.js +7 -0
- package/lib/src/types/LayoutTypes.js.map +1 -1
- package/lib/src/types/VariableTypes.d.ts +4 -0
- package/lib/src/types/ViewportTypes.d.ts +11 -0
- package/lib/src/types/ViewportTypes.js +2 -0
- package/lib/src/types/ViewportTypes.js.map +1 -0
- package/lib/src/utils/enums.d.ts +7 -2
- package/lib/src/utils/enums.js +6 -1
- package/lib/src/utils/enums.js.map +1 -1
- package/package.json +2 -2
package/_bundles/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","mappings":"CAAA,SAA2CA,K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ACR,+BACA,+BACA,oBACH,CAJD,CAAYA,OAAAA,KAAI,KAKhB,SAAYC,WACR,oCACA,gCACA,yBACH,CAJD,CAAYA,YAAAA,UAAS,KA6ErB,SAAYC,iBACR,4BACA,gCACA,8BACA,iCACH,CALD,CAAYA,kBAAAA,gBAAe,KAO3B,SAAYC,2BACR,4CACA,sDACA,iDACH,CAJD,CAAYA,4BAAAA,0BAAyB,KAMrC,SAAYC,oBACR,gDACA,gDACA,yCACA,0CACA,wCACA,kDACA,4CACA,0CACA,kDACA,sDACA,qDACA,yCACA,8CACA,0CACA,iCACA,yDACA,8CACA,uDACA,0CACA,qCACA,kDACA,sDACH,CAvBD,CAAYA,qBAAAA,mBAAkB,KCjH9B,SAAYC,WACR,oBACA,oBACA,sBACA,sBACA,oBACA,qBACH,CAPD,CAAYA,YAAAA,UAAS,KAgGrB,SAAYC,gBAIR,6BAIA,kCACH,CATD,CAAYA,iBAAAA,eAAc,KChG1B,SAAYC,mBACR,kCACA,6BACH,CAHD,CAAYA,oBAAAA,kBAAiB,KCG7B,SAAYC,mBAIR,gEAMA,0CAKA,oDAMA,kDAKA,6DACH,CA3BD,CAAYA,oBAAAA,kBAAiB,KCH7B,SAAYC,WACR,4BACA,gCACA,2BACH,CAJD,CAAYA,YAAAA,UAAS,KAwCrB,SAAYC,kBACR,2BACA,6BACA,4BACH,CAJD,CAAYA,mBAAAA,iBAAgB,KC2E5B,c","sources":["webpack://ChiliEditorSDK/webpack/universalModuleDefinition","webpack://ChiliEditorSDK/webpack/bootstrap","webpack://ChiliEditorSDK/./node_modules/penpal/lib/enums.js","webpack://ChiliEditorSDK/webpack/runtime/define property getters","webpack://ChiliEditorSDK/webpack/runtime/hasOwnProperty shorthand","webpack://ChiliEditorSDK/webpack/runtime/make namespace object","webpack://ChiliEditorSDK/./node_modules/penpal/lib/createDestructor.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/parent/getOriginFromSrc.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/errorSerialization.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/generateId.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/methodSerialization.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/connectCallSender.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/parent/handleAckMessageFactory.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/connectCallReceiver.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/parent/connectToChild.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/createLogger.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/parent/validateIframeHasSrcOrSrcDoc.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/parent/handleSynMessageFactory.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/startConnectionTimeout.js","webpack://ChiliEditorSDK/./node_modules/penpal/lib/parent/monitorIframeRemoval.js","webpack://ChiliEditorSDK/./src/interactions/connector.ts","webpack://ChiliEditorSDK/./src/types/ConfigurationTypes.ts","webpack://ChiliEditorSDK/./src/types/DocumentTypes.ts","webpack://ChiliEditorSDK/./src/utils/EditorResponseData.ts","webpack://ChiliEditorSDK/./src/controllers/ActionController.ts","webpack://ChiliEditorSDK/./src/controllers/AnimationController.ts","webpack://ChiliEditorSDK/./src/controllers/CanvasController.ts","webpack://ChiliEditorSDK/./src/controllers/CharacterStyleController.ts","webpack://ChiliEditorSDK/./src/controllers/ColorStyleController.ts","webpack://ChiliEditorSDK/./src/controllers/ColorConversionController.ts","webpack://ChiliEditorSDK/./src/types/ConnectorTypes.ts","webpack://ChiliEditorSDK/./src/controllers/ConfigurationController.ts","webpack://ChiliEditorSDK/./src/controllers/ConnectorController.ts","webpack://ChiliEditorSDK/./src/controllers/DebugController.ts","webpack://ChiliEditorSDK/./src/types/FrameTypes.ts","webpack://ChiliEditorSDK/./src/controllers/DocumentController.ts","webpack://ChiliEditorSDK/./src/controllers/ExperimentController.ts","webpack://ChiliEditorSDK/./src/controllers/FontConnectorController.ts","webpack://ChiliEditorSDK/./src/controllers/FontController.ts","webpack://ChiliEditorSDK/./src/controllers/ShapeController.ts","webpack://ChiliEditorSDK/./src/controllers/FrameController.ts","webpack://ChiliEditorSDK/./src/types/MediaConnectorTypes.ts","webpack://ChiliEditorSDK/./src/controllers/LayoutController.ts","webpack://ChiliEditorSDK/./src/controllers/MediaConnectorController.ts","webpack://ChiliEditorSDK/./src/controllers/PageController.ts","webpack://ChiliEditorSDK/./src/controllers/ParagraphStyleController.ts","webpack://ChiliEditorSDK/./src/controllers/SubscriberController.ts","webpack://ChiliEditorSDK/./src/utils/enums.ts","webpack://ChiliEditorSDK/./src/controllers/TextStyleController.ts","webpack://ChiliEditorSDK/./src/controllers/ToolController.ts","webpack://ChiliEditorSDK/./src/controllers/UndoManagerController.ts","webpack://ChiliEditorSDK/./src/utils/MathUtils.ts","webpack://ChiliEditorSDK/./src/controllers/UtilsController.ts","webpack://ChiliEditorSDK/./src/controllers/VariableController.ts","webpack://ChiliEditorSDK/./src/controllers/InfoController.ts","webpack://ChiliEditorSDK/./src/controllers/ClipboardController.ts","webpack://ChiliEditorSDK/./src/sdk.ts","webpack://ChiliEditorSDK/./src/types/AnimationTypes.ts","webpack://ChiliEditorSDK/./src/types/LayoutTypes.ts","webpack://ChiliEditorSDK/./src/types/ViewModeTypes.ts","webpack://ChiliEditorSDK/./src/types/VariableTypes.ts","webpack://ChiliEditorSDK/./src/types/TextStyleTypes.ts","webpack://ChiliEditorSDK/./src/types/ColorStyleTypes.ts","webpack://ChiliEditorSDK/./src/types/FontConnectorTypes.ts","webpack://ChiliEditorSDK/./src/types/ActionTypes.ts","webpack://ChiliEditorSDK/./src/types/ShapeTypes.ts","webpack://ChiliEditorSDK/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"ChiliEditorSDK\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ChiliEditorSDK\"] = factory();\n\telse\n\t\troot[\"ChiliEditorSDK\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","export var MessageType;\n(function (MessageType) {\n MessageType[\"Call\"] = \"call\";\n MessageType[\"Reply\"] = \"reply\";\n MessageType[\"Syn\"] = \"syn\";\n MessageType[\"SynAck\"] = \"synAck\";\n MessageType[\"Ack\"] = \"ack\";\n})(MessageType || (MessageType = {}));\nexport var Resolution;\n(function (Resolution) {\n Resolution[\"Fulfilled\"] = \"fulfilled\";\n Resolution[\"Rejected\"] = \"rejected\";\n})(Resolution || (Resolution = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ErrorCode[\"ConnectionDestroyed\"] = \"ConnectionDestroyed\";\n ErrorCode[\"ConnectionTimeout\"] = \"ConnectionTimeout\";\n ErrorCode[\"NoIframeSrc\"] = \"NoIframeSrc\";\n})(ErrorCode || (ErrorCode = {}));\nexport var NativeErrorName;\n(function (NativeErrorName) {\n NativeErrorName[\"DataCloneError\"] = \"DataCloneError\";\n})(NativeErrorName || (NativeErrorName = {}));\nexport var NativeEventType;\n(function (NativeEventType) {\n NativeEventType[\"Message\"] = \"message\";\n})(NativeEventType || (NativeEventType = {}));\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default (localName, log) => {\n const callbacks = [];\n let destroyed = false;\n return {\n destroy(error) {\n if (!destroyed) {\n destroyed = true;\n log(`${localName}: Destroying connection`);\n callbacks.forEach((callback) => {\n callback(error);\n });\n }\n },\n onDestroy(callback) {\n destroyed ? callback() : callbacks.push(callback);\n },\n };\n};\n","const DEFAULT_PORT_BY_PROTOCOL = {\n 'http:': '80',\n 'https:': '443',\n};\nconst URL_REGEX = /^(https?:)?\\/\\/([^/:]+)?(:(\\d+))?/;\nconst opaqueOriginSchemes = ['file:', 'data:'];\n/**\n * Converts a src value into an origin.\n */\nexport default (src) => {\n if (src && opaqueOriginSchemes.find((scheme) => src.startsWith(scheme))) {\n // The origin of the child document is an opaque origin and its\n // serialization is \"null\"\n // https://html.spec.whatwg.org/multipage/origin.html#origin\n return 'null';\n }\n // Note that if src is undefined, then srcdoc is being used instead of src\n // and we can follow this same logic below to get the origin of the parent,\n // which is the origin that we will need to use.\n const location = document.location;\n const regexResult = URL_REGEX.exec(src);\n let protocol;\n let hostname;\n let port;\n if (regexResult) {\n // It's an absolute URL. Use the parsed info.\n // regexResult[1] will be undefined if the URL starts with //\n protocol = regexResult[1] ? regexResult[1] : location.protocol;\n hostname = regexResult[2];\n port = regexResult[4];\n }\n else {\n // It's a relative path. Use the current location's info.\n protocol = location.protocol;\n hostname = location.hostname;\n port = location.port;\n }\n // If the port is the default for the protocol, we don't want to add it to the origin string\n // or it won't match the message's event.origin.\n const portSuffix = port && port !== DEFAULT_PORT_BY_PROTOCOL[protocol] ? `:${port}` : '';\n return `${protocol}//${hostname}${portSuffix}`;\n};\n","/**\n * Converts an error object into a plain object.\n */\nexport const serializeError = ({ name, message, stack, }) => ({\n name,\n message,\n stack,\n});\n/**\n * Converts a plain object into an error object.\n */\nexport const deserializeError = (obj) => {\n const deserializedError = new Error();\n // @ts-ignore\n Object.keys(obj).forEach((key) => (deserializedError[key] = obj[key]));\n return deserializedError;\n};\n","let id = 0;\n/**\n * @return {number} A unique ID (not universally unique)\n */\nexport default () => ++id;\n","const KEY_PATH_DELIMITER = '.';\nconst keyPathToSegments = (keyPath) => keyPath ? keyPath.split(KEY_PATH_DELIMITER) : [];\nconst segmentsToKeyPath = (segments) => segments.join(KEY_PATH_DELIMITER);\nconst createKeyPath = (key, prefix) => {\n const segments = keyPathToSegments(prefix || '');\n segments.push(key);\n return segmentsToKeyPath(segments);\n};\n/**\n * Given a `keyPath`, set it to be `value` on `subject`, creating any intermediate\n * objects along the way.\n *\n * @param {Object} subject The object on which to set value.\n * @param {string} keyPath The key path at which to set value.\n * @param {Object} value The value to store at the given key path.\n * @returns {Object} Updated subject.\n */\nexport const setAtKeyPath = (subject, keyPath, value) => {\n const segments = keyPathToSegments(keyPath);\n segments.reduce((prevSubject, key, idx) => {\n if (typeof prevSubject[key] === 'undefined') {\n prevSubject[key] = {};\n }\n if (idx === segments.length - 1) {\n prevSubject[key] = value;\n }\n return prevSubject[key];\n }, subject);\n return subject;\n};\n/**\n * Given a dictionary of (nested) keys to function, flatten them to a map\n * from key path to function.\n *\n * @param {Object} methods The (potentially nested) object to serialize.\n * @param {string} prefix A string with which to prefix entries. Typically not intended to be used by consumers.\n * @returns {Object} An map from key path in `methods` to functions.\n */\nexport const serializeMethods = (methods, prefix) => {\n const flattenedMethods = {};\n Object.keys(methods).forEach((key) => {\n const value = methods[key];\n const keyPath = createKeyPath(key, prefix);\n if (typeof value === 'object') {\n // Recurse into any nested children.\n Object.assign(flattenedMethods, serializeMethods(value, keyPath));\n }\n if (typeof value === 'function') {\n // If we've found a method, expose it.\n flattenedMethods[keyPath] = value;\n }\n });\n return flattenedMethods;\n};\n/**\n * Given a map of key paths to functions, unpack the key paths to an object.\n *\n * @param {Object} flattenedMethods A map of key paths to functions to unpack.\n * @returns {Object} A (potentially nested) map of functions.\n */\nexport const deserializeMethods = (flattenedMethods) => {\n const methods = {};\n for (const keyPath in flattenedMethods) {\n setAtKeyPath(methods, keyPath, flattenedMethods[keyPath]);\n }\n return methods;\n};\n","import generateId from './generateId';\nimport { deserializeError } from './errorSerialization';\nimport { deserializeMethods } from './methodSerialization';\nimport { ErrorCode, MessageType, NativeEventType, Resolution } from './enums';\n/**\n * Augments an object with methods that match those defined by the remote. When these methods are\n * called, a \"call\" message will be sent to the remote, the remote's corresponding method will be\n * executed, and the method's return value will be returned via a message.\n * @param {Object} callSender Sender object that should be augmented with methods.\n * @param {Object} info Information about the local and remote windows.\n * @param {Array} methodKeyPaths Key paths of methods available to be called on the remote.\n * @param {Promise} destructionPromise A promise resolved when destroy() is called on the penpal\n * connection.\n * @returns {Object} The call sender object with methods that may be called.\n */\nexport default (callSender, info, methodKeyPaths, destroyConnection, log) => {\n const { localName, local, remote, originForSending, originForReceiving, } = info;\n let destroyed = false;\n log(`${localName}: Connecting call sender`);\n const createMethodProxy = (methodName) => {\n return (...args) => {\n log(`${localName}: Sending ${methodName}() call`);\n // This handles the case where the iframe has been removed from the DOM\n // (and therefore its window closed), the consumer has not yet\n // called destroy(), and the user calls a method exposed by\n // the remote. We detect the iframe has been removed and force\n // a destroy() immediately so that the consumer sees the error saying\n // the connection has been destroyed. We wrap this check in a try catch\n // because Edge throws an \"Object expected\" error when accessing\n // contentWindow.closed on a contentWindow from an iframe that's been\n // removed from the DOM.\n let iframeRemoved;\n try {\n if (remote.closed) {\n iframeRemoved = true;\n }\n }\n catch (e) {\n iframeRemoved = true;\n }\n if (iframeRemoved) {\n destroyConnection();\n }\n if (destroyed) {\n const error = new Error(`Unable to send ${methodName}() call due ` + `to destroyed connection`);\n error.code = ErrorCode.ConnectionDestroyed;\n throw error;\n }\n return new Promise((resolve, reject) => {\n const id = generateId();\n const handleMessageEvent = (event) => {\n if (event.source !== remote ||\n event.data.penpal !== MessageType.Reply ||\n event.data.id !== id) {\n return;\n }\n if (event.origin !== originForReceiving) {\n log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);\n return;\n }\n const replyMessage = event.data;\n log(`${localName}: Received ${methodName}() reply`);\n local.removeEventListener(NativeEventType.Message, handleMessageEvent);\n let returnValue = replyMessage.returnValue;\n if (replyMessage.returnValueIsError) {\n returnValue = deserializeError(returnValue);\n }\n (replyMessage.resolution === Resolution.Fulfilled ? resolve : reject)(returnValue);\n };\n local.addEventListener(NativeEventType.Message, handleMessageEvent);\n const callMessage = {\n penpal: MessageType.Call,\n id,\n methodName,\n args,\n };\n remote.postMessage(callMessage, originForSending);\n });\n };\n };\n // Wrap each method in a proxy which sends it to the corresponding receiver.\n const flattenedMethods = methodKeyPaths.reduce((api, name) => {\n api[name] = createMethodProxy(name);\n return api;\n }, {});\n // Unpack the structure of the provided methods object onto the CallSender, exposing\n // the methods in the same shape they were provided.\n Object.assign(callSender, deserializeMethods(flattenedMethods));\n return () => {\n destroyed = true;\n };\n};\n","import connectCallReceiver from '../connectCallReceiver';\nimport connectCallSender from '../connectCallSender';\n/**\n * Handles an ACK handshake message.\n */\nexport default (serializedMethods, childOrigin, originForSending, destructor, log) => {\n const { destroy, onDestroy } = destructor;\n let destroyCallReceiver;\n let receiverMethodNames;\n // We resolve the promise with the call sender. If the child reconnects\n // (for example, after refreshing or navigating to another page that\n // uses Penpal, we'll update the call sender with methods that match the\n // latest provided by the child.\n const callSender = {};\n return (event) => {\n if (event.origin !== childOrigin) {\n log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);\n return;\n }\n log('Parent: Handshake - Received ACK');\n const info = {\n localName: 'Parent',\n local: window,\n remote: event.source,\n originForSending: originForSending,\n originForReceiving: childOrigin,\n };\n // If the child reconnected, we need to destroy the prior call receiver\n // before setting up a new one.\n if (destroyCallReceiver) {\n destroyCallReceiver();\n }\n destroyCallReceiver = connectCallReceiver(info, serializedMethods, log);\n onDestroy(destroyCallReceiver);\n // If the child reconnected, we need to remove the methods from the\n // previous call receiver off the sender.\n if (receiverMethodNames) {\n receiverMethodNames.forEach((receiverMethodName) => {\n delete callSender[receiverMethodName];\n });\n }\n receiverMethodNames = event.data.methodNames;\n const destroyCallSender = connectCallSender(callSender, info, receiverMethodNames, destroy, log);\n onDestroy(destroyCallSender);\n return callSender;\n };\n};\n","import { serializeError } from './errorSerialization';\nimport { MessageType, NativeEventType, NativeErrorName, Resolution, } from './enums';\n/**\n * Listens for \"call\" messages coming from the remote, executes the corresponding method, and\n * responds with the return value.\n */\nexport default (info, serializedMethods, log) => {\n const { localName, local, remote, originForSending, originForReceiving, } = info;\n let destroyed = false;\n const handleMessageEvent = (event) => {\n if (event.source !== remote || event.data.penpal !== MessageType.Call) {\n return;\n }\n if (event.origin !== originForReceiving) {\n log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);\n return;\n }\n const callMessage = event.data;\n const { methodName, args, id } = callMessage;\n log(`${localName}: Received ${methodName}() call`);\n const createPromiseHandler = (resolution) => {\n return (returnValue) => {\n log(`${localName}: Sending ${methodName}() reply`);\n if (destroyed) {\n // It's possible to throw an error here, but it would need to be thrown asynchronously\n // and would only be catchable using window.onerror. This is because the consumer\n // is merely returning a value from their method and not calling any function\n // that they could wrap in a try-catch. Even if the consumer were to catch the error,\n // the value of doing so is questionable. Instead, we'll just log a message.\n log(`${localName}: Unable to send ${methodName}() reply due to destroyed connection`);\n return;\n }\n const message = {\n penpal: MessageType.Reply,\n id,\n resolution,\n returnValue,\n };\n if (resolution === Resolution.Rejected &&\n returnValue instanceof Error) {\n message.returnValue = serializeError(returnValue);\n message.returnValueIsError = true;\n }\n try {\n remote.postMessage(message, originForSending);\n }\n catch (err) {\n // If a consumer attempts to send an object that's not cloneable (e.g., window),\n // we want to ensure the receiver's promise gets rejected.\n if (err.name === NativeErrorName.DataCloneError) {\n const errorReplyMessage = {\n penpal: MessageType.Reply,\n id,\n resolution: Resolution.Rejected,\n returnValue: serializeError(err),\n returnValueIsError: true,\n };\n remote.postMessage(errorReplyMessage, originForSending);\n }\n throw err;\n }\n };\n };\n new Promise((resolve) => resolve(serializedMethods[methodName].apply(serializedMethods, args))).then(createPromiseHandler(Resolution.Fulfilled), createPromiseHandler(Resolution.Rejected));\n };\n local.addEventListener(NativeEventType.Message, handleMessageEvent);\n return () => {\n destroyed = true;\n local.removeEventListener(NativeEventType.Message, handleMessageEvent);\n };\n};\n","import { MessageType, NativeEventType } from '../enums';\nimport createDestructor from '../createDestructor';\nimport createLogger from '../createLogger';\nimport getOriginFromSrc from './getOriginFromSrc';\nimport handleAckMessageFactory from './handleAckMessageFactory';\nimport handleSynMessageFactory from './handleSynMessageFactory';\nimport { serializeMethods } from '../methodSerialization';\nimport monitorIframeRemoval from './monitorIframeRemoval';\nimport startConnectionTimeout from '../startConnectionTimeout';\nimport validateIframeHasSrcOrSrcDoc from './validateIframeHasSrcOrSrcDoc';\n/**\n * Attempts to establish communication with an iframe.\n */\nexport default (options) => {\n let { iframe, methods = {}, childOrigin, timeout, debug = false } = options;\n const log = createLogger(debug);\n const destructor = createDestructor('Parent', log);\n const { onDestroy, destroy } = destructor;\n if (!childOrigin) {\n validateIframeHasSrcOrSrcDoc(iframe);\n childOrigin = getOriginFromSrc(iframe.src);\n }\n // If event.origin is \"null\", the remote protocol is file: or data: and we\n // must post messages with \"*\" as targetOrigin when sending messages.\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#Using_window.postMessage_in_extensions\n const originForSending = childOrigin === 'null' ? '*' : childOrigin;\n const serializedMethods = serializeMethods(methods);\n const handleSynMessage = handleSynMessageFactory(log, serializedMethods, childOrigin, originForSending);\n const handleAckMessage = handleAckMessageFactory(serializedMethods, childOrigin, originForSending, destructor, log);\n const promise = new Promise((resolve, reject) => {\n const stopConnectionTimeout = startConnectionTimeout(timeout, destroy);\n const handleMessage = (event) => {\n if (event.source !== iframe.contentWindow || !event.data) {\n return;\n }\n if (event.data.penpal === MessageType.Syn) {\n handleSynMessage(event);\n return;\n }\n if (event.data.penpal === MessageType.Ack) {\n const callSender = handleAckMessage(event);\n if (callSender) {\n stopConnectionTimeout();\n resolve(callSender);\n }\n return;\n }\n };\n window.addEventListener(NativeEventType.Message, handleMessage);\n log('Parent: Awaiting handshake');\n monitorIframeRemoval(iframe, destructor);\n onDestroy((error) => {\n window.removeEventListener(NativeEventType.Message, handleMessage);\n if (error) {\n reject(error);\n }\n });\n });\n return {\n promise,\n destroy() {\n // Don't allow consumer to pass an error into destroy.\n destroy();\n },\n };\n};\n","export default (debug) => {\n /**\n * Logs a message if debug is enabled.\n */\n return (...args) => {\n if (debug) {\n console.log('[Penpal]', ...args); // eslint-disable-line no-console\n }\n };\n};\n","import { ErrorCode } from '../enums';\nexport default (iframe) => {\n if (!iframe.src && !iframe.srcdoc) {\n const error = new Error('Iframe must have src or srcdoc property defined.');\n error.code = ErrorCode.NoIframeSrc;\n throw error;\n }\n};\n","import { MessageType } from '../enums';\n/**\n * Handles a SYN handshake message.\n */\nexport default (log, serializedMethods, childOrigin, originForSending) => {\n return (event) => {\n if (event.origin !== childOrigin) {\n log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);\n return;\n }\n log('Parent: Handshake - Received SYN, responding with SYN-ACK');\n const synAckMessage = {\n penpal: MessageType.SynAck,\n methodNames: Object.keys(serializedMethods),\n };\n event.source.postMessage(synAckMessage, originForSending);\n };\n};\n","import { ErrorCode } from './enums';\n/**\n * Starts a timeout and calls the callback with an error\n * if the timeout completes before the stop function is called.\n */\nexport default (timeout, callback) => {\n let timeoutId;\n if (timeout !== undefined) {\n timeoutId = window.setTimeout(() => {\n const error = new Error(`Connection timed out after ${timeout}ms`);\n error.code = ErrorCode.ConnectionTimeout;\n callback(error);\n }, timeout);\n }\n return () => {\n clearTimeout(timeoutId);\n };\n};\n","const CHECK_IFRAME_IN_DOC_INTERVAL = 60000;\n/**\n * Monitors for iframe removal and destroys connection if iframe\n * is found to have been removed from DOM. This is to prevent memory\n * leaks when the iframe is removed from the document and the consumer\n * hasn't called destroy(). Without this, event listeners attached to\n * the window would stick around and since the event handlers have a\n * reference to the iframe in their closures, the iframe would stick\n * around too.\n */\nexport default (iframe, destructor) => {\n const { destroy, onDestroy } = destructor;\n const checkIframeInDocIntervalId = setInterval(() => {\n if (!iframe.isConnected) {\n clearInterval(checkIframeInDocIntervalId);\n destroy();\n }\n }, CHECK_IFRAME_IN_DOC_INTERVAL);\n onDestroy(() => {\n clearInterval(checkIframeInDocIntervalId);\n });\n};\n","import { Connection, connectToChild } from 'penpal';\nimport { Id } from '../types/CommonTypes';\nimport { StudioStyling } from '../types/ConfigurationTypes';\n\nexport const validateEditorLink = (editorLink: string) => {\n const linkValidator = new RegExp(/^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w]+\\/$/);\n let link = '';\n if (linkValidator.test(editorLink)) {\n link = editorLink;\n } else if (editorLink.indexOf('/index.html') > -1) {\n link = editorLink.replace('/index.html', '/');\n } else if (editorLink.charAt(-1) !== '/') {\n link = `${editorLink}/`;\n }\n return link;\n};\n\nexport const setupFrame = (iframe: HTMLIFrameElement, editorLink: string, styling?: StudioStyling) => {\n const link = validateEditorLink(editorLink);\n const stylingJson = JSON.stringify(styling || {});\n const html = `<html>\n <head>\n <base href=\"/\" />\n <meta charset=\"UTF-8\"/>\n <!-- use this property to pass the StudioStyling to the engine -->\n <meta name=\"studio-styling\" content=${stylingJson}>\n </head>\n <body>\n <script src=\"${link}init.js\" async></script>\n <script src=\"${link}init_engine.js\"></script>\n <script>\n initializeStudioEngine({\n assetBase: '${link}',\n entryPointUrl: '${link}main.dart.js',\n });\n </script>\n </body>\n </html>\n `;\n\n // eslint-disable-next-line no-param-reassign\n iframe.srcdoc = 'placeholder';\n\n let iframeDoc: Document = iframe.ownerDocument;\n if (iframe.contentWindow) {\n iframeDoc = iframe.contentWindow.document;\n }\n iframeDoc.open();\n iframeDoc.write(html);\n iframeDoc.close();\n};\ninterface ConfigParameterTypes {\n onActionsChanged: (state: string) => void;\n onStateChanged: (state: string) => void;\n onAuthExpired: (authRefreshRequest: string) => Promise<string | null>;\n onDocumentLoaded: () => void;\n onSelectedFramesContentChanged: (state: string) => void;\n onSelectedFramesLayoutChanged: (state: string) => void;\n onSelectedLayoutPropertiesChanged: (state: string) => void;\n onSelectedLayoutUnitChanged: (state: string) => void;\n onPageSelectionChanged: () => void;\n onScrubberPositionChanged: (state: string) => void;\n onFrameAnimationsChanged: (state: string) => void;\n onVariableListChanged: (state: string) => void;\n onSelectedToolChanged: (state: string) => void;\n onUndoStateChanged: (state: string) => void;\n onSelectedLayoutFramesChanged: (state: string) => void;\n onSelectedTextStyleChanged: (styles: string) => void;\n onColorsChanged: (colors: string) => void;\n onParagraphStylesChanged: (paragraphStyles: string) => void;\n onCharacterStylesChanged: (characterStyles: string) => void;\n onFontFamiliesChanged: (fonts: string) => void;\n onSelectedLayoutIdChanged: (id: string) => void;\n onLayoutsChanged: (layouts: string) => void;\n onConnectorEvent: (state: string) => void;\n onZoomChanged: (scaleFactor: string) => void;\n onPageSizeChanged: (scaleFactor: string) => void;\n onShapeCornerRadiusChanged: (cornerRadius: string) => void;\n onCropActiveFrameIdChanged: (id?: Id) => void;\n onAsyncError: (asyncError: string) => void;\n onViewModeChanged: (viewMode: string) => void;\n}\n\nconst Connect = (\n editorLink: string,\n params: ConfigParameterTypes,\n setConnection: (connection: Connection) => void,\n editorId = 'chili-editor',\n styling?: StudioStyling,\n) => {\n const editorSelectorId = `#${editorId}`;\n const iframe = document.createElement('iframe');\n iframe.setAttribute('srcdoc', ' ');\n iframe.setAttribute('title', 'Chili-Editor');\n iframe.setAttribute('style', 'width: 100%; height: 100%;');\n iframe.setAttribute('frameBorder', '0');\n iframe.setAttribute('referrerpolicy', 'origin');\n\n const setupNewFrame = () => {\n const iframeContainer = document.querySelector(editorSelectorId);\n if (iframeContainer) {\n iframeContainer?.appendChild(iframe);\n setupFrame(iframe, editorLink, styling);\n }\n };\n\n if (document.readyState === 'complete' || document.readyState === 'interactive') {\n setupNewFrame();\n } else {\n document.addEventListener('DOMContentLoaded', () => {\n setupNewFrame();\n });\n }\n setConnection(\n connectToChild({\n // The iframe to which a connection should be made\n iframe,\n // All the methods that we want to expose to the child should be inside the methods object\n // f.e. stateChange(documentJson)\n methods: {\n actionsChanged: params.onActionsChanged,\n stateChanged: params.onStateChanged,\n documentLoaded: params.onDocumentLoaded,\n authExpired: params.onAuthExpired,\n selectedFramesContent: params.onSelectedFramesContentChanged,\n selectedFramesLayout: params.onSelectedFramesLayoutChanged,\n selectedLayoutProperties: params.onSelectedLayoutPropertiesChanged,\n openLayoutPropertiesPanel: params.onPageSelectionChanged,\n selectedLayoutUnit: params.onSelectedLayoutUnitChanged,\n scrubberPositionChanged: params.onScrubberPositionChanged,\n frameAnimationsChanged: params.onFrameAnimationsChanged,\n selectedToolChanged: params.onSelectedToolChanged,\n variableListChanged: params.onVariableListChanged,\n undoStackStateChanged: params.onUndoStateChanged,\n selectedLayoutFramesChanged: params.onSelectedLayoutFramesChanged,\n selectedTextStyleChanged: params.onSelectedTextStyleChanged,\n colorsChanged: params.onColorsChanged,\n paragraphStylesChanged: params.onParagraphStylesChanged,\n characterStylesChanged: params.onCharacterStylesChanged,\n fontFamiliesChanged: params.onFontFamiliesChanged,\n selectedLayoutId: params.onSelectedLayoutIdChanged,\n layoutListChanged: params.onLayoutsChanged,\n connectorEvent: params.onConnectorEvent,\n zoomChanged: params.onZoomChanged,\n pageSizeChanged: params.onPageSizeChanged,\n shapeCornerRadiusChanged: params.onShapeCornerRadiusChanged,\n cropActiveFrameIdChanged: params.onCropActiveFrameIdChanged,\n asyncError: params.onAsyncError,\n viewModeChanged: params.onViewModeChanged,\n },\n }),\n );\n};\nexport default Connect;\n","export enum WellKnownConfigurationKeys {\n GraFxStudioEnvironmentApiUrl = 'ENVIRONMENT_API',\n GraFxStudioSdkVersion = 'SDK_VERSION',\n GraFxStudioDocumentType = 'DOCUMENT_TYPE',\n GraFxStudioTemplateId = 'TEMPLATE_ID',\n GraFxStudioAuthToken = 'GRAFX_AUTH_TOKEN',\n}\n\nexport type StudioStyling = {\n uiBackgroundColorHex?: string;\n};\n\n/**\n * Studio Options that can be updated.\n */\nexport type StudioOptionsDeltaUpdate = {\n /** Options for the different studio engine shortcuts */\n shortcutOptions?: ShortcutOptionsDeltaUpdate;\n};\n\n/**\n * Shortcut Options that can be updated.\n */\nexport type ShortcutOptionsDeltaUpdate = {\n /** The debug panel shortcut. */\n debugPanel?: ShortcutOption;\n\n /** The ellipse shape shortcut. */\n ellipse?: ShortcutOption;\n\n /** The hand shortcut. */\n hand?: ShortcutOption;\n\n /** The image frame shortcut. */\n image?: ShortcutOption;\n\n /** The polygon shape shortcut. */\n polygon?: ShortcutOption;\n\n /** The rectangle shape shortcut. */\n rectangle?: ShortcutOption;\n\n /** The select shortcut. */\n select?: ShortcutOption;\n\n /** The text frame shortcut. */\n text?: ShortcutOption;\n\n /** The zoom shortcut. */\n zoom?: ShortcutOption;\n\n /** The copy/cut/paste/duplicate shortcut. */\n copyPaste?: ShortcutOption;\n\n /** The view mode shortcut. */\n viewMode?: ShortcutOption;\n};\n\n/**\n * Specific shortcut options\n */\nexport type ShortcutOption = {\n /** Whether the shortcut is enabled. */\n enabled: boolean;\n};\n\n/**\n * Default studio options with all shortcuts disabled.\n */\nexport const defaultStudioOptions: StudioOptionsDeltaUpdate = {\n shortcutOptions: {\n debugPanel: { enabled: false },\n ellipse: { enabled: false },\n hand: { enabled: false },\n image: { enabled: false },\n polygon: { enabled: false },\n rectangle: { enabled: false },\n select: { enabled: false },\n text: { enabled: false },\n zoom: { enabled: false },\n copyPaste: { enabled: false },\n viewMode: { enabled: false },\n },\n};\n","import { BasicAnimationsEmphasisType, BasicAnimationsIntroType, BasicAnimationsOutroType } from './AnimationTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\nimport { BlendMode, FrameTypeEnum } from './FrameTypes';\nimport { LayoutIntent, LayoutType } from './LayoutTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { Variable } from './VariableTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentAction } from './ActionTypes';\nimport { ShapeProperties } from './ShapeTypes';\n\nexport type DocumentError = { error: Record<string, unknown>; code: number };\n\nexport type UndoState = {\n canUndo: boolean;\n canRedo: boolean;\n undoItemName: OperationName;\n redoItemName: OperationName;\n};\n\nexport type OperationName = { translationKey: number; name: string };\n\n/**\n * This type should give a clear indication of how the JSON document is structured. This could help you with building a test document yourself.\n */\nexport interface ChiliDocument {\n selectedLayoutId: string;\n properties?: TemplateDocumentProperties | ProjectDocumentProperties;\n pages: DocumentPage[];\n layouts: (ChildLayout | TopLayout)[];\n stylekit: DocumentStylekit;\n variables: Variable[];\n actions: DocumentAction[];\n}\n\nexport interface DocumentPage {\n id: string;\n number: number;\n frames: (ImageFrame | TextFrame | ShapeFrame)[];\n}\n\nexport interface DocumentFrame {\n id: string;\n name: string;\n type: FrameTypeEnum;\n blendMode: BlendMode;\n constrainProportions: boolean;\n}\n\nexport interface ImageFrame extends DocumentFrame {\n src: ImageFrameUrlSource | ImageFrameConnectorSource | ImageFrameVariableSource;\n}\n\nexport interface ShapeFrame extends DocumentFrame {\n shapeProperties: ShapeProperties;\n}\n\nexport interface TextFrame extends DocumentFrame {\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumns: number;\n columnGap: number;\n textDirection: string;\n flowDirection: string;\n verticalAlign: string;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n}\n\nexport enum ImageFrameSourceType {\n url = 'url',\n assetProvider = 'assetProvider',\n variable = 'variable',\n}\n\nexport interface ImageFrameSource {\n type: ImageFrameSourceType;\n}\n\nexport interface ImageFrameUrlSource extends ImageFrameSource {\n url: string;\n}\n\nexport interface ImageFrameConnectorSource extends ImageFrameSource {\n id: string;\n assetId: string;\n}\n\nexport interface ImageFrameVariableSource extends ImageFrameSource {\n id: string;\n}\n\nexport interface Layout {\n id: string;\n name: string;\n frameProperties: (ChildFrameProperty | TopFrameProperty)[];\n width?: number;\n height?: number;\n childLayouts: string[];\n type: LayoutType;\n frameAnimations?: FrameAnimation[];\n timelineLengthMs?: number;\n animated?: boolean;\n intent?: LayoutIntent;\n}\n\nexport interface TopLayout extends Layout {\n frameAnimations: FrameAnimation[];\n timelineLengthMs: number;\n animated: boolean;\n intent: LayoutIntent;\n width: number;\n height: number;\n}\n\nexport interface ChildLayout extends Layout {\n parentId: Id;\n}\n\nexport enum FramePropertiesType {\n top = 'top',\n child = 'child',\n}\nexport interface FrameProperty {\n id: Id;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n rotationDegrees?: number;\n rotationOriginY?: number;\n scaleX?: number;\n scaleY?: number;\n isVisible?: boolean;\n type: FramePropertiesType;\n}\n\nexport type ChildFrameProperty = FrameProperty;\nexport interface TopFrameProperty extends FrameProperty {\n x: number;\n y: number;\n width: number;\n height: number;\n rotationDegrees: number;\n rotationOriginY: number;\n scaleX: number;\n scaleY: number;\n isVisible: boolean;\n}\n\nexport interface FrameAnimation {\n id: Id;\n from: number;\n to: number;\n basicAnimations: BasicAnimations;\n}\n\nexport interface BasicAnimations {\n intro?: BasicAnimationsIntroType;\n emphasis?: BasicAnimationsEmphasisType;\n outro?: BasicAnimationsOutroType;\n}\n\nexport interface DocumentStylekit {\n colors: DocumentColor[];\n characterStyles: DocumentCharacterStyle[];\n paragraphStyles: DocumentParagraphStyle[];\n}\n\nexport type DocumentCharacterStyle = CharacterStyle;\nexport type DocumentParagraphStyle = ParagraphStyle;\n\nexport interface DocumentVariable extends Variable {\n parentId: Id;\n name: string;\n label: string;\n isVisible: boolean;\n isReadonly: boolean;\n isRequired: boolean;\n value: string;\n defaultValue: string;\n}\n\nexport enum DocumentType {\n project = 'project',\n template = 'template',\n}\n\nexport interface DocumentProperties {\n type: DocumentType;\n}\n\nexport type TemplateDocumentProperties = DocumentProperties;\n\nexport interface ProjectDocumentProperties extends DocumentProperties {\n templateId: string;\n}\n\nexport type DocumentLoadOptions = {\n keepConnectors?: boolean;\n};\n","import type { EditorResponse } from '../types/CommonTypes';\n\nexport function getEditorResponseData<T>(response: EditorResponse<unknown>, parse = true): EditorResponse<T> {\n try {\n if (!response.success) {\n throw new Error(response.error ?? 'Yikes, something went wrong', {\n cause: {\n name: String(response.status),\n message: response.error ?? 'Yikes, something went wrong',\n },\n });\n }\n const dataShouldBeParsed = response.data && parse;\n return {\n ...response,\n parsedData: dataShouldBeParsed\n ? (JSON.parse(response.data as string) as T)\n : (response.data as unknown as T),\n };\n } catch (error) {\n console.error(error);\n throw error;\n }\n}\n\n// For testing purposes only\nexport function castToEditorResponse(toCast: unknown): EditorResponse<unknown> {\n return {\n status: 200,\n success: true,\n parsedData: null,\n data: JSON.stringify(toCast),\n };\n}\n","import { ActionDeltaUpdate, ActionTrigger, DocumentAction } from '../types/ActionTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ActionController is responsible for all Actions-related functionality.\n * Methods inside this controller can be called by `window.SDK.action.{method-name}`\n */\nexport class ActionController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of all actions.\n * @returns list of all actions\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getActions().then((result) => getEditorResponseData<DocumentAction[]>(result));\n };\n\n /**\n * This method returns an action by the id\n * @param id the id of a specific action\n * @returns action details\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getActionById(id).then((result) => getEditorResponseData<DocumentAction>(result));\n };\n\n /**\n * This method creates a new action.\n * @returns the id of the newly created action.\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createAction().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method duplicates an existing action by the id\n * @param id the id of a specific action\n * @returns the id of the duplicated action.\n */\n duplicate = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateAction(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method removes the action by the id\n * @param id the id of a specific action\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeAction(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method updates an existing Action\n * @param id the id of a specific Action\n * @param update the delta update to apply to the Action\n * @returns\n */\n update = async (id: Id, update: ActionDeltaUpdate) => {\n const res = await this.#editorAPI;\n return res.updateAction(id, JSON.stringify(update)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method renames an action by the id and provided name\n * @param id the id of a specific action\n * @param name the new unique name for the action\n * @returns\n */\n rename = async (id: Id, name: string) => {\n return this.update(id, { name: name });\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method updates the script the action uses by the id and provided script\n * @param id the id of a specific action\n * @param actionScript the JavaScript based action script\n * @returns\n */\n updateScript = async (id: Id, actionScript: string) => {\n return this.update(id, { script: actionScript });\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method updates the triggers on which the action will react.\n * @param id the id of a specific action\n * @param triggers the triggers this action should react on.\n * @returns\n */\n updateTriggers = async (id: Id, triggers: ActionTrigger[]) => {\n return this.update(id, { triggers: triggers });\n };\n\n /**\n * This method changes positions of actions\n * @param order the position of actions\n * @param ids the list of action IDs\n * @returns\n */\n move = async (order: number, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.moveActions(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method stores the state of action type errors to the document\n *\n * Those errors states can be read back from the usual getters or the\n * `onActionsChanged` stream\n * @param id the id of a specific action\n * @param hasTypeErrors whether there is an action type error\n * @returns\n */\n setTypeError = async (id: string, hasTypeErrors: boolean) => {\n return this.update(id, { hasTypeError: hasTypeErrors });\n };\n}\n","import { FrameAnimationPropertiesType } from '../types/AnimationTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The AnimationController is responsible for all communication regarding Animations.\n * Methods inside this controller can be called by `window.SDK.animation.{method-name}`\n */\nexport class AnimationController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(children: EditorAPI) {\n this.#editorAPI = children;\n }\n\n /**\n * This method returns all animations on current layout\n * @returns list of all animation on current layout\n */\n getAllOnSelectedLayout = async () => {\n const res = await this.#editorAPI;\n return res\n .getAnimationsOnSelectedLayout()\n .then((result) => getEditorResponseData<FrameAnimationPropertiesType[]>(result));\n };\n\n /**\n * This method returns an animation for a given frame and layout IDs\n * @param id the id of a specific frame\n * @param layoutId the id of a specific layout\n * @returns animation properties for a given frame and layout\n */\n getByFrameId = async (id: Id, layoutId?: Id) => {\n const res = await this.#editorAPI;\n return res\n .getAnimationByFrameId<string>(id, layoutId)\n .then((result) => getEditorResponseData<FrameAnimationPropertiesType>(result));\n };\n\n /**\n * This method returns the animations for a given layout id\n * @param id the id of a specific layout\n * @returns animation properties for a given layout\n */\n getByLayoutId = async (id: Id) => {\n const res = await this.#editorAPI;\n return res\n .getAnimationsByLayoutId(id)\n .then((result) => getEditorResponseData<FrameAnimationPropertiesType>(result));\n };\n\n /**\n * This method sets the animation state for a certain Frame\n * @param animation animation properties\n * @returns updated animation properties\n */\n setFrameAnimation = async (animation: FrameAnimationPropertiesType) => {\n const res = await this.#editorAPI;\n return res\n .setFrameAnimation(JSON.stringify(animation))\n .then((result) =>\n getEditorResponseData<FrameAnimationPropertiesType>({ ...result, data: JSON.stringify(animation) }),\n );\n };\n\n /**\n * This method triggers the animation to play\n * @returns\n */\n play = async () => {\n const res = await this.#editorAPI;\n return res.playAnimation().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method triggers the animation to pause\n * @returns\n */\n pause = async () => {\n const res = await this.#editorAPI;\n return res.pauseAnimation().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the animation time to a certain time, expressed in milliseconds\n * @param timeInMS the time expressed in milliseconds\n * @returns\n */\n setScrubberPosition = async (timeInMS: number) => {\n const res = await this.#editorAPI;\n return res.setScrubberPosition(timeInMS).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the total and maximum duration of the animation, expressed in milliseconds\n * @param timeInMS the time expressed in milliseconds\n * @returns\n */\n setDuration = async (timeInMS: number) => {\n const res = await this.#editorAPI;\n return res.setAnimationDuration(timeInMS).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method resets the animation to its initial state\n * @param id the id of a certain frame\n * @returns\n */\n resetFrameAnimation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameAnimation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method resets the layout's animations and animation duration to its initial state\n * @returns\n */\n reset = async () => {\n const res = await this.#editorAPI;\n return res.resetAnimation().then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ViewMode } from '../types/ViewModeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The CanvasController is responsible for all Canvas-related functionality.\n * Methods inside this controller can be called by `window.SDK.canvas.{method-name}`\n */\nexport class CanvasController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method fits the page to the given rectangle or the viewport available\n * Optional parameters `left`, `top`, `width` and `height` are needed to define the rectangle to fit the page to\n * If any or all of them aren't provided the page will fit the whole viewport available\n * @param id the id of a specific page\n * @param left\n * @param top\n * @param width\n * @param height\n * @returns\n */\n zoomToPage = async (\n id?: Id | null,\n left?: number | null,\n top?: number | null,\n width?: number | null,\n height?: number | null,\n ) => {\n const res = await this.#editorAPI;\n return res.zoomToPage(id, left, top, width, height).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets the scale factor of the canvas\n * @returns scale factor in percents\n */\n getZoomPercentage = async () => {\n const res = await this.#editorAPI;\n return res.getZoomPercentage().then((result) => getEditorResponseData<number>(result));\n };\n\n /**\n * This method sets the scale factor to the canvas and re-centers the page\n * @param scaleFactor scale factor in percents\n * @returns\n */\n setZoomPercentage = async (scaleFactor: number) => {\n const res = await this.#editorAPI;\n return res.setZoomPercentage(scaleFactor).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new view mode\n * @param viewMode view mode of the editor\n * @returns\n */\n setViewMode = async (viewMode: ViewMode) => {\n const res = await this.#editorAPI;\n return res.setViewMode(viewMode).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { CharacterStyle, CharacterStyleUpdate } from '../types/CharacterStyleTypes';\n\n/**\n * The CharacterStyleController is responsible for all communication regarding character styles.\n * Methods inside this controller can be called by `window.SDK.characterStyle.{method-name}`\n */\nexport class CharacterStyleController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of character styles\n * @returns list of all character styles\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getCharacterStyles().then((result) => getEditorResponseData<CharacterStyle[]>(result));\n };\n\n /**\n * This method returns a character style by the id\n * @param characterStyleId the id of a specific character style\n * @returns character style for given id\n */\n getById = async (characterStyleId: Id) => {\n const res = await this.#editorAPI;\n return res\n .getCharacterStyleById(characterStyleId)\n .then((result) => getEditorResponseData<CharacterStyle>(result));\n };\n\n /**\n * This method creates a new character style\n * @returns the id of new character style\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createCharacterStyle().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method updates a character style by the id and provided properties\n * @param characterStyleId the id of a specific character style\n * @param characterStyle the new character style properties\n * @returns\n */\n update = async (characterStyleId: Id, characterStyle: CharacterStyleUpdate) => {\n const res = await this.#editorAPI;\n return res\n .updateCharacterStyle(characterStyleId, JSON.stringify(characterStyle))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a character style by the id\n * @param characterStyleId the id of a specific character style\n * @returns\n */\n remove = async (characterStyleId: Id) => {\n const res = await this.#editorAPI;\n return res.removeCharacterStyle(characterStyleId).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method duplicates a character style by the id\n * @param characterStyleId the id of a specific character style\n * @returns id of the duplicated character style\n */\n duplicate = async (characterStyleId: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateCharacterStyle(characterStyleId).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method renames a character style by the id\n * @param characterStyleId the id of a specific character style\n * @param characterStyleName the new name of the character style\n * @returns\n */\n rename = async (characterStyleId: Id, characterStyleName: string) => {\n const res = await this.#editorAPI;\n return res\n .renameCharacterStyle(characterStyleId, characterStyleName)\n .then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorUpdate, DocumentColor } from '../types/ColorStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ColorStyleController is responsible for all communication regarding color styles.\n * Methods inside this controller can be called by `window.SDK.colorStyle.{method-name}`\n */\nexport class ColorStyleController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of colors\n * @returns list of all colors\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getColors().then((result) => getEditorResponseData<DocumentColor[]>(result));\n };\n\n /**\n * This method returns a color by id\n * @param id the id of a specific color\n * @returns color properties for given id\n */\n getById = async (id: string) => {\n const res = await this.#editorAPI;\n return res.getColorById(id).then((result) => getEditorResponseData<DocumentColor>(result));\n };\n\n /**\n * This method creates a new color\n * @returns the new created color id\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createColor().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method duplicates a color by the id\n * @param id the id of a specific color\n * @returns id of the duplicated color\n */\n duplicate = async (id: string) => {\n const res = await this.#editorAPI;\n return res.duplicateColor(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method changes positions of colors\n * @param order the position of the colors\n * @param ids the list of color IDs\n * @returns\n */\n move = async (order: number, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.moveColors(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method renames a color\n * @param id the id of a specific color\n * @param newColorName the new name of the color\n * @returns\n */\n rename = async (id: string, newColorName: string) => {\n const res = await this.#editorAPI;\n return res.renameColor(id, newColorName).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method updates a color\n * @param id the id of a specific color\n * @param newColorProperties the new color properties\n * @returns\n */\n update = async (id: string, newColorProperties: ColorUpdate) => {\n const res = await this.#editorAPI;\n return res\n .updateColor(id, JSON.stringify(newColorProperties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a color\n * @param id the id of a specific color\n * @returns\n */\n remove = async (id: string) => {\n const res = await this.#editorAPI;\n return res.removeColor(id).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Color, RGBColor } from '../types/ColorStyleTypes';\n\n/**\n * The ColorConversionController is responsible for all communication regarding color coversion.\n * Methods inside this controller can be called by `window.SDK.colorConversion.{method-name}`\n */\nexport class ColorConversionController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method converts the given color to its rgb representation\n * @param color the color to convert\n * @returns the rgb representation of the given color\n */\n convertToRgb = async (color: Color) => {\n const res = await this.#editorAPI;\n return res.colorToRgb(color).then((result) => getEditorResponseData<RGBColor>(result));\n };\n}\n","import { Id } from './CommonTypes';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport type QueryOptions = {\n filter?: string[] | null;\n collection?: string | null;\n pageToken?: string | null;\n pageSize?: number | null;\n sortBy?: SortBy | null;\n sortOrder?: SortOrder | null;\n};\n\nexport type FontConnectorCapabilities = {\n query: boolean;\n detail: boolean;\n preview: boolean;\n filtering: boolean;\n};\n\nexport type MediaConnectorCapabilities = {\n query: boolean;\n detail: boolean;\n filtering: boolean;\n};\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly available url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly available link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport class ConnectorMapping {\n name: string;\n value: string;\n direction = ConnectorMappingDirection.engineToConnector;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string,\n direction = ConnectorMappingDirection.engineToConnector,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `${mapFrom}.${sourceValue}`;\n } else {\n this.value = sourceValue;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = {\n pageSize: number;\n nextPageToken?: string;\n data: T[];\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n\n constructor(token: string) {\n this.token = token;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\n/**\n * @param connectorId connector id\n * @param type type of auth renewal needed\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AuthRefreshRequest = {\n connectorId: Id;\n type: AuthRefreshTypeEnum;\n headerValue: string | null;\n};\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { StudioOptionsDeltaUpdate, WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\n\n/**\n * The ConfigurationController allows setting editor session data. This data is not stored in the document and\n * can only be used at runtime. Amongst others, the configuration store is available to the editor connectors and\n * Javascript actions running in the editor.\n * Methods inside this controller can be called by `window.SDK.configuration.{method-name}`\n */\nexport class ConfigurationController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the value for a given configuration key. If a value was not found in the configuration store\n * this method returns an error. The key cannot be null.\n * @returns value for a given configuration key\n */\n getValue = async (key: WellKnownConfigurationKeys | string) => {\n const res = await this.#editorAPI;\n return res.getConfigValue(key).then((result) => getEditorResponseData<string>(result));\n };\n\n /**\n * This method sets, or overrides the value for a given key. Null values are not allowed for both key and value,\n * using them will result in an error.\n * @returns\n */\n setValue = async (key: WellKnownConfigurationKeys | string, value: string) => {\n const res = await this.#editorAPI;\n return res.setConfigValue(key, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method updates the studio options. Only defined options are updated, null values are ignored.\n * @returns\n */\n updateStudioOptions = async (options: StudioOptionsDeltaUpdate) => {\n const res = await this.#editorAPI;\n return res.updateStudioOptions(JSON.stringify(options)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method returns the engine session id. This id is unique for this engine session\n * @returns the engine session id\n */\n getEngineSessionId = async () => {\n const res = await this.#editorAPI;\n return res.getEngineSessionId().then((result) => getEditorResponseData<string>(result));\n };\n}\n","import { ConnectorOptions, EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\r\nimport {\r\n ConnectorState,\r\n ConnectorStateType,\r\n ConnectorMapping,\r\n ConnectorRegistration,\r\n ConnectorInstance,\r\n ConnectorType,\r\n} from '../types/ConnectorTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\n/**\r\n * The ConnectorController manages lifetime of all available connectors, regardless of the type, in the\r\n * document. Use it to add/remove connectors to a template, or set specific configuration.\r\n *\r\n * The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an\r\n * implementation of a set of capabilities we need to interact with a certain external resource management system.\r\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\r\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\r\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\r\n * generation.\r\n * This controller is an interface to the running connector instance inside the studio engine. The engine will\r\n * automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered\r\n * manually.\r\n */\r\nexport class ConnectorController {\r\n /**\r\n * @ignore\r\n */\r\n #editorAPI: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(editorAPI: EditorAPI) {\r\n this.#editorAPI = editorAPI;\r\n }\r\n\r\n /**\r\n * Gets a connector by its id\r\n * @param id the id of the connector\r\n * @returns connector\r\n */\r\n getById = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorById(id).then((result) => getEditorResponseData<ConnectorInstance>(result));\r\n };\r\n\r\n /**\r\n * Gets all available connectors of a 'ConnectorType'\r\n * @param type type of connector you want to get\r\n * @returns list of all available connectors of a 'ConnectorType'\r\n */\r\n getAllByType = async (type: ConnectorType) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectors(type).then((result) => getEditorResponseData<ConnectorInstance[]>(result));\r\n };\r\n\r\n /**\r\n * Registers a new connector in the SDK. After successful registration, depending\r\n * on the connector type, the connector can be configured and used in the template\r\n * Remember to add custom authentication information after registering the connector\r\n * @param registration registration object containing all details about the connector\r\n * @returns the Id of the newly created connector, this Id should be used going forward.\r\n */\r\n register = async (registration: ConnectorRegistration) => {\r\n const res = await this.#editorAPI;\r\n return res.registerConnector(JSON.stringify(registration)).then((result) => getEditorResponseData<Id>(result));\r\n };\r\n\r\n /**\r\n * Unregisters a connector from the document.\r\n * @param id the id of the connector to unregister\r\n * @returns\r\n */\r\n unregister = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.unregisterConnector(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Configures a registered connector. A configurator helper is passed as an argument\r\n * of the callback for you to setup your connector.\r\n * @param id the id of your registered connector\r\n * @param configurationCallback callback to setup the connector\r\n * @returns\r\n */\r\n configure = async (id: Id, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => {\r\n const res = await this.#editorAPI;\r\n // wait for connector to be ready\r\n await this.waitToBeReady(id);\r\n // execute callback\r\n await configurationCallback(new ConnectorConfigurator(id, res));\r\n // invalidate connector in engine\r\n return res.updateConnectorConfiguration(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitToBeReady'\r\n * method in this controller.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns connector state\r\n */\r\n getState = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorState(id).then((result) => getEditorResponseData<ConnectorState>(result));\r\n };\r\n\r\n /**\r\n * Gets the mapped data from connector.\r\n * @param id the id of your registered connector\r\n * @returns mappings\r\n */\r\n getMappings = async (id: string) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorMappings(id).then((result) => getEditorResponseData<ConnectorMapping[]>(result));\r\n };\r\n\r\n /**\r\n * Gets the options from the connector.\r\n * @param id the id of your registered connector\r\n * @returns options\r\n */\r\n getOptions = async (id: string) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorOptions(id).then((result) => getEditorResponseData<ConnectorOptions>(result));\r\n };\r\n\r\n /**\r\n * Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure\r\n * an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure\r\n * the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially\r\n * useful during startup of the SDK / right after the loadDocument call.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns\r\n */\r\n waitToBeReady = async (id: Id, timeoutMilliseconds = 2000): Promise<EditorResponse<null>> => {\r\n // minimum timeout is 500ms\r\n let timeout = Math.max(timeoutMilliseconds, 500);\r\n\r\n // maximum timeout is 5000ms\r\n timeout = Math.min(timeout, 5000);\r\n\r\n const waitTime = 100;\r\n let retries = 0;\r\n\r\n try {\r\n // using while loop will prevent stack overflow issues when using recursion\r\n // wait for maximum 2 seconds to fail\r\n while (retries * waitTime < timeout) {\r\n const result = await this.getState(id);\r\n\r\n if (\r\n result.success &&\r\n result.parsedData &&\r\n (result.parsedData.type === ConnectorStateType.running ||\r\n result.parsedData.type === ConnectorStateType.ready)\r\n ) {\r\n return getEditorResponseData<null>(\r\n { data: null, success: true, error: undefined, status: 0, parsedData: undefined },\r\n false,\r\n );\r\n }\r\n\r\n await new Promise((resolve) => setTimeout(resolve, waitTime));\r\n retries++;\r\n }\r\n } catch (err) {\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Error while getting connector state ${err}`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n }\r\n\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Timed out waiting for connector`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n };\r\n}\r\n\r\n/**\r\n * Helper to setup your connector\r\n */\r\nclass ConnectorConfigurator {\r\n /**\r\n * @ignore\r\n */\r\n #connectorId: Id;\r\n #res: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(id: Id, res: EditorAPI) {\r\n this.#connectorId = id;\r\n this.#res = res;\r\n }\r\n\r\n /**\r\n * Allows to customize the context data a connector can work with. The options data\r\n * will be available using the context parameter in the connector implementation code.\r\n * @param options object containing key value data to pass to connector context\r\n * @returns\r\n */\r\n setOptions = async (options: ConnectorOptions) => {\r\n return this.#res\r\n .setConnectorOptions(this.#connectorId, JSON.stringify(options))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Allows to map variables or strings to connector context data.\r\n * By defining the mappings, we can trigger re-download of assets (dynamic asset provider)\r\n * or populate filters for the query endpoint. The mapped data will be available using\r\n * the context parameter in the connector implementation code.\r\n *\r\n * For the variables the mapping should follow the format \"var.[variable id]\". e.g. var.6B29FC40-CA47-1067-B31D-00DD010662DA\r\n *\r\n * @param mappings collection of mappings to set to this connector\r\n * @returns\r\n */\r\n setMappings = async (mappings: ConnectorMapping[]) => {\r\n const result = await this.#res.setConnectorMappings(\r\n this.#connectorId,\r\n mappings.map(function (m) {\r\n return JSON.stringify(m);\r\n }),\r\n );\r\n return getEditorResponseData<null>(result);\r\n };\r\n\r\n /**\r\n * @deprecated define the GraFx Studio Auth Token in the `SDK.Configuration.setValue`\r\n *\r\n * This method sets the GraFx Access Token in the Authentication HTTP header for the 'chili' authentication type.\r\n * The CHILI Token will be used to authenticate every grafx connector http call.\r\n * @param token token for the CHILI authentication\r\n * @returns\r\n */\r\n setChiliToken = async (token: string) => {\r\n return this.#res\r\n .connectorAuthenticationSetChiliToken(this.#connectorId, token)\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method sets the HTTP headers for the 'staticKey' authentication type.\r\n * These additional headers will be added to all connector http calls.\r\n * Can only be used after a connector has been registered. (if you are using a grafx connector no registration is needed)\r\n * @param headerName name of the header\r\n * @param headerValue value of the header\r\n * @returns\r\n */\r\n setHttpHeader = async (headerName: string, headerValue: string) => {\r\n return this.#res\r\n .connectorAuthenticationSetHttpHeader(this.#connectorId, headerName, headerValue)\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { DebugData } from '../types/DebugTypes';\n\n/**\n * The DebugController is responsible for all communication regarding Debugging.\n * Methods inside this controller can be called by `window.SDK.debug.{method-name}`\n */\nexport class DebugController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns all debug logs\n * @returns list of all debug logs\n */\n getAllLogs = async () => {\n const res = await this.#editorAPI;\n return res.getLogs().then((result) => getEditorResponseData<DebugData[]>(result));\n };\n\n /**\n * This method toggles the showcase of debug panel\n * @returns\n */\n toggleDebugPanel = async () => {\n const res = await this.#editorAPI;\n return res.toggleDebugPanel().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method enables the debugging\n * @returns\n */\n enableDebug = async () => {\n const res = await this.#editorAPI;\n return res.enableDebug().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method disables the debugging\n * @returns\n */\n disableDebug = async () => {\n const res = await this.#editorAPI;\n return res.disableDebug().then((result) => getEditorResponseData<null>(result));\n };\n}\n","// FramePropertiesDto\nimport { ColorUsage } from './ColorStyleTypes';\nimport { Id, PropertyState } from './CommonTypes';\nimport { CornerRadiusAll, CornerRadiusNone, CornerRadiusOnly, ShapeType } from './ShapeTypes';\n\nexport type FrameLayoutType = {\n id: Id;\n layoutId: Id;\n x: PropertyState<number>;\n y: PropertyState<number>;\n width: PropertyState<number>;\n height: PropertyState<number>;\n rotationDegrees: PropertyState<number>;\n scaleX: PropertyState<number>;\n scaleY: PropertyState<number>;\n isVisible: PropertyState<boolean>;\n fitMode: PropertyState<FitMode>;\n hasImageCrop: PropertyState<boolean>;\n minCopyfitting: PropertyState<number>;\n maxCopyfitting: PropertyState<number>;\n enableCopyfitting: PropertyState<boolean>;\n} | null;\n\n//Frame.image\nexport type FrameType = {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n // `imageUrl` is not generic: should be removed from model\n imageUrl: string;\n blendMode: string;\n constrainProportions: boolean;\n};\n\nexport type Frame = TextFrame | ImageFrame | ShapeFrame;\n\nexport type ImageFrameVariableSource = {\n type: ImageSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type ImageFrameUrlSource = {\n type: ImageSourceTypeEnum.url;\n url: string;\n};\n\nexport type ImageFrameConnectorSource = {\n assetId: Id;\n id: Id;\n type: ImageSourceTypeEnum.connector;\n};\n\nexport type ImageFrameSource = ImageFrameConnectorSource | ImageFrameVariableSource | ImageFrameUrlSource;\n\n// used by new getter methods\nexport type ImageFrame = {\n id: Id;\n name: string;\n type: FrameTypeEnum.image;\n src?: ImageFrameSource;\n blendMode: BlendMode;\n constrainProportions: boolean;\n crop?: CropSettings | NoCropSettings;\n};\n\nexport type ShapeFrame = {\n id: Id;\n name: string;\n type: FrameTypeEnum.shape;\n blendMode: BlendMode;\n constrainProportions: boolean;\n shapeProperties: {\n enableFill: boolean;\n fillColor: ColorUsage;\n enableStroke: boolean;\n strokeWeight: number;\n strokeColor: ColorUsage;\n allCornersSame: boolean;\n };\n src: {\n type: ShapeType;\n cornerRadius: CornerRadiusNone | CornerRadiusAll | CornerRadiusOnly;\n sides?: number;\n };\n};\n\nexport type TextFrame = {\n id: Id;\n name: string;\n type: FrameTypeEnum.text;\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumn: number;\n columnGap: number;\n textDirection: TextDirection;\n flowDirection: FlowDirection;\n verticalAlign: VerticalAlign;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n blendMode: BlendMode;\n constrainProportions: boolean;\n};\n\nexport type CropSettings = {\n left: number;\n top: number;\n width: number;\n height: number;\n rotationDegrees: number;\n type: 'default';\n};\n\nexport type NoCropSettings = {\n type: 'noCrop';\n};\n\nexport enum ImageSourceTypeEnum {\n url = 'url',\n variable = 'variable',\n connector = 'connector',\n}\n\nexport enum FrameTypeEnum {\n text = 'text',\n image = 'image',\n shape = 'shape',\n}\n\nexport enum TextDirection {\n leftToRight = 'leftToRight',\n rightToLeft = 'rightToLeft',\n weak = 'weak',\n}\n\nexport enum FlowDirection {\n horizontal = 'horizontal',\n vertical = 'vertical',\n onPath = 'onPath',\n}\n\nexport enum VerticalAlign {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n justify = 'justify',\n}\n\nexport enum BlendMode {\n normal = 'normal',\n screen = 'screen',\n overlay = 'overlay',\n darken = 'darken',\n lighten = 'lighten',\n colorDodge = 'colorDodge',\n colorBurn = 'colorBurn',\n hardLight = 'hardLight',\n softLight = 'softLight',\n difference = 'difference',\n exclusion = 'exclusion',\n multiply = 'multiply',\n hue = 'hue',\n saturation = 'saturation',\n color = 'color',\n luminosity = 'luminosity',\n}\n\nexport enum FitMode {\n fit = 'fit',\n fill = 'fill',\n}\n\nexport enum UpdateZIndexMethod {\n bringToFront = 'bringToFront',\n sendToBack = 'sendToBack',\n bringForward = 'bringForward',\n sendBackward = 'sendBackward',\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport type { ChiliDocument, DocumentLoadOptions } from '../types/DocumentTypes';\n\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n/**\n * The DocumentController is responsible for all communication regarding the Document.\n * Methods inside this controller can be called by `window.SDK.document.{method-name}`\n */\n\nexport class DocumentController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method retrieves the current document state from the editor\n * @returns the JSON document in the form of a string\n */\n getCurrentState = async () => {\n const res = await this.#editorAPI;\n return res.getCurrentDocumentState().then((result) => getEditorResponseData<ChiliDocument>(result));\n };\n\n /**\n * This method will load a provided document in the ChiliDocument format and\n * clean old document states.\n * If you set `DocumentLoadOptions.keepConnectors` to true, `load` will keep\n * your old connectors states e.g. options, authentication..\n * By default `keepConnectors` is false and your connectors states are reset.\n * In this case, you would need to configure your connectors appropriately\n * beforehand.\n * @param doc the document to load in\n * @param options the options object for setting up the document load\n * @returns the document loaded inside of the canvas\n */\n load = async (doc: ChiliDocument | string, options: DocumentLoadOptions = { keepConnectors: false }) => {\n const res = await this.#editorAPI;\n\n // Note: loadDocumentKeepConnectors is a temporary engine call to make the\n // merging smoother, it will be removed when all projects will point to\n // this SDK version but the SDK API won't change. -> [EDT-1107]\n const loadDocumentRedirection = options.keepConnectors ? res.loadDocumentKeepConnectors : res.loadDocument;\n const parsedDoc = typeof doc !== 'string' ? JSON.stringify(doc) : doc;\n\n return loadDocumentRedirection(parsedDoc).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ImageSourceTypeEnum, ImageFrameVariableSource } from '../types/FrameTypes';\nimport { TextType } from '../types/TextTypes';\n\n/**\n * The ExperimentController contains all SDK functions that are considered for addition,\n * or functions we want to keep open for changing definitions. This is a sneak peak\n * into future versions of the SDK. Never build production code relying on functions in\n * this controller.\n */\nexport class ExperimentController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method will assign an image from a variable to the correct ImageFrame\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param variableId the id of the variable which contains the image\n * @returns\n */\n insertImageVariableToFrame = async (imageFrameId: Id, variableId: Id) => {\n const res = await this.#editorAPI;\n const src: ImageFrameVariableSource = { id: variableId, type: ImageSourceTypeEnum.variable };\n return res\n .setImageSource(imageFrameId, JSON.stringify(src))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will insert a text variable in the selected frame. Calling this method\n * requires that the selected frame is in text editing mode.\n * @param id the id of the variable to be inserted.\n * @returns\n */\n insertTextVariable = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.insertTextVariable(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will enter text editing mode on the provided frame.\n * @param id the id frame to enter text edit mode on.\n * @returns\n */\n enterTextEditMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterTextEditMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit text editing mode.\n * @returns\n */\n exitTextEditMode = async () => {\n const res = await this.#editorAPI;\n return res.exitTextEditMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets the text content of a text frame.\n * The variables contained in the text will return their values only if you\n * are in text editing mode.\n * @param frameId The ID of a text frame\n * @param textType The type of the text\n * @returns the text content\n */\n getText = async (frameId: string, textType: TextType) => {\n const res = await this.#editorAPI;\n return res.getTextByFrameId(frameId, textType).then((result) => getEditorResponseData<string>(result));\n };\n\n /**\n * This method sets the text content of a text frame\n * @param frameId The ID of a text frame\n * @param text The new text content\n * @returns\n */\n setText = async (frameId: string, text: string) => {\n const res = await this.#editorAPI;\n return res.setTextByFrameId(frameId, text).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method selects the text content of a text frame\n * @param frameId The ID of a text frame\n * @param startIndex The index where the selection starts\n * @param length The length of selection from startIndex\n * @returns\n */\n selectText = async (frameId: string, startIndex: number, length: number) => {\n const res = await this.#editorAPI;\n return res.selectTextById(frameId, startIndex, length).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { ConnectorConfigOptions, EditorAPI, EditorRawAPI, EditorResponse, MetaData } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n DeprecatedMediaType,\n FontConnectorCapabilities,\n MediaType,\n QueryOptions,\n QueryPage,\n} from '../types/ConnectorTypes';\nimport { FontFamily, FontPreviewFormat, FontStyle } from '../types/FontConnectorTypes';\nimport { CallSender } from 'penpal';\n\n/**\n * The FontConnectorController is responsible for all communication regarding Font connectors.\n * Methods inside this controller can be called by `window.SDK.FontConnector.{method-name}`\n *\n * The way CHILI Studio handles different sources of Font is called 'FontConnectors'. A FontConnectors is an\n * implementation of a set of capabilities we need to interact with a certain Digital Asset Management system.\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\n * execute the Font connector both on web using webassembly and on the server side during e.g. animation output\n * generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class FontConnectorController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\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 * Query a specific FontConnector for data using both standardized queryOptions and the dynamic\n * context as parameters.\n * @param connectorId unique id of the Font connector\n * @param queryOptions query options\n * @param context context that will be available in the connector script.\n * @returns array of font families\n */\n query = async (connectorId: string, queryOptions: QueryOptions, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorQuery(connectorId, JSON.stringify(queryOptions), JSON.stringify(context))\n .then((result) => getEditorResponseData<QueryPage<FontFamily>>(result));\n };\n\n /**\n * Returns all font styles for a family using a specific FontConnector. The connector needs to list `detail` as a supported capability.\n * @param connectorId unique id of the Font connector\n * @param fontFamilyId unique id of the Font family\n * @param context context that will be available in the connector script.\n * @returns array of font styles\n */\n detail = async (connectorId: string, fontFamilyId: string, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorDetail(connectorId, fontFamilyId, JSON.stringify(context))\n .then((result) => getEditorResponseData<FontStyle[]>(result));\n };\n\n /**\n * The combination of a `connectorId` and `fontId` is typically enough for a Font connector to\n * perform the download of this asset. The `download` endpoint is capable of relaying this information to the\n * Font connector instance running in the editor engine.\n * @param connectorId unique id of the Font connector\n * @param fontStyleId unique id of the Font style to download\n * @param context context that will be available in the connector script.\n * @returns\n */\n download = async (connectorId: string, fontStyleId: string, context: MetaData = {}): Promise<Uint8Array> => {\n const res = await this.#blobAPI;\n return res\n .fontConnectorDownload(connectorId, fontStyleId, JSON.stringify(context))\n .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * The combination of a `connectorId` and `fontFamilyId` is typically enough for a Font connector to\n * perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the\n * Font connector instance running in the editor engine.\n * @param connectorId unique id of the Font connector\n * @param fontFamilyId unique id of the Font family to download\n * @param previewFormat hint to the Font connector about desired format of the Font preview\n * @param context dynamic map of additional options potentially used by the connector\n * @returns\n */\n preview = async (\n connectorId: string,\n fontFamilyId: string,\n previewFormat: FontPreviewFormat,\n context: MetaData = {},\n ): Promise<Uint8Array> => {\n const res = await this.#blobAPI;\n return res\n .fontConnectorPreview(connectorId, fontFamilyId, previewFormat, JSON.stringify(context))\n .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n * mappings, they will be available in the `context` parameter of any connector method.\n * @param connectorId unique id of the media connector\n * @returns connector mappings\n */\n getConfigurationOptions = async (connectorId: string) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorGetConfigurationOptions(connectorId)\n .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n };\n\n /**\n * This method returns what capabilities the selected connector has. It gives an indication what methods can\n * be used successfully for a certain connector.\n * @param connectorId unique id of the Font connector\n * @returns FontConnectorCapabilities\n */\n getCapabilities = async (connectorId: string) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorGetCapabilities(connectorId)\n .then((result) => getEditorResponseData<FontConnectorCapabilities>(result));\n };\n\n /**\n * This method will parse the deprecatedFontType to the new Font type. This method will be removed once the deprecatedFontType is out of use\n * @param deprecatedType is 0 or 1\n * @returns MediaType value\n */\n parseDeprecatedFontType = (deprecatedType: DeprecatedMediaType) => {\n if (deprecatedType === DeprecatedMediaType.file) return MediaType.file;\n if (deprecatedType === DeprecatedMediaType.collection) return MediaType.collection;\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\r\nimport { AddDocumentFontFamily, AddDocumentFontStyle, DocumentFontFamily, DocumentFontStyle } from '../types/FontTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\n/**\r\n * The FontController is responsible for all communication regarding font styles.\r\n * Methods inside this controller can be called by `window.SDK.font.{method-name}`\r\n */\r\nexport class FontController {\r\n /**\r\n * @ignore\r\n */\r\n #editorAPI: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(editorAPI: EditorAPI) {\r\n this.#editorAPI = editorAPI;\r\n }\r\n\r\n /**\r\n * This method adds a font family\r\n * @param connectorId unique id of the font connector\r\n * @param fontFamily the font family object\r\n * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID`\r\n */\r\n addFontFamily = async (connectorId: Id, fontFamily: AddDocumentFontFamily) => {\r\n const res = await this.#editorAPI;\r\n return res\r\n .addFontFamily(connectorId, JSON.stringify(fontFamily))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method removes a font family\r\n * @param id the id of a specific font family\r\n * @returns\r\n */\r\n removeFontFamily = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.removeFontFamily(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method adds a font style\r\n * @param connectorId unique id of the font connector\r\n * @param fontStyle the font object\r\n * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID::FONT_STYLE_ID`\r\n */\r\n addFontStyle = async (connectorId: Id, fontStyle: AddDocumentFontStyle) => {\r\n const res = await this.#editorAPI;\r\n return res\r\n .addFontStyle(connectorId, JSON.stringify(fontStyle))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method removes a font style\r\n * @param id the id of a specific font style\r\n * @returns\r\n */\r\n removeFontStyle = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.removeFontStyle(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method returns the list of font families\r\n * @returns DocumentFontFamily[]\r\n */\r\n getFontFamilies = async () => {\r\n const res = await this.#editorAPI;\r\n return res.getFontFamilies().then((result) => getEditorResponseData<DocumentFontFamily[]>(result));\r\n };\r\n\r\n /**\r\n * This method returns the list of font styles for a specific family\r\n * @param id the id of a specific font style\r\n * @returns DocumentFontStyle[]\r\n */\r\n getFontStyles = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getFontStyles(id).then((result) => getEditorResponseData<DocumentFontStyle[]>(result));\r\n };\r\n\r\n /**\r\n * This method returns a font family by id\r\n * @param id the id of a specific font family\r\n * @returns DocumentFontFamily properties\r\n */\r\n getFontFamilyById = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getFontFamilyById(id).then((result) => getEditorResponseData<DocumentFontFamily>(result));\r\n };\r\n\r\n /**\r\n * This method returns a font style by id\r\n * @param id the id of a specific font style\r\n * @returns DocumentFontStyle properties\r\n */\r\n getFontStyleById = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getFontStyleById(id).then((result) => getEditorResponseData<DocumentFontStyle>(result));\r\n };\r\n\r\n /**\r\n * This method returns the default font.\r\n * Be aware that the default font will not change during the entire lifetime of the SDK session.\r\n * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.\r\n * @returns a default DocumentFontStyle\r\n */\r\n\r\n getDefaultFontStyle = async () => {\r\n const res = await this.#editorAPI;\r\n return res.getDefaultFontStyle().then((result) => getEditorResponseData<DocumentFontStyle>(result));\r\n };\r\n\r\n /**\r\n * This method returns the default font family.\r\n * Be aware that the default font family will not change during the entire lifetime of the SDK session.\r\n * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.\r\n * @returns a default DocumentFontFamily\r\n */\r\n getDefaultFontFamily = async () => {\r\n const res = await this.#editorAPI;\r\n return res.getDefaultFontFamily().then((result) => getEditorResponseData<DocumentFontFamily>(result));\r\n };\r\n\r\n /**\r\n * Check if the font family is used anywhere in the document\r\n * @param id the id of the font family to check\r\n * @returns boolean\r\n */\r\n isFontFamilyUsed = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.isFontFamilyUsed(id).then((result) => getEditorResponseData<boolean>(result));\r\n };\r\n\r\n /**\r\n * Check if the font style is used anywhere in the document\r\n * @param id the id of the font style to check\r\n * @returns boolean\r\n */\r\n isFontStyleUsed = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.isFontStyleUsed(id).then((result) => getEditorResponseData<boolean>(result));\r\n };\r\n\r\n /**\r\n * This method changes positions of font families\r\n * @param order the position of the font family\r\n * @param ids the list of font family IDs\r\n * @returns\r\n */\r\n moveFontFamilies = async (order: number, ids: string[]) => {\r\n const res = await this.#editorAPI;\r\n return res.moveFontFamilies(order, ids).then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport { CornerRadiusUpdateModel, ShapeProperties } from '../types/ShapeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ShapeController is responsible for all communication regarding Shapes.\n * Methods inside this controller can be called by `window.SDK.shape.{method-name}`\n */\nexport class ShapeController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method updates properties of the shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param properties A property to update\n * @returns\n */\n private setShapeProperties = async (id: Id, properties: ShapeProperties) => {\n const res = await this.#editorAPI;\n return res\n .setShapeProperties(id, JSON.stringify(properties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the visibility of the shape fill.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param enableFill Whether the shape fill is visible.\n * @returns\n */\n setEnableFill = async (id: Id, enableFill: boolean) => {\n const properties: ShapeProperties = { enableFill: enableFill };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the shape fill color of a specified shape frame.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param fillColor the new shape fill color that you want to set to the shapeFrame.\n * @returns\n */\n setFillColor = async (id: Id, fillColor: ColorUsage) => {\n const properties: ShapeProperties = { fillColor: fillColor };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the visibility of the shape stroke.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param enableStroke Whether the shape stroke is visible.\n * @returns\n */\n setEnableStroke = async (id: Id, enableStroke: boolean) => {\n const properties: ShapeProperties = { enableStroke: enableStroke };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the shape stroke color of a specified shape frame.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param strokeColor the new shape stroke color that you want to set to the shapeFrame.\n * @returns\n */\n setStrokeColor = async (id: Id, strokeColor: ColorUsage) => {\n const properties: ShapeProperties = { strokeColor: strokeColor };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the shape stroke weight of a specified shape frame.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param strokeWeight the new shape stroke weight that you want to set to the shapeFrame.\n * @returns\n */\n setStrokeWeight = async (id: Id, strokeWeight: number) => {\n const properties: ShapeProperties = { strokeWeight: strokeWeight };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the flag to change the way the rectangle shape corners will be changed: all at once or separately.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param allCornersSame the new flag that you want to set to the shapeFrame.\n * @returns\n */\n setFlagAllCornersSame = async (id: Id, allCornersSame: boolean) => {\n const properties: ShapeProperties = { allCornersSame: allCornersSame };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method updates radii of the rectangle and polygon shapes\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius object to update a desired corner;\n * @returns\n */\n private setShapeCorners = async (id: Id, radius: CornerRadiusUpdateModel) => {\n const res = await this.#editorAPI;\n return res.setShapeCorners(id, JSON.stringify(radius)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the radius for all corners of the rectangle and polygon shapes\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update all corners at once;\n * @returns\n */\n setRadiusAll = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { radiusAll: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the top left corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the top left corner;\n * @returns\n */\n setRadiusTopLeft = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { topLeft: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the bottom left corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the bottom left corner;\n * @returns\n */\n setRadiusBottomLeft = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { bottomLeft: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the top right corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the top right corner;\n * @returns\n */\n setRadiusTopRight = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { topRight: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the bottom right corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the bottom right corner;\n * @returns\n */\n setRadiusBottomRight = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { bottomRight: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n}\n","import type { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n BlendMode,\n FitMode,\n FrameLayoutType,\n FrameType,\n FrameTypeEnum,\n ImageFrameConnectorSource,\n ImageFrameSource,\n ImageFrameUrlSource,\n ImageSourceTypeEnum,\n UpdateZIndexMethod,\n VerticalAlign,\n} from '../types/FrameTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport { ShapeType } from '../types/ShapeTypes';\nimport { ShapeController } from './ShapeController';\n\n/**\n * The FrameController is responsible for all communication regarding Frames.\n * Methods inside this controller can be called by `window.SDK.frame.{method-name}`\n */\nexport class FrameController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.shapeController = new ShapeController(this.#editorAPI);\n }\n\n /**\n * This variable helps to redirect shapes related methods to newly introduced ShapeController\n * to avoid any breaking changes\n */\n private shapeController: ShapeController;\n /**\n * This method returns the list of frames\n * @returns list of all frames\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getFrames().then((result) => getEditorResponseData<FrameType[]>(result));\n };\n\n /**\n * This method returns the list of selected frames\n * @returns list of all selected frames\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedFrames().then((result) => getEditorResponseData<FrameType[]>(result));\n };\n\n /**\n * This method returns the list of frames by id\n * @param id the id of a specific page\n * @returns list of all frames by id\n */\n getAllByPageId = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFramesByPageId(id).then((result) => getEditorResponseData<FrameType[]>(result));\n };\n\n /**\n * This method returns a frame by its name\n * @param name the name of a specific frame\n * @returns frame properties\n */\n getByName = async (name: string) => {\n const res = await this.#editorAPI;\n return res.getFrameByName(name).then((result) => getEditorResponseData<FrameType>(result));\n };\n\n /**\n * This method returns a frame by its id\n * @param id the id of a specific frame\n * @returns frame properties\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFrameById(id).then((result) => getEditorResponseData<FrameType>(result));\n };\n\n /**\n * This method returns all frame properties on current layout\n * @returns all frame properties on current layout\n */\n getPropertiesOnSelectedLayout = async () => {\n const res = await this.#editorAPI;\n return res\n .getFramePropertiesOnSelectedLayout()\n .then((result) => getEditorResponseData<FrameLayoutType[]>(result));\n };\n\n /**\n * This method returns frame layout properties for a given frame and layout\n * @param id the id of a specific frame\n * @param layoutId the id of a specific layout\n * @returns frame layout properties\n */\n getLayoutProperties = async (id: Id, layoutId?: Id) => {\n const res = await this.#editorAPI;\n return res\n .getFramePropertiesByFrameId(id, layoutId)\n .then((result) => getEditorResponseData<FrameLayoutType>(result));\n };\n\n /**\n * This method returns a list of frame properties for a given layout\n * @param id the id of a specific layout\n * @returns list of frame layout properties\n */\n getAllLayoutProperties = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFramesProperties(id).then((result) => getEditorResponseData<FrameLayoutType[]>(result));\n };\n\n /**\n * This method will reset the frame size (width and height) to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetSize = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameSize(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will select a specific frame\n * @param id the id of a specific frame\n * @returns\n */\n select = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.selectFrames([id]).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will select multipleFrames\n * @param ids An array of all ids you want to select\n * @returns\n */\n selectMultiple = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.selectFrames(ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method changes the order of frames in the z-index list.\n * @param order the index in the list to move to\n * @param ids An array of all IDs you want to move to the given index\n * @returns\n */\n reorderFrames = async (order: number, ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.reorderFrames(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update the z-index of a frame.\n * @param id the id of the frame you want to change the z-index of\n * @param method the z-index update method to perform\n * @returns\n */\n setZIndex = async (id: Id, method: UpdateZIndexMethod) => {\n const res = await this.#editorAPI;\n return res.setFrameZIndex(id, method).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of a specific frame\n * @param id the id of a specific frame\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setHeight = async (id: Id, height: string) => {\n const res = await this.#editorAPI;\n return res.setFrameHeight(id, height).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the rotation angle of a specific frame\n * @param id the id of a specific frame\n * @param rotation the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setRotation = async (id: Id, rotation: string) => {\n const res = await this.#editorAPI;\n return res.setFrameRotation(id, rotation).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the width of a specific frame\n * @param id the id of a specific frame\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setWidth = async (id: Id, width: string) => {\n const res = await this.#editorAPI;\n return res.setFrameWidth(id, width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the x value of a specific frame\n * @param id the id of a specific frame\n * @param XValue the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setX = async (id: Id, XValue: string) => {\n const res = await this.#editorAPI;\n return res.setFrameX(id, XValue).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the y value of a specific frame\n * @param id the id of a specific frame\n * @param YValue the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setY = async (id: Id, YValue: string) => {\n const res = await this.#editorAPI;\n return res.setFrameY(id, YValue).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update the name of a specific frame\n * @param id the id of a specific frame\n * @param name the new name that the frame should receive\n * @returns\n */\n rename = async (id: Id, name: string) => {\n const res = await this.#editorAPI;\n return res.renameFrame(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset properties of a specific frame to their original values\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n reset = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrame(id).then((result) => getEditorResponseData<null>(result));\n };\n /**\n * This method will reset the x value of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetX = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameX(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the y value of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetY = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameY(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the rotation value of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetRotation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameRotation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the width of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetWidth = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameWidth(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the height of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetHeight = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameHeight(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the fitMode property of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetImageFrameFitMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetImageFrameFitMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated Use `setIsVisible` instead.\n *\n * This method will set the visibility property of a specified frame. If set to false the frame will be invisible and vice versa.\n * @param id the id of the frame that needs to get updated\n * @param value True means the frame gets visible, false means the frame gets invisible\n * @returns\n */\n setVisibility = async (id: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setFrameIsVisible(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the isVisible property of a specified frame. If set to false the frame will be invisible and vice versa.\n * @param id the id of the frame that needs to get updated\n * @param value True means the frame gets visible, false means the frame gets invisible\n * @returns\n */\n setIsVisible = async (id: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setFrameIsVisible(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will remove a specific frame using the Id.\n * @param id the id of the frame that needs to be deleted\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeFrames([id]).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will remove frames with the given ids.\n * @param ids an array of ids of the frames to be removed.\n * @returns\n */\n removeFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.removeFrames(ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will create a new frame of 'type' to the template positioned on the requested\n * coordinates.\n * @param type the type of frame to create\n * @param x X coordinate of the new frame within the template\n * @param y Y coordinate of the new frame within the template\n * @param width Width of the new frame within the template\n * @param height Height of the new frame within the template\n * @returns the newly created frame's id\n */\n create = async (type: FrameTypeEnum, x: number, y: number, width: number, height: number) => {\n const res = await this.#editorAPI;\n return res.addFrame(type, x, y, width, height).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will create a new frame of 'type' type to the template positioned on the requested\n * coordinates.\n * @param type the type of frame to create\n * @param x X coordinate of the new frame within the template\n * @param y Y coordinate of the new frame within the template\n * @param width Width of the new frame within the template\n * @param height Height of the new frame within the template\n * @returns the newly created shape frame's id\n */\n createShapeFrame = async (type: ShapeType, x: number, y: number, width: number, height: number) => {\n const res = await this.#editorAPI;\n return res.addFrame(type, x, y, width, height).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will duplicate a list of frames\n * @param ids An array of all ids you want to duplicate\n * @returns\n */\n duplicateFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.duplicateFrames(ids).then((result) => getEditorResponseData<Id>(result));\n };\n\n\n /**\n * This method sets or removes the image source to the ImageFrame\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param newImageSource A new image source\n * @returns\n */\n private updateImageSource = async (imageFrameId: Id, src: ImageFrameSource | null) => {\n const res = await this.#editorAPI;\n const srcJson = src !== null ? JSON.stringify(src) : null;\n return res.setImageSource(imageFrameId, srcJson).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes the image source from the ImageFrame\n * @param imageFrameId the id of the imageFrame where an image needs to be removed from\n */\n removeImageSource = async (imageFrameId: string) => {\n return this.updateImageSource(imageFrameId, null);\n };\n\n /**\n * This method will assign an image from a mediaConnector to the correct ImageFrame\n * @param id Unique Id of the media connector\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param assetId Unique id of the asset that you want to assign to the imageFrame\n * @returns\n */\n setImageFromConnector = async (imageFrameId: Id, connectorId: Id, assetId: Id) => {\n const src: ImageFrameConnectorSource = {\n id: connectorId,\n assetId,\n type: ImageSourceTypeEnum.connector,\n };\n return this.updateImageSource(imageFrameId, src);\n };\n\n /**\n * This method will assign an image from url to the correct ImageFrame\n * Make sure the url can be accessed by the editor.\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param url A valid image uri\n * @returns\n */\n setImageFromUrl = async (imageFrameId: Id, url: string) => {\n const source: ImageFrameUrlSource = { url: url, type: ImageSourceTypeEnum.url };\n return this.updateImageSource(imageFrameId, source);\n };\n\n /**\n * This method will set the fitMode property of a specified image frame.\n * @param imageFrameId the id of the imageFrame that needs to get updated.\n * @param fitMode the new fitMode that you want to set to the imageFrame.\n * @returns\n */\n setImageFrameFitMode = async (imageFrameId: Id, fitMode: FitMode) => {\n const res = await this.#editorAPI;\n return res.setImageFrameFitMode(imageFrameId, fitMode).then((result) => getEditorResponseData<null>(result));\n };\n /**\n * This method will set the constrainProportions property of a specified frame.\n * @param id the id of the frame that needs to get updated.\n * @param constrainProportions The new constraint that you want to set to the frame.\n * @returns\n */\n setFrameConstrainProportions = async (id: Id, constrainProportions: boolean) => {\n const res = await this.#editorAPI;\n return res\n .setFrameConstrainProportions(id, constrainProportions)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the vertical alignment property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param verticalAlign the new vertical alignment to be set to the frame.\n * @returns\n */\n setVerticalAlign = async (id: Id, verticalAlign: VerticalAlign) => {\n const res = await this.#editorAPI;\n return res.setVerticalAlignment(id, verticalAlign).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the min copyFitting property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new min copyFitting value to be set to the frame.\n * @returns\n */\n setMinCopyfitting = async (id: Id, value: string) => {\n const res = await this.#editorAPI;\n return res.setMinCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the max copyFitting property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new max copyFitting value to be set to the frame.\n * @returns\n */\n setMaxCopyfitting = async (id: Id, value: string) => {\n const res = await this.#editorAPI;\n return res.setMaxCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will enable copyFitting on a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new value to be set to the frame.\n * @returns\n */\n setEnableCopyfitting = async (id: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setEnableCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame minCopyfitting to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetMinCopyfitting = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetMinCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame maxCopyfitting to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetMaxCopyfitting = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetMaxCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame enableCopyfitting to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetEnableCopyfitting = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetEnableCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the visibility of the shape fill.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param enableFill Whether the shape fill is visible.\n * @returns\n */\n setShapeFrameEnableFill = async (shapeFrameId: Id, enableFill: boolean) => {\n return this.shapeController.setEnableFill(shapeFrameId, enableFill);\n };\n\n /**\n * This method will set the shape fill color of a specified shape frame.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param fillColor the new shape fill color that you want to set to the shapeFrame.\n * @returns\n */\n setShapeFrameFillColor = async (shapeFrameId: Id, fillColor: ColorUsage) => {\n return this.shapeController.setFillColor(shapeFrameId, fillColor);\n };\n\n /**\n * This method will set the visibility of the shape stroke.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param enableStroke Whether the shape stroke is visible.\n * @returns\n */\n setShapeFrameEnableStroke = async (shapeFrameId: Id, enableStroke: boolean) => {\n return this.shapeController.setEnableStroke(shapeFrameId, enableStroke);\n };\n\n /**\n * This method will set the shape stroke color of a specified shape frame.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param strokeColor the new shape stroke color that you want to set to the shapeFrame.\n * @returns\n */\n setShapeFrameStrokeColor = async (shapeFrameId: Id, strokeColor: ColorUsage) => {\n return this.shapeController.setStrokeColor(shapeFrameId, strokeColor);\n };\n\n /**\n * This method will set the shape stroke weight of a specified shape frame.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param strokeWeight the new shape stroke weight that you want to set to the shapeFrame.\n * @returns\n */\n setShapeFrameStrokeWeight = async (shapeFrameId: Id, strokeWeight: number) => {\n return this.shapeController.setStrokeWeight(shapeFrameId, strokeWeight);\n };\n\n /**\n * This method will set the blend mode of a specified shape frame\n * @param id the id of a specific frame\n * @param blendMode the blend mode\n * @returns\n */\n setBlendMode = async (id: Id, blendMode: BlendMode) => {\n const res = await this.#editorAPI;\n return res.setFrameBlendMode(id, blendMode).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will make the specified image frame go into cropping mode.\n * @param id the id of a specific image frame\n * @returns\n */\n enterCropMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterCropMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit cropping mode while saving the applied crop.\n * @returns\n */\n applyCropMode = async () => {\n const res = await this.#editorAPI;\n return res.applyCropMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the currently applied crop mode and apply the last selected fit mode again.\n * @param id the id of a specific image frame\n * @returns\n */\n resetCropMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetCropMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit cropping mode without saving the applied crop.\n * @returns\n */\n exitCropMode = async () => {\n const res = await this.#editorAPI;\n return res.cancelCropMode().then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { Id } from './CommonTypes';\nimport { MediaType } from './ConnectorTypes';\n\nexport enum MediaDownloadType {\n thumbnail = 'thumbnail',\n mediumres = 'mediumres',\n highres = 'highres',\n original = 'original',\n}\n\nexport enum MediaDownloadIntent {\n web = 'web',\n}\n\nexport type Media = {\n id: Id;\n name: string;\n relativePath: string;\n type: MediaType;\n extension: string | null;\n metaData: {\n [key: string]: string;\n };\n};\n\nexport interface MediaDetail extends Media {\n width?: number;\n height?: number;\n}\n","import type { EditorAPI, EditorRawAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Layout, MeasurementUnit, LayoutIntent } from '../types/LayoutTypes';\nimport { CallSender } from 'penpal';\n\n/**\n * The LayoutController is responsible for all communication regarding Layouts.\n * Methods inside this controller can be called by `window.SDK.layout.{method-name}`\n */\nexport class LayoutController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\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 returns the list of layouts\n * @returns list of all layouts\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getLayouts().then((result) => getEditorResponseData<Layout[]>(result));\n };\n\n /**\n * This method returns a layout by its id\n * @param id the id of a specific layout\n * @returns layout properties\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getLayoutById(id).then((result) => getEditorResponseData<Layout>(result));\n };\n\n /**\n * This method returns a layout by its name\n * @param name the name of a specific layout\n * @returns layout properties\n */\n getByName = async (name: string) => {\n const res = await this.#editorAPI;\n return res.getLayoutByName(name).then((result) => getEditorResponseData<Layout>(result));\n };\n\n /**\n * This method returns the selected layout\n * @returns layout properties\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedLayout().then((result) => getEditorResponseData<Layout>(result));\n };\n\n /**\n * This method will remove a specific layout\n * @param id the id of a specific layout\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeLayout(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will create a new child layout (a new layout is always child of a root / parent)\n * @param parentId the id of a specific layout, being the parent\n * @returns id of new layout\n */\n create = async (parentId: Id) => {\n const res = await this.#editorAPI;\n return res.addLayout(parentId).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will update the name of a specific layout\n * @param id the id of a specific layout\n * @param name the new name that the layout should receive\n * @returns\n */\n rename = async (id: Id, name: string) => {\n const res = await this.#editorAPI;\n return res.renameLayout(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will select a specific layout\n * @param id the id of a specific layout\n * @returns\n */\n select = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.selectLayout(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will duplicate a specific layout\n * @param id the id of a specific layout\n * @returns id of specific layout\n */\n duplicate = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateLayout(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will reset a specific layout to its original value\n * @param id the id of a specific layout\n * @returns\n */\n reset = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayout(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of the layout to a specific value\n * @param id the id of a specific layout\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setHeight = async (id: Id, height: string) => {\n const res = await this.#editorAPI;\n return res.setLayoutHeight(id, height).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the width of the layout to a specific value\n * @param id the id of a specific layout\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setWidth = async (id: Id, width: string) => {\n const res = await this.#editorAPI;\n return res.setLayoutWidth(id, width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the unit of the layout to a specific value\n *\n * @param id The id of a specific layout\n * @param unit the unit that will be used for the layout. All values in this layout will now be reported in this unit\n * @returns\n */\n setUnit = async (id: Id, unit: MeasurementUnit) => {\n const res = await this.#editorAPI;\n return res.setLayoutUnit(id, unit).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the height of a specific layout to its original value\n * @param id the id of a specific layout\n * @returns\n */\n resetHeight = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutHeight(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the width of a specific layout to its original value\n * @param id the id of a specific layout\n * @returns\n */\n resetWidth = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutWidth(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the unit of a specific layout to its original (inherited) value\n * @param id the id of a specific layout\n * @returns\n */\n resetUnit = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutUnit(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method returns a UInt8Array containing a PNG encoded image of the currently selected layout.\n * @returns UInt8Array snapshot of the current layout\n */\n getSelectedSnapshot = async () => {\n const res = await this.#blobAPI;\n return res.getPageSnapshot().then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * This method sets the intent of a specific layout. Note that setting the intent for a layout\n * can have side-effects such as updating the measurement unit\n * @param id the id of a specific layout\n * @param intent the intent that will be used for the layout\n */\n setIntent = async (id: Id, intent: LayoutIntent) => {\n const res = await this.#editorAPI;\n return res.setLayoutIntent(id, intent).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method resets the intent of a specific layout to its original (inherited) value.\n * Note: Calling this on the top layout is not valid\n *\n * @param id The id of the (child) layout to reset the intent for\n */\n resetIntent = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutIntent(id).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { ConnectorConfigOptions, EditorAPI, EditorRawAPI, EditorResponse, Id, MetaData } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n DeprecatedMediaConnectorDownloadType,\n DeprecatedMediaType,\n MediaConnectorCapabilities,\n MediaType,\n QueryOptions,\n QueryPage,\n} from '../types/ConnectorTypes';\nimport { CallSender } from 'penpal';\nimport { Media, MediaDownloadIntent, MediaDetail, MediaDownloadType } from '../types/MediaConnectorTypes';\n\n/**\n * The MediaConnectorController is responsible for all communication regarding media connectors.\n * Methods inside this controller can be called by `window.SDK.mediaConnector.{method-name}`\n *\n * The way CHILI Studio handles different sources of media is called 'MediaConnectors'. A MediaConnectors is an\n * implementation of a set of capabilities we need to interact with a certain Digital Asset Management system.\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\n * generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class MediaConnectorController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\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 * Query a specific MediaConnector for data using both standardized queryOptions and the dynamic\n * context as parameters. This call returns an array of Media items.\n * @param id unique id of the media connector\n * @param queryOptions stringified instance of `QueryOptions`\n * @param context context that will be available in the connector script.\n * @returns array of Media items\n */\n query = async (id: Id, queryOptions: QueryOptions, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorQuery(id, JSON.stringify(queryOptions), JSON.stringify(context))\n .then((result) => getEditorResponseData<QueryPage<Media>>(result));\n };\n\n /**\n * Returns a single media using a specific MediaConnector.\n *\n * The connector needs to list `detail` as a supported capability.\n * @param id unique id of the Media connector\n * @param mediaId unique id of the Media\n * @param context context that will be available in the connector script.\n * @returns Media item\n */\n detail = async (id: Id, mediaId: string, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorDetail(id, mediaId, JSON.stringify(context))\n .then((result) => getEditorResponseData<MediaDetail>(result));\n };\n\n /**\n * The combination of a `connectorId` and `mediaId` is typically enough for a media connector to\n * perform the download of this asset. The `download` endpoint is capable of relaying this information to the\n * media connector instance running in the editor engine.\n * @param id unique id of the media connector\n * @param mediaId unique id of the media to download\n * @param downloadType hint to the media connector about desired quality of the downloaded media\n * @param context context that will be available in the connector script.\n * @returns\n */\n download = async (\n id: Id,\n mediaId: Id,\n downloadType: MediaDownloadType,\n context: MetaData = {},\n ): Promise<Uint8Array> => {\n const compatibleDownloadType = this.parseDeprecatedMediaDownloadType(\n downloadType as unknown as DeprecatedMediaConnectorDownloadType,\n ) as MediaDownloadType;\n const res = await this.#blobAPI;\n return res\n .mediaConnectorDownload(\n id,\n mediaId,\n compatibleDownloadType,\n MediaDownloadIntent.web,\n JSON.stringify(context),\n )\n .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n * mappings, they will be available in the `context` parameter of any connector method.\n * @param id unique id of the media connector\n * @returns connector mappings\n */\n getConfigurationOptions = async (id: Id) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorGetConfigurationOptions(id)\n .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n };\n\n /**\n * This method returns what capabilities the selected connector has. It gives an indication what methods can\n * be used successfully for a certain connector.\n * @param id unique id of the media connector\n * @returns MediaConnectorCapabilities\n */\n getCapabilities = async (id: Id) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorGetCapabilities(id)\n .then((result) => getEditorResponseData<MediaConnectorCapabilities>(result));\n };\n\n /**\n * This method will parse the deprecatedMediaType to the new media type. This method will be removed once the deprecatedMediaType is out of use\n * @param deprecatedType is 0 or 1\n * @returns connector capabilities\n */\n parseDeprecatedMediaType = (deprecatedType: DeprecatedMediaType) => {\n if (deprecatedType === DeprecatedMediaType.file) return MediaType.file;\n if (deprecatedType === DeprecatedMediaType.collection) return MediaType.collection;\n };\n\n /**\n * This method will parse the deprecatedMediaDownloadType to the new media download type.\n * This method will be removed once the deprecatedMediaDownloadType is out of use\n * @param deprecatedMediaDownloadType legacy download type\n * @returns MediaDownloadType\n */\n parseDeprecatedMediaDownloadType(\n deprecatedMediaDownloadType: DeprecatedMediaConnectorDownloadType,\n ): MediaDownloadType {\n switch (deprecatedMediaDownloadType) {\n case DeprecatedMediaConnectorDownloadType.HighResolutionWeb:\n return MediaDownloadType.highres;\n case DeprecatedMediaConnectorDownloadType.LowResolutionWeb:\n return MediaDownloadType.thumbnail;\n default:\n return deprecatedMediaDownloadType as unknown as MediaDownloadType;\n }\n }\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Page } from '../types/PageTypes';\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 constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of pages\n * @returns list of all pages\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getPages().then((result) => getEditorResponseData<Page[]>(result));\n };\n\n /**\n * This method returns a page by its id\n * @param id the id of a specific page\n * @returns page properties\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getPageById(id).then((result) => getEditorResponseData<Page>(result));\n };\n\n /**\n * This method will set the width of the page to a specific value.\n * This only works if the document is a project.\n * @param id the id of a specific page\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setWidth = async (id: Id, width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(id, width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of the page to a specific value.\n * This only works if the document is a project.\n * @param id the id of a specific page\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The notation is in pixels\n * @returns\n */\n setHeight = async (id: Id, height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(id, height).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ParagraphStyle, ParagraphStyleUpdate } from '../types/ParagraphStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ParagraphStyleController is responsible for all communication regarding paragraph styles.\n * Methods inside this controller can be called by `window.SDK.paragraphStyle.{method-name}`\n */\nexport class ParagraphStyleController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of paragraph styles\n * @returns\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getParagraphStyles().then((result) => getEditorResponseData<ParagraphStyle[]>(result));\n };\n\n /**\n * This method returns a paragraph style by id\n * @param id the id of a specific paragraph style\n * @returns\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getParagraphStyleById(id).then((result) => getEditorResponseData<ParagraphStyle>(result));\n };\n\n /**\n * This method creates a new paragraph style\n * @returns the id of new paragraph style\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createParagraphStyle().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method duplicates a paragraph style\n * @param id the id of a specific paragraph style\n * @returns the new paragraph style id\n */\n duplicate = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateParagraphStyle(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method updates a paragraph style\n * @param id the id of a specific paragraph style\n * @param properties The new paragraph style properties\n * @returns\n */\n update = async (id: Id, properties: ParagraphStyleUpdate) => {\n const res = await this.#editorAPI;\n return res\n .updateParagraphStyle(id, JSON.stringify(properties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method renames a paragraph style\n * @param id the id of a specific paragraph style\n * @param name the new name of the paragraph style\n * @returns\n */\n rename = async (id: Id, name: string) => {\n const res = await this.#editorAPI;\n return res.renameParagraphStyle(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a paragraph style\n * @param id the id of a specific paragraph style\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeParagraphStyle(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method changes positions of paragraph styles\n * @param order the position of the paragraph styles\n * @param ids the list of paragraph styles ids\n * @returns\n */\n move = async (order: number, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.moveParagraphStyles(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { ConfigType, Id } from '../types/CommonTypes';\nimport { MeasurementUnit } from '../types/LayoutTypes';\nimport { ViewMode } from '../types/ViewModeTypes';\nimport { ToolType } from '../utils/enums';\n\n/**\n * The SubscriberController is responsible for all listeners which can influence the application-state from outside.\n * Callbacks inside this controller can be set by `window.SDK.subscriber.{method-name}`\n */\nexport class SubscriberController {\n /**\n * @ignore\n */\n private config: ConfigType;\n\n /**\n * @ignore\n */\n constructor(config: ConfigType) {\n this.config = config;\n }\n\n /**\n * Listener on actions, if this changes, this listener will get triggered with the updates\n * @param actions Stringified array of DocumentAction type\n */\n onActionsChanged = (actions: string) => {\n const callBack = this.config.onActionsChanged;\n callBack && callBack(JSON.parse(actions));\n };\n\n /**\n * Listener on when a certain animation gets changed\n * @param animation Stringified array of FrameAnimationType\n */\n onAnimationChanged = (animation: string) => {\n const callBack = this.config.onFrameAnimationsChanged;\n callBack && callBack(JSON.parse(animation));\n };\n\n /**\n * Listener on the playback state of the animation, it contains the current time of the playback (in milliseconds) and a flag that describes if the animation is currently playing\n * @param animationPlaybackState Stringified array of AnimationPlaybackType\n */\n onAnimationPlaybackChanged = (animationPlaybackState: string) => {\n const callBack = this.config.onScrubberPositionChanged;\n callBack && callBack(JSON.parse(animationPlaybackState));\n };\n\n /**\n * Listener on the state of the currently selected layout, if its properties are changed, this listener will get triggered with the new properties\n * @param layoutProperties Stringified object of LayoutPropertiesType\n */\n onSelectedLayoutPropertiesChanged = (layoutProperties: string) => {\n const callBack = this.config.onSelectedLayoutPropertiesChanged;\n callBack && callBack(JSON.parse(layoutProperties));\n };\n\n /**\n * Listener on the unit of the currently active layout. If you switch between layouts with different units, this listener will get triggered with the new unit\n * If you switch the unit of a layout this listener will get triggered with the new unit\n *\n * @param unit Stringified object of MeasurementUnit\n */\n onSelectedLayoutUnitChanged = (unit: string) => {\n const callBack = this.config.onSelectedLayoutUnitChanged;\n callBack && callBack(unit as MeasurementUnit);\n };\n\n /**\n * Listener on the state of the currently selected frames, if this changes, this listener will get triggered with the updates\n * @param framesLayout Stringified array of FrameLayoutType objects\n */\n onSelectedFramesLayoutChanged = (framesLayout: string) => {\n const frames = JSON.parse(framesLayout);\n const multiFrameCallBack = this.config.onSelectedFramesLayoutChanged;\n multiFrameCallBack && multiFrameCallBack(frames);\n\n const singleFrameCallBack = this.config.onSelectedFrameLayoutChanged;\n singleFrameCallBack && singleFrameCallBack(frames.length > 1 ? undefined : frames[0]);\n };\n\n /**\n * Listener on the state of the currently selected frame, it contains some basic information on the type of frame it is\n * @param framesContent Stringified array of Frame objects\n */\n onSelectedFramesContentChanged = (framesContent: string) => {\n const frames = JSON.parse(framesContent);\n const multiFrameCallBack = this.config.onSelectedFramesContentChanged;\n multiFrameCallBack && multiFrameCallBack(frames);\n\n const singleFrameCallBack = this.config.onSelectedFrameContentChanged;\n singleFrameCallBack && singleFrameCallBack(frames.length > 1 ? null : frames[0]);\n };\n\n /**\n * Listener on the general state of the document, gets triggered every time a change is done on the document.\n */\n onStateChanged = () => {\n const callBack = this.config.onStateChanged;\n callBack && callBack();\n };\n\n /**\n * Listener on authentication expiration.\n * The callback should resolve to the refreshed authentication. If the\n * listener is not defined, the http requests from the connector will return\n * 401 with no refetch of assets.\n *\n * When this emits it means either:\n * - the grafxToken needs to be renewed\n * - any other authentication needs to be renewed (user impersonation, static..)\n *\n * @param authRefreshRequest Stringified object of AuthRefreshRequest\n */\n onAuthExpired = (authRefreshRequest: string) => {\n const callBack = this.config.onAuthExpired;\n\n return callBack\n ? callBack(JSON.parse(authRefreshRequest)).then((auth) => JSON.stringify(auth))\n : new Promise<string | null>((resolve) => resolve(null));\n };\n\n /**\n * Listener on when the document is fully loaded.\n */\n onDocumentLoaded = () => {\n const callBack = this.config.onDocumentLoaded;\n callBack && callBack();\n };\n\n /**\n * To be implemented, gets triggered when clicking on the pageTitle on the canvas.\n */\n onPageSelectionChanged = () => {\n const callBack = this.config.onPageSelectionChanged;\n callBack && callBack();\n };\n\n /**\n * Listener on when variables change\n * @param variablesJson Stringified array of Variable\n */\n onVariableListChanged = (variablesJson: string) => {\n const callBack = this.config.onVariableListChanged;\n callBack && callBack(JSON.parse(variablesJson));\n };\n\n /**\n * Listener on when the tool has changed by the canvas\n * @param tool the string representation of a certain tool\n */\n onSelectedToolChanged = (tool: string) => {\n const callBack = this.config.onSelectedToolChanged;\n callBack && callBack(tool as ToolType);\n };\n\n /**\n * Listener on state changes\n * @param undoState Stringified object of UndoState\n */\n onUndoStateChanged = (undoState: string) => {\n const callBack = this.config.onUndoStackStateChanged;\n callBack && callBack(JSON.parse(undoState));\n };\n\n /**\n * Listener on the state of the currently selected layout's frames, if this changes, this listener will get triggered with the updates\n * @param layoutFrames Stringified object of Frames\n */\n onSelectedLayoutFramesChanged = (layoutFrames: string) => {\n const callBack = this.config.onSelectedLayoutFramesChanged;\n callBack && callBack(JSON.parse(layoutFrames));\n };\n\n /**\n * Listener on the state of the currently selected text's styles, if this changes, this listener will get triggered with the updates\n * @param styles Stringified object of styles\n */\n onSelectedTextStyleChanged = (styles: string) => {\n const callBack = this.config.onSelectedTextStyleChanged;\n callBack && callBack(JSON.parse(styles));\n };\n\n /**\n * Listener on the state of the currently selected color's styles, if this changes, this listener will get triggered with the updates\n * @param colors Stringified object of colors\n */\n onColorsChanged = (colors: string) => {\n const callBack = this.config.onColorsChanged;\n callBack && callBack(JSON.parse(colors));\n };\n\n /**\n * Listener on paragraph styles, if this changes, this listener will get triggered with the updates\n * @param paragraphStyles Stringified object of paragraph styles\n */\n onParagraphStylesChanged = (paragraphStyles: string) => {\n const callBack = this.config.onParagraphStylesChanged;\n callBack && callBack(JSON.parse(paragraphStyles));\n };\n\n /**\n * Listener on character styles, if this changes, this listener will get triggered with the updates\n * @param characterStyles Stringified object of character styles\n */\n onCharacterStylesChanged = (characterStyles: string) => {\n const callBack = this.config.onCharacterStylesChanged;\n callBack && callBack(JSON.parse(characterStyles));\n };\n\n /**\n * Listener on fonts, if this changes, this listener will get triggered with the updates\n * @param fonts Stringified object of font families\n */\n onFontFamiliesChanged = (fonts: string) => {\n const callBack = this.config.onFontFamiliesChanged;\n callBack && callBack(JSON.parse(fonts));\n };\n\n /**\n * Listener on selected layout id, this listener will get triggered when a different layout is selected.\n * @param id the currently selected layout id\n */\n onSelectedLayoutIdChanged = (id: Id) => {\n const callBack = this.config.onSelectedLayoutIdChanged;\n callBack && callBack(id);\n };\n\n /**\n * Listener on layouts, this listener will get triggered when a (sub)layout is\n * - created\n * - removed\n * - renamed\n * - duplicated\n * @param layouts Stringified object of layouts\n */\n onLayoutsChanged = (layouts: string) => {\n const callBack = this.config.onLayoutsChanged;\n callBack && callBack(JSON.parse(layouts));\n };\n\n /**\n * Listener on scale factor of the canvas, this listener will get triggered when a zoom is applied to the canvas\n * @param zoom Stringified scale factor\n */\n onZoomChanged = (zoom: string) => {\n const callBack = this.config.onZoomChanged;\n callBack && callBack(JSON.parse(zoom));\n };\n\n /**\n * Listener on connector events, this listener will get triggered when a connector emits one of those events\n * - reloadRequired\n * - authChanged\n * - unloaded\n * - stateChanged\n *\n * stateChanged - this event will be triggered by connector states: loading, loaded, running, ready, error\n * @param connectorEvent Stringified object of ConnectorEvent\n */\n onConnectorEvent = (connectorEvent: string) => {\n const callBack = this.config.onConnectorEvent;\n callBack && callBack(JSON.parse(connectorEvent));\n };\n\n /**\n * Listener on page size, this listener will get triggered when the page size is changed, while the document is a `project`.\n * This will not emit anything if your document is a `template`.\n * @param pageSize Stringified object of the PageSize\n */\n onPageSizeChanged = (pageSize: string) => {\n const callBack = this.config.onPageSizeChanged;\n callBack && callBack(JSON.parse(pageSize));\n };\n\n /**\n * Listener on corner radii of rectangle and polygon shapes, this listener will get triggered when any corner radius is changed\n * @param cornerRadius Stringified object of the CornerRadius\n */\n onShapeCornerRadiusChanged = (cornerRadius: string) => {\n const callBack = this.config.onShapeCornerRadiusChanged;\n callBack && callBack(JSON.parse(cornerRadius));\n };\n\n /**\n * Listener of editor entering / exiting the crop mode\n * @param id frame id when entering / null when exiting\n */\n onCropActiveFrameIdChanged = (id?: Id) => {\n const callBack = this.config.onCropActiveFrameIdChanged;\n callBack && callBack(id);\n };\n\n /**\n * Listener on async errors.\n * Async errors are thrown at times not directly tied to SDK calls.\n * e.g. Getting an action error triggered after a late event.\n *\n * If this is an `ActionAsyncError`:\n * - `id` refers to the action id\n * - `event` refers to the event that triggered the action\n * - `eventChain` refers the chain of events that lead to the action, first\n * item being the closest parent.\n * @param asyncError error triggered asynchronously\n */\n onAsyncError = (asyncError: string) => {\n const callBack = this.config.onAsyncError;\n callBack && callBack(JSON.parse(asyncError));\n };\n\n /**\n * Listener on when the view mode has changed\n * @param viewMode the string representation of a view mode\n */\n onViewModeChanged = (viewMode: string) => {\n const callBack = this.config.onViewModeChanged;\n callBack && callBack(viewMode as ViewMode);\n };\n}\n","export enum FramePropertyNames {\n FRAME_X = 'frameX',\n FRAME_Y = 'frameY',\n WIDTH = 'width',\n HEIGHT = 'height',\n FRAME_ROTATION = 'frameRotation',\n}\nexport enum LayoutPropertyNames {\n LAYOUT_HEIGHT = 'layoutHeight',\n LAYOUT_WIDTH = 'layoutWidth',\n}\n\nexport enum ToolType {\n SELECT = 'select',\n ZOOM = 'zoom',\n HAND = 'hand',\n IMAGE_FRAME = 'imageFrame',\n TEXT_FRAME = 'textFrame',\n SHAPE_RECT = 'rect',\n SHAPE_ELLIPSE = 'ellipse',\n SHAPE_POLYGON = 'polygon',\n}\nexport enum DownloadFormats {\n MP4 = 'mp4',\n GIF = 'gif',\n PNG = 'png',\n JPG = 'jpg',\n EXPERIMENTAL_PDF = 'pdf',\n}\n\nexport enum EnvironmentType {\n SANDBOX = 'sandbox',\n PRODUCTION = 'online',\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { SelectedTextStyle, TextStyleUpdateType } from '../types/TextStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The TextStyleController is responsible for all communication regarding text styles.\n * Methods inside this controller can be called by `window.SDK.textStyle.{method-name}`\n */\nexport class TextStyleController {\n /**\n * @ignore\n */\n readonly #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method updates a selected Text's style properties\n * @returns\n */\n set = async (style: TextStyleUpdateType) => {\n const res = await this.#editorAPI;\n return res\n .selectedTextStyleDeltaUpdate(JSON.stringify(style))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a selected Text's style properties\n * If the text is selected, then the inline style properties will be removed\n * If the text is not selected and user tried to change any style property, the temporary style will be removed\n * if there is no text selection and there is no temporary style, the inline paragraph properties will be removed\n * @returns\n */\n removeSelected = async () => {\n const res = await this.#editorAPI;\n return res.selectedTextStyleClean().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets a selected Text's style properties\n * @returns\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedTextStyle().then((result) => getEditorResponseData<SelectedTextStyle>(result));\n };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { ToolType } from '../utils/enums';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ToolController is responsible for all communication regarding the tools.\n * Methods inside this controller can be called by `window.SDK.tool.{method-name}`\n */\nexport class ToolController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method sets the currently used tool\n * @param tool\n */\n setTool = async (tool: ToolType) => {\n const res = await this.#editorAPI;\n return res.setTool(tool).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method returns selected tool\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedTool().then((result) => getEditorResponseData<ToolType>(result));\n };\n\n /**\n * This method sets the used tool to a Pointer tool\n */\n setPointer = async () => {\n return this.setTool(ToolType.SELECT);\n };\n\n /**\n * This method sets the used tool to a Move tool\n */\n setHand = async () => {\n return this.setTool(ToolType.HAND);\n };\n\n /**\n * This method sets the used tool to a Zoom tool\n */\n setZoom = async () => {\n return this.setTool(ToolType.ZOOM);\n };\n\n /**\n * This method sets the used tool to a TextFrame tool\n */\n setTextFrame = async () => {\n return this.setTool(ToolType.TEXT_FRAME);\n };\n\n /**\n * This method sets the used tool to a ImageFrame tool\n */\n setImageFrame = async () => {\n return this.setTool(ToolType.IMAGE_FRAME);\n };\n\n /**\n * This method sets the used tool to a ShapeRectangle tool\n */\n setShapeRect = async () => {\n return this.setTool(ToolType.SHAPE_RECT);\n };\n\n /**\n * This method sets the used tool to a ShapeEllipse tool\n */\n setShapeEllipse = async () => {\n return this.setTool(ToolType.SHAPE_ELLIPSE);\n };\n\n /**\n * This method sets the used tool to a ShapePolygon tool\n */\n setShapePolygon = async () => {\n return this.setTool(ToolType.SHAPE_POLYGON);\n };\n}\n","import SDK from '..';\nimport { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The UndoManagerController is responsible for all communication regarding the Undo-Manager.\n * Methods inside this controller can be called by `window.SDK.undoManager.{method-name}`\n */\nexport class UndoManagerController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n #advanced: AdvancedUndoManagerController;\n #sdk: SDK;\n\n /**\n * @ignore\n */\n constructor(children: EditorAPI, sdk: SDK) {\n this.#editorAPI = children;\n this.#sdk = sdk;\n this.#advanced = new AdvancedUndoManagerController(children);\n }\n\n /**\n * This method undoes the last operation\n * @returns\n */\n undo = async () => {\n const res = await this.#editorAPI;\n return res.undo().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method redoes the last operation\n * @returns\n */\n redo = async () => {\n const res = await this.#editorAPI;\n return res.redo().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Record any operations in the current scope. This will automatically begin\n * the undo operation. Once you leave the record scope, it will end the undo operation.\n * Even if you throw an exception inside the record scope it will still end it properly.\n * @returns\n */\n record = async (operationName: string, undoOperationCallback: (sdk: SDK) => void) => {\n try {\n await this.#advanced.beginIfNoneActive(operationName);\n\n await undoOperationCallback(this.#sdk);\n } catch (error) {\n throw error;\n } finally {\n await this.#advanced.end();\n }\n };\n}\n\nexport class AdvancedUndoManagerController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(children: EditorAPI) {\n this.#editorAPI = children;\n }\n\n /**\n * This will start a new undo operation.\n * This will throw an exception when there is already an undo operation recording.\n * @returns\n */\n begin = async (operationName: string) => {\n const res = await this.#editorAPI;\n return res.begin(operationName).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This will start a new undo operation if there is no other undo operation recording.\n * This does not throw.\n * @returns\n */\n beginIfNoneActive = async (operationName: string) => {\n const res = await this.#editorAPI;\n return res.beginIfNoneActive(operationName).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Ends the currently active recording operation.\n * If there is no recording operation currently running this will throw an exception.\n * @returns\n */\n end = async () => {\n const res = await this.#editorAPI;\n return res.end().then((result) => getEditorResponseData<null>(result));\n };\n}\n","export const round = (val: number, precision = 2) => {\n const hundred = Math.pow(10, precision);\n return Math.round(val * hundred) / hundred;\n};\n","import { round } from '../utils/MathUtils';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { EnvironmentType } from '../utils/enums';\n\n/**\n * The UtilsController exposes a set of useful utilities that can be used to make some repeated tasks a bit easier\n * Methods inside this controller can be called by `window.SDK.utils.{method-name}`\n */\nexport class UtilsController {\n /**\n * This method can round a value to a certain precision, default is 2\n * @param val the value that needs to be rounded\n * @param precision the precision of the rounding operation\n * @returns the rounded value as a number\n */\n round = (val: number, precision?: number) =>\n getEditorResponseData<number>({\n data: String(round(val, precision)),\n success: true,\n status: 200,\n parsedData: null,\n });\n\n createEnvironmentBaseURL = (parameters: { type?: EnvironmentType; environment?: string; version?: string }) => {\n const { type = EnvironmentType.SANDBOX, environment = 'ft-nostress', version = '1' } = parameters;\n const host = type == EnvironmentType.SANDBOX ? 'chili-publish-sandbox' : 'chili-publish';\n return `https://${environment}.${host}.online/grafx/api/v${version}/environment/${environment}`;\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ConnectorRegistration } from '../types/ConnectorTypes';\nimport { Variable, VariableType } from '../types/VariableTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\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 /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\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.getVariables().then((result) => getEditorResponseData<Variable[]>(result));\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.getVariableById(id).then((result) => getEditorResponseData<Variable>(result));\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.getVariableByName(name).then((result) => getEditorResponseData<Variable>(result));\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) => {\n const res = await this.#editorAPI;\n return res.setVariableLabel(id, label).then((result) => getEditorResponseData<null>(result));\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 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.setListVariableItems(id, items).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new value for a variable\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 | null) => {\n const res = await this.#editorAPI;\n return res.setVariableValue(id, value).then((result) => getEditorResponseData<null>(result));\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 * This method sets isVisible flag for a variable\n * @returns\n */\n setIsVisible = async (id: string, isVisible: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsVisible(id, isVisible).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated Use `setIsVisible` instead.\n *\n * This method sets isHidden flag for a variable\n * @returns\n */\n setIsHidden = async (id: string, isHidden: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsVisible(id, !isHidden).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 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 return res\n .setImageVariableConnector(id, JSON.stringify(registration))\n .then((result) => getEditorResponseData<Id>(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","import engineInfo from '../../editor-engine.json';\nimport sdkInfo from '../../package.json';\n\n/**\n * The InfoController is responsible for getting info on the engine, like version f.e. .\n * Methods and properties inside this controller can be accessed by `window.SDK.engine.{name}`\n */\nexport class InfoController {\n /**\n * This property returns the current engine version.\n * @returns current engine version\n */\n currentEngineVersion = engineInfo.current;\n\n /**\n * @returns The currently applicable SDK version\n */\n currentSDKVersion = sdkInfo.version;\n}\n","import { ClipboardContentType } from '../types/ClipboardTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ClipboardController is responsible for all communication regarding clipboard.\n * Methods inside this controller can be called by `window.SDK.clipboard.{method-name}`\n */\nexport class ClipboardController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method will copy the frames to the OS clipboard as a json frame\n * @param ids An array of all frame ids you want to copy\n * @returns\n */\n copyFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n const frameData = await res.copyFrames(ids);\n\n if (frameData.data) {\n await navigator.clipboard.writeText(frameData.data);\n }\n\n return getEditorResponseData<null>(frameData);\n };\n\n /**\n * This method will remove the frames and store them to the OS clipboard as\n * a json frame\n * @param ids An array of all frame ids you want to cut\n * @returns\n */\n cutFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n const frameData = await res.cutFrames(ids);\n\n if (frameData.data) {\n await navigator.clipboard.writeText(frameData.data);\n }\n\n return getEditorResponseData<null>(frameData);\n };\n\n /**\n * This method will paste the OS clipboard content to the editor as frames\n * @returns\n */\n pasteFrames = async () => {\n const res = await this.#editorAPI;\n\n const clipboardData = await navigator.clipboard.readText();\n const result = await res.pasteFrames(clipboardData);\n\n return getEditorResponseData<null>(result);\n }\n\n /**\n * This method will get the content type of the OS clipboard\n * @returns content type\n */\n getContentType = async () => {\n const res = await this.#editorAPI;\n\n const clipboardData = await navigator.clipboard.readText();\n const result = await res.getClipboardContentType(clipboardData);\n\n return getEditorResponseData<ClipboardContentType>(result);\n }\n}\n\n\n","import { Connection } from 'penpal';\nimport Connect from './interactions/connector';\nimport { defaultStudioOptions, WellKnownConfigurationKeys } from './types/ConfigurationTypes';\nimport packageInfo from '../package.json';\nimport engineInfo from '../editor-engine.json';\n\nimport type { ConfigType, EditorAPI } from './types/CommonTypes';\nimport { DocumentType } from './types/DocumentTypes';\n\nimport { ActionController } from './controllers/ActionController';\nimport { AnimationController } from './controllers/AnimationController';\nimport { CanvasController } from './controllers/CanvasController';\nimport { CharacterStyleController } from './controllers/CharacterStyleController';\nimport { ColorStyleController } from './controllers/ColorStyleController';\nimport { ColorConversionController } from './controllers/ColorConversionController';\nimport { ConfigurationController } from './controllers/ConfigurationController';\nimport { ConnectorController } from './controllers/ConnectorController';\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 { LayoutController } from './controllers/LayoutController';\nimport { MediaConnectorController } from './controllers/MediaConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { ParagraphStyleController } from './controllers/ParagraphStyleController';\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 { ShapeController } from './controllers/ShapeController';\nimport { InfoController } from './controllers/InfoController';\nimport { ClipboardController } from './controllers/ClipboardController';\n\nlet connection: Connection;\n\nconst FIXED_EDITOR_LINK = 'https://studio-cdn.chiligrafx.com/editor/' + engineInfo.current + '/web';\n\nexport class SDK {\n config: ConfigType;\n connection: Connection;\n\n /**\n * @ignore\n */\n editorAPI: EditorAPI;\n\n action: ActionController;\n layout: LayoutController;\n frame: FrameController;\n shape: ShapeController;\n connector: ConnectorController;\n mediaConnector: MediaConnectorController;\n fontConnector: FontConnectorController;\n animation: AnimationController;\n document: DocumentController;\n configuration: ConfigurationController;\n variable: VariableController;\n utils: UtilsController;\n tool: ToolController;\n page: PageController;\n debug: DebugController;\n undoManager: UndoManagerController;\n textSelection: TextStyleController;\n paragraphStyle: ParagraphStyleController;\n characterStyle: CharacterStyleController;\n colorStyle: ColorStyleController;\n font: FontController;\n experiment: ExperimentController;\n canvas: CanvasController;\n colorConversion: ColorConversionController;\n info: InfoController;\n clipboard: ClipboardController;\n\n private subscriber: SubscriberController;\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 = config;\n this.connection = connection;\n this.editorAPI = connection?.promise.then((child) => {\n return child;\n }) as unknown as EditorAPI;\n\n this.action = new ActionController(this.editorAPI);\n this.layout = new LayoutController(this.editorAPI);\n this.frame = new FrameController(this.editorAPI);\n this.shape = new ShapeController(this.editorAPI);\n this.undoManager = new UndoManagerController(this.editorAPI, this);\n this.connector = new ConnectorController(this.editorAPI);\n this.mediaConnector = new MediaConnectorController(this.editorAPI);\n this.fontConnector = new FontConnectorController(this.editorAPI);\n this.animation = new AnimationController(this.editorAPI);\n this.document = new DocumentController(this.editorAPI);\n this.configuration = new ConfigurationController(this.editorAPI);\n this.variable = new VariableController(this.editorAPI);\n this.utils = new UtilsController();\n this.subscriber = new SubscriberController(this.config);\n this.tool = new ToolController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.debug = new DebugController(this.editorAPI);\n // To be renamed textSelection > textStyle\n this.textSelection = new TextStyleController(this.editorAPI);\n this.colorStyle = new ColorStyleController(this.editorAPI);\n this.paragraphStyle = new ParagraphStyleController(this.editorAPI);\n this.characterStyle = new CharacterStyleController(this.editorAPI);\n this.font = new FontController(this.editorAPI);\n this.experiment = new ExperimentController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n this.colorConversion = new ColorConversionController(this.editorAPI);\n this.info = new InfoController();\n this.clipboard = new ClipboardController(this.editorAPI);\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 onDocumentLoaded: this.subscriber.onDocumentLoaded,\n onSelectedFramesContentChanged: this.subscriber.onSelectedFramesContentChanged,\n onSelectedFramesLayoutChanged: this.subscriber.onSelectedFramesLayoutChanged,\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: this.subscriber.onVariableListChanged,\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 onZoomChanged: this.subscriber.onZoomChanged,\n onPageSizeChanged: this.subscriber.onPageSizeChanged,\n onShapeCornerRadiusChanged: this.subscriber.onShapeCornerRadiusChanged,\n onCropActiveFrameIdChanged: this.subscriber.onCropActiveFrameIdChanged,\n onAsyncError: this.subscriber.onAsyncError,\n onViewModeChanged: this.subscriber.onViewModeChanged,\n },\n this.setConnection,\n this.config.editorId,\n this.config.studioStyling,\n );\n this.editorAPI = connection?.promise.then((editorAPI) => {\n return editorAPI;\n }) as unknown as EditorAPI;\n\n this.action = new ActionController(this.editorAPI);\n this.layout = new LayoutController(this.editorAPI);\n this.frame = new FrameController(this.editorAPI);\n this.animation = new AnimationController(this.editorAPI);\n this.document = new DocumentController(this.editorAPI);\n this.configuration = new ConfigurationController(this.editorAPI);\n this.utils = new UtilsController();\n this.tool = new ToolController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.debug = new DebugController(this.editorAPI);\n this.undoManager = new UndoManagerController(this.editorAPI, this);\n this.textSelection = new TextStyleController(this.editorAPI);\n this.colorStyle = new ColorStyleController(this.editorAPI);\n this.paragraphStyle = new ParagraphStyleController(this.editorAPI);\n this.characterStyle = new CharacterStyleController(this.editorAPI);\n this.mediaConnector = new MediaConnectorController(this.editorAPI);\n this.fontConnector = new FontConnectorController(this.editorAPI);\n this.connector = new ConnectorController(this.editorAPI);\n this.variable = new VariableController(this.editorAPI);\n this.font = new FontController(this.editorAPI);\n this.experiment = new ExperimentController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n this.shape = new ShapeController(this.editorAPI);\n this.info = new InfoController();\n this.clipboard = new ClipboardController(this.editorAPI);\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\n setConnection = (newConnection: Connection) => {\n connection = newConnection;\n };\n}\n\nexport default SDK;\n","import { Id } from './CommonTypes';\n\nexport enum SlideDirections {\n top = 'top',\n left = 'left',\n right = 'right',\n bottom = 'bottom',\n topLeft = 'topLeft',\n topRight = 'topRight',\n bottomLeft = 'bottomLeft',\n bottomRight = 'bottomRight',\n}\n\nexport enum ShakeDirections {\n horizontal = 'horizontal',\n vertical = 'vertical',\n}\n\nexport enum EaseTypes {\n easeIn = 'easeIn',\n easeOut = 'easeOut',\n easeInOut = 'easeInOut',\n}\n\nexport enum TweenTypes {\n quadratic = 'Quadratic',\n cubic = 'Cubic',\n quartic = 'Quartic',\n quintic = 'Quintic',\n sine = 'Sine',\n exponential = 'Exponential',\n circular = 'Circular',\n elastic = 'Elastic',\n bounce = 'Bounce',\n back = 'Back',\n}\n\nexport enum BasicAnimationsEmphasisStyles {\n bounce = 'bounce',\n flash = 'flash',\n headshake = 'headShake',\n heartbeat = 'heartbeat',\n pulse = 'pulse',\n rubberBand = 'rubberBand',\n vertical = 'vertical',\n horizontal = 'horizontal',\n swing = 'swing',\n tada = 'tada',\n}\n\nexport type EaseTweenCombinationType = `${EaseTypes}${TweenTypes}` | 'noEase';\n\nexport type BasicAnimationsIntroOutroStylesType = {\n slide?: {\n direction: SlideDirections;\n offsetPercent: number;\n };\n rotation?: {\n angleDegrees: number;\n numberOfRotations?: number;\n };\n scale?: {\n scalePercent: number;\n };\n fade?: boolean;\n};\n\nexport type BasicAnimationsIntroType = {\n from: number;\n to: number;\n ease: EaseTweenCombinationType;\n styles: BasicAnimationsIntroOutroStylesType;\n};\n\nexport type BasicAnimationsEmphasisType = {\n from: number;\n to: number;\n ease: EaseTweenCombinationType;\n styles: {\n bounce?: boolean;\n flash?: boolean;\n pulse?: boolean;\n rubberBand?: boolean;\n shake?: {\n direction: ShakeDirections;\n };\n vertical?: boolean;\n horizontal?: boolean;\n headshake?: boolean;\n swing?: boolean;\n tada?: boolean;\n heartbeat?: boolean;\n };\n};\n\nexport type BasicAnimationsOutroType = {\n from: number;\n to: number;\n ease: EaseTweenCombinationType;\n styles: BasicAnimationsIntroOutroStylesType;\n};\n\nexport type BasicAnimationsType = {\n intro?: BasicAnimationsIntroType;\n emphasis?: BasicAnimationsEmphasisType;\n outro?: BasicAnimationsOutroType;\n};\n\nexport type FrameAnimationPropertiesType = {\n id: Id;\n from: number;\n to: number;\n basicAnimations: BasicAnimationsType;\n advancedAnimations?: unknown; // TBI\n};\nexport type FrameAnimationType = {\n animation: FrameAnimationPropertiesType;\n isOverride: boolean;\n};\n\nexport type AnimationPlaybackType = {\n currentAnimationTimeMs: number;\n animationIsPlaying: boolean;\n} | null;\n","import { Id, PropertyState } from './CommonTypes';\n\nexport type LayoutPropertiesType = {\n id: Id;\n width: { value: number; isOverride: boolean };\n height: { value: number; isOverride: boolean };\n timelineLengthMs: { value: number; isOverride: boolean };\n [key: string]: number | string | Record<string, unknown>;\n} | null;\n\nexport type FrameProperties = {\n id: Id;\n type: string;\n height: number | null;\n isVisible: boolean | null;\n rotationDegrees: number | null;\n scaleX: number | null;\n scaleY: number | null;\n width: number | null;\n x: number | null;\n y: number | null;\n};\n\nexport type LayoutWithFrameProperties = {\n id: Id;\n name: string;\n parentId?: Id;\n frameProperties: FrameProperties[];\n width: number | null;\n height: number | null;\n childLayouts: Id[];\n type: LayoutType;\n timelineLengthMs?: number;\n children?: LayoutWithFrameProperties[];\n intent: LayoutIntent | null;\n};\n\n// used by new getter methods\nexport type Layout = {\n id: Id;\n name: string;\n parentId?: Id;\n width: PropertyState<number>;\n height: PropertyState<number>;\n childLayouts: Id[];\n timelineLengthMs: PropertyState<number>;\n unit: PropertyState<MeasurementUnit>;\n intent: PropertyState<LayoutIntent>;\n};\n\n// used by onLayoutsChanged\nexport type LayoutListItemType = {\n id: string;\n name: string;\n type: LayoutType;\n parentId?: Id | null;\n childLayouts: Id[];\n};\n\nexport enum LayoutType {\n top = 'top',\n child = 'child',\n}\n\nexport enum MeasurementUnit {\n px = 'px',\n mm = 'mm',\n cm = 'cm',\n inch = 'inch',\n pt = 'pt',\n}\n\nexport enum LayoutIntent {\n print = 'print',\n digitalStatic = 'digitalStatic',\n digitalAnimated = 'digitalAnimated',\n}\n","export enum ViewMode {\n preview = 'preview',\n normal = 'normal',\n}\n","export interface ConnectorImageVariableSource {\n connectorId: string;\n /**\n * The requested asset id or name\n */\n assetId: string;\n /**\n * If the connector was able to query, this will contain\n * the actual resolved media Id.\n */\n resolved?: ResolvedMedia;\n}\n\n/**\n * Image variable query lookup result\n */\nexport interface ResolvedMedia {\n /**\n * The resolved media Id.\n * This id can be used to perform the download call.\n */\n mediaId: string;\n}\n\nexport enum VariableType {\n shortText = 'shortText',\n longText = 'longText',\n image = 'image',\n list = 'list',\n boolean = 'boolean',\n group = 'group',\n}\n\nexport interface Variable {\n id: string;\n type: VariableType;\n parentId?: string;\n name: string;\n label: string;\n isVisible: boolean;\n isReadonly: boolean;\n isRequired: boolean;\n occurrences: number;\n}\n\nexport interface ImageVariable extends Variable {\n value?: ConnectorImageVariableSource;\n}\n\nexport interface ListVariable extends Variable {\n items: string[];\n selected?: string;\n}\n\nexport interface BooleanVariable extends Variable {\n value: boolean;\n}\n\nexport interface ShortTextVariable extends Variable {\n value: string;\n}\n\nexport type LongTextVariable = ShortTextVariable;\n\nexport type GroupVariable = Variable;\n","import { VerticalAlign } from './FrameTypes';\nimport { ColorUsage } from './ColorStyleTypes';\n\nexport enum FontWeights {\n BOLD = 'Bold',\n ITALIC = 'Italic',\n REGULAR = 'Regular',\n}\nexport enum Alignment {\n LEFT = 'left',\n CENTER = 'center',\n RIGHT = 'right',\n JUSTIFY = 'justify',\n}\n\nexport enum TextPosition {\n TOP = 'top',\n CENTER = 'center',\n BOTTOM = 'bottom',\n}\nexport enum Case {\n TO_LOWER_CASE = 'lowercase',\n TO_UPPER_CASE = 'uppercase',\n NORMAL = 'normal',\n}\nexport enum Scripting {\n SUPERSCRIPT = 'superscript',\n SUBSCRIPT = 'subscript',\n NORMAL = 'normal',\n}\n\nexport type DisplayColor = ColorUsage & {\n isApplied: boolean;\n};\nexport interface TextProperties {\n fontKey?: string;\n fontStyle?: FontWeights;\n fontSize?: number;\n textAlign?: Alignment;\n verticalAlign?: VerticalAlign;\n underline?: boolean;\n lineThrough?: boolean;\n letterSpacing?: string;\n trackingRight?: string;\n lineHeight?: number;\n SUB_SUPER_SCRIPT?: Scripting;\n typographicCase?: Case;\n color?: DisplayColor;\n [key: string]: number | string | Record<string, unknown> | null | boolean | undefined;\n}\n\nexport interface TextStyle {\n paragraph?: string;\n character?: string;\n [key: string]: number | string | Record<string, unknown> | null | boolean | undefined;\n}\nexport type TextStyleUpdateType = {\n [key in keyof typeof SelectedTextStyles]?: {\n value: number | string | boolean;\n };\n};\n\nexport interface AppearanceProperties {\n blendMode?: string;\n opacity?: string;\n useFill?: boolean;\n useStroke?: boolean;\n useDropShadow?: boolean;\n fillColor?: string;\n strokeColor?: string;\n dropShadowColor?: string;\n}\n\nexport interface SelectedTextStyle {\n paragraphStyleId?: string;\n characterStyleId?: string;\n fontKey?: string;\n fontSize?: number;\n typographicCase?: Case;\n kerningOn?: boolean;\n subSuperScript?: Scripting;\n trackingLeft?: number;\n trackingRight?: number;\n paragraphIndentStart?: string;\n paragraphIndentEnd?: string;\n paragraphSpaceBefore?: string;\n paragraphSpaceAfter?: string;\n textIndent?: string;\n alignToBaseLine?: boolean;\n baselineShiftValue?: string;\n lineHeight?: number;\n verticalAlign?: VerticalAlign;\n copyfittingScale?: number;\n textAlign?: HorizontalAlign;\n textAlignLast?: HorizontalAlign;\n textOverprint?: boolean;\n color?: DisplayColor;\n underline?: boolean;\n lineThrough?: boolean;\n hasLocalFormatting: boolean;\n}\n\nexport enum HorizontalAlign {\n left = 'left',\n center = 'center',\n right = 'right',\n justify = 'justify',\n}\n\nexport enum SelectedTextStyleSections {\n STYLE = 'textStyle',\n PROPERTIES = 'textProperties',\n APPEARANCE = 'appearance',\n}\n\nexport enum SelectedTextStyles {\n PARAGRAPH = 'paragraphStyleId',\n CHARACTER = 'characterStyleId',\n FONT_FAMILY = 'fontKey',\n FONT_STYLE = 'fontStyle',\n FONT_SIZE = 'fontSize',\n LETTER_SPACING = 'letterSpacing',\n LINE_HEIGHT = 'lineHeight',\n TEXT_ALIGN = 'textAlign',\n VERTICAL_ALIGN = 'verticalAlign',\n TYPOGRAPHIC_CASE = 'typographicCase',\n SUB_SUPER_SCRIPT = 'subSuperScript',\n UNDERLINE = 'underline',\n LINE_THROUGH = 'lineThrough',\n FILL_COLOR = 'fillColor',\n COLOR = 'color',\n FILL_COLOR_APPLIED = 'fillColorApplied',\n STROKE_COLOR = 'strokeColor',\n DROP_SHADOW_COLOR = 'dropShadowColor',\n BLEND_MODE = 'blendMode',\n OPACITY = 'opacity',\n TRACKING_RIGHT = 'trackingRight',\n BASELINE_SHIFT = 'baselineShiftValue',\n}\n\nexport interface UpdateStyleType {\n path: { value: number | string | Record<string, unknown> | null | boolean | undefined };\n}\n","import { Id } from './CommonTypes';\n\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n spot = 'spot',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color = RGBColor | CMYKColor | HSLColor | GrayColor | SpotColor | HexColor;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the stylekit color, can only be used if it is a stylekit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the stylekit color, can only be used if it is a stylekit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * THe color is referencing a stylekit color\n */\n stylekit = 'stylekit',\n}\n","import { Id } from './CommonTypes';\n\nexport enum FontPreviewFormat {\n Square = 'square',\n Line = 'line',\n}\n\nexport type FontFamily = {\n id: Id;\n name: string;\n fontStylesCount: number;\n extensions: string[];\n};\n\nexport type FontStyle = {\n id: Id;\n name: string;\n familyId: string;\n familyName: string;\n};\n","import { Id } from './CommonTypes';\n\n/**\n * Editor Events that Actions can react to.\n */\nexport enum ActionEditorEvent {\n /**\n * Indicates the selected layout changed.\n */\n selectedLayoutChanged = 'selectedLayoutChanged',\n\n /**\n * Indicates a frame was moved, resized, rotated.\n * Note: this does not trigger when a different layout is selected.\n */\n frameMoved = 'frameMoved',\n\n /**\n * Indicates the size of a page has changed.\n */\n pageSizeChanged = 'pageSizeChanged',\n\n /**\n * Indicates the document is fully initialized, actions can safely be executed.\n * Note: the other events will only be triggered after a document is fully initialized.\n */\n documentLoaded = 'documentLoaded',\n\n /**\n * Indicates the value of a variable changed.\n */\n variableValueChanged = 'variableValueChanged',\n}\n\n/**\n * Action used by the document.\n */\nexport interface DocumentAction {\n /**\n * Unique Id of the action.\n */\n id: Id;\n\n /**\n * Unique action name\n */\n name: string;\n\n /**\n * All the triggers this action will react to.\n */\n triggers: ActionTrigger[];\n\n /**\n * The JavaScript based action script.\n */\n script: string;\n}\n\n/**\n * Trigger used to fire an action.\n */\nexport type ActionTrigger =\n | SelectedLayoutChangedTrigger\n | FrameMovedTrigger\n | PageSizeChangedTrigger\n | DocumentLoadedTrigger\n | VariableValueChangedTrigger;\n\nexport interface SelectedLayoutChangedTrigger {\n event: ActionEditorEvent.selectedLayoutChanged;\n}\n\n/**\n * Model to update an Action.\n */\nexport type ActionDeltaUpdate = {\n /**\n * The new Action JS script.\n */\n script?: string;\n\n /**\n * The new name of the Action.\n */\n name?: string;\n\n /**\n * Whether the Action has any typing errors.\n */\n hasTypeError?: boolean;\n\n /**\n * The new list of triggers.\n */\n triggers?: ActionTrigger[];\n};\n\nexport interface FrameMovedTrigger {\n event: ActionEditorEvent.frameMoved;\n /**\n * The frame id's this trigger should react to.\n * Leaving this `undefined`, will make this trigger react to any frame that moves in any direction (also rotation, resize and ).\n */\n triggers?: Id[];\n}\n\nexport interface PageSizeChangedTrigger {\n event: ActionEditorEvent.pageSizeChanged;\n}\n\nexport interface DocumentLoadedTrigger {\n event: ActionEditorEvent.documentLoaded;\n}\n\nexport interface VariableValueChangedTrigger {\n event: ActionEditorEvent.variableValueChanged;\n\n /**\n * The variable id's this trigger should react to.\n * Leaving this `undefined`, will make this trigger react to all variableValueChanges.\n */\n triggers?: Id[];\n}\n","import { ColorUsage } from './ColorStyleTypes';\n\nexport enum ShapeType {\n ellipse = 'ellipse',\n rectangle = 'rectangle',\n polygon = 'polygon',\n}\n\nexport interface ShapeProperties {\n enableFill?: boolean;\n fillColor?: ColorUsage;\n enableStroke?: boolean;\n strokeColor?: ColorUsage;\n strokeWeight?: number;\n allCornersSame?: boolean;\n}\n\nexport interface CornerRadiusUpdateModel {\n radiusAll?: number;\n topLeft?: number;\n bottomLeft?: number;\n topRight?: number;\n bottomRight?: number;\n}\n\nexport interface CornerRadiusNone {\n type: string;\n}\n\nexport interface CornerRadiusAll {\n type: string;\n radius: number;\n}\n\nexport interface CornerRadiusOnly {\n type: string;\n topLeft: number;\n bottomLeft: number;\n topRight: number;\n bottomRight: number;\n}\n\nexport enum CornerRadiusType {\n all = 'all',\n only = 'only',\n none = 'none',\n}\n","import { SDK } from './sdk';\n\nexport { FramePropertyNames, LayoutPropertyNames, ToolType, DownloadFormats, EnvironmentType } from './utils/enums';\n\nexport {\n SlideDirections,\n ShakeDirections,\n EaseTypes,\n TweenTypes,\n BasicAnimationsEmphasisStyles,\n} from './types/AnimationTypes';\nexport { LayoutType, MeasurementUnit, LayoutIntent } from './types/LayoutTypes';\nexport {\n BlendMode,\n FrameTypeEnum,\n VerticalAlign,\n TextDirection,\n FlowDirection,\n FitMode,\n UpdateZIndexMethod,\n ImageSourceTypeEnum,\n} from './types/FrameTypes';\nexport { DocumentType } from './types/DocumentTypes';\n\nexport { ViewMode } from './types/ViewModeTypes';\n\nexport type {\n LayoutPropertiesType,\n FrameProperties,\n LayoutWithFrameProperties,\n LayoutListItemType,\n Layout,\n} from './types/LayoutTypes';\nexport type {\n FrameLayoutType,\n FrameType,\n Frame,\n TextFrame,\n ImageFrame,\n ShapeFrame,\n ImageFrameSource,\n ImageFrameVariableSource,\n ImageFrameUrlSource,\n} from './types/FrameTypes';\nexport type {\n Variable,\n GroupVariable,\n ImageVariable,\n LongTextVariable,\n ShortTextVariable,\n ListVariable,\n BooleanVariable,\n ConnectorImageVariableSource,\n} from './types/VariableTypes';\nexport { VariableType } from './types/VariableTypes';\n\nexport type { Color, DocumentColor, ColorUpdate } from './types/ColorStyleTypes';\n\nexport type { DocumentError } from './types/DocumentTypes';\nexport type {\n FrameAnimationType,\n FrameAnimationPropertiesType,\n EaseTweenCombinationType,\n AnimationPlaybackType,\n BasicAnimationsType,\n} from './types/AnimationTypes';\nexport type {\n ConfigType,\n InitialStateType,\n PageType,\n EditorResponse,\n SelectedLayoutFrame,\n MetaData,\n Id,\n} from './types/CommonTypes';\n\nexport type {\n TextProperties,\n SelectedTextStyle,\n TextStyle,\n AppearanceProperties,\n TextStyleUpdateType,\n UpdateStyleType,\n DisplayColor,\n} from './types/TextStyleTypes';\n\nexport type { ParagraphStyle, ParagraphStyleUpdate } from './types/ParagraphStyleTypes';\nexport type { CharacterStyle, CharacterStyleUpdate } from './types/CharacterStyleTypes';\nexport type { ColorUsage, ColorUsageUpdate, ColorUsageType } from './types/ColorStyleTypes';\n\nexport type {\n DocumentFontStyle,\n DocumentFontFamily,\n AddDocumentFontStyle,\n AddDocumentFontFamily,\n} from './types/FontTypes';\n\nexport {\n SelectedTextStyleSections,\n SelectedTextStyles,\n FontWeights,\n Alignment,\n TextPosition,\n Case,\n Scripting,\n} from './types/TextStyleTypes';\nexport { ColorType } from './types/ColorStyleTypes';\nexport * from './types/MediaConnectorTypes';\nexport * from './types/FontConnectorTypes';\nexport * from './types/ConnectorTypes';\n\nexport { WellKnownConfigurationKeys } from './types/ConfigurationTypes';\n\nexport * from './types/ActionTypes';\n\nexport * from './types/ShapeTypes';\n\nexport default SDK;\n"],"names":["root","factory","exports","module","define","amd","this","Resolution","ErrorCode","NativeErrorName","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","MessageType","NativeEventType","DEFAULT_PORT_BY_PROTOCOL","URL_REGEX","opaqueOriginSchemes","serializeError","name","message","stack","id","keyPathToSegments","keyPath","split","setAtKeyPath","subject","segments","reduce","prevSubject","idx","length","methods","prefix","flattenedMethods","keys","forEach","push","join","segmentsToKeyPath","createKeyPath","assign","callSender","info","methodKeyPaths","destroyConnection","log","destroyed","localName","createMethodProxy","methodName","args","iframeRemoved","remote","closed","e","error","Error","code","ConnectionDestroyed","Promise","resolve","reject","generateId","handleMessageEvent","event","source","data","penpal","origin","originForReceiving","replyMessage","local","removeEventListener","returnValue","returnValueIsError","deserializedError","deserializeError","resolution","Fulfilled","addEventListener","callMessage","postMessage","originForSending","api","deserializeMethods","serializedMethods","childOrigin","destructor","destroyCallReceiver","receiverMethodNames","window","createPromiseHandler","Rejected","err","DataCloneError","errorReplyMessage","apply","then","onDestroy","receiverMethodName","methodNames","destroyCallSender","destroy","options","debug","console","callbacks","callback","iframe","src","srcdoc","NoIframeSrc","validateIframeHasSrcOrSrcDoc","find","scheme","startsWith","location","document","regexResult","exec","protocol","hostname","port","getOriginFromSrc","handleSynMessage","synAckMessage","handleSynMessageFactory","handleAckMessage","handleAckMessageFactory","promise","stopConnectionTimeout","timeout","timeoutId","undefined","setTimeout","ConnectionTimeout","clearTimeout","handleMessage","contentWindow","checkIframeInDocIntervalId","setInterval","isConnected","clearInterval","monitorIframeRemoval","setupFrame","editorLink","styling","link","RegExp","test","indexOf","replace","charAt","validateEditorLink","html","JSON","stringify","iframeDoc","ownerDocument","open","write","close","params","setConnection","editorId","editorSelectorId","createElement","setAttribute","setupNewFrame","iframeContainer","querySelector","appendChild","readyState","connectToChild","actionsChanged","onActionsChanged","stateChanged","onStateChanged","documentLoaded","onDocumentLoaded","authExpired","onAuthExpired","selectedFramesContent","onSelectedFramesContentChanged","selectedFramesLayout","onSelectedFramesLayoutChanged","selectedLayoutProperties","onSelectedLayoutPropertiesChanged","openLayoutPropertiesPanel","onPageSelectionChanged","selectedLayoutUnit","onSelectedLayoutUnitChanged","scrubberPositionChanged","onScrubberPositionChanged","frameAnimationsChanged","onFrameAnimationsChanged","selectedToolChanged","onSelectedToolChanged","variableListChanged","onVariableListChanged","undoStackStateChanged","onUndoStateChanged","selectedLayoutFramesChanged","onSelectedLayoutFramesChanged","selectedTextStyleChanged","onSelectedTextStyleChanged","colorsChanged","onColorsChanged","paragraphStylesChanged","onParagraphStylesChanged","characterStylesChanged","onCharacterStylesChanged","fontFamiliesChanged","onFontFamiliesChanged","selectedLayoutId","onSelectedLayoutIdChanged","layoutListChanged","onLayoutsChanged","connectorEvent","onConnectorEvent","zoomChanged","onZoomChanged","pageSizeChanged","onPageSizeChanged","shapeCornerRadiusChanged","onShapeCornerRadiusChanged","cropActiveFrameIdChanged","onCropActiveFrameIdChanged","asyncError","onAsyncError","viewModeChanged","onViewModeChanged","WellKnownConfigurationKeys","defaultStudioOptions","shortcutOptions","debugPanel","enabled","ellipse","hand","image","polygon","rectangle","select","text","zoom","copyPaste","viewMode","ImageFrameSourceType","FramePropertiesType","DocumentType","getEditorResponseData","response","parse","success","cause","String","status","dataShouldBeParsed","parsedData","ActionController","constructor","editorAPI","getAll","getActions","result","getById","getActionById","create","createAction","duplicate","duplicateAction","remove","removeAction","update","updateAction","rename","updateScript","actionScript","script","updateTriggers","triggers","move","order","ids","moveActions","setTypeError","hasTypeErrors","hasTypeError","AnimationController","children","getAllOnSelectedLayout","getAnimationsOnSelectedLayout","getByFrameId","layoutId","getAnimationByFrameId","getByLayoutId","getAnimationsByLayoutId","setFrameAnimation","animation","play","playAnimation","pause","pauseAnimation","setScrubberPosition","timeInMS","setDuration","setAnimationDuration","resetFrameAnimation","reset","resetAnimation","CanvasController","zoomToPage","left","top","width","height","getZoomPercentage","setZoomPercentage","scaleFactor","setViewMode","CharacterStyleController","getCharacterStyles","characterStyleId","getCharacterStyleById","createCharacterStyle","characterStyle","updateCharacterStyle","removeCharacterStyle","duplicateCharacterStyle","characterStyleName","renameCharacterStyle","ColorStyleController","getColors","getColorById","createColor","duplicateColor","moveColors","newColorName","renameColor","newColorProperties","updateColor","removeColor","ColorConversionController","convertToRgb","color","colorToRgb","DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","ConfigurationController","getValue","getConfigValue","setValue","setConfigValue","updateStudioOptions","getEngineSessionId","ConnectorMapping","contextProperty","mapFrom","sourceValue","direction","engineToConnector","variable","grafxMediaConnectorRegistration","url","GrafxTokenAuthCredentials","token","type","AuthCredentialsTypeEnum","grafxToken","RefreshedAuthCredendentials","refreshed","AuthRefreshTypeEnum","ConnectorController","getConnectorById","getAllByType","getConnectors","register","registration","registerConnector","unregister","unregisterConnector","configure","configurationCallback","res","waitToBeReady","ConnectorConfigurator","updateConnectorConfiguration","getState","getConnectorState","getMappings","getConnectorMappings","getOptions","getConnectorOptions","timeoutMilliseconds","Math","max","min","retries","running","ready","setOptions","setConnectorOptions","setMappings","mappings","setConnectorMappings","map","m","setChiliToken","connectorAuthenticationSetChiliToken","setHttpHeader","headerName","headerValue","connectorAuthenticationSetHttpHeader","DebugController","getAllLogs","getLogs","toggleDebugPanel","enableDebug","disableDebug","ImageSourceTypeEnum","FrameTypeEnum","TextDirection","FlowDirection","VerticalAlign","BlendMode","FitMode","UpdateZIndexMethod","DocumentController","getCurrentState","getCurrentDocumentState","load","doc","keepConnectors","loadDocumentKeepConnectors","loadDocument","ExperimentController","insertImageVariableToFrame","imageFrameId","variableId","setImageSource","insertTextVariable","enterTextEditMode","exitTextEditMode","getText","frameId","textType","getTextByFrameId","setText","setTextByFrameId","selectText","startIndex","selectTextById","FontConnectorController","query","connectorId","queryOptions","context","fontConnectorQuery","detail","fontFamilyId","fontConnectorDetail","download","fontStyleId","fontConnectorDownload","preview","previewFormat","fontConnectorPreview","getConfigurationOptions","fontConnectorGetConfigurationOptions","getCapabilities","fontConnectorGetCapabilities","parseDeprecatedFontType","deprecatedType","file","collection","FontController","addFontFamily","fontFamily","removeFontFamily","addFontStyle","fontStyle","removeFontStyle","getFontFamilies","getFontStyles","getFontFamilyById","getFontStyleById","getDefaultFontStyle","getDefaultFontFamily","isFontFamilyUsed","isFontStyleUsed","moveFontFamilies","ShapeController","setShapeProperties","properties","setEnableFill","enableFill","setFillColor","fillColor","setEnableStroke","enableStroke","setStrokeColor","strokeColor","setStrokeWeight","strokeWeight","setFlagAllCornersSame","allCornersSame","setShapeCorners","radius","setRadiusAll","cornerRadius","radiusAll","setRadiusTopLeft","topLeft","setRadiusBottomLeft","bottomLeft","setRadiusTopRight","topRight","setRadiusBottomRight","bottomRight","FrameController","getFrames","getSelected","getSelectedFrames","getAllByPageId","getFramesByPageId","getByName","getFrameByName","getFrameById","getPropertiesOnSelectedLayout","getFramePropertiesOnSelectedLayout","getLayoutProperties","getFramePropertiesByFrameId","getAllLayoutProperties","getFramesProperties","resetSize","resetFrameSize","selectFrames","selectMultiple","reorderFrames","setZIndex","method","setFrameZIndex","setHeight","setFrameHeight","setRotation","rotation","setFrameRotation","setWidth","setFrameWidth","setX","XValue","setFrameX","setY","YValue","setFrameY","renameFrame","resetFrame","resetX","resetFrameX","resetY","resetFrameY","resetRotation","resetFrameRotation","resetWidth","resetFrameWidth","resetHeight","resetFrameHeight","resetImageFrameFitMode","setVisibility","setFrameIsVisible","setIsVisible","removeFrames","x","y","addFrame","createShapeFrame","duplicateFrames","updateImageSource","srcJson","removeImageSource","setImageFromConnector","assetId","connector","setImageFromUrl","setImageFrameFitMode","fitMode","setFrameConstrainProportions","constrainProportions","setVerticalAlign","verticalAlign","setVerticalAlignment","setMinCopyfitting","setMaxCopyfitting","setEnableCopyfitting","resetMinCopyfitting","resetMaxCopyfitting","resetEnableCopyfitting","setShapeFrameEnableFill","shapeFrameId","shapeController","setShapeFrameFillColor","setShapeFrameEnableStroke","setShapeFrameStrokeColor","setShapeFrameStrokeWeight","setBlendMode","blendMode","setFrameBlendMode","enterCropMode","applyCropMode","resetCropMode","exitCropMode","cancelCropMode","MediaDownloadType","MediaDownloadIntent","LayoutController","getLayouts","getLayoutById","getLayoutByName","getSelectedLayout","removeLayout","parentId","addLayout","renameLayout","selectLayout","duplicateLayout","resetLayout","setLayoutHeight","setLayoutWidth","setUnit","unit","setLayoutUnit","resetLayoutHeight","resetLayoutWidth","resetUnit","resetLayoutUnit","getSelectedSnapshot","getPageSnapshot","setIntent","intent","setLayoutIntent","resetIntent","resetLayoutIntent","MediaConnectorController","mediaConnectorQuery","mediaId","mediaConnectorDetail","downloadType","compatibleDownloadType","parseDeprecatedMediaDownloadType","mediaConnectorDownload","web","mediaConnectorGetConfigurationOptions","mediaConnectorGetCapabilities","parseDeprecatedMediaType","deprecatedMediaDownloadType","HighResolutionWeb","highres","LowResolutionWeb","thumbnail","PageController","getPages","getPageById","setPageWidth","setPageHeight","ParagraphStyleController","getParagraphStyles","getParagraphStyleById","createParagraphStyle","duplicateParagraphStyle","updateParagraphStyle","renameParagraphStyle","removeParagraphStyle","moveParagraphStyles","SubscriberController","config","actions","callBack","onAnimationChanged","onAnimationPlaybackChanged","animationPlaybackState","layoutProperties","framesLayout","frames","multiFrameCallBack","singleFrameCallBack","onSelectedFrameLayoutChanged","framesContent","onSelectedFrameContentChanged","authRefreshRequest","auth","variablesJson","tool","undoState","onUndoStackStateChanged","layoutFrames","styles","colors","paragraphStyles","characterStyles","fonts","layouts","pageSize","FramePropertyNames","LayoutPropertyNames","ToolType","DownloadFormats","EnvironmentType","TextStyleController","set","style","selectedTextStyleDeltaUpdate","removeSelected","selectedTextStyleClean","getSelectedTextStyle","ToolController","setTool","getSelectedTool","setPointer","SELECT","setHand","HAND","setZoom","ZOOM","setTextFrame","TEXT_FRAME","setImageFrame","IMAGE_FRAME","setShapeRect","SHAPE_RECT","setShapeEllipse","SHAPE_ELLIPSE","setShapePolygon","SHAPE_POLYGON","UndoManagerController","sdk","undo","redo","record","operationName","undoOperationCallback","beginIfNoneActive","end","AdvancedUndoManagerController","begin","round","val","precision","hundred","pow","UtilsController","createEnvironmentBaseURL","parameters","SANDBOX","environment","version","VariableController","getVariables","getVariableById","getVariableByName","addVariable","removeVariables","setVariableName","setLabel","label","setVariableLabel","setType","setVariableType","setListVariable","items","setListVariableItems","setVariableValue","duplicateVariable","groupVariables","ungroupVariables","ungroupVariable","moveVariable","moveVariables","isVisible","setVariableIsVisible","setIsHidden","isHidden","setIsRequired","isRequired","setVariableIsRequired","setIsReadonly","isReadonly","setVariableIsReadonly","getImageVariableConnectorId","setImageVariableConnector","removeSource","InfoController","currentEngineVersion","currentSDKVersion","ClipboardController","copyFrames","frameData","navigator","clipboard","writeText","cutFrames","pasteFrames","clipboardData","readText","getContentType","getClipboardContentType","connection","FIXED_EDITOR_LINK","SDK","loadEditor","subscriber","studioStyling","action","layout","frame","configuration","utils","page","undoManager","textSelection","colorStyle","paragraphStyle","mediaConnector","fontConnector","font","experiment","canvas","shape","GraFxStudioSdkVersion","GraFxStudioDocumentType","documentType","template","studioOptions","newConnection","child","colorConversion","SlideDirections","ShakeDirections","EaseTypes","TweenTypes","BasicAnimationsEmphasisStyles","LayoutType","MeasurementUnit","LayoutIntent","ViewMode","VariableType","FontWeights","Alignment","TextPosition","Case","Scripting","HorizontalAlign","SelectedTextStyleSections","SelectedTextStyles","ColorType","ColorUsageType","FontPreviewFormat","ActionEditorEvent","ShapeType","CornerRadiusType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CACA,kDACA,4CACA,0CACA,kDACA,sDACA,qDACA,yCACA,8CACA,0CACA,iCACA,yDACA,8CACA,uDACA,0CACA,qCACA,kDACA,sDACH,CAvBD,CAAYA,qBAAAA,mBAAkB,KCjH9B,SAAYC,WACR,oBACA,oBACA,sBACA,sBACA,oBACA,qBACH,CAPD,CAAYA,YAAAA,UAAS,KAgGrB,SAAYC,gBAIR,6BAIA,kCACH,CATD,CAAYA,iBAAAA,eAAc,KChG1B,SAAYC,mBACR,kCACA,6BACH,CAHD,CAAYA,oBAAAA,kBAAiB,KCG7B,SAAYC,mBAIR,gEAMA,0CAKA,oDAMA,kDAKA,6DACH,CA3BD,CAAYA,oBAAAA,kBAAiB,KCH7B,SAAYC,WACR,4BACA,gCACA,2BACH,CAJD,CAAYA,YAAAA,UAAS,KAwCrB,SAAYC,kBACR,2BACA,6BACA,4BACH,CAJD,CAAYA,mBAAAA,iBAAgB,KCwF5B,c","sources":["webpack://StudioSDK/webpack/universalModuleDefinition","webpack://StudioSDK/webpack/bootstrap","webpack://StudioSDK/./node_modules/penpal/lib/enums.js","webpack://StudioSDK/webpack/runtime/define property getters","webpack://StudioSDK/webpack/runtime/hasOwnProperty shorthand","webpack://StudioSDK/webpack/runtime/make namespace object","webpack://StudioSDK/./node_modules/penpal/lib/createDestructor.js","webpack://StudioSDK/./node_modules/penpal/lib/parent/getOriginFromSrc.js","webpack://StudioSDK/./node_modules/penpal/lib/errorSerialization.js","webpack://StudioSDK/./node_modules/penpal/lib/generateId.js","webpack://StudioSDK/./node_modules/penpal/lib/methodSerialization.js","webpack://StudioSDK/./node_modules/penpal/lib/connectCallSender.js","webpack://StudioSDK/./node_modules/penpal/lib/parent/handleAckMessageFactory.js","webpack://StudioSDK/./node_modules/penpal/lib/connectCallReceiver.js","webpack://StudioSDK/./node_modules/penpal/lib/parent/connectToChild.js","webpack://StudioSDK/./node_modules/penpal/lib/createLogger.js","webpack://StudioSDK/./node_modules/penpal/lib/parent/validateIframeHasSrcOrSrcDoc.js","webpack://StudioSDK/./node_modules/penpal/lib/parent/handleSynMessageFactory.js","webpack://StudioSDK/./node_modules/penpal/lib/startConnectionTimeout.js","webpack://StudioSDK/./node_modules/penpal/lib/parent/monitorIframeRemoval.js","webpack://StudioSDK/./src/interactions/connector.ts","webpack://StudioSDK/./src/types/ConfigurationTypes.ts","webpack://StudioSDK/./src/types/DocumentTypes.ts","webpack://StudioSDK/./src/utils/EditorResponseData.ts","webpack://StudioSDK/./src/controllers/ActionController.ts","webpack://StudioSDK/./src/controllers/AnimationController.ts","webpack://StudioSDK/./src/controllers/CanvasController.ts","webpack://StudioSDK/./src/controllers/CharacterStyleController.ts","webpack://StudioSDK/./src/controllers/ColorStyleController.ts","webpack://StudioSDK/./src/controllers/ColorConversionController.ts","webpack://StudioSDK/./src/types/ConnectorTypes.ts","webpack://StudioSDK/./src/controllers/ConfigurationController.ts","webpack://StudioSDK/./src/controllers/ConnectorController.ts","webpack://StudioSDK/./src/controllers/DebugController.ts","webpack://StudioSDK/./src/types/FrameTypes.ts","webpack://StudioSDK/./src/controllers/DocumentController.ts","webpack://StudioSDK/./src/controllers/ExperimentController.ts","webpack://StudioSDK/./src/controllers/FontConnectorController.ts","webpack://StudioSDK/./src/controllers/FontController.ts","webpack://StudioSDK/./src/controllers/ShapeController.ts","webpack://StudioSDK/./src/types/LayoutTypes.ts","webpack://StudioSDK/./src/controllers/FrameController.ts","webpack://StudioSDK/./src/types/MediaConnectorTypes.ts","webpack://StudioSDK/./src/controllers/LayoutController.ts","webpack://StudioSDK/./src/controllers/MediaConnectorController.ts","webpack://StudioSDK/./src/controllers/PageController.ts","webpack://StudioSDK/./src/types/VariableTypes.ts","webpack://StudioSDK/./src/controllers/ParagraphStyleController.ts","webpack://StudioSDK/./src/controllers/SubscriberController.ts","webpack://StudioSDK/./src/utils/enums.ts","webpack://StudioSDK/./src/controllers/TextStyleController.ts","webpack://StudioSDK/./src/controllers/ToolController.ts","webpack://StudioSDK/./src/controllers/UndoManagerController.ts","webpack://StudioSDK/./src/utils/MathUtils.ts","webpack://StudioSDK/./src/controllers/UtilsController.ts","webpack://StudioSDK/./src/controllers/VariableController.ts","webpack://StudioSDK/./src/controllers/InfoController.ts","webpack://StudioSDK/./src/types/BarcodeTypes.ts","webpack://StudioSDK/./src/controllers/ClipboardController.ts","webpack://StudioSDK/./src/controllers/BarcodeController.ts","webpack://StudioSDK/./src/sdk.ts","webpack://StudioSDK/./src/types/AnimationTypes.ts","webpack://StudioSDK/./src/types/ViewModeTypes.ts","webpack://StudioSDK/./src/types/TextStyleTypes.ts","webpack://StudioSDK/./src/types/ColorStyleTypes.ts","webpack://StudioSDK/./src/types/FontConnectorTypes.ts","webpack://StudioSDK/./src/types/ActionTypes.ts","webpack://StudioSDK/./src/types/ShapeTypes.ts","webpack://StudioSDK/./src/index.ts"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"StudioSDK\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"StudioSDK\"] = factory();\n\telse\n\t\troot[\"StudioSDK\"] = factory();\n})(this, () => {\nreturn ","// The require scope\nvar __webpack_require__ = {};\n\n","export var MessageType;\n(function (MessageType) {\n MessageType[\"Call\"] = \"call\";\n MessageType[\"Reply\"] = \"reply\";\n MessageType[\"Syn\"] = \"syn\";\n MessageType[\"SynAck\"] = \"synAck\";\n MessageType[\"Ack\"] = \"ack\";\n})(MessageType || (MessageType = {}));\nexport var Resolution;\n(function (Resolution) {\n Resolution[\"Fulfilled\"] = \"fulfilled\";\n Resolution[\"Rejected\"] = \"rejected\";\n})(Resolution || (Resolution = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ErrorCode[\"ConnectionDestroyed\"] = \"ConnectionDestroyed\";\n ErrorCode[\"ConnectionTimeout\"] = \"ConnectionTimeout\";\n ErrorCode[\"NoIframeSrc\"] = \"NoIframeSrc\";\n})(ErrorCode || (ErrorCode = {}));\nexport var NativeErrorName;\n(function (NativeErrorName) {\n NativeErrorName[\"DataCloneError\"] = \"DataCloneError\";\n})(NativeErrorName || (NativeErrorName = {}));\nexport var NativeEventType;\n(function (NativeEventType) {\n NativeEventType[\"Message\"] = \"message\";\n})(NativeEventType || (NativeEventType = {}));\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","export default (localName, log) => {\n const callbacks = [];\n let destroyed = false;\n return {\n destroy(error) {\n if (!destroyed) {\n destroyed = true;\n log(`${localName}: Destroying connection`);\n callbacks.forEach((callback) => {\n callback(error);\n });\n }\n },\n onDestroy(callback) {\n destroyed ? callback() : callbacks.push(callback);\n },\n };\n};\n","const DEFAULT_PORT_BY_PROTOCOL = {\n 'http:': '80',\n 'https:': '443',\n};\nconst URL_REGEX = /^(https?:)?\\/\\/([^/:]+)?(:(\\d+))?/;\nconst opaqueOriginSchemes = ['file:', 'data:'];\n/**\n * Converts a src value into an origin.\n */\nexport default (src) => {\n if (src && opaqueOriginSchemes.find((scheme) => src.startsWith(scheme))) {\n // The origin of the child document is an opaque origin and its\n // serialization is \"null\"\n // https://html.spec.whatwg.org/multipage/origin.html#origin\n return 'null';\n }\n // Note that if src is undefined, then srcdoc is being used instead of src\n // and we can follow this same logic below to get the origin of the parent,\n // which is the origin that we will need to use.\n const location = document.location;\n const regexResult = URL_REGEX.exec(src);\n let protocol;\n let hostname;\n let port;\n if (regexResult) {\n // It's an absolute URL. Use the parsed info.\n // regexResult[1] will be undefined if the URL starts with //\n protocol = regexResult[1] ? regexResult[1] : location.protocol;\n hostname = regexResult[2];\n port = regexResult[4];\n }\n else {\n // It's a relative path. Use the current location's info.\n protocol = location.protocol;\n hostname = location.hostname;\n port = location.port;\n }\n // If the port is the default for the protocol, we don't want to add it to the origin string\n // or it won't match the message's event.origin.\n const portSuffix = port && port !== DEFAULT_PORT_BY_PROTOCOL[protocol] ? `:${port}` : '';\n return `${protocol}//${hostname}${portSuffix}`;\n};\n","/**\n * Converts an error object into a plain object.\n */\nexport const serializeError = ({ name, message, stack, }) => ({\n name,\n message,\n stack,\n});\n/**\n * Converts a plain object into an error object.\n */\nexport const deserializeError = (obj) => {\n const deserializedError = new Error();\n // @ts-ignore\n Object.keys(obj).forEach((key) => (deserializedError[key] = obj[key]));\n return deserializedError;\n};\n","let id = 0;\n/**\n * @return {number} A unique ID (not universally unique)\n */\nexport default () => ++id;\n","const KEY_PATH_DELIMITER = '.';\nconst keyPathToSegments = (keyPath) => keyPath ? keyPath.split(KEY_PATH_DELIMITER) : [];\nconst segmentsToKeyPath = (segments) => segments.join(KEY_PATH_DELIMITER);\nconst createKeyPath = (key, prefix) => {\n const segments = keyPathToSegments(prefix || '');\n segments.push(key);\n return segmentsToKeyPath(segments);\n};\n/**\n * Given a `keyPath`, set it to be `value` on `subject`, creating any intermediate\n * objects along the way.\n *\n * @param {Object} subject The object on which to set value.\n * @param {string} keyPath The key path at which to set value.\n * @param {Object} value The value to store at the given key path.\n * @returns {Object} Updated subject.\n */\nexport const setAtKeyPath = (subject, keyPath, value) => {\n const segments = keyPathToSegments(keyPath);\n segments.reduce((prevSubject, key, idx) => {\n if (typeof prevSubject[key] === 'undefined') {\n prevSubject[key] = {};\n }\n if (idx === segments.length - 1) {\n prevSubject[key] = value;\n }\n return prevSubject[key];\n }, subject);\n return subject;\n};\n/**\n * Given a dictionary of (nested) keys to function, flatten them to a map\n * from key path to function.\n *\n * @param {Object} methods The (potentially nested) object to serialize.\n * @param {string} prefix A string with which to prefix entries. Typically not intended to be used by consumers.\n * @returns {Object} An map from key path in `methods` to functions.\n */\nexport const serializeMethods = (methods, prefix) => {\n const flattenedMethods = {};\n Object.keys(methods).forEach((key) => {\n const value = methods[key];\n const keyPath = createKeyPath(key, prefix);\n if (typeof value === 'object') {\n // Recurse into any nested children.\n Object.assign(flattenedMethods, serializeMethods(value, keyPath));\n }\n if (typeof value === 'function') {\n // If we've found a method, expose it.\n flattenedMethods[keyPath] = value;\n }\n });\n return flattenedMethods;\n};\n/**\n * Given a map of key paths to functions, unpack the key paths to an object.\n *\n * @param {Object} flattenedMethods A map of key paths to functions to unpack.\n * @returns {Object} A (potentially nested) map of functions.\n */\nexport const deserializeMethods = (flattenedMethods) => {\n const methods = {};\n for (const keyPath in flattenedMethods) {\n setAtKeyPath(methods, keyPath, flattenedMethods[keyPath]);\n }\n return methods;\n};\n","import generateId from './generateId';\nimport { deserializeError } from './errorSerialization';\nimport { deserializeMethods } from './methodSerialization';\nimport { ErrorCode, MessageType, NativeEventType, Resolution } from './enums';\n/**\n * Augments an object with methods that match those defined by the remote. When these methods are\n * called, a \"call\" message will be sent to the remote, the remote's corresponding method will be\n * executed, and the method's return value will be returned via a message.\n * @param {Object} callSender Sender object that should be augmented with methods.\n * @param {Object} info Information about the local and remote windows.\n * @param {Array} methodKeyPaths Key paths of methods available to be called on the remote.\n * @param {Promise} destructionPromise A promise resolved when destroy() is called on the penpal\n * connection.\n * @returns {Object} The call sender object with methods that may be called.\n */\nexport default (callSender, info, methodKeyPaths, destroyConnection, log) => {\n const { localName, local, remote, originForSending, originForReceiving, } = info;\n let destroyed = false;\n log(`${localName}: Connecting call sender`);\n const createMethodProxy = (methodName) => {\n return (...args) => {\n log(`${localName}: Sending ${methodName}() call`);\n // This handles the case where the iframe has been removed from the DOM\n // (and therefore its window closed), the consumer has not yet\n // called destroy(), and the user calls a method exposed by\n // the remote. We detect the iframe has been removed and force\n // a destroy() immediately so that the consumer sees the error saying\n // the connection has been destroyed. We wrap this check in a try catch\n // because Edge throws an \"Object expected\" error when accessing\n // contentWindow.closed on a contentWindow from an iframe that's been\n // removed from the DOM.\n let iframeRemoved;\n try {\n if (remote.closed) {\n iframeRemoved = true;\n }\n }\n catch (e) {\n iframeRemoved = true;\n }\n if (iframeRemoved) {\n destroyConnection();\n }\n if (destroyed) {\n const error = new Error(`Unable to send ${methodName}() call due ` + `to destroyed connection`);\n error.code = ErrorCode.ConnectionDestroyed;\n throw error;\n }\n return new Promise((resolve, reject) => {\n const id = generateId();\n const handleMessageEvent = (event) => {\n if (event.source !== remote ||\n event.data.penpal !== MessageType.Reply ||\n event.data.id !== id) {\n return;\n }\n if (event.origin !== originForReceiving) {\n log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);\n return;\n }\n const replyMessage = event.data;\n log(`${localName}: Received ${methodName}() reply`);\n local.removeEventListener(NativeEventType.Message, handleMessageEvent);\n let returnValue = replyMessage.returnValue;\n if (replyMessage.returnValueIsError) {\n returnValue = deserializeError(returnValue);\n }\n (replyMessage.resolution === Resolution.Fulfilled ? resolve : reject)(returnValue);\n };\n local.addEventListener(NativeEventType.Message, handleMessageEvent);\n const callMessage = {\n penpal: MessageType.Call,\n id,\n methodName,\n args,\n };\n remote.postMessage(callMessage, originForSending);\n });\n };\n };\n // Wrap each method in a proxy which sends it to the corresponding receiver.\n const flattenedMethods = methodKeyPaths.reduce((api, name) => {\n api[name] = createMethodProxy(name);\n return api;\n }, {});\n // Unpack the structure of the provided methods object onto the CallSender, exposing\n // the methods in the same shape they were provided.\n Object.assign(callSender, deserializeMethods(flattenedMethods));\n return () => {\n destroyed = true;\n };\n};\n","import connectCallReceiver from '../connectCallReceiver';\nimport connectCallSender from '../connectCallSender';\n/**\n * Handles an ACK handshake message.\n */\nexport default (serializedMethods, childOrigin, originForSending, destructor, log) => {\n const { destroy, onDestroy } = destructor;\n let destroyCallReceiver;\n let receiverMethodNames;\n // We resolve the promise with the call sender. If the child reconnects\n // (for example, after refreshing or navigating to another page that\n // uses Penpal, we'll update the call sender with methods that match the\n // latest provided by the child.\n const callSender = {};\n return (event) => {\n if (event.origin !== childOrigin) {\n log(`Parent: Handshake - Received ACK message from origin ${event.origin} which did not match expected origin ${childOrigin}`);\n return;\n }\n log('Parent: Handshake - Received ACK');\n const info = {\n localName: 'Parent',\n local: window,\n remote: event.source,\n originForSending: originForSending,\n originForReceiving: childOrigin,\n };\n // If the child reconnected, we need to destroy the prior call receiver\n // before setting up a new one.\n if (destroyCallReceiver) {\n destroyCallReceiver();\n }\n destroyCallReceiver = connectCallReceiver(info, serializedMethods, log);\n onDestroy(destroyCallReceiver);\n // If the child reconnected, we need to remove the methods from the\n // previous call receiver off the sender.\n if (receiverMethodNames) {\n receiverMethodNames.forEach((receiverMethodName) => {\n delete callSender[receiverMethodName];\n });\n }\n receiverMethodNames = event.data.methodNames;\n const destroyCallSender = connectCallSender(callSender, info, receiverMethodNames, destroy, log);\n onDestroy(destroyCallSender);\n return callSender;\n };\n};\n","import { serializeError } from './errorSerialization';\nimport { MessageType, NativeEventType, NativeErrorName, Resolution, } from './enums';\n/**\n * Listens for \"call\" messages coming from the remote, executes the corresponding method, and\n * responds with the return value.\n */\nexport default (info, serializedMethods, log) => {\n const { localName, local, remote, originForSending, originForReceiving, } = info;\n let destroyed = false;\n const handleMessageEvent = (event) => {\n if (event.source !== remote || event.data.penpal !== MessageType.Call) {\n return;\n }\n if (event.origin !== originForReceiving) {\n log(`${localName} received message from origin ${event.origin} which did not match expected origin ${originForReceiving}`);\n return;\n }\n const callMessage = event.data;\n const { methodName, args, id } = callMessage;\n log(`${localName}: Received ${methodName}() call`);\n const createPromiseHandler = (resolution) => {\n return (returnValue) => {\n log(`${localName}: Sending ${methodName}() reply`);\n if (destroyed) {\n // It's possible to throw an error here, but it would need to be thrown asynchronously\n // and would only be catchable using window.onerror. This is because the consumer\n // is merely returning a value from their method and not calling any function\n // that they could wrap in a try-catch. Even if the consumer were to catch the error,\n // the value of doing so is questionable. Instead, we'll just log a message.\n log(`${localName}: Unable to send ${methodName}() reply due to destroyed connection`);\n return;\n }\n const message = {\n penpal: MessageType.Reply,\n id,\n resolution,\n returnValue,\n };\n if (resolution === Resolution.Rejected &&\n returnValue instanceof Error) {\n message.returnValue = serializeError(returnValue);\n message.returnValueIsError = true;\n }\n try {\n remote.postMessage(message, originForSending);\n }\n catch (err) {\n // If a consumer attempts to send an object that's not cloneable (e.g., window),\n // we want to ensure the receiver's promise gets rejected.\n if (err.name === NativeErrorName.DataCloneError) {\n const errorReplyMessage = {\n penpal: MessageType.Reply,\n id,\n resolution: Resolution.Rejected,\n returnValue: serializeError(err),\n returnValueIsError: true,\n };\n remote.postMessage(errorReplyMessage, originForSending);\n }\n throw err;\n }\n };\n };\n new Promise((resolve) => resolve(serializedMethods[methodName].apply(serializedMethods, args))).then(createPromiseHandler(Resolution.Fulfilled), createPromiseHandler(Resolution.Rejected));\n };\n local.addEventListener(NativeEventType.Message, handleMessageEvent);\n return () => {\n destroyed = true;\n local.removeEventListener(NativeEventType.Message, handleMessageEvent);\n };\n};\n","import { MessageType, NativeEventType } from '../enums';\nimport createDestructor from '../createDestructor';\nimport createLogger from '../createLogger';\nimport getOriginFromSrc from './getOriginFromSrc';\nimport handleAckMessageFactory from './handleAckMessageFactory';\nimport handleSynMessageFactory from './handleSynMessageFactory';\nimport { serializeMethods } from '../methodSerialization';\nimport monitorIframeRemoval from './monitorIframeRemoval';\nimport startConnectionTimeout from '../startConnectionTimeout';\nimport validateIframeHasSrcOrSrcDoc from './validateIframeHasSrcOrSrcDoc';\n/**\n * Attempts to establish communication with an iframe.\n */\nexport default (options) => {\n let { iframe, methods = {}, childOrigin, timeout, debug = false } = options;\n const log = createLogger(debug);\n const destructor = createDestructor('Parent', log);\n const { onDestroy, destroy } = destructor;\n if (!childOrigin) {\n validateIframeHasSrcOrSrcDoc(iframe);\n childOrigin = getOriginFromSrc(iframe.src);\n }\n // If event.origin is \"null\", the remote protocol is file: or data: and we\n // must post messages with \"*\" as targetOrigin when sending messages.\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage#Using_window.postMessage_in_extensions\n const originForSending = childOrigin === 'null' ? '*' : childOrigin;\n const serializedMethods = serializeMethods(methods);\n const handleSynMessage = handleSynMessageFactory(log, serializedMethods, childOrigin, originForSending);\n const handleAckMessage = handleAckMessageFactory(serializedMethods, childOrigin, originForSending, destructor, log);\n const promise = new Promise((resolve, reject) => {\n const stopConnectionTimeout = startConnectionTimeout(timeout, destroy);\n const handleMessage = (event) => {\n if (event.source !== iframe.contentWindow || !event.data) {\n return;\n }\n if (event.data.penpal === MessageType.Syn) {\n handleSynMessage(event);\n return;\n }\n if (event.data.penpal === MessageType.Ack) {\n const callSender = handleAckMessage(event);\n if (callSender) {\n stopConnectionTimeout();\n resolve(callSender);\n }\n return;\n }\n };\n window.addEventListener(NativeEventType.Message, handleMessage);\n log('Parent: Awaiting handshake');\n monitorIframeRemoval(iframe, destructor);\n onDestroy((error) => {\n window.removeEventListener(NativeEventType.Message, handleMessage);\n if (error) {\n reject(error);\n }\n });\n });\n return {\n promise,\n destroy() {\n // Don't allow consumer to pass an error into destroy.\n destroy();\n },\n };\n};\n","export default (debug) => {\n /**\n * Logs a message if debug is enabled.\n */\n return (...args) => {\n if (debug) {\n console.log('[Penpal]', ...args); // eslint-disable-line no-console\n }\n };\n};\n","import { ErrorCode } from '../enums';\nexport default (iframe) => {\n if (!iframe.src && !iframe.srcdoc) {\n const error = new Error('Iframe must have src or srcdoc property defined.');\n error.code = ErrorCode.NoIframeSrc;\n throw error;\n }\n};\n","import { MessageType } from '../enums';\n/**\n * Handles a SYN handshake message.\n */\nexport default (log, serializedMethods, childOrigin, originForSending) => {\n return (event) => {\n if (event.origin !== childOrigin) {\n log(`Parent: Handshake - Received SYN message from origin ${event.origin} which did not match expected origin ${childOrigin}`);\n return;\n }\n log('Parent: Handshake - Received SYN, responding with SYN-ACK');\n const synAckMessage = {\n penpal: MessageType.SynAck,\n methodNames: Object.keys(serializedMethods),\n };\n event.source.postMessage(synAckMessage, originForSending);\n };\n};\n","import { ErrorCode } from './enums';\n/**\n * Starts a timeout and calls the callback with an error\n * if the timeout completes before the stop function is called.\n */\nexport default (timeout, callback) => {\n let timeoutId;\n if (timeout !== undefined) {\n timeoutId = window.setTimeout(() => {\n const error = new Error(`Connection timed out after ${timeout}ms`);\n error.code = ErrorCode.ConnectionTimeout;\n callback(error);\n }, timeout);\n }\n return () => {\n clearTimeout(timeoutId);\n };\n};\n","const CHECK_IFRAME_IN_DOC_INTERVAL = 60000;\n/**\n * Monitors for iframe removal and destroys connection if iframe\n * is found to have been removed from DOM. This is to prevent memory\n * leaks when the iframe is removed from the document and the consumer\n * hasn't called destroy(). Without this, event listeners attached to\n * the window would stick around and since the event handlers have a\n * reference to the iframe in their closures, the iframe would stick\n * around too.\n */\nexport default (iframe, destructor) => {\n const { destroy, onDestroy } = destructor;\n const checkIframeInDocIntervalId = setInterval(() => {\n if (!iframe.isConnected) {\n clearInterval(checkIframeInDocIntervalId);\n destroy();\n }\n }, CHECK_IFRAME_IN_DOC_INTERVAL);\n onDestroy(() => {\n clearInterval(checkIframeInDocIntervalId);\n });\n};\n","import { Connection, connectToChild } from 'penpal';\nimport { Id } from '../types/CommonTypes';\nimport { StudioStyling } from '../types/ConfigurationTypes';\n\nexport const validateEditorLink = (editorLink: string) => {\n const linkValidator = new RegExp(/^(?:http(s)?:\\/\\/)?[\\w.-]+(?:\\.[\\w.-]+)+[\\w]+\\/$/);\n let link = '';\n if (linkValidator.test(editorLink)) {\n link = editorLink;\n } else if (editorLink.indexOf('/index.html') > -1) {\n link = editorLink.replace('/index.html', '/');\n } else if (editorLink.charAt(-1) !== '/') {\n link = `${editorLink}/`;\n }\n return link;\n};\n\nexport const setupFrame = (iframe: HTMLIFrameElement, editorLink: string, styling?: StudioStyling) => {\n const link = validateEditorLink(editorLink);\n const stylingJson = JSON.stringify(styling || {});\n const html = `<html>\n <head>\n <base href=\"/\" />\n <meta charset=\"UTF-8\"/>\n <!-- use this property to pass the StudioStyling to the engine -->\n <meta name=\"studio-styling\" content=${stylingJson}>\n </head>\n <body>\n <script src=\"${link}init.js\" async></script>\n <script src=\"${link}init_engine.js\"></script>\n <script>\n initializeStudioEngine({\n assetBase: '${link}',\n entryPointUrl: '${link}main.dart.js',\n });\n </script>\n </body>\n </html>\n `;\n\n // eslint-disable-next-line no-param-reassign\n iframe.srcdoc = 'placeholder';\n\n let iframeDoc: Document = iframe.ownerDocument;\n if (iframe.contentWindow) {\n iframeDoc = iframe.contentWindow.document;\n }\n iframeDoc.open();\n iframeDoc.write(html);\n iframeDoc.close();\n};\n\ninterface ConfigParameterTypes {\n onActionsChanged: (state: string) => void;\n onStateChanged: (state: string) => void;\n onAuthExpired: (authRefreshRequest: string) => Promise<string | null>;\n onViewportRequested: () => string | null;\n onDocumentLoaded: () => void;\n onSelectedFramesContentChanged: (state: string) => void;\n onSelectedFramesLayoutChanged: (state: string) => void;\n onSelectedLayoutPropertiesChanged: (state: string) => void;\n onSelectedLayoutUnitChanged: (state: string) => void;\n onPageSelectionChanged: () => void;\n onScrubberPositionChanged: (state: string) => void;\n onFrameAnimationsChanged: (state: string) => void;\n onVariableListChanged: (state: string) => void;\n onSelectedToolChanged: (state: string) => void;\n onUndoStateChanged: (state: string) => void;\n onSelectedLayoutFramesChanged: (state: string) => void;\n onSelectedTextStyleChanged: (styles: string) => void;\n onColorsChanged: (colors: string) => void;\n onParagraphStylesChanged: (paragraphStyles: string) => void;\n onCharacterStylesChanged: (characterStyles: string) => void;\n onFontFamiliesChanged: (fonts: string) => void;\n onSelectedLayoutIdChanged: (id: string) => void;\n onLayoutsChanged: (layouts: string) => void;\n onConnectorEvent: (state: string) => void;\n onConnectorsChanged: (state: string) => void;\n onZoomChanged: (scaleFactor: string) => void;\n onPageSizeChanged: (scaleFactor: string) => void;\n onShapeCornerRadiusChanged: (cornerRadius: string) => void;\n onCropActiveFrameIdChanged: (id?: Id) => void;\n onAsyncError: (asyncError: string) => void;\n onViewModeChanged: (viewMode: string) => void;\n onBarcodeValidationChanged: (validationResults: string) => void;\n}\n\nconst Connect = (\n editorLink: string,\n params: ConfigParameterTypes,\n setConnection: (connection: Connection) => void,\n editorId = 'chili-editor',\n styling?: StudioStyling,\n) => {\n const editorSelectorId = `#${editorId}`;\n const iframe = document.createElement('iframe');\n iframe.setAttribute('srcdoc', ' ');\n iframe.setAttribute('title', 'Chili-Editor');\n iframe.setAttribute('style', 'width: 100%; height: 100%;');\n iframe.setAttribute('frameBorder', '0');\n iframe.setAttribute('referrerpolicy', 'origin');\n\n const setupNewFrame = () => {\n const iframeContainer = document.querySelector(editorSelectorId);\n if (iframeContainer) {\n iframeContainer?.appendChild(iframe);\n setupFrame(iframe, editorLink, styling);\n }\n };\n\n if (document.readyState === 'complete' || document.readyState === 'interactive') {\n setupNewFrame();\n } else {\n document.addEventListener('DOMContentLoaded', () => {\n setupNewFrame();\n });\n }\n setConnection(\n connectToChild({\n // The iframe to which a connection should be made\n iframe,\n // All the methods that we want to expose to the child should be inside the methods object\n // f.e. stateChange(documentJson)\n methods: {\n actionsChanged: params.onActionsChanged,\n stateChanged: params.onStateChanged,\n documentLoaded: params.onDocumentLoaded,\n authExpired: params.onAuthExpired,\n viewportRequested: params.onViewportRequested,\n selectedFramesContent: params.onSelectedFramesContentChanged,\n selectedFramesLayout: params.onSelectedFramesLayoutChanged,\n selectedLayoutProperties: params.onSelectedLayoutPropertiesChanged,\n openLayoutPropertiesPanel: params.onPageSelectionChanged,\n selectedLayoutUnit: params.onSelectedLayoutUnitChanged,\n scrubberPositionChanged: params.onScrubberPositionChanged,\n frameAnimationsChanged: params.onFrameAnimationsChanged,\n selectedToolChanged: params.onSelectedToolChanged,\n variableListChanged: params.onVariableListChanged,\n undoStackStateChanged: params.onUndoStateChanged,\n selectedLayoutFramesChanged: params.onSelectedLayoutFramesChanged,\n selectedTextStyleChanged: params.onSelectedTextStyleChanged,\n colorsChanged: params.onColorsChanged,\n paragraphStylesChanged: params.onParagraphStylesChanged,\n characterStylesChanged: params.onCharacterStylesChanged,\n fontFamiliesChanged: params.onFontFamiliesChanged,\n selectedLayoutId: params.onSelectedLayoutIdChanged,\n layoutListChanged: params.onLayoutsChanged,\n connectorEvent: params.onConnectorEvent,\n connectorsChanged: params.onConnectorsChanged,\n zoomChanged: params.onZoomChanged,\n pageSizeChanged: params.onPageSizeChanged,\n shapeCornerRadiusChanged: params.onShapeCornerRadiusChanged,\n cropActiveFrameIdChanged: params.onCropActiveFrameIdChanged,\n asyncError: params.onAsyncError,\n viewModeChanged: params.onViewModeChanged,\n barcodeValidationChanged: params.onBarcodeValidationChanged,\n },\n }),\n );\n};\nexport default Connect;\n","export enum WellKnownConfigurationKeys {\n GraFxStudioEnvironmentApiUrl = 'ENVIRONMENT_API',\n GraFxStudioSdkVersion = 'SDK_VERSION',\n GraFxStudioDocumentType = 'DOCUMENT_TYPE',\n GraFxStudioTemplateId = 'TEMPLATE_ID',\n GraFxStudioAuthToken = 'GRAFX_AUTH_TOKEN',\n}\n\nexport type StudioStyling = {\n uiBackgroundColorHex?: string;\n};\n\n/**\n * Studio Options that can be updated.\n */\nexport type StudioOptionsDeltaUpdate = {\n /** Options for the different studio engine shortcuts */\n shortcutOptions?: ShortcutOptionsDeltaUpdate;\n};\n\n/**\n * Shortcut Options that can be updated.\n */\nexport type ShortcutOptionsDeltaUpdate = {\n /** The debug panel shortcut. */\n debugPanel?: ShortcutOption;\n\n /** The ellipse shape shortcut. */\n ellipse?: ShortcutOption;\n\n /** The hand shortcut. */\n hand?: ShortcutOption;\n\n /** The image frame shortcut. */\n image?: ShortcutOption;\n\n /** The polygon shape shortcut. */\n polygon?: ShortcutOption;\n\n /** The rectangle shape shortcut. */\n rectangle?: ShortcutOption;\n\n /** The select shortcut. */\n select?: ShortcutOption;\n\n /** The text frame shortcut. */\n text?: ShortcutOption;\n\n /** The zoom shortcut. */\n zoom?: ShortcutOption;\n\n /** The copy/cut/paste/duplicate shortcut. */\n copyPaste?: ShortcutOption;\n\n /** The view mode shortcut. */\n viewMode?: ShortcutOption;\n};\n\n/**\n * Specific shortcut options\n */\nexport type ShortcutOption = {\n /** Whether the shortcut is enabled. */\n enabled: boolean;\n};\n\n/**\n * Default studio options with all shortcuts disabled.\n */\nexport const defaultStudioOptions: StudioOptionsDeltaUpdate = {\n shortcutOptions: {\n debugPanel: { enabled: false },\n ellipse: { enabled: false },\n hand: { enabled: false },\n image: { enabled: false },\n polygon: { enabled: false },\n rectangle: { enabled: false },\n select: { enabled: false },\n text: { enabled: false },\n zoom: { enabled: false },\n copyPaste: { enabled: false },\n viewMode: { enabled: false },\n },\n};\n","import { BasicAnimationsEmphasisType, BasicAnimationsIntroType, BasicAnimationsOutroType } from './AnimationTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { Id } from './CommonTypes';\nimport { BlendMode, FrameTypeEnum } from './FrameTypes';\nimport { LayoutIntent, LayoutType } from './LayoutTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { Variable } from './VariableTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentAction } from './ActionTypes';\nimport { ShapeProperties } from './ShapeTypes';\n\nexport type DocumentError = { error: Record<string, unknown>; code: number };\n\nexport type UndoState = {\n canUndo: boolean;\n canRedo: boolean;\n undoItemName: OperationName;\n redoItemName: OperationName;\n};\n\nexport type OperationName = { translationKey: number; name: string };\n\n/**\n * This type should give a clear indication of how the JSON document is structured. This could help you with building a test document yourself.\n */\nexport interface ChiliDocument {\n selectedLayoutId: string;\n properties?: TemplateDocumentProperties | ProjectDocumentProperties;\n pages: DocumentPage[];\n layouts: (ChildLayout | TopLayout)[];\n stylekit: DocumentStylekit;\n variables: Variable[];\n actions: DocumentAction[];\n}\n\nexport interface DocumentPage {\n id: string;\n number: number;\n frames: (ImageFrame | TextFrame | ShapeFrame)[];\n}\n\nexport interface DocumentFrame {\n id: string;\n name: string;\n type: FrameTypeEnum;\n blendMode: BlendMode;\n constrainProportions: boolean;\n}\n\nexport interface ImageFrame extends DocumentFrame {\n src: ImageFrameUrlSource | ImageFrameConnectorSource | ImageFrameVariableSource;\n}\n\nexport interface ShapeFrame extends DocumentFrame {\n shapeProperties: ShapeProperties;\n}\n\nexport interface TextFrame extends DocumentFrame {\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumns: number;\n columnGap: number;\n textDirection: string;\n flowDirection: string;\n verticalAlign: string;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n}\n\nexport enum ImageFrameSourceType {\n url = 'url',\n assetProvider = 'assetProvider',\n variable = 'variable',\n}\n\nexport interface ImageFrameSource {\n type: ImageFrameSourceType;\n}\n\nexport interface ImageFrameUrlSource extends ImageFrameSource {\n url: string;\n}\n\nexport interface ImageFrameConnectorSource extends ImageFrameSource {\n id: string;\n assetId: string;\n}\n\nexport interface ImageFrameVariableSource extends ImageFrameSource {\n id: string;\n}\n\nexport interface Layout {\n id: string;\n name: string;\n frameProperties: (ChildFrameProperty | TopFrameProperty)[];\n width?: number;\n height?: number;\n childLayouts: string[];\n type: LayoutType;\n frameAnimations?: FrameAnimation[];\n timelineLengthMs?: number;\n animated?: boolean;\n intent?: LayoutIntent;\n}\n\nexport interface TopLayout extends Layout {\n frameAnimations: FrameAnimation[];\n timelineLengthMs: number;\n animated: boolean;\n intent: LayoutIntent;\n width: number;\n height: number;\n}\n\nexport interface ChildLayout extends Layout {\n parentId: Id;\n}\n\nexport enum FramePropertiesType {\n top = 'top',\n child = 'child',\n}\nexport interface FrameProperty {\n id: Id;\n x?: number;\n y?: number;\n width?: number;\n height?: number;\n rotationDegrees?: number;\n rotationOriginY?: number;\n scaleX?: number;\n scaleY?: number;\n isVisible?: boolean;\n type: FramePropertiesType;\n}\n\nexport type ChildFrameProperty = FrameProperty;\nexport interface TopFrameProperty extends FrameProperty {\n x: number;\n y: number;\n width: number;\n height: number;\n rotationDegrees: number;\n rotationOriginY: number;\n scaleX: number;\n scaleY: number;\n isVisible: boolean;\n}\n\nexport interface FrameAnimation {\n id: Id;\n from: number;\n to: number;\n basicAnimations: BasicAnimations;\n}\n\nexport interface BasicAnimations {\n intro?: BasicAnimationsIntroType;\n emphasis?: BasicAnimationsEmphasisType;\n outro?: BasicAnimationsOutroType;\n}\n\nexport interface DocumentStylekit {\n colors: DocumentColor[];\n characterStyles: DocumentCharacterStyle[];\n paragraphStyles: DocumentParagraphStyle[];\n}\n\nexport type DocumentCharacterStyle = CharacterStyle;\nexport type DocumentParagraphStyle = ParagraphStyle;\n\nexport interface DocumentVariable extends Variable {\n parentId: Id;\n name: string;\n label: string;\n isVisible: boolean;\n isReadonly: boolean;\n isRequired: boolean;\n value: string;\n defaultValue: string;\n}\n\nexport enum DocumentType {\n project = 'project',\n template = 'template',\n}\n\nexport interface DocumentProperties {\n type: DocumentType;\n}\n\nexport type TemplateDocumentProperties = DocumentProperties;\n\nexport interface ProjectDocumentProperties extends DocumentProperties {\n templateId: string;\n}\n\nexport type DocumentLoadOptions = {\n keepConnectors?: boolean;\n};\n","import type { EditorResponse } from '../types/CommonTypes';\n\nexport function getEditorResponseData<T>(response: EditorResponse<unknown>, parse = true): EditorResponse<T> {\n try {\n if (!response.success) {\n throw new Error(response.error ?? 'Yikes, something went wrong', {\n cause: {\n name: String(response.status),\n message: response.error ?? 'Yikes, something went wrong',\n },\n });\n }\n const dataShouldBeParsed = response.data && parse;\n return {\n ...response,\n parsedData: dataShouldBeParsed\n ? (JSON.parse(response.data as string) as T)\n : (response.data as unknown as T),\n };\n } catch (error) {\n console.error(error);\n throw error;\n }\n}\n\n// For testing purposes only\nexport function castToEditorResponse(toCast: unknown): EditorResponse<unknown> {\n return {\n status: 200,\n success: true,\n parsedData: null,\n data: JSON.stringify(toCast),\n };\n}\n","import { ActionDeltaUpdate, ActionTrigger, DocumentAction } from '../types/ActionTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ActionController is responsible for all Actions-related functionality.\n * Methods inside this controller can be called by `window.SDK.action.{method-name}`\n */\nexport class ActionController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of all actions.\n * @returns list of all actions\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getActions().then((result) => getEditorResponseData<DocumentAction[]>(result));\n };\n\n /**\n * This method returns an action by the id\n * @param id the id of a specific action\n * @returns action details\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getActionById(id).then((result) => getEditorResponseData<DocumentAction>(result));\n };\n\n /**\n * This method creates a new action.\n * @returns the id of the newly created action.\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createAction().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method duplicates an existing action by the id\n * @param id the id of a specific action\n * @returns the id of the duplicated action.\n */\n duplicate = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateAction(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method removes the action by the id\n * @param id the id of a specific action\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeAction(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method updates an existing Action\n * @param id the id of a specific Action\n * @param update the delta update to apply to the Action\n * @returns\n */\n update = async (id: Id, update: ActionDeltaUpdate) => {\n const res = await this.#editorAPI;\n return res.updateAction(id, JSON.stringify(update)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method renames an action by the id and provided name\n * @param id the id of a specific action\n * @param name the new unique name for the action\n * @returns\n */\n rename = async (id: Id, name: string) => {\n return this.update(id, { name: name });\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method updates the script the action uses by the id and provided script\n * @param id the id of a specific action\n * @param actionScript the JavaScript based action script\n * @returns\n */\n updateScript = async (id: Id, actionScript: string) => {\n return this.update(id, { script: actionScript });\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method updates the triggers on which the action will react.\n * @param id the id of a specific action\n * @param triggers the triggers this action should react on.\n * @returns\n */\n updateTriggers = async (id: Id, triggers: ActionTrigger[]) => {\n return this.update(id, { triggers: triggers });\n };\n\n /**\n * This method changes positions of actions\n * @param order the position of actions\n * @param ids the list of action IDs\n * @returns\n */\n move = async (order: number, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.moveActions(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated use the update method instead\n *\n * This method stores the state of action type errors to the document\n *\n * Those errors states can be read back from the usual getters or the\n * `onActionsChanged` stream\n * @param id the id of a specific action\n * @param hasTypeErrors whether there is an action type error\n * @returns\n */\n setTypeError = async (id: string, hasTypeErrors: boolean) => {\n return this.update(id, { hasTypeError: hasTypeErrors });\n };\n}\n","import { FrameAnimationPropertiesType } from '../types/AnimationTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The AnimationController is responsible for all communication regarding Animations.\n * Methods inside this controller can be called by `window.SDK.animation.{method-name}`\n */\nexport class AnimationController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(children: EditorAPI) {\n this.#editorAPI = children;\n }\n\n /**\n * This method returns all animations on current layout\n * @returns list of all animation on current layout\n */\n getAllOnSelectedLayout = async () => {\n const res = await this.#editorAPI;\n return res\n .getAnimationsOnSelectedLayout()\n .then((result) => getEditorResponseData<FrameAnimationPropertiesType[]>(result));\n };\n\n /**\n * This method returns an animation for a given frame and layout IDs\n * @param id the id of a specific frame\n * @param layoutId the id of a specific layout\n * @returns animation properties for a given frame and layout\n */\n getByFrameId = async (id: Id, layoutId?: Id) => {\n const res = await this.#editorAPI;\n return res\n .getAnimationByFrameId<string>(id, layoutId)\n .then((result) => getEditorResponseData<FrameAnimationPropertiesType>(result));\n };\n\n /**\n * This method returns the animations for a given layout id\n * @param id the id of a specific layout\n * @returns animation properties for a given layout\n */\n getByLayoutId = async (id: Id) => {\n const res = await this.#editorAPI;\n return res\n .getAnimationsByLayoutId(id)\n .then((result) => getEditorResponseData<FrameAnimationPropertiesType>(result));\n };\n\n /**\n * This method sets the animation state for a certain Frame\n * @param animation animation properties\n * @returns updated animation properties\n */\n setFrameAnimation = async (animation: FrameAnimationPropertiesType) => {\n const res = await this.#editorAPI;\n return res\n .setFrameAnimation(JSON.stringify(animation))\n .then((result) =>\n getEditorResponseData<FrameAnimationPropertiesType>({ ...result, data: JSON.stringify(animation) }),\n );\n };\n\n /**\n * This method triggers the animation to play\n * @returns\n */\n play = async () => {\n const res = await this.#editorAPI;\n return res.playAnimation().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method triggers the animation to pause\n * @returns\n */\n pause = async () => {\n const res = await this.#editorAPI;\n return res.pauseAnimation().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the animation time to a certain time, expressed in milliseconds\n * @param timeInMS the time expressed in milliseconds\n * @returns\n */\n setScrubberPosition = async (timeInMS: number) => {\n const res = await this.#editorAPI;\n return res.setScrubberPosition(timeInMS).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the total and maximum duration of the animation, expressed in milliseconds\n * @param timeInMS the time expressed in milliseconds\n * @returns\n */\n setDuration = async (timeInMS: number) => {\n const res = await this.#editorAPI;\n return res.setAnimationDuration(timeInMS).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method resets the animation to its initial state\n * @param id the id of a certain frame\n * @returns\n */\n resetFrameAnimation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameAnimation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method resets the layout's animations and animation duration to its initial state\n * @returns\n */\n reset = async () => {\n const res = await this.#editorAPI;\n return res.resetAnimation().then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ViewMode } from '../types/ViewModeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The CanvasController is responsible for all Canvas-related functionality.\n * Methods inside this controller can be called by `window.SDK.canvas.{method-name}`\n */\nexport class CanvasController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method fits the page to the given rectangle or the viewport available\n * Optional parameters `left`, `top`, `width` and `height` are needed to define the rectangle to fit the page to\n * If any or all of them aren't provided the page will fit the whole viewport available\n * @param id the id of a specific page\n * @param left\n * @param top\n * @param width\n * @param height\n * @returns\n */\n zoomToPage = async (\n id?: Id | null,\n left?: number | null,\n top?: number | null,\n width?: number | null,\n height?: number | null,\n ) => {\n const res = await this.#editorAPI;\n return res.zoomToPage(id, left, top, width, height).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets the scale factor of the canvas\n * @returns scale factor in percents\n */\n getZoomPercentage = async () => {\n const res = await this.#editorAPI;\n return res.getZoomPercentage().then((result) => getEditorResponseData<number>(result));\n };\n\n /**\n * This method sets the scale factor to the canvas and re-centers the page\n * @param scaleFactor scale factor in percents\n * @returns\n */\n setZoomPercentage = async (scaleFactor: number) => {\n const res = await this.#editorAPI;\n return res.setZoomPercentage(scaleFactor).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets a new view mode\n * @param viewMode view mode of the editor\n * @returns\n */\n setViewMode = async (viewMode: ViewMode) => {\n const res = await this.#editorAPI;\n return res.setViewMode(viewMode).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { CharacterStyle, CharacterStyleUpdate } from '../types/CharacterStyleTypes';\n\n/**\n * The CharacterStyleController is responsible for all communication regarding character styles.\n * Methods inside this controller can be called by `window.SDK.characterStyle.{method-name}`\n */\nexport class CharacterStyleController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of character styles\n * @returns list of all character styles\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getCharacterStyles().then((result) => getEditorResponseData<CharacterStyle[]>(result));\n };\n\n /**\n * This method returns a character style by the id\n * @param characterStyleId the id of a specific character style\n * @returns character style for given id\n */\n getById = async (characterStyleId: Id) => {\n const res = await this.#editorAPI;\n return res\n .getCharacterStyleById(characterStyleId)\n .then((result) => getEditorResponseData<CharacterStyle>(result));\n };\n\n /**\n * This method creates a new character style\n * @returns the id of new character style\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createCharacterStyle().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method updates a character style by the id and provided properties\n * @param characterStyleId the id of a specific character style\n * @param characterStyle the new character style properties\n * @returns\n */\n update = async (characterStyleId: Id, characterStyle: CharacterStyleUpdate) => {\n const res = await this.#editorAPI;\n return res\n .updateCharacterStyle(characterStyleId, JSON.stringify(characterStyle))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a character style by the id\n * @param characterStyleId the id of a specific character style\n * @returns\n */\n remove = async (characterStyleId: Id) => {\n const res = await this.#editorAPI;\n return res.removeCharacterStyle(characterStyleId).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method duplicates a character style by the id\n * @param characterStyleId the id of a specific character style\n * @returns id of the duplicated character style\n */\n duplicate = async (characterStyleId: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateCharacterStyle(characterStyleId).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method renames a character style by the id\n * @param characterStyleId the id of a specific character style\n * @param characterStyleName the new name of the character style\n * @returns\n */\n rename = async (characterStyleId: Id, characterStyleName: string) => {\n const res = await this.#editorAPI;\n return res\n .renameCharacterStyle(characterStyleId, characterStyleName)\n .then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorUpdate, DocumentColor } from '../types/ColorStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ColorStyleController is responsible for all communication regarding color styles.\n * Methods inside this controller can be called by `window.SDK.colorStyle.{method-name}`\n */\nexport class ColorStyleController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of colors\n * @returns list of all colors\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getColors().then((result) => getEditorResponseData<DocumentColor[]>(result));\n };\n\n /**\n * This method returns a color by id\n * @param id the id of a specific color\n * @returns color properties for given id\n */\n getById = async (id: string) => {\n const res = await this.#editorAPI;\n return res.getColorById(id).then((result) => getEditorResponseData<DocumentColor>(result));\n };\n\n /**\n * This method creates a new color\n * @returns the new created color id\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createColor().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method duplicates a color by the id\n * @param id the id of a specific color\n * @returns id of the duplicated color\n */\n duplicate = async (id: string) => {\n const res = await this.#editorAPI;\n return res.duplicateColor(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method changes positions of colors\n * @param order the position of the colors\n * @param ids the list of color IDs\n * @returns\n */\n move = async (order: number, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.moveColors(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method renames a color\n * @param id the id of a specific color\n * @param newColorName the new name of the color\n * @returns\n */\n rename = async (id: string, newColorName: string) => {\n const res = await this.#editorAPI;\n return res.renameColor(id, newColorName).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method updates a color\n * @param id the id of a specific color\n * @param newColorProperties the new color properties\n * @returns\n */\n update = async (id: string, newColorProperties: ColorUpdate) => {\n const res = await this.#editorAPI;\n return res\n .updateColor(id, JSON.stringify(newColorProperties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a color\n * @param id the id of a specific color\n * @returns\n */\n remove = async (id: string) => {\n const res = await this.#editorAPI;\n return res.removeColor(id).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Color, RGBColor } from '../types/ColorStyleTypes';\n\n/**\n * The ColorConversionController is responsible for all communication regarding color coversion.\n * Methods inside this controller can be called by `window.SDK.colorConversion.{method-name}`\n */\nexport class ColorConversionController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method converts the given color to its rgb representation\n * @param color the color to convert\n * @returns the rgb representation of the given color\n */\n convertToRgb = async (color: Color) => {\n const res = await this.#editorAPI;\n return res.colorToRgb(color).then((result) => getEditorResponseData<RGBColor>(result));\n };\n}\n","import { Id } from './CommonTypes';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport type QueryOptions = {\n filter?: string[] | null;\n collection?: string | null;\n pageToken?: string | null;\n pageSize?: number | null;\n sortBy?: SortBy | null;\n sortOrder?: SortOrder | null;\n};\n\nexport type FontConnectorCapabilities = {\n query: boolean;\n detail: boolean;\n preview: boolean;\n filtering: boolean;\n};\n\nexport type MediaConnectorCapabilities = {\n query: boolean;\n detail: boolean;\n filtering: boolean;\n};\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly available url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly available link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport class ConnectorMapping {\n name: string;\n value: string;\n direction = ConnectorMappingDirection.engineToConnector;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string,\n direction = ConnectorMappingDirection.engineToConnector,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `${mapFrom}.${sourceValue}`;\n } else {\n this.value = sourceValue;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = {\n pageSize: number;\n nextPageToken?: string;\n data: T[];\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n\n constructor(token: string) {\n this.token = token;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\n/**\n * @param connectorId connector id\n * @param type type of auth renewal needed\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AuthRefreshRequest = {\n connectorId: Id;\n type: AuthRefreshTypeEnum;\n headerValue: string | null;\n};\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { StudioOptionsDeltaUpdate, WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\n\n/**\n * The ConfigurationController allows setting editor session data. This data is not stored in the document and\n * can only be used at runtime. Amongst others, the configuration store is available to the editor connectors and\n * Javascript actions running in the editor.\n * Methods inside this controller can be called by `window.SDK.configuration.{method-name}`\n */\nexport class ConfigurationController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the value for a given configuration key. If a value was not found in the configuration store\n * this method returns an error. The key cannot be null.\n * @returns value for a given configuration key\n */\n getValue = async (key: WellKnownConfigurationKeys | string) => {\n const res = await this.#editorAPI;\n return res.getConfigValue(key).then((result) => getEditorResponseData<string>(result));\n };\n\n /**\n * This method sets, or overrides the value for a given key. Null values are not allowed for both key and value,\n * using them will result in an error.\n * @returns\n */\n setValue = async (key: WellKnownConfigurationKeys | string, value: string) => {\n const res = await this.#editorAPI;\n return res.setConfigValue(key, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method updates the studio options. Only defined options are updated, null values are ignored.\n * @returns\n */\n updateStudioOptions = async (options: StudioOptionsDeltaUpdate) => {\n const res = await this.#editorAPI;\n return res.updateStudioOptions(JSON.stringify(options)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method returns the engine session id. This id is unique for this engine session\n * @returns the engine session id\n */\n getEngineSessionId = async () => {\n const res = await this.#editorAPI;\n return res.getEngineSessionId().then((result) => getEditorResponseData<string>(result));\n };\n}\n","import { ConnectorOptions, EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\r\nimport {\r\n ConnectorState,\r\n ConnectorStateType,\r\n ConnectorMapping,\r\n ConnectorRegistration,\r\n ConnectorInstance,\r\n ConnectorType,\r\n} from '../types/ConnectorTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\n/**\r\n * The ConnectorController manages lifetime of all available connectors, regardless of the type, in the\r\n * document. Use it to add/remove connectors to a template, or set specific configuration.\r\n *\r\n * The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an\r\n * implementation of a set of capabilities we need to interact with a certain external resource management system.\r\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\r\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\r\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\r\n * generation.\r\n * This controller is an interface to the running connector instance inside the studio engine. The engine will\r\n * automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered\r\n * manually.\r\n */\r\nexport class ConnectorController {\r\n /**\r\n * @ignore\r\n */\r\n #editorAPI: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(editorAPI: EditorAPI) {\r\n this.#editorAPI = editorAPI;\r\n }\r\n\r\n /**\r\n * Gets a connector by its id\r\n * @param id the id of the connector\r\n * @returns connector\r\n */\r\n getById = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorById(id).then((result) => getEditorResponseData<ConnectorInstance>(result));\r\n };\r\n\r\n /**\r\n * Gets all available connectors of a 'ConnectorType'\r\n * @param type type of connector you want to get\r\n * @returns list of all available connectors of a 'ConnectorType'\r\n */\r\n getAllByType = async (type: ConnectorType) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectors(type).then((result) => getEditorResponseData<ConnectorInstance[]>(result));\r\n };\r\n\r\n /**\r\n * Registers a new connector in the SDK. After successful registration, depending\r\n * on the connector type, the connector can be configured and used in the template\r\n * Remember to add custom authentication information after registering the connector\r\n * @param registration registration object containing all details about the connector\r\n * @returns the Id of the newly created connector, this Id should be used going forward.\r\n */\r\n register = async (registration: ConnectorRegistration) => {\r\n const res = await this.#editorAPI;\r\n return res.registerConnector(JSON.stringify(registration)).then((result) => getEditorResponseData<Id>(result));\r\n };\r\n\r\n /**\r\n * Unregisters a connector from the document.\r\n * @param id the id of the connector to unregister\r\n * @returns\r\n */\r\n unregister = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.unregisterConnector(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Configures a registered connector. A configurator helper is passed as an argument\r\n * of the callback for you to setup your connector.\r\n * @param id the id of your registered connector\r\n * @param configurationCallback callback to setup the connector\r\n * @returns\r\n */\r\n configure = async (id: Id, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => {\r\n const res = await this.#editorAPI;\r\n // wait for connector to be ready\r\n await this.waitToBeReady(id);\r\n // execute callback\r\n await configurationCallback(new ConnectorConfigurator(id, res));\r\n // invalidate connector in engine\r\n return res.updateConnectorConfiguration(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitToBeReady'\r\n * method in this controller.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns connector state\r\n */\r\n getState = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorState(id).then((result) => getEditorResponseData<ConnectorState>(result));\r\n };\r\n\r\n /**\r\n * Gets the mapped data from connector.\r\n * @param id the id of your registered connector\r\n * @returns mappings\r\n */\r\n getMappings = async (id: string) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorMappings(id).then((result) => getEditorResponseData<ConnectorMapping[]>(result));\r\n };\r\n\r\n /**\r\n * Gets the options from the connector.\r\n * @param id the id of your registered connector\r\n * @returns options\r\n */\r\n getOptions = async (id: string) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorOptions(id).then((result) => getEditorResponseData<ConnectorOptions>(result));\r\n };\r\n\r\n /**\r\n * Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure\r\n * an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure\r\n * the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially\r\n * useful during startup of the SDK / right after the loadDocument call.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns\r\n */\r\n waitToBeReady = async (id: Id, timeoutMilliseconds = 2000): Promise<EditorResponse<null>> => {\r\n // minimum timeout is 500ms\r\n let timeout = Math.max(timeoutMilliseconds, 500);\r\n\r\n // maximum timeout is 5000ms\r\n timeout = Math.min(timeout, 5000);\r\n\r\n const waitTime = 100;\r\n let retries = 0;\r\n\r\n try {\r\n // using while loop will prevent stack overflow issues when using recursion\r\n // wait for maximum 2 seconds to fail\r\n while (retries * waitTime < timeout) {\r\n const result = await this.getState(id);\r\n\r\n if (\r\n result.success &&\r\n result.parsedData &&\r\n (result.parsedData.type === ConnectorStateType.running ||\r\n result.parsedData.type === ConnectorStateType.ready)\r\n ) {\r\n return getEditorResponseData<null>(\r\n { data: null, success: true, error: undefined, status: 0, parsedData: undefined },\r\n false,\r\n );\r\n }\r\n\r\n await new Promise((resolve) => setTimeout(resolve, waitTime));\r\n retries++;\r\n }\r\n } catch (err) {\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Error while getting connector state ${err}`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n }\r\n\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Timed out waiting for connector`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n };\r\n}\r\n\r\n/**\r\n * Helper to setup your connector\r\n */\r\nclass ConnectorConfigurator {\r\n /**\r\n * @ignore\r\n */\r\n #connectorId: Id;\r\n #res: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(id: Id, res: EditorAPI) {\r\n this.#connectorId = id;\r\n this.#res = res;\r\n }\r\n\r\n /**\r\n * Allows to customize the context data a connector can work with. The options data\r\n * will be available using the context parameter in the connector implementation code.\r\n * @param options object containing key value data to pass to connector context\r\n * @returns\r\n */\r\n setOptions = async (options: ConnectorOptions) => {\r\n return this.#res\r\n .setConnectorOptions(this.#connectorId, JSON.stringify(options))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Allows to map variables or strings to connector context data.\r\n * By defining the mappings, we can trigger re-download of assets (dynamic asset provider)\r\n * or populate filters for the query endpoint. The mapped data will be available using\r\n * the context parameter in the connector implementation code.\r\n *\r\n * For the variables the mapping should follow the format \"var.[variable id]\". e.g. var.6B29FC40-CA47-1067-B31D-00DD010662DA\r\n *\r\n * @param mappings collection of mappings to set to this connector\r\n * @returns\r\n */\r\n setMappings = async (mappings: ConnectorMapping[]) => {\r\n const result = await this.#res.setConnectorMappings(\r\n this.#connectorId,\r\n mappings.map(function (m) {\r\n return JSON.stringify(m);\r\n }),\r\n );\r\n return getEditorResponseData<null>(result);\r\n };\r\n\r\n /**\r\n * This method sets the HTTP headers for the 'staticKey' authentication type.\r\n * These additional headers will be added to all connector http calls.\r\n * Can only be used after a connector has been registered. (if you are using a grafx connector no registration is needed)\r\n * @param headerName name of the header\r\n * @param headerValue value of the header\r\n * @returns\r\n */\r\n setHttpHeader = async (headerName: string, headerValue: string) => {\r\n return this.#res\r\n .connectorAuthenticationSetHttpHeader(this.#connectorId, headerName, headerValue)\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n","import { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { DebugData } from '../types/DebugTypes';\n\n/**\n * The DebugController is responsible for all communication regarding Debugging.\n * Methods inside this controller can be called by `window.SDK.debug.{method-name}`\n */\nexport class DebugController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns all debug logs\n * @returns list of all debug logs\n */\n getAllLogs = async () => {\n const res = await this.#editorAPI;\n return res.getLogs().then((result) => getEditorResponseData<DebugData[]>(result));\n };\n\n /**\n * This method toggles the showcase of debug panel\n * @returns\n */\n toggleDebugPanel = async () => {\n const res = await this.#editorAPI;\n return res.toggleDebugPanel().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method enables the debugging\n * @returns\n */\n enableDebug = async () => {\n const res = await this.#editorAPI;\n return res.enableDebug().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method disables the debugging\n * @returns\n */\n disableDebug = async () => {\n const res = await this.#editorAPI;\n return res.disableDebug().then((result) => getEditorResponseData<null>(result));\n };\n}\n","// FramePropertiesDto\nimport { BarcodeCharacterSet, BarcodeErrorCorrectionLevel, BarcodeType, QuietZone } from './BarcodeTypes';\nimport { ColorUsage } from './ColorStyleTypes';\nimport { Id, PropertyState } from './CommonTypes';\nimport { CornerRadiusAll, CornerRadiusNone, CornerRadiusOnly, ShapeType } from './ShapeTypes';\n\nexport type FrameLayoutType = {\n id: Id;\n layoutId: Id;\n x: PropertyState<number>;\n y: PropertyState<number>;\n width: PropertyState<number>;\n height: PropertyState<number>;\n rotationDegrees: PropertyState<number>;\n scaleX: PropertyState<number>;\n scaleY: PropertyState<number>;\n isVisible: PropertyState<boolean>;\n fitMode: PropertyState<FitMode>;\n hasImageCrop: PropertyState<boolean>;\n minCopyfitting: PropertyState<number>;\n maxCopyfitting: PropertyState<number>;\n enableCopyfitting: PropertyState<boolean>;\n} | null;\n\n//Frame.image\nexport type FrameType = {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n // `imageUrl` is not generic: should be removed from model\n imageUrl: string;\n blendMode: string;\n constrainProportions: boolean;\n constrainProportionsReadOnly: boolean;\n};\n\nexport type Frame = TextFrame | ImageFrame | ShapeFrame | BarcodeFrame;\n\nexport type ImageFrameVariableSource = {\n type: ImageSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type ImageFrameUrlSource = {\n type: ImageSourceTypeEnum.url;\n url: string;\n};\n\nexport type ImageFrameConnectorSource = {\n assetId: Id;\n id: Id;\n type: ImageSourceTypeEnum.connector;\n};\n\nexport type ImageFrameSource = ImageFrameConnectorSource | ImageFrameVariableSource | ImageFrameUrlSource;\n\n// used by new getter methods\nexport type ImageFrame = {\n id: Id;\n name: string;\n type: FrameTypeEnum.image;\n src?: ImageFrameSource;\n blendMode: BlendMode;\n constrainProportions: boolean;\n constrainProportionsReadOnly: boolean;\n crop?: CropSettings | NoCropSettings;\n};\n\nexport type ShapeFrame = {\n id: Id;\n name: string;\n type: FrameTypeEnum.shape;\n blendMode: BlendMode;\n constrainProportions: boolean;\n constrainProportionsReadOnly: boolean;\n shapeProperties: {\n enableFill: boolean;\n fillColor: ColorUsage;\n enableStroke: boolean;\n strokeWeight: number;\n strokeColor: ColorUsage;\n allCornersSame: boolean;\n };\n src: {\n type: ShapeType;\n cornerRadius: CornerRadiusNone | CornerRadiusAll | CornerRadiusOnly;\n sides?: number;\n };\n};\n\nexport type TextFrame = {\n id: Id;\n name: string;\n type: FrameTypeEnum.text;\n textContent: string;\n paddingLeft: number;\n paddingTop: number;\n paddingRight: number;\n paddingBottom: number;\n numberOfColumn: number;\n columnGap: number;\n textDirection: TextDirection;\n flowDirection: FlowDirection;\n verticalAlign: VerticalAlign;\n textStroke: boolean;\n textStrokeWeight: number;\n textStrokeColor: number;\n hasClippingPath: boolean;\n blendMode: BlendMode;\n constrainProportions: boolean;\n constrainProportionsReadOnly: boolean;\n};\n\nexport type BarcodeFrame = {\n id: Id;\n name: string;\n type: FrameTypeEnum.barcode;\n blendMode: BlendMode;\n constrainProportions: boolean;\n constrainProportionsReadOnly: boolean;\n barcodeProperties: {\n enableBackground: boolean;\n backgroundColor: ColorUsage;\n enableBarColor: boolean;\n barColor: ColorUsage;\n enableText: boolean;\n barHeight: number;\n magnification: number;\n quietZone: QuietZone;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n };\n src?: BarcodeSource;\n barcodeType: BarcodeType;\n};\n\nexport type BarcodeSource = BarcodeVariableSource | BarcodeTextSource;\n\nexport type BarcodeVariableSource = {\n type: BarcodeSourceTypeEnum.variable;\n id: Id;\n};\n\nexport type BarcodeTextSource = {\n type: BarcodeSourceTypeEnum.text;\n text: string;\n};\n\nexport type CropSettings = {\n left: number;\n top: number;\n width: number;\n height: number;\n rotationDegrees: number;\n type: 'default';\n};\n\nexport type NoCropSettings = {\n type: 'noCrop';\n};\n\nexport enum ImageSourceTypeEnum {\n url = 'url',\n variable = 'variable',\n connector = 'connector',\n}\n\nexport enum FrameTypeEnum {\n text = 'text',\n image = 'image',\n shape = 'shape',\n barcode = 'barcode',\n}\n\nexport enum BarcodeSourceTypeEnum {\n variable = 'variable',\n text = 'text',\n}\n\nexport enum TextDirection {\n leftToRight = 'leftToRight',\n rightToLeft = 'rightToLeft',\n weak = 'weak',\n}\n\nexport enum FlowDirection {\n horizontal = 'horizontal',\n vertical = 'vertical',\n onPath = 'onPath',\n}\n\nexport enum VerticalAlign {\n top = 'top',\n bottom = 'bottom',\n middle = 'middle',\n justify = 'justify',\n}\n\nexport enum BlendMode {\n normal = 'normal',\n screen = 'screen',\n overlay = 'overlay',\n darken = 'darken',\n lighten = 'lighten',\n colorDodge = 'colorDodge',\n colorBurn = 'colorBurn',\n hardLight = 'hardLight',\n softLight = 'softLight',\n difference = 'difference',\n exclusion = 'exclusion',\n multiply = 'multiply',\n hue = 'hue',\n saturation = 'saturation',\n color = 'color',\n luminosity = 'luminosity',\n}\n\nexport enum FitMode {\n fit = 'fit',\n fill = 'fill',\n}\n\nexport enum UpdateZIndexMethod {\n bringToFront = 'bringToFront',\n sendToBack = 'sendToBack',\n bringForward = 'bringForward',\n sendBackward = 'sendBackward',\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport type { ChiliDocument, DocumentLoadOptions } from '../types/DocumentTypes';\n\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n/**\n * The DocumentController is responsible for all communication regarding the Document.\n * Methods inside this controller can be called by `window.SDK.document.{method-name}`\n */\n\nexport class DocumentController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method retrieves the current document state from the editor\n * @returns the JSON document in the form of a string\n */\n getCurrentState = async () => {\n const res = await this.#editorAPI;\n return res.getCurrentDocumentState().then((result) => getEditorResponseData<ChiliDocument>(result));\n };\n\n /**\n * This method will load a provided document in the ChiliDocument format and\n * clean old document states.\n * If you set `DocumentLoadOptions.keepConnectors` to true, `load` will keep\n * your old connectors states e.g. options, authentication..\n * By default `keepConnectors` is false and your connectors states are reset.\n * In this case, you would need to configure your connectors appropriately\n * beforehand.\n * @param doc the document to load in\n * @param options the options object for setting up the document load\n * @returns the document loaded inside of the canvas\n */\n load = async (doc: ChiliDocument | string, options: DocumentLoadOptions = { keepConnectors: false }) => {\n const res = await this.#editorAPI;\n\n // Note: loadDocumentKeepConnectors is a temporary engine call to make the\n // merging smoother, it will be removed when all projects will point to\n // this SDK version but the SDK API won't change. -> [EDT-1107]\n const loadDocumentRedirection = options.keepConnectors ? res.loadDocumentKeepConnectors : res.loadDocument;\n const parsedDoc = typeof doc !== 'string' ? JSON.stringify(doc) : doc;\n\n return loadDocumentRedirection(parsedDoc).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { ImageSourceTypeEnum, ImageFrameVariableSource } from '../types/FrameTypes';\nimport { TextType } from '../types/TextTypes';\n\n/**\n * The ExperimentController contains all SDK functions that are considered for addition,\n * or functions we want to keep open for changing definitions. This is a sneak peak\n * into future versions of the SDK. Never build production code relying on functions in\n * this controller.\n */\nexport class ExperimentController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method will assign an image from a variable to the correct ImageFrame\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param variableId the id of the variable which contains the image\n * @returns\n */\n insertImageVariableToFrame = async (imageFrameId: Id, variableId: Id) => {\n const res = await this.#editorAPI;\n const src: ImageFrameVariableSource = { id: variableId, type: ImageSourceTypeEnum.variable };\n return res\n .setImageSource(imageFrameId, JSON.stringify(src))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will insert a text variable in the selected frame. Calling this method\n * requires that the selected frame is in text editing mode.\n * @param id the id of the variable to be inserted.\n * @returns\n */\n insertTextVariable = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.insertTextVariable(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will enter text editing mode on the provided frame.\n * @param id the id frame to enter text edit mode on.\n * @returns\n */\n enterTextEditMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterTextEditMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit text editing mode.\n * @returns\n */\n exitTextEditMode = async () => {\n const res = await this.#editorAPI;\n return res.exitTextEditMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets the text content of a text frame.\n * The variables contained in the text will return their values only if you\n * are in text editing mode.\n * @param frameId The ID of a text frame\n * @param textType The type of the text\n * @returns the text content\n */\n getText = async (frameId: string, textType: TextType) => {\n const res = await this.#editorAPI;\n return res.getTextByFrameId(frameId, textType).then((result) => getEditorResponseData<string>(result));\n };\n\n /**\n * This method sets the text content of a text frame\n * @param frameId The ID of a text frame\n * @param text The new text content\n * @returns\n */\n setText = async (frameId: string, text: string) => {\n const res = await this.#editorAPI;\n return res.setTextByFrameId(frameId, text).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method selects the text content of a text frame\n * @param frameId The ID of a text frame\n * @param startIndex The index where the selection starts\n * @param length The length of selection from startIndex\n * @returns\n */\n selectText = async (frameId: string, startIndex: number, length: number) => {\n const res = await this.#editorAPI;\n return res.selectTextById(frameId, startIndex, length).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { ConnectorConfigOptions, EditorAPI, EditorRawAPI, EditorResponse, MetaData } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n DeprecatedMediaType,\n FontConnectorCapabilities,\n MediaType,\n QueryOptions,\n QueryPage,\n} from '../types/ConnectorTypes';\nimport { FontFamily, FontPreviewFormat, FontStyle } from '../types/FontConnectorTypes';\nimport { CallSender } from 'penpal';\n\n/**\n * The FontConnectorController is responsible for all communication regarding Font connectors.\n * Methods inside this controller can be called by `window.SDK.FontConnector.{method-name}`\n *\n * The way CHILI Studio handles different sources of Font is called 'FontConnectors'. A FontConnectors is an\n * implementation of a set of capabilities we need to interact with a certain Digital Asset Management system.\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\n * execute the Font connector both on web using webassembly and on the server side during e.g. animation output\n * generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class FontConnectorController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\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 * Query a specific FontConnector for data using both standardized queryOptions and the dynamic\n * context as parameters.\n * @param connectorId unique id of the Font connector\n * @param queryOptions query options\n * @param context context that will be available in the connector script.\n * @returns array of font families\n */\n query = async (connectorId: string, queryOptions: QueryOptions, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorQuery(connectorId, JSON.stringify(queryOptions), JSON.stringify(context))\n .then((result) => getEditorResponseData<QueryPage<FontFamily>>(result));\n };\n\n /**\n * Returns all font styles for a family using a specific FontConnector. The connector needs to list `detail` as a supported capability.\n * @param connectorId unique id of the Font connector\n * @param fontFamilyId unique id of the Font family\n * @param context context that will be available in the connector script.\n * @returns array of font styles\n */\n detail = async (connectorId: string, fontFamilyId: string, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorDetail(connectorId, fontFamilyId, JSON.stringify(context))\n .then((result) => getEditorResponseData<FontStyle[]>(result));\n };\n\n /**\n * The combination of a `connectorId` and `fontId` is typically enough for a Font connector to\n * perform the download of this asset. The `download` endpoint is capable of relaying this information to the\n * Font connector instance running in the editor engine.\n * @param connectorId unique id of the Font connector\n * @param fontStyleId unique id of the Font style to download\n * @param context context that will be available in the connector script.\n * @returns\n */\n download = async (connectorId: string, fontStyleId: string, context: MetaData = {}): Promise<Uint8Array> => {\n const res = await this.#blobAPI;\n return res\n .fontConnectorDownload(connectorId, fontStyleId, JSON.stringify(context))\n .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * The combination of a `connectorId` and `fontFamilyId` is typically enough for a Font connector to\n * perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the\n * Font connector instance running in the editor engine.\n * @param connectorId unique id of the Font connector\n * @param fontFamilyId unique id of the Font family to download\n * @param previewFormat hint to the Font connector about desired format of the Font preview\n * @param context dynamic map of additional options potentially used by the connector\n * @returns\n */\n preview = async (\n connectorId: string,\n fontFamilyId: string,\n previewFormat: FontPreviewFormat,\n context: MetaData = {},\n ): Promise<Uint8Array> => {\n const res = await this.#blobAPI;\n return res\n .fontConnectorPreview(connectorId, fontFamilyId, previewFormat, JSON.stringify(context))\n .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n * mappings, they will be available in the `context` parameter of any connector method.\n * @param connectorId unique id of the media connector\n * @returns connector mappings\n */\n getConfigurationOptions = async (connectorId: string) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorGetConfigurationOptions(connectorId)\n .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n };\n\n /**\n * This method returns what capabilities the selected connector has. It gives an indication what methods can\n * be used successfully for a certain connector.\n * @param connectorId unique id of the Font connector\n * @returns FontConnectorCapabilities\n */\n getCapabilities = async (connectorId: string) => {\n const res = await this.#editorAPI;\n return res\n .fontConnectorGetCapabilities(connectorId)\n .then((result) => getEditorResponseData<FontConnectorCapabilities>(result));\n };\n\n /**\n * This method will parse the deprecatedFontType to the new Font type. This method will be removed once the deprecatedFontType is out of use\n * @param deprecatedType is 0 or 1\n * @returns MediaType value\n */\n parseDeprecatedFontType = (deprecatedType: DeprecatedMediaType) => {\n if (deprecatedType === DeprecatedMediaType.file) return MediaType.file;\n if (deprecatedType === DeprecatedMediaType.collection) return MediaType.collection;\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\r\nimport { AddDocumentFontFamily, AddDocumentFontStyle, DocumentFontFamily, DocumentFontStyle } from '../types/FontTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\n/**\r\n * The FontController is responsible for all communication regarding font styles.\r\n * Methods inside this controller can be called by `window.SDK.font.{method-name}`\r\n */\r\nexport class FontController {\r\n /**\r\n * @ignore\r\n */\r\n #editorAPI: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(editorAPI: EditorAPI) {\r\n this.#editorAPI = editorAPI;\r\n }\r\n\r\n /**\r\n * This method adds a font family\r\n * @param connectorId unique id of the font connector\r\n * @param fontFamily the font family object\r\n * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID`\r\n */\r\n addFontFamily = async (connectorId: Id, fontFamily: AddDocumentFontFamily) => {\r\n const res = await this.#editorAPI;\r\n return res\r\n .addFontFamily(connectorId, JSON.stringify(fontFamily))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method removes a font family\r\n * @param id the id of a specific font family\r\n * @returns\r\n */\r\n removeFontFamily = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.removeFontFamily(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method adds a font style\r\n * @param connectorId unique id of the font connector\r\n * @param fontStyle the font object\r\n * @returns id generated on the engine side `CONNECTOR_ID::FONT_FAMILY_ID::FONT_STYLE_ID`\r\n */\r\n addFontStyle = async (connectorId: Id, fontStyle: AddDocumentFontStyle) => {\r\n const res = await this.#editorAPI;\r\n return res\r\n .addFontStyle(connectorId, JSON.stringify(fontStyle))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method removes a font style\r\n * @param id the id of a specific font style\r\n * @returns\r\n */\r\n removeFontStyle = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.removeFontStyle(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * This method returns the list of font families\r\n * @returns DocumentFontFamily[]\r\n */\r\n getFontFamilies = async () => {\r\n const res = await this.#editorAPI;\r\n return res.getFontFamilies().then((result) => getEditorResponseData<DocumentFontFamily[]>(result));\r\n };\r\n\r\n /**\r\n * This method returns the list of font styles for a specific family\r\n * @param id the id of a specific font style\r\n * @returns DocumentFontStyle[]\r\n */\r\n getFontStyles = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getFontStyles(id).then((result) => getEditorResponseData<DocumentFontStyle[]>(result));\r\n };\r\n\r\n /**\r\n * This method returns a font family by id\r\n * @param id the id of a specific font family\r\n * @returns DocumentFontFamily properties\r\n */\r\n getFontFamilyById = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getFontFamilyById(id).then((result) => getEditorResponseData<DocumentFontFamily>(result));\r\n };\r\n\r\n /**\r\n * This method returns a font style by id\r\n * @param id the id of a specific font style\r\n * @returns DocumentFontStyle properties\r\n */\r\n getFontStyleById = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getFontStyleById(id).then((result) => getEditorResponseData<DocumentFontStyle>(result));\r\n };\r\n\r\n /**\r\n * This method returns the default font.\r\n * Be aware that the default font will not change during the entire lifetime of the SDK session.\r\n * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.\r\n * @returns a default DocumentFontStyle\r\n */\r\n\r\n getDefaultFontStyle = async () => {\r\n const res = await this.#editorAPI;\r\n return res.getDefaultFontStyle().then((result) => getEditorResponseData<DocumentFontStyle>(result));\r\n };\r\n\r\n /**\r\n * This method returns the default font family.\r\n * Be aware that the default font family will not change during the entire lifetime of the SDK session.\r\n * It is not necessary to call this more than once in an integration, this value can be safely stored during the lifetime of this SDK session.\r\n * @returns a default DocumentFontFamily\r\n */\r\n getDefaultFontFamily = async () => {\r\n const res = await this.#editorAPI;\r\n return res.getDefaultFontFamily().then((result) => getEditorResponseData<DocumentFontFamily>(result));\r\n };\r\n\r\n /**\r\n * Check if the font family is used anywhere in the document\r\n * @param id the id of the font family to check\r\n * @returns boolean\r\n */\r\n isFontFamilyUsed = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.isFontFamilyUsed(id).then((result) => getEditorResponseData<boolean>(result));\r\n };\r\n\r\n /**\r\n * Check if the font style is used anywhere in the document\r\n * @param id the id of the font style to check\r\n * @returns boolean\r\n */\r\n isFontStyleUsed = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.isFontStyleUsed(id).then((result) => getEditorResponseData<boolean>(result));\r\n };\r\n\r\n /**\r\n * This method changes positions of font families\r\n * @param order the position of the font family\r\n * @param ids the list of font family IDs\r\n * @returns\r\n */\r\n moveFontFamilies = async (order: number, ids: string[]) => {\r\n const res = await this.#editorAPI;\r\n return res.moveFontFamilies(order, ids).then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport { CornerRadiusUpdateModel, ShapeProperties } from '../types/ShapeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ShapeController is responsible for all communication regarding Shapes.\n * Methods inside this controller can be called by `window.SDK.shape.{method-name}`\n */\nexport class ShapeController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method updates properties of the shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param properties A property to update\n * @returns\n */\n private setShapeProperties = async (id: Id, properties: ShapeProperties) => {\n const res = await this.#editorAPI;\n return res\n .setShapeProperties(id, JSON.stringify(properties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the visibility of the shape fill.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param enableFill Whether the shape fill is visible.\n * @returns\n */\n setEnableFill = async (id: Id, enableFill: boolean) => {\n const properties: ShapeProperties = { enableFill: enableFill };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the shape fill color of a specified shape frame.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param fillColor the new shape fill color that you want to set to the shapeFrame.\n * @returns\n */\n setFillColor = async (id: Id, fillColor: ColorUsage) => {\n const properties: ShapeProperties = { fillColor: fillColor };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the visibility of the shape stroke.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param enableStroke Whether the shape stroke is visible.\n * @returns\n */\n setEnableStroke = async (id: Id, enableStroke: boolean) => {\n const properties: ShapeProperties = { enableStroke: enableStroke };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the shape stroke color of a specified shape frame.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param strokeColor the new shape stroke color that you want to set to the shapeFrame.\n * @returns\n */\n setStrokeColor = async (id: Id, strokeColor: ColorUsage) => {\n const properties: ShapeProperties = { strokeColor: strokeColor };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the shape stroke weight of a specified shape frame.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param strokeWeight the new shape stroke weight that you want to set to the shapeFrame.\n * @returns\n */\n setStrokeWeight = async (id: Id, strokeWeight: number) => {\n const properties: ShapeProperties = { strokeWeight: strokeWeight };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method will set the flag to change the way the rectangle shape corners will be changed: all at once or separately.\n * @param id the id of the shapeFrame that needs to get updated.\n * @param allCornersSame the new flag that you want to set to the shapeFrame.\n * @returns\n */\n setFlagAllCornersSame = async (id: Id, allCornersSame: boolean) => {\n const properties: ShapeProperties = { allCornersSame: allCornersSame };\n return this.setShapeProperties(id, properties);\n };\n\n /**\n * This method updates radii of the rectangle and polygon shapes\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius object to update a desired corner;\n * @returns\n */\n private setShapeCorners = async (id: Id, radius: CornerRadiusUpdateModel) => {\n const res = await this.#editorAPI;\n return res.setShapeCorners(id, JSON.stringify(radius)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the radius for all corners of the rectangle and polygon shapes\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update all corners at once;\n * @returns\n */\n setRadiusAll = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { radiusAll: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the top left corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the top left corner;\n * @returns\n */\n setRadiusTopLeft = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { topLeft: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the bottom left corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the bottom left corner;\n * @returns\n */\n setRadiusBottomLeft = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { bottomLeft: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the top right corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the top right corner;\n * @returns\n */\n setRadiusTopRight = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { topRight: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n\n /**\n * This method will set the radius for the bottom right corner of the rectangle shape\n * @param id the id of the shapeFrame that needs to get updated.\n * @param radius A radius to update the bottom right corner;\n * @returns\n */\n setRadiusBottomRight = async (id: Id, radius: number) => {\n const cornerRadius: CornerRadiusUpdateModel = { bottomRight: radius };\n return this.setShapeCorners(id, cornerRadius);\n };\n}\n","import { ColorUsage } from './ColorStyleTypes';\nimport { Id, PropertyState } from './CommonTypes';\n\nexport type LayoutPropertiesType = {\n id: Id;\n width: { value: number; isOverride: boolean };\n height: { value: number; isOverride: boolean };\n timelineLengthMs: { value: number; isOverride: boolean };\n [key: string]: number | string | Record<string, unknown>;\n} | null;\n\nexport type FrameProperties = {\n id: Id;\n type: string;\n height: number | null;\n isVisible: boolean | null;\n rotationDegrees: number | null;\n scaleX: number | null;\n scaleY: number | null;\n width: number | null;\n x: number | null;\n y: number | null;\n};\n\nexport type LayoutWithFrameProperties = {\n id: Id;\n name: string;\n parentId?: Id;\n frameProperties: FrameProperties[];\n width: number | null;\n height: number | null;\n childLayouts: Id[];\n type: LayoutType;\n timelineLengthMs?: number;\n children?: LayoutWithFrameProperties[];\n intent: LayoutIntent | null;\n};\n\n// used by new getter methods\nexport type Layout = {\n id: Id;\n name: string;\n parentId?: Id;\n width: PropertyState<number>;\n height: PropertyState<number>;\n childLayouts: Id[];\n timelineLengthMs: PropertyState<number>;\n unit: PropertyState<MeasurementUnit>;\n intent: PropertyState<LayoutIntent>;\n bleed: PropertyState<LayoutBleed>;\n fillColor: PropertyState<ColorUsage>;\n fillColorEnabled: PropertyState<boolean>;\n};\n\n// used by onLayoutsChanged\nexport type LayoutListItemType = {\n id: string;\n name: string;\n type: LayoutType;\n parentId?: Id | null;\n childLayouts: Id[];\n};\n\nexport type LayoutBleed = {\n left: number;\n top: number;\n right: number;\n bottom: number;\n areBleedValuesCombined: boolean;\n};\n\nexport type BleedDeltaUpdate = {\n left?: string;\n top?: string;\n right?: string;\n bottom?: string;\n areBleedValuesCombined?: boolean;\n};\n\nexport enum PositionEnum {\n top = 'top',\n right = 'right',\n bottom = 'bottom',\n left = 'left',\n}\n\nexport enum LayoutType {\n top = 'top',\n child = 'child',\n}\n\nexport enum MeasurementUnit {\n px = 'px',\n mm = 'mm',\n cm = 'cm',\n inch = 'inch',\n pt = 'pt',\n}\n\nexport enum LayoutIntent {\n print = 'print',\n digitalStatic = 'digitalStatic',\n digitalAnimated = 'digitalAnimated',\n}\n","import type { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n BlendMode,\n FitMode,\n FrameLayoutType,\n FrameType,\n FrameTypeEnum,\n ImageFrameConnectorSource,\n ImageFrameSource,\n ImageFrameUrlSource,\n ImageSourceTypeEnum,\n UpdateZIndexMethod,\n VerticalAlign,\n} from '../types/FrameTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport { ShapeType } from '../types/ShapeTypes';\nimport { ShapeController } from './ShapeController';\nimport { BarcodeType } from '../types/BarcodeTypes';\n\n/**\n * The FrameController is responsible for all communication regarding Frames.\n * Methods inside this controller can be called by `window.SDK.frame.{method-name}`\n */\nexport class FrameController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.shapeController = new ShapeController(this.#editorAPI);\n }\n\n /**\n * This variable helps to redirect shapes related methods to newly introduced ShapeController\n * to avoid any breaking changes\n */\n private shapeController: ShapeController;\n /**\n * This method returns the list of frames\n * @returns list of all frames\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getFrames().then((result) => getEditorResponseData<FrameType[]>(result));\n };\n\n /**\n * This method returns the list of selected frames\n * @returns list of all selected frames\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedFrames().then((result) => getEditorResponseData<FrameType[]>(result));\n };\n\n /**\n * This method returns the list of frames by id\n * @param id the id of a specific page\n * @returns list of all frames by id\n */\n getAllByPageId = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFramesByPageId(id).then((result) => getEditorResponseData<FrameType[]>(result));\n };\n\n /**\n * This method returns a frame by its name\n * @param name the name of a specific frame\n * @returns frame properties\n */\n getByName = async (name: string) => {\n const res = await this.#editorAPI;\n return res.getFrameByName(name).then((result) => getEditorResponseData<FrameType>(result));\n };\n\n /**\n * This method returns a frame by its id\n * @param id the id of a specific frame\n * @returns frame properties\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFrameById(id).then((result) => getEditorResponseData<FrameType>(result));\n };\n\n /**\n * This method returns all frame properties on current layout\n * @returns all frame properties on current layout\n */\n getPropertiesOnSelectedLayout = async () => {\n const res = await this.#editorAPI;\n return res\n .getFramePropertiesOnSelectedLayout()\n .then((result) => getEditorResponseData<FrameLayoutType[]>(result));\n };\n\n /**\n * This method returns frame layout properties for a given frame and layout\n * @param id the id of a specific frame\n * @param layoutId the id of a specific layout\n * @returns frame layout properties\n */\n getLayoutProperties = async (id: Id, layoutId?: Id) => {\n const res = await this.#editorAPI;\n return res\n .getFramePropertiesByFrameId(id, layoutId)\n .then((result) => getEditorResponseData<FrameLayoutType>(result));\n };\n\n /**\n * This method returns a list of frame properties for a given layout\n * @param id the id of a specific layout\n * @returns list of frame layout properties\n */\n getAllLayoutProperties = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFramesProperties(id).then((result) => getEditorResponseData<FrameLayoutType[]>(result));\n };\n\n /**\n * This method will reset the frame size (width and height) to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetSize = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameSize(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will select a specific frame\n * @param id the id of a specific frame\n * @returns\n */\n select = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.selectFrames([id]).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will select multipleFrames\n * @param ids An array of all ids you want to select\n * @returns\n */\n selectMultiple = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.selectFrames(ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method changes the order of frames in the z-index list.\n * @param order the index in the list to move to\n * @param ids An array of all IDs you want to move to the given index\n * @returns\n */\n reorderFrames = async (order: number, ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.reorderFrames(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update the z-index of a frame.\n * @param id the id of the frame you want to change the z-index of\n * @param method the z-index update method to perform\n * @returns\n */\n setZIndex = async (id: Id, method: UpdateZIndexMethod) => {\n const res = await this.#editorAPI;\n return res.setFrameZIndex(id, method).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of a specific frame\n * @param id the id of a specific frame\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setHeight = async (id: Id, height: string) => {\n const res = await this.#editorAPI;\n return res.setFrameHeight(id, height).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the rotation angle of a specific frame\n * @param id the id of a specific frame\n * @param rotation the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setRotation = async (id: Id, rotation: string) => {\n const res = await this.#editorAPI;\n return res.setFrameRotation(id, rotation).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the width of a specific frame\n * @param id the id of a specific frame\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setWidth = async (id: Id, width: string) => {\n const res = await this.#editorAPI;\n return res.setFrameWidth(id, width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the x value of a specific frame\n * @param id the id of a specific frame\n * @param XValue the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setX = async (id: Id, XValue: string) => {\n const res = await this.#editorAPI;\n return res.setFrameX(id, XValue).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the y value of a specific frame\n * @param id the id of a specific frame\n * @param YValue the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setY = async (id: Id, YValue: string) => {\n const res = await this.#editorAPI;\n return res.setFrameY(id, YValue).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update the name of a specific frame\n * @param id the id of a specific frame\n * @param name the new name that the frame should receive\n * @returns\n */\n rename = async (id: Id, name: string) => {\n const res = await this.#editorAPI;\n return res.renameFrame(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset properties of a specific frame to their original values\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n reset = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrame(id).then((result) => getEditorResponseData<null>(result));\n };\n /**\n * This method will reset the x value of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetX = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameX(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the y value of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetY = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameY(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the rotation value of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetRotation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameRotation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the width of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetWidth = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameWidth(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the height of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetHeight = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameHeight(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the fitMode property of a specific frame to its original value\n * @param id the id of the frame that needs to get reset\n * @returns\n */\n resetImageFrameFitMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetImageFrameFitMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated Use `setIsVisible` instead.\n *\n * This method will set the visibility property of a specified frame. If set to false the frame will be invisible and vice versa.\n * @param id the id of the frame that needs to get updated\n * @param value True means the frame gets visible, false means the frame gets invisible\n * @returns\n */\n setVisibility = async (id: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setFrameIsVisible(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the isVisible property of a specified frame. If set to false the frame will be invisible and vice versa.\n * @param id the id of the frame that needs to get updated\n * @param value True means the frame gets visible, false means the frame gets invisible\n * @returns\n */\n setIsVisible = async (id: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setFrameIsVisible(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will remove a specific frame using the Id.\n * @param id the id of the frame that needs to be deleted\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeFrames([id]).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will remove frames with the given ids.\n * @param ids an array of ids of the frames to be removed.\n * @returns\n */\n removeFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.removeFrames(ids).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will create a new frame of 'type' to the template positioned on the requested\n * coordinates.\n * @param type the type of frame to create\n * @param x X coordinate of the new frame within the template\n * @param y Y coordinate of the new frame within the template\n * @param width Width of the new frame within the template\n * @param height Height of the new frame within the template\n * @returns the newly created frame's id\n */\n create = async (type: FrameTypeEnum, x: number, y: number, width: number, height: number) => {\n const res = await this.#editorAPI;\n return res.addFrame(type, x, y, width, height).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will create a new frame of 'type' type to the template positioned on the requested\n * coordinates.\n * @param type the type of frame to create\n * @param x X coordinate of the new frame within the template\n * @param y Y coordinate of the new frame within the template\n * @param width Width of the new frame within the template\n * @param height Height of the new frame within the template\n * @returns the newly created shape frame's id\n */\n createShapeFrame = async (type: ShapeType, x: number, y: number, width: number, height: number) => {\n const res = await this.#editorAPI;\n return res.addFrame(type, x, y, width, height).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * @experimental This method will create a new barcode frame of 'type' type to the layout positioned on the requested\n * coordinates. Any coordinate that is not specified will default to 'center'.\n * @param type the type of barcode to create\n * @param position optional position object where you can specify the x, y of the barcode frame\n * @returns\n */\n createBarcodeFrame = async (type: BarcodeType, position?: { x?: number; y?: number }) => {\n const res = await this.#editorAPI;\n return res.addBarcodeFrame(type, position?.x, position?.y).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will duplicate a list of frames\n * @param ids An array of all ids you want to duplicate\n * @returns\n */\n duplicateFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n return res.duplicateFrames(ids).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method sets or removes the image source to the ImageFrame\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param newImageSource A new image source\n * @returns\n */\n private updateImageSource = async (imageFrameId: Id, src: ImageFrameSource | null) => {\n const res = await this.#editorAPI;\n const srcJson = src !== null ? JSON.stringify(src) : null;\n return res.setImageSource(imageFrameId, srcJson).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes the image source from the ImageFrame\n * @param imageFrameId the id of the imageFrame where an image needs to be removed from\n */\n removeImageSource = async (imageFrameId: string) => {\n return this.updateImageSource(imageFrameId, null);\n };\n\n /**\n * This method will assign an image from a mediaConnector to the correct ImageFrame\n * @param id Unique Id of the media connector\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param assetId Unique id of the asset that you want to assign to the imageFrame\n * @returns\n */\n setImageFromConnector = async (imageFrameId: Id, connectorId: Id, assetId: Id) => {\n const src: ImageFrameConnectorSource = {\n id: connectorId,\n assetId,\n type: ImageSourceTypeEnum.connector,\n };\n return this.updateImageSource(imageFrameId, src);\n };\n\n /**\n * This method will assign an image from url to the correct ImageFrame\n * Make sure the url can be accessed by the editor.\n * @param imageFrameId the id of the imageFrame where an image needs to be assigned to\n * @param url A valid image uri\n * @returns\n */\n setImageFromUrl = async (imageFrameId: Id, url: string) => {\n const source: ImageFrameUrlSource = { url: url, type: ImageSourceTypeEnum.url };\n return this.updateImageSource(imageFrameId, source);\n };\n\n /**\n * This method will set the fitMode property of a specified image frame.\n * @param imageFrameId the id of the imageFrame that needs to get updated.\n * @param fitMode the new fitMode that you want to set to the imageFrame.\n * @returns\n */\n setImageFrameFitMode = async (imageFrameId: Id, fitMode: FitMode) => {\n const res = await this.#editorAPI;\n return res.setImageFrameFitMode(imageFrameId, fitMode).then((result) => getEditorResponseData<null>(result));\n };\n /**\n * This method will set the constrainProportions property of a specified frame. If constrainProportionsReadOnly is\n * true, the frame's constrainProportions property cannot be changed and this method will return an error.\n *\n * @param id the id of the frame that needs to get updated.\n * @param constrainProportions The new constraint that you want to set to the frame.\n * @returns\n */\n setFrameConstrainProportions = async (id: Id, constrainProportions: boolean) => {\n const res = await this.#editorAPI;\n return res\n .setFrameConstrainProportions(id, constrainProportions)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the vertical alignment property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param verticalAlign the new vertical alignment to be set to the frame.\n * @returns\n */\n setVerticalAlign = async (id: Id, verticalAlign: VerticalAlign) => {\n const res = await this.#editorAPI;\n return res.setVerticalAlignment(id, verticalAlign).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the min copyFitting property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new min copyFitting value to be set to the frame.\n * @returns\n */\n setMinCopyfitting = async (id: Id, value: string) => {\n const res = await this.#editorAPI;\n return res.setMinCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the max copyFitting property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new max copyFitting value to be set to the frame.\n * @returns\n */\n setMaxCopyfitting = async (id: Id, value: string) => {\n const res = await this.#editorAPI;\n return res.setMaxCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will enable copyFitting on a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new value to be set to the frame.\n * @returns\n */\n setEnableCopyfitting = async (id: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setEnableCopyfitting(id, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame minCopyfitting to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetMinCopyfitting = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetMinCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame maxCopyfitting to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetMaxCopyfitting = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetMaxCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame enableCopyfitting to the frame's original value\n * @param id the id of a specific frame\n * @returns\n */\n resetEnableCopyfitting = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetEnableCopyfitting(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the visibility of the shape fill.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param enableFill Whether the shape fill is visible.\n * @returns\n */\n setShapeFrameEnableFill = async (shapeFrameId: Id, enableFill: boolean) => {\n return this.shapeController.setEnableFill(shapeFrameId, enableFill);\n };\n\n /**\n * This method will set the shape fill color of a specified shape frame.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param fillColor the new shape fill color that you want to set to the shapeFrame.\n * @returns\n */\n setShapeFrameFillColor = async (shapeFrameId: Id, fillColor: ColorUsage) => {\n return this.shapeController.setFillColor(shapeFrameId, fillColor);\n };\n\n /**\n * This method will set the visibility of the shape stroke.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param enableStroke Whether the shape stroke is visible.\n * @returns\n */\n setShapeFrameEnableStroke = async (shapeFrameId: Id, enableStroke: boolean) => {\n return this.shapeController.setEnableStroke(shapeFrameId, enableStroke);\n };\n\n /**\n * This method will set the shape stroke color of a specified shape frame.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param strokeColor the new shape stroke color that you want to set to the shapeFrame.\n * @returns\n */\n setShapeFrameStrokeColor = async (shapeFrameId: Id, strokeColor: ColorUsage) => {\n return this.shapeController.setStrokeColor(shapeFrameId, strokeColor);\n };\n\n /**\n * This method will set the shape stroke weight of a specified shape frame.\n * @param shapeFrameId the id of the shapeFrame that needs to get updated.\n * @param strokeWeight the new shape stroke weight that you want to set to the shapeFrame.\n * @returns\n */\n setShapeFrameStrokeWeight = async (shapeFrameId: Id, strokeWeight: number) => {\n return this.shapeController.setStrokeWeight(shapeFrameId, strokeWeight);\n };\n\n /**\n * This method will set the blend mode of a specified frame\n * @param id the id of a specific frame\n * @param blendMode the blend mode\n * @returns\n */\n setBlendMode = async (id: Id, blendMode: BlendMode) => {\n const res = await this.#editorAPI;\n return res.setFrameBlendMode(id, blendMode).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will make the specified image frame go into cropping mode.\n * @param id the id of a specific image frame\n * @returns\n */\n enterCropMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterCropMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit cropping mode while saving the applied crop.\n * @returns\n */\n applyCropMode = async () => {\n const res = await this.#editorAPI;\n return res.applyCropMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the currently applied crop mode and apply the last selected fit mode again.\n * @param id the id of a specific image frame\n * @returns\n */\n resetCropMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetCropMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit cropping mode without saving the applied crop.\n * @returns\n */\n exitCropMode = async () => {\n const res = await this.#editorAPI;\n return res.cancelCropMode().then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { Id } from './CommonTypes';\nimport { MediaType } from './ConnectorTypes';\n\nexport enum MediaDownloadType {\n thumbnail = 'thumbnail',\n mediumres = 'mediumres',\n highres = 'highres',\n original = 'original',\n}\n\nexport enum MediaDownloadIntent {\n web = 'web',\n}\n\nexport type Media = {\n id: Id;\n name: string;\n relativePath: string;\n type: MediaType;\n extension: string | null;\n metaData: {\n [key: string]: string;\n };\n};\n\nexport interface MediaDetail extends Media {\n width?: number;\n height?: number;\n}\n","import type { EditorAPI, EditorRawAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Layout, MeasurementUnit, LayoutIntent, PositionEnum, BleedDeltaUpdate } from '../types/LayoutTypes';\nimport { CallSender } from 'penpal';\nimport { ColorUsage } from '../types/ColorStyleTypes';\n\n/**\n * The LayoutController is responsible for all communication regarding Layouts.\n * Methods inside this controller can be called by `window.SDK.layout.{method-name}`\n */\nexport class LayoutController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\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 returns the list of layouts\n * @returns list of all layouts\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getLayouts().then((result) => getEditorResponseData<Layout[]>(result));\n };\n\n /**\n * This method returns a layout by its id\n * @param id the id of a specific layout\n * @returns layout properties\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getLayoutById(id).then((result) => getEditorResponseData<Layout>(result));\n };\n\n /**\n * This method returns a layout by its name\n * @param name the name of a specific layout\n * @returns layout properties\n */\n getByName = async (name: string) => {\n const res = await this.#editorAPI;\n return res.getLayoutByName(name).then((result) => getEditorResponseData<Layout>(result));\n };\n\n /**\n * This method returns the selected layout\n * @returns layout properties\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedLayout().then((result) => getEditorResponseData<Layout>(result));\n };\n\n /**\n * This method will remove a specific layout\n * @param id the id of a specific layout\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeLayout(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will create a new child layout (a new layout is always child of a root / parent)\n * @param parentId the id of a specific layout, being the parent\n * @returns id of new layout\n */\n create = async (parentId: Id) => {\n const res = await this.#editorAPI;\n return res.addLayout(parentId).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will update the name of a specific layout\n * @param id the id of a specific layout\n * @param name the new name that the layout should receive\n * @returns\n */\n rename = async (id: Id, name: string) => {\n const res = await this.#editorAPI;\n return res.renameLayout(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will select a specific layout\n * @param id the id of a specific layout\n * @returns\n */\n select = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.selectLayout(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will duplicate a specific layout\n * @param id the id of a specific layout\n * @returns id of specific layout\n */\n duplicate = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateLayout(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method will reset a specific layout to its original value\n * @param id the id of a specific layout\n * @returns\n */\n reset = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayout(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of the layout to a specific value\n * @param id the id of a specific layout\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setHeight = async (id: Id, height: string) => {\n const res = await this.#editorAPI;\n return res.setLayoutHeight(id, height).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the width of the layout to a specific value\n * @param id the id of a specific layout\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setWidth = async (id: Id, width: string) => {\n const res = await this.#editorAPI;\n return res.setLayoutWidth(id, width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the unit of the layout to a specific value\n *\n * @param id The id of a specific layout\n * @param unit the unit that will be used for the layout. All values in this layout will now be reported in this unit\n * @returns\n */\n setUnit = async (id: Id, unit: MeasurementUnit) => {\n const res = await this.#editorAPI;\n return res.setLayoutUnit(id, unit).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the height of a specific layout to its original value\n * @param id the id of a specific layout\n * @returns\n */\n resetHeight = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutHeight(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the width of a specific layout to its original value\n * @param id the id of a specific layout\n * @returns\n */\n resetWidth = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutWidth(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the unit of a specific layout to its original (inherited) value\n * @param id the id of a specific layout\n * @returns\n */\n resetUnit = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutUnit(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method returns a UInt8Array containing a PNG encoded image of the currently selected layout.\n * @returns UInt8Array snapshot of the current layout\n */\n getSelectedSnapshot = async () => {\n const res = await this.#blobAPI;\n return res.getPageSnapshot().then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * This method sets the intent of a specific layout. Note that setting the intent for a layout\n * can have side-effects such as updating the measurement unit\n * @param id the id of a specific layout\n * @param intent the intent that will be used for the layout\n */\n setIntent = async (id: Id, intent: LayoutIntent) => {\n const res = await this.#editorAPI;\n return res.setLayoutIntent(id, intent).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method resets the intent of a specific layout to its original (inherited) value.\n * Note: Calling this on the top layout is not valid\n *\n * @param id The id of the (child) layout to reset the intent for\n */\n resetIntent = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutIntent(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the fill color of a specific layout.\n * Note: Depending on the layout intent, some colors might not be valid (eg opacity for digitalAnimated, any color for print)\n *\n * @param id the id of a specific layout\n * @param color the color that will be used for the layout\n */\n setFillColor = async (id: Id, color: ColorUsage) => {\n const res = await this.#editorAPI;\n return res.setLayoutFillColor(id, JSON.stringify(color)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This is a convenience method to enable or disable the fill color of a specific layout.\n * Note: Depending on the layout intent, disabling might not be valid (eg disabling for digitalAnimated)\n *\n * @param id the id of a specific layout\n * @param enabled whether the fill color should be enabled or disabled\n */\n setFillColorEnabled = async (id: Id, enabled: boolean) => {\n const res = await this.#editorAPI;\n return res.setLayoutFillColorEnabled(id, enabled).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method resets the fill color of a specific layout to its original (inherited) value.\n * Note: Calling this on the top layout is not valid\n *\n * @param id The id of the (child) layout to reset the fill color for\n */\n resetFillColor = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetLayoutFillColor(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the bleed value of a specific layout.\n * Note: this is only valid on a print layout\n *\n * @param id The id of the specific layout\n * @param value The bleed value\n * @param position When defined will update the bleed value of a single position,\n * otherwise will set all positions to the same value. Depending on this parameter\n * being defined, the `areBleedValuesCombined` will also be updated.\n */\n setBleedValue = async (id: Id, value: string, position?: PositionEnum) => {\n const update: BleedDeltaUpdate = position\n ? {\n left: position === PositionEnum.left ? value : undefined,\n top: position === PositionEnum.top ? value : undefined,\n right: position === PositionEnum.right ? value : undefined,\n bottom: position === PositionEnum.bottom ? value : undefined,\n }\n : { left: value, top: value, right: value, bottom: value };\n\n const res = await this.#editorAPI;\n return res.updateLayoutBleed(id, JSON.stringify(update)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the combined state of the bleed values.\n * Note: this is only valid on a print layout\n *\n * @param id The id of the specific layout\n * @param value Whether the bleed values are combined\n */\n setAreBleedValuesCombined = async (id: Id, value: boolean) => {\n const update: BleedDeltaUpdate = { areBleedValuesCombined: value };\n\n const res = await this.#editorAPI;\n return res.updateLayoutBleed(id, JSON.stringify(update)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the bleed values on the specified layout to its original (inherited) value.\n * Note: Calling this on the top layout is not valid.\n *\n * @param id The id of the (child) layout to reset the bleed values for\n */\n resetBleedValues = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.updateLayoutBleed(id, null).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { ConnectorConfigOptions, EditorAPI, EditorRawAPI, EditorResponse, Id, MetaData } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n DeprecatedMediaConnectorDownloadType,\n DeprecatedMediaType,\n MediaConnectorCapabilities,\n MediaType,\n QueryOptions,\n QueryPage,\n} from '../types/ConnectorTypes';\nimport { CallSender } from 'penpal';\nimport { Media, MediaDownloadIntent, MediaDetail, MediaDownloadType } from '../types/MediaConnectorTypes';\n\n/**\n * The MediaConnectorController is responsible for all communication regarding media connectors.\n * Methods inside this controller can be called by `window.SDK.mediaConnector.{method-name}`\n *\n * The way CHILI Studio handles different sources of media is called 'MediaConnectors'. A MediaConnectors is an\n * implementation of a set of capabilities we need to interact with a certain Digital Asset Management system.\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\n * generation.\n * This controller is an interface to the running connector instance inside the studio engine.\n */\nexport class MediaConnectorController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\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 * Query a specific MediaConnector for data using both standardized queryOptions and the dynamic\n * context as parameters. This call returns an array of Media items.\n * @param id unique id of the media connector\n * @param queryOptions stringified instance of `QueryOptions`\n * @param context context that will be available in the connector script.\n * @returns array of Media items\n */\n query = async (id: Id, queryOptions: QueryOptions, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorQuery(id, JSON.stringify(queryOptions), JSON.stringify(context))\n .then((result) => getEditorResponseData<QueryPage<Media>>(result));\n };\n\n /**\n * Returns a single media using a specific MediaConnector.\n *\n * The connector needs to list `detail` as a supported capability.\n * @param id unique id of the Media connector\n * @param mediaId unique id of the Media\n * @param context context that will be available in the connector script.\n * @returns Media item\n */\n detail = async (id: Id, mediaId: string, context: MetaData = {}) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorDetail(id, mediaId, JSON.stringify(context))\n .then((result) => getEditorResponseData<MediaDetail>(result));\n };\n\n /**\n * The combination of a `connectorId` and `mediaId` is typically enough for a media connector to\n * perform the download of this asset. The `download` endpoint is capable of relaying this information to the\n * media connector instance running in the editor engine.\n * @param id unique id of the media connector\n * @param mediaId unique id of the media to download\n * @param downloadType hint to the media connector about desired quality of the downloaded media\n * @param context context that will be available in the connector script.\n * @returns\n */\n download = async (\n id: Id,\n mediaId: Id,\n downloadType: MediaDownloadType,\n context: MetaData = {},\n ): Promise<Uint8Array> => {\n const compatibleDownloadType = this.parseDeprecatedMediaDownloadType(\n downloadType as unknown as DeprecatedMediaConnectorDownloadType,\n ) as MediaDownloadType;\n const res = await this.#blobAPI;\n return res\n .mediaConnectorDownload(\n id,\n mediaId,\n compatibleDownloadType,\n MediaDownloadIntent.web,\n JSON.stringify(context),\n )\n .then((result) => (result as Uint8Array) ?? (result as EditorResponse<null>));\n };\n\n /**\n * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This\n * method allows you to discover which mappings are available for a given connector. If you want to use any of these\n * mappings, they will be available in the `context` parameter of any connector method.\n * @param id unique id of the media connector\n * @returns connector mappings\n */\n getConfigurationOptions = async (id: Id) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorGetConfigurationOptions(id)\n .then((result) => getEditorResponseData<ConnectorConfigOptions>(result));\n };\n\n /**\n * This method returns what capabilities the selected connector has. It gives an indication what methods can\n * be used successfully for a certain connector.\n * @param id unique id of the media connector\n * @returns MediaConnectorCapabilities\n */\n getCapabilities = async (id: Id) => {\n const res = await this.#editorAPI;\n return res\n .mediaConnectorGetCapabilities(id)\n .then((result) => getEditorResponseData<MediaConnectorCapabilities>(result));\n };\n\n /**\n * This method will parse the deprecatedMediaType to the new media type. This method will be removed once the deprecatedMediaType is out of use\n * @param deprecatedType is 0 or 1\n * @returns connector capabilities\n */\n parseDeprecatedMediaType = (deprecatedType: DeprecatedMediaType) => {\n if (deprecatedType === DeprecatedMediaType.file) return MediaType.file;\n if (deprecatedType === DeprecatedMediaType.collection) return MediaType.collection;\n };\n\n /**\n * This method will parse the deprecatedMediaDownloadType to the new media download type.\n * This method will be removed once the deprecatedMediaDownloadType is out of use\n * @param deprecatedMediaDownloadType legacy download type\n * @returns MediaDownloadType\n */\n parseDeprecatedMediaDownloadType(\n deprecatedMediaDownloadType: DeprecatedMediaConnectorDownloadType,\n ): MediaDownloadType {\n switch (deprecatedMediaDownloadType) {\n case DeprecatedMediaConnectorDownloadType.HighResolutionWeb:\n return MediaDownloadType.highres;\n case DeprecatedMediaConnectorDownloadType.LowResolutionWeb:\n return MediaDownloadType.thumbnail;\n default:\n return deprecatedMediaDownloadType as unknown as MediaDownloadType;\n }\n }\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { Page } from '../types/PageTypes';\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 constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of pages\n * @returns list of all pages\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getPages().then((result) => getEditorResponseData<Page[]>(result));\n };\n\n /**\n * This method returns a page by its id\n * @param id the id of a specific page\n * @returns page properties\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getPageById(id).then((result) => getEditorResponseData<Page>(result));\n };\n\n /**\n * This method will set the width of the page to a specific value.\n * This only works if the document is a project.\n * @param id the id of a specific page\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The notation is in pixels\n * @returns\n */\n setWidth = async (id: Id, width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(id, width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of the page to a specific value.\n * This only works if the document is a project.\n * @param id the id of a specific page\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The notation is in pixels\n * @returns\n */\n setHeight = async (id: Id, height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(id, height).then((result) => getEditorResponseData<null>(result));\n };\n}\n","export interface ConnectorImageVariableSource {\n connectorId: string;\n /**\n * The requested asset id or name\n */\n assetId: string;\n /**\n * If the connector was able to query, this will contain\n * the actual resolved media Id.\n */\n resolved?: ResolvedMedia;\n}\n\n/**\n * Image variable query lookup result\n */\nexport interface ResolvedMedia {\n /**\n * The resolved media Id.\n * This id can be used to perform the download call.\n */\n mediaId: string;\n}\n\nexport enum VariableType {\n shortText = 'shortText',\n longText = 'longText',\n image = 'image',\n list = 'list',\n boolean = 'boolean',\n group = 'group',\n}\n\nexport interface Variable {\n id: string;\n type: VariableType;\n parentId?: string;\n name: string;\n label: string;\n isVisible: boolean;\n isReadonly: boolean;\n isRequired: boolean;\n occurrences: number;\n}\n\nexport interface ImageVariable extends Variable {\n value?: ConnectorImageVariableSource;\n}\n\nexport interface ListVariableItem {\n value: string;\n displayValue?: string;\n}\n\nexport interface ListVariable extends Variable {\n items: string[];\n selected?: string;\n}\n\nexport interface BooleanVariable extends Variable {\n value: boolean;\n}\n\nexport interface ShortTextVariable extends Variable {\n value: string;\n}\n\nexport type LongTextVariable = ShortTextVariable;\n\nexport type GroupVariable = Variable;\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ParagraphStyle, ParagraphStyleUpdate } from '../types/ParagraphStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ParagraphStyleController is responsible for all communication regarding paragraph styles.\n * Methods inside this controller can be called by `window.SDK.paragraphStyle.{method-name}`\n */\nexport class ParagraphStyleController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method returns the list of paragraph styles\n * @returns\n */\n getAll = async () => {\n const res = await this.#editorAPI;\n return res.getParagraphStyles().then((result) => getEditorResponseData<ParagraphStyle[]>(result));\n };\n\n /**\n * This method returns a paragraph style by id\n * @param id the id of a specific paragraph style\n * @returns\n */\n getById = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getParagraphStyleById(id).then((result) => getEditorResponseData<ParagraphStyle>(result));\n };\n\n /**\n * This method creates a new paragraph style\n * @returns the id of new paragraph style\n */\n create = async () => {\n const res = await this.#editorAPI;\n return res.createParagraphStyle().then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method duplicates a paragraph style\n * @param id the id of a specific paragraph style\n * @returns the new paragraph style id\n */\n duplicate = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.duplicateParagraphStyle(id).then((result) => getEditorResponseData<Id>(result));\n };\n\n /**\n * This method updates a paragraph style\n * @param id the id of a specific paragraph style\n * @param properties The new paragraph style properties\n * @returns\n */\n update = async (id: Id, properties: ParagraphStyleUpdate) => {\n const res = await this.#editorAPI;\n return res\n .updateParagraphStyle(id, JSON.stringify(properties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method renames a paragraph style\n * @param id the id of a specific paragraph style\n * @param name the new name of the paragraph style\n * @returns\n */\n rename = async (id: Id, name: string) => {\n const res = await this.#editorAPI;\n return res.renameParagraphStyle(id, name).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a paragraph style\n * @param id the id of a specific paragraph style\n * @returns\n */\n remove = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.removeParagraphStyle(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method changes positions of paragraph styles\n * @param order the position of the paragraph styles\n * @param ids the list of paragraph styles ids\n * @returns\n */\n move = async (order: number, ids: string[]) => {\n const res = await this.#editorAPI;\n return res.moveParagraphStyles(order, ids).then((result) => getEditorResponseData<null>(result));\n };\n}\n","import { ConfigType, Id } from '../types/CommonTypes';\nimport { MeasurementUnit } from '../types/LayoutTypes';\nimport { ListVariable, ListVariableItem, Variable, VariableType } from '../types/VariableTypes';\nimport { ViewMode } from '../types/ViewModeTypes';\nimport { ToolType } from '../utils/enums';\n\n/**\n * The SubscriberController is responsible for all listeners which can influence the application-state from outside.\n * Callbacks inside this controller can be set by `window.SDK.subscriber.{method-name}`\n */\nexport class SubscriberController {\n /**\n * @ignore\n */\n private config: ConfigType;\n\n /**\n * @ignore\n */\n constructor(config: ConfigType) {\n this.config = config;\n }\n\n /**\n * Listener on actions, if this changes, this listener will get triggered with the updates\n * @param actions Stringified array of DocumentAction type\n */\n onActionsChanged = (actions: string) => {\n const callBack = this.config.onActionsChanged;\n callBack && callBack(JSON.parse(actions));\n };\n\n /**\n * Listener on when a certain animation gets changed\n * @param animation Stringified array of FrameAnimationType\n */\n onAnimationChanged = (animation: string) => {\n const callBack = this.config.onFrameAnimationsChanged;\n callBack && callBack(JSON.parse(animation));\n };\n\n /**\n * Listener on the playback state of the animation, it contains the current time of the playback (in milliseconds) and a flag that describes if the animation is currently playing\n * @param animationPlaybackState Stringified array of AnimationPlaybackType\n */\n onAnimationPlaybackChanged = (animationPlaybackState: string) => {\n const callBack = this.config.onScrubberPositionChanged;\n callBack && callBack(JSON.parse(animationPlaybackState));\n };\n\n /**\n * Listener on the state of the currently selected layout, if its properties are changed, this listener will get triggered with the new properties\n * @param layoutProperties Stringified object of LayoutPropertiesType\n */\n onSelectedLayoutPropertiesChanged = (layoutProperties: string) => {\n const callBack = this.config.onSelectedLayoutPropertiesChanged;\n callBack && callBack(JSON.parse(layoutProperties));\n };\n\n /**\n * Listener on the unit of the currently active layout. If you switch between layouts with different units, this listener will get triggered with the new unit\n * If you switch the unit of a layout this listener will get triggered with the new unit\n *\n * @param unit Stringified object of MeasurementUnit\n */\n onSelectedLayoutUnitChanged = (unit: string) => {\n const callBack = this.config.onSelectedLayoutUnitChanged;\n callBack && callBack(unit as MeasurementUnit);\n };\n\n /**\n * Listener on the state of the currently selected frames, if this changes, this listener will get triggered with the updates\n * @param framesLayout Stringified array of FrameLayoutType objects\n */\n onSelectedFramesLayoutChanged = (framesLayout: string) => {\n const frames = JSON.parse(framesLayout);\n const multiFrameCallBack = this.config.onSelectedFramesLayoutChanged;\n multiFrameCallBack && multiFrameCallBack(frames);\n\n const singleFrameCallBack = this.config.onSelectedFrameLayoutChanged;\n singleFrameCallBack && singleFrameCallBack(frames.length > 1 ? undefined : frames[0]);\n };\n\n /**\n * Listener on the state of the currently selected frame, it contains some basic information on the type of frame it is\n * @param framesContent Stringified array of Frame objects\n */\n onSelectedFramesContentChanged = (framesContent: string) => {\n const frames = JSON.parse(framesContent);\n const multiFrameCallBack = this.config.onSelectedFramesContentChanged;\n multiFrameCallBack && multiFrameCallBack(frames);\n\n const singleFrameCallBack = this.config.onSelectedFrameContentChanged;\n singleFrameCallBack && singleFrameCallBack(frames.length > 1 ? null : frames[0]);\n };\n\n /**\n * Listener on the general state of the document, gets triggered every time a change is done on the document.\n */\n onStateChanged = () => {\n const callBack = this.config.onStateChanged;\n callBack && callBack();\n };\n\n /**\n * Listener on authentication expiration.\n * The callback should resolve to the refreshed authentication. If the\n * listener is not defined, the http requests from the connector will return\n * 401 with no refetch of assets.\n *\n * When this emits it means either:\n * - the grafxToken needs to be renewed\n * - any other authentication needs to be renewed (user impersonation, static..)\n *\n * @param authRefreshRequest Stringified object of AuthRefreshRequest\n */\n onAuthExpired = async (authRefreshRequest: string) => {\n const callBack = this.config.onAuthExpired;\n\n if (!callBack) {\n return null;\n }\n\n const authCredentials = await callBack(JSON.parse(authRefreshRequest));\n\n return authCredentials != null ? JSON.stringify(authCredentials) : null;\n };\n\n /**\n * Listener on viewport request.\n * The callback should resolve to the visible viewport. If the\n * listener is not defined, the viewport will take full size.\n *\n * When this emits it means that the engine requested the viewport for a\n * zoom to page call.\n */\n onViewportRequested = () => {\n const callBack = this.config.onViewportRequested;\n\n if (!callBack) {\n return null;\n }\n\n const viewport = callBack();\n\n return viewport != null ? JSON.stringify(viewport) : null;\n };\n\n /**\n * Listener on when the document is fully loaded.\n */\n onDocumentLoaded = () => {\n const callBack = this.config.onDocumentLoaded;\n callBack && callBack();\n };\n\n /**\n * To be implemented, gets triggered when clicking on the pageTitle on the canvas.\n */\n onPageSelectionChanged = () => {\n const callBack = this.config.onPageSelectionChanged;\n callBack && callBack();\n };\n\n /**\n * Listener on when variables change\n * @param variablesJson Stringified array of Variable\n */\n onVariableListChanged = (variablesJson: string) => {\n const callBack = this.config.onVariableListChanged;\n\n // TODO: Revert in part 2.\n if (!callBack) {\n return;\n }\n\n const parsed = JSON.parse(variablesJson) as Variable[];\n\n const updated = parsed.map((variable) =>\n variable.type === VariableType.list\n ? {\n ...variable,\n items: ((variable as ListVariable).items as unknown as ListVariableItem[]).map(\n (item) => item.value,\n ),\n selected: ((variable as ListVariable).selected as unknown as ListVariableItem | undefined)?.value,\n }\n : variable,\n );\n\n callBack(updated);\n };\n\n /**\n * Listener on when the tool has changed by the canvas\n * @param tool the string representation of a certain tool\n */\n onSelectedToolChanged = (tool: string) => {\n const callBack = this.config.onSelectedToolChanged;\n callBack && callBack(tool as ToolType);\n };\n\n /**\n * Listener on state changes\n * @param undoState Stringified object of UndoState\n */\n onUndoStateChanged = (undoState: string) => {\n const callBack = this.config.onUndoStackStateChanged;\n callBack && callBack(JSON.parse(undoState));\n };\n\n /**\n * Listener on the state of the currently selected layout's frames, if this changes, this listener will get triggered with the updates\n * @param layoutFrames Stringified object of Frames\n */\n onSelectedLayoutFramesChanged = (layoutFrames: string) => {\n const callBack = this.config.onSelectedLayoutFramesChanged;\n callBack && callBack(JSON.parse(layoutFrames));\n };\n\n /**\n * Listener on the state of the currently selected text's styles, if this changes, this listener will get triggered with the updates\n * @param styles Stringified object of styles\n */\n onSelectedTextStyleChanged = (styles: string) => {\n const callBack = this.config.onSelectedTextStyleChanged;\n callBack && callBack(JSON.parse(styles));\n };\n\n /**\n * Listener on the state of the currently selected color's styles, if this changes, this listener will get triggered with the updates\n * @param colors Stringified object of colors\n */\n onColorsChanged = (colors: string) => {\n const callBack = this.config.onColorsChanged;\n callBack && callBack(JSON.parse(colors));\n };\n\n /**\n * Listener on paragraph styles, if this changes, this listener will get triggered with the updates\n * @param paragraphStyles Stringified object of paragraph styles\n */\n onParagraphStylesChanged = (paragraphStyles: string) => {\n const callBack = this.config.onParagraphStylesChanged;\n callBack && callBack(JSON.parse(paragraphStyles));\n };\n\n /**\n * Listener on character styles, if this changes, this listener will get triggered with the updates\n * @param characterStyles Stringified object of character styles\n */\n onCharacterStylesChanged = (characterStyles: string) => {\n const callBack = this.config.onCharacterStylesChanged;\n callBack && callBack(JSON.parse(characterStyles));\n };\n\n /**\n * Listener on fonts, if this changes, this listener will get triggered with the updates\n * @param fonts Stringified object of font families\n */\n onFontFamiliesChanged = (fonts: string) => {\n const callBack = this.config.onFontFamiliesChanged;\n callBack && callBack(JSON.parse(fonts));\n };\n\n /**\n * Listener on selected layout id, this listener will get triggered when a different layout is selected.\n * @param id the currently selected layout id\n */\n onSelectedLayoutIdChanged = (id: Id) => {\n const callBack = this.config.onSelectedLayoutIdChanged;\n callBack && callBack(id);\n };\n\n /**\n * Listener on layouts, this listener will get triggered when a (sub)layout is\n * - created\n * - removed\n * - renamed\n * - duplicated\n * @param layouts Stringified object of layouts\n */\n onLayoutsChanged = (layouts: string) => {\n const callBack = this.config.onLayoutsChanged;\n callBack && callBack(JSON.parse(layouts));\n };\n\n /**\n * Listener on scale factor of the canvas, this listener will get triggered when a zoom is applied to the canvas\n * @param zoom Stringified scale factor\n */\n onZoomChanged = (zoom: string) => {\n const callBack = this.config.onZoomChanged;\n callBack && callBack(JSON.parse(zoom));\n };\n\n /**\n * Listener on connector events, this listener will get triggered when a connector emits one of those events\n * - reloadRequired\n * - authChanged\n * - unloaded\n * - stateChanged\n *\n * stateChanged - this event will be triggered by connector states: loading, loaded, running, ready, error\n * @param connectorEvent Stringified object of ConnectorEvent\n */\n onConnectorEvent = (connectorEvent: string) => {\n const callBack = this.config.onConnectorEvent;\n callBack && callBack(JSON.parse(connectorEvent));\n };\n\n /**\n * Listener on connectors, if this changes, this listener will get triggered with the updates\n * @param connectors Stringified array of ConnectorInstance type\n */\n onConnectorsChanged = (connectors: string) => {\n const callBack = this.config.onConnectorsChanged;\n callBack && callBack(JSON.parse(connectors));\n };\n\n /**\n * Listener on page size, this listener will get triggered when the page size is changed, while the document is a `project`.\n * This will not emit anything if your document is a `template`.\n * @param pageSize Stringified object of the PageSize\n */\n onPageSizeChanged = (pageSize: string) => {\n const callBack = this.config.onPageSizeChanged;\n callBack && callBack(JSON.parse(pageSize));\n };\n\n /**\n * Listener on corner radii of rectangle and polygon shapes, this listener will get triggered when any corner radius is changed\n * @param cornerRadius Stringified object of the CornerRadius\n */\n onShapeCornerRadiusChanged = (cornerRadius: string) => {\n const callBack = this.config.onShapeCornerRadiusChanged;\n callBack && callBack(JSON.parse(cornerRadius));\n };\n\n /**\n * Listener of editor entering / exiting the crop mode\n * @param id frame id when entering / null when exiting\n */\n onCropActiveFrameIdChanged = (id?: Id) => {\n const callBack = this.config.onCropActiveFrameIdChanged;\n callBack && callBack(id);\n };\n\n /**\n * Listener on async errors.\n * Async errors are thrown at times not directly tied to SDK calls.\n * e.g. Getting an action error triggered after a late event.\n *\n * If this is an `ActionAsyncError`:\n * - `id` refers to the action id\n * - `event` refers to the event that triggered the action\n * - `eventChain` refers the chain of events that lead to the action, first\n * item being the closest parent.\n * @param asyncError error triggered asynchronously\n */\n onAsyncError = (asyncError: string) => {\n const callBack = this.config.onAsyncError;\n callBack && callBack(JSON.parse(asyncError));\n };\n\n /**\n * Listener on when the view mode has changed\n * @param viewMode the string representation of a view mode\n */\n onViewModeChanged = (viewMode: string) => {\n const callBack = this.config.onViewModeChanged;\n callBack && callBack(viewMode as ViewMode);\n };\n\n /**\n * Listener on when barcode frames change their validation state\n *\n * @param validationResults the json string representation of the validation results\n */\n onBarcodeValidationChanged = (validationResults: string) => {\n const callBack = this.config.onBarcodeValidationChanged;\n callBack && callBack(JSON.parse(validationResults));\n };\n}\n","export enum FramePropertyNames {\n FRAME_X = 'frameX',\n FRAME_Y = 'frameY',\n WIDTH = 'width',\n HEIGHT = 'height',\n FRAME_ROTATION = 'frameRotation',\n}\nexport enum LayoutPropertyNames {\n LAYOUT_HEIGHT = 'layoutHeight',\n LAYOUT_WIDTH = 'layoutWidth',\n BLEED_TOP = 'bleedTop',\n BLEED_BOTTOM = 'bleedBottom',\n BLEED_LEFT = 'bleedLeft',\n BLEED_RIGHT = 'bleedRight',\n BLEED_VALUES_COMBINED = 'areBleedValuesCombined',\n}\n\nexport enum ToolType {\n SELECT = 'select',\n ZOOM = 'zoom',\n HAND = 'hand',\n IMAGE_FRAME = 'imageFrame',\n TEXT_FRAME = 'textFrame',\n SHAPE_RECT = 'rect',\n SHAPE_ELLIPSE = 'ellipse',\n SHAPE_POLYGON = 'polygon',\n}\nexport enum DownloadFormats {\n MP4 = 'mp4',\n GIF = 'gif',\n PNG = 'png',\n JPG = 'jpg',\n PDF = 'pdf',\n}\n\nexport enum EnvironmentType {\n SANDBOX = 'sandbox',\n PRODUCTION = 'online',\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { SelectedTextStyle, TextStyleUpdateType } from '../types/TextStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The TextStyleController is responsible for all communication regarding text styles.\n * Methods inside this controller can be called by `window.SDK.textStyle.{method-name}`\n */\nexport class TextStyleController {\n /**\n * @ignore\n */\n readonly #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method updates a selected Text's style properties\n * @returns\n */\n set = async (style: TextStyleUpdateType) => {\n const res = await this.#editorAPI;\n return res\n .selectedTextStyleDeltaUpdate(JSON.stringify(style))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method removes a selected Text's style properties\n * If the text is selected, then the inline style properties will be removed\n * If the text is not selected and user tried to change any style property, the temporary style will be removed\n * if there is no text selection and there is no temporary style, the inline paragraph properties will be removed\n * @returns\n */\n removeSelected = async () => {\n const res = await this.#editorAPI;\n return res.selectedTextStyleClean().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method gets a selected Text's style properties\n * @returns\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedTextStyle().then((result) => getEditorResponseData<SelectedTextStyle>(result));\n };\n}\n","import { EditorAPI } from '../types/CommonTypes';\nimport { ToolType } from '../utils/enums';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ToolController is responsible for all communication regarding the tools.\n * Methods inside this controller can be called by `window.SDK.tool.{method-name}`\n */\nexport class ToolController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method sets the currently used tool\n * @param tool\n */\n setTool = async (tool: ToolType) => {\n const res = await this.#editorAPI;\n return res.setTool(tool).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method returns selected tool\n */\n getSelected = async () => {\n const res = await this.#editorAPI;\n return res.getSelectedTool().then((result) => getEditorResponseData<ToolType>(result));\n };\n\n /**\n * @deprecated\n * This method sets the used tool to the select tool.\n * This method is deprecated in favour of the setSelect tool setter.\n */\n setPointer = async () => {\n return this.setTool(ToolType.SELECT);\n };\n\n /**\n * This method sets the used tool to the select tool.\n */\n setSelect = async () => {\n return this.setTool(ToolType.SELECT);\n };\n\n /**\n * This method sets the used tool to the Move tool\n */\n setHand = async () => {\n return this.setTool(ToolType.HAND);\n };\n\n /**\n * This method sets the used tool to the Zoom tool\n */\n setZoom = async () => {\n return this.setTool(ToolType.ZOOM);\n };\n\n /**\n * This method sets the used tool to the TextFrame tool\n */\n setTextFrame = async () => {\n return this.setTool(ToolType.TEXT_FRAME);\n };\n\n /**\n * This method sets the used tool to the ImageFrame tool\n */\n setImageFrame = async () => {\n return this.setTool(ToolType.IMAGE_FRAME);\n };\n\n /**\n * This method sets the used tool to the ShapeRectangle tool\n */\n setShapeRect = async () => {\n return this.setTool(ToolType.SHAPE_RECT);\n };\n\n /**\n * This method sets the used tool to the ShapeEllipse tool\n */\n setShapeEllipse = async () => {\n return this.setTool(ToolType.SHAPE_ELLIPSE);\n };\n\n /**\n * This method sets the used tool to the ShapePolygon tool\n */\n setShapePolygon = async () => {\n return this.setTool(ToolType.SHAPE_POLYGON);\n };\n}\n","import SDK from '..';\nimport { EditorAPI } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The UndoManagerController is responsible for all communication regarding the Undo-Manager.\n * Methods inside this controller can be called by `window.SDK.undoManager.{method-name}`\n */\nexport class UndoManagerController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n #advanced: AdvancedUndoManagerController;\n #sdk: SDK;\n\n /**\n * @ignore\n */\n constructor(children: EditorAPI, sdk: SDK) {\n this.#editorAPI = children;\n this.#sdk = sdk;\n this.#advanced = new AdvancedUndoManagerController(children);\n }\n\n /**\n * This method undoes the last operation\n * @returns\n */\n undo = async () => {\n const res = await this.#editorAPI;\n return res.undo().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method redoes the last operation\n * @returns\n */\n redo = async () => {\n const res = await this.#editorAPI;\n return res.redo().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Record any operations in the current scope. This will automatically begin\n * the undo operation. Once you leave the record scope, it will end the undo operation.\n * Even if you throw an exception inside the record scope it will still end it properly.\n * @returns\n */\n record = async (operationName: string, undoOperationCallback: (sdk: SDK) => void) => {\n try {\n await this.#advanced.beginIfNoneActive(operationName);\n\n await undoOperationCallback(this.#sdk);\n } catch (error) {\n throw error;\n } finally {\n await this.#advanced.end();\n }\n };\n}\n\nexport class AdvancedUndoManagerController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(children: EditorAPI) {\n this.#editorAPI = children;\n }\n\n /**\n * This will start a new undo operation.\n * This will throw an exception when there is already an undo operation recording.\n * @returns\n */\n begin = async (operationName: string) => {\n const res = await this.#editorAPI;\n return res.begin(operationName).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This will start a new undo operation if there is no other undo operation recording.\n * This does not throw.\n * @returns\n */\n beginIfNoneActive = async (operationName: string) => {\n const res = await this.#editorAPI;\n return res.beginIfNoneActive(operationName).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * Ends the currently active recording operation.\n * If there is no recording operation currently running this will throw an exception.\n * @returns\n */\n end = async () => {\n const res = await this.#editorAPI;\n return res.end().then((result) => getEditorResponseData<null>(result));\n };\n}\n","export const round = (val: number, precision = 2) => {\n const hundred = Math.pow(10, precision);\n return Math.round(val * hundred) / hundred;\n};\n","import { round } from '../utils/MathUtils';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { EnvironmentType } from '../utils/enums';\n\n/**\n * The UtilsController exposes a set of useful utilities that can be used to make some repeated tasks a bit easier\n * Methods inside this controller can be called by `window.SDK.utils.{method-name}`\n */\nexport class UtilsController {\n /**\n * This method can round a value to a certain precision, default is 2\n * @param val the value that needs to be rounded\n * @param precision the precision of the rounding operation\n * @returns the rounded value as a number\n */\n round = (val: number, precision?: number) =>\n getEditorResponseData<number>({\n data: String(round(val, precision)),\n success: true,\n status: 200,\n parsedData: null,\n });\n\n createEnvironmentBaseURL = (parameters: { type?: EnvironmentType; environment?: string; version?: string }) => {\n const { type = EnvironmentType.SANDBOX, environment = 'ft-nostress', version = '1' } = parameters;\n const host = type == EnvironmentType.SANDBOX ? 'chili-publish-sandbox' : 'chili-publish';\n return `https://${environment}.${host}.online/grafx/api/v${version}/environment/${environment}`;\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ConnectorRegistration } from '../types/ConnectorTypes';\nimport { ListVariable, ListVariableItem, Variable, VariableType } from '../types/VariableTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\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 /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\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) => {\n const res = await this.#editorAPI;\n return res.setVariableLabel(id, label).then((result) => getEditorResponseData<null>(result));\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 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 * @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 | null) => {\n const res = await this.#editorAPI;\n return res.setVariableValue(id, value).then((result) => getEditorResponseData<null>(result));\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 * This method sets isVisible flag for a variable\n * @returns\n */\n setIsVisible = async (id: string, isVisible: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsVisible(id, isVisible).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated Use `setIsVisible` instead.\n *\n * This method sets isHidden flag for a variable\n * @returns\n */\n setIsHidden = async (id: string, isHidden: boolean) => {\n const res = await this.#editorAPI;\n return res.setVariableIsVisible(id, !isHidden).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 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 return res\n .setImageVariableConnector(id, JSON.stringify(registration))\n .then((result) => getEditorResponseData<Id>(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 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","import engineInfo from '../../editor-engine.json';\nimport sdkInfo from '../../package.json';\n\n/**\n * The InfoController is responsible for getting info on the engine, like version f.e. .\n * Methods and properties inside this controller can be accessed by `window.SDK.engine.{name}`\n */\nexport class InfoController {\n /**\n * This property returns the current engine version.\n * @returns current engine version\n */\n currentEngineVersion = engineInfo.current;\n\n /**\n * @returns The currently applicable SDK version\n */\n currentSDKVersion = sdkInfo.version;\n}\n","import { ColorUsage } from './ColorStyleTypes';\n\nexport enum BarcodeType {\n code39 = 'code39',\n code93 = 'code93',\n code128 = 'code128',\n dataMatrix = 'dataMatrix',\n ean13 = 'ean13',\n ean8 = 'ean8',\n qr = 'qr',\n upca = 'upca',\n upce = 'upce',\n gs1128 = 'gs1128',\n}\n\nexport interface BarcodeProperties {\n enableBackground?: boolean;\n backgroundColor?: ColorUsage;\n enableBars?: boolean;\n barColor?: ColorUsage;\n enableText?: boolean;\n barHeight?: string;\n magnification?: number;\n quietZone?: QuietZoneDeltaUpdate;\n errorCorrectionLevel?: BarcodeErrorCorrectionLevel;\n characterSet?: BarcodeCharacterSet;\n}\n\nexport enum BarcodeErrorCorrectionLevel {\n low = 'low',\n medium = 'medium',\n quartile = 'quartile',\n high = 'high',\n}\n\nexport enum BarcodeCharacterSet {\n utf8 = 'utf8',\n iso8859_1 = 'iso8859_1',\n code128a = 'code128a',\n code128b = 'code128b',\n code128c = 'code128c',\n}\n\nexport interface BarcodeConfigurationOptions {\n allowedErrorCorrectionLevels?: BarcodeErrorCorrectionLevel[];\n allowedCharacterSets?: BarcodeCharacterSet[];\n allowQuietZone: boolean;\n allowBarHeight: boolean;\n allowEnableMagnification: boolean;\n allowToggleText: boolean;\n quietZoneAlwaysCombined: boolean;\n}\n\nexport type QuietZone = {\n left: number;\n top: number;\n right: number;\n bottom: number;\n areQuietZoneValuesCombined: boolean;\n};\n\nexport type QuietZoneDeltaUpdate = {\n left?: string;\n top?: string;\n right?: string;\n bottom?: string;\n areQuietZoneValuesCombined?: boolean;\n};\n\nexport type BarcodeFrameValidationResult = {\n id: string;\n validationResult: BarcodeValidationResult;\n};\n\nexport enum BarcodeValidationResult {\n success = 'success',\n empty = 'empty',\n invalidLength = 'invalidLength',\n invalidCharacters = 'invalidCharacters',\n invalidChecksum = 'invalidChecksum',\n invalidUPCE = 'invalidUPCE',\n otherError = 'otherError',\n}\n","import { ClipboardContentType } from '../types/ClipboardTypes';\nimport { EditorAPI, Id } from '../types/CommonTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\n\n/**\n * The ClipboardController is responsible for all communication regarding clipboard.\n * Methods inside this controller can be called by `window.SDK.clipboard.{method-name}`\n */\nexport class ClipboardController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * This method will copy the frames to the OS clipboard as a json frame\n * @param ids An array of all frame ids you want to copy\n * @returns\n */\n copyFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n const frameData = await res.copyFrames(ids);\n\n if (frameData.data) {\n await navigator.clipboard.writeText(frameData.data);\n }\n\n return getEditorResponseData<null>(frameData);\n };\n\n /**\n * This method will remove the frames and store them to the OS clipboard as\n * a json frame\n * @param ids An array of all frame ids you want to cut\n * @returns\n */\n cutFrames = async (ids: Id[]) => {\n const res = await this.#editorAPI;\n const frameData = await res.cutFrames(ids);\n\n if (frameData.data) {\n await navigator.clipboard.writeText(frameData.data);\n }\n\n return getEditorResponseData<null>(frameData);\n };\n\n /**\n * This method will paste the OS clipboard content to the editor as frames\n * @returns\n */\n pasteFrames = async () => {\n const res = await this.#editorAPI;\n\n const clipboardData = await navigator.clipboard.readText();\n const result = await res.pasteFrames(clipboardData);\n\n return getEditorResponseData<null>(result);\n };\n\n /**\n * This method will get the content type of the OS clipboard\n * @returns content type\n */\n getContentType = async () => {\n const res = await this.#editorAPI;\n\n const clipboardData = await navigator.clipboard.readText();\n const result = await res.getClipboardContentType(clipboardData);\n\n return getEditorResponseData<ClipboardContentType>(result);\n };\n}\n","import { EditorAPI, Id } from '../types/CommonTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport {\n BarcodeConfigurationOptions,\n BarcodeProperties,\n BarcodeType,\n QuietZoneDeltaUpdate,\n BarcodeCharacterSet,\n BarcodeErrorCorrectionLevel,\n} from '../types/BarcodeTypes';\nimport { BarcodeSource } from '../types/FrameTypes';\nimport { PositionEnum } from '../types/LayoutTypes';\n\n/**\n * The BarcodeController is responsible for all communication regarding Barcodes.\n * Methods inside this controller can be called by `window.SDK.barcode.{method-name}`\n */\nexport class BarcodeController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n }\n\n /**\n * @experimental This method updates properties of the barcode\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param properties A property to update\n * @returns\n */\n private setBarcodeProperties = async (id: Id, properties: BarcodeProperties) => {\n const res = await this.#editorAPI;\n return res\n .setBarcodeProperties(id, JSON.stringify(properties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental This method will set the background of a barcode enabled or disabled\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param enableBackground Whether the barcode's background is visible.\n * @returns\n */\n setEnableBackground = async (id: Id, enableBackground: boolean) => {\n const properties: BarcodeProperties = { enableBackground: enableBackground };\n return this.setBarcodeProperties(id, properties);\n };\n\n /**\n * @experimental This method will set the barcode background color of a specified barcode frame.\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param backgroundColor the new barcode background color that you want to set to the barcodeFrame.\n * @returns\n */\n setBackgroundColor = async (id: Id, backgroundColor: ColorUsage) => {\n const properties: BarcodeProperties = { backgroundColor: backgroundColor };\n return this.setBarcodeProperties(id, properties);\n };\n\n /**\n * @experimental This method will set the visibility of the barcode's bars.\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param enableBars Whether the barcode bars are visible.\n * @returns\n */\n setEnableBars = async (id: Id, enableBars: boolean) => {\n const properties: BarcodeProperties = { enableBars: enableBars };\n return this.setBarcodeProperties(id, properties);\n };\n\n /**\n * @experimental This method will set the bar color of a specified barcode frame.\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param barColor the new bar color that you want to set to the barcodeFrame.\n * @returns\n */\n setBarColor = async (id: Id, barColor: ColorUsage) => {\n const properties: BarcodeProperties = { barColor: barColor };\n return this.setBarcodeProperties(id, properties);\n };\n\n /**\n * @experimental This method will set the source of the barcode to the given source.\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param source the new source that you want to set to the barcodeFrame.\n * @returns\n */\n setBarcodeSource = async (id: Id, source: BarcodeSource) => {\n const res = await this.#editorAPI;\n return res.setBarcodeSource(id, JSON.stringify(source)).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental This method enables/disables displaying the text of the barcode.\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param enableText true if the text should be displayed, false otherwise.\n * @returns\n */\n setEnableText = async (id: Id, enableText: boolean) => {\n const properties: BarcodeProperties = { enableText: enableText };\n return this.setBarcodeProperties(id, properties);\n };\n\n /**\n * @experimental This method sets the bar height for 1-dimensional barcodes.\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param barHeight the height of the bars in the barcode. The string value will be calculated (f.e. 1+1 will result in 2)\n * @returns\n */\n setBarHeight = async (id: Id, barHeight: string) => {\n const properties: BarcodeProperties = { barHeight: barHeight };\n return this.setBarcodeProperties(id, properties);\n };\n\n /**\n * @experimental This method sets the magnification for 1-dimensional barcodes.\n * @param id the id of the barcodeFrame that needs to be updated.\n * @param magnification the magnification of the barcode. This is a decimal value where 1 denotes 100%. (f.e. 1.5 will result in 150%)\n * @returns\n */\n setMagnification = async (id: Id, magnification: number) => {\n const properties: BarcodeProperties = { magnification: magnification };\n return this.setBarcodeProperties(id, properties);\n };\n\n /**\n * @experimental This method sets the quiet zone value of a specific barcode.\n * @param id The id of the specific barcode frame\n * @param value The quiet zone value\n * @param position When defined will update the quiet value of a single position,\n * otherwise will set all positions to the same value. Depending on this parameter\n * being defined, the `areQuietZoneValuesCombined` will also be updated.\n */\n setQuietZoneValue = async (id: Id, value: string, position?: PositionEnum) => {\n const update: QuietZoneDeltaUpdate = position\n ? {\n left: position === PositionEnum.left ? value : undefined,\n top: position === PositionEnum.top ? value : undefined,\n right: position === PositionEnum.right ? value : undefined,\n bottom: position === PositionEnum.bottom ? value : undefined,\n }\n : { left: value, top: value, right: value, bottom: value };\n\n const res = await this.#editorAPI;\n return res\n .setBarcodeProperties(id, JSON.stringify({ quietZone: update }))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental This method sets the combined state of the quiet zone values.\n * @param id The id of the specific barcode frame\n * @param value Whether the quiet zone values are combined\n */\n setAreQuietZoneValuesCombined = async (id: Id, value: boolean) => {\n const update: QuietZoneDeltaUpdate = { areQuietZoneValuesCombined: value };\n\n const res = await this.#editorAPI;\n return res\n .setBarcodeProperties(id, JSON.stringify({ quietZone: update }))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental This method sets the character set for the barcode.\n * @param id The id of the specific barcode frame.\n * @param errorCorrectionLevel The error correction level to set.\n * @returns\n */\n setErrorCorrectionLevel = async (id: Id, errorCorrectionLevel: BarcodeErrorCorrectionLevel) => {\n const res = await this.#editorAPI;\n return res\n .setBarcodeProperties(id, JSON.stringify({ errorCorrectionLevel: errorCorrectionLevel }))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental This method sets the character set for the barcode.\n * @param id The id of the specific barcode frame.\n * @param characterSet The character set to set.\n * @returns\n */\n setCharacterSet = async (id: Id, characterSet: BarcodeCharacterSet) => {\n const res = await this.#editorAPI;\n return res\n .setBarcodeProperties(id, JSON.stringify({ characterSet: characterSet }))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental This method returns the possible configuration options which are valid for the given barcode type.\n * @param type the barcode type for which the configuration options are requested.\n * @returns a BarcodeConfigurationOptions object\n */\n getBarcodeConfigationOptions = (type: BarcodeType): BarcodeConfigurationOptions => {\n let allowToggleText = true;\n let allowBarHeight = true;\n let allowEnableMagnification = true;\n let allowedCharacterSets = undefined;\n let allowedErrorCorrectionLevels = undefined;\n let quietZoneAlwaysCombined = false;\n switch (type) {\n case BarcodeType.qr:\n allowedCharacterSets = [BarcodeCharacterSet.iso8859_1, BarcodeCharacterSet.utf8];\n allowedErrorCorrectionLevels = [\n BarcodeErrorCorrectionLevel.low,\n BarcodeErrorCorrectionLevel.medium,\n BarcodeErrorCorrectionLevel.quartile,\n BarcodeErrorCorrectionLevel.high,\n ];\n // Intentional fall-through\n case BarcodeType.dataMatrix:\n allowToggleText = false;\n allowBarHeight = false;\n allowEnableMagnification = false;\n quietZoneAlwaysCombined = true;\n break;\n case BarcodeType.ean13:\n case BarcodeType.ean8:\n case BarcodeType.upca:\n case BarcodeType.upce:\n allowToggleText = false;\n break;\n case BarcodeType.code128:\n case BarcodeType.gs1128:\n allowedCharacterSets = [\n BarcodeCharacterSet.code128a,\n BarcodeCharacterSet.code128b,\n BarcodeCharacterSet.code128c,\n ];\n break;\n }\n return {\n allowEnableMagnification: allowEnableMagnification,\n allowBarHeight: allowBarHeight,\n allowQuietZone: true,\n allowedCharacterSets: allowedCharacterSets,\n allowedErrorCorrectionLevels: allowedErrorCorrectionLevels,\n allowToggleText: allowToggleText,\n quietZoneAlwaysCombined: quietZoneAlwaysCombined,\n };\n };\n}\n","import { Connection } from 'penpal';\nimport Connect from './interactions/connector';\nimport { defaultStudioOptions, WellKnownConfigurationKeys } from './types/ConfigurationTypes';\nimport packageInfo from '../package.json';\nimport engineInfo from '../editor-engine.json';\n\nimport type { ConfigType, EditorAPI } from './types/CommonTypes';\nimport { DocumentType } from './types/DocumentTypes';\n\nimport { ActionController } from './controllers/ActionController';\nimport { AnimationController } from './controllers/AnimationController';\nimport { CanvasController } from './controllers/CanvasController';\nimport { CharacterStyleController } from './controllers/CharacterStyleController';\nimport { ColorStyleController } from './controllers/ColorStyleController';\nimport { ColorConversionController } from './controllers/ColorConversionController';\nimport { ConfigurationController } from './controllers/ConfigurationController';\nimport { ConnectorController } from './controllers/ConnectorController';\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 { LayoutController } from './controllers/LayoutController';\nimport { MediaConnectorController } from './controllers/MediaConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { ParagraphStyleController } from './controllers/ParagraphStyleController';\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 { ShapeController } from './controllers/ShapeController';\nimport { InfoController } from './controllers/InfoController';\nimport { ClipboardController } from './controllers/ClipboardController';\nimport { BarcodeController } from './controllers/BarcodeController';\n\nlet connection: Connection;\n\nconst FIXED_EDITOR_LINK = 'https://studio-cdn.chiligrafx.com/editor/' + engineInfo.current + '/web';\n\nexport class SDK {\n config: ConfigType;\n connection: Connection;\n\n /**\n * @ignore\n */\n editorAPI: EditorAPI;\n\n action: ActionController;\n layout: LayoutController;\n frame: FrameController;\n shape: ShapeController;\n /** @experimental */\n barcode: BarcodeController;\n connector: ConnectorController;\n mediaConnector: MediaConnectorController;\n fontConnector: FontConnectorController;\n animation: AnimationController;\n document: DocumentController;\n configuration: ConfigurationController;\n variable: VariableController;\n utils: UtilsController;\n tool: ToolController;\n page: PageController;\n debug: DebugController;\n undoManager: UndoManagerController;\n textSelection: TextStyleController;\n paragraphStyle: ParagraphStyleController;\n characterStyle: CharacterStyleController;\n colorStyle: ColorStyleController;\n font: FontController;\n experiment: ExperimentController;\n canvas: CanvasController;\n colorConversion: ColorConversionController;\n info: InfoController;\n clipboard: ClipboardController;\n\n private subscriber: SubscriberController;\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 = config;\n this.connection = connection;\n this.editorAPI = connection?.promise.then((child) => {\n return child;\n }) as unknown as EditorAPI;\n\n this.action = new ActionController(this.editorAPI);\n this.layout = new LayoutController(this.editorAPI);\n this.frame = new FrameController(this.editorAPI);\n this.shape = new ShapeController(this.editorAPI);\n this.barcode = new BarcodeController(this.editorAPI);\n this.undoManager = new UndoManagerController(this.editorAPI, this);\n this.connector = new ConnectorController(this.editorAPI);\n this.mediaConnector = new MediaConnectorController(this.editorAPI);\n this.fontConnector = new FontConnectorController(this.editorAPI);\n this.animation = new AnimationController(this.editorAPI);\n this.document = new DocumentController(this.editorAPI);\n this.configuration = new ConfigurationController(this.editorAPI);\n this.variable = new VariableController(this.editorAPI);\n this.utils = new UtilsController();\n this.subscriber = new SubscriberController(this.config);\n this.tool = new ToolController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.debug = new DebugController(this.editorAPI);\n // To be renamed textSelection > textStyle\n this.textSelection = new TextStyleController(this.editorAPI);\n this.colorStyle = new ColorStyleController(this.editorAPI);\n this.paragraphStyle = new ParagraphStyleController(this.editorAPI);\n this.characterStyle = new CharacterStyleController(this.editorAPI);\n this.font = new FontController(this.editorAPI);\n this.experiment = new ExperimentController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n this.colorConversion = new ColorConversionController(this.editorAPI);\n this.info = new InfoController();\n this.clipboard = new ClipboardController(this.editorAPI);\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 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: this.subscriber.onVariableListChanged,\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: this.subscriber.onConnectorsChanged,\n onZoomChanged: this.subscriber.onZoomChanged,\n onPageSizeChanged: this.subscriber.onPageSizeChanged,\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 },\n this.setConnection,\n this.config.editorId,\n this.config.studioStyling,\n );\n this.editorAPI = connection?.promise.then((editorAPI) => {\n return editorAPI;\n }) as unknown as EditorAPI;\n\n this.action = new ActionController(this.editorAPI);\n this.layout = new LayoutController(this.editorAPI);\n this.frame = new FrameController(this.editorAPI);\n this.barcode = new BarcodeController(this.editorAPI);\n this.animation = new AnimationController(this.editorAPI);\n this.document = new DocumentController(this.editorAPI);\n this.configuration = new ConfigurationController(this.editorAPI);\n this.utils = new UtilsController();\n this.tool = new ToolController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.debug = new DebugController(this.editorAPI);\n this.undoManager = new UndoManagerController(this.editorAPI, this);\n this.textSelection = new TextStyleController(this.editorAPI);\n this.colorStyle = new ColorStyleController(this.editorAPI);\n this.paragraphStyle = new ParagraphStyleController(this.editorAPI);\n this.characterStyle = new CharacterStyleController(this.editorAPI);\n this.mediaConnector = new MediaConnectorController(this.editorAPI);\n this.fontConnector = new FontConnectorController(this.editorAPI);\n this.connector = new ConnectorController(this.editorAPI);\n this.variable = new VariableController(this.editorAPI);\n this.font = new FontController(this.editorAPI);\n this.experiment = new ExperimentController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n this.shape = new ShapeController(this.editorAPI);\n this.info = new InfoController();\n this.clipboard = new ClipboardController(this.editorAPI);\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\n setConnection = (newConnection: Connection) => {\n connection = newConnection;\n };\n}\n\nexport default SDK;\n","import { Id } from './CommonTypes';\n\nexport enum SlideDirections {\n top = 'top',\n left = 'left',\n right = 'right',\n bottom = 'bottom',\n topLeft = 'topLeft',\n topRight = 'topRight',\n bottomLeft = 'bottomLeft',\n bottomRight = 'bottomRight',\n}\n\nexport enum ShakeDirections {\n horizontal = 'horizontal',\n vertical = 'vertical',\n}\n\nexport enum EaseTypes {\n easeIn = 'easeIn',\n easeOut = 'easeOut',\n easeInOut = 'easeInOut',\n}\n\nexport enum TweenTypes {\n quadratic = 'Quadratic',\n cubic = 'Cubic',\n quartic = 'Quartic',\n quintic = 'Quintic',\n sine = 'Sine',\n exponential = 'Exponential',\n circular = 'Circular',\n elastic = 'Elastic',\n bounce = 'Bounce',\n back = 'Back',\n}\n\nexport enum BasicAnimationsEmphasisStyles {\n bounce = 'bounce',\n flash = 'flash',\n headshake = 'headShake',\n heartbeat = 'heartbeat',\n pulse = 'pulse',\n rubberBand = 'rubberBand',\n vertical = 'vertical',\n horizontal = 'horizontal',\n swing = 'swing',\n tada = 'tada',\n}\n\nexport type EaseTweenCombinationType = `${EaseTypes}${TweenTypes}` | 'noEase';\n\nexport type BasicAnimationsIntroOutroStylesType = {\n slide?: {\n direction: SlideDirections;\n offsetPercent: number;\n };\n rotation?: {\n angleDegrees: number;\n numberOfRotations?: number;\n };\n scale?: {\n scalePercent: number;\n };\n fade?: boolean;\n};\n\nexport type BasicAnimationsIntroType = {\n from: number;\n to: number;\n ease: EaseTweenCombinationType;\n styles: BasicAnimationsIntroOutroStylesType;\n};\n\nexport type BasicAnimationsEmphasisType = {\n from: number;\n to: number;\n ease: EaseTweenCombinationType;\n styles: {\n bounce?: boolean;\n flash?: boolean;\n pulse?: boolean;\n rubberBand?: boolean;\n shake?: {\n direction: ShakeDirections;\n };\n vertical?: boolean;\n horizontal?: boolean;\n headshake?: boolean;\n swing?: boolean;\n tada?: boolean;\n heartbeat?: boolean;\n };\n};\n\nexport type BasicAnimationsOutroType = {\n from: number;\n to: number;\n ease: EaseTweenCombinationType;\n styles: BasicAnimationsIntroOutroStylesType;\n};\n\nexport type BasicAnimationsType = {\n intro?: BasicAnimationsIntroType;\n emphasis?: BasicAnimationsEmphasisType;\n outro?: BasicAnimationsOutroType;\n};\n\nexport type FrameAnimationPropertiesType = {\n id: Id;\n from: number;\n to: number;\n basicAnimations: BasicAnimationsType;\n advancedAnimations?: unknown; // TBI\n};\nexport type FrameAnimationType = {\n animation: FrameAnimationPropertiesType;\n isOverride: boolean;\n};\n\nexport type AnimationPlaybackType = {\n currentAnimationTimeMs: number;\n animationIsPlaying: boolean;\n} | null;\n","export enum ViewMode {\n preview = 'preview',\n normal = 'normal',\n}\n","import { VerticalAlign } from './FrameTypes';\nimport { ColorUsage } from './ColorStyleTypes';\n\nexport enum FontWeights {\n BOLD = 'Bold',\n ITALIC = 'Italic',\n REGULAR = 'Regular',\n}\nexport enum Alignment {\n LEFT = 'left',\n CENTER = 'center',\n RIGHT = 'right',\n JUSTIFY = 'justify',\n}\n\nexport enum TextPosition {\n TOP = 'top',\n CENTER = 'center',\n BOTTOM = 'bottom',\n}\nexport enum Case {\n TO_LOWER_CASE = 'lowercase',\n TO_UPPER_CASE = 'uppercase',\n NORMAL = 'normal',\n}\nexport enum Scripting {\n SUPERSCRIPT = 'superscript',\n SUBSCRIPT = 'subscript',\n NORMAL = 'normal',\n}\n\nexport type DisplayColor = ColorUsage & {\n isApplied: boolean;\n};\nexport interface TextProperties {\n fontKey?: string;\n fontStyle?: FontWeights;\n fontSize?: number;\n textAlign?: Alignment;\n verticalAlign?: VerticalAlign;\n underline?: boolean;\n lineThrough?: boolean;\n letterSpacing?: string;\n trackingRight?: string;\n lineHeight?: number;\n SUB_SUPER_SCRIPT?: Scripting;\n typographicCase?: Case;\n color?: DisplayColor;\n [key: string]: number | string | Record<string, unknown> | null | boolean | undefined;\n}\n\nexport interface TextStyle {\n paragraph?: string;\n character?: string;\n [key: string]: number | string | Record<string, unknown> | null | boolean | undefined;\n}\nexport type TextStyleUpdateType = {\n [key in keyof typeof SelectedTextStyles]?: {\n value: number | string | boolean;\n };\n};\n\nexport interface AppearanceProperties {\n blendMode?: string;\n opacity?: string;\n useFill?: boolean;\n useStroke?: boolean;\n useDropShadow?: boolean;\n fillColor?: string;\n strokeColor?: string;\n dropShadowColor?: string;\n}\n\nexport interface SelectedTextStyle {\n paragraphStyleId?: string;\n characterStyleId?: string;\n fontKey?: string;\n fontSize?: number;\n typographicCase?: Case;\n kerningOn?: boolean;\n subSuperScript?: Scripting;\n trackingLeft?: number;\n trackingRight?: number;\n paragraphIndentStart?: string;\n paragraphIndentEnd?: string;\n paragraphSpaceBefore?: string;\n paragraphSpaceAfter?: string;\n textIndent?: string;\n alignToBaseLine?: boolean;\n baselineShiftValue?: string;\n lineHeight?: number;\n verticalAlign?: VerticalAlign;\n copyfittingScale?: number;\n textAlign?: HorizontalAlign;\n textAlignLast?: HorizontalAlign;\n textOverprint?: boolean;\n color?: DisplayColor;\n underline?: boolean;\n lineThrough?: boolean;\n hasLocalFormatting: boolean;\n}\n\nexport enum HorizontalAlign {\n left = 'left',\n center = 'center',\n right = 'right',\n justify = 'justify',\n}\n\nexport enum SelectedTextStyleSections {\n STYLE = 'textStyle',\n PROPERTIES = 'textProperties',\n APPEARANCE = 'appearance',\n}\n\nexport enum SelectedTextStyles {\n PARAGRAPH = 'paragraphStyleId',\n CHARACTER = 'characterStyleId',\n FONT_FAMILY = 'fontKey',\n FONT_STYLE = 'fontStyle',\n FONT_SIZE = 'fontSize',\n LETTER_SPACING = 'letterSpacing',\n LINE_HEIGHT = 'lineHeight',\n TEXT_ALIGN = 'textAlign',\n VERTICAL_ALIGN = 'verticalAlign',\n TYPOGRAPHIC_CASE = 'typographicCase',\n SUB_SUPER_SCRIPT = 'subSuperScript',\n UNDERLINE = 'underline',\n LINE_THROUGH = 'lineThrough',\n FILL_COLOR = 'fillColor',\n COLOR = 'color',\n FILL_COLOR_APPLIED = 'fillColorApplied',\n STROKE_COLOR = 'strokeColor',\n DROP_SHADOW_COLOR = 'dropShadowColor',\n BLEND_MODE = 'blendMode',\n OPACITY = 'opacity',\n TRACKING_RIGHT = 'trackingRight',\n BASELINE_SHIFT = 'baselineShiftValue',\n}\n\nexport interface UpdateStyleType {\n path: { value: number | string | Record<string, unknown> | null | boolean | undefined };\n}\n","import { Id } from './CommonTypes';\n\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n spot = 'spot',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color = RGBColor | CMYKColor | HSLColor | GrayColor | SpotColor | HexColor;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the stylekit color, can only be used if it is a stylekit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the stylekit color, can only be used if it is a stylekit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * THe color is referencing a stylekit color\n */\n stylekit = 'stylekit',\n}\n","import { Id } from './CommonTypes';\n\nexport enum FontPreviewFormat {\n Square = 'square',\n Line = 'line',\n}\n\nexport type FontFamily = {\n id: Id;\n name: string;\n fontStylesCount: number;\n extensions: string[];\n};\n\nexport type FontStyle = {\n id: Id;\n name: string;\n familyId: string;\n familyName: string;\n};\n","import { Id } from './CommonTypes';\n\n/**\n * Editor Events that Actions can react to.\n */\nexport enum ActionEditorEvent {\n /**\n * Indicates the selected layout changed.\n */\n selectedLayoutChanged = 'selectedLayoutChanged',\n\n /**\n * Indicates a frame was moved, resized, rotated.\n * Note: this does not trigger when a different layout is selected.\n */\n frameMoved = 'frameMoved',\n\n /**\n * Indicates the size of a page has changed.\n */\n pageSizeChanged = 'pageSizeChanged',\n\n /**\n * Indicates the document is fully initialized, actions can safely be executed.\n * Note: the other events will only be triggered after a document is fully initialized.\n */\n documentLoaded = 'documentLoaded',\n\n /**\n * Indicates the value of a variable changed.\n */\n variableValueChanged = 'variableValueChanged',\n}\n\n/**\n * Action used by the document.\n */\nexport interface DocumentAction {\n /**\n * Unique Id of the action.\n */\n id: Id;\n\n /**\n * Unique action name\n */\n name: string;\n\n /**\n * All the triggers this action will react to.\n */\n triggers: ActionTrigger[];\n\n /**\n * The JavaScript based action script.\n */\n script: string;\n}\n\n/**\n * Trigger used to fire an action.\n */\nexport type ActionTrigger =\n | SelectedLayoutChangedTrigger\n | FrameMovedTrigger\n | PageSizeChangedTrigger\n | DocumentLoadedTrigger\n | VariableValueChangedTrigger;\n\nexport interface SelectedLayoutChangedTrigger {\n event: ActionEditorEvent.selectedLayoutChanged;\n}\n\n/**\n * Model to update an Action.\n */\nexport type ActionDeltaUpdate = {\n /**\n * The new Action JS script.\n */\n script?: string;\n\n /**\n * The new name of the Action.\n */\n name?: string;\n\n /**\n * Whether the Action has any typing errors.\n */\n hasTypeError?: boolean;\n\n /**\n * The new list of triggers.\n */\n triggers?: ActionTrigger[];\n};\n\nexport interface FrameMovedTrigger {\n event: ActionEditorEvent.frameMoved;\n /**\n * The frame id's this trigger should react to.\n * Leaving this `undefined`, will make this trigger react to any frame that moves in any direction (also rotation, resize and ).\n */\n triggers?: Id[];\n}\n\nexport interface PageSizeChangedTrigger {\n event: ActionEditorEvent.pageSizeChanged;\n}\n\nexport interface DocumentLoadedTrigger {\n event: ActionEditorEvent.documentLoaded;\n}\n\nexport interface VariableValueChangedTrigger {\n event: ActionEditorEvent.variableValueChanged;\n\n /**\n * The variable id's this trigger should react to.\n * Leaving this `undefined`, will make this trigger react to all variableValueChanges.\n */\n triggers?: Id[];\n}\n","import { ColorUsage } from './ColorStyleTypes';\n\nexport enum ShapeType {\n ellipse = 'ellipse',\n rectangle = 'rectangle',\n polygon = 'polygon',\n}\n\nexport interface ShapeProperties {\n enableFill?: boolean;\n fillColor?: ColorUsage;\n enableStroke?: boolean;\n strokeColor?: ColorUsage;\n strokeWeight?: number;\n allCornersSame?: boolean;\n}\n\nexport interface CornerRadiusUpdateModel {\n radiusAll?: number;\n topLeft?: number;\n bottomLeft?: number;\n topRight?: number;\n bottomRight?: number;\n}\n\nexport interface CornerRadiusNone {\n type: string;\n}\n\nexport interface CornerRadiusAll {\n type: string;\n radius: number;\n}\n\nexport interface CornerRadiusOnly {\n type: string;\n topLeft: number;\n bottomLeft: number;\n topRight: number;\n bottomRight: number;\n}\n\nexport enum CornerRadiusType {\n all = 'all',\n only = 'only',\n none = 'none',\n}\n","import { SDK } from './sdk';\n\nexport { FramePropertyNames, LayoutPropertyNames, ToolType, DownloadFormats, EnvironmentType } from './utils/enums';\n\nexport {\n SlideDirections,\n ShakeDirections,\n EaseTypes,\n TweenTypes,\n BasicAnimationsEmphasisStyles,\n} from './types/AnimationTypes';\nexport { LayoutType, MeasurementUnit, LayoutIntent, PositionEnum } from './types/LayoutTypes';\nexport {\n BlendMode,\n FrameTypeEnum,\n VerticalAlign,\n TextDirection,\n FlowDirection,\n FitMode,\n UpdateZIndexMethod,\n ImageSourceTypeEnum,\n BarcodeSourceTypeEnum,\n} from './types/FrameTypes';\nexport { DocumentType } from './types/DocumentTypes';\n\nexport { ViewMode } from './types/ViewModeTypes';\n\nexport type {\n LayoutPropertiesType,\n FrameProperties,\n LayoutWithFrameProperties,\n LayoutListItemType,\n Layout,\n} from './types/LayoutTypes';\nexport type {\n FrameLayoutType,\n FrameType,\n Frame,\n TextFrame,\n ImageFrame,\n ShapeFrame,\n BarcodeFrame,\n BarcodeSource,\n BarcodeVariableSource,\n BarcodeTextSource,\n ImageFrameSource,\n ImageFrameVariableSource,\n ImageFrameUrlSource,\n} from './types/FrameTypes';\nexport type {\n Variable,\n GroupVariable,\n ImageVariable,\n LongTextVariable,\n ShortTextVariable,\n ListVariable,\n ListVariableItem,\n BooleanVariable,\n ConnectorImageVariableSource,\n} from './types/VariableTypes';\nexport { VariableType } from './types/VariableTypes';\n\nexport type { Color, DocumentColor, ColorUpdate } from './types/ColorStyleTypes';\n\nexport type { DocumentError } from './types/DocumentTypes';\nexport type {\n FrameAnimationType,\n FrameAnimationPropertiesType,\n EaseTweenCombinationType,\n AnimationPlaybackType,\n BasicAnimationsType,\n} from './types/AnimationTypes';\nexport type {\n ConfigType,\n InitialStateType,\n PageType,\n EditorResponse,\n SelectedLayoutFrame,\n MetaData,\n Id,\n ConnectorConfigOptions,\n ConnectorConfigValue,\n ConnectorConfigValueType,\n} from './types/CommonTypes';\n\nexport type {\n TextProperties,\n SelectedTextStyle,\n TextStyle,\n AppearanceProperties,\n TextStyleUpdateType,\n UpdateStyleType,\n DisplayColor,\n} from './types/TextStyleTypes';\n\nexport type { ParagraphStyle, ParagraphStyleUpdate } from './types/ParagraphStyleTypes';\nexport type { CharacterStyle, CharacterStyleUpdate } from './types/CharacterStyleTypes';\nexport type { ColorUsage, ColorUsageUpdate, ColorUsageType } from './types/ColorStyleTypes';\n\nexport type {\n DocumentFontStyle,\n DocumentFontFamily,\n AddDocumentFontStyle,\n AddDocumentFontFamily,\n} from './types/FontTypes';\n\nexport {\n SelectedTextStyleSections,\n SelectedTextStyles,\n FontWeights,\n Alignment,\n TextPosition,\n Case,\n Scripting,\n} from './types/TextStyleTypes';\nexport { ColorType } from './types/ColorStyleTypes';\nexport * from './types/MediaConnectorTypes';\nexport * from './types/FontConnectorTypes';\nexport * from './types/ConnectorTypes';\n\nexport { WellKnownConfigurationKeys } from './types/ConfigurationTypes';\n\nexport * from './types/ActionTypes';\n\nexport * from './types/ShapeTypes';\n\nexport * from './types/BarcodeTypes';\n\nexport type { Viewport } from './types/ViewportTypes';\n\nexport default SDK;\n"],"names":["root","factory","exports","module","define","amd","this","Resolution","ErrorCode","NativeErrorName","__webpack_require__","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","MessageType","NativeEventType","DEFAULT_PORT_BY_PROTOCOL","URL_REGEX","opaqueOriginSchemes","serializeError","name","message","stack","id","keyPathToSegments","keyPath","split","setAtKeyPath","subject","segments","reduce","prevSubject","idx","length","methods","prefix","flattenedMethods","keys","forEach","push","join","segmentsToKeyPath","createKeyPath","assign","callSender","info","methodKeyPaths","destroyConnection","log","destroyed","localName","createMethodProxy","methodName","args","iframeRemoved","remote","closed","e","error","Error","code","ConnectionDestroyed","Promise","resolve","reject","generateId","handleMessageEvent","event","source","data","penpal","origin","originForReceiving","replyMessage","local","removeEventListener","returnValue","returnValueIsError","deserializedError","deserializeError","resolution","Fulfilled","addEventListener","callMessage","postMessage","originForSending","api","deserializeMethods","serializedMethods","childOrigin","destructor","destroyCallReceiver","receiverMethodNames","window","createPromiseHandler","Rejected","err","DataCloneError","errorReplyMessage","apply","then","onDestroy","receiverMethodName","methodNames","destroyCallSender","destroy","options","debug","console","callbacks","callback","iframe","src","srcdoc","NoIframeSrc","validateIframeHasSrcOrSrcDoc","find","scheme","startsWith","location","document","regexResult","exec","protocol","hostname","port","getOriginFromSrc","handleSynMessage","synAckMessage","handleSynMessageFactory","handleAckMessage","handleAckMessageFactory","promise","stopConnectionTimeout","timeout","timeoutId","undefined","setTimeout","ConnectionTimeout","clearTimeout","handleMessage","contentWindow","checkIframeInDocIntervalId","setInterval","isConnected","clearInterval","monitorIframeRemoval","setupFrame","editorLink","styling","link","RegExp","test","indexOf","replace","charAt","validateEditorLink","html","JSON","stringify","iframeDoc","ownerDocument","open","write","close","params","setConnection","editorId","editorSelectorId","createElement","setAttribute","setupNewFrame","iframeContainer","querySelector","appendChild","readyState","connectToChild","actionsChanged","onActionsChanged","stateChanged","onStateChanged","documentLoaded","onDocumentLoaded","authExpired","onAuthExpired","viewportRequested","onViewportRequested","selectedFramesContent","onSelectedFramesContentChanged","selectedFramesLayout","onSelectedFramesLayoutChanged","selectedLayoutProperties","onSelectedLayoutPropertiesChanged","openLayoutPropertiesPanel","onPageSelectionChanged","selectedLayoutUnit","onSelectedLayoutUnitChanged","scrubberPositionChanged","onScrubberPositionChanged","frameAnimationsChanged","onFrameAnimationsChanged","selectedToolChanged","onSelectedToolChanged","variableListChanged","onVariableListChanged","undoStackStateChanged","onUndoStateChanged","selectedLayoutFramesChanged","onSelectedLayoutFramesChanged","selectedTextStyleChanged","onSelectedTextStyleChanged","colorsChanged","onColorsChanged","paragraphStylesChanged","onParagraphStylesChanged","characterStylesChanged","onCharacterStylesChanged","fontFamiliesChanged","onFontFamiliesChanged","selectedLayoutId","onSelectedLayoutIdChanged","layoutListChanged","onLayoutsChanged","connectorEvent","onConnectorEvent","connectorsChanged","onConnectorsChanged","zoomChanged","onZoomChanged","pageSizeChanged","onPageSizeChanged","shapeCornerRadiusChanged","onShapeCornerRadiusChanged","cropActiveFrameIdChanged","onCropActiveFrameIdChanged","asyncError","onAsyncError","viewModeChanged","onViewModeChanged","barcodeValidationChanged","onBarcodeValidationChanged","WellKnownConfigurationKeys","defaultStudioOptions","shortcutOptions","debugPanel","enabled","ellipse","hand","image","polygon","rectangle","select","text","zoom","copyPaste","viewMode","ImageFrameSourceType","FramePropertiesType","DocumentType","getEditorResponseData","response","parse","success","cause","String","status","dataShouldBeParsed","parsedData","ActionController","constructor","editorAPI","getAll","getActions","result","getById","getActionById","create","createAction","duplicate","duplicateAction","remove","removeAction","update","updateAction","rename","updateScript","actionScript","script","updateTriggers","triggers","move","order","ids","moveActions","setTypeError","hasTypeErrors","hasTypeError","AnimationController","children","getAllOnSelectedLayout","getAnimationsOnSelectedLayout","getByFrameId","layoutId","getAnimationByFrameId","getByLayoutId","getAnimationsByLayoutId","setFrameAnimation","animation","play","playAnimation","pause","pauseAnimation","setScrubberPosition","timeInMS","setDuration","setAnimationDuration","resetFrameAnimation","reset","resetAnimation","CanvasController","zoomToPage","left","top","width","height","getZoomPercentage","setZoomPercentage","scaleFactor","setViewMode","CharacterStyleController","getCharacterStyles","characterStyleId","getCharacterStyleById","createCharacterStyle","characterStyle","updateCharacterStyle","removeCharacterStyle","duplicateCharacterStyle","characterStyleName","renameCharacterStyle","ColorStyleController","getColors","getColorById","createColor","duplicateColor","moveColors","newColorName","renameColor","newColorProperties","updateColor","removeColor","ColorConversionController","convertToRgb","color","colorToRgb","DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","ConfigurationController","getValue","getConfigValue","setValue","setConfigValue","updateStudioOptions","getEngineSessionId","ConnectorMapping","contextProperty","mapFrom","sourceValue","direction","engineToConnector","variable","grafxMediaConnectorRegistration","url","GrafxTokenAuthCredentials","token","type","AuthCredentialsTypeEnum","grafxToken","RefreshedAuthCredendentials","refreshed","AuthRefreshTypeEnum","ConnectorController","getConnectorById","getAllByType","getConnectors","register","registration","registerConnector","unregister","unregisterConnector","configure","configurationCallback","res","waitToBeReady","ConnectorConfigurator","updateConnectorConfiguration","getState","getConnectorState","getMappings","getConnectorMappings","getOptions","getConnectorOptions","timeoutMilliseconds","Math","max","min","retries","running","ready","setOptions","setConnectorOptions","setMappings","mappings","setConnectorMappings","map","m","setHttpHeader","headerName","headerValue","connectorAuthenticationSetHttpHeader","DebugController","getAllLogs","getLogs","toggleDebugPanel","enableDebug","disableDebug","ImageSourceTypeEnum","FrameTypeEnum","BarcodeSourceTypeEnum","TextDirection","FlowDirection","VerticalAlign","BlendMode","FitMode","UpdateZIndexMethod","DocumentController","getCurrentState","getCurrentDocumentState","load","doc","keepConnectors","loadDocumentKeepConnectors","loadDocument","ExperimentController","insertImageVariableToFrame","imageFrameId","variableId","setImageSource","insertTextVariable","enterTextEditMode","exitTextEditMode","getText","frameId","textType","getTextByFrameId","setText","setTextByFrameId","selectText","startIndex","selectTextById","FontConnectorController","query","connectorId","queryOptions","context","fontConnectorQuery","detail","fontFamilyId","fontConnectorDetail","download","fontStyleId","fontConnectorDownload","preview","previewFormat","fontConnectorPreview","getConfigurationOptions","fontConnectorGetConfigurationOptions","getCapabilities","fontConnectorGetCapabilities","parseDeprecatedFontType","deprecatedType","file","collection","FontController","addFontFamily","fontFamily","removeFontFamily","addFontStyle","fontStyle","removeFontStyle","getFontFamilies","getFontStyles","getFontFamilyById","getFontStyleById","getDefaultFontStyle","getDefaultFontFamily","isFontFamilyUsed","isFontStyleUsed","moveFontFamilies","ShapeController","setShapeProperties","properties","setEnableFill","enableFill","setFillColor","fillColor","setEnableStroke","enableStroke","setStrokeColor","strokeColor","setStrokeWeight","strokeWeight","setFlagAllCornersSame","allCornersSame","setShapeCorners","radius","setRadiusAll","cornerRadius","radiusAll","setRadiusTopLeft","topLeft","setRadiusBottomLeft","bottomLeft","setRadiusTopRight","topRight","setRadiusBottomRight","bottomRight","PositionEnum","LayoutType","MeasurementUnit","LayoutIntent","FrameController","getFrames","getSelected","getSelectedFrames","getAllByPageId","getFramesByPageId","getByName","getFrameByName","getFrameById","getPropertiesOnSelectedLayout","getFramePropertiesOnSelectedLayout","getLayoutProperties","getFramePropertiesByFrameId","getAllLayoutProperties","getFramesProperties","resetSize","resetFrameSize","selectFrames","selectMultiple","reorderFrames","setZIndex","method","setFrameZIndex","setHeight","setFrameHeight","setRotation","rotation","setFrameRotation","setWidth","setFrameWidth","setX","XValue","setFrameX","setY","YValue","setFrameY","renameFrame","resetFrame","resetX","resetFrameX","resetY","resetFrameY","resetRotation","resetFrameRotation","resetWidth","resetFrameWidth","resetHeight","resetFrameHeight","resetImageFrameFitMode","setVisibility","setFrameIsVisible","setIsVisible","removeFrames","x","y","addFrame","createShapeFrame","createBarcodeFrame","position","addBarcodeFrame","duplicateFrames","updateImageSource","srcJson","removeImageSource","setImageFromConnector","assetId","connector","setImageFromUrl","setImageFrameFitMode","fitMode","setFrameConstrainProportions","constrainProportions","setVerticalAlign","verticalAlign","setVerticalAlignment","setMinCopyfitting","setMaxCopyfitting","setEnableCopyfitting","resetMinCopyfitting","resetMaxCopyfitting","resetEnableCopyfitting","setShapeFrameEnableFill","shapeFrameId","shapeController","setShapeFrameFillColor","setShapeFrameEnableStroke","setShapeFrameStrokeColor","setShapeFrameStrokeWeight","setBlendMode","blendMode","setFrameBlendMode","enterCropMode","applyCropMode","resetCropMode","exitCropMode","cancelCropMode","MediaDownloadType","MediaDownloadIntent","LayoutController","getLayouts","getLayoutById","getLayoutByName","getSelectedLayout","removeLayout","parentId","addLayout","renameLayout","selectLayout","duplicateLayout","resetLayout","setLayoutHeight","setLayoutWidth","setUnit","unit","setLayoutUnit","resetLayoutHeight","resetLayoutWidth","resetUnit","resetLayoutUnit","getSelectedSnapshot","getPageSnapshot","setIntent","intent","setLayoutIntent","resetIntent","resetLayoutIntent","setLayoutFillColor","setFillColorEnabled","setLayoutFillColorEnabled","resetFillColor","resetLayoutFillColor","setBleedValue","right","bottom","updateLayoutBleed","setAreBleedValuesCombined","areBleedValuesCombined","resetBleedValues","MediaConnectorController","mediaConnectorQuery","mediaId","mediaConnectorDetail","downloadType","compatibleDownloadType","parseDeprecatedMediaDownloadType","mediaConnectorDownload","web","mediaConnectorGetConfigurationOptions","mediaConnectorGetCapabilities","parseDeprecatedMediaType","deprecatedMediaDownloadType","HighResolutionWeb","highres","LowResolutionWeb","thumbnail","PageController","getPages","getPageById","setPageWidth","setPageHeight","VariableType","ParagraphStyleController","getParagraphStyles","getParagraphStyleById","createParagraphStyle","duplicateParagraphStyle","updateParagraphStyle","renameParagraphStyle","removeParagraphStyle","moveParagraphStyles","SubscriberController","config","actions","callBack","onAnimationChanged","onAnimationPlaybackChanged","animationPlaybackState","layoutProperties","framesLayout","frames","multiFrameCallBack","singleFrameCallBack","onSelectedFrameLayoutChanged","framesContent","onSelectedFrameContentChanged","authRefreshRequest","authCredentials","viewport","variablesJson","list","items","item","selected","tool","undoState","onUndoStackStateChanged","layoutFrames","styles","colors","paragraphStyles","characterStyles","fonts","layouts","connectors","pageSize","validationResults","FramePropertyNames","LayoutPropertyNames","ToolType","DownloadFormats","EnvironmentType","TextStyleController","set","style","selectedTextStyleDeltaUpdate","removeSelected","selectedTextStyleClean","getSelectedTextStyle","ToolController","setTool","getSelectedTool","setPointer","SELECT","setSelect","setHand","HAND","setZoom","ZOOM","setTextFrame","TEXT_FRAME","setImageFrame","IMAGE_FRAME","setShapeRect","SHAPE_RECT","setShapeEllipse","SHAPE_ELLIPSE","setShapePolygon","SHAPE_POLYGON","UndoManagerController","sdk","undo","redo","record","operationName","undoOperationCallback","beginIfNoneActive","end","AdvancedUndoManagerController","begin","round","val","precision","hundred","pow","UtilsController","createEnvironmentBaseURL","parameters","SANDBOX","environment","version","VariableController","getVariables","resp","makeVariablesBackwardsCompatible","getVariableById","makeVariableBackwardsCompatible","getVariableByName","addVariable","removeVariables","setVariableName","setLabel","label","setVariableLabel","setType","setVariableType","setListVariable","setListVariableItems","setVariableValue","duplicateVariable","groupVariables","ungroupVariables","ungroupVariable","moveVariable","moveVariables","isVisible","setVariableIsVisible","setIsHidden","isHidden","setIsRequired","isRequired","setVariableIsRequired","setIsReadonly","isReadonly","setVariableIsReadonly","getImageVariableConnectorId","setImageVariableConnector","removeSource","variables","makeListVariableBackwardsCompatible","listVariable","updated","newItems","InfoController","currentEngineVersion","currentSDKVersion","BarcodeType","BarcodeErrorCorrectionLevel","BarcodeCharacterSet","BarcodeValidationResult","ClipboardController","copyFrames","frameData","navigator","clipboard","writeText","cutFrames","pasteFrames","clipboardData","readText","getContentType","getClipboardContentType","BarcodeController","setBarcodeProperties","setEnableBackground","enableBackground","setBackgroundColor","backgroundColor","setEnableBars","enableBars","setBarColor","barColor","setBarcodeSource","setEnableText","enableText","setBarHeight","barHeight","setMagnification","magnification","setQuietZoneValue","quietZone","setAreQuietZoneValuesCombined","areQuietZoneValuesCombined","setErrorCorrectionLevel","errorCorrectionLevel","setCharacterSet","characterSet","getBarcodeConfigationOptions","allowedCharacterSets","allowedErrorCorrectionLevels","allowToggleText","allowBarHeight","allowEnableMagnification","quietZoneAlwaysCombined","qr","iso8859_1","utf8","low","medium","quartile","high","dataMatrix","ean13","ean8","upca","upce","code128","gs1128","code128a","code128b","code128c","allowQuietZone","connection","FIXED_EDITOR_LINK","SDK","loadEditor","subscriber","studioStyling","action","layout","frame","barcode","configuration","utils","page","undoManager","textSelection","colorStyle","paragraphStyle","mediaConnector","fontConnector","font","experiment","canvas","shape","GraFxStudioSdkVersion","GraFxStudioDocumentType","documentType","template","studioOptions","newConnection","child","colorConversion","SlideDirections","ShakeDirections","EaseTypes","TweenTypes","BasicAnimationsEmphasisStyles","ViewMode","FontWeights","Alignment","TextPosition","Case","Scripting","HorizontalAlign","SelectedTextStyleSections","SelectedTextStyles","ColorType","ColorUsageType","FontPreviewFormat","ActionEditorEvent","ShapeType","CornerRadiusType"],"sourceRoot":""}
|