@ai-matrx/design-system 0.86.356 → 0.86.358
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/CHANGELOG.md +16 -0
- package/dist/auth-gate-dialog.js +2 -2
- package/dist/carousel.js +11 -10
- package/dist/carousel.js.map +1 -1
- package/dist/{chunk-UWTODOMD.js → chunk-2BQAHLU3.js} +4 -4
- package/dist/{chunk-T4D7WAV7.js → chunk-42GFQMLA.js} +2 -2
- package/dist/chunk-5Z5GTXKL.js +79 -0
- package/dist/chunk-5Z5GTXKL.js.map +1 -0
- package/dist/{chunk-POJ3RR3K.js → chunk-B5D3VIMC.js} +1 -1
- package/dist/{chunk-POJ3RR3K.js.map → chunk-B5D3VIMC.js.map} +1 -1
- package/dist/{chunk-4WSXAP24.js → chunk-BB5LA7FQ.js} +3 -1
- package/dist/chunk-BB5LA7FQ.js.map +1 -0
- package/dist/{chunk-FRJ4PPA2.js → chunk-CZGZV35G.js} +2 -2
- package/dist/{chunk-RLM4RSED.js → chunk-GUGBVQ4T.js} +6 -4
- package/dist/{chunk-RLM4RSED.js.map → chunk-GUGBVQ4T.js.map} +1 -1
- package/dist/{chunk-LJKF267O.js → chunk-HS6GMHKZ.js} +18 -76
- package/dist/chunk-HS6GMHKZ.js.map +1 -0
- package/dist/{chunk-2PO3N42Q.js → chunk-K3XWUACX.js} +5 -5
- package/dist/{chunk-ZMUPFGQO.js → chunk-K5ZQROWN.js} +5 -5
- package/dist/{chunk-U46XUQI7.js → chunk-KSCSH7AO.js} +16 -14
- package/dist/chunk-KSCSH7AO.js.map +1 -0
- package/dist/{chunk-MTE6N7XU.js → chunk-NFJ63LIH.js} +2 -2
- package/dist/{chunk-CFUXEGW2.js → chunk-OUQT72UL.js} +4 -4
- package/dist/{chunk-WUD23YTG.js → chunk-P56Y43RL.js} +6 -6
- package/dist/{chunk-GMNROZQJ.js → chunk-QTPW44IJ.js} +2 -2
- package/dist/{chunk-QA7EHFRX.js → chunk-T3FKFPCW.js} +5 -5
- package/dist/{chunk-X6ZRHJQP.js → chunk-T57DLONB.js} +20 -11
- package/dist/chunk-T57DLONB.js.map +1 -0
- package/dist/{chunk-SOCNWQMX.js → chunk-TEMAM5ET.js} +3 -3
- package/dist/{chunk-CH2NWSES.js → chunk-TIV6M7Q7.js} +3 -3
- package/dist/{chunk-6XNYYROM.js → chunk-WVEDW5VO.js} +2 -2
- package/dist/clipboard-fallback-dialog.js +4 -4
- package/dist/controls.cjs +34 -13
- package/dist/controls.cjs.map +1 -1
- package/dist/controls.js +9 -8
- package/dist/data-table/data-row-inspector.cjs +99 -11
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +8 -7
- package/dist/data-table/data-row-window.cjs +99 -11
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +11 -10
- package/dist/data-table/drill-chart.cjs +15 -3
- package/dist/data-table/drill-chart.cjs.map +1 -1
- package/dist/data-table/drill-chart.js +2 -1
- package/dist/data-table/drill-chart.js.map +1 -1
- package/dist/data-table/host.cjs.map +1 -1
- package/dist/data-table/host.d.cts +6 -2
- package/dist/data-table/host.d.ts +6 -2
- package/dist/data-table/host.js +1 -1
- package/dist/data-table/index.cjs +54 -40
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +6 -2
- package/dist/data-table/index.d.ts +6 -2
- package/dist/data-table/index.js +25 -28
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/pagination.cjs +19 -10
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +4 -4
- package/dist/data-table/uuid-cell.cjs +99 -11
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +5 -4
- package/dist/desktop.cjs +45 -15
- package/dist/desktop.cjs.map +1 -1
- package/dist/desktop.js +23 -15
- package/dist/desktop.js.map +1 -1
- package/dist/email-input-dialog.cjs +15 -3
- package/dist/email-input-dialog.cjs.map +1 -1
- package/dist/email-input-dialog.js +4 -3
- package/dist/email-input-dialog.js.map +1 -1
- package/dist/error-sentence.cjs +130 -0
- package/dist/error-sentence.cjs.map +1 -0
- package/dist/error-sentence.d.cts +49 -0
- package/dist/error-sentence.d.ts +49 -0
- package/dist/error-sentence.js +22 -0
- package/dist/error-sentence.js.map +1 -0
- package/dist/index.cjs +47 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -10
- package/dist/index.d.ts +12 -10
- package/dist/index.js +30 -28
- package/dist/index.js.map +1 -1
- package/dist/item.cjs +19 -10
- package/dist/item.cjs.map +1 -1
- package/dist/item.js +7 -7
- package/dist/lite-table.cjs +15 -3
- package/dist/lite-table.cjs.map +1 -1
- package/dist/lite-table.js +5 -4
- package/dist/lite-table.js.map +1 -1
- package/dist/menu-look.cjs +19 -10
- package/dist/menu-look.cjs.map +1 -1
- package/dist/menu-look.js +2 -2
- package/dist/notice-stack.cjs +2 -0
- package/dist/notice-stack.cjs.map +1 -1
- package/dist/notice-stack.d.cts +11 -1
- package/dist/notice-stack.d.ts +11 -1
- package/dist/notice-stack.js +3 -1
- package/dist/record-list.cjs +34 -13
- package/dist/record-list.cjs.map +1 -1
- package/dist/record-list.js +8 -7
- package/dist/record-list.js.map +1 -1
- package/dist/sandbox-gate-dialog.js +2 -2
- package/dist/scope-mismatch-dialog.js +2 -2
- package/dist/settings.js +3 -3
- package/dist/swipe-deck.cjs +15 -3
- package/dist/swipe-deck.cjs.map +1 -1
- package/dist/swipe-deck.js +2 -1
- package/dist/swipe-deck.js.map +1 -1
- package/dist/text-input-dialog.cjs +15 -3
- package/dist/text-input-dialog.cjs.map +1 -1
- package/dist/text-input-dialog.js +4 -3
- package/dist/text-input-dialog.js.map +1 -1
- package/dist/value-prompts-dialog.js +2 -2
- package/dist/writing-field.js +5 -5
- package/package.json +12 -2
- package/dist/chunk-4WSXAP24.js.map +0 -1
- package/dist/chunk-LJKF267O.js.map +0 -1
- package/dist/chunk-U46XUQI7.js.map +0 -1
- package/dist/chunk-X6ZRHJQP.js.map +0 -1
- /package/dist/{chunk-UWTODOMD.js.map → chunk-2BQAHLU3.js.map} +0 -0
- /package/dist/{chunk-T4D7WAV7.js.map → chunk-42GFQMLA.js.map} +0 -0
- /package/dist/{chunk-FRJ4PPA2.js.map → chunk-CZGZV35G.js.map} +0 -0
- /package/dist/{chunk-2PO3N42Q.js.map → chunk-K3XWUACX.js.map} +0 -0
- /package/dist/{chunk-ZMUPFGQO.js.map → chunk-K5ZQROWN.js.map} +0 -0
- /package/dist/{chunk-MTE6N7XU.js.map → chunk-NFJ63LIH.js.map} +0 -0
- /package/dist/{chunk-CFUXEGW2.js.map → chunk-OUQT72UL.js.map} +0 -0
- /package/dist/{chunk-WUD23YTG.js.map → chunk-P56Y43RL.js.map} +0 -0
- /package/dist/{chunk-GMNROZQJ.js.map → chunk-QTPW44IJ.js.map} +0 -0
- /package/dist/{chunk-QA7EHFRX.js.map → chunk-T3FKFPCW.js.map} +0 -0
- /package/dist/{chunk-SOCNWQMX.js.map → chunk-TEMAM5ET.js.map} +0 -0
- /package/dist/{chunk-CH2NWSES.js.map → chunk-TIV6M7Q7.js.map} +0 -0
- /package/dist/{chunk-6XNYYROM.js.map → chunk-WVEDW5VO.js.map} +0 -0
package/dist/menu-look.js
CHANGED
|
@@ -34,10 +34,10 @@ import {
|
|
|
34
34
|
MenuLookSubContent,
|
|
35
35
|
MenuLookSubTrigger,
|
|
36
36
|
menuLookItemClass
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-42GFQMLA.js";
|
|
38
38
|
import "./chunk-HEFTQUJ5.js";
|
|
39
39
|
import "./chunk-OPF265PU.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-T57DLONB.js";
|
|
41
41
|
import "./chunk-BNXNIN2S.js";
|
|
42
42
|
import "./chunk-FXXSZNER.js";
|
|
43
43
|
import "./chunk-DGNHZBJY.js";
|
package/dist/notice-stack.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
22
22
|
var notice_stack_exports = {};
|
|
23
23
|
__export(notice_stack_exports, {
|
|
24
24
|
NOTICE_STACK: () => NOTICE_STACK,
|
|
25
|
+
NOTICE_TEXT_BUDGET: () => NOTICE_TEXT_BUDGET,
|
|
25
26
|
collapseNotices: () => collapseNotices,
|
|
26
27
|
noticeKey: () => noticeKey,
|
|
27
28
|
noticeLifetimeMs: () => noticeLifetimeMs,
|
|
@@ -40,6 +41,7 @@ var NOTICE_STACK = {
|
|
|
40
41
|
/** The card's width: small, never the window's. */
|
|
41
42
|
widthRem: 22
|
|
42
43
|
};
|
|
44
|
+
var NOTICE_TEXT_BUDGET = { titleChars: 24, lineChars: 40 };
|
|
43
45
|
function noticeKey(tone, title, message) {
|
|
44
46
|
const text = (v) => typeof v === "string" || typeof v === "number" ? String(v).trim() : "";
|
|
45
47
|
return `${tone}\0${text(title)}\0${text(message)}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/notice-stack.ts"],"sourcesContent":["/**\n * @ai-matrx/design-system/notice-stack — THE ONE NOTICE LOOK AND STACK RULE, for the web and Matrx 2.\n *\n * Arman, 2026-10-23, looking at two full-width red bars across Matrx 2 Cloud Chat: \"Let's eliminate\n * this terrible pattern of having giant errors that shit the entire ui. If we're going to have a\n * place for errors, it should be a small something that resembles errors from a normal macos\".\n *\n * Champion: the macOS notification banner. A small rounded card of translucent material in the\n * window's TOP-RIGHT corner (where macOS puts every notification, so the eye already looks there;\n * the bottom of our windows holds the composer and the list's foot, which a notice must not sit on),\n * the tone's icon, a one-line title, an optional second line, at most one action, and ×.\n *\n * The stack rule, the same on both hosts:\n * - identical notices (same tone, title and line) collapse into ONE card with a count;\n * - at most 3 cards show; the rest fold into \"N more\";\n * - info and success go after NOTICE_STACK.infoMs; errors and warnings stay until dismissed\n * or until NOTICE_STACK.errorMs (long, so a notice nobody saw does not sit there for ever).\n *\n * The desktop renders it through `Notices` + `Banner` (desktop/layout.tsx, desktop/state.tsx); the\n * web through its one sonner Toaster (matrx-frontend components/ui/sonner.tsx), which reads these\n * constants and keys every toast with `noticeKey` so the same notice never stacks twice.\n */\n\nexport const NOTICE_STACK = {\n /** The corner every notice floats in. */\n corner: \"top-right\",\n /** Cards shown at once; the rest fold into \"N more\". */\n maxVisible: 3,\n /** Info and success: gone after this long. */\n infoMs: 4000,\n /** Errors and warnings: stay until dismissed, or this long at most. */\n errorMs: 30000,\n /** The card's width: small, never the window's. */\n widthRem: 22,\n} as const;\n\nexport type NoticeStackTone = \"neutral\" | \"info\" | \"warning\" | \"danger\" | \"success\";\n\n/** The identity two notices share when they say the same thing (tone, title, line). */\nexport function noticeKey(tone: string, title: unknown, message?: unknown): string {\n const text = (v: unknown): string => (typeof v === \"string\" || typeof v === \"number\" ? String(v).trim() : \"\");\n return `${tone}\\u0000${text(title)}\\u0000${text(message)}`;\n}\n\nexport interface CollapsedNotice<T> {\n /** The latest notice of the group (its dismiss and action are the live ones). */\n readonly item: T;\n /** Every notice the group holds, oldest first. */\n readonly members: readonly T[];\n /** How many identical notices it stands for. */\n readonly count: number;\n}\n\n/**\n * Identical notices become one with a count, in the order each first appeared. A notice whose key\n * is null (a rich one that says nothing comparable) stands alone.\n */\nexport function collapseNotices<T>(items: readonly T[], keyOf: (item: T) => string | null): CollapsedNotice<T>[] {\n const groups: { key: string | null; members: T[] }[] = [];\n const byKey = new Map<string, { key: string | null; members: T[] }>();\n for (const item of items) {\n const key = keyOf(item);\n const found = key !== null ? byKey.get(key) : undefined;\n if (found) {\n found.members.push(item);\n continue;\n }\n const group = { key, members: [item] };\n groups.push(group);\n if (key !== null) byKey.set(key, group);\n }\n return groups.map((g) => ({ item: g.members[g.members.length - 1] as T, members: g.members, count: g.members.length }));\n}\n\n/** The cards on screen and how many fold away (the newest show). */\nexport function visibleNotices<T>(groups: readonly T[], max: number = NOTICE_STACK.maxVisible): { shown: T[]; folded: number } {\n if (groups.length <= max) return { shown: [...groups], folded: 0 };\n return { shown: groups.slice(groups.length - max), folded: groups.length - max };\n}\n\n/** How long a notice of this tone stays (ms; Infinity never happens: errors cap at errorMs). */\nexport function noticeLifetimeMs(tone: NoticeStackTone | \"error\"): number {\n return tone === \"danger\" || tone === \"warning\" || tone === \"error\" ? NOTICE_STACK.errorMs : NOTICE_STACK.infoMs;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBO,IAAM,eAAe;AAAA;AAAA,EAE1B,QAAQ;AAAA;AAAA,EAER,YAAY;AAAA;AAAA,EAEZ,QAAQ;AAAA;AAAA,EAER,SAAS;AAAA;AAAA,EAET,UAAU;AACZ;
|
|
1
|
+
{"version":3,"sources":["../src/notice-stack.ts"],"sourcesContent":["/**\n * @ai-matrx/design-system/notice-stack — THE ONE NOTICE LOOK AND STACK RULE, for the web and Matrx 2.\n *\n * Arman, 2026-10-23, looking at two full-width red bars across Matrx 2 Cloud Chat: \"Let's eliminate\n * this terrible pattern of having giant errors that shit the entire ui. If we're going to have a\n * place for errors, it should be a small something that resembles errors from a normal macos\".\n *\n * Champion: the macOS notification banner. A small rounded card of translucent material in the\n * window's TOP-RIGHT corner (where macOS puts every notification, so the eye already looks there;\n * the bottom of our windows holds the composer and the list's foot, which a notice must not sit on),\n * the tone's icon, a one-line title, an optional second line, at most one action, and ×.\n *\n * The stack rule, the same on both hosts:\n * - identical notices (same tone, title and line) collapse into ONE card with a count;\n * - at most 3 cards show; the rest fold into \"N more\";\n * - info and success go after NOTICE_STACK.infoMs; errors and warnings stay until dismissed\n * or until NOTICE_STACK.errorMs (long, so a notice nobody saw does not sit there for ever).\n *\n * The desktop renders it through `Notices` + `Banner` (desktop/layout.tsx, desktop/state.tsx); the\n * web through its one sonner Toaster (matrx-frontend components/ui/sonner.tsx), which reads these\n * constants and keys every toast with `noticeKey` so the same notice never stacks twice.\n */\n\nexport const NOTICE_STACK = {\n /** The corner every notice floats in. */\n corner: \"top-right\",\n /** Cards shown at once; the rest fold into \"N more\". */\n maxVisible: 3,\n /** Info and success: gone after this long. */\n infoMs: 4000,\n /** Errors and warnings: stay until dismissed, or this long at most. */\n errorMs: 30000,\n /** The card's width: small, never the window's. */\n widthRem: 22,\n} as const;\n\n/**\n * How much a card can SAY with nothing cut by \"…\" at the smallest window (900 × 560, Matrx 2 Cloud\n * Chat: the card is 324 px wide over the viewer, and an action such as Retry shares the row, leaving\n * ~180 px of text): the title is one line, the line under it at most two short ones. Measured\n * 2026-10-24 (\"Your change was not saved …\" / \"Check the connection and tr…\"). In-app text is layout.\n */\nexport const NOTICE_TEXT_BUDGET = { titleChars: 24, lineChars: 40 } as const;\n\nexport type NoticeStackTone = \"neutral\" | \"info\" | \"warning\" | \"danger\" | \"success\";\n\n/** The identity two notices share when they say the same thing (tone, title, line). */\nexport function noticeKey(tone: string, title: unknown, message?: unknown): string {\n const text = (v: unknown): string => (typeof v === \"string\" || typeof v === \"number\" ? String(v).trim() : \"\");\n return `${tone}\\u0000${text(title)}\\u0000${text(message)}`;\n}\n\nexport interface CollapsedNotice<T> {\n /** The latest notice of the group (its dismiss and action are the live ones). */\n readonly item: T;\n /** Every notice the group holds, oldest first. */\n readonly members: readonly T[];\n /** How many identical notices it stands for. */\n readonly count: number;\n}\n\n/**\n * Identical notices become one with a count, in the order each first appeared. A notice whose key\n * is null (a rich one that says nothing comparable) stands alone.\n */\nexport function collapseNotices<T>(items: readonly T[], keyOf: (item: T) => string | null): CollapsedNotice<T>[] {\n const groups: { key: string | null; members: T[] }[] = [];\n const byKey = new Map<string, { key: string | null; members: T[] }>();\n for (const item of items) {\n const key = keyOf(item);\n const found = key !== null ? byKey.get(key) : undefined;\n if (found) {\n found.members.push(item);\n continue;\n }\n const group = { key, members: [item] };\n groups.push(group);\n if (key !== null) byKey.set(key, group);\n }\n return groups.map((g) => ({ item: g.members[g.members.length - 1] as T, members: g.members, count: g.members.length }));\n}\n\n/** The cards on screen and how many fold away (the newest show). */\nexport function visibleNotices<T>(groups: readonly T[], max: number = NOTICE_STACK.maxVisible): { shown: T[]; folded: number } {\n if (groups.length <= max) return { shown: [...groups], folded: 0 };\n return { shown: groups.slice(groups.length - max), folded: groups.length - max };\n}\n\n/** How long a notice of this tone stays (ms; Infinity never happens: errors cap at errorMs). */\nexport function noticeLifetimeMs(tone: NoticeStackTone | \"error\"): number {\n return tone === \"danger\" || tone === \"warning\" || tone === \"error\" ? NOTICE_STACK.errorMs : NOTICE_STACK.infoMs;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAuBO,IAAM,eAAe;AAAA;AAAA,EAE1B,QAAQ;AAAA;AAAA,EAER,YAAY;AAAA;AAAA,EAEZ,QAAQ;AAAA;AAAA,EAER,SAAS;AAAA;AAAA,EAET,UAAU;AACZ;AAQO,IAAM,qBAAqB,EAAE,YAAY,IAAI,WAAW,GAAG;AAK3D,SAAS,UAAU,MAAc,OAAgB,SAA2B;AACjF,QAAM,OAAO,CAAC,MAAwB,OAAO,MAAM,YAAY,OAAO,MAAM,WAAW,OAAO,CAAC,EAAE,KAAK,IAAI;AAC1G,SAAO,GAAG,IAAI,KAAS,KAAK,KAAK,CAAC,KAAS,KAAK,OAAO,CAAC;AAC1D;AAeO,SAAS,gBAAmB,OAAqB,OAAyD;AAC/G,QAAM,SAAiD,CAAC;AACxD,QAAM,QAAQ,oBAAI,IAAkD;AACpE,aAAW,QAAQ,OAAO;AACxB,UAAM,MAAM,MAAM,IAAI;AACtB,UAAM,QAAQ,QAAQ,OAAO,MAAM,IAAI,GAAG,IAAI;AAC9C,QAAI,OAAO;AACT,YAAM,QAAQ,KAAK,IAAI;AACvB;AAAA,IACF;AACA,UAAM,QAAQ,EAAE,KAAK,SAAS,CAAC,IAAI,EAAE;AACrC,WAAO,KAAK,KAAK;AACjB,QAAI,QAAQ,KAAM,OAAM,IAAI,KAAK,KAAK;AAAA,EACxC;AACA,SAAO,OAAO,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,SAAS,CAAC,GAAQ,SAAS,EAAE,SAAS,OAAO,EAAE,QAAQ,OAAO,EAAE;AACxH;AAGO,SAAS,eAAkB,QAAsB,MAAc,aAAa,YAA4C;AAC7H,MAAI,OAAO,UAAU,IAAK,QAAO,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,QAAQ,EAAE;AACjE,SAAO,EAAE,OAAO,OAAO,MAAM,OAAO,SAAS,GAAG,GAAG,QAAQ,OAAO,SAAS,IAAI;AACjF;AAGO,SAAS,iBAAiB,MAAyC;AACxE,SAAO,SAAS,YAAY,SAAS,aAAa,SAAS,UAAU,aAAa,UAAU,aAAa;AAC3G;","names":[]}
|
package/dist/notice-stack.d.cts
CHANGED
|
@@ -32,6 +32,16 @@ declare const NOTICE_STACK: {
|
|
|
32
32
|
/** The card's width: small, never the window's. */
|
|
33
33
|
readonly widthRem: 22;
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* How much a card can SAY with nothing cut by "…" at the smallest window (900 × 560, Matrx 2 Cloud
|
|
37
|
+
* Chat: the card is 324 px wide over the viewer, and an action such as Retry shares the row, leaving
|
|
38
|
+
* ~180 px of text): the title is one line, the line under it at most two short ones. Measured
|
|
39
|
+
* 2026-10-24 ("Your change was not saved …" / "Check the connection and tr…"). In-app text is layout.
|
|
40
|
+
*/
|
|
41
|
+
declare const NOTICE_TEXT_BUDGET: {
|
|
42
|
+
readonly titleChars: 24;
|
|
43
|
+
readonly lineChars: 40;
|
|
44
|
+
};
|
|
35
45
|
type NoticeStackTone = "neutral" | "info" | "warning" | "danger" | "success";
|
|
36
46
|
/** The identity two notices share when they say the same thing (tone, title, line). */
|
|
37
47
|
declare function noticeKey(tone: string, title: unknown, message?: unknown): string;
|
|
@@ -56,5 +66,5 @@ declare function visibleNotices<T>(groups: readonly T[], max?: number): {
|
|
|
56
66
|
/** How long a notice of this tone stays (ms; Infinity never happens: errors cap at errorMs). */
|
|
57
67
|
declare function noticeLifetimeMs(tone: NoticeStackTone | "error"): number;
|
|
58
68
|
|
|
59
|
-
export { NOTICE_STACK, collapseNotices, noticeKey, noticeLifetimeMs, visibleNotices };
|
|
69
|
+
export { NOTICE_STACK, NOTICE_TEXT_BUDGET, collapseNotices, noticeKey, noticeLifetimeMs, visibleNotices };
|
|
60
70
|
export type { CollapsedNotice, NoticeStackTone };
|
package/dist/notice-stack.d.ts
CHANGED
|
@@ -32,6 +32,16 @@ declare const NOTICE_STACK: {
|
|
|
32
32
|
/** The card's width: small, never the window's. */
|
|
33
33
|
readonly widthRem: 22;
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* How much a card can SAY with nothing cut by "…" at the smallest window (900 × 560, Matrx 2 Cloud
|
|
37
|
+
* Chat: the card is 324 px wide over the viewer, and an action such as Retry shares the row, leaving
|
|
38
|
+
* ~180 px of text): the title is one line, the line under it at most two short ones. Measured
|
|
39
|
+
* 2026-10-24 ("Your change was not saved …" / "Check the connection and tr…"). In-app text is layout.
|
|
40
|
+
*/
|
|
41
|
+
declare const NOTICE_TEXT_BUDGET: {
|
|
42
|
+
readonly titleChars: 24;
|
|
43
|
+
readonly lineChars: 40;
|
|
44
|
+
};
|
|
35
45
|
type NoticeStackTone = "neutral" | "info" | "warning" | "danger" | "success";
|
|
36
46
|
/** The identity two notices share when they say the same thing (tone, title, line). */
|
|
37
47
|
declare function noticeKey(tone: string, title: unknown, message?: unknown): string;
|
|
@@ -56,5 +66,5 @@ declare function visibleNotices<T>(groups: readonly T[], max?: number): {
|
|
|
56
66
|
/** How long a notice of this tone stays (ms; Infinity never happens: errors cap at errorMs). */
|
|
57
67
|
declare function noticeLifetimeMs(tone: NoticeStackTone | "error"): number;
|
|
58
68
|
|
|
59
|
-
export { NOTICE_STACK, collapseNotices, noticeKey, noticeLifetimeMs, visibleNotices };
|
|
69
|
+
export { NOTICE_STACK, NOTICE_TEXT_BUDGET, collapseNotices, noticeKey, noticeLifetimeMs, visibleNotices };
|
|
60
70
|
export type { CollapsedNotice, NoticeStackTone };
|
package/dist/notice-stack.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import {
|
|
3
3
|
NOTICE_STACK,
|
|
4
|
+
NOTICE_TEXT_BUDGET,
|
|
4
5
|
collapseNotices,
|
|
5
6
|
noticeKey,
|
|
6
7
|
noticeLifetimeMs,
|
|
7
8
|
visibleNotices
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BB5LA7FQ.js";
|
|
9
10
|
export {
|
|
10
11
|
NOTICE_STACK,
|
|
12
|
+
NOTICE_TEXT_BUDGET,
|
|
11
13
|
collapseNotices,
|
|
12
14
|
noticeKey,
|
|
13
15
|
noticeLifetimeMs,
|
package/dist/record-list.cjs
CHANGED
|
@@ -340,6 +340,16 @@ function errorSentenceOf(error) {
|
|
|
340
340
|
}
|
|
341
341
|
var TIMED_OUT_SENTENCE = "That took too long. Nothing was lost; try again.";
|
|
342
342
|
var FALLBACK_ERROR_SENTENCE = "Something went wrong. Try again.";
|
|
343
|
+
var CARD_ERROR_LINE = {
|
|
344
|
+
OFFLINE: "No connection",
|
|
345
|
+
TIMEOUT: "Took too long. Nothing was lost.",
|
|
346
|
+
UNAUTHORIZED: "Signed out. Sign in again.",
|
|
347
|
+
FORBIDDEN: "Not allowed for this account",
|
|
348
|
+
NOT_FOUND: "Not found. Refresh and retry.",
|
|
349
|
+
RATE_LIMIT: "Too many requests. Wait a moment.",
|
|
350
|
+
SERVER: "Server problem. Try again soon.",
|
|
351
|
+
FALLBACK: "Something went wrong"
|
|
352
|
+
};
|
|
343
353
|
function isTimedOutError(error, message, code) {
|
|
344
354
|
if (code === "57014" || code === "timed_out") return true;
|
|
345
355
|
if (error && typeof error === "object") {
|
|
@@ -357,8 +367,9 @@ var ANY_HOST_CODES = /* @__PURE__ */ new Set(["OFFLINE", "TIMEOUT", "UNAUTHORIZE
|
|
|
357
367
|
var MACHINE_PREFIX = /^\s*(?:\[[\w./-]+\]\s*|[a-z][\w]*(?:[._][\w]+)+:\s+)/;
|
|
358
368
|
var RAW_TEXT = /\b(?:Type|Reference|Syntax|Range|Internal|Eval|URI)Error\b|\bat\s+[\w$.<>]+\s*\(|\.(?:[cm]?[jt]sx?|py):\d+|(?:^|[\s(])(?:\/[\w.@-]+){2,}|\bundefined is not\b|\bcannot read propert(?:y|ies)\b|\bis not a function\b|\bunexpected token\b/i;
|
|
359
369
|
function peopleErrorSentence(error, message, options = {}) {
|
|
360
|
-
|
|
361
|
-
|
|
370
|
+
const card = options.card === true;
|
|
371
|
+
if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;
|
|
372
|
+
const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);
|
|
362
373
|
const raw = message?.trim() || errorSentenceOf(error).trim();
|
|
363
374
|
if (!raw) return fallback;
|
|
364
375
|
let text = raw;
|
|
@@ -366,7 +377,8 @@ function peopleErrorSentence(error, message, options = {}) {
|
|
|
366
377
|
if (!text) return fallback;
|
|
367
378
|
if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {
|
|
368
379
|
const said = describeError(text, fallback);
|
|
369
|
-
|
|
380
|
+
if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;
|
|
381
|
+
return card ? CARD_ERROR_LINE[said.code] : said.cause;
|
|
370
382
|
}
|
|
371
383
|
return text;
|
|
372
384
|
}
|
|
@@ -1035,7 +1047,7 @@ var DropdownMenuSubTrigger = React7.forwardRef(({ className, inset, children, ..
|
|
|
1035
1047
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
1036
1048
|
var DropdownMenuSubContent = React7.forwardRef(({ className, container, surface = "default", sideOffset = 2, alignOffset = -4, collisionPadding, onFocusOutside, children, ...props }, ref) => {
|
|
1037
1049
|
const portalContainer = usePortalContainer(container);
|
|
1038
|
-
const [bottomClearance] = React7.useState(
|
|
1050
|
+
const [bottomClearance] = React7.useState(sharedBottomClearance);
|
|
1039
1051
|
const padding = menuCollisionPadding(collisionPadding ?? 8, 0, bottomClearance);
|
|
1040
1052
|
const nested = useNestedSubmenuPlacement(ref, padding);
|
|
1041
1053
|
const keep = useSubmenuSurvivesParentPanelFocus(nested.ref, onFocusOutside);
|
|
@@ -1057,18 +1069,27 @@ var DropdownMenuSubContent = React7.forwardRef(({ className, container, surface
|
|
|
1057
1069
|
) });
|
|
1058
1070
|
});
|
|
1059
1071
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
1060
|
-
function readTopClearance() {
|
|
1061
|
-
return readClearance("var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))");
|
|
1062
|
-
}
|
|
1063
|
-
function readBottomClearance() {
|
|
1064
|
-
return readClearance("var(--matrx-floating-clearance, 0px)");
|
|
1065
|
-
}
|
|
1066
1072
|
function menuCollisionPadding(caller, top, bottom, fallback = 0) {
|
|
1067
1073
|
const side = (key) => typeof caller === "number" ? caller : caller?.[key] ?? fallback;
|
|
1068
1074
|
return { top: Math.max(side("top"), top), right: side("right"), bottom: Math.max(side("bottom"), bottom), left: side("left") };
|
|
1069
1075
|
}
|
|
1070
|
-
|
|
1076
|
+
var CLEARANCE_REUSE_MS = 500;
|
|
1077
|
+
var clearanceCache = /* @__PURE__ */ new Map();
|
|
1078
|
+
var clock = () => typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
1079
|
+
function readClearance(height, shared = false) {
|
|
1071
1080
|
if (typeof document === "undefined") return 0;
|
|
1081
|
+
const now = clock();
|
|
1082
|
+
const held = shared ? clearanceCache.get(height) : void 0;
|
|
1083
|
+
if (held && now - held.at < CLEARANCE_REUSE_MS) return held.px;
|
|
1084
|
+
const px = measureClearance(height);
|
|
1085
|
+
clearanceCache.set(height, { px, at: now });
|
|
1086
|
+
return px;
|
|
1087
|
+
}
|
|
1088
|
+
var TOP_CLEARANCE = "var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))";
|
|
1089
|
+
var BOTTOM_CLEARANCE = "var(--matrx-floating-clearance, 0px)";
|
|
1090
|
+
var sharedTopClearance = () => readClearance(TOP_CLEARANCE, true);
|
|
1091
|
+
var sharedBottomClearance = () => readClearance(BOTTOM_CLEARANCE, true);
|
|
1092
|
+
function measureClearance(height) {
|
|
1072
1093
|
const probe = document.createElement("div");
|
|
1073
1094
|
probe.style.cssText = `position:fixed;top:0;left:0;width:0;visibility:hidden;pointer-events:none;height:${height}`;
|
|
1074
1095
|
document.body.appendChild(probe);
|
|
@@ -1078,8 +1099,8 @@ function readClearance(height) {
|
|
|
1078
1099
|
}
|
|
1079
1100
|
var DropdownMenuContent = React7.forwardRef(({ className, sideOffset = 4, container, surface = "default", children, onCloseAutoFocus, collisionPadding, ...props }, ref) => {
|
|
1080
1101
|
const portalContainer = usePortalContainer(container);
|
|
1081
|
-
const [topClearance] = React7.useState(
|
|
1082
|
-
const [bottomClearance] = React7.useState(
|
|
1102
|
+
const [topClearance] = React7.useState(sharedTopClearance);
|
|
1103
|
+
const [bottomClearance] = React7.useState(sharedBottomClearance);
|
|
1083
1104
|
const edges = useMenuScrollEdges(ref);
|
|
1084
1105
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1085
1106
|
DropdownMenuPrimitive.Content,
|