@netless/appliance-plugin 1.1.41 → 1.1.42-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/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +17 -16
- package/dist/{bridge-BxkfdTkq.js → bridge-DSExBXc6.js} +1 -1
- package/dist/{bridge-BNKS_R2l.mjs → bridge-DUsq9J63.mjs} +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/component/textEditor/types.d.ts +2 -0
- package/dist/core/initReadyBarrier.d.ts +1 -0
- package/dist/fullWorker.js +72 -72
- package/dist/{index-Doaj3rDL.mjs → index-B06VHpH3.mjs} +1 -1
- package/dist/index-BPe58bft.js +570 -0
- package/dist/{index-C4uTXXaR.js → index-BVJ7qyIu.js} +1 -1
- package/dist/{index-SwxjyKCD.js → index-BX9ljfwt.js} +1 -1
- package/dist/{index-BwKNcV3h.mjs → index-BtESOKG9.mjs} +1 -1
- package/dist/{index-z4Oul31S.mjs → index-CiseirWP.mjs} +1 -1
- package/dist/{index-BoGQFZPO.js → index-D1w-ps7R.js} +1 -1
- package/dist/{index-COQOIflN.mjs → index-DCBGoUS5.mjs} +12345 -12255
- package/dist/{index-WMF2MmW5.mjs → index-DEr1vsuv.mjs} +11730 -11645
- package/dist/{index-BpI4eSla.js → index-Dafk2rBe.js} +1 -1
- package/dist/{index-Bellzj9L.mjs → index-Diyr2Pk3.mjs} +1 -1
- package/dist/index-DmnzG1v1.js +570 -0
- package/dist/plugin/applianceMultiPlugin.d.ts +1 -1
- package/dist/plugin/applianceSinglePlugin.d.ts +1 -1
- package/dist/plugin/baseApplianceManager.d.ts +13 -3
- package/dist/plugin/renderingCompatibility.d.ts +2 -1
- package/dist/plugin/types.d.ts +12 -4
- package/dist/subWorker.js +61 -61
- package/package.json +2 -1
- package/dist/index-DjDB-MYx.js +0 -570
- package/dist/index-DrGUJkFH.js +0 -570
|
@@ -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,
|
|
15
|
+
static createCurrentManager: (remake: WindowManager, options: RequiredAppliancePluginOptions, plugin: ApplianceMultiPlugin, callbacks?: ApplianceAdaptor["callbacks"]) => 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,
|
|
15
|
+
static createCurrentManager: (displayer: Displayer, options: RequiredAppliancePluginOptions, plugin?: ApplianceSinglePlugin, callbacks?: ApplianceAdaptor["callbacks"]) => 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, ApplianceInitLoadingChangeInfo, ApplianceFontFaceLoadState, ApplianceFontFaceRenderState, ApplianceRefreshRenderState } from "./types";
|
|
2
|
+
import { EStrokeType, MemberState, AppliancePluginLike, ApplianceInitLoadingChangeInfo, ApplianceFontFaceLoadState, ApplianceFontFaceRenderState, ApplianceRefreshRenderState, CallbacksFun } from "./types";
|
|
3
3
|
import { Collector, ViewId } from "../collector";
|
|
4
4
|
import { RoomMemberManager } from "../members";
|
|
5
5
|
import { TextEditorManager } from "../component/textEditor";
|
|
@@ -23,7 +23,7 @@ export interface BaseApplianceManagerProps {
|
|
|
23
23
|
displayer: Displayer<DisplayerCallbacks>;
|
|
24
24
|
plugin?: AppliancePluginLike;
|
|
25
25
|
options: RequiredAppliancePluginOptions;
|
|
26
|
-
|
|
26
|
+
callbacks?: CallbacksFun;
|
|
27
27
|
}
|
|
28
28
|
/** 插件管理器 */
|
|
29
29
|
export declare abstract class BaseApplianceManager {
|
|
@@ -54,6 +54,7 @@ export declare abstract class BaseApplianceManager {
|
|
|
54
54
|
private _disableCameraTransform?;
|
|
55
55
|
private initFontFaceTextRenderGate;
|
|
56
56
|
private initFontFaceTextRenderSkipped;
|
|
57
|
+
private readonly mainViewMountedReady;
|
|
57
58
|
effectResolve?: (value: boolean) => void;
|
|
58
59
|
readonly hotkeyManager: HotkeyManager;
|
|
59
60
|
readonly pluginOptions: RequiredAppliancePluginOptions;
|
|
@@ -67,7 +68,7 @@ export declare abstract class BaseApplianceManager {
|
|
|
67
68
|
readonly renderControl: RenderCotrolImple;
|
|
68
69
|
readonly miniMapManager?: MiniMapManagerImpl;
|
|
69
70
|
readonly pluginManager?: PluginManager;
|
|
70
|
-
readonly
|
|
71
|
+
readonly callbacks?: CallbacksFun;
|
|
71
72
|
/** WB-429: selector 公开 API / 事件实现入口 */
|
|
72
73
|
selectorApi?: SelectorApiManager;
|
|
73
74
|
/** WB-429: selector API 事件派发用,指向 BaseApplianceManager.PublicMsgEmitter */
|
|
@@ -77,6 +78,15 @@ export declare abstract class BaseApplianceManager {
|
|
|
77
78
|
private _isPolyfill;
|
|
78
79
|
constructor(params: BaseApplianceManagerProps);
|
|
79
80
|
emitInitLoadingChange(info: ApplianceInitLoadingChangeInfo): void;
|
|
81
|
+
/**
|
|
82
|
+
* 主视图 displayer 真正创建完成(WindowManager.bindMainView 或
|
|
83
|
+
* ApplianceSigleWrapper 绑定 main view)后由 viewContainerManager 通知。
|
|
84
|
+
* 与 WindowManager 的延迟 bindContainer 模式对齐:getInstance 在
|
|
85
|
+
* 主视图尚未挂载时不再阻塞等待 render-init ack,等挂载后补齐。
|
|
86
|
+
*/
|
|
87
|
+
notifyMainViewMounted(): void;
|
|
88
|
+
isMainViewMounted(): boolean;
|
|
89
|
+
waitForMainViewMounted(timeoutMs?: number): Promise<"ready" | "cancelled" | "timeout">;
|
|
80
90
|
emitFontFaceLoadState(info: ApplianceFontFaceLoadState): void;
|
|
81
91
|
emitFontFaceRenderState(info: ApplianceFontFaceRenderState): void;
|
|
82
92
|
hasPolyfillMethod(methodName: "requestIdleCallback" | "cancelIdleCallback"): boolean;
|
|
@@ -32,12 +32,13 @@ export type RenderingCompatibilityDecision = {
|
|
|
32
32
|
effectiveImageBitmapFeatureLevel?: WorkerImageBitmapFeatureBlacklistLevel;
|
|
33
33
|
issues: string[];
|
|
34
34
|
};
|
|
35
|
-
type BlacklistKind = "renderMode" | "canvasContext" | "maskTextureFormat" | "maskTextureUpload" | "imageBitmapFeature";
|
|
35
|
+
type BlacklistKind = "renderMode" | "canvasContext" | "maskTextureFormat" | "maskTextureUpload" | "imageBitmapFeature" | "fontFaceFallback";
|
|
36
36
|
export declare function normalizeVersion(value: string): string | undefined;
|
|
37
37
|
export declare function compareVersions(left: string, right: string): number;
|
|
38
38
|
export declare function detectRenderingRuntime(userAgent?: string): RenderingRuntime | undefined;
|
|
39
39
|
export declare function resolveVersionBlacklistLevel(currentVersion: string, rules: VersionWorkerBlacklist | undefined, kind: BlacklistKind, issues?: string[]): number | undefined;
|
|
40
40
|
export declare function mergeWorkerBlacklists(builtin: WorkerBlacklistByRuntime | undefined, injected: WorkerBlacklistByRuntime | undefined, kind: BlacklistKind): WorkerBlacklistByRuntime;
|
|
41
|
+
export declare function isFontFaceFallbackBlacklisted(blacklist: WorkerBlacklistByRuntime | undefined, userAgent?: string): boolean;
|
|
41
42
|
export declare function detectRenderCapabilities(workerUrl?: boolean): RenderCapabilities;
|
|
42
43
|
export declare function resolveRenderingCompatibility(input: {
|
|
43
44
|
useWorker: "auto" | "mainThread";
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -159,11 +159,16 @@ export type ApplianceFontFaceRenderState = {
|
|
|
159
159
|
export type ApplianceRefreshRenderState = {
|
|
160
160
|
status: "success" | "error";
|
|
161
161
|
};
|
|
162
|
+
/** Runtime callbacks. These are deliberately outside options/extras so options remain JSON-serializable. */
|
|
163
|
+
export type CallbacksFun = {
|
|
164
|
+
onInitLoadingChange?: (info: ApplianceInitLoadingChangeInfo) => void;
|
|
165
|
+
onBackgroundImageLoadEvent?: (event: BackgroundImageLoadEvent) => void;
|
|
166
|
+
};
|
|
162
167
|
export type ApplianceAdaptor = {
|
|
163
168
|
options: AppliancePluginOptions;
|
|
164
169
|
logger?: Logger;
|
|
165
170
|
cursorAdapter?: CursorAdapter;
|
|
166
|
-
|
|
171
|
+
callbacks?: CallbacksFun;
|
|
167
172
|
};
|
|
168
173
|
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" | "hasBackgroundImage" | "blurText" | "insertMarkmap" | "updateMarkmap" | "insertBackgroundImage" | "getSelectedElements" | "updateSelectedElements" | "copySelectedElements" | "deleteSelectedElements" | "getFloatbarContainer" | "getViewOffsetToContainer">;
|
|
169
174
|
export interface AppliancePluginInstance {
|
|
@@ -421,6 +426,9 @@ export declare enum WorkerMaskTextureUploadBlacklistLevel {
|
|
|
421
426
|
export declare enum WorkerImageBitmapFeatureBlacklistLevel {
|
|
422
427
|
DirtyRect = 1
|
|
423
428
|
}
|
|
429
|
+
export declare enum FontFaceFallbackBlacklistLevel {
|
|
430
|
+
RefreshTextRender = 1
|
|
431
|
+
}
|
|
424
432
|
export type VersionWorkerBlacklist = Record<string, number>;
|
|
425
433
|
export type WorkerBlacklistByRuntime = {
|
|
426
434
|
androidWebView?: VersionWorkerBlacklist;
|
|
@@ -451,6 +459,8 @@ export type ExtrasOptions = {
|
|
|
451
459
|
workerMaskTextureUploadBlacklist?: WorkerBlacklistByRuntime;
|
|
452
460
|
/** API 可用但 ImageBitmap crop 行为异常的运行时版本 */
|
|
453
461
|
workerImageBitmapFeatureBlacklist?: WorkerBlacklistByRuntime;
|
|
462
|
+
/** 按运行时版本启用字体加载失败后的文本补绘兜底 */
|
|
463
|
+
fontFaceFallbackBlacklist?: WorkerBlacklistByRuntime;
|
|
454
464
|
/** 是否使用背景Svg功能, 默认值为 ``false`` */
|
|
455
465
|
useBackgroundThread?: boolean;
|
|
456
466
|
/** 同步数据配置项 */
|
|
@@ -485,8 +495,6 @@ export type ExtrasOptions = {
|
|
|
485
495
|
overwriteSelectorStyles?: SelectorStyleOverrides;
|
|
486
496
|
/** 可见背景图片的超时与重试策略。 */
|
|
487
497
|
backgroundImageLoadOptions?: BackgroundImageLoadOptions;
|
|
488
|
-
/** Bridge 等集成层使用的背景图片加载事件入口。 */
|
|
489
|
-
onBackgroundImageLoadEvent?: (event: BackgroundImageLoadEvent) => void;
|
|
490
498
|
};
|
|
491
499
|
export type SelectorStyleOverrides = {
|
|
492
500
|
/** `.appliance-plugin-highlight-box` 外框样式 */
|
|
@@ -565,6 +573,7 @@ export type RequiredExtrasOptions = {
|
|
|
565
573
|
workerMaskTextureFormatBlacklist: WorkerBlacklistByRuntime;
|
|
566
574
|
workerMaskTextureUploadBlacklist: WorkerBlacklistByRuntime;
|
|
567
575
|
workerImageBitmapFeatureBlacklist: WorkerBlacklistByRuntime;
|
|
576
|
+
fontFaceFallbackBlacklist: WorkerBlacklistByRuntime;
|
|
568
577
|
useBackgroundThread: Required<boolean>;
|
|
569
578
|
syncOpt: Required<SyncOpt>;
|
|
570
579
|
syncLogger: Required<SyncLoggerOpt>;
|
|
@@ -582,7 +591,6 @@ export type RequiredExtrasOptions = {
|
|
|
582
591
|
markmap: Required<MarkmapOpt>;
|
|
583
592
|
overwriteSelectorStyles: SelectorStyleOverrides;
|
|
584
593
|
backgroundImageLoadOptions: Required<BackgroundImageLoadOptions>;
|
|
585
|
-
onBackgroundImageLoadEvent?: (event: BackgroundImageLoadEvent) => void;
|
|
586
594
|
};
|
|
587
595
|
export type RequiredAppliancePluginOptions = {
|
|
588
596
|
cdn: CdnOpt;
|