@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApContext.d.ts","sourceRoot":"","sources":["../../src/app/AcApContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AcApContext.d.ts","sourceRoot":"","sources":["../../src/app/AcApContext.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAA;AAE1D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAU7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,WAAW;IACtB,sDAAsD;IACtD,OAAO,CAAC,KAAK,CAAc;IAC3B,+CAA+C;IAC/C,OAAO,CAAC,IAAI,CAAc;IAE1B;;;;;;;;;;;OAWG;gBACS,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY;IAwFjD;;;;OAIG;IACH,IAAI,IAAI,iBAEP;IAED;;;;OAIG;IACH,IAAI,GAAG,IAAI,YAAY,CAEtB;CACF"}
|
package/lib/app/AcApContext.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { AcDbLayout, AcDbSystemVariables, AcDbSysVarManager } from '@mlightcad/data-model';
|
|
2
2
|
import { AcTrView2d } from '../view';
|
|
3
3
|
import { canApplyVisibilityOnlySceneUpdate } from './AcApEntityUpdate';
|
|
4
|
+
function asEntityList(entity) {
|
|
5
|
+
return Array.isArray(entity) ? entity : [entity];
|
|
6
|
+
}
|
|
4
7
|
/**
|
|
5
8
|
* Application context that binds a CAD document with its associated view.
|
|
6
9
|
*
|
|
@@ -43,7 +46,11 @@ var AcApContext = /** @class */ (function () {
|
|
|
43
46
|
this._doc = doc;
|
|
44
47
|
// Add entity to scene
|
|
45
48
|
doc.database.events.entityAppended.addEventListener(function (args) {
|
|
46
|
-
_this.view.
|
|
49
|
+
var pending = asEntityList(args.entity).filter(function (entity) { return !_this.view.hasEntity(entity.objectId); });
|
|
50
|
+
if (pending.length === 0) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
_this.view.addEntity(pending.length === 1 ? pending[0] : pending);
|
|
47
54
|
});
|
|
48
55
|
// Update entity
|
|
49
56
|
doc.database.events.entityModified.addEventListener(function (args) {
|
|
@@ -58,7 +65,13 @@ var AcApContext = /** @class */ (function () {
|
|
|
58
65
|
});
|
|
59
66
|
// Erase entity
|
|
60
67
|
doc.database.events.entityErased.addEventListener(function (args) {
|
|
61
|
-
|
|
68
|
+
var pending = asEntityList(args.entity).filter(function (entity) {
|
|
69
|
+
return _this.view.hasEntity(entity.objectId);
|
|
70
|
+
});
|
|
71
|
+
if (pending.length === 0) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
_this.view.removeEntity(pending.length === 1 ? pending[0] : pending);
|
|
62
75
|
});
|
|
63
76
|
// Set layer visibility
|
|
64
77
|
doc.database.events.layerAppended.addEventListener(function (args) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApContext.js","sourceRoot":"","sources":["../../src/app/AcApContext.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AcApContext.js","sourceRoot":"","sources":["../../src/app/AcApContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,uBAAuB,CAAA;AAG9B,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,EAEL,iCAAiC,EAClC,MAAM,oBAAoB,CAAA;AAE3B,SAAS,YAAY,CAAC,MAAiC;IACrD,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;AAClD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;IAME;;;;;;;;;;;OAWG;IACH,qBAAY,IAAkB,EAAE,GAAiB;QAAjD,iBAsFC;QArFC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAA;QAEf,sBAAsB;QACtB,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,UAAA,IAAI;YACtD,IAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAC9C,UAAA,MAAM,IAAI,OAAA,CAAC,KAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,EAArC,CAAqC,CAChD,CAAA;YACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACzB,OAAM;YACR,CAAC;YACD,KAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;QAClE,CAAC,CAA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AI,CAAC,MAAM,YAAY,UAAU,EAAE,CAAC;gBACtC,KAAI,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,MAAoB,CAAC,CAAA;YACjD,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,oDAAoD;QACpD,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC,UAAA,IAAI;YAC3D,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC1B,CAAC,CAAC,CAAA;QAEF,sDAAsD;QACtD,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,gBAAgB,CAAC,gBAAgB,CAAC,UAAA,IAAI;YAC7D,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC5B,CAAC,CAAC,CAAA;IACJ,CAAC;IAOD,sBAAI,6BAAI;QALR;;;;WAIG;aACH;YACE,OAAO,IAAI,CAAC,KAAK,CAAA;QACnB,CAAC;;;OAAA;IAOD,sBAAI,4BAAG;QALP;;;;WAIG;aACH;YACE,OAAO,IAAI,CAAC,IAAI,CAAA;QAClB,CAAC;;;OAAA;IACH,kBAAC;AAAD,CAAC,AA3HD,IA2HC"}
|
|
@@ -4,6 +4,7 @@ import { AcApPluginManager } from '../plugin/AcApPluginManager';
|
|
|
4
4
|
import { AcTrView2d } from '../view';
|
|
5
5
|
import { AcApContext } from './AcApContext';
|
|
6
6
|
import { AcApDocument } from './AcApDocument';
|
|
7
|
+
import { type AcApOpenDocumentDefaultsResolver } from './AcApOpenFileDialog';
|
|
7
8
|
import { AcApOpenDatabaseOptions } from './AcDbOpenDatabaseOptions';
|
|
8
9
|
/**
|
|
9
10
|
* Event arguments for document-related events.
|
|
@@ -84,6 +85,12 @@ export interface AcApDocManagerOptions {
|
|
|
84
85
|
* URLs for Web Worker JavaScript bundles used by the CAD viewer.
|
|
85
86
|
*/
|
|
86
87
|
webworkerFileUrls?: AcApWebworkerFiles;
|
|
88
|
+
/**
|
|
89
|
+
* When true, verify worker script URLs via HEAD requests after initialization.
|
|
90
|
+
* The result is exposed through {@link AcApDocManager.workersReady} and the
|
|
91
|
+
* `workersReady` event. Defaults to false.
|
|
92
|
+
*/
|
|
93
|
+
checkWorkersOnInit?: boolean;
|
|
87
94
|
/**
|
|
88
95
|
* URL of the offline HTML viewer runtime bundle (`viewer-runtime.iife.js`).
|
|
89
96
|
* Used by the HTML export plugin when packaging standalone HTML files.
|
|
@@ -159,6 +166,17 @@ export interface AcApDocManagerOptions {
|
|
|
159
166
|
* ```
|
|
160
167
|
*/
|
|
161
168
|
commandAliases?: Record<string, string | string[]>;
|
|
169
|
+
/**
|
|
170
|
+
* When false, the built-in OPEN command file picker is not installed.
|
|
171
|
+
* Defaults to true.
|
|
172
|
+
*/
|
|
173
|
+
builtinOpenFileDialog?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Default options for files opened through the built-in OPEN command dialog.
|
|
176
|
+
*
|
|
177
|
+
* Can be updated later via {@link AcApDocManager.setOpenDocumentDefaults}.
|
|
178
|
+
*/
|
|
179
|
+
openDocumentDefaults?: AcApOpenDocumentDefaultsResolver;
|
|
162
180
|
}
|
|
163
181
|
/**
|
|
164
182
|
* Document manager that handles CAD document lifecycle and provides the main entry point for the CAD viewer.
|
|
@@ -200,12 +218,20 @@ export declare class AcApDocManager {
|
|
|
200
218
|
* registering built-in and system-variable commands.
|
|
201
219
|
*/
|
|
202
220
|
private _commandAliasOverrides;
|
|
221
|
+
/** Default options for the built-in OPEN file dialog */
|
|
222
|
+
private _openDocumentDefaults?;
|
|
203
223
|
/** Peak open-file percentage for the current open operation (monotonic) */
|
|
204
224
|
private _openFileProgressPeak;
|
|
205
225
|
/** Last open-file progress stage (FETCH_FILE or CONVERSION) */
|
|
206
226
|
private _openFileProgressStage?;
|
|
207
227
|
/** Singleton instance */
|
|
208
228
|
private static _instance?;
|
|
229
|
+
/** Worker URLs configured at initialization */
|
|
230
|
+
private _webworkerFileUrls?;
|
|
231
|
+
/** Cached worker readiness; null until checked, then true or false */
|
|
232
|
+
private _workersReady;
|
|
233
|
+
/** In-flight worker readiness check */
|
|
234
|
+
private _workersReadyCheckPromise?;
|
|
209
235
|
/** Events fired during document lifecycle */
|
|
210
236
|
readonly events: {
|
|
211
237
|
/** Fired before a document starts opening */
|
|
@@ -214,6 +240,10 @@ export declare class AcApDocManager {
|
|
|
214
240
|
documentCreated: AcCmEventManager<AcDbDocumentEventArgs>;
|
|
215
241
|
/** Fired when a document becomes active */
|
|
216
242
|
documentActivated: AcCmEventManager<AcDbDocumentEventArgs>;
|
|
243
|
+
/** Fired when a worker readiness check completes */
|
|
244
|
+
workersReady: AcCmEventManager<{
|
|
245
|
+
ready: boolean;
|
|
246
|
+
}>;
|
|
217
247
|
};
|
|
218
248
|
/**
|
|
219
249
|
* Private constructor for singleton pattern.
|
|
@@ -235,6 +265,11 @@ export declare class AcApDocManager {
|
|
|
235
265
|
* @returns The singleton instance
|
|
236
266
|
*/
|
|
237
267
|
static createInstance(options?: AcApDocManagerOptions): AcApDocManager | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* Checks whether configured worker scripts are reachable without creating an
|
|
270
|
+
* {@link AcApDocManager} instance.
|
|
271
|
+
*/
|
|
272
|
+
static checkWebworkerReadiness(webworkerFileUrls?: AcApWebworkerFiles): Promise<boolean>;
|
|
238
273
|
/**
|
|
239
274
|
* Gets the singleton instance of the document manager.
|
|
240
275
|
* Throw one exception if the instance isn't created yet.
|
|
@@ -246,6 +281,19 @@ export declare class AcApDocManager {
|
|
|
246
281
|
* Destroy the view and unload all plugins
|
|
247
282
|
*/
|
|
248
283
|
destroy(): Promise<void>;
|
|
284
|
+
/**
|
|
285
|
+
* Last worker readiness result for this manager, or null if not checked yet.
|
|
286
|
+
*/
|
|
287
|
+
get workersReady(): boolean | null;
|
|
288
|
+
/**
|
|
289
|
+
* Returns true when all configured worker files are reachable.
|
|
290
|
+
*
|
|
291
|
+
* Uses HEAD requests internally. A successful result is cached on this
|
|
292
|
+
* instance for fast subsequent calls; failures update {@link workersReady}
|
|
293
|
+
* to false but can be retried. The underlying URL probe does not cache
|
|
294
|
+
* failures, so transient network errors can recover on a later call.
|
|
295
|
+
*/
|
|
296
|
+
areWorkersReady(): Promise<boolean>;
|
|
249
297
|
/**
|
|
250
298
|
* Gets the current application context.
|
|
251
299
|
*
|
|
@@ -412,6 +460,14 @@ export declare class AcApDocManager {
|
|
|
412
460
|
* ```
|
|
413
461
|
*/
|
|
414
462
|
openDocument(fileName: string, content: ArrayBuffer, options: AcApOpenDatabaseOptions): Promise<boolean>;
|
|
463
|
+
/**
|
|
464
|
+
* Sets default options applied when opening files through the built-in OPEN dialog.
|
|
465
|
+
*/
|
|
466
|
+
setOpenDocumentDefaults(defaults?: AcApOpenDocumentDefaultsResolver): void;
|
|
467
|
+
/**
|
|
468
|
+
* Resolves default open options for the built-in OPEN file dialog.
|
|
469
|
+
*/
|
|
470
|
+
resolveOpenDocumentDefaults(): AcApOpenDatabaseOptions | Promise<AcApOpenDatabaseOptions>;
|
|
415
471
|
/**
|
|
416
472
|
* Redraws the current view. Currently it is used once you modified font mapping
|
|
417
473
|
* for missed fonts so that the drawing can apply new fonts.
|
|
@@ -583,6 +639,13 @@ export declare class AcApDocManager {
|
|
|
583
639
|
* When callers omit `mode`, document open APIs default to read mode.
|
|
584
640
|
*/
|
|
585
641
|
private getDocumentEventMode;
|
|
642
|
+
/**
|
|
643
|
+
* Resolves how the view is framed when a document finishes opening.
|
|
644
|
+
*
|
|
645
|
+
* Explicit `openViewMode` wins; otherwise Read/Review zoom to the drawing and
|
|
646
|
+
* Write restores AutoCAD's saved view.
|
|
647
|
+
*/
|
|
648
|
+
private resolveOpenViewMode;
|
|
586
649
|
/**
|
|
587
650
|
* Shows a spinner overlay without text (e.g. HTML export).
|
|
588
651
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AcApDocManager.d.ts","sourceRoot":"","sources":["../../src/app/AcApDocManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAQjB,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"AcApDocManager.d.ts","sourceRoot":"","sources":["../../src/app/AcApDocManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAQjB,MAAM,uBAAuB,CAAA;AAmE9B,OAAO,EAEL,WAAW,EACX,gBAAgB,EAChB,YAAY,EAEb,MAAM,WAAW,CAAA;AAElB,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,OAAO,EAEL,KAAK,gCAAgC,EAGtC,MAAM,sBAAsB,CAAA;AAO7B,OAAO,EACL,uBAAuB,EAExB,MAAM,2BAA2B,CAAA;AAoDlC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,yCAAyC;IACzC,GAAG,EAAE,YAAY,CAAA;IACjB,2DAA2D;IAC3D,IAAI,EAAE,YAAY,CAAA;CACnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAExB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;IAExB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,GAAG,CAAA;CAC3B;AAKD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;OAEG;IACH,SAAS,CAAC,EAAE,WAAW,CAAA;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH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IAOrC;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,gBAAgB;IAkHxB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,2BAA2B;IA2BnC;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,qBAAqB;IAoB7B;;;;;;;;;;;;;;;;;OAiBG;IACH,mBAAmB,CAAC,MAAM,EAAE,MAAM;IAQlC;;;;;;;OAOG;YACW,oBAAoB;IAuClC;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;;;;OAKG;IACH,eAAe;IAOf;;;;;;;OAOG;IACH,SAAS,CAAC,oBAAoB,CAAC,OAAO,CAAC,EAAE,uBAAuB;IAWhE;;;;;;;;;OASG;IACH,SAAS,CAAC,mBAAmB,CAC3B,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE,uBAAuB;IA0FnC;;;;;;;;;;OAUG;IACH,OAAO,CAAC,UAAU;IAqBlB;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAI5B;;;;;OAKG;IACH,OAAO,CAAC,mBAAmB;IAY3B;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAKzB;;OAEG;IACH,iBAAiB,IAAI,IAAI;IAIzB;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAK7B;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;IAoBjC;;;OAGG;IACH,OAAO,CAAC,cAAc;IAmBtB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,kBAAkB;IAkC1B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,eAAe;IASvB;;;;;;;;OAQG;YACW,WAAW;CAwD1B"}
|
|
@@ -70,11 +70,12 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
70
70
|
}
|
|
71
71
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
72
72
|
};
|
|
73
|
-
import { AcCmEventManager, AcDbDatabaseConverterManager,
|
|
73
|
+
import { AcCmEventManager, AcDbDatabaseConverterManager, AcDbFileType, acdbHostApplicationServices, AcDbSysVarManager, AcGeBox2d, log } from '@mlightcad/data-model';
|
|
74
|
+
import { AcDbDxfConverter } from '@mlightcad/dxf-json-converter';
|
|
74
75
|
import { AcDbLibreDwgConverter } from '@mlightcad/libredwg-converter';
|
|
75
76
|
import { FontManager } from '@mlightcad/mtext-renderer';
|
|
76
77
|
import { AcTrMTextRenderer } from '@mlightcad/three-renderer';
|
|
77
|
-
import { AcApArcCmd, AcApCircleCmd, AcApClearMeasurementsCmd, AcApConvertToDxfCmd, AcApConvertToPngCmd, AcApCopyCmd, AcApDimLinearCmd, AcApEllipseCmd, AcApEraseCmd, AcApHatchCmd, AcApHideObjectsCmd, AcApLayerCloseCmd, AcApLayerCmd, AcApLayerCurCmd, AcApLayerDelCmd, AcApLayerFreezeCmd, AcApLayerIsoCmd, AcApLayerLockCmd, AcApLayerOnCmd, AcApLayerPCmd, AcApLayerThawCmd, AcApLayerUnisoCmd, AcApLayerUnlockCmd, AcApLayoffCmd, AcApLineCmd, AcApLogCmd, AcApMeasureAngleCmd, AcApMeasureArcCmd, AcApMeasureAreaCmd, AcApMeasureDistanceCmd, AcApMLineCmd, AcApMoveCmd, AcApMTextCmd, AcApOffsetCmd, AcApOpenCmd, AcApPanCmd, AcApPointCmd, AcApPolygonCmd, AcApPolylineCmd, AcApQNewCmd, AcApRayCmd, AcApRectCmd, AcApRegenCmd, AcApRevCircleCmd, AcApRevCloudCmd, AcApRevRectCmd, AcApRevVisibilityCmd, AcApRotateCmd, AcApSelectCmd, AcApSketchCmd, AcApSplineCmd, AcApSwitchBgCmd, AcApSysVarCmd, AcApUnisolateObjectsCmd, AcApXLineCmd, AcApZoomCmd } from '../command';
|
|
78
|
+
import { AcApArcCmd, AcApCacheFontCmd, AcApCircleCmd, AcApClearMeasurementsCmd, AcApConvertToDxfCmd, AcApConvertToPngCmd, AcApCopyCmd, AcApDimLinearCmd, AcApEllipseCmd, AcApEraseCmd, AcApHatchCmd, AcApHideObjectsCmd, AcApLayerCloseCmd, AcApLayerCmd, AcApLayerCurCmd, AcApLayerDelCmd, AcApLayerFreezeCmd, AcApLayerIsoCmd, AcApLayerLockCmd, AcApLayerOnCmd, AcApLayerPCmd, AcApLayerThawCmd, AcApLayerUnisoCmd, AcApLayerUnlockCmd, AcApLayoffCmd, AcApLineCmd, AcApLogCmd, AcApMeasureAngleCmd, AcApMeasureArcCmd, AcApMeasureAreaCmd, AcApMeasureDistanceCmd, AcApMLineCmd, AcApMoveCmd, AcApMTextCmd, AcApOffsetCmd, AcApOpenCmd, AcApPanCmd, AcApPointCmd, AcApPolygonCmd, AcApPolylineCmd, AcApQNewCmd, AcApRayCmd, AcApRectCmd, AcApRedoCmd, AcApRegenCmd, AcApRevCircleCmd, AcApRevCloudCmd, AcApRevRectCmd, AcApRevVisibilityCmd, AcApRotateCmd, AcApSelectCmd, AcApSketchCmd, AcApSplineCmd, AcApSwitchBgCmd, AcApSysVarCmd, AcApUndoCmd, AcApUnisolateObjectsCmd, AcApXLineCmd, AcApZoomCmd } from '../command';
|
|
78
79
|
import { AcEdCommandStack, AcEdOpenMode, eventBus } from '../editor';
|
|
79
80
|
import { AcApI18n } from '../i18n';
|
|
80
81
|
import { AcApPluginManager } from '../plugin/AcApPluginManager';
|
|
@@ -82,7 +83,10 @@ import { AcTrView2d } from '../view';
|
|
|
82
83
|
import { AcApContext } from './AcApContext';
|
|
83
84
|
import { AcApDocument } from './AcApDocument';
|
|
84
85
|
import { AcApFontLoader } from './AcApFontLoader';
|
|
86
|
+
import { acapInstallOpenFileDialog, acapUninstallOpenFileDialog, acapUpdateOpenFileDialogOptions } from './AcApOpenFileDialog';
|
|
85
87
|
import { AcApProgress } from './AcApProgress';
|
|
88
|
+
import { checkWebworkerReadiness, DEFAULT_WEBWORKER_FILE_URLS, resetWebworkerReadinessCache } from './AcApWebworkerReadiness';
|
|
89
|
+
import { AcApOpenViewMode } from './AcDbOpenDatabaseOptions';
|
|
86
90
|
import { isOpenFileProgressComplete } from './openFileProgress';
|
|
87
91
|
var DEFAULT_BASE_URL = 'https://cdn.jsdelivr.net/gh/mlightcad/cad-data';
|
|
88
92
|
/**
|
|
@@ -128,7 +132,9 @@ var DEFAULT_COMMAND_ALIASES = {
|
|
|
128
132
|
SELECT: ['SE'],
|
|
129
133
|
SPLINE: ['SPL'],
|
|
130
134
|
XLINE: ['XL'],
|
|
131
|
-
ZOOM: ['Z']
|
|
135
|
+
ZOOM: ['Z'],
|
|
136
|
+
UNDO: ['U'],
|
|
137
|
+
REDO: ['REDO']
|
|
132
138
|
};
|
|
133
139
|
/** AutoCAD-era default font fallback chain used when glyphs are missing. */
|
|
134
140
|
var DEFAULT_FONTS_PRESET = 'modern';
|
|
@@ -160,6 +166,8 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
160
166
|
var _a, _b, _c, _d;
|
|
161
167
|
/** Peak open-file percentage for the current open operation (monotonic) */
|
|
162
168
|
this._openFileProgressPeak = 0;
|
|
169
|
+
/** Cached worker readiness; null until checked, then true or false */
|
|
170
|
+
this._workersReady = null;
|
|
163
171
|
/** Events fired during document lifecycle */
|
|
164
172
|
this.events = {
|
|
165
173
|
/** Fired before a document starts opening */
|
|
@@ -167,11 +175,14 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
167
175
|
/** Fired when a new document is created */
|
|
168
176
|
documentCreated: new AcCmEventManager(),
|
|
169
177
|
/** Fired when a document becomes active */
|
|
170
|
-
documentActivated: new AcCmEventManager()
|
|
178
|
+
documentActivated: new AcCmEventManager(),
|
|
179
|
+
/** Fired when a worker readiness check completes */
|
|
180
|
+
workersReady: new AcCmEventManager()
|
|
171
181
|
};
|
|
172
182
|
this._baseUrl = (_a = options.baseUrl) !== null && _a !== void 0 ? _a : DEFAULT_BASE_URL;
|
|
173
183
|
this._htmlViewerRuntimeUrl = options.htmlViewerRuntimeUrl;
|
|
174
184
|
this._commandAliasOverrides = this.normalizeCommandAliasConfig(options.commandAliases);
|
|
185
|
+
this._openDocumentDefaults = options.openDocumentDefaults;
|
|
175
186
|
if (options.useMainThreadDraw) {
|
|
176
187
|
AcTrMTextRenderer.getInstance().setRenderMode('main');
|
|
177
188
|
}
|
|
@@ -210,10 +221,17 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
210
221
|
var callback = function () {
|
|
211
222
|
var _a, _b, _c, _d, _e;
|
|
212
223
|
if (options.autoResize) {
|
|
224
|
+
var container = options.container;
|
|
225
|
+
if (container) {
|
|
226
|
+
return {
|
|
227
|
+
width: Math.max(1, Math.floor(container.clientWidth)),
|
|
228
|
+
height: Math.max(1, Math.floor(container.clientHeight))
|
|
229
|
+
};
|
|
230
|
+
}
|
|
213
231
|
var box = (_a = options.container) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
|
214
232
|
return {
|
|
215
|
-
width: (_b = box === null || box === void 0 ? void 0 : box.width) !== null && _b !== void 0 ? _b : initialSize.width,
|
|
216
|
-
height: (_c = box === null || box === void 0 ? void 0 : box.height) !== null && _c !== void 0 ? _c : initialSize.height
|
|
233
|
+
width: Math.max(1, Math.floor((_b = box === null || box === void 0 ? void 0 : box.width) !== null && _b !== void 0 ? _b : initialSize.width)),
|
|
234
|
+
height: Math.max(1, Math.floor((_c = box === null || box === void 0 ? void 0 : box.height) !== null && _c !== void 0 ? _c : initialSize.height))
|
|
217
235
|
};
|
|
218
236
|
}
|
|
219
237
|
else {
|
|
@@ -242,11 +260,19 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
242
260
|
if (!options.notLoadDefaultFonts) {
|
|
243
261
|
this.loadDefaultFonts();
|
|
244
262
|
}
|
|
263
|
+
this._webworkerFileUrls = options.webworkerFileUrls;
|
|
245
264
|
this.registerWorkers(options.webworkerFileUrls);
|
|
265
|
+
if (options.checkWorkersOnInit) {
|
|
266
|
+
void this.areWorkersReady();
|
|
267
|
+
}
|
|
246
268
|
// Load plugins asynchronously (don't await to avoid blocking initialization)
|
|
247
269
|
this.loadPlugins(options.plugins).catch(function (error) {
|
|
248
270
|
log.error('[AcApDocManager] Error loading plugins:', error);
|
|
249
271
|
});
|
|
272
|
+
acapInstallOpenFileDialog({
|
|
273
|
+
enabled: options.builtinOpenFileDialog !== false,
|
|
274
|
+
getOpenDocumentDefaults: function () { return _this.resolveOpenDocumentDefaults(); }
|
|
275
|
+
});
|
|
250
276
|
}
|
|
251
277
|
/**
|
|
252
278
|
* Creates the singleton instance with an optional canvas element.
|
|
@@ -264,6 +290,13 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
264
290
|
}
|
|
265
291
|
return this._instance;
|
|
266
292
|
};
|
|
293
|
+
/**
|
|
294
|
+
* Checks whether configured worker scripts are reachable without creating an
|
|
295
|
+
* {@link AcApDocManager} instance.
|
|
296
|
+
*/
|
|
297
|
+
AcApDocManager.checkWebworkerReadiness = function (webworkerFileUrls) {
|
|
298
|
+
return checkWebworkerReadiness(webworkerFileUrls);
|
|
299
|
+
};
|
|
267
300
|
Object.defineProperty(AcApDocManager, "instance", {
|
|
268
301
|
/**
|
|
269
302
|
* Gets the singleton instance of the document manager.
|
|
@@ -290,12 +323,56 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
290
323
|
case 0: return [4 /*yield*/, this._pluginManager.unloadAllPlugins()];
|
|
291
324
|
case 1:
|
|
292
325
|
_a.sent();
|
|
326
|
+
this.context.doc.destroy();
|
|
327
|
+
acapUninstallOpenFileDialog();
|
|
328
|
+
AcTrMTextRenderer.resetInstance();
|
|
329
|
+
resetWebworkerReadinessCache();
|
|
293
330
|
AcApDocManager._instance = undefined;
|
|
294
331
|
return [2 /*return*/];
|
|
295
332
|
}
|
|
296
333
|
});
|
|
297
334
|
});
|
|
298
335
|
};
|
|
336
|
+
Object.defineProperty(AcApDocManager.prototype, "workersReady", {
|
|
337
|
+
/**
|
|
338
|
+
* Last worker readiness result for this manager, or null if not checked yet.
|
|
339
|
+
*/
|
|
340
|
+
get: function () {
|
|
341
|
+
return this._workersReady;
|
|
342
|
+
},
|
|
343
|
+
enumerable: false,
|
|
344
|
+
configurable: true
|
|
345
|
+
});
|
|
346
|
+
/**
|
|
347
|
+
* Returns true when all configured worker files are reachable.
|
|
348
|
+
*
|
|
349
|
+
* Uses HEAD requests internally. A successful result is cached on this
|
|
350
|
+
* instance for fast subsequent calls; failures update {@link workersReady}
|
|
351
|
+
* to false but can be retried. The underlying URL probe does not cache
|
|
352
|
+
* failures, so transient network errors can recover on a later call.
|
|
353
|
+
*/
|
|
354
|
+
AcApDocManager.prototype.areWorkersReady = function () {
|
|
355
|
+
var _this = this;
|
|
356
|
+
if (this._workersReady === true) {
|
|
357
|
+
return Promise.resolve(true);
|
|
358
|
+
}
|
|
359
|
+
if (!this._workersReadyCheckPromise) {
|
|
360
|
+
this._workersReadyCheckPromise = checkWebworkerReadiness(this._webworkerFileUrls)
|
|
361
|
+
.then(function (ready) {
|
|
362
|
+
_this._workersReady = ready;
|
|
363
|
+
_this._workersReadyCheckPromise = undefined;
|
|
364
|
+
_this.events.workersReady.dispatch({ ready: ready });
|
|
365
|
+
return ready;
|
|
366
|
+
})
|
|
367
|
+
.catch(function () {
|
|
368
|
+
_this._workersReady = false;
|
|
369
|
+
_this._workersReadyCheckPromise = undefined;
|
|
370
|
+
_this.events.workersReady.dispatch({ ready: false });
|
|
371
|
+
return false;
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
return this._workersReadyCheckPromise;
|
|
375
|
+
};
|
|
299
376
|
Object.defineProperty(AcApDocManager.prototype, "context", {
|
|
300
377
|
/**
|
|
301
378
|
* Gets the current application context.
|
|
@@ -604,6 +681,30 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
604
681
|
});
|
|
605
682
|
});
|
|
606
683
|
};
|
|
684
|
+
/**
|
|
685
|
+
* Sets default options applied when opening files through the built-in OPEN dialog.
|
|
686
|
+
*/
|
|
687
|
+
AcApDocManager.prototype.setOpenDocumentDefaults = function (defaults) {
|
|
688
|
+
var _this = this;
|
|
689
|
+
this._openDocumentDefaults = defaults;
|
|
690
|
+
acapUpdateOpenFileDialogOptions({
|
|
691
|
+
enabled: true,
|
|
692
|
+
getOpenDocumentDefaults: function () { return _this.resolveOpenDocumentDefaults(); }
|
|
693
|
+
});
|
|
694
|
+
};
|
|
695
|
+
/**
|
|
696
|
+
* Resolves default open options for the built-in OPEN file dialog.
|
|
697
|
+
*/
|
|
698
|
+
AcApDocManager.prototype.resolveOpenDocumentDefaults = function () {
|
|
699
|
+
var defaults = this._openDocumentDefaults;
|
|
700
|
+
if (defaults == null) {
|
|
701
|
+
return { minimumChunkSize: 1000 };
|
|
702
|
+
}
|
|
703
|
+
if (typeof defaults === 'function') {
|
|
704
|
+
return defaults();
|
|
705
|
+
}
|
|
706
|
+
return defaults;
|
|
707
|
+
};
|
|
607
708
|
/**
|
|
608
709
|
* Redraws the current view. Currently it is used once you modified font mapping
|
|
609
710
|
* for missed fonts so that the drawing can apply new fonts.
|
|
@@ -695,6 +796,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
695
796
|
register.addCommand(AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME, cmdGlobalName, cmdLocalName, cmd, _this.resolveCommandAliases(cmdGlobalName, defaults));
|
|
696
797
|
};
|
|
697
798
|
addSystemCommand('arc', 'arc', new AcApArcCmd());
|
|
799
|
+
addSystemCommand('cachefont', 'cachefont', new AcApCacheFontCmd());
|
|
698
800
|
addSystemCommand('circle', 'circle', new AcApCircleCmd());
|
|
699
801
|
addSystemCommand('cdxf', 'cdxf', new AcApConvertToDxfCmd());
|
|
700
802
|
addSystemCommand('pngout', 'pngout', new AcApConvertToPngCmd());
|
|
@@ -748,6 +850,8 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
748
850
|
addSystemCommand('switchbg', 'switchbg', new AcApSwitchBgCmd());
|
|
749
851
|
addSystemCommand('unisolateobjects', 'unisolateobjects', new AcApUnisolateObjectsCmd());
|
|
750
852
|
addSystemCommand('xline', 'xline', new AcApXLineCmd());
|
|
853
|
+
addSystemCommand('undo', 'undo', new AcApUndoCmd());
|
|
854
|
+
addSystemCommand('redo', 'redo', new AcApRedoCmd());
|
|
751
855
|
addSystemCommand('zoom', 'zoom', new AcApZoomCmd());
|
|
752
856
|
// Register system variables as commands
|
|
753
857
|
var sysVars = AcDbSysVarManager.instance().getAllDescriptors();
|
|
@@ -937,10 +1041,14 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
937
1041
|
* @protected
|
|
938
1042
|
*/
|
|
939
1043
|
AcApDocManager.prototype.onBeforeOpenDocument = function (options) {
|
|
1044
|
+
var _a;
|
|
940
1045
|
this.events.documentToBeOpened.dispatch({
|
|
941
1046
|
doc: this.context.doc,
|
|
942
1047
|
mode: this.getDocumentEventMode(options)
|
|
943
1048
|
});
|
|
1049
|
+
this.curView.bindDrawDatabase(this.context.doc.database);
|
|
1050
|
+
this.curView.progressiveRendering =
|
|
1051
|
+
(_a = options === null || options === void 0 ? void 0 : options.progressiveRendering) !== null && _a !== void 0 ? _a : false;
|
|
944
1052
|
this.curView.clear();
|
|
945
1053
|
};
|
|
946
1054
|
/**
|
|
@@ -954,7 +1062,9 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
954
1062
|
* @protected
|
|
955
1063
|
*/
|
|
956
1064
|
AcApDocManager.prototype.onAfterOpenDocument = function (isSuccess, options) {
|
|
1065
|
+
var _a;
|
|
957
1066
|
if (isSuccess) {
|
|
1067
|
+
this.context.doc.destroy();
|
|
958
1068
|
var doc = this.context.doc;
|
|
959
1069
|
this.events.documentActivated.dispatch({
|
|
960
1070
|
doc: doc,
|
|
@@ -963,7 +1073,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
963
1073
|
this.setActiveLayout();
|
|
964
1074
|
this.curView.syncDisplaySysVars(doc.database);
|
|
965
1075
|
var db = doc.database;
|
|
966
|
-
//
|
|
1076
|
+
// View framing at document open time (see `openViewMode`):
|
|
967
1077
|
//
|
|
968
1078
|
// 1. **Paper space + has LIMMIN/LIMMAX**: frame the authoritative
|
|
969
1079
|
// paper sheet rectangle (`AcDbLayout.limits`). Real-world DWGs
|
|
@@ -973,8 +1083,15 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
973
1083
|
// dominated by the largest-scale outliers and shrinks the
|
|
974
1084
|
// actual paper to a grain.
|
|
975
1085
|
//
|
|
976
|
-
// 2. **
|
|
977
|
-
// geometry bounds once entities land.
|
|
1086
|
+
// 2. **Extents** (Read/Review default): poll `zoomToFitDrawing`
|
|
1087
|
+
// and frame batch-derived geometry bounds once entities land.
|
|
1088
|
+
//
|
|
1089
|
+
// 3. **Saved** (Write default) in model space: restore VPORT
|
|
1090
|
+
// `*ACTIVE`, then frame EXTMIN/EXTMAX when no saved view exists.
|
|
1091
|
+
//
|
|
1092
|
+
// 4. **Fallback** (paper without limits, or model with empty
|
|
1093
|
+
// extents — typically DXF): poll `zoomToFitDrawing` and frame
|
|
1094
|
+
// the populated layout bounding box once entities land.
|
|
978
1095
|
//
|
|
979
1096
|
// The pre-fix code used `db.extmin/db.extmax` (always model-space
|
|
980
1097
|
// EXTMIN/EXTMAX sysvars) even when opening into paper, landing on
|
|
@@ -986,11 +1103,43 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
986
1103
|
var isPaperSpaceActive = db.currentSpaceId !== modelSpaceId;
|
|
987
1104
|
var activeLayout = acdbHostApplicationServices().layoutManager.getActiveLayout(db);
|
|
988
1105
|
var layoutLimits = activeLayout === null || activeLayout === void 0 ? void 0 : activeLayout.limits;
|
|
1106
|
+
var openViewMode = this.resolveOpenViewMode(options);
|
|
1107
|
+
var view = this.curView;
|
|
1108
|
+
var progressiveRendering = (_a = options === null || options === void 0 ? void 0 : options.progressiveRendering) !== null && _a !== void 0 ? _a : false;
|
|
989
1109
|
if (isPaperSpaceActive && layoutLimits && !layoutLimits.isEmpty()) {
|
|
990
|
-
|
|
1110
|
+
view.zoomTo(layoutLimits);
|
|
1111
|
+
}
|
|
1112
|
+
else if (openViewMode === AcApOpenViewMode.Extents) {
|
|
1113
|
+
if (progressiveRendering) {
|
|
1114
|
+
view.beginProgressiveOpenFit();
|
|
1115
|
+
}
|
|
1116
|
+
view.zoomToFitDrawing();
|
|
1117
|
+
}
|
|
1118
|
+
else if (!isPaperSpaceActive) {
|
|
1119
|
+
var canvasAspect = view.width / Math.max(view.height, 1);
|
|
1120
|
+
var vport = db.tables.viewportTable.getActiveVport();
|
|
1121
|
+
// Restore AutoCAD's saved *ACTIVE view without EXTMIN/EXTMAX heuristics.
|
|
1122
|
+
// Many real drawings store a valid saved view far from $EXTMIN/$EXTMAX
|
|
1123
|
+
// (e.g. title-block extents vs. model content at large coordinates).
|
|
1124
|
+
var activeModelViewBox = vport === null || vport === void 0 ? void 0 : vport.modelViewBox(canvasAspect);
|
|
1125
|
+
if (activeModelViewBox) {
|
|
1126
|
+
view.zoomTo(activeModelViewBox);
|
|
1127
|
+
}
|
|
1128
|
+
else if (!db.extents.isEmpty()) {
|
|
1129
|
+
view.zoomTo(new AcGeBox2d(db.extmin, db.extmax));
|
|
1130
|
+
}
|
|
1131
|
+
else {
|
|
1132
|
+
if (progressiveRendering) {
|
|
1133
|
+
view.beginProgressiveOpenFit();
|
|
1134
|
+
}
|
|
1135
|
+
view.zoomToFitDrawing();
|
|
1136
|
+
}
|
|
991
1137
|
}
|
|
992
1138
|
else {
|
|
993
|
-
|
|
1139
|
+
if (progressiveRendering) {
|
|
1140
|
+
view.beginProgressiveOpenFit();
|
|
1141
|
+
}
|
|
1142
|
+
view.zoomToFitDrawing();
|
|
994
1143
|
}
|
|
995
1144
|
// Tell the view we've already framed the startup layout, so that
|
|
996
1145
|
// when the user later switches to a different tab and back, the
|
|
@@ -1015,10 +1164,22 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1015
1164
|
*/
|
|
1016
1165
|
AcApDocManager.prototype.setOptions = function (options) {
|
|
1017
1166
|
if (options == null) {
|
|
1018
|
-
options = {
|
|
1167
|
+
options = {
|
|
1168
|
+
fontLoader: this._fontLoader,
|
|
1169
|
+
drawNoPlotLayers: false,
|
|
1170
|
+
progressiveRendering: false
|
|
1171
|
+
};
|
|
1019
1172
|
}
|
|
1020
|
-
else
|
|
1021
|
-
options.fontLoader
|
|
1173
|
+
else {
|
|
1174
|
+
if (options.fontLoader == null) {
|
|
1175
|
+
options.fontLoader = this._fontLoader;
|
|
1176
|
+
}
|
|
1177
|
+
if (options.drawNoPlotLayers == null) {
|
|
1178
|
+
options.drawNoPlotLayers = false;
|
|
1179
|
+
}
|
|
1180
|
+
if (options.progressiveRendering == null) {
|
|
1181
|
+
options.progressiveRendering = false;
|
|
1182
|
+
}
|
|
1022
1183
|
}
|
|
1023
1184
|
return options;
|
|
1024
1185
|
};
|
|
@@ -1031,6 +1192,21 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1031
1192
|
var _a;
|
|
1032
1193
|
return (_a = options === null || options === void 0 ? void 0 : options.mode) !== null && _a !== void 0 ? _a : AcEdOpenMode.Read;
|
|
1033
1194
|
};
|
|
1195
|
+
/**
|
|
1196
|
+
* Resolves how the view is framed when a document finishes opening.
|
|
1197
|
+
*
|
|
1198
|
+
* Explicit `openViewMode` wins; otherwise Read/Review zoom to the drawing and
|
|
1199
|
+
* Write restores AutoCAD's saved view.
|
|
1200
|
+
*/
|
|
1201
|
+
AcApDocManager.prototype.resolveOpenViewMode = function (options) {
|
|
1202
|
+
if ((options === null || options === void 0 ? void 0 : options.openViewMode) != null) {
|
|
1203
|
+
return options.openViewMode;
|
|
1204
|
+
}
|
|
1205
|
+
var mode = this.getDocumentEventMode(options);
|
|
1206
|
+
return mode === AcEdOpenMode.Write
|
|
1207
|
+
? AcApOpenViewMode.Saved
|
|
1208
|
+
: AcApOpenViewMode.Extents;
|
|
1209
|
+
};
|
|
1034
1210
|
/**
|
|
1035
1211
|
* Shows a spinner overlay without text (e.g. HTML export).
|
|
1036
1212
|
*/
|
|
@@ -1104,14 +1280,13 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1104
1280
|
* even if one or more converters fail to register.
|
|
1105
1281
|
*/
|
|
1106
1282
|
AcApDocManager.prototype.registerConverters = function (webworkerFileUrls) {
|
|
1283
|
+
var _a, _b;
|
|
1107
1284
|
// Register DXF converter
|
|
1108
1285
|
try {
|
|
1109
1286
|
var converter = new AcDbDxfConverter({
|
|
1110
1287
|
convertByEntityType: false,
|
|
1111
1288
|
useWorker: true,
|
|
1112
|
-
parserWorkerUrl: webworkerFileUrls
|
|
1113
|
-
? webworkerFileUrls.dxfParser
|
|
1114
|
-
: './assets/dxf-parser-worker.js'
|
|
1289
|
+
parserWorkerUrl: (_a = webworkerFileUrls === null || webworkerFileUrls === void 0 ? void 0 : webworkerFileUrls.dxfParser) !== null && _a !== void 0 ? _a : DEFAULT_WEBWORKER_FILE_URLS.dxfParser
|
|
1115
1290
|
});
|
|
1116
1291
|
AcDbDatabaseConverterManager.instance.register(AcDbFileType.DXF, converter);
|
|
1117
1292
|
}
|
|
@@ -1123,9 +1298,7 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1123
1298
|
var converter = new AcDbLibreDwgConverter({
|
|
1124
1299
|
convertByEntityType: false,
|
|
1125
1300
|
useWorker: true,
|
|
1126
|
-
parserWorkerUrl: webworkerFileUrls
|
|
1127
|
-
? webworkerFileUrls.dwgParser
|
|
1128
|
-
: './assets/libredwg-parser-worker.js'
|
|
1301
|
+
parserWorkerUrl: (_b = webworkerFileUrls === null || webworkerFileUrls === void 0 ? void 0 : webworkerFileUrls.dwgParser) !== null && _b !== void 0 ? _b : DEFAULT_WEBWORKER_FILE_URLS.dwgParser
|
|
1129
1302
|
});
|
|
1130
1303
|
AcDbDatabaseConverterManager.instance.register(AcDbFileType.DWG, converter);
|
|
1131
1304
|
}
|
|
@@ -1146,11 +1319,10 @@ var AcApDocManager = /** @class */ (function () {
|
|
|
1146
1319
|
* initialization are handled inside the respective registration routines.
|
|
1147
1320
|
*/
|
|
1148
1321
|
AcApDocManager.prototype.registerWorkers = function (webworkerFileUrls) {
|
|
1322
|
+
var _a;
|
|
1149
1323
|
this.registerConverters(webworkerFileUrls);
|
|
1150
1324
|
var mtextRenderer = AcTrMTextRenderer.getInstance();
|
|
1151
|
-
mtextRenderer.initialize(webworkerFileUrls
|
|
1152
|
-
? webworkerFileUrls.mtextRender
|
|
1153
|
-
: './assets/mtext-renderer-worker.js');
|
|
1325
|
+
mtextRenderer.initialize((_a = webworkerFileUrls === null || webworkerFileUrls === void 0 ? void 0 : webworkerFileUrls.mtextRender) !== null && _a !== void 0 ? _a : DEFAULT_WEBWORKER_FILE_URLS.mtextRender);
|
|
1154
1326
|
void mtextRenderer.setDefaultFonts(DEFAULT_FONTS_PRESET);
|
|
1155
1327
|
};
|
|
1156
1328
|
/**
|