@mlightcad/cad-simple-viewer 1.2.2 → 1.2.3

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 (202) hide show
  1. package/dist/__vite-browser-external-l0sNRNKZ-l0sNRNKZ.js +1 -0
  2. package/dist/index.js +40205 -0
  3. package/dist/index.umd.cjs +333 -0
  4. package/dist/libredwg-parser-worker.js +15458 -0
  5. package/dist/mtext-renderer-worker.js +29930 -0
  6. package/lib/app/AcApContext.d.ts +57 -0
  7. package/lib/app/AcApContext.d.ts.map +1 -0
  8. package/lib/app/AcApContext.js +106 -0
  9. package/lib/app/AcApContext.js.map +1 -0
  10. package/lib/app/AcApDocManager.d.ts +291 -0
  11. package/lib/app/AcApDocManager.d.ts.map +1 -0
  12. package/lib/app/AcApDocManager.js +498 -0
  13. package/lib/app/AcApDocManager.js.map +1 -0
  14. package/lib/app/AcApDocument.d.ts +101 -0
  15. package/lib/app/AcApDocument.d.ts.map +1 -0
  16. package/lib/app/AcApDocument.js +237 -0
  17. package/lib/app/AcApDocument.js.map +1 -0
  18. package/lib/app/AcApFontLoader.d.ts +54 -0
  19. package/lib/app/AcApFontLoader.d.ts.map +1 -0
  20. package/lib/app/AcApFontLoader.js +151 -0
  21. package/lib/app/AcApFontLoader.js.map +1 -0
  22. package/lib/app/AcApGlobalFunc.d.ts +26 -0
  23. package/lib/app/AcApGlobalFunc.d.ts.map +1 -0
  24. package/lib/app/AcApGlobalFunc.js +66 -0
  25. package/lib/app/AcApGlobalFunc.js.map +1 -0
  26. package/lib/app/AcApSettingManager.d.ts +232 -0
  27. package/lib/app/AcApSettingManager.d.ts.map +1 -0
  28. package/lib/app/AcApSettingManager.js +283 -0
  29. package/lib/app/AcApSettingManager.js.map +1 -0
  30. package/lib/app/index.d.ts +6 -0
  31. package/lib/app/index.d.ts.map +1 -0
  32. package/lib/app/index.js +6 -0
  33. package/lib/app/index.js.map +1 -0
  34. package/lib/command/AcApConvertToSvgCmd.d.ts +32 -0
  35. package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -0
  36. package/lib/command/AcApConvertToSvgCmd.js +56 -0
  37. package/lib/command/AcApConvertToSvgCmd.js.map +1 -0
  38. package/lib/command/AcApOpenCmd.d.ts +37 -0
  39. package/lib/command/AcApOpenCmd.d.ts.map +1 -0
  40. package/lib/command/AcApOpenCmd.js +60 -0
  41. package/lib/command/AcApOpenCmd.js.map +1 -0
  42. package/lib/command/AcApPanCmd.d.ts +31 -0
  43. package/lib/command/AcApPanCmd.d.ts.map +1 -0
  44. package/lib/command/AcApPanCmd.js +55 -0
  45. package/lib/command/AcApPanCmd.js.map +1 -0
  46. package/lib/command/AcApQNewCmd.d.ts +32 -0
  47. package/lib/command/AcApQNewCmd.d.ts.map +1 -0
  48. package/lib/command/AcApQNewCmd.js +56 -0
  49. package/lib/command/AcApQNewCmd.js.map +1 -0
  50. package/lib/command/AcApRegenCmd.d.ts +21 -0
  51. package/lib/command/AcApRegenCmd.d.ts.map +1 -0
  52. package/lib/command/AcApRegenCmd.js +45 -0
  53. package/lib/command/AcApRegenCmd.js.map +1 -0
  54. package/lib/command/AcApSelectCmd.d.ts +32 -0
  55. package/lib/command/AcApSelectCmd.d.ts.map +1 -0
  56. package/lib/command/AcApSelectCmd.js +56 -0
  57. package/lib/command/AcApSelectCmd.js.map +1 -0
  58. package/lib/command/AcApSvgConvertor.d.ts +53 -0
  59. package/lib/command/AcApSvgConvertor.d.ts.map +1 -0
  60. package/lib/command/AcApSvgConvertor.js +103 -0
  61. package/lib/command/AcApSvgConvertor.js.map +1 -0
  62. package/lib/command/AcApZoomCmd.d.ts +35 -0
  63. package/lib/command/AcApZoomCmd.d.ts.map +1 -0
  64. package/lib/command/AcApZoomCmd.js +57 -0
  65. package/lib/command/AcApZoomCmd.js.map +1 -0
  66. package/lib/command/AcApZoomToBoxCmd.d.ts +68 -0
  67. package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -0
  68. package/lib/command/AcApZoomToBoxCmd.js +158 -0
  69. package/lib/command/AcApZoomToBoxCmd.js.map +1 -0
  70. package/lib/command/index.d.ts +11 -0
  71. package/lib/command/index.d.ts.map +1 -0
  72. package/lib/command/index.js +11 -0
  73. package/lib/command/index.js.map +1 -0
  74. package/lib/editor/command/AcEdCommand.d.ts +151 -0
  75. package/lib/editor/command/AcEdCommand.d.ts.map +1 -0
  76. package/lib/editor/command/AcEdCommand.js +164 -0
  77. package/lib/editor/command/AcEdCommand.js.map +1 -0
  78. package/lib/editor/command/AcEdCommandIterator.d.ts +36 -0
  79. package/lib/editor/command/AcEdCommandIterator.d.ts.map +1 -0
  80. package/lib/editor/command/AcEdCommandIterator.js +65 -0
  81. package/lib/editor/command/AcEdCommandIterator.js.map +1 -0
  82. package/lib/editor/command/AcEdCommandStack.d.ts +120 -0
  83. package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -0
  84. package/lib/editor/command/AcEdCommandStack.js +235 -0
  85. package/lib/editor/command/AcEdCommandStack.js.map +1 -0
  86. package/lib/editor/command/index.d.ts +3 -0
  87. package/lib/editor/command/index.d.ts.map +1 -0
  88. package/lib/editor/command/index.js +3 -0
  89. package/lib/editor/command/index.js.map +1 -0
  90. package/lib/editor/global/AcEdConditionWaiter.d.ts +51 -0
  91. package/lib/editor/global/AcEdConditionWaiter.d.ts.map +1 -0
  92. package/lib/editor/global/AcEdConditionWaiter.js +87 -0
  93. package/lib/editor/global/AcEdConditionWaiter.js.map +1 -0
  94. package/lib/editor/global/AcEdGlobalFunc.d.ts +8 -0
  95. package/lib/editor/global/AcEdGlobalFunc.d.ts.map +1 -0
  96. package/lib/editor/global/AcEdGlobalFunc.js +14 -0
  97. package/lib/editor/global/AcEdGlobalFunc.js.map +1 -0
  98. package/lib/editor/global/AcEdMessage.d.ts +5 -0
  99. package/lib/editor/global/AcEdMessage.d.ts.map +1 -0
  100. package/lib/editor/global/AcEdMessage.js +6 -0
  101. package/lib/editor/global/AcEdMessage.js.map +1 -0
  102. package/lib/editor/global/eventBus.d.ts +103 -0
  103. package/lib/editor/global/eventBus.d.ts.map +1 -0
  104. package/lib/editor/global/eventBus.js +41 -0
  105. package/lib/editor/global/eventBus.js.map +1 -0
  106. package/lib/editor/global/index.d.ts +4 -0
  107. package/lib/editor/global/index.d.ts.map +1 -0
  108. package/lib/editor/global/index.js +4 -0
  109. package/lib/editor/global/index.js.map +1 -0
  110. package/lib/editor/index.d.ts +5 -0
  111. package/lib/editor/index.d.ts.map +1 -0
  112. package/lib/editor/index.js +5 -0
  113. package/lib/editor/index.js.map +1 -0
  114. package/lib/editor/input/AcEdBaseInput.d.ts +89 -0
  115. package/lib/editor/input/AcEdBaseInput.d.ts.map +1 -0
  116. package/lib/editor/input/AcEdBaseInput.js +166 -0
  117. package/lib/editor/input/AcEdBaseInput.js.map +1 -0
  118. package/lib/editor/input/AcEdBoxSelector.d.ts +108 -0
  119. package/lib/editor/input/AcEdBoxSelector.d.ts.map +1 -0
  120. package/lib/editor/input/AcEdBoxSelector.js +220 -0
  121. package/lib/editor/input/AcEdBoxSelector.js.map +1 -0
  122. package/lib/editor/input/AcEdCursorManager.d.ts +130 -0
  123. package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -0
  124. package/lib/editor/input/AcEdCursorManager.js +155 -0
  125. package/lib/editor/input/AcEdCursorManager.js.map +1 -0
  126. package/lib/editor/input/AcEdInputPoint.d.ts +51 -0
  127. package/lib/editor/input/AcEdInputPoint.d.ts.map +1 -0
  128. package/lib/editor/input/AcEdInputPoint.js +78 -0
  129. package/lib/editor/input/AcEdInputPoint.js.map +1 -0
  130. package/lib/editor/input/AcEdJig.d.ts +180 -0
  131. package/lib/editor/input/AcEdJig.d.ts.map +1 -0
  132. package/lib/editor/input/AcEdJig.js +256 -0
  133. package/lib/editor/input/AcEdJig.js.map +1 -0
  134. package/lib/editor/input/AcEdJigLoop.d.ts +63 -0
  135. package/lib/editor/input/AcEdJigLoop.d.ts.map +1 -0
  136. package/lib/editor/input/AcEdJigLoop.js +91 -0
  137. package/lib/editor/input/AcEdJigLoop.js.map +1 -0
  138. package/lib/editor/input/AcEdSelectionSet.d.ts +146 -0
  139. package/lib/editor/input/AcEdSelectionSet.d.ts.map +1 -0
  140. package/lib/editor/input/AcEdSelectionSet.js +179 -0
  141. package/lib/editor/input/AcEdSelectionSet.js.map +1 -0
  142. package/lib/editor/input/AcEditor.d.ts +111 -0
  143. package/lib/editor/input/AcEditor.d.ts.map +1 -0
  144. package/lib/editor/input/AcEditor.js +183 -0
  145. package/lib/editor/input/AcEditor.js.map +1 -0
  146. package/lib/editor/input/index.d.ts +5 -0
  147. package/lib/editor/input/index.d.ts.map +1 -0
  148. package/lib/editor/input/index.js +5 -0
  149. package/lib/editor/input/index.js.map +1 -0
  150. package/lib/editor/view/AcEdBaseView.d.ts +457 -0
  151. package/lib/editor/view/AcEdBaseView.d.ts.map +1 -0
  152. package/lib/editor/view/AcEdBaseView.js +349 -0
  153. package/lib/editor/view/AcEdBaseView.js.map +1 -0
  154. package/lib/editor/view/AcEdLayerInfo.d.ts +21 -0
  155. package/lib/editor/view/AcEdLayerInfo.d.ts.map +1 -0
  156. package/lib/editor/view/AcEdLayerInfo.js +2 -0
  157. package/lib/editor/view/AcEdLayerInfo.js.map +1 -0
  158. package/lib/editor/view/index.d.ts +3 -0
  159. package/lib/editor/view/index.d.ts.map +1 -0
  160. package/lib/editor/view/index.js +3 -0
  161. package/lib/editor/view/index.js.map +1 -0
  162. package/lib/index.d.ts +5 -0
  163. package/lib/index.d.ts.map +1 -0
  164. package/lib/index.js +5 -0
  165. package/lib/index.js.map +1 -0
  166. package/lib/util/AcTrGeometryUtil.d.ts +92 -0
  167. package/lib/util/AcTrGeometryUtil.d.ts.map +1 -0
  168. package/lib/util/AcTrGeometryUtil.js +109 -0
  169. package/lib/util/AcTrGeometryUtil.js.map +1 -0
  170. package/lib/util/index.d.ts +2 -0
  171. package/lib/util/index.d.ts.map +1 -0
  172. package/lib/util/index.js +2 -0
  173. package/lib/util/index.js.map +1 -0
  174. package/lib/view/AcTrLayer.d.ts +132 -0
  175. package/lib/view/AcTrLayer.d.ts.map +1 -0
  176. package/lib/view/AcTrLayer.js +199 -0
  177. package/lib/view/AcTrLayer.js.map +1 -0
  178. package/lib/view/AcTrLayout.d.ts +218 -0
  179. package/lib/view/AcTrLayout.d.ts.map +1 -0
  180. package/lib/view/AcTrLayout.js +437 -0
  181. package/lib/view/AcTrLayout.js.map +1 -0
  182. package/lib/view/AcTrLayoutView.d.ts +115 -0
  183. package/lib/view/AcTrLayoutView.d.ts.map +1 -0
  184. package/lib/view/AcTrLayoutView.js +200 -0
  185. package/lib/view/AcTrLayoutView.js.map +1 -0
  186. package/lib/view/AcTrLayoutViewManager.d.ts +89 -0
  187. package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -0
  188. package/lib/view/AcTrLayoutViewManager.js +118 -0
  189. package/lib/view/AcTrLayoutViewManager.js.map +1 -0
  190. package/lib/view/AcTrScene.d.ts +162 -0
  191. package/lib/view/AcTrScene.d.ts.map +1 -0
  192. package/lib/view/AcTrScene.js +370 -0
  193. package/lib/view/AcTrScene.js.map +1 -0
  194. package/lib/view/AcTrView2d.d.ts +262 -0
  195. package/lib/view/AcTrView2d.d.ts.map +1 -0
  196. package/lib/view/AcTrView2d.js +772 -0
  197. package/lib/view/AcTrView2d.js.map +1 -0
  198. package/lib/view/index.d.ts +2 -0
  199. package/lib/view/index.d.ts.map +1 -0
  200. package/lib/view/index.js +2 -0
  201. package/lib/view/index.js.map +1 -0
  202. package/package.json +3 -3
@@ -0,0 +1,232 @@
1
+ import { AcCmEventManager } from '@mlightcad/data-model';
2
+ /**
3
+ * Font mappings for CAD text rendering.
4
+ *
5
+ * Maps original font names to replacement font names when the original
6
+ * font is not available in the system.
7
+ *
8
+ * @example
9
+ * ```typescript
10
+ * const fontMapping: AcApFontMapping = {
11
+ * 'AutoCAD Font': 'Arial',
12
+ * 'SimSun': 'Microsoft YaHei'
13
+ * };
14
+ * ```
15
+ */
16
+ export type AcApFontMapping = Record<string, string>;
17
+ /**
18
+ * Configuration settings for the CAD application.
19
+ *
20
+ * Contains various UI and rendering preferences that can be persisted
21
+ * and modified during runtime.
22
+ */
23
+ export interface AcApSettings {
24
+ /** Whether debug mode is enabled for development features */
25
+ isDebug: boolean;
26
+ /** Whether the command line interface is visible */
27
+ isShowCommandLine: boolean;
28
+ /** Whether coordinate display is visible */
29
+ isShowCoordinate: boolean;
30
+ /** Whether the toolbar is visible */
31
+ isShowToolbar: boolean;
32
+ /** Whether performance statistics are displayed */
33
+ isShowStats: boolean;
34
+ /** Font mapping configuration for text rendering */
35
+ fontMapping: AcApFontMapping;
36
+ }
37
+ /**
38
+ * Event arguments for settings modification events.
39
+ *
40
+ * @template T - The settings type, defaults to AcApSettings
41
+ */
42
+ export interface AcApSettingManagerEventArgs<T extends AcApSettings = AcApSettings> {
43
+ /** The setting key that was modified */
44
+ key: keyof T;
45
+ /** The new value of the setting */
46
+ value: unknown;
47
+ }
48
+ /**
49
+ * Singleton settings manager for the CAD application.
50
+ *
51
+ * This class manages application-wide settings with:
52
+ * - Persistent storage using localStorage
53
+ * - Event notification when settings change
54
+ * - Type-safe setting access
55
+ * - Default value fallbacks
56
+ *
57
+ * The settings are automatically saved to localStorage and restored on application start.
58
+ *
59
+ * @template T - The settings interface type, defaults to AcApSettings
60
+ *
61
+ * @example
62
+ * ```typescript
63
+ * // Get the singleton instance
64
+ * const settings = AcApSettingManager.instance;
65
+ *
66
+ * // Set a setting value
67
+ * settings.set('isShowToolbar', false);
68
+ *
69
+ * // Get a setting value
70
+ * const showToolbar = settings.get('isShowToolbar');
71
+ *
72
+ * // Toggle a boolean setting
73
+ * settings.toggle('isDebug');
74
+ *
75
+ * // Listen for setting changes
76
+ * settings.events.modified.addEventListener(args => {
77
+ * console.log(`Setting ${args.key} changed to:`, args.value);
78
+ * });
79
+ * ```
80
+ */
81
+ export declare class AcApSettingManager<T extends AcApSettings = AcApSettings> {
82
+ /** Singleton instance */
83
+ private static _instance?;
84
+ /** Events fired when settings are modified */
85
+ readonly events: {
86
+ /** Fired when any setting is modified */
87
+ modified: AcCmEventManager<AcApSettingManagerEventArgs<T>>;
88
+ };
89
+ /**
90
+ * Gets the singleton instance of the settings manager.
91
+ *
92
+ * Creates a new instance if one doesn't exist yet.
93
+ *
94
+ * @returns The singleton settings manager instance
95
+ */
96
+ static get instance(): AcApSettingManager<AcApSettings>;
97
+ /**
98
+ * Sets a setting value and persists it to localStorage.
99
+ *
100
+ * Fires a modified event after the setting is saved.
101
+ *
102
+ * @template K - The setting key type
103
+ * @param key - The setting key to modify
104
+ * @param value - The new value for the setting
105
+ *
106
+ * @example
107
+ * ```typescript
108
+ * settings.set('isShowToolbar', false);
109
+ * settings.set('fontMapping', { 'Arial': 'Helvetica' });
110
+ * ```
111
+ */
112
+ set<K extends keyof T>(key: K, value: T[K]): void;
113
+ /**
114
+ * Gets a setting value.
115
+ *
116
+ * Returns the stored value or the default value if not set.
117
+ *
118
+ * @template K - The setting key type
119
+ * @param key - The setting key to retrieve
120
+ * @returns The setting value
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * const isDebug = settings.get('isDebug');
125
+ * const fontMapping = settings.get('fontMapping');
126
+ * ```
127
+ */
128
+ get<K extends keyof T>(key: K): NonNullable<AcApSettings & T>[K];
129
+ /**
130
+ * Toggles a boolean setting value.
131
+ *
132
+ * Only works with boolean settings. The caller should ensure the setting is boolean.
133
+ *
134
+ * @template K - The setting key type
135
+ * @param key - The boolean setting key to toggle
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * settings.toggle('isDebug'); // false -> true
140
+ * settings.toggle('isShowToolbar'); // true -> false
141
+ * ```
142
+ */
143
+ toggle<K extends keyof T>(key: K): void;
144
+ /**
145
+ * Gets whether debug mode is enabled.
146
+ *
147
+ * @returns True if debug mode is enabled
148
+ */
149
+ get isDebug(): boolean;
150
+ /**
151
+ * Sets whether debug mode is enabled.
152
+ *
153
+ * @param value - True to enable debug mode
154
+ */
155
+ set isDebug(value: boolean);
156
+ /**
157
+ * Gets whether the command line is visible.
158
+ *
159
+ * @returns True if command line should be shown
160
+ */
161
+ get isShowCommandLine(): boolean;
162
+ /**
163
+ * Sets whether the command line is visible.
164
+ *
165
+ * @param value - True to show the command line
166
+ */
167
+ set isShowCommandLine(value: boolean);
168
+ /**
169
+ * Gets whether coordinate display is visible.
170
+ *
171
+ * @returns True if coordinates should be displayed
172
+ */
173
+ get isShowCoordinate(): boolean;
174
+ /**
175
+ * Sets whether coordinate display is visible.
176
+ *
177
+ * @param value - True to show coordinates
178
+ */
179
+ set isShowCoordinate(value: boolean);
180
+ /**
181
+ * Gets whether the toolbar is visible.
182
+ *
183
+ * @returns True if toolbar should be shown
184
+ */
185
+ get isShowToolbar(): boolean;
186
+ /**
187
+ * Sets whether the toolbar is visible.
188
+ *
189
+ * @param value - True to show the toolbar
190
+ */
191
+ set isShowToolbar(value: boolean);
192
+ /**
193
+ * Gets whether performance statistics are displayed.
194
+ *
195
+ * @returns True if stats should be shown
196
+ */
197
+ get isShowStats(): boolean;
198
+ /**
199
+ * Sets whether performance statistics are displayed.
200
+ *
201
+ * @param value - True to show stats
202
+ */
203
+ set isShowStats(value: boolean);
204
+ /**
205
+ * Gets the font mapping configuration.
206
+ *
207
+ * @returns The current font mapping
208
+ */
209
+ get fontMapping(): AcApFontMapping;
210
+ /**
211
+ * Sets the font mapping configuration.
212
+ *
213
+ * @param value - The new font mapping
214
+ */
215
+ set fontMapping(value: AcApFontMapping);
216
+ /**
217
+ * Sets a single font mapping entry.
218
+ *
219
+ * @param originalFont - The original font name
220
+ * @param mappedFont - The replacement font name
221
+ */
222
+ setFontMapping(originalFont: string, mappedFont: string): void;
223
+ /**
224
+ * Gets the current settings object.
225
+ *
226
+ * This method combines localStorage values with default values.
227
+ *
228
+ * @returns The current settings object
229
+ */
230
+ get settings(): NonNullable<AcApSettings & T>;
231
+ }
232
+ //# sourceMappingURL=AcApSettingManager.d.ts.map
@@ -0,0 +1 @@
1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EAAE,CAAC;IAI7B;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IAMhC;;;;OAIG;IACH,IAAI,OAAO,IASQ,OAAO,CAPzB;IAED;;;;OAIG;IACH,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAEzB;IAED;;;;OAIG;IACH,IAAI,iBAAiB,IASQ,OAAO,CAPnC;IAED;;;;OAIG;IACH,IAAI,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAEnC;IAED;;;;OAIG;IACH,IAAI,gBAAgB,IASQ,OAAO,CAPlC;IAED;;;;OAIG;IACH,IAAI,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAElC;IAED;;;;OAIG;IACH,IAAI,aAAa,IASQ,OAAO,CAP/B;IAED;;;;OAIG;IACH,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAE/B;IAED;;;;OAIG;IACH,IAAI,WAAW,IASQ,OAAO,CAP7B;IAED;;;;OAIG;IACH,IAAI,WAAW,CAAC,KAAK,EAAE,OAAO,EAE7B;IAED;;;;OAIG;IACH,IAAI,WAAW,IASQ,eAAe,CAPrC;IAED;;;;OAIG;IACH,IAAI,WAAW,CAAC,KAAK,EAAE,eAAe,EAErC;IAED;;;;;OAKG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAMvD;;;;;;OAMG;IACH,IAAI,QAAQ,kCAIX;CACF"}
@@ -0,0 +1,283 @@
1
+ import { AcCmEventManager } from '@mlightcad/data-model';
2
+ import { defaults } from 'lodash-es';
3
+ /** Default values for all application settings */
4
+ var DEFAULT_VALUES = {
5
+ isDebug: false,
6
+ isShowCommandLine: true,
7
+ isShowCoordinate: true,
8
+ isShowToolbar: true,
9
+ isShowStats: false,
10
+ fontMapping: {}
11
+ };
12
+ /** Local storage key for persisting settings */
13
+ var SETTINGS_LS_KEY = 'settings';
14
+ /**
15
+ * Singleton settings manager for the CAD application.
16
+ *
17
+ * This class manages application-wide settings with:
18
+ * - Persistent storage using localStorage
19
+ * - Event notification when settings change
20
+ * - Type-safe setting access
21
+ * - Default value fallbacks
22
+ *
23
+ * The settings are automatically saved to localStorage and restored on application start.
24
+ *
25
+ * @template T - The settings interface type, defaults to AcApSettings
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * // Get the singleton instance
30
+ * const settings = AcApSettingManager.instance;
31
+ *
32
+ * // Set a setting value
33
+ * settings.set('isShowToolbar', false);
34
+ *
35
+ * // Get a setting value
36
+ * const showToolbar = settings.get('isShowToolbar');
37
+ *
38
+ * // Toggle a boolean setting
39
+ * settings.toggle('isDebug');
40
+ *
41
+ * // Listen for setting changes
42
+ * settings.events.modified.addEventListener(args => {
43
+ * console.log(`Setting ${args.key} changed to:`, args.value);
44
+ * });
45
+ * ```
46
+ */
47
+ var AcApSettingManager = /** @class */ (function () {
48
+ function AcApSettingManager() {
49
+ /** Events fired when settings are modified */
50
+ this.events = {
51
+ /** Fired when any setting is modified */
52
+ modified: new AcCmEventManager()
53
+ };
54
+ }
55
+ Object.defineProperty(AcApSettingManager, "instance", {
56
+ /**
57
+ * Gets the singleton instance of the settings manager.
58
+ *
59
+ * Creates a new instance if one doesn't exist yet.
60
+ *
61
+ * @returns The singleton settings manager instance
62
+ */
63
+ get: function () {
64
+ if (!this._instance) {
65
+ this._instance = new AcApSettingManager();
66
+ }
67
+ return this._instance;
68
+ },
69
+ enumerable: false,
70
+ configurable: true
71
+ });
72
+ /**
73
+ * Sets a setting value and persists it to localStorage.
74
+ *
75
+ * Fires a modified event after the setting is saved.
76
+ *
77
+ * @template K - The setting key type
78
+ * @param key - The setting key to modify
79
+ * @param value - The new value for the setting
80
+ *
81
+ * @example
82
+ * ```typescript
83
+ * settings.set('isShowToolbar', false);
84
+ * settings.set('fontMapping', { 'Arial': 'Helvetica' });
85
+ * ```
86
+ */
87
+ AcApSettingManager.prototype.set = function (key, value) {
88
+ var toggles = this.settings;
89
+ toggles[key] = value;
90
+ localStorage.setItem(SETTINGS_LS_KEY, JSON.stringify(toggles));
91
+ this.events.modified.dispatch({
92
+ key: key,
93
+ value: value
94
+ });
95
+ };
96
+ /**
97
+ * Gets a setting value.
98
+ *
99
+ * Returns the stored value or the default value if not set.
100
+ *
101
+ * @template K - The setting key type
102
+ * @param key - The setting key to retrieve
103
+ * @returns The setting value
104
+ *
105
+ * @example
106
+ * ```typescript
107
+ * const isDebug = settings.get('isDebug');
108
+ * const fontMapping = settings.get('fontMapping');
109
+ * ```
110
+ */
111
+ AcApSettingManager.prototype.get = function (key) {
112
+ return this.settings[key];
113
+ };
114
+ /**
115
+ * Toggles a boolean setting value.
116
+ *
117
+ * Only works with boolean settings. The caller should ensure the setting is boolean.
118
+ *
119
+ * @template K - The setting key type
120
+ * @param key - The boolean setting key to toggle
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * settings.toggle('isDebug'); // false -> true
125
+ * settings.toggle('isShowToolbar'); // true -> false
126
+ * ```
127
+ */
128
+ AcApSettingManager.prototype.toggle = function (key) {
129
+ var value = this.get(key);
130
+ // @ts-expect-error The caller should guarantee the correct feature name passed to this function
131
+ this.set(key, !value);
132
+ };
133
+ Object.defineProperty(AcApSettingManager.prototype, "isDebug", {
134
+ /**
135
+ * Gets whether debug mode is enabled.
136
+ *
137
+ * @returns True if debug mode is enabled
138
+ */
139
+ get: function () {
140
+ return this.get('isDebug');
141
+ },
142
+ /**
143
+ * Sets whether debug mode is enabled.
144
+ *
145
+ * @param value - True to enable debug mode
146
+ */
147
+ set: function (value) {
148
+ this.set('isDebug', value);
149
+ },
150
+ enumerable: false,
151
+ configurable: true
152
+ });
153
+ Object.defineProperty(AcApSettingManager.prototype, "isShowCommandLine", {
154
+ /**
155
+ * Gets whether the command line is visible.
156
+ *
157
+ * @returns True if command line should be shown
158
+ */
159
+ get: function () {
160
+ return this.get('isShowCommandLine');
161
+ },
162
+ /**
163
+ * Sets whether the command line is visible.
164
+ *
165
+ * @param value - True to show the command line
166
+ */
167
+ set: function (value) {
168
+ this.set('isShowCommandLine', value);
169
+ },
170
+ enumerable: false,
171
+ configurable: true
172
+ });
173
+ Object.defineProperty(AcApSettingManager.prototype, "isShowCoordinate", {
174
+ /**
175
+ * Gets whether coordinate display is visible.
176
+ *
177
+ * @returns True if coordinates should be displayed
178
+ */
179
+ get: function () {
180
+ return this.get('isShowCoordinate');
181
+ },
182
+ /**
183
+ * Sets whether coordinate display is visible.
184
+ *
185
+ * @param value - True to show coordinates
186
+ */
187
+ set: function (value) {
188
+ this.set('isShowCoordinate', value);
189
+ },
190
+ enumerable: false,
191
+ configurable: true
192
+ });
193
+ Object.defineProperty(AcApSettingManager.prototype, "isShowToolbar", {
194
+ /**
195
+ * Gets whether the toolbar is visible.
196
+ *
197
+ * @returns True if toolbar should be shown
198
+ */
199
+ get: function () {
200
+ return this.get('isShowToolbar');
201
+ },
202
+ /**
203
+ * Sets whether the toolbar is visible.
204
+ *
205
+ * @param value - True to show the toolbar
206
+ */
207
+ set: function (value) {
208
+ this.set('isShowToolbar', value);
209
+ },
210
+ enumerable: false,
211
+ configurable: true
212
+ });
213
+ Object.defineProperty(AcApSettingManager.prototype, "isShowStats", {
214
+ /**
215
+ * Gets whether performance statistics are displayed.
216
+ *
217
+ * @returns True if stats should be shown
218
+ */
219
+ get: function () {
220
+ return this.get('isShowStats');
221
+ },
222
+ /**
223
+ * Sets whether performance statistics are displayed.
224
+ *
225
+ * @param value - True to show stats
226
+ */
227
+ set: function (value) {
228
+ this.set('isShowStats', value);
229
+ },
230
+ enumerable: false,
231
+ configurable: true
232
+ });
233
+ Object.defineProperty(AcApSettingManager.prototype, "fontMapping", {
234
+ /**
235
+ * Gets the font mapping configuration.
236
+ *
237
+ * @returns The current font mapping
238
+ */
239
+ get: function () {
240
+ return this.get('fontMapping');
241
+ },
242
+ /**
243
+ * Sets the font mapping configuration.
244
+ *
245
+ * @param value - The new font mapping
246
+ */
247
+ set: function (value) {
248
+ this.set('fontMapping', value);
249
+ },
250
+ enumerable: false,
251
+ configurable: true
252
+ });
253
+ /**
254
+ * Sets a single font mapping entry.
255
+ *
256
+ * @param originalFont - The original font name
257
+ * @param mappedFont - The replacement font name
258
+ */
259
+ AcApSettingManager.prototype.setFontMapping = function (originalFont, mappedFont) {
260
+ var mapping = this.get('fontMapping');
261
+ mapping[originalFont] = mappedFont;
262
+ this.set('fontMapping', mapping);
263
+ };
264
+ Object.defineProperty(AcApSettingManager.prototype, "settings", {
265
+ /**
266
+ * Gets the current settings object.
267
+ *
268
+ * This method combines localStorage values with default values.
269
+ *
270
+ * @returns The current settings object
271
+ */
272
+ get: function () {
273
+ var values = localStorage.getItem(SETTINGS_LS_KEY);
274
+ var results = (values == null ? {} : JSON.parse(values));
275
+ return defaults(results, DEFAULT_VALUES);
276
+ },
277
+ enumerable: false,
278
+ configurable: true
279
+ });
280
+ return AcApSettingManager;
281
+ }());
282
+ export { AcApSettingManager };
283
+ //# sourceMappingURL=AcApSettingManager.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApSettingManager.js","sourceRoot":"","sources":["../../src/app/AcApSettingManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAuCpC,kDAAkD;AAClD,IAAM,cAAc,GAAiB;IACnC,OAAO,EAAE,KAAK;IACd,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;IACtB,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,KAAK;IAClB,WAAW,EAAE,EAAE;CAChB,CAAA;AAED,gDAAgD;AAChD,IAAM,eAAe,GAAG,UAAU,CAAA;AAgBlC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH;IAAA;QAIE,8CAA8C;QAC9B,WAAM,GAAG;YACvB,yCAAyC;YACzC,QAAQ,EAAE,IAAI,gBAAgB,EAAkC;SACjE,CAAA;IAoN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;QAClC,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC;IASD,sBAAI,wCAAQ;QAPZ;;;;;;WAMG;aACH;YACE,IAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,eAAe,CAAC,CAAA;YACpD,IAAM,OAAO,GAAG,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAM,CAAA;YAC/D,OAAO,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC,CAAA;QAC1C,CAAC;;;OAAA;IACH,yBAAC;AAAD,CAAC,AA5ND,IA4NC"}
@@ -0,0 +1,6 @@
1
+ export * from './AcApContext';
2
+ export * from './AcApDocument';
3
+ export * from './AcApDocManager';
4
+ export * from './AcApGlobalFunc';
5
+ export * from './AcApSettingManager';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,6 @@
1
+ export * from './AcApContext';
2
+ export * from './AcApDocument';
3
+ export * from './AcApDocManager';
4
+ export * from './AcApGlobalFunc';
5
+ export * from './AcApSettingManager';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/app/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,kBAAkB,CAAA;AAChC,cAAc,kBAAkB,CAAA;AAChC,cAAc,sBAAsB,CAAA"}
@@ -0,0 +1,32 @@
1
+ import { AcApContext } from '../app';
2
+ import { AcEdCommand } from '../command';
3
+ /**
4
+ * Command for converting the current CAD drawing to SVG format.
5
+ *
6
+ * This command creates an SVG converter and initiates the conversion
7
+ * process to export the current drawing as an SVG file. The command:
8
+ * - Creates a new SVG converter instance
9
+ * - Converts all entities in the current document to SVG
10
+ * - Automatically downloads the SVG file
11
+ *
12
+ * This is useful for exporting drawings to a web-friendly vector format
13
+ * that can be displayed in browsers or used in web applications.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const convertCmd = new AcApConvertToSvgCmd();
18
+ * convertCmd.execute(context); // Converts and downloads as SVG
19
+ * ```
20
+ */
21
+ export declare class AcApConvertToSvgCmd extends AcEdCommand {
22
+ /**
23
+ * Executes the SVG conversion command.
24
+ *
25
+ * Creates a converter instance and initiates the conversion process
26
+ * for the current document.
27
+ *
28
+ * @param _context - The application context (unused in this command)
29
+ */
30
+ execute(_context: AcApContext): void;
31
+ }
32
+ //# sourceMappingURL=AcApConvertToSvgCmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApConvertToSvgCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApConvertToSvgCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD;;;;;;;OAOG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAI9B"}
@@ -0,0 +1,56 @@
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 { AcApSvgConvertor } from './AcApSvgConvertor';
18
+ /**
19
+ * Command for converting the current CAD drawing to SVG format.
20
+ *
21
+ * This command creates an SVG converter and initiates the conversion
22
+ * process to export the current drawing as an SVG file. The command:
23
+ * - Creates a new SVG converter instance
24
+ * - Converts all entities in the current document to SVG
25
+ * - Automatically downloads the SVG file
26
+ *
27
+ * This is useful for exporting drawings to a web-friendly vector format
28
+ * that can be displayed in browsers or used in web applications.
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * const convertCmd = new AcApConvertToSvgCmd();
33
+ * convertCmd.execute(context); // Converts and downloads as SVG
34
+ * ```
35
+ */
36
+ var AcApConvertToSvgCmd = /** @class */ (function (_super) {
37
+ __extends(AcApConvertToSvgCmd, _super);
38
+ function AcApConvertToSvgCmd() {
39
+ return _super !== null && _super.apply(this, arguments) || this;
40
+ }
41
+ /**
42
+ * Executes the SVG conversion command.
43
+ *
44
+ * Creates a converter instance and initiates the conversion process
45
+ * for the current document.
46
+ *
47
+ * @param _context - The application context (unused in this command)
48
+ */
49
+ AcApConvertToSvgCmd.prototype.execute = function (_context) {
50
+ var converter = new AcApSvgConvertor();
51
+ converter.convert();
52
+ };
53
+ return AcApConvertToSvgCmd;
54
+ }(AcEdCommand));
55
+ export { AcApConvertToSvgCmd };
56
+ //# sourceMappingURL=AcApConvertToSvgCmd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApConvertToSvgCmd.js","sourceRoot":"","sources":["../../src/command/AcApConvertToSvgCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAyC,uCAAW;IAApD;;IAaA,CAAC;IAZC;;;;;;;OAOG;IACH,qCAAO,GAAP,UAAQ,QAAqB;QAC3B,IAAM,SAAS,GAAG,IAAI,gBAAgB,EAAE,CAAA;QACxC,SAAS,CAAC,OAAO,EAAE,CAAA;IACrB,CAAC;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,WAAW,GAanD"}
@@ -0,0 +1,37 @@
1
+ import { AcApContext } from '../app';
2
+ import { AcEdCommand } from '../command';
3
+ /**
4
+ * Command to open a CAD file.
5
+ *
6
+ * This command triggers the file opening workflow by emitting an 'open-file' event
7
+ * on the global event bus. The actual file opening logic is handled by other
8
+ * components listening for this event (typically the UI layer).
9
+ *
10
+ * The command follows the standard CAD pattern where the command itself is lightweight
11
+ * and delegates the actual work to specialized handlers.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const openCommand = new AcApOpenCmd();
16
+ * openCommand.globalName = 'OPEN';
17
+ * openCommand.localName = 'Open File';
18
+ *
19
+ * // Trigger the command
20
+ * openCommand.trigger(docManager.context);
21
+ *
22
+ * // The command will emit 'open-file' event for UI components to handle
23
+ * ```
24
+ */
25
+ export declare class AcApOpenCmd extends AcEdCommand {
26
+ /**
27
+ * Executes the open file command.
28
+ *
29
+ * Emits an 'open-file' event on the global event bus to trigger
30
+ * the file opening workflow. UI components typically listen for
31
+ * this event to display file selection dialogs.
32
+ *
33
+ * @param _context - The current application context (not used in this command)
34
+ */
35
+ execute(_context: AcApContext): void;
36
+ }
37
+ //# sourceMappingURL=AcApOpenCmd.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AcApOpenCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApOpenCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAGxC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;;OAQG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAG9B"}