@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 +12 -0
- package/dist/index.cjs +32 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +32 -28
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +16 -17
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +16 -17
- package/dist/pickers.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -4533,6 +4533,7 @@ import {
|
|
|
4533
4533
|
statusGroupOf
|
|
4534
4534
|
} from "@ai-matrx/records";
|
|
4535
4535
|
import { BasicInput as BasicInput4, cn as cn11 } from "@ai-matrx/design-system";
|
|
4536
|
+
import { OutboundLink } from "@ai-matrx/kit/outbound-react";
|
|
4536
4537
|
import { Fragment as Fragment4, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
4537
4538
|
var own = (event) => event.stopPropagation();
|
|
4538
4539
|
function newerKindValue(field2, value, opts = {}) {
|
|
@@ -4581,11 +4582,9 @@ function AddressLink({ value }) {
|
|
|
4581
4582
|
const href = addressMapUrl(value);
|
|
4582
4583
|
if (!words2 || !href) return /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
4583
4584
|
return /* @__PURE__ */ jsxs14(
|
|
4584
|
-
|
|
4585
|
+
OutboundLink,
|
|
4585
4586
|
{
|
|
4586
4587
|
href,
|
|
4587
|
-
target: "_blank",
|
|
4588
|
-
rel: "noopener noreferrer",
|
|
4589
4588
|
className: "inline-flex min-w-0 items-center gap-1 text-primary hover:underline",
|
|
4590
4589
|
title: "Open in maps",
|
|
4591
4590
|
"data-records-address": "",
|
|
@@ -4633,7 +4632,7 @@ function marks(text, key) {
|
|
|
4633
4632
|
const link = /^\[([^\]]+)\]\(([^)\s]+)\)$/.exec(tok);
|
|
4634
4633
|
const href = safeLinkHref(link?.[2] ?? "");
|
|
4635
4634
|
out.push(
|
|
4636
|
-
href ? /* @__PURE__ */ jsx16(
|
|
4635
|
+
href ? /* @__PURE__ */ jsx16(OutboundLink, { href, className: "text-primary underline-offset-2 hover:underline", onClick: own, children: link?.[1] }, k) : link?.[1] ?? tok
|
|
4637
4636
|
);
|
|
4638
4637
|
} else out.push(/* @__PURE__ */ jsx16("em", { children: tok.slice(1, -1) }, k));
|
|
4639
4638
|
last = at + tok.length;
|
|
@@ -5928,6 +5927,7 @@ import { wholeValueOf } from "@ai-matrx/records/core";
|
|
|
5928
5927
|
import { useEffect as useEffect13, useState as useState18 } from "react";
|
|
5929
5928
|
import { wholeValueSize } from "@ai-matrx/records/core";
|
|
5930
5929
|
import { BasicTextarea as BasicTextarea2 } from "@ai-matrx/design-system";
|
|
5930
|
+
import { OutboundLink as OutboundLink2 } from "@ai-matrx/kit/outbound-react";
|
|
5931
5931
|
import { jsx as jsx22, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5932
5932
|
var WHOLE_VALUE_UNBOUND = "The whole text is kept as a file, and this screen has no way to open files yet.";
|
|
5933
5933
|
function wholeValueLine(pointer) {
|
|
@@ -5942,7 +5942,7 @@ function WholeValueCell({ words: words2, pointer }) {
|
|
|
5942
5942
|
words2,
|
|
5943
5943
|
"\u2026"
|
|
5944
5944
|
] }),
|
|
5945
|
-
href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ jsx22(
|
|
5945
|
+
href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ jsx22(OutboundLink2, { className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline", href, children: line }) : /* @__PURE__ */ jsx22("span", { className: "shrink-0 text-xs italic text-muted-foreground", title: WHOLE_VALUE_UNBOUND, children: `${wholeValueSize(pointer)} in a file` })
|
|
5946
5946
|
] });
|
|
5947
5947
|
}
|
|
5948
5948
|
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.";
|
|
@@ -6024,6 +6024,7 @@ import { useRef as useRef10 } from "react";
|
|
|
6024
6024
|
import { FormattedCell } from "@ai-matrx/design-system/data-table";
|
|
6025
6025
|
import { formatFieldValue as formatFieldValue2, formatPhone, getFieldFormat as getFieldFormat2 } from "@ai-matrx/design-system/field-formats";
|
|
6026
6026
|
import { cn as cn16 } from "@ai-matrx/design-system";
|
|
6027
|
+
import { OutboundLink as OutboundLink3 } from "@ai-matrx/kit/outbound-react";
|
|
6027
6028
|
import { jsx as jsx23, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6028
6029
|
var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
|
|
6029
6030
|
var own2 = (event) => event.stopPropagation();
|
|
@@ -6094,16 +6095,14 @@ function rich(id, text, raw, format) {
|
|
|
6094
6095
|
case "email":
|
|
6095
6096
|
return /* @__PURE__ */ jsx23("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ jsx23("span", { className: "truncate", children: text }) });
|
|
6096
6097
|
case "url":
|
|
6097
|
-
return /* @__PURE__ */ jsx23(
|
|
6098
|
+
return /* @__PURE__ */ jsx23(OutboundLink3, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ jsx23("span", { className: "truncate", children: text }) });
|
|
6098
6099
|
case "phone":
|
|
6099
6100
|
return /* @__PURE__ */ jsx23("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ jsx23("span", { className: "truncate tabular-nums", children: formatPhone(text) }) });
|
|
6100
6101
|
case "address":
|
|
6101
6102
|
return /* @__PURE__ */ jsx23(
|
|
6102
|
-
|
|
6103
|
+
OutboundLink3,
|
|
6103
6104
|
{
|
|
6104
6105
|
href: `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(text)}`,
|
|
6105
|
-
target: "_blank",
|
|
6106
|
-
rel: "noopener noreferrer",
|
|
6107
6106
|
className: LINK,
|
|
6108
6107
|
title: "Open in maps",
|
|
6109
6108
|
onClick: own2,
|
|
@@ -6273,6 +6272,7 @@ function FilePicker({
|
|
|
6273
6272
|
}
|
|
6274
6273
|
|
|
6275
6274
|
// src/gridAttachments.tsx
|
|
6275
|
+
import { OutboundLink as OutboundLink4 } from "@ai-matrx/kit/outbound-react";
|
|
6276
6276
|
import { jsx as jsx25, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6277
6277
|
function attachmentIdsOf(value) {
|
|
6278
6278
|
return idsOf(value);
|
|
@@ -6329,11 +6329,9 @@ function AttachmentChip({ id, onRemove }) {
|
|
|
6329
6329
|
const title = href ? `Open ${words2}` : read?.why ?? FILE_CHIP_NO_PAGE;
|
|
6330
6330
|
return /* @__PURE__ */ jsxs22(Badge3, { variant: "secondary", className: "max-w-[14rem] gap-1 text-[11px]", "data-records-file-chip": id, title, children: [
|
|
6331
6331
|
href ? /* @__PURE__ */ jsx25(
|
|
6332
|
-
|
|
6332
|
+
OutboundLink4,
|
|
6333
6333
|
{
|
|
6334
6334
|
href,
|
|
6335
|
-
target: "_blank",
|
|
6336
|
-
rel: "noreferrer",
|
|
6337
6335
|
className: "truncate underline-offset-2 hover:underline",
|
|
6338
6336
|
"data-records-file-link": read?.fileId ?? "",
|
|
6339
6337
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -6992,6 +6990,7 @@ function WorkedOutError({ field: field2, sentence: sentence2, floated = false })
|
|
|
6992
6990
|
}
|
|
6993
6991
|
|
|
6994
6992
|
// src/values.tsx
|
|
6993
|
+
import { OutboundLink as OutboundLink5 } from "@ai-matrx/kit/outbound-react";
|
|
6995
6994
|
import { Fragment as Fragment8, jsx as jsx30, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
6996
6995
|
function statusMark(field2, item, document2) {
|
|
6997
6996
|
const mark = statusMarkOf(field2, item, document2);
|
|
@@ -7116,12 +7115,10 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look) {
|
|
|
7116
7115
|
if (kind === "url" && typeof value === "string") {
|
|
7117
7116
|
const href = value.includes("://") ? value : `https://${value}`;
|
|
7118
7117
|
return /* @__PURE__ */ jsxs26(
|
|
7119
|
-
|
|
7118
|
+
OutboundLink5,
|
|
7120
7119
|
{
|
|
7121
7120
|
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",
|
|
7122
7121
|
href,
|
|
7123
|
-
target: "_blank",
|
|
7124
|
-
rel: "noreferrer",
|
|
7125
7122
|
title: value,
|
|
7126
7123
|
"data-records-link-chip": "",
|
|
7127
7124
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -9947,6 +9944,8 @@ function NewColumnDefault({
|
|
|
9947
9944
|
}
|
|
9948
9945
|
|
|
9949
9946
|
// src/buttonCell.tsx
|
|
9947
|
+
import { OutboundLink as OutboundLink6 } from "@ai-matrx/kit/outbound-react";
|
|
9948
|
+
import { openOutbound } from "@ai-matrx/kit/outbound";
|
|
9950
9949
|
import { Fragment as Fragment11, jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9951
9950
|
function buttonPressWords(label, pressed) {
|
|
9952
9951
|
if (pressed.do === "open_url") return `${label} opened ${pressed.url}`;
|
|
@@ -9977,7 +9976,7 @@ function ButtonValue({ field: field2, recordId, inCell }) {
|
|
|
9977
9976
|
if (!answered.ok) return setSaid({ kind: "refused", error: answered.error });
|
|
9978
9977
|
const pressed = answered.data;
|
|
9979
9978
|
if (pressed.do === "open_url") {
|
|
9980
|
-
const opened = typeof window !== "undefined" ?
|
|
9979
|
+
const opened = typeof window !== "undefined" ? openOutbound(pressed.url, "_blank", "noopener") : null;
|
|
9981
9980
|
return setSaid({ kind: "ran", says: opened ? `${b.label} opened.` : `${b.label} is ready:`, link: pressed.url });
|
|
9982
9981
|
}
|
|
9983
9982
|
setSaid({ kind: "ran", says: buttonPressWords(b.label, pressed) });
|
|
@@ -10011,7 +10010,7 @@ function ButtonValue({ field: field2, recordId, inCell }) {
|
|
|
10011
10010
|
said2?.kind === "ran" ? /* @__PURE__ */ jsxs35("p", { className: "break-words", children: [
|
|
10012
10011
|
said2.says,
|
|
10013
10012
|
" ",
|
|
10014
|
-
said2.link ? /* @__PURE__ */ jsx39(
|
|
10013
|
+
said2.link ? /* @__PURE__ */ jsx39(OutboundLink6, { href: said2.link, className: "text-primary underline", children: said2.link }) : null
|
|
10015
10014
|
] }) : null,
|
|
10016
10015
|
said2?.kind === "needs" ? /* @__PURE__ */ jsxs35(Fragment11, { children: [
|
|
10017
10016
|
/* @__PURE__ */ jsx39("p", { children: said2.says }),
|
|
@@ -21124,6 +21123,7 @@ function ObjectActionMenuItems({ actions }) {
|
|
|
21124
21123
|
}
|
|
21125
21124
|
|
|
21126
21125
|
// src/RecordActionMenu.tsx
|
|
21126
|
+
import { openOutbound as openOutbound2 } from "@ai-matrx/kit/outbound";
|
|
21127
21127
|
import { Fragment as Fragment23, jsx as jsx75, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
21128
21128
|
function duplicateValues(fields, document2) {
|
|
21129
21129
|
const data = {};
|
|
@@ -21156,7 +21156,7 @@ function useRecordActionHost({ tableId, row, onOpenRecord, onChanged, onMerge, o
|
|
|
21156
21156
|
// The record's panel carries its history under it — on its page, or in the table's rail.
|
|
21157
21157
|
...href ? { history: () => window.location.assign(href) } : onOpenRecord ? { history: (r) => onOpenRecord(r.id) } : {},
|
|
21158
21158
|
openInNewTab: (url) => {
|
|
21159
|
-
|
|
21159
|
+
openOutbound2(url, "_blank", "noopener");
|
|
21160
21160
|
},
|
|
21161
21161
|
copyText: async (url) => {
|
|
21162
21162
|
if (await copyText(url)) {
|
|
@@ -21324,6 +21324,7 @@ function RecordActionMenu({ tableId, row, name, onOpenRecord, onChanged, childre
|
|
|
21324
21324
|
}
|
|
21325
21325
|
|
|
21326
21326
|
// src/gridOpen.tsx
|
|
21327
|
+
import { openOutbound as openOutbound3 } from "@ai-matrx/kit/outbound";
|
|
21327
21328
|
import { jsx as jsx76, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
21328
21329
|
function openRecordLabel(name) {
|
|
21329
21330
|
return `Open ${name}`;
|
|
@@ -21361,7 +21362,7 @@ function withOpenRecord(columns, onOpen, nameOf2, place = "end", hrefOf) {
|
|
|
21361
21362
|
onOpen(row.id);
|
|
21362
21363
|
return;
|
|
21363
21364
|
}
|
|
21364
|
-
if (event.metaKey || event.ctrlKey)
|
|
21365
|
+
if (event.metaKey || event.ctrlKey) openOutbound3(href, "_blank", "noopener");
|
|
21365
21366
|
else window.location.assign(href);
|
|
21366
21367
|
},
|
|
21367
21368
|
children: "\u2922"
|
|
@@ -28401,7 +28402,8 @@ import {
|
|
|
28401
28402
|
|
|
28402
28403
|
// src/unfinishedTable.ts
|
|
28403
28404
|
var UNFINISHED_WINDOW_MS = 24 * 60 * 60 * 1e3;
|
|
28404
|
-
|
|
28405
|
+
var FILLED_WINDOW_MS = 15 * 60 * 1e3;
|
|
28406
|
+
async function findUnfinishedTable(client, wantedName, wantedKeys, wantedRows, now = Date.now()) {
|
|
28405
28407
|
const name = wantedName.trim().toLowerCase();
|
|
28406
28408
|
if (!name) return null;
|
|
28407
28409
|
const listed = await client.tableList();
|
|
@@ -28419,11 +28421,12 @@ async function findUnfinishedTable(client, wantedName, wantedKeys, now = Date.no
|
|
|
28419
28421
|
if (candidates.length === 0) return null;
|
|
28420
28422
|
const counted = await client.tableRowCounts({ table_ids: candidates.map((t) => t.id) });
|
|
28421
28423
|
if (!counted.ok) return null;
|
|
28422
|
-
const
|
|
28424
|
+
const rowsOf2 = new Map(counted.data.map((c) => [c.table_id, c.visible_rows]));
|
|
28423
28425
|
const wanted = new Set(wantedKeys);
|
|
28424
28426
|
const ordered = [...candidates].sort((a, b) => (madeAt.get(b.id) ?? 0) - (madeAt.get(a.id) ?? 0));
|
|
28425
28427
|
for (const t of ordered) {
|
|
28426
|
-
|
|
28428
|
+
const rows = rowsOf2.get(t.id) ?? 0;
|
|
28429
|
+
if (rows > 0 && (rows > wantedRows || now - (madeAt.get(t.id) ?? 0) > FILLED_WINDOW_MS)) continue;
|
|
28427
28430
|
const read = await client.fields({ table_id: t.id });
|
|
28428
28431
|
if (!read.ok) continue;
|
|
28429
28432
|
const have = new Set(read.data.map((f) => f.key));
|
|
@@ -30670,7 +30673,7 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
|
|
|
30670
30673
|
});
|
|
30671
30674
|
setPhase("making");
|
|
30672
30675
|
try {
|
|
30673
|
-
const earlier = await findUnfinishedTable(client, name ?? proposedName, fields.map((f) => f.key));
|
|
30676
|
+
const earlier = await findUnfinishedTable(client, name ?? proposedName, fields.map((f) => f.key), rows.length);
|
|
30674
30677
|
let tableName2;
|
|
30675
30678
|
let newId;
|
|
30676
30679
|
if (earlier) {
|
|
@@ -46430,6 +46433,7 @@ import {
|
|
|
46430
46433
|
formFromSummary,
|
|
46431
46434
|
formLookDocument
|
|
46432
46435
|
} from "@ai-matrx/records/forms";
|
|
46436
|
+
import { OutboundLink as OutboundLink7 } from "@ai-matrx/kit/outbound-react";
|
|
46433
46437
|
import { Fragment as Fragment60, jsx as jsx151, jsxs as jsxs139 } from "react/jsx-runtime";
|
|
46434
46438
|
function freshFormName(base2, taken) {
|
|
46435
46439
|
const names = new Set(taken.map((n) => n.trim().toLowerCase()));
|
|
@@ -47084,11 +47088,9 @@ function PublishRow({
|
|
|
47084
47088
|
) : null,
|
|
47085
47089
|
state !== "draft" ? /* @__PURE__ */ jsxs139(Fragment60, { children: [
|
|
47086
47090
|
/* @__PURE__ */ jsx151(
|
|
47087
|
-
|
|
47091
|
+
OutboundLink7,
|
|
47088
47092
|
{
|
|
47089
47093
|
href: url,
|
|
47090
|
-
target: "_blank",
|
|
47091
|
-
rel: "noreferrer",
|
|
47092
47094
|
className: "min-w-0 flex-1 truncate text-xs underline underline-offset-2",
|
|
47093
47095
|
children: url
|
|
47094
47096
|
}
|
|
@@ -52133,6 +52135,7 @@ function asRefusal3(e, fallback) {
|
|
|
52133
52135
|
|
|
52134
52136
|
// src/CalendarSubscribe.tsx
|
|
52135
52137
|
import { Button as Button113, Dialog as Dialog17, DialogContent as DialogContent17, DialogHeader as DialogHeader17, DialogTitle as DialogTitle17 } from "@ai-matrx/design-system";
|
|
52138
|
+
import { OutboundLink as OutboundLink8 } from "@ai-matrx/kit/outbound-react";
|
|
52136
52139
|
import { jsx as jsx168, jsxs as jsxs156 } from "react/jsx-runtime";
|
|
52137
52140
|
function CalendarLinkOnce({ url }) {
|
|
52138
52141
|
const notify = useRecordsUi().notify;
|
|
@@ -52160,7 +52163,7 @@ function CalendarLinkOnce({ url }) {
|
|
|
52160
52163
|
] }),
|
|
52161
52164
|
/* @__PURE__ */ jsxs156("div", { className: "flex flex-wrap gap-2", children: [
|
|
52162
52165
|
/* @__PURE__ */ jsx168(Button113, { asChild: true, size: "sm", variant: "outline", children: /* @__PURE__ */ jsx168("a", { href: webcalUrl(url), "data-calendar-apple": "", children: "Open in Apple Calendar" }) }),
|
|
52163
|
-
/* @__PURE__ */ jsx168(Button113, { asChild: true, size: "sm", variant: "outline", children: /* @__PURE__ */ jsx168(
|
|
52166
|
+
/* @__PURE__ */ jsx168(Button113, { asChild: true, size: "sm", variant: "outline", children: /* @__PURE__ */ jsx168(OutboundLink8, { href: googleCalendarUrl(url), "data-calendar-google": "", children: "Add to Google Calendar" }) })
|
|
52164
52167
|
] }),
|
|
52165
52168
|
/* @__PURE__ */ jsx168("p", { className: "text-xs text-muted-foreground", children: "Shown once. Rotate it from Settings if you lose it." })
|
|
52166
52169
|
] });
|
|
@@ -53065,6 +53068,7 @@ function useSlotScroll(slot) {
|
|
|
53065
53068
|
|
|
53066
53069
|
// src/TablePage.tsx
|
|
53067
53070
|
import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
|
|
53071
|
+
import { openOutbound as openOutbound4 } from "@ai-matrx/kit/outbound";
|
|
53068
53072
|
import { Fragment as Fragment71, jsx as jsx175, jsxs as jsxs163 } from "react/jsx-runtime";
|
|
53069
53073
|
var RAIL_TITLE = {
|
|
53070
53074
|
settings: "Table settings",
|
|
@@ -53885,7 +53889,7 @@ function TablePage({
|
|
|
53885
53889
|
...actionHost?.extend ? actionHost.extend(subject, mayDo) : []
|
|
53886
53890
|
],
|
|
53887
53891
|
openInNewTab: (url) => {
|
|
53888
|
-
|
|
53892
|
+
openOutbound4(url, "_blank", "noopener");
|
|
53889
53893
|
},
|
|
53890
53894
|
copyText: async (url) => {
|
|
53891
53895
|
if (await copyText15(url)) {
|