@chili-publish/studio-sdk 1.46.2 → 1.47.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/_bundles/main.js +2 -2
  2. package/_bundles/main.js.map +1 -1
  3. package/lib/src/controllers/ComponentGridController.cjs.js.map +1 -1
  4. package/lib/src/controllers/ComponentGridController.es.js.map +1 -1
  5. package/lib/src/controllers/FrameController.cjs.js +8 -0
  6. package/lib/src/controllers/FrameController.cjs.js.map +1 -1
  7. package/lib/src/controllers/FrameController.d.ts +14 -0
  8. package/lib/src/controllers/FrameController.es.js +8 -0
  9. package/lib/src/controllers/FrameController.es.js.map +1 -1
  10. package/lib/src/controllers/UtilsController.cjs.js +4 -1
  11. package/lib/src/controllers/UtilsController.cjs.js.map +1 -1
  12. package/lib/src/controllers/UtilsController.es.js +4 -1
  13. package/lib/src/controllers/UtilsController.es.js.map +1 -1
  14. package/lib/src/next/controllers/PageController.cjs.js +1 -0
  15. package/lib/src/next/controllers/PageController.cjs.js.map +1 -1
  16. package/lib/src/next/controllers/PageController.es.js +1 -0
  17. package/lib/src/next/controllers/PageController.es.js.map +1 -1
  18. package/lib/src/sdk/editor-engine.json.cjs.js +1 -1
  19. package/lib/src/sdk/editor-engine.json.es.js +1 -1
  20. package/lib/src/sdk/package.json.cjs.js +1 -1
  21. package/lib/src/sdk/package.json.es.js +1 -1
  22. package/lib/src/sdk.cjs.js +26 -13
  23. package/lib/src/sdk.cjs.js.map +1 -1
  24. package/lib/src/sdk.d.ts +14 -0
  25. package/lib/src/sdk.es.js +26 -13
  26. package/lib/src/sdk.es.js.map +1 -1
  27. package/lib/src/types/BarcodeTypes.cjs.js.map +1 -1
  28. package/lib/src/types/BarcodeTypes.d.ts +3 -1
  29. package/lib/src/types/BarcodeTypes.es.js.map +1 -1
  30. package/lib/src/types/BrandKitTypes.d.ts +4 -2
  31. package/lib/src/types/CharacterStyleTypes.d.ts +6 -2
  32. package/lib/src/types/ColorStyleTypes.cjs.js.map +1 -1
  33. package/lib/src/types/ColorStyleTypes.es.js.map +1 -1
  34. package/lib/src/types/ComponentGridTypes.cjs.js.map +1 -1
  35. package/lib/src/types/ComponentGridTypes.es.js.map +1 -1
  36. package/lib/src/types/ConnectorTypes.cjs.js.map +1 -1
  37. package/lib/src/types/ConnectorTypes.es.js.map +1 -1
  38. package/lib/src/types/FrameTypes.cjs.js.map +1 -1
  39. package/lib/src/types/FrameTypes.d.ts +5 -0
  40. package/lib/src/types/FrameTypes.es.js.map +1 -1
  41. package/lib/src/types/ParagraphStyleTypes.cjs.js.map +1 -1
  42. package/lib/src/types/ParagraphStyleTypes.d.ts +6 -2
  43. package/lib/src/types/ParagraphStyleTypes.es.js.map +1 -1
  44. package/lib/src/types/RichTextRuleTypes.cjs.js.map +1 -1
  45. package/lib/src/types/RichTextRuleTypes.es.js.map +1 -1
  46. package/lib/src/types/ShapeTypes.cjs.js.map +1 -1
  47. package/lib/src/types/ShapeTypes.d.ts +2 -0
  48. package/lib/src/types/ShapeTypes.es.js.map +1 -1
  49. package/lib/src/types/TextStyleTypes.cjs.js.map +1 -1
  50. package/lib/src/types/TextStyleTypes.d.ts +2 -1
  51. package/lib/src/types/TextStyleTypes.es.js.map +1 -1
  52. package/lib/src/types/VariableTypes.cjs.js.map +1 -1
  53. package/lib/src/types/VariableTypes.es.js.map +1 -1
  54. package/lib/src/utils/EngineCallbackHandler.cjs.js.map +1 -1
  55. package/lib/src/utils/EngineCallbackHandler.es.js.map +1 -1
  56. package/lib/src/utils/EngineEvent.cjs.js.map +1 -1
  57. package/lib/src/utils/EngineEvent.es.js.map +1 -1
  58. package/package.json +17 -20
@@ -1 +1 @@
1
- {"version":3,"file":"FrameController.es.js","sources":["../../../src/controllers/FrameController.ts"],"sourcesContent":["import { BarcodeType } from '../types/BarcodeTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport type { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport {\n AnchorTarget,\n AutoGrowDeltaUpdate,\n AutoGrowDirection,\n BlendMode,\n ComponentSource,\n CropType,\n FitMode,\n FitModePosition,\n FontSizeRangeManagedConstraint,\n FrameAnchorProperties,\n FrameAnchorType,\n FrameConfiguration,\n FrameConstraints,\n FrameConstraintsDeltaUpdate,\n FrameLayoutType,\n FrameType,\n FrameTypeEnum,\n IdSetManagedConstraint,\n ImageFrameConnectorSource,\n ImageFrameSource,\n ImageFrameUrlSource,\n ImageSourceTypeEnum,\n ShadowSettingsDeltaUpdate,\n SmartCropSettings,\n UpdateZIndexMethod,\n VerticalAlign,\n} from '../types/FrameTypes';\nimport { GradientDeltaUpdate, GradientUpdate } from '../types/GradientStyleTypes';\nimport { ShapeType, ShapeFrameSource } from '../types/ShapeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\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 constraints: FrameConstraintController;\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 /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.shapeController = new ShapeController(this.#editorAPI);\n this.constraints = new FrameConstraintController(this.#editorAPI);\n }\n\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's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n */\n resetTransformation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetSize = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(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 will deselect all frames\n * @returns\n */\n deselectAll = async () => {\n const res = await this.#editorAPI;\n return res.deselectFrames().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 set the frame opacity\n * @param id the id of a specific frame\n * @param opacity the opacity of the frame in range [0.0 - 1.0]\n * @returns\n */\n setOpacity = async (id: Id, opacity: number) => {\n const res = await this.#editorAPI;\n return res.setFrameOpacity(id, opacity).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 frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetX = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetY = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetRotation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetWidth = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetHeight = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the fitMode, position and crop properties 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 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 the newly created barcode frame's id\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 * @experimental This method will add a new component frame to the current layout positioned on the requested\n * coordinates with the given dimensions. The component is initialized with the provided source.\n * @param source The source of the component frame\n * @param x The X coordinate of the new component frame within the layout\n * @param y The Y coordinate of the new component frame within the layout\n * @param width The width of the new component frame within the layout\n * @param height The height of the new component frame within the layout\n * @returns the newly created component frame's id\n */\n createComponentFrame = async (source: ComponentSource, x: number, y: number, width: number, height: number) => {\n const res = await this.#editorAPI;\n return res\n .addComponentFrame(x, y, width, height, JSON.stringify(source))\n .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 /**\n * This method will set the fit mode position property of a specified image frame.\n * @param imageFrameId the id of the imageFrame that needs to get updated.\n * @param position the new position that you want to set to the imageFrame.\n * @returns\n */\n setImageFrameFitModePosition = async (imageFrameId: Id, position: FitModePosition) => {\n const res = await this.#editorAPI;\n return res\n .setImageFrameFitModePosition(imageFrameId, position)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the smart crop settings of a specified image frame. The frame does not have\n * to be in smart crop mode to set the smart crop settings. This method does not change the mode of the image frame\n *\n * @param imageFrameId the id of the imageFrame that needs to get updated.\n * @param settings the new smart crop settings to be set to the imageFrame.\n * @returns\n */\n setImageFrameSmartCropSettings = async (imageFrameId: Id, settings: SmartCropSettings) => {\n const res = await this.#editorAPI;\n return res\n .setImageFrameSmartCropSettings(imageFrameId, JSON.stringify(settings))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated the constrain proportions setter is not supported anymore.\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setFrameConstrainProportions = async (_id: Id, _constrainProportions: boolean) => {\n console.error('setFrameConstrainProportions is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'setFrameConstrainProportions is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\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 number of columns property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param numberOfColumns the number of columns to be set to the frame.\n * @returns\n */\n setNumberOfColumns = async (id: Id, numberOfColumns: number) => {\n const res = await this.#editorAPI;\n return res.setNumberOfColumns(id, numberOfColumns).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the column gap property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param columnGap the column gap value to be set to the frame.\n * @returns\n */\n setColumnGap = async (id: Id, columnGap: string) => {\n const res = await this.#editorAPI;\n return res.setColumnGap(id, columnGap).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 set the container shape of a specified frame\n * @param frameId the id of the frame that needs to get updated\n * @param value the shape frame source object\n * @returns\n */\n setFrameContainerShape = async (frameId: Id, value: ShapeFrameSource) => {\n const res = await this.#editorAPI;\n return res\n .setFrameContainerShape(frameId, JSON.stringify(value))\n .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 * @param type the type of cropping mode to enter. Defaults to frameCrop.\n * @returns\n */\n enterCropMode = async (id: Id, type: CropType = CropType.frameCrop) => {\n const res = await this.#editorAPI;\n return res.enterCropMode(id, type).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 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 /**\n * This method will make the specified image frame go into subject mode.\n * @param id the id of a specific image frame\n * @returns\n */\n enterSubjectMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterSubjectMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit subject mode while saving the applied subject area.\n * @returns\n */\n applySubjectMode = async () => {\n const res = await this.#editorAPI;\n return res.applySubjectMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit subject mode without saving the applied subject area.\n * @returns\n */\n exitSubjectMode = async () => {\n const res = await this.#editorAPI;\n return res.cancelSubjectMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will make the specified shape frame go into gradient mode.\n * @param id the id of a specific shape frame\n * @returns\n */\n enterGradientMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterGradientMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit gradient mode while saving the applied gradient.\n * @returns\n */\n applyGradientMode = async () => {\n const res = await this.#editorAPI;\n return res.applyGradientMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit gradient mode without saving the applied gradient.\n * @returns\n */\n cancelGradientMode = async () => {\n const res = await this.#editorAPI;\n return res.cancelGradientMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated This method no longer has any effect. Use 'setImageFrameFitMode' or 'resetImageFrameFitMode' instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetCropMode = async (_id: Id) => {\n console.error('resetCropMode is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetCropMode is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * This method will enable auto grow 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 setEnableAutoGrow = async (id: Id, value: boolean) => {\n const update: AutoGrowDeltaUpdate = { enabled: { value: value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the minWidth for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new minWidth value to be set\n * @returns\n */\n setAutoGrowMinWidth = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { minWidth: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the maxWidth for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new maxWidth value to be set\n * @returns\n */\n setAutoGrowMaxWidth = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { maxWidth: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the minHeight for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new minHeight value to be set\n * @returns\n */\n setAutoGrowMinHeight = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { minHeight: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the maxHeight for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new maxHeight value to be set\n * @returns\n */\n setAutoGrowMaxHeight = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { maxHeight: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the auto grow directions for auto-grow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new directions value to be set\n * @returns\n */\n setAutoGrowDirections = async (id: Id, value: Array<AutoGrowDirection>) => {\n const update: AutoGrowDeltaUpdate = { directions: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowSettingsEnabled = async (_id: Id) => {\n console.error('resetAutoGrowSettingsEnabled is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowSettingsEnabled is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMinWidth = async (_id: Id) => {\n console.error('resetAutoGrowMinWidth is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMinWidth is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMaxWidth = async (_id: Id) => {\n console.error('resetAutoGrowMaxWidth is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMaxWidth is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMinHeight = async (_id: Id) => {\n console.error('resetAutoGrowMinHeight is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMinHeight is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMaxHeight = async (_id: Id) => {\n console.error('resetAutoGrowMaxHeight is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMaxHeight is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowDirections = async (_id: Id) => {\n console.error('resetAutoGrowDirections is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowDirections is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrow = async (_id: Id) => {\n console.error('resetAutoGrow is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrow is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * This method will enable shadow 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 setShadowEnabled = async (id: Id, value: boolean) => {\n const update: ShadowSettingsDeltaUpdate = { enabled: { value: value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the distance for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new distance value to be set\n * @returns\n */\n setShadowDistance = async (id: Id, value: string) => {\n const update: ShadowSettingsDeltaUpdate = { distance: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the angle in degrees for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new angle value to be set\n * @returns\n */\n setShadowAngleDegrees = async (id: Id, value: number) => {\n const update: ShadowSettingsDeltaUpdate = { angleDegrees: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the blur radius for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new blur radius value to be set\n * @returns\n */\n setShadowBlurRadius = async (id: Id, value: number) => {\n const update: ShadowSettingsDeltaUpdate = { blurRadius: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the color for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new color value to be set\n * @returns\n */\n setShadowColor = async (id: Id, value: ColorUsage) => {\n const update: ShadowSettingsDeltaUpdate = { color: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n private setAnchor = async (\n id: Id,\n horizontal: boolean,\n anchorType: FrameAnchorType,\n anchorTarget: AnchorTarget,\n endAnchorTarget?: AnchorTarget | null,\n ) => {\n const properties: FrameAnchorProperties = {\n horizontal: horizontal,\n type: anchorType,\n target: anchorTarget,\n endTarget: endAnchorTarget,\n };\n\n const res = await this.#editorAPI;\n return res\n .setAnchorProperties(id, JSON.stringify(properties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental\n * This method will set the vertical anchor to target frame on a specified frame.\n * @param id the id of the frame that needs to get a frame anchor set\n * @param anchorType the type of positioning to be set to the frame\n * @param anchorTarget the target frame to which it is anchored\n * @param endAnchorTarget the target (end) frame to which it can be anchored\n * @returns\n */\n setVerticalAnchor = async (\n id: Id,\n anchorType: FrameAnchorType,\n anchorTarget: AnchorTarget,\n endAnchorTarget?: AnchorTarget | null,\n ) => {\n return this.setAnchor(id, false, anchorType, anchorTarget, endAnchorTarget);\n };\n\n /**\n * @experimental\n * This method will set the horizontal anchor to target frame on a specified frame.\n * @param id the id of the frame that needs to get a frame anchor set\n * @param anchorType the type of positioning to be set to the frame\n * @param anchorTarget the target frame to which it is anchored\n * @param endAnchorTarget the target (end) frame to which it can be anchored\n * @returns\n */\n setHorizontalAnchor = async (\n id: Id,\n anchorType: FrameAnchorType,\n anchorTarget: AnchorTarget,\n endAnchorTarget?: AnchorTarget | null,\n ) => {\n return this.setAnchor(id, true, anchorType, anchorTarget, endAnchorTarget);\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetAnchoring = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the isVisible property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @returns\n */\n resetVisibility = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.setFrameIsVisible(id, null).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will get the frame configuration for a specified frame.\n *\n * A frame configuration is a set of rules that define what is allowed to\n * do with a given behavior of a frame.\n *\n * e.g. list of allowed frame targets for a specific anchor\n *\n * @param id the id of the frame to get the frame configuration for\n * @returns the frame's configuration\n */\n getConfiguration = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFrameConfiguration(id).then((result) => getEditorResponseData<FrameConfiguration>(result));\n };\n\n /**\n * This method will set the crop override for the current asset for the specified frame\n * @param id the id of the frame that holds the override to reset\n * @returns\n */\n resetAssetCropOverride = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetAssetCropOverride(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset all crop overrides for the specified frame\n * @param id the id of the frame\n * @returns\n */\n resetAllAssetCropOverrides = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetAllAssetCropOverrides(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will enable/disable gradient 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 setGradientApplied = async (id: Id, value: boolean) => {\n const update: GradientDeltaUpdate = { isApplied: value };\n const res = await this.#editorAPI;\n return res\n .updateFrameGradientSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update (or set) the local gradient 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 setLocalGradient = async (id: Id, value: GradientUpdate) => {\n const update: GradientDeltaUpdate = { gradient: value };\n const res = await this.#editorAPI;\n return res\n .updateFrameGradientSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update (or set) the frame to use the provided brand kit gradient\n * @param id the id of the frame that needs to get updated\n * @param value the id of an existing brandkit gradient\n * @returns\n */\n setBrandKitGradient = async (id: Id, value: Id) => {\n const update: GradientDeltaUpdate = { id: value };\n const res = await this.#editorAPI;\n return res\n .updateFrameGradientSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the smart crop subject id for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param subjectId the subject id to set for smart crop\n * @returns\n */\n setSmartCropSubjectId = async (id: Id, subjectId?: Id) => {\n const res = await this.#editorAPI;\n return res.setSmartCropSubjectId(id, subjectId).then((result) => getEditorResponseData<null>(result));\n };\n}\n\nexport class FrameConstraintController {\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 retrieve all constraints for a specified frame\n * @param id the id of the frame that we want to know the constraints from\n * @returns the constraints configuration for the frame\n */\n get = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFrameConstraints(id).then((result) => getEditorResponseData<FrameConstraints>(result));\n };\n\n /**\n * This method will set the selectable constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether the frame is selectable or not\n * @returns\n */\n setSelectable = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { selectionAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the horizontal movement constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether horizontal movement is allowed or not\n * @returns\n */\n setHorizontalMovement = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { horizontalMovementAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the vertical movement constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether vertical movement is allowed or not\n * @returns\n */\n setVerticalMovement = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { verticalMovementAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the rotation constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether rotation is allowed or not\n * @returns\n */\n setRotation = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { rotationAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the resize constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether resize is allowed or not\n * @param proportionLocked whether the frame's proportions are locked or not\n * @returns\n */\n setResize = async (id: Id, allowed: boolean, proportionLocked?: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = {\n resizeAllowed: { value: allowed },\n ...(proportionLocked !== undefined && { proportionLocked: { value: proportionLocked } }),\n };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the crop constraint for a specified image frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether crop is allowed or not\n * @returns\n */\n setCrop = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { image: { cropAllowed: { value: allowed } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the text editing constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether text editing is allowed or not\n * @returns\n */\n setTextEditingAllowed = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { editingAllowed: { value: allowed } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed paragraph styles constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, only the provided ids may be used; when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedParagraphStyles = async (id: Id, constraint: IdSetManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { paragraphStyles: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed character styles constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, only the provided ids may be used; when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedCharacterStyles = async (id: Id, constraint: IdSetManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { characterStyles: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed colors constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, only the provided ids may be used; when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedColors = async (id: Id, constraint: IdSetManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { colors: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed font sizes constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, restricts font sizes to min and max (inclusive); when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedFontSizes = async (id: Id, constraint: FontSizeRangeManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { fontSizes: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":["_editorAPI"],"mappings":";;;;;;;;;;;AAwCO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAezB,YAAY,WAAsB;AAXlC;AAAA;AAAA;AAAA;AAqBA,SAAA,SAAS,YAAY;AACjB,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,YAAY,KAAK,CAAC,WAAW,sBAAmC,MAAM,CAAC;AAAA,IACtF;AAMA,SAAA,cAAc,YAAY;AACtB,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,oBAAoB,KAAK,CAAC,WAAW,sBAAmC,MAAM,CAAC;A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,UAAU,WAAW,CAAC,EACtD,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAQA,SAAA,mBAAmB,OAAO,IAAQ,eAAuC;AACrE,YAAM,cAA2C,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,WAAA,IAAa;AACzF,YAAM,MAAM,MAAM,mBAAKA;AACvB,aAAO,IACF,uBAAuB,IAAI,KAAK,UAAU,WAAW,CAAC,EACtD,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAQA,SAAA,sBAAsB,OAAO,IAAQ,eAA+C;AAChF,YAAM,cAA2C,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,WAAA,IAAa;AAC5F,YAAM,MAAM,MAAM,mBAAKA;AACvB,aAAO,IACF,uBAAuB,IAAI,KAAK,UAAU,WAAW,CAAC,EACtD,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAzKI,uBAAKA,aAAa;AAAA,EACtB;AAyKJ;AAhLIA,cAAA;"}
1
+ {"version":3,"file":"FrameController.es.js","sources":["../../../src/controllers/FrameController.ts"],"sourcesContent":["import { BarcodeType } from '../types/BarcodeTypes';\nimport { ColorUsage } from '../types/ColorStyleTypes';\nimport type { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\nimport {\n AnchorTarget,\n AutoGrowDeltaUpdate,\n AutoGrowDirection,\n BlendMode,\n ComponentSource,\n CropType,\n FitMode,\n FitModePosition,\n FontSizeRangeManagedConstraint,\n FrameAnchorProperties,\n FrameAnchorType,\n FrameConfiguration,\n FrameConstraints,\n FrameConstraintsDeltaUpdate,\n FrameLayoutType,\n FrameType,\n FrameTypeEnum,\n IdSetManagedConstraint,\n ImageFrameConnectorSource,\n ImageFrameSource,\n ImageFrameUrlSource,\n ImageSourceTypeEnum,\n ShadowSettingsDeltaUpdate,\n SmartCropSettings,\n UpdateZIndexMethod,\n VerticalAlign,\n} from '../types/FrameTypes';\nimport { GradientDeltaUpdate, GradientUpdate } from '../types/GradientStyleTypes';\nimport { ShapeType, ShapeFrameSource } from '../types/ShapeTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\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 constraints: FrameConstraintController;\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 /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.shapeController = new ShapeController(this.#editorAPI);\n this.constraints = new FrameConstraintController(this.#editorAPI);\n }\n\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's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n */\n resetTransformation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetSize = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(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 will deselect all frames\n * @returns\n */\n deselectAll = async () => {\n const res = await this.#editorAPI;\n return res.deselectFrames().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 set the frame opacity\n * @param id the id of a specific frame\n * @param opacity the opacity of the frame in range [0.0 - 1.0]\n * @returns\n */\n setOpacity = async (id: Id, opacity: number) => {\n const res = await this.#editorAPI;\n return res.setFrameOpacity(id, opacity).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 frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetX = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetY = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetRotation = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetWidth = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetHeight = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the fitMode, position and crop properties 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 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 the newly created barcode frame's id\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 * @experimental This method will add a new component frame to the current layout positioned on the requested\n * coordinates with the given dimensions. The component is initialized with the provided source.\n * @param source The source of the component frame\n * @param x The X coordinate of the new component frame within the layout\n * @param y The Y coordinate of the new component frame within the layout\n * @param width The width of the new component frame within the layout\n * @param height The height of the new component frame within the layout\n * @returns the newly created component frame's id\n */\n createComponentFrame = async (source: ComponentSource, x: number, y: number, width: number, height: number) => {\n const res = await this.#editorAPI;\n return res\n .addComponentFrame(x, y, width, height, JSON.stringify(source))\n .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 /**\n * This method will set the fit mode position property of a specified image frame.\n * @param imageFrameId the id of the imageFrame that needs to get updated.\n * @param position the new position that you want to set to the imageFrame.\n * @returns\n */\n setImageFrameFitModePosition = async (imageFrameId: Id, position: FitModePosition) => {\n const res = await this.#editorAPI;\n return res\n .setImageFrameFitModePosition(imageFrameId, position)\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method sets the smart crop settings of a specified image frame. The frame does not have\n * to be in smart crop mode to set the smart crop settings. This method does not change the mode of the image frame\n *\n * @param imageFrameId the id of the imageFrame that needs to get updated.\n * @param settings the new smart crop settings to be set to the imageFrame.\n * @returns\n */\n setImageFrameSmartCropSettings = async (imageFrameId: Id, settings: SmartCropSettings) => {\n const res = await this.#editorAPI;\n return res\n .setImageFrameSmartCropSettings(imageFrameId, JSON.stringify(settings))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated the constrain proportions setter is not supported anymore.\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n setFrameConstrainProportions = async (_id: Id, _constrainProportions: boolean) => {\n console.error('setFrameConstrainProportions is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'setFrameConstrainProportions is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\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 number of columns property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param numberOfColumns the number of columns to be set to the frame.\n * @returns\n */\n setNumberOfColumns = async (id: Id, numberOfColumns: number) => {\n const res = await this.#editorAPI;\n return res.setNumberOfColumns(id, numberOfColumns).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the column gap property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param columnGap the column gap value to be set to the frame.\n * @returns\n */\n setColumnGap = async (id: Id, columnGap: string) => {\n const res = await this.#editorAPI;\n return res.setColumnGap(id, columnGap).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 overprint property of a specified frame's fill.\n * @param frameId the id of the frame that needs to get updated\n * @param value whether the frame's fill should overprint\n * @returns\n */\n setFillOverprint = async (frameId: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setFrameFillOverprint(frameId, value).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the overprint property of a specified frame's stroke.\n * @param frameId the id of the frame that needs to get updated\n * @param value whether the frame's stroke should overprint\n * @returns\n */\n setStrokeOverprint = async (frameId: Id, value: boolean) => {\n const res = await this.#editorAPI;\n return res.setFrameStrokeOverprint(frameId, value).then((result) => getEditorResponseData<null>(result));\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 set the container shape of a specified frame\n * @param frameId the id of the frame that needs to get updated\n * @param value the shape frame source object\n * @returns\n */\n setFrameContainerShape = async (frameId: Id, value: ShapeFrameSource) => {\n const res = await this.#editorAPI;\n return res\n .setFrameContainerShape(frameId, JSON.stringify(value))\n .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 * @param type the type of cropping mode to enter. Defaults to frameCrop.\n * @returns\n */\n enterCropMode = async (id: Id, type: CropType = CropType.frameCrop) => {\n const res = await this.#editorAPI;\n return res.enterCropMode(id, type).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 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 /**\n * This method will make the specified image frame go into subject mode.\n * @param id the id of a specific image frame\n * @returns\n */\n enterSubjectMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterSubjectMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit subject mode while saving the applied subject area.\n * @returns\n */\n applySubjectMode = async () => {\n const res = await this.#editorAPI;\n return res.applySubjectMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit subject mode without saving the applied subject area.\n * @returns\n */\n exitSubjectMode = async () => {\n const res = await this.#editorAPI;\n return res.cancelSubjectMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will make the specified shape frame go into gradient mode.\n * @param id the id of a specific shape frame\n * @returns\n */\n enterGradientMode = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.enterGradientMode(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit gradient mode while saving the applied gradient.\n * @returns\n */\n applyGradientMode = async () => {\n const res = await this.#editorAPI;\n return res.applyGradientMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will exit gradient mode without saving the applied gradient.\n * @returns\n */\n cancelGradientMode = async () => {\n const res = await this.#editorAPI;\n return res.cancelGradientMode().then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated This method no longer has any effect. Use 'setImageFrameFitMode' or 'resetImageFrameFitMode' instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetCropMode = async (_id: Id) => {\n console.error('resetCropMode is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetCropMode is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * This method will enable auto grow 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 setEnableAutoGrow = async (id: Id, value: boolean) => {\n const update: AutoGrowDeltaUpdate = { enabled: { value: value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the minWidth for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new minWidth value to be set\n * @returns\n */\n setAutoGrowMinWidth = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { minWidth: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the maxWidth for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new maxWidth value to be set\n * @returns\n */\n setAutoGrowMaxWidth = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { maxWidth: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the minHeight for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new minHeight value to be set\n * @returns\n */\n setAutoGrowMinHeight = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { minHeight: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the maxHeight for auto-grow of a specified frame. Set to null to remove the value.\n * @param id the id of the frame that needs to get updated\n * @param value the new maxHeight value to be set\n * @returns\n */\n setAutoGrowMaxHeight = async (id: Id, value: string | null) => {\n const update: AutoGrowDeltaUpdate = { maxHeight: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the auto grow directions for auto-grow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new directions value to be set\n * @returns\n */\n setAutoGrowDirections = async (id: Id, value: Array<AutoGrowDirection>) => {\n const update: AutoGrowDeltaUpdate = { directions: { value } };\n const res = await this.#editorAPI;\n return res\n .updateAutoGrowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowSettingsEnabled = async (_id: Id) => {\n console.error('resetAutoGrowSettingsEnabled is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowSettingsEnabled is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMinWidth = async (_id: Id) => {\n console.error('resetAutoGrowMinWidth is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMinWidth is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMaxWidth = async (_id: Id) => {\n console.error('resetAutoGrowMaxWidth is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMaxWidth is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMinHeight = async (_id: Id) => {\n console.error('resetAutoGrowMinHeight is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMinHeight is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowMaxHeight = async (_id: Id) => {\n console.error('resetAutoGrowMaxHeight is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowMaxHeight is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrowDirections = async (_id: Id) => {\n console.error('resetAutoGrowDirections is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrowDirections is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * @deprecated This method no longer has any effect. Use `resetTransformation` instead\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n resetAutoGrow = async (_id: Id) => {\n console.error('resetAutoGrow is not supported anymore');\n\n const res: EditorResponse<null> = {\n success: false,\n status: 0,\n error: 'resetAutoGrow is not supported anymore',\n parsedData: null,\n };\n\n return getEditorResponseData<null>(res);\n };\n\n /**\n * This method will enable shadow 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 setShadowEnabled = async (id: Id, value: boolean) => {\n const update: ShadowSettingsDeltaUpdate = { enabled: { value: value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the distance for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new distance value to be set\n * @returns\n */\n setShadowDistance = async (id: Id, value: string) => {\n const update: ShadowSettingsDeltaUpdate = { distance: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the angle in degrees for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new angle value to be set\n * @returns\n */\n setShadowAngleDegrees = async (id: Id, value: number) => {\n const update: ShadowSettingsDeltaUpdate = { angleDegrees: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the blur radius for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new blur radius value to be set\n * @returns\n */\n setShadowBlurRadius = async (id: Id, value: number) => {\n const update: ShadowSettingsDeltaUpdate = { blurRadius: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the color for shadow of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @param value the new color value to be set\n * @returns\n */\n setShadowColor = async (id: Id, value: ColorUsage) => {\n const update: ShadowSettingsDeltaUpdate = { color: { value } };\n const res = await this.#editorAPI;\n return res\n .updateFrameShadowSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n private setAnchor = async (\n id: Id,\n horizontal: boolean,\n anchorType: FrameAnchorType,\n anchorTarget: AnchorTarget,\n endAnchorTarget?: AnchorTarget | null,\n ) => {\n const properties: FrameAnchorProperties = {\n horizontal: horizontal,\n type: anchorType,\n target: anchorTarget,\n endTarget: endAnchorTarget,\n };\n\n const res = await this.#editorAPI;\n return res\n .setAnchorProperties(id, JSON.stringify(properties))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * @experimental\n * This method will set the vertical anchor to target frame on a specified frame.\n * @param id the id of the frame that needs to get a frame anchor set\n * @param anchorType the type of positioning to be set to the frame\n * @param anchorTarget the target frame to which it is anchored\n * @param endAnchorTarget the target (end) frame to which it can be anchored\n * @returns\n */\n setVerticalAnchor = async (\n id: Id,\n anchorType: FrameAnchorType,\n anchorTarget: AnchorTarget,\n endAnchorTarget?: AnchorTarget | null,\n ) => {\n return this.setAnchor(id, false, anchorType, anchorTarget, endAnchorTarget);\n };\n\n /**\n * @experimental\n * This method will set the horizontal anchor to target frame on a specified frame.\n * @param id the id of the frame that needs to get a frame anchor set\n * @param anchorType the type of positioning to be set to the frame\n * @param anchorTarget the target frame to which it is anchored\n * @param endAnchorTarget the target (end) frame to which it can be anchored\n * @returns\n */\n setHorizontalAnchor = async (\n id: Id,\n anchorType: FrameAnchorType,\n anchorTarget: AnchorTarget,\n endAnchorTarget?: AnchorTarget | null,\n ) => {\n return this.setAnchor(id, true, anchorType, anchorTarget, endAnchorTarget);\n };\n\n /**\n * This method will reset the frame's transformation properties (x, y, width, height, rotation, anchors)\n * to the frame's to be inherited from the parent layout\n * @param id the id of a specific frame\n * @returns\n * @deprecated Use 'resetTransformation' instead\n */\n resetAnchoring = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetFrameTransformation(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset the isVisible property of a specified frame.\n * @param id the id of the frame that needs to get updated\n * @returns\n */\n resetVisibility = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.setFrameIsVisible(id, null).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will get the frame configuration for a specified frame.\n *\n * A frame configuration is a set of rules that define what is allowed to\n * do with a given behavior of a frame.\n *\n * e.g. list of allowed frame targets for a specific anchor\n *\n * @param id the id of the frame to get the frame configuration for\n * @returns the frame's configuration\n */\n getConfiguration = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFrameConfiguration(id).then((result) => getEditorResponseData<FrameConfiguration>(result));\n };\n\n /**\n * This method will set the crop override for the current asset for the specified frame\n * @param id the id of the frame that holds the override to reset\n * @returns\n */\n resetAssetCropOverride = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetAssetCropOverride(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will reset all crop overrides for the specified frame\n * @param id the id of the frame\n * @returns\n */\n resetAllAssetCropOverrides = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.resetAllAssetCropOverrides(id).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will enable/disable gradient 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 setGradientApplied = async (id: Id, value: boolean) => {\n const update: GradientDeltaUpdate = { isApplied: value };\n const res = await this.#editorAPI;\n return res\n .updateFrameGradientSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update (or set) the local gradient 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 setLocalGradient = async (id: Id, value: GradientUpdate) => {\n const update: GradientDeltaUpdate = { gradient: value };\n const res = await this.#editorAPI;\n return res\n .updateFrameGradientSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will update (or set) the frame to use the provided brand kit gradient\n * @param id the id of the frame that needs to get updated\n * @param value the id of an existing brandkit gradient\n * @returns\n */\n setBrandKitGradient = async (id: Id, value: Id) => {\n const update: GradientDeltaUpdate = { id: value };\n const res = await this.#editorAPI;\n return res\n .updateFrameGradientSettings(id, JSON.stringify(update))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the smart crop subject id for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param subjectId the subject id to set for smart crop\n * @returns\n */\n setSmartCropSubjectId = async (id: Id, subjectId?: Id) => {\n const res = await this.#editorAPI;\n return res.setSmartCropSubjectId(id, subjectId).then((result) => getEditorResponseData<null>(result));\n };\n}\n\nexport class FrameConstraintController {\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 retrieve all constraints for a specified frame\n * @param id the id of the frame that we want to know the constraints from\n * @returns the constraints configuration for the frame\n */\n get = async (id: Id) => {\n const res = await this.#editorAPI;\n return res.getFrameConstraints(id).then((result) => getEditorResponseData<FrameConstraints>(result));\n };\n\n /**\n * This method will set the selectable constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether the frame is selectable or not\n * @returns\n */\n setSelectable = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { selectionAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the horizontal movement constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether horizontal movement is allowed or not\n * @returns\n */\n setHorizontalMovement = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { horizontalMovementAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the vertical movement constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether vertical movement is allowed or not\n * @returns\n */\n setVerticalMovement = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { verticalMovementAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the rotation constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether rotation is allowed or not\n * @returns\n */\n setRotation = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { rotationAllowed: { value: allowed } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the resize constraint for a specified frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether resize is allowed or not\n * @param proportionLocked whether the frame's proportions are locked or not\n * @returns\n */\n setResize = async (id: Id, allowed: boolean, proportionLocked?: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = {\n resizeAllowed: { value: allowed },\n ...(proportionLocked !== undefined && { proportionLocked: { value: proportionLocked } }),\n };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the crop constraint for a specified image frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether crop is allowed or not\n * @returns\n */\n setCrop = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { image: { cropAllowed: { value: allowed } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the text editing constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param allowed whether text editing is allowed or not\n * @returns\n */\n setTextEditingAllowed = async (id: Id, allowed: boolean) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { editingAllowed: { value: allowed } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed paragraph styles constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, only the provided ids may be used; when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedParagraphStyles = async (id: Id, constraint: IdSetManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { paragraphStyles: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed character styles constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, only the provided ids may be used; when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedCharacterStyles = async (id: Id, constraint: IdSetManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { characterStyles: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed colors constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, only the provided ids may be used; when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedColors = async (id: Id, constraint: IdSetManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { colors: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the allowed font sizes constraint for a specified text frame\n * @param id the id of the frame that needs to get updated\n * @param constraint the managed constraint: when allowed is true, restricts font sizes to min and max (inclusive); when false, the constraint is turned off (stored value is kept for reactivation)\n * @returns\n */\n setAllowedFontSizes = async (id: Id, constraint: FontSizeRangeManagedConstraint) => {\n const deltaUpdate: FrameConstraintsDeltaUpdate = { text: { fontSizes: { value: constraint } } };\n const res = await this.#editorAPI;\n return res\n .updateFrameConstraints(id, JSON.stringify(deltaUpdate))\n .then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":["_editorAPI"],"mappings":";;;;;;;;;;;AAwCO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAezB,YAAY,WAAsB;AAXlC;AAAA;AAAA;AAAA;AAqBA,SAAA,SAAS,YAAY;AACjB,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,YAAY,KAAK,CAAC,WAAW,sBAAmC,MAAM,CAAC;AAAA,IACtF;AAMA,SAAA,cAAc,YAAY;AACtB,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,oBAAoB,KAAK,CAAC,WAAW,sBAAmC,MAAM,CAAC;AAAA,IAC9F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G,YAAM,MAAM,MAAM,mBAAKA;AACvB,aAAO,IACF,uBAAuB,IAAI,KAAK,UAAU,WAAW,CAAC,EACtD,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAQA,SAAA,4BAA4B,OAAO,IAAQ,eAAuC;AAC9E,YAAM,cAA2C,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,WAAA,IAAa;AAClG,YAAM,MAAM,MAAM,mBAAKA;AACvB,aAAO,IACF,uBAAuB,IAAI,KAAK,UAAU,WAAW,CAAC,EACtD,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAQA,SAAA,mBAAmB,OAAO,IAAQ,eAAuC;AACrE,YAAM,cAA2C,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,WAAA,IAAa;AACzF,YAAM,MAAM,MAAM,mBAAKA;AACvB,aAAO,IACF,uBAAuB,IAAI,KAAK,UAAU,WAAW,CAAC,EACtD,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAQA,SAAA,sBAAsB,OAAO,IAAQ,eAA+C;AAChF,YAAM,cAA2C,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,WAAA,IAAa;AAC5F,YAAM,MAAM,MAAM,mBAAKA;AACvB,aAAO,IACF,uBAAuB,IAAI,KAAK,UAAU,WAAW,CAAC,EACtD,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAzKI,uBAAKA,aAAa;AAAA,EACtB;AAyKJ;AAhLIA,cAAA;"}
@@ -36,12 +36,15 @@ class UtilsController {
36
36
  return `https://${environment}.${host}.online/grafx/api/v${version}/environment/${environment}`;
37
37
  };
38
38
  this.stageFiles = async (files, remoteConnectorId, validationConfiguration) => {
39
+ var _a;
39
40
  const envApiUrl = __privateGet(this, _localConfig).get(ConfigurationTypes.WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl);
40
41
  if (!envApiUrl) {
41
42
  throw new Error("GraFx Studio Environment API URL is not set");
42
43
  }
43
44
  const stageUrl = `${envApiUrl}connectors/${remoteConnectorId}/stage`;
44
- const accessToken = __privateGet(this, _localConfig).get(ConfigurationTypes.WellKnownConfigurationKeys.GraFxStudioAuthToken);
45
+ const res = await __privateGet(this, _editorAPI);
46
+ const accessTokenResult = await res.getConfigValue(ConfigurationTypes.WellKnownConfigurationKeys.GraFxStudioAuthToken);
47
+ const accessToken = (_a = EditorResponseData.getEditorResponseData(accessTokenResult)) == null ? void 0 : _a.parsedData;
45
48
  if (!accessToken) {
46
49
  throw new Error("GraFx Studio Auth Token is not set");
47
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UtilsController.cjs.js","sources":["../../../src/controllers/UtilsController.ts"],"sourcesContent":["import { SDKUnauthorizedError, type EditorAPI, type Id } from '../types/CommonTypes';\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\nimport {\n FilePointer,\n UploadAssetValidationError,\n UploadAssetValidationErrorType,\n UploadValidationConfiguration,\n} from '../types/ConnectorTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { EnvironmentType } from '../utils/Enums';\nimport { round } from '../utils/MathUtils';\nimport { MeasurementUnit } from '../types/LayoutTypes';\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 * @ignore\n */\n #editorAPI: EditorAPI;\n #localConfig: Map<string, string>;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\n this.#editorAPI = editorAPI;\n this.#localConfig = localConfig;\n }\n\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 /**\n * This method can help you stage a file to the CHILI GraFx Environment API for upload.\n * @param files The Files or Blobs to stage.\n * @param remoteConnectorId The connector ID from Environment API to stage the files for.\n * @param validationConfiguration The validation configuration to use for the files.\n * @returns Promise<FilePointer[]> referencing the staged data.\n */\n stageFiles = async (\n files: File[] | Blob[],\n remoteConnectorId: Id,\n validationConfiguration?: UploadValidationConfiguration,\n ): Promise<FilePointer[]> => {\n const envApiUrl = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl);\n if (!envApiUrl) {\n throw new Error('GraFx Studio Environment API URL is not set');\n }\n\n const stageUrl = `${envApiUrl}connectors/${remoteConnectorId}/stage`;\n\n const accessToken = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioAuthToken);\n if (!accessToken) {\n throw new Error('GraFx Studio Auth Token is not set');\n }\n\n const formData = new FormData();\n\n // Add each file/blob to form data\n files.forEach((file, idx) => {\n const filename = file instanceof File ? file.name : `blob-${idx}`;\n formData.append('files', file, filename);\n });\n\n if (validationConfiguration) {\n formData.append(\n 'validationJson',\n JSON.stringify({\n allowedMimeTypes: validationConfiguration.mimeTypes,\n minDimensions: {\n width: validationConfiguration.minWidthPixels,\n height: validationConfiguration.minHeightPixels,\n },\n }),\n );\n }\n\n const response = await fetch(stageUrl, {\n method: 'POST',\n body: formData,\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n\n if (response.status === 422) {\n const data = await response.json();\n throw new UploadAssetValidationError(data.message, UploadAssetValidationErrorType.minDimension);\n }\n\n if (response.status === 401) {\n const data = await response.json();\n throw new SDKUnauthorizedError(data.message);\n }\n\n if (!response.ok) {\n throw new Error('Failed to stage files');\n }\n\n const data = await response.json();\n return data as FilePointer[];\n };\n\n /**\n * Evaluates a unit expression and returns its value as a number in the\n * specified conversionUnit, or in the current layout measurement unit if\n * conversionUnit is not provided.\n *\n * Returns null if unitExpression is null, empty, or cannot be evaluated.\n *\n * Example:\n * ```\n * const value = await SDK.utils.unitEvaluate('10cm', MeasurementUnit.px);\n * // value is the numeric value in px\n * ```\n *\n * @param unitExpression The unit expression to evaluate (e.g., \"10px\", \"5mm + 2cm\", null)\n * @param conversionUnit Optional target unit for conversion. If not provided, uses the current layout measurement unit.\n * @returns The evaluated result as a number, or null if the expression cannot be evaluated\n */\n unitEvaluate = async (unitExpression: string | null, conversionUnit?: MeasurementUnit) => {\n const res = await this.#editorAPI;\n return res\n .unitEvaluate(unitExpression, conversionUnit)\n .then((result) => getEditorResponseData<number | null>(result));\n };\n}\n"],"names":["getEditorResponseData","round","EnvironmentType","WellKnownConfigurationKeys","data","UploadAssetValidationError","UploadAssetValidationErrorType","SDKUnauthorizedError"],"mappings":";;;;;;;;;;;;;;;;AAiBO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAUzB,YAAY,WAAsB,aAAkC;AANpE;AAAA;AAAA;AAAA;AACA;AAgBA,SAAA,QAAQ,CAAC,KAAa,cAClBA,mBAAAA,sBAA8B;AAAA,MAC1B,MAAM,OAAOC,UAAAA,MAAM,KAAK,SAAS,CAAC;AAAA,MAClC,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,YAAY;AAAA,IAAA,CACf;AAEL,SAAA,2BAA2B,CAAC,eAAmF;AAC3G,YAAM,EAAE,OAAOC,MAAAA,gBAAgB,SAAS,cAAc,eAAe,UAAU,QAAQ;AACvF,YAAM,OAAO,QAAQA,MAAAA,gBAAgB,UAAU,0BAA0B;AACzE,aAAO,WAAW,WAAW,IAAI,IAAI,sBAAsB,OAAO,gBAAgB,WAAW;AAAA,IACjG;AASA,SAAA,aAAa,OACT,OACA,mBACA,4BACyB;AACzB,YAAM,YAAY,mBAAK,cAAa,IAAI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AA,IACX;AAmBA,SAAA,eAAe,OAAO,gBAA+B,mBAAqC;AACtF,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IACF,aAAa,gBAAgB,cAAc,EAC3C,KAAK,CAAC,WAAWJ,yCAAqC,MAAM,CAAC;AAAA,IACtE;AArHI,uBAAK,YAAa;AAClB,uBAAK,cAAe;AAAA,EACxB;AAoHJ;AA7HI;AACA;;"}
1
+ {"version":3,"file":"UtilsController.cjs.js","sources":["../../../src/controllers/UtilsController.ts"],"sourcesContent":["import { SDKUnauthorizedError, type EditorAPI, type Id } from '../types/CommonTypes';\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\nimport {\n FilePointer,\n UploadAssetValidationError,\n UploadAssetValidationErrorType,\n UploadValidationConfiguration,\n} from '../types/ConnectorTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { EnvironmentType } from '../utils/Enums';\nimport { round } from '../utils/MathUtils';\nimport { MeasurementUnit } from '../types/LayoutTypes';\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 * @ignore\n */\n #editorAPI: EditorAPI;\n #localConfig: Map<string, string>;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\n this.#editorAPI = editorAPI;\n this.#localConfig = localConfig;\n }\n\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 /**\n * This method can help you stage a file to the CHILI GraFx Environment API for upload.\n * @param files The Files or Blobs to stage.\n * @param remoteConnectorId The connector ID from Environment API to stage the files for.\n * @param validationConfiguration The validation configuration to use for the files.\n * @returns Promise<FilePointer[]> referencing the staged data.\n */\n stageFiles = async (\n files: File[] | Blob[],\n remoteConnectorId: Id,\n validationConfiguration?: UploadValidationConfiguration,\n ): Promise<FilePointer[]> => {\n const envApiUrl = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl);\n if (!envApiUrl) {\n throw new Error('GraFx Studio Environment API URL is not set');\n }\n\n const stageUrl = `${envApiUrl}connectors/${remoteConnectorId}/stage`;\n\n // fetch the freshest access token\n const res = await this.#editorAPI;\n const accessTokenResult = await res.getConfigValue(WellKnownConfigurationKeys.GraFxStudioAuthToken);\n const accessToken = getEditorResponseData<string>(accessTokenResult)?.parsedData;\n if (!accessToken) {\n throw new Error('GraFx Studio Auth Token is not set');\n }\n\n const formData = new FormData();\n\n // Add each file/blob to form data\n files.forEach((file, idx) => {\n const filename = file instanceof File ? file.name : `blob-${idx}`;\n formData.append('files', file, filename);\n });\n\n if (validationConfiguration) {\n formData.append(\n 'validationJson',\n JSON.stringify({\n allowedMimeTypes: validationConfiguration.mimeTypes,\n minDimensions: {\n width: validationConfiguration.minWidthPixels,\n height: validationConfiguration.minHeightPixels,\n },\n }),\n );\n }\n\n const response = await fetch(stageUrl, {\n method: 'POST',\n body: formData,\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n\n if (response.status === 422) {\n const data = await response.json();\n throw new UploadAssetValidationError(data.message, UploadAssetValidationErrorType.minDimension);\n }\n\n if (response.status === 401) {\n const data = await response.json();\n throw new SDKUnauthorizedError(data.message);\n }\n\n if (!response.ok) {\n throw new Error('Failed to stage files');\n }\n\n const data = await response.json();\n return data as FilePointer[];\n };\n\n /**\n * Evaluates a unit expression and returns its value as a number in the\n * specified conversionUnit, or in the current layout measurement unit if\n * conversionUnit is not provided.\n *\n * Returns null if unitExpression is null, empty, or cannot be evaluated.\n *\n * Example:\n * ```\n * const value = await SDK.utils.unitEvaluate('10cm', MeasurementUnit.px);\n * // value is the numeric value in px\n * ```\n *\n * @param unitExpression The unit expression to evaluate (e.g., \"10px\", \"5mm + 2cm\", null)\n * @param conversionUnit Optional target unit for conversion. If not provided, uses the current layout measurement unit.\n * @returns The evaluated result as a number, or null if the expression cannot be evaluated\n */\n unitEvaluate = async (unitExpression: string | null, conversionUnit?: MeasurementUnit) => {\n const res = await this.#editorAPI;\n return res\n .unitEvaluate(unitExpression, conversionUnit)\n .then((result) => getEditorResponseData<number | null>(result));\n };\n}\n"],"names":["getEditorResponseData","round","EnvironmentType","WellKnownConfigurationKeys","data","UploadAssetValidationError","UploadAssetValidationErrorType","SDKUnauthorizedError"],"mappings":";;;;;;;;;;;;;;;;AAiBO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAUzB,YAAY,WAAsB,aAAkC;AANpE;AAAA;AAAA;AAAA;AACA;AAgBA,SAAA,QAAQ,CAAC,KAAa,cAClBA,mBAAAA,sBAA8B;AAAA,MAC1B,MAAM,OAAOC,UAAAA,MAAM,KAAK,SAAS,CAAC;AAAA,MAClC,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,YAAY;AAAA,IAAA,CACf;AAEL,SAAA,2BAA2B,CAAC,eAAmF;AAC3G,YAAM,EAAE,OAAOC,MAAAA,gBAAgB,SAAS,cAAc,eAAe,UAAU,QAAQ;AACvF,YAAM,OAAO,QAAQA,MAAAA,gBAAgB,UAAU,0BAA0B;AACzE,aAAO,WAAW,WAAW,IAAI,IAAI,sBAAsB,OAAO,gBAAgB,WAAW;AAAA,IACjG;AASA,SAAA,aAAa,OACT,OACA,mBACA,4BACyB;;AACzB,YAAM,YAAY,mBAAK,cAAa,IAAIC,mBAAAA,2BAA2B,4BAA4B;AAC/F,UAAI,CAAC,WAAW;AACZ,cAAM,IA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AAS,KAAA;AAC5B,aAAO;AAAA,IACX;AAmBA,SAAA,eAAe,OAAO,gBAA+B,mBAAqC;AACtF,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IACF,aAAa,gBAAgB,cAAc,EAC3C,KAAK,CAAC,WAAWJ,yCAAqC,MAAM,CAAC;AAAA,IACtE;AAxHI,uBAAK,YAAa;AAClB,uBAAK,cAAe;AAAA,EACxB;AAuHJ;AAhII;AACA;;"}
@@ -34,12 +34,15 @@ class UtilsController {
34
34
  return `https://${environment}.${host}.online/grafx/api/v${version}/environment/${environment}`;
35
35
  };
36
36
  this.stageFiles = async (files, remoteConnectorId, validationConfiguration) => {
37
+ var _a;
37
38
  const envApiUrl = __privateGet(this, _localConfig).get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl);
38
39
  if (!envApiUrl) {
39
40
  throw new Error("GraFx Studio Environment API URL is not set");
40
41
  }
41
42
  const stageUrl = `${envApiUrl}connectors/${remoteConnectorId}/stage`;
42
- const accessToken = __privateGet(this, _localConfig).get(WellKnownConfigurationKeys.GraFxStudioAuthToken);
43
+ const res = await __privateGet(this, _editorAPI);
44
+ const accessTokenResult = await res.getConfigValue(WellKnownConfigurationKeys.GraFxStudioAuthToken);
45
+ const accessToken = (_a = getEditorResponseData(accessTokenResult)) == null ? void 0 : _a.parsedData;
43
46
  if (!accessToken) {
44
47
  throw new Error("GraFx Studio Auth Token is not set");
45
48
  }
@@ -1 +1 @@
1
- {"version":3,"file":"UtilsController.es.js","sources":["../../../src/controllers/UtilsController.ts"],"sourcesContent":["import { SDKUnauthorizedError, type EditorAPI, type Id } from '../types/CommonTypes';\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\nimport {\n FilePointer,\n UploadAssetValidationError,\n UploadAssetValidationErrorType,\n UploadValidationConfiguration,\n} from '../types/ConnectorTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { EnvironmentType } from '../utils/Enums';\nimport { round } from '../utils/MathUtils';\nimport { MeasurementUnit } from '../types/LayoutTypes';\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 * @ignore\n */\n #editorAPI: EditorAPI;\n #localConfig: Map<string, string>;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\n this.#editorAPI = editorAPI;\n this.#localConfig = localConfig;\n }\n\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 /**\n * This method can help you stage a file to the CHILI GraFx Environment API for upload.\n * @param files The Files or Blobs to stage.\n * @param remoteConnectorId The connector ID from Environment API to stage the files for.\n * @param validationConfiguration The validation configuration to use for the files.\n * @returns Promise<FilePointer[]> referencing the staged data.\n */\n stageFiles = async (\n files: File[] | Blob[],\n remoteConnectorId: Id,\n validationConfiguration?: UploadValidationConfiguration,\n ): Promise<FilePointer[]> => {\n const envApiUrl = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl);\n if (!envApiUrl) {\n throw new Error('GraFx Studio Environment API URL is not set');\n }\n\n const stageUrl = `${envApiUrl}connectors/${remoteConnectorId}/stage`;\n\n const accessToken = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioAuthToken);\n if (!accessToken) {\n throw new Error('GraFx Studio Auth Token is not set');\n }\n\n const formData = new FormData();\n\n // Add each file/blob to form data\n files.forEach((file, idx) => {\n const filename = file instanceof File ? file.name : `blob-${idx}`;\n formData.append('files', file, filename);\n });\n\n if (validationConfiguration) {\n formData.append(\n 'validationJson',\n JSON.stringify({\n allowedMimeTypes: validationConfiguration.mimeTypes,\n minDimensions: {\n width: validationConfiguration.minWidthPixels,\n height: validationConfiguration.minHeightPixels,\n },\n }),\n );\n }\n\n const response = await fetch(stageUrl, {\n method: 'POST',\n body: formData,\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n\n if (response.status === 422) {\n const data = await response.json();\n throw new UploadAssetValidationError(data.message, UploadAssetValidationErrorType.minDimension);\n }\n\n if (response.status === 401) {\n const data = await response.json();\n throw new SDKUnauthorizedError(data.message);\n }\n\n if (!response.ok) {\n throw new Error('Failed to stage files');\n }\n\n const data = await response.json();\n return data as FilePointer[];\n };\n\n /**\n * Evaluates a unit expression and returns its value as a number in the\n * specified conversionUnit, or in the current layout measurement unit if\n * conversionUnit is not provided.\n *\n * Returns null if unitExpression is null, empty, or cannot be evaluated.\n *\n * Example:\n * ```\n * const value = await SDK.utils.unitEvaluate('10cm', MeasurementUnit.px);\n * // value is the numeric value in px\n * ```\n *\n * @param unitExpression The unit expression to evaluate (e.g., \"10px\", \"5mm + 2cm\", null)\n * @param conversionUnit Optional target unit for conversion. If not provided, uses the current layout measurement unit.\n * @returns The evaluated result as a number, or null if the expression cannot be evaluated\n */\n unitEvaluate = async (unitExpression: string | null, conversionUnit?: MeasurementUnit) => {\n const res = await this.#editorAPI;\n return res\n .unitEvaluate(unitExpression, conversionUnit)\n .then((result) => getEditorResponseData<number | null>(result));\n };\n}\n"],"names":["data"],"mappings":";;;;;;;;;;;;;;AAiBO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAUzB,YAAY,WAAsB,aAAkC;AANpE;AAAA;AAAA;AAAA;AACA;AAgBA,SAAA,QAAQ,CAAC,KAAa,cAClB,sBAA8B;AAAA,MAC1B,MAAM,OAAO,MAAM,KAAK,SAAS,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AAM,SAAS,KAAA;AAC5B,cAAM,IAAI,2BAA2BA,MAAK,SAAS,+BAA+B,YAAY;AAAA,MAClG;AAEA,UAAI,SAAS,WAAW,KAAK;AACzB,cAAMA,QAAO,MAAM,SAAS,KAAA;AAC5B,cAAM,IAAI,qBAAqBA,MAAK,OAAO;AAAA,MAC/C;AAEA,UAAI,CAAC,SAAS,IAAI;AACd,cAAM,IAAI,MAAM,uBAAuB;AAAA,MAC3C;AAEA,YAAM,OAAO,MAAM,SAAS,KAAA;AAC5B,aAAO;AAAA,IACX;AAmBA,SAAA,eAAe,OAAO,gBAA+B,mBAAqC;AACtF,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IACF,aAAa,gBAAgB,cAAc,EAC3C,KAAK,CAAC,WAAW,sBAAqC,MAAM,CAAC;AAAA,IACtE;AArHI,uBAAK,YAAa;AAClB,uBAAK,cAAe;AAAA,EACxB;AAoHJ;AA7HI;AACA;"}
1
+ {"version":3,"file":"UtilsController.es.js","sources":["../../../src/controllers/UtilsController.ts"],"sourcesContent":["import { SDKUnauthorizedError, type EditorAPI, type Id } from '../types/CommonTypes';\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\nimport {\n FilePointer,\n UploadAssetValidationError,\n UploadAssetValidationErrorType,\n UploadValidationConfiguration,\n} from '../types/ConnectorTypes';\nimport { getEditorResponseData } from '../utils/EditorResponseData';\nimport { EnvironmentType } from '../utils/Enums';\nimport { round } from '../utils/MathUtils';\nimport { MeasurementUnit } from '../types/LayoutTypes';\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 * @ignore\n */\n #editorAPI: EditorAPI;\n #localConfig: Map<string, string>;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\n this.#editorAPI = editorAPI;\n this.#localConfig = localConfig;\n }\n\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 /**\n * This method can help you stage a file to the CHILI GraFx Environment API for upload.\n * @param files The Files or Blobs to stage.\n * @param remoteConnectorId The connector ID from Environment API to stage the files for.\n * @param validationConfiguration The validation configuration to use for the files.\n * @returns Promise<FilePointer[]> referencing the staged data.\n */\n stageFiles = async (\n files: File[] | Blob[],\n remoteConnectorId: Id,\n validationConfiguration?: UploadValidationConfiguration,\n ): Promise<FilePointer[]> => {\n const envApiUrl = this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl);\n if (!envApiUrl) {\n throw new Error('GraFx Studio Environment API URL is not set');\n }\n\n const stageUrl = `${envApiUrl}connectors/${remoteConnectorId}/stage`;\n\n // fetch the freshest access token\n const res = await this.#editorAPI;\n const accessTokenResult = await res.getConfigValue(WellKnownConfigurationKeys.GraFxStudioAuthToken);\n const accessToken = getEditorResponseData<string>(accessTokenResult)?.parsedData;\n if (!accessToken) {\n throw new Error('GraFx Studio Auth Token is not set');\n }\n\n const formData = new FormData();\n\n // Add each file/blob to form data\n files.forEach((file, idx) => {\n const filename = file instanceof File ? file.name : `blob-${idx}`;\n formData.append('files', file, filename);\n });\n\n if (validationConfiguration) {\n formData.append(\n 'validationJson',\n JSON.stringify({\n allowedMimeTypes: validationConfiguration.mimeTypes,\n minDimensions: {\n width: validationConfiguration.minWidthPixels,\n height: validationConfiguration.minHeightPixels,\n },\n }),\n );\n }\n\n const response = await fetch(stageUrl, {\n method: 'POST',\n body: formData,\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n });\n\n if (response.status === 422) {\n const data = await response.json();\n throw new UploadAssetValidationError(data.message, UploadAssetValidationErrorType.minDimension);\n }\n\n if (response.status === 401) {\n const data = await response.json();\n throw new SDKUnauthorizedError(data.message);\n }\n\n if (!response.ok) {\n throw new Error('Failed to stage files');\n }\n\n const data = await response.json();\n return data as FilePointer[];\n };\n\n /**\n * Evaluates a unit expression and returns its value as a number in the\n * specified conversionUnit, or in the current layout measurement unit if\n * conversionUnit is not provided.\n *\n * Returns null if unitExpression is null, empty, or cannot be evaluated.\n *\n * Example:\n * ```\n * const value = await SDK.utils.unitEvaluate('10cm', MeasurementUnit.px);\n * // value is the numeric value in px\n * ```\n *\n * @param unitExpression The unit expression to evaluate (e.g., \"10px\", \"5mm + 2cm\", null)\n * @param conversionUnit Optional target unit for conversion. If not provided, uses the current layout measurement unit.\n * @returns The evaluated result as a number, or null if the expression cannot be evaluated\n */\n unitEvaluate = async (unitExpression: string | null, conversionUnit?: MeasurementUnit) => {\n const res = await this.#editorAPI;\n return res\n .unitEvaluate(unitExpression, conversionUnit)\n .then((result) => getEditorResponseData<number | null>(result));\n };\n}\n"],"names":["data"],"mappings":";;;;;;;;;;;;;;AAiBO,MAAM,gBAAgB;AAAA;AAAA;AAAA;AAAA,EAUzB,YAAY,WAAsB,aAAkC;AANpE;AAAA;AAAA;AAAA;AACA;AAgBA,SAAA,QAAQ,CAAC,KAAa,cAClB,sBAA8B;AAAA,MAC1B,MAAM,OAAO,MAAM,KAAK,SAAS,CAAC;AAAA,MAClC,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,YAAY;AAAA,IAAA,CACf;AAEL,SAAA,2BAA2B,CAAC,eAAmF;AAC3G,YAAM,EAAE,OAAO,gBAAgB,SAAS,cAAc,eAAe,UAAU,QAAQ;AACvF,YAAM,OAAO,QAAQ,gBAAgB,UAAU,0BAA0B;AACzE,aAAO,WAA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C5B,cAAM,IAAI,qBAAqBA,MAAK,OAAO;AAAA,MAC/C;AAEA,UAAI,CAAC,SAAS,IAAI;AACd,cAAM,IAAI,MAAM,uBAAuB;AAAA,MAC3C;AAEA,YAAM,OAAO,MAAM,SAAS,KAAA;AAC5B,aAAO;AAAA,IACX;AAmBA,SAAA,eAAe,OAAO,gBAA+B,mBAAqC;AACtF,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IACF,aAAa,gBAAgB,cAAc,EAC3C,KAAK,CAAC,WAAW,sBAAqC,MAAM,CAAC;AAAA,IACtE;AAxHI,uBAAK,YAAa;AAClB,uBAAK,cAAe;AAAA,EACxB;AAuHJ;AAhII;AACA;"}
@@ -21,6 +21,7 @@ class PageController {
21
21
  /**
22
22
  * @ignore
23
23
  */
24
+ // eslint-disable-next-line no-unused-private-class-members
24
25
  __privateAdd(this, _blobAPI);
25
26
  this.setWidth = async (width) => {
26
27
  const res = await __privateGet(this, _editorAPI);
@@ -1 +1 @@
1
- {"version":3,"file":"PageController.cjs.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":["getEditorResponseData"],"mappings":";;;;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAcxB,YAAY,WAAsB;AAVlC;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAgBA,SAAA,WAAW,OAAO,UAAkB;AAChC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,aAAa,KAAK,EAAE,KAAK,CAAC,WAAWA,yCAA4B,MAAM,CAAC;AAAA,IACvF;AAQA,SAAA,YAAY,OAAO,WAAmB;AAClC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,cAAc,MAAM,EAAE,KAAK,CAAC,WAAWA,yCAA4B,MAAM,CAAC;AAAA,IACzF;AAxBI,uBAAK,YAAa;AAClB,uBAAK,UAAW;AAAA,EACpB;AAuBJ;AApCI;AAKA;;"}
1
+ {"version":3,"file":"PageController.cjs.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n // eslint-disable-next-line no-unused-private-class-members\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":["getEditorResponseData"],"mappings":";;;;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAexB,YAAY,WAAsB;AAXlC;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAgBA,SAAA,WAAW,OAAO,UAAkB;AAChC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,aAAa,KAAK,EAAE,KAAK,CAAC,WAAWA,yCAA4B,MAAM,CAAC;AAAA,IACvF;AAQA,SAAA,YAAY,OAAO,WAAmB;AAClC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,cAAc,MAAM,EAAE,KAAK,CAAC,WAAWA,yCAA4B,MAAM,CAAC;AAAA,IACzF;AAxBI,uBAAK,YAAa;AAClB,uBAAK,UAAW;AAAA,EACpB;AAuBJ;AArCI;AAMA;;"}
@@ -19,6 +19,7 @@ class PageController {
19
19
  /**
20
20
  * @ignore
21
21
  */
22
+ // eslint-disable-next-line no-unused-private-class-members
22
23
  __privateAdd(this, _blobAPI);
23
24
  this.setWidth = async (width) => {
24
25
  const res = await __privateGet(this, _editorAPI);
@@ -1 +1 @@
1
- {"version":3,"file":"PageController.es.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAcxB,YAAY,WAAsB;AAVlC;AAAA;AAAA;AAAA;AAKA;AAAA;AAAA;AAAA;AAgBA,SAAA,WAAW,OAAO,UAAkB;AAChC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,aAAa,KAAK,EAAE,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IACvF;AAQA,SAAA,YAAY,OAAO,WAAmB;AAClC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,cAAc,MAAM,EAAE,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IACzF;AAxBI,uBAAK,YAAa;AAClB,uBAAK,UAAW;AAAA,EACpB;AAuBJ;AApCI;AAKA;"}
1
+ {"version":3,"file":"PageController.es.js","sources":["../../../../src/next/controllers/PageController.ts"],"sourcesContent":["import { EditorAPI, EditorRawAPI } from '../../types/CommonTypes';\nimport { getEditorResponseData } from '../../utils/EditorResponseData';\nimport { CallSender } from 'penpal';\n\n/**\n * The PageController is responsible for all communication regarding Pages.\n * Methods inside this controller can be called by `window.SDK.page.{method-name}`\n */\nexport class PageController {\n /**\n * @ignore\n */\n #editorAPI: EditorAPI;\n\n /**\n * @ignore\n */\n // eslint-disable-next-line no-unused-private-class-members\n #blobAPI: EditorRawAPI;\n\n /**\n * @ignore\n */\n constructor(editorAPI: EditorAPI) {\n this.#editorAPI = editorAPI;\n this.#blobAPI = editorAPI as CallSender as EditorRawAPI;\n }\n\n /**\n * This method will set the width of all pages to a specific value.\n * This only works if the document is a project.\n * @param width the string value that will be calculated (f.e. 1+1 will result in 2) The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setWidth = async (width: string) => {\n const res = await this.#editorAPI;\n return res.setPageWidth(width).then((result) => getEditorResponseData<null>(result));\n };\n\n /**\n * This method will set the height of all pages to a specific value.\n * This only works if the document is a project.\n * @param height the string value that will be calculated (f.e. 1+1 will result in 2). The default unit is in the current layout unit (e.g. px, mm, in)\n * @returns\n */\n setHeight = async (height: string) => {\n const res = await this.#editorAPI;\n return res.setPageHeight(height).then((result) => getEditorResponseData<null>(result));\n };\n}\n"],"names":[],"mappings":";;;;;;;;;AAQO,MAAM,eAAe;AAAA;AAAA;AAAA;AAAA,EAexB,YAAY,WAAsB;AAXlC;AAAA;AAAA;AAAA;AAMA;AAAA;AAAA;AAAA;AAAA;AAgBA,SAAA,WAAW,OAAO,UAAkB;AAChC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,aAAa,KAAK,EAAE,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IACvF;AAQA,SAAA,YAAY,OAAO,WAAmB;AAClC,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IAAI,cAAc,MAAM,EAAE,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IACzF;AAxBI,uBAAK,YAAa;AAClB,uBAAK,UAAW;AAAA,EACpB;AAuBJ;AArCI;AAMA;"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const current = "2.29.latest";
3
+ const current = "2.30.latest";
4
4
  const engineInfo = {
5
5
  current
6
6
  };
@@ -1,4 +1,4 @@
1
- const current = "2.29.latest";
1
+ const current = "2.30.latest";
2
2
  const engineInfo = {
3
3
  current
4
4
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const version = "1.46.2";
3
+ const version = "1.47.0";
4
4
  const packageInfo = {
5
5
  version
6
6
  };
@@ -1,4 +1,4 @@
1
- const version = "1.46.2";
1
+ const version = "1.47.0";
2
2
  const packageInfo = {
3
3
  version
4
4
  };