@mlightcad/cad-simple-viewer 1.8.0-preview.3 → 1.8.0-preview.4
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 +21 -21
- package/README.md +206 -204
- package/dist/cad-simple-viewer-AcApSimpleUiChrome-D_0b6okm.js +890 -0
- package/dist/cad-simple-viewer-AcApSimpleUiChrome-DcZiBNvh.js +1 -0
- package/dist/cad-simple-viewer-AcUiFileOpenSession-AGSCe0Nv.js +324 -0
- package/dist/{cad-simple-viewer-AcUiFileOpenSession-BCcqBAH9.js → cad-simple-viewer-AcUiFileOpenSession-Bo3U3wCu.js} +707 -167
- package/dist/cad-simple-viewer-file-open-panel.js +26 -24
- package/dist/cad-simple-viewer-file-open-panel.umd.cjs +1 -1
- package/dist/cad-simple-viewer.js +64409 -41558
- package/dist/cad-simple-viewer.umd.cjs +1659 -497
- package/dist/mtext-renderer-worker.js +4 -5
- package/file-open-panel.ts +6 -6
- package/icons.ts +7 -7
- package/lib/app/AcApClipboard.d.ts +97 -0
- package/lib/app/AcApClipboard.d.ts.map +1 -0
- package/lib/app/AcApClipboard.js +270 -0
- package/lib/app/AcApClipboard.js.map +1 -0
- package/lib/app/AcApContext.d.ts +10 -0
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +24 -8
- 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 +264 -35
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +11 -11
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApOpenFileDialog.d.ts +2 -2
- package/lib/app/AcApOpenFileDialog.js +2 -2
- package/lib/app/AcApPaletteService.d.ts +154 -0
- package/lib/app/AcApPaletteService.d.ts.map +1 -0
- package/lib/app/AcApPaletteService.js +327 -0
- package/lib/app/AcApPaletteService.js.map +1 -0
- package/lib/app/acapHealModelLayoutLink.d.ts +30 -0
- package/lib/app/acapHealModelLayoutLink.d.ts.map +1 -0
- package/lib/app/acapHealModelLayoutLink.js +192 -0
- package/lib/app/acapHealModelLayoutLink.js.map +1 -0
- package/lib/app/dataSource/AcApLocalDataSource.d.ts +1 -1
- package/lib/app/dataSource/AcApLocalDataSource.js +2 -2
- package/lib/app/dataSource/AcApLocalDataSource.js.map +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.js +1 -1
- package/lib/app/dataSource/AcApUrlDataSource.js.map +1 -1
- package/lib/app/index.d.ts +2 -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/AcApShortCutToolbarDocBind.d.ts.map +1 -1
- package/lib/command/AcApShortCutToolbarDocBind.js +30 -3
- package/lib/command/AcApShortCutToolbarDocBind.js.map +1 -1
- package/lib/command/AcApUcsCmd.d.ts +26 -0
- package/lib/command/AcApUcsCmd.d.ts.map +1 -0
- package/lib/command/AcApUcsCmd.js +545 -0
- package/lib/command/AcApUcsCmd.js.map +1 -0
- package/lib/command/AcApViewRestoreCmd.d.ts +13 -0
- package/lib/command/AcApViewRestoreCmd.d.ts.map +1 -0
- package/lib/command/AcApViewRestoreCmd.js +101 -0
- package/lib/command/AcApViewRestoreCmd.js.map +1 -0
- package/lib/command/block/AcApDashBSearchCmd.d.ts +57 -0
- package/lib/command/block/AcApDashBSearchCmd.d.ts.map +1 -0
- package/lib/command/block/AcApDashBSearchCmd.js +618 -0
- package/lib/command/block/AcApDashBSearchCmd.js.map +1 -0
- package/lib/command/block/index.d.ts +2 -0
- package/lib/command/block/index.d.ts.map +1 -0
- package/lib/command/block/index.js +2 -0
- package/lib/command/block/index.js.map +1 -0
- package/lib/command/clipboard/AcApClipboardUtils.d.ts +61 -0
- package/lib/command/clipboard/AcApClipboardUtils.d.ts.map +1 -0
- package/lib/command/clipboard/AcApClipboardUtils.js +203 -0
- package/lib/command/clipboard/AcApClipboardUtils.js.map +1 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.d.ts +13 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.js +95 -0
- package/lib/command/clipboard/AcApCopyBaseCmd.js.map +1 -0
- package/lib/command/clipboard/AcApCopyClipCmd.d.ts +15 -0
- package/lib/command/clipboard/AcApCopyClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCopyClipCmd.js +85 -0
- package/lib/command/clipboard/AcApCopyClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApCutClipCmd.d.ts +11 -0
- package/lib/command/clipboard/AcApCutClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApCutClipCmd.js +91 -0
- package/lib/command/clipboard/AcApCutClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.d.ts +23 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.js +127 -0
- package/lib/command/clipboard/AcApPasteBlockCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteClipCmd.d.ts +14 -0
- package/lib/command/clipboard/AcApPasteClipCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteClipCmd.js +100 -0
- package/lib/command/clipboard/AcApPasteClipCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.d.ts +15 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.js +99 -0
- package/lib/command/clipboard/AcApPasteOrigCmd.js.map +1 -0
- package/lib/command/clipboard/AcApPastePreviewJig.d.ts +37 -0
- package/lib/command/clipboard/AcApPastePreviewJig.d.ts.map +1 -0
- package/lib/command/clipboard/AcApPastePreviewJig.js +87 -0
- package/lib/command/clipboard/AcApPastePreviewJig.js.map +1 -0
- package/lib/command/clipboard/index.d.ts +9 -0
- package/lib/command/clipboard/index.d.ts.map +1 -0
- package/lib/command/clipboard/index.js +9 -0
- package/lib/command/clipboard/index.js.map +1 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.d.ts +8 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApBlockPreviewConvertor.js +16 -0
- package/lib/command/convert/AcApBlockPreviewConvertor.js.map +1 -1
- package/lib/command/convert/AcApEntityPreviewConvertor.d.ts +32 -0
- package/lib/command/convert/AcApEntityPreviewConvertor.d.ts.map +1 -1
- package/lib/command/convert/AcApEntityPreviewConvertor.js +70 -14
- package/lib/command/convert/AcApEntityPreviewConvertor.js.map +1 -1
- package/lib/command/draw/AcApDimBlockUtil.d.ts +7 -0
- package/lib/command/draw/AcApDimBlockUtil.d.ts.map +1 -1
- package/lib/command/draw/AcApDimBlockUtil.js +16 -54
- package/lib/command/draw/AcApDimBlockUtil.js.map +1 -1
- package/lib/command/draw/AcApLeaderCmd.d.ts +49 -0
- package/lib/command/draw/AcApLeaderCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApLeaderCmd.js +611 -0
- package/lib/command/draw/AcApLeaderCmd.js.map +1 -0
- package/lib/command/draw/AcApMLeaderCmd.d.ts +41 -0
- package/lib/command/draw/AcApMLeaderCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderCmd.js +632 -0
- package/lib/command/draw/AcApMLeaderCmd.js.map +1 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.d.ts +137 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.js +411 -0
- package/lib/command/draw/AcApMLeaderCmdUtil.js.map +1 -0
- package/lib/command/draw/AcApMLeaderEditCmd.d.ts +13 -0
- package/lib/command/draw/AcApMLeaderEditCmd.d.ts.map +1 -0
- package/lib/command/draw/AcApMLeaderEditCmd.js +245 -0
- package/lib/command/draw/AcApMLeaderEditCmd.js.map +1 -0
- package/lib/command/draw/acedRenderDimStylePreview.d.ts +7 -0
- package/lib/command/draw/acedRenderDimStylePreview.d.ts.map +1 -0
- package/lib/command/draw/acedRenderDimStylePreview.js +141 -0
- package/lib/command/draw/acedRenderDimStylePreview.js.map +1 -0
- package/lib/command/draw/dimStylePreview.d.ts +62 -0
- package/lib/command/draw/dimStylePreview.d.ts.map +1 -0
- package/lib/command/draw/dimStylePreview.js +723 -0
- package/lib/command/draw/dimStylePreview.js.map +1 -0
- package/lib/command/draw/index.d.ts +6 -0
- package/lib/command/draw/index.d.ts.map +1 -1
- package/lib/command/draw/index.js +6 -0
- package/lib/command/draw/index.js.map +1 -1
- package/lib/command/group/AcApDashGroupCmd.d.ts +18 -0
- package/lib/command/group/AcApDashGroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApDashGroupCmd.js +457 -0
- package/lib/command/group/AcApDashGroupCmd.js.map +1 -0
- package/lib/command/group/AcApGroupCmd.d.ts +18 -0
- package/lib/command/group/AcApGroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApGroupCmd.js +253 -0
- package/lib/command/group/AcApGroupCmd.js.map +1 -0
- package/lib/command/group/AcApGroupEditCmd.d.ts +14 -0
- package/lib/command/group/AcApGroupEditCmd.d.ts.map +1 -0
- package/lib/command/group/AcApGroupEditCmd.js +241 -0
- package/lib/command/group/AcApGroupEditCmd.js.map +1 -0
- package/lib/command/group/AcApUngroupCmd.d.ts +20 -0
- package/lib/command/group/AcApUngroupCmd.d.ts.map +1 -0
- package/lib/command/group/AcApUngroupCmd.js +249 -0
- package/lib/command/group/AcApUngroupCmd.js.map +1 -0
- package/lib/command/group/index.d.ts +5 -0
- package/lib/command/group/index.d.ts.map +1 -0
- package/lib/command/group/index.js +5 -0
- package/lib/command/group/index.js.map +1 -0
- package/lib/command/index.d.ts +5 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +5 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts +9 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupSessionBootstrap.js +21 -7
- package/lib/command/markup/AcApMarkupSessionBootstrap.js.map +1 -1
- package/lib/command/markup/index.d.ts +1 -1
- package/lib/command/markup/index.d.ts.map +1 -1
- package/lib/command/markup/index.js +4 -2
- package/lib/command/markup/index.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.d.ts +7 -0
- package/lib/command/measure/AcApMeasureArcCmd.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcCmd.js +183 -73
- package/lib/command/measure/AcApMeasureArcCmd.js.map +1 -1
- package/lib/command/measure/AcApMeasureArcLock.d.ts +23 -1
- package/lib/command/measure/AcApMeasureArcLock.d.ts.map +1 -1
- package/lib/command/measure/AcApMeasureArcLock.js +57 -1
- package/lib/command/measure/AcApMeasureArcLock.js.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts +3 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.d.ts.map +1 -1
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js +44 -4
- package/lib/command/measure/entity/AcApMeasureDrawUtil.js.map +1 -1
- package/lib/command/modify/AcApScaleCmd.d.ts +115 -0
- package/lib/command/modify/AcApScaleCmd.d.ts.map +1 -0
- package/lib/command/modify/AcApScaleCmd.js +347 -0
- package/lib/command/modify/AcApScaleCmd.js.map +1 -0
- package/lib/command/modify/AcApScalePreviewJig.d.ts +56 -0
- package/lib/command/modify/AcApScalePreviewJig.d.ts.map +1 -0
- package/lib/command/modify/AcApScalePreviewJig.js +115 -0
- package/lib/command/modify/AcApScalePreviewJig.js.map +1 -0
- package/lib/command/modify/index.d.ts +1 -0
- package/lib/command/modify/index.d.ts.map +1 -1
- package/lib/command/modify/index.js +1 -0
- package/lib/command/modify/index.js.map +1 -1
- package/lib/command/ui/AcApFindUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApFindUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApFindUiCmd.js +83 -0
- package/lib/command/ui/AcApFindUiCmd.js.map +1 -0
- package/lib/command/ui/AcApLayerUiCmd.d.ts +65 -0
- package/lib/command/ui/AcApLayerUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApLayerUiCmd.js +142 -0
- package/lib/command/ui/AcApLayerUiCmd.js.map +1 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.js +83 -0
- package/lib/command/ui/AcApMarkupPanelUiCmd.js.map +1 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.d.ts +26 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.d.ts.map +1 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.js +83 -0
- package/lib/command/ui/AcApMeasurementPanelUiCmd.js.map +1 -0
- package/lib/command/ui/index.d.ts +5 -0
- package/lib/command/ui/index.d.ts.map +1 -0
- package/lib/command/ui/index.js +5 -0
- package/lib/command/ui/index.js.map +1 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts +13 -0
- package/lib/editor/grip/AcEdGripEditSession.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripEditSession.js +44 -9
- package/lib/editor/grip/AcEdGripEditSession.js.map +1 -1
- package/lib/editor/grip/AcEdGripManager.d.ts +21 -1
- package/lib/editor/grip/AcEdGripManager.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripManager.js +204 -22
- package/lib/editor/grip/AcEdGripManager.js.map +1 -1
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts +7 -0
- package/lib/editor/grip/AcEdGripPreviewJig.d.ts.map +1 -1
- package/lib/editor/grip/AcEdGripPreviewJig.js +18 -1
- package/lib/editor/grip/AcEdGripPreviewJig.js.map +1 -1
- package/lib/editor/grip/AcEdGripViewport.d.ts +35 -0
- package/lib/editor/grip/AcEdGripViewport.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGripViewport.js +68 -0
- package/lib/editor/grip/AcEdGripViewport.js.map +1 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.d.ts +24 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.js +76 -0
- package/lib/editor/grip/AcEdGroupGripEditSession.js.map +1 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.d.ts +46 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.d.ts.map +1 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.js +187 -0
- package/lib/editor/grip/AcEdGroupGripPolicy.js.map +1 -0
- package/lib/editor/grip/index.d.ts +3 -0
- package/lib/editor/grip/index.d.ts.map +1 -1
- package/lib/editor/grip/index.js +3 -0
- package/lib/editor/grip/index.js.map +1 -1
- package/lib/editor/input/AcEdOrthoMode.d.ts +2 -2
- package/lib/editor/input/AcEdOrthoMode.d.ts.map +1 -1
- package/lib/editor/input/AcEdOrthoMode.js +20 -7
- package/lib/editor/input/AcEdOrthoMode.js.map +1 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts +16 -0
- package/lib/editor/input/AcEdOsnapCenterMarks.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapCenterMarks.js +24 -3
- package/lib/editor/input/AcEdOsnapCenterMarks.js.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts +0 -1
- package/lib/editor/input/AcEdOsnapResolver.d.ts.map +1 -1
- package/lib/editor/input/AcEdOsnapResolver.js +3 -16
- package/lib/editor/input/AcEdOsnapResolver.js.map +1 -1
- package/lib/editor/input/AcEdPolarTracking.d.ts.map +1 -1
- package/lib/editor/input/AcEdPolarTracking.js +16 -10
- package/lib/editor/input/AcEdPolarTracking.js.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.d.ts.map +1 -1
- package/lib/editor/input/handler/AcEdPointHandler.js +36 -16
- package/lib/editor/input/handler/AcEdPointHandler.js.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts +12 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.d.ts.map +1 -1
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js +20 -0
- package/lib/editor/input/prompt/AcEdPromptSelectionOptions.js.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.d.ts +5 -0
- package/lib/editor/input/ui/AcEdCommandLine.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdCommandLine.js +33 -5
- package/lib/editor/input/ui/AcEdCommandLine.js.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +30 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +47 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +80 -0
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts +40 -4
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.js +199 -3
- package/lib/editor/view/AcEdSelectionBoxIntersect.js.map +1 -1
- package/lib/editor/view/AcEdViewportBoxSelection.d.ts +10 -0
- package/lib/editor/view/AcEdViewportBoxSelection.d.ts.map +1 -1
- package/lib/editor/view/AcEdViewportBoxSelection.js +15 -8
- package/lib/editor/view/AcEdViewportBoxSelection.js.map +1 -1
- package/lib/file-open-panel.d.ts.map +1 -1
- package/lib/file-open-panel.js +4 -0
- package/lib/file-open-panel.js.map +1 -1
- package/lib/find/AcApFindNavigator.d.ts +47 -0
- package/lib/find/AcApFindNavigator.d.ts.map +1 -1
- package/lib/find/AcApFindNavigator.js +13 -5
- package/lib/find/AcApFindNavigator.js.map +1 -1
- package/lib/find/findDrawing.d.ts +1 -1
- package/lib/find/findDrawing.d.ts.map +1 -1
- package/lib/find/findDrawing.js +4 -3
- package/lib/find/findDrawing.js.map +1 -1
- package/lib/find/findText.d.ts +40 -13
- package/lib/find/findText.d.ts.map +1 -1
- package/lib/find/findText.js +100 -44
- package/lib/find/findText.js.map +1 -1
- package/lib/find/index.d.ts +8 -0
- package/lib/find/index.d.ts.map +1 -1
- package/lib/find/index.js +8 -0
- package/lib/find/index.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +1 -1
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +2 -0
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/AcUiI18n.d.ts +23 -0
- package/lib/i18n/AcUiI18n.d.ts.map +1 -0
- package/lib/i18n/AcUiI18n.js +126 -0
- package/lib/i18n/AcUiI18n.js.map +1 -0
- package/lib/i18n/ar/command.d.ts +103 -6
- package/lib/i18n/ar/command.d.ts.map +1 -1
- package/lib/i18n/ar/command.js +601 -11
- package/lib/i18n/ar/command.js.map +1 -1
- package/lib/i18n/ar/jig.d.ts +1423 -579
- package/lib/i18n/ar/jig.d.ts.map +1 -1
- package/lib/i18n/ar/jig.js +2096 -322
- package/lib/i18n/ar/jig.js.map +1 -1
- package/lib/i18n/ar/main.d.ts +22 -0
- package/lib/i18n/ar/main.d.ts.map +1 -1
- package/lib/i18n/ar/main.js +22 -0
- package/lib/i18n/ar/main.js.map +1 -1
- package/lib/i18n/ar/simpleUi.d.ts +170 -0
- package/lib/i18n/ar/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ar/simpleUi.js +169 -0
- package/lib/i18n/ar/simpleUi.js.map +1 -0
- package/lib/i18n/cs/command.d.ts +111 -1
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +112 -2
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +867 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +988 -24
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/cs/main.d.ts +22 -0
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +23 -1
- package/lib/i18n/cs/main.js.map +1 -1
- package/lib/i18n/cs/simpleUi.d.ts +170 -0
- package/lib/i18n/cs/simpleUi.d.ts.map +1 -0
- package/lib/i18n/cs/simpleUi.js +169 -0
- package/lib/i18n/cs/simpleUi.js.map +1 -0
- package/lib/i18n/en/command.d.ts +98 -1
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +99 -2
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +844 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +801 -1
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +22 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +22 -0
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/en/simpleUi.d.ts +170 -0
- package/lib/i18n/en/simpleUi.d.ts.map +1 -0
- package/lib/i18n/en/simpleUi.js +169 -0
- package/lib/i18n/en/simpleUi.js.map +1 -0
- package/lib/i18n/index.d.ts +1 -0
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js +37 -6
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/ja/command.d.ts +605 -0
- package/lib/i18n/ja/command.d.ts.map +1 -0
- package/lib/i18n/ja/command.js +604 -0
- package/lib/i18n/ja/command.js.map +1 -0
- package/lib/i18n/ja/jig.d.ts +2425 -0
- package/lib/i18n/ja/jig.d.ts.map +1 -0
- package/lib/i18n/ja/jig.js +2316 -0
- package/lib/i18n/ja/jig.js.map +1 -0
- package/lib/i18n/ja/main.d.ts +216 -0
- package/lib/i18n/ja/main.d.ts.map +1 -0
- package/lib/i18n/ja/main.js +215 -0
- package/lib/i18n/ja/main.js.map +1 -0
- package/lib/i18n/ja/simpleUi.d.ts +170 -0
- package/lib/i18n/ja/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ja/simpleUi.js +169 -0
- package/lib/i18n/ja/simpleUi.js.map +1 -0
- package/lib/i18n/ko/command.d.ts +605 -0
- package/lib/i18n/ko/command.d.ts.map +1 -0
- package/lib/i18n/ko/command.js +604 -0
- package/lib/i18n/ko/command.js.map +1 -0
- package/lib/i18n/ko/jig.d.ts +2425 -0
- package/lib/i18n/ko/jig.d.ts.map +1 -0
- package/lib/i18n/ko/jig.js +2316 -0
- package/lib/i18n/ko/jig.js.map +1 -0
- package/lib/i18n/ko/main.d.ts +216 -0
- package/lib/i18n/ko/main.d.ts.map +1 -0
- package/lib/i18n/ko/main.js +215 -0
- package/lib/i18n/ko/main.js.map +1 -0
- package/lib/i18n/ko/simpleUi.d.ts +170 -0
- package/lib/i18n/ko/simpleUi.d.ts.map +1 -0
- package/lib/i18n/ko/simpleUi.js +169 -0
- package/lib/i18n/ko/simpleUi.js.map +1 -0
- package/lib/i18n/tr/command.d.ts +111 -1
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +112 -2
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +867 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +1096 -24
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +22 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +23 -1
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/tr/simpleUi.d.ts +170 -0
- package/lib/i18n/tr/simpleUi.d.ts.map +1 -0
- package/lib/i18n/tr/simpleUi.js +169 -0
- package/lib/i18n/tr/simpleUi.js.map +1 -0
- package/lib/i18n/zh/command.d.ts +98 -1
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +99 -2
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +844 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +793 -1
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +22 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +22 -0
- package/lib/i18n/zh/main.js.map +1 -1
- package/lib/i18n/zh/simpleUi.d.ts +170 -0
- package/lib/i18n/zh/simpleUi.d.ts.map +1 -0
- package/lib/i18n/zh/simpleUi.js +169 -0
- package/lib/i18n/zh/simpleUi.js.map +1 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/service/AcApEntityService.d.ts +36 -2
- package/lib/service/AcApEntityService.d.ts.map +1 -1
- package/lib/service/AcApEntityService.js +92 -23
- package/lib/service/AcApEntityService.js.map +1 -1
- package/lib/service/AcApGroup.d.ts +95 -0
- package/lib/service/AcApGroup.d.ts.map +1 -0
- package/lib/service/AcApGroup.js +421 -0
- package/lib/service/AcApGroup.js.map +1 -0
- package/lib/service/AcApLlmSettingsService.d.ts +74 -0
- package/lib/service/AcApLlmSettingsService.d.ts.map +1 -0
- package/lib/service/AcApLlmSettingsService.js +126 -0
- package/lib/service/AcApLlmSettingsService.js.map +1 -0
- package/lib/service/AcApNamedViewService.d.ts +139 -0
- package/lib/service/AcApNamedViewService.d.ts.map +1 -0
- package/lib/service/AcApNamedViewService.js +407 -0
- package/lib/service/AcApNamedViewService.js.map +1 -0
- package/lib/service/AcApTextRecognitionService.d.ts +107 -0
- package/lib/service/AcApTextRecognitionService.d.ts.map +1 -0
- package/lib/service/AcApTextRecognitionService.js +304 -0
- package/lib/service/AcApTextRecognitionService.js.map +1 -0
- package/lib/service/AcApUcsService.d.ts +101 -0
- package/lib/service/AcApUcsService.d.ts.map +1 -0
- package/lib/service/AcApUcsService.js +753 -0
- package/lib/service/AcApUcsService.js.map +1 -0
- package/lib/service/index.d.ts +5 -0
- package/lib/service/index.d.ts.map +1 -1
- package/lib/service/index.js +5 -0
- package/lib/service/index.js.map +1 -1
- package/lib/smartBlock/AcApSmartBlockConvert.d.ts +98 -0
- package/lib/smartBlock/AcApSmartBlockConvert.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockConvert.js +300 -0
- package/lib/smartBlock/AcApSmartBlockConvert.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockDetect.d.ts +149 -0
- package/lib/smartBlock/AcApSmartBlockDetect.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockDetect.js +1464 -0
- package/lib/smartBlock/AcApSmartBlockDetect.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSearch.d.ts +161 -0
- package/lib/smartBlock/AcApSmartBlockSearch.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSearch.js +712 -0
- package/lib/smartBlock/AcApSmartBlockSearch.js.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSession.d.ts +85 -0
- package/lib/smartBlock/AcApSmartBlockSession.d.ts.map +1 -0
- package/lib/smartBlock/AcApSmartBlockSession.js +233 -0
- package/lib/smartBlock/AcApSmartBlockSession.js.map +1 -0
- package/lib/smartBlock/AcEdShapeFeatures.d.ts +33 -0
- package/lib/smartBlock/AcEdShapeFeatures.d.ts.map +1 -0
- package/lib/smartBlock/AcEdShapeFeatures.js +571 -0
- package/lib/smartBlock/AcEdShapeFeatures.js.map +1 -0
- package/lib/smartBlock/AcEdShapeMatcher.d.ts +146 -0
- package/lib/smartBlock/AcEdShapeMatcher.d.ts.map +1 -0
- package/lib/smartBlock/AcEdShapeMatcher.js +749 -0
- package/lib/smartBlock/AcEdShapeMatcher.js.map +1 -0
- package/lib/smartBlock/index.d.ts +7 -0
- package/lib/smartBlock/index.d.ts.map +1 -0
- package/lib/smartBlock/index.js +7 -0
- package/lib/smartBlock/index.js.map +1 -0
- package/lib/ui/AcApSimpleUiChrome.d.ts +374 -0
- package/lib/ui/AcApSimpleUiChrome.d.ts.map +1 -0
- package/lib/ui/AcApSimpleUiChrome.js +1308 -0
- package/lib/ui/AcApSimpleUiChrome.js.map +1 -0
- package/lib/ui/AcUiColorPicker.d.ts +47 -0
- package/lib/ui/AcUiColorPicker.d.ts.map +1 -0
- package/lib/ui/AcUiColorPicker.js +133 -0
- package/lib/ui/AcUiColorPicker.js.map +1 -0
- package/lib/ui/AcUiFileOpenPanel.js +1 -1
- package/lib/ui/AcUiFileOpenPanel.js.map +1 -1
- package/lib/ui/AcUiFindPaletteView.d.ts +99 -0
- package/lib/ui/AcUiFindPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiFindPaletteView.js +426 -0
- package/lib/ui/AcUiFindPaletteView.js.map +1 -0
- package/lib/ui/AcUiLayerListView.d.ts +114 -0
- package/lib/ui/AcUiLayerListView.d.ts.map +1 -0
- package/lib/ui/AcUiLayerListView.js +443 -0
- package/lib/ui/AcUiLayerListView.js.map +1 -0
- package/lib/ui/AcUiMeasurementPaletteView.d.ts +83 -0
- package/lib/ui/AcUiMeasurementPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiMeasurementPaletteView.js +341 -0
- package/lib/ui/AcUiMeasurementPaletteView.js.map +1 -0
- package/lib/ui/AcUiReviewPaletteView.d.ts +141 -0
- package/lib/ui/AcUiReviewPaletteView.d.ts.map +1 -0
- package/lib/ui/AcUiReviewPaletteView.js +524 -0
- package/lib/ui/AcUiReviewPaletteView.js.map +1 -0
- package/lib/ui/AcUiShortCutToolbar.d.ts +24 -2
- package/lib/ui/AcUiShortCutToolbar.d.ts.map +1 -1
- package/lib/ui/AcUiShortCutToolbar.js +48 -6
- package/lib/ui/AcUiShortCutToolbar.js.map +1 -1
- package/lib/ui/AcUiSimpleUiOptions.d.ts +88 -0
- package/lib/ui/AcUiSimpleUiOptions.d.ts.map +1 -0
- package/lib/ui/AcUiSimpleUiOptions.js +2 -0
- package/lib/ui/AcUiSimpleUiOptions.js.map +1 -0
- package/lib/ui/AcUiSimpleUiStyles.d.ts +12 -0
- package/lib/ui/AcUiSimpleUiStyles.d.ts.map +1 -0
- package/lib/ui/AcUiSimpleUiStyles.js +28 -0
- package/lib/ui/AcUiSimpleUiStyles.js.map +1 -0
- package/lib/ui/AcUiThemeSync.d.ts +58 -0
- package/lib/ui/AcUiThemeSync.d.ts.map +1 -0
- package/lib/ui/AcUiThemeSync.js +114 -0
- package/lib/ui/AcUiThemeSync.js.map +1 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.d.ts +20 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.d.ts.map +1 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.js +46 -0
- package/lib/ui/acuiNormalizeSimpleUiOptions.js.map +1 -0
- package/lib/ui/dock/AcUiDockPanel.d.ts +204 -0
- package/lib/ui/dock/AcUiDockPanel.d.ts.map +1 -0
- package/lib/ui/dock/AcUiDockPanel.js +926 -0
- package/lib/ui/dock/AcUiDockPanel.js.map +1 -0
- package/lib/ui/dock/acuiDockPanelStyles.d.ts +9 -0
- package/lib/ui/dock/acuiDockPanelStyles.d.ts.map +1 -0
- package/lib/ui/dock/acuiDockPanelStyles.js +27 -0
- package/lib/ui/dock/acuiDockPanelStyles.js.map +1 -0
- package/lib/ui/dock/index.d.ts +3 -0
- package/lib/ui/dock/index.d.ts.map +1 -0
- package/lib/ui/dock/index.js +3 -0
- package/lib/ui/dock/index.js.map +1 -0
- package/lib/ui/icons.d.ts +22 -14
- package/lib/ui/icons.d.ts.map +1 -1
- package/lib/ui/icons.js +42 -32
- package/lib/ui/icons.js.map +1 -1
- package/lib/ui/index.d.ts +12 -0
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +11 -0
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/toolbar/AcUiToolbar.d.ts +1 -1
- package/lib/ui/toolbar/AcUiToolbar.js +1 -1
- package/lib/ui/toolbar/createLayoutToolbarItem.d.ts +41 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.d.ts.map +1 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.js +103 -0
- package/lib/ui/toolbar/createLayoutToolbarItem.js.map +1 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.d.ts +40 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.d.ts.map +1 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.js +65 -0
- package/lib/ui/toolbar/createToolbarLayoutSwitcher.js.map +1 -0
- package/lib/ui/toolbar/defaultToolbarItems.d.ts +44 -0
- package/lib/ui/toolbar/defaultToolbarItems.d.ts.map +1 -0
- package/lib/ui/toolbar/defaultToolbarItems.js +614 -0
- package/lib/ui/toolbar/defaultToolbarItems.js.map +1 -0
- package/lib/ui/toolbar/index.d.ts +3 -1
- package/lib/ui/toolbar/index.d.ts.map +1 -1
- package/lib/ui/toolbar/index.js +1 -0
- package/lib/ui/toolbar/index.js.map +1 -1
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.d.ts +25 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.d.ts.map +1 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.js +164 -0
- package/lib/ui/toolbar/mergeToolbarOptionsForLayout.js.map +1 -0
- package/lib/ui/toolbar/resolveDockMountTarget.d.ts +22 -0
- package/lib/ui/toolbar/resolveDockMountTarget.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveDockMountTarget.js +47 -0
- package/lib/ui/toolbar/resolveDockMountTarget.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItems.d.ts +46 -0
- package/lib/ui/toolbar/resolveToolbarItems.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItems.js +161 -0
- package/lib/ui/toolbar/resolveToolbarItems.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.d.ts +17 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.js +39 -0
- package/lib/ui/toolbar/resolveToolbarMountTarget.js.map +1 -0
- package/lib/ui/toolbar/simpleUiPresets.d.ts +15 -0
- package/lib/ui/toolbar/simpleUiPresets.d.ts.map +1 -0
- package/lib/ui/toolbar/simpleUiPresets.js +14 -0
- package/lib/ui/toolbar/simpleUiPresets.js.map +1 -0
- package/lib/ui/toolbar/types.d.ts +18 -0
- package/lib/ui/toolbar/types.d.ts.map +1 -1
- package/lib/util/AcApFontUtil.d.ts +19 -0
- package/lib/util/AcApFontUtil.d.ts.map +1 -1
- package/lib/util/AcApFontUtil.js +108 -13
- package/lib/util/AcApFontUtil.js.map +1 -1
- package/lib/util/AcApGeTransform.d.ts +8 -0
- package/lib/util/AcApGeTransform.d.ts.map +1 -1
- package/lib/util/AcApGeTransform.js +13 -0
- package/lib/util/AcApGeTransform.js.map +1 -1
- package/lib/util/AcApTextMeasure.d.ts +43 -0
- package/lib/util/AcApTextMeasure.d.ts.map +1 -0
- package/lib/util/AcApTextMeasure.js +82 -0
- package/lib/util/AcApTextMeasure.js.map +1 -0
- package/lib/util/acapResolveOpenFileType.d.ts +12 -0
- package/lib/util/acapResolveOpenFileType.d.ts.map +1 -0
- package/lib/util/acapResolveOpenFileType.js +22 -0
- package/lib/util/acapResolveOpenFileType.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/AcApUcsIconOverlay.d.ts +26 -0
- package/lib/view/AcApUcsIconOverlay.d.ts.map +1 -0
- package/lib/view/AcApUcsIconOverlay.js +143 -0
- package/lib/view/AcApUcsIconOverlay.js.map +1 -0
- package/lib/view/AcEdViewKeyHandler.d.ts +11 -0
- package/lib/view/AcEdViewKeyHandler.d.ts.map +1 -1
- package/lib/view/AcEdViewKeyHandler.js +39 -3
- package/lib/view/AcEdViewKeyHandler.js.map +1 -1
- package/lib/view/AcTrEntityDisplayController.d.ts +5 -0
- package/lib/view/AcTrEntityDisplayController.d.ts.map +1 -1
- package/lib/view/AcTrEntityDisplayController.js +5 -0
- package/lib/view/AcTrEntityDisplayController.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +27 -0
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +40 -0
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +55 -1
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +252 -51
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrLayoutView.d.ts +0 -12
- package/lib/view/AcTrLayoutView.d.ts.map +1 -1
- package/lib/view/AcTrLayoutView.js +0 -20
- package/lib/view/AcTrLayoutView.js.map +1 -1
- package/lib/view/AcTrLayoutViewManager.d.ts +6 -0
- package/lib/view/AcTrLayoutViewManager.d.ts.map +1 -1
- package/lib/view/AcTrLayoutViewManager.js +8 -0
- package/lib/view/AcTrLayoutViewManager.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +12 -0
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +65 -16
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +92 -1
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +367 -92
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/AcTrViewSessionState.d.ts +5 -0
- package/lib/view/AcTrViewSessionState.d.ts.map +1 -1
- package/package.json +12 -16
- package/src/file-open-panel.ts +93 -89
- package/src/ui/icons.ts +428 -411
- package/dist/cad-simple-viewer-AcUiFileOpenSession-drptdOYc.js +0 -324
- package/find.ts +0 -7
- package/src/find/AcApFindNavigator.ts +0 -190
- package/src/find/findDrawing.ts +0 -211
- package/src/find/findText.ts +0 -624
- package/src/find/index.ts +0 -2
|
@@ -0,0 +1,1308 @@
|
|
|
1
|
+
var __values = (this && this.__values) || function(o) {
|
|
2
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
3
|
+
if (m) return m.call(o);
|
|
4
|
+
if (o && typeof o.length === "number") return {
|
|
5
|
+
next: function () {
|
|
6
|
+
if (o && i >= o.length) o = void 0;
|
|
7
|
+
return { value: o && o[i++], done: !o };
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
11
|
+
};
|
|
12
|
+
import { ACAP_PALETTE_NAMED_TAB, AcApDocManager, AcApPaletteService, AcApSettingManager } from '../app';
|
|
13
|
+
import { acapBindToolbarDocState } from '../command/AcApToolbarDocBind';
|
|
14
|
+
import { AcApFindUiCmd, AcApLayerUiCmd, AcApMarkupPanelUiCmd, AcApMeasurementPanelUiCmd, AcUiLayerDockController, AcUiLayerUiControllerHolder } from '../command/ui';
|
|
15
|
+
import { AcEdCommandStack, acedGetUiLayout, acedSubscribeUiLayout } from '../editor';
|
|
16
|
+
import { AcApI18n } from '../i18n';
|
|
17
|
+
import { AcUiI18n, acuiRegisterSimpleUiI18n } from '../i18n/AcUiI18n';
|
|
18
|
+
import { AcUiFindPaletteView } from './AcUiFindPaletteView';
|
|
19
|
+
import { AcUiLayerListView } from './AcUiLayerListView';
|
|
20
|
+
import { AcUiMeasurementPaletteView } from './AcUiMeasurementPaletteView';
|
|
21
|
+
import { acuiNormalizeSimpleUiOptions } from './acuiNormalizeSimpleUiOptions';
|
|
22
|
+
import { AcUiReviewPaletteView } from './AcUiReviewPaletteView';
|
|
23
|
+
import { acuiRemoveUiStylesIfUnused } from './AcUiSimpleUiStyles';
|
|
24
|
+
import { AcUiThemeSync } from './AcUiThemeSync';
|
|
25
|
+
import { AcUiDockPanel } from './dock/AcUiDockPanel';
|
|
26
|
+
import { acuiToolbarItemsIncludeItem } from './toolbar';
|
|
27
|
+
import { AcUiToolbar } from './toolbar/AcUiToolbar';
|
|
28
|
+
import { acuiMergeToolbarOptionsForLayout, acuiPrependToolbarLayoutSwitcher, acuiResolveDockMountTarget, acuiResolveToolbarItems, acuiResolveToolbarMountTarget } from './toolbar/simpleUiPresets';
|
|
29
|
+
var LAYERS_TAB_ID = 'layers';
|
|
30
|
+
var REVIEW_TAB_ID = 'review';
|
|
31
|
+
var MEASUREMENTS_TAB_ID = 'measurements';
|
|
32
|
+
var FIND_TAB_ID = 'find';
|
|
33
|
+
/**
|
|
34
|
+
* Built-in plain-DOM chrome: toolbar, layer manager, and review palette.
|
|
35
|
+
*
|
|
36
|
+
* Registers the `layer`, `markuppanel`, and `measurementpanel` commands when
|
|
37
|
+
* the toolbar includes those buttons, injects shared UI styles, and keeps
|
|
38
|
+
* theme and locale in sync with {@link AcApI18n} and the `COLORTHEME` system
|
|
39
|
+
* variable.
|
|
40
|
+
*
|
|
41
|
+
* Supports responsive chrome via {@link AcUiSimpleUiOptions.layout} and
|
|
42
|
+
* {@link AcUiSimpleUiOptions.layouts}: phone (bottom full-width bar),
|
|
43
|
+
* pad, and desktop (default right-side toolbar). Use {@link getLayout} and
|
|
44
|
+
* {@link setLayout} to read or override the active layout at runtime.
|
|
45
|
+
*/
|
|
46
|
+
var AcApSimpleUiChrome = /** @class */ (function () {
|
|
47
|
+
/**
|
|
48
|
+
* @param options - Toolbar, layer manager, dock panel, and host configuration.
|
|
49
|
+
*/
|
|
50
|
+
function AcApSimpleUiChrome(options) {
|
|
51
|
+
if (options === void 0) { options = {}; }
|
|
52
|
+
var _this = this;
|
|
53
|
+
this.options = options;
|
|
54
|
+
/** Mutable delegate for the registered `layer` command. */
|
|
55
|
+
this.layerUiControllerHolder = new AcUiLayerUiControllerHolder();
|
|
56
|
+
/** Resolved toolbar items before layer action wiring. */
|
|
57
|
+
this.baseToolbarItems = [];
|
|
58
|
+
/** Raw toolbar items configuration last applied via {@link setToolbarItems}. */
|
|
59
|
+
this.toolbarItemsInput = 'default';
|
|
60
|
+
/**
|
|
61
|
+
* When true, {@link setToolbarItems} replaced the layout-derived item list.
|
|
62
|
+
* Layout switches still update chrome (placement, size, labels) but keep
|
|
63
|
+
* this item list until the next {@link setToolbarItems} call.
|
|
64
|
+
*/
|
|
65
|
+
this.toolbarItemsOverridden = false;
|
|
66
|
+
/** Whether the toolbar includes a layer button. */
|
|
67
|
+
this.hasLayerToolbarItem = false;
|
|
68
|
+
/** Whether the toolbar includes a markup panel / review button. */
|
|
69
|
+
this.hasMarkupPanelToolbarItem = false;
|
|
70
|
+
/** Whether the toolbar includes a measurement panel button. */
|
|
71
|
+
this.hasMeasurementPanelToolbarItem = false;
|
|
72
|
+
/** Whether the toolbar includes a find (text search) button. */
|
|
73
|
+
this.hasFindToolbarItem = false;
|
|
74
|
+
/** Whether {@link dockPanel} was explicitly enabled in options. */
|
|
75
|
+
this.dockPanelExplicitlyEnabled = false;
|
|
76
|
+
/** Current toolbar edge placement (mutable via toolbar settings button). */
|
|
77
|
+
this.toolbarPlacement = 'right';
|
|
78
|
+
/** Whether the viewer toolbar supports collapse/expand. */
|
|
79
|
+
this.toolbarCollapsible = false;
|
|
80
|
+
/** Inset of the viewer toolbar from the canvas edge in px. */
|
|
81
|
+
this.toolbarEdgeOffset = 8;
|
|
82
|
+
/** Cross-axis inset of the viewer toolbar from host edges in px. */
|
|
83
|
+
this.toolbarSideOffset = 0;
|
|
84
|
+
/**
|
|
85
|
+
* When true, the toolbar is a flex sibling of the canvas in the canvas parent.
|
|
86
|
+
*/
|
|
87
|
+
this.toolbarInCanvasParent = false;
|
|
88
|
+
/** Whether the main toolbar shows labels below icons. */
|
|
89
|
+
this.toolbarShowLabels = false;
|
|
90
|
+
/** Whether parent buttons with children show a corner triangle. */
|
|
91
|
+
this.toolbarShowChildrenIndicator = true;
|
|
92
|
+
/** Whether the toolbar container border is shown. */
|
|
93
|
+
this.toolbarShowBorder = true;
|
|
94
|
+
/** Whether each toolbar button draws a permanent outer border. */
|
|
95
|
+
this.toolbarShowButtonBorder = false;
|
|
96
|
+
/** Whether toolbar separator dividers are shown. */
|
|
97
|
+
this.toolbarShowSeparators = true;
|
|
98
|
+
/** Toolbar sizing along the layout axis (`auto` or `stretch`). */
|
|
99
|
+
this.toolbarSize = 'auto';
|
|
100
|
+
/** Overflow behavior when buttons exceed host bounds. */
|
|
101
|
+
this.toolbarOverflow = 'menu';
|
|
102
|
+
/** Layout mode from plugin options (`auto` or forced kind). */
|
|
103
|
+
this.layoutMode = 'auto';
|
|
104
|
+
/** Active resolved layout kind after merging defaults. */
|
|
105
|
+
this.activeLayoutKind = 'desktop';
|
|
106
|
+
/** Commands registered during {@link start} for cleanup on {@link dispose}. */
|
|
107
|
+
this.registeredCommands = [];
|
|
108
|
+
/** Refreshes toolbar, layer, and review UI when the app locale changes. */
|
|
109
|
+
this.handleLocaleChanged = function () {
|
|
110
|
+
var _a, _b, _c, _d, _e, _f;
|
|
111
|
+
_this.rebuildToolbarItems(_this.activeLayoutKind);
|
|
112
|
+
(_a = _this.toolbar) === null || _a === void 0 ? void 0 : _a.setSelectedChild('locale', "locale-".concat(AcApI18n.currentLocale));
|
|
113
|
+
(_b = _this.layerListView) === null || _b === void 0 ? void 0 : _b.refreshLocale();
|
|
114
|
+
(_c = _this.reviewPaletteView) === null || _c === void 0 ? void 0 : _c.refreshLocale();
|
|
115
|
+
(_d = _this.measurementPaletteView) === null || _d === void 0 ? void 0 : _d.refreshLocale();
|
|
116
|
+
(_e = _this.findPaletteView) === null || _e === void 0 ? void 0 : _e.refreshLocale();
|
|
117
|
+
(_f = _this.dockPanel) === null || _f === void 0 ? void 0 : _f.refreshLocale();
|
|
118
|
+
if (_this.toolbar) {
|
|
119
|
+
_this.toolbar.updateItems(_this.baseToolbarItems);
|
|
120
|
+
_this.toolbar.refreshLocale();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
/** Re-resolves mount targets after the viewer view becomes available. */
|
|
124
|
+
this.handleDocumentActivatedForDock = function () {
|
|
125
|
+
var _a, _b;
|
|
126
|
+
if (_this.hasLayerToolbarItem) {
|
|
127
|
+
_this.mountLayerDockUi();
|
|
128
|
+
}
|
|
129
|
+
if (_this.hasMarkupPanelToolbarItem) {
|
|
130
|
+
_this.mountReviewDockUi();
|
|
131
|
+
}
|
|
132
|
+
if (_this.hasMeasurementPanelToolbarItem) {
|
|
133
|
+
_this.mountMeasurementDockUi();
|
|
134
|
+
}
|
|
135
|
+
if (_this.hasFindToolbarItem) {
|
|
136
|
+
_this.mountFindDockUi();
|
|
137
|
+
}
|
|
138
|
+
_this.tryUpgradeDockMountTarget();
|
|
139
|
+
(_a = _this.dockPanel) === null || _a === void 0 ? void 0 : _a.ensureMounted();
|
|
140
|
+
_this.ensureViewerToolbar();
|
|
141
|
+
_this.tryUpgradeToolbarMountTarget();
|
|
142
|
+
(_b = _this.toolbar) === null || _b === void 0 ? void 0 : _b.syncInParentLayout();
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Shows command panels from `AcApPaletteService` (e.g. `pdftext`) as dock
|
|
146
|
+
* panel tabs while their command runs. Closing the dock ends the command;
|
|
147
|
+
* the dock is restored afterwards (closed, or on its previous tab).
|
|
148
|
+
*/
|
|
149
|
+
this.paletteHost = {
|
|
150
|
+
show: function (content, onUserClose) {
|
|
151
|
+
_this.ensureDockReady();
|
|
152
|
+
var dock = _this.dockPanel;
|
|
153
|
+
if (!dock)
|
|
154
|
+
return undefined;
|
|
155
|
+
var tabId = "hosted-".concat(content.id);
|
|
156
|
+
var wasOpen = dock.isOpen;
|
|
157
|
+
var previousTab = dock.activeTab;
|
|
158
|
+
dock.removeTab(tabId);
|
|
159
|
+
if (!dock.addTab({
|
|
160
|
+
id: tabId,
|
|
161
|
+
label: content.title,
|
|
162
|
+
content: content.element
|
|
163
|
+
})) {
|
|
164
|
+
return undefined;
|
|
165
|
+
}
|
|
166
|
+
dock.open(tabId);
|
|
167
|
+
var removeListener = dock.addCloseListener(onUserClose);
|
|
168
|
+
return {
|
|
169
|
+
close: function () {
|
|
170
|
+
removeListener();
|
|
171
|
+
dock.removeTab(tabId);
|
|
172
|
+
if (!wasOpen)
|
|
173
|
+
dock.close();
|
|
174
|
+
else if (previousTab && previousTab !== tabId)
|
|
175
|
+
dock.open(previousTab);
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
},
|
|
179
|
+
openNamedTab: function (id) {
|
|
180
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
181
|
+
switch (id) {
|
|
182
|
+
case ACAP_PALETTE_NAMED_TAB.layers:
|
|
183
|
+
_this.prepareLayerDockForCommand();
|
|
184
|
+
_this.layerUiControllerHolder.toggleFromCommand();
|
|
185
|
+
return (_b = (_a = _this.dockPanel) === null || _a === void 0 ? void 0 : _a.hasTab(LAYERS_TAB_ID)) !== null && _b !== void 0 ? _b : false;
|
|
186
|
+
case ACAP_PALETTE_NAMED_TAB.review:
|
|
187
|
+
_this.prepareReviewDockForCommand();
|
|
188
|
+
(_c = _this.dockPanel) === null || _c === void 0 ? void 0 : _c.open(REVIEW_TAB_ID);
|
|
189
|
+
return (_e = (_d = _this.dockPanel) === null || _d === void 0 ? void 0 : _d.hasTab(REVIEW_TAB_ID)) !== null && _e !== void 0 ? _e : false;
|
|
190
|
+
case ACAP_PALETTE_NAMED_TAB.measurements:
|
|
191
|
+
_this.prepareMeasurementDockForCommand();
|
|
192
|
+
(_f = _this.dockPanel) === null || _f === void 0 ? void 0 : _f.open(MEASUREMENTS_TAB_ID);
|
|
193
|
+
return (_h = (_g = _this.dockPanel) === null || _g === void 0 ? void 0 : _g.hasTab(MEASUREMENTS_TAB_ID)) !== null && _h !== void 0 ? _h : false;
|
|
194
|
+
case ACAP_PALETTE_NAMED_TAB.find:
|
|
195
|
+
_this.mountFindDockUi();
|
|
196
|
+
_this.tryUpgradeDockMountTarget();
|
|
197
|
+
if (!((_j = _this.dockPanel) === null || _j === void 0 ? void 0 : _j.hasTab(FIND_TAB_ID)))
|
|
198
|
+
return false;
|
|
199
|
+
_this.dockPanel.open(FIND_TAB_ID);
|
|
200
|
+
(_k = _this.findPaletteView) === null || _k === void 0 ? void 0 : _k.focus();
|
|
201
|
+
return true;
|
|
202
|
+
default:
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Adds a tab to the dock panel and opens it.
|
|
210
|
+
* Creates the dock panel container when it does not exist yet.
|
|
211
|
+
*
|
|
212
|
+
* @param tab - Tab definition.
|
|
213
|
+
* @returns Whether the tab was added.
|
|
214
|
+
*/
|
|
215
|
+
AcApSimpleUiChrome.prototype.addDockPanelTab = function (tab) {
|
|
216
|
+
if (!tab.labelKey && !tab.label)
|
|
217
|
+
return false;
|
|
218
|
+
this.ensureDockReady();
|
|
219
|
+
if (!this.dockPanel)
|
|
220
|
+
return false;
|
|
221
|
+
if (!this.dockPanel.addTab(tab))
|
|
222
|
+
return false;
|
|
223
|
+
this.dockPanel.open(tab.id);
|
|
224
|
+
return true;
|
|
225
|
+
};
|
|
226
|
+
/** Whether the dock panel is open. */
|
|
227
|
+
AcApSimpleUiChrome.prototype.isDockPanelOpen = function () {
|
|
228
|
+
var _a, _b;
|
|
229
|
+
return (_b = (_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.isOpen) !== null && _b !== void 0 ? _b : false;
|
|
230
|
+
};
|
|
231
|
+
/** Whether a dock panel tab with the given id is registered. */
|
|
232
|
+
AcApSimpleUiChrome.prototype.hasDockPanelTab = function (tabId) {
|
|
233
|
+
var _a, _b;
|
|
234
|
+
return (_b = (_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.hasTab(tabId)) !== null && _b !== void 0 ? _b : false;
|
|
235
|
+
};
|
|
236
|
+
/**
|
|
237
|
+
* Opens the dock panel and activates a tab, or closes the panel when that tab
|
|
238
|
+
* is already active.
|
|
239
|
+
*
|
|
240
|
+
* @param tabId - Tab to toggle.
|
|
241
|
+
* @returns `true` when applied; `false` when the tab or dock panel is unavailable.
|
|
242
|
+
*/
|
|
243
|
+
AcApSimpleUiChrome.prototype.toggleDockPanelTab = function (tabId) {
|
|
244
|
+
var _a;
|
|
245
|
+
if (!((_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.hasTab(tabId))) {
|
|
246
|
+
return false;
|
|
247
|
+
}
|
|
248
|
+
this.ensureDockReady();
|
|
249
|
+
if (!this.dockPanel) {
|
|
250
|
+
return false;
|
|
251
|
+
}
|
|
252
|
+
this.dockPanel.toggle(tabId);
|
|
253
|
+
return true;
|
|
254
|
+
};
|
|
255
|
+
/**
|
|
256
|
+
* Opens or closes the dock panel.
|
|
257
|
+
*
|
|
258
|
+
* @param open - Target open state.
|
|
259
|
+
* @returns `true` when applied; `false` when the dock panel is unavailable.
|
|
260
|
+
*/
|
|
261
|
+
AcApSimpleUiChrome.prototype.setDockPanelOpen = function (open) {
|
|
262
|
+
if (open) {
|
|
263
|
+
this.ensureDockReady();
|
|
264
|
+
if (!this.dockPanel) {
|
|
265
|
+
console.warn('[SimpleUiChrome] setDockPanelOpen skipped: dock panel is unavailable.');
|
|
266
|
+
return false;
|
|
267
|
+
}
|
|
268
|
+
this.dockPanel.open();
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
if (!this.dockPanel) {
|
|
272
|
+
return true;
|
|
273
|
+
}
|
|
274
|
+
this.dockPanel.close();
|
|
275
|
+
return true;
|
|
276
|
+
};
|
|
277
|
+
/** Returns the dock panel side, if the dock panel exists. */
|
|
278
|
+
AcApSimpleUiChrome.prototype.getDockPanelSide = function () {
|
|
279
|
+
var _a;
|
|
280
|
+
return (_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.getSide();
|
|
281
|
+
};
|
|
282
|
+
/** Returns the dock panel size in px, if the dock panel exists. */
|
|
283
|
+
AcApSimpleUiChrome.prototype.getDockPanelSize = function () {
|
|
284
|
+
var _a;
|
|
285
|
+
return (_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.getSize();
|
|
286
|
+
};
|
|
287
|
+
/**
|
|
288
|
+
* Sets the dock panel width or height in px.
|
|
289
|
+
*
|
|
290
|
+
* @param size - Target size in px.
|
|
291
|
+
* @returns `true` when applied; `false` when the dock panel is unavailable.
|
|
292
|
+
*/
|
|
293
|
+
AcApSimpleUiChrome.prototype.setDockPanelSize = function (size) {
|
|
294
|
+
this.ensureDockReady();
|
|
295
|
+
if (!this.dockPanel) {
|
|
296
|
+
console.warn('[SimpleUiChrome] setDockPanelSize skipped: dock panel is unavailable.');
|
|
297
|
+
return false;
|
|
298
|
+
}
|
|
299
|
+
this.dockPanel.setPanelSize(size);
|
|
300
|
+
return true;
|
|
301
|
+
};
|
|
302
|
+
/** Returns the toolbar item configuration last passed to {@link setToolbarItems}. */
|
|
303
|
+
AcApSimpleUiChrome.prototype.getToolbarItems = function () {
|
|
304
|
+
return this.toolbarItemsInput;
|
|
305
|
+
};
|
|
306
|
+
/**
|
|
307
|
+
* Replaces the entire toolbar item list at runtime.
|
|
308
|
+
*
|
|
309
|
+
* Unlike `toolbar.appendItems`, this replaces the full `items` collection.
|
|
310
|
+
* Preset references and `'default'` are resolved using the same rules as
|
|
311
|
+
* initial plugin load. Subsequent {@link setLayout} / auto viewport switches
|
|
312
|
+
* keep this list and only update toolbar chrome.
|
|
313
|
+
*
|
|
314
|
+
* @param items - Full toolbar layout definition.
|
|
315
|
+
* @param layoutSwitcher - Optional layout submenu button prepended before `items`.
|
|
316
|
+
*/
|
|
317
|
+
AcApSimpleUiChrome.prototype.setToolbarItems = function (items, layoutSwitcher) {
|
|
318
|
+
if (!this.toolbar)
|
|
319
|
+
return;
|
|
320
|
+
this.toolbarItemsOverridden = true;
|
|
321
|
+
this.toolbarLayoutSwitcher = layoutSwitcher;
|
|
322
|
+
this.toolbarItemsInput = items;
|
|
323
|
+
var resolved = this.resolveBaseToolbarItems(items);
|
|
324
|
+
this.baseToolbarItems = layoutSwitcher
|
|
325
|
+
? acuiPrependToolbarLayoutSwitcher(resolved, layoutSwitcher)
|
|
326
|
+
: resolved;
|
|
327
|
+
this.syncLayerToolbarItem();
|
|
328
|
+
this.syncReviewToolbarItem();
|
|
329
|
+
this.syncMeasurementToolbarItem();
|
|
330
|
+
this.syncFindToolbarItem();
|
|
331
|
+
this.renderToolbarItems();
|
|
332
|
+
};
|
|
333
|
+
/** Returns the viewer toolbar edge placement. */
|
|
334
|
+
AcApSimpleUiChrome.prototype.getToolbarPlacement = function () {
|
|
335
|
+
return this.toolbarPlacement;
|
|
336
|
+
};
|
|
337
|
+
/**
|
|
338
|
+
* Moves the viewer toolbar to another host edge.
|
|
339
|
+
*
|
|
340
|
+
* @param placement - Target edge placement.
|
|
341
|
+
* @returns `true` when applied; `false` when the toolbar is unavailable.
|
|
342
|
+
*/
|
|
343
|
+
AcApSimpleUiChrome.prototype.setToolbarPlacement = function (placement) {
|
|
344
|
+
if (!this.toolbar) {
|
|
345
|
+
console.warn('[SimpleUiChrome] setToolbarPlacement skipped: toolbar is unavailable.');
|
|
346
|
+
return false;
|
|
347
|
+
}
|
|
348
|
+
this.applyToolbarPlacement(placement);
|
|
349
|
+
return true;
|
|
350
|
+
};
|
|
351
|
+
/** Whether the viewer toolbar is visible. */
|
|
352
|
+
AcApSimpleUiChrome.prototype.isToolbarVisible = function () {
|
|
353
|
+
var _a, _b;
|
|
354
|
+
return (_b = (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.isVisible) !== null && _b !== void 0 ? _b : false;
|
|
355
|
+
};
|
|
356
|
+
/**
|
|
357
|
+
* Shows or hides the viewer toolbar.
|
|
358
|
+
*
|
|
359
|
+
* @param visible - Target visibility.
|
|
360
|
+
* @returns `true` when applied; `false` when the toolbar is unavailable.
|
|
361
|
+
*/
|
|
362
|
+
AcApSimpleUiChrome.prototype.setToolbarVisible = function (visible) {
|
|
363
|
+
var _a;
|
|
364
|
+
if (!this.toolbar) {
|
|
365
|
+
console.warn('[SimpleUiChrome] setToolbarVisible skipped: toolbar is unavailable.');
|
|
366
|
+
return false;
|
|
367
|
+
}
|
|
368
|
+
this.toolbar.setVisible(visible);
|
|
369
|
+
if (!visible) {
|
|
370
|
+
(_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.close();
|
|
371
|
+
}
|
|
372
|
+
return true;
|
|
373
|
+
};
|
|
374
|
+
/** Whether the viewer toolbar is collapsed to its toggle button. */
|
|
375
|
+
AcApSimpleUiChrome.prototype.isToolbarCollapsed = function () {
|
|
376
|
+
var _a, _b;
|
|
377
|
+
return (_b = (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.isCollapsed) !== null && _b !== void 0 ? _b : false;
|
|
378
|
+
};
|
|
379
|
+
/**
|
|
380
|
+
* Collapses or expands the viewer toolbar when {@link toolbar.collapsible} is enabled.
|
|
381
|
+
*
|
|
382
|
+
* @param collapsed - Target collapsed state.
|
|
383
|
+
* @returns `true` when applied; `false` when the toolbar is unavailable or not collapsible.
|
|
384
|
+
*/
|
|
385
|
+
AcApSimpleUiChrome.prototype.setToolbarCollapsed = function (collapsed) {
|
|
386
|
+
if (!this.toolbar) {
|
|
387
|
+
console.warn('[SimpleUiChrome] setToolbarCollapsed skipped: toolbar is unavailable.');
|
|
388
|
+
return false;
|
|
389
|
+
}
|
|
390
|
+
if (!this.toolbarCollapsible) {
|
|
391
|
+
console.warn('[SimpleUiChrome] setToolbarCollapsed skipped: toolbar is not collapsible.');
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
this.toolbar.setCollapsed(collapsed);
|
|
395
|
+
return true;
|
|
396
|
+
};
|
|
397
|
+
/** Returns the viewer toolbar inset from the canvas edge in px. */
|
|
398
|
+
AcApSimpleUiChrome.prototype.getToolbarEdgeOffset = function () {
|
|
399
|
+
var _a, _b;
|
|
400
|
+
return (_b = (_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.getEdgeOffset()) !== null && _b !== void 0 ? _b : this.toolbarEdgeOffset;
|
|
401
|
+
};
|
|
402
|
+
/** Returns the active UI layout kind (`phone`, `pad`, or `desktop`). */
|
|
403
|
+
AcApSimpleUiChrome.prototype.getLayout = function () {
|
|
404
|
+
return this.activeLayoutKind;
|
|
405
|
+
};
|
|
406
|
+
/**
|
|
407
|
+
* Sets layout mode and reapplies toolbar chrome for the target kind.
|
|
408
|
+
*
|
|
409
|
+
* When `mode` is `'auto'`, subscribes to viewport media queries via
|
|
410
|
+
* {@link acedSubscribeUiLayout} and switches toolbar configuration when
|
|
411
|
+
* {@link acedGetUiLayout} changes. Forced modes stop auto subscription.
|
|
412
|
+
*
|
|
413
|
+
* @param mode - `'auto'` or a fixed {@link AcEdUiLayoutKind}.
|
|
414
|
+
* @returns `true` when the mode was stored or applied; `false` when the
|
|
415
|
+
* toolbar is unavailable and the mode could not be applied (except when only
|
|
416
|
+
* updating stored mode before toolbar creation).
|
|
417
|
+
*/
|
|
418
|
+
AcApSimpleUiChrome.prototype.setLayout = function (mode) {
|
|
419
|
+
var _this = this;
|
|
420
|
+
var _a;
|
|
421
|
+
if (!this.toolbar && mode !== this.layoutMode) {
|
|
422
|
+
this.layoutMode = mode;
|
|
423
|
+
return true;
|
|
424
|
+
}
|
|
425
|
+
if (!this.toolbar)
|
|
426
|
+
return false;
|
|
427
|
+
this.layoutMode = mode;
|
|
428
|
+
(_a = this.unsubscribeLayout) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
429
|
+
this.unsubscribeLayout = undefined;
|
|
430
|
+
if (mode === 'auto') {
|
|
431
|
+
this.unsubscribeLayout = acedSubscribeUiLayout(function (kind) {
|
|
432
|
+
if (kind !== _this.activeLayoutKind) {
|
|
433
|
+
_this.applyLayoutKind(kind);
|
|
434
|
+
}
|
|
435
|
+
});
|
|
436
|
+
this.applyLayoutKind(acedGetUiLayout());
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
this.applyLayoutKind(mode);
|
|
440
|
+
}
|
|
441
|
+
return true;
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* Sets the viewer toolbar inset from the canvas edge.
|
|
445
|
+
*
|
|
446
|
+
* @param offset - Distance in px (clamped to >= 0).
|
|
447
|
+
* @returns `true` when applied; `false` when the toolbar is unavailable.
|
|
448
|
+
*/
|
|
449
|
+
AcApSimpleUiChrome.prototype.setToolbarEdgeOffset = function (offset) {
|
|
450
|
+
if (!this.toolbar) {
|
|
451
|
+
console.warn('[SimpleUiChrome] setToolbarEdgeOffset skipped: toolbar is unavailable.');
|
|
452
|
+
return false;
|
|
453
|
+
}
|
|
454
|
+
this.toolbarEdgeOffset = Math.max(0, offset);
|
|
455
|
+
this.toolbar.setEdgeOffset(this.toolbarEdgeOffset);
|
|
456
|
+
return true;
|
|
457
|
+
};
|
|
458
|
+
/**
|
|
459
|
+
* Creates UI components, registers commands, and starts theme sync.
|
|
460
|
+
*
|
|
461
|
+
* @param commandManager - Command stack used to register UI commands.
|
|
462
|
+
*/
|
|
463
|
+
AcApSimpleUiChrome.prototype.start = function (commandManager) {
|
|
464
|
+
var _this = this;
|
|
465
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
466
|
+
acuiRegisterSimpleUiI18n();
|
|
467
|
+
this.commandManager = commandManager;
|
|
468
|
+
// This shell has no command ribbon; keep the draw-style overlay available
|
|
469
|
+
// without persisting isShowRibbon into shared localStorage.
|
|
470
|
+
AcApSettingManager.instance.set('isShowRibbon', false, { persist: false });
|
|
471
|
+
var resolvedOptions = acuiNormalizeSimpleUiOptions(this.options);
|
|
472
|
+
var host = (_c = (_a = resolvedOptions.host) !== null && _a !== void 0 ? _a : (_b = AcApDocManager.instance.curView) === null || _b === void 0 ? void 0 : _b.container) !== null && _c !== void 0 ? _c : document.body;
|
|
473
|
+
this.hostEl = host;
|
|
474
|
+
this.dockPanelMountTargetOption = (_d = this.options.dockPanel) === null || _d === void 0 ? void 0 : _d.mountTarget;
|
|
475
|
+
this.toolbarMountTargetOption = (_e = this.options.toolbar) === null || _e === void 0 ? void 0 : _e.mountTarget;
|
|
476
|
+
this.layoutMode = resolvedOptions.layout;
|
|
477
|
+
this.dockPanelExplicitlyEnabled = resolvedOptions.dockPanel.enabled === true;
|
|
478
|
+
this.dockPanelDefaults = {
|
|
479
|
+
defaultOpen: (_f = resolvedOptions.dockPanel.defaultOpen) !== null && _f !== void 0 ? _f : false,
|
|
480
|
+
defaultSide: (_g = resolvedOptions.dockPanel.defaultSide) !== null && _g !== void 0 ? _g : 'left',
|
|
481
|
+
defaultHeight: (_h = resolvedOptions.dockPanel.defaultHeight) !== null && _h !== void 0 ? _h : 240,
|
|
482
|
+
defaultWidth: (_j = resolvedOptions.dockPanel.defaultWidth) !== null && _j !== void 0 ? _j : 280
|
|
483
|
+
};
|
|
484
|
+
this.themeSync = new AcUiThemeSync(host, function () { var _a; return (_a = _this.toolbar) === null || _a === void 0 ? void 0 : _a.refresh(); });
|
|
485
|
+
this.themeSync.start();
|
|
486
|
+
AcApPaletteService.setHost(this.paletteHost);
|
|
487
|
+
this.i18n = new AcUiI18n();
|
|
488
|
+
AcApI18n.events.localeChanged.addEventListener(this.handleLocaleChanged);
|
|
489
|
+
AcApDocManager.instance.events.documentActivated.addEventListener(this.handleDocumentActivatedForDock);
|
|
490
|
+
var initialLayout = this.layoutMode === 'auto' ? acedGetUiLayout() : this.layoutMode;
|
|
491
|
+
var toolbarEnabled = this.isViewerToolbarEnabled();
|
|
492
|
+
this.applyLayoutKind(initialLayout, { skipToolbarApply: !toolbarEnabled });
|
|
493
|
+
if (resolvedOptions.shouldCreateDockPanel) {
|
|
494
|
+
this.ensureDockPanel();
|
|
495
|
+
}
|
|
496
|
+
// applyLayoutKind → syncLayerToolbarItem / syncReviewToolbarItem /
|
|
497
|
+
// syncMeasurementToolbarItem may already have registered these; use
|
|
498
|
+
// ensure* so start stays idempotent.
|
|
499
|
+
if (this.hasLayerToolbarItem) {
|
|
500
|
+
this.mountLayerDockUi();
|
|
501
|
+
this.ensureLayerCommandRegistered();
|
|
502
|
+
}
|
|
503
|
+
if (this.hasMarkupPanelToolbarItem) {
|
|
504
|
+
this.mountReviewDockUi();
|
|
505
|
+
this.ensureMarkupPanelCommandRegistered();
|
|
506
|
+
}
|
|
507
|
+
if (this.hasMeasurementPanelToolbarItem) {
|
|
508
|
+
this.mountMeasurementDockUi();
|
|
509
|
+
this.ensureMeasurementPanelCommandRegistered();
|
|
510
|
+
}
|
|
511
|
+
if (this.hasFindToolbarItem) {
|
|
512
|
+
this.mountFindDockUi();
|
|
513
|
+
this.ensureFindCommandRegistered();
|
|
514
|
+
}
|
|
515
|
+
this.ensureViewerToolbar(host);
|
|
516
|
+
};
|
|
517
|
+
/** Whether viewer toolbar creation is allowed (only explicit `false` disables). */
|
|
518
|
+
AcApSimpleUiChrome.prototype.isViewerToolbarEnabled = function () {
|
|
519
|
+
var _a;
|
|
520
|
+
return ((_a = this.options.toolbar) === null || _a === void 0 ? void 0 : _a.enabled) !== false;
|
|
521
|
+
};
|
|
522
|
+
/**
|
|
523
|
+
* Creates the floating toolbar when enabled and not already present.
|
|
524
|
+
*
|
|
525
|
+
* @param host - Plugin theme host; defaults to {@link hostEl}.
|
|
526
|
+
*/
|
|
527
|
+
AcApSimpleUiChrome.prototype.ensureViewerToolbar = function (host) {
|
|
528
|
+
var _this = this;
|
|
529
|
+
var _a, _b;
|
|
530
|
+
if (!this.isViewerToolbarEnabled()) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
if (this.toolbar) {
|
|
534
|
+
if (this.toolbar.isRootConnected()) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
(_a = this.toolbarDocUnbind) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
538
|
+
this.toolbarDocUnbind = undefined;
|
|
539
|
+
this.toolbar.destroy();
|
|
540
|
+
this.toolbar = undefined;
|
|
541
|
+
this.toolbarMountEl = undefined;
|
|
542
|
+
}
|
|
543
|
+
var mountHost = host !== null && host !== void 0 ? host : this.hostEl;
|
|
544
|
+
if (!mountHost || !this.i18n) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
var toolbarMountEl = (_b = this.getToolbarMountEl()) !== null && _b !== void 0 ? _b : mountHost;
|
|
548
|
+
this.toolbarMountEl = toolbarMountEl;
|
|
549
|
+
var mergedToolbar = this.getMergedToolbarOptions(this.activeLayoutKind);
|
|
550
|
+
try {
|
|
551
|
+
this.toolbar = new AcUiToolbar({
|
|
552
|
+
host: toolbarMountEl,
|
|
553
|
+
themeHost: mountHost,
|
|
554
|
+
placement: this.toolbarPlacement,
|
|
555
|
+
edgeOffset: this.toolbarEdgeOffset,
|
|
556
|
+
sideOffset: this.toolbarSideOffset,
|
|
557
|
+
items: this.baseToolbarItems,
|
|
558
|
+
i18n: this.i18n,
|
|
559
|
+
collapsible: this.toolbarCollapsible,
|
|
560
|
+
defaultCollapsed: mergedToolbar.defaultCollapsed,
|
|
561
|
+
showLabels: this.toolbarShowLabels,
|
|
562
|
+
showChildrenIndicator: this.toolbarShowChildrenIndicator,
|
|
563
|
+
size: this.toolbarSize,
|
|
564
|
+
overflow: this.toolbarOverflow,
|
|
565
|
+
showBorder: this.toolbarShowBorder,
|
|
566
|
+
showButtonBorder: this.toolbarShowButtonBorder,
|
|
567
|
+
showSeparators: this.toolbarShowSeparators,
|
|
568
|
+
inCanvasParent: this.toolbarInCanvasParent,
|
|
569
|
+
subToolbar: this.toolbarSubToolbar,
|
|
570
|
+
onCollapse: function () {
|
|
571
|
+
var _a;
|
|
572
|
+
(_a = _this.dockPanel) === null || _a === void 0 ? void 0 : _a.close();
|
|
573
|
+
},
|
|
574
|
+
onExclusiveOpen: function () { return _this.dismissDockForExclusiveChrome(); },
|
|
575
|
+
onCommand: function (command) {
|
|
576
|
+
AcApDocManager.instance.sendStringToExecute(command);
|
|
577
|
+
}
|
|
578
|
+
});
|
|
579
|
+
this.toolbarDocUnbind = acapBindToolbarDocState(this.toolbar);
|
|
580
|
+
}
|
|
581
|
+
catch (error) {
|
|
582
|
+
console.error('[SimpleUiChrome] Failed to create viewer toolbar:', error);
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
try {
|
|
586
|
+
this.setLayout(this.layoutMode);
|
|
587
|
+
}
|
|
588
|
+
catch (error) {
|
|
589
|
+
console.warn('[SimpleUiChrome] setLayout failed during toolbar setup:', error);
|
|
590
|
+
}
|
|
591
|
+
};
|
|
592
|
+
/** Resolves the canvas element that receives the viewer toolbar. */
|
|
593
|
+
AcApSimpleUiChrome.prototype.getToolbarMountEl = function () {
|
|
594
|
+
if (!this.hostEl)
|
|
595
|
+
return undefined;
|
|
596
|
+
if (this.toolbarInCanvasParent) {
|
|
597
|
+
return acuiResolveDockMountTarget(this.hostEl, this.toolbarMountTargetOption);
|
|
598
|
+
}
|
|
599
|
+
return acuiResolveToolbarMountTarget(this.hostEl, this.toolbarMountTargetOption);
|
|
600
|
+
};
|
|
601
|
+
/**
|
|
602
|
+
* Moves the toolbar from a host or inner-canvas fallback to the preferred
|
|
603
|
+
* mount (typically the canvas parent) once the view is available.
|
|
604
|
+
*/
|
|
605
|
+
AcApSimpleUiChrome.prototype.tryUpgradeToolbarMountTarget = function () {
|
|
606
|
+
var _a;
|
|
607
|
+
if (this.toolbarMountTargetOption || !this.hostEl || !this.toolbar) {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
var preferred = this.getToolbarMountEl();
|
|
611
|
+
if (!preferred || preferred === this.toolbarMountEl) {
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
var canvasContainer = (_a = AcApDocManager.instance.curView) === null || _a === void 0 ? void 0 : _a.container;
|
|
615
|
+
var canvasParent = canvasContainer === null || canvasContainer === void 0 ? void 0 : canvasContainer.parentElement;
|
|
616
|
+
if (this.toolbarMountEl !== this.hostEl &&
|
|
617
|
+
this.toolbarMountEl !== canvasContainer &&
|
|
618
|
+
this.toolbarMountEl !== canvasParent) {
|
|
619
|
+
return;
|
|
620
|
+
}
|
|
621
|
+
this.toolbar.reparentTo(preferred);
|
|
622
|
+
this.toolbarMountEl = preferred;
|
|
623
|
+
this.toolbar.syncInParentLayout();
|
|
624
|
+
};
|
|
625
|
+
/**
|
|
626
|
+
* Merges built-in, top-level, and per-layout toolbar options for a kind.
|
|
627
|
+
*
|
|
628
|
+
* @param kind - Layout kind to resolve options for.
|
|
629
|
+
* @returns Merged {@link AcUiToolbarOptions} used by {@link applyLayoutKind}.
|
|
630
|
+
*/
|
|
631
|
+
AcApSimpleUiChrome.prototype.getMergedToolbarOptions = function (kind) {
|
|
632
|
+
var _a, _b;
|
|
633
|
+
return acuiMergeToolbarOptionsForLayout(kind, this.options.toolbar, (_b = (_a = this.options.layouts) === null || _a === void 0 ? void 0 : _a[kind]) === null || _b === void 0 ? void 0 : _b.toolbar);
|
|
634
|
+
};
|
|
635
|
+
/**
|
|
636
|
+
* Applies toolbar configuration for a layout kind and refreshes dock wiring.
|
|
637
|
+
*
|
|
638
|
+
* Chrome always comes from merged layout options. Item lists come from those
|
|
639
|
+
* options unless {@link setToolbarItems} has replaced them at runtime.
|
|
640
|
+
*
|
|
641
|
+
* @param kind - Target layout kind.
|
|
642
|
+
* @param options - When `skipToolbarApply` is true, only updates resolved state.
|
|
643
|
+
*/
|
|
644
|
+
AcApSimpleUiChrome.prototype.applyLayoutKind = function (kind, options) {
|
|
645
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
646
|
+
this.activeLayoutKind = kind;
|
|
647
|
+
var toolbarOpts = this.getMergedToolbarOptions(kind);
|
|
648
|
+
this.toolbarPlacement = (_a = toolbarOpts.placement) !== null && _a !== void 0 ? _a : 'right';
|
|
649
|
+
this.toolbarCollapsible = (_b = toolbarOpts.collapsible) !== null && _b !== void 0 ? _b : false;
|
|
650
|
+
this.toolbarEdgeOffset = (_c = toolbarOpts.edgeOffset) !== null && _c !== void 0 ? _c : 8;
|
|
651
|
+
this.toolbarSideOffset = (_d = toolbarOpts.sideOffset) !== null && _d !== void 0 ? _d : 0;
|
|
652
|
+
this.toolbarShowLabels = (_e = toolbarOpts.showLabels) !== null && _e !== void 0 ? _e : false;
|
|
653
|
+
this.toolbarShowChildrenIndicator =
|
|
654
|
+
(_f = toolbarOpts.showChildrenIndicator) !== null && _f !== void 0 ? _f : true;
|
|
655
|
+
this.toolbarShowBorder = (_g = toolbarOpts.showBorder) !== null && _g !== void 0 ? _g : true;
|
|
656
|
+
this.toolbarShowButtonBorder = (_h = toolbarOpts.showButtonBorder) !== null && _h !== void 0 ? _h : false;
|
|
657
|
+
this.toolbarShowSeparators = (_j = toolbarOpts.showSeparators) !== null && _j !== void 0 ? _j : true;
|
|
658
|
+
this.toolbarSize = (_k = toolbarOpts.size) !== null && _k !== void 0 ? _k : 'auto';
|
|
659
|
+
this.toolbarOverflow = (_l = toolbarOpts.overflow) !== null && _l !== void 0 ? _l : 'menu';
|
|
660
|
+
this.toolbarSubToolbar = toolbarOpts.subToolbar;
|
|
661
|
+
var nextInCanvasParent = toolbarOpts.inCanvasParent === true;
|
|
662
|
+
var inCanvasParentChanged = nextInCanvasParent !== this.toolbarInCanvasParent;
|
|
663
|
+
this.toolbarInCanvasParent = nextInCanvasParent;
|
|
664
|
+
this.rebuildToolbarItems(kind, toolbarOpts);
|
|
665
|
+
this.syncLayerToolbarItem();
|
|
666
|
+
this.syncReviewToolbarItem();
|
|
667
|
+
this.syncMeasurementToolbarItem();
|
|
668
|
+
this.syncFindToolbarItem();
|
|
669
|
+
if ((options === null || options === void 0 ? void 0 : options.skipToolbarApply) || !this.toolbar) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
// Unwrap/wrap before remounting so overlay resolution never sees a
|
|
673
|
+
// transient `toolbar-main` as `canvas.parentElement`.
|
|
674
|
+
this.toolbar.applyViewOptions({
|
|
675
|
+
placement: this.toolbarPlacement,
|
|
676
|
+
edgeOffset: this.toolbarEdgeOffset,
|
|
677
|
+
sideOffset: this.toolbarSideOffset,
|
|
678
|
+
collapsible: this.toolbarCollapsible,
|
|
679
|
+
defaultCollapsed: toolbarOpts.defaultCollapsed,
|
|
680
|
+
showLabels: this.toolbarShowLabels,
|
|
681
|
+
showChildrenIndicator: this.toolbarShowChildrenIndicator,
|
|
682
|
+
size: this.toolbarSize,
|
|
683
|
+
overflow: this.toolbarOverflow,
|
|
684
|
+
showBorder: this.toolbarShowBorder,
|
|
685
|
+
showButtonBorder: this.toolbarShowButtonBorder,
|
|
686
|
+
showSeparators: this.toolbarShowSeparators,
|
|
687
|
+
subToolbar: this.toolbarSubToolbar,
|
|
688
|
+
inCanvasParent: this.toolbarInCanvasParent,
|
|
689
|
+
items: this.baseToolbarItems
|
|
690
|
+
});
|
|
691
|
+
if (inCanvasParentChanged || !this.toolbar.isRootConnected()) {
|
|
692
|
+
var preferred = this.getToolbarMountEl();
|
|
693
|
+
if (preferred) {
|
|
694
|
+
this.toolbar.reparentTo(preferred);
|
|
695
|
+
this.toolbarMountEl = preferred;
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
this.toolbar.syncInParentLayout();
|
|
699
|
+
};
|
|
700
|
+
/** Context passed when resolving default toolbar presets. */
|
|
701
|
+
AcApSimpleUiChrome.prototype.getToolbarContext = function () {
|
|
702
|
+
var _this = this;
|
|
703
|
+
return {
|
|
704
|
+
getTheme: function () { var _a, _b; return (_b = (_a = _this.themeSync) === null || _a === void 0 ? void 0 : _a.getTheme()) !== null && _b !== void 0 ? _b : 'dark'; },
|
|
705
|
+
setTheme: function (theme) { var _a; return (_a = _this.themeSync) === null || _a === void 0 ? void 0 : _a.setTheme(theme); },
|
|
706
|
+
getLocale: function () { return AcApI18n.currentLocale; },
|
|
707
|
+
setLocale: function (locale) { return _this.setLocale(locale); },
|
|
708
|
+
getPlacement: function () { return _this.toolbarPlacement; },
|
|
709
|
+
setPlacement: function (placement) {
|
|
710
|
+
_this.applyToolbarPlacement(placement);
|
|
711
|
+
}
|
|
712
|
+
};
|
|
713
|
+
};
|
|
714
|
+
/**
|
|
715
|
+
* Resolves {@link baseToolbarItems} from a runtime override or layout options.
|
|
716
|
+
*
|
|
717
|
+
* @param kind - Layout kind used for `'default'` and preset expansion.
|
|
718
|
+
* @param toolbarOpts - Merged options for `kind`; fetched when omitted.
|
|
719
|
+
*/
|
|
720
|
+
AcApSimpleUiChrome.prototype.rebuildToolbarItems = function (kind, toolbarOpts) {
|
|
721
|
+
var _a;
|
|
722
|
+
if (this.toolbarItemsOverridden) {
|
|
723
|
+
var resolved = this.resolveBaseToolbarItems(this.toolbarItemsInput);
|
|
724
|
+
this.baseToolbarItems = this.toolbarLayoutSwitcher
|
|
725
|
+
? acuiPrependToolbarLayoutSwitcher(resolved, this.toolbarLayoutSwitcher)
|
|
726
|
+
: resolved;
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
var merged = toolbarOpts !== null && toolbarOpts !== void 0 ? toolbarOpts : this.getMergedToolbarOptions(kind);
|
|
730
|
+
this.toolbarItemsInput = (_a = merged.items) !== null && _a !== void 0 ? _a : 'default';
|
|
731
|
+
this.baseToolbarItems = acuiResolveToolbarItems(merged, this.getToolbarContext(), kind);
|
|
732
|
+
};
|
|
733
|
+
/** Resolves raw toolbar input into concrete toolbar items. */
|
|
734
|
+
AcApSimpleUiChrome.prototype.resolveBaseToolbarItems = function (items) {
|
|
735
|
+
return acuiResolveToolbarItems({
|
|
736
|
+
items: items,
|
|
737
|
+
appendItems: undefined
|
|
738
|
+
}, this.getToolbarContext(), this.activeLayoutKind);
|
|
739
|
+
};
|
|
740
|
+
/** Applies {@link baseToolbarItems} to the toolbar. */
|
|
741
|
+
AcApSimpleUiChrome.prototype.renderToolbarItems = function () {
|
|
742
|
+
var _a;
|
|
743
|
+
(_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.updateItems(this.baseToolbarItems);
|
|
744
|
+
};
|
|
745
|
+
/** Mounts or tears down layer UI when the layer toolbar button is added or removed. */
|
|
746
|
+
AcApSimpleUiChrome.prototype.syncLayerToolbarItem = function () {
|
|
747
|
+
var hadLayer = this.hasLayerToolbarItem;
|
|
748
|
+
var hasLayer = acuiToolbarItemsIncludeItem(this.baseToolbarItems, 'layer');
|
|
749
|
+
this.hasLayerToolbarItem = hasLayer;
|
|
750
|
+
if (hasLayer && !hadLayer) {
|
|
751
|
+
this.ensureLayerCommandRegistered();
|
|
752
|
+
this.mountLayerDockUi();
|
|
753
|
+
}
|
|
754
|
+
else if (!hasLayer && hadLayer) {
|
|
755
|
+
this.teardownLayerUi();
|
|
756
|
+
this.unregisterLayerCommand();
|
|
757
|
+
}
|
|
758
|
+
};
|
|
759
|
+
/** Mounts or tears down review UI when the markup panel button is added or removed. */
|
|
760
|
+
AcApSimpleUiChrome.prototype.syncReviewToolbarItem = function () {
|
|
761
|
+
var hadReview = this.hasMarkupPanelToolbarItem;
|
|
762
|
+
var hasReview = acuiToolbarItemsIncludeItem(this.baseToolbarItems, 'markup-panel');
|
|
763
|
+
this.hasMarkupPanelToolbarItem = hasReview;
|
|
764
|
+
if (hasReview && !hadReview) {
|
|
765
|
+
this.ensureMarkupPanelCommandRegistered();
|
|
766
|
+
this.mountReviewDockUi();
|
|
767
|
+
}
|
|
768
|
+
else if (!hasReview && hadReview) {
|
|
769
|
+
this.teardownReviewUi();
|
|
770
|
+
this.unregisterMarkupPanelCommand();
|
|
771
|
+
}
|
|
772
|
+
};
|
|
773
|
+
/** Mounts or tears down measurement UI when the panel button is added or removed. */
|
|
774
|
+
AcApSimpleUiChrome.prototype.syncMeasurementToolbarItem = function () {
|
|
775
|
+
var hadPanel = this.hasMeasurementPanelToolbarItem;
|
|
776
|
+
var hasPanel = acuiToolbarItemsIncludeItem(this.baseToolbarItems, 'measurement-panel');
|
|
777
|
+
this.hasMeasurementPanelToolbarItem = hasPanel;
|
|
778
|
+
if (hasPanel && !hadPanel) {
|
|
779
|
+
this.ensureMeasurementPanelCommandRegistered();
|
|
780
|
+
this.mountMeasurementDockUi();
|
|
781
|
+
}
|
|
782
|
+
else if (!hasPanel && hadPanel) {
|
|
783
|
+
this.teardownMeasurementUi();
|
|
784
|
+
this.unregisterMeasurementPanelCommand();
|
|
785
|
+
}
|
|
786
|
+
};
|
|
787
|
+
/** Mounts or tears down find UI when the find toolbar button is added or removed. */
|
|
788
|
+
AcApSimpleUiChrome.prototype.syncFindToolbarItem = function () {
|
|
789
|
+
var hadFind = this.hasFindToolbarItem;
|
|
790
|
+
var hasFind = acuiToolbarItemsIncludeItem(this.baseToolbarItems, 'find');
|
|
791
|
+
this.hasFindToolbarItem = hasFind;
|
|
792
|
+
if (hasFind && !hadFind) {
|
|
793
|
+
this.ensureFindCommandRegistered();
|
|
794
|
+
this.mountFindDockUi();
|
|
795
|
+
}
|
|
796
|
+
else if (!hasFind && hadFind) {
|
|
797
|
+
this.teardownFindUi();
|
|
798
|
+
this.unregisterFindCommand();
|
|
799
|
+
}
|
|
800
|
+
};
|
|
801
|
+
/** Removes the `layer` command when the layer toolbar button is removed at runtime. */
|
|
802
|
+
AcApSimpleUiChrome.prototype.unregisterLayerCommand = function () {
|
|
803
|
+
if (!this.commandManager)
|
|
804
|
+
return;
|
|
805
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
806
|
+
var index = this.registeredCommands.findIndex(function (cmd) { return cmd.name === 'layer'; });
|
|
807
|
+
if (index === -1)
|
|
808
|
+
return;
|
|
809
|
+
this.commandManager.removeCmd(group, 'layer');
|
|
810
|
+
this.registeredCommands.splice(index, 1);
|
|
811
|
+
};
|
|
812
|
+
/** Registers the `layer` command when a layer button appears at runtime. */
|
|
813
|
+
AcApSimpleUiChrome.prototype.ensureLayerCommandRegistered = function () {
|
|
814
|
+
if (!this.commandManager)
|
|
815
|
+
return;
|
|
816
|
+
if (this.registeredCommands.some(function (cmd) { return cmd.name === 'layer'; }))
|
|
817
|
+
return;
|
|
818
|
+
this.registerLayerCommand(this.commandManager);
|
|
819
|
+
};
|
|
820
|
+
/** Removes the `markuppanel` command when the review toolbar button is removed. */
|
|
821
|
+
AcApSimpleUiChrome.prototype.unregisterMarkupPanelCommand = function () {
|
|
822
|
+
if (!this.commandManager)
|
|
823
|
+
return;
|
|
824
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
825
|
+
var index = this.registeredCommands.findIndex(function (cmd) { return cmd.name === 'markuppanel'; });
|
|
826
|
+
if (index === -1)
|
|
827
|
+
return;
|
|
828
|
+
this.commandManager.removeCmd(group, 'markuppanel');
|
|
829
|
+
this.registeredCommands.splice(index, 1);
|
|
830
|
+
};
|
|
831
|
+
/** Registers the `markuppanel` command when a review button appears at runtime. */
|
|
832
|
+
AcApSimpleUiChrome.prototype.ensureMarkupPanelCommandRegistered = function () {
|
|
833
|
+
if (!this.commandManager)
|
|
834
|
+
return;
|
|
835
|
+
if (this.registeredCommands.some(function (cmd) { return cmd.name === 'markuppanel'; }))
|
|
836
|
+
return;
|
|
837
|
+
this.registerMarkupPanelCommand(this.commandManager);
|
|
838
|
+
};
|
|
839
|
+
/** Removes the `measurementpanel` command when the measurement panel button is removed. */
|
|
840
|
+
AcApSimpleUiChrome.prototype.unregisterMeasurementPanelCommand = function () {
|
|
841
|
+
if (!this.commandManager)
|
|
842
|
+
return;
|
|
843
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
844
|
+
var index = this.registeredCommands.findIndex(function (cmd) { return cmd.name === 'measurementpanel'; });
|
|
845
|
+
if (index === -1)
|
|
846
|
+
return;
|
|
847
|
+
this.commandManager.removeCmd(group, 'measurementpanel');
|
|
848
|
+
this.registeredCommands.splice(index, 1);
|
|
849
|
+
};
|
|
850
|
+
/** Registers the `measurementpanel` command when a panel button appears at runtime. */
|
|
851
|
+
AcApSimpleUiChrome.prototype.ensureMeasurementPanelCommandRegistered = function () {
|
|
852
|
+
if (!this.commandManager)
|
|
853
|
+
return;
|
|
854
|
+
if (this.registeredCommands.some(function (cmd) { return cmd.name === 'measurementpanel'; })) {
|
|
855
|
+
return;
|
|
856
|
+
}
|
|
857
|
+
this.registerMeasurementPanelCommand(this.commandManager);
|
|
858
|
+
};
|
|
859
|
+
/** Removes the `find` command when the find toolbar button is removed. */
|
|
860
|
+
AcApSimpleUiChrome.prototype.unregisterFindCommand = function () {
|
|
861
|
+
if (!this.commandManager)
|
|
862
|
+
return;
|
|
863
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
864
|
+
var index = this.registeredCommands.findIndex(function (cmd) { return cmd.name === 'find'; });
|
|
865
|
+
if (index === -1)
|
|
866
|
+
return;
|
|
867
|
+
this.commandManager.removeCmd(group, 'find');
|
|
868
|
+
this.registeredCommands.splice(index, 1);
|
|
869
|
+
};
|
|
870
|
+
/** Registers the `find` command when a find button appears at runtime. */
|
|
871
|
+
AcApSimpleUiChrome.prototype.ensureFindCommandRegistered = function () {
|
|
872
|
+
var _this = this;
|
|
873
|
+
if (!this.commandManager)
|
|
874
|
+
return;
|
|
875
|
+
if (this.registeredCommands.some(function (cmd) { return cmd.name === 'find'; }))
|
|
876
|
+
return;
|
|
877
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
878
|
+
this.commandManager.addCommand(group, 'find', 'find', new AcApFindUiCmd({
|
|
879
|
+
prepare: function () {
|
|
880
|
+
_this.mountFindDockUi();
|
|
881
|
+
_this.tryUpgradeDockMountTarget();
|
|
882
|
+
},
|
|
883
|
+
toggle: function () {
|
|
884
|
+
var _a, _b;
|
|
885
|
+
(_a = _this.dockPanel) === null || _a === void 0 ? void 0 : _a.open(FIND_TAB_ID);
|
|
886
|
+
(_b = _this.findPaletteView) === null || _b === void 0 ? void 0 : _b.focus();
|
|
887
|
+
}
|
|
888
|
+
}));
|
|
889
|
+
this.registeredCommands.push({ group: group, name: 'find' });
|
|
890
|
+
};
|
|
891
|
+
/** Registers the `layer` command with dock preparation wired in. */
|
|
892
|
+
AcApSimpleUiChrome.prototype.registerLayerCommand = function (commandManager) {
|
|
893
|
+
if (this.registeredCommands.some(function (cmd) { return cmd.name === 'layer'; }))
|
|
894
|
+
return;
|
|
895
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
896
|
+
commandManager.addCommand(group, 'layer', 'layer', this.createLayerCommand());
|
|
897
|
+
this.registeredCommands.push({ group: group, name: 'layer' });
|
|
898
|
+
};
|
|
899
|
+
/** Creates the `layer` command that prepares the dock panel before opening layers. */
|
|
900
|
+
AcApSimpleUiChrome.prototype.createLayerCommand = function () {
|
|
901
|
+
var _this = this;
|
|
902
|
+
return new AcApLayerUiCmd({
|
|
903
|
+
prepare: function () { return _this.prepareLayerDockForCommand(); },
|
|
904
|
+
toggle: function () { return _this.layerUiControllerHolder.toggleFromCommand(); }
|
|
905
|
+
});
|
|
906
|
+
};
|
|
907
|
+
/** Ensures the dock panel and layers tab exist for the `layer` command. */
|
|
908
|
+
AcApSimpleUiChrome.prototype.prepareLayerDockForCommand = function () {
|
|
909
|
+
this.mountLayerDockUi();
|
|
910
|
+
this.tryUpgradeDockMountTarget();
|
|
911
|
+
};
|
|
912
|
+
/** Registers the `markuppanel` command with dock preparation wired in. */
|
|
913
|
+
AcApSimpleUiChrome.prototype.registerMarkupPanelCommand = function (commandManager) {
|
|
914
|
+
if (this.registeredCommands.some(function (cmd) { return cmd.name === 'markuppanel'; }))
|
|
915
|
+
return;
|
|
916
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
917
|
+
commandManager.addCommand(group, 'markuppanel', 'markuppanel', this.createMarkupPanelCommand());
|
|
918
|
+
this.registeredCommands.push({ group: group, name: 'markuppanel' });
|
|
919
|
+
};
|
|
920
|
+
/** Creates the `markuppanel` command that prepares the dock panel before opening review. */
|
|
921
|
+
AcApSimpleUiChrome.prototype.createMarkupPanelCommand = function () {
|
|
922
|
+
var _this = this;
|
|
923
|
+
return new AcApMarkupPanelUiCmd({
|
|
924
|
+
prepare: function () { return _this.prepareReviewDockForCommand(); },
|
|
925
|
+
toggle: function () { var _a; return (_a = _this.dockPanel) === null || _a === void 0 ? void 0 : _a.open(REVIEW_TAB_ID); }
|
|
926
|
+
});
|
|
927
|
+
};
|
|
928
|
+
/** Ensures the dock panel and review tab exist for the `markuppanel` command. */
|
|
929
|
+
AcApSimpleUiChrome.prototype.prepareReviewDockForCommand = function () {
|
|
930
|
+
this.mountReviewDockUi();
|
|
931
|
+
this.tryUpgradeDockMountTarget();
|
|
932
|
+
};
|
|
933
|
+
/** Registers the `measurementpanel` command with dock preparation wired in. */
|
|
934
|
+
AcApSimpleUiChrome.prototype.registerMeasurementPanelCommand = function (commandManager) {
|
|
935
|
+
if (this.registeredCommands.some(function (cmd) { return cmd.name === 'measurementpanel'; })) {
|
|
936
|
+
return;
|
|
937
|
+
}
|
|
938
|
+
var group = AcEdCommandStack.SYSTEMT_COMMAND_GROUP_NAME;
|
|
939
|
+
commandManager.addCommand(group, 'measurementpanel', 'measurementpanel', this.createMeasurementPanelCommand());
|
|
940
|
+
this.registeredCommands.push({ group: group, name: 'measurementpanel' });
|
|
941
|
+
};
|
|
942
|
+
/** Creates the `measurementpanel` command that prepares the dock before opening. */
|
|
943
|
+
AcApSimpleUiChrome.prototype.createMeasurementPanelCommand = function () {
|
|
944
|
+
var _this = this;
|
|
945
|
+
return new AcApMeasurementPanelUiCmd({
|
|
946
|
+
prepare: function () { return _this.prepareMeasurementDockForCommand(); },
|
|
947
|
+
toggle: function () { var _a; return (_a = _this.dockPanel) === null || _a === void 0 ? void 0 : _a.open(MEASUREMENTS_TAB_ID); }
|
|
948
|
+
});
|
|
949
|
+
};
|
|
950
|
+
/** Ensures the dock panel and measurements tab exist for the command. */
|
|
951
|
+
AcApSimpleUiChrome.prototype.prepareMeasurementDockForCommand = function () {
|
|
952
|
+
this.mountMeasurementDockUi();
|
|
953
|
+
this.tryUpgradeDockMountTarget();
|
|
954
|
+
};
|
|
955
|
+
/** Ensures the dock panel exists, tabs are mounted, and mount target is current. */
|
|
956
|
+
AcApSimpleUiChrome.prototype.ensureDockReady = function () {
|
|
957
|
+
var _a;
|
|
958
|
+
if (!this.dockPanel) {
|
|
959
|
+
this.prepareDockPanel();
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
if (this.hasLayerToolbarItem && !this.dockPanel.hasTab(LAYERS_TAB_ID)) {
|
|
963
|
+
this.mountLayerDockUi();
|
|
964
|
+
}
|
|
965
|
+
if (this.hasMarkupPanelToolbarItem &&
|
|
966
|
+
!this.dockPanel.hasTab(REVIEW_TAB_ID)) {
|
|
967
|
+
this.mountReviewDockUi();
|
|
968
|
+
}
|
|
969
|
+
if (this.hasMeasurementPanelToolbarItem &&
|
|
970
|
+
!this.dockPanel.hasTab(MEASUREMENTS_TAB_ID)) {
|
|
971
|
+
this.mountMeasurementDockUi();
|
|
972
|
+
}
|
|
973
|
+
if (this.hasFindToolbarItem && !this.dockPanel.hasTab(FIND_TAB_ID)) {
|
|
974
|
+
this.mountFindDockUi();
|
|
975
|
+
}
|
|
976
|
+
this.tryUpgradeDockMountTarget();
|
|
977
|
+
this.dockPanel.ensureMounted();
|
|
978
|
+
(_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.syncInParentLayout();
|
|
979
|
+
};
|
|
980
|
+
/** Ensures the dock panel exists, is mounted on the current target, and has tabs when applicable. */
|
|
981
|
+
AcApSimpleUiChrome.prototype.prepareDockPanel = function () {
|
|
982
|
+
if (this.hasLayerToolbarItem) {
|
|
983
|
+
this.mountLayerDockUi();
|
|
984
|
+
}
|
|
985
|
+
if (this.hasMarkupPanelToolbarItem) {
|
|
986
|
+
this.mountReviewDockUi();
|
|
987
|
+
}
|
|
988
|
+
if (this.hasMeasurementPanelToolbarItem) {
|
|
989
|
+
this.mountMeasurementDockUi();
|
|
990
|
+
}
|
|
991
|
+
if (this.hasFindToolbarItem) {
|
|
992
|
+
this.mountFindDockUi();
|
|
993
|
+
}
|
|
994
|
+
if (!this.dockPanel) {
|
|
995
|
+
this.ensureDockPanel();
|
|
996
|
+
}
|
|
997
|
+
this.tryUpgradeDockMountTarget();
|
|
998
|
+
};
|
|
999
|
+
/** Closes open sub-toolbars when {@link AcUiSubToolbarOptions.replaceOnNested} is set. */
|
|
1000
|
+
AcApSimpleUiChrome.prototype.dismissStripsForDockPanel = function () {
|
|
1001
|
+
var _a;
|
|
1002
|
+
if ((_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.replaceOnNested) {
|
|
1003
|
+
this.toolbar.dismissOpenChildren();
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
/** Closes the dock panel when {@link AcUiSubToolbarOptions.replaceOnNested} is set. */
|
|
1007
|
+
AcApSimpleUiChrome.prototype.dismissDockForExclusiveChrome = function () {
|
|
1008
|
+
var _a, _b;
|
|
1009
|
+
if ((_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.replaceOnNested) {
|
|
1010
|
+
(_b = this.dockPanel) === null || _b === void 0 ? void 0 : _b.close();
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
1013
|
+
/** Ensures the dock panel container exists. */
|
|
1014
|
+
AcApSimpleUiChrome.prototype.ensureDockPanel = function () {
|
|
1015
|
+
var _this = this;
|
|
1016
|
+
var mountEl = this.getDockMountEl();
|
|
1017
|
+
if (!mountEl || !this.i18n || !this.dockPanelDefaults) {
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
if (this.dockPanel) {
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
this.dockPanel = new AcUiDockPanel({
|
|
1024
|
+
host: mountEl,
|
|
1025
|
+
t: function (key) { return AcApI18n.t(key); },
|
|
1026
|
+
defaultSide: this.dockPanelDefaults.defaultSide,
|
|
1027
|
+
defaultOpen: this.dockPanelDefaults.defaultOpen,
|
|
1028
|
+
defaultHeight: this.dockPanelDefaults.defaultHeight,
|
|
1029
|
+
defaultWidth: this.dockPanelDefaults.defaultWidth,
|
|
1030
|
+
onOpen: function () { return _this.dismissStripsForDockPanel(); }
|
|
1031
|
+
});
|
|
1032
|
+
this.syncToolbarMountAfterDockChange();
|
|
1033
|
+
};
|
|
1034
|
+
/** Resolves the dock mount element (lazy; canvas parent may appear after load). */
|
|
1035
|
+
AcApSimpleUiChrome.prototype.getDockMountEl = function () {
|
|
1036
|
+
if (!this.hostEl)
|
|
1037
|
+
return undefined;
|
|
1038
|
+
return acuiResolveDockMountTarget(this.hostEl, this.dockPanelMountTargetOption);
|
|
1039
|
+
};
|
|
1040
|
+
/**
|
|
1041
|
+
* Moves the dock panel from a host fallback to the canvas parent once available.
|
|
1042
|
+
*/
|
|
1043
|
+
AcApSimpleUiChrome.prototype.tryUpgradeDockMountTarget = function () {
|
|
1044
|
+
if (this.dockPanelMountTargetOption || !this.hostEl || !this.dockPanel) {
|
|
1045
|
+
return;
|
|
1046
|
+
}
|
|
1047
|
+
var preferred = acuiResolveDockMountTarget(this.hostEl);
|
|
1048
|
+
var current = this.dockPanel.getMountHost();
|
|
1049
|
+
if (current === preferred) {
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
// Only upgrade from the host fallback to the canvas parent.
|
|
1053
|
+
if (current !== this.hostEl || preferred === this.hostEl) {
|
|
1054
|
+
return;
|
|
1055
|
+
}
|
|
1056
|
+
this.dockPanel.reparentTo(preferred);
|
|
1057
|
+
this.refreshLayerDockController();
|
|
1058
|
+
this.syncToolbarMountAfterDockChange();
|
|
1059
|
+
};
|
|
1060
|
+
/** Rebinds the layer dock controller after the dock panel moves. */
|
|
1061
|
+
AcApSimpleUiChrome.prototype.refreshLayerDockController = function () {
|
|
1062
|
+
var _a, _b;
|
|
1063
|
+
if (!((_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.hasTab(LAYERS_TAB_ID))) {
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
(_b = this.layerDockController) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
1067
|
+
this.layerDockController = new AcUiLayerDockController(this.dockPanel, LAYERS_TAB_ID);
|
|
1068
|
+
this.layerUiControllerHolder.current = this.layerDockController;
|
|
1069
|
+
};
|
|
1070
|
+
/** Mounts the layer list in the dock panel layers tab. */
|
|
1071
|
+
AcApSimpleUiChrome.prototype.mountLayerDockUi = function () {
|
|
1072
|
+
if (!this.hostEl || !this.i18n)
|
|
1073
|
+
return;
|
|
1074
|
+
this.ensureDockPanel();
|
|
1075
|
+
if (!this.dockPanel)
|
|
1076
|
+
return;
|
|
1077
|
+
if (this.dockPanel.hasTab(LAYERS_TAB_ID)) {
|
|
1078
|
+
this.refreshLayerDockController();
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
this.layerListView = new AcUiLayerListView({
|
|
1082
|
+
editor: AcApDocManager.instance,
|
|
1083
|
+
i18n: this.i18n,
|
|
1084
|
+
host: this.hostEl,
|
|
1085
|
+
showHeader: false
|
|
1086
|
+
});
|
|
1087
|
+
var added = this.dockPanel.addTab({
|
|
1088
|
+
id: LAYERS_TAB_ID,
|
|
1089
|
+
labelKey: 'main.dockPanel.tab.layers',
|
|
1090
|
+
content: this.layerListView.element
|
|
1091
|
+
});
|
|
1092
|
+
if (!added) {
|
|
1093
|
+
this.layerListView.destroy();
|
|
1094
|
+
this.layerListView = undefined;
|
|
1095
|
+
return;
|
|
1096
|
+
}
|
|
1097
|
+
this.layerDockController = new AcUiLayerDockController(this.dockPanel, LAYERS_TAB_ID);
|
|
1098
|
+
this.layerUiControllerHolder.current = this.layerDockController;
|
|
1099
|
+
};
|
|
1100
|
+
/** Tears down active layer UI without removing the dock shell when other tabs remain. */
|
|
1101
|
+
AcApSimpleUiChrome.prototype.teardownLayerUi = function () {
|
|
1102
|
+
var _a, _b, _c;
|
|
1103
|
+
(_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.removeTab(LAYERS_TAB_ID);
|
|
1104
|
+
(_b = this.layerListView) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
1105
|
+
this.layerListView = undefined;
|
|
1106
|
+
(_c = this.layerDockController) === null || _c === void 0 ? void 0 : _c.destroy();
|
|
1107
|
+
this.layerDockController = undefined;
|
|
1108
|
+
this.layerUiControllerHolder.current = undefined;
|
|
1109
|
+
this.destroyDockIfUnused();
|
|
1110
|
+
};
|
|
1111
|
+
/** Mounts the review palette in the dock panel review tab. */
|
|
1112
|
+
AcApSimpleUiChrome.prototype.mountReviewDockUi = function () {
|
|
1113
|
+
if (!this.hostEl || !this.i18n)
|
|
1114
|
+
return;
|
|
1115
|
+
this.ensureDockPanel();
|
|
1116
|
+
if (!this.dockPanel)
|
|
1117
|
+
return;
|
|
1118
|
+
if (this.dockPanel.hasTab(REVIEW_TAB_ID)) {
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
this.reviewPaletteView = new AcUiReviewPaletteView({
|
|
1122
|
+
editor: AcApDocManager.instance,
|
|
1123
|
+
i18n: this.i18n
|
|
1124
|
+
});
|
|
1125
|
+
var added = this.dockPanel.addTab({
|
|
1126
|
+
id: REVIEW_TAB_ID,
|
|
1127
|
+
labelKey: 'main.dockPanel.tab.review',
|
|
1128
|
+
content: this.reviewPaletteView.element
|
|
1129
|
+
});
|
|
1130
|
+
if (!added) {
|
|
1131
|
+
this.reviewPaletteView.destroy();
|
|
1132
|
+
this.reviewPaletteView = undefined;
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
/** Tears down review UI without removing the dock shell when other tabs remain. */
|
|
1136
|
+
AcApSimpleUiChrome.prototype.teardownReviewUi = function () {
|
|
1137
|
+
var _a, _b;
|
|
1138
|
+
(_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.removeTab(REVIEW_TAB_ID);
|
|
1139
|
+
(_b = this.reviewPaletteView) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
1140
|
+
this.reviewPaletteView = undefined;
|
|
1141
|
+
this.destroyDockIfUnused();
|
|
1142
|
+
};
|
|
1143
|
+
/** Mounts the measurement list in the dock panel measurements tab. */
|
|
1144
|
+
AcApSimpleUiChrome.prototype.mountMeasurementDockUi = function () {
|
|
1145
|
+
if (!this.hostEl || !this.i18n)
|
|
1146
|
+
return;
|
|
1147
|
+
this.ensureDockPanel();
|
|
1148
|
+
if (!this.dockPanel)
|
|
1149
|
+
return;
|
|
1150
|
+
if (this.dockPanel.hasTab(MEASUREMENTS_TAB_ID)) {
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
this.measurementPaletteView = new AcUiMeasurementPaletteView({
|
|
1154
|
+
editor: AcApDocManager.instance,
|
|
1155
|
+
i18n: this.i18n
|
|
1156
|
+
});
|
|
1157
|
+
var added = this.dockPanel.addTab({
|
|
1158
|
+
id: MEASUREMENTS_TAB_ID,
|
|
1159
|
+
labelKey: 'main.dockPanel.tab.measurements',
|
|
1160
|
+
content: this.measurementPaletteView.element
|
|
1161
|
+
});
|
|
1162
|
+
if (!added) {
|
|
1163
|
+
this.measurementPaletteView.destroy();
|
|
1164
|
+
this.measurementPaletteView = undefined;
|
|
1165
|
+
}
|
|
1166
|
+
};
|
|
1167
|
+
/** Tears down measurement UI without removing the dock shell when other tabs remain. */
|
|
1168
|
+
AcApSimpleUiChrome.prototype.teardownMeasurementUi = function () {
|
|
1169
|
+
var _a, _b;
|
|
1170
|
+
(_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.removeTab(MEASUREMENTS_TAB_ID);
|
|
1171
|
+
(_b = this.measurementPaletteView) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
1172
|
+
this.measurementPaletteView = undefined;
|
|
1173
|
+
this.destroyDockIfUnused();
|
|
1174
|
+
};
|
|
1175
|
+
/** Mounts the text search view in the dock panel find tab. */
|
|
1176
|
+
AcApSimpleUiChrome.prototype.mountFindDockUi = function () {
|
|
1177
|
+
if (!this.hostEl || !this.i18n)
|
|
1178
|
+
return;
|
|
1179
|
+
this.ensureDockPanel();
|
|
1180
|
+
if (!this.dockPanel)
|
|
1181
|
+
return;
|
|
1182
|
+
if (this.dockPanel.hasTab(FIND_TAB_ID)) {
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
this.findPaletteView = new AcUiFindPaletteView({
|
|
1186
|
+
editor: AcApDocManager.instance,
|
|
1187
|
+
i18n: this.i18n
|
|
1188
|
+
});
|
|
1189
|
+
var added = this.dockPanel.addTab({
|
|
1190
|
+
id: FIND_TAB_ID,
|
|
1191
|
+
labelKey: 'main.dockPanel.tab.find',
|
|
1192
|
+
content: this.findPaletteView.element
|
|
1193
|
+
});
|
|
1194
|
+
if (!added) {
|
|
1195
|
+
this.findPaletteView.destroy();
|
|
1196
|
+
this.findPaletteView = undefined;
|
|
1197
|
+
}
|
|
1198
|
+
};
|
|
1199
|
+
/** Tears down find UI without removing the dock shell when other tabs remain. */
|
|
1200
|
+
AcApSimpleUiChrome.prototype.teardownFindUi = function () {
|
|
1201
|
+
var _a, _b;
|
|
1202
|
+
(_a = this.dockPanel) === null || _a === void 0 ? void 0 : _a.removeTab(FIND_TAB_ID);
|
|
1203
|
+
(_b = this.findPaletteView) === null || _b === void 0 ? void 0 : _b.destroy();
|
|
1204
|
+
this.findPaletteView = undefined;
|
|
1205
|
+
this.destroyDockIfUnused();
|
|
1206
|
+
};
|
|
1207
|
+
/** Closes and optionally destroys the dock panel when it has no remaining tabs. */
|
|
1208
|
+
AcApSimpleUiChrome.prototype.destroyDockIfUnused = function () {
|
|
1209
|
+
if (!this.dockPanel)
|
|
1210
|
+
return;
|
|
1211
|
+
if (this.dockPanel.hasTabs)
|
|
1212
|
+
return;
|
|
1213
|
+
this.dockPanel.close();
|
|
1214
|
+
if (this.dockPanelExplicitlyEnabled)
|
|
1215
|
+
return;
|
|
1216
|
+
this.dockPanel.destroy();
|
|
1217
|
+
this.dockPanel = undefined;
|
|
1218
|
+
this.syncToolbarMountAfterDockChange();
|
|
1219
|
+
};
|
|
1220
|
+
/**
|
|
1221
|
+
* Re-resolves the toolbar mount after dock wrap/unwrap, which can detach a
|
|
1222
|
+
* stale `dock-main` host or change `canvas.parentElement`.
|
|
1223
|
+
*/
|
|
1224
|
+
AcApSimpleUiChrome.prototype.syncToolbarMountAfterDockChange = function () {
|
|
1225
|
+
if (!this.toolbar || !this.hostEl)
|
|
1226
|
+
return;
|
|
1227
|
+
var preferred = this.getToolbarMountEl();
|
|
1228
|
+
if (!preferred)
|
|
1229
|
+
return;
|
|
1230
|
+
if (preferred !== this.toolbarMountEl || !this.toolbar.isRootConnected()) {
|
|
1231
|
+
this.toolbar.reparentTo(preferred);
|
|
1232
|
+
this.toolbarMountEl = preferred;
|
|
1233
|
+
}
|
|
1234
|
+
this.toolbar.syncInParentLayout();
|
|
1235
|
+
};
|
|
1236
|
+
/** Updates toolbar placement. */
|
|
1237
|
+
AcApSimpleUiChrome.prototype.applyToolbarPlacement = function (placement) {
|
|
1238
|
+
var _a;
|
|
1239
|
+
this.toolbarPlacement = placement;
|
|
1240
|
+
(_a = this.toolbar) === null || _a === void 0 ? void 0 : _a.setPlacement(placement);
|
|
1241
|
+
};
|
|
1242
|
+
/**
|
|
1243
|
+
* Tears down UI, unregisters commands, and removes injected styles if unused.
|
|
1244
|
+
*
|
|
1245
|
+
* @param commandManager - Command stack used to remove registered commands.
|
|
1246
|
+
*/
|
|
1247
|
+
AcApSimpleUiChrome.prototype.dispose = function (commandManager) {
|
|
1248
|
+
var e_1, _a;
|
|
1249
|
+
var _b, _c, _d, _e, _f;
|
|
1250
|
+
var stack = commandManager !== null && commandManager !== void 0 ? commandManager : this.commandManager;
|
|
1251
|
+
AcApPaletteService.setHost(undefined);
|
|
1252
|
+
(_b = this.unsubscribeLayout) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
1253
|
+
this.unsubscribeLayout = undefined;
|
|
1254
|
+
AcApI18n.events.localeChanged.removeEventListener(this.handleLocaleChanged);
|
|
1255
|
+
AcApDocManager.instance.events.documentActivated.removeEventListener(this.handleDocumentActivatedForDock);
|
|
1256
|
+
if (stack) {
|
|
1257
|
+
try {
|
|
1258
|
+
for (var _g = __values(this.registeredCommands), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
1259
|
+
var cmd = _h.value;
|
|
1260
|
+
stack.removeCmd(cmd.group, cmd.name);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
1264
|
+
finally {
|
|
1265
|
+
try {
|
|
1266
|
+
if (_h && !_h.done && (_a = _g.return)) _a.call(_g);
|
|
1267
|
+
}
|
|
1268
|
+
finally { if (e_1) throw e_1.error; }
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
this.registeredCommands = [];
|
|
1272
|
+
this.teardownLayerUi();
|
|
1273
|
+
this.teardownReviewUi();
|
|
1274
|
+
this.teardownMeasurementUi();
|
|
1275
|
+
this.teardownFindUi();
|
|
1276
|
+
(_c = this.toolbarDocUnbind) === null || _c === void 0 ? void 0 : _c.call(this);
|
|
1277
|
+
this.toolbarDocUnbind = undefined;
|
|
1278
|
+
(_d = this.toolbar) === null || _d === void 0 ? void 0 : _d.destroy();
|
|
1279
|
+
(_e = this.dockPanel) === null || _e === void 0 ? void 0 : _e.destroy();
|
|
1280
|
+
this.toolbar = undefined;
|
|
1281
|
+
this.toolbarMountEl = undefined;
|
|
1282
|
+
this.toolbarMountTargetOption = undefined;
|
|
1283
|
+
this.dockPanel = undefined;
|
|
1284
|
+
this.hostEl = undefined;
|
|
1285
|
+
this.dockPanelMountTargetOption = undefined;
|
|
1286
|
+
this.baseToolbarItems = [];
|
|
1287
|
+
this.toolbarItemsInput = 'default';
|
|
1288
|
+
this.toolbarItemsOverridden = false;
|
|
1289
|
+
this.toolbarLayoutSwitcher = undefined;
|
|
1290
|
+
this.hasLayerToolbarItem = false;
|
|
1291
|
+
this.hasMarkupPanelToolbarItem = false;
|
|
1292
|
+
this.hasMeasurementPanelToolbarItem = false;
|
|
1293
|
+
this.hasFindToolbarItem = false;
|
|
1294
|
+
this.commandManager = undefined;
|
|
1295
|
+
this.i18n = undefined;
|
|
1296
|
+
(_f = this.themeSync) === null || _f === void 0 ? void 0 : _f.stop();
|
|
1297
|
+
this.themeSync = undefined;
|
|
1298
|
+
AcApSettingManager.instance.clearSessionOverride('isShowRibbon');
|
|
1299
|
+
acuiRemoveUiStylesIfUnused();
|
|
1300
|
+
};
|
|
1301
|
+
/** Sets {@link AcApI18n.currentLocale} to one of the supported locales. */
|
|
1302
|
+
AcApSimpleUiChrome.prototype.setLocale = function (locale) {
|
|
1303
|
+
AcApI18n.setCurrentLocale(locale);
|
|
1304
|
+
};
|
|
1305
|
+
return AcApSimpleUiChrome;
|
|
1306
|
+
}());
|
|
1307
|
+
export { AcApSimpleUiChrome };
|
|
1308
|
+
//# sourceMappingURL=AcApSimpleUiChrome.js.map
|