@mlightcad/cad-simple-viewer 1.5.6 → 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/README.md +66 -1
- package/dist/cad-simple-viewer.js +30394 -28405
- package/dist/cad-simple-viewer.umd.cjs +150 -158
- package/dist/dxf-parser-worker.js +796 -707
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +15 -5
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +56 -0
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +112 -14
- 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/index.d.ts +3 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +2 -0
- package/lib/app/index.js.map +1 -1
- package/lib/command/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/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/draw/AcApEllipseCmd.d.ts.map +1 -1
- package/lib/command/draw/AcApEllipseCmd.js +12 -4
- package/lib/command/draw/AcApEllipseCmd.js.map +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 +2 -0
- package/lib/command/draw/AcApMLineCmd.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/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/index.d.ts +2 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +2 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/layer/AcApLayerCmd.d.ts +3 -187
- package/lib/command/layer/AcApLayerCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCmd.js +52 -376
- package/lib/command/layer/AcApLayerCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.d.ts +2 -27
- package/lib/command/layer/AcApLayerCurCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerCurCmd.js +18 -67
- package/lib/command/layer/AcApLayerCurCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.d.ts +2 -25
- package/lib/command/layer/AcApLayerDelCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerDelCmd.js +22 -155
- package/lib/command/layer/AcApLayerDelCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts +2 -9
- package/lib/command/layer/AcApLayerFreezeCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerFreezeCmd.js +27 -39
- package/lib/command/layer/AcApLayerFreezeCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.d.ts +2 -24
- package/lib/command/layer/AcApLayerIsoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerIsoCmd.js +14 -183
- package/lib/command/layer/AcApLayerIsoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.d.ts +2 -33
- package/lib/command/layer/AcApLayerLockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerLockCmd.js +18 -55
- 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 -2
- package/lib/command/layer/AcApLayerOffCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOffCmd.js +27 -28
- package/lib/command/layer/AcApLayerOffCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.d.ts +2 -15
- package/lib/command/layer/AcApLayerOnCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerOnCmd.js +6 -49
- package/lib/command/layer/AcApLayerOnCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.d.ts +2 -68
- package/lib/command/layer/AcApLayerPCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerPCmd.js +4 -152
- package/lib/command/layer/AcApLayerPCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.d.ts +2 -22
- package/lib/command/layer/AcApLayerThawCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerThawCmd.js +6 -61
- package/lib/command/layer/AcApLayerThawCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts +2 -37
- package/lib/command/layer/AcApLayerUnisoCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnisoCmd.js +7 -108
- package/lib/command/layer/AcApLayerUnisoCmd.js.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts +2 -33
- package/lib/command/layer/AcApLayerUnlockCmd.d.ts.map +1 -1
- package/lib/command/layer/AcApLayerUnlockCmd.js +18 -55
- 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 +0 -7
- 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 +5 -33
- 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 +37 -200
- 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/editor/command/AcEdCommand.d.ts +8 -0
- package/lib/editor/command/AcEdCommand.d.ts.map +1 -1
- package/lib/editor/command/AcEdCommand.js +48 -5
- package/lib/editor/command/AcEdCommand.js.map +1 -1
- package/lib/editor/global/eventBus.d.ts +10 -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.map +1 -1
- package/lib/editor/grip/AcEdGripEditSession.js +9 -2
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
- package/lib/editor/grip/AcEdGripHandle.d.ts +3 -2
- package/lib/editor/grip/AcEdGripHandle.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripHandle.js +9 -6
- package/lib/editor/grip/AcEdGripHandle.js.map +1 -1
- package/lib/editor/grip/AcEdGripManager.d.ts +13 -1
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripManager.js +54 -14
- package/lib/editor/grip/AcEdGripManager.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/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/index.d.ts +2 -0
- package/lib/editor/input/index.d.ts.map +1 -1
- package/lib/editor/input/index.js +2 -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/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/view/AcEdBaseView.d.ts +37 -2
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +14 -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 +23 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +23 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +23 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +23 -0
- package/lib/i18n/zh/command.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/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 +21 -6
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +56 -10
- 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/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/AcTrGroupWcsBboxAssert.d.ts +16 -0
- package/lib/view/AcTrGroupWcsBboxAssert.d.ts.map +1 -1
- package/lib/view/AcTrGroupWcsBboxAssert.js +19 -0
- package/lib/view/AcTrGroupWcsBboxAssert.js.map +1 -1
- 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 +26 -2
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +64 -0
- 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 +36 -1
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +160 -14
- package/lib/view/AcTrLayout.js.map +1 -1
- 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 +50 -53
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +195 -312
- 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 +7 -7
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerLockCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerLockCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"AcApLayerLockCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerLockCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH;IAAsC,oCAAoB;IACxD;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC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R,KAAK,iBAAiB;oBACpB,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,eAAK,MAAM,CAAC,SAAS,CAAE,EAChE,SAAS,CACV,CAAA;oBACD,OAAM;gBACR,KAAK,gBAAgB;oBACnB,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,eAAK,MAAM,CAAC,SAAS,CAAE,EAChE,MAAM,CACP,CAAA;oBACD,OAAM;YACV,CAAC;QACH,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;QACjC,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,eAAK,MAAM,CAAC,SAAS,CAAE,EACzD,SAAS,CACV,CAAA;IACH,CAAC;IACH,uBAAC;AAAD,CAAC,AA5DD,CAAsC,oBAAoB,GA4DzD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AcApContext } from '../../app';
|
|
2
|
+
import { AcEdCommand } from '../../editor';
|
|
3
|
+
/**
|
|
4
|
+
* Base class for commands that mutate the layer table.
|
|
5
|
+
*
|
|
6
|
+
* Overrides undo recording so layer changes are undoable even in Write mode.
|
|
7
|
+
* Captures layer state before execution so {@link AcApLayerPCmd} can restore it.
|
|
8
|
+
*/
|
|
9
|
+
export declare abstract class AcApLayerMutationCmd extends AcEdCommand {
|
|
10
|
+
protected shouldRecordUndoStack(_context: AcApContext): boolean;
|
|
11
|
+
protected onCommandWillStart(context: AcApContext): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=AcApLayerMutationCmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLayerMutationCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerMutationCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAK1C;;;;;GAKG;AACH,8BAAsB,oBAAqB,SAAQ,WAAW;IAC5D,SAAS,CAAC,qBAAqB,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO;IAI/D,SAAS,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;CAMzD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
import { AcEdCommand } from '../../editor';
|
|
17
|
+
/** Global command name for `LAYERP`; excluded from pre-operation capture. */
|
|
18
|
+
var LAYERP_COMMAND_NAME = 'layerp';
|
|
19
|
+
/**
|
|
20
|
+
* Base class for commands that mutate the layer table.
|
|
21
|
+
*
|
|
22
|
+
* Overrides undo recording so layer changes are undoable even in Write mode.
|
|
23
|
+
* Captures layer state before execution so {@link AcApLayerPCmd} can restore it.
|
|
24
|
+
*/
|
|
25
|
+
var AcApLayerMutationCmd = /** @class */ (function (_super) {
|
|
26
|
+
__extends(AcApLayerMutationCmd, _super);
|
|
27
|
+
function AcApLayerMutationCmd() {
|
|
28
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
29
|
+
}
|
|
30
|
+
AcApLayerMutationCmd.prototype.shouldRecordUndoStack = function (_context) {
|
|
31
|
+
return this.recordsUndoStack;
|
|
32
|
+
};
|
|
33
|
+
AcApLayerMutationCmd.prototype.onCommandWillStart = function (context) {
|
|
34
|
+
if (this.globalName.toLowerCase() === LAYERP_COMMAND_NAME) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
context.doc.captureLayerPreviousState();
|
|
38
|
+
};
|
|
39
|
+
return AcApLayerMutationCmd;
|
|
40
|
+
}(AcEdCommand));
|
|
41
|
+
export { AcApLayerMutationCmd };
|
|
42
|
+
//# sourceMappingURL=AcApLayerMutationCmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApLayerMutationCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerMutationCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE1C,6EAA6E;AAC7E,IAAM,mBAAmB,GAAG,QAAQ,CAAA;AAEpC;;;;;GAKG;AACH;IAAmD,wCAAW;IAA9D;;IAWA,CAAC;IAVW,oDAAqB,GAA/B,UAAgC,QAAqB;QACnD,OAAO,IAAI,CAAC,gBAAgB,CAAA;IAC9B,CAAC;IAES,iDAAkB,GAA5B,UAA6B,OAAoB;QAC/C,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,KAAK,mBAAmB,EAAE,CAAC;YAC1D,OAAM;QACR,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,CAAA;IACzC,CAAC;IACH,2BAAC;AAAD,CAAC,AAXD,CAAmD,WAAW,GAW7D"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AcApContext } from '../../app';
|
|
2
|
-
import {
|
|
2
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
3
3
|
/**
|
|
4
4
|
* AutoCAD-like `LAYOFF` command.
|
|
5
5
|
*
|
|
@@ -13,7 +13,7 @@ import { AcEdCommand } from '../../editor';
|
|
|
13
13
|
* selection setting is stored for future use but does not currently change
|
|
14
14
|
* the resolved target layer.
|
|
15
15
|
*/
|
|
16
|
-
export declare class AcApLayoffCmd extends
|
|
16
|
+
export declare class AcApLayoffCmd extends AcApLayerMutationCmd {
|
|
17
17
|
private static _settings;
|
|
18
18
|
private _history;
|
|
19
19
|
private _vpfreezeHintShown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerOffCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOffCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApLayerOffCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOffCmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAkB,MAAM,WAAW,CAAA;AASvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AA2E7D;;;;;;;;;;;;GAYG;AACH,qBAAa,aAAc,SAAQ,oBAAoB;IACrD,OAAO,CAAC,MAAM,CAAC,SAAS,CAA0C;IAElE,OAAO,CAAC,QAAQ,CAA2B;IAC3C,OAAO,CAAC,kBAAkB,CAAQ;IAElC;;OAEG;;IAMH;;;;;;;;OAQG;IACG,OAAO,CAAC,OAAO,EAAE,WAAW;IAsBlC;;;;;OAKG;IACH,OAAO,CAAC,UAAU;IAoBlB;;;;OAIG;YACW,eAAe;IA8B7B;;;;OAIG;YACW,WAAW;IAwBzB;;;;;;;OAOG;YACW,kBAAkB;IAmChC;;;;;;;OAOG;YACW,wBAAwB;IAuCtC;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAmD1B;;;;OAIG;IACH,OAAO,CAAC,OAAO;CAsBhB"}
|
|
@@ -61,8 +61,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
63
|
import { AcApDocManager } from '../../app';
|
|
64
|
-
import {
|
|
64
|
+
import { AcEdOpenMode, AcEdPromptEntityOptions, AcEdPromptKeywordOptions, AcEdPromptStatus } from '../../editor';
|
|
65
65
|
import { AcApI18n } from '../../i18n';
|
|
66
|
+
import { AcApLayerService } from '../../service';
|
|
67
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
66
68
|
var DEFAULT_SETTINGS = {
|
|
67
69
|
viewportMode: 'Off',
|
|
68
70
|
blockSelectionMode: 'None'
|
|
@@ -314,24 +316,23 @@ var AcApLayoffCmd = /** @class */ (function (_super) {
|
|
|
314
316
|
*/
|
|
315
317
|
AcApLayoffCmd.prototype.turnOffEntityLayer = function (context, objectId) {
|
|
316
318
|
var _a;
|
|
317
|
-
var
|
|
318
|
-
var
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
this.showMessage("".concat(AcApI18n.t('jig.layoff.alreadyOff'), ": ").concat(layer.name), 'info');
|
|
319
|
+
var service = new AcApLayerService(context.doc.database);
|
|
320
|
+
var result = service.turnOffLayerByEntity(objectId);
|
|
321
|
+
if (!result.ok) {
|
|
322
|
+
switch (result.reason) {
|
|
323
|
+
case 'invalid_selection':
|
|
324
|
+
this.showMessage(AcApI18n.t('jig.layoff.invalidSelection'), 'warning');
|
|
325
|
+
return;
|
|
326
|
+
case 'layer_not_found':
|
|
327
|
+
this.showMessage("".concat(AcApI18n.t('jig.layoff.layerNotFound'), ": ").concat(result.layerName), 'warning');
|
|
328
|
+
return;
|
|
329
|
+
case 'cannot_change_current':
|
|
330
|
+
this.showMessage(AcApI18n.t('jig.layoff.cannotTurnOffCurrent'), 'warning');
|
|
331
|
+
return;
|
|
332
|
+
case 'already_off':
|
|
333
|
+
this.showMessage("".concat(AcApI18n.t('jig.layoff.alreadyOff'), ": ").concat(result.layerName), 'info');
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
335
336
|
return;
|
|
336
337
|
}
|
|
337
338
|
if (AcApLayoffCmd._settings.viewportMode === 'Vpfreeze' &&
|
|
@@ -340,12 +341,11 @@ var AcApLayoffCmd = /** @class */ (function (_super) {
|
|
|
340
341
|
this._vpfreezeHintShown = true;
|
|
341
342
|
}
|
|
342
343
|
this._history.push({
|
|
343
|
-
layerName:
|
|
344
|
-
wasOff:
|
|
344
|
+
layerName: result.layerName,
|
|
345
|
+
wasOff: (_a = result.previousOff) !== null && _a !== void 0 ? _a : false
|
|
345
346
|
});
|
|
346
|
-
layer.isOff = true;
|
|
347
347
|
context.view.selectionSet.clear();
|
|
348
|
-
this.showMessage("".concat(AcApI18n.t('jig.layoff.turnedOff'), ": ").concat(
|
|
348
|
+
this.showMessage("".concat(AcApI18n.t('jig.layoff.turnedOff'), ": ").concat(result.layerName), 'success');
|
|
349
349
|
};
|
|
350
350
|
/**
|
|
351
351
|
* Restores the most recently changed layer-off state captured during this run.
|
|
@@ -358,17 +358,16 @@ var AcApLayoffCmd = /** @class */ (function (_super) {
|
|
|
358
358
|
this.showMessage(AcApI18n.t('jig.layoff.nothingToUndo'), 'warning');
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
|
-
var
|
|
362
|
-
if (!
|
|
361
|
+
var service = new AcApLayerService(context.doc.database);
|
|
362
|
+
if (!service.setLayerOffByName(history.layerName, history.wasOff)) {
|
|
363
363
|
this.showMessage("".concat(AcApI18n.t('jig.layoff.layerNotFound'), ": ").concat(history.layerName), 'warning');
|
|
364
364
|
return;
|
|
365
365
|
}
|
|
366
|
-
layer.isOff = history.wasOff;
|
|
367
366
|
context.view.selectionSet.clear();
|
|
368
|
-
this.showMessage("".concat(AcApI18n.t('jig.layoff.restored'), ": ").concat(
|
|
367
|
+
this.showMessage("".concat(AcApI18n.t('jig.layoff.restored'), ": ").concat(history.layerName), 'success');
|
|
369
368
|
};
|
|
370
369
|
AcApLayoffCmd._settings = __assign({}, DEFAULT_SETTINGS);
|
|
371
370
|
return AcApLayoffCmd;
|
|
372
|
-
}(
|
|
371
|
+
}(AcApLayerMutationCmd));
|
|
373
372
|
export { AcApLayoffCmd };
|
|
374
373
|
//# sourceMappingURL=AcApLayerOffCmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerOffCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOffCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"AcApLayerOffCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOffCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAA;AACvD,OAAO,EACL,YAAY,EACZ,uBAAuB,EACvB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAsE7D,IAAM,gBAAgB,GAAmB;IACvC,YAAY,EAAE,KAAK;IACnB,kBAAkB,EAAE,MAAM;CAC3B,CAAA;AAED;;;;;;;;;;;;GAYG;AACH;IAAmC,iCAAoB;IAMrD;;OAEG;IACH;QACE,YAAA,MAAK,WAAE,SAAA;QAPD,cAAQ,GAAyB,EAAE,CAA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E,SAAS,CAAC,CAAA;YACnE,OAAM;QACR,CAAC;QAED,IAAM,OAAO,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;QAC1D,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;YAClE,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,eAAK,OAAO,CAAC,SAAS,CAAE,EACjE,SAAS,CACV,CAAA;YACD,OAAM;QACR,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;QACjC,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,eAAK,OAAO,CAAC,SAAS,CAAE,EAC5D,SAAS,CACV,CAAA;IACH,CAAC;IAtTc,uBAAS,gBAAwB,gBAAgB,CAAxC,CAA0C;IAuTpE,oBAAC;CAAA,AAxTD,CAAmC,oBAAoB,GAwTtD;SAxTY,aAAa"}
|
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
import { AcApContext } from '../../app';
|
|
2
|
-
import {
|
|
2
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
3
3
|
/**
|
|
4
4
|
* AutoCAD-like `LAYON` command.
|
|
5
|
-
*
|
|
6
|
-
* The command turns on every layer in the current drawing by clearing the
|
|
7
|
-
* layer-off flag. Frozen layers remain frozen, which matches the AutoCAD
|
|
8
|
-
* command's responsibility of restoring only off layers.
|
|
9
5
|
*/
|
|
10
|
-
export declare class AcApLayerOnCmd extends
|
|
11
|
-
/**
|
|
12
|
-
* Creates a write-enabled `LAYON` command instance.
|
|
13
|
-
*/
|
|
6
|
+
export declare class AcApLayerOnCmd extends AcApLayerMutationCmd {
|
|
14
7
|
constructor();
|
|
15
|
-
/**
|
|
16
|
-
* Runs the turn-on-all-layers workflow.
|
|
17
|
-
*
|
|
18
|
-
* @param context - Active application context used to update the current drawing.
|
|
19
|
-
* @returns Resolves when all layer states have been processed.
|
|
20
|
-
*/
|
|
21
8
|
execute(context: AcApContext): Promise<void>;
|
|
22
9
|
}
|
|
23
10
|
//# sourceMappingURL=AcApLayerOnCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerOnCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOnCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApLayerOnCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOnCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAIvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH,qBAAa,cAAe,SAAQ,oBAAoB;;IAMhD,OAAO,CAAC,OAAO,EAAE,WAAW;CAcnC"}
|
|
@@ -49,68 +49,25 @@ 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
|
-
|
|
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 { AcEdCommand, AcEdOpenMode } from '../../editor';
|
|
52
|
+
import { AcEdOpenMode } from '../../editor';
|
|
78
53
|
import { AcApI18n } from '../../i18n';
|
|
54
|
+
import { AcApLayerService } from '../../service';
|
|
55
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
79
56
|
/**
|
|
80
57
|
* AutoCAD-like `LAYON` command.
|
|
81
|
-
*
|
|
82
|
-
* The command turns on every layer in the current drawing by clearing the
|
|
83
|
-
* layer-off flag. Frozen layers remain frozen, which matches the AutoCAD
|
|
84
|
-
* command's responsibility of restoring only off layers.
|
|
85
58
|
*/
|
|
86
59
|
var AcApLayerOnCmd = /** @class */ (function (_super) {
|
|
87
60
|
__extends(AcApLayerOnCmd, _super);
|
|
88
|
-
/**
|
|
89
|
-
* Creates a write-enabled `LAYON` command instance.
|
|
90
|
-
*/
|
|
91
61
|
function AcApLayerOnCmd() {
|
|
92
62
|
var _this = _super.call(this) || this;
|
|
93
63
|
_this.mode = AcEdOpenMode.Write;
|
|
94
64
|
return _this;
|
|
95
65
|
}
|
|
96
|
-
/**
|
|
97
|
-
* Runs the turn-on-all-layers workflow.
|
|
98
|
-
*
|
|
99
|
-
* @param context - Active application context used to update the current drawing.
|
|
100
|
-
* @returns Resolves when all layer states have been processed.
|
|
101
|
-
*/
|
|
102
66
|
AcApLayerOnCmd.prototype.execute = function (context) {
|
|
103
67
|
return __awaiter(this, void 0, void 0, function () {
|
|
104
|
-
var
|
|
68
|
+
var turnedOn;
|
|
105
69
|
return __generator(this, function (_a) {
|
|
106
|
-
|
|
107
|
-
turnedOn = 0;
|
|
108
|
-
layers.forEach(function (layer) {
|
|
109
|
-
if (!layer.isOff)
|
|
110
|
-
return;
|
|
111
|
-
layer.isOff = false;
|
|
112
|
-
turnedOn++;
|
|
113
|
-
});
|
|
70
|
+
turnedOn = new AcApLayerService(context.doc.database).setAllLayersOn();
|
|
114
71
|
context.view.selectionSet.clear();
|
|
115
72
|
if (turnedOn === 0) {
|
|
116
73
|
this.showMessage(AcApI18n.t('jig.layon.alreadyOn'));
|
|
@@ -122,6 +79,6 @@ var AcApLayerOnCmd = /** @class */ (function (_super) {
|
|
|
122
79
|
});
|
|
123
80
|
};
|
|
124
81
|
return AcApLayerOnCmd;
|
|
125
|
-
}(
|
|
82
|
+
}(AcApLayerMutationCmd));
|
|
126
83
|
export { AcApLayerOnCmd };
|
|
127
84
|
//# sourceMappingURL=AcApLayerOnCmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerOnCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOnCmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApLayerOnCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerOnCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH;IAAoC,kCAAoB;IACtD;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC,CAAC;IAEK,gCAAO,GAAb,UAAc,OAAoB;;;;gBAC1B,QAAQ,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,cAAc,EAAE,CAAA;gBAC5E,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;gBAEjC,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;oBACnB,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAA;oBACnD,sBAAM;gBACR,CAAC;gBAED,IAAI,CAAC,WAAW,CACd,UAAG,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,eAAK,QAAQ,CAAE,EAClD,SAAS,CACV,CAAA;;;;KACF;IACH,qBAAC;AAAD,CAAC,AApBD,CAAoC,oBAAoB,GAoBvD"}
|
|
@@ -1,76 +1,10 @@
|
|
|
1
1
|
import { AcApContext } from '../../app';
|
|
2
|
-
import {
|
|
3
|
-
/**
|
|
4
|
-
* Global store for layer state snapshots to support LAYERP command.
|
|
5
|
-
*/
|
|
6
|
-
declare class AcApLayerPreviousStateManager {
|
|
7
|
-
private previousSnapshot;
|
|
8
|
-
/**
|
|
9
|
-
* Captures the current layer state.
|
|
10
|
-
* @param context - Active application context
|
|
11
|
-
*/
|
|
12
|
-
captureState(context: AcApContext): void;
|
|
13
|
-
/**
|
|
14
|
-
* Restores the previous layer state.
|
|
15
|
-
* @param context - Active application context
|
|
16
|
-
* @returns true if restoration was successful
|
|
17
|
-
*/
|
|
18
|
-
restorePreviousState(context: AcApContext): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Clears the previous state snapshot.
|
|
21
|
-
*/
|
|
22
|
-
clearPreviousState(): void;
|
|
23
|
-
/**
|
|
24
|
-
* Checks if a layer is locked.
|
|
25
|
-
* @param layer - Layer table record
|
|
26
|
-
*/
|
|
27
|
-
private isLayerLocked;
|
|
28
|
-
/**
|
|
29
|
-
* Sets or clears the locked bit in layer flags.
|
|
30
|
-
* @param layer - Layer table record
|
|
31
|
-
* @param locked - Whether the layer should be locked
|
|
32
|
-
*/
|
|
33
|
-
private setLayerLocked;
|
|
34
|
-
/**
|
|
35
|
-
* Sets or clears the frozen bit in layer flags.
|
|
36
|
-
* @param layer - Layer table record
|
|
37
|
-
* @param frozen - Whether the layer should be frozen
|
|
38
|
-
*/
|
|
39
|
-
private setLayerFrozen;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Exposes layer previous state manager for external use.
|
|
43
|
-
*/
|
|
44
|
-
export declare function getLayerPreviousStateManager(): AcApLayerPreviousStateManager;
|
|
2
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
45
3
|
/**
|
|
46
4
|
* AutoCAD-like `LAYERP` command.
|
|
47
|
-
*
|
|
48
|
-
* The command restores the layer state to what it was before the last
|
|
49
|
-
* layer-modifying operation. This includes changes to layer on/off,
|
|
50
|
-
* freeze/thaw, and lock/unlock states.
|
|
51
|
-
*
|
|
52
|
-
* Note: This is a simplified implementation that tracks one previous state.
|
|
53
|
-
* A full implementation would maintain a stack of states.
|
|
54
5
|
*/
|
|
55
|
-
export declare class AcApLayerPCmd extends
|
|
56
|
-
/**
|
|
57
|
-
* Creates a write-enabled `LAYERP` command instance.
|
|
58
|
-
*/
|
|
6
|
+
export declare class AcApLayerPCmd extends AcApLayerMutationCmd {
|
|
59
7
|
constructor();
|
|
60
|
-
/**
|
|
61
|
-
* Runs the restore-previous-layer-state workflow.
|
|
62
|
-
*
|
|
63
|
-
* @param context - Active application context used to update the current drawing.
|
|
64
|
-
* @returns Resolves when the restoration is complete or if there is nothing to restore.
|
|
65
|
-
*/
|
|
66
8
|
execute(context: AcApContext): Promise<void>;
|
|
67
9
|
}
|
|
68
|
-
/**
|
|
69
|
-
* Captures layer state before executing a layer-modifying command.
|
|
70
|
-
* Should be called before executing commands like LAYOFF, LAYFRZ, LAYLCK, etc.
|
|
71
|
-
*
|
|
72
|
-
* @param context - Active application context
|
|
73
|
-
*/
|
|
74
|
-
export declare function captureLayerStateBeforeOperation(context: AcApContext): void;
|
|
75
|
-
export {};
|
|
76
10
|
//# sourceMappingURL=AcApLayerPCmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerPCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerPCmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApLayerPCmd.d.ts","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerPCmd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAGvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH,qBAAa,aAAc,SAAQ,oBAAoB;;IAM/C,OAAO,CAAC,OAAO,EAAE,WAAW;CASnC"}
|
|
@@ -49,162 +49,23 @@ 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
|
-
|
|
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 { AcEdCommand, AcEdOpenMode } from '../../editor';
|
|
52
|
+
import { AcEdOpenMode } from '../../editor';
|
|
78
53
|
import { AcApI18n } from '../../i18n';
|
|
79
|
-
|
|
80
|
-
* Global store for layer state snapshots to support LAYERP command.
|
|
81
|
-
*/
|
|
82
|
-
var AcApLayerPreviousStateManager = /** @class */ (function () {
|
|
83
|
-
function AcApLayerPreviousStateManager() {
|
|
84
|
-
this.previousSnapshot = null;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Captures the current layer state.
|
|
88
|
-
* @param context - Active application context
|
|
89
|
-
*/
|
|
90
|
-
AcApLayerPreviousStateManager.prototype.captureState = function (context) {
|
|
91
|
-
var _this = this;
|
|
92
|
-
var db = context.doc.database;
|
|
93
|
-
this.previousSnapshot = {
|
|
94
|
-
clayer: db.clayer,
|
|
95
|
-
states: __spreadArray([], __read(db.tables.layerTable.newIterator()), false).map(function (layer) { return ({
|
|
96
|
-
name: layer.name,
|
|
97
|
-
isOn: !layer.isOff,
|
|
98
|
-
isFrozen: layer.isFrozen,
|
|
99
|
-
isLocked: _this.isLayerLocked(layer)
|
|
100
|
-
}); })
|
|
101
|
-
};
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* Restores the previous layer state.
|
|
105
|
-
* @param context - Active application context
|
|
106
|
-
* @returns true if restoration was successful
|
|
107
|
-
*/
|
|
108
|
-
AcApLayerPreviousStateManager.prototype.restorePreviousState = function (context) {
|
|
109
|
-
var _this = this;
|
|
110
|
-
if (!this.previousSnapshot) {
|
|
111
|
-
return false;
|
|
112
|
-
}
|
|
113
|
-
var db = context.doc.database;
|
|
114
|
-
var snapshot = this.previousSnapshot;
|
|
115
|
-
// Apply layer state changes
|
|
116
|
-
snapshot.states.forEach(function (state) {
|
|
117
|
-
var layer = db.tables.layerTable.getAt(state.name);
|
|
118
|
-
if (!layer)
|
|
119
|
-
return;
|
|
120
|
-
layer.isOff = !state.isOn;
|
|
121
|
-
_this.setLayerFrozen(layer, state.isFrozen);
|
|
122
|
-
_this.setLayerLocked(layer, state.isLocked);
|
|
123
|
-
});
|
|
124
|
-
// Restore current layer
|
|
125
|
-
var currentLayer = db.tables.layerTable.getAt(snapshot.clayer);
|
|
126
|
-
if (currentLayer) {
|
|
127
|
-
currentLayer.isOff = false;
|
|
128
|
-
this.setLayerFrozen(currentLayer, false);
|
|
129
|
-
db.clayer = currentLayer.name;
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
return false;
|
|
133
|
-
};
|
|
134
|
-
/**
|
|
135
|
-
* Clears the previous state snapshot.
|
|
136
|
-
*/
|
|
137
|
-
AcApLayerPreviousStateManager.prototype.clearPreviousState = function () {
|
|
138
|
-
this.previousSnapshot = null;
|
|
139
|
-
};
|
|
140
|
-
/**
|
|
141
|
-
* Checks if a layer is locked.
|
|
142
|
-
* @param layer - Layer table record
|
|
143
|
-
*/
|
|
144
|
-
AcApLayerPreviousStateManager.prototype.isLayerLocked = function (layer) {
|
|
145
|
-
var _a;
|
|
146
|
-
return (((_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0) & 0x04) !== 0;
|
|
147
|
-
};
|
|
148
|
-
/**
|
|
149
|
-
* Sets or clears the locked bit in layer flags.
|
|
150
|
-
* @param layer - Layer table record
|
|
151
|
-
* @param locked - Whether the layer should be locked
|
|
152
|
-
*/
|
|
153
|
-
AcApLayerPreviousStateManager.prototype.setLayerLocked = function (layer, locked) {
|
|
154
|
-
var _a;
|
|
155
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
156
|
-
layer.standardFlags = locked ? flags | 0x04 : flags & ~0x04;
|
|
157
|
-
};
|
|
158
|
-
/**
|
|
159
|
-
* Sets or clears the frozen bit in layer flags.
|
|
160
|
-
* @param layer - Layer table record
|
|
161
|
-
* @param frozen - Whether the layer should be frozen
|
|
162
|
-
*/
|
|
163
|
-
AcApLayerPreviousStateManager.prototype.setLayerFrozen = function (layer, frozen) {
|
|
164
|
-
var _a;
|
|
165
|
-
var flags = (_a = layer.standardFlags) !== null && _a !== void 0 ? _a : 0;
|
|
166
|
-
layer.standardFlags = frozen ? flags | 0x01 : flags & ~0x01;
|
|
167
|
-
};
|
|
168
|
-
return AcApLayerPreviousStateManager;
|
|
169
|
-
}());
|
|
170
|
-
// Global instance
|
|
171
|
-
var layerPreviousStateManager = new AcApLayerPreviousStateManager();
|
|
172
|
-
/**
|
|
173
|
-
* Exposes layer previous state manager for external use.
|
|
174
|
-
*/
|
|
175
|
-
export function getLayerPreviousStateManager() {
|
|
176
|
-
return layerPreviousStateManager;
|
|
177
|
-
}
|
|
54
|
+
import { AcApLayerMutationCmd } from './AcApLayerMutationCmd';
|
|
178
55
|
/**
|
|
179
56
|
* AutoCAD-like `LAYERP` command.
|
|
180
|
-
*
|
|
181
|
-
* The command restores the layer state to what it was before the last
|
|
182
|
-
* layer-modifying operation. This includes changes to layer on/off,
|
|
183
|
-
* freeze/thaw, and lock/unlock states.
|
|
184
|
-
*
|
|
185
|
-
* Note: This is a simplified implementation that tracks one previous state.
|
|
186
|
-
* A full implementation would maintain a stack of states.
|
|
187
57
|
*/
|
|
188
58
|
var AcApLayerPCmd = /** @class */ (function (_super) {
|
|
189
59
|
__extends(AcApLayerPCmd, _super);
|
|
190
|
-
/**
|
|
191
|
-
* Creates a write-enabled `LAYERP` command instance.
|
|
192
|
-
*/
|
|
193
60
|
function AcApLayerPCmd() {
|
|
194
61
|
var _this = _super.call(this) || this;
|
|
195
62
|
_this.mode = AcEdOpenMode.Write;
|
|
196
63
|
return _this;
|
|
197
64
|
}
|
|
198
|
-
/**
|
|
199
|
-
* Runs the restore-previous-layer-state workflow.
|
|
200
|
-
*
|
|
201
|
-
* @param context - Active application context used to update the current drawing.
|
|
202
|
-
* @returns Resolves when the restoration is complete or if there is nothing to restore.
|
|
203
|
-
*/
|
|
204
65
|
AcApLayerPCmd.prototype.execute = function (context) {
|
|
205
66
|
return __awaiter(this, void 0, void 0, function () {
|
|
206
67
|
return __generator(this, function (_a) {
|
|
207
|
-
if (
|
|
68
|
+
if (context.doc.restoreLayerPreviousState()) {
|
|
208
69
|
this.showMessage(AcApI18n.t('jig.layerp.restored'), 'success');
|
|
209
70
|
}
|
|
210
71
|
else {
|
|
@@ -216,15 +77,6 @@ var AcApLayerPCmd = /** @class */ (function (_super) {
|
|
|
216
77
|
});
|
|
217
78
|
};
|
|
218
79
|
return AcApLayerPCmd;
|
|
219
|
-
}(
|
|
80
|
+
}(AcApLayerMutationCmd));
|
|
220
81
|
export { AcApLayerPCmd };
|
|
221
|
-
/**
|
|
222
|
-
* Captures layer state before executing a layer-modifying command.
|
|
223
|
-
* Should be called before executing commands like LAYOFF, LAYFRZ, LAYLCK, etc.
|
|
224
|
-
*
|
|
225
|
-
* @param context - Active application context
|
|
226
|
-
*/
|
|
227
|
-
export function captureLayerStateBeforeOperation(context) {
|
|
228
|
-
layerPreviousStateManager.captureState(context);
|
|
229
|
-
}
|
|
230
82
|
//# sourceMappingURL=AcApLayerPCmd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApLayerPCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerPCmd.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApLayerPCmd.js","sourceRoot":"","sources":["../../../src/command/layer/AcApLayerPCmd.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAE7D;;GAEG;AACH;IAAmC,iCAAoB;IACrD;QACE,YAAA,MAAK,WAAE,SAAA;QACP,KAAI,CAAC,IAAI,GAAG,YAAY,CAAC,KAAK,CAAA;;IAChC,CAAC;IAEK,+BAAO,GAAb,UAAc,OAAoB;;;gBAChC,IAAI,OAAO,CAAC,GAAG,CAAC,yBAAyB,EAAE,EAAE,CAAC;oBAC5C,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,qBAAqB,CAAC,EAAE,SAAS,CAAC,CAAA;gBAChE,CAAC;qBAAM,CAAC;oBACN,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAA;gBAC5D,CAAC;gBAED,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAA;;;;KAClC;IACH,oBAAC;AAAD,CAAC,AAfD,CAAmC,oBAAoB,GAetD"}
|