@netless/appliance-plugin 1.1.0 → 1.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 +107 -9
- package/cdn/cdn.js +1 -1
- package/cdn/fullWorker-DXT06v.js +441 -0
- package/cdn/subWorker-caziyz.js +441 -0
- package/dist/appliance-plugin.js +1 -1
- package/dist/appliance-plugin.mjs +23 -19
- package/dist/collector/base.d.ts +3 -0
- package/dist/collector/collector.d.ts +40 -3
- package/dist/collector/enum.d.ts +0 -3
- package/dist/collector/eventCollector.d.ts +1 -0
- package/dist/collector/magixEventCollector.d.ts +1 -0
- package/dist/collector/types.d.ts +61 -15
- package/dist/component/autoDraw/index.d.ts +54 -0
- package/dist/component/miniMap/index.d.ts +1 -0
- package/dist/component/miniMap/manager.d.ts +37 -0
- package/dist/component/miniMap/view.d.ts +14 -0
- package/dist/core/enum.d.ts +56 -6
- package/dist/core/mainEngine.d.ts +36 -15
- package/dist/core/mainThread/base.d.ts +4 -0
- package/dist/core/mainThread/snapshotThread.d.ts +4 -1
- package/dist/core/mainThread/subLocalThread.d.ts +6 -6
- package/dist/core/mainThread/subServiceThread.d.ts +1 -1
- package/dist/core/mainThread/subTopThread.d.ts +2 -2
- package/dist/core/mainThread/workerMainThread.d.ts +3 -2
- package/dist/core/plugin.d.ts +49 -0
- package/dist/core/renderCotrol.d.ts +108 -0
- package/dist/core/tools/arrow.d.ts +3 -2
- package/dist/core/tools/base.d.ts +39 -5
- package/dist/core/tools/ellipse.d.ts +3 -2
- package/dist/core/tools/eraser.d.ts +1 -1
- package/dist/core/tools/image.d.ts +9 -7
- package/dist/core/tools/pencil.d.ts +4 -3
- package/dist/core/tools/pencilEraser.d.ts +1 -1
- package/dist/core/tools/pencilEraserBitMap.d.ts +21 -6
- package/dist/core/tools/polygon.d.ts +3 -2
- package/dist/core/tools/rectangle.d.ts +3 -2
- package/dist/core/tools/selector.d.ts +2 -2
- package/dist/core/tools/speechBalloon.d.ts +3 -2
- package/dist/core/tools/star.d.ts +3 -2
- package/dist/core/tools/straight.d.ts +3 -2
- package/dist/core/tools/utils.d.ts +4 -3
- package/dist/core/types.d.ts +16 -11
- package/dist/core/utils/math.d.ts +1 -0
- package/dist/core/utils/spriteNode.d.ts +9 -3
- package/dist/core/vNodeManager.d.ts +14 -3
- package/dist/core/worker/base.d.ts +19 -9
- package/dist/core/worker/fullWorkerLocal.d.ts +9 -4
- package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
- package/dist/core/worker/workerManager.d.ts +2 -2
- package/dist/displayer/floatBar/index.d.ts +1 -0
- package/dist/extend.d.ts +2 -0
- package/dist/fullWorker.js +158 -156
- package/dist/{index-C4KNxHht.mjs → index-16eeAu4_.mjs} +874 -862
- package/dist/index-BgMemNid.mjs +16918 -0
- package/dist/index-Bpx1RNLY.js +1 -0
- package/dist/index-D0mDu2PZ.js +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/members/index.d.ts +1 -0
- package/dist/plugin/baseApplianceManager.d.ts +29 -2
- package/dist/plugin/baseViewContainerManager.d.ts +3 -2
- package/dist/plugin/const.d.ts +6 -4
- package/dist/plugin/displayerView.d.ts +2 -0
- package/dist/plugin/multi/applianceMultiManager.d.ts +0 -1
- package/dist/plugin/types.d.ts +116 -7
- package/dist/style.css +1 -1
- package/dist/subWorker.js +158 -156
- package/dist/undo/index.d.ts +2 -2
- package/package.json +6 -7
- package/cdn/fullWorker-CjGKnN.js +0 -439
- package/cdn/subWorker-DUJqv_.js +0 -439
- package/dist/index-C29o_HLi.js +0 -1
- package/dist/index-CIJP6_Qj.mjs +0 -14190
- package/dist/index-DmfRoAiB.js +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# appliance-plugin
|
|
2
2
|
|
|
3
|
-
[中文文档](https://github.com/
|
|
3
|
+
[中文文档](https://github.com/netless-io/fastboard/blob/main/docs/zh/appliance-plugin.md)
|
|
4
4
|
|
|
5
5
|
The plug-in is attached to the plug-in mechanism of white-web-sdk to achieve a set of whiteboard teaching AIDS, state synchronization, playback, scene switching and other functions still rely on white-web-sdk or window-manager.
|
|
6
6
|
|
|
@@ -67,13 +67,13 @@ const subWorkerUrl = URL.createObjectURL(subWorkerBlob);
|
|
|
67
67
|
|
|
68
68
|
const whiteWebSdk = new WhiteWebSdk(...)
|
|
69
69
|
const room = await whiteWebSdk.joinRoom({
|
|
70
|
-
...
|
|
71
|
-
invisiblePlugins: [WindowManager, ApplianceMultiPlugin],
|
|
72
|
-
useMultiViews: true,
|
|
70
|
+
...
|
|
71
|
+
invisiblePlugins: [WindowManager, ApplianceMultiPlugin],
|
|
72
|
+
useMultiViews: true,
|
|
73
73
|
})
|
|
74
74
|
const manager = await WindowManager.mount({ room , container:elm, chessboard: true, cursor: true, supportAppliancePlugin: true});
|
|
75
75
|
if (manager) {
|
|
76
|
-
await manager.switchMainViewToWriter();
|
|
76
|
+
// await manager.switchMainViewToWriter();
|
|
77
77
|
await ApplianceMultiPlugin.getInstance(manager,
|
|
78
78
|
{
|
|
79
79
|
options: {
|
|
@@ -135,7 +135,11 @@ module: {
|
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
## Call introduction
|
|
138
|
+
|
|
138
139
|
### api introduction
|
|
140
|
+
|
|
141
|
+
#### Optimize legacy interface
|
|
142
|
+
|
|
139
143
|
The plugin re-implements some of the interfaces of the same name on room or Windows Manager, but internally we have re-injected them back into the original object via injectMethodToObject. No changes are required for external users. As follows:
|
|
140
144
|
```js
|
|
141
145
|
// Internal hack
|
|
@@ -183,10 +187,104 @@ The following interfaces are involved:
|
|
|
183
187
|
- `cleanCurrentScene`
|
|
184
188
|
|
|
185
189
|
4. Customize
|
|
186
|
-
- `getBoundingRectAsync`
|
|
187
|
-
- `screenshotToCanvasAsync`
|
|
188
|
-
- `scenePreviewAsync`
|
|
189
|
-
- `destroy`
|
|
190
|
+
- `getBoundingRectAsync` Replace the api room.getBoundingRect
|
|
191
|
+
- `screenshotToCanvasAsync` Replace the api room.screenshotToCanvas
|
|
192
|
+
- `scenePreviewAsync` Replace the api room.scenePreview
|
|
193
|
+
- `destroy` Destroy the instance of appliance-plugin
|
|
194
|
+
- `addListener` add appliance plugin Listener
|
|
195
|
+
- `removeListener` remove appliance plugin Listener
|
|
196
|
+
|
|
197
|
+
5.Incompatible
|
|
198
|
+
- `exportScene` When the appliance-plugin is enabled, notes cannot be exported in room mode
|
|
199
|
+
- 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
|
|
200
|
+
|
|
201
|
+
#### New features
|
|
202
|
+
1. Minimap function (Version >=1.1.6)
|
|
203
|
+
```js
|
|
204
|
+
/** Create a minimap
|
|
205
|
+
* @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
|
|
206
|
+
* @param div Small map DOM container
|
|
207
|
+
*/
|
|
208
|
+
createMiniMap(viewId: string, div: HTMLElement): Promise<void>;
|
|
209
|
+
/** Destroy minimap */
|
|
210
|
+
destroyMiniMap(viewId: string): Promise<void>;
|
|
211
|
+
```
|
|
212
|
+
2. Filter Elements (Version >=1.1.6)
|
|
213
|
+
```js
|
|
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 filter filter condition
|
|
217
|
+
* 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
|
|
218
|
+
* hide: Note is hidden, [uid1, uid2,...] Or true. true, that is to hide, [uid1, uid2,...] To specify a hidden user uid collection
|
|
219
|
+
* 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
|
|
220
|
+
* @param isSync Whether to synchronize data to other users. The default value is true, that is, the data will be synchronized to other users
|
|
221
|
+
*/
|
|
222
|
+
filterRenderByUid(viewId: string, filter: { render?: _ArrayTrue, hide?: _ArrayTrue, clear?: _ArrayTrue}, isSync?:boolean): void;
|
|
223
|
+
/** Filter Elements
|
|
224
|
+
* @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
|
|
225
|
+
* @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
|
|
226
|
+
*/
|
|
227
|
+
cancelFilterRender(viewId: string, isSync?:boolean): void;
|
|
228
|
+
```
|
|
229
|
+
3. Split screen display Elements (little whiteboard featrue), need to combine '@netless/app-little-white-board' (Version >=1.1.3)
|
|
230
|
+
|
|
231
|
+
4. laserPen teaching aids (Version >=1.1.1)
|
|
232
|
+
```js
|
|
233
|
+
import { EStrokeType, ApplianceNames } from '@netless/appliance-plugin';
|
|
234
|
+
room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType: EStrokeType.Normal});
|
|
235
|
+
```
|
|
236
|
+
5. Extended Teaching AIDS (Version >=1.1.1)
|
|
237
|
+
```js
|
|
238
|
+
export enum EStrokeType {
|
|
239
|
+
/** Solid line */
|
|
240
|
+
Normal = 'Normal',
|
|
241
|
+
/** Line with pen edge */
|
|
242
|
+
Stroke = 'Stroke',
|
|
243
|
+
/** Dotted line */
|
|
244
|
+
Dotted = 'Dotted',
|
|
245
|
+
/** Long dotted line */
|
|
246
|
+
LongDotted = 'LongDotted'
|
|
247
|
+
};
|
|
248
|
+
export type ExtendMemberState = {
|
|
249
|
+
/** The teaching AIDS selected by the current user */
|
|
250
|
+
currentApplianceName: ApplianceNames;
|
|
251
|
+
/** Whether to open the pen tip */
|
|
252
|
+
strokeType? : EStrokeType;
|
|
253
|
+
/** Whether to delete the entire line segment */
|
|
254
|
+
isLine? : boolean;
|
|
255
|
+
/** Wireframe transparency */
|
|
256
|
+
strokeOpacity? : number;
|
|
257
|
+
/** Whether to turn on laser pointer */
|
|
258
|
+
useLaserPen? : boolean;
|
|
259
|
+
/** Laser pointer holding time, second */
|
|
260
|
+
duration? : number;
|
|
261
|
+
/** Fill style */
|
|
262
|
+
fillColor? : Color;
|
|
263
|
+
/** Fill transparency */
|
|
264
|
+
fillOpacity? : number;
|
|
265
|
+
/** The specific type of graph to draw when using shape */
|
|
266
|
+
shapeType? : ShapeType;
|
|
267
|
+
/** Number of polygon vertices */
|
|
268
|
+
vertices? :number;
|
|
269
|
+
/** Length of the inner vertex of the polygon */
|
|
270
|
+
innerVerticeStep? :number;
|
|
271
|
+
/** Ratio of the radius of the inner vertex of the polygon to the outer vertex */
|
|
272
|
+
innerRatio? : number;
|
|
273
|
+
/** Text transparency */
|
|
274
|
+
textOpacity? : number;
|
|
275
|
+
/** Text background color */
|
|
276
|
+
textBgColor? : Color;
|
|
277
|
+
/** Text background color transparency */
|
|
278
|
+
textBgOpacity? : number;
|
|
279
|
+
/** Location */
|
|
280
|
+
placement? : SpeechBalloonPlacement;
|
|
281
|
+
};
|
|
282
|
+
import { ExtendMemberState, ApplianceNames } from '@netless/appliance-plugin';
|
|
283
|
+
/** Set the state of teaching AIDS */
|
|
284
|
+
room.setMemberState({ ... } as ExtendMemberState);
|
|
285
|
+
manager.mainView.setMemberState({ ... } as ExtendMemberState);
|
|
286
|
+
appliance.setMemberState({ ... } as ExtendMemberState);
|
|
287
|
+
```
|
|
190
288
|
|
|
191
289
|
### Configure parameters
|
|
192
290
|
``getInstance(wm: WindowManager, adaptor: ApplianceAdaptor)``
|
package/cdn/cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="/fullWorker-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="/fullWorker-DXT06v.js",e="/subWorker-caziyz.js";exports.fullWorkerUrl=r;exports.subWorkerUrl=e;
|