@ai-matrx/records 0.77.1 → 0.77.3

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/app-table/index.cjs +7 -6
  3. package/dist/app-table/index.cjs.map +1 -1
  4. package/dist/app-table/index.d.cts +3 -3
  5. package/dist/app-table/index.d.ts +3 -3
  6. package/dist/app-table/index.js +7 -6
  7. package/dist/app-table/index.js.map +1 -1
  8. package/dist/{client-BcGGEpNi.d.cts → client-DZ3UcU4_.d.cts} +1 -1
  9. package/dist/{client-BbzLb-sB.d.ts → client-ZIxyAOdh.d.ts} +1 -1
  10. package/dist/core/index.cjs +12 -8
  11. package/dist/core/index.cjs.map +1 -1
  12. package/dist/core/index.d.cts +4 -4
  13. package/dist/core/index.d.ts +4 -4
  14. package/dist/core/index.js +12 -8
  15. package/dist/core/index.js.map +1 -1
  16. package/dist/data/index.cjs +4 -3
  17. package/dist/data/index.cjs.map +1 -1
  18. package/dist/data/index.d.cts +2 -2
  19. package/dist/data/index.d.ts +2 -2
  20. package/dist/data/index.js +4 -3
  21. package/dist/data/index.js.map +1 -1
  22. package/dist/{declareTable-COEPJpke.d.cts → declareTable-BYZdFrt5.d.cts} +2 -2
  23. package/dist/{declareTable-Dxq0Aega.d.ts → declareTable-DGSJMqGx.d.ts} +2 -2
  24. package/dist/index.cjs +8 -4
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.d.cts +2 -2
  27. package/dist/index.d.ts +2 -2
  28. package/dist/index.js +8 -4
  29. package/dist/index.js.map +1 -1
  30. package/dist/memory/index.cjs +4 -1
  31. package/dist/memory/index.cjs.map +1 -1
  32. package/dist/memory/index.js +4 -1
  33. package/dist/memory/index.js.map +1 -1
  34. package/dist/react/index.cjs +13 -9
  35. package/dist/react/index.cjs.map +1 -1
  36. package/dist/react/index.d.cts +6 -1
  37. package/dist/react/index.d.ts +6 -1
  38. package/dist/react/index.js +13 -9
  39. package/dist/react/index.js.map +1 -1
  40. package/dist/{table-kind-C5jsmotR.d.ts → table-kind-Da21ZLdJ.d.ts} +6 -1
  41. package/dist/{table-kind-DrVhYZbX.d.cts → table-kind-HAQ6WNxZ.d.cts} +6 -1
  42. package/dist/templates/index.cjs +4 -2
  43. package/dist/templates/index.cjs.map +1 -1
  44. package/dist/templates/index.js +4 -2
  45. package/dist/templates/index.js.map +1 -1
  46. package/package.json +4 -4
@@ -6081,7 +6081,12 @@ declare function emptyArchiveLine(lane: ArchiveLane): string;
6081
6081
  declare function sameDocument(a: RecordDocument, b: RecordDocument): boolean;
6082
6082
 
6083
6083
  /** `public.permission_level`, in the store's own order. */
6084
- type PermissionLevel = "viewer" | "commenter" | "editor" | "admin";
6084
+ /**
6085
+ * `edit_content` (Notion's "Can edit content") sits between `commenter` and `editor`: it may change
6086
+ * the rows and page content of a thing, never its structure (columns, views, settings) or its
6087
+ * sharing — those stay with `editor` and `admin`.
6088
+ */
6089
+ type PermissionLevel = "viewer" | "commenter" | "edit_content" | "editor" | "admin";
6085
6090
  /** The order the store writes them in, lowest first. */
6086
6091
  declare const PERMISSION_LEVELS: readonly PermissionLevel[];
6087
6092
  /** Whether `held` is the same rung as `needed` or a higher one. Nothing held is never enough. */
@@ -6081,7 +6081,12 @@ declare function emptyArchiveLine(lane: ArchiveLane): string;
6081
6081
  declare function sameDocument(a: RecordDocument, b: RecordDocument): boolean;
6082
6082
 
6083
6083
  /** `public.permission_level`, in the store's own order. */
6084
- type PermissionLevel = "viewer" | "commenter" | "editor" | "admin";
6084
+ /**
6085
+ * `edit_content` (Notion's "Can edit content") sits between `commenter` and `editor`: it may change
6086
+ * the rows and page content of a thing, never its structure (columns, views, settings) or its
6087
+ * sharing — those stay with `editor` and `admin`.
6088
+ */
6089
+ type PermissionLevel = "viewer" | "commenter" | "edit_content" | "editor" | "admin";
6085
6090
  /** The order the store writes them in, lowest first. */
6086
6091
  declare const PERMISSION_LEVELS: readonly PermissionLevel[];
6087
6092
  /** Whether `held` is the same rung as `needed` or a higher one. Nothing held is never enough. */
@@ -707,14 +707,16 @@ function moveConsequence(home, to) {
707
707
  var PERMISSION_LEVELS = [
708
708
  "viewer",
709
709
  "commenter",
710
+ "edit_content",
710
711
  "editor",
711
712
  "admin"
712
713
  ];
713
714
  var ORDINAL = {
714
715
  viewer: 1,
715
716
  commenter: 2,
716
- editor: 3,
717
- admin: 4
717
+ edit_content: 3,
718
+ editor: 4,
719
+ admin: 5
718
720
  };
719
721
  function atLeast(held, needed) {
720
722
  if (!held) return false;
@@ -9850,7 +9852,7 @@ function createTableDataPort({ client, aliases }) {
9850
9852
  const levels = await seat(binding).myLevels({ ids: [binding.tableId] });
9851
9853
  level = levels.ok ? levels.data[0]?.level ?? null : null;
9852
9854
  }
9853
- const may = atLeast(level, "editor");
9855
+ const may = atLeast(level, "edit_content");
9854
9856
  out.push({ alias, label: binding.label ?? table.data?.name ?? alias, kind: "table", canCreate: may, canUpdate: may });
9855
9857
  }
9856
9858
  return { ok: true, data: out };
@@ -10555,6 +10557,7 @@ function useStoreTable(table, options = {}) {
10555
10557
  }
10556
10558
 
10557
10559
  // src/app-table/graduate.ts
10560
+ import { isUuidShape as isUuidShape5 } from "@ai-matrx/kit/uuid";
10558
10561
  var TO_CUSTOM_FIELDS = "custom_fields";
10559
10562
  var TO_ASSOCIATION = "association";
10560
10563
  var GRADUATION_BASE_COLUMNS = [
@@ -10614,10 +10617,9 @@ function graduationProblems(fields, graduation) {
10614
10617
  }
10615
10618
  return problems;
10616
10619
  }
10617
- var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
10618
10620
  function idsOf(value) {
10619
10621
  const list = Array.isArray(value) ? value : value === null || value === void 0 ? [] : [value];
10620
- return list.filter((v) => typeof v === "string" && UUID.test(v));
10622
+ return list.filter((v) => typeof v === "string" && isUuidShape5(v));
10621
10623
  }
10622
10624
  function graduatedRow(fields, graduation, snapshot) {
10623
10625
  const row = {
@@ -11081,7 +11083,7 @@ function allowsOtherValues(field2) {
11081
11083
  }
11082
11084
 
11083
11085
  // src/retype.ts
11084
- import { isUuidShape as isUuidShape5 } from "@ai-matrx/kit/uuid";
11086
+ import { isUuidShape as isUuidShape6 } from "@ai-matrx/kit/uuid";
11085
11087
  var TRUE_WORDS2 = /* @__PURE__ */ new Set(["true", "t", "yes", "y", "1", "on", "x", "\u2713", "\u2714"]);
11086
11088
  var FALSE_WORDS2 = /* @__PURE__ */ new Set(["false", "f", "no", "n", "0", "off", "\u2610"]);
11087
11089
  function valueConverts(to, value) {
@@ -11102,7 +11104,7 @@ function valueConverts(to, value) {
11102
11104
  return text2.trim() !== "" && /^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i.test(text2.trim());
11103
11105
  case "list":
11104
11106
  case "relation":
11105
- return typeof value === "string" && isUuidShape5(text2);
11107
+ return typeof value === "string" && isUuidShape6(text2);
11106
11108
  default:
11107
11109
  return false;
11108
11110
  }
@@ -11553,6 +11555,9 @@ function scopeChip(scope) {
11553
11555
  return scope.title ? `About: ${scope.title}` : "About: this record";
11554
11556
  }
11555
11557
 
11558
+ // src/table-kind.ts
11559
+ import { isLowercaseUuidShape } from "@ai-matrx/kit/uuid";
11560
+
11556
11561
  // src/table-kind-mapping.json
11557
11562
  var table_kind_mapping_default = {
11558
11563
  about: "THE ONE MAPPING from a store Field to a kind's three schemas (KINDS-GLUE wave 3 \xA72). Hand-written here; aidream copies it verbatim to packages/matrx-graph/matrx_graph/table_kind_mapping.json (scripts/generate_table_kind_mapping.py --check). Both languages derive from this file only: @ai-matrx/records src/table-kind.ts and matrx_graph.table_kinds. Keys of `kinds` are the store's field kinds (custom.field_kinds() plus the formula `system` kinds custom.field_kind_of answers). Stored mode only: `column_source_default` is custom.table_column_source's answer when the facts carry none (silence means the doctrine: Field rows are the columns); `platform_keys` mirrors custom.record_platform_keys() with each key's shape (parent_id: custom.containment_parent's uuid cast; icon: the record's own @ai-matrx/icons name, a string or null); `stored_patterns` mirror custom.validate_values' relation id regex and, for dates, refuse a string the timestamptz cast can never read (no digits, not a special word) while never refusing one it can.",
@@ -11631,14 +11636,13 @@ var table_kind_mapping_default = {
11631
11636
 
11632
11637
  // src/table-kind.ts
11633
11638
  var TABLE_KIND_PREFIX = "table:";
11634
- var UUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
11635
11639
  var KIND_KEY = "__kind";
11636
11640
  var M = table_kind_mapping_default;
11637
11641
  function tableKindMapping() {
11638
11642
  return M;
11639
11643
  }
11640
11644
  function isTableKind(slug) {
11641
- return typeof slug === "string" && slug.startsWith(TABLE_KIND_PREFIX) && UUID2.test(slug.slice(TABLE_KIND_PREFIX.length));
11645
+ return typeof slug === "string" && slug.startsWith(TABLE_KIND_PREFIX) && isLowercaseUuidShape(slug.slice(TABLE_KIND_PREFIX.length));
11642
11646
  }
11643
11647
  function tableKindSlug(tableId) {
11644
11648
  const slug = `${TABLE_KIND_PREFIX}${String(tableId).trim().toLowerCase()}`;