@ai-matrx/design-system 0.86.356 → 0.86.357

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 (82) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/auth-gate-dialog.js +2 -2
  3. package/dist/carousel.js +7 -6
  4. package/dist/carousel.js.map +1 -1
  5. package/dist/{chunk-UWTODOMD.js → chunk-2BQAHLU3.js} +4 -4
  6. package/dist/chunk-5Z5GTXKL.js +79 -0
  7. package/dist/chunk-5Z5GTXKL.js.map +1 -0
  8. package/dist/{chunk-2PO3N42Q.js → chunk-ACZALXD6.js} +3 -3
  9. package/dist/{chunk-4WSXAP24.js → chunk-BB5LA7FQ.js} +3 -1
  10. package/dist/chunk-BB5LA7FQ.js.map +1 -0
  11. package/dist/{chunk-RLM4RSED.js → chunk-GUGBVQ4T.js} +6 -4
  12. package/dist/{chunk-RLM4RSED.js.map → chunk-GUGBVQ4T.js.map} +1 -1
  13. package/dist/{chunk-LJKF267O.js → chunk-HS6GMHKZ.js} +18 -76
  14. package/dist/chunk-HS6GMHKZ.js.map +1 -0
  15. package/dist/{chunk-ZMUPFGQO.js → chunk-TV2IDHPZ.js} +2 -2
  16. package/dist/{chunk-CFUXEGW2.js → chunk-XZGYKKCE.js} +2 -2
  17. package/dist/clipboard-fallback-dialog.js +2 -2
  18. package/dist/controls.cjs +15 -3
  19. package/dist/controls.cjs.map +1 -1
  20. package/dist/controls.js +5 -4
  21. package/dist/data-table/data-row-window.js +3 -3
  22. package/dist/data-table/drill-chart.cjs +15 -3
  23. package/dist/data-table/drill-chart.cjs.map +1 -1
  24. package/dist/data-table/drill-chart.js +2 -1
  25. package/dist/data-table/drill-chart.js.map +1 -1
  26. package/dist/data-table/index.cjs +15 -3
  27. package/dist/data-table/index.cjs.map +1 -1
  28. package/dist/data-table/index.js +8 -7
  29. package/dist/data-table/index.js.map +1 -1
  30. package/dist/desktop.cjs +26 -5
  31. package/dist/desktop.cjs.map +1 -1
  32. package/dist/desktop.js +15 -7
  33. package/dist/desktop.js.map +1 -1
  34. package/dist/email-input-dialog.cjs +15 -3
  35. package/dist/email-input-dialog.cjs.map +1 -1
  36. package/dist/email-input-dialog.js +4 -3
  37. package/dist/email-input-dialog.js.map +1 -1
  38. package/dist/error-sentence.cjs +130 -0
  39. package/dist/error-sentence.cjs.map +1 -0
  40. package/dist/error-sentence.d.cts +49 -0
  41. package/dist/error-sentence.d.ts +49 -0
  42. package/dist/error-sentence.js +22 -0
  43. package/dist/error-sentence.js.map +1 -0
  44. package/dist/index.cjs +16 -4
  45. package/dist/index.cjs.map +1 -1
  46. package/dist/index.d.cts +3 -1
  47. package/dist/index.d.ts +3 -1
  48. package/dist/index.js +17 -15
  49. package/dist/index.js.map +1 -1
  50. package/dist/item.js +2 -2
  51. package/dist/lite-table.cjs +15 -3
  52. package/dist/lite-table.cjs.map +1 -1
  53. package/dist/lite-table.js +3 -2
  54. package/dist/lite-table.js.map +1 -1
  55. package/dist/notice-stack.cjs +2 -0
  56. package/dist/notice-stack.cjs.map +1 -1
  57. package/dist/notice-stack.d.cts +11 -1
  58. package/dist/notice-stack.d.ts +11 -1
  59. package/dist/notice-stack.js +3 -1
  60. package/dist/record-list.cjs +15 -3
  61. package/dist/record-list.cjs.map +1 -1
  62. package/dist/record-list.js +3 -2
  63. package/dist/record-list.js.map +1 -1
  64. package/dist/sandbox-gate-dialog.js +2 -2
  65. package/dist/scope-mismatch-dialog.js +2 -2
  66. package/dist/swipe-deck.cjs +15 -3
  67. package/dist/swipe-deck.cjs.map +1 -1
  68. package/dist/swipe-deck.js +2 -1
  69. package/dist/swipe-deck.js.map +1 -1
  70. package/dist/text-input-dialog.cjs +15 -3
  71. package/dist/text-input-dialog.cjs.map +1 -1
  72. package/dist/text-input-dialog.js +4 -3
  73. package/dist/text-input-dialog.js.map +1 -1
  74. package/dist/value-prompts-dialog.js +2 -2
  75. package/dist/writing-field.js +2 -2
  76. package/package.json +12 -2
  77. package/dist/chunk-4WSXAP24.js.map +0 -1
  78. package/dist/chunk-LJKF267O.js.map +0 -1
  79. /package/dist/{chunk-UWTODOMD.js.map → chunk-2BQAHLU3.js.map} +0 -0
  80. /package/dist/{chunk-2PO3N42Q.js.map → chunk-ACZALXD6.js.map} +0 -0
  81. /package/dist/{chunk-ZMUPFGQO.js.map → chunk-TV2IDHPZ.js.map} +0 -0
  82. /package/dist/{chunk-CFUXEGW2.js.map → chunk-XZGYKKCE.js.map} +0 -0
@@ -46,6 +46,16 @@ function errorSentenceOf(error) {
46
46
  }
47
47
  var TIMED_OUT_SENTENCE = "That took too long. Nothing was lost; try again.";
48
48
  var FALLBACK_ERROR_SENTENCE = "Something went wrong. Try again.";
49
+ var CARD_ERROR_LINE = {
50
+ OFFLINE: "No connection",
51
+ TIMEOUT: "Took too long. Nothing was lost.",
52
+ UNAUTHORIZED: "Signed out. Sign in again.",
53
+ FORBIDDEN: "Not allowed for this account",
54
+ NOT_FOUND: "Not found. Refresh and retry.",
55
+ RATE_LIMIT: "Too many requests. Wait a moment.",
56
+ SERVER: "Server problem. Try again soon.",
57
+ FALLBACK: "Something went wrong"
58
+ };
49
59
  function isTimedOutError(error, message, code) {
50
60
  if (code === "57014" || code === "timed_out") return true;
51
61
  if (error && typeof error === "object") {
@@ -70,8 +80,9 @@ function isRawErrorText(text) {
70
80
  return MACHINE_PREFIX.test(text) || RAW_TEXT.test(text);
71
81
  }
72
82
  function peopleErrorSentence(error, message, options = {}) {
73
- if (isTimedOutError(error, message, options.code)) return TIMED_OUT_SENTENCE;
74
- const fallback = options.fallback ?? FALLBACK_ERROR_SENTENCE;
83
+ const card = options.card === true;
84
+ if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;
85
+ const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);
75
86
  const raw = message?.trim() || errorSentenceOf(error).trim();
76
87
  if (!raw) return fallback;
77
88
  let text = raw;
@@ -79,90 +90,21 @@ function peopleErrorSentence(error, message, options = {}) {
79
90
  if (!text) return fallback;
80
91
  if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {
81
92
  const said = describeError(text, fallback);
82
- return said.code && ANY_HOST_CODES.has(said.code) ? said.cause : fallback;
93
+ if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;
94
+ return card ? CARD_ERROR_LINE[said.code] : said.cause;
83
95
  }
84
96
  return text;
85
97
  }
86
98
 
87
- // src/error-box.tsx
88
- import * as React from "react";
89
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
90
- var CONTEXT_KEY = /* @__PURE__ */ Symbol.for("@ai-matrx/design-system/error-actions");
91
- var registry = globalThis;
92
- var ErrorActionsContext = registry[CONTEXT_KEY] ?? (registry[CONTEXT_KEY] = React.createContext(null));
93
- function ErrorActionsProvider({
94
- render,
95
- children
96
- }) {
97
- return /* @__PURE__ */ jsx(ErrorActionsContext.Provider, { value: render, children });
98
- }
99
- var MENUS_KEY = /* @__PURE__ */ Symbol.for("@ai-matrx/design-system/error-card-menus");
100
- var menusRegistry = globalThis;
101
- var ErrorCardMenusContext = menusRegistry[MENUS_KEY] ?? (menusRegistry[MENUS_KEY] = React.createContext(null));
102
- function ErrorCardMenusProvider({
103
- menus,
104
- children
105
- }) {
106
- return /* @__PURE__ */ jsx(ErrorCardMenusContext.Provider, { value: menus, children });
107
- }
108
- function useErrorCardMenus() {
109
- return React.useContext(ErrorCardMenusContext);
110
- }
111
- function useErrorActions() {
112
- return React.useContext(ErrorActionsContext);
113
- }
114
- function ErrorActions(props) {
115
- const render = useErrorActions();
116
- if (!render) return null;
117
- return /* @__PURE__ */ jsx(Fragment, { children: render(props) });
118
- }
119
- function sayable(body, error) {
120
- if (typeof body === "string") return peopleErrorSentence(error, body);
121
- if (Array.isArray(body)) return body.map((b) => typeof b === "string" && b.trim() ? peopleErrorSentence(error, b) : b);
122
- return body;
123
- }
124
- var ErrorBox = React.forwardRef(function ErrorBox2({
125
- as = "p",
126
- message,
127
- title,
128
- error,
129
- operation,
130
- records,
131
- unsavedInput,
132
- origin,
133
- children,
134
- ...rest
135
- }, ref) {
136
- const Tag = as;
137
- const facts = {
138
- ...message !== void 0 ? { message } : {},
139
- ...title !== void 0 ? { title } : {},
140
- ...error !== void 0 ? { error } : {},
141
- ...operation !== void 0 ? { operation } : {},
142
- ...records !== void 0 ? { records } : {},
143
- ...unsavedInput !== void 0 ? { unsavedInput } : {},
144
- ...origin !== void 0 ? { origin } : {}
145
- };
146
- return /* @__PURE__ */ jsxs(Tag, { ref, role: "alert", "data-error-box": "", ...rest, children: [
147
- sayable(children ?? message, error),
148
- /* @__PURE__ */ jsx(ErrorActions, { ...facts })
149
- ] });
150
- });
151
-
152
99
  export {
153
100
  describeError,
154
101
  errorSentenceOf,
155
102
  TIMED_OUT_SENTENCE,
156
103
  FALLBACK_ERROR_SENTENCE,
104
+ CARD_ERROR_LINE,
157
105
  isTimedOutError,
158
106
  isOfflineError,
159
107
  isRawErrorText,
160
- peopleErrorSentence,
161
- ErrorActionsProvider,
162
- ErrorCardMenusProvider,
163
- useErrorCardMenus,
164
- useErrorActions,
165
- ErrorActions,
166
- ErrorBox
108
+ peopleErrorSentence
167
109
  };
168
- //# sourceMappingURL=chunk-LJKF267O.js.map
110
+ //# sourceMappingURL=chunk-HS6GMHKZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/desktop/errors.ts","../src/error-sentence.ts"],"sourcesContent":["/**\n * THE error-wording layer. A failure is shown as a cause the person can act on (\"A program it\n * needs isn't installed\"), never as the raw text a process threw (\"spawn uv ENOENT\"). The raw text\n * is kept, whole, as `detail` — the banner offers it behind Copy details and a tooltip, for a bug\n * report or an agent. One table, so every screen and every service says the same thing.\n */\n\nexport interface DescribedError {\n /** One plain sentence: what went wrong and, where it helps, what to do. */\n cause: string;\n /** The raw text, unedited (empty when it would only repeat `cause`). */\n detail: string;\n /** A short machine code when one was recognized (\"ENOENT\", \"TIMEOUT\"). */\n code?: string;\n}\n\ninterface Rule {\n code: string;\n test: RegExp;\n cause: string;\n}\n\n/** Ordered: the first rule whose pattern matches the raw text wins. */\nconst RULES: ReadonlyArray<Rule> = [\n { 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.\" },\n { 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 › Privacy & Security, then try again.\" },\n { 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.\" },\n { code: \"ECONNREFUSED\", test: /\\bECONNREFUSED\\b|connection refused/i, cause: \"The service isn't answering. It may have stopped; start it again.\" },\n { 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.\" },\n { code: \"TIMEOUT\", test: /\\bETIMEDOUT\\b|timed? ?out|\\bTIMEOUT\\b|deadline exceeded/i, cause: \"It took too long to answer. Try again in a moment.\" },\n { code: \"ENOSPC\", test: /\\bENOSPC\\b|no space left/i, cause: \"The disk is full. Free some space, then try again.\" },\n { code: \"ENOMEM\", test: /\\bENOMEM\\b|out of memory|cannot allocate memory/i, cause: \"The computer ran out of memory. Close something and try again.\" },\n { 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.\" },\n { code: \"FORBIDDEN\", test: /\\b403\\b|forbidden/i, cause: \"This account isn't allowed to do that.\" },\n { code: \"NOT_FOUND\", test: /\\b404\\b|not found/i, cause: \"It isn't there any more. Refresh and try again.\" },\n { code: \"RATE_LIMIT\", test: /\\b429\\b|rate.?limit|too many requests/i, cause: \"Too many requests just now. Wait a moment and try again.\" },\n { 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.\" },\n { 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.\" },\n];\n\nconst RAW = /\\b[A-Z]{2,}[A-Z_]*\\b|[\\\\/][\\w.-]+[\\\\/]|\\bat \\S+ \\(|\\{|\\}|errno|stack|undefined|null|\\bspawn\\b/;\n\nfunction rawText(error: unknown): string {\n if (error instanceof Error) return error.message || error.name;\n if (typeof error === \"string\") return error;\n if (error && typeof error === \"object\" && \"message\" in error && typeof (error as { message: unknown }).message === \"string\") {\n return (error as { message: string }).message;\n }\n return \"\";\n}\n\n/**\n * Turn any thrown or returned error into words a person can act on. Already-humane text (a full\n * sentence the app wrote itself, with no codes, paths or stack) passes through unchanged.\n */\nexport function describeError(error: unknown, fallback = \"Something went wrong. Try again.\"): DescribedError {\n const detail = rawText(error).trim();\n if (!detail) return { cause: fallback, detail: \"\" };\n for (const rule of RULES) {\n if (rule.test.test(detail)) return { cause: rule.cause, detail, code: rule.code };\n }\n if (!RAW.test(detail) && detail.length <= 160) return { cause: detail, detail: \"\" };\n return { cause: fallback, detail };\n}\n","/**\n * THE SENTENCE A PERSON READS FOR AN ERROR — the one funnel every error surface draws through\n * (ErrorNotice, ErrorBox, the desktop Banner). Raw error text never reaches the screen: no\n * \"TypeError: Failed to fetch\", no `sidebar_conversations:` RPC prefix, no stack frame or file\n * path (Arman, 2026-10-24: notices are small and plain). The raw error still travels to the\n * Alchemy Menu / AI payload through the `error` prop; only the screen gets the sentence.\n *\n * The wording table is desktop/errors.ts `describeError` (one table for every screen); this file\n * adds what decides WHEN a sentence must go through it, narrow enough that an app's own sentence\n * (\"PDF too large\") passes untouched.\n */\nimport { describeError } from \"./desktop/errors\";\n\n/**\n * The sentence an error carries: its own message (string, Error, or any\n * object with a `message`). Empty when it has none.\n */\nexport function errorSentenceOf(error: unknown): string {\n if (error == null || error === true || error === false) return \"\";\n if (typeof error === \"string\") return error;\n if (typeof error !== \"object\") return String(error);\n const message = (error as { message?: unknown }).message;\n return typeof message === \"string\" ? message : \"\";\n}\n\n/**\n * What a person reads when the store cancelled a call at its statement timeout\n * (SQLSTATE 57014). Postgres' own \"canceling statement due to statement\n * timeout\" is about the database, not the person; the cancelled call rolled\n * back, so nothing was written (lane AT-SLOW, 2026-10-19). The same sentence\n * @ai-matrx/records' `TIMED_OUT_MESSAGE` gives.\n */\nexport const TIMED_OUT_SENTENCE = \"That took too long. Nothing was lost; try again.\";\n\n/** What a person reads when an error says nothing a person can use. */\nexport const FALLBACK_ERROR_SENTENCE = \"Something went wrong. Try again.\";\n\n/**\n * A notice CARD's words (the web toast, Matrx 2's floating card): a card is ~22 rem at most and its\n * action shares the row, so a line is a few words (notice-stack.ts NOTICE_TEXT_BUDGET). The same\n * causes as the sentences above, said short enough to fit at the smallest window, never cut by \"…\".\n */\nexport const CARD_ERROR_LINE = {\n OFFLINE: \"No connection\",\n TIMEOUT: \"Took too long. Nothing was lost.\",\n UNAUTHORIZED: \"Signed out. Sign in again.\",\n FORBIDDEN: \"Not allowed for this account\",\n NOT_FOUND: \"Not found. Refresh and retry.\",\n RATE_LIMIT: \"Too many requests. Wait a moment.\",\n SERVER: \"Server problem. Try again soon.\",\n FALLBACK: \"Something went wrong\",\n} as const;\n\n/** True when an error, its code, or its sentence is the store's statement timeout. */\nexport function isTimedOutError(error: unknown, message?: string | null, code?: string | number): boolean {\n if (code === \"57014\" || code === \"timed_out\") return true;\n if (error && typeof error === \"object\") {\n const o = error as { code?: unknown; sqlstate?: unknown };\n if (o.code === \"57014\" || o.code === \"timed_out\" || o.sqlstate === \"57014\") return true;\n }\n const text = `${message ?? \"\"} ${errorSentenceOf(error)}`;\n return /canceling statement due to statement timeout/i.test(text);\n}\n\n/** True when the call failed because the device is offline or the network never answered. */\nexport function isOfflineError(error: unknown, message?: string | null): boolean {\n if (typeof navigator !== \"undefined\" && navigator.onLine === false) return true;\n return offlineText(`${message ?? \"\"} ${errorSentenceOf(error)}`);\n}\n\nfunction offlineText(text: string): boolean {\n const t = text.trim();\n return t !== \"\" && (describeError(t).code === \"OFFLINE\" || /networkerror|network request failed|load failed/i.test(t));\n}\n\n/** describeError's causes that hold on every host (its process codes — ENOENT, EACCES, ports — are\n * the desktop's words for a local program and would mislead on a database refusal). */\nconst ANY_HOST_CODES = new Set([\"OFFLINE\", \"TIMEOUT\", \"UNAUTHORIZED\", \"FORBIDDEN\", \"NOT_FOUND\", \"RATE_LIMIT\", \"SERVER\"]);\n\n/** A leading machine label: `sidebar_conversations: …`, `chat.rpc_name: …`, `[chat-sidebar] …`. */\nconst MACHINE_PREFIX = /^\\s*(?:\\[[\\w./-]+\\]\\s*|[a-z][\\w]*(?:[._][\\w]+)+:\\s+)/;\n/** Text no person should read: JS error class names, stack frames, source paths. */\nconst RAW_TEXT =\n /\\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;\n\n/** True when a sentence carries raw error text or a code path (what the guard refuses on screen). */\nexport function isRawErrorText(text: string): boolean {\n return MACHINE_PREFIX.test(text) || RAW_TEXT.test(text);\n}\n\n/**\n * `card: true` = the short CARD_ERROR_LINE words for a notice card. Otherwise:\n * the sentence for the screen: the timeout sentence for a statement timeout; a caller's plain\n * sentence as is; a machine label stripped from the front; anything raw or offline worded by\n * `describeError` (its table, else `fallback`).\n */\nexport function peopleErrorSentence(\n error: unknown,\n message?: string | null,\n options: { code?: string | number | undefined; fallback?: string | undefined; card?: boolean | undefined } = {},\n): string {\n const card = options.card === true;\n if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;\n const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);\n const raw = message?.trim() || errorSentenceOf(error).trim();\n if (!raw) return fallback;\n let text = raw;\n for (let i = 0; i < 3 && MACHINE_PREFIX.test(text); i++) text = text.replace(MACHINE_PREFIX, \"\").trim();\n if (!text) return fallback;\n if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {\n const said = describeError(text, fallback);\n if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;\n return card ? CARD_ERROR_LINE[said.code as keyof typeof CARD_ERROR_LINE] : said.cause;\n }\n return text;\n}\n"],"mappings":";;;AAuBA,IAAM,QAA6B;AAAA,EACjC,EAAE,MAAM,UAAU,MAAM,4EAA4E,OAAO,iGAAiG;AAAA,EAC5M,EAAE,MAAM,UAAU,MAAM,iGAAiG,OAAO,6GAAwG;AAAA,EACxO,EAAE,MAAM,cAAc,MAAM,0EAA0E,OAAO,+EAA+E;AAAA,EAC5L,EAAE,MAAM,gBAAgB,MAAM,wCAAwC,OAAO,oEAAoE;AAAA,EACjJ,EAAE,MAAM,WAAW,MAAM,8GAA8G,OAAO,gEAAgE;AAAA,EAC9M,EAAE,MAAM,WAAW,MAAM,4DAA4D,OAAO,qDAAqD;AAAA,EACjJ,EAAE,MAAM,UAAU,MAAM,6BAA6B,OAAO,qDAAqD;AAAA,EACjH,EAAE,MAAM,UAAU,MAAM,oDAAoD,OAAO,iEAAiE;AAAA,EACpJ,EAAE,MAAM,gBAAgB,MAAM,yFAAyF,OAAO,4DAA4D;AAAA,EAC1L,EAAE,MAAM,aAAa,MAAM,sBAAsB,OAAO,yCAAyC;AAAA,EACjG,EAAE,MAAM,aAAa,MAAM,sBAAsB,OAAO,kDAAkD;AAAA,EAC1G,EAAE,MAAM,cAAc,MAAM,0CAA0C,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eAAe,KAAK,IAAI,GAAG,IAAK,QAAO,KAAK,QAAQ,gBAAgB,EAAE,EAAE,KAAK;AACtG,MAAI,CAAC,KAAM,QAAO;AAClB,MAAI,YAAY,IAAI,KAAK,SAAS,KAAK,IAAI,KAAK,SAAS,KAAK;AAC5D,UAAM,OAAO,cAAc,MAAM,QAAQ;AACzC,QAAI,CAAC,KAAK,QAAQ,CAAC,eAAe,IAAI,KAAK,IAAI,EAAG,QAAO;AACzD,WAAO,OAAO,gBAAgB,KAAK,IAAoC,IAAI,KAAK;AAAA,EAClF;AACA,SAAO;AACT;","names":[]}
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-GMNROZQJ.js";
13
13
  import {
14
14
  ErrorBox
15
- } from "./chunk-LJKF267O.js";
15
+ } from "./chunk-5Z5GTXKL.js";
16
16
  import {
17
17
  Skeleton
18
18
  } from "./chunk-DRSBLHOF.js";
@@ -778,4 +778,4 @@ export {
778
778
  CanvasLayout,
779
779
  ModeSwitch
780
780
  };
781
- //# sourceMappingURL=chunk-ZMUPFGQO.js.map
781
+ //# sourceMappingURL=chunk-TV2IDHPZ.js.map
@@ -17,7 +17,7 @@ import {
17
17
  DialogContent,
18
18
  DialogHeader,
19
19
  DialogTitle
20
- } from "./chunk-UWTODOMD.js";
20
+ } from "./chunk-2BQAHLU3.js";
21
21
  import {
22
22
  DataRowInspector,
23
23
  columnId
@@ -305,4 +305,4 @@ export {
305
305
  withMacLookDefaults,
306
306
  DataRowWindow
307
307
  };
308
- //# sourceMappingURL=chunk-CFUXEGW2.js.map
308
+ //# sourceMappingURL=chunk-XZGYKKCE.js.map
@@ -9,10 +9,10 @@ import {
9
9
  DialogFooter,
10
10
  DialogHeader,
11
11
  DialogTitle
12
- } from "./chunk-UWTODOMD.js";
12
+ } from "./chunk-2BQAHLU3.js";
13
+ import "./chunk-LEPD6TV7.js";
13
14
  import "./chunk-U24MOJWK.js";
14
15
  import "./chunk-NDTDBBMM.js";
15
- import "./chunk-LEPD6TV7.js";
16
16
  import {
17
17
  Textarea
18
18
  } from "./chunk-6XNYYROM.js";
package/dist/controls.cjs CHANGED
@@ -6183,6 +6183,16 @@ function errorSentenceOf(error) {
6183
6183
  }
6184
6184
  var TIMED_OUT_SENTENCE = "That took too long. Nothing was lost; try again.";
6185
6185
  var FALLBACK_ERROR_SENTENCE = "Something went wrong. Try again.";
6186
+ var CARD_ERROR_LINE = {
6187
+ OFFLINE: "No connection",
6188
+ TIMEOUT: "Took too long. Nothing was lost.",
6189
+ UNAUTHORIZED: "Signed out. Sign in again.",
6190
+ FORBIDDEN: "Not allowed for this account",
6191
+ NOT_FOUND: "Not found. Refresh and retry.",
6192
+ RATE_LIMIT: "Too many requests. Wait a moment.",
6193
+ SERVER: "Server problem. Try again soon.",
6194
+ FALLBACK: "Something went wrong"
6195
+ };
6186
6196
  function isTimedOutError(error, message, code) {
6187
6197
  if (code === "57014" || code === "timed_out") return true;
6188
6198
  if (error && typeof error === "object") {
@@ -6200,8 +6210,9 @@ var ANY_HOST_CODES = /* @__PURE__ */ new Set(["OFFLINE", "TIMEOUT", "UNAUTHORIZE
6200
6210
  var MACHINE_PREFIX = /^\s*(?:\[[\w./-]+\]\s*|[a-z][\w]*(?:[._][\w]+)+:\s+)/;
6201
6211
  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;
6202
6212
  function peopleErrorSentence(error, message, options = {}) {
6203
- if (isTimedOutError(error, message, options.code)) return TIMED_OUT_SENTENCE;
6204
- const fallback = options.fallback ?? FALLBACK_ERROR_SENTENCE;
6213
+ const card = options.card === true;
6214
+ if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;
6215
+ const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);
6205
6216
  const raw = message?.trim() || errorSentenceOf(error).trim();
6206
6217
  if (!raw) return fallback;
6207
6218
  let text = raw;
@@ -6209,7 +6220,8 @@ function peopleErrorSentence(error, message, options = {}) {
6209
6220
  if (!text) return fallback;
6210
6221
  if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {
6211
6222
  const said = describeError(text, fallback);
6212
- return said.code && ANY_HOST_CODES.has(said.code) ? said.cause : fallback;
6223
+ if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;
6224
+ return card ? CARD_ERROR_LINE[said.code] : said.cause;
6213
6225
  }
6214
6226
  return text;
6215
6227
  }