@mlightcad/cad-simple-viewer 1.2.1 → 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.
- package/package.json +6 -6
- package/dist/index.js +0 -33474
- package/dist/index.umd.cjs +0 -294
- package/dist/libredwg-parser-worker.js +0 -15411
- package/dist/mtext-renderer-worker.js +0 -29938
- package/lib/app/AcApContext.d.ts +0 -57
- package/lib/app/AcApContext.d.ts.map +0 -1
- package/lib/app/AcApContext.js +0 -106
- package/lib/app/AcApContext.js.map +0 -1
- package/lib/app/AcApDocManager.d.ts +0 -291
- package/lib/app/AcApDocManager.d.ts.map +0 -1
- package/lib/app/AcApDocManager.js +0 -498
- package/lib/app/AcApDocManager.js.map +0 -1
- package/lib/app/AcApDocument.d.ts +0 -101
- package/lib/app/AcApDocument.d.ts.map +0 -1
- package/lib/app/AcApDocument.js +0 -237
- package/lib/app/AcApDocument.js.map +0 -1
- package/lib/app/AcApFontLoader.d.ts +0 -54
- package/lib/app/AcApFontLoader.d.ts.map +0 -1
- package/lib/app/AcApFontLoader.js +0 -151
- package/lib/app/AcApFontLoader.js.map +0 -1
- package/lib/app/AcApGlobalFunc.d.ts +0 -26
- package/lib/app/AcApGlobalFunc.d.ts.map +0 -1
- package/lib/app/AcApGlobalFunc.js +0 -66
- package/lib/app/AcApGlobalFunc.js.map +0 -1
- package/lib/app/AcApSettingManager.d.ts +0 -232
- package/lib/app/AcApSettingManager.d.ts.map +0 -1
- package/lib/app/AcApSettingManager.js +0 -283
- package/lib/app/AcApSettingManager.js.map +0 -1
- package/lib/app/index.d.ts +0 -6
- package/lib/app/index.d.ts.map +0 -1
- package/lib/app/index.js +0 -6
- package/lib/app/index.js.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts +0 -32
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +0 -1
- package/lib/command/AcApConvertToSvgCmd.js +0 -56
- package/lib/command/AcApConvertToSvgCmd.js.map +0 -1
- package/lib/command/AcApOpenCmd.d.ts +0 -37
- package/lib/command/AcApOpenCmd.d.ts.map +0 -1
- package/lib/command/AcApOpenCmd.js +0 -60
- package/lib/command/AcApOpenCmd.js.map +0 -1
- package/lib/command/AcApPanCmd.d.ts +0 -31
- package/lib/command/AcApPanCmd.d.ts.map +0 -1
- package/lib/command/AcApPanCmd.js +0 -55
- package/lib/command/AcApPanCmd.js.map +0 -1
- package/lib/command/AcApQNewCmd.d.ts +0 -32
- package/lib/command/AcApQNewCmd.d.ts.map +0 -1
- package/lib/command/AcApQNewCmd.js +0 -56
- package/lib/command/AcApQNewCmd.js.map +0 -1
- package/lib/command/AcApRegenCmd.d.ts +0 -21
- package/lib/command/AcApRegenCmd.d.ts.map +0 -1
- package/lib/command/AcApRegenCmd.js +0 -45
- package/lib/command/AcApRegenCmd.js.map +0 -1
- package/lib/command/AcApSelectCmd.d.ts +0 -32
- package/lib/command/AcApSelectCmd.d.ts.map +0 -1
- package/lib/command/AcApSelectCmd.js +0 -56
- package/lib/command/AcApSelectCmd.js.map +0 -1
- package/lib/command/AcApSvgConvertor.d.ts +0 -53
- package/lib/command/AcApSvgConvertor.d.ts.map +0 -1
- package/lib/command/AcApSvgConvertor.js +0 -103
- package/lib/command/AcApSvgConvertor.js.map +0 -1
- package/lib/command/AcApZoomCmd.d.ts +0 -35
- package/lib/command/AcApZoomCmd.d.ts.map +0 -1
- package/lib/command/AcApZoomCmd.js +0 -57
- package/lib/command/AcApZoomCmd.js.map +0 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +0 -68
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +0 -1
- package/lib/command/AcApZoomToBoxCmd.js +0 -158
- package/lib/command/AcApZoomToBoxCmd.js.map +0 -1
- package/lib/command/index.d.ts +0 -11
- package/lib/command/index.d.ts.map +0 -1
- package/lib/command/index.js +0 -11
- package/lib/command/index.js.map +0 -1
- package/lib/editor/command/AcEdCommand.d.ts +0 -151
- package/lib/editor/command/AcEdCommand.d.ts.map +0 -1
- package/lib/editor/command/AcEdCommand.js +0 -164
- package/lib/editor/command/AcEdCommand.js.map +0 -1
- package/lib/editor/command/AcEdCommandIterator.d.ts +0 -36
- package/lib/editor/command/AcEdCommandIterator.d.ts.map +0 -1
- package/lib/editor/command/AcEdCommandIterator.js +0 -65
- package/lib/editor/command/AcEdCommandIterator.js.map +0 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +0 -120
- package/lib/editor/command/AcEdCommandStack.d.ts.map +0 -1
- package/lib/editor/command/AcEdCommandStack.js +0 -235
- package/lib/editor/command/AcEdCommandStack.js.map +0 -1
- package/lib/editor/command/index.d.ts +0 -3
- package/lib/editor/command/index.d.ts.map +0 -1
- package/lib/editor/command/index.js +0 -3
- package/lib/editor/command/index.js.map +0 -1
- package/lib/editor/global/AcEdConditionWaiter.d.ts +0 -51
- package/lib/editor/global/AcEdConditionWaiter.d.ts.map +0 -1
- package/lib/editor/global/AcEdConditionWaiter.js +0 -87
- package/lib/editor/global/AcEdConditionWaiter.js.map +0 -1
- package/lib/editor/global/AcEdGlobalFunc.d.ts +0 -8
- package/lib/editor/global/AcEdGlobalFunc.d.ts.map +0 -1
- package/lib/editor/global/AcEdGlobalFunc.js +0 -14
- package/lib/editor/global/AcEdGlobalFunc.js.map +0 -1
- package/lib/editor/global/AcEdMessage.d.ts +0 -5
- package/lib/editor/global/AcEdMessage.d.ts.map +0 -1
- package/lib/editor/global/AcEdMessage.js +0 -6
- package/lib/editor/global/AcEdMessage.js.map +0 -1
- package/lib/editor/global/eventBus.d.ts +0 -103
- package/lib/editor/global/eventBus.d.ts.map +0 -1
- package/lib/editor/global/eventBus.js +0 -41
- package/lib/editor/global/eventBus.js.map +0 -1
- package/lib/editor/global/index.d.ts +0 -4
- package/lib/editor/global/index.d.ts.map +0 -1
- package/lib/editor/global/index.js +0 -4
- package/lib/editor/global/index.js.map +0 -1
- package/lib/editor/index.d.ts +0 -5
- package/lib/editor/index.d.ts.map +0 -1
- package/lib/editor/index.js +0 -5
- package/lib/editor/index.js.map +0 -1
- package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
- package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
- package/lib/editor/input/AcEdBaseInput.js +0 -166
- package/lib/editor/input/AcEdBaseInput.js.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.js +0 -220
- package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +0 -130
- package/lib/editor/input/AcEdCursorManager.d.ts.map +0 -1
- package/lib/editor/input/AcEdCursorManager.js +0 -155
- package/lib/editor/input/AcEdCursorManager.js.map +0 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
- package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
- package/lib/editor/input/AcEdInputPoint.js +0 -78
- package/lib/editor/input/AcEdInputPoint.js.map +0 -1
- package/lib/editor/input/AcEdJig.d.ts +0 -180
- package/lib/editor/input/AcEdJig.d.ts.map +0 -1
- package/lib/editor/input/AcEdJig.js +0 -256
- package/lib/editor/input/AcEdJig.js.map +0 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
- package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
- package/lib/editor/input/AcEdJigLoop.js +0 -91
- package/lib/editor/input/AcEdJigLoop.js.map +0 -1
- package/lib/editor/input/AcEdSelectionSet.d.ts +0 -146
- package/lib/editor/input/AcEdSelectionSet.d.ts.map +0 -1
- package/lib/editor/input/AcEdSelectionSet.js +0 -179
- package/lib/editor/input/AcEdSelectionSet.js.map +0 -1
- package/lib/editor/input/AcEditor.d.ts +0 -111
- package/lib/editor/input/AcEditor.d.ts.map +0 -1
- package/lib/editor/input/AcEditor.js +0 -183
- package/lib/editor/input/AcEditor.js.map +0 -1
- package/lib/editor/input/index.d.ts +0 -5
- package/lib/editor/input/index.d.ts.map +0 -1
- package/lib/editor/input/index.js +0 -5
- package/lib/editor/input/index.js.map +0 -1
- package/lib/editor/view/AcEdBaseView.d.ts +0 -457
- package/lib/editor/view/AcEdBaseView.d.ts.map +0 -1
- package/lib/editor/view/AcEdBaseView.js +0 -349
- package/lib/editor/view/AcEdBaseView.js.map +0 -1
- package/lib/editor/view/AcEdLayerInfo.d.ts +0 -21
- package/lib/editor/view/AcEdLayerInfo.d.ts.map +0 -1
- package/lib/editor/view/AcEdLayerInfo.js +0 -2
- package/lib/editor/view/AcEdLayerInfo.js.map +0 -1
- package/lib/editor/view/index.d.ts +0 -3
- package/lib/editor/view/index.d.ts.map +0 -1
- package/lib/editor/view/index.js +0 -3
- package/lib/editor/view/index.js.map +0 -1
- package/lib/index.d.ts +0 -5
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -5
- package/lib/index.js.map +0 -1
- package/lib/util/AcTrGeometryUtil.d.ts +0 -92
- package/lib/util/AcTrGeometryUtil.d.ts.map +0 -1
- package/lib/util/AcTrGeometryUtil.js +0 -109
- package/lib/util/AcTrGeometryUtil.js.map +0 -1
- package/lib/util/index.d.ts +0 -2
- package/lib/util/index.d.ts.map +0 -1
- package/lib/util/index.js +0 -2
- package/lib/util/index.js.map +0 -1
- package/lib/view/AcTrLayer.d.ts +0 -132
- package/lib/view/AcTrLayer.d.ts.map +0 -1
- package/lib/view/AcTrLayer.js +0 -199
- package/lib/view/AcTrLayer.js.map +0 -1
- package/lib/view/AcTrLayout.d.ts +0 -218
- package/lib/view/AcTrLayout.d.ts.map +0 -1
- package/lib/view/AcTrLayout.js +0 -437
- package/lib/view/AcTrLayout.js.map +0 -1
- package/lib/view/AcTrLayoutView.d.ts +0 -115
- package/lib/view/AcTrLayoutView.d.ts.map +0 -1
- package/lib/view/AcTrLayoutView.js +0 -200
- package/lib/view/AcTrLayoutView.js.map +0 -1
- package/lib/view/AcTrLayoutViewManager.d.ts +0 -89
- package/lib/view/AcTrLayoutViewManager.d.ts.map +0 -1
- package/lib/view/AcTrLayoutViewManager.js +0 -118
- package/lib/view/AcTrLayoutViewManager.js.map +0 -1
- package/lib/view/AcTrScene.d.ts +0 -162
- package/lib/view/AcTrScene.d.ts.map +0 -1
- package/lib/view/AcTrScene.js +0 -370
- package/lib/view/AcTrScene.js.map +0 -1
- package/lib/view/AcTrView2d.d.ts +0 -262
- package/lib/view/AcTrView2d.d.ts.map +0 -1
- package/lib/view/AcTrView2d.js +0 -772
- package/lib/view/AcTrView2d.js.map +0 -1
- package/lib/view/index.d.ts +0 -2
- package/lib/view/index.d.ts.map +0 -1
- package/lib/view/index.js +0 -2
- package/lib/view/index.js.map +0 -1
|
@@ -1,232 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSettingManager.d.ts","sourceRoot":"","sources":["../../src/app/AcApSett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,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"}
|
|
@@ -1,283 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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;IAoNH,CAAC;IA3MC,sBAAW,8BAAQ;QAPnB;;;;;;WAMG;aACH;YACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;gBACpB,IAAI,CAAC,SAAS,GAAG,IAAI,kBAAkB,EAAE,CAAA;YAC3C,CAAC;YACD,OAAO,IAAI,CAAC,SAAS,CAAA;QACvB,CAAC;;;OAAA;IAED;;;;;;;;;;;;;;OAcG;IACH,gCAAG,GAAH,UAAuB,GAAM,EAAE,KAAW;QACxC,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7B,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAA;QACpB,YAAY,CAAC,OAAO,CAAC,eAAe,EAAE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}
|
package/lib/app/index.d.ts
DELETED
package/lib/app/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/lib/app/index.js
DELETED
package/lib/app/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,32 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -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 { 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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,37 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|