@ai-matrx/records-ui 0.93.140 → 0.93.142

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
@@ -400,21 +400,35 @@ import {
400
400
  fieldKindFor,
401
401
  newerKindOf as newerKindOf2
402
402
  } from "@ai-matrx/records";
403
+ import { humanizeIdentifier } from "@ai-matrx/kit/text-case";
404
+
405
+ // src/docs.ts
406
+ function isSignatureField(field) {
407
+ return field.type === "text" && (field.format ?? "").toLowerCase() === "signature";
408
+ }
409
+
410
+ // src/parity.ts
411
+ var kernelId = (name) => KERNEL_TABLES.find((t) => t.name === name)?.id ?? "";
412
+ var KERNEL_FILE_TABLE = kernelId("File");
413
+ var KERNEL_PERSON_TABLE = kernelId("Person");
414
+ var PARITY_MADE_OF = Object.fromEntries(
415
+ PARITY_FIELD_TYPES.map((p) => [p.parity_type, p.made_of])
416
+ );
417
+ var KERNEL = { file: KERNEL_FILE_TABLE, person: KERNEL_PERSON_TABLE };
418
+ function editorKindFor(field) {
419
+ return fieldKindFor(field, KERNEL);
420
+ }
403
421
 
404
422
  // src/names.ts
405
423
  import { isUuidShape } from "@ai-matrx/kit/uuid";
406
- function humanize(token) {
407
- const words = token.replace(/[_\-.]+/g, " ").replace(/([a-z0-9])([A-Z])/g, "$1 $2").trim();
408
- if (words === "") return token;
409
- return words.charAt(0).toUpperCase() + words.slice(1);
410
- }
424
+ import { humanizeIdentifier as humanizeIdentifier2 } from "@ai-matrx/kit/text-case";
411
425
  function fieldName(field) {
412
426
  const label = (field.label ?? "").trim();
413
- if (label !== "" && label === field.key && /^[a-z0-9]+(?:[_.-][a-z0-9]+)+$/.test(label)) return humanize(label);
427
+ if (label !== "" && label === field.key && /^[a-z0-9]+(?:[_.-][a-z0-9]+)+$/.test(label)) return humanizeIdentifier2(label);
414
428
  if (label !== "") return label;
415
429
  const name = (field.name ?? "").trim();
416
430
  if (name !== "") return name;
417
- return humanize(field.key);
431
+ return humanizeIdentifier2(field.key);
418
432
  }
419
433
  function recordName(document2, titleKey, fallback = "Untitled") {
420
434
  const data = document2 ?? {};
@@ -438,23 +452,6 @@ function rowNameIn(table, row, fallback = "Untitled") {
438
452
  }
439
453
  var WITHHELD_RECORD_LABEL = "A record you have not been given access to";
440
454
 
441
- // src/docs.ts
442
- function isSignatureField(field) {
443
- return field.type === "text" && (field.format ?? "").toLowerCase() === "signature";
444
- }
445
-
446
- // src/parity.ts
447
- var kernelId = (name) => KERNEL_TABLES.find((t) => t.name === name)?.id ?? "";
448
- var KERNEL_FILE_TABLE = kernelId("File");
449
- var KERNEL_PERSON_TABLE = kernelId("Person");
450
- var PARITY_MADE_OF = Object.fromEntries(
451
- PARITY_FIELD_TYPES.map((p) => [p.parity_type, p.made_of])
452
- );
453
- var KERNEL = { file: KERNEL_FILE_TABLE, person: KERNEL_PERSON_TABLE };
454
- function editorKindFor(field) {
455
- return fieldKindFor(field, KERNEL);
456
- }
457
-
458
455
  // src/RelationPicker.tsx
459
456
  import { useEffect as useEffect3, useMemo, useState as useState3 } from "react";
460
457
  import { rankTypedMatches } from "@ai-matrx/records";
@@ -4199,6 +4196,7 @@ import { Badge as Badge4, cn as cn14 } from "@ai-matrx/design-system";
4199
4196
 
4200
4197
  // src/kindValues.ts
4201
4198
  import { tryDecodeDirective } from "@ai-matrx/content-ir/directives";
4199
+ import { humanizeIdentifier as humanizeIdentifier3 } from "@ai-matrx/kit/text-case";
4202
4200
  var KIND_KEY = "__kind";
4203
4201
  var WHOLE_FENCE = /^\s*```(?:matrx|json)?[ \t]*\r?\n?([\s\S]*?)\r?\n?[ \t]*```\s*$/;
4204
4202
  function asObject(value) {
@@ -4244,8 +4242,7 @@ function kindValueWords(kv) {
4244
4242
  return kindLabel(kv.kind);
4245
4243
  }
4246
4244
  function kindLabel(kind) {
4247
- const words = kind.replace(/^directive_v\d+_/, "").replace(/_v\d+$/, "").replace(/_/g, " ").trim();
4248
- return words ? words.charAt(0).toUpperCase() + words.slice(1) : "Structured value";
4245
+ return humanizeIdentifier3(kind.replace(/^directive_v\d+_/, "").replace(/_v\d+$/, "")) || "Structured value";
4249
4246
  }
4250
4247
 
4251
4248
  // src/ReferenceChips.tsx