@netless/fastboard-core 1.1.5-beta.6 → 1.1.5

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/index.d.ts CHANGED
@@ -1,2 +1,502 @@
1
- export * from './lite';
1
+ import { Size, SceneDefinition, ConvertedFile, RoomPhase as RoomPhase$1, ShapeType, MemberState, RoomState, CameraState, Camera, AnimationMode, Rectangle, Color, ConversionResponse, WhiteWebSdkConfiguration, JoinRoomParams, RoomCallbacks, WhiteWebSdk, Room, HotKeys, PlayerPhase as PlayerPhase$1, PlayerState, PlayerSeekingResult, ReplayRoomParams, PlayerCallbacks, Player, ViewCallbacks, View } from 'white-web-sdk';
2
+ export { AnimationMode, ApplianceNames, Camera, CameraState, Color, ConversionResponse, HotKey, HotKeys, JoinRoomParams, MemberState, PlayerSeekingResult, Rectangle, Room, RoomCallbacks, RoomState, SceneDefinition, ShapeType, ViewCallbacks, WhiteWebSdk, WhiteWebSdkConfiguration } from 'white-web-sdk';
3
+ import { AddPageParams, MountParams, NetlessApp, WindowManager, RegisterParams, PublicEvent } from '@netless/window-manager';
4
+ export { AddPageParams, MountParams, NetlessApp, PublicEvent, WindowManager } from '@netless/window-manager';
5
+ import { SyncedStore } from '@netless/synced-store';
6
+ export { Diff, DiffOne, Storage, SyncedStore } from '@netless/synced-store';
7
+ import { ApplianceNames, AppliancePluginOptions, AppliancePluginInstance } from '@netless/appliance-plugin';
8
+ export { ApplianceNames as ExtendApplianceNames, MemberState as ExtendMemberState } from '@netless/appliance-plugin';
9
+ import { AppInMainViewOptions, AppInMainViewInstance } from '@netless/app-in-mainview-plugin';
2
10
  export { PreviewParams, default as SlideApp, AppResult as SlideController, AppOptions as SlideOptions, SlidePreviewer, addHooks as addSlideHooks, previewSlide, apps as slideApps } from '@netless/app-slide';
11
+
12
+ type Subscriber<T> = (value: T) => void;
13
+ type Unsubscriber = () => void;
14
+ type Updater<T> = (value: T) => T;
15
+ type StartStopNotifier<T> = (set: Subscriber<T>) => Unsubscriber | void;
16
+ interface Readable<T> {
17
+ readonly value: T;
18
+ subscribe(this: void, run: Subscriber<T>): Unsubscriber;
19
+ reaction(this: void, run: Subscriber<T>): Unsubscriber;
20
+ dispose(value?: T): void;
21
+ }
22
+ interface Writable<T> extends Readable<T> {
23
+ set(this: void, value: T): void;
24
+ update(this: void, updater: Updater<T>): void;
25
+ }
26
+ declare function readable<T>(value: T, start?: StartStopNotifier<T>): Readable<T>;
27
+ declare function writable<T>(value: T, start: StartStopNotifier<T> | undefined, set: Subscriber<T>): Writable<T>;
28
+
29
+ declare function getImageSize(url: string, fallback: Size, crossOrigin?: boolean | string): Promise<Size>;
30
+ declare function makeSlideParams(scenes: SceneDefinition[]): {
31
+ scenes: SceneDefinition[];
32
+ taskId: string;
33
+ url: string;
34
+ };
35
+ declare function convertedFileToScene(f: ConvertedFile, i: number): SceneDefinition;
36
+
37
+ declare function genUID(): string;
38
+
39
+ declare const warnings: {
40
+ readonly "no-ppt-in-scenes": "You're probably inserting the slide app in a wrong way, there shouldn't exist `scenes[0].ppt`.";
41
+ };
42
+ declare function warn(id: keyof typeof warnings): void;
43
+
44
+ declare class FastboardAppBase<TEventData extends Record<string, any> = any> {
45
+ readonly sdk: WhiteWebSdk;
46
+ readonly room: Room;
47
+ readonly manager: WindowManager;
48
+ readonly hotKeys: Partial<HotKeys>;
49
+ readonly syncedStore: SyncedStore<TEventData>;
50
+ readonly appliancePlugin?: AppliancePluginInstance | undefined;
51
+ readonly appInMainViewPlugin?: AppInMainViewInstance | undefined;
52
+ constructor(sdk: WhiteWebSdk, room: Room, manager: WindowManager, hotKeys: Partial<HotKeys>, syncedStore: SyncedStore<TEventData>, appliancePlugin?: AppliancePluginInstance | undefined, appInMainViewPlugin?: AppInMainViewInstance | undefined);
53
+ protected _destroyed: boolean;
54
+ /**
55
+ * Destroy fastboard (disconnect from the whiteboard room).
56
+ */
57
+ destroy(): Promise<void>;
58
+ }
59
+ type RoomPhase = `${RoomPhase$1}`;
60
+
61
+ /** pencil, eraser, rectangle... */
62
+ type Appliance = `${ApplianceNames}`;
63
+ /** triangle, star... */
64
+ type Shape = `${ShapeType}`;
65
+ /** Params for static docs, they are rendered as many images. */
66
+ interface InsertDocsStatic {
67
+ readonly fileType: "pdf";
68
+ /** Unique string for binding whiteboard view to the doc. Must start with `/`. */
69
+ readonly scenePath: string;
70
+ /** @example [{ name: '1', ppt: { src: 'url/to/ppt/1.png' } }] */
71
+ readonly scenes: SceneDefinition[];
72
+ /** Window title. */
73
+ readonly title?: string;
74
+ }
75
+ /** Params for slides, they are rendered in @netless/app-slide with animations. */
76
+ interface InsertDocsDynamic {
77
+ readonly fileType: "pptx";
78
+ /** Unique string for binding whiteboard view to the doc. Must start with `/`. */
79
+ readonly scenePath: string;
80
+ /** Conversion task id, see https://developer.netless.link/server-en/home/server-conversion#get-query-task-conversion-progress. */
81
+ readonly taskId: string;
82
+ /** Window title. */
83
+ readonly title?: string;
84
+ /** Where the slide resource placed. @default `https://convertcdn.netless.link/dynamicConvert` */
85
+ readonly url?: string;
86
+ /** @example [{ name: '1' }, { name: '2' }, { name: '3' }] */
87
+ readonly scenes?: SceneDefinition[];
88
+ }
89
+ type InsertDocsParams = InsertDocsStatic | InsertDocsDynamic;
90
+ interface ProjectorResponse {
91
+ uuid: string;
92
+ status: "Waiting" | "Converting" | "Finished" | "Fail";
93
+ type: "dynamic" | "static";
94
+ /** 0..100 */
95
+ convertedPercentage: number;
96
+ /** https://example.org/path/to/{static,dynamic}Convert */
97
+ prefix?: string;
98
+ pageCount?: number;
99
+ /** {1:"{prefix}/{taskId}/preview/1.png"}, only when type=dynamic and preview=true */
100
+ previews?: Record<number, string>;
101
+ /** {prefix}/{taskId}/jsonOutput/note.json */
102
+ note?: string;
103
+ /** {1:{width,height,url}}, only when type=static */
104
+ images?: Record<number, {
105
+ width: number;
106
+ height: number;
107
+ url: string;
108
+ }>;
109
+ /** 20xxxxx */
110
+ errorCode?: string;
111
+ errorMessage?: string;
112
+ }
113
+ type SetMemberStateFn = (partialMemberState: Partial<MemberState>) => void;
114
+ type RoomStateChanged = (diff: Partial<RoomState>) => void;
115
+ /** App download progress. */
116
+ interface AppsStatus {
117
+ [kind: string]: {
118
+ status: "idle" | "loading" | "failed";
119
+ /** Exist if status is `failed`. */
120
+ reason?: string;
121
+ };
122
+ }
123
+ declare class FastboardApp<TEventData extends Record<string, any> = any> extends FastboardAppBase<TEventData> {
124
+ /**
125
+ * Render this app to some DOM.
126
+ */
127
+ bindContainer(container: HTMLElement): void;
128
+ /**
129
+ * Move window-manager's collector to some place.
130
+ */
131
+ bindCollector(container: HTMLElement): void;
132
+ /**
133
+ * Is current room writable?
134
+ */
135
+ readonly writable: Writable<boolean>;
136
+ /**
137
+ * Is current room online?
138
+ */
139
+ readonly phase: Readable<"connecting" | "connected" | "reconnecting" | "disconnecting" | "disconnected">;
140
+ /**
141
+ * Current window-manager's windows' state (is it maximized?).
142
+ */
143
+ readonly boxState: Readable<"normal" | "minimized" | "maximized" | undefined>;
144
+ /**
145
+ * Current window-manager's focused app's id.
146
+ * @example "HelloWorld-1A2b3C4d"
147
+ */
148
+ readonly focusedApp: Readable<string | undefined>;
149
+ /**
150
+ * How many times can I call `app.redo()`?
151
+ */
152
+ readonly canRedoSteps: Readable<number>;
153
+ /**
154
+ * How many times can I call `app.undo()`?
155
+ */
156
+ readonly canUndoSteps: Readable<number>;
157
+ /**
158
+ * Current camera information of main view.
159
+ *
160
+ * Change the camera position by `app.moveCamera()`.
161
+ */
162
+ readonly camera: Readable<CameraState>;
163
+ /**
164
+ * Current tool's info, like "is using pencil?", "what color?".
165
+ *
166
+ * Change the tool by `app.setAppliance()`.
167
+ */
168
+ readonly memberState: Readable<MemberState>;
169
+ /**
170
+ * 0..n-1, current index of main view scenes.
171
+ */
172
+ readonly sceneIndex: Writable<number>;
173
+ /**
174
+ * How many pages are in the main view?
175
+ */
176
+ readonly sceneLength: Readable<number>;
177
+ /**
178
+ * Apps status.
179
+ */
180
+ readonly appsStatus: Readable<AppsStatus>;
181
+ /**
182
+ * visible Apps, when appInMainViewPlugin is not enabled, it will be empty.
183
+ */
184
+ readonly visibleApps: Readable<Set<string>>;
185
+ /**
186
+ * Returns `writable && phase === "connected"`.
187
+ */
188
+ get canOperate(): boolean;
189
+ /**
190
+ * Undo a step on main view.
191
+ */
192
+ undo(): void;
193
+ /**
194
+ * Redo a step on main view.
195
+ */
196
+ redo(): void;
197
+ /**
198
+ * Move current main view's camera position.
199
+ */
200
+ moveCamera(camera: Partial<Camera> & {
201
+ animationMode?: AnimationMode | undefined;
202
+ }): void;
203
+ /**
204
+ * Move current main view's camera to include a rectangle.
205
+ */
206
+ moveCameraToContain(rectangle: Rectangle & {
207
+ animationMode?: AnimationMode;
208
+ }): void;
209
+ /**
210
+ * Delete all things on the main view.
211
+ */
212
+ cleanCurrentScene(): void;
213
+ /**
214
+ * Set current tool, like "pencil".
215
+ */
216
+ setAppliance(appliance: ApplianceNames | Appliance, shape?: ShapeType | Shape): void;
217
+ /**
218
+ * Set pencil and shape's thickness.
219
+ */
220
+ setStrokeWidth(strokeWidth: number): void;
221
+ /**
222
+ * Set pencil and shape's color.
223
+ */
224
+ setStrokeColor(strokeColor: Color): void;
225
+ /**
226
+ * Set text size. Default is 16.
227
+ */
228
+ setTextSize(textSize: number): void;
229
+ /**
230
+ * Set text color.
231
+ *
232
+ * @example
233
+ * setTextColor([0x66, 0xcc, 0xff])
234
+ */
235
+ setTextColor(textColor: Color): void;
236
+ /**
237
+ * Toggle dotted line effect on pencil.
238
+ */
239
+ toggleDottedLine(force?: boolean): void;
240
+ /**
241
+ * Set pencil eraser size.
242
+ */
243
+ setPencilEraserSize(size: number): void;
244
+ /**
245
+ * Goto previous page (the main whiteboard view).
246
+ */
247
+ prevPage(): Promise<boolean>;
248
+ /**
249
+ * Goto next page (the main whiteboard view).
250
+ */
251
+ nextPage(): Promise<boolean>;
252
+ /**
253
+ * Goto any page (index range: 0..n-1)
254
+ */
255
+ jumpPage(index: number): Promise<boolean>;
256
+ /**
257
+ * Add one page to the main whiteboard view.
258
+ *
259
+ * @example
260
+ * addPage({ after: true }) // add one page right after current one.
261
+ * nextPage() // then, goto that page.
262
+ */
263
+ addPage(params?: AddPageParams): Promise<void>;
264
+ /**
265
+ * Remove one page at given index or current page (by default).
266
+ *
267
+ * Requires `@netless/window-manager` >= 0.4.30.
268
+ *
269
+ * @example
270
+ * removePage() // remove current page
271
+ */
272
+ removePage(index?: number): Promise<boolean>;
273
+ /**
274
+ * Insert an image to the main view.
275
+ *
276
+ * @param crossOrigin Whether to load the image with CORS enabled, default is `true`.
277
+ *
278
+ * @example
279
+ * insertImage("https://i.imgur.com/CzXTtJV.jpg")
280
+ */
281
+ insertImage(url: string, crossOrigin?: boolean | string): Promise<void>;
282
+ /**
283
+ * Insert PDF/PPTX from conversion result.
284
+ * @param status https://developer.netless.link/server-en/home/server-conversion#get-query-task-conversion-progress
285
+ */
286
+ insertDocs(filename: string, status: ConversionResponse): Promise<string | undefined>;
287
+ /**
288
+ * Insert PDF/PPTX from projector conversion result.
289
+ * @param response https://developer.netless.link/server-zh/home/server-projector#get-%E6%9F%A5%E8%AF%A2%E4%BB%BB%E5%8A%A1%E8%BD%AC%E6%8D%A2%E8%BF%9B%E5%BA%A6
290
+ */
291
+ insertDocs(filename: string, response: ProjectorResponse): Promise<string | undefined>;
292
+ /**
293
+ * Manual way.
294
+ * @example
295
+ * app.insertDocs({
296
+ * fileType: 'pptx',
297
+ * scenePath: `/pptx/${conversion.taskId}`,
298
+ * taskId: conversion.taskId,
299
+ * title: 'Title',
300
+ * })
301
+ */
302
+ insertDocs(params: InsertDocsParams): Promise<string | undefined>;
303
+ /**
304
+ * Insert the Media Player app.
305
+ */
306
+ insertMedia(title: string, src: string): Promise<string | undefined>;
307
+ /**
308
+ * Insert the Monaco Code Editor app.
309
+ * @deprecated Use `app.manager.addApp({ kind: 'Monaco' })` instead.
310
+ */
311
+ insertCodeEditor(): Promise<string | undefined>;
312
+ /**
313
+ * Insert the Countdown app.
314
+ * @deprecated Use `app.manager.addApp({ kind: 'Countdown' })` instead.
315
+ */
316
+ insertCountdown(): Promise<string | undefined>;
317
+ /**
318
+ * Insert the GeoGebra app.
319
+ * @deprecated Use `app.manager.addApp({ kind: 'GeoGebra' })` instead.
320
+ */
321
+ insertGeoGebra(): Promise<string | undefined>;
322
+ destroy(): Promise<void>;
323
+ }
324
+ interface FastboardOptions {
325
+ sdkConfig: Omit<WhiteWebSdkConfiguration, "useMobXState"> & {
326
+ region: NonNullable<WhiteWebSdkConfiguration["region"]>;
327
+ };
328
+ joinRoom: Omit<JoinRoomParams, "useMultiViews" | "disableNewPencil" | "disableMagixEventDispatchLimit"> & {
329
+ callbacks?: Partial<Omit<RoomCallbacks, "onCanRedoStepsUpdate" | "onCanUndoStepsUpdate">>;
330
+ };
331
+ managerConfig?: Omit<MountParams, "room">;
332
+ netlessApps?: NetlessApp[];
333
+ enableAppliancePlugin?: AppliancePluginOptions;
334
+ enableAppInMainViewPlugin?: true | AppInMainViewOptions;
335
+ }
336
+ /**
337
+ * Create a FastboardApp instance.
338
+ * @example
339
+ * let app = await createFastboard({
340
+ * sdkConfig: {
341
+ * appIdentifier: import.meta.env.VITE_APPID,
342
+ * region: 'cn-hz',
343
+ * },
344
+ * joinRoom: {
345
+ * uid: unique_id,
346
+ * uuid: import.meta.env.VITE_ROOM_UUID,
347
+ * roomToken: import.meta.env.VITE_ROOM_TOKEN,
348
+ * },
349
+ * })
350
+ */
351
+ declare function createFastboard<TEventData extends Record<string, any> = any>({ sdkConfig, joinRoom: { callbacks, ...joinRoomParams }, managerConfig, netlessApps, enableAppliancePlugin, enableAppInMainViewPlugin, }: FastboardOptions): Promise<FastboardApp<TEventData>>;
352
+
353
+ declare class FastboardPlayerBase<TEventData extends Record<string, any> = any> {
354
+ readonly sdk: WhiteWebSdk;
355
+ readonly player: Player;
356
+ readonly manager: WindowManager;
357
+ readonly syncedStore: SyncedStore<TEventData>;
358
+ readonly appliancePlugin?: AppliancePluginInstance | undefined;
359
+ readonly appInMainViewPlugin?: AppInMainViewInstance | undefined;
360
+ constructor(sdk: WhiteWebSdk, player: Player, manager: WindowManager, syncedStore: SyncedStore<TEventData>, appliancePlugin?: AppliancePluginInstance | undefined, appInMainViewPlugin?: AppInMainViewInstance | undefined);
361
+ protected _destroyed: boolean;
362
+ destroy(): void;
363
+ }
364
+ type PlayerPhase = `${PlayerPhase$1}`;
365
+
366
+ declare class FastboardPlayer<TEventData extends Record<string, any> = any> extends FastboardPlayerBase<TEventData> {
367
+ /**
368
+ * Render this player to some DOM.
369
+ */
370
+ bindContainer(container: HTMLElement): void;
371
+ /**
372
+ * Move window-manager's collector to some place.
373
+ */
374
+ bindCollector(container: HTMLElement): void;
375
+ /**
376
+ * Player current time in milliseconds.
377
+ */
378
+ readonly currentTime: Writable<number>;
379
+ /**
380
+ * Player state, like "is it playing?".
381
+ */
382
+ readonly phase: Readable<"waitingFirstFrame" | "playing" | "pause" | "stop" | "ended" | "buffering">;
383
+ /**
384
+ * Will become true after buffering.
385
+ */
386
+ readonly canplay: Readable<boolean>;
387
+ /**
388
+ * Playback speed, default `1`.
389
+ */
390
+ readonly playbackRate: Writable<number>;
391
+ /**
392
+ * Playback duration in milliseconds.
393
+ */
394
+ readonly duration: Readable<number>;
395
+ /**
396
+ * Get state of room at that time, like "who was in the room?".
397
+ */
398
+ readonly state: Readable<PlayerState>;
399
+ /**
400
+ * Seek to some time in milliseconds.
401
+ */
402
+ seek(timestamp: number): Promise<PlayerSeekingResult>;
403
+ /**
404
+ * Change player state to playing.
405
+ */
406
+ play(): void;
407
+ /**
408
+ * Change player state to paused.
409
+ */
410
+ pause(): void;
411
+ /**
412
+ * Change player state to stopped.
413
+ */
414
+ stop(): void;
415
+ /**
416
+ * Set playback speed, a shortcut for `speed.set(x)`.
417
+ */
418
+ setPlaybackRate(value: number): void;
419
+ }
420
+ interface FastboardReplayOptions {
421
+ sdkConfig: Omit<WhiteWebSdkConfiguration, "useMobXState"> & {
422
+ region: NonNullable<WhiteWebSdkConfiguration["region"]>;
423
+ };
424
+ replayRoom: Omit<ReplayRoomParams, "useMultiViews"> & {
425
+ callbacks?: Partial<PlayerCallbacks>;
426
+ };
427
+ managerConfig?: Omit<MountParams, "room">;
428
+ netlessApps?: NetlessApp[];
429
+ enableAppliancePlugin?: AppliancePluginOptions;
430
+ enableAppInMainViewPlugin?: true | AppInMainViewOptions;
431
+ }
432
+ /**
433
+ * Create a FastboardPlayer instance.
434
+ * @example
435
+ * let player = await replayFastboard({
436
+ * sdkConfig: {
437
+ * appIdentifier: import.meta.env.VITE_APPID,
438
+ * region: 'cn-hz',
439
+ * },
440
+ * replayRoom: {
441
+ * room: "room uuid",
442
+ * roomToken: "NETLESSROOM_...",
443
+ * beginTimestamp: 1646619090394,
444
+ * duration: 70448,
445
+ * },
446
+ * })
447
+ */
448
+ declare function replayFastboard<TEventData extends Record<string, any> = any>({ sdkConfig, replayRoom: { callbacks, ...replayRoomParams }, managerConfig, netlessApps, enableAppliancePlugin, enableAppInMainViewPlugin, }: FastboardReplayOptions): Promise<FastboardPlayer<TEventData>>;
449
+
450
+ declare const register: typeof WindowManager.register;
451
+ interface AppsConfig {
452
+ [kind: string]: Omit<RegisterParams, "kind">;
453
+ }
454
+ declare const version: string;
455
+
456
+ declare function addRoomListener<K extends keyof RoomCallbacks>(room: Room, name: K, listener: RoomCallbacks[K]): () => void;
457
+ declare function addPlayerListener<K extends keyof PlayerCallbacks>(player: Player, name: K, listener: PlayerCallbacks[K]): () => void;
458
+ /**
459
+ * Note: view listeners will be invalid on reconnection.
460
+ * You have to rebind them after the phase changed.
461
+ * @example
462
+ * const bindCamera = () => addViewListener(mainView, "onCameraUpdated", setCamera)
463
+ * let dispose = bindCamera(), phase_ = "disconnected"
464
+ * setCamera(mainView.camera)
465
+ * addRoomListener(room, "onPhaseChanged", (phase) => {
466
+ * if (phase === "connected" && phase_ === "reconnecting") {
467
+ * dispose()
468
+ * dispose = bindCamera()
469
+ * setCamera(mainView.camera)
470
+ * }
471
+ * phase_ = phase
472
+ * })
473
+ */
474
+ declare function addViewListener<K extends keyof ViewCallbacks>(view: View, name: K, listener: (value: ViewCallbacks[K]) => void): () => void;
475
+ declare function addManagerListener<K extends keyof PublicEvent>(manager: WindowManager, name: K, listener: (value: PublicEvent[K]) => void): () => void;
476
+
477
+ interface DocsEventOptions {
478
+ /** If provided, will dispatch to the specific app. Default to the focused app. */
479
+ appId?: string;
480
+ /** Used by `jumpToPage` event, range from 1 to total pages count. */
481
+ page?: number;
482
+ }
483
+ /**
484
+ * Send specific command to the static docs / slide app.
485
+ * Only works for apps that were created by `insertDocs()`.
486
+ *
487
+ * Returns false if failed to find the app or not writable.
488
+ *
489
+ * For static docs, `nextPage` equals to `nextStep`, as with `prevPage` and `prevStep`.
490
+ *
491
+ * @example
492
+ * ```js
493
+ * // send "next page" to the focused app
494
+ * dispatchDocsEvent(fastboard, "nextPage")
495
+ *
496
+ * // send "prev page" to some app
497
+ * dispatchDocsEvent(fastboard, "prevPage", {appId:"Slide-1a2b3c4d"})
498
+ * ```
499
+ */
500
+ declare function dispatchDocsEvent(fastboard: FastboardApp | WindowManager, event: "prevPage" | "nextPage" | "prevStep" | "nextStep" | "jumpToPage", options?: DocsEventOptions): boolean;
501
+
502
+ export { Appliance, AppsConfig, AppsStatus, DocsEventOptions, FastboardApp, FastboardOptions, FastboardPlayer, FastboardReplayOptions, InsertDocsDynamic, InsertDocsParams, InsertDocsStatic, PlayerPhase, ProjectorResponse, Readable, RoomPhase, RoomStateChanged, SetMemberStateFn, Shape, StartStopNotifier, Subscriber, Unsubscriber, Updater, Writable, addManagerListener, addPlayerListener, addRoomListener, addViewListener, convertedFileToScene, createFastboard, dispatchDocsEvent, genUID, getImageSize, makeSlideParams, readable, register, replayFastboard, version, warn, writable };
package/dist/index.js CHANGED
@@ -251,7 +251,7 @@ for (const kind in DefaultApps) {
251
251
  windowManager.WindowManager.register(__spreadValues({ kind }, options));
252
252
  }
253
253
  }
254
- var version = "1.1.5-beta.6";
254
+ var version = "1.1.5";
255
255
  if (typeof window !== "undefined") {
256
256
  let str = window.__netlessUA || "";
257
257
  str += ` ${"@netless/fastboard-core"}@${version} `;
@@ -268,6 +268,11 @@ async function loadAppInMainViewPluginModule() {
268
268
  return import('@netless/app-in-mainview-plugin');
269
269
  }
270
270
 
271
+ // src/impl/bridge-runtime.ts
272
+ function attachFastboardBridgeRuntime(manager, runtime) {
273
+ manager.__fastboardBridgeRuntime = runtime;
274
+ }
275
+
271
276
  // src/impl/FastboardApp.ts
272
277
  function noop2() {
273
278
  }
@@ -843,6 +848,15 @@ async function createFastboard(_a) {
843
848
  }, managerConfig), {
844
849
  room
845
850
  }));
851
+ attachFastboardBridgeRuntime(manager, {
852
+ whiteWebSdk: {
853
+ autorun: whiteWebSdk.autorun,
854
+ toJS: whiteWebSdk.toJS
855
+ },
856
+ windowManager: {
857
+ ExtendPlugin: windowManager.ExtendPlugin
858
+ }
859
+ });
846
860
  let appInMainViewPluginInstance;
847
861
  if (enableAppInMainViewPlugin && _AppInMainViewPlugin) {
848
862
  appInMainViewPluginInstance = await _AppInMainViewPlugin.getInstance(
@@ -1093,6 +1107,15 @@ async function replayFastboard(_a) {
1093
1107
  }));
1094
1108
  player.play();
1095
1109
  const manager = await managerPromise;
1110
+ attachFastboardBridgeRuntime(manager, {
1111
+ whiteWebSdk: {
1112
+ autorun: whiteWebSdk.autorun,
1113
+ toJS: whiteWebSdk.toJS
1114
+ },
1115
+ windowManager: {
1116
+ ExtendPlugin: windowManager.ExtendPlugin
1117
+ }
1118
+ });
1096
1119
  let appliancePluginInstance;
1097
1120
  if (isEnableAppliancePlugin && enableAppliancePlugin && _ApplianceMultiPlugin) {
1098
1121
  appliancePluginInstance = await _ApplianceMultiPlugin.getInstance(manager, {