@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.
Files changed (73) hide show
  1. package/README.md +107 -9
  2. package/cdn/cdn.js +1 -1
  3. package/cdn/fullWorker-DXT06v.js +441 -0
  4. package/cdn/subWorker-caziyz.js +441 -0
  5. package/dist/appliance-plugin.js +1 -1
  6. package/dist/appliance-plugin.mjs +23 -19
  7. package/dist/collector/base.d.ts +3 -0
  8. package/dist/collector/collector.d.ts +40 -3
  9. package/dist/collector/enum.d.ts +0 -3
  10. package/dist/collector/eventCollector.d.ts +1 -0
  11. package/dist/collector/magixEventCollector.d.ts +1 -0
  12. package/dist/collector/types.d.ts +61 -15
  13. package/dist/component/autoDraw/index.d.ts +54 -0
  14. package/dist/component/miniMap/index.d.ts +1 -0
  15. package/dist/component/miniMap/manager.d.ts +37 -0
  16. package/dist/component/miniMap/view.d.ts +14 -0
  17. package/dist/core/enum.d.ts +56 -6
  18. package/dist/core/mainEngine.d.ts +36 -15
  19. package/dist/core/mainThread/base.d.ts +4 -0
  20. package/dist/core/mainThread/snapshotThread.d.ts +4 -1
  21. package/dist/core/mainThread/subLocalThread.d.ts +6 -6
  22. package/dist/core/mainThread/subServiceThread.d.ts +1 -1
  23. package/dist/core/mainThread/subTopThread.d.ts +2 -2
  24. package/dist/core/mainThread/workerMainThread.d.ts +3 -2
  25. package/dist/core/plugin.d.ts +49 -0
  26. package/dist/core/renderCotrol.d.ts +108 -0
  27. package/dist/core/tools/arrow.d.ts +3 -2
  28. package/dist/core/tools/base.d.ts +39 -5
  29. package/dist/core/tools/ellipse.d.ts +3 -2
  30. package/dist/core/tools/eraser.d.ts +1 -1
  31. package/dist/core/tools/image.d.ts +9 -7
  32. package/dist/core/tools/pencil.d.ts +4 -3
  33. package/dist/core/tools/pencilEraser.d.ts +1 -1
  34. package/dist/core/tools/pencilEraserBitMap.d.ts +21 -6
  35. package/dist/core/tools/polygon.d.ts +3 -2
  36. package/dist/core/tools/rectangle.d.ts +3 -2
  37. package/dist/core/tools/selector.d.ts +2 -2
  38. package/dist/core/tools/speechBalloon.d.ts +3 -2
  39. package/dist/core/tools/star.d.ts +3 -2
  40. package/dist/core/tools/straight.d.ts +3 -2
  41. package/dist/core/tools/utils.d.ts +4 -3
  42. package/dist/core/types.d.ts +16 -11
  43. package/dist/core/utils/math.d.ts +1 -0
  44. package/dist/core/utils/spriteNode.d.ts +9 -3
  45. package/dist/core/vNodeManager.d.ts +14 -3
  46. package/dist/core/worker/base.d.ts +19 -9
  47. package/dist/core/worker/fullWorkerLocal.d.ts +9 -4
  48. package/dist/core/worker/subWorkerTopLayer.d.ts +2 -2
  49. package/dist/core/worker/workerManager.d.ts +2 -2
  50. package/dist/displayer/floatBar/index.d.ts +1 -0
  51. package/dist/extend.d.ts +2 -0
  52. package/dist/fullWorker.js +158 -156
  53. package/dist/{index-C4KNxHht.mjs → index-16eeAu4_.mjs} +874 -862
  54. package/dist/index-BgMemNid.mjs +16918 -0
  55. package/dist/index-Bpx1RNLY.js +1 -0
  56. package/dist/index-D0mDu2PZ.js +1 -0
  57. package/dist/index.d.ts +1 -0
  58. package/dist/members/index.d.ts +1 -0
  59. package/dist/plugin/baseApplianceManager.d.ts +29 -2
  60. package/dist/plugin/baseViewContainerManager.d.ts +3 -2
  61. package/dist/plugin/const.d.ts +6 -4
  62. package/dist/plugin/displayerView.d.ts +2 -0
  63. package/dist/plugin/multi/applianceMultiManager.d.ts +0 -1
  64. package/dist/plugin/types.d.ts +116 -7
  65. package/dist/style.css +1 -1
  66. package/dist/subWorker.js +158 -156
  67. package/dist/undo/index.d.ts +2 -2
  68. package/package.json +6 -7
  69. package/cdn/fullWorker-CjGKnN.js +0 -439
  70. package/cdn/subWorker-DUJqv_.js +0 -439
  71. package/dist/index-C29o_HLi.js +0 -1
  72. package/dist/index-CIJP6_Qj.mjs +0 -14190
  73. 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/hqer927/appliance-plugin/blob/master/READMA.zh-CN.md)
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-CjGKnN.js",e="/subWorker-DUJqv_.js";exports.fullWorkerUrl=r;exports.subWorkerUrl=e;
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;