@3dsource/metabox-modular-configurator-api 0.0.4-dev.1 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -12,6 +12,7 @@ components, component types, materials, and capture screenshots or PDFs.
12
12
  - [Quick Start](#quick-start)
13
13
  - [API Reference](#api-reference)
14
14
  - [System Terminology](#system-terminology)
15
+ - [Steps to build custom menu](#steps-to-build-custom-menu)
15
16
  - [Core Integration](#core-integration)
16
17
  - [Type Definitions](#type-definitions)
17
18
  - [Command Classes](#command-classes)
@@ -124,6 +125,7 @@ Create a container element where the configurator will be embedded:
124
125
  api.sendCommandToMetaBox(new ShowOverlayInterface(false));
125
126
  api.sendCommandToMetaBox(new GetPdf());
126
127
  api.sendCommandToMetaBox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));
128
+ api.sendCommandToMetaBox(new GetCallToActionInformation());
127
129
  });
128
130
  </script>
129
131
  ```
@@ -265,6 +267,20 @@ configurator.changeMaterial('seat-fabric', 'leather-brown');
265
267
  - Your backend decides how to use the configuration JSON (e.g., generate a PDF or build a product list).
266
268
  - After your endpoint responds with a JSON containing "redirectUrl", the user is redirected in a new browser tab to that URL (a non‑Metabox page on your side) to complete the flow (e.g., leave contact information, proceed to checkout, etc.).
267
269
 
270
+ ### Steps to build custom menu
271
+
272
+ - **configuratorDataUpdated** - add event listener to receive get configurator data and then updates
273
+ - **showEmbeddedMenu** - hide embedded metabox right sidebar, but if you want to show it again, you can use this method
274
+ - **showOverlayInterface** - hide viewport metabox actions if you want to add yours
275
+ - **setEnvironment** - set active environment when you want to change environment
276
+ - **setEnvironmentMaterialById** - set environment material by slot ID
277
+ - **setComponentType** - set component type when you want to change component type !!!IMPORTANT!!!
278
+ - **setComponent** - set active component
279
+ - **setComponentMaterialById** - set component material by slot ID
280
+ - **getScreenshot** - get screenshot
281
+ - **getCallToActionInformation** - send call to action information to api endpoint provided in CTA configuration
282
+ - **getPdf** - get PDF.
283
+
268
284
  ### Core Integration
269
285
 
270
286
  #### `integrateMetabox(configuratorUrl, containerId, apiReadyCallback)`
@@ -411,6 +427,7 @@ interface ToMetaboxMessagePayloads {
411
427
  setComponentType: { typeId: string };
412
428
  setComponentMaterialById: { slotId: string; materialId: string };
413
429
  getScreenshot: { format: MimeType; size?: { x: number; y: number } };
430
+ getCallToActionInformation: void;
414
431
  getPdf: void;
415
432
  showEmbeddedMenu: { visible: boolean };
416
433
  showOverlayInterface: { visible: boolean };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dsource/metabox-modular-configurator-api",
3
- "version": "0.0.4-dev.1",
3
+ "version": "0.0.5",
4
4
  "description": "API for Metabox MODULAR configurator",
5
5
  "keywords": [
6
6
  "metabox",