@3dsource/metabox-modular-configurator-api 3.0.37 → 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 +30 -10
- package/fesm2022/3dsource-metabox-modular-configurator-api.mjs.map +1 -1
- package/llms.txt +2 -0
- package/package.json +2 -2
- package/types/3dsource-metabox-modular-configurator-api.d.ts +95 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3dsource/metabox-modular-configurator-api",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.39",
|
|
4
4
|
"description": "Client API for the Metabox Modular configurator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"metabox",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
],
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git+ssh://git@bitbucket.org/dreamsoft/front-libraries.git"
|
|
13
|
+
"url": "git+ssh://git@ssh.bitbucket.org/dreamsoft/front-libraries.git"
|
|
14
14
|
},
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
16
|
"author": "3dsource",
|
|
@@ -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
|
/**
|
|
@@ -431,6 +436,13 @@ export interface ToMetaBoxMessage {
|
|
|
431
436
|
payload: ToMetaBoxMessageEnvelope;
|
|
432
437
|
target: ToMetaboxTarget;
|
|
433
438
|
apiVersion: string;
|
|
439
|
+
/**
|
|
440
|
+
* True when the command is sent while the host page has transient user activation
|
|
441
|
+
* (a click or key press within the last few seconds). Metabox counts analytics for
|
|
442
|
+
* embed API commands only when it is true, so a command sent on page load is not
|
|
443
|
+
* recorded as a shopper's choice.
|
|
444
|
+
*/
|
|
445
|
+
userActivated: boolean;
|
|
434
446
|
}
|
|
435
447
|
/**
|
|
436
448
|
* Represents a modular configurator envelope with an initial configurator, configuration tree,
|
|
@@ -1458,7 +1470,7 @@ export interface CommunicatorConnection {
|
|
|
1458
1470
|
* NEVER send commands before this callback fires. All commands and event listeners go through this single
|
|
1459
1471
|
* api object. Clean up listeners with removeEventListener on component unmount.
|
|
1460
1472
|
*
|
|
1461
|
-
*
|
|
1473
|
+
* Do not construct it yourself: {@link integrateMetabox} hands it to your `apiReadyCallback`.
|
|
1462
1474
|
*/
|
|
1463
1475
|
export declare class Communicator extends EventDispatcher {
|
|
1464
1476
|
/**
|
|
@@ -1721,7 +1733,6 @@ export declare const prepareIframeSrc: (configuratorId: string, config?: Integra
|
|
|
1721
1733
|
* @param {Communicator} target - The Communicator instance to listen on.
|
|
1722
1734
|
* @param {T} eventName - The event name from {@link FromMetaBoxApiEvents} to subscribe to.
|
|
1723
1735
|
* @returns An Observable that emits the typed payload each time the event fires.
|
|
1724
|
-
* @internal
|
|
1725
1736
|
*/
|
|
1726
1737
|
export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
|
|
1727
1738
|
/**
|
|
@@ -1781,8 +1792,8 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1781
1792
|
* available, arrives on `statusMessageChanged`.
|
|
1782
1793
|
*
|
|
1783
1794
|
* @example
|
|
1784
|
-
* import {
|
|
1785
|
-
*
|
|
1795
|
+
* import { integrateMetabox, Communicator, GetPdf, type PdfStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
1796
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1786
1797
|
*
|
|
1787
1798
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1788
1799
|
* api.addEventListener('pdfStatusChanged', (status: PdfStatus) => {
|
|
@@ -1793,7 +1804,7 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1793
1804
|
* });
|
|
1794
1805
|
*
|
|
1795
1806
|
* api.sendCommandToMetabox(new GetPdf());
|
|
1796
|
-
* };
|
|
1807
|
+
* });
|
|
1797
1808
|
*/
|
|
1798
1809
|
export declare class GetPdf extends CommandBase {
|
|
1799
1810
|
constructor();
|
|
@@ -1827,8 +1838,8 @@ export declare class GetPdf extends CommandBase {
|
|
|
1827
1838
|
* and returns a redirect URL.
|
|
1828
1839
|
*
|
|
1829
1840
|
* @example
|
|
1830
|
-
* import {
|
|
1831
|
-
*
|
|
1841
|
+
* import { integrateMetabox, Communicator, GetCallToActionInformation, type EcomConfigurator } from '@3dsource/metabox-modular-configurator-api';
|
|
1842
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1832
1843
|
*
|
|
1833
1844
|
* //Subscribe as soon as the api is ready: this event fires once, when the ecom data loads
|
|
1834
1845
|
* api.addEventListener('ecomConfiguratorDataUpdated', (data:EcomConfigurator) => {
|
|
@@ -1837,7 +1848,7 @@ export declare class GetPdf extends CommandBase {
|
|
|
1837
1848
|
*
|
|
1838
1849
|
* // Send the command to get Call To Action information from Metabox Modular Configurator
|
|
1839
1850
|
* api.sendCommandToMetabox(new GetCallToActionInformation());
|
|
1840
|
-
* };
|
|
1851
|
+
* });
|
|
1841
1852
|
*/
|
|
1842
1853
|
export declare class GetCallToActionInformation extends CommandBase {
|
|
1843
1854
|
constructor();
|
|
@@ -1861,8 +1872,8 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1861
1872
|
* SetCamera to restore the view.
|
|
1862
1873
|
*
|
|
1863
1874
|
* @example
|
|
1864
|
-
* import {
|
|
1865
|
-
*
|
|
1875
|
+
* import { integrateMetabox, Communicator, GetCamera, type CameraCommandPayload } from '@3dsource/metabox-modular-configurator-api';
|
|
1876
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1866
1877
|
*
|
|
1867
1878
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1868
1879
|
* api.addEventListener('getCameraResult', (data:CameraCommandPayload) => {
|
|
@@ -1870,7 +1881,7 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1870
1881
|
* });
|
|
1871
1882
|
*
|
|
1872
1883
|
* api.sendCommandToMetabox(new GetCamera());
|
|
1873
|
-
* };
|
|
1884
|
+
* });
|
|
1874
1885
|
*/
|
|
1875
1886
|
export declare class GetCamera extends CommandBase {
|
|
1876
1887
|
constructor();
|
|
@@ -1894,8 +1905,8 @@ export declare class GetCamera extends CommandBase {
|
|
|
1894
1905
|
* `{fov?, mode?, position?, rotation?, restrictions?}`.
|
|
1895
1906
|
*
|
|
1896
1907
|
* @example
|
|
1897
|
-
* import {
|
|
1898
|
-
*
|
|
1908
|
+
* import { integrateMetabox, Communicator, SetCamera } from '@3dsource/metabox-modular-configurator-api';
|
|
1909
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1899
1910
|
* api.sendCommandToMetabox(new SetCamera({
|
|
1900
1911
|
* fov: 45,
|
|
1901
1912
|
* mode: 'orbit',
|
|
@@ -1912,7 +1923,7 @@ export declare class GetCamera extends CommandBase {
|
|
|
1912
1923
|
* minVerticalRotation: 0,
|
|
1913
1924
|
* },
|
|
1914
1925
|
* }));
|
|
1915
|
-
* };
|
|
1926
|
+
* });
|
|
1916
1927
|
*
|
|
1917
1928
|
* @param {CameraCommandPayload} camera - The camera configuration.
|
|
1918
1929
|
*/
|
|
@@ -1935,10 +1946,10 @@ export declare class SetCamera extends CommandBase {
|
|
|
1935
1946
|
* Good practice to call after SetComponent changes that may shift the focal point of the assembly.
|
|
1936
1947
|
*
|
|
1937
1948
|
* @example
|
|
1938
|
-
* import {
|
|
1939
|
-
*
|
|
1949
|
+
* import { integrateMetabox, Communicator, ResetCamera } from '@3dsource/metabox-modular-configurator-api';
|
|
1950
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1940
1951
|
* api.sendCommandToMetabox(new ResetCamera());
|
|
1941
|
-
* };
|
|
1952
|
+
* });
|
|
1942
1953
|
*/
|
|
1943
1954
|
export declare class ResetCamera extends CommandBase {
|
|
1944
1955
|
constructor();
|
|
@@ -1971,8 +1982,8 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1971
1982
|
* its default framing.
|
|
1972
1983
|
*
|
|
1973
1984
|
* @example
|
|
1974
|
-
* import {
|
|
1975
|
-
*
|
|
1985
|
+
* import { integrateMetabox, Communicator, ResetConfiguration, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
1986
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1976
1987
|
*
|
|
1977
1988
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1978
1989
|
* api.addEventListener('configuratorDataUpdated', (data: ModularConfiguratorEnvelope) => {
|
|
@@ -1980,7 +1991,7 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1980
1991
|
* });
|
|
1981
1992
|
*
|
|
1982
1993
|
* api.sendCommandToMetabox(new ResetConfiguration());
|
|
1983
|
-
* };
|
|
1994
|
+
* });
|
|
1984
1995
|
*/
|
|
1985
1996
|
export declare class ResetConfiguration extends CommandBase {
|
|
1986
1997
|
constructor();
|
|
@@ -2003,10 +2014,10 @@ export declare class ResetConfiguration extends CommandBase {
|
|
|
2003
2014
|
* Pattern: `api.sendCommandToMetabox(new ApplyZoom(50))`.
|
|
2004
2015
|
*
|
|
2005
2016
|
* @example
|
|
2006
|
-
* import { ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
|
|
2007
|
-
*
|
|
2017
|
+
* import { integrateMetabox, ApplyZoom, Communicator } from '@3dsource/metabox-modular-configurator-api';
|
|
2018
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2008
2019
|
* api.sendCommandToMetabox(new ApplyZoom(50));
|
|
2009
|
-
* };
|
|
2020
|
+
* });
|
|
2010
2021
|
*
|
|
2011
2022
|
* @param {number} zoom - The zoom value to apply.
|
|
2012
2023
|
*/
|
|
@@ -2033,15 +2044,15 @@ export declare class ApplyZoom extends CommandBase {
|
|
|
2033
2044
|
* Subscribe to showcaseStatusChanged to track playback state ('playing'/'paused'/'stopped').
|
|
2034
2045
|
*
|
|
2035
2046
|
* @example
|
|
2036
|
-
* import {
|
|
2037
|
-
*
|
|
2047
|
+
* import { integrateMetabox, Communicator, InitShowcase, type ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2048
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2038
2049
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2039
2050
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
2040
2051
|
* console.log('Showcase status value after changed:', data);
|
|
2041
2052
|
* });
|
|
2042
2053
|
*
|
|
2043
2054
|
* api.sendCommandToMetabox(new InitShowcase());
|
|
2044
|
-
* };
|
|
2055
|
+
* });
|
|
2045
2056
|
*/
|
|
2046
2057
|
export declare class InitShowcase extends CommandBase {
|
|
2047
2058
|
constructor();
|
|
@@ -2065,15 +2076,15 @@ export declare class InitShowcase extends CommandBase {
|
|
|
2065
2076
|
* PlayShowcase.
|
|
2066
2077
|
*
|
|
2067
2078
|
* @example
|
|
2068
|
-
* import { Communicator, PlayShowcase } from '@3dsource/metabox-modular-configurator-api';
|
|
2069
|
-
*
|
|
2079
|
+
* import { integrateMetabox, Communicator, PlayShowcase } from '@3dsource/metabox-modular-configurator-api';
|
|
2080
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2070
2081
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2071
2082
|
* api.addEventListener('showcaseStatusChanged', (data) => {
|
|
2072
2083
|
* console.log('Showcase status value after changed:', data);
|
|
2073
2084
|
* });
|
|
2074
2085
|
*
|
|
2075
2086
|
* api.sendCommandToMetabox(new PlayShowcase());
|
|
2076
|
-
* };
|
|
2087
|
+
* });
|
|
2077
2088
|
*/
|
|
2078
2089
|
export declare class PlayShowcase extends CommandBase {
|
|
2079
2090
|
constructor();
|
|
@@ -2104,8 +2115,8 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
2104
2115
|
* to confirm 'pause' state. Use PlayShowcase to resume or StopShowcase to reset.
|
|
2105
2116
|
*
|
|
2106
2117
|
* @example
|
|
2107
|
-
* import {
|
|
2108
|
-
*
|
|
2118
|
+
* import { integrateMetabox, Communicator, PauseShowcase, type ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2119
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2109
2120
|
*
|
|
2110
2121
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2111
2122
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -2113,7 +2124,7 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
2113
2124
|
* });
|
|
2114
2125
|
*
|
|
2115
2126
|
* api.sendCommandToMetabox(new PauseShowcase());
|
|
2116
|
-
* };
|
|
2127
|
+
* });
|
|
2117
2128
|
*/
|
|
2118
2129
|
export declare class PauseShowcase extends CommandBase {
|
|
2119
2130
|
constructor();
|
|
@@ -2137,8 +2148,8 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
2137
2148
|
* interactive mode — re-enable configuration controls.
|
|
2138
2149
|
*
|
|
2139
2150
|
* @example
|
|
2140
|
-
* import { Communicator, ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2141
|
-
*
|
|
2151
|
+
* import { integrateMetabox, Communicator, StopShowcase, type ShowCaseStatus } from '@3dsource/metabox-modular-configurator-api';
|
|
2152
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2142
2153
|
*
|
|
2143
2154
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2144
2155
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -2146,7 +2157,7 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
2146
2157
|
* });
|
|
2147
2158
|
*
|
|
2148
2159
|
* api.sendCommandToMetabox(new StopShowcase());
|
|
2149
|
-
* };
|
|
2160
|
+
* });
|
|
2150
2161
|
*/
|
|
2151
2162
|
export declare class StopShowcase extends CommandBase {
|
|
2152
2163
|
constructor();
|
|
@@ -2189,18 +2200,20 @@ type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
|
2189
2200
|
* Use saveImage() helper to convert base64 to downloadable file.
|
|
2190
2201
|
*
|
|
2191
2202
|
* @example
|
|
2192
|
-
* import {
|
|
2193
|
-
*
|
|
2203
|
+
* import { integrateMetabox, Communicator, GetScreenshot, saveImage } from '@3dsource/metabox-modular-configurator-api';
|
|
2204
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2194
2205
|
*
|
|
2195
2206
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2196
|
-
* api.addEventListener('screenshotReady', (data:string) => {
|
|
2207
|
+
* api.addEventListener('screenshotReady', (data: string | null) => {
|
|
2197
2208
|
* // The data is a base64 string of the image. You can use it to display the image or save it as a file.
|
|
2198
2209
|
* console.log('Get screenshot here:', data);
|
|
2199
|
-
*
|
|
2210
|
+
* if (data) {
|
|
2211
|
+
* saveImage(data, 'Render.png');
|
|
2212
|
+
* }
|
|
2200
2213
|
* });
|
|
2201
2214
|
*
|
|
2202
2215
|
* api.sendCommandToMetabox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));
|
|
2203
|
-
* };
|
|
2216
|
+
* });
|
|
2204
2217
|
*
|
|
2205
2218
|
* @param {MimeType} mimeType - The output format.
|
|
2206
2219
|
* @param {{ x: number; y: number }} [size] - Optional size in pixels.
|
|
@@ -2231,8 +2244,8 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2231
2244
|
* Wrong order = blank viewport. The typeId must match componentType values from the configurator.
|
|
2232
2245
|
*
|
|
2233
2246
|
* @example
|
|
2234
|
-
* import {
|
|
2235
|
-
*
|
|
2247
|
+
* import { integrateMetabox, Communicator, SetComponent, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2248
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2236
2249
|
*
|
|
2237
2250
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2238
2251
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2242,7 +2255,7 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2242
2255
|
* api.sendCommandToMetabox(new SetComponent(
|
|
2243
2256
|
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'typeId'
|
|
2244
2257
|
* ));
|
|
2245
|
-
* };
|
|
2258
|
+
* });
|
|
2246
2259
|
*
|
|
2247
2260
|
* @param {string} id - The component ID.
|
|
2248
2261
|
* @param {string} typeId - The component type ID.
|
|
@@ -2268,8 +2281,8 @@ export declare class SetComponent extends CommandBase {
|
|
|
2268
2281
|
* `new SetComponentMaterial('component-uuid', 'slot-name', 'material-uuid')`. The referenced component must already be set in the tree.
|
|
2269
2282
|
*
|
|
2270
2283
|
* @example
|
|
2271
|
-
* import {
|
|
2272
|
-
*
|
|
2284
|
+
* import { integrateMetabox, Communicator, SetComponentMaterial, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2285
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2273
2286
|
*
|
|
2274
2287
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2275
2288
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2281,7 +2294,7 @@ export declare class SetComponent extends CommandBase {
|
|
|
2281
2294
|
* 'carpaint',
|
|
2282
2295
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2283
2296
|
* ));
|
|
2284
|
-
* };
|
|
2297
|
+
* });
|
|
2285
2298
|
*
|
|
2286
2299
|
* @param {string} componentId - The component ID.
|
|
2287
2300
|
* @param {string} slotId - The slot ID.
|
|
@@ -2307,8 +2320,8 @@ export declare class SetComponentMaterial extends CommandBase {
|
|
|
2307
2320
|
* its own material slots, thumbnails, and lighting properties.
|
|
2308
2321
|
*
|
|
2309
2322
|
* @example
|
|
2310
|
-
* import { Communicator, ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2311
|
-
*
|
|
2323
|
+
* import { integrateMetabox, Communicator, SetEnvironment, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2324
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2312
2325
|
*
|
|
2313
2326
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2314
2327
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2316,7 +2329,7 @@ export declare class SetComponentMaterial extends CommandBase {
|
|
|
2316
2329
|
* });
|
|
2317
2330
|
*
|
|
2318
2331
|
* api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'))
|
|
2319
|
-
* };
|
|
2332
|
+
* });
|
|
2320
2333
|
*
|
|
2321
2334
|
* @param {string} environmentId - The environment ID.
|
|
2322
2335
|
*/
|
|
@@ -2341,8 +2354,8 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2341
2354
|
* has configurable material slots.
|
|
2342
2355
|
*
|
|
2343
2356
|
* @example
|
|
2344
|
-
* import { Communicator, ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2345
|
-
*
|
|
2357
|
+
* import { integrateMetabox, Communicator, SetEnvironmentMaterial, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2358
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2346
2359
|
*
|
|
2347
2360
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2348
2361
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2353,7 +2366,7 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2353
2366
|
* 'carpaint',
|
|
2354
2367
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2355
2368
|
* ));
|
|
2356
|
-
* };
|
|
2369
|
+
* });
|
|
2357
2370
|
*
|
|
2358
2371
|
* @param {string} slotId - The slot ID.
|
|
2359
2372
|
* @param {string} materialId - The material ID.
|
|
@@ -2400,8 +2413,8 @@ type MaterialCommand = SetComponentMaterial | SetEnvironmentMaterial;
|
|
|
2400
2413
|
* Keep using `SetComponentMaterial` on its own for a single swatch click.
|
|
2401
2414
|
*
|
|
2402
2415
|
* @example
|
|
2403
|
-
* import { Communicator,
|
|
2404
|
-
*
|
|
2416
|
+
* import { integrateMetabox, Communicator, SetComponentMaterial, SetEnvironmentMaterial, SetMaterials, type ModularConfiguratorEnvelope } from '@3dsource/metabox-modular-configurator-api';
|
|
2417
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2405
2418
|
*
|
|
2406
2419
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2407
2420
|
* api.addEventListener('configuratorDataUpdated', (data:ModularConfiguratorEnvelope) => {
|
|
@@ -2412,7 +2425,7 @@ type MaterialCommand = SetComponentMaterial | SetEnvironmentMaterial;
|
|
|
2412
2425
|
* new SetComponentMaterial('ffea6b5c-3a8a-4f56-9417-e605acb5cca3', 'carpaint', 'dd829d6e-9200-47a7-8d5b-af5df89b7e91'),
|
|
2413
2426
|
* new SetEnvironmentMaterial('floor', '7c1f4b2a-58e3-4a19-9d6c-2b0f83e5a114'),
|
|
2414
2427
|
* ]));
|
|
2415
|
-
* };
|
|
2428
|
+
* });
|
|
2416
2429
|
*
|
|
2417
2430
|
* @param {MaterialCommand[]} commands - The material commands to apply, in order.
|
|
2418
2431
|
*/
|
|
@@ -2437,10 +2450,10 @@ export declare class SetMaterials extends CommandBase {
|
|
|
2437
2450
|
* Pattern for custom UI: `ShowEmbeddedMenu(false)` + `ShowOverlayInterface(false)`.
|
|
2438
2451
|
*
|
|
2439
2452
|
* @example
|
|
2440
|
-
* import {
|
|
2441
|
-
*
|
|
2453
|
+
* import { integrateMetabox, Communicator, ShowEmbeddedMenu } from '@3dsource/metabox-modular-configurator-api';
|
|
2454
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2442
2455
|
* api.sendCommandToMetabox(new ShowEmbeddedMenu(true));
|
|
2443
|
-
* };
|
|
2456
|
+
* });
|
|
2444
2457
|
*
|
|
2445
2458
|
* @param {boolean} visible - A flag indicating whether the embedded menu should be visible.
|
|
2446
2459
|
*/
|
|
@@ -2465,10 +2478,10 @@ export declare class ShowEmbeddedMenu extends CommandBase {
|
|
|
2465
2478
|
* Pass true to restore if entering a mode that uses native controls.
|
|
2466
2479
|
*
|
|
2467
2480
|
* @example
|
|
2468
|
-
* import {
|
|
2469
|
-
*
|
|
2481
|
+
* import { integrateMetabox, Communicator, ShowOverlayInterface } from '@3dsource/metabox-modular-configurator-api';
|
|
2482
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2470
2483
|
* api.sendCommandToMetabox(new ShowOverlayInterface(true));
|
|
2471
|
-
* };
|
|
2484
|
+
* });
|
|
2472
2485
|
*
|
|
2473
2486
|
* @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.
|
|
2474
2487
|
*/
|
|
@@ -2491,10 +2504,10 @@ export declare class ShowOverlayInterface extends CommandBase {
|
|
|
2491
2504
|
* Track visibility state in your app to keep toggle buttons in sync.
|
|
2492
2505
|
*
|
|
2493
2506
|
* @example
|
|
2494
|
-
* import {
|
|
2495
|
-
*
|
|
2507
|
+
* import { integrateMetabox, Communicator, ShowMeasurement } from '@3dsource/metabox-modular-configurator-api';
|
|
2508
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2496
2509
|
* api.sendCommandToMetabox(new ShowMeasurement());
|
|
2497
|
-
* };
|
|
2510
|
+
* });
|
|
2498
2511
|
*/
|
|
2499
2512
|
export declare class ShowMeasurement extends CommandBase {
|
|
2500
2513
|
constructor();
|
|
@@ -2515,10 +2528,10 @@ export declare class ShowMeasurement extends CommandBase {
|
|
|
2515
2528
|
* Track visibility state in your app state to keep toggle buttons in sync.
|
|
2516
2529
|
*
|
|
2517
2530
|
* @example
|
|
2518
|
-
* import {
|
|
2519
|
-
*
|
|
2531
|
+
* import { integrateMetabox, Communicator, HideMeasurement } from '@3dsource/metabox-modular-configurator-api';
|
|
2532
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2520
2533
|
* api.sendCommandToMetabox(new HideMeasurement());
|
|
2521
|
-
* };
|
|
2534
|
+
* });
|
|
2522
2535
|
*/
|
|
2523
2536
|
export declare class HideMeasurement extends CommandBase {
|
|
2524
2537
|
constructor();
|
|
@@ -2539,10 +2552,10 @@ export declare class HideMeasurement extends CommandBase {
|
|
|
2539
2552
|
* does not reinitialize the configurator or reset component/environment state.
|
|
2540
2553
|
*
|
|
2541
2554
|
* @example
|
|
2542
|
-
* import {
|
|
2543
|
-
*
|
|
2555
|
+
* import { integrateMetabox, Communicator, ResumeStream } from '@3dsource/metabox-modular-configurator-api';
|
|
2556
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2544
2557
|
* api.sendCommandToMetabox(new ResumeStream());
|
|
2545
|
-
* };
|
|
2558
|
+
* });
|
|
2546
2559
|
*/
|
|
2547
2560
|
export declare class ResumeStream extends CommandBase {
|
|
2548
2561
|
constructor();
|
|
@@ -2564,10 +2577,10 @@ export declare class ResumeStream extends CommandBase {
|
|
|
2564
2577
|
* does not reset component/environment state. Use `ResumeStream` to reconnect afterwards.
|
|
2565
2578
|
*
|
|
2566
2579
|
* @example
|
|
2567
|
-
* import {
|
|
2568
|
-
*
|
|
2580
|
+
* import { integrateMetabox, Communicator, StopStream } from '@3dsource/metabox-modular-configurator-api';
|
|
2581
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2569
2582
|
* api.sendCommandToMetabox(new StopStream());
|
|
2570
|
-
* };
|
|
2583
|
+
* });
|
|
2571
2584
|
*/
|
|
2572
2585
|
export declare class StopStream extends CommandBase {
|
|
2573
2586
|
constructor();
|
|
@@ -2591,15 +2604,15 @@ export declare class StopStream extends CommandBase {
|
|
|
2591
2604
|
* `userInactivityDetected.countdownVisible` is `true`.
|
|
2592
2605
|
*
|
|
2593
2606
|
* @example
|
|
2594
|
-
* import {
|
|
2595
|
-
*
|
|
2607
|
+
* import { integrateMetabox, Communicator, ResetUserInactivityTimer } from '@3dsource/metabox-modular-configurator-api';
|
|
2608
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2596
2609
|
* api.addEventListener('userInactivityDetected', ({ countdownVisible }) => {
|
|
2597
2610
|
* if (countdownVisible) {
|
|
2598
2611
|
* // show custom UI, then on user confirmation:
|
|
2599
2612
|
* api.sendCommandToMetabox(new ResetUserInactivityTimer());
|
|
2600
2613
|
* }
|
|
2601
2614
|
* });
|
|
2602
|
-
* };
|
|
2615
|
+
* });
|
|
2603
2616
|
*/
|
|
2604
2617
|
export declare class ResetUserInactivityTimer extends CommandBase {
|
|
2605
2618
|
constructor();
|