@netless/window-manager 0.4.54 → 0.4.56
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/CHANGELOG.md +10 -0
- package/README.zh-cn.md +1 -0
- package/dist/{index.cjs.js → index.js} +3 -3
- package/dist/index.js.map +1 -0
- package/dist/{index.es.js → index.mjs} +3 -3
- package/dist/index.mjs.map +1 -0
- package/docs/advanced.md +55 -55
- package/docs/api.md +116 -114
- package/docs/app-context.md +213 -213
- package/docs/basic.md +25 -26
- package/docs/camera.md +19 -20
- package/docs/cn/advanced.md +137 -0
- package/docs/cn/api.md +309 -0
- package/docs/cn/app-context.md +369 -0
- package/docs/cn/basic.md +64 -0
- package/docs/cn/camera.md +53 -0
- package/docs/cn/concept.md +9 -0
- package/docs/cn/custom-max-bar.md +31 -0
- package/docs/cn/develop-app.md +94 -0
- package/docs/cn/export-pdf.md +48 -0
- package/docs/cn/migrate.md +60 -0
- package/docs/cn/replay.md +40 -0
- package/docs/concept.md +6 -5
- package/docs/custom-max-bar.md +7 -7
- package/docs/develop-app.md +20 -20
- package/docs/export-pdf.md +20 -20
- package/docs/migrate.md +25 -27
- package/docs/quickstart.md +50 -0
- package/docs/replay.md +20 -20
- package/package.json +3 -3
- package/src/Helper.ts +1 -1
- package/vite.config.js +3 -1
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -60
- package/dist/index.umd.js.map +0 -1
- /package/docs/{qickstart.md → cn/quickstart.md} +0 -0
package/docs/advanced.md
CHANGED
@@ -1,56 +1,56 @@
|
|
1
|
-
##
|
1
|
+
## Advanced usage
|
2
2
|
|
3
|
-
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
3
|
+
- Table of contents
|
4
|
+
- [Undo Redo](#redo-undo)
|
5
|
+
- [clean screen](#clean-current-scene)
|
6
|
+
- [Judging whether to open a certain APP](#has-kind)
|
7
|
+
- [page controller](#page-control)
|
8
|
+
- [viewpoint](#view-mode)
|
9
|
+
- [Insert image to current app](#insert-image-to-app)
|
10
10
|
|
11
11
|
|
12
|
-
<h3 id="redo-undo"
|
12
|
+
<h3 id="redo-undo">Undo redo</h3>
|
13
13
|
|
14
|
-
>
|
14
|
+
> The following events and properties will automatically switch application objects according to the `focus` window
|
15
15
|
|
16
|
-
####
|
16
|
+
#### Get the number of steps that can be undone/redoed
|
17
17
|
|
18
18
|
```ts
|
19
19
|
manager.canUndoSteps
|
20
20
|
manager.canRedoSteps
|
21
21
|
```
|
22
22
|
|
23
|
-
####
|
23
|
+
#### Monitor changes in the number of steps that can be undone/redoed
|
24
24
|
|
25
|
-
`canRedoStepsChange`
|
25
|
+
`canRedoStepsChange` and `canUndoStepsChange` will retrigger when switching windows
|
26
26
|
|
27
27
|
```ts
|
28
28
|
manager.emitter.on("canUndoStepsChange", (steps: number) => {
|
29
|
-
|
29
|
+
// undoable steps update
|
30
30
|
})
|
31
31
|
manager.emitter.on("canRedoStepsChange", (steps: number) => {
|
32
|
-
|
32
|
+
// Update the number of steps that can be redone
|
33
33
|
})
|
34
34
|
```
|
35
35
|
|
36
|
-
####
|
36
|
+
#### Undo/Redo
|
37
37
|
|
38
38
|
```ts
|
39
|
-
manager.undo()
|
40
|
-
manager.redo() //
|
39
|
+
manager.undo() // undo
|
40
|
+
manager.redo() // redo
|
41
41
|
```
|
42
42
|
|
43
43
|
<br>
|
44
44
|
|
45
|
-
<h3 id="clean-current-scene"
|
45
|
+
<h3 id="clean-current-scene">Clear screen</h3>
|
46
46
|
|
47
|
-
|
47
|
+
Because there are multiple whiteboards in multi-window mode, if you want to clear the current `focus` whiteboard, you only need to call
|
48
48
|
|
49
49
|
```ts
|
50
50
|
manager.cleanCurrentScene()
|
51
51
|
```
|
52
52
|
|
53
|
-
|
53
|
+
If you only want to clean up the handwriting on the main whiteboard, you need
|
54
54
|
|
55
55
|
```ts
|
56
56
|
manager.mainView.cleanCurrentScene()
|
@@ -59,31 +59,31 @@ manager.mainView.cleanCurrentScene()
|
|
59
59
|
|
60
60
|
<br>
|
61
61
|
|
62
|
-
<h3 id="has-kind"
|
62
|
+
<h3 id="has-kind">Determine whether to open a certain APP</h3>
|
63
63
|
|
64
64
|
```ts
|
65
|
-
manager.emitter.on("ready", () => { // ready
|
66
|
-
|
67
|
-
|
65
|
+
manager.emitter.on("ready", () => { // ready event is triggered after all app creation is complete
|
66
|
+
const apps = manager.queryAll(); // Get all opened apps
|
67
|
+
const hasSlide = apps.some(app => app.kind === "Slide"); // Determine whether there is Slide in the opened APP
|
68
68
|
});
|
69
69
|
```
|
70
70
|
|
71
71
|
<br>
|
72
72
|
|
73
|
-
<h3 id="page-control"
|
73
|
+
<h3 id="page-control">page controller</h3>
|
74
74
|
|
75
|
-
`manager`
|
75
|
+
`manager` provides a `pageState` to get the current index and the total number of pages
|
76
76
|
|
77
77
|
```ts
|
78
|
-
manager.pageState.index //
|
79
|
-
manager.pageState.length //
|
78
|
+
manager.pageState.index // current index
|
79
|
+
manager.pageState.length // total number of pages
|
80
80
|
|
81
81
|
manager.emitter.on("pageStateChange", state => {
|
82
|
-
|
82
|
+
// This event will be triggered when the current index changes and the total number of pages changes
|
83
83
|
});
|
84
84
|
```
|
85
85
|
|
86
|
-
|
86
|
+
Previous/Next/Add a page
|
87
87
|
|
88
88
|
```ts
|
89
89
|
manager.nextPage()
|
@@ -93,45 +93,45 @@ manager.addPage()
|
|
93
93
|
|
94
94
|
<br>
|
95
95
|
|
96
|
-
<h3 id="view-mode"
|
96
|
+
<h3 id="view-mode">View follow</h3>
|
97
97
|
|
98
|
-
|
98
|
+
`ViewMode` in multi-window has `broadcaster` `freedom` two modes
|
99
99
|
|
100
100
|
- `freedom`
|
101
101
|
|
102
|
-
|
102
|
+
Free mode, users can freely zoom and move the viewing angle
|
103
103
|
|
104
|
-
|
104
|
+
Even if there is an anchor in the room, the anchor cannot affect the user's perspective
|
105
105
|
|
106
106
|
- `broadcaster`
|
107
107
|
|
108
|
-
|
108
|
+
Host mode, other people's perspectives will follow me during operation
|
109
109
|
|
110
|
-
|
110
|
+
At the same time, other people in `broadcaster` mode will also affect my perspective
|
111
111
|
|
112
|
-
|
112
|
+
When `isWritable` is `false`, it will only follow other `broadcaster` perspectives
|
113
113
|
|
114
114
|
<br>
|
115
115
|
|
116
|
-
<h3 id="insert-image-to-app"
|
116
|
+
<h3 id="insert-image-to-app">Insert an image into the current app</h3>
|
117
117
|
|
118
118
|
```ts
|
119
|
-
//
|
119
|
+
// Determine whether the current is maximized
|
120
120
|
if (manager.boxState === "maximized") {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
121
|
+
// The value of `focused` will vary depending on the currently focused app
|
122
|
+
const app = manager.queryOne(manager. focused)
|
123
|
+
// Only apps with a view can insert pictures, apps like video and audio do not have a view
|
124
|
+
if (app.view) {
|
125
|
+
var imageInformation = {
|
126
|
+
uuid: uuid,
|
127
|
+
centerX: centerX,
|
128
|
+
centerY: centerY,
|
129
|
+
width: width,
|
130
|
+
height: height,
|
131
|
+
locked: false,
|
132
|
+
};
|
133
|
+
app.view.insertImage(imageInformation);
|
134
|
+
app.view.completeImageUpload(uuid, src);
|
135
|
+
}
|
136
136
|
}
|
137
137
|
```
|
package/docs/api.md
CHANGED
@@ -1,83 +1,85 @@
|
|
1
1
|
# API
|
2
2
|
|
3
|
-
##
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
3
|
+
## Table of contents
|
4
|
+
- [Static methods](#static-methods)
|
5
|
+
- [`mount`](#mount)
|
6
|
+
- [`register`](#register)
|
7
|
+
- [`registered`](#registered)
|
8
|
+
- [`setContainer`](#set-container)
|
9
|
+
- [`setCollectorContainer`](#set-collector-container)
|
10
|
+
- [instance methods](#instance-methods)
|
11
|
+
- [`addApp`](#addApp)
|
12
|
+
- [`closeApp`](#closeApp)
|
13
|
+
- [`focusApp`](#focusApp)
|
14
|
+
- [`setMainViewSceneIndex`](#setMainViewSceneIndex)
|
15
|
+
- [`setBoxState`](#setBoxState)
|
16
|
+
- [`cleanCurrentScene`](#cleanCurrentScene)
|
17
|
+
- [`redo`](#redo)
|
18
|
+
- [`undo`](#undo)
|
19
|
+
- [`copy`](#copy)
|
20
|
+
- [`paste`](#paste)
|
21
|
+
- [`delete`](#delete)
|
22
|
+
- [`duplicate`](#duplicate)
|
23
|
+
- [`insertText`](#insertText)
|
24
|
+
- [`insertImage`](#insertImage)
|
25
|
+
- [`completeImageUpload`](#completeImageUpload)
|
26
|
+
- [`lockImage`](#lockImage)
|
27
|
+
- [`lockImages`](#lockImages)
|
28
|
+
- [`nextPage`](#nextPage)
|
29
|
+
- [`prevPage`](#prevPage)
|
30
|
+
- [`addPage`](#addPage)
|
31
|
+
- [`removePage`](#removePage)
|
32
|
+
- [`refresh`](#refresh)
|
33
|
+
- [`setContainerSizeRatio`](#setContainerSizeRatio)
|
34
|
+
- [instance properties](#prototypes)
|
35
|
+
- [event callback](#events)
|
36
36
|
|
37
37
|
<br>
|
38
38
|
|
39
|
-
<h2 id="static-methods"
|
39
|
+
<h2 id="static-methods">Static methods</h2>
|
40
40
|
|
41
41
|
<h3 id="mount">WindowManager.mount</h3>
|
42
42
|
|
43
|
-
>
|
43
|
+
> mount WindowManager
|
44
44
|
|
45
45
|
```typescript
|
46
|
-
const manager = await WindowManager.mount(
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
const manager = await WindowManager. mount(
|
47
|
+
room: room,
|
48
|
+
container: document. getElementById("container")
|
49
|
+
// full configuration see below
|
50
50
|
);
|
51
51
|
```
|
52
52
|
|
53
|
-
|
53
|
+
parameter
|
54
|
+
|
54
55
|
|
55
56
|
| name | type | default | desc |
|
56
57
|
| ---------------------- | --------------------------------------- | ------- | ---------------------------- |
|
57
|
-
| room | [require] Room | |
|
58
|
-
| container | [require] HTMLElement | |
|
59
|
-
| containerSizeRatio | [optional] number | 9 / 16 |
|
60
|
-
| chessboard | [optional] boolean | true |
|
61
|
-
| collectorContainer | [optional] HTMLElement | |
|
62
|
-
| collectorStyles | [optional] Partial{CSSStyleDeclaration} | |
|
63
|
-
| overwriteStyles | [optional] string | |
|
64
|
-
| cursor | [optional] boolean | false |
|
65
|
-
| disableCameraTransform | [optional] boolean | |
|
58
|
+
| room | [require] Room | | room instance |
|
59
|
+
| container | [require] HTMLElement | | room mount container |
|
60
|
+
| containerSizeRatio | [optional] number | 9 / 16 | The aspect ratio of the multi-window area, the default is 9 : 16 |
|
61
|
+
| chessboard | [optional] boolean | true | The space outside the multi-window area displays PS checkerboard background, default true |
|
62
|
+
| collectorContainer | [optional] HTMLElement | | dom for multi-window minimize icon mount |
|
63
|
+
| collectorStyles | [optional] Partial{CSSStyleDeclaration} | | Configure collector style |
|
64
|
+
| overwriteStyles | [optional] string | | The style to use for the overlay window |
|
65
|
+
| cursor | [optional] boolean | false | Turn on cursor sync |
|
66
|
+
| disableCameraTransform | [optional] boolean | | Disable camera movement for the main whiteboard |
|
66
67
|
| prefersColorScheme | [optional] string | light | auto, light, dark |
|
67
|
-
| debug | [optional] boolean | false |
|
68
|
-
| applianceIcons | [optional] {ApplianceNames, string} | |
|
68
|
+
| debug | [optional] boolean | false | print log information |
|
69
|
+
| applianceIcons | [optional] {ApplianceNames, string} | | Configure the teaching aid picture used by the cursor |
|
70
|
+
|
69
71
|
|
70
|
-
<h3 id="register">WindowManager.register</h3>
|
72
|
+
<h3 id="register">WindowManager. register</h3>
|
71
73
|
|
72
|
-
>
|
74
|
+
> Register `APP` to `WindowManager`
|
73
75
|
|
74
76
|
```typescript
|
75
|
-
WindowManager.register({
|
76
|
-
kind: "
|
77
|
+
WindowManager. register({
|
78
|
+
kind: "hello World",
|
77
79
|
src: NetlessApp,
|
78
80
|
appOptions: () => "appOptions",
|
79
81
|
addHooks: (emitter) => {
|
80
|
-
|
82
|
+
emitter.on("created", result => {
|
81
83
|
console.log("HelloWordResult", result);
|
82
84
|
});
|
83
85
|
emitter.on("focus", result => {
|
@@ -94,7 +96,7 @@ WindowManager.register({
|
|
94
96
|
|
95
97
|
<h3 id="registered">WindowManager.registered</h3>
|
96
98
|
|
97
|
-
>
|
99
|
+
> Get the registered `App`
|
98
100
|
|
99
101
|
```ts
|
100
102
|
WindowManager.registered
|
@@ -104,7 +106,7 @@ WindowManager.registered
|
|
104
106
|
|
105
107
|
<h3 id="set-container">setContainer</h3>
|
106
108
|
|
107
|
-
>
|
109
|
+
> Set whiteboard mount container
|
108
110
|
|
109
111
|
```typescript
|
110
112
|
WindowManager.setContainer(document.getElementById("container"));
|
@@ -112,7 +114,7 @@ WindowManager.setContainer(document.getElementById("container"));
|
|
112
114
|
|
113
115
|
<h3 id="set-container">setCollectorContainer</h3>
|
114
116
|
|
115
|
-
>
|
117
|
+
> Set container mounted by `Collector`
|
116
118
|
|
117
119
|
```typescript
|
118
120
|
WindowManager.setCollectorContainer(document.getElementById("collector-container"));
|
@@ -120,25 +122,25 @@ WindowManager.setCollectorContainer(document.getElementById("collector-container
|
|
120
122
|
|
121
123
|
<br>
|
122
124
|
|
123
|
-
<h2 id="instance-methods"
|
125
|
+
<h2 id="instance-methods">Instance methods</h2>
|
124
126
|
|
125
127
|
<h3 id="addApp">addApp</h3>
|
126
128
|
|
127
|
-
>
|
129
|
+
> add `app` to whiteboard
|
128
130
|
|
129
131
|
```typescript
|
130
132
|
const appId = await manager.addApp({
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
133
|
+
kind: "hello World"
|
134
|
+
options: { // optional configuration
|
135
|
+
scenePath: "/hello-world"
|
136
|
+
}
|
135
137
|
})
|
136
138
|
```
|
137
|
-
|
139
|
+
For specific parameters, please refer to the requirements of `APP` itself
|
138
140
|
|
139
141
|
<h3 id="closeApp">closeApp</h3>
|
140
142
|
|
141
|
-
>
|
143
|
+
> Close any open `APP`
|
142
144
|
|
143
145
|
```typescript
|
144
146
|
manager.closeApp(appId)
|
@@ -146,7 +148,7 @@ manager.closeApp(appId)
|
|
146
148
|
|
147
149
|
<h3 id="focusApp">focusApp</h3>
|
148
150
|
|
149
|
-
>
|
151
|
+
> Switch the `app` of the current `focus`, and set this `app` to the front
|
150
152
|
|
151
153
|
```typescript
|
152
154
|
manager.focusApp(appId)
|
@@ -154,7 +156,7 @@ manager.focusApp(appId)
|
|
154
156
|
|
155
157
|
<h3 id="setMainViewSceneIndex">setMainViewSceneIndex</h3>
|
156
158
|
|
157
|
-
>
|
159
|
+
> Set the `SceneIndex` of the main whiteboard
|
158
160
|
|
159
161
|
```ts
|
160
162
|
manager.setMainViewSceneIndex(1)
|
@@ -162,7 +164,7 @@ manager.setMainViewSceneIndex(1)
|
|
162
164
|
|
163
165
|
<h3 id="setBoxState">setBoxState</h3>
|
164
166
|
|
165
|
-
>
|
167
|
+
> Set the current `boxState`
|
166
168
|
|
167
169
|
```ts
|
168
170
|
manager.setBoxState("normal") // boxState: normal | maximized | minimized
|
@@ -170,7 +172,7 @@ manager.setBoxState("normal") // boxState: normal | maximized | minimized
|
|
170
172
|
|
171
173
|
<h3 id="cleanCurrentScene">cleanCurrentScene</h3>
|
172
174
|
|
173
|
-
>
|
175
|
+
> Clear the handwriting of the currently focused view
|
174
176
|
|
175
177
|
```ts
|
176
178
|
manager.cleanCurrentScene()
|
@@ -178,7 +180,7 @@ manager.cleanCurrentScene()
|
|
178
180
|
|
179
181
|
<h3 id="redo">redo</h3>
|
180
182
|
|
181
|
-
>
|
183
|
+
> Redo the last operation on the currently focused view
|
182
184
|
|
183
185
|
```ts
|
184
186
|
manager.redo()
|
@@ -186,7 +188,7 @@ manager.redo()
|
|
186
188
|
|
187
189
|
<h3 id="undo">undo</h3>
|
188
190
|
|
189
|
-
>
|
191
|
+
> Undo the last action on the currently focused view
|
190
192
|
|
191
193
|
```ts
|
192
194
|
manager.undo()
|
@@ -194,49 +196,49 @@ manager.undo()
|
|
194
196
|
|
195
197
|
<h3 id="nextPage">nextPage</h3>
|
196
198
|
|
197
|
-
>
|
199
|
+
> Switch main whiteboard to next page
|
198
200
|
|
199
201
|
```ts
|
200
202
|
const success = await manager.nextPage()
|
201
203
|
if (!success) {
|
202
|
-
|
204
|
+
// reached the last page
|
203
205
|
}
|
204
206
|
```
|
205
207
|
|
206
208
|
<h3 id="prevPage">prevPage</h3>
|
207
209
|
|
208
|
-
>
|
210
|
+
> Switch main whiteboard to previous page
|
209
211
|
|
210
212
|
```ts
|
211
213
|
const success = await manager.prevPage()
|
212
214
|
if (!success) {
|
213
|
-
|
215
|
+
// have reached the first page
|
214
216
|
}
|
215
217
|
```
|
216
218
|
|
217
219
|
<h3 id="addPage">addPage</h3>
|
218
220
|
|
219
|
-
>
|
221
|
+
> Add a page to the main whiteboard
|
220
222
|
|
221
223
|
```ts
|
222
|
-
manager.addPage() //
|
223
|
-
manager.addPage({ after: true }) //
|
224
|
-
manager.addPage({ scene: { name: "page2" } }) //
|
224
|
+
manager.addPage() // add a page at the end by default
|
225
|
+
manager.addPage({ after: true }) // add a page after the current page
|
226
|
+
manager.addPage({ scene: { name: "page2" } }) // pass in page information
|
225
227
|
```
|
226
228
|
|
227
229
|
<h3 id="removePage">removePage</h3>
|
228
230
|
|
229
|
-
>
|
230
|
-
>
|
231
|
+
> remove a page
|
232
|
+
> When there is only one page left, the last page is not allowed to be deleted
|
231
233
|
|
232
234
|
```ts
|
233
|
-
const success = await manager.removePage() //
|
234
|
-
const success = await manager.removePage(1) //
|
235
|
+
const success = await manager.removePage() // delete the current page by default
|
236
|
+
const success = await manager.removePage(1) // can delete the specified index
|
235
237
|
```
|
236
238
|
|
237
239
|
<h3 id="refresh">refresh</h3>
|
238
240
|
|
239
|
-
>
|
241
|
+
> Refreshes `manager` internal state for `copy` `attributes` from other rooms
|
240
242
|
|
241
243
|
```ts
|
242
244
|
manager.refresh()
|
@@ -244,7 +246,7 @@ manager.refresh()
|
|
244
246
|
|
245
247
|
<h3 id="setContainerSizeRatio">setContainerSizeRatio</h3>
|
246
248
|
|
247
|
-
>
|
249
|
+
> Set the aspect ratio of the whiteboard synchronization area
|
248
250
|
|
249
251
|
```ts
|
250
252
|
manager.setContainerSizeRatio(10 / 16)
|
@@ -252,25 +254,25 @@ manager.setContainerSizeRatio(10 / 16)
|
|
252
254
|
|
253
255
|
<br>
|
254
256
|
|
255
|
-
<h2 id="prototypes"
|
257
|
+
<h2 id="prototypes">Instance attributes</h2>
|
256
258
|
|
257
259
|
| name | type | default | desc |
|
258
260
|
| ------------------ | ------- | ------- | ----------------- |
|
259
|
-
| mainView | View | |
|
260
|
-
| mainViewSceneIndex | number | |
|
261
|
-
| mainViewScenesLength | number | | mainView
|
262
|
-
| boxState | string | |
|
263
|
-
| darkMode | boolean | |
|
264
|
-
| prefersColorScheme | string | |
|
265
|
-
| focused | string | | focus
|
266
|
-
| canRedoSteps | number | |
|
267
|
-
| canRedoSteps | number | |
|
268
|
-
| sceneState | SceneState | |
|
269
|
-
| pageState | PageState | |
|
261
|
+
| mainView | View | | main whiteboard |
|
262
|
+
| mainViewSceneIndex | number | | The SceneIndex of the current main whiteboard |
|
263
|
+
| mainViewScenesLength | number | | mainView's scenes length |
|
264
|
+
| boxState | string | | current window status |
|
265
|
+
| darkMode | boolean | | dark mode |
|
266
|
+
| prefersColorScheme | string | | color theme |
|
267
|
+
| focused | string | | focus app |
|
268
|
+
| canRedoSteps | number | | The number of steps that the currently focused view can redo |
|
269
|
+
| canRedoSteps | number | | The number of steps that the currently focused view can undo |
|
270
|
+
| sceneState | SceneState | | Compatible with the sceneState property of the original SDK, only valid for mainView |
|
271
|
+
| pageState | PageState | | Combine the index and scenes modification of mainView |
|
270
272
|
|
271
273
|
<br>
|
272
274
|
|
273
|
-
<h2 id="events"
|
275
|
+
<h2 id="events">event callback</h2>
|
274
276
|
|
275
277
|
```typescript
|
276
278
|
manager.callbacks.on(events, listener)
|
@@ -284,26 +286,26 @@ manager.callbacks.on(events, listener)
|
|
284
286
|
| darkModeChange | boolean | | |
|
285
287
|
| prefersColorSchemeChange | string | | auto,light,dark |
|
286
288
|
| cameraStateChange | CameraState | | |
|
287
|
-
| focusedChange | string, undefined | |
|
288
|
-
| mainViewScenesLengthChange | number | | mainView scenes
|
289
|
-
| canRedoStepsChange | number | |
|
290
|
-
| canUndoStepsChange | number | |
|
291
|
-
| loadApp | LoadAppEvent | |
|
292
|
-
| ready | undefined | |
|
293
|
-
| sceneStateChange | SceneState | |
|
294
|
-
| pageStateChange | PageState | |
|
289
|
+
| focusedChange | string, undefined | | The appId of the current focus, undefined for the main whiteboard |
|
290
|
+
| mainViewScenesLengthChange | number | | fires when mainView scenes are added or removed |
|
291
|
+
| canRedoStepsChange | number | | The view of the current focus can redo the number of steps to change |
|
292
|
+
| canUndoStepsChange | number | | The current focus view can undo the step change |
|
293
|
+
| loadApp | LoadAppEvent | | Load remote APP event |
|
294
|
+
| ready | undefined | | Triggered when all apps are created |
|
295
|
+
| sceneStateChange | SceneState | | Fired when sceneState is modified |
|
296
|
+
| pageStateChange | PageState | | |
|
295
297
|
|
296
298
|
```ts
|
297
299
|
type LoadAppEvent = {
|
298
|
-
|
299
|
-
|
300
|
-
|
300
|
+
kind: string;
|
301
|
+
status: "start" | "success" | "failed";
|
302
|
+
reason?: string;
|
301
303
|
}
|
302
304
|
```
|
303
305
|
|
304
306
|
```ts
|
305
307
|
type PageState = {
|
306
|
-
|
307
|
-
|
308
|
+
index: number;
|
309
|
+
length: number;
|
308
310
|
}
|
309
|
-
```
|
311
|
+
```
|