@mlightcad/cad-simple-viewer 1.0.0 → 1.0.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/README.md +296 -2
- package/dist/index.js +1348 -122
- package/dist/index.umd.cjs +2 -2
- package/lib/app/AcApContext.d.ts +45 -3
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +43 -3
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocCreator.d.ts +68 -2
- package/lib/app/AcApDocCreator.d.ts.map +1 -1
- package/lib/app/AcApDocCreator.js +67 -2
- package/lib/app/AcApDocCreator.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +227 -12
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +229 -17
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +77 -3
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +75 -3
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApFontLoader.d.ts +32 -0
- package/lib/app/AcApFontLoader.d.ts.map +1 -1
- package/lib/app/AcApFontLoader.js +30 -0
- package/lib/app/AcApFontLoader.js.map +1 -1
- package/lib/app/AcApSettingManager.d.ts +191 -3
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +161 -0
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts +26 -0
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.js +26 -0
- package/lib/command/AcApConvertToSvgCmd.js.map +1 -1
- package/lib/command/AcApOpenCmd.d.ts +31 -0
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +31 -0
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApPanCmd.d.ts +25 -0
- package/lib/command/AcApPanCmd.d.ts.map +1 -1
- package/lib/command/AcApPanCmd.js +25 -0
- package/lib/command/AcApPanCmd.js.map +1 -1
- package/lib/command/AcApQNewCmd.d.ts +26 -0
- package/lib/command/AcApQNewCmd.d.ts.map +1 -1
- package/lib/command/AcApQNewCmd.js +26 -0
- package/lib/command/AcApQNewCmd.js.map +1 -1
- package/lib/command/AcApSelectCmd.d.ts +26 -0
- package/lib/command/AcApSelectCmd.d.ts.map +1 -1
- package/lib/command/AcApSelectCmd.js +26 -0
- package/lib/command/AcApSelectCmd.js.map +1 -1
- package/lib/command/AcApSvgConvertor.d.ts +48 -0
- package/lib/command/AcApSvgConvertor.d.ts.map +1 -1
- package/lib/command/AcApSvgConvertor.js +48 -0
- package/lib/command/AcApSvgConvertor.js.map +1 -1
- package/lib/command/AcApZoomCmd.d.ts +29 -0
- package/lib/command/AcApZoomCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomCmd.js +29 -0
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +57 -0
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +57 -0
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/editor/command/AcEdCommand.d.ts +118 -9
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +113 -9
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +59 -5
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +48 -5
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/global/eventBus.d.ts +76 -7
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js +38 -0
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/input/AcEdBaseInput.d.ts +65 -1
- package/lib/editor/input/AcEdBaseInput.d.ts.map +1 -1
- package/lib/editor/input/AcEdBaseInput.js +62 -1
- package/lib/editor/input/AcEdBaseInput.js.map +1 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +81 -0
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +1 -1
- package/lib/editor/input/AcEdBoxSelector.js +80 -0
- package/lib/editor/input/AcEdBoxSelector.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +95 -8
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +95 -11
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +38 -1
- package/lib/editor/input/AcEdInputPoint.d.ts.map +1 -1
- package/lib/editor/input/AcEdInputPoint.js +38 -1
- package/lib/editor/input/AcEdInputPoint.js.map +1 -1
- package/lib/editor/input/AcEdJig.d.ts +166 -0
- package/lib/editor/input/AcEdJig.d.ts.map +1 -1
- package/lib/editor/input/AcEdJig.js +164 -0
- package/lib/editor/input/AcEdJig.js.map +1 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +49 -0
- package/lib/editor/input/AcEdJigLoop.d.ts.map +1 -1
- package/lib/editor/input/AcEdJigLoop.js +48 -0
- package/lib/editor/input/AcEdJigLoop.js.map +1 -1
- package/lib/editor/input/AcEdSelectionSet.d.ts +122 -2
- package/lib/editor/input/AcEdSelectionSet.d.ts.map +1 -1
- package/lib/editor/input/AcEdSelectionSet.js +117 -1
- package/lib/editor/input/AcEdSelectionSet.js.map +1 -1
- package/lib/editor/input/AcEditor.d.ts +90 -6
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +86 -6
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +163 -16
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +94 -5
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/util/AcTrGeometryUtil.d.ts +65 -0
- package/lib/util/AcTrGeometryUtil.d.ts.map +1 -1
- package/lib/util/AcTrGeometryUtil.js +65 -0
- package/lib/util/AcTrGeometryUtil.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +40 -5
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +34 -5
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +122 -23
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +103 -23
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrLayoutView.d.ts +74 -16
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +65 -16
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrLayoutViewManager.d.ts +58 -12
- package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -1
- package/lib/view/AcTrLayoutViewManager.js +56 -12
- package/lib/view/AcTrLayoutViewManager.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +48 -4
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +44 -4
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +71 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +65 -0
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +8 -4
|
@@ -1,11 +1,68 @@
|
|
|
1
1
|
import { AcApContext } from '../app';
|
|
2
2
|
import { AcEdCommand } from '../command';
|
|
3
3
|
import { AcEdBaseView, AcEdJig } from '../editor';
|
|
4
|
+
/**
|
|
5
|
+
* Jig for handling zoom-to-box selection interaction.
|
|
6
|
+
*
|
|
7
|
+
* This jig handles the user interaction for selecting a rectangular
|
|
8
|
+
* area to zoom to. It extends {@link AcEdJig} to provide interactive
|
|
9
|
+
* selection capabilities.
|
|
10
|
+
*
|
|
11
|
+
* The jig allows users to:
|
|
12
|
+
* - Select a rectangular area on the drawing
|
|
13
|
+
* - Zoom the view to fit the selected area
|
|
14
|
+
* - Provide visual feedback during selection
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const jig = new AcApZoomToBoxJig(view);
|
|
19
|
+
* await jig.drag(); // User selects area to zoom to
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
4
22
|
export declare class AcApZoomToBoxJig extends AcEdJig<boolean> {
|
|
23
|
+
/**
|
|
24
|
+
* Creates a new zoom-to-box jig.
|
|
25
|
+
*
|
|
26
|
+
* @param view - The view that will be zoomed
|
|
27
|
+
*/
|
|
5
28
|
constructor(view: AcEdBaseView);
|
|
29
|
+
/**
|
|
30
|
+
* Handles the selection sampling and zooming operation.
|
|
31
|
+
*
|
|
32
|
+
* This method gets the user's selection box and applies
|
|
33
|
+
* the zoom operation to fit that area in the view.
|
|
34
|
+
*
|
|
35
|
+
* @returns Promise that resolves when the zoom operation completes
|
|
36
|
+
*/
|
|
6
37
|
sampler(): Promise<void>;
|
|
7
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Command for zooming to a user-selected rectangular area.
|
|
41
|
+
*
|
|
42
|
+
* This command initiates an interactive zoom-to-box operation where:
|
|
43
|
+
* - User selects a rectangular area by dragging
|
|
44
|
+
* - The view zooms to fit the selected area
|
|
45
|
+
* - The zoom level is adjusted to show the entire selected region
|
|
46
|
+
*
|
|
47
|
+
* This provides precise navigation control, allowing users to quickly
|
|
48
|
+
* focus on specific areas of large drawings.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const zoomToBoxCmd = new AcApZoomToBoxCmd();
|
|
53
|
+
* await zoomToBoxCmd.execute(context); // User selects area to zoom to
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
8
56
|
export declare class AcApZoomToBoxCmd extends AcEdCommand {
|
|
57
|
+
/**
|
|
58
|
+
* Executes the zoom-to-box command.
|
|
59
|
+
*
|
|
60
|
+
* Creates a jig for interactive area selection and initiates
|
|
61
|
+
* the drag operation for the user to select the zoom area.
|
|
62
|
+
*
|
|
63
|
+
* @param context - The application context containing the view
|
|
64
|
+
* @returns Promise that resolves when the zoom operation completes
|
|
65
|
+
*/
|
|
9
66
|
execute(context: AcApContext): Promise<void>;
|
|
10
67
|
}
|
|
11
68
|
//# sourceMappingURL=AcApZoomToBoxCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomToBoxCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AcApZoomToBoxCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AAEpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,OAAO,CAAC;IACpD;;;;OAIG;gBACS,IAAI,EAAE,YAAY;IAI9B;;;;;;;OAOG;IACG,OAAO;CAKd;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;OAQG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CAInC"}
|
|
@@ -52,11 +52,42 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
import { AcApDocManager } from '../app';
|
|
53
53
|
import { AcEdCommand } from '../command';
|
|
54
54
|
import { AcEdJig } from '../editor';
|
|
55
|
+
/**
|
|
56
|
+
* Jig for handling zoom-to-box selection interaction.
|
|
57
|
+
*
|
|
58
|
+
* This jig handles the user interaction for selecting a rectangular
|
|
59
|
+
* area to zoom to. It extends {@link AcEdJig} to provide interactive
|
|
60
|
+
* selection capabilities.
|
|
61
|
+
*
|
|
62
|
+
* The jig allows users to:
|
|
63
|
+
* - Select a rectangular area on the drawing
|
|
64
|
+
* - Zoom the view to fit the selected area
|
|
65
|
+
* - Provide visual feedback during selection
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const jig = new AcApZoomToBoxJig(view);
|
|
70
|
+
* await jig.drag(); // User selects area to zoom to
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
55
73
|
var AcApZoomToBoxJig = /** @class */ (function (_super) {
|
|
56
74
|
__extends(AcApZoomToBoxJig, _super);
|
|
75
|
+
/**
|
|
76
|
+
* Creates a new zoom-to-box jig.
|
|
77
|
+
*
|
|
78
|
+
* @param view - The view that will be zoomed
|
|
79
|
+
*/
|
|
57
80
|
function AcApZoomToBoxJig(view) {
|
|
58
81
|
return _super.call(this, view) || this;
|
|
59
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Handles the selection sampling and zooming operation.
|
|
85
|
+
*
|
|
86
|
+
* This method gets the user's selection box and applies
|
|
87
|
+
* the zoom operation to fit that area in the view.
|
|
88
|
+
*
|
|
89
|
+
* @returns Promise that resolves when the zoom operation completes
|
|
90
|
+
*/
|
|
60
91
|
AcApZoomToBoxJig.prototype.sampler = function () {
|
|
61
92
|
return __awaiter(this, void 0, void 0, function () {
|
|
62
93
|
var _this = this;
|
|
@@ -75,11 +106,37 @@ var AcApZoomToBoxJig = /** @class */ (function (_super) {
|
|
|
75
106
|
return AcApZoomToBoxJig;
|
|
76
107
|
}(AcEdJig));
|
|
77
108
|
export { AcApZoomToBoxJig };
|
|
109
|
+
/**
|
|
110
|
+
* Command for zooming to a user-selected rectangular area.
|
|
111
|
+
*
|
|
112
|
+
* This command initiates an interactive zoom-to-box operation where:
|
|
113
|
+
* - User selects a rectangular area by dragging
|
|
114
|
+
* - The view zooms to fit the selected area
|
|
115
|
+
* - The zoom level is adjusted to show the entire selected region
|
|
116
|
+
*
|
|
117
|
+
* This provides precise navigation control, allowing users to quickly
|
|
118
|
+
* focus on specific areas of large drawings.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const zoomToBoxCmd = new AcApZoomToBoxCmd();
|
|
123
|
+
* await zoomToBoxCmd.execute(context); // User selects area to zoom to
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
78
126
|
var AcApZoomToBoxCmd = /** @class */ (function (_super) {
|
|
79
127
|
__extends(AcApZoomToBoxCmd, _super);
|
|
80
128
|
function AcApZoomToBoxCmd() {
|
|
81
129
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
82
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* Executes the zoom-to-box command.
|
|
133
|
+
*
|
|
134
|
+
* Creates a jig for interactive area selection and initiates
|
|
135
|
+
* the drag operation for the user to select the zoom area.
|
|
136
|
+
*
|
|
137
|
+
* @param context - The application context containing the view
|
|
138
|
+
* @returns Promise that resolves when the zoom operation completes
|
|
139
|
+
*/
|
|
83
140
|
AcApZoomToBoxCmd.prototype.execute = function (context) {
|
|
84
141
|
return __awaiter(this, void 0, void 0, function () {
|
|
85
142
|
var jig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomToBoxCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;IAAsC,oCAAgB;IACpD,0BAAY,IAAkB;QAC5B,OAAA,MAAK,YAAC,IAAI,CAAC,SAAA;IACb,CAAC;
|
|
1
|
+
{"version":3,"file":"AcApZoomToBoxCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAgB,OAAO,EAAE,MAAM,WAAW,CAAA;AAEjD;;;;;;;;;;;;;;;;;GAiBG;AACH;IAAsC,oCAAgB;IACpD;;;;OAIG;IACH,0BAAY,IAAkB;QAC5B,OAAA,MAAK,YAAC,IAAI,CAAC,SAAA;IACb,CAAC;IAED;;;;;;;OAOG;IACG,kCAAO,GAAb;;;;;4BACE,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;4BAC1D,OAAO,KAAI,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;wBACjC,CAAC,CAAC,EAAA;;wBAFF,SAEE,CAAA;;;;;KACH;IACH,uBAAC;AAAD,CAAC,AAvBD,CAAsC,OAAO,GAuB5C;;AAED;;;;;;;;;;;;;;;;GAgBG;AACH;IAAsC,oCAAW;IAAjD;;IAcA,CAAC;IAbC;;;;;;;;OAQG;IACG,kCAAO,GAAb,UAAc,OAAoB;;;;;;wBAC1B,GAAG,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;wBAC9C,qBAAM,GAAG,CAAC,IAAI,EAAE,EAAA;;wBAAhB,SAAgB,CAAA;;;;;KACjB;IACH,uBAAC;AAAD,CAAC,AAdD,CAAsC,WAAW,GAchD"}
|
|
@@ -1,41 +1,150 @@
|
|
|
1
1
|
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
2
|
import { AcApContext } from '../../app';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Event arguments for command lifecycle events.
|
|
5
|
+
*
|
|
6
|
+
* Contains the command instance that triggered the event.
|
|
5
7
|
*/
|
|
6
8
|
export interface AcEdCommandEventArgs {
|
|
9
|
+
/** The command instance involved in the event */
|
|
7
10
|
command: AcEdCommand;
|
|
8
11
|
}
|
|
9
12
|
/**
|
|
10
|
-
*
|
|
13
|
+
* Abstract base class for all CAD commands.
|
|
14
|
+
*
|
|
15
|
+
* This class provides the foundation for implementing CAD commands with:
|
|
16
|
+
* - Command name management (global and localized names)
|
|
17
|
+
* - Lifecycle event handling (command start/end)
|
|
18
|
+
* - Execution framework with context access
|
|
19
|
+
* - Event notification system
|
|
20
|
+
*
|
|
21
|
+
* Commands are the primary way users interact with the CAD system. Each command
|
|
22
|
+
* represents a specific operation like drawing lines, selecting objects, zooming, etc.
|
|
23
|
+
*
|
|
24
|
+
* ## Command Lifecycle
|
|
25
|
+
* 1. Command is triggered via `trigger()` method
|
|
26
|
+
* 2. `commandWillStart` event is fired
|
|
27
|
+
* 3. `execute()` method is called with current context
|
|
28
|
+
* 4. `commandEnded` event is fired
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* class MyDrawCommand extends AcEdCommand {
|
|
33
|
+
* constructor() {
|
|
34
|
+
* super();
|
|
35
|
+
* this.globalName = 'DRAW';
|
|
36
|
+
* this.localName = 'Draw Line';
|
|
37
|
+
* }
|
|
38
|
+
*
|
|
39
|
+
* execute(context: AcApContext) {
|
|
40
|
+
* // Implement command logic here
|
|
41
|
+
* const view = context.view;
|
|
42
|
+
* const document = context.doc;
|
|
43
|
+
* // ... drawing logic
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
*
|
|
47
|
+
* // Usage
|
|
48
|
+
* const command = new MyDrawCommand();
|
|
49
|
+
* command.events.commandWillStart.addEventListener(args => {
|
|
50
|
+
* console.log('Command starting:', args.command.globalName);
|
|
51
|
+
* });
|
|
52
|
+
* command.trigger(context);
|
|
53
|
+
* ```
|
|
11
54
|
*/
|
|
12
55
|
export declare abstract class AcEdCommand {
|
|
56
|
+
/** The global (untranslated) name of the command */
|
|
13
57
|
private _globalName;
|
|
58
|
+
/** The local (translated) name of the command */
|
|
14
59
|
private _localName;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a new command instance.
|
|
62
|
+
*
|
|
63
|
+
* Initializes the command with empty names. Subclasses should set
|
|
64
|
+
* appropriate global and local names in their constructors.
|
|
65
|
+
*/
|
|
15
66
|
constructor();
|
|
67
|
+
/** Events fired during command execution lifecycle */
|
|
16
68
|
readonly events: {
|
|
69
|
+
/** Fired just before the command starts executing */
|
|
17
70
|
commandWillStart: AcCmEventManager<AcEdCommandEventArgs>;
|
|
71
|
+
/** Fired after the command finishes executing */
|
|
18
72
|
commandEnded: AcCmEventManager<AcEdCommandEventArgs>;
|
|
19
73
|
};
|
|
20
74
|
/**
|
|
21
|
-
*
|
|
75
|
+
* Gets the global (untranslated) name of the command.
|
|
76
|
+
*
|
|
77
|
+
* The global name is typically used for programmatic access and
|
|
78
|
+
* should remain consistent across different language localizations.
|
|
79
|
+
*
|
|
80
|
+
* @returns The global command name
|
|
22
81
|
*/
|
|
23
82
|
get globalName(): string;
|
|
83
|
+
/**
|
|
84
|
+
* Sets the global (untranslated) name of the command.
|
|
85
|
+
*
|
|
86
|
+
* @param value - The global command name (e.g., 'LINE', 'CIRCLE', 'ZOOM')
|
|
87
|
+
*/
|
|
24
88
|
set globalName(value: string);
|
|
25
89
|
/**
|
|
26
|
-
*
|
|
90
|
+
* Gets the local (translated) name of the command.
|
|
91
|
+
*
|
|
92
|
+
* The local name is displayed to users and should be localized
|
|
93
|
+
* to the current language/region.
|
|
94
|
+
*
|
|
95
|
+
* @returns The localized command name
|
|
27
96
|
*/
|
|
28
97
|
get localName(): string;
|
|
98
|
+
/**
|
|
99
|
+
* Sets the local (translated) name of the command.
|
|
100
|
+
*
|
|
101
|
+
* @param value - The localized command name (e.g., 'Draw Line', 'Zoom In')
|
|
102
|
+
*/
|
|
29
103
|
set localName(value: string);
|
|
30
104
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
105
|
+
* Triggers the command execution with proper event handling.
|
|
106
|
+
*
|
|
107
|
+
* This method should not be overridden by subclasses as it handles
|
|
108
|
+
* the event notification workflow. Subclasses should implement the
|
|
109
|
+
* `execute()` method instead.
|
|
110
|
+
*
|
|
111
|
+
* The execution flow:
|
|
112
|
+
* 1. Fires `commandWillStart` event
|
|
113
|
+
* 2. Calls the `execute()` method
|
|
114
|
+
* 3. Fires `commandEnded` event
|
|
115
|
+
*
|
|
116
|
+
* @param context - The current application context containing view and document
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```typescript
|
|
120
|
+
* const command = new MyCommand();
|
|
121
|
+
* command.trigger(docManager.context);
|
|
122
|
+
* ```
|
|
34
123
|
*/
|
|
35
124
|
tirgger(context: AcApContext): void;
|
|
36
125
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
126
|
+
* Executes the command logic.
|
|
127
|
+
*
|
|
128
|
+
* This abstract method must be implemented by subclasses to define
|
|
129
|
+
* the specific behavior of the command. The method receives the current
|
|
130
|
+
* application context providing access to the view and document.
|
|
131
|
+
*
|
|
132
|
+
* @param _context - The current application context
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```typescript
|
|
136
|
+
* execute(context: AcApContext) {
|
|
137
|
+
* const view = context.view;
|
|
138
|
+
* const doc = context.doc;
|
|
139
|
+
*
|
|
140
|
+
* // Get user input
|
|
141
|
+
* const point = await view.editor.getPoint();
|
|
142
|
+
*
|
|
143
|
+
* // Create entity in document
|
|
144
|
+
* const entity = new SomeEntity(point);
|
|
145
|
+
* doc.database.addEntity(entity);
|
|
146
|
+
* }
|
|
147
|
+
* ```
|
|
39
148
|
*/
|
|
40
149
|
execute(_context: AcApContext): void;
|
|
41
150
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommand.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC
|
|
1
|
+
{"version":3,"file":"AcEdCommand.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,OAAO,EAAE,WAAW,CAAA;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,8BAAsB,WAAW;IAC/B,oDAAoD;IACpD,OAAO,CAAC,WAAW,CAAQ;IAC3B,iDAAiD;IACjD,OAAO,CAAC,UAAU,CAAQ;IAE1B;;;;;OAKG;;IAMH,sDAAsD;IACtD,SAAgB,MAAM;QACpB,qDAAqD;;QAErD,iDAAiD;;MAElD;IAED;;;;;;;OAOG;IACH,IAAI,UAAU,IASQ,MAAM,CAP3B;IAED;;;;OAIG;IACH,IAAI,UAAU,CAAC,KAAK,EAAE,MAAM,EAE3B;IAED;;;;;;;OAOG;IACH,IAAI,SAAS,IASQ,MAAM,CAP1B;IAED;;;;OAIG;IACH,IAAI,SAAS,CAAC,KAAK,EAAE,MAAM,EAE1B;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,OAAO,EAAE,WAAW;IAM5B;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,OAAO,CAAC,QAAQ,EAAE,WAAW;CAG9B"}
|
|
@@ -1,11 +1,60 @@
|
|
|
1
1
|
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Abstract base class for all CAD commands.
|
|
4
|
+
*
|
|
5
|
+
* This class provides the foundation for implementing CAD commands with:
|
|
6
|
+
* - Command name management (global and localized names)
|
|
7
|
+
* - Lifecycle event handling (command start/end)
|
|
8
|
+
* - Execution framework with context access
|
|
9
|
+
* - Event notification system
|
|
10
|
+
*
|
|
11
|
+
* Commands are the primary way users interact with the CAD system. Each command
|
|
12
|
+
* represents a specific operation like drawing lines, selecting objects, zooming, etc.
|
|
13
|
+
*
|
|
14
|
+
* ## Command Lifecycle
|
|
15
|
+
* 1. Command is triggered via `trigger()` method
|
|
16
|
+
* 2. `commandWillStart` event is fired
|
|
17
|
+
* 3. `execute()` method is called with current context
|
|
18
|
+
* 4. `commandEnded` event is fired
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* class MyDrawCommand extends AcEdCommand {
|
|
23
|
+
* constructor() {
|
|
24
|
+
* super();
|
|
25
|
+
* this.globalName = 'DRAW';
|
|
26
|
+
* this.localName = 'Draw Line';
|
|
27
|
+
* }
|
|
28
|
+
*
|
|
29
|
+
* execute(context: AcApContext) {
|
|
30
|
+
* // Implement command logic here
|
|
31
|
+
* const view = context.view;
|
|
32
|
+
* const document = context.doc;
|
|
33
|
+
* // ... drawing logic
|
|
34
|
+
* }
|
|
35
|
+
* }
|
|
36
|
+
*
|
|
37
|
+
* // Usage
|
|
38
|
+
* const command = new MyDrawCommand();
|
|
39
|
+
* command.events.commandWillStart.addEventListener(args => {
|
|
40
|
+
* console.log('Command starting:', args.command.globalName);
|
|
41
|
+
* });
|
|
42
|
+
* command.trigger(context);
|
|
43
|
+
* ```
|
|
4
44
|
*/
|
|
5
45
|
var AcEdCommand = /** @class */ (function () {
|
|
46
|
+
/**
|
|
47
|
+
* Creates a new command instance.
|
|
48
|
+
*
|
|
49
|
+
* Initializes the command with empty names. Subclasses should set
|
|
50
|
+
* appropriate global and local names in their constructors.
|
|
51
|
+
*/
|
|
6
52
|
function AcEdCommand() {
|
|
53
|
+
/** Events fired during command execution lifecycle */
|
|
7
54
|
this.events = {
|
|
55
|
+
/** Fired just before the command starts executing */
|
|
8
56
|
commandWillStart: new AcCmEventManager(),
|
|
57
|
+
/** Fired after the command finishes executing */
|
|
9
58
|
commandEnded: new AcCmEventManager()
|
|
10
59
|
};
|
|
11
60
|
this._globalName = '';
|
|
@@ -13,11 +62,21 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
13
62
|
}
|
|
14
63
|
Object.defineProperty(AcEdCommand.prototype, "globalName", {
|
|
15
64
|
/**
|
|
16
|
-
*
|
|
65
|
+
* Gets the global (untranslated) name of the command.
|
|
66
|
+
*
|
|
67
|
+
* The global name is typically used for programmatic access and
|
|
68
|
+
* should remain consistent across different language localizations.
|
|
69
|
+
*
|
|
70
|
+
* @returns The global command name
|
|
17
71
|
*/
|
|
18
72
|
get: function () {
|
|
19
73
|
return this._globalName;
|
|
20
74
|
},
|
|
75
|
+
/**
|
|
76
|
+
* Sets the global (untranslated) name of the command.
|
|
77
|
+
*
|
|
78
|
+
* @param value - The global command name (e.g., 'LINE', 'CIRCLE', 'ZOOM')
|
|
79
|
+
*/
|
|
21
80
|
set: function (value) {
|
|
22
81
|
this._globalName = value;
|
|
23
82
|
},
|
|
@@ -26,11 +85,21 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
26
85
|
});
|
|
27
86
|
Object.defineProperty(AcEdCommand.prototype, "localName", {
|
|
28
87
|
/**
|
|
29
|
-
*
|
|
88
|
+
* Gets the local (translated) name of the command.
|
|
89
|
+
*
|
|
90
|
+
* The local name is displayed to users and should be localized
|
|
91
|
+
* to the current language/region.
|
|
92
|
+
*
|
|
93
|
+
* @returns The localized command name
|
|
30
94
|
*/
|
|
31
95
|
get: function () {
|
|
32
96
|
return this._localName;
|
|
33
97
|
},
|
|
98
|
+
/**
|
|
99
|
+
* Sets the local (translated) name of the command.
|
|
100
|
+
*
|
|
101
|
+
* @param value - The localized command name (e.g., 'Draw Line', 'Zoom In')
|
|
102
|
+
*/
|
|
34
103
|
set: function (value) {
|
|
35
104
|
this._localName = value;
|
|
36
105
|
},
|
|
@@ -38,9 +107,24 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
38
107
|
configurable: true
|
|
39
108
|
});
|
|
40
109
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
110
|
+
* Triggers the command execution with proper event handling.
|
|
111
|
+
*
|
|
112
|
+
* This method should not be overridden by subclasses as it handles
|
|
113
|
+
* the event notification workflow. Subclasses should implement the
|
|
114
|
+
* `execute()` method instead.
|
|
115
|
+
*
|
|
116
|
+
* The execution flow:
|
|
117
|
+
* 1. Fires `commandWillStart` event
|
|
118
|
+
* 2. Calls the `execute()` method
|
|
119
|
+
* 3. Fires `commandEnded` event
|
|
120
|
+
*
|
|
121
|
+
* @param context - The current application context containing view and document
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```typescript
|
|
125
|
+
* const command = new MyCommand();
|
|
126
|
+
* command.trigger(docManager.context);
|
|
127
|
+
* ```
|
|
44
128
|
*/
|
|
45
129
|
AcEdCommand.prototype.tirgger = function (context) {
|
|
46
130
|
this.events.commandWillStart.dispatch({ command: this });
|
|
@@ -48,11 +132,31 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
48
132
|
this.events.commandEnded.dispatch({ command: this });
|
|
49
133
|
};
|
|
50
134
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
135
|
+
* Executes the command logic.
|
|
136
|
+
*
|
|
137
|
+
* This abstract method must be implemented by subclasses to define
|
|
138
|
+
* the specific behavior of the command. The method receives the current
|
|
139
|
+
* application context providing access to the view and document.
|
|
140
|
+
*
|
|
141
|
+
* @param _context - The current application context
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* execute(context: AcApContext) {
|
|
146
|
+
* const view = context.view;
|
|
147
|
+
* const doc = context.doc;
|
|
148
|
+
*
|
|
149
|
+
* // Get user input
|
|
150
|
+
* const point = await view.editor.getPoint();
|
|
151
|
+
*
|
|
152
|
+
* // Create entity in document
|
|
153
|
+
* const entity = new SomeEntity(point);
|
|
154
|
+
* doc.database.addEntity(entity);
|
|
155
|
+
* }
|
|
156
|
+
* ```
|
|
53
157
|
*/
|
|
54
158
|
AcEdCommand.prototype.execute = function (_context) {
|
|
55
|
-
// Do nothing
|
|
159
|
+
// Do nothing - subclasses should override this method
|
|
56
160
|
};
|
|
57
161
|
return AcEdCommand;
|
|
58
162
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommand.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"AcEdCommand.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAcxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH;IAME;;;;;OAKG;IACH;QAKA,sDAAsD;QACtC,WAAM,GAAG;YACvB,qDAAqD;YACrD,gBAAgB,EAAE,IAAI,gBAAgB,EAAwB;YAC9D,iDAAiD;YACjD,YAAY,EAAE,IAAI,gBAAgB,EAAwB;SAC3D,CAAA;QAVC,IAAI,CAAC,WAAW,GAAG,EAAE,CAAA;QACrB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;IACtB,CAAC;IAkBD,sBAAI,mCAAU;QARd;;;;;;;WAOG;aACH;YACE,OAAO,IAAI,CAAC,WAAW,CAAA;QACzB,CAAC;QAED;;;;WAIG;aACH,UAAe,KAAa;YAC1B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAA;QAC1B,CAAC;;;OATA;IAmBD,sBAAI,kCAAS;QARb;;;;;;;WAOG;aACH;YACE,OAAO,IAAI,CAAC,UAAU,CAAA;QACxB,CAAC;QAED;;;;WAIG;aACH,UAAc,KAAa;YACzB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAA;QACzB,CAAC;;;OATA;IAWD;;;;;;;;;;;;;;;;;;;OAmBG;IACH,6BAAO,GAAP,UAAQ,OAAoB;QAC1B,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;QACxD,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;QACrB,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;IACtD,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,6BAAO,GAAP,UAAQ,QAAqB;QAC3B,sDAAsD;IACxD,CAAC;IACH,kBAAC;AAAD,CAAC,AAxHD,IAwHC"}
|
|
@@ -1,26 +1,76 @@
|
|
|
1
1
|
import { AcEdCommand } from './AcEdCommand';
|
|
2
2
|
import { AcEdCommandIterator } from './AcEdCommandIterator';
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing a command group in the command stack.
|
|
5
|
+
* Groups commands by name and provides maps for both global and local command lookups.
|
|
6
|
+
*/
|
|
3
7
|
export interface AcEdCommandGroup {
|
|
8
|
+
/** The name of the command group */
|
|
4
9
|
groupName: string;
|
|
10
|
+
/** Map of commands indexed by their global names */
|
|
5
11
|
commandsByGlobalName: Map<string, AcEdCommand>;
|
|
12
|
+
/** Map of commands indexed by their local names */
|
|
6
13
|
commandsByLocalName: Map<string, AcEdCommand>;
|
|
7
14
|
}
|
|
8
15
|
/**
|
|
9
16
|
* The class to create, define, and register command objects.
|
|
17
|
+
*
|
|
18
|
+
* This is a singleton class that manages all command registration and lookup functionality.
|
|
19
|
+
* Commands are organized into groups, with system commands (ACAD) and user commands (USER)
|
|
20
|
+
* being the default groups.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const commandStack = AcEdCommandStack.instance;
|
|
25
|
+
* commandStack.addCommand('USER', 'MYCOMMAND', 'MYCOMMAND', myCommandInstance);
|
|
26
|
+
* const command = commandStack.lookupGlobalCmd('MYCOMMAND');
|
|
27
|
+
* ```
|
|
10
28
|
*/
|
|
11
29
|
export declare class AcEdCommandStack {
|
|
30
|
+
/** The name of the system command group */
|
|
12
31
|
static SYSTEMT_COMMAND_GROUP_NAME: string;
|
|
32
|
+
/** The name of the default user command group */
|
|
13
33
|
static DEFAUT_COMMAND_GROUP_NAME: string;
|
|
34
|
+
/** Array of all command groups in the stack */
|
|
14
35
|
private _commandsByGroup;
|
|
36
|
+
/** Reference to the system command group */
|
|
15
37
|
private _systemCommandGroup;
|
|
38
|
+
/** Reference to the default user command group */
|
|
16
39
|
private _defaultCommandGroup;
|
|
40
|
+
/** Singleton instance of the command stack */
|
|
17
41
|
private static _instance?;
|
|
42
|
+
/**
|
|
43
|
+
* Private constructor to enforce singleton pattern.
|
|
44
|
+
* Initializes the command stack with system and default command groups.
|
|
45
|
+
*/
|
|
18
46
|
private constructor();
|
|
47
|
+
/**
|
|
48
|
+
* Gets the singleton instance of the command stack.
|
|
49
|
+
* Creates a new instance if one doesn't exist.
|
|
50
|
+
*
|
|
51
|
+
* @returns The singleton instance of AcEdCommandStack
|
|
52
|
+
*/
|
|
19
53
|
static get instance(): AcEdCommandStack;
|
|
54
|
+
/**
|
|
55
|
+
* Adds a command to the specified command group.
|
|
56
|
+
*
|
|
57
|
+
* @param cmdGroupName - The name of the command group. If empty, uses the default group.
|
|
58
|
+
* @param cmdGlobalName - The global (untranslated) name of the command. Must be unique within the group.
|
|
59
|
+
* @param cmdLocalName - The local (translated) name of the command. Defaults to global name if empty.
|
|
60
|
+
* @param cmd - The command object to add to the stack.
|
|
61
|
+
*
|
|
62
|
+
* @throws {Error} When the global name is empty or when a command with the same name already exists
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* commandStack.addCommand('USER', 'LINE', 'ligne', new LineCommand());
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
20
69
|
addCommand(cmdGroupName: string, cmdGlobalName: string, cmdLocalName: string, cmd: AcEdCommand): void;
|
|
21
70
|
/**
|
|
22
71
|
* Return an iterator that can be used to traverse all of command objects in this command stack
|
|
23
72
|
* (that is, the iterator iterates through all commands in all groups).
|
|
73
|
+
*
|
|
24
74
|
* @returns Return an iterator that can be used to traverse all of command objects in this command
|
|
25
75
|
* stack.
|
|
26
76
|
*/
|
|
@@ -31,7 +81,8 @@ export declare class AcEdCommandStack {
|
|
|
31
81
|
* matched AcEdCommand object is returned. Otherwise undefined is returned to indicate that the command
|
|
32
82
|
* could not be found. If more than one command of the same name is present in the command stack (that
|
|
33
83
|
* is, in separate command groups), then the first one found is used.
|
|
34
|
-
*
|
|
84
|
+
*
|
|
85
|
+
* @param cmdName - Input the command name to search for
|
|
35
86
|
* @returns Return the matched AcEdCommand object if a match is found. Otherwise, return undefined.
|
|
36
87
|
*/
|
|
37
88
|
lookupGlobalCmd(cmdName: string): AcEdCommand | undefined;
|
|
@@ -41,7 +92,8 @@ export declare class AcEdCommandStack {
|
|
|
41
92
|
* AcEdCommand object is returned. Otherwise undefined is returned to indicate that the command could not
|
|
42
93
|
* be found. If more than one command of the same name is present in the command stack (that is, in
|
|
43
94
|
* separate command groups), then the first one found is used.
|
|
44
|
-
*
|
|
95
|
+
*
|
|
96
|
+
* @param cmdName - Input the command name to search for
|
|
45
97
|
* @returns Return the matched AcEdCommand object if a match is found. Otherwise, return undefined.
|
|
46
98
|
*/
|
|
47
99
|
lookupLocalCmd(cmdName: string): AcEdCommand | undefined;
|
|
@@ -49,8 +101,9 @@ export declare class AcEdCommandStack {
|
|
|
49
101
|
* Remove the command with the global and untranslated name `cmdGlobalName` from the `cmdGroupName`
|
|
50
102
|
* command group. Return true if successful. Return false if no command with the global and untranslated
|
|
51
103
|
* name `cmdGlobalName` is found in the `cmdGroupName` command group.
|
|
52
|
-
*
|
|
53
|
-
* @param
|
|
104
|
+
*
|
|
105
|
+
* @param cmdGroupName - Input the name of the command group containing the command to be removed
|
|
106
|
+
* @param cmdGlobalName - Input the command name which is to be removed from cmdGroupName
|
|
54
107
|
* @returns Return true if successful. Return false if no command with the global and untranslated
|
|
55
108
|
* name `cmdGlobalName` is found in the `cmdGroupName` command group.
|
|
56
109
|
*/
|
|
@@ -58,7 +111,8 @@ export declare class AcEdCommandStack {
|
|
|
58
111
|
/**
|
|
59
112
|
* Remove the command group with the name `GroupName` from the command stack and delete the command group
|
|
60
113
|
* dictionary object and all the AcEdCommand objects stored within it.
|
|
61
|
-
*
|
|
114
|
+
*
|
|
115
|
+
* @param groupName - Input the name of the command group to be removed from the command stack.
|
|
62
116
|
* @returns Return true if successful. Return false if no command group is found with the name `GroupName`.
|
|
63
117
|
*/
|
|
64
118
|
removeGroup(groupName: string): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommandStack.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAC9C,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CAC9C;AAED
|
|
1
|
+
{"version":3,"file":"AcEdCommandStack.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAE3D;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAC9C,mDAAmD;IACnD,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CAC9C;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,gBAAgB;IAC3B,2CAA2C;IAC3C,MAAM,CAAC,0BAA0B,SAAS;IAC1C,iDAAiD;IACjD,MAAM,CAAC,yBAAyB,SAAS;IAEzC,+CAA+C;IAC/C,OAAO,CAAC,gBAAgB,CAAoB;IAC5C,4CAA4C;IAC5C,OAAO,CAAC,mBAAmB,CAAkB;IAC7C,kDAAkD;IAClD,OAAO,CAAC,oBAAoB,CAAkB;IAC9C,8CAA8C;IAC9C,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,CAAkB;IAE3C;;;OAGG;IACH,OAAO;IAgBP;;;;;OAKG;IACH,MAAM,KAAK,QAAQ,qBAKlB;IAED;;;;;;;;;;;;;;OAcG;IACH,UAAU,CACR,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,WAAW;IA2ClB;;;;;;OAMG;IACH,QAAQ;IAIR;;;;;;;;;OASG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM;IAS/B;;;;;;;;;OASG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM;IAS9B;;;;;;;;;OASG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IASrD;;;;;;OAMG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM;CAY9B"}
|