@3dsource/metabox-modular-configurator-api 0.0.3 → 0.0.4-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,7 @@ components, component types, materials, and capture screenshots or PDFs.
11
11
  - [Installation](#installation)
12
12
  - [Quick Start](#quick-start)
13
13
  - [API Reference](#api-reference)
14
+ - [System Terminology](#system-terminology)
14
15
  - [Core Integration](#core-integration)
15
16
  - [Type Definitions](#type-definitions)
16
17
  - [Command Classes](#command-classes)
@@ -239,6 +240,18 @@ configurator.changeMaterial('seat-fabric', 'leather-brown');
239
240
 
240
241
  ## API Reference
241
242
 
243
+ ### System Terminology
244
+
245
+ - **product** - 3D digital twin of the actual physical product within a Metabox system; concept is used in Basic configurator.
246
+ - **productId** - Unique Product ID within the Metabox system; mandatory. Assigned by the Metabox system automatically after the product's 3D digital twin is uploaded into Metabox.
247
+ - **environment** - 3D digital twin of the actual environment (room scene or other) within a Metabox system.
248
+ - **environmentId** - Unique environment ID within the Metabox system; mandatory. Assigned by the Metabox system automatically after the environment's 3D digital twin is uploaded into Metabox.
249
+ - **externalId** - Product or Material ID assigned to product or material in Metabox; optional; can be a combination of letters or numbers or both. Should be identical to the product SKU number in any other non-Metabox e-commerce system that is used for managing products, so Metabox can be integrated with such a system.
250
+ - **showcase** - Exists as an attribute of product only; optional. If present, it means the product's digital twin contains a camera sequence that causes the video mode added automatically to the configurator by Metabox system to play this camera sequence.
251
+ - **component** - Product in the Modular configurator context.
252
+ - **componentId** - Unique Component ID within the Metabox system; mandatory. Assigned by the Metabox system automatically after the Modular configurator is created in Metabox.
253
+ - **componentType** - Exists in Modular Configurator only; the name of the type of the product component, which can include one or several separate products of the same category (examples of product component types: truck wheel, truck bumper). It is set by an unreal artist while creating the digital twin model and is automatically added to the Metabox system after this twin is uploaded to Metabox.
254
+
242
255
  ### Core Integration
243
256
 
244
257
  #### `integrateMetabox(configuratorUrl, containerId, apiReadyCallback)`
@@ -6,15 +6,6 @@ import { fromEvent } from 'rxjs';
6
6
  class CommandBase {
7
7
  }
8
8
 
9
- /**
10
- * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.
11
- * @param {Communicator} target
12
- * @param eventName
13
- */
14
- function fromCommunicatorEvent(target, eventName) {
15
- return fromEvent(target, eventName);
16
- }
17
-
18
9
  const MetaboxModularConfiguratorActions = {
19
10
  setEnvironment: 'setEnvironment',
20
11
  setEnvironmentMaterialById: 'setEnvironmentMaterialById',
@@ -22,6 +13,7 @@ const MetaboxModularConfiguratorActions = {
22
13
  setComponentType: 'setComponentType',
23
14
  setComponentMaterialById: 'setComponentMaterialById',
24
15
  getPdf: 'getPdf',
16
+ getCallToActionInformation: 'getCallToActionInformation',
25
17
  getScreenshot: 'getScreenshot',
26
18
  showEmbeddedMenu: 'showEmbeddedMenu',
27
19
  forceSetDeviceType: 'forceSetDeviceType',
@@ -36,85 +28,123 @@ const MetaboxModularConfiguratorActions = {
36
28
  };
37
29
 
38
30
  /**
39
- * Represents a command to get a PDF from Metabox.
31
+ * Represents a command to ApplyZoom and change zoom camera on a scene.
40
32
  * @remarks
41
- * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
33
+ * This class sends a command to the Metabox API to change zoom on a scene.
34
+ *
35
+ * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
36
+ *
37
+ * @example
38
+ * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
39
+ * window.env3DSource.apiReady = (api: Communicator) => {
40
+ * api.sendCommandToMetaBox(new ApplyZoom(10));
41
+ * api.sendCommandToMetaBox(new ApplyZoom(-10));
42
+ * };
43
+ */
44
+ class ApplyZoom extends CommandBase {
45
+ /**
46
+ * Creates an instance of ApplyZoom.
47
+ *
48
+ * @param {...number} zoom
49
+ */
50
+ constructor(zoom) {
51
+ super();
52
+ this.data = {
53
+ action: MetaboxModularConfiguratorActions.applyZoom,
54
+ payload: { zoom },
55
+ };
56
+ }
57
+ }
58
+
59
+ /**
60
+ * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.
61
+ * @param {Communicator} target
62
+ * @param eventName
63
+ */
64
+ function fromCommunicatorEvent(target, eventName) {
65
+ return fromEvent(target, eventName);
66
+ }
67
+
68
+ /**
69
+ * Represents a command to get a Call To Action Information from Metabox Modular Configurator.
70
+ * @remarks
71
+ * This class sends a message to the Metabox API to generate Call To Action information based on the current configuration and sends it to the endpoint url from the cta information.
42
72
  * This action does not require any parameters.
43
73
  *
44
74
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
45
75
  *
46
76
  * @example
47
- * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';
77
+ * import { GetCallToActionInformation, Communicator } from '@3dsource/metabox-modular-configurator-api';
48
78
  * window.env3DSource.apiReady = (api: Communicator) => {
49
- * api.sendCommandToMetaBox(new GetPdf());
79
+ * api.sendCommandToMetaBox(new GetCallToActionInformation());
50
80
  * };
51
81
  */
52
- class GetPdf extends CommandBase {
82
+ class GetCallToActionInformation extends CommandBase {
53
83
  /**
54
- * Creates an instance of GetPdf.
84
+ * Creates an instance of GetCallToActionInformation.
55
85
  *
56
86
  * @remarks
57
87
  * This constructor does not require any parameters.
58
88
  */
59
89
  constructor() {
60
90
  super();
61
- this.data = { action: MetaboxModularConfiguratorActions.getPdf };
91
+ this.data = {
92
+ action: MetaboxModularConfiguratorActions.getCallToActionInformation,
93
+ };
62
94
  }
63
95
  }
64
96
 
65
97
  /**
66
- * Represents a command to send to unreal and reset camera to initial.
98
+ * Represents a command to get a PDF from Metabox.
67
99
  * @remarks
68
- * This class sends a message to the Metabox API to reset the camera on a scene.
100
+ * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
69
101
  * This action does not require any parameters.
70
102
  *
71
103
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
72
104
  *
73
105
  * @example
74
- * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
106
+ * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';
75
107
  * window.env3DSource.apiReady = (api: Communicator) => {
76
- * api.sendCommandToMetaBox(new ResetCamera());
108
+ * api.sendCommandToMetaBox(new GetPdf());
77
109
  * };
78
110
  */
79
- class ResetCamera extends CommandBase {
111
+ class GetPdf extends CommandBase {
80
112
  /**
81
- * Creates an instance of ResetCamera.
113
+ * Creates an instance of GetPdf.
82
114
  *
83
115
  * @remarks
84
116
  * This constructor does not require any parameters.
85
117
  */
86
118
  constructor() {
87
119
  super();
88
- this.data = { action: MetaboxModularConfiguratorActions.resetCamera };
120
+ this.data = { action: MetaboxModularConfiguratorActions.getPdf };
89
121
  }
90
122
  }
91
123
 
92
124
  /**
93
- * Represents a command to ApplyZoom and change zoom camera on a scene.
125
+ * Represents a command to send to unreal and reset camera to initial.
94
126
  * @remarks
95
- * This class sends a command to the Metabox API to change zoom on a scene.
127
+ * This class sends a message to the Metabox API to reset the camera on a scene.
128
+ * This action does not require any parameters.
96
129
  *
97
130
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
98
131
  *
99
132
  * @example
100
- * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
133
+ * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
101
134
  * window.env3DSource.apiReady = (api: Communicator) => {
102
- * api.sendCommandToMetaBox(new ApplyZoom(10));
103
- * api.sendCommandToMetaBox(new ApplyZoom(-10));
135
+ * api.sendCommandToMetaBox(new ResetCamera());
104
136
  * };
105
137
  */
106
- class ApplyZoom extends CommandBase {
138
+ class ResetCamera extends CommandBase {
107
139
  /**
108
- * Creates an instance of ApplyZoom.
140
+ * Creates an instance of ResetCamera.
109
141
  *
110
- * @param {...number} zoom
142
+ * @remarks
143
+ * This constructor does not require any parameters.
111
144
  */
112
- constructor(zoom) {
145
+ constructor() {
113
146
  super();
114
- this.data = {
115
- action: MetaboxModularConfiguratorActions.applyZoom,
116
- payload: { zoom },
117
- };
147
+ this.data = { action: MetaboxModularConfiguratorActions.resetCamera };
118
148
  }
119
149
  }
120
150
 
@@ -122,15 +152,14 @@ class ApplyZoom extends CommandBase {
122
152
  * Represents a command to Init Showcase for a product in a component on a scene and start a sequence for the product.
123
153
  * @remarks
124
154
  * This class sends a command to the Metabox API to init showcase if the product in a component has a sequence.
125
- * For check this needs to find a showcase property in current product in a component
126
- * If this property exist you can send init showcase command
127
- * @internal Use {@link UniversalConfiguratorProduct.product.showcase}
128
- * @remarks
129
- * You can send init showcase command only for root components, otherwise we will ignore this command
155
+ * For check this needs to find a showcase property in the current product in a component
156
+ * If this property exists, you can send init showcase command
157
+ * You can send init showcase command only for root components; otherwise we will ignore this command
130
158
  *
131
159
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
132
160
  *
133
161
  * @example
162
+ * ```typescript
134
163
  * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';
135
164
  * window.env3DSource.apiReady = (api: Communicator) => {
136
165
  * api.sendCommandToMetaBox(new InitShowcase('ffea6b5c-3a8a-4f56-9417-e605acb5cca3');
@@ -709,5 +738,5 @@ function saveImage(imageUrl, filename) {
709
738
  * Generated bundle index. Do not edit.
710
739
  */
711
740
 
712
- export { ApplyZoom, CommandBase, Communicator, EventDispatcher, GetPdf, GetScreenshot, InitShowcase, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetComponent, SetComponentMaterial, SetComponentType, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, StopShowcase, UnrealCommand, fromCommunicatorEvent, integrateMetabox, saveImage };
741
+ export { ApplyZoom, CommandBase, Communicator, EventDispatcher, GetCallToActionInformation, GetPdf, GetScreenshot, InitShowcase, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetComponent, SetComponentMaterial, SetComponentType, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, StopShowcase, UnrealCommand, fromCommunicatorEvent, integrateMetabox, saveImage };
713
742
  //# sourceMappingURL=3dsource-metabox-modular-configurator-api.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"3dsource-metabox-modular-configurator-api.mjs","sources":["../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/CommandBase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/fromCommunicatorEvent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/interfaces/ToMetaboxMessagePayloads.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetPdf.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ResetCamera.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ApplyZoom.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/InitShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/UnrealCommand.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PlayShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PauseShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/StopShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetScreenshot.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentType.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironment.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironmentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowEmbeddedMenu.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowOverlayInterface.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/event-dispatcher.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/communicator.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/integrate-metabox.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/save-image.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/3dsource-metabox-modular-configurator-api.ts"],"sourcesContent":["import type { ToMetaBoxMessageEnvelope } from '../interfaces';\n\n/**\n * Base class for commands sent to the Metabox.\n */\nexport class CommandBase {\n data!: ToMetaBoxMessageEnvelope;\n}\n","import type { Communicator } from '../helpers';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\nimport type { Observable } from 'rxjs';\nimport { fromEvent } from 'rxjs';\n\n/**\n * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.\n * @param {Communicator} target\n * @param eventName\n */\nexport function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(\n target: Communicator,\n eventName: T,\n) {\n return fromEvent(target, eventName) as Observable<\n FromMetaboxMessagePayloads[T]\n >;\n}\n","import type { MimeType } from '../actions';\nimport type { ApplicationDeviceTypes } from './application-device-types';\n\nexport const MetaboxModularConfiguratorActions = {\n setEnvironment: 'setEnvironment',\n setEnvironmentMaterialById: 'setEnvironmentMaterialById',\n setComponent: 'setComponent',\n setComponentType: 'setComponentType',\n setComponentMaterialById: 'setComponentMaterialById',\n getPdf: 'getPdf',\n getScreenshot: 'getScreenshot',\n showEmbeddedMenu: 'showEmbeddedMenu',\n forceSetDeviceType: 'forceSetDeviceType',\n showOverlayInterface: 'showOverlayInterface',\n resetCamera: 'resetCamera',\n applyZoom: 'applyZoom',\n initShowcase: 'initShowcase',\n playShowcase: 'playShowcase',\n pauseShowcase: 'pauseShowcase',\n stopShowcase: 'stopShowcase',\n sendCommandToUnreal: 'sendCommandToUnreal',\n} as const;\n\nexport type ToMetaBoxActions =\n (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions];\n\n/**\n * @internal\n * @hidden\n */\nexport type ToMetaboxMessagePayload =\n ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads];\n\nexport type Test = Record<ToMetaBoxActions, object>;\n\n/**\n * Interface for messages sent from the application to the Metabox Modular Configurator.\n */\nexport interface ToMetaboxMessagePayloads {\n [MetaboxModularConfiguratorActions.setEnvironment]: { id: string };\n [MetaboxModularConfiguratorActions.setEnvironmentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.setComponentType]: { typeId: string };\n [MetaboxModularConfiguratorActions.setComponent]: {\n id: string;\n typeId: string;\n isRoot: boolean;\n };\n [MetaboxModularConfiguratorActions.setComponentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.getScreenshot]: {\n format: MimeType;\n size?: { x: number; y: number };\n };\n [MetaboxModularConfiguratorActions.getPdf]: void;\n [MetaboxModularConfiguratorActions.showEmbeddedMenu]: { visible: boolean };\n [MetaboxModularConfiguratorActions.showOverlayInterface]: {\n visible: boolean;\n };\n [MetaboxModularConfiguratorActions.forceSetDeviceType]: {\n deviceType: ApplicationDeviceTypes;\n };\n [MetaboxModularConfiguratorActions.resetCamera]: void;\n [MetaboxModularConfiguratorActions.applyZoom]: { zoom: number };\n [MetaboxModularConfiguratorActions.initShowcase]: { productId: string };\n [MetaboxModularConfiguratorActions.playShowcase]: void;\n [MetaboxModularConfiguratorActions.pauseShowcase]: void;\n [MetaboxModularConfiguratorActions.stopShowcase]: void;\n [MetaboxModularConfiguratorActions.sendCommandToUnreal]: object;\n}\n\nexport interface ToMetaBoxMessageEnvelope {\n action: ToMetaBoxActions;\n payload?: ToMetaboxMessagePayload | never;\n}\n\nexport interface ToMetaBoxMessage {\n host: 'metaBoxHost';\n payload: ToMetaBoxMessageEnvelope;\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to get a PDF from Metabox.\n * @remarks\n * This class sends a message to the Metabox API to generate a PDF based on the current configuration.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new GetPdf());\n * };\n */\n\nexport class GetPdf extends CommandBase {\n /**\n * Creates an instance of GetPdf.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.getPdf };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to send to unreal and reset camera to initial.\n * @remarks\n * This class sends a message to the Metabox API to reset the camera on a scene.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new ResetCamera());\n * };\n */\n\nexport class ResetCamera extends CommandBase {\n /**\n * Creates an instance of ResetCamera.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.resetCamera };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to ApplyZoom and change zoom camera on a scene.\n * @remarks\n * This class sends a command to the Metabox API to change zoom on a scene.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new ApplyZoom(10));\n * api.sendCommandToMetaBox(new ApplyZoom(-10));\n * };\n */\n\nexport class ApplyZoom extends CommandBase {\n /**\n * Creates an instance of ApplyZoom.\n *\n * @param {...number} zoom\n */\n constructor(zoom: number) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.applyZoom,\n payload: { zoom },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Init Showcase for a product in a component on a scene and start a sequence for the product.\n * @remarks\n * This class sends a command to the Metabox API to init showcase if the product in a component has a sequence.\n * For check this needs to find a showcase property in current product in a component\n * If this property exist you can send init showcase command\n * @internal Use {@link UniversalConfiguratorProduct.product.showcase}\n * @remarks\n * You can send init showcase command only for root components, otherwise we will ignore this command\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new InitShowcase('ffea6b5c-3a8a-4f56-9417-e605acb5cca3');\n * };\n */\n\nexport class InitShowcase extends CommandBase {\n /**\n * Creates an instance of InitShowcase.\n *\n * @param {string} productId\n */\n constructor(productId: string) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.initShowcase,\n payload: { productId },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * @internal\n * @hidden\n * Represents a command to send Unreal command.\n */\nexport class UnrealCommand extends CommandBase {\n constructor(payload: object) {\n super();\n this.data = {\n payload,\n action: MetaboxModularConfiguratorActions.sendCommandToUnreal,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Play Showcase for a product when it already init, and you call pause, for example, before it.\n * @remarks\n * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and pause.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PlayShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new PlayShowcase());\n * };\n */\n\nexport class PlayShowcase extends CommandBase {\n /**\n * Creates an instance of PlayShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.playShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Pause Showcase for a product when it already init and play, and you call pause.\n * @remarks\n * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and play.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PauseShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new PauseShowcase());\n * };\n */\n\nexport class PauseShowcase extends CommandBase {\n /**\n * Creates an instance of PauseShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.pauseShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Stop Showcase for a product when it already init, and you want to destroy it.\n * @remarks\n * This class sends a command to the Metabox API to Stop showcase for a product if it is already initialized.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { StopShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new StopShowcase());\n * };\n */\n\nexport class StopShowcase extends CommandBase {\n /**\n * Creates an instance of StopShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.stopShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Image format.\n * @remarks\n * This type represents the allowed image formats.\n */\nexport type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';\n\n/**\n * Represents a command to get a screenshot.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * // Listen for events from to the Metabox API\n * api.addEventListener('screenshot', (data) => {\n * // Process the get screenshot response\n * saveImage(data, 'Render.png');\n * });\n * api.sendCommandToMetaBox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));\n * };\n */\nexport class GetScreenshot extends CommandBase {\n /**\n * Constructs an instance of GetScreenshot.\n * @param {MimeType} mimeType - The output format.\n * @param {{ x: number; y: number }} [size] - Optional size in pixels.\n */\n constructor(mimeType: MimeType, size?: { x: number; y: number }) {\n super();\n this.data = {\n payload: { format: mimeType, size },\n action: MetaboxModularConfiguratorActions.getScreenshot,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component by its data (ID, typeId, isRoot).\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component using the provided component ID and its component type data.\n *\n * @example\n * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new SetComponent(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId', true\n * ));\n * };\n */\nexport class SetComponent extends CommandBase {\n /**\n * Creates an instance of SetComponent.\n *\n * @param {string} id\n * @param {string} typeId\n * @param {boolean} isRoot\n */\n constructor(id: string, typeId: string, isRoot: boolean) {\n super();\n this.data = {\n payload: { id, typeId, isRoot },\n action: MetaboxModularConfiguratorActions.setComponent,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set component material by its slot ID and Material ID.\n *\n * @example\n * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new SetComponentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetComponentMaterial extends CommandBase {\n /**\n * Creates an instance of SetComponentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setComponentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component type by its ID.\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component type using the provided component type ID.\n *\n * @example\n * import { SetComponentType, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new SetComponentType(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'\n * ));\n * };\n */\nexport class SetComponentType extends CommandBase {\n /**\n * Creates an instance of SetComponentType.\n *\n * @param {string} typeId\n */\n constructor(typeId: string) {\n super();\n this.data = {\n payload: { typeId },\n action: MetaboxModularConfiguratorActions.setComponentType,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set the environment by its ID.\n *\n * @example\n * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * // Change the environment to '55555555-1234-1234-1234-01234567890'\n * api.sendCommandToMetaBox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));\n * };\n */\nexport class SetEnvironment extends CommandBase {\n /**\n * Creates an instance of SetEnvironment.\n *\n * @param {string} environmentId - The environment ID.\n */\n constructor(environmentId: string) {\n super();\n this.data = {\n payload: { id: environmentId },\n action: MetaboxModularConfiguratorActions.setEnvironment,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set an environment material by its slot ID and Material ID.\n *\n * @example\n * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new SetEnvironmentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetEnvironmentMaterial extends CommandBase {\n /**\n * Creates an instance of SetEnvironmentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setEnvironmentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Embedded to the Metabox Menu.\n *\n * @example\n * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new ShowEmbeddedMenu(true));\n * };\n */\nexport class ShowEmbeddedMenu extends CommandBase {\n /**\n * Creates an instance of ShowEmbeddedMenu.\n *\n * @param {boolean} visible - A flag indicating whether the embedded menu should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showEmbeddedMenu,\n payload: { visible },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Unreal Overlay Interface Menu.\n *\n * @remarks\n * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI.\n *\n * @example\n * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new ShowOverlayInterface(true));\n * };\n */\nexport class ShowOverlayInterface extends CommandBase {\n /**\n * Creates an instance of ShowOverlayInterface.\n *\n * @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showOverlayInterface,\n payload: { visible },\n };\n }\n}\n","/**\n * Represents a callback listener for specific message types.\n * Used internally by EventDispatcher to store event listeners.\n *\n * @public\n */\nexport interface Listener {\n /** The message type this listener is registered for */\n messageType: string;\n /** The callback function to execute when a message of the specified type is received */\n callback: (data: unknown) => void;\n}\n\n/**\n * EventDispatcher is a class that manages event listeners and dispatches events to them.\n */\nexport class EventDispatcher {\n /**\n * Storage for callback listeners by message type.\n */\n listeners: Listener[] = [];\n\n destroy() {\n this.listeners = [];\n }\n\n /**\n * Adds an event listener for receiving specific types of messages.\n *\n * @param {string} messageType - The message type to listen for.\n * @param callback - The callback function to execute when a message is received.\n */\n addEventListener(\n messageType: string,\n callback: (data: unknown) => void,\n ): this {\n this.listeners.push({ messageType, callback });\n return this;\n }\n\n /**\n * Dispatches an event to all listeners of a specific message type.\n *\n * @param {string} messageType - The message type.\n * @param data - The data associated with the event.\n */\n dispatchEvent(messageType: string, data: unknown): this {\n this.listeners\n .filter((listener) => listener.messageType === messageType)\n .forEach((listener) => listener.callback(data));\n return this;\n }\n\n /**\n * Removes an event listener for a specific type of message.\n *\n * @param {string} messageType - The message type.\n * @param callback - The callback function to remove.\n */\n removeEventListener(\n messageType: string,\n callback: (data: unknown) => void,\n ): this {\n this.listeners = this.listeners.filter(\n (listener) =>\n !(\n listener.messageType === messageType && listener.callback === callback\n ),\n );\n return this;\n }\n}\n","import { EventDispatcher } from './event-dispatcher';\nimport type { CommandBase } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\n\n/**\n * Handles messaging between the host page and embedded to the Metabox content.\n * @internal Use {@link Communicator.createInstance} or the {@link integrateMetabox} helper to instantiate.\n */\nexport class Communicator extends EventDispatcher {\n /**\n * Singleton reference to the current communicator instance.\n */\n public static instance: Communicator | null = null;\n /**\n * Bound handler for incoming postMessage events.\n */\n private binder = this.handleMessageReceived.bind(this, 'metaboxData');\n\n /**\n * Constructs a Communicator, replacing any existing instance, and begins listening for messages.\n * @internal\n */\n constructor() {\n super();\n Communicator.instance?.destroy();\n Communicator.instance = this;\n window.addEventListener('message', this.binder);\n }\n\n /**\n * Listens for to the Metabox to signal readiness, then initializes communicator.\n * @param apiReadyCallback - Called with the new Communicator once to the Metabox is loaded.\n */\n static createInstance(apiReadyCallback: (api: Communicator) => void): void {\n const startHandler = (event: MessageEvent): void => {\n const message = event.data as FromMetaBoxMessage;\n if (message?.envelope?.action === 'appLoaded') {\n apiReadyCallback(new Communicator());\n window.removeEventListener('message', startHandler);\n }\n };\n\n window.addEventListener('message', startHandler);\n }\n\n /**\n * Cleans up resources and stops listening for messages.\n */\n public override destroy(): void {\n super.destroy();\n window.removeEventListener('message', this.binder);\n }\n\n /**\n * Posts a command to the Metabox iframe.\n * @param command - An action command containing data to send.\n */\n public sendCommandToMetaBox<T extends CommandBase>(command: T): void {\n const { data } = command;\n const iframe = document.getElementById(\n 'embeddedContent',\n ) as HTMLIFrameElement;\n\n if (!iframe?.contentWindow) {\n console.warn('to the Metabox IFrame not found or not ready.');\n return;\n }\n\n const message = {\n host: 'metaBoxHost',\n payload: { ...data },\n };\n\n // Replace '*' with a specific origin in production for better security.\n iframe.contentWindow.postMessage(message, '*');\n }\n\n /**\n * Registers an event listener for messages dispatched by Metabox.\n * @override\n */\n override addEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.addEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Dispatches a typed event to all registered listeners.\n * @override\n */\n override dispatchEvent<T extends FromMetaBoxApiEvents>(\n messageType: T,\n data: FromMetaboxMessagePayloads[T],\n ) {\n return super.dispatchEvent(messageType, data);\n }\n\n /**\n * Removes a previously registered event listener.\n * @override\n */\n override removeEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.removeEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Filters and dispatches incoming messages from to the Metabox.\n * @param messageType - Expected message type for filtering ('metaboxData').\n * @param event - The postMessage event received on a window.\n */\n private handleMessageReceived<T extends FromMetaBoxApiEvents>(\n messageType: T | 'metaboxData',\n event: MessageEvent,\n ): void {\n // Optionally validate event.origin for security.\n if (messageType !== 'metaboxData' || event.data?.host !== 'metabox') {\n return;\n }\n\n const { eventType, payload } = event.data.envelope;\n this.dispatchEvent(eventType as T, payload);\n }\n}\n","import { Communicator } from './communicator';\n\n/**\n * Integrates Metabox Modular Configurator into the provided layout.\n *\n * @remarks\n * This function injects an iframe into a specified container element in the DOM and initializes\n * the communicator for interacting with the Metabox embedded content.\n *\n * @param iframeSrc - The source URL of the Metabox iframe.\n * Additional url parameters:\n * ```javascript\n * sidebar=false - disables the internal Metabox menu\n * introImage=https://example.com/image.png - sets the intro image\n * ```\n * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id?sidebar=false&introImage=https://example.com/image.png\n *\n * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.\n * @param apiReadyCallback\n * @throws Error if the container element with the specified ID is not found.\n *\n * @example\n * import {\n * integrateMetabox,\n * } from '@3dsource/metabox-modular-configurator-api';\n *\n * integrateMetabox(\n * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',\n * 'embed3DSource'\n * );\n */\nexport function integrateMetabox(\n iframeSrc: string,\n containerId = 'embed3DSource',\n apiReadyCallback: (api: Communicator) => void,\n): void {\n const container = document.getElementById(containerId);\n if (!container) {\n throw new Error(`Container element with id ${containerId} not found`);\n }\n\n const existingIframe = document.getElementById('embeddedContent');\n if (existingIframe) {\n existingIframe.remove();\n }\n\n Communicator.createInstance(apiReadyCallback);\n\n const style = document.createElement('style');\n style.innerHTML = `\n #${containerId} {\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n }\n `;\n document.head.appendChild(style);\n\n const iframe = document.createElement('iframe');\n iframe.setAttribute('referrerPolicy', 'no-referrer-when-downgrade');\n iframe.setAttribute('id', 'embeddedContent');\n iframe.style.border = '0';\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.overflow = 'hidden';\n iframe.src = iframeSrc;\n container.appendChild(iframe);\n}\n","/**\n * Saves an image by triggering a download.\n *\n * @remarks\n * This function creates an anchor element, sets its `href` attribute to the provided image URL,\n * and triggers a click event to initiate a download with the specified filename.\n *\n * @param {string} imageUrl - The URL of the image to save.\n * @param {string} filename - The name of the file to save.\n */\nexport function saveImage(imageUrl: string, filename: string): void {\n const a = document.createElement('a');\n a.href = imageUrl;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;AAEG;MACU,WAAW,CAAA;AAEvB;;ACCD;;;;AAIG;AACG,SAAU,qBAAqB,CACnC,MAAoB,EACpB,SAAY,EAAA;AAEZ,IAAA,OAAO,SAAS,CAAC,MAAM,EAAE,SAAS,CAEjC;AACH;;ACjBO,MAAM,iCAAiC,GAAG;AAC/C,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,Y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AS;AACtB,IAAA,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC;AAC/B;;ACpEA;;;;;;;;;AASG;AACG,SAAU,SAAS,CAAC,QAAgB,EAAE,QAAgB,EAAA;IAC1D,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;AACrC,IAAA,CAAC,CAAC,IAAI,GAAG,QAAQ;AACjB,IAAA,CAAC,CAAC,QAAQ,GAAG,QAAQ;AACrB,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,KAAK,EAAE;AACT,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AAC9B;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"3dsource-metabox-modular-configurator-api.mjs","sources":["../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/CommandBase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/interfaces/ToMetaboxMessagePayloads.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ApplyZoom.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/fromCommunicatorEvent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetCallToActionInformation.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetPdf.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ResetCamera.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/InitShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/UnrealCommand.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PlayShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PauseShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/StopShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetScreenshot.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentType.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironment.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironmentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowEmbeddedMenu.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowOverlayInterface.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/event-dispatcher.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/communicator.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/integrate-metabox.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/save-image.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/3dsource-metabox-modular-configurator-api.ts"],"sourcesContent":["import type { ToMetaBoxMessageEnvelope } from '../interfaces';\n\n/**\n * Base class for commands sent to the Metabox.\n */\nexport class CommandBase {\n data!: ToMetaBoxMessageEnvelope;\n}\n","import type { MimeType } from '../actions';\nimport type { ApplicationDeviceTypes } from './application-device-types';\n\nexport const MetaboxModularConfiguratorActions = {\n setEnvironment: 'setEnvironment',\n setEnvironmentMaterialById: 'setEnvironmentMaterialById',\n setComponent: 'setComponent',\n setComponentType: 'setComponentType',\n setComponentMaterialById: 'setComponentMaterialById',\n getPdf: 'getPdf',\n getCallToActionInformation: 'getCallToActionInformation',\n getScreenshot: 'getScreenshot',\n showEmbeddedMenu: 'showEmbeddedMenu',\n forceSetDeviceType: 'forceSetDeviceType',\n showOverlayInterface: 'showOverlayInterface',\n resetCamera: 'resetCamera',\n applyZoom: 'applyZoom',\n initShowcase: 'initShowcase',\n playShowcase: 'playShowcase',\n pauseShowcase: 'pauseShowcase',\n stopShowcase: 'stopShowcase',\n sendCommandToUnreal: 'sendCommandToUnreal',\n} as const;\n\nexport type ToMetaBoxActions =\n (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions];\n\n/**\n * @internal\n * @hidden\n */\nexport type ToMetaboxMessagePayload =\n ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads];\n\nexport type Test = Record<ToMetaBoxActions, object>;\n\n/**\n * Interface for messages sent from the application to the Metabox Modular Configurator.\n */\nexport interface ToMetaboxMessagePayloads {\n [MetaboxModularConfiguratorActions.setEnvironment]: { id: string };\n [MetaboxModularConfiguratorActions.setEnvironmentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.setComponentType]: { typeId: string };\n [MetaboxModularConfiguratorActions.setComponent]: {\n id: string;\n typeId: string;\n isRoot: boolean;\n };\n [MetaboxModularConfiguratorActions.setComponentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.getScreenshot]: {\n format: MimeType;\n size?: { x: number; y: number };\n };\n [MetaboxModularConfiguratorActions.getCallToActionInformation]: void;\n [MetaboxModularConfiguratorActions.getPdf]: void;\n [MetaboxModularConfiguratorActions.showEmbeddedMenu]: { visible: boolean };\n [MetaboxModularConfiguratorActions.showOverlayInterface]: {\n visible: boolean;\n };\n [MetaboxModularConfiguratorActions.forceSetDeviceType]: {\n deviceType: ApplicationDeviceTypes;\n };\n [MetaboxModularConfiguratorActions.resetCamera]: void;\n [MetaboxModularConfiguratorActions.applyZoom]: { zoom: number };\n [MetaboxModularConfiguratorActions.initShowcase]: { productId: string };\n [MetaboxModularConfiguratorActions.playShowcase]: void;\n [MetaboxModularConfiguratorActions.pauseShowcase]: void;\n [MetaboxModularConfiguratorActions.stopShowcase]: void;\n [MetaboxModularConfiguratorActions.sendCommandToUnreal]: object;\n}\n\nexport interface ToMetaBoxMessageEnvelope {\n action: ToMetaBoxActions;\n payload?: ToMetaboxMessagePayload | never;\n}\n\nexport interface ToMetaBoxMessage {\n host: 'metaBoxHost';\n payload: ToMetaBoxMessageEnvelope;\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to ApplyZoom and change zoom camera on a scene.\n * @remarks\n * This class sends a command to the Metabox API to change zoom on a scene.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new ApplyZoom(10));\n * api.sendCommandToMetaBox(new ApplyZoom(-10));\n * };\n */\n\nexport class ApplyZoom extends CommandBase {\n /**\n * Creates an instance of ApplyZoom.\n *\n * @param {...number} zoom\n */\n constructor(zoom: number) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.applyZoom,\n payload: { zoom },\n };\n }\n}\n","import type { Communicator } from '../helpers';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\nimport type { Observable } from 'rxjs';\nimport { fromEvent } from 'rxjs';\n\n/**\n * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.\n * @param {Communicator} target\n * @param eventName\n */\nexport function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(\n target: Communicator,\n eventName: T,\n) {\n return fromEvent(target, eventName) as Observable<\n FromMetaboxMessagePayloads[T]\n >;\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to get a Call To Action Information from Metabox Modular Configurator.\n * @remarks\n * This class sends a message to the Metabox API to generate Call To Action information based on the current configuration and sends it to the endpoint url from the cta information.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetCallToActionInformation, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new GetCallToActionInformation());\n * };\n */\n\nexport class GetCallToActionInformation extends CommandBase {\n /**\n * Creates an instance of GetCallToActionInformation.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.getCallToActionInformation,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to get a PDF from Metabox.\n * @remarks\n * This class sends a message to the Metabox API to generate a PDF based on the current configuration.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new GetPdf());\n * };\n */\n\nexport class GetPdf extends CommandBase {\n /**\n * Creates an instance of GetPdf.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.getPdf };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to send to unreal and reset camera to initial.\n * @remarks\n * This class sends a message to the Metabox API to reset the camera on a scene.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new ResetCamera());\n * };\n */\n\nexport class ResetCamera extends CommandBase {\n /**\n * Creates an instance of ResetCamera.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.resetCamera };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Init Showcase for a product in a component on a scene and start a sequence for the product.\n * @remarks\n * This class sends a command to the Metabox API to init showcase if the product in a component has a sequence.\n * For check this needs to find a showcase property in the current product in a component\n * If this property exists, you can send init showcase command\n * You can send init showcase command only for root components; otherwise we will ignore this command\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * ```typescript\n * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new InitShowcase('ffea6b5c-3a8a-4f56-9417-e605acb5cca3');\n * };\n */\n\nexport class InitShowcase extends CommandBase {\n /**\n * Creates an instance of InitShowcase.\n *\n * @param {string} productId\n */\n constructor(productId: string) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.initShowcase,\n payload: { productId },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * @internal\n * @hidden\n * Represents a command to send Unreal command.\n */\nexport class UnrealCommand extends CommandBase {\n constructor(payload: object) {\n super();\n this.data = {\n payload,\n action: MetaboxModularConfiguratorActions.sendCommandToUnreal,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Play Showcase for a product when it already init, and you call pause, for example, before it.\n * @remarks\n * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and pause.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PlayShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new PlayShowcase());\n * };\n */\n\nexport class PlayShowcase extends CommandBase {\n /**\n * Creates an instance of PlayShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.playShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Pause Showcase for a product when it already init and play, and you call pause.\n * @remarks\n * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and play.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PauseShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new PauseShowcase());\n * };\n */\n\nexport class PauseShowcase extends CommandBase {\n /**\n * Creates an instance of PauseShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.pauseShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Stop Showcase for a product when it already init, and you want to destroy it.\n * @remarks\n * This class sends a command to the Metabox API to Stop showcase for a product if it is already initialized.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { StopShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new StopShowcase());\n * };\n */\n\nexport class StopShowcase extends CommandBase {\n /**\n * Creates an instance of StopShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.stopShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Image format.\n * @remarks\n * This type represents the allowed image formats.\n */\nexport type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';\n\n/**\n * Represents a command to get a screenshot.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api: Communicator) => {\n * // Listen for events from to the Metabox API\n * api.addEventListener('screenshot', (data) => {\n * // Process the get screenshot response\n * saveImage(data, 'Render.png');\n * });\n * api.sendCommandToMetaBox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));\n * };\n */\nexport class GetScreenshot extends CommandBase {\n /**\n * Constructs an instance of GetScreenshot.\n * @param {MimeType} mimeType - The output format.\n * @param {{ x: number; y: number }} [size] - Optional size in pixels.\n */\n constructor(mimeType: MimeType, size?: { x: number; y: number }) {\n super();\n this.data = {\n payload: { format: mimeType, size },\n action: MetaboxModularConfiguratorActions.getScreenshot,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component by its data (ID, typeId, isRoot).\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component using the provided component ID and its component type data.\n *\n * @example\n * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new SetComponent(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId', true\n * ));\n * };\n */\nexport class SetComponent extends CommandBase {\n /**\n * Creates an instance of SetComponent.\n *\n * @param {string} id\n * @param {string} typeId\n * @param {boolean} isRoot\n */\n constructor(id: string, typeId: string, isRoot: boolean) {\n super();\n this.data = {\n payload: { id, typeId, isRoot },\n action: MetaboxModularConfiguratorActions.setComponent,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set component material by its slot ID and Material ID.\n *\n * @example\n * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new SetComponentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetComponentMaterial extends CommandBase {\n /**\n * Creates an instance of SetComponentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setComponentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component type by its ID.\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component type using the provided component type ID.\n *\n * @example\n * import { SetComponentType, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new SetComponentType(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'\n * ));\n * };\n */\nexport class SetComponentType extends CommandBase {\n /**\n * Creates an instance of SetComponentType.\n *\n * @param {string} typeId\n */\n constructor(typeId: string) {\n super();\n this.data = {\n payload: { typeId },\n action: MetaboxModularConfiguratorActions.setComponentType,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set the environment by its ID.\n *\n * @example\n * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * // Change the environment to '55555555-1234-1234-1234-01234567890'\n * api.sendCommandToMetaBox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));\n * };\n */\nexport class SetEnvironment extends CommandBase {\n /**\n * Creates an instance of SetEnvironment.\n *\n * @param {string} environmentId - The environment ID.\n */\n constructor(environmentId: string) {\n super();\n this.data = {\n payload: { id: environmentId },\n action: MetaboxModularConfiguratorActions.setEnvironment,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set an environment material by its slot ID and Material ID.\n *\n * @example\n * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetaBox(new SetEnvironmentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetEnvironmentMaterial extends CommandBase {\n /**\n * Creates an instance of SetEnvironmentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setEnvironmentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Embedded to the Metabox Menu.\n *\n * @example\n * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new ShowEmbeddedMenu(true));\n * };\n */\nexport class ShowEmbeddedMenu extends CommandBase {\n /**\n * Creates an instance of ShowEmbeddedMenu.\n *\n * @param {boolean} visible - A flag indicating whether the embedded menu should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showEmbeddedMenu,\n payload: { visible },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Unreal Overlay Interface Menu.\n *\n * @remarks\n * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI.\n *\n * @example\n * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new ShowOverlayInterface(true));\n * };\n */\nexport class ShowOverlayInterface extends CommandBase {\n /**\n * Creates an instance of ShowOverlayInterface.\n *\n * @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showOverlayInterface,\n payload: { visible },\n };\n }\n}\n","/**\n * Represents a callback listener for specific message types.\n * Used internally by EventDispatcher to store event listeners.\n *\n * @public\n */\nexport interface Listener {\n /** The message type this listener is registered for */\n messageType: string;\n /** The callback function to execute when a message of the specified type is received */\n callback: (data: unknown) => void;\n}\n\n/**\n * EventDispatcher is a class that manages event listeners and dispatches events to them.\n */\nexport class EventDispatcher {\n /**\n * Storage for callback listeners by message type.\n */\n listeners: Listener[] = [];\n\n destroy() {\n this.listeners = [];\n }\n\n /**\n * Adds an event listener for receiving specific types of messages.\n *\n * @param {string} messageType - The message type to listen for.\n * @param callback - The callback function to execute when a message is received.\n */\n addEventListener(\n messageType: string,\n callback: (data: unknown) => void,\n ): this {\n this.listeners.push({ messageType, callback });\n return this;\n }\n\n /**\n * Dispatches an event to all listeners of a specific message type.\n *\n * @param {string} messageType - The message type.\n * @param data - The data associated with the event.\n */\n dispatchEvent(messageType: string, data: unknown): this {\n this.listeners\n .filter((listener) => listener.messageType === messageType)\n .forEach((listener) => listener.callback(data));\n return this;\n }\n\n /**\n * Removes an event listener for a specific type of message.\n *\n * @param {string} messageType - The message type.\n * @param callback - The callback function to remove.\n */\n removeEventListener(\n messageType: string,\n callback: (data: unknown) => void,\n ): this {\n this.listeners = this.listeners.filter(\n (listener) =>\n !(\n listener.messageType === messageType && listener.callback === callback\n ),\n );\n return this;\n }\n}\n","import { EventDispatcher } from './event-dispatcher';\nimport type { CommandBase } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\n\n/**\n * Handles messaging between the host page and embedded to the Metabox content.\n * @internal Use {@link Communicator.createInstance} or the {@link integrateMetabox} helper to instantiate.\n */\nexport class Communicator extends EventDispatcher {\n /**\n * Singleton reference to the current communicator instance.\n */\n public static instance: Communicator | null = null;\n /**\n * Bound handler for incoming postMessage events.\n */\n private binder = this.handleMessageReceived.bind(this, 'metaboxData');\n\n /**\n * Constructs a Communicator, replacing any existing instance, and begins listening for messages.\n * @internal\n */\n constructor() {\n super();\n Communicator.instance?.destroy();\n Communicator.instance = this;\n window.addEventListener('message', this.binder);\n }\n\n /**\n * Listens for to the Metabox to signal readiness, then initializes communicator.\n * @param apiReadyCallback - Called with the new Communicator once to the Metabox is loaded.\n */\n static createInstance(apiReadyCallback: (api: Communicator) => void): void {\n const startHandler = (event: MessageEvent): void => {\n const message = event.data as FromMetaBoxMessage;\n if (message?.envelope?.action === 'appLoaded') {\n apiReadyCallback(new Communicator());\n window.removeEventListener('message', startHandler);\n }\n };\n\n window.addEventListener('message', startHandler);\n }\n\n /**\n * Cleans up resources and stops listening for messages.\n */\n public override destroy(): void {\n super.destroy();\n window.removeEventListener('message', this.binder);\n }\n\n /**\n * Posts a command to the Metabox iframe.\n * @param command - An action command containing data to send.\n */\n public sendCommandToMetaBox<T extends CommandBase>(command: T): void {\n const { data } = command;\n const iframe = document.getElementById(\n 'embeddedContent',\n ) as HTMLIFrameElement;\n\n if (!iframe?.contentWindow) {\n console.warn('to the Metabox IFrame not found or not ready.');\n return;\n }\n\n const message = {\n host: 'metaBoxHost',\n payload: { ...data },\n };\n\n // Replace '*' with a specific origin in production for better security.\n iframe.contentWindow.postMessage(message, '*');\n }\n\n /**\n * Registers an event listener for messages dispatched by Metabox.\n * @override\n */\n override addEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.addEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Dispatches a typed event to all registered listeners.\n * @override\n */\n override dispatchEvent<T extends FromMetaBoxApiEvents>(\n messageType: T,\n data: FromMetaboxMessagePayloads[T],\n ) {\n return super.dispatchEvent(messageType, data);\n }\n\n /**\n * Removes a previously registered event listener.\n * @override\n */\n override removeEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.removeEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Filters and dispatches incoming messages from to the Metabox.\n * @param messageType - Expected message type for filtering ('metaboxData').\n * @param event - The postMessage event received on a window.\n */\n private handleMessageReceived<T extends FromMetaBoxApiEvents>(\n messageType: T | 'metaboxData',\n event: MessageEvent,\n ): void {\n // Optionally validate event.origin for security.\n if (messageType !== 'metaboxData' || event.data?.host !== 'metabox') {\n return;\n }\n\n const { eventType, payload } = event.data.envelope;\n this.dispatchEvent(eventType as T, payload);\n }\n}\n","import { Communicator } from './communicator';\n\n/**\n * Integrates Metabox Modular Configurator into the provided layout.\n *\n * @remarks\n * This function injects an iframe into a specified container element in the DOM and initializes\n * the communicator for interacting with the Metabox embedded content.\n *\n * @param iframeSrc - The source URL of the Metabox iframe.\n * Additional url parameters:\n * ```javascript\n * sidebar=false - disables the internal Metabox menu\n * introImage=https://example.com/image.png - sets the intro image\n * ```\n * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id?sidebar=false&introImage=https://example.com/image.png\n *\n * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.\n * @param apiReadyCallback\n * @throws Error if the container element with the specified ID is not found.\n *\n * @example\n * import {\n * integrateMetabox,\n * } from '@3dsource/metabox-modular-configurator-api';\n *\n * integrateMetabox(\n * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',\n * 'embed3DSource'\n * );\n */\nexport function integrateMetabox(\n iframeSrc: string,\n containerId = 'embed3DSource',\n apiReadyCallback: (api: Communicator) => void,\n): void {\n const container = document.getElementById(containerId);\n if (!container) {\n throw new Error(`Container element with id ${containerId} not found`);\n }\n\n const existingIframe = document.getElementById('embeddedContent');\n if (existingIframe) {\n existingIframe.remove();\n }\n\n Communicator.createInstance(apiReadyCallback);\n\n const style = document.createElement('style');\n style.innerHTML = `\n #${containerId} {\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n }\n `;\n document.head.appendChild(style);\n\n const iframe = document.createElement('iframe');\n iframe.setAttribute('referrerPolicy', 'no-referrer-when-downgrade');\n iframe.setAttribute('id', 'embeddedContent');\n iframe.style.border = '0';\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.overflow = 'hidden';\n iframe.src = iframeSrc;\n container.appendChild(iframe);\n}\n","/**\n * Saves an image by triggering a download.\n *\n * @remarks\n * This function creates an anchor element, sets its `href` attribute to the provided image URL,\n * and triggers a click event to initiate a download with the specified filename.\n *\n * @param {string} imageUrl - The URL of the image to save.\n * @param {string} filename - The name of the file to save.\n */\nexport function saveImage(imageUrl: string, filename: string): void {\n const a = document.createElement('a');\n a.href = imageUrl;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;AAEG;MACU,WAAW,CAAA;AAEvB;;ACJM,MAAM,iCAAiC,GAAG;AAC/C,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,wBAAwB,EAAE,0BAA0B;AACpD,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,cAAc;AAC5B,IA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,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC;AAC/B;;ACpEA;;;;;;;;;AASG;AACG,SAAU,SAAS,CAAC,QAAgB,EAAE,QAAgB,EAAA;IAC1D,MAAM,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC;AACrC,IAAA,CAAC,CAAC,IAAI,GAAG,QAAQ;AACjB,IAAA,CAAC,CAAC,QAAQ,GAAG,QAAQ;AACrB,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,KAAK,EAAE;AACT,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AAC9B;;ACjBA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -11,6 +11,7 @@ declare const MetaboxModularConfiguratorActions: {
11
11
  readonly setComponentType: "setComponentType";
12
12
  readonly setComponentMaterialById: "setComponentMaterialById";
13
13
  readonly getPdf: "getPdf";
14
+ readonly getCallToActionInformation: "getCallToActionInformation";
14
15
  readonly getScreenshot: "getScreenshot";
15
16
  readonly showEmbeddedMenu: "showEmbeddedMenu";
16
17
  readonly forceSetDeviceType: "forceSetDeviceType";
@@ -60,6 +61,7 @@ interface ToMetaboxMessagePayloads {
60
61
  y: number;
61
62
  };
62
63
  };
64
+ [MetaboxModularConfiguratorActions.getCallToActionInformation]: void;
63
65
  [MetaboxModularConfiguratorActions.getPdf]: void;
64
66
  [MetaboxModularConfiguratorActions.showEmbeddedMenu]: {
65
67
  visible: boolean;
@@ -265,6 +267,21 @@ interface Material {
265
267
  /** GraphQL typename for the material. */
266
268
  __typename: 'Material';
267
269
  }
270
+ /**
271
+ * Defines model details for products or materials.
272
+ */
273
+ interface Model {
274
+ /** Unique identifier for the model. */
275
+ id: string;
276
+ /** Path to the pak file for the model. */
277
+ pakFilePath: string;
278
+ /** Asset path for the model. */
279
+ assetPath: string;
280
+ /** Unreal Engine version required for the model. */
281
+ unrealVersion: string;
282
+ /** GraphQL typename for the model. */
283
+ __typename: 'Model';
284
+ }
268
285
  /**
269
286
  * Details showcase the presentation of a product.
270
287
  */
@@ -348,12 +365,41 @@ interface VideoResolution {
348
365
  height: number | null;
349
366
  }
350
367
 
368
+ /** Represents an ecom configurator object with all necessary information about cta */
369
+ interface EcomConfigurator {
370
+ /** The unique ecom configurator identifier. */
371
+ id: string;
372
+ /** The created data of ecom configurator. */
373
+ createdAt: string;
374
+ /** A reference to the Call To Action Information. */
375
+ cta?: Cta;
376
+ /** GraphQL typename for the ecom configurator. */
377
+ __typename: 'Configurator';
378
+ }
379
+ /**
380
+ * Represents the call-to-action information for an ecom configurator.
381
+ */
382
+ interface Cta {
383
+ /** The indicator of whether the call-to-action is enabled or not. */
384
+ enabled: boolean;
385
+ /** Label of button for call-to-action. */
386
+ label: string;
387
+ /** Callback URL using for sent configurator selected information to this url and redirected to the url after get response. */
388
+ callbackUrl: string;
389
+ /** GraphQL typename for the CTA object. */
390
+ __typename: 'Cta';
391
+ }
392
+
351
393
  interface FromMetaboxMessagePayloads {
352
394
  /**
353
- * Dispatches every time the configurator data is updated ands .
395
+ * Dispatches every time the configurator data is updated.
354
396
  * I.e., when the user changes the configuration. (Material, Component Tree, Components, Component Type, Environment)
355
397
  */
356
398
  configuratorDataUpdated: ModularConfiguratorEnvelope;
399
+ /**
400
+ * Dispatches Every time the ecom configurator data is updated (label, endpointUrl).
401
+ */
402
+ ecomConfiguratorDataUpdated: EcomConfigurator;
357
403
  /**
358
404
  * Dispatches every time when the configurator showcase status will be changed.
359
405
  */
@@ -422,6 +468,29 @@ declare class CommandBase {
422
468
  data: ToMetaBoxMessageEnvelope;
423
469
  }
424
470
 
471
+ /**
472
+ * Represents a command to ApplyZoom and change zoom camera on a scene.
473
+ * @remarks
474
+ * This class sends a command to the Metabox API to change zoom on a scene.
475
+ *
476
+ * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
477
+ *
478
+ * @example
479
+ * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
480
+ * window.env3DSource.apiReady = (api: Communicator) => {
481
+ * api.sendCommandToMetaBox(new ApplyZoom(10));
482
+ * api.sendCommandToMetaBox(new ApplyZoom(-10));
483
+ * };
484
+ */
485
+ declare class ApplyZoom extends CommandBase {
486
+ /**
487
+ * Creates an instance of ApplyZoom.
488
+ *
489
+ * @param {...number} zoom
490
+ */
491
+ constructor(zoom: number);
492
+ }
493
+
425
494
  /**
426
495
  * Represents a callback listener for specific message types.
427
496
  * Used internally by EventDispatcher to store event listeners.
@@ -572,22 +641,22 @@ declare function saveImage(imageUrl: string, filename: string): void;
572
641
  declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
573
642
 
574
643
  /**
575
- * Represents a command to get a PDF from Metabox.
644
+ * Represents a command to get a Call To Action Information from Metabox Modular Configurator.
576
645
  * @remarks
577
- * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
646
+ * This class sends a message to the Metabox API to generate Call To Action information based on the current configuration and sends it to the endpoint url from the cta information.
578
647
  * This action does not require any parameters.
579
648
  *
580
649
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
581
650
  *
582
651
  * @example
583
- * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';
652
+ * import { GetCallToActionInformation, Communicator } from '@3dsource/metabox-modular-configurator-api';
584
653
  * window.env3DSource.apiReady = (api: Communicator) => {
585
- * api.sendCommandToMetaBox(new GetPdf());
654
+ * api.sendCommandToMetaBox(new GetCallToActionInformation());
586
655
  * };
587
656
  */
588
- declare class GetPdf extends CommandBase {
657
+ declare class GetCallToActionInformation extends CommandBase {
589
658
  /**
590
- * Creates an instance of GetPdf.
659
+ * Creates an instance of GetCallToActionInformation.
591
660
  *
592
661
  * @remarks
593
662
  * This constructor does not require any parameters.
@@ -596,22 +665,22 @@ declare class GetPdf extends CommandBase {
596
665
  }
597
666
 
598
667
  /**
599
- * Represents a command to send to unreal and reset camera to initial.
668
+ * Represents a command to get a PDF from Metabox.
600
669
  * @remarks
601
- * This class sends a message to the Metabox API to reset the camera on a scene.
670
+ * This class sends a message to the Metabox API to generate a PDF based on the current configuration.
602
671
  * This action does not require any parameters.
603
672
  *
604
673
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
605
674
  *
606
675
  * @example
607
- * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
676
+ * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';
608
677
  * window.env3DSource.apiReady = (api: Communicator) => {
609
- * api.sendCommandToMetaBox(new ResetCamera());
678
+ * api.sendCommandToMetaBox(new GetPdf());
610
679
  * };
611
680
  */
612
- declare class ResetCamera extends CommandBase {
681
+ declare class GetPdf extends CommandBase {
613
682
  /**
614
- * Creates an instance of ResetCamera.
683
+ * Creates an instance of GetPdf.
615
684
  *
616
685
  * @remarks
617
686
  * This constructor does not require any parameters.
@@ -620,41 +689,41 @@ declare class ResetCamera extends CommandBase {
620
689
  }
621
690
 
622
691
  /**
623
- * Represents a command to ApplyZoom and change zoom camera on a scene.
692
+ * Represents a command to send to unreal and reset camera to initial.
624
693
  * @remarks
625
- * This class sends a command to the Metabox API to change zoom on a scene.
694
+ * This class sends a message to the Metabox API to reset the camera on a scene.
695
+ * This action does not require any parameters.
626
696
  *
627
697
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
628
698
  *
629
699
  * @example
630
- * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
700
+ * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';
631
701
  * window.env3DSource.apiReady = (api: Communicator) => {
632
- * api.sendCommandToMetaBox(new ApplyZoom(10));
633
- * api.sendCommandToMetaBox(new ApplyZoom(-10));
702
+ * api.sendCommandToMetaBox(new ResetCamera());
634
703
  * };
635
704
  */
636
- declare class ApplyZoom extends CommandBase {
705
+ declare class ResetCamera extends CommandBase {
637
706
  /**
638
- * Creates an instance of ApplyZoom.
707
+ * Creates an instance of ResetCamera.
639
708
  *
640
- * @param {...number} zoom
709
+ * @remarks
710
+ * This constructor does not require any parameters.
641
711
  */
642
- constructor(zoom: number);
712
+ constructor();
643
713
  }
644
714
 
645
715
  /**
646
716
  * Represents a command to Init Showcase for a product in a component on a scene and start a sequence for the product.
647
717
  * @remarks
648
718
  * This class sends a command to the Metabox API to init showcase if the product in a component has a sequence.
649
- * For check this needs to find a showcase property in current product in a component
650
- * If this property exist you can send init showcase command
651
- * @internal Use {@link UniversalConfiguratorProduct.product.showcase}
652
- * @remarks
653
- * You can send init showcase command only for root components, otherwise we will ignore this command
719
+ * For check this needs to find a showcase property in the current product in a component
720
+ * If this property exists, you can send init showcase command
721
+ * You can send init showcase command only for root components; otherwise we will ignore this command
654
722
  *
655
723
  * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
656
724
  *
657
725
  * @example
726
+ * ```typescript
658
727
  * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';
659
728
  * window.env3DSource.apiReady = (api: Communicator) => {
660
729
  * api.sendCommandToMetaBox(new InitShowcase('ffea6b5c-3a8a-4f56-9417-e605acb5cca3');
@@ -945,5 +1014,5 @@ declare class ShowOverlayInterface extends CommandBase {
945
1014
  constructor(visible: boolean);
946
1015
  }
947
1016
 
948
- export { ApplyZoom, CommandBase, Communicator, EventDispatcher, GetPdf, GetScreenshot, InitShowcase, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetComponent, SetComponentMaterial, SetComponentType, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, StopShowcase, UnrealCommand, fromCommunicatorEvent, integrateMetabox, saveImage };
949
- export type { ApplicationDeviceTypes, ComponentWithParent, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxApiAction, FromMetaboxMessagePayloads, InitialModularConfigurator, Listener, MCAppLoaded, Material, MetaBoxApiEnvelope, MetaProperty, MimeType, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, Product, SelectedIds, ShowCaseStatus, Slot, Test, Thumbnail, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, VideoResolution };
1017
+ export { ApplyZoom, CommandBase, Communicator, EventDispatcher, GetCallToActionInformation, GetPdf, GetScreenshot, InitShowcase, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetComponent, SetComponentMaterial, SetComponentType, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, StopShowcase, UnrealCommand, fromCommunicatorEvent, integrateMetabox, saveImage };
1018
+ export type { ApplicationDeviceTypes, ComponentWithParent, Cta, EcomConfigurator, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxApiAction, FromMetaboxMessagePayloads, InitialModularConfigurator, Listener, MCAppLoaded, Material, MetaBoxApiEnvelope, MetaProperty, MimeType, Model, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, Product, SelectedIds, ShowCaseStatus, Showcase, Slot, Test, Thumbnail, Timecode, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, VideoResolution };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dsource/metabox-modular-configurator-api",
3
- "version": "0.0.3",
3
+ "version": "0.0.4-dev.0",
4
4
  "description": "API for Metabox MODULAR configurator",
5
5
  "keywords": [
6
6
  "metabox",