@mlightcad/cad-simple-viewer 1.4.7 → 1.4.9
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/dist/index.js +7749 -6724
- package/dist/index.umd.cjs +23 -23
- package/lib/app/AcApAnnotation.d.ts +46 -0
- package/lib/app/AcApAnnotation.d.ts.map +1 -0
- package/lib/app/AcApAnnotation.js +134 -0
- package/lib/app/AcApAnnotation.js.map +1 -0
- package/lib/app/AcApDocManager.d.ts +118 -6
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +163 -7
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +16 -14
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +48 -31
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +8 -2
- package/lib/app/AcApProgress.d.ts.map +1 -1
- package/lib/app/AcApProgress.js +13 -7
- package/lib/app/AcApProgress.js.map +1 -1
- package/lib/app/AcDbOpenDatabaseOptions.d.ts +28 -0
- package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -0
- package/lib/app/AcDbOpenDatabaseOptions.js +2 -0
- package/lib/app/AcDbOpenDatabaseOptions.js.map +1 -0
- package/lib/app/index.d.ts +2 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +2 -0
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApBaseRevCmd.d.ts +36 -0
- package/lib/command/AcApBaseRevCmd.d.ts.map +1 -0
- package/lib/command/AcApBaseRevCmd.js +68 -0
- package/lib/command/AcApBaseRevCmd.js.map +1 -0
- package/lib/command/AcApCircleCmd.d.ts +1 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -1
- package/lib/command/AcApCircleCmd.js +4 -2
- package/lib/command/AcApCircleCmd.js.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts +1 -1
- package/lib/command/AcApConvertToSvgCmd.d.ts.map +1 -1
- package/lib/command/AcApConvertToSvgCmd.js +44 -2
- package/lib/command/AcApConvertToSvgCmd.js.map +1 -1
- package/lib/command/AcApDimLinearCmd.d.ts +1 -0
- package/lib/command/AcApDimLinearCmd.d.ts.map +1 -1
- package/lib/command/AcApDimLinearCmd.js +4 -2
- package/lib/command/AcApDimLinearCmd.js.map +1 -1
- package/lib/command/AcApEraseCmd.d.ts +1 -0
- package/lib/command/AcApEraseCmd.d.ts.map +1 -1
- package/lib/command/AcApEraseCmd.js +14 -4
- package/lib/command/AcApEraseCmd.js.map +1 -1
- package/lib/command/AcApLineCmd.d.ts +1 -0
- package/lib/command/AcApLineCmd.d.ts.map +1 -1
- package/lib/command/AcApLineCmd.js +4 -2
- package/lib/command/AcApLineCmd.js.map +1 -1
- package/lib/command/AcApLogCmd.d.ts +1 -1
- package/lib/command/AcApLogCmd.d.ts.map +1 -1
- package/lib/command/AcApLogCmd.js +44 -3
- package/lib/command/AcApLogCmd.js.map +1 -1
- package/lib/command/AcApOpenCmd.d.ts +1 -1
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +42 -1
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApPanCmd.d.ts +1 -1
- package/lib/command/AcApPanCmd.d.ts.map +1 -1
- package/lib/command/AcApPanCmd.js +43 -2
- package/lib/command/AcApPanCmd.js.map +1 -1
- package/lib/command/AcApQNewCmd.d.ts +1 -1
- package/lib/command/AcApQNewCmd.d.ts.map +1 -1
- package/lib/command/AcApQNewCmd.js +44 -2
- package/lib/command/AcApQNewCmd.js.map +1 -1
- package/lib/command/AcApRectCmd.d.ts +23 -0
- package/lib/command/AcApRectCmd.d.ts.map +1 -0
- package/lib/command/AcApRectCmd.js +134 -0
- package/lib/command/AcApRectCmd.js.map +1 -0
- package/lib/command/AcApRegenCmd.d.ts +1 -1
- package/lib/command/AcApRegenCmd.d.ts.map +1 -1
- package/lib/command/AcApRegenCmd.js +42 -1
- package/lib/command/AcApRegenCmd.js.map +1 -1
- package/lib/command/AcApRevCircleCmd.d.ts +10 -0
- package/lib/command/AcApRevCircleCmd.d.ts.map +1 -0
- package/lib/command/AcApRevCircleCmd.js +83 -0
- package/lib/command/AcApRevCircleCmd.js.map +1 -0
- package/lib/command/AcApRevCloudCmd.d.ts +26 -0
- package/lib/command/AcApRevCloudCmd.d.ts.map +1 -0
- package/lib/command/AcApRevCloudCmd.js +234 -0
- package/lib/command/AcApRevCloudCmd.js.map +1 -0
- package/lib/command/AcApRevRectCmd.d.ts +10 -0
- package/lib/command/AcApRevRectCmd.d.ts.map +1 -0
- package/lib/command/AcApRevRectCmd.js +83 -0
- package/lib/command/AcApRevRectCmd.js.map +1 -0
- package/lib/command/AcApRevVisibilityCmd.d.ts +15 -0
- package/lib/command/AcApRevVisibilityCmd.d.ts.map +1 -0
- package/lib/command/AcApRevVisibilityCmd.js +90 -0
- package/lib/command/AcApRevVisibilityCmd.js.map +1 -0
- package/lib/command/AcApSelectCmd.d.ts +1 -1
- package/lib/command/AcApSelectCmd.d.ts.map +1 -1
- package/lib/command/AcApSelectCmd.js +43 -2
- package/lib/command/AcApSelectCmd.js.map +1 -1
- package/lib/command/AcApSketchCmd.d.ts +32 -0
- package/lib/command/AcApSketchCmd.d.ts.map +1 -0
- package/lib/command/AcApSketchCmd.js +171 -0
- package/lib/command/AcApSketchCmd.js.map +1 -0
- package/lib/command/AcApSwitchBgCmd.d.ts +14 -0
- package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -0
- package/lib/command/AcApSwitchBgCmd.js +86 -0
- package/lib/command/AcApSwitchBgCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts +2 -1
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
- package/lib/command/AcApSysVarCmd.js +6 -5
- package/lib/command/AcApSysVarCmd.js.map +1 -1
- package/lib/command/AcApZoomCmd.d.ts +1 -1
- package/lib/command/AcApZoomCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomCmd.js +42 -1
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/index.d.ts +8 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +8 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommand.d.ts +81 -22
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +157 -15
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/command/AcEdCommandIterator.d.ts +1 -1
- package/lib/editor/command/AcEdCommandIterator.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +31 -6
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +55 -11
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/input/AcEditor.d.ts +14 -0
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +5 -1
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +4 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.js +11 -3
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -1
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +6 -3
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +2 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +22 -5
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +2 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts +6 -4
- package/lib/editor/input/ui/AcEdFloatingMessage.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingMessage.js +19 -13
- package/lib/editor/input/ui/AcEdFloatingMessage.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +14 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +30 -2
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +42 -6
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdOpenMode.d.ts +26 -0
- package/lib/editor/view/AcEdOpenMode.d.ts.map +1 -0
- package/lib/editor/view/AcEdOpenMode.js +27 -0
- package/lib/editor/view/AcEdOpenMode.js.map +1 -0
- package/lib/editor/view/index.d.ts +2 -0
- package/lib/editor/view/index.d.ts.map +1 -1
- package/lib/editor/view/index.js +2 -0
- package/lib/editor/view/index.js.map +1 -1
- package/lib/i18n/en/command.d.ts +18 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +19 -1
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +8 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +8 -0
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +18 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +18 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +8 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +8 -0
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/plugin/AcApPlugin.d.ts +83 -0
- package/lib/plugin/AcApPlugin.d.ts.map +1 -0
- package/lib/plugin/AcApPlugin.js +2 -0
- package/lib/plugin/AcApPlugin.js.map +1 -0
- package/lib/plugin/AcApPluginExample.d.ts +23 -0
- package/lib/plugin/AcApPluginExample.d.ts.map +1 -0
- package/lib/plugin/AcApPluginExample.js +160 -0
- package/lib/plugin/AcApPluginExample.js.map +1 -0
- package/lib/plugin/AcApPluginManager.d.ts +206 -0
- package/lib/plugin/AcApPluginManager.d.ts.map +1 -0
- package/lib/plugin/AcApPluginManager.js +499 -0
- package/lib/plugin/AcApPluginManager.js.map +1 -0
- package/lib/plugin/index.d.ts +4 -0
- package/lib/plugin/index.d.ts.map +1 -0
- package/lib/plugin/index.js +4 -0
- package/lib/plugin/index.js.map +1 -0
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +8 -1
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +5 -5
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommand.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"AcEdCommand.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,8BAAsB,WAAW,CAAC,SAAS,SAAS,MAAM,GAAG,EAAE;IAC7D,oDAAoD;IACpD,OAAO,CAAC,WAAW,CAAQ;IAC3B,iDAAiD;IACjD,OAAO,CAAC,UAAU,CAAQ;IAC1B,+DAA+D;IAC/D,OAAO,CAAC,KAAK,CAAkC;IAE/C,OAAO,CAAC,SAAS,CAAW;IAE5B;;;;;OAKG;;IAOH;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,IAAI,QAAQ,cAEX;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;;;;;;;OAOG;IACH,IAAI,IAAI,IASQ,YAAY,CAP3B;IAED;;;;OAIG;IACH,IAAI,IAAI,CAAC,KAAK,EAAE,YAAY,EAE3B;IAED;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI;IAIzD;;;;;;;;;;;OAWG;IACH,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,WAAW,GAAG,IAAI;IAIrD;;;;;;;;;;;;;;;;;;;OAmBG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;IAWlC;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,OAAO,CAAC,QAAQ,EAAE,WAAW;CAGpC"}
|
|
@@ -1,4 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
import { AcEdOpenMode } from '../view';
|
|
2
38
|
/**
|
|
3
39
|
* Abstract base class for all CAD commands.
|
|
4
40
|
*
|
|
@@ -13,9 +49,9 @@ import { AcCmEventManager } from '@mlightcad/data-model';
|
|
|
13
49
|
*
|
|
14
50
|
* ## Command Lifecycle
|
|
15
51
|
* 1. Command is triggered via `trigger()` method
|
|
16
|
-
* 2. `commandWillStart` event is fired
|
|
52
|
+
* 2. `AcEditor.commandWillStart` event is fired
|
|
17
53
|
* 3. `execute()` method is called with current context
|
|
18
|
-
* 4. `commandEnded` event is fired
|
|
54
|
+
* 4. `AcEditor.commandEnded` event is fired
|
|
19
55
|
*
|
|
20
56
|
* @example
|
|
21
57
|
* ```typescript
|
|
@@ -50,16 +86,48 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
50
86
|
* appropriate global and local names in their constructors.
|
|
51
87
|
*/
|
|
52
88
|
function AcEdCommand() {
|
|
53
|
-
/**
|
|
54
|
-
this.
|
|
55
|
-
/** Fired just before the command starts executing */
|
|
56
|
-
commandWillStart: new AcCmEventManager(),
|
|
57
|
-
/** Fired after the command finishes executing */
|
|
58
|
-
commandEnded: new AcCmEventManager()
|
|
59
|
-
};
|
|
89
|
+
/** The minimum access mode required to execute this command */
|
|
90
|
+
this._mode = AcEdOpenMode.Read;
|
|
60
91
|
this._globalName = '';
|
|
61
92
|
this._localName = '';
|
|
93
|
+
this._userData = {};
|
|
62
94
|
}
|
|
95
|
+
Object.defineProperty(AcEdCommand.prototype, "userData", {
|
|
96
|
+
/**
|
|
97
|
+
* Gets the custom user-defined data associated with this command.
|
|
98
|
+
*
|
|
99
|
+
* `userData` is a generic, strongly-typed container that allows consumers
|
|
100
|
+
* of the command to attach arbitrary metadata without modifying the
|
|
101
|
+
* command class itself.
|
|
102
|
+
*
|
|
103
|
+
* The shape of `userData` is defined by the generic parameter `TUserData`
|
|
104
|
+
* when the command is declared:
|
|
105
|
+
*
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* interface MyCommandData {
|
|
109
|
+
* sourceLayerId: string
|
|
110
|
+
* isPreview: boolean
|
|
111
|
+
* }
|
|
112
|
+
*
|
|
113
|
+
* class MyCommand extends AcEdCommand<MyCommandData> {}
|
|
114
|
+
*
|
|
115
|
+
* const cmd = new MyCommand()
|
|
116
|
+
* cmd.userData.sourceLayerId = 'Layer-01'
|
|
117
|
+
* cmd.userData.isPreview = true
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* This design provides flexibility similar to `THREE.Object3D.userData`
|
|
121
|
+
* while preserving full compile-time type safety.
|
|
122
|
+
*
|
|
123
|
+
* @returns The user-defined data object associated with this command
|
|
124
|
+
*/
|
|
125
|
+
get: function () {
|
|
126
|
+
return this._userData;
|
|
127
|
+
},
|
|
128
|
+
enumerable: false,
|
|
129
|
+
configurable: true
|
|
130
|
+
});
|
|
63
131
|
Object.defineProperty(AcEdCommand.prototype, "globalName", {
|
|
64
132
|
/**
|
|
65
133
|
* Gets the global (untranslated) name of the command.
|
|
@@ -106,6 +174,60 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
106
174
|
enumerable: false,
|
|
107
175
|
configurable: true
|
|
108
176
|
});
|
|
177
|
+
Object.defineProperty(AcEdCommand.prototype, "mode", {
|
|
178
|
+
/**
|
|
179
|
+
* Gets the minimum access mode required to execute this command.
|
|
180
|
+
*
|
|
181
|
+
* Commands with higher mode requirements can only be executed when the document
|
|
182
|
+
* is opened in a compatible mode. Higher value modes are compatible with lower value modes.
|
|
183
|
+
*
|
|
184
|
+
* @returns The minimum access mode required
|
|
185
|
+
*/
|
|
186
|
+
get: function () {
|
|
187
|
+
return this._mode;
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* Sets the minimum access mode required to execute this command.
|
|
191
|
+
*
|
|
192
|
+
* @param value - The minimum access mode (Read, Review, or Write)
|
|
193
|
+
*/
|
|
194
|
+
set: function (value) {
|
|
195
|
+
this._mode = value;
|
|
196
|
+
},
|
|
197
|
+
enumerable: false,
|
|
198
|
+
configurable: true
|
|
199
|
+
});
|
|
200
|
+
/**
|
|
201
|
+
* Called right before the command starts executing.
|
|
202
|
+
*
|
|
203
|
+
* This lifecycle hook is intended for subclasses that need to perform
|
|
204
|
+
* setup work before `execute()` runs, such as:
|
|
205
|
+
* - Initializing temporary state
|
|
206
|
+
* - Locking resources
|
|
207
|
+
* - Preparing UI or editor state
|
|
208
|
+
*
|
|
209
|
+
* The default implementation does nothing.
|
|
210
|
+
*
|
|
211
|
+
* @param _context - The current application context
|
|
212
|
+
*/
|
|
213
|
+
AcEdCommand.prototype.onCommandWillStart = function (_context) {
|
|
214
|
+
// Intentionally empty — override in subclasses if needed
|
|
215
|
+
};
|
|
216
|
+
/**
|
|
217
|
+
* Called after the command has finished executing.
|
|
218
|
+
*
|
|
219
|
+
* This lifecycle hook is intended for cleanup or follow-up logic, such as:
|
|
220
|
+
* - Releasing resources
|
|
221
|
+
* - Resetting editor state
|
|
222
|
+
* - Finalizing transactions
|
|
223
|
+
*
|
|
224
|
+
* The default implementation does nothing.
|
|
225
|
+
*
|
|
226
|
+
* @param _context - The current application context
|
|
227
|
+
*/
|
|
228
|
+
AcEdCommand.prototype.onCommandEnded = function (_context) {
|
|
229
|
+
// Intentionally empty — override in subclasses if needed
|
|
230
|
+
};
|
|
109
231
|
/**
|
|
110
232
|
* Triggers the command execution with proper event handling.
|
|
111
233
|
*
|
|
@@ -126,10 +248,26 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
126
248
|
* command.trigger(docManager.context);
|
|
127
249
|
* ```
|
|
128
250
|
*/
|
|
129
|
-
AcEdCommand.prototype.
|
|
130
|
-
this
|
|
131
|
-
|
|
132
|
-
|
|
251
|
+
AcEdCommand.prototype.trigger = function (context) {
|
|
252
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
253
|
+
return __generator(this, function (_a) {
|
|
254
|
+
switch (_a.label) {
|
|
255
|
+
case 0:
|
|
256
|
+
_a.trys.push([0, , 2, 3]);
|
|
257
|
+
this.onCommandWillStart(context);
|
|
258
|
+
context.view.editor.events.commandWillStart.dispatch({ command: this });
|
|
259
|
+
return [4 /*yield*/, this.execute(context)];
|
|
260
|
+
case 1:
|
|
261
|
+
_a.sent();
|
|
262
|
+
return [3 /*break*/, 3];
|
|
263
|
+
case 2:
|
|
264
|
+
context.view.editor.events.commandEnded.dispatch({ command: this });
|
|
265
|
+
this.onCommandEnded(context);
|
|
266
|
+
return [7 /*endfinally*/];
|
|
267
|
+
case 3: return [2 /*return*/];
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
});
|
|
133
271
|
};
|
|
134
272
|
/**
|
|
135
273
|
* Executes the command logic.
|
|
@@ -156,7 +294,11 @@ var AcEdCommand = /** @class */ (function () {
|
|
|
156
294
|
* ```
|
|
157
295
|
*/
|
|
158
296
|
AcEdCommand.prototype.execute = function (_context) {
|
|
159
|
-
|
|
297
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
298
|
+
return __generator(this, function (_a) {
|
|
299
|
+
return [2 /*return*/];
|
|
300
|
+
});
|
|
301
|
+
});
|
|
160
302
|
};
|
|
161
303
|
return AcEdCommand;
|
|
162
304
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommand.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcEdCommand.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH;IAUE;;;;;OAKG;IACH;QAXA,+DAA+D;QACvD,UAAK,GAAiB,YAAY,CAAC,IAAI,CAAA;QAW7C,IAAI,CAAC,WAAW,GAAG,EAAE,C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AAC,OAAO,CAAC,OAAO,CAAC,EAAA;;wBAA3B,SAA2B,CAAA;;;wBAE3B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;wBACnE,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;;;;;;KAE/B;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,6BAAO,GAAb,UAAc,QAAqB;;;;;;KAElC;IACH,kBAAC;AAAD,CAAC,AAjND,IAiNC"}
|
|
@@ -20,7 +20,7 @@ export declare class AcEdCommandIterator implements IterableIterator<AcEdCommand
|
|
|
20
20
|
* Return command object the iterator currently points to. If the iterator is at the beginning, then the
|
|
21
21
|
* first object is returned. If the iterator has already gone past the last entry, then null is returned.
|
|
22
22
|
*/
|
|
23
|
-
get command(): AcEdCommand | null;
|
|
23
|
+
get command(): AcEdCommand<{}> | null;
|
|
24
24
|
/**
|
|
25
25
|
* Return the name of the command object the iterator currently points to. If the iterator is at the
|
|
26
26
|
* beginning, then the first object is returned. If the iterator has already gone past the last entry,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommandIterator.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandIterator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,WAAW,CAAA;CACrB;AACD;;;GAGG;AACH,qBAAa,mBACX,YAAW,gBAAgB,CAAC,uBAAuB,CAAC;IAEpD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,SAAS,CAA2B;gBAEhC,aAAa,EAAE,gBAAgB,EAAE;IAc7C,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,uBAAuB,CAAC;IAI9D;;;OAGG;IACH,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"AcEdCommandIterator.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandIterator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,CAAA;IACpB,OAAO,EAAE,WAAW,CAAA;CACrB;AACD;;;GAGG;AACH,qBAAa,mBACX,YAAW,gBAAgB,CAAC,uBAAuB,CAAC;IAEpD,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,SAAS,CAA2B;gBAEhC,aAAa,EAAE,gBAAgB,EAAE;IAc7C,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,gBAAgB,CAAC,uBAAuB,CAAC;IAI9D;;;OAGG;IACH,IAAI,OAAO,2BAIV;IAED;;;;OAIG;IACH,IAAI,YAAY,kBAIf;IAED;;;OAGG;IACH,IAAI,IAAI,cAAc,CAAC,uBAAuB,EAAE,IAAI,CAAC;CAQtD"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AcEdOpenMode } from '../view';
|
|
1
2
|
import { AcEdCommand } from './AcEdCommand';
|
|
2
3
|
import { AcEdCommandIterator, AcEdCommandIteratorItem } from './AcEdCommandIterator';
|
|
3
4
|
/**
|
|
@@ -71,19 +72,22 @@ export declare class AcEdCommandStack {
|
|
|
71
72
|
*
|
|
72
73
|
* This method iterates through all commands in all command groups and returns those
|
|
73
74
|
* whose global or local names start with the provided prefix. The search is case-insensitive.
|
|
75
|
+
* If a mode is specified, only commands compatible with that mode are returned.
|
|
76
|
+
* Higher value modes are compatible with lower value modes.
|
|
74
77
|
*
|
|
75
78
|
* @param prefix - The prefix string to search for. Case-insensitive.
|
|
79
|
+
* @param mode - Optional access mode to filter commands. Only commands compatible with this mode are returned.
|
|
76
80
|
* @returns An array of objects containing matched commands and their corresponding group names.
|
|
77
81
|
*
|
|
78
82
|
* @example
|
|
79
83
|
* ```typescript
|
|
80
|
-
* const matches = commandStack.searchCommandsByPrefix('LI');
|
|
84
|
+
* const matches = commandStack.searchCommandsByPrefix('LI', AcEdOpenMode.Write);
|
|
81
85
|
* matches.forEach(item => {
|
|
82
86
|
* console.log(item.groupName, item.command.globalName);
|
|
83
87
|
* });
|
|
84
88
|
* ```
|
|
85
89
|
*/
|
|
86
|
-
searchCommandsByPrefix(prefix: string): AcEdCommandIteratorItem[];
|
|
90
|
+
searchCommandsByPrefix(prefix: string, mode?: AcEdOpenMode): AcEdCommandIteratorItem[];
|
|
87
91
|
/**
|
|
88
92
|
* Search through all of the global and untranslated names in all of the command groups in the command
|
|
89
93
|
* stack starting at the top of the stack trying to find a match with cmdName. If a match is found, the
|
|
@@ -91,10 +95,14 @@ export declare class AcEdCommandStack {
|
|
|
91
95
|
* could not be found. If more than one command of the same name is present in the command stack (that
|
|
92
96
|
* is, in separate command groups), then the first one found is used.
|
|
93
97
|
*
|
|
98
|
+
* If a mode is specified, the command is only returned if it is compatible with that mode.
|
|
99
|
+
* Higher value modes are compatible with lower value modes.
|
|
100
|
+
*
|
|
94
101
|
* @param cmdName - Input the command name to search for
|
|
95
|
-
* @
|
|
102
|
+
* @param mode - Optional access mode to check compatibility. Only returns the command if it's compatible with this mode.
|
|
103
|
+
* @returns Return the matched AcEdCommand object if a match is found and compatible with the mode. Otherwise, return undefined.
|
|
96
104
|
*/
|
|
97
|
-
lookupGlobalCmd(cmdName: string): AcEdCommand | undefined;
|
|
105
|
+
lookupGlobalCmd(cmdName: string, mode?: AcEdOpenMode): AcEdCommand<{}> | undefined;
|
|
98
106
|
/**
|
|
99
107
|
* Search through all of the local and translated names in all of the command groups in the command stack
|
|
100
108
|
* starting at the top of the stack trying to find a match with cmdName. If a match is found, the matched
|
|
@@ -102,10 +110,14 @@ export declare class AcEdCommandStack {
|
|
|
102
110
|
* be found. If more than one command of the same name is present in the command stack (that is, in
|
|
103
111
|
* separate command groups), then the first one found is used.
|
|
104
112
|
*
|
|
113
|
+
* If a mode is specified, the command is only returned if it is compatible with that mode.
|
|
114
|
+
* Higher value modes are compatible with lower value modes.
|
|
115
|
+
*
|
|
105
116
|
* @param cmdName - Input the command name to search for
|
|
106
|
-
* @
|
|
117
|
+
* @param mode - Optional access mode to check compatibility. Only returns the command if it's compatible with this mode.
|
|
118
|
+
* @returns Return the matched AcEdCommand object if a match is found and compatible with the mode. Otherwise, return undefined.
|
|
107
119
|
*/
|
|
108
|
-
lookupLocalCmd(cmdName: string): AcEdCommand | undefined;
|
|
120
|
+
lookupLocalCmd(cmdName: string, mode?: AcEdOpenMode): AcEdCommand<{}> | undefined;
|
|
109
121
|
/**
|
|
110
122
|
* Remove the command with the global and untranslated name `cmdGlobalName` from the `cmdGroupName`
|
|
111
123
|
* command group. Return true if successful. Return false if no command with the global and untranslated
|
|
@@ -129,5 +141,18 @@ export declare class AcEdCommandStack {
|
|
|
129
141
|
* Removes all of registered commands
|
|
130
142
|
*/
|
|
131
143
|
removeAll(): void;
|
|
144
|
+
/**
|
|
145
|
+
* Checks if a document mode is compatible with a command's required mode.
|
|
146
|
+
*
|
|
147
|
+
* Higher value modes are compatible with lower value modes.
|
|
148
|
+
* - Write mode (8) is compatible with Review (4) and Read (0) commands
|
|
149
|
+
* - Review mode (4) is compatible with Read (0) commands
|
|
150
|
+
* - Read mode (0) is only compatible with Read (0) commands
|
|
151
|
+
*
|
|
152
|
+
* @param documentMode - The mode of the document
|
|
153
|
+
* @param commandMode - The mode required by the command
|
|
154
|
+
* @returns True if the document mode is compatible with the command mode
|
|
155
|
+
*/
|
|
156
|
+
private isModeCompatible;
|
|
132
157
|
}
|
|
133
158
|
//# sourceMappingURL=AcEdCommandStack.d.ts.map
|
|
@@ -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,EACL,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAE9B;;;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;IAE9C;;;OAGG;;IAiBH;;;;;;;;;;;;;;OAcG;IACH,UAAU,CACR,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,GAAG,EAAE,WAAW;IA+ClB;;;;;;OAMG;IACH,QAAQ;IAIR
|
|
1
|
+
{"version":3,"file":"AcEdCommandStack.d.ts","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandStack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,uBAAuB,CAAA;AAE9B;;;GAGG;AACH,MAAM,WAAW,gB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,19 +109,22 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
109
109
|
*
|
|
110
110
|
* This method iterates through all commands in all command groups and returns those
|
|
111
111
|
* whose global or local names start with the provided prefix. The search is case-insensitive.
|
|
112
|
+
* If a mode is specified, only commands compatible with that mode are returned.
|
|
113
|
+
* Higher value modes are compatible with lower value modes.
|
|
112
114
|
*
|
|
113
115
|
* @param prefix - The prefix string to search for. Case-insensitive.
|
|
116
|
+
* @param mode - Optional access mode to filter commands. Only commands compatible with this mode are returned.
|
|
114
117
|
* @returns An array of objects containing matched commands and their corresponding group names.
|
|
115
118
|
*
|
|
116
119
|
* @example
|
|
117
120
|
* ```typescript
|
|
118
|
-
* const matches = commandStack.searchCommandsByPrefix('LI');
|
|
121
|
+
* const matches = commandStack.searchCommandsByPrefix('LI', AcEdOpenMode.Write);
|
|
119
122
|
* matches.forEach(item => {
|
|
120
123
|
* console.log(item.groupName, item.command.globalName);
|
|
121
124
|
* });
|
|
122
125
|
* ```
|
|
123
126
|
*/
|
|
124
|
-
AcEdCommandStack.prototype.searchCommandsByPrefix = function (prefix) {
|
|
127
|
+
AcEdCommandStack.prototype.searchCommandsByPrefix = function (prefix, mode) {
|
|
125
128
|
prefix = prefix.toUpperCase();
|
|
126
129
|
var results = [];
|
|
127
130
|
var iter = this.iterator();
|
|
@@ -130,7 +133,10 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
130
133
|
var command = item.value.command;
|
|
131
134
|
if (command.globalName.startsWith(prefix) ||
|
|
132
135
|
command.localName.startsWith(prefix)) {
|
|
133
|
-
|
|
136
|
+
// Check mode compatibility if mode is specified
|
|
137
|
+
if (mode === undefined || this.isModeCompatible(mode, command.mode)) {
|
|
138
|
+
results.push(item.value);
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
141
|
item = iter.next();
|
|
136
142
|
}
|
|
@@ -143,10 +149,14 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
143
149
|
* could not be found. If more than one command of the same name is present in the command stack (that
|
|
144
150
|
* is, in separate command groups), then the first one found is used.
|
|
145
151
|
*
|
|
152
|
+
* If a mode is specified, the command is only returned if it is compatible with that mode.
|
|
153
|
+
* Higher value modes are compatible with lower value modes.
|
|
154
|
+
*
|
|
146
155
|
* @param cmdName - Input the command name to search for
|
|
147
|
-
* @
|
|
156
|
+
* @param mode - Optional access mode to check compatibility. Only returns the command if it's compatible with this mode.
|
|
157
|
+
* @returns Return the matched AcEdCommand object if a match is found and compatible with the mode. Otherwise, return undefined.
|
|
148
158
|
*/
|
|
149
|
-
AcEdCommandStack.prototype.lookupGlobalCmd = function (cmdName) {
|
|
159
|
+
AcEdCommandStack.prototype.lookupGlobalCmd = function (cmdName, mode) {
|
|
150
160
|
var e_1, _a;
|
|
151
161
|
cmdName = cmdName.toUpperCase();
|
|
152
162
|
var result = undefined;
|
|
@@ -154,8 +164,15 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
154
164
|
for (var _b = __values(this._commandsByGroup), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
155
165
|
var group = _c.value;
|
|
156
166
|
result = group.commandsByGlobalName.get(cmdName);
|
|
157
|
-
if (result)
|
|
158
|
-
|
|
167
|
+
if (result) {
|
|
168
|
+
// Check mode compatibility if mode is specified
|
|
169
|
+
if (mode === undefined || this.isModeCompatible(mode, result.mode)) {
|
|
170
|
+
break;
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
result = undefined;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
159
176
|
}
|
|
160
177
|
}
|
|
161
178
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -174,10 +191,14 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
174
191
|
* be found. If more than one command of the same name is present in the command stack (that is, in
|
|
175
192
|
* separate command groups), then the first one found is used.
|
|
176
193
|
*
|
|
194
|
+
* If a mode is specified, the command is only returned if it is compatible with that mode.
|
|
195
|
+
* Higher value modes are compatible with lower value modes.
|
|
196
|
+
*
|
|
177
197
|
* @param cmdName - Input the command name to search for
|
|
178
|
-
* @
|
|
198
|
+
* @param mode - Optional access mode to check compatibility. Only returns the command if it's compatible with this mode.
|
|
199
|
+
* @returns Return the matched AcEdCommand object if a match is found and compatible with the mode. Otherwise, return undefined.
|
|
179
200
|
*/
|
|
180
|
-
AcEdCommandStack.prototype.lookupLocalCmd = function (cmdName) {
|
|
201
|
+
AcEdCommandStack.prototype.lookupLocalCmd = function (cmdName, mode) {
|
|
181
202
|
var e_2, _a;
|
|
182
203
|
cmdName = cmdName.toUpperCase();
|
|
183
204
|
var result = undefined;
|
|
@@ -185,8 +206,15 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
185
206
|
for (var _b = __values(this._commandsByGroup), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
186
207
|
var group = _c.value;
|
|
187
208
|
result = group.commandsByLocalName.get(cmdName);
|
|
188
|
-
if (result)
|
|
189
|
-
|
|
209
|
+
if (result) {
|
|
210
|
+
// Check mode compatibility if mode is specified
|
|
211
|
+
if (mode === undefined || this.isModeCompatible(mode, result.mode)) {
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
result = undefined;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
190
218
|
}
|
|
191
219
|
}
|
|
192
220
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -259,6 +287,22 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
259
287
|
this._systemCommandGroup.commandsByGlobalName.clear();
|
|
260
288
|
this._systemCommandGroup.commandsByLocalName.clear();
|
|
261
289
|
};
|
|
290
|
+
/**
|
|
291
|
+
* Checks if a document mode is compatible with a command's required mode.
|
|
292
|
+
*
|
|
293
|
+
* Higher value modes are compatible with lower value modes.
|
|
294
|
+
* - Write mode (8) is compatible with Review (4) and Read (0) commands
|
|
295
|
+
* - Review mode (4) is compatible with Read (0) commands
|
|
296
|
+
* - Read mode (0) is only compatible with Read (0) commands
|
|
297
|
+
*
|
|
298
|
+
* @param documentMode - The mode of the document
|
|
299
|
+
* @param commandMode - The mode required by the command
|
|
300
|
+
* @returns True if the document mode is compatible with the command mode
|
|
301
|
+
*/
|
|
302
|
+
AcEdCommandStack.prototype.isModeCompatible = function (documentMode, commandMode) {
|
|
303
|
+
// Higher value modes are compatible with lower value modes
|
|
304
|
+
return documentMode >= commandMode;
|
|
305
|
+
};
|
|
262
306
|
/** The name of the system command group */
|
|
263
307
|
AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME = 'ACAD';
|
|
264
308
|
/** The name of the default user command group */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommandStack.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandStack.ts"],"names":[],"mappings":";;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AcEdCommandStack.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandStack.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA,OAAO,EACL,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAe9B;;;;;;;;;;;;;GAaG;AACH;IAaE;;;OAGG;IACH;QACE,IAAI,CAAC,gBAAgB,GAAG,EAAE,CAAA;QAC1B,IAAI,CAAC,mBAAmB,GAAG;YACzB,SAAS,EAAE,gBAAgB,CAAC,0BAA0B;YACtD,oBAAoB,EAAE,IAAI,GAAG,EAAE;YAC/B,mBAAmB,EAAE,IAAI,GAAG,EAAE;SAC/B,CAAA;QACD,IAAI,CAAC,oBAAoB,GAAG;YAC1B,SAAS,EAAE,gBAAgB,CAAC,yBAAyB;YACrD,oBAAoB,EAAE,IAAI,GAAG,EAAE;YAC/B,mBAAmB,EAAE,IAAI,GAAG,EAAE;SAC/B,CAAA;QACD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAA;QACpD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CA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AC,KAAK,EAAE,CAAA;IACtD,CAAC;IAED;;;;;;;;;;;OAWG;IACK,2CAAgB,GAAxB,UACE,YAA0B,EAC1B,WAAyB;QAEzB,2DAA2D;QAC3D,OAAO,YAAY,IAAI,WAAW,CAAA;IACpC,CAAC;IAhSD,2CAA2C;IACpC,2CAA0B,GAAG,MAAM,CAAA;IAC1C,iDAAiD;IAC1C,0CAAyB,GAAG,MAAM,CAAA;IA8R3C,uBAAC;CAAA,AAlSD,IAkSC;SAlSY,gBAAgB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
|
+
import { AcEdCommand } from '../command';
|
|
2
3
|
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
3
4
|
import { AcEdCorsorType } from './AcEdCursorManager';
|
|
4
5
|
import { AcEdPromptAngleOptions, AcEdPromptDistanceOptions, AcEdPromptEntityOptions, AcEdPromptKeywordOptions, AcEdPromptPointOptions, AcEdPromptSelectionOptions, AcEdPromptStringOptions } from './prompt';
|
|
@@ -9,6 +10,15 @@ export interface AcDbSysVarEventArgs {
|
|
|
9
10
|
/** The system variable name */
|
|
10
11
|
name: string;
|
|
11
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* Event arguments for command lifecycle events.
|
|
15
|
+
*
|
|
16
|
+
* Contains the command instance that triggered the event.
|
|
17
|
+
*/
|
|
18
|
+
export interface AcEdCommandEventArgs {
|
|
19
|
+
/** The command instance involved in the event */
|
|
20
|
+
command: AcEdCommand;
|
|
21
|
+
}
|
|
12
22
|
/**
|
|
13
23
|
* Advanced input handler for CAD operations providing high-level user interaction methods.
|
|
14
24
|
*
|
|
@@ -56,6 +66,10 @@ export declare class AcEditor {
|
|
|
56
66
|
* by entering the variable name at the command line.
|
|
57
67
|
*/
|
|
58
68
|
sysVarChanged: AcCmEventManager<AcDbSysVarEventArgs>;
|
|
69
|
+
/** Fired just before the command starts executing */
|
|
70
|
+
commandWillStart: AcCmEventManager<AcEdCommandEventArgs>;
|
|
71
|
+
/** Fired after the command finishes executing */
|
|
72
|
+
commandEnded: AcCmEventManager<AcEdCommandEventArgs>;
|
|
59
73
|
};
|
|
60
74
|
/**
|
|
61
75
|
* Creates a new editor instance for the specified view.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,EAC1B,uBAAuB,EACxB,MAAM,UAAU,CAAA;AAGjB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,QAAQ;IACnB,iDAAiD;IACjD,OAAO,CAAC,eAAe,CAAC,CAAgB;IACxC,mCAAmC;IACnC,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,iDAAiD;IACjD,OAAO,CAAC,cAAc,CAAmB;IACzC,2CAA2C;IAC3C,OAAO,CAAC,aAAa,CAAkB;IACvC,8CAA8C;IAC9C,SAAS,CAAC,KAAK,EAAE,YAAY,CAAA;IAE7B;;OAEG;IACH,SAAgB,MAAM;QACpB;;;WAGG;;
|
|
1
|
+
{"version":3,"file":"AcEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,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B;IAIhD;;;;OAIG;IACG,WAAW,CAAC,OAAO,EAAE,wBAAwB;IAInD;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,uBAAuB;IAIhD;;;;;;;;OAQG;IACG,YAAY,CAAC,OAAO,EAAE,0BAA0B;IAItD;;;;OAIG;IACG,MAAM;CAGb"}
|
|
@@ -79,7 +79,11 @@ var AcEditor = /** @class */ (function () {
|
|
|
79
79
|
* Fired after a system variable is changed directly through the SETVAR command or
|
|
80
80
|
* by entering the variable name at the command line.
|
|
81
81
|
*/
|
|
82
|
-
sysVarChanged: new AcCmEventManager()
|
|
82
|
+
sysVarChanged: new AcCmEventManager(),
|
|
83
|
+
/** Fired just before the command starts executing */
|
|
84
|
+
commandWillStart: new AcCmEventManager(),
|
|
85
|
+
/** Fired after the command finishes executing */
|
|
86
|
+
commandEnded: new AcCmEventManager()
|
|
83
87
|
};
|
|
84
88
|
this._view = view;
|
|
85
89
|
this._cursorManager = new AcEdCursorManager(view);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEditor.js","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"AcEditor.js","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAIxD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAUvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAoBvC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IA2BE;;;;OAIG;IACH,kBAAY,IAAkB;QApB9B;;WAEG;QACa,WAAM,GAAG;YACvB;;;eAG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OAAO,CAAC,EAAA;4BAAjD,sBAAO,SAA0C,EAAA;;;;KAClD;IAED;;;;;;;;OAQG;IACG,8BAAW,GAAjB,UAAkB,OAAkC;;;;4BAC3C,qBAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,EAAA;4BAApD,sBAAO,SAA6C,EAAA;;;;KACrD;IAED;;;;OAIG;IACG,4BAAS,GAAf,UAAgB,OAAgC;;;;4BACvC,qBAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,EAAA;4BAAlD,sBAAO,SAA2C,EAAA;;;;KACnD;IAED;;;;OAIG;IACG,8BAAW,GAAjB,UAAkB,OAAiC;;;;4BAC1C,qBAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,EAAA;4BAApD,sBAAO,SAA6C,EAAA;;;;KACrD;IAED;;;;OAIG;IACG,4BAAS,GAAf,UAAgB,OAAgC;;;;4BACvC,qBAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,EAAA;4BAAlD,sBAAO,SAA2C,EAAA;;;;KACnD;IAED;;;;;;;;OAQG;IACG,+BAAY,GAAlB,UAAmB,OAAmC;;;;4BAC7C,qBAAM,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,CAAC,EAAA;4BAArD,sBAAO,SAA8C,EAAA;;;;KACtD;IAED;;;;OAIG;IACG,yBAAM,GAAZ;;;;4BACS,qBAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAA;4BAAxC,sBAAO,SAAiC,EAAA;;;;KACzC;IACH,eAAC;AAAD,CAAC,AA9KD,IA8KC"}
|
|
@@ -17,6 +17,8 @@ export type AcEdMarkerType = 'circle' | 'triangle' | 'rect' | 'diamond' | 'x';
|
|
|
17
17
|
export declare class AcEdMarker {
|
|
18
18
|
/** DOM element representing the marker */
|
|
19
19
|
private _el;
|
|
20
|
+
/** Host element where the marker DOM is mounted */
|
|
21
|
+
private _host;
|
|
20
22
|
/** Size (width = height) of the marker in pixels */
|
|
21
23
|
private _size;
|
|
22
24
|
/** Marker shape type */
|
|
@@ -29,8 +31,9 @@ export declare class AcEdMarker {
|
|
|
29
31
|
* @param type - Shape type of the marker (`circle`, `triangle`, `rect`)
|
|
30
32
|
* @param size - Size of the marker (width/height in px; triangle uses font-size)
|
|
31
33
|
* @param color - Marker color (CSS color string)
|
|
34
|
+
* @param host - Host container where marker DOM is mounted and positioned
|
|
32
35
|
*/
|
|
33
|
-
constructor(type
|
|
36
|
+
constructor(type: AcEdMarkerType | undefined, size: number | undefined, color: string | undefined, host: HTMLElement);
|
|
34
37
|
/**
|
|
35
38
|
* Gets the current marker color.
|
|
36
39
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdMarker.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/marker/AcEdMarker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,GAAG,CAAA;AAE7E;;;;;;;;;;GAUG;AACH,qBAAa,UAAU;IACrB,0CAA0C;IAC1C,OAAO,CAAC,GAAG,CAAa;
|
|
1
|
+
{"version":3,"file":"AcEdMarker.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/marker/AcEdMarker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,SAAS,GAAG,GAAG,CAAA;AAE7E;;;;;;;;;;GAUG;AACH,qBAAa,UAAU;IACrB,0CAA0C;IAC1C,OAAO,CAAC,GAAG,CAAa;IACxB,mDAAmD;IACnD,OAAO,CAAC,KAAK,CAAa;IAE1B,oDAAoD;IACpD,OAAO,CAAC,KAAK,CAAQ;IAErB,wBAAwB;IACxB,OAAO,CAAC,KAAK,CAAgB;IAE7B,kCAAkC;IAClC,OAAO,CAAC,MAAM,CAAQ;IAEtB;;;;;;;OAOG;gBAED,IAAI,EAAE,cAAc,YAAS,EAC7B,IAAI,EAAE,MAAM,YAAI,EAChB,KAAK,EAAE,MAAM,YAAU,EACvB,IAAI,EAAE,WAAW;IA4BnB;;OAEG;IACH,IAAW,KAAK,IAAI,MAAM,CAEzB;IAED;;OAEG;IACH,IAAW,KAAK,CAAC,KAAK,EAAE,MAAM,EAG7B;IAED;;OAEG;IACH,IAAW,IAAI,IAAI,cAAc,CAEhC;IAED;;OAEG;IACH,IAAW,IAAI,CAAC,KAAK,EAAE,cAAc,EAGpC;IAED;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAgExB;;;OAGG;IACH,OAAO,CAAC,UAAU;IAwClB;;;;OAIG;IACI,WAAW,CAAC,GAAG,EAAE,eAAe;IAKvC;;;OAGG;IACI,OAAO;CAGf"}
|
|
@@ -16,23 +16,31 @@ var AcEdMarker = /** @class */ (function () {
|
|
|
16
16
|
* @param type - Shape type of the marker (`circle`, `triangle`, `rect`)
|
|
17
17
|
* @param size - Size of the marker (width/height in px; triangle uses font-size)
|
|
18
18
|
* @param color - Marker color (CSS color string)
|
|
19
|
+
* @param host - Host container where marker DOM is mounted and positioned
|
|
19
20
|
*/
|
|
20
|
-
function AcEdMarker(type, size, color) {
|
|
21
|
+
function AcEdMarker(type, size, color, host) {
|
|
21
22
|
if (type === void 0) { type = 'rect'; }
|
|
22
23
|
if (size === void 0) { size = 8; }
|
|
23
24
|
if (color === void 0) { color = 'green'; }
|
|
24
25
|
this._type = type;
|
|
25
26
|
this._size = size;
|
|
26
27
|
this._color = color;
|
|
28
|
+
this._host = host;
|
|
27
29
|
// Ensure CSS is injected once
|
|
28
30
|
AcEdMarker.injectCSS();
|
|
31
|
+
// Markers are now anchored to an explicit host (usually view.container),
|
|
32
|
+
// so they stay inside the current view instead of global viewport space.
|
|
33
|
+
var hostPosition = getComputedStyle(this._host).position;
|
|
34
|
+
if (hostPosition === 'static') {
|
|
35
|
+
this._host.style.position = 'relative';
|
|
36
|
+
}
|
|
29
37
|
// Create marker DOM
|
|
30
38
|
this._el = document.createElement('div');
|
|
31
39
|
this._el.classList.add('ml-marker');
|
|
32
40
|
this._el.style.color = color;
|
|
33
41
|
this.applyShape();
|
|
34
|
-
// Attach to
|
|
35
|
-
|
|
42
|
+
// Attach to host
|
|
43
|
+
this._host.appendChild(this._el);
|
|
36
44
|
}
|
|
37
45
|
Object.defineProperty(AcEdMarker.prototype, "color", {
|
|
38
46
|
/**
|