@3dsource/metabox-front-api 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +169 -21
- package/dist/actions/ApiAction.d.ts +2 -1
- package/dist/actions/GetFastRender.d.ts +36 -5
- package/dist/actions/GetFastRender.js +38 -7
- package/dist/actions/GetPdf.d.ts +25 -1
- package/dist/actions/GetPdf.js +27 -3
- package/dist/actions/SetEnvironment.d.ts +17 -1
- package/dist/actions/SetEnvironment.js +19 -3
- package/dist/actions/SetMaterial.d.ts +32 -0
- package/dist/actions/SetMaterial.js +34 -2
- package/dist/actions/SetProduct.js +2 -2
- package/dist/actions/ShowEmbeddedMenu.js +2 -2
- package/dist/actions/WatchCallbacks.d.ts +16 -0
- package/dist/actions/WatchCallbacks.js +27 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.js +2 -1
- package/dist/interfaces/FromMetaboxMessagePayloads.d.ts +130 -0
- package/dist/{lib/MetaBoxApiAction.js → interfaces/FromMetaboxMessagePayloads.js} +1 -18
- package/dist/interfaces/ToMetaboxMessagePayloads.d.ts +53 -0
- package/dist/interfaces/ToMetaboxMessagePayloads.js +12 -0
- package/dist/interfaces/UniversalConfigurator.d.ts +101 -81
- package/dist/lib/initializeCommunicator.d.ts +13 -12
- package/dist/lib/initializeCommunicator.js +23 -21
- package/dist/lib/integrateMetaBox.d.ts +11 -0
- package/dist/lib/integrateMetaBox.js +13 -2
- package/package.json +3 -2
- package/dist/interfaces/metabox-message.interface.d.ts +0 -10
- package/dist/interfaces/metabox-message.interface.js +0 -6
- package/dist/lib/MetaBoxApiAction.d.ts +0 -92
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { FromMetaBoxAPIEnvelope, ToMetaBoxMessagePayload } from '@api/src';
|
|
2
|
-
|
|
3
|
-
export interface FromMetaBoxMessage {
|
|
4
|
-
host: 'metabox';
|
|
5
|
-
payload: FromMetaBoxAPIEnvelope;
|
|
6
|
-
}
|
|
7
|
-
export interface ToMetaBoxMessage {
|
|
8
|
-
host: 'metaBoxHost';
|
|
9
|
-
payload: ToMetaBoxMessagePayload;
|
|
10
|
-
}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { ExportedConfigurator } from '../interfaces/UniversalConfigurator';
|
|
2
|
-
export declare const FromMetaBoxApiAction: {
|
|
3
|
-
bridge: string;
|
|
4
|
-
unrealCallback: string;
|
|
5
|
-
unrealFeatureBridge: string;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
8
|
-
*/
|
|
9
|
-
configuratorDataWithStateBridge: string;
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
12
|
-
*/
|
|
13
|
-
configuratorDataBridge: string;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
16
|
-
*/
|
|
17
|
-
menuDataBridge: string;
|
|
18
|
-
/**
|
|
19
|
-
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
|
|
20
|
-
*/
|
|
21
|
-
flatMenuDataBridge: string;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated, use Bridge with isFullscreen
|
|
24
|
-
*/
|
|
25
|
-
fullScreenBridge: string;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated, use Bridge with streamResolution
|
|
28
|
-
*/
|
|
29
|
-
videoSize: string;
|
|
30
|
-
/**
|
|
31
|
-
* Used in platform, must be removed in future
|
|
32
|
-
*/
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated\
|
|
35
|
-
*/
|
|
36
|
-
unrealResponse: string;
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated\
|
|
39
|
-
*/
|
|
40
|
-
getFastRender: string;
|
|
41
|
-
appLoaded: string;
|
|
42
|
-
};
|
|
43
|
-
export declare const ToMetaBoxApiAction: {
|
|
44
|
-
readonly getPdf: "getPdf";
|
|
45
|
-
readonly loadLevel: "loadLevel";
|
|
46
|
-
readonly setProduct: "setProduct";
|
|
47
|
-
readonly addResponse: "addResponse";
|
|
48
|
-
readonly getFastRender: "getFastRender";
|
|
49
|
-
readonly watchCallbacks: "watchCallbacks";
|
|
50
|
-
readonly setExternalMode: "setExternalMode";
|
|
51
|
-
readonly setMaterialById: "setMaterialById";
|
|
52
|
-
readonly showEmbeddedMenu: "showEmbeddedMenu";
|
|
53
|
-
readonly forceSetDeviceType: "forceSetDeviceType";
|
|
54
|
-
};
|
|
55
|
-
export type ToMetaBoxApiTypeValue = (typeof ToMetaBoxApiAction)[keyof typeof ToMetaBoxApiAction];
|
|
56
|
-
export type FromMetaBoxApiTypeValue = (typeof FromMetaBoxApiAction)[keyof typeof FromMetaBoxApiAction];
|
|
57
|
-
export interface ToMetaBoxMessagePayload {
|
|
58
|
-
action: ToMetaBoxApiTypeValue;
|
|
59
|
-
payload?: Record<string, unknown> | never;
|
|
60
|
-
}
|
|
61
|
-
export interface MCAppLoaded {
|
|
62
|
-
action: string;
|
|
63
|
-
eventType?: unknown;
|
|
64
|
-
payload?: unknown;
|
|
65
|
-
}
|
|
66
|
-
export interface MetaBoxAPIPayloads {
|
|
67
|
-
basicConfiguratorDataWithState: ExportedConfigurator;
|
|
68
|
-
dataChannelConnected: boolean;
|
|
69
|
-
viewportReady: boolean;
|
|
70
|
-
isFullscreen: boolean;
|
|
71
|
-
statusMessage: string;
|
|
72
|
-
freezeFrame: {
|
|
73
|
-
dataUrl: string | null;
|
|
74
|
-
progress: number | null;
|
|
75
|
-
};
|
|
76
|
-
unrealCallback: object;
|
|
77
|
-
getFastRender: string | null;
|
|
78
|
-
unrealFeature: object;
|
|
79
|
-
streamResolution: {
|
|
80
|
-
width: number;
|
|
81
|
-
number: number;
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
export type FromMetaBoxApiKeys = keyof MetaBoxAPIPayloads;
|
|
85
|
-
export interface MetaBoxApiEnvelope<T extends FromMetaBoxApiKeys> {
|
|
86
|
-
action: 'bridge';
|
|
87
|
-
eventType: T;
|
|
88
|
-
payload: MetaBoxAPIPayloads[T];
|
|
89
|
-
}
|
|
90
|
-
export type FromMetaBoxAPIEnvelope = {
|
|
91
|
-
[K in keyof MetaBoxAPIPayloads]: MetaBoxApiEnvelope<K>;
|
|
92
|
-
}[keyof MetaBoxAPIPayloads] | MCAppLoaded;
|