@mlightcad/cad-simple-viewer 1.2.0 → 1.2.2

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 (197) hide show
  1. package/package.json +6 -6
  2. package/dist/index.js +0 -22197
  3. package/dist/index.umd.cjs +0 -284
  4. package/dist/libredwg-parser-worker.js +0 -15411
  5. package/dist/mtext-renderer-worker.js +0 -18688
  6. package/lib/app/AcApContext.d.ts +0 -57
  7. package/lib/app/AcApContext.d.ts.map +0 -1
  8. package/lib/app/AcApContext.js +0 -106
  9. package/lib/app/AcApContext.js.map +0 -1
  10. package/lib/app/AcApDocManager.d.ts +0 -272
  11. package/lib/app/AcApDocManager.d.ts.map +0 -1
  12. package/lib/app/AcApDocManager.js +0 -485
  13. package/lib/app/AcApDocManager.js.map +0 -1
  14. package/lib/app/AcApDocument.d.ts +0 -101
  15. package/lib/app/AcApDocument.d.ts.map +0 -1
  16. package/lib/app/AcApDocument.js +0 -237
  17. package/lib/app/AcApDocument.js.map +0 -1
  18. package/lib/app/AcApFontLoader.d.ts +0 -56
  19. package/lib/app/AcApFontLoader.d.ts.map +0 -1
  20. package/lib/app/AcApFontLoader.js +0 -159
  21. package/lib/app/AcApFontLoader.js.map +0 -1
  22. package/lib/app/AcApGlobalFunc.d.ts +0 -26
  23. package/lib/app/AcApGlobalFunc.d.ts.map +0 -1
  24. package/lib/app/AcApGlobalFunc.js +0 -66
  25. package/lib/app/AcApGlobalFunc.js.map +0 -1
  26. package/lib/app/AcApSettingManager.d.ts +0 -232
  27. package/lib/app/AcApSettingManager.d.ts.map +0 -1
  28. package/lib/app/AcApSettingManager.js +0 -283
  29. package/lib/app/AcApSettingManager.js.map +0 -1
  30. package/lib/app/index.d.ts +0 -6
  31. package/lib/app/index.d.ts.map +0 -1
  32. package/lib/app/index.js +0 -6
  33. package/lib/app/index.js.map +0 -1
  34. package/lib/command/AcApConvertToSvgCmd.d.ts +0 -32
  35. package/lib/command/AcApConvertToSvgCmd.d.ts.map +0 -1
  36. package/lib/command/AcApConvertToSvgCmd.js +0 -56
  37. package/lib/command/AcApConvertToSvgCmd.js.map +0 -1
  38. package/lib/command/AcApOpenCmd.d.ts +0 -37
  39. package/lib/command/AcApOpenCmd.d.ts.map +0 -1
  40. package/lib/command/AcApOpenCmd.js +0 -60
  41. package/lib/command/AcApOpenCmd.js.map +0 -1
  42. package/lib/command/AcApPanCmd.d.ts +0 -31
  43. package/lib/command/AcApPanCmd.d.ts.map +0 -1
  44. package/lib/command/AcApPanCmd.js +0 -55
  45. package/lib/command/AcApPanCmd.js.map +0 -1
  46. package/lib/command/AcApQNewCmd.d.ts +0 -32
  47. package/lib/command/AcApQNewCmd.d.ts.map +0 -1
  48. package/lib/command/AcApQNewCmd.js +0 -56
  49. package/lib/command/AcApQNewCmd.js.map +0 -1
  50. package/lib/command/AcApSelectCmd.d.ts +0 -32
  51. package/lib/command/AcApSelectCmd.d.ts.map +0 -1
  52. package/lib/command/AcApSelectCmd.js +0 -56
  53. package/lib/command/AcApSelectCmd.js.map +0 -1
  54. package/lib/command/AcApSvgConvertor.d.ts +0 -53
  55. package/lib/command/AcApSvgConvertor.d.ts.map +0 -1
  56. package/lib/command/AcApSvgConvertor.js +0 -103
  57. package/lib/command/AcApSvgConvertor.js.map +0 -1
  58. package/lib/command/AcApZoomCmd.d.ts +0 -35
  59. package/lib/command/AcApZoomCmd.d.ts.map +0 -1
  60. package/lib/command/AcApZoomCmd.js +0 -57
  61. package/lib/command/AcApZoomCmd.js.map +0 -1
  62. package/lib/command/AcApZoomToBoxCmd.d.ts +0 -68
  63. package/lib/command/AcApZoomToBoxCmd.d.ts.map +0 -1
  64. package/lib/command/AcApZoomToBoxCmd.js +0 -158
  65. package/lib/command/AcApZoomToBoxCmd.js.map +0 -1
  66. package/lib/command/index.d.ts +0 -10
  67. package/lib/command/index.d.ts.map +0 -1
  68. package/lib/command/index.js +0 -10
  69. package/lib/command/index.js.map +0 -1
  70. package/lib/editor/command/AcEdCommand.d.ts +0 -151
  71. package/lib/editor/command/AcEdCommand.d.ts.map +0 -1
  72. package/lib/editor/command/AcEdCommand.js +0 -164
  73. package/lib/editor/command/AcEdCommand.js.map +0 -1
  74. package/lib/editor/command/AcEdCommandIterator.d.ts +0 -36
  75. package/lib/editor/command/AcEdCommandIterator.d.ts.map +0 -1
  76. package/lib/editor/command/AcEdCommandIterator.js +0 -65
  77. package/lib/editor/command/AcEdCommandIterator.js.map +0 -1
  78. package/lib/editor/command/AcEdCommandStack.d.ts +0 -120
  79. package/lib/editor/command/AcEdCommandStack.d.ts.map +0 -1
  80. package/lib/editor/command/AcEdCommandStack.js +0 -235
  81. package/lib/editor/command/AcEdCommandStack.js.map +0 -1
  82. package/lib/editor/command/index.d.ts +0 -3
  83. package/lib/editor/command/index.d.ts.map +0 -1
  84. package/lib/editor/command/index.js +0 -3
  85. package/lib/editor/command/index.js.map +0 -1
  86. package/lib/editor/global/AcEdConditionWaiter.d.ts +0 -51
  87. package/lib/editor/global/AcEdConditionWaiter.d.ts.map +0 -1
  88. package/lib/editor/global/AcEdConditionWaiter.js +0 -87
  89. package/lib/editor/global/AcEdConditionWaiter.js.map +0 -1
  90. package/lib/editor/global/AcEdGlobalFunc.d.ts +0 -8
  91. package/lib/editor/global/AcEdGlobalFunc.d.ts.map +0 -1
  92. package/lib/editor/global/AcEdGlobalFunc.js +0 -14
  93. package/lib/editor/global/AcEdGlobalFunc.js.map +0 -1
  94. package/lib/editor/global/AcEdMessage.d.ts +0 -5
  95. package/lib/editor/global/AcEdMessage.d.ts.map +0 -1
  96. package/lib/editor/global/AcEdMessage.js +0 -6
  97. package/lib/editor/global/AcEdMessage.js.map +0 -1
  98. package/lib/editor/global/eventBus.d.ts +0 -103
  99. package/lib/editor/global/eventBus.d.ts.map +0 -1
  100. package/lib/editor/global/eventBus.js +0 -41
  101. package/lib/editor/global/eventBus.js.map +0 -1
  102. package/lib/editor/global/index.d.ts +0 -4
  103. package/lib/editor/global/index.d.ts.map +0 -1
  104. package/lib/editor/global/index.js +0 -4
  105. package/lib/editor/global/index.js.map +0 -1
  106. package/lib/editor/index.d.ts +0 -5
  107. package/lib/editor/index.d.ts.map +0 -1
  108. package/lib/editor/index.js +0 -5
  109. package/lib/editor/index.js.map +0 -1
  110. package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
  111. package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
  112. package/lib/editor/input/AcEdBaseInput.js +0 -166
  113. package/lib/editor/input/AcEdBaseInput.js.map +0 -1
  114. package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
  115. package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
  116. package/lib/editor/input/AcEdBoxSelector.js +0 -220
  117. package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
  118. package/lib/editor/input/AcEdCursorManager.d.ts +0 -130
  119. package/lib/editor/input/AcEdCursorManager.d.ts.map +0 -1
  120. package/lib/editor/input/AcEdCursorManager.js +0 -155
  121. package/lib/editor/input/AcEdCursorManager.js.map +0 -1
  122. package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
  123. package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
  124. package/lib/editor/input/AcEdInputPoint.js +0 -78
  125. package/lib/editor/input/AcEdInputPoint.js.map +0 -1
  126. package/lib/editor/input/AcEdJig.d.ts +0 -180
  127. package/lib/editor/input/AcEdJig.d.ts.map +0 -1
  128. package/lib/editor/input/AcEdJig.js +0 -256
  129. package/lib/editor/input/AcEdJig.js.map +0 -1
  130. package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
  131. package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
  132. package/lib/editor/input/AcEdJigLoop.js +0 -91
  133. package/lib/editor/input/AcEdJigLoop.js.map +0 -1
  134. package/lib/editor/input/AcEdSelectionSet.d.ts +0 -146
  135. package/lib/editor/input/AcEdSelectionSet.d.ts.map +0 -1
  136. package/lib/editor/input/AcEdSelectionSet.js +0 -179
  137. package/lib/editor/input/AcEdSelectionSet.js.map +0 -1
  138. package/lib/editor/input/AcEditor.d.ts +0 -111
  139. package/lib/editor/input/AcEditor.d.ts.map +0 -1
  140. package/lib/editor/input/AcEditor.js +0 -183
  141. package/lib/editor/input/AcEditor.js.map +0 -1
  142. package/lib/editor/input/index.d.ts +0 -5
  143. package/lib/editor/input/index.d.ts.map +0 -1
  144. package/lib/editor/input/index.js +0 -5
  145. package/lib/editor/input/index.js.map +0 -1
  146. package/lib/editor/view/AcEdBaseView.d.ts +0 -457
  147. package/lib/editor/view/AcEdBaseView.d.ts.map +0 -1
  148. package/lib/editor/view/AcEdBaseView.js +0 -349
  149. package/lib/editor/view/AcEdBaseView.js.map +0 -1
  150. package/lib/editor/view/AcEdLayerInfo.d.ts +0 -21
  151. package/lib/editor/view/AcEdLayerInfo.d.ts.map +0 -1
  152. package/lib/editor/view/AcEdLayerInfo.js +0 -2
  153. package/lib/editor/view/AcEdLayerInfo.js.map +0 -1
  154. package/lib/editor/view/index.d.ts +0 -3
  155. package/lib/editor/view/index.d.ts.map +0 -1
  156. package/lib/editor/view/index.js +0 -3
  157. package/lib/editor/view/index.js.map +0 -1
  158. package/lib/index.d.ts +0 -5
  159. package/lib/index.d.ts.map +0 -1
  160. package/lib/index.js +0 -5
  161. package/lib/index.js.map +0 -1
  162. package/lib/util/AcTrGeometryUtil.d.ts +0 -92
  163. package/lib/util/AcTrGeometryUtil.d.ts.map +0 -1
  164. package/lib/util/AcTrGeometryUtil.js +0 -109
  165. package/lib/util/AcTrGeometryUtil.js.map +0 -1
  166. package/lib/util/index.d.ts +0 -2
  167. package/lib/util/index.d.ts.map +0 -1
  168. package/lib/util/index.js +0 -2
  169. package/lib/util/index.js.map +0 -1
  170. package/lib/view/AcTrLayer.d.ts +0 -132
  171. package/lib/view/AcTrLayer.d.ts.map +0 -1
  172. package/lib/view/AcTrLayer.js +0 -199
  173. package/lib/view/AcTrLayer.js.map +0 -1
  174. package/lib/view/AcTrLayout.d.ts +0 -218
  175. package/lib/view/AcTrLayout.d.ts.map +0 -1
  176. package/lib/view/AcTrLayout.js +0 -437
  177. package/lib/view/AcTrLayout.js.map +0 -1
  178. package/lib/view/AcTrLayoutView.d.ts +0 -115
  179. package/lib/view/AcTrLayoutView.d.ts.map +0 -1
  180. package/lib/view/AcTrLayoutView.js +0 -200
  181. package/lib/view/AcTrLayoutView.js.map +0 -1
  182. package/lib/view/AcTrLayoutViewManager.d.ts +0 -89
  183. package/lib/view/AcTrLayoutViewManager.d.ts.map +0 -1
  184. package/lib/view/AcTrLayoutViewManager.js +0 -118
  185. package/lib/view/AcTrLayoutViewManager.js.map +0 -1
  186. package/lib/view/AcTrScene.d.ts +0 -162
  187. package/lib/view/AcTrScene.d.ts.map +0 -1
  188. package/lib/view/AcTrScene.js +0 -370
  189. package/lib/view/AcTrScene.js.map +0 -1
  190. package/lib/view/AcTrView2d.d.ts +0 -262
  191. package/lib/view/AcTrView2d.d.ts.map +0 -1
  192. package/lib/view/AcTrView2d.js +0 -772
  193. package/lib/view/AcTrView2d.js.map +0 -1
  194. package/lib/view/index.d.ts +0 -2
  195. package/lib/view/index.d.ts.map +0 -1
  196. package/lib/view/index.js +0 -2
  197. package/lib/view/index.js.map +0 -1
@@ -1,60 +0,0 @@
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
- import { AcEdCommand } from '../command';
17
- import { eventBus } from '../editor';
18
- /**
19
- * Command to open a CAD file.
20
- *
21
- * This command triggers the file opening workflow by emitting an 'open-file' event
22
- * on the global event bus. The actual file opening logic is handled by other
23
- * components listening for this event (typically the UI layer).
24
- *
25
- * The command follows the standard CAD pattern where the command itself is lightweight
26
- * and delegates the actual work to specialized handlers.
27
- *
28
- * @example
29
- * ```typescript
30
- * const openCommand = new AcApOpenCmd();
31
- * openCommand.globalName = 'OPEN';
32
- * openCommand.localName = 'Open File';
33
- *
34
- * // Trigger the command
35
- * openCommand.trigger(docManager.context);
36
- *
37
- * // The command will emit 'open-file' event for UI components to handle
38
- * ```
39
- */
40
- var AcApOpenCmd = /** @class */ (function (_super) {
41
- __extends(AcApOpenCmd, _super);
42
- function AcApOpenCmd() {
43
- return _super !== null && _super.apply(this, arguments) || this;
44
- }
45
- /**
46
- * Executes the open file command.
47
- *
48
- * Emits an 'open-file' event on the global event bus to trigger
49
- * the file opening workflow. UI components typically listen for
50
- * this event to display file selection dialogs.
51
- *
52
- * @param _context - The current application context (not used in this command)
53
- */
54
- AcApOpenCmd.prototype.execute = function (_context) {
55
- eventBus.emit('open-file', {});
56
- };
57
- return AcApOpenCmd;
58
- }(AcEdCommand));
59
- export { AcApOpenCmd };
60
- //# sourceMappingURL=AcApOpenCmd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApOpenCmd.js","sourceRoot":"","sources":["../../src/command/AcApOpenCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAEpC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAAiC,+BAAW;IAA5C;;IAaA,CAAC;IAZC;;;;;;;;OAQG;IACH,6BAAO,GAAP,UAAQ,QAAqB;QAC3B,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;IAChC,CAAC;IACH,kBAAC;AAAD,CAAC,AAbD,CAAiC,WAAW,GAa3C"}
@@ -1,31 +0,0 @@
1
- import { AcApContext } from '../app';
2
- import { AcEdCommand } from '../command';
3
- /**
4
- * Command for enabling pan mode in the CAD viewer.
5
- *
6
- * This command switches the view to pan mode, allowing users to drag
7
- * and move the drawing around the canvas. When executed, it:
8
- * - Sets the view mode to PAN
9
- * - Changes the cursor to a grab cursor for visual feedback
10
- *
11
- * Pan mode allows users to click and drag to move the viewport,
12
- * providing an intuitive way to navigate large drawings.
13
- *
14
- * @example
15
- * ```typescript
16
- * const panCmd = new AcApPanCmd();
17
- * panCmd.execute(context); // Enables pan mode
18
- * ```
19
- */
20
- export declare class AcApPanCmd extends AcEdCommand {
21
- /**
22
- * Executes the pan command.
23
- *
24
- * Sets the view to pan mode and updates the cursor appearance
25
- * to indicate that panning is active.
26
- *
27
- * @param context - The application context containing the view
28
- */
29
- execute(context: AcApContext): void;
30
- }
31
- //# sourceMappingURL=AcApPanCmd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApPanCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApPanCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,UAAW,SAAQ,WAAW;IACzC;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;CAI7B"}
@@ -1,55 +0,0 @@
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
- import { AcEdCommand } from '../command';
17
- import { AcEdCorsorType, AcEdViewMode } from '../editor';
18
- /**
19
- * Command for enabling pan mode in the CAD viewer.
20
- *
21
- * This command switches the view to pan mode, allowing users to drag
22
- * and move the drawing around the canvas. When executed, it:
23
- * - Sets the view mode to PAN
24
- * - Changes the cursor to a grab cursor for visual feedback
25
- *
26
- * Pan mode allows users to click and drag to move the viewport,
27
- * providing an intuitive way to navigate large drawings.
28
- *
29
- * @example
30
- * ```typescript
31
- * const panCmd = new AcApPanCmd();
32
- * panCmd.execute(context); // Enables pan mode
33
- * ```
34
- */
35
- var AcApPanCmd = /** @class */ (function (_super) {
36
- __extends(AcApPanCmd, _super);
37
- function AcApPanCmd() {
38
- return _super !== null && _super.apply(this, arguments) || this;
39
- }
40
- /**
41
- * Executes the pan command.
42
- *
43
- * Sets the view to pan mode and updates the cursor appearance
44
- * to indicate that panning is active.
45
- *
46
- * @param context - The application context containing the view
47
- */
48
- AcApPanCmd.prototype.execute = function (context) {
49
- context.view.mode = AcEdViewMode.PAN;
50
- context.view.setCursor(AcEdCorsorType.Grab);
51
- };
52
- return AcApPanCmd;
53
- }(AcEdCommand));
54
- export { AcApPanCmd };
55
- //# sourceMappingURL=AcApPanCmd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApPanCmd.js","sourceRoot":"","sources":["../../src/command/AcApPanCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExD;;;;;;;;;;;;;;;;GAgBG;AACH;IAAgC,8BAAW;IAA3C;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,4BAAO,GAAP,UAAQ,OAAoB;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,GAAG,CAAA;QACpC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;IAC7C,CAAC;IACH,iBAAC;AAAD,CAAC,AAbD,CAAgC,WAAW,GAa1C"}
@@ -1,32 +0,0 @@
1
- import { AcApContext } from '../app';
2
- import { AcEdCommand } from '../command';
3
- /**
4
- * Command for creating a new CAD document from a template.
5
- *
6
- * This command opens a predefined template drawing (acadiso.dxf) from
7
- * a CDN to create a new document. The template provides:
8
- * - Standard ISO drawing settings
9
- * - Predefined layers and styles
10
- * - Default drawing setup
11
- *
12
- * This is equivalent to "Quick New" functionality in traditional CAD applications,
13
- * providing users with a ready-to-use drawing environment.
14
- *
15
- * @example
16
- * ```typescript
17
- * const qNewCmd = new AcApQNewCmd();
18
- * qNewCmd.execute(context); // Creates new document from template
19
- * ```
20
- */
21
- export declare class AcApQNewCmd extends AcEdCommand {
22
- /**
23
- * Executes the quick new command.
24
- *
25
- * Opens the ISO template from the CDN to create a new document
26
- * with standard drawing settings.
27
- *
28
- * @param _context - The application context (unused in this command)
29
- */
30
- execute(_context: AcApContext): void;
31
- }
32
- //# sourceMappingURL=AcApQNewCmd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApQNewCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApQNewCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAI9B"}
@@ -1,56 +0,0 @@
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
- import { AcApDocManager } from '../app';
17
- import { AcEdCommand } from '../command';
18
- /**
19
- * Command for creating a new CAD document from a template.
20
- *
21
- * This command opens a predefined template drawing (acadiso.dxf) from
22
- * a CDN to create a new document. The template provides:
23
- * - Standard ISO drawing settings
24
- * - Predefined layers and styles
25
- * - Default drawing setup
26
- *
27
- * This is equivalent to "Quick New" functionality in traditional CAD applications,
28
- * providing users with a ready-to-use drawing environment.
29
- *
30
- * @example
31
- * ```typescript
32
- * const qNewCmd = new AcApQNewCmd();
33
- * qNewCmd.execute(context); // Creates new document from template
34
- * ```
35
- */
36
- var AcApQNewCmd = /** @class */ (function (_super) {
37
- __extends(AcApQNewCmd, _super);
38
- function AcApQNewCmd() {
39
- return _super !== null && _super.apply(this, arguments) || this;
40
- }
41
- /**
42
- * Executes the quick new command.
43
- *
44
- * Opens the ISO template from the CDN to create a new document
45
- * with standard drawing settings.
46
- *
47
- * @param _context - The application context (unused in this command)
48
- */
49
- AcApQNewCmd.prototype.execute = function (_context) {
50
- var baseUrl = AcApDocManager.instance.baseUrl;
51
- AcApDocManager.instance.openUrl(baseUrl + 'templates/acadiso.dxf');
52
- };
53
- return AcApQNewCmd;
54
- }(AcEdCommand));
55
- export { AcApQNewCmd };
56
- //# sourceMappingURL=AcApQNewCmd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApQNewCmd.js","sourceRoot":"","sources":["../../src/command/AcApQNewCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAiC,+BAAW;IAA5C;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,QAAqB;QAC3B,IAAM,OAAO,GAAG,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAA;QAC/C,cAAc,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,GAAG,uBAAuB,CAAC,CAAA;IACpE,CAAC;IACH,kBAAC;AAAD,CAAC,AAbD,CAAiC,WAAW,GAa3C"}
@@ -1,32 +0,0 @@
1
- import { AcApContext } from '../app';
2
- import { AcEdCommand } from '../command';
3
- /**
4
- * Command for enabling selection mode in the CAD viewer.
5
- *
6
- * This command switches the view to selection mode, allowing users to
7
- * select CAD entities by clicking on them. When executed, it:
8
- * - Sets the view mode to SELECTION
9
- * - Changes the cursor to a crosshair for precise selection
10
- *
11
- * In selection mode, users can click on entities to select them,
12
- * which will add them to the selection set and typically show
13
- * grip points for manipulation.
14
- *
15
- * @example
16
- * ```typescript
17
- * const selectCmd = new AcApSelectCmd();
18
- * selectCmd.execute(context); // Enables selection mode
19
- * ```
20
- */
21
- export declare class AcApSelectCmd extends AcEdCommand {
22
- /**
23
- * Executes the select command.
24
- *
25
- * Sets the view to selection mode and updates the cursor appearance
26
- * to indicate that entity selection is active.
27
- *
28
- * @param context - The application context containing the view
29
- */
30
- execute(context: AcApContext): void;
31
- }
32
- //# sourceMappingURL=AcApSelectCmd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApSelectCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAC5C;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;CAI7B"}
@@ -1,56 +0,0 @@
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
- import { AcEdCommand } from '../command';
17
- import { AcEdCorsorType, AcEdViewMode } from '../editor';
18
- /**
19
- * Command for enabling selection mode in the CAD viewer.
20
- *
21
- * This command switches the view to selection mode, allowing users to
22
- * select CAD entities by clicking on them. When executed, it:
23
- * - Sets the view mode to SELECTION
24
- * - Changes the cursor to a crosshair for precise selection
25
- *
26
- * In selection mode, users can click on entities to select them,
27
- * which will add them to the selection set and typically show
28
- * grip points for manipulation.
29
- *
30
- * @example
31
- * ```typescript
32
- * const selectCmd = new AcApSelectCmd();
33
- * selectCmd.execute(context); // Enables selection mode
34
- * ```
35
- */
36
- var AcApSelectCmd = /** @class */ (function (_super) {
37
- __extends(AcApSelectCmd, _super);
38
- function AcApSelectCmd() {
39
- return _super !== null && _super.apply(this, arguments) || this;
40
- }
41
- /**
42
- * Executes the select command.
43
- *
44
- * Sets the view to selection mode and updates the cursor appearance
45
- * to indicate that entity selection is active.
46
- *
47
- * @param context - The application context containing the view
48
- */
49
- AcApSelectCmd.prototype.execute = function (context) {
50
- context.view.mode = AcEdViewMode.SELECTION;
51
- context.view.setCursor(AcEdCorsorType.Crosshair);
52
- };
53
- return AcApSelectCmd;
54
- }(AcEdCommand));
55
- export { AcApSelectCmd };
56
- //# sourceMappingURL=AcApSelectCmd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApSelectCmd.js","sourceRoot":"","sources":["../../src/command/AcApSelectCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAExD;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAmC,iCAAW;IAA9C;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,+BAAO,GAAP,UAAQ,OAAoB;QAC1B,OAAO,CAAC,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,SAAS,CAAA;QAC1C,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,CAAA;IAClD,CAAC;IACH,oBAAC;AAAD,CAAC,AAbD,CAAmC,WAAW,GAa7C"}
@@ -1,53 +0,0 @@
1
- /**
2
- * Utility class for converting CAD drawings to SVG format.
3
- *
4
- * This class provides functionality to export the current CAD drawing
5
- * to SVG format and download it as a file. It iterates through all
6
- * entities in the model space and renders them using the SVG renderer.
7
- *
8
- * The conversion process:
9
- * 1. Gets all entities from the current document's model space
10
- * 2. Uses the SVG renderer to convert each entity to SVG markup
11
- * 3. Exports the complete SVG content
12
- * 4. Creates a downloadable file for the user
13
- *
14
- * @example
15
- * ```typescript
16
- * const converter = new AcApSvgConvertor();
17
- *
18
- * // Convert and download current drawing as SVG
19
- * converter.convert();
20
- * ```
21
- */
22
- export declare class AcApSvgConvertor {
23
- /**
24
- * Converts the current CAD drawing to SVG format and initiates download.
25
- *
26
- * This method:
27
- * - Retrieves all entities from the current document's model space
28
- * - Renders each entity using the SVG renderer
29
- * - Exports the complete SVG markup
30
- * - Automatically downloads the SVG file as 'example.svg'
31
- *
32
- * @example
33
- * ```typescript
34
- * const converter = new AcApSvgConvertor();
35
- * converter.convert(); // Downloads the drawing as SVG
36
- * ```
37
- */
38
- convert(): void;
39
- /**
40
- * Creates a downloadable SVG file and triggers the download.
41
- *
42
- * This method:
43
- * - Creates a Blob from the SVG content with proper MIME type
44
- * - Generates a temporary download URL
45
- * - Creates and triggers a download link
46
- * - Cleans up the temporary elements
47
- *
48
- * @param svgContent - The SVG markup content to download
49
- * @private
50
- */
51
- private createFileAndDownloadIt;
52
- }
53
- //# sourceMappingURL=AcApSvgConvertor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApSvgConvertor.d.ts","sourceRoot":"","sources":["../../src/command/AcApSvgConvertor.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,gBAAgB;IAC3B;;;;;;;;;;;;;;OAcG;IACH,OAAO;IAUP;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,uBAAuB;CAoBhC"}
@@ -1,103 +0,0 @@
1
- var __values = (this && this.__values) || function(o) {
2
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3
- if (m) return m.call(o);
4
- if (o && typeof o.length === "number") return {
5
- next: function () {
6
- if (o && i >= o.length) o = void 0;
7
- return { value: o && o[i++], done: !o };
8
- }
9
- };
10
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
11
- };
12
- import { AcSvgRenderer } from '@mlightcad/svg-renderer';
13
- import { AcApDocManager } from '../app';
14
- /**
15
- * Utility class for converting CAD drawings to SVG format.
16
- *
17
- * This class provides functionality to export the current CAD drawing
18
- * to SVG format and download it as a file. It iterates through all
19
- * entities in the model space and renders them using the SVG renderer.
20
- *
21
- * The conversion process:
22
- * 1. Gets all entities from the current document's model space
23
- * 2. Uses the SVG renderer to convert each entity to SVG markup
24
- * 3. Exports the complete SVG content
25
- * 4. Creates a downloadable file for the user
26
- *
27
- * @example
28
- * ```typescript
29
- * const converter = new AcApSvgConvertor();
30
- *
31
- * // Convert and download current drawing as SVG
32
- * converter.convert();
33
- * ```
34
- */
35
- var AcApSvgConvertor = /** @class */ (function () {
36
- function AcApSvgConvertor() {
37
- }
38
- /**
39
- * Converts the current CAD drawing to SVG format and initiates download.
40
- *
41
- * This method:
42
- * - Retrieves all entities from the current document's model space
43
- * - Renders each entity using the SVG renderer
44
- * - Exports the complete SVG markup
45
- * - Automatically downloads the SVG file as 'example.svg'
46
- *
47
- * @example
48
- * ```typescript
49
- * const converter = new AcApSvgConvertor();
50
- * converter.convert(); // Downloads the drawing as SVG
51
- * ```
52
- */
53
- AcApSvgConvertor.prototype.convert = function () {
54
- var e_1, _a;
55
- var entities = AcApDocManager.instance.curDocument.database.tables.blockTable.modelSpace.newIterator();
56
- var renderer = new AcSvgRenderer();
57
- try {
58
- for (var entities_1 = __values(entities), entities_1_1 = entities_1.next(); !entities_1_1.done; entities_1_1 = entities_1.next()) {
59
- var entity = entities_1_1.value;
60
- entity.draw(renderer);
61
- }
62
- }
63
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
64
- finally {
65
- try {
66
- if (entities_1_1 && !entities_1_1.done && (_a = entities_1.return)) _a.call(entities_1);
67
- }
68
- finally { if (e_1) throw e_1.error; }
69
- }
70
- this.createFileAndDownloadIt(renderer.export());
71
- };
72
- /**
73
- * Creates a downloadable SVG file and triggers the download.
74
- *
75
- * This method:
76
- * - Creates a Blob from the SVG content with proper MIME type
77
- * - Generates a temporary download URL
78
- * - Creates and triggers a download link
79
- * - Cleans up the temporary elements
80
- *
81
- * @param svgContent - The SVG markup content to download
82
- * @private
83
- */
84
- AcApSvgConvertor.prototype.createFileAndDownloadIt = function (svgContent) {
85
- // Convert the SVG content into a Blob
86
- var svgBlob = new Blob([svgContent], {
87
- type: 'image/svg+xml;charset=utf-8'
88
- });
89
- // Create a URL for the Blob
90
- var url = URL.createObjectURL(svgBlob);
91
- // Create a download link and trigger the download
92
- var downloadLink = document.createElement('a');
93
- downloadLink.href = url;
94
- downloadLink.download = 'example.svg';
95
- // Append the link to the body (it needs to be in the DOM to work in some browsers)
96
- document.body.appendChild(downloadLink);
97
- // Trigger the download
98
- downloadLink.click();
99
- };
100
- return AcApSvgConvertor;
101
- }());
102
- export { AcApSvgConvertor };
103
- //# sourceMappingURL=AcApSvgConvertor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApSvgConvertor.js","sourceRoot":"","sources":["../../src/command/AcApSvgConvertor.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAA;IA0DA,CAAC;IAzDC;;;;;;;;;;;;;;OAcG;IACH,kCAAO,GAAP;;QACE,IAAM,QAAQ,GACZ,cAAc,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA;QACzF,IAAM,QAAQ,GAAG,IAAI,aAAa,EAAE,CAAA;;YACpC,KAAqB,IAAA,aAAA,SAAA,QAAQ,CAAA,kCAAA,wDAAE,CAAC;gBAA3B,IAAM,MAAM,qBAAA;gBACf,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;YACvB,CAAC;;;;;;;;;QACD,IAAI,CAAC,uBAAuB,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IACjD,CAAC;IAED;;;;;;;;;;;OAWG;IACK,kDAAuB,GAA/B,UAAgC,UAAkB;QAChD,sCAAsC;QACtC,IAAM,OAAO,GAAG,IAAI,IAAI,CAAC,CAAC,UAAU,CAAC,EAAE;YACrC,IAAI,EAAE,6BAA6B;SACpC,CAAC,CAAA;QAEF,4BAA4B;QAC5B,IAAM,GAAG,GAAG,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;QAExC,kDAAkD;QAClD,IAAM,YAAY,GAAG,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,CAAA;QAChD,YAAY,CAAC,IAAI,GAAG,GAAG,CAAA;QACvB,YAAY,CAAC,QAAQ,GAAG,aAAa,CAAA;QAErC,mFAAmF;QACnF,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,YAAY,CAAC,CAAA;QAEvC,uBAAuB;QACvB,YAAY,CAAC,KAAK,EAAE,CAAA;IACtB,CAAC;IACH,uBAAC;AAAD,CAAC,AA1DD,IA0DC"}
@@ -1,35 +0,0 @@
1
- import { AcApContext } from '../app';
2
- import { AcEdCommand } from '../command';
3
- /**
4
- * Command to zoom the view to fit all visible entities.
5
- *
6
- * This command adjusts the view's zoom level and position to show all
7
- * visible entities in the current drawing within the viewport. It's
8
- * equivalent to the "Zoom Extents" or "Fit to Window" functionality
9
- * found in most CAD applications.
10
- *
11
- * The command calculates the bounding box of all visible entities and
12
- * adjusts the camera to show them all with appropriate padding.
13
- *
14
- * @example
15
- * ```typescript
16
- * const zoomCommand = new AcApZoomCmd();
17
- * zoomCommand.globalName = 'ZOOM';
18
- * zoomCommand.localName = 'Zoom to Fit';
19
- *
20
- * // Execute the command to fit all entities in view
21
- * zoomCommand.trigger(docManager.context);
22
- * ```
23
- */
24
- export declare class AcApZoomCmd extends AcEdCommand {
25
- /**
26
- * Executes the zoom to fit command.
27
- *
28
- * Calls the view's `zoomToFit()` method to adjust the camera position
29
- * and zoom level to display all visible entities within the viewport.
30
- *
31
- * @param context - The current application context containing the view to zoom
32
- */
33
- execute(context: AcApContext): void;
34
- }
35
- //# sourceMappingURL=AcApZoomCmd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApZoomCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;CAG7B"}
@@ -1,57 +0,0 @@
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
- import { AcEdCommand } from '../command';
17
- /**
18
- * Command to zoom the view to fit all visible entities.
19
- *
20
- * This command adjusts the view's zoom level and position to show all
21
- * visible entities in the current drawing within the viewport. It's
22
- * equivalent to the "Zoom Extents" or "Fit to Window" functionality
23
- * found in most CAD applications.
24
- *
25
- * The command calculates the bounding box of all visible entities and
26
- * adjusts the camera to show them all with appropriate padding.
27
- *
28
- * @example
29
- * ```typescript
30
- * const zoomCommand = new AcApZoomCmd();
31
- * zoomCommand.globalName = 'ZOOM';
32
- * zoomCommand.localName = 'Zoom to Fit';
33
- *
34
- * // Execute the command to fit all entities in view
35
- * zoomCommand.trigger(docManager.context);
36
- * ```
37
- */
38
- var AcApZoomCmd = /** @class */ (function (_super) {
39
- __extends(AcApZoomCmd, _super);
40
- function AcApZoomCmd() {
41
- return _super !== null && _super.apply(this, arguments) || this;
42
- }
43
- /**
44
- * Executes the zoom to fit command.
45
- *
46
- * Calls the view's `zoomToFit()` method to adjust the camera position
47
- * and zoom level to display all visible entities within the viewport.
48
- *
49
- * @param context - The current application context containing the view to zoom
50
- */
51
- AcApZoomCmd.prototype.execute = function (context) {
52
- context.view.zoomToFit();
53
- };
54
- return AcApZoomCmd;
55
- }(AcEdCommand));
56
- export { AcApZoomCmd };
57
- //# sourceMappingURL=AcApZoomCmd.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AcApZoomCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAiC,+BAAW;IAA5C;;IAYA,CAAC;IAXC;;;;;;;OAOG;IACH,6BAAO,GAAP,UAAQ,OAAoB;QAC1B,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,CAAA;IAC1B,CAAC;IACH,kBAAC;AAAD,CAAC,AAZD,CAAiC,WAAW,GAY3C"}