@netless/appliance-plugin 1.1.34-beta.3 → 1.1.35-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 (51) hide show
  1. package/READMA.zh-CN.md +33 -1
  2. package/README.md +32 -0
  3. package/cdn/cdn.js +1 -1
  4. package/cdn/fullWorker-BShzOf.js +486 -0
  5. package/cdn/subWorker-DofGU2.js +486 -0
  6. package/dist/appliance-plugin.js +1 -1
  7. package/dist/appliance-plugin.mjs +1 -1
  8. package/dist/assets/fullWorker-BLBp1QlT.js +593 -0
  9. package/dist/assets/subWorker-CA5sK8hX.js +593 -0
  10. package/dist/{bridge-Bb-MjyNY.mjs → bridge-D6IerdOk.mjs} +6 -6
  11. package/dist/{bridge-m2Uim0rf.js → bridge-s6K3XU2g.js} +1 -1
  12. package/dist/bridge.js +1 -1
  13. package/dist/bridge.mjs +1 -1
  14. package/dist/core/autoShape/index.d.ts +12 -0
  15. package/dist/core/autoShape/mapper.d.ts +3 -0
  16. package/dist/core/autoShape/recognizer.d.ts +8 -0
  17. package/dist/core/autoShape/registry.d.ts +2 -0
  18. package/dist/core/autoShape/templates.d.ts +2 -0
  19. package/dist/core/autoShape/types.d.ts +78 -0
  20. package/dist/core/mainEngine.d.ts +9 -0
  21. package/dist/core/tools/pencil.d.ts +3 -0
  22. package/dist/core/types.d.ts +7 -0
  23. package/dist/fullWorker.js +147 -147
  24. package/dist/index-328yD4vj.js +1 -0
  25. package/dist/{index-B5p02yLM.mjs → index-4k563Sm-.mjs} +3076 -2293
  26. package/dist/index-C89lvDjQ.js +1 -0
  27. package/dist/{index-C-ITXa9_.js → index-CBE_U7Gn.js} +3 -3
  28. package/dist/{index-BAEfMWKR.mjs → index-CPmHcL9u.mjs} +1041 -1013
  29. package/dist/{index-BbVM6AMN.mjs → index-D-IWIyEl.mjs} +260 -253
  30. package/dist/{index-D9CYiyfx.mjs → index-D1p6YXf0.mjs} +3014 -2238
  31. package/dist/{index-HS0sRcOj.js → index-DDL0Hq_X.js} +3 -3
  32. package/dist/{index-on8Dtynb.mjs → index-DR2km5D4.mjs} +215 -208
  33. package/dist/index-DXx1-O0K.js +1 -0
  34. package/dist/index-DbLWM-6h.js +1 -0
  35. package/dist/{index-O6ldDna3.mjs → index-IQRiGPX7.mjs} +1041 -1013
  36. package/dist/plugin/multi/containerManager.d.ts +7 -0
  37. package/dist/plugin/types.d.ts +24 -0
  38. package/dist/subWorker.js +147 -147
  39. package/dist/svgToImageLoader-B3gIDAQo.js +1 -0
  40. package/dist/svgToImageLoader-DZz5bAo4.mjs +22 -0
  41. package/package.json +11 -5
  42. package/cdn/fullWorker-cY8Uuj.js +0 -486
  43. package/cdn/subWorker-BleGf3.js +0 -486
  44. package/dist/assets/fullWorker-BuSPsz-_.js +0 -593
  45. package/dist/assets/subWorker-B0NfJ2Bk.js +0 -593
  46. package/dist/index-BVYBjZU_.js +0 -1
  47. package/dist/index-D696FwsD.js +0 -1
  48. package/dist/index-DTeRhVER.js +0 -1
  49. package/dist/index-DnT8RFOT.js +0 -1
  50. package/dist/svgToImageLoader-DPRAAhwW.js +0 -1
  51. package/dist/svgToImageLoader-mXH53h-l.mjs +0 -18
package/READMA.zh-CN.md CHANGED
@@ -342,6 +342,36 @@ room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType:
342
342
  ```
343
343
  ![Image](https://github.com/user-attachments/assets/3cd10c3a-b17b-4c01-b9d4-868c69116d96)
344
344
 
345
+ ##### Auto Shape: 一笔快速绘制成图形 (Version >=1.1.33)
346
+ 开启后,用户仍使用 `Pencil` 教具,抬笔时会尝试把这一笔手势识别成规则图形,并直接生成对应的 shape,而不是普通铅笔路径。
347
+
348
+ ```js
349
+ import { ApplianceNames, EStrokeType } from '@netless/appliance-plugin';
350
+
351
+ room.setMemberState({
352
+ currentApplianceName: ApplianceNames.pencil,
353
+ autoShape: true,
354
+ strokeType: EStrokeType.Normal,
355
+ });
356
+ ```
357
+
358
+ 当前版本支持单笔识别以下图形:
359
+
360
+ - `Straight`
361
+ - `Arrow`
362
+ - `Rectangle`
363
+ - `Ellipse / Circle`
364
+ - `Triangle`
365
+ - `Rhombus`
366
+ - `Five-point Star`
367
+
368
+ 建议:
369
+
370
+ - 使用 `Pencil` 教具
371
+ - 尽量一笔完成
372
+ - 闭合绘制矩形、圆/椭圆、三角形、五角星
373
+ - 箭头和直线保持单笔非闭合
374
+
345
375
  ##### 扩展教具 (Version >=1.1.1)
346
376
  在原来的[白板教具](https://doc.shengwang.cn/api-ref/whiteboard/javascript/globals.html#memberstate)类型上,增加了一些扩展功能属性,如下:
347
377
 
@@ -367,6 +397,8 @@ export type ExtendMemberState = {
367
397
  strokeOpacity?: number;
368
398
  /** 是否开启激光笔 */
369
399
  useLaserPen?: boolean;
400
+ /** 是否开启单笔自动识别图形 */
401
+ autoShape?: boolean;
370
402
  /** 激光笔保持时间, second */
371
403
  duration?: number;
372
404
  /** 填充样式 */
@@ -958,4 +990,4 @@ MIT License
958
990
  - [官方文档](https://doc.shengwang.cn/)
959
991
 
960
992
 
961
- ## [changelog](https://github.com/duty-os/appliance-plugin/blob/master/CHANGELOG.md)
993
+ ## [changelog](https://github.com/duty-os/appliance-plugin/blob/master/CHANGELOG.md)
package/README.md CHANGED
@@ -335,6 +335,36 @@ room.setMemberState({currentApplianceName: ApplianceNames.laserPen, strokeType:
335
335
  ```
336
336
  ![Image](https://github.com/user-attachments/assets/3cd10c3a-b17b-4c01-b9d4-868c69116d96)
337
337
 
338
+ ##### Auto Shape: One-stroke Quick Shape Drawing (Version >=1.1.33)
339
+ When enabled, users still draw with the `Pencil` tool. On pointer up, the plugin tries to recognize the completed stroke as a regular shape and outputs the corresponding shape instead of a normal pencil path.
340
+
341
+ ```js
342
+ import { ApplianceNames, EStrokeType } from '@netless/appliance-plugin';
343
+
344
+ room.setMemberState({
345
+ currentApplianceName: ApplianceNames.pencil,
346
+ autoShape: true,
347
+ strokeType: EStrokeType.Normal,
348
+ });
349
+ ```
350
+
351
+ The current version supports single-stroke recognition for:
352
+
353
+ - `Straight`
354
+ - `Arrow`
355
+ - `Rectangle`
356
+ - `Ellipse / Circle`
357
+ - `Triangle`
358
+ - `Rhombus`
359
+ - `Five-point Star`
360
+
361
+ Recommendations:
362
+
363
+ - Use the `Pencil` tool
364
+ - Complete the gesture in one stroke
365
+ - Draw `Rectangle`, `Ellipse / Circle`, `Triangle`, and `Five-point Star` as closed strokes
366
+ - Draw `Arrow` and `Straight` as open single strokes
367
+
338
368
  ##### Extended Tools (Version >=1.1.1)
339
369
  On the original [whiteboard tools](https://api-ref.agora.io/en/interactive-whiteboard-sdk/web/2.x/globals.html#memberstate) type, some extended function attributes have been added, as follows:
340
370
 
@@ -360,6 +390,8 @@ export type ExtendMemberState = {
360
390
  strokeOpacity?: number;
361
391
  /** Whether to enable laser pointer */
362
392
  useLaserPen?: boolean;
393
+ /** Whether to enable one-stroke auto shape recognition */
394
+ autoShape?: boolean;
363
395
  /** Laser pointer holding time, second */
364
396
  duration?: number;
365
397
  /** Fill style */
package/cdn/cdn.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="/fullWorker-cY8Uuj.js",e="/subWorker-BleGf3.js";exports.fullWorkerUrl=r;exports.subWorkerUrl=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r="/fullWorker-BShzOf.js",e="/subWorker-DofGU2.js";exports.fullWorkerUrl=r;exports.subWorkerUrl=e;