@netless/appliance-plugin 1.1.39 → 1.1.40

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-dVlV22UP.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.AppliancePluginCursorNames=e.AppliancePluginCursorNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.Cursor_Hover_Id=e.Cursor_Hover_Id;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EForceStopReason=e.EForceStopReason;exports.EImageType=e.EImageType;exports.EMatrixrRelationType=e.EMatrixrRelationType;exports.EOperationType=e.EOperationType;exports.EPostMessageType=e.EPostMessageType;exports.ERenderFilterType=e.ERenderFilterType;exports.ESVGType=e.ESVGType;exports.EScaleType=e.EScaleType;exports.EStrokeType=e.EStrokeType;exports.EToolsKey=e.EToolsKey;exports.ElayerType=e.ElayerType;exports.EmitEventType=e.EmitEventType;exports.EventMessageType=e.EventMessageType;exports.EventWorkState=e.EventWorkState;exports.EvevtWorkState=e.EventWorkState;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.Main_View_Id=e.Main_View_Id;exports.Plugin=e.Plugin;exports.ShapeType=e.ShapeType;exports.Task_Time_Interval=e.Task_Time_Interval;exports.WorkerCanvasContextBlacklistLevel=e.WorkerCanvasContextBlacklistLevel;exports.WorkerImageBitmapFeatureBlacklistLevel=e.WorkerImageBitmapFeatureBlacklistLevel;exports.WorkerMaskTextureFormatBlacklistLevel=e.WorkerMaskTextureFormatBlacklistLevel;exports.WorkerMaskTextureUploadBlacklistLevel=e.WorkerMaskTextureUploadBlacklistLevel;exports.WorkerRenderModeBlacklistLevel=e.WorkerRenderModeBlacklistLevel;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DoIyQYzA.js");exports.ActiveContainerType=e.ActiveContainerType;exports.ApplianceMultiPlugin=e.ApplianceMultiPlugin;exports.ApplianceNames=e.ApplianceNames;exports.AppliancePluginCursorNames=e.AppliancePluginCursorNames;exports.ApplianceSigleWrapper=e.ApplianceSigleWrapper;exports.ApplianceSinglePlugin=e.ApplianceSinglePlugin;exports.Cursor_Hover_Id=e.Cursor_Hover_Id;exports.ECanvasShowType=e.ECanvasShowType;exports.EDataType=e.EDataType;exports.EForceStopReason=e.EForceStopReason;exports.EImageType=e.EImageType;exports.EMatrixrRelationType=e.EMatrixrRelationType;exports.EOperationType=e.EOperationType;exports.EPostMessageType=e.EPostMessageType;exports.ERenderFilterType=e.ERenderFilterType;exports.ESVGType=e.ESVGType;exports.EScaleType=e.EScaleType;exports.EStrokeType=e.EStrokeType;exports.EToolsKey=e.EToolsKey;exports.ElayerType=e.ElayerType;exports.EmitEventType=e.EmitEventType;exports.EventMessageType=e.EventMessageType;exports.EventWorkState=e.EventWorkState;exports.EvevtWorkState=e.EventWorkState;exports.InternalMsgEmitterType=e.InternalMsgEmitterType;exports.Main_View_Id=e.Main_View_Id;exports.Plugin=e.Plugin;exports.ShapeType=e.ShapeType;exports.Task_Time_Interval=e.Task_Time_Interval;exports.WorkerCanvasContextBlacklistLevel=e.WorkerCanvasContextBlacklistLevel;exports.WorkerImageBitmapFeatureBlacklistLevel=e.WorkerImageBitmapFeatureBlacklistLevel;exports.WorkerMaskTextureFormatBlacklistLevel=e.WorkerMaskTextureFormatBlacklistLevel;exports.WorkerMaskTextureUploadBlacklistLevel=e.WorkerMaskTextureUploadBlacklistLevel;exports.WorkerRenderModeBlacklistLevel=e.WorkerRenderModeBlacklistLevel;
@@ -1,4 +1,4 @@
1
- import { I as s, J as r, K as t, L as l, N as p, P as i, C as n, p as o, b as T, Q as E, w as y, z as k, R as v, a as c, U as g, d as u, W as m, X as S, c as M, Y as W, E as d, Z as C, e as I, e as _, _ as A, u as B, $ as L, a0 as P, T as x, a1 as R, a2 as F, a3 as w, a4 as N, a5 as h } from "./index-CYV4mPpp.mjs";
1
+ import { I as s, J as r, K as t, L as l, N as p, P as i, C as n, p as o, b as T, Q as E, w as y, z as k, R as v, a as c, U as g, d as u, W as m, X as S, c as M, Y as W, E as d, Z as C, e as I, e as _, _ as A, u as B, $ as L, a0 as P, T as x, a1 as R, a2 as F, a3 as w, a4 as N, a5 as h } from "./index-GpA_9BZu.mjs";
2
2
  export {
3
3
  s as ActiveContainerType,
4
4
  r as ApplianceMultiPlugin,
@@ -1 +1 @@
1
- "use strict";var l=Object.defineProperty;var o=(i,e,t)=>e in i?l(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>o(i,typeof e!="symbol"?e+"":e,t);let r;function c(i){r=i}function u(){if(!r)throw new Error("[@netless/appliance-plugin/bridge] white-web-sdk runtime has not been bound yet.");return r}class h{constructor(){n(this,"control");n(this,"_listeners",{})}_inject(e){this.control=e}_onEvent(e,t){this._listeners[e]&&this._listeners[e](...t)}callbacks(e,t){this._listeners[e]=t}removeCallback(e){delete this._listeners[e]}}class g{constructor(e){n(this,"control");n(this,"worker");n(this,"publicMsgEmitter");n(this,"plugins",new Map);const{control:t,publicMsgEmitter:s}=e;this.control=t,this.publicMsgEmitter=s,this.worker=t.worker}use(e){this.plugins.set(e.kind,e),e._inject(this.control),e.onCreate()}destroy(){this.plugins.forEach(e=>{this.plugins.delete(e.kind),e.onDestroy()})}dispatchPluginEvent(e,...t){this.plugins.forEach(s=>{s._onEvent(e,t)})}}async function a(i){return c(i),Promise.resolve().then(()=>require("./index-gq2ek7io.js")).then(e=>e.index)}exports.Plugin=h;exports.PluginManager=g;exports.getWhiteWebSdkBridgeRuntime=u;exports.loadAppliancePluginBridge=a;
1
+ "use strict";var l=Object.defineProperty;var o=(i,e,t)=>e in i?l(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var n=(i,e,t)=>o(i,typeof e!="symbol"?e+"":e,t);let r;function c(i){r=i}function u(){if(!r)throw new Error("[@netless/appliance-plugin/bridge] white-web-sdk runtime has not been bound yet.");return r}class h{constructor(){n(this,"control");n(this,"_listeners",{})}_inject(e){this.control=e}_onEvent(e,t){this._listeners[e]&&this._listeners[e](...t)}callbacks(e,t){this._listeners[e]=t}removeCallback(e){delete this._listeners[e]}}class g{constructor(e){n(this,"control");n(this,"worker");n(this,"publicMsgEmitter");n(this,"plugins",new Map);const{control:t,publicMsgEmitter:s}=e;this.control=t,this.publicMsgEmitter=s,this.worker=t.worker}use(e){this.plugins.set(e.kind,e),e._inject(this.control),e.onCreate()}destroy(){this.plugins.forEach(e=>{this.plugins.delete(e.kind),e.onDestroy()})}dispatchPluginEvent(e,...t){this.plugins.forEach(s=>{s._onEvent(e,t)})}}async function a(i){return c(i),Promise.resolve().then(()=>require("./index-RKd-OVPO.js")).then(e=>e.index)}exports.Plugin=h;exports.PluginManager=g;exports.getWhiteWebSdkBridgeRuntime=u;exports.loadAppliancePluginBridge=a;
@@ -54,7 +54,7 @@ class g {
54
54
  }
55
55
  }
56
56
  async function d(i) {
57
- return c(i), import("./index-cYVyBD7Q.mjs").then((t) => t.J);
57
+ return c(i), import("./index-rhSRO8Tb.mjs").then((t) => t.J);
58
58
  }
59
59
  export {
60
60
  g as P,
package/dist/bridge.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bridge-CHAFBa3k.js");exports.Plugin=e.Plugin;exports.loadAppliancePluginBridge=e.loadAppliancePluginBridge;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./bridge-DLEmhE7Y.js");exports.Plugin=e.Plugin;exports.loadAppliancePluginBridge=e.loadAppliancePluginBridge;
package/dist/bridge.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as i, l as e } from "./bridge-CYWXPQ84.mjs";
1
+ import { a as i, l as e } from "./bridge-b23MKtwT.mjs";
2
2
  export {
3
3
  i as Plugin,
4
4
  e as loadAppliancePluginBridge
@@ -1,6 +1,7 @@
1
1
  import { EToolsKey } from "../../core";
2
2
  import { ETextEditorType } from "./types";
3
3
  export declare function getTextEditorType(toolsKey: EToolsKey): ETextEditorType | undefined;
4
+ export declare function hasTextContent(value?: string): boolean;
4
5
  export declare function escapeCSS(id: string): string;
5
6
  export declare function ensureTextEditorCursorTarget(currentDiv: HTMLDivElement): Text | ChildNode;
6
7
  export declare function setTextEditorSelectionToEnd(sel: Selection, currentDiv: HTMLDivElement): void;
@@ -0,0 +1,8 @@
1
+ export type CurrentScenePathGetter = (viewId: string) => string | undefined;
2
+ export declare function isCurrentViewScene(viewId: string, scenePath: string | undefined, getCurrentScenePath: CurrentScenePathGetter): boolean;
3
+ export declare function shouldDispatchSceneTask(task: {
4
+ isService: boolean;
5
+ isAllViews: boolean;
6
+ viewId?: string;
7
+ scenePath?: string;
8
+ }, getCurrentScenePath: CurrentScenePathGetter): boolean;
@@ -62,6 +62,7 @@ export declare class MainThreadEngineImpl implements MainThreadEngine {
62
62
  private debounceUpdateCameraId?;
63
63
  private debounceUpdateCache;
64
64
  private mainThreadPostId?;
65
+ private destroyed;
65
66
  private combinePostMsg;
66
67
  private methodBuilder;
67
68
  private cacheImages;
@@ -0,0 +1,14 @@
1
+ type Destroyable = {
2
+ destroy(): void;
3
+ };
4
+ type Removable = {
5
+ parent?: unknown;
6
+ remove(): void;
7
+ };
8
+ export declare function destroyMainThreadResources({ subThreads, layers, scene, removeLayerTexture, }: {
9
+ subThreads: Destroyable[];
10
+ layers: Removable[];
11
+ scene: Pick<Removable, "remove">;
12
+ removeLayerTexture: (layer: Removable, parent: unknown) => void;
13
+ }): void;
14
+ export {};