@ai-matrx/records-ui 0.115.100 → 0.115.101

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/pickers.cjs CHANGED
@@ -8442,9 +8442,8 @@ function renderValue(field, value, document2, labels, stillWaitingFor, look, roo
8442
8442
  if (Array.isArray(value)) {
8443
8443
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: "flex flex-wrap gap-1", children: value.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_design_system27.Badge, { variant: "secondary", className: "text-[11px]", children: scalarText(field, item, labels) }, `${String(item)}-${i}`)) });
8444
8444
  }
8445
- if ((kind === "text" || kind === "url") && typeof value === "string" && isImageUrl2(value)) {
8446
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ImageUrlValue, { url: value.trim(), alt: field.label || field.key, room });
8447
- }
8445
+ const pictureAt = imageAddressOf(field, value);
8446
+ if (pictureAt) return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(ImageUrlValue, { url: pictureAt, alt: field.label || field.key, room });
8448
8447
  if (kind === "url" && typeof value === "string") {
8449
8448
  const href = value.includes("://") ? value : `https://${value}`;
8450
8449
  return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(LinkPreviewCard, { url: href, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
@@ -8494,6 +8493,15 @@ function isImageUrl2(value) {
8494
8493
  }
8495
8494
  return /\.(png|jpe?g|gif|webp|avif|svg|bmp|ico)$/i.test(url.pathname) || /\/(images?|img)\//i.test(url.pathname);
8496
8495
  }
8496
+ function imageAddressOf(field, value) {
8497
+ if (typeof value !== "string") return null;
8498
+ const kind = editorKindFor(field);
8499
+ if (kind !== "text" && kind !== "url") return null;
8500
+ const text = value.trim();
8501
+ if (isImageUrl2(text)) return text;
8502
+ const named = /(^|[^a-z])(logo|image|img|photo|picture|avatar|thumbnail|headshot)s?([^a-z]|$)/i.test(`${field.label ?? ""} ${field.key}`);
8503
+ return named && /^https?:\/\/[^\s]+$/i.test(text) ? text : null;
8504
+ }
8497
8505
  function ImageUrlValue({ url, alt, room }) {
8498
8506
  const host = useRecordsUi();
8499
8507
  const box = room === "full" ? "size-24" : "size-6";