@ai-matrx/records-ui 0.116.76 → 0.116.77
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 +4 -8342
- package/dist/{chunk-D2FZEAYO.js → chunk-P7GVWT6U.js} +341 -325
- package/dist/chunk-P7GVWT6U.js.map +1 -0
- package/dist/index.cjs +50 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/dist/pickers.cjs +43 -27
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-D2FZEAYO.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -8261,7 +8261,7 @@ __export(src_exports, {
|
|
|
8261
8261
|
PROPOSED_CHANGE_ACT_VALUES: () => PROPOSED_CHANGE_ACT_VALUES,
|
|
8262
8262
|
PageCanvas: () => PageCanvas,
|
|
8263
8263
|
PageScreen: () => PageScreen,
|
|
8264
|
-
Peek: () =>
|
|
8264
|
+
Peek: () => Peek3,
|
|
8265
8265
|
PersonPicker: () => PersonPicker,
|
|
8266
8266
|
PickOrAdd: () => PickOrAdd,
|
|
8267
8267
|
PipelineBoard: () => PipelineBoard,
|
|
@@ -15135,12 +15135,36 @@ var import_design_system26 = require("@ai-matrx/design-system");
|
|
|
15135
15135
|
init_host();
|
|
15136
15136
|
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
15137
15137
|
var answers = /* @__PURE__ */ new Map();
|
|
15138
|
+
function hostOf(url) {
|
|
15139
|
+
try {
|
|
15140
|
+
return new URL(url).hostname.replace(/^www\./, "");
|
|
15141
|
+
} catch {
|
|
15142
|
+
return url;
|
|
15143
|
+
}
|
|
15144
|
+
}
|
|
15145
|
+
function linkPreviewRecord(url, shown5) {
|
|
15146
|
+
const site = shown5.siteName?.trim() || hostOf(url);
|
|
15147
|
+
const title = shown5.title?.trim() || site;
|
|
15148
|
+
return {
|
|
15149
|
+
kind: "Link",
|
|
15150
|
+
id: url,
|
|
15151
|
+
showId: false,
|
|
15152
|
+
title,
|
|
15153
|
+
...shown5.siteName || shown5.title ? { subtitle: site } : {},
|
|
15154
|
+
avatar: { initials: site.slice(0, 1).toUpperCase(), ...shown5.faviconUrl ? { src: shown5.faviconUrl } : {} },
|
|
15155
|
+
...shown5.imageUrl ? { media: { alt: title, src: shown5.imageUrl, aspect: "16:9" } } : {},
|
|
15156
|
+
...shown5.description ? { body: [{ section: "Description", text: shown5.description, clamp: 3 }] } : {},
|
|
15157
|
+
href: url,
|
|
15158
|
+
copyData: { url, title: shown5.title, description: shown5.description, site: shown5.siteName }
|
|
15159
|
+
};
|
|
15160
|
+
}
|
|
15138
15161
|
function LinkPreviewCard({ url, children }) {
|
|
15139
15162
|
const port = useRecordsUi().linkPreview;
|
|
15140
15163
|
const [preview, setPreview] = (0, import_react48.useState)(void 0);
|
|
15141
15164
|
const [open, setOpen] = (0, import_react48.useState)(false);
|
|
15142
|
-
const
|
|
15143
|
-
(0, import_react48.
|
|
15165
|
+
const shown5 = preview && (preview.title || preview.description || preview.imageUrl) ? preview : null;
|
|
15166
|
+
const record = (0, import_react48.useMemo)(() => shown5 ? linkPreviewRecord(url, shown5) : null, [url, shown5]);
|
|
15167
|
+
(0, import_react48.useEffect)(() => setPreview(void 0), [url]);
|
|
15144
15168
|
if (!port) return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
|
|
15145
15169
|
const ask2 = () => {
|
|
15146
15170
|
if (preview !== void 0) return;
|
|
@@ -15151,31 +15175,23 @@ function LinkPreviewCard({ url, children }) {
|
|
|
15151
15175
|
}
|
|
15152
15176
|
void pending.then((found) => setPreview(found));
|
|
15153
15177
|
};
|
|
15154
|
-
const
|
|
15155
|
-
|
|
15156
|
-
|
|
15157
|
-
|
|
15158
|
-
|
|
15159
|
-
|
|
15160
|
-
|
|
15161
|
-
|
|
15162
|
-
|
|
15163
|
-
|
|
15164
|
-
|
|
15165
|
-
|
|
15166
|
-
|
|
15167
|
-
|
|
15168
|
-
|
|
15169
|
-
|
|
15170
|
-
|
|
15171
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsxs)("div", { className: "flex items-center gap-1.5", children: [
|
|
15172
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system26.SiteIcon, { site: url, iconUrl: shown5.faviconUrl, className: "h-3.5 w-3.5" }),
|
|
15173
|
-
/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "truncate text-muted-foreground", children: shown5.siteName ?? "" })
|
|
15174
|
-
] }),
|
|
15175
|
-
shown5.title ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "line-clamp-2 font-medium", children: shown5.title }) : null,
|
|
15176
|
-
shown5.description ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { className: "line-clamp-3 text-muted-foreground", children: shown5.description }) : null
|
|
15177
|
-
] }) : null
|
|
15178
|
-
] });
|
|
15178
|
+
const chip = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("span", { className: "inline-flex min-w-0 max-w-full", onMouseEnter: ask2, onFocus: ask2, children });
|
|
15179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
|
|
15180
|
+
import_design_system26.PeekHoverCard,
|
|
15181
|
+
{
|
|
15182
|
+
trigger: chip,
|
|
15183
|
+
label: record?.title ?? "Link",
|
|
15184
|
+
side: "bottom",
|
|
15185
|
+
align: "start",
|
|
15186
|
+
presentation: "float",
|
|
15187
|
+
open: open && record !== null,
|
|
15188
|
+
onOpenChange: (next) => {
|
|
15189
|
+
if (next) ask2();
|
|
15190
|
+
setOpen(next);
|
|
15191
|
+
},
|
|
15192
|
+
children: record ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_design_system26.Peek, { record, size: "sm" }) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, {})
|
|
15193
|
+
}
|
|
15194
|
+
);
|
|
15179
15195
|
}
|
|
15180
15196
|
|
|
15181
15197
|
// src/formattedValue.tsx
|
|
@@ -37594,7 +37610,7 @@ var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
|
37594
37610
|
function drawnBelowOnPage(field2, bodyKey) {
|
|
37595
37611
|
return field2.key === bodyKey || editorKindFor(field2) === "relation";
|
|
37596
37612
|
}
|
|
37597
|
-
function
|
|
37613
|
+
function Peek3({ tableId, recordId, onClose, className, onPage = false }) {
|
|
37598
37614
|
usePeopleTick();
|
|
37599
37615
|
const table = (0, import_react209.useTable)(tableId);
|
|
37600
37616
|
const fields = (0, import_react209.useFields)(tableId);
|
|
@@ -39883,7 +39899,7 @@ function RecordPanel({ tableId, recordId, onClose, onAskAboutField, onPage = fal
|
|
|
39883
39899
|
},
|
|
39884
39900
|
children: [
|
|
39885
39901
|
neighbors && onStep ? /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(RecordStepper, { neighbors, onStep: (to) => onStep(to), expanded, onToggleExpand, full, onToggleFull }) : null,
|
|
39886
|
-
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
39902
|
+
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(Peek3, { tableId, recordId, onPage, ...onClose ? { onClose } : {} }),
|
|
39887
39903
|
answered ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
39888
39904
|
onPage ? /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(import_jsx_runtime135.Fragment, { children: [
|
|
39889
39905
|
/* @__PURE__ */ (0, import_jsx_runtime135.jsx)(RecordBody, { tableId, recordId }),
|
|
@@ -59374,7 +59390,7 @@ function BlockBody(inner2) {
|
|
|
59374
59390
|
function RecordPanelView({ tableId, recordId, row, listId }) {
|
|
59375
59391
|
const door = useInterfaceDoor();
|
|
59376
59392
|
const through = useDoorRows(door, listId);
|
|
59377
|
-
if (!door) return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
59393
|
+
if (!door) return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(Peek3, { tableId, recordId }, recordId);
|
|
59378
59394
|
if (!row) return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(BlockNote, { children: "Pick a record in the list." });
|
|
59379
59395
|
return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(RecordDetail, { row, all: through.fields, groups: void 0 });
|
|
59380
59396
|
}
|
|
@@ -59602,7 +59618,7 @@ function ReviewBlockView({ block, viewerUserId, extra }) {
|
|
|
59602
59618
|
/* @__PURE__ */ (0, import_jsx_runtime194.jsx)("span", { className: "min-w-0 flex-1 truncate text-sm font-medium", children: rowNameIn(table.data ?? null, current) }),
|
|
59603
59619
|
neighbors ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(RecordStepper, { neighbors, onStep: (to) => setChosen(to) }) : null
|
|
59604
59620
|
] }),
|
|
59605
|
-
block.field_groups && block.field_groups.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(RecordDetail, { row: current, all, groups: block.field_groups }) : door ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(RecordDetail, { row: current, all, groups: void 0 }) : /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
59621
|
+
block.field_groups && block.field_groups.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(RecordDetail, { row: current, all, groups: block.field_groups }) : door ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(RecordDetail, { row: current, all, groups: void 0 }) : /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(Peek3, { tableId: block.table_id, recordId: current.id }, current.id)
|
|
59606
59622
|
] }) : null
|
|
59607
59623
|
] });
|
|
59608
59624
|
}
|
|
@@ -59695,7 +59711,7 @@ function MemberLayoutView({ block, viewerUserId, extra }) {
|
|
|
59695
59711
|
onOpenRecord: (id) => setOpen(id)
|
|
59696
59712
|
}
|
|
59697
59713
|
),
|
|
59698
|
-
open ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(
|
|
59714
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime194.jsx)(Peek3, { tableId: block.table_id, recordId: open, onClose: () => setOpen(null) }, open) : null
|
|
59699
59715
|
] });
|
|
59700
59716
|
}
|
|
59701
59717
|
function DoorLayoutView({ block, door }) {
|
|
@@ -61710,7 +61726,7 @@ function PortalShell({ tableId, form, resourceType = "record", className }) {
|
|
|
61710
61726
|
] });
|
|
61711
61727
|
}
|
|
61712
61728
|
if (open) {
|
|
61713
|
-
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("section", { className: (0, import_design_system176.cn)("flex min-h-0 flex-col gap-2", className), children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(
|
|
61729
|
+
return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)("section", { className: (0, import_design_system176.cn)("flex min-h-0 flex-col gap-2", className), children: /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(Peek3, { tableId, recordId: open, onClose: () => setOpen(null) }) });
|
|
61714
61730
|
}
|
|
61715
61731
|
return /* @__PURE__ */ (0, import_jsx_runtime200.jsxs)("section", { className: (0, import_design_system176.cn)("flex min-h-0 flex-col gap-2", className), children: [
|
|
61716
61732
|
/* @__PURE__ */ (0, import_jsx_runtime200.jsxs)("header", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|