@ai-matrx/design-system 0.86.357 → 0.86.359

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +30 -2
  2. package/dist/carousel.js +6 -6
  3. package/dist/{chunk-T4D7WAV7.js → chunk-42GFQMLA.js} +2 -2
  4. package/dist/{chunk-POJ3RR3K.js → chunk-B5D3VIMC.js} +1 -1
  5. package/dist/{chunk-POJ3RR3K.js.map → chunk-B5D3VIMC.js.map} +1 -1
  6. package/dist/{chunk-FRJ4PPA2.js → chunk-CZGZV35G.js} +2 -2
  7. package/dist/{chunk-ACZALXD6.js → chunk-K3XWUACX.js} +3 -3
  8. package/dist/{chunk-TV2IDHPZ.js → chunk-K5ZQROWN.js} +4 -4
  9. package/dist/{chunk-U46XUQI7.js → chunk-KSCSH7AO.js} +16 -14
  10. package/dist/chunk-KSCSH7AO.js.map +1 -0
  11. package/dist/{chunk-MTE6N7XU.js → chunk-NFJ63LIH.js} +2 -2
  12. package/dist/{chunk-XZGYKKCE.js → chunk-OUQT72UL.js} +3 -3
  13. package/dist/{chunk-WUD23YTG.js → chunk-P56Y43RL.js} +6 -6
  14. package/dist/{chunk-GMNROZQJ.js → chunk-QTPW44IJ.js} +2 -2
  15. package/dist/{chunk-QA7EHFRX.js → chunk-T3FKFPCW.js} +5 -5
  16. package/dist/{chunk-X6ZRHJQP.js → chunk-T57DLONB.js} +20 -11
  17. package/dist/chunk-T57DLONB.js.map +1 -0
  18. package/dist/{chunk-SOCNWQMX.js → chunk-TEMAM5ET.js} +3 -3
  19. package/dist/{chunk-CH2NWSES.js → chunk-TIV6M7Q7.js} +3 -3
  20. package/dist/{chunk-6XNYYROM.js → chunk-WVEDW5VO.js} +2 -2
  21. package/dist/clipboard-fallback-dialog.js +2 -2
  22. package/dist/controls.cjs +19 -10
  23. package/dist/controls.cjs.map +1 -1
  24. package/dist/controls.js +6 -6
  25. package/dist/data-table/data-row-inspector.cjs +99 -11
  26. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  27. package/dist/data-table/data-row-inspector.js +8 -7
  28. package/dist/data-table/data-row-window.cjs +99 -11
  29. package/dist/data-table/data-row-window.cjs.map +1 -1
  30. package/dist/data-table/data-row-window.js +9 -8
  31. package/dist/data-table/drill-chart.js +1 -1
  32. package/dist/data-table/host.cjs.map +1 -1
  33. package/dist/data-table/host.d.cts +6 -2
  34. package/dist/data-table/host.d.ts +6 -2
  35. package/dist/data-table/host.js +1 -1
  36. package/dist/data-table/index.cjs +39 -37
  37. package/dist/data-table/index.cjs.map +1 -1
  38. package/dist/data-table/index.d.cts +6 -2
  39. package/dist/data-table/index.d.ts +6 -2
  40. package/dist/data-table/index.js +19 -23
  41. package/dist/data-table/index.js.map +1 -1
  42. package/dist/data-table/pagination.cjs +19 -10
  43. package/dist/data-table/pagination.cjs.map +1 -1
  44. package/dist/data-table/pagination.js +4 -4
  45. package/dist/data-table/uuid-cell.cjs +99 -11
  46. package/dist/data-table/uuid-cell.cjs.map +1 -1
  47. package/dist/data-table/uuid-cell.js +5 -4
  48. package/dist/desktop.cjs +20 -11
  49. package/dist/desktop.cjs.map +1 -1
  50. package/dist/desktop.d.cts +1 -1
  51. package/dist/desktop.d.ts +1 -1
  52. package/dist/desktop.js +13 -13
  53. package/dist/desktop.js.map +1 -1
  54. package/dist/email-input-dialog.js +1 -1
  55. package/dist/index.cjs +31 -22
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.cts +9 -9
  58. package/dist/index.d.ts +9 -9
  59. package/dist/index.js +20 -20
  60. package/dist/item.cjs +19 -10
  61. package/dist/item.cjs.map +1 -1
  62. package/dist/item.js +5 -5
  63. package/dist/lite-table.js +3 -3
  64. package/dist/menu-look.cjs +19 -10
  65. package/dist/menu-look.cjs.map +1 -1
  66. package/dist/menu-look.js +2 -2
  67. package/dist/record-list.cjs +19 -10
  68. package/dist/record-list.cjs.map +1 -1
  69. package/dist/record-list.js +6 -6
  70. package/dist/settings.js +3 -3
  71. package/dist/swipe-deck.cjs +11 -2
  72. package/dist/swipe-deck.cjs.map +1 -1
  73. package/dist/swipe-deck.js +12 -3
  74. package/dist/swipe-deck.js.map +1 -1
  75. package/dist/text-input-dialog.js +1 -1
  76. package/dist/writing-field.js +3 -3
  77. package/package.json +2 -2
  78. package/dist/chunk-U46XUQI7.js.map +0 -1
  79. package/dist/chunk-X6ZRHJQP.js.map +0 -1
  80. /package/dist/{chunk-T4D7WAV7.js.map → chunk-42GFQMLA.js.map} +0 -0
  81. /package/dist/{chunk-FRJ4PPA2.js.map → chunk-CZGZV35G.js.map} +0 -0
  82. /package/dist/{chunk-ACZALXD6.js.map → chunk-K3XWUACX.js.map} +0 -0
  83. /package/dist/{chunk-TV2IDHPZ.js.map → chunk-K5ZQROWN.js.map} +0 -0
  84. /package/dist/{chunk-MTE6N7XU.js.map → chunk-NFJ63LIH.js.map} +0 -0
  85. /package/dist/{chunk-XZGYKKCE.js.map → chunk-OUQT72UL.js.map} +0 -0
  86. /package/dist/{chunk-WUD23YTG.js.map → chunk-P56Y43RL.js.map} +0 -0
  87. /package/dist/{chunk-GMNROZQJ.js.map → chunk-QTPW44IJ.js.map} +0 -0
  88. /package/dist/{chunk-QA7EHFRX.js.map → chunk-T3FKFPCW.js.map} +0 -0
  89. /package/dist/{chunk-SOCNWQMX.js.map → chunk-TEMAM5ET.js.map} +0 -0
  90. /package/dist/{chunk-CH2NWSES.js.map → chunk-TIV6M7Q7.js.map} +0 -0
  91. /package/dist/{chunk-6XNYYROM.js.map → chunk-WVEDW5VO.js.map} +0 -0
package/dist/controls.js CHANGED
@@ -73,7 +73,7 @@ import {
73
73
  spansOf,
74
74
  splitForMiddleTruncate,
75
75
  stageStates
76
- } from "./chunk-ACZALXD6.js";
76
+ } from "./chunk-K3XWUACX.js";
77
77
  import "./chunk-6NOLVA4E.js";
78
78
  import {
79
79
  Input,
@@ -98,10 +98,9 @@ import {
98
98
  RowGroup,
99
99
  SettingRow,
100
100
  Tile
101
- } from "./chunk-GMNROZQJ.js";
101
+ } from "./chunk-QTPW44IJ.js";
102
102
  import "./chunk-K4XCB576.js";
103
103
  import "./chunk-5Z5GTXKL.js";
104
- import "./chunk-HS6GMHKZ.js";
105
104
  import "./chunk-DRSBLHOF.js";
106
105
  import "./chunk-TH6DDCWF.js";
107
106
  import "./chunk-2BQAHLU3.js";
@@ -120,7 +119,7 @@ import {
120
119
  StatusToken,
121
120
  isCollectedValue,
122
121
  valueSummary
123
- } from "./chunk-MTE6N7XU.js";
122
+ } from "./chunk-NFJ63LIH.js";
124
123
  import "./chunk-WFBPCMPF.js";
125
124
  import "./chunk-OPF265PU.js";
126
125
  import {
@@ -142,13 +141,14 @@ import {
142
141
  Switch,
143
142
  Tabs,
144
143
  Textarea
145
- } from "./chunk-6XNYYROM.js";
144
+ } from "./chunk-WVEDW5VO.js";
146
145
  import "./chunk-BD77DHUO.js";
147
146
  import "./chunk-BKCJUFD3.js";
148
147
  import "./chunk-PIQJULQB.js";
149
148
  import "./chunk-MOZRIHJF.js";
150
- import "./chunk-X6ZRHJQP.js";
149
+ import "./chunk-T57DLONB.js";
151
150
  import "./chunk-BNXNIN2S.js";
151
+ import "./chunk-HS6GMHKZ.js";
152
152
  import "./chunk-WFITMVDB.js";
153
153
  import "./chunk-WAT2XW7L.js";
154
154
  import "./chunk-7IOSA55D.js";
@@ -1541,13 +1541,14 @@ function useTableNotice() {
1541
1541
  const [message, setMessage] = (0, import_react3.useState)(null);
1542
1542
  const notify = (0, import_react3.useMemo)(
1543
1543
  () => ({
1544
- success(text) {
1545
- if (host.notify) host.notify.success(text);
1546
- else setMessage({ text, error: false });
1544
+ // A card is a short title and an optional line (NOTICE_TEXT_BUDGET); the inline fallback joins them.
1545
+ success(text, options) {
1546
+ if (host.notify) host.notify.success(text, options);
1547
+ else setMessage({ text: options?.description ? `${text}. ${options.description}` : text, error: false });
1547
1548
  },
1548
- error(text) {
1549
- if (host.notify) host.notify.error(text);
1550
- else setMessage({ text, error: true });
1549
+ error(text, options) {
1550
+ if (host.notify) host.notify.error(text, options);
1551
+ else setMessage({ text: options?.description ? `${text}. ${options.description}` : text, error: true });
1551
1552
  }
1552
1553
  }),
1553
1554
  [host]
@@ -1576,6 +1577,95 @@ function displayId(id, show = "auto") {
1576
1577
  return id;
1577
1578
  }
1578
1579
 
1580
+ // src/desktop/errors.ts
1581
+ var RULES = [
1582
+ { code: "ENOENT", test: /\b(spawn\s+\S+\s+)?ENOENT\b|command not found|no such file or directory/i, cause: "A program or file it needs isn't on this computer. Install it or update Matrx, then try again." },
1583
+ { code: "EACCES", test: /\bEACCES\b|\bEPERM\b|permission denied|operation not permitted|not authori[sz]ed by the user/i, cause: "Matrx isn't allowed to do that. Grant access in System Settings \u203A Privacy & Security, then try again." },
1584
+ { code: "EADDRINUSE", test: /\bEADDRINUSE\b|address already in use|port .* (is )?(already )?in use/i, cause: "Another program is already using that port. Stop it, or choose another port." },
1585
+ { code: "ECONNREFUSED", test: /\bECONNREFUSED\b|connection refused/i, cause: "The service isn't answering. It may have stopped; start it again." },
1586
+ { code: "OFFLINE", test: /\bENOTFOUND\b|\bEAI_AGAIN\b|\bENETUNREACH\b|getaddrinfo|network (is )?unreachable|failed to fetch|offline/i, cause: "Can't reach the internet. Check the connection and try again." },
1587
+ { code: "TIMEOUT", test: /\bETIMEDOUT\b|timed? ?out|\bTIMEOUT\b|deadline exceeded/i, cause: "It took too long to answer. Try again in a moment." },
1588
+ { code: "ENOSPC", test: /\bENOSPC\b|no space left/i, cause: "The disk is full. Free some space, then try again." },
1589
+ { code: "ENOMEM", test: /\bENOMEM\b|out of memory|cannot allocate memory/i, cause: "The computer ran out of memory. Close something and try again." },
1590
+ { code: "UNAUTHORIZED", test: /\b401\b|unauthori[sz]ed|invalid (api )?key|not signed in|jwt expired|session expired/i, cause: "You're signed out, or the key was refused. Sign in again." },
1591
+ { code: "FORBIDDEN", test: /\b403\b|forbidden/i, cause: "This account isn't allowed to do that." },
1592
+ { code: "NOT_FOUND", test: /\b404\b|not found/i, cause: "It isn't there any more. Refresh and try again." },
1593
+ { code: "RATE_LIMIT", test: /\b429\b|rate.?limit|too many requests/i, cause: "Too many requests just now. Wait a moment and try again." },
1594
+ { code: "SERVER", test: /\b5\d\d\b|internal server error|bad gateway|service unavailable/i, cause: "The server had a problem. Try again in a moment." },
1595
+ { code: "EXITED", test: /exited with code|process exited|crashed|SIGKILL|SIGSEGV|SIGTERM/i, cause: "The service stopped unexpectedly. Start it again; Copy details if it keeps happening." }
1596
+ ];
1597
+ var RAW = /\b[A-Z]{2,}[A-Z_]*\b|[\\/][\w.-]+[\\/]|\bat \S+ \(|\{|\}|errno|stack|undefined|null|\bspawn\b/;
1598
+ function rawText(error) {
1599
+ if (error instanceof Error) return error.message || error.name;
1600
+ if (typeof error === "string") return error;
1601
+ if (error && typeof error === "object" && "message" in error && typeof error.message === "string") {
1602
+ return error.message;
1603
+ }
1604
+ return "";
1605
+ }
1606
+ function describeError(error, fallback = "Something went wrong. Try again.") {
1607
+ const detail = rawText(error).trim();
1608
+ if (!detail) return { cause: fallback, detail: "" };
1609
+ for (const rule of RULES) {
1610
+ if (rule.test.test(detail)) return { cause: rule.cause, detail, code: rule.code };
1611
+ }
1612
+ if (!RAW.test(detail) && detail.length <= 160) return { cause: detail, detail: "" };
1613
+ return { cause: fallback, detail };
1614
+ }
1615
+
1616
+ // src/error-sentence.ts
1617
+ function errorSentenceOf(error) {
1618
+ if (error == null || error === true || error === false) return "";
1619
+ if (typeof error === "string") return error;
1620
+ if (typeof error !== "object") return String(error);
1621
+ const message = error.message;
1622
+ return typeof message === "string" ? message : "";
1623
+ }
1624
+ var TIMED_OUT_SENTENCE = "That took too long. Nothing was lost; try again.";
1625
+ var FALLBACK_ERROR_SENTENCE = "Something went wrong. Try again.";
1626
+ var CARD_ERROR_LINE = {
1627
+ OFFLINE: "No connection",
1628
+ TIMEOUT: "Took too long. Nothing was lost.",
1629
+ UNAUTHORIZED: "Signed out. Sign in again.",
1630
+ FORBIDDEN: "Not allowed for this account",
1631
+ NOT_FOUND: "Not found. Refresh and retry.",
1632
+ RATE_LIMIT: "Too many requests. Wait a moment.",
1633
+ SERVER: "Server problem. Try again soon.",
1634
+ FALLBACK: "Something went wrong"
1635
+ };
1636
+ function isTimedOutError(error, message, code) {
1637
+ if (code === "57014" || code === "timed_out") return true;
1638
+ if (error && typeof error === "object") {
1639
+ const o = error;
1640
+ if (o.code === "57014" || o.code === "timed_out" || o.sqlstate === "57014") return true;
1641
+ }
1642
+ const text = `${message ?? ""} ${errorSentenceOf(error)}`;
1643
+ return /canceling statement due to statement timeout/i.test(text);
1644
+ }
1645
+ function offlineText(text) {
1646
+ const t = text.trim();
1647
+ return t !== "" && (describeError(t).code === "OFFLINE" || /networkerror|network request failed|load failed/i.test(t));
1648
+ }
1649
+ var ANY_HOST_CODES = /* @__PURE__ */ new Set(["OFFLINE", "TIMEOUT", "UNAUTHORIZED", "FORBIDDEN", "NOT_FOUND", "RATE_LIMIT", "SERVER"]);
1650
+ var MACHINE_PREFIX = /^\s*(?:\[[\w./-]+\]\s*|[a-z][\w]*(?:[._][\w]+)+:\s+)/;
1651
+ 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;
1652
+ function peopleErrorSentence(error, message, options = {}) {
1653
+ const card = options.card === true;
1654
+ if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;
1655
+ const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);
1656
+ const raw = message?.trim() || errorSentenceOf(error).trim();
1657
+ if (!raw) return fallback;
1658
+ let text = raw;
1659
+ for (let i = 0; i < 3 && MACHINE_PREFIX.test(text); i++) text = text.replace(MACHINE_PREFIX, "").trim();
1660
+ if (!text) return fallback;
1661
+ if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {
1662
+ const said = describeError(text, fallback);
1663
+ if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;
1664
+ return card ? CARD_ERROR_LINE[said.code] : said.cause;
1665
+ }
1666
+ return text;
1667
+ }
1668
+
1579
1669
  // src/record-id.tsx
1580
1670
  var import_jsx_runtime13 = require("react/jsx-runtime");
1581
1671
  function RecordId({
@@ -1637,7 +1727,7 @@ function RecordId({
1637
1727
  e.preventDefault();
1638
1728
  void (0, import_clipboard.copyText)(value).then((ok) => {
1639
1729
  if (!ok) {
1640
- notify?.error(`Couldn't copy ${copyLabel}`);
1730
+ notify?.error("Not copied", { description: copyLabel });
1641
1731
  return;
1642
1732
  }
1643
1733
  setCopied(true);
@@ -1653,12 +1743,10 @@ function RecordId({
1653
1743
  try {
1654
1744
  const result = await onOpen(value);
1655
1745
  if (result === "forbidden") {
1656
- notify?.error("You don't have access to open this record");
1746
+ notify?.error("No access", { description: "This account can't open this record" });
1657
1747
  }
1658
1748
  } catch (err) {
1659
- notify?.error(
1660
- `Couldn't open: ${err instanceof Error ? err.message : String(err)}`
1661
- );
1749
+ notify?.error("Not opened", { description: peopleErrorSentence(err, null, { card: true }) });
1662
1750
  } finally {
1663
1751
  setOpening(false);
1664
1752
  }