@3dsource/metabox-front-api 3.0.34 → 3.0.35
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 +93 -55
- package/fesm2022/3dsource-metabox-front-api.mjs +25 -7
- package/fesm2022/3dsource-metabox-front-api.mjs.map +1 -1
- package/llms.txt +2 -0
- package/package.json +1 -1
- package/types/3dsource-metabox-front-api.d.ts +89 -84
package/llms.txt
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
|
|
25
25
|
- [Type declarations](./types/3dsource-metabox-front-api.d.ts): `ToMetaboxMessagePayloads` (command payloads), `FromMetaboxMessagePayloads` (event payloads), `ConfiguratorEnvelope`, `IntegrateMetaboxConfig` — each documented with JSDoc
|
|
26
26
|
|
|
27
|
+
- [API reference in Markdown](https://preview.3dsource.com/front-libraries/master/basic-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/basic-configurator-api-doc-md/SKILL.md) explains how to navigate it
|
|
28
|
+
|
|
27
29
|
## Optional
|
|
28
30
|
|
|
29
31
|
- [React integration example](./README.md#react-integration-example): A complete React component
|
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
|
|
@@ -66,9 +66,10 @@ export declare const AppLoaded = "appLoaded";
|
|
|
66
66
|
*
|
|
67
67
|
* ### AI Coding Best Practices
|
|
68
68
|
* Let integrateMetabox() use the default. Override only if needed:
|
|
69
|
-
* `integrateMetabox(id, container, callback, { domain: '
|
|
69
|
+
* `integrateMetabox(id, container, callback, { domain: 'custom.domain.com' })` — hostname only; `https://` is added for you.
|
|
70
70
|
* HTTPS is mandatory — HTTP will be rejected.
|
|
71
71
|
*/
|
|
72
|
+
export declare const MetaboxDomain = "metabox.3dsource.com";
|
|
72
73
|
/**
|
|
73
74
|
* @deprecated
|
|
74
75
|
*/
|
|
@@ -81,7 +82,6 @@ export declare const MetaboxHost_V3 = "metaboxHost_v3";
|
|
|
81
82
|
* @deprecated
|
|
82
83
|
*/
|
|
83
84
|
export declare const AppLoaded_V3 = "appLoaded_v3";
|
|
84
|
-
export declare const MetaboxDomain = "metabox.3dsource.com";
|
|
85
85
|
/**
|
|
86
86
|
* Base route path appended to the domain when building the configurator iframe URL.
|
|
87
87
|
*
|
|
@@ -97,7 +97,7 @@ export declare const MetaboxDomain = "metabox.3dsource.com";
|
|
|
97
97
|
* (e.g., QR codes, email links, server-side rendering).
|
|
98
98
|
*/
|
|
99
99
|
export declare const BasicRouteUrl = "metabox-configurator/basic";
|
|
100
|
-
export declare const VERSION = "3.0.
|
|
100
|
+
export declare const VERSION = "3.0.35";
|
|
101
101
|
/**
|
|
102
102
|
* Configuration options for integrating the Metabox Basic Configurator iframe into a host page.
|
|
103
103
|
* Passed as the `config` parameter to {@link integrateMetabox}.
|
|
@@ -297,7 +297,10 @@ export interface ToMetaboxMessagePayloads {
|
|
|
297
297
|
[MetaboxBasicConfiguratorActions.pauseShowcase]: void;
|
|
298
298
|
[MetaboxBasicConfiguratorActions.stopShowcase]: void;
|
|
299
299
|
[MetaboxBasicConfiguratorActions.sendCommandToUnreal]: object;
|
|
300
|
+
[MetaboxBasicConfiguratorActions.showMeasurement]: void;
|
|
301
|
+
[MetaboxBasicConfiguratorActions.hideMeasurement]: void;
|
|
300
302
|
[MetaboxBasicConfiguratorActions.resetUserInactivityTimer]: void;
|
|
303
|
+
[MetaboxBasicConfiguratorActions.resumeStream]: void;
|
|
301
304
|
[MetaboxBasicConfiguratorActions.stopStream]: void;
|
|
302
305
|
}
|
|
303
306
|
/**
|
|
@@ -1258,11 +1261,12 @@ export interface CommunicatorConnection {
|
|
|
1258
1261
|
* NEVER send commands before this callback fires. All commands and event listeners go through this single
|
|
1259
1262
|
* api object. Clean up listeners with removeEventListener on component unmount.
|
|
1260
1263
|
*
|
|
1261
|
-
*
|
|
1264
|
+
* Do not construct it yourself: {@link integrateMetabox} hands it to your `apiReadyCallback`.
|
|
1262
1265
|
*/
|
|
1263
1266
|
export declare class Communicator extends EventDispatcher {
|
|
1264
1267
|
/**
|
|
1265
|
-
*
|
|
1268
|
+
* @deprecated Never assigned, always `null`. Keep the `api` passed to the
|
|
1269
|
+
* `integrateMetabox` callback instead.
|
|
1266
1270
|
*/
|
|
1267
1271
|
static instance: Communicator | null;
|
|
1268
1272
|
/**
|
|
@@ -1545,7 +1549,6 @@ export declare const prepareIframeSrc: (configuratorId: string, config?: Integra
|
|
|
1545
1549
|
* @param {Communicator} target - The Communicator instance to listen on.
|
|
1546
1550
|
* @param {T} eventName - The event name from {@link FromMetaBoxApiEvents} to subscribe to.
|
|
1547
1551
|
* @returns An Observable that emits the typed payload each time the event fires.
|
|
1548
|
-
* @internal
|
|
1549
1552
|
*/
|
|
1550
1553
|
export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
|
|
1551
1554
|
/**
|
|
@@ -1605,8 +1608,8 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1605
1608
|
* available, arrives on `statusMessageChanged`.
|
|
1606
1609
|
*
|
|
1607
1610
|
* @example
|
|
1608
|
-
* import {
|
|
1609
|
-
*
|
|
1611
|
+
* import { integrateMetabox, Communicator, GetPdf, type PdfStatus } from '@3dsource/metabox-front-api';
|
|
1612
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1610
1613
|
*
|
|
1611
1614
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1612
1615
|
* api.addEventListener('pdfStatusChanged', (status: PdfStatus) => {
|
|
@@ -1617,7 +1620,7 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1617
1620
|
* });
|
|
1618
1621
|
*
|
|
1619
1622
|
* api.sendCommandToMetabox(new GetPdf());
|
|
1620
|
-
* };
|
|
1623
|
+
* });
|
|
1621
1624
|
*/
|
|
1622
1625
|
export declare class GetPdf extends CommandBase {
|
|
1623
1626
|
constructor();
|
|
@@ -1651,17 +1654,17 @@ export declare class GetPdf extends CommandBase {
|
|
|
1651
1654
|
* and returns a redirect URL.
|
|
1652
1655
|
*
|
|
1653
1656
|
* @example
|
|
1654
|
-
* import { Communicator,
|
|
1655
|
-
*
|
|
1657
|
+
* import { integrateMetabox, Communicator, GetCallToActionInformation, type EcomConfigurator } from '@3dsource/metabox-front-api';
|
|
1658
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1656
1659
|
*
|
|
1657
1660
|
* //Subscribe as soon as the api is ready: this event fires once, when the ecom data loads
|
|
1658
1661
|
* api.addEventListener('ecomConfiguratorDataUpdated', (data:EcomConfigurator) => {
|
|
1659
1662
|
* console.log('Ecom configurator params:', data);
|
|
1660
1663
|
* });
|
|
1661
1664
|
*
|
|
1662
|
-
* Send the command to get Call To Action information from Metabox Basic Configurator
|
|
1665
|
+
* // Send the command to get Call To Action information from Metabox Basic Configurator
|
|
1663
1666
|
* api.sendCommandToMetabox(new GetCallToActionInformation());
|
|
1664
|
-
* };
|
|
1667
|
+
* });
|
|
1665
1668
|
*/
|
|
1666
1669
|
export declare class GetCallToActionInformation extends CommandBase {
|
|
1667
1670
|
constructor();
|
|
@@ -1685,8 +1688,8 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1685
1688
|
* SetCamera to restore the view.
|
|
1686
1689
|
*
|
|
1687
1690
|
* @example
|
|
1688
|
-
* import { Communicator,
|
|
1689
|
-
*
|
|
1691
|
+
* import { integrateMetabox, Communicator, GetCamera, type CameraCommandPayload } from '@3dsource/metabox-front-api';
|
|
1692
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1690
1693
|
*
|
|
1691
1694
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1692
1695
|
* api.addEventListener('getCameraResult', (data:CameraCommandPayload) => {
|
|
@@ -1694,7 +1697,7 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1694
1697
|
* });
|
|
1695
1698
|
*
|
|
1696
1699
|
* api.sendCommandToMetabox(new GetCamera());
|
|
1697
|
-
* };
|
|
1700
|
+
* });
|
|
1698
1701
|
*/
|
|
1699
1702
|
export declare class GetCamera extends CommandBase {
|
|
1700
1703
|
constructor();
|
|
@@ -1718,8 +1721,8 @@ export declare class GetCamera extends CommandBase {
|
|
|
1718
1721
|
* `{fov?, mode?, position?, rotation?, restrictions?}`.
|
|
1719
1722
|
*
|
|
1720
1723
|
* @example
|
|
1721
|
-
* import {
|
|
1722
|
-
*
|
|
1724
|
+
* import { integrateMetabox, Communicator, SetCamera } from '@3dsource/metabox-front-api';
|
|
1725
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1723
1726
|
* api.sendCommandToMetabox(new SetCamera({
|
|
1724
1727
|
* fov: 45,
|
|
1725
1728
|
* mode: 'orbit',
|
|
@@ -1736,7 +1739,7 @@ export declare class GetCamera extends CommandBase {
|
|
|
1736
1739
|
* minVerticalRotation: 0,
|
|
1737
1740
|
* },
|
|
1738
1741
|
* }));
|
|
1739
|
-
* };
|
|
1742
|
+
* });
|
|
1740
1743
|
*
|
|
1741
1744
|
* @param {CameraCommandPayload} camera - The camera configuration.
|
|
1742
1745
|
*/
|
|
@@ -1759,10 +1762,10 @@ export declare class SetCamera extends CommandBase {
|
|
|
1759
1762
|
* Good practice to call after SetProduct changes that may shift the focal point.
|
|
1760
1763
|
*
|
|
1761
1764
|
* @example
|
|
1762
|
-
* import {
|
|
1763
|
-
*
|
|
1765
|
+
* import { integrateMetabox, Communicator, ResetCamera } from '@3dsource/metabox-front-api';
|
|
1766
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1764
1767
|
* api.sendCommandToMetabox(new ResetCamera());
|
|
1765
|
-
* };
|
|
1768
|
+
* });
|
|
1766
1769
|
*/
|
|
1767
1770
|
export declare class ResetCamera extends CommandBase {
|
|
1768
1771
|
constructor();
|
|
@@ -1792,8 +1795,8 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1792
1795
|
* you also want the viewport returned to its default framing.
|
|
1793
1796
|
*
|
|
1794
1797
|
* @example
|
|
1795
|
-
* import {
|
|
1796
|
-
*
|
|
1798
|
+
* import { integrateMetabox, Communicator, ResetConfiguration, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
1799
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1797
1800
|
*
|
|
1798
1801
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1799
1802
|
* api.addEventListener('configuratorDataUpdated', (data: ConfiguratorEnvelope) => {
|
|
@@ -1801,7 +1804,7 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1801
1804
|
* });
|
|
1802
1805
|
*
|
|
1803
1806
|
* api.sendCommandToMetabox(new ResetConfiguration());
|
|
1804
|
-
* };
|
|
1807
|
+
* });
|
|
1805
1808
|
*/
|
|
1806
1809
|
export declare class ResetConfiguration extends CommandBase {
|
|
1807
1810
|
constructor();
|
|
@@ -1824,10 +1827,10 @@ export declare class ResetConfiguration extends CommandBase {
|
|
|
1824
1827
|
* Pattern: `api.sendCommandToMetabox(new ApplyZoom(50))`.
|
|
1825
1828
|
*
|
|
1826
1829
|
* @example
|
|
1827
|
-
* import { ApplyZoom, Communicator } from '@3dsource/metabox-front-api';
|
|
1828
|
-
*
|
|
1830
|
+
* import { integrateMetabox, ApplyZoom, Communicator } from '@3dsource/metabox-front-api';
|
|
1831
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1829
1832
|
* api.sendCommandToMetabox(new ApplyZoom(50));
|
|
1830
|
-
* };
|
|
1833
|
+
* });
|
|
1831
1834
|
*
|
|
1832
1835
|
* @param {number} zoom - The zoom value to apply.
|
|
1833
1836
|
*/
|
|
@@ -1855,15 +1858,15 @@ export declare class ApplyZoom extends CommandBase {
|
|
|
1855
1858
|
* Subscribe to showcaseStatusChanged to track playback state ('playing'/'paused'/'stopped').
|
|
1856
1859
|
*
|
|
1857
1860
|
* @example
|
|
1858
|
-
* import { Communicator,
|
|
1859
|
-
*
|
|
1861
|
+
* import { integrateMetabox, Communicator, InitShowcase, type ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1862
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1860
1863
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1861
1864
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
1862
1865
|
* console.log('Showcase status value after changed:', data);
|
|
1863
1866
|
* });
|
|
1864
1867
|
*
|
|
1865
1868
|
* api.sendCommandToMetabox(new InitShowcase());
|
|
1866
|
-
* };
|
|
1869
|
+
* });
|
|
1867
1870
|
*/
|
|
1868
1871
|
export declare class InitShowcase extends CommandBase {
|
|
1869
1872
|
constructor();
|
|
@@ -1887,15 +1890,15 @@ export declare class InitShowcase extends CommandBase {
|
|
|
1887
1890
|
* PlayShowcase.
|
|
1888
1891
|
*
|
|
1889
1892
|
* @example
|
|
1890
|
-
* import { Communicator,PlayShowcase } from '@3dsource/metabox-front-api';
|
|
1891
|
-
*
|
|
1893
|
+
* import { integrateMetabox, Communicator, PlayShowcase } from '@3dsource/metabox-front-api';
|
|
1894
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1892
1895
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1893
1896
|
* api.addEventListener('showcaseStatusChanged', (data) => {
|
|
1894
1897
|
* console.log('Showcase status value after changed:', data);
|
|
1895
1898
|
* });
|
|
1896
1899
|
*
|
|
1897
1900
|
* api.sendCommandToMetabox(new PlayShowcase());
|
|
1898
|
-
* };
|
|
1901
|
+
* });
|
|
1899
1902
|
*/
|
|
1900
1903
|
export declare class PlayShowcase extends CommandBase {
|
|
1901
1904
|
constructor();
|
|
@@ -1928,8 +1931,8 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
1928
1931
|
* to confirm 'pause' state. Use PlayShowcase to resume or StopShowcase to reset.
|
|
1929
1932
|
*
|
|
1930
1933
|
* @example
|
|
1931
|
-
* import { Communicator,
|
|
1932
|
-
*
|
|
1934
|
+
* import { integrateMetabox, Communicator, PauseShowcase, type ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1935
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1933
1936
|
*
|
|
1934
1937
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1935
1938
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -1937,7 +1940,7 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
1937
1940
|
* });
|
|
1938
1941
|
*
|
|
1939
1942
|
* api.sendCommandToMetabox(new PauseShowcase());
|
|
1940
|
-
* };
|
|
1943
|
+
* });
|
|
1941
1944
|
*/
|
|
1942
1945
|
export declare class PauseShowcase extends CommandBase {
|
|
1943
1946
|
constructor();
|
|
@@ -1961,8 +1964,8 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
1961
1964
|
* interactive mode — re-enable configuration controls.
|
|
1962
1965
|
*
|
|
1963
1966
|
* @example
|
|
1964
|
-
* import { Communicator,ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1965
|
-
*
|
|
1967
|
+
* import { integrateMetabox, Communicator, StopShowcase, type ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1968
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1966
1969
|
*
|
|
1967
1970
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1968
1971
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -1970,7 +1973,7 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
1970
1973
|
* });
|
|
1971
1974
|
*
|
|
1972
1975
|
* api.sendCommandToMetabox(new StopShowcase());
|
|
1973
|
-
* };
|
|
1976
|
+
* });
|
|
1974
1977
|
*/
|
|
1975
1978
|
export declare class StopShowcase extends CommandBase {
|
|
1976
1979
|
constructor();
|
|
@@ -2013,18 +2016,20 @@ type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
|
2013
2016
|
* Use saveImage() helper to convert base64 to downloadable file.
|
|
2014
2017
|
*
|
|
2015
2018
|
* @example
|
|
2016
|
-
* import { Communicator,
|
|
2017
|
-
*
|
|
2019
|
+
* import { integrateMetabox, Communicator, GetScreenshot, saveImage } from '@3dsource/metabox-front-api';
|
|
2020
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2018
2021
|
*
|
|
2019
2022
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2020
|
-
* api.addEventListener('screenshotReady', (data:string) => {
|
|
2023
|
+
* api.addEventListener('screenshotReady', (data: string | null) => {
|
|
2021
2024
|
* // The data is a base64 string of the image. You can use it to display the image or save it as a file.
|
|
2022
2025
|
* console.log('Get screenshot here:', data);
|
|
2023
|
-
*
|
|
2026
|
+
* if (data) {
|
|
2027
|
+
* saveImage(data, 'Render.png');
|
|
2028
|
+
* }
|
|
2024
2029
|
* });
|
|
2025
2030
|
*
|
|
2026
2031
|
* api.sendCommandToMetabox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));
|
|
2027
|
-
* };
|
|
2032
|
+
* });
|
|
2028
2033
|
*
|
|
2029
2034
|
* @param {MimeType} mimeType - The output format.
|
|
2030
2035
|
* @param {{ x: number; y: number }} [size] - Optional size in pixels.
|
|
@@ -2056,8 +2061,8 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2056
2061
|
* re-apply them if needed.
|
|
2057
2062
|
*
|
|
2058
2063
|
* @example
|
|
2059
|
-
* import { Communicator,ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2060
|
-
*
|
|
2064
|
+
* import { integrateMetabox, Communicator, SetProduct, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2065
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2061
2066
|
*
|
|
2062
2067
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2063
2068
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2067,7 +2072,7 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2067
2072
|
* api.sendCommandToMetabox(new SetProduct(
|
|
2068
2073
|
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
|
|
2069
2074
|
* ));
|
|
2070
|
-
* };
|
|
2075
|
+
* });
|
|
2071
2076
|
*
|
|
2072
2077
|
* @param {string} productId - The product ID.
|
|
2073
2078
|
*/
|
|
@@ -2093,8 +2098,8 @@ export declare class SetProduct extends CommandBase {
|
|
|
2093
2098
|
* `new SetProductMaterial('slot-name', 'material-uuid')`. The referenced product must already be set.
|
|
2094
2099
|
*
|
|
2095
2100
|
* @example
|
|
2096
|
-
* import { Communicator,
|
|
2097
|
-
*
|
|
2101
|
+
* import { integrateMetabox, Communicator, SetProductMaterial, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2102
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2098
2103
|
*
|
|
2099
2104
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2100
2105
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2105,7 +2110,7 @@ export declare class SetProduct extends CommandBase {
|
|
|
2105
2110
|
* 'carpaint',
|
|
2106
2111
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2107
2112
|
* ));
|
|
2108
|
-
* };
|
|
2113
|
+
* });
|
|
2109
2114
|
*
|
|
2110
2115
|
* @param {string} slotId - The slot ID.
|
|
2111
2116
|
* @param {string} materialId - The material ID.
|
|
@@ -2130,8 +2135,8 @@ export declare class SetProductMaterial extends CommandBase {
|
|
|
2130
2135
|
* its own material slots, thumbnails, and lighting properties.
|
|
2131
2136
|
*
|
|
2132
2137
|
* @example
|
|
2133
|
-
* import { Communicator,ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2134
|
-
*
|
|
2138
|
+
* import { integrateMetabox, Communicator, SetEnvironment, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2139
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2135
2140
|
*
|
|
2136
2141
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2137
2142
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2139,7 +2144,7 @@ export declare class SetProductMaterial extends CommandBase {
|
|
|
2139
2144
|
* });
|
|
2140
2145
|
*
|
|
2141
2146
|
* api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'))
|
|
2142
|
-
* };
|
|
2147
|
+
* });
|
|
2143
2148
|
*
|
|
2144
2149
|
* @param {string} environmentId - The environment ID.
|
|
2145
2150
|
*/
|
|
@@ -2164,8 +2169,8 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2164
2169
|
* has configurable material slots.
|
|
2165
2170
|
*
|
|
2166
2171
|
* @example
|
|
2167
|
-
* import { Communicator,ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2168
|
-
*
|
|
2172
|
+
* import { integrateMetabox, Communicator, SetEnvironmentMaterial, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2173
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2169
2174
|
*
|
|
2170
2175
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2171
2176
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2176,7 +2181,7 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2176
2181
|
* 'carpaint',
|
|
2177
2182
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2178
2183
|
* ));
|
|
2179
|
-
* };
|
|
2184
|
+
* });
|
|
2180
2185
|
*
|
|
2181
2186
|
* @param {string} slotId - The slot ID.
|
|
2182
2187
|
* @param {string} materialId - The material ID.
|
|
@@ -2222,8 +2227,8 @@ type MaterialCommand = SetProductMaterial | SetEnvironmentMaterial;
|
|
|
2222
2227
|
* `SetProductMaterial` on its own for a single swatch click.
|
|
2223
2228
|
*
|
|
2224
2229
|
* @example
|
|
2225
|
-
* import { Communicator,
|
|
2226
|
-
*
|
|
2230
|
+
* import { integrateMetabox, Communicator, SetEnvironmentMaterial, SetMaterials, SetProductMaterial, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2231
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2227
2232
|
*
|
|
2228
2233
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2229
2234
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2234,7 +2239,7 @@ type MaterialCommand = SetProductMaterial | SetEnvironmentMaterial;
|
|
|
2234
2239
|
* new SetProductMaterial('carpaint', 'dd829d6e-9200-47a7-8d5b-af5df89b7e91'),
|
|
2235
2240
|
* new SetEnvironmentMaterial('floor', '7c1f4b2a-58e3-4a19-9d6c-2b0f83e5a114'),
|
|
2236
2241
|
* ]));
|
|
2237
|
-
* };
|
|
2242
|
+
* });
|
|
2238
2243
|
*
|
|
2239
2244
|
* @param {MaterialCommand[]} commands - The material commands to apply, in order.
|
|
2240
2245
|
*/
|
|
@@ -2259,10 +2264,10 @@ export declare class SetMaterials extends CommandBase {
|
|
|
2259
2264
|
* Pattern for custom UI: `ShowEmbeddedMenu(false)` + `ShowOverlayInterface(false)`.
|
|
2260
2265
|
*
|
|
2261
2266
|
* @example
|
|
2262
|
-
* import {
|
|
2263
|
-
*
|
|
2267
|
+
* import { integrateMetabox, Communicator, ShowEmbeddedMenu } from '@3dsource/metabox-front-api';
|
|
2268
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2264
2269
|
* api.sendCommandToMetabox(new ShowEmbeddedMenu(true));
|
|
2265
|
-
* };
|
|
2270
|
+
* });
|
|
2266
2271
|
*
|
|
2267
2272
|
* @param {boolean} visible - A flag indicating whether the embedded menu should be visible.
|
|
2268
2273
|
*/
|
|
@@ -2287,10 +2292,10 @@ export declare class ShowEmbeddedMenu extends CommandBase {
|
|
|
2287
2292
|
* Pass true to restore if entering a mode that uses native controls.
|
|
2288
2293
|
*
|
|
2289
2294
|
* @example
|
|
2290
|
-
* import {
|
|
2291
|
-
*
|
|
2295
|
+
* import { integrateMetabox, Communicator, ShowOverlayInterface } from '@3dsource/metabox-front-api';
|
|
2296
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2292
2297
|
* api.sendCommandToMetabox(new ShowOverlayInterface(true));
|
|
2293
|
-
* };
|
|
2298
|
+
* });
|
|
2294
2299
|
*
|
|
2295
2300
|
* @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.
|
|
2296
2301
|
*/
|
|
@@ -2313,10 +2318,10 @@ export declare class ShowOverlayInterface extends CommandBase {
|
|
|
2313
2318
|
* Track visibility state in your app to keep toggle buttons in sync.
|
|
2314
2319
|
*
|
|
2315
2320
|
* @example
|
|
2316
|
-
* import {
|
|
2317
|
-
*
|
|
2321
|
+
* import { integrateMetabox, Communicator, ShowMeasurement } from '@3dsource/metabox-front-api';
|
|
2322
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2318
2323
|
* api.sendCommandToMetabox(new ShowMeasurement());
|
|
2319
|
-
* };
|
|
2324
|
+
* });
|
|
2320
2325
|
*/
|
|
2321
2326
|
export declare class ShowMeasurement extends CommandBase {
|
|
2322
2327
|
constructor();
|
|
@@ -2337,10 +2342,10 @@ export declare class ShowMeasurement extends CommandBase {
|
|
|
2337
2342
|
* Track visibility state in your app state to keep toggle buttons in sync.
|
|
2338
2343
|
*
|
|
2339
2344
|
* @example
|
|
2340
|
-
* import {
|
|
2341
|
-
*
|
|
2345
|
+
* import { integrateMetabox, Communicator, HideMeasurement } from '@3dsource/metabox-front-api';
|
|
2346
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2342
2347
|
* api.sendCommandToMetabox(new HideMeasurement());
|
|
2343
|
-
* };
|
|
2348
|
+
* });
|
|
2344
2349
|
*/
|
|
2345
2350
|
export declare class HideMeasurement extends CommandBase {
|
|
2346
2351
|
constructor();
|
|
@@ -2361,10 +2366,10 @@ export declare class HideMeasurement extends CommandBase {
|
|
|
2361
2366
|
* does not reinitialize the configurator or reset product/environment state.
|
|
2362
2367
|
*
|
|
2363
2368
|
* @example
|
|
2364
|
-
* import {
|
|
2365
|
-
*
|
|
2369
|
+
* import { integrateMetabox, Communicator, ResumeStream } from '@3dsource/metabox-front-api';
|
|
2370
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2366
2371
|
* api.sendCommandToMetabox(new ResumeStream());
|
|
2367
|
-
* };
|
|
2372
|
+
* });
|
|
2368
2373
|
*/
|
|
2369
2374
|
export declare class ResumeStream extends CommandBase {
|
|
2370
2375
|
constructor();
|
|
@@ -2386,10 +2391,10 @@ export declare class ResumeStream extends CommandBase {
|
|
|
2386
2391
|
* does not reset product/environment state. Use `ResumeStream` to reconnect afterwards.
|
|
2387
2392
|
*
|
|
2388
2393
|
* @example
|
|
2389
|
-
* import {
|
|
2390
|
-
*
|
|
2394
|
+
* import { integrateMetabox, Communicator, StopStream } from '@3dsource/metabox-front-api';
|
|
2395
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2391
2396
|
* api.sendCommandToMetabox(new StopStream());
|
|
2392
|
-
* };
|
|
2397
|
+
* });
|
|
2393
2398
|
*/
|
|
2394
2399
|
export declare class StopStream extends CommandBase {
|
|
2395
2400
|
constructor();
|
|
@@ -2413,15 +2418,15 @@ export declare class StopStream extends CommandBase {
|
|
|
2413
2418
|
* `userInactivityDetected.countdownVisible` is `true`.
|
|
2414
2419
|
*
|
|
2415
2420
|
* @example
|
|
2416
|
-
* import {
|
|
2417
|
-
*
|
|
2421
|
+
* import { integrateMetabox, Communicator, ResetUserInactivityTimer } from '@3dsource/metabox-front-api';
|
|
2422
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2418
2423
|
* api.addEventListener('userInactivityDetected', ({ countdownVisible }) => {
|
|
2419
2424
|
* if (countdownVisible) {
|
|
2420
2425
|
* // show custom UI, then on user confirmation:
|
|
2421
2426
|
* api.sendCommandToMetabox(new ResetUserInactivityTimer());
|
|
2422
2427
|
* }
|
|
2423
2428
|
* });
|
|
2424
|
-
* };
|
|
2429
|
+
* });
|
|
2425
2430
|
*/
|
|
2426
2431
|
export declare class ResetUserInactivityTimer extends CommandBase {
|
|
2427
2432
|
constructor();
|