@ai-matrx/records-ui 0.101.30 → 0.101.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -584,6 +584,8 @@ interface ReferenceChipRef {
584
584
  * archived (chair ruling B3-21), so the chip still names it and draws the archived state.
585
585
  */
586
586
  archived?: boolean | undefined;
587
+ /** The record's (or its table's) icon — an emoji or short glyph — when the host knows one. */
588
+ icon?: string | null | undefined;
587
589
  }
588
590
  interface RecordsUiHost {
589
591
  /**
@@ -2142,7 +2144,8 @@ declare const NO_COLUMNS_WHY: string;
2142
2144
  * ordered by the table's own sort exactly as before, and offers no Reorder.
2143
2145
  */
2144
2146
  interface GridViewOrder {
2145
- viewId: Uuid;
2147
+ /** The saved view's id; `null` for a view a host holds inline (it still carries its own `sorts`). */
2148
+ viewId: Uuid | null;
2146
2149
  /** The view's own order word (`definition.order`). */
2147
2150
  order: ViewOrder;
2148
2151
  /** The view's own sort (`definition.sorts`) — where a sorted view OPENS, over the table's. */
@@ -3372,6 +3375,7 @@ declare function useChoiceNudge(enabled?: boolean): ChoiceNudge | null;
3372
3375
  interface EmbeddedLook {
3373
3376
  blankEmpty: boolean;
3374
3377
  choiceDot: boolean;
3378
+ plainRelation: boolean;
3375
3379
  }
3376
3380
 
3377
3381
  /** The envelope for one key, when the document carries one. */
package/dist/index.d.ts CHANGED
@@ -584,6 +584,8 @@ interface ReferenceChipRef {
584
584
  * archived (chair ruling B3-21), so the chip still names it and draws the archived state.
585
585
  */
586
586
  archived?: boolean | undefined;
587
+ /** The record's (or its table's) icon — an emoji or short glyph — when the host knows one. */
588
+ icon?: string | null | undefined;
587
589
  }
588
590
  interface RecordsUiHost {
589
591
  /**
@@ -2142,7 +2144,8 @@ declare const NO_COLUMNS_WHY: string;
2142
2144
  * ordered by the table's own sort exactly as before, and offers no Reorder.
2143
2145
  */
2144
2146
  interface GridViewOrder {
2145
- viewId: Uuid;
2147
+ /** The saved view's id; `null` for a view a host holds inline (it still carries its own `sorts`). */
2148
+ viewId: Uuid | null;
2146
2149
  /** The view's own order word (`definition.order`). */
2147
2150
  order: ViewOrder;
2148
2151
  /** The view's own sort (`definition.sorts`) — where a sorted view OPENS, over the table's. */
@@ -3372,6 +3375,7 @@ declare function useChoiceNudge(enabled?: boolean): ChoiceNudge | null;
3372
3375
  interface EmbeddedLook {
3373
3376
  blankEmpty: boolean;
3374
3377
  choiceDot: boolean;
3378
+ plainRelation: boolean;
3375
3379
  }
3376
3380
 
3377
3381
  /** The envelope for one key, when the document carries one. */
package/dist/index.js CHANGED
@@ -5157,7 +5157,7 @@ import { Badge as Badge5, cn as cn17 } from "@ai-matrx/design-system";
5157
5157
 
5158
5158
  // src/embeddedLook.tsx
5159
5159
  import { createContext as createContext4, useContext as useContext4 } from "react";
5160
- var EMBEDDED_LOOK = { blankEmpty: true, choiceDot: true };
5160
+ var EMBEDDED_LOOK = { blankEmpty: true, choiceDot: true, plainRelation: true };
5161
5161
  var EmbeddedLookContext = createContext4(null);
5162
5162
  var EmbeddedLookProvider = EmbeddedLookContext.Provider;
5163
5163
  function useEmbeddedLook() {
@@ -5173,6 +5173,7 @@ var EMBEDDED_TABLE_CLASS = [
5173
5173
  "[&_thead_th]:border-border",
5174
5174
  "[&_thead_th:last-child]:border-r-0"
5175
5175
  ].join(" ");
5176
+ var EMBEDDED_PLAIN_FOOTER_CLASS = "[&_tfoot]:bg-transparent [&_tfoot]:border-t-0";
5176
5177
 
5177
5178
  // src/enumLabels.ts
5178
5179
  function exhaustiveValuesOf() {
@@ -5481,10 +5482,39 @@ function referencesOf(field2, value, kind, labels) {
5481
5482
  }
5482
5483
  var ARCHIVED_REFERENCE_WORD = "Archived";
5483
5484
  var ARCHIVED_REFERENCE_TIP = "In the Archived view; restore it to use it again";
5485
+ function PageGlyph() {
5486
+ return /* @__PURE__ */ jsxs18("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", width: 14, height: 14, fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "data-records-page-glyph": "", children: [
5487
+ /* @__PURE__ */ jsx22("path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z" }),
5488
+ /* @__PURE__ */ jsx22("path", { d: "M14 2v4a2 2 0 0 0 2 2h4" }),
5489
+ /* @__PURE__ */ jsx22("path", { d: "M10 13H8" }),
5490
+ /* @__PURE__ */ jsx22("path", { d: "M16 17H8" })
5491
+ ] });
5492
+ }
5484
5493
  function ReferenceChip({ reference, waiting }) {
5485
5494
  const host = useRecordsUi();
5486
5495
  const words2 = reference.label ?? (reference.token === "record" ? waiting ?? "Loading\u2026" : WITHHELD_ENTITY_LABEL);
5487
5496
  const drawn = host.renderReference ? host.renderReference({ ...reference, label: reference.label ?? words2 }) : null;
5497
+ const look = useEmbeddedLook();
5498
+ if (look?.plainRelation) {
5499
+ return /* @__PURE__ */ jsxs18(
5500
+ "span",
5501
+ {
5502
+ className: cn15(
5503
+ "inline-flex max-w-full min-w-0 items-center gap-1.5 text-sm text-foreground hover:underline [&_a]:text-inherit [&_a]:no-underline [&_a:hover]:underline",
5504
+ reference.archived && "opacity-70"
5505
+ ),
5506
+ "data-records-reference-chip": reference.token,
5507
+ "data-records-reference-plain": "",
5508
+ "data-records-reference-archived": reference.archived ? "" : void 0,
5509
+ title: reference.archived ? ARCHIVED_REFERENCE_TIP : words2,
5510
+ children: [
5511
+ /* @__PURE__ */ jsx22("span", { "aria-hidden": "true", "data-records-reference-icon": "", className: "inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground", children: reference.icon ? /* @__PURE__ */ jsx22("span", { className: "text-sm leading-none", children: reference.icon }) : /* @__PURE__ */ jsx22(PageGlyph, {}) }),
5512
+ drawn ?? /* @__PURE__ */ jsx22("span", { className: "truncate", children: words2 }),
5513
+ reference.archived ? /* @__PURE__ */ jsx22("span", { className: "shrink-0 text-muted-foreground", children: ARCHIVED_REFERENCE_WORD }) : null
5514
+ ]
5515
+ }
5516
+ );
5517
+ }
5488
5518
  return /* @__PURE__ */ jsxs18(
5489
5519
  Badge4,
5490
5520
  {
@@ -6215,7 +6245,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look) {
6215
6245
  "data-records-choice-chip": "",
6216
6246
  ...chip.tinted ? { "data-records-choice-tint": "" } : {},
6217
6247
  children: [
6218
- look?.choiceDot ? /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", "data-records-choice-dot": "", className: cn17("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
6248
+ look?.choiceDot ? /* @__PURE__ */ jsx26("span", { "aria-hidden": "true", "data-matrx-pill-ink": "", "data-records-choice-dot": "", className: cn17("mr-1.5 inline-block size-1.5 shrink-0 rounded-full", chip.dot) }) : null,
6219
6249
  statusMark(field2, item, Array.isArray(value) ? void 0 : document2),
6220
6250
  scalarText(field2, item, labels, Array.isArray(value) ? void 0 : stillWaitingFor)
6221
6251
  ]
@@ -6370,7 +6400,7 @@ function RecordValue({
6370
6400
  const shape = shown4 && (shown4.id === "date" || shown4.id === "datetime") && isDateField(field2) ? dateFormatFor(field2, value) : void 0;
6371
6401
  const dated = shape ? { ...shape, ...shown4?.options ? { options: shown4.options } : {} } : void 0;
6372
6402
  const formatted = shown4 ? formatColumnValue({ format: dated ?? shown4 }, value) : null;
6373
- if (formatted) return /* @__PURE__ */ jsx26(FormattedValue, { value, format: dated ?? shown4 });
6403
+ if (formatted && !(embeddedLook?.blankEmpty && formatted.empty)) return /* @__PURE__ */ jsx26(FormattedValue, { value, format: dated ?? shown4 });
6374
6404
  return /* @__PURE__ */ jsx26(Fragment6, { children: renderValue(field2, value, document2, labels, stillWaitingFor, embeddedLook) });
6375
6405
  }
6376
6406
  var ONE_FIELD_ARRAYS = /* @__PURE__ */ new WeakMap();
@@ -22288,7 +22318,7 @@ function GridBody({
22288
22318
  [storePaged, query, queryTotal, classicInCard, records.data?.total]
22289
22319
  );
22290
22320
  const showAddLine = mayAddRow && rows.length > 0;
22291
- const showSummaryLine = rows.length > 0 && (!merged || Object.keys(chosenSummaries).length > 0);
22321
+ const showSummaryLine = rows.length > 0 && (embedded ? Object.keys(chosenSummaries).length > 0 : !merged || Object.keys(chosenSummaries).length > 0);
22292
22322
  const footerFace = JSON.stringify([
22293
22323
  showAddLine ? added.busy : null,
22294
22324
  showSummaryLine ? [chosenSummaries, summaries.values, summaries.rowCount, summaries.loading] : null
@@ -22471,7 +22501,7 @@ function GridBody({
22471
22501
  mode: phone ? "sheet" : toolbarFold2 >= 3 ? "menu" : "inline",
22472
22502
  pinned: /* @__PURE__ */ jsxs61(Fragment23, { children: [
22473
22503
  /* @__PURE__ */ jsx68(UndoRedoLive, { source: undoSource }),
22474
- !readOnly && rights.write ? /* @__PURE__ */ jsx68(
22504
+ !embedded && !readOnly && rights.write ? /* @__PURE__ */ jsx68(
22475
22505
  NewFromTemplateMenu,
22476
22506
  {
22477
22507
  tableId,
@@ -22483,7 +22513,8 @@ function GridBody({
22483
22513
  // NEW RECORD NEVER LEAVES THE ROW (live walk 2026-10-05: at 1440 px with the
22484
22514
  // side chat open it and "From template" both vanished behind the "…"). When the
22485
22515
  // row is short, "From template", undo and the rest ride the "…"; this stays.
22486
- ...!readOnly && rights.write ? {
22516
+ // EMBEDDED: the "+ New page" line under the table is the create action.
22517
+ ...!embedded && !readOnly && rights.write ? {
22487
22518
  primary: /* @__PURE__ */ jsx68(
22488
22519
  NewRecordControl,
22489
22520
  {
@@ -22548,7 +22579,7 @@ function GridBody({
22548
22579
  // 2026-09-28: with the Forms rail open "New record" read "New reco", faded
22549
22580
  // under the slot's edge). Pinned, it sticks to the row's right edge and what
22550
22581
  // scrolls passes under it — the merged grid's rule, not a second one.
22551
- ...!readOnly && rights.write ? {
22582
+ ...!embedded && !readOnly && rights.write ? {
22552
22583
  overflow: {
22553
22584
  mode: "inline",
22554
22585
  pinned: /* @__PURE__ */ jsx68(Button42, { size: "sm", className: "shrink-0", disabled: editingBusy, onClick: () => void addRecord(), children: editingBusy ? "Adding\u2026" : "New record" })
@@ -22799,7 +22830,8 @@ function GridBody({
22799
22830
  tableClassName: cn34(
22800
22831
  !look.wrap && "[&_tbody_td]:max-w-[28rem] [&_tbody_td]:overflow-hidden [&_tbody_td]:text-ellipsis [&_tbody_td]:whitespace-nowrap! [&_tbody_td_*]:whitespace-nowrap!",
22801
22832
  look.fit === "scroll" && "sm:[&>table]:w-max! sm:[&>table]:max-w-none! sm:[&>table]:min-w-full!",
22802
- embedded && EMBEDDED_TABLE_CLASS
22833
+ embedded && EMBEDDED_TABLE_CLASS,
22834
+ embedded && !showSummaryLine && EMBEDDED_PLAIN_FOOTER_CLASS
22803
22835
  ),
22804
22836
  footerRows,
22805
22837
  ...embedded ? { copy: false } : copyConfig ? { copy: copyConfig } : {},
@@ -31396,7 +31428,11 @@ function ViewSwitcher({
31396
31428
  onUseSort: (sort) => change({ sorts: [sort], order: "sorted" })
31397
31429
  } : {}
31398
31430
  }
31399
- } : {}
31431
+ } : (view.sorts?.length ?? 0) > 0 || local.sorts ? (
31432
+ /* A VIEW THE HOST HOLDS INLINE (Spaces) has no saved id but still has its sort: the
31433
+ grid opens in it, never in the table's own order. */
31434
+ { viewOrder: { viewId: null, order: null, sorts: local.sorts ?? view.sorts ?? [] } }
31435
+ ) : {}
31400
31436
  }
31401
31437
  ) : /* @__PURE__ */ jsx105(
31402
31438
  Board,