@3dsource/metabox-front-api 3.0.32 → 3.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/fesm2022/3dsource-metabox-front-api.mjs +496 -1886
- package/fesm2022/3dsource-metabox-front-api.mjs.map +1 -1
- package/llms.txt +32 -0
- package/package.json +2 -2
- package/types/3dsource-metabox-front-api.d.ts +662 -695
package/llms.txt
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @3dsource/metabox-front-api
|
|
2
|
+
|
|
3
|
+
> Client API that embeds a Metabox Basic configurator — a live 3D product configurator streamed from Unreal Engine — into any web page and drives it from the host page over `postMessage`: choose products, materials and environments, read the configuration, take screenshots and PDFs, run showcases and trigger the e-commerce call to action. For Modular configurators use `@3dsource/metabox-modular-configurator-api`.
|
|
4
|
+
|
|
5
|
+
- Install with `npm install @3dsource/metabox-front-api`, or import the ESM build from `https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/+esm`.
|
|
6
|
+
- `integrateMetabox(configuratorId, containerId, (api) => { … }, config?)` injects the iframe (`https://metabox.3dsource.com/metabox-configurator/basic/{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 SetProduct(productId))`. 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 (`configurator.products`, `configurator.environments`, their slots and allowed materials) and the current selection. Take every id from it; never guess an id.
|
|
9
|
+
- `configuratorNotFound` fires when the configurator id does not exist, instead of the page waiting forever.
|
|
10
|
+
- `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`).
|
|
11
|
+
- 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.
|
|
12
|
+
|
|
13
|
+
## Docs
|
|
14
|
+
|
|
15
|
+
- [README](./README.md): Full guide — installation, quick start, API reference, standalone mode, custom UI, examples, troubleshooting
|
|
16
|
+
- [Quick start](./README.md#quick-start): HTML container plus a minimal `integrateMetabox` integration
|
|
17
|
+
- [Command classes](./README.md#command-classes): Every command (`SetProduct`, `SetProductMaterial`, `SetEnvironment`, `GetScreenshot`, `GetPdf`, showcase and camera commands …) and its payload
|
|
18
|
+
- [Event handling](./README.md#event-handling): Every event and its payload, including `configuratorDataUpdated`, `screenshotReady` and the status events
|
|
19
|
+
- [Standalone mode](./README.md#standalone-mode): When to hide the built-in menu and what the host page takes over
|
|
20
|
+
- [Building a custom UI](./README.md#building-a-custom-ui): Driving your own menu from `configuratorDataUpdated`
|
|
21
|
+
- [Troubleshooting](./README.md#troubleshooting): Common integration failures and their fixes
|
|
22
|
+
|
|
23
|
+
## Types
|
|
24
|
+
|
|
25
|
+
- [Type declarations](./types/3dsource-metabox-front-api.d.ts): `ToMetaboxMessagePayloads` (command payloads), `FromMetaboxMessagePayloads` (event payloads), `ConfiguratorEnvelope`, `IntegrateMetaboxConfig` — each documented with JSDoc
|
|
26
|
+
|
|
27
|
+
## Optional
|
|
28
|
+
|
|
29
|
+
- [React integration example](./README.md#react-integration-example): A complete React component
|
|
30
|
+
- [Angular integration example](./README.md#angular-integration-example): A complete Angular component
|
|
31
|
+
- [Live API demo](https://preview.3dsource.com/front-libraries/develop/#/components/BasicConfiguratorApiDemoComponent): A working host page that drives a configurator
|
|
32
|
+
- [npm package](https://www.npmjs.com/package/@3dsource/metabox-front-api): Versions and install stats
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3dsource/metabox-front-api",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.34",
|
|
4
4
|
"description": "Client API for the Metabox Basic 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",
|