@3dsource/metabox-front-api 0.0.19-beta.5 → 0.0.19-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/dist/index.d.ts CHANGED
@@ -12,9 +12,11 @@ export type { MimeType } from './actions/GetFastRender';
12
12
  export { CommandBase } from './actions/CommandBase';
13
13
  export * from './lib/integrateMetaBox';
14
14
  export * from './lib/Communicator';
15
+ export * from './lib/fromCommunicatorEvent';
15
16
  export * from './lib/saveImage';
16
17
  export * from './lib/sleep';
17
18
  export * from './lib/UrlUtils';
19
+ export type * from './interfaces/application-device-types';
18
20
  export type * from './interfaces/UniversalConfigurator';
19
21
  export type * from './interfaces/ToMetaboxMessagePayloads';
20
22
  export type * from './interfaces/FromMetaboxMessagePayloads';
package/dist/index.esm.js CHANGED
@@ -1,3 +1,5 @@
1
+ import { fromEvent } from 'rxjs';
2
+
1
3
  /**
2
4
  * Base class for commands sent to the MetaBox.
3
5
  */
@@ -419,7 +421,8 @@ class Communicator extends EventDispatcher {
419
421
  if (((_a = event === null || event === void 0 ? void 0 : event.data) === null || _a === void 0 ? void 0 : _a.host) !== 'metabox') {
420
422
  return;
421
423
  }
422
- this.dispatchEvent(messageType, event.data.payload);
424
+ const { eventType, payload } = event.data.payload;
425
+ this.dispatchEvent(eventType, payload);
423
426
  }
424
427
  /**
425
428
  * Initializes the communicator when the embedded content is ready.
@@ -509,6 +512,10 @@ function integrateMetaBox(iframeSrc, containerId = 'embed3DSource', apiReadyCall
509
512
  container.appendChild(iframe);
510
513
  }
511
514
 
515
+ function fromCommunicatorEvent(target, eventName) {
516
+ return fromEvent(target, eventName);
517
+ }
518
+
512
519
  /**
513
520
  * Saves an image by triggering a download.
514
521
  *
@@ -574,5 +581,5 @@ function getUrlParams() {
574
581
  return selections;
575
582
  }
576
583
 
577
- export { CommandBase, Communicator, GetFastRender, GetPdf, SendCommandToUnreal, SetEnvironment, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, ShowOverlayInterface, WatchCallbacks, getUrlParams, integrateMetaBox, saveImage, setUrlParams, sleep };
584
+ export { CommandBase, Communicator, GetFastRender, GetPdf, SendCommandToUnreal, SetEnvironment, SetEnvironmentMaterial, SetMaterial, SetProduct, ShowEmbeddedMenu, ShowOverlayInterface, WatchCallbacks, fromCommunicatorEvent, getUrlParams, integrateMetaBox, saveImage, setUrlParams, sleep };
578
585
  //# sourceMappingURL=index.esm.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["metabox-front-api"] = {}));
5
- })(this, (function (exports) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'rxjs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["metabox-front-api"] = {}, global.rxjs));
5
+ })(this, (function (exports, rxjs) { 'use strict';
6
6
 
7
7
  /**
8
8
  * Base class for commands sent to the MetaBox.
@@ -425,7 +425,8 @@
425
425
  if (((_a = event === null || event === void 0 ? void 0 : event.data) === null || _a === void 0 ? void 0 : _a.host) !== 'metabox') {
426
426
  return;
427
427
  }
428
- this.dispatchEvent(messageType, event.data.payload);
428
+ const { eventType, payload } = event.data.payload;
429
+ this.dispatchEvent(eventType, payload);
429
430
  }
430
431
  /**
431
432
  * Initializes the communicator when the embedded content is ready.
@@ -515,6 +516,10 @@
515
516
  container.appendChild(iframe);
516
517
  }
517
518
 
519
+ function fromCommunicatorEvent(target, eventName) {
520
+ return rxjs.fromEvent(target, eventName);
521
+ }
522
+
518
523
  /**
519
524
  * Saves an image by triggering a download.
520
525
  *
@@ -592,6 +597,7 @@
592
597
  exports.ShowEmbeddedMenu = ShowEmbeddedMenu;
593
598
  exports.ShowOverlayInterface = ShowOverlayInterface;
594
599
  exports.WatchCallbacks = WatchCallbacks;
600
+ exports.fromCommunicatorEvent = fromCommunicatorEvent;
595
601
  exports.getUrlParams = getUrlParams;
596
602
  exports.integrateMetaBox = integrateMetaBox;
597
603
  exports.saveImage = saveImage;
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ import type { Communicator } from './Communicator';
2
+ import type { FromMetaBoxApiEvents, FromMetaboxMessagePayloads } from '../interfaces/FromMetaboxMessagePayloads';
3
+ import type { Observable } from 'rxjs';
4
+ export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
@@ -1,4 +1 @@
1
- import { Communicator } from '../Communicator';
2
- import { FromMetaBoxApiEvents, FromMetaboxMessagePayloads } from '../../interfaces/FromMetaboxMessagePayloads';
3
- import { Observable } from 'rxjs';
4
- export declare function fromCommunicatorEvent<T extends FromMetaBoxApiEvents>(target: Communicator, eventName: T): Observable<FromMetaboxMessagePayloads[T]>;
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@3dsource/metabox-front-api",
3
- "version": "0.0.19-beta.5",
3
+ "version": "0.0.19-dev.0",
4
4
  "description": "API for MetaBox BASIC configurator",
5
5
  "keywords": [
6
6
  "metabox",
@@ -35,9 +35,9 @@
35
35
  "clean": "rimraf dist",
36
36
  "packAll": "npm run clean && npm run build && npm pack",
37
37
  "publish:prod": "npm run packAll && npm publish --access public",
38
- "publish:dev": "npm run packAll && npm publish --access public --tag beta",
38
+ "publish:dev": "npm run packAll && npm publish --access public --tag dev",
39
39
  "bump:prod": "npm version patch && npm run publish:prod",
40
- "bump:dev": "npm version prerelease --preid=beta && npm run publish:dev"
40
+ "bump:dev": "npm version prerelease --preid=dev && npm run publish:dev"
41
41
  },
42
42
  "peerDependencies": {
43
43
  "@3dsource/angular-unreal-module": "^0.0.29",