@netless/appliance-plugin 1.1.38-beta.0 → 1.1.38-beta.2
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/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/assets/fullWorker-oCSw6O3g.js +593 -0
- package/dist/assets/subWorker-BifINabz.js +593 -0
- package/dist/{bridge-Dy4qAJh2.js → bridge-9xpV4vrR.js} +1 -1
- package/dist/{bridge-DwZ1Wbur.mjs → bridge-DriJmXUc.mjs} +5 -5
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/component/textEditor/manager.d.ts +11 -0
- package/dist/core/enum.d.ts +5 -1
- package/dist/core/fontFace.d.ts +48 -0
- package/dist/core/mainEngine.d.ts +8 -11
- package/dist/core/types.d.ts +2 -0
- package/dist/core/utils/indexDB.d.ts +1 -1
- package/dist/core/worker/workerManager.d.ts +2 -0
- package/dist/fullWorker.js +103 -103
- package/dist/{index-_2fP_0Sl.mjs → index-BFJsqXw9.mjs} +1201 -1193
- package/dist/{index-C2MVZqzb.mjs → index-BZEnjbEL.mjs} +7468 -6798
- package/dist/{index-WaXfuCxD.js → index-CKKDVGyO.js} +1 -1
- package/dist/index-CMbFdnXT.js +1 -0
- package/dist/{index-DTbzQbDD.js → index-CR_bcDnN.js} +1 -1
- package/dist/{index-BhVU2Mya.mjs → index-CnJJTu0m.mjs} +7671 -7001
- package/dist/{index-CElZ0WHE.mjs → index-DJnJIbsl.mjs} +1201 -1193
- package/dist/{index-I3Kp1ALi.js → index-DKaW8Kfx.js} +1 -1
- package/dist/{index-DZ-ZGSXh.js → index-DWyeGs6A.js} +1 -1
- package/dist/{index-RGIk2cUF.mjs → index-INqwKLxl.mjs} +1 -1
- package/dist/index-mmq0sYNo.js +1 -0
- package/dist/{index-S9-T6OvV.mjs → index-yvXpy4Qn.mjs} +1 -1
- package/dist/plugin/applianceMultiPlugin.d.ts +1 -1
- package/dist/plugin/applianceSinglePlugin.d.ts +1 -1
- package/dist/plugin/baseApplianceManager.d.ts +25 -1
- package/dist/plugin/baseViewContainerManager.d.ts +5 -1
- package/dist/plugin/displayerView.d.ts +2 -1
- package/dist/plugin/types.d.ts +31 -0
- package/dist/subWorker.js +103 -103
- package/package.json +1 -1
- package/dist/assets/fullWorker-B0Pt8Py_.js +0 -593
- package/dist/assets/subWorker-CleNZH9d.js +0 -593
- package/dist/index-BQ6rzeq9.js +0 -1
- package/dist/index-CsPVcYdq.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var B = Object.defineProperty;
|
|
2
2
|
var x = (o, e, t) => e in o ? B(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
|
|
3
3
|
var h = (o, e, t) => x(o, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import { E as I, a as d, b as L, c as y, d as N, g as b, V as C, S as A } from "./index-
|
|
4
|
+
import { E as I, a as d, b as L, c as y, d as N, g as b, V as C, S as A } from "./index-CnJJTu0m.mjs";
|
|
5
5
|
import { isEqual as T, isString as V, clone as D, throttle as H } from "lodash";
|
|
6
6
|
import "spritejs";
|
|
7
7
|
import "lz-string";
|
|
@@ -12,7 +12,7 @@ export declare class ApplianceMultiPlugin extends InvisiblePlugin<AppliancePlugi
|
|
|
12
12
|
static getInstance(remake: WindowManager, adaptor: ApplianceAdaptor): Promise<AppliancePluginInstance>;
|
|
13
13
|
static onCreate(plugin: InvisiblePlugin<AppliancePluginAttributes, any>): void;
|
|
14
14
|
static createApplianceMultiPlugin(d: Room, kind: string): Promise<ApplianceMultiPlugin>;
|
|
15
|
-
static createCurrentManager: (remake: WindowManager, options: RequiredAppliancePluginOptions, plugin: ApplianceMultiPlugin) => void;
|
|
15
|
+
static createCurrentManager: (remake: WindowManager, options: RequiredAppliancePluginOptions, plugin: ApplianceMultiPlugin, onInitLoadingChange?: ApplianceAdaptor["onInitLoadingChange"]) => void;
|
|
16
16
|
private get isReplay();
|
|
17
17
|
private get callbackName();
|
|
18
18
|
init(displayer: Displayer): void;
|
|
@@ -12,7 +12,7 @@ export declare class ApplianceSinglePlugin extends InvisiblePlugin<AppliancePlug
|
|
|
12
12
|
static getInstance(remake: Player | Room, adaptor: ApplianceAdaptor): Promise<AppliancePluginInstance>;
|
|
13
13
|
static onCreate(plugin: InvisiblePlugin<AppliancePluginAttributes, any>): void;
|
|
14
14
|
static createAppliancePlugin(d: Room, kind: string): Promise<ApplianceSinglePlugin>;
|
|
15
|
-
static createCurrentManager: (displayer: Displayer, options: RequiredAppliancePluginOptions, plugin?: ApplianceSinglePlugin) => void;
|
|
15
|
+
static createCurrentManager: (displayer: Displayer, options: RequiredAppliancePluginOptions, plugin?: ApplianceSinglePlugin, onInitLoadingChange?: ApplianceAdaptor["onInitLoadingChange"]) => void;
|
|
16
16
|
/**
|
|
17
17
|
* 房间实例化时,将当前实例对displayer外部API的添加内部处理逻辑;
|
|
18
18
|
* @param displayer
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import EventEmitter2 from "eventemitter2";
|
|
2
|
-
import { EStrokeType, MemberState, AppliancePluginLike } from "./types";
|
|
2
|
+
import { EStrokeType, MemberState, AppliancePluginLike, ApplianceInitLoadingChangeInfo, ApplianceFontFaceLoadState, ApplianceFontFaceRenderState, ApplianceRefreshRenderState } from "./types";
|
|
3
3
|
import { Collector, ViewId } from "../collector";
|
|
4
4
|
import { RoomMemberManager } from "../members";
|
|
5
5
|
import { TextEditorManager } from "../component/textEditor";
|
|
@@ -19,6 +19,7 @@ export interface BaseApplianceManagerProps {
|
|
|
19
19
|
displayer: Displayer<DisplayerCallbacks>;
|
|
20
20
|
plugin?: AppliancePluginLike;
|
|
21
21
|
options: RequiredAppliancePluginOptions;
|
|
22
|
+
onInitLoadingChange?: (info: ApplianceInitLoadingChangeInfo) => void;
|
|
22
23
|
}
|
|
23
24
|
/** 插件管理器 */
|
|
24
25
|
export declare abstract class BaseApplianceManager {
|
|
@@ -37,6 +38,8 @@ export declare abstract class BaseApplianceManager {
|
|
|
37
38
|
private _disableEraseText?;
|
|
38
39
|
private _disableCameraTransform?;
|
|
39
40
|
private _disableUseWorker?;
|
|
41
|
+
private initFontFaceTextRenderGate;
|
|
42
|
+
private initFontFaceTextRenderSkipped;
|
|
40
43
|
effectResolve?: (value: boolean) => void;
|
|
41
44
|
readonly hotkeyManager: HotkeyManager;
|
|
42
45
|
readonly pluginOptions: RequiredAppliancePluginOptions;
|
|
@@ -48,6 +51,7 @@ export declare abstract class BaseApplianceManager {
|
|
|
48
51
|
readonly renderControl: RenderCotrolImple;
|
|
49
52
|
readonly miniMapManager?: MiniMapManagerImpl;
|
|
50
53
|
readonly pluginManager?: PluginManager;
|
|
54
|
+
readonly onInitLoadingChange?: (info: ApplianceInitLoadingChangeInfo) => void;
|
|
51
55
|
/** WB-429: selector 公开 API / 事件实现入口 */
|
|
52
56
|
selectorApi?: SelectorApiManager;
|
|
53
57
|
/** WB-429: selector API 事件派发用,指向 BaseApplianceManager.PublicMsgEmitter */
|
|
@@ -56,6 +60,9 @@ export declare abstract class BaseApplianceManager {
|
|
|
56
60
|
get internalMsgEmitter(): EventEmitter2;
|
|
57
61
|
private _isPolyfill;
|
|
58
62
|
constructor(params: BaseApplianceManagerProps);
|
|
63
|
+
emitInitLoadingChange(info: ApplianceInitLoadingChangeInfo): void;
|
|
64
|
+
emitFontFaceLoadState(info: ApplianceFontFaceLoadState): void;
|
|
65
|
+
emitFontFaceRenderState(info: ApplianceFontFaceRenderState): void;
|
|
59
66
|
hasPolyfillMethod(methodName: "requestIdleCallback" | "cancelIdleCallback"): boolean;
|
|
60
67
|
registerPolyfillMethod(methodName: "requestIdleCallback" | "cancelIdleCallback"): void;
|
|
61
68
|
get hasExtendFontFaces(): boolean;
|
|
@@ -64,6 +71,23 @@ export declare abstract class BaseApplianceManager {
|
|
|
64
71
|
src: string;
|
|
65
72
|
}[];
|
|
66
73
|
get loadFontFacesTimeout(): number;
|
|
74
|
+
loadFontFaces(): Promise<ApplianceFontFaceLoadState>;
|
|
75
|
+
beginInitFontFaceTextRenderGate(): void;
|
|
76
|
+
markInitFontFaceTextRenderSkipped(): void;
|
|
77
|
+
shouldHoldServiceTextRenderForFontFace(): boolean;
|
|
78
|
+
hasInitFontFaceTextRenderSkipped(): boolean;
|
|
79
|
+
endInitFontFaceTextRenderGate(): void;
|
|
80
|
+
startInitFontFaceLoadAndRender(): void;
|
|
81
|
+
private waitNextFrame;
|
|
82
|
+
private getSortedRefreshViews;
|
|
83
|
+
private escapeCssIdentifier;
|
|
84
|
+
private getTextEditorElement;
|
|
85
|
+
private measureViewTextEditorsForRender;
|
|
86
|
+
private refreshViewTextRenderInternal;
|
|
87
|
+
refreshViewTextRender(viewId: string, emitState?: boolean): Promise<ApplianceRefreshRenderState>;
|
|
88
|
+
refreshTextRender(): Promise<ApplianceRefreshRenderState>;
|
|
89
|
+
refreshViewRender(viewId: string): Promise<ApplianceRefreshRenderState>;
|
|
90
|
+
refreshRender(): Promise<ApplianceRefreshRenderState>;
|
|
67
91
|
get disableEraseText(): boolean;
|
|
68
92
|
set disableEraseText(bol: boolean);
|
|
69
93
|
get disableEraseImage(): boolean;
|
|
@@ -86,7 +86,11 @@ export declare abstract class ViewContainerManager {
|
|
|
86
86
|
/** 是否显示浮动选框按钮 */
|
|
87
87
|
showFloatBarBtn(viewId: string, isShow: boolean): void;
|
|
88
88
|
/** 更新文字编辑器信息 */
|
|
89
|
-
updateTextEditorInfo(viewId: string, activeTextId?: string): void;
|
|
89
|
+
updateTextEditorInfo(viewId: string, activeTextId?: string, callback?: () => void): void;
|
|
90
|
+
/** 只触发文字编辑器层按当前 manager state 重新 render */
|
|
91
|
+
renderTextEditorInfo(viewId: string, activeTextId?: string, callback?: () => void): void;
|
|
92
|
+
renderTextEditorInfoAsync(viewId: string, activeTextId?: string): Promise<void>;
|
|
93
|
+
updateTextEditorInfoAsync(viewId: string, activeTextId?: string): Promise<void>;
|
|
90
94
|
setActiveMiniMap(viewId: string, show?: boolean): void;
|
|
91
95
|
}
|
|
92
96
|
export declare abstract class BaseViewDisplayerManager {
|
|
@@ -56,7 +56,8 @@ export declare class BaseViewDisplayer extends React.Component<BaseDisplayerProp
|
|
|
56
56
|
showFloatBar(show: boolean, value?: Partial<ShowFloatBarMsgValue>): void;
|
|
57
57
|
activeTextEditor(): void;
|
|
58
58
|
unActiveTextEditor(): void;
|
|
59
|
-
updateTextEditorInfo(activeTextId?: string): void;
|
|
59
|
+
updateTextEditorInfo(activeTextId?: string, callback?: () => void): void;
|
|
60
|
+
renderTextEditorInfo(activeTextId?: string, callback?: () => void): void;
|
|
60
61
|
setFloatBarData(data: Partial<ShowFloatBarMsgValue>): void;
|
|
61
62
|
private setAngle;
|
|
62
63
|
private setOperationType;
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -130,10 +130,27 @@ export interface BaseSubWorkModuleProps {
|
|
|
130
130
|
internalMsgEmitter: EventEmitter2;
|
|
131
131
|
publicMsgEmitter: EventEmitter2;
|
|
132
132
|
}
|
|
133
|
+
export type ApplianceInitLoadingPhase = "plugin" | "worker" | "scene" | "ready";
|
|
134
|
+
export type ApplianceInitLoadingStatus = "start" | "success" | "timeout" | "error";
|
|
135
|
+
export type ApplianceInitLoadingChangeInfo = {
|
|
136
|
+
loading: boolean;
|
|
137
|
+
phase: ApplianceInitLoadingPhase;
|
|
138
|
+
status: ApplianceInitLoadingStatus;
|
|
139
|
+
};
|
|
140
|
+
export type ApplianceFontFaceLoadState = {
|
|
141
|
+
status: "start" | "success" | "timeout" | "error";
|
|
142
|
+
};
|
|
143
|
+
export type ApplianceFontFaceRenderState = {
|
|
144
|
+
status: "start" | "success" | "error";
|
|
145
|
+
};
|
|
146
|
+
export type ApplianceRefreshRenderState = {
|
|
147
|
+
status: "success" | "error";
|
|
148
|
+
};
|
|
133
149
|
export type ApplianceAdaptor = {
|
|
134
150
|
options: AppliancePluginOptions;
|
|
135
151
|
logger?: Logger;
|
|
136
152
|
cursorAdapter?: CursorAdapter;
|
|
153
|
+
onInitLoadingChange?: (info: ApplianceInitLoadingChangeInfo) => void;
|
|
137
154
|
};
|
|
138
155
|
export type canBindMethodType = keyof Omit<AppliancePluginInstance, "displayer" | "windowManager" | "disableDeviceInputs" | "disableEraseImage" | "disableCameraTransform" | "injectMethodToObject" | "callbacksOn" | "callbacksOnce" | "callbacksOff" | "_injectTargetObject" | "createMiniMap" | "destroyMiniMap" | "filterRenderByUid" | "cancelFilterRender" | "addListener" | "removeListener" | "usePlugin" | "stopDraw" | "setViewLocalScenePathChange" | "getElements" | "hasElements" | "blurText" | "insertMarkmap" | "updateMarkmap" | "insertBackgroundImage" | "getSelectedElements" | "updateSelectedElements" | "copySelectedElements" | "deleteSelectedElements" | "getFloatbarContainer" | "getViewOffsetToContainer">;
|
|
139
156
|
export interface AppliancePluginInstance {
|
|
@@ -293,6 +310,16 @@ export interface AppliancePluginInstance {
|
|
|
293
310
|
getElements(scenePath?: string, filter?: (toolsType: EToolsKey) => boolean): BaseCollectorReducerAction[];
|
|
294
311
|
/** 停止Draw事件 */
|
|
295
312
|
stopDraw(viewId: string): Promise<void>;
|
|
313
|
+
/** 加载自定义字体,不阻塞插件初始化 */
|
|
314
|
+
loadFontFaces(): Promise<ApplianceFontFaceLoadState>;
|
|
315
|
+
/** 刷新指定 view 的 canvas 与文字 DOM 渲染 */
|
|
316
|
+
refreshViewRender(viewId: string): Promise<ApplianceRefreshRenderState>;
|
|
317
|
+
/** 刷新所有 view 的 canvas 与文字 DOM 渲染,优先刷新 focused view */
|
|
318
|
+
refreshRender(): Promise<ApplianceRefreshRenderState>;
|
|
319
|
+
/** 仅刷新指定 view 的文字 DOM 渲染 */
|
|
320
|
+
refreshViewTextRender(viewId: string): Promise<ApplianceRefreshRenderState>;
|
|
321
|
+
/** 仅刷新所有 view 的文字 DOM 渲染,优先刷新 focused view */
|
|
322
|
+
refreshTextRender(): Promise<ApplianceRefreshRenderState>;
|
|
296
323
|
/** 设置白板本地场景路径变化 */
|
|
297
324
|
setViewLocalScenePathChange(viewId: string, scenePath: string): Promise<void>;
|
|
298
325
|
/** 插入markmap */
|
|
@@ -712,6 +739,10 @@ export type PublicListener = {
|
|
|
712
739
|
workState: (workState: EventWorkState, viewId: string) => void;
|
|
713
740
|
/** 强制中断 */
|
|
714
741
|
forceStop: (reason: EForceStopReason, viewId: string) => void;
|
|
742
|
+
/** 自定义字体加载状态 */
|
|
743
|
+
fontFaceLoadState: (info: ApplianceFontFaceLoadState) => void;
|
|
744
|
+
/** 自定义字体加载后的文字重渲染状态 */
|
|
745
|
+
fontFaceRenderState: (info: ApplianceFontFaceRenderState) => void;
|
|
715
746
|
/** auto shape 调试信息 */
|
|
716
747
|
autoShape: (info: AutoShapeDebugInfo) => void;
|
|
717
748
|
/** 同步数据变化 */
|