@3dsource/metabox-modular-configurator-api 3.0.38 → 3.0.39
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/CHANGELOG.md +40 -0
- package/README.md +85 -39
- package/fesm2022/3dsource-metabox-modular-configurator-api.mjs +28 -9
- package/fesm2022/3dsource-metabox-modular-configurator-api.mjs.map +1 -1
- package/llms.txt +2 -0
- package/package.json +1 -1
- package/types/3dsource-metabox-modular-configurator-api.d.ts +88 -82
package/llms.txt
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
- [Type declarations](./types/3dsource-metabox-modular-configurator-api.d.ts): `ToMetaboxMessagePayloads` (command payloads), `FromMetaboxMessagePayloads` (event payloads), the modular state envelope, `IntegrateMetaboxConfig` — each documented with JSDoc
|
|
28
28
|
|
|
29
|
+
- [API reference in Markdown](https://preview.3dsource.com/front-libraries/master/modular-configurator-api-doc-md/index.md): One file per class, interface and type, generated from the code; its [SKILL.md](https://preview.3dsource.com/front-libraries/master/modular-configurator-api-doc-md/SKILL.md) explains how to navigate it
|
|
30
|
+
|
|
29
31
|
## Optional
|
|
30
32
|
|
|
31
33
|
- [Export configuration](./README.md#export-configuration): Saving and restoring an assembly
|
package/package.json
CHANGED
|
@@ -5,13 +5,13 @@ import { Observable } from "rxjs";
|
|
|
5
5
|
* Core constants used for host-to-iframe communication and URL construction.
|
|
6
6
|
*/
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Value of the `host` field on every message the configurator posts to the host page.
|
|
9
9
|
*
|
|
10
10
|
* ### What does it unlock?
|
|
11
|
-
*
|
|
11
|
+
* Marks a postMessage as coming from the configurator; the Communicator ignores messages without it.
|
|
12
12
|
*
|
|
13
13
|
* ### Practical Application
|
|
14
|
-
* Internal
|
|
14
|
+
* Internal protocol marker.
|
|
15
15
|
* Not needed in front-end application code.
|
|
16
16
|
*
|
|
17
17
|
* ### AI Coding Best Practices
|
|
@@ -64,10 +64,11 @@ export declare const AppLoaded = "appLoaded";
|
|
|
64
64
|
*
|
|
65
65
|
* ### AI Coding Best Practices
|
|
66
66
|
* Let integrateMetabox() use the default. Override only if needed:
|
|
67
|
-
* `integrateMetabox(id, container, callback, { domain: '
|
|
67
|
+
* `integrateMetabox(id, container, callback, { domain: 'custom.domain.com' })` — hostname only; `https://` is added for you. HTTPS is mandatory.
|
|
68
68
|
*
|
|
69
69
|
* @internal
|
|
70
70
|
*/
|
|
71
|
+
export declare const MetaboxDomain = "metabox.3dsource.com";
|
|
71
72
|
/**
|
|
72
73
|
* @deprecated
|
|
73
74
|
*/
|
|
@@ -80,7 +81,6 @@ export declare const MetaboxHost_V3 = "metaboxHost_v3";
|
|
|
80
81
|
* @deprecated
|
|
81
82
|
*/
|
|
82
83
|
export declare const AppLoaded_V3 = "appLoaded_v3";
|
|
83
|
-
export declare const MetaboxDomain = "metabox.3dsource.com";
|
|
84
84
|
/**
|
|
85
85
|
* Base route URL segment for the Modular Configurator.
|
|
86
86
|
*
|
|
@@ -97,8 +97,12 @@ export declare const MetaboxDomain = "metabox.3dsource.com";
|
|
|
97
97
|
*
|
|
98
98
|
* @internal
|
|
99
99
|
*/
|
|
100
|
+
export declare const ModularRouteUrl = "metabox-configurator/modular";
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Misnamed: it holds the modular route. Use {@link ModularRouteUrl}.
|
|
103
|
+
*/
|
|
100
104
|
export declare const BasicRouteUrl = "metabox-configurator/modular";
|
|
101
|
-
export declare const VERSION = "3.0.
|
|
105
|
+
export declare const VERSION = "3.0.39";
|
|
102
106
|
/**
|
|
103
107
|
* Configuration options for integrating the Metabox Modular Configurator iframe into a host page.
|
|
104
108
|
* Passed as the `config` parameter to {@link integrateMetabox}.
|
|
@@ -303,6 +307,7 @@ export interface ToMetaboxMessagePayloads {
|
|
|
303
307
|
[MetaboxModularConfiguratorActions.showMeasurement]: void;
|
|
304
308
|
[MetaboxModularConfiguratorActions.hideMeasurement]: void;
|
|
305
309
|
[MetaboxModularConfiguratorActions.resetUserInactivityTimer]: void;
|
|
310
|
+
[MetaboxModularConfiguratorActions.resumeStream]: void;
|
|
306
311
|
[MetaboxModularConfiguratorActions.stopStream]: void;
|
|
307
312
|
}
|
|
308
313
|
/**
|
|
@@ -1465,7 +1470,7 @@ export interface CommunicatorConnection {
|
|
|
1465
1470
|
* NEVER send commands before this callback fires. All commands and event listeners go through this single
|
|
1466
1471
|
* api object. Clean up listeners with removeEventListener on component unmount.
|
|
1467
1472
|
*
|
|
1468
|
-
*
|
|
1473
|
+
* Do not construct it yourself: {@link integrateMetabox} hands it to your `apiReadyCallback`.
|
|
1469
1474
|
*/
|
|
1470
1475
|
export declare class Communicator extends EventDispatcher {
|
|
1471
1476
|
/**
|
|
@@ -1728,7 +1733,6 @@ export declare const prepareIframeSrc: (configuratorId: string, config?: Integra
|
|
|
1728
1733
|
* @param {Communicator} target - The Communicator instance to listen on.
|
|
1729
1734
|
* @param {T} eventName - The event name from {@link FromMetaBoxApiEvents} to subscribe to.
|
|
1730
1735
|
* @returns An Observable that emits the typed payload each time the event fires.
|
|
1731
|
-
* @internal
|
|
1732
1736
|
*/
|
|
1733
1737
|
export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
|
|
1734
1738
|
/**
|
|
@@ -1788,8 +1792,8 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1788
1792
|
* available, arrives on `statusMessageChanged`.
|
|
1789
1793
|
*
|
|
1790
1794
|
* @example
|
|
1791
|
-
* import {
|
|
1792
|
-
*
|
|
1795
|
+
* import { integrateMetabox, Communicator, GetPdf, type PdfStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
1796
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1793
1797
|
*
|
|
1794
1798
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1795
1799
|
* api.addEventListener('pdfStatusChanged', (status: PdfStatus) => {
|
|
@@ -1800,7 +1804,7 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1800
1804
|
* });
|
|
1801
1805
|
*
|
|
1802
1806
|
* api.sendCommandToMetabox(new GetPdf());
|
|
1803
|
-
* };
|
|
1807
|
+
* });
|
|
1804
1808
|
*/
|
|
1805
1809
|
export declare class GetPdf extends CommandBase {
|
|
1806
1810
|
constructor();
|
|
@@ -1834,8 +1838,8 @@ export declare class GetPdf extends CommandBase {
|
|
|
1834
1838
|
* and returns a redirect URL.
|
|
1835
1839
|
*
|
|
1836
1840
|
* @example
|
|
1837
|
-
* import {
|
|
1838
|
-
*
|
|
1841
|
+
* import { integrateMetabox, Communicator, GetCallToActionInformation, type EcomConfigurator } from '@3dsource/metabox-modular-configurator-api';
|
|
1842
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1839
1843
|
*
|
|
1840
1844
|
* //Subscribe as soon as the api is ready: this event fires once, when the ecom data loads
|
|
1841
1845
|
* api.addEventListener('ecomConfiguratorDataUpdated', (data:EcomConfigurator) => {
|
|
@@ -1844,7 +1848,7 @@ export declare class GetPdf extends CommandBase {
|
|
|
1844
1848
|
*
|
|
1845
1849
|
* // Send the command to get Call To Action information from Metabox Modular Configurator
|
|
1846
1850
|
* api.sendCommandToMetabox(new GetCallToActionInformation());
|
|
1847
|
-
* };
|
|
1851
|
+
* });
|
|
1848
1852
|
*/
|
|
1849
1853
|
export declare class GetCallToActionInformation extends CommandBase {
|
|
1850
1854
|
constructor();
|
|
@@ -1868,8 +1872,8 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1868
1872
|
* SetCamera to restore the view.
|
|
1869
1873
|
*
|
|
1870
1874
|
* @example
|
|
1871
|
-
* import {
|
|
1872
|
-
*
|
|
1875
|
+
* import { integrateMetabox, Communicator, GetCamera, type CameraCommandPayload } from '@3dsource/metabox-modular-configurator-api';
|
|
1876
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1873
1877
|
*
|
|
1874
1878
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1875
1879
|
* api.addEventListener('getCameraResult', (data:CameraCommandPayload) => {
|
|
@@ -1877,7 +1881,7 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1877
1881
|
* });
|
|
1878
1882
|
*
|
|
1879
1883
|
* api.sendCommandToMetabox(new GetCamera());
|
|
1880
|
-
* };
|
|
1884
|
+
* });
|
|
1881
1885
|
*/
|
|
1882
1886
|
export declare class GetCamera extends CommandBase {
|
|
1883
1887
|
constructor();
|
|
@@ -1901,8 +1905,8 @@ export declare class GetCamera extends CommandBase {
|
|
|
1901
1905
|
* `{fov?, mode?, position?, rotation?, restrictions?}`.
|
|
1902
1906
|
*
|
|
1903
1907
|
* @example
|
|
1904
|
-
* import {
|
|
1905
|
-
*
|
|
1908
|
+
* import { integrateMetabox, Communicator, SetCamera } from '@3dsource/metabox-modular-configurator-api';
|
|
1909
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1906
1910
|
* api.sendCommandToMetabox(new SetCamera({
|
|
1907
1911
|
* fov: 45,
|
|
1908
1912
|
* mode: 'orbit',
|
|
@@ -1919,7 +1923,7 @@ export declare class GetCamera extends CommandBase {
|
|
|
1919
1923
|
* minVerticalRotation: 0,
|
|
1920
1924
|
* },
|
|
1921
1925
|
* }));
|
|
1922
|
-
* };
|
|
1926
|
+
* });
|
|
1923
1927
|
*
|
|
1924
1928
|
* @param {CameraCommandPayload} camera - The camera configuration.
|
|
1925
1929
|
*/
|
|
@@ -1942,10 +1946,10 @@ export declare class SetCamera extends CommandBase {
|
|
|
1942
1946
|
* Good practice to call after SetComponent changes that may shift the focal point of the assembly.
|
|
1943
1947
|
*
|
|
1944
1948
|
* @example
|
|
1945
|
-
* import {
|
|
1946
|
-
*
|
|
1949
|
+
* import { integrateMetabox, Communicator, ResetCamera } from '@3dsource/metabox-modular-configurator-api';
|
|
1950
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1947
1951
|
* api.sendCommandToMetabox(new ResetCamera());
|
|
1948
|
-
* };
|
|
1952
|
+
* });
|
|
1949
1953
|
*/
|
|
1950
1954
|
export declare class ResetCamera extends CommandBase {
|
|
1951
1955
|
constructor();
|
|
@@ -1978,8 +1982,8 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1978
1982
|
* its default framing.
|
|
1979
1983
|
*
|
|
1980
1984
|
* @example
|
|
1981
|
-
* import {
|
|
1982
|
-
*
|
|
1985
|
+
* import { integrateMetabox, Communicator, ResetConfiguration, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
1986
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1983
1987
|
*
|
|
1984
1988
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1985
1989
|
* api.addEventListener('configuratorDataUpdated', (data: ModularConfiguratorEnvelope) => {
|
|
@@ -1987,7 +1991,7 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1987
1991
|
* });
|
|
1988
1992
|
*
|
|
1989
1993
|
* api.sendCommandToMetabox(new ResetConfiguration());
|
|
1990
|
-
* };
|
|
1994
|
+
* });
|
|
1991
1995
|
*/
|
|
1992
1996
|
export declare class ResetConfiguration extends CommandBase {
|
|
1993
1997
|
constructor();
|
|
@@ -2010,10 +2014,10 @@ export declare class ResetConfiguration extends CommandBase {
|
|
|
2010
2014
|
* Pattern: `api.sendCommandToMetabox(new ApplyZoom(50))`.
|
|
2011
2015
|
*
|
|
2012
2016
|
* @example
|
|
2013
|
-
* import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
|
|
2014
|
-
*
|
|
2017
|
+
* import { integrateMetabox, ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
|
|
2018
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2015
2019
|
* api.sendCommandToMetabox(new ApplyZoom(50));
|
|
2016
|
-
* };
|
|
2020
|
+
* });
|
|
2017
2021
|
*
|
|
2018
2022
|
* @param {number} zoom - The zoom value to apply.
|
|
2019
2023
|
*/
|
|
@@ -2040,15 +2044,15 @@ export declare class ApplyZoom extends CommandBase {
|
|
|
2040
2044
|
* Subscribe to showcaseStatusChanged to track playback state ('playing'/'paused'/'stopped').
|
|
2041
2045
|
*
|
|
2042
2046
|
* @example
|
|
2043
|
-
* import {
|
|
2044
|
-
*
|
|
2047
|
+
* import { integrateMetabox, Communicator, InitShowcase, type ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2048
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2045
2049
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2046
2050
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
2047
2051
|
* console.log('Showcase status value after changed:', data);
|
|
2048
2052
|
* });
|
|
2049
2053
|
*
|
|
2050
2054
|
* api.sendCommandToMetabox(new InitShowcase());
|
|
2051
|
-
* };
|
|
2055
|
+
* });
|
|
2052
2056
|
*/
|
|
2053
2057
|
export declare class InitShowcase extends CommandBase {
|
|
2054
2058
|
constructor();
|
|
@@ -2072,15 +2076,15 @@ export declare class InitShowcase extends CommandBase {
|
|
|
2072
2076
|
* PlayShowcase.
|
|
2073
2077
|
*
|
|
2074
2078
|
* @example
|
|
2075
|
-
* import { Communicator, PlayShowcase } from '@3dsource/metabox-modular-configurator-api';
|
|
2076
|
-
*
|
|
2079
|
+
* import { integrateMetabox, Communicator, PlayShowcase } from '@3dsource/metabox-modular-configurator-api';
|
|
2080
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2077
2081
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2078
2082
|
* api.addEventListener('showcaseStatusChanged', (data) => {
|
|
2079
2083
|
* console.log('Showcase status value after changed:', data);
|
|
2080
2084
|
* });
|
|
2081
2085
|
*
|
|
2082
2086
|
* api.sendCommandToMetabox(new PlayShowcase());
|
|
2083
|
-
* };
|
|
2087
|
+
* });
|
|
2084
2088
|
*/
|
|
2085
2089
|
export declare class PlayShowcase extends CommandBase {
|
|
2086
2090
|
constructor();
|
|
@@ -2111,8 +2115,8 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
2111
2115
|
* to confirm 'pause' state. Use PlayShowcase to resume or StopShowcase to reset.
|
|
2112
2116
|
*
|
|
2113
2117
|
* @example
|
|
2114
|
-
* import {
|
|
2115
|
-
*
|
|
2118
|
+
* import { integrateMetabox, Communicator, PauseShowcase, type ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2119
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2116
2120
|
*
|
|
2117
2121
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2118
2122
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -2120,7 +2124,7 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
2120
2124
|
* });
|
|
2121
2125
|
*
|
|
2122
2126
|
* api.sendCommandToMetabox(new PauseShowcase());
|
|
2123
|
-
* };
|
|
2127
|
+
* });
|
|
2124
2128
|
*/
|
|
2125
2129
|
export declare class PauseShowcase extends CommandBase {
|
|
2126
2130
|
constructor();
|
|
@@ -2144,8 +2148,8 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
2144
2148
|
* interactive mode — re-enable configuration controls.
|
|
2145
2149
|
*
|
|
2146
2150
|
* @example
|
|
2147
|
-
* import { Communicator, ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2148
|
-
*
|
|
2151
|
+
* import { integrateMetabox, Communicator, StopShowcase, type ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2152
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2149
2153
|
*
|
|
2150
2154
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2151
2155
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -2153,7 +2157,7 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
2153
2157
|
* });
|
|
2154
2158
|
*
|
|
2155
2159
|
* api.sendCommandToMetabox(new StopShowcase());
|
|
2156
|
-
* };
|
|
2160
|
+
* });
|
|
2157
2161
|
*/
|
|
2158
2162
|
export declare class StopShowcase extends CommandBase {
|
|
2159
2163
|
constructor();
|
|
@@ -2196,18 +2200,20 @@ type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
|
2196
2200
|
* Use saveImage() helper to convert base64 to downloadable file.
|
|
2197
2201
|
*
|
|
2198
2202
|
* @example
|
|
2199
|
-
* import {
|
|
2200
|
-
*
|
|
2203
|
+
* import { integrateMetabox, Communicator, GetScreenshot, saveImage } from '@3dsource/metabox-modular-configurator-api';
|
|
2204
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2201
2205
|
*
|
|
2202
2206
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2203
|
-
* api.addEventListener('screenshotReady', (data:string) => {
|
|
2207
|
+
* api.addEventListener('screenshotReady', (data: string | null) => {
|
|
2204
2208
|
* // The data is a base64 string of the image. You can use it to display the image or save it as a file.
|
|
2205
2209
|
* console.log('Get screenshot here:', data);
|
|
2206
|
-
*
|
|
2210
|
+
* if (data) {
|
|
2211
|
+
* saveImage(data, 'Render.png');
|
|
2212
|
+
* }
|
|
2207
2213
|
* });
|
|
2208
2214
|
*
|
|
2209
2215
|
* api.sendCommandToMetabox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));
|
|
2210
|
-
* };
|
|
2216
|
+
* });
|
|
2211
2217
|
*
|
|
2212
2218
|
* @param {MimeType} mimeType - The output format.
|
|
2213
2219
|
* @param {{ x: number; y: number }} [size] - Optional size in pixels.
|
|
@@ -2238,8 +2244,8 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2238
2244
|
* Wrong order = blank viewport. The typeId must match componentType values from the configurator.
|
|
2239
2245
|
*
|
|
2240
2246
|
* @example
|
|
2241
|
-
* import {
|
|
2242
|
-
*
|
|
2247
|
+
* import { integrateMetabox, Communicator, SetComponent, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2248
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2243
2249
|
*
|
|
2244
2250
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2245
2251
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2249,7 +2255,7 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2249
2255
|
* api.sendCommandToMetabox(new SetComponent(
|
|
2250
2256
|
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId'
|
|
2251
2257
|
* ));
|
|
2252
|
-
* };
|
|
2258
|
+
* });
|
|
2253
2259
|
*
|
|
2254
2260
|
* @param {string} id - The component ID.
|
|
2255
2261
|
* @param {string} typeId - The component type ID.
|
|
@@ -2275,8 +2281,8 @@ export declare class SetComponent extends CommandBase {
|
|
|
2275
2281
|
* `new SetComponentMaterial('component-uuid', 'slot-name', 'material-uuid')`. The referenced component must already be set in the tree.
|
|
2276
2282
|
*
|
|
2277
2283
|
* @example
|
|
2278
|
-
* import {
|
|
2279
|
-
*
|
|
2284
|
+
* import { integrateMetabox, Communicator, SetComponentMaterial, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2285
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2280
2286
|
*
|
|
2281
2287
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2282
2288
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2288,7 +2294,7 @@ export declare class SetComponent extends CommandBase {
|
|
|
2288
2294
|
* 'carpaint',
|
|
2289
2295
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2290
2296
|
* ));
|
|
2291
|
-
* };
|
|
2297
|
+
* });
|
|
2292
2298
|
*
|
|
2293
2299
|
* @param {string} componentId - The component ID.
|
|
2294
2300
|
* @param {string} slotId - The slot ID.
|
|
@@ -2314,8 +2320,8 @@ export declare class SetComponentMaterial extends CommandBase {
|
|
|
2314
2320
|
* its own material slots, thumbnails, and lighting properties.
|
|
2315
2321
|
*
|
|
2316
2322
|
* @example
|
|
2317
|
-
* import { Communicator, ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2318
|
-
*
|
|
2323
|
+
* import { integrateMetabox, Communicator, SetEnvironment, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2324
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2319
2325
|
*
|
|
2320
2326
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2321
2327
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2323,7 +2329,7 @@ export declare class SetComponentMaterial extends CommandBase {
|
|
|
2323
2329
|
* });
|
|
2324
2330
|
*
|
|
2325
2331
|
* api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'))
|
|
2326
|
-
* };
|
|
2332
|
+
* });
|
|
2327
2333
|
*
|
|
2328
2334
|
* @param {string} environmentId - The environment ID.
|
|
2329
2335
|
*/
|
|
@@ -2348,8 +2354,8 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2348
2354
|
* has configurable material slots.
|
|
2349
2355
|
*
|
|
2350
2356
|
* @example
|
|
2351
|
-
* import { Communicator, ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2352
|
-
*
|
|
2357
|
+
* import { integrateMetabox, Communicator, SetEnvironmentMaterial, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2358
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2353
2359
|
*
|
|
2354
2360
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2355
2361
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2360,7 +2366,7 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2360
2366
|
* 'carpaint',
|
|
2361
2367
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2362
2368
|
* ));
|
|
2363
|
-
* };
|
|
2369
|
+
* });
|
|
2364
2370
|
*
|
|
2365
2371
|
* @param {string} slotId - The slot ID.
|
|
2366
2372
|
* @param {string} materialId - The material ID.
|
|
@@ -2407,8 +2413,8 @@ type MaterialCommand = SetComponentMaterial | SetEnvironmentMaterial;
|
|
|
2407
2413
|
* Keep using `SetComponentMaterial` on its own for a single swatch click.
|
|
2408
2414
|
*
|
|
2409
2415
|
* @example
|
|
2410
|
-
* import { Communicator,
|
|
2411
|
-
*
|
|
2416
|
+
* import { integrateMetabox, Communicator, SetComponentMaterial, SetEnvironmentMaterial, SetMaterials, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2417
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2412
2418
|
*
|
|
2413
2419
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2414
2420
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2419,7 +2425,7 @@ type MaterialCommand = SetComponentMaterial | SetEnvironmentMaterial;
|
|
|
2419
2425
|
* new SetComponentMaterial('ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'carpaint', 'dd829d6e-9200-47a7-8d5b-af5df89b7e91'),
|
|
2420
2426
|
* new SetEnvironmentMaterial('floor', '7c1f4b2a-58e3-4a19-9d6c-2b0f83e5a114'),
|
|
2421
2427
|
* ]));
|
|
2422
|
-
* };
|
|
2428
|
+
* });
|
|
2423
2429
|
*
|
|
2424
2430
|
* @param {MaterialCommand[]} commands - The material commands to apply, in order.
|
|
2425
2431
|
*/
|
|
@@ -2444,10 +2450,10 @@ export declare class SetMaterials extends CommandBase {
|
|
|
2444
2450
|
* Pattern for custom UI: `ShowEmbeddedMenu(false)` + `ShowOverlayInterface(false)`.
|
|
2445
2451
|
*
|
|
2446
2452
|
* @example
|
|
2447
|
-
* import {
|
|
2448
|
-
*
|
|
2453
|
+
* import { integrateMetabox, Communicator, ShowEmbeddedMenu } from '@3dsource/metabox-modular-configurator-api';
|
|
2454
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2449
2455
|
* api.sendCommandToMetabox(new ShowEmbeddedMenu(true));
|
|
2450
|
-
* };
|
|
2456
|
+
* });
|
|
2451
2457
|
*
|
|
2452
2458
|
* @param {boolean} visible - A flag indicating whether the embedded menu should be visible.
|
|
2453
2459
|
*/
|
|
@@ -2472,10 +2478,10 @@ export declare class ShowEmbeddedMenu extends CommandBase {
|
|
|
2472
2478
|
* Pass true to restore if entering a mode that uses native controls.
|
|
2473
2479
|
*
|
|
2474
2480
|
* @example
|
|
2475
|
-
* import {
|
|
2476
|
-
*
|
|
2481
|
+
* import { integrateMetabox, Communicator, ShowOverlayInterface } from '@3dsource/metabox-modular-configurator-api';
|
|
2482
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2477
2483
|
* api.sendCommandToMetabox(new ShowOverlayInterface(true));
|
|
2478
|
-
* };
|
|
2484
|
+
* });
|
|
2479
2485
|
*
|
|
2480
2486
|
* @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.
|
|
2481
2487
|
*/
|
|
@@ -2498,10 +2504,10 @@ export declare class ShowOverlayInterface extends CommandBase {
|
|
|
2498
2504
|
* Track visibility state in your app to keep toggle buttons in sync.
|
|
2499
2505
|
*
|
|
2500
2506
|
* @example
|
|
2501
|
-
* import {
|
|
2502
|
-
*
|
|
2507
|
+
* import { integrateMetabox, Communicator, ShowMeasurement } from '@3dsource/metabox-modular-configurator-api';
|
|
2508
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2503
2509
|
* api.sendCommandToMetabox(new ShowMeasurement());
|
|
2504
|
-
* };
|
|
2510
|
+
* });
|
|
2505
2511
|
*/
|
|
2506
2512
|
export declare class ShowMeasurement extends CommandBase {
|
|
2507
2513
|
constructor();
|
|
@@ -2522,10 +2528,10 @@ export declare class ShowMeasurement extends CommandBase {
|
|
|
2522
2528
|
* Track visibility state in your app state to keep toggle buttons in sync.
|
|
2523
2529
|
*
|
|
2524
2530
|
* @example
|
|
2525
|
-
* import {
|
|
2526
|
-
*
|
|
2531
|
+
* import { integrateMetabox, Communicator, HideMeasurement } from '@3dsource/metabox-modular-configurator-api';
|
|
2532
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2527
2533
|
* api.sendCommandToMetabox(new HideMeasurement());
|
|
2528
|
-
* };
|
|
2534
|
+
* });
|
|
2529
2535
|
*/
|
|
2530
2536
|
export declare class HideMeasurement extends CommandBase {
|
|
2531
2537
|
constructor();
|
|
@@ -2546,10 +2552,10 @@ export declare class HideMeasurement extends CommandBase {
|
|
|
2546
2552
|
* does not reinitialize the configurator or reset component/environment state.
|
|
2547
2553
|
*
|
|
2548
2554
|
* @example
|
|
2549
|
-
* import {
|
|
2550
|
-
*
|
|
2555
|
+
* import { integrateMetabox, Communicator, ResumeStream } from '@3dsource/metabox-modular-configurator-api';
|
|
2556
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2551
2557
|
* api.sendCommandToMetabox(new ResumeStream());
|
|
2552
|
-
* };
|
|
2558
|
+
* });
|
|
2553
2559
|
*/
|
|
2554
2560
|
export declare class ResumeStream extends CommandBase {
|
|
2555
2561
|
constructor();
|
|
@@ -2571,10 +2577,10 @@ export declare class ResumeStream extends CommandBase {
|
|
|
2571
2577
|
* does not reset component/environment state. Use `ResumeStream` to reconnect afterwards.
|
|
2572
2578
|
*
|
|
2573
2579
|
* @example
|
|
2574
|
-
* import {
|
|
2575
|
-
*
|
|
2580
|
+
* import { integrateMetabox, Communicator, StopStream } from '@3dsource/metabox-modular-configurator-api';
|
|
2581
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2576
2582
|
* api.sendCommandToMetabox(new StopStream());
|
|
2577
|
-
* };
|
|
2583
|
+
* });
|
|
2578
2584
|
*/
|
|
2579
2585
|
export declare class StopStream extends CommandBase {
|
|
2580
2586
|
constructor();
|
|
@@ -2598,15 +2604,15 @@ export declare class StopStream extends CommandBase {
|
|
|
2598
2604
|
* `userInactivityDetected.countdownVisible` is `true`.
|
|
2599
2605
|
*
|
|
2600
2606
|
* @example
|
|
2601
|
-
* import {
|
|
2602
|
-
*
|
|
2607
|
+
* import { integrateMetabox, Communicator, ResetUserInactivityTimer } from '@3dsource/metabox-modular-configurator-api';
|
|
2608
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2603
2609
|
* api.addEventListener('userInactivityDetected', ({ countdownVisible }) => {
|
|
2604
2610
|
* if (countdownVisible) {
|
|
2605
2611
|
* // show custom UI, then on user confirmation:
|
|
2606
2612
|
* api.sendCommandToMetabox(new ResetUserInactivityTimer());
|
|
2607
2613
|
* }
|
|
2608
2614
|
* });
|
|
2609
|
-
* };
|
|
2615
|
+
* });
|
|
2610
2616
|
*/
|
|
2611
2617
|
export declare class ResetUserInactivityTimer extends CommandBase {
|
|
2612
2618
|
constructor();
|