@ai-matrx/records-ui 0.115.68 → 0.115.70

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
@@ -1,5 +1,17 @@
1
1
  # Changelog — @ai-matrx/records-ui
2
2
 
3
+ ## 0.115.70
4
+
5
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
6
+ `git diff npm/records-ui/v0.115.69..npm/records-ui/v0.115.70 -- apps/shared/records-ui`).
7
+ No source changes intended and no consumer action required.
8
+
9
+ ## 0.115.69
10
+
11
+ Automatic changed-only republish (docs/metadata drift since the last tag — see
12
+ `git diff npm/records-ui/v0.115.68..npm/records-ui/v0.115.69 -- apps/shared/records-ui`).
13
+ No source changes intended and no consumer action required.
14
+
3
15
  ## 0.115.68
4
16
 
5
17
  Automatic changed-only republish (docs/metadata drift since the last tag — see
package/dist/index.cjs CHANGED
@@ -5085,6 +5085,7 @@ var import_react26 = require("react");
5085
5085
  var import_source = require("@ai-matrx/content-ir/source");
5086
5086
  var import_records14 = require("@ai-matrx/records");
5087
5087
  var import_design_system14 = require("@ai-matrx/design-system");
5088
+ var import_outbound_react = require("@ai-matrx/kit/outbound-react");
5088
5089
  var import_jsx_runtime16 = require("react/jsx-runtime");
5089
5090
  var own = (event) => event.stopPropagation();
5090
5091
  function newerKindValue(field2, value, opts = {}) {
@@ -5133,11 +5134,9 @@ function AddressLink({ value }) {
5133
5134
  const href = (0, import_records14.addressMapUrl)(value);
5134
5135
  if (!words2 || !href) return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("span", { className: "text-muted-foreground", children: "\u2014" });
5135
5136
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(
5136
- "a",
5137
+ import_outbound_react.OutboundLink,
5137
5138
  {
5138
5139
  href,
5139
- target: "_blank",
5140
- rel: "noopener noreferrer",
5141
5140
  className: "inline-flex min-w-0 items-center gap-1 text-primary hover:underline",
5142
5141
  title: "Open in maps",
5143
5142
  "data-records-address": "",
@@ -5185,7 +5184,7 @@ function marks(text, key) {
5185
5184
  const link = /^\[([^\]]+)\]\(([^)\s]+)\)$/.exec(tok);
5186
5185
  const href = (0, import_records14.safeLinkHref)(link?.[2] ?? "");
5187
5186
  out.push(
5188
- href ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("a", { href, target: "_blank", rel: "noopener noreferrer", className: "text-primary underline-offset-2 hover:underline", onClick: own, children: link?.[1] }, k) : link?.[1] ?? tok
5187
+ href ? /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_outbound_react.OutboundLink, { href, className: "text-primary underline-offset-2 hover:underline", onClick: own, children: link?.[1] }, k) : link?.[1] ?? tok
5189
5188
  );
5190
5189
  } else out.push(/* @__PURE__ */ (0, import_jsx_runtime16.jsx)("em", { children: tok.slice(1, -1) }, k));
5191
5190
  last = at + tok.length;
@@ -6441,6 +6440,7 @@ var import_core6 = require("@ai-matrx/records/core");
6441
6440
  var import_react36 = require("react");
6442
6441
  var import_core5 = require("@ai-matrx/records/core");
6443
6442
  var import_design_system19 = require("@ai-matrx/design-system");
6443
+ var import_outbound_react2 = require("@ai-matrx/kit/outbound-react");
6444
6444
  var import_jsx_runtime22 = require("react/jsx-runtime");
6445
6445
  var WHOLE_VALUE_UNBOUND = "The whole text is kept as a file, and this screen has no way to open files yet.";
6446
6446
  function wholeValueLine(pointer) {
@@ -6455,7 +6455,7 @@ function WholeValueCell({ words: words2, pointer }) {
6455
6455
  words2,
6456
6456
  "\u2026"
6457
6457
  ] }),
6458
- href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("a", { className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline", href, target: "_blank", rel: "noreferrer", children: line }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "shrink-0 text-xs italic text-muted-foreground", title: WHOLE_VALUE_UNBOUND, children: `${(0, import_core5.wholeValueSize)(pointer)} in a file` })
6458
+ href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_outbound_react2.OutboundLink, { className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline", href, children: line }) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "shrink-0 text-xs italic text-muted-foreground", title: WHOLE_VALUE_UNBOUND, children: `${(0, import_core5.wholeValueSize)(pointer)} in a file` })
6459
6459
  ] });
6460
6460
  }
6461
6461
  var WHOLE_VALUE_NOT_EDITABLE_HERE = "The whole text is kept as a file. Open it to read it; this screen cannot load it to edit.";
@@ -6537,6 +6537,7 @@ var import_react37 = require("react");
6537
6537
  var import_data_table5 = require("@ai-matrx/design-system/data-table");
6538
6538
  var import_field_formats3 = require("@ai-matrx/design-system/field-formats");
6539
6539
  var import_design_system20 = require("@ai-matrx/design-system");
6540
+ var import_outbound_react3 = require("@ai-matrx/kit/outbound-react");
6540
6541
  var import_jsx_runtime23 = require("react/jsx-runtime");
6541
6542
  var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
6542
6543
  var own2 = (event) => event.stopPropagation();
@@ -6607,16 +6608,14 @@ function rich(id, text, raw, format) {
6607
6608
  case "email":
6608
6609
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate", children: text }) });
6609
6610
  case "url":
6610
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { href: text.includes("://") ? text : `https://${text}`, target: "_blank", rel: "noopener noreferrer", className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate", children: text }) });
6611
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_outbound_react3.OutboundLink, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate", children: text }) });
6611
6612
  case "phone":
6612
6613
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: "truncate tabular-nums", children: (0, import_field_formats3.formatPhone)(text) }) });
6613
6614
  case "address":
6614
6615
  return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
6615
- "a",
6616
+ import_outbound_react3.OutboundLink,
6616
6617
  {
6617
6618
  href: `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(text)}`,
6618
- target: "_blank",
6619
- rel: "noopener noreferrer",
6620
6619
  className: LINK,
6621
6620
  title: "Open in maps",
6622
6621
  onClick: own2,
@@ -6786,6 +6785,7 @@ function FilePicker({
6786
6785
  }
6787
6786
 
6788
6787
  // src/gridAttachments.tsx
6788
+ var import_outbound_react4 = require("@ai-matrx/kit/outbound-react");
6789
6789
  var import_jsx_runtime25 = require("react/jsx-runtime");
6790
6790
  function attachmentIdsOf(value) {
6791
6791
  return idsOf(value);
@@ -6842,11 +6842,9 @@ function AttachmentChip({ id, onRemove }) {
6842
6842
  const title = href ? `Open ${words2}` : read?.why ?? FILE_CHIP_NO_PAGE;
6843
6843
  return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_design_system22.Badge, { variant: "secondary", className: "max-w-[14rem] gap-1 text-[11px]", "data-records-file-chip": id, title, children: [
6844
6844
  href ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
6845
- "a",
6845
+ import_outbound_react4.OutboundLink,
6846
6846
  {
6847
6847
  href,
6848
- target: "_blank",
6849
- rel: "noreferrer",
6850
6848
  className: "truncate underline-offset-2 hover:underline",
6851
6849
  "data-records-file-link": read?.fileId ?? "",
6852
6850
  onClick: (event) => event.stopPropagation(),
@@ -7505,6 +7503,7 @@ function WorkedOutError({ field: field2, sentence: sentence2, floated = false })
7505
7503
  }
7506
7504
 
7507
7505
  // src/values.tsx
7506
+ var import_outbound_react5 = require("@ai-matrx/kit/outbound-react");
7508
7507
  var import_jsx_runtime30 = require("react/jsx-runtime");
7509
7508
  function statusMark(field2, item, document2) {
7510
7509
  const mark = statusMarkOf(field2, item, document2);
@@ -7629,12 +7628,10 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look) {
7629
7628
  if (kind === "url" && typeof value === "string") {
7630
7629
  const href = value.includes("://") ? value : `https://${value}`;
7631
7630
  return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
7632
- "a",
7631
+ import_outbound_react5.OutboundLink,
7633
7632
  {
7634
7633
  className: "inline-flex min-w-0 max-w-full items-center gap-1 rounded-md border border-border bg-muted/60 px-1.5 py-0.5 text-[11px] text-foreground hover:bg-accent",
7635
7634
  href,
7636
- target: "_blank",
7637
- rel: "noreferrer",
7638
7635
  title: value,
7639
7636
  "data-records-link-chip": "",
7640
7637
  onClick: (event) => event.stopPropagation(),
@@ -10451,6 +10448,8 @@ function NewColumnDefault({
10451
10448
  }
10452
10449
 
10453
10450
  // src/buttonCell.tsx
10451
+ var import_outbound_react6 = require("@ai-matrx/kit/outbound-react");
10452
+ var import_outbound = require("@ai-matrx/kit/outbound");
10454
10453
  var import_jsx_runtime39 = require("react/jsx-runtime");
10455
10454
  function buttonPressWords(label, pressed) {
10456
10455
  if (pressed.do === "open_url") return `${label} opened ${pressed.url}`;
@@ -10481,7 +10480,7 @@ function ButtonValue({ field: field2, recordId, inCell }) {
10481
10480
  if (!answered.ok) return setSaid({ kind: "refused", error: answered.error });
10482
10481
  const pressed = answered.data;
10483
10482
  if (pressed.do === "open_url") {
10484
- const opened = typeof window !== "undefined" ? window.open(pressed.url, "_blank", "noopener,noreferrer") : null;
10483
+ const opened = typeof window !== "undefined" ? (0, import_outbound.openOutbound)(pressed.url, "_blank", "noopener") : null;
10485
10484
  return setSaid({ kind: "ran", says: opened ? `${b.label} opened.` : `${b.label} is ready:`, link: pressed.url });
10486
10485
  }
10487
10486
  setSaid({ kind: "ran", says: buttonPressWords(b.label, pressed) });
@@ -10515,7 +10514,7 @@ function ButtonValue({ field: field2, recordId, inCell }) {
10515
10514
  said2?.kind === "ran" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("p", { className: "break-words", children: [
10516
10515
  said2.says,
10517
10516
  " ",
10518
- said2.link ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("a", { href: said2.link, target: "_blank", rel: "noopener noreferrer", className: "text-primary underline", children: said2.link }) : null
10517
+ said2.link ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_outbound_react6.OutboundLink, { href: said2.link, className: "text-primary underline", children: said2.link }) : null
10519
10518
  ] }) : null,
10520
10519
  said2?.kind === "needs" ? /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [
10521
10520
  /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { children: said2.says }),
@@ -21430,6 +21429,7 @@ function ObjectActionMenuItems({ actions }) {
21430
21429
  }
21431
21430
 
21432
21431
  // src/RecordActionMenu.tsx
21432
+ var import_outbound2 = require("@ai-matrx/kit/outbound");
21433
21433
  var import_jsx_runtime75 = require("react/jsx-runtime");
21434
21434
  function duplicateValues(fields, document2) {
21435
21435
  const data = {};
@@ -21462,7 +21462,7 @@ function useRecordActionHost({ tableId, row, onOpenRecord, onChanged, onMerge, o
21462
21462
  // The record's panel carries its history under it — on its page, or in the table's rail.
21463
21463
  ...href ? { history: () => window.location.assign(href) } : onOpenRecord ? { history: (r) => onOpenRecord(r.id) } : {},
21464
21464
  openInNewTab: (url) => {
21465
- window.open(url, "_blank", "noopener,noreferrer");
21465
+ (0, import_outbound2.openOutbound)(url, "_blank", "noopener");
21466
21466
  },
21467
21467
  copyText: async (url) => {
21468
21468
  if (await (0, import_clipboard2.copyText)(url)) {
@@ -21630,6 +21630,7 @@ function RecordActionMenu({ tableId, row, name, onOpenRecord, onChanged, childre
21630
21630
  }
21631
21631
 
21632
21632
  // src/gridOpen.tsx
21633
+ var import_outbound3 = require("@ai-matrx/kit/outbound");
21633
21634
  var import_jsx_runtime76 = require("react/jsx-runtime");
21634
21635
  function openRecordLabel(name) {
21635
21636
  return `Open ${name}`;
@@ -21667,7 +21668,7 @@ function withOpenRecord(columns, onOpen, nameOf2, place = "end", hrefOf) {
21667
21668
  onOpen(row.id);
21668
21669
  return;
21669
21670
  }
21670
- if (event.metaKey || event.ctrlKey) window.open(href, "_blank", "noopener,noreferrer");
21671
+ if (event.metaKey || event.ctrlKey) (0, import_outbound3.openOutbound)(href, "_blank", "noopener");
21671
21672
  else window.location.assign(href);
21672
21673
  },
21673
21674
  children: "\u2922"
@@ -28630,7 +28631,8 @@ var import_design_system85 = require("@ai-matrx/design-system");
28630
28631
 
28631
28632
  // src/unfinishedTable.ts
28632
28633
  var UNFINISHED_WINDOW_MS = 24 * 60 * 60 * 1e3;
28633
- async function findUnfinishedTable(client, wantedName, wantedKeys, now = Date.now()) {
28634
+ var FILLED_WINDOW_MS = 15 * 60 * 1e3;
28635
+ async function findUnfinishedTable(client, wantedName, wantedKeys, wantedRows, now = Date.now()) {
28634
28636
  const name = wantedName.trim().toLowerCase();
28635
28637
  if (!name) return null;
28636
28638
  const listed = await client.tableList();
@@ -28648,11 +28650,12 @@ async function findUnfinishedTable(client, wantedName, wantedKeys, now = Date.no
28648
28650
  if (candidates.length === 0) return null;
28649
28651
  const counted = await client.tableRowCounts({ table_ids: candidates.map((t) => t.id) });
28650
28652
  if (!counted.ok) return null;
28651
- const withRows = new Set(counted.data.filter((c) => c.visible_rows > 0).map((c) => c.table_id));
28653
+ const rowsOf2 = new Map(counted.data.map((c) => [c.table_id, c.visible_rows]));
28652
28654
  const wanted = new Set(wantedKeys);
28653
28655
  const ordered = [...candidates].sort((a, b) => (madeAt.get(b.id) ?? 0) - (madeAt.get(a.id) ?? 0));
28654
28656
  for (const t of ordered) {
28655
- if (withRows.has(t.id)) continue;
28657
+ const rows = rowsOf2.get(t.id) ?? 0;
28658
+ if (rows > 0 && (rows > wantedRows || now - (madeAt.get(t.id) ?? 0) > FILLED_WINDOW_MS)) continue;
28656
28659
  const read = await client.fields({ table_id: t.id });
28657
28660
  if (!read.ok) continue;
28658
28661
  const have = new Set(read.data.map((f) => f.key));
@@ -30877,7 +30880,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
30877
30880
  });
30878
30881
  setPhase("making");
30879
30882
  try {
30880
- const earlier = await findUnfinishedTable(client, name ?? proposedName, fields.map((f) => f.key));
30883
+ const earlier = await findUnfinishedTable(client, name ?? proposedName, fields.map((f) => f.key), rows.length);
30881
30884
  let tableName2;
30882
30885
  let newId;
30883
30886
  if (earlier) {
@@ -46510,6 +46513,7 @@ function Question({
46510
46513
 
46511
46514
  // src/FormBuilder.tsx
46512
46515
  var import_forms3 = require("@ai-matrx/records/forms");
46516
+ var import_outbound_react7 = require("@ai-matrx/kit/outbound-react");
46513
46517
  var import_jsx_runtime151 = require("react/jsx-runtime");
46514
46518
  function freshFormName(base2, taken) {
46515
46519
  const names = new Set(taken.map((n) => n.trim().toLowerCase()));
@@ -47164,11 +47168,9 @@ function PublishRow({
47164
47168
  ) : null,
47165
47169
  state !== "draft" ? /* @__PURE__ */ (0, import_jsx_runtime151.jsxs)(import_jsx_runtime151.Fragment, { children: [
47166
47170
  /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
47167
- "a",
47171
+ import_outbound_react7.OutboundLink,
47168
47172
  {
47169
47173
  href: url,
47170
- target: "_blank",
47171
- rel: "noreferrer",
47172
47174
  className: "min-w-0 flex-1 truncate text-xs underline underline-offset-2",
47173
47175
  children: url
47174
47176
  }
@@ -52154,6 +52156,7 @@ function asRefusal3(e, fallback) {
52154
52156
 
52155
52157
  // src/CalendarSubscribe.tsx
52156
52158
  var import_design_system150 = require("@ai-matrx/design-system");
52159
+ var import_outbound_react8 = require("@ai-matrx/kit/outbound-react");
52157
52160
  var import_jsx_runtime168 = require("react/jsx-runtime");
52158
52161
  function CalendarLinkOnce({ url }) {
52159
52162
  const notify = useRecordsUi().notify;
@@ -52181,7 +52184,7 @@ function CalendarLinkOnce({ url }) {
52181
52184
  ] }),
52182
52185
  /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)("div", { className: "flex flex-wrap gap-2", children: [
52183
52186
  /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_design_system150.Button, { asChild: true, size: "sm", variant: "outline", children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("a", { href: webcalUrl(url), "data-calendar-apple": "", children: "Open in Apple Calendar" }) }),
52184
- /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_design_system150.Button, { asChild: true, size: "sm", variant: "outline", children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("a", { href: googleCalendarUrl(url), target: "_blank", rel: "noopener noreferrer", "data-calendar-google": "", children: "Add to Google Calendar" }) })
52187
+ /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_design_system150.Button, { asChild: true, size: "sm", variant: "outline", children: /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(import_outbound_react8.OutboundLink, { href: googleCalendarUrl(url), "data-calendar-google": "", children: "Add to Google Calendar" }) })
52185
52188
  ] }),
52186
52189
  /* @__PURE__ */ (0, import_jsx_runtime168.jsx)("p", { className: "text-xs text-muted-foreground", children: "Shown once. Rotate it from Settings if you lose it." })
52187
52190
  ] });
@@ -53075,6 +53078,7 @@ function useSlotScroll(slot) {
53075
53078
 
53076
53079
  // src/TablePage.tsx
53077
53080
  var import_uuid3 = require("@ai-matrx/kit/uuid");
53081
+ var import_outbound4 = require("@ai-matrx/kit/outbound");
53078
53082
  var import_jsx_runtime175 = require("react/jsx-runtime");
53079
53083
  var RAIL_TITLE = {
53080
53084
  settings: "Table settings",
@@ -53895,7 +53899,7 @@ function TablePage({
53895
53899
  ...actionHost?.extend ? actionHost.extend(subject, mayDo) : []
53896
53900
  ],
53897
53901
  openInNewTab: (url) => {
53898
- window.open(url, "_blank", "noopener,noreferrer");
53902
+ (0, import_outbound4.openOutbound)(url, "_blank", "noopener");
53899
53903
  },
53900
53904
  copyText: async (url) => {
53901
53905
  if (await (0, import_clipboard17.copyText)(url)) {