@ai-matrx/records-ui 0.115.90 → 0.115.91

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.js CHANGED
@@ -2525,12 +2525,11 @@ function PersonPicker({ field: field2, value, onChange, disabled, id, className,
2525
2525
  ] });
2526
2526
  }
2527
2527
 
2528
+ // src/memberNames.ts
2529
+ import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
2530
+
2528
2531
  // src/userIds.ts
2529
- var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
2530
2532
  var PERSON_NOT_IN_ORGANIZATION = "A person no longer in this organization";
2531
- function isUserId(value) {
2532
- return typeof value === "string" && UUID.test(value);
2533
- }
2534
2533
 
2535
2534
  // src/memberNames.ts
2536
2535
  function memberWords(member) {
@@ -2576,7 +2575,7 @@ async function resolveKeptPerson(client, id, roster) {
2576
2575
  }
2577
2576
  function useKeptPeople(value, roster) {
2578
2577
  const client = useOptionalRecordsClient3();
2579
- const ids = useMemo4(() => (Array.isArray(value) ? value : [value]).filter(isUserId), [value]);
2578
+ const ids = useMemo4(() => (Array.isArray(value) ? value : [value]).filter(isUuidShape3), [value]);
2580
2579
  const key = ids.join(",");
2581
2580
  const [people, setPeople] = useState6(null);
2582
2581
  useEffect6(() => {
@@ -2596,10 +2595,11 @@ __reExport(recordVersions_exports, versions_star2);
2596
2595
  import * as versions_star2 from "@ai-matrx/records/versions";
2597
2596
 
2598
2597
  // src/personRetype.ts
2598
+ import { isUuidShape as isUuidShape4 } from "@ai-matrx/kit/uuid";
2599
2599
  var PAGE = 500;
2600
2600
  var CEILING = 2e4;
2601
2601
  function idsIn(value) {
2602
- return (Array.isArray(value) ? value : [value]).filter(isUserId);
2602
+ return (Array.isArray(value) ? value : [value]).filter(isUuidShape4);
2603
2603
  }
2604
2604
  async function readPersonColumn(client, tableId, key) {
2605
2605
  const out = [];
@@ -7239,6 +7239,7 @@ function withFormulaDisplayNow(field2, fields, kindOf, currencyCodeOf) {
7239
7239
 
7240
7240
  // src/values.tsx
7241
7241
  import { autonumberPrefixOf as autonumberPrefixOf2, autonumberWords as autonumberWords2, isButtonField as isButtonField2, newerKindWords, sourceArchivedOf as sourceArchivedOf2 } from "@ai-matrx/records";
7242
+ import { isUuidShape as isUuidShape7 } from "@ai-matrx/kit/uuid";
7242
7243
 
7243
7244
  // src/personNames.ts
7244
7245
  import { useSyncExternalStore as useSyncExternalStore2 } from "react";
@@ -7302,6 +7303,7 @@ import { ruleThatRefuses } from "@ai-matrx/records";
7302
7303
  import { useState as useState23 } from "react";
7303
7304
  import { useRecordsClient as useRecordsClient8 } from "@ai-matrx/records/react";
7304
7305
  import { Button as Button13 } from "@ai-matrx/design-system";
7306
+ import { isUuidShape as isUuidShape5 } from "@ai-matrx/kit/uuid";
7305
7307
  import { jsx as jsx28, jsxs as jsxs25 } from "react/jsx-runtime";
7306
7308
  function same(a, b) {
7307
7309
  return JSON.stringify(a) === JSON.stringify(b);
@@ -7381,7 +7383,7 @@ function RetiredValues({
7381
7383
  const field2 = fields.find((f) => f.key === entry.key);
7382
7384
  const name = field2 ? fieldName(field2) : entry.label ?? entry.key;
7383
7385
  const shown5 = field2 ? scalarText(field2, entry.value) : typeof entry.value === "string" ? entry.value : JSON.stringify(entry.value);
7384
- const holdsUserId = (Array.isArray(entry.value) ? entry.value : [entry.value]).some(isUserId);
7386
+ const holdsUserId = (Array.isArray(entry.value) ? entry.value : [entry.value]).some(isUuidShape5);
7385
7387
  return /* @__PURE__ */ jsxs25("div", { className: "flex flex-col gap-0.5", "data-records-retired-key": entry.key, children: [
7386
7388
  /* @__PURE__ */ jsxs25("div", { className: "flex flex-wrap items-baseline gap-2", children: [
7387
7389
  /* @__PURE__ */ jsx28("span", { className: "text-muted-foreground", children: name }),
@@ -7402,6 +7404,7 @@ function RetiredValues({
7402
7404
  }
7403
7405
 
7404
7406
  // src/cellMarks.tsx
7407
+ import { isUuidShape as isUuidShape6 } from "@ai-matrx/kit/uuid";
7405
7408
  import { jsx as jsx29 } from "react/jsx-runtime";
7406
7409
  function keptAsideFor(document2, key) {
7407
7410
  const doc = document2;
@@ -7431,7 +7434,7 @@ function keptAsideReason(field2, entry) {
7431
7434
  function KeptAsideValue({ field: field2, entry, shown: shown5 }) {
7432
7435
  const why = keptAsideReason(field2, entry);
7433
7436
  const open = useRecordsUi().openPerson;
7434
- const person = (Array.isArray(entry.value) ? entry.value : [entry.value]).find(isUserId);
7437
+ const person = (Array.isArray(entry.value) ? entry.value : [entry.value]).find(isUuidShape6);
7435
7438
  const opens = open && typeof person === "string";
7436
7439
  return /* @__PURE__ */ jsx29(
7437
7440
  "span",
@@ -7657,7 +7660,7 @@ function LivePersonChip({ id, name }) {
7657
7660
  var NEVER_AN_ID_KINDS = /* @__PURE__ */ new Set(["member", "person", "number", "currency", "percent", "date", "datetime", "checkbox", "boolean"]);
7658
7661
  function personWordsOf(kind2, value) {
7659
7662
  const items = Array.isArray(value) ? value : [value];
7660
- const ids = items.filter(isUserId);
7663
+ const ids = items.filter(isUuidShape7);
7661
7664
  if (ids.length === 0) return null;
7662
7665
  const wordsColumn = !NEVER_AN_ID_KINDS.has(kind2);
7663
7666
  const named = ids.map((id) => knownPerson(id));
@@ -42562,6 +42565,7 @@ function ActionInbox({
42562
42565
  }
42563
42566
 
42564
42567
  // src/HistoryPanel.tsx
42568
+ import { isUuidShape as isUuidShape8 } from "@ai-matrx/kit/uuid";
42565
42569
  import { useCallback as useCallback47, useEffect as useEffect98, useRef as useRef54, useState as useState116 } from "react";
42566
42570
 
42567
42571
  // src/undoChange.ts
@@ -43314,7 +43318,7 @@ function whenText(at) {
43314
43318
  function say(value, field2) {
43315
43319
  if (value === null || value === void 0 || value === "") return "nothing";
43316
43320
  if (field2) return scalarText(field2, value);
43317
- const ids = (Array.isArray(value) ? value : [value]).filter(isUserId);
43321
+ const ids = (Array.isArray(value) ? value : [value]).filter(isUuidShape8);
43318
43322
  if (ids.length > 0 && ids.length === (Array.isArray(value) ? value.length : 1)) {
43319
43323
  return ids.map((id) => knownPerson(id) ?? PERSON_NOT_IN_ORGANIZATION).join(", ");
43320
43324
  }
@@ -43324,6 +43328,7 @@ function say(value, field2) {
43324
43328
  }
43325
43329
 
43326
43330
  // src/CommentThread.tsx
43331
+ import { isUuidShape as isUuidShape9 } from "@ai-matrx/kit/uuid";
43327
43332
  import { useCallback as useCallback48, useEffect as useEffect99, useMemo as useMemo67, useRef as useRef55, useState as useState117 } from "react";
43328
43333
  import {
43329
43334
  useFields as useFields24,
@@ -43562,7 +43567,7 @@ function Line2({
43562
43567
  /* @__PURE__ */ jsx139("p", { className: "whitespace-pre-wrap text-xs", children: comment.body }),
43563
43568
  comment.mentions.length > 0 ? /* @__PURE__ */ jsxs127("p", { className: "text-[10px] text-muted-foreground", children: [
43564
43569
  "Told: ",
43565
- comment.mentions.map((m) => isUserId(m.name) ? PERSON_NOT_IN_ORGANIZATION : m.name).join(", ")
43570
+ comment.mentions.map((m) => isUuidShape9(m.name) ? PERSON_NOT_IN_ORGANIZATION : m.name).join(", ")
43566
43571
  ] }) : null
43567
43572
  ] });
43568
43573
  }
@@ -54030,7 +54035,7 @@ function useSlotScroll(slot) {
54030
54035
  }
54031
54036
 
54032
54037
  // src/TablePage.tsx
54033
- import { isUuidShape as isUuidShape3 } from "@ai-matrx/kit/uuid";
54038
+ import { isUuidShape as isUuidShape10 } from "@ai-matrx/kit/uuid";
54034
54039
  import { openOutbound as openOutbound4 } from "@ai-matrx/kit/outbound";
54035
54040
  import { Fragment as Fragment72, jsx as jsx178, jsxs as jsxs166 } from "react/jsx-runtime";
54036
54041
  var RAIL_TITLE = {
@@ -54262,7 +54267,7 @@ function openingView(activeView, activeDashboardId) {
54262
54267
  }
54263
54268
  function savedViewFromParam(activeView) {
54264
54269
  const word = typeof activeView === "string" ? activeView.trim() : "";
54265
- return isUuidShape3(word) ? word.toLowerCase() : null;
54270
+ return isUuidShape10(word) ? word.toLowerCase() : null;
54266
54271
  }
54267
54272
  function addressForView(view, layout) {
54268
54273
  return view && !view.isDefault ? view.id : layout;
@@ -55300,7 +55305,7 @@ function TablePage({
55300
55305
  QuestionPanel,
55301
55306
  {
55302
55307
  tableId,
55303
- activeQuestionId: questionsFromLink && activeItemId && isUuidShape3(activeItemId) ? activeItemId : null,
55308
+ activeQuestionId: questionsFromLink && activeItemId && isUuidShape10(activeItemId) ? activeItemId : null,
55304
55309
  draft: questionDraft
55305
55310
  }
55306
55311
  ) : main === "archived" ? (