@ai-matrx/records-ui 0.116.0 → 0.116.2

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 (51) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/dist/SaveToTable-3VDK4U5M.js +20 -0
  3. package/dist/chunk-32TUVT57.js +246 -0
  4. package/dist/chunk-32TUVT57.js.map +1 -0
  5. package/dist/chunk-B5S5F5NH.js +445 -0
  6. package/dist/chunk-B5S5F5NH.js.map +1 -0
  7. package/dist/chunk-IUUZVQZD.js +95 -0
  8. package/dist/chunk-IUUZVQZD.js.map +1 -0
  9. package/dist/{chunk-6NSGVKYL.js → chunk-NJYJEAQC.js} +1 -91
  10. package/dist/chunk-NJYJEAQC.js.map +1 -0
  11. package/dist/{chunk-4ZYGWYQP.js → chunk-QRZ4RW2T.js} +56 -31
  12. package/dist/chunk-QRZ4RW2T.js.map +1 -0
  13. package/dist/chunk-SPPATZSR.js +288 -0
  14. package/dist/chunk-SPPATZSR.js.map +1 -0
  15. package/dist/{chunk-7IZJT3DV.js → chunk-TCRNJVGZ.js} +93 -512
  16. package/dist/chunk-TCRNJVGZ.js.map +1 -0
  17. package/dist/{chunk-W5SOKJ5P.js → chunk-TNIC2SGW.js} +5 -3
  18. package/dist/{chunk-W5SOKJ5P.js.map → chunk-TNIC2SGW.js.map} +1 -1
  19. package/dist/{chunk-3OKHOGSO.js → chunk-VCAOXQ5K.js} +2 -283
  20. package/dist/chunk-VCAOXQ5K.js.map +1 -0
  21. package/dist/first-page.cjs.map +1 -1
  22. package/dist/first-page.js.map +1 -1
  23. package/dist/helpers.cjs +812 -8
  24. package/dist/helpers.cjs.map +1 -1
  25. package/dist/helpers.d.cts +441 -3
  26. package/dist/helpers.d.ts +441 -3
  27. package/dist/helpers.js +754 -10
  28. package/dist/helpers.js.map +1 -1
  29. package/dist/index.cjs +1634 -1581
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.d.cts +156 -168
  32. package/dist/index.d.ts +156 -168
  33. package/dist/index.js +4286 -4477
  34. package/dist/index.js.map +1 -1
  35. package/dist/object-actions.js +3 -2
  36. package/dist/pickers.cjs +52 -13
  37. package/dist/pickers.cjs.map +1 -1
  38. package/dist/pickers.js +6 -3
  39. package/dist/skeleton.cjs +262 -0
  40. package/dist/skeleton.cjs.map +1 -0
  41. package/dist/skeleton.d.cts +50 -0
  42. package/dist/skeleton.d.ts +50 -0
  43. package/dist/skeleton.js +26 -0
  44. package/dist/skeleton.js.map +1 -0
  45. package/package.json +18 -7
  46. package/dist/SaveToTable-AG7ZY4IG.js +0 -18
  47. package/dist/chunk-3OKHOGSO.js.map +0 -1
  48. package/dist/chunk-4ZYGWYQP.js.map +0 -1
  49. package/dist/chunk-6NSGVKYL.js.map +0 -1
  50. package/dist/chunk-7IZJT3DV.js.map +0 -1
  51. /package/dist/{SaveToTable-AG7ZY4IG.js.map → SaveToTable-3VDK4U5M.js.map} +0 -0
@@ -20,8 +20,9 @@ import {
20
20
  toDropdownEntries,
21
21
  toStripAndRows,
22
22
  withExtensions
23
- } from "./chunk-W5SOKJ5P.js";
24
- import "./chunk-6NSGVKYL.js";
23
+ } from "./chunk-TNIC2SGW.js";
24
+ import "./chunk-IUUZVQZD.js";
25
+ import "./chunk-NJYJEAQC.js";
25
26
  import "./chunk-HKYEHBQT.js";
26
27
  export {
27
28
  ACTION_CHECKING_ACCESS_REASON,
package/dist/pickers.cjs CHANGED
@@ -2132,6 +2132,16 @@ async function findUnfinishedTable(client, wantedName, wantedKeys, wantedRows, n
2132
2132
  }
2133
2133
  return null;
2134
2134
  }
2135
+ function choiceWordsOwed(existing, wanted) {
2136
+ const idOf = new Map(existing.map((f) => [f.key, f.id]));
2137
+ const owed = [];
2138
+ for (const f of wanted) {
2139
+ const fieldId = idOf.get(f.key);
2140
+ const words = [...new Set((f.options ?? []).map((w) => w.trim()).filter(Boolean))];
2141
+ if (f.type === "select" && fieldId && words.length > 0) owed.push({ fieldId, words });
2142
+ }
2143
+ return owed;
2144
+ }
2135
2145
  var UNFINISHED_WINDOW_MS, FILLED_WINDOW_MS;
2136
2146
  var init_unfinishedTable = __esm({
2137
2147
  "src/unfinishedTable.ts"() {
@@ -4021,7 +4031,7 @@ var init_ImportWizard = __esm({
4021
4031
  }
4022
4032
  });
4023
4033
 
4024
- // src/TablesHome.tsx
4034
+ // src/tableLanes.ts
4025
4035
  function platformOwned(table) {
4026
4036
  const t = table;
4027
4037
  return t.platform_owned === true || t.kept_by_the_app === true;
@@ -4041,7 +4051,16 @@ function shownToOnlyMe(table) {
4041
4051
  if (table.shown_to !== void 0) return table.shown_to === "only_me";
4042
4052
  return table.visibility === "personal";
4043
4053
  }
4044
- var import_react43, import_react44, import_core7, import_records16, import_design_system24, import_jsx_runtime26, PLATFORM_TABLE_PREFIX2;
4054
+ var PLATFORM_TABLE_PREFIX2;
4055
+ var init_tableLanes = __esm({
4056
+ "src/tableLanes.ts"() {
4057
+ "use strict";
4058
+ PLATFORM_TABLE_PREFIX2 = "records_ui_";
4059
+ }
4060
+ });
4061
+
4062
+ // src/TablesHome.tsx
4063
+ var import_react43, import_react44, import_core7, import_records16, import_design_system24, import_jsx_runtime26;
4045
4064
  var init_TablesHome = __esm({
4046
4065
  "src/TablesHome.tsx"() {
4047
4066
  "use strict";
@@ -4051,8 +4070,8 @@ var init_TablesHome = __esm({
4051
4070
  import_core7 = require("@ai-matrx/records/core");
4052
4071
  import_records16 = require("@ai-matrx/records");
4053
4072
  import_design_system24 = require("@ai-matrx/design-system");
4073
+ init_tableLanes();
4054
4074
  import_jsx_runtime26 = require("react/jsx-runtime");
4055
- PLATFORM_TABLE_PREFIX2 = "records_ui_";
4056
4075
  }
4057
4076
  });
4058
4077
 
@@ -4208,6 +4227,17 @@ function SaveToTable({ source, shapeIndex = 0, onOpenTable, onSaved, onClose, ma
4208
4227
  setPhase("ready");
4209
4228
  return;
4210
4229
  }
4230
+ const present = await client.fields({ table_id: newId });
4231
+ if (present.ok) {
4232
+ for (const owed of choiceWordsOwed(present.data, fields)) {
4233
+ const topped = await client.fieldUpdate({ field_id: owed.fieldId, patch: { options_add: owed.words } });
4234
+ if (!topped.ok) {
4235
+ setProblem(topped.error);
4236
+ setPhase("ready");
4237
+ return;
4238
+ }
4239
+ }
4240
+ }
4211
4241
  } else {
4212
4242
  tableName2 = freeName(name ?? proposedName, (tables.data ?? []).map((t) => t.name));
4213
4243
  const born = await (0, import_field_kinds5.declareTable)(client, { name: tableName2, fields });
@@ -5942,7 +5972,6 @@ var NOT_TYPED_BY_NAME = /* @__PURE__ */ new Set([
5942
5972
  "fx.sub",
5943
5973
  "fx.mul",
5944
5974
  "fx.div",
5945
- "fx.mod",
5946
5975
  "fx.neg",
5947
5976
  "fx.eq",
5948
5977
  "fx.ne",
@@ -10393,6 +10422,25 @@ function NewRowAction({
10393
10422
 
10394
10423
  // src/FieldEditor.tsx
10395
10424
  var import_records25 = require("@ai-matrx/records");
10425
+
10426
+ // src/standardFieldChoices.ts
10427
+ var import_field_kinds7 = require("@ai-matrx/records/field-kinds");
10428
+ init_fieldTypes();
10429
+ var STORE_BEHAVIOUR = new Map(import_field_kinds7.DECLARABLE_FIELD_KINDS.map((row) => [row.kind, row.behavior]));
10430
+ function holdsAValueOnAStandardTable(kind) {
10431
+ if (isSystemFieldKind(kind)) return false;
10432
+ const behaviour = STORE_BEHAVIOUR.get(kind);
10433
+ return behaviour !== void 0 && behaviour !== "formula";
10434
+ }
10435
+ var STANDARD_TABLE_FIELD_CHOICES = FIELD_TYPE_CHOICES.filter(
10436
+ (c) => holdsAValueOnAStandardTable(c.id)
10437
+ );
10438
+ var ADDABLE_TYPES = STANDARD_TABLE_FIELD_CHOICES.map((choice) => ({
10439
+ value: choice.id,
10440
+ label: choice.label
10441
+ }));
10442
+
10443
+ // src/FieldEditor.tsx
10396
10444
  var import_jsx_runtime38 = require("react/jsx-runtime");
10397
10445
  var RULE_KINDS = FIELD_RULE_KIND_VALUES.map((kind) => ({ kind, label: FIELD_RULE_KIND_LABEL[kind] }));
10398
10446
  var SENSITIVITIES = import_records25.FIELD_SENSITIVITIES.map((value) => ({ value, label: FIELD_SENSITIVITY_LABEL[value] }));
@@ -10409,15 +10457,6 @@ var FORMULA_OPERATIONS = FORMULA_OP_VALUES.map((value) => ({
10409
10457
  label: FORMULA_OP_LABEL[value],
10410
10458
  joins: FORMULA_OP_JOINS[value]
10411
10459
  }));
10412
- var STORE_BEHAVIOUR = new Map(import_records25.DECLARABLE_FIELD_KINDS.map((row) => [row.kind, row.behavior]));
10413
- function holdsAValueOnAStandardTable(kind) {
10414
- if (isSystemFieldKind(kind)) return false;
10415
- const behaviour = STORE_BEHAVIOUR.get(kind);
10416
- return behaviour !== void 0 && behaviour !== "formula";
10417
- }
10418
- var STANDARD_TABLE_FIELD_CHOICES = FIELD_TYPE_CHOICES.filter(
10419
- (c) => holdsAValueOnAStandardTable(c.id)
10420
- );
10421
10460
  var ADD_STANDARD_FIELD_SAVE_LABEL = "Create field";
10422
10461
  var KINDS_WITH_A_DEFAULT = /* @__PURE__ */ new Set([
10423
10462
  "text",