@3dsource/metabox-modular-configurator-api 2.0.1 → 2.0.2

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
@@ -16,6 +16,7 @@ components, component types, materials, and capture screenshots or PDFs.
16
16
  - [Core Integration](#core-integration)
17
17
  - [Type Definitions](#type-definitions)
18
18
  - [Command Classes](#command-classes)
19
+ - [Standalone Mode](#standalone-mode)
19
20
  - [Examples](#examples)
20
21
  - [Event Handling](#event-handling)
21
22
  - [Troubleshooting](#troubleshooting)
@@ -38,6 +39,8 @@ components, component types, materials, and capture screenshots or PDFs.
38
39
  - HTTPS connection (required for Unreal Engine)
39
40
  - Valid Metabox modular configurator URL
40
41
 
42
+ Important: Use an HTTPS configurator URL and a valid container element ID. integrateMetabox will throw if the container element is not found.
43
+
41
44
  ## Installation
42
45
 
43
46
  ### NPM Installation (Recommended)
@@ -45,7 +48,7 @@ components, component types, materials, and capture screenshots or PDFs.
45
48
  For use with modern frameworks like Angular, React, Vue, etc.:
46
49
 
47
50
  ```bash
48
- npm install @3dsource/metabox-modular-configurator-api --save
51
+ npm install @3dsource/metabox-modular-configurator-api@^2.0.1 --save
49
52
  ```
50
53
 
51
54
  ### CDN Installation
@@ -53,12 +56,12 @@ npm install @3dsource/metabox-modular-configurator-api --save
53
56
  For direct browser usage without a build system:
54
57
 
55
58
  ```javascript
56
- import { integrateMetabox, Communicator, SetEnvironment, SetComponent } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api';
59
+ import { integrateMetabox, Communicator, SetEnvironment, SetComponent } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api@2.0.1/+esm';
57
60
  ```
58
61
 
59
62
  Alternative CDN options:
60
63
 
61
- - **jsDelivr**: `https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api@0.0.5/+esm`
64
+ - **jsDelivr**: `https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api@^2.0.1/+esm`
62
65
 
63
66
  ## Quick Start
64
67
 
@@ -98,7 +101,7 @@ Create a container element where the configurator will be embedded:
98
101
 
99
102
  ```html
100
103
  <script type="module">
101
- import { GetPdf, GetScreenshot, GetCallToActionInformation, integrateMetabox, saveImage, SetComponent, SetComponentMaterial, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, ResetCamera, ApplyZoom } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api';
104
+ import { GetPdf, GetScreenshot, GetCallToActionInformation, integrateMetabox, saveImage, SetComponent, SetComponentMaterial, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, ResetCamera, ApplyZoom } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api@2.0.1/+esm';
102
105
 
103
106
  // Replace it with your actual configurator URL
104
107
  const configuratorUrl = 'https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id';
@@ -292,11 +295,12 @@ Integrates the Metabox modular configurator into the specified container.
292
295
  - `configuratorUrl` (`string`): The URL of your Metabox configurator
293
296
  - `containerId` (`string`): The ID of the HTML element where the configurator will be embedded
294
297
  - `apiReadyCallback` (`(api: Communicator) => void`): Callback function that receives the API communicator instance
298
+ - `config` (Partial<MetaboxCommandConfig>, optional): Initial configuration for the integration. Set `standalone: true` to disable Metabox’s built-in UI/template logic and control everything from the host app. Other fields like `hostUrl` and `apiVersion` are populated automatically.
295
299
 
296
300
  **TypeScript Signature:**
297
301
 
298
302
  ```typescript
299
- declare function integrateMetabox(configuratorUrl: string, containerId: string, apiReadyCallback: (api: Communicator) => void): void;
303
+ function integrateMetabox(configuratorUrl: string, containerId: string, apiReadyCallback: (api: Communicator) => void, config?: Partial<MetaboxCommandConfig>): void;
300
304
  ```
301
305
 
302
306
  **Example:**
@@ -563,30 +567,32 @@ api.sendCommandToMetaBox(new SetComponentMaterial('chair-fabric', 'leather-brown
563
567
 
564
568
  #### `ShowEmbeddedMenu(visible)`
565
569
 
566
- Controls the visibility of the embedded configurator menu.
570
+ Controls the visibility of the embedded configurator menu (right sidebar).
567
571
 
568
572
  **Parameters:**
569
573
 
570
- - `visible` (boolean): Whether to show or hide the menu
574
+ - `visible` (boolean): `true` to show the built-in menu; `false` to hide it.
571
575
 
572
- **Example:**
576
+ **Examples:**
573
577
 
574
578
  ```typescript
579
+ api.sendCommandToMetaBox(new ShowEmbeddedMenu(true)); // Show menu
575
580
  api.sendCommandToMetaBox(new ShowEmbeddedMenu(false)); // Hide menu
576
581
  ```
577
582
 
578
583
  #### `ShowOverlayInterface(visible)`
579
584
 
580
- Controls the visibility of the overlay interface.
585
+ Controls the visibility of the overlay interface over the Unreal viewport (e.g., on‑viewport buttons, tooltips, hotspots).
581
586
 
582
587
  **Parameters:**
583
588
 
584
- - `visible` (boolean): Whether to show or hide the overlay
589
+ - `visible` (boolean): `true` to show the overlay; `false` to hide it.
585
590
 
586
- **Example:**
591
+ **Examples:**
587
592
 
588
593
  ```typescript
589
- api.sendCommandToMetaBox(new ShowOverlayInterface(true)); // Show overlay
594
+ api.sendCommandToMetaBox(new ShowOverlayInterface(true)); // Show overlay
595
+ api.sendCommandToMetaBox(new ShowOverlayInterface(false)); // Hide overlay
590
596
  ```
591
597
 
592
598
  ### Camera Control
@@ -1081,17 +1087,10 @@ api.addEventListener('statusMessageChanged', (message: string | null) => {
1081
1087
  4. Check the browser console for CORS or network errors
1082
1088
 
1083
1089
  ```typescript
1084
- // Add error handling
1085
- integrateMetabox(
1086
- configuratorUrl,
1087
- 'embed3DSource',
1088
- (api) => {
1089
- console.log('API ready!');
1090
- },
1091
- (error) => {
1092
- console.error('Failed to load configurator:', error);
1093
- },
1094
- );
1090
+ // Ensure the element exists and URL is correct before calling
1091
+ integrateMetabox(configuratorUrl, 'embed3DSource', (api) => {
1092
+ console.log('API ready!');
1093
+ });
1095
1094
  ```
1096
1095
 
1097
1096
  #### Commands Not Working
@@ -1173,3 +1172,61 @@ We welcome contributions to improve the Metabox Modular Configurator API!
1173
1172
 
1174
1173
  For more examples and advanced usage, visit
1175
1174
  our [documentation site](https://preview.3dsource.com/front-libraries/master/modular-configurator-api-doc/).
1175
+
1176
+ ## Standalone Mode
1177
+
1178
+ Standalone mode lets you embed the Metabox renderer without the built‑in Metabox UI and template logic. This is ideal when you want to build a fully custom UI (menus, buttons, flows) and drive the configurator entirely through this API.
1179
+
1180
+ When standalone is enabled, the embedded page does not render Metabox’s internal menus, overlays, or template logic. You are responsible for sending commands (e.g., setComponent, setEnvironment, setComponentMaterialById) and listening to events to keep your UI in sync.
1181
+
1182
+ Key points:
1183
+
1184
+ - Purpose: use when you need a 100% custom interface and logic on the host page.
1185
+ - Behavior: Metabox default UI, embedded menu and template logic are disabled on the iframe side.
1186
+ - Control: you drive everything with API commands and events.
1187
+ - Availability: supported since v2 of the API (example versions ≥ 2.0.1).
1188
+
1189
+ How to enable
1190
+
1191
+ Pass the 4th argument config with standalone set to true when calling integrateMetabox.
1192
+
1193
+ TypeScript example:
1194
+
1195
+ ```typescript
1196
+ import { integrateMetabox, Communicator, SetComponent, SetEnvironment } from '@3dsource/metabox-modular-configurator-api';
1197
+
1198
+ integrateMetabox(
1199
+ 'https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id',
1200
+ 'embed3DSource',
1201
+ (api: Communicator) => {
1202
+ // Send your initial commands to establish state
1203
+ api.sendCommandToMetaBox(new SetComponent('your-component-id', 'your-type-id', true));
1204
+ api.sendCommandToMetaBox(new SetEnvironment('your-environment-id'));
1205
+ },
1206
+ { standalone: true },
1207
+ );
1208
+ ```
1209
+
1210
+ JavaScript (CDN) example:
1211
+
1212
+ ```html
1213
+ <script type="module">
1214
+ import { integrateMetabox, SetComponent, SetEnvironment } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api@2.0.1/+esm';
1215
+
1216
+ integrateMetabox(
1217
+ 'https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id',
1218
+ 'embed3DSource',
1219
+ (api) => {
1220
+ api.sendCommandToMetaBox(new SetComponent('your-component-id', 'your-type-id', true));
1221
+ api.sendCommandToMetaBox(new SetEnvironment('your-environment-id'));
1222
+ },
1223
+ { standalone: true },
1224
+ );
1225
+ </script>
1226
+ ```
1227
+
1228
+ Notes and tips
1229
+
1230
+ - In standalone mode, nothing will change until you send initial commands (e.g., set component/environment). If you see a blank/default view, ensure you dispatch the necessary SetComponent/SetEnvironment commands once api is ready.
1231
+ - All events (like configuratorDataUpdated, screenshotReady) still work; use them to keep your UI synchronized.
1232
+ - The config.hostUrl and config.apiVersion are set automatically by the library; you typically don’t need to pass them.
@@ -584,7 +584,7 @@ const MetaboxHost_V2 = 'metaboxHost_v2';
584
584
  const MetaboxData_V2 = 'metaboxData_v2';
585
585
  const AppLoaded_V2 = 'appLoaded_v2';
586
586
 
587
- const VERSION = '2.0.1';
587
+ const VERSION = '2.0.2';
588
588
 
589
589
  const communicatorMap = new Map();
590
590
  /**
@@ -716,10 +716,9 @@ class Communicator extends EventDispatcher {
716
716
  * @param iframeSrc - The source URL of the Metabox iframe.
717
717
  * Additional url parameters:
718
718
  * ```javascript
719
- * sidebar=false - disables the internal Metabox menu
720
719
  * introImage=https://example.com/image.png - sets the intro image
721
720
  * ```
722
- * 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
721
+ * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id&introImage=https://example.com/image.png
723
722
  *
724
723
  * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.
725
724
  * @param apiReadyCallback - Callback after communicator will be created.
@@ -732,7 +731,7 @@ class Communicator extends EventDispatcher {
732
731
  * } from '@3dsource/metabox-modular-configurator-api';
733
732
  *
734
733
  * integrateMetabox(
735
- * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
734
+ * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp',
736
735
  * 'embed3DSource'
737
736
  * );
738
737
  */
@@ -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/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/actions/MetaboxConfig.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/event-dispatcher.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/constants/common.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/constants/version.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';\nimport { MetaboxHost_V2 } from '../constants';\nimport { MetaboxCommandConfig } from './metabox-config';\n\nexport const MetaboxModularConfiguratorActions = {\n metaboxConfig: 'metaboxConfig',\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.metaboxConfig]: {\n appId: string;\n config: MetaboxCommandConfig;\n };\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]: void;\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: typeof MetaboxHost_V2;\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();\n * };\n */\n\nexport class InitShowcase extends CommandBase {\n /**\n * Creates an instance of InitShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.initShowcase,\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","import { CommandBase } from './CommandBase';\nimport {\n MetaboxCommandConfig,\n MetaboxModularConfiguratorActions,\n} from '../interfaces';\n\n/**\n * Represents a command to send Metabox Config to Metabox Modular Configurator.\n * @remarks\n * Automatically sent when the Communicator instance is ready.\n */\n\nexport class MetaboxConfig extends CommandBase {\n /**\n * Creates an instance of MetaboxConfig.\n * @param {string} appId - The unique identifier for the Communicator Instance\n * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic\n */\n constructor(appId: string, config: MetaboxCommandConfig) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.metaboxConfig,\n payload: { appId, config },\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n destroy(key: string): void {\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","export const Metabox_V2 = 'metabox_v2';\nexport const MetaboxHost_V2 = 'metaboxHost_v2';\nexport const MetaboxData_V2 = 'metaboxData_v2';\nexport const AppLoaded_V2 = 'appLoaded_v2';\n","export const VERSION = '2.0.1';\n","import { EventDispatcher } from './event-dispatcher';\nimport { CommandBase, MetaboxConfig } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n MCAppLoaded,\n MetaboxCommandConfig,\n MetaboxEnvironment,\n} from '../interfaces';\nimport {\n AppLoaded_V2,\n Metabox_V2,\n MetaboxData_V2,\n MetaboxHost_V2,\n VERSION,\n} from '../constants';\n\nconst communicatorMap = new Map<string, { instance: Communicator }>();\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_V2);\n\n /**\n * Constructs a Communicator, replacing any existing instance, and begins listening for messages.\n * @internal\n */\n constructor(\n data: MCAppLoaded['payload'],\n environment: MetaboxEnvironment,\n config?: Partial<MetaboxCommandConfig>,\n ) {\n super();\n const { appId = 'unknown', version = VERSION } = data ?? {};\n const key = `${version}_${environment}_${appId}`;\n communicatorMap.get(key)?.instance.destroy(key);\n communicatorMap.set(key, { instance: this });\n window.addEventListener('message', this.binder);\n this.sendCommandToMetaBox(\n new MetaboxConfig(appId, {\n ...config,\n hostUrl: location.href,\n apiVersion: VERSION,\n }),\n );\n }\n\n /**\n * Listens for Metabox to signal readiness, then initializes communicator.\n * @param apiReadyCallback - Called with the new Communicator once to the Metabox is loaded.\n * @param {MetaboxEnvironment} environment - The environment in which the Communicator is running.\n * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic\n */\n static createInstance(\n apiReadyCallback: (api: Communicator) => void,\n environment: MetaboxEnvironment,\n config?: Partial<MetaboxCommandConfig>,\n ): void {\n const startHandler = (event: MessageEvent): void => {\n const message = event.data as FromMetaBoxMessage;\n if (\n message?.envelope?.action === AppLoaded_V2 &&\n message.host === Metabox_V2\n ) {\n apiReadyCallback(\n new Communicator(message.envelope.payload, environment, config),\n );\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(key: string): void {\n super.destroy(key);\n window.removeEventListener('message', this.binder);\n }\n\n static clearAll() {\n if (communicatorMap.size === 0) {\n return;\n }\n\n communicatorMap.forEach((value, key) => value.instance.destroy(key));\n communicatorMap.clear();\n }\n\n static getCommunicator(key: string) {\n return communicatorMap.get(key);\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 const message = {\n host: MetaboxHost_V2,\n payload: { ...data },\n };\n\n if (!iframe?.contentWindow) {\n console.warn(\n 'to the Metabox IFrame not found or not ready. Message sends to the same window',\n );\n window.postMessage({ ...message, target: 'metabox' }, '*');\n return;\n }\n\n // Replace '*' with a specific origin in production for better security.\n iframe.contentWindow.postMessage({ ...message, target: 'child' }, '*');\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_V2).\n * @param event - The postMessage event received on a window.\n */\n private handleMessageReceived<T extends FromMetaBoxApiEvents>(\n messageType: T | typeof MetaboxData_V2,\n event: MessageEvent,\n ): void {\n // Optionally validate event.origin for security.\n if (messageType !== MetaboxData_V2 || event.data?.host !== Metabox_V2) {\n return;\n }\n const data = event.data?.envelope;\n this.dispatchEvent(data?.eventType as T, data.payload);\n }\n}\n","import { Communicator } from './communicator';\nimport { MetaboxCommandConfig } from '../interfaces';\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 - Callback after communicator will be created.\n * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic\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 config?: Partial<MetaboxCommandConfig>,\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, 'host', config);\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;;ACFM,MAAM,iCAAiC,GAAG;AAC/C,IAAA,aAAa,EAAE,eAAe;AAC9B,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,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ator-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/actions/MetaboxConfig.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/event-dispatcher.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/constants/common.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/constants/version.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';\nimport { MetaboxHost_V2 } from '../constants';\nimport { MetaboxCommandConfig } from './metabox-config';\n\nexport const MetaboxModularConfiguratorActions = {\n metaboxConfig: 'metaboxConfig',\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.metaboxConfig]: {\n appId: string;\n config: MetaboxCommandConfig;\n };\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]: void;\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: typeof MetaboxHost_V2;\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();\n * };\n */\n\nexport class InitShowcase extends CommandBase {\n /**\n * Creates an instance of InitShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.initShowcase,\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","import { CommandBase } from './CommandBase';\nimport {\n MetaboxCommandConfig,\n MetaboxModularConfiguratorActions,\n} from '../interfaces';\n\n/**\n * Represents a command to send Metabox Config to Metabox Modular Configurator.\n * @remarks\n * Automatically sent when the Communicator instance is ready.\n */\n\nexport class MetaboxConfig extends CommandBase {\n /**\n * Creates an instance of MetaboxConfig.\n * @param {string} appId - The unique identifier for the Communicator Instance\n * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic\n */\n constructor(appId: string, config: MetaboxCommandConfig) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.metaboxConfig,\n payload: { appId, config },\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 // eslint-disable-next-line @typescript-eslint/no-unused-vars\n destroy(key: string): void {\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","export const Metabox_V2 = 'metabox_v2';\nexport const MetaboxHost_V2 = 'metaboxHost_v2';\nexport const MetaboxData_V2 = 'metaboxData_v2';\nexport const AppLoaded_V2 = 'appLoaded_v2';\n","export const VERSION = '2.0.2';\n","import { EventDispatcher } from './event-dispatcher';\nimport { CommandBase, MetaboxConfig } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n MCAppLoaded,\n MetaboxCommandConfig,\n MetaboxEnvironment,\n} from '../interfaces';\nimport {\n AppLoaded_V2,\n Metabox_V2,\n MetaboxData_V2,\n MetaboxHost_V2,\n VERSION,\n} from '../constants';\n\nconst communicatorMap = new Map<string, { instance: Communicator }>();\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_V2);\n\n /**\n * Constructs a Communicator, replacing any existing instance, and begins listening for messages.\n * @internal\n */\n constructor(\n data: MCAppLoaded['payload'],\n environment: MetaboxEnvironment,\n config?: Partial<MetaboxCommandConfig>,\n ) {\n super();\n const { appId = 'unknown', version = VERSION } = data ?? {};\n const key = `${version}_${environment}_${appId}`;\n communicatorMap.get(key)?.instance.destroy(key);\n communicatorMap.set(key, { instance: this });\n window.addEventListener('message', this.binder);\n this.sendCommandToMetaBox(\n new MetaboxConfig(appId, {\n ...config,\n hostUrl: location.href,\n apiVersion: VERSION,\n }),\n );\n }\n\n /**\n * Listens for Metabox to signal readiness, then initializes communicator.\n * @param apiReadyCallback - Called with the new Communicator once to the Metabox is loaded.\n * @param {MetaboxEnvironment} environment - The environment in which the Communicator is running.\n * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic\n */\n static createInstance(\n apiReadyCallback: (api: Communicator) => void,\n environment: MetaboxEnvironment,\n config?: Partial<MetaboxCommandConfig>,\n ): void {\n const startHandler = (event: MessageEvent): void => {\n const message = event.data as FromMetaBoxMessage;\n if (\n message?.envelope?.action === AppLoaded_V2 &&\n message.host === Metabox_V2\n ) {\n apiReadyCallback(\n new Communicator(message.envelope.payload, environment, config),\n );\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(key: string): void {\n super.destroy(key);\n window.removeEventListener('message', this.binder);\n }\n\n static clearAll() {\n if (communicatorMap.size === 0) {\n return;\n }\n\n communicatorMap.forEach((value, key) => value.instance.destroy(key));\n communicatorMap.clear();\n }\n\n static getCommunicator(key: string) {\n return communicatorMap.get(key);\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 const message = {\n host: MetaboxHost_V2,\n payload: { ...data },\n };\n\n if (!iframe?.contentWindow) {\n console.warn(\n 'to the Metabox IFrame not found or not ready. Message sends to the same window',\n );\n window.postMessage({ ...message, target: 'metabox' }, '*');\n return;\n }\n\n // Replace '*' with a specific origin in production for better security.\n iframe.contentWindow.postMessage({ ...message, target: 'child' }, '*');\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_V2).\n * @param event - The postMessage event received on a window.\n */\n private handleMessageReceived<T extends FromMetaBoxApiEvents>(\n messageType: T | typeof MetaboxData_V2,\n event: MessageEvent,\n ): void {\n // Optionally validate event.origin for security.\n if (messageType !== MetaboxData_V2 || event.data?.host !== Metabox_V2) {\n return;\n }\n const data = event.data?.envelope;\n this.dispatchEvent(data?.eventType as T, data.payload);\n }\n}\n","import { Communicator } from './communicator';\nimport { MetaboxCommandConfig } from '../interfaces';\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 * 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&introImage=https://example.com/image.png\n *\n * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.\n * @param apiReadyCallback - Callback after communicator will be created.\n * @param {MetaboxCommandConfig} config - optional initial config: standalone - if true - disable metabox custom template and all logic\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',\n * 'embed3DSource'\n * );\n */\nexport function integrateMetabox(\n iframeSrc: string,\n containerId = 'embed3DSource',\n apiReadyCallback: (api: Communicator) => void,\n config?: Partial<MetaboxCommandConfig>,\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, 'host', config);\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;;ACFM,MAAM,iCAAiC,GAAG;AAC/C,IAAA,aAAa,EAAE,eAAe;AAC9B,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;AAC1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AAW,CAAA;;;;;;KAMjB;AACH,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;IAEhC,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC;AAC/C,IAAA,MAAM,CAAC,YAAY,CAAC,gBAAgB,EAAE,4BAA4B,CAAC;AACnE,IAAA,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,iBAAiB,CAAC;AAC5C,IAAA,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,GAAG;AACzB,IAAA,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,MAAM;AAC3B,IAAA,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM;AAC5B,IAAA,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ;AAChC,IAAA,MAAM,CAAC,GAAG,GAAG,SAAS;AACtB,IAAA,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC;AAC/B;;ACtEA;;;;;;;;;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
@@ -7,7 +7,7 @@ declare const MetaboxHost_V2 = "metaboxHost_v2";
7
7
  declare const MetaboxData_V2 = "metaboxData_v2";
8
8
  declare const AppLoaded_V2 = "appLoaded_v2";
9
9
 
10
- declare const VERSION = "2.0.1";
10
+ declare const VERSION = "2.0.2";
11
11
 
12
12
  type FromMetaboxApiAction = 'bridge' | typeof AppLoaded_V2;
13
13
 
@@ -719,10 +719,9 @@ declare class Communicator extends EventDispatcher {
719
719
  * @param iframeSrc - The source URL of the Metabox iframe.
720
720
  * Additional url parameters:
721
721
  * ```javascript
722
- * sidebar=false - disables the internal Metabox menu
723
722
  * introImage=https://example.com/image.png - sets the intro image
724
723
  * ```
725
- * 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
724
+ * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id&introImage=https://example.com/image.png
726
725
  *
727
726
  * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.
728
727
  * @param apiReadyCallback - Callback after communicator will be created.
@@ -735,7 +734,7 @@ declare class Communicator extends EventDispatcher {
735
734
  * } from '@3dsource/metabox-modular-configurator-api';
736
735
  *
737
736
  * integrateMetabox(
738
- * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
737
+ * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp',
739
738
  * 'embed3DSource'
740
739
  * );
741
740
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dsource/metabox-modular-configurator-api",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "description": "API for Metabox MODULAR configurator",
5
5
  "keywords": [
6
6
  "metabox",