@ai-matrx/records-ui 0.116.26 → 0.116.27

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/dist/index.cjs CHANGED
@@ -14011,6 +14011,15 @@ function RelationPicker({ field: field2, value, onChange, disabled, id, classNam
14011
14011
  );
14012
14012
  }
14013
14013
 
14014
+ // src/readableLink.ts
14015
+ function readableLink(raw) {
14016
+ try {
14017
+ return decodeURI(raw).replace(/%40/gi, "@");
14018
+ } catch {
14019
+ return raw;
14020
+ }
14021
+ }
14022
+
14014
14023
  // src/buttonCell.tsx
14015
14024
  var import_react89 = require("react");
14016
14025
  var import_design_system53 = require("@ai-matrx/design-system");
@@ -14762,7 +14771,7 @@ function RatingStars({
14762
14771
  function rich(id, text, raw, format) {
14763
14772
  switch (id) {
14764
14773
  case "email":
14765
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate", children: text }) });
14774
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("a", { href: `mailto:${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate", children: readableLink(text) }) });
14766
14775
  case "url":
14767
14776
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_outbound_react3.OutboundLink, { href: text.includes("://") ? text : `https://${text}`, className: LINK, onClick: own2, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("span", { className: "truncate", children: text }) });
14768
14777
  case "phone":
@@ -15991,7 +16000,7 @@ function Scalar({ value, keyName, dense }) {
15991
16000
  if (isImageUrl(text, keyName)) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Thumb, { src: text, size: dense ? "sm" : "md" });
15992
16001
  if (isUrl(text)) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(LinkChip, { href: text, dense });
15993
16002
  if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(text)) {
15994
- return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("a", { href: `mailto:${text}`, onClick: stop, className: "text-primary underline-offset-2 hover:underline", children: text });
16003
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("a", { href: `mailto:${text}`, onClick: stop, className: "text-primary underline-offset-2 hover:underline", children: readableLink(text) });
15995
16004
  }
15996
16005
  const date = dateWords(text);
15997
16006
  if (date) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { title: text, children: date });
@@ -16300,7 +16309,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look, ro
16300
16309
  {
16301
16310
  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",
16302
16311
  href,
16303
- title: value,
16312
+ title: readableLink(value),
16304
16313
  "data-records-link-chip": "",
16305
16314
  onClick: (event) => event.stopPropagation(),
16306
16315
  children: [
@@ -16324,7 +16333,7 @@ function renderValue(field2, value, document2, labels, stillWaitingFor, look, ro
16324
16333
  );
16325
16334
  }
16326
16335
  if (kind2 === "email" && typeof value === "string") {
16327
- return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("a", { className: "truncate text-primary underline-offset-2 hover:underline", href: `mailto:${value}`, children: value });
16336
+ return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("a", { className: "truncate text-primary underline-offset-2 hover:underline", href: `mailto:${value}`, children: readableLink(value) });
16328
16337
  }
16329
16338
  if (typeof value === "boolean") {
16330
16339
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: kind2 === "checkbox" ? "text-sm" : "", title: value ? "Yes" : "No", children: value ? "\u2713" : "\u2014" });
@@ -19414,7 +19423,7 @@ var import_outbound_react7 = require("@ai-matrx/kit/outbound-react");
19414
19423
  var import_outbound2 = require("@ai-matrx/kit/outbound");
19415
19424
  var import_jsx_runtime62 = require("react/jsx-runtime");
19416
19425
  function buttonPressWords(label, pressed) {
19417
- if (pressed.do === "open_url") return `${label} opened ${pressed.url}`;
19426
+ if (pressed.do === "open_url") return `${label} opened ${readableLink(pressed.url)}`;
19418
19427
  if (pressed.do === "add_row") return `${label}: a row was added.`;
19419
19428
  if (pressed.do === "run_action") {
19420
19429
  const n = Number(pressed.result?.ran ?? 1);
@@ -19628,7 +19637,7 @@ function ButtonValue({ field: field2, recordId, inCell, beforeSave }) {
19628
19637
  said2.value ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(StructuredValueView, { structured: said2.value, label: b.label }) : null,
19629
19638
  said2.says,
19630
19639
  " ",
19631
- said2.link ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_outbound_react7.OutboundLink, { href: said2.link, className: "text-primary underline", children: said2.link }) : null
19640
+ said2.link ? /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_outbound_react7.OutboundLink, { href: said2.link, className: "text-primary underline", children: readableLink(said2.link) }) : null
19632
19641
  ] }) : null,
19633
19642
  said2?.kind === "needs" ? /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(import_jsx_runtime62.Fragment, { children: [
19634
19643
  /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { children: said2.says }),