@ai-matrx/records-ui 0.115.69 → 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 +6 -0
- package/dist/index.cjs +26 -24
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +26 -24
- 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 +5 -5
package/dist/pickers.js
CHANGED
|
@@ -956,6 +956,7 @@ import {
|
|
|
956
956
|
statusGroupOf
|
|
957
957
|
} from "@ai-matrx/records";
|
|
958
958
|
import { BasicInput as BasicInput2, cn as cn4 } from "@ai-matrx/design-system";
|
|
959
|
+
import { OutboundLink } from "@ai-matrx/kit/outbound-react";
|
|
959
960
|
import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
960
961
|
var own = (event) => event.stopPropagation();
|
|
961
962
|
function newerKindValue(field, value, opts = {}) {
|
|
@@ -1004,11 +1005,9 @@ function AddressLink({ value }) {
|
|
|
1004
1005
|
const href = addressMapUrl(value);
|
|
1005
1006
|
if (!words || !href) return /* @__PURE__ */ jsx6("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
1006
1007
|
return /* @__PURE__ */ jsxs5(
|
|
1007
|
-
|
|
1008
|
+
OutboundLink,
|
|
1008
1009
|
{
|
|
1009
1010
|
href,
|
|
1010
|
-
target: "_blank",
|
|
1011
|
-
rel: "noopener noreferrer",
|
|
1012
1011
|
className: "inline-flex min-w-0 items-center gap-1 text-primary hover:underline",
|
|
1013
1012
|
title: "Open in maps",
|
|
1014
1013
|
"data-records-address": "",
|
|
@@ -1056,7 +1055,7 @@ function marks(text, key) {
|
|
|
1056
1055
|
const link = /^\[([^\]]+)\]\(([^)\s]+)\)$/.exec(tok);
|
|
1057
1056
|
const href = safeLinkHref(link?.[2] ?? "");
|
|
1058
1057
|
out.push(
|
|
1059
|
-
href ? /* @__PURE__ */ jsx6(
|
|
1058
|
+
href ? /* @__PURE__ */ jsx6(OutboundLink, { href, className: "text-primary underline-offset-2 hover:underline", onClick: own, children: link?.[1] }, k) : link?.[1] ?? tok
|
|
1060
1059
|
);
|
|
1061
1060
|
} else out.push(/* @__PURE__ */ jsx6("em", { children: tok.slice(1, -1) }, k));
|
|
1062
1061
|
last = at + tok.length;
|
|
@@ -3741,6 +3740,7 @@ import { wholeValueOf } from "@ai-matrx/records/core";
|
|
|
3741
3740
|
import { useEffect as useEffect10, useState as useState15 } from "react";
|
|
3742
3741
|
import { wholeValueSize } from "@ai-matrx/records/core";
|
|
3743
3742
|
import { BasicTextarea as BasicTextarea2 } from "@ai-matrx/design-system";
|
|
3743
|
+
import { OutboundLink as OutboundLink2 } from "@ai-matrx/kit/outbound-react";
|
|
3744
3744
|
import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3745
3745
|
var WHOLE_VALUE_UNBOUND = "The whole text is kept as a file, and this screen has no way to open files yet.";
|
|
3746
3746
|
function wholeValueLine(pointer) {
|
|
@@ -3755,7 +3755,7 @@ function WholeValueCell({ words, pointer }) {
|
|
|
3755
3755
|
words,
|
|
3756
3756
|
"\u2026"
|
|
3757
3757
|
] }),
|
|
3758
|
-
href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ jsx18(
|
|
3758
|
+
href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ jsx18(OutboundLink2, { className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline", href, children: line }) : /* @__PURE__ */ jsx18("span", { className: "shrink-0 text-xs italic text-muted-foreground", title: WHOLE_VALUE_UNBOUND, children: `${wholeValueSize(pointer)} in a file` })
|
|
3759
3759
|
] });
|
|
3760
3760
|
}
|
|
3761
3761
|
|
|
@@ -3767,6 +3767,7 @@ import { useRef as useRef8 } from "react";
|
|
|
3767
3767
|
import { FormattedCell } from "@ai-matrx/design-system/data-table";
|
|
3768
3768
|
import { formatFieldValue as formatFieldValue2, formatPhone, getFieldFormat as getFieldFormat2 } from "@ai-matrx/design-system/field-formats";
|
|
3769
3769
|
import { cn as cn15 } from "@ai-matrx/design-system";
|
|
3770
|
+
import { OutboundLink as OutboundLink3 } from "@ai-matrx/kit/outbound-react";
|
|
3770
3771
|
import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3771
3772
|
var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
|
|
3772
3773
|
var own2 = (event) => event.stopPropagation();
|
|
@@ -3837,16 +3838,14 @@ function rich(id, text, raw, format) {
|
|
|
3837
3838
|
case "email":
|
|
3838
3839
|
return /* @__PURE__ */ jsx19("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ jsx19("span", { className: "truncate", children: text }) });
|
|
3839
3840
|
case "url":
|
|
3840
|
-
return /* @__PURE__ */ jsx19(
|
|
3841
|
+
return /* @__PURE__ */ jsx19(OutboundLink3, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ jsx19("span", { className: "truncate", children: text }) });
|
|
3841
3842
|
case "phone":
|
|
3842
3843
|
return /* @__PURE__ */ jsx19("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ jsx19("span", { className: "truncate tabular-nums", children: formatPhone(text) }) });
|
|
3843
3844
|
case "address":
|
|
3844
3845
|
return /* @__PURE__ */ jsx19(
|
|
3845
|
-
|
|
3846
|
+
OutboundLink3,
|
|
3846
3847
|
{
|
|
3847
3848
|
href: `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(text)}`,
|
|
3848
|
-
target: "_blank",
|
|
3849
|
-
rel: "noopener noreferrer",
|
|
3850
3849
|
className: LINK,
|
|
3851
3850
|
title: "Open in maps",
|
|
3852
3851
|
onClick: own2,
|
|
@@ -4016,6 +4015,7 @@ function FilePicker({
|
|
|
4016
4015
|
}
|
|
4017
4016
|
|
|
4018
4017
|
// src/gridAttachments.tsx
|
|
4018
|
+
import { OutboundLink as OutboundLink4 } from "@ai-matrx/kit/outbound-react";
|
|
4019
4019
|
import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
4020
4020
|
function attachmentIdsOf(value) {
|
|
4021
4021
|
return idsOf(value);
|
|
@@ -4072,11 +4072,9 @@ function AttachmentChip({ id, onRemove }) {
|
|
|
4072
4072
|
const title = href ? `Open ${words}` : read?.why ?? FILE_CHIP_NO_PAGE;
|
|
4073
4073
|
return /* @__PURE__ */ jsxs19(Badge3, { variant: "secondary", className: "max-w-[14rem] gap-1 text-[11px]", "data-records-file-chip": id, title, children: [
|
|
4074
4074
|
href ? /* @__PURE__ */ jsx21(
|
|
4075
|
-
|
|
4075
|
+
OutboundLink4,
|
|
4076
4076
|
{
|
|
4077
4077
|
href,
|
|
4078
|
-
target: "_blank",
|
|
4079
|
-
rel: "noreferrer",
|
|
4080
4078
|
className: "truncate underline-offset-2 hover:underline",
|
|
4081
4079
|
"data-records-file-link": read?.fileId ?? "",
|
|
4082
4080
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -4400,6 +4398,7 @@ function formulaSourceArchived(field, document2) {
|
|
|
4400
4398
|
|
|
4401
4399
|
// src/values.tsx
|
|
4402
4400
|
import { autonumberPrefixOf as autonumberPrefixOf2, autonumberWords as autonumberWords2, isButtonField as isButtonField2, newerKindWords, sourceArchivedOf as sourceArchivedOf2 } from "@ai-matrx/records";
|
|
4401
|
+
import { OutboundLink as OutboundLink5 } from "@ai-matrx/kit/outbound-react";
|
|
4403
4402
|
import { Fragment as Fragment7, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4404
4403
|
function statusMark(field, item, document2) {
|
|
4405
4404
|
const mark = statusMarkOf(field, item, document2);
|
|
@@ -4524,12 +4523,10 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look) {
|
|
|
4524
4523
|
if (kind === "url" && typeof value === "string") {
|
|
4525
4524
|
const href = value.includes("://") ? value : `https://${value}`;
|
|
4526
4525
|
return /* @__PURE__ */ jsxs21(
|
|
4527
|
-
|
|
4526
|
+
OutboundLink5,
|
|
4528
4527
|
{
|
|
4529
4528
|
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",
|
|
4530
4529
|
href,
|
|
4531
|
-
target: "_blank",
|
|
4532
|
-
rel: "noreferrer",
|
|
4533
4530
|
title: value,
|
|
4534
4531
|
"data-records-link-chip": "",
|
|
4535
4532
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -7450,6 +7447,8 @@ function NewColumnDefault({
|
|
|
7450
7447
|
}
|
|
7451
7448
|
|
|
7452
7449
|
// src/buttonCell.tsx
|
|
7450
|
+
import { OutboundLink as OutboundLink6 } from "@ai-matrx/kit/outbound-react";
|
|
7451
|
+
import { openOutbound } from "@ai-matrx/kit/outbound";
|
|
7453
7452
|
import { Fragment as Fragment10, jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
7454
7453
|
function buttonPressWords(label, pressed) {
|
|
7455
7454
|
if (pressed.do === "open_url") return `${label} opened ${pressed.url}`;
|
|
@@ -7480,7 +7479,7 @@ function ButtonValue({ field, recordId, inCell }) {
|
|
|
7480
7479
|
if (!answered.ok) return setSaid({ kind: "refused", error: answered.error });
|
|
7481
7480
|
const pressed = answered.data;
|
|
7482
7481
|
if (pressed.do === "open_url") {
|
|
7483
|
-
const opened = typeof window !== "undefined" ?
|
|
7482
|
+
const opened = typeof window !== "undefined" ? openOutbound(pressed.url, "_blank", "noopener") : null;
|
|
7484
7483
|
return setSaid({ kind: "ran", says: opened ? `${b.label} opened.` : `${b.label} is ready:`, link: pressed.url });
|
|
7485
7484
|
}
|
|
7486
7485
|
setSaid({ kind: "ran", says: buttonPressWords(b.label, pressed) });
|
|
@@ -7514,7 +7513,7 @@ function ButtonValue({ field, recordId, inCell }) {
|
|
|
7514
7513
|
said2?.kind === "ran" ? /* @__PURE__ */ jsxs31("p", { className: "break-words", children: [
|
|
7515
7514
|
said2.says,
|
|
7516
7515
|
" ",
|
|
7517
|
-
said2.link ? /* @__PURE__ */ jsx33(
|
|
7516
|
+
said2.link ? /* @__PURE__ */ jsx33(OutboundLink6, { href: said2.link, className: "text-primary underline", children: said2.link }) : null
|
|
7518
7517
|
] }) : null,
|
|
7519
7518
|
said2?.kind === "needs" ? /* @__PURE__ */ jsxs31(Fragment10, { children: [
|
|
7520
7519
|
/* @__PURE__ */ jsx33("p", { children: said2.says }),
|