@3dsource/metabox-modular-configurator-api 3.0.36 → 3.0.38
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/llms.txt
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @3dsource/metabox-modular-configurator-api
|
|
2
|
+
|
|
3
|
+
> Client API that embeds a Metabox Modular configurator — a live 3D configurator streamed from Unreal Engine where a product is assembled from components (a root component plus child components connected by sockets) — into any web page and drives it from the host page over `postMessage`: choose components and their materials, change the environment, read the assembly, take screenshots and PDFs, run showcases and trigger the e-commerce call to action. For Basic configurators (one product at a time) use `@3dsource/metabox-front-api`.
|
|
4
|
+
|
|
5
|
+
- Install with `npm install @3dsource/metabox-modular-configurator-api`, or import the ESM build from `https://cdn.jsdelivr.net/npm/@3dsource/metabox-modular-configurator-api@latest/+esm`.
|
|
6
|
+
- `integrateMetabox(configuratorId, containerId, (api) => { … }, config?)` injects the iframe (`https://metabox.3dsource.com/metabox-configurator/modular/{configuratorId}`) into the element with that id and calls back with a `Communicator` once the handshake completes. Call it once per configurator; it returns a function that stops waiting for the handshake. The container must have a size.
|
|
7
|
+
- Subscribe with `api.addEventListener(event, handler)` before sending commands, then send them with `api.sendCommandToMetabox(new SetComponent(componentId, componentTypeId))`. Commands are queued until the configurator can run them, and none of them returns a value: read results from events.
|
|
8
|
+
- `configuratorDataUpdated` carries the whole state — the catalog (component types, components, environments, slots and allowed materials) plus `configurationTree` (the assembled hierarchy), `componentsByComponentType` (the chosen component per type), `componentMaterialsIds` and the environment selection. Take every id from it; never guess an id.
|
|
9
|
+
- Order matters when restoring a configuration: set the root component first, then the environment, then child components, then their materials.
|
|
10
|
+
- `configuratorNotFound` fires when the configurator id does not exist, instead of the page waiting forever.
|
|
11
|
+
- `config.standalone: true` hides the built-in Metabox menu so you can build your own UI; the host page then owns loading (`loadingStatusChanged`), inactivity (`userInactivityDetected`) and messages (`statusMessageChanged`).
|
|
12
|
+
- In browsers with WebMCP the iframe gets the `tools` permission, so an in-browser AI agent on the host page can use the tools the configurator registers.
|
|
13
|
+
|
|
14
|
+
## Docs
|
|
15
|
+
|
|
16
|
+
- [README](./README.md): Full guide — installation, quick start, API reference, standalone mode, custom menu, troubleshooting
|
|
17
|
+
- [Quick start](./README.md#quick-start): HTML container plus a minimal `integrateMetabox` integration
|
|
18
|
+
- [Type definitions](./README.md#type-definitions): The modular data model — component types, components, the configuration tree and the state envelope
|
|
19
|
+
- [Command classes](./README.md#command-classes): Every command (`SetComponent`, `SetComponentMaterial`, `SetEnvironment`, `GetScreenshot`, `GetPdf`, showcase and camera commands …) and its payload
|
|
20
|
+
- [Event handling](./README.md#event-handling): Every event and its payload, including `configuratorDataUpdated`, `screenshotReady` and the status events
|
|
21
|
+
- [Standalone mode](./README.md#standalone-mode): When to hide the built-in menu and what the host page takes over
|
|
22
|
+
- [Building a custom menu](./README.md#building-a-custom-menu-preferred-approach): Driving your own menu from `configuratorDataUpdated`
|
|
23
|
+
- [Troubleshooting](./README.md#troubleshooting): Common integration failures and their fixes
|
|
24
|
+
|
|
25
|
+
## Types
|
|
26
|
+
|
|
27
|
+
- [Type declarations](./types/3dsource-metabox-modular-configurator-api.d.ts): `ToMetaboxMessagePayloads` (command payloads), `FromMetaboxMessagePayloads` (event payloads), the modular state envelope, `IntegrateMetaboxConfig` — each documented with JSDoc
|
|
28
|
+
|
|
29
|
+
## Optional
|
|
30
|
+
|
|
31
|
+
- [Export configuration](./README.md#export-configuration): Saving and restoring an assembly
|
|
32
|
+
- [Live API demo](https://preview.3dsource.com/front-libraries/develop/#/components/ModularConfiguratorApiDemoComponent): A working host page that drives a modular configurator
|
|
33
|
+
- [npm package](https://www.npmjs.com/package/@3dsource/metabox-modular-configurator-api): Versions and install stats
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3dsource/metabox-modular-configurator-api",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.38",
|
|
4
4
|
"description": "Client API for the 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+ssh://git@bitbucket.org/dreamsoft/front-libraries.git"
|
|
13
|
+
"url": "git+ssh://git@ssh.bitbucket.org/dreamsoft/front-libraries.git"
|
|
14
14
|
},
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
16
|
"author": "3dsource",
|