@ai-matrx/records-ui 0.116.15 → 0.116.17

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/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ### Unreleased
4
4
 
5
+
6
+ - **The URL-cell link preview shows the site's real icon** even when the page metadata carries none (falls back to Google / DuckDuckGo favicons). Consumer action: none.
7
+
5
8
  - **A ring of many slices is visible again; a share never wraps.** Past 24 slices a donut's gap is half of each slice's share (`donutGap`, exported) and its slices draw no outline — before, a fixed 1° gap plus recharts' white 1px outline left a 200-group ring blank around its number. The legend's share column no longer wraps "23.5 %" onto two lines in a narrow card. Guard: `src/a-donut-says-the-hosts-total-and-colours.test.tsx`. Consumer action: none.
6
9
  - **`ChartBlock` says a host's total, its option colours, and no legend (CHART-CONVERGENCE, 2026-10-17).** Three new optional props, so Spaces draws its database chart (donut included) with ChartBlock and its own donut is deleted: `centerTotal` (the number a `centerValue` donut draws in its middle — the total over every record, or an average / min / max over every record; `null` draws "–"; absent = the drawn groups added up, as before), `groupColors` (a colour per group keyed by its stored value as text, `""` for no value — a choice column's option colours; bars, columns and donut slices and legend rows; single-group, uncompared blocks only) and `legend` (`false` hides the donut legend and the value list under bars / a line; default `true`). New export `colorOfGroup`. Guard: `src/a-donut-says-the-hosts-total-and-colours.test.tsx` (red without the props). Additive. Consumer action: none.
7
10
  - **Who else is looking at this table (AIRTABLE-PARITY row 183).** New optional host port `presence` on `RecordsUiHost` (`RecordsPresencePort`, bound with `createRecordsPresencePort` from `@ai-matrx/records/realtime`). `TablePage` draws `TablePresence` in its one toolbar row: avatars of the other people (+N past four), and each person's selected cell outlined in their colour; this person's selected cell is told to the others. Exports `TablePresence`, `useTablePresence`, `presenceOutlineCss` and the port types. Unbound: nothing drawn. Guard: `src/a-table-shows-who-else-is-looking.test.tsx`. Additive. Consumer action: bind `presence` to see colleagues.
@@ -14,11 +17,53 @@
14
17
  - Tests: `vitest.setup.ts` gives jsdom a no-op `performance.mark` / `measure`.
15
18
  - **New subpath `@ai-matrx/records-ui/data-source`:** `recordsDataSource`, `personActor` and the who-changed words (`whenWords`, `actorWords`, `actorBadge`, `lastChangeSentence`, `SOMEBODY`, `THE_SYSTEM`) alone. `/helpers` also carries the field-type words, the colour resolver and the table builders, which read `@ai-matrx/records/core`; this entry reaches `@ai-matrx/kit` only, and shares the one data-source cache with `/helpers` and the root. Additive. Consumer action: a shell-reachable service that only binds its supabase client or says when imports from `/data-source`.
16
19
 
17
- ## 0.116.15
20
+ ## 0.116.17
18
21
 
19
22
  UNVERIFIED: this release has no Unreleased entry and the source comparison could not be made (the caller supplied no source comparison). Whether source changed is unknown; consumer action is unknown.
20
23
  Check the package's gitHead on npm against this version's gitHead: `git diff <previous gitHead> <this gitHead> -- apps/shared/records-ui/src`.
21
24
 
25
+ ## 0.116.16
26
+
27
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
28
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
29
+ Diff: `git diff b3732ecfc5 25eb01daa8 -- apps/shared/records-ui/src`
30
+
31
+ Changed shipped source files (16):
32
+ - `apps/shared/records-ui/src/CustomFieldsSection.tsx`
33
+ - `apps/shared/records-ui/src/Grid.tsx`
34
+ - `apps/shared/records-ui/src/LinkPreviewCard.tsx`
35
+ - `apps/shared/records-ui/src/ListView.tsx`
36
+ - `apps/shared/records-ui/src/RecordsSkeleton.tsx`
37
+ - `apps/shared/records-ui/src/SectionCard.tsx`
38
+ - `apps/shared/records-ui/src/ViewSwitcher.tsx`
39
+ - `apps/shared/records-ui/src/buttonCell.tsx`
40
+ - `apps/shared/records-ui/src/clickableSurface.tsx`
41
+ - `apps/shared/records-ui/src/editors.tsx`
42
+ - `apps/shared/records-ui/src/looks/designLooks.tsx`
43
+ - `apps/shared/records-ui/src/looks/index.ts`
44
+ - ...and 4 more
45
+
46
+ ## 0.116.15
47
+
48
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
49
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
50
+ Diff: `git diff 850ff71080 b3732ecfc5 -- apps/shared/records-ui/src`
51
+
52
+ Changed shipped source files (2):
53
+ - `apps/shared/records-ui/src/buttonCell.tsx`
54
+ - `apps/shared/records-ui/src/host.tsx`
55
+
56
+ ## 0.116.14
57
+
58
+ SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
59
+ so they may include breaking API changes. Consumer action is UNKNOWN: read the diff before upgrading.
60
+ Diff: `git diff 803a1d7fd1 850ff71080 -- apps/shared/records-ui/src`
61
+
62
+ Changed shipped source files (3):
63
+ - `apps/shared/records-ui/src/ChartBlock.tsx`
64
+ - `apps/shared/records-ui/src/ChartLayout.tsx`
65
+ - `apps/shared/records-ui/src/entityViews.tsx`
66
+
22
67
  ## 0.116.13
23
68
 
24
69
  SOURCE CHANGED WITH NO RELEASE NOTE. This release shipped source changes that nobody described in an Unreleased entry,
@@ -4,7 +4,7 @@ import {
4
4
  SAVE_TO_TABLE_TYPES,
5
5
  SaveToTable,
6
6
  shapesOfSource
7
- } from "./chunk-YIGEIVU7.js";
7
+ } from "./chunk-U3ZEY6BB.js";
8
8
  import "./chunk-DDTOL35E.js";
9
9
  import "./chunk-TF3JYYJN.js";
10
10
  import "./chunk-TIZHA6VK.js";
@@ -17,4 +17,4 @@ export {
17
17
  SaveToTable,
18
18
  shapesOfSource
19
19
  };
20
- //# sourceMappingURL=SaveToTable-54FVMGKL.js.map
20
+ //# sourceMappingURL=SaveToTable-62C57VOL.js.map
@@ -451,8 +451,15 @@ function numberOf(value) {
451
451
  function Swatch({ color, className }) {
452
452
  return /* @__PURE__ */ jsx2("span", { "aria-hidden": true, className: cn2("inline-block h-4 w-4 shrink-0 rounded border border-border", className), style: { backgroundColor: color } });
453
453
  }
454
- function colorPairContrast(pair, format) {
455
- const ground = format.options?.contrastWith;
454
+ function colorPairGround(format, context) {
455
+ const fixed = format.options?.contrastWith;
456
+ if (fixed?.readsOnField) return context?.ground ?? null;
457
+ if (context?.ground) return context.ground;
458
+ if (!fixed || !fixed.light && !fixed.dark) return null;
459
+ return { ...fixed.light ? { light: fixed.light } : {}, ...fixed.dark ? { dark: fixed.dark } : {}, label: fixed.label ?? "its background" };
460
+ }
461
+ function colorPairContrast(pair, format, context) {
462
+ const ground = colorPairGround(format, context);
456
463
  if (!ground) return {};
457
464
  const out = {};
458
465
  if (ground.light) {
@@ -587,11 +594,11 @@ function ColorPairPreview({ value }) {
587
594
  /* @__PURE__ */ jsx2("span", { className: "flex items-end p-2", style: { backgroundColor: pair.dark ?? pair.light }, children: /* @__PURE__ */ jsx2("span", { className: "rounded bg-background px-1.5 py-0.5 text-xs text-foreground", children: "Dark" }) })
588
595
  ] });
589
596
  }
590
- function colorPairChecks(value, format) {
597
+ function colorPairChecks(value, format, context) {
591
598
  const pair = readColorPair(value);
592
599
  if (!pair) return [];
593
- const contrast = colorPairContrast(pair, format);
594
- const ground = format.options?.contrastWith?.label ?? "its background";
600
+ const contrast = colorPairContrast(pair, format, context);
601
+ const ground = colorPairGround(format, context)?.label ?? "its background";
595
602
  const out = [];
596
603
  for (const part of ["light", "dark"]) {
597
604
  const ratio = contrast[part];
@@ -650,17 +657,50 @@ function NumberBox({
650
657
  function unitOf(format) {
651
658
  return format.options?.unit ?? "px";
652
659
  }
660
+ function MeasureMini({ px, kind }) {
661
+ if (kind === "spacing") {
662
+ const gap = Math.max(1, Math.min(px, 48));
663
+ return /* @__PURE__ */ jsxs2("span", { "aria-hidden": true, "data-records-measure-mini": "spacing", className: "inline-flex h-4 shrink-0 items-center", children: [
664
+ /* @__PURE__ */ jsx2("span", { className: "h-4 w-2.5 rounded-sm border border-border bg-muted" }),
665
+ /* @__PURE__ */ jsx2("span", { style: { width: gap } }),
666
+ /* @__PURE__ */ jsx2("span", { className: "h-4 w-2.5 rounded-sm border border-border bg-muted" })
667
+ ] });
668
+ }
669
+ if (kind === "radius") {
670
+ return /* @__PURE__ */ jsx2(
671
+ "span",
672
+ {
673
+ "aria-hidden": true,
674
+ "data-records-measure-mini": "radius",
675
+ className: "inline-block h-5 w-5 shrink-0 border-2 border-foreground bg-card",
676
+ style: { borderRadius: Math.min(px, 10) }
677
+ }
678
+ );
679
+ }
680
+ return null;
681
+ }
653
682
  function MeasureView({ value, format }) {
654
683
  const n = numberOf(value);
655
684
  if (n === null) return null;
656
- return /* @__PURE__ */ jsxs2("span", { "data-records-look": "measure", className: "tabular-nums", children: [
657
- n,
658
- " ",
659
- /* @__PURE__ */ jsx2("span", { className: "text-muted-foreground", children: unitOf(format) })
685
+ const px = pixels(n, unitOf(format));
686
+ const kind = format.options?.measurePreview ?? "none";
687
+ return /* @__PURE__ */ jsxs2("span", { "data-records-look": "measure", className: "inline-flex items-center gap-2 tabular-nums", children: [
688
+ px !== null && (kind === "spacing" || kind === "radius") ? /* @__PURE__ */ jsx2(MeasureMini, { px, kind }) : null,
689
+ /* @__PURE__ */ jsxs2("span", { children: [
690
+ n,
691
+ " ",
692
+ /* @__PURE__ */ jsx2("span", { className: "text-muted-foreground", children: unitOf(format) })
693
+ ] })
660
694
  ] });
661
695
  }
662
696
  function MeasureEditor({ value, format, onChange, disabled, id, label }) {
663
- return /* @__PURE__ */ jsx2(NumberBox, { id, label, value: numberOf(value), unit: unitOf(format), disabled, className: "w-full max-w-40", onChange });
697
+ const n = numberOf(value);
698
+ const px = n === null ? null : pixels(n, unitOf(format));
699
+ const kind = format.options?.measurePreview ?? "none";
700
+ return /* @__PURE__ */ jsxs2("span", { className: "flex items-center gap-2", children: [
701
+ /* @__PURE__ */ jsx2(NumberBox, { id, label, value: n, unit: unitOf(format), disabled, className: "w-full max-w-40", onChange }),
702
+ px !== null && (kind === "spacing" || kind === "radius") ? /* @__PURE__ */ jsx2(MeasureMini, { px, kind }) : null
703
+ ] });
664
704
  }
665
705
  function pixels(n, unit) {
666
706
  if (unit === "px" || unit === "pt") return n;
@@ -842,10 +882,10 @@ function fieldLookFor(formatId) {
842
882
  function fieldLookIds() {
843
883
  return [...LOOKS.keys()];
844
884
  }
845
- function lookChecks(value, format) {
885
+ function lookChecks(value, format, context) {
846
886
  if (!format) return [];
847
887
  const look = LOOKS.get(format.id);
848
- return look?.checks ? look.checks(value, format) : [];
888
+ return look?.checks ? look.checks(value, format, context) : [];
849
889
  }
850
890
  function registeredLook(format) {
851
891
  return format && LOOKS.has(format.id) ? format : void 0;
@@ -3308,7 +3348,7 @@ function linkChipText(raw) {
3308
3348
 
3309
3349
  // src/LinkPreviewCard.tsx
3310
3350
  import { useEffect as useEffect8, useRef as useRef8, useState as useState13 } from "react";
3311
- import { HoverCard, HoverCardContent, HoverCardTrigger } from "@ai-matrx/design-system";
3351
+ import { HoverCard, HoverCardContent, HoverCardTrigger, SiteIcon } from "@ai-matrx/design-system";
3312
3352
  import { Fragment as Fragment8, jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
3313
3353
  var answers = /* @__PURE__ */ new Map();
3314
3354
  function LinkPreviewCard({ url, children }) {
@@ -3345,10 +3385,7 @@ function LinkPreviewCard({ url, children }) {
3345
3385
  /* @__PURE__ */ jsx18("img", { src: shown2.imageUrl, alt: "", className: "h-28 w-full rounded object-cover", referrerPolicy: "no-referrer" })
3346
3386
  ) : null,
3347
3387
  /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1.5", children: [
3348
- shown2.faviconUrl ? (
3349
- // eslint-disable-next-line @next/next/no-img-element
3350
- /* @__PURE__ */ jsx18("img", { src: shown2.faviconUrl, alt: "", className: "h-3.5 w-3.5 shrink-0", referrerPolicy: "no-referrer" })
3351
- ) : null,
3388
+ /* @__PURE__ */ jsx18(SiteIcon, { site: url, iconUrl: shown2.faviconUrl, className: "h-3.5 w-3.5" }),
3352
3389
  /* @__PURE__ */ jsx18("span", { className: "truncate text-muted-foreground", children: shown2.siteName ?? "" })
3353
3390
  ] }),
3354
3391
  shown2.title ? /* @__PURE__ */ jsx18("div", { className: "line-clamp-2 font-medium", children: shown2.title }) : null,
@@ -4349,7 +4386,7 @@ import { AlchemyMenu } from "@ai-matrx/alchemy/react";
4349
4386
  import { OutboundLink as OutboundLink5 } from "@ai-matrx/kit/outbound-react";
4350
4387
  import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
4351
4388
  import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
4352
- var SaveToTable = lazy(() => import("./SaveToTable-54FVMGKL.js").then((m) => ({ default: m.SaveToTable })));
4389
+ var SaveToTable = lazy(() => import("./SaveToTable-62C57VOL.js").then((m) => ({ default: m.SaveToTable })));
4353
4390
  var LONGEST_READ = 5e5;
4354
4391
  var FENCE = /^```(?:json)?[ \t]*\r?\n([\s\S]*?)\r?\n?```$/;
4355
4392
  function isPlainObject(v) {
@@ -7823,6 +7860,25 @@ function FieldEditor(props) {
7823
7860
  const watchStart = useMemo10(() => watchedFieldsOf(start), [start]);
7824
7861
  const [watchFields, setWatchFields] = useState25(watchStart);
7825
7862
  const [dependency, setDependency] = useState25(dependencyStart);
7863
+ const [notifyStart, setNotifyStart] = useState25(field2 ? null : false);
7864
+ const [notify, setNotify] = useState25(false);
7865
+ const [notifyReadError, setNotifyReadError] = useState25(null);
7866
+ const personColumn = !onEntity && type === "member";
7867
+ useEffect17(() => {
7868
+ if (!field2 || onEntity || type !== "member") return;
7869
+ let live = true;
7870
+ void client.fieldNotifyOnAssign({ field_id: field2.id, on: null }).then((got) => {
7871
+ if (!live) return;
7872
+ if (got.ok) {
7873
+ setNotifyStart(got.data.notify_on_assign === true);
7874
+ setNotify(got.data.notify_on_assign === true);
7875
+ setNotifyReadError(null);
7876
+ } else setNotifyReadError(got.error);
7877
+ });
7878
+ return () => {
7879
+ live = false;
7880
+ };
7881
+ }, [client, field2, onEntity, type]);
7826
7882
  useEffect17(() => {
7827
7883
  if (!field2 || type !== "status") return;
7828
7884
  let live = true;
@@ -8035,7 +8091,16 @@ function FieldEditor(props) {
8035
8091
  return;
8036
8092
  }
8037
8093
  const written2 = await tableMutation.update({ field_id: field2.id, patch });
8038
- if (written2 !== null) onSaved?.();
8094
+ if (written2 === null) return;
8095
+ if (personColumn && notifyStart !== null && notify !== notifyStart) {
8096
+ const told = await client.fieldNotifyOnAssign({ field_id: field2.id, on: notify });
8097
+ if (!told.ok) {
8098
+ setBackfillError(told.error);
8099
+ return;
8100
+ }
8101
+ setNotifyStart(notify);
8102
+ }
8103
+ onSaved?.();
8039
8104
  return;
8040
8105
  }
8041
8106
  const spec = {
@@ -8115,6 +8180,13 @@ function FieldEditor(props) {
8115
8180
  return;
8116
8181
  }
8117
8182
  }
8183
+ if (personColumn && notify) {
8184
+ const told = await client.fieldNotifyOnAssign({ field_id: written, on: true });
8185
+ if (!told.ok) {
8186
+ setBackfillError(told.error);
8187
+ return;
8188
+ }
8189
+ }
8118
8190
  setBackfillError(null);
8119
8191
  if (type === "relation" && relationTarget === tableId && dependency && !onEntity) {
8120
8192
  const marked = await client.fieldUpdate({ field_id: written, patch: { dependency: true } });
@@ -8310,6 +8382,20 @@ function FieldEditor(props) {
8310
8382
  /* @__PURE__ */ jsx35(Checkbox4, { checked: dependency, "aria-label": "Waits on the linked records", "data-records-dependency": "", onCheckedChange: (v) => setDependency(v === true) }),
8311
8383
  /* @__PURE__ */ jsx35("span", { children: "Waits on the linked records" })
8312
8384
  ] }) : null,
8385
+ personColumn ? /* @__PURE__ */ jsxs31("label", { className: "flex items-center gap-1.5 text-sm", title: "Each person added to this column gets a notice", children: [
8386
+ /* @__PURE__ */ jsx35(
8387
+ Checkbox4,
8388
+ {
8389
+ checked: notify,
8390
+ disabled: notifyStart === null,
8391
+ "aria-label": "Notify people when they're added",
8392
+ "data-records-notify-on-assign": "",
8393
+ onCheckedChange: (v) => setNotify(v === true)
8394
+ }
8395
+ ),
8396
+ /* @__PURE__ */ jsx35("span", { children: "Notify people when they're added" })
8397
+ ] }) : null,
8398
+ notifyReadError ? /* @__PURE__ */ jsx35(RefusalNotice, { error: notifyReadError }) : null,
8313
8399
  type === "rollup" ? /* @__PURE__ */ jsx35(
8314
8400
  RollupFilterQuestion,
8315
8401
  {
@@ -9051,7 +9137,7 @@ function waitingRunsOf(pressed) {
9051
9137
  return out;
9052
9138
  }
9053
9139
  var stop2 = (event) => event.stopPropagation();
9054
- function ButtonValue({ field: field2, recordId, inCell }) {
9140
+ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
9055
9141
  const client = useOptionalRecordsClient11();
9056
9142
  const b = buttonOf2(field2);
9057
9143
  const [busy, setBusy] = useState26(false);
@@ -9065,6 +9151,12 @@ function ButtonValue({ field: field2, recordId, inCell }) {
9065
9151
  useEffect18(() => () => void (waitingOn.current += 1), []);
9066
9152
  if (!b) return null;
9067
9153
  const color = isStyleColor(b.color) ? CHOICE_CHIP_CLASS[b.color] : NEUTRAL_CHIP_CLASS;
9154
+ if (beforeSave) {
9155
+ return /* @__PURE__ */ jsxs32("span", { className: "inline-flex min-w-0 items-center gap-2", "data-records-button-before-save": field2.key, children: [
9156
+ /* @__PURE__ */ jsx36(Button15, { type: "button", size: "xs", variant: "outline", disabled: true, "aria-describedby": `${field2.key}-before-save`, "data-records-button": field2.key, className: cn18("max-w-full gap-1 border px-2 font-medium", inCell ? "h-5" : "h-6", color), children: /* @__PURE__ */ jsx36("span", { className: "truncate", children: b.label }) }),
9157
+ /* @__PURE__ */ jsx36("span", { id: `${field2.key}-before-save`, className: "whitespace-nowrap text-xs text-muted-foreground", children: "Save the record first" })
9158
+ ] });
9159
+ }
9068
9160
  const needs = buttonNeeds2(b);
9069
9161
  const tableId = field2.entity_definition_id;
9070
9162
  const press = async () => {
@@ -9841,7 +9933,7 @@ function FieldControl({ field: field2, value, onChange, disabled, id, autoOpen,
9841
9933
  const ownDetails = useOptionalRecordsClient12() === null;
9842
9934
  if (isTypedDraft(value)) return /* @__PURE__ */ jsx40(TypedTextControl, { field: field2, value, onChange, disabled, id: inputId, onCommit, onCancel });
9843
9935
  if (isSignatureField(field2)) return /* @__PURE__ */ jsx40(SignaturePad, { id: inputId, value, onChange, disabled });
9844
- if (isButtonField2(field2)) return /* @__PURE__ */ jsx40(ButtonValue, { field: field2 });
9936
+ if (isButtonField2(field2)) return /* @__PURE__ */ jsx40(ButtonValue, { field: field2, recordId: recordId ?? null, beforeSave: !recordId });
9845
9937
  const newerControl = newerKindControl({ field: field2, value, onChange, disabled, id: inputId });
9846
9938
  if (newerControl !== void 0) return newerControl;
9847
9939
  const format = formatForField(field2);
@@ -11569,6 +11661,7 @@ export {
11569
11661
  SignaturePad,
11570
11662
  TYPE_SAMPLE,
11571
11663
  Swatch,
11664
+ colorPairGround,
11572
11665
  colorPairContrast,
11573
11666
  ContrastMark,
11574
11667
  ColorWell,
@@ -11719,4 +11812,4 @@ export {
11719
11812
  RecordNameText,
11720
11813
  HeldChangeDecision
11721
11814
  };
11722
- //# sourceMappingURL=chunk-E5HKO5LT.js.map
11815
+ //# sourceMappingURL=chunk-4GZVOFJJ.js.map