@ai-matrx/records-ui 0.116.113 → 0.116.115

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 (34) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/{SaveToTable-GRDFTAC4.js → SaveToTable-FVDYG5QS.js} +3 -3
  3. package/dist/{chunk-FZVW6XVB.js → chunk-ESOQXQAE.js} +2 -2
  4. package/dist/{chunk-LGQLATW5.js → chunk-KUEASKVB.js} +4 -4
  5. package/dist/{chunk-Z3EUU2NM.js → chunk-OY553AFP.js} +2 -2
  6. package/dist/{chunk-N76I4VXM.js → chunk-PYLGLSKU.js} +2 -2
  7. package/dist/{chunk-JTEIYLII.js → chunk-RKI2YQHW.js} +2 -2
  8. package/dist/chunk-RKI2YQHW.js.map +1 -0
  9. package/dist/entity-doors.cjs +3 -4
  10. package/dist/entity-doors.cjs.map +1 -1
  11. package/dist/entity-doors.js +3 -4
  12. package/dist/entity-doors.js.map +1 -1
  13. package/dist/entity-ref.cjs +4 -5
  14. package/dist/entity-ref.cjs.map +1 -1
  15. package/dist/entity-ref.js +4 -5
  16. package/dist/entity-ref.js.map +1 -1
  17. package/dist/helpers.cjs +2 -3
  18. package/dist/helpers.cjs.map +1 -1
  19. package/dist/helpers.js +2 -2
  20. package/dist/helpers.js.map +1 -1
  21. package/dist/index.cjs +394 -394
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +5 -5
  24. package/dist/pickers.cjs +158 -158
  25. package/dist/pickers.cjs.map +1 -1
  26. package/dist/pickers.js +3 -3
  27. package/dist/skeleton.js +3 -3
  28. package/package.json +2 -2
  29. package/dist/chunk-JTEIYLII.js.map +0 -1
  30. /package/dist/{SaveToTable-GRDFTAC4.js.map → SaveToTable-FVDYG5QS.js.map} +0 -0
  31. /package/dist/{chunk-FZVW6XVB.js.map → chunk-ESOQXQAE.js.map} +0 -0
  32. /package/dist/{chunk-LGQLATW5.js.map → chunk-KUEASKVB.js.map} +0 -0
  33. /package/dist/{chunk-Z3EUU2NM.js.map → chunk-OY553AFP.js.map} +0 -0
  34. /package/dist/{chunk-N76I4VXM.js.map → chunk-PYLGLSKU.js.map} +0 -0
package/dist/pickers.js CHANGED
@@ -17,13 +17,13 @@ import {
17
17
  isCompleteDataBinding,
18
18
  isDataBinding,
19
19
  useTablesAnywhere
20
- } from "./chunk-LGQLATW5.js";
21
- import "./chunk-Z3EUU2NM.js";
20
+ } from "./chunk-KUEASKVB.js";
21
+ import "./chunk-OY553AFP.js";
22
22
  import "./chunk-4CI2HLX3.js";
23
23
  import "./chunk-DZ4KNUSS.js";
24
24
  import "./chunk-YHPVSUK6.js";
25
25
  import "./chunk-LBZZDHV6.js";
26
- import "./chunk-JTEIYLII.js";
26
+ import "./chunk-RKI2YQHW.js";
27
27
  import "./chunk-WCQSJPLS.js";
28
28
  import "./chunk-HKYEHBQT.js";
29
29
  export {
package/dist/skeleton.js CHANGED
@@ -20,9 +20,9 @@ import {
20
20
  useExpectedRows,
21
21
  useRememberedLayout,
22
22
  useRememberedPageRows
23
- } from "./chunk-FZVW6XVB.js";
24
- import "./chunk-Z3EUU2NM.js";
25
- import "./chunk-JTEIYLII.js";
23
+ } from "./chunk-ESOQXQAE.js";
24
+ import "./chunk-OY553AFP.js";
25
+ import "./chunk-RKI2YQHW.js";
26
26
  import "./chunk-WCQSJPLS.js";
27
27
  import "./chunk-HKYEHBQT.js";
28
28
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-matrx/records-ui",
3
- "version": "0.116.113",
3
+ "version": "0.116.115",
4
4
  "description": "The thirty-one canonical screens of the AI Matrx record store: grid, generated record form, field editor, table settings, relation picker, peek, views, import/export, custom fields, action inbox, history, comments, forms, charts, documents, record chat, AI field fill, checklists, bookings, offline capture, portals, public pages and embeds. Built on @ai-matrx/design-system's data table, carrying @ai-matrx/alchemy's menu, and reading and writing ONLY through @ai-matrx/records.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -172,5 +172,5 @@
172
172
  "node": ">=20"
173
173
  },
174
174
  "sideEffects": false,
175
- "gitHead": "9d4bb49eb5dbe816f5ceae12085d5cd4ab27f90c"
175
+ "gitHead": "2a67e4f9525a14fdd36bd8e1d3a96b91e06a051d"
176
176
  }
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/personZone.ts","../src/docs.ts","../src/choiceLooks.ts","../src/parity.ts","../src/dates.ts"],"sourcesContent":["// The person's time zone, as the app saved it (userPreferences.display.timeZone).\n//\n// The host app tells this package once (`setPersonTimeZone(\"America/Los_Angeles\")`); every \"today\" and\n// \"now\" a screen draws (the calendar's today marker and now-line, a timeline's today, a date picker's\n// today) is read in that zone instead of the device's. With nothing set the device zone applies, as before.\n// Nothing here stores a zone: the host's saved preference is the one place, this is its mirror.\n\nimport { setColorRuleTimeZone, setDisplayTimeZone } from \"@ai-matrx/design-system/data-table/table-style\";\nimport { setReadersTimeZone } from \"@ai-matrx/records\";\nimport { globalSlot } from \"@ai-matrx/kit/global-slot\";\n\n// No React here: `@ai-matrx/records-ui/helpers` serves this file alone (the host sets the zone at\n// boot), and the root entry carries its own copy — so the zone lives in ONE realm-wide slot that\n// both copies read, never a module `let` that would split in two. The hook is `./personTime`.\nconst state = globalSlot(\"ai-matrx.records-ui.person-time-zone\", () => ({\n zone: null as string | null,\n listeners: new Set<() => void>(),\n}));\n\nfunction valid(z: unknown): z is string {\n if (typeof z !== \"string\" || !z.trim()) return false;\n try {\n new Intl.DateTimeFormat(\"en-US\", { timeZone: z });\n return true;\n } catch {\n return false;\n }\n}\n\n/** The host app's saved zone (IANA). `null` / junk clears it: the device zone applies. */\nexport function setPersonTimeZone(next: string | null | undefined): void {\n const clean = valid(next) ? next : null;\n if (clean === state.zone) return;\n state.zone = clean;\n // \"Today\" in a color rule is the person's day, not the device's (lane NOTION-SMALL-2).\n setColorRuleTimeZone(clean);\n // And every moment a screen prints (grid cell, panel, card, export) reads in it too: ONE zone, one slot.\n setDisplayTimeZone(clean);\n // And a relative day (\"Today\", \"Overdue\") a view asks the store is cut in it before it is sent (ADVERSARIAL-11 F3).\n setReadersTimeZone(clean);\n state.listeners.forEach((l) => l());\n}\n\nexport function getPersonTimeZone(): string | null {\n return state.zone;\n}\n\n/** Calls `listener` whenever the zone changes; returns the unsubscribe. */\nexport function subscribePersonTimeZone(listener: () => void): () => void {\n state.listeners.add(listener);\n return () => {\n state.listeners.delete(listener);\n };\n}\n\n/**\n * `at` as a Date whose LOCAL fields (getFullYear, getHours, ...) read the wall clock in the person's zone.\n * For day / hour math only: never compare it with a stored instant.\n */\nexport function personWallNow(at: Date = new Date()): Date {\n const zone = state.zone;\n if (!zone) return at;\n const parts = new Intl.DateTimeFormat(\"en-US\", {\n timeZone: zone,\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n hourCycle: \"h23\",\n }).formatToParts(at);\n const n = (t: string) => Number(parts.find((p) => p.type === t)?.value ?? 0);\n return new Date(n(\"year\"), n(\"month\") - 1, n(\"day\"), n(\"hour\"), n(\"minute\"), n(\"second\"));\n}\n\n/**\n * The inverse of `personWallNow`: the INSTANT at which the person's wall clock reads the local fields\n * of `wall` (getFullYear, getHours, ...). A calendar drop at \"9:30 on Nov 3\" writes this, so the card\n * reads 9:30 on Nov 3 again in the person's zone. With no zone set it is `wall` itself (device zone).\n */\nexport function instantFromPersonWall(wall: Date): Date {\n const zone = state.zone;\n if (!zone) return wall;\n const target = Date.UTC(wall.getFullYear(), wall.getMonth(), wall.getDate(), wall.getHours(), wall.getMinutes(), wall.getSeconds(), wall.getMilliseconds());\n let guess = target;\n for (let i = 0; i < 3; i += 1) {\n const seen = personWallNow(new Date(guess));\n const shown = Date.UTC(seen.getFullYear(), seen.getMonth(), seen.getDate(), seen.getHours(), seen.getMinutes(), seen.getSeconds(), wall.getMilliseconds());\n guess -= shown - target;\n }\n return new Date(guess);\n}\n","// src/docs.ts — @ai-matrx/records-ui · SCR-20, SCR-21, SCR-22\n//\n// DOCUMENTS OVER RECORDS. A template is a body whose tokens point at Fields BY\n// ID; a render is written ONCE and frozen with the SHA-256 of its own text; a\n// signature seals that exact version and is immutable once made.\n//\n// Three things this package refuses to re-implement, because the store already\n// does them and doing them twice is how two answers appear:\n// · which tokens a body contains — `custom.doc_tokens`;\n// · which of them this Table cannot answer, and why — `custom.doc_unresolved_tokens`;\n// · whether a signature still holds — `custom.doc_signature_intact`.\n//\n// The token syntax is the store's own: `{{field:<the field's id>}}`. A name\n// would be a token that silently stops resolving the day somebody renames a\n// Field, which is the exact failure REC-17 exists to prevent.\n\nimport type { Field, Uuid } from \"@ai-matrx/records\";\n\n/** The one token form, written the way the store's own pattern reads it. */\nexport function fieldToken(fieldId: Uuid): string {\n return `{{field:${fieldId}}}`;\n}\n\n/** THE DECLARATIVE SPEC an agent writes. One template, whole, in one object. */\nexport interface DocTemplateSpec {\n name: string;\n /** The body, tokens and all. */\n body: string;\n}\n\n/**\n * A template written in terms of Field KEYS — which is how an agent thinks and\n * how a person reads — turned into the store's id-based tokens. The agent writes\n * `{{title}}`; what is stored points at the Field's id, so a rename never\n * silently empties the document.\n *\n * A key this Table does not have is LEFT EXACTLY AS IT IS, so\n * `custom.doc_unresolved_tokens` names it and the screen shows the store's own\n * reason — it is never quietly deleted from the body.\n */\nexport function bodyFromKeys(body: string, fields: Field[]): string {\n const byKey = new Map(fields.map((f) => [f.key, f.id]));\n return body.replace(/\\{\\{\\s*([a-zA-Z0-9_]+)\\s*\\}\\}/g, (whole, key: string) => {\n const id = byKey.get(key);\n return id ? fieldToken(id) : whole;\n });\n}\n\n/** The reverse, for a person reading a stored body: ids shown as the Field's label. */\nexport function bodyForReading(body: string, fields: Field[]): string {\n const byId = new Map(fields.map((f) => [f.id, f.label || f.key]));\n return body.replace(/\\{\\{\\s*field:([0-9a-fA-F-]{36})\\s*\\}\\}/g, (whole, id: string) => {\n const label = byId.get(id);\n return label ? `{{${label}}}` : whole;\n });\n}\n\n/** VAL-10: a signature is a Value on a text Field whose format is `signature`. */\nexport function isSignatureField(field: Field): boolean {\n return field.type === \"text\" && (field.format ?? \"\").toLowerCase() === \"signature\";\n}\n","// src/choiceLooks.ts — @ai-matrx/records-ui · merge tranche 6f (early)\n//\n// A CHOICE WEARS THE COLOR ITS OWNER GAVE IT.\n//\n// The older /data grid let a person paint each choice of a list (\"Completed\" green, \"Scheduled\"\n// blue), and those colors are kept on the Field itself: `display_format.options.choices`, the\n// document `custom.field_update` writes (the /data Sheet's seam writes it the same way, and a\n// column's settings here write it back). The grid used to ignore it and HASH THE WORD into a\n// color, so a column painted green on /data came up amber here, and a color a person set in the\n// settings changed nothing on screen — the silent half of a setting.\n//\n// Pure: no React, no store call. The Field the grid already holds carries everything.\n\nimport { newerKindOf } from \"@ai-matrx/records/field-kinds\";\nimport type { Field } from \"@ai-matrx/records\";\n// The values from the pure `table-style` subpath (no \"use client\", no grid): `@ai-matrx/records-ui/helpers`\n// reaches this file through `fieldTypeLabel`, and the data-table root would drag the whole grid with it.\nimport { CHOICE_CHIP_CLASS, NEUTRAL_CHIP_CLASS, STYLE_COLORS } from \"@ai-matrx/design-system/data-table/table-style\";\nimport type { ChoiceColorLookup, StyleColor } from \"@ai-matrx/design-system/data-table\";\n\n/** One choice's look, as the Field keeps it. */\nexport interface ChoiceLook {\n value: string;\n label?: string;\n color?: StyleColor;\n}\n\n/** The Field's display document, which the store keeps beside its declared keys. */\nexport function displayFormatOf(field: Field): { id: string; options: Record<string, unknown> } | null {\n const raw = (field as unknown as { display_format?: unknown }).display_format;\n if (!raw || typeof raw !== \"object\") return null;\n const id = (raw as { id?: unknown }).id;\n if (typeof id !== \"string\" || id === \"\") return null;\n const options = (raw as { options?: unknown }).options;\n return { id, options: options && typeof options === \"object\" ? (options as Record<string, unknown>) : {} };\n}\n\nfunction isStyleColor(v: unknown): v is StyleColor {\n return typeof v === \"string\" && (STYLE_COLORS as readonly string[]).includes(v);\n}\n\n/** Every choice look the Field keeps, in its own order. A color outside the palette is dropped. */\nexport function choiceLooksOf(field: Field): ChoiceLook[] {\n const display = displayFormatOf(field);\n const choices = display?.options[\"choices\"];\n if (!Array.isArray(choices)) return [];\n const out: ChoiceLook[] = [];\n for (const c of choices) {\n if (!c || typeof c !== \"object\") continue;\n const value = (c as { value?: unknown }).value;\n if (typeof value !== \"string\" || value.trim() === \"\") continue;\n const color = (c as { color?: unknown }).color;\n const label = (c as { label?: unknown }).label;\n out.push({\n value: value.trim(),\n ...(typeof label === \"string\" && label.trim() !== \"\" ? { label: label.trim() } : {}),\n ...(isStyleColor(color) ? { color } : {}),\n });\n }\n return out;\n}\n\n/**\n * ONE WORD, HOWEVER IT WAS WRITTEN. A moved list keeps its words as `completed` / `truck_4` and\n * shows them as `Completed` / `Truck 4`; a color kept against either spelling is the same choice.\n */\nexport function choiceWord(value: unknown): string {\n return String(value ?? \"\")\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"_\")\n .replace(/^_+|_+$/g, \"\");\n}\n\n/**\n * NOTION'S STATUS COLORS, BY GROUP: To-do gray, In progress blue, Complete green. A status choice\n * the column paints nothing for wears its group's color, so a fresh Status column reads the way\n * Notion's does with nobody picking a color. A choice with a color of its own keeps it\n * (`storedChoiceColor` asks the column first).\n */\nexport const STATUS_GROUP_COLOR = { todo: \"gray\", in_progress: \"blue\", done: \"green\" } as const satisfies Record<string, StyleColor>;\n\n/** The color a status choice's GROUP gives it, or `undefined` when the column is not a Status. */\nexport function statusGroupColor(field: Field, value: unknown): StyleColor | undefined {\n if (newerKindOf(field) !== \"status\" || value === null || value === undefined || value === \"\") return undefined;\n const word = choiceWord(value);\n if (word === \"\") return undefined;\n const groups = ((field.config ?? {}) as Record<string, unknown>)[\"status_groups\"];\n if (groups && typeof groups === \"object\") {\n // the group is kept under the choice's KEY; the cell may hold its WORDS (\"In progress\" ↔ in_progress)\n for (const [key, group] of Object.entries(groups as Record<string, unknown>)) {\n if (choiceWord(key) !== word) continue;\n return group === \"in_progress\" ? STATUS_GROUP_COLOR.in_progress : group === \"done\" ? STATUS_GROUP_COLOR.done : STATUS_GROUP_COLOR.todo;\n }\n }\n return STATUS_GROUP_COLOR.todo;\n}\n\n/** The color this Field keeps for this value, or `undefined` when it keeps none. */\nexport function storedChoiceColor(field: Field, value: unknown): StyleColor | undefined {\n if (value === null || value === undefined || value === \"\") return undefined;\n const word = choiceWord(value);\n if (word === \"\") return undefined;\n for (const look of choiceLooksOf(field)) {\n if (!look.color) continue;\n if (choiceWord(look.value) === word || (look.label && choiceWord(look.label) === word)) return look.color;\n }\n return statusGroupColor(field, value);\n}\n\n/**\n * THE COLOR-BY LOOKUP, STORED COLORS FIRST. A value whose column keeps a color for it wears\n * that color; any other value still paints, deterministically, through `fallback` — a color-by\n * that silently did nothing would be the screen lying about a setting a person just changed.\n */\nexport function storedChoiceColorLookup(\n fields: readonly Field[],\n fallback: ChoiceColorLookup,\n): ChoiceColorLookup {\n const byKey = new Map(fields.map((f) => [f.key, f] as const));\n return (fieldKey, value) => {\n const field = byKey.get(fieldKey);\n return (field ? storedChoiceColor(field, value) : undefined) ?? fallback(fieldKey, value);\n };\n}\n\n/**\n * THE ORDER A NEW CHOICE IS PAINTED IN (Airtable): each choice added to a list takes the next\n * palette color the list does not wear yet, so a fresh list reads as distinct chips with nobody\n * picking a color. Gray last — it reads as \"no color\".\n */\nexport const NEW_CHOICE_PALETTE: readonly StyleColor[] = [\"blue\", \"green\", \"amber\", \"red\", \"violet\", \"teal\", \"slate\"];\n\n/** The color the next choice of a list takes, given the colors its choices already wear. */\nexport function nextChoiceColor(worn: ReadonlyArray<StyleColor | null | undefined>): StyleColor {\n const taken = new Set(worn.filter((c): c is StyleColor => Boolean(c)));\n const free = NEW_CHOICE_PALETTE.find((c) => !taken.has(c));\n return free ?? NEW_CHOICE_PALETTE[worn.length % NEW_CHOICE_PALETTE.length]!;\n}\n\n/**\n * THE ONE CHIP A CHOICE IS DRAWN AS — the grid cell, the picker's list and its chip, a form's\n * pills: the color the column keeps for the value (by any of the words given — its key, its\n * label), else the neutral chip. One answer, so no surface paints a choice its own way.\n */\nexport function choiceChipLookOf(field: Field, ...words: unknown[]): { className: string; color: StyleColor | null } {\n for (const word of words) {\n const color = storedChoiceColor(field, word);\n if (color) return { className: CHOICE_CHIP_CLASS[color], color };\n }\n return { className: NEUTRAL_CHIP_CLASS, color: null };\n}\n","// src/parity.ts — @ai-matrx/records-ui\n//\n// FLD-11, the parity floor. A Field stores a BEHAVIOR (one of five) plus\n// modifiers, unit and format; a person picked one of THIRTEEN parity types in\n// the UI. This resolves the second from the first, using the same facts the\n// store's own `custom.parity_field_types()` describes — which is generated into\n// `@ai-matrx/records` and imported here, never retyped.\n//\n// Nothing in this file decides policy. It decides which editor to draw.\n\nimport { displayFormatOf } from \"./choiceLooks\";\nimport {\n KERNEL_TABLES,\n PARITY_FIELD_TYPES,\n fieldKindFor,\n newerKindOf,\n isButtonField,\n type FieldKind,\n type KernelTargets,\n type ParityFieldType,\n} from \"@ai-matrx/records/field-kinds\";\nimport type { Field } from \"@ai-matrx/records\";\nimport { humanizeIdentifier } from \"@ai-matrx/kit/text-case\";\nimport { isSignatureField } from \"./docs\";\nimport { fieldTypeChoice, isSystemFieldKind, type PickableFieldType } from \"./fieldTypes\";\n\n/** The kernel ids come from the store's own kernel rows, never from a literal here. */\nconst kernelId = (name: string): string =>\n KERNEL_TABLES.find((t) => t.name === name)?.id ?? \"\";\nconst KERNEL_FILE_TABLE = kernelId(\"File\");\nconst KERNEL_PERSON_TABLE = kernelId(\"Person\");\n\nexport const PARITY_LABEL: Record<ParityFieldType, string> = {\n attachment: \"Attachment\",\n checkbox: \"Yes / no\",\n currency: \"Currency\",\n datetime: \"Date\",\n email: \"Email\",\n formula: \"Formula\",\n lookup: \"Lookup\",\n member: \"Person\",\n multi_select: \"Multi-select\",\n percent: \"Percent\",\n phone: \"Phone\",\n rollup: \"Rollup\",\n select: \"Select\",\n url: \"Link\",\n};\n\n/** The \"made of\" sentence the store itself publishes, for the field editor's help text. */\nexport const PARITY_MADE_OF: Record<string, string> = Object.fromEntries(\n PARITY_FIELD_TYPES.map((p) => [p.parity_type, p.made_of]),\n);\n\n/**\n * Plain text and plain number are behaviors with no parity type of their own.\n *\n * 🚨 THIS IS NOW AN ALIAS, AND THAT IS THE POINT (TAILS-3, 2026-09-21). The\n * classifier moved into `@ai-matrx/records` as `FieldKind` so that the editor a\n * person types into and the COERCION applied to what they typed are decided by\n * one body. They were decided by two, and the public booking page paid for it:\n * \"Vehicle Year takes a number, and it was given a string\" on every table with\n * a number field.\n */\nexport type EditorKind = FieldKind;\n\n/** The kernel ids come from the store's own kernel rows, never from a literal here. */\nconst KERNEL: KernelTargets = { file: KERNEL_FILE_TABLE, person: KERNEL_PERSON_TABLE };\n\n/**\n * Which editor one Field wants. Reads the Field's own declaration only — the\n * behavior, the modifiers, the format, the relation target and the config —\n * because those are what the store stores, and a screen that guessed from a\n * value would draw a different editor for an empty record.\n *\n * It is `fieldKindFor` with this package's kernel ids bound. Nothing here\n * decides anything the core does not.\n */\nexport function editorKindFor(field: Field): EditorKind {\n return fieldKindFor(field, KERNEL);\n}\n\n/**\n * WHICH KIND A PERSON PICKED, read back off the Field the store keeps — the ONE reader every\n * \"what does this column hold\" answer goes through (the Settings column list, the column panel).\n *\n * `editorKindFor` answers which EDITOR to draw, and for two families that is not the kind a\n * person picked: a Signature is a text Field whose format is `signature` (it draws a line of\n * text), and the store's stamps — Record number, Created time, Last changed time — are formula\n * Fields whose `config.system` names the stamp. Read through the editor classifier alone, the\n * Settings list called a Signature \"Text\" and a Record number \"Worked out from other columns\"\n * (lane 10 W1-A, guard `every-pickable-kind-reads-back-as-itself.test.tsx`).\n *\n * `undefined` when the Field is none of the kinds the menu offers.\n */\nexport function pickableTypeOf(field: Field): PickableFieldType | undefined {\n if (isSignatureField(field)) return \"signature\";\n // NOTION-PROPS-3: a button is text wearing the format `button`.\n if (isButtonField(field)) return \"button\";\n // LANE 10 P4: the nine newer kinds, each a base type wearing a format (`newerKindOf`).\n const newer = newerKindOf(field);\n if (newer) return newer;\n // A RATING OR A TIME made as a plain column wearing its look (`LOOK_KINDS`): named by that kind.\n const look = displayFormatOf(field)?.id;\n if (look === \"rating\" && field.type === \"range\") return \"rating\";\n if (look === \"time\" && field.type === \"text\") return \"time\";\n if ((look === \"color_pair\" || look === \"type_style\" || look === \"shadow\") && field.type === \"text\") return look;\n if (look === \"measure\" && field.type === \"range\") return \"measure\";\n const system = (field.config as Record<string, unknown> | undefined)?.[\"system\"];\n if (field.type === \"formula\" && typeof system === \"string\" && isSystemFieldKind(system)) return system;\n const kind = editorKindFor(field);\n return fieldTypeChoice(kind) ? (kind as PickableFieldType) : undefined;\n}\n\n/**\n * The type word a person sees in a header or a settings row — and it is the\n * SAME word the field panel offers, read from `FIELD_TYPE_CHOICES`, so a column\n * added as \"Money\" is never described anywhere else as \"Currency\".\n */\nexport function fieldTypeLabel(field: Field): string {\n const kind = pickableTypeOf(field) ?? editorKindFor(field);\n const known = fieldTypeChoice(kind)?.label;\n if (known) return field.multi && kind !== \"multi_select\" ? `${known} (many)` : known;\n const plain: Record<string, string> = {\n // `boolean` is the BEHAVIOR word; `checkbox` is the type a person picks. Both are\n // written the way a person writes them, never as a raw token.\n boolean: \"Yes / no\",\n date: \"Date\",\n json: \"Structured data\",\n relation: \"Link to a record\",\n };\n // Never a raw token on a screen: an editor kind this table has not named is\n // still written the way a person writes it.\n return plain[kind] ?? humanizeIdentifier(kind);\n}\n","/**\n * 🚨 THE ONE DATE HELPER EVERY LAYOUT READS (lane UI-FIX-18, VERIFIER-18 H2 / M1).\n *\n * MEASURED 2026-09-24 on production, browser in America/Los_Angeles: Kitchen's start date,\n * stored `2026-04-01`, read **Apr 1** in the grid, **Mar 31** on the calendar, **3/31** in\n * the gallery, and Backyard Deck's May 1 read **4/30** in the record panel. The grid was right\n * because it formats through the design system's registry (`formatFieldValue`), which reads a\n * bare `YYYY-MM-DD` as a day on a calendar. Every other surface called `new Date(\"2026-04-01\")`\n * itself — which JavaScript parses as UTC MIDNIGHT — and then printed it in the viewer's zone,\n * so everybody west of Greenwich saw the day before.\n *\n * THE CLASS, NOT THE INSTANCE. No component in this package parses or prints a date on its\n * own any more; it asks this file, and this file asks the SAME registry the grid asks. The\n * calendar's day key is the one thing the registry does not answer, and it is answered here\n * by the same rule: a bare calendar date IS its own day (read the characters), an instant\n * (`…Z`, `…+hh:mm`) is placed on the viewer's own calendar.\n *\n * The store's own stamps — Created time and Last changed time (`fx.created_time`,\n * `fx.modified_time`) — are instants, and are printed like every other date-and-time cell\n * (VERIFIER-18 M1 found `2026-09-25T00:13:34.564Z` in the grid, the gallery and the panel).\n */\nimport { formatFieldValue, type FieldFormatConfig } from \"@ai-matrx/design-system/field-formats\";\nimport type { Field } from \"@ai-matrx/records\";\nimport { momentZoneOptions } from \"@ai-matrx/design-system/field-formats\";\nimport { personWallNow } from \"./personZone\";\n\n/** A day on a calendar with no time and no zone — `2026-04-01`, or a zoneless local midnight. */\nconst BARE_CALENDAR_DATE = /^(\\d{4})-(\\d{2})-(\\d{2})(?:[T ]00:00(?::00(?:\\.0+)?)?)?$/;\n\ntype SystemStamp = \"autonumber\" | \"created_time\" | \"modified_time\";\n\n/** The store's own stamp this Field is, when it is one (`config.system`). */\nexport function systemStampOf(field: Pick<Field, \"type\" | \"config\">): SystemStamp | null {\n if (field.type !== \"formula\") return null;\n const system = String((field.config ?? {})[\"system\"] ?? \"\");\n return system === \"autonumber\" || system === \"created_time\" || system === \"modified_time\" ? system : null;\n}\n\n/**\n * Does this value (or, with no value, this Field) carry a TIME OF DAY as well as a date?\n *\n * A DATE IS A DATE (chair ruling, 2026-09-24). The control and the text follow the STORED\n * VALUE's shape, never `config.kind` alone: a value with no time part — `1988-06-14`, a date\n * of birth on a `kind: \"datetime\"` Field — gets a date-only control and a date-only reading\n * everywhere (grid, form, panel, calendar). With no value yet, only a Field that says so\n * outright carries a time: the older `format: \"datetime\"`, or the store's own Created / Last\n * changed stamps (instants by construction).\n */\nexport function carriesTimeOfDay(field: Pick<Field, \"type\" | \"config\" | \"format\">, value?: unknown): boolean {\n if (value !== undefined && value !== null && value !== \"\") return hasTimePart(value);\n const stamp = systemStampOf(field);\n if (stamp === \"created_time\" || stamp === \"modified_time\") return true;\n return (field.format ?? \"\").toLowerCase() === \"datetime\";\n}\n\n/**\n * THE TIME OF DAY A MOMENT CARRIES, in the reader's clock (\"3:30 PM\") — the same words the grid's\n * date-and-time cell ends in — or null for a bare day. A calendar's month card and a timeline's bar\n * show it before the title (lane 10 P4, verifier V8 #7), as Google Calendar does.\n */\nexport function timeOfDayWords(value: unknown): string | null {\n if (!hasTimePart(value)) return null;\n const at = value instanceof Date ? value : new Date(value as string | number);\n return Number.isNaN(at.getTime()) ? null : at.toLocaleTimeString(undefined, { hour: \"numeric\", minute: \"2-digit\", ...momentZoneOptions(at) });\n}\n\n/** A value that names a moment in the day, not just the day. */\nexport function hasTimePart(value: unknown): boolean {\n if (value instanceof Date || typeof value === \"number\") return true;\n if (typeof value !== \"string\") return false;\n const trimmed = value.trim();\n if (BARE_CALENDAR_DATE.test(trimmed)) return false;\n return /^\\d{4}-\\d{2}-\\d{2}[T ]\\d/.test(trimmed);\n}\n\n/** Is this Field a date column at all — a dated range, or the store's own time stamp? */\nexport function isDateField(field: Pick<Field, \"type\" | \"config\">): boolean {\n const stamp = systemStampOf(field);\n if (stamp === \"created_time\" || stamp === \"modified_time\") return true;\n if (field.type !== \"range\") return false;\n const kind = String((field.config ?? {})[\"kind\"] ?? \"\");\n return kind === \"date\" || kind === \"datetime\";\n}\n\n/**\n * The format a date-ish Field draws with, or `undefined` for a Field that is not one. With a\n * value, it is that value's own shape; without, the Field's (`carriesTimeOfDay`).\n * `presentation.formatForField` answers dates through this, so the grid and every card agree.\n */\nexport function dateFormatFor(\n field: Pick<Field, \"type\" | \"config\" | \"format\">,\n value?: unknown,\n): FieldFormatConfig | undefined {\n if (!isDateField(field)) return undefined;\n return carriesTimeOfDay(field, value) ? { id: \"datetime\" } : { id: \"date\" };\n}\n\n/**\n * THE TEXT OF ONE DATE VALUE, in the viewer's language — through the design system's\n * registry, exactly as the grid prints it, in the value's own shape. `null` when the value is\n * not a date at all, so the caller can fall back to its own reading (THE FALLBACK LAW).\n */\nexport function dateText(field: Pick<Field, \"type\" | \"config\" | \"format\">, value: unknown): string | null {\n const format = dateFormatFor(field, value) ?? (isDateLike(value) ? { id: hasTimePart(value) ? \"datetime\" : \"date\" } : undefined);\n if (!format) return null;\n const result = formatFieldValue(value, format);\n return result.ok && !result.empty ? result.text : null;\n}\n\nfunction isDateLike(value: unknown): boolean {\n return typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}/.test(value.trim());\n}\n\nfunction pad(n: number): string {\n return n < 10 ? `0${n}` : String(n);\n}\n\n/**\n * THE CALENDAR DAY a value falls on, as `YYYY-MM-DD` — the key a calendar files a card under.\n *\n * A bare calendar date is its own day. An instant is placed on the VIEWER's calendar: a visit\n * logged at 5:13 PM Pacific on 24 September is on the 24th for the person in Pacific time,\n * even though it is already the 25th in UTC.\n */\nexport function calendarDayOf(value: unknown): string | null {\n if (typeof value === \"string\") {\n const trimmed = value.trim();\n const bare = BARE_CALENDAR_DATE.exec(trimmed);\n if (bare) return `${bare[1]}-${bare[2]}-${bare[3]}`;\n if (trimmed === \"\") return null;\n } else if (typeof value !== \"number\" && !(value instanceof Date)) {\n return null;\n }\n const instant = value instanceof Date ? value : new Date(value as string | number);\n if (Number.isNaN(instant.getTime())) return null;\n // The day is the one on the PERSON's wall clock (their saved zone), not the device's.\n const at = personWallNow(instant);\n return `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())}`;\n}\n\n/** The heading of one calendar day — `Apr 1, 2026` — built on local midnight, never UTC. */\nexport function calendarDayLabel(day: string): string {\n const m = /^(\\d{4})-(\\d{2})-(\\d{2})$/.exec(day);\n if (!m) return day;\n const at = new Date(Number(m[1]), Number(m[2]) - 1, Number(m[3]));\n return at.toLocaleDateString(undefined, { month: \"short\", day: \"numeric\", year: \"numeric\" });\n}\n\n// ---------------------------------------------------------------------------------------------\n// DAY ARITHMETIC ON THE VIEWER'S OWN CALENDAR (lane VIEWS-AND-FIELDS, sublane TL, 2026-10-02).\n// A day key is `YYYY-MM-DD`, built and read at LOCAL midnight — never `new Date(\"YYYY-MM-DD\")`,\n// which is UTC midnight and lands on the day before for everybody west of Greenwich. The timeline\n// places and moves bars with these; a move is always a whole number of days.\n\n/** The day key of a moment, on the viewer's calendar. */\nexport function dayKeyOf(at: Date): string {\n return `${at.getFullYear()}-${pad(at.getMonth() + 1)}-${pad(at.getDate())}`;\n}\n\n/** A day key as local midnight. */\nexport function dayAt(day: string): Date {\n const [y, m, d] = day.split(\"-\").map(Number);\n return new Date(y!, (m ?? 1) - 1, d ?? 1);\n}\n\n/** The day `n` days after (or before, when negative) `day`. */\nexport function addDays(day: string, n: number): string {\n const at = dayAt(day);\n at.setDate(at.getDate() + n);\n return dayKeyOf(at);\n}\n\n/** Whole days from `from` to `to` (negative when `to` is earlier). DST-safe: rounds the hour away. */\nexport function daysBetween(from: string, to: string): number {\n return Math.round((dayAt(to).getTime() - dayAt(from).getTime()) / 86_400_000);\n}\n"],"mappings":";;;;;;;AAOA,SAAS,sBAAsB,0BAA0B;AACzD,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAK3B,IAAM,QAAQ,WAAW,wCAAwC,OAAO;AAAA,EACtE,MAAM;AAAA,EACN,WAAW,oBAAI,IAAgB;AACjC,EAAE;AAEF,SAAS,MAAM,GAAyB;AACtC,MAAI,OAAO,MAAM,YAAY,CAAC,EAAE,KAAK,EAAG,QAAO;AAC/C,MAAI;AACF,QAAI,KAAK,eAAe,SAAS,EAAE,UAAU,EAAE,CAAC;AAChD,WAAO;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,kBAAkB,MAAuC;AACvE,QAAM,QAAQ,MAAM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