@nivaro/react 0.3.8 → 0.3.10

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 (60) hide show
  1. package/dist/components/fields/FileField.js +20 -19
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/replayUploadQueue.js +107 -93
  4. package/dist/hooks/useNivaroForm.js +129 -126
  5. package/dist/hooks/useSessionRecorder.js +103 -101
  6. package/dist/index.d.ts +115 -2
  7. package/dist/index.js +466 -447
  8. package/dist/shared/components/CollectionBrowserView.js +1058 -1059
  9. package/dist/shared/components/ConformanceView.js +36 -35
  10. package/dist/shared/components/DataTable.js +230 -223
  11. package/dist/shared/components/ForceReloadBanner.js +58 -34
  12. package/dist/shared/components/ItemEditForm.js +3687 -3580
  13. package/dist/shared/components/JsonMapEditor.js +18 -17
  14. package/dist/shared/components/MatrixEditor.js +8 -7
  15. package/dist/shared/components/MyWorkView.js +32 -31
  16. package/dist/shared/components/PageRenderer.js +146 -145
  17. package/dist/shared/components/QueryTable.js +49 -49
  18. package/dist/shared/components/RecordGridEditor.js +76 -75
  19. package/dist/shared/components/ai/AiMemorySuggestions.js +15 -14
  20. package/dist/shared/components/ai/AskPanel.js +55 -54
  21. package/dist/shared/components/bulk/BulkActionButtons.js +30 -29
  22. package/dist/shared/components/bulk/PushBulkButtons.js +57 -56
  23. package/dist/shared/components/chat/ChatPanel.js +288 -287
  24. package/dist/shared/components/chat/SlashCommands.js +30 -29
  25. package/dist/shared/components/chat/chat-outbox.js +76 -75
  26. package/dist/shared/components/help-videos/recorder/useLeaveWarning.js +6 -5
  27. package/dist/shared/components/integrations/console/SignalCard.js +124 -123
  28. package/dist/shared/components/integrations/console/SnoozeMenu.js +24 -23
  29. package/dist/shared/components/item-edit/CloneDialog.js +85 -78
  30. package/dist/shared/components/item-edit/InlineTableField.js +301 -300
  31. package/dist/shared/components/item-edit/MembershipSetField.js +24 -23
  32. package/dist/shared/components/item-edit/QuickCreateButton.js +8 -7
  33. package/dist/shared/components/item-edit/RecordLiveSync.js +101 -100
  34. package/dist/shared/components/item-edit/staged-links.js +86 -0
  35. package/dist/shared/components/layout-editor/LayoutEditor.js +275 -274
  36. package/dist/shared/components/layout-editor/editors/cascade-rule-row.js +18 -17
  37. package/dist/shared/components/layout-editor/inspector/HelpTab.js +37 -36
  38. package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +50 -49
  39. package/dist/shared/components/panels/CommentPanel.js +237 -236
  40. package/dist/shared/components/profile/AiMemoryCard.js +15 -14
  41. package/dist/shared/components/profile/PersonAdminTools.js +70 -67
  42. package/dist/shared/components/profile/usePersonPresence.js +42 -37
  43. package/dist/shared/components/queue/QueueItemSheet.js +36 -35
  44. package/dist/shared/components/queue/QueueWorklist.js +597 -598
  45. package/dist/shared/lib/client-version.js +63 -0
  46. package/dist/shared/lib/force-reload.js +36 -0
  47. package/dist/shared/lib/load-error.js +11 -10
  48. package/dist/shared/lib/presence-live.js +73 -0
  49. package/dist/shared/lib/presence-state.js +39 -31
  50. package/dist/shared/lib/record-outbox.js +76 -75
  51. package/dist/shared/lib/request-gate.js +120 -102
  52. package/dist/shared/lib/rum.js +45 -36
  53. package/dist/shared/lib/safe-error.js +39 -0
  54. package/dist/shared/lib/server-clock.js +11 -7
  55. package/dist/shared/lib/signed-out.js +114 -0
  56. package/dist/shared/lib/socket-realtime.js +19 -17
  57. package/dist/shared/lib/unsaved-work.js +62 -0
  58. package/dist/shared/lib/use-online-users.js +11 -10
  59. package/dist/shared/lib/worker-socket.js +89 -79
  60. package/package.json +1 -1
@@ -0,0 +1,86 @@
1
+ import { m2aWriteMeta as C } from "./M2MCombobox.js";
2
+ function F(n, l, s) {
3
+ var r;
4
+ let e = l.find((o) => o.one_collection === n && o.one_field === s);
5
+ if (!e && s.includes(".")) {
6
+ const o = s.slice(0, s.indexOf("."));
7
+ e = l.find(
8
+ (i) => i.one_collection === n && i.many_collection === o && !!i.one_field
9
+ );
10
+ }
11
+ if (!(e != null && e.one_field) || !e.many_collection) return null;
12
+ const c = e.junction_field ?? ((r = l.find((o) => o.many_collection === e.many_collection && o.id !== e.id)) == null ? void 0 : r.many_field) ?? null;
13
+ if (!c) return null;
14
+ const d = l.find(
15
+ (o) => o.many_collection === e.many_collection && o.many_field === c && o.id !== e.id
16
+ ), _ = C(d);
17
+ return { field: e.one_field, junctionField: c, m2aCollection: (_ == null ? void 0 : _.value) ?? null };
18
+ }
19
+ function O(n) {
20
+ return n == null || n === "" ? [] : Array.isArray(n) ? n : typeof n == "object" ? [] : [n];
21
+ }
22
+ const b = (n) => n && typeof n == "object" ? `${String(n.collection ?? "")}:${String(n.id ?? "")}` : `:${String(n)}`;
23
+ function E(n) {
24
+ var i;
25
+ const { collection: l, relations: s, links: e, unlinks: c, payload: d, isNew: _ } = n, r = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set([...e.keys(), ...c.keys()]);
26
+ for (const f of o) {
27
+ const g = e.get(f) ?? [], y = c.get(f) ?? /* @__PURE__ */ new Set();
28
+ if (g.length === 0 && y.size === 0) continue;
29
+ const u = F(l, s, f);
30
+ if (!u) continue;
31
+ const p = (t) => u.m2aCollection ? { collection: u.m2aCollection, id: t } : t;
32
+ if (_) {
33
+ if (y.size > 0) continue;
34
+ const t = [], m = /* @__PURE__ */ new Set();
35
+ for (const a of [...O(d[u.field]), ...g.map(p)]) {
36
+ const S = b(a);
37
+ m.has(S) || (m.add(S), t.push(a));
38
+ }
39
+ d[u.field] = t, r.add(f);
40
+ continue;
41
+ }
42
+ const h = (i = n.committed) == null ? void 0 : i.call(n, f);
43
+ let w = [];
44
+ if (y.size > 0) {
45
+ if (!h) continue;
46
+ const t = new Map(h.map((a) => [String(a.id), a])), m = [...y].map((a) => {
47
+ var S;
48
+ return (S = t.get(String(a))) == null ? void 0 : S[u.junctionField];
49
+ });
50
+ if (m.some((a) => a == null)) continue;
51
+ w = m.map(p);
52
+ }
53
+ const x = (h ?? []).filter((t) => !y.has(t.id) && !y.has(String(t.id))).map((t) => t[u.junctionField]).filter((t) => t != null), k = [], j = /* @__PURE__ */ new Set();
54
+ for (const t of [...x.map(p), ...g.map(p)]) {
55
+ const m = b(t);
56
+ j.has(m) || (j.add(m), k.push(t));
57
+ }
58
+ d[u.field] = {
59
+ ...k.length ? { create: k } : {},
60
+ ...w.length ? { delete: w } : {}
61
+ }, r.add(f);
62
+ }
63
+ return r;
64
+ }
65
+ const z = 500;
66
+ function W(n) {
67
+ var s;
68
+ const l = /* @__PURE__ */ new Set();
69
+ for (const [e, c] of n.rows) {
70
+ if (c.length === 0 || (s = n.skip) != null && s.has(e)) continue;
71
+ const d = e.indexOf(".");
72
+ if (d < 0) continue;
73
+ const _ = e.slice(0, d), r = e.slice(d + 1), o = n.relations.find(
74
+ (i) => i.one_collection === n.collection && i.many_collection === _ && i.many_field === r && !!i.one_field && i.junction_field == null
75
+ );
76
+ o != null && o.one_field && (c.length > z || c.some((i) => Object.keys(i).some((f) => f.startsWith("__o2m_"))) || (n.payload[o.one_field] = c.map((i) => {
77
+ const { id: f, ...g } = i;
78
+ return g;
79
+ }), l.add(e)));
80
+ }
81
+ return l;
82
+ }
83
+ export {
84
+ E as foldStagedLinks,
85
+ W as foldStagedRows
86
+ };