@ai-matrx/design-system 0.20.2 → 0.20.6
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 +20 -0
- package/dist/content-transfer.cjs +35 -15
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.css +10 -2
- package/dist/content-transfer.js +35 -15
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/data-row-inspector.cjs +60 -14
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +60 -14
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +60 -14
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +60 -14
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/index.cjs +67 -46
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.js +67 -46
- package/dist/data-table/index.js.map +1 -1
- package/dist/styles.css +1 -19
- package/package.json +1 -1
|
@@ -1199,7 +1199,7 @@ var useContentTransferCapabilities = () => React9.useContext(CapabilityContext);
|
|
|
1199
1199
|
var SurfaceContext = React9.createContext(null);
|
|
1200
1200
|
function MenuPresentation({ label, hint, icon: Icon2 }) {
|
|
1201
1201
|
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1202
|
-
Icon2 ? /* @__PURE__ */ jsx13(Icon2, { className: "matrx-alchemy-menu-icon" }) :
|
|
1202
|
+
Icon2 ? /* @__PURE__ */ jsx13(Icon2, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ jsx13(PaletteGlyph, { file: true }),
|
|
1203
1203
|
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1204
1204
|
label,
|
|
1205
1205
|
hint ? /* @__PURE__ */ jsx13("small", { className: "matrx-alchemy-menu-hint", children: hint }) : null
|
|
@@ -1221,8 +1221,11 @@ function DestinationPresentation({ action }) {
|
|
|
1221
1221
|
};
|
|
1222
1222
|
const path = paths[action.id.replace(/^matrx:/, "")];
|
|
1223
1223
|
return /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1224
|
-
|
|
1225
|
-
/* @__PURE__ */
|
|
1224
|
+
action.icon ? /* @__PURE__ */ jsx13(action.icon, { className: "matrx-alchemy-menu-icon" }) : path ? /* @__PURE__ */ jsx13("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: path }) }) : /* @__PURE__ */ jsx13(PaletteGlyph, { file: true }),
|
|
1225
|
+
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1226
|
+
action.label,
|
|
1227
|
+
action.hint ? /* @__PURE__ */ jsx13("small", { className: "matrx-alchemy-menu-hint", children: action.hint }) : null
|
|
1228
|
+
] })
|
|
1226
1229
|
] });
|
|
1227
1230
|
}
|
|
1228
1231
|
function ReceiptLink({ target }) {
|
|
@@ -1232,6 +1235,11 @@ function ReceiptLink({ target }) {
|
|
|
1232
1235
|
] }) : null;
|
|
1233
1236
|
}
|
|
1234
1237
|
function PaletteGlyph({ format, ai = false, file = false, kind }) {
|
|
1238
|
+
if (kind === "link") return /* @__PURE__ */ jsx13("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "M10 13a5 5 0 0 0 7 0l3-3a5 5 0 0 0-7-7l-2 2M14 11a5 5 0 0 0-7 0l-3 3a5 5 0 0 0 7 7l2-2" }) });
|
|
1239
|
+
if (kind === "surface") return /* @__PURE__ */ jsxs7("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1240
|
+
/* @__PURE__ */ jsx13("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
|
|
1241
|
+
/* @__PURE__ */ jsx13("path", { d: "M3 9h18M9 9v12" })
|
|
1242
|
+
] });
|
|
1235
1243
|
if (kind === "ai-copy") return /* @__PURE__ */ jsxs7("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
1236
1244
|
/* @__PURE__ */ jsx13("rect", { x: "5", y: "5", width: "11", height: "14", rx: "2" }),
|
|
1237
1245
|
/* @__PURE__ */ jsx13("path", { d: "M9 3h6a2 2 0 0 1 2 2v10" }),
|
|
@@ -1712,7 +1720,7 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
1712
1720
|
const presentation = options.action;
|
|
1713
1721
|
const Icon2 = presentation?.icon;
|
|
1714
1722
|
const fallbackLabel = options.file && !/^download\b/i.test(label2) ? `Download ${label2}` : label2;
|
|
1715
|
-
return /* @__PURE__ */ jsxs7("button", { type: "button", className: "matrx-alchemy-palette-tile", "aria-label": presentation?.ariaLabel ?? (presentation ? fallbackLabel : options.ariaLabel ?? `${resolvedMode === "copy" ? "Copy" : "Download"} ${label2}`), onClick: () => {
|
|
1723
|
+
return /* @__PURE__ */ jsxs7("button", { type: "button", className: "matrx-alchemy-palette-tile", title: id === "table-data" ? "JSON using column display names" : id === "table-schema" ? "Table schema and rows" : label2, "aria-label": presentation?.ariaLabel ?? (presentation ? fallbackLabel : options.ariaLabel ?? `${resolvedMode === "copy" ? "Copy" : "Download"} ${label2}`), onClick: () => {
|
|
1716
1724
|
closePalette();
|
|
1717
1725
|
onClick();
|
|
1718
1726
|
}, children: [
|
|
@@ -1774,7 +1782,7 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
1774
1782
|
/* @__PURE__ */ jsx13(PaletteGlyph, { kind: "ai-copy" }),
|
|
1775
1783
|
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1776
1784
|
"Copy with AI context",
|
|
1777
|
-
/* @__PURE__ */ jsx13("small", { className: "matrx-alchemy-menu-hint", children: "
|
|
1785
|
+
/* @__PURE__ */ jsx13("small", { className: "matrx-alchemy-menu-hint", children: "Include source context" })
|
|
1778
1786
|
] })
|
|
1779
1787
|
] }) : null, items: quickVariants("ai"), onRun: (variant) => {
|
|
1780
1788
|
closePalette();
|
|
@@ -1787,32 +1795,44 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
1787
1795
|
/* @__PURE__ */ jsx13(PaletteGlyph, { kind: "sliders" }),
|
|
1788
1796
|
/* @__PURE__ */ jsxs7("span", { children: [
|
|
1789
1797
|
"Prepare for AI",
|
|
1790
|
-
/* @__PURE__ */ jsx13("small", { className: "matrx-alchemy-menu-hint", children: "
|
|
1798
|
+
/* @__PURE__ */ jsx13("small", { className: "matrx-alchemy-menu-hint", children: "Trim, edit or summarize" })
|
|
1791
1799
|
] })
|
|
1792
1800
|
] }) })
|
|
1793
1801
|
] }) : null,
|
|
1794
1802
|
prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ jsx13(PaletteRows, { title: "Other sources", items: [], extra: /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
1795
|
-
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */
|
|
1803
|
+
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ jsxs7("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
|
|
1796
1804
|
closePalette();
|
|
1797
1805
|
void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName });
|
|
1798
|
-
}, children:
|
|
1806
|
+
}, children: [
|
|
1807
|
+
/* @__PURE__ */ jsx13(PaletteGlyph, { kind: "surface" }),
|
|
1808
|
+
/* @__PURE__ */ jsx13("span", { children: "Prepare this page" })
|
|
1809
|
+
] }) : null,
|
|
1799
1810
|
variants.map((variant) => /* @__PURE__ */ jsx13("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": variant.ariaLabel, onClick: () => {
|
|
1800
1811
|
closePalette();
|
|
1801
1812
|
void openWorkspace(variantWorkspaceKeys.get(variant.id), variant);
|
|
1802
1813
|
}, children: /* @__PURE__ */ jsx13(MenuPresentation, { ...variant, label: `Prepare ${variant.label}` }) }, variant.id))
|
|
1803
1814
|
] }) }) : null,
|
|
1804
1815
|
references.length || referenceActions.length ? /* @__PURE__ */ jsxs7("section", { className: "matrx-alchemy-palette-section", children: [
|
|
1805
|
-
/* @__PURE__ */ jsx13("h3", { children: "
|
|
1806
|
-
/* @__PURE__ */
|
|
1807
|
-
|
|
1808
|
-
|
|
1816
|
+
/* @__PURE__ */ jsx13("h3", { children: "References" }),
|
|
1817
|
+
referenceActions.map((action) => /* @__PURE__ */ jsxs7("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => void openReference(action), children: [
|
|
1818
|
+
/* @__PURE__ */ jsx13(PaletteGlyph, { kind: "link" }),
|
|
1819
|
+
/* @__PURE__ */ jsx13("span", { children: action.label }),
|
|
1820
|
+
/* @__PURE__ */ jsx13("svg", { className: "matrx-alchemy-disclosure", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "m6 4 4 4-4 4" }) })
|
|
1821
|
+
] }, action.id)),
|
|
1822
|
+
references.map((reference) => /* @__PURE__ */ jsxs7("button", { type: "button", className: "matrx-alchemy-palette-row", title: "Copies a reference to saved data", onClick: () => void copyReference(reference), children: [
|
|
1823
|
+
/* @__PURE__ */ jsx13(PaletteGlyph, { kind: "link" }),
|
|
1824
|
+
/* @__PURE__ */ jsx13("span", { children: reference.label })
|
|
1825
|
+
] }, reference.id))
|
|
1809
1826
|
] }) : null,
|
|
1810
1827
|
["save", "chat", "email", "other"].map((group) => {
|
|
1811
1828
|
const entries = ordinaryActions.filter((action) => (action.group ?? "other") === group);
|
|
1812
1829
|
return entries.length ? /* @__PURE__ */ jsxs7("details", { className: "matrx-alchemy-palette-destinations", children: [
|
|
1813
1830
|
/* @__PURE__ */ jsxs7("summary", { children: [
|
|
1814
1831
|
group === "save" ? "Save to Matrx" : group === "chat" ? "Continue with AI" : group === "email" ? "Email to me" : "Actions",
|
|
1815
|
-
/* @__PURE__ */
|
|
1832
|
+
/* @__PURE__ */ jsxs7("span", { className: "matrx-alchemy-disclosure-meta", children: [
|
|
1833
|
+
/* @__PURE__ */ jsx13("span", { children: entries.length }),
|
|
1834
|
+
/* @__PURE__ */ jsx13("svg", { className: "matrx-alchemy-disclosure", viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", "aria-hidden": "true", children: /* @__PURE__ */ jsx13("path", { d: "m6 4 4 4-4 4" }) })
|
|
1835
|
+
] })
|
|
1816
1836
|
] }),
|
|
1817
1837
|
/* @__PURE__ */ jsx13("div", { children: entries.map((action) => /* @__PURE__ */ jsx13("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": action.ariaLabel, onClick: () => {
|
|
1818
1838
|
closePalette();
|
|
@@ -3185,6 +3205,32 @@ function isUuidValue(value) {
|
|
|
3185
3205
|
return typeof value === "string" && /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value);
|
|
3186
3206
|
}
|
|
3187
3207
|
|
|
3208
|
+
// src/data-table/filter-engine.ts
|
|
3209
|
+
function stringifyCellValue(value) {
|
|
3210
|
+
if (value == null) return "";
|
|
3211
|
+
if (typeof value === "string") return value;
|
|
3212
|
+
if (typeof value === "number" || typeof value === "boolean") {
|
|
3213
|
+
return String(value);
|
|
3214
|
+
}
|
|
3215
|
+
if (value instanceof Date) return value.toISOString();
|
|
3216
|
+
try {
|
|
3217
|
+
return JSON.stringify(value);
|
|
3218
|
+
} catch {
|
|
3219
|
+
return String(value);
|
|
3220
|
+
}
|
|
3221
|
+
}
|
|
3222
|
+
|
|
3223
|
+
// src/data-table/display-value.ts
|
|
3224
|
+
function formatTableDisplayValue(value) {
|
|
3225
|
+
if (typeof value === "number") return value.toLocaleString(void 0, { maximumFractionDigits: 12 });
|
|
3226
|
+
if (value instanceof Date) return value.toLocaleString();
|
|
3227
|
+
if (typeof value === "string" && /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(value) && !Number.isNaN(Date.parse(value))) {
|
|
3228
|
+
return new Date(value).toLocaleString();
|
|
3229
|
+
}
|
|
3230
|
+
if (typeof value === "boolean") return value ? "Yes" : "No";
|
|
3231
|
+
return stringifyCellValue(value) || "\u2014";
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3188
3234
|
// src/data-table/DataRowInspector.tsx
|
|
3189
3235
|
import { jsx as jsx18, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3190
3236
|
var noFieldToken = () => null;
|
|
@@ -3257,7 +3303,7 @@ function DataRowInspector({
|
|
|
3257
3303
|
key
|
|
3258
3304
|
);
|
|
3259
3305
|
}
|
|
3260
|
-
const formatted = formatValue(value);
|
|
3306
|
+
const formatted = value !== null && typeof value === "object" && !(value instanceof Date) ? formatValue(value) : formatTableDisplayValue(value);
|
|
3261
3307
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
3262
3308
|
return /* @__PURE__ */ jsxs11(
|
|
3263
3309
|
"div",
|