@3dsource/metabox-front-api 0.0.12 → 0.0.14
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 +30 -37
- package/dist/actions/ApiAction.d.ts +20 -2
- package/dist/actions/GetFastRender.d.ts +5 -20
- package/dist/actions/GetPdf.d.ts +5 -19
- package/dist/actions/SendCommandToUnreal.d.ts +10 -0
- package/dist/actions/SetEnvironment.d.ts +3 -11
- package/dist/actions/SetEnvironmentMaterial.d.ts +11 -31
- package/dist/actions/SetMaterial.d.ts +7 -27
- package/dist/actions/SetProduct.d.ts +10 -0
- package/dist/actions/ShowEmbeddedMenu.d.ts +9 -1
- package/dist/actions/WatchCallbacks.d.ts +2 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +95 -112
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +95 -111
- package/dist/index.umd.js.map +1 -1
- package/dist/interfaces/FromMetaboxMessagePayloads.d.ts +1 -1
- package/dist/interfaces/ToMetaboxMessagePayloads.d.ts +2 -0
- package/dist/interfaces/UniversalConfigurator.d.ts +21 -2
- package/package.json +26 -22
package/README.md
CHANGED
|
@@ -14,13 +14,13 @@ then
|
|
|
14
14
|
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu,... } from '@3dsource/metabox-front-api';
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
**OR** work with direct import from `NPM` using `CDN` network unpkg.com (you can also download package and use it locally):
|
|
17
|
+
**OR** work with direct import from `NPM` using `CDN` network `unpkg.com` or `jsdelivr.net` (you can also download package and use it locally):
|
|
18
18
|
|
|
19
19
|
```javascript
|
|
20
|
-
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu,... } from 'https://
|
|
20
|
+
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu,... } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
**
|
|
23
|
+
**We strongly recommend using the first option with npm and locking it to the latest version at the time of integration, as the second option can change rapidly and may cause unexpected behavior in your existing code.**
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
@@ -45,8 +45,7 @@ Insert this code into your HTML file just before the closing `</body>` tag:
|
|
|
45
45
|
|
|
46
46
|
```html
|
|
47
47
|
<script type="module">
|
|
48
|
-
import { integrateMetaBox, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, FromMetaboxApiAction } from '@3dsource/metabox-front-api';
|
|
49
|
-
let initilaized = false;
|
|
48
|
+
import { integrateMetaBox, SetEnvironment, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, FromMetaboxApiAction } from '@3dsource/metabox-front-api';
|
|
50
49
|
// Expose API
|
|
51
50
|
window.env3DSource.apiReady = (api) => {
|
|
52
51
|
api.addEventListener('metaboxData', (data) => {
|
|
@@ -55,20 +54,8 @@ Insert this code into your HTML file just before the closing `</body>` tag:
|
|
|
55
54
|
return;
|
|
56
55
|
}
|
|
57
56
|
|
|
58
|
-
if (eventType === 'viewportReady' && payload === true) {
|
|
59
|
-
//You can use this event to trigger any action that can work only when the viewport is ready,
|
|
60
|
-
//i.e. GetPdf or GetFastRender
|
|
61
|
-
|
|
62
|
-
// Get a fast render (optionally specify size)
|
|
63
|
-
new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
64
|
-
|
|
65
|
-
// Generate a PDF of the current view
|
|
66
|
-
new GetPdf();
|
|
67
|
-
}
|
|
68
|
-
|
|
69
57
|
if (eventType === 'basicConfiguratorDataWithState') {
|
|
70
58
|
updateConfiguratorData(data);
|
|
71
|
-
setupInitialState();
|
|
72
59
|
}
|
|
73
60
|
|
|
74
61
|
if (eventType === 'fastRender') {
|
|
@@ -76,6 +63,7 @@ Insert this code into your HTML file just before the closing `</body>` tag:
|
|
|
76
63
|
saveImage(payload, 'Render.png');
|
|
77
64
|
}
|
|
78
65
|
});
|
|
66
|
+
setupInitialState();
|
|
79
67
|
};
|
|
80
68
|
|
|
81
69
|
/**
|
|
@@ -87,27 +75,36 @@ Insert this code into your HTML file just before the closing `</body>` tag:
|
|
|
87
75
|
}
|
|
88
76
|
|
|
89
77
|
/**
|
|
90
|
-
* Setup initial state
|
|
78
|
+
* Setup initial state,
|
|
79
|
+
* Executes additional commands as example
|
|
91
80
|
*/
|
|
92
81
|
function setupInitialState() {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
82
|
+
// All commands can be used at any time from the moment api is ready and will be buffered automatically
|
|
83
|
+
// i.e. GetFastRender and GetPdf will be executed when the viewport is ready
|
|
84
|
+
|
|
96
85
|
// Set product
|
|
97
|
-
new SetProduct('
|
|
86
|
+
new SetProduct('productId');
|
|
98
87
|
|
|
99
88
|
// Set environment
|
|
100
|
-
new SetEnvironment('
|
|
89
|
+
new SetEnvironment('environmentId');
|
|
101
90
|
|
|
102
91
|
// Set material
|
|
103
|
-
new SetMaterial('
|
|
92
|
+
new SetMaterial('productId', 'slotId', 'materialId');
|
|
93
|
+
|
|
94
|
+
// Set environment material
|
|
95
|
+
new SetEnvironmentMaterial('productId', 'slotId', 'materialId');
|
|
104
96
|
|
|
105
97
|
// Toggle embedded menu
|
|
106
98
|
new ShowEmbeddedMenu(false);
|
|
99
|
+
|
|
100
|
+
//Request Pdf, Will execute as stream is ready, will be auto-downloaded
|
|
101
|
+
new GetPdf();
|
|
102
|
+
|
|
103
|
+
//Request Fast Render, Will execute as stream is ready, will be sent back as a callback
|
|
104
|
+
new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
107
105
|
}
|
|
108
106
|
|
|
109
107
|
// Integrate the 3D configurator into your page
|
|
110
|
-
|
|
111
108
|
/**
|
|
112
109
|
* Additional url parameters:
|
|
113
110
|
* @see integrateMetaBox
|
|
@@ -144,6 +141,14 @@ Insert this code into your HTML file just before the closing `</body>` tag:
|
|
|
144
141
|
new SetMaterial(productId: string, slotId: string, materialId: string);
|
|
145
142
|
```
|
|
146
143
|
|
|
144
|
+
### `SetEnvironmentMaterial`
|
|
145
|
+
|
|
146
|
+
- **Description**: Sets the material for a given environment slot.
|
|
147
|
+
- **Constructor**:
|
|
148
|
+
```typescript
|
|
149
|
+
new SetEnvironmentMaterial(productId: string, slotId: string, materialId: string);
|
|
150
|
+
```
|
|
151
|
+
|
|
147
152
|
### `SetProduct`
|
|
148
153
|
|
|
149
154
|
- **Description**: Sets the product by ID.
|
|
@@ -162,12 +167,6 @@ Insert this code into your HTML file just before the closing `</body>` tag:
|
|
|
162
167
|
|
|
163
168
|
### `GetFastRender`
|
|
164
169
|
|
|
165
|
-
**Important:** Before invoking this action, ensure that the MetaBox viewport is fully loaded. This is indicated by the event:
|
|
166
|
-
|
|
167
|
-
```javascript
|
|
168
|
-
data.eventType === 'viewportReady' && data.payload === true.
|
|
169
|
-
```
|
|
170
|
-
|
|
171
170
|
- **Description**: Retrieves a fast render of the current view.
|
|
172
171
|
- **Usage**:
|
|
173
172
|
```typescript
|
|
@@ -176,12 +175,6 @@ data.eventType === 'viewportReady' && data.payload === true.
|
|
|
176
175
|
|
|
177
176
|
### `GetPdf`
|
|
178
177
|
|
|
179
|
-
**Important:** Before invoking this action, ensure that the MetaBox viewport is fully loaded. This is indicated by the event:
|
|
180
|
-
|
|
181
|
-
```javascript
|
|
182
|
-
data.eventType === 'viewportReady' && data.payload === true.
|
|
183
|
-
```
|
|
184
|
-
|
|
185
178
|
- **Description**: Generates a PDF of the current view.
|
|
186
179
|
- **Usage**:
|
|
187
180
|
```typescript
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import type { Communicator } from '../lib/initializeCommunicator';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* To integrate the MetaBox configurator into an HTML element, use the following example:
|
|
4
|
+
*
|
|
5
|
+
* **We strongly recommend using the option with npm and locking it to the latest version at the time of integration, as the option with cdn can change rapidly and may cause unexpected behavior in your existing code. See root documentation.**
|
|
6
|
+
*
|
|
7
|
+
* ```typescript
|
|
8
|
+
* import { integrateMetaBox } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
9
|
+
*
|
|
10
|
+
* integrateMetaBox(
|
|
11
|
+
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
12
|
+
* 'embed3DSource'
|
|
13
|
+
* );
|
|
14
|
+
*
|
|
15
|
+
* // Set up the global API environment
|
|
16
|
+
* window.env3DSource = window.env3DSource || {};
|
|
17
|
+
*
|
|
18
|
+
* //Listen for the API ready event
|
|
19
|
+
* window.env3DSource.apiReady = (api) => {
|
|
20
|
+
* // Use the API actions here
|
|
21
|
+
* };
|
|
22
|
+
* ```
|
|
5
23
|
*/
|
|
6
24
|
export declare class ApiAction {
|
|
7
25
|
protected api: Communicator;
|
|
@@ -6,40 +6,25 @@ import { ApiAction } from './ApiAction';
|
|
|
6
6
|
*/
|
|
7
7
|
export type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
8
8
|
/**
|
|
9
|
+
* {@inheritDoc ApiAction}
|
|
10
|
+
*
|
|
9
11
|
* Represents a fast render action.
|
|
10
12
|
* @remarks
|
|
11
13
|
* This class sends a message to the MetaBox API to obtain a fast render based on the provided format and optional size.
|
|
12
14
|
*
|
|
13
|
-
* **Important
|
|
14
|
-
* ```javascript
|
|
15
|
-
* data.eventType === 'viewportReady' && data.payload === true.
|
|
16
|
-
* ```
|
|
17
|
-
* Only then request be processed.
|
|
15
|
+
* **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
|
|
18
16
|
*
|
|
19
17
|
* @example
|
|
20
|
-
* import {
|
|
21
|
-
*
|
|
22
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
23
|
-
* integrateMetaBox(
|
|
24
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
25
|
-
* 'embed3DSource'
|
|
26
|
-
* );
|
|
27
|
-
*
|
|
28
|
-
* // Set up the global API environment
|
|
29
|
-
* window.env3DSource = window.env3DSource || {};
|
|
18
|
+
* import { GetFastRender,saveImage } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
30
19
|
* window.env3DSource.apiReady = (api) => {
|
|
31
20
|
* // Listen for events from the MetaBox API
|
|
32
21
|
* api.addEventListener('metaboxData', (data) => {
|
|
33
|
-
* // Ensure the viewport is ready before sending render requests
|
|
34
|
-
* if (data.eventType === 'viewportReady' && data.payload === true) {
|
|
35
|
-
* // Request a fast render (PNG image with 1024x1024 dimensions)
|
|
36
|
-
* new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
37
|
-
* }
|
|
38
22
|
* // Process the fast render response
|
|
39
23
|
* if (data.eventType === 'fastRender') {
|
|
40
24
|
* saveImage(data.payload, 'Render.png');
|
|
41
25
|
* }
|
|
42
26
|
* });
|
|
27
|
+
* new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
43
28
|
* };
|
|
44
29
|
*/
|
|
45
30
|
export declare class GetFastRender extends ApiAction {
|
package/dist/actions/GetPdf.d.ts
CHANGED
|
@@ -1,32 +1,18 @@
|
|
|
1
1
|
import { ApiAction } from './ApiAction';
|
|
2
2
|
/**
|
|
3
|
+
* {@inheritDoc ApiAction}
|
|
4
|
+
*
|
|
3
5
|
* Represents an action to get a PDF from Metabox.
|
|
4
6
|
* @remarks
|
|
5
7
|
* This class sends a message to the MetaBox API to generate a PDF based on the current configuration.
|
|
6
8
|
* This action does not require any parameters.
|
|
7
9
|
*
|
|
8
|
-
* **Important
|
|
9
|
-
*```javascript
|
|
10
|
-
* data.eventType === 'viewportReady' && data.payload === true.
|
|
11
|
-
* ```
|
|
12
|
-
* Only then request be processed.
|
|
10
|
+
* **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
|
|
13
11
|
*
|
|
14
12
|
* @example
|
|
15
|
-
* import {
|
|
16
|
-
*
|
|
17
|
-
* integrateMetaBox(
|
|
18
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
19
|
-
* 'embed3DSource'
|
|
20
|
-
* );
|
|
21
|
-
*
|
|
22
|
-
* window.env3DSource = window.env3DSource || {};
|
|
13
|
+
* import { GetPdf } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
23
14
|
* window.env3DSource.apiReady = (api) => {
|
|
24
|
-
*
|
|
25
|
-
* if (data.eventType === 'viewportReady' && data.payload === true) {
|
|
26
|
-
* // Request a PDF of the current configuration
|
|
27
|
-
* new GetPdf();
|
|
28
|
-
* }
|
|
29
|
-
* });
|
|
15
|
+
* new GetPdf();
|
|
30
16
|
* };
|
|
31
17
|
*/
|
|
32
18
|
export declare class GetPdf extends ApiAction {
|
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { ApiAction } from './ApiAction';
|
|
2
2
|
/**
|
|
3
|
+
* {@inheritDoc ApiAction}
|
|
4
|
+
*
|
|
3
5
|
* Represents an action to set the environment by its ID.
|
|
4
6
|
* @remarks
|
|
5
7
|
* This action sends a message to the MetaBox API to load the environment level using the specified environment ID.
|
|
6
|
-
* It requires the MetaBox API to be properly initialized and an event listener to be registered.
|
|
7
8
|
*
|
|
8
9
|
* @example
|
|
9
|
-
* import {
|
|
10
|
-
*
|
|
11
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
12
|
-
* integrateMetaBox(
|
|
13
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
14
|
-
* 'embed3DSource'
|
|
15
|
-
* );
|
|
16
|
-
*
|
|
17
|
-
* // Setup API ready callback
|
|
18
|
-
* window.env3DSource = window.env3DSource || {};
|
|
10
|
+
* import { SetEnvironment } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
19
11
|
* window.env3DSource.apiReady = (api) => {
|
|
20
12
|
* // Change the environment to '55555555-1234-1234-1234-01234567890'
|
|
21
13
|
* new SetEnvironment('55555555-1234-1234-1234-01234567890');
|
|
@@ -1,45 +1,25 @@
|
|
|
1
1
|
import { ApiAction } from './ApiAction';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* {@inheritDoc ApiAction}
|
|
4
|
+
*
|
|
5
|
+
* Represents an action to set a environment material by its ID.
|
|
4
6
|
*
|
|
5
7
|
* @remarks
|
|
6
|
-
* This action sends a message to the MetaBox API to update the material on a specific
|
|
7
|
-
|
|
8
|
-
* **Important:** Before invoking this action, ensure that the MetaBox already dispatched
|
|
9
|
-
* as minimum one eventType:"basicConfiguratorDataWithState":
|
|
10
|
-
* ```javascript
|
|
11
|
-
* data.eventType === 'basicConfiguratorDataWithState'.
|
|
12
|
-
* ```
|
|
13
|
-
* Only then request be processed.
|
|
8
|
+
* This action sends a message to the MetaBox API to update the material on a specific environment slot using the provided identifiers.
|
|
14
9
|
*
|
|
15
10
|
* @example
|
|
16
|
-
* import {
|
|
17
|
-
*
|
|
18
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
19
|
-
* integrateMetaBox(
|
|
20
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
21
|
-
* 'embed3DSource'
|
|
22
|
-
* );
|
|
23
|
-
*
|
|
24
|
-
* // Set up the global API environment
|
|
25
|
-
* window.env3DSource = window.env3DSource || {};
|
|
11
|
+
* import { SetEnvironmentMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
26
12
|
* window.env3DSource.apiReady = (api) => {
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
33
|
-
* 'carpaint',
|
|
34
|
-
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
35
|
-
* );
|
|
36
|
-
* }
|
|
37
|
-
* });
|
|
13
|
+
* new SetEnvironmentMaterial(
|
|
14
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
15
|
+
* 'carpaint',
|
|
16
|
+
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
17
|
+
* );
|
|
38
18
|
* };
|
|
39
19
|
*/
|
|
40
20
|
export declare class SetEnvironmentMaterial extends ApiAction {
|
|
41
21
|
/**
|
|
42
|
-
* Creates an instance of
|
|
22
|
+
* Creates an instance of SetEnvironmentMaterial.
|
|
43
23
|
*
|
|
44
24
|
* @param productId - The product ID.
|
|
45
25
|
* @param slotId - The slot ID.
|
|
@@ -1,40 +1,20 @@
|
|
|
1
1
|
import { ApiAction } from './ApiAction';
|
|
2
2
|
/**
|
|
3
|
+
* {@inheritDoc ApiAction}
|
|
4
|
+
*
|
|
3
5
|
* Represents an action to set a material by its ID.
|
|
4
6
|
*
|
|
5
7
|
* @remarks
|
|
6
8
|
* This action sends a message to the MetaBox API to update the material on a specific product slot using the provided identifiers.
|
|
7
|
-
|
|
8
|
-
* **Important:** Before invoking this action, ensure that the MetaBox already dispatched
|
|
9
|
-
* as minimum one eventType:"basicConfiguratorDataWithState":
|
|
10
|
-
* ```javascript
|
|
11
|
-
* data.eventType === 'basicConfiguratorDataWithState'.
|
|
12
|
-
* ```
|
|
13
|
-
* Only then request be processed.
|
|
14
9
|
*
|
|
15
10
|
* @example
|
|
16
11
|
* import { SetMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
17
|
-
*
|
|
18
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
19
|
-
* integrateMetaBox(
|
|
20
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
21
|
-
* 'embed3DSource'
|
|
22
|
-
* );
|
|
23
|
-
*
|
|
24
|
-
* // Set up the global API environment
|
|
25
|
-
* window.env3DSource = window.env3DSource || {};
|
|
26
12
|
* window.env3DSource.apiReady = (api) => {
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
33
|
-
* 'carpaint',
|
|
34
|
-
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
35
|
-
* );
|
|
36
|
-
* }
|
|
37
|
-
* });
|
|
13
|
+
* new SetMaterial(
|
|
14
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
15
|
+
* 'carpaint',
|
|
16
|
+
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
17
|
+
* );
|
|
38
18
|
* };
|
|
39
19
|
*/
|
|
40
20
|
export declare class SetMaterial extends ApiAction {
|
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { ApiAction } from './ApiAction';
|
|
2
2
|
/**
|
|
3
|
+
* {@inheritDoc ApiAction}
|
|
4
|
+
*
|
|
3
5
|
* Represents an action to set a product by its ID.
|
|
4
6
|
*
|
|
5
7
|
* @remarks
|
|
6
8
|
* This action sends a message to the MetaBox API to set a product using the provided product ID.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* import { SetProduct } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
12
|
+
* window.env3DSource.apiReady = (api) => {
|
|
13
|
+
* new SetProduct(
|
|
14
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
|
|
15
|
+
* );
|
|
16
|
+
* };
|
|
7
17
|
*/
|
|
8
18
|
export declare class SetProduct extends ApiAction {
|
|
9
19
|
/**
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import { ApiAction } from './ApiAction';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* {@inheritDoc ApiAction}
|
|
4
|
+
*
|
|
5
|
+
* Represents an action to toggle the Embedded MetaBox Menu.
|
|
4
6
|
*
|
|
5
7
|
* @remarks
|
|
6
8
|
* This action sends a message to the MetaBox API to toggle the visibility of the embedded menu.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* import { ShowEmbeddedMenu } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
12
|
+
* window.env3DSource.apiReady = (api) => {
|
|
13
|
+
* new ShowEmbeddedMenu(true);
|
|
14
|
+
* };
|
|
7
15
|
*/
|
|
8
16
|
export declare class ShowEmbeddedMenu extends ApiAction {
|
|
9
17
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -5,15 +5,16 @@ export { GetPdf } from './actions/GetPdf';
|
|
|
5
5
|
export { SetMaterial } from './actions/SetMaterial';
|
|
6
6
|
export { SetEnvironmentMaterial } from './actions/SetEnvironmentMaterial';
|
|
7
7
|
export { GetFastRender } from './actions/GetFastRender';
|
|
8
|
+
export { SendCommandToUnreal } from './actions/SendCommandToUnreal';
|
|
8
9
|
export { WatchCallbacks } from './actions/WatchCallbacks';
|
|
9
|
-
export { MimeType } from './actions/GetFastRender';
|
|
10
|
+
export type { MimeType } from './actions/GetFastRender';
|
|
10
11
|
export { ApiAction } from './actions/ApiAction';
|
|
11
12
|
export * from './lib/integrateMetaBox';
|
|
12
13
|
export * from './lib/initializeCommunicator';
|
|
13
14
|
export * from './lib/saveImage';
|
|
14
15
|
export * from './lib/sleep';
|
|
15
16
|
export * from './lib/UrlUtils';
|
|
16
|
-
export * from './interfaces/UniversalConfigurator';
|
|
17
|
+
export type * from './interfaces/UniversalConfigurator';
|
|
17
18
|
export * from './interfaces/ToMetaboxMessagePayloads';
|
|
18
19
|
export * from './interfaces/FromMetaboxMessagePayloads';
|
|
19
20
|
export * from './interfaces/application-device-types';
|
package/dist/index.esm.js
CHANGED
|
@@ -4,8 +4,26 @@
|
|
|
4
4
|
* All Rights Reserved
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* To integrate the MetaBox configurator into an HTML element, use the following example:
|
|
8
|
+
*
|
|
9
|
+
* **We strongly recommend using the option with npm and locking it to the latest version at the time of integration, as the option with cdn can change rapidly and may cause unexpected behavior in your existing code. See root documentation.**
|
|
10
|
+
*
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { integrateMetaBox } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
13
|
+
*
|
|
14
|
+
* integrateMetaBox(
|
|
15
|
+
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
16
|
+
* 'embed3DSource'
|
|
17
|
+
* );
|
|
18
|
+
*
|
|
19
|
+
* // Set up the global API environment
|
|
20
|
+
* window.env3DSource = window.env3DSource || {};
|
|
21
|
+
*
|
|
22
|
+
* //Listen for the API ready event
|
|
23
|
+
* window.env3DSource.apiReady = (api) => {
|
|
24
|
+
* // Use the API actions here
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
9
27
|
*/
|
|
10
28
|
class ApiAction {
|
|
11
29
|
constructor() {
|
|
@@ -33,6 +51,7 @@ const ToMetaBoxApiAction = {
|
|
|
33
51
|
setMaterialById: 'setMaterialById',
|
|
34
52
|
showEmbeddedMenu: 'showEmbeddedMenu',
|
|
35
53
|
forceSetDeviceType: 'forceSetDeviceType',
|
|
54
|
+
sendCommandToUnreal: 'sendCommandToUnreal',
|
|
36
55
|
setEnvironmentMaterialById: 'setEnvironmentMaterialById',
|
|
37
56
|
};
|
|
38
57
|
|
|
@@ -42,10 +61,18 @@ const ToMetaBoxApiAction = {
|
|
|
42
61
|
* All Rights Reserved
|
|
43
62
|
*/
|
|
44
63
|
/**
|
|
45
|
-
*
|
|
64
|
+
* {@inheritDoc ApiAction}
|
|
65
|
+
*
|
|
66
|
+
* Represents an action to toggle the Embedded MetaBox Menu.
|
|
46
67
|
*
|
|
47
68
|
* @remarks
|
|
48
69
|
* This action sends a message to the MetaBox API to toggle the visibility of the embedded menu.
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* import { ShowEmbeddedMenu } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
73
|
+
* window.env3DSource.apiReady = (api) => {
|
|
74
|
+
* new ShowEmbeddedMenu(true);
|
|
75
|
+
* };
|
|
49
76
|
*/
|
|
50
77
|
class ShowEmbeddedMenu extends ApiAction {
|
|
51
78
|
/**
|
|
@@ -70,22 +97,14 @@ class ShowEmbeddedMenu extends ApiAction {
|
|
|
70
97
|
* All Rights Reserved
|
|
71
98
|
*/
|
|
72
99
|
/**
|
|
100
|
+
* {@inheritDoc ApiAction}
|
|
101
|
+
*
|
|
73
102
|
* Represents an action to set the environment by its ID.
|
|
74
103
|
* @remarks
|
|
75
104
|
* This action sends a message to the MetaBox API to load the environment level using the specified environment ID.
|
|
76
|
-
* It requires the MetaBox API to be properly initialized and an event listener to be registered.
|
|
77
105
|
*
|
|
78
106
|
* @example
|
|
79
|
-
* import {
|
|
80
|
-
*
|
|
81
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
82
|
-
* integrateMetaBox(
|
|
83
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
84
|
-
* 'embed3DSource'
|
|
85
|
-
* );
|
|
86
|
-
*
|
|
87
|
-
* // Setup API ready callback
|
|
88
|
-
* window.env3DSource = window.env3DSource || {};
|
|
107
|
+
* import { SetEnvironment } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
89
108
|
* window.env3DSource.apiReady = (api) => {
|
|
90
109
|
* // Change the environment to '55555555-1234-1234-1234-01234567890'
|
|
91
110
|
* new SetEnvironment('55555555-1234-1234-1234-01234567890');
|
|
@@ -114,10 +133,20 @@ class SetEnvironment extends ApiAction {
|
|
|
114
133
|
* All Rights Reserved
|
|
115
134
|
*/
|
|
116
135
|
/**
|
|
136
|
+
* {@inheritDoc ApiAction}
|
|
137
|
+
*
|
|
117
138
|
* Represents an action to set a product by its ID.
|
|
118
139
|
*
|
|
119
140
|
* @remarks
|
|
120
141
|
* This action sends a message to the MetaBox API to set a product using the provided product ID.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* import { SetProduct } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
145
|
+
* window.env3DSource.apiReady = (api) => {
|
|
146
|
+
* new SetProduct(
|
|
147
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
|
|
148
|
+
* );
|
|
149
|
+
* };
|
|
121
150
|
*/
|
|
122
151
|
class SetProduct extends ApiAction {
|
|
123
152
|
/**
|
|
@@ -142,33 +171,19 @@ class SetProduct extends ApiAction {
|
|
|
142
171
|
* All Rights Reserved
|
|
143
172
|
*/
|
|
144
173
|
/**
|
|
174
|
+
* {@inheritDoc ApiAction}
|
|
175
|
+
*
|
|
145
176
|
* Represents an action to get a PDF from Metabox.
|
|
146
177
|
* @remarks
|
|
147
178
|
* This class sends a message to the MetaBox API to generate a PDF based on the current configuration.
|
|
148
179
|
* This action does not require any parameters.
|
|
149
180
|
*
|
|
150
|
-
* **Important
|
|
151
|
-
*```javascript
|
|
152
|
-
* data.eventType === 'viewportReady' && data.payload === true.
|
|
153
|
-
* ```
|
|
154
|
-
* Only then request be processed.
|
|
181
|
+
* **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
|
|
155
182
|
*
|
|
156
183
|
* @example
|
|
157
|
-
* import {
|
|
158
|
-
*
|
|
159
|
-
* integrateMetaBox(
|
|
160
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
161
|
-
* 'embed3DSource'
|
|
162
|
-
* );
|
|
163
|
-
*
|
|
164
|
-
* window.env3DSource = window.env3DSource || {};
|
|
184
|
+
* import { GetPdf } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
165
185
|
* window.env3DSource.apiReady = (api) => {
|
|
166
|
-
*
|
|
167
|
-
* if (data.eventType === 'viewportReady' && data.payload === true) {
|
|
168
|
-
* // Request a PDF of the current configuration
|
|
169
|
-
* new GetPdf();
|
|
170
|
-
* }
|
|
171
|
-
* });
|
|
186
|
+
* new GetPdf();
|
|
172
187
|
* };
|
|
173
188
|
*/
|
|
174
189
|
class GetPdf extends ApiAction {
|
|
@@ -192,41 +207,21 @@ class GetPdf extends ApiAction {
|
|
|
192
207
|
* All Rights Reserved
|
|
193
208
|
*/
|
|
194
209
|
/**
|
|
210
|
+
* {@inheritDoc ApiAction}
|
|
211
|
+
*
|
|
195
212
|
* Represents an action to set a material by its ID.
|
|
196
213
|
*
|
|
197
214
|
* @remarks
|
|
198
215
|
* This action sends a message to the MetaBox API to update the material on a specific product slot using the provided identifiers.
|
|
199
|
-
|
|
200
|
-
* **Important:** Before invoking this action, ensure that the MetaBox already dispatched
|
|
201
|
-
* as minimum one eventType:"basicConfiguratorDataWithState":
|
|
202
|
-
* ```javascript
|
|
203
|
-
* data.eventType === 'basicConfiguratorDataWithState'.
|
|
204
|
-
* ```
|
|
205
|
-
* Only then request be processed.
|
|
206
216
|
*
|
|
207
217
|
* @example
|
|
208
218
|
* import { SetMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
209
|
-
*
|
|
210
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
211
|
-
* integrateMetaBox(
|
|
212
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
213
|
-
* 'embed3DSource'
|
|
214
|
-
* );
|
|
215
|
-
*
|
|
216
|
-
* // Set up the global API environment
|
|
217
|
-
* window.env3DSource = window.env3DSource || {};
|
|
218
219
|
* window.env3DSource.apiReady = (api) => {
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
*
|
|
222
|
-
*
|
|
223
|
-
*
|
|
224
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
225
|
-
* 'carpaint',
|
|
226
|
-
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
227
|
-
* );
|
|
228
|
-
* }
|
|
229
|
-
* });
|
|
220
|
+
* new SetMaterial(
|
|
221
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
222
|
+
* 'carpaint',
|
|
223
|
+
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
224
|
+
* );
|
|
230
225
|
* };
|
|
231
226
|
*/
|
|
232
227
|
class SetMaterial extends ApiAction {
|
|
@@ -256,46 +251,26 @@ class SetMaterial extends ApiAction {
|
|
|
256
251
|
* All Rights Reserved
|
|
257
252
|
*/
|
|
258
253
|
/**
|
|
259
|
-
*
|
|
254
|
+
* {@inheritDoc ApiAction}
|
|
255
|
+
*
|
|
256
|
+
* Represents an action to set a environment material by its ID.
|
|
260
257
|
*
|
|
261
258
|
* @remarks
|
|
262
|
-
* This action sends a message to the MetaBox API to update the material on a specific
|
|
263
|
-
|
|
264
|
-
* **Important:** Before invoking this action, ensure that the MetaBox already dispatched
|
|
265
|
-
* as minimum one eventType:"basicConfiguratorDataWithState":
|
|
266
|
-
* ```javascript
|
|
267
|
-
* data.eventType === 'basicConfiguratorDataWithState'.
|
|
268
|
-
* ```
|
|
269
|
-
* Only then request be processed.
|
|
259
|
+
* This action sends a message to the MetaBox API to update the material on a specific environment slot using the provided identifiers.
|
|
270
260
|
*
|
|
271
261
|
* @example
|
|
272
|
-
* import {
|
|
273
|
-
*
|
|
274
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
275
|
-
* integrateMetaBox(
|
|
276
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
277
|
-
* 'embed3DSource'
|
|
278
|
-
* );
|
|
279
|
-
*
|
|
280
|
-
* // Set up the global API environment
|
|
281
|
-
* window.env3DSource = window.env3DSource || {};
|
|
262
|
+
* import { SetEnvironmentMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
282
263
|
* window.env3DSource.apiReady = (api) => {
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
*
|
|
288
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
289
|
-
* 'carpaint',
|
|
290
|
-
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
291
|
-
* );
|
|
292
|
-
* }
|
|
293
|
-
* });
|
|
264
|
+
* new SetEnvironmentMaterial(
|
|
265
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
266
|
+
* 'carpaint',
|
|
267
|
+
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
268
|
+
* );
|
|
294
269
|
* };
|
|
295
270
|
*/
|
|
296
271
|
class SetEnvironmentMaterial extends ApiAction {
|
|
297
272
|
/**
|
|
298
|
-
* Creates an instance of
|
|
273
|
+
* Creates an instance of SetEnvironmentMaterial.
|
|
299
274
|
*
|
|
300
275
|
* @param productId - The product ID.
|
|
301
276
|
* @param slotId - The slot ID.
|
|
@@ -320,40 +295,25 @@ class SetEnvironmentMaterial extends ApiAction {
|
|
|
320
295
|
* All Rights Reserved
|
|
321
296
|
*/
|
|
322
297
|
/**
|
|
298
|
+
* {@inheritDoc ApiAction}
|
|
299
|
+
*
|
|
323
300
|
* Represents a fast render action.
|
|
324
301
|
* @remarks
|
|
325
302
|
* This class sends a message to the MetaBox API to obtain a fast render based on the provided format and optional size.
|
|
326
303
|
*
|
|
327
|
-
* **Important
|
|
328
|
-
* ```javascript
|
|
329
|
-
* data.eventType === 'viewportReady' && data.payload === true.
|
|
330
|
-
* ```
|
|
331
|
-
* Only then request be processed.
|
|
304
|
+
* **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
|
|
332
305
|
*
|
|
333
306
|
* @example
|
|
334
|
-
* import {
|
|
335
|
-
*
|
|
336
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
337
|
-
* integrateMetaBox(
|
|
338
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
339
|
-
* 'embed3DSource'
|
|
340
|
-
* );
|
|
341
|
-
*
|
|
342
|
-
* // Set up the global API environment
|
|
343
|
-
* window.env3DSource = window.env3DSource || {};
|
|
307
|
+
* import { GetFastRender,saveImage } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
344
308
|
* window.env3DSource.apiReady = (api) => {
|
|
345
309
|
* // Listen for events from the MetaBox API
|
|
346
310
|
* api.addEventListener('metaboxData', (data) => {
|
|
347
|
-
* // Ensure the viewport is ready before sending render requests
|
|
348
|
-
* if (data.eventType === 'viewportReady' && data.payload === true) {
|
|
349
|
-
* // Request a fast render (PNG image with 1024x1024 dimensions)
|
|
350
|
-
* new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
351
|
-
* }
|
|
352
311
|
* // Process the fast render response
|
|
353
312
|
* if (data.eventType === 'fastRender') {
|
|
354
313
|
* saveImage(data.payload, 'Render.png');
|
|
355
314
|
* }
|
|
356
315
|
* });
|
|
316
|
+
* new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
357
317
|
* };
|
|
358
318
|
*/
|
|
359
319
|
class GetFastRender extends ApiAction {
|
|
@@ -374,6 +334,27 @@ class GetFastRender extends ApiAction {
|
|
|
374
334
|
}
|
|
375
335
|
}
|
|
376
336
|
|
|
337
|
+
/*
|
|
338
|
+
* Copyright (c) 2025.
|
|
339
|
+
* 3DSource.com, Sergii Karanda steve@3dsource.com
|
|
340
|
+
* All Rights Reserved
|
|
341
|
+
*/
|
|
342
|
+
/**
|
|
343
|
+
* {@inheritDoc ApiAction}
|
|
344
|
+
* @internal
|
|
345
|
+
* @hidden
|
|
346
|
+
* Represents an action to send Unreal command.
|
|
347
|
+
*/
|
|
348
|
+
class SendCommandToUnreal extends ApiAction {
|
|
349
|
+
constructor(payload) {
|
|
350
|
+
super();
|
|
351
|
+
this.api.sendMessageToMetaBox({
|
|
352
|
+
payload,
|
|
353
|
+
action: ToMetaBoxApiAction.sendCommandToUnreal,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
377
358
|
/*
|
|
378
359
|
* Copyright (c) 2025.
|
|
379
360
|
* 3DSource.com, Sergii Karanda steve@3dsource.com
|
|
@@ -381,6 +362,8 @@ class GetFastRender extends ApiAction {
|
|
|
381
362
|
*/
|
|
382
363
|
/**
|
|
383
364
|
* @experimental
|
|
365
|
+
* @internal
|
|
366
|
+
* @hidden
|
|
384
367
|
* @remarks
|
|
385
368
|
* Represents an action to watch Unreal callbacks from Unreal engine.
|
|
386
369
|
* Can be useful for custom solutions.
|
|
@@ -748,5 +731,5 @@ const APPLICATION_DEVICE_TYPES = {
|
|
|
748
731
|
deviceTypeDesktop: 'deviceTypeDesktop',
|
|
749
732
|
};
|
|
750
733
|
|
|
751
|
-
export { APPLICATION_DEVICE_TYPES, ApiAction, Communicator, FromMetaboxApiAction, GetFastRender, GetPdf, SetEnvironment, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, ToMetaBoxApiAction, WatchCallbacks, getUrlParams, integrateMetaBox, saveImage, setUrlParams, sleep };
|
|
734
|
+
export { APPLICATION_DEVICE_TYPES, ApiAction, Communicator, FromMetaboxApiAction, GetFastRender, GetPdf, SendCommandToUnreal, SetEnvironment, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, ToMetaBoxApiAction, WatchCallbacks, getUrlParams, integrateMetaBox, saveImage, setUrlParams, sleep };
|
|
752
735
|
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -10,8 +10,26 @@
|
|
|
10
10
|
* All Rights Reserved
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* To integrate the MetaBox configurator into an HTML element, use the following example:
|
|
14
|
+
*
|
|
15
|
+
* **We strongly recommend using the option with npm and locking it to the latest version at the time of integration, as the option with cdn can change rapidly and may cause unexpected behavior in your existing code. See root documentation.**
|
|
16
|
+
*
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { integrateMetaBox } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
19
|
+
*
|
|
20
|
+
* integrateMetaBox(
|
|
21
|
+
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
22
|
+
* 'embed3DSource'
|
|
23
|
+
* );
|
|
24
|
+
*
|
|
25
|
+
* // Set up the global API environment
|
|
26
|
+
* window.env3DSource = window.env3DSource || {};
|
|
27
|
+
*
|
|
28
|
+
* //Listen for the API ready event
|
|
29
|
+
* window.env3DSource.apiReady = (api) => {
|
|
30
|
+
* // Use the API actions here
|
|
31
|
+
* };
|
|
32
|
+
* ```
|
|
15
33
|
*/
|
|
16
34
|
class ApiAction {
|
|
17
35
|
constructor() {
|
|
@@ -39,6 +57,7 @@
|
|
|
39
57
|
setMaterialById: 'setMaterialById',
|
|
40
58
|
showEmbeddedMenu: 'showEmbeddedMenu',
|
|
41
59
|
forceSetDeviceType: 'forceSetDeviceType',
|
|
60
|
+
sendCommandToUnreal: 'sendCommandToUnreal',
|
|
42
61
|
setEnvironmentMaterialById: 'setEnvironmentMaterialById',
|
|
43
62
|
};
|
|
44
63
|
|
|
@@ -48,10 +67,18 @@
|
|
|
48
67
|
* All Rights Reserved
|
|
49
68
|
*/
|
|
50
69
|
/**
|
|
51
|
-
*
|
|
70
|
+
* {@inheritDoc ApiAction}
|
|
71
|
+
*
|
|
72
|
+
* Represents an action to toggle the Embedded MetaBox Menu.
|
|
52
73
|
*
|
|
53
74
|
* @remarks
|
|
54
75
|
* This action sends a message to the MetaBox API to toggle the visibility of the embedded menu.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* import { ShowEmbeddedMenu } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
79
|
+
* window.env3DSource.apiReady = (api) => {
|
|
80
|
+
* new ShowEmbeddedMenu(true);
|
|
81
|
+
* };
|
|
55
82
|
*/
|
|
56
83
|
class ShowEmbeddedMenu extends ApiAction {
|
|
57
84
|
/**
|
|
@@ -76,22 +103,14 @@
|
|
|
76
103
|
* All Rights Reserved
|
|
77
104
|
*/
|
|
78
105
|
/**
|
|
106
|
+
* {@inheritDoc ApiAction}
|
|
107
|
+
*
|
|
79
108
|
* Represents an action to set the environment by its ID.
|
|
80
109
|
* @remarks
|
|
81
110
|
* This action sends a message to the MetaBox API to load the environment level using the specified environment ID.
|
|
82
|
-
* It requires the MetaBox API to be properly initialized and an event listener to be registered.
|
|
83
111
|
*
|
|
84
112
|
* @example
|
|
85
|
-
* import {
|
|
86
|
-
*
|
|
87
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
88
|
-
* integrateMetaBox(
|
|
89
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
90
|
-
* 'embed3DSource'
|
|
91
|
-
* );
|
|
92
|
-
*
|
|
93
|
-
* // Setup API ready callback
|
|
94
|
-
* window.env3DSource = window.env3DSource || {};
|
|
113
|
+
* import { SetEnvironment } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
95
114
|
* window.env3DSource.apiReady = (api) => {
|
|
96
115
|
* // Change the environment to '55555555-1234-1234-1234-01234567890'
|
|
97
116
|
* new SetEnvironment('55555555-1234-1234-1234-01234567890');
|
|
@@ -120,10 +139,20 @@
|
|
|
120
139
|
* All Rights Reserved
|
|
121
140
|
*/
|
|
122
141
|
/**
|
|
142
|
+
* {@inheritDoc ApiAction}
|
|
143
|
+
*
|
|
123
144
|
* Represents an action to set a product by its ID.
|
|
124
145
|
*
|
|
125
146
|
* @remarks
|
|
126
147
|
* This action sends a message to the MetaBox API to set a product using the provided product ID.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* import { SetProduct } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
151
|
+
* window.env3DSource.apiReady = (api) => {
|
|
152
|
+
* new SetProduct(
|
|
153
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
|
|
154
|
+
* );
|
|
155
|
+
* };
|
|
127
156
|
*/
|
|
128
157
|
class SetProduct extends ApiAction {
|
|
129
158
|
/**
|
|
@@ -148,33 +177,19 @@
|
|
|
148
177
|
* All Rights Reserved
|
|
149
178
|
*/
|
|
150
179
|
/**
|
|
180
|
+
* {@inheritDoc ApiAction}
|
|
181
|
+
*
|
|
151
182
|
* Represents an action to get a PDF from Metabox.
|
|
152
183
|
* @remarks
|
|
153
184
|
* This class sends a message to the MetaBox API to generate a PDF based on the current configuration.
|
|
154
185
|
* This action does not require any parameters.
|
|
155
186
|
*
|
|
156
|
-
* **Important
|
|
157
|
-
*```javascript
|
|
158
|
-
* data.eventType === 'viewportReady' && data.payload === true.
|
|
159
|
-
* ```
|
|
160
|
-
* Only then request be processed.
|
|
187
|
+
* **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
|
|
161
188
|
*
|
|
162
189
|
* @example
|
|
163
|
-
* import {
|
|
164
|
-
*
|
|
165
|
-
* integrateMetaBox(
|
|
166
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
167
|
-
* 'embed3DSource'
|
|
168
|
-
* );
|
|
169
|
-
*
|
|
170
|
-
* window.env3DSource = window.env3DSource || {};
|
|
190
|
+
* import { GetPdf } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
171
191
|
* window.env3DSource.apiReady = (api) => {
|
|
172
|
-
*
|
|
173
|
-
* if (data.eventType === 'viewportReady' && data.payload === true) {
|
|
174
|
-
* // Request a PDF of the current configuration
|
|
175
|
-
* new GetPdf();
|
|
176
|
-
* }
|
|
177
|
-
* });
|
|
192
|
+
* new GetPdf();
|
|
178
193
|
* };
|
|
179
194
|
*/
|
|
180
195
|
class GetPdf extends ApiAction {
|
|
@@ -198,41 +213,21 @@
|
|
|
198
213
|
* All Rights Reserved
|
|
199
214
|
*/
|
|
200
215
|
/**
|
|
216
|
+
* {@inheritDoc ApiAction}
|
|
217
|
+
*
|
|
201
218
|
* Represents an action to set a material by its ID.
|
|
202
219
|
*
|
|
203
220
|
* @remarks
|
|
204
221
|
* This action sends a message to the MetaBox API to update the material on a specific product slot using the provided identifiers.
|
|
205
|
-
|
|
206
|
-
* **Important:** Before invoking this action, ensure that the MetaBox already dispatched
|
|
207
|
-
* as minimum one eventType:"basicConfiguratorDataWithState":
|
|
208
|
-
* ```javascript
|
|
209
|
-
* data.eventType === 'basicConfiguratorDataWithState'.
|
|
210
|
-
* ```
|
|
211
|
-
* Only then request be processed.
|
|
212
222
|
*
|
|
213
223
|
* @example
|
|
214
224
|
* import { SetMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
215
|
-
*
|
|
216
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
217
|
-
* integrateMetaBox(
|
|
218
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
219
|
-
* 'embed3DSource'
|
|
220
|
-
* );
|
|
221
|
-
*
|
|
222
|
-
* // Set up the global API environment
|
|
223
|
-
* window.env3DSource = window.env3DSource || {};
|
|
224
225
|
* window.env3DSource.apiReady = (api) => {
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
231
|
-
* 'carpaint',
|
|
232
|
-
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
233
|
-
* );
|
|
234
|
-
* }
|
|
235
|
-
* });
|
|
226
|
+
* new SetMaterial(
|
|
227
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
228
|
+
* 'carpaint',
|
|
229
|
+
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
230
|
+
* );
|
|
236
231
|
* };
|
|
237
232
|
*/
|
|
238
233
|
class SetMaterial extends ApiAction {
|
|
@@ -262,46 +257,26 @@
|
|
|
262
257
|
* All Rights Reserved
|
|
263
258
|
*/
|
|
264
259
|
/**
|
|
265
|
-
*
|
|
260
|
+
* {@inheritDoc ApiAction}
|
|
261
|
+
*
|
|
262
|
+
* Represents an action to set a environment material by its ID.
|
|
266
263
|
*
|
|
267
264
|
* @remarks
|
|
268
|
-
* This action sends a message to the MetaBox API to update the material on a specific
|
|
269
|
-
|
|
270
|
-
* **Important:** Before invoking this action, ensure that the MetaBox already dispatched
|
|
271
|
-
* as minimum one eventType:"basicConfiguratorDataWithState":
|
|
272
|
-
* ```javascript
|
|
273
|
-
* data.eventType === 'basicConfiguratorDataWithState'.
|
|
274
|
-
* ```
|
|
275
|
-
* Only then request be processed.
|
|
265
|
+
* This action sends a message to the MetaBox API to update the material on a specific environment slot using the provided identifiers.
|
|
276
266
|
*
|
|
277
267
|
* @example
|
|
278
|
-
* import {
|
|
279
|
-
*
|
|
280
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
281
|
-
* integrateMetaBox(
|
|
282
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
283
|
-
* 'embed3DSource'
|
|
284
|
-
* );
|
|
285
|
-
*
|
|
286
|
-
* // Set up the global API environment
|
|
287
|
-
* window.env3DSource = window.env3DSource || {};
|
|
268
|
+
* import { SetEnvironmentMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
288
269
|
* window.env3DSource.apiReady = (api) => {
|
|
289
|
-
*
|
|
290
|
-
*
|
|
291
|
-
*
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
295
|
-
* 'carpaint',
|
|
296
|
-
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
297
|
-
* );
|
|
298
|
-
* }
|
|
299
|
-
* });
|
|
270
|
+
* new SetEnvironmentMaterial(
|
|
271
|
+
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
272
|
+
* 'carpaint',
|
|
273
|
+
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
274
|
+
* );
|
|
300
275
|
* };
|
|
301
276
|
*/
|
|
302
277
|
class SetEnvironmentMaterial extends ApiAction {
|
|
303
278
|
/**
|
|
304
|
-
* Creates an instance of
|
|
279
|
+
* Creates an instance of SetEnvironmentMaterial.
|
|
305
280
|
*
|
|
306
281
|
* @param productId - The product ID.
|
|
307
282
|
* @param slotId - The slot ID.
|
|
@@ -326,40 +301,25 @@
|
|
|
326
301
|
* All Rights Reserved
|
|
327
302
|
*/
|
|
328
303
|
/**
|
|
304
|
+
* {@inheritDoc ApiAction}
|
|
305
|
+
*
|
|
329
306
|
* Represents a fast render action.
|
|
330
307
|
* @remarks
|
|
331
308
|
* This class sends a message to the MetaBox API to obtain a fast render based on the provided format and optional size.
|
|
332
309
|
*
|
|
333
|
-
* **Important
|
|
334
|
-
* ```javascript
|
|
335
|
-
* data.eventType === 'viewportReady' && data.payload === true.
|
|
336
|
-
* ```
|
|
337
|
-
* Only then request be processed.
|
|
310
|
+
* **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
|
|
338
311
|
*
|
|
339
312
|
* @example
|
|
340
|
-
* import {
|
|
341
|
-
*
|
|
342
|
-
* // Integrate the MetaBox configurator into an HTML element with the ID 'embed3DSource'
|
|
343
|
-
* integrateMetaBox(
|
|
344
|
-
* 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
|
|
345
|
-
* 'embed3DSource'
|
|
346
|
-
* );
|
|
347
|
-
*
|
|
348
|
-
* // Set up the global API environment
|
|
349
|
-
* window.env3DSource = window.env3DSource || {};
|
|
313
|
+
* import { GetFastRender,saveImage } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
|
|
350
314
|
* window.env3DSource.apiReady = (api) => {
|
|
351
315
|
* // Listen for events from the MetaBox API
|
|
352
316
|
* api.addEventListener('metaboxData', (data) => {
|
|
353
|
-
* // Ensure the viewport is ready before sending render requests
|
|
354
|
-
* if (data.eventType === 'viewportReady' && data.payload === true) {
|
|
355
|
-
* // Request a fast render (PNG image with 1024x1024 dimensions)
|
|
356
|
-
* new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
357
|
-
* }
|
|
358
317
|
* // Process the fast render response
|
|
359
318
|
* if (data.eventType === 'fastRender') {
|
|
360
319
|
* saveImage(data.payload, 'Render.png');
|
|
361
320
|
* }
|
|
362
321
|
* });
|
|
322
|
+
* new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
363
323
|
* };
|
|
364
324
|
*/
|
|
365
325
|
class GetFastRender extends ApiAction {
|
|
@@ -380,6 +340,27 @@
|
|
|
380
340
|
}
|
|
381
341
|
}
|
|
382
342
|
|
|
343
|
+
/*
|
|
344
|
+
* Copyright (c) 2025.
|
|
345
|
+
* 3DSource.com, Sergii Karanda steve@3dsource.com
|
|
346
|
+
* All Rights Reserved
|
|
347
|
+
*/
|
|
348
|
+
/**
|
|
349
|
+
* {@inheritDoc ApiAction}
|
|
350
|
+
* @internal
|
|
351
|
+
* @hidden
|
|
352
|
+
* Represents an action to send Unreal command.
|
|
353
|
+
*/
|
|
354
|
+
class SendCommandToUnreal extends ApiAction {
|
|
355
|
+
constructor(payload) {
|
|
356
|
+
super();
|
|
357
|
+
this.api.sendMessageToMetaBox({
|
|
358
|
+
payload,
|
|
359
|
+
action: ToMetaBoxApiAction.sendCommandToUnreal,
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
|
|
383
364
|
/*
|
|
384
365
|
* Copyright (c) 2025.
|
|
385
366
|
* 3DSource.com, Sergii Karanda steve@3dsource.com
|
|
@@ -387,6 +368,8 @@
|
|
|
387
368
|
*/
|
|
388
369
|
/**
|
|
389
370
|
* @experimental
|
|
371
|
+
* @internal
|
|
372
|
+
* @hidden
|
|
390
373
|
* @remarks
|
|
391
374
|
* Represents an action to watch Unreal callbacks from Unreal engine.
|
|
392
375
|
* Can be useful for custom solutions.
|
|
@@ -760,6 +743,7 @@
|
|
|
760
743
|
exports.FromMetaboxApiAction = FromMetaboxApiAction;
|
|
761
744
|
exports.GetFastRender = GetFastRender;
|
|
762
745
|
exports.GetPdf = GetPdf;
|
|
746
|
+
exports.SendCommandToUnreal = SendCommandToUnreal;
|
|
763
747
|
exports.SetEnvironment = SetEnvironment;
|
|
764
748
|
exports.SetEnvironmentMaterial = SetEnvironmentMaterial;
|
|
765
749
|
exports.SetMaterial = SetMaterial;
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -82,7 +82,7 @@ export interface FromMetaboxMessagePayloads {
|
|
|
82
82
|
/**
|
|
83
83
|
* Dispatches Every when user toggle fullscreen button in internal menu.
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
isFullScreen: boolean;
|
|
86
86
|
/**
|
|
87
87
|
* Dispatches at the moment while configurator loads. Shows status information.
|
|
88
88
|
*/
|
|
@@ -15,6 +15,7 @@ export declare const ToMetaBoxApiAction: {
|
|
|
15
15
|
readonly setMaterialById: "setMaterialById";
|
|
16
16
|
readonly showEmbeddedMenu: "showEmbeddedMenu";
|
|
17
17
|
readonly forceSetDeviceType: "forceSetDeviceType";
|
|
18
|
+
readonly sendCommandToUnreal: "sendCommandToUnreal";
|
|
18
19
|
readonly setEnvironmentMaterialById: "setEnvironmentMaterialById";
|
|
19
20
|
};
|
|
20
21
|
export type ToMetaBoxActions = (typeof ToMetaBoxApiAction)[keyof typeof ToMetaBoxApiAction];
|
|
@@ -48,6 +49,7 @@ export interface ToMetaboxMessagePayloads {
|
|
|
48
49
|
slotId: string;
|
|
49
50
|
materialId: string;
|
|
50
51
|
};
|
|
52
|
+
sendCommandToUnreal: unknown;
|
|
51
53
|
setEnvironmentMaterialById: {
|
|
52
54
|
productId: string;
|
|
53
55
|
slotId: string;
|
|
@@ -6,7 +6,7 @@ export interface ConfiguratorEnvelope {
|
|
|
6
6
|
/**
|
|
7
7
|
* A reference to the universal configurator.
|
|
8
8
|
*/
|
|
9
|
-
configurator: UniversalConfigurator
|
|
9
|
+
configurator: UniversalConfigurator;
|
|
10
10
|
/**
|
|
11
11
|
* The unique product identifier.
|
|
12
12
|
*/
|
|
@@ -16,7 +16,9 @@ export interface ConfiguratorEnvelope {
|
|
|
16
16
|
*/
|
|
17
17
|
productMaterialsIds: SelectedIds;
|
|
18
18
|
/**
|
|
19
|
-
* @deprecated,
|
|
19
|
+
* @deprecated,
|
|
20
|
+
* use `productMaterialsIds` instead.
|
|
21
|
+
* @hidden
|
|
20
22
|
*/
|
|
21
23
|
selectedMaterials: SelectedIds;
|
|
22
24
|
/**
|
|
@@ -74,6 +76,8 @@ export interface Product {
|
|
|
74
76
|
thumbnailList: Thumbnail[];
|
|
75
77
|
/** Available slots for the product. */
|
|
76
78
|
slots: Slot[];
|
|
79
|
+
/** List of metaProperties for the product (optional). */
|
|
80
|
+
metaProperties: MetaProperty[];
|
|
77
81
|
/** The model information associated with the product. */
|
|
78
82
|
/** Unique identifier for the product. */
|
|
79
83
|
id: string;
|
|
@@ -107,6 +111,21 @@ export interface Slot {
|
|
|
107
111
|
/** GraphQL typename for the slot. */
|
|
108
112
|
__typename: 'Slot';
|
|
109
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Represents a metaProperty within a product that may allow business logic customization.
|
|
116
|
+
*/
|
|
117
|
+
export interface MetaProperty {
|
|
118
|
+
/** Unique identifier for the metaProperty. */
|
|
119
|
+
id: string;
|
|
120
|
+
/** Display name for the metaProperty. */
|
|
121
|
+
name: string;
|
|
122
|
+
/** Value for the metaProperty. */
|
|
123
|
+
value: string;
|
|
124
|
+
/** Type for the metaProperty. */
|
|
125
|
+
type: string;
|
|
126
|
+
/** GraphQL typename for the metaProperty. */
|
|
127
|
+
__typename: 'MetaProperty';
|
|
128
|
+
}
|
|
110
129
|
/**
|
|
111
130
|
* Represents a material that can be applied to a product slot.
|
|
112
131
|
*/
|
package/package.json
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3dsource/metabox-front-api",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.14",
|
|
4
4
|
"description": "API for MetaBox BASIC configurator",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"type": "module",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"build": "rollup -c",
|
|
12
|
-
"clean": "rimraf dist",
|
|
13
|
-
"packAll": "npm run clean && npm run build && npm pack",
|
|
14
|
-
"publishApi": "npm run packAll && npm publish --access public",
|
|
15
|
-
"apiDoc": "typedoc --entryPointStrategy Expand src/index.ts --tsconfig ./../../../tsconfig.typedoc.json --out ./../../../dist/browser/apiDocBasic"
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist/**/*"
|
|
5
|
+
"keywords": [
|
|
6
|
+
"metabox",
|
|
7
|
+
"api",
|
|
8
|
+
"configurator"
|
|
19
9
|
],
|
|
20
10
|
"repository": {
|
|
21
11
|
"type": "git",
|
|
22
12
|
"url": "git@bitbucket.org:dreamsoft/ams_vps-frontend.git"
|
|
23
13
|
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": "3dsource.com",
|
|
16
|
+
"type": "module",
|
|
24
17
|
"exports": {
|
|
25
|
-
".":
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.esm.js",
|
|
20
|
+
"require": "./dist/index.umd.js",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
22
|
+
}
|
|
26
23
|
},
|
|
24
|
+
"main": "dist/index.umd.js",
|
|
25
|
+
"jsdelivr": "dist/index.esm.js",
|
|
26
|
+
"unpkg": "dist/index.esm.js",
|
|
27
|
+
"module": "dist/index.esm.js",
|
|
27
28
|
"types": "dist/index.d.ts",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"api",
|
|
31
|
-
"configurator"
|
|
29
|
+
"files": [
|
|
30
|
+
"dist/**/*"
|
|
32
31
|
],
|
|
33
|
-
"
|
|
34
|
-
|
|
32
|
+
"scripts": {
|
|
33
|
+
"apiDoc": "typedoc --entryPointStrategy Expand src/index.ts --tsconfig ./../../../tsconfig.typedoc.json --out ./../../../dist/browser/apiDocBasic",
|
|
34
|
+
"build": "rollup -c",
|
|
35
|
+
"clean": "rimraf dist",
|
|
36
|
+
"packAll": "npm run clean && npm run build && npm pack",
|
|
37
|
+
"publishApi": "npm run packAll && npm publish --access public"
|
|
38
|
+
},
|
|
35
39
|
"devDependencies": {
|
|
36
40
|
"rimraf": "^3.0.2",
|
|
37
41
|
"rollup": "^4.39.0",
|