@mlightcad/cad-simple-viewer 1.2.4 → 1.3.0
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 +13000 -10094
- package/dist/index.umd.cjs +327 -24
- package/dist/libredwg-parser-worker.js +7267 -7238
- package/dist/mtext-renderer-worker.js +81 -41
- package/lib/app/AcApContext.js +1 -1
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +20 -3
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +67 -12
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApProgress.d.ts +133 -0
- package/lib/app/AcApProgress.d.ts.map +1 -0
- package/lib/app/AcApProgress.js +148 -0
- package/lib/app/AcApProgress.js.map +1 -0
- package/lib/app/AcApSettingManager.d.ts +42 -0
- package/lib/app/AcApSettingManager.d.ts.map +1 -1
- package/lib/app/AcApSettingManager.js +63 -0
- package/lib/app/AcApSettingManager.js.map +1 -1
- package/lib/app/index.d.ts +0 -1
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +0 -1
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApCircleCmd.d.ts +21 -0
- package/lib/command/AcApCircleCmd.d.ts.map +1 -0
- package/lib/command/AcApCircleCmd.js +115 -0
- package/lib/command/AcApCircleCmd.js.map +1 -0
- package/lib/command/AcApDimCmd.d.ts +57 -0
- package/lib/command/AcApDimCmd.d.ts.map +1 -0
- package/lib/command/AcApDimCmd.js +228 -0
- package/lib/command/AcApDimCmd.js.map +1 -0
- package/lib/command/AcApLogCmd.d.ts +13 -0
- package/lib/command/AcApLogCmd.d.ts.map +1 -0
- package/lib/command/AcApLogCmd.js +97 -0
- package/lib/command/AcApLogCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts +15 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -0
- package/lib/command/AcApSysVarCmd.js +94 -0
- package/lib/command/AcApSysVarCmd.js.map +1 -0
- package/lib/command/AcApZoomCmd.js +1 -1
- package/lib/command/AcApZoomCmd.js.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.d.ts +0 -36
- package/lib/command/AcApZoomToBoxCmd.d.ts.map +1 -1
- package/lib/command/AcApZoomToBoxCmd.js +4 -61
- package/lib/command/AcApZoomToBoxCmd.js.map +1 -1
- package/lib/command/index.d.ts +4 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +4 -0
- package/lib/command/index.js.map +1 -1
- package/lib/editor/command/AcEdCommandStack.d.ts +19 -1
- package/lib/editor/command/AcEdCommandStack.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommandStack.js +40 -0
- package/lib/editor/command/AcEdCommandStack.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts +14 -30
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +32 -31
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdPreviewJig.d.ts +103 -0
- package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdPreviewJig.js +82 -0
- package/lib/editor/input/AcEdPreviewJig.js.map +1 -0
- package/lib/editor/input/AcEditor.d.ts +58 -11
- package/lib/editor/input/AcEditor.d.ts.map +1 -1
- package/lib/editor/input/AcEditor.js +86 -22
- package/lib/editor/input/AcEditor.js.map +1 -1
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js +25 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts +8 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js +29 -0
- package/lib/editor/input/handler/AcEdDistanceHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts +7 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js +28 -0
- package/lib/editor/input/handler/AcEdDoubleHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts +14 -0
- package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdInputHandler.js +2 -0
- package/lib/editor/input/handler/AcEdInputHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js +44 -0
- package/lib/editor/input/handler/AcEdIntegerHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +11 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js +24 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +16 -0
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdPointHandler.js +19 -0
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts +12 -0
- package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -0
- package/lib/editor/input/handler/AcEdStringHandler.js +24 -0
- package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -0
- package/lib/editor/input/handler/index.d.ts +9 -0
- package/lib/editor/input/handler/index.d.ts.map +1 -0
- package/lib/editor/input/handler/index.js +9 -0
- package/lib/editor/input/handler/index.js.map +1 -0
- package/lib/editor/input/index.d.ts +4 -1
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +4 -1
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/marker/AcEdMarker.d.ts +72 -0
- package/lib/editor/input/marker/AcEdMarker.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdMarker.js +124 -0
- package/lib/editor/input/marker/AcEdMarker.js.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts +52 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.d.ts.map +1 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js +91 -0
- package/lib/editor/input/marker/AcEdOSnapMarkerManager.js.map +1 -0
- package/lib/editor/input/marker/index.d.ts +3 -0
- package/lib/editor/input/marker/index.d.ts.map +1 -0
- package/lib/editor/input/marker/index.js +3 -0
- package/lib/editor/input/marker/index.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts +63 -0
- package/lib/editor/input/prompt/AcEdKeyword.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeyword.js +120 -0
- package/lib/editor/input/prompt/AcEdKeyword.js.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts +52 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js +103 -0
- package/lib/editor/input/prompt/AcEdKeywordCollection.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +75 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +182 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js +114 -0
- package/lib/editor/input/prompt/AcEdPromptDistanceOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts +10 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js +31 -0
- package/lib/editor/input/prompt/AcEdPromptDoubleOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts +39 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js +84 -0
- package/lib/editor/input/prompt/AcEdPromptIntegerOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts +59 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js +140 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts +19 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js +36 -0
- package/lib/editor/input/prompt/AcEdPromptNumericalResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts +61 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js +179 -0
- package/lib/editor/input/prompt/AcEdPromptOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts +46 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js +113 -0
- package/lib/editor/input/prompt/AcEdPromptPointOptions.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts +25 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js +38 -0
- package/lib/editor/input/prompt/AcEdPromptPointResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts +27 -0
- package/lib/editor/input/prompt/AcEdPromptResult.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js +19 -0
- package/lib/editor/input/prompt/AcEdPromptResult.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts +22 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js +23 -0
- package/lib/editor/input/prompt/AcEdPromptStatus.js.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts +54 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.d.ts.map +1 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js +124 -0
- package/lib/editor/input/prompt/AcEdPromptStringOptions.js.map +1 -0
- package/lib/editor/input/prompt/index.d.ts +11 -0
- package/lib/editor/input/prompt/index.d.ts.map +1 -0
- package/lib/editor/input/prompt/index.js +11 -0
- package/lib/editor/input/prompt/index.js.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +116 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdCommandLine.js +481 -0
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +151 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js +239 -0
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts +60 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts +104 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +154 -0
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +113 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js +2 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.js.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts +132 -0
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdInputManager.js +477 -0
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts +66 -0
- package/lib/editor/input/ui/AcEdRubberBand.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdRubberBand.js +276 -0
- package/lib/editor/input/ui/AcEdRubberBand.js.map +1 -0
- package/lib/editor/input/ui/index.d.ts +3 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -0
- package/lib/editor/input/ui/index.js +3 -0
- package/lib/editor/input/ui/index.js.map +1 -0
- package/lib/editor/view/AcEdBaseView.d.ts +54 -16
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +14 -11
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdLayerInfo.d.ts +5 -0
- package/lib/editor/view/AcEdLayerInfo.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +135 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -0
- package/lib/i18n/AcApI18n.js +208 -0
- package/lib/i18n/AcApI18n.js.map +1 -0
- package/lib/i18n/en/command.d.ts +18 -0
- package/lib/i18n/en/command.d.ts.map +1 -0
- package/lib/i18n/en/command.js +17 -0
- package/lib/i18n/en/command.js.map +1 -0
- package/lib/i18n/en/jig.d.ts +11 -0
- package/lib/i18n/en/jig.d.ts.map +1 -0
- package/lib/i18n/en/jig.js +10 -0
- package/lib/i18n/en/jig.js.map +1 -0
- package/lib/i18n/en/main.d.ts +37 -0
- package/lib/i18n/en/main.d.ts.map +1 -0
- package/lib/i18n/en/main.js +36 -0
- package/lib/i18n/en/main.js.map +1 -0
- package/lib/i18n/index.d.ts +6 -0
- package/lib/i18n/index.d.ts.map +1 -0
- package/lib/i18n/index.js +31 -0
- package/lib/i18n/index.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +18 -0
- package/lib/i18n/zh/command.d.ts.map +1 -0
- package/lib/i18n/zh/command.js +17 -0
- package/lib/i18n/zh/command.js.map +1 -0
- package/lib/i18n/zh/jig.d.ts +11 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -0
- package/lib/i18n/zh/jig.js +10 -0
- package/lib/i18n/zh/jig.js.map +1 -0
- package/lib/i18n/zh/main.d.ts +37 -0
- package/lib/i18n/zh/main.d.ts.map +1 -0
- package/lib/i18n/zh/main.js +36 -0
- package/lib/i18n/zh/main.js.map +1 -0
- 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/view/AcTrLayer.d.ts +29 -5
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +44 -6
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +13 -7
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +29 -21
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +22 -8
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +36 -9
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +19 -4
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +135 -43
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +7 -7
- package/lib/editor/input/AcEdBaseInput.d.ts +0 -89
- package/lib/editor/input/AcEdBaseInput.d.ts.map +0 -1
- package/lib/editor/input/AcEdBaseInput.js +0 -166
- package/lib/editor/input/AcEdBaseInput.js.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.d.ts +0 -108
- package/lib/editor/input/AcEdBoxSelector.d.ts.map +0 -1
- package/lib/editor/input/AcEdBoxSelector.js +0 -220
- package/lib/editor/input/AcEdBoxSelector.js.map +0 -1
- package/lib/editor/input/AcEdInputPoint.d.ts +0 -51
- package/lib/editor/input/AcEdInputPoint.d.ts.map +0 -1
- package/lib/editor/input/AcEdInputPoint.js +0 -78
- package/lib/editor/input/AcEdInputPoint.js.map +0 -1
- package/lib/editor/input/AcEdJig.d.ts +0 -180
- package/lib/editor/input/AcEdJig.d.ts.map +0 -1
- package/lib/editor/input/AcEdJig.js +0 -256
- package/lib/editor/input/AcEdJig.js.map +0 -1
- package/lib/editor/input/AcEdJigLoop.d.ts +0 -63
- package/lib/editor/input/AcEdJigLoop.d.ts.map +0 -1
- package/lib/editor/input/AcEdJigLoop.js +0 -91
- package/lib/editor/input/AcEdJigLoop.js.map +0 -1
|
@@ -51,61 +51,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51
51
|
};
|
|
52
52
|
import { AcApDocManager } from '../app';
|
|
53
53
|
import { AcEdCommand } from '../command';
|
|
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
|
-
*/
|
|
73
|
-
var AcApZoomToBoxJig = /** @class */ (function (_super) {
|
|
74
|
-
__extends(AcApZoomToBoxJig, _super);
|
|
75
|
-
/**
|
|
76
|
-
* Creates a new zoom-to-box jig.
|
|
77
|
-
*
|
|
78
|
-
* @param view - The view that will be zoomed
|
|
79
|
-
*/
|
|
80
|
-
function AcApZoomToBoxJig(view) {
|
|
81
|
-
return _super.call(this, view) || this;
|
|
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
|
-
*/
|
|
91
|
-
AcApZoomToBoxJig.prototype.sampler = function () {
|
|
92
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
-
var _this = this;
|
|
94
|
-
return __generator(this, function (_a) {
|
|
95
|
-
switch (_a.label) {
|
|
96
|
-
case 0: return [4 /*yield*/, AcApDocManager.instance.editor.getSelection().then(function (box) {
|
|
97
|
-
return _this.view.zoomTo(box, 1);
|
|
98
|
-
})];
|
|
99
|
-
case 1:
|
|
100
|
-
_a.sent();
|
|
101
|
-
return [2 /*return*/];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
return AcApZoomToBoxJig;
|
|
107
|
-
}(AcEdJig));
|
|
108
|
-
export { AcApZoomToBoxJig };
|
|
109
54
|
/**
|
|
110
55
|
* Command for zooming to a user-selected rectangular area.
|
|
111
56
|
*
|
|
@@ -139,15 +84,13 @@ var AcApZoomToBoxCmd = /** @class */ (function (_super) {
|
|
|
139
84
|
*/
|
|
140
85
|
AcApZoomToBoxCmd.prototype.execute = function (context) {
|
|
141
86
|
return __awaiter(this, void 0, void 0, function () {
|
|
142
|
-
var
|
|
87
|
+
var box;
|
|
143
88
|
return __generator(this, function (_a) {
|
|
144
89
|
switch (_a.label) {
|
|
145
|
-
case 0:
|
|
146
|
-
jig = new AcApZoomToBoxJig(context.view);
|
|
147
|
-
return [4 /*yield*/, jig.drag()];
|
|
90
|
+
case 0: return [4 /*yield*/, AcApDocManager.instance.editor.getSelection()];
|
|
148
91
|
case 1:
|
|
149
|
-
_a.sent();
|
|
150
|
-
return [2 /*return
|
|
92
|
+
box = _a.sent();
|
|
93
|
+
return [2 /*return*/, context.view.zoomTo(box, 1)];
|
|
151
94
|
}
|
|
152
95
|
});
|
|
153
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApZoomToBoxCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AcApZoomToBoxCmd.js","sourceRoot":"","sources":["../../src/command/AcApZoomToBoxCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAe,cAAc,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAExC;;;;;;;;;;;;;;;;GAgBG;AACH;IAAsC,oCAAW;IAAjD;;IAcA,CAAC;IAbC;;;;;;;;OAQG;IACG,kCAAO,GAAb,UAAc,OAAoB;;;;;4BACpB,qBAAM,cAAc,CAAC,QAAQ,CAAC,MAAM,CAAC,YAAY,EAAE,EAAA;;wBAAzD,GAAG,GAAG,SAAmD;wBAC/D,sBAAO,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,EAAA;;;;KACnC;IACH,uBAAC;AAAD,CAAC,AAdD,CAAsC,WAAW,GAchD"}
|
package/lib/command/index.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export * from '../editor/command/AcEdCommand';
|
|
2
2
|
export * from '../editor/command/AcEdCommandStack';
|
|
3
|
+
export * from './AcApCircleCmd';
|
|
3
4
|
export * from './AcApConvertToSvgCmd';
|
|
5
|
+
export * from './AcApDimCmd';
|
|
6
|
+
export * from './AcApLogCmd';
|
|
4
7
|
export * from './AcApOpenCmd';
|
|
5
8
|
export * from './AcApQNewCmd';
|
|
6
9
|
export * from './AcApRegenCmd';
|
|
7
10
|
export * from './AcApSelectCmd';
|
|
11
|
+
export * from './AcApSysVarCmd';
|
|
8
12
|
export * from './AcApZoomCmd';
|
|
9
13
|
export * from './AcApZoomToBoxCmd';
|
|
10
14
|
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,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,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,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,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"}
|
package/lib/command/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export * from '../editor/command/AcEdCommand';
|
|
2
2
|
export * from '../editor/command/AcEdCommandStack';
|
|
3
|
+
export * from './AcApCircleCmd';
|
|
3
4
|
export * from './AcApConvertToSvgCmd';
|
|
5
|
+
export * from './AcApDimCmd';
|
|
6
|
+
export * from './AcApLogCmd';
|
|
4
7
|
export * from './AcApOpenCmd';
|
|
5
8
|
export * from './AcApQNewCmd';
|
|
6
9
|
export * from './AcApRegenCmd';
|
|
7
10
|
export * from './AcApSelectCmd';
|
|
11
|
+
export * from './AcApSysVarCmd';
|
|
8
12
|
export * from './AcApZoomCmd';
|
|
9
13
|
export * from './AcApZoomToBoxCmd';
|
|
10
14
|
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,uBAAuB,CAAA;AACrC,cAAc,eAAe,CAAA;AAC7B,cAAc,eAAe,CAAA;AAC7B,cAAc,gBAAgB,CAAA;AAC9B,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,iBAAiB,CAAA;AAC/B,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,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,5 +1,5 @@
|
|
|
1
1
|
import { AcEdCommand } from './AcEdCommand';
|
|
2
|
-
import { AcEdCommandIterator } from './AcEdCommandIterator';
|
|
2
|
+
import { AcEdCommandIterator, AcEdCommandIteratorItem } from './AcEdCommandIterator';
|
|
3
3
|
/**
|
|
4
4
|
* Interface representing a command group in the command stack.
|
|
5
5
|
* Groups commands by name and provides maps for both global and local command lookups.
|
|
@@ -75,6 +75,24 @@ export declare class AcEdCommandStack {
|
|
|
75
75
|
* stack.
|
|
76
76
|
*/
|
|
77
77
|
iterator(): AcEdCommandIterator;
|
|
78
|
+
/**
|
|
79
|
+
* Fuzzy search for commands by prefix using the command iterator.
|
|
80
|
+
*
|
|
81
|
+
* This method iterates through all commands in all command groups and returns those
|
|
82
|
+
* whose global or local names start with the provided prefix. The search is case-insensitive.
|
|
83
|
+
*
|
|
84
|
+
* @param prefix - The prefix string to search for. Case-insensitive.
|
|
85
|
+
* @returns An array of objects containing matched commands and their corresponding group names.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* const matches = commandStack.searchCommandsByPrefix('LI');
|
|
90
|
+
* matches.forEach(item => {
|
|
91
|
+
* console.log(item.groupName, item.command.globalName);
|
|
92
|
+
* });
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
searchCommandsByPrefix(prefix: string): AcEdCommandIteratorItem[];
|
|
78
96
|
/**
|
|
79
97
|
* Search through all of the global and untranslated names in all of the command groups in the command
|
|
80
98
|
* stack starting at the top of the stack trying to find a match with cmdName. If a match is found, the
|
|
@@ -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,
|
|
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;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;IA+ClB;;;;;;OAMG;IACH,QAAQ;IAIR;;;;;;;;;;;;;;;;OAgBG;IACH,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,EAAE;IAoBjE;;;;;;;;;OASG;IACH,eAAe,CAAC,OAAO,EAAE,MAAM;IAU/B;;;;;;;;;OASG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM;IAU9B;;;;;;;;;OASG;IACH,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IAWrD;;;;;;OAMG;IACH,WAAW,CAAC,SAAS,EAAE,MAAM;CAa9B"}
|
|
@@ -76,6 +76,9 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
76
76
|
* ```
|
|
77
77
|
*/
|
|
78
78
|
AcEdCommandStack.prototype.addCommand = function (cmdGroupName, cmdGlobalName, cmdLocalName, cmd) {
|
|
79
|
+
cmdGroupName = cmdGroupName.toUpperCase();
|
|
80
|
+
cmdGlobalName = cmdGlobalName.toUpperCase();
|
|
81
|
+
cmdLocalName = cmdLocalName.toUpperCase();
|
|
79
82
|
if (!cmdGlobalName) {
|
|
80
83
|
throw new Error('[AcEdCommandStack] The global name of the command is required!');
|
|
81
84
|
}
|
|
@@ -117,6 +120,38 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
117
120
|
AcEdCommandStack.prototype.iterator = function () {
|
|
118
121
|
return new AcEdCommandIterator(this._commandsByGroup);
|
|
119
122
|
};
|
|
123
|
+
/**
|
|
124
|
+
* Fuzzy search for commands by prefix using the command iterator.
|
|
125
|
+
*
|
|
126
|
+
* This method iterates through all commands in all command groups and returns those
|
|
127
|
+
* whose global or local names start with the provided prefix. The search is case-insensitive.
|
|
128
|
+
*
|
|
129
|
+
* @param prefix - The prefix string to search for. Case-insensitive.
|
|
130
|
+
* @returns An array of objects containing matched commands and their corresponding group names.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* const matches = commandStack.searchCommandsByPrefix('LI');
|
|
135
|
+
* matches.forEach(item => {
|
|
136
|
+
* console.log(item.groupName, item.command.globalName);
|
|
137
|
+
* });
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
AcEdCommandStack.prototype.searchCommandsByPrefix = function (prefix) {
|
|
141
|
+
prefix = prefix.toUpperCase();
|
|
142
|
+
var results = [];
|
|
143
|
+
var iter = this.iterator();
|
|
144
|
+
var item = iter.next();
|
|
145
|
+
while (!item.done) {
|
|
146
|
+
var command = item.value.command;
|
|
147
|
+
if (command.globalName.startsWith(prefix) ||
|
|
148
|
+
command.localName.startsWith(prefix)) {
|
|
149
|
+
results.push(item.value);
|
|
150
|
+
}
|
|
151
|
+
item = iter.next();
|
|
152
|
+
}
|
|
153
|
+
return results;
|
|
154
|
+
};
|
|
120
155
|
/**
|
|
121
156
|
* Search through all of the global and untranslated names in all of the command groups in the command
|
|
122
157
|
* stack starting at the top of the stack trying to find a match with cmdName. If a match is found, the
|
|
@@ -129,6 +164,7 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
129
164
|
*/
|
|
130
165
|
AcEdCommandStack.prototype.lookupGlobalCmd = function (cmdName) {
|
|
131
166
|
var e_1, _a;
|
|
167
|
+
cmdName = cmdName.toUpperCase();
|
|
132
168
|
var result = undefined;
|
|
133
169
|
try {
|
|
134
170
|
for (var _b = __values(this._commandsByGroup), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -159,6 +195,7 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
159
195
|
*/
|
|
160
196
|
AcEdCommandStack.prototype.lookupLocalCmd = function (cmdName) {
|
|
161
197
|
var e_2, _a;
|
|
198
|
+
cmdName = cmdName.toUpperCase();
|
|
162
199
|
var result = undefined;
|
|
163
200
|
try {
|
|
164
201
|
for (var _b = __values(this._commandsByGroup), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -189,6 +226,8 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
189
226
|
*/
|
|
190
227
|
AcEdCommandStack.prototype.removeCmd = function (cmdGroupName, cmdGlobalName) {
|
|
191
228
|
var e_3, _a;
|
|
229
|
+
cmdGroupName = cmdGroupName.toUpperCase();
|
|
230
|
+
cmdGlobalName = cmdGlobalName.toUpperCase();
|
|
192
231
|
try {
|
|
193
232
|
for (var _b = __values(this._commandsByGroup), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
194
233
|
var group = _c.value;
|
|
@@ -214,6 +253,7 @@ var AcEdCommandStack = /** @class */ (function () {
|
|
|
214
253
|
* @returns Return true if successful. Return false if no command group is found with the name `GroupName`.
|
|
215
254
|
*/
|
|
216
255
|
AcEdCommandStack.prototype.removeGroup = function (groupName) {
|
|
256
|
+
groupName = groupName.toUpperCase();
|
|
217
257
|
var tmp = -1;
|
|
218
258
|
this._commandsByGroup.some(function (group, index) {
|
|
219
259
|
tmp = index;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCommandStack.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandStack.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"AcEdCommandStack.js","sourceRoot":"","sources":["../../../src/editor/command/AcEdCommandStack.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EACL,mBAAmB,EAEpB,MAAM,uBAAuB,CAAA;AAe9B;;;;;;;;;;;;;GAaG;AACH;IAeE;;;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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,OAAO,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;gBACzD,CAAC;YACH,CAAC;;;;;;;;;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAED;;;;;;OAMG;IACH,sCAAW,GAAX,UAAY,SAAiB;QAC3B,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAA;QACnC,IAAI,GAAG,GAAG,CAAC,CAAC,CAAA;QACZ,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,UAAC,KAAK,EAAE,KAAK;YACtC,GAAG,GAAG,KAAK,CAAA;YACX,OAAO,KAAK,CAAC,SAAS,IAAI,SAAS,CAAA;QACrC,CAAC,CAAC,CAAA;QACF,IAAI,GAAG,IAAI,CAAC,EAAE,CAAC;YACb,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;YACpC,OAAO,IAAI,CAAA;QACb,CAAC;QACD,OAAO,KAAK,CAAA;IACd,CAAC;IAjPD,2CAA2C;IACpC,2CAA0B,GAAG,MAAM,CAAA;IAC1C,iDAAiD;IAC1C,0CAAyB,GAAG,MAAM,CAAA;IA+O3C,uBAAC;CAAA,AAnPD,IAmPC;SAnPY,gBAAgB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AcEdBaseView } from '../view';
|
|
1
2
|
/**
|
|
2
3
|
* Enumeration of cursor types available in the CAD editor.
|
|
3
4
|
*
|
|
@@ -58,47 +59,30 @@ export declare enum AcEdCorsorType {
|
|
|
58
59
|
*
|
|
59
60
|
* The cursor manager maintains a cache of cursor definitions to avoid
|
|
60
61
|
* recreating them repeatedly, improving performance.
|
|
61
|
-
*
|
|
62
|
-
* @internal This class is for internal use by the editor system
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```typescript
|
|
66
|
-
* const cursorManager = new AcEdCursorManager();
|
|
67
|
-
* const canvas = document.getElementById('canvas') as HTMLCanvasElement;
|
|
68
|
-
*
|
|
69
|
-
* // Set crosshair cursor
|
|
70
|
-
* cursorManager.setCursor(AcEdCorsorType.Crosshair, canvas);
|
|
71
|
-
*
|
|
72
|
-
* // Set grab cursor for panning
|
|
73
|
-
* cursorManager.setCursor(AcEdCorsorType.Grab, canvas);
|
|
74
|
-
* ```
|
|
75
62
|
*/
|
|
76
63
|
export declare class AcEdCursorManager {
|
|
64
|
+
/** The view associated with the cursor manager */
|
|
65
|
+
private _view;
|
|
66
|
+
/** The current curos type in the associated view */
|
|
67
|
+
private _currentCursor;
|
|
77
68
|
/** Cache of cursor definitions mapped by cursor type */
|
|
78
69
|
private _cursorMap;
|
|
79
70
|
/**
|
|
80
71
|
* Creates a new cursor manager instance.
|
|
81
|
-
*
|
|
82
|
-
*
|
|
72
|
+
* Initializes the cursor and creates default cursor definitions.
|
|
73
|
+
* @param view - The view associated with the cursor manager
|
|
83
74
|
*/
|
|
84
|
-
constructor();
|
|
75
|
+
constructor(view: AcEdBaseView);
|
|
85
76
|
/**
|
|
86
|
-
*
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
*
|
|
77
|
+
* The current cursor type for the associated view.
|
|
78
|
+
*/
|
|
79
|
+
get currentCursor(): AcEdCorsorType;
|
|
80
|
+
/**
|
|
81
|
+
* Sets the current cursor for the associated view.
|
|
91
82
|
*
|
|
92
83
|
* @param cursorType - The type of cursor to set
|
|
93
|
-
* @param element - The HTML element to apply the cursor to
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```typescript
|
|
97
|
-
* const canvas = document.getElementById('canvas') as HTMLCanvasElement;
|
|
98
|
-
* cursorManager.setCursor(AcEdCorsorType.Crosshair, canvas);
|
|
99
|
-
* ```
|
|
100
84
|
*/
|
|
101
|
-
setCursor(cursorType: AcEdCorsorType
|
|
85
|
+
setCursor(cursorType: AcEdCorsorType): void;
|
|
102
86
|
/**
|
|
103
87
|
* Encodes an SVG string into a CSS cursor URL.
|
|
104
88
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCursorManager.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcEdCursorManager.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC;;;;;;;;;;;;;;;;;;GAkBG;AACH,oBAAY,cAAc;IACxB,+CAA+C;IAC/C,eAAe,KAAK;IACpB,mDAAmD;IACnD,SAAS,IAAI;IACb,0CAA0C;IAC1C,UAAU,IAAA;IACV,6CAA6C;IAC7C,UAAU,IAAA;IACV,yBAAyB;IACzB,UAAU,IAAA;IACV,4CAA4C;IAC5C,SAAS,IAAA;IACT,+BAA+B;IAC/B,gBAAgB,IAAA;IAChB,8CAA8C;IAC9C,iBAAiB,IAAA;IACjB,yCAAyC;IACzC,SAAS,IAAA;IACT,8BAA8B;IAC9B,YAAY,IAAA;IACZ,iDAAiD;IACjD,aAAa,IAAA;IACb,+CAA+C;IAC/C,mBAAmB,KAAA;IACnB,gDAAgD;IAChD,cAAc,KAAA;IACd,8BAA8B;IAC9B,eAAe,KAAA;IACf,mCAAmC;IACnC,IAAI,KAAA;CACL;AAED;;;;;;;;;GASG;AACH,qBAAa,iBAAiB;IAC5B,kDAAkD;IAClD,OAAO,CAAC,KAAK,CAAc;IAE3B,oDAAoD;IACpD,OAAO,CAAC,cAAc,CAAiB;IAEvC,wDAAwD;IACxD,OAAO,CAAC,UAAU,CAA6B;IAE/C;;;;OAIG;gBACS,IAAI,EAAE,YAAY;IAuB9B;;OAEG;IACH,IAAI,aAAa,mBAEhB;IAED;;;;OAIG;IACH,SAAS,CAAC,UAAU,EAAE,cAAc;IAepC;;;;;;;;;;;;;;;;;OAiBG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAIrE;;;;;;OAMG;IACH,OAAO,CAAC,mBAAmB;CAsB5B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AcDbSysVarManager } from '@mlightcad/data-model';
|
|
1
2
|
/**
|
|
2
3
|
* Enumeration of cursor types available in the CAD editor.
|
|
3
4
|
*
|
|
@@ -59,48 +60,47 @@ export var AcEdCorsorType;
|
|
|
59
60
|
*
|
|
60
61
|
* The cursor manager maintains a cache of cursor definitions to avoid
|
|
61
62
|
* recreating them repeatedly, improving performance.
|
|
62
|
-
*
|
|
63
|
-
* @internal This class is for internal use by the editor system
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```typescript
|
|
67
|
-
* const cursorManager = new AcEdCursorManager();
|
|
68
|
-
* const canvas = document.getElementById('canvas') as HTMLCanvasElement;
|
|
69
|
-
*
|
|
70
|
-
* // Set crosshair cursor
|
|
71
|
-
* cursorManager.setCursor(AcEdCorsorType.Crosshair, canvas);
|
|
72
|
-
*
|
|
73
|
-
* // Set grab cursor for panning
|
|
74
|
-
* cursorManager.setCursor(AcEdCorsorType.Grab, canvas);
|
|
75
|
-
* ```
|
|
76
63
|
*/
|
|
77
64
|
var AcEdCursorManager = /** @class */ (function () {
|
|
78
65
|
/**
|
|
79
66
|
* Creates a new cursor manager instance.
|
|
80
|
-
*
|
|
81
|
-
*
|
|
67
|
+
* Initializes the cursor and creates default cursor definitions.
|
|
68
|
+
* @param view - The view associated with the cursor manager
|
|
82
69
|
*/
|
|
83
|
-
function AcEdCursorManager() {
|
|
70
|
+
function AcEdCursorManager(view) {
|
|
71
|
+
var _this = this;
|
|
72
|
+
this._view = view;
|
|
84
73
|
this._cursorMap = new Map();
|
|
85
|
-
|
|
74
|
+
var totalLength = 20;
|
|
75
|
+
var rectSize = 10;
|
|
76
|
+
this._cursorMap.set(AcEdCorsorType.Crosshair, this.createRectCrossIcon(rectSize, totalLength - rectSize));
|
|
77
|
+
AcDbSysVarManager.instance().events.sysVarChanged.addEventListener(function (args) {
|
|
78
|
+
if (args.name === 'PICKBOX') {
|
|
79
|
+
var size = args.newVal;
|
|
80
|
+
size = size >= 0 ? size : 0;
|
|
81
|
+
_this._cursorMap.set(AcEdCorsorType.Crosshair, _this.createRectCrossIcon(size, totalLength - size));
|
|
82
|
+
_this.setCursor(_this._currentCursor);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
this.setCursor(AcEdCorsorType.Crosshair);
|
|
86
86
|
}
|
|
87
|
+
Object.defineProperty(AcEdCursorManager.prototype, "currentCursor", {
|
|
88
|
+
/**
|
|
89
|
+
* The current cursor type for the associated view.
|
|
90
|
+
*/
|
|
91
|
+
get: function () {
|
|
92
|
+
return this._currentCursor;
|
|
93
|
+
},
|
|
94
|
+
enumerable: false,
|
|
95
|
+
configurable: true
|
|
96
|
+
});
|
|
87
97
|
/**
|
|
88
|
-
* Sets the cursor for the
|
|
89
|
-
*
|
|
90
|
-
* Applies the appropriate cursor style based on the cursor type.
|
|
91
|
-
* For built-in cursor types, uses CSS cursor values. For custom
|
|
92
|
-
* cursor types, uses cached SVG-based cursor definitions.
|
|
98
|
+
* Sets the current cursor for the associated view.
|
|
93
99
|
*
|
|
94
100
|
* @param cursorType - The type of cursor to set
|
|
95
|
-
* @param element - The HTML element to apply the cursor to
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* ```typescript
|
|
99
|
-
* const canvas = document.getElementById('canvas') as HTMLCanvasElement;
|
|
100
|
-
* cursorManager.setCursor(AcEdCorsorType.Crosshair, canvas);
|
|
101
|
-
* ```
|
|
102
101
|
*/
|
|
103
|
-
AcEdCursorManager.prototype.setCursor = function (cursorType
|
|
102
|
+
AcEdCursorManager.prototype.setCursor = function (cursorType) {
|
|
103
|
+
var element = this._view.canvas;
|
|
104
104
|
if (cursorType <= AcEdCorsorType.NoSpecialCursor) {
|
|
105
105
|
element.style.cursor = 'default';
|
|
106
106
|
}
|
|
@@ -113,6 +113,7 @@ var AcEdCursorManager = /** @class */ (function () {
|
|
|
113
113
|
element.style.cursor = cursor;
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
|
+
this._currentCursor = cursorType;
|
|
116
117
|
};
|
|
117
118
|
/**
|
|
118
119
|
* Encodes an SVG string into a CSS cursor URL.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdCursorManager.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IACxB,+CAA+C;IAC/C,0EAAoB,CAAA;IACpB,mDAAmD;IACnD,6DAAa,CAAA;IACb,0CAA0C;IAC1C,+DAAU,CAAA;IACV,6CAA6C;IAC7C,+DAAU,CAAA;IACV,yBAAyB;IACzB,+DAAU,CAAA;IACV,4CAA4C;IAC5C,6DAAS,CAAA;IACT,+BAA+B;IAC/B,2EAAgB,CAAA;IAChB,8CAA8C;IAC9C,6EAAiB,CAAA;IACjB,yCAAyC;IACzC,6DAAS,CAAA;IACT,8BAA8B;IAC9B,mEAAY,CAAA;IACZ,iDAAiD;IACjD,qEAAa,CAAA;IACb,+CAA+C;IAC/C,kFAAmB,CAAA;IACnB,gDAAgD;IAChD,wEAAc,CAAA;IACd,8BAA8B;IAC9B,0EAAe,CAAA;IACf,mCAAmC;IACnC,oDAAI,CAAA;AACN,CAAC,EA/BW,cAAc,KAAd,cAAc,QA+BzB;AAED
|
|
1
|
+
{"version":3,"file":"AcEdCursorManager.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdCursorManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAIzD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAN,IAAY,cA+BX;AA/BD,WAAY,cAAc;IACxB,+CAA+C;IAC/C,0EAAoB,CAAA;IACpB,mDAAmD;IACnD,6DAAa,CA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AE3B,IAAM,QAAQ,GAAG,QAAQ,GAAG,CAAC,CAAA;QAC7B,IAAM,OAAO,GAAG,QAAQ,GAAG,CAAC,GAAG,UAAU,CAAA;QACzC,IAAM,GAAG,GAAG,oEACuC,OAAO,yBAAa,OAAO,8BAAkB,OAAO,cAAI,OAAO,oCACnG,UAAU,oBAAQ,UAAU,wBAAY,QAAQ,yBAAa,QAAQ,uCAAyB,SAAS,uCACtG,QAAQ,GAAG,UAAU,8BAAgB,QAAQ,GAAG,UAAU,qBAAS,UAAU,yBAAa,SAAS,uCACnG,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,CAAC,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,yBAAa,SAAS,uCACzI,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,UAAU,qBAAS,QAAQ,GAAG,CAAC,GAAG,UAAU,yBAAa,SAAS,gDAClI,QAAQ,GAAG,UAAU,qBAAS,UAAU,qBAAS,QAAQ,GAAG,UAAU,yBAAa,SAAS,8BAElH,CAAA;QACD,OAAO,IAAI,CAAC,iBAAiB,CAC3B,GAAG,EACH,QAAQ,GAAG,UAAU,EACrB,QAAQ,GAAG,UAAU,CACtB,CAAA;IACH,CAAC;IACH,wBAAC;AAAD,CAAC,AApHD,IAoHC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { AcDbEntity } from '@mlightcad/data-model';
|
|
2
|
+
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
3
|
+
/**
|
|
4
|
+
* @class AcEdPreviewJig<T>
|
|
5
|
+
* @template T
|
|
6
|
+
*
|
|
7
|
+
* @description
|
|
8
|
+
* A generic, TypeScript-based version of AutoCAD’s AcEdJig system for
|
|
9
|
+
* interactive previews during editor input.
|
|
10
|
+
*
|
|
11
|
+
* This class manages a *transient preview entity* that updates dynamically
|
|
12
|
+
* as the user moves the cursor or provides other incremental input.
|
|
13
|
+
*
|
|
14
|
+
* ## Why Generic?
|
|
15
|
+
* AutoCAD’s jig can sample different types of values:
|
|
16
|
+
* - a 3D point → during acquirePoint()
|
|
17
|
+
* - a distance → during acquireDistance()
|
|
18
|
+
* - an angle → during acquireAngle()
|
|
19
|
+
*
|
|
20
|
+
* Using a generic type parameter `T` allows the jig to update entities
|
|
21
|
+
* based on different input types while sharing the same structure.
|
|
22
|
+
*
|
|
23
|
+
* ## Method Mapping vs AutoCAD AcEdJig
|
|
24
|
+
* | AutoCAD AcEdJig Method | Purpose | This Class |
|
|
25
|
+
* |-------------------------|---------|------------|
|
|
26
|
+
* | `sampler()` | Sample new input | `update(value: T)` |
|
|
27
|
+
* | `worldDraw()` | Draw geometry | `render()` |
|
|
28
|
+
* | `startJig()` | Begin preview | `setEntity()` |
|
|
29
|
+
* | `drag()` | Main loop | Controlled externally via JS events |
|
|
30
|
+
*
|
|
31
|
+
* ## Entity Integration
|
|
32
|
+
* The preview entity may optionally implement:
|
|
33
|
+
* ```ts
|
|
34
|
+
* onJigUpdate(value: T): void
|
|
35
|
+
* ```
|
|
36
|
+
* When present, the jig will call it whenever the input changes.
|
|
37
|
+
*
|
|
38
|
+
* ## Example Use Cases
|
|
39
|
+
* - Point acquisition (`T = AcGePoint3d`)
|
|
40
|
+
* - Distance jig (`T = number`)
|
|
41
|
+
* - Angle jig (`T = number`)
|
|
42
|
+
*
|
|
43
|
+
* Example:
|
|
44
|
+
* ```ts
|
|
45
|
+
* const jig = new AcEdPreviewJig<AcGePoint3d>(view)
|
|
46
|
+
* jig.setEntity(circleEntity)
|
|
47
|
+
* await editor.getPoint("Specify center:", { jig })
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare abstract class AcEdPreviewJig<T> {
|
|
51
|
+
private view;
|
|
52
|
+
/**
|
|
53
|
+
* Construct a new preview jig.
|
|
54
|
+
*
|
|
55
|
+
* @param view The CAD drawing view responsible for rendering transient graphics.
|
|
56
|
+
* Called via `view.draw(entity)` on each update.
|
|
57
|
+
*/
|
|
58
|
+
constructor(view: AcEdBaseView);
|
|
59
|
+
/**
|
|
60
|
+
* Assign the preview entity used by the jig.
|
|
61
|
+
*
|
|
62
|
+
* The entity should be transient (not yet added to the model database).
|
|
63
|
+
*
|
|
64
|
+
* @param ent The preview entity to display.
|
|
65
|
+
*/
|
|
66
|
+
abstract get entity(): AcDbEntity | null;
|
|
67
|
+
/**
|
|
68
|
+
* Update the preview entity based on incremental input.
|
|
69
|
+
*
|
|
70
|
+
* This method replaces the older `updatePoint()` and now accepts any type `T`,
|
|
71
|
+
* enabling use for point, distance, angle, or custom parameter updates.
|
|
72
|
+
*
|
|
73
|
+
* This function performs the conceptual role of AutoCAD’s `sampler()`:
|
|
74
|
+
* the editor triggers this method whenever the user’s input changes.
|
|
75
|
+
*
|
|
76
|
+
* If the preview entity implements:
|
|
77
|
+
* ```ts
|
|
78
|
+
* onJigUpdate(value: T)
|
|
79
|
+
* ```
|
|
80
|
+
* then it will be invoked here to recompute geometry.
|
|
81
|
+
*
|
|
82
|
+
* @param value Incremental value of type `T` describing new jig input.
|
|
83
|
+
* Examples:
|
|
84
|
+
* - world point
|
|
85
|
+
* - radius/distance
|
|
86
|
+
* - angle in radians
|
|
87
|
+
*/
|
|
88
|
+
abstract update(value: T): void;
|
|
89
|
+
/**
|
|
90
|
+
* Render the preview entity through the associated view.
|
|
91
|
+
*
|
|
92
|
+
* Equivalent to AutoCAD’s `worldDraw()` — called after each `update(value)`.
|
|
93
|
+
*/
|
|
94
|
+
render(): void;
|
|
95
|
+
/**
|
|
96
|
+
* End the jig and clear any transient preview state.
|
|
97
|
+
*
|
|
98
|
+
* Should be called when the user finalizes input (mouse click or Enter)
|
|
99
|
+
* to prevent further updates and allow garbage collection.
|
|
100
|
+
*/
|
|
101
|
+
end(): void;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=AcEdPreviewJig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdPreviewJig.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEdPreviewJig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,8BAAsB,cAAc,CAAC,CAAC;IACpC,OAAO,CAAC,IAAI,CAAc;IAE1B;;;;;OAKG;gBACS,IAAI,EAAE,YAAY;IAI9B;;;;;;OAMG;IACH,QAAQ,KAAK,MAAM,IAAI,UAAU,GAAG,IAAI,CAAA;IAExC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAE/B;;;;OAIG;IACH,MAAM,IAAI,IAAI;IAMd;;;;;OAKG;IACH,GAAG,IAAI,IAAI;CAKZ"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @class AcEdPreviewJig<T>
|
|
3
|
+
* @template T
|
|
4
|
+
*
|
|
5
|
+
* @description
|
|
6
|
+
* A generic, TypeScript-based version of AutoCAD’s AcEdJig system for
|
|
7
|
+
* interactive previews during editor input.
|
|
8
|
+
*
|
|
9
|
+
* This class manages a *transient preview entity* that updates dynamically
|
|
10
|
+
* as the user moves the cursor or provides other incremental input.
|
|
11
|
+
*
|
|
12
|
+
* ## Why Generic?
|
|
13
|
+
* AutoCAD’s jig can sample different types of values:
|
|
14
|
+
* - a 3D point → during acquirePoint()
|
|
15
|
+
* - a distance → during acquireDistance()
|
|
16
|
+
* - an angle → during acquireAngle()
|
|
17
|
+
*
|
|
18
|
+
* Using a generic type parameter `T` allows the jig to update entities
|
|
19
|
+
* based on different input types while sharing the same structure.
|
|
20
|
+
*
|
|
21
|
+
* ## Method Mapping vs AutoCAD AcEdJig
|
|
22
|
+
* | AutoCAD AcEdJig Method | Purpose | This Class |
|
|
23
|
+
* |-------------------------|---------|------------|
|
|
24
|
+
* | `sampler()` | Sample new input | `update(value: T)` |
|
|
25
|
+
* | `worldDraw()` | Draw geometry | `render()` |
|
|
26
|
+
* | `startJig()` | Begin preview | `setEntity()` |
|
|
27
|
+
* | `drag()` | Main loop | Controlled externally via JS events |
|
|
28
|
+
*
|
|
29
|
+
* ## Entity Integration
|
|
30
|
+
* The preview entity may optionally implement:
|
|
31
|
+
* ```ts
|
|
32
|
+
* onJigUpdate(value: T): void
|
|
33
|
+
* ```
|
|
34
|
+
* When present, the jig will call it whenever the input changes.
|
|
35
|
+
*
|
|
36
|
+
* ## Example Use Cases
|
|
37
|
+
* - Point acquisition (`T = AcGePoint3d`)
|
|
38
|
+
* - Distance jig (`T = number`)
|
|
39
|
+
* - Angle jig (`T = number`)
|
|
40
|
+
*
|
|
41
|
+
* Example:
|
|
42
|
+
* ```ts
|
|
43
|
+
* const jig = new AcEdPreviewJig<AcGePoint3d>(view)
|
|
44
|
+
* jig.setEntity(circleEntity)
|
|
45
|
+
* await editor.getPoint("Specify center:", { jig })
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
var AcEdPreviewJig = /** @class */ (function () {
|
|
49
|
+
/**
|
|
50
|
+
* Construct a new preview jig.
|
|
51
|
+
*
|
|
52
|
+
* @param view The CAD drawing view responsible for rendering transient graphics.
|
|
53
|
+
* Called via `view.draw(entity)` on each update.
|
|
54
|
+
*/
|
|
55
|
+
function AcEdPreviewJig(view) {
|
|
56
|
+
this.view = view;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Render the preview entity through the associated view.
|
|
60
|
+
*
|
|
61
|
+
* Equivalent to AutoCAD’s `worldDraw()` — called after each `update(value)`.
|
|
62
|
+
*/
|
|
63
|
+
AcEdPreviewJig.prototype.render = function () {
|
|
64
|
+
if (this.entity) {
|
|
65
|
+
this.view.addTransientEntity(this.entity);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* End the jig and clear any transient preview state.
|
|
70
|
+
*
|
|
71
|
+
* Should be called when the user finalizes input (mouse click or Enter)
|
|
72
|
+
* to prevent further updates and allow garbage collection.
|
|
73
|
+
*/
|
|
74
|
+
AcEdPreviewJig.prototype.end = function () {
|
|
75
|
+
if (this.entity) {
|
|
76
|
+
this.view.removeTransientEntity(this.entity.objectId);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
return AcEdPreviewJig;
|
|
80
|
+
}());
|
|
81
|
+
export { AcEdPreviewJig };
|
|
82
|
+
//# sourceMappingURL=AcEdPreviewJig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdPreviewJig.js","sourceRoot":"","sources":["../../../src/editor/input/AcEdPreviewJig.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH;IAGE;;;;;OAKG;IACH,wBAAY,IAAkB;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAkCD;;;;OAIG;IACH,+BAAM,GAAN;QACE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC3C,CAAC;IACH,CAAC;IAED;;;;;OAKG;IACH,4BAAG,GAAH;QACE,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YAChB,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;QACvD,CAAC;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAnED,IAmEC"}
|