Skip to content

Commit d550b12

Browse files
committed
docs: update appliance-plugin Notes
1 parent 26407a9 commit d550b12

File tree

4 files changed

+102
-64
lines changed

4 files changed

+102
-64
lines changed

Diff for: README-zh.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ function App() {
468468
```
469469
### 注意
470470

471-
- 在开启 appliance-plugin 插件后, 之前白板上旧绘制的内容会显示,但是无法操作和升级. 所以为了不影响体验,请在一个无任何历史数据的白板上使用。同理插件关闭后, 新绘制的内容会丢失。
471+
- 首先必需保证在安卓\ios\web,三端都开启 appliance-plugin 配置. appliance-plugin 开启后绘制的笔记在未开启的白板上不会显示.
472+
- 在开启 appliance-plugin 插件后, 之前白板上旧绘制的内容会显示,但是无法操作和升级成新的笔记. 所以为了不影响体验,请在一个无任何历史数据的白板上使用。同理插件关闭后, 新绘制的内容会丢失。
472473
- 只有浏览器对 web API [offscreenCanvas](https://developer.mozilla.org/zh-CN/docs/Web/API/OffscreenCanvas#%E6%B5%8F%E8%A7%88%E5%99%A8%E5%85%BC%E5%AE%B9%E6%80%A7) 的完全支持,才能体验到更加的性能及丰富的教具功能体验。
473474

474475
<h2 id="customization">自定义</h2>

Diff for: README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,8 @@ function App() {
461461
}
462462
```
463463
**Note:**
464-
- After opening the appliance plugin, the drawn content will be displayed, but it cannot be manipulated and upgraded, so in order not to affect the experience, please use it on a whiteboard without any historical data. Similarly, when the plugin is closed, the newly drawn content will be lost.
464+
- First, you must ensure that the appliance plugin configuration is enabled on all three ends of Android \ios\web. Notes drawn after appliance-plugin is enabled will not be displayed on the unoccupied whiteboard.
465+
- After the appliance plugin is turned on, the old contents drawn on the previous whiteboard are displayed, but cannot be manipulated and upgraded into new notes. So in order not to affect the experience, please use on a whiteboard without any historical data. Similarly, when the plugin is closed, the newly drawn content will be lost.
465466
- only the browser for web apis [offscreenCanvas](https://developer.mozilla.org/en-US/docs/Web/API/OffscreenCanvas#browser_compatibility) Full support, in order to experience more performance and rich teaching AIDS functional experience.
466467

467468
## Customization

Diff for: docs/en/appliance-plugin.md

+49-31
Original file line numberDiff line numberDiff line change
@@ -190,41 +190,12 @@ The following interfaces are involved:
190190
- Server-side screenshot, after the appliance-plugin is turned on, notes cannot be obtained by calling server-side screenshot, but need to use `screenshotToCanvasAsync` to obtain the screenshot
191191

192192
#### New features
193-
1. Minimap function (Version >=1.1.6)
194-
```js
195-
/** Create a minimap
196-
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
197-
* @param div Small map DOM container
198-
*/
199-
createMiniMap(viewId: string, div: HTMLElement): Promise<void>;
200-
/** Destroy minimap */
201-
destroyMiniMap(viewId: string): Promise<void>;
202-
```
203-
2. Filter Elements (Version >=1.1.6)
204-
```js
205-
/** Filter Elements
206-
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
207-
* @param filter filter condition
208-
* render: Whether notes can be rendered, [uid1, uid2,...] Or true. true, that is, both render, [uid1, uid2,...] The collection of user Uids rendered for the specified
209-
* hide: Note is hidden, [uid1, uid2,...] Or true. true, that is to hide, [uid1, uid2,...] To specify a hidden user uid collection
210-
* clear: Whether notes can be cleared, [uid1, uid2,...] Or true. true, that is, can be cleared, [uid1, uid2,...] Specifies a collection of user Uids that can be cleared
211-
* @param isSync Whether to synchronize data to other users. The default value is true, that is, the data will be synchronized to other users
212-
*/
213-
filterRenderByUid(viewId: string, filter: { render?: _ArrayTrue, hide?: _ArrayTrue, clear?: _ArrayTrue}, isSync?:boolean): void;
214-
/** Filter Elements
215-
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
216-
* @param isSync Whether to synchronize data to other users. The default value is true, that is, the data will be synchronized to other users. Keep it the same as the filterRenderByUid setting
217-
*/
218-
cancelFilterRender(viewId: string, isSync?:boolean): void;
219-
```
220-
3. Split screen display Elements (little whiteboard featrue), need to combine '@netless/app-little-white-board' (Version >=1.1.3)
221-
222-
4. laserPen teaching aids (Version >=1.1.1)
193+
1. laserPen teaching aids (Version >=1.1.1)
223194
```js
224195
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
225196
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
226197
```
227-
5. Extended Teaching AIDS (Version >=1.1.1)
198+
2. Extended Teaching AIDS (Version >=1.1.1)
228199
```js
229200
export enum EStrokeType {
230201
/** Solid line */
@@ -276,7 +247,54 @@ The following interfaces are involved:
276247
manager.mainView.setMemberState({ ... } as ExtendMemberState);
277248
appliance.setMemberState({ ... } as ExtendMemberState);
278249
```
250+
3. Split screen display Elements (little whiteboard featrue), need to combine '@netless/app-little-white-board' (Version >=1.1.3)
279251

252+
4. Minimap function (Version >=1.1.6)
253+
```js
254+
/** Create a minimap
255+
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
256+
* @param div Small map DOM container
257+
*/
258+
createMiniMap(viewId: string, div: HTMLElement): Promise<void>;
259+
/** Destroy minimap */
260+
destroyMiniMap(viewId: string): Promise<void>;
261+
```
262+
5. Filter Elements (Version >=1.1.6)
263+
```js
264+
/** Filter Elements
265+
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
266+
* @param filter filter condition
267+
* render: Whether notes can be rendered, [uid1, uid2,...] Or true. true, that is, both render, [uid1, uid2,...] The collection of user Uids rendered for the specified
268+
* hide: Note is hidden, [uid1, uid2,...] Or true. true, that is to hide, [uid1, uid2,...] To specify a hidden user uid collection
269+
* clear: Whether notes can be cleared, [uid1, uid2,...] Or true. true, that is, can be cleared, [uid1, uid2,...] Specifies a collection of user Uids that can be cleared
270+
* @param isSync Whether to synchronize data to other users. The default value is true, that is, the data will be synchronized to other users
271+
*/
272+
filterRenderByUid(viewId: string, filter: { render?: _ArrayTrue, hide?: _ArrayTrue, clear?: _ArrayTrue}, isSync?:boolean): void;
273+
/** Filter Elements
274+
* @param viewId ID of the whiteboard under windowManager. The ID of the main whiteboard is mainView, and the ID of other whiteboards is the appID of addApp() return
275+
* @param isSync Whether to synchronize data to other users. The default value is true, that is, the data will be synchronized to other users. Keep it the same as the filterRenderByUid setting
276+
*/
277+
cancelFilterRender(viewId: string, isSync?:boolean): void;
278+
```
279+
6. Handwriting graphics automatic association function: 'autoDraw' (version >=1.1.7)
280+
```js
281+
export type AutoDrawOptions = {
282+
/** Automatically associate rest api addresses */
283+
hostServer: string;
284+
/** A container that holds a list of associated icons */
285+
container: HTMLDivElement;
286+
/** How long does the drawing end start activating the association */
287+
delay?: number;
288+
};
289+
import { ApplianceMultiPlugin, AutoDrawPlugin } from '@netless/appliance-plugin';
290+
const plugin = await ApplianceMultiPlugin.getInstance(...);
291+
const autoDrawPlugin = new AutoDrawPlugin({
292+
container: topBarDiv,
293+
hostServer: 'https://autodraw-white-backup-hk-hkxykbfofr.cn-hongkong.fcapp.run',
294+
delay: 2000
295+
});
296+
plugin.usePlugin(autoDrawPlugin);
297+
```
280298
### Configure parameters
281299
``getInstance(wm: WindowManager, adaptor: ApplianceAdaptor)``
282300
- wm: WindowManager\room\player. In multi-window mode, you pass WindowManager, and in single-window mode, you pass room or player(whiteboard playback mode).

Diff for: docs/zh/appliance-plugin.md

+49-31
Original file line numberDiff line numberDiff line change
@@ -193,41 +193,12 @@ module: {
193193
- 服务端截图, appliance-plugin开启后, 笔记不能通过调用服务端截图方式获取截图,而需要改用`screenshotToCanvasAsync`获取
194194

195195
#### 新功能
196-
1. 小地图功能 (Version >=1.1.6)
197-
```js
198-
/** 创建小地图
199-
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
200-
* @param div 小地图DOM容器
201-
*/
202-
createMiniMap(viewId: string, div: HTMLElement): Promise<void>;
203-
/** 销毁小地图 */
204-
destroyMiniMap(viewId: string): Promise<boolean>;
205-
```
206-
2. 过滤笔记 (Version >=1.1.6)
207-
```js
208-
/** 过滤笔记
209-
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
210-
* @param filter 过滤条件
211-
* render: 笔记是否能要渲染, [uid1, uid2, ...] 或 true. true, 即都会渲染, [uid1, uid2, ...] 为指定渲染的用户uid集合
212-
* hide: 笔记是否隐藏, [uid1, uid2, ...] 或 true. true, 即都要隐藏, [uid1, uid2, ...] 为指定隐藏的用户uid集合
213-
* clear: 笔记是否可被清除, [uid1, uid2, ...] 或 true. true, 即都可以被清除, [uid1, uid2, ...] 为指定可被清除的用户uid集合
214-
* @param isSync 是否同步到其他用户, 默认为true, 即会同步到其他用户
215-
*/
216-
filterRenderByUid(viewId: string, filter: { render?: _ArrayTrue, hide?: _ArrayTrue, clear?: _ArrayTrue}, isSync?:boolean): void;
217-
/** 取消过滤笔记
218-
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
219-
* @param isSync 是否同步到其他用户, 默认为true, 即会同步到其他用户. 请保持和filterRenderByUid设置的一致
220-
*/
221-
cancelFilterRender(viewId: string, isSync?:boolean): void;
222-
```
223-
3. 分屏显示笔记(小白板功能),需要结合 `@netless/app-little-white-board` (Version >=1.1.3)
224-
225-
4. 激光铅笔教具 (Version >=1.1.1)
196+
1. 激光铅笔教具 (Version >=1.1.1)
226197
```js
227198
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
228199
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
229200
```
230-
5. 扩展教具 (Version >=1.1.1)
201+
2. 扩展教具 (Version >=1.1.1)
231202
```js
232203
export enum EStrokeType {
233204
/** 实心线条 */
@@ -279,6 +250,53 @@ module: {
279250
manager.mainView.setMemberState({ ... } as ExtendMemberState);
280251
appliance.setMemberState({ ... } as ExtendMemberState);
281252
```
253+
3. 分屏显示笔记(小白板功能),需要结合 `@netless/app-little-white-board` (Version >=1.1.3)
254+
4. 小地图功能 (Version >=1.1.6)
255+
```js
256+
/** 创建小地图
257+
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
258+
* @param div 小地图DOM容器
259+
*/
260+
createMiniMap(viewId: string, div: HTMLElement): Promise<void>;
261+
/** 销毁小地图 */
262+
destroyMiniMap(viewId: string): Promise<boolean>;
263+
```
264+
5. 过滤笔记 (Version >=1.1.6)
265+
```js
266+
/** 过滤笔记
267+
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
268+
* @param filter 过滤条件
269+
* render: 笔记是否能要渲染, [uid1, uid2, ...] 或 true. true, 即都会渲染, [uid1, uid2, ...] 为指定渲染的用户uid集合
270+
* hide: 笔记是否隐藏, [uid1, uid2, ...] 或 true. true, 即都要隐藏, [uid1, uid2, ...] 为指定隐藏的用户uid集合
271+
* clear: 笔记是否可被清除, [uid1, uid2, ...] 或 true. true, 即都可以被清除, [uid1, uid2, ...] 为指定可被清除的用户uid集合
272+
* @param isSync 是否同步到其他用户, 默认为true, 即会同步到其他用户
273+
*/
274+
filterRenderByUid(viewId: string, filter: { render?: _ArrayTrue, hide?: _ArrayTrue, clear?: _ArrayTrue}, isSync?:boolean): void;
275+
/** 取消过滤笔记
276+
* @param viewId 多白板下白板ID, 主白板ID为 `mainView`, 其他白板ID为 addApp() return 的appID
277+
* @param isSync 是否同步到其他用户, 默认为true, 即会同步到其他用户. 请保持和filterRenderByUid设置的一致
278+
*/
279+
cancelFilterRender(viewId: string, isSync?:boolean): void;
280+
```
281+
6. 手写图形自动联想功能:`autoDraw` (version >=1.1.7)
282+
```js
283+
export type AutoDrawOptions = {
284+
/** 自动联想rest api地址 */
285+
hostServer: string;
286+
/** 存放联想icon列表的容器 */
287+
container: HTMLDivElement;
288+
/** 绘制结束多久开始激活联想 */
289+
delay?: number;
290+
};
291+
import { ApplianceMultiPlugin, AutoDrawPlugin } from '@netless/appliance-plugin';
292+
const plugin = await ApplianceMultiPlugin.getInstance(...);
293+
const autoDrawPlugin = new AutoDrawPlugin({
294+
container: topBarDiv,
295+
hostServer: 'https://autodraw-white-backup-hk-hkxykbfofr.cn-hongkong.fcapp.run',
296+
delay: 2000
297+
});
298+
plugin.usePlugin(autoDrawPlugin);
299+
```
282300

283301
### 配置参数
284302
``getInstance(wm: WindowManager, adaptor: ApplianceAdaptor)``

0 commit comments

Comments
 (0)