@mlightcad/cad-simple-viewer 1.7.0 → 1.7.1
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 +185 -180
- package/dist/cad-simple-viewer.js +17061 -12706
- package/dist/cad-simple-viewer.umd.cjs +981 -114
- package/dist/mtext-renderer-worker.js +1908 -1765
- package/icons.ts +7 -7
- 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 +38 -18
- package/lib/app/AcApDocManager.d.ts.map +1 -1
- package/lib/app/AcApDocManager.js +59 -45
- package/lib/app/AcApDocManager.js.map +1 -1
- package/lib/app/AcApOpenDatabaseOptions.d.ts +17 -1
- 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 +4 -2
- package/lib/app/AcApOpenFileProgressController.d.ts.map +1 -1
- package/lib/app/AcApOpenFileProgressController.js +4 -2
- package/lib/app/AcApOpenFileProgressController.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/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 +30 -0
- package/lib/i18n/ar/main.d.ts.map +1 -1
- package/lib/i18n/ar/main.js +34 -4
- 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 +30 -0
- package/lib/i18n/cs/main.d.ts.map +1 -1
- package/lib/i18n/cs/main.js +34 -4
- 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 +30 -0
- package/lib/i18n/en/main.d.ts.map +1 -1
- package/lib/i18n/en/main.js +34 -4
- 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 +30 -0
- package/lib/i18n/tr/main.d.ts.map +1 -1
- package/lib/i18n/tr/main.js +34 -4
- 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 +30 -0
- package/lib/i18n/zh/main.d.ts.map +1 -1
- package/lib/i18n/zh/main.js +34 -4
- package/lib/i18n/zh/main.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 +603 -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/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/index.d.ts +3 -0
- package/lib/util/index.d.ts.map +1 -1
- package/lib/util/index.js +3 -0
- package/lib/util/index.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/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 +93 -14
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +382 -102
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +8 -8
- package/src/ui/icons.ts +387 -387
- package/lib/command/convert/AcApPngConvertor.d.ts.map +0 -1
- package/lib/command/convert/AcApPngConvertor.js.map +0 -1
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __values = (this && this.__values) || function(o) {
|
|
13
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
14
|
+
if (m) return m.call(o);
|
|
15
|
+
if (o && typeof o.length === "number") return {
|
|
16
|
+
next: function () {
|
|
17
|
+
if (o && i >= o.length) o = void 0;
|
|
18
|
+
return { value: o && o[i++], done: !o };
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
22
|
+
};
|
|
23
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
24
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
25
|
+
if (!m) return o;
|
|
26
|
+
var i = m.call(o), r, ar = [], e;
|
|
27
|
+
try {
|
|
28
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
29
|
+
}
|
|
30
|
+
catch (error) { e = { error: error }; }
|
|
31
|
+
finally {
|
|
32
|
+
try {
|
|
33
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
34
|
+
}
|
|
35
|
+
finally { if (e) throw e.error; }
|
|
36
|
+
}
|
|
37
|
+
return ar;
|
|
38
|
+
};
|
|
39
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
40
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
41
|
+
if (ar || !(i in from)) {
|
|
42
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
43
|
+
ar[i] = from[i];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* In-memory notification store used by the built-in DOM notification UI and as
|
|
50
|
+
* a reference implementation for custom centers.
|
|
51
|
+
*
|
|
52
|
+
* Notifications are kept in per-session buckets. {@link notifications} /
|
|
53
|
+
* {@link unreadCount} / mutation helpers (except {@link clearSession} and
|
|
54
|
+
* {@link remove} by id) operate on the active session.
|
|
55
|
+
*/
|
|
56
|
+
var AcApNotificationStore = /** @class */ (function () {
|
|
57
|
+
function AcApNotificationStore() {
|
|
58
|
+
/** Per-session notification lists keyed by {@link AcApDocSession.id}. */
|
|
59
|
+
this._buckets = new Map();
|
|
60
|
+
/** Session currently exposed via {@link notifications}. */
|
|
61
|
+
this._activeSessionId = null;
|
|
62
|
+
/** Monotonic counter used to allocate notification ids. */
|
|
63
|
+
this._nextId = 1;
|
|
64
|
+
/** Observers notified after any mutating change. */
|
|
65
|
+
this._listeners = new Set();
|
|
66
|
+
}
|
|
67
|
+
Object.defineProperty(AcApNotificationStore.prototype, "notifications", {
|
|
68
|
+
/**
|
|
69
|
+
* Notifications for the active document session only.
|
|
70
|
+
*/
|
|
71
|
+
get: function () {
|
|
72
|
+
return this.activeList();
|
|
73
|
+
},
|
|
74
|
+
enumerable: false,
|
|
75
|
+
configurable: true
|
|
76
|
+
});
|
|
77
|
+
Object.defineProperty(AcApNotificationStore.prototype, "unreadCount", {
|
|
78
|
+
/**
|
|
79
|
+
* Number of notifications in the active session.
|
|
80
|
+
*/
|
|
81
|
+
get: function () {
|
|
82
|
+
return this.activeList().length;
|
|
83
|
+
},
|
|
84
|
+
enumerable: false,
|
|
85
|
+
configurable: true
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(AcApNotificationStore.prototype, "activeSessionId", {
|
|
88
|
+
/**
|
|
89
|
+
* Currently active session id, or `null` when none is set.
|
|
90
|
+
*/
|
|
91
|
+
get: function () {
|
|
92
|
+
return this._activeSessionId;
|
|
93
|
+
},
|
|
94
|
+
enumerable: false,
|
|
95
|
+
configurable: true
|
|
96
|
+
});
|
|
97
|
+
/**
|
|
98
|
+
* Registers a change listener.
|
|
99
|
+
*
|
|
100
|
+
* @param listener - Callback invoked after list / session mutations.
|
|
101
|
+
* @returns Unsubscribe function.
|
|
102
|
+
*/
|
|
103
|
+
AcApNotificationStore.prototype.subscribe = function (listener) {
|
|
104
|
+
var _this = this;
|
|
105
|
+
this._listeners.add(listener);
|
|
106
|
+
return function () {
|
|
107
|
+
_this._listeners.delete(listener);
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Notifies all {@link subscribe} listeners.
|
|
112
|
+
*/
|
|
113
|
+
AcApNotificationStore.prototype.emitChange = function () {
|
|
114
|
+
var e_1, _a;
|
|
115
|
+
try {
|
|
116
|
+
for (var _b = __values(this._listeners), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
117
|
+
var listener = _c.value;
|
|
118
|
+
listener();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
122
|
+
finally {
|
|
123
|
+
try {
|
|
124
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
125
|
+
}
|
|
126
|
+
finally { if (e_1) throw e_1.error; }
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Returns the mutable list for the active session, or an empty array.
|
|
131
|
+
*/
|
|
132
|
+
AcApNotificationStore.prototype.activeList = function () {
|
|
133
|
+
var _a;
|
|
134
|
+
if (this._activeSessionId == null)
|
|
135
|
+
return [];
|
|
136
|
+
return (_a = this._buckets.get(this._activeSessionId)) !== null && _a !== void 0 ? _a : [];
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Replaces the active session's list, deleting the bucket when empty.
|
|
140
|
+
*
|
|
141
|
+
* @param list - Next notification list for the active session.
|
|
142
|
+
*/
|
|
143
|
+
AcApNotificationStore.prototype.setActiveList = function (list) {
|
|
144
|
+
if (this._activeSessionId == null)
|
|
145
|
+
return;
|
|
146
|
+
if (list.length === 0) {
|
|
147
|
+
this._buckets.delete(this._activeSessionId);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
this._buckets.set(this._activeSessionId, list);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
/**
|
|
154
|
+
* Resolves which session bucket an add should target.
|
|
155
|
+
*
|
|
156
|
+
* @param explicit - Optional `sessionId` from the input payload.
|
|
157
|
+
* @returns Session id, or `null` when neither explicit nor active is set.
|
|
158
|
+
*/
|
|
159
|
+
AcApNotificationStore.prototype.resolveSessionId = function (explicit) {
|
|
160
|
+
return explicit !== null && explicit !== void 0 ? explicit : this._activeSessionId;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Switches which document's list is exposed via {@link notifications}.
|
|
164
|
+
*
|
|
165
|
+
* @param sessionId - Active session id, or `null` when none.
|
|
166
|
+
*/
|
|
167
|
+
AcApNotificationStore.prototype.setActiveSession = function (sessionId) {
|
|
168
|
+
if (this._activeSessionId === sessionId)
|
|
169
|
+
return;
|
|
170
|
+
this._activeSessionId = sessionId;
|
|
171
|
+
this.emitChange();
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Drops all notifications for a closed document session.
|
|
175
|
+
*
|
|
176
|
+
* @param sessionId - Session whose bucket should be deleted.
|
|
177
|
+
*/
|
|
178
|
+
AcApNotificationStore.prototype.clearSession = function (sessionId) {
|
|
179
|
+
if (!this._buckets.has(sessionId)) {
|
|
180
|
+
if (this._activeSessionId === sessionId) {
|
|
181
|
+
this.emitChange();
|
|
182
|
+
}
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
this._buckets.delete(sessionId);
|
|
186
|
+
this.emitChange();
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Inserts a notification into the resolved session bucket (newest first).
|
|
190
|
+
*
|
|
191
|
+
* @param notification - Entry fields without `id` / `timestamp`.
|
|
192
|
+
* @returns The assigned id, or `''` when no session could be resolved.
|
|
193
|
+
*/
|
|
194
|
+
AcApNotificationStore.prototype.add = function (notification) {
|
|
195
|
+
var _a;
|
|
196
|
+
var sessionId = this.resolveSessionId(notification.sessionId);
|
|
197
|
+
if (sessionId == null) {
|
|
198
|
+
// No active document yet — drop rather than creating an orphan bucket.
|
|
199
|
+
return '';
|
|
200
|
+
}
|
|
201
|
+
var entry = __assign(__assign({}, notification), { sessionId: sessionId, id: "notification-".concat(this._nextId++), timestamp: new Date() });
|
|
202
|
+
var list = (_a = this._buckets.get(sessionId)) !== null && _a !== void 0 ? _a : [];
|
|
203
|
+
this._buckets.set(sessionId, __spreadArray([entry], __read(list), false));
|
|
204
|
+
this.emitChange();
|
|
205
|
+
return entry.id;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Adds an `info` notification to the active (or explicit) session.
|
|
209
|
+
*
|
|
210
|
+
* @param title - Headline text.
|
|
211
|
+
* @param message - Optional body.
|
|
212
|
+
* @param options - Extra fields merged into the entry.
|
|
213
|
+
* @returns The assigned notification id.
|
|
214
|
+
*/
|
|
215
|
+
AcApNotificationStore.prototype.info = function (title, message, options) {
|
|
216
|
+
return this.add(__assign({ type: 'info', title: title, message: message }, options));
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Adds a `warning` notification to the active (or explicit) session.
|
|
220
|
+
*
|
|
221
|
+
* @param title - Headline text.
|
|
222
|
+
* @param message - Optional body.
|
|
223
|
+
* @param options - Extra fields merged into the entry.
|
|
224
|
+
* @returns The assigned notification id.
|
|
225
|
+
*/
|
|
226
|
+
AcApNotificationStore.prototype.warning = function (title, message, options) {
|
|
227
|
+
return this.add(__assign({ type: 'warning', title: title, message: message }, options));
|
|
228
|
+
};
|
|
229
|
+
/**
|
|
230
|
+
* Adds an `error` notification (defaults to `persistent: true`).
|
|
231
|
+
*
|
|
232
|
+
* @param title - Headline text.
|
|
233
|
+
* @param message - Optional body.
|
|
234
|
+
* @param options - Extra fields merged into the entry.
|
|
235
|
+
* @returns The assigned notification id.
|
|
236
|
+
*/
|
|
237
|
+
AcApNotificationStore.prototype.error = function (title, message, options) {
|
|
238
|
+
return this.add(__assign({ type: 'error', title: title, message: message, persistent: true }, options));
|
|
239
|
+
};
|
|
240
|
+
/**
|
|
241
|
+
* Adds a `success` notification to the active (or explicit) session.
|
|
242
|
+
*
|
|
243
|
+
* @param title - Headline text.
|
|
244
|
+
* @param message - Optional body.
|
|
245
|
+
* @param options - Extra fields merged into the entry.
|
|
246
|
+
* @returns The assigned notification id.
|
|
247
|
+
*/
|
|
248
|
+
AcApNotificationStore.prototype.success = function (title, message, options) {
|
|
249
|
+
return this.add(__assign({ type: 'success', title: title, message: message }, options));
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Removes a notification by id from any session bucket.
|
|
253
|
+
*
|
|
254
|
+
* @param id - Notification id previously returned by {@link add}.
|
|
255
|
+
*/
|
|
256
|
+
AcApNotificationStore.prototype.remove = function (id) {
|
|
257
|
+
var e_2, _a;
|
|
258
|
+
try {
|
|
259
|
+
for (var _b = __values(this._buckets), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
260
|
+
var _d = __read(_c.value, 2), sessionId = _d[0], list = _d[1];
|
|
261
|
+
var next = list.filter(function (n) { return n.id !== id; });
|
|
262
|
+
if (next.length === list.length)
|
|
263
|
+
continue;
|
|
264
|
+
if (next.length === 0) {
|
|
265
|
+
this._buckets.delete(sessionId);
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
this._buckets.set(sessionId, next);
|
|
269
|
+
}
|
|
270
|
+
this.emitChange();
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
275
|
+
finally {
|
|
276
|
+
try {
|
|
277
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
278
|
+
}
|
|
279
|
+
finally { if (e_2) throw e_2.error; }
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* Clears notifications for the active session only.
|
|
284
|
+
*/
|
|
285
|
+
AcApNotificationStore.prototype.clear = function () {
|
|
286
|
+
if (this._activeSessionId == null)
|
|
287
|
+
return;
|
|
288
|
+
if (!this._buckets.has(this._activeSessionId))
|
|
289
|
+
return;
|
|
290
|
+
this._buckets.delete(this._activeSessionId);
|
|
291
|
+
this.emitChange();
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* Removes notifications matching a predicate from the active session.
|
|
295
|
+
*
|
|
296
|
+
* @param predicate - Return `true` for entries that should be removed.
|
|
297
|
+
*/
|
|
298
|
+
AcApNotificationStore.prototype.removeWhere = function (predicate) {
|
|
299
|
+
var list = this.activeList();
|
|
300
|
+
if (list.length === 0)
|
|
301
|
+
return;
|
|
302
|
+
var next = list.filter(function (n) { return !predicate(n); });
|
|
303
|
+
if (next.length === list.length)
|
|
304
|
+
return;
|
|
305
|
+
this.setActiveList(next);
|
|
306
|
+
this.emitChange();
|
|
307
|
+
};
|
|
308
|
+
/**
|
|
309
|
+
* Removes all active-session notifications with the given source.
|
|
310
|
+
*
|
|
311
|
+
* @param source - Producer to clear.
|
|
312
|
+
*/
|
|
313
|
+
AcApNotificationStore.prototype.removeBySource = function (source) {
|
|
314
|
+
this.removeWhere(function (notification) { return notification.source === source; });
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Drops `font-missed` entries that no longer apply given the still-missing fonts.
|
|
318
|
+
*
|
|
319
|
+
* @param missedFontNames - Fonts that are still unresolved.
|
|
320
|
+
*/
|
|
321
|
+
AcApNotificationStore.prototype.removeResolvedFontMissedNotifications = function (missedFontNames) {
|
|
322
|
+
var missed = new Set(missedFontNames);
|
|
323
|
+
this.removeWhere(function (notification) {
|
|
324
|
+
var _a;
|
|
325
|
+
if (notification.source !== 'font-missed')
|
|
326
|
+
return false;
|
|
327
|
+
if (missed.size === 0)
|
|
328
|
+
return true;
|
|
329
|
+
if (!((_a = notification.fontNames) === null || _a === void 0 ? void 0 : _a.length))
|
|
330
|
+
return false;
|
|
331
|
+
return !notification.fontNames.some(function (fontName) { return missed.has(fontName); });
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* Clears listeners, all session buckets, and the active session pointer.
|
|
336
|
+
*/
|
|
337
|
+
AcApNotificationStore.prototype.dispose = function () {
|
|
338
|
+
this._listeners.clear();
|
|
339
|
+
this._buckets.clear();
|
|
340
|
+
this._activeSessionId = null;
|
|
341
|
+
};
|
|
342
|
+
return AcApNotificationStore;
|
|
343
|
+
}());
|
|
344
|
+
export { AcApNotificationStore };
|
|
345
|
+
//# sourceMappingURL=AcApNotificationStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApNotificationStore.js","sourceRoot":"","sources":["../../../src/app/notification/Ac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AA;IAC9B,CAAC;IACH,4BAAC;AAAD,CAAC,AA5RD,IA4RC"}
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifies the subsystem that produced a notification for grouping / cleanup.
|
|
3
|
+
*/
|
|
4
|
+
export type AcApNotificationSource = 'font-missed' | 'unsupported-entities';
|
|
5
|
+
/**
|
|
6
|
+
* Sources the default / Vue UIs collapse into expandable groups.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ACAP_GROUPABLE_NOTIFICATION_SOURCES: readonly AcApNotificationSource[];
|
|
9
|
+
/**
|
|
10
|
+
* Visual severity category for a notification entry.
|
|
11
|
+
*/
|
|
12
|
+
export type AcApNotificationType = 'info' | 'warning' | 'error' | 'success';
|
|
13
|
+
/**
|
|
14
|
+
* A clickable action rendered on a notification.
|
|
15
|
+
*/
|
|
16
|
+
export interface AcApNotificationAction {
|
|
17
|
+
/** Button label shown in the UI. */
|
|
18
|
+
label: string;
|
|
19
|
+
/** Handler invoked when the action is activated. */
|
|
20
|
+
action: () => void;
|
|
21
|
+
/** When `true`, the UI may emphasize this action as the primary choice. */
|
|
22
|
+
primary?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One notification entry stored in a session bucket.
|
|
26
|
+
*/
|
|
27
|
+
export interface AcApNotification {
|
|
28
|
+
/** Stable id assigned by the store (`notification-N`). */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Visual severity and icon category. */
|
|
31
|
+
type: AcApNotificationType;
|
|
32
|
+
/** Short headline shown in the list / panel. */
|
|
33
|
+
title: string;
|
|
34
|
+
/** Optional longer body text. */
|
|
35
|
+
message?: string;
|
|
36
|
+
/** Creation time used for ordering and relative timestamps. */
|
|
37
|
+
timestamp: Date;
|
|
38
|
+
/** Optional action buttons rendered with the entry. */
|
|
39
|
+
actions?: AcApNotificationAction[];
|
|
40
|
+
/** When `true`, hosts should not auto-dismiss the entry. */
|
|
41
|
+
persistent?: boolean;
|
|
42
|
+
/** Optional auto-dismiss delay in milliseconds (host-defined). */
|
|
43
|
+
timeout?: number;
|
|
44
|
+
/** Producer used for grouping and selective removal. */
|
|
45
|
+
source?: AcApNotificationSource;
|
|
46
|
+
/**
|
|
47
|
+
* Font names associated with a `font-missed` notification, used when pruning
|
|
48
|
+
* resolved missing-font alerts.
|
|
49
|
+
*/
|
|
50
|
+
fontNames?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* {@link AcApDocSession.id} of the document this notification belongs to.
|
|
53
|
+
* Assigned by the store when omitted (uses the active session).
|
|
54
|
+
*/
|
|
55
|
+
sessionId?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Fields accepted when creating a notification (`id` / `timestamp` assigned by the store).
|
|
59
|
+
*/
|
|
60
|
+
export type AcApNotificationInput = Omit<AcApNotification, 'id' | 'timestamp'>;
|
|
61
|
+
/**
|
|
62
|
+
* Host-replaceable notification center API.
|
|
63
|
+
*
|
|
64
|
+
* Notifications are **per document session** (MDI). {@link notifications} and
|
|
65
|
+
* {@link unreadCount} always reflect the active session set via
|
|
66
|
+
* {@link setActiveSession}. Hosts such as `cad-viewer` can call
|
|
67
|
+
* {@link acapSetNotificationCenter} to supply their own UI while reusing the
|
|
68
|
+
* shared event bridge.
|
|
69
|
+
*/
|
|
70
|
+
export interface AcApNotificationCenter {
|
|
71
|
+
/** Notifications for the active document session only. */
|
|
72
|
+
readonly notifications: readonly AcApNotification[];
|
|
73
|
+
/** Number of notifications in the active session (same as list length). */
|
|
74
|
+
readonly unreadCount: number;
|
|
75
|
+
/**
|
|
76
|
+
* Inserts a notification into the resolved session bucket.
|
|
77
|
+
*
|
|
78
|
+
* @param notification - Entry fields without `id` / `timestamp`.
|
|
79
|
+
* @returns The assigned id, or `''` when no session could be resolved.
|
|
80
|
+
*/
|
|
81
|
+
add(notification: AcApNotificationInput): string;
|
|
82
|
+
/**
|
|
83
|
+
* Adds an `info` notification.
|
|
84
|
+
*
|
|
85
|
+
* @param title - Headline text.
|
|
86
|
+
* @param message - Optional body.
|
|
87
|
+
* @param options - Extra fields merged into the entry.
|
|
88
|
+
* @returns The assigned notification id.
|
|
89
|
+
*/
|
|
90
|
+
info(title: string, message?: string, options?: Partial<AcApNotification>): string;
|
|
91
|
+
/**
|
|
92
|
+
* Adds a `warning` notification.
|
|
93
|
+
*
|
|
94
|
+
* @param title - Headline text.
|
|
95
|
+
* @param message - Optional body.
|
|
96
|
+
* @param options - Extra fields merged into the entry.
|
|
97
|
+
* @returns The assigned notification id.
|
|
98
|
+
*/
|
|
99
|
+
warning(title: string, message?: string, options?: Partial<AcApNotification>): string;
|
|
100
|
+
/**
|
|
101
|
+
* Adds an `error` notification (defaults to `persistent: true`).
|
|
102
|
+
*
|
|
103
|
+
* @param title - Headline text.
|
|
104
|
+
* @param message - Optional body.
|
|
105
|
+
* @param options - Extra fields merged into the entry.
|
|
106
|
+
* @returns The assigned notification id.
|
|
107
|
+
*/
|
|
108
|
+
error(title: string, message?: string, options?: Partial<AcApNotification>): string;
|
|
109
|
+
/**
|
|
110
|
+
* Adds a `success` notification.
|
|
111
|
+
*
|
|
112
|
+
* @param title - Headline text.
|
|
113
|
+
* @param message - Optional body.
|
|
114
|
+
* @param options - Extra fields merged into the entry.
|
|
115
|
+
* @returns The assigned notification id.
|
|
116
|
+
*/
|
|
117
|
+
success(title: string, message?: string, options?: Partial<AcApNotification>): string;
|
|
118
|
+
/**
|
|
119
|
+
* Removes a notification by id from any session bucket.
|
|
120
|
+
*
|
|
121
|
+
* @param id - Notification id previously returned by {@link add}.
|
|
122
|
+
*/
|
|
123
|
+
remove(id: string): void;
|
|
124
|
+
/** Clears notifications for the active session. */
|
|
125
|
+
clear(): void;
|
|
126
|
+
/**
|
|
127
|
+
* Removes notifications matching a predicate from the active session.
|
|
128
|
+
*
|
|
129
|
+
* @param predicate - Return `true` for entries that should be removed.
|
|
130
|
+
*/
|
|
131
|
+
removeWhere(predicate: (notification: AcApNotification) => boolean): void;
|
|
132
|
+
/**
|
|
133
|
+
* Removes all active-session notifications with the given {@link source}.
|
|
134
|
+
*
|
|
135
|
+
* @param source - Producer to clear.
|
|
136
|
+
*/
|
|
137
|
+
removeBySource(source: AcApNotificationSource): void;
|
|
138
|
+
/**
|
|
139
|
+
* Drops `font-missed` entries that no longer apply given the still-missing fonts.
|
|
140
|
+
*
|
|
141
|
+
* @param missedFontNames - Fonts that are still unresolved; entries whose
|
|
142
|
+
* `fontNames` no longer intersect this set are removed. An empty set removes
|
|
143
|
+
* every `font-missed` entry in the active session.
|
|
144
|
+
*/
|
|
145
|
+
removeResolvedFontMissedNotifications(missedFontNames: Iterable<string>): void;
|
|
146
|
+
/**
|
|
147
|
+
* Switches which document's list is exposed via {@link notifications}.
|
|
148
|
+
* Called by the event bridge on document activate.
|
|
149
|
+
*
|
|
150
|
+
* @param sessionId - Active {@link AcApDocSession.id}, or `null` when none.
|
|
151
|
+
*/
|
|
152
|
+
setActiveSession(sessionId: string | null): void;
|
|
153
|
+
/**
|
|
154
|
+
* Drops all notifications for a closed document session.
|
|
155
|
+
*
|
|
156
|
+
* @param sessionId - Session whose bucket should be deleted.
|
|
157
|
+
*/
|
|
158
|
+
clearSession(sessionId: string): void;
|
|
159
|
+
/**
|
|
160
|
+
* Subscribe to list / active-session changes. Returns an unsubscribe function.
|
|
161
|
+
* Optional for custom centers that do not need observation.
|
|
162
|
+
*
|
|
163
|
+
* @param listener - Callback invoked after any mutating change.
|
|
164
|
+
* @returns Function that removes the listener.
|
|
165
|
+
*/
|
|
166
|
+
subscribe?(listener: () => void): () => void;
|
|
167
|
+
/** Dispose UI / listeners owned by this center. Optional. */
|
|
168
|
+
dispose?(): void;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* One visual group produced by {@link acapGroupNotifications} for panel UIs.
|
|
172
|
+
*/
|
|
173
|
+
export interface AcApNotificationGroup {
|
|
174
|
+
/** Stable key (`font-missed`, `unsupported-entities`, or `single:<id>`). */
|
|
175
|
+
key: string;
|
|
176
|
+
/** Present when the group collapses a groupable {@link AcApNotificationSource}. */
|
|
177
|
+
source?: AcApNotificationSource;
|
|
178
|
+
/** Entries in insertion order within the group. */
|
|
179
|
+
items: AcApNotification[];
|
|
180
|
+
/** `true` when the UI should render an expandable header (multiple items). */
|
|
181
|
+
collapsible: boolean;
|
|
182
|
+
/** Highest-severity type among {@link items}. */
|
|
183
|
+
type: AcApNotificationType;
|
|
184
|
+
/** Newest {@link AcApNotification.timestamp} in the group. */
|
|
185
|
+
latestTimestamp: Date;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Groups notifications for UI panels (`font-missed` / `unsupported-entities` collapse).
|
|
189
|
+
*
|
|
190
|
+
* @param notifications - Flat list for the active session (newest first).
|
|
191
|
+
* @returns Groups in first-seen order; collapsible only when a groupable source
|
|
192
|
+
* has more than one item.
|
|
193
|
+
*/
|
|
194
|
+
export declare function acapGroupNotifications(notifications: readonly AcApNotification[]): AcApNotificationGroup[];
|
|
195
|
+
//# sourceMappingURL=AcApNotificationTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApNotificationTypes.d.ts","sourceRoot":"","sources":["../../../src/app/notification/AcApNotificationTypes.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG,sBAAsB,CAAA;AAE3E;;GAEG;AACH,eAAO,MAAM,mCAAmC,EAAE,SAAS,sBAAsB,EAC/B,CAAA;AAElD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAA;AAE3E;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,g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oB,CAAA;IAC1B,8DAA8D;IAC9D,eAAe,EAAE,IAAI,CAAA;CACtB;AAYD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,SAAS,gBAAgB,EAAE,GACzC,qBAAqB,EAAE,CAyCzB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
* Sources the default / Vue UIs collapse into expandable groups.
|
|
14
|
+
*/
|
|
15
|
+
export var ACAP_GROUPABLE_NOTIFICATION_SOURCES = ['font-missed', 'unsupported-entities'];
|
|
16
|
+
/**
|
|
17
|
+
* Severity rank used when collapsing groupable notifications into one header type.
|
|
18
|
+
*/
|
|
19
|
+
var TYPE_RANK = {
|
|
20
|
+
error: 3,
|
|
21
|
+
warning: 2,
|
|
22
|
+
info: 1,
|
|
23
|
+
success: 0
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Groups notifications for UI panels (`font-missed` / `unsupported-entities` collapse).
|
|
27
|
+
*
|
|
28
|
+
* @param notifications - Flat list for the active session (newest first).
|
|
29
|
+
* @returns Groups in first-seen order; collapsible only when a groupable source
|
|
30
|
+
* has more than one item.
|
|
31
|
+
*/
|
|
32
|
+
export function acapGroupNotifications(notifications) {
|
|
33
|
+
var e_1, _a;
|
|
34
|
+
var groups = new Map();
|
|
35
|
+
var order = [];
|
|
36
|
+
try {
|
|
37
|
+
for (var notifications_1 = __values(notifications), notifications_1_1 = notifications_1.next(); !notifications_1_1.done; notifications_1_1 = notifications_1.next()) {
|
|
38
|
+
var notification = notifications_1_1.value;
|
|
39
|
+
var source = notification.source;
|
|
40
|
+
var isGroupable = source != null &&
|
|
41
|
+
ACAP_GROUPABLE_NOTIFICATION_SOURCES.includes(source);
|
|
42
|
+
var key = isGroupable ? source : "single:".concat(notification.id);
|
|
43
|
+
var existing = groups.get(key);
|
|
44
|
+
if (existing) {
|
|
45
|
+
existing.items.push(notification);
|
|
46
|
+
if (TYPE_RANK[notification.type] > TYPE_RANK[existing.type]) {
|
|
47
|
+
existing.type = notification.type;
|
|
48
|
+
}
|
|
49
|
+
if (notification.timestamp > existing.latestTimestamp) {
|
|
50
|
+
existing.latestTimestamp = notification.timestamp;
|
|
51
|
+
}
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
groups.set(key, {
|
|
55
|
+
key: key,
|
|
56
|
+
source: isGroupable ? source : undefined,
|
|
57
|
+
items: [notification],
|
|
58
|
+
collapsible: false,
|
|
59
|
+
type: notification.type,
|
|
60
|
+
latestTimestamp: notification.timestamp
|
|
61
|
+
});
|
|
62
|
+
order.push(key);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
66
|
+
finally {
|
|
67
|
+
try {
|
|
68
|
+
if (notifications_1_1 && !notifications_1_1.done && (_a = notifications_1.return)) _a.call(notifications_1);
|
|
69
|
+
}
|
|
70
|
+
finally { if (e_1) throw e_1.error; }
|
|
71
|
+
}
|
|
72
|
+
return order.map(function (key) {
|
|
73
|
+
var group = groups.get(key);
|
|
74
|
+
group.collapsible = group.source != null && group.items.length > 1;
|
|
75
|
+
return group;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=AcApNotificationTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcApNotificationTypes.js","sourceRoot":"","sources":["../../../src/app/notification/AcApNotificationTypes.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;YACV,CAAC;YAED,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE;gBACd,GAAG,KAAA;gBACH,MAAM,EAAE,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBACxC,KAAK,EAAE,CAAC,YAAY,CAAC;gBACrB,WAAW,EAAE,KAAK;gBAClB,IAAI,EAAE,YAAY,CAAC,IAAI;gBACvB,eAAe,EAAE,YAAY,CAAC,SAAS;aACxC,CAAC,CAAA;YACF,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QACjB,CAAC;;;;;;;;;IAED,OAAO,KAAK,CAAC,GAAG,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAE,CAAA;QAC9B,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;QAClE,OAAO,KAAK,CAAA;IACd,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel exports for the notification center application subsystem
|
|
3
|
+
* (types, store, event bridge, service).
|
|
4
|
+
*
|
|
5
|
+
* The default DOM chrome lives in `src/ui` as {@link AcUiDefaultNotificationUi}.
|
|
6
|
+
*
|
|
7
|
+
* See `docs/notification-center.md` for architecture and host-override guidance.
|
|
8
|
+
*/
|
|
9
|
+
export * from './AcApNotificationTypes';
|
|
10
|
+
export * from './AcApNotificationStore';
|
|
11
|
+
export * from './AcApNotificationEventBridge';
|
|
12
|
+
export * from './AcApNotificationService';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/app/notification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Barrel exports for the notification center application subsystem
|
|
3
|
+
* (types, store, event bridge, service).
|
|
4
|
+
*
|
|
5
|
+
* The default DOM chrome lives in `src/ui` as {@link AcUiDefaultNotificationUi}.
|
|
6
|
+
*
|
|
7
|
+
* See `docs/notification-center.md` for architecture and host-override guidance.
|
|
8
|
+
*/
|
|
9
|
+
export * from './AcApNotificationTypes';
|
|
10
|
+
export * from './AcApNotificationStore';
|
|
11
|
+
export * from './AcApNotificationEventBridge';
|
|
12
|
+
export * from './AcApNotificationService';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/app/notification/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,yBAAyB,CAAA;AACvC,cAAc,yBAAyB,CAAA;AACvC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,2BAA2B,CAAA"}
|