@mlightcad/cad-simple-viewer 1.5.5 → 1.5.7
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 +69 -1
- package/dist/{index.js → cad-simple-viewer.js} +34247 -29923
- package/dist/cad-simple-viewer.umd.cjs +913 -0
- package/dist/dxf-parser-worker.js +2091 -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 +15 -2
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +63 -0
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +195 -23
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +81 -0
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +154 -0
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApLayerSessionState.d.ts +15 -0
- package/lib/app/AcApLayerSessionState.d.ts.map +1 -0
- package/lib/app/AcApLayerSessionState.js +2 -0
- package/lib/app/AcApLayerSessionState.js.map +1 -0
- package/lib/app/AcApOpenFileDialog.d.ts +35 -0
- package/lib/app/AcApOpenFileDialog.d.ts.map +1 -0
- package/lib/app/AcApOpenFileDialog.js +192 -0
- package/lib/app/AcApOpenFileDialog.js.map +1 -0
- package/lib/app/AcApWebworkerReadiness.d.ts +18 -0
- package/lib/app/AcApWebworkerReadiness.d.ts.map +1 -0
- package/lib/app/AcApWebworkerReadiness.js +126 -0
- package/lib/app/AcApWebworkerReadiness.js.map +1 -0
- 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 +4 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +3 -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/AcApOpenCmd.d.ts +3 -22
- package/lib/command/AcApOpenCmd.d.ts.map +1 -1
- package/lib/command/AcApOpenCmd.js +3 -22
- package/lib/command/AcApOpenCmd.js.map +1 -1
- package/lib/command/AcApRedoCmd.d.ts +10 -0
- package/lib/command/AcApRedoCmd.d.ts.map +1 -0
- package/lib/command/AcApRedoCmd.js +85 -0
- package/lib/command/AcApRedoCmd.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/AcApUndoCmd.d.ts +10 -0
- package/lib/command/AcApUndoCmd.d.ts.map +1 -0
- package/lib/command/AcApUndoCmd.js +85 -0
- package/lib/command/AcApUndoCmd.js.map +1 -0
- 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 +14 -9
- package/lib/command/draw/AcApEllipseCmd.js.map +1 -1
- package/lib/command/draw/AcApHatchCmd.d.ts +1 -1
- package/lib/command/draw/AcApLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApLineCmd.js +8 -2
- package/lib/command/draw/AcApLineCmd.js.map +1 -1
- package/lib/command/draw/AcApMLineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApMLineCmd.js +4 -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/AcApPolylineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApPolylineCmd.js +3 -0
- package/lib/command/draw/AcApPolylineCmd.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/AcApSplineCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApSplineCmd.js +2 -0
- package/lib/command/draw/AcApSplineCmd.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 +3 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +3 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/layer/AcApLayerCmd.d.ts +3 -194
- package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCmd.js +64 -398
- package/lib/command/layer/AcApLayerCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.d.ts +2 -34
- package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.js +18 -77
- package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.d.ts +2 -32
- package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.js +26 -169
- package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts +2 -16
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.js +32 -54
- package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.d.ts +2 -31
- package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.js +19 -198
- package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.d.ts +2 -40
- package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.js +18 -65
- package/lib/command/layer/AcApLayerLockCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerMutationCmd.d.ts +13 -0
- package/lib/command/layer/AcApLayerMutationCmd.d.ts.map +1 -0
- package/lib/command/layer/AcApLayerMutationCmd.js +42 -0
- package/lib/command/layer/AcApLayerMutationCmd.js.map +1 -0
- package/lib/command/layer/AcApLayerOffCmd.d.ts +2 -9
- package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOffCmd.js +32 -43
- package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.d.ts +2 -22
- package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.js +8 -62
- package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.d.ts +2 -75
- package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.js +6 -165
- package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.d.ts +2 -29
- package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.js +8 -74
- package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts +2 -44
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.js +10 -122
- package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts +2 -40
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.js +18 -65
- package/lib/command/layer/AcApLayerUnlockCmd.js.map +1 -1
- package/lib/command/modify/AcApCopyCmd.d.ts +12 -0
- package/lib/command/modify/AcApCopyCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApCopyCmd.js +67 -177
- package/lib/command/modify/AcApCopyCmd.js.map +1 -1
- package/lib/command/modify/AcApCopyPreviewJig.d.ts +21 -0
- package/lib/command/modify/AcApCopyPreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApCopyPreviewJig.js +61 -0
- package/lib/command/modify/AcApCopyPreviewJig.js.map +1 -0
- package/lib/command/modify/AcApEraseCmd.d.ts +0 -6
- package/lib/command/modify/AcApEraseCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApEraseCmd.js +11 -38
- package/lib/command/modify/AcApEraseCmd.js.map +1 -1
- package/lib/command/modify/AcApHideObjectsCmd.d.ts +0 -7
- package/lib/command/modify/AcApHideObjectsCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApHideObjectsCmd.js +1 -8
- package/lib/command/modify/AcApHideObjectsCmd.js.map +1 -1
- package/lib/command/modify/AcApMoveCmd.d.ts +0 -6
- package/lib/command/modify/AcApMoveCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApMoveCmd.js +26 -105
- package/lib/command/modify/AcApMoveCmd.js.map +1 -1
- package/lib/command/modify/AcApMovePreviewJig.d.ts +18 -0
- package/lib/command/modify/AcApMovePreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApMovePreviewJig.js +45 -0
- package/lib/command/modify/AcApMovePreviewJig.js.map +1 -0
- package/lib/command/modify/AcApOffsetCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApOffsetCmd.js +14 -37
- package/lib/command/modify/AcApOffsetCmd.js.map +1 -1
- package/lib/command/modify/AcApRotateCmd.d.ts +2 -2
- package/lib/command/modify/AcApRotateCmd.d.ts.map +1 -1
- package/lib/command/modify/AcApRotateCmd.js +38 -204
- package/lib/command/modify/AcApRotateCmd.js.map +1 -1
- package/lib/command/modify/AcApRotatePreviewJig.d.ts +47 -0
- package/lib/command/modify/AcApRotatePreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApRotatePreviewJig.js +97 -0
- package/lib/command/modify/AcApRotatePreviewJig.js.map +1 -0
- 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 +24 -0
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +71 -5
- 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 +16 -2
- package/lib/editor/global/eventBus.d.ts.map +1 -1
- package/lib/editor/global/eventBus.js.map +1 -1
- package/lib/editor/grip/AcEdGripAppearance.d.ts +18 -0
- package/lib/editor/grip/AcEdGripAppearance.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripAppearance.js +30 -0
- package/lib/editor/grip/AcEdGripAppearance.js.map +1 -0
- 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 +83 -0
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -0
- package/lib/editor/grip/AcEdGripHandle.d.ts +21 -0
- package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripHandle.js +62 -0
- package/lib/editor/grip/AcEdGripHandle.js.map +1 -0
- package/lib/editor/grip/AcEdGripManager.d.ts +171 -0
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripManager.js +376 -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/AcEdBatchPreview.d.ts +96 -0
- package/lib/editor/input/AcEdBatchPreview.d.ts.map +1 -0
- package/lib/editor/input/AcEdBatchPreview.js +125 -0
- package/lib/editor/input/AcEdBatchPreview.js.map +1 -0
- 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/AcEdPreviewJig.d.ts +1 -1
- package/lib/editor/input/AcEdPreviewJig.d.ts.map +1 -1
- package/lib/editor/input/AcEdPreviewJig.js +14 -0
- package/lib/editor/input/AcEdPreviewJig.js.map +1 -1
- package/lib/editor/input/AcEdSelectionPreviewJig.d.ts +109 -0
- package/lib/editor/input/AcEdSelectionPreviewJig.d.ts.map +1 -0
- package/lib/editor/input/AcEdSelectionPreviewJig.js +185 -0
- package/lib/editor/input/AcEdSelectionPreviewJig.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 +3 -0
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +3 -0
- package/lib/editor/input/index.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts +7 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.js +17 -0
- package/lib/editor/input/prompt/AcEdPromptAngleOptions.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/AcEdFloatingInputBox.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBox.js +10 -2
- package/lib/editor/input/ui/AcEdFloatingInputBox.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.js +9 -4
- package/lib/editor/input/ui/AcEdFloatingInputBoxes.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 +44 -2
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +26 -12
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSpatialQueryResult.d.ts +28 -0
- package/lib/editor/view/AcEdSpatialQueryResult.d.ts.map +1 -1
- package/lib/editor/view/AcEdSpatialQueryResult.js +65 -1
- package/lib/editor/view/AcEdSpatialQueryResult.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +42 -0
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +56 -4
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/en/command.d.ts +26 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +26 -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 +26 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +26 -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/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/plugin/AcApLazyPluginRegistration.d.ts +3 -8
- package/lib/plugin/AcApLazyPluginRegistration.d.ts.map +1 -1
- package/lib/service/AcApEntitySelection.d.ts +42 -0
- package/lib/service/AcApEntitySelection.d.ts.map +1 -0
- package/lib/service/AcApEntitySelection.js +156 -0
- package/lib/service/AcApEntitySelection.js.map +1 -0
- package/lib/service/AcApEntityService.d.ts +115 -0
- package/lib/service/AcApEntityService.d.ts.map +1 -0
- package/lib/service/AcApEntityService.js +194 -0
- package/lib/service/AcApEntityService.js.map +1 -0
- package/lib/{command/layer → service}/AcApLayerIsoState.d.ts +6 -24
- package/lib/service/AcApLayerIsoState.d.ts.map +1 -0
- package/lib/service/AcApLayerIsoState.js +28 -0
- package/lib/service/AcApLayerIsoState.js.map +1 -0
- package/lib/service/AcApLayerService.d.ts +400 -0
- package/lib/service/AcApLayerService.d.ts.map +1 -0
- package/lib/service/AcApLayerService.js +1240 -0
- package/lib/service/AcApLayerService.js.map +1 -0
- package/lib/service/AcApLayerStore.d.ts +198 -0
- package/lib/service/AcApLayerStore.d.ts.map +1 -0
- package/lib/service/AcApLayerStore.js +335 -0
- package/lib/service/AcApLayerStore.js.map +1 -0
- package/lib/service/AcApServiceEdit.d.ts +18 -0
- package/lib/service/AcApServiceEdit.d.ts.map +1 -0
- package/lib/service/AcApServiceEdit.js +34 -0
- package/lib/service/AcApServiceEdit.js.map +1 -0
- package/lib/service/index.d.ts +16 -0
- package/lib/service/index.d.ts.map +1 -0
- package/lib/service/index.js +16 -0
- package/lib/service/index.js.map +1 -0
- package/lib/service/types.d.ts +116 -0
- package/lib/service/types.d.ts.map +1 -0
- package/lib/service/types.js +5 -0
- package/lib/service/types.js.map +1 -0
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +22 -7
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +58 -12
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +2 -2
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -3
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +2 -2
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js +19 -5
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrSpatialIndex.d.ts +10 -1
- package/lib/spatialIndex/AcTrSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrSpatialIndex.js +7 -1
- package/lib/spatialIndex/AcTrSpatialIndex.js.map +1 -1
- package/lib/util/AcApDatabaseEdit.d.ts +11 -0
- package/lib/util/AcApDatabaseEdit.d.ts.map +1 -0
- package/lib/util/AcApDatabaseEdit.js +20 -0
- package/lib/util/AcApDatabaseEdit.js.map +1 -0
- 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/util/AcApGeTransform.d.ts +10 -0
- package/lib/util/AcApGeTransform.d.ts.map +1 -0
- package/lib/util/AcApGeTransform.js +15 -0
- package/lib/util/AcApGeTransform.js.map +1 -0
- package/lib/util/index.d.ts +2 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +2 -0
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcEdViewKeyHandler.d.ts +32 -0
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -0
- package/lib/view/AcEdViewKeyHandler.js +101 -0
- package/lib/view/AcEdViewKeyHandler.js.map +1 -0
- 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 +43 -0
- package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -0
- package/lib/view/AcTrGroupWcsBboxAssert.js +84 -0
- package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -0
- package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts +49 -0
- package/lib/view/AcTrInheritedLayerMaterialMapper.d.ts.map +1 -0
- package/lib/view/AcTrInheritedLayerMaterialMapper.js +138 -0
- package/lib/view/AcTrInheritedLayerMaterialMapper.js.map +1 -0
- package/lib/view/AcTrLayer.d.ts +33 -2
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +75 -2
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayerAppearanceController.d.ts +55 -0
- package/lib/view/AcTrLayerAppearanceController.d.ts.map +1 -0
- package/lib/view/AcTrLayerAppearanceController.js +86 -0
- package/lib/view/AcTrLayerAppearanceController.js.map +1 -0
- package/lib/view/AcTrLayout.d.ts +37 -2
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +161 -15
- 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/AcTrScene.d.ts +47 -1
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +78 -3
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +118 -27
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +584 -362
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/index.d.ts +3 -0
- package/lib/view/index.d.ts.map +1 -1
- package/lib/view/index.js +3 -0
- package/lib/view/index.js.map +1 -1
- package/package.json +13 -11
- package/dist/index.umd.cjs +0 -897
- package/lib/command/layer/AcApLayerIsoState.d.ts.map +0 -1
- package/lib/command/layer/AcApLayerIsoState.js +0 -53
- package/lib/command/layer/AcApLayerIsoState.js.map +0 -1
|
@@ -49,65 +49,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
49
49
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
50
50
|
}
|
|
51
51
|
};
|
|
52
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
53
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
54
|
-
if (!m) return o;
|
|
55
|
-
var i = m.call(o), r, ar = [], e;
|
|
56
|
-
try {
|
|
57
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
58
|
-
}
|
|
59
|
-
catch (error) { e = { error: error }; }
|
|
60
|
-
finally {
|
|
61
|
-
try {
|
|
62
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
63
|
-
}
|
|
64
|
-
finally { if (e) throw e.error; }
|
|
65
|
-
}
|
|
66
|
-
return ar;
|
|
67
|
-
};
|
|
68
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
69
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
70
|
-
if (ar || !(i in from)) {
|
|
71
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
72
|
-
ar[i] = from[i];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
76
|
-
};
|
|
77
|
-
import { AcCmColor, AcCmColorMethod, AcDbLayerTableRecord } from '@mlightcad/data-model';
|
|
78
52
|
import { AcApDocManager } from '../../app';
|
|
79
|
-
import {
|
|
53
|
+
import { AcEdOpenMode, AcEdPromptKeywordOptions, AcEdPromptStatus, AcEdPromptStringOptions } from '../../editor';
|
|
80
54
|
import { AcApI18n } from '../../i18n';
|
|
55
|
+
import { AcApLayerService } from '../../service';
|
|
56
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
81
57
|
/**
|
|
82
58
|
* AutoCAD-style command-line layer command (`-LAYER`).
|
|
83
|
-
*
|
|
84
|
-
* This command intentionally avoids any dialog UI and keeps all interactions
|
|
85
|
-
* in command line prompts.
|
|
86
59
|
*/
|
|
87
60
|
var AcApLayerCmd = /** @class */ (function (_super) {
|
|
88
61
|
__extends(AcApLayerCmd, _super);
|
|
89
|
-
/**
|
|
90
|
-
* Creates a command-line `-LAYER` command instance.
|
|
91
|
-
*
|
|
92
|
-
* The command is registered as a write-mode command because layer operations
|
|
93
|
-
* can modify database state (current layer, visibility, lock state, color,
|
|
94
|
-
* descriptions, and table records).
|
|
95
|
-
*/
|
|
96
62
|
function AcApLayerCmd() {
|
|
97
63
|
var _this = _super.call(this) || this;
|
|
98
64
|
_this.mode = AcEdOpenMode.Write;
|
|
99
65
|
return _this;
|
|
100
66
|
}
|
|
101
|
-
/**
|
|
102
|
-
* Runs the interactive `-LAYER` loop.
|
|
103
|
-
*
|
|
104
|
-
* The command keeps prompting for top-level options until the user cancels
|
|
105
|
-
* or confirms an empty input. Each selected keyword dispatches to one
|
|
106
|
-
* dedicated branch handler.
|
|
107
|
-
*
|
|
108
|
-
* @param context - Active application context containing view and document.
|
|
109
|
-
* @returns Resolves when the command exits.
|
|
110
|
-
*/
|
|
111
67
|
AcApLayerCmd.prototype.execute = function (context) {
|
|
112
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
113
69
|
var action, _a;
|
|
@@ -189,16 +145,12 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
189
145
|
});
|
|
190
146
|
});
|
|
191
147
|
};
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
* The prompt is keyword-only and supports empty-enter termination (`allowNone`).
|
|
196
|
-
*
|
|
197
|
-
* @returns Selected top-level keyword, or `undefined` when canceled/finished.
|
|
198
|
-
*/
|
|
148
|
+
AcApLayerCmd.prototype.layerService = function (context) {
|
|
149
|
+
return new AcApLayerService(context.doc.database);
|
|
150
|
+
};
|
|
199
151
|
AcApLayerCmd.prototype.promptMainKeyword = function () {
|
|
200
152
|
return __awaiter(this, void 0, void 0, function () {
|
|
201
|
-
var prompt, result
|
|
153
|
+
var prompt, result;
|
|
202
154
|
return __generator(this, function (_a) {
|
|
203
155
|
switch (_a.label) {
|
|
204
156
|
case 0:
|
|
@@ -221,137 +173,22 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
221
173
|
result = _a.sent();
|
|
222
174
|
if (result.status !== AcEdPromptStatus.OK)
|
|
223
175
|
return [2 /*return*/, undefined];
|
|
224
|
-
|
|
225
|
-
return [2 /*return*/, keyword];
|
|
176
|
+
return [2 /*return*/, result.stringResult];
|
|
226
177
|
}
|
|
227
178
|
});
|
|
228
179
|
});
|
|
229
180
|
};
|
|
230
|
-
/**
|
|
231
|
-
* Adds one localized keyword entry to the main `-LAYER` prompt.
|
|
232
|
-
*
|
|
233
|
-
* @param prompt - Target keyword prompt to receive the keyword option.
|
|
234
|
-
* @param keyword - Translation-key suffix for `jig.layer.keywords.*`.
|
|
235
|
-
*/
|
|
236
181
|
AcApLayerCmd.prototype.addKeyword = function (prompt, keyword) {
|
|
237
182
|
prompt.keywords.add(AcApI18n.t("jig.layer.keywords.".concat(keyword, ".display")), AcApI18n.t("jig.layer.keywords.".concat(keyword, ".global")), AcApI18n.t("jig.layer.keywords.".concat(keyword, ".local")));
|
|
238
183
|
};
|
|
239
|
-
/**
|
|
240
|
-
* Emits one user-facing message through the command-line output.
|
|
241
|
-
*
|
|
242
|
-
* @param message - Message text to display.
|
|
243
|
-
* @param type - Message severity category.
|
|
244
|
-
*/
|
|
245
|
-
AcApLayerCmd.prototype.notify = function (message, type) {
|
|
246
|
-
if (type === void 0) { type = 'info'; }
|
|
247
|
-
AcApDocManager.instance.editor.showMessage(message, type);
|
|
248
|
-
};
|
|
249
|
-
/**
|
|
250
|
-
* Prints all layer states to browser console and reports summary in UI.
|
|
251
|
-
*
|
|
252
|
-
* The list contains the current-layer marker and common status columns
|
|
253
|
-
* (on/off, frozen, locked, color).
|
|
254
|
-
*
|
|
255
|
-
* @param context - Active command context used to resolve the layer table.
|
|
256
|
-
*/
|
|
257
184
|
AcApLayerCmd.prototype.listLayers = function (context) {
|
|
258
|
-
var
|
|
259
|
-
var layers = __spreadArray([], __read(db.tables.layerTable.newIterator()), false);
|
|
260
|
-
var rows = layers.map(function (layer) { return ({
|
|
261
|
-
name: layer.name,
|
|
262
|
-
current: db.clayer === layer.name ? '*' : '',
|
|
263
|
-
on: layer.isOff ? 'No' : 'Yes',
|
|
264
|
-
frozen: layer.isFrozen ? 'Yes' : 'No',
|
|
265
|
-
locked: layer.isLocked ? 'Yes' : 'No',
|
|
266
|
-
color: layer.color.toString()
|
|
267
|
-
}); });
|
|
185
|
+
var rows = this.layerService(context).getLayerSummaries();
|
|
268
186
|
console.table(rows);
|
|
269
|
-
this.
|
|
270
|
-
};
|
|
271
|
-
/**
|
|
272
|
-
* Parses a raw layer-name input string into a distinct name list.
|
|
273
|
-
*
|
|
274
|
-
* Supported forms:
|
|
275
|
-
* - `*` to target all existing layer names.
|
|
276
|
-
* - Comma-separated names (e.g. `A,B,C`).
|
|
277
|
-
*
|
|
278
|
-
* @param input - Raw user input from command line.
|
|
279
|
-
* @param allNames - All existing layer names, used for wildcard expansion.
|
|
280
|
-
* @returns Deduplicated list of requested layer names.
|
|
281
|
-
*/
|
|
282
|
-
AcApLayerCmd.prototype.parseLayerNameInput = function (input, allNames) {
|
|
283
|
-
var raw = input.trim();
|
|
284
|
-
if (!raw)
|
|
285
|
-
return [];
|
|
286
|
-
if (raw === '*')
|
|
287
|
-
return __spreadArray([], __read(allNames), false);
|
|
288
|
-
var names = raw
|
|
289
|
-
.split(',')
|
|
290
|
-
.map(function (v) { return v.trim(); })
|
|
291
|
-
.filter(Boolean);
|
|
292
|
-
return __spreadArray([], __read(new Set(names)), false);
|
|
293
|
-
};
|
|
294
|
-
/**
|
|
295
|
-
* Resolves layer records by name and separates missing names.
|
|
296
|
-
*
|
|
297
|
-
* @param context - Active command context with access to layer table.
|
|
298
|
-
* @param names - Layer names to resolve.
|
|
299
|
-
* @returns Object containing matched records and unresolved names.
|
|
300
|
-
*/
|
|
301
|
-
AcApLayerCmd.prototype.resolveLayers = function (context, names) {
|
|
302
|
-
var table = context.doc.database.tables.layerTable;
|
|
303
|
-
var layers = [];
|
|
304
|
-
var missing = [];
|
|
305
|
-
names.forEach(function (name) {
|
|
306
|
-
var layer = table.getAt(name);
|
|
307
|
-
if (layer)
|
|
308
|
-
layers.push(layer);
|
|
309
|
-
else
|
|
310
|
-
missing.push(name);
|
|
311
|
-
});
|
|
312
|
-
return { layers: layers, missing: missing };
|
|
313
|
-
};
|
|
314
|
-
/**
|
|
315
|
-
* Sets or clears the frozen bit in `standardFlags`.
|
|
316
|
-
*
|
|
317
|
-
* The explicit bit operation is used to ensure both freeze and thaw are
|
|
318
|
-
* applied deterministically.
|
|
319
|
-
*
|
|
320
|
-
* @param layer - Target layer table record.
|
|
321
|
-
* @param frozen - `true` to freeze, `false` to thaw.
|
|
322
|
-
*/
|
|
323
|
-
AcApLayerCmd.prototype.setLayerFrozen = function (layer, frozen) {
|
|
324
|
-
var _a;
|
|
325
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
326
|
-
layer.standardFlags = frozen ? flags | 0x01 : flags & ~0x01;
|
|
187
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.listSummary'), " (").concat(rows.length, ")"), 'info');
|
|
327
188
|
};
|
|
328
|
-
/**
|
|
329
|
-
* Sets or clears the locked bit in `standardFlags`.
|
|
330
|
-
*
|
|
331
|
-
* The explicit bit operation is used to ensure both lock and unlock are
|
|
332
|
-
* applied deterministically.
|
|
333
|
-
*
|
|
334
|
-
* @param layer - Target layer table record.
|
|
335
|
-
* @param locked - `true` to lock, `false` to unlock.
|
|
336
|
-
*/
|
|
337
|
-
AcApLayerCmd.prototype.setLayerLocked = function (layer, locked) {
|
|
338
|
-
var _a;
|
|
339
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
340
|
-
layer.standardFlags = locked ? flags | 0x04 : flags & ~0x04;
|
|
341
|
-
};
|
|
342
|
-
/**
|
|
343
|
-
* Prompts for one or more layer names and parses them into a list.
|
|
344
|
-
*
|
|
345
|
-
* This helper powers batch operations such as on/off/freeze/thaw/lock/unlock
|
|
346
|
-
* and supports wildcard `*` plus comma-separated names.
|
|
347
|
-
*
|
|
348
|
-
* @param message - Prompt message shown in command line.
|
|
349
|
-
* @param context - Active command context used for wildcard expansion.
|
|
350
|
-
* @returns Parsed layer names, or `undefined` when canceled/invalid.
|
|
351
|
-
*/
|
|
352
189
|
AcApLayerCmd.prototype.promptLayerNames = function (message, context) {
|
|
353
190
|
return __awaiter(this, void 0, void 0, function () {
|
|
354
|
-
var prompt, result,
|
|
191
|
+
var prompt, result, service, names;
|
|
355
192
|
var _a;
|
|
356
193
|
return __generator(this, function (_b) {
|
|
357
194
|
switch (_b.label) {
|
|
@@ -363,10 +200,10 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
363
200
|
result = _b.sent();
|
|
364
201
|
if (result.status !== AcEdPromptStatus.OK)
|
|
365
202
|
return [2 /*return*/, undefined];
|
|
366
|
-
|
|
367
|
-
names =
|
|
203
|
+
service = this.layerService(context);
|
|
204
|
+
names = service.parseLayerNameInput((_a = result.stringResult) !== null && _a !== void 0 ? _a : '');
|
|
368
205
|
if (!names.length) {
|
|
369
|
-
this.
|
|
206
|
+
this.showMessage(AcApI18n.t('jig.layer.emptyInput'), 'warning');
|
|
370
207
|
return [2 /*return*/, undefined];
|
|
371
208
|
}
|
|
372
209
|
return [2 /*return*/, names];
|
|
@@ -374,12 +211,6 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
374
211
|
});
|
|
375
212
|
});
|
|
376
213
|
};
|
|
377
|
-
/**
|
|
378
|
-
* Prompts for a single layer name.
|
|
379
|
-
*
|
|
380
|
-
* @param message - Prompt message shown in command line.
|
|
381
|
-
* @returns Trimmed layer name, or `undefined` when canceled/empty.
|
|
382
|
-
*/
|
|
383
214
|
AcApLayerCmd.prototype.promptSingleLayerName = function (message) {
|
|
384
215
|
return __awaiter(this, void 0, void 0, function () {
|
|
385
216
|
var prompt, result, name;
|
|
@@ -400,65 +231,31 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
400
231
|
});
|
|
401
232
|
});
|
|
402
233
|
};
|
|
403
|
-
/**
|
|
404
|
-
* Handles the `New` branch.
|
|
405
|
-
*
|
|
406
|
-
* Creates one or more missing layers while keeping existing ones unchanged.
|
|
407
|
-
* The method reports creation count and duplicate names separately.
|
|
408
|
-
*
|
|
409
|
-
* @param context - Active command context used to access the layer table.
|
|
410
|
-
* @returns Resolves when branch execution completes.
|
|
411
|
-
*/
|
|
412
234
|
AcApLayerCmd.prototype.runNew = function (context) {
|
|
413
235
|
return __awaiter(this, void 0, void 0, function () {
|
|
414
|
-
var names,
|
|
415
|
-
return __generator(this, function (
|
|
416
|
-
switch (
|
|
236
|
+
var names, _a, created, existed;
|
|
237
|
+
return __generator(this, function (_b) {
|
|
238
|
+
switch (_b.label) {
|
|
417
239
|
case 0: return [4 /*yield*/, this.promptLayerNames(AcApI18n.t('jig.layer.newPrompt'), context)];
|
|
418
240
|
case 1:
|
|
419
|
-
names =
|
|
241
|
+
names = _b.sent();
|
|
420
242
|
if (!names)
|
|
421
243
|
return [2 /*return*/];
|
|
422
|
-
|
|
423
|
-
created = 0;
|
|
424
|
-
existed = [];
|
|
425
|
-
names.forEach(function (name) {
|
|
426
|
-
if (table.has(name)) {
|
|
427
|
-
existed.push(name);
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
table.add(new AcDbLayerTableRecord({
|
|
431
|
-
name: name,
|
|
432
|
-
isOff: false,
|
|
433
|
-
isPlottable: true,
|
|
434
|
-
color: new AcCmColor(AcCmColorMethod.ByACI, 7),
|
|
435
|
-
linetype: 'Continuous'
|
|
436
|
-
}));
|
|
437
|
-
created++;
|
|
438
|
-
});
|
|
244
|
+
_a = this.layerService(context).createLayers(names), created = _a.created, existed = _a.existed;
|
|
439
245
|
if (created > 0) {
|
|
440
|
-
this.
|
|
246
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.created'), ": ").concat(created), 'success');
|
|
441
247
|
}
|
|
442
248
|
if (existed.length > 0) {
|
|
443
|
-
this.
|
|
249
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.alreadyExists'), ": ").concat(existed.join(', ')), 'warning');
|
|
444
250
|
}
|
|
445
251
|
return [2 /*return*/];
|
|
446
252
|
}
|
|
447
253
|
});
|
|
448
254
|
});
|
|
449
255
|
};
|
|
450
|
-
/**
|
|
451
|
-
* Handles the `Set` branch.
|
|
452
|
-
*
|
|
453
|
-
* Sets one existing layer as current (`CLAYER`) and ensures the target is
|
|
454
|
-
* visible/unfrozen before assignment.
|
|
455
|
-
*
|
|
456
|
-
* @param context - Active command context.
|
|
457
|
-
* @returns Resolves when branch execution completes.
|
|
458
|
-
*/
|
|
459
256
|
AcApLayerCmd.prototype.runSet = function (context) {
|
|
460
257
|
return __awaiter(this, void 0, void 0, function () {
|
|
461
|
-
var name
|
|
258
|
+
var name;
|
|
462
259
|
return __generator(this, function (_a) {
|
|
463
260
|
switch (_a.label) {
|
|
464
261
|
case 0: return [4 /*yield*/, this.promptSingleLayerName(AcApI18n.t('jig.layer.setPrompt'))];
|
|
@@ -466,31 +263,17 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
466
263
|
name = _a.sent();
|
|
467
264
|
if (!name)
|
|
468
265
|
return [2 /*return*/];
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
|
|
472
|
-
return [2 /*return*/];
|
|
266
|
+
if (!this.layerService(context).setCurrentLayer(name)) {
|
|
267
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
|
|
473
268
|
}
|
|
474
|
-
layer.isOff = false;
|
|
475
|
-
this.setLayerFrozen(layer, false);
|
|
476
|
-
context.doc.database.clayer = layer.name;
|
|
477
269
|
return [2 /*return*/];
|
|
478
270
|
}
|
|
479
271
|
});
|
|
480
272
|
});
|
|
481
273
|
};
|
|
482
|
-
/**
|
|
483
|
-
* Handles the `Make` branch.
|
|
484
|
-
*
|
|
485
|
-
* Creates the layer if missing, then makes it current. The resulting current
|
|
486
|
-
* layer is turned on and thawed.
|
|
487
|
-
*
|
|
488
|
-
* @param context - Active command context.
|
|
489
|
-
* @returns Resolves when branch execution completes.
|
|
490
|
-
*/
|
|
491
274
|
AcApLayerCmd.prototype.runMake = function (context) {
|
|
492
275
|
return __awaiter(this, void 0, void 0, function () {
|
|
493
|
-
var name
|
|
276
|
+
var name;
|
|
494
277
|
return __generator(this, function (_a) {
|
|
495
278
|
switch (_a.label) {
|
|
496
279
|
case 0: return [4 /*yield*/, this.promptSingleLayerName(AcApI18n.t('jig.layer.makePrompt'))];
|
|
@@ -498,194 +281,90 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
498
281
|
name = _a.sent();
|
|
499
282
|
if (!name)
|
|
500
283
|
return [2 /*return*/];
|
|
501
|
-
|
|
502
|
-
layer = table.getAt(name);
|
|
503
|
-
if (!layer) {
|
|
504
|
-
layer = new AcDbLayerTableRecord({
|
|
505
|
-
name: name,
|
|
506
|
-
isOff: false,
|
|
507
|
-
isPlottable: true,
|
|
508
|
-
color: new AcCmColor(AcCmColorMethod.ByACI, 7),
|
|
509
|
-
linetype: 'Continuous'
|
|
510
|
-
});
|
|
511
|
-
table.add(layer);
|
|
512
|
-
}
|
|
513
|
-
layer.isOff = false;
|
|
514
|
-
this.setLayerFrozen(layer, false);
|
|
515
|
-
context.doc.database.clayer = layer.name;
|
|
284
|
+
this.layerService(context).makeLayer(name);
|
|
516
285
|
return [2 /*return*/];
|
|
517
286
|
}
|
|
518
287
|
});
|
|
519
288
|
});
|
|
520
289
|
};
|
|
521
|
-
/**
|
|
522
|
-
* Handles `On` and `Off` branches.
|
|
523
|
-
*
|
|
524
|
-
* Batch toggles visibility for selected layers. Turning off the current layer
|
|
525
|
-
* is skipped and reported as warning.
|
|
526
|
-
*
|
|
527
|
-
* @param context - Active command context.
|
|
528
|
-
* @param off - `true` for `Off`, `false` for `On`.
|
|
529
|
-
* @returns Resolves when branch execution completes.
|
|
530
|
-
*/
|
|
531
290
|
AcApLayerCmd.prototype.runOnOff = function (context, off) {
|
|
532
291
|
return __awaiter(this, void 0, void 0, function () {
|
|
533
|
-
var names,
|
|
534
|
-
return __generator(this, function (
|
|
535
|
-
switch (
|
|
292
|
+
var names, service, missing, skippedCurrent;
|
|
293
|
+
return __generator(this, function (_a) {
|
|
294
|
+
switch (_a.label) {
|
|
536
295
|
case 0: return [4 /*yield*/, this.promptLayerNames(off
|
|
537
296
|
? AcApI18n.t('jig.layer.offPrompt')
|
|
538
297
|
: AcApI18n.t('jig.layer.onPrompt'), context)];
|
|
539
298
|
case 1:
|
|
540
|
-
names =
|
|
299
|
+
names = _a.sent();
|
|
541
300
|
if (!names)
|
|
542
301
|
return [2 /*return*/];
|
|
543
|
-
|
|
544
|
-
|
|
302
|
+
service = this.layerService(context);
|
|
303
|
+
missing = service.resolveLayers(names).missing;
|
|
545
304
|
if (missing.length > 0) {
|
|
546
|
-
this.
|
|
305
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
|
|
547
306
|
}
|
|
548
|
-
skippedCurrent =
|
|
549
|
-
layers.forEach(function (layer) {
|
|
550
|
-
if (off && layer.name === db.clayer) {
|
|
551
|
-
skippedCurrent.push(layer.name);
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
layer.isOff = off;
|
|
555
|
-
});
|
|
307
|
+
skippedCurrent = service.setLayersVisibility(names, off).skippedCurrent;
|
|
556
308
|
if (skippedCurrent.length > 0) {
|
|
557
|
-
this.
|
|
309
|
+
this.showMessage(AcApI18n.t('jig.layer.cannotChangeCurrent'), 'warning');
|
|
558
310
|
}
|
|
559
311
|
return [2 /*return*/];
|
|
560
312
|
}
|
|
561
313
|
});
|
|
562
314
|
});
|
|
563
315
|
};
|
|
564
|
-
/**
|
|
565
|
-
* Handles `Freeze` and `Thaw` branches.
|
|
566
|
-
*
|
|
567
|
-
* Batch toggles frozen state using explicit bit operations. Freezing the
|
|
568
|
-
* current layer is skipped and reported as warning.
|
|
569
|
-
*
|
|
570
|
-
* @param context - Active command context.
|
|
571
|
-
* @param freeze - `true` for `Freeze`, `false` for `Thaw`.
|
|
572
|
-
* @returns Resolves when branch execution completes.
|
|
573
|
-
*/
|
|
574
316
|
AcApLayerCmd.prototype.runFreeze = function (context, freeze) {
|
|
575
317
|
return __awaiter(this, void 0, void 0, function () {
|
|
576
|
-
var names,
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
switch (_b.label) {
|
|
318
|
+
var names, service, missing, skippedCurrent;
|
|
319
|
+
return __generator(this, function (_a) {
|
|
320
|
+
switch (_a.label) {
|
|
580
321
|
case 0: return [4 /*yield*/, this.promptLayerNames(freeze
|
|
581
322
|
? AcApI18n.t('jig.layer.freezePrompt')
|
|
582
323
|
: AcApI18n.t('jig.layer.thawPrompt'), context)];
|
|
583
324
|
case 1:
|
|
584
|
-
names =
|
|
325
|
+
names = _a.sent();
|
|
585
326
|
if (!names)
|
|
586
327
|
return [2 /*return*/];
|
|
587
|
-
|
|
588
|
-
|
|
328
|
+
service = this.layerService(context);
|
|
329
|
+
missing = service.resolveLayers(names).missing;
|
|
589
330
|
if (missing.length > 0) {
|
|
590
|
-
this.
|
|
331
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
|
|
591
332
|
}
|
|
592
|
-
skippedCurrent =
|
|
593
|
-
layers.forEach(function (layer) {
|
|
594
|
-
if (freeze && layer.name === db.clayer) {
|
|
595
|
-
skippedCurrent.push(layer.name);
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
_this.setLayerFrozen(layer, freeze);
|
|
599
|
-
});
|
|
333
|
+
skippedCurrent = service.setLayersFrozen(names, freeze).skippedCurrent;
|
|
600
334
|
if (skippedCurrent.length > 0) {
|
|
601
|
-
this.
|
|
335
|
+
this.showMessage(AcApI18n.t('jig.layer.cannotChangeCurrent'), 'warning');
|
|
602
336
|
}
|
|
603
337
|
return [2 /*return*/];
|
|
604
338
|
}
|
|
605
339
|
});
|
|
606
340
|
});
|
|
607
341
|
};
|
|
608
|
-
/**
|
|
609
|
-
* Handles `Lock` and `Unlock` branches.
|
|
610
|
-
*
|
|
611
|
-
* Batch toggles lock state using explicit bit operations.
|
|
612
|
-
*
|
|
613
|
-
* @param context - Active command context.
|
|
614
|
-
* @param lock - `true` for `Lock`, `false` for `Unlock`.
|
|
615
|
-
* @returns Resolves when branch execution completes.
|
|
616
|
-
*/
|
|
617
342
|
AcApLayerCmd.prototype.runLock = function (context, lock) {
|
|
618
343
|
return __awaiter(this, void 0, void 0, function () {
|
|
619
|
-
var names,
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
switch (_b.label) {
|
|
344
|
+
var names, service, missing;
|
|
345
|
+
return __generator(this, function (_a) {
|
|
346
|
+
switch (_a.label) {
|
|
623
347
|
case 0: return [4 /*yield*/, this.promptLayerNames(lock
|
|
624
348
|
? AcApI18n.t('jig.layer.lockPrompt')
|
|
625
349
|
: AcApI18n.t('jig.layer.unlockPrompt'), context)];
|
|
626
350
|
case 1:
|
|
627
|
-
names =
|
|
351
|
+
names = _a.sent();
|
|
628
352
|
if (!names)
|
|
629
353
|
return [2 /*return*/];
|
|
630
|
-
|
|
354
|
+
service = this.layerService(context);
|
|
355
|
+
missing = service.resolveLayers(names).missing;
|
|
631
356
|
if (missing.length > 0) {
|
|
632
|
-
this.
|
|
357
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
|
|
633
358
|
}
|
|
634
|
-
|
|
359
|
+
service.setLayersLocked(names, lock);
|
|
635
360
|
return [2 /*return*/];
|
|
636
361
|
}
|
|
637
362
|
});
|
|
638
363
|
});
|
|
639
364
|
};
|
|
640
|
-
/**
|
|
641
|
-
* Parses one color input token into `AcCmColor`.
|
|
642
|
-
*
|
|
643
|
-
* Supported formats:
|
|
644
|
-
* - ACI index (`1..255`)
|
|
645
|
-
* - RGB string accepted by `AcCmColor.fromString`
|
|
646
|
-
* - CSS color names accepted by `AcCmColor.fromString`
|
|
647
|
-
*
|
|
648
|
-
* `ByLayer` and `ByBlock` are rejected for explicit layer color assignment.
|
|
649
|
-
*
|
|
650
|
-
* @param input - Raw color input string.
|
|
651
|
-
* @returns Parsed color object, or `undefined` when invalid/unsupported.
|
|
652
|
-
*/
|
|
653
|
-
AcApLayerCmd.prototype.parseColorInput = function (input) {
|
|
654
|
-
var value = input.trim();
|
|
655
|
-
if (!value)
|
|
656
|
-
return undefined;
|
|
657
|
-
if (/^\d+$/.test(value)) {
|
|
658
|
-
var index = Number(value);
|
|
659
|
-
if (index >= 1 && index <= 255) {
|
|
660
|
-
return new AcCmColor(AcCmColorMethod.ByACI, index);
|
|
661
|
-
}
|
|
662
|
-
return undefined;
|
|
663
|
-
}
|
|
664
|
-
var color = AcCmColor.fromString(value);
|
|
665
|
-
if (!color)
|
|
666
|
-
return undefined;
|
|
667
|
-
if (color.isByACI) {
|
|
668
|
-
var index = color.colorIndex;
|
|
669
|
-
if (index == null || index < 1 || index > 255) {
|
|
670
|
-
return undefined;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
if (color.isByLayer || color.isByBlock)
|
|
674
|
-
return undefined;
|
|
675
|
-
return color;
|
|
676
|
-
};
|
|
677
|
-
/**
|
|
678
|
-
* Handles the `Color` branch.
|
|
679
|
-
*
|
|
680
|
-
* Prompts target layers first, then prompts color value and applies a cloned
|
|
681
|
-
* color instance to each resolved layer.
|
|
682
|
-
*
|
|
683
|
-
* @param context - Active command context.
|
|
684
|
-
* @returns Resolves when branch execution completes.
|
|
685
|
-
*/
|
|
686
365
|
AcApLayerCmd.prototype.runColor = function (context) {
|
|
687
366
|
return __awaiter(this, void 0, void 0, function () {
|
|
688
|
-
var names, _a, layers, missing, colorPrompt, colorResult, color;
|
|
367
|
+
var names, service, _a, layers, missing, colorPrompt, colorResult, color;
|
|
689
368
|
var _b;
|
|
690
369
|
return __generator(this, function (_c) {
|
|
691
370
|
switch (_c.label) {
|
|
@@ -694,9 +373,10 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
694
373
|
names = _c.sent();
|
|
695
374
|
if (!names)
|
|
696
375
|
return [2 /*return*/];
|
|
697
|
-
|
|
376
|
+
service = this.layerService(context);
|
|
377
|
+
_a = service.resolveLayers(names), layers = _a.layers, missing = _a.missing;
|
|
698
378
|
if (missing.length > 0) {
|
|
699
|
-
this.
|
|
379
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(missing.join(', ')), 'warning');
|
|
700
380
|
}
|
|
701
381
|
if (layers.length === 0)
|
|
702
382
|
return [2 /*return*/];
|
|
@@ -707,31 +387,20 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
707
387
|
colorResult = _c.sent();
|
|
708
388
|
if (colorResult.status !== AcEdPromptStatus.OK)
|
|
709
389
|
return [2 /*return*/];
|
|
710
|
-
color =
|
|
390
|
+
color = service.parseColorInput((_b = colorResult.stringResult) !== null && _b !== void 0 ? _b : '');
|
|
711
391
|
if (!color) {
|
|
712
|
-
this.
|
|
392
|
+
this.showMessage(AcApI18n.t('jig.layer.invalidColor'), 'warning');
|
|
713
393
|
return [2 /*return*/];
|
|
714
394
|
}
|
|
715
|
-
|
|
716
|
-
layer.color = color.clone();
|
|
717
|
-
});
|
|
395
|
+
service.setLayersColor(names, color);
|
|
718
396
|
return [2 /*return*/];
|
|
719
397
|
}
|
|
720
398
|
});
|
|
721
399
|
});
|
|
722
400
|
};
|
|
723
|
-
/**
|
|
724
|
-
* Handles the `Description` branch.
|
|
725
|
-
*
|
|
726
|
-
* Updates the description text of one specified layer. Empty description is
|
|
727
|
-
* allowed and treated as clear.
|
|
728
|
-
*
|
|
729
|
-
* @param context - Active command context.
|
|
730
|
-
* @returns Resolves when branch execution completes.
|
|
731
|
-
*/
|
|
732
401
|
AcApLayerCmd.prototype.runDescription = function (context) {
|
|
733
402
|
return __awaiter(this, void 0, void 0, function () {
|
|
734
|
-
var name,
|
|
403
|
+
var name, descPrompt, result;
|
|
735
404
|
var _a;
|
|
736
405
|
return __generator(this, function (_b) {
|
|
737
406
|
switch (_b.label) {
|
|
@@ -740,11 +409,6 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
740
409
|
name = _b.sent();
|
|
741
410
|
if (!name)
|
|
742
411
|
return [2 /*return*/];
|
|
743
|
-
layer = context.doc.database.tables.layerTable.getAt(name);
|
|
744
|
-
if (!layer) {
|
|
745
|
-
this.notify("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
|
|
746
|
-
return [2 /*return*/];
|
|
747
|
-
}
|
|
748
412
|
descPrompt = new AcEdPromptStringOptions(AcApI18n.t('jig.layer.descriptionValuePrompt'));
|
|
749
413
|
descPrompt.allowSpaces = true;
|
|
750
414
|
descPrompt.allowEmpty = true;
|
|
@@ -753,13 +417,15 @@ var AcApLayerCmd = /** @class */ (function (_super) {
|
|
|
753
417
|
result = _b.sent();
|
|
754
418
|
if (result.status !== AcEdPromptStatus.OK)
|
|
755
419
|
return [2 /*return*/];
|
|
756
|
-
|
|
420
|
+
if (!this.layerService(context).setLayerDescription(name, (_a = result.stringResult) !== null && _a !== void 0 ? _a : '')) {
|
|
421
|
+
this.showMessage("".concat(AcApI18n.t('jig.layer.notFound'), ": ").concat(name), 'warning');
|
|
422
|
+
}
|
|
757
423
|
return [2 /*return*/];
|
|
758
424
|
}
|
|
759
425
|
});
|
|
760
426
|
});
|
|
761
427
|
};
|
|
762
428
|
return AcApLayerCmd;
|
|
763
|
-
}(
|
|
429
|
+
}(AcApLayerMutationCmd));
|
|
764
430
|
export { AcApLayerCmd };
|
|
765
431
|
//# sourceMappingURL=AcApLayerCmd.js.map
|