@netless/window-manager 1.0.5 → 1.0.6-beta.1

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.mjs CHANGED
@@ -17946,11 +17946,40 @@ IframeBridge.hiddenClass = "netless-iframe-brdige-hidden";
17946
17946
  IframeBridge.emitter = new Emittery();
17947
17947
  IframeBridge.displayer = null;
17948
17948
  IframeBridge.alreadyCreate = false;
17949
+ class ExtendPlugin extends Emittery {
17950
+ _inject(context) {
17951
+ this.context = context;
17952
+ }
17953
+ }
17954
+ class ExtendPluginManager {
17955
+ constructor(props) {
17956
+ this.extends = /* @__PURE__ */ new Map();
17957
+ this.context = {
17958
+ manager: this,
17959
+ windowManager: props.windowManager,
17960
+ internalEmitter: props.internalEmitter
17961
+ };
17962
+ }
17963
+ hasRegister(kind2) {
17964
+ return appRegister.appClasses.has(kind2);
17965
+ }
17966
+ use(extend) {
17967
+ this.extends.set(extend.kind, extend);
17968
+ extend._inject(this.context);
17969
+ extend.onCreate();
17970
+ }
17971
+ destroy() {
17972
+ this.extends.forEach((extend) => {
17973
+ this.extends.delete(extend.kind);
17974
+ extend.onDestroy();
17975
+ });
17976
+ }
17977
+ }
17949
17978
  const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
17950
17979
  const _WindowManager = class extends InvisiblePlugin {
17951
17980
  constructor(context) {
17952
17981
  super(context);
17953
- this.version = "1.0.5";
17982
+ this.version = "1.0.6-beta.1";
17954
17983
  this.dependencies = { "dependencies": { "@juggle/resize-observer": "^3.3.1", "@netless/telebox-insider": "^0.2.32", "emittery": "^0.9.2", "lodash": "^4.17.21", "p-retry": "^4.6.1", "uuid": "^7.0.3", "video.js": ">=7" }, "peerDependencies": { "jspdf": "2.5.1", "white-web-sdk": "^2.16.52" }, "devDependencies": { "@hyrious/dts": "^0.2.2", "@netless/app-docs-viewer": "^0.2.19", "@netless/app-media-player": "0.1.4", "@rollup/plugin-commonjs": "^20.0.0", "@rollup/plugin-node-resolve": "^13.0.4", "@rollup/plugin-url": "^6.1.0", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.22", "@tsconfig/svelte": "^2.0.1", "@types/debug": "^4.1.7", "@types/lodash": "^4.14.182", "@types/lodash-es": "^4.17.4", "@types/uuid": "^8.3.1", "@typescript-eslint/eslint-plugin": "^4.30.0", "@typescript-eslint/parser": "^4.30.0", "@vitest/ui": "^0.14.1", "cypress": "^8.7.0", "dotenv": "^10.0.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-svelte3": "^3.2.0", "jsdom": "^19.0.0", "jspdf": "^2.5.1", "less": "^4.1.1", "prettier": "^2.3.2", "prettier-plugin-svelte": "^2.4.0", "rollup-plugin-analyzer": "^4.0.0", "rollup-plugin-styles": "^3.14.1", "side-effect-manager": "0.1.5", "svelte": "^3.42.4", "typescript": "^4.5.5", "vite": "^2.9.9", "vitest": "^0.14.1", "white-web-sdk": "^2.16.52" } };
17955
17984
  this.emitter = callbacks$1;
17956
17985
  this.viewMode = ViewMode.Broadcaster;
@@ -18016,6 +18045,10 @@ const _WindowManager = class extends InvisiblePlugin {
18016
18045
  manager.appManager.polling = params.polling || false;
18017
18046
  manager._pageState = new PageStateImpl(manager.appManager);
18018
18047
  manager.cursorManager = new CursorManager(manager.appManager, Boolean(cursor), params.cursorOptions, params.applianceIcons);
18048
+ manager.extendPluginManager = new ExtendPluginManager({
18049
+ internalEmitter,
18050
+ windowManager: manager
18051
+ });
18019
18052
  if (containerSizeRatio) {
18020
18053
  manager.containerSizeRatio = containerSizeRatio;
18021
18054
  }
@@ -18546,19 +18579,20 @@ const _WindowManager = class extends InvisiblePlugin {
18546
18579
  this._destroy();
18547
18580
  }
18548
18581
  _destroy() {
18549
- var _a, _b, _c, _d, _e;
18582
+ var _a, _b, _c, _d, _e, _f;
18550
18583
  (_a = this.containerResizeObserver) == null ? void 0 : _a.disconnect();
18551
18584
  (_b = this.appManager) == null ? void 0 : _b.destroy();
18552
18585
  (_c = this.cursorManager) == null ? void 0 : _c.destroy();
18586
+ (_d = this.extendPluginManager) == null ? void 0 : _d.destroy();
18553
18587
  _WindowManager.container = void 0;
18554
18588
  _WindowManager.wrapper = void 0;
18555
18589
  _WindowManager.sizer = void 0;
18556
18590
  _WindowManager.isCreated = false;
18557
18591
  if (_WindowManager.playground) {
18558
- (_d = _WindowManager.playground.parentNode) == null ? void 0 : _d.removeChild(_WindowManager.playground);
18592
+ (_e = _WindowManager.playground.parentNode) == null ? void 0 : _e.removeChild(_WindowManager.playground);
18559
18593
  }
18560
18594
  _WindowManager.params = void 0;
18561
- (_e = this._iframeBridge) == null ? void 0 : _e.destroy();
18595
+ (_f = this._iframeBridge) == null ? void 0 : _f.destroy();
18562
18596
  this._iframeBridge = void 0;
18563
18597
  log("Destroyed");
18564
18598
  }
@@ -18700,6 +18734,10 @@ const _WindowManager = class extends InvisiblePlugin {
18700
18734
  this._iframeBridge || (this._iframeBridge = new IframeBridge(this, this.appManager));
18701
18735
  return this._iframeBridge;
18702
18736
  }
18737
+ useExtendPlugin(extend) {
18738
+ var _a;
18739
+ (_a = this.extendPluginManager) == null ? void 0 : _a.use(extend);
18740
+ }
18703
18741
  };
18704
18742
  let WindowManager = _WindowManager;
18705
18743
  WindowManager.kind = "WindowManager";
@@ -18708,5 +18746,5 @@ WindowManager.containerSizeRatio = DEFAULT_CONTAINER_RATIO;
18708
18746
  WindowManager.isCreated = false;
18709
18747
  WindowManager._resolve = (_manager) => void 0;
18710
18748
  setupBuiltin();
18711
- export { AppCreateError, AppManagerNotInitError, AppNotRegisterError, BindContainerRoomPhaseInvalidError, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, DomEvents, IframeBridge, IframeEvents, InvalidScenePath, ParamsInvalidError, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, reconnectRefresher };
18749
+ export { AppCreateError, AppManagerNotInitError, AppNotRegisterError, BindContainerRoomPhaseInvalidError, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, DomEvents, ExtendPlugin, ExtendPluginManager, IframeBridge, IframeEvents, InvalidScenePath, ParamsInvalidError, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, reconnectRefresher };
18712
18750
  //# sourceMappingURL=index.mjs.map