@3dsource/metabox-modular-configurator-api 0.0.1-dev.0 → 0.0.1-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ class CommandBase {
8
8
 
9
9
  /**
10
10
  * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.
11
- * @param target
11
+ * @param {Communicator} target
12
12
  * @param eventName
13
13
  */
14
14
  function fromCommunicatorEvent(target, eventName) {
@@ -24,7 +24,6 @@ const MetaboxModularConfiguratorActions = {
24
24
  sendCommandToUnreal: 'sendCommandToUnreal',
25
25
  getPdf: 'getPdf',
26
26
  getScreenshot: 'getScreenshot',
27
- watchCallbacks: 'watchCallbacks',
28
27
  showEmbeddedMenu: 'showEmbeddedMenu',
29
28
  forceSetDeviceType: 'forceSetDeviceType',
30
29
  showOverlayInterface: 'showOverlayInterface',
@@ -34,6 +33,17 @@ const MetaboxModularConfiguratorActions = {
34
33
  playShowcase: 'playShowcase',
35
34
  pauseShowcase: 'pauseShowcase',
36
35
  stopShowcase: 'stopShowcase',
36
+ watchCallbacks: 'watchCallbacks',
37
+ };
38
+
39
+ /**
40
+ * Defines the structure for an available showcase status for the current product on a scene.
41
+ */
42
+ const ShowCaseStatus = {
43
+ INIT: 'init',
44
+ PLAY: 'play',
45
+ PAUSE: 'pause',
46
+ STOP: 'stop',
37
47
  };
38
48
 
39
49
  /**
@@ -658,8 +668,8 @@ class Communicator extends EventDispatcher {
658
668
  * ```
659
669
  * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id?sidebar=false&introImage=https://example.com/image.png
660
670
  *
661
- * @param containerId - The ID of the layout element. Defaults to 'embed3DSource'.
662
- * @param apiReadyCallback
671
+ * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.
672
+ * @param apiReadyCallback
663
673
  * @throws Error if the container element with the specified ID is not found.
664
674
  *
665
675
  * @example
@@ -706,8 +716,8 @@ function integrateMetabox(iframeSrc, containerId = 'embed3DSource', apiReadyCall
706
716
  * This function creates an anchor element, sets its `href` attribute to the provided image URL,
707
717
  * and triggers a click event to initiate a download with the specified filename.
708
718
  *
709
- * @param imageUrl - The URL of the image to save.
710
- * @param filename - The name of the file to save.
719
+ * @param {string} imageUrl - The URL of the image to save.
720
+ * @param {string} filename - The name of the file to save.
711
721
  */
712
722
  function saveImage(imageUrl, filename) {
713
723
  const a = document.createElement('a');
@@ -724,7 +734,7 @@ function saveImage(imageUrl, filename) {
724
734
  * @remarks
725
735
  * This function returns a promise that resolves after the given number of milliseconds.
726
736
  *
727
- * @param time - The time to sleep in milliseconds.
737
+ * @param {number} time - The time to sleep in milliseconds.
728
738
  * @returns A promise that resolves after the specified duration.
729
739
  */
730
740
  function sleep(time) {
@@ -768,5 +778,5 @@ function getUrlParams() {
768
778
  * Generated bundle index. Do not edit.
769
779
  */
770
780
 
771
- export { ApplyZoom, CommandBase, Communicator, EventDispatcher, GetPdf, GetScreenshot, InitShowcase, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetComponent, SetComponentMaterial, SetComponentType, SetEnvironment, SetEnvironmentMaterial, ShowEmbeddedMenu, ShowOverlayInterface, StopShowcase, UnrealCommand, WatchCallbacks, fromCommunicatorEvent, getUrlParams, integrateMetabox, saveImage, setUrlParams, sleep };
781
+ export { ApplyZoom, CommandBase, Communicator, EventDispatcher, GetPdf, GetScreenshot, InitShowcase, MetaboxModularConfiguratorActions, PauseShowcase, PlayShowcase, ResetCamera, SetComponent, SetComponentMaterial, SetComponentType, SetEnvironment, SetEnvironmentMaterial, ShowCaseStatus, ShowEmbeddedMenu, ShowOverlayInterface, StopShowcase, UnrealCommand, WatchCallbacks, fromCommunicatorEvent, getUrlParams, integrateMetabox, saveImage, setUrlParams, sleep };
772
782
  //# sourceMappingURL=3dsource-metabox-modular-configurator-api.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"3dsource-metabox-modular-configurator-api.mjs","sources":["../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/CommandBase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/fromCommunicatorEvent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/interfaces/ToMetaboxMessagePayloads.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetPdf.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ResetCamera.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ApplyZoom.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/InitShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PlayShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PauseShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/StopShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetScreenshot.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentType.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironment.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironmentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowEmbeddedMenu.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowOverlayInterface.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/UnrealCommand.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/WatchCallbacks.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/event-dispatcher.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/communicator.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/integrate-metabox.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/saveImage.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/sleep.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/url-utils.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/3dsource-metabox-modular-configurator-api.ts"],"sourcesContent":["import type { ToMetaBoxMessageEnvelope } from '../interfaces';\n\n/**\n * Base class for commands sent to the Metabox.\n */\nexport class CommandBase {\n data!: ToMetaBoxMessageEnvelope;\n}\n","import type { Communicator } from '../helpers';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\nimport type { Observable } from 'rxjs';\nimport { fromEvent } from 'rxjs';\n\n/**\n * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.\n * @param target\n * @param eventName\n */\nexport function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(\n target: Communicator,\n eventName: T,\n) {\n return fromEvent(target, eventName) as Observable<\n FromMetaboxMessagePayloads[T]\n >;\n}\n","import type { MimeType } from '../actions';\nimport type { ApplicationDeviceTypes } from './application-device-types';\nimport type { MetaBoxCommandPacket } from '@3dsource/types-unreal';\n\nexport const MetaboxModularConfiguratorActions = {\n setEnvironment: 'setEnvironment',\n setEnvironmentMaterialById: 'setEnvironmentMaterialById',\n setComponent: 'setComponent',\n setComponentType: 'setComponentType',\n setComponentMaterialById: 'setComponentMaterialById',\n sendCommandToUnreal: 'sendCommandToUnreal',\n getPdf: 'getPdf',\n getScreenshot: 'getScreenshot',\n watchCallbacks: 'watchCallbacks',\n showEmbeddedMenu: 'showEmbeddedMenu',\n forceSetDeviceType: 'forceSetDeviceType',\n showOverlayInterface: 'showOverlayInterface',\n resetCamera: 'resetCamera',\n applyZoom: 'applyZoom',\n initShowcase: 'initShowcase',\n playShowcase: 'playShowcase',\n pauseShowcase: 'pauseShowcase',\n stopShowcase: 'stopShowcase',\n} as const;\n\nexport type ToMetaBoxActions =\n (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions];\n\n/**\n * @internal\n * @hidden\n */\nexport type ToMetaboxMessagePayload =\n ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads];\n\nexport type Test = Record<ToMetaBoxActions, object>;\n\n/**\n * Interface for messages sent from the application to the Metabox Modular Configurator.\n */\nexport interface ToMetaboxMessagePayloads {\n [MetaboxModularConfiguratorActions.setEnvironment]: { id: string };\n [MetaboxModularConfiguratorActions.setEnvironmentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.setComponentType]: { typeId: string };\n [MetaboxModularConfiguratorActions.setComponent]: {\n id: string;\n typeId: string;\n isRoot: boolean;\n };\n [MetaboxModularConfiguratorActions.setComponentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.sendCommandToUnreal]: MetaBoxCommandPacket;\n [MetaboxModularConfiguratorActions.getScreenshot]: {\n format: MimeType;\n size?: { x: number; y: number };\n };\n [MetaboxModularConfiguratorActions.getPdf]: void;\n [MetaboxModularConfiguratorActions.watchCallbacks]: void;\n [MetaboxModularConfiguratorActions.showEmbeddedMenu]: { visible: boolean };\n [MetaboxModularConfiguratorActions.showOverlayInterface]: {\n isVisible: boolean;\n };\n [MetaboxModularConfiguratorActions.forceSetDeviceType]: {\n deviceType: ApplicationDeviceTypes;\n };\n [MetaboxModularConfiguratorActions.resetCamera]: void;\n [MetaboxModularConfiguratorActions.applyZoom]: { zoom: number };\n [MetaboxModularConfiguratorActions.initShowcase]: { productId: string };\n [MetaboxModularConfiguratorActions.playShowcase]: void;\n [MetaboxModularConfiguratorActions.pauseShowcase]: void;\n [MetaboxModularConfiguratorActions.stopShowcase]: void;\n}\n\nexport interface ToMetaBoxMessageEnvelope {\n action: ToMetaBoxActions;\n payload?: ToMetaboxMessagePayload | never;\n}\n\nexport interface ToMetaBoxMessage {\n host: 'metaBoxHost';\n payload: ToMetaBoxMessageEnvelope;\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to get a PDF from Metabox.\n * @remarks\n * This class sends a message to the Metabox API to generate a PDF based on the current configuration.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new GetPdf());\n * };\n */\n\nexport class GetPdf extends CommandBase {\n /**\n * Creates an instance of GetPdf.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.getPdf };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to send to unreal and reset camera to initial.\n * @remarks\n * This class sends a message to the Metabox API to reset the camera on a scene.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new ResetCamera());\n * };\n */\n\nexport class ResetCamera extends CommandBase {\n /**\n * Creates an instance of ResetCamera.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.resetCamera };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to ApplyZoom and change zoom camera on a scene.\n * @remarks\n * This class sends a command to the Metabox API to change zoom on a scene.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new ApplyZoom(10));\n * api.sendCommandToMetaBox(new ApplyZoom(-10));\n * };\n */\n\nexport class ApplyZoom extends CommandBase {\n /**\n * Creates an instance of ApplyZoom.\n *\n * @param {...number} zoom\n */\n constructor(zoom: number) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.applyZoom,\n payload: { zoom },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Init Showcase for a product on a scene and start a sequence for the product.\n * @remarks\n * This class sends a command to the Metabox API to init showcase if the product has a sequence.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new InitShowcase('ffea6b5c-3a8a-4f56-9417-e605acb5cca3');\n * };\n */\n\nexport class InitShowcase extends CommandBase {\n /**\n * Creates an instance of InitShowcase.\n *\n * @param {string} productId\n */\n constructor(productId: string) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.initShowcase,\n payload: { productId },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Play Showcase for a product when it already init, and you call pause, for example, before it.\n * @remarks\n * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and pause.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PlayShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new PlayShowcase());\n * };\n */\n\nexport class PlayShowcase extends CommandBase {\n /**\n * Creates an instance of PlayShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.playShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Pause Showcase for a product when it already init and play, and you call pause.\n * @remarks\n * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and play.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PauseShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new PauseShowcase());\n * };\n */\n\nexport class PauseShowcase extends CommandBase {\n /**\n * Creates an instance of PauseShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.pauseShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Stop Showcase for a product when it already init, and you want to destroy it.\n * @remarks\n * This class sends a command to the Metabox API to Stop showcase for a product if it is already initialized.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { StopShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new StopShowcase());\n * };\n */\n\nexport class StopShowcase extends CommandBase {\n /**\n * Creates an instance of StopShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.stopShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Image format.\n * @remarks\n * This type represents the allowed image formats.\n */\nexport type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';\n\n/**\n * Represents a command to get a screenshot.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * // Listen for events from to the Metabox API\n * api.addEventListener('screenshot', (data) => {\n * // Process the get screenshot response\n * saveImage(data, 'Render.png');\n * });\n * api.sendCommandToMetaBox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));\n * };\n */\nexport class GetScreenshot extends CommandBase {\n /**\n * Constructs an instance of GetScreenshot.\n * @param {MimeType} mimeType - The output format.\n * @param {{ x: number; y: number }} [size] - Optional size in pixels.\n */\n constructor(mimeType: MimeType, size?: { x: number; y: number }) {\n super();\n this.data = {\n payload: { format: mimeType, size },\n action: MetaboxModularConfiguratorActions.getScreenshot,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component by its data (ID, typeId, isRoot).\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component using the provided component ID and its component type data.\n *\n * @example\n * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new SetComponent(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId', true\n * ));\n * };\n */\nexport class SetComponent extends CommandBase {\n /**\n * Creates an instance of SetComponent.\n *\n * @param {string} id\n * @param {string} typeId\n * @param {boolean} isRoot\n */\n constructor(id: string, typeId: string, isRoot: boolean) {\n super();\n this.data = {\n payload: { id, typeId, isRoot },\n action: MetaboxModularConfiguratorActions.setComponent,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set component material by its slot ID and Material ID.\n *\n * @example\n * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new SetComponentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetComponentMaterial extends CommandBase {\n /**\n * Creates an instance of SetComponentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setComponentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component type by its ID.\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component type using the provided component type ID.\n *\n * @example\n * import { SetComponentType, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new SetComponentType(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'\n * ));\n * };\n */\nexport class SetComponentType extends CommandBase {\n /**\n * Creates an instance of SetComponentType.\n *\n * @param {string} typeId\n */\n constructor(typeId: string) {\n super();\n this.data = {\n payload: { typeId },\n action: MetaboxModularConfiguratorActions.setComponentType,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set the environment by its ID.\n *\n * @example\n * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * // Change the environment to '55555555-1234-1234-1234-01234567890'\n * api.sendCommandToMetaBox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));\n * };\n */\nexport class SetEnvironment extends CommandBase {\n /**\n * Creates an instance of SetEnvironment.\n *\n * @param {string} environmentId - The environment ID.\n */\n constructor(environmentId: string) {\n super();\n this.data = {\n payload: { id: environmentId },\n action: MetaboxModularConfiguratorActions.setEnvironment,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set an environment material by its slot ID and Material ID.\n *\n * @example\n * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new SetEnvironmentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetEnvironmentMaterial extends CommandBase {\n /**\n * Creates an instance of SetEnvironmentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setEnvironmentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Embedded to the Metabox Menu.\n *\n * @example\n * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new ShowEmbeddedMenu(true));\n * };\n */\nexport class ShowEmbeddedMenu extends CommandBase {\n /**\n * Creates an instance of ShowEmbeddedMenu.\n *\n * @param {boolean} visible - A flag indicating whether the embedded menu should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showEmbeddedMenu,\n payload: { visible },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Unreal Overlay Interface Menu.\n *\n * @remarks\n * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI.\n *\n * @example\n * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new ShowOverlayInterface(true));\n * };\n */\nexport class ShowOverlayInterface extends CommandBase {\n /**\n * Creates an instance of ShowOverlayInterface.\n *\n * @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showOverlayInterface,\n payload: { visible },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport type { MetaBoxCommandPacket } from '@3dsource/types-unreal';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * @internal\n * @hidden\n * Represents a command to send Unreal command.\n */\nexport class UnrealCommand extends CommandBase {\n constructor(payload: MetaBoxCommandPacket) {\n super();\n this.data = {\n payload,\n action: MetaboxModularConfiguratorActions.sendCommandToUnreal,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * @experimental\n * @internal\n * @hidden\n * @remarks\n * Represents a command to watch Unreal callbacks from Unreal engine.\n * Can be useful for custom solutions.\n */\nexport class WatchCallbacks extends CommandBase {\n /**\n * Creates an instance of WatchCallbacks.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.watchCallbacks };\n }\n}\n","/**\n * Represents a callback listener for specific message types.\n */\ninterface Listener {\n messageType: string;\n callback: (data: unknown) => void;\n}\n\n/**\n * EventDispatcher is a class that manages event listeners and dispatches events to them.\n */\nexport class EventDispatcher {\n /**\n * Storage for callback listeners by message type.\n */\n listeners: Listener[] = [];\n\n destroy() {\n this.listeners = [];\n }\n\n /**\n * Adds an event listener for receiving specific types of messages.\n *\n * @param 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 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 messageType - The message type.\n * @param callback - The callback function to remove.\n */\n removeEventListener(\n messageType: string,\n callback: (data: unknown) => void,\n ): this {\n this.listeners = this.listeners.filter(\n (listener) =>\n !(\n listener.messageType === messageType && listener.callback === callback\n ),\n );\n return this;\n }\n}\n","import { EventDispatcher } from './event-dispatcher';\nimport type { CommandBase } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\n\n/**\n * Handles messaging between the host page and embedded to the Metabox content.\n * @internal Use {@link Communicator.createInstance} or the {@link integrateMetaBox} helper to instantiate.\n */\nexport class Communicator extends EventDispatcher {\n /**\n * Singleton reference to the current communicator instance.\n */\n public static instance: Communicator | null = null;\n /**\n * Bound handler for incoming postMessage events.\n */\n private binder = this.handleMessageReceived.bind(this, 'metaboxData');\n\n /**\n * Constructs a Communicator, replacing any existing instance, and begins listening for messages.\n * @internal\n */\n constructor() {\n super();\n Communicator.instance?.destroy();\n Communicator.instance = this;\n window.addEventListener('message', this.binder);\n }\n\n /**\n * Listens for to the Metabox to signal readiness, then initializes communicator.\n * @param apiReadyCallback - Called with the new Communicator once to the Metabox is loaded.\n */\n static createInstance(apiReadyCallback: (api: Communicator) => void): void {\n const startHandler = (event: MessageEvent): void => {\n const message = event.data as FromMetaBoxMessage;\n if (message?.envelope?.action === 'appLoaded') {\n apiReadyCallback(new Communicator());\n window.removeEventListener('message', startHandler);\n }\n };\n\n window.addEventListener('message', startHandler);\n }\n\n /**\n * Cleans up resources and stops listening for messages.\n */\n public override destroy(): void {\n super.destroy();\n window.removeEventListener('message', this.binder);\n }\n\n /**\n * Posts a command to the Metabox iframe.\n * @param command - An action command containing data to send.\n */\n public sendCommandToMetaBox<T extends CommandBase>(command: T): void {\n const { data } = command;\n const iframe = document.getElementById(\n 'embeddedContent',\n ) as HTMLIFrameElement;\n\n if (!iframe?.contentWindow) {\n console.warn('to the Metabox IFrame not found or not ready.');\n return;\n }\n\n const message = {\n host: 'metaBoxHost',\n payload: { ...data },\n };\n\n // Replace '*' with a specific origin in production for better security.\n iframe.contentWindow.postMessage(message, '*');\n }\n\n /**\n * Registers an event listener for messages dispatched by Metabox.\n * @override\n */\n override addEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.addEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Dispatches a typed event to all registered listeners.\n * @override\n */\n override dispatchEvent<T extends FromMetaBoxApiEvents>(\n messageType: T,\n data: FromMetaboxMessagePayloads[T],\n ) {\n return super.dispatchEvent(messageType, data);\n }\n\n /**\n * Removes a previously registered event listener.\n * @override\n */\n override removeEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.removeEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Filters and dispatches incoming messages from to the Metabox.\n * @param messageType - Expected message type for filtering ('metaboxData').\n * @param event - The postMessage event received on window.\n */\n private handleMessageReceived<T extends FromMetaBoxApiEvents>(\n messageType: T | 'metaboxData',\n event: MessageEvent,\n ): void {\n // Optionally validate event.origin for security.\n if (messageType !== 'metaboxData' || event.data?.host !== 'metabox') {\n return;\n }\n\n const { eventType, payload } = event.data.payload;\n this.dispatchEvent(eventType as T, payload);\n }\n}\n","import { Communicator } from './communicator';\n\n/**\n * Integrates Metabox Modular Configurator into the provided layout.\n *\n * @remarks\n * This function injects an iframe into a specified container element in the DOM and initializes\n * the communicator for interacting with the Metabox embedded content.\n *\n * @param iframeSrc - The source URL of the Metabox iframe.\n * Additional url parameters:\n * ```javascript\n * sidebar=false - disables the internal Metabox menu\n * introImage=https://example.com/image.png - sets the intro image\n * ```\n * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id?sidebar=false&introImage=https://example.com/image.png\n *\n * @param containerId - The ID of the layout element. Defaults to 'embed3DSource'.\n * @param apiReadyCallback\n * @throws Error if the container element with the specified ID is not found.\n *\n * @example\n * import {\n * integrateMetaBox,\n * } from '@3dsource/metabox-modular-configurator-api';\n *\n * integrateMetaBox(\n * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',\n * 'embed3DSource'\n * );\n */\nexport function integrateMetabox(\n iframeSrc: string,\n containerId = 'embed3DSource',\n apiReadyCallback: (api: Communicator) => void,\n): void {\n const container = document.getElementById(containerId);\n if (!container) {\n throw new Error(`Container element with id ${containerId} not found`);\n }\n\n Communicator.createInstance(apiReadyCallback);\n\n const style = document.createElement('style');\n style.innerHTML = `\n #${containerId} {\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n }\n `;\n document.head.appendChild(style);\n\n const iframe = document.createElement('iframe');\n iframe.setAttribute('referrerPolicy', 'no-referrer-when-downgrade');\n iframe.setAttribute('id', 'embeddedContent');\n iframe.style.border = '0';\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.overflow = 'hidden';\n iframe.src = iframeSrc;\n container.appendChild(iframe);\n}\n","/**\n * Saves an image by triggering a download.\n *\n * @remarks\n * This function creates an anchor element, sets its `href` attribute to the provided image URL,\n * and triggers a click event to initiate a download with the specified filename.\n *\n * @param imageUrl - The URL of the image to save.\n * @param 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 * Pauses execution for a specified duration.\n *\n * @remarks\n * This function returns a promise that resolves after the given number of milliseconds.\n *\n * @param time - The time to sleep in milliseconds.\n * @returns A promise that resolves after the specified duration.\n */\nexport function sleep(time: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, time));\n}\n","/**\n * Sets the URL parameters based on the provided state.\n *\n * @remarks\n * This function updates the current URL by replacing its search parameters with the key-value pairs from the provided state object.\n *\n * @param state - An object containing key-value pairs to set as URL parameters.\n */\nexport function setUrlParams(state: Record<string, string>): void {\n const url = new URL(window.location.href);\n url.search = '';\n Object.entries(state).forEach(([key, value]) => {\n url.searchParams.set(key, value);\n });\n history.replaceState(null, '', url.toString());\n}\n\n/**\n * Retrieves the URL parameters as an object.\n *\n * @remarks\n * This function parses the current URL's search parameters and returns them as a key-value object.\n *\n * @returns An object containing the URL parameters.\n */\nexport function getUrlParams(): Record<string, string> {\n const urlParams = new URLSearchParams(window.location.search);\n const selections: Record<string, string> = {};\n urlParams.forEach((value, key) => {\n selections[key] = value;\n });\n return selections;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;AAEG;MACU,WAAW,CAAA;AAEvB;;ACCD;;;;AAIG;AACG,SAAU,qBAAqB,CACnC,MAAoB,EACpB,SAAY,EAAA;AAEZ,IAAA,OAAO,SAAS,CAAC,MAAM,EAAE,SAAS,CAEjC;AACH;;AChBO,MAAM,iCAAiC,GAAG;AAC/C,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,wBAAwB,EAAE,0BAA0B;AACpD,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,cAAc;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AAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC,KAAK,EAAE;AACT,IAAA,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;AAC9B;;ACjBA;;;;;;;;AAQG;AACG,SAAU,KAAK,CAAC,IAAY,EAAA;AAChC,IAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5D;;ACXA;;;;;;;AAOG;AACG,SAAU,YAAY,CAAC,KAA6B,EAAA;IACxD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AACzC,IAAA,GAAG,CAAC,MAAM,GAAG,EAAE;AACf,IAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;QAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AAClC,KAAC,CAAC;AACF,IAAA,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;AAChD;AAEA;;;;;;;AAOG;SACa,YAAY,GAAA;IAC1B,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC7D,MAAM,UAAU,GAA2B,EAAE;IAC7C,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,KAAI;AAC/B,QAAA,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK;AACzB,KAAC,CAAC;AACF,IAAA,OAAO,UAAU;AACnB;;AChCA;;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/interfaces/modular-configurator.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetPdf.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ResetCamera.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ApplyZoom.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/InitShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PlayShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/PauseShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/StopShowcase.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/GetScreenshot.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponent.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetComponentType.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironment.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/SetEnvironmentMaterial.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowEmbeddedMenu.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/ShowOverlayInterface.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/UnrealCommand.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/actions/WatchCallbacks.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/event-dispatcher.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/communicator.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/integrate-metabox.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/saveImage.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/sleep.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/lib/helpers/url-utils.ts","../../../../projects/3dsource/metabox-modular-configurator-api/src/3dsource-metabox-modular-configurator-api.ts"],"sourcesContent":["import type { ToMetaBoxMessageEnvelope } from '../interfaces';\n\n/**\n * Base class for commands sent to the Metabox.\n */\nexport class CommandBase {\n data!: ToMetaBoxMessageEnvelope;\n}\n","import type { Communicator } from '../helpers';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\nimport type { Observable } from 'rxjs';\nimport { fromEvent } from 'rxjs';\n\n/**\n * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.\n * @param {Communicator} target\n * @param eventName\n */\nexport function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(\n target: Communicator,\n eventName: T,\n) {\n return fromEvent(target, eventName) as Observable<\n FromMetaboxMessagePayloads[T]\n >;\n}\n","import type { MimeType } from '../actions';\nimport type { ApplicationDeviceTypes } from './application-device-types';\nimport type { MetaBoxCommandPacket } from '@3dsource/types-unreal';\n\nexport const MetaboxModularConfiguratorActions = {\n setEnvironment: 'setEnvironment',\n setEnvironmentMaterialById: 'setEnvironmentMaterialById',\n setComponent: 'setComponent',\n setComponentType: 'setComponentType',\n setComponentMaterialById: 'setComponentMaterialById',\n sendCommandToUnreal: 'sendCommandToUnreal',\n getPdf: 'getPdf',\n getScreenshot: 'getScreenshot',\n showEmbeddedMenu: 'showEmbeddedMenu',\n forceSetDeviceType: 'forceSetDeviceType',\n showOverlayInterface: 'showOverlayInterface',\n resetCamera: 'resetCamera',\n applyZoom: 'applyZoom',\n initShowcase: 'initShowcase',\n playShowcase: 'playShowcase',\n pauseShowcase: 'pauseShowcase',\n stopShowcase: 'stopShowcase',\n watchCallbacks: 'watchCallbacks',\n} as const;\n\nexport type ToMetaBoxActions =\n (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions];\n\n/**\n * @internal\n * @hidden\n */\nexport type ToMetaboxMessagePayload =\n ToMetaboxMessagePayloads[keyof ToMetaboxMessagePayloads];\n\nexport type Test = Record<ToMetaBoxActions, object>;\n\n/**\n * Interface for messages sent from the application to the Metabox Modular Configurator.\n */\nexport interface ToMetaboxMessagePayloads {\n [MetaboxModularConfiguratorActions.setEnvironment]: { id: string };\n [MetaboxModularConfiguratorActions.setEnvironmentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.setComponentType]: { typeId: string };\n [MetaboxModularConfiguratorActions.setComponent]: {\n id: string;\n typeId: string;\n isRoot: boolean;\n };\n [MetaboxModularConfiguratorActions.setComponentMaterialById]: {\n slotId: string;\n materialId: string;\n };\n [MetaboxModularConfiguratorActions.sendCommandToUnreal]: MetaBoxCommandPacket;\n [MetaboxModularConfiguratorActions.getScreenshot]: {\n format: MimeType;\n size?: { x: number; y: number };\n };\n [MetaboxModularConfiguratorActions.getPdf]: void;\n [MetaboxModularConfiguratorActions.watchCallbacks]: void;\n [MetaboxModularConfiguratorActions.showEmbeddedMenu]: { visible: boolean };\n [MetaboxModularConfiguratorActions.showOverlayInterface]: {\n visible: boolean;\n };\n [MetaboxModularConfiguratorActions.forceSetDeviceType]: {\n deviceType: ApplicationDeviceTypes;\n };\n [MetaboxModularConfiguratorActions.resetCamera]: void;\n [MetaboxModularConfiguratorActions.applyZoom]: { zoom: number };\n [MetaboxModularConfiguratorActions.initShowcase]: { productId: string };\n [MetaboxModularConfiguratorActions.playShowcase]: void;\n [MetaboxModularConfiguratorActions.pauseShowcase]: void;\n [MetaboxModularConfiguratorActions.stopShowcase]: void;\n}\n\nexport interface ToMetaBoxMessageEnvelope {\n action: ToMetaBoxActions;\n payload?: ToMetaboxMessagePayload | never;\n}\n\nexport interface ToMetaBoxMessage {\n host: 'metaBoxHost';\n payload: ToMetaBoxMessageEnvelope;\n}\n","/**\n * Represents a modular configurator object with its configuration, selected materials,\n * product identifier, and associated environment.\n */\nexport interface ModularConfiguratorEnvelope {\n /**\n * A reference to the universal configurator.\n */\n configurator: ModularConfigurator;\n\n /**\n * The unique product identifier.\n */\n productId: string;\n\n /**\n * A record mapping product material selections.\n */\n\n productMaterialsIds: SelectedIds;\n\n /**\n * The unique environment identifier.\n */\n environmentId: string;\n\n /**\n * A record mapping environment material selections.\n */\n environmentMaterialsIds: SelectedIds;\n}\n\n/**\n * Represents the universal configurator with its modular properties and components.\n */\nexport interface ModularConfigurator {\n /** Unique identifier for the configurator. */\n id: string;\n /** Indicates if the configurator is active. */\n //isActive: boolean;\n /** Label for the product collection. */\n productCollectionLabel: string;\n /** The name of the configurator. */\n name: string;\n /** The camera settings used in the configurator. */\n //camera: Camera;\n /** Client information associated with the configurator. */\n //client: Client;\n /** A list of products for the configurator. */\n products: UniversalConfiguratorProduct[];\n /** A list of available environments. */\n environments: UniversalConfiguratorEnvironment[];\n /** GraphQL typename for the configurator. */\n __typename: 'UniversalConfigurator';\n}\n\n/**\n * Defines the camera configuration for the configurator.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Camera {\n /** Camera mode as a string value. */\n mode: string;\n /** Field of view of the camera. */\n fov: number;\n /** The position of the camera in 3D space. */\n position: Position;\n /** The rotation settings of the camera. */\n rotation: Rotation;\n /** Restrictions applied to the camera settings. */\n restrictions: Restrictions;\n /** GraphQL typename for the camera. */\n __typename: 'Camera';\n}\n\n/**\n * Defines a 3D position with x, y, and z coordinates.\n */\ninterface Position {\n /** X-coordinate value. */\n x: number;\n /** Y-coordinate value. */\n y: number;\n /** Z-coordinate value. */\n z: number;\n /** GraphQL typename for the position. */\n __typename: 'Position';\n}\n\n/**\n * Defines rotation parameters for a 3D object.\n */\ninterface Rotation {\n /** Rotation pitch. */\n pitch: number;\n /** Rotation yaw. */\n yaw: number;\n /** Rotation roll. */\n roll: number;\n /** GraphQL typename for the rotation. */\n __typename: 'Rotation';\n}\n\n/**\n * Specifies camera restrictions like zoom and pitch/yaw limits.\n */\ninterface Restrictions {\n /** Maximum zoom level (if applicable). */\n maxZoom?: null;\n /** Minimum zoom level allowed. */\n minZoom: number;\n /** Minimum pitch allowed. */\n minPitch: number;\n /** Maximum pitch allowed. */\n maxPitch: number;\n /** Maximum yaw allowed (if applicable). */\n maxYaw?: null;\n /** Minimum yaw allowed (if applicable). */\n minYaw?: null;\n /** Radius for pan boundaries (if applicable). */\n panBoundariesRadius?: null;\n /** Box boundaries for pan (if applicable). */\n panBoundariesBox?: null;\n /** GraphQL typename for the restrictions. */\n __typename: 'Restrictions';\n}\n\n/**\n * Contains client-specific information.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Client {\n /** Unique identifier for the client. */\n id: string;\n /** The name of the client. */\n name: string;\n /** The Unreal Engine version used by the client. */\n unrealVersion: string;\n /** Indicates if public assets are available. */\n hasPublicAssets: boolean;\n /** GraphQL typename for the client. */\n __typename: 'Client';\n}\n\n/**\n * Represents a product within the universal configurator.\n */\nexport interface UniversalConfiguratorProduct {\n /** The product's unique identifier. */\n productId: string;\n /** Position index of the product. */\n position: number;\n /** Display label for the product. */\n label: string;\n /** Optional camera settings for the product. */\n //camera?: null;\n /** The detailed product information. */\n product: Product;\n /** GraphQL typename for the product. */\n __typename: 'UniversalConfiguratorProduct';\n}\n\n/**\n * Represents product details including visual assets and configuration.\n */\nexport interface Product {\n /** The title of the product. */\n title: string;\n /** List of thumbnails for the product. */\n thumbnailList: Thumbnail[];\n /** Available slots for the product. */\n slots: Slot[];\n /** List of metaProperties for the product (optional). */\n metaProperties: MetaProperty[];\n /** The model information associated with the product. */\n //model: Model;\n /** Unique identifier for the product. */\n id: string;\n /** Unique external id for the product. */\n externalId: string;\n /** Showcase details for the product. */\n //showcase: Showcase;\n /** GraphQL typename for the product. */\n __typename: 'Product';\n}\n\n/**\n * Represents a thumbnail image entity with dimensions and URL path.\n */\nexport interface Thumbnail {\n /** Width of the thumbnail. */\n width: number;\n /** Height of the thumbnail. */\n height: number;\n /** URL path to the thumbnail image. */\n urlPath: string;\n /** GraphQL typename (as a string, flexible type). */\n __typename: 'Thumbnail';\n}\n\n/**\n * Represents a slot within a product that may allow material customization.\n */\nexport interface Slot {\n /** Unique identifier for the slot. */\n id: string;\n /** Display a label for the slot. */\n label: string;\n /** A list of enabled materials for the slot. */\n enabledMaterials: Material[];\n /** GraphQL typename for the slot. */\n __typename: 'Slot';\n}\n\n/**\n * Represents a metaProperty within a product that may allow business logic customization.\n */\nexport interface MetaProperty {\n /** Unique identifier for the metaProperty. */\n id: string;\n /** Display the name for the metaProperty. */\n name: string;\n /** Value for the metaProperty. */\n value: string;\n /** Type for the metaProperty. */\n type: string;\n /** GraphQL typename for the metaProperty. */\n __typename: 'MetaProperty';\n}\n\n/**\n * Represents a material that can be applied to a product slot.\n */\nexport interface Material {\n /** Unique identifier for the material. */\n id: string;\n /** Title or name of the material. */\n title: string;\n /** Unique external id for the material. */\n externalId: string;\n /** List of thumbnails for the material. */\n thumbnailList: Thumbnail[];\n /** The model information associated with the material. */\n //model: Model;\n /** GraphQL typename for the material. */\n __typename: 'Material';\n}\n\n/**\n * Defines model details for products or materials.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Model {\n /** Unique identifier for the model. */\n id: string;\n /** Path to the pak file for the model. */\n pakFilePath: string;\n /** Asset path for the model. */\n assetPath: string;\n /** Unreal Engine version required for the model. */\n unrealVersion: string;\n /** GraphQL typename for the model. */\n __typename: 'Model';\n}\n\n/**\n * Details showcase the presentation of a product.\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\ninterface Showcase {\n /** A list of low-bandwidth versions for the showcase (optional). */\n lowBandwidth?: (Timecode | null)[] | null;\n /** Duration for the showcase (optional). */\n duration?: null;\n /** GraphQL typename for the showcase. */\n __typename: 'Showcase';\n}\n\n/**\n * Represents a low bandwidth entity used in showcases in LBM mode.\n */\ninterface Timecode {\n /** Time marker for the entity. */\n time: number;\n /** Duration of the entity display. */\n duration: number;\n /** GraphQL typename (as a string, flexible type). */\n __typename: 'Timecode';\n}\n\n/**\n * Represents the environment settings for a universal configurator.\n */\nexport interface UniversalConfiguratorEnvironment {\n /** Unique identifier for the environment. */\n environmentId: string;\n /** Position index of the environment. */\n position: number;\n /** Display label for the environment. */\n label: string;\n /** Detailed environment configuration. */\n environment: Environment;\n /** GraphQL typename for the environment. */\n __typename: 'UniversalConfiguratorEnvironment';\n}\n\n/**\n * Represents an environment with associated media and configuration.\n */\nexport interface Environment {\n /** Unique identifier for the environment. */\n id: string;\n /** Title or name of the environment. */\n title: string;\n /** Flag indicating if UDS is enabled. */\n //udsEnabled: boolean;\n /** The north yaw of the sun in the environment. */\n //sunNorthYaw: number;\n /** The UDS hour setting for the environment. */\n //udsHour: number;\n /** GraphQL typename for the environment. */\n __typename: 'Environment';\n /** List of thumbnails for the environment (optional). */\n thumbnailList: Thumbnail[];\n /** List of slots for the environment (optional). */\n slots: Slot[];\n /** The model associated with the environment. */\n //model: Model;\n}\n\n/**\n * Defines the structure for a mapping of selected materials.\n */\nexport type SelectedIds = Record<string, Record<string, string>>;\n\n/**\n * Defines the structure for an available showcase status for the current product on a scene.\n */\nexport const ShowCaseStatus = {\n INIT: 'init',\n PLAY: 'play',\n PAUSE: 'pause',\n STOP: 'stop',\n} as const;\n\nexport type ShowCaseStatusKeys =\n (typeof ShowCaseStatus)[keyof typeof ShowCaseStatus];\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to get a PDF from Metabox.\n * @remarks\n * This class sends a message to the Metabox API to generate a PDF based on the current configuration.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetPdf, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new GetPdf());\n * };\n */\n\nexport class GetPdf extends CommandBase {\n /**\n * Creates an instance of GetPdf.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.getPdf };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to send to unreal and reset camera to initial.\n * @remarks\n * This class sends a message to the Metabox API to reset the camera on a scene.\n * This action does not require any parameters.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ResetCamera, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new ResetCamera());\n * };\n */\n\nexport class ResetCamera extends CommandBase {\n /**\n * Creates an instance of ResetCamera.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.resetCamera };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to ApplyZoom and change zoom camera on a scene.\n * @remarks\n * This class sends a command to the Metabox API to change zoom on a scene.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new ApplyZoom(10));\n * api.sendCommandToMetaBox(new ApplyZoom(-10));\n * };\n */\n\nexport class ApplyZoom extends CommandBase {\n /**\n * Creates an instance of ApplyZoom.\n *\n * @param {...number} zoom\n */\n constructor(zoom: number) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.applyZoom,\n payload: { zoom },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Init Showcase for a product on a scene and start a sequence for the product.\n * @remarks\n * This class sends a command to the Metabox API to init showcase if the product has a sequence.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { InitShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new InitShowcase('ffea6b5c-3a8a-4f56-9417-e605acb5cca3');\n * };\n */\n\nexport class InitShowcase extends CommandBase {\n /**\n * Creates an instance of InitShowcase.\n *\n * @param {string} productId\n */\n constructor(productId: string) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.initShowcase,\n payload: { productId },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Play Showcase for a product when it already init, and you call pause, for example, before it.\n * @remarks\n * This class sends a command to the Metabox API to play showcase for a product if it is already initialized and pause.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PlayShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new PlayShowcase());\n * };\n */\n\nexport class PlayShowcase extends CommandBase {\n /**\n * Creates an instance of PlayShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.playShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Pause Showcase for a product when it already init and play, and you call pause.\n * @remarks\n * This class sends a command to the Metabox API to pause showcase for a product if it is already initialized and play.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { PauseShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new PauseShowcase());\n * };\n */\n\nexport class PauseShowcase extends CommandBase {\n /**\n * Creates an instance of PauseShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.pauseShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to Stop Showcase for a product when it already init, and you want to destroy it.\n * @remarks\n * This class sends a command to the Metabox API to Stop showcase for a product if it is already initialized.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { StopShowcase, Communicator } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new StopShowcase());\n * };\n */\n\nexport class StopShowcase extends CommandBase {\n /**\n * Creates an instance of StopShowcase.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.stopShowcase };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Image format.\n * @remarks\n * This type represents the allowed image formats.\n */\nexport type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';\n\n/**\n * Represents a command to get a screenshot.\n *\n * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.\n *\n * @example\n * import { GetScreenshot, Communicator, saveImage } from '@3dsource/metabox-modular-configurator-api';\n * window.env3DSource.apiReady = (api:Communicator) => {\n * // Listen for events from to the Metabox API\n * api.addEventListener('screenshot', (data) => {\n * // Process the get screenshot response\n * saveImage(data, 'Render.png');\n * });\n * api.sendCommandToMetaBox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));\n * };\n */\nexport class GetScreenshot extends CommandBase {\n /**\n * Constructs an instance of GetScreenshot.\n * @param {MimeType} mimeType - The output format.\n * @param {{ x: number; y: number }} [size] - Optional size in pixels.\n */\n constructor(mimeType: MimeType, size?: { x: number; y: number }) {\n super();\n this.data = {\n payload: { format: mimeType, size },\n action: MetaboxModularConfiguratorActions.getScreenshot,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component by its data (ID, typeId, isRoot).\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component using the provided component ID and its component type data.\n *\n * @example\n * import { SetComponent, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new SetComponent(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId', true\n * ));\n * };\n */\nexport class SetComponent extends CommandBase {\n /**\n * Creates an instance of SetComponent.\n *\n * @param {string} id\n * @param {string} typeId\n * @param {boolean} isRoot\n */\n constructor(id: string, typeId: string, isRoot: boolean) {\n super();\n this.data = {\n payload: { id, typeId, isRoot },\n action: MetaboxModularConfiguratorActions.setComponent,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set component material by its slot ID and Material ID.\n *\n * @example\n * import { SetComponentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new SetComponentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetComponentMaterial extends CommandBase {\n /**\n * Creates an instance of SetComponentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setComponentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set a component type by its ID.\n *\n * @remarks\n * This action sends a message to the Metabox API to set a component type using the provided component type ID.\n *\n * @example\n * import { SetComponentType, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new SetComponentType(\n * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'\n * ));\n * };\n */\nexport class SetComponentType extends CommandBase {\n /**\n * Creates an instance of SetComponentType.\n *\n * @param {string} typeId\n */\n constructor(typeId: string) {\n super();\n this.data = {\n payload: { typeId },\n action: MetaboxModularConfiguratorActions.setComponentType,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set the environment by its ID.\n *\n * @example\n * import { SetEnvironment, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * // Change the environment to '55555555-1234-1234-1234-01234567890'\n * api.sendCommandToMetaBox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));\n * };\n */\nexport class SetEnvironment extends CommandBase {\n /**\n * Creates an instance of SetEnvironment.\n *\n * @param {string} environmentId - The environment ID.\n */\n constructor(environmentId: string) {\n super();\n this.data = {\n payload: { id: environmentId },\n action: MetaboxModularConfiguratorActions.setEnvironment,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to set an environment material by its slot ID and Material ID.\n *\n * @example\n * import { SetEnvironmentMaterial, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.sendCommandToMetaBox(new SetEnvironmentMaterial(\n * 'carpaint',\n * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',\n * ));\n * };\n */\nexport class SetEnvironmentMaterial extends CommandBase {\n /**\n * Creates an instance of SetEnvironmentMaterial.\n *\n * @param {string} slotId - The slot ID.\n * @param {string} materialId - The material ID.\n */\n constructor(slotId: string, materialId: string) {\n super();\n this.data = {\n payload: { slotId, materialId },\n action: MetaboxModularConfiguratorActions.setEnvironmentMaterialById,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Embedded to the Metabox Menu.\n *\n * @example\n * import { ShowEmbeddedMenu, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new ShowEmbeddedMenu(true));\n * };\n */\nexport class ShowEmbeddedMenu extends CommandBase {\n /**\n * Creates an instance of ShowEmbeddedMenu.\n *\n * @param {boolean} visible - A flag indicating whether the embedded menu should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showEmbeddedMenu,\n payload: { visible },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * Represents a command to toggle the Unreal Overlay Interface Menu.\n *\n * @remarks\n * This action sends a message to the Metabox API to toggle the visibility of the Unreal overlay UI.\n *\n * @example\n * import { ShowOverlayInterface, Communicator } from '@3dsource/metabox-modular-configurator-api';\n *\n * //...Assume that the integration is already implemented\n * window.env3DSource.apiReady = (api:Communicator) => {\n * api.setCommandToMetaBox(new ShowOverlayInterface(true));\n * };\n */\nexport class ShowOverlayInterface extends CommandBase {\n /**\n * Creates an instance of ShowOverlayInterface.\n *\n * @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.\n */\n constructor(visible: boolean) {\n super();\n this.data = {\n action: MetaboxModularConfiguratorActions.showOverlayInterface,\n payload: { visible },\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport type { MetaBoxCommandPacket } from '@3dsource/types-unreal';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * @internal\n * @hidden\n * Represents a command to send Unreal command.\n */\nexport class UnrealCommand extends CommandBase {\n constructor(payload: MetaBoxCommandPacket) {\n super();\n this.data = {\n payload,\n action: MetaboxModularConfiguratorActions.sendCommandToUnreal,\n };\n }\n}\n","import { CommandBase } from './CommandBase';\nimport { MetaboxModularConfiguratorActions } from '../interfaces';\n\n/**\n * @experimental\n * @internal\n * @hidden\n * @remarks\n * Represents a command to watch Unreal callbacks from Unreal engine.\n * Can be useful for custom solutions.\n */\nexport class WatchCallbacks extends CommandBase {\n /**\n * Creates an instance of WatchCallbacks.\n *\n * @remarks\n * This constructor does not require any parameters.\n */\n constructor() {\n super();\n this.data = { action: MetaboxModularConfiguratorActions.watchCallbacks };\n }\n}\n","/**\n * Represents a callback listener for specific message types.\n */\ninterface Listener {\n messageType: string;\n callback: (data: unknown) => void;\n}\n\n/**\n * EventDispatcher is a class that manages event listeners and dispatches events to them.\n */\nexport class EventDispatcher {\n /**\n * Storage for callback listeners by message type.\n */\n listeners: Listener[] = [];\n\n destroy() {\n this.listeners = [];\n }\n\n /**\n * Adds an event listener for receiving specific types of messages.\n *\n * @param 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 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 messageType - The message type.\n * @param callback - The callback function to remove.\n */\n removeEventListener(\n messageType: string,\n callback: (data: unknown) => void,\n ): this {\n this.listeners = this.listeners.filter(\n (listener) =>\n !(\n listener.messageType === messageType && listener.callback === callback\n ),\n );\n return this;\n }\n}\n","import { EventDispatcher } from './event-dispatcher';\nimport type { CommandBase } from '../actions';\nimport type {\n FromMetaBoxApiEvents,\n FromMetaBoxMessage,\n FromMetaboxMessagePayloads,\n} from '../interfaces';\n\n/**\n * Handles messaging between the host page and embedded to the Metabox content.\n * @internal Use {@link Communicator.createInstance} or the {@link integrateMetaBox} helper to instantiate.\n */\nexport class Communicator extends EventDispatcher {\n /**\n * Singleton reference to the current communicator instance.\n */\n public static instance: Communicator | null = null;\n /**\n * Bound handler for incoming postMessage events.\n */\n private binder = this.handleMessageReceived.bind(this, 'metaboxData');\n\n /**\n * Constructs a Communicator, replacing any existing instance, and begins listening for messages.\n * @internal\n */\n constructor() {\n super();\n Communicator.instance?.destroy();\n Communicator.instance = this;\n window.addEventListener('message', this.binder);\n }\n\n /**\n * Listens for to the Metabox to signal readiness, then initializes communicator.\n * @param apiReadyCallback - Called with the new Communicator once to the Metabox is loaded.\n */\n static createInstance(apiReadyCallback: (api: Communicator) => void): void {\n const startHandler = (event: MessageEvent): void => {\n const message = event.data as FromMetaBoxMessage;\n if (message?.envelope?.action === 'appLoaded') {\n apiReadyCallback(new Communicator());\n window.removeEventListener('message', startHandler);\n }\n };\n\n window.addEventListener('message', startHandler);\n }\n\n /**\n * Cleans up resources and stops listening for messages.\n */\n public override destroy(): void {\n super.destroy();\n window.removeEventListener('message', this.binder);\n }\n\n /**\n * Posts a command to the Metabox iframe.\n * @param command - An action command containing data to send.\n */\n public sendCommandToMetaBox<T extends CommandBase>(command: T): void {\n const { data } = command;\n const iframe = document.getElementById(\n 'embeddedContent',\n ) as HTMLIFrameElement;\n\n if (!iframe?.contentWindow) {\n console.warn('to the Metabox IFrame not found or not ready.');\n return;\n }\n\n const message = {\n host: 'metaBoxHost',\n payload: { ...data },\n };\n\n // Replace '*' with a specific origin in production for better security.\n iframe.contentWindow.postMessage(message, '*');\n }\n\n /**\n * Registers an event listener for messages dispatched by Metabox.\n * @override\n */\n override addEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.addEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Dispatches a typed event to all registered listeners.\n * @override\n */\n override dispatchEvent<T extends FromMetaBoxApiEvents>(\n messageType: T,\n data: FromMetaboxMessagePayloads[T],\n ) {\n return super.dispatchEvent(messageType, data);\n }\n\n /**\n * Removes a previously registered event listener.\n * @override\n */\n override removeEventListener<T extends FromMetaBoxApiEvents>(\n messageType: T,\n callback: (data: FromMetaboxMessagePayloads[T]) => void,\n ) {\n return super.removeEventListener(\n messageType,\n callback as (data: unknown) => void,\n );\n }\n\n /**\n * Filters and dispatches incoming messages from to the Metabox.\n * @param messageType - Expected message type for filtering ('metaboxData').\n * @param event - The postMessage event received on window.\n */\n private handleMessageReceived<T extends FromMetaBoxApiEvents>(\n messageType: T | 'metaboxData',\n event: MessageEvent,\n ): void {\n // Optionally validate event.origin for security.\n if (messageType !== 'metaboxData' || event.data?.host !== 'metabox') {\n return;\n }\n\n const { eventType, payload } = event.data.payload;\n this.dispatchEvent(eventType as T, payload);\n }\n}\n","import { Communicator } from './communicator';\n\n/**\n * Integrates Metabox Modular Configurator into the provided layout.\n *\n * @remarks\n * This function injects an iframe into a specified container element in the DOM and initializes\n * the communicator for interacting with the Metabox embedded content.\n *\n * @param iframeSrc - The source URL of the Metabox iframe.\n * Additional url parameters:\n * ```javascript\n * sidebar=false - disables the internal Metabox menu\n * introImage=https://example.com/image.png - sets the intro image\n * ```\n * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id?sidebar=false&introImage=https://example.com/image.png\n *\n * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.\n * @param apiReadyCallback\n * @throws Error if the container element with the specified ID is not found.\n *\n * @example\n * import {\n * integrateMetaBox,\n * } from '@3dsource/metabox-modular-configurator-api';\n *\n * integrateMetaBox(\n * 'https://metabox.3dsource.com/metabox-configurator/modular/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',\n * 'embed3DSource'\n * );\n */\nexport function integrateMetabox(\n iframeSrc: string,\n containerId = 'embed3DSource',\n apiReadyCallback: (api: Communicator) => void,\n): void {\n const container = document.getElementById(containerId);\n if (!container) {\n throw new Error(`Container element with id ${containerId} not found`);\n }\n\n Communicator.createInstance(apiReadyCallback);\n\n const style = document.createElement('style');\n style.innerHTML = `\n #${containerId} {\n width: 100%;\n height: 100%;\n overflow: hidden;\n position: relative;\n }\n `;\n document.head.appendChild(style);\n\n const iframe = document.createElement('iframe');\n iframe.setAttribute('referrerPolicy', 'no-referrer-when-downgrade');\n iframe.setAttribute('id', 'embeddedContent');\n iframe.style.border = '0';\n iframe.style.width = '100%';\n iframe.style.height = '100%';\n iframe.style.overflow = 'hidden';\n iframe.src = iframeSrc;\n container.appendChild(iframe);\n}\n","/**\n * Saves an image by triggering a download.\n *\n * @remarks\n * This function creates an anchor element, sets its `href` attribute to the provided image URL,\n * and triggers a click event to initiate a download with the specified filename.\n *\n * @param {string} imageUrl - The URL of the image to save.\n * @param {string} filename - The name of the file to save.\n */\nexport function saveImage(imageUrl: string, filename: string): void {\n const a = document.createElement('a');\n a.href = imageUrl;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n}\n","/**\n * Pauses execution for a specified duration.\n *\n * @remarks\n * This function returns a promise that resolves after the given number of milliseconds.\n *\n * @param {number} time - The time to sleep in milliseconds.\n * @returns A promise that resolves after the specified duration.\n */\nexport function sleep(time: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, time));\n}\n","/**\n * Sets the URL parameters based on the provided state.\n *\n * @remarks\n * This function updates the current URL by replacing its search parameters with the key-value pairs from the provided state object.\n *\n * @param state - An object containing key-value pairs to set as URL parameters.\n */\nexport function setUrlParams(state: Record<string, string>): void {\n const url = new URL(window.location.href);\n url.search = '';\n Object.entries(state).forEach(([key, value]) => {\n url.searchParams.set(key, value);\n });\n history.replaceState(null, '', url.toString());\n}\n\n/**\n * Retrieves the URL parameters as an object.\n *\n * @remarks\n * This function parses the current URL's search parameters and returns them as a key-value object.\n *\n * @returns An object containing the URL parameters.\n */\nexport function getUrlParams(): Record<string, string> {\n const urlParams = new URLSearchParams(window.location.search);\n const selections: Record<string, string> = {};\n urlParams.forEach((value, key) => {\n selections[key] = value;\n });\n return selections;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEA;;AAEG;MACU,WAAW,CAAA;AAEvB;;ACCD;;;;AAIG;AACG,SAAU,qBAAqB,CACnC,MAAoB,EACpB,SAAY,EAAA;AAEZ,IAAA,OAAO,SAAS,CAAC,MAAM,EAAE,SAAS,CAEjC;AACH;;AChBO,MAAM,iCAAiC,GAAG;AAC/C,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,0BAA0B,EAAE,4BAA4B;AACxD,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,wBAAwB,EAAE,0BAA0B;AACpD,IAAA,mBAAmB,EAAE,qBAAqB;AAC1C,IAAA,MAAM,EAAE,QAAQ;AAChB,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,oBAAoB,EAAE,sBAAsB;AAC5C,IAAA,WAAW,EAAE,aAAa;AAC1B,IAAA,SAAS,EAAE,WAAW;AACtB,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,aAAa,EAAE,eAAe;AAC9B,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,cAAc,EAAE,gBAAgB;;;ACyTlC;;AAEG;AACI,MAAM,cAAc,GAAG;AAC5B,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,KAAK,EAAE,OAAO;AACd,IAAA,IAAI,EAAE,MAAM;;;ACnVd;;;;;;;;;;;;;AAaG;AAEG,MAAO,MAAO,SAAQ,WAAW,CAAA;AACrC;;;;;AAKG;AACH,IAAA,WAAA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C,IAAA,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC5D;;ACXA;;;;;;;AAOG;AACG,SAAU,YAAY,CAAC,KAA6B,EAAA;IACxD,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC;AACzC,IAAA,GAAG,CAAC,MAAM,GAAG,EAAE;AACf,IAAA,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,KAAI;QAC7C,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC;AAClC,KAAC,CAAC;AACF,IAAA,OAAO,CAAC,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;AAChD;AAEA;;;;;;;AAOG;SACa,YAAY,GAAA;IAC1B,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC7D,MAAM,UAAU,GAA2B,EAAE;IAC7C,SAAS,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,KAAI;AAC/B,QAAA,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK;AACzB,KAAC,CAAC;AACF,IAAA,OAAO,UAAU;AACnB;;AChCA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -15,7 +15,6 @@ declare const MetaboxModularConfiguratorActions: {
15
15
  readonly sendCommandToUnreal: "sendCommandToUnreal";
16
16
  readonly getPdf: "getPdf";
17
17
  readonly getScreenshot: "getScreenshot";
18
- readonly watchCallbacks: "watchCallbacks";
19
18
  readonly showEmbeddedMenu: "showEmbeddedMenu";
20
19
  readonly forceSetDeviceType: "forceSetDeviceType";
21
20
  readonly showOverlayInterface: "showOverlayInterface";
@@ -25,6 +24,7 @@ declare const MetaboxModularConfiguratorActions: {
25
24
  readonly playShowcase: "playShowcase";
26
25
  readonly pauseShowcase: "pauseShowcase";
27
26
  readonly stopShowcase: "stopShowcase";
27
+ readonly watchCallbacks: "watchCallbacks";
28
28
  };
29
29
  type ToMetaBoxActions = (typeof MetaboxModularConfiguratorActions)[keyof typeof MetaboxModularConfiguratorActions];
30
30
  /**
@@ -70,7 +70,7 @@ interface ToMetaboxMessagePayloads {
70
70
  visible: boolean;
71
71
  };
72
72
  [MetaboxModularConfiguratorActions.showOverlayInterface]: {
73
- isVisible: boolean;
73
+ visible: boolean;
74
74
  };
75
75
  [MetaboxModularConfiguratorActions.forceSetDeviceType]: {
76
76
  deviceType: ApplicationDeviceTypes;
@@ -321,7 +321,6 @@ interface FromMetaboxMessagePayloads {
321
321
  * Dispatches every time when Unreal is sending ordered render with new GetFastRender() command.
322
322
  */
323
323
  screenshot: string | null;
324
- fastRender: string | null;
325
324
  /**
326
325
  * @experimental
327
326
  * Dispatches every Unreal state is changing, including all unreal module state.
@@ -484,8 +483,8 @@ declare class Communicator extends EventDispatcher {
484
483
  * ```
485
484
  * i.e., a final link will look like https://metabox.3dsource.com/metabox-configurator/modular/your-configurator-id?sidebar=false&introImage=https://example.com/image.png
486
485
  *
487
- * @param containerId - The ID of the layout element. Defaults to 'embed3DSource'.
488
- * @param apiReadyCallback
486
+ * @param {string} containerId - The ID of the layout element. Defaults to 'embed3DSource'.
487
+ * @param apiReadyCallback
489
488
  * @throws Error if the container element with the specified ID is not found.
490
489
  *
491
490
  * @example
@@ -507,8 +506,8 @@ declare function integrateMetabox(iframeSrc: string, containerId: string | undef
507
506
  * This function creates an anchor element, sets its `href` attribute to the provided image URL,
508
507
  * and triggers a click event to initiate a download with the specified filename.
509
508
  *
510
- * @param imageUrl - The URL of the image to save.
511
- * @param filename - The name of the file to save.
509
+ * @param {string} imageUrl - The URL of the image to save.
510
+ * @param {string} filename - The name of the file to save.
512
511
  */
513
512
  declare function saveImage(imageUrl: string, filename: string): void;
514
513
 
@@ -518,7 +517,7 @@ declare function saveImage(imageUrl: string, filename: string): void;
518
517
  * @remarks
519
518
  * This function returns a promise that resolves after the given number of milliseconds.
520
519
  *
521
- * @param time - The time to sleep in milliseconds.
520
+ * @param {number} time - The time to sleep in milliseconds.
522
521
  * @returns A promise that resolves after the specified duration.
523
522
  */
524
523
  declare function sleep(time: number): Promise<void>;
@@ -544,7 +543,7 @@ declare function getUrlParams(): Record<string, string>;
544
543
 
545
544
  /**
546
545
  * Wrapper helper function to use it with rxJs the same as `fromEvent` to listen to events from the Communicator.
547
- * @param target
546
+ * @param {Communicator} target
548
547
  * @param eventName
549
548
  */
550
549
  declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dsource/metabox-modular-configurator-api",
3
- "version": "0.0.1-dev.0",
3
+ "version": "0.0.1-dev.2",
4
4
  "description": "API for Metabox MODULAR configurator",
5
5
  "keywords": [
6
6
  "metabox",
@@ -10,7 +10,7 @@
10
10
  ],
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git@bitbucket.org:dreamsoft/sourceui.git"
13
+ "url": "git@bitbucket.org:dreamsoft/front-libraries.git"
14
14
  },
15
15
  "license": "UNLICENSED",
16
16
  "author": "3dsource",