@netless/window-manager 1.0.0-canary.7 → 1.0.0-canary.71

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.
Files changed (112) hide show
  1. package/README.md +30 -6
  2. package/dist/index.js +13625 -0
  3. package/dist/index.mjs +13622 -0
  4. package/dist/index.umd.js +13620 -46
  5. package/dist/{App → src/App}/AppContext.d.ts +16 -14
  6. package/dist/{App → src/App}/AppPageStateImpl.d.ts +0 -0
  7. package/dist/{App → src/App}/AppProxy.d.ts +30 -11
  8. package/dist/{App → src/App}/MagixEvent/index.d.ts +0 -0
  9. package/dist/src/App/WhiteboardView.d.ts +27 -0
  10. package/dist/{App → src/App}/index.d.ts +1 -0
  11. package/dist/src/App/type.d.ts +21 -0
  12. package/dist/{AppListener.d.ts → src/AppListener.d.ts} +2 -2
  13. package/dist/{AppManager.d.ts → src/AppManager.d.ts} +12 -7
  14. package/dist/{AttributesDelegate.d.ts → src/AttributesDelegate.d.ts} +5 -2
  15. package/dist/{BoxEmitter.d.ts → src/BoxEmitter.d.ts} +0 -0
  16. package/dist/{BoxManager.d.ts → src/BoxManager.d.ts} +12 -6
  17. package/dist/{BuiltinApps.d.ts → src/BuiltinApps.d.ts} +3 -0
  18. package/dist/{Cursor → src/Cursor}/Cursor.d.ts +0 -0
  19. package/dist/{Cursor → src/Cursor}/icons.d.ts +0 -0
  20. package/dist/{Cursor → src/Cursor}/index.d.ts +4 -3
  21. package/dist/{Helper.d.ts → src/Helper.d.ts} +4 -8
  22. package/dist/{InternalEmitter.d.ts → src/InternalEmitter.d.ts} +1 -4
  23. package/dist/{Page → src/Page}/PageController.d.ts +3 -1
  24. package/dist/{Page → src/Page}/index.d.ts +0 -0
  25. package/dist/{PageState.d.ts → src/PageState.d.ts} +1 -0
  26. package/dist/{ReconnectRefresher.d.ts → src/ReconnectRefresher.d.ts} +0 -0
  27. package/dist/{RedoUndo.d.ts → src/RedoUndo.d.ts} +0 -0
  28. package/dist/{Register → src/Register}/index.d.ts +4 -2
  29. package/dist/{Register → src/Register}/loader.d.ts +1 -1
  30. package/dist/src/Register/storage.d.ts +11 -0
  31. package/dist/{Utils → src/Utils}/AppCreateQueue.d.ts +0 -0
  32. package/dist/{Utils → src/Utils}/Common.d.ts +0 -0
  33. package/dist/{Utils → src/Utils}/Reactive.d.ts +1 -1
  34. package/dist/{Utils → src/Utils}/RoomHacker.d.ts +0 -0
  35. package/dist/{Utils → src/Utils}/error.d.ts +4 -1
  36. package/dist/{Utils → src/Utils}/log.d.ts +0 -0
  37. package/dist/src/View/CameraSynchronizer.d.ts +21 -0
  38. package/dist/{View → src/View}/MainView.d.ts +25 -7
  39. package/dist/src/View/ScrollMode.d.ts +32 -0
  40. package/dist/{View → src/View}/ViewManager.d.ts +0 -0
  41. package/dist/src/View/ViewSync.d.ts +32 -0
  42. package/dist/{callback.d.ts → src/callback.d.ts} +12 -1
  43. package/dist/{constants.d.ts → src/constants.d.ts} +12 -5
  44. package/dist/src/image.d.ts +19 -0
  45. package/dist/{index.d.ts → src/index.d.ts} +63 -17
  46. package/dist/src/shim.d.ts +11 -0
  47. package/dist/src/storage.d.ts +7 -0
  48. package/dist/{typings.d.ts → src/typings.d.ts} +21 -8
  49. package/dist/style.css +810 -1
  50. package/docs/api.md +10 -0
  51. package/docs/app-context.md +155 -27
  52. package/docs/mirgrate-to-1.0.md +68 -0
  53. package/package.json +27 -22
  54. package/playwright.config.ts +29 -0
  55. package/src/App/AppContext.ts +81 -46
  56. package/src/App/AppPageStateImpl.ts +3 -0
  57. package/src/App/AppProxy.ts +249 -141
  58. package/src/App/WhiteboardView.ts +37 -14
  59. package/src/App/index.ts +1 -0
  60. package/src/App/type.ts +22 -0
  61. package/src/AppListener.ts +27 -21
  62. package/src/AppManager.ts +96 -50
  63. package/src/AttributesDelegate.ts +6 -3
  64. package/src/BoxManager.ts +76 -38
  65. package/src/BuiltinApps.ts +9 -8
  66. package/src/Cursor/Cursor.svelte +6 -2
  67. package/src/Cursor/Cursor.ts +15 -4
  68. package/src/Cursor/icons.ts +6 -0
  69. package/src/Cursor/index.ts +16 -11
  70. package/src/Helper.ts +25 -7
  71. package/src/InternalEmitter.ts +1 -4
  72. package/src/Page/PageController.ts +3 -1
  73. package/src/PageState.ts +8 -1
  74. package/src/ReconnectRefresher.ts +7 -3
  75. package/src/Register/index.ts +36 -14
  76. package/src/Register/loader.ts +20 -9
  77. package/src/Register/storage.ts +26 -5
  78. package/src/Utils/Common.ts +3 -0
  79. package/src/Utils/Reactive.ts +29 -27
  80. package/src/Utils/RoomHacker.ts +3 -0
  81. package/src/Utils/error.ts +6 -2
  82. package/src/View/CameraSynchronizer.ts +55 -36
  83. package/src/View/MainView.ts +163 -77
  84. package/src/View/ScrollMode.ts +240 -0
  85. package/src/View/ViewSync.ts +138 -6
  86. package/src/callback.ts +8 -1
  87. package/src/constants.ts +11 -3
  88. package/src/image/pencil-eraser-1.svg +3 -0
  89. package/src/image/pencil-eraser-2.svg +3 -0
  90. package/src/image/pencil-eraser-3.svg +3 -0
  91. package/src/index.ts +197 -60
  92. package/src/storage.ts +15 -0
  93. package/src/style.css +18 -47
  94. package/src/typings.ts +24 -7
  95. package/vite.config.js +12 -7
  96. package/dist/App/AppViewSync.d.ts +0 -11
  97. package/dist/App/Storage/StorageEvent.d.ts +0 -8
  98. package/dist/App/Storage/index.d.ts +0 -39
  99. package/dist/App/Storage/typings.d.ts +0 -22
  100. package/dist/App/Storage/utils.d.ts +0 -5
  101. package/dist/App/WhiteboardView.d.ts +0 -21
  102. package/dist/Register/storage.d.ts +0 -8
  103. package/dist/View/CameraSynchronizer.d.ts +0 -17
  104. package/dist/View/ViewSync.d.ts +0 -7
  105. package/dist/index.cjs.js +0 -46
  106. package/dist/index.es.js +0 -16161
  107. package/pnpm-lock.yaml +0 -6302
  108. package/src/App/AppViewSync.ts +0 -68
  109. package/src/App/Storage/StorageEvent.ts +0 -21
  110. package/src/App/Storage/index.ts +0 -295
  111. package/src/App/Storage/typings.ts +0 -23
  112. package/src/App/Storage/utils.ts +0 -17
@@ -0,0 +1,32 @@
1
+ import { SideEffectManager } from "side-effect-manager";
2
+ import type { ReadonlyVal } from "value-enhancer";
3
+ import type { AppManager } from "../AppManager";
4
+ import type { ScrollStorage } from "../storage";
5
+ export declare type ScrollState = {
6
+ scrollTop: number;
7
+ page: number;
8
+ maxScrollPage: number;
9
+ };
10
+ export declare class ScrollMode {
11
+ private manager;
12
+ readonly sideEffect: SideEffectManager;
13
+ private readonly _root$;
14
+ private readonly _whiteboard$;
15
+ private readonly _scrollTop$;
16
+ readonly _page$: ReadonlyVal<number>;
17
+ private readonly _scale$;
18
+ private readonly _size$;
19
+ private readonly _mainView$;
20
+ private baseWidth;
21
+ private baseHeight;
22
+ scrollStorage: ScrollStorage;
23
+ readonly scrollState$: ReadonlyVal<ScrollState>;
24
+ setRoot(root: HTMLElement): void;
25
+ constructor(manager: AppManager);
26
+ private initScroll;
27
+ private updateScroll;
28
+ private updateBound;
29
+ dispose(): void;
30
+ private getWhiteboardElement;
31
+ private onWheel;
32
+ }
File without changes
@@ -0,0 +1,32 @@
1
+ import { Val } from "value-enhancer";
2
+ import type { View } from "white-web-sdk";
3
+ import type { ReadonlyVal } from "value-enhancer";
4
+ import type { ICamera, ISize } from "../AttributesDelegate";
5
+ import type { TeleBoxRect } from "@netless/telebox-insider";
6
+ import type { ManagerViewMode } from "../typings";
7
+ export declare type ViewSyncContext = {
8
+ uid: string;
9
+ camera$: Val<ICamera | undefined, boolean>;
10
+ size$: Val<ISize | undefined>;
11
+ stageRect$: ReadonlyVal<TeleBoxRect>;
12
+ viewMode$?: Val<ManagerViewMode>;
13
+ storeCamera: (camera: ICamera) => void;
14
+ storeSize: (size: ISize) => void;
15
+ view$: Val<View | undefined>;
16
+ };
17
+ export declare class ViewSync {
18
+ private context;
19
+ private sem;
20
+ private synchronizer;
21
+ private needRecoverCamera$?;
22
+ constructor(context: ViewSyncContext);
23
+ private get isBroadcastMode();
24
+ private createSynchronizer;
25
+ private subscribeView;
26
+ private subscribeCamera;
27
+ private subscribeSize;
28
+ private subscribeStageRect;
29
+ bindView: (view?: View | undefined) => void;
30
+ private onCameraUpdatedByDevice;
31
+ destroy(): void;
32
+ }
@@ -1,8 +1,10 @@
1
1
  import Emittery from "emittery";
2
- import type { TeleBoxColorScheme, TELE_BOX_STATE } from "@netless/telebox-insider";
2
+ import type { TeleBoxColorScheme, TeleBoxFullscreen, TELE_BOX_STATE } from "@netless/telebox-insider";
3
3
  import type { CameraState, SceneState, ViewVisionMode } from "white-web-sdk";
4
4
  import type { LoadAppEvent } from "./Register";
5
5
  import type { PageState } from "./Page";
6
+ import type { ISize } from "./AttributesDelegate";
7
+ import type { ScrollState } from "./View/ScrollMode";
6
8
  export declare type PublicEvent = {
7
9
  mainViewModeChange: ViewVisionMode;
8
10
  boxStateChange: `${TELE_BOX_STATE}`;
@@ -19,6 +21,15 @@ export declare type PublicEvent = {
19
21
  ready: undefined;
20
22
  sceneStateChange: SceneState;
21
23
  pageStateChange: PageState;
24
+ appClose: {
25
+ appId: string;
26
+ kind: string;
27
+ error?: Error;
28
+ };
29
+ baseSizeChange: ISize;
30
+ fullscreenChange: TeleBoxFullscreen;
31
+ userScroll: undefined;
32
+ scrollStateChange: ScrollState;
22
33
  };
23
34
  export declare type CallbacksType = Emittery<PublicEvent>;
24
35
  export declare const callbacks: CallbacksType;
@@ -5,18 +5,18 @@ export declare enum Events {
5
5
  AppBoxStateChange = "AppBoxStateChange",
6
6
  GetAttributes = "GetAttributes",
7
7
  UpdateWindowManagerWrapper = "UpdateWindowManagerWrapper",
8
- InitReplay = "InitReplay",
9
8
  WindowCreated = "WindowCreated",
10
9
  SetMainViewScenePath = "SetMainViewScenePath",
11
10
  SetMainViewSceneIndex = "SetMainViewSceneIndex",
12
11
  SetAppFocusIndex = "SetAppFocusIndex",
13
12
  SwitchViewsToFreedom = "SwitchViewsToFreedom",
14
- MoveCamera = "MoveCamera",
15
- MoveCameraToContain = "MoveCameraToContain",
16
13
  CursorMove = "CursorMove",
17
14
  RootDirRemoved = "RootDirRemoved",
18
15
  Refresh = "Refresh",
19
- InitMainViewCamera = "InitMainViewCamera"
16
+ InitMainViewCamera = "InitMainViewCamera",
17
+ InvokeAttributesUpdateCallback = "InvokeAttributesUpdateCallback",
18
+ MoveCamera = "MoveCamera",
19
+ MoveCameraToContain = "moveCameraToContain"
20
20
  }
21
21
  export declare const MagixEventName = "__WindowManger";
22
22
  export declare const EnsureReconnectEvent = "__WindowMangerEnsureReconnected__";
@@ -24,7 +24,12 @@ export declare enum AppAttributes {
24
24
  Size = "size",
25
25
  Position = "position",
26
26
  SceneIndex = "SceneIndex",
27
- ZIndex = "zIndex"
27
+ ZIndex = "zIndex",
28
+ Visible = "visible",
29
+ Ratio = "ratio",
30
+ StageRatio = "stageRatio",
31
+ Draggable = "draggable",
32
+ Resizable = "resizable"
28
33
  }
29
34
  export declare enum AppEvents {
30
35
  setBoxSize = "setBoxSize",
@@ -47,3 +52,5 @@ export declare const ROOT_DIR = "/";
47
52
  export declare const INIT_DIR = "/init";
48
53
  export declare const SETUP_APP_DELAY = 50;
49
54
  export declare const MAX_PAGE_SIZE = 500;
55
+ export declare const SCROLL_MODE_BASE_WIDTH = 1600;
56
+ export declare const SCROLL_MODE_BASE_HEIGHT: number;
@@ -0,0 +1,19 @@
1
+ declare module "*.svg" {
2
+ const content: string;
3
+ export default content;
4
+ }
5
+
6
+ declare module "*.jpg" {
7
+ const content: string;
8
+ export default content;
9
+ }
10
+
11
+ declare module "*.png" {
12
+ const content: string;
13
+ export default content;
14
+ }
15
+
16
+ declare module "*.gif" {
17
+ const content: string;
18
+ export default content;
19
+ }
@@ -1,25 +1,25 @@
1
1
  import { AppManager } from "./AppManager";
2
2
  import { CursorManager } from "./Cursor";
3
- import { InvisiblePlugin, ViewMode } from "white-web-sdk";
3
+ import { InvisiblePlugin } from "white-web-sdk";
4
4
  import { ReconnectRefresher } from "./ReconnectRefresher";
5
- import "video.js/dist/video-js.css";
6
- import "./style.css";
7
- import "@netless/telebox-insider/dist/style.css";
5
+ import { Val } from "value-enhancer";
8
6
  import type { TELE_BOX_STATE } from "./BoxManager";
9
7
  import type { Apps, Position, ICamera, ISize } from "./AttributesDelegate";
10
- import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, AnimationMode, CameraBound, Point, Rectangle, CameraState, Player, ImageInformation, SceneState } from "white-web-sdk";
8
+ import type { Displayer, SceneDefinition, View, Room, InvisiblePluginContext, Camera, CameraBound, Point, CameraState, Player, ImageInformation, SceneState, Size, AnimationMode, Rectangle } from "white-web-sdk";
11
9
  import type { AppListeners } from "./AppListener";
12
- import type { ApplianceIcons, NetlessApp, RegisterParams } from "./typings";
13
- import type { TeleBoxColorScheme, TeleBoxState } from "@netless/telebox-insider";
10
+ import type { ApplianceIcons, ManagerViewMode, MoveCameraParams, NetlessApp, RegisterParams } from "./typings";
11
+ import type { TeleBoxColorScheme, TeleBoxFullscreen, TeleBoxManager, TeleBoxManagerThemeConfig, TeleBoxState } from "@netless/telebox-insider";
14
12
  import type { AppProxy } from "./App";
15
13
  import type { PublicEvent } from "./callback";
16
14
  import type Emittery from "emittery";
17
15
  import type { PageController, AddPageParams, PageState } from "./Page";
16
+ import type { ScrollState } from "./View/ScrollMode";
18
17
  export declare type WindowMangerAttributes = {
19
18
  modelValue?: string;
20
19
  boxState: TELE_BOX_STATE;
21
20
  maximized?: boolean;
22
21
  minimized?: boolean;
22
+ scrollTop?: number;
23
23
  [key: string]: any;
24
24
  };
25
25
  export declare type apps = {
@@ -56,6 +56,7 @@ export declare type AppSyncAttributes = {
56
56
  createdAt?: number;
57
57
  camera?: ICamera;
58
58
  size?: ISize;
59
+ setup: boolean;
59
60
  };
60
61
  export declare type AppInitState = {
61
62
  id: string;
@@ -69,6 +70,11 @@ export declare type AppInitState = {
69
70
  sceneIndex?: number;
70
71
  boxState?: TeleBoxState;
71
72
  zIndex?: number;
73
+ visible?: boolean;
74
+ stageRatio?: number;
75
+ resizable?: boolean;
76
+ draggable?: boolean;
77
+ ratio?: number;
72
78
  };
73
79
  export declare type CursorMovePayload = {
74
80
  uid: string;
@@ -80,8 +86,6 @@ export declare type MountParams = {
80
86
  container?: HTMLElement;
81
87
  /** 白板高宽比例, 默认为 9 / 16 */
82
88
  containerSizeRatio?: number;
83
- /** 显示 PS 透明背景,默认 true */
84
- chessboard?: boolean;
85
89
  collectorContainer?: HTMLElement;
86
90
  collectorStyles?: Partial<CSSStyleDeclaration>;
87
91
  overwriteStyles?: string;
@@ -89,10 +93,26 @@ export declare type MountParams = {
89
93
  debug?: boolean;
90
94
  disableCameraTransform?: boolean;
91
95
  prefersColorScheme?: TeleBoxColorScheme;
96
+ /** @deprecated */
97
+ chessboard?: boolean;
92
98
  applianceIcons?: ApplianceIcons;
99
+ containerStyle?: string;
100
+ stageStyle?: string;
101
+ fullscreen?: TeleBoxFullscreen;
102
+ /** Custom `style` attribute value for content area of all boxes. Can be overwritten by box. */
103
+ defaultBoxBodyStyle?: string | null;
104
+ /** Custom `style` attribute value for stage area of all boxes. Can be overwritten by box. */
105
+ defaultBoxStageStyle?: string | null;
106
+ /** Theme variable */
107
+ theme?: TeleBoxManagerThemeConfig;
108
+ /** ScrollMode BaseWidth */
109
+ scrollModeWidth?: number;
110
+ /** ScrollMode BaseHeight */
111
+ scrollModeHeight?: number;
112
+ viewMode?: ManagerViewMode;
93
113
  };
94
114
  export declare const reconnectRefresher: ReconnectRefresher;
95
- export declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes> implements PageController {
115
+ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttributes, any> implements PageController {
96
116
  static kind: string;
97
117
  static displayer: Displayer;
98
118
  static playground?: HTMLElement;
@@ -100,6 +120,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
100
120
  static debug: boolean;
101
121
  static containerSizeRatio: number;
102
122
  private static isCreated;
123
+ static registry: import("./Register").AppRegister;
103
124
  version: string;
104
125
  dependencies: Record<string, string>;
105
126
  appListeners?: AppListeners;
@@ -107,7 +128,8 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
107
128
  emitter: Emittery<PublicEvent>;
108
129
  appManager?: AppManager;
109
130
  cursorManager?: CursorManager;
110
- viewMode: ViewMode;
131
+ viewMode$: Val<ManagerViewMode, any>;
132
+ playground$: Val<HTMLElement | undefined, any>;
111
133
  isReplay: boolean;
112
134
  private _pageState?;
113
135
  private boxManager?;
@@ -123,7 +145,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
123
145
  /**
124
146
  * 注册插件
125
147
  */
126
- static register<AppOptions = any, SetupResult = any, Attributes = any>(params: RegisterParams<AppOptions, SetupResult, Attributes>): Promise<void>;
148
+ static register<AppOptions = any, SetupResult = any, Attributes extends Record<string, any> = any>(params: RegisterParams<AppOptions, SetupResult, Attributes>): Promise<void>;
127
149
  /**
128
150
  * 注销插件
129
151
  */
@@ -144,6 +166,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
144
166
  setMainViewSceneIndex(index: number): Promise<void>;
145
167
  nextPage(): Promise<boolean>;
146
168
  prevPage(): Promise<boolean>;
169
+ jumpPage(index: number): Promise<boolean>;
147
170
  addPage(params?: AddPageParams): Promise<void>;
148
171
  /**
149
172
  * 删除一页
@@ -174,17 +197,26 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
174
197
  /**
175
198
  * 设置 ViewMode
176
199
  */
177
- setViewMode(mode: ViewMode): void;
200
+ setViewMode(mode: ManagerViewMode): void;
178
201
  setBoxState(boxState: TeleBoxState): void;
179
202
  setMaximized(maximized: boolean): void;
180
203
  setMinimized(minimized: boolean): void;
181
204
  get mainView(): View;
182
205
  get camera(): Camera;
206
+ get baseCamera(): {
207
+ id: string;
208
+ centerX: number | null;
209
+ centerY: number | null;
210
+ scale: number;
211
+ } | undefined;
212
+ get baseSize(): ISize | undefined;
183
213
  get cameraState(): CameraState;
184
214
  get apps(): Apps | undefined;
185
215
  get boxState(): TeleBoxState | undefined;
186
216
  get darkMode(): boolean;
217
+ get viewMode(): ManagerViewMode;
187
218
  get prefersColorScheme(): TeleBoxColorScheme | undefined;
219
+ get fullscreen(): TeleBoxFullscreen | undefined;
188
220
  get focused(): string | undefined;
189
221
  get focusedView(): View | undefined;
190
222
  get mainViewSceneIndex(): number;
@@ -195,6 +227,8 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
195
227
  get canUndoSteps(): number;
196
228
  get sceneState(): SceneState;
197
229
  get pageState(): PageState;
230
+ get scrollState(): ScrollState | undefined;
231
+ get teleboxManager(): TeleBoxManager;
198
232
  /**
199
233
  * 查询所有的 App
200
234
  */
@@ -207,9 +241,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
207
241
  * 关闭 APP
208
242
  */
209
243
  closeApp(appId: string): Promise<void>;
210
- moveCamera(camera: Partial<Camera> & {
211
- animationMode?: AnimationMode | undefined;
212
- }): void;
244
+ moveCamera: (camera: MoveCameraParams) => void;
213
245
  moveCameraToContain(rectangle: Rectangle & Readonly<{
214
246
  animationMode?: AnimationMode;
215
247
  }>): void;
@@ -224,6 +256,7 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
224
256
  safeSetAttributes(attributes: any): void;
225
257
  safeUpdateAttributes(keys: string[], value: any): void;
226
258
  setPrefersColorScheme(scheme: TeleBoxColorScheme): void;
259
+ setFullscreen(fullscreen: TeleBoxFullscreen): void;
227
260
  cleanCurrentScene(): void;
228
261
  redo(): number;
229
262
  undo(): number;
@@ -240,9 +273,22 @@ export declare class WindowManager extends InvisiblePlugin<WindowMangerAttribute
240
273
  /** @inner */
241
274
  _refresh(): void;
242
275
  setContainerSizeRatio(ratio: number): void;
276
+ setContainerStyle(style: string): void;
277
+ setStageStyle(style: string): void;
278
+ setBaseSize(size: Size): void;
279
+ /**
280
+ * 切换 focus 到指定的 app, 并且把这个 app 放到最前面
281
+ */
282
+ focusApp(appId: string): void;
283
+ createPPTHandler(): {
284
+ onPageJumpTo: (_pptUUID: string, index: number) => void;
285
+ onPageToNext: () => void;
286
+ onPageToPrev: () => void;
287
+ };
243
288
  private isDynamicPPT;
244
289
  private ensureAttributes;
245
290
  }
246
291
  export * from "./typings";
247
- export { BuiltinApps } from "./BuiltinApps";
292
+ export { BuiltinApps, BuiltinAppsMap } from "./BuiltinApps";
248
293
  export type { PublicEvent } from "./callback";
294
+ export type { Member } from "./Helper";
@@ -0,0 +1,11 @@
1
+ import type { SvelteComponent } from "svelte";
2
+
3
+ declare module "*.svelte" {
4
+ const app: SvelteComponent;
5
+ export default app;
6
+ }
7
+
8
+ declare global {
9
+ const __APP_VERSION__: string;
10
+ const __APP_DEPENDENCIES__: Record<string, string>;
11
+ }
@@ -0,0 +1,7 @@
1
+ import { Storage } from "@netless/synced-store";
2
+ import type { AppManager } from "./AppManager";
3
+ export declare type ScrollStorageState = {
4
+ scrollTop: number;
5
+ };
6
+ export declare type ScrollStorage = Storage<ScrollStorageState>;
7
+ export declare const createScrollStorage: (manager: AppManager) => Storage<ScrollStorageState>;
@@ -1,10 +1,10 @@
1
1
  import type Emittery from "emittery";
2
- import type { AnimationMode, ApplianceNames, Displayer, DisplayerState, Player, Room, SceneDefinition, SceneState, View } from "white-web-sdk";
2
+ import type { AnimationMode, ApplianceNames, Camera, Displayer, DisplayerState, Player, Room, SceneDefinition, SceneState, View, ViewMode } from "white-web-sdk";
3
3
  import type { AppContext } from "./App";
4
- import type { ReadonlyTeleBox, TeleBoxRect } from "@netless/telebox-insider";
4
+ import type { ReadonlyTeleBox, TeleBoxRect, TeleBoxFullscreen } from "@netless/telebox-insider";
5
5
  import type { PageState } from "./Page";
6
6
  import type { Member } from "./Helper";
7
- export interface NetlessApp<Attributes = any, MagixEventPayloads = any, AppOptions = any, SetupResult = any> {
7
+ export interface NetlessApp<Attributes extends Record<string, any> = any, MagixEventPayloads = any, AppOptions = any, SetupResult = any> {
8
8
  kind: string;
9
9
  config?: {
10
10
  /** Box width relative to whiteboard. 0~1. Default 0.5. */
@@ -17,6 +17,8 @@ export interface NetlessApp<Attributes = any, MagixEventPayloads = any, AppOptio
17
17
  minheight?: number;
18
18
  /** App only single instance. */
19
19
  singleton?: boolean;
20
+ /** App box enableShadowDom. Default true */
21
+ enableShadowDOM?: boolean;
20
22
  };
21
23
  setup: (context: AppContext<Attributes, MagixEventPayloads, AppOptions>) => SetupResult;
22
24
  }
@@ -62,21 +64,32 @@ export declare type RegisterEvents<SetupResult = any> = {
62
64
  destroy: RegisterEventData;
63
65
  focus: RegisterEventData;
64
66
  };
65
- export declare type RegisterParams<AppOptions = any, SetupResult = any, Attributes = any> = {
67
+ export declare type RegisterParams<AppOptions = any, SetupResult = any, Attributes extends Record<string, any> = any> = {
66
68
  kind: string;
67
- src: NetlessApp<Attributes, SetupResult> | string | (() => Promise<NetlessApp<Attributes, SetupResult>>);
69
+ src: NetlessApp<Attributes, SetupResult> | string | (() => Promise<NetlessApp<Attributes, SetupResult>>) | (() => Promise<{
70
+ default: NetlessApp<Attributes, SetupResult>;
71
+ }>);
68
72
  appOptions?: AppOptions | (() => AppOptions);
69
73
  addHooks?: (emitter: Emittery<RegisterEvents<SetupResult>>) => void;
70
74
  /** dynamic load app package name */
71
75
  name?: string;
76
+ contentStyles?: string;
72
77
  };
73
78
  export declare type AppListenerKeys = keyof AppEmitterEvent;
74
- export declare type ApplianceIcons = Partial<Record<ApplianceNames, string>>;
79
+ export declare type ApplianceIcons = Partial<Record<`${ApplianceNames}` | string, string>>;
80
+ export declare type Writeable<T> = {
81
+ -readonly [P in keyof T]: T[P];
82
+ };
83
+ export declare type ManagerViewMode = `${ViewMode}` | "scroll";
84
+ export declare type MoveCameraParams = Partial<Camera> & {
85
+ animationMode?: AnimationMode;
86
+ };
75
87
  export type { AppContext } from "./App/AppContext";
76
88
  export type { WhiteBoardView } from "./App";
77
- export type { ReadonlyTeleBox, TeleBoxRect };
89
+ export type { ReadonlyTeleBox, TeleBoxRect, TeleBoxFullscreen };
78
90
  export type { SceneState, SceneDefinition, View, AnimationMode, Displayer, Room, Player };
79
- export type { Storage, StorageStateChangedEvent, StorageStateChangedListener } from "./App/Storage";
80
91
  export * from "./Page";
81
92
  export * from "./Utils/error";
82
93
  export type { Member } from "./Helper";
94
+ export type { TeleBoxManager, TeleBoxManagerQueryConfig } from "@netless/telebox-insider";
95
+ export type { Storage, StorageConfig, StorageEventData } from "@netless/synced-store";