@mlightcad/cad-simple-viewer 1.7.0 → 1.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -1
- package/dist/cad-simple-viewer.js +17658 -13023
- package/dist/cad-simple-viewer.umd.cjs +985 -114
- package/dist/mtext-renderer-worker.js +7390 -7160
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +4 -3
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/app/AcApDocManager.d.ts +41 -18
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +89 -49
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApDocument.d.ts +3 -0
- package/lib/app/AcApDocument.d.ts.map +1 -1
- package/lib/app/AcApDocument.js +31 -24
- package/lib/app/AcApDocument.js.map +1 -1
- package/lib/app/AcApOpenDatabaseOptions.d.ts +33 -7
- package/lib/app/AcApOpenDatabaseOptions.d.ts.map +1 -1
- package/lib/app/AcApOpenDatabaseOptions.js +1 -1
- package/lib/app/AcApOpenDatabaseOptions.js.map +1 -1
- package/lib/app/AcApOpenFileProgressController.d.ts +13 -4
- package/lib/app/AcApOpenFileProgressController.d.ts.map +1 -1
- package/lib/app/AcApOpenFileProgressController.js +25 -6
- package/lib/app/AcApOpenFileProgressController.js.map +1 -1
- package/lib/app/AcApWorkerAssets.d.ts +3 -3
- package/lib/app/AcApWorkerAssets.d.ts.map +1 -1
- package/lib/app/AcApWorkerAssets.js +3 -3
- package/lib/app/AcApWorkerAssets.js.map +1 -1
- package/lib/app/index.d.ts +1 -0
- package/lib/app/index.d.ts.map +1 -1
- package/lib/app/index.js +1 -0
- package/lib/app/index.js.map +1 -1
- package/lib/app/notification/AcApNotificationEventBridge.d.ts +130 -0
- package/lib/app/notification/AcApNotificationEventBridge.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationEventBridge.js +309 -0
- package/lib/app/notification/AcApNotificationEventBridge.js.map +1 -0
- package/lib/app/notification/AcApNotificationService.d.ts +185 -0
- package/lib/app/notification/AcApNotificationService.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationService.js +271 -0
- package/lib/app/notification/AcApNotificationService.js.map +1 -0
- package/lib/app/notification/AcApNotificationStore.d.ts +147 -0
- package/lib/app/notification/AcApNotificationStore.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationStore.js +345 -0
- package/lib/app/notification/AcApNotificationStore.js.map +1 -0
- package/lib/app/notification/AcApNotificationTypes.d.ts +195 -0
- package/lib/app/notification/AcApNotificationTypes.d.ts.map +1 -0
- package/lib/app/notification/AcApNotificationTypes.js +78 -0
- package/lib/app/notification/AcApNotificationTypes.js.map +1 -0
- package/lib/app/notification/index.d.ts +13 -0
- package/lib/app/notification/index.d.ts.map +1 -0
- package/lib/app/notification/index.js +13 -0
- package/lib/app/notification/index.js.map +1 -0
- package/lib/command/AcApInstallDrawStyleSessionAccessory.js +11 -7
- package/lib/command/AcApInstallDrawStyleSessionAccessory.js.map +1 -1
- package/lib/command/AcApSwitchBgCmd.d.ts.map +1 -1
- package/lib/command/AcApSwitchBgCmd.js +7 -2
- package/lib/command/AcApSwitchBgCmd.js.map +1 -1
- package/lib/command/AcApToolbarDocBind.d.ts +19 -0
- package/lib/command/AcApToolbarDocBind.d.ts.map +1 -0
- package/lib/command/AcApToolbarDocBind.js +62 -0
- package/lib/command/AcApToolbarDocBind.js.map +1 -0
- package/lib/command/convert/AcApConvertToBmpCmd.d.ts +14 -0
- package/lib/command/convert/AcApConvertToBmpCmd.d.ts.map +1 -0
- package/lib/command/convert/AcApConvertToBmpCmd.js +34 -0
- package/lib/command/convert/AcApConvertToBmpCmd.js.map +1 -0
- package/lib/command/convert/AcApConvertToJpgCmd.d.ts +14 -0
- package/lib/command/convert/AcApConvertToJpgCmd.d.ts.map +1 -0
- package/lib/command/convert/AcApConvertToJpgCmd.js +34 -0
- package/lib/command/convert/AcApConvertToJpgCmd.js.map +1 -0
- package/lib/command/convert/AcApConvertToPngCmd.d.ts +4 -36
- package/lib/command/convert/AcApConvertToPngCmd.d.ts.map +1 -1
- package/lib/command/convert/AcApConvertToPngCmd.js +4 -138
- package/lib/command/convert/AcApConvertToPngCmd.js.map +1 -1
- package/lib/command/convert/AcApConvertToRasterImageCmd.d.ts +40 -0
- package/lib/command/convert/AcApConvertToRasterImageCmd.d.ts.map +1 -0
- package/lib/command/convert/AcApConvertToRasterImageCmd.js +161 -0
- package/lib/command/convert/AcApConvertToRasterImageCmd.js.map +1 -0
- package/lib/command/convert/{AcApPngConvertor.d.ts → AcApRasterImageConvertor.d.ts} +36 -12
- package/lib/command/convert/AcApRasterImageConvertor.d.ts.map +1 -0
- package/lib/command/convert/{AcApPngConvertor.js → AcApRasterImageConvertor.js} +163 -32
- package/lib/command/convert/AcApRasterImageConvertor.js.map +1 -0
- package/lib/command/convert/index.d.ts +4 -1
- package/lib/command/convert/index.d.ts.map +1 -1
- package/lib/command/convert/index.js +4 -1
- package/lib/command/convert/index.js.map +1 -1
- package/lib/command/index.d.ts +2 -0
- package/lib/command/index.d.ts.map +1 -1
- package/lib/command/index.js +2 -0
- package/lib/command/index.js.map +1 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.js +51 -1
- package/lib/command/markup/AcApMarkupCalloutCmd.js.map +1 -1
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts +5 -0
- package/lib/command/markup/AcApMarkupCmdUtil.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupCmdUtil.js +27 -9
- package/lib/command/markup/AcApMarkupCmdUtil.js.map +1 -1
- package/lib/command/markup/AcApMarkupShapeCallout.d.ts.map +1 -1
- package/lib/command/markup/AcApMarkupShapeCallout.js +49 -1
- package/lib/command/markup/AcApMarkupShapeCallout.js.map +1 -1
- package/lib/editor/global/AcEdUiLayout.d.ts +6 -0
- package/lib/editor/global/AcEdUiLayout.d.ts.map +1 -1
- package/lib/editor/global/AcEdUiLayout.js +6 -0
- package/lib/editor/global/AcEdUiLayout.js.map +1 -1
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.d.ts +31 -0
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.d.ts.map +1 -0
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.js +67 -0
- package/lib/editor/input/ui/AcEdCanvasTouchCalloutGuard.js.map +1 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts +2 -0
- package/lib/editor/input/ui/AcEdFloatingInput.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInput.js +13 -2
- package/lib/editor/input/ui/AcEdFloatingInput.js.map +1 -1
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts +6 -0
- package/lib/editor/input/ui/AcEdFloatingInputTypes.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdInputManager.js +47 -7
- package/lib/editor/input/ui/AcEdInputManager.js.map +1 -1
- package/lib/editor/input/ui/AcEdMTextEditor.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdMTextEditor.js +2 -1
- package/lib/editor/input/ui/AcEdMTextEditor.js.map +1 -1
- package/lib/editor/input/ui/AcEdMobileBoxGesture.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdMobileBoxGesture.js +2 -0
- package/lib/editor/input/ui/AcEdMobileBoxGesture.js.map +1 -1
- package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts +18 -4
- package/lib/editor/input/ui/AcEdMobileCommandChrome.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdMobileCommandChrome.js +14 -0
- package/lib/editor/input/ui/AcEdMobileCommandChrome.js.map +1 -1
- package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts +10 -2
- package/lib/editor/input/ui/AcEdSessionAccessoryController.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdSessionAccessoryController.js +15 -4
- package/lib/editor/input/ui/AcEdSessionAccessoryController.js.map +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.d.ts.map +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.js +1 -1
- package/lib/editor/input/ui/AcEdTouchPointTiming.js.map +1 -1
- package/lib/editor/input/ui/index.d.ts +1 -0
- package/lib/editor/input/ui/index.d.ts.map +1 -1
- package/lib/editor/input/ui/index.js +1 -0
- package/lib/editor/input/ui/index.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +12 -0
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js +19 -9
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts +36 -0
- package/lib/editor/view/AcEdSelectionBoxIntersect.d.ts.map +1 -0
- package/lib/editor/view/AcEdSelectionBoxIntersect.js +113 -0
- package/lib/editor/view/AcEdSelectionBoxIntersect.js.map +1 -0
- package/lib/editor/view/index.d.ts +1 -0
- package/lib/editor/view/index.d.ts.map +1 -1
- package/lib/editor/view/index.js +1 -0
- package/lib/editor/view/index.js.map +1 -1
- package/lib/i18n/AcApI18n.d.ts +2 -1
- package/lib/i18n/AcApI18n.d.ts.map +1 -1
- package/lib/i18n/AcApI18n.js +4 -1
- package/lib/i18n/AcApI18n.js.map +1 -1
- package/lib/i18n/ar/command.d.ts +9 -0
- package/lib/i18n/ar/command.d.ts.map +1 -1
- package/lib/i18n/ar/command.js +1 -1
- package/lib/i18n/ar/command.js.map +1 -1
- package/lib/i18n/ar/jig.d.ts +47 -0
- package/lib/i18n/ar/jig.d.ts.map +1 -1
- package/lib/i18n/ar/jig.js +17 -1
- package/lib/i18n/ar/jig.js.map +1 -1
- package/lib/i18n/ar/main.d.ts +32 -0
- package/lib/i18n/ar/main.d.ts.map +1 -1
- package/lib/i18n/ar/main.js +38 -6
- package/lib/i18n/ar/main.js.map +1 -1
- package/lib/i18n/cs/command.d.ts +9 -0
- package/lib/i18n/cs/command.d.ts.map +1 -1
- package/lib/i18n/cs/command.js +9 -0
- package/lib/i18n/cs/command.js.map +1 -1
- package/lib/i18n/cs/jig.d.ts +47 -0
- package/lib/i18n/cs/jig.d.ts.map +1 -1
- package/lib/i18n/cs/jig.js +47 -0
- package/lib/i18n/cs/jig.js.map +1 -1
- package/lib/i18n/cs/main.d.ts +32 -0
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +38 -6
- package/lib/i18n/cs/main.js.map +1 -1
- package/lib/i18n/en/command.d.ts +9 -0
- package/lib/i18n/en/command.d.ts.map +1 -1
- package/lib/i18n/en/command.js +9 -0
- package/lib/i18n/en/command.js.map +1 -1
- package/lib/i18n/en/jig.d.ts +47 -0
- package/lib/i18n/en/jig.d.ts.map +1 -1
- package/lib/i18n/en/jig.js +47 -0
- package/lib/i18n/en/jig.js.map +1 -1
- package/lib/i18n/en/main.d.ts +32 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +38 -6
- package/lib/i18n/en/main.js.map +1 -1
- package/lib/i18n/index.d.ts +2 -2
- package/lib/i18n/index.d.ts.map +1 -1
- package/lib/i18n/index.js.map +1 -1
- package/lib/i18n/tr/command.d.ts +9 -0
- package/lib/i18n/tr/command.d.ts.map +1 -1
- package/lib/i18n/tr/command.js +9 -0
- package/lib/i18n/tr/command.js.map +1 -1
- package/lib/i18n/tr/jig.d.ts +47 -0
- package/lib/i18n/tr/jig.d.ts.map +1 -1
- package/lib/i18n/tr/jig.js +47 -0
- package/lib/i18n/tr/jig.js.map +1 -1
- package/lib/i18n/tr/main.d.ts +32 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +38 -6
- package/lib/i18n/tr/main.js.map +1 -1
- package/lib/i18n/zh/command.d.ts +9 -0
- package/lib/i18n/zh/command.d.ts.map +1 -1
- package/lib/i18n/zh/command.js +9 -0
- package/lib/i18n/zh/command.js.map +1 -1
- package/lib/i18n/zh/jig.d.ts +47 -0
- package/lib/i18n/zh/jig.d.ts.map +1 -1
- package/lib/i18n/zh/jig.js +47 -0
- package/lib/i18n/zh/jig.js.map +1 -1
- package/lib/i18n/zh/main.d.ts +32 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +38 -6
- package/lib/i18n/zh/main.js.map +1 -1
- 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/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts +6 -0
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js +10 -0
- package/lib/spatialIndex/AcTrHierarchicalSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts +4 -0
- package/lib/spatialIndex/AcTrLinearSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js +9 -0
- package/lib/spatialIndex/AcTrLinearSpatialIndex.js.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts +4 -0
- package/lib/spatialIndex/AcTrRBushSpatialIndex.d.ts.map +1 -1
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js +9 -0
- package/lib/spatialIndex/AcTrRBushSpatialIndex.js.map +1 -1
- package/lib/ui/AcUiDefaultNotificationUi.d.ts +167 -0
- package/lib/ui/AcUiDefaultNotificationUi.d.ts.map +1 -0
- package/lib/ui/AcUiDefaultNotificationUi.js +604 -0
- package/lib/ui/AcUiDefaultNotificationUi.js.map +1 -0
- package/lib/ui/AcUiDrawStyle.d.ts +2 -1
- package/lib/ui/AcUiDrawStyle.d.ts.map +1 -1
- package/lib/ui/AcUiDrawStyle.js +2 -1
- package/lib/ui/AcUiDrawStyle.js.map +1 -1
- package/lib/ui/AcUiDrawStyleSessionAccessory.d.ts.map +1 -1
- package/lib/ui/AcUiDrawStyleSessionAccessory.js +5 -1
- package/lib/ui/AcUiDrawStyleSessionAccessory.js.map +1 -1
- package/lib/ui/AcUiMobileSessionPanel.d.ts +73 -8
- package/lib/ui/AcUiMobileSessionPanel.d.ts.map +1 -1
- package/lib/ui/AcUiMobileSessionPanel.js +314 -49
- package/lib/ui/AcUiMobileSessionPanel.js.map +1 -1
- package/lib/ui/AcUiShortCutToolbar.d.ts +24 -0
- package/lib/ui/AcUiShortCutToolbar.d.ts.map +1 -1
- package/lib/ui/AcUiShortCutToolbar.js +73 -5
- package/lib/ui/AcUiShortCutToolbar.js.map +1 -1
- package/lib/ui/icons.d.ts +7 -1
- package/lib/ui/icons.d.ts.map +1 -1
- package/lib/ui/icons.js +10 -2
- package/lib/ui/icons.js.map +1 -1
- package/lib/ui/index.d.ts +2 -0
- package/lib/ui/index.d.ts.map +1 -1
- package/lib/ui/index.js +2 -0
- package/lib/ui/index.js.map +1 -1
- package/lib/ui/toolbar/AcUiDropdownMenu.d.ts +48 -0
- package/lib/ui/toolbar/AcUiDropdownMenu.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiDropdownMenu.js +116 -0
- package/lib/ui/toolbar/AcUiDropdownMenu.js.map +1 -0
- package/lib/ui/toolbar/AcUiSubToolbar.d.ts +125 -0
- package/lib/ui/toolbar/AcUiSubToolbar.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiSubToolbar.js +625 -0
- package/lib/ui/toolbar/AcUiSubToolbar.js.map +1 -0
- package/lib/ui/toolbar/AcUiToolbar.d.ts +446 -0
- package/lib/ui/toolbar/AcUiToolbar.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiToolbar.js +1550 -0
- package/lib/ui/toolbar/AcUiToolbar.js.map +1 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.d.ts +20 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.d.ts.map +1 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.js +34 -0
- package/lib/ui/toolbar/AcUiToolbarStyles.js.map +1 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.d.ts +19 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.d.ts.map +1 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.js +36 -0
- package/lib/ui/toolbar/acuiWrapPackLayout.js.map +1 -0
- package/lib/ui/toolbar/index.d.ts +19 -0
- package/lib/ui/toolbar/index.d.ts.map +1 -0
- package/lib/ui/toolbar/index.js +15 -0
- package/lib/ui/toolbar/index.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarChrome.d.ts +14 -0
- package/lib/ui/toolbar/resolveToolbarChrome.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarChrome.js +35 -0
- package/lib/ui/toolbar/resolveToolbarChrome.js.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItemState.d.ts +63 -0
- package/lib/ui/toolbar/resolveToolbarItemState.d.ts.map +1 -0
- package/lib/ui/toolbar/resolveToolbarItemState.js +171 -0
- package/lib/ui/toolbar/resolveToolbarItemState.js.map +1 -0
- package/lib/ui/toolbar/toolbarItemUtils.d.ts +62 -0
- package/lib/ui/toolbar/toolbarItemUtils.d.ts.map +1 -0
- package/lib/ui/toolbar/toolbarItemUtils.js +184 -0
- package/lib/ui/toolbar/toolbarItemUtils.js.map +1 -0
- package/lib/ui/toolbar/types.d.ts +268 -0
- package/lib/ui/toolbar/types.d.ts.map +1 -0
- package/lib/ui/toolbar/types.js +8 -0
- package/lib/ui/toolbar/types.js.map +1 -0
- package/lib/ui-html-entry.d.ts +8 -1
- package/lib/ui-html-entry.d.ts.map +1 -1
- package/lib/ui-html-entry.js +6 -1
- package/lib/ui-html-entry.js.map +1 -1
- package/lib/util/AcApAnalyzeUnsupportedDrawing.d.ts +53 -0
- package/lib/util/AcApAnalyzeUnsupportedDrawing.d.ts.map +1 -0
- package/lib/util/AcApAnalyzeUnsupportedDrawing.js +164 -0
- package/lib/util/AcApAnalyzeUnsupportedDrawing.js.map +1 -0
- package/lib/util/AcApFormatFontMissedMessage.d.ts +32 -0
- package/lib/util/AcApFormatFontMissedMessage.d.ts.map +1 -0
- package/lib/util/AcApFormatFontMissedMessage.js +46 -0
- package/lib/util/AcApFormatFontMissedMessage.js.map +1 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.d.ts +44 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.d.ts.map +1 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.js +105 -0
- package/lib/util/AcApFormatUnsupportedEntitiesMessage.js.map +1 -0
- package/lib/util/AcApMessageLink.d.ts +41 -0
- package/lib/util/AcApMessageLink.d.ts.map +1 -0
- package/lib/util/AcApMessageLink.js +127 -0
- package/lib/util/AcApMessageLink.js.map +1 -0
- package/lib/util/AcApOpenFileErrorMessage.d.ts +18 -1
- package/lib/util/AcApOpenFileErrorMessage.d.ts.map +1 -1
- package/lib/util/AcApOpenFileErrorMessage.js +34 -2
- package/lib/util/AcApOpenFileErrorMessage.js.map +1 -1
- package/lib/util/index.d.ts +4 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +4 -0
- package/lib/util/index.js.map +1 -1
- package/lib/view/AcTrDirectBatch.d.ts.map +1 -1
- package/lib/view/AcTrDirectBatch.js +12 -1
- package/lib/view/AcTrDirectBatch.js.map +1 -1
- package/lib/view/AcTrLayer.d.ts +13 -1
- package/lib/view/AcTrLayer.d.ts.map +1 -1
- package/lib/view/AcTrLayer.js +28 -11
- package/lib/view/AcTrLayer.js.map +1 -1
- package/lib/view/AcTrLayout.d.ts +17 -2
- package/lib/view/AcTrLayout.d.ts.map +1 -1
- package/lib/view/AcTrLayout.js +44 -3
- package/lib/view/AcTrLayout.js.map +1 -1
- package/lib/view/AcTrProgressiveOpenFitController.d.ts +8 -0
- package/lib/view/AcTrProgressiveOpenFitController.d.ts.map +1 -1
- package/lib/view/AcTrProgressiveOpenFitController.js +13 -0
- package/lib/view/AcTrProgressiveOpenFitController.js.map +1 -1
- package/lib/view/AcTrScene.d.ts +4 -0
- package/lib/view/AcTrScene.d.ts.map +1 -1
- package/lib/view/AcTrScene.js +6 -0
- package/lib/view/AcTrScene.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +173 -17
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +742 -144
- package/lib/view/AcTrView2d.js.map +1 -1
- package/lib/view/fontLoadRegen.d.ts +25 -0
- package/lib/view/fontLoadRegen.d.ts.map +1 -0
- package/lib/view/fontLoadRegen.js +33 -0
- package/lib/view/fontLoadRegen.js.map +1 -0
- package/package.json +10 -8
- package/src/ui/icons.ts +14 -2
- package/lib/command/convert/AcApPngConvertor.d.ts.map +0 -1
- package/lib/command/convert/AcApPngConvertor.js.map +0 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { AcDbClass, AcDbDatabase } from '@mlightcad/data-model';
|
|
2
|
+
/**
|
|
3
|
+
* Result of scanning a drawing for unsupported / custom entities.
|
|
4
|
+
*/
|
|
5
|
+
export interface AcApUnsupportedDrawingAnalysis {
|
|
6
|
+
/** Entities the parser could not construct at all. */
|
|
7
|
+
unknownEntityCount: number;
|
|
8
|
+
/** Sum of `instanceCount` for 天正-like entity classes. */
|
|
9
|
+
tianzhengEntityCount: number;
|
|
10
|
+
/** `ProxyEntity` instances with empty / missing proxy graphics. */
|
|
11
|
+
emptyProxyEntityCount: number;
|
|
12
|
+
/** True when CLASSES (or proxy metadata) looks like a 天正 drawing. */
|
|
13
|
+
isTianzhengDrawing: boolean;
|
|
14
|
+
/** Whether the viewer should surface a parsing warning. */
|
|
15
|
+
shouldWarn: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Options for {@link acapAnalyzeUnsupportedDrawing}.
|
|
19
|
+
*/
|
|
20
|
+
export interface AcApAnalyzeUnsupportedDrawingOptions {
|
|
21
|
+
/**
|
|
22
|
+
* When `false`, skip walking block-table entities for empty proxies
|
|
23
|
+
* (CLASSES-only pass). Default `true`.
|
|
24
|
+
*/
|
|
25
|
+
scanProxies?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Returns true when a CLASSES entry name looks like a 天正 / TArch class.
|
|
29
|
+
*
|
|
30
|
+
* @param name - DXF or C++ class name to test.
|
|
31
|
+
* @returns `true` when the name starts with a known 天正 prefix.
|
|
32
|
+
*/
|
|
33
|
+
export declare function acapIsTianzhengClassName(name: string | undefined | null): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Returns true when a class definition appears to belong to 天正 / TArch.
|
|
36
|
+
*
|
|
37
|
+
* @param entry - CLASSES table entry from the drawing database.
|
|
38
|
+
* @returns `true` when name / cpp name / app name matches 天正 heuristics.
|
|
39
|
+
*/
|
|
40
|
+
export declare function acapIsTianzhengClass(entry: AcDbClass): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Analyzes a drawing for unsupported / custom entities the viewer cannot show.
|
|
43
|
+
*
|
|
44
|
+
* Combines parser stats (`unknownEntityCount`), CLASSES-section heuristics
|
|
45
|
+
* (especially 天正 `TCH_` / `TH_` classes), and a scan for empty proxy graphics.
|
|
46
|
+
*
|
|
47
|
+
* @param database - Opened drawing database.
|
|
48
|
+
* @param unknownEntityCount - Count reported at PARSE END; defaults to `0`.
|
|
49
|
+
* @param options - Analysis flags (see {@link AcApAnalyzeUnsupportedDrawingOptions}).
|
|
50
|
+
* @returns Aggregated counts and whether a warning should be shown.
|
|
51
|
+
*/
|
|
52
|
+
export declare function acapAnalyzeUnsupportedDrawing(database: AcDbDatabase, unknownEntityCount?: number, options?: AcApAnalyzeUnsupportedDrawingOptions): AcApUnsupportedDrawingAnalysis;
|
|
53
|
+
//# sourceMappingURL=AcApAnalyzeUnsupportedDrawing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApAnalyzeUnsupportedDrawing.d.ts","sourceRoot":"","sources":["../../src/util/AcApAnalyzeUnsupportedDrawing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAc,MAAM,uBAAuB,CAAA;AAUhF;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,sDAAsD;IACtD,kBAAkB,EAAE,MAAM,CAAA;IAC1B,yDAAyD;IACzD,oBAAoB,EAAE,MAAM,CAAA;IAC5B,mEAAmE;IACnE,qBAAqB,EAAE,MAAM,CAAA;IAC7B,qEAAqE;IACrE,kBAAkB,EAAE,OAAO,CAAA;IAC3B,2DAA2D;IAC3D,UAAU,EAAE,OAAO,CAAA;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,oCAAoC;IACnD;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAC9B,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAU9D;AAkDD;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,YAAY,EACtB,kBAAkB,SAAI,EACtB,OAAO,GAAE,oCAAyC,GACjD,8BAA8B,CAuChC"}
|
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Heuristic markers for TArch / 天正 custom classes in the CLASSES section.
|
|
14
|
+
*
|
|
15
|
+
* Real drawings commonly use `TCH_*` and `TH_*` DXF / C++ class names
|
|
16
|
+
* (see {@link AcDbClass} docs which use `TH_TOLERANCEENT` as an example).
|
|
17
|
+
*/
|
|
18
|
+
var TIANZHENG_NAME_PREFIXES = ['TCH_', 'TH_'];
|
|
19
|
+
/**
|
|
20
|
+
* Returns true when a CLASSES entry name looks like a 天正 / TArch class.
|
|
21
|
+
*
|
|
22
|
+
* @param name - DXF or C++ class name to test.
|
|
23
|
+
* @returns `true` when the name starts with a known 天正 prefix.
|
|
24
|
+
*/
|
|
25
|
+
export function acapIsTianzhengClassName(name) {
|
|
26
|
+
if (!name)
|
|
27
|
+
return false;
|
|
28
|
+
var normalized = name.trim().toUpperCase();
|
|
29
|
+
if (!normalized)
|
|
30
|
+
return false;
|
|
31
|
+
return TIANZHENG_NAME_PREFIXES.some(function (prefix) { return normalized.startsWith(prefix); });
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns true when a class definition appears to belong to 天正 / TArch.
|
|
35
|
+
*
|
|
36
|
+
* @param entry - CLASSES table entry from the drawing database.
|
|
37
|
+
* @returns `true` when name / cpp name / app name matches 天正 heuristics.
|
|
38
|
+
*/
|
|
39
|
+
export function acapIsTianzhengClass(entry) {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
if (acapIsTianzhengClassName(entry.name) ||
|
|
42
|
+
acapIsTianzhengClassName(entry.cppClassName)) {
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
var app = (_b = (_a = entry.appName) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '';
|
|
46
|
+
if (!app)
|
|
47
|
+
return false;
|
|
48
|
+
return /天正|tarch|tianzheng/i.test(app);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Narrows an entity to a proxy entity with optional graphics metadata.
|
|
52
|
+
*
|
|
53
|
+
* @param entity - Database entity to test.
|
|
54
|
+
* @returns Type predicate for proxy entities.
|
|
55
|
+
*/
|
|
56
|
+
function isProxyEntity(entity) {
|
|
57
|
+
return entity.type === 'ProxyEntity';
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Counts undrawable proxy entities and whether any proxy metadata looks like 天正.
|
|
61
|
+
*
|
|
62
|
+
* @param database - Opened drawing database.
|
|
63
|
+
* @returns Empty-proxy count and a 天正 hint from original class names.
|
|
64
|
+
*/
|
|
65
|
+
function scanProxyEntities(database) {
|
|
66
|
+
var e_1, _a, e_2, _b;
|
|
67
|
+
var _c;
|
|
68
|
+
var emptyProxyEntityCount = 0;
|
|
69
|
+
var tianzhengProxyHint = false;
|
|
70
|
+
try {
|
|
71
|
+
for (var _d = __values(database.tables.blockTable.newIterator()), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
72
|
+
var btr = _e.value;
|
|
73
|
+
try {
|
|
74
|
+
for (var _f = (e_2 = void 0, __values(btr.newIterator())), _g = _f.next(); !_g.done; _g = _f.next()) {
|
|
75
|
+
var entity = _g.value;
|
|
76
|
+
if (!isProxyEntity(entity))
|
|
77
|
+
continue;
|
|
78
|
+
if (!((_c = entity.proxyGraphic) === null || _c === void 0 ? void 0 : _c.length)) {
|
|
79
|
+
emptyProxyEntityCount += 1;
|
|
80
|
+
}
|
|
81
|
+
if (!tianzhengProxyHint &&
|
|
82
|
+
(acapIsTianzhengClassName(entity.originalDxfName) ||
|
|
83
|
+
acapIsTianzhengClassName(entity.originalClassName))) {
|
|
84
|
+
tianzhengProxyHint = true;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
89
|
+
finally {
|
|
90
|
+
try {
|
|
91
|
+
if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
|
|
92
|
+
}
|
|
93
|
+
finally { if (e_2) throw e_2.error; }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
98
|
+
finally {
|
|
99
|
+
try {
|
|
100
|
+
if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
|
|
101
|
+
}
|
|
102
|
+
finally { if (e_1) throw e_1.error; }
|
|
103
|
+
}
|
|
104
|
+
return { emptyProxyEntityCount: emptyProxyEntityCount, tianzhengProxyHint: tianzhengProxyHint };
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Analyzes a drawing for unsupported / custom entities the viewer cannot show.
|
|
108
|
+
*
|
|
109
|
+
* Combines parser stats (`unknownEntityCount`), CLASSES-section heuristics
|
|
110
|
+
* (especially 天正 `TCH_` / `TH_` classes), and a scan for empty proxy graphics.
|
|
111
|
+
*
|
|
112
|
+
* @param database - Opened drawing database.
|
|
113
|
+
* @param unknownEntityCount - Count reported at PARSE END; defaults to `0`.
|
|
114
|
+
* @param options - Analysis flags (see {@link AcApAnalyzeUnsupportedDrawingOptions}).
|
|
115
|
+
* @returns Aggregated counts and whether a warning should be shown.
|
|
116
|
+
*/
|
|
117
|
+
export function acapAnalyzeUnsupportedDrawing(database, unknownEntityCount, options) {
|
|
118
|
+
var e_3, _a;
|
|
119
|
+
if (unknownEntityCount === void 0) { unknownEntityCount = 0; }
|
|
120
|
+
if (options === void 0) { options = {}; }
|
|
121
|
+
var _b = options.scanProxies, scanProxies = _b === void 0 ? true : _b;
|
|
122
|
+
var tianzhengEntityCount = 0;
|
|
123
|
+
var isTianzhengDrawing = false;
|
|
124
|
+
try {
|
|
125
|
+
for (var _c = __values(database.classes), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
126
|
+
var entry = _d.value;
|
|
127
|
+
if (!acapIsTianzhengClass(entry))
|
|
128
|
+
continue;
|
|
129
|
+
isTianzhengDrawing = true;
|
|
130
|
+
if (entry.isEntity && entry.instanceCount > 0) {
|
|
131
|
+
tianzhengEntityCount += entry.instanceCount;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
136
|
+
finally {
|
|
137
|
+
try {
|
|
138
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
139
|
+
}
|
|
140
|
+
finally { if (e_3) throw e_3.error; }
|
|
141
|
+
}
|
|
142
|
+
var emptyProxyEntityCount = 0;
|
|
143
|
+
if (scanProxies) {
|
|
144
|
+
var proxyScan = scanProxyEntities(database);
|
|
145
|
+
emptyProxyEntityCount = proxyScan.emptyProxyEntityCount;
|
|
146
|
+
if (proxyScan.tianzhengProxyHint) {
|
|
147
|
+
isTianzhengDrawing = true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (isTianzhengDrawing && tianzhengEntityCount === 0) {
|
|
151
|
+
tianzhengEntityCount = emptyProxyEntityCount;
|
|
152
|
+
}
|
|
153
|
+
var shouldWarn = unknownEntityCount > 0 ||
|
|
154
|
+
tianzhengEntityCount > 0 ||
|
|
155
|
+
emptyProxyEntityCount > 0;
|
|
156
|
+
return {
|
|
157
|
+
unknownEntityCount: unknownEntityCount,
|
|
158
|
+
tianzhengEntityCount: tianzhengEntityCount,
|
|
159
|
+
emptyProxyEntityCount: emptyProxyEntityCount,
|
|
160
|
+
isTianzhengDrawing: isTianzhengDrawing,
|
|
161
|
+
shouldWarn: shouldWarn
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=AcApAnalyzeUnsupportedDrawing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApAnalyzeUnsupportedDrawing.js","sourceRoot":"","sources":["../../src/util/AcApAnalyzeUnsupportedDrawing.ts"],"names":[],"mappings":";;;;;;;;;;;AAEA;;;;;GAKG;AACH,IAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,KAAK,CAAU,CAAA;AA6BxD;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAA+B;IAE/B,IAAI,CAAC,IAAI;QAAE,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AAG,SAAS,CAAC,qBAAqB,CAAA;QACvD,IAAI,SAAS,CAAC,kBAAkB,EAAE,CAAC;YACjC,kBAAkB,GAAG,IAAI,CAAA;QAC3B,CAAC;IACH,CAAC;IAED,IAAI,kBAAkB,IAAI,oBAAoB,KAAK,CAAC,EAAE,CAAC;QACrD,oBAAoB,GAAG,qBAAqB,CAAA;IAC9C,CAAC;IAED,IAAM,UAAU,GACd,kBAAkB,GAAG,CAAC;QACtB,oBAAoB,GAAG,CAAC;QACxB,qBAAqB,GAAG,CAAC,CAAA;IAE3B,OAAO;QACL,kBAAkB,oBAAA;QAClB,oBAAoB,sBAAA;QACpB,qBAAqB,uBAAA;QACrB,kBAAkB,oBAAA;QAClB,UAAU,YAAA;KACX,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { type AcApTranslateFn } from './AcApFormatUnsupportedEntitiesMessage';
|
|
2
|
+
/**
|
|
3
|
+
* Formats one missing font with its replacement name for notification text.
|
|
4
|
+
*
|
|
5
|
+
* @param t - Translation function (key + `{param}` interpolation).
|
|
6
|
+
* @param fontName - Missing font face name.
|
|
7
|
+
* @returns Localized string naming the font and its replacement.
|
|
8
|
+
*/
|
|
9
|
+
export declare function acapResolveFontMissedReplacement(t: AcApTranslateFn, fontName: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Formats several missing fonts with replacement names.
|
|
12
|
+
*
|
|
13
|
+
* @param t - Translation function (key + `{param}` interpolation).
|
|
14
|
+
* @param fontNames - Missing font face names.
|
|
15
|
+
* @returns Comma-separated localized replacement strings.
|
|
16
|
+
*/
|
|
17
|
+
export declare function acapResolveFontsMissedReplacement(t: AcApTranslateFn, fontNames: string[]): string;
|
|
18
|
+
/**
|
|
19
|
+
* Formats one missing font with replacement using {@link AcApI18n}.
|
|
20
|
+
*
|
|
21
|
+
* @param fontName - Missing font face name.
|
|
22
|
+
* @returns Localized string naming the font and its replacement.
|
|
23
|
+
*/
|
|
24
|
+
export declare function acapFormatFontMissedReplacement(fontName: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Formats several missing fonts with replacement using {@link AcApI18n}.
|
|
27
|
+
*
|
|
28
|
+
* @param fontNames - Missing font face names.
|
|
29
|
+
* @returns Comma-separated localized replacement strings.
|
|
30
|
+
*/
|
|
31
|
+
export declare function acapFormatFontsMissedReplacement(fontNames: string[]): string;
|
|
32
|
+
//# sourceMappingURL=AcApFormatFontMissedMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApFormatFontMissedMessage.d.ts","sourceRoot":"","sources":["../../src/util/AcApFormatFontMissedMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,wCAAwC,CAAA;AAE/C;;;;;;GAMG;AACH,wBAAgB,gCAAgC,CAC9C,CAAC,EAAE,eAAe,EAClB,QAAQ,EAAE,MAAM,GACf,MAAM,CAKR;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,CAAC,EAAE,eAAe,EAClB,SAAS,EAAE,MAAM,EAAE,GAClB,MAAM,CAIR;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,gCAAgC,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAE5E"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AcApFontUtil } from './AcApFontUtil';
|
|
2
|
+
import { acapI18nTranslate } from './AcApFormatUnsupportedEntitiesMessage';
|
|
3
|
+
/**
|
|
4
|
+
* Formats one missing font with its replacement name for notification text.
|
|
5
|
+
*
|
|
6
|
+
* @param t - Translation function (key + `{param}` interpolation).
|
|
7
|
+
* @param fontName - Missing font face name.
|
|
8
|
+
* @returns Localized string naming the font and its replacement.
|
|
9
|
+
*/
|
|
10
|
+
export function acapResolveFontMissedReplacement(t, fontName) {
|
|
11
|
+
return t('main.message.fontMissedReplacement', {
|
|
12
|
+
font: fontName,
|
|
13
|
+
replacement: AcApFontUtil.getReplacementFontName(fontName)
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Formats several missing fonts with replacement names.
|
|
18
|
+
*
|
|
19
|
+
* @param t - Translation function (key + `{param}` interpolation).
|
|
20
|
+
* @param fontNames - Missing font face names.
|
|
21
|
+
* @returns Comma-separated localized replacement strings.
|
|
22
|
+
*/
|
|
23
|
+
export function acapResolveFontsMissedReplacement(t, fontNames) {
|
|
24
|
+
return fontNames
|
|
25
|
+
.map(function (fontName) { return acapResolveFontMissedReplacement(t, fontName); })
|
|
26
|
+
.join(', ');
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Formats one missing font with replacement using {@link AcApI18n}.
|
|
30
|
+
*
|
|
31
|
+
* @param fontName - Missing font face name.
|
|
32
|
+
* @returns Localized string naming the font and its replacement.
|
|
33
|
+
*/
|
|
34
|
+
export function acapFormatFontMissedReplacement(fontName) {
|
|
35
|
+
return acapResolveFontMissedReplacement(acapI18nTranslate, fontName);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Formats several missing fonts with replacement using {@link AcApI18n}.
|
|
39
|
+
*
|
|
40
|
+
* @param fontNames - Missing font face names.
|
|
41
|
+
* @returns Comma-separated localized replacement strings.
|
|
42
|
+
*/
|
|
43
|
+
export function acapFormatFontsMissedReplacement(fontNames) {
|
|
44
|
+
return acapResolveFontsMissedReplacement(acapI18nTranslate, fontNames);
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=AcApFormatFontMissedMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApFormatFontMissedMessage.js","sourceRoot":"","sources":["../../src/util/AcApFormatFontMissedMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EACL,iBAAiB,EAElB,MAAM,wCAAwC,CAAA;AAE/C;;;;;;GAMG;AACH,MAAM,UAAU,gCAAgC,CAC9C,CAAkB,EAClB,QAAgB;IAEhB,OAAO,CAAC,CAAC,oCAAoC,EAAE;QAC7C,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,YAAY,CAAC,sBAAsB,CAAC,QAAQ,CAAC;KAC3D,CAAC,CAAA;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,iCAAiC,CAC/C,CAAkB,EAClB,SAAmB;IAEnB,OAAO,SAAS;SACb,GAAG,CAAC,UAAA,QAAQ,IAAI,OAAA,gCAAgC,CAAC,CAAC,EAAE,QAAQ,CAAC,EAA7C,CAA6C,CAAC;SAC9D,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,+BAA+B,CAAC,QAAgB;IAC9D,OAAO,gCAAgC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;AACtE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gCAAgC,CAAC,SAAmB;IAClE,OAAO,iCAAiC,CAAC,iBAAiB,EAAE,SAAS,CAAC,CAAA;AACxE,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { AcApUnsupportedDrawingAnalysis } from './AcApAnalyzeUnsupportedDrawing';
|
|
2
|
+
/**
|
|
3
|
+
* Translation function used by notification message formatters.
|
|
4
|
+
*
|
|
5
|
+
* @param key - Locale message key (e.g. `main.message.unknownEntities`).
|
|
6
|
+
* @param params - Optional `{name}` placeholders to interpolate.
|
|
7
|
+
* @returns Localized string.
|
|
8
|
+
*/
|
|
9
|
+
export type AcApTranslateFn = (key: string, params?: Record<string, string | number>) => string;
|
|
10
|
+
/**
|
|
11
|
+
* Applies `{name}` placeholders in a locale template string.
|
|
12
|
+
*
|
|
13
|
+
* @param template - Template containing `{param}` tokens.
|
|
14
|
+
* @param params - Values to substitute for each token.
|
|
15
|
+
* @returns Interpolated string (unchanged when `params` is omitted).
|
|
16
|
+
*/
|
|
17
|
+
export declare function acapApplyTemplateParams(template: string, params?: Record<string, string | number>): string;
|
|
18
|
+
/**
|
|
19
|
+
* {@link AcApTranslateFn} backed by {@link AcApI18n} with `{param}` interpolation.
|
|
20
|
+
*
|
|
21
|
+
* @param key - Locale message key.
|
|
22
|
+
* @param params - Optional placeholders.
|
|
23
|
+
* @returns Localized, interpolated string.
|
|
24
|
+
*/
|
|
25
|
+
export declare function acapI18nTranslate(key: string, params?: Record<string, string | number>): string;
|
|
26
|
+
/**
|
|
27
|
+
* Builds the notification body for unsupported / custom entity warnings.
|
|
28
|
+
*
|
|
29
|
+
* Prefers an explicit 天正 message when that family of classes is detected so
|
|
30
|
+
* users understand why large parts of the drawing may be blank.
|
|
31
|
+
*
|
|
32
|
+
* @param t - Translation function.
|
|
33
|
+
* @param analysis - Result from {@link acapAnalyzeUnsupportedDrawing}.
|
|
34
|
+
* @returns Space-joined localized message parts (may be empty).
|
|
35
|
+
*/
|
|
36
|
+
export declare function acapResolveUnsupportedEntitiesMessage(t: AcApTranslateFn, analysis: AcApUnsupportedDrawingAnalysis): string;
|
|
37
|
+
/**
|
|
38
|
+
* Formats unsupported-entity warning text using {@link AcApI18n}.
|
|
39
|
+
*
|
|
40
|
+
* @param analysis - Result from {@link acapAnalyzeUnsupportedDrawing}.
|
|
41
|
+
* @returns Localized warning body for the notification center.
|
|
42
|
+
*/
|
|
43
|
+
export declare function acapFormatUnsupportedEntitiesMessage(analysis: AcApUnsupportedDrawingAnalysis): string;
|
|
44
|
+
//# sourceMappingURL=AcApFormatUnsupportedEntitiesMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApFormatUnsupportedEntitiesMessage.d.ts","sourceRoot":"","sources":["../../src/util/AcApFormatUnsupportedEntitiesMessage.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,iCAAiC,CAAA;AAErF;;;;;;GAMG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACrC,MAAM,CAAA;AAEX;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACvC,MAAM,CAOR;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GACvC,MAAM,CAER;AAED;;;;;;;;;GASG;AACH,wBAAgB,qCAAqC,CACnD,CAAC,EAAE,eAAe,EAClB,QAAQ,EAAE,8BAA8B,GACvC,MAAM,CA6BR;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,8BAA8B,GACvC,MAAM,CAER"}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
13
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
|
+
if (!m) return o;
|
|
15
|
+
var i = m.call(o), r, ar = [], e;
|
|
16
|
+
try {
|
|
17
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
18
|
+
}
|
|
19
|
+
catch (error) { e = { error: error }; }
|
|
20
|
+
finally {
|
|
21
|
+
try {
|
|
22
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
23
|
+
}
|
|
24
|
+
finally { if (e) throw e.error; }
|
|
25
|
+
}
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
import { AcApI18n } from '../i18n/AcApI18n';
|
|
29
|
+
/**
|
|
30
|
+
* Applies `{name}` placeholders in a locale template string.
|
|
31
|
+
*
|
|
32
|
+
* @param template - Template containing `{param}` tokens.
|
|
33
|
+
* @param params - Values to substitute for each token.
|
|
34
|
+
* @returns Interpolated string (unchanged when `params` is omitted).
|
|
35
|
+
*/
|
|
36
|
+
export function acapApplyTemplateParams(template, params) {
|
|
37
|
+
var e_1, _a;
|
|
38
|
+
if (!params)
|
|
39
|
+
return template;
|
|
40
|
+
var text = template;
|
|
41
|
+
try {
|
|
42
|
+
for (var _b = __values(Object.entries(params)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
43
|
+
var _d = __read(_c.value, 2), key = _d[0], value = _d[1];
|
|
44
|
+
text = text.split("{".concat(key, "}")).join(String(value));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
48
|
+
finally {
|
|
49
|
+
try {
|
|
50
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
51
|
+
}
|
|
52
|
+
finally { if (e_1) throw e_1.error; }
|
|
53
|
+
}
|
|
54
|
+
return text;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* {@link AcApTranslateFn} backed by {@link AcApI18n} with `{param}` interpolation.
|
|
58
|
+
*
|
|
59
|
+
* @param key - Locale message key.
|
|
60
|
+
* @param params - Optional placeholders.
|
|
61
|
+
* @returns Localized, interpolated string.
|
|
62
|
+
*/
|
|
63
|
+
export function acapI18nTranslate(key, params) {
|
|
64
|
+
return acapApplyTemplateParams(AcApI18n.t(key), params);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Builds the notification body for unsupported / custom entity warnings.
|
|
68
|
+
*
|
|
69
|
+
* Prefers an explicit 天正 message when that family of classes is detected so
|
|
70
|
+
* users understand why large parts of the drawing may be blank.
|
|
71
|
+
*
|
|
72
|
+
* @param t - Translation function.
|
|
73
|
+
* @param analysis - Result from {@link acapAnalyzeUnsupportedDrawing}.
|
|
74
|
+
* @returns Space-joined localized message parts (may be empty).
|
|
75
|
+
*/
|
|
76
|
+
export function acapResolveUnsupportedEntitiesMessage(t, analysis) {
|
|
77
|
+
var parts = [];
|
|
78
|
+
if (analysis.isTianzhengDrawing && analysis.tianzhengEntityCount > 0) {
|
|
79
|
+
parts.push(t('main.message.tianzhengEntities', {
|
|
80
|
+
count: analysis.tianzhengEntityCount
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
if (analysis.unknownEntityCount > 0) {
|
|
84
|
+
parts.push(t('main.message.unknownEntities', {
|
|
85
|
+
count: analysis.unknownEntityCount
|
|
86
|
+
}));
|
|
87
|
+
}
|
|
88
|
+
else if (!analysis.isTianzhengDrawing &&
|
|
89
|
+
analysis.emptyProxyEntityCount > 0) {
|
|
90
|
+
parts.push(t('main.message.emptyProxyEntities', {
|
|
91
|
+
count: analysis.emptyProxyEntityCount
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return parts.join(' ');
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Formats unsupported-entity warning text using {@link AcApI18n}.
|
|
98
|
+
*
|
|
99
|
+
* @param analysis - Result from {@link acapAnalyzeUnsupportedDrawing}.
|
|
100
|
+
* @returns Localized warning body for the notification center.
|
|
101
|
+
*/
|
|
102
|
+
export function acapFormatUnsupportedEntitiesMessage(analysis) {
|
|
103
|
+
return acapResolveUnsupportedEntitiesMessage(acapI18nTranslate, analysis);
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=AcApFormatUnsupportedEntitiesMessage.js.map
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kBAAkB,GAAG,CAAC,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CACR,CAAC,CAAC,8BAA8B,EAAE;YAChC,KAAK,EAAE,QAAQ,CAAC,kBAAkB;SACnC,CAAC,CACH,CAAA;IACH,CAAC;SAAM,IACL,CAAC,QAAQ,CAAC,kBAAkB;QAC5B,QAAQ,CAAC,qBAAqB,GAAG,CAAC,EAClC,CAAC;QACD,KAAK,CAAC,IAAI,CACR,CAAC,CAAC,iCAAiC,EAAE;YACnC,KAAK,EAAE,QAAQ,CAAC,qBAAqB;SACtC,CAAC,CACH,CAAA;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AACxB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,oCAAoC,CAClD,QAAwC;IAExC,OAAO,qCAAqC,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAA;AAC3E,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product page for the commercial DWG parser (`@mlightcad/dwg-converter`).
|
|
3
|
+
* Shown when LibreDWG runs out of memory while opening a drawing.
|
|
4
|
+
*/
|
|
5
|
+
export declare const ACAP_DWG_PARSER_PRODUCT_URL = "https://mlightcad.com/dwg-parser.html";
|
|
6
|
+
/**
|
|
7
|
+
* Escapes text for safe interpolation into HTML content.
|
|
8
|
+
*
|
|
9
|
+
* @param text - Raw text.
|
|
10
|
+
* @returns HTML-escaped string.
|
|
11
|
+
*/
|
|
12
|
+
export declare function acapEscapeHtml(text: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* Builds a markdown link `[label](url)` for use in localized message templates.
|
|
15
|
+
*
|
|
16
|
+
* @param label - Visible link text.
|
|
17
|
+
* @param url - Absolute `http(s)` URL.
|
|
18
|
+
*/
|
|
19
|
+
export declare function acapMarkdownLink(label: string, url: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* Converts plain text that may contain markdown links into safe HTML.
|
|
22
|
+
* Only `http` / `https` link targets are rendered as anchors.
|
|
23
|
+
*
|
|
24
|
+
* @param text - Message text, optionally with `[label](https://...)` links.
|
|
25
|
+
* @returns Escaped HTML with clickable anchors.
|
|
26
|
+
*/
|
|
27
|
+
export declare function acapFormatMessageHtml(text: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Appends plain text and markdown links as DOM nodes (no `innerHTML`).
|
|
30
|
+
*
|
|
31
|
+
* @param container - Element that receives text and optional `<a>` children.
|
|
32
|
+
* @param text - Message text, optionally with `[label](https://...)` links.
|
|
33
|
+
*/
|
|
34
|
+
export declare function acapAppendLinkedText(container: HTMLElement, text: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* Opens a URL in a new tab when `window` is available.
|
|
37
|
+
*
|
|
38
|
+
* @param url - Absolute URL to open.
|
|
39
|
+
*/
|
|
40
|
+
export declare function acapOpenUrl(url: string): void;
|
|
41
|
+
//# sourceMappingURL=AcApMessageLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApMessageLink.d.ts","sourceRoot":"","sources":["../../src/util/AcApMessageLink.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,2BAA2B,0CACC,CAAA;AAKzC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMnD;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAEnE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAoB1D;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,WAAW,EACtB,IAAI,EAAE,MAAM,GACX,IAAI,CAqBN;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAG7C"}
|
|
@@ -0,0 +1,127 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Product page for the commercial DWG parser (`@mlightcad/dwg-converter`).
|
|
14
|
+
* Shown when LibreDWG runs out of memory while opening a drawing.
|
|
15
|
+
*/
|
|
16
|
+
export var ACAP_DWG_PARSER_PRODUCT_URL = 'https://mlightcad.com/dwg-parser.html';
|
|
17
|
+
/** Matches a single markdown link `[label](https://...)`. */
|
|
18
|
+
var MARKDOWN_LINK_RE = /\[([^\]]+)\]\((https?:\/\/[^)\s]+)\)/g;
|
|
19
|
+
/**
|
|
20
|
+
* Escapes text for safe interpolation into HTML content.
|
|
21
|
+
*
|
|
22
|
+
* @param text - Raw text.
|
|
23
|
+
* @returns HTML-escaped string.
|
|
24
|
+
*/
|
|
25
|
+
export function acapEscapeHtml(text) {
|
|
26
|
+
return text
|
|
27
|
+
.replace(/&/g, '&')
|
|
28
|
+
.replace(/</g, '<')
|
|
29
|
+
.replace(/>/g, '>')
|
|
30
|
+
.replace(/"/g, '"');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Builds a markdown link `[label](url)` for use in localized message templates.
|
|
34
|
+
*
|
|
35
|
+
* @param label - Visible link text.
|
|
36
|
+
* @param url - Absolute `http(s)` URL.
|
|
37
|
+
*/
|
|
38
|
+
export function acapMarkdownLink(label, url) {
|
|
39
|
+
return "[".concat(label, "](").concat(url, ")");
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Converts plain text that may contain markdown links into safe HTML.
|
|
43
|
+
* Only `http` / `https` link targets are rendered as anchors.
|
|
44
|
+
*
|
|
45
|
+
* @param text - Message text, optionally with `[label](https://...)` links.
|
|
46
|
+
* @returns Escaped HTML with clickable anchors.
|
|
47
|
+
*/
|
|
48
|
+
export function acapFormatMessageHtml(text) {
|
|
49
|
+
var e_1, _a;
|
|
50
|
+
var _b;
|
|
51
|
+
var parts = [];
|
|
52
|
+
var lastIndex = 0;
|
|
53
|
+
try {
|
|
54
|
+
for (var _c = __values(text.matchAll(MARKDOWN_LINK_RE)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
55
|
+
var match = _d.value;
|
|
56
|
+
var index = (_b = match.index) !== null && _b !== void 0 ? _b : 0;
|
|
57
|
+
if (index > lastIndex) {
|
|
58
|
+
parts.push(acapEscapeHtml(text.slice(lastIndex, index)));
|
|
59
|
+
}
|
|
60
|
+
var label = acapEscapeHtml(match[1]);
|
|
61
|
+
// Escape attribute value so crafted file names cannot break out of href="...".
|
|
62
|
+
var href = acapEscapeHtml(match[2]);
|
|
63
|
+
parts.push("<a href=\"".concat(href, "\" target=\"_blank\" rel=\"noopener noreferrer\">").concat(label, "</a>"));
|
|
64
|
+
lastIndex = index + match[0].length;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
68
|
+
finally {
|
|
69
|
+
try {
|
|
70
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
71
|
+
}
|
|
72
|
+
finally { if (e_1) throw e_1.error; }
|
|
73
|
+
}
|
|
74
|
+
if (lastIndex < text.length) {
|
|
75
|
+
parts.push(acapEscapeHtml(text.slice(lastIndex)));
|
|
76
|
+
}
|
|
77
|
+
return parts.join('');
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Appends plain text and markdown links as DOM nodes (no `innerHTML`).
|
|
81
|
+
*
|
|
82
|
+
* @param container - Element that receives text and optional `<a>` children.
|
|
83
|
+
* @param text - Message text, optionally with `[label](https://...)` links.
|
|
84
|
+
*/
|
|
85
|
+
export function acapAppendLinkedText(container, text) {
|
|
86
|
+
var e_2, _a;
|
|
87
|
+
var _b;
|
|
88
|
+
container.replaceChildren();
|
|
89
|
+
var lastIndex = 0;
|
|
90
|
+
try {
|
|
91
|
+
for (var _c = __values(text.matchAll(MARKDOWN_LINK_RE)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
92
|
+
var match = _d.value;
|
|
93
|
+
var index = (_b = match.index) !== null && _b !== void 0 ? _b : 0;
|
|
94
|
+
if (index > lastIndex) {
|
|
95
|
+
container.appendChild(document.createTextNode(text.slice(lastIndex, index)));
|
|
96
|
+
}
|
|
97
|
+
var anchor = document.createElement('a');
|
|
98
|
+
anchor.href = match[2];
|
|
99
|
+
anchor.target = '_blank';
|
|
100
|
+
anchor.rel = 'noopener noreferrer';
|
|
101
|
+
anchor.textContent = match[1];
|
|
102
|
+
container.appendChild(anchor);
|
|
103
|
+
lastIndex = index + match[0].length;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
107
|
+
finally {
|
|
108
|
+
try {
|
|
109
|
+
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
110
|
+
}
|
|
111
|
+
finally { if (e_2) throw e_2.error; }
|
|
112
|
+
}
|
|
113
|
+
if (lastIndex < text.length) {
|
|
114
|
+
container.appendChild(document.createTextNode(text.slice(lastIndex)));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Opens a URL in a new tab when `window` is available.
|
|
119
|
+
*
|
|
120
|
+
* @param url - Absolute URL to open.
|
|
121
|
+
*/
|
|
122
|
+
export function acapOpenUrl(url) {
|
|
123
|
+
if (typeof window === 'undefined')
|
|
124
|
+
return;
|
|
125
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=AcApM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