@netless/window-manager 1.0.5 → 1.0.6-beta.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.mjs CHANGED
@@ -17946,11 +17946,37 @@ 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
+ use(extend) {
17964
+ this.extends.set(extend.kind, extend);
17965
+ extend._inject(this.context);
17966
+ extend.onCreate();
17967
+ }
17968
+ destroy() {
17969
+ this.extends.forEach((extend) => {
17970
+ this.extends.delete(extend.kind);
17971
+ extend.onDestroy();
17972
+ });
17973
+ }
17974
+ }
17949
17975
  const reconnectRefresher = new ReconnectRefresher({ emitter: internalEmitter });
17950
17976
  const _WindowManager = class extends InvisiblePlugin {
17951
17977
  constructor(context) {
17952
17978
  super(context);
17953
- this.version = "1.0.5";
17979
+ this.version = "1.0.6-beta.0";
17954
17980
  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
17981
  this.emitter = callbacks$1;
17956
17982
  this.viewMode = ViewMode.Broadcaster;
@@ -18016,6 +18042,10 @@ const _WindowManager = class extends InvisiblePlugin {
18016
18042
  manager.appManager.polling = params.polling || false;
18017
18043
  manager._pageState = new PageStateImpl(manager.appManager);
18018
18044
  manager.cursorManager = new CursorManager(manager.appManager, Boolean(cursor), params.cursorOptions, params.applianceIcons);
18045
+ manager.extendPluginManager = new ExtendPluginManager({
18046
+ internalEmitter,
18047
+ windowManager: manager
18048
+ });
18019
18049
  if (containerSizeRatio) {
18020
18050
  manager.containerSizeRatio = containerSizeRatio;
18021
18051
  }
@@ -18546,19 +18576,20 @@ const _WindowManager = class extends InvisiblePlugin {
18546
18576
  this._destroy();
18547
18577
  }
18548
18578
  _destroy() {
18549
- var _a, _b, _c, _d, _e;
18579
+ var _a, _b, _c, _d, _e, _f;
18550
18580
  (_a = this.containerResizeObserver) == null ? void 0 : _a.disconnect();
18551
18581
  (_b = this.appManager) == null ? void 0 : _b.destroy();
18552
18582
  (_c = this.cursorManager) == null ? void 0 : _c.destroy();
18583
+ (_d = this.extendPluginManager) == null ? void 0 : _d.destroy();
18553
18584
  _WindowManager.container = void 0;
18554
18585
  _WindowManager.wrapper = void 0;
18555
18586
  _WindowManager.sizer = void 0;
18556
18587
  _WindowManager.isCreated = false;
18557
18588
  if (_WindowManager.playground) {
18558
- (_d = _WindowManager.playground.parentNode) == null ? void 0 : _d.removeChild(_WindowManager.playground);
18589
+ (_e = _WindowManager.playground.parentNode) == null ? void 0 : _e.removeChild(_WindowManager.playground);
18559
18590
  }
18560
18591
  _WindowManager.params = void 0;
18561
- (_e = this._iframeBridge) == null ? void 0 : _e.destroy();
18592
+ (_f = this._iframeBridge) == null ? void 0 : _f.destroy();
18562
18593
  this._iframeBridge = void 0;
18563
18594
  log("Destroyed");
18564
18595
  }
@@ -18708,5 +18739,5 @@ WindowManager.containerSizeRatio = DEFAULT_CONTAINER_RATIO;
18708
18739
  WindowManager.isCreated = false;
18709
18740
  WindowManager._resolve = (_manager) => void 0;
18710
18741
  setupBuiltin();
18711
- export { AppCreateError, AppManagerNotInitError, AppNotRegisterError, BindContainerRoomPhaseInvalidError, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, DomEvents, IframeBridge, IframeEvents, InvalidScenePath, ParamsInvalidError, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, reconnectRefresher };
18742
+ export { AppCreateError, AppManagerNotInitError, AppNotRegisterError, BindContainerRoomPhaseInvalidError, BoxManagerNotFoundError, BoxNotCreatedError, BuiltinApps, DomEvents, ExtendPlugin, ExtendPluginManager, IframeBridge, IframeEvents, InvalidScenePath, ParamsInvalidError, WhiteWebSDKInvalidError, WindowManager, calculateNextIndex, reconnectRefresher };
18712
18743
  //# sourceMappingURL=index.mjs.map