@ai-matrx/records-ui 0.115.105 → 0.115.107

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.js CHANGED
@@ -26,7 +26,7 @@ var __copyProps = (to, from, except, desc) => {
26
26
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
27
27
 
28
28
  // src/choiceLooks.ts
29
- import { newerKindOf } from "@ai-matrx/records/core";
29
+ import { newerKindOf } from "@ai-matrx/records/field-kinds";
30
30
  import { CHOICE_CHIP_CLASS, NEUTRAL_CHIP_CLASS, STYLE_COLORS } from "@ai-matrx/design-system/data-table/table-style";
31
31
  function displayFormatOf(field) {
32
32
  const raw = field.display_format;
@@ -296,7 +296,7 @@ var init_plainWords = __esm({
296
296
  });
297
297
 
298
298
  // src/rights.ts
299
- import { atLeast } from "@ai-matrx/records/core";
299
+ import { atLeast } from "@ai-matrx/records/field-kinds";
300
300
  function sentenceFor(what, level) {
301
301
  if (level === null) return NOTHING_AT_ALL;
302
302
  const need = LEVEL_WORD[NEEDS[what]];
@@ -660,7 +660,7 @@ var init_docs = __esm({
660
660
  });
661
661
 
662
662
  // src/fieldTypes.ts
663
- import { DECLARABLE_FIELD_KINDS, NEWER_FIELD_KINDS, PARITY_FIELD_TYPES } from "@ai-matrx/records/core";
663
+ import { DECLARABLE_FIELD_KINDS, NEWER_FIELD_KINDS, PARITY_FIELD_TYPES } from "@ai-matrx/records/field-kinds";
664
664
  function declaredAsLook(kind) {
665
665
  return kind in LOOK_KINDS && !storePublishesKind(kind);
666
666
  }
@@ -756,9 +756,9 @@ import {
756
756
  KERNEL_TABLES,
757
757
  PARITY_FIELD_TYPES as PARITY_FIELD_TYPES2,
758
758
  fieldKindFor,
759
- newerKindOf as newerKindOf3
760
- } from "@ai-matrx/records/core";
761
- import { isButtonField } from "@ai-matrx/records/core";
759
+ newerKindOf as newerKindOf3,
760
+ isButtonField
761
+ } from "@ai-matrx/records/field-kinds";
762
762
  import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
763
763
  function editorKindFor(field) {
764
764
  return fieldKindFor(field, KERNEL);
@@ -1174,12 +1174,11 @@ var init_refusals = __esm({
1174
1174
  // src/createTable.ts
1175
1175
  import {
1176
1176
  declareTable,
1177
- ensureTable,
1178
1177
  addFields,
1179
1178
  fieldDeclarationFor,
1180
1179
  tokenFor,
1181
1180
  DEFAULT_FIELDS
1182
- } from "@ai-matrx/records/core";
1181
+ } from "@ai-matrx/records/field-kinds";
1183
1182
  var init_createTable = __esm({
1184
1183
  "src/createTable.ts"() {
1185
1184
  "use strict";
@@ -5593,7 +5592,7 @@ function RelationPicker({ field, value, onChange, disabled, id, className, allow
5593
5592
  // src/buttonCell.tsx
5594
5593
  init_Refusal();
5595
5594
  import { useEffect as useEffect25, useRef as useRef16, useState as useState32 } from "react";
5596
- import { Button as Button20, Dialog as Dialog3, DialogContent as DialogContent3, DialogDescription, DialogHeader as DialogHeader3, DialogTitle as DialogTitle3, Popover as Popover5, PopoverContent as PopoverContent5, PopoverTrigger as PopoverTrigger5, cn as cn27 } from "@ai-matrx/design-system";
5595
+ import { Button as Button20, Dialog as Dialog3, ErrorBox as ErrorBox3, DialogContent as DialogContent3, DialogDescription, DialogHeader as DialogHeader3, DialogTitle as DialogTitle3, Popover as Popover5, PopoverContent as PopoverContent5, PopoverTrigger as PopoverTrigger5, cn as cn27 } from "@ai-matrx/design-system";
5597
5596
  import { CHOICE_CHIP_CLASS as CHOICE_CHIP_CLASS2, NEUTRAL_CHIP_CLASS as NEUTRAL_CHIP_CLASS2, isStyleColor as isStyleColor2 } from "@ai-matrx/design-system/data-table";
5598
5597
  import { buttonNeeds as buttonNeeds2, buttonOf as buttonOf2 } from "@ai-matrx/records";
5599
5598
  import { useOptionalRecordsClient as useOptionalRecordsClient11 } from "@ai-matrx/records/react";
@@ -5673,7 +5672,7 @@ init_tablePicking();
5673
5672
  init_names();
5674
5673
  import { useMemo as useMemo4, useState as useState8 } from "react";
5675
5674
  import { useFields, useRecords, useRecordsClient as useRecordsClient3 } from "@ai-matrx/records/react";
5676
- import { DOORS, doorReady } from "@ai-matrx/records/core";
5675
+ import { DOORS, doorReady, ensureTable } from "@ai-matrx/records/core";
5677
5676
  import {
5678
5677
  Button as Button5,
5679
5678
  Checkbox as Checkbox2,
@@ -6316,7 +6315,7 @@ init_parity();
6316
6315
  init_dates();
6317
6316
  import { COLOR_ROTATION, parseTableStyle, tableStyleIsEmpty } from "@ai-matrx/design-system/data-table/table-style";
6318
6317
  import { getFieldFormat } from "@ai-matrx/design-system/field-formats";
6319
- import { newerKindOf as newerKindOf4, ratingMaxOf } from "@ai-matrx/records/core";
6318
+ import { newerKindOf as newerKindOf4, ratingMaxOf } from "@ai-matrx/records/field-kinds";
6320
6319
  var DRAWN_KINDS = /* @__PURE__ */ new Set(["select", "multi_select", "relation", "member", "person", "attachment", "file", "entity_reference", "checkbox", "boolean", "signature", "json"]);
6321
6320
  function shownAsOf(field) {
6322
6321
  if (DRAWN_KINDS.has(String(editorKindFor(field)))) return void 0;
@@ -8218,14 +8217,19 @@ function Thumb({ src, size }) {
8218
8217
  }
8219
8218
  ) });
8220
8219
  }
8221
- function LinkChip({ href }) {
8220
+ function LinkChip({ href, dense }) {
8222
8221
  return /* @__PURE__ */ jsxs26(
8223
8222
  OutboundLink5,
8224
8223
  {
8225
8224
  href,
8226
8225
  title: href,
8227
8226
  onClick: stop,
8228
- 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",
8227
+ className: cn23(
8228
+ "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",
8229
+ // A percentage max-width means nothing inside an auto-layout table cell, so a link column would hold
8230
+ // its full address; in a table the chip gets a real ceiling and shortens with an ellipsis.
8231
+ dense && "max-w-[7rem]"
8232
+ ),
8229
8233
  "data-records-link-chip": "",
8230
8234
  children: [
8231
8235
  /* @__PURE__ */ jsx28("span", { "aria-hidden": "true", className: "text-muted-foreground", children: "\u2197" }),
@@ -8242,7 +8246,7 @@ function Scalar({ value, keyName, dense }) {
8242
8246
  if (typeof value !== "string") return /* @__PURE__ */ jsx28("span", { children: String(value) });
8243
8247
  const text = value.trim();
8244
8248
  if (isImageUrl(text, keyName)) return /* @__PURE__ */ jsx28(Thumb, { src: text, size: dense ? "sm" : "md" });
8245
- if (isUrl(text)) return /* @__PURE__ */ jsx28(LinkChip, { href: text });
8249
+ if (isUrl(text)) return /* @__PURE__ */ jsx28(LinkChip, { href: text, dense });
8246
8250
  if (/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(text)) {
8247
8251
  return /* @__PURE__ */ jsx28("a", { href: `mailto:${text}`, onClick: stop, className: "text-primary underline-offset-2 hover:underline", children: text });
8248
8252
  }
@@ -8260,8 +8264,8 @@ function RecordsTable({ items }) {
8260
8264
  const shown2 = all ? items : items.slice(0, TABLE_ROWS);
8261
8265
  return /* @__PURE__ */ jsxs26("div", { className: "min-w-0", "data-records-structured": "table", children: [
8262
8266
  /* @__PURE__ */ jsx28("div", { className: "max-w-full overflow-x-auto rounded-md border border-border", "data-records-structured-table-frame": "", children: /* @__PURE__ */ jsxs26("table", { className: "w-full border-collapse text-xs", children: [
8263
- /* @__PURE__ */ jsx28("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ jsx28("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ jsx28("th", { scope: "col", className: "whitespace-nowrap px-2 py-1 font-medium text-muted-foreground", children: keyWords(k) }, k)) }) }),
8264
- /* @__PURE__ */ jsx28("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ jsx28("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ jsx28("td", { className: "min-w-[4rem] max-w-[18rem] break-words px-2 py-1 [overflow-wrap:anywhere]", children: k in item ? /* @__PURE__ */ jsx28(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
8267
+ /* @__PURE__ */ jsx28("thead", { className: "bg-muted/60 text-left", children: /* @__PURE__ */ jsx28("tr", { children: pictureFirst.map((k) => /* @__PURE__ */ jsx28("th", { scope: "col", className: "px-2 py-1 font-medium text-muted-foreground [overflow-wrap:anywhere]", children: keyWords(k) }, k)) }) }),
8268
+ /* @__PURE__ */ jsx28("tbody", { children: shown2.map((item, i) => /* @__PURE__ */ jsx28("tr", { className: "border-t border-border/60 align-top", children: pictureFirst.map((k) => /* @__PURE__ */ jsx28("td", { className: "min-w-[2rem] max-w-[18rem] break-words px-2 py-1 [overflow-wrap:anywhere]", children: k in item ? /* @__PURE__ */ jsx28(Nested, { value: item[k], keyName: k, dense: true }) : /* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: "\u2014" }) }, k)) }, i)) })
8265
8269
  ] }) }),
8266
8270
  items.length > TABLE_ROWS ? /* @__PURE__ */ jsx28(Button14, { type: "button", variant: "ghost", size: "sm", className: "mt-1 h-6 px-2 text-xs", onClick: (e) => {
8267
8271
  stop(e);
@@ -11939,7 +11943,7 @@ function ButtonValue({ field, recordId, inCell }) {
11939
11943
  /* @__PURE__ */ jsxs37(PopoverContent5, { className: "w-72 space-y-2 p-3 text-sm", onClick: stop2, onPointerDown: stop2, "data-records-button-said": said2?.kind, children: [
11940
11944
  said2?.kind === "refused" ? /* @__PURE__ */ jsx39(RefusalLine, { error: said2.error }) : null,
11941
11945
  said2?.kind === "waiting" ? /* @__PURE__ */ jsx39("p", { className: "matrx-shimmer rounded px-1 py-0.5", role: "status", "aria-live": "polite", children: said2.says }) : null,
11942
- said2?.kind === "failed" ? /* @__PURE__ */ jsx39("p", { className: "break-words text-destructive", role: "alert", children: said2.says }) : null,
11946
+ said2?.kind === "failed" ? /* @__PURE__ */ jsx39(ErrorBox3, { as: "p", className: "break-words text-destructive", message: said2.says, origin: "records-ui/buttonCell", children: said2.says }) : null,
11943
11947
  said2?.kind === "public" ? /* @__PURE__ */ jsx39("p", { children: "Buttons run for signed-in people." }) : null,
11944
11948
  said2?.kind === "ran" ? /* @__PURE__ */ jsxs37("div", { className: "break-words", children: [
11945
11949
  said2.value ? /* @__PURE__ */ jsx39(StructuredValueView, { structured: said2.value, label: b.label }) : null,