@ai-matrx/records-ui 0.116.76 → 0.116.78
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 +21 -0
- package/dist/{SaveToTable-HQREESNE.js → SaveToTable-DQXFHYHS.js} +2 -2
- package/dist/{chunk-NDYZROTI.js → chunk-5RNBIP6J.js} +75 -56
- package/dist/{chunk-NDYZROTI.js.map → chunk-5RNBIP6J.js.map} +1 -1
- package/dist/{chunk-D2FZEAYO.js → chunk-AZZA7DQ4.js} +679 -558
- package/dist/chunk-AZZA7DQ4.js.map +1 -0
- package/dist/index.cjs +6097 -5996
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +184 -203
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +724 -599
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-D2FZEAYO.js.map +0 -1
- /package/dist/{SaveToTable-HQREESNE.js.map → SaveToTable-DQXFHYHS.js.map} +0 -0
package/dist/index.js
CHANGED
|
@@ -188,7 +188,7 @@ import {
|
|
|
188
188
|
withoutLeadingBlank,
|
|
189
189
|
workedOutErrorFor,
|
|
190
190
|
workedOutHoldsNumbers
|
|
191
|
-
} from "./chunk-
|
|
191
|
+
} from "./chunk-AZZA7DQ4.js";
|
|
192
192
|
import {
|
|
193
193
|
CHART_PLOT_PX,
|
|
194
194
|
EMBEDDED_ROW_PX,
|
|
@@ -299,7 +299,7 @@ import {
|
|
|
299
299
|
visibilityLaneFor,
|
|
300
300
|
whyNotAskable,
|
|
301
301
|
writeOnTheWinningVersion_exports
|
|
302
|
-
} from "./chunk-
|
|
302
|
+
} from "./chunk-5RNBIP6J.js";
|
|
303
303
|
import {
|
|
304
304
|
ACTION_CHECKING_ACCESS_REASON,
|
|
305
305
|
ACTION_NOT_HERE_REASON,
|
|
@@ -2833,7 +2833,8 @@ import {
|
|
|
2833
2833
|
Label,
|
|
2834
2834
|
Skeleton,
|
|
2835
2835
|
Switch,
|
|
2836
|
-
cn as cn2
|
|
2836
|
+
cn as cn2,
|
|
2837
|
+
displayId
|
|
2837
2838
|
} from "@ai-matrx/design-system";
|
|
2838
2839
|
import { formatRelativeTime as formatRelativeTime2 } from "@ai-matrx/kit/format";
|
|
2839
2840
|
import { humanizeIdentifier as humanizeIdentifier3 } from "@ai-matrx/kit/text-case";
|
|
@@ -3492,7 +3493,7 @@ function EnrichPanel({ tableId, fieldId, className }) {
|
|
|
3492
3493
|
] }) : null
|
|
3493
3494
|
] }) : null,
|
|
3494
3495
|
outcome?.ok && outcome.fieldId === row.field_id && outcome.wouldWrite && outcome.wouldWrite.length > 0 ? /* @__PURE__ */ jsx7("ul", { className: "space-y-1 rounded border p-2 text-xs", "data-testid": "enrich-would-write", children: outcome.wouldWrite.map((w) => /* @__PURE__ */ jsxs5("li", { className: "flex justify-between gap-2", children: [
|
|
3495
|
-
/* @__PURE__ */ jsx7("span", { className: "truncate text-muted-foreground", children: preview?.find((p) => p.record_id === w.record_id)?.title ?? w.record_id
|
|
3496
|
+
/* @__PURE__ */ jsx7("span", { className: "truncate text-muted-foreground", children: preview?.find((p) => p.record_id === w.record_id)?.title ?? displayId(w.record_id) }),
|
|
3496
3497
|
/* @__PURE__ */ jsx7("span", { className: "min-w-0 truncate text-right", children: w.absent ? w.absent === "conflicting" ? "Sources disagree" : "Nothing found" : String(w.value ?? "") })
|
|
3497
3498
|
] }, w.record_id)) }) : null,
|
|
3498
3499
|
outcome && (outcome.fieldId === void 0 || outcome.fieldId === row.field_id) ? outcome.ok ? /* @__PURE__ */ jsx7("p", { className: "text-xs text-muted-foreground", "data-testid": "enrich-outcome", children: outcome.message }) : (
|
|
@@ -25039,7 +25040,7 @@ import {
|
|
|
25039
25040
|
measureKey as measureKey4
|
|
25040
25041
|
} from "@ai-matrx/records";
|
|
25041
25042
|
import { mapPgError as mapPgError2 } from "@ai-matrx/records/core";
|
|
25042
|
-
import { cn as cn39 } from "@ai-matrx/design-system";
|
|
25043
|
+
import { cn as cn39, displayId as displayId2 } from "@ai-matrx/design-system";
|
|
25043
25044
|
import { formatCount as formatCount5 } from "@ai-matrx/kit/format";
|
|
25044
25045
|
|
|
25045
25046
|
// src/linkWords.ts
|
|
@@ -25891,7 +25892,7 @@ function StuckList({ rows }) {
|
|
|
25891
25892
|
/* @__PURE__ */ jsx94("th", { children: "Days unchanged" })
|
|
25892
25893
|
] }) }),
|
|
25893
25894
|
/* @__PURE__ */ jsx94("tbody", { children: rows.map((row) => /* @__PURE__ */ jsxs85("tr", { className: "border-t first:border-t-0", children: [
|
|
25894
|
-
/* @__PURE__ */ jsx94("td", { className: "truncate py-0.5 pr-2", title: row.title ?? void 0, children: row.title ?? row.record_id
|
|
25895
|
+
/* @__PURE__ */ jsx94("td", { className: "truncate py-0.5 pr-2", title: row.title ?? void 0, children: row.title ?? displayId2(row.record_id) }),
|
|
25895
25896
|
/* @__PURE__ */ jsx94("td", { className: "truncate py-0.5 pr-2 text-muted-foreground", title: row.state ?? void 0, children: row.state ?? "\u2014" }),
|
|
25896
25897
|
/* @__PURE__ */ jsxs85(
|
|
25897
25898
|
"td",
|
|
@@ -35737,26 +35738,11 @@ import {
|
|
|
35737
35738
|
SelectTrigger as SelectTrigger12,
|
|
35738
35739
|
SelectValue as SelectValue12,
|
|
35739
35740
|
Skeleton as Skeleton38,
|
|
35740
|
-
cn as
|
|
35741
|
+
cn as cn62
|
|
35741
35742
|
} from "@ai-matrx/design-system";
|
|
35742
35743
|
|
|
35743
|
-
// src/
|
|
35744
|
-
import {
|
|
35745
|
-
DndContext as DndContext3,
|
|
35746
|
-
KeyboardSensor as KeyboardSensor2,
|
|
35747
|
-
PointerSensor as PointerSensor3,
|
|
35748
|
-
pointerWithin,
|
|
35749
|
-
useSensor as useSensor3,
|
|
35750
|
-
useSensors as useSensors3
|
|
35751
|
-
} from "@dnd-kit/core";
|
|
35752
|
-
import {
|
|
35753
|
-
SortableContext as SortableContext3,
|
|
35754
|
-
rectSortingStrategy,
|
|
35755
|
-
sortableKeyboardCoordinates as sortableKeyboardCoordinates2,
|
|
35756
|
-
useSortable as useSortable3
|
|
35757
|
-
} from "@dnd-kit/sortable";
|
|
35758
|
-
import { CSS as CSS4 } from "@dnd-kit/utilities";
|
|
35759
|
-
import { cn as cn62 } from "@ai-matrx/design-system";
|
|
35744
|
+
// src/BlockGrid.tsx
|
|
35745
|
+
import { GridCanvas } from "@ai-matrx/design-system";
|
|
35760
35746
|
import { Select as Select17 } from "@ai-matrx/design-system/controls";
|
|
35761
35747
|
|
|
35762
35748
|
// src/dashboardLayout.ts
|
|
@@ -35768,26 +35754,10 @@ var SPAN_CHOICES = [
|
|
|
35768
35754
|
{ span: 12, label: "Full" }
|
|
35769
35755
|
];
|
|
35770
35756
|
var DEFAULT_SPAN = 6;
|
|
35771
|
-
var SPAN_CLASS = {
|
|
35772
|
-
2: "sm:col-span-2",
|
|
35773
|
-
3: "sm:col-span-3",
|
|
35774
|
-
4: "sm:col-span-4",
|
|
35775
|
-
5: "sm:col-span-5",
|
|
35776
|
-
6: "sm:col-span-6",
|
|
35777
|
-
7: "sm:col-span-7",
|
|
35778
|
-
8: "sm:col-span-8",
|
|
35779
|
-
9: "sm:col-span-9",
|
|
35780
|
-
10: "sm:col-span-10",
|
|
35781
|
-
11: "sm:col-span-11",
|
|
35782
|
-
12: "sm:col-span-12"
|
|
35783
|
-
};
|
|
35784
35757
|
function clampSpan(span) {
|
|
35785
35758
|
if (typeof span !== "number" || !Number.isFinite(span)) return DEFAULT_SPAN;
|
|
35786
35759
|
return Math.min(12, Math.max(2, Math.round(span)));
|
|
35787
35760
|
}
|
|
35788
|
-
function spanClass(span) {
|
|
35789
|
-
return SPAN_CLASS[clampSpan(span)];
|
|
35790
|
-
}
|
|
35791
35761
|
function snapSpan(span) {
|
|
35792
35762
|
const want = clampSpan(span);
|
|
35793
35763
|
let best = SPAN_CHOICES[0].span;
|
|
@@ -35796,100 +35766,111 @@ function snapSpan(span) {
|
|
|
35796
35766
|
}
|
|
35797
35767
|
return best;
|
|
35798
35768
|
}
|
|
35799
|
-
function moveListItem(items, from, to) {
|
|
35800
|
-
const next = [...items];
|
|
35801
|
-
if (from === to || from < 0 || to < 0 || from >= next.length || to >= next.length) return next;
|
|
35802
|
-
const [moved] = next.splice(from, 1);
|
|
35803
|
-
next.splice(to, 0, moved);
|
|
35804
|
-
return next;
|
|
35805
|
-
}
|
|
35806
35769
|
function withBlockIds(blocks) {
|
|
35807
35770
|
return blocks.map((block) => block.id ? block : { ...block, id: crypto.randomUUID() });
|
|
35808
35771
|
}
|
|
35809
35772
|
|
|
35810
|
-
// src/
|
|
35773
|
+
// src/BlockGrid.tsx
|
|
35811
35774
|
import { jsx as jsx121, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
35812
|
-
|
|
35813
|
-
|
|
35814
|
-
|
|
35815
|
-
const at = args.collisionRect;
|
|
35816
|
-
return args.droppableContainers.flatMap((container) => {
|
|
35817
|
-
const rect = args.droppableRects.get(container.id);
|
|
35818
|
-
if (!rect) return [];
|
|
35819
|
-
return [{ id: container.id, data: { droppableContainer: container, value: Math.hypot(rect.left - at.left, rect.top - at.top) } }];
|
|
35820
|
-
}).sort((a, b) => a.data.value - b.data.value);
|
|
35821
|
-
};
|
|
35822
|
-
function DashboardGrid({ items, arranging, onMove, onSpan }) {
|
|
35823
|
-
const sensors = useSensors3(
|
|
35824
|
-
useSensor3(PointerSensor3, { activationConstraint: { distance: 4 } }),
|
|
35825
|
-
useSensor3(KeyboardSensor2, { coordinateGetter: sortableKeyboardCoordinates2 })
|
|
35826
|
-
);
|
|
35827
|
-
const ids = items.map((item) => item.id);
|
|
35828
|
-
function dragEnd(event) {
|
|
35829
|
-
const from = ids.indexOf(String(event.active.id));
|
|
35830
|
-
const to = event.over ? ids.indexOf(String(event.over.id)) : -1;
|
|
35831
|
-
if (from >= 0 && to >= 0 && from !== to) onMove(from, to);
|
|
35832
|
-
}
|
|
35833
|
-
const grid = /* @__PURE__ */ jsx121("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-12", children: items.map((item, index) => /* @__PURE__ */ jsx121(GridCell2, { item, index, arranging, onSpan }, item.id)) });
|
|
35834
|
-
if (!arranging) return grid;
|
|
35835
|
-
return /* @__PURE__ */ jsx121(DndContext3, { sensors, collisionDetection: dashboardCollision, onDragEnd: dragEnd, children: /* @__PURE__ */ jsx121(SortableContext3, { items: ids, strategy: rectSortingStrategy, children: grid }) });
|
|
35775
|
+
function blockSpan(span) {
|
|
35776
|
+
if (typeof span !== "number" || !Number.isFinite(span)) return DEFAULT_SPAN;
|
|
35777
|
+
return Math.min(12, Math.max(2, Math.round(span)));
|
|
35836
35778
|
}
|
|
35837
|
-
function
|
|
35838
|
-
|
|
35839
|
-
|
|
35840
|
-
|
|
35841
|
-
|
|
35842
|
-
|
|
35843
|
-
|
|
35844
|
-
|
|
35845
|
-
|
|
35846
|
-
|
|
35779
|
+
function blocksToLines(items) {
|
|
35780
|
+
let x = 0;
|
|
35781
|
+
let y = 0;
|
|
35782
|
+
return items.map((item, n) => {
|
|
35783
|
+
const w = blockSpan(item.span);
|
|
35784
|
+
if (x > 0 && x + w > 12) {
|
|
35785
|
+
x = 0;
|
|
35786
|
+
y += 1;
|
|
35787
|
+
}
|
|
35788
|
+
const lg = { x, y, w, h: 1 };
|
|
35789
|
+
x += w;
|
|
35790
|
+
return { id: item.id, minW: 2, lg, sm: { x: 0, y: n, w: 4, h: 1 } };
|
|
35791
|
+
});
|
|
35792
|
+
}
|
|
35793
|
+
function linesToArrangement(next, ids, breakpoint) {
|
|
35794
|
+
const byId = new Map(next.map((p) => [p.id, p]));
|
|
35795
|
+
const at = (id) => (breakpoint === "sm" ? byId.get(id)?.sm : void 0) ?? byId.get(id).lg;
|
|
35796
|
+
const order = ids.map((_, n) => n).sort((a, b) => {
|
|
35797
|
+
const pa = at(ids[a]);
|
|
35798
|
+
const pb = at(ids[b]);
|
|
35799
|
+
return pa.y - pb.y || pa.x - pb.x;
|
|
35800
|
+
});
|
|
35801
|
+
return { order, spans: order.map((n) => blockSpan(byId.get(ids[n]).lg.w)) };
|
|
35802
|
+
}
|
|
35803
|
+
function BlockGrid({ items, arranging, onArrange }) {
|
|
35804
|
+
const ids = items.map((item) => item.id);
|
|
35805
|
+
const byId = new Map(items.map((item, index) => [item.id, { item, index }]));
|
|
35806
|
+
const spans = items.map((item) => blockSpan(item.span));
|
|
35807
|
+
return /* @__PURE__ */ jsx121(
|
|
35808
|
+
GridCanvas,
|
|
35847
35809
|
{
|
|
35848
|
-
|
|
35849
|
-
|
|
35850
|
-
|
|
35851
|
-
|
|
35852
|
-
|
|
35853
|
-
|
|
35854
|
-
|
|
35855
|
-
|
|
35856
|
-
|
|
35857
|
-
|
|
35858
|
-
|
|
35859
|
-
|
|
35860
|
-
|
|
35861
|
-
|
|
35862
|
-
|
|
35863
|
-
|
|
35864
|
-
|
|
35865
|
-
|
|
35866
|
-
|
|
35867
|
-
|
|
35868
|
-
|
|
35869
|
-
/* @__PURE__ */ jsx121(
|
|
35870
|
-
|
|
35871
|
-
|
|
35872
|
-
|
|
35873
|
-
|
|
35874
|
-
|
|
35875
|
-
|
|
35876
|
-
|
|
35877
|
-
|
|
35878
|
-
|
|
35879
|
-
|
|
35880
|
-
|
|
35881
|
-
|
|
35882
|
-
|
|
35883
|
-
|
|
35884
|
-
|
|
35885
|
-
|
|
35886
|
-
|
|
35887
|
-
|
|
35888
|
-
|
|
35889
|
-
|
|
35810
|
+
fit: "content",
|
|
35811
|
+
gap: 8,
|
|
35812
|
+
items: blocksToLines(items),
|
|
35813
|
+
editable: arranging,
|
|
35814
|
+
itemLabel: (id) => byId.get(id)?.item.title ?? "Block",
|
|
35815
|
+
onChange: (next, info) => {
|
|
35816
|
+
const { order, spans: nextSpans } = linesToArrangement(next, ids, info.breakpoint);
|
|
35817
|
+
onArrange(order, info.breakpoint === "sm" ? order.map((n) => spans[n]) : nextSpans);
|
|
35818
|
+
},
|
|
35819
|
+
renderItem: (id) => {
|
|
35820
|
+
const entry = byId.get(id);
|
|
35821
|
+
if (!entry) return null;
|
|
35822
|
+
const { item, index } = entry;
|
|
35823
|
+
return /* @__PURE__ */ jsxs112(
|
|
35824
|
+
"div",
|
|
35825
|
+
{
|
|
35826
|
+
"data-testid": `dashboard-block-${index}`,
|
|
35827
|
+
"data-block-span": blockSpan(item.span),
|
|
35828
|
+
className: arranging ? "flex h-full min-w-0 flex-col gap-1 rounded-md ring-1 ring-border" : "flex h-full min-w-0 flex-col gap-1",
|
|
35829
|
+
children: [
|
|
35830
|
+
arranging ? /* @__PURE__ */ jsxs112("div", { className: "flex items-center gap-1 px-1 pt-1 text-xs", children: [
|
|
35831
|
+
/* @__PURE__ */ jsx121(
|
|
35832
|
+
"button",
|
|
35833
|
+
{
|
|
35834
|
+
type: "button",
|
|
35835
|
+
"data-grid-drag-handle": "",
|
|
35836
|
+
"aria-label": `Move ${item.title}`,
|
|
35837
|
+
className: "flex h-7 w-7 touch-none items-center justify-center rounded text-muted-foreground hover:bg-muted",
|
|
35838
|
+
children: /* @__PURE__ */ jsxs112("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", className: "h-4 w-4 fill-current", children: [
|
|
35839
|
+
/* @__PURE__ */ jsx121("circle", { cx: "5.5", cy: "3.5", r: "1.25" }),
|
|
35840
|
+
/* @__PURE__ */ jsx121("circle", { cx: "10.5", cy: "3.5", r: "1.25" }),
|
|
35841
|
+
/* @__PURE__ */ jsx121("circle", { cx: "5.5", cy: "8", r: "1.25" }),
|
|
35842
|
+
/* @__PURE__ */ jsx121("circle", { cx: "10.5", cy: "8", r: "1.25" }),
|
|
35843
|
+
/* @__PURE__ */ jsx121("circle", { cx: "5.5", cy: "12.5", r: "1.25" }),
|
|
35844
|
+
/* @__PURE__ */ jsx121("circle", { cx: "10.5", cy: "12.5", r: "1.25" })
|
|
35845
|
+
] })
|
|
35846
|
+
}
|
|
35847
|
+
),
|
|
35848
|
+
/* @__PURE__ */ jsx121(
|
|
35849
|
+
Select17,
|
|
35850
|
+
{
|
|
35851
|
+
"aria-label": `Width of ${item.title}`,
|
|
35852
|
+
className: "ml-auto",
|
|
35853
|
+
value: String(snapSpan(item.span)),
|
|
35854
|
+
onValueChange: (v) => onArrange(items.map((_, n) => n), items.map((it, n) => n === index ? Number(v) : blockSpan(it.span))),
|
|
35855
|
+
options: SPAN_CHOICES.map((choice) => ({ value: String(choice.span), label: choice.label }))
|
|
35856
|
+
}
|
|
35857
|
+
)
|
|
35858
|
+
] }) : null,
|
|
35859
|
+
item.body
|
|
35860
|
+
]
|
|
35861
|
+
}
|
|
35862
|
+
);
|
|
35863
|
+
}
|
|
35890
35864
|
}
|
|
35891
35865
|
);
|
|
35892
35866
|
}
|
|
35867
|
+
function arrangeBlocks(blocks, order, spans, shown4 = (block) => blockSpan(block.span)) {
|
|
35868
|
+
return order.flatMap((n, k) => {
|
|
35869
|
+
const block = blocks[n];
|
|
35870
|
+
if (!block) return [];
|
|
35871
|
+
return [shown4(block, n) === spans[k] ? block : { ...block, span: spans[k] }];
|
|
35872
|
+
});
|
|
35873
|
+
}
|
|
35893
35874
|
|
|
35894
35875
|
// src/AddChart.tsx
|
|
35895
35876
|
import { useMemo as useMemo64, useState as useState110 } from "react";
|
|
@@ -36481,9 +36462,9 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
|
|
|
36481
36462
|
}
|
|
36482
36463
|
const spansTables = new Set((board?.blocks ?? []).map((b) => b.subject ?? tableId)).size > 1;
|
|
36483
36464
|
const rightsPending = !rights.known && (table.loading || !!table.data && !table.error);
|
|
36484
|
-
if (boards === null || rightsPending) return /* @__PURE__ */ jsx123(Skeleton38, { className:
|
|
36465
|
+
if (boards === null || rightsPending) return /* @__PURE__ */ jsx123(Skeleton38, { className: cn62("h-64 w-full", className) });
|
|
36485
36466
|
const PageLink = host.Link;
|
|
36486
|
-
return /* @__PURE__ */ jsxs114("div", { className:
|
|
36467
|
+
return /* @__PURE__ */ jsxs114("div", { className: cn62("flex min-h-0 flex-col gap-2", className), children: [
|
|
36487
36468
|
/* @__PURE__ */ jsxs114("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Dashboards", children: [
|
|
36488
36469
|
boards.map((d) => /* @__PURE__ */ jsx123(
|
|
36489
36470
|
Button92,
|
|
@@ -36620,13 +36601,12 @@ function DashboardCanvas({ tableId, activeDashboardId, filter, createOnMount, on
|
|
|
36620
36601
|
notKept ? /* @__PURE__ */ jsx123("p", { role: "status", "data-records-dashboard-not-kept": "", className: "text-xs text-amber-700 dark:text-amber-400", children: notKept }) : null,
|
|
36621
36602
|
!board ? /* @__PURE__ */ jsx123("p", { className: "text-xs text-muted-foreground", children: rights.admin ? "No dashboards yet." : rights.why("structure") }) : run === null ? /* @__PURE__ */ jsx123(Skeleton38, { className: "h-64 w-full" }) : run.blocks.length === 0 ? /* @__PURE__ */ jsx123("p", { className: "text-xs text-muted-foreground", children: "No charts yet." }) : /* @__PURE__ */ jsxs114(Fragment47, { children: [
|
|
36622
36603
|
/* @__PURE__ */ jsx123(
|
|
36623
|
-
|
|
36604
|
+
BlockGrid,
|
|
36624
36605
|
{
|
|
36625
36606
|
arranging: arranging && rights.admin,
|
|
36626
|
-
|
|
36627
|
-
onSpan: (index, span) => void declare2(
|
|
36607
|
+
onArrange: (order, spans) => void declare2(
|
|
36628
36608
|
board,
|
|
36629
|
-
board.blocks
|
|
36609
|
+
arrangeBlocks(board.blocks, order, spans, (b, i) => blockSpan(b.span ?? run.blocks[i]?.span))
|
|
36630
36610
|
),
|
|
36631
36611
|
items: run.blocks.map((block, index) => ({
|
|
36632
36612
|
id: board.blocks[index]?.id ?? block.id ?? `block-${index}`,
|
|
@@ -36953,7 +36933,7 @@ function TargetControl({
|
|
|
36953
36933
|
// src/QuestionPanel.tsx
|
|
36954
36934
|
import { copyText as copyText7 } from "@ai-matrx/kit/clipboard";
|
|
36955
36935
|
import { useEffect as useEffect99, useMemo as useMemo66, useRef as useRef46, useState as useState112 } from "react";
|
|
36956
|
-
import { Badge as Badge17, BasicInput as BasicInput21, Button as Button93, Checkbox as Checkbox12, Label as Label17, Skeleton as Skeleton39, cn as
|
|
36936
|
+
import { Badge as Badge17, BasicInput as BasicInput21, Button as Button93, Checkbox as Checkbox12, Label as Label17, Skeleton as Skeleton39, cn as cn63 } from "@ai-matrx/design-system";
|
|
36957
36937
|
import { useFields as useFields30, useRecordsClient as useRecordsClient91 } from "@ai-matrx/records/react";
|
|
36958
36938
|
|
|
36959
36939
|
// src/question.ts
|
|
@@ -37126,7 +37106,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
|
|
|
37126
37106
|
void copyText7(url.toString());
|
|
37127
37107
|
};
|
|
37128
37108
|
if (fields.loading || hidden === null) {
|
|
37129
|
-
return /* @__PURE__ */ jsxs115("div", { className:
|
|
37109
|
+
return /* @__PURE__ */ jsxs115("div", { className: cn63("flex flex-col gap-2 p-3", className), "data-testid": "question-panel", children: [
|
|
37130
37110
|
/* @__PURE__ */ jsx124(Skeleton39, { className: "h-8 w-full" }),
|
|
37131
37111
|
/* @__PURE__ */ jsx124(Skeleton39, { className: "h-32 w-full" })
|
|
37132
37112
|
] });
|
|
@@ -37135,7 +37115,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
|
|
|
37135
37115
|
{ value: "", label: "New question" },
|
|
37136
37116
|
...(saved ?? []).map((q) => ({ value: q.id, label: q.name, group: q.shared ? "Shared" : "Only me" }))
|
|
37137
37117
|
];
|
|
37138
|
-
return /* @__PURE__ */ jsxs115("div", { className:
|
|
37118
|
+
return /* @__PURE__ */ jsxs115("div", { className: cn63("flex min-h-0 flex-col gap-3 p-3 text-xs", className), "data-testid": "question-panel", children: [
|
|
37139
37119
|
/* @__PURE__ */ jsxs115("div", { className: "flex flex-wrap items-center gap-1.5", children: [
|
|
37140
37120
|
/* @__PURE__ */ jsx124(
|
|
37141
37121
|
PickOne,
|
|
@@ -37261,7 +37241,7 @@ function QuestionPanel({ tableId, activeQuestionId, draft, className }) {
|
|
|
37261
37241
|
)) })
|
|
37262
37242
|
] }) : null
|
|
37263
37243
|
] }),
|
|
37264
|
-
/* @__PURE__ */ jsx124("div", { className:
|
|
37244
|
+
/* @__PURE__ */ jsx124("div", { className: cn63("min-h-24 rounded-md border p-2 transition-opacity", asking && "opacity-60"), "data-testid": "question-answer", "aria-busy": asking, children: answer === null ? /* @__PURE__ */ jsx124(Skeleton39, { className: "h-16 w-full" }) : !answer.ok ? /* @__PURE__ */ jsx124(RefusalNotice, { error: answer.error }) : /* @__PURE__ */ jsx124(QuestionAnswerView, { tableId, spec, answer: answer.data, fields: all, related }) })
|
|
37265
37245
|
] });
|
|
37266
37246
|
}
|
|
37267
37247
|
function Measures({ measures, fields, onChange }) {
|
|
@@ -37930,7 +37910,7 @@ function AgentAnswer({
|
|
|
37930
37910
|
// src/PageScreen.tsx
|
|
37931
37911
|
import { useCallback as useCallback54, useEffect as useEffect102, useMemo as useMemo68, useRef as useRef47, useState as useState115 } from "react";
|
|
37932
37912
|
import { useRecordsClient as useRecordsClient94 } from "@ai-matrx/records/react";
|
|
37933
|
-
import { BasicInput as BasicInput24, Button as Button96, Skeleton as Skeleton42, cn as
|
|
37913
|
+
import { BasicInput as BasicInput24, Button as Button96, Skeleton as Skeleton42, cn as cn65 } from "@ai-matrx/design-system";
|
|
37934
37914
|
|
|
37935
37915
|
// src/PageCanvas.tsx
|
|
37936
37916
|
import { createContext as createContext7, useContext as useContext8, useEffect as useEffect101, useMemo as useMemo67, useState as useState114 } from "react";
|
|
@@ -37944,7 +37924,7 @@ import {
|
|
|
37944
37924
|
import { onRecordChanged as onRecordChanged2 } from "@ai-matrx/records/core";
|
|
37945
37925
|
import { downloadFile as downloadFile2 } from "@ai-matrx/kit/download";
|
|
37946
37926
|
import { formatCount as formatCount8 } from "@ai-matrx/kit/format";
|
|
37947
|
-
import { BasicInput as BasicInput23, Button as Button95, Checkbox as Checkbox13, Skeleton as Skeleton41, cn as
|
|
37927
|
+
import { BasicInput as BasicInput23, Button as Button95, Checkbox as Checkbox13, Skeleton as Skeleton41, cn as cn64 } from "@ai-matrx/design-system";
|
|
37948
37928
|
import { formFromSummary as formFromSummary2 } from "@ai-matrx/records/forms";
|
|
37949
37929
|
import { Fragment as Fragment50, jsx as jsx126, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
37950
37930
|
var InterfaceDoorContext = createContext7(null);
|
|
@@ -38058,11 +38038,12 @@ function PageCanvasBody({ blocks, charts, run, subject, viewerUserId, editing, c
|
|
|
38058
38038
|
...block.kind === "chart" ? { charts: charts.filter((c) => c.id !== block.id) } : {}
|
|
38059
38039
|
});
|
|
38060
38040
|
return /* @__PURE__ */ jsx126(
|
|
38061
|
-
|
|
38041
|
+
BlockGrid,
|
|
38062
38042
|
{
|
|
38063
38043
|
arranging: editing,
|
|
38064
|
-
|
|
38065
|
-
|
|
38044
|
+
onArrange: (order, spans) => onSave({
|
|
38045
|
+
blocks: arrangeBlocks(blocks, order, spans, (b) => blockSpan(b.span ?? charts.find((c) => c.id === b.id)?.span ?? 6))
|
|
38046
|
+
}),
|
|
38066
38047
|
items: blocks.map((block) => {
|
|
38067
38048
|
const chart = block.kind === "chart" ? charts.find((c) => c.id === block.id) : void 0;
|
|
38068
38049
|
return {
|
|
@@ -38390,7 +38371,7 @@ function RowsTable({
|
|
|
38390
38371
|
}
|
|
38391
38372
|
},
|
|
38392
38373
|
"data-clickable": "",
|
|
38393
|
-
className:
|
|
38374
|
+
className: cn64("border-t hover:bg-muted/60", row.id === selected && "bg-primary/10 hover:bg-primary/15"),
|
|
38394
38375
|
children: columns.map((f) => /* @__PURE__ */ jsx126("td", { className: "max-w-[14rem] truncate px-2 py-1.5", children: /* @__PURE__ */ jsx126(
|
|
38395
38376
|
RecordValue,
|
|
38396
38377
|
{
|
|
@@ -38588,7 +38569,7 @@ function DoorLayoutView({ block, door }) {
|
|
|
38588
38569
|
"data-records-page-card": row.id,
|
|
38589
38570
|
children: [
|
|
38590
38571
|
block.image_field && typeof (row.document ?? {})[block.image_field] === "string" ? /* @__PURE__ */ jsx126("img", { src: (row.document ?? {})[block.image_field], alt: "", className: "h-28 w-full rounded object-cover" }) : null,
|
|
38591
|
-
columns.map((f) => /* @__PURE__ */ jsx126("span", { className:
|
|
38572
|
+
columns.map((f) => /* @__PURE__ */ jsx126("span", { className: cn64("min-w-0 truncate", f.key === title?.key ? "text-sm font-medium" : "text-xs"), children: /* @__PURE__ */ jsx126(RecordValue, { field: f, value: (row.document ?? {})[f.key], document: row.document, withheld: row.hidden?.[f.key] ?? null, recordId: row.id, inCell: true }) }, f.key))
|
|
38592
38573
|
]
|
|
38593
38574
|
},
|
|
38594
38575
|
row.id
|
|
@@ -38596,7 +38577,7 @@ function DoorLayoutView({ block, door }) {
|
|
|
38596
38577
|
const opened = read.rows.find((r) => r.id === open);
|
|
38597
38578
|
return /* @__PURE__ */ jsxs117("div", { className: "flex min-w-0 flex-col gap-2", "data-records-page-layout": block.layout, children: [
|
|
38598
38579
|
/* @__PURE__ */ jsx126("div", { className: "flex justify-end", children: /* @__PURE__ */ jsx126(CsvButton, { name: block.title ?? ELEMENT_LAYOUT_LABEL[block.layout], fields: columns, rows: read.rows }) }),
|
|
38599
|
-
block.layout === "grid" ? /* @__PURE__ */ jsx126(RowsTable, { label: block.title ?? "Records", rows: read.rows, columns, selected: open, onSelect: setOpen, titleOf: () => "" }) : block.layout === "gallery" ? /* @__PURE__ */ jsx126("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3", children: read.rows.map(card) }) : /* @__PURE__ */ jsx126("div", { className:
|
|
38580
|
+
block.layout === "grid" ? /* @__PURE__ */ jsx126(RowsTable, { label: block.title ?? "Records", rows: read.rows, columns, selected: open, onSelect: setOpen, titleOf: () => "" }) : block.layout === "gallery" ? /* @__PURE__ */ jsx126("div", { className: "grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3", children: read.rows.map(card) }) : /* @__PURE__ */ jsx126("div", { className: cn64("flex min-w-0 gap-2", block.layout === "kanban" ? "flex-col overflow-x-auto sm:flex-row" : "flex-col"), children: [...groups.entries()].map(([key, rows]) => /* @__PURE__ */ jsxs117("section", { className: cn64("flex min-w-0 flex-col gap-1.5", block.layout === "kanban" && "sm:w-64 sm:shrink-0"), children: [
|
|
38600
38581
|
/* @__PURE__ */ jsxs117("h3", { className: "text-xs font-medium text-muted-foreground", children: [
|
|
38601
38582
|
key || "None",
|
|
38602
38583
|
" ",
|
|
@@ -39254,9 +39235,9 @@ function PageScreen({
|
|
|
39254
39235
|
}, [client, page, onArchived]);
|
|
39255
39236
|
if (error) return /* @__PURE__ */ jsx127(RefusalNotice, { error, className });
|
|
39256
39237
|
if (missing) {
|
|
39257
|
-
return /* @__PURE__ */ jsx127("p", { className:
|
|
39238
|
+
return /* @__PURE__ */ jsx127("p", { className: cn65("p-4 text-sm text-muted-foreground", className), "data-records-page-missing": "", children: "This page is archived or not shared with you." });
|
|
39258
39239
|
}
|
|
39259
|
-
if (!page) return /* @__PURE__ */ jsx127(Skeleton42, { className:
|
|
39240
|
+
if (!page) return /* @__PURE__ */ jsx127(Skeleton42, { className: cn65("h-64 w-full", className) });
|
|
39260
39241
|
const addBlock = (choice) => {
|
|
39261
39242
|
const made = newElement(choice, blocks, page.subject ?? "");
|
|
39262
39243
|
if (made.kind === "chart") {
|
|
@@ -39282,7 +39263,7 @@ function PageScreen({
|
|
|
39282
39263
|
/* @__PURE__ */ jsx127(Button96, { size: "sm", variant: "ghost", onClick: () => canvas.current && printRecordsPage(canvas.current, page.name), "data-records-page-print": "", children: "Print" }),
|
|
39283
39264
|
organizationId ? /* @__PURE__ */ jsx127(ShareControl, { kind: "record", organizationId, subjectId: page.id, name: page.name }) : null
|
|
39284
39265
|
] });
|
|
39285
|
-
return /* @__PURE__ */ jsxs118("div", { className:
|
|
39266
|
+
return /* @__PURE__ */ jsxs118("div", { className: cn65("flex min-h-0 flex-col gap-2", className), "data-records-page": page.id, children: [
|
|
39286
39267
|
header ? header({ name: page.name, actions }) : /* @__PURE__ */ jsxs118("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
39287
39268
|
/* @__PURE__ */ jsx127("h1", { className: "min-w-0 flex-1 truncate text-base font-medium", children: page.name }),
|
|
39288
39269
|
actions
|
|
@@ -39344,7 +39325,7 @@ function PageScreen({
|
|
|
39344
39325
|
// src/InterfaceScreen.tsx
|
|
39345
39326
|
import { useCallback as useCallback55, useEffect as useEffect103, useMemo as useMemo69, useRef as useRef48, useState as useState116 } from "react";
|
|
39346
39327
|
import { useRecordsClient as useRecordsClient95 } from "@ai-matrx/records/react";
|
|
39347
|
-
import { BasicInput as BasicInput25, Button as Button97, Skeleton as Skeleton43, cn as
|
|
39328
|
+
import { BasicInput as BasicInput25, Button as Button97, Skeleton as Skeleton43, cn as cn66 } from "@ai-matrx/design-system";
|
|
39348
39329
|
import { Fragment as Fragment52, jsx as jsx128, jsxs as jsxs119 } from "react/jsx-runtime";
|
|
39349
39330
|
var INTERFACE_COLOR_CLASS = {
|
|
39350
39331
|
blue: "bg-blue-500 text-white",
|
|
@@ -39464,7 +39445,7 @@ function InterfaceScreen({
|
|
|
39464
39445
|
if (missing) {
|
|
39465
39446
|
return /* @__PURE__ */ jsx128("div", { className, "data-records-interface-missing": "", children: notShared ?? /* @__PURE__ */ jsx128("p", { className: "p-4 text-sm text-muted-foreground", children: "This interface is archived or not shared with you." }) });
|
|
39466
39447
|
}
|
|
39467
|
-
if (!read || !shape) return /* @__PURE__ */ jsx128(Skeleton43, { className:
|
|
39448
|
+
if (!read || !shape) return /* @__PURE__ */ jsx128(Skeleton43, { className: cn66("h-64 w-full", className) });
|
|
39468
39449
|
const changed2 = builder && hasUnpublishedChanges(shape);
|
|
39469
39450
|
const savePage = (nextPage) => void save(withDraftPage(shape, nextPage));
|
|
39470
39451
|
const actions = /* @__PURE__ */ jsxs119("span", { className: "flex flex-wrap items-center gap-1", children: [
|
|
@@ -39493,7 +39474,7 @@ function InterfaceScreen({
|
|
|
39493
39474
|
const badge = /* @__PURE__ */ jsx128(
|
|
39494
39475
|
"span",
|
|
39495
39476
|
{
|
|
39496
|
-
className:
|
|
39477
|
+
className: cn66("flex h-6 w-6 shrink-0 items-center justify-center rounded text-xs font-semibold", INTERFACE_COLOR_CLASS[shape.color] ?? INTERFACE_COLOR_CLASS.blue),
|
|
39497
39478
|
"aria-hidden": true,
|
|
39498
39479
|
children: renderIcon ? renderIcon(shape.icon) : read.name.slice(0, 1).toUpperCase()
|
|
39499
39480
|
}
|
|
@@ -39535,7 +39516,7 @@ function InterfaceScreen({
|
|
|
39535
39516
|
]
|
|
39536
39517
|
}
|
|
39537
39518
|
);
|
|
39538
|
-
return /* @__PURE__ */ jsxs119("div", { className:
|
|
39519
|
+
return /* @__PURE__ */ jsxs119("div", { className: cn66("flex min-h-0 flex-col gap-2", className), "data-records-interface": read.id, children: [
|
|
39539
39520
|
header ? header({ name: read.name, actions }) : /* @__PURE__ */ jsxs119("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
39540
39521
|
badge,
|
|
39541
39522
|
/* @__PURE__ */ jsx128("h1", { className: "min-w-0 flex-1 truncate text-base font-medium", children: read.name }),
|
|
@@ -39659,7 +39640,7 @@ import { copyText as copyText8 } from "@ai-matrx/kit/clipboard";
|
|
|
39659
39640
|
import { useCallback as useCallback56, useEffect as useEffect104, useRef as useRef49, useState as useState117 } from "react";
|
|
39660
39641
|
import { useRecordsClient as useRecordsClient96, useTable as useTable35 } from "@ai-matrx/records/react";
|
|
39661
39642
|
import { publicFormPath as publicFormPath2 } from "@ai-matrx/records";
|
|
39662
|
-
import { Badge as Badge18, Button as Button98, Skeleton as Skeleton44, cn as
|
|
39643
|
+
import { Badge as Badge18, Button as Button98, Skeleton as Skeleton44, cn as cn67 } from "@ai-matrx/design-system";
|
|
39663
39644
|
import { FORM_STATE_WORDS as FORM_STATE_WORDS2 } from "@ai-matrx/records/forms";
|
|
39664
39645
|
import { Fragment as Fragment53, jsx as jsx129, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
39665
39646
|
var FORM_NOT_HERE_LINE = "The link named a form this table does not have \u2014 it may have been removed, or it belongs to another table. The forms this table does have are listed here.";
|
|
@@ -39728,9 +39709,9 @@ function FormsPanel({ tableId, activeFormId, asView = false, className }) {
|
|
|
39728
39709
|
setShown(url);
|
|
39729
39710
|
}
|
|
39730
39711
|
}, []);
|
|
39731
|
-
if (forms === null) return /* @__PURE__ */ jsx129(Skeleton44, { className:
|
|
39712
|
+
if (forms === null) return /* @__PURE__ */ jsx129(Skeleton44, { className: cn67("h-32 w-full", className) });
|
|
39732
39713
|
const origin = host.publicOrigin ?? (typeof window === "undefined" ? "" : window.location.origin);
|
|
39733
|
-
return /* @__PURE__ */ jsxs120("section", { className:
|
|
39714
|
+
return /* @__PURE__ */ jsxs120("section", { className: cn67("flex flex-col gap-3", className), children: [
|
|
39734
39715
|
/* @__PURE__ */ jsxs120("header", { className: "flex items-center gap-2", children: [
|
|
39735
39716
|
/* @__PURE__ */ jsx129("h3", { className: "text-sm font-medium", children: "Forms" }),
|
|
39736
39717
|
/* @__PURE__ */ jsx129("span", { className: "text-xs text-muted-foreground", children: forms.length === 0 ? "none yet" : `${forms.length}` }),
|
|
@@ -39776,7 +39757,7 @@ function FormsPanel({ tableId, activeFormId, asView = false, className }) {
|
|
|
39776
39757
|
{
|
|
39777
39758
|
"data-linked": form.form_id === activeFormId ? "true" : void 0,
|
|
39778
39759
|
ref: form.form_id === activeFormId ? (el) => el?.scrollIntoView({ block: "nearest" }) : void 0,
|
|
39779
|
-
className:
|
|
39760
|
+
className: cn67(
|
|
39780
39761
|
"rounded-md border p-2.5",
|
|
39781
39762
|
form.form_id === activeFormId && "border-primary ring-1 ring-primary"
|
|
39782
39763
|
),
|
|
@@ -39848,7 +39829,7 @@ function FormsPanel({ tableId, activeFormId, asView = false, className }) {
|
|
|
39848
39829
|
// src/CaptureSheet.tsx
|
|
39849
39830
|
import { useCallback as useCallback58, useEffect as useEffect106, useRef as useRef51, useState as useState119 } from "react";
|
|
39850
39831
|
import { useFields as useFields33, useRecordsClient as useRecordsClient98, useTable as useTable36 } from "@ai-matrx/records/react";
|
|
39851
|
-
import { Button as Button100, Input as Input9, Skeleton as Skeleton46, Textarea as Textarea7, cn as
|
|
39832
|
+
import { Button as Button100, Input as Input9, Skeleton as Skeleton46, Textarea as Textarea7, cn as cn69 } from "@ai-matrx/design-system";
|
|
39852
39833
|
|
|
39853
39834
|
// src/CaptureRun.tsx
|
|
39854
39835
|
import { useCallback as useCallback57, useEffect as useEffect105, useMemo as useMemo70, useRef as useRef50, useState as useState118 } from "react";
|
|
@@ -39858,7 +39839,7 @@ import {
|
|
|
39858
39839
|
openCaptureQueue
|
|
39859
39840
|
} from "@ai-matrx/records";
|
|
39860
39841
|
import { useRecordsClient as useRecordsClient97 } from "@ai-matrx/records/react";
|
|
39861
|
-
import { Button as Button99, Input as Input8, Skeleton as Skeleton45, Textarea as Textarea6, cn as
|
|
39842
|
+
import { Button as Button99, Input as Input8, Skeleton as Skeleton45, Textarea as Textarea6, cn as cn68 } from "@ai-matrx/design-system";
|
|
39862
39843
|
import { momentZoneOptions as momentZoneOptions5 } from "@ai-matrx/design-system/field-formats";
|
|
39863
39844
|
import { jsx as jsx130, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
39864
39845
|
function controlFor(field) {
|
|
@@ -40048,13 +40029,13 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
40048
40029
|
if (online) await sync();
|
|
40049
40030
|
}
|
|
40050
40031
|
if (loadFailed) {
|
|
40051
|
-
return /* @__PURE__ */ jsx130("section", { className:
|
|
40032
|
+
return /* @__PURE__ */ jsx130("section", { className: cn68("mx-auto w-full max-w-sm p-4", className), children: /* @__PURE__ */ jsx130("div", { "data-testid": "capture-refusal", children: /* @__PURE__ */ jsx130(RefusalNotice, { error: loadFailed, className: "text-sm" }) }) });
|
|
40052
40033
|
}
|
|
40053
40034
|
if (face === void 0) {
|
|
40054
|
-
return /* @__PURE__ */ jsx130(Skeleton45, { className:
|
|
40035
|
+
return /* @__PURE__ */ jsx130(Skeleton45, { className: cn68("mx-auto h-64 w-full max-w-sm", className) });
|
|
40055
40036
|
}
|
|
40056
40037
|
if (face === null) {
|
|
40057
|
-
return /* @__PURE__ */ jsx130("section", { className:
|
|
40038
|
+
return /* @__PURE__ */ jsx130("section", { className: cn68("mx-auto w-full max-w-sm p-4", className), children: /* @__PURE__ */ jsx130("p", { className: "text-sm", "data-testid": "capture-refusal", children: "This capture sheet is not here, or it is not yours to open. If somebody sent you this link, ask them to check it." }) });
|
|
40058
40039
|
}
|
|
40059
40040
|
const waiting = counts.waiting + counts.sending;
|
|
40060
40041
|
const queueLine = /* @__PURE__ */ jsxs121("div", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", "data-testid": "capture-queue-line", children: [
|
|
@@ -40106,7 +40087,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
40106
40087
|
) : null
|
|
40107
40088
|
] }, i.client_key)) }) : null;
|
|
40108
40089
|
if (!face.may_capture) {
|
|
40109
|
-
return /* @__PURE__ */ jsxs121("section", { className:
|
|
40090
|
+
return /* @__PURE__ */ jsxs121("section", { className: cn68("mx-auto flex w-full max-w-sm flex-col gap-3 p-4", className), children: [
|
|
40110
40091
|
/* @__PURE__ */ jsx130("h1", { className: "text-lg font-medium", children: face.title }),
|
|
40111
40092
|
/* @__PURE__ */ jsx130("p", { className: "text-sm", "data-testid": "capture-refusal", children: face.message }),
|
|
40112
40093
|
queueLine,
|
|
@@ -40115,7 +40096,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
40115
40096
|
}
|
|
40116
40097
|
if (done) {
|
|
40117
40098
|
const thanks = face.presentation?.thank_you ?? {};
|
|
40118
|
-
return /* @__PURE__ */ jsxs121("section", { className:
|
|
40099
|
+
return /* @__PURE__ */ jsxs121("section", { className: cn68("mx-auto flex w-full max-w-sm flex-col gap-3 p-4", className), children: [
|
|
40119
40100
|
/* @__PURE__ */ jsx130("h2", { className: "text-lg font-medium", "data-testid": "capture-thankyou", children: thanks.title ?? "Logged" }),
|
|
40120
40101
|
/* @__PURE__ */ jsx130("p", { className: "text-sm text-muted-foreground", children: done.queued ? "There is no signal, so this one is on the phone and goes up the moment there is. Nothing is lost." : thanks.body ?? "Ready for the next one." }),
|
|
40121
40102
|
/* @__PURE__ */ jsx130(Button99, { className: "h-12", onClick: () => setDone(null), "data-testid": "capture-next", children: "Next one" }),
|
|
@@ -40127,7 +40108,7 @@ function CaptureRun({ sheetId, face: given, className }) {
|
|
|
40127
40108
|
const field = fieldOf(q.field);
|
|
40128
40109
|
const control = controlFor(field);
|
|
40129
40110
|
const last = at >= questions.length - 1;
|
|
40130
|
-
return /* @__PURE__ */ jsxs121("section", { className:
|
|
40111
|
+
return /* @__PURE__ */ jsxs121("section", { className: cn68("mx-auto flex w-full max-w-sm flex-col gap-3 p-4", className), children: [
|
|
40131
40112
|
/* @__PURE__ */ jsxs121("div", { className: "flex items-center gap-2 text-[11px] text-muted-foreground", children: [
|
|
40132
40113
|
/* @__PURE__ */ jsxs121("span", { className: "tabular-nums", "data-testid": "capture-progress", children: [
|
|
40133
40114
|
at + 1,
|
|
@@ -40398,9 +40379,9 @@ function AdHocCaptureSheet({
|
|
|
40398
40379
|
}
|
|
40399
40380
|
if (table.error) return /* @__PURE__ */ jsx131(RefusalNotice, { error: table.error, onRetry: table.reload, className });
|
|
40400
40381
|
if (fields.error) return /* @__PURE__ */ jsx131(RefusalNotice, { error: fields.error, onRetry: fields.reload, className });
|
|
40401
|
-
if (fields.loading || pending === null) return /* @__PURE__ */ jsx131(Skeleton46, { className:
|
|
40382
|
+
if (fields.loading || pending === null) return /* @__PURE__ */ jsx131(Skeleton46, { className: cn69("h-64 w-full", className) });
|
|
40402
40383
|
const keys = resolved();
|
|
40403
|
-
return /* @__PURE__ */ jsxs122("section", { className:
|
|
40384
|
+
return /* @__PURE__ */ jsxs122("section", { className: cn69("mx-auto flex w-full max-w-sm flex-col gap-2", className), children: [
|
|
40404
40385
|
/* @__PURE__ */ jsxs122("header", { className: "flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
40405
40386
|
CAPTURE_MODES.map((m) => /* @__PURE__ */ jsx131(
|
|
40406
40387
|
Button100,
|
|
@@ -40505,7 +40486,7 @@ function AdHocCaptureSheet({
|
|
|
40505
40486
|
// src/PortalShell.tsx
|
|
40506
40487
|
import { useCallback as useCallback59, useEffect as useEffect107, useState as useState120 } from "react";
|
|
40507
40488
|
import { useRecordsClient as useRecordsClient99 } from "@ai-matrx/records/react";
|
|
40508
|
-
import { Button as Button101, Skeleton as Skeleton47, cn as
|
|
40489
|
+
import { Button as Button101, Skeleton as Skeleton47, cn as cn70 } from "@ai-matrx/design-system";
|
|
40509
40490
|
import { jsx as jsx132, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
40510
40491
|
function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
40511
40492
|
const client = useRecordsClient99();
|
|
@@ -40535,12 +40516,12 @@ function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
|
40535
40516
|
if (error) {
|
|
40536
40517
|
return /* @__PURE__ */ jsx132(RefusalNotice, { error, className });
|
|
40537
40518
|
}
|
|
40538
|
-
if (!card || reach === null) return /* @__PURE__ */ jsx132(Skeleton47, { className:
|
|
40519
|
+
if (!card || reach === null) return /* @__PURE__ */ jsx132(Skeleton47, { className: cn70("h-64 w-full", className) });
|
|
40539
40520
|
if (!card.external) {
|
|
40540
|
-
return /* @__PURE__ */ jsx132("p", { className:
|
|
40521
|
+
return /* @__PURE__ */ jsx132("p", { className: cn70("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: card.explanation || "You are a member of an organization here, so this portal is not yours \u2014 a portal is the scoped view an OUTSIDER gets. You have the full application instead." });
|
|
40541
40522
|
}
|
|
40542
40523
|
if (sending && form) {
|
|
40543
|
-
return /* @__PURE__ */ jsxs123("section", { className:
|
|
40524
|
+
return /* @__PURE__ */ jsxs123("section", { className: cn70("flex min-h-0 flex-col gap-2", className), children: [
|
|
40544
40525
|
/* @__PURE__ */ jsxs123("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
40545
40526
|
/* @__PURE__ */ jsx132("span", { className: "font-medium text-foreground", children: form.name }),
|
|
40546
40527
|
/* @__PURE__ */ jsx132(Button101, { size: "sm", variant: "ghost", className: "ml-auto h-6 px-2 text-[11px]", onClick: () => setSending(false), children: "Back" })
|
|
@@ -40558,9 +40539,9 @@ function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
|
40558
40539
|
] });
|
|
40559
40540
|
}
|
|
40560
40541
|
if (open) {
|
|
40561
|
-
return /* @__PURE__ */ jsx132("section", { className:
|
|
40542
|
+
return /* @__PURE__ */ jsx132("section", { className: cn70("flex min-h-0 flex-col gap-2", className), children: /* @__PURE__ */ jsx132(Peek2, { tableId, recordId: open, onClose: () => setOpen(null) }) });
|
|
40562
40543
|
}
|
|
40563
|
-
return /* @__PURE__ */ jsxs123("section", { className:
|
|
40544
|
+
return /* @__PURE__ */ jsxs123("section", { className: cn70("flex min-h-0 flex-col gap-2", className), children: [
|
|
40564
40545
|
/* @__PURE__ */ jsxs123("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
40565
40546
|
/* @__PURE__ */ jsx132("span", { className: "font-medium text-foreground", children: "Shared with you" }),
|
|
40566
40547
|
/* @__PURE__ */ jsx132("span", { className: "tabular-nums", children: reach.length }),
|
|
@@ -40611,7 +40592,7 @@ function PortalRow({ tableId, recordId }) {
|
|
|
40611
40592
|
// src/PublicViewPage.tsx
|
|
40612
40593
|
import { useCallback as useCallback60, useEffect as useEffect108, useState as useState121 } from "react";
|
|
40613
40594
|
import { useRecordsClient as useRecordsClient100 } from "@ai-matrx/records/react";
|
|
40614
|
-
import { Skeleton as Skeleton48, cn as
|
|
40595
|
+
import { Skeleton as Skeleton48, cn as cn71 } from "@ai-matrx/design-system";
|
|
40615
40596
|
import { publicReadOf } from "@ai-matrx/records/forms";
|
|
40616
40597
|
import { jsx as jsx133, jsxs as jsxs124 } from "react/jsx-runtime";
|
|
40617
40598
|
function PublicViewPage({ slug, className }) {
|
|
@@ -40676,15 +40657,15 @@ function PublicViewPage({ slug, className }) {
|
|
|
40676
40657
|
void load();
|
|
40677
40658
|
}, [load]);
|
|
40678
40659
|
if (error) return /* @__PURE__ */ jsx133(RefusalNotice, { error, className });
|
|
40679
|
-
if (binding === null) return /* @__PURE__ */ jsx133(Skeleton48, { className:
|
|
40660
|
+
if (binding === null) return /* @__PURE__ */ jsx133(Skeleton48, { className: cn71("h-64 w-full", className) });
|
|
40680
40661
|
if (binding === "none") {
|
|
40681
|
-
return /* @__PURE__ */ jsxs124("main", { className:
|
|
40662
|
+
return /* @__PURE__ */ jsxs124("main", { className: cn71("mx-auto max-w-2xl py-16 text-center", className), children: [
|
|
40682
40663
|
/* @__PURE__ */ jsx133("h1", { className: "text-lg font-medium", children: "Nothing here" }),
|
|
40683
40664
|
/* @__PURE__ */ jsx133("p", { className: "mt-1 text-sm text-muted-foreground", children: "There is no public page at this address." }),
|
|
40684
40665
|
gap ? /* @__PURE__ */ jsx133("p", { className: "mt-6 text-xs text-muted-foreground", children: gap }) : null
|
|
40685
40666
|
] });
|
|
40686
40667
|
}
|
|
40687
|
-
return /* @__PURE__ */ jsxs124("main", { className:
|
|
40668
|
+
return /* @__PURE__ */ jsxs124("main", { className: cn71("mx-auto flex max-w-2xl flex-col gap-3 py-8", className), children: [
|
|
40688
40669
|
/* @__PURE__ */ jsxs124("header", { className: "flex items-baseline gap-2 text-xs text-muted-foreground", children: [
|
|
40689
40670
|
/* @__PURE__ */ jsx133("span", { className: "font-medium text-foreground", children: binding.namespace ?? "Published" }),
|
|
40690
40671
|
/* @__PURE__ */ jsx133("span", { children: plan?.read === "table" || plan?.read === "view" ? `${rows?.length ?? 0} items` : "Shared publicly" })
|
|
@@ -40712,7 +40693,7 @@ function PublicRow({ row, fields }) {
|
|
|
40712
40693
|
import { copyText as copyText9 } from "@ai-matrx/kit/clipboard";
|
|
40713
40694
|
import { useCallback as useCallback61, useEffect as useEffect109, useState as useState122 } from "react";
|
|
40714
40695
|
import { useRecordsClient as useRecordsClient101 } from "@ai-matrx/records/react";
|
|
40715
|
-
import { Button as Button102, Input as Input10, Skeleton as Skeleton49, Textarea as Textarea8, cn as
|
|
40696
|
+
import { Button as Button102, Input as Input10, Skeleton as Skeleton49, Textarea as Textarea8, cn as cn72 } from "@ai-matrx/design-system";
|
|
40716
40697
|
import { useTable as useTable37 } from "@ai-matrx/records/react";
|
|
40717
40698
|
import { Fragment as Fragment55, jsx as jsx134, jsxs as jsxs125 } from "react/jsx-runtime";
|
|
40718
40699
|
function EmbedFrame({
|
|
@@ -40766,15 +40747,15 @@ function EmbedFrame({
|
|
|
40766
40747
|
setTokenId(null);
|
|
40767
40748
|
}, [client, tokenId]);
|
|
40768
40749
|
if (table.error) return /* @__PURE__ */ jsx134(RefusalNotice, { error: table.error, onRetry: table.reload, className });
|
|
40769
|
-
if (table.loading && !table.data) return /* @__PURE__ */ jsx134(Skeleton49, { className:
|
|
40750
|
+
if (table.loading && !table.data) return /* @__PURE__ */ jsx134(Skeleton49, { className: cn72("h-48 w-full", className) });
|
|
40770
40751
|
if (!rights.admin) {
|
|
40771
|
-
return /* @__PURE__ */ jsxs125("p", { className:
|
|
40752
|
+
return /* @__PURE__ */ jsxs125("p", { className: cn72("rounded border border-dashed px-2 py-1 text-xs text-muted-foreground", className), children: [
|
|
40772
40753
|
rights.why("structure"),
|
|
40773
40754
|
" Issuing an embed opens a way in from somebody else's website, so it needs Full access on this table."
|
|
40774
40755
|
] });
|
|
40775
40756
|
}
|
|
40776
40757
|
const snippet = secret ? `<iframe src="${embedUrl}#t=${secret}" style="width:100%;height:640px;border:0" loading="lazy"></iframe>` : null;
|
|
40777
|
-
return /* @__PURE__ */ jsxs125("section", { className:
|
|
40758
|
+
return /* @__PURE__ */ jsxs125("section", { className: cn72("flex min-h-0 flex-col gap-2", className), children: [
|
|
40778
40759
|
/* @__PURE__ */ jsxs125("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
40779
40760
|
/* @__PURE__ */ jsx134("span", { className: "font-medium text-foreground", children: "Embed" }),
|
|
40780
40761
|
/* @__PURE__ */ jsx134("span", { children: mode === "write" ? "a form people can send" : "a read-only view" })
|
|
@@ -40863,7 +40844,7 @@ import {
|
|
|
40863
40844
|
DropdownMenuTrigger as DropdownMenuTrigger9,
|
|
40864
40845
|
Input as Input12,
|
|
40865
40846
|
Skeleton as Skeleton50,
|
|
40866
|
-
cn as
|
|
40847
|
+
cn as cn74,
|
|
40867
40848
|
useIsMobile as useIsMobile2
|
|
40868
40849
|
} from "@ai-matrx/design-system";
|
|
40869
40850
|
import { humanizeIdentifier as humanizeIdentifier18 } from "@ai-matrx/kit/text-case";
|
|
@@ -41576,7 +41557,7 @@ function ViewFilter({ tableId, view, onApply, withheldKeys, className }) {
|
|
|
41576
41557
|
}
|
|
41577
41558
|
|
|
41578
41559
|
// src/PhoneTableActions.tsx
|
|
41579
|
-
import { DropdownMenu as DropdownMenu8, DropdownMenuContent as DropdownMenuContent8, DropdownMenuTrigger as DropdownMenuTrigger8, cn as
|
|
41560
|
+
import { DropdownMenu as DropdownMenu8, DropdownMenuContent as DropdownMenuContent8, DropdownMenuTrigger as DropdownMenuTrigger8, cn as cn73 } from "@ai-matrx/design-system";
|
|
41580
41561
|
import { jsx as jsx141, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
41581
41562
|
function PhoneActionRow({ action: action2, groupStart }) {
|
|
41582
41563
|
const disabled = action2.disabledReason !== void 0;
|
|
@@ -41590,7 +41571,7 @@ function PhoneActionRow({ action: action2, groupStart }) {
|
|
|
41590
41571
|
onClick: () => {
|
|
41591
41572
|
if (!disabled) void action2.run();
|
|
41592
41573
|
},
|
|
41593
|
-
className:
|
|
41574
|
+
className: cn73(
|
|
41594
41575
|
"flex min-h-11 w-full items-center gap-3 px-1 text-left text-base disabled:opacity-60",
|
|
41595
41576
|
groupStart && "border-t border-border pt-1",
|
|
41596
41577
|
action2.destructive && "text-destructive"
|
|
@@ -42011,7 +41992,7 @@ function RailFrame({
|
|
|
42011
41992
|
children: over ? /* @__PURE__ */ jsx143(
|
|
42012
41993
|
"div",
|
|
42013
41994
|
{
|
|
42014
|
-
className:
|
|
41995
|
+
className: cn74(
|
|
42015
41996
|
"fixed inset-y-0 right-0 z-40 overflow-y-auto border-l bg-background p-4 shadow-xl",
|
|
42016
41997
|
full ? "w-screen" : "w-[min(48rem,100vw)]"
|
|
42017
41998
|
),
|
|
@@ -42077,7 +42058,7 @@ function TableNotHere({
|
|
|
42077
42058
|
if (archived.phase === "asking") return /* @__PURE__ */ jsx143(Skeleton50, { className: "h-40 w-full" });
|
|
42078
42059
|
const row = archived.phase === "answered" ? archived.row : null;
|
|
42079
42060
|
if (row) {
|
|
42080
|
-
return /* @__PURE__ */ jsxs134("div", { className:
|
|
42061
|
+
return /* @__PURE__ */ jsxs134("div", { className: cn74("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
42081
42062
|
/* @__PURE__ */ jsx143("p", { className: "text-sm font-medium", children: "This table is archived" }),
|
|
42082
42063
|
/* @__PURE__ */ jsx143("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_IS_ARCHIVED }),
|
|
42083
42064
|
/* @__PURE__ */ jsx143("p", { className: "text-xs text-muted-foreground", children: archivedByLine2(row) }),
|
|
@@ -42106,7 +42087,7 @@ function TableNotHere({
|
|
|
42106
42087
|
] })
|
|
42107
42088
|
] });
|
|
42108
42089
|
}
|
|
42109
|
-
return /* @__PURE__ */ jsxs134("div", { className:
|
|
42090
|
+
return /* @__PURE__ */ jsxs134("div", { className: cn74("flex flex-col items-start gap-2 rounded-md border border-dashed p-6", className), children: [
|
|
42110
42091
|
/* @__PURE__ */ jsx143("p", { className: "text-sm font-medium", children: "This table is not here" }),
|
|
42111
42092
|
/* @__PURE__ */ jsx143("p", { className: "max-w-prose text-xs text-muted-foreground", children: TABLE_NOT_REACHABLE }),
|
|
42112
42093
|
onLeave ? /* @__PURE__ */ jsx143(Button108, { size: "sm", variant: "outline", onClick: onLeave, children: leaveLabel }) : null
|
|
@@ -43044,7 +43025,7 @@ function TablePage({
|
|
|
43044
43025
|
rights.write && view && Object.keys(viewPatchDocument(saveToViewPlan(view, look ?? {}).patch)).length > 0
|
|
43045
43026
|
);
|
|
43046
43027
|
return /* @__PURE__ */ jsxs134(ViewAddressContext.Provider, { value: addressPort, children: [
|
|
43047
|
-
/* @__PURE__ */ jsxs134("div", { className:
|
|
43028
|
+
/* @__PURE__ */ jsxs134("div", { className: cn74("flex h-full min-h-0 gap-4", className), "data-table-footer": footer, children: [
|
|
43048
43029
|
headerNode,
|
|
43049
43030
|
/* @__PURE__ */ jsx143("div", { className: "flex min-h-0 min-w-0 flex-1 flex-col gap-2", children: structure.hidden || !structure.settled ? (
|
|
43050
43031
|
/* THE TOOLBAR ROW'S HEIGHT IS KEPT (min-h-8), so the sentence lands exactly where the bar was. */
|
|
@@ -43098,7 +43079,7 @@ function TablePage({
|
|
|
43098
43079
|
role: "radio",
|
|
43099
43080
|
"aria-checked": footer === option,
|
|
43100
43081
|
"data-view-footer": option,
|
|
43101
|
-
className:
|
|
43082
|
+
className: cn74(
|
|
43102
43083
|
"flex min-h-7 items-center gap-2 rounded-sm px-1 text-left text-xs text-popover-foreground hover:bg-accent hover:text-accent-foreground",
|
|
43103
43084
|
footer === option && "font-medium"
|
|
43104
43085
|
),
|
|
@@ -43108,7 +43089,7 @@ function TablePage({
|
|
|
43108
43089
|
"span",
|
|
43109
43090
|
{
|
|
43110
43091
|
"aria-hidden": "true",
|
|
43111
|
-
className:
|
|
43092
|
+
className: cn74("h-2 w-2 shrink-0 rounded-full border border-current", footer === option && "bg-current")
|
|
43112
43093
|
}
|
|
43113
43094
|
),
|
|
43114
43095
|
FOOTER_WORDS[option]
|
|
@@ -43230,7 +43211,7 @@ function TablePage({
|
|
|
43230
43211
|
"div",
|
|
43231
43212
|
{
|
|
43232
43213
|
ref: setToolbarSlot,
|
|
43233
|
-
className:
|
|
43214
|
+
className: cn74(
|
|
43234
43215
|
// `min-w-9`: never narrower than the layout toolbar's folded "…" (36 px) — a row too
|
|
43235
43216
|
// narrow for its pinned controls folds them behind that "…" (design-system
|
|
43236
43217
|
// `usePinnedFold`), and the "…" itself is never cut (merged-grid leftovers, 2026-09-28).
|
|
@@ -43323,7 +43304,7 @@ function TablePage({
|
|
|
43323
43304
|
) : /* @__PURE__ */ jsx143(TableToolbarSlotContext.Provider, { value: toolbarSlot, children: /* @__PURE__ */ jsx143(TableToolbarFoldContext.Provider, { value: toolbarFold2, children: /* @__PURE__ */ jsx143(TableToolbarSheetExtrasContext.Provider, { value: sheetExtras, children: /* @__PURE__ */ jsx143(OpenRecordHereContext.Provider, { value: openHere, children: /* @__PURE__ */ jsxs134(
|
|
43324
43305
|
"div",
|
|
43325
43306
|
{
|
|
43326
|
-
className:
|
|
43307
|
+
className: cn74(
|
|
43327
43308
|
"min-h-0 flex-1",
|
|
43328
43309
|
// Inline: a plain scrolling block, so nothing in it shrinks to the height — the
|
|
43329
43310
|
// layout is as tall as its rows and the footer follows the last one.
|
|
@@ -43544,7 +43525,7 @@ import { formatCount as formatCount10 } from "@ai-matrx/kit/format";
|
|
|
43544
43525
|
import { TapTargetSearchGroup as TapTargetSearchGroup2, TooltipProvider as TooltipProvider2 } from "@ai-matrx/design-system";
|
|
43545
43526
|
import { MatrxTableCardShowMore as MatrxTableCardShowMore3 } from "@ai-matrx/design-system/data-table";
|
|
43546
43527
|
import { useEffect as useEffect115, useMemo as useMemo76, useRef as useRef54, useState as useState132 } from "react";
|
|
43547
|
-
import { Button as Button109, ErrorBox as ErrorBox5, Input as Input13, cn as
|
|
43528
|
+
import { Button as Button109, ErrorBox as ErrorBox5, Input as Input13, cn as cn75 } from "@ai-matrx/design-system";
|
|
43548
43529
|
import { SEED_FRESH_MS, useRecordsClient as useRecordsClient104, useSeededAnswerAt } from "@ai-matrx/records/react";
|
|
43549
43530
|
import { Fragment as Fragment58, jsx as jsx144, jsxs as jsxs135 } from "react/jsx-runtime";
|
|
43550
43531
|
var entityTitleColumn = entityNameColumn;
|
|
@@ -43582,14 +43563,14 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
43582
43563
|
const says = await entity.update(id, column, to);
|
|
43583
43564
|
if (says) setRefused({ to, says });
|
|
43584
43565
|
};
|
|
43585
|
-
return /* @__PURE__ */ jsx144("div", { className:
|
|
43566
|
+
return /* @__PURE__ */ jsx144("div", { className: cn75("flex min-h-40 gap-2 overflow-x-auto pb-1", className), "data-records-entity-board": column.key, children: lanes.map((lane) => {
|
|
43586
43567
|
const cards = rowsOf(lane.key);
|
|
43587
43568
|
if (lane.key === "" && cards.length === 0) return null;
|
|
43588
43569
|
return /* @__PURE__ */ jsxs135(
|
|
43589
43570
|
"section",
|
|
43590
43571
|
{
|
|
43591
43572
|
"aria-label": lane.label,
|
|
43592
|
-
className:
|
|
43573
|
+
className: cn75("flex w-60 shrink-0 flex-col gap-1.5 rounded-md bg-muted/40 p-1.5", over === lane.key && "ring-1 ring-ring"),
|
|
43593
43574
|
onDragOver: writable && lane.key ? (e) => {
|
|
43594
43575
|
e.preventDefault();
|
|
43595
43576
|
setOver(lane.key);
|
|
@@ -43610,7 +43591,7 @@ function EntityBoard({ entity, groupBy, cardFields, onOpenRecord, className }) {
|
|
|
43610
43591
|
e.dataTransfer.setData("text/x-entity-row", row._id);
|
|
43611
43592
|
e.dataTransfer.effectAllowed = "move";
|
|
43612
43593
|
},
|
|
43613
|
-
className:
|
|
43594
|
+
className: cn75("flex flex-col gap-0.5 rounded border bg-card px-2 py-1.5 text-xs shadow-sm", writable && "cursor-grab"),
|
|
43614
43595
|
"data-records-entity-card": row._id,
|
|
43615
43596
|
children: [
|
|
43616
43597
|
onOpenRecord ? /* @__PURE__ */ jsx144("button", { type: "button", className: "truncate text-left font-medium hover:underline", onClick: () => onOpenRecord(row._id), children: (title ? entityValueText(title, entityCellValue(row, title)) : shown3(row._id)) || "Untitled" }) : /* @__PURE__ */ jsx144("span", { className: "truncate font-medium", children: (title ? entityValueText(title, entityCellValue(row, title)) : shown3(row._id)) || "Untitled" }),
|
|
@@ -43731,7 +43712,7 @@ function EntityTablePageBody({
|
|
|
43731
43712
|
rowNoun: (entity.label ?? "record").toLowerCase(),
|
|
43732
43713
|
enabled: layout === "grid"
|
|
43733
43714
|
});
|
|
43734
|
-
return /* @__PURE__ */ jsxs135("div", { className:
|
|
43715
|
+
return /* @__PURE__ */ jsxs135("div", { className: cn75("flex min-w-0 flex-col gap-2", className), "data-records-entity-page": source.token, children: [
|
|
43735
43716
|
presentation === "page" || boardable || entity.creatable ? /* @__PURE__ */ jsxs135("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
43736
43717
|
presentation === "page" ? /* @__PURE__ */ jsx144("h2", { className: "truncate text-base font-semibold", children: entity.label ?? (entity.loading ? "Loading\u2026" : "Table") }) : null,
|
|
43737
43718
|
presentation === "page" ? /* @__PURE__ */ jsx144("span", { className: "text-xs tabular-nums text-muted-foreground", children: entity.loading || entity.total === null ? "" : formatCount10(entity.total) }) : null,
|
|
@@ -44013,7 +43994,7 @@ import {
|
|
|
44013
43994
|
SelectItem as SelectItem15,
|
|
44014
43995
|
SelectTrigger as SelectTrigger15,
|
|
44015
43996
|
SelectValue as SelectValue15,
|
|
44016
|
-
cn as
|
|
43997
|
+
cn as cn77
|
|
44017
43998
|
} from "@ai-matrx/design-system";
|
|
44018
43999
|
import { MessageSquareIcon, PlusIcon as PlusIcon2, StickyNoteIcon } from "@ai-matrx/design-system/icons";
|
|
44019
44000
|
import { readColorPair, readShadowPair, shadowWords } from "@ai-matrx/design-system/field-formats";
|
|
@@ -44035,7 +44016,7 @@ import {
|
|
|
44035
44016
|
SelectItem as SelectItem14,
|
|
44036
44017
|
SelectTrigger as SelectTrigger14,
|
|
44037
44018
|
SelectValue as SelectValue14,
|
|
44038
|
-
cn as
|
|
44019
|
+
cn as cn76
|
|
44039
44020
|
} from "@ai-matrx/design-system";
|
|
44040
44021
|
import { PlusIcon } from "@ai-matrx/design-system/icons";
|
|
44041
44022
|
|
|
@@ -44118,7 +44099,7 @@ function EntityValueCell({ row, column, editable, save }) {
|
|
|
44118
44099
|
}
|
|
44119
44100
|
if (kind2 === null) {
|
|
44120
44101
|
const words2 = textOf(row, column);
|
|
44121
|
-
return /* @__PURE__ */ jsx148("span", { className:
|
|
44102
|
+
return /* @__PURE__ */ jsx148("span", { className: cn76("block truncate text-sm", words2 ? "text-foreground" : "text-muted-foreground"), children: words2 || "\u2013" });
|
|
44122
44103
|
}
|
|
44123
44104
|
const label = `${column.label}`;
|
|
44124
44105
|
if (kind2 === "choice") {
|
|
@@ -44259,7 +44240,7 @@ function EntityAddDialog({
|
|
|
44259
44240
|
}
|
|
44260
44241
|
function EntitySectionCard(props) {
|
|
44261
44242
|
if (!useOptionalRecordsClient11()) {
|
|
44262
|
-
return /* @__PURE__ */ jsx148("section", { "data-records-section-card": "", className:
|
|
44243
|
+
return /* @__PURE__ */ jsx148("section", { "data-records-section-card": "", className: cn76("rounded-2xl border border-border bg-card px-5 py-5 text-sm text-muted-foreground sm:px-6", props.className), children: "This section cannot be shown here: the page has no connection to the data." });
|
|
44263
44244
|
}
|
|
44264
44245
|
return /* @__PURE__ */ jsx148(EntityDataScope, { children: /* @__PURE__ */ jsx148(EntitySectionBody, { ...props }) });
|
|
44265
44246
|
}
|
|
@@ -44280,7 +44261,7 @@ function EntitySectionBody(props) {
|
|
|
44280
44261
|
setFailed(said);
|
|
44281
44262
|
return said === null;
|
|
44282
44263
|
};
|
|
44283
|
-
return /* @__PURE__ */ jsxs138("section", { "data-records-section-card": "", "data-records-section-source": source.token, className:
|
|
44264
|
+
return /* @__PURE__ */ jsxs138("section", { "data-records-section-card": "", "data-records-section-source": source.token, className: cn76("rounded-2xl border border-border bg-card text-card-foreground", className), children: [
|
|
44284
44265
|
/* @__PURE__ */ jsxs138("header", { className: "flex items-start justify-between gap-4 px-5 pt-5 pb-3 sm:px-6", children: [
|
|
44285
44266
|
/* @__PURE__ */ jsxs138("div", { className: "min-w-0", children: [
|
|
44286
44267
|
/* @__PURE__ */ jsx148("h2", { className: "truncate font-serif text-2xl tracking-tight text-foreground", children: title || " " }),
|
|
@@ -44490,7 +44471,7 @@ function ValueCell({
|
|
|
44490
44471
|
const words2 = !layers ? "Set" : part === "dark" && !ownDark ? "Same as light" : shadowWords(layers);
|
|
44491
44472
|
const inner = /* @__PURE__ */ jsxs139("span", { className: "flex min-w-0 items-center gap-2", children: [
|
|
44492
44473
|
layers ? /* @__PURE__ */ jsx149(ShadowSwatch, { layers, theme: part }) : null,
|
|
44493
|
-
/* @__PURE__ */ jsx149("span", { className:
|
|
44474
|
+
/* @__PURE__ */ jsx149("span", { className: cn77("truncate text-xs", part === "dark" && !ownDark ? "text-muted-foreground" : "text-foreground"), children: words2 })
|
|
44494
44475
|
] });
|
|
44495
44476
|
return /* @__PURE__ */ jsxs139("div", { className: stacked ? "flex min-w-0 items-center gap-2" : "min-w-0 px-3", children: [
|
|
44496
44477
|
stacked ? /* @__PURE__ */ jsx149("span", { className: "w-9 shrink-0 text-xs text-muted-foreground", children: part === "light" ? "Light" : "Dark" }) : null,
|
|
@@ -44810,7 +44791,7 @@ function TableSectionCard(props) {
|
|
|
44810
44791
|
const sectionRef = useRef55(null);
|
|
44811
44792
|
const narrow = useNarrow2(sectionRef);
|
|
44812
44793
|
const cellLabel = (c) => c.part ? columns.filter((x) => x.field.key === c.field.key).map((x) => x.header).join(" \xB7 ") : c.header;
|
|
44813
|
-
return /* @__PURE__ */ jsxs139("section", { ref: sectionRef, "data-records-section-card": "", "data-narrow": narrow ? "" : void 0, className:
|
|
44794
|
+
return /* @__PURE__ */ jsxs139("section", { ref: sectionRef, "data-records-section-card": "", "data-narrow": narrow ? "" : void 0, className: cn77("rounded-2xl border border-border bg-card text-card-foreground", className), children: [
|
|
44814
44795
|
/* @__PURE__ */ jsxs139("header", { className: "flex items-start justify-between gap-4 px-5 pt-5 pb-3 sm:px-6", children: [
|
|
44815
44796
|
/* @__PURE__ */ jsxs139("div", { className: "min-w-0", children: [
|
|
44816
44797
|
/* @__PURE__ */ jsx149("h2", { className: "type-heading truncate text-foreground", children: title || "\xA0" }),
|
|
@@ -44818,13 +44799,13 @@ function TableSectionCard(props) {
|
|
|
44818
44799
|
] }),
|
|
44819
44800
|
mayWrite && nameField ? /* @__PURE__ */ jsx149(Button112, { type: "button", variant: "outline", icon: /* @__PURE__ */ jsx149(PlusIcon2, {}), onClick: () => setAdding(groups[groups.length - 1]?.key ?? UNGROUPED2), children: "Add" }) : null
|
|
44820
44801
|
] }),
|
|
44821
|
-
refused ? /* @__PURE__ */ jsx149("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: refusalSentence(refused) }) : !fieldsRead.data || page.loading && rows.length === 0 ? /* @__PURE__ */ jsx149("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx149("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ jsx149(SectionEmpty, { empty: props.empty }) : /* @__PURE__ */ jsx149("div", { className:
|
|
44802
|
+
refused ? /* @__PURE__ */ jsx149("p", { className: "px-5 pb-5 text-sm text-muted-foreground sm:px-6", children: refusalSentence(refused) }) : !fieldsRead.data || page.loading && rows.length === 0 ? /* @__PURE__ */ jsx149("div", { className: "flex flex-col gap-1.5 px-5 pb-5 sm:px-6", "aria-busy": "true", children: [0, 1, 2].map((i) => /* @__PURE__ */ jsx149("div", { className: "h-9 rounded-md bg-muted" }, i)) }) : rows.length === 0 ? /* @__PURE__ */ jsx149(SectionEmpty, { empty: props.empty }) : /* @__PURE__ */ jsx149("div", { className: cn77("-mb-px", !narrow && "overflow-x-auto"), children: groups.map((group) => /* @__PURE__ */ jsxs139("div", { "data-records-section-group": group.key, className: "", children: [
|
|
44822
44803
|
cols.group ? /* @__PURE__ */ jsxs139("div", { className: "flex items-center justify-between border-y border-border px-5 py-1 sm:px-6", children: [
|
|
44823
44804
|
/* @__PURE__ */ jsx149("span", { className: "text-xs font-semibold text-foreground", children: group.key || "No group" }),
|
|
44824
44805
|
mayWrite ? /* @__PURE__ */ jsx149(Button112, { type: "button", variant: "quiet", icon: /* @__PURE__ */ jsx149(PlusIcon2, {}), "aria-label": `Add to ${group.key || "no group"}`, onClick: () => setAdding(group.key) }) : null
|
|
44825
44806
|
] }) : null,
|
|
44826
44807
|
/* @__PURE__ */ jsxs139("div", { role: "table", "aria-label": group.key || title, className: narrow ? "" : "min-w-[36rem]", children: [
|
|
44827
|
-
/* @__PURE__ */ jsxs139("div", { role: "row", style: gridStyle, className:
|
|
44808
|
+
/* @__PURE__ */ jsxs139("div", { role: "row", style: gridStyle, className: cn77("grid border-b border-border text-xs text-muted-foreground", narrow && "hidden"), children: [
|
|
44828
44809
|
/* @__PURE__ */ jsx149("span", { role: "columnheader", className: "border-r border-border px-5 py-1.5 sm:px-6", children: nameField ? fieldName(nameField) : "Name" }),
|
|
44829
44810
|
columns.map((c) => /* @__PURE__ */ jsx149("span", { role: "columnheader", className: "truncate px-3 py-1.5", children: c.header }, `${c.field.key}-${c.part ?? ""}`)),
|
|
44830
44811
|
/* @__PURE__ */ jsx149("span", {})
|
|
@@ -44859,7 +44840,7 @@ function TableSectionCard(props) {
|
|
|
44859
44840
|
{
|
|
44860
44841
|
role: "cell",
|
|
44861
44842
|
style: c.part ? { gridColumn: "span 2" } : void 0,
|
|
44862
|
-
className: narrow ? "min-w-0" :
|
|
44843
|
+
className: narrow ? "min-w-0" : cn77("min-w-0 py-1", c.part ? "" : "px-3"),
|
|
44863
44844
|
children: [
|
|
44864
44845
|
narrow && !c.part ? /* @__PURE__ */ jsx149("span", { className: "mb-0.5 block text-xs text-muted-foreground", children: cellLabel(c) }) : null,
|
|
44865
44846
|
/* @__PURE__ */ jsx149(
|