@ai-matrx/records-ui 0.116.24 → 0.116.26

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +37 -1
  2. package/README.md +3 -3
  3. package/dist/SaveToTable-P3MPRSCW.js +20 -0
  4. package/dist/{chunk-WQGFKNE2.js → chunk-4NJUW3VM.js} +26 -26
  5. package/dist/chunk-4NJUW3VM.js.map +1 -0
  6. package/dist/{chunk-MUK63ANA.js → chunk-4ZS4WEEE.js} +3 -3
  7. package/dist/chunk-4ZS4WEEE.js.map +1 -0
  8. package/dist/{chunk-SYHUPGCU.js → chunk-6Z537SLG.js} +1 -1
  9. package/dist/{chunk-SYHUPGCU.js.map → chunk-6Z537SLG.js.map} +1 -1
  10. package/dist/{chunk-ODABFEHG.js → chunk-7RSMA3NK.js} +3 -3
  11. package/dist/chunk-7RSMA3NK.js.map +1 -0
  12. package/dist/{chunk-VHZKLE63.js → chunk-FLIERNH7.js} +9 -9
  13. package/dist/chunk-FLIERNH7.js.map +1 -0
  14. package/dist/{chunk-MCDA6L7E.js → chunk-HAWACXPU.js} +2 -2
  15. package/dist/chunk-HAWACXPU.js.map +1 -0
  16. package/dist/{chunk-ZNIXJ5RY.js → chunk-KQR2RA4V.js} +3 -3
  17. package/dist/{chunk-5IX4BL72.js → chunk-MBUW42SM.js} +2 -2
  18. package/dist/{chunk-5IX4BL72.js.map → chunk-MBUW42SM.js.map} +1 -1
  19. package/dist/{chunk-PPWNFIJ5.js → chunk-OV6QBL5R.js} +2 -2
  20. package/dist/{chunk-PPWNFIJ5.js.map → chunk-OV6QBL5R.js.map} +1 -1
  21. package/dist/{chunk-FECWKOWW.js → chunk-W7GR64CB.js} +1 -1
  22. package/dist/chunk-W7GR64CB.js.map +1 -0
  23. package/dist/{chunk-FHL4GG6R.js → chunk-WCQSJPLS.js} +2 -2
  24. package/dist/chunk-WCQSJPLS.js.map +1 -0
  25. package/dist/data-source.cjs.map +1 -1
  26. package/dist/data-source.d.cts +1 -1
  27. package/dist/data-source.d.ts +1 -1
  28. package/dist/data-source.js.map +1 -1
  29. package/dist/first-page.cjs.map +1 -1
  30. package/dist/first-page.d.cts +1 -1
  31. package/dist/first-page.d.ts +1 -1
  32. package/dist/first-page.js.map +1 -1
  33. package/dist/helpers.cjs +4 -4
  34. package/dist/helpers.cjs.map +1 -1
  35. package/dist/helpers.d.cts +9 -9
  36. package/dist/helpers.d.ts +9 -9
  37. package/dist/helpers.js +4 -4
  38. package/dist/helpers.js.map +1 -1
  39. package/dist/html-frame.cjs.map +1 -1
  40. package/dist/html-frame.d.cts +1 -1
  41. package/dist/html-frame.d.ts +1 -1
  42. package/dist/html-frame.js +1 -1
  43. package/dist/index.cjs +147 -116
  44. package/dist/index.cjs.map +1 -1
  45. package/dist/index.d.cts +46 -46
  46. package/dist/index.d.ts +46 -46
  47. package/dist/index.js +133 -102
  48. package/dist/index.js.map +1 -1
  49. package/dist/object-actions.cjs +2 -2
  50. package/dist/object-actions.cjs.map +1 -1
  51. package/dist/object-actions.js +3 -3
  52. package/dist/pickers.cjs +23 -23
  53. package/dist/pickers.cjs.map +1 -1
  54. package/dist/pickers.js +8 -8
  55. package/dist/skeleton.cjs.map +1 -1
  56. package/dist/skeleton.js +4 -4
  57. package/dist/table-shape.cjs.map +1 -1
  58. package/dist/table-shape.js +1 -1
  59. package/package.json +3 -3
  60. package/dist/SaveToTable-PGOQVYVS.js +0 -20
  61. package/dist/chunk-FECWKOWW.js.map +0 -1
  62. package/dist/chunk-FHL4GG6R.js.map +0 -1
  63. package/dist/chunk-MCDA6L7E.js.map +0 -1
  64. package/dist/chunk-MUK63ANA.js.map +0 -1
  65. package/dist/chunk-ODABFEHG.js.map +0 -1
  66. package/dist/chunk-VHZKLE63.js.map +0 -1
  67. package/dist/chunk-WQGFKNE2.js.map +0 -1
  68. /package/dist/{SaveToTable-PGOQVYVS.js.map → SaveToTable-P3MPRSCW.js.map} +0 -0
  69. /package/dist/{chunk-ZNIXJ5RY.js.map → chunk-KQR2RA4V.js.map} +0 -0
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  dateFormatFor,
4
4
  editorKindFor
5
- } from "./chunk-MUK63ANA.js";
5
+ } from "./chunk-4ZS4WEEE.js";
6
6
 
7
7
  // src/presentation.ts
8
8
  import { COLOR_ROTATION, parseTableStyle, tableStyleIsEmpty } from "@ai-matrx/design-system/data-table/table-style";
@@ -446,4 +446,4 @@ export {
446
446
  EMBEDDED_TABLE_CLASS,
447
447
  EMBEDDED_PLAIN_FOOTER_CLASS
448
448
  };
449
- //# sourceMappingURL=chunk-MCDA6L7E.js.map
449
+ //# sourceMappingURL=chunk-HAWACXPU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/presentation.ts","../src/viewKeys.ts","../src/firstPage.ts","../src/embeddedLook.tsx"],"sourcesContent":["/**\n * The Gantt mode of a timeline view, by Field key. `mode` turns the left task list on; `critical` paints the longest\n * chain; `progress` is a percent/number column; `milestone` a yes/no column; `baselineStart` / `baselineEnd` the two\n * date columns \"Save baseline\" writes; `dependency` the link column that dependencies are written to.\n */\nexport interface GanttLook {\n mode?: boolean;\n critical?: boolean;\n progress?: string;\n milestone?: string;\n baselineStart?: string;\n baselineEnd?: string;\n dependency?: string;\n}\n\n/** Read a stored Gantt look; unknown keys and wrong shapes are dropped. */\nexport function parseGanttLook(raw: unknown): GanttLook | undefined {\n if (!raw || typeof raw !== \"object\" || Array.isArray(raw)) return undefined;\n const v = raw as Record<string, unknown>;\n const out: GanttLook = {};\n if (v[\"mode\"] === true) out.mode = true;\n if (v[\"critical\"] === true) out.critical = true;\n for (const k of [\"progress\", \"milestone\", \"baselineStart\", \"baselineEnd\", \"dependency\"] as const) {\n const x = v[k];\n if (typeof x === \"string\" && x !== \"\") out[k] = x;\n }\n return Object.keys(out).length > 0 ? out : undefined;\n}\n\n/**\n * HOW A TABLE LOOKS — colors, formats and the frozen column.\n *\n * THE SPLIT, AND WHY IT IS THIS ONE. A Field declares WHAT it holds: a\n * currency, a percent, a date, a person. A VIEW declares HOW that reads and\n * what it is worth looking at: two decimal places or none, tint the row when\n * Status is Blocked, keep Name in place while the rest scrolls. Airtable draws\n * the line in exactly this place, and it has to be here: two people read one\n * table two different ways, and neither reading is a fact about the records.\n *\n * So nothing in this module is a new column on a Field and nothing here needed\n * a migration. A presentation lives on the saved-view record (`views.ts`), which\n * is an ordinary record of an ordinary Table — which means an agent sets it\n * through the same `records` tool it uses for everything else, and it travels\n * with the table the way every other record does.\n *\n * A FIELD STILL GETS ITS MONEY RIGHT WITH NO CONFIGURATION. `formatForField`\n * reads the Field's OWN declaration — a `currency` parity type with unit `$`, a\n * `percent`, a `datetime` with `config.kind` — and returns the format that\n * follows from it. The view's `formats` map only OVERRIDES that. A table nobody\n * has ever styled still shows `$1,250.50` and `45%`.\n */\n\n// The style parser from its own client-free subpath (lane SSR-ROWS): `@ai-matrx/records-ui/first-page`\n// runs in a host's SERVER component, and every export of the \"use client\" `data-table` entry is a\n// client reference there — calling `parseTableStyle` through it threw on the server.\nimport { COLOR_ROTATION, parseTableStyle, tableStyleIsEmpty } from \"@ai-matrx/design-system/data-table/table-style\";\nimport type {\n ChoiceColorLookup,\n GroupAggregateKind,\n GroupAggregateSpec,\n GroupOrder,\n StyleColor,\n TableStyle,\n} from \"@ai-matrx/design-system/data-table\";\nimport { getFieldFormat, type FieldFormatConfig } from \"@ai-matrx/design-system/field-formats\";\nimport type { ColorRule } from \"@ai-matrx/design-system/data-table\";\nimport { newerKindOf, ratingMaxOf } from \"@ai-matrx/records/field-kinds\";\nimport type { Field, TableDecorations } from \"@ai-matrx/records\";\n\nimport { editorKindFor } from \"./parity\";\nimport { dateFormatFor } from \"./dates\";\n\n/**\n * SECTIONS BY A FIELD — the view's own grouping.\n *\n * `field` is a Field KEY, exactly like `frozen` and the keys of `formats`,\n * because a view is written against the Table's declaration and never against\n * whatever id a screen happened to build its columns with.\n *\n * `aggregates` is keyed by Field key too, and `collapsed` holds the data\n * table's own group keys (`s:Blocked`, `n:3`, `empty`), which is what the\n * primitive emits and the only thing that survives a value rendering the same\n * text as another.\n *\n * NOTHING HERE IS EVER CALLED `valueOf`, `toString` or `hasOwnProperty`: every\n * object in JavaScript already has all three, so an optional field by one of\n * those names is NEVER absent and a `config.valueOf ? … : …` check silently\n * reads `Object.prototype`. It cost the primitive a whole grouping once.\n */\nexport type GridGrouping = {\n /** The Field key whose value makes the sections. */\n field: string;\n /** Per-Field-key subtotal on every section header. */\n aggregates?: Record<string, GroupAggregateSpec>;\n /** Section order. The primitive's default is `value-asc`; blanks sort last. */\n order?: GroupOrder;\n /** The sections this view keeps shut, by the primitive's own group key. */\n collapsed?: string[];\n /** The grouped column stays drawn as a column (Airtable). Absent = shown; `false` = the person stepped it aside. */\n showColumn?: boolean;\n /**\n * SUB-GROUPS (lane S1-PRIME VIEW-KEYS; ui-bench LISTS \"sub-grouping\"): up to two more levels\n * inside each section, by Field key. At most three levels in all — the store refuses a fourth\n * (`custom.view_declare`). A layout that draws one level ignores the rest; it never drops them,\n * because this list is parsed and written back whole with the rest of the look.\n */\n then?: GridSubGroup[];\n /**\n * DRILL (lane DRILL-TABLE-PRIMITIVE): the Dimension pivoted across the top — a Field key, or\n * `<key>:<grain>` for a date cut into periods.\n */\n across?: string;\n /** DRILL: the period `field` is cut into when it is a date (`month`); the store keeps `field` a Field key. */\n grain?: string;\n /** The Measures shown (\"what to display\"), by the store's own keys (`count`, `sum_quantity`). */\n show?: string[];\n /** The drill trail, in order: each crumb a Dimension reference and the value it narrowed to. */\n trail?: GridDrillStep[];\n};\n\n/** One crumb of a saved drill trail. `value: null` is \"no value\". */\nexport type GridDrillStep = { dim: string; value: string | null };\n\n/** One sub-group level: a Field key and its section order. */\nexport type GridSubGroup = { field: string; order?: GroupOrder; grain?: string };\n\n/** Everything a view says about how its table LOOKS. */\nexport type GridPresentation = {\n /** Color-by-a-column, rules and manual highlights. */\n style?: TableStyle;\n /** Per-column format overrides, by the Field's key. */\n formats?: Record<string, FieldFormatConfig>;\n /**\n * The columns that stay in place while the table scrolls sideways, by Field\n * key. Only the LEADING run of the view's column order can actually freeze —\n * the data table decides that, and declines rather than pinning a column at a\n * guessed offset.\n */\n frozen?: string[];\n /** Collapsible sections by one Field, with subtotals on each header. */\n grouping?: GridGrouping;\n /**\n * The width a person dragged a column to, by Field key. SPARSE on purpose —\n * a view saved before widths existed carries none and still parses, and a\n * column nobody resized is left to the table's own measurement.\n */\n widths?: Record<string, number>;\n /** The body row height this view remembers, in px. */\n rowHeight?: number;\n /**\n * Field keys hidden from this view — the SAME hidden-column list the grid's\n * own column picker holds, now given a place on the view so it survives a\n * reload and a layout switch reads the identical set gallery and grid agree\n * on, rather than a second \"fields shown\" list nobody kept in sync.\n */\n hiddenFields?: string[];\n /**\n * THE FIELDS A CARD LEAVES OFF (board, list, gallery, calendar, timeline), by Field key — the\n * card's own choice, kept apart from `hiddenFields` so a board's \"Card fields\" never hides the\n * grid's columns when the view switches layout (v7 TABLE-EXPERIENCE, walk 2026-10-05). An empty\n * list is a choice (every field shown); absent means the card never chose.\n */\n cardHidden?: string[];\n /**\n * THE ORDER A PERSON DRAGGED THE COLUMNS INTO, by Field key (merge tranche 6a). Sparse like\n * `widths`: a key it does not name keeps its Field's own place after the named ones, and a key\n * whose Field is gone is skipped — a column order can never hide or invent a column.\n */\n columnOrder?: string[];\n /**\n * The gallery's card size, remembered the same way the grid remembers its\n * row height — a per-view look, not a global default.\n */\n gallerySize?: \"small\" | \"medium\" | \"large\";\n /**\n * THE BOARD'S OWN LOOK (lane BOARD-SWIMLANES, Notion's board options). All kept on the view, all\n * read only by the kanban layout. Absent means the board's default: columns wear their choice's\n * color, each heading shows its count, empty columns and lanes are drawn, cards are medium with\n * no preview.\n * boardSize card size: sets the column width, the preview's height and, small, drops the card's extras\n * boardPreview the FILE field drawn as a cover at the top of each card (absent = no preview)\n * boardHideEmpty leave out a column or a lane that holds no card\n * boardColorColumns false = neutral headings, no accent bar on the cards\n * boardCounts false = no count beside the heading\n * boardLanesShut the swimlanes kept shut to a strip, by the lane's name\n */\n boardSize?: \"small\" | \"medium\" | \"large\";\n boardPreview?: string;\n boardHideEmpty?: boolean;\n boardColorColumns?: boolean;\n boardCounts?: boolean;\n boardLanesShut?: string[];\n /**\n * A CHART VIEW'S MENU (PIVOT-VIEW): `chartLabels` draws each mark's value on it (the chart menu's \"Data labels\"\n * switch); `chartLegend: false` leaves the legend off. Read only by the chart layout.\n */\n chartLabels?: boolean;\n chartLegend?: boolean;\n /**\n * A LOCKED VIEW (lane NOTION-SMALL-2): its layout, filters, sorts and settings are not saved over until\n * somebody unlocks it. An editing convenience against an accidental change, never a permission.\n */\n locked?: boolean;\n /**\n * THIS VIEW'S OWN LAYOUT CHOICES, over the organization's `custom/grid_layout` knob (lane\n * DEFAULT-GRID-PARITY, TABLE-PARITY D1 D5 D6). Absent means \"whatever the organization\n * says\"; present is the view's word. `freezeFirst: false` is an explicit NO over an\n * organization that freezes the first column — an empty `frozen` cannot say that.\n */\n wrap?: boolean;\n /** AIRTABLE'S \"WRAP FIELD HEADERS\": column titles take a second line instead of being cut. Absent = one line. */\n headerWrap?: boolean;\n /** NOTION'S \"WRAP COLUMN\" (N5): the columns that wrap their text when the view as a whole does not. */\n wrapColumns?: string[];\n fit?: \"auto\" | \"fit\" | \"scroll\";\n freezeFirst?: boolean;\n /**\n * THE SUMMARY BAR (TABLE-PARITY F1): Field key → the store measure shown under that column\n * (`count`, `sum`, `avg`, `min`, `max`, `median`, `filled`, `empty`, `unique`), worked out\n * by `custom.record_aggregate` over the whole table.\n */\n summaries?: Record<string, string>;\n /** THE TIMELINE'S GANTT MODE (kept as `presentation.gantt`): see `GanttLook`. */\n gantt?: GanttLook;\n /**\n * WHERE THE FOOTER SITS (lane TABLE-PAGE-CHROME, owner 2026-09-25) — the row count and the\n * pages: `sticky`, pinned to the bottom of the screen while the rows scroll (the older grid's\n * way, and the default when a view says nothing), or `inline`, right after the last row with\n * the page scrolling. Read by the Grid and a host's Sheet.\n */\n footer?: FooterPlacement;\n};\n\n/** Where a grid's footer sits. */\nexport type FooterPlacement = \"sticky\" | \"inline\";\n\n/** What a view that says nothing gets — the older grid's pinned footer. */\nexport const DEFAULT_FOOTER: FooterPlacement = \"sticky\";\n\n/** Where THIS view's footer sits, said or defaulted. */\nexport function footerOf(p: GridPresentation | null | undefined): FooterPlacement {\n return p?.footer ?? DEFAULT_FOOTER;\n}\n\nexport const EMPTY_PRESENTATION: GridPresentation = {};\n\n/** A frozen column needs a known width, or the table declines to freeze at all. */\nexport const FROZEN_COLUMN_WIDTH = 200;\n\n/**\n * WHAT A ROW HEIGHT IS ALLOWED TO BE. Below the floor the text is clipped and\n * no editor fits; above the ceiling one record fills the screen. A view asking\n * for anything outside it is DROPPED rather than obeyed, because a saved look\n * must not be able to make a table unreadable — and the Fields' own heights\n * still draw, which is the tolerant half.\n */\nexport const MIN_ROW_HEIGHT = 24;\nexport const MAX_ROW_HEIGHT = 240;\n\n/**\n * The aggregate kinds and orders the primitive actually implements. Listed here\n * because they are the tolerant parser's allow-list and a view is hostile input:\n * `satisfies` ties them to the primitive's own union, so a kind it renames stops\n * this file compiling instead of quietly parsing into a subtotal nobody draws.\n */\nconst AGGREGATE_KINDS = [\n \"count\",\n \"sum\",\n \"average\",\n \"min\",\n \"max\",\n \"empty\",\n \"filled\",\n \"unique\",\n \"checked\",\n \"unchecked\",\n \"percentFilled\",\n] as const satisfies readonly GroupAggregateKind[];\n\nconst GROUP_ORDERS = [\n \"value-asc\",\n \"value-desc\",\n \"count-desc\",\n \"first-seen\",\n] as const satisfies readonly GroupOrder[];\n\nfunction isRecord(v: unknown): v is Record<string, unknown> {\n return typeof v === \"object\" && v !== null && !Array.isArray(v);\n}\n\n/**\n * Read a presentation out of whatever the view record holds — an object, or the\n * JSON string a text field stores.\n *\n * Tolerant in exactly the way `parseTableStyle` is: an unreadable half is\n * dropped and the rest still applies, because a table must keep drawing when\n * one piece of its styling goes out of date.\n */\nexport function parseGridPresentation(raw: unknown): GridPresentation {\n let value = raw;\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n if (trimmed === \"\") return {};\n try {\n value = JSON.parse(trimmed);\n } catch {\n return {};\n }\n }\n if (!isRecord(value)) return {};\n\n const out: GridPresentation = {};\n\n const style = parseTableStyle(value[\"style\"]);\n if (!tableStyleIsEmpty(style)) out.style = style;\n\n if (isRecord(value[\"formats\"])) {\n const formats: Record<string, FieldFormatConfig> = {};\n for (const [key, cfg] of Object.entries(value[\"formats\"])) {\n if (!isRecord(cfg)) continue;\n const id = cfg[\"id\"];\n if (typeof id !== \"string\") continue;\n const options = cfg[\"options\"];\n formats[key] = isRecord(options)\n ? {\n id: id as FieldFormatConfig[\"id\"],\n options: options as NonNullable<FieldFormatConfig[\"options\"]>,\n }\n : { id: id as FieldFormatConfig[\"id\"] };\n }\n if (Object.keys(formats).length > 0) out.formats = formats;\n }\n\n if (Array.isArray(value[\"frozen\"])) {\n const frozen = value[\"frozen\"].filter((k): k is string => typeof k === \"string\");\n if (frozen.length > 0) out.frozen = frozen;\n }\n\n const grouping = parseGrouping(value[\"grouping\"]);\n if (grouping) out.grouping = grouping;\n\n if (isRecord(value[\"widths\"])) {\n const widths: Record<string, number> = {};\n for (const [key, raw] of Object.entries(value[\"widths\"])) {\n // A width that is not a usable number is one column's loss, never the\n // view's: the rest of the widths still apply and that column is measured.\n if (typeof raw !== \"number\" || !Number.isFinite(raw) || raw <= 0) continue;\n widths[key] = Math.round(raw);\n }\n if (Object.keys(widths).length > 0) out.widths = widths;\n }\n\n const rowHeight = value[\"rowHeight\"];\n if (\n typeof rowHeight === \"number\" &&\n Number.isFinite(rowHeight) &&\n rowHeight >= MIN_ROW_HEIGHT &&\n rowHeight <= MAX_ROW_HEIGHT\n ) {\n out.rowHeight = Math.round(rowHeight);\n }\n\n if (Array.isArray(value[\"hiddenFields\"])) {\n const hiddenFields = value[\"hiddenFields\"].filter((k): k is string => typeof k === \"string\");\n if (hiddenFields.length > 0) out.hiddenFields = hiddenFields;\n }\n if (Array.isArray(value[\"cardHidden\"])) {\n out.cardHidden = value[\"cardHidden\"].filter((k): k is string => typeof k === \"string\");\n }\n\n if (Array.isArray(value[\"columnOrder\"])) {\n const columnOrder = value[\"columnOrder\"].filter((k): k is string => typeof k === \"string\");\n if (columnOrder.length > 0) out.columnOrder = columnOrder;\n }\n\n const gallerySize = value[\"gallerySize\"];\n if (gallerySize === \"small\" || gallerySize === \"medium\" || gallerySize === \"large\") {\n out.gallerySize = gallerySize;\n }\n\n const boardSize = value[\"boardSize\"];\n if (boardSize === \"small\" || boardSize === \"medium\" || boardSize === \"large\") out.boardSize = boardSize;\n if (typeof value[\"boardPreview\"] === \"string\" && value[\"boardPreview\"] !== \"\") out.boardPreview = value[\"boardPreview\"];\n if (typeof value[\"boardHideEmpty\"] === \"boolean\") out.boardHideEmpty = value[\"boardHideEmpty\"];\n if (typeof value[\"boardColorColumns\"] === \"boolean\") out.boardColorColumns = value[\"boardColorColumns\"];\n if (typeof value[\"boardCounts\"] === \"boolean\") out.boardCounts = value[\"boardCounts\"];\n if (typeof value[\"chartLabels\"] === \"boolean\") out.chartLabels = value[\"chartLabels\"];\n if (typeof value[\"chartLegend\"] === \"boolean\") out.chartLegend = value[\"chartLegend\"];\n if (value[\"locked\"] === true) out.locked = true;\n if (Array.isArray(value[\"boardLanesShut\"])) {\n const shut = value[\"boardLanesShut\"].filter((k): k is string => typeof k === \"string\");\n if (shut.length > 0) out.boardLanesShut = shut;\n }\n\n if (typeof value[\"wrap\"] === \"boolean\") out.wrap = value[\"wrap\"];\n if (typeof value[\"headerWrap\"] === \"boolean\") out.headerWrap = value[\"headerWrap\"];\n if (Array.isArray(value[\"wrapColumns\"])) {\n const wrapColumns = value[\"wrapColumns\"].filter((k): k is string => typeof k === \"string\");\n if (wrapColumns.length > 0) out.wrapColumns = wrapColumns;\n }\n const fit = value[\"fit\"];\n if (fit === \"auto\" || fit === \"fit\" || fit === \"scroll\") out.fit = fit;\n if (typeof value[\"freezeFirst\"] === \"boolean\") out.freezeFirst = value[\"freezeFirst\"];\n const footer = value[\"footer\"];\n if (footer === \"sticky\" || footer === \"inline\") out.footer = footer;\n {\n const gantt = parseGanttLook(value[\"gantt\"]);\n if (gantt) out.gantt = gantt;\n }\n if (isRecord(value[\"summaries\"])) {\n const summaries: Record<string, string> = {};\n for (const [key, op] of Object.entries(value[\"summaries\"])) {\n // A measure name is judged by the store when it is asked; a non-string is nobody's.\n if (typeof op === \"string\" && op.trim() !== \"\") summaries[key] = op;\n }\n if (Object.keys(summaries).length > 0) out.summaries = summaries;\n }\n\n return out;\n}\n\n/**\n * A grouping, or nothing. A grouping with no Field to group BY is not a partial\n * grouping — it is no grouping at all, so it is dropped whole; an unreadable\n * subtotal or a section order this primitive does not have costs only itself.\n */\nfunction parseGrouping(raw: unknown): GridGrouping | undefined {\n if (!isRecord(raw)) return undefined;\n const field = raw[\"field\"];\n if (typeof field !== \"string\" || field.trim() === \"\") return undefined;\n\n const out: GridGrouping = { field };\n\n if (isRecord(raw[\"aggregates\"])) {\n const aggregates: Record<string, GroupAggregateSpec> = {};\n for (const [key, spec] of Object.entries(raw[\"aggregates\"])) {\n if (!isRecord(spec)) continue;\n const kind = spec[\"kind\"];\n if (typeof kind !== \"string\") continue;\n if (!(AGGREGATE_KINDS as readonly string[]).includes(kind)) continue;\n const label = spec[\"label\"];\n aggregates[key] =\n typeof label === \"string\"\n ? { kind: kind as GroupAggregateKind, label }\n : { kind: kind as GroupAggregateKind };\n }\n if (Object.keys(aggregates).length > 0) out.aggregates = aggregates;\n }\n\n const order = raw[\"order\"];\n if (typeof order === \"string\" && (GROUP_ORDERS as readonly string[]).includes(order)) {\n out.order = order as GroupOrder;\n }\n\n if (Array.isArray(raw[\"collapsed\"])) {\n const collapsed = raw[\"collapsed\"].filter((k): k is string => typeof k === \"string\");\n if (collapsed.length > 0) out.collapsed = collapsed;\n }\n\n if (typeof raw[\"showColumn\"] === \"boolean\") out.showColumn = raw[\"showColumn\"];\n\n if (Array.isArray(raw[\"then\"])) {\n const then: GridSubGroup[] = [];\n for (const level of raw[\"then\"]) {\n if (!isRecord(level)) continue;\n const sub = level[\"field\"];\n if (typeof sub !== \"string\" || sub.trim() === \"\") continue;\n const subOrder = level[\"order\"];\n const subGrain = level[\"grain\"];\n then.push({\n field: sub,\n ...(typeof subOrder === \"string\" && (GROUP_ORDERS as readonly string[]).includes(subOrder)\n ? { order: subOrder as GroupOrder }\n : {}),\n ...(typeof subGrain === \"string\" && subGrain !== \"\" ? { grain: subGrain } : {}),\n });\n }\n if (then.length > 0) out.then = then.slice(0, 2);\n }\n\n const grain = raw[\"grain\"];\n if (typeof grain === \"string\" && grain !== \"\") out.grain = grain;\n const across = raw[\"across\"];\n if (typeof across === \"string\" && across.trim() !== \"\") out.across = across;\n if (Array.isArray(raw[\"show\"])) {\n const show = raw[\"show\"].filter((k): k is string => typeof k === \"string\" && k !== \"\");\n if (show.length > 0) out.show = show;\n }\n if (Array.isArray(raw[\"trail\"])) {\n const trail: GridDrillStep[] = [];\n for (const step of raw[\"trail\"]) {\n if (!isRecord(step) || typeof step[\"dim\"] !== \"string\" || step[\"dim\"] === \"\") continue;\n const value = step[\"value\"];\n if (value !== null && typeof value !== \"string\") continue;\n trail.push({ dim: step[\"dim\"], value });\n }\n if (trail.length > 0) out.trail = trail;\n }\n\n return out;\n}\n\n/** True when nothing here would change how anything looks. */\nexport function presentationIsEmpty(p: GridPresentation): boolean {\n return (\n (p.style === undefined || tableStyleIsEmpty(p.style)) &&\n Object.keys(p.formats ?? {}).length === 0 &&\n (p.frozen?.length ?? 0) === 0 &&\n p.grouping === undefined &&\n Object.keys(p.widths ?? {}).length === 0 &&\n p.rowHeight === undefined &&\n (p.hiddenFields?.length ?? 0) === 0 &&\n p.cardHidden === undefined &&\n (p.columnOrder?.length ?? 0) === 0 &&\n p.gallerySize === undefined &&\n p.boardSize === undefined &&\n p.boardPreview === undefined &&\n p.boardHideEmpty === undefined &&\n p.boardColorColumns === undefined &&\n p.boardCounts === undefined &&\n (p.boardLanesShut?.length ?? 0) === 0 &&\n p.chartLabels === undefined &&\n p.chartLegend === undefined &&\n p.locked === undefined &&\n p.wrap === undefined &&\n p.headerWrap === undefined &&\n p.fit === undefined &&\n p.freezeFirst === undefined &&\n p.footer === undefined &&\n Object.keys(p.summaries ?? {}).length === 0 &&\n p.gantt === undefined\n );\n}\n\n/** The string a view record stores. Empty string for \"this view styles nothing\". */\nexport function presentationDocument(p: GridPresentation): string {\n return presentationIsEmpty(p) ? \"\" : JSON.stringify(p);\n}\n\n/** Kinds whose value is a control the record renderer draws, never a formatter's string. */\nconst DRAWN_KINDS = new Set([\"select\", \"multi_select\", \"relation\", \"member\", \"person\", \"attachment\", \"file\", \"entity_reference\", \"checkbox\", \"boolean\", \"signature\", \"json\"]);\n\n/**\n * The display format a column's settings chose for it, when it is one the platform registry\n * knows and the column is not one the record renderer draws itself. `undefined` otherwise.\n */\nexport function shownAsOf(field: Field): FieldFormatConfig | undefined {\n if (DRAWN_KINDS.has(String(editorKindFor(field)))) return undefined;\n const raw = (field as unknown as { display_format?: unknown }).display_format;\n if (!raw || typeof raw !== \"object\") return undefined;\n const id = (raw as { id?: unknown }).id;\n // `formula` is the column's KIND, never a look: a worked-out column shows as its result format.\n if (typeof id !== \"string\" || id === \"formula\" || !getFieldFormat(id)) return undefined;\n const options = (raw as { options?: unknown }).options;\n return options && typeof options === \"object\" && Object.keys(options).length > 0\n ? ({ id, options } as FieldFormatConfig)\n : ({ id } as FieldFormatConfig);\n}\n\n/**\n * The format a Field's OWN declaration implies, before any view says anything.\n *\n * Returns `undefined` for a Field whose value the record renderer already draws\n * better than a formatter could — a relation chip, a person, an attachment, a\n * choice — because handing those to a text formatter would REPLACE a working\n * control with a string.\n */\n/**\n * A COLUMN THAT HOLDS YEARS (\"Founded\", \"Year\", \"Year built\", \"Established\", \"Model year\"…).\n * A year is a number that is never grouped: \"Founded 2,008\" read as a quantity (lane RECORD-PAGE-UI,\n * 2026-10-15). Known by its name; a value is printed as a year only when it is also a whole number\n * from 1000 to 2999 (`isYearValue`).\n */\nconst YEAR_NAMES = /(^|[\\s_-])(year|founded|established|incorporated|vintage)([\\s_-]|$)/i;\nexport function isYearField(field: Pick<Field, \"key\" | \"label\">): boolean {\n return YEAR_NAMES.test(String(field.label ?? \"\")) || YEAR_NAMES.test(field.key);\n}\nexport function isYearValue(value: unknown): boolean {\n return typeof value === \"number\" && Number.isInteger(value) && value >= 1000 && value <= 2999;\n}\n/** A number format with its grouping off for a year column, unless the column chose grouping itself. */\nfunction ungroupedForYears(field: Field, format: FieldFormatConfig): FieldFormatConfig {\n if (format.id !== \"number\" || !isYearField(field)) return format;\n const options = (format.options ?? {}) as Record<string, unknown>;\n if (options[\"useGrouping\"] !== undefined) return format;\n return { ...format, options: { ...options, useGrouping: false } };\n}\n\nexport function formatForField(field: Field): FieldFormatConfig | undefined {\n // \"SHOWS AS\" — THE FORMAT THE COLUMN'S OWN SETTINGS CHOSE (merge tranche 6a/6e). The column\n // keeps it on the Field (`display_format`, written by `custom.field_update`), so the grid, the\n // record panel and the export read one answer. A column the record renderer draws better than\n // a formatter (a choice, a link, a person, a file) keeps its own drawing.\n const shownAs = shownAsOf(field);\n // A RATING'S TOP STAR IS ITS MAX RULE (lane 10 P4), so changing the rule changes the stars.\n if (newerKindOf(field) === \"rating\" && (!shownAs || shownAs.id === \"rating\")) {\n return { id: \"rating\", options: { ...(shownAs?.options ?? {}), ratingMax: ratingMaxOf(field) } };\n }\n if (shownAs) return ungroupedForYears(field, shownAs);\n // THE STORE'S OWN STAMPS (Created time, Last changed time) are instants and print like\n // every other date-and-time cell — `dates.ts` answers, the same helper every card reads.\n const stamp = dateFormatFor(field);\n if (stamp && editorKindFor(field) !== \"datetime\") return stamp;\n switch (editorKindFor(field)) {\n case \"currency\":\n return {\n id: \"currency\",\n options: { currency: currencyCodeFor(field.unit) },\n };\n case \"percent\":\n return { id: \"percent\" };\n case \"datetime\":\n // The COLUMN's declaration: a `kind: \"date\"` column is a date column, anything else can\n // hold a moment. Each VALUE is still printed in its own shape (`RecordValue` →\n // `dates.dateFormatFor(field, value)`), so a bare date in a datetime column reads as a date.\n return String(field.config?.[\"kind\"] ?? \"\") === \"date\" ? { id: \"date\" } : { id: \"datetime\" };\n case \"email\":\n return { id: \"email\" };\n case \"url\":\n return { id: \"url\" };\n case \"phone\":\n return { id: \"phone\" };\n case \"number\":\n return ungroupedForYears(field, { id: \"number\" });\n default:\n return undefined;\n }\n}\n\n/**\n * THE FORMAT ONE CELL OF A COLUMN IS DRAWN IN — the grid's cell and the gallery's card alike\n * (guard G4 \"one format\", lane VIEWS-AND-FIELDS W1-B): the view's own format for the column when\n * it set one, else the Field's own (`formatForField`). One function, so no layout formats money\n * (or a date, or a percent) its own way.\n */\nexport function cellFormatFor(field: Field, viewFormat?: FieldFormatConfig | undefined): FieldFormatConfig | undefined {\n return viewFormat ?? formatForField(field);\n}\n\n/**\n * The store lets a person type the SYMBOL they think in (`$`, `€`), and\n * `Intl.NumberFormat` wants the ISO code. The symbols people actually enter are\n * mapped; anything else is passed straight through, because a real ISO code is\n * the other thing that lands in this field, and an unknown code still renders\n * (`1,234.00 XYZ`) rather than blanking — THE FALLBACK LAW.\n */\nconst SYMBOL_TO_CODE: Record<string, string> = {\n $: \"USD\",\n \"£\": \"GBP\",\n \"€\": \"EUR\",\n \"¥\": \"JPY\",\n \"₹\": \"INR\",\n \"₽\": \"RUB\",\n \"₩\": \"KRW\",\n \"R$\": \"BRL\",\n \"C$\": \"CAD\",\n \"A$\": \"AUD\",\n};\n\nexport function currencyCodeFor(unit: string | null | undefined): string {\n const raw = (unit ?? \"\").trim();\n if (raw === \"\") return \"USD\";\n return SYMBOL_TO_CODE[raw] ?? raw.toUpperCase();\n}\n\n/**\n * The color a value paints with when a view colors BY a column.\n *\n * NOTHING FAILS SILENTLY, so this never returns \"no color\" for a value that\n * exists. The store keeps a list column's choices as records of another Table,\n * and this grid has not read that Table's option colors, so the color is\n * derived from the value's own text: the same word always gets the same color,\n * different words get different ones, and `true` is green the way every\n * checklist reads. When those option colors do land, this is the ONE function\n * that changes and every screen follows.\n */\nexport const colorFromTheValue: ChoiceColorLookup = (_fieldKey, value) => {\n if (value === true) return \"green\";\n if (value === false || value === null || value === undefined) return undefined;\n const text = String(value).trim().toLowerCase();\n if (text === \"\") return undefined;\n let hash = 0;\n for (let i = 0; i < text.length; i += 1) {\n hash = (hash * 31 + text.charCodeAt(i)) >>> 0;\n }\n return COLOR_ROTATION[hash % COLOR_ROTATION.length] as StyleColor;\n};\n\n/**\n * G1's TABLE-LEVEL COLORS (`custom.table_decorations` / `client.tableDecorations`),\n * TRANSLATED INTO A `TableStyle` — the same document a saved view's own `presentation.style`\n * is, so one resolver (`resolveTableStyle`, below) can treat \"the table's colors\" and \"this\n * view's colors\" as two layers of the SAME thing instead of two unrelated systems.\n *\n * THE TRANSLATION IS NECESSARY AND IT IS THE ONLY ONE. G1 addresses a Field by its ID\n * (REC-17 — a column renamed keeps its color), because it is the STORE's own door; a\n * `TableStyle` addresses a Field by its KEY, because it reads straight off `row.document`,\n * which is keyed by Field key. A rule or a color-by whose Field has been deleted (its id no\n * longer resolves to a key) is dropped rather than crashing the whole style — a defect in\n * one rule costs that rule, never the read.\n */\nexport function styleFromDecorations(\n decorations: TableDecorations | null | undefined,\n fields: readonly Field[],\n): TableStyle {\n if (!decorations) return { version: 1 };\n const keyOf = (id: string) => fields.find((f) => f.id === id)?.key;\n const style: TableStyle = { version: 1 };\n\n if (decorations.color_by?.field) {\n const field = keyOf(decorations.color_by.field);\n if (field) style.colorBy = { field, target: decorations.color_by.target };\n }\n\n if (Array.isArray(decorations.rules) && decorations.rules.length > 0) {\n const rules: ColorRule[] = [];\n decorations.rules.forEach((rule, index) => {\n const field = keyOf(rule.field);\n if (!field) return;\n rules.push({\n id: rule.id ?? `decoration:${index}`,\n field,\n op: rule.op,\n color: rule.color,\n target: rule.target,\n ...(rule.value === undefined || rule.value === null ? {} : { value: String(rule.value) }),\n });\n });\n if (rules.length > 0) style.rules = rules;\n }\n\n if (decorations.rows && Object.keys(decorations.rows).length > 0) {\n style.rows = { ...decorations.rows };\n }\n\n const columns: Record<string, StyleColor> = {};\n for (const [id, color] of Object.entries(decorations.columns ?? {})) {\n const key = keyOf(id);\n if (key) columns[key] = color;\n }\n if (Object.keys(columns).length > 0) style.columns = columns;\n\n const cells: Record<string, Record<string, StyleColor>> = {};\n for (const [rowId, byField] of Object.entries(decorations.cells ?? {})) {\n for (const [id, color] of Object.entries(byField ?? {})) {\n const key = keyOf(id);\n if (!key) continue;\n (cells[rowId] ??= {})[key] = color;\n }\n }\n if (Object.keys(cells).length > 0) style.cells = cells;\n\n return style;\n}\n\n/**\n * THE ONE PRESENTATION RESOLVER every colored surface in this package reads —\n * `Grid`, and (via `Card`) the kanban board, the calendar and the gallery.\n *\n * THE CLASS THIS CLOSES (lane UI-QUICK-1, TABLE-PARITY review, 2026-09-24). Threading\n * `view.presentation.style` into `Card` closed the instance the CALENDAR-GALLERY bench\n * found — a VIEW that had its own color-by looked right everywhere — but it left the\n * class open: a table whose colors are the ORGANIZATION's decorations (G1's\n * `custom.table_decorations` — \"color rows by Account Type\", \"MAXED and NEAR rules\" on\n * Arman's own Coding Accounts table) and whose views never set a `presentation.style` of\n * their own drew NOTHING, on the grid exactly as much as on every other layout, because\n * nothing in this package had ever read G1's door at all.\n *\n * TWO LAYERS, ONE DOCUMENT. The table's decorations are the base coat — what every view\n * of this table shows until a view says otherwise. A view's OWN `presentation.style` is\n * an override, piece by piece: a view that only ever set manual row highlights still\n * inherits the table's color-by and rules for everything it never touched, and a view\n * that fully redecorated (its own `colorBy` AND its own `rules`) is not haunted by a\n * table rule it meant to replace. Per-piece, never all-or-nothing, because a view is a\n * LOOK on top of the table, not a wholesale substitute for it.\n */\nexport function resolveTableStyle(\n decorations: TableDecorations | null | undefined,\n fields: readonly Field[],\n viewStyle: TableStyle | undefined,\n): TableStyle {\n const base = styleFromDecorations(decorations, fields);\n if (!viewStyle) return base;\n const colorBy = viewStyle.colorBy ?? base.colorBy;\n const rules = viewStyle.rules ?? base.rules;\n const rows = viewStyle.rows ?? base.rows;\n const columns = viewStyle.columns ?? base.columns;\n const cells = viewStyle.cells ?? base.cells;\n return {\n version: 1,\n ...(colorBy !== undefined ? { colorBy } : {}),\n ...(rules !== undefined ? { rules } : {}),\n ...(rows !== undefined ? { rows } : {}),\n ...(columns !== undefined ? { columns } : {}),\n ...(cells !== undefined ? { cells } : {}),\n };\n}\n","// src/viewKeys.ts — @ai-matrx/records-ui · lane S1-PRIME VIEW-KEYS\n//\n// THE VIEW-KEY REGISTRY MOVED TO `@ai-matrx/records/views` (step 10, 2026-10-08): the declared keys, the one\n// reader and the one writer are headless there. What stays here is this package's LOOK: the grid\n// presentation (colors, formats, frozen columns — `presentation.ts`, built on design-system) bound as the\n// view's presentation codec. Every name this file exported is unchanged.\n\nimport * as base from \"@ai-matrx/records/views\";\nimport { parseGridPresentation, presentationDocument, presentationIsEmpty, type GridPresentation } from \"./presentation\";\n\nexport {\n STORE_KEEPS_TIMELINE,\n STORE_KEPT_LAYOUTS,\n VIEW_KEYS,\n storeKeepsLayout,\n viewKeysFor,\n viewSettingsFor,\n type ViewKeyDeclaration,\n type ViewKeyLayout,\n type ViewKeyWriter,\n type ViewSortKey,\n} from \"@ai-matrx/records/views\";\n\n/** This package's look, as the view's presentation codec. */\nexport const gridPresentationCodec: base.ViewPresentationCodec<GridPresentation> = {\n parse: parseGridPresentation,\n isEmpty: presentationIsEmpty,\n toDocument: (presentation) => JSON.parse(presentationDocument(presentation)) as Record<string, unknown>,\n};\n\n/** EVERY DECLARED KEY OF A VIEW, TYPED, with this package's grid look. */\nexport type ViewSettings = base.ViewSettings<GridPresentation>;\nexport type ViewSettingsPatch = base.ViewSettingsPatch<GridPresentation>;\n\n/** Every view and look door with this package's grid look bound — bindings of records' one definition. */\nexport const boundViews = base.bindViewCodec<GridPresentation>(gridPresentationCodec);\n\n/** THE READER (a stored `definition` and the row's flat `filters` in, every declared key out) and THE WRITER'S SHAPE. */\nexport const { viewSettings, viewSettingsPatch } = boundViews;\n","// src/firstPage.ts — @ai-matrx/records-ui/first-page · lane PAGE-BUNDLE-2\n//\n// THE GRID'S FIRST PAGE, ASKED BEFORE THE GRID EXISTS. The logic lives in `@ai-matrx/records/first-page` (headless,\n// step 10, 2026-10-08); this entry binds this package's grid look (`gridPresentationCodec`) so a view is read exactly\n// as the screen reads it. No React here (server-safe entry).\n\nimport { bindFirstPageCodec } from \"@ai-matrx/records/first-page\";\nimport type { GridPresentation } from \"./presentation\";\nimport { gridPresentationCodec } from \"./viewKeys\";\n\nexport type { GridPresentation } from \"./presentation\";\n\nexport {\n EMBEDDED_PAGE_SIZE,\n TABLE_PAGE_SIZE,\n firstGridPageArgs,\n serverRowsOf,\n viewFilterOf,\n type FirstGridPageArgs,\n} from \"@ai-matrx/records/first-page\";\n\ntype BoundFirstPage = ReturnType<typeof bindFirstPageCodec<GridPresentation>>;\nconst boundFirstPage = bindFirstPageCodec(gridPresentationCodec);\nexport const firstGridPageRequest: BoundFirstPage[\"firstGridPageRequest\"] = boundFirstPage.firstGridPageRequest;\nexport const askTablePageSeed: BoundFirstPage[\"askTablePageSeed\"] = boundFirstPage.askTablePageSeed;\n\n// Entity blocks and chart tiles (lane SEED-ENTITY).\nexport * from \"./firstPageEntity\";\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 color.\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 colored 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 centered 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 gray 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"],"mappings":";;;;;;;AAuDA,SAAS,gBAAgB,iBAAiB,yBAAyB;AASnE,SAAS,sBAA8C;AAEvD,SAAS,aAAa,mBAAmB;AAlD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AAA,EACA;AAAA,OAEK;AAGP,IAAM,iBAAiB,mBAAmB,qBAAqB;AACxD,IAAM,uBAA+D,eAAe;AACpF,IAAM,mBAAuD,eAAe;;;ACNnF,SAAS,eAAe,kBAAkB;AAQnC,IAAM,gBAA8B,EAAE,YAAY,MAAM,WAAW,MAAM,eAAe,KAAK;AAEpG,IAAM,sBAAsB,cAAmC,IAAI;AAC5D,IAAM,uBAAuB,oBAAoB;AAEjD,SAAS,kBAAuC;AACrD,SAAO,WAAW,mBAAmB;AACvC;AAMO,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;","names":["raw","base"]}
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  LEVEL_WORD,
4
4
  levelNeededFor
5
- } from "./chunk-PPWNFIJ5.js";
5
+ } from "./chunk-OV6QBL5R.js";
6
6
  import {
7
7
  ADD_FIELD_OPEN_LABEL
8
- } from "./chunk-FHL4GG6R.js";
8
+ } from "./chunk-WCQSJPLS.js";
9
9
 
10
10
  // src/objectActions.ts
11
11
  import { formatTapShortcut } from "@ai-matrx/design-system/tap-target";
@@ -245,4 +245,4 @@ export {
245
245
  STRIP_FEATURE_ROWS,
246
246
  toStripAndRows
247
247
  };
248
- //# sourceMappingURL=chunk-ZNIXJ5RY.js.map
248
+ //# sourceMappingURL=chunk-KQR2RA4V.js.map
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  EMBEDDED_PLAIN_FOOTER_CLASS,
4
4
  EMBEDDED_TABLE_CLASS
5
- } from "./chunk-MCDA6L7E.js";
5
+ } from "./chunk-HAWACXPU.js";
6
6
 
7
7
  // src/skeletonLayout.ts
8
8
  var RECORDS_SKELETON_LAYOUTS = [
@@ -302,4 +302,4 @@ export {
302
302
  RecordsSkeleton,
303
303
  TablePageSkeleton
304
304
  };
305
- //# sourceMappingURL=chunk-5IX4BL72.js.map
305
+ //# sourceMappingURL=chunk-MBUW42SM.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 | \"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 \"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 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 { 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, 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 {\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 // 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":";;;;;;;AAqBO,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;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,MAAM,QAAQ,MAAM,KAAK,OAAO,WAAW,EAAG,QAAO;AAC1D,QAAM,MAAgB,CAAC;AACvB,aAAW,KAAK,QAAQ;AACtB,QAAI,OAAO,MAAM,YAAY,CAAC,OAAO,SAAS,CAAC,KAAK,IAAI,EAAG,QAAO;AAClE,QAAI,KAAK,KAAK,IAAI,KAAK,MAA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M,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":[]}
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 | \"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 \"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, 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 {\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 // 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":";;;;;;;AAqBO,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;AACF;AAGO,SAAS,kBAAkB,QAA0D;AAC1F,MAAI,WAAW,WAAW,WAAW,WAAY,QAAO;AACxD,SAAQ,yBAA+C,S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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":[]}
@@ -41,7 +41,7 @@ function sentenceFor(what, level) {
41
41
  read: "open this",
42
42
  comment: "leave a comment",
43
43
  write: "change anything here",
44
- organise: "organise this",
44
+ organise: "organize this",
45
45
  remove: "delete this",
46
46
  share: "pass this on to somebody else",
47
47
  structure: "change the columns of this table"
@@ -92,4 +92,4 @@ export {
92
92
  tableIsLocked,
93
93
  DATABASE_LOCKED_REASON
94
94
  };
95
- //# sourceMappingURL=chunk-PPWNFIJ5.js.map
95
+ //# sourceMappingURL=chunk-OV6QBL5R.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/rights.ts"],"sourcesContent":["// src/rights.ts — @ai-matrx/records-ui\n//\n// THE ONE PLACE A LEVEL BECOMES A SCREEN.\n//\n// WHAT A PERSON HIT (independent verdict, sixth pass, 19-20 September). A\n// colleague who had been shared a table at viewer opened it, double-clicked a\n// cell, got a live editor, typed a value and pressed Enter — and only THEN was\n// told she may not write. \"The permission is right; the screen told her she\n// could.\" Measured against Airtable, Notion and Linear the verdict called it\n// out by name: \"None of these three products lets you start an action it\n// already knows it will reject.\"\n//\n// WHY THE SCREEN COULD NOT KNOW. The rights question was a PORT with two honest\n// answers and no third: `NO_RIGHTS` (every administering control absent, which\n// is useless for a host whose authority IS the store's) and\n// `storeDecidesRights` — `{admin: true, comment: true, write: true}` for every\n// non-kernel table, for everybody. That second one is the defect, written down:\n// it is the screen ASSUMING the answer and letting the door say no afterwards.\n//\n// WHAT REPLACES IT. The store already answers this, and the client now carries\n// it: `custom.read_records` returns the reader's level on the TABLE on every\n// row (so `Table.your_level` costs nothing), and `custom.my_levels` — the door\n// this lane added — answers the caller's level on any subject they name, one\n// call for a whole page. This file is the only place in the package that turns\n// one of those four words into what a screen may DRAW.\n//\n// THE LADDER IS THE STORE'S, NOT OURS: viewer < commenter < editor < admin, and\n// which rung each door requires is read from the doors themselves —\n// `custom.record_update` asserts `editor` on the record, `custom.field_declare`\n// asserts `admin` on the TABLE (\"the SHAPE of this table, which is an admin's\n// right and not an editor's\"), `custom.io_comment_write` admits a commenter.\n// Nothing here invents a rule; it mirrors the four assertions those doors make\n// and is wrong the moment they change, which is what the suite is for.\n//\n// ABSENT OR HONEST, NEVER DEAD. Every `false` here carries the sentence that\n// says why and what to do about it, so a control can be left out AND explained.\n// A screen that hid a control with nothing to say is the silent half of the\n// same defect.\n\nimport { atLeast, type PermissionLevel } from \"@ai-matrx/records/field-kinds\";\nimport type { Table } from \"@ai-matrx/records\";\n\n/** The six things a person does to a record or a table, as the screens offer them. */\nexport type Capability = \"read\" | \"comment\" | \"write\" | \"organise\" | \"remove\" | \"share\" | \"structure\";\n\nexport interface WhatYouMayDo {\n /** The word the store answered, or null when it answered nothing. */\n level: PermissionLevel | null;\n /**\n * Whether the store has ANSWERED yet. `false` is a third state and not a\n * refusal: a screen that drew \"you may not\" while the answer was in flight\n * would blink every control off on every reload, which is its own lie.\n */\n known: boolean;\n read: boolean;\n comment: boolean;\n write: boolean;\n /** Duplicate, merge, restore, make a layout the default: the doors that ask `editor`, above content. */\n organise: boolean;\n remove: boolean;\n share: boolean;\n structure: boolean;\n /** Why this person may not do that, in one sentence naming the way in. */\n why: (what: Capability) => string;\n}\n\n/** What each rung of the ladder is called where a person reads it. */\nexport const LEVEL_WORD: Record<PermissionLevel, string> = {\n viewer: \"Viewer\",\n commenter: \"Commenter\",\n edit_content: \"Content editor\",\n editor: \"Editor\",\n admin: \"Admin\",\n};\n\n/**\n * WHICH RUNG EACH DOOR ASKS FOR. Read off the doors themselves, in one place,\n * so a screen never re-decides it and the suite has one thing to check.\n */\nconst NEEDS: Record<Capability, PermissionLevel> = {\n read: \"viewer\",\n // custom.io_comment_write\n comment: \"commenter\",\n // custom.record_update / custom.record_write — `edit_content` changes rows and page content;\n // columns, views and settings (structure) stay with admin below, and sharing with admin.\n write: \"edit_content\",\n // custom.view_designate / view_declare / migrate_merge / record_restore — all ask `editor`: more than\n // changing content (`edit_content`), less than changing columns (`admin`).\n organise: \"editor\",\n // custom.record_delete\n remove: \"editor\",\n // custom.share_grant — ONE-LADDER (2026-10-10): Edit may pass View / Comment / Edit on inside the\n // organization (iam.may_grant_as, knobs access.sharing/*). Which levels, and to whom, is the share\n // dialog's own question (iam.my_grantable_levels); the Share button only has to open for Edit.\n share: \"editor\",\n // custom.field_declare / field_update / field_retire / table settings\n structure: \"admin\",\n};\n\n/** The rung a capability asks for — so a short \"Needs Admin access\" never re-decides the ladder. */\nexport function levelNeededFor(what: Capability): PermissionLevel {\n return NEEDS[what];\n}\n\nconst NOT_YET =\n \"Checking what you may do here. Nothing is offered until then.\";\n\nconst NOTHING_AT_ALL =\n \"You have not been given this. Ask somebody who administers it to share it with you.\";\n\n/** The sentence for one refusal: what the level is, what it would have to be. */\nfunction sentenceFor(what: Capability, level: PermissionLevel | null): string {\n if (level === null) return NOTHING_AT_ALL;\n const need = LEVEL_WORD[NEEDS[what]];\n const have = LEVEL_WORD[level];\n const doing: Record<Capability, string> = {\n read: \"open this\",\n comment: \"leave a comment\",\n write: \"change anything here\",\n organise: \"organise this\",\n remove: \"delete this\",\n share: \"pass this on to somebody else\",\n structure: \"change the columns of this table\",\n };\n return `You are ${have} here, and it takes ${need} to ${doing[what]}. Ask somebody who is Admin on it to move you up.`;\n}\n\n/**\n * WHAT ONE LEVEL LETS A PERSON DO. `level` null and `known` true means the\n * store said \"nothing\" — a real answer. `known` false means it has not said.\n */\nexport function whatYouMayDo(level: PermissionLevel | null, known = true): WhatYouMayDo {\n const may = (what: Capability) => known && atLeast(level, NEEDS[what]);\n return {\n level: known ? level : null,\n known,\n read: may(\"read\"),\n comment: may(\"comment\"),\n write: may(\"write\"),\n organise: may(\"organise\"),\n remove: may(\"remove\"),\n share: may(\"share\"),\n structure: may(\"structure\"),\n why: (what) => (known ? sentenceFor(what, level) : NOT_YET),\n };\n}\n\n/** Nothing offered, because nothing is known yet. */\nexport const NOT_ANSWERED_YET: WhatYouMayDo = whatYouMayDo(null, false);\n\n/**\n * REC-27. The nine Tables the platform ships are not administered from a\n * person's screen whatever level they hold on them — so the structure controls\n * are absent for a kernel Table and say why, and everything else follows the\n * level as usual.\n */\nexport const KERNEL_REASON =\n \"This is one of the tables the platform ships, so its columns are not changed from a screen. \" +\n \"Make your own table to change columns.\";\n\nexport function whatYouMayDoWithTable(\n table: Table | null | undefined,\n level: PermissionLevel | null,\n known: boolean,\n): WhatYouMayDo {\n const base = whatYouMayDo(level, known);\n // A LOCKED DATABASE (lane NOTION-SMALL-2): the columns and the table's settings stay as they are until\n // somebody unlocks it. An editing convenience, never a permission — the lock changes what is OFFERED, the\n // store's ladder is untouched and anyone who may edit the table may unlock it.\n if (!table?.is_kernel) return table && tableIsLocked(table) ? lockedStructure(base) : base;\n return {\n ...base,\n structure: false,\n why: (what) => (what === \"structure\" ? KERNEL_REASON : base.why(what)),\n };\n}\n\n/** Is this table locked against column and settings changes? Kept on the table's own metadata. */\nexport function tableIsLocked(table: Pick<Table, \"metadata\"> | null | undefined): boolean {\n return table?.metadata?.[\"locked\"] === true;\n}\n\nexport const DATABASE_LOCKED_REASON = \"This database is locked, so its columns and settings are read-only. Unlock it to change them.\";\n\nfunction lockedStructure(base: WhatYouMayDo): WhatYouMayDo {\n return { ...base, structure: false, why: (what) => (what === \"structure\" ? DATABASE_LOCKED_REASON : base.why(what)) };\n}\n"],"mappings":";;;AAuCA,SAAS,eAAqC;AA4BvC,IAAM,aAA8C;AAAA,EACzD,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,OAAO;AACT;AAMA,IAAM,QAA6C;AAAA,EACjD,MAAM;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W,QAAO,SAAS,cAAc,KAAK,IAAI,gBAAgB,IAAI,IAAI;AACtF,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW;AAAA,IACX,KAAK,CAAC,SAAU,SAAS,cAAc,gBAAgB,KAAK,IAAI,IAAI;AAAA,EACtE;AACF;AAGO,SAAS,cAAc,OAA4D;AACxF,SAAO,OAAO,WAAW,QAAQ,MAAM;AACzC;AAEO,IAAM,yBAAyB;AAEtC,SAAS,gBAAgB,MAAkC;AACzD,SAAO,EAAE,GAAG,MAAM,WAAW,OAAO,KAAK,CAAC,SAAU,SAAS,cAAc,yBAAyB,KAAK,IAAI,IAAI,EAAG;AACtH;","names":[]}
1
+ {"version":3,"sources":["../src/rights.ts"],"sourcesContent":["// src/rights.ts — @ai-matrx/records-ui\n//\n// THE ONE PLACE A LEVEL BECOMES A SCREEN.\n//\n// WHAT A PERSON HIT (independent verdict, sixth pass, 19-20 September). A\n// colleague who had been shared a table at viewer opened it, double-clicked a\n// cell, got a live editor, typed a value and pressed Enter — and only THEN was\n// told she may not write. \"The permission is right; the screen told her she\n// could.\" Measured against Airtable, Notion and Linear the verdict called it\n// out by name: \"None of these three products lets you start an action it\n// already knows it will reject.\"\n//\n// WHY THE SCREEN COULD NOT KNOW. The rights question was a PORT with two honest\n// answers and no third: `NO_RIGHTS` (every administering control absent, which\n// is useless for a host whose authority IS the store's) and\n// `storeDecidesRights` — `{admin: true, comment: true, write: true}` for every\n// non-kernel table, for everybody. That second one is the defect, written down:\n// it is the screen ASSUMING the answer and letting the door say no afterwards.\n//\n// WHAT REPLACES IT. The store already answers this, and the client now carries\n// it: `custom.read_records` returns the reader's level on the TABLE on every\n// row (so `Table.your_level` costs nothing), and `custom.my_levels` — the door\n// this lane added — answers the caller's level on any subject they name, one\n// call for a whole page. This file is the only place in the package that turns\n// one of those four words into what a screen may DRAW.\n//\n// THE LADDER IS THE STORE'S, NOT OURS: viewer < commenter < editor < admin, and\n// which rung each door requires is read from the doors themselves —\n// `custom.record_update` asserts `editor` on the record, `custom.field_declare`\n// asserts `admin` on the TABLE (\"the SHAPE of this table, which is an admin's\n// right and not an editor's\"), `custom.io_comment_write` admits a commenter.\n// Nothing here invents a rule; it mirrors the four assertions those doors make\n// and is wrong the moment they change, which is what the suite is for.\n//\n// ABSENT OR HONEST, NEVER DEAD. Every `false` here carries the sentence that\n// says why and what to do about it, so a control can be left out AND explained.\n// A screen that hid a control with nothing to say is the silent half of the\n// same defect.\n\nimport { atLeast, type PermissionLevel } from \"@ai-matrx/records/field-kinds\";\nimport type { Table } from \"@ai-matrx/records\";\n\n/** The six things a person does to a record or a table, as the screens offer them. */\nexport type Capability = \"read\" | \"comment\" | \"write\" | \"organise\" | \"remove\" | \"share\" | \"structure\";\n\nexport interface WhatYouMayDo {\n /** The word the store answered, or null when it answered nothing. */\n level: PermissionLevel | null;\n /**\n * Whether the store has ANSWERED yet. `false` is a third state and not a\n * refusal: a screen that drew \"you may not\" while the answer was in flight\n * would blink every control off on every reload, which is its own lie.\n */\n known: boolean;\n read: boolean;\n comment: boolean;\n write: boolean;\n /** Duplicate, merge, restore, make a layout the default: the doors that ask `editor`, above content. */\n organise: boolean;\n remove: boolean;\n share: boolean;\n structure: boolean;\n /** Why this person may not do that, in one sentence naming the way in. */\n why: (what: Capability) => string;\n}\n\n/** What each rung of the ladder is called where a person reads it. */\nexport const LEVEL_WORD: Record<PermissionLevel, string> = {\n viewer: \"Viewer\",\n commenter: \"Commenter\",\n edit_content: \"Content editor\",\n editor: \"Editor\",\n admin: \"Admin\",\n};\n\n/**\n * WHICH RUNG EACH DOOR ASKS FOR. Read off the doors themselves, in one place,\n * so a screen never re-decides it and the suite has one thing to check.\n */\nconst NEEDS: Record<Capability, PermissionLevel> = {\n read: \"viewer\",\n // custom.io_comment_write\n comment: \"commenter\",\n // custom.record_update / custom.record_write — `edit_content` changes rows and page content;\n // columns, views and settings (structure) stay with admin below, and sharing with admin.\n write: \"edit_content\",\n // custom.view_designate / view_declare / migrate_merge / record_restore — all ask `editor`: more than\n // changing content (`edit_content`), less than changing columns (`admin`).\n organise: \"editor\",\n // custom.record_delete\n remove: \"editor\",\n // custom.share_grant — ONE-LADDER (2026-10-10): Edit may pass View / Comment / Edit on inside the\n // organization (iam.may_grant_as, knobs access.sharing/*). Which levels, and to whom, is the share\n // dialog's own question (iam.my_grantable_levels); the Share button only has to open for Edit.\n share: \"editor\",\n // custom.field_declare / field_update / field_retire / table settings\n structure: \"admin\",\n};\n\n/** The rung a capability asks for — so a short \"Needs Admin access\" never re-decides the ladder. */\nexport function levelNeededFor(what: Capability): PermissionLevel {\n return NEEDS[what];\n}\n\nconst NOT_YET =\n \"Checking what you may do here. Nothing is offered until then.\";\n\nconst NOTHING_AT_ALL =\n \"You have not been given this. Ask somebody who administers it to share it with you.\";\n\n/** The sentence for one refusal: what the level is, what it would have to be. */\nfunction sentenceFor(what: Capability, level: PermissionLevel | null): string {\n if (level === null) return NOTHING_AT_ALL;\n const need = LEVEL_WORD[NEEDS[what]];\n const have = LEVEL_WORD[level];\n const doing: Record<Capability, string> = {\n read: \"open this\",\n comment: \"leave a comment\",\n write: \"change anything here\",\n organise: \"organize this\",\n remove: \"delete this\",\n share: \"pass this on to somebody else\",\n structure: \"change the columns of this table\",\n };\n return `You are ${have} here, and it takes ${need} to ${doing[what]}. Ask somebody who is Admin on it to move you up.`;\n}\n\n/**\n * WHAT ONE LEVEL LETS A PERSON DO. `level` null and `known` true means the\n * store said \"nothing\" — a real answer. `known` false means it has not said.\n */\nexport function whatYouMayDo(level: PermissionLevel | null, known = true): WhatYouMayDo {\n const may = (what: Capability) => known && atLeast(level, NEEDS[what]);\n return {\n level: known ? level : null,\n known,\n read: may(\"read\"),\n comment: may(\"comment\"),\n write: may(\"write\"),\n organise: may(\"organise\"),\n remove: may(\"remove\"),\n share: may(\"share\"),\n structure: may(\"structure\"),\n why: (what) => (known ? sentenceFor(what, level) : NOT_YET),\n };\n}\n\n/** Nothing offered, because nothing is known yet. */\nexport const NOT_ANSWERED_YET: WhatYouMayDo = whatYouMayDo(null, false);\n\n/**\n * REC-27. The nine Tables the platform ships are not administered from a\n * person's screen whatever level they hold on them — so the structure controls\n * are absent for a kernel Table and say why, and everything else follows the\n * level as usual.\n */\nexport const KERNEL_REASON =\n \"This is one of the tables the platform ships, so its columns are not changed from a screen. \" +\n \"Make your own table to change columns.\";\n\nexport function whatYouMayDoWithTable(\n table: Table | null | undefined,\n level: PermissionLevel | null,\n known: boolean,\n): WhatYouMayDo {\n const base = whatYouMayDo(level, known);\n // A LOCKED DATABASE (lane NOTION-SMALL-2): the columns and the table's settings stay as they are until\n // somebody unlocks it. An editing convenience, never a permission — the lock changes what is OFFERED, the\n // store's ladder is untouched and anyone who may edit the table may unlock it.\n if (!table?.is_kernel) return table && tableIsLocked(table) ? lockedStructure(base) : base;\n return {\n ...base,\n structure: false,\n why: (what) => (what === \"structure\" ? KERNEL_REASON : base.why(what)),\n };\n}\n\n/** Is this table locked against column and settings changes? Kept on the table's own metadata. */\nexport function tableIsLocked(table: Pick<Table, \"metadata\"> | null | undefined): boolean {\n return table?.metadata?.[\"locked\"] === true;\n}\n\nexport const DATABASE_LOCKED_REASON = \"This database is locked, so its columns and settings are read-only. Unlock it to change them.\";\n\nfunction lockedStructure(base: WhatYouMayDo): WhatYouMayDo {\n return { ...base, structure: false, why: (what) => (what === \"structure\" ? DATABASE_LOCKED_REASON : base.why(what)) };\n}\n"],"mappings":";;;AAuCA,SAAS,eAAqC;AA4BvC,IAAM,aAA8C;AAAA,EACzD,QAAQ;AAAA,EACR,WAAW;AAAA,EACX,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,OAAO;AACT;AAMA,IAAM,QAA6C;AAAA,EACjD,MAAM;AAAA;AAAA,EAEN,SAAS;AAAA;AAAA;AAAA,EAGT,OAAO;AAAA;AAAA;AAAA,EAGP,UAAU;AAAA;AAAA,EAEV,QAAQ;AAAA;AAAA;AAAA;AAAA,EAIR,OAAO;AAAA;AAAA,EAEP,WAAW;AAC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EACtE;AACF;AAGO,SAAS,cAAc,OAA4D;AACxF,SAAO,OAAO,WAAW,QAAQ,MAAM;AACzC;AAEO,IAAM,yBAAyB;AAEtC,SAAS,gBAAgB,MAAkC;AACzD,SAAO,EAAE,GAAG,MAAM,WAAW,OAAO,KAAK,CAAC,SAAU,SAAS,cAAc,yBAAyB,KAAK,IAAI,IAAI,EAAG;AACtH;","names":[]}
@@ -157,4 +157,4 @@ export {
157
157
  sampleHeight,
158
158
  HtmlSampleFrame
159
159
  };
160
- //# sourceMappingURL=chunk-FECWKOWW.js.map
160
+ //# sourceMappingURL=chunk-W7GR64CB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/looks/htmlFrame.tsx"],"sourcesContent":["\"use client\";\n\n// src/looks/htmlFrame.tsx — @ai-matrx/records-ui · THE SEAMLESS HTML FRAME (light: react + cn only)\n//\n// Shipped alone as `@ai-matrx/records-ui/html-frame`, so a host draws written HTML (the board's\n// Cover hero) without loading a screen. The html_sample look (htmlLook.tsx) draws its samples in it.\n// What the frame allows and why: see htmlLook.tsx's header.\n\nimport { createContext, useContext, useEffect, useRef, useState, type ReactNode } from \"react\";\nimport { cn } from \"@ai-matrx/design-system/cn\";\n/** The sandbox the frame wears. Markup and CSS only: never `allow-scripts` (see the header). */\nexport const HTML_SAMPLE_SANDBOX = \"allow-same-origin\";\n\n/** What a sample may load: inline styles, and images and fonts from data or https. Nothing else. */\nexport const HTML_SAMPLE_CSP =\n \"default-src 'none'; style-src 'unsafe-inline' https://fonts.googleapis.com; img-src data: blob: https:; font-src data: https:; media-src data: https:; script-src 'none'; connect-src 'none'; form-action 'none'\";\n\n/** The token names every sample can use as `var(--name)`. The agent skill names the same list. */\nexport const SAMPLE_TOKEN_NAMES = [\n \"background\",\n \"foreground\",\n \"card\",\n \"card-foreground\",\n \"popover\",\n \"popover-foreground\",\n \"muted\",\n \"muted-foreground\",\n \"primary\",\n \"primary-foreground\",\n \"secondary\",\n \"secondary-foreground\",\n \"accent\",\n \"accent-foreground\",\n \"destructive\",\n \"destructive-foreground\",\n \"success\",\n \"warning\",\n \"border\",\n \"input\",\n \"ring\",\n \"radius\",\n] as const;\n\nexport type SampleTheme = \"light\" | \"dark\";\n/** Token values by name, without the leading dashes: `{ primary: \"#1f4fe0\", radius: \"8px\" }`. */\nexport type SampleTokens = Readonly<Record<string, string>>;\nexport interface SampleTokenSet {\n light?: SampleTokens;\n dark?: SampleTokens;\n /** Web font families the samples name (a board's type styles); loaded from Google Fonts. */\n fonts?: readonly string[];\n}\n\n/** Families that are the system's own and need no loading. */\nconst SYSTEM_FAMILY = /^(system-ui|ui-[a-z-]+|-apple-system|blinkmacsystemfont|serif|sans-serif|monospace|cursive|fantasy|georgia|arial|helvetica|helvetica neue|times|times new roman|courier|courier new|verdana|tahoma|segoe ui|roboto mono|sf pro.*|menlo|monaco|consolas)$/i;\n\n/** The one stylesheet link that loads these families, or \"\" when none needs loading. */\nexport function fontLink(fonts: readonly string[] | undefined): string {\n const families = [...new Set((fonts ?? []).map((f) => f.trim()).filter((f) => /^[A-Za-z0-9 ]{2,40}$/.test(f) && !SYSTEM_FAMILY.test(f)))].slice(0, 8);\n if (families.length === 0) return \"\";\n const q = families.map((f) => `family=${f.replace(/ /g, \"+\")}:ital,wght@0,300..800;1,300..800`).join(\"&\");\n return `<link rel=\"stylesheet\" href=\"https://fonts.googleapis.com/css2?${q}&display=swap\">`;\n}\n\nconst TokensContext = createContext<SampleTokenSet | null>(null);\n\n/** A host's own token values for every sample under it (a board's design-system tables). */\nexport function HtmlSampleTokensProvider({ tokens, children }: { tokens: SampleTokenSet | null; children: ReactNode }) {\n return <TokensContext.Provider value={tokens}>{children}</TokensContext.Provider>;\n}\n\n/** A bare HSL triplet (\"240 5% 96%\", how the app keeps its colors) becomes a color a sample can use. */\nexport function tokenValue(raw: string): string {\n const v = raw.trim();\n return /^-?\\d+(\\.\\d+)?(deg)?\\s+\\d+(\\.\\d+)?%\\s+\\d+(\\.\\d+)?%(\\s*\\/\\s*[\\d.]+%?)?$/.test(v) ? `hsl(${v})` : v;\n}\n\n/** The host page's theme: `dark` when its root wears the `dark` class or `data-theme=\"dark\"`. */\nexport function hostTheme(doc: Document | undefined = typeof document === \"undefined\" ? undefined : document): SampleTheme {\n const root = doc?.documentElement;\n if (!root) return \"light\";\n return root.classList.contains(\"dark\") || root.dataset.theme === \"dark\" ? \"dark\" : \"light\";\n}\n\n/** The host page's own token values, read from where the frame sits (so a themed region counts). */\nexport function hostTokens(at: Element | null): Record<string, string> {\n const out: Record<string, string> = {};\n if (!at || typeof getComputedStyle === \"undefined\") return out;\n const style = getComputedStyle(at);\n for (const name of SAMPLE_TOKEN_NAMES) {\n const raw = style.getPropertyValue(`--${name}`);\n if (raw && raw.trim()) out[name] = tokenValue(raw);\n }\n return out;\n}\n\n/** The `:root` block a sample reads its tokens from, plus the frame's own seamless reset. */\nexport function sampleStyle(tokens: SampleTokens, theme: SampleTheme, font?: string): string {\n const vars = Object.entries(tokens)\n .filter(([name, value]) => /^[a-z][a-z0-9-]*$/.test(name) && !/[;{}<>]/.test(value))\n .map(([name, value]) => `--${name}:${value};`)\n .join(\"\");\n const family = font && !/[;{}<>]/.test(font) ? font : \"system-ui, sans-serif\";\n return (\n `:root{${vars}color-scheme:${theme};}` +\n `html,body{margin:0;padding:0;background:transparent;overflow:hidden;}` +\n `body{color:var(--foreground,${theme === \"dark\" ? \"#e8ebf1\" : \"#111827\"});font-family:${family};font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased;}` +\n `*,*::before,*::after{box-sizing:border-box;}` +\n `#matrx-sample{display:flow-root;}`\n );\n}\n\n/** The whole document the frame draws: CSP, tokens, the reset, and the sample inside one measured box. */\nexport function sampleDocument(html: string, tokens: SampleTokens, theme: SampleTheme, font?: string, fonts?: readonly string[]): string {\n return (\n `<!doctype html><html class=\"${theme}\" style=\"color-scheme:${theme}\"><head><meta charset=\"utf-8\">` +\n `<meta http-equiv=\"Content-Security-Policy\" content=\"${HTML_SAMPLE_CSP}\">` +\n fontLink(fonts) +\n `<meta name=\"color-scheme\" content=\"${theme}\">` +\n `<style id=\"matrx-sample-tokens\">${sampleStyle(tokens, theme, font)}</style>` +\n `</head><body><div id=\"matrx-sample\">${html}</div></body></html>`\n );\n}\n\n/** The sample's drawn height in px, from its one measured box (margins included: it is a flow root). */\nexport function sampleHeight(doc: Document | null | undefined): number {\n const box = doc?.getElementById(\"matrx-sample\");\n if (!box) return 0;\n return Math.ceil(box.getBoundingClientRect().height || box.scrollHeight || 0);\n}\n\nexport interface HtmlSampleFrameProps {\n html: string;\n /** What a screen reader calls the frame. */\n title?: string;\n className?: string;\n /** Height before the sample has been measured, so the page does not jump when it loads. Default 24. */\n initialHeight?: number;\n}\n\n/**\n * THE SEAMLESS SAMPLE FRAME — markup and CSS only, transparent, borderless, as tall as its content,\n * with the host's tokens and theme. See the file header for what the sandbox allows.\n */\nexport function HtmlSampleFrame({ html, title = \"Sample\", className, initialHeight = 24 }: HtmlSampleFrameProps) {\n const frame = useRef<HTMLIFrameElement | null>(null);\n const given = useContext(TokensContext);\n const [height, setHeight] = useState(initialHeight);\n const [theme, setTheme] = useState<SampleTheme>(() => hostTheme());\n // The document is built once per html; a theme or token change after that is written into the\n // live frame (`paint`), never a reload.\n const fontsKey = (given?.fonts ?? []).join(\"|\");\n const [doc, setDoc] = useState(() => sampleDocument(html, given?.[theme] ?? {}, theme, undefined, given?.fonts));\n const built = useRef(`${html}\\u0000${fontsKey}`);\n\n const tokensFor = (t: SampleTheme): Record<string, string> => ({ ...hostTokens(frame.current), ...(given?.[t] ?? {}) });\n const fontOf = () => (frame.current && typeof getComputedStyle !== \"undefined\" ? getComputedStyle(frame.current).fontFamily : undefined);\n\n // A new html: a new document, opened in today's theme with today's tokens.\n // New fonts to load also rebuild (a stylesheet link is part of the document head).\n useEffect(() => {\n const key = `${html}\\u0000${fontsKey}`;\n if (built.current === key) return;\n built.current = key;\n setDoc(sampleDocument(html, tokensFor(theme), theme, fontOf(), given?.fonts));\n // eslint-disable-next-line react-hooks/exhaustive-deps -- the theme and tokens are written live below\n }, [html, fontsKey]);\n\n // The host's theme, followed as it changes.\n useEffect(() => {\n if (typeof MutationObserver === \"undefined\" || typeof document === \"undefined\") return;\n const watch = new MutationObserver(() => setTheme(hostTheme()));\n watch.observe(document.documentElement, { attributes: true, attributeFilter: [\"class\", \"data-theme\"] });\n return () => watch.disconnect();\n }, []);\n\n const measure = () => {\n const h = sampleHeight(frame.current?.contentDocument);\n if (h > 0) setHeight(h);\n };\n\n // Write the theme and tokens into the live document (same origin, no script inside it).\n const paint = () => {\n const inner = frame.current?.contentDocument;\n if (!inner?.documentElement) return;\n const style = inner.getElementById(\"matrx-sample-tokens\");\n if (style) style.textContent = sampleStyle(tokensFor(theme), theme, fontOf());\n inner.documentElement.className = theme;\n inner.documentElement.style.colorScheme = theme;\n measure();\n };\n\n useEffect(paint, [theme, given]); // eslint-disable-line react-hooks/exhaustive-deps\n\n // The width the frame is given changes the sample's height (text wraps): measure again.\n useEffect(() => {\n const el = frame.current;\n if (!el || typeof ResizeObserver === \"undefined\") return;\n const ro = new ResizeObserver(() => measure());\n ro.observe(el);\n return () => ro.disconnect();\n }, []); // eslint-disable-line react-hooks/exhaustive-deps\n\n const onLoad = () => {\n paint();\n const inner = frame.current?.contentDocument;\n if (!inner) return;\n // Late images and fonts change the height after load.\n inner.addEventListener(\"load\", measure, true);\n void inner.fonts?.ready.then(measure).catch(() => undefined);\n const box = inner.getElementById(\"matrx-sample\");\n const View = inner.defaultView as (Window & { ResizeObserver?: typeof ResizeObserver }) | null;\n if (box && View?.ResizeObserver) new View.ResizeObserver(() => measure()).observe(box);\n };\n\n return (\n <iframe\n ref={frame}\n title={title}\n aria-label={title}\n data-records-html-sample=\"\"\n sandbox={HTML_SAMPLE_SANDBOX}\n referrerPolicy=\"no-referrer\"\n srcDoc={doc}\n onLoad={onLoad}\n scrolling=\"no\"\n className={cn(\"block w-full border-0 bg-transparent\", className)}\n style={{ height: `${height}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AAU,SAAS;AAAA;AAAA,EACzE;AAEJ;","names":[]}
@@ -32,7 +32,7 @@ var FIELD_TYPE_CATALOGUE = [
32
32
  { id: "phone", group: "Words", label: "Phone number", explanation: "A phone number, checked as you type." },
33
33
  { id: "url", group: "Words", label: "Link", explanation: "A web address that opens in a new tab when you click it." },
34
34
  { id: "address", group: "Words", label: "Address", explanation: "A street address in parts, opened in maps." },
35
- { id: "color_pair", group: "Words", label: "Colour", explanation: "A colour for light and dark, with a readability check." },
35
+ { id: "color_pair", group: "Words", label: "Color", explanation: "A color for light and dark, with a readability check." },
36
36
  { id: "type_style", group: "Words", label: "Type style", explanation: "A font, weight and size, shown as a sample." },
37
37
  { id: "shadow", group: "Words", label: "Shadow", explanation: "A shadow, shown on a card." },
38
38
  { id: "json", group: "Words", label: "JSON", explanation: "Structured data \u2014 a list or a set of named values \u2014 shown folded." },
@@ -121,4 +121,4 @@ export {
121
121
  ADD_FIELD_SAVE_LABEL,
122
122
  EDIT_FIELD_SAVE_LABEL
123
123
  };
124
- //# sourceMappingURL=chunk-FHL4GG6R.js.map
124
+ //# sourceMappingURL=chunk-WCQSJPLS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/fieldTypes.ts"],"sourcesContent":["// src/fieldTypes.ts — @ai-matrx/records-ui\n//\n// EVERY KIND OF COLUMN THE STORE TAKES, IN THE WORDS A PERSON USES.\n//\n// The store publishes fourteen parity types and, for each, a sentence about what\n// it is MADE OF — \"REC-31: a File record reached through a relation, target the\n// kernel `File` Table\", \"FLD-9: a declared computation, on read or on write,\n// evaluated by custom.rule_eval\", \"config.via names the relation field,\n// config.pick the Value on the far side\". Those sentences are true and they are\n// for us. The 19 September verdict found them printed at the person choosing a\n// column type, alongside contract row ids, and called it what it is: machine\n// identity where a person is looking.\n//\n// So this file holds the OTHER sentence — what the type is FOR — and the field\n// panel shows that one. The store's own `made_of` stays where it belongs, in\n// `PARITY_MADE_OF`, for an engineer reading the package.\n//\n// The LIST itself is still the store's: `PARITY_FIELD_TYPES` is generated from\n// `custom.parity_field_types()`, and `assertEveryParityTypeIsExplained` (run by\n// the suite) fails the moment the store ships a fourteenth and nobody wrote a\n// sentence for it. A type with no explanation would otherwise appear with a\n// blank line under it, which is the silent version of the same defect. It caught the\n// fourteenth — `checkbox`, 2026-09-21 — exactly as it was written to.\n\nimport { DECLARABLE_FIELD_KINDS, NEWER_FIELD_KINDS, PARITY_FIELD_TYPES, type DeclarableFieldKind, type NewerFieldKind, type ParityFieldType } from \"@ai-matrx/records/field-kinds\";\n\n/** The three behaviors that carry no parity type of their own. */\nexport type PlainFieldType = \"text\" | \"long_text\" | \"number\";\n\n/**\n * THE ONE A PERSON COMING FROM AIRTABLE REACHES FOR FIRST, AND IT WAS NOT HERE.\n *\n * The list above offered `member` (a Person) and `attachment` (a File) — the two\n * relations whose target is a Table the PLATFORM keeps — and nothing at all for\n * \"this job belongs to that customer\". The store has taken it since 2026-09-20\n * (`custom.field_declare` with `type: \"relation\"` and a `relation_target`), the\n * Field type has named it since the same day, and `editorKindFor` has answered\n * `\"relation\"` for one since long before that. Only the menu did not offer it,\n * so the guide's section 3 told a person to pick a kind that did not exist.\n *\n * It is NOT a parity type of its own. `custom.parity_field_types()` ships\n * fourteen (the fourteenth is `checkbox`) and a relation is a BEHAVIOR — the same behavior `member` and\n * `attachment` are made of — so it sits beside the three plain ones as its own\n * word, and `parityTypesWithNoExplanation()` is unaffected by it in both\n * directions: it does not appear there, and it cannot hide a real gap there.\n */\nexport type RelationFieldType = \"relation\";\n\n/**\n * What a person picks in the panel — AND IT IS THE STORE'S OWN LIST, not a union\n * assembled here.\n *\n * 🚨 THE CLASS FIX (FIX-10B-F6, VERIFIER-10). This used to read\n * `ParityFieldType | PlainFieldType | RelationFieldType` — the parity floor plus two words\n * this file knew about — and that union was the whole defect. `custom.doc_sign` accepts\n * exactly one field, a text column whose format is `signature`, and it is granted to\n * `authenticated`; the Documents screen told a person in so many words to go and declare\n * one; and no list any screen could read named it, so the control did not exist and the\n * e-sign half of Documents was unreachable from the product. A kind the store takes and no\n * screen offers is invisible, and nothing failed — which is the only reason it survived.\n *\n * `custom.field_kinds()` is now the ONE registry and `DECLARABLE_FIELD_KINDS` is generated\n * from it, so the next kind the store learns arrives here as a TYPE ERROR in\n * `FIELD_TYPE_CHOICES`'s coverage and as a red `kindsWithNoChoice()` below — never as a\n * silence.\n */\nexport type PickableFieldType = DeclarableFieldKind | SystemFieldKind | \"entity_reference\" | NewerFieldKind | LookFieldKind;\n\n/**\n * A KIND THAT IS A PLAIN COLUMN WEARING A LOOK (grids review 3, lane H item 5). The store keeps a\n * column's \"Shows as\" on the Field (`display_format`, `custom.display_format_ids()` has `rating` and\n * `time`), so a Rating is a whole number shown as stars and a Time is a time of day kept as its\n * 24-hour text — declared through the ordinary door (`{ plain, display_format }`) the same way the\n * \"Shows as\" picker makes one. Offered whenever the store does not yet publish the kind as its own\n * word (`custom.field_kinds()`): a Rating the store publishes goes as `{ type: \"rating\", max }`.\n */\nexport type LookFieldKind = \"time\" | \"color_pair\" | \"measure\" | \"type_style\" | \"shadow\";\n\nexport interface LookKind {\n plain: \"number\" | \"text\";\n look: (args: { ratingMax: number }) => { id: string; options?: Record<string, unknown> };\n}\n\nexport const LOOK_KINDS: Partial<Record<PickableFieldType, LookKind>> = {\n rating: { plain: \"number\", look: ({ ratingMax }) => ({ id: \"rating\", options: { ratingMax } }) },\n time: { plain: \"text\", look: () => ({ id: \"time\" }) },\n // PLUG-IN DESIGN LOOKS (2026-10-17, `looks/designLooks.tsx`): a structured token is JSON text in a text column.\n color_pair: { plain: \"text\", look: () => ({ id: \"color_pair\" }) },\n measure: { plain: \"number\", look: () => ({ id: \"measure\", options: { unit: \"px\" } }) },\n type_style: { plain: \"text\", look: () => ({ id: \"type_style\" }) },\n shadow: { plain: \"text\", look: () => ({ id: \"shadow\" }) },\n};\n\n/** Is this kind declared as a plain column wearing a look (because the store does not publish it)? */\nexport function declaredAsLook(kind: string): boolean {\n return kind in LOOK_KINDS && !storePublishesKind(kind);\n}\n\n/**\n * LANE 10 P4: THE NINE NEWER KINDS (rating, duration, created by, last changed by, status, address,\n * barcode, formatted text, count). Each is listed in `FIELD_TYPE_CATALOGUE` below, so every reader\n * (Settings, the column panel, every layout) names a column of one by its own word; the MENU offers\n * one only once `custom.field_kinds()` publishes it (after the chair's apply and\n * `pnpm records:generate`), so a person is never offered a kind the live store would refuse.\n */\nexport function storePublishesKind(kind: string): boolean {\n return DECLARABLE_FIELD_KINDS.some((row) => (row.kind as string) === kind);\n}\n\n/**\n * LANE SC-R: a column that points at a PLATFORM thing (a note, a web site, an agent). Its menu entry\n * is drawn only once `custom.field_kinds()` publishes `entity_reference` (after the chair's apply\n * and `pnpm records:generate`), so the menu never offers a kind the live store would refuse.\n */\nexport const STORE_PUBLISHES_ENTITY_REFERENCE = DECLARABLE_FIELD_KINDS.some(\n (row) => (row.kind as string) === \"entity_reference\",\n);\n\n/**\n * THE STORE'S OWN STAMPS AS COLUMNS (GRID-PRIMITIVES G5; TABLE-PARITY H2 H3, lane\n * DEFAULT-GRID-PARITY). `custom.field_declare` takes these three WORDS and makes each a formula\n * Field whose expression is the system node (`fx.autonumber`, `fx.created_time`,\n * `fx.modified_time`, `config.system` naming which), so nobody types into them and every reader\n * that serves a worked-out value serves them. `custom.field_kinds()` does not publish them,\n * because each is a formula, not a behavior of its own. So they are named here, sent as their\n * word through the `{ type }` arm, and a new autonumber column numbers the records already in\n * the table through `custom.autonumber_backfill`.\n */\nexport type SystemFieldKind = \"autonumber\" | \"created_time\" | \"modified_time\";\n\nexport const SYSTEM_FIELD_KINDS: readonly SystemFieldKind[] = [\"autonumber\", \"created_time\", \"modified_time\"];\n\nexport function isSystemFieldKind(id: string): id is SystemFieldKind {\n return (SYSTEM_FIELD_KINDS as readonly string[]).includes(id);\n}\n\nexport interface FieldTypeChoice {\n id: PickableFieldType;\n /** The word on the menu. */\n label: string;\n /** One line, under the word, saying what it is FOR. Never what it is made of. */\n explanation: string;\n /** The heading it sits under, so seventeen choices read as four short lists. */\n group: \"Words\" | \"Numbers and dates\" | \"Choices and people\" | \"Worked out\";\n}\n\n/**\n * EVERY KIND THIS PACKAGE CAN NAME AND DRAW, in menu order. The menu (`FIELD_TYPE_CHOICES`) is this\n * list less the kinds the live store does not take yet; every reader names a column from this one.\n */\nexport const FIELD_TYPE_CATALOGUE: FieldTypeChoice[] = [\n { id: \"text\", group: \"Words\", label: \"Text\", explanation: \"A short line of writing — a name, a reference, a title.\" },\n { id: \"long_text\", group: \"Words\", label: \"Long text\", explanation: \"Several lines — a description, notes, an address.\" },\n { id: \"rich_text\", group: \"Words\", label: \"Formatted text\", explanation: \"Notes with bold, lists and links.\" },\n { id: \"email\", group: \"Words\", label: \"Email address\", explanation: \"An email address, checked as you type and ready to write to.\" },\n { id: \"phone\", group: \"Words\", label: \"Phone number\", explanation: \"A phone number, checked as you type.\" },\n { id: \"url\", group: \"Words\", label: \"Link\", explanation: \"A web address that opens in a new tab when you click it.\" },\n { id: \"address\", group: \"Words\", label: \"Address\", explanation: \"A street address in parts, opened in maps.\" },\n { id: \"color_pair\", group: \"Words\", label: \"Color\", explanation: \"A color for light and dark, with a readability check.\" },\n { id: \"type_style\", group: \"Words\", label: \"Type style\", explanation: \"A font, weight and size, shown as a sample.\" },\n { id: \"shadow\", group: \"Words\", label: \"Shadow\", explanation: \"A shadow, shown on a card.\" },\n { id: \"json\", group: \"Words\", label: \"JSON\", explanation: \"Structured data — a list or a set of named values — shown folded.\" },\n { id: \"barcode\", group: \"Words\", label: \"Barcode\", explanation: \"A code a scanner reads, like a wristband or a box.\" },\n { id: \"button\", group: \"Words\", label: \"Button\", explanation: \"A button on each record that opens a link or runs an action.\" },\n\n { id: \"number\", group: \"Numbers and dates\", label: \"Number\", explanation: \"A plain number you can total up and sort by.\" },\n { id: \"currency\", group: \"Numbers and dates\", label: \"Money\", explanation: \"An amount of money, shown with its currency wherever it appears.\" },\n { id: \"percent\", group: \"Numbers and dates\", label: \"Percentage\", explanation: \"A number out of a hundred, kept between 0 and 100.\" },\n { id: \"rating\", group: \"Numbers and dates\", label: \"Rating\", explanation: \"A score in stars, set with one click.\" },\n { id: \"duration\", group: \"Numbers and dates\", label: \"Duration\", explanation: \"A length of time, typed as 45 min or 1:30.\" },\n { id: \"time\", group: \"Numbers and dates\", label: \"Time\", explanation: \"A time of day with no date — a shift start, opening hours.\" },\n { id: \"measure\", group: \"Numbers and dates\", label: \"Size\", explanation: \"A number with a unit: 16 px, 1.5 rem, 200 ms.\" },\n { id: \"datetime\", group: \"Numbers and dates\", label: \"Date\", explanation: \"A day, or a day and a time. Dates are what the calendar view reads.\" },\n\n { id: \"select\", group: \"Choices and people\", label: \"Choice\", explanation: \"One answer from a list you write here. Choices are what the board view groups by.\" },\n { id: \"multi_select\", group: \"Choices and people\", label: \"Several choices\", explanation: \"Any number of answers from a list you write here.\" },\n { id: \"status\", group: \"Choices and people\", label: \"Status\", explanation: \"Choices grouped into To do, In progress and Done.\" },\n { id: \"checkbox\", group: \"Choices and people\", label: \"Yes / no\", explanation: \"A box you tick. Left alone it stays unanswered, which is not the same as a no.\" },\n { id: \"member\", group: \"Choices and people\", label: \"Person\", explanation: \"Somebody in this organization, picked from the people who are in it.\" },\n { id: \"attachment\", group: \"Choices and people\", label: \"File\", explanation: \"A file or a picture kept with the record.\" },\n { id: \"signature\", group: \"Choices and people\", label: \"Signature\", explanation: \"Somebody's sign-off on a document made from this record. Nobody types in it — it fills in when they sign.\" },\n { id: \"relation\", group: \"Choices and people\", label: \"Points at another record\", explanation: \"A link to records in another of your tables — the customer a job is for, the lines on an invoice.\" },\n {\n id: \"entity_reference\",\n group: \"Choices and people\",\n label: \"Points at something else on the platform\",\n explanation: \"A note, a web site, an agent, a workbook — anything you keep here that is not one of your tables.\",\n },\n\n { id: \"lookup\", group: \"Worked out\", label: \"Borrowed value\", explanation: \"A value read from a record this one points at, kept in step with it.\" },\n { id: \"rollup\", group: \"Worked out\", label: \"Total of linked records\", explanation: \"A count or a total worked out from the records this one points at.\" },\n { id: \"count\", group: \"Worked out\", label: \"Count of linked records\", explanation: \"How many records this one points at.\" },\n { id: \"formula\", group: \"Worked out\", label: \"Worked out from other columns\", explanation: \"A value this record works out for itself from its own other columns.\" },\n { id: \"autonumber\", group: \"Worked out\", label: \"Record number\", explanation: \"A number the table gives each record, one after another, never reused. Records already here are numbered in the order they were made.\" },\n { id: \"created_time\", group: \"Worked out\", label: \"Created time\", explanation: \"When each record was made. Nobody types it.\" },\n { id: \"modified_time\", group: \"Worked out\", label: \"Last changed time\", explanation: \"When each record last changed. Nobody types it.\" },\n { id: \"created_by\", group: \"Worked out\", label: \"Created by\", explanation: \"Who made each record. Nobody types it.\" },\n { id: \"modified_by\", group: \"Worked out\", label: \"Last changed by\", explanation: \"Who last changed each record. Nobody types it.\" },\n];\n\n/** The kinds the menu offers only once the live store publishes them. */\nconst GATED_KINDS = new Set<string>([\"entity_reference\", ...NEWER_FIELD_KINDS]);\n\nexport const FIELD_TYPE_CHOICES: FieldTypeChoice[] = FIELD_TYPE_CATALOGUE.filter(\n (c) => !GATED_KINDS.has(c.id) || storePublishesKind(c.id) || c.id in LOOK_KINDS,\n);\n\nexport const FIELD_TYPE_GROUPS: FieldTypeChoice[\"group\"][] = [\n \"Words\",\n \"Numbers and dates\",\n \"Choices and people\",\n \"Worked out\",\n];\n\nconst BY_ID = new Map<string, FieldTypeChoice>(FIELD_TYPE_CATALOGUE.map((c) => [c.id, c]));\n\nexport function fieldTypeChoice(id: string): FieldTypeChoice | undefined {\n return BY_ID.get(id);\n}\n\n/** The three that are a plain behavior rather than one of the fourteen. */\nexport function isPlainFieldType(id: string): id is PlainFieldType {\n return id === \"text\" || id === \"long_text\" || id === \"number\";\n}\n\n/**\n * The one that is a relation a person aims themselves. It is neither plain nor\n * one of the thirteen, so every caller that branched on `isPlainFieldType`\n * alone has to answer this question too — which is why it is a named function\n * and not an inline string comparison at four call sites.\n */\nexport function isRelationFieldType(id: string): id is RelationFieldType {\n return id === \"relation\";\n}\n\n/**\n * One of FLD-11's fourteen, which is what `parity_type` on a declaration means.\n *\n * Read from the store's own generated floor, never from a list here — because a kind that\n * is NOT one of the fourteen (plain text, a person-aimed relation, a signature) has to be\n * declared by its WORD (`type`) and a panel that sent `parity_type` for it would be refused\n * \"There is no field type called …\". That is the shape of the F6 defect: the panel's `save`\n * had exactly two branches, relation and plain, and everything else fell into `parity_type`.\n */\nexport function isParityFieldType(id: string): id is ParityFieldType {\n return PARITY_FIELD_TYPES.some((row) => row.parity_type === id);\n}\n\n/**\n * THE GUARD THIS FILE NEEDS, because the list it explains is generated.\n *\n * Returns the parity types the store ships that nothing here explains. The\n * suite asserts it is empty; a fourteenth type would otherwise reach the menu\n * with a blank line under it and nobody would notice until a person did.\n *\n * `relation` is deliberately NOT one of the thirteen and therefore never\n * appears in this answer: `PARITY_FIELD_TYPES` is the store's own generated\n * list and a behavior that carries no parity type is not in it.\n */\nexport function parityTypesWithNoExplanation(): string[] {\n return PARITY_FIELD_TYPES.map((row) => row.parity_type).filter((type) => !BY_ID.has(type));\n}\n\n/**\n * 🚨 THE GUARD THAT CLOSES THE CLASS (FIX-10B-F6).\n *\n * `parityTypesWithNoExplanation()` above watches the parity FLOOR, and the floor was never\n * the whole list: the store also declares plain text, long text, number, a person-aimed\n * relation and a signature, and for months nothing anywhere compared the panel's menu with\n * THAT. So `signature` — the one field `custom.doc_sign` accepts, on a door granted to\n * every signed-in person, named to the person by the Documents screen itself — was absent\n * from the menu and every check stayed green.\n *\n * This returns the kinds `custom.field_kinds()` publishes that this panel does not offer.\n * The suite asserts it is empty, so a kind the store learns tomorrow either reaches the\n * person or turns a test red the same day. It is the class, not the instance: it would have\n * caught `signature`, and it will catch the twentieth kind nobody has thought of yet.\n */\nexport function kindsWithNoChoice(): string[] {\n return DECLARABLE_FIELD_KINDS.map((row) => row.kind).filter((kind) => !BY_ID.has(kind));\n}\n\n// ───────────────────────────────────────────────────────────────────────────\n// THE WORDS ON THE TWO BUTTONS, IN ONE PLACE — because they used to be the SAME\n// WORDS in two places, and that cost somebody their column.\n//\n// 🚨 THE DEFECT (TAILS-5, 2026-09-21, measured while driving the panel headless\n// on Rincon Plumbing's Summerland branch). The Jobs toolbar's control that OPENS\n// the field panel read exactly \"Add field\", and the panel's own SAVE button read\n// exactly \"Add field\" too — `FieldEditor` says \"Save field\" only when EDITING an\n// existing column, so on the create path the two were character-identical. The\n// toolbar control is a TOGGLE: pressing it while the panel is open closes the\n// panel and throws away everything typed into it. So a person who typed a column\n// name, chose a type, picked the target table and its display columns, then\n// looked up at the words they were told to press, could lose all of it — with no\n// sentence, no request sent, and nothing to say it had happened. A walk written\n// by an agent lost the column twice that way and spent a round diagnosing the\n// store before reading the two labels side by side.\n//\n// WHY THEY LIVE HERE AND NOT IN `@ai-matrx/design-system`. The words are RECORDS\n// vocabulary — \"field\", \"column\" — and the design system knows nothing about\n// either; a labels module there would be a domain word in a generic package, and\n// the next person adding a button would not find it. This file is already the\n// one place that owns what a person READS about a column (`FIELD_TYPE_CHOICES`\n// is right above), and both surfaces that draw these buttons are in this\n// package. One module, one import each, and `fieldTypes.test.ts` asserts the two\n// can never be the same string again.\n//\n// THE RULE: the control that OPENS a panel and the control that COMMITS it never\n// read the same words. The opener is an invitation; the committer says what it\n// will make.\n\n/** The toolbar control that OPENS the add-a-column panel. An invitation. */\nexport const ADD_FIELD_OPEN_LABEL = \"Add column\";\n\n/** The panel's own primary, on the CREATE path. It says what pressing it makes. */\nexport const ADD_FIELD_SAVE_LABEL = \"Create column\";\n\n/** The panel's own primary when an existing column is being changed. */\nexport const EDIT_FIELD_SAVE_LABEL = \"Save column\";\n"],"mappings":";;;AAwBA,SAAS,wBAAwB,mBAAmB,0BAA+F;AA2D5I,IAAM,aAA2D;AAAA,EACtE,QAAQ,EAAE,OAAO,UAAU,MAAM,CAAC,EAAE,UAAU,OAAO,EAAE,IAAI,UAAU,SAAS,EAAE,UAAU,EAAE,GAAG;AAAA,EAC/F,MAAM,EAAE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