@mlightcad/cad-simple-viewer 1.4.7 → 1.4.8
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/LICENSE +21 -21
- package/README.md +88 -88
- package/dist/index.js +6014 -5042
- package/dist/index.umd.cjs +22 -22
- 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 +162 -6
- 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/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 +15 -0
- package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -0
- package/lib/command/AcApSwitchBgCmd.js +88 -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/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +2 -2
- package/lib/editor/input/ui/AcEdCommandLine.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
|
@@ -51,7 +51,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51
51
|
};
|
|
52
52
|
import { AcDbSysVarManager } from '@mlightcad/data-model';
|
|
53
53
|
import { AcApDocManager } from '../app';
|
|
54
|
-
import { AcEdCommand, AcEdPromptStringOptions } from '../editor';
|
|
54
|
+
import { AcEdCommand, AcEdOpenMode, AcEdPromptStringOptions } from '../editor';
|
|
55
55
|
import { AcApI18n } from '../i18n';
|
|
56
56
|
/**
|
|
57
57
|
* Command for modifying value of one system variable. All of system variables share
|
|
@@ -60,28 +60,29 @@ import { AcApI18n } from '../i18n';
|
|
|
60
60
|
var AcApSysVarCmd = /** @class */ (function (_super) {
|
|
61
61
|
__extends(AcApSysVarCmd, _super);
|
|
62
62
|
function AcApSysVarCmd() {
|
|
63
|
-
|
|
63
|
+
var _this = _super.call(this) || this;
|
|
64
|
+
_this.mode = AcEdOpenMode.Review;
|
|
65
|
+
return _this;
|
|
64
66
|
}
|
|
65
67
|
/**
|
|
66
68
|
* Executes the command to modify the value of one system variable.
|
|
67
69
|
*
|
|
68
70
|
* @param context - The application context containing the view
|
|
69
71
|
*/
|
|
70
|
-
AcApSysVarCmd.prototype.execute = function (
|
|
72
|
+
AcApSysVarCmd.prototype.execute = function (context) {
|
|
71
73
|
return __awaiter(this, void 0, void 0, function () {
|
|
72
74
|
var prompt, value, sysVarManager, sysVar;
|
|
73
75
|
return __generator(this, function (_a) {
|
|
74
76
|
switch (_a.label) {
|
|
75
77
|
case 0:
|
|
76
78
|
prompt = new AcEdPromptStringOptions(AcApI18n.t('jig.sysvar.prompt'));
|
|
77
|
-
AcEdPromptStringOptions;
|
|
78
79
|
return [4 /*yield*/, AcApDocManager.instance.editor.getString(prompt)];
|
|
79
80
|
case 1:
|
|
80
81
|
value = _a.sent();
|
|
81
82
|
sysVarManager = AcDbSysVarManager.instance();
|
|
82
83
|
sysVar = sysVarManager.getDescriptor(this.globalName);
|
|
83
84
|
if (sysVar) {
|
|
84
|
-
sysVarManager.setVar(this.globalName, value);
|
|
85
|
+
sysVarManager.setVar(this.globalName, value, context.doc.database);
|
|
85
86
|
}
|
|
86
87
|
return [2 /*return*/];
|
|
87
88
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApSysVarCmd.js","sourceRoot":"","sources":["../../src/command/AcApSysVarCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAe,cAAc,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApSysVarCmd.js","sourceRoot":"","sources":["../../src/command/AcApSysVarCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,OAAO,EAAe,cAAc,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAElC;;;GAGG;AACH;IAAmC,iCAAW;IAC5C;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,MAAM,CAAA;;IACjC,CAAC;IAED;;;;OAIG;IACG,+BAAO,GAAb,UAAc,OAAoB;;;;;;wBAC1B,MAAM,GAAG,IAAI,uBAAuB,CAAC,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAA;wBAC7D,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAA;;wBAA9D,KAAK,GAAG,SAAsD;wBAC9D,aAAa,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAA;wBAC5C,MAAM,GAAG,aAAa,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;wBAC3D,IAAI,MAAM,EAAE,CAAC;4BACX,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;wBACpE,CAAC;;;;;KACF;IACH,oBAAC;AAAD,CAAC,AApBD,CAAmC,WAAW,GAoB7C"}
|
|
@@ -30,6 +30,6 @@ export declare class AcApZoomCmd extends AcEdCommand {
|
|
|
30
30
|
*
|
|
31
31
|
* @param context - The current application context containing the view to zoom
|
|
32
32
|
*/
|
|
33
|
-
execute(context: AcApContext): void
|
|
33
|
+
execute(context: AcApContext): Promise<void>;
|
|
34
34
|
}
|
|
35
35
|
//# sourceMappingURL=AcApZoomCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;
|
|
1
|
+
{"version":3,"file":"AcApZoomCmd.d.ts","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;;;;OAOG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;CAGnC"}
|
|
@@ -13,6 +13,42 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
13
13
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
26
|
+
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);
|
|
27
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
28
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
29
|
+
function step(op) {
|
|
30
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
31
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
32
|
+
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;
|
|
33
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
34
|
+
switch (op[0]) {
|
|
35
|
+
case 0: case 1: t = op; break;
|
|
36
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
37
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
38
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
39
|
+
default:
|
|
40
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
41
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
42
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
43
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
44
|
+
if (t[2]) _.ops.pop();
|
|
45
|
+
_.trys.pop(); continue;
|
|
46
|
+
}
|
|
47
|
+
op = body.call(thisArg, _);
|
|
48
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
49
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
16
52
|
import { AcEdCommand } from '../command';
|
|
17
53
|
/**
|
|
18
54
|
* Command to zoom the view to fit all visible entities.
|
|
@@ -49,7 +85,12 @@ var AcApZoomCmd = /** @class */ (function (_super) {
|
|
|
49
85
|
* @param context - The current application context containing the view to zoom
|
|
50
86
|
*/
|
|
51
87
|
AcApZoomCmd.prototype.execute = function (context) {
|
|
52
|
-
|
|
88
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
89
|
+
return __generator(this, function (_a) {
|
|
90
|
+
context.view.zoomToFitDrawing();
|
|
91
|
+
return [2 /*return*/];
|
|
92
|
+
});
|
|
93
|
+
});
|
|
53
94
|
};
|
|
54
95
|
return AcApZoomCmd;
|
|
55
96
|
}(AcEdCommand));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApZoomCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH;IAAiC,+BAAW;IAA5C;;IAYA,CAAC;IAXC;;;;;;;OAOG;IACG,6BAAO,GAAb,UAAc,OAAoB;;;gBAChC,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAA;;;;KAChC;IACH,kBAAC;AAAD,CAAC,AAZD,CAAiC,WAAW,GAY3C"}
|
package/lib/command/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from '../editor/command/AcEdCommand';
|
|
2
2
|
export * from '../editor/command/AcEdCommandStack';
|
|
3
|
+
export * from './AcApBaseRevCmd';
|
|
3
4
|
export * from './AcApCircleCmd';
|
|
4
5
|
export * from './AcApConvertToSvgCmd';
|
|
5
6
|
export * from './AcApDimLinearCmd';
|
|
@@ -8,9 +9,16 @@ export * from './AcApLineCmd';
|
|
|
8
9
|
export * from './AcApLogCmd';
|
|
9
10
|
export * from './AcApOpenCmd';
|
|
10
11
|
export * from './AcApQNewCmd';
|
|
12
|
+
export * from './AcApRectCmd';
|
|
11
13
|
export * from './AcApRegenCmd';
|
|
14
|
+
export * from './AcApRevCloudCmd';
|
|
15
|
+
export * from './AcApRevCircleCmd';
|
|
16
|
+
export * from './AcApRevRectCmd';
|
|
17
|
+
export * from './AcApRevVisibilityCmd';
|
|
12
18
|
export * from './AcApSelectCmd';
|
|
19
|
+
export * from './AcApSketchCmd';
|
|
13
20
|
export * from './AcApSysVarCmd';
|
|
21
|
+
export * from './AcApSwitchBgCmd';
|
|
14
22
|
export * from './AcApZoomCmd';
|
|
15
23
|
export * from './AcApZoomToBoxCmd';
|
|
16
24
|
export * from './AcApPanCmd';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oCAAoC,CAAA;AAClD,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oCAAoC,CAAA;AAClD,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA"}
|
package/lib/command/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from '../editor/command/AcEdCommand';
|
|
2
2
|
export * from '../editor/command/AcEdCommandStack';
|
|
3
|
+
export * from './AcApBaseRevCmd';
|
|
3
4
|
export * from './AcApCircleCmd';
|
|
4
5
|
export * from './AcApConvertToSvgCmd';
|
|
5
6
|
export * from './AcApDimLinearCmd';
|
|
@@ -8,9 +9,16 @@ export * from './AcApLineCmd';
|
|
|
8
9
|
export * from './AcApLogCmd';
|
|
9
10
|
export * from './AcApOpenCmd';
|
|
10
11
|
export * from './AcApQNewCmd';
|
|
12
|
+
export * from './AcApRectCmd';
|
|
11
13
|
export * from './AcApRegenCmd';
|
|
14
|
+
export * from './AcApRevCloudCmd';
|
|
15
|
+
export * from './AcApRevCircleCmd';
|
|
16
|
+
export * from './AcApRevRectCmd';
|
|
17
|
+
export * from './AcApRevVisibilityCmd';
|
|
12
18
|
export * from './AcApSelectCmd';
|
|
19
|
+
export * from './AcApSketchCmd';
|
|
13
20
|
export * from './AcApSysVarCmd';
|
|
21
|
+
export * from './AcApSwitchBgCmd';
|
|
14
22
|
export * from './AcApZoomCmd';
|
|
15
23
|
export * from './AcApZoomToBoxCmd';
|
|
16
24
|
export * from './AcApPanCmd';
|
package/lib/command/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oCAAoC,CAAA;AAClD,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/command/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oCAAoC,CAAA;AAClD,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA;AACtC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,mBAAmB,CAAA;AACjC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,cAAc,CAAA"}
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
2
1
|
import { AcApContext } from '../../app';
|
|
3
|
-
|
|
4
|
-
* Event arguments for command lifecycle events.
|
|
5
|
-
*
|
|
6
|
-
* Contains the command instance that triggered the event.
|
|
7
|
-
*/
|
|
8
|
-
export interface AcEdCommandEventArgs {
|
|
9
|
-
/** The command instance involved in the event */
|
|
10
|
-
command: AcEdCommand;
|
|
11
|
-
}
|
|
2
|
+
import { AcEdOpenMode } from '../view';
|
|
12
3
|
/**
|
|
13
4
|
* Abstract base class for all CAD commands.
|
|
14
5
|
*
|
|
@@ -23,9 +14,9 @@ export interface AcEdCommandEventArgs {
|
|
|
23
14
|
*
|
|
24
15
|
* ## Command Lifecycle
|
|
25
16
|
* 1. Command is triggered via `trigger()` method
|
|
26
|
-
* 2. `commandWillStart` event is fired
|
|
17
|
+
* 2. `AcEditor.commandWillStart` event is fired
|
|
27
18
|
* 3. `execute()` method is called with current context
|
|
28
|
-
* 4. `commandEnded` event is fired
|
|
19
|
+
* 4. `AcEditor.commandEnded` event is fired
|
|
29
20
|
*
|
|
30
21
|
* @example
|
|
31
22
|
* ```typescript
|
|
@@ -52,11 +43,14 @@ export interface AcEdCommandEventArgs {
|
|
|
52
43
|
* command.trigger(context);
|
|
53
44
|
* ```
|
|
54
45
|
*/
|
|
55
|
-
export declare abstract class AcEdCommand {
|
|
46
|
+
export declare abstract class AcEdCommand<TUserData extends object = {}> {
|
|
56
47
|
/** The global (untranslated) name of the command */
|
|
57
48
|
private _globalName;
|
|
58
49
|
/** The local (translated) name of the command */
|
|
59
50
|
private _localName;
|
|
51
|
+
/** The minimum access mode required to execute this command */
|
|
52
|
+
private _mode;
|
|
53
|
+
private _userData;
|
|
60
54
|
/**
|
|
61
55
|
* Creates a new command instance.
|
|
62
56
|
*
|
|
@@ -64,13 +58,36 @@ export declare abstract class AcEdCommand {
|
|
|
64
58
|
* appropriate global and local names in their constructors.
|
|
65
59
|
*/
|
|
66
60
|
constructor();
|
|
67
|
-
/**
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Gets the custom user-defined data associated with this command.
|
|
63
|
+
*
|
|
64
|
+
* `userData` is a generic, strongly-typed container that allows consumers
|
|
65
|
+
* of the command to attach arbitrary metadata without modifying the
|
|
66
|
+
* command class itself.
|
|
67
|
+
*
|
|
68
|
+
* The shape of `userData` is defined by the generic parameter `TUserData`
|
|
69
|
+
* when the command is declared:
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* interface MyCommandData {
|
|
74
|
+
* sourceLayerId: string
|
|
75
|
+
* isPreview: boolean
|
|
76
|
+
* }
|
|
77
|
+
*
|
|
78
|
+
* class MyCommand extends AcEdCommand<MyCommandData> {}
|
|
79
|
+
*
|
|
80
|
+
* const cmd = new MyCommand()
|
|
81
|
+
* cmd.userData.sourceLayerId = 'Layer-01'
|
|
82
|
+
* cmd.userData.isPreview = true
|
|
83
|
+
* ```
|
|
84
|
+
*
|
|
85
|
+
* This design provides flexibility similar to `THREE.Object3D.userData`
|
|
86
|
+
* while preserving full compile-time type safety.
|
|
87
|
+
*
|
|
88
|
+
* @returns The user-defined data object associated with this command
|
|
89
|
+
*/
|
|
90
|
+
get userData(): TUserData;
|
|
74
91
|
/**
|
|
75
92
|
* Gets the global (untranslated) name of the command.
|
|
76
93
|
*
|
|
@@ -101,6 +118,48 @@ export declare abstract class AcEdCommand {
|
|
|
101
118
|
* @param value - The localized command name (e.g., 'Draw Line', 'Zoom In')
|
|
102
119
|
*/
|
|
103
120
|
set localName(value: string);
|
|
121
|
+
/**
|
|
122
|
+
* Gets the minimum access mode required to execute this command.
|
|
123
|
+
*
|
|
124
|
+
* Commands with higher mode requirements can only be executed when the document
|
|
125
|
+
* is opened in a compatible mode. Higher value modes are compatible with lower value modes.
|
|
126
|
+
*
|
|
127
|
+
* @returns The minimum access mode required
|
|
128
|
+
*/
|
|
129
|
+
get mode(): AcEdOpenMode;
|
|
130
|
+
/**
|
|
131
|
+
* Sets the minimum access mode required to execute this command.
|
|
132
|
+
*
|
|
133
|
+
* @param value - The minimum access mode (Read, Review, or Write)
|
|
134
|
+
*/
|
|
135
|
+
set mode(value: AcEdOpenMode);
|
|
136
|
+
/**
|
|
137
|
+
* Called right before the command starts executing.
|
|
138
|
+
*
|
|
139
|
+
* This lifecycle hook is intended for subclasses that need to perform
|
|
140
|
+
* setup work before `execute()` runs, such as:
|
|
141
|
+
* - Initializing temporary state
|
|
142
|
+
* - Locking resources
|
|
143
|
+
* - Preparing UI or editor state
|
|
144
|
+
*
|
|
145
|
+
* The default implementation does nothing.
|
|
146
|
+
*
|
|
147
|
+
* @param _context - The current application context
|
|
148
|
+
*/
|
|
149
|
+
protected onCommandWillStart(_context: AcApContext): void;
|
|
150
|
+
/**
|
|
151
|
+
* Called after the command has finished executing.
|
|
152
|
+
*
|
|
153
|
+
* This lifecycle hook is intended for cleanup or follow-up logic, such as:
|
|
154
|
+
* - Releasing resources
|
|
155
|
+
* - Resetting editor state
|
|
156
|
+
* - Finalizing transactions
|
|
157
|
+
*
|
|
158
|
+
* The default implementation does nothing.
|
|
159
|
+
*
|
|
160
|
+
* @param _context - The current application context
|
|
161
|
+
*/
|
|
162
|
+
protected onCommandEnded(_context: AcApContext): void;
|
|
104
163
|
/**
|
|
105
164
|
* Triggers the command execution with proper event handling.
|
|
106
165
|
*
|
|
@@ -121,7 +180,7 @@ export declare abstract class AcEdCommand {
|
|
|
121
180
|
* command.trigger(docManager.context);
|
|
122
181
|
* ```
|
|
123
182
|
*/
|
|
124
|
-
|
|
183
|
+
trigger(context: AcApContext): Promise<void>;
|
|
125
184
|
/**
|
|
126
185
|
* Executes the command logic.
|
|
127
186
|
*
|
|
@@ -146,6 +205,6 @@ export declare abstract class AcEdCommand {
|
|
|
146
205
|
* }
|
|
147
206
|
* ```
|
|
148
207
|
*/
|
|
149
|
-
execute(_context: AcApContext): void
|
|
208
|
+
execute(_context: AcApContext): Promise<void>;
|
|
150
209
|
}
|
|
151
210
|
//# sourceMappingURL=AcEdCommand.d.ts.map
|
|
@@ -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,CAAA;QACrB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QACpB,IAAI,CAAC,SAAS,GAAG,EAAe,CAAA;IAClC,CAAC;IA+BD,sBAAI,iCAAQ;QA7BZ;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA4BG;aACH;YACE,OAAO,IAAI,CAAC,SAAS,CAAA;QACvB,CAAC;;;OAAA;IAUD,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;IAmBD,sBAAI,6BAAI;QARR;;;;;;;WAOG;aACH;YACE,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;QAED;;;;WAIG;aACH,UAAS,KAAmB;YAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QACpB,CAAC;;;OATA;IAWD;;;;;;;;;;;;OAYG;IACO,wCAAkB,GAA5B,UAA6B,QAAqB;QAChD,yDAAyD;IAC3D,CAAC;IAED;;;;;;;;;;;OAWG;IACO,oCAAc,GAAxB,UAAyB,QAAqB;QAC5C,yDAAyD;IAC3D,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACG,6BAAO,GAAb,UAAc,OAAoB;;;;;;wBAE9B,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAA;wBAChC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAA;wBACvE,qBAAM,IAAI,CAAC,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"}
|