@3dsource/metabox-modular-configurator-api 3.0.19-dev.1 → 3.0.19-dev.10
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
|
@@ -402,17 +402,17 @@ Embeds the Metabox Modular Configurator iframe and establishes communication cha
|
|
|
402
402
|
**Signature:**
|
|
403
403
|
|
|
404
404
|
```typescript
|
|
405
|
-
function integrateMetabox(configuratorId: string, containerId
|
|
405
|
+
function integrateMetabox(configuratorId: string, containerId: string, apiReadyCallback: (api: Communicator) => void, config?: IntegrateMetaboxConfig): void;
|
|
406
406
|
```
|
|
407
407
|
|
|
408
408
|
**Parameters:**
|
|
409
409
|
|
|
410
|
-
| Parameter | Type | Required | Default
|
|
411
|
-
| ------------------ | ------------------------ | -------- |
|
|
412
|
-
| `configuratorId` | `string` | ✅ | -
|
|
413
|
-
| `containerId` | `string` |
|
|
414
|
-
| `apiReadyCallback` | `function` | ✅ | -
|
|
415
|
-
| `config` | `IntegrateMetaboxConfig` | ❌ | `{}`
|
|
410
|
+
| Parameter | Type | Required | Default | Description |
|
|
411
|
+
| ------------------ | ------------------------ | -------- | ------- | ---------------------------------------- |
|
|
412
|
+
| `configuratorId` | `string` | ✅ | - | Modular configurator UUID (not full URL) |
|
|
413
|
+
| `containerId` | `string` | ✅ | - | DOM container element ID |
|
|
414
|
+
| `apiReadyCallback` | `function` | ✅ | - | Callback invoked when API is ready |
|
|
415
|
+
| `config` | `IntegrateMetaboxConfig` | ❌ | `{}` | Additional configuration options |
|
|
416
416
|
|
|
417
417
|
**Config Options (`IntegrateMetaboxConfig`):**
|
|
418
418
|
|
|
@@ -588,7 +588,7 @@ Commands control configurator behavior. Send via `api.sendCommandToMetabox(new C
|
|
|
588
588
|
|
|
589
589
|
| Command | Parameters | Description |
|
|
590
590
|
| ------------------------ | --------------------------------------------------------- | ---------------------------------- |
|
|
591
|
-
| `SetComponent` | `componentId: string, typeId: string
|
|
591
|
+
| `SetComponent` | `componentId: string, typeId: string` | Add/select component in assembly |
|
|
592
592
|
| `SetComponentMaterial` | `componentId: string, slotId: string, materialId: string` | Apply material to component slot |
|
|
593
593
|
| `SetEnvironment` | `environmentId: string` | Change environment/scene |
|
|
594
594
|
| `SetEnvironmentMaterial` | `slotId: string, materialId: string` | Apply material to environment slot |
|
|
@@ -518,7 +518,7 @@ class GetScreenshot extends CommandBase {
|
|
|
518
518
|
}
|
|
519
519
|
|
|
520
520
|
/**
|
|
521
|
-
* Represents a command to set a component by its data (ID, typeId
|
|
521
|
+
* Represents a command to set a component by its data (ID, typeId).
|
|
522
522
|
*
|
|
523
523
|
* @remarks
|
|
524
524
|
* To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
|
|
@@ -540,7 +540,7 @@ class GetScreenshot extends CommandBase {
|
|
|
540
540
|
* @param {Communicator} api - communicator instance api
|
|
541
541
|
* window.env3DSource.apiReady = (api: Communicator) => {
|
|
542
542
|
* api.sendCommandToMetabox(new SetComponent(
|
|
543
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId'
|
|
543
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId'
|
|
544
544
|
* ));
|
|
545
545
|
* };
|
|
546
546
|
*/
|
|
@@ -550,12 +550,11 @@ class SetComponent extends CommandBase {
|
|
|
550
550
|
*
|
|
551
551
|
* @param {string} id - The component ID.
|
|
552
552
|
* @param {string} typeId - The component type ID.
|
|
553
|
-
* @param {boolean} isRoot - Whether this is a root component.
|
|
554
553
|
*/
|
|
555
|
-
constructor(id, typeId
|
|
554
|
+
constructor(id, typeId) {
|
|
556
555
|
super();
|
|
557
556
|
this.data = {
|
|
558
|
-
payload: { id, typeId
|
|
557
|
+
payload: { id, typeId },
|
|
559
558
|
action: MetaboxModularConfiguratorActions.setComponent,
|
|
560
559
|
};
|
|
561
560
|
}
|
|
@@ -889,16 +888,28 @@ class EventDispatcher {
|
|
|
889
888
|
* @internal
|
|
890
889
|
* @hidden
|
|
891
890
|
* Represents main constants.
|
|
891
|
+
* IMPORTANT !!! DO NOT CHANGE THESE CONSTANTS !!!!
|
|
892
|
+
* CHANGING THESE CONSTANTS WILL BROKE CUSTOM MENUS
|
|
892
893
|
*/
|
|
893
|
-
const Metabox = '
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
894
|
+
const Metabox = 'metabox';
|
|
895
|
+
const MetaboxHost = 'metaboxHost';
|
|
896
|
+
const AppLoaded = 'appLoaded';
|
|
897
|
+
/**
|
|
898
|
+
* @deprecated
|
|
899
|
+
*/
|
|
900
|
+
const Metabox_V3 = 'metabox_v3';
|
|
901
|
+
/**
|
|
902
|
+
* @deprecated
|
|
903
|
+
*/
|
|
904
|
+
const MetaboxHost_V3 = 'metaboxHost_v3';
|
|
905
|
+
/**
|
|
906
|
+
* @deprecated
|
|
907
|
+
*/
|
|
908
|
+
const AppLoaded_V3 = 'appLoaded_v3';
|
|
898
909
|
const MetaboxDomain = 'metabox.3dsource.com';
|
|
899
910
|
const BasicRouteUrl = 'metabox-configurator/modular';
|
|
900
911
|
|
|
901
|
-
const VERSION = '3.0.19-dev.
|
|
912
|
+
const VERSION = '3.0.19-dev.10';
|
|
902
913
|
|
|
903
914
|
const communicatorMap = new Map();
|
|
904
915
|
/**
|
|
@@ -919,7 +930,7 @@ class Communicator extends EventDispatcher {
|
|
|
919
930
|
/**
|
|
920
931
|
* Bound handler for incoming postMessage events.
|
|
921
932
|
*/
|
|
922
|
-
this.binder = this.handleMessageReceived.bind(this
|
|
933
|
+
this.binder = this.handleMessageReceived.bind(this);
|
|
923
934
|
const { appId = 'unknown', version = VERSION } = data ?? {};
|
|
924
935
|
const key = `${version}_${environment}_${appId}`;
|
|
925
936
|
communicatorMap.get(key)?.instance.destroy(key);
|
|
@@ -940,8 +951,7 @@ class Communicator extends EventDispatcher {
|
|
|
940
951
|
static createInstance(apiReadyCallback, environment, config) {
|
|
941
952
|
const startHandler = (event) => {
|
|
942
953
|
const message = event.data;
|
|
943
|
-
if (message?.envelope?.action ===
|
|
944
|
-
message.host === Metabox) {
|
|
954
|
+
if (message?.envelope?.action === AppLoaded && message.host === Metabox) {
|
|
945
955
|
apiReadyCallback(new Communicator(message.envelope.payload, environment, config));
|
|
946
956
|
window.removeEventListener('message', startHandler);
|
|
947
957
|
}
|
|
@@ -973,9 +983,11 @@ class Communicator extends EventDispatcher {
|
|
|
973
983
|
const { data } = command;
|
|
974
984
|
const iframe = document.getElementById('embeddedContent');
|
|
975
985
|
const toMetaboxMessage = {
|
|
976
|
-
host:
|
|
986
|
+
host: MetaboxHost,
|
|
977
987
|
envelope: { ...data },
|
|
988
|
+
payload: { ...data },
|
|
978
989
|
target: iframe?.contentWindow ? 'child' : 'metabox',
|
|
990
|
+
apiVersion: VERSION,
|
|
979
991
|
};
|
|
980
992
|
if (!iframe?.contentWindow) {
|
|
981
993
|
console.warn('Metabox IFrame not found or not ready. Message sends to the same window');
|
|
@@ -1007,12 +1019,10 @@ class Communicator extends EventDispatcher {
|
|
|
1007
1019
|
}
|
|
1008
1020
|
/**
|
|
1009
1021
|
* Filters and dispatches incoming messages from the Metabox.
|
|
1010
|
-
* @param messageType - Expected message type for filtering (MetaboxData).
|
|
1011
1022
|
* @param event - The postMessage event received on a window.
|
|
1012
1023
|
*/
|
|
1013
|
-
handleMessageReceived(
|
|
1014
|
-
|
|
1015
|
-
if (messageType !== MetaboxData || event.data?.host !== Metabox) {
|
|
1024
|
+
handleMessageReceived(event) {
|
|
1025
|
+
if (event.data?.host !== Metabox) {
|
|
1016
1026
|
return;
|
|
1017
1027
|
}
|
|
1018
1028
|
const data = event.data?.envelope;
|
|
@@ -1060,7 +1070,7 @@ const prepareIframeSrc = (configuratorId, config) => {
|
|
|
1060
1070
|
* @param {string} configuratorId - The Modular Configurator ID (not a full URL). It is appended to
|
|
1061
1071
|
* `https://{domain}/metabox-configurator/modular/{configuratorId}` to form the iframe src.
|
|
1062
1072
|
*
|
|
1063
|
-
* @param {string}
|
|
1073
|
+
* @param {string} containerId - The id of the container element where the iframe will be injected.
|
|
1064
1074
|
*
|
|
1065
1075
|
* @param {(api: Communicator) => void} apiReadyCallback - Called when the Communicator instance is created on the host side.
|
|
1066
1076
|
*
|
|
@@ -1093,7 +1103,7 @@ const prepareIframeSrc = (configuratorId, config) => {
|
|
|
1093
1103
|
* },
|
|
1094
1104
|
* );
|
|
1095
1105
|
*/
|
|
1096
|
-
function integrateMetabox(configuratorId, containerId
|
|
1106
|
+
function integrateMetabox(configuratorId, containerId, apiReadyCallback, config) {
|
|
1097
1107
|
if (!configuratorId.trim()) {
|
|
1098
1108
|
throw new Error('integrateMetabox: configuratorId must be a non-empty string');
|
|
1099
1109
|
}
|
|
@@ -1165,5 +1175,5 @@ function saveImage(imageUrl, filename) {
|
|
|
1165
1175
|
* Generated bundle index. Do not edit.
|
|
1166
1176
|
*/
|
|
1167
1177
|
|
|
1168
|
-
export { AppLoaded, ApplyZoom, BasicRouteUrl, CommandBase, Communicator, EventDispatcher, ForceSetDeviceType, GetCallToActionInformation, GetCamera, GetPdf, GetScreenshot, HideMeasurement, InitShowcase, Metabox, MetaboxConfig,
|
|
1178
|
+
export { AppLoaded, AppLoaded_V3, ApplyZoom, BasicRouteUrl, CommandBase, Communicator, EventDispatcher, ForceSetDeviceType, GetCallToActionInformation, GetCamera, GetPdf, GetScreenshot, HideMeasurement, InitShowcase, Metabox, MetaboxConfig, MetaboxDomain, MetaboxHost, MetaboxHost_V3, MetaboxModularConfiguratorActions, Metabox_V3, PauseShowcase, PlayShowcase, ResetCamera, SetCamera, SetComponent, SetComponentMaterial, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowMeasurement, ShowOverlayInterface, StopShowcase, UnrealCommand, VERSION, fromCommunicatorEvent, integrateMetabox, prepareIframeSrc, saveImage };
|
|
1169
1179
|
//# 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/MetaboxConfig.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetPdf.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetCallToActionInformation.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetCamera.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetCamera.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/PlayShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/UnrealCommand.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/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/ShowMeasurement.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/HideMeasurement.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ForceSetDeviceType.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/prepare-iframe-src.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 API.\n * @internal\n * @hidden\n */\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 *\n * @param {Communicator} target\n * @param eventName\n * @internal\n */\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';\nimport type { Metabox } from '../constants';\nimport type { MetaboxCommandConfig } from './metabox-config';\n\nexport const MetaboxModularConfiguratorActions = {\n metaboxConfig: 'metaboxConfig',\n setEnvironment: 'setEnvironment',\n setEnvironmentMaterialById: 'setEnvironmentMaterialById',\n setComponent: 'setComponent',\n setComponentMaterialById: 'setComponentMaterialById',\n getPdf: 'getPdf',\n getCallToActionInformation: 'getCallToActionInformation',\n getScreenshot: 'getScreenshot',\n showEmbeddedMenu: 'showEmbeddedMenu',\n forceSetDeviceType: 'forceSetDeviceType',\n showOverlayInterface: 'showOverlayInterface',\n getCamera: 'getCamera',\n setCamera: 'setCamera',\n resetCamera: 'resetCamera',\n applyZoom: 'applyZoom',\n initShowcase: 'initShowcase',\n playShowcase: 'playShowcase',\n pauseShowcase: 'pauseShowcase',\n stopShowcase: 'stopShowcase',\n sendCommandToUnreal: 'sendCommandToUnreal',\n showMeasurement: 'showMeasurement',\n hideMeasurement: 'hideMeasurement',\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\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.setComponent]: {\n id: string;\n typeId: string;\n isRoot: boolean;\n };\n [MetaboxModularConfiguratorActions.setComponentMaterialById]: {\n componentId: string;\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.getCamera]: void;\n [MetaboxModularConfiguratorActions.setCamera]: {\n camera: CameraCommandPayload;\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 CameraCommandPayload {\n fov?: number;\n mode?: 'fps' | 'orbit';\n position?: { x: number; y: number; z: number };\n rotation?: {\n horizontal: number;\n vertical: number;\n };\n restrictions?: {\n maxDistanceToPivot?: number;\n maxFov?: number;\n maxHorizontalRotation?: number;\n maxVerticalRotation?: number;\n minDistanceToPivot?: number;\n minFov?: number;\n minHorizontalRotation?: number;\n minVerticalRotation?: number;\n };\n}\n\nexport interface ToMetaBoxMessageEnvelope {\n action: ToMetaBoxActions;\n payload?: ToMetaboxMessagePayload | never;\n}\n\nexport type ToMetaboxTarget = 'metabox' | 'child';\n\nexport interface ToMetaBoxMessage {\n host: typeof Metabox;\n envelope: ToMetaBoxMessageEnvelope;\n /**\n * @deprecated, use envelope instead of payload\n */\n payload?: ToMetaBoxMessageEnvelope;\n target: ToMetaboxTarget;\n}\n","import { CommandBase } from './CommandBase';\nimport type { MetaboxCommandConfig } from '../interfaces';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to send Metabox Config to Metabox Basic Configurator.\n * @remarks\n * **Important**: No need to listen to any events to see changes.\n *\n * @internal\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","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to get a PDF from Metabox Basic Configurator.\n * @remarks\n * This class sends a message to the Metabox API to generate a PDF based on the current configuration.\n * **Important**: No need to listen to any events to see changes.\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 *\n * @param {Communicator} api - communicator instance 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 get a Call To Action Information from Metabox Basic 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 *\n * To listen for changes after sending this command, listen to the 'ecomConfiguratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {EcomConfigurator} data - description for all ecom configurator params\n * api.addEventListener('ecomConfiguratorDataUpdated', (data) => {\n * console.log('Ecom configurator params:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 the camera configuration from Unreal.\n * @remarks\n * This class sends a message to the Metabox API to get the camera from a scene.\n *\n * To listen for changes after sending this command, listen to the 'getCameraResult' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {CameraCommandPayload} data - camera params\n * api.addEventListener('getCameraResult', (data) => {\n * console.log('Camera params after get camera command:', data);\n * });\n * };\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 { GetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new GetCamera());\n * };\n */\n\nexport class GetCamera extends CommandBase {\n /**\n * Creates an instance of GetCamera.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.getCamera };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport type { CameraCommandPayload } from '../interfaces';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set the camera configuration.\n * @remarks\n * This class sends a message to the Metabox API to set the camera on a scene.\n * **Important**: No need to listen to any events to see changes.\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 { SetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetCamera({\n * fov: 45,\n * mode: 'orbit',\n * position: { x: 100, y: 100, z: 100 },\n * rotation: { horizontal: 0, vertical: 0 },\n * restrictions: {\n * maxDistanceToPivot: 0,\n * maxFov: 0,\n * maxHorizontalRotation: 0,\n * maxVerticalRotation: 0,\n * minDistanceToPivot: 0,\n * minFov: 0,\n * minHorizontalRotation: 0,\n * minVerticalRotation: 0,\n * },\n * }));\n * };\n */\n\nexport class SetCamera extends CommandBase {\n /**\n * Creates an instance of SetCamera.\n *\n * @param {CameraCommandPayload} camera - The camera configuration.\n */\n constructor(camera: CameraCommandPayload) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.setCamera,\n payload: { camera },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to reset the camera to its initial position.\n * @remarks\n * This class sends a message to the Metabox API to reset the camera on a scene.\n * **Important**: No need to listen to any events to see changes.\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 * @param {Communicator} api - communicator instance 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 apply zoom and change the camera zoom on a scene.\n * @remarks\n * This class sends a command to the Metabox API to change zoom on a scene.\n * **Important**: No need to listen to any events to see changes.\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 *\n * @param {Communicator} api - communicator instance 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 - The zoom value to apply.\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 initialize Showcase for a product scene and start a sequence for the product.\n * @remarks\n * This class sends a command to the Metabox API to initialize showcase if the product has a sequence.\n * To check this, find the showcase property in the current product and listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new environment:', data);\n * });\n * };\n *\n * If this property exists, you can send the init showcase command.\n *\n * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 * Represents a command to play Showcase for a product when it is already initialized and paused.\n * @remarks\n * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and paused.\n *\n * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 * @internal\n * @hidden\n * Represents a command to send Unreal command.\n */\n\nexport class UnrealCommand extends CommandBase {\n constructor(payload: object) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.sendCommandToUnreal,\n payload,\n };\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 is already initialized and playing.\n * @remarks\n * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and playing.\n *\n * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 is already initialized, 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 * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @remarks\n * To listen for changes after sending this command, listen to the 'screenshot' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {string} data - base64 string image\n * api.addEventListener('screenshot', (data) => {\n * console.log('Get screenshot here:', data);\n * saveImage(data, 'Render.png');\n * });\n * };\n *\n * @example\n * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));\n * };\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 action: MetaboxModularConfiguratorActions.getScreenshot,\n payload: { format: mimeType, size },\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 * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new component:', data);\n * });\n * };\n *\n * @example\n * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(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 - The component ID.\n * @param {string} typeId - The component type ID.\n * @param {boolean} isRoot - Whether this is a root component.\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 * @remarks\n * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new product:', data);\n * });\n * };\n *\n * @example\n * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetComponentMaterial(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',\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} componentId - The component ID.\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(componentId: string, slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { componentId, 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 the environment by its ID.\n *\n * @remarks\n * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new environment:', data);\n * });\n * };\n *\n * @example\n * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));\n * };\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 action: MetaboxModularConfiguratorActions.setEnvironment,\n payload: { id: environmentId },\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 * @remarks\n * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new environment material:', data);\n * });\n * };\n *\n * @example\n * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetEnvironmentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\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 action: MetaboxModularConfiguratorActions.setEnvironmentMaterialById,\n payload: { slotId, materialId },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the embedded Metabox menu.\n * @remarks\n * This command can only be used when using the metabox menu.\n * **Important**: No need to listen to any events to see changes.\n *\n * @example\n * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new ShowEmbeddedMenu(true));\n * };\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 * **Important**: No need to listen to any events to see changes.\n *\n * @example\n * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new ShowOverlayInterface(true));\n * };\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 { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to show measurement for a product when it is already loaded.\n * @remarks\n * This class sends a command to the Metabox API to show measurement for a product if it is already initialized.\n * **Important**: No need to listen to any events to see changes.\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 { ShowMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new ShowMeasurement());\n * };\n */\n\nexport class ShowMeasurement extends CommandBase {\n /**\n * Creates an instance of ShowMeasurement.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.showMeasurement };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to hide measurement for a product when it is already loaded.\n * @remarks\n * This class sends a command to the Metabox API to hide measurement for a product if it is already initialized.\n * **Important**: No need to listen to any events to see changes.\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 { HideMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new HideMeasurement());\n * };\n */\n\nexport class HideMeasurement extends CommandBase {\n /**\n * Creates an instance of HideMeasurement.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.hideMeasurement };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport type { ApplicationDeviceTypes } from '../interfaces';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to force set the device type.\n *\n * @remarks\n * This class sends a message to the Metabox API to force set the device type.\n * **Important**: No need to listen to any events to see changes.\n * //...Assume that the integration is already implemented (only once)\n *\n * @example\n * import { ForceSetDeviceType, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new ForceSetDeviceType('desktop'));\n * };\n */\n\nexport class ForceSetDeviceType extends CommandBase {\n /**\n * Creates an instance of ForceSetDeviceType.\n *\n * @param {ApplicationDeviceTypes} deviceType - The device type to force set.\n */\n constructor(deviceType: ApplicationDeviceTypes) {\n super();\n this.data = {\n payload: { deviceType },\n action: MetaboxModularConfiguratorActions.forceSetDeviceType,\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) {\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","/**\n * @internal\n * @hidden\n * Represents main constants.\n */\nexport const Metabox = 'metabox_v3';\n\n// TODO need to delete all of this\nexport const MetaboxHost = 'metaboxHost_v3';\nexport const MetaboxData = 'metaboxData_v3';\nexport const AppLoaded = 'appLoaded_v3';\n\nexport const MetaboxDomain = 'metabox.3dsource.com';\nexport const BasicRouteUrl = 'metabox-configurator/modular';\n","export const VERSION = '3.0.19-dev.1';\n","import { EventDispatcher } from './event-dispatcher';\nimport type { CommandBase } from '../actions';\nimport { MetaboxConfig } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n MCAppLoaded,\n MetaboxCommandConfig,\n MetaboxEnvironment,\n ToMetaBoxMessage,\n} from '../interfaces';\nimport { Metabox, MetaboxData, VERSION } 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);\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 ) {\n const startHandler = (event: MessageEvent) => {\n const message = event.data as FromMetaBoxMessage;\n if (\n message?.envelope?.action === 'appLoaded_v3' &&\n message.host === Metabox\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) {\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) {\n const { data } = command;\n const iframe = document.getElementById(\n 'embeddedContent',\n ) as HTMLIFrameElement;\n\n const toMetaboxMessage = {\n host: Metabox,\n envelope: { ...data },\n target: iframe?.contentWindow ? 'child' : 'metabox',\n } satisfies ToMetaBoxMessage;\n\n if (!iframe?.contentWindow) {\n console.warn(\n 'Metabox IFrame not found or not ready. Message sends to the same window',\n );\n window.postMessage(toMetaboxMessage, '*');\n return;\n }\n\n iframe.contentWindow.postMessage(toMetaboxMessage, '*');\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 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 | typeof MetaboxData,\n event: MessageEvent,\n ) {\n // Optionally validate event.origin for security.\n if (messageType !== MetaboxData || event.data?.host !== Metabox) {\n return;\n }\n const data = event.data?.envelope;\n this.dispatchEvent(data?.eventType as T, data.payload);\n }\n}\n","import type { IntegrateMetaboxConfig } from '../interfaces';\nimport { BasicRouteUrl, MetaboxDomain } from '../constants';\n\n/**\n *\n * @remarks\n * @internal\n * @hidden\n *\n * @param {string} configuratorId - An string identifier for the configurator.\n * @param {IntegrateMetaboxConfig} config - An object containing the configuration options.\n */\nexport const prepareIframeSrc = (\n configuratorId: string,\n config?: IntegrateMetaboxConfig,\n) => {\n const base = `https://${config?.domain || MetaboxDomain}/${BasicRouteUrl}/${configuratorId}`;\n const params = new URLSearchParams();\n\n if (config?.introImage) {\n params.set('introImage', config.introImage);\n }\n if (config?.introVideo) {\n params.set('introVideo', config.introVideo);\n }\n if (config?.loadingImage) {\n params.set('loadingImage', config.loadingImage);\n }\n if (config?.state) {\n params.set('state', decodeURIComponent(config.state));\n }\n\n const query = params.toString();\n return query ? `${base}?${query}` : base;\n};\n","import { Communicator } from './communicator';\nimport type { IntegrateMetaboxConfig } from '../interfaces';\nimport { prepareIframeSrc } from './prepare-iframe-src';\n\n/**\n * Integrates the Metabox Modular Configurator into the page by injecting an iframe and\n * initializing a Communicator instance for host-to-iframe messaging.\n *\n * @remarks\n * - Builds a secure iframe URL using the provided configuratorId and config options.\n * - Ensures the resulting URL uses HTTPS and that the target container exists.\n * - Removes any previously embedded iframe with id \"embeddedContent\" before inserting a new one.\n *\n * @param {string} configuratorId - The Modular Configurator ID (not a full URL). It is appended to\n * `https://{domain}/metabox-configurator/modular/{configuratorId}` to form the iframe src.\n *\n * @param {string} [containerId='embed3DSource'] - The id of the container element where the iframe will be injected.\n *\n * @param {(api: Communicator) => void} apiReadyCallback - Called when the Communicator instance is created on the host side.\n *\n * @param {IntegrateMetaboxConfig} config - Optional configuration used to build the iframe URL and initialize the communicator.\n * Supported fields:\n * - standalone?: boolean — if true, disables Metabox custom template and related logic.\n * - introImage?: string — URL to an image shown on the intro screen (added as ?introImage=...).\n * - introVideo?: string — URL to a video shown on the intro screen (added as ?introVideo=...).\n * - loadingImage?: string — URL to an image displayed while loading (added as ?loadingImage=...).\n * - state?: string — Predefined state for configurator for initial loading (added as ?state=...).\n * - domain?: string — custom domain for testing (defaults to metabox.3dsource.com). HTTPS is enforced.\n *\n * @throws Error If configuratorId or containerId are empty strings.\n * @throws Error If the computed iframe URL is invalid or does not use HTTPS.\n * @throws Error If the container element with the provided id cannot be found.\n *\n * @example\n * import { integrateMetabox } from '@3dsource/metabox-modular-configurator-api';\n *\n * integrateMetabox(\n * 'configurator-id',\n * 'embed3DSource',\n * (api) => {\n * // Communicator is ready to use\n * },\n * {\n * standalone: false,\n * introImage: 'https://example.com/intro.png',\n * loadingImage: 'https://example.com/loading.png',\n * },\n * );\n */\nexport function integrateMetabox(\n configuratorId: string,\n containerId = 'embed3DSource',\n apiReadyCallback: (api: Communicator) => void,\n config?: IntegrateMetaboxConfig,\n) {\n if (!configuratorId.trim()) {\n throw new Error(\n 'integrateMetabox: configuratorId must be a non-empty string',\n );\n }\n const iframeSrc = prepareIframeSrc(configuratorId, config);\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(iframeSrc);\n } catch {\n throw new Error('integrateMetabox: Provided iframeSrc is not a valid URL');\n }\n if (parsedUrl.protocol !== 'https:') {\n throw new Error('integrateMetabox: iframeSrc must use HTTPS protocol');\n }\n if (!containerId.trim()) {\n throw new Error('integrateMetabox: containerId must be a non-empty string');\n }\n\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('allow', 'autoplay; fullscreen; encrypted-media');\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;;;;AAIG;MAEU,WAAW,CAAA;AAEvB;;ACFD;;;;;;AAMG;AAEG,SAAU,qBAAqB,CACnC,MAAoB,EACpB,SAAY,EAAA;AAEZ,IAAA,OAAO,SAAS,CAAC,MAAM,EAAE,SAAS,CAEjC;AACH;;AClBO,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,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,SAAS,EAAE,WAAW;AACtB,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,eAAe,EAAE,iBAAiB;;;ACvBpC;;;;;;;AAOG;AAEG,MAAO,aAAc,SAAQ,WAAW,CAAA;AAC5C;;;;AAIG;IACH,WAAA,CAAY,KAAa,EAAE,MAA4B,EAAA;AACrD,QAAA,KAAK,EAAE;Q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AuC,CAAC;AACrE,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;;AC3GA;;;;;;;;;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/actions/fromCommunicatorEvent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/interfaces/ToMetaboxMessagePayloads.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/MetaboxConfig.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetPdf.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetCallToActionInformation.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetCamera.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetCamera.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/PlayShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/UnrealCommand.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/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/ShowMeasurement.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/HideMeasurement.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ForceSetDeviceType.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/prepare-iframe-src.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 API.\n * @internal\n * @hidden\n */\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 *\n * @param {Communicator} target\n * @param eventName\n * @internal\n */\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';\nimport type { MetaboxHost } from '../constants';\nimport type { MetaboxCommandConfig } from './metabox-config';\n\nexport const MetaboxModularConfiguratorActions = {\n metaboxConfig: 'metaboxConfig',\n setEnvironment: 'setEnvironment',\n setEnvironmentMaterialById: 'setEnvironmentMaterialById',\n setComponent: 'setComponent',\n setComponentMaterialById: 'setComponentMaterialById',\n getPdf: 'getPdf',\n getCallToActionInformation: 'getCallToActionInformation',\n getScreenshot: 'getScreenshot',\n showEmbeddedMenu: 'showEmbeddedMenu',\n forceSetDeviceType: 'forceSetDeviceType',\n showOverlayInterface: 'showOverlayInterface',\n getCamera: 'getCamera',\n setCamera: 'setCamera',\n resetCamera: 'resetCamera',\n applyZoom: 'applyZoom',\n initShowcase: 'initShowcase',\n playShowcase: 'playShowcase',\n pauseShowcase: 'pauseShowcase',\n stopShowcase: 'stopShowcase',\n sendCommandToUnreal: 'sendCommandToUnreal',\n showMeasurement: 'showMeasurement',\n hideMeasurement: 'hideMeasurement',\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\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.setComponent]: {\n id: string;\n typeId: string;\n };\n [MetaboxModularConfiguratorActions.setComponentMaterialById]: {\n componentId: string;\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.getCamera]: void;\n [MetaboxModularConfiguratorActions.setCamera]: {\n camera: CameraCommandPayload;\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 CameraCommandPayload {\n fov?: number;\n mode?: 'fps' | 'orbit';\n position?: { x: number; y: number; z: number };\n rotation?: {\n horizontal: number;\n vertical: number;\n };\n restrictions?: {\n maxDistanceToPivot?: number;\n maxFov?: number;\n maxHorizontalRotation?: number;\n maxVerticalRotation?: number;\n minDistanceToPivot?: number;\n minFov?: number;\n minHorizontalRotation?: number;\n minVerticalRotation?: number;\n };\n}\n\nexport interface ToMetaBoxMessageEnvelope {\n action: ToMetaBoxActions;\n payload?: ToMetaboxMessagePayload | never;\n}\n\nexport type ToMetaboxTarget = 'metabox' | 'child';\n\nexport interface ToMetaBoxMessage {\n host: typeof MetaboxHost;\n envelope: ToMetaBoxMessageEnvelope;\n /**\n * @deprecated, use envelope instead of payload\n */\n payload: ToMetaBoxMessageEnvelope;\n target: ToMetaboxTarget;\n apiVersion: string;\n}\n","import { CommandBase } from './CommandBase';\nimport type { MetaboxCommandConfig } from '../interfaces';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to send Metabox Config to Metabox Basic Configurator.\n * @remarks\n * **Important**: No need to listen to any events to see changes.\n *\n * @internal\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","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to get a PDF from Metabox Basic Configurator.\n * @remarks\n * This class sends a message to the Metabox API to generate a PDF based on the current configuration.\n * **Important**: No need to listen to any events to see changes.\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 *\n * @param {Communicator} api - communicator instance 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 get a Call To Action Information from Metabox Basic 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 *\n * To listen for changes after sending this command, listen to the 'ecomConfiguratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {EcomConfigurator} data - description for all ecom configurator params\n * api.addEventListener('ecomConfiguratorDataUpdated', (data) => {\n * console.log('Ecom configurator params:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 the camera configuration from Unreal.\n * @remarks\n * This class sends a message to the Metabox API to get the camera from a scene.\n *\n * To listen for changes after sending this command, listen to the 'getCameraResult' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {CameraCommandPayload} data - camera params\n * api.addEventListener('getCameraResult', (data) => {\n * console.log('Camera params after get camera command:', data);\n * });\n * };\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 { GetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new GetCamera());\n * };\n */\n\nexport class GetCamera extends CommandBase {\n /**\n * Creates an instance of GetCamera.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.getCamera };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport type { CameraCommandPayload } from '../interfaces';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set the camera configuration.\n * @remarks\n * This class sends a message to the Metabox API to set the camera on a scene.\n * **Important**: No need to listen to any events to see changes.\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 { SetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetCamera({\n * fov: 45,\n * mode: 'orbit',\n * position: { x: 100, y: 100, z: 100 },\n * rotation: { horizontal: 0, vertical: 0 },\n * restrictions: {\n * maxDistanceToPivot: 0,\n * maxFov: 0,\n * maxHorizontalRotation: 0,\n * maxVerticalRotation: 0,\n * minDistanceToPivot: 0,\n * minFov: 0,\n * minHorizontalRotation: 0,\n * minVerticalRotation: 0,\n * },\n * }));\n * };\n */\n\nexport class SetCamera extends CommandBase {\n /**\n * Creates an instance of SetCamera.\n *\n * @param {CameraCommandPayload} camera - The camera configuration.\n */\n constructor(camera: CameraCommandPayload) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.setCamera,\n payload: { camera },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to reset the camera to its initial position.\n * @remarks\n * This class sends a message to the Metabox API to reset the camera on a scene.\n * **Important**: No need to listen to any events to see changes.\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 * @param {Communicator} api - communicator instance 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 apply zoom and change the camera zoom on a scene.\n * @remarks\n * This class sends a command to the Metabox API to change zoom on a scene.\n * **Important**: No need to listen to any events to see changes.\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 *\n * @param {Communicator} api - communicator instance 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 - The zoom value to apply.\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 initialize Showcase for a product scene and start a sequence for the product.\n * @remarks\n * This class sends a command to the Metabox API to initialize showcase if the product has a sequence.\n * To check this, find the showcase property in the current product and listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new environment:', data);\n * });\n * };\n *\n * If this property exists, you can send the init showcase command.\n *\n * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 * Represents a command to play Showcase for a product when it is already initialized and paused.\n * @remarks\n * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and paused.\n *\n * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 * @internal\n * @hidden\n * Represents a command to send Unreal command.\n */\n\nexport class UnrealCommand extends CommandBase {\n constructor(payload: object) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.sendCommandToUnreal,\n payload,\n };\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 is already initialized and playing.\n * @remarks\n * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and playing.\n *\n * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 is already initialized, 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 * To listen for changes after sending this command, listen to the 'showcaseStatusChanged' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ShowCaseStatus} data - showcase status value\n * api.addEventListener('showcaseStatusChanged', (data) => {\n * console.log('Showcase status value after changed:', data);\n * });\n * };\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 *\n * @param {Communicator} api - communicator instance 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 * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @remarks\n * To listen for changes after sending this command, listen to the 'screenshot' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {string} data - base64 string image\n * api.addEventListener('screenshot', (data) => {\n * console.log('Get screenshot here:', data);\n * saveImage(data, 'Render.png');\n * });\n * };\n *\n * @example\n * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));\n * };\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 action: MetaboxModularConfiguratorActions.getScreenshot,\n payload: { format: mimeType, size },\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).\n *\n * @remarks\n * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new component:', data);\n * });\n * };\n *\n * @example\n * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetComponent(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId'\n * ));\n * };\n */\nexport class SetComponent extends CommandBase {\n /**\n * Creates an instance of SetComponent.\n *\n * @param {string} id - The component ID.\n * @param {string} typeId - The component type ID.\n */\n constructor(id: string, typeId: string) {\n super();\n this.data = {\n payload: { id, typeId },\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 * @remarks\n * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new product:', data);\n * });\n * };\n *\n * @example\n * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetComponentMaterial(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',\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} componentId - The component ID.\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(componentId: string, slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { componentId, 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 the environment by its ID.\n *\n * @remarks\n * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new environment:', data);\n * });\n * };\n *\n * @example\n * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));\n * };\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 action: MetaboxModularConfiguratorActions.setEnvironment,\n payload: { id: environmentId },\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 * @remarks\n * To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.\n * //...Assume that the integration is already implemented (only once)\n * @example\n * import { Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * @param {ConfiguratorEnvelope} data - configurator state after updated\n * api.addEventListener('configuratorDataUpdated', (data) => {\n * console.log('State updated after applied new environment material:', data);\n * });\n * };\n *\n * @example\n * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new SetEnvironmentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\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 action: MetaboxModularConfiguratorActions.setEnvironmentMaterialById,\n payload: { slotId, materialId },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the embedded Metabox menu.\n * @remarks\n * This command can only be used when using the metabox menu.\n * **Important**: No need to listen to any events to see changes.\n *\n * @example\n * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new ShowEmbeddedMenu(true));\n * };\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 * **Important**: No need to listen to any events to see changes.\n *\n * @example\n * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.setCommandToMetaBox(new ShowOverlayInterface(true));\n * };\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 { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to show measurement for a product when it is already loaded.\n * @remarks\n * This class sends a command to the Metabox API to show measurement for a product if it is already initialized.\n * **Important**: No need to listen to any events to see changes.\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 { ShowMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new ShowMeasurement());\n * };\n */\n\nexport class ShowMeasurement extends CommandBase {\n /**\n * Creates an instance of ShowMeasurement.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.showMeasurement };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to hide measurement for a product when it is already loaded.\n * @remarks\n * This class sends a command to the Metabox API to hide measurement for a product if it is already initialized.\n * **Important**: No need to listen to any events to see changes.\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 { HideMeasurement, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new HideMeasurement());\n * };\n */\n\nexport class HideMeasurement extends CommandBase {\n /**\n * Creates an instance of HideMeasurement.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.hideMeasurement };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport type { ApplicationDeviceTypes } from '../interfaces';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to force set the device type.\n *\n * @remarks\n * This class sends a message to the Metabox API to force set the device type.\n * **Important**: No need to listen to any events to see changes.\n * //...Assume that the integration is already implemented (only once)\n *\n * @example\n * import { ForceSetDeviceType, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * @param {Communicator} api - communicator instance api\n * window.env3DSource.apiReady = (api: Communicator) => {\n * api.sendCommandToMetabox(new ForceSetDeviceType('desktop'));\n * };\n */\n\nexport class ForceSetDeviceType extends CommandBase {\n /**\n * Creates an instance of ForceSetDeviceType.\n *\n * @param {ApplicationDeviceTypes} deviceType - The device type to force set.\n */\n constructor(deviceType: ApplicationDeviceTypes) {\n super();\n this.data = {\n payload: { deviceType },\n action: MetaboxModularConfiguratorActions.forceSetDeviceType,\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) {\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","/**\n * @internal\n * @hidden\n * Represents main constants.\n * IMPORTANT !!! DO NOT CHANGE THESE CONSTANTS !!!!\n * CHANGING THESE CONSTANTS WILL BROKE CUSTOM MENUS\n */\nexport const Metabox = 'metabox';\nexport const MetaboxHost = 'metaboxHost';\nexport const AppLoaded = 'appLoaded';\n\n/**\n * @deprecated\n */\nexport const Metabox_V3 = 'metabox_v3';\n/**\n * @deprecated\n */\nexport const MetaboxHost_V3 = 'metaboxHost_v3';\n/**\n * @deprecated\n */\nexport const AppLoaded_V3 = 'appLoaded_v3';\n\nexport const MetaboxDomain = 'metabox.3dsource.com';\nexport const BasicRouteUrl = 'metabox-configurator/modular';\n","export const VERSION = '3.0.19-dev.10';\n","import { EventDispatcher } from './event-dispatcher';\nimport type { CommandBase } from '../actions';\nimport { MetaboxConfig } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n MCAppLoaded,\n MetaboxCommandConfig,\n MetaboxEnvironment,\n ToMetaBoxMessage,\n} from '../interfaces';\nimport { AppLoaded, Metabox, MetaboxHost, VERSION } 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);\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 ) {\n const startHandler = (event: MessageEvent) => {\n const message = event.data as FromMetaBoxMessage;\n if (message?.envelope?.action === AppLoaded && message.host === Metabox) {\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) {\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) {\n const { data } = command;\n const iframe = document.getElementById(\n 'embeddedContent',\n ) as HTMLIFrameElement;\n\n const toMetaboxMessage = {\n host: MetaboxHost,\n envelope: { ...data },\n payload: { ...data },\n target: iframe?.contentWindow ? 'child' : 'metabox',\n apiVersion: VERSION,\n } satisfies ToMetaBoxMessage;\n\n if (!iframe?.contentWindow) {\n console.warn(\n 'Metabox IFrame not found or not ready. Message sends to the same window',\n );\n window.postMessage(toMetaboxMessage, '*');\n return;\n }\n\n iframe.contentWindow.postMessage(toMetaboxMessage, '*');\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 the Metabox.\n * @param event - The postMessage event received on a window.\n */\n private handleMessageReceived<T extends FromMetaBoxApiEvents>(\n event: MessageEvent,\n ) {\n if (event.data?.host !== Metabox) {\n return;\n }\n const data = event.data?.envelope;\n this.dispatchEvent(data?.eventType as T, data.payload);\n }\n}\n","import type { IntegrateMetaboxConfig } from '../interfaces';\nimport { BasicRouteUrl, MetaboxDomain } from '../constants';\n\n/**\n *\n * @remarks\n * @internal\n * @hidden\n *\n * @param {string} configuratorId - An string identifier for the configurator.\n * @param {IntegrateMetaboxConfig} config - An object containing the configuration options.\n */\nexport const prepareIframeSrc = (\n configuratorId: string,\n config?: IntegrateMetaboxConfig,\n) => {\n const base = `https://${config?.domain || MetaboxDomain}/${BasicRouteUrl}/${configuratorId}`;\n const params = new URLSearchParams();\n\n if (config?.introImage) {\n params.set('introImage', config.introImage);\n }\n if (config?.introVideo) {\n params.set('introVideo', config.introVideo);\n }\n if (config?.loadingImage) {\n params.set('loadingImage', config.loadingImage);\n }\n if (config?.state) {\n params.set('state', decodeURIComponent(config.state));\n }\n\n const query = params.toString();\n return query ? `${base}?${query}` : base;\n};\n","import { Communicator } from './communicator';\nimport type { IntegrateMetaboxConfig } from '../interfaces';\nimport { prepareIframeSrc } from './prepare-iframe-src';\n\n/**\n * Integrates the Metabox Modular Configurator into the page by injecting an iframe and\n * initializing a Communicator instance for host-to-iframe messaging.\n *\n * @remarks\n * - Builds a secure iframe URL using the provided configuratorId and config options.\n * - Ensures the resulting URL uses HTTPS and that the target container exists.\n * - Removes any previously embedded iframe with id \"embeddedContent\" before inserting a new one.\n *\n * @param {string} configuratorId - The Modular Configurator ID (not a full URL). It is appended to\n * `https://{domain}/metabox-configurator/modular/{configuratorId}` to form the iframe src.\n *\n * @param {string} containerId - The id of the container element where the iframe will be injected.\n *\n * @param {(api: Communicator) => void} apiReadyCallback - Called when the Communicator instance is created on the host side.\n *\n * @param {IntegrateMetaboxConfig} config - Optional configuration used to build the iframe URL and initialize the communicator.\n * Supported fields:\n * - standalone?: boolean — if true, disables Metabox custom template and related logic.\n * - introImage?: string — URL to an image shown on the intro screen (added as ?introImage=...).\n * - introVideo?: string — URL to a video shown on the intro screen (added as ?introVideo=...).\n * - loadingImage?: string — URL to an image displayed while loading (added as ?loadingImage=...).\n * - state?: string — Predefined state for configurator for initial loading (added as ?state=...).\n * - domain?: string — custom domain for testing (defaults to metabox.3dsource.com). HTTPS is enforced.\n *\n * @throws Error If configuratorId or containerId are empty strings.\n * @throws Error If the computed iframe URL is invalid or does not use HTTPS.\n * @throws Error If the container element with the provided id cannot be found.\n *\n * @example\n * import { integrateMetabox } from '@3dsource/metabox-modular-configurator-api';\n *\n * integrateMetabox(\n * 'configurator-id',\n * 'embed3DSource',\n * (api) => {\n * // Communicator is ready to use\n * },\n * {\n * standalone: false,\n * introImage: 'https://example.com/intro.png',\n * loadingImage: 'https://example.com/loading.png',\n * },\n * );\n */\nexport function integrateMetabox(\n configuratorId: string,\n containerId: string,\n apiReadyCallback: (api: Communicator) => void,\n config?: IntegrateMetaboxConfig,\n) {\n if (!configuratorId.trim()) {\n throw new Error(\n 'integrateMetabox: configuratorId must be a non-empty string',\n );\n }\n const iframeSrc = prepareIframeSrc(configuratorId, config);\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(iframeSrc);\n } catch {\n throw new Error('integrateMetabox: Provided iframeSrc is not a valid URL');\n }\n if (parsedUrl.protocol !== 'https:') {\n throw new Error('integrateMetabox: iframeSrc must use HTTPS protocol');\n }\n if (!containerId.trim()) {\n throw new Error('integrateMetabox: containerId must be a non-empty string');\n }\n\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('allow', 'autoplay; fullscreen; encrypted-media');\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;;;;AAIG;MAEU,WAAW,CAAA;AAEvB;;ACFD;;;;;;AAMG;AAEG,SAAU,qBAAqB,CACnC,MAAoB,EACpB,SAAY,EAAA;AAEZ,IAAA,OAAO,SAAS,CAAC,MAA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AAA,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;;AC3GA;;;;;;;;;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/package.json
CHANGED
|
@@ -6,15 +6,28 @@ type ApplicationDeviceTypes = 'deviceTypeAuto' | 'deviceTypeMobile' | 'deviceTyp
|
|
|
6
6
|
* @internal
|
|
7
7
|
* @hidden
|
|
8
8
|
* Represents main constants.
|
|
9
|
+
* IMPORTANT !!! DO NOT CHANGE THESE CONSTANTS !!!!
|
|
10
|
+
* CHANGING THESE CONSTANTS WILL BROKE CUSTOM MENUS
|
|
9
11
|
*/
|
|
10
|
-
declare const Metabox = "
|
|
11
|
-
declare const MetaboxHost = "
|
|
12
|
-
declare const
|
|
13
|
-
|
|
12
|
+
declare const Metabox = "metabox";
|
|
13
|
+
declare const MetaboxHost = "metaboxHost";
|
|
14
|
+
declare const AppLoaded = "appLoaded";
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated
|
|
17
|
+
*/
|
|
18
|
+
declare const Metabox_V3 = "metabox_v3";
|
|
19
|
+
/**
|
|
20
|
+
* @deprecated
|
|
21
|
+
*/
|
|
22
|
+
declare const MetaboxHost_V3 = "metaboxHost_v3";
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated
|
|
25
|
+
*/
|
|
26
|
+
declare const AppLoaded_V3 = "appLoaded_v3";
|
|
14
27
|
declare const MetaboxDomain = "metabox.3dsource.com";
|
|
15
28
|
declare const BasicRouteUrl = "metabox-configurator/modular";
|
|
16
29
|
|
|
17
|
-
declare const VERSION = "3.0.19-dev.
|
|
30
|
+
declare const VERSION = "3.0.19-dev.10";
|
|
18
31
|
|
|
19
32
|
interface IntegrateMetaboxConfig {
|
|
20
33
|
standalone?: boolean;
|
|
@@ -78,7 +91,6 @@ interface ToMetaboxMessagePayloads {
|
|
|
78
91
|
[MetaboxModularConfiguratorActions.setComponent]: {
|
|
79
92
|
id: string;
|
|
80
93
|
typeId: string;
|
|
81
|
-
isRoot: boolean;
|
|
82
94
|
};
|
|
83
95
|
[MetaboxModularConfiguratorActions.setComponentMaterialById]: {
|
|
84
96
|
componentId: string;
|
|
@@ -146,13 +158,14 @@ interface ToMetaBoxMessageEnvelope {
|
|
|
146
158
|
}
|
|
147
159
|
type ToMetaboxTarget = 'metabox' | 'child';
|
|
148
160
|
interface ToMetaBoxMessage {
|
|
149
|
-
host: typeof
|
|
161
|
+
host: typeof MetaboxHost;
|
|
150
162
|
envelope: ToMetaBoxMessageEnvelope;
|
|
151
163
|
/**
|
|
152
164
|
* @deprecated, use envelope instead of payload
|
|
153
165
|
*/
|
|
154
|
-
payload
|
|
166
|
+
payload: ToMetaBoxMessageEnvelope;
|
|
155
167
|
target: ToMetaboxTarget;
|
|
168
|
+
apiVersion: string;
|
|
156
169
|
}
|
|
157
170
|
|
|
158
171
|
/**
|
|
@@ -502,7 +515,7 @@ type MetaboxEnvironment = 'metabox' | 'host';
|
|
|
502
515
|
* Used for signaling that the app is loaded and ready to open api.
|
|
503
516
|
*/
|
|
504
517
|
interface MCAppLoaded {
|
|
505
|
-
action:
|
|
518
|
+
action: typeof AppLoaded;
|
|
506
519
|
eventType?: unknown;
|
|
507
520
|
payload: {
|
|
508
521
|
appId: string;
|
|
@@ -517,9 +530,11 @@ interface MCAppLoaded {
|
|
|
517
530
|
type FromMetaBoxAPIEnvelope = {
|
|
518
531
|
[K in keyof FromMetaboxMessagePayloads]: MetaBoxApiEnvelope<K>;
|
|
519
532
|
}[keyof FromMetaboxMessagePayloads] | MCAppLoaded;
|
|
533
|
+
type FromMetaboxTarget = 'parent' | 'communicator';
|
|
520
534
|
interface FromMetaBoxMessage {
|
|
521
535
|
host: typeof Metabox;
|
|
522
536
|
envelope: FromMetaBoxAPIEnvelope;
|
|
537
|
+
target: FromMetaboxTarget;
|
|
523
538
|
}
|
|
524
539
|
|
|
525
540
|
/**
|
|
@@ -630,7 +645,6 @@ declare class Communicator extends EventDispatcher {
|
|
|
630
645
|
removeEventListener<T extends FromMetaBoxApiEvents>(messageType: T, callback: (data: FromMetaboxMessagePayloads[T]) => void): this;
|
|
631
646
|
/**
|
|
632
647
|
* Filters and dispatches incoming messages from the Metabox.
|
|
633
|
-
* @param messageType - Expected message type for filtering (MetaboxData).
|
|
634
648
|
* @param event - The postMessage event received on a window.
|
|
635
649
|
*/
|
|
636
650
|
private handleMessageReceived;
|
|
@@ -648,7 +662,7 @@ declare class Communicator extends EventDispatcher {
|
|
|
648
662
|
* @param {string} configuratorId - The Modular Configurator ID (not a full URL). It is appended to
|
|
649
663
|
* `https://{domain}/metabox-configurator/modular/{configuratorId}` to form the iframe src.
|
|
650
664
|
*
|
|
651
|
-
* @param {string}
|
|
665
|
+
* @param {string} containerId - The id of the container element where the iframe will be injected.
|
|
652
666
|
*
|
|
653
667
|
* @param {(api: Communicator) => void} apiReadyCallback - Called when the Communicator instance is created on the host side.
|
|
654
668
|
*
|
|
@@ -681,7 +695,7 @@ declare class Communicator extends EventDispatcher {
|
|
|
681
695
|
* },
|
|
682
696
|
* );
|
|
683
697
|
*/
|
|
684
|
-
declare function integrateMetabox(configuratorId: string, containerId: string
|
|
698
|
+
declare function integrateMetabox(configuratorId: string, containerId: string, apiReadyCallback: (api: Communicator) => void, config?: IntegrateMetaboxConfig): void;
|
|
685
699
|
|
|
686
700
|
/**
|
|
687
701
|
* Saves an image by triggering a download.
|
|
@@ -1140,7 +1154,7 @@ declare class GetScreenshot extends CommandBase {
|
|
|
1140
1154
|
}
|
|
1141
1155
|
|
|
1142
1156
|
/**
|
|
1143
|
-
* Represents a command to set a component by its data (ID, typeId
|
|
1157
|
+
* Represents a command to set a component by its data (ID, typeId).
|
|
1144
1158
|
*
|
|
1145
1159
|
* @remarks
|
|
1146
1160
|
* To listen for changes after sending this command, listen to the 'configuratorDataUpdated' event.
|
|
@@ -1162,7 +1176,7 @@ declare class GetScreenshot extends CommandBase {
|
|
|
1162
1176
|
* @param {Communicator} api - communicator instance api
|
|
1163
1177
|
* window.env3DSource.apiReady = (api: Communicator) => {
|
|
1164
1178
|
* api.sendCommandToMetabox(new SetComponent(
|
|
1165
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId'
|
|
1179
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId'
|
|
1166
1180
|
* ));
|
|
1167
1181
|
* };
|
|
1168
1182
|
*/
|
|
@@ -1172,9 +1186,8 @@ declare class SetComponent extends CommandBase {
|
|
|
1172
1186
|
*
|
|
1173
1187
|
* @param {string} id - The component ID.
|
|
1174
1188
|
* @param {string} typeId - The component type ID.
|
|
1175
|
-
* @param {boolean} isRoot - Whether this is a root component.
|
|
1176
1189
|
*/
|
|
1177
|
-
constructor(id: string, typeId: string
|
|
1190
|
+
constructor(id: string, typeId: string);
|
|
1178
1191
|
}
|
|
1179
1192
|
|
|
1180
1193
|
/**
|
|
@@ -1411,5 +1424,5 @@ declare class ForceSetDeviceType extends CommandBase {
|
|
|
1411
1424
|
constructor(deviceType: ApplicationDeviceTypes);
|
|
1412
1425
|
}
|
|
1413
1426
|
|
|
1414
|
-
export { AppLoaded, ApplyZoom, BasicRouteUrl, CommandBase, Communicator, EventDispatcher, ForceSetDeviceType, GetCallToActionInformation, GetCamera, GetPdf, GetScreenshot, HideMeasurement, InitShowcase, Metabox, MetaboxConfig,
|
|
1415
|
-
export type { ApplicationDeviceTypes, CameraCommandPayload, ComponentWithParent, Cta, EcomConfigurator, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxMessagePayloads, InitialModularConfigurator, IntegrateMetaboxConfig, Listener, MCAppLoaded, Material, MetaBoxApiEnvelope, MetaProperty, MetaboxCommandConfig, MetaboxEnvironment, MimeType, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, Product, SelectedIds, ShowCaseStatus, Showcase, Slot, Thumbnail, Timecode, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, ToMetaboxTarget, VideoResolution };
|
|
1427
|
+
export { AppLoaded, AppLoaded_V3, ApplyZoom, BasicRouteUrl, CommandBase, Communicator, EventDispatcher, ForceSetDeviceType, GetCallToActionInformation, GetCamera, GetPdf, GetScreenshot, HideMeasurement, InitShowcase, Metabox, MetaboxConfig, MetaboxDomain, MetaboxHost, MetaboxHost_V3, MetaboxModularConfiguratorActions, Metabox_V3, PauseShowcase, PlayShowcase, ResetCamera, SetCamera, SetComponent, SetComponentMaterial, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowMeasurement, ShowOverlayInterface, StopShowcase, UnrealCommand, VERSION, fromCommunicatorEvent, integrateMetabox, prepareIframeSrc, saveImage };
|
|
1428
|
+
export type { ApplicationDeviceTypes, CameraCommandPayload, ComponentWithParent, Cta, EcomConfigurator, Environment, FromMetaBoxAPIEnvelope, FromMetaBoxApiEvents, FromMetaBoxMessage, FromMetaboxMessagePayloads, FromMetaboxTarget, InitialModularConfigurator, IntegrateMetaboxConfig, Listener, MCAppLoaded, Material, MetaBoxApiEnvelope, MetaProperty, MetaboxCommandConfig, MetaboxEnvironment, MimeType, ModularConfiguratorComponent, ModularConfiguratorComponentType, ModularConfiguratorConnector, ModularConfiguratorEnvelope, ModularConfiguratorEnvironment, ModularConfiguratorVirtualSocketToConnector, Product, SelectedIds, ShowCaseStatus, Showcase, Slot, Thumbnail, Timecode, ToMetaBoxActions, ToMetaBoxMessage, ToMetaBoxMessageEnvelope, ToMetaboxMessagePayload, ToMetaboxMessagePayloads, ToMetaboxTarget, VideoResolution };
|