@netless/appliance-plugin 1.1.6-beta.0 → 1.1.7-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/README.md +60 -6
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-l-yx2w.js +439 -0
- package/cdn/subWorker-B_WP6U.js +439 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +16 -14
- package/dist/component/miniMap/manager.d.ts +1 -0
- package/dist/core/enum.d.ts +7 -1
- package/dist/core/mainEngine.d.ts +15 -3
- package/dist/core/mainThread/base.d.ts +3 -0
- package/dist/core/mainThread/snapshotThread.d.ts +3 -0
- package/dist/core/plugin.d.ts +47 -0
- package/dist/core/tools/image.d.ts +5 -3
- package/dist/core/worker/base.d.ts +9 -3
- package/dist/core/worker/fullWorkerLocal.d.ts +2 -1
- package/dist/fullWorker.js +112 -112
- package/dist/index-9cZB1Gyu.js +1 -0
- package/dist/index-B1RiN3Qs.js +1 -0
- package/dist/{index-DK7rOQ8d.mjs → index-BhSfbo3W.mjs} +3750 -3616
- package/dist/{index-f9cCJCDG.mjs → index-C0f2hrD6.mjs} +591 -506
- package/dist/plugin/baseApplianceManager.d.ts +5 -1
- package/dist/plugin/types.d.ts +46 -1
- package/dist/subWorker.js +112 -112
- package/package.json +4 -4
- package/cdn/fullWorker-Bn23ql.js +0 -439
- package/cdn/subWorker-BHGGPo.js +0 -439
- package/dist/index--nNSULzs.js +0 -1
- package/dist/index-Jd0URiCw.js +0 -1
|
@@ -3,7 +3,7 @@ import { MemberState, AppliancePluginLike, AppliancePluginOptions } from "./type
|
|
|
3
3
|
import { Collector, ViewId } from "../collector";
|
|
4
4
|
import { RoomMemberManager } from "../members";
|
|
5
5
|
import { TextEditorManager } from "../component/textEditor";
|
|
6
|
-
import type { Camera, Displayer, DisplayerCallbacks, Player, PriorityType, Rectangle, Room, RoomMember, _ArrayTrue } from "./types";
|
|
6
|
+
import type { Camera, Displayer, DisplayerCallbacks, IconifyInformation, Player, PriorityType, Rectangle, Room, RoomMember, _ArrayTrue } from "./types";
|
|
7
7
|
import { CursorManager } from "../cursors";
|
|
8
8
|
import { ViewContainerManager } from "./baseViewContainerManager";
|
|
9
9
|
import { MasterControlForWorker } from "../core/mainEngine";
|
|
@@ -13,6 +13,7 @@ import { ICameraOpt } from "../core/types";
|
|
|
13
13
|
import { HotkeyManager } from "../hotkey";
|
|
14
14
|
import { RenderCotrolImple } from "../core/renderCotrol";
|
|
15
15
|
import { MiniMapManagerImpl } from "../component/miniMap/manager";
|
|
16
|
+
import { PluginManager, Plugin } from "../core/plugin";
|
|
16
17
|
export interface BaseApplianceManagerProps {
|
|
17
18
|
displayer: Displayer<DisplayerCallbacks>;
|
|
18
19
|
plugin?: AppliancePluginLike;
|
|
@@ -40,6 +41,7 @@ export declare abstract class BaseApplianceManager {
|
|
|
40
41
|
abstract readonly viewContainerManager: ViewContainerManager;
|
|
41
42
|
readonly renderControl: RenderCotrolImple;
|
|
42
43
|
readonly miniMapManager: MiniMapManagerImpl;
|
|
44
|
+
readonly pluginManager: PluginManager;
|
|
43
45
|
constructor(params: BaseApplianceManagerProps);
|
|
44
46
|
setPriority(priority: PriorityType): void;
|
|
45
47
|
hasOffscreenCanvas(): boolean;
|
|
@@ -100,4 +102,6 @@ export declare abstract class BaseApplianceManager {
|
|
|
100
102
|
cancelFilterRender(viewId: ViewId, isSync?: boolean): void;
|
|
101
103
|
createMiniMap(viewId: string, div: HTMLElement): Promise<void>;
|
|
102
104
|
destroyMiniMap(viewId: string): Promise<void>;
|
|
105
|
+
insertIconify(viewId: string, iconifyInfo: IconifyInformation): void;
|
|
106
|
+
usePlugin(plugin: Plugin): void;
|
|
103
107
|
}
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ import type { ApplianceSinglePlugin } from "./applianceSinglePlugin";
|
|
|
9
9
|
import type { ApplianceMultiPlugin } from "./applianceMultiPlugin";
|
|
10
10
|
import type { ECanvasContextType } from "../core/enum";
|
|
11
11
|
import { AuthRenderScenesData } from "../core/renderCotrol";
|
|
12
|
+
import type { Plugin } from "../core/plugin";
|
|
13
|
+
export { Plugin } from "../core/plugin";
|
|
12
14
|
export type { Room, ImageInformation, Point, Size, Rectangle, RoomMember, RoomState, Player, HotKeys, Camera, Displayer, DisplayerCallbacks, CameraState, View, Cursor, CursorAdapter, RenderEngine, _MemberState };
|
|
13
15
|
export declare enum ApplianceNames {
|
|
14
16
|
/**
|
|
@@ -127,7 +129,7 @@ export type ApplianceAdaptor = {
|
|
|
127
129
|
logger?: Logger;
|
|
128
130
|
cursorAdapter?: CursorAdapter;
|
|
129
131
|
};
|
|
130
|
-
export type canBindMethodType = keyof Omit<AppliancePluginInstance, 'displayer' | 'windowManager' | 'injectMethodToObject' | 'callbacksOn' | 'callbacksOnce' | 'callbacksOff' | '_injectTargetObject' | 'createMiniMap' | 'destroyMiniMap' | 'filterRenderByUid' | 'cancelFilterRender' | 'addListener' | 'removeListener'>;
|
|
132
|
+
export type canBindMethodType = keyof Omit<AppliancePluginInstance, 'displayer' | 'windowManager' | 'injectMethodToObject' | 'callbacksOn' | 'callbacksOnce' | 'callbacksOff' | '_injectTargetObject' | 'createMiniMap' | 'destroyMiniMap' | 'filterRenderByUid' | 'cancelFilterRender' | 'addListener' | 'removeListener' | 'usePligiun'>;
|
|
131
133
|
export interface AppliancePluginInstance {
|
|
132
134
|
readonly displayer: Displayer;
|
|
133
135
|
readonly currentManager?: ApplianceManagerLike;
|
|
@@ -232,6 +234,11 @@ export interface AppliancePluginInstance {
|
|
|
232
234
|
* 移除事件监听器
|
|
233
235
|
*/
|
|
234
236
|
removeListener(event: PublicEvent, callback: PublicCallback<PublicEvent>): void;
|
|
237
|
+
/**
|
|
238
|
+
* 使用插件
|
|
239
|
+
* @param plugin 插件
|
|
240
|
+
*/
|
|
241
|
+
usePligiun(plugin: Plugin): void;
|
|
235
242
|
}
|
|
236
243
|
export type Logger = {
|
|
237
244
|
readonly info: (...messages: any[]) => void;
|
|
@@ -411,3 +418,41 @@ export type PublicListener = {
|
|
|
411
418
|
};
|
|
412
419
|
export type PublicEvent = keyof PublicListener;
|
|
413
420
|
export type PublicCallback<T extends PublicEvent> = PublicListener[T];
|
|
421
|
+
export type IconifyInformation = {
|
|
422
|
+
/**
|
|
423
|
+
* inconify svg url
|
|
424
|
+
*/
|
|
425
|
+
src: string;
|
|
426
|
+
/**
|
|
427
|
+
* 图片的唯一识别符
|
|
428
|
+
*/
|
|
429
|
+
uuid: string;
|
|
430
|
+
/**
|
|
431
|
+
* 图片中点在世界坐标系中的 x 坐标
|
|
432
|
+
*/
|
|
433
|
+
centerX: number;
|
|
434
|
+
/**
|
|
435
|
+
* 图片中点在世界坐标系中的 y 坐标
|
|
436
|
+
*/
|
|
437
|
+
centerY: number;
|
|
438
|
+
/**
|
|
439
|
+
* 图片中点在世界坐标系中的宽
|
|
440
|
+
*/
|
|
441
|
+
width: number;
|
|
442
|
+
/**
|
|
443
|
+
* 图片中点在世界坐标系中的高
|
|
444
|
+
*/
|
|
445
|
+
height: number;
|
|
446
|
+
/**
|
|
447
|
+
* 图片是否被锁定
|
|
448
|
+
*/
|
|
449
|
+
locked: boolean;
|
|
450
|
+
/**
|
|
451
|
+
* 图片是否禁止非等比放缩
|
|
452
|
+
*/
|
|
453
|
+
uniformScale?: boolean;
|
|
454
|
+
/**
|
|
455
|
+
* 是否以跨域方式加载图片
|
|
456
|
+
*/
|
|
457
|
+
crossOrigin?: boolean | string;
|
|
458
|
+
};
|