@3dsource/metabox-front-api 3.0.33 → 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 +27 -8
- package/fesm2022/3dsource-metabox-front-api.mjs.map +1 -1
- package/llms.txt +2 -0
- package/package.json +2 -2
- package/types/3dsource-metabox-front-api.d.ts +96 -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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3dsource/metabox-front-api",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.35",
|
|
4
4
|
"description": "Client API for the Metabox Basic 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
|
|
@@ -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
|
/**
|
|
@@ -425,6 +428,13 @@ export interface ToMetaBoxMessage {
|
|
|
425
428
|
payload: ToMetaBoxMessageEnvelope;
|
|
426
429
|
target: ToMetaboxTarget;
|
|
427
430
|
apiVersion: string;
|
|
431
|
+
/**
|
|
432
|
+
* True when the command is sent while the host page has transient user activation
|
|
433
|
+
* (a click or key press within the last few seconds). Metabox counts analytics for
|
|
434
|
+
* embed API commands only when it is true, so a command sent on page load is not
|
|
435
|
+
* recorded as a shopper's choice.
|
|
436
|
+
*/
|
|
437
|
+
userActivated: boolean;
|
|
428
438
|
}
|
|
429
439
|
/**
|
|
430
440
|
* Represents an ecom configurator object with all necessary information about cta.
|
|
@@ -1251,11 +1261,12 @@ export interface CommunicatorConnection {
|
|
|
1251
1261
|
* NEVER send commands before this callback fires. All commands and event listeners go through this single
|
|
1252
1262
|
* api object. Clean up listeners with removeEventListener on component unmount.
|
|
1253
1263
|
*
|
|
1254
|
-
*
|
|
1264
|
+
* Do not construct it yourself: {@link integrateMetabox} hands it to your `apiReadyCallback`.
|
|
1255
1265
|
*/
|
|
1256
1266
|
export declare class Communicator extends EventDispatcher {
|
|
1257
1267
|
/**
|
|
1258
|
-
*
|
|
1268
|
+
* @deprecated Never assigned, always `null`. Keep the `api` passed to the
|
|
1269
|
+
* `integrateMetabox` callback instead.
|
|
1259
1270
|
*/
|
|
1260
1271
|
static instance: Communicator | null;
|
|
1261
1272
|
/**
|
|
@@ -1538,7 +1549,6 @@ export declare const prepareIframeSrc: (configuratorId: string, config?: Integra
|
|
|
1538
1549
|
* @param {Communicator} target - The Communicator instance to listen on.
|
|
1539
1550
|
* @param {T} eventName - The event name from {@link FromMetaBoxApiEvents} to subscribe to.
|
|
1540
1551
|
* @returns An Observable that emits the typed payload each time the event fires.
|
|
1541
|
-
* @internal
|
|
1542
1552
|
*/
|
|
1543
1553
|
export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
|
|
1544
1554
|
/**
|
|
@@ -1598,8 +1608,8 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1598
1608
|
* available, arrives on `statusMessageChanged`.
|
|
1599
1609
|
*
|
|
1600
1610
|
* @example
|
|
1601
|
-
* import {
|
|
1602
|
-
*
|
|
1611
|
+
* import { integrateMetabox, Communicator, GetPdf, type PdfStatus } from '@3dsource/metabox-front-api';
|
|
1612
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1603
1613
|
*
|
|
1604
1614
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1605
1615
|
* api.addEventListener('pdfStatusChanged', (status: PdfStatus) => {
|
|
@@ -1610,7 +1620,7 @@ export declare class MetaboxConfig extends CommandBase {
|
|
|
1610
1620
|
* });
|
|
1611
1621
|
*
|
|
1612
1622
|
* api.sendCommandToMetabox(new GetPdf());
|
|
1613
|
-
* };
|
|
1623
|
+
* });
|
|
1614
1624
|
*/
|
|
1615
1625
|
export declare class GetPdf extends CommandBase {
|
|
1616
1626
|
constructor();
|
|
@@ -1644,17 +1654,17 @@ export declare class GetPdf extends CommandBase {
|
|
|
1644
1654
|
* and returns a redirect URL.
|
|
1645
1655
|
*
|
|
1646
1656
|
* @example
|
|
1647
|
-
* import { Communicator,
|
|
1648
|
-
*
|
|
1657
|
+
* import { integrateMetabox, Communicator, GetCallToActionInformation, type EcomConfigurator } from '@3dsource/metabox-front-api';
|
|
1658
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1649
1659
|
*
|
|
1650
1660
|
* //Subscribe as soon as the api is ready: this event fires once, when the ecom data loads
|
|
1651
1661
|
* api.addEventListener('ecomConfiguratorDataUpdated', (data:EcomConfigurator) => {
|
|
1652
1662
|
* console.log('Ecom configurator params:', data);
|
|
1653
1663
|
* });
|
|
1654
1664
|
*
|
|
1655
|
-
* 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
|
|
1656
1666
|
* api.sendCommandToMetabox(new GetCallToActionInformation());
|
|
1657
|
-
* };
|
|
1667
|
+
* });
|
|
1658
1668
|
*/
|
|
1659
1669
|
export declare class GetCallToActionInformation extends CommandBase {
|
|
1660
1670
|
constructor();
|
|
@@ -1678,8 +1688,8 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1678
1688
|
* SetCamera to restore the view.
|
|
1679
1689
|
*
|
|
1680
1690
|
* @example
|
|
1681
|
-
* import { Communicator,
|
|
1682
|
-
*
|
|
1691
|
+
* import { integrateMetabox, Communicator, GetCamera, type CameraCommandPayload } from '@3dsource/metabox-front-api';
|
|
1692
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1683
1693
|
*
|
|
1684
1694
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1685
1695
|
* api.addEventListener('getCameraResult', (data:CameraCommandPayload) => {
|
|
@@ -1687,7 +1697,7 @@ export declare class GetCallToActionInformation extends CommandBase {
|
|
|
1687
1697
|
* });
|
|
1688
1698
|
*
|
|
1689
1699
|
* api.sendCommandToMetabox(new GetCamera());
|
|
1690
|
-
* };
|
|
1700
|
+
* });
|
|
1691
1701
|
*/
|
|
1692
1702
|
export declare class GetCamera extends CommandBase {
|
|
1693
1703
|
constructor();
|
|
@@ -1711,8 +1721,8 @@ export declare class GetCamera extends CommandBase {
|
|
|
1711
1721
|
* `{fov?, mode?, position?, rotation?, restrictions?}`.
|
|
1712
1722
|
*
|
|
1713
1723
|
* @example
|
|
1714
|
-
* import {
|
|
1715
|
-
*
|
|
1724
|
+
* import { integrateMetabox, Communicator, SetCamera } from '@3dsource/metabox-front-api';
|
|
1725
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1716
1726
|
* api.sendCommandToMetabox(new SetCamera({
|
|
1717
1727
|
* fov: 45,
|
|
1718
1728
|
* mode: 'orbit',
|
|
@@ -1729,7 +1739,7 @@ export declare class GetCamera extends CommandBase {
|
|
|
1729
1739
|
* minVerticalRotation: 0,
|
|
1730
1740
|
* },
|
|
1731
1741
|
* }));
|
|
1732
|
-
* };
|
|
1742
|
+
* });
|
|
1733
1743
|
*
|
|
1734
1744
|
* @param {CameraCommandPayload} camera - The camera configuration.
|
|
1735
1745
|
*/
|
|
@@ -1752,10 +1762,10 @@ export declare class SetCamera extends CommandBase {
|
|
|
1752
1762
|
* Good practice to call after SetProduct changes that may shift the focal point.
|
|
1753
1763
|
*
|
|
1754
1764
|
* @example
|
|
1755
|
-
* import {
|
|
1756
|
-
*
|
|
1765
|
+
* import { integrateMetabox, Communicator, ResetCamera } from '@3dsource/metabox-front-api';
|
|
1766
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1757
1767
|
* api.sendCommandToMetabox(new ResetCamera());
|
|
1758
|
-
* };
|
|
1768
|
+
* });
|
|
1759
1769
|
*/
|
|
1760
1770
|
export declare class ResetCamera extends CommandBase {
|
|
1761
1771
|
constructor();
|
|
@@ -1785,8 +1795,8 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1785
1795
|
* you also want the viewport returned to its default framing.
|
|
1786
1796
|
*
|
|
1787
1797
|
* @example
|
|
1788
|
-
* import {
|
|
1789
|
-
*
|
|
1798
|
+
* import { integrateMetabox, Communicator, ResetConfiguration, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
1799
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1790
1800
|
*
|
|
1791
1801
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1792
1802
|
* api.addEventListener('configuratorDataUpdated', (data: ConfiguratorEnvelope) => {
|
|
@@ -1794,7 +1804,7 @@ export declare class ResetCamera extends CommandBase {
|
|
|
1794
1804
|
* });
|
|
1795
1805
|
*
|
|
1796
1806
|
* api.sendCommandToMetabox(new ResetConfiguration());
|
|
1797
|
-
* };
|
|
1807
|
+
* });
|
|
1798
1808
|
*/
|
|
1799
1809
|
export declare class ResetConfiguration extends CommandBase {
|
|
1800
1810
|
constructor();
|
|
@@ -1817,10 +1827,10 @@ export declare class ResetConfiguration extends CommandBase {
|
|
|
1817
1827
|
* Pattern: `api.sendCommandToMetabox(new ApplyZoom(50))`.
|
|
1818
1828
|
*
|
|
1819
1829
|
* @example
|
|
1820
|
-
* import { ApplyZoom, Communicator } from '@3dsource/metabox-front-api';
|
|
1821
|
-
*
|
|
1830
|
+
* import { integrateMetabox, ApplyZoom, Communicator } from '@3dsource/metabox-front-api';
|
|
1831
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1822
1832
|
* api.sendCommandToMetabox(new ApplyZoom(50));
|
|
1823
|
-
* };
|
|
1833
|
+
* });
|
|
1824
1834
|
*
|
|
1825
1835
|
* @param {number} zoom - The zoom value to apply.
|
|
1826
1836
|
*/
|
|
@@ -1848,15 +1858,15 @@ export declare class ApplyZoom extends CommandBase {
|
|
|
1848
1858
|
* Subscribe to showcaseStatusChanged to track playback state ('playing'/'paused'/'stopped').
|
|
1849
1859
|
*
|
|
1850
1860
|
* @example
|
|
1851
|
-
* import { Communicator,
|
|
1852
|
-
*
|
|
1861
|
+
* import { integrateMetabox, Communicator, InitShowcase, type ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1862
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1853
1863
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1854
1864
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
1855
1865
|
* console.log('Showcase status value after changed:', data);
|
|
1856
1866
|
* });
|
|
1857
1867
|
*
|
|
1858
1868
|
* api.sendCommandToMetabox(new InitShowcase());
|
|
1859
|
-
* };
|
|
1869
|
+
* });
|
|
1860
1870
|
*/
|
|
1861
1871
|
export declare class InitShowcase extends CommandBase {
|
|
1862
1872
|
constructor();
|
|
@@ -1880,15 +1890,15 @@ export declare class InitShowcase extends CommandBase {
|
|
|
1880
1890
|
* PlayShowcase.
|
|
1881
1891
|
*
|
|
1882
1892
|
* @example
|
|
1883
|
-
* import { Communicator,PlayShowcase } from '@3dsource/metabox-front-api';
|
|
1884
|
-
*
|
|
1893
|
+
* import { integrateMetabox, Communicator, PlayShowcase } from '@3dsource/metabox-front-api';
|
|
1894
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1885
1895
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1886
1896
|
* api.addEventListener('showcaseStatusChanged', (data) => {
|
|
1887
1897
|
* console.log('Showcase status value after changed:', data);
|
|
1888
1898
|
* });
|
|
1889
1899
|
*
|
|
1890
1900
|
* api.sendCommandToMetabox(new PlayShowcase());
|
|
1891
|
-
* };
|
|
1901
|
+
* });
|
|
1892
1902
|
*/
|
|
1893
1903
|
export declare class PlayShowcase extends CommandBase {
|
|
1894
1904
|
constructor();
|
|
@@ -1921,8 +1931,8 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
1921
1931
|
* to confirm 'pause' state. Use PlayShowcase to resume or StopShowcase to reset.
|
|
1922
1932
|
*
|
|
1923
1933
|
* @example
|
|
1924
|
-
* import { Communicator,
|
|
1925
|
-
*
|
|
1934
|
+
* import { integrateMetabox, Communicator, PauseShowcase, type ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1935
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1926
1936
|
*
|
|
1927
1937
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1928
1938
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -1930,7 +1940,7 @@ export declare class UnrealCommand extends CommandBase {
|
|
|
1930
1940
|
* });
|
|
1931
1941
|
*
|
|
1932
1942
|
* api.sendCommandToMetabox(new PauseShowcase());
|
|
1933
|
-
* };
|
|
1943
|
+
* });
|
|
1934
1944
|
*/
|
|
1935
1945
|
export declare class PauseShowcase extends CommandBase {
|
|
1936
1946
|
constructor();
|
|
@@ -1954,8 +1964,8 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
1954
1964
|
* interactive mode — re-enable configuration controls.
|
|
1955
1965
|
*
|
|
1956
1966
|
* @example
|
|
1957
|
-
* import { Communicator,ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1958
|
-
*
|
|
1967
|
+
* import { integrateMetabox, Communicator, StopShowcase, type ShowCaseStatus } from '@3dsource/metabox-front-api';
|
|
1968
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
1959
1969
|
*
|
|
1960
1970
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
1961
1971
|
* api.addEventListener('showcaseStatusChanged', (data:ShowCaseStatus) => {
|
|
@@ -1963,7 +1973,7 @@ export declare class PauseShowcase extends CommandBase {
|
|
|
1963
1973
|
* });
|
|
1964
1974
|
*
|
|
1965
1975
|
* api.sendCommandToMetabox(new StopShowcase());
|
|
1966
|
-
* };
|
|
1976
|
+
* });
|
|
1967
1977
|
*/
|
|
1968
1978
|
export declare class StopShowcase extends CommandBase {
|
|
1969
1979
|
constructor();
|
|
@@ -2006,18 +2016,20 @@ type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
|
|
|
2006
2016
|
* Use saveImage() helper to convert base64 to downloadable file.
|
|
2007
2017
|
*
|
|
2008
2018
|
* @example
|
|
2009
|
-
* import { Communicator,
|
|
2010
|
-
*
|
|
2019
|
+
* import { integrateMetabox, Communicator, GetScreenshot, saveImage } from '@3dsource/metabox-front-api';
|
|
2020
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2011
2021
|
*
|
|
2012
2022
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2013
|
-
* api.addEventListener('screenshotReady', (data:string) => {
|
|
2023
|
+
* api.addEventListener('screenshotReady', (data: string | null) => {
|
|
2014
2024
|
* // The data is a base64 string of the image. You can use it to display the image or save it as a file.
|
|
2015
2025
|
* console.log('Get screenshot here:', data);
|
|
2016
|
-
*
|
|
2026
|
+
* if (data) {
|
|
2027
|
+
* saveImage(data, 'Render.png');
|
|
2028
|
+
* }
|
|
2017
2029
|
* });
|
|
2018
2030
|
*
|
|
2019
2031
|
* api.sendCommandToMetabox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));
|
|
2020
|
-
* };
|
|
2032
|
+
* });
|
|
2021
2033
|
*
|
|
2022
2034
|
* @param {MimeType} mimeType - The output format.
|
|
2023
2035
|
* @param {{ x: number; y: number }} [size] - Optional size in pixels.
|
|
@@ -2049,8 +2061,8 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2049
2061
|
* re-apply them if needed.
|
|
2050
2062
|
*
|
|
2051
2063
|
* @example
|
|
2052
|
-
* import { Communicator,ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2053
|
-
*
|
|
2064
|
+
* import { integrateMetabox, Communicator, SetProduct, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2065
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2054
2066
|
*
|
|
2055
2067
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2056
2068
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2060,7 +2072,7 @@ export declare class GetScreenshot extends CommandBase {
|
|
|
2060
2072
|
* api.sendCommandToMetabox(new SetProduct(
|
|
2061
2073
|
* 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
|
|
2062
2074
|
* ));
|
|
2063
|
-
* };
|
|
2075
|
+
* });
|
|
2064
2076
|
*
|
|
2065
2077
|
* @param {string} productId - The product ID.
|
|
2066
2078
|
*/
|
|
@@ -2086,8 +2098,8 @@ export declare class SetProduct extends CommandBase {
|
|
|
2086
2098
|
* `new SetProductMaterial('slot-name', 'material-uuid')`. The referenced product must already be set.
|
|
2087
2099
|
*
|
|
2088
2100
|
* @example
|
|
2089
|
-
* import { Communicator,
|
|
2090
|
-
*
|
|
2101
|
+
* import { integrateMetabox, Communicator, SetProductMaterial, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2102
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2091
2103
|
*
|
|
2092
2104
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2093
2105
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2098,7 +2110,7 @@ export declare class SetProduct extends CommandBase {
|
|
|
2098
2110
|
* 'carpaint',
|
|
2099
2111
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2100
2112
|
* ));
|
|
2101
|
-
* };
|
|
2113
|
+
* });
|
|
2102
2114
|
*
|
|
2103
2115
|
* @param {string} slotId - The slot ID.
|
|
2104
2116
|
* @param {string} materialId - The material ID.
|
|
@@ -2123,8 +2135,8 @@ export declare class SetProductMaterial extends CommandBase {
|
|
|
2123
2135
|
* its own material slots, thumbnails, and lighting properties.
|
|
2124
2136
|
*
|
|
2125
2137
|
* @example
|
|
2126
|
-
* import { Communicator,ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2127
|
-
*
|
|
2138
|
+
* import { integrateMetabox, Communicator, SetEnvironment, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2139
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2128
2140
|
*
|
|
2129
2141
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2130
2142
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2132,7 +2144,7 @@ export declare class SetProductMaterial extends CommandBase {
|
|
|
2132
2144
|
* });
|
|
2133
2145
|
*
|
|
2134
2146
|
* api.sendCommandToMetabox(new SetEnvironment('55555555-1234-1234-1234-01234567890'))
|
|
2135
|
-
* };
|
|
2147
|
+
* });
|
|
2136
2148
|
*
|
|
2137
2149
|
* @param {string} environmentId - The environment ID.
|
|
2138
2150
|
*/
|
|
@@ -2157,8 +2169,8 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2157
2169
|
* has configurable material slots.
|
|
2158
2170
|
*
|
|
2159
2171
|
* @example
|
|
2160
|
-
* import { Communicator,ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2161
|
-
*
|
|
2172
|
+
* import { integrateMetabox, Communicator, SetEnvironmentMaterial, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2173
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2162
2174
|
*
|
|
2163
2175
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2164
2176
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2169,7 +2181,7 @@ export declare class SetEnvironment extends CommandBase {
|
|
|
2169
2181
|
* 'carpaint',
|
|
2170
2182
|
* 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
|
|
2171
2183
|
* ));
|
|
2172
|
-
* };
|
|
2184
|
+
* });
|
|
2173
2185
|
*
|
|
2174
2186
|
* @param {string} slotId - The slot ID.
|
|
2175
2187
|
* @param {string} materialId - The material ID.
|
|
@@ -2215,8 +2227,8 @@ type MaterialCommand = SetProductMaterial | SetEnvironmentMaterial;
|
|
|
2215
2227
|
* `SetProductMaterial` on its own for a single swatch click.
|
|
2216
2228
|
*
|
|
2217
2229
|
* @example
|
|
2218
|
-
* import { Communicator,
|
|
2219
|
-
*
|
|
2230
|
+
* import { integrateMetabox, Communicator, SetEnvironmentMaterial, SetMaterials, SetProductMaterial, type ConfiguratorEnvelope } from '@3dsource/metabox-front-api';
|
|
2231
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2220
2232
|
*
|
|
2221
2233
|
* //Subscribe to the event before sending the command to ensure you capture the response
|
|
2222
2234
|
* api.addEventListener('configuratorDataUpdated', (data:ConfiguratorEnvelope) => {
|
|
@@ -2227,7 +2239,7 @@ type MaterialCommand = SetProductMaterial | SetEnvironmentMaterial;
|
|
|
2227
2239
|
* new SetProductMaterial('carpaint', 'dd829d6e-9200-47a7-8d5b-af5df89b7e91'),
|
|
2228
2240
|
* new SetEnvironmentMaterial('floor', '7c1f4b2a-58e3-4a19-9d6c-2b0f83e5a114'),
|
|
2229
2241
|
* ]));
|
|
2230
|
-
* };
|
|
2242
|
+
* });
|
|
2231
2243
|
*
|
|
2232
2244
|
* @param {MaterialCommand[]} commands - The material commands to apply, in order.
|
|
2233
2245
|
*/
|
|
@@ -2252,10 +2264,10 @@ export declare class SetMaterials extends CommandBase {
|
|
|
2252
2264
|
* Pattern for custom UI: `ShowEmbeddedMenu(false)` + `ShowOverlayInterface(false)`.
|
|
2253
2265
|
*
|
|
2254
2266
|
* @example
|
|
2255
|
-
* import {
|
|
2256
|
-
*
|
|
2267
|
+
* import { integrateMetabox, Communicator, ShowEmbeddedMenu } from '@3dsource/metabox-front-api';
|
|
2268
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2257
2269
|
* api.sendCommandToMetabox(new ShowEmbeddedMenu(true));
|
|
2258
|
-
* };
|
|
2270
|
+
* });
|
|
2259
2271
|
*
|
|
2260
2272
|
* @param {boolean} visible - A flag indicating whether the embedded menu should be visible.
|
|
2261
2273
|
*/
|
|
@@ -2280,10 +2292,10 @@ export declare class ShowEmbeddedMenu extends CommandBase {
|
|
|
2280
2292
|
* Pass true to restore if entering a mode that uses native controls.
|
|
2281
2293
|
*
|
|
2282
2294
|
* @example
|
|
2283
|
-
* import {
|
|
2284
|
-
*
|
|
2295
|
+
* import { integrateMetabox, Communicator, ShowOverlayInterface } from '@3dsource/metabox-front-api';
|
|
2296
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2285
2297
|
* api.sendCommandToMetabox(new ShowOverlayInterface(true));
|
|
2286
|
-
* };
|
|
2298
|
+
* });
|
|
2287
2299
|
*
|
|
2288
2300
|
* @param {boolean} visible - A flag indicating whether the Unreal overlay UI should be visible.
|
|
2289
2301
|
*/
|
|
@@ -2306,10 +2318,10 @@ export declare class ShowOverlayInterface extends CommandBase {
|
|
|
2306
2318
|
* Track visibility state in your app to keep toggle buttons in sync.
|
|
2307
2319
|
*
|
|
2308
2320
|
* @example
|
|
2309
|
-
* import {
|
|
2310
|
-
*
|
|
2321
|
+
* import { integrateMetabox, Communicator, ShowMeasurement } from '@3dsource/metabox-front-api';
|
|
2322
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2311
2323
|
* api.sendCommandToMetabox(new ShowMeasurement());
|
|
2312
|
-
* };
|
|
2324
|
+
* });
|
|
2313
2325
|
*/
|
|
2314
2326
|
export declare class ShowMeasurement extends CommandBase {
|
|
2315
2327
|
constructor();
|
|
@@ -2330,10 +2342,10 @@ export declare class ShowMeasurement extends CommandBase {
|
|
|
2330
2342
|
* Track visibility state in your app state to keep toggle buttons in sync.
|
|
2331
2343
|
*
|
|
2332
2344
|
* @example
|
|
2333
|
-
* import {
|
|
2334
|
-
*
|
|
2345
|
+
* import { integrateMetabox, Communicator, HideMeasurement } from '@3dsource/metabox-front-api';
|
|
2346
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2335
2347
|
* api.sendCommandToMetabox(new HideMeasurement());
|
|
2336
|
-
* };
|
|
2348
|
+
* });
|
|
2337
2349
|
*/
|
|
2338
2350
|
export declare class HideMeasurement extends CommandBase {
|
|
2339
2351
|
constructor();
|
|
@@ -2354,10 +2366,10 @@ export declare class HideMeasurement extends CommandBase {
|
|
|
2354
2366
|
* does not reinitialize the configurator or reset product/environment state.
|
|
2355
2367
|
*
|
|
2356
2368
|
* @example
|
|
2357
|
-
* import {
|
|
2358
|
-
*
|
|
2369
|
+
* import { integrateMetabox, Communicator, ResumeStream } from '@3dsource/metabox-front-api';
|
|
2370
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2359
2371
|
* api.sendCommandToMetabox(new ResumeStream());
|
|
2360
|
-
* };
|
|
2372
|
+
* });
|
|
2361
2373
|
*/
|
|
2362
2374
|
export declare class ResumeStream extends CommandBase {
|
|
2363
2375
|
constructor();
|
|
@@ -2379,10 +2391,10 @@ export declare class ResumeStream extends CommandBase {
|
|
|
2379
2391
|
* does not reset product/environment state. Use `ResumeStream` to reconnect afterwards.
|
|
2380
2392
|
*
|
|
2381
2393
|
* @example
|
|
2382
|
-
* import {
|
|
2383
|
-
*
|
|
2394
|
+
* import { integrateMetabox, Communicator, StopStream } from '@3dsource/metabox-front-api';
|
|
2395
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2384
2396
|
* api.sendCommandToMetabox(new StopStream());
|
|
2385
|
-
* };
|
|
2397
|
+
* });
|
|
2386
2398
|
*/
|
|
2387
2399
|
export declare class StopStream extends CommandBase {
|
|
2388
2400
|
constructor();
|
|
@@ -2406,15 +2418,15 @@ export declare class StopStream extends CommandBase {
|
|
|
2406
2418
|
* `userInactivityDetected.countdownVisible` is `true`.
|
|
2407
2419
|
*
|
|
2408
2420
|
* @example
|
|
2409
|
-
* import {
|
|
2410
|
-
*
|
|
2421
|
+
* import { integrateMetabox, Communicator, ResetUserInactivityTimer } from '@3dsource/metabox-front-api';
|
|
2422
|
+
* integrateMetabox('configurator-id', 'embed3DSource', (api: Communicator) => {
|
|
2411
2423
|
* api.addEventListener('userInactivityDetected', ({ countdownVisible }) => {
|
|
2412
2424
|
* if (countdownVisible) {
|
|
2413
2425
|
* // show custom UI, then on user confirmation:
|
|
2414
2426
|
* api.sendCommandToMetabox(new ResetUserInactivityTimer());
|
|
2415
2427
|
* }
|
|
2416
2428
|
* });
|
|
2417
|
-
* };
|
|
2429
|
+
* });
|
|
2418
2430
|
*/
|
|
2419
2431
|
export declare class ResetUserInactivityTimer extends CommandBase {
|
|
2420
2432
|
constructor();
|