@mlightcad/cad-simple-viewer 1.4.7 → 1.4.8

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 (177) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +88 -88
  3. package/dist/index.js +6014 -5042
  4. package/dist/index.umd.cjs +22 -22
  5. package/lib/app/AcApAnnotation.d.ts +46 -0
  6. package/lib/app/AcApAnnotation.d.ts.map +1 -0
  7. package/lib/app/AcApAnnotation.js +134 -0
  8. package/lib/app/AcApAnnotation.js.map +1 -0
  9. package/lib/app/AcApDocManager.d.ts +118 -6
  10. package/lib/app/AcApDocManager.d.ts.map +1 -1
  11. package/lib/app/AcApDocManager.js +162 -6
  12. package/lib/app/AcApDocManager.js.map +1 -1
  13. package/lib/app/AcApDocument.d.ts +16 -14
  14. package/lib/app/AcApDocument.d.ts.map +1 -1
  15. package/lib/app/AcApDocument.js +48 -31
  16. package/lib/app/AcApDocument.js.map +1 -1
  17. package/lib/app/AcDbOpenDatabaseOptions.d.ts +28 -0
  18. package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -0
  19. package/lib/app/AcDbOpenDatabaseOptions.js +2 -0
  20. package/lib/app/AcDbOpenDatabaseOptions.js.map +1 -0
  21. package/lib/app/index.d.ts +2 -0
  22. package/lib/app/index.d.ts.map +1 -1
  23. package/lib/app/index.js +2 -0
  24. package/lib/app/index.js.map +1 -1
  25. package/lib/command/AcApBaseRevCmd.d.ts +36 -0
  26. package/lib/command/AcApBaseRevCmd.d.ts.map +1 -0
  27. package/lib/command/AcApBaseRevCmd.js +68 -0
  28. package/lib/command/AcApBaseRevCmd.js.map +1 -0
  29. package/lib/command/AcApCircleCmd.d.ts +1 -0
  30. package/lib/command/AcApCircleCmd.d.ts.map +1 -1
  31. package/lib/command/AcApCircleCmd.js +4 -2
  32. package/lib/command/AcApCircleCmd.js.map +1 -1
  33. package/lib/command/AcApConvertToSvgCmd.d.ts +1 -1
  34. package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -1
  35. package/lib/command/AcApConvertToSvgCmd.js +44 -2
  36. package/lib/command/AcApConvertToSvgCmd.js.map +1 -1
  37. package/lib/command/AcApDimLinearCmd.d.ts +1 -0
  38. package/lib/command/AcApDimLinearCmd.d.ts.map +1 -1
  39. package/lib/command/AcApDimLinearCmd.js +4 -2
  40. package/lib/command/AcApDimLinearCmd.js.map +1 -1
  41. package/lib/command/AcApEraseCmd.d.ts +1 -0
  42. package/lib/command/AcApEraseCmd.d.ts.map +1 -1
  43. package/lib/command/AcApEraseCmd.js +14 -4
  44. package/lib/command/AcApEraseCmd.js.map +1 -1
  45. package/lib/command/AcApLineCmd.d.ts +1 -0
  46. package/lib/command/AcApLineCmd.d.ts.map +1 -1
  47. package/lib/command/AcApLineCmd.js +4 -2
  48. package/lib/command/AcApLineCmd.js.map +1 -1
  49. package/lib/command/AcApLogCmd.d.ts +1 -1
  50. package/lib/command/AcApLogCmd.d.ts.map +1 -1
  51. package/lib/command/AcApLogCmd.js +44 -3
  52. package/lib/command/AcApLogCmd.js.map +1 -1
  53. package/lib/command/AcApOpenCmd.d.ts +1 -1
  54. package/lib/command/AcApOpenCmd.d.ts.map +1 -1
  55. package/lib/command/AcApOpenCmd.js +42 -1
  56. package/lib/command/AcApOpenCmd.js.map +1 -1
  57. package/lib/command/AcApPanCmd.d.ts +1 -1
  58. package/lib/command/AcApPanCmd.d.ts.map +1 -1
  59. package/lib/command/AcApPanCmd.js +43 -2
  60. package/lib/command/AcApPanCmd.js.map +1 -1
  61. package/lib/command/AcApQNewCmd.d.ts +1 -1
  62. package/lib/command/AcApQNewCmd.d.ts.map +1 -1
  63. package/lib/command/AcApQNewCmd.js +44 -2
  64. package/lib/command/AcApQNewCmd.js.map +1 -1
  65. package/lib/command/AcApRectCmd.d.ts +23 -0
  66. package/lib/command/AcApRectCmd.d.ts.map +1 -0
  67. package/lib/command/AcApRectCmd.js +134 -0
  68. package/lib/command/AcApRectCmd.js.map +1 -0
  69. package/lib/command/AcApRegenCmd.d.ts +1 -1
  70. package/lib/command/AcApRegenCmd.d.ts.map +1 -1
  71. package/lib/command/AcApRegenCmd.js +42 -1
  72. package/lib/command/AcApRegenCmd.js.map +1 -1
  73. package/lib/command/AcApRevCircleCmd.d.ts +10 -0
  74. package/lib/command/AcApRevCircleCmd.d.ts.map +1 -0
  75. package/lib/command/AcApRevCircleCmd.js +83 -0
  76. package/lib/command/AcApRevCircleCmd.js.map +1 -0
  77. package/lib/command/AcApRevCloudCmd.d.ts +26 -0
  78. package/lib/command/AcApRevCloudCmd.d.ts.map +1 -0
  79. package/lib/command/AcApRevCloudCmd.js +234 -0
  80. package/lib/command/AcApRevCloudCmd.js.map +1 -0
  81. package/lib/command/AcApRevRectCmd.d.ts +10 -0
  82. package/lib/command/AcApRevRectCmd.d.ts.map +1 -0
  83. package/lib/command/AcApRevRectCmd.js +83 -0
  84. package/lib/command/AcApRevRectCmd.js.map +1 -0
  85. package/lib/command/AcApRevVisibilityCmd.d.ts +15 -0
  86. package/lib/command/AcApRevVisibilityCmd.d.ts.map +1 -0
  87. package/lib/command/AcApRevVisibilityCmd.js +90 -0
  88. package/lib/command/AcApRevVisibilityCmd.js.map +1 -0
  89. package/lib/command/AcApSelectCmd.d.ts +1 -1
  90. package/lib/command/AcApSelectCmd.d.ts.map +1 -1
  91. package/lib/command/AcApSelectCmd.js +43 -2
  92. package/lib/command/AcApSelectCmd.js.map +1 -1
  93. package/lib/command/AcApSketchCmd.d.ts +32 -0
  94. package/lib/command/AcApSketchCmd.d.ts.map +1 -0
  95. package/lib/command/AcApSketchCmd.js +171 -0
  96. package/lib/command/AcApSketchCmd.js.map +1 -0
  97. package/lib/command/AcApSwitchBgCmd.d.ts +15 -0
  98. package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -0
  99. package/lib/command/AcApSwitchBgCmd.js +88 -0
  100. package/lib/command/AcApSwitchBgCmd.js.map +1 -0
  101. package/lib/command/AcApSysVarCmd.d.ts +2 -1
  102. package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
  103. package/lib/command/AcApSysVarCmd.js +6 -5
  104. package/lib/command/AcApSysVarCmd.js.map +1 -1
  105. package/lib/command/AcApZoomCmd.d.ts +1 -1
  106. package/lib/command/AcApZoomCmd.d.ts.map +1 -1
  107. package/lib/command/AcApZoomCmd.js +42 -1
  108. package/lib/command/AcApZoomCmd.js.map +1 -1
  109. package/lib/command/index.d.ts +8 -0
  110. package/lib/command/index.d.ts.map +1 -1
  111. package/lib/command/index.js +8 -0
  112. package/lib/command/index.js.map +1 -1
  113. package/lib/editor/command/AcEdCommand.d.ts +81 -22
  114. package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
  115. package/lib/editor/command/AcEdCommand.js +157 -15
  116. package/lib/editor/command/AcEdCommand.js.map +1 -1
  117. package/lib/editor/command/AcEdCommandIterator.d.ts +1 -1
  118. package/lib/editor/command/AcEdCommandIterator.d.ts.map +1 -1
  119. package/lib/editor/command/AcEdCommandStack.d.ts +31 -6
  120. package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
  121. package/lib/editor/command/AcEdCommandStack.js +55 -11
  122. package/lib/editor/command/AcEdCommandStack.js.map +1 -1
  123. package/lib/editor/input/AcEditor.d.ts +14 -0
  124. package/lib/editor/input/AcEditor.d.ts.map +1 -1
  125. package/lib/editor/input/AcEditor.js +5 -1
  126. package/lib/editor/input/AcEditor.js.map +1 -1
  127. package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
  128. package/lib/editor/input/ui/AcEdCommandLine.js +2 -2
  129. package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
  130. package/lib/editor/view/AcEdOpenMode.d.ts +26 -0
  131. package/lib/editor/view/AcEdOpenMode.d.ts.map +1 -0
  132. package/lib/editor/view/AcEdOpenMode.js +27 -0
  133. package/lib/editor/view/AcEdOpenMode.js.map +1 -0
  134. package/lib/editor/view/index.d.ts +2 -0
  135. package/lib/editor/view/index.d.ts.map +1 -1
  136. package/lib/editor/view/index.js +2 -0
  137. package/lib/editor/view/index.js.map +1 -1
  138. package/lib/i18n/en/command.d.ts +18 -0
  139. package/lib/i18n/en/command.d.ts.map +1 -1
  140. package/lib/i18n/en/command.js +19 -1
  141. package/lib/i18n/en/command.js.map +1 -1
  142. package/lib/i18n/en/jig.d.ts +8 -0
  143. package/lib/i18n/en/jig.d.ts.map +1 -1
  144. package/lib/i18n/en/jig.js +8 -0
  145. package/lib/i18n/en/jig.js.map +1 -1
  146. package/lib/i18n/zh/command.d.ts +18 -0
  147. package/lib/i18n/zh/command.d.ts.map +1 -1
  148. package/lib/i18n/zh/command.js +18 -0
  149. package/lib/i18n/zh/command.js.map +1 -1
  150. package/lib/i18n/zh/jig.d.ts +8 -0
  151. package/lib/i18n/zh/jig.d.ts.map +1 -1
  152. package/lib/i18n/zh/jig.js +8 -0
  153. package/lib/i18n/zh/jig.js.map +1 -1
  154. package/lib/index.d.ts +1 -0
  155. package/lib/index.d.ts.map +1 -1
  156. package/lib/index.js +1 -0
  157. package/lib/index.js.map +1 -1
  158. package/lib/plugin/AcApPlugin.d.ts +83 -0
  159. package/lib/plugin/AcApPlugin.d.ts.map +1 -0
  160. package/lib/plugin/AcApPlugin.js +2 -0
  161. package/lib/plugin/AcApPlugin.js.map +1 -0
  162. package/lib/plugin/AcApPluginExample.d.ts +23 -0
  163. package/lib/plugin/AcApPluginExample.d.ts.map +1 -0
  164. package/lib/plugin/AcApPluginExample.js +160 -0
  165. package/lib/plugin/AcApPluginExample.js.map +1 -0
  166. package/lib/plugin/AcApPluginManager.d.ts +206 -0
  167. package/lib/plugin/AcApPluginManager.d.ts.map +1 -0
  168. package/lib/plugin/AcApPluginManager.js +499 -0
  169. package/lib/plugin/AcApPluginManager.js.map +1 -0
  170. package/lib/plugin/index.d.ts +4 -0
  171. package/lib/plugin/index.d.ts.map +1 -0
  172. package/lib/plugin/index.js +4 -0
  173. package/lib/plugin/index.js.map +1 -0
  174. package/lib/view/AcTrView2d.d.ts.map +1 -1
  175. package/lib/view/AcTrView2d.js +8 -1
  176. package/lib/view/AcTrView2d.js.map +1 -1
  177. package/package.json +5 -5
@@ -12,6 +12,14 @@ declare const _default: {
12
12
  firstPoint: string;
13
13
  nextPoint: string;
14
14
  };
15
+ rect: {
16
+ firstPoint: string;
17
+ nextPoint: string;
18
+ };
19
+ sketch: {
20
+ firstPoint: string;
21
+ nextPoint: string;
22
+ };
15
23
  sysvar: {
16
24
  prompt: string;
17
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"jig.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/jig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,wBAiBC"}
1
+ {"version":3,"file":"jig.d.ts","sourceRoot":"","sources":["../../../src/i18n/en/jig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyBC"}
@@ -12,6 +12,14 @@ export default {
12
12
  firstPoint: 'Specify the first point:',
13
13
  nextPoint: 'Specify the next point:'
14
14
  },
15
+ rect: {
16
+ firstPoint: 'Specify the first point:',
17
+ nextPoint: 'Specify the next point:'
18
+ },
19
+ sketch: {
20
+ firstPoint: 'Specify the first point:',
21
+ nextPoint: 'Specify the end point:'
22
+ },
15
23
  sysvar: {
16
24
  prompt: 'Please input new value:'
17
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jig.js","sourceRoot":"","sources":["../../../src/i18n/en/jig.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,MAAM,EAAE;QACN,MAAM,EAAE,+BAA+B;QACvC,MAAM,EAAE,+BAA+B;KACxC;IACD,SAAS,EAAE;QACT,WAAW,EAAE,0CAA0C;QACvD,WAAW,EAAE,2CAA2C;QACxD,YAAY,EAAE,kCAAkC;KACjD;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,0BAA0B;QACtC,SAAS,EAAE,yBAAyB;KACrC;IACD,MAAM,EAAE;QACN,MAAM,EAAE,yBAAyB;KAClC;CACF,CAAA"}
1
+ {"version":3,"file":"jig.js","sourceRoot":"","sources":["../../../src/i18n/en/jig.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,MAAM,EAAE;QACN,MAAM,EAAE,+BAA+B;QACvC,MAAM,EAAE,+BAA+B;KACxC;IACD,SAAS,EAAE;QACT,WAAW,EAAE,0CAA0C;QACvD,WAAW,EAAE,2CAA2C;QACxD,YAAY,EAAE,kCAAkC;KACjD;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,0BAA0B;QACtC,SAAS,EAAE,yBAAyB;KACrC;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,0BAA0B;QACtC,SAAS,EAAE,yBAAyB;KACrC;IACD,MAAM,EAAE;QACN,UAAU,EAAE,0BAA0B;QACtC,SAAS,EAAE,wBAAwB;KACpC;IACD,MAAM,EAAE;QACN,MAAM,EAAE,yBAAyB;KAClC;CACF,CAAA"}
@@ -1,5 +1,11 @@
1
1
  declare const _default: {
2
2
  ACAD: {
3
+ cecolor: {
4
+ description: string;
5
+ };
6
+ clayer: {
7
+ description: string;
8
+ };
3
9
  circle: {
4
10
  description: string;
5
11
  };
@@ -31,12 +37,24 @@ declare const _default: {
31
37
  qnew: {
32
38
  description: string;
33
39
  };
40
+ rectangle: {
41
+ description: string;
42
+ };
34
43
  regen: {
35
44
  description: string;
36
45
  };
46
+ revcloud: {
47
+ description: string;
48
+ };
37
49
  select: {
38
50
  description: string;
39
51
  };
52
+ sketch: {
53
+ description: string;
54
+ };
55
+ whitebkcolor: {
56
+ description: string;
57
+ };
40
58
  zoom: {
41
59
  description: string;
42
60
  };
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/i18n/zh/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBA+CC"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../src/i18n/zh/command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAiEC"}
@@ -1,5 +1,11 @@
1
1
  export default {
2
2
  ACAD: {
3
+ cecolor: {
4
+ description: '设置新创建对象的当前默认颜色'
5
+ },
6
+ clayer: {
7
+ description: '设置新建对象和编辑操作所使用的当前图层'
8
+ },
3
9
  circle: {
4
10
  description: '使用圆心和半径创建圆'
5
11
  },
@@ -31,12 +37,24 @@ export default {
31
37
  qnew: {
32
38
  description: '创建新图纸'
33
39
  },
40
+ rectangle: {
41
+ description: '通过指定两个对角点创建矩形'
42
+ },
34
43
  regen: {
35
44
  description: '重绘图纸'
36
45
  },
46
+ revcloud: {
47
+ description: '创建矩形云线(修订云线)'
48
+ },
37
49
  select: {
38
50
  description: '选择图元'
39
51
  },
52
+ sketch: {
53
+ description: '使用多段线创建手绘线,跟踪鼠标移动'
54
+ },
55
+ whitebkcolor: {
56
+ description: '切换绘图区域背景颜色,在白色和黑色背景之间切换'
57
+ },
40
58
  zoom: {
41
59
  description: '缩放以显示所有对象'
42
60
  },
@@ -1 +1 @@
1
- {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/i18n/zh/command.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE;QACJ,MAAM,EAAE;YACN,WAAW,EAAE,YAAY;SAC1B;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,cAAc;SAC5B;QACD,SAAS,EAAE;YACT,WAAW,EAAE,UAAU;SACxB;QACD,KAAK,EAAE;YACL,WAAW,EAAE,YAAY;YACzB,MAAM,EAAE,MAAM;SACf;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,aAAa;SAC3B;QACD,GAAG,EAAE;YACH,WAAW,EAAE,YAAY;SAC1B;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,MAAM;SACpB;QACD,GAAG,EAAE;YACH,WAAW,EAAE,MAAM;SACpB;QACD,OAAO,EAAE;YACP,WAAW,EAAE,oBAAoB;SAClC;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,OAAO;SACrB;QACD,KAAK,EAAE;YACL,WAAW,EAAE,MAAM;SACpB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,MAAM;SACpB;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,WAAW;SACzB;QACD,KAAK,EAAE;YACL,WAAW,EAAE,eAAe;SAC7B;KACF;IACD,IAAI,EAAE,EAAE;CACT,CAAA"}
1
+ {"version":3,"file":"command.js","sourceRoot":"","sources":["../../../src/i18n/zh/command.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,IAAI,EAAE;QACJ,OAAO,EAAE;YACP,WAAW,EAAE,gBAAgB;SAC9B;QACD,MAAM,EAAE;YACN,WAAW,EAAE,qBAAqB;SACnC;QACD,MAAM,EAAE;YACN,WAAW,EAAE,YAAY;SAC1B;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,cAAc;SAC5B;QACD,SAAS,EAAE;YACT,WAAW,EAAE,UAAU;SACxB;QACD,KAAK,EAAE;YACL,WAAW,EAAE,YAAY;YACzB,MAAM,EAAE,MAAM;SACf;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,aAAa;SAC3B;QACD,GAAG,EAAE;YACH,WAAW,EAAE,YAAY;SAC1B;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,MAAM;SACpB;QACD,GAAG,EAAE;YACH,WAAW,EAAE,MAAM;SACpB;QACD,OAAO,EAAE;YACP,WAAW,EAAE,oBAAoB;SAClC;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,OAAO;SACrB;QACD,SAAS,EAAE;YACT,WAAW,EAAE,eAAe;SAC7B;QACD,KAAK,EAAE;YACL,WAAW,EAAE,MAAM;SACpB;QACD,QAAQ,EAAE;YACR,WAAW,EAAE,cAAc;SAC5B;QACD,MAAM,EAAE;YACN,WAAW,EAAE,MAAM;SACpB;QACD,MAAM,EAAE;YACN,WAAW,EAAE,mBAAmB;SACjC;QACD,YAAY,EAAE;YACZ,WAAW,EAAE,yBAAyB;SACvC;QACD,IAAI,EAAE;YACJ,WAAW,EAAE,WAAW;SACzB;QACD,KAAK,EAAE;YACL,WAAW,EAAE,eAAe;SAC7B;KACF;IACD,IAAI,EAAE,EAAE;CACT,CAAA"}
@@ -12,6 +12,14 @@ declare const _default: {
12
12
  firstPoint: string;
13
13
  nextPoint: string;
14
14
  };
15
+ rect: {
16
+ firstPoint: string;
17
+ nextPoint: string;
18
+ };
19
+ sketch: {
20
+ firstPoint: string;
21
+ nextPoint: string;
22
+ };
15
23
  sysvar: {
16
24
  prompt: string;
17
25
  };
@@ -1 +1 @@
1
- {"version":3,"file":"jig.d.ts","sourceRoot":"","sources":["../../../src/i18n/zh/jig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,wBAiBC"}
1
+ {"version":3,"file":"jig.d.ts","sourceRoot":"","sources":["../../../src/i18n/zh/jig.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wBAyBC"}
@@ -12,6 +12,14 @@ export default {
12
12
  firstPoint: '指定第一个点:',
13
13
  nextPoint: '指定下一个点:'
14
14
  },
15
+ rect: {
16
+ firstPoint: '指定第一个点:',
17
+ nextPoint: '指定下一个点:'
18
+ },
19
+ sketch: {
20
+ firstPoint: '指定第一个点:',
21
+ nextPoint: '指定结束点:'
22
+ },
15
23
  sysvar: {
16
24
  prompt: '请输入新的值:'
17
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"jig.js","sourceRoot":"","sources":["../../../src/i18n/zh/jig.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,MAAM,EAAE;QACN,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB;IACD,SAAS,EAAE;QACT,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,cAAc;QAC3B,YAAY,EAAE,UAAU;KACzB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,SAAS;KACrB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,SAAS;KAClB;CACF,CAAA"}
1
+ {"version":3,"file":"jig.js","sourceRoot":"","sources":["../../../src/i18n/zh/jig.ts"],"names":[],"mappings":"AAAA,eAAe;IACb,MAAM,EAAE;QACN,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;KAClB;IACD,SAAS,EAAE;QACT,WAAW,EAAE,cAAc;QAC3B,WAAW,EAAE,cAAc;QAC3B,YAAY,EAAE,UAAU;KACzB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,SAAS;KACrB;IACD,IAAI,EAAE;QACJ,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,SAAS;KACrB;IACD,MAAM,EAAE;QACN,UAAU,EAAE,SAAS;QACrB,SAAS,EAAE,QAAQ;KACpB;IACD,MAAM,EAAE;QACN,MAAM,EAAE,SAAS;KAClB;CACF,CAAA"}
package/lib/index.d.ts CHANGED
@@ -2,5 +2,6 @@ export * from './app';
2
2
  export * from './command';
3
3
  export * from './editor';
4
4
  export * from './i18n';
5
+ export * from './plugin';
5
6
  export * from './view';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
package/lib/index.js CHANGED
@@ -2,5 +2,6 @@ export * from './app';
2
2
  export * from './command';
3
3
  export * from './editor';
4
4
  export * from './i18n';
5
+ export * from './plugin';
5
6
  export * from './view';
6
7
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
@@ -0,0 +1,83 @@
1
+ import { AcApContext } from '../app/AcApContext';
2
+ import { AcEdCommandStack } from '../editor/command/AcEdCommandStack';
3
+ /**
4
+ * Plugin interface that all plugins must implement.
5
+ *
6
+ * Plugins can extend the functionality of the CAD viewer by:
7
+ * - Registering custom commands
8
+ * - Accessing the application context (view, document)
9
+ * - Performing initialization and cleanup
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * class MyPlugin implements AcApPlugin {
14
+ * name = 'MyPlugin'
15
+ * version = '1.0.0'
16
+ *
17
+ * private registeredCommands: Array<{group: string, name: string}> = []
18
+ *
19
+ * onLoad(context: AcApContext, commandManager: AcEdCommandStack): void {
20
+ * // Register custom commands
21
+ * commandManager.addCommand('USER', 'MYCMD', 'My Command', new MyCommand())
22
+ * this.registeredCommands.push({group: 'USER', name: 'MYCMD'})
23
+ * }
24
+ *
25
+ * onUnload(context: AcApContext, commandManager: AcEdCommandStack): void {
26
+ * // Clean up registered commands
27
+ * for (const cmd of this.registeredCommands) {
28
+ * commandManager.removeCmd(cmd.group, cmd.name)
29
+ * }
30
+ * this.registeredCommands = []
31
+ * }
32
+ * }
33
+ * ```
34
+ */
35
+ export interface AcApPlugin {
36
+ /** Unique identifier for the plugin */
37
+ name: string;
38
+ /** Version of the plugin */
39
+ version?: string;
40
+ /** Optional description of the plugin */
41
+ description?: string;
42
+ /**
43
+ * Called when the plugin is loaded.
44
+ *
45
+ * This method is invoked when the plugin is registered with the plugin manager.
46
+ * Use this method to:
47
+ * - Register custom commands using the provided command manager
48
+ * - Initialize plugin-specific resources
49
+ * - Set up event listeners
50
+ *
51
+ * @param context - The current application context (view, document)
52
+ * @param commandManager - The command manager for registering commands
53
+ *
54
+ * @example
55
+ * ```typescript
56
+ * onLoad(context: AcApContext, commandManager: AcEdCommandStack) {
57
+ * commandManager.addCommand('USER', 'MYCMD', 'My Command', new MyCommand());
58
+ * }
59
+ * ```
60
+ */
61
+ onLoad(context: AcApContext, commandManager: AcEdCommandStack): void | Promise<void>;
62
+ /**
63
+ * Called when the plugin is unloaded.
64
+ *
65
+ * This method is invoked when the plugin is removed from the plugin manager.
66
+ * Use this method to:
67
+ * - Clean up registered commands using commandManager.removeCmd()
68
+ * - Release resources
69
+ * - Remove event listeners
70
+ *
71
+ * @param context - The current application context (view, document)
72
+ * @param commandManager - The command manager for unregistering commands
73
+ *
74
+ * @example
75
+ * ```typescript
76
+ * onUnload(context: AcApContext, commandManager: AcEdCommandStack) {
77
+ * commandManager.removeCmd('USER', 'MYCMD');
78
+ * }
79
+ * ```
80
+ */
81
+ onUnload(context: AcApContext, commandManager: AcEdCommandStack): void | Promise<void>;
82
+ }
83
+ //# sourceMappingURL=AcApPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApPlugin.d.ts","sourceRoot":"","sources":["../../src/plugin/AcApPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AAErE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,UAAU;IACzB,uCAAuC;IACvC,IAAI,EAAE,MAAM,CAAA;IACZ,4BAA4B;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,yCAAyC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CACJ,OAAO,EAAE,WAAW,EACpB,cAAc,EAAE,gBAAgB,GAC/B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEvB;;;;;;;;;;;;;;;;;;OAkBG;IACH,QAAQ,CACN,OAAO,EAAE,WAAW,EACpB,cAAc,EAAE,gBAAgB,GAC/B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACxB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=AcApPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApPlugin.js","sourceRoot":"","sources":["../../src/plugin/AcApPlugin.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { AcApContext } from '../app/AcApContext';
2
+ import { AcEdCommandStack } from '../editor/command/AcEdCommandStack';
3
+ import { AcApPlugin } from './AcApPlugin';
4
+ /**
5
+ * Example plugin implementation.
6
+ */
7
+ export declare class AcApExamplePlugin implements AcApPlugin {
8
+ name: string;
9
+ version: string;
10
+ description: string;
11
+ private registeredCommands;
12
+ /**
13
+ * Called when the plugin is loaded.
14
+ * Register custom commands here.
15
+ */
16
+ onLoad(_context: AcApContext, commandManager: AcEdCommandStack): void;
17
+ /**
18
+ * Called when the plugin is unloaded.
19
+ * Clean up registered commands and other resources here.
20
+ */
21
+ onUnload(_context: AcApContext, commandManager: AcEdCommandStack): void;
22
+ }
23
+ //# sourceMappingURL=AcApPluginExample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApPluginExample.d.ts","sourceRoot":"","sources":["../../src/plugin/AcApPluginExample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAsCzC;;GAEG;AACH,qBAAa,iBAAkB,YAAW,UAAU;IAClD,IAAI,SAAkB;IACtB,OAAO,SAAU;IACjB,WAAW,SAAsD;IAGjE,OAAO,CAAC,kBAAkB,CAA6C;IAEvE;;;OAGG;IACH,MAAM,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,GAAG,IAAI;IAgBrE;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,GAAG,IAAI;CASxE"}
@@ -0,0 +1,160 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
17
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
18
+ return new (P || (P = Promise))(function (resolve, reject) {
19
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
20
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
21
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
22
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
23
+ });
24
+ };
25
+ var __generator = (this && this.__generator) || function (thisArg, body) {
26
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
27
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
28
+ function verb(n) { return function (v) { return step([n, v]); }; }
29
+ function step(op) {
30
+ if (f) throw new TypeError("Generator is already executing.");
31
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
32
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
33
+ if (y = 0, t) op = [op[0] & 2, t.value];
34
+ switch (op[0]) {
35
+ case 0: case 1: t = op; break;
36
+ case 4: _.label++; return { value: op[1], done: false };
37
+ case 5: _.label++; y = op[1]; op = [0]; continue;
38
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
39
+ default:
40
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
41
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
42
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
43
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
44
+ if (t[2]) _.ops.pop();
45
+ _.trys.pop(); continue;
46
+ }
47
+ op = body.call(thisArg, _);
48
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
49
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
50
+ }
51
+ };
52
+ var __values = (this && this.__values) || function(o) {
53
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
54
+ if (m) return m.call(o);
55
+ if (o && typeof o.length === "number") return {
56
+ next: function () {
57
+ if (o && i >= o.length) o = void 0;
58
+ return { value: o && o[i++], done: !o };
59
+ }
60
+ };
61
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
62
+ };
63
+ import { AcEdCommand } from '../editor/command/AcEdCommand';
64
+ /**
65
+ * Example plugin demonstrating how to create and use plugins in cad-simple-viewer.
66
+ *
67
+ * This example shows:
68
+ * - How to implement the AcApPlugin interface
69
+ * - How to register custom commands in the onLoad hook
70
+ * - How to clean up resources in the onUnload hook
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * import { AcApDocManager } from '@mlightcad/cad-simple-viewer';
75
+ * import { ExamplePlugin } from './AcApPluginExample';
76
+ *
77
+ * // Load the plugin
78
+ * const plugin = new ExamplePlugin();
79
+ * await AcApDocManager.instance.pluginManager.loadPlugin(plugin);
80
+ *
81
+ * // The plugin's commands are now available
82
+ * // You can execute them via: docManager.sendStringToExecute('HELLO');
83
+ *
84
+ * // Unload the plugin when done
85
+ * await AcApDocManager.instance.pluginManager.unloadPlugin('ExamplePlugin');
86
+ * ```
87
+ */
88
+ /**
89
+ * Example command that prints a greeting message.
90
+ */
91
+ var AcApHelloCommand = /** @class */ (function (_super) {
92
+ __extends(AcApHelloCommand, _super);
93
+ function AcApHelloCommand() {
94
+ return _super !== null && _super.apply(this, arguments) || this;
95
+ }
96
+ AcApHelloCommand.prototype.execute = function (context) {
97
+ return __awaiter(this, void 0, void 0, function () {
98
+ return __generator(this, function (_a) {
99
+ console.log('Hello from ExamplePlugin!');
100
+ console.log('Current document:', context.doc);
101
+ console.log('Current view:', context.view);
102
+ return [2 /*return*/];
103
+ });
104
+ });
105
+ };
106
+ return AcApHelloCommand;
107
+ }(AcEdCommand));
108
+ /**
109
+ * Example plugin implementation.
110
+ */
111
+ var AcApExamplePlugin = /** @class */ (function () {
112
+ function AcApExamplePlugin() {
113
+ this.name = 'ExamplePlugin';
114
+ this.version = '1.0.0';
115
+ this.description = 'An example plugin demonstrating the plugin system';
116
+ // Track registered commands for cleanup
117
+ this.registeredCommands = [];
118
+ }
119
+ /**
120
+ * Called when the plugin is loaded.
121
+ * Register custom commands here.
122
+ */
123
+ AcApExamplePlugin.prototype.onLoad = function (_context, commandManager) {
124
+ // Register a custom command
125
+ commandManager.addCommand('USER', // Command group
126
+ 'HELLO', // Global command name
127
+ 'Hello', // Local command name
128
+ new AcApHelloCommand());
129
+ // Track the command for cleanup
130
+ this.registeredCommands.push({ group: 'USER', name: 'HELLO' });
131
+ console.log("[".concat(this.name, "] Plugin loaded successfully"));
132
+ console.log("[".concat(this.name, "] Registered command: HELLO"));
133
+ };
134
+ /**
135
+ * Called when the plugin is unloaded.
136
+ * Clean up registered commands and other resources here.
137
+ */
138
+ AcApExamplePlugin.prototype.onUnload = function (_context, commandManager) {
139
+ var e_1, _a;
140
+ try {
141
+ // Remove all registered commands
142
+ for (var _b = __values(this.registeredCommands), _c = _b.next(); !_c.done; _c = _b.next()) {
143
+ var cmd = _c.value;
144
+ commandManager.removeCmd(cmd.group, cmd.name);
145
+ }
146
+ }
147
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
148
+ finally {
149
+ try {
150
+ if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
151
+ }
152
+ finally { if (e_1) throw e_1.error; }
153
+ }
154
+ this.registeredCommands = [];
155
+ console.log("[".concat(this.name, "] Plugin unloaded"));
156
+ };
157
+ return AcApExamplePlugin;
158
+ }());
159
+ export { AcApExamplePlugin };
160
+ //# sourceMappingURL=AcApPluginExample.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApPluginExample.js","sourceRoot":"","sources":["../../src/plugin/AcApPluginExample.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAA;AAI3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;GAEG;AACH;IAA+B,oCAAW;IAA1C;;IAMA,CAAC;IALO,kCAAO,GAAb,UAAc,OAAoB;;;gBAChC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAA;gBACxC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA;gBAC7C,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,CAAC,CAAA;;;;KAC3C;IACH,uBAAC;AAAD,CAAC,AAND,CAA+B,WAAW,GAMzC;AAED;;GAEG;AACH;IAAA;QACE,SAAI,GAAG,eAAe,CAAA;QACtB,YAAO,GAAG,OAAO,CAAA;QACjB,gBAAW,GAAG,mDAAmD,CAAA;QAEjE,wCAAwC;QAChC,uBAAkB,GAA2C,EAAE,CAAA;IAmCzE,CAAC;IAjCC;;;OAGG;IACH,kCAAM,GAAN,UAAO,QAAqB,EAAE,cAAgC;QAC5D,4BAA4B;QAC5B,cAAc,CAAC,UAAU,CACvB,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,sBAAsB;QAC/B,OAAO,EAAE,qBAAqB;QAC9B,IAAI,gBAAgB,EAAE,CACvB,CAAA;QAED,gCAAgC;QAChC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;QAE9D,OAAO,CAAC,GAAG,CAAC,WAAI,IAAI,CAAC,IAAI,iCAA8B,CAAC,CAAA;QACxD,OAAO,CAAC,GAAG,CAAC,WAAI,IAAI,CAAC,IAAI,gCAA6B,CAAC,CAAA;IACzD,CAAC;IAED;;;OAGG;IACH,oCAAQ,GAAR,UAAS,QAAqB,EAAE,cAAgC;;;YAC9D,iCAAiC;YACjC,KAAkB,IAAA,KAAA,SAAA,IAAI,CAAC,kBAAkB,CAAA,gBAAA,4BAAE,CAAC;gBAAvC,IAAM,GAAG,WAAA;gBACZ,cAAc,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;YAC/C,CAAC;;;;;;;;;QACD,IAAI,CAAC,kBAAkB,GAAG,EAAE,CAAA;QAE5B,OAAO,CAAC,GAAG,CAAC,WAAI,IAAI,CAAC,IAAI,sBAAmB,CAAC,CAAA;IAC/C,CAAC;IACH,wBAAC;AAAD,CAAC,AAzCD,IAyCC"}