@wow-two-beta/ui-vue 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{FeedbackBus-BRbyOMCn.js → FeedbackBus-CTj18X4n.js} +17 -3
- package/dist/chunks/FeedbackBus-CTj18X4n.js.map +1 -0
- package/dist/chunks/Navbar.vue_vue_type_script_setup_true_lang-Cl2ejukE.js.map +1 -1
- package/dist/chunks/{NotificationItem.vue_vue_type_script_setup_true_lang-gi0uHIuK.js → NotificationItem.vue_vue_type_script_setup_true_lang-KC5Iusce.js} +2 -2
- package/dist/chunks/{NotificationItem.vue_vue_type_script_setup_true_lang-gi0uHIuK.js.map → NotificationItem.vue_vue_type_script_setup_true_lang-KC5Iusce.js.map} +1 -1
- package/dist/feedback/FeedbackBus.d.ts +21 -3
- package/dist/feedback/index.d.ts +1 -1
- package/dist/feedback/index.js +2 -2
- package/dist/index.js +1 -1
- package/dist/presentation/feedback/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/FeedbackBus-BRbyOMCn.js.map +0 -1
|
@@ -42,6 +42,20 @@ export interface PublishedNotice extends FeedbackNotice {
|
|
|
42
42
|
}
|
|
43
43
|
/** Defines a listener notified on every published notice. */
|
|
44
44
|
export type NoticeListener = (notice: PublishedNotice) => void;
|
|
45
|
+
/** Defines the context handed to `onError` when a subscriber throws. */
|
|
46
|
+
export interface FeedbackErrorContext {
|
|
47
|
+
/** The listener that threw. */
|
|
48
|
+
readonly listener: NoticeListener;
|
|
49
|
+
/** The notice being delivered when it threw. */
|
|
50
|
+
readonly notice: PublishedNotice;
|
|
51
|
+
}
|
|
52
|
+
/** Defines the subscriber-failure handler — publishing must never break the publisher, so every listener throw lands here instead of propagating. */
|
|
53
|
+
export type FeedbackErrorHandler = (error: unknown, context: FeedbackErrorContext) => void;
|
|
54
|
+
/** Defines the options for {@link createFeedbackBus}. */
|
|
55
|
+
export interface FeedbackBusOptions {
|
|
56
|
+
/** Receives every subscriber failure. Omitted means failures are swallowed — a broken subscriber is never worth an app crash. */
|
|
57
|
+
readonly onError?: FeedbackErrorHandler;
|
|
58
|
+
}
|
|
45
59
|
/**
|
|
46
60
|
* Defines the module-scope feedback hub wiring app code to whatever surface renders notices.
|
|
47
61
|
* Fire-and-forget pub/sub (no replay): a notice published with no subscriber is dropped, so mount
|
|
@@ -58,13 +72,17 @@ export type NoticeListener = (notice: PublishedNotice) => void;
|
|
|
58
72
|
* `bus` prop on the adapter is the isolation seam an app needs instead.
|
|
59
73
|
*/
|
|
60
74
|
export interface FeedbackBus {
|
|
61
|
-
/** Publishes a notice to all subscribers — safe to call with none mounted (no-op); returns the notice id. */
|
|
75
|
+
/** Publishes a notice to all subscribers — safe to call with none mounted (no-op), and never throws whatever a subscriber does; returns the notice id. */
|
|
62
76
|
notify(notice: FeedbackNotice): string;
|
|
63
77
|
/** Subscribes to published notices; returns an unsubscribe. */
|
|
64
78
|
subscribe(listener: NoticeListener): () => void;
|
|
65
79
|
}
|
|
66
|
-
/**
|
|
67
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Creates a {@link FeedbackBus} — one per app, module scope, shared by publishers and the rendering adapter.
|
|
82
|
+
* Apps that don't need isolation use the default {@link feedbackBus}; pass `onError` to see the subscriber
|
|
83
|
+
* failures the bus otherwise swallows.
|
|
84
|
+
*/
|
|
85
|
+
export declare function createFeedbackBus(options?: FeedbackBusOptions): FeedbackBus;
|
|
68
86
|
/** The default app-wide bus — what `notify` and the adapters bind to unless handed an explicit bus. */
|
|
69
87
|
export declare const feedbackBus: FeedbackBus;
|
|
70
88
|
/** Publishes a notice on the default {@link feedbackBus} — the everyday `notify({ tone: 'success', title: 'Saved' })` entry point. */
|
package/dist/feedback/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { NoticeTone, createFeedbackBus, feedbackBus, notify, type NoticeNode, type FeedbackNotice, type PublishedNotice, type NoticeListener, type FeedbackBus, } from './FeedbackBus';
|
|
1
|
+
export { NoticeTone, createFeedbackBus, feedbackBus, notify, type NoticeNode, type FeedbackNotice, type PublishedNotice, type NoticeListener, type FeedbackBus, type FeedbackBusOptions, type FeedbackErrorContext, type FeedbackErrorHandler, } from './FeedbackBus';
|
|
2
2
|
export { feedbackQueryErrors, toErrorNotice } from './FeedbackQueryErrors';
|
package/dist/feedback/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { f as feedbackBus, N as NoticeTone } from "../chunks/FeedbackBus-
|
|
2
|
-
import { c, n } from "../chunks/FeedbackBus-
|
|
1
|
+
import { f as feedbackBus, N as NoticeTone } from "../chunks/FeedbackBus-CTj18X4n.js";
|
|
2
|
+
import { c, n } from "../chunks/FeedbackBus-CTj18X4n.js";
|
|
3
3
|
function toErrorNotice(error) {
|
|
4
4
|
const isNetwork = error.status === 0;
|
|
5
5
|
const title = error.problem?.title ?? (isNetwork ? "Network error" : `Request failed (${error.status})`);
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { _, a, b, c, d, F, e, f, L, g, h, S, i as i8, j, k, l, T, m, n, o, p, q,
|
|
|
9
9
|
import { A, _ as _2, B, a as a2, C, b as b2, c as c2, d as d2, e as e2, f as f2, g as g2, h as h2, i as i9, j as j2, k as k2, l as l2, m as m2, n as n2, o as o2, p as p2, q as q2, r as r2, s as s2, t, u as u2, v, w, x, y, z, D, E, F as F2, G, H, I, J, K, L as L2, M, N, O, P, Q, R, S as S2, T as T2, U, V, W, X, Y, Z, $, a0, a1, a2 as a22, a3, a4, a5, a6, a7, a8, a9, a4 as a42, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, a$, b0, b1, b2 as b22, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB } from "./chunks/ChatComposer.vue_vue_type_script_setup_true_lang-lNcRhKIv.js";
|
|
10
10
|
import { _ as _3, a as a10, b as b10, c as c3, A as A2, d as d3, e as e3, f as f3, g as g3, h as h3, i as i10, j as j3, k as k3, l as l3, m as m3, n as n3, o as o3, p as p3, q as q3, r as r3, s as s3, B as B2, t as t2, u as u3, v as v2, w as w2, x as x2, y as y2, z as z2, C as C2, D as D2, E as E2, F as F3, G as G2, H as H2, I as I2, J as J2, K as K2, L as L3, M as M2, N as N2, O as O2, P as P2, Q as Q2, R as R2, S as S3, T as T3, U as U2, V as V2, W as W2, X as X2, Y as Y2, Z as Z2, $ as $2, a0 as a02, a1 as a12, a2 as a23, a3 as a32, a4 as a43, a5 as a52, a6 as a62, a7 as a72, a8 as a82, a9 as a92, aa as aa2, ab as ab2, ac as ac2, ad as ad2, ae as ae2, af as af2, ag as ag2, ah as ah2, ai as ai2, aj as aj2, ak as ak2, al as al2, am as am2, an as an2, ao as ao2, ap as ap2, aq as aq2, ar as ar2, as as as2, at as at2, au as au2, av as av2, aw as aw2, ax as ax2, ay as ay2, az as az2, aA as aA2, aB as aB2, aC as aC2, aD as aD2, aE as aE2, aF as aF2, aG as aG2, aH as aH2, aI as aI2, aJ as aJ2, aK as aK2, aL as aL2, aM as aM2, aN as aN2, aO as aO2, aP as aP2, aQ as aQ2, aR as aR2, aS as aS2, aT as aT2, aU as aU2, aV as aV2, aW as aW2, aX as aX2, aY as aY2, aZ as aZ2, a_ as a_2, a$ as a$2, b0 as b02, b1 as b12, b2 as b23, b3 as b32, b4 as b42, b5 as b52, b6 as b62, b7 as b72, b8 as b82, b9 as b92, ba as ba2, bb as bb2, bc as bc2, bd as bd2, be as be2, bf as bf2, bg as bg2, bh as bh2, bi as bi2, bj as bj2, bk as bk2, bl as bl2, bm as bm2, bn as bn2, bo as bo2, bp as bp2, bq as bq2, br as br2, bs as bs2, bt as bt2, bu as bu2, bv as bv2, bw as bw2, bx as bx2, by as by2, bz as bz2, bA as bA2, bB as bB2, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, b_, b$, c0 } from "./chunks/SortableHandle.vue_vue_type_script_setup_true_lang-CWCXGjZG.js";
|
|
11
11
|
import { _ as _4, a as a11, b as b11, c as c4, d as d4, e as e4, f as f4, c as c5, d as d5, e as e5, f as f5, g as g4, h as h4, i as i11, j as j4, k as k4, h as h5, l as l4, m as m4, i as i12, n as n4, j as j5, k as k5, h as h6, l as l5, m as m5, i as i13, o as o4, p as p4, q as q4, r as r4, s as s4, j as j6, k as k6, h as h7, l as l6, m as m6, i as i14, n as n5, t as t3, u as u4 } from "./chunks/BottomSheet.vue_vue_type_script_setup_true_lang-CmNoI4BE.js";
|
|
12
|
-
import { _ as _5, a as a13, b as b13, c as c6, d as d6, e as e6, f as f6, g as g5, h as h8, i as i15, j as j7, k as k7, l as l7, m as m7, n as n6, P as P3, o as o5, p as p5, q as q5, r as r5, s as s5, t as t4, S as S4, u as u5, v as v3, w as w3, x as x3, y as y3, z as z3, A as A3, T as T4, B as B3, C as C3, D as D3, E as E3, F as F4, G as G3, H as H3, I as I3, J as J3, K as K3 } from "./chunks/NotificationItem.vue_vue_type_script_setup_true_lang-
|
|
12
|
+
import { _ as _5, a as a13, b as b13, c as c6, d as d6, e as e6, f as f6, g as g5, h as h8, i as i15, j as j7, k as k7, l as l7, m as m7, n as n6, P as P3, o as o5, p as p5, q as q5, r as r5, s as s5, t as t4, S as S4, u as u5, v as v3, w as w3, x as x3, y as y3, z as z3, A as A3, T as T4, B as B3, C as C3, D as D3, E as E3, F as F4, G as G3, H as H3, I as I3, J as J3, K as K3 } from "./chunks/NotificationItem.vue_vue_type_script_setup_true_lang-KC5Iusce.js";
|
|
13
13
|
import { _ as _6, a as a14, b as b14, c as c7, d as d7, e as e7, f as f7, g as g6, h as h9, B as B4, i as i16, j as j8, k as k8, C as C4, l as l8, m as m8, n as n7, F as F5, o as o6, G as G4, p as p6, q as q6, N as N3, r as r6, O as O3, s as s6, t as t5, u as u6, v as v4, w as w4, x as x4, y as y4, S as S5, z as z4, A as A4, D as D4, E as E4, H as H4, I as I4, J as J4, K as K4, L as L4, M as M3, P as P4, Q as Q3, R as R3, T as T5, U as U3 } from "./chunks/Navbar.vue_vue_type_script_setup_true_lang-Cl2ejukE.js";
|
|
14
14
|
import { _ as _7, B as B5 } from "./chunks/Backdrop.vue_vue_type_script_setup_true_lang-DZUhGY9p.js";
|
|
15
15
|
import { _ as _8, a as a15, b as b15, c as c8, d as d8, e as e8, f as f8, g as g7, h as h10, i as i17, j as j9, k as k9, l as l9, m as m9, n as n8, o as o7, p as p7, q as q7, M as M4, r as r7, s as s7, t as t6, u as u7, v as v5, w as w5, x as x5, y as y5, z as z5, A as A5, B as B6, C as C5, D as D5, E as E5, F as F6, G as G5, H as H5, I as I5, J as J5, K as K5, L as L5, N as N4, O as O4, P as P5, Q as Q4, R as R4, S as S6, T as T6, U as U4, V as V3, W as W3, X as X3, Y as Y3, Z as Z3, $ as $3, a0 as a03, a1 as a16 } from "./chunks/TableOfContents.vue_vue_type_script_setup_true_lang-HVL4lg_f.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _, a, b, c, d, e, f, g, h, i, j, k, l, m, n, P, o, p, q, r, s, t, S, u, v, w, x, y, z, A, T, B, C, D, E, F, G, H, I, J, K } from "../../chunks/NotificationItem.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _, a, b, c, d, e, f, g, h, i, j, k, l, m, n, P, o, p, q, r, s, t, S, u, v, w, x, y, z, A, T, B, C, D, E, F, G, H, I, J, K } from "../../chunks/NotificationItem.vue_vue_type_script_setup_true_lang-KC5Iusce.js";
|
|
2
2
|
import { _ as _2, S as S2, s as s2 } from "../../chunks/Spinner.vue_vue_type_script_setup_true_lang-C4lNiUOm.js";
|
|
3
3
|
export {
|
|
4
4
|
_ as Alert,
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackBus-BRbyOMCn.js","sources":["../../src/feedback/FeedbackBus.ts"],"sourcesContent":["import type { VNode } from 'vue';\n\nimport { Severity } from '../foundation/utils';\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 `Toaster` 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 a feedback notice published on the bus — the headless payload a presentation adapter renders (toast, banner, notification center…). */\nexport interface FeedbackNotice {\n /** The semantic tone — maps 1:1 onto the toast `severity` vocabulary. */\n readonly tone: NoticeTone;\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 /** An optional stable identity — assigned by the bus (`n_<seq>`) when omitted; callers set it for future dedupe / notification-center use. */\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/**\n * Defines the module-scope feedback hub wiring app code to whatever surface renders notices.\n * Fire-and-forget pub/sub (no replay): a notice published with no subscriber is dropped, so mount\n * the adapter (`<FeedbackToasts/>`) 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** — `<FeedbackToasts/>` (`/presentation/feedback`) subscribes and forwards each\n * notice into the imperative `toaster.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 a notice to all subscribers — safe to call with none mounted (no-op); returns the notice id. */\n notify(notice: FeedbackNotice): string;\n\n /** Subscribes to published notices; returns an unsubscribe. */\n subscribe(listener: NoticeListener): () => void;\n}\n\n/** Creates a {@link FeedbackBus} — one per app, module scope, shared by publishers and the rendering adapter. Apps that don't need isolation use the default {@link feedbackBus}. */\nexport function createFeedbackBus(): FeedbackBus {\n const listeners = new Set<NoticeListener>();\n let idSeq = 0;\n\n return {\n notify(notice: FeedbackNotice): string {\n const published: PublishedNotice = { ...notice, id: notice.id ?? `n_${++idSeq}` };\n for (const listener of [...listeners]) listener(published);\n return published.id;\n },\n\n subscribe(listener: NoticeListener): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\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 everyday `notify({ tone: 'success', title: 'Saved' })` entry point. */\nexport function notify(notice: FeedbackNotice): string {\n return feedbackBus.notify(notice);\n}\n"],"names":[],"mappings":";AAKO,MAAM,aAAa;AAAA;AAAA,EAExB,MAAM,SAAS;AAAA;AAAA,EAEf,SAAS,SAAS;AAAA;AAAA,EAElB,SAAS,SAAS;AAAA;AAAA,EAElB,QAAQ,SAAS;AACnB;AAoEO,SAAS,oBAAiC;AAC/C,QAAM,gCAAgB,IAAA;AACtB,MAAI,QAAQ;AAEZ,SAAO;AAAA,IACL,OAAO,QAAgC;AACrC,YAAM,YAA6B,EAAE,GAAG,QAAQ,IAAI,OAAO,MAAM,KAAK,EAAE,KAAK,GAAA;AAC7E,iBAAW,YAAY,CAAC,GAAG,SAAS,YAAY,SAAS;AACzD,aAAO,UAAU;AAAA,IACnB;AAAA,IAEA,UAAU,UAAsC;AAC9C,gBAAU,IAAI,QAAQ;AACtB,aAAO,MAAM;AACX,kBAAU,OAAO,QAAQ;AAAA,MAC3B;AAAA,IACF;AAAA,EAAA;AAEJ;AAGO,MAAM,cAA2B,kBAAA;AAGjC,SAAS,OAAO,QAAgC;AACrD,SAAO,YAAY,OAAO,MAAM;AAClC;"}
|