@netless/appliance-plugin 1.1.39 → 1.1.41
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/README.md +31 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +1 -1
- package/dist/{bridge-CYWXPQ84.mjs → bridge-BNKS_R2l.mjs} +1 -1
- package/dist/{bridge-CHAFBa3k.js → bridge-BxkfdTkq.js} +1 -1
- package/dist/bridge.js +1 -1
- package/dist/bridge.mjs +1 -1
- package/dist/component/backgroundImageLoadCoordinator.d.ts +61 -0
- package/dist/component/svg/base.d.ts +2 -0
- package/dist/component/svg/svgElemt.d.ts +3 -1
- package/dist/component/svg/types.d.ts +2 -0
- package/dist/component/textEditor/utils.d.ts +1 -0
- package/dist/core/currentSceneGuard.d.ts +14 -0
- package/dist/core/initReadyBarrier.d.ts +8 -0
- package/dist/core/mainEngine.d.ts +4 -2
- package/dist/core/mainThread/base.d.ts +4 -3
- package/dist/core/mainThread/lifecycle.d.ts +14 -0
- package/dist/core/mainThread/snapshotThread.d.ts +3 -3
- package/dist/core/mainThread/subLocalThread.d.ts +1 -1
- package/dist/core/mainThread/subServiceThread.d.ts +1 -1
- package/dist/fullWorker.js +78 -78
- package/dist/{index-C7gY405v.mjs → index-Bellzj9L.mjs} +234 -210
- package/dist/{index-CcC63woo.js → index-BoGQFZPO.js} +1 -1
- package/dist/index-BpI4eSla.js +1 -0
- package/dist/{index-b8vebU--.mjs → index-BwKNcV3h.mjs} +95 -70
- package/dist/{index-BZgfPcL0.js → index-C4uTXXaR.js} +1 -1
- package/dist/{index-CYV4mPpp.mjs → index-COQOIflN.mjs} +13078 -12701
- package/dist/index-DjDB-MYx.js +570 -0
- package/dist/{index-CR1hkggk.mjs → index-Doaj3rDL.mjs} +95 -70
- package/dist/index-DrGUJkFH.js +570 -0
- package/dist/index-SwxjyKCD.js +1 -0
- package/dist/{index-cYVyBD7Q.mjs → index-WMF2MmW5.mjs} +10376 -9964
- package/dist/{index-C8KlJXk3.mjs → index-z4Oul31S.mjs} +221 -201
- package/dist/plugin/backgroundImageQuery.d.ts +4 -0
- package/dist/plugin/baseApplianceManager.d.ts +4 -0
- package/dist/plugin/sceneChangeProgress.d.ts +7 -0
- package/dist/plugin/types.d.ts +26 -1
- package/dist/subWorker.js +77 -77
- package/package.json +10 -5
- package/dist/index-BPWZCEwU.js +0 -1
- package/dist/index-YgdyZP_3.js +0 -1
- package/dist/index-dVlV22UP.js +0 -570
- package/dist/index-gq2ek7io.js +0 -570
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ISerializableStorageViewData } from "../collector/types";
|
|
2
|
+
import type { HasBackgroundImageParams } from "./types";
|
|
3
|
+
/** Returns whether the appliance provider contains the requested background. */
|
|
4
|
+
export declare function hasApplianceBackgroundImage(storage: ISerializableStorageViewData | undefined, params: HasBackgroundImageParams): boolean;
|
|
@@ -17,6 +17,8 @@ import { RenderCotrolImple } from "../core/renderCotrol";
|
|
|
17
17
|
import { MiniMapManagerImpl } from "../component/miniMap/manager";
|
|
18
18
|
import { PluginManager, Plugin } from "../core/plugin";
|
|
19
19
|
import { SelectorApiManager } from "./selectorApi";
|
|
20
|
+
import { BackgroundImageLoadCoordinator } from "../component/backgroundImageLoadCoordinator";
|
|
21
|
+
import type { ReloadBackgroundImageParams, ReloadBackgroundImageResult } from "../component/backgroundImageLoadCoordinator";
|
|
20
22
|
export interface BaseApplianceManagerProps {
|
|
21
23
|
displayer: Displayer<DisplayerCallbacks>;
|
|
22
24
|
plugin?: AppliancePluginLike;
|
|
@@ -25,6 +27,7 @@ export interface BaseApplianceManagerProps {
|
|
|
25
27
|
}
|
|
26
28
|
/** 插件管理器 */
|
|
27
29
|
export declare abstract class BaseApplianceManager {
|
|
30
|
+
readonly backgroundImageLoadCoordinator: BackgroundImageLoadCoordinator;
|
|
28
31
|
private toolChangePending;
|
|
29
32
|
private toolChangePendingTimer?;
|
|
30
33
|
private pendingSceneChecks;
|
|
@@ -198,6 +201,7 @@ export declare abstract class BaseApplianceManager {
|
|
|
198
201
|
destroyMiniMap(viewId: string): Promise<void>;
|
|
199
202
|
insertIconify(viewId: string, iconifyInfo: IconifyInformation): void;
|
|
200
203
|
insertBackgroundSVG(viewId: string, svgInfo: ISVGUrlInformation): void;
|
|
204
|
+
reloadBackgroundImage(params: ReloadBackgroundImageParams): ReloadBackgroundImageResult;
|
|
201
205
|
insertBackgroundMarkMap(viewId: string, svgInfo: ISVGMarkmapInformation): Promise<MarkmapId | undefined>;
|
|
202
206
|
updateBackgroundMarkMap(viewId: string, markmapId: string, svgInfo: ISVGMarkmapInformation): void;
|
|
203
207
|
usePlugin(plugin: Plugin): void | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function shouldContinueSceneChange({ previousScenePath, attemptedScenePath, getCurrentScenePath, getTargetScenePath, yieldToNextTask, }: {
|
|
2
|
+
previousScenePath: string;
|
|
3
|
+
attemptedScenePath: string;
|
|
4
|
+
getCurrentScenePath: () => string | undefined;
|
|
5
|
+
getTargetScenePath: () => string;
|
|
6
|
+
yieldToNextTask?: () => Promise<void>;
|
|
7
|
+
}): Promise<boolean>;
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -15,6 +15,19 @@ import type { TextEditorInfo, FontWeightType, FontStyleType, TextAlignType, Vert
|
|
|
15
15
|
import type { IMarkmapOptions } from "../component/svg/markmap-runtime";
|
|
16
16
|
import type { AutoShapeKind, AutoShapeMetrics } from "../core/autoShape/types";
|
|
17
17
|
import type { ShapeOptType } from "../displayer/types";
|
|
18
|
+
import type { BackgroundImageLoadEvent, BackgroundImageLoadOptions, BackgroundImageSource, ReloadBackgroundImageParams, ReloadBackgroundImageResult } from "../component/backgroundImageLoadCoordinator";
|
|
19
|
+
export type { BackgroundImageLoadEvent, BackgroundImageLoadOptions, BackgroundImageSource, ReloadBackgroundImageParams, ReloadBackgroundImageResult, };
|
|
20
|
+
export type BackgroundImageQuerySource = "appliance" | "whiteSdk";
|
|
21
|
+
export interface HasBackgroundImageParams {
|
|
22
|
+
/** Whiteboard view containing the scene. */
|
|
23
|
+
viewId: string;
|
|
24
|
+
/** Exact scene path to query. */
|
|
25
|
+
scenePath: string;
|
|
26
|
+
/** Exact background image URL to match. */
|
|
27
|
+
imageUrl: string;
|
|
28
|
+
/** Providers included in the aggregate query. */
|
|
29
|
+
sources: readonly BackgroundImageQuerySource[];
|
|
30
|
+
}
|
|
18
31
|
export type { Room, ImageInformation, Point, Size, Rectangle, RoomMember, RoomState, Player, HotKeys, Camera, Displayer, DisplayerCallbacks, CameraState, View, Cursor, CursorAdapter, RenderEngine, _MemberState, };
|
|
19
32
|
export declare enum ApplianceNames {
|
|
20
33
|
/**
|
|
@@ -152,7 +165,7 @@ export type ApplianceAdaptor = {
|
|
|
152
165
|
cursorAdapter?: CursorAdapter;
|
|
153
166
|
onInitLoadingChange?: (info: ApplianceInitLoadingChangeInfo) => void;
|
|
154
167
|
};
|
|
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">;
|
|
168
|
+
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">;
|
|
156
169
|
export interface AppliancePluginInstance {
|
|
157
170
|
readonly displayer: Displayer;
|
|
158
171
|
readonly currentManager?: ApplianceManagerLike;
|
|
@@ -308,6 +321,11 @@ export interface AppliancePluginInstance {
|
|
|
308
321
|
* @returns 所有元素
|
|
309
322
|
*/
|
|
310
323
|
getElements(scenePath?: string, filter?: (toolsType: EToolsKey) => boolean): BaseCollectorReducerAction[];
|
|
324
|
+
/**
|
|
325
|
+
* 判断指定 view 和场景中是否存在 URL 完全匹配的背景图。
|
|
326
|
+
* appliance 实现只在 sources 包含 `appliance` 时参与查询。
|
|
327
|
+
*/
|
|
328
|
+
hasBackgroundImage(params: HasBackgroundImageParams): boolean;
|
|
311
329
|
/** 停止Draw事件 */
|
|
312
330
|
stopDraw(viewId: string): Promise<void>;
|
|
313
331
|
/** 加载自定义字体,不阻塞插件初始化 */
|
|
@@ -328,6 +346,7 @@ export interface AppliancePluginInstance {
|
|
|
328
346
|
updateMarkmap(viewId: string, markmapId: MarkmapId, markdownInfo: ISVGMarkmapInformation): Promise<void>;
|
|
329
347
|
/** 插入背景图片 */
|
|
330
348
|
insertBackgroundImage(viewId: string, imageInfo: ISVGUrlInformation): void;
|
|
349
|
+
reloadBackgroundImage(params: ReloadBackgroundImageParams): Promise<ReloadBackgroundImageResult>;
|
|
331
350
|
/**
|
|
332
351
|
* 获取当前 selector 选中元素的快照。
|
|
333
352
|
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的 appID。省略时取当前 focuedView / mainView。
|
|
@@ -464,6 +483,10 @@ export type ExtrasOptions = {
|
|
|
464
483
|
markmap?: MarkmapOpt;
|
|
465
484
|
/** 覆盖 selector DOM 的内联样式 */
|
|
466
485
|
overwriteSelectorStyles?: SelectorStyleOverrides;
|
|
486
|
+
/** 可见背景图片的超时与重试策略。 */
|
|
487
|
+
backgroundImageLoadOptions?: BackgroundImageLoadOptions;
|
|
488
|
+
/** Bridge 等集成层使用的背景图片加载事件入口。 */
|
|
489
|
+
onBackgroundImageLoadEvent?: (event: BackgroundImageLoadEvent) => void;
|
|
467
490
|
};
|
|
468
491
|
export type SelectorStyleOverrides = {
|
|
469
492
|
/** `.appliance-plugin-highlight-box` 外框样式 */
|
|
@@ -558,6 +581,8 @@ export type RequiredExtrasOptions = {
|
|
|
558
581
|
undoRedo: Required<UndoRedoOpt>;
|
|
559
582
|
markmap: Required<MarkmapOpt>;
|
|
560
583
|
overwriteSelectorStyles: SelectorStyleOverrides;
|
|
584
|
+
backgroundImageLoadOptions: Required<BackgroundImageLoadOptions>;
|
|
585
|
+
onBackgroundImageLoadEvent?: (event: BackgroundImageLoadEvent) => void;
|
|
561
586
|
};
|
|
562
587
|
export type RequiredAppliancePluginOptions = {
|
|
563
588
|
cdn: CdnOpt;
|