@protobase/ui 0.23.1 → 0.23.2

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.
@@ -13,6 +13,7 @@ import { Field } from "../record-view/field.js";
13
13
  import { Section } from "../record-view/section.js";
14
14
  import { MetadataCard } from "../record-view/record-sidebar.js";
15
15
  import { RecordHeader } from "../record-view/record-header.js";
16
+ import { markdownExcerpt } from "../markdown/markdown-excerpt.js";
16
17
  import { isMarkdown } from "../markdown/markdown-hint.js";
17
18
  import { recordTitle } from "../live/model-helpers.js";
18
19
  import { contactFormat } from "../live/contact-links.js";
@@ -32,7 +33,6 @@ import { ErrorBanner } from "./error-banner.js";
32
33
  import { useProjectUi } from "./pages/project-ui.js";
33
34
  import { shownWidget } from "./field-types/shown-widget.js";
34
35
  import { WidgetPart } from "./field-types/widget-part.js";
35
- import { Markdown } from "../markdown/markdown.js";
36
36
  import { ContactLink } from "../live/contact-link.js";
37
37
  import { FieldEditor } from "./field-editor.js";
38
38
  import { fieldMessage } from "./field-errors.js";
@@ -303,25 +303,24 @@ const LoadedRecord = ({ model, recordKey, stored, preview }) => {
303
303
  label: hint(name)?.label ?? humanize(name),
304
304
  value: /* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-24" })
305
305
  }];
306
- const text = displayValue(field, stored.record[name], hint(name));
307
306
  const value = stored.record[name];
308
- const markdown = isMarkdown(field, hint(name)) && typeof value === "string" && value !== "";
307
+ const text = isMarkdown(field, hint(name)) && typeof value === "string" && value !== "" ? markdownExcerpt(value) : displayValue(field, value, hint(name));
309
308
  const contact = field.type === "text" && typeof value === "string" && value !== "" ? contactFormat(hint(name)) : void 0;
310
309
  const builtIn = field.type === "enum" ? /* @__PURE__ */ jsx(ValueBadge, {
311
310
  value,
312
311
  hints: hint(name),
313
312
  children: text
314
- }) : markdown ? /* @__PURE__ */ jsx(Markdown, { source: value }) : contact ? /* @__PURE__ */ jsx(ContactLink, {
313
+ }) : contact ? /* @__PURE__ */ jsx(ContactLink, {
315
314
  format: contact,
316
315
  value: text
317
316
  }) : /* @__PURE__ */ jsx("strong", {
318
317
  title: valueTitle(field, value, void 0, hint(name)),
319
- className: hint(name)?.multiline ? "whitespace-pre-line break-words" : void 0,
320
318
  children: text
321
319
  });
322
320
  const shown = shownWidget(fieldTypes, field, hint(name));
323
321
  return [{
324
322
  label: hint(name)?.label ?? humanize(name),
323
+ title: text,
325
324
  value: shown ? /* @__PURE__ */ jsx(WidgetPart, {
326
325
  shown,
327
326
  part: "display",
package/dist/package.js CHANGED
@@ -1,5 +1,5 @@
1
1
  //#region package.json
2
- var version = "0.23.1";
2
+ var version = "0.23.2";
3
3
  var protobase = { "pluginApi": 1 };
4
4
  //#endregion
5
5
  export { protobase, version };
@@ -2,14 +2,15 @@ import "lucide-react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  //#region src/record-view/record-sidebar.tsx
4
4
  const MetadataList = ({ rows }) => /* @__PURE__ */ jsx("dl", {
5
- className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-2",
5
+ className: "grid grid-cols-[auto_minmax(0,1fr)] gap-x-4 gap-y-2",
6
6
  children: rows.map((row) => /* @__PURE__ */ jsxs("div", {
7
7
  className: "contents",
8
8
  children: [/* @__PURE__ */ jsx("dt", {
9
9
  className: "text-muted-foreground",
10
10
  children: row.label
11
11
  }), /* @__PURE__ */ jsx("dd", {
12
- className: "text-right tabular-nums text-foreground",
12
+ title: row.title,
13
+ className: "truncate text-right tabular-nums text-foreground",
13
14
  children: row.value
14
15
  })]
15
16
  }, row.label))