@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/controls.js
CHANGED
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
spansOf,
|
|
74
74
|
splitForMiddleTruncate,
|
|
75
75
|
stageStates
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-K3XWUACX.js";
|
|
77
77
|
import "./chunk-6NOLVA4E.js";
|
|
78
78
|
import {
|
|
79
79
|
Input,
|
|
@@ -98,16 +98,16 @@ import {
|
|
|
98
98
|
RowGroup,
|
|
99
99
|
SettingRow,
|
|
100
100
|
Tile
|
|
101
|
-
} from "./chunk-
|
|
101
|
+
} from "./chunk-QTPW44IJ.js";
|
|
102
102
|
import "./chunk-K4XCB576.js";
|
|
103
|
-
import "./chunk-
|
|
103
|
+
import "./chunk-5Z5GTXKL.js";
|
|
104
104
|
import "./chunk-DRSBLHOF.js";
|
|
105
105
|
import "./chunk-TH6DDCWF.js";
|
|
106
|
-
import "./chunk-
|
|
106
|
+
import "./chunk-2BQAHLU3.js";
|
|
107
|
+
import "./chunk-LEPD6TV7.js";
|
|
107
108
|
import "./chunk-IMQ3RX35.js";
|
|
108
109
|
import "./chunk-U24MOJWK.js";
|
|
109
110
|
import "./chunk-NDTDBBMM.js";
|
|
110
|
-
import "./chunk-LEPD6TV7.js";
|
|
111
111
|
import {
|
|
112
112
|
CONFIGURATION_CHOICE_SIZE,
|
|
113
113
|
ConfigurationTable,
|
|
@@ -119,7 +119,7 @@ import {
|
|
|
119
119
|
StatusToken,
|
|
120
120
|
isCollectedValue,
|
|
121
121
|
valueSummary
|
|
122
|
-
} from "./chunk-
|
|
122
|
+
} from "./chunk-NFJ63LIH.js";
|
|
123
123
|
import "./chunk-WFBPCMPF.js";
|
|
124
124
|
import "./chunk-OPF265PU.js";
|
|
125
125
|
import {
|
|
@@ -141,13 +141,14 @@ import {
|
|
|
141
141
|
Switch,
|
|
142
142
|
Tabs,
|
|
143
143
|
Textarea
|
|
144
|
-
} from "./chunk-
|
|
144
|
+
} from "./chunk-WVEDW5VO.js";
|
|
145
145
|
import "./chunk-BD77DHUO.js";
|
|
146
146
|
import "./chunk-BKCJUFD3.js";
|
|
147
147
|
import "./chunk-PIQJULQB.js";
|
|
148
148
|
import "./chunk-MOZRIHJF.js";
|
|
149
|
-
import "./chunk-
|
|
149
|
+
import "./chunk-T57DLONB.js";
|
|
150
150
|
import "./chunk-BNXNIN2S.js";
|
|
151
|
+
import "./chunk-HS6GMHKZ.js";
|
|
151
152
|
import "./chunk-WFITMVDB.js";
|
|
152
153
|
import "./chunk-WAT2XW7L.js";
|
|
153
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
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
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(
|
|
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("
|
|
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
|
}
|