@3dsource/metabox-front-api 1.2.1-dev.0 → 1.2.1-dev.3

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.
Files changed (36) hide show
  1. package/LICENSE +14 -0
  2. package/README.md +218 -216
  3. package/{dist/index.esm.js → fesm2022/3dsource-metabox-front-api.mjs} +47 -46
  4. package/fesm2022/3dsource-metabox-front-api.mjs.map +1 -0
  5. package/index.d.ts +860 -0
  6. package/package.json +39 -53
  7. package/dist/actions/CommandBase.d.ts +0 -7
  8. package/dist/actions/GetFastRender.d.ts +0 -2
  9. package/dist/actions/GetPdf.d.ts +0 -24
  10. package/dist/actions/GetScreenshot.d.ts +0 -34
  11. package/dist/actions/SetEnvironment.d.ts +0 -21
  12. package/dist/actions/SetEnvironmentMaterial.d.ts +0 -24
  13. package/dist/actions/SetMaterial.d.ts +0 -24
  14. package/dist/actions/SetProduct.d.ts +0 -25
  15. package/dist/actions/ShowEmbeddedMenu.d.ts +0 -20
  16. package/dist/actions/ShowOverlayInterface.d.ts +0 -23
  17. package/dist/actions/UnrealCommand.d.ts +0 -14
  18. package/dist/actions/WatchCallbacks.d.ts +0 -18
  19. package/dist/const/FromMetaboxApiAction.d.ts +0 -58
  20. package/dist/index.d.ts +0 -23
  21. package/dist/index.esm.js.map +0 -1
  22. package/dist/index.umd.js +0 -604
  23. package/dist/index.umd.js.map +0 -1
  24. package/dist/interfaces/FromMetaboxMessagePayloads.d.ts +0 -134
  25. package/dist/interfaces/ToMetaboxMessagePayloads.d.ts +0 -72
  26. package/dist/interfaces/UniversalConfigurator.d.ts +0 -213
  27. package/dist/interfaces/application-device-types.d.ts +0 -1
  28. package/dist/lib/Communicator.d.ts +0 -57
  29. package/dist/lib/EventDispatcher.d.ts +0 -39
  30. package/dist/lib/UrlUtils.d.ts +0 -18
  31. package/dist/lib/fromCommunicatorEvent.d.ts +0 -9
  32. package/dist/lib/integrateMetaBox.d.ts +0 -31
  33. package/dist/lib/saveImage.d.ts +0 -11
  34. package/dist/lib/sleep.d.ts +0 -10
  35. package/dist/lib/test/Communicator.spec.d.ts +0 -1
  36. package/dist/lib/test/integrateMetabox.spec.d.ts +0 -9
package/package.json CHANGED
@@ -1,53 +1,39 @@
1
- {
2
- "name": "@3dsource/metabox-front-api",
3
- "version": "1.2.1-dev.0",
4
- "description": "API for MetaBox BASIC configurator",
5
- "keywords": [
6
- "metabox",
7
- "api",
8
- "configurator"
9
- ],
10
- "repository": {
11
- "type": "git",
12
- "url": "git@bitbucket.org:dreamsoft/ams_vps-frontend.git"
13
- },
14
- "license": "MIT",
15
- "author": "Sergii Karanda @3dsource.com",
16
- "type": "module",
17
- "exports": {
18
- ".": {
19
- "types": "./dist/index.d.ts",
20
- "require": "./dist/index.umd.js",
21
- "import": "./dist/index.esm.js"
22
- }
23
- },
24
- "main": "dist/index.umd.js",
25
- "jsdelivr": "dist/index.esm.js",
26
- "unpkg": "dist/index.esm.js",
27
- "module": "dist/index.esm.js",
28
- "types": "dist/index.d.ts",
29
- "files": [
30
- "dist/**/*"
31
- ],
32
- "scripts": {
33
- "apiDoc": "typedoc --entryPointStrategy Expand src/index.ts --tsconfig ./../../../tsconfig.typedoc.json --out ./../../../dist/browser/apiDocBasic",
34
- "build": "rollup -c",
35
- "bump:dev": "npm version prerelease --preid=dev && npm run publish:dev",
36
- "bump:minor": "npm version minor && npm run publish:prod",
37
- "bump:prod": "npm version patch && npm run publish:prod",
38
- "clean": "rimraf dist",
39
- "packAll": "npm run clean && npm run build && npm pack",
40
- "publish:dev": "npm run packAll && npm publish --access public --tag dev",
41
- "publish:prod": "npm run packAll && npm publish --access public"
42
- },
43
- "peerDependencies": {
44
- "@3dsource/angular-unreal-module": ">=0.0.29",
45
- "rimraf": ">=6.0.0",
46
- "rollup": ">=4.0.0",
47
- "rollup-plugin-typescript2": ">=0.36.0",
48
- "typescript": ">=5.0.0"
49
- },
50
- "publishConfig": {
51
- "access": "public"
52
- }
53
- }
1
+ {
2
+ "name": "@3dsource/metabox-front-api",
3
+ "version": "1.2.1-dev.3",
4
+ "description": "API for Metabox BASIC configurator",
5
+ "keywords": [
6
+ "metabox",
7
+ "api",
8
+ "configurator",
9
+ "basic"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git@bitbucket.org:dreamsoft/sourceui.git"
14
+ },
15
+ "license": "UNLICENSED",
16
+ "author": "3dsource",
17
+ "sideEffects": false,
18
+ "peerDependencies": {
19
+ "@3dsource/angular-unreal-module": ">=0.0.29"
20
+ },
21
+ "dependencies": {
22
+ "tslib": "^2.8.1"
23
+ },
24
+ "engines": {
25
+ "node": ">=20",
26
+ "npm": ">9"
27
+ },
28
+ "module": "fesm2022/3dsource-metabox-front-api.mjs",
29
+ "typings": "index.d.ts",
30
+ "exports": {
31
+ "./package.json": {
32
+ "default": "./package.json"
33
+ },
34
+ ".": {
35
+ "types": "./index.d.ts",
36
+ "default": "./fesm2022/3dsource-metabox-front-api.mjs"
37
+ }
38
+ }
39
+ }
@@ -1,7 +0,0 @@
1
- import type { ToMetaBoxMessageEnvelope } from '../interfaces/ToMetaboxMessagePayloads';
2
- /**
3
- * Base class for commands sent to the MetaBox.
4
- */
5
- export declare class CommandBase {
6
- data: ToMetaBoxMessageEnvelope;
7
- }
@@ -1,2 +0,0 @@
1
- import { GetScreenshot } from './GetScreenshot';
2
- export declare const GetFastRender: typeof GetScreenshot;
@@ -1,24 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Represents a command to get a PDF from Metabox.
4
- * @remarks
5
- * This class sends a message to the MetaBox API to generate a PDF based on the current configuration.
6
- * This action does not require any parameters.
7
- *
8
- * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
9
- *
10
- * @example
11
- * import { GetPdf,Communicator } from '@3dsource/metabox-front-api';
12
- * window.env3DSource.apiReady = (api:Communicator) => {
13
- * api.sendCommandToMetaBox(new GetPdf());
14
- * };
15
- */
16
- export declare class GetPdf extends CommandBase {
17
- /**
18
- * Creates an instance of GetPdf.
19
- *
20
- * @remarks
21
- * This constructor does not require any parameters.
22
- */
23
- constructor();
24
- }
@@ -1,34 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Image format.
4
- * @remarks
5
- * This type represents the allowed image formats.
6
- */
7
- export type MimeType = 'image/png' | 'image/jpeg' | 'image/webp';
8
- /**
9
- * Represents a command to get fast render.
10
- *
11
- * **Important**: Invoking this command will buffer it until the viewport is ready. Only then will the request be processed.
12
- *
13
- * @example
14
- * import { GetScreenshot,Communicator,saveImage } from '@3dsource/metabox-front-api';
15
- * window.env3DSource.apiReady = (api:Communicator) => {
16
- * // Listen for events from the MetaBox API
17
- * api.addEventListener('screenshot', (data) => {
18
- * // Process the fast render response
19
- * saveImage(data, 'Render.png');
20
- * });
21
- * api.sendCommandToMetaBox(new GetScreenshot('image/png', { x: 1024, y: 1024 }));
22
- * };
23
- */
24
- export declare class GetScreenshot extends CommandBase {
25
- /**
26
- * Constructs an instance of GetScreenshot.
27
- * @param mimeType - The output format.
28
- * @param size - Optional size in pixels.
29
- */
30
- constructor(mimeType: MimeType, size?: {
31
- x: number;
32
- y: number;
33
- });
34
- }
@@ -1,21 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Represents a command to set the environment by its ID.
4
- *
5
- * @example
6
- * import { SetEnvironment,Communicator } from '@3dsource/metabox-front-api';
7
- *
8
- * //...Assume that the integration is already implemented
9
- * window.env3DSource.apiReady = (api:Communicator) => {
10
- * // Change the environment to '55555555-1234-1234-1234-01234567890'
11
- * api.sendCommandToMetaBox(new SetEnvironment('55555555-1234-1234-1234-01234567890'));
12
- * };
13
- */
14
- export declare class SetEnvironment extends CommandBase {
15
- /**
16
- * Creates an instance of SetEnvironment.
17
- *
18
- * @param environmentId - The environment ID.
19
- */
20
- constructor(environmentId: string);
21
- }
@@ -1,24 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Represents a command to set an environment material by its ID.
4
- *
5
- * @example
6
- * import { SetEnvironmentMaterial,Communicator } from '@3dsource/metabox-front-api';
7
- *
8
- * //...Assume that the integration is already implemented
9
- * window.env3DSource.apiReady = (api:Communicator) => {
10
- * api.sendCommandToMetaBox(new SetEnvironmentMaterial(
11
- * 'carpaint',
12
- * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
13
- * ));
14
- * };
15
- */
16
- export declare class SetEnvironmentMaterial extends CommandBase {
17
- /**
18
- * Creates an instance of SetEnvironmentMaterial.
19
- *
20
- * @param slotId - The slot ID.
21
- * @param materialId - The material ID.
22
- */
23
- constructor(slotId: string, materialId: string);
24
- }
@@ -1,24 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Represents a command to set a material by its ID.
4
- *
5
- * @example
6
- * import { SetMaterial,Communicator } from '@3dsource/metabox-front-api';
7
- *
8
- * //...Assume that the integration is already implemented
9
- * window.env3DSource.apiReady = (api:Communicator) => {
10
- * api.sendCommandToMetaBox(new SetMaterial(
11
- * 'carpaint',
12
- * 'dd829d6e-9200-47a7-8d5b-af5df89b7e91',
13
- * ));
14
- * };
15
- */
16
- export declare class SetMaterial extends CommandBase {
17
- /**
18
- * Creates an instance of SetMaterial.
19
- *
20
- * @param slotId - The slot ID.
21
- * @param materialId - The material ID.
22
- */
23
- constructor(slotId: string, materialId: string);
24
- }
@@ -1,25 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Represents a command to set a product by its ID.
4
- *
5
- * @remarks
6
- * This action sends a message to the MetaBox API to set a product using the provided product ID.
7
- *
8
- * @example
9
- * import { SetProduct,Communicator } from '@3dsource/metabox-front-api';
10
- *
11
- * //...Assume that the integration is already implemented
12
- * window.env3DSource.apiReady = (api:Communicator) => {
13
- * api.setCommandToMetaBox(new SetProduct(
14
- * 'ffea6b5c-3a8a-4f56-9417-e605acb5cca3'
15
- * ));
16
- * };
17
- */
18
- export declare class SetProduct extends CommandBase {
19
- /**
20
- * Creates an instance of SetProduct.
21
- *
22
- * @param productId - The product ID.
23
- */
24
- constructor(productId: string);
25
- }
@@ -1,20 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Represents a command to toggle the Embedded MetaBox Menu.
4
- *
5
- * @example
6
- * import { ShowEmbeddedMenu,Communicator } from '@3dsource/metabox-front-api';
7
- *
8
- * //...Assume that the integration is already implemented
9
- * window.env3DSource.apiReady = (api:Communicator) => {
10
- * api.setCommandToMetaBox(new ShowEmbeddedMenu(true));
11
- * };
12
- */
13
- export declare class ShowEmbeddedMenu extends CommandBase {
14
- /**
15
- * Creates an instance of ShowEmbeddedMenu.
16
- *
17
- * @param visible - A flag indicating whether the embedded menu should be visible.
18
- */
19
- constructor(visible: boolean);
20
- }
@@ -1,23 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * Represents a command to toggle the Unreal Overlay Interface Menu.
4
- *
5
- * @remarks
6
- * This action sends a message to the MetaBox API to toggle the visibility of the Unreal overlay UI.
7
- *
8
- * @example
9
- * import { ShowOverlayInterface,Communicator } from '@3dsource/metabox-front-api';
10
- *
11
- * //...Assume that the integration is already implemented
12
- * window.env3DSource.apiReady = (api:Communicator) => {
13
- * api.setCommandToMetaBox(new ShowOverlayInterface(true));
14
- * };
15
- */
16
- export declare class ShowOverlayInterface extends CommandBase {
17
- /**
18
- * Creates an instance of ShowOverlayInterface.
19
- *
20
- * @param visible - A flag indicating whether the Unreal overlay UI should be visible.
21
- */
22
- constructor(visible: boolean);
23
- }
@@ -1,14 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- import type { MetaBoxCommandPacket } from '@3dsource/types-unreal';
3
- /**
4
- * @internal
5
- * @hidden
6
- * Represents a command to send Unreal command.
7
- */
8
- export declare class UnrealCommand extends CommandBase {
9
- constructor(payload: MetaBoxCommandPacket);
10
- }
11
- /**
12
- * @deprecated, use `UnrealCommand` instead.
13
- */
14
- export declare const SendCommandToUnreal: typeof UnrealCommand;
@@ -1,18 +0,0 @@
1
- import { CommandBase } from './CommandBase';
2
- /**
3
- * @experimental
4
- * @internal
5
- * @hidden
6
- * @remarks
7
- * Represents a command to watch Unreal callbacks from Unreal engine.
8
- * Can be useful for custom solutions.
9
- */
10
- export declare class WatchCallbacks extends CommandBase {
11
- /**
12
- * Creates an instance of WatchCallbacks.
13
- *
14
- * @remarks
15
- * This constructor does not require any parameters.
16
- */
17
- constructor();
18
- }
@@ -1,58 +0,0 @@
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 =
8
- /**
9
- * @hidden
10
- * @deprecated, use MetaBoxApiAction.Bridge with eventType: "unrealFeature"
11
- */
12
- 'unrealFeatureBridge'
13
- /**
14
- * @hidden
15
- * @deprecated, use MetaBoxApiAction.Bridge with eventType: "unrealCallback"
16
- */
17
- | 'unrealCallback'
18
- /**
19
- * @hidden
20
- * @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
21
- */
22
- | 'configuratorDataWithStateBridge'
23
- /**
24
- * @hidden
25
- * @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
26
- */
27
- | 'configuratorDataBridge'
28
- /**
29
- * @hidden
30
- * @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
31
- */
32
- | 'menuDataBridge'
33
- /**
34
- * @hidden
35
- * @deprecated, use MetaBoxApiAction.Bridge with eventType: "configuratorDataWithState"
36
- */
37
- | 'flatMenuDataBridge'
38
- /**
39
- * @hidden
40
- * @deprecated, use Bridge with isFullscreen
41
- */
42
- | 'fullScreenBridge'
43
- /**
44
- * @hidden
45
- * @deprecated, use Bridge with streamResolution
46
- */
47
- | 'videoSize'
48
- /**
49
- * @hidden
50
- * Used in a platform, must be removed in future
51
- * @deprecated
52
- */
53
- | 'unrealResponse'
54
- /**
55
- * @hidden
56
- * @deprecated\
57
- */
58
- | 'getFastRender';
package/dist/index.d.ts DELETED
@@ -1,23 +0,0 @@
1
- export { ShowOverlayInterface } from './actions/ShowOverlayInterface';
2
- export { ShowEmbeddedMenu } from './actions/ShowEmbeddedMenu';
3
- export { SetEnvironment } from './actions/SetEnvironment';
4
- export { SetProduct } from './actions/SetProduct';
5
- export { GetPdf } from './actions/GetPdf';
6
- export { SetMaterial } from './actions/SetMaterial';
7
- export { SetEnvironmentMaterial } from './actions/SetEnvironmentMaterial';
8
- export { GetScreenshot } from './actions/GetScreenshot';
9
- export { SendCommandToUnreal } from './actions/UnrealCommand';
10
- export { UnrealCommand } from './actions/UnrealCommand';
11
- export { WatchCallbacks } from './actions/WatchCallbacks';
12
- export { CommandBase } from './actions/CommandBase';
13
- export type { MimeType } from './actions/GetScreenshot';
14
- export * from './lib/integrateMetaBox';
15
- export * from './lib/Communicator';
16
- export * from './lib/fromCommunicatorEvent';
17
- export * from './lib/saveImage';
18
- export * from './lib/sleep';
19
- export * from './lib/UrlUtils';
20
- export type * from './interfaces/application-device-types';
21
- export type * from './interfaces/UniversalConfigurator';
22
- export type * from './interfaces/ToMetaboxMessagePayloads';
23
- export type * from './interfaces/FromMetaboxMessagePayloads';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}