@ai-matrx/records-ui 0.115.108 → 0.116.1
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 +28 -1
- package/dist/SaveToTable-3VDK4U5M.js +20 -0
- package/dist/{chunk-W3EU7H4V.js → chunk-42VA6SWA.js} +93 -512
- package/dist/chunk-42VA6SWA.js.map +1 -0
- package/dist/chunk-B5S5F5NH.js +445 -0
- package/dist/chunk-B5S5F5NH.js.map +1 -0
- package/dist/chunk-IUUZVQZD.js +95 -0
- package/dist/chunk-IUUZVQZD.js.map +1 -0
- package/dist/{chunk-6NSGVKYL.js → chunk-NJYJEAQC.js} +1 -91
- package/dist/chunk-NJYJEAQC.js.map +1 -0
- package/dist/{chunk-VGNQBI2J.js → chunk-QRZ4RW2T.js} +56 -31
- package/dist/chunk-QRZ4RW2T.js.map +1 -0
- package/dist/chunk-SPPATZSR.js +288 -0
- package/dist/chunk-SPPATZSR.js.map +1 -0
- package/dist/{chunk-W5SOKJ5P.js → chunk-TNIC2SGW.js} +5 -3
- package/dist/{chunk-W5SOKJ5P.js.map → chunk-TNIC2SGW.js.map} +1 -1
- package/dist/{chunk-4U2JCICC.js → chunk-VCAOXQ5K.js} +2 -283
- package/dist/chunk-VCAOXQ5K.js.map +1 -0
- package/dist/chunk-Z6WTP467.js +245 -0
- package/dist/chunk-Z6WTP467.js.map +1 -0
- package/dist/first-page.cjs.map +1 -1
- package/dist/first-page.js.map +1 -1
- package/dist/helpers.cjs +813 -8
- package/dist/helpers.cjs.map +1 -1
- package/dist/helpers.d.cts +478 -4
- package/dist/helpers.d.ts +478 -4
- package/dist/helpers.js +755 -10
- package/dist/helpers.js.map +1 -1
- package/dist/index.cjs +4610 -3878
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +357 -175
- package/dist/index.d.ts +357 -175
- package/dist/index.js +5891 -5405
- package/dist/index.js.map +1 -1
- package/dist/object-actions.js +3 -2
- package/dist/pickers.cjs +111 -72
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +6 -3
- package/dist/skeleton.cjs +261 -0
- package/dist/skeleton.cjs.map +1 -0
- package/dist/skeleton.d.cts +50 -0
- package/dist/skeleton.d.ts +50 -0
- package/dist/skeleton.js +26 -0
- package/dist/skeleton.js.map +1 -0
- package/package.json +16 -5
- package/dist/SaveToTable-V3R7QVKV.js +0 -18
- package/dist/chunk-4U2JCICC.js.map +0 -1
- package/dist/chunk-6NSGVKYL.js.map +0 -1
- package/dist/chunk-VGNQBI2J.js.map +0 -1
- package/dist/chunk-W3EU7H4V.js.map +0 -1
- /package/dist/{SaveToTable-V3R7QVKV.js.map → SaveToTable-3VDK4U5M.js.map} +0 -0
package/dist/pickers.js
CHANGED
|
@@ -17,10 +17,13 @@ import {
|
|
|
17
17
|
isCompleteDataBinding,
|
|
18
18
|
isDataBinding,
|
|
19
19
|
useTablesAnywhere
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-42VA6SWA.js";
|
|
21
|
+
import "./chunk-B5S5F5NH.js";
|
|
22
|
+
import "./chunk-VCAOXQ5K.js";
|
|
22
23
|
import "./chunk-TIZHA6VK.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-IUUZVQZD.js";
|
|
25
|
+
import "./chunk-SPPATZSR.js";
|
|
26
|
+
import "./chunk-NJYJEAQC.js";
|
|
24
27
|
import "./chunk-HKYEHBQT.js";
|
|
25
28
|
export {
|
|
26
29
|
ColumnValuesEditor,
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use strict";
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
+
|
|
21
|
+
// src/skeletonEntry.ts
|
|
22
|
+
var skeletonEntry_exports = {};
|
|
23
|
+
__export(skeletonEntry_exports, {
|
|
24
|
+
RECORDS_GRID_ROW_PX: () => RECORDS_GRID_ROW_PX,
|
|
25
|
+
RECORDS_SKELETON_LAYOUTS: () => RECORDS_SKELETON_LAYOUTS,
|
|
26
|
+
RecordsSkeleton: () => RecordsSkeleton,
|
|
27
|
+
TABLE_TOOLBAR_ROW_CLASS: () => TABLE_TOOLBAR_ROW_CLASS,
|
|
28
|
+
TablePageSkeleton: () => TablePageSkeleton,
|
|
29
|
+
skeletonLayoutFor: () => skeletonLayoutFor,
|
|
30
|
+
useRememberedLayout: () => useRememberedLayout,
|
|
31
|
+
useRememberedPageRows: () => useRememberedPageRows
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(skeletonEntry_exports);
|
|
34
|
+
|
|
35
|
+
// src/RecordsSkeleton.tsx
|
|
36
|
+
var import_react2 = require("react");
|
|
37
|
+
var import_design_system = require("@ai-matrx/design-system");
|
|
38
|
+
var import_data_table = require("@ai-matrx/design-system/data-table");
|
|
39
|
+
|
|
40
|
+
// src/embeddedLook.tsx
|
|
41
|
+
var import_react = require("react");
|
|
42
|
+
var EmbeddedLookContext = (0, import_react.createContext)(null);
|
|
43
|
+
var EmbeddedLookProvider = EmbeddedLookContext.Provider;
|
|
44
|
+
var EMBEDDED_TABLE_CLASS = [
|
|
45
|
+
"[&_tbody_td]:h-10",
|
|
46
|
+
"[&_tbody_td]:align-middle!",
|
|
47
|
+
"[&_tbody_td]:border-r",
|
|
48
|
+
"[&_tbody_td]:border-border",
|
|
49
|
+
"[&_tbody_td:last-child]:border-r-0",
|
|
50
|
+
"[&_thead_th]:border-r",
|
|
51
|
+
"[&_thead_th]:border-border",
|
|
52
|
+
"[&_thead_th:last-child]:border-r-0"
|
|
53
|
+
].join(" ");
|
|
54
|
+
var EMBEDDED_PLAIN_FOOTER_CLASS = "[&_tfoot]:bg-transparent [&_tfoot]:border-t-0";
|
|
55
|
+
|
|
56
|
+
// src/rememberedRows.ts
|
|
57
|
+
var PREFIX = "records-ui:rows:";
|
|
58
|
+
var MAX = 100;
|
|
59
|
+
function storage() {
|
|
60
|
+
try {
|
|
61
|
+
return typeof window !== "undefined" && window.localStorage ? window.localStorage : null;
|
|
62
|
+
} catch {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function rememberedRowCount(key, cap, fallback) {
|
|
67
|
+
const held = storage()?.getItem(PREFIX + key);
|
|
68
|
+
const n = held == null ? NaN : Number(held);
|
|
69
|
+
if (!Number.isFinite(n) || n < 0) return fallback;
|
|
70
|
+
return Math.max(1, Math.min(cap, MAX, Math.round(n)));
|
|
71
|
+
}
|
|
72
|
+
var LAYOUT_PREFIX = "records-ui:layout:";
|
|
73
|
+
function rememberedLayout(tableId) {
|
|
74
|
+
const held = storage()?.getItem(LAYOUT_PREFIX + tableId);
|
|
75
|
+
return held && /^[a-z_-]{2,24}$/.test(held) ? held : null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// src/skeletonLayout.ts
|
|
79
|
+
var RECORDS_SKELETON_LAYOUTS = [
|
|
80
|
+
"grid",
|
|
81
|
+
"kanban",
|
|
82
|
+
"gallery",
|
|
83
|
+
"list",
|
|
84
|
+
"calendar",
|
|
85
|
+
"timeline",
|
|
86
|
+
"map",
|
|
87
|
+
"orgchart",
|
|
88
|
+
"form",
|
|
89
|
+
"record",
|
|
90
|
+
"chart",
|
|
91
|
+
"home"
|
|
92
|
+
];
|
|
93
|
+
function skeletonLayoutFor(layout) {
|
|
94
|
+
if (layout === "board" || layout === "pipeline") return "kanban";
|
|
95
|
+
return RECORDS_SKELETON_LAYOUTS.includes(layout ?? "") ? layout : "grid";
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// src/RecordsSkeleton.tsx
|
|
99
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
100
|
+
var NEVER = () => () => {
|
|
101
|
+
};
|
|
102
|
+
function useRememberedPageRows(tableId) {
|
|
103
|
+
return (0, import_react2.useSyncExternalStore)(
|
|
104
|
+
NEVER,
|
|
105
|
+
() => tableId ? rememberedRowCount(`${tableId}:page:last`, 100, "fill") : "fill",
|
|
106
|
+
() => "fill"
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
function useRememberedLayout(tableId) {
|
|
110
|
+
return (0, import_react2.useSyncExternalStore)(
|
|
111
|
+
NEVER,
|
|
112
|
+
() => tableId ? rememberedLayout(tableId) : null,
|
|
113
|
+
() => null
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
var SPATIAL_LAYOUT_BOX = "h-[60vh] min-h-[22rem]";
|
|
117
|
+
var TABLE_TOOLBAR_ROW_CLASS = "flex min-h-8 min-w-0 shrink-0 flex-nowrap items-center gap-1.5 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
118
|
+
var TABLE_PAGE_FRAME_CLASS = "flex h-full min-h-0 gap-4";
|
|
119
|
+
var TABLE_PAGE_COLUMN_CLASS = "flex min-h-0 min-w-0 flex-1 flex-col gap-2";
|
|
120
|
+
var PLACEHOLDER_COLUMNS = ["a", "b", "c", "d", "e", "f"].map((id) => ({
|
|
121
|
+
id,
|
|
122
|
+
header: "",
|
|
123
|
+
accessorFn: () => ""
|
|
124
|
+
}));
|
|
125
|
+
var NO_ROWS = [];
|
|
126
|
+
function GridSkeleton({ embedded, rows }) {
|
|
127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
128
|
+
import_data_table.MatrxDataTable,
|
|
129
|
+
{
|
|
130
|
+
...embedded ? {} : { className: "min-h-0 flex-1" },
|
|
131
|
+
data: NO_ROWS,
|
|
132
|
+
columns: PLACEHOLDER_COLUMNS,
|
|
133
|
+
getRowId: (r) => r.id,
|
|
134
|
+
isLoading: true,
|
|
135
|
+
density: "condensed",
|
|
136
|
+
loadingRowHeight: RECORDS_GRID_ROW_PX,
|
|
137
|
+
hideToolbar: true,
|
|
138
|
+
viewTabs: false,
|
|
139
|
+
stickyHeader: true,
|
|
140
|
+
frameHeight: embedded ? "content" : "fill",
|
|
141
|
+
loadingRows: rows,
|
|
142
|
+
copy: false,
|
|
143
|
+
...embedded ? {
|
|
144
|
+
appearance: "embedded",
|
|
145
|
+
hidePagination: true,
|
|
146
|
+
tableClassName: (0, import_design_system.cn)(EMBEDDED_TABLE_CLASS, EMBEDDED_PLAIN_FOOTER_CLASS)
|
|
147
|
+
} : {}
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
var CHART_PLOT_PX = 140;
|
|
152
|
+
var RECORDS_GRID_ROW_PX = 35;
|
|
153
|
+
function Cards({ count, className }) {
|
|
154
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "block", className }, i)) });
|
|
155
|
+
}
|
|
156
|
+
function BodySkeleton({ layout, embedded, rows }) {
|
|
157
|
+
const lineCount = rows === "fill" ? 12 : rows;
|
|
158
|
+
switch (layout) {
|
|
159
|
+
case "grid":
|
|
160
|
+
case "home":
|
|
161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GridSkeleton, { embedded, rows });
|
|
162
|
+
case "kanban":
|
|
163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex min-h-0 flex-1 gap-2 overflow-hidden pb-2", "data-records-skeleton-part": "body", children: Array.from({ length: 4 }, (_, c) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex w-64 shrink-0 flex-col gap-2 rounded-lg bg-muted/40 p-2", children: [
|
|
164
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: "1/2", className: "my-1.5" }),
|
|
165
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Cards, { count: 3 - c % 2, className: "h-24" })
|
|
166
|
+
] }, c)) });
|
|
167
|
+
case "gallery":
|
|
168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
169
|
+
"div",
|
|
170
|
+
{
|
|
171
|
+
className: "grid min-h-0 flex-1 auto-rows-min grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-3 overflow-hidden",
|
|
172
|
+
"data-records-skeleton-part": "body",
|
|
173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Cards, { count: 8, className: "h-48" })
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
case "list":
|
|
177
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden", "data-records-skeleton-part": "body", children: Array.from({ length: lineCount }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex h-9 items-center gap-3 border-b border-border/60 px-2", children: [
|
|
178
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { className: "size-4" }),
|
|
179
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: i % 3 === 0 ? "1/2" : i % 3 === 1 ? "2/3" : "1/3" })
|
|
180
|
+
] }, i)) });
|
|
181
|
+
case "calendar":
|
|
182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col gap-2 overflow-hidden", "data-records-skeleton-part": "body", children: [
|
|
183
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-7 gap-px", children: Array.from({ length: 7 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: "1/3", className: "mx-auto my-1" }, i)) }),
|
|
184
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid flex-1 grid-cols-7 grid-rows-5 gap-px overflow-hidden rounded-md border border-border bg-border", children: Array.from({ length: 35 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-card p-1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: "1/3" }) }, i)) })
|
|
185
|
+
] });
|
|
186
|
+
case "timeline":
|
|
187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border border-border", "data-records-skeleton-part": "body", children: [
|
|
188
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-9 items-center gap-6 border-b border-border px-3", children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: "sm", className: "w-16" }, i)) }),
|
|
189
|
+
Array.from({ length: Math.min(lineCount, 8) }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-10 items-center border-b border-border/60 px-3", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { className: "h-6 rounded-md", style: { marginLeft: `${i * 13 % 45}%`, width: `${20 + i * 7 % 25}%` } }) }, i))
|
|
190
|
+
] });
|
|
191
|
+
case "map":
|
|
192
|
+
case "orgchart":
|
|
193
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { className: `w-full rounded-md ${SPATIAL_LAYOUT_BOX}`, "data-records-skeleton-part": "body" });
|
|
194
|
+
case "record":
|
|
195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col gap-2 overflow-hidden", "data-records-skeleton-part": "body", children: [
|
|
196
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "title", width: "1/2", className: "h-8", "data-records-skeleton-part": "title" }),
|
|
197
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex h-[38px] items-center gap-2", "data-records-skeleton-part": "actions", children: [
|
|
198
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", width: "sm", className: "h-8" }),
|
|
199
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", width: "sm", className: "h-8" })
|
|
200
|
+
] }),
|
|
201
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-px w-full shrink-0 bg-border" }),
|
|
202
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-0.5", "data-records-skeleton-part": "fields", children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "contents", children: [
|
|
203
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: "2/3", className: "my-[7px]" }),
|
|
204
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "row", className: "h-7" })
|
|
205
|
+
] }, i)) }),
|
|
206
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "block", height: "lg" })
|
|
207
|
+
] });
|
|
208
|
+
case "form":
|
|
209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex min-h-0 flex-1 flex-col gap-4 overflow-hidden", "data-records-skeleton-part": "body", children: [
|
|
210
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "title", width: "1/2" }),
|
|
211
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-1.5", children: Array.from({ length: 6 }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "contents", children: [
|
|
212
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: "2/3", className: "my-1.5" }),
|
|
213
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "row", className: "h-7" })
|
|
214
|
+
] }, i)) }),
|
|
215
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", width: "sm" })
|
|
216
|
+
] });
|
|
217
|
+
case "chart":
|
|
218
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col gap-2", "data-records-skeleton-part": "body", children: [
|
|
219
|
+
embedded ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "line", width: "1/3" }),
|
|
220
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "block", style: { height: CHART_PLOT_PX } })
|
|
221
|
+
] });
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
function RecordsSkeleton({ layout = "grid", embedded = false, rows, className }) {
|
|
225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
226
|
+
"div",
|
|
227
|
+
{
|
|
228
|
+
role: "status",
|
|
229
|
+
"aria-label": "Loading",
|
|
230
|
+
"aria-busy": "true",
|
|
231
|
+
"data-records-skeleton": layout,
|
|
232
|
+
className: (0, import_design_system.cn)("flex min-h-0 flex-col", !embedded && "flex-1", className),
|
|
233
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(BodySkeleton, { layout, embedded, rows: rows ?? (embedded ? 5 : "fill") })
|
|
234
|
+
}
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
function TablePageSkeleton({
|
|
238
|
+
layout: layoutAsked,
|
|
239
|
+
embedded = false,
|
|
240
|
+
rows,
|
|
241
|
+
tableId,
|
|
242
|
+
className
|
|
243
|
+
}) {
|
|
244
|
+
const remembered = useRememberedPageRows(embedded ? void 0 : tableId);
|
|
245
|
+
const rememberedFace = useRememberedLayout(embedded || layoutAsked ? void 0 : tableId);
|
|
246
|
+
const layout = layoutAsked ?? skeletonLayoutFor(rememberedFace);
|
|
247
|
+
const painted = rows ?? (remembered === "fill" ? void 0 : remembered);
|
|
248
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_design_system.cn)(TABLE_PAGE_FRAME_CLASS, className), "data-records-skeleton-page": layout, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: TABLE_PAGE_COLUMN_CLASS, children: [
|
|
249
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: TABLE_TOOLBAR_ROW_CLASS, "data-table-toolbar": "", "data-records-skeleton-part": "toolbar", "aria-hidden": "true", children: [
|
|
250
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", width: "sm", className: "w-28" }),
|
|
251
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", className: "w-16" }),
|
|
252
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", className: "w-16" }),
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "ml-auto flex items-center gap-1.5", children: [
|
|
254
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", width: "md" }),
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_design_system.Skeleton, { shape: "control", className: "w-24" })
|
|
256
|
+
] })
|
|
257
|
+
] }),
|
|
258
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex min-h-0 flex-1 flex-col gap-2", "data-table-records": "", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RecordsSkeleton, { layout, embedded, ...painted !== void 0 ? { rows: painted } : {} }) })
|
|
259
|
+
] }) });
|
|
260
|
+
}
|
|
261
|
+
//# sourceMappingURL=skeleton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/skeletonEntry.ts","../src/RecordsSkeleton.tsx","../src/embeddedLook.tsx","../src/rememberedRows.ts","../src/skeletonLayout.ts"],"sourcesContent":["// src/skeletonEntry.ts — @ai-matrx/records-ui/skeleton · the loading frames, without the screens\n//\n// THE FRONT DOOR'S LOADING FRAME (records-ui front door, 2026-10-16). matrx-frontend reaches the\n// root (every screen, ~1.85 MB) through one lazy edge, and while that chunk is out a surface paints\n// its skeleton. The skeleton must not need the root, or the frame that stands for a screen would\n// load the screen. This entry is in the split client group, so it shares its modules (one copy of\n// `RecordsSkeleton.tsx`) with the root and reaches only React and the design system's data table.\n\nexport {\n RecordsSkeleton,\n TablePageSkeleton,\n useRememberedPageRows,\n useRememberedLayout,\n RECORDS_SKELETON_LAYOUTS,\n RECORDS_GRID_ROW_PX,\n TABLE_TOOLBAR_ROW_CLASS,\n skeletonLayoutFor,\n} from \"./RecordsSkeleton\";\nexport type { RecordsSkeletonLayout, RecordsSkeletonProps } from \"./RecordsSkeleton\";\n","/**\n * THE LOADING FRAME OF EVERY RECORDS SURFACE (lane STABLE-TABLES).\n *\n * Arman, 2026-10-06: \"The tables do not properly show a loading state so they are jumpy … They\n * must properly show skeletons and they should not cause shifts … all must have proper loading,\n * empty state, etc.\" Measured before this file: a table page went route placeholder → a line of\n * text → a 160px grey box → a grid frame with 23px rows and its footer under them → the real grid\n * with 35px rows and its footer 580px lower. Four frames, four geometries.\n *\n * ONE skeleton per surface, chosen by a named option, drawn in the frame the loaded surface uses:\n * · the toolbar row is the page's own toolbar row (`TABLE_TOOLBAR_ROW_CLASS`), at its height;\n * · `grid` is the data table itself in its loading state — the same header, the same row\n * height, the same pinned footer — so its geometry is the loaded grid's by construction;\n * · `kanban`, `gallery`, `list`, `calendar`, `timeline` paint their columns, cards, rows or\n * cells where the loaded layout puts them;\n * · `form` and `record` paint the field stack and the body; `chart` reserves the chart's box.\n *\n * THE COUNT WHEN NOBODY KNOWS IT. A page frame fills to its edge (Airtable's rule: the grid never\n * starts short and grows); an embedded frame paints the rows the table had last time, else five\n * (Notion's inline database paints a short run) — see `rememberedRows.ts`.\n *\n * Hosts never style a placeholder of their own: they render this, with a layout.\n */\n\nimport { useSyncExternalStore } from \"react\";\nimport { cn, Skeleton } from \"@ai-matrx/design-system\";\nimport { MatrxDataTable, type MatrxColumnDef } from \"@ai-matrx/design-system/data-table\";\n\nimport { EMBEDDED_PLAIN_FOOTER_CLASS, EMBEDDED_TABLE_CLASS } from \"./embeddedLook\";\nimport { rememberedLayout, rememberedRowCount } from \"./rememberedRows\";\nimport { skeletonLayoutFor, type RecordsSkeletonLayout } from \"./skeletonLayout\";\n\n// The layout words and their chooser are pure, so `/helpers` carries them too (records-ui front door, 2026-10-16).\nexport { RECORDS_SKELETON_LAYOUTS, skeletonLayoutFor, type RecordsSkeletonLayout } from \"./skeletonLayout\";\n\nconst NEVER = () => () => {};\n\n/**\n * THE ROWS A TABLE PAGE PAINTED LAST VISIT, for a frame drawn before the table is known (the\n * route's own loading frame, the page's first-read frame). The server render and the first client\n * paint agree (\"fill\"); a browser that remembers the table then settles on its count with no\n * hydration mismatch. The key is the one the grid writes (`<tableId>:page:last`).\n */\nexport function useRememberedPageRows(tableId: string | undefined): number | \"fill\" {\n return useSyncExternalStore(\n NEVER,\n () => (tableId ? rememberedRowCount(`${tableId}:page:last`, 100, \"fill\" as const) : \"fill\"),\n () => \"fill\" as const,\n );\n}\n\n/**\n * THE LAYOUT A TABLE PAGE SETTLED ON LAST VISIT (null before a browser remembers one, and on the\n * server). Server render and first client paint agree (null); a browser that remembers the table\n * then settles on its layout with no hydration mismatch.\n */\nexport function useRememberedLayout(tableId: string | undefined): string | null {\n return useSyncExternalStore(\n NEVER,\n () => (tableId ? rememberedLayout(tableId) : null),\n () => null,\n );\n}\n\n/** The box a map or an org chart reserves from the first frame: the skeleton and the loaded layout share it. */\nexport const SPATIAL_LAYOUT_BOX = \"h-[60vh] min-h-[22rem]\";\n\n/**\n * THE TABLE PAGE'S TOOLBAR ROW — one class for the loaded row and its skeleton, so the two are\n * the same height from the first frame (`min-h-8`: the row's 32px buttons; a chip that arrives\n * later can never make it taller or shorter).\n */\nexport const TABLE_TOOLBAR_ROW_CLASS =\n \"flex min-h-8 min-w-0 shrink-0 flex-nowrap items-center gap-1.5 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\";\n\n/** The table page's frame: the same two boxes `TablePage` draws round its toolbar and records. */\nexport const TABLE_PAGE_FRAME_CLASS = \"flex h-full min-h-0 gap-4\";\nexport const TABLE_PAGE_COLUMN_CLASS = \"flex min-h-0 min-w-0 flex-1 flex-col gap-2\";\n\ntype Row = { id: string };\nconst PLACEHOLDER_COLUMNS: MatrxColumnDef<Row>[] = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\"].map((id) => ({\n id,\n header: \"\",\n accessorFn: () => \"\",\n}));\nconst NO_ROWS: Row[] = [];\n\n/**\n * THE GRID'S SKELETON IS THE GRID. The data table in its loading state, with the records grid's\n * own row height (35px: the condensed row round its 32px action strip), header and footer.\n */\nfunction GridSkeleton({ embedded, rows }: { embedded: boolean; rows: number | \"fill\" }) {\n return (\n <MatrxDataTable<Row>\n {...(embedded ? {} : { className: \"min-h-0 flex-1\" })}\n data={NO_ROWS}\n columns={PLACEHOLDER_COLUMNS}\n getRowId={(r) => r.id}\n isLoading\n density=\"condensed\"\n loadingRowHeight={RECORDS_GRID_ROW_PX}\n hideToolbar\n viewTabs={false}\n stickyHeader\n frameHeight={embedded ? \"content\" : \"fill\"}\n loadingRows={rows}\n copy={false}\n {...(embedded\n ? {\n appearance: \"embedded\" as const,\n hidePagination: true,\n tableClassName: cn(EMBEDDED_TABLE_CLASS, EMBEDDED_PLAIN_FOOTER_CLASS),\n }\n : {})}\n />\n );\n}\n\n/** A chart block's plot height (`ChartBlock`'s HEIGHT): the box a chart skeleton reserves. */\nexport const CHART_PLOT_PX = 140;\n\n/** The records grid's row: condensed, round the 32px row action strip, plus its rule. */\nexport const RECORDS_GRID_ROW_PX = 35;\n\nfunction Cards({ count, className }: { count: number; className: string }) {\n return (\n <>\n {Array.from({ length: count }, (_, i) => (\n <Skeleton key={i} shape=\"block\" className={className} />\n ))}\n </>\n );\n}\n\nfunction BodySkeleton({ layout, embedded, rows }: { layout: RecordsSkeletonLayout; embedded: boolean; rows: number | \"fill\" }) {\n const lineCount = rows === \"fill\" ? 12 : rows;\n switch (layout) {\n case \"grid\":\n case \"home\":\n return <GridSkeleton embedded={embedded} rows={rows} />;\n case \"kanban\":\n return (\n <div className=\"flex min-h-0 flex-1 gap-2 overflow-hidden pb-2\" data-records-skeleton-part=\"body\">\n {Array.from({ length: 4 }, (_, c) => (\n <div key={c} className=\"flex w-64 shrink-0 flex-col gap-2 rounded-lg bg-muted/40 p-2\">\n <Skeleton shape=\"line\" width=\"1/2\" className=\"my-1.5\" />\n <Cards count={3 - (c % 2)} className=\"h-24\" />\n </div>\n ))}\n </div>\n );\n case \"gallery\":\n return (\n <div\n className=\"grid min-h-0 flex-1 auto-rows-min grid-cols-[repeat(auto-fill,minmax(14rem,1fr))] gap-3 overflow-hidden\"\n data-records-skeleton-part=\"body\"\n >\n <Cards count={8} className=\"h-48\" />\n </div>\n );\n case \"list\":\n return (\n <div className=\"flex min-h-0 flex-1 flex-col overflow-hidden\" data-records-skeleton-part=\"body\">\n {Array.from({ length: lineCount }, (_, i) => (\n <div key={i} className=\"flex h-9 items-center gap-3 border-b border-border/60 px-2\">\n <Skeleton className=\"size-4\" />\n <Skeleton shape=\"line\" width={i % 3 === 0 ? \"1/2\" : i % 3 === 1 ? \"2/3\" : \"1/3\"} />\n </div>\n ))}\n </div>\n );\n case \"calendar\":\n return (\n <div className=\"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden\" data-records-skeleton-part=\"body\">\n <div className=\"grid grid-cols-7 gap-px\">\n {Array.from({ length: 7 }, (_, i) => (\n <Skeleton key={i} shape=\"line\" width=\"1/3\" className=\"mx-auto my-1\" />\n ))}\n </div>\n <div className=\"grid flex-1 grid-cols-7 grid-rows-5 gap-px overflow-hidden rounded-md border border-border bg-border\">\n {Array.from({ length: 35 }, (_, i) => (\n <div key={i} className=\"bg-card p-1.5\">\n <Skeleton shape=\"line\" width=\"1/3\" />\n </div>\n ))}\n </div>\n </div>\n );\n case \"timeline\":\n return (\n <div className=\"flex min-h-0 flex-1 flex-col overflow-hidden rounded-md border border-border\" data-records-skeleton-part=\"body\">\n <div className=\"flex h-9 items-center gap-6 border-b border-border px-3\">\n {Array.from({ length: 6 }, (_, i) => (\n <Skeleton key={i} shape=\"line\" width=\"sm\" className=\"w-16\" />\n ))}\n </div>\n {Array.from({ length: Math.min(lineCount, 8) }, (_, i) => (\n <div key={i} className=\"flex h-10 items-center border-b border-border/60 px-3\">\n <Skeleton className=\"h-6 rounded-md\" style={{ marginLeft: `${(i * 13) % 45}%`, width: `${20 + ((i * 7) % 25)}%` }} />\n </div>\n ))}\n </div>\n );\n case \"map\":\n case \"orgchart\":\n // The same box the loaded layout reserves (`SPATIAL_LAYOUT_BOX`), so nothing moves when it lands.\n return <Skeleton className={`w-full rounded-md ${SPATIAL_LAYOUT_BOX}`} data-records-skeleton-part=\"body\" />;\n case \"record\":\n // THE RECORD PAGE'S OWN GEOMETRY (STABLE-2, field list moved down on landing): RecordPanel's header\n // is a 32px title, an actions row (38px), a rule, then the field list — each `gap-2` apart; the\n // field rows are 28px with 2px between. Same boxes here, so the first field is at the same y\n // whether the record has landed or not.\n return (\n <div className=\"flex min-h-0 flex-1 flex-col gap-2 overflow-hidden\" data-records-skeleton-part=\"body\">\n <Skeleton shape=\"title\" width=\"1/2\" className=\"h-8\" data-records-skeleton-part=\"title\" />\n <div className=\"flex h-[38px] items-center gap-2\" data-records-skeleton-part=\"actions\">\n <Skeleton shape=\"control\" width=\"sm\" className=\"h-8\" />\n <Skeleton shape=\"control\" width=\"sm\" className=\"h-8\" />\n </div>\n <div className=\"h-px w-full shrink-0 bg-border\" />\n <div className=\"grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-0.5\" data-records-skeleton-part=\"fields\">\n {Array.from({ length: 6 }, (_, i) => (\n <div key={i} className=\"contents\">\n <Skeleton shape=\"line\" width=\"2/3\" className=\"my-[7px]\" />\n <Skeleton shape=\"row\" className=\"h-7\" />\n </div>\n ))}\n </div>\n <Skeleton shape=\"block\" height=\"lg\" />\n </div>\n );\n case \"form\":\n return (\n <div className=\"flex min-h-0 flex-1 flex-col gap-4 overflow-hidden\" data-records-skeleton-part=\"body\">\n <Skeleton shape=\"title\" width=\"1/2\" />\n <div className=\"grid grid-cols-[minmax(6rem,12rem)_1fr] gap-x-3 gap-y-1.5\">\n {Array.from({ length: 6 }, (_, i) => (\n <div key={i} className=\"contents\">\n <Skeleton shape=\"line\" width=\"2/3\" className=\"my-1.5\" />\n <Skeleton shape=\"row\" className=\"h-7\" />\n </div>\n ))}\n </div>\n <Skeleton shape=\"control\" width=\"sm\" />\n </div>\n );\n case \"chart\":\n // The chart's box: its title line, then the plot at the plot's own height (`CHART_PLOT_PX`).\n return (\n <div className=\"flex flex-col gap-2\" data-records-skeleton-part=\"body\">\n {embedded ? null : <Skeleton shape=\"line\" width=\"1/3\" />}\n <Skeleton shape=\"block\" style={{ height: CHART_PLOT_PX }} />\n </div>\n );\n }\n}\n\nexport interface RecordsSkeletonProps {\n /** Which surface is coming. Default `grid`. */\n layout?: RecordsSkeletonLayout;\n /** Inside a page (a Spaces block): no frame, the data table's embedded look, content height. */\n embedded?: boolean;\n /** Rows to paint; default — page: to the frame's edge, embedded: five. */\n rows?: number | \"fill\";\n /** The table this page is for: a page frame then paints the rows that table showed last visit. */\n tableId?: string;\n className?: string;\n}\n\n/** The body of a layout while its first read is out — where the loaded layout's body will be. */\nexport function RecordsSkeleton({ layout = \"grid\", embedded = false, rows, className }: RecordsSkeletonProps) {\n return (\n <div\n role=\"status\"\n aria-label=\"Loading\"\n aria-busy=\"true\"\n data-records-skeleton={layout}\n className={cn(\"flex min-h-0 flex-col\", !embedded && \"flex-1\", className)}\n >\n <BodySkeleton layout={layout} embedded={embedded} rows={rows ?? (embedded ? 5 : \"fill\")} />\n </div>\n );\n}\n\n/**\n * A WHOLE TABLE PAGE while the table itself is being read: the page's own frame, its toolbar row\n * at its height (the view, the layout, filter, then the search and the add buttons at the end),\n * and the layout's body skeleton below — the boxes the loaded page fills, nothing else.\n */\nexport function TablePageSkeleton({\n layout: layoutAsked,\n embedded = false,\n rows,\n tableId,\n className,\n}: RecordsSkeletonProps) {\n const remembered = useRememberedPageRows(embedded ? undefined : tableId);\n // No layout named (the route's loading frame): the layout this table settled on last visit, else the grid.\n const rememberedFace = useRememberedLayout(embedded || layoutAsked ? undefined : tableId);\n const layout: RecordsSkeletonLayout = layoutAsked ?? skeletonLayoutFor(rememberedFace);\n const painted = rows ?? (remembered === \"fill\" ? undefined : remembered);\n return (\n <div className={cn(TABLE_PAGE_FRAME_CLASS, className)} data-records-skeleton-page={layout}>\n <div className={TABLE_PAGE_COLUMN_CLASS}>\n <div className={TABLE_TOOLBAR_ROW_CLASS} data-table-toolbar=\"\" data-records-skeleton-part=\"toolbar\" aria-hidden=\"true\">\n <Skeleton shape=\"control\" width=\"sm\" className=\"w-28\" />\n <Skeleton shape=\"control\" className=\"w-16\" />\n <Skeleton shape=\"control\" className=\"w-16\" />\n <div className=\"ml-auto flex items-center gap-1.5\">\n <Skeleton shape=\"control\" width=\"md\" />\n <Skeleton shape=\"control\" className=\"w-24\" />\n </div>\n </div>\n <div className=\"flex min-h-0 flex-1 flex-col gap-2\" data-table-records=\"\">\n <RecordsSkeleton layout={layout} embedded={embedded} {...(painted !== undefined ? { rows: painted } : {})} />\n </div>\n </div>\n </div>\n );\n}\n","\"use client\";\n\n// src/embeddedLook.tsx — @ai-matrx/records-ui · CHAIR-EMBEDDED-FIDELITY\n//\n// THE EMBEDDED TABLE'S LOOK, AS NAMED OPTIONS (never free-form styling). `TablePage\n// presentation=\"embedded\"` is the grid a page holds inline, measured against Notion's inline\n// database. Every difference from the full page is ONE option here, switched on by `Grid`\n// when `embedded` and read by the pieces that draw a value:\n//\n// · `blankEmpty` an empty cell is blank, not \"—\" (\"Withheld\" and a worked-out column's reason\n// words stay: they say something a dash would not).\n// · `choiceDot` a choice chip carries a small leading dot in its option's colour.\n// · `plainRelation` a relation cell reads like Notion's: the record's icon (else a page glyph)\n// then its title — no fill, no badge, no coloured underline; hover underlines.\n//\n// Row height and column dividers are classes on the table (`EMBEDDED_TABLE_CLASS`), drawn from\n// the design system's own tokens (`border-border`).\n\nimport { createContext, useContext } from \"react\";\n\nexport interface EmbeddedLook {\n blankEmpty: boolean;\n choiceDot: boolean;\n plainRelation: boolean;\n}\n\nexport const EMBEDDED_LOOK: EmbeddedLook = { blankEmpty: true, choiceDot: true, plainRelation: true };\n\nconst EmbeddedLookContext = createContext<EmbeddedLook | null>(null);\nexport const EmbeddedLookProvider = EmbeddedLookContext.Provider;\n/** The embedded look in force here, or `null` on a full page. */\nexport function useEmbeddedLook(): EmbeddedLook | null {\n return useContext(EmbeddedLookContext);\n}\n\n/**\n * Embedded rows are 40px tall with the value centred in them (as every grid cell is), and thin\n * vertical dividers sit between columns in the existing border token.\n */\nexport const EMBEDDED_TABLE_CLASS = [\n \"[&_tbody_td]:h-10\",\n \"[&_tbody_td]:align-middle!\",\n \"[&_tbody_td]:border-r\",\n \"[&_tbody_td]:border-border\",\n \"[&_tbody_td:last-child]:border-r-0\",\n \"[&_thead_th]:border-r\",\n \"[&_thead_th]:border-border\",\n \"[&_thead_th:last-child]:border-r-0\",\n].join(\" \");\n\n/** With no calculation chosen, the footer holds only the new-row line: no grey band, no rule above it. */\nexport const EMBEDDED_PLAIN_FOOTER_CLASS = \"[&_tfoot]:bg-transparent [&_tfoot]:border-t-0\";\n\n/**\n * HOW MANY ROWS AN EMBEDDED TABLE READS AT A TIME (CHAIR-EMBEDDED-FIDELITY 16): its first page, and\n * each \"Show more\" press brings about this many more — never the whole table. Declared beside the\n * server's first-page builder (`firstPage.ts`), which asks the same first page (lane SSR-ROWS).\n */\nexport { EMBEDDED_PAGE_SIZE } from \"./firstPage\";\n","/**\n * HOW MANY ROWS A TABLE HAD LAST TIME (lane STABLE-TABLES, Arman 2026-10-06: \"if a table renders\n * with an unknown number of rows, we'll have to figure out the best way to handle that by\n * following the best apps in the world\").\n *\n * The champions' rule for a count nobody knows yet: Airtable paints placeholder rows to the\n * frame's edge; Notion's inline database paints a short fixed run. Both still jump once the real\n * count lands. Linear does not, because it paints from its local cache. This is the cache-sized\n * part of Linear's answer: the count a table showed the last time this browser opened it (per\n * table and per place), so a return visit paints exactly the rows it will get and nothing moves.\n * A first visit falls back to the champions' rule (`fallback`). Pure storage; never throws.\n */\n\nconst PREFIX = \"records-ui:rows:\";\nconst MAX = 100;\n\nfunction storage(): Storage | null {\n try {\n return typeof window !== \"undefined\" && window.localStorage ? window.localStorage : null;\n } catch {\n return null;\n }\n}\n\n/** The rows to paint while a first read is out: last time's count (capped at `cap`), else `fallback`. */\nexport function rememberedRowCount<F extends number | \"fill\">(key: string, cap: number, fallback: F): number | F {\n const held = storage()?.getItem(PREFIX + key);\n const n = held == null ? NaN : Number(held);\n if (!Number.isFinite(n) || n < 0) return fallback;\n return Math.max(1, Math.min(cap, MAX, Math.round(n)));\n}\n\n/** Keep the count the table just showed. Zero is kept as one row: the empty state's own frame. */\nexport function rememberRowCount(key: string, count: number): void {\n try {\n storage()?.setItem(PREFIX + key, String(Math.max(0, Math.min(MAX, Math.round(count)))));\n } catch {\n // A full or refused storage only costs the next visit its exact count.\n }\n}\n\nconst LAYOUT_PREFIX = \"records-ui:layout:\";\n\n/**\n * THE LAYOUT A TABLE SHOWED LAST TIME (lane TAIL-FIX). A frame drawn before the table's saved view,\n * look and host layouts are read (the route's loading frame, the page's first-read frame) cannot know\n * whether this person opens it as a grid or a board, so it painted the grid and then switched, 300 to\n * 450ms later (Cleanings, 3 of 3 loads). The layout the page settled on is kept per table in this\n * browser, so a return visit's first frame already is the final layout. A first visit has nothing to\n * remember and keeps the grid skeleton. Pure storage; never throws.\n */\nexport function rememberedLayout(tableId: string): string | null {\n const held = storage()?.getItem(LAYOUT_PREFIX + tableId);\n return held && /^[a-z_-]{2,24}$/.test(held) ? held : null;\n}\n\n/** Keep the layout the table just settled on. */\nexport function rememberLayout(tableId: string, layout: string): void {\n try {\n storage()?.setItem(LAYOUT_PREFIX + tableId, layout);\n } catch {\n // A full or refused storage only costs the next visit its first-frame layout.\n }\n}\n","// src/skeletonLayout.ts — @ai-matrx/records-ui · the skeleton's layout words, with no React\n//\n// Pure, so `/helpers` carries `skeletonLayoutFor` and a host can choose a loading frame before it\n// loads any screen (records-ui front door, 2026-10-16). `RecordsSkeleton.tsx` re-exports all of it.\n\n/** Every place a records surface shows while its first read is out. */\nexport type RecordsSkeletonLayout =\n | \"grid\"\n | \"kanban\"\n | \"gallery\"\n | \"list\"\n | \"calendar\"\n | \"timeline\"\n | \"map\"\n | \"orgchart\"\n | \"form\"\n | \"record\"\n | \"chart\"\n | \"home\";\n\nexport const RECORDS_SKELETON_LAYOUTS: readonly RecordsSkeletonLayout[] = [\n \"grid\",\n \"kanban\",\n \"gallery\",\n \"list\",\n \"calendar\",\n \"timeline\",\n \"map\",\n \"orgchart\",\n \"form\",\n \"record\",\n \"chart\",\n \"home\",\n];\n\n/** A layout word the address or a view carries, as the skeleton that stands for it. */\nexport function skeletonLayoutFor(layout: string | null | undefined): RecordsSkeletonLayout {\n if (layout === \"board\" || layout === \"pipeline\") return \"kanban\";\n return (RECORDS_SKELETON_LAYOUTS as readonly string[]).includes(layout ?? \"\")\n ? (layout as RecordsSkeletonLayout)\n : \"grid\";\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACwBA,IAAAA,gBAAqC;AACrC,2BAA6B;AAC7B,wBAAoD;;;ACRpD,mBAA0C;AAU1C,IAAM,0BAAsB,4BAAmC,IAAI;AAC5D,IAAM,uBAAuB,oBAAoB;AAUjD,IAAM,uBAAuB;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK,GAAG;AAGH,IAAM,8BAA8B;;;ACtC3C,IAAM,SAAS;AACf,IAAM,MAAM;AAEZ,SAAS,UAA0B;AACjC,MAAI;AACF,WAAO,OAAO,WAAW,eAAe,OAAO,eAAe,OAAO,eAAe;AAAA,EACtF,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,mBAA8C,KAAa,KAAa,UAAyB;AAC/G,QAAM,OAAO,QAAQ,GAAG,QAAQ,SAAS,GAAG;AAC5C,QAAM,IAAI,QAAQ,OAAO,MAAM,OAAO,IAAI;AAC1C,MAAI,CAAC,OAAO,SAAS,CAAC,KAAK,IAAI,EAAG,QAAO;AACzC,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC;AACtD;AAWA,IAAM,gBAAgB;AAUf,SAAS,iBAAiB,SAAgC;AAC/D,QAAM,OAAO,QAAQ,GAAG,QAAQ,gBAAgB,O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AAC,SAAI,WAAU,sCAAqC,sBAAmB,IACrE,sDAAC,mBAAgB,QAAgB,UAAqB,GAAI,YAAY,SAAY,EAAE,MAAM,QAAQ,IAAI,CAAC,GAAI,GAC7G;AAAA,KACF,GACF;AAEJ;","names":["import_react"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
/** Every place a records surface shows while its first read is out. */
|
|
4
|
+
type RecordsSkeletonLayout = "grid" | "kanban" | "gallery" | "list" | "calendar" | "timeline" | "map" | "orgchart" | "form" | "record" | "chart" | "home";
|
|
5
|
+
declare const RECORDS_SKELETON_LAYOUTS: readonly RecordsSkeletonLayout[];
|
|
6
|
+
/** A layout word the address or a view carries, as the skeleton that stands for it. */
|
|
7
|
+
declare function skeletonLayoutFor(layout: string | null | undefined): RecordsSkeletonLayout;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* THE ROWS A TABLE PAGE PAINTED LAST VISIT, for a frame drawn before the table is known (the
|
|
11
|
+
* route's own loading frame, the page's first-read frame). The server render and the first client
|
|
12
|
+
* paint agree ("fill"); a browser that remembers the table then settles on its count with no
|
|
13
|
+
* hydration mismatch. The key is the one the grid writes (`<tableId>:page:last`).
|
|
14
|
+
*/
|
|
15
|
+
declare function useRememberedPageRows(tableId: string | undefined): number | "fill";
|
|
16
|
+
/**
|
|
17
|
+
* THE LAYOUT A TABLE PAGE SETTLED ON LAST VISIT (null before a browser remembers one, and on the
|
|
18
|
+
* server). Server render and first client paint agree (null); a browser that remembers the table
|
|
19
|
+
* then settles on its layout with no hydration mismatch.
|
|
20
|
+
*/
|
|
21
|
+
declare function useRememberedLayout(tableId: string | undefined): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* THE TABLE PAGE'S TOOLBAR ROW — one class for the loaded row and its skeleton, so the two are
|
|
24
|
+
* the same height from the first frame (`min-h-8`: the row's 32px buttons; a chip that arrives
|
|
25
|
+
* later can never make it taller or shorter).
|
|
26
|
+
*/
|
|
27
|
+
declare const TABLE_TOOLBAR_ROW_CLASS = "flex min-h-8 min-w-0 shrink-0 flex-nowrap items-center gap-1.5 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
28
|
+
/** The records grid's row: condensed, round the 32px row action strip, plus its rule. */
|
|
29
|
+
declare const RECORDS_GRID_ROW_PX = 35;
|
|
30
|
+
interface RecordsSkeletonProps {
|
|
31
|
+
/** Which surface is coming. Default `grid`. */
|
|
32
|
+
layout?: RecordsSkeletonLayout;
|
|
33
|
+
/** Inside a page (a Spaces block): no frame, the data table's embedded look, content height. */
|
|
34
|
+
embedded?: boolean;
|
|
35
|
+
/** Rows to paint; default — page: to the frame's edge, embedded: five. */
|
|
36
|
+
rows?: number | "fill";
|
|
37
|
+
/** The table this page is for: a page frame then paints the rows that table showed last visit. */
|
|
38
|
+
tableId?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/** The body of a layout while its first read is out — where the loaded layout's body will be. */
|
|
42
|
+
declare function RecordsSkeleton({ layout, embedded, rows, className }: RecordsSkeletonProps): react.JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* A WHOLE TABLE PAGE while the table itself is being read: the page's own frame, its toolbar row
|
|
45
|
+
* at its height (the view, the layout, filter, then the search and the add buttons at the end),
|
|
46
|
+
* and the layout's body skeleton below — the boxes the loaded page fills, nothing else.
|
|
47
|
+
*/
|
|
48
|
+
declare function TablePageSkeleton({ layout: layoutAsked, embedded, rows, tableId, className, }: RecordsSkeletonProps): react.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { RECORDS_GRID_ROW_PX, RECORDS_SKELETON_LAYOUTS, RecordsSkeleton, type RecordsSkeletonLayout, type RecordsSkeletonProps, TABLE_TOOLBAR_ROW_CLASS, TablePageSkeleton, skeletonLayoutFor, useRememberedLayout, useRememberedPageRows };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
|
|
3
|
+
/** Every place a records surface shows while its first read is out. */
|
|
4
|
+
type RecordsSkeletonLayout = "grid" | "kanban" | "gallery" | "list" | "calendar" | "timeline" | "map" | "orgchart" | "form" | "record" | "chart" | "home";
|
|
5
|
+
declare const RECORDS_SKELETON_LAYOUTS: readonly RecordsSkeletonLayout[];
|
|
6
|
+
/** A layout word the address or a view carries, as the skeleton that stands for it. */
|
|
7
|
+
declare function skeletonLayoutFor(layout: string | null | undefined): RecordsSkeletonLayout;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* THE ROWS A TABLE PAGE PAINTED LAST VISIT, for a frame drawn before the table is known (the
|
|
11
|
+
* route's own loading frame, the page's first-read frame). The server render and the first client
|
|
12
|
+
* paint agree ("fill"); a browser that remembers the table then settles on its count with no
|
|
13
|
+
* hydration mismatch. The key is the one the grid writes (`<tableId>:page:last`).
|
|
14
|
+
*/
|
|
15
|
+
declare function useRememberedPageRows(tableId: string | undefined): number | "fill";
|
|
16
|
+
/**
|
|
17
|
+
* THE LAYOUT A TABLE PAGE SETTLED ON LAST VISIT (null before a browser remembers one, and on the
|
|
18
|
+
* server). Server render and first client paint agree (null); a browser that remembers the table
|
|
19
|
+
* then settles on its layout with no hydration mismatch.
|
|
20
|
+
*/
|
|
21
|
+
declare function useRememberedLayout(tableId: string | undefined): string | null;
|
|
22
|
+
/**
|
|
23
|
+
* THE TABLE PAGE'S TOOLBAR ROW — one class for the loaded row and its skeleton, so the two are
|
|
24
|
+
* the same height from the first frame (`min-h-8`: the row's 32px buttons; a chip that arrives
|
|
25
|
+
* later can never make it taller or shorter).
|
|
26
|
+
*/
|
|
27
|
+
declare const TABLE_TOOLBAR_ROW_CLASS = "flex min-h-8 min-w-0 shrink-0 flex-nowrap items-center gap-1.5 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden";
|
|
28
|
+
/** The records grid's row: condensed, round the 32px row action strip, plus its rule. */
|
|
29
|
+
declare const RECORDS_GRID_ROW_PX = 35;
|
|
30
|
+
interface RecordsSkeletonProps {
|
|
31
|
+
/** Which surface is coming. Default `grid`. */
|
|
32
|
+
layout?: RecordsSkeletonLayout;
|
|
33
|
+
/** Inside a page (a Spaces block): no frame, the data table's embedded look, content height. */
|
|
34
|
+
embedded?: boolean;
|
|
35
|
+
/** Rows to paint; default — page: to the frame's edge, embedded: five. */
|
|
36
|
+
rows?: number | "fill";
|
|
37
|
+
/** The table this page is for: a page frame then paints the rows that table showed last visit. */
|
|
38
|
+
tableId?: string;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
/** The body of a layout while its first read is out — where the loaded layout's body will be. */
|
|
42
|
+
declare function RecordsSkeleton({ layout, embedded, rows, className }: RecordsSkeletonProps): react.JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* A WHOLE TABLE PAGE while the table itself is being read: the page's own frame, its toolbar row
|
|
45
|
+
* at its height (the view, the layout, filter, then the search and the add buttons at the end),
|
|
46
|
+
* and the layout's body skeleton below — the boxes the loaded page fills, nothing else.
|
|
47
|
+
*/
|
|
48
|
+
declare function TablePageSkeleton({ layout: layoutAsked, embedded, rows, tableId, className, }: RecordsSkeletonProps): react.JSX.Element;
|
|
49
|
+
|
|
50
|
+
export { RECORDS_GRID_ROW_PX, RECORDS_SKELETON_LAYOUTS, RecordsSkeleton, type RecordsSkeletonLayout, type RecordsSkeletonProps, TABLE_TOOLBAR_ROW_CLASS, TablePageSkeleton, skeletonLayoutFor, useRememberedLayout, useRememberedPageRows };
|
package/dist/skeleton.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
RECORDS_GRID_ROW_PX,
|
|
4
|
+
RECORDS_SKELETON_LAYOUTS,
|
|
5
|
+
RecordsSkeleton,
|
|
6
|
+
TABLE_TOOLBAR_ROW_CLASS,
|
|
7
|
+
TablePageSkeleton,
|
|
8
|
+
skeletonLayoutFor,
|
|
9
|
+
useRememberedLayout,
|
|
10
|
+
useRememberedPageRows
|
|
11
|
+
} from "./chunk-Z6WTP467.js";
|
|
12
|
+
import "./chunk-B5S5F5NH.js";
|
|
13
|
+
import "./chunk-SPPATZSR.js";
|
|
14
|
+
import "./chunk-NJYJEAQC.js";
|
|
15
|
+
import "./chunk-HKYEHBQT.js";
|
|
16
|
+
export {
|
|
17
|
+
RECORDS_GRID_ROW_PX,
|
|
18
|
+
RECORDS_SKELETON_LAYOUTS,
|
|
19
|
+
RecordsSkeleton,
|
|
20
|
+
TABLE_TOOLBAR_ROW_CLASS,
|
|
21
|
+
TablePageSkeleton,
|
|
22
|
+
skeletonLayoutFor,
|
|
23
|
+
useRememberedLayout,
|
|
24
|
+
useRememberedPageRows
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=skeleton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-matrx/records-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.116.1",
|
|
4
4
|
"description": "The thirty-one canonical screens of the AI Matrx record store: grid, generated record form, field editor, table settings, relation picker, peek, views, import/export, custom fields, action inbox, history, comments, forms, charts, documents, record chat, AI field fill, checklists, bookings, offline capture, portals, public pages and embeds. Built on @ai-matrx/design-system's data table, carrying @ai-matrx/alchemy's menu, and reading and writing ONLY through @ai-matrx/records.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -104,6 +104,16 @@
|
|
|
104
104
|
"types": "./dist/data-source.d.cts",
|
|
105
105
|
"default": "./dist/data-source.cjs"
|
|
106
106
|
}
|
|
107
|
+
},
|
|
108
|
+
"./skeleton": {
|
|
109
|
+
"import": {
|
|
110
|
+
"types": "./dist/skeleton.d.ts",
|
|
111
|
+
"default": "./dist/skeleton.js"
|
|
112
|
+
},
|
|
113
|
+
"require": {
|
|
114
|
+
"types": "./dist/skeleton.d.cts",
|
|
115
|
+
"default": "./dist/skeleton.cjs"
|
|
116
|
+
}
|
|
107
117
|
}
|
|
108
118
|
},
|
|
109
119
|
"peerDependencies": {
|
|
@@ -116,13 +126,13 @@
|
|
|
116
126
|
"@tanstack/react-query": ">=5.100.0"
|
|
117
127
|
},
|
|
118
128
|
"dependencies": {
|
|
129
|
+
"@ai-matrx/alchemy": "latest",
|
|
130
|
+
"@ai-matrx/content-ir": "latest",
|
|
119
131
|
"@ai-matrx/data": "latest",
|
|
120
132
|
"@ai-matrx/design-system": "latest",
|
|
121
133
|
"@ai-matrx/kit": "latest",
|
|
122
134
|
"@ai-matrx/print": "latest",
|
|
123
|
-
"@ai-matrx/
|
|
124
|
-
"@ai-matrx/records": "latest",
|
|
125
|
-
"@ai-matrx/alchemy": "latest"
|
|
135
|
+
"@ai-matrx/records": "latest"
|
|
126
136
|
},
|
|
127
137
|
"devDependencies": {
|
|
128
138
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
@@ -137,6 +147,7 @@
|
|
|
137
147
|
"@types/react-dom": "19.3.0",
|
|
138
148
|
"@vitejs/plugin-react": "^5.2.0",
|
|
139
149
|
"jsdom": "^30.1.1",
|
|
150
|
+
"playwright-core": "^1.56.0",
|
|
140
151
|
"publint": "^0.3.24",
|
|
141
152
|
"react": "^19.3.0",
|
|
142
153
|
"react-dom": "^19.3.0",
|
|
@@ -184,5 +195,5 @@
|
|
|
184
195
|
"test:record": "RECORDS_UI_RECORD=1 vitest run demo/deterministic.test.tsx",
|
|
185
196
|
"check:consumer-flags": "tsc --noEmit -p tsconfig.consumer.json"
|
|
186
197
|
},
|
|
187
|
-
"gitHead": "
|
|
198
|
+
"gitHead": "e101f72586ffdd012f4ac1bc1670d8e1ddcf1062"
|
|
188
199
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use client";
|
|
3
|
-
import {
|
|
4
|
-
SAVE_TO_TABLE_TYPES,
|
|
5
|
-
SaveToTable,
|
|
6
|
-
shapesOfSource
|
|
7
|
-
} from "./chunk-VGNQBI2J.js";
|
|
8
|
-
import "./chunk-W5SOKJ5P.js";
|
|
9
|
-
import "./chunk-4U2JCICC.js";
|
|
10
|
-
import "./chunk-TIZHA6VK.js";
|
|
11
|
-
import "./chunk-6NSGVKYL.js";
|
|
12
|
-
import "./chunk-HKYEHBQT.js";
|
|
13
|
-
export {
|
|
14
|
-
SAVE_TO_TABLE_TYPES,
|
|
15
|
-
SaveToTable,
|
|
16
|
-
shapesOfSource
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=SaveToTable-V3R7QVKV.js.map
|