@3dsource/metabox-front-api 1.1.0 → 1.2.1-dev.0
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
CHANGED
|
@@ -17,7 +17,7 @@ import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImag
|
|
|
17
17
|
**OR** work with direct import from `NPM` using `CDN` network `unpkg.com` or `jsdelivr.net` (you can also download package and use it locally):
|
|
18
18
|
|
|
19
19
|
```javascript
|
|
20
|
-
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu, ShowOverlayInterface, SetEnvironmentMaterial, Communicator, ConfiguratorEnvelope } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@1.
|
|
20
|
+
import { FromMetaBoxApiAction, GetFastRender, GetPdf, integrateMetaBox, saveImage, SetEnvironment, SetMaterial, SetProduct, ShowEmbeddedMenu, ShowOverlayInterface, SetEnvironmentMaterial, Communicator, ConfiguratorEnvelope } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@1.2.0';
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
@@ -45,7 +45,7 @@ HTML:
|
|
|
45
45
|
|
|
46
46
|
```html
|
|
47
47
|
<script type="module">
|
|
48
|
-
import { integrateMetaBox, SetEnvironment, ShowOverlayInterface, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, Communicator, FromMetaboxApiAction } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@1.
|
|
48
|
+
import { integrateMetaBox, SetEnvironment, ShowOverlayInterface, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, GetFastRender, GetPdf, saveImage, Communicator, FromMetaboxApiAction } from 'https://cdn.jsdelivr.net/npm/@3dsource/metabox-front-api@1.2.0';
|
|
49
49
|
|
|
50
50
|
class JsIntegrator {
|
|
51
51
|
constructor() {
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
export type FromMetaboxApiAction = 'bridge' | 'appLoaded'
|
|
1
|
+
export type FromMetaboxApiAction = 'bridge' | 'appLoaded';
|
|
2
|
+
/**
|
|
3
|
+
* @hidden
|
|
4
|
+
* Preserved for backward compatibility.
|
|
5
|
+
* @deprecated Use FromMetaboxApiAction type instead.
|
|
6
|
+
*/
|
|
7
|
+
export type FromMetaboxDeprecatedApiAction =
|
|
2
8
|
/**
|
|
3
9
|
* @hidden
|
|
4
10
|
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "unrealFeature"
|
|
5
11
|
*/
|
|
6
|
-
|
|
12
|
+
'unrealFeatureBridge'
|
|
7
13
|
/**
|
|
8
14
|
* @hidden
|
|
9
15
|
* @deprecated, use MetaBoxApiAction.Bridge with eventType: "unrealCallback"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ConfiguratorEnvelope } from './UniversalConfigurator';
|
|
2
2
|
import type { StreamResolutionProps, UnrealCallBackJson, UnrealState } from '@3dsource/angular-unreal-module';
|
|
3
|
+
import type { FromMetaboxApiAction, FromMetaboxDeprecatedApiAction } from '../const/FromMetaboxApiAction';
|
|
3
4
|
export interface FromMetaboxMessagePayloads {
|
|
4
5
|
/**
|
|
5
6
|
* Dispatches Every time the configurator data is updated.
|
|
@@ -102,6 +103,17 @@ export interface MCAppLoaded {
|
|
|
102
103
|
eventType?: unknown;
|
|
103
104
|
payload?: unknown;
|
|
104
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* @hidden
|
|
108
|
+
* Preserved for backward compatibility.
|
|
109
|
+
* @deprecated
|
|
110
|
+
* Used for sending deprecated messages, must be removed in the future.
|
|
111
|
+
*/
|
|
112
|
+
export interface DeprecatedEnvelope {
|
|
113
|
+
action: FromMetaboxDeprecatedApiAction | FromMetaboxApiAction;
|
|
114
|
+
eventType?: unknown;
|
|
115
|
+
payload?: unknown;
|
|
116
|
+
}
|
|
105
117
|
/**
|
|
106
118
|
* @internal
|
|
107
119
|
* @hidden
|
|
@@ -109,8 +121,14 @@ export interface MCAppLoaded {
|
|
|
109
121
|
*/
|
|
110
122
|
export type FromMetaBoxAPIEnvelope = {
|
|
111
123
|
[K in keyof FromMetaboxMessagePayloads]: MetaBoxApiEnvelope<K>;
|
|
112
|
-
}[keyof FromMetaboxMessagePayloads] | MCAppLoaded;
|
|
124
|
+
}[keyof FromMetaboxMessagePayloads] | MCAppLoaded | DeprecatedEnvelope;
|
|
113
125
|
export interface FromMetaBoxMessage {
|
|
114
126
|
host: 'metabox';
|
|
115
|
-
|
|
127
|
+
/**
|
|
128
|
+
* @hidden
|
|
129
|
+
* Preserved for backward compatibility.
|
|
130
|
+
* @deprecated, use `envelope` instead.
|
|
131
|
+
*/
|
|
132
|
+
payload?: FromMetaBoxAPIEnvelope;
|
|
133
|
+
envelope: FromMetaBoxAPIEnvelope;
|
|
116
134
|
}
|
|
@@ -43,13 +43,11 @@ export interface ToMetaboxMessagePayloads {
|
|
|
43
43
|
};
|
|
44
44
|
watchCallbacks: void;
|
|
45
45
|
setMaterialById: {
|
|
46
|
-
productId: string;
|
|
47
46
|
slotId: string;
|
|
48
47
|
materialId: string;
|
|
49
48
|
};
|
|
50
49
|
sendCommandToUnreal: MetaBoxCommandPacket;
|
|
51
50
|
setEnvironmentMaterialById: {
|
|
52
|
-
productId: string;
|
|
53
51
|
slotId: string;
|
|
54
52
|
materialId: string;
|
|
55
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@3dsource/metabox-front-api",
|
|
3
|
-
"version": "1.1.0",
|
|
3
|
+
"version": "1.2.1-dev.0",
|
|
4
4
|
"description": "API for MetaBox BASIC configurator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"metabox",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"url": "git@bitbucket.org:dreamsoft/ams_vps-frontend.git"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
|
-
"author": "Sergii Karanda @
|
|
15
|
+
"author": "Sergii Karanda @3dsource.com",
|
|
16
16
|
"type": "module",
|
|
17
17
|
"exports": {
|
|
18
18
|
".": {
|
|
@@ -34,9 +34,6 @@
|
|
|
34
34
|
"build": "rollup -c",
|
|
35
35
|
"bump:dev": "npm version prerelease --preid=dev && npm run publish:dev",
|
|
36
36
|
"bump:minor": "npm version minor && npm run publish:prod",
|
|
37
|
-
"bump:preminor:beta": "npm version preminor --preid=beta && npm run publish:dev --tag beta",
|
|
38
|
-
"bump:preminor:dev": "npm version preminor --preid=dev && npm run publish:dev",
|
|
39
|
-
"bump:prepatch:beta": "npm version prepatch --preid=beta && npm run publish:dev --tag beta",
|
|
40
37
|
"bump:prod": "npm version patch && npm run publish:prod",
|
|
41
38
|
"clean": "rimraf dist",
|
|
42
39
|
"packAll": "npm run clean && npm run build && npm pack",
|
|
@@ -44,7 +41,7 @@
|
|
|
44
41
|
"publish:prod": "npm run packAll && npm publish --access public"
|
|
45
42
|
},
|
|
46
43
|
"peerDependencies": {
|
|
47
|
-
"@3dsource/angular-unreal-module": "
|
|
44
|
+
"@3dsource/angular-unreal-module": ">=0.0.29",
|
|
48
45
|
"rimraf": ">=6.0.0",
|
|
49
46
|
"rollup": ">=4.0.0",
|
|
50
47
|
"rollup-plugin-typescript2": ">=0.36.0",
|