@ai-matrx/records-ui 0.116.121 → 0.116.123

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.
@@ -0,0 +1,235 @@
1
+ "use client";
2
+
3
+ // src/plainWords.ts
4
+ var MACHINE_IDENTITY = [
5
+ /\b[A-Z]{2,4}-\d{1,3}\b/,
6
+ // A build lane's tag: capital words joined by hyphens, then a colon ("STORE-TAILS-3:",
7
+ // "MOVE-AND-OUTSIDER:"). A person never reads which lane wrote a sentence.
8
+ /\b[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+:/,
9
+ /\b(?:custom|platform|iam|history|public|auth|campaign_watch)\.[a-z_]+/,
10
+ /\b(?:config|data|document|spec|patch)\.[a-z_]+/,
11
+ /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,
12
+ /\b[a-z][a-z0-9]*(?:_[a-z0-9]+)+\b/,
13
+ // Five characters of digits and capitals, at least one a digit — so `23514`
14
+ // and `PT409` match and an emphatic `NEVER` does not.
15
+ /\b(?=[0-9A-Z]{5}\b)(?=[0-9A-Z]*\d)[0-9A-Z]{5}\b/
16
+ ];
17
+ function isMachineIdentity(text) {
18
+ return MACHINE_IDENTITY.some((shape) => shape.test(text));
19
+ }
20
+ function machineIdentityIn(text) {
21
+ const found = [];
22
+ for (const shape of MACHINE_IDENTITY) {
23
+ const all = new RegExp(shape.source, shape.flags.includes("g") ? shape.flags : `${shape.flags}g`);
24
+ for (const hit of text.matchAll(all)) if (hit[0]) found.push(hit[0]);
25
+ }
26
+ return [...new Set(found)];
27
+ }
28
+ var TITLE = {
29
+ stale_write: "Someone else wrote first",
30
+ door: "You do not have access to this",
31
+ door_absent: "That is not built yet",
32
+ refused_by_rule: "That value was not accepted",
33
+ invalid_argument: "That was not accepted",
34
+ not_found: "Not there any more",
35
+ missing_reference: "That points at something that is not there",
36
+ already_exists: "That already exists",
37
+ not_supported: "That cannot be done here",
38
+ store_limit: "This has got as big as it can",
39
+ // 🚨 NOT "THE SWITCH IS OFF" (lane 7 W1 fix round 1). PGRST202 / PGRST205 land here, and the
40
+ // commonest cause is a door this screen asks for that the database it talks to does not serve
41
+ // YET — a release in flight. Telling the person her organization has its store switched off was
42
+ // false (the switch is answered by its own door, `platform.unified_data_store_on`). Honest:
43
+ // nothing happened, and it is ours, and it passes.
44
+ store_not_served: "This isn't available right now",
45
+ unreachable: "We could not reach your data",
46
+ needs_approval: "This is waiting on someone's approval",
47
+ stale_read: "Your view of this is a moment behind",
48
+ timed_out: "That took too long to answer",
49
+ internal: "Something went wrong at our end"
50
+ };
51
+ var REMEDY = {
52
+ stale_write: "Look at what they wrote. Keep theirs, or try again and yours goes on top.",
53
+ door: "Ask somebody who administers this to share it with you at the level you need.",
54
+ door_absent: "There is nothing to do here yet. It is on our list, not yours.",
55
+ refused_by_rule: "Change the value so it passes, then try again.",
56
+ invalid_argument: "Change what you entered, then try again.",
57
+ not_found: "It may have been deleted. Go back to the list and open it again from there.",
58
+ missing_reference: "Pick something that is still there.",
59
+ already_exists: "Use a different name.",
60
+ not_supported: "There is another way to do this \u2014 ask, and we will point you at it.",
61
+ store_limit: "Split it up, or ask us to raise the ceiling for your organization.",
62
+ store_not_served: "Nothing was changed. Try again in a few minutes.",
63
+ // 🚨 NOTHING WAS WRITTEN AND NOTHING WAS REFUSED (lane TAILS-6). The call
64
+ // never arrived, so "try again" is the honest instruction rather than a
65
+ // consolation — and saying nothing changed is the half a person actually
66
+ // worries about.
67
+ unreachable: "Nothing was changed. Check your connection and open this again.",
68
+ needs_approval: "Nothing was changed yet. The people who can approve it have been asked.",
69
+ stale_read: "Open this again in a moment and it will be up to date.",
70
+ // 🚨 ONE REMEDY THAT IS TRUE OF EVERY DOOR (lane CHAIR-STORE-PERF, 2026-10-03). The store cancels the
71
+ // WHOLE statement at its clock, so a timed-out door wrote nothing — a create, a column add and a page
72
+ // read alike. "Try a smaller page" was written for the page read and was printed to a person adding
73
+ // one row to a three-row table (clone walk, 2026-10-03; the clock was a lock another lane's
74
+ // rehearsal held, not the row). A door whose page can shrink says so in its own hint, which wins here.
75
+ // ONE SENTENCE, NOT TWO (lane TIMEOUT-ONE-SENTENCE, 2026-10-19): the shared timed-out sentence ("That took too long.
76
+ // Nothing was lost; try again.") already says what happened and what to do, so the table adds NO second remedy
77
+ // ("Nothing was changed" was also wrong on a read). Empty = the notice prints no remedy line and the one-line
78
+ // form is the sentence alone. A door's own hint still wins.
79
+ timed_out: "",
80
+ internal: "Nothing you did caused this. Try again, and tell us if it keeps happening."
81
+ };
82
+ var ENGINEER_TEXT = [
83
+ /@ai-matrx\//,
84
+ /\bSQLSTATE\b/i,
85
+ /\bPostgREST\b/i,
86
+ /\bIndexedDB\b/i,
87
+ // `<RecordsUiProvider>` — a component, on a screen.
88
+ /<\/?[A-Z][A-Za-z0-9]*\s*\/?>/,
89
+ // `savedViews`, `openRecords`, `onReask` — an identifier, however it is
90
+ // quoted. English does not write camelCase; code does.
91
+ /\b[a-z][a-z0-9]*[A-Z][A-Za-z0-9]*\b/,
92
+ // A backticked token is a thing you type into an editor, not a thing you do.
93
+ /`[A-Za-z_][A-Za-z0-9_.]*`/,
94
+ // "bind X on Y", "pass X", "import X" — an instruction to whoever maintains
95
+ // the app, arriving on the screen of somebody who cannot act on it.
96
+ /\bbind\s+[`'"A-Za-z]/i
97
+ ];
98
+ function isDeveloperHint(hint) {
99
+ const text = hint.trim();
100
+ if (text === "") return false;
101
+ if (text.includes("```")) return true;
102
+ if (/\n\s+at\s+\S+/.test(text)) return true;
103
+ if (text.length > 600) return true;
104
+ return isEngineerText(text);
105
+ }
106
+ function peopleHint(hint) {
107
+ const said = (hint ?? "").trim();
108
+ if (said === "" || isDeveloperHint(said)) return null;
109
+ return plainSentence(said).kept;
110
+ }
111
+ function isEngineerText(text) {
112
+ return ENGINEER_TEXT.some((shape) => shape.test(text));
113
+ }
114
+ function withoutMachineClauses(sentence) {
115
+ const dropped = [];
116
+ const footnotes = [];
117
+ const withoutFootnotes = sentence.replace(/\s*\((?:see\s+)?[A-Z]{2,5}-[A-Z0-9-]{1,8}\)/g, (hit) => {
118
+ footnotes.push(hit.trim());
119
+ return "";
120
+ });
121
+ dropped.push(...footnotes);
122
+ const clauses = withoutFootnotes.split(/(?:,\s+so\s+|\s+—\s+|\s+--\s+|\s*\|\s*)/).map((clause) => clause.trim()).filter((clause) => clause !== "");
123
+ const kept = clauses.filter((clause) => {
124
+ if (!isMachineIdentity(clause)) return true;
125
+ dropped.push(clause);
126
+ return false;
127
+ });
128
+ if (kept.length === 0) return { kept: null, dropped };
129
+ if (dropped.length === 0) return { kept: sentence.trim(), dropped };
130
+ let joined = kept.join(". ").replace(/\.\.+/g, ".").trim();
131
+ if (!/[.!?]$/.test(joined)) joined = `${joined}.`;
132
+ return { kept: joined, dropped };
133
+ }
134
+ function peopleSentence(message) {
135
+ const [lead = "", ...tail] = message.split(/\s+—\s+|\s+--\s+/);
136
+ const sentences = lead.trim().split(/(?<=(?<!\b(?:Dr|Mr|Mrs|Ms|St|vs|No|e\.g|i\.e|etc|[A-Z]))[.!?])\s+/);
137
+ const first = sentences[0] ?? "";
138
+ const rest = [...sentences.slice(1), ...tail].map((part) => part.trim()).filter((part) => part !== "");
139
+ const cleaned = plainSentence(first);
140
+ return { kept: cleaned.kept, dropped: [...cleaned.dropped, ...rest] };
141
+ }
142
+ function refusalSentence(error) {
143
+ return refusalForAPerson(error).sentence;
144
+ }
145
+ var BUILD_LABEL = String.raw`(?:Test \d+ \([^)]{1,40}\)|[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+|[A-Z]{1,5}\d+[a-z]?)`;
146
+ var LEADING_BUILD_LABEL = new RegExp(String.raw`^${BUILD_LABEL}(?:\s*\/\s*${BUILD_LABEL})*:\s+`);
147
+ function withoutBuildLabel(sentence) {
148
+ const hit = LEADING_BUILD_LABEL.exec(sentence);
149
+ if (!hit) return { label: null, rest: sentence };
150
+ const rest = sentence.slice(hit[0].length).trim();
151
+ return { label: hit[0].trim(), rest: rest.charAt(0).toUpperCase() + rest.slice(1) };
152
+ }
153
+ function plainSentence(message) {
154
+ const dropped = [];
155
+ const kept = [];
156
+ for (const raw of message.split(/(?<=[.!?])\s+/)) {
157
+ const labelled = withoutBuildLabel(raw.trim());
158
+ if (labelled.label) dropped.push(labelled.label);
159
+ const sentence = labelled.rest;
160
+ if (sentence === "") continue;
161
+ const cleaned = withoutMachineClauses(sentence);
162
+ dropped.push(...cleaned.dropped);
163
+ if (cleaned.kept) kept.push(cleaned.kept);
164
+ }
165
+ return { kept: kept.length === 0 ? null : kept.join(" "), dropped };
166
+ }
167
+ function readsAsASentence(text) {
168
+ return (text ?? "").trim().split(/\s+/).filter(Boolean).length >= 2;
169
+ }
170
+ function exampleOf(error) {
171
+ const detail = error.detail;
172
+ if (!detail || typeof detail !== "object") return null;
173
+ const example = detail.example;
174
+ return typeof example === "string" && example.trim() !== "" ? example.trim() : null;
175
+ }
176
+ var TIMED_OUT_SAID = "That took too long. Nothing was lost; try again.";
177
+ function refusalForAPerson(error) {
178
+ const code = error.code ?? "internal";
179
+ const timedOut = code === "timed_out" || error.sqlstate === "57014" || /canceling statement due to statement timeout/i.test(String(error.message ?? ""));
180
+ const ours = error.ours === true;
181
+ const hint = plainSentence(String(error.hint ?? ""));
182
+ const message = ours ? plainSentence(String(error.message ?? "")) : peopleSentence(String(error.message ?? ""));
183
+ const title = timedOut ? TITLE["timed_out"] : TITLE[code] ?? "That was refused";
184
+ const hintIsForEngineers = isDeveloperHint(String(error.hint ?? ""));
185
+ const example = exampleOf(error);
186
+ const remedy = (example ? `Enter it like ${example}.` : null) ?? (hintIsForEngineers || !readsAsASentence(hint.kept) ? null : hint.kept) ?? (timedOut ? REMEDY["timed_out"] : REMEDY[code]) ?? REMEDY["internal"];
187
+ const messageIsForEngineers = isEngineerText(String(error.message ?? ""));
188
+ const said = timedOut ? TIMED_OUT_SAID : (messageIsForEngineers ? "" : message.kept ?? "").trim();
189
+ const forEngineers = [
190
+ error.sqlstate ? `SQLSTATE ${error.sqlstate}.` : null,
191
+ // The client's own note about a class it did not recognize, or a call that
192
+ // never reached the store. It is rendered out of sight, never as a sentence.
193
+ error.diagnostic ? error.diagnostic : null,
194
+ messageIsForEngineers || timedOut ? `Message: ${error.message}` : null,
195
+ error.hint && (hintIsForEngineers || hint.kept !== error.hint) ? `Hint: ${error.hint}` : null,
196
+ message.dropped.length > 0 || hint.dropped.length > 0 ? `Dropped from the person's view: ${[...message.dropped, ...hint.dropped].join(" | ")}` : null
197
+ ].filter(Boolean).join(" ");
198
+ return {
199
+ title,
200
+ // Nothing invented. When every clause was machine identity the title says
201
+ // what happened and the remedy says what to do; a made-up diagnosis would
202
+ // be worse than the identifier it replaced.
203
+ sentence: said === "" ? `${title}.` : said,
204
+ remedy,
205
+ storeSaid: said !== "",
206
+ forEngineers
207
+ };
208
+ }
209
+ function refusalLineForAPerson(error) {
210
+ const plain = refusalForAPerson(error);
211
+ const sentence = plain.sentence.trim();
212
+ const ended = sentence === "" || /[.!?…:]$/.test(sentence) ? sentence : `${sentence}.`;
213
+ return `${ended} ${plain.remedy}`.trim();
214
+ }
215
+ function refusalIsMissingInput(error) {
216
+ return error.sqlstate === "22023" || error.code === "invalid_argument";
217
+ }
218
+ function withoutInternalCodes(text) {
219
+ return text.replace(/\s*\((?:[A-Z]{2,}-\d+[A-Za-z]?|T\d+)(?:\s*\/\s*(?:[A-Z]{2,}-\d+[A-Za-z]?|T\d+))*\)/g, "").replace(/\s+([.,;])/g, "$1").trim();
220
+ }
221
+
222
+ export {
223
+ MACHINE_IDENTITY,
224
+ isMachineIdentity,
225
+ machineIdentityIn,
226
+ ENGINEER_TEXT,
227
+ peopleHint,
228
+ isEngineerText,
229
+ refusalSentence,
230
+ refusalForAPerson,
231
+ refusalLineForAPerson,
232
+ refusalIsMissingInput,
233
+ withoutInternalCodes
234
+ };
235
+ //# sourceMappingURL=chunk-CSGNQAQD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plainWords.ts"],"sourcesContent":["// src/plainWords.ts — @ai-matrx/records-ui\n//\n// THE ONE FORMATTER EVERY REFUSAL PASSES THROUGH.\n//\n// WHAT A PERSON READ (independent verdict, sixth pass, 19-20 September):\n//\n// \"You do not have access to this table, so custom.applicable_fields has\n// nothing to show you.\"\n// \"config.via names a relation Field of this same table, by its key… The\n// store's code for this was 23514.\"\n//\n// The verdict's third measured gap against Airtable, Notion and Linear was\n// exactly this: \"The machinery still shows through… two column types answer\n// with a contract row id and a SQL error number. Airtable, Notion and Linear\n// never show a person an internal name.\"\n//\n// WHY FILTERING THE HINT WAS NOT ENOUGH. The previous pass filtered the store's\n// HINT — the half written for whoever fixes the caller — and printed the\n// MESSAGE verbatim, because the store writes good messages. Most of them are\n// good. But the store's access refusals are built by `format()` from the DOOR'S\n// OWN NAME (`assert_client_may_change`: \"…so % may not write to it\", with the\n// door name substituted in), so the machine identity is IN the sentence a\n// person reads and no amount of hint-filtering reaches it.\n//\n// SO: ONE function, here, and every screen in this package renders what it\n// returns and nothing else. It does three things and refuses to do a fourth:\n//\n// 1. It KEEPS the store's own words wherever they are a person's words. The\n// store writes the best sentences in this feature (\"Being a member of the\n// organization is not by itself permission to rewrite somebody else's\n// row\") and this package does not rewrite them.\n// 2. It DROPS the clause that carries machine identity, by SHAPE — a\n// schema-qualified object, a document path, a contract row id, a SQLSTATE,\n// a uuid, a bare snake_case token. Dropped, never deleted: it joins the\n// SQLSTATE on the notice for whoever has to debug it.\n// 3. It ADDS a REMEDY — the sentence that says what to do now — keyed off the\n// store's own refusal code, because a refusal with nothing to do about it\n// is a dead end with an explanation.\n//\n// 4. It does NOT invent a diagnosis. When every clause of a message is\n// machine identity there is nothing honest left to say about the specifics,\n// so it says what happened in general terms and offers the remedy. Making\n// something up would be worse than the identifier it replaced.\n//\n// The guard for all of this is `demo/plain-words.test.tsx` plus the sweep in\n// `demo/honest.test.tsx`, which reads the RENDERED text of the real screens and\n// fails on any of the shapes below. A formatter nobody is forced through is a\n// formatter somebody bypasses next week.\n\nimport type { RecordsError } from \"@ai-matrx/records\";\n\n/**\n * MACHINE IDENTITY, BY SHAPE — never by a list of the sentences we happen to\n * have seen, because the next refusal is one nobody has read yet.\n *\n * `FLD-11:` / `REC-29:` / `AGT-7:` a contract row id\n * `custom.field_declare` a schema-qualified database object\n * `config.via` / `data.fields` a path inside a stored document\n * `retention_days` a document key, snake_case\n * `8f2c1b0a-…` a uuid\n * `23514` / `PT409` a SQLSTATE\n * `STORE-TAILS-3:` / `UI-FIX-19:` a build lane's tag (UI-FIX-19)\n */\nexport const MACHINE_IDENTITY: RegExp[] = [\n /\\b[A-Z]{2,4}-\\d{1,3}\\b/,\n // A build lane's tag: capital words joined by hyphens, then a colon (\"STORE-TAILS-3:\",\n // \"MOVE-AND-OUTSIDER:\"). A person never reads which lane wrote a sentence.\n /\\b[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+:/,\n /\\b(?:custom|platform|iam|history|public|auth|campaign_watch)\\.[a-z_]+/,\n /\\b(?:config|data|document|spec|patch)\\.[a-z_]+/,\n /\\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\\b/i,\n /\\b[a-z][a-z0-9]*(?:_[a-z0-9]+)+\\b/,\n // Five characters of digits and capitals, at least one a digit — so `23514`\n // and `PT409` match and an emphatic `NEVER` does not.\n /\\b(?=[0-9A-Z]{5}\\b)(?=[0-9A-Z]*\\d)[0-9A-Z]{5}\\b/,\n];\n\n/** Whether any shape above appears in this text. */\nexport function isMachineIdentity(text: string): boolean {\n return MACHINE_IDENTITY.some((shape) => shape.test(text));\n}\n\n/**\n * Every fragment of `text` that a person should never have been shown. Used by\n * the suite to say WHAT it found rather than only that it found something.\n */\nexport function machineIdentityIn(text: string): string[] {\n const found: string[] = [];\n for (const shape of MACHINE_IDENTITY) {\n const all = new RegExp(shape.source, shape.flags.includes(\"g\") ? shape.flags : `${shape.flags}g`);\n for (const hit of text.matchAll(all)) if (hit[0]) found.push(hit[0]);\n }\n return [...new Set(found)];\n}\n\n/** What the notice is called. The store's code, in the words of what went wrong. */\nconst TITLE: Record<string, string> = {\n stale_write: \"Someone else wrote first\",\n door: \"You do not have access to this\",\n door_absent: \"That is not built yet\",\n refused_by_rule: \"That value was not accepted\",\n invalid_argument: \"That was not accepted\",\n not_found: \"Not there any more\",\n missing_reference: \"That points at something that is not there\",\n already_exists: \"That already exists\",\n not_supported: \"That cannot be done here\",\n store_limit: \"This has got as big as it can\",\n // 🚨 NOT \"THE SWITCH IS OFF\" (lane 7 W1 fix round 1). PGRST202 / PGRST205 land here, and the\n // commonest cause is a door this screen asks for that the database it talks to does not serve\n // YET — a release in flight. Telling the person her organization has its store switched off was\n // false (the switch is answered by its own door, `platform.unified_data_store_on`). Honest:\n // nothing happened, and it is ours, and it passes.\n store_not_served: \"This isn't available right now\",\n unreachable: \"We could not reach your data\",\n needs_approval: \"This is waiting on someone's approval\",\n stale_read: \"Your view of this is a moment behind\",\n timed_out: \"That took too long to answer\",\n internal: \"Something went wrong at our end\",\n};\n\n/**\n * WHAT TO DO NOW. One sentence per refusal code, and it is the whole reason\n * this file exists rather than a regular expression in `Refusal.tsx`: a\n * sentence that names what went wrong and nothing to do about it is a dead end.\n */\nconst REMEDY: Record<string, string> = {\n stale_write:\n \"Look at what they wrote. Keep theirs, or try again and yours goes on top.\",\n door:\n \"Ask somebody who administers this to share it with you at the level you need.\",\n door_absent:\n \"There is nothing to do here yet. It is on our list, not yours.\",\n refused_by_rule: \"Change the value so it passes, then try again.\",\n invalid_argument: \"Change what you entered, then try again.\",\n not_found:\n \"It may have been deleted. Go back to the list and open it again from there.\",\n missing_reference: \"Pick something that is still there.\",\n already_exists: \"Use a different name.\",\n not_supported: \"There is another way to do this — ask, and we will point you at it.\",\n store_limit: \"Split it up, or ask us to raise the ceiling for your organization.\",\n store_not_served: \"Nothing was changed. Try again in a few minutes.\",\n // 🚨 NOTHING WAS WRITTEN AND NOTHING WAS REFUSED (lane TAILS-6). The call\n // never arrived, so \"try again\" is the honest instruction rather than a\n // consolation — and saying nothing changed is the half a person actually\n // worries about.\n unreachable:\n \"Nothing was changed. Check your connection and open this again.\",\n needs_approval:\n \"Nothing was changed yet. The people who can approve it have been asked.\",\n stale_read: \"Open this again in a moment and it will be up to date.\",\n // 🚨 ONE REMEDY THAT IS TRUE OF EVERY DOOR (lane CHAIR-STORE-PERF, 2026-10-03). The store cancels the\n // WHOLE statement at its clock, so a timed-out door wrote nothing — a create, a column add and a page\n // read alike. \"Try a smaller page\" was written for the page read and was printed to a person adding\n // one row to a three-row table (clone walk, 2026-10-03; the clock was a lock another lane's\n // rehearsal held, not the row). A door whose page can shrink says so in its own hint, which wins here.\n // ONE SENTENCE, NOT TWO (lane TIMEOUT-ONE-SENTENCE, 2026-10-19): the shared timed-out sentence (\"That took too long.\n // Nothing was lost; try again.\") already says what happened and what to do, so the table adds NO second remedy\n // (\"Nothing was changed\" was also wrong on a read). Empty = the notice prints no remedy line and the one-line\n // form is the sentence alone. A door's own hint still wins.\n timed_out: \"\",\n internal:\n \"Nothing you did caused this. Try again, and tell us if it keeps happening.\",\n};\n\n/**\n * 🚨 A HINT THIS PACKAGE OR ITS CLIENT WROTE IS NOT A PERSON'S REMEDY.\n *\n * `refusalForAPerson` prefers the DOOR's own hint over the table above, because\n * the door that refused knows more about the way out than a code does. That is\n * right — but it assumed every hint came from the store. It did not: until\n * `@ai-matrx/records` 0.47.0 the client appended its OWN note to `hint` when it\n * met a SQLSTATE it did not know, and the machine-identity filter let it\n * through whenever the code was not exactly five characters (an empty code from\n * a dropped connection, or an HTTP status like `404`). So the Checklists tab of\n * a plumbing company's jobs table told its owner:\n *\n * @ai-matrx/records did not recognize SQLSTATE from checklistTemplates\n *\n * The client no longer writes there. This is the guard on the other side, by\n * SHAPE and not by that one sentence: a hint that talks about a package, a\n * SQLSTATE, or a `camelCaseDoor` is engineer text wherever it came from, and it\n * joins the engineer's line instead of a person's screen.\n */\nexport const ENGINEER_TEXT: RegExp[] = [\n /@ai-matrx\\//,\n /\\bSQLSTATE\\b/i,\n /\\bPostgREST\\b/i,\n /\\bIndexedDB\\b/i,\n // `<RecordsUiProvider>` — a component, on a screen.\n /<\\/?[A-Z][A-Za-z0-9]*\\s*\\/?>/,\n // `savedViews`, `openRecords`, `onReask` — an identifier, however it is\n // quoted. English does not write camelCase; code does.\n /\\b[a-z][a-z0-9]*[A-Z][A-Za-z0-9]*\\b/,\n // A backticked token is a thing you type into an editor, not a thing you do.\n /`[A-Za-z_][A-Za-z0-9_.]*`/,\n // \"bind X on Y\", \"pass X\", \"import X\" — an instruction to whoever maintains\n // the app, arriving on the screen of somebody who cannot act on it.\n /\\bbind\\s+[`'\"A-Za-z]/i,\n];\n\n/**\n * THE ONE GUARD ON A DOOR'S HINT. True when the hint is developer text and must never be\n * printed at a person: engineer shapes (package, SQLSTATE, component, camelCase, backticked\n * token), a code fence, stack-like lines, or a block too long to be one remedy (over 600).\n * Machine clauses INSIDE an otherwise plain hint are cut by `plainSentence`, not by this.\n */\nexport function isDeveloperHint(hint: string): boolean {\n const text = hint.trim();\n if (text === \"\") return false;\n if (text.includes(\"```\")) return true;\n if (/\\n\\s+at\\s+\\S+/.test(text)) return true;\n if (text.length > 600) return true;\n return isEngineerText(text);\n}\n\n/** The hint a person may read: cleaned to people's sentences, or null. The one place that decides. */\nexport function peopleHint(hint: string | null | undefined): string | null {\n const said = (hint ?? \"\").trim();\n if (said === \"\" || isDeveloperHint(said)) return null;\n return plainSentence(said).kept;\n}\n\n/** Whether this sentence was written for whoever maintains the code. */\nexport function isEngineerText(text: string): boolean {\n return ENGINEER_TEXT.some((shape) => shape.test(text));\n}\n\n/** The one shape every screen in this package renders a refusal from. */\nexport interface PlainRefusal {\n /** The heading. Never the store's code. */\n title: string;\n /**\n * What happened, in the store's own words where they are a person's words\n * and in ours where they are not. Never empty.\n */\n sentence: string;\n /** What to do now. Never empty. */\n remedy: string;\n /**\n * TRUE when `sentence` is the store's own words (UI-FIX-19): a notice is then HEADED by that\n * sentence, never by the generic `title` over it.\n */\n storeSaid: boolean;\n /**\n * Everything a person should not read, kept for whoever has to debug it: the\n * SQLSTATE, the hint written for a caller, and any clause dropped above.\n * Kept on the notice's `data-for-engineers` attribute only (UI-FIX-19): never a\n * tooltip, never text a screen can copy or read aloud; never deleted.\n */\n forEngineers: string;\n}\n\n/**\n * A sentence with its machine clauses taken out — or null when nothing honest\n * is left. Clauses are split on the joins the store's own `format()` templates\n * use (\"…, so custom.x may not write to it\", \"… — FLD-11: …\").\n */\nfunction withoutMachineClauses(sentence: string): { kept: string | null; dropped: string[] } {\n const dropped: string[] = [];\n // 🚨 A PARENTHETICAL ID IS EXCISED, NOT A REASON TO BIN THE SENTENCE AROUND IT\n // (lane LIMITS-FIX-UI, 2026-09-21). The store's own way out for a colleague who\n // is not in the organization — \"Invite them to the organization, share with\n // their organization instead (VIS-23), or, if they are a client rather than a\n // colleague, put them in a portal\" — was thrown away WHOLE because of those\n // eight characters, so a plumbing company trying to show one customer her own\n // jobs was told nothing at all about what to do instead. A contract id in\n // brackets is a footnote: lift it out and the sentence around it is a person's\n // sentence. It is still kept for the engineer, below.\n const footnotes: string[] = [];\n const withoutFootnotes = sentence.replace(/\\s*\\((?:see\\s+)?[A-Z]{2,5}-[A-Z0-9-]{1,8}\\)/g, (hit) => {\n footnotes.push(hit.trim());\n return \"\";\n });\n dropped.push(...footnotes);\n const clauses = withoutFootnotes\n .split(/(?:,\\s+so\\s+|\\s+—\\s+|\\s+--\\s+|\\s*\\|\\s*)/)\n .map((clause) => clause.trim())\n .filter((clause) => clause !== \"\");\n const kept = clauses.filter((clause) => {\n if (!isMachineIdentity(clause)) return true;\n dropped.push(clause);\n return false;\n });\n if (kept.length === 0) return { kept: null, dropped };\n // 🚨 A CLEANER THAT DROPPED NOTHING CHANGES NOTHING (same lane, same day).\n //\n // The split above is on the joins the store's `format()` templates use, and\n // \", so \" is one of them — which is also how ordinary English joins two\n // clauses. So \"That person is not in this organization, so they cannot be\n // given access to this table yet.\" came back out as \"That person is not in\n // this organization. they cannot be given access to this table yet.\" — a\n // sentence nobody wrote, with a lower-case word after a full stop, shown to\n // every person every time. Nothing was dropped from it; there was nothing to\n // clean. When that is true the sentence is returned exactly as the store wrote\n // it, and this function's re-joining only ever runs on a sentence it actually\n // took something out of.\n if (dropped.length === 0) return { kept: sentence.trim(), dropped };\n let joined = kept.join(\". \").replace(/\\.\\.+/g, \".\").trim();\n if (!/[.!?]$/.test(joined)) joined = `${joined}.`;\n return { kept: joined, dropped };\n}\n\n/**\n * THE PEOPLE-FACING SENTENCE OF A STORE MESSAGE, AND NOTHING AFTER IT (lane\n * RECORDS-UI-REFUSAL-TEXT, 2026-10-01). A refusal's message is one plain sentence,\n * then ` — ` and developer detail, or a second sentence written for whoever fixes the\n * caller. A person reads the first sentence only; the rest rides `forEngineers`.\n */\nfunction peopleSentence(message: string): { kept: string | null; dropped: string[] } {\n const [lead = \"\", ...tail] = message.split(/\\s+—\\s+|\\s+--\\s+/);\n // A full stop after an abbreviation or an initial (\"Ask Dr. Whitfield\", \"e.g. a quote\") is not an end.\n const sentences = lead.trim().split(/(?<=(?<!\\b(?:Dr|Mr|Mrs|Ms|St|vs|No|e\\.g|i\\.e|etc|[A-Z]))[.!?])\\s+/);\n const first = sentences[0] ?? \"\";\n const rest = [...sentences.slice(1), ...tail].map((part) => part.trim()).filter((part) => part !== \"\");\n const cleaned = plainSentence(first);\n return { kept: cleaned.kept, dropped: [...cleaned.dropped, ...rest] };\n}\n\n/**\n * THE ONE SENTENCE A PERSON READS FOR A REFUSAL — the store's first sentence, or the\n * title when nothing of it is a person's words. Never the hint, details, code or\n * SQLSTATE. Every place that needs a refusal as a string (a toast, a cell, a banner)\n * calls this and nothing else; `check:records-ui-refusal-text` fails on a raw\n * `error.message` / `error.hint` render anywhere else.\n */\nexport function refusalSentence(error: Pick<RecordsError, \"message\"> & Partial<RecordsError>): string {\n return refusalForAPerson(error as RecordsError).sentence;\n}\n\n// A BUILD LABEL OPENING A SENTENCE (lane CLOSE-LINK, CD-LINK-07): the acceptance test or the lane/rule tag the store was\n// built against — \"Test 3 (Reparent):\", \"REC-21:\", \"T5 / VAL-4:\", \"CLOSE-LINK:\". A person never reads it, and it is\n// never a reason to drop the remedy after it (which is what the machine-identity filter did to the whole sentence).\nconst BUILD_LABEL = String.raw`(?:Test \\d+ \\([^)]{1,40}\\)|[A-Z][A-Z0-9]*(?:-[A-Z0-9]+)+|[A-Z]{1,5}\\d+[a-z]?)`;\nconst LEADING_BUILD_LABEL = new RegExp(String.raw`^${BUILD_LABEL}(?:\\s*\\/\\s*${BUILD_LABEL})*:\\s+`);\n\n/** The sentence with any build label lifted off its start, the label kept for engineers. */\nfunction withoutBuildLabel(sentence: string): { label: string | null; rest: string } {\n const hit = LEADING_BUILD_LABEL.exec(sentence);\n if (!hit) return { label: null, rest: sentence };\n const rest = sentence.slice(hit[0].length).trim();\n return { label: hit[0].trim(), rest: rest.charAt(0).toUpperCase() + rest.slice(1) };\n}\n\n/** Every sentence of a message, cleaned; the ones that cannot be cleaned are dropped. */\nfunction plainSentence(message: string): { kept: string | null; dropped: string[] } {\n const dropped: string[] = [];\n const kept: string[] = [];\n for (const raw of message.split(/(?<=[.!?])\\s+/)) {\n const labelled = withoutBuildLabel(raw.trim());\n if (labelled.label) dropped.push(labelled.label);\n const sentence = labelled.rest;\n if (sentence === \"\") continue;\n const cleaned = withoutMachineClauses(sentence);\n dropped.push(...cleaned.dropped);\n if (cleaned.kept) kept.push(cleaned.kept);\n }\n return { kept: kept.length === 0 ? null : kept.join(\" \"), dropped };\n}\n\n/** A remedy is a sentence, not the one word left after a build label was lifted off (\"FLD-1: text.\" keeps \"Text.\"). */\nfunction readsAsASentence(text: string | null): boolean {\n return (text ?? \"\").trim().split(/\\s+/).filter(Boolean).length >= 2;\n}\n\n/** The example a pattern refusal carries in its detail, when it carries one. */\nfunction exampleOf(error: RecordsError): string | null {\n const detail = (error as { detail?: unknown }).detail;\n if (!detail || typeof detail !== \"object\") return null;\n const example = (detail as { example?: unknown }).example;\n return typeof example === \"string\" && example.trim() !== \"\" ? example.trim() : null;\n}\n\n/** What a statement timeout says of itself, in place of the database's own words. */\n// ONE SENTENCE EVERYWHERE: the same words as design-system's `TIMED_OUT_SENTENCE` (what every screen prints through\n// `refusalSaid`) and records' `TIMED_OUT_MESSAGE`. This file is the light helpers door, so it cannot import either\n// (design-system's root is heavy); `a-timeout-reads-as-the-platforms-sentence.test.tsx` fails if the three drift.\nconst TIMED_OUT_SAID = \"That took too long. Nothing was lost; try again.\";\n\n/**\n * THE FORMATTER. Every refusal a screen in this package shows goes through\n * here, and nothing in this package renders `error.message` directly.\n */\nexport function refusalForAPerson(error: RecordsError): PlainRefusal {\n const code = error.code ?? \"internal\";\n // A STATEMENT TIMEOUT is the database's words, never a person's (AT-SNAPJOB-2, 2026-10-19: a base rename showed\n // \"canceling statement due to statement timeout\"). Whatever way it arrived (the package's `timed_out`, SQLSTATE\n // 57014, or only Postgres' sentence on an error with no code) it reads as the timed-out refusal: its title and\n // remedy below, and a sentence of our own in place of the database's.\n const timedOut =\n code === \"timed_out\" ||\n (error as { sqlstate?: string }).sqlstate === \"57014\" ||\n /canceling statement due to statement timeout/i.test(String(error.message ?? \"\"));\n // A refusal THIS package wrote (`refusals.ts` marks it `ours`) is whole people-facing prose, a\n // count then a reason; only a door's message is cut after its first sentence.\n const ours = (error as { ours?: unknown }).ours === true;\n const hint = plainSentence(String(error.hint ?? \"\"));\n const message = ours ? plainSentence(String(error.message ?? \"\")) : peopleSentence(String(error.message ?? \"\"));\n\n const title = timedOut ? TITLE[\"timed_out\"]! : (TITLE[code] ?? \"That was refused\");\n\n // 🚨 ONE REMEDY, AND IT IS THE DOOR'S OWN WHEN THE DOOR HAS ONE (lane\n // LIMITS-FIX-UI, 2026-09-21).\n //\n // The table below is a FALLBACK, not an answer. `custom.share_grant` refuses a\n // colleague who is not in the organization with its own three ways forward —\n // *\"Invite them to the organization, share with their organization instead, or,\n // if they are a client rather than a colleague, put them in a portal\"* — and\n // this formatter used to print that AND then \"Change the value so it passes,\n // then try again\", which is not a thing anybody can do about a membership. Two\n // remedies, one of them wrong, is worse than one: a person follows the last\n // sentence they read. The door that refused knows more about the way out than\n // a table keyed on a code does, so its hint wins whenever it survived the\n // machine-identity filter, and the table answers when it did not.\n // 🚨 THE DOOR'S HINT IS THE REMEDY WHEN IT READS AS A PERSON'S SENTENCE (chair ruling,\n // 2026-10-01, restoring the 2026-09-21 one-remedy ruling). A hint that is developer text (a\n // SQL state, a snake_case name, a uuid, a code fence, a stack, a package or component name)\n // is never printed: it rides `forEngineers` and the code's table sentence is the remedy.\n const hintIsForEngineers = isDeveloperHint(String(error.hint ?? \"\"));\n // STORE-RULE-GAPS: a pattern that carries an example hands it over as DATA\n // (`detail.example`), because an example is the person's own shape of value.\n const example = exampleOf(error);\n const remedy =\n (example ? `Enter it like ${example}.` : null) ??\n (hintIsForEngineers || !readsAsASentence(hint.kept) ? null : hint.kept) ??\n (timedOut ? REMEDY[\"timed_out\"] : REMEDY[code]) ??\n REMEDY[\"internal\"]!;\n\n // The store's own sentence for what happened. Its hint is the REMEDY above\n // rather than more of this, so the two halves never say the same thing twice.\n // A STORE MESSAGE IS NEVER ENGINEER TEXT; a stand-in written by a client can\n // be, and a person must not read it. It still reaches the engineer's line.\n const messageIsForEngineers = isEngineerText(String(error.message ?? \"\"));\n const said = timedOut ? TIMED_OUT_SAID : (messageIsForEngineers ? \"\" : (message.kept ?? \"\")).trim();\n\n const forEngineers = [\n error.sqlstate ? `SQLSTATE ${error.sqlstate}.` : null,\n // The client's own note about a class it did not recognize, or a call that\n // never reached the store. It is rendered out of sight, never as a sentence.\n error.diagnostic ? error.diagnostic : null,\n messageIsForEngineers || timedOut ? `Message: ${error.message}` : null,\n error.hint && (hintIsForEngineers || hint.kept !== error.hint) ? `Hint: ${error.hint}` : null,\n message.dropped.length > 0 || hint.dropped.length > 0\n ? `Dropped from the person's view: ${[...message.dropped, ...hint.dropped].join(\" | \")}`\n : null,\n ]\n .filter(Boolean)\n .join(\" \");\n\n return {\n title,\n // Nothing invented. When every clause was machine identity the title says\n // what happened and the remedy says what to do; a made-up diagnosis would\n // be worse than the identifier it replaced.\n sentence: said === \"\" ? `${title}.` : said,\n remedy,\n storeSaid: said !== \"\",\n forEngineers,\n };\n}\n\n/**\n * The same answer as one line, for a cell or a field where a block would break\n * the layout. Still one sentence and one remedy — never the sentence alone,\n * because half of this formatter's job is the thing to do next.\n */\nexport function refusalLineForAPerson(error: RecordsError): string {\n const plain = refusalForAPerson(error);\n // TWO SENTENCES, NOT ONE RUN-ON (VERIFIER-15/16): the store's rule message has no\n // full stop (\"Pressure (psi) has to be at least 0\"), and joining it to the remedy\n // read \"…at least 0 Send this column somewhere else\". A line ends its sentence.\n const sentence = plain.sentence.trim();\n const ended = sentence === \"\" || /[.!?…:]$/.test(sentence) ? sentence : `${sentence}.`;\n return `${ended} ${plain.remedy}`.trim();\n}\n\n/** The store refused because the request was missing something (22023 / invalid_argument): a decision, never text to print. */\nexport function refusalIsMissingInput(error: Partial<RecordsError>): boolean {\n return error.sqlstate === \"22023\" || error.code === \"invalid_argument\";\n}\n\n/**\n * A STORED SENTENCE WITHOUT ITS INTERNAL CODES (lane F2, D11). The store's older sentences — a kept-aside\n * reason, a migration note — end with the spec codes they were written against (\"(FLD-4 / T12)\",\n * \"(VAL-1)\"). Those codes are for the people who wrote the store; the store no longer writes them, and the\n * ones already saved come off here, wherever a person reads them.\n */\nexport function withoutInternalCodes(text: string): string {\n return text\n .replace(/\\s*\\((?:[A-Z]{2,}-\\d+[A-Za-z]?|T\\d+)(?:\\s*\\/\\s*(?:[A-Z]{2,}-\\d+[A-Za-z]?|T\\d+))*\\)/g, \"\")\n .replace(/\\s+([.,;])/g, \"$1\")\n .trim();\n}\n"],"mappings":";;;AA+DO,IAAM,mBAA6B;AAAA,EACxC;AAAA;AAA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AM,aAAa,WAAW,MAAM,SAAS;AACtD;AAQO,SAAS,qBAAqB,MAAsB;AACzD,SAAO,KACJ,QAAQ,uFAAuF,EAAE,EACjG,QAAQ,eAAe,IAAI,EAC3B,KAAK;AACV;","names":[]}
@@ -161,7 +161,7 @@ function GridSkeleton({ embedded, rows }) {
161
161
  ] });
162
162
  }
163
163
  var CHART_PLOT_PX = 140;
164
- var RECORDS_GRID_ROW_PX = 35;
164
+ var RECORDS_GRID_ROW_PX = 31;
165
165
  function Cards({ count, className }) {
166
166
  return /* @__PURE__ */ jsx(Fragment, { children: Array.from({ length: count }, (_, i) => /* @__PURE__ */ jsx(Skeleton, { shape: "block", className }, i)) });
167
167
  }
@@ -304,4 +304,4 @@ export {
304
304
  RecordsSkeleton,
305
305
  TablePageSkeleton
306
306
  };
307
- //# sourceMappingURL=chunk-7J7AUZ25.js.map
307
+ //# sourceMappingURL=chunk-D476B6JU.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/skeletonLayout.ts","../src/RecordsSkeleton.tsx","../src/rememberedRows.ts"],"sourcesContent":["// 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 | \"pivot\"\n | \"swipe\"\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 \"pivot\",\n \"swipe\",\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\n/**\n * THE GEOMETRY OF AN EMBEDDED GRID, MEASURED ON A LIVE SPACES PAGE (lane SKELETON-HEIGHT, 2026-10-17).\n * A loading frame that is not the loaded frame moves everything under it when the rows land. The\n * embedded grid is: a 12px wrap (the body's 4px padding twice plus its 4px gap), the data table's 36px\n * header, one 37px row per record, and the footer line (44.5px: the add-row line) when there is a row.\n * Pure numbers, so a host can size a frame before it loads any screen.\n */\nexport const EMBEDDED_ROW_PX = 37;\nexport const EMBEDDED_HEADER_PX = 36;\nexport const EMBEDDED_FOOTER_PX = 44.5;\nexport const EMBEDDED_WRAP_PX = 12;\n/** An embedded table reads this many rows at a time (the same number as `EMBEDDED_PAGE_SIZE`, firstPage.ts; a test holds them equal). */\nexport const SKELETON_EMBEDDED_PAGE_ROWS = 50;\n/** A full page's grid reads this many rows at a time (the page's own `pageSize`). */\nexport const SKELETON_PAGE_ROWS = 100;\n\n/**\n * THE ROWS A LOADING FRAME DRAWS WHEN THE SERVER KNOWS HOW MANY THE PERSON SEES: min(rows, page size).\n * `rowsVisible` is the count the store gave (`custom.where_id_opens` / the table bundle: the caller's own\n * visible rows, capped), `pageSize` the rows the surface reads first. Null/undefined/invalid = not known.\n */\nexport function skeletonRowsFor(rowsVisible: number | null | undefined, pageSize: number): number | null {\n if (typeof rowsVisible !== \"number\" || !Number.isFinite(rowsVisible) || rowsVisible < 0) return null;\n return Math.min(Math.floor(rowsVisible), pageSize);\n}\n\n/** The height (px) of an embedded grid's body with `rows` rows drawn: the loaded body's own height. */\nexport function embeddedGridBodyPx(rows: number): number {\n return EMBEDDED_WRAP_PX + EMBEDDED_HEADER_PX + EMBEDDED_ROW_PX * rows + (rows > 0 ? EMBEDDED_FOOTER_PX : 0);\n}\n\n/**\n * THE CARDS EACH BOARD COLUMN DRAWS WHEN THE SERVER KNOWS THEM (lane SKELETON-HEIGHT-2): the store's\n * per-group counts (`opening_view.groups`), each min(cards, page size). Null = not known (empty or invalid),\n * so the board skeleton keeps its stand-in columns. A column with no card still draws (its header).\n */\nexport function skeletonColumnsFor(groups: readonly number[] | null | undefined, pageSize: number): number[] | null {\n if (!Array.isArray(groups) || groups.length === 0) return null;\n const out: number[] = [];\n for (const g of groups) {\n if (typeof g !== \"number\" || !Number.isFinite(g) || g < 0) return null;\n out.push(Math.min(Math.floor(g), pageSize));\n }\n return out;\n}\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 gray 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 { createContext, useContext, useMemo, useSyncExternalStore, type ReactNode } from \"react\";\nimport { cn } from \"@ai-matrx/design-system/cn\";\nimport { Skeleton } from \"@ai-matrx/design-system/skeleton\";\nimport { MatrxDataTable } from \"@ai-matrx/design-system/data-table/lazy\";\nimport type { MatrxColumnDef } from \"@ai-matrx/design-system/data-table/types\";\n\nimport { EMBEDDED_PLAIN_FOOTER_CLASS, EMBEDDED_TABLE_CLASS } from \"./embeddedLook\";\nimport { rememberedLayout, rememberedRowCount } from \"./rememberedRows\";\nimport {\n EMBEDDED_FOOTER_PX,\n EMBEDDED_ROW_PX,\n EMBEDDED_WRAP_PX,\n SKELETON_EMBEDDED_PAGE_ROWS,\n SKELETON_PAGE_ROWS,\n skeletonLayoutFor,\n skeletonColumnsFor,\n skeletonRowsFor,\n type RecordsSkeletonLayout,\n} 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 {\n EMBEDDED_FOOTER_PX,\n EMBEDDED_HEADER_PX,\n EMBEDDED_ROW_PX,\n EMBEDDED_WRAP_PX,\n RECORDS_SKELETON_LAYOUTS,\n SKELETON_EMBEDDED_PAGE_ROWS,\n SKELETON_PAGE_ROWS,\n embeddedGridBodyPx,\n skeletonColumnsFor,\n skeletonLayoutFor,\n skeletonRowsFor,\n type RecordsSkeletonLayout,\n} from \"./skeletonLayout\";\n\ninterface Expected {\n rows: number | null;\n /** A board's cards per column (the store's opening view): a board skeleton draws these columns. */\n groups: number[] | null;\n}\nconst ExpectedRowsContext = createContext<Expected>({ rows: null, groups: null });\n\n/**\n * HOW MANY ROWS THE SERVER SAYS THIS PERSON SEES (lane SKELETON-HEIGHT). A host that knows the count\n * before the table loads (`rows_visible` from the store's `where_id_opens` / table bundle) wraps the table in\n * this; every loading frame below — the skeleton, the page skeleton, the grid's own first frame — then paints\n * min(rows, its page size) rows, the height the loaded table will have, and nothing under it moves.\n * `groups` (lane SKELETON-HEIGHT-2) is the cards each board column holds (`opening_view.groups`): a board's\n * skeleton then draws that many columns, each min(cards, page size) tall; a gallery's draws `rows` cards.\n */\nexport function ExpectedRows({ rows, groups, children }: { rows: number | null | undefined; groups?: readonly number[] | null | undefined; children: ReactNode }) {\n const value = useMemo<Expected>(\n () => ({ rows: typeof rows === \"number\" && rows >= 0 ? rows : null, groups: skeletonColumnsFor(groups, Number.MAX_SAFE_INTEGER) }),\n [rows, groups],\n );\n return <ExpectedRowsContext.Provider value={value}>{children}</ExpectedRowsContext.Provider>;\n}\n\n/** The rows a loading frame draws from what the host said it knows (null = nobody told it). */\nexport function useExpectedRows(embedded: boolean): number | null {\n return skeletonRowsFor(useContext(ExpectedRowsContext).rows, embedded ? SKELETON_EMBEDDED_PAGE_ROWS : SKELETON_PAGE_ROWS);\n}\n\n/** The cards each board column draws (page size capped), or null when the host did not say. */\nexport function useExpectedColumns(embedded: boolean): number[] | null {\n return skeletonColumnsFor(useContext(ExpectedRowsContext).groups, embedded ? SKELETON_EMBEDDED_PAGE_ROWS : SKELETON_PAGE_ROWS);\n}\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. The row holds tap buttons and tap groups, whose footprint is\n * the design system's tap box (38px: the 32px pill plus its gap), so the row is that tall before the\n * toolbar mounts — at 32px the first paint was 6px short and the whole grid moved down when the\n * toolbar's controls arrived (CLS on /data/<table>, admin and member alike). A chip that arrives\n * later can never make it taller or shorter.\n */\nexport const TABLE_TOOLBAR_ROW_CLASS =\n \"flex min-h-[var(--matrx-tap-box,2.375rem)] 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 const table = (\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={embedded ? EMBEDDED_ROW_PX : 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 if (!embedded) return table;\n // The loaded embedded grid: the body's wrap (6px above and below) and, once there is a row, the add-row footer.\n return (\n <div style={{ paddingBlock: EMBEDDED_WRAP_PX / 2 }} data-records-skeleton-part=\"embedded-grid\">\n {table}\n {rows === \"fill\" || rows > 0 ? <div style={{ height: EMBEDDED_FOOTER_PX }} data-records-skeleton-part=\"footer\" /> : null}\n </div>\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, columns, known }: { layout: RecordsSkeletonLayout; embedded: boolean; rows: number | \"fill\"; columns?: number[] | null; known?: number | \"fill\" | undefined }) {\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 {(columns ?? [3, 2, 3, 2]).map((cards, c) => (\n <div key={c} className=\"flex w-64 shrink-0 flex-col gap-2 rounded-lg bg-muted/40 p-2\" data-records-skeleton-part=\"column\">\n <Skeleton shape=\"line\" width=\"1/2\" className=\"my-1.5\" />\n <Cards count={cards} 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={typeof known === \"number\" ? known : 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 \"pivot\":\n // The box the pivot layout reserves (`PIVOT_BOX`, PivotLayout.tsx): the skeleton and the loaded table share it.\n return <Skeleton className=\"min-h-[16rem] w-full rounded-md\" data-records-skeleton-part=\"body\" />;\n case \"map\":\n case \"orgchart\":\n case \"swipe\":\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 const expected = useExpectedRows(embedded);\n const columns = useExpectedColumns(embedded);\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 ?? expected ?? (embedded ? 5 : \"fill\")} columns={columns} known={rows ?? expected ?? undefined} />\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 expected = useExpectedRows(embedded);\n // What the server said this person sees outranks what this browser remembers from last visit.\n const painted = rows ?? expected ?? (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","/**\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"],"mappings":";;;;;;;AAsBO,IAAM,2BAA6D;AAAA,EACxE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,SAAS,kBAAkB,QAA0D;AAC1F,MAAI,WAAW,WAAW,WAAW,WAAY,QAAO;AACxD,SAAQ,yBAA+C,SAAS,UAAU,EAAE,IACvE,SACD;AACN;AASO,IAAM,kBAAkB;AACxB,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAC3B,IA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AAC,SAAI,WAAU,sCAAqC,sBAAmB,IACrE,8BAAC,mBAAgB,QAAgB,UAAqB,GAAI,YAAY,SAAY,EAAE,MAAM,QAAQ,IAAI,CAAC,GAAI,GAC7G;AAAA,KACF,GACF;AAEJ;","names":[]}
1
+ {"version":3,"sources":["../src/skeletonLayout.ts","../src/RecordsSkeleton.tsx","../src/rememberedRows.ts"],"sourcesContent":["// 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 | \"pivot\"\n | \"swipe\"\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 \"pivot\",\n \"swipe\",\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\n/**\n * THE GEOMETRY OF AN EMBEDDED GRID, MEASURED ON A LIVE SPACES PAGE (lane SKELETON-HEIGHT, 2026-10-17).\n * A loading frame that is not the loaded frame moves everything under it when the rows land. The\n * embedded grid is: a 12px wrap (the body's 4px padding twice plus its 4px gap), the data table's 36px\n * header, one 37px row per record, and the footer line (44.5px: the add-row line) when there is a row.\n * Pure numbers, so a host can size a frame before it loads any screen.\n */\nexport const EMBEDDED_ROW_PX = 37;\nexport const EMBEDDED_HEADER_PX = 36;\nexport const EMBEDDED_FOOTER_PX = 44.5;\nexport const EMBEDDED_WRAP_PX = 12;\n/** An embedded table reads this many rows at a time (the same number as `EMBEDDED_PAGE_SIZE`, firstPage.ts; a test holds them equal). */\nexport const SKELETON_EMBEDDED_PAGE_ROWS = 50;\n/** A full page's grid reads this many rows at a time (the page's own `pageSize`). */\nexport const SKELETON_PAGE_ROWS = 100;\n\n/**\n * THE ROWS A LOADING FRAME DRAWS WHEN THE SERVER KNOWS HOW MANY THE PERSON SEES: min(rows, page size).\n * `rowsVisible` is the count the store gave (`custom.where_id_opens` / the table bundle: the caller's own\n * visible rows, capped), `pageSize` the rows the surface reads first. Null/undefined/invalid = not known.\n */\nexport function skeletonRowsFor(rowsVisible: number | null | undefined, pageSize: number): number | null {\n if (typeof rowsVisible !== \"number\" || !Number.isFinite(rowsVisible) || rowsVisible < 0) return null;\n return Math.min(Math.floor(rowsVisible), pageSize);\n}\n\n/** The height (px) of an embedded grid's body with `rows` rows drawn: the loaded body's own height. */\nexport function embeddedGridBodyPx(rows: number): number {\n return EMBEDDED_WRAP_PX + EMBEDDED_HEADER_PX + EMBEDDED_ROW_PX * rows + (rows > 0 ? EMBEDDED_FOOTER_PX : 0);\n}\n\n/**\n * THE CARDS EACH BOARD COLUMN DRAWS WHEN THE SERVER KNOWS THEM (lane SKELETON-HEIGHT-2): the store's\n * per-group counts (`opening_view.groups`), each min(cards, page size). Null = not known (empty or invalid),\n * so the board skeleton keeps its stand-in columns. A column with no card still draws (its header).\n */\nexport function skeletonColumnsFor(groups: readonly number[] | null | undefined, pageSize: number): number[] | null {\n if (!Array.isArray(groups) || groups.length === 0) return null;\n const out: number[] = [];\n for (const g of groups) {\n if (typeof g !== \"number\" || !Number.isFinite(g) || g < 0) return null;\n out.push(Math.min(Math.floor(g), pageSize));\n }\n return out;\n}\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 gray 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 { createContext, useContext, useMemo, useSyncExternalStore, type ReactNode } from \"react\";\nimport { cn } from \"@ai-matrx/design-system/cn\";\nimport { Skeleton } from \"@ai-matrx/design-system/skeleton\";\nimport { MatrxDataTable } from \"@ai-matrx/design-system/data-table/lazy\";\nimport type { MatrxColumnDef } from \"@ai-matrx/design-system/data-table/types\";\n\nimport { EMBEDDED_PLAIN_FOOTER_CLASS, EMBEDDED_TABLE_CLASS } from \"./embeddedLook\";\nimport { rememberedLayout, rememberedRowCount } from \"./rememberedRows\";\nimport {\n EMBEDDED_FOOTER_PX,\n EMBEDDED_ROW_PX,\n EMBEDDED_WRAP_PX,\n SKELETON_EMBEDDED_PAGE_ROWS,\n SKELETON_PAGE_ROWS,\n skeletonLayoutFor,\n skeletonColumnsFor,\n skeletonRowsFor,\n type RecordsSkeletonLayout,\n} 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 {\n EMBEDDED_FOOTER_PX,\n EMBEDDED_HEADER_PX,\n EMBEDDED_ROW_PX,\n EMBEDDED_WRAP_PX,\n RECORDS_SKELETON_LAYOUTS,\n SKELETON_EMBEDDED_PAGE_ROWS,\n SKELETON_PAGE_ROWS,\n embeddedGridBodyPx,\n skeletonColumnsFor,\n skeletonLayoutFor,\n skeletonRowsFor,\n type RecordsSkeletonLayout,\n} from \"./skeletonLayout\";\n\ninterface Expected {\n rows: number | null;\n /** A board's cards per column (the store's opening view): a board skeleton draws these columns. */\n groups: number[] | null;\n}\nconst ExpectedRowsContext = createContext<Expected>({ rows: null, groups: null });\n\n/**\n * HOW MANY ROWS THE SERVER SAYS THIS PERSON SEES (lane SKELETON-HEIGHT). A host that knows the count\n * before the table loads (`rows_visible` from the store's `where_id_opens` / table bundle) wraps the table in\n * this; every loading frame below — the skeleton, the page skeleton, the grid's own first frame — then paints\n * min(rows, its page size) rows, the height the loaded table will have, and nothing under it moves.\n * `groups` (lane SKELETON-HEIGHT-2) is the cards each board column holds (`opening_view.groups`): a board's\n * skeleton then draws that many columns, each min(cards, page size) tall; a gallery's draws `rows` cards.\n */\nexport function ExpectedRows({ rows, groups, children }: { rows: number | null | undefined; groups?: readonly number[] | null | undefined; children: ReactNode }) {\n const value = useMemo<Expected>(\n () => ({ rows: typeof rows === \"number\" && rows >= 0 ? rows : null, groups: skeletonColumnsFor(groups, Number.MAX_SAFE_INTEGER) }),\n [rows, groups],\n );\n return <ExpectedRowsContext.Provider value={value}>{children}</ExpectedRowsContext.Provider>;\n}\n\n/** The rows a loading frame draws from what the host said it knows (null = nobody told it). */\nexport function useExpectedRows(embedded: boolean): number | null {\n return skeletonRowsFor(useContext(ExpectedRowsContext).rows, embedded ? SKELETON_EMBEDDED_PAGE_ROWS : SKELETON_PAGE_ROWS);\n}\n\n/** The cards each board column draws (page size capped), or null when the host did not say. */\nexport function useExpectedColumns(embedded: boolean): number[] | null {\n return skeletonColumnsFor(useContext(ExpectedRowsContext).groups, embedded ? SKELETON_EMBEDDED_PAGE_ROWS : SKELETON_PAGE_ROWS);\n}\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. The row holds tap buttons and tap groups, whose footprint is\n * the design system's tap box (38px: the 32px pill plus its gap), so the row is that tall before the\n * toolbar mounts — at 32px the first paint was 6px short and the whole grid moved down when the\n * toolbar's controls arrived (CLS on /data/<table>, admin and member alike). A chip that arrives\n * later can never make it taller or shorter.\n */\nexport const TABLE_TOOLBAR_ROW_CLASS =\n \"flex min-h-[var(--matrx-tap-box,2.375rem)] 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 const table = (\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={embedded ? EMBEDDED_ROW_PX : 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 if (!embedded) return table;\n // The loaded embedded grid: the body's wrap (6px above and below) and, once there is a row, the add-row footer.\n return (\n <div style={{ paddingBlock: EMBEDDED_WRAP_PX / 2 }} data-records-skeleton-part=\"embedded-grid\">\n {table}\n {rows === \"fill\" || rows > 0 ? <div style={{ height: EMBEDDED_FOOTER_PX }} data-records-skeleton-part=\"footer\" /> : null}\n </div>\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 28px row-action strip (`--matrx-table-row-action-size`\n * 1.75rem), plus its cell padding and rule. */\nexport const RECORDS_GRID_ROW_PX = 31;\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, columns, known }: { layout: RecordsSkeletonLayout; embedded: boolean; rows: number | \"fill\"; columns?: number[] | null; known?: number | \"fill\" | undefined }) {\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 {(columns ?? [3, 2, 3, 2]).map((cards, c) => (\n <div key={c} className=\"flex w-64 shrink-0 flex-col gap-2 rounded-lg bg-muted/40 p-2\" data-records-skeleton-part=\"column\">\n <Skeleton shape=\"line\" width=\"1/2\" className=\"my-1.5\" />\n <Cards count={cards} 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={typeof known === \"number\" ? known : 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 \"pivot\":\n // The box the pivot layout reserves (`PIVOT_BOX`, PivotLayout.tsx): the skeleton and the loaded table share it.\n return <Skeleton className=\"min-h-[16rem] w-full rounded-md\" data-records-skeleton-part=\"body\" />;\n case \"map\":\n case \"orgchart\":\n case \"swipe\":\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 const expected = useExpectedRows(embedded);\n const columns = useExpectedColumns(embedded);\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 ?? expected ?? (embedded ? 5 : \"fill\")} columns={columns} known={rows ?? expected ?? undefined} />\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 expected = useExpectedRows(embedded);\n // What the server said this person sees outranks what this browser remembers from last visit.\n const painted = rows ?? expected ?? (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","/**\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"],"mappings":";;;;;;;AAsBO,IAAM,2BAA6D;AAAA,EACxE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAGO,SAAS,kBAAkB,QAA0D;AAC1F,MAAI,WAAW,WAAW,WAAW,WAAY,QAAO;AACxD,SAAQ,yBAA+C,SAAS,UAAU,EAAE,IACvE,SACD;AACN;AASO,IAAM,kBAAkB;AACxB,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AAEzB,IAAM,8BAA8B;AAEpC,IAAM,qBAAqB;AAO3B,SAAS,gBAAgB,aAAwC,UAAiC;AACvG,MAAI,OAAO,gBAAgB,YAAY,CAAC,OAAO,SAAS,WAAW,KAAK,cAAc,EAAG,QAAO;AAChG,SAAO,KAAK,IAAI,KAAK,MAAM,WAAW,GAAG,QAAQ;AACnD;AAGO,SAAS,mBAAmB,MAAsB;AACvD,SAAO,mBAAmB,qBAAqB,kBAAkB,QAAQ,OAAO,IAAI,qBAAqB;AAC3G;AAOO,SAAS,mBAAmB,QAA8C,UAAmC;AAClH,MAAI,CAAC,M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A;AAAA,EAC/J;AAEJ;AAOO,SAAS,kBAAkB;AAAA,EAChC,QAAQ;AAAA,EACR,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AACF,GAAyB;AACvB,QAAM,aAAa,sBAAsB,WAAW,SAAY,OAAO;AAEvE,QAAM,iBAAiB,oBAAoB,YAAY,cAAc,SAAY,OAAO;AACxF,QAAM,SAAgC,eAAe,kBAAkB,cAAc;AACrF,QAAM,WAAW,gBAAgB,QAAQ;AAEzC,QAAM,UAAU,QAAQ,aAAa,eAAe,SAAS,SAAY;AACzE,SACE,oBAAC,SAAI,WAAW,GAAG,wBAAwB,SAAS,GAAG,8BAA4B,QACjF,+BAAC,SAAI,WAAW,yBACd;AAAA,yBAAC,SAAI,WAAW,yBAAyB,sBAAmB,IAAG,8BAA2B,WAAU,eAAY,QAC9G;AAAA,0BAAC,YAAS,OAAM,WAAU,OAAM,MAAK,WAAU,QAAO;AAAA,MACtD,oBAAC,YAAS,OAAM,WAAU,WAAU,QAAO;AAAA,MAC3C,oBAAC,YAAS,OAAM,WAAU,WAAU,QAAO;AAAA,MAC3C,qBAAC,SAAI,WAAU,qCACb;AAAA,4BAAC,YAAS,OAAM,WAAU,OAAM,MAAK;AAAA,QACrC,oBAAC,YAAS,OAAM,WAAU,WAAU,QAAO;AAAA,SAC7C;AAAA,OACF;AAAA,IACA,oBAAC,SAAI,WAAU,sCAAqC,sBAAmB,IACrE,8BAAC,mBAAgB,QAAgB,UAAqB,GAAI,YAAY,SAAY,EAAE,MAAM,QAAQ,IAAI,CAAC,GAAI,GAC7G;AAAA,KACF,GACF;AAEJ;","names":[]}
@@ -27,7 +27,7 @@ import {
27
27
  useRecordsUi,
28
28
  useTableRights,
29
29
  writeOnTheWinningVersion_exports
30
- } from "./chunk-KJAVVXRW.js";
30
+ } from "./chunk-W2P3LXJY.js";
31
31
  import {
32
32
  guessColumn,
33
33
  readTableShapes,
@@ -5206,4 +5206,4 @@ export {
5206
5206
  shapesOfSource,
5207
5207
  SaveToTable
5208
5208
  };
5209
- //# sourceMappingURL=chunk-6RFL5KYR.js.map
5209
+ //# sourceMappingURL=chunk-EPZG2VCY.js.map