@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
@@ -989,14 +989,16 @@ function moveConsequence(home, to) {
989
989
  var PERMISSION_LEVELS = [
990
990
  "viewer",
991
991
  "commenter",
992
+ "edit_content",
992
993
  "editor",
993
994
  "admin"
994
995
  ];
995
996
  var ORDINAL = {
996
997
  viewer: 1,
997
998
  commenter: 2,
998
- editor: 3,
999
- admin: 4
999
+ edit_content: 3,
1000
+ editor: 4,
1001
+ admin: 5
1000
1002
  };
1001
1003
  function atLeast(held, needed) {
1002
1004
  if (!held) return false;
@@ -10132,7 +10134,7 @@ function createTableDataPort({ client, aliases }) {
10132
10134
  const levels = await seat(binding).myLevels({ ids: [binding.tableId] });
10133
10135
  level = levels.ok ? levels.data[0]?.level ?? null : null;
10134
10136
  }
10135
- const may = atLeast(level, "editor");
10137
+ const may = atLeast(level, "edit_content");
10136
10138
  out.push({ alias, label: binding.label ?? table.data?.name ?? alias, kind: "table", canCreate: may, canUpdate: may });
10137
10139
  }
10138
10140
  return { ok: true, data: out };
@@ -10830,6 +10832,7 @@ function useStoreTable(table, options = {}) {
10830
10832
  }
10831
10833
 
10832
10834
  // src/app-table/graduate.ts
10835
+ var import_uuid5 = require("@ai-matrx/kit/uuid");
10833
10836
  var TO_CUSTOM_FIELDS = "custom_fields";
10834
10837
  var TO_ASSOCIATION = "association";
10835
10838
  var GRADUATION_BASE_COLUMNS = [
@@ -10889,10 +10892,9 @@ function graduationProblems(fields, graduation) {
10889
10892
  }
10890
10893
  return problems;
10891
10894
  }
10892
- var UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
10893
10895
  function idsOf(value) {
10894
10896
  const list = Array.isArray(value) ? value : value === null || value === void 0 ? [] : [value];
10895
- return list.filter((v) => typeof v === "string" && UUID.test(v));
10897
+ return list.filter((v) => typeof v === "string" && (0, import_uuid5.isUuidShape)(v));
10896
10898
  }
10897
10899
  function graduatedRow(fields, graduation, snapshot) {
10898
10900
  const row = {
@@ -11356,7 +11358,7 @@ function allowsOtherValues(field2) {
11356
11358
  }
11357
11359
 
11358
11360
  // src/retype.ts
11359
- var import_uuid5 = require("@ai-matrx/kit/uuid");
11361
+ var import_uuid6 = require("@ai-matrx/kit/uuid");
11360
11362
  var TRUE_WORDS2 = /* @__PURE__ */ new Set(["true", "t", "yes", "y", "1", "on", "x", "\u2713", "\u2714"]);
11361
11363
  var FALSE_WORDS2 = /* @__PURE__ */ new Set(["false", "f", "no", "n", "0", "off", "\u2610"]);
11362
11364
  function valueConverts(to, value) {
@@ -11377,7 +11379,7 @@ function valueConverts(to, value) {
11377
11379
  return text2.trim() !== "" && /^[+-]?(\d+\.?\d*|\.\d+)(e[+-]?\d+)?$/i.test(text2.trim());
11378
11380
  case "list":
11379
11381
  case "relation":
11380
- return typeof value === "string" && (0, import_uuid5.isUuidShape)(text2);
11382
+ return typeof value === "string" && (0, import_uuid6.isUuidShape)(text2);
11381
11383
  default:
11382
11384
  return false;
11383
11385
  }
@@ -11828,6 +11830,9 @@ function scopeChip(scope) {
11828
11830
  return scope.title ? `About: ${scope.title}` : "About: this record";
11829
11831
  }
11830
11832
 
11833
+ // src/table-kind.ts
11834
+ var import_uuid7 = require("@ai-matrx/kit/uuid");
11835
+
11831
11836
  // src/table-kind-mapping.json
11832
11837
  var table_kind_mapping_default = {
11833
11838
  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.",
@@ -11906,14 +11911,13 @@ var table_kind_mapping_default = {
11906
11911
 
11907
11912
  // src/table-kind.ts
11908
11913
  var TABLE_KIND_PREFIX = "table:";
11909
- var UUID2 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
11910
11914
  var KIND_KEY = "__kind";
11911
11915
  var M = table_kind_mapping_default;
11912
11916
  function tableKindMapping() {
11913
11917
  return M;
11914
11918
  }
11915
11919
  function isTableKind(slug) {
11916
- return typeof slug === "string" && slug.startsWith(TABLE_KIND_PREFIX) && UUID2.test(slug.slice(TABLE_KIND_PREFIX.length));
11920
+ return typeof slug === "string" && slug.startsWith(TABLE_KIND_PREFIX) && (0, import_uuid7.isLowercaseUuidShape)(slug.slice(TABLE_KIND_PREFIX.length));
11917
11921
  }
11918
11922
  function tableKindSlug(tableId) {
11919
11923
  const slug = `${TABLE_KIND_PREFIX}${String(tableId).trim().toLowerCase()}`;