@wow-two-beta/fe 0.0.49 → 0.0.51
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/dist/feedback/FeedbackBus.d.ts +154 -29
- package/dist/feedback/FeedbackBus.js +264 -27
- package/dist/feedback/FeedbackBus.js.map +1 -1
- package/dist/feedback/index.d.ts +1 -1
- package/dist/feedback/index.js +3 -1
- package/dist/foundation/dom/enums/ElementTag.d.ts +2 -0
- package/dist/foundation/dom/enums/ElementTag.js +3 -1
- package/dist/foundation/dom/enums/ElementTag.js.map +1 -1
- package/dist/index.js +404 -382
- package/dist/index.js.map +1 -1
- package/dist/presentation/actions/button/Button.variants.d.ts +12 -0
- package/dist/presentation/actions/button/Button.variants.js +18 -2
- package/dist/presentation/actions/button/Button.variants.js.map +1 -1
- package/dist/presentation/actions/button/Button.vue.d.ts +8 -1
- package/dist/presentation/actions/button/Button.vue.js +106 -58
- package/dist/presentation/actions/button/Button.vue.js.map +1 -1
- package/dist/presentation/actions/refreshButton/RefreshButton.vue.js.map +1 -1
- package/dist/presentation/display/badge/Badge.variants.d.ts +23 -1
- package/dist/presentation/display/badge/Badge.variants.js +18 -3
- package/dist/presentation/display/badge/Badge.variants.js.map +1 -1
- package/dist/presentation/display/badge/Badge.vue.d.ts +3 -0
- package/dist/presentation/display/badge/Badge.vue.js +10 -4
- package/dist/presentation/display/badge/Badge.vue.js.map +1 -1
- package/dist/presentation/display/carousel/Carousel.variants.d.ts +65 -0
- package/dist/presentation/display/carousel/Carousel.variants.js +56 -0
- package/dist/presentation/display/carousel/Carousel.variants.js.map +1 -0
- package/dist/presentation/display/carousel/Carousel.vue.d.ts +7 -0
- package/dist/presentation/display/carousel/Carousel.vue.js +7 -2
- package/dist/presentation/display/carousel/Carousel.vue.js.map +1 -1
- package/dist/presentation/display/carousel/CarouselContext.d.ts +10 -0
- package/dist/presentation/display/carousel/CarouselContext.js.map +1 -1
- package/dist/presentation/display/carousel/CarouselNext.vue.d.ts +6 -2
- package/dist/presentation/display/carousel/CarouselNext.vue.js +12 -4
- package/dist/presentation/display/carousel/CarouselNext.vue.js.map +1 -1
- package/dist/presentation/display/carousel/CarouselPrev.vue.d.ts +6 -2
- package/dist/presentation/display/carousel/CarouselPrev.vue.js +12 -4
- package/dist/presentation/display/carousel/CarouselPrev.vue.js.map +1 -1
- package/dist/presentation/display/carousel/CarouselViewport.vue.d.ts +13 -2
- package/dist/presentation/display/carousel/CarouselViewport.vue.js +54 -2
- package/dist/presentation/display/carousel/CarouselViewport.vue.js.map +1 -1
- package/dist/presentation/display/carousel/index.d.ts +1 -0
- package/dist/presentation/display/index.d.ts +1 -0
- package/dist/presentation/display/index.js +120 -108
- package/dist/presentation/display/index.js.map +1 -1
- package/dist/presentation/display/mediaCard/MediaCard.vue.d.ts +41 -0
- package/dist/presentation/display/mediaCard/MediaCard.vue.js +108 -0
- package/dist/presentation/display/mediaCard/MediaCard.vue.js.map +1 -0
- package/dist/presentation/display/mediaCard/MediaCard2.vue.js +5 -0
- package/dist/presentation/display/mediaCard/MediaCard2.vue.js.map +1 -0
- package/dist/presentation/display/mediaCard/index.d.ts +1 -0
- package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.d.ts +37 -0
- package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.js +72 -0
- package/dist/presentation/display/metaInlineText/MetaInlineItem.vue.js.map +1 -0
- package/dist/presentation/display/metaInlineText/MetaInlineItem2.vue.js +7 -0
- package/dist/presentation/display/metaInlineText/MetaInlineItem2.vue.js.map +1 -0
- package/dist/presentation/display/metaInlineText/index.d.ts +1 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.d.ts +18 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.js +120 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton.vue.js.map +1 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton2.vue.js +5 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterButton2.vue.js.map +1 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.d.ts +11 -6
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.js +255 -61
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroup.vue.js.map +1 -1
- package/dist/presentation/display/notificationCenterGroup/{NotificationItem.vue.d.ts → NotificationCenterGroupItem.vue.d.ts} +13 -12
- package/dist/presentation/display/notificationCenterGroup/{NotificationItem.vue.js → NotificationCenterGroupItem.vue.js} +81 -58
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem.vue.js.map +1 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem2.vue.js +5 -0
- package/dist/presentation/display/notificationCenterGroup/NotificationCenterGroupItem2.vue.js.map +1 -0
- package/dist/presentation/display/notificationCenterGroup/index.d.ts +6 -1
- package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.d.ts +1 -9
- package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.js +165 -20
- package/dist/presentation/feedback/feedbackToastHost/FeedbackToastHost.vue.js.map +1 -1
- package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.d.ts +7 -0
- package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.js +56 -0
- package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton.vue.js.map +1 -0
- package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton2.vue.js +5 -0
- package/dist/presentation/feedback/feedbackToastHost/RemindLaterButton2.vue.js.map +1 -0
- package/dist/presentation/feedback/index.js +9 -1
- package/dist/presentation/feedback/index.js.map +1 -1
- package/dist/presentation/feedback/toast/Toast.vue.d.ts +34 -8
- package/dist/presentation/feedback/toast/Toast.vue.js +290 -85
- package/dist/presentation/feedback/toast/Toast.vue.js.map +1 -1
- package/dist/presentation/feedback/toast/ToastContent.vue.d.ts +25 -0
- package/dist/presentation/feedback/toast/ToastContent.vue.js +78 -0
- package/dist/presentation/feedback/toast/ToastContent.vue.js.map +1 -0
- package/dist/presentation/feedback/toast/ToastContent2.vue.js +5 -0
- package/dist/presentation/feedback/toast/ToastContent2.vue.js.map +1 -0
- package/dist/presentation/feedback/toast/ToastRunningProgress.vue.d.ts +15 -0
- package/dist/presentation/feedback/toast/ToastRunningProgress.vue.js +88 -0
- package/dist/presentation/feedback/toast/ToastRunningProgress.vue.js.map +1 -0
- package/dist/presentation/feedback/toast/ToastRunningProgress2.vue.js +5 -0
- package/dist/presentation/feedback/toast/ToastRunningProgress2.vue.js.map +1 -0
- package/dist/presentation/feedback/toast/ToastSurface.d.ts +8 -0
- package/dist/presentation/feedback/toast/ToastSurface.js +10 -0
- package/dist/presentation/feedback/toast/ToastSurface.js.map +1 -0
- package/dist/presentation/feedback/toast/index.d.ts +1 -0
- package/dist/presentation/feedback/toastHost/ToastContent.d.ts +3 -0
- package/dist/presentation/feedback/toastHost/ToastEntry.d.ts +12 -0
- package/dist/presentation/feedback/toastHost/ToastFocusExtensions.d.ts +2 -0
- package/dist/presentation/feedback/toastHost/ToastFocusExtensions.js +11 -0
- package/dist/presentation/feedback/toastHost/ToastFocusExtensions.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastGroup.d.ts +8 -0
- package/dist/presentation/feedback/toastHost/ToastGroupLatest.d.ts +10 -0
- package/dist/presentation/feedback/toastHost/ToastHost.vue.d.ts +55 -110
- package/dist/presentation/feedback/toastHost/ToastHost.vue.js +394 -399
- package/dist/presentation/feedback/toastHost/ToastHost.vue.js.map +1 -1
- package/dist/presentation/feedback/toastHost/ToastHost2.vue.js +4 -5
- package/dist/presentation/feedback/toastHost/ToastHostStore.d.ts +37 -0
- package/dist/presentation/feedback/toastHost/ToastHostStore.js +98 -0
- package/dist/presentation/feedback/toastHost/ToastHostStore.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastHostStyles.d.ts +34 -0
- package/dist/presentation/feedback/toastHost/ToastHostStyles.js +44 -0
- package/dist/presentation/feedback/toastHost/ToastHostStyles.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastNode.d.ts +3 -0
- package/dist/presentation/feedback/toastHost/ToastOptions.d.ts +72 -0
- package/dist/presentation/feedback/toastHost/ToastProgress.vue.d.ts +11 -0
- package/dist/presentation/feedback/toastHost/ToastProgress.vue.js +44 -0
- package/dist/presentation/feedback/toastHost/ToastProgress.vue.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastProgress2.vue.js +5 -0
- package/dist/presentation/feedback/toastHost/ToastProgress2.vue.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastPromiseOptions.d.ts +12 -0
- package/dist/presentation/feedback/toastHost/ToastRing.vue.d.ts +14 -0
- package/dist/presentation/feedback/toastHost/ToastRing.vue.js +65 -0
- package/dist/presentation/feedback/toastHost/ToastRing.vue.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastRing2.vue.js +5 -0
- package/dist/presentation/feedback/toastHost/ToastRing2.vue.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastSeconds.vue.d.ts +9 -0
- package/dist/presentation/feedback/toastHost/ToastSeconds.vue.js +56 -0
- package/dist/presentation/feedback/toastHost/ToastSeconds.vue.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastSeconds2.vue.js +5 -0
- package/dist/presentation/feedback/toastHost/ToastSeconds2.vue.js.map +1 -0
- package/dist/presentation/feedback/toastHost/ToastSeverity.d.ts +3 -0
- package/dist/presentation/feedback/toastHost/UseResolvedToasts.d.ts +27 -0
- package/dist/presentation/feedback/toastHost/UseResolvedToasts.js +34 -0
- package/dist/presentation/feedback/toastHost/UseResolvedToasts.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastAnnouncer.d.ts +14 -0
- package/dist/presentation/feedback/toastHost/UseToastAnnouncer.js +106 -0
- package/dist/presentation/feedback/toastHost/UseToastAnnouncer.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastCapacity.d.ts +34 -0
- package/dist/presentation/feedback/toastHost/UseToastCapacity.js +128 -0
- package/dist/presentation/feedback/toastHost/UseToastCapacity.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastClock.d.ts +44 -0
- package/dist/presentation/feedback/toastHost/UseToastClock.js +134 -0
- package/dist/presentation/feedback/toastHost/UseToastClock.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastCountdown.d.ts +26 -0
- package/dist/presentation/feedback/toastHost/UseToastCountdown.js +23 -0
- package/dist/presentation/feedback/toastHost/UseToastCountdown.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastEntries.d.ts +4 -0
- package/dist/presentation/feedback/toastHost/UseToastEntries.js +17 -0
- package/dist/presentation/feedback/toastHost/UseToastEntries.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastExits.d.ts +11 -0
- package/dist/presentation/feedback/toastHost/UseToastExits.js +52 -0
- package/dist/presentation/feedback/toastHost/UseToastExits.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastGroupMotion.d.ts +43 -0
- package/dist/presentation/feedback/toastHost/UseToastGroupMotion.js +173 -0
- package/dist/presentation/feedback/toastHost/UseToastGroupMotion.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastHost.d.ts +10 -0
- package/dist/presentation/feedback/toastHost/UseToastHost.js +14 -0
- package/dist/presentation/feedback/toastHost/UseToastHost.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastHotkey.d.ts +20 -0
- package/dist/presentation/feedback/toastHost/UseToastHotkey.js +66 -0
- package/dist/presentation/feedback/toastHost/UseToastHotkey.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastPins.d.ts +26 -0
- package/dist/presentation/feedback/toastHost/UseToastPins.js +35 -0
- package/dist/presentation/feedback/toastHost/UseToastPins.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastStackMotion.d.ts +27 -0
- package/dist/presentation/feedback/toastHost/UseToastStackMotion.js +96 -0
- package/dist/presentation/feedback/toastHost/UseToastStackMotion.js.map +1 -0
- package/dist/presentation/feedback/toastHost/UseToastSwipe.d.ts +19 -0
- package/dist/presentation/feedback/toastHost/UseToastSwipe.js +173 -0
- package/dist/presentation/feedback/toastHost/UseToastSwipe.js.map +1 -0
- package/dist/presentation/feedback/toastHost/index.d.ts +8 -1
- package/dist/presentation/feedback/toastHost/index.js +7 -1
- package/dist/presentation/feedback/toastHost/index.js.map +1 -1
- package/dist/presentation/feedback/toastHost/styles.css +14 -2
- package/dist/presentation/layout/grid/Grid.variants.d.ts +7 -0
- package/dist/presentation/layout/grid/Grid.variants.js +4 -0
- package/dist/presentation/layout/grid/Grid.variants.js.map +1 -1
- package/dist/presentation/layout/grid/Grid.vue.d.ts +5 -0
- package/dist/presentation/layout/grid/Grid.vue.js +16 -4
- package/dist/presentation/layout/grid/Grid.vue.js.map +1 -1
- package/dist/presentation/layout/grid/index.d.ts +1 -1
- package/dist/presentation/layout/index.js +3 -1
- package/dist/presentation/nav/accountMenu/AccountMenu.vue.d.ts +1 -1
- package/dist/presentation/overlays/hoverCard/HoverCard.vue.d.ts +1 -1
- package/dist/presentation/overlays/popover/PopoverContent.vue.js +4 -4
- package/dist/presentation/overlays/popover/PopoverContent.vue.js.map +1 -1
- package/dist/presentation/overlays/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/presentation/overlays/tooltip/Tooltip.vue.js +8 -9
- package/dist/presentation/overlays/tooltip/Tooltip.vue.js.map +1 -1
- package/package.json +1 -1
- package/dist/presentation/display/notificationCenterGroup/NotificationItem.vue.js.map +0 -1
- package/dist/presentation/display/notificationCenterGroup/NotificationItem2.vue.js +0 -5
- package/dist/presentation/display/notificationCenterGroup/NotificationItem2.vue.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackBus.js","sources":["../../src/feedback/FeedbackBus.ts"],"sourcesContent":["import type { VNode } from 'vue';\n\nimport { Severity } from '../foundation/styles';\nimport type { ReportSend } from '../reporting';\n\n/** Defines the tone of a notice — the house `Severity` vocabulary minus `neutral` (a notice always carries intent). */\nexport const NoticeTone = {\n /** Refers to an informational notice. */\n Info: Severity.Info,\n /** Refers to a positive / success notice. */\n Success: Severity.Success,\n /** Refers to a caution / warning notice. */\n Warning: Severity.Warning,\n /** Refers to a destructive / error notice. */\n Danger: Severity.Danger,\n} as const;\n\nexport type NoticeTone = (typeof NoticeTone)[keyof typeof NoticeTone];\n\n/**\n * A renderable slice of a notice. React's `ReactNode` becomes `string | VNode`\n * for the same reason the `ToastHost` payload did: notices travel as data through\n * `notify()`, not through a slot, so a caller who wants markup builds it with\n * `h()`. Structurally identical to `presentation/feedback`'s `ToastNode` — the\n * adapter's assignment is what keeps the two from drifting, and this module\n * cannot import that one (boundaries: `feedback` never reaches into\n * `presentation`).\n */\nexport type NoticeNode = string | VNode;\n\n/** Defines whether a notice is toast-only or remains in the explicit notification center. */\nexport const NoticeCategory = {\n /** Refers to a transient toast; dismissal leaves no history. */\n Transient: 'transient',\n /** Refers to a notice retained in this bus until removed or the scope resets. */\n Retained: 'retained',\n} as const;\n\nexport type NoticeCategory = (typeof NoticeCategory)[keyof typeof NoticeCategory];\n\n/** Defines a notice published on the bus — the headless payload a presentation adapter renders. */\nexport interface FeedbackNotice {\n /** The semantic tone — maps 1:1 onto the toast `severity` vocabulary. */\n readonly tone: NoticeTone;\n\n /** Defaults to transient; retained notices remain in this bus's in-memory notification center. */\n readonly category?: NoticeCategory;\n\n /** The headline. */\n readonly title: NoticeNode;\n\n /** The optional supporting body. */\n readonly description?: NoticeNode;\n\n /** An optional action slot (e.g. a retry button) — passed through to the rendering surface. */\n readonly action?: NoticeNode;\n\n /**\n * Sends a one-click report of the failure behind this notice — a captured incident's `send` from\n * `/reporting`. The rendering surface shows it as a Report action beside `action`.\n */\n readonly report?: ReportSend;\n\n /** An optional stable identity, assigned by the bus (`n_<seq>`) when omitted. Set it to dedupe later. */\n readonly id?: string;\n\n /** ms before the rendering surface auto-dismisses. Surface default when omitted; `Infinity` = sticky. */\n readonly durationMs?: number;\n}\n\n/** Defines a notice as delivered to subscribers — identity always assigned. */\nexport interface PublishedNotice extends FeedbackNotice {\n readonly id: string;\n}\n\n/** Defines a listener notified on every published notice. */\nexport type NoticeListener = (notice: PublishedNotice) => void;\n\n/** Defines a listener receiving the complete retained snapshot, including an immediate initial snapshot. */\nexport type RetainedNoticeListener = (notices: ReadonlyArray<PublishedNotice>) => void;\n\n/** Defines a toast dismissal listener; null closes every toast belonging to this bus. */\nexport type NoticeDismissListener = (id: string | null) => void;\n\n/** Defines the context handed to `onError` when a subscriber throws. */\nexport interface FeedbackErrorContext {\n /** The listener that threw. */\n readonly listener: NoticeListener;\n\n /** The notice being delivered when it threw. */\n readonly notice: PublishedNotice;\n}\n\n/** Defines the subscriber-failure handler; publishing never breaks the publisher, so a listener throw lands here. */\nexport type FeedbackErrorHandler = (error: unknown, context: FeedbackErrorContext) => void;\n\n/** Defines the options for {@link createFeedbackBus}. */\nexport interface FeedbackBusOptions {\n /** Explicitly restores an application-validated retained snapshot without replaying toasts. No storage is read. */\n readonly initialRetained?: ReadonlyArray<PublishedNotice>;\n /** Receives every subscriber failure. Omitted swallows them — a broken subscriber is not worth a crash. */\n readonly onError?: FeedbackErrorHandler;\n}\n\n/**\n * Defines the module-scope feedback hub wiring app code to whatever surface renders notices.\n * Transient notices are fire-and-forget (no replay). Retained notices explicitly opt into an in-memory\n * snapshot rendered by `NotificationCenterGroup`. No browser storage, network or account wiring is implicit.\n * A transient notice published with no subscriber is dropped, so mount\n * the adapter (`<FeedbackToastHost/>`) before publishing. Nothing subscribes automatically — GWDNBM,\n * every wire is explicit:\n *\n * - **Notices in** — `notify({ tone, title })` from anywhere (composables, api client code, stores);\n * `feedbackQueryErrors(bus)` plugs a `/query` global error seam in.\n * - **Toasts out** — `<FeedbackToastHost/>` (`/presentation/feedback`) subscribes and forwards each\n * notice into the imperative `toastHost.toast()` API.\n *\n * Plain module state rather than a Vue plugin / `provide`: the bus is publisher-agnostic, and a\n * publisher is rarely inside a component's `setup()` (an interceptor, a store action). The\n * `bus` prop on the adapter is the isolation seam an app needs instead.\n */\nexport interface FeedbackBus {\n /** Publishes to subscribers and returns the id. Retained notices also update history without a mounted surface. */\n notify(notice: FeedbackNotice): string;\n\n /** Subscribes to published notices; returns an unsubscribe. */\n subscribe(listener: NoticeListener): () => void;\n\n /** Returns the newest-first retained snapshot. The array and notice objects are immutable. */\n retained(): ReadonlyArray<PublishedNotice>;\n\n /** Subscribes to retained snapshots; receives the current snapshot immediately. Listener failures are isolated. */\n subscribeRetained(listener: RetainedNoticeListener): () => void;\n\n /** Subscribes a toast adapter to removal/reset. Listener failures are isolated. */\n subscribeDismiss(listener: NoticeDismissListener): () => void;\n\n /** Removes a retained notice and closes its toast; a transient or unknown id is a no-op. */\n remove(id: string): void;\n\n /** Clears retained notices and this bus's toasts; subscriptions remain for a new session scope. */\n reset(): void;\n\n /** Resets and permanently disposes subscriptions. Subsequent publication is a no-op. */\n dispose(): void;\n}\n\n/**\n * Creates a {@link FeedbackBus} — one per app, module scope, shared by publishers and the rendering adapter.\n * Apps that don't need isolation use the default {@link feedbackBus}; pass `onError` to see the subscriber\n * failures the bus otherwise swallows.\n */\nexport function createFeedbackBus(options: FeedbackBusOptions = {}): FeedbackBus {\n const { onError } = options;\n const listeners = new Set<NoticeListener>();\n const retainedListeners = new Set<RetainedNoticeListener>();\n const dismissListeners = new Set<NoticeDismissListener>();\n let notices: ReadonlyArray<PublishedNotice> = Object.freeze([\n ...new Map(\n (options.initialRetained ?? []).map((notice) => [\n notice.id,\n Object.freeze({ ...notice, category: NoticeCategory.Retained }),\n ]),\n ).values(),\n ]);\n let idSeq = 0;\n let disposed = false;\n const nextId = (): string => {\n let id: string;\n do {\n id = `n_${++idSeq}`;\n } while (notices.some((notice) => notice.id === id));\n return id;\n };\n\n // Snapshot/lifecycle observers cannot break notification delivery or scope cleanup.\n const deliver = <T>(subscribers: ReadonlySet<(value: T) => void>, value: T): void => {\n for (const listener of [...subscribers]) {\n try {\n listener(value);\n } catch {\n /* Observer failure stays isolated. */\n }\n }\n };\n const publishRetained = (): void => deliver(retainedListeners, notices);\n const reset = (): void => {\n notices = Object.freeze([]);\n publishRetained();\n deliver(dismissListeners, null);\n };\n\n /** Routes a subscriber failure to `onError`; a handler that throws is swallowed, having nowhere to report. */\n const report = (error: unknown, listener: NoticeListener, notice: PublishedNotice): void => {\n if (!onError) return;\n try {\n onError(error, { listener, notice });\n } catch {\n // The handler is the last line of defence; a throw here must not reach the caller either.\n }\n };\n\n return {\n notify(notice: FeedbackNotice): string {\n const published: PublishedNotice = Object.freeze({ ...notice, id: notice.id ?? nextId() });\n if (disposed) return published.id;\n const retained = notice.category === NoticeCategory.Retained;\n const existing = notices.some((item) => item.id === published.id);\n if (retained || existing) {\n notices = Object.freeze(\n retained\n ? existing\n ? notices.map((item) => (item.id === published.id ? published : item))\n : [published, ...notices]\n : notices.filter((item) => item.id !== published.id),\n );\n publishRetained();\n }\n // Every subscriber is invoked in isolation. A subscriber is adapter code the publisher does not own,\n // and `notify()` is called from click handlers, `catch` blocks and error boundaries — precisely where a\n // second exception masks the first and takes down the path that was meant to recover. So a throwing\n // subscriber costs only its own delivery: the rest of the fan-out still runs, `notify()` still returns\n // the id, and the failure surfaces on `onError` rather than in the caller.\n for (const listener of [...listeners]) {\n try {\n listener(published);\n } catch (failure) {\n report(failure, listener, published);\n }\n }\n return published.id;\n },\n\n subscribe(listener: NoticeListener): () => void {\n if (disposed) return () => undefined;\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n\n retained: () => notices,\n\n subscribeRetained(listener): () => void {\n deliver(new Set([listener]), notices);\n if (disposed) return () => undefined;\n retainedListeners.add(listener);\n return () => {\n retainedListeners.delete(listener);\n };\n },\n\n subscribeDismiss(listener): () => void {\n if (disposed) return () => undefined;\n dismissListeners.add(listener);\n return () => {\n dismissListeners.delete(listener);\n };\n },\n\n remove(id): void {\n if (disposed || !notices.some((notice) => notice.id === id)) return;\n notices = Object.freeze(notices.filter((notice) => notice.id !== id));\n publishRetained();\n deliver(dismissListeners, id);\n },\n\n reset,\n\n dispose(): void {\n if (disposed) return;\n disposed = true;\n reset();\n listeners.clear();\n retainedListeners.clear();\n dismissListeners.clear();\n },\n };\n}\n\n/** The default app-wide bus — what `notify` and the adapters bind to unless handed an explicit bus. */\nexport const feedbackBus: FeedbackBus = createFeedbackBus();\n\n/** Publishes a notice on the default {@link feedbackBus} — the `notify({ tone, title })` entry point. */\nexport function notify(notice: FeedbackNotice): string {\n return feedbackBus.notify(notice);\n}\n"],"names":[],"mappings":";AAMO,MAAM,aAAa;AAAA;AAAA,EAExB,MAAM,SAAS;AAAA;AAAA,EAEf,SAAS,SAAS;AAAA;AAAA,EAElB,SAAS,SAAS;AAAA;AAAA,EAElB,QAAQ,SAAS;AACnB;AAgBO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,WAAW;AAAA;AAAA,EAEX,UAAU;AACZ;AAoHO,SAAS,kBAAkB,UAA8B,IAAiB;AAC/E,QAAM,EAAE,YAAY;AACpB,QAAM,gCAAgB,IAAA;AACtB,QAAM,wCAAwB,IAAA;AAC9B,QAAM,uCAAuB,IAAA;AAC7B,MAAI,UAA0C,OAAO,OAAO;AAAA,IAC1D,GAAG,IAAI;AAAA,OACJ,QAAQ,mBAAmB,CAAA,GAAI,IAAI,CAAC,WAAW;AAAA,QAC9C,OAAO;AAAA,QACP,OAAO,OAAO,EAAE,GAAG,QAAQ,UAAU,eAAe,UAAU;AAAA,MAAA,CAC/D;AAAA,IAAA,EACD,OAAA;AAAA,EAAO,CACV;AACD,MAAI,QAAQ;AACZ,MAAI,WAAW;AACf,QAAM,SAAS,MAAc;AAC3B,QAAI;AACJ,OAAG;AACD,WAAK,KAAK,EAAE,KAAK;AAAA,IACnB,SAAS,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,EAAE;AAClD,WAAO;AAAA,EACT;AAGA,QAAM,UAAU,CAAI,aAA8C,UAAmB;AACnF,eAAW,YAAY,CAAC,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B;AAAA,IACF;AAAA,IAEA,UAAU,MAAM;AAAA,IAEhB,kBAAkB,UAAsB;AACtC,kCAAY,IAAI,CAAC,QAAQ,CAAC,GAAG,OAAO;AACpC,UAAI,iBAAiB,MAAM;AAC3B,wBAAkB,IAAI,QAAQ;AAC9B,aAAO,MAAM;AACX,0BAAkB,OAAO,QAAQ;AAAA,MACnC;AAAA,IACF;AAAA,IAEA,iBAAiB,UAAsB;AACrC,UAAI,iBAAiB,MAAM;AAC3B,uBAAiB,IAAI,QAAQ;AAC7B,aAAO,MAAM;AACX,yBAAiB,OAAO,QAAQ;AAAA,MAClC;AAAA,IACF;AAAA,IAEA,OAAO,IAAU;AACf,UAAI,YAAY,CAAC,QAAQ,KAAK,CAAC,WAAW,OAAO,OAAO,EAAE,EAAG;AAC7D,gBAAU,OAAO,OAAO,QAAQ,OAAO,CAAC,WAAW,OAAO,OAAO,EAAE,CAAC;AACpE,sBAAA;AACA,cAAQ,kBAAkB,EAAE;AAAA,IAC9B;AAAA,IAEA;AAAA,IAEA,UAAgB;AACd,UAAI,SAAU;AACd,iBAAW;AACX,YAAA;AACA,gBAAU,MAAA;AACV,wBAAkB,MAAA;AAClB,uBAAiB,MAAA;AAAA,IACnB;AAAA,EAAA;AAEJ;AAGO,MAAM,cAA2B,kBAAA;AAGjC,SAAS,OAAO,QAAgC;AACrD,SAAO,YAAY,OAAO,MAAM;AAClC;"}
|
|
1
|
+
{"version":3,"file":"FeedbackBus.js","sources":["../../src/feedback/FeedbackBus.ts"],"sourcesContent":["import type { VNode } from 'vue';\n\nimport { Severity } from '../foundation/styles';\nimport type { ReportSend } from '../reporting';\n\n/** Defines the tone of a notice — the house `Severity` vocabulary minus `neutral` (a notice always carries intent). */\nexport const NoticeTone = {\n /** Refers to an informational notice. */\n Info: Severity.Info,\n /** Refers to a positive / success notice. */\n Success: Severity.Success,\n /** Refers to a caution / warning notice. */\n Warning: Severity.Warning,\n /** Refers to a destructive / error notice. */\n Danger: Severity.Danger,\n} as const;\n\nexport type NoticeTone = (typeof NoticeTone)[keyof typeof NoticeTone];\n\n/** Defines how urgently a live notice needs attention. Equal priorities retain their delivery order. */\nexport const NoticePriority = {\n /** Refers to a passive update whose result is already visible. */\n Low: 'low',\n /** Refers to a routine confirmation. */\n Normal: 'normal',\n /** Refers to a task outcome or progress update people are waiting on. */\n High: 'high',\n /** Refers to an immediate decision, such as an Undo with a real deadline. */\n Urgent: 'urgent',\n} as const;\n\nexport type NoticePriority = (typeof NoticePriority)[keyof typeof NoticePriority];\n\n/** The sort rank of each priority; a higher rank sits closer to the stack's anchor. */\nexport const NoticePriorityRank: Readonly<Record<NoticePriority, number>> = Object.freeze({\n [NoticePriority.Low]: 0,\n [NoticePriority.Normal]: 1,\n [NoticePriority.High]: 2,\n [NoticePriority.Urgent]: 3,\n});\n\n/** Represents a renderable slice of a notice — a string or a caller-built VNode. */\nexport type NoticeNode = string | VNode;\n\n/** Represents the copy shown when a notice is read in a compact list. */\nexport interface NoticeCompactCopy {\n /** The headline in the compact list. */\n readonly title: NoticeNode;\n\n /** The optional supporting body in the compact list. */\n readonly description?: NoticeNode;\n}\n\n/** Defines whether a notice is toast-only or remains in the explicit notification center. */\nexport const NoticeCategory = {\n /** Refers to a transient toast; dismissal leaves no history. */\n Transient: 'transient',\n /** Refers to a notice retained in this bus until removed or the scope resets. */\n Retained: 'retained',\n} as const;\n\nexport type NoticeCategory = (typeof NoticeCategory)[keyof typeof NoticeCategory];\n\n/** Joins live notices with the same key behind one expandable toast. Each notice keeps its own identity. */\nexport interface NoticeGroup {\n /** The key shared by every notice that joins the group. */\n readonly key: string;\n\n /** The summary title shown while the group holds more than one notice. */\n readonly title: string;\n}\n\n/** Represents the stable identifiers and due time passed to the owning product's reminder scheduler. */\nexport interface NoticeReminderRequest {\n /** The id of the notice to remind about. */\n readonly noticeId: string;\n\n /** The notice's `reminderKey`, which the product can resolve after a reload. */\n readonly key: string;\n\n /** The epoch milliseconds when the reminder falls due. */\n readonly dueAtMs: number;\n}\n\n/** Defines reminder scheduling for a feedback scope; the product delivers due notices through its bus. */\nexport interface FeedbackReminderOptions {\n /** The delay before a reminder falls due, in ms. Finite and positive. */\n readonly delayMs: number;\n\n /** Records one reminder; resolving hides the notice, and `signal` aborts when the notice is removed or replaced. */\n readonly schedule: (request: NoticeReminderRequest, signal: AbortSignal) => Promise<void>;\n}\n\n/**\n * Defines the progress of a running operation behind a notice. Omit `value` for an indeterminate operation;\n * `max` defaults to 1 when a surface renders it, so the bus never normalizes either field.\n */\nexport interface NoticeProgress {\n /** How much work is done, between 0 and `max`. Omitted means indeterminate. */\n readonly value?: number;\n\n /** The value that counts as complete. A surface treats an omitted `max` as 1. */\n readonly max?: number;\n\n /** Optional text describing the current step. */\n readonly label?: string;\n}\n\n/** Represents a notice published on the bus — the headless payload a presentation adapter renders. */\nexport interface FeedbackNotice {\n /** The semantic tone — maps 1:1 onto the toast `severity` vocabulary. */\n readonly tone: NoticeTone;\n\n /** Controls stack position and selects the configured default lifetime. */\n readonly priority?: NoticePriority;\n\n /** Defaults to transient; retained notices remain in this bus's in-memory notification center. */\n readonly category?: NoticeCategory;\n\n /** The headline. */\n readonly title: NoticeNode;\n\n /** The optional supporting body. */\n readonly description?: NoticeNode;\n\n /** Optional shorter copy for expanded groups and stack overflow. The default toast keeps its full copy. */\n readonly compact?: NoticeCompactCopy;\n\n /** Additional content revealed in the toast on demand. */\n readonly details?: NoticeNode;\n\n /** An explicit grouping key and summary title. Omit to deliver a separate toast. */\n readonly group?: NoticeGroup;\n\n /** An optional action slot (e.g. a retry button) — passed through to the rendering surface. */\n readonly action?: NoticeNode;\n\n /** Overrides the action in History. Set false for a toast-only action. Deadlines apply in both places. */\n readonly historyAction?: NoticeNode | false;\n\n /**\n * Sends a one-click report of the failure behind this notice — a captured incident's `send` from\n * `/reporting`. The rendering surface shows it as a Report action beside `action`.\n */\n readonly report?: ReportSend;\n\n /** An optional stable identity, assigned by the bus (`n_<seq>`) when omitted. Set it to dedupe later. */\n readonly id?: string;\n\n /** ms before the rendering surface auto-dismisses. Surface default when omitted; `Infinity` = sticky. */\n readonly durationMs?: number;\n\n /** Absolute deadline in epoch milliseconds. It takes precedence over the display duration and cannot pause. */\n readonly expiresAtMs?: number;\n\n /** Overrides the host's pin default for this toast. */\n readonly canPin?: boolean;\n\n /** Enables Remind later when the bus has a scheduler. Use a stable key the product can resolve after reload. */\n readonly reminderKey?: string;\n\n /**\n * Marks the operation behind this notice as still running; surfaces render it sticky with no countdown.\n * Republish the same id without `progress` to mark completion.\n */\n readonly progress?: NoticeProgress;\n\n /**\n * Epoch milliseconds of the first publication. A product may supply it when restoring a notice; the bus\n * otherwise stamps `Date.now()`, and republishing a retained id keeps its original time.\n */\n readonly publishedAtMs?: number;\n}\n\n/** Represents a notice as delivered to subscribers — identity and publication time always assigned. */\nexport interface PublishedNotice extends FeedbackNotice {\n readonly id: string;\n readonly publishedAtMs: number;\n}\n\n/** Represents a retained notice a product restores through `initialRetained`; its id is required. */\nexport type RetainedSeed = FeedbackNotice & { readonly id: string };\n\n/** Defines a listener notified on every published notice. */\nexport type NoticeListener = (notice: PublishedNotice) => void;\n\n/** Defines a listener receiving the complete retained snapshot, including an immediate initial snapshot. */\nexport type RetainedNoticeListener = (notices: ReadonlyArray<PublishedNotice>) => void;\n\n/** Defines a toast dismissal listener; null closes every toast belonging to this bus. */\nexport type NoticeDismissListener = (id: string | null) => void;\n\n/** Defines a pop-up pause — an epoch deadline, `'manual'` until resumed, or `null` for active pop-ups. */\nexport type ToastPauseUntil = number | 'manual' | null;\n\n/** Represents the pop-up pause and the unread retained ids of a feedback scope. */\nexport interface FeedbackNotificationState {\n /** The pause in effect, or `null` while pop-ups are active. */\n readonly pausedUntil: ToastPauseUntil;\n\n /** Equals `unreadIds.length`. */\n readonly unreadCount: number;\n\n /** The unread retained ids, newest-first in the order of the retained list. */\n readonly unreadIds: ReadonlyArray<string>;\n}\n\n/** Defines a listener receiving the notification state, including an immediate initial snapshot. */\nexport type NotificationStateListener = (state: FeedbackNotificationState) => void;\n\n/** Represents the context handed to `onError` when a subscriber throws. */\nexport interface FeedbackErrorContext {\n /** The listener that threw. */\n readonly listener: NoticeListener;\n\n /** The notice being delivered when it threw. */\n readonly notice: PublishedNotice;\n}\n\n/** Defines the subscriber-failure handler; publishing never breaks the publisher, so a listener throw lands here. */\nexport type FeedbackErrorHandler = (error: unknown, context: FeedbackErrorContext) => void;\n\n/** Defines the options for {@link createFeedbackBus}. */\nexport interface FeedbackBusOptions {\n /**\n * Explicitly restores an application-validated retained snapshot without replaying toasts. No storage is read.\n * A seed without a finite `publishedAtMs` is stamped with the creation time, and every seed starts read.\n */\n readonly initialRetained?: ReadonlyArray<RetainedSeed>;\n\n /**\n * Keeps only the newest N retained notices; older ones leave the history, unread state and reminders without\n * closing their toasts. A positive integer or `Infinity`; defaults to 200.\n */\n readonly maxRetained?: number;\n\n /** Notices at or above this priority still pop up while pop-ups are paused. Omitted pauses every notice. */\n readonly pauseBypass?: NoticePriority;\n\n /** Receives every subscriber failure. Omitted swallows them — a broken subscriber is not worth a crash. */\n readonly onError?: FeedbackErrorHandler;\n\n /** Registers the scheduler and delay for Remind later. */\n readonly reminders?: FeedbackReminderOptions;\n}\n\n/** Defines the notices `track()` publishes while work runs and once it settles. */\nexport interface FeedbackTrackNotices<T> {\n /** The notice published while the work runs; its `progress` marks the operation as running. */\n readonly running: FeedbackNotice;\n\n /** The notice that replaces it when the work resolves, or a function of the resolved value. */\n readonly success: FeedbackNotice | ((value: T) => FeedbackNotice);\n\n /** The notice that replaces it when the work rejects, or a function of the rejection. */\n readonly failure: FeedbackNotice | ((error: unknown) => FeedbackNotice);\n}\n\n/**\n * Defines the module-scope feedback hub between app code and the surface that renders notices.\n * Mount the adapter (`<FeedbackToastHost/>`) before publishing — a transient notice with no subscriber is dropped.\n * Retained notices stay in memory only; no browser storage, network or account wiring is implicit.\n */\nexport interface FeedbackBus {\n /** Publishes to subscribers and returns the id. Retained notices also update history without a mounted surface. */\n notify(notice: FeedbackNotice): string;\n\n /** Subscribes to published notices; returns an unsubscribe. */\n subscribe(listener: NoticeListener): () => void;\n\n /** Returns the newest-first retained snapshot. The array and notice objects are immutable. */\n retained(): ReadonlyArray<PublishedNotice>;\n\n /** Subscribes to retained snapshots; receives the current snapshot immediately. Listener failures are isolated. */\n subscribeRetained(listener: RetainedNoticeListener): () => void;\n\n /** Subscribes a toast adapter to removal/reset. Listener failures are isolated. */\n subscribeDismiss(listener: NoticeDismissListener): () => void;\n\n /** Returns the pop-up pause and unread retained ids for this scope. */\n notificationState(): FeedbackNotificationState;\n\n /** Subscribes to notification state and immediately receives a snapshot. */\n subscribeNotificationState(listener: NotificationStateListener): () => void;\n\n /** Hides this scope's visible pop-ups and suppresses new ones until resumed. Use null to resume. */\n setToastPause(until: ToastPauseUntil): void;\n\n /** Clears every unread id while leaving the retained entries available. */\n markNotificationsRead(): void;\n\n /** Marks one retained id read; a read or unknown id is a no-op. */\n markRead(id: string): void;\n\n /** Reports whether pop-ups are paused now (an elapsed timed pause is over) and the notice does not bypass it. */\n suppresses(notice: FeedbackNotice): boolean;\n\n /** Schedules an eligible notice, then hides it from the live stack. Retained history stays available. */\n readonly remindLater?: (notice: PublishedNotice) => Promise<void>;\n\n /** Removes a retained notice and closes its toast; a transient or unknown id is a no-op. */\n remove(id: string): void;\n\n /** Closes the live toast of any id, transient or retained. Retained history and unread state stay untouched. */\n dismiss(id: string): void;\n\n /** Removes every retained notice and closes their toasts; pause and subscriptions stay. A no-op when empty. */\n clearRetained(): void;\n\n /**\n * Publishes `running` with a stable id and `progress`, then replaces it under that id with the settled notice,\n * `progress` removed. Resolves with the work's value; rethrows its original error. After `dispose()` it\n * returns the settlement and publishes nothing.\n */\n track<T>(\n work: Promise<T> | ((report: (progress: NoticeProgress) => void) => Promise<T>),\n notices: FeedbackTrackNotices<T>,\n ): Promise<T>;\n\n /** Clears retained notices and this bus's toasts; subscriptions remain for a new session scope. */\n reset(): void;\n\n /** Resets and permanently disposes subscriptions. Subsequent publication is a no-op. */\n dispose(): void;\n}\n\n/** @internal The default cap on retained notices. */\nconst DefaultMaxRetained = 200;\n\n/** @internal Reports whether a value is a finite millisecond count. */\nfunction isFiniteMs(value: number | undefined): value is number {\n return value !== undefined && Number.isFinite(value);\n}\n\n/**\n * Creates a {@link FeedbackBus} — one per app, module scope, shared by publishers and the rendering adapter.\n * Apps that don't need isolation use the default {@link feedbackBus}; pass `onError` to see the subscriber\n * failures the bus otherwise swallows.\n */\nexport function createFeedbackBus(options: FeedbackBusOptions = {}): FeedbackBus {\n const { onError, reminders, pauseBypass } = options;\n if (reminders && (!Number.isFinite(reminders.delayMs) || reminders.delayMs <= 0)) {\n throw new RangeError('Reminder delay must be finite and positive.');\n }\n const maxRetained = options.maxRetained === undefined ? DefaultMaxRetained : options.maxRetained;\n if (maxRetained !== Infinity && !(Number.isInteger(maxRetained) && maxRetained > 0)) {\n throw new RangeError('Retained limit must be a positive integer or Infinity.');\n }\n if (pauseBypass !== undefined && !Object.values<string>(NoticePriority).includes(pauseBypass)) {\n throw new RangeError('Pause bypass must be a notice priority.');\n }\n const listeners = new Set<NoticeListener>();\n const retainedListeners = new Set<RetainedNoticeListener>();\n const dismissListeners = new Set<NoticeDismissListener>();\n const notificationListeners = new Set<NotificationStateListener>();\n const unread = new Set<string>();\n const scheduling = new Map<string, { key: string; controller: AbortController; pending: Promise<void> }>();\n let pausedUntil: ToastPauseUntil = null;\n let resumeTimer: ReturnType<typeof setTimeout> | undefined;\n let notificationSnapshot: FeedbackNotificationState = Object.freeze({\n pausedUntil,\n unreadCount: 0,\n unreadIds: Object.freeze([]),\n });\n const seededAtMs = Date.now();\n let notices: ReadonlyArray<PublishedNotice> = Object.freeze(\n capped([\n ...new Map(\n (options.initialRetained ?? []).map((seed) => [\n seed.id,\n Object.freeze({\n ...seed,\n category: NoticeCategory.Retained,\n publishedAtMs: isFiniteMs(seed.publishedAtMs) ? seed.publishedAtMs : seededAtMs,\n }),\n ]),\n ).values(),\n ]),\n );\n let idSeq = 0;\n let disposed = false;\n const nextId = (): string => {\n let id: string;\n do {\n id = `n_${++idSeq}`;\n } while (notices.some((notice) => notice.id === id));\n return id;\n };\n\n /** Keeps the newest `maxRetained` entries of a newest-first list; dropped ids leave unread and reminders. */\n function capped(list: ReadonlyArray<PublishedNotice>): ReadonlyArray<PublishedNotice> {\n if (list.length <= maxRetained) return list;\n for (const dropped of list.slice(maxRetained)) {\n unread.delete(dropped.id);\n cancelReminder(dropped.id);\n }\n return list.slice(0, maxRetained);\n }\n\n // Snapshot/lifecycle observers cannot break notification delivery or scope cleanup.\n const deliver = <T>(subscribers: ReadonlySet<(value: T) => void>, value: T): void => {\n for (const listener of [...subscribers]) {\n try {\n listener(value);\n } catch {\n /* Observer failure stays isolated. */\n }\n }\n };\n const publishRetained = (): void => deliver(retainedListeners, notices);\n\n function publishNotificationState(): void {\n const unreadIds = notices.filter((notice) => unread.has(notice.id)).map((notice) => notice.id);\n const previous = notificationSnapshot.unreadIds;\n if (\n notificationSnapshot.pausedUntil === pausedUntil &&\n previous.length === unreadIds.length &&\n previous.every((id, index) => id === unreadIds[index])\n ) {\n return;\n }\n notificationSnapshot = Object.freeze({\n pausedUntil,\n unreadCount: unreadIds.length,\n unreadIds: Object.freeze(unreadIds),\n });\n deliver(notificationListeners, notificationSnapshot);\n }\n\n function scheduleResume(): void {\n clearTimeout(resumeTimer);\n if (typeof pausedUntil !== 'number') return;\n const wait = Math.max(1, pausedUntil - Date.now());\n resumeTimer = setTimeout(\n () => {\n if (typeof pausedUntil === 'number' && pausedUntil <= Date.now()) setToastPause(null);\n else scheduleResume();\n },\n Math.min(wait, 2_147_483_647),\n );\n }\n\n function setToastPause(until: ToastPauseUntil): void {\n if (disposed) return;\n const next =\n until === 'manual' ||\n (typeof until === 'number' && Number.isFinite(new Date(until).getTime()) && until > Date.now())\n ? until\n : null;\n if (next === pausedUntil) return;\n const starting = pausedUntil === null && next !== null;\n pausedUntil = next;\n scheduleResume();\n publishNotificationState();\n if (starting) deliver(dismissListeners, null);\n }\n\n function notificationState(): FeedbackNotificationState {\n if (typeof pausedUntil === 'number' && pausedUntil <= Date.now()) setToastPause(null);\n return notificationSnapshot;\n }\n\n function suppresses(notice: FeedbackNotice): boolean {\n if (notificationState().pausedUntil === null) return false;\n if (pauseBypass === undefined) return true;\n return NoticePriorityRank[notice.priority ?? NoticePriority.Normal] < NoticePriorityRank[pauseBypass];\n }\n\n function cancelReminder(id: string): void {\n const current = scheduling.get(id);\n scheduling.delete(id);\n current?.controller.abort();\n }\n\n const reset = (): void => {\n for (const id of scheduling.keys()) cancelReminder(id);\n clearTimeout(resumeTimer);\n pausedUntil = null;\n unread.clear();\n notices = Object.freeze([]);\n publishRetained();\n publishNotificationState();\n deliver(dismissListeners, null);\n };\n\n const remindLater = reminders\n ? (notice: PublishedNotice): Promise<void> => {\n const key = notice.reminderKey;\n if (disposed || !key || Number.isFinite(notice.expiresAtMs)) {\n return Promise.reject(new Error('This notice cannot be scheduled.'));\n }\n const existing = scheduling.get(notice.id);\n if (existing?.key === key) return existing.pending;\n cancelReminder(notice.id);\n const controller = new AbortController();\n const { signal } = controller;\n const request = { noticeId: notice.id, key, dueAtMs: Date.now() + reminders.delayMs };\n const pending = Promise.resolve()\n .then(() => {\n signal.throwIfAborted();\n return reminders.schedule(request, signal);\n })\n .then(() => {\n signal.throwIfAborted();\n deliver(dismissListeners, notice.id);\n })\n .finally(() => {\n if (scheduling.get(notice.id)?.controller === controller) scheduling.delete(notice.id);\n });\n scheduling.set(notice.id, { key, controller, pending });\n return pending;\n }\n : undefined;\n\n /** Routes a subscriber failure to `onError`; a handler that throws is swallowed, having nowhere to report. */\n const report = (error: unknown, listener: NoticeListener, notice: PublishedNotice): void => {\n if (!onError) return;\n try {\n onError(error, { listener, notice });\n } catch {\n // A throwing handler stays isolated.\n }\n };\n\n /** Reports whether a republished retained entry changed what the reader sees: its title, description or tone. */\n function isNews(previous: PublishedNotice, next: PublishedNotice): boolean {\n return previous.title !== next.title || previous.description !== next.description || previous.tone !== next.tone;\n }\n\n function notify(notice: FeedbackNotice): string {\n const id = notice.id ?? nextId();\n const existingEntry = notices.find((item) => item.id === id);\n const published: PublishedNotice = Object.freeze({\n ...notice,\n id,\n publishedAtMs:\n existingEntry?.publishedAtMs ?? (isFiniteMs(notice.publishedAtMs) ? notice.publishedAtMs : Date.now()),\n });\n if (disposed) return id;\n notificationState();\n const pending = scheduling.get(id);\n if (pending && pending.key !== published.reminderKey) cancelReminder(id);\n const retained = notice.category === NoticeCategory.Retained;\n if (retained || existingEntry) {\n notices = Object.freeze(\n capped(\n retained\n ? existingEntry\n ? notices.map((item) => (item.id === id ? published : item))\n : [published, ...notices]\n : notices.filter((item) => item.id !== id),\n ),\n );\n // A progress tick or other unchanged republish keeps the reader's read mark; new copy or a new tone is news.\n if (!retained) unread.delete(id);\n else if (!existingEntry || isNews(existingEntry, published)) unread.add(id);\n publishRetained();\n publishNotificationState();\n }\n // Each subscriber runs in isolation; a throw costs only its own delivery and surfaces on `onError`.\n for (const listener of [...listeners]) {\n try {\n listener(published);\n } catch (failure) {\n report(failure, listener, published);\n }\n }\n return id;\n }\n\n /** Republishes a notice under the tracked id with `progress` removed — the operation is over. */\n function settle(notice: FeedbackNotice, id: string): void {\n const settled: { -readonly [K in keyof FeedbackNotice]: FeedbackNotice[K] } = { ...notice, id };\n delete settled.progress;\n notify(settled);\n }\n\n function track<T>(\n work: Promise<T> | ((report: (progress: NoticeProgress) => void) => Promise<T>),\n tracked: FeedbackTrackNotices<T>,\n ): Promise<T> {\n const id = tracked.running.id ?? nextId();\n let finished = false;\n const showProgress = (progress: NoticeProgress): void => {\n if (!finished) notify({ ...tracked.running, id, progress });\n };\n showProgress(tracked.running.progress ?? {});\n let operation: Promise<T>;\n try {\n operation = Promise.resolve(typeof work === 'function' ? work(showProgress) : work);\n } catch (failure) {\n operation = Promise.reject(failure);\n }\n const failureFor = (error: unknown): FeedbackNotice =>\n typeof tracked.failure === 'function' ? tracked.failure(error) : tracked.failure;\n /**\n * Settles with the built notice. A throwing formatter still settles the card — a failed `success` with the\n * failure notice, else `running` without `progress` — and its error rejects the call.\n */\n const conclude = (build: () => FeedbackNotice, isSuccess: boolean): void => {\n finished = true;\n if (disposed) return;\n let notice: FeedbackNotice;\n try {\n notice = build();\n } catch (formatterError) {\n let fallback: FeedbackNotice = tracked.running;\n if (isSuccess) {\n try {\n fallback = failureFor(formatterError);\n } catch {\n // The failure formatter threw as well; the running copy stands in.\n }\n }\n settle(fallback, id);\n throw formatterError;\n }\n settle(notice, id);\n };\n return operation.then(\n (value) => {\n conclude(() => (typeof tracked.success === 'function' ? tracked.success(value) : tracked.success), true);\n return value;\n },\n (failure: unknown) => {\n conclude(() => failureFor(failure), false);\n throw failure;\n },\n );\n }\n\n return {\n notify,\n\n subscribe(listener: NoticeListener): () => void {\n if (disposed) return () => undefined;\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n\n retained: () => notices,\n\n subscribeRetained(listener): () => void {\n deliver(new Set([listener]), notices);\n if (disposed) return () => undefined;\n retainedListeners.add(listener);\n return () => {\n retainedListeners.delete(listener);\n };\n },\n\n subscribeDismiss(listener): () => void {\n if (disposed) return () => undefined;\n dismissListeners.add(listener);\n return () => {\n dismissListeners.delete(listener);\n };\n },\n\n notificationState,\n\n subscribeNotificationState(listener): () => void {\n deliver(new Set([listener]), notificationState());\n if (disposed) return () => undefined;\n notificationListeners.add(listener);\n return () => {\n notificationListeners.delete(listener);\n };\n },\n\n setToastPause,\n\n markNotificationsRead(): void {\n unread.clear();\n publishNotificationState();\n },\n\n markRead(id): void {\n if (unread.delete(id)) publishNotificationState();\n },\n\n suppresses,\n\n remindLater,\n\n remove(id): void {\n if (disposed || !notices.some((notice) => notice.id === id)) return;\n cancelReminder(id);\n notices = Object.freeze(notices.filter((notice) => notice.id !== id));\n unread.delete(id);\n publishRetained();\n publishNotificationState();\n deliver(dismissListeners, id);\n },\n\n dismiss(id): void {\n if (!disposed) deliver(dismissListeners, id);\n },\n\n clearRetained(): void {\n if (disposed || notices.length === 0) return;\n const ids = notices.map((notice) => notice.id);\n for (const id of ids) cancelReminder(id);\n unread.clear();\n notices = Object.freeze([]);\n publishRetained();\n publishNotificationState();\n for (const id of ids) deliver(dismissListeners, id);\n },\n\n track,\n\n reset,\n\n dispose(): void {\n if (disposed) return;\n disposed = true;\n reset();\n listeners.clear();\n retainedListeners.clear();\n dismissListeners.clear();\n notificationListeners.clear();\n },\n };\n}\n\n/** The default app-wide bus — what `notify` and the adapters bind to unless handed an explicit bus. */\nexport const feedbackBus: FeedbackBus = createFeedbackBus();\n\n/** Publishes a notice on the default {@link feedbackBus} — the `notify({ tone, title })` entry point. */\nexport function notify(notice: FeedbackNotice): string {\n return feedbackBus.notify(notice);\n}\n"],"names":["notify"],"mappings":";AAMO,MAAM,aAAa;AAAA;AAAA,EAExB,MAAM,SAAS;AAAA;AAAA,EAEf,SAAS,SAAS;AAAA;AAAA,EAElB,SAAS,SAAS;AAAA;AAAA,EAElB,QAAQ,SAAS;AACnB;AAKO,MAAM,iBAAiB;AAAA;AAAA,EAE5B,KAAK;AAAA;AAAA,EAEL,QAAQ;AAAA;AAAA,EAER,MAAM;AAAA;AAAA,EAEN,QAAQ;AACV;AAKO,MAAM,qBAA+D,OAAO,OAAO;AAAA,EACxF,CAAC,eAAe,GAAG,GAAG;AAAA,EACtB,CAAC,eAAe,MAAM,GAAG;AAAA,EACzB,CAAC,eAAe,IAAI,GAAG;AAAA,EACvB,CAAC,eAAe,MAAM,GAAG;AAC3B,CAAC;AAeM,MAAM,iBAAiB;AAAA;AAAA,EAE5B,WAAW;AAAA;AAAA,EAEX,UAAU;AACZ;AA4QA,MAAM,qBAAqB;AAG3B,SAAS,WAAW,OAA4C;AAC9D,SAAO,UAAU,UAAa,OAAO,SAAS,KAAK;AACrD;AAOO,SAAS,kBAAkB,UAA8B,IAAiB;AAC/E,QAAM,EAAE,SAAS,WAAW,YAAA,IAAgB;AAC5C,MAAI,cAA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;AACrD,SAAO,YAAY,OAAO,MAAM;AAClC;"}
|
package/dist/feedback/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { NoticeTone, NoticeCategory, createFeedbackBus, feedbackBus, notify, type NoticeNode, type FeedbackNotice, type PublishedNotice, type NoticeListener, type RetainedNoticeListener, type NoticeDismissListener, type FeedbackBus, type FeedbackBusOptions, type FeedbackErrorContext, type FeedbackErrorHandler, } from './FeedbackBus';
|
|
1
|
+
export { NoticeTone, NoticePriority, NoticePriorityRank, NoticeCategory, createFeedbackBus, feedbackBus, notify, type NoticeNode, type NoticeCompactCopy, type NoticeGroup, type NoticeProgress, type NoticeReminderRequest, type FeedbackReminderOptions, type FeedbackNotice, type PublishedNotice, type RetainedSeed, type NoticeListener, type RetainedNoticeListener, type NoticeDismissListener, type ToastPauseUntil, type FeedbackNotificationState, type NotificationStateListener, type FeedbackBus, type FeedbackTrackNotices, type FeedbackBusOptions, type FeedbackErrorContext, type FeedbackErrorHandler, } from './FeedbackBus';
|
|
2
2
|
export { feedbackQueryErrors, toErrorNotice, DefaultReportableErrorTypes, type FeedbackQueryErrorsOptions, } from './FeedbackQueryErrors';
|
|
3
3
|
export { feedbackSessionExpiry, SessionExpiredNotice } from './FeedbackSessionExpiry';
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { NoticeCategory, NoticeTone, createFeedbackBus, feedbackBus, notify } from "./FeedbackBus.js";
|
|
1
|
+
import { NoticeCategory, NoticePriority, NoticePriorityRank, NoticeTone, createFeedbackBus, feedbackBus, notify } from "./FeedbackBus.js";
|
|
2
2
|
import { DefaultReportableErrorTypes, feedbackQueryErrors, toErrorNotice } from "./FeedbackQueryErrors.js";
|
|
3
3
|
import { SessionExpiredNotice, feedbackSessionExpiry } from "./FeedbackSessionExpiry.js";
|
|
4
4
|
export {
|
|
5
5
|
DefaultReportableErrorTypes,
|
|
6
6
|
NoticeCategory,
|
|
7
|
+
NoticePriority,
|
|
8
|
+
NoticePriorityRank,
|
|
7
9
|
NoticeTone,
|
|
8
10
|
SessionExpiredNotice,
|
|
9
11
|
createFeedbackBus,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ElementTag.js","sources":["../../../../src/foundation/dom/enums/ElementTag.ts"],"sourcesContent":["/* Shared polymorphic-element vocabulary for the `as` prop\n * (countUp / typewriter / animatedNumber / tilt / gradientText / scrollReveal). */\n\n/** Defines the HTML tag a polymorphic component renders as. */\nexport const ElementTag = {\n /** Refers to a `<span>`. */\n Span: 'span',\n /** Refers to a `<div>`. */\n Div: 'div',\n /** Refers to a `<p>`. */\n P: 'p',\n /** Refers to an `<h1>`. */\n H1: 'h1',\n /** Refers to an `<h2>`. */\n H2: 'h2',\n /** Refers to an `<h3>`. */\n H3: 'h3',\n /** Refers to an `<h4>`. */\n H4: 'h4',\n /** Refers to an `<h5>`. */\n H5: 'h5',\n /** Refers to an `<h6>`. */\n H6: 'h6',\n /** Refers to a `<section>`. */\n Section: 'section',\n /** Refers to an `<article>`. */\n Article: 'article',\n /** Refers to an `<li>`. */\n Li: 'li',\n} as const;\n\nexport type ElementTag = (typeof ElementTag)[keyof typeof ElementTag];\n"],"names":[],"mappings":"AAIO,MAAM,aAAa;AAAA;AAAA,EAExB,MAAM;AAAA;AAAA,EAEN,KAAK;AAAA;AAAA,EAEL,GAAG;AAAA;AAAA,EAEH,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,SAAS;AAAA;AAAA,EAET,SAAS;AAAA;AAAA,EAET,IAAI;AACN;"}
|
|
1
|
+
{"version":3,"file":"ElementTag.js","sources":["../../../../src/foundation/dom/enums/ElementTag.ts"],"sourcesContent":["/* Shared polymorphic-element vocabulary for the `as` prop\n * (countUp / typewriter / animatedNumber / tilt / gradientText / scrollReveal). */\n\n/** Defines the HTML tag a polymorphic component renders as. */\nexport const ElementTag = {\n /** Refers to a `<span>`. */\n Span: 'span',\n /** Refers to a `<div>`. */\n Div: 'div',\n /** Refers to a `<p>`. */\n P: 'p',\n /** Refers to an `<h1>`. */\n H1: 'h1',\n /** Refers to an `<h2>`. */\n H2: 'h2',\n /** Refers to an `<h3>`. */\n H3: 'h3',\n /** Refers to an `<h4>`. */\n H4: 'h4',\n /** Refers to an `<h5>`. */\n H5: 'h5',\n /** Refers to an `<h6>`. */\n H6: 'h6',\n /** Refers to a `<section>`. */\n Section: 'section',\n /** Refers to an `<article>`. */\n Article: 'article',\n /** Refers to an `<li>`. */\n Li: 'li',\n /** Refers to a `<ul>`. */\n Ul: 'ul',\n} as const;\n\nexport type ElementTag = (typeof ElementTag)[keyof typeof ElementTag];\n"],"names":[],"mappings":"AAIO,MAAM,aAAa;AAAA;AAAA,EAExB,MAAM;AAAA;AAAA,EAEN,KAAK;AAAA;AAAA,EAEL,GAAG;AAAA;AAAA,EAEH,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,IAAI;AAAA;AAAA,EAEJ,SAAS;AAAA;AAAA,EAET,SAAS;AAAA;AAAA,EAET,IAAI;AAAA;AAAA,EAEJ,IAAI;AACN;"}
|