@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.cjs
CHANGED
|
@@ -937,6 +937,7 @@ var import_react8 = require("react");
|
|
|
937
937
|
var import_source = require("@ai-matrx/content-ir/source");
|
|
938
938
|
var import_records4 = require("@ai-matrx/records");
|
|
939
939
|
var import_design_system5 = require("@ai-matrx/design-system");
|
|
940
|
+
var import_outbound_react = require("@ai-matrx/kit/outbound-react");
|
|
940
941
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
941
942
|
var own = (event) => event.stopPropagation();
|
|
942
943
|
function newerKindValue(field, value, opts = {}) {
|
|
@@ -985,11 +986,9 @@ function AddressLink({ value }) {
|
|
|
985
986
|
const href = (0, import_records4.addressMapUrl)(value);
|
|
986
987
|
if (!words || !href) return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", { className: "text-muted-foreground", children: "\u2014" });
|
|
987
988
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
988
|
-
|
|
989
|
+
import_outbound_react.OutboundLink,
|
|
989
990
|
{
|
|
990
991
|
href,
|
|
991
|
-
target: "_blank",
|
|
992
|
-
rel: "noopener noreferrer",
|
|
993
992
|
className: "inline-flex min-w-0 items-center gap-1 text-primary hover:underline",
|
|
994
993
|
title: "Open in maps",
|
|
995
994
|
"data-records-address": "",
|
|
@@ -1037,7 +1036,7 @@ function marks(text, key) {
|
|
|
1037
1036
|
const link = /^\[([^\]]+)\]\(([^)\s]+)\)$/.exec(tok);
|
|
1038
1037
|
const href = (0, import_records4.safeLinkHref)(link?.[2] ?? "");
|
|
1039
1038
|
out.push(
|
|
1040
|
-
href ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1039
|
+
href ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_outbound_react.OutboundLink, { href, className: "text-primary underline-offset-2 hover:underline", onClick: own, children: link?.[1] }, k) : link?.[1] ?? tok
|
|
1041
1040
|
);
|
|
1042
1041
|
} else out.push(/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("em", { children: tok.slice(1, -1) }, k));
|
|
1043
1042
|
last = at + tok.length;
|
|
@@ -3671,6 +3670,7 @@ var import_core5 = require("@ai-matrx/records/core");
|
|
|
3671
3670
|
var import_react28 = require("react");
|
|
3672
3671
|
var import_core4 = require("@ai-matrx/records/core");
|
|
3673
3672
|
var import_design_system16 = require("@ai-matrx/design-system");
|
|
3673
|
+
var import_outbound_react2 = require("@ai-matrx/kit/outbound-react");
|
|
3674
3674
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
3675
3675
|
var WHOLE_VALUE_UNBOUND = "The whole text is kept as a file, and this screen has no way to open files yet.";
|
|
3676
3676
|
function wholeValueLine(pointer) {
|
|
@@ -3685,7 +3685,7 @@ function WholeValueCell({ words, pointer }) {
|
|
|
3685
3685
|
words,
|
|
3686
3686
|
"\u2026"
|
|
3687
3687
|
] }),
|
|
3688
|
-
href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
3688
|
+
href ? host.Link ? host.Link({ href, children: line, className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline" }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_outbound_react2.OutboundLink, { className: "shrink-0 text-xs text-primary underline-offset-2 hover:underline", href, children: line }) : /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { className: "shrink-0 text-xs italic text-muted-foreground", title: WHOLE_VALUE_UNBOUND, children: `${(0, import_core4.wholeValueSize)(pointer)} in a file` })
|
|
3689
3689
|
] });
|
|
3690
3690
|
}
|
|
3691
3691
|
|
|
@@ -3697,6 +3697,7 @@ var import_react29 = require("react");
|
|
|
3697
3697
|
var import_data_table4 = require("@ai-matrx/design-system/data-table");
|
|
3698
3698
|
var import_field_formats3 = require("@ai-matrx/design-system/field-formats");
|
|
3699
3699
|
var import_design_system17 = require("@ai-matrx/design-system");
|
|
3700
|
+
var import_outbound_react3 = require("@ai-matrx/kit/outbound-react");
|
|
3700
3701
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3701
3702
|
var LINK = "inline-flex min-w-0 items-center gap-1 text-primary hover:underline";
|
|
3702
3703
|
var own2 = (event) => event.stopPropagation();
|
|
@@ -3767,16 +3768,14 @@ function rich(id, text, raw, format) {
|
|
|
3767
3768
|
case "email":
|
|
3768
3769
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate", children: text }) });
|
|
3769
3770
|
case "url":
|
|
3770
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3771
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_outbound_react3.OutboundLink, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate", children: text }) });
|
|
3771
3772
|
case "phone":
|
|
3772
3773
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("a", { href: `tel:${text.replace(/[^\d+]/g, "")}`, className: LINK, onClick: own2, title: text, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "truncate tabular-nums", children: (0, import_field_formats3.formatPhone)(text) }) });
|
|
3773
3774
|
case "address":
|
|
3774
3775
|
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
3775
|
-
|
|
3776
|
+
import_outbound_react3.OutboundLink,
|
|
3776
3777
|
{
|
|
3777
3778
|
href: `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(text)}`,
|
|
3778
|
-
target: "_blank",
|
|
3779
|
-
rel: "noopener noreferrer",
|
|
3780
3779
|
className: LINK,
|
|
3781
3780
|
title: "Open in maps",
|
|
3782
3781
|
onClick: own2,
|
|
@@ -3946,6 +3945,7 @@ function FilePicker({
|
|
|
3946
3945
|
}
|
|
3947
3946
|
|
|
3948
3947
|
// src/gridAttachments.tsx
|
|
3948
|
+
var import_outbound_react4 = require("@ai-matrx/kit/outbound-react");
|
|
3949
3949
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3950
3950
|
function attachmentIdsOf(value) {
|
|
3951
3951
|
return idsOf(value);
|
|
@@ -4002,11 +4002,9 @@ function AttachmentChip({ id, onRemove }) {
|
|
|
4002
4002
|
const title = href ? `Open ${words}` : read?.why ?? FILE_CHIP_NO_PAGE;
|
|
4003
4003
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_design_system19.Badge, { variant: "secondary", className: "max-w-[14rem] gap-1 text-[11px]", "data-records-file-chip": id, title, children: [
|
|
4004
4004
|
href ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
4005
|
-
|
|
4005
|
+
import_outbound_react4.OutboundLink,
|
|
4006
4006
|
{
|
|
4007
4007
|
href,
|
|
4008
|
-
target: "_blank",
|
|
4009
|
-
rel: "noreferrer",
|
|
4010
4008
|
className: "truncate underline-offset-2 hover:underline",
|
|
4011
4009
|
"data-records-file-link": read?.fileId ?? "",
|
|
4012
4010
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -4330,6 +4328,7 @@ function formulaSourceArchived(field, document2) {
|
|
|
4330
4328
|
|
|
4331
4329
|
// src/values.tsx
|
|
4332
4330
|
var import_records17 = require("@ai-matrx/records");
|
|
4331
|
+
var import_outbound_react5 = require("@ai-matrx/kit/outbound-react");
|
|
4333
4332
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
4334
4333
|
function statusMark(field, item, document2) {
|
|
4335
4334
|
const mark = statusMarkOf(field, item, document2);
|
|
@@ -4454,12 +4453,10 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look) {
|
|
|
4454
4453
|
if (kind === "url" && typeof value === "string") {
|
|
4455
4454
|
const href = value.includes("://") ? value : `https://${value}`;
|
|
4456
4455
|
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
4457
|
-
|
|
4456
|
+
import_outbound_react5.OutboundLink,
|
|
4458
4457
|
{
|
|
4459
4458
|
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",
|
|
4460
4459
|
href,
|
|
4461
|
-
target: "_blank",
|
|
4462
|
-
rel: "noreferrer",
|
|
4463
4460
|
title: value,
|
|
4464
4461
|
"data-records-link-chip": "",
|
|
4465
4462
|
onClick: (event) => event.stopPropagation(),
|
|
@@ -7371,6 +7368,8 @@ function NewColumnDefault({
|
|
|
7371
7368
|
}
|
|
7372
7369
|
|
|
7373
7370
|
// src/buttonCell.tsx
|
|
7371
|
+
var import_outbound_react6 = require("@ai-matrx/kit/outbound-react");
|
|
7372
|
+
var import_outbound = require("@ai-matrx/kit/outbound");
|
|
7374
7373
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
7375
7374
|
function buttonPressWords(label, pressed) {
|
|
7376
7375
|
if (pressed.do === "open_url") return `${label} opened ${pressed.url}`;
|
|
@@ -7401,7 +7400,7 @@ function ButtonValue({ field, recordId, inCell }) {
|
|
|
7401
7400
|
if (!answered.ok) return setSaid({ kind: "refused", error: answered.error });
|
|
7402
7401
|
const pressed = answered.data;
|
|
7403
7402
|
if (pressed.do === "open_url") {
|
|
7404
|
-
const opened = typeof window !== "undefined" ?
|
|
7403
|
+
const opened = typeof window !== "undefined" ? (0, import_outbound.openOutbound)(pressed.url, "_blank", "noopener") : null;
|
|
7405
7404
|
return setSaid({ kind: "ran", says: opened ? `${b.label} opened.` : `${b.label} is ready:`, link: pressed.url });
|
|
7406
7405
|
}
|
|
7407
7406
|
setSaid({ kind: "ran", says: buttonPressWords(b.label, pressed) });
|
|
@@ -7435,7 +7434,7 @@ function ButtonValue({ field, recordId, inCell }) {
|
|
|
7435
7434
|
said2?.kind === "ran" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("p", { className: "break-words", children: [
|
|
7436
7435
|
said2.says,
|
|
7437
7436
|
" ",
|
|
7438
|
-
said2.link ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
7437
|
+
said2.link ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_outbound_react6.OutboundLink, { href: said2.link, className: "text-primary underline", children: said2.link }) : null
|
|
7439
7438
|
] }) : null,
|
|
7440
7439
|
said2?.kind === "needs" ? /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
|
|
7441
7440
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("p", { children: said2.says }),
|