@ai-matrx/design-system 0.18.3 → 0.18.5
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 +18 -0
- package/README.md +22 -0
- package/dist/content-transfer.cjs +20 -7
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.d.cts +6 -0
- package/dist/content-transfer.d.ts +6 -0
- package/dist/content-transfer.js +20 -7
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.cjs +53 -0
- package/dist/data-table/copy-helpers.cjs.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +13 -2
- package/dist/data-table/copy-helpers.d.ts +13 -2
- package/dist/data-table/copy-helpers.js +55 -0
- package/dist/data-table/copy-helpers.js.map +1 -1
- package/dist/data-table/copy-types.cjs.map +1 -1
- package/dist/data-table/copy-types.d.cts +4 -0
- package/dist/data-table/copy-types.d.ts +4 -0
- package/dist/data-table/data-row-inspector.cjs +78 -52
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +78 -52
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +78 -52
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +78 -52
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/index.cjs +1587 -1277
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +23 -3
- package/dist/data-table/index.d.ts +23 -3
- package/dist/data-table/index.js +1574 -1262
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/pagination.cjs +149 -91
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +144 -86
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/uuid-cell.cjs +58 -45
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +58 -45
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/{types-CD4xGL5Z.d.cts → types-0CNCWvdK.d.cts} +4 -2
- package/dist/{types-BhSkeZQ_.d.ts → types-cH8oLqUx.d.ts} +4 -2
- package/package.json +1 -1
|
@@ -1523,6 +1523,7 @@ var actionDone = (message) => ({
|
|
|
1523
1523
|
mimeTypes: [],
|
|
1524
1524
|
message
|
|
1525
1525
|
});
|
|
1526
|
+
var isSafeFilename = (filename) => filename === filename.trim() && filename.length > 0 && !/^\.+$/.test(filename) && !/[\\/\x00-\x1F\x7F]/.test(filename);
|
|
1526
1527
|
var sourceFor = (id, label, build) => ({
|
|
1527
1528
|
id,
|
|
1528
1529
|
label,
|
|
@@ -1579,14 +1580,21 @@ function MatrxCopyMenuSession(props) {
|
|
|
1579
1580
|
))
|
|
1580
1581
|
throw new Error("Sheet rows must be JSON objects.");
|
|
1581
1582
|
const rows = value;
|
|
1582
|
-
const
|
|
1583
|
+
const suppliedColumns = props.export.sheetColumns?.();
|
|
1584
|
+
const columns = suppliedColumns ?? [...new Set(rows.flatMap((row) => Object.keys(row)))].map((id) => ({ id, label: id }));
|
|
1585
|
+
const ids = /* @__PURE__ */ new Set();
|
|
1586
|
+
for (const column of columns) {
|
|
1587
|
+
if (!column.id || !column.label || ids.has(column.id)) throw new Error("Sheet columns require unique nonempty ids and labels.");
|
|
1588
|
+
ids.add(column.id);
|
|
1589
|
+
}
|
|
1590
|
+
for (const row of rows) for (const key of Object.keys(row)) if (!ids.has(key)) throw new Error(`Sheet row key "${key}" is not declared in sheetColumns.`);
|
|
1583
1591
|
return {
|
|
1584
1592
|
kind: "rows",
|
|
1585
1593
|
rows,
|
|
1586
|
-
columns:
|
|
1587
|
-
id:
|
|
1588
|
-
label:
|
|
1589
|
-
path: `/${
|
|
1594
|
+
columns: columns.map((column) => ({
|
|
1595
|
+
id: column.id,
|
|
1596
|
+
label: column.label,
|
|
1597
|
+
path: `/${column.id.replace(/~/g, "~0").replace(/\//g, "~1")}`,
|
|
1590
1598
|
visible: true
|
|
1591
1599
|
}))
|
|
1592
1600
|
};
|
|
@@ -1671,7 +1679,8 @@ function MatrxCopyMenuSession(props) {
|
|
|
1671
1679
|
value: {
|
|
1672
1680
|
bytes: Array.from(bytes),
|
|
1673
1681
|
mime: file.mime,
|
|
1674
|
-
extension: file.extension
|
|
1682
|
+
extension: file.extension,
|
|
1683
|
+
...file.filename !== void 0 ? { filename: file.filename } : {}
|
|
1675
1684
|
}
|
|
1676
1685
|
};
|
|
1677
1686
|
},
|
|
@@ -1688,12 +1697,16 @@ function MatrxCopyMenuSession(props) {
|
|
|
1688
1697
|
(byte) => typeof byte !== "number" || !Number.isInteger(byte) || byte < 0 || byte > 255
|
|
1689
1698
|
))
|
|
1690
1699
|
throw new Error(`${item.label} did not capture a valid file.`);
|
|
1700
|
+
if (value.filename !== void 0 && (typeof value.filename !== "string" || !isSafeFilename(value.filename)))
|
|
1701
|
+
throw new Error(
|
|
1702
|
+
`${item.label} has an unsafe filename. Use a nonempty basename without leading or trailing whitespace, dots only, path separators, or control characters.`
|
|
1703
|
+
);
|
|
1691
1704
|
if (draft.omissions.some((omission) => omission.reason !== "duplicate"))
|
|
1692
1705
|
throw new Error(
|
|
1693
1706
|
"This custom file exceeds the configured export limits or contains excluded content. Use a standard format or revise the source options."
|
|
1694
1707
|
);
|
|
1695
1708
|
const bytes = new Uint8Array(value.bytes);
|
|
1696
|
-
const filename = `${props.label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "export"}.${value.extension.replace(/[^a-zA-Z0-9.-]/g, "") || "bin"}`;
|
|
1709
|
+
const filename = typeof value.filename === "string" ? value.filename : `${props.label.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "export"}.${value.extension.replace(/[^a-zA-Z0-9.-]/g, "") || "bin"}`;
|
|
1697
1710
|
return transport.download(
|
|
1698
1711
|
(0, import_content_transfer2.sealTransferArtifact)({
|
|
1699
1712
|
snapshotId: snapshot.id,
|
|
@@ -2231,7 +2244,7 @@ function MatrxUuidCell({
|
|
|
2231
2244
|
}
|
|
2232
2245
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
2233
2246
|
})();
|
|
2234
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2247
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
|
|
2235
2248
|
"span",
|
|
2236
2249
|
{
|
|
2237
2250
|
"data-matrx-cell-control": true,
|
|
@@ -2241,51 +2254,64 @@ function MatrxUuidCell({
|
|
|
2241
2254
|
),
|
|
2242
2255
|
onClick: stop,
|
|
2243
2256
|
children: [
|
|
2244
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.
|
|
2257
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
2245
2258
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
2246
2259
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
2247
|
-
] })
|
|
2248
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
{
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2260
|
+
] }),
|
|
2261
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
2262
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2263
|
+
"button",
|
|
2264
|
+
{
|
|
2265
|
+
type: "button",
|
|
2266
|
+
onClick: onCopy,
|
|
2267
|
+
"aria-label": copied ? "Copied" : `Copy ${label ?? "id"}`,
|
|
2268
|
+
className: cn(
|
|
2269
|
+
"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
2270
|
+
copied && "text-primary"
|
|
2271
|
+
),
|
|
2272
|
+
children: copied ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Copy, { className: "h-3 w-3" })
|
|
2273
|
+
}
|
|
2274
|
+
) }),
|
|
2275
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
|
|
2276
|
+
] }),
|
|
2277
|
+
canPeek ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
2278
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2279
|
+
"button",
|
|
2280
|
+
{
|
|
2281
|
+
type: "button",
|
|
2282
|
+
onClick: (e) => {
|
|
2283
|
+
stop(e);
|
|
2284
|
+
setPeekOpen(true);
|
|
2285
|
+
},
|
|
2286
|
+
"aria-label": `Quick look at ${label ?? "record"}`,
|
|
2287
|
+
className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
2288
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Lightbulb, { className: "h-3 w-3" })
|
|
2289
|
+
}
|
|
2290
|
+
) }),
|
|
2291
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(TooltipContent, { side: "top", children: [
|
|
2292
|
+
"Quick look at ",
|
|
2293
|
+
label ?? "record"
|
|
2294
|
+
] })
|
|
2295
|
+
] }) : null,
|
|
2296
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Tooltip, { children: [
|
|
2297
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
2298
|
+
"a",
|
|
2299
|
+
{
|
|
2300
|
+
href: resolvedHref,
|
|
2301
|
+
target: "_blank",
|
|
2302
|
+
rel: "noopener noreferrer",
|
|
2303
|
+
onClick: stop,
|
|
2304
|
+
"aria-label": `Open ${label ?? "record"} in a new tab`,
|
|
2305
|
+
className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
|
|
2306
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ExternalLink, { className: "h-3 w-3" })
|
|
2307
|
+
}
|
|
2308
|
+
) }),
|
|
2309
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(TooltipContent, { side: "top", children: [
|
|
2310
|
+
"Open ",
|
|
2311
|
+
label ?? "record",
|
|
2312
|
+
" in a new tab"
|
|
2313
|
+
] })
|
|
2314
|
+
] }) : null,
|
|
2289
2315
|
trailing,
|
|
2290
2316
|
notice,
|
|
2291
2317
|
canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
@@ -2299,7 +2325,7 @@ function MatrxUuidCell({
|
|
|
2299
2325
|
) : null
|
|
2300
2326
|
]
|
|
2301
2327
|
}
|
|
2302
|
-
);
|
|
2328
|
+
) });
|
|
2303
2329
|
}
|
|
2304
2330
|
|
|
2305
2331
|
// src/data-table/entity.ts
|