@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
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
1
2
|
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
2
3
|
import { AcEdCorsorType } from './AcEdCursorManager';
|
|
4
|
+
import { AcEdPromptAngleOptions, AcEdPromptDistanceOptions, AcEdPromptPointOptions, AcEdPromptStringOptions } from './prompt';
|
|
5
|
+
/**
|
|
6
|
+
* Event arguments for system variable related events.
|
|
7
|
+
*/
|
|
8
|
+
export interface AcDbSysVarEventArgs {
|
|
9
|
+
/** The system variable name */
|
|
10
|
+
name: string;
|
|
11
|
+
}
|
|
3
12
|
/**
|
|
4
13
|
* Advanced input handler for CAD operations providing high-level user interaction methods.
|
|
5
14
|
*
|
|
@@ -34,14 +43,31 @@ export declare class AcEditor {
|
|
|
34
43
|
private _currentCursor?;
|
|
35
44
|
/** Manager for cursor appearance and behavior */
|
|
36
45
|
private _cursorManager;
|
|
46
|
+
/** Manager for mouse and keyboard input */
|
|
47
|
+
private _inputManager;
|
|
37
48
|
/** The view this editor is associated with */
|
|
38
49
|
protected _view: AcEdBaseView;
|
|
50
|
+
/**
|
|
51
|
+
* Editor events
|
|
52
|
+
*/
|
|
53
|
+
readonly events: {
|
|
54
|
+
/**
|
|
55
|
+
* Fired after a system variable is changed directly through the SETVAR command or
|
|
56
|
+
* by entering the variable name at the command line.
|
|
57
|
+
*/
|
|
58
|
+
sysVarChanged: AcCmEventManager<AcDbSysVarEventArgs>;
|
|
59
|
+
};
|
|
39
60
|
/**
|
|
40
61
|
* Creates a new editor instance for the specified view.
|
|
41
62
|
*
|
|
42
63
|
* @param view - The view that this editor will handle input for
|
|
43
64
|
*/
|
|
44
65
|
constructor(view: AcEdBaseView);
|
|
66
|
+
/**
|
|
67
|
+
* The flag to indicate whether it is currently in an “input acquisition” mode (e.g., point
|
|
68
|
+
* selection, distance/angle prompt, string prompt, etc.),
|
|
69
|
+
*/
|
|
70
|
+
get isActive(): boolean;
|
|
45
71
|
/**
|
|
46
72
|
* Gets the currently active cursor type.
|
|
47
73
|
*
|
|
@@ -70,21 +96,42 @@ export declare class AcEditor {
|
|
|
70
96
|
*/
|
|
71
97
|
setCursor(cursorType: AcEdCorsorType): void;
|
|
72
98
|
/**
|
|
73
|
-
* Prompts the user to input a point by clicking on the view
|
|
99
|
+
* Prompts the user to input a point by clicking on the view or inputting
|
|
100
|
+
* one coordinate value.
|
|
74
101
|
*
|
|
75
|
-
* This method returns a promise that resolves
|
|
76
|
-
* on the view
|
|
102
|
+
* This method returns a promise that resolves after the user clicks
|
|
103
|
+
* on the view or inputs one valid coordinate value, providing the
|
|
104
|
+
* world coordinates of the click point.
|
|
77
105
|
*
|
|
78
106
|
* @returns Promise that resolves to the input point coordinates
|
|
107
|
+
*/
|
|
108
|
+
getPoint(options: AcEdPromptPointOptions): Promise<import("@mlightcad/data-model").AcGeVector3dLike>;
|
|
109
|
+
/**
|
|
110
|
+
* Prompts the user to input an angle by clicking on the view or input
|
|
111
|
+
* one number.
|
|
79
112
|
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
|
|
85
|
-
|
|
113
|
+
* This method returns a promise that resolves after the user clicks
|
|
114
|
+
* on the view or inputs one valid angle value.
|
|
115
|
+
*
|
|
116
|
+
* @returns Promise that resolves to the input angle value.
|
|
117
|
+
*/
|
|
118
|
+
getAngle(options: AcEdPromptAngleOptions): Promise<number>;
|
|
119
|
+
/**
|
|
120
|
+
* Prompts the user to input a distance by clicking on the view or input
|
|
121
|
+
* one number.
|
|
122
|
+
*
|
|
123
|
+
* This method returns a promise that resolves after the user clicks
|
|
124
|
+
* on the view or inputs one valid distance value.
|
|
125
|
+
*
|
|
126
|
+
* @returns Promise that resolves to the input distance value.
|
|
127
|
+
*/
|
|
128
|
+
getDistance(options: AcEdPromptDistanceOptions): Promise<number>;
|
|
129
|
+
/**
|
|
130
|
+
* Prompts the user to input a string.
|
|
131
|
+
*
|
|
132
|
+
* @returns Promise that resolves to the input one string.
|
|
86
133
|
*/
|
|
87
|
-
|
|
134
|
+
getString(options: AcEdPromptStringOptions): Promise<string>;
|
|
88
135
|
/**
|
|
89
136
|
* Prompts the user to select entities using box selection.
|
|
90
137
|
*
|
|
@@ -106,6 +153,6 @@ export declare class AcEditor {
|
|
|
106
153
|
* }
|
|
107
154
|
* ```
|
|
108
155
|
*/
|
|
109
|
-
getSelection(): Promise<import("@mlightcad/
|
|
156
|
+
getSelection(): Promise<import("@mlightcad/data-model").AcGeBox2d>;
|
|
110
157
|
}
|
|
111
158
|
//# sourceMappingURL=AcEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"AcEditor.d.ts","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAExD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAA;AACvE,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,UAAU,CAAA;AAGjB;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,IAAI,EAAE,MAAM,CAAA;CACb;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,QAAQ;IACnB,iDAAiD;IACjD,OAAO,CAAC,eAAe,CAAC,CAAgB;IACxC,mCAAmC;IACnC,OAAO,CAAC,cAAc,CAAC,CAAgB;IACvC,iDAAiD;IACjD,OAAO,CAAC,cAAc,CAAmB;IACzC,2CAA2C;IAC3C,OAAO,CAAC,aAAa,CAAkB;IACvC,8CAA8C;IAC9C,SAAS,CAAC,KAAK,EAAE,YAAY,CAAA;IAE7B;;OAEG;IACH,SAAgB,MAAM;QACpB;;;WAGG;;MAEJ;IAED;;;;OAIG;gBACS,IAAI,EAAE,YAAY;IAM9B;;;OAGG;IACH,IAAI,QAAQ,YAEX;IAED;;;;OAIG;IACH,IAAI,aAAa,+BAEhB;IAED;;;;;OAKG;IACH,aAAa;IAMb;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,UAAU,EAAE,cAAc;IAMpC;;;;;;;;;OASG;IACG,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAI9C;;;;;;;;OAQG;IACG,QAAQ,CAAC,OAAO,EAAE,sBAAsB;IAI9C;;;;;;;;OAQG;IACG,WAAW,CAAC,OAAO,EAAE,yBAAyB;IAIpD;;;;OAIG;IACG,SAAS,CAAC,OAAO,EAAE,uBAAuB;IAIhD;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,YAAY;CAGnB"}
|
|
@@ -34,9 +34,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
34
34
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
import {
|
|
37
|
+
import { AcCmEventManager } from '@mlightcad/data-model';
|
|
38
38
|
import { AcEdCursorManager } from './AcEdCursorManager';
|
|
39
|
-
import {
|
|
39
|
+
import { AcEdInputManager } from './ui';
|
|
40
40
|
/**
|
|
41
41
|
* Advanced input handler for CAD operations providing high-level user interaction methods.
|
|
42
42
|
*
|
|
@@ -71,9 +71,31 @@ var AcEditor = /** @class */ (function () {
|
|
|
71
71
|
* @param view - The view that this editor will handle input for
|
|
72
72
|
*/
|
|
73
73
|
function AcEditor(view) {
|
|
74
|
+
/**
|
|
75
|
+
* Editor events
|
|
76
|
+
*/
|
|
77
|
+
this.events = {
|
|
78
|
+
/**
|
|
79
|
+
* Fired after a system variable is changed directly through the SETVAR command or
|
|
80
|
+
* by entering the variable name at the command line.
|
|
81
|
+
*/
|
|
82
|
+
sysVarChanged: new AcCmEventManager()
|
|
83
|
+
};
|
|
74
84
|
this._view = view;
|
|
75
|
-
this._cursorManager = new AcEdCursorManager();
|
|
85
|
+
this._cursorManager = new AcEdCursorManager(view);
|
|
86
|
+
this._inputManager = new AcEdInputManager(view);
|
|
76
87
|
}
|
|
88
|
+
Object.defineProperty(AcEditor.prototype, "isActive", {
|
|
89
|
+
/**
|
|
90
|
+
* The flag to indicate whether it is currently in an “input acquisition” mode (e.g., point
|
|
91
|
+
* selection, distance/angle prompt, string prompt, etc.),
|
|
92
|
+
*/
|
|
93
|
+
get: function () {
|
|
94
|
+
return this._inputManager.isActive;
|
|
95
|
+
},
|
|
96
|
+
enumerable: false,
|
|
97
|
+
configurable: true
|
|
98
|
+
});
|
|
77
99
|
Object.defineProperty(AcEditor.prototype, "currentCursor", {
|
|
78
100
|
/**
|
|
79
101
|
* Gets the currently active cursor type.
|
|
@@ -111,33 +133,78 @@ var AcEditor = /** @class */ (function () {
|
|
|
111
133
|
* ```
|
|
112
134
|
*/
|
|
113
135
|
AcEditor.prototype.setCursor = function (cursorType) {
|
|
114
|
-
this._cursorManager.setCursor(cursorType
|
|
136
|
+
this._cursorManager.setCursor(cursorType);
|
|
115
137
|
this._previousCursor = this._currentCursor;
|
|
116
138
|
this._currentCursor = cursorType;
|
|
117
139
|
};
|
|
118
140
|
/**
|
|
119
|
-
* Prompts the user to input a point by clicking on the view
|
|
141
|
+
* Prompts the user to input a point by clicking on the view or inputting
|
|
142
|
+
* one coordinate value.
|
|
120
143
|
*
|
|
121
|
-
* This method returns a promise that resolves
|
|
122
|
-
* on the view
|
|
144
|
+
* This method returns a promise that resolves after the user clicks
|
|
145
|
+
* on the view or inputs one valid coordinate value, providing the
|
|
146
|
+
* world coordinates of the click point.
|
|
123
147
|
*
|
|
124
148
|
* @returns Promise that resolves to the input point coordinates
|
|
149
|
+
*/
|
|
150
|
+
AcEditor.prototype.getPoint = function (options) {
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
return __generator(this, function (_a) {
|
|
153
|
+
switch (_a.label) {
|
|
154
|
+
case 0: return [4 /*yield*/, this._inputManager.getPoint(options)];
|
|
155
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
/**
|
|
161
|
+
* Prompts the user to input an angle by clicking on the view or input
|
|
162
|
+
* one number.
|
|
125
163
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
|
|
131
|
-
|
|
164
|
+
* This method returns a promise that resolves after the user clicks
|
|
165
|
+
* on the view or inputs one valid angle value.
|
|
166
|
+
*
|
|
167
|
+
* @returns Promise that resolves to the input angle value.
|
|
168
|
+
*/
|
|
169
|
+
AcEditor.prototype.getAngle = function (options) {
|
|
170
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
171
|
+
return __generator(this, function (_a) {
|
|
172
|
+
switch (_a.label) {
|
|
173
|
+
case 0: return [4 /*yield*/, this._inputManager.getAngle(options)];
|
|
174
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Prompts the user to input a distance by clicking on the view or input
|
|
181
|
+
* one number.
|
|
182
|
+
*
|
|
183
|
+
* This method returns a promise that resolves after the user clicks
|
|
184
|
+
* on the view or inputs one valid distance value.
|
|
185
|
+
*
|
|
186
|
+
* @returns Promise that resolves to the input distance value.
|
|
187
|
+
*/
|
|
188
|
+
AcEditor.prototype.getDistance = function (options) {
|
|
189
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
+
return __generator(this, function (_a) {
|
|
191
|
+
switch (_a.label) {
|
|
192
|
+
case 0: return [4 /*yield*/, this._inputManager.getDistance(options)];
|
|
193
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Prompts the user to input a string.
|
|
200
|
+
*
|
|
201
|
+
* @returns Promise that resolves to the input one string.
|
|
132
202
|
*/
|
|
133
|
-
AcEditor.prototype.
|
|
203
|
+
AcEditor.prototype.getString = function (options) {
|
|
134
204
|
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
-
var inputter;
|
|
136
205
|
return __generator(this, function (_a) {
|
|
137
206
|
switch (_a.label) {
|
|
138
|
-
case 0:
|
|
139
|
-
inputter = new AcEdInputPoint(this._view);
|
|
140
|
-
return [4 /*yield*/, inputter.start()];
|
|
207
|
+
case 0: return [4 /*yield*/, this._inputManager.getString(options)];
|
|
141
208
|
case 1: return [2 /*return*/, _a.sent()];
|
|
142
209
|
}
|
|
143
210
|
});
|
|
@@ -166,12 +233,9 @@ var AcEditor = /** @class */ (function () {
|
|
|
166
233
|
*/
|
|
167
234
|
AcEditor.prototype.getSelection = function () {
|
|
168
235
|
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
-
var selector;
|
|
170
236
|
return __generator(this, function (_a) {
|
|
171
237
|
switch (_a.label) {
|
|
172
|
-
case 0:
|
|
173
|
-
selector = new AcEdBoxSelector(this._view);
|
|
174
|
-
return [4 /*yield*/, selector.start()];
|
|
238
|
+
case 0: return [4 /*yield*/, this._inputManager.getBox()];
|
|
175
239
|
case 1: return [2 /*return*/, _a.sent()];
|
|
176
240
|
}
|
|
177
241
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEditor.js","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AcEditor.js","sourceRoot":"","sources":["../../../src/editor/input/AcEditor.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAGxD,OAAO,EAAkB,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAOvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAUvC;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAuBE;;;;OAIG;IACH,kBAAY,IAAkB;QAhB9B;;WAEG;QACa,WAAM,GAAG;YACvB;;;eAGG;YACH,aAAa,EAAE,IAAI,gBAAgB,EAAuB;SAC3D,CAAA;QAQC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,cAAc,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAA;QACjD,IAAI,CAAC,aAAa,GAAG,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAA;IACjD,CAAC;IAMD,sBAAI,8BAAQ;QAJZ;;;WAGG;aACH;YACE,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAA;QACpC,CAAC;;;OAAA;IAOD,sBAAI,mCAAa;QALjB;;;;WAIG;aACH;YACE,OAAO,IAAI,CAAC,cAAc,CAAA;QAC5B,CAAC;;;OAAA;IAED;;;;;OAKG;IACH,gCAAa,GAAb;QACE,IAAI,IAAI,CAAC,eAAe,IAAI,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QACtC,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,4BAAS,GAAT,UAAU,UAA0B;QAClC,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;QACzC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,cAAc,CAAA;QAC1C,IAAI,CAAC,cAAc,GAAG,UAAU,CAAA;IAClC,CAAC;IAED;;;;;;;;;OASG;IACG,2BAAQ,GAAd,UAAe,OAA+B;;;;4BACrC,qBAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;4BAAjD,sBAAO,SAA0C,EAAA;;;;KAClD;IAED;;;;;;;;OAQG;IACG,2BAAQ,GAAd,UAAe,OAA+B;;;;4BACrC,qBAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAA;4BAAjD,sBAAO,SAA0C,EAAA;;;;KAClD;IAED;;;;;;;;OAQG;IACG,8BAAW,GAAjB,UAAkB,OAAkC;;;;4BAC3C,qBAAM,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,OAAO,CAAC,EAAA;4BAApD,sBAAO,SAA6C,EAAA;;;;KACrD;IAED;;;;OAIG;IACG,4BAAS,GAAf,UAAgB,OAAgC;;;;4BACvC,qBAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,OAAO,CAAC,EAAA;4BAAlD,sBAAO,SAA2C,EAAA;;;;KACnD;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,+BAAY,GAAlB;;;;4BACS,qBAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,EAAA;4BAAxC,sBAAO,SAAiC,EAAA;;;;KACzC;IACH,eAAC;AAAD,CAAC,AA3JD,IA2JC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AcEdPromptAngleOptions } from '../prompt/AcEdPromptAngleOptions';
|
|
2
|
+
import { AcEdInputHandler } from './AcEdInputHandler';
|
|
3
|
+
/**
|
|
4
|
+
* Validates angular numeric input.
|
|
5
|
+
* Uses degrees. Fully compatible with PromptAngleOptions behavior in AutoCAD.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcEdAngleHandler implements AcEdInputHandler<number> {
|
|
8
|
+
private options;
|
|
9
|
+
constructor(options: AcEdPromptAngleOptions);
|
|
10
|
+
parse(value: string): number | null;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AcEdAngleHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdAngleHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdAngleHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,qBAAa,gBAAiB,YAAW,gBAAgB,CAAC,MAAM,CAAC;IAC/D,OAAO,CAAC,OAAO,CAAwB;gBAE3B,OAAO,EAAE,sBAAsB;IAI3C,KAAK,CAAC,KAAK,EAAE,MAAM;CAiBpB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates angular numeric input.
|
|
3
|
+
* Uses degrees. Fully compatible with PromptAngleOptions behavior in AutoCAD.
|
|
4
|
+
*/
|
|
5
|
+
var AcEdAngleHandler = /** @class */ (function () {
|
|
6
|
+
function AcEdAngleHandler(options) {
|
|
7
|
+
this.options = options;
|
|
8
|
+
}
|
|
9
|
+
AcEdAngleHandler.prototype.parse = function (value) {
|
|
10
|
+
var n = Number(value);
|
|
11
|
+
if (isNaN(n)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
if (!this.options.allowNegative && n < 0) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
if (!this.options.allowZero && n === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return n;
|
|
21
|
+
};
|
|
22
|
+
return AcEdAngleHandler;
|
|
23
|
+
}());
|
|
24
|
+
export { AcEdAngleHandler };
|
|
25
|
+
//# sourceMappingURL=AcEdAngleHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdAngleHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdAngleHandler.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH;IAGE,0BAAY,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,gCAAK,GAAL,UAAM,KAAa;QACjB,IAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CAAC,CAAA;IACV,CAAC;IACH,uBAAC;AAAD,CAAC,AAxBD,IAwBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AcEdNumericalHandler } from './AcEdNumericalHandler';
|
|
2
|
+
/**
|
|
3
|
+
* Validates distance input.
|
|
4
|
+
* Distances must be numeric and normally non-negative (AutoCAD behavior).
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcEdDistanceHandler extends AcEdNumericalHandler {
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=AcEdDistanceHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdDistanceHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdDistanceHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,oBAAoB;CAAG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcEdNumericalHandler } from './AcEdNumericalHandler';
|
|
17
|
+
/**
|
|
18
|
+
* Validates distance input.
|
|
19
|
+
* Distances must be numeric and normally non-negative (AutoCAD behavior).
|
|
20
|
+
*/
|
|
21
|
+
var AcEdDistanceHandler = /** @class */ (function (_super) {
|
|
22
|
+
__extends(AcEdDistanceHandler, _super);
|
|
23
|
+
function AcEdDistanceHandler() {
|
|
24
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
+
}
|
|
26
|
+
return AcEdDistanceHandler;
|
|
27
|
+
}(AcEdNumericalHandler));
|
|
28
|
+
export { AcEdDistanceHandler };
|
|
29
|
+
//# sourceMappingURL=AcEdDistanceHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdDistanceHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdDistanceHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;;GAGG;AACH;IAAyC,uCAAoB;IAA7D;;IAA+D,CAAC;IAAD,0BAAC;AAAD,CAAC,AAAhE,CAAyC,oBAAoB,GAAG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AcEdNumericalHandler } from './AcEdNumericalHandler';
|
|
2
|
+
/**
|
|
3
|
+
* Handles validation and parsing of double-precision floating-point input.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AcEdDoubleHandler extends AcEdNumericalHandler {
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=AcEdDoubleHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdDoubleHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdDoubleHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,oBAAoB;CAAG"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcEdNumericalHandler } from './AcEdNumericalHandler';
|
|
17
|
+
/**
|
|
18
|
+
* Handles validation and parsing of double-precision floating-point input.
|
|
19
|
+
*/
|
|
20
|
+
var AcEdDoubleHandler = /** @class */ (function (_super) {
|
|
21
|
+
__extends(AcEdDoubleHandler, _super);
|
|
22
|
+
function AcEdDoubleHandler() {
|
|
23
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
24
|
+
}
|
|
25
|
+
return AcEdDoubleHandler;
|
|
26
|
+
}(AcEdNumericalHandler));
|
|
27
|
+
export { AcEdDoubleHandler };
|
|
28
|
+
//# sourceMappingURL=AcEdDoubleHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdDoubleHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdDoubleHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH;IAAuC,qCAAoB;IAA3D;;IAA6D,CAAC;IAAD,wBAAC;AAAD,CAAC,AAA9D,CAAuC,oBAAoB,GAAG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base class for all input handlers.
|
|
3
|
+
* @template T The final parsed value type (number, string, point, etc.).
|
|
4
|
+
*/
|
|
5
|
+
export interface AcEdInputHandler<T> {
|
|
6
|
+
/**
|
|
7
|
+
* Parses `value` using rules implemented in subclasses.
|
|
8
|
+
* @param x - Texts in the first input box
|
|
9
|
+
* @param y - Texts in the second input box
|
|
10
|
+
* @returns parsed value if valid, otherwise null.
|
|
11
|
+
*/
|
|
12
|
+
parse(x: string, y?: string): T | null;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=AcEdInputHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdInputHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdInputHandler.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC;;;;;OAKG;IACH,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,GAAG,IAAI,CAAA;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdInputHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdInputHandler.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AcEdPromptIntegerOptions } from '../prompt/AcEdPromptIntegerOptions';
|
|
2
|
+
import { AcEdNumericalHandler } from './AcEdNumericalHandler';
|
|
3
|
+
/**
|
|
4
|
+
* Handles validation and parsing of integer user input.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcEdIntegerHandler extends AcEdNumericalHandler {
|
|
7
|
+
protected options: AcEdPromptIntegerOptions;
|
|
8
|
+
constructor(options: AcEdPromptIntegerOptions);
|
|
9
|
+
parse(value: string): number | null;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=AcEdIntegerHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdIntegerHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdIntegerHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAA;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,oBAAoB;IAC1D,UAAkB,OAAO,EAAE,wBAAwB,CAAA;gBAEvC,OAAO,EAAE,wBAAwB;IAI7C,KAAK,CAAC,KAAK,EAAE,MAAM;CAoBpB"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcEdNumericalHandler } from './AcEdNumericalHandler';
|
|
17
|
+
/**
|
|
18
|
+
* Handles validation and parsing of integer user input.
|
|
19
|
+
*/
|
|
20
|
+
var AcEdIntegerHandler = /** @class */ (function (_super) {
|
|
21
|
+
__extends(AcEdIntegerHandler, _super);
|
|
22
|
+
function AcEdIntegerHandler(options) {
|
|
23
|
+
return _super.call(this, options) || this;
|
|
24
|
+
}
|
|
25
|
+
AcEdIntegerHandler.prototype.parse = function (value) {
|
|
26
|
+
var n = _super.prototype.parse.call(this, value);
|
|
27
|
+
if (n == null) {
|
|
28
|
+
return n;
|
|
29
|
+
}
|
|
30
|
+
if (!Number.isInteger(n)) {
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
if (this.options.lowerLimit !== undefined && n < this.options.lowerLimit) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
if (this.options.upperLimit !== undefined && n > this.options.upperLimit) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return n;
|
|
40
|
+
};
|
|
41
|
+
return AcEdIntegerHandler;
|
|
42
|
+
}(AcEdNumericalHandler));
|
|
43
|
+
export { AcEdIntegerHandler };
|
|
44
|
+
//# sourceMappingURL=AcEdIntegerHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdIntegerHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdIntegerHandler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH;IAAwC,sCAAoB;IAG1D,4BAAY,OAAiC;QAC3C,OAAA,MAAK,YAAC,OAAO,CAAC,SAAA;IAChB,CAAC;IAED,kCAAK,GAAL,UAAM,KAAa;QACjB,IAAM,CAAC,GAAG,gBAAK,CAAC,KAAK,YAAC,KAAK,CAAC,CAAA;QAC5B,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;YACd,OAAO,CAAC,CAAA;QACV,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;YACzB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACzE,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;YACzE,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CAAC,CAAA;IACV,CAAC;IACH,yBAAC;AAAD,CAAC,AA3BD,CAAwC,oBAAoB,GA2B3D"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AcEdPromptNumericalOptions } from '../prompt/AcEdPromptNumericalOptions';
|
|
2
|
+
import { AcEdInputHandler } from './AcEdInputHandler';
|
|
3
|
+
/**
|
|
4
|
+
* Handles validation and parsing of numerical user input.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AcEdNumericalHandler implements AcEdInputHandler<number> {
|
|
7
|
+
protected options: AcEdPromptNumericalOptions;
|
|
8
|
+
constructor(options: AcEdPromptNumericalOptions);
|
|
9
|
+
parse(value: string): number | null;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=AcEdNumericalHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdNumericalHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdNumericalHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAA;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;GAEG;AACH,qBAAa,oBAAqB,YAAW,gBAAgB,CAAC,MAAM,CAAC;IACnE,SAAS,CAAC,OAAO,EAAE,0BAA0B,CAAA;gBAEjC,OAAO,EAAE,0BAA0B;IAI/C,KAAK,CAAC,KAAK,EAAE,MAAM;CAiBpB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles validation and parsing of numerical user input.
|
|
3
|
+
*/
|
|
4
|
+
var AcEdNumericalHandler = /** @class */ (function () {
|
|
5
|
+
function AcEdNumericalHandler(options) {
|
|
6
|
+
this.options = options;
|
|
7
|
+
}
|
|
8
|
+
AcEdNumericalHandler.prototype.parse = function (value) {
|
|
9
|
+
var n = Number(value);
|
|
10
|
+
if (isNaN(n)) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
if (!this.options.allowNegative && n < 0) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
if (!this.options.allowZero && n === 0) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
return n;
|
|
20
|
+
};
|
|
21
|
+
return AcEdNumericalHandler;
|
|
22
|
+
}());
|
|
23
|
+
export { AcEdNumericalHandler };
|
|
24
|
+
//# sourceMappingURL=AcEdNumericalHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdNumericalHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdNumericalHandler.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAGE,8BAAY,OAAmC;QAC7C,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,oCAAK,GAAL,UAAM,KAAa;QACjB,IAAM,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;QAEvB,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;YACb,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACzC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YACvC,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,CAAC,CAAA;IACV,CAAC;IACH,2BAAC;AAAD,CAAC,AAxBD,IAwBC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AcGePoint3dLike } from '@mlightcad/data-model';
|
|
2
|
+
import { AcEdPromptPointOptions } from '../prompt/AcEdPromptPointOptions';
|
|
3
|
+
import { AcEdInputHandler } from './AcEdInputHandler';
|
|
4
|
+
/**
|
|
5
|
+
* Handles validation and parsing of point user input.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcEdPointHandler implements AcEdInputHandler<AcGePoint3dLike> {
|
|
8
|
+
protected options: AcEdPromptPointOptions;
|
|
9
|
+
constructor(options: AcEdPromptPointOptions);
|
|
10
|
+
parse(x: string, y?: string): {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
z: number;
|
|
14
|
+
} | null;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=AcEdPointHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdPointHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdPointHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;GAEG;AACH,qBAAa,gBAAiB,YAAW,gBAAgB,CAAC,eAAe,CAAC;IACxE,SAAS,CAAC,OAAO,EAAE,sBAAsB,CAAA;gBAE7B,OAAO,EAAE,sBAAsB;IAI3C,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM;;;;;CAU5B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handles validation and parsing of point user input.
|
|
3
|
+
*/
|
|
4
|
+
var AcEdPointHandler = /** @class */ (function () {
|
|
5
|
+
function AcEdPointHandler(options) {
|
|
6
|
+
this.options = options;
|
|
7
|
+
}
|
|
8
|
+
AcEdPointHandler.prototype.parse = function (x, y) {
|
|
9
|
+
var nx = Number(x);
|
|
10
|
+
var ny = Number(y);
|
|
11
|
+
if (isNaN(nx) || isNaN(ny)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return { x: nx, y: ny, z: 0 };
|
|
15
|
+
};
|
|
16
|
+
return AcEdPointHandler;
|
|
17
|
+
}());
|
|
18
|
+
export { AcEdPointHandler };
|
|
19
|
+
//# sourceMappingURL=AcEdPointHandler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdPointHandler.js","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdPointHandler.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH;IAGE,0BAAY,OAA+B;QACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,gCAAK,GAAL,UAAM,CAAS,EAAE,CAAU;QACzB,IAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QACpB,IAAM,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,CAAA;QAEpB,IAAI,KAAK,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAA;QACb,CAAC;QAED,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAA;IAC/B,CAAC;IACH,uBAAC;AAAD,CAAC,AAjBD,IAiBC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AcEdPromptStringOptions } from '../prompt/AcEdPromptStringOptions';
|
|
2
|
+
import { AcEdInputHandler } from './AcEdInputHandler';
|
|
3
|
+
/**
|
|
4
|
+
* Validates string input according to {@link AcEdPromptStringOptions}.
|
|
5
|
+
* Supports empty string rules, keyword checking, and maximum length.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcEdStringHandler implements AcEdInputHandler<string> {
|
|
8
|
+
private options;
|
|
9
|
+
constructor(options: AcEdPromptStringOptions);
|
|
10
|
+
parse(value: string): string | null;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=AcEdStringHandler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdStringHandler.d.ts","sourceRoot":"","sources":["../../../../src/editor/input/handler/AcEdStringHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAA;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAErD;;;GAGG;AACH,qBAAa,iBAAkB,YAAW,gBAAgB,CAAC,MAAM,CAAC;IAChE,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,EAAE,uBAAuB;IAI5C,KAAK,CAAC,KAAK,EAAE,MAAM;CAepB"}
|