@mlightcad/cad-simple-viewer 1.5.5 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +3 -0
- package/dist/{index.js → cad-simple-viewer.js} +16583 -14248
- package/dist/cad-simple-viewer.umd.cjs +921 -0
- package/dist/dxf-parser-worker.js +2002 -0
- package/dist/libredwg-parser-worker.js +5388 -5122
- package/dist/mtext-renderer-worker.js +3061 -2858
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +3 -0
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +7 -0
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +84 -10
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcDbOpenDatabaseOptions.d.ts +29 -0
- package/lib/app/AcDbOpenDatabaseOptions.d.ts.map +1 -1
- package/lib/app/AcDbOpenDatabaseOptions.js +10 -1
- package/lib/app/AcDbOpenDatabaseOptions.js.map +1 -1
- package/lib/app/index.d.ts +1 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +1 -0
- package/lib/app/index.js.map +1 -1
- package/lib/command/AcApCacheFontCmd.d.ts +25 -0
- package/lib/command/AcApCacheFontCmd.d.ts.map +1 -0
- package/lib/command/AcApCacheFontCmd.js +142 -0
- package/lib/command/AcApCacheFontCmd.js.map +1 -0
- package/lib/command/AcApSysVarCmd.d.ts.map +1 -1
- package/lib/command/AcApSysVarCmd.js +5 -11
- package/lib/command/AcApSysVarCmd.js.map +1 -1
- package/lib/command/convert/AcApPngConvertor.d.ts +1 -1
- package/lib/command/convert/AcApPngConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApPngConvertor.js +5 -2
- package/lib/command/convert/AcApPngConvertor.js.map +1 -1
- package/lib/command/draw/AcApArcCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApArcCmd.js +2 -5
- package/lib/command/draw/AcApArcCmd.js.map +1 -1
- package/lib/command/draw/AcApEllipseCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApEllipseCmd.js +2 -5
- package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
- package/lib/command/draw/AcApHatchCmd.d.ts +1 -1
- package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApMLineCmd.js +2 -2
- package/lib/command/draw/AcApMLineCmd.js.map +1 -1
- package/lib/command/draw/AcApPolygonCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApPolygonCmd.js +2 -5
- package/lib/command/draw/AcApPolygonCmd.js.map +1 -1
- package/lib/command/draw/AcApRectCmd.d.ts +6 -0
- package/lib/command/draw/AcApRectCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApRectCmd.js +12 -10
- package/lib/command/draw/AcApRectCmd.js.map +1 -1
- package/lib/command/draw/AcApXLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApXLineCmd.js +1 -1
- package/lib/command/draw/AcApXLineCmd.js.map +1 -1
- package/lib/command/index.d.ts +1 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +1 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/layer/AcApLayerCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCmd.js +13 -23
- package/lib/command/layer/AcApLayerCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.js +3 -13
- package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.js +8 -18
- package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.js +11 -21
- package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.js +7 -17
- package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.js +4 -14
- package/lib/command/layer/AcApLayerLockCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerOffCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOffCmd.js +11 -21
- package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.js +2 -13
- package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.js +2 -13
- package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.js +2 -13
- package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.js +4 -15
- package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts +0 -7
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.js +4 -14
- package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -1
- package/lib/command/modify/AcApHideObjectsCmd.js +1 -1
- package/lib/command/modify/AcApHideObjectsCmd.js.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.js +9 -4
- package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
- package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApRotateCmd.js +2 -5
- package/lib/command/modify/AcApRotateCmd.js.map +1 -1
- package/lib/command/modify/AcApUnisolateObjectsCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApUnisolateObjectsCmd.js +3 -3
- package/lib/command/modify/AcApUnisolateObjectsCmd.js.map +1 -1
- package/lib/editor/command/AcEdCommand.d.ts +16 -0
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +23 -0
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/global/AcEdUiColor.d.ts +13 -13
- package/lib/editor/global/AcEdUiColor.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiColor.js +21 -20
- package/lib/editor/global/AcEdUiColor.js.map +1 -1
- package/lib/editor/global/eventBus.d.ts +7 -1
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/grip/AcEdGripEditSession.d.ts +29 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripEditSession.js +76 -0
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -0
- package/lib/editor/grip/AcEdGripHandle.d.ts +20 -0
- package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripHandle.js +59 -0
- package/lib/editor/grip/AcEdGripHandle.js.map +1 -0
- package/lib/editor/grip/AcEdGripManager.d.ts +159 -0
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripManager.js +336 -0
- package/lib/editor/grip/AcEdGripManager.js.map +1 -0
- package/lib/editor/grip/AcEdGripPolicy.d.ts +6 -0
- package/lib/editor/grip/AcEdGripPolicy.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripPolicy.js +30 -0
- package/lib/editor/grip/AcEdGripPolicy.js.map +1 -0
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts +21 -0
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripPreviewJig.js +73 -0
- package/lib/editor/grip/AcEdGripPreviewJig.js.map +1 -0
- package/lib/editor/grip/index.d.ts +5 -0
- package/lib/editor/grip/index.d.ts.map +1 -0
- package/lib/editor/grip/index.js +5 -0
- package/lib/editor/grip/index.js.map +1 -0
- package/lib/editor/index.d.ts +1 -0
- package/lib/editor/index.d.ts.map +1 -1
- package/lib/editor/index.js +1 -0
- package/lib/editor/index.js.map +1 -1
- package/lib/editor/input/AcEdCursorManager.d.ts.map +1 -1
- package/lib/editor/input/AcEdCursorManager.js +2 -2
- package/lib/editor/input/AcEdCursorManager.js.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts +34 -0
- package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -0
- package/lib/editor/input/AcEdOsnapResolver.js +117 -0
- package/lib/editor/input/AcEdOsnapResolver.js.map +1 -0
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts +2 -1
- package/lib/editor/input/handler/AcEdAngleHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdAngleHandler.js +6 -0
- package/lib/editor/input/handler/AcEdAngleHandler.js.map +1 -1
- package/lib/editor/input/handler/AcEdInputHandler.d.ts +20 -1
- package/lib/editor/input/handler/AcEdInputHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdKeywordHandler.d.ts +2 -1
- package/lib/editor/input/handler/AcEdKeywordHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdKeywordHandler.js +3 -0
- package/lib/editor/input/handler/AcEdKeywordHandler.js.map +1 -1
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts +2 -1
- package/lib/editor/input/handler/AcEdNumericalHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdNumericalHandler.js +6 -0
- package/lib/editor/input/handler/AcEdNumericalHandler.js.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +17 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.js +89 -0
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
- package/lib/editor/input/handler/AcEdStringHandler.d.ts +2 -1
- package/lib/editor/input/handler/AcEdStringHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdStringHandler.js +3 -0
- package/lib/editor/input/handler/AcEdStringHandler.js.map +1 -1
- package/lib/editor/input/index.d.ts +1 -0
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +1 -0
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/session/AcEdInputSession.d.ts +11 -1
- package/lib/editor/input/session/AcEdInputSession.d.ts.map +1 -1
- package/lib/editor/input/session/AcEdInputSession.js.map +1 -1
- package/lib/editor/input/session/AcEdPromptInputSession.d.ts +51 -0
- package/lib/editor/input/session/AcEdPromptInputSession.d.ts.map +1 -0
- package/lib/editor/input/session/AcEdPromptInputSession.js +109 -0
- package/lib/editor/input/session/AcEdPromptInputSession.js.map +1 -0
- package/lib/editor/input/session/index.d.ts +1 -0
- package/lib/editor/input/session/index.d.ts.map +1 -1
- package/lib/editor/input/session/index.js +1 -0
- package/lib/editor/input/session/index.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +10 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +67 -35
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +0 -11
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +9 -119
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts +26 -23
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +135 -83
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdMTextEditor.js +2 -2
- package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +7 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +12 -0
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/i18n/en/command.d.ts +3 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +3 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +26 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +134 -108
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +3 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +4 -1
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +3 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +3 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +26 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +134 -108
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +3 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +4 -1
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/plugin/AcApLazyPluginRegistration.d.ts +3 -8
- package/lib/plugin/AcApLazyPluginRegistration.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +2 -2
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
- package/lib/util/AcApFontUtil.d.ts +14 -2
- package/lib/util/AcApFontUtil.d.ts.map +1 -1
- package/lib/util/AcApFontUtil.js +18 -0
- package/lib/util/AcApFontUtil.js.map +1 -1
- package/lib/view/AcTrEntityDisplayController.d.ts +46 -0
- package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -0
- package/lib/view/AcTrEntityDisplayController.js +114 -0
- package/lib/view/AcTrEntityDisplayController.js.map +1 -0
- package/lib/view/AcTrGroupWcsBboxAssert.d.ts +27 -0
- package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -0
- package/lib/view/AcTrGroupWcsBboxAssert.js +65 -0
- package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -0
- package/lib/view/AcTrLayer.d.ts +7 -0
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +11 -2
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +1 -1
- package/lib/view/AcTrLayout.js +2 -2
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrProgressiveOpenFitController.d.ts +64 -0
- package/lib/view/AcTrProgressiveOpenFitController.d.ts.map +1 -0
- package/lib/view/AcTrProgressiveOpenFitController.js +209 -0
- package/lib/view/AcTrProgressiveOpenFitController.js.map +1 -0
- package/lib/view/AcTrView2d.d.ts +95 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +539 -200
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +13 -11
- package/dist/index.umd.cjs +0 -897
|
@@ -9,30 +9,29 @@
|
|
|
9
9
|
* - **UI colour theme** — `COLORTHEME` only affects viewer chrome, not
|
|
10
10
|
* canvas or ACI-7 rendering.
|
|
11
11
|
*
|
|
12
|
-
* Shared colour constants and luminance helpers
|
|
13
|
-
* `@mlightcad/
|
|
14
|
-
*
|
|
12
|
+
* Shared colour constants and luminance helpers are defined in
|
|
13
|
+
* `@mlightcad/graphic-interface` (`AcGiContext.ts`) and re-exported here
|
|
14
|
+
* for editor callers.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
import { AcCmColor, AcCmColorMethod, AcDbSystemVariables, AcDbSysVarManager } from '@mlightcad/data-model';
|
|
18
|
-
import { contrastingForegroundColor, isLightBackground, MODEL_SPACE_BACKGROUND, PAPER_SPACE_BACKGROUND } from '@mlightcad/three-renderer';
|
|
16
|
+
export { ACGI_DARK_THEME_FOREGROUND, ACGI_LIGHT_THEME_FOREGROUND, ACGI_MODEL_SPACE_BACKGROUND, ACGI_PAPER_SPACE_BACKGROUND, acgiContrastingForegroundColor, acgiForegroundColorForBackground, acgiIsLightBackground } from '@mlightcad/data-model';
|
|
17
|
+
import { AcCmColor, AcCmColorMethod, AcDbSystemVariables, AcDbSysVarManager, ACGI_MODEL_SPACE_BACKGROUND, ACGI_PAPER_SPACE_BACKGROUND, acgiContrastingForegroundColor, acgiIsLightBackground } from '@mlightcad/data-model';
|
|
19
18
|
/**
|
|
20
19
|
* Returns the UI chrome foreground colour that matches `COLORTHEME`.
|
|
21
20
|
*
|
|
22
21
|
* This maps the UI light/dark theme flag to shared constants. It does
|
|
23
22
|
* **not** drive ACI-7 drawing colours — use
|
|
24
|
-
* {@link
|
|
23
|
+
* {@link acgiForegroundColorForBackground} for canvas-linked inversion.
|
|
25
24
|
*
|
|
26
25
|
* @param isLightTheme - `true` when `COLORTHEME` indicates a light UI theme
|
|
27
26
|
* (value `1`); `false` for a dark UI theme (value `0`).
|
|
28
|
-
* @returns Packed RGB: {@link
|
|
29
|
-
* {@link
|
|
27
|
+
* @returns Packed RGB: {@link ACGI_LIGHT_THEME_FOREGROUND} for light UI,
|
|
28
|
+
* {@link ACGI_DARK_THEME_FOREGROUND} for dark UI.
|
|
30
29
|
*
|
|
31
30
|
* @see {@link isLightColorTheme} — normalises raw `COLORTHEME` sysvar values
|
|
32
|
-
* @see {@link
|
|
31
|
+
* @see {@link acgiForegroundColorForBackground} — ACI-7 inversion from layout bg
|
|
33
32
|
*/
|
|
34
33
|
export function foregroundColorFromColorTheme(isLightTheme) {
|
|
35
|
-
return
|
|
34
|
+
return acgiContrastingForegroundColor(isLightTheme);
|
|
36
35
|
}
|
|
37
36
|
/**
|
|
38
37
|
* Normalises a raw `COLORTHEME` system-variable value to a boolean light UI
|
|
@@ -118,8 +117,8 @@ export function layoutBackgroundSysVar(isModelSpace) {
|
|
|
118
117
|
*
|
|
119
118
|
* When the sysvar holds a concrete RGB colour (`color.RGB` is defined), that
|
|
120
119
|
* value is returned directly. Otherwise the AutoCAD defaults are used:
|
|
121
|
-
* {@link
|
|
122
|
-
* {@link
|
|
120
|
+
* {@link ACGI_MODEL_SPACE_BACKGROUND} (`0x000000`) for model space or
|
|
121
|
+
* {@link ACGI_PAPER_SPACE_BACKGROUND} (`0xffffff`) for paper space.
|
|
123
122
|
*
|
|
124
123
|
* @param color - Layout background colour from `MODELBKCOLOR` or
|
|
125
124
|
* `PAPERBKCOLOR`, or `undefined` when the sysvar is unset.
|
|
@@ -134,7 +133,9 @@ export function canvasBackgroundFromColor(color, isModelSpace) {
|
|
|
134
133
|
if (rgb != null) {
|
|
135
134
|
return rgb;
|
|
136
135
|
}
|
|
137
|
-
return isModelSpace
|
|
136
|
+
return isModelSpace
|
|
137
|
+
? ACGI_MODEL_SPACE_BACKGROUND
|
|
138
|
+
: ACGI_PAPER_SPACE_BACKGROUND;
|
|
138
139
|
}
|
|
139
140
|
/**
|
|
140
141
|
* Reads the layout background colour from the database for the given space.
|
|
@@ -166,10 +167,10 @@ export function readLayoutBackgroundColor(database, isModelSpace) {
|
|
|
166
167
|
* Toggles a layout background colour between black and white.
|
|
167
168
|
*
|
|
168
169
|
* Inspects the current colour's perceived luminance via
|
|
169
|
-
* {@link
|
|
170
|
+
* {@link acgiIsLightBackground} and returns a new {@link AcCmColor} set to pure
|
|
170
171
|
* black (`RGB 0, 0, 0`) when the input is light, or pure white
|
|
171
172
|
* (`RGB 255, 255, 255`) when the input is dark. If the source colour has no
|
|
172
|
-
* RGB component, {@link
|
|
173
|
+
* RGB component, {@link ACGI_MODEL_SPACE_BACKGROUND} is used as the luminance
|
|
173
174
|
* reference.
|
|
174
175
|
*
|
|
175
176
|
* Used by {@link AcApSwitchBgCmd} to flip `MODELBKCOLOR` / `PAPERBKCOLOR`
|
|
@@ -189,9 +190,9 @@ export function readLayoutBackgroundColor(database, isModelSpace) {
|
|
|
189
190
|
*/
|
|
190
191
|
export function toggleBlackWhiteBackgroundColor(color) {
|
|
191
192
|
var _a;
|
|
192
|
-
var rgb = (_a = color.RGB) !== null && _a !== void 0 ? _a :
|
|
193
|
+
var rgb = (_a = color.RGB) !== null && _a !== void 0 ? _a : ACGI_MODEL_SPACE_BACKGROUND;
|
|
193
194
|
var next = new AcCmColor(AcCmColorMethod.ByColor);
|
|
194
|
-
if (
|
|
195
|
+
if (acgiIsLightBackground(rgb)) {
|
|
195
196
|
next.setRGB(0, 0, 0);
|
|
196
197
|
}
|
|
197
198
|
else {
|
|
@@ -204,7 +205,7 @@ export function toggleBlackWhiteBackgroundColor(color) {
|
|
|
204
205
|
*
|
|
205
206
|
* Returns `'black'` on light backgrounds and `'white'` on dark backgrounds so
|
|
206
207
|
* the crosshair and other SVG/CSS cursors remain visible. The decision is
|
|
207
|
-
* delegated to {@link
|
|
208
|
+
* delegated to {@link acgiIsLightBackground}.
|
|
208
209
|
*
|
|
209
210
|
* @param backgroundColor - Current renderer clear colour as packed
|
|
210
211
|
* `0xRRGGBB` RGB.
|
|
@@ -219,6 +220,6 @@ export function toggleBlackWhiteBackgroundColor(color) {
|
|
|
219
220
|
* @see {@link AcEdCursorManager.syncCursorBackground}
|
|
220
221
|
*/
|
|
221
222
|
export function cursorColorForBackground(backgroundColor) {
|
|
222
|
-
return
|
|
223
|
+
return acgiIsLightBackground(backgroundColor) ? 'black' : 'white';
|
|
223
224
|
}
|
|
224
225
|
//# sourceMappingURL=AcEdUiColor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcEdUiColor.js","sourceRoot":"","sources":["../../../src/editor/global/AcEdUiColor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,0BAA0B,EAC1B,
|
|
1
|
+
{"version":3,"file":"AcEdUiColor.js","sourceRoot":"","sources":["../../../src/editor/global/AcEdUiColor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC3B,8BAA8B,EAC9B,gCAAgC,EAChC,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAE9B,OAAO,EACL,SAAS,EACT,eAAe,EAEf,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,8BAA8B,EAC9B,qBAAqB,EACtB,MAAM,uBAAuB,CAAA;AAE9B;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,6BAA6B,CAAC,YAAqB;IACjE,OAAO,8BAA8B,CAAC,YAAY,CAAC,CAAA;AACrD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAc;IAC9C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,KAAK,CAAC,CAAA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,KAAK,EAAE,YAAY,CAAC,CAAA;AACvD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,+BAA+B,CAAC,KAAgB;;IAC9D,IAAM,GAAG,GAAG,MAAA,KAAK,CAAC,GAAG,mCAAI,2BAA2B,CAAA;IACpD,IAAM,IAAI,GAAG,IAAI,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,CAAA;IACnD,IAAI,qBAAqB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/B,IAAI,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IACtB,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IAC5B,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,wBAAwB,CACtC,eAAuB;IAEvB,OAAO,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAA;AACnE,CAAC"}
|
|
@@ -14,7 +14,7 @@ export interface AcEdFontNotLoadedInfo {
|
|
|
14
14
|
* type safety for event emission and listening throughout the application.
|
|
15
15
|
*
|
|
16
16
|
* ## Event Categories
|
|
17
|
-
* - **File Operations**: `open-file`, `open-file-progress`, `failed-to-open-file`
|
|
17
|
+
* - **File Operations**: `open-file`, `open-file-progress`, `failed-to-open-file`, `cache-font`, `font-file-selected`
|
|
18
18
|
* - **Palette Control**: `close-layer-manager`
|
|
19
19
|
* - **Font Management**: `fonts-not-loaded`, `failed-to-get-avaiable-fonts`, `font-not-found`
|
|
20
20
|
* - **Missing Resources**: `missed-data-changed`
|
|
@@ -23,6 +23,12 @@ export interface AcEdFontNotLoadedInfo {
|
|
|
23
23
|
export type AcEdEvents = {
|
|
24
24
|
/** Emitted to request opening a file dialog */
|
|
25
25
|
'open-file': {};
|
|
26
|
+
/** Emitted to request opening a font file dialog for IndexedDB caching */
|
|
27
|
+
'cache-font': {};
|
|
28
|
+
/** Emitted when the user selects a font file in the cache-font dialog */
|
|
29
|
+
'font-file-selected': {
|
|
30
|
+
file?: File;
|
|
31
|
+
};
|
|
26
32
|
/** Emitted to request closing the layer properties manager */
|
|
27
33
|
'close-layer-manager': {};
|
|
28
34
|
/** Emitted during file opening to report progress */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventBus.d.ts","sourceRoot":"","sources":["../../../src/editor/global/eventBus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAa,EAAE,KAAK,OAAO,EAAE,MAAM,MAAM,CAAA;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAE7D,MAAM,WAAW,qBAAqB;IACpC,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,yDAAyD;IACzD,GAAG,EAAE,MAAM,CAAA;CACZ;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,+CAA+C;IAC/C,WAAW,EAAE,EAAE,CAAA;IACf,8DAA8D;IAC9D,qBAAqB,EAAE,EAAE,CAAA;IACzB,qDAAqD;IACrD,oBAAoB,EAAE,sBAAsB,CAAA;IAC5C,+CAA+C;IAC/C,OAAO,EAAE;QACP,kCAAkC;QAClC,OAAO,EAAE,MAAM,CAAA;QACf,uCAAuC;QACvC,IAAI,EAAE,eAAe,CAAA;KACtB,CAAA;IACD,kEAAkE;IAClE,iBAAiB,EAAE;QACjB,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,CAAA;IACD,4CAA4C;IAC5C,kBAAkB,EAAE;QAClB,KAAK,EAAE,qBAAqB,EAAE,CAAA;KAC/B,CAAA;IACD,gEAAgE;IAChE,8BAA8B,EAAE;QAC9B,kEAAkE;QAClE,GAAG,EAAE,MAAM,CAAA;K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;KACtB,CAAA;IACD,kEAAkE;IAClE,iBAAiB,EAAE;QACjB,KAAK,EAAE,MAAM,EAAE,CAAA;KAChB,CAAA;IACD,4CAA4C;IAC5C,kBAAkB,EAAE;QAClB,KAAK,EAAE,qBAAqB,EAAE,CAAA;KAC/B,CAAA;IACD,gEAAgE;IAChE,8BAA8B,EAAE;QAC9B,kEAAkE;QAClE,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;IACD,wCAAwC;IACxC,qBAAqB,EAAE;QACrB,gDAAgD;QAChD,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,gDAAgD;IAChD,gBAAgB,EAAE;QAChB,+BAA+B;QAC/B,QAAQ,EAAE,MAAM,CAAA;QAChB,gDAAgD;QAChD,KAAK,EAAE,MAAM,CAAA;KACd,CAAA;IACD,+EAA+E;IAC/E,qBAAqB,EAAE,EAAE,CAAA;CAC1B,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,QAAQ,EAAE,OAAO,CAAC,UAAU,CAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eventBus.js","sourceRoot":"","sources":["../../../src/editor/global/eventBus.ts"],"names":[],"mappings":"AACA,OAAO,IAAsB,MAAM,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"eventBus.js","sourceRoot":"","sources":["../../../src/editor/global/eventBus.ts"],"names":[],"mappings":"AACA,OAAO,IAAsB,MAAM,MAAM,CAAA;AAyEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,CAAC,IAAM,QAAQ,GAAwB,IAAI,EAAc,CAAA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AcDbEntity, AcDbObjectId, AcGePoint3dLike } from '@mlightcad/data-model';
|
|
2
|
+
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
3
|
+
export interface AcEdGripEditTarget {
|
|
4
|
+
entityId: AcDbObjectId;
|
|
5
|
+
gripIndex: number;
|
|
6
|
+
gripBaseWcs: AcGePoint3dLike;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Handles an in-progress grip drag: preview on move, commit or cancel on end.
|
|
10
|
+
*/
|
|
11
|
+
export declare class AcEdGripEditSession {
|
|
12
|
+
private readonly _view;
|
|
13
|
+
private readonly _entity;
|
|
14
|
+
private readonly _target;
|
|
15
|
+
private readonly _jig;
|
|
16
|
+
private readonly _onEnd;
|
|
17
|
+
private readonly _osnapMarkerManager;
|
|
18
|
+
private _boundMouseMove;
|
|
19
|
+
private _boundMouseUp;
|
|
20
|
+
private _boundKeyDown;
|
|
21
|
+
constructor(view: AcEdBaseView, entity: AcDbEntity, target: AcEdGripEditTarget, onEnd: () => void);
|
|
22
|
+
onMouseMove(e: MouseEvent): void;
|
|
23
|
+
private onMouseUp;
|
|
24
|
+
private onKeyDown;
|
|
25
|
+
cancel(): void;
|
|
26
|
+
private finish;
|
|
27
|
+
private resolveWcs;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=AcEdGripEditSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdGripEditSession.d.ts","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripEditSession.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,YAAY,EACZ,eAAe,EAChB,MAAM,uBAAuB,CAAA;AAI9B,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAGnD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,YAAY,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,eAAe,CAAA;CAC7B;AAED;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAY;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAoB;IAC5C,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,mBAAmB,CAAmB;IAEvD,OAAO,CAAC,eAAe,CAAyC;IAChE,OAAO,CAAC,aAAa,CAAuC;IAC5D,OAAO,CAAC,aAAa,CAA0C;gBAG7D,IAAI,EAAE,YAAY,EAClB,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,MAAM,IAAI;IAmBnB,WAAW,CAAC,CAAC,EAAE,UAAU;IAMzB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,SAAS;IAMjB,MAAM;IAIN,OAAO,CAAC,MAAM;IASd,OAAO,CAAC,UAAU;CAwBnB"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { AcEdOsnapResolver } from '../input/AcEdOsnapResolver';
|
|
2
|
+
import { AcEdMarkerManager } from '../input/marker';
|
|
3
|
+
import { AcEdGripPreviewJig } from './AcEdGripPreviewJig';
|
|
4
|
+
/**
|
|
5
|
+
* Handles an in-progress grip drag: preview on move, commit or cancel on end.
|
|
6
|
+
*/
|
|
7
|
+
var AcEdGripEditSession = /** @class */ (function () {
|
|
8
|
+
function AcEdGripEditSession(view, entity, target, onEnd) {
|
|
9
|
+
var _this = this;
|
|
10
|
+
this._boundMouseMove = function (e) { return _this.onMouseMove(e); };
|
|
11
|
+
this._boundMouseUp = function (e) { return _this.onMouseUp(e); };
|
|
12
|
+
this._boundKeyDown = function (e) { return _this.onKeyDown(e); };
|
|
13
|
+
this._view = view;
|
|
14
|
+
this._entity = entity;
|
|
15
|
+
this._target = target;
|
|
16
|
+
this._onEnd = onEnd;
|
|
17
|
+
this._osnapMarkerManager = new AcEdMarkerManager(view);
|
|
18
|
+
this._jig = new AcEdGripPreviewJig(view, entity, target.gripIndex, target.gripBaseWcs);
|
|
19
|
+
document.addEventListener('mousemove', this._boundMouseMove);
|
|
20
|
+
document.addEventListener('mouseup', this._boundMouseUp);
|
|
21
|
+
document.addEventListener('keydown', this._boundKeyDown);
|
|
22
|
+
}
|
|
23
|
+
AcEdGripEditSession.prototype.onMouseMove = function (e) {
|
|
24
|
+
var wcs = this.resolveWcs(e);
|
|
25
|
+
this._jig.update(wcs);
|
|
26
|
+
this._jig.render();
|
|
27
|
+
};
|
|
28
|
+
AcEdGripEditSession.prototype.onMouseUp = function (e) {
|
|
29
|
+
if (e.button !== 0)
|
|
30
|
+
return;
|
|
31
|
+
var wcs = this.resolveWcs(e);
|
|
32
|
+
var offset = this._jig.computeOffset(wcs);
|
|
33
|
+
this._entity.subMoveGripPointsAt([this._target.gripIndex], offset);
|
|
34
|
+
this._entity.triggerModifiedEvent();
|
|
35
|
+
this.finish();
|
|
36
|
+
};
|
|
37
|
+
AcEdGripEditSession.prototype.onKeyDown = function (e) {
|
|
38
|
+
if (e.key !== 'Escape')
|
|
39
|
+
return;
|
|
40
|
+
e.preventDefault();
|
|
41
|
+
this.cancel();
|
|
42
|
+
};
|
|
43
|
+
AcEdGripEditSession.prototype.cancel = function () {
|
|
44
|
+
this.finish();
|
|
45
|
+
};
|
|
46
|
+
AcEdGripEditSession.prototype.finish = function () {
|
|
47
|
+
this._jig.end();
|
|
48
|
+
this._osnapMarkerManager.clear();
|
|
49
|
+
document.removeEventListener('mousemove', this._boundMouseMove);
|
|
50
|
+
document.removeEventListener('mouseup', this._boundMouseUp);
|
|
51
|
+
document.removeEventListener('keydown', this._boundKeyDown);
|
|
52
|
+
this._onEnd();
|
|
53
|
+
};
|
|
54
|
+
AcEdGripEditSession.prototype.resolveWcs = function (e) {
|
|
55
|
+
var _a;
|
|
56
|
+
var canvasPos = this._view.viewportToCanvas({
|
|
57
|
+
x: e.clientX,
|
|
58
|
+
y: e.clientY
|
|
59
|
+
});
|
|
60
|
+
var wcs = this._view.screenToWorld(canvasPos);
|
|
61
|
+
var cursorWcs = { x: wcs.x, y: wcs.y, z: 0 };
|
|
62
|
+
this._osnapMarkerManager.hideMarker();
|
|
63
|
+
var snapPoint = this._view.osnapResolver.resolve({
|
|
64
|
+
cursorWcs: cursorWcs,
|
|
65
|
+
lastPoint: this._target.gripBaseWcs
|
|
66
|
+
});
|
|
67
|
+
if (snapPoint) {
|
|
68
|
+
this._osnapMarkerManager.showMarker(snapPoint, AcEdOsnapResolver.osnapModeToMarkerType(snapPoint.type));
|
|
69
|
+
return { x: snapPoint.x, y: snapPoint.y, z: (_a = snapPoint.z) !== null && _a !== void 0 ? _a : 0 };
|
|
70
|
+
}
|
|
71
|
+
return cursorWcs;
|
|
72
|
+
};
|
|
73
|
+
return AcEdGripEditSession;
|
|
74
|
+
}());
|
|
75
|
+
export { AcEdGripEditSession };
|
|
76
|
+
//# sourceMappingURL=AcEdGripEditSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdGripEditSession.js","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripEditSession.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAEnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAQzD;;GAEG;AACH;IAYE,6BACE,IAAkB,EAClB,MAAkB,EAClB,MAA0B,EAC1B,KAAiB;QAJnB,iBAqBC;QAzBO,oBAAe,GAAG,UAAC,CAAa,IAAK,OAAA,KAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAnB,CAAmB,CAAA;QACxD,kBAAa,GAAG,UAAC,CAAa,IAAK,OAAA,KAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAjB,CAAiB,CAAA;QACpD,kBAAa,GAAG,UAAC,CAAgB,IAAK,OAAA,KAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAjB,CAAiB,CAAA;QAQ7D,IAAI,CAAC,KAAK,GA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SACpC,CAAC,CAAA;QAEF,IAAI,SAAS,EAAE,CAAC;YACd,IAAI,CAAC,mBAAmB,CAAC,UAAU,CACjC,SAAS,EACT,iBAAiB,CAAC,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,CACxD,CAAA;YACD,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,MAAA,SAAS,CAAC,CAAC,mCAAI,CAAC,EAAE,CAAA;QAChE,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IACH,0BAAC;AAAD,CAAC,AA7FD,IA6FC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AcGePoint2dLike } from '@mlightcad/data-model';
|
|
2
|
+
/** Visual state of a grip handle. */
|
|
3
|
+
export type AcEdGripHandleState = 'normal' | 'hover' | 'hot';
|
|
4
|
+
/**
|
|
5
|
+
* Interactive DOM grip square rendered in container-local screen coordinates.
|
|
6
|
+
*/
|
|
7
|
+
export declare class AcEdGripHandle {
|
|
8
|
+
private readonly _host;
|
|
9
|
+
private readonly _size;
|
|
10
|
+
private readonly _el;
|
|
11
|
+
private _state;
|
|
12
|
+
constructor(_host: HTMLElement, _size?: number);
|
|
13
|
+
get element(): HTMLElement;
|
|
14
|
+
get state(): AcEdGripHandleState;
|
|
15
|
+
setState(state: AcEdGripHandleState): void;
|
|
16
|
+
setPosition(pos: AcGePoint2dLike): void;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
private static injectCSS;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=AcEdGripHandle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdGripHandle.d.ts","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripHandle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD,qCAAqC;AACrC,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAA;AAE5D;;GAEG;AACH,qBAAa,cAAc;IAKvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,KAAK;IALxB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAa;IACjC,OAAO,CAAC,MAAM,CAAgC;gBAG3B,KAAK,EAAE,WAAW,EAClB,KAAK,SAAI;IAgB5B,IAAI,OAAO,IAAI,WAAW,CAEzB;IAED,IAAI,KAAK,IAAI,mBAAmB,CAE/B;IAED,QAAQ,CAAC,KAAK,EAAE,mBAAmB;IAMnC,WAAW,CAAC,GAAG,EAAE,eAAe;IAKhC,OAAO;IAIP,OAAO,CAAC,MAAM,CAAC,SAAS;CAgCzB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive DOM grip square rendered in container-local screen coordinates.
|
|
3
|
+
*/
|
|
4
|
+
var AcEdGripHandle = /** @class */ (function () {
|
|
5
|
+
function AcEdGripHandle(_host, _size) {
|
|
6
|
+
if (_size === void 0) { _size = 9; }
|
|
7
|
+
this._host = _host;
|
|
8
|
+
this._size = _size;
|
|
9
|
+
this._state = 'normal';
|
|
10
|
+
AcEdGripHandle.injectCSS();
|
|
11
|
+
var hostPosition = getComputedStyle(this._host).position;
|
|
12
|
+
if (hostPosition === 'static') {
|
|
13
|
+
this._host.style.position = 'relative';
|
|
14
|
+
}
|
|
15
|
+
this._el = document.createElement('div');
|
|
16
|
+
this._el.className = 'ml-grip-handle ml-grip-handle-normal';
|
|
17
|
+
this._el.style.width = "".concat(this._size, "px");
|
|
18
|
+
this._el.style.height = "".concat(this._size, "px");
|
|
19
|
+
this._host.appendChild(this._el);
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(AcEdGripHandle.prototype, "element", {
|
|
22
|
+
get: function () {
|
|
23
|
+
return this._el;
|
|
24
|
+
},
|
|
25
|
+
enumerable: false,
|
|
26
|
+
configurable: true
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(AcEdGripHandle.prototype, "state", {
|
|
29
|
+
get: function () {
|
|
30
|
+
return this._state;
|
|
31
|
+
},
|
|
32
|
+
enumerable: false,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
AcEdGripHandle.prototype.setState = function (state) {
|
|
36
|
+
if (this._state === state)
|
|
37
|
+
return;
|
|
38
|
+
this._state = state;
|
|
39
|
+
this._el.className = "ml-grip-handle ml-grip-handle-".concat(state);
|
|
40
|
+
};
|
|
41
|
+
AcEdGripHandle.prototype.setPosition = function (pos) {
|
|
42
|
+
this._el.style.left = "".concat(pos.x, "px");
|
|
43
|
+
this._el.style.top = "".concat(pos.y, "px");
|
|
44
|
+
};
|
|
45
|
+
AcEdGripHandle.prototype.destroy = function () {
|
|
46
|
+
this._el.remove();
|
|
47
|
+
};
|
|
48
|
+
AcEdGripHandle.injectCSS = function () {
|
|
49
|
+
if (document.getElementById('ml-grip-handle-style'))
|
|
50
|
+
return;
|
|
51
|
+
var style = document.createElement('style');
|
|
52
|
+
style.id = 'ml-grip-handle-style';
|
|
53
|
+
style.textContent = "\n .ml-grip-handle {\n position: absolute;\n pointer-events: auto;\n transform: translate(-50%, -50%);\n z-index: 5;\n box-sizing: border-box;\n cursor: pointer;\n }\n\n .ml-grip-handle-normal {\n border: 1px solid var(--ml-ui-grip-normal, #0080ff);\n background: transparent;\n }\n\n .ml-grip-handle-hover {\n border: 1px solid var(--ml-ui-grip-hover, #0080ff);\n background: color-mix(in srgb, var(--ml-ui-grip-hover, #0080ff) 25%, transparent);\n }\n\n .ml-grip-handle-hot {\n border: 1px solid var(--ml-ui-grip-hot, #ff0000);\n background: var(--ml-ui-grip-hot, #ff0000);\n }\n ";
|
|
54
|
+
document.head.appendChild(style);
|
|
55
|
+
};
|
|
56
|
+
return AcEdGripHandle;
|
|
57
|
+
}());
|
|
58
|
+
export { AcEdGripHandle };
|
|
59
|
+
//# sourceMappingURL=AcE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;QACnB,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,wCAAiC,KAAK,CAAE,CAAA;IAC/D,CAAC;IAED,oCAAW,GAAX,UAAY,GAAoB;QAC9B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,GAAG,UAAG,GAAG,CAAC,CAAC,OAAI,CAAA;QAClC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,GAAG,UAAG,GAAG,CAAC,CAAC,OAAI,CAAA;IACnC,CAAC;IAED,gCAAO,GAAP;QACE,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAA;IACnB,CAAC;IAEc,wBAAS,GAAxB;QACE,IAAI,QAAQ,CAAC,cAAc,CAAC,sBAAsB,CAAC;YAAE,OAAM;QAE3D,IAAM,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;QAC7C,KAAK,CAAC,EAAE,GAAG,sBAAsB,CAAA;QACjC,KAAK,CAAC,WAAW,GAAG,usBAwBnB,CAAA;QACD,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;IACH,qBAAC;AAAD,CAAC,AA7ED,IA6EC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { AcEdBaseView } from '../view/AcEdBaseView';
|
|
2
|
+
/**
|
|
3
|
+
* Manages grip point display and drag editing for the active view.
|
|
4
|
+
*
|
|
5
|
+
* Grip handles are shown for entities in the view's selection set when the
|
|
6
|
+
* editor is idle, the document is writable, and selection count is within the
|
|
7
|
+
* `GRIPOBJLIMIT` system variable. The manager listens for selection, view,
|
|
8
|
+
* command, and system-variable changes to refresh or reposition handles.
|
|
9
|
+
*
|
|
10
|
+
* Clicking a grip starts an {@link AcEdGripEditSession} that previews and
|
|
11
|
+
* commits entity geometry changes; while dragging, all grip handles are hidden.
|
|
12
|
+
*
|
|
13
|
+
* ## Key Responsibilities
|
|
14
|
+
* - **Display**: Create and position grip handles from entity grip points
|
|
15
|
+
* - **Interaction**: Route hover, hot, and mousedown events to edit sessions
|
|
16
|
+
* - **Lifecycle**: Subscribe/unsubscribe view events and dispose DOM on teardown
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const gripManager = new AcEdGripManager(view);
|
|
21
|
+
* // Handles appear automatically when entities are selected.
|
|
22
|
+
* // On view dispose:
|
|
23
|
+
* gripManager.dispose();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class AcEdGripManager {
|
|
27
|
+
/** View that owns selection, coordinate conversion, and the handle container. */
|
|
28
|
+
private readonly _view;
|
|
29
|
+
/** Active grip entries, one per grip point on each selected entity. */
|
|
30
|
+
private readonly _entries;
|
|
31
|
+
/** In-progress grip drag session, or `null` when not editing. */
|
|
32
|
+
private _editSession;
|
|
33
|
+
/** Entry currently under the pointer during mousedown (hot grip), if any. */
|
|
34
|
+
private _hotEntry;
|
|
35
|
+
/** Stable listener reference for selection/command refresh. */
|
|
36
|
+
private readonly _boundRefresh;
|
|
37
|
+
/** Stable listener reference for view pan/zoom/resize repositioning. */
|
|
38
|
+
private readonly _boundReposition;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a grip manager bound to the given view.
|
|
41
|
+
*
|
|
42
|
+
* Registers event listeners on the view's selection set, editor, view
|
|
43
|
+
* events, and `GRIPOBJLIMIT` system variable so grips stay in sync with
|
|
44
|
+
* application state.
|
|
45
|
+
*
|
|
46
|
+
* @param view - The CAD view whose selection and container host grip handles
|
|
47
|
+
*/
|
|
48
|
+
constructor(view: AcEdBaseView);
|
|
49
|
+
/**
|
|
50
|
+
* Whether a grip drag edit is currently in progress.
|
|
51
|
+
*
|
|
52
|
+
* While `true`, hover styling on other handles is suppressed and grip
|
|
53
|
+
* handles are hidden until the session ends.
|
|
54
|
+
*/
|
|
55
|
+
get isDragging(): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Tears down the manager and releases all resources.
|
|
58
|
+
*
|
|
59
|
+
* Unsubscribes from view events, cancels any active edit session, and
|
|
60
|
+
* destroys all grip handle DOM elements.
|
|
61
|
+
*/
|
|
62
|
+
dispose(): void;
|
|
63
|
+
/**
|
|
64
|
+
* Rebuilds the grip handle set from the current selection.
|
|
65
|
+
*
|
|
66
|
+
* Clears existing entries first. If grips are not allowed (read-only mode,
|
|
67
|
+
* active command, MText editor, or selection over limit), no new handles are
|
|
68
|
+
* created. Otherwise, iterates selected entities, queries grip points via
|
|
69
|
+
* `subGetGripPoints()`, creates handles, wires pointer events, and positions
|
|
70
|
+
* each entry in container coordinates.
|
|
71
|
+
*/
|
|
72
|
+
refresh(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Determines whether grip handles may be shown for the current view state.
|
|
75
|
+
*
|
|
76
|
+
* Delegates to {@link acedShouldShowGrips} using document open mode, editor
|
|
77
|
+
* activity, MText input focus, selection count, and `GRIPOBJLIMIT`.
|
|
78
|
+
*
|
|
79
|
+
* @returns `true` if grips should be displayed; otherwise `false`
|
|
80
|
+
*/
|
|
81
|
+
private canShowGrips;
|
|
82
|
+
/**
|
|
83
|
+
* Subscribes to events that require a full grip refresh or reposition.
|
|
84
|
+
*
|
|
85
|
+
* Refresh triggers: selection added/removed, command start/end,
|
|
86
|
+
* `GRIPOBJLIMIT` sysvar change. Reposition triggers: view changed, view resize.
|
|
87
|
+
*/
|
|
88
|
+
private bindEvents;
|
|
89
|
+
/**
|
|
90
|
+
* Removes all event listeners registered by {@link bindEvents}.
|
|
91
|
+
*/
|
|
92
|
+
private unbindEvents;
|
|
93
|
+
/**
|
|
94
|
+
* Attaches pointer event handlers to a grip handle element.
|
|
95
|
+
*
|
|
96
|
+
* - **mouseenter**: Sets hover state unless a drag is active
|
|
97
|
+
* - **mouseleave**: Reverts to normal unless this entry is the hot grip
|
|
98
|
+
* - **mousedown** (left button): Marks hot, prevents default propagation,
|
|
99
|
+
* and starts a grip edit session when grips are allowed
|
|
100
|
+
*
|
|
101
|
+
* @param entry - The grip entry whose handle receives the listeners
|
|
102
|
+
*/
|
|
103
|
+
private wireHandleEvents;
|
|
104
|
+
/**
|
|
105
|
+
* Begins a grip drag edit for the given entry.
|
|
106
|
+
*
|
|
107
|
+
* Resolves the entity from the document, hides all grip handles for the
|
|
108
|
+
* duration of the drag, and constructs an {@link AcEdGripEditSession} that
|
|
109
|
+
* calls {@link endEdit} when the session completes.
|
|
110
|
+
*
|
|
111
|
+
* If the entity no longer exists, {@link endEdit} is invoked immediately.
|
|
112
|
+
*
|
|
113
|
+
* @param entry - The grip entry that was activated by the user
|
|
114
|
+
*/
|
|
115
|
+
private startEdit;
|
|
116
|
+
/**
|
|
117
|
+
* Completes or aborts the current grip edit and restores grip display.
|
|
118
|
+
*
|
|
119
|
+
* Clears the edit session and hot entry, then rebuilds handles via
|
|
120
|
+
* {@link refresh} so geometry and selection state are reflected on screen.
|
|
121
|
+
*/
|
|
122
|
+
private endEdit;
|
|
123
|
+
/**
|
|
124
|
+
* Removes all visible grip handles while a drag edit is in progress.
|
|
125
|
+
*
|
|
126
|
+
* Called when starting an edit so only the preview jig is shown, not the
|
|
127
|
+
* static grip squares.
|
|
128
|
+
*/
|
|
129
|
+
private hideEntriesForDrag;
|
|
130
|
+
/**
|
|
131
|
+
* Updates a single grip handle's screen position from its WCS point.
|
|
132
|
+
*
|
|
133
|
+
* Converts world coordinates to canvas, then to container-local pixels,
|
|
134
|
+
* and applies the result to the handle's DOM element.
|
|
135
|
+
*
|
|
136
|
+
* @param entry - The grip entry to reposition
|
|
137
|
+
*/
|
|
138
|
+
private positionEntry;
|
|
139
|
+
/**
|
|
140
|
+
* Repositions every active grip handle after a view transform or resize.
|
|
141
|
+
*
|
|
142
|
+
* Does not recreate entries; only updates DOM positions from stored WCS points.
|
|
143
|
+
*/
|
|
144
|
+
private repositionAll;
|
|
145
|
+
/**
|
|
146
|
+
* Destroys all grip handle DOM elements and clears the entry list.
|
|
147
|
+
*
|
|
148
|
+
* Also resets {@link _hotEntry}. Does not cancel an active edit session;
|
|
149
|
+
* use {@link clear} for full teardown including session cancellation.
|
|
150
|
+
*/
|
|
151
|
+
private clearEntries;
|
|
152
|
+
/**
|
|
153
|
+
* Cancels any in-progress edit and removes all grip handles.
|
|
154
|
+
*
|
|
155
|
+
* Used by {@link dispose} and internally when a full reset is required.
|
|
156
|
+
*/
|
|
157
|
+
private clear;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=AcEdGripManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcEdGripManager.d.ts","sourceRoot":"","sources":["../../../src/editor/grip/AcEdGripManager.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAyBnD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,qBAAa,eAAe;IAC1B,iFAAiF;IACjF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAc;IACpC,uEAAuE;IACvE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAsB;IAC/C,iEAAiE;IACjE,OAAO,CAAC,YAAY,CAAmC;IACvD,6EAA6E;IAC7E,OAAO,CAAC,SAAS,CAA6B;IAE9C,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAuB;IACrD,wEAAwE;IACxE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAA6B;IAE9D;;;;;;;;OAQG;gBACS,IAAI,EAAE,YAAY;IAK9B;;;;;OAKG;IACH,IAAI,UAAU,IAAI,OAAO,CAExB;IAED;;;;;OAKG;IACH,OAAO;IAKP;;;;;;;;OAQG;IACH,OAAO;IA8BP;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;IAgBpB;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAiBlB;;OAEG;IACH,OAAO,CAAC,YAAY;IAWpB;;;;;;;;;OASG;IACH,OAAO,CAAC,gBAAgB;IA0BxB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,SAAS;IAyBjB;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAMf;;;;;OAKG;IACH,OAAO,CAAC,kBAAkB;IAI1B;;;;;;;OAOG;IACH,OAAO,CAAC,aAAa;IAMrB;;;;OAIG;IACH,OAAO,CAAC,aAAa;IAMrB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAQpB;;;;OAIG;IACH,OAAO,CAAC,KAAK;CAKd"}
|