@ai-matrx/records-ui 0.116.0 → 0.116.2

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 (51) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/dist/SaveToTable-3VDK4U5M.js +20 -0
  3. package/dist/chunk-32TUVT57.js +246 -0
  4. package/dist/chunk-32TUVT57.js.map +1 -0
  5. package/dist/chunk-B5S5F5NH.js +445 -0
  6. package/dist/chunk-B5S5F5NH.js.map +1 -0
  7. package/dist/chunk-IUUZVQZD.js +95 -0
  8. package/dist/chunk-IUUZVQZD.js.map +1 -0
  9. package/dist/{chunk-6NSGVKYL.js → chunk-NJYJEAQC.js} +1 -91
  10. package/dist/chunk-NJYJEAQC.js.map +1 -0
  11. package/dist/{chunk-4ZYGWYQP.js → chunk-QRZ4RW2T.js} +56 -31
  12. package/dist/chunk-QRZ4RW2T.js.map +1 -0
  13. package/dist/chunk-SPPATZSR.js +288 -0
  14. package/dist/chunk-SPPATZSR.js.map +1 -0
  15. package/dist/{chunk-7IZJT3DV.js → chunk-TCRNJVGZ.js} +93 -512
  16. package/dist/chunk-TCRNJVGZ.js.map +1 -0
  17. package/dist/{chunk-W5SOKJ5P.js → chunk-TNIC2SGW.js} +5 -3
  18. package/dist/{chunk-W5SOKJ5P.js.map → chunk-TNIC2SGW.js.map} +1 -1
  19. package/dist/{chunk-3OKHOGSO.js → chunk-VCAOXQ5K.js} +2 -283
  20. package/dist/chunk-VCAOXQ5K.js.map +1 -0
  21. package/dist/first-page.cjs.map +1 -1
  22. package/dist/first-page.js.map +1 -1
  23. package/dist/helpers.cjs +812 -8
  24. package/dist/helpers.cjs.map +1 -1
  25. package/dist/helpers.d.cts +441 -3
  26. package/dist/helpers.d.ts +441 -3
  27. package/dist/helpers.js +754 -10
  28. package/dist/helpers.js.map +1 -1
  29. package/dist/index.cjs +1634 -1581
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +156 -168
  32. package/dist/index.d.ts +156 -168
  33. package/dist/index.js +4286 -4477
  34. package/dist/index.js.map +1 -1
  35. package/dist/object-actions.js +3 -2
  36. package/dist/pickers.cjs +52 -13
  37. package/dist/pickers.cjs.map +1 -1
  38. package/dist/pickers.js +6 -3
  39. package/dist/skeleton.cjs +262 -0
  40. package/dist/skeleton.cjs.map +1 -0
  41. package/dist/skeleton.d.cts +50 -0
  42. package/dist/skeleton.d.ts +50 -0
  43. package/dist/skeleton.js +26 -0
  44. package/dist/skeleton.js.map +1 -0
  45. package/package.json +18 -7
  46. package/dist/SaveToTable-AG7ZY4IG.js +0 -18
  47. package/dist/chunk-3OKHOGSO.js.map +0 -1
  48. package/dist/chunk-4ZYGWYQP.js.map +0 -1
  49. package/dist/chunk-6NSGVKYL.js.map +0 -1
  50. package/dist/chunk-7IZJT3DV.js.map +0 -1
  51. /package/dist/{SaveToTable-AG7ZY4IG.js.map → SaveToTable-3VDK4U5M.js.map} +0 -0
package/dist/helpers.d.ts CHANGED
@@ -1,10 +1,16 @@
1
- import { Uuid, RecordsActor, RecordsDataSource, PermissionLevel as PermissionLevel$1, RecordScopeContext, Field, RowAction, RecordDocument, AggregateFilter, Table, RecordRead, RowAgentTarget, ReadRow, HistoryActor, FieldHistoryEntry, HiddenFieldNotice, TableDecorations } from '@ai-matrx/records';
1
+ import * as _ai_matrx_records from '@ai-matrx/records';
2
+ import { Uuid, RecordsActor, RecordsDataSource, PermissionLevel as PermissionLevel$1, RecordScopeContext, Field, RowAction, RecordDocument, Table, ReadRow, RecordRead, RowAgentTarget, AggregateFilter, HistoryActor, FieldHistoryEntry, HiddenFieldNotice, TableDecorations, DashboardSummary, FieldSensitivity, RecordsError } from '@ai-matrx/records';
2
3
  import { PermissionLevel, DeclarableFieldKind, NewerFieldKind, FieldKind, ParityFieldType } from '@ai-matrx/records/field-kinds';
3
4
  export { DEFAULT_FIELDS, DeclareResult, NewFieldSpec, NewTableSpec, addFields, declareTable, fieldDeclarationFor, tokenFor } from '@ai-matrx/records/field-kinds';
4
5
  import { ReactNode, ComponentType, KeyboardEvent } from 'react';
5
6
  import { ReversibleAnnouncement } from '@ai-matrx/kit/reversible';
6
7
  import { Uuid as Uuid$1 } from '@ai-matrx/records/react';
7
- import { TableStyle } from '@ai-matrx/design-system/data-table';
8
+ import { TableStyle, GroupAggregateSpec, GroupOrder } from '@ai-matrx/design-system/data-table';
9
+ import { FieldFormatConfig } from '@ai-matrx/design-system/field-formats';
10
+ import * as _ai_matrx_records_core from '@ai-matrx/records/core';
11
+ import { RecordsClient } from '@ai-matrx/records/core';
12
+ import * as base from '@ai-matrx/records/views';
13
+ export { endingsFromDocument, hiddenFromLink, themeFromDocument, welcomeFromDocument } from '@ai-matrx/records/forms';
8
14
 
9
15
  declare function personActor(userId: Uuid | null | undefined): RecordsActor;
10
16
  declare function recordsDataSource(client: object, fallbackSchema?: string): RecordsDataSource;
@@ -42,6 +48,11 @@ interface WhatYouMayDo {
42
48
  /** Why this person may not do that, in one sentence naming the way in. */
43
49
  why: (what: Capability) => string;
44
50
  }
51
+ /**
52
+ * WHAT ONE LEVEL LETS A PERSON DO. `level` null and `known` true means the
53
+ * store said "nothing" — a real answer. `known` false means it has not said.
54
+ */
55
+ declare function whatYouMayDo(level: PermissionLevel | null, known?: boolean): WhatYouMayDo;
45
56
 
46
57
  /**
47
58
  * What a person may do to one table. The four words and the ladder are the
@@ -108,6 +119,39 @@ interface TableSettingsAgent {
108
119
  stageTableDetails: (input: unknown) => Promise<void>;
109
120
  }
110
121
 
122
+ /**
123
+ * A Lucide icon NAME, kebab-case — the same currency `Table.icon` already uses.
124
+ * Closed on purpose: each renderer maps every member to its own glyph, and a
125
+ * new member fails that renderer's typecheck until it is mapped.
126
+ */
127
+ type ObjectActionIcon = "folder-open" | "external-link" | "link" | "pencil" | "copy" | "folder-input" | "star" | "star-off" | "share-2" | "download" | "upload" | "columns-3" | "settings" | "history" | "blocks" | "file-text" | "calendar-clock" | "list-checks" | "bell" | "door-open" | "inbox" | "layout-dashboard" | "archive-restore" | "archive" | "link-2" | "layout-grid" | "git-merge" | "split" | "arrow-up-from-line" | "lock" | "lock-open" | "eraser";
128
+ /** The groups, in their one order. Separators fall out of group boundaries. */
129
+ type ObjectActionGroup = "open" | "organize" | "share" | "manage" | "built-on" | "danger";
130
+ /**
131
+ * THE STANDARD VERBS every object's menu shares — what the icon strip draws. One
132
+ * per meaning; an object maps its action onto the verb, never a second "share".
133
+ */
134
+ type StandardVerbId = "open" | "open-new-tab" | "copy-link" | "rename" | "duplicate" | "move" | "favorite" | "share" | "export" | "import" | "settings" | "history" | "archive";
135
+ /** One thing a person can do to an object, for any renderer. */
136
+ interface ObjectAction {
137
+ /** Stable within the object's list. React key, test handle, future ⌘K id. */
138
+ id: string;
139
+ label: string;
140
+ icon: ObjectActionIcon;
141
+ group: ObjectActionGroup;
142
+ /** The standard verb this action IS (a strip icon). Absent = a feature row. */
143
+ verb?: StandardVerbId;
144
+ /** A feature row's place among the rows, 1 first. Ignored when `verb` is set. */
145
+ rank?: number;
146
+ /** Display-only hint ("⌘D"). */
147
+ shortcut?: string;
148
+ destructive?: boolean;
149
+ /** Present = shown disabled with this line (≤ 60 chars). Absent = enabled. */
150
+ disabledReason?: string;
151
+ /** Called only when enabled. The host owns the side effect and its feedback. */
152
+ run: () => void | Promise<void>;
153
+ }
154
+
111
155
  /** What a door answers when it mints or changes a link. The token is the only time it is seen. */
112
156
  interface CalendarFeedMade {
113
157
  id: string;
@@ -143,6 +187,10 @@ interface CalendarFeedPort {
143
187
  /** The https address a calendar app reads for this token (the host's route). */
144
188
  urlFor(token: string): string;
145
189
  }
190
+ /** webcal:// is the same address, asking the calendar app to subscribe. */
191
+ declare function webcalUrl(httpsUrl: string): string;
192
+ /** Google Calendar's "add by URL": the webcal address, encoded whole into `cid`. */
193
+ declare function googleCalendarUrl(httpsUrl: string): string;
146
194
 
147
195
  /** One named piece of grounding, shaped the way the platform's context slice takes them. */
148
196
  interface RecordChatEntry {
@@ -276,6 +324,37 @@ interface GridContextSnapshot {
276
324
  total: number | null;
277
325
  search: string;
278
326
  }
327
+ /** Where the cursor is, as the data table tells it (`spreadsheet.onSelectionChange`). */
328
+ interface GridCursor {
329
+ active: {
330
+ rowId: string;
331
+ columnId: string;
332
+ };
333
+ rowIds: string[];
334
+ columnIds: string[];
335
+ cellCount: number;
336
+ tsv: string;
337
+ }
338
+ declare function gridContextSnapshot(args: {
339
+ tableId: Uuid;
340
+ table: Table | null;
341
+ fields: readonly Field[];
342
+ /** The Field keys on screen, in order. */
343
+ shownKeys: readonly string[];
344
+ rows: readonly ReadRow[];
345
+ rowActions: readonly RowAction[];
346
+ canWrite: boolean;
347
+ cursor: GridCursor | null;
348
+ /** The cell whose editor is open, which wins over the cursor. */
349
+ editing: {
350
+ rowId: Uuid;
351
+ key: string;
352
+ draft: unknown;
353
+ } | null;
354
+ selectedIds: readonly string[];
355
+ total: number | null;
356
+ search: string;
357
+ }): GridContextSnapshot;
279
358
 
280
359
  /** What a host's map painter is given. Pins arrive unclustered; the painter clusters them for its zoom. */
281
360
  interface MapCanvasProps {
@@ -1305,6 +1384,180 @@ declare function tablePickerEntries<T extends PickerTable>(tables: readonly T[],
1305
1384
  keep?: string | null | undefined;
1306
1385
  }): TablePickerEntries<T>;
1307
1386
 
1387
+ /**
1388
+ * The Gantt mode of a timeline view, by Field key. `mode` turns the left task list on; `critical` paints the longest
1389
+ * chain; `progress` is a percent/number column; `milestone` a yes/no column; `baselineStart` / `baselineEnd` the two
1390
+ * date columns "Save baseline" writes; `dependency` the link column that dependencies are written to.
1391
+ */
1392
+ interface GanttLook {
1393
+ mode?: boolean;
1394
+ critical?: boolean;
1395
+ progress?: string;
1396
+ milestone?: string;
1397
+ baselineStart?: string;
1398
+ baselineEnd?: string;
1399
+ dependency?: string;
1400
+ }
1401
+ /**
1402
+ * SECTIONS BY A FIELD — the view's own grouping.
1403
+ *
1404
+ * `field` is a Field KEY, exactly like `frozen` and the keys of `formats`,
1405
+ * because a view is written against the Table's declaration and never against
1406
+ * whatever id a screen happened to build its columns with.
1407
+ *
1408
+ * `aggregates` is keyed by Field key too, and `collapsed` holds the data
1409
+ * table's own group keys (`s:Blocked`, `n:3`, `empty`), which is what the
1410
+ * primitive emits and the only thing that survives a value rendering the same
1411
+ * text as another.
1412
+ *
1413
+ * NOTHING HERE IS EVER CALLED `valueOf`, `toString` or `hasOwnProperty`: every
1414
+ * object in JavaScript already has all three, so an optional field by one of
1415
+ * those names is NEVER absent and a `config.valueOf ? … : …` check silently
1416
+ * reads `Object.prototype`. It cost the primitive a whole grouping once.
1417
+ */
1418
+ type GridGrouping = {
1419
+ /** The Field key whose value makes the sections. */
1420
+ field: string;
1421
+ /** Per-Field-key subtotal on every section header. */
1422
+ aggregates?: Record<string, GroupAggregateSpec>;
1423
+ /** Section order. The primitive's default is `value-asc`; blanks sort last. */
1424
+ order?: GroupOrder;
1425
+ /** The sections this view keeps shut, by the primitive's own group key. */
1426
+ collapsed?: string[];
1427
+ /** The grouped column stays drawn as a column (Airtable). Absent = shown; `false` = the person stepped it aside. */
1428
+ showColumn?: boolean;
1429
+ /**
1430
+ * SUB-GROUPS (lane S1-PRIME VIEW-KEYS; ui-bench LISTS "sub-grouping"): up to two more levels
1431
+ * inside each section, by Field key. At most three levels in all — the store refuses a fourth
1432
+ * (`custom.view_declare`). A layout that draws one level ignores the rest; it never drops them,
1433
+ * because this list is parsed and written back whole with the rest of the look.
1434
+ */
1435
+ then?: GridSubGroup[];
1436
+ /**
1437
+ * DRILL (lane DRILL-TABLE-PRIMITIVE): the Dimension pivoted across the top — a Field key, or
1438
+ * `<key>:<grain>` for a date cut into periods.
1439
+ */
1440
+ across?: string;
1441
+ /** DRILL: the period `field` is cut into when it is a date (`month`); the store keeps `field` a Field key. */
1442
+ grain?: string;
1443
+ /** The Measures shown ("what to display"), by the store's own keys (`count`, `sum_quantity`). */
1444
+ show?: string[];
1445
+ /** The drill trail, in order: each crumb a Dimension reference and the value it narrowed to. */
1446
+ trail?: GridDrillStep[];
1447
+ };
1448
+ /** One crumb of a saved drill trail. `value: null` is "no value". */
1449
+ type GridDrillStep = {
1450
+ dim: string;
1451
+ value: string | null;
1452
+ };
1453
+ /** One sub-group level: a Field key and its section order. */
1454
+ type GridSubGroup = {
1455
+ field: string;
1456
+ order?: GroupOrder;
1457
+ grain?: string;
1458
+ };
1459
+ /** Everything a view says about how its table LOOKS. */
1460
+ type GridPresentation = {
1461
+ /** Color-by-a-column, rules and manual highlights. */
1462
+ style?: TableStyle;
1463
+ /** Per-column format overrides, by the Field's key. */
1464
+ formats?: Record<string, FieldFormatConfig>;
1465
+ /**
1466
+ * The columns that stay in place while the table scrolls sideways, by Field
1467
+ * key. Only the LEADING run of the view's column order can actually freeze —
1468
+ * the data table decides that, and declines rather than pinning a column at a
1469
+ * guessed offset.
1470
+ */
1471
+ frozen?: string[];
1472
+ /** Collapsible sections by one Field, with subtotals on each header. */
1473
+ grouping?: GridGrouping;
1474
+ /**
1475
+ * The width a person dragged a column to, by Field key. SPARSE on purpose —
1476
+ * a view saved before widths existed carries none and still parses, and a
1477
+ * column nobody resized is left to the table's own measurement.
1478
+ */
1479
+ widths?: Record<string, number>;
1480
+ /** The body row height this view remembers, in px. */
1481
+ rowHeight?: number;
1482
+ /**
1483
+ * Field keys hidden from this view — the SAME hidden-column list the grid's
1484
+ * own column picker holds, now given a place on the view so it survives a
1485
+ * reload and a layout switch reads the identical set gallery and grid agree
1486
+ * on, rather than a second "fields shown" list nobody kept in sync.
1487
+ */
1488
+ hiddenFields?: string[];
1489
+ /**
1490
+ * THE FIELDS A CARD LEAVES OFF (board, list, gallery, calendar, timeline), by Field key — the
1491
+ * card's own choice, kept apart from `hiddenFields` so a board's "Card fields" never hides the
1492
+ * grid's columns when the view switches layout (v7 TABLE-EXPERIENCE, walk 2026-10-05). An empty
1493
+ * list is a choice (every field shown); absent means the card never chose.
1494
+ */
1495
+ cardHidden?: string[];
1496
+ /**
1497
+ * THE ORDER A PERSON DRAGGED THE COLUMNS INTO, by Field key (merge tranche 6a). Sparse like
1498
+ * `widths`: a key it does not name keeps its Field's own place after the named ones, and a key
1499
+ * whose Field is gone is skipped — a column order can never hide or invent a column.
1500
+ */
1501
+ columnOrder?: string[];
1502
+ /**
1503
+ * The gallery's card size, remembered the same way the grid remembers its
1504
+ * row height — a per-view look, not a global default.
1505
+ */
1506
+ gallerySize?: "small" | "medium" | "large";
1507
+ /**
1508
+ * THE BOARD'S OWN LOOK (lane BOARD-SWIMLANES, Notion's board options). All kept on the view, all
1509
+ * read only by the kanban layout. Absent means the board's default: columns wear their choice's
1510
+ * colour, each heading shows its count, empty columns and lanes are drawn, cards are medium with
1511
+ * no preview.
1512
+ * boardSize card size: sets the column width, the preview's height and, small, drops the card's extras
1513
+ * boardPreview the FILE field drawn as a cover at the top of each card (absent = no preview)
1514
+ * boardHideEmpty leave out a column or a lane that holds no card
1515
+ * boardColorColumns false = neutral headings, no accent bar on the cards
1516
+ * boardCounts false = no count beside the heading
1517
+ * boardLanesShut the swimlanes kept shut to a strip, by the lane's name
1518
+ */
1519
+ boardSize?: "small" | "medium" | "large";
1520
+ boardPreview?: string;
1521
+ boardHideEmpty?: boolean;
1522
+ boardColorColumns?: boolean;
1523
+ boardCounts?: boolean;
1524
+ boardLanesShut?: string[];
1525
+ /**
1526
+ * A LOCKED VIEW (lane NOTION-SMALL-2): its layout, filters, sorts and settings are not saved over until
1527
+ * somebody unlocks it. An editing convenience against an accidental change, never a permission.
1528
+ */
1529
+ locked?: boolean;
1530
+ /**
1531
+ * THIS VIEW'S OWN LAYOUT CHOICES, over the organization's `custom/grid_layout` knob (lane
1532
+ * DEFAULT-GRID-PARITY, TABLE-PARITY D1 D5 D6). Absent means "whatever the organization
1533
+ * says"; present is the view's word. `freezeFirst: false` is an explicit NO over an
1534
+ * organization that freezes the first column — an empty `frozen` cannot say that.
1535
+ */
1536
+ wrap?: boolean;
1537
+ /** AIRTABLE'S "WRAP FIELD HEADERS": column titles take a second line instead of being cut. Absent = one line. */
1538
+ headerWrap?: boolean;
1539
+ /** NOTION'S "WRAP COLUMN" (N5): the columns that wrap their text when the view as a whole does not. */
1540
+ wrapColumns?: string[];
1541
+ fit?: "auto" | "fit" | "scroll";
1542
+ freezeFirst?: boolean;
1543
+ /**
1544
+ * THE SUMMARY BAR (TABLE-PARITY F1): Field key → the store measure shown under that column
1545
+ * (`count`, `sum`, `avg`, `min`, `max`, `median`, `filled`, `empty`, `unique`), worked out
1546
+ * by `custom.record_aggregate` over the whole table.
1547
+ */
1548
+ summaries?: Record<string, string>;
1549
+ /** THE TIMELINE'S GANTT MODE (kept as `presentation.gantt`): see `GanttLook`. */
1550
+ gantt?: GanttLook;
1551
+ /**
1552
+ * WHERE THE FOOTER SITS (lane TABLE-PAGE-CHROME, owner 2026-09-25) — the row count and the
1553
+ * pages: `sticky`, pinned to the bottom of the screen while the rows scroll (the older grid's
1554
+ * way, and the default when a view says nothing), or `inline`, right after the last row with
1555
+ * the page scrolling. Read by the Grid and a host's Sheet.
1556
+ */
1557
+ footer?: FooterPlacement;
1558
+ };
1559
+ /** Where a grid's footer sits. */
1560
+ type FooterPlacement = "sticky" | "inline";
1308
1561
  /**
1309
1562
  * G1's TABLE-LEVEL COLORS (`custom.table_decorations` / `client.tableDecorations`),
1310
1563
  * TRANSLATED INTO A `TableStyle` — the same document a saved view's own `presentation.style`
@@ -1342,4 +1595,189 @@ declare function styleFromDecorations(decorations: TableDecorations | null | und
1342
1595
  */
1343
1596
  declare function resolveTableStyle(decorations: TableDecorations | null | undefined, fields: readonly Field[], viewStyle: TableStyle | undefined): TableStyle;
1344
1597
 
1345
- export { type AgentBuildAsk, type EditorKind, NO_RIGHTS, type OpenRecordsAsk, PARITY_LABEL, PARITY_MADE_OF, type PickerTable, type RecordsUiHost, type ResolveName, SOMEBODY, THE_SYSTEM, type TablePickerEntries, type TablePickerEntry, type TableRights, UNREAD_RECORD_LABEL, WITHHELD_RECORD_LABEL, WITHHELD_WORD, actorBadge, actorWords, cardTitleField, editorKindFor, fieldName, fieldTypeLabel, getPersonTimeZone, isKeptTable, isValueSet, lastChangeSentence, looksLikeId, personActor, personWallNow, pickableTypeOf, recordName, recordNameIn, recordsDataSource, resolveTableStyle, rowName, rowNameIn, setPersonTimeZone, singularNoun, styleFromDecorations, subscribePersonTimeZone, tableName, tablePickerEntries, tableRightsAt, whenWords, withheldNoticeOf, withheldSentence };
1598
+ /** Is this dashboard row a Page? Every row with no kind is a dashboard (the store's default). */
1599
+ declare function isPage(row: Pick<DashboardSummary, "presentation"> | {
1600
+ presentation?: unknown;
1601
+ }): boolean;
1602
+
1603
+ declare function isInterface(row: Pick<DashboardSummary, "presentation"> | {
1604
+ presentation?: unknown;
1605
+ }): boolean;
1606
+
1607
+ type TableLane = "mine" | "organization" | "system" | "community" | "app";
1608
+ /**
1609
+ * WHETHER THE STORE ITSELF KEEPS THIS TABLE FOR THE APP — a choice list made per
1610
+ * choice field, for one. The Table record's document carries `kept_by_the_app:
1611
+ * true`, and `tableList()` spreads the whole document onto the Table; the
1612
+ * `Table` interface does not declare it yet, so it is read through this one
1613
+ * narrow cast.
1614
+ *
1615
+ * 🚨 MEASURED ON RINCON PLUMBING CO (VERIFIER-15): 13 "Crew choices" and 14
1616
+ * "Status choices" tables sat under My organization here, beside Jobs and
1617
+ * Invoices, while the organization hub above them already counted them as the
1618
+ * app's. Two lists on one page disagreed about the same 27 tables. They go to
1619
+ * the app's lane, with the saved views.
1620
+ */
1621
+ declare function platformOwned(table: Table): boolean;
1622
+ /** Which lane one Table belongs to, from the record's own columns. */
1623
+ declare function laneFor(table: Table): TableLane;
1624
+
1625
+ /**
1626
+ * The column a record page writes its body in: the formatted-text column NAMED like a page's body
1627
+ * ("Notes", "Page content"…), else the table's first formatted-text column. A "Caption" before a
1628
+ * "Notes" stays a field (walk 2026-10-05: the body took the Caption).
1629
+ */
1630
+ declare function bodyFieldOf(fields: readonly Field[]): Field | undefined;
1631
+
1632
+ declare const readLooks: (client: Pick<_ai_matrx_records_core.RecordsClient, "viewLookRead">, tableId: _ai_matrx_records.Uuid) => Promise<_ai_matrx_records.RecordsResult<Record<string, Partial<Pick<base.SavedViewSpec<GridPresentation>, "presentation" | "layout" | "measure" | "where" | "mapField" | "sorts" | "groupField" | "swimlaneField" | "collapsedColumns" | "dateField" | "startField" | "endField" | "imageField" | "mapLngField" | "parentField">>>>>;
1633
+
1634
+ declare const viewFromRow: (row: _ai_matrx_records.SavedViewRow) => base.SavedView<GridPresentation>;
1635
+
1636
+ /** The words this feature owns in an address. A host must not use them for anything else. */
1637
+ declare const VIEW_ADDRESS_KEYS: readonly ["sort", "cf", "q", "hide", "page"];
1638
+ type ViewAddressSort = {
1639
+ field: string;
1640
+ direction: "asc" | "desc";
1641
+ };
1642
+ /** What the address says about a look. Absent keys say nothing. */
1643
+ type ViewAddressState = {
1644
+ sort?: ViewAddressSort | null;
1645
+ /** The grid's column filters, in the grid's own shape (field key → its filter value). */
1646
+ filters?: Record<string, unknown>;
1647
+ search?: string;
1648
+ /** Field keys hidden on this look. */
1649
+ hidden?: string[];
1650
+ /** 1-based page; 1 is never written. */
1651
+ page?: number;
1652
+ };
1653
+ declare function isViewAddressEmpty(state: ViewAddressState | null | undefined): boolean;
1654
+ /** The state as flat address words. Empty parts are left out, so a plain view has a plain address. */
1655
+ declare function viewAddressToParams(state: ViewAddressState | null | undefined): Record<string, string>;
1656
+ /** The address words back into a state; null when the address says nothing (or only nonsense). */
1657
+ declare function viewAddressFromParams(get: (key: string) => string | null | undefined): ViewAddressState | null;
1658
+ /** Two states that say the same thing — so a report that changes nothing is never sent. */
1659
+ declare function sameViewAddress(a: ViewAddressState | null | undefined, b: ViewAddressState | null | undefined): boolean;
1660
+
1661
+ declare const FIELD_SENSITIVITY_LABEL: Record<FieldSensitivity, string>;
1662
+
1663
+ /**
1664
+ * WHAT A PERSON CAN ADD FROM A RECORD PAGE: EVERYTHING A TABLE'S COLUMN CAN BE.
1665
+ *
1666
+ * 🚨 G3 — ONE PALETTE (lane 7 STANDARD-TABLES, wave 1). This used to be a hand-kept list of
1667
+ * eleven types (`ADDABLE_TYPE_IDS`) "that need nothing more than a name", so a CRM contact could
1668
+ * not get a Choice, a Yes / no or a link to another record, and none of the column's governance —
1669
+ * while `custom.entity_field_declare` resolves its spec through the very `custom._field_document_for`
1670
+ * a custom table's column goes through. A standard table and a custom table are one primitive, so
1671
+ * the record page opens the table's own `FieldEditor` and offers `fieldTypes.ts`'s pickable set
1672
+ * less the kinds that cannot hold a value on a standard row (`STANDARD_TABLE_FIELD_CHOICES`, read
1673
+ * from the store's kind registry). `a-record-page-adds-a-field-with-the-tables-own-palette.test.tsx`
1674
+ * fails the moment this list and that set differ.
1675
+ */
1676
+ declare const ADDABLE_TYPES: {
1677
+ value: string;
1678
+ label: string;
1679
+ }[];
1680
+
1681
+ /** The one shape every screen in this package renders a refusal from. */
1682
+ interface PlainRefusal {
1683
+ /** The heading. Never the store's code. */
1684
+ title: string;
1685
+ /**
1686
+ * What happened, in the store's own words where they are a person's words
1687
+ * and in ours where they are not. Never empty.
1688
+ */
1689
+ sentence: string;
1690
+ /** What to do now. Never empty. */
1691
+ remedy: string;
1692
+ /**
1693
+ * TRUE when `sentence` is the store's own words (UI-FIX-19): a notice is then HEADED by that
1694
+ * sentence, never by the generic `title` over it.
1695
+ */
1696
+ storeSaid: boolean;
1697
+ /**
1698
+ * Everything a person should not read, kept for whoever has to debug it: the
1699
+ * SQLSTATE, the hint written for a caller, and any clause dropped above.
1700
+ * Kept on the notice's `data-for-engineers` attribute only (UI-FIX-19): never a
1701
+ * tooltip, never text a screen can copy or read aloud; never deleted.
1702
+ */
1703
+ forEngineers: string;
1704
+ }
1705
+ /**
1706
+ * THE FORMATTER. Every refusal a screen in this package shows goes through
1707
+ * here, and nothing in this package renders `error.message` directly.
1708
+ */
1709
+ declare function refusalForAPerson(error: RecordsError): PlainRefusal;
1710
+
1711
+ /** What a "the app's code depends on this table" refusal names, or null for any other refusal. */
1712
+ declare function codeDependsRefusal(error: RecordsError | null | undefined): {
1713
+ slug: string;
1714
+ declaredIn: string | null;
1715
+ } | null;
1716
+
1717
+ interface AnnounceTableArchived {
1718
+ notify: RecordsUiHost["notify"];
1719
+ client: Pick<RecordsClient, "tableRestoreWhole">;
1720
+ tableId: Uuid;
1721
+ /** The table's name as the store gave it. */
1722
+ name: string;
1723
+ /** Called once the table is back, so the surface can show it again. */
1724
+ onRestored?: (() => void) | undefined;
1725
+ }
1726
+ declare function announceTableArchived({ notify, client, tableId, name, onRestored }: AnnounceTableArchived): void;
1727
+
1728
+ /** Every place a records surface shows while its first read is out. */
1729
+ type RecordsSkeletonLayout = "grid" | "kanban" | "gallery" | "list" | "calendar" | "timeline" | "map" | "orgchart" | "form" | "record" | "chart" | "home";
1730
+ declare const RECORDS_SKELETON_LAYOUTS: readonly RecordsSkeletonLayout[];
1731
+ /** A layout word the address or a view carries, as the skeleton that stands for it. */
1732
+ declare function skeletonLayoutFor(layout: string | null | undefined): RecordsSkeletonLayout;
1733
+
1734
+ /** What the list needs to know about the record. */
1735
+ interface RecordActionSubject {
1736
+ id: Uuid;
1737
+ tableId: Uuid;
1738
+ /** The record's name as every card reads it (`recordNameIn` / `cardWords`). */
1739
+ name: string;
1740
+ }
1741
+ type RecordHandler = (record: RecordActionSubject) => void | Promise<void>;
1742
+ /** THE SIDE EFFECTS THIS LIST CANNOT OWN. A handler left out keeps its action, disabled. */
1743
+ interface RecordActionHost {
1744
+ /** Origin for Copy link and Open in new tab. Default `https://www.aimatrx.com`. */
1745
+ origin?: string;
1746
+ /**
1747
+ * The record's own page (the host's `hrefForRecord`), absolute or root-relative. When given, Copy
1748
+ * link and Open in new tab carry it instead of the table page with `?record=`.
1749
+ */
1750
+ href?: string;
1751
+ open?: RecordHandler;
1752
+ openInNewTab?: (url: string, record: RecordActionSubject) => void;
1753
+ /** Runs inside the click (the clipboard needs the gesture). */
1754
+ copyText?: (text: string, record: RecordActionSubject) => void | Promise<void>;
1755
+ duplicate?: RecordHandler;
1756
+ /** Merge another record of the same table into this one (`MergeRecordDialog`). */
1757
+ merge?: RecordHandler;
1758
+ /** Move some of this record's values to a new record of the same table (`SplitRecordDialog`). */
1759
+ split?: RecordHandler;
1760
+ /** Copy some values up into a new record of a parent table and put this one under it (`ExtractParentDialog`). */
1761
+ extractParent?: RecordHandler;
1762
+ /** Open the host's one record picker pointed at this record (`RecordsUiHost.linkRecord`). */
1763
+ link?: RecordHandler;
1764
+ history?: RecordHandler;
1765
+ archive?: RecordHandler;
1766
+ /** Why an action whose handler is left out is unavailable here, by id (≤ 60 chars). */
1767
+ unavailableReasons?: Readonly<Record<string, string>>;
1768
+ /** Another lane's record entries; same rules as `TableActionHost.extend`. */
1769
+ extend?: (record: RecordActionSubject, rights: WhatYouMayDo) => readonly ObjectAction[];
1770
+ }
1771
+ interface RecordActionsInput {
1772
+ record: RecordActionSubject;
1773
+ /** The person's rights on the record (its row level), or on the table when that is all there is. */
1774
+ rights: WhatYouMayDo;
1775
+ host: RecordActionHost;
1776
+ }
1777
+ /**
1778
+ * THE RECORD'S ACTIONS, in the one order. Same ids, same order, same verbs for every seat and every
1779
+ * host — only `disabledReason` varies.
1780
+ */
1781
+ declare function recordActions(input: RecordActionsInput): ObjectAction[];
1782
+
1783
+ export { type AgentBuildAsk, type AnnounceTableArchived, ADDABLE_TYPES as CUSTOM_FIELD_ADDABLE_TYPES, type EditorKind, FIELD_SENSITIVITY_LABEL, NO_RIGHTS, type OpenRecordsAsk, PARITY_LABEL, PARITY_MADE_OF, type PickerTable, RECORDS_SKELETON_LAYOUTS, type RecordActionHost, type RecordActionSubject, type RecordActionsInput, type RecordsSkeletonLayout, type RecordsUiHost, type ResolveName, SOMEBODY, THE_SYSTEM, type TableLane, type TablePickerEntries, type TablePickerEntry, type TableRights, UNREAD_RECORD_LABEL, VIEW_ADDRESS_KEYS, type ViewAddressSort, type ViewAddressState, WITHHELD_RECORD_LABEL, WITHHELD_WORD, actorBadge, actorWords, announceTableArchived, bodyFieldOf, cardTitleField, codeDependsRefusal, editorKindFor, fieldName, fieldTypeLabel, getPersonTimeZone, googleCalendarUrl, gridContextSnapshot, isInterface, isKeptTable, isPage, isValueSet, isViewAddressEmpty, laneFor, lastChangeSentence, looksLikeId, personActor, personWallNow, pickableTypeOf, platformOwned, readLooks, recordActions, recordName, recordNameIn, recordsDataSource, refusalForAPerson, resolveTableStyle, rowName, rowNameIn, sameViewAddress, setPersonTimeZone, singularNoun, skeletonLayoutFor, styleFromDecorations, subscribePersonTimeZone, tableName, tablePickerEntries, tableRightsAt, viewAddressFromParams, viewAddressToParams, viewFromRow, webcalUrl, whatYouMayDo, whenWords, withheldNoticeOf, withheldSentence };