@3dsource/metabox-front-api 0.0.15 → 0.0.17

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 CHANGED
@@ -17,7 +17,7 @@ import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImag
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
- import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu,... } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
20
+ import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu,... } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest';
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.**
@@ -45,8 +45,9 @@ 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, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, FromMetaboxApiAction } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
48
+ import { integrateMetaBox, SetEnvironment, ShowOverlayInterface, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, FromMetaboxApiAction } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest';
49
49
  // Expose API
50
+ window.env3DSource = { ...window.env3DSource };
50
51
  window.env3DSource.apiReady = (api) => {
51
52
  api.addEventListener('metaboxData', (data) => {
52
53
  const { action, payload, eventType } = data;
@@ -97,6 +98,9 @@ Insert this code into your HTML file just before the closing `</body>` tag:
97
98
  // Toggle embedded menu
98
99
  new ShowEmbeddedMenu(false);
99
100
 
101
+ // Toggle overlay interface
102
+ new ShowOverlayInterface(false);
103
+
100
104
  //Request Pdf, Will execute as stream is ready, will be auto-downloaded
101
105
  new GetPdf();
102
106
 
@@ -165,6 +169,14 @@ Insert this code into your HTML file just before the closing `</body>` tag:
165
169
  new ShowEmbeddedMenu(visible: boolean);
166
170
  ```
167
171
 
172
+ ### `ShowOverlayInterface`
173
+
174
+ - **Description**: Toggles the overlay interface over Unreal viewport.
175
+ - **Constructor**:
176
+ ```typescript
177
+ new ShowOverlayInterface(visible: boolean);
178
+ ```
179
+
168
180
  ### `GetFastRender`
169
181
 
170
182
  - **Description**: Retrieves a fast render of the current view.
@@ -15,7 +15,7 @@ export type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
15
15
  * **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
16
16
  *
17
17
  * @example
18
- * import { GetFastRender,saveImage } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
18
+ * import { GetFastRender,saveImage } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
19
19
  * window.env3DSource.apiReady = (api) => {
20
20
  * // Listen for events from the MetaBox API
21
21
  * api.addEventListener('metaboxData', (data) => {
@@ -10,7 +10,7 @@ import { ApiAction } from './ApiAction';
10
10
  * **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
11
11
  *
12
12
  * @example
13
- * import { GetPdf } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
13
+ * import { GetPdf } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
14
14
  * window.env3DSource.apiReady = (api) => {
15
15
  * new GetPdf();
16
16
  * };
@@ -7,7 +7,7 @@ import { ApiAction } from './ApiAction';
7
7
  * This action sends a message to the MetaBox API to load the environment level using the specified environment ID.
8
8
  *
9
9
  * @example
10
- * import { SetEnvironment } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
10
+ * import { SetEnvironment } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
11
11
  * window.env3DSource.apiReady = (api) => {
12
12
  * // Change the environment to '55555555-1234-1234-1234-01234567890'
13
13
  * new SetEnvironment('55555555-1234-1234-1234-01234567890');
@@ -8,7 +8,7 @@ import { ApiAction } from './ApiAction';
8
8
  * This action sends a message to the MetaBox API to update the material on a specific environment slot using the provided identifiers.
9
9
  *
10
10
  * @example
11
- * import { SetEnvironmentMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
11
+ * import { SetEnvironmentMaterial } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
12
12
  * window.env3DSource.apiReady = (api) => {
13
13
  * new SetEnvironmentMaterial(
14
14
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
@@ -8,7 +8,7 @@ import { ApiAction } from './ApiAction';
8
8
  * This action sends a message to the MetaBox API to update the material on a specific product slot using the provided identifiers.
9
9
  *
10
10
  * @example
11
- * import { SetMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
11
+ * import { SetMaterial } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
12
12
  * window.env3DSource.apiReady = (api) => {
13
13
  * new SetMaterial(
14
14
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
@@ -8,7 +8,7 @@ import { ApiAction } from './ApiAction';
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 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
11
+ * import { SetProduct } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
12
12
  * window.env3DSource.apiReady = (api) => {
13
13
  * new SetProduct(
14
14
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
@@ -8,7 +8,7 @@ import { ApiAction } from './ApiAction';
8
8
  * This action sends a message to the MetaBox API to toggle the visibility of the embedded menu.
9
9
  *
10
10
  * @example
11
- * import { ShowEmbeddedMenu } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
11
+ * import { ShowEmbeddedMenu } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
12
12
  * window.env3DSource.apiReady = (api) => {
13
13
  * new ShowEmbeddedMenu(true);
14
14
  * };
@@ -0,0 +1,23 @@
1
+ import { ApiAction } from './ApiAction';
2
+ /**
3
+ * {@inheritDoc ApiAction}
4
+ *
5
+ * Represents an action to toggle the Unreal Overlay Interface Menu.
6
+ *
7
+ * @remarks
8
+ * This action sends a message to the MetaBox API to toggle the visibility of the Unreal overlay UI.
9
+ *
10
+ * @example
11
+ * import { ShowOverlayInterface } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
12
+ * window.env3DSource.apiReady = (api) => {
13
+ * new ShowOverlayInterface(true);
14
+ * };
15
+ */
16
+ export declare class ShowOverlayInterface extends ApiAction {
17
+ /**
18
+ * Creates an instance of ShowOverlayInterface.
19
+ *
20
+ * @param visible - A flag indicating whether the Unreal overlay UI should be visible.
21
+ */
22
+ constructor(visible: boolean);
23
+ }
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { ShowOverlayInterface } from './actions/ShowOverlayInterface';
1
2
  export { ShowEmbeddedMenu } from './actions/ShowEmbeddedMenu';
2
3
  export { SetEnvironment } from './actions/SetEnvironment';
3
4
  export { SetProduct } from './actions/SetProduct';
package/dist/index.esm.js CHANGED
@@ -1,8 +1,3 @@
1
- /*
2
- * Copyright (c) 2025.
3
- * 3DSource.com, Sergii Karanda steve@3dsource.com
4
- * All Rights Reserved
5
- */
6
1
  /**
7
2
  * To integrate the MetaBox configurator into an HTML element, use the following example:
8
3
  *
@@ -31,11 +26,6 @@ class ApiAction {
31
26
  }
32
27
  }
33
28
 
34
- /*
35
- * Copyright (c) 2025.
36
- * 3DSource.com, Sergii Karanda steve@3dsource.com
37
- * All Rights Reserved
38
- */
39
29
  const ToMetaBoxApiAction = {
40
30
  getPdf: 'getPdf',
41
31
  loadLevel: 'loadLevel',
@@ -52,14 +42,41 @@ const ToMetaBoxApiAction = {
52
42
  showEmbeddedMenu: 'showEmbeddedMenu',
53
43
  forceSetDeviceType: 'forceSetDeviceType',
54
44
  sendCommandToUnreal: 'sendCommandToUnreal',
45
+ showOverlayInterface: 'showOverlayInterface',
55
46
  setEnvironmentMaterialById: 'setEnvironmentMaterialById',
56
47
  };
57
48
 
58
- /*
59
- * Copyright (c) 2025.
60
- * 3DSource.com, Sergii Karanda steve@3dsource.com
61
- * All Rights Reserved
49
+ /**
50
+ * {@inheritDoc ApiAction}
51
+ *
52
+ * Represents an action to toggle the Unreal Overlay Interface Menu.
53
+ *
54
+ * @remarks
55
+ * This action sends a message to the MetaBox API to toggle the visibility of the Unreal overlay UI.
56
+ *
57
+ * @example
58
+ * import { ShowOverlayInterface } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
59
+ * window.env3DSource.apiReady = (api) => {
60
+ * new ShowOverlayInterface(true);
61
+ * };
62
62
  */
63
+ class ShowOverlayInterface extends ApiAction {
64
+ /**
65
+ * Creates an instance of ShowOverlayInterface.
66
+ *
67
+ * @param visible - A flag indicating whether the Unreal overlay UI should be visible.
68
+ */
69
+ constructor(visible) {
70
+ super();
71
+ this.api.sendMessageToMetaBox({
72
+ action: ToMetaBoxApiAction.showOverlayInterface,
73
+ payload: {
74
+ visible,
75
+ },
76
+ });
77
+ }
78
+ }
79
+
63
80
  /**
64
81
  * {@inheritDoc ApiAction}
65
82
  *
@@ -69,7 +86,7 @@ const ToMetaBoxApiAction = {
69
86
  * This action sends a message to the MetaBox API to toggle the visibility of the embedded menu.
70
87
  *
71
88
  * @example
72
- * import { ShowEmbeddedMenu } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
89
+ * import { ShowEmbeddedMenu } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
73
90
  * window.env3DSource.apiReady = (api) => {
74
91
  * new ShowEmbeddedMenu(true);
75
92
  * };
@@ -91,11 +108,6 @@ class ShowEmbeddedMenu extends ApiAction {
91
108
  }
92
109
  }
93
110
 
94
- /*
95
- * Copyright (c) 2025.
96
- * 3DSource.com, Sergii Karanda steve@3dsource.com
97
- * All Rights Reserved
98
- */
99
111
  /**
100
112
  * {@inheritDoc ApiAction}
101
113
  *
@@ -104,7 +116,7 @@ class ShowEmbeddedMenu extends ApiAction {
104
116
  * This action sends a message to the MetaBox API to load the environment level using the specified environment ID.
105
117
  *
106
118
  * @example
107
- * import { SetEnvironment } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
119
+ * import { SetEnvironment } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
108
120
  * window.env3DSource.apiReady = (api) => {
109
121
  * // Change the environment to '55555555-1234-1234-1234-01234567890'
110
122
  * new SetEnvironment('55555555-1234-1234-1234-01234567890');
@@ -127,11 +139,6 @@ class SetEnvironment extends ApiAction {
127
139
  }
128
140
  }
129
141
 
130
- /*
131
- * Copyright (c) 2025.
132
- * 3DSource.com, Sergii Karanda steve@3dsource.com
133
- * All Rights Reserved
134
- */
135
142
  /**
136
143
  * {@inheritDoc ApiAction}
137
144
  *
@@ -141,7 +148,7 @@ class SetEnvironment extends ApiAction {
141
148
  * This action sends a message to the MetaBox API to set a product using the provided product ID.
142
149
  *
143
150
  * @example
144
- * import { SetProduct } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
151
+ * import { SetProduct } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
145
152
  * window.env3DSource.apiReady = (api) => {
146
153
  * new SetProduct(
147
154
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
@@ -165,11 +172,6 @@ class SetProduct extends ApiAction {
165
172
  }
166
173
  }
167
174
 
168
- /*
169
- * Copyright (c) 2025.
170
- * 3DSource.com, Sergii Karanda steve@3dsource.com
171
- * All Rights Reserved
172
- */
173
175
  /**
174
176
  * {@inheritDoc ApiAction}
175
177
  *
@@ -181,7 +183,7 @@ class SetProduct extends ApiAction {
181
183
  * **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
182
184
  *
183
185
  * @example
184
- * import { GetPdf } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
186
+ * import { GetPdf } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
185
187
  * window.env3DSource.apiReady = (api) => {
186
188
  * new GetPdf();
187
189
  * };
@@ -201,11 +203,6 @@ class GetPdf extends ApiAction {
201
203
  }
202
204
  }
203
205
 
204
- /*
205
- * Copyright (c) 2025.
206
- * 3DSource.com, Sergii Karanda steve@3dsource.com
207
- * All Rights Reserved
208
- */
209
206
  /**
210
207
  * {@inheritDoc ApiAction}
211
208
  *
@@ -215,7 +212,7 @@ class GetPdf extends ApiAction {
215
212
  * This action sends a message to the MetaBox API to update the material on a specific product slot using the provided identifiers.
216
213
  *
217
214
  * @example
218
- * import { SetMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
215
+ * import { SetMaterial } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
219
216
  * window.env3DSource.apiReady = (api) => {
220
217
  * new SetMaterial(
221
218
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
@@ -245,11 +242,6 @@ class SetMaterial extends ApiAction {
245
242
  }
246
243
  }
247
244
 
248
- /*
249
- * Copyright (c) 2025.
250
- * 3DSource.com, Sergii Karanda steve@3dsource.com
251
- * All Rights Reserved
252
- */
253
245
  /**
254
246
  * {@inheritDoc ApiAction}
255
247
  *
@@ -259,7 +251,7 @@ class SetMaterial extends ApiAction {
259
251
  * This action sends a message to the MetaBox API to update the material on a specific environment slot using the provided identifiers.
260
252
  *
261
253
  * @example
262
- * import { SetEnvironmentMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
254
+ * import { SetEnvironmentMaterial } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
263
255
  * window.env3DSource.apiReady = (api) => {
264
256
  * new SetEnvironmentMaterial(
265
257
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
@@ -289,11 +281,6 @@ class SetEnvironmentMaterial extends ApiAction {
289
281
  }
290
282
  }
291
283
 
292
- /*
293
- * Copyright (c) 2025.
294
- * 3DSource.com, Sergii Karanda steve@3dsource.com
295
- * All Rights Reserved
296
- */
297
284
  /**
298
285
  * {@inheritDoc ApiAction}
299
286
  *
@@ -304,7 +291,7 @@ class SetEnvironmentMaterial extends ApiAction {
304
291
  * **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
305
292
  *
306
293
  * @example
307
- * import { GetFastRender,saveImage } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
294
+ * import { GetFastRender,saveImage } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
308
295
  * window.env3DSource.apiReady = (api) => {
309
296
  * // Listen for events from the MetaBox API
310
297
  * api.addEventListener('metaboxData', (data) => {
@@ -334,11 +321,6 @@ class GetFastRender extends ApiAction {
334
321
  }
335
322
  }
336
323
 
337
- /*
338
- * Copyright (c) 2025.
339
- * 3DSource.com, Sergii Karanda steve@3dsource.com
340
- * All Rights Reserved
341
- */
342
324
  /**
343
325
  * {@inheritDoc ApiAction}
344
326
  * @internal
@@ -355,11 +337,6 @@ class SendCommandToUnreal extends ApiAction {
355
337
  }
356
338
  }
357
339
 
358
- /*
359
- * Copyright (c) 2025.
360
- * 3DSource.com, Sergii Karanda steve@3dsource.com
361
- * All Rights Reserved
362
- */
363
340
  /**
364
341
  * @experimental
365
342
  * @internal
@@ -383,11 +360,6 @@ class WatchCallbacks extends ApiAction {
383
360
  }
384
361
  }
385
362
 
386
- /*
387
- * Copyright (c) 2025.
388
- * 3DSource.com, Sergii Karanda steve@3dsource.com
389
- * All Rights Reserved
390
- */
391
363
  /**
392
364
  * EventDispatcher is a class that manages event listeners and dispatches events to them.
393
365
  */
@@ -432,11 +404,6 @@ class EventDispatcher {
432
404
  }
433
405
  }
434
406
 
435
- /*
436
- * Copyright (c) 2025.
437
- * 3DSource.com, Sergii Karanda steve@3dsource.com
438
- * All Rights Reserved
439
- */
440
407
  const binderMessageType = 'metaboxData';
441
408
  /**
442
409
  * API class to handle communication with the embedded content.
@@ -531,11 +498,6 @@ class Communicator extends EventDispatcher {
531
498
  */
532
499
  Communicator.instance = null;
533
500
 
534
- /*
535
- * Copyright (c) 2025.
536
- * 3DSource.com, Sergii Karanda steve@3dsource.com
537
- * All Rights Reserved
538
- */
539
501
  /**
540
502
  * Integrates the MetaBox into the provided layout.
541
503
  *
@@ -558,7 +520,7 @@ Communicator.instance = null;
558
520
  * @example
559
521
  * import {
560
522
  * integrateMetaBox,
561
- * } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
523
+ * } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
562
524
  *
563
525
  * integrateMetaBox(
564
526
  * 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
@@ -592,11 +554,6 @@ function integrateMetaBox(iframeSrc, containerId = 'embed3DSource') {
592
554
  container.appendChild(iframe);
593
555
  }
594
556
 
595
- /*
596
- * Copyright (c) 2025.
597
- * 3DSource.com, Sergii Karanda steve@3dsource.com
598
- * All Rights Reserved
599
- */
600
557
  /**
601
558
  * Saves an image by triggering a download.
602
559
  *
@@ -616,11 +573,6 @@ function saveImage(image, filename) {
616
573
  document.body.removeChild(a);
617
574
  }
618
575
 
619
- /*
620
- * Copyright (c) 2025.
621
- * 3DSource.com, Sergii Karanda steve@3dsource.com
622
- * All Rights Reserved
623
- */
624
576
  /**
625
577
  * Pauses execution for a specified duration.
626
578
  *
@@ -634,11 +586,6 @@ function sleep(time) {
634
586
  return new Promise((resolve) => setTimeout(resolve, time));
635
587
  }
636
588
 
637
- /*
638
- * Copyright (c) 2025.
639
- * 3DSource.com, Sergii Karanda steve@3dsource.com
640
- * All Rights Reserved
641
- */
642
589
  /**
643
590
  * Sets the URL parameters based on the provided state.
644
591
  *
@@ -672,11 +619,6 @@ function getUrlParams() {
672
619
  return selections;
673
620
  }
674
621
 
675
- /*
676
- * Copyright (c) 2025.
677
- * 3DSource.com, Sergii Karanda steve@3dsource.com
678
- * All Rights Reserved
679
- */
680
622
  const FromMetaboxApiAction = {
681
623
  bridge: 'bridge',
682
624
  appLoaded: 'appLoaded',
@@ -733,16 +675,11 @@ const FromMetaboxApiAction = {
733
675
  getFastRender: 'getFastRender',
734
676
  };
735
677
 
736
- /*
737
- * Copyright (c) 2025.
738
- * 3DSource.com, Sergii Karanda steve@3dsource.com
739
- * All Rights Reserved
740
- */
741
678
  const APPLICATION_DEVICE_TYPES = {
742
679
  deviceTypeAuto: 'deviceTypeAuto',
743
680
  deviceTypeMobile: 'deviceTypeMobile',
744
681
  deviceTypeDesktop: 'deviceTypeDesktop',
745
682
  };
746
683
 
747
- export { APPLICATION_DEVICE_TYPES, ApiAction, Communicator, FromMetaboxApiAction, GetFastRender, GetPdf, SendCommandToUnreal, SetEnvironment, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, ToMetaBoxApiAction, WatchCallbacks, getUrlParams, integrateMetaBox, saveImage, setUrlParams, sleep };
684
+ export { APPLICATION_DEVICE_TYPES, ApiAction, Communicator, FromMetaboxApiAction, GetFastRender, GetPdf, SendCommandToUnreal, SetEnvironment, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, ShowOverlayInterface, ToMetaBoxApiAction, WatchCallbacks, getUrlParams, integrateMetaBox, saveImage, setUrlParams, sleep };
748
685
  //# sourceMappingURL=index.esm.js.map
@@ -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
@@ -4,11 +4,6 @@
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["metabox-front-api"] = {}));
5
5
  })(this, (function (exports) { 'use strict';
6
6
 
7
- /*
8
- * Copyright (c) 2025.
9
- * 3DSource.com, Sergii Karanda steve@3dsource.com
10
- * All Rights Reserved
11
- */
12
7
  /**
13
8
  * To integrate the MetaBox configurator into an HTML element, use the following example:
14
9
  *
@@ -37,11 +32,6 @@
37
32
  }
38
33
  }
39
34
 
40
- /*
41
- * Copyright (c) 2025.
42
- * 3DSource.com, Sergii Karanda steve@3dsource.com
43
- * All Rights Reserved
44
- */
45
35
  const ToMetaBoxApiAction = {
46
36
  getPdf: 'getPdf',
47
37
  loadLevel: 'loadLevel',
@@ -58,14 +48,41 @@
58
48
  showEmbeddedMenu: 'showEmbeddedMenu',
59
49
  forceSetDeviceType: 'forceSetDeviceType',
60
50
  sendCommandToUnreal: 'sendCommandToUnreal',
51
+ showOverlayInterface: 'showOverlayInterface',
61
52
  setEnvironmentMaterialById: 'setEnvironmentMaterialById',
62
53
  };
63
54
 
64
- /*
65
- * Copyright (c) 2025.
66
- * 3DSource.com, Sergii Karanda steve@3dsource.com
67
- * All Rights Reserved
55
+ /**
56
+ * {@inheritDoc ApiAction}
57
+ *
58
+ * Represents an action to toggle the Unreal Overlay Interface Menu.
59
+ *
60
+ * @remarks
61
+ * This action sends a message to the MetaBox API to toggle the visibility of the Unreal overlay UI.
62
+ *
63
+ * @example
64
+ * import { ShowOverlayInterface } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
65
+ * window.env3DSource.apiReady = (api) => {
66
+ * new ShowOverlayInterface(true);
67
+ * };
68
68
  */
69
+ class ShowOverlayInterface extends ApiAction {
70
+ /**
71
+ * Creates an instance of ShowOverlayInterface.
72
+ *
73
+ * @param visible - A flag indicating whether the Unreal overlay UI should be visible.
74
+ */
75
+ constructor(visible) {
76
+ super();
77
+ this.api.sendMessageToMetaBox({
78
+ action: ToMetaBoxApiAction.showOverlayInterface,
79
+ payload: {
80
+ visible,
81
+ },
82
+ });
83
+ }
84
+ }
85
+
69
86
  /**
70
87
  * {@inheritDoc ApiAction}
71
88
  *
@@ -75,7 +92,7 @@
75
92
  * This action sends a message to the MetaBox API to toggle the visibility of the embedded menu.
76
93
  *
77
94
  * @example
78
- * import { ShowEmbeddedMenu } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
95
+ * import { ShowEmbeddedMenu } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
79
96
  * window.env3DSource.apiReady = (api) => {
80
97
  * new ShowEmbeddedMenu(true);
81
98
  * };
@@ -97,11 +114,6 @@
97
114
  }
98
115
  }
99
116
 
100
- /*
101
- * Copyright (c) 2025.
102
- * 3DSource.com, Sergii Karanda steve@3dsource.com
103
- * All Rights Reserved
104
- */
105
117
  /**
106
118
  * {@inheritDoc ApiAction}
107
119
  *
@@ -110,7 +122,7 @@
110
122
  * This action sends a message to the MetaBox API to load the environment level using the specified environment ID.
111
123
  *
112
124
  * @example
113
- * import { SetEnvironment } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
125
+ * import { SetEnvironment } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
114
126
  * window.env3DSource.apiReady = (api) => {
115
127
  * // Change the environment to '55555555-1234-1234-1234-01234567890'
116
128
  * new SetEnvironment('55555555-1234-1234-1234-01234567890');
@@ -133,11 +145,6 @@
133
145
  }
134
146
  }
135
147
 
136
- /*
137
- * Copyright (c) 2025.
138
- * 3DSource.com, Sergii Karanda steve@3dsource.com
139
- * All Rights Reserved
140
- */
141
148
  /**
142
149
  * {@inheritDoc ApiAction}
143
150
  *
@@ -147,7 +154,7 @@
147
154
  * This action sends a message to the MetaBox API to set a product using the provided product ID.
148
155
  *
149
156
  * @example
150
- * import { SetProduct } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
157
+ * import { SetProduct } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
151
158
  * window.env3DSource.apiReady = (api) => {
152
159
  * new SetProduct(
153
160
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
@@ -171,11 +178,6 @@
171
178
  }
172
179
  }
173
180
 
174
- /*
175
- * Copyright (c) 2025.
176
- * 3DSource.com, Sergii Karanda steve@3dsource.com
177
- * All Rights Reserved
178
- */
179
181
  /**
180
182
  * {@inheritDoc ApiAction}
181
183
  *
@@ -187,7 +189,7 @@
187
189
  * **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
188
190
  *
189
191
  * @example
190
- * import { GetPdf } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
192
+ * import { GetPdf } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
191
193
  * window.env3DSource.apiReady = (api) => {
192
194
  * new GetPdf();
193
195
  * };
@@ -207,11 +209,6 @@
207
209
  }
208
210
  }
209
211
 
210
- /*
211
- * Copyright (c) 2025.
212
- * 3DSource.com, Sergii Karanda steve@3dsource.com
213
- * All Rights Reserved
214
- */
215
212
  /**
216
213
  * {@inheritDoc ApiAction}
217
214
  *
@@ -221,7 +218,7 @@
221
218
  * This action sends a message to the MetaBox API to update the material on a specific product slot using the provided identifiers.
222
219
  *
223
220
  * @example
224
- * import { SetMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
221
+ * import { SetMaterial } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
225
222
  * window.env3DSource.apiReady = (api) => {
226
223
  * new SetMaterial(
227
224
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
@@ -251,11 +248,6 @@
251
248
  }
252
249
  }
253
250
 
254
- /*
255
- * Copyright (c) 2025.
256
- * 3DSource.com, Sergii Karanda steve@3dsource.com
257
- * All Rights Reserved
258
- */
259
251
  /**
260
252
  * {@inheritDoc ApiAction}
261
253
  *
@@ -265,7 +257,7 @@
265
257
  * This action sends a message to the MetaBox API to update the material on a specific environment slot using the provided identifiers.
266
258
  *
267
259
  * @example
268
- * import { SetEnvironmentMaterial } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
260
+ * import { SetEnvironmentMaterial } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
269
261
  * window.env3DSource.apiReady = (api) => {
270
262
  * new SetEnvironmentMaterial(
271
263
  * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3',
@@ -295,11 +287,6 @@
295
287
  }
296
288
  }
297
289
 
298
- /*
299
- * Copyright (c) 2025.
300
- * 3DSource.com, Sergii Karanda steve@3dsource.com
301
- * All Rights Reserved
302
- */
303
290
  /**
304
291
  * {@inheritDoc ApiAction}
305
292
  *
@@ -310,7 +297,7 @@
310
297
  * **Important**: Invoking this action will buffer it until the viewport is ready. Only then will the request be processed.
311
298
  *
312
299
  * @example
313
- * import { GetFastRender,saveImage } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
300
+ * import { GetFastRender,saveImage } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
314
301
  * window.env3DSource.apiReady = (api) => {
315
302
  * // Listen for events from the MetaBox API
316
303
  * api.addEventListener('metaboxData', (data) => {
@@ -340,11 +327,6 @@
340
327
  }
341
328
  }
342
329
 
343
- /*
344
- * Copyright (c) 2025.
345
- * 3DSource.com, Sergii Karanda steve@3dsource.com
346
- * All Rights Reserved
347
- */
348
330
  /**
349
331
  * {@inheritDoc ApiAction}
350
332
  * @internal
@@ -361,11 +343,6 @@
361
343
  }
362
344
  }
363
345
 
364
- /*
365
- * Copyright (c) 2025.
366
- * 3DSource.com, Sergii Karanda steve@3dsource.com
367
- * All Rights Reserved
368
- */
369
346
  /**
370
347
  * @experimental
371
348
  * @internal
@@ -389,11 +366,6 @@
389
366
  }
390
367
  }
391
368
 
392
- /*
393
- * Copyright (c) 2025.
394
- * 3DSource.com, Sergii Karanda steve@3dsource.com
395
- * All Rights Reserved
396
- */
397
369
  /**
398
370
  * EventDispatcher is a class that manages event listeners and dispatches events to them.
399
371
  */
@@ -438,11 +410,6 @@
438
410
  }
439
411
  }
440
412
 
441
- /*
442
- * Copyright (c) 2025.
443
- * 3DSource.com, Sergii Karanda steve@3dsource.com
444
- * All Rights Reserved
445
- */
446
413
  const binderMessageType = 'metaboxData';
447
414
  /**
448
415
  * API class to handle communication with the embedded content.
@@ -537,11 +504,6 @@
537
504
  */
538
505
  Communicator.instance = null;
539
506
 
540
- /*
541
- * Copyright (c) 2025.
542
- * 3DSource.com, Sergii Karanda steve@3dsource.com
543
- * All Rights Reserved
544
- */
545
507
  /**
546
508
  * Integrates the MetaBox into the provided layout.
547
509
  *
@@ -564,7 +526,7 @@
564
526
  * @example
565
527
  * import {
566
528
  * integrateMetaBox,
567
- * } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
529
+ * } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
568
530
  *
569
531
  * integrateMetaBox(
570
532
  * 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
@@ -598,11 +560,6 @@
598
560
  container.appendChild(iframe);
599
561
  }
600
562
 
601
- /*
602
- * Copyright (c) 2025.
603
- * 3DSource.com, Sergii Karanda steve@3dsource.com
604
- * All Rights Reserved
605
- */
606
563
  /**
607
564
  * Saves an image by triggering a download.
608
565
  *
@@ -622,11 +579,6 @@
622
579
  document.body.removeChild(a);
623
580
  }
624
581
 
625
- /*
626
- * Copyright (c) 2025.
627
- * 3DSource.com, Sergii Karanda steve@3dsource.com
628
- * All Rights Reserved
629
- */
630
582
  /**
631
583
  * Pauses execution for a specified duration.
632
584
  *
@@ -640,11 +592,6 @@
640
592
  return new Promise((resolve) => setTimeout(resolve, time));
641
593
  }
642
594
 
643
- /*
644
- * Copyright (c) 2025.
645
- * 3DSource.com, Sergii Karanda steve@3dsource.com
646
- * All Rights Reserved
647
- */
648
595
  /**
649
596
  * Sets the URL parameters based on the provided state.
650
597
  *
@@ -678,11 +625,6 @@
678
625
  return selections;
679
626
  }
680
627
 
681
- /*
682
- * Copyright (c) 2025.
683
- * 3DSource.com, Sergii Karanda steve@3dsource.com
684
- * All Rights Reserved
685
- */
686
628
  const FromMetaboxApiAction = {
687
629
  bridge: 'bridge',
688
630
  appLoaded: 'appLoaded',
@@ -739,11 +681,6 @@
739
681
  getFastRender: 'getFastRender',
740
682
  };
741
683
 
742
- /*
743
- * Copyright (c) 2025.
744
- * 3DSource.com, Sergii Karanda steve@3dsource.com
745
- * All Rights Reserved
746
- */
747
684
  const APPLICATION_DEVICE_TYPES = {
748
685
  deviceTypeAuto: 'deviceTypeAuto',
749
686
  deviceTypeMobile: 'deviceTypeMobile',
@@ -762,6 +699,7 @@
762
699
  exports.SetMaterial = SetMaterial;
763
700
  exports.SetProduct = SetProduct;
764
701
  exports.ShowEmbeddedMenu = ShowEmbeddedMenu;
702
+ exports.ShowOverlayInterface = ShowOverlayInterface;
765
703
  exports.ToMetaBoxApiAction = ToMetaBoxApiAction;
766
704
  exports.WatchCallbacks = WatchCallbacks;
767
705
  exports.getUrlParams = getUrlParams;
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -16,6 +16,7 @@ export declare const ToMetaBoxApiAction: {
16
16
  readonly showEmbeddedMenu: "showEmbeddedMenu";
17
17
  readonly forceSetDeviceType: "forceSetDeviceType";
18
18
  readonly sendCommandToUnreal: "sendCommandToUnreal";
19
+ readonly showOverlayInterface: "showOverlayInterface";
19
20
  readonly setEnvironmentMaterialById: "setEnvironmentMaterialById";
20
21
  };
21
22
  export type ToMetaBoxActions = (typeof ToMetaBoxApiAction)[keyof typeof ToMetaBoxApiAction];
@@ -58,6 +59,9 @@ export interface ToMetaboxMessagePayloads {
58
59
  showEmbeddedMenu: {
59
60
  visible: boolean;
60
61
  };
62
+ showOverlayInterface: {
63
+ visible: boolean;
64
+ };
61
65
  forceSetDeviceType: {
62
66
  deviceType: ApplicationDeviceType;
63
67
  };
@@ -20,7 +20,7 @@
20
20
  * @example
21
21
  * import {
22
22
  * integrateMetaBox,
23
- * } from 'https://unpkg.com/@3dsource/metabox-front-api@latest/dist/index.js';
23
+ * } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@latest/dist/index.js';
24
24
  *
25
25
  * integrateMetaBox(
26
26
  * 'https://metabox.3dsource.com/metabox-configurator/basic/12345678-1234-1234-1234-01234567890?introImage=https://example.com/intro.webp&sidebar=false',
package/package.json CHANGED
@@ -1,12 +1,15 @@
1
1
  {
2
2
  "name": "@3dsource/metabox-front-api",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "API for MetaBox BASIC configurator",
5
5
  "keywords": [
6
6
  "metabox",
7
7
  "api",
8
8
  "configurator"
9
9
  ],
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
10
13
  "repository": {
11
14
  "type": "git",
12
15
  "url": "git@bitbucket.org:dreamsoft/ams_vps-frontend.git"