@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
|
@@ -3,16 +3,17 @@ import "../chunk-QFP4BUKZ.js";
|
|
|
3
3
|
import {
|
|
4
4
|
RecordId,
|
|
5
5
|
shortUuid
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-KSCSH7AO.js";
|
|
7
|
+
import "../chunk-WVEDW5VO.js";
|
|
8
8
|
import "../chunk-BD77DHUO.js";
|
|
9
9
|
import "../chunk-BKCJUFD3.js";
|
|
10
10
|
import "../chunk-PIQJULQB.js";
|
|
11
11
|
import "../chunk-MOZRIHJF.js";
|
|
12
|
-
import "../chunk-
|
|
12
|
+
import "../chunk-T57DLONB.js";
|
|
13
13
|
import "../chunk-BNXNIN2S.js";
|
|
14
|
+
import "../chunk-HS6GMHKZ.js";
|
|
14
15
|
import "../chunk-ORXB4A5E.js";
|
|
15
|
-
import "../chunk-
|
|
16
|
+
import "../chunk-B5D3VIMC.js";
|
|
16
17
|
import "../chunk-4JAYMFQO.js";
|
|
17
18
|
import "../chunk-WFITMVDB.js";
|
|
18
19
|
import "../chunk-WAT2XW7L.js";
|
package/dist/desktop.cjs
CHANGED
|
@@ -3896,7 +3896,7 @@ var DropdownMenuSubTrigger = React25.forwardRef(({ className, inset, children, .
|
|
|
3896
3896
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
3897
3897
|
var DropdownMenuSubContent = React25.forwardRef(({ className, container, surface = "default", sideOffset = 2, alignOffset = -4, collisionPadding, onFocusOutside, children, ...props }, ref) => {
|
|
3898
3898
|
const portalContainer = usePortalContainer(container);
|
|
3899
|
-
const [bottomClearance] = React25.useState(
|
|
3899
|
+
const [bottomClearance] = React25.useState(sharedBottomClearance);
|
|
3900
3900
|
const padding = menuCollisionPadding(collisionPadding ?? 8, 0, bottomClearance);
|
|
3901
3901
|
const nested = useNestedSubmenuPlacement(ref, padding);
|
|
3902
3902
|
const keep = useSubmenuSurvivesParentPanelFocus(nested.ref, onFocusOutside);
|
|
@@ -3918,18 +3918,27 @@ var DropdownMenuSubContent = React25.forwardRef(({ className, container, surface
|
|
|
3918
3918
|
) });
|
|
3919
3919
|
});
|
|
3920
3920
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3921
|
-
function readTopClearance() {
|
|
3922
|
-
return readClearance("var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))");
|
|
3923
|
-
}
|
|
3924
|
-
function readBottomClearance() {
|
|
3925
|
-
return readClearance("var(--matrx-floating-clearance, 0px)");
|
|
3926
|
-
}
|
|
3927
3921
|
function menuCollisionPadding(caller, top, bottom, fallback = 0) {
|
|
3928
3922
|
const side = (key2) => typeof caller === "number" ? caller : caller?.[key2] ?? fallback;
|
|
3929
3923
|
return { top: Math.max(side("top"), top), right: side("right"), bottom: Math.max(side("bottom"), bottom), left: side("left") };
|
|
3930
3924
|
}
|
|
3931
|
-
|
|
3925
|
+
var CLEARANCE_REUSE_MS = 500;
|
|
3926
|
+
var clearanceCache = /* @__PURE__ */ new Map();
|
|
3927
|
+
var clock = () => typeof performance !== "undefined" ? performance.now() : Date.now();
|
|
3928
|
+
function readClearance(height, shared = false) {
|
|
3932
3929
|
if (typeof document === "undefined") return 0;
|
|
3930
|
+
const now = clock();
|
|
3931
|
+
const held = shared ? clearanceCache.get(height) : void 0;
|
|
3932
|
+
if (held && now - held.at < CLEARANCE_REUSE_MS) return held.px;
|
|
3933
|
+
const px = measureClearance(height);
|
|
3934
|
+
clearanceCache.set(height, { px, at: now });
|
|
3935
|
+
return px;
|
|
3936
|
+
}
|
|
3937
|
+
var TOP_CLEARANCE = "var(--matrx-floating-top-clearance, var(--shell-header-h, 0px))";
|
|
3938
|
+
var BOTTOM_CLEARANCE = "var(--matrx-floating-clearance, 0px)";
|
|
3939
|
+
var sharedTopClearance = () => readClearance(TOP_CLEARANCE, true);
|
|
3940
|
+
var sharedBottomClearance = () => readClearance(BOTTOM_CLEARANCE, true);
|
|
3941
|
+
function measureClearance(height) {
|
|
3933
3942
|
const probe = document.createElement("div");
|
|
3934
3943
|
probe.style.cssText = `position:fixed;top:0;left:0;width:0;visibility:hidden;pointer-events:none;height:${height}`;
|
|
3935
3944
|
document.body.appendChild(probe);
|
|
@@ -3939,8 +3948,8 @@ function readClearance(height) {
|
|
|
3939
3948
|
}
|
|
3940
3949
|
var DropdownMenuContent = React25.forwardRef(({ className, sideOffset = 4, container, surface = "default", children, onCloseAutoFocus, collisionPadding, ...props }, ref) => {
|
|
3941
3950
|
const portalContainer = usePortalContainer(container);
|
|
3942
|
-
const [topClearance] = React25.useState(
|
|
3943
|
-
const [bottomClearance] = React25.useState(
|
|
3951
|
+
const [topClearance] = React25.useState(sharedTopClearance);
|
|
3952
|
+
const [bottomClearance] = React25.useState(sharedBottomClearance);
|
|
3944
3953
|
const edges = useMenuScrollEdges(ref);
|
|
3945
3954
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
|
|
3946
3955
|
DropdownMenuPrimitive.Content,
|
|
@@ -5478,6 +5487,16 @@ function errorSentenceOf(error) {
|
|
|
5478
5487
|
}
|
|
5479
5488
|
var TIMED_OUT_SENTENCE = "That took too long. Nothing was lost; try again.";
|
|
5480
5489
|
var FALLBACK_ERROR_SENTENCE = "Something went wrong. Try again.";
|
|
5490
|
+
var CARD_ERROR_LINE = {
|
|
5491
|
+
OFFLINE: "No connection",
|
|
5492
|
+
TIMEOUT: "Took too long. Nothing was lost.",
|
|
5493
|
+
UNAUTHORIZED: "Signed out. Sign in again.",
|
|
5494
|
+
FORBIDDEN: "Not allowed for this account",
|
|
5495
|
+
NOT_FOUND: "Not found. Refresh and retry.",
|
|
5496
|
+
RATE_LIMIT: "Too many requests. Wait a moment.",
|
|
5497
|
+
SERVER: "Server problem. Try again soon.",
|
|
5498
|
+
FALLBACK: "Something went wrong"
|
|
5499
|
+
};
|
|
5481
5500
|
function isTimedOutError(error, message, code) {
|
|
5482
5501
|
if (code === "57014" || code === "timed_out") return true;
|
|
5483
5502
|
if (error && typeof error === "object") {
|
|
@@ -5487,6 +5506,10 @@ function isTimedOutError(error, message, code) {
|
|
|
5487
5506
|
const text = `${message ?? ""} ${errorSentenceOf(error)}`;
|
|
5488
5507
|
return /canceling statement due to statement timeout/i.test(text);
|
|
5489
5508
|
}
|
|
5509
|
+
function isOfflineError(error, message) {
|
|
5510
|
+
if (typeof navigator !== "undefined" && navigator.onLine === false) return true;
|
|
5511
|
+
return offlineText(`${message ?? ""} ${errorSentenceOf(error)}`);
|
|
5512
|
+
}
|
|
5490
5513
|
function offlineText(text) {
|
|
5491
5514
|
const t = text.trim();
|
|
5492
5515
|
return t !== "" && (describeError(t).code === "OFFLINE" || /networkerror|network request failed|load failed/i.test(t));
|
|
@@ -5498,8 +5521,9 @@ function isRawErrorText(text) {
|
|
|
5498
5521
|
return MACHINE_PREFIX.test(text) || RAW_TEXT.test(text);
|
|
5499
5522
|
}
|
|
5500
5523
|
function peopleErrorSentence(error, message, options = {}) {
|
|
5501
|
-
|
|
5502
|
-
|
|
5524
|
+
const card = options.card === true;
|
|
5525
|
+
if (isTimedOutError(error, message, options.code)) return card ? CARD_ERROR_LINE.TIMEOUT : TIMED_OUT_SENTENCE;
|
|
5526
|
+
const fallback = options.fallback ?? (card ? CARD_ERROR_LINE.FALLBACK : FALLBACK_ERROR_SENTENCE);
|
|
5503
5527
|
const raw = message?.trim() || errorSentenceOf(error).trim();
|
|
5504
5528
|
if (!raw) return fallback;
|
|
5505
5529
|
let text = raw;
|
|
@@ -5507,7 +5531,8 @@ function peopleErrorSentence(error, message, options = {}) {
|
|
|
5507
5531
|
if (!text) return fallback;
|
|
5508
5532
|
if (offlineText(text) || RAW_TEXT.test(text) || text !== raw) {
|
|
5509
5533
|
const said = describeError(text, fallback);
|
|
5510
|
-
|
|
5534
|
+
if (!said.code || !ANY_HOST_CODES.has(said.code)) return fallback;
|
|
5535
|
+
return card ? CARD_ERROR_LINE[said.code] : said.cause;
|
|
5511
5536
|
}
|
|
5512
5537
|
return text;
|
|
5513
5538
|
}
|
|
@@ -5515,6 +5540,9 @@ function peopleErrorSentence(error, message, options = {}) {
|
|
|
5515
5540
|
// src/desktop/state.tsx
|
|
5516
5541
|
var import_clipboard = require("@ai-matrx/kit/clipboard");
|
|
5517
5542
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
5543
|
+
function isOfflineOrKnown(text) {
|
|
5544
|
+
return isOfflineError(null, text) || isTimedOutError(null, text);
|
|
5545
|
+
}
|
|
5518
5546
|
var EMPTY_ICON = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 1.75, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": true, children: [
|
|
5519
5547
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "M22 12h-6l-2 3h-4l-2-3H2" }),
|
|
5520
5548
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("path", { d: "M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z" })
|
|
@@ -5591,10 +5619,12 @@ var BANNER_ICON = {
|
|
|
5591
5619
|
};
|
|
5592
5620
|
function Banner({ tone, icon, title, message, actions, detail, onDismiss, count, className, ...props }) {
|
|
5593
5621
|
const [copied, setCopied] = React34.useState(false);
|
|
5594
|
-
if (typeof title === "string" && isRawErrorText(title)) title = peopleErrorSentence(null, title);
|
|
5595
|
-
if (typeof message === "string" && isRawErrorText(message)) message = peopleErrorSentence(null, message);
|
|
5596
5622
|
const registry3 = React34.useContext(NoticeStackContext);
|
|
5597
5623
|
const floating = registry3 !== null;
|
|
5624
|
+
const asCard = registry3 !== null;
|
|
5625
|
+
if (typeof title === "string" && isRawErrorText(title)) title = peopleErrorSentence(null, title, { card: asCard });
|
|
5626
|
+
if (typeof message === "string" && (isRawErrorText(message) || asCard && isOfflineOrKnown(message)))
|
|
5627
|
+
message = peopleErrorSentence(null, message, { card: asCard });
|
|
5598
5628
|
const id = React34.useId();
|
|
5599
5629
|
const key2 = bannerNoticeKey(tone, title, message);
|
|
5600
5630
|
React34.useLayoutEffect(() => {
|