@3dsource/metabox-front-api 0.0.17 → 0.0.19-beta.0
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 +121 -105
- package/dist/actions/CommandBase.d.ts +7 -0
- package/dist/actions/GetFastRender.d.ts +10 -14
- package/dist/actions/GetPdf.d.ts +8 -8
- package/dist/actions/SendCommandToUnreal.d.ts +4 -4
- package/dist/actions/SetEnvironment.d.ts +7 -9
- package/dist/actions/SetEnvironmentMaterial.d.ts +8 -11
- package/dist/actions/SetMaterial.d.ts +8 -11
- package/dist/actions/SetProduct.d.ts +8 -8
- package/dist/actions/ShowEmbeddedMenu.d.ts +7 -10
- package/dist/actions/ShowOverlayInterface.d.ts +7 -7
- package/dist/actions/WatchCallbacks.d.ts +3 -3
- package/dist/const/FromMetaboxApiAction.d.ts +52 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +119 -228
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +119 -231
- package/dist/index.umd.js.map +1 -1
- package/dist/interfaces/FromMetaboxMessagePayloads.d.ts +30 -82
- package/dist/interfaces/ToMetaboxMessagePayloads.d.ts +8 -22
- package/dist/interfaces/UniversalConfigurator.d.ts +42 -2
- package/dist/interfaces/application-device-types.d.ts +1 -10
- package/dist/lib/{initializeCommunicator.d.ts → Communicator.d.ts} +7 -13
- package/dist/lib/EventDispatcher.d.ts +3 -3
- package/dist/lib/integrateMetaBox.d.ts +4 -3
- package/dist/lib/test/Communicator.spec.d.ts +1 -0
- package/dist/lib/test/integrateMetabox.spec.d.ts +9 -0
- package/package.json +14 -10
- package/dist/actions/ApiAction.d.ts +0 -26
package/README.md
CHANGED
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
This package provides an API for interacting with the MetaBox Basic Configurator using plain JavaScript.
|
|
4
4
|
|
|
5
|
-
### Installation (for using with frameworks like Angular, React, etc.) This is recommended method
|
|
5
|
+
### Installation (for using with frameworks like Angular, React, etc.) This is the recommended method
|
|
6
6
|
|
|
7
7
|
```sh
|
|
8
|
-
npm install @3dsource/metabox-front-api --save
|
|
8
|
+
npm install @3dsource/metabox-front-api@^1.0.0 --save
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
then
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu
|
|
14
|
+
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu, ShowOverlayInterface, SetEnvironmentMaterial, Communicator, ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
15
15
|
```
|
|
16
16
|
|
|
17
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
|
-
|
|
20
|
+
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu, ShowOverlayInterface, SetEnvironmentMaterial, Communicator, ConfiguratorEnvelope } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@1.0.0';
|
|
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.**
|
|
@@ -43,160 +43,176 @@ Insert this code into your HTML file just before the closing `</body>` tag:
|
|
|
43
43
|
|
|
44
44
|
**EXAMPLE:**
|
|
45
45
|
|
|
46
|
+
HTML:
|
|
47
|
+
|
|
46
48
|
```html
|
|
47
49
|
<script type="module">
|
|
48
|
-
import { integrateMetaBox, SetEnvironment, ShowOverlayInterface, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, FromMetaboxApiAction } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
50
|
+
import { integrateMetaBox, SetEnvironment, ShowOverlayInterface, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, Communicator, FromMetaboxApiAction } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@1.0.0';
|
|
51
|
+
|
|
52
|
+
class JsIntegrator {
|
|
53
|
+
constructor() {
|
|
54
|
+
const url = 'https://metabox.3dsource.com/metabox-configurator/basic/your-configurator-id?sidebar=false';
|
|
55
|
+
integrateMetaBox(url, 'embed3DSource', (api) => this.apiReady(api));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
apiReady(api) {
|
|
59
|
+
api.addEventListener('basicConfiguratorDataWithState', (data) => {
|
|
60
|
+
this.updateConfiguratorData(data);
|
|
61
|
+
});
|
|
62
|
+
api.addEventListener('fastRender', (data) => {
|
|
63
|
+
saveImage(data, 'Render.png');
|
|
64
|
+
});
|
|
65
|
+
this.setupInitialState(api);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
updateConfiguratorData(data) {
|
|
69
|
+
// Use data on your own
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
setupInitialState(api) {
|
|
73
|
+
api.sendCommandToMetaBox(new SetProduct('productId'));
|
|
74
|
+
api.sendCommandToMetaBox(new SetEnvironment('environmentId'));
|
|
75
|
+
api.sendCommandToMetaBox(new SetMaterial('productId', 'slotId', 'materialId'));
|
|
76
|
+
api.sendCommandToMetaBox(new SetEnvironmentMaterial('productId', 'slotId', 'materialId'));
|
|
77
|
+
api.sendCommandToMetaBox(new ShowEmbeddedMenu(false));
|
|
78
|
+
api.sendCommandToMetaBox(new ShowOverlayInterface(false));
|
|
79
|
+
api.sendCommandToMetaBox(new GetPdf());
|
|
80
|
+
api.sendCommandToMetaBox(new GetFastRender('image/png', { x: 1024, y: 1024 }));
|
|
81
|
+
}
|
|
76
82
|
}
|
|
77
83
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
*/
|
|
82
|
-
function setupInitialState() {
|
|
83
|
-
// All commands can be used at any time from the moment api is ready and will be buffered automatically
|
|
84
|
-
// i.e. GetFastRender and GetPdf will be executed when the viewport is ready
|
|
85
|
-
|
|
86
|
-
// Set product
|
|
87
|
-
new SetProduct('productId');
|
|
88
|
-
|
|
89
|
-
// Set environment
|
|
90
|
-
new SetEnvironment('environmentId');
|
|
84
|
+
new JsIntegrator();
|
|
85
|
+
</script>
|
|
86
|
+
```
|
|
91
87
|
|
|
92
|
-
|
|
93
|
-
new SetMaterial('productId', 'slotId', 'materialId');
|
|
88
|
+
TypeScript:
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
```typescript
|
|
91
|
+
import { ConfiguratorEnvelope, UniversalConfigurator, integrateMetaBox, SetEnvironment, ShowOverlayInterface, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, Communicator, FromMetaboxApiAction } from '@3dsource/metabox-front-api';
|
|
97
92
|
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
class TsIntegrator {
|
|
94
|
+
constructor() {
|
|
95
|
+
const url = 'https://metabox.3dsource.com/metabox-configurator/basic/your-configurator-id?sidebar=false';
|
|
96
|
+
integrateMetaBox(url, 'embed3DSource', (api) => this.apiReady(api));
|
|
97
|
+
}
|
|
100
98
|
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
apiReady(api: Communicator) {
|
|
100
|
+
api.addEventListener('basicConfiguratorDataWithState', (data) => {
|
|
101
|
+
this.updateConfiguratorData(data);
|
|
102
|
+
});
|
|
103
|
+
api.addEventListener('fastRender', (data) => {
|
|
104
|
+
saveImage(data, 'Render.png');
|
|
105
|
+
});
|
|
106
|
+
this.setupInitialState(api);
|
|
107
|
+
}
|
|
103
108
|
|
|
104
|
-
|
|
105
|
-
|
|
109
|
+
updateConfiguratorData(data: ConfiguratorEnvelope) {
|
|
110
|
+
// Use data on your own
|
|
111
|
+
}
|
|
106
112
|
|
|
107
|
-
|
|
108
|
-
new
|
|
113
|
+
setupInitialState(api: Communicator) {
|
|
114
|
+
api.sendCommandToMetaBox(new SetProduct('productId'));
|
|
115
|
+
api.sendCommandToMetaBox(new SetEnvironment('environmentId'));
|
|
116
|
+
api.sendCommandToMetaBox(new SetMaterial('productId', 'slotId', 'materialId'));
|
|
117
|
+
api.sendCommandToMetaBox(new SetEnvironmentMaterial('productId', 'slotId', 'materialId'));
|
|
118
|
+
api.sendCommandToMetaBox(new ShowEmbeddedMenu(false));
|
|
119
|
+
api.sendCommandToMetaBox(new ShowOverlayInterface(false));
|
|
120
|
+
api.sendCommandToMetaBox(new GetPdf());
|
|
121
|
+
api.sendCommandToMetaBox(new GetFastRender('image/png', { x: 1024, y: 1024 }));
|
|
109
122
|
}
|
|
123
|
+
}
|
|
110
124
|
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Additional url parameters:
|
|
114
|
-
* @see integrateMetaBox
|
|
115
|
-
* @type {string}
|
|
116
|
-
*/
|
|
117
|
-
const url = 'https://metabox.3dsource.com/metabox-configurator/basic/your-configurator-id?sidebar=false';
|
|
118
|
-
integrateMetaBox(url, 'embed3DSource');
|
|
119
|
-
</script>
|
|
125
|
+
new TsIntegrator();
|
|
120
126
|
```
|
|
121
127
|
|
|
122
128
|
### Documentation for current example
|
|
123
129
|
|
|
124
|
-
|
|
130
|
+
#### `integrateMetaBox`
|
|
131
|
+
|
|
132
|
+
* **Description**: Integrates the MetaBox configurator into the specified container.
|
|
133
|
+
* **Usage**:
|
|
125
134
|
|
|
126
|
-
- **Description**: Integrates the MetaBox configurator into the specified container.
|
|
127
|
-
- **Usage**:
|
|
128
135
|
```typescript
|
|
129
|
-
integrateMetaBox(configuratorUrl: string, containerId: string
|
|
136
|
+
integrateMetaBox(configuratorUrl: string, containerId: string, apiReadyCallback: (api: Communicator) => void);
|
|
130
137
|
```
|
|
131
138
|
|
|
132
|
-
|
|
139
|
+
#### `SetEnvironment`
|
|
140
|
+
|
|
141
|
+
* **Description**: Sets the environment by ID.
|
|
142
|
+
* **Usage**:
|
|
133
143
|
|
|
134
|
-
- **Description**: Sets the environment by ID.
|
|
135
|
-
- **Constructor**:
|
|
136
144
|
```typescript
|
|
137
|
-
new SetEnvironment(environmentId: string);
|
|
145
|
+
api.sendCommandToMetaBox(new SetEnvironment(environmentId: string));
|
|
138
146
|
```
|
|
139
147
|
|
|
140
|
-
|
|
148
|
+
#### `SetMaterial`
|
|
149
|
+
|
|
150
|
+
* **Description**: Sets the material for a given product slot.
|
|
151
|
+
* **Usage**:
|
|
141
152
|
|
|
142
|
-
- **Description**: Sets the material for a given product slot.
|
|
143
|
-
- **Constructor**:
|
|
144
153
|
```typescript
|
|
145
|
-
new SetMaterial(productId: string, slotId: string, materialId: string);
|
|
154
|
+
api.sendCommandToMetaBox(new SetMaterial(productId: string, slotId: string, materialId: string));
|
|
146
155
|
```
|
|
147
156
|
|
|
148
|
-
|
|
157
|
+
#### `SetEnvironmentMaterial`
|
|
158
|
+
|
|
159
|
+
* **Description**: Sets the material for a given environment slot.
|
|
160
|
+
* **Usage**:
|
|
149
161
|
|
|
150
|
-
- **Description**: Sets the material for a given environment slot.
|
|
151
|
-
- **Constructor**:
|
|
152
162
|
```typescript
|
|
153
|
-
new SetEnvironmentMaterial(productId: string, slotId: string, materialId: string);
|
|
163
|
+
api.sendCommandToMetaBox(new SetEnvironmentMaterial(productId: string, slotId: string, materialId: string));
|
|
154
164
|
```
|
|
155
165
|
|
|
156
|
-
|
|
166
|
+
#### `SetProduct`
|
|
167
|
+
|
|
168
|
+
* **Description**: Sets the product by ID.
|
|
169
|
+
* **Usage**:
|
|
157
170
|
|
|
158
|
-
- **Description**: Sets the product by ID.
|
|
159
|
-
- **Constructor**:
|
|
160
171
|
```typescript
|
|
161
|
-
new SetProduct(productId: string);
|
|
172
|
+
api.sendCommandToMetaBox(new SetProduct(productId: string));
|
|
162
173
|
```
|
|
163
174
|
|
|
164
|
-
|
|
175
|
+
#### `ShowEmbeddedMenu`
|
|
176
|
+
|
|
177
|
+
* **Description**: Toggles the embedded menu in the MetaBox configurator.
|
|
178
|
+
* **Usage**:
|
|
165
179
|
|
|
166
|
-
- **Description**: Toggles the embedded menu in the MetaBox configurator.
|
|
167
|
-
- **Constructor**:
|
|
168
180
|
```typescript
|
|
169
|
-
new ShowEmbeddedMenu(visible: boolean);
|
|
181
|
+
api.sendCommandToMetaBox(new ShowEmbeddedMenu(visible: boolean));
|
|
170
182
|
```
|
|
171
183
|
|
|
172
|
-
|
|
184
|
+
#### `ShowOverlayInterface`
|
|
185
|
+
|
|
186
|
+
* **Description**: Toggles the overlay interface over Unreal viewport.
|
|
187
|
+
* **Usage**:
|
|
173
188
|
|
|
174
|
-
- **Description**: Toggles the overlay interface over Unreal viewport.
|
|
175
|
-
- **Constructor**:
|
|
176
189
|
```typescript
|
|
177
|
-
new ShowOverlayInterface(visible: boolean);
|
|
190
|
+
api.sendCommandToMetaBox(new ShowOverlayInterface(visible: boolean));
|
|
178
191
|
```
|
|
179
192
|
|
|
180
|
-
|
|
193
|
+
#### `GetFastRender`
|
|
194
|
+
|
|
195
|
+
* **Description**: Retrieves a fast render of the current view.
|
|
196
|
+
* **Usage**:
|
|
181
197
|
|
|
182
|
-
- **Description**: Retrieves a fast render of the current view.
|
|
183
|
-
- **Usage**:
|
|
184
198
|
```typescript
|
|
185
|
-
new GetFastRender(mimeType: string, size?: { x: number, y: number });
|
|
199
|
+
api.sendCommandToMetaBox(new GetFastRender(mimeType: string, size?: { x: number, y: number }));
|
|
186
200
|
```
|
|
187
201
|
|
|
188
|
-
|
|
202
|
+
#### `GetPdf`
|
|
203
|
+
|
|
204
|
+
* **Description**: Generates a PDF of the current view.
|
|
205
|
+
* **Usage**:
|
|
189
206
|
|
|
190
|
-
- **Description**: Generates a PDF of the current view.
|
|
191
|
-
- **Usage**:
|
|
192
207
|
```typescript
|
|
193
|
-
new GetPdf();
|
|
208
|
+
api.sendCommandToMetaBox(new GetPdf());
|
|
194
209
|
```
|
|
195
210
|
|
|
196
|
-
|
|
211
|
+
#### `saveImage`
|
|
212
|
+
|
|
213
|
+
* **Description**: Saves the arrived rendered image to a file using utility function.
|
|
214
|
+
* **Usage**:
|
|
197
215
|
|
|
198
|
-
- **Description**: Saves the arrived rendered image to a file using utility function.
|
|
199
|
-
- **Usage**:
|
|
200
216
|
```typescript
|
|
201
217
|
saveImage(renderData: string, fileName: string): void;
|
|
202
218
|
```
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
3
|
* Image format.
|
|
4
4
|
* @remarks
|
|
@@ -6,28 +6,24 @@ import { ApiAction } from './ApiAction';
|
|
|
6
6
|
*/
|
|
7
7
|
export type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
8
8
|
/**
|
|
9
|
-
* {@inheritDoc
|
|
9
|
+
* {@inheritDoc CommandBase}
|
|
10
10
|
*
|
|
11
|
-
* Represents a fast render
|
|
12
|
-
* @remarks
|
|
13
|
-
* This class sends a message to the MetaBox API to obtain a fast render based on the provided format and optional size.
|
|
11
|
+
* Represents a command to get fast render.
|
|
14
12
|
*
|
|
15
|
-
* **Important**: Invoking this
|
|
13
|
+
* **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
|
|
16
14
|
*
|
|
17
15
|
* @example
|
|
18
|
-
* import { GetFastRender,saveImage } from '
|
|
19
|
-
* window.env3DSource.apiReady = (api) => {
|
|
16
|
+
* import { GetFastRender,Communicator,saveImage } from '@3dsource/metabox-front-api';
|
|
17
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
20
18
|
* // Listen for events from the MetaBox API
|
|
21
|
-
* api.addEventListener('
|
|
19
|
+
* api.addEventListener('fastRender', (data) => {
|
|
22
20
|
* // Process the fast render response
|
|
23
|
-
*
|
|
24
|
-
* saveImage(data.payload, 'Render.png');
|
|
25
|
-
* }
|
|
21
|
+
* saveImage(data, 'Render.png');
|
|
26
22
|
* });
|
|
27
|
-
* new GetFastRender('image/png', { x: 1024, y: 1024 });
|
|
23
|
+
* api.sendCommandToMetaBox(new GetFastRender('image/png', { x: 1024, y: 1024 }));
|
|
28
24
|
* };
|
|
29
25
|
*/
|
|
30
|
-
export declare class GetFastRender extends
|
|
26
|
+
export declare class GetFastRender extends CommandBase {
|
|
31
27
|
/**
|
|
32
28
|
* Constructs an instance of GetFastRender.
|
|
33
29
|
* @param mimeType - The output format.
|
package/dist/actions/GetPdf.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
*
|
|
5
|
-
* Represents
|
|
5
|
+
* Represents a command to get a PDF from Metabox.
|
|
6
6
|
* @remarks
|
|
7
7
|
* This class sends a message to the MetaBox API to generate a PDF based on the current configuration.
|
|
8
8
|
* This action does not require any parameters.
|
|
9
9
|
*
|
|
10
|
-
* **Important**: Invoking this
|
|
10
|
+
* **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
|
-
* import { GetPdf } from '
|
|
14
|
-
* window.env3DSource.apiReady = (api) => {
|
|
15
|
-
* new GetPdf();
|
|
13
|
+
* import { GetPdf,Communicator } from '@3dsource/metabox-front-api';
|
|
14
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
15
|
+
* api.sendCommandToMetaBox(new GetPdf());
|
|
16
16
|
* };
|
|
17
17
|
*/
|
|
18
|
-
export declare class GetPdf extends
|
|
18
|
+
export declare class GetPdf extends CommandBase {
|
|
19
19
|
/**
|
|
20
20
|
* Creates an instance of GetPdf.
|
|
21
21
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
* @internal
|
|
5
5
|
* @hidden
|
|
6
|
-
* Represents
|
|
6
|
+
* Represents a command to send Unreal command.
|
|
7
7
|
*/
|
|
8
|
-
export declare class SendCommandToUnreal extends
|
|
8
|
+
export declare class SendCommandToUnreal extends CommandBase {
|
|
9
9
|
constructor(payload: unknown);
|
|
10
10
|
}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
*
|
|
5
|
-
* Represents
|
|
6
|
-
* @remarks
|
|
7
|
-
* This action sends a message to the MetaBox API to load the environment level using the specified environment ID.
|
|
5
|
+
* Represents a command to set the environment by its ID.
|
|
8
6
|
*
|
|
9
7
|
* @example
|
|
10
|
-
* import { SetEnvironment } from '
|
|
11
|
-
* window.env3DSource.apiReady = (api) => {
|
|
8
|
+
* import { SetEnvironment,Communicator } from '@3dsource/metabox-front-api';
|
|
9
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
12
10
|
* // Change the environment to '55555555-1234-1234-1234-01234567890'
|
|
13
|
-
* new SetEnvironment('55555555-1234-1234-1234-01234567890');
|
|
11
|
+
* api.sendCommandToMetaBox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));
|
|
14
12
|
* };
|
|
15
13
|
*/
|
|
16
|
-
export declare class SetEnvironment extends
|
|
14
|
+
export declare class SetEnvironment extends CommandBase {
|
|
17
15
|
/**
|
|
18
16
|
* Creates an instance of SetEnvironment.
|
|
19
17
|
*
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
*
|
|
5
|
-
* Represents
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* This action sends a message to the MetaBox API to update the material on a specific environment slot using the provided identifiers.
|
|
5
|
+
* Represents a command to set an environment material by its ID.
|
|
9
6
|
*
|
|
10
7
|
* @example
|
|
11
|
-
* import { SetEnvironmentMaterial } from '
|
|
12
|
-
* window.env3DSource.apiReady = (api) => {
|
|
13
|
-
* new SetEnvironmentMaterial(
|
|
8
|
+
* import { SetEnvironmentMaterial,Communicator } from '@3dsource/metabox-front-api';
|
|
9
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
10
|
+
* api.sendCommandToMetaBox(new SetEnvironmentMaterial(
|
|
14
11
|
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
15
12
|
* 'carpaint',
|
|
16
13
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
17
|
-
* );
|
|
14
|
+
* ));
|
|
18
15
|
* };
|
|
19
16
|
*/
|
|
20
|
-
export declare class SetEnvironmentMaterial extends
|
|
17
|
+
export declare class SetEnvironmentMaterial extends CommandBase {
|
|
21
18
|
/**
|
|
22
19
|
* Creates an instance of SetEnvironmentMaterial.
|
|
23
20
|
*
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
*
|
|
5
|
-
* Represents
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* This action sends a message to the MetaBox API to update the material on a specific product slot using the provided identifiers.
|
|
5
|
+
* Represents a command to set a material by its ID.
|
|
9
6
|
*
|
|
10
7
|
* @example
|
|
11
|
-
* import { SetMaterial } from '
|
|
12
|
-
* window.env3DSource.apiReady = (api) => {
|
|
13
|
-
* new SetMaterial(
|
|
8
|
+
* import { SetMaterial,Communicator } from '@3dsource/metabox-front-api';
|
|
9
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
10
|
+
* api.sendCommandToMetaBox(new SetMaterial(
|
|
14
11
|
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
|
|
15
12
|
* 'carpaint',
|
|
16
13
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
17
|
-
* );
|
|
14
|
+
* ));
|
|
18
15
|
* };
|
|
19
16
|
*/
|
|
20
|
-
export declare class SetMaterial extends
|
|
17
|
+
export declare class SetMaterial extends CommandBase {
|
|
21
18
|
/**
|
|
22
19
|
* Creates an instance of SetMaterial.
|
|
23
20
|
*
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
*
|
|
5
|
-
* Represents
|
|
5
|
+
* Represents a command to set a product by its ID.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* This action sends a message to the MetaBox API to set a product using the provided product ID.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* import { SetProduct } from '
|
|
12
|
-
* window.env3DSource.apiReady = (api) => {
|
|
13
|
-
* new SetProduct(
|
|
11
|
+
* import { SetProduct,Communicator } from '@3dsource/metabox-front-api';
|
|
12
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
13
|
+
* api.setCommandToMetaBox(new SetProduct(
|
|
14
14
|
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
|
|
15
|
-
* );
|
|
15
|
+
* ));
|
|
16
16
|
* };
|
|
17
17
|
*/
|
|
18
|
-
export declare class SetProduct extends
|
|
18
|
+
export declare class SetProduct extends CommandBase {
|
|
19
19
|
/**
|
|
20
20
|
* Creates an instance of SetProduct.
|
|
21
21
|
*
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
*
|
|
5
|
-
* Represents
|
|
6
|
-
*
|
|
7
|
-
* @remarks
|
|
8
|
-
* This action sends a message to the MetaBox API to toggle the visibility of the embedded menu.
|
|
5
|
+
* Represents a command to toggle the Embedded MetaBox Menu.
|
|
9
6
|
*
|
|
10
7
|
* @example
|
|
11
|
-
* import { ShowEmbeddedMenu } from '
|
|
12
|
-
* window.env3DSource.apiReady = (api) => {
|
|
13
|
-
* new ShowEmbeddedMenu(true);
|
|
8
|
+
* import { ShowEmbeddedMenu,Communicator } from '@3dsource/metabox-front-api';
|
|
9
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
10
|
+
* api.setCommandToMetaBox(new ShowEmbeddedMenu(true));
|
|
14
11
|
* };
|
|
15
12
|
*/
|
|
16
|
-
export declare class ShowEmbeddedMenu extends
|
|
13
|
+
export declare class ShowEmbeddedMenu extends CommandBase {
|
|
17
14
|
/**
|
|
18
15
|
* Creates an instance of ShowEmbeddedMenu.
|
|
19
16
|
*
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
|
-
* {@inheritDoc
|
|
3
|
+
* {@inheritDoc CommandBase}
|
|
4
4
|
*
|
|
5
|
-
* Represents
|
|
5
|
+
* Represents a command to toggle the Unreal Overlay Interface Menu.
|
|
6
6
|
*
|
|
7
7
|
* @remarks
|
|
8
8
|
* This action sends a message to the MetaBox API to toggle the visibility of the Unreal overlay UI.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
|
-
* import { ShowOverlayInterface } from '
|
|
12
|
-
* window.env3DSource.apiReady = (api) => {
|
|
13
|
-
* new ShowOverlayInterface(true);
|
|
11
|
+
* import { ShowOverlayInterface,Communicator } from '@3dsource/metabox-front-api';
|
|
12
|
+
* window.env3DSource.apiReady = (api:Communicator) => {
|
|
13
|
+
* api.setCommandToMetaBox(new ShowOverlayInterface(true));
|
|
14
14
|
* };
|
|
15
15
|
*/
|
|
16
|
-
export declare class ShowOverlayInterface extends
|
|
16
|
+
export declare class ShowOverlayInterface extends CommandBase {
|
|
17
17
|
/**
|
|
18
18
|
* Creates an instance of ShowOverlayInterface.
|
|
19
19
|
*
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CommandBase } from './CommandBase';
|
|
2
2
|
/**
|
|
3
3
|
* @experimental
|
|
4
4
|
* @internal
|
|
5
5
|
* @hidden
|
|
6
6
|
* @remarks
|
|
7
|
-
* Represents
|
|
7
|
+
* Represents a command to watch Unreal callbacks from Unreal engine.
|
|
8
8
|
* Can be useful for custom solutions.
|
|
9
9
|
*/
|
|
10
|
-
export declare class WatchCallbacks extends
|
|
10
|
+
export declare class WatchCallbacks extends CommandBase {
|
|
11
11
|
/**
|
|
12
12
|
* Creates an instance of WatchCallbacks.
|
|
13
13
|
*
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type FromMetaboxApiAction = 'bridge' | 'appLoaded'
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "unrealFeature"
|
|
5
|
+
*/
|
|
6
|
+
| 'unrealFeatureBridge'
|
|
7
|
+
/**
|
|
8
|
+
* @hidden
|
|
9
|
+
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "unrealCallback"
|
|
10
|
+
*/
|
|
11
|
+
| 'unrealCallback'
|
|
12
|
+
/**
|
|
13
|
+
* @hidden
|
|
14
|
+
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
15
|
+
*/
|
|
16
|
+
| 'configuratorDataWithStateBridge'
|
|
17
|
+
/**
|
|
18
|
+
* @hidden
|
|
19
|
+
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
20
|
+
*/
|
|
21
|
+
| 'configuratorDataBridge'
|
|
22
|
+
/**
|
|
23
|
+
* @hidden
|
|
24
|
+
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
25
|
+
*/
|
|
26
|
+
| 'menuDataBridge'
|
|
27
|
+
/**
|
|
28
|
+
* @hidden
|
|
29
|
+
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
30
|
+
*/
|
|
31
|
+
| 'flatMenuDataBridge'
|
|
32
|
+
/**
|
|
33
|
+
* @hidden
|
|
34
|
+
* @deprecated, use Bridge with isFullscreen
|
|
35
|
+
*/
|
|
36
|
+
| 'fullScreenBridge'
|
|
37
|
+
/**
|
|
38
|
+
* @hidden
|
|
39
|
+
* @deprecated, use Bridge with streamResolution
|
|
40
|
+
*/
|
|
41
|
+
| 'videoSize'
|
|
42
|
+
/**
|
|
43
|
+
* @hidden
|
|
44
|
+
* Used in a platform, must be removed in future
|
|
45
|
+
* @deprecated
|
|
46
|
+
*/
|
|
47
|
+
| 'unrealResponse'
|
|
48
|
+
/**
|
|
49
|
+
* @hidden
|
|
50
|
+
* @deprecated\
|
|
51
|
+
*/
|
|
52
|
+
| 'getFastRender';
|