@nivaro/react 0.3.127 → 0.3.129

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 (50) hide show
  1. package/dist/components/slots/CommentsSlot.js +124 -95
  2. package/dist/full.css +1 -1
  3. package/dist/hooks/useSessionRecorder.js +1 -1
  4. package/dist/index.d.ts +29 -3
  5. package/dist/index.js +150 -147
  6. package/dist/shared/components/CollectionBrowserView.js +3259 -3211
  7. package/dist/shared/components/DataTable.js +406 -401
  8. package/dist/shared/components/ItemEditForm.js +4485 -4409
  9. package/dist/shared/components/MatrixEditor.js +548 -490
  10. package/dist/shared/components/MyWorkView.js +284 -274
  11. package/dist/shared/components/NotificationBell.js +264 -218
  12. package/dist/shared/components/RecordGridEditor.js +582 -472
  13. package/dist/shared/components/ai/AiMarkdown.js +215 -196
  14. package/dist/shared/components/chat/chat-core.js +331 -346
  15. package/dist/shared/components/chat/chat-typing.js +25 -0
  16. package/dist/shared/components/command-center/CommandCenterView.js +1 -1
  17. package/dist/shared/components/command-center/PeekPanel.js +8 -1
  18. package/dist/shared/components/command-center/api.js +17 -9
  19. package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
  20. package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
  21. package/dist/shared/components/item-edit/GroupSection.js +1 -1
  22. package/dist/shared/components/item-edit/HeaderTools.js +216 -210
  23. package/dist/shared/components/item-edit/InlineTableField.js +432 -429
  24. package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
  25. package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
  26. package/dist/shared/components/item-edit/RowComments.js +33 -30
  27. package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
  28. package/dist/shared/components/item-edit/live-related.js +29 -16
  29. package/dist/shared/components/item-edit/record-opened-live.js +86 -0
  30. package/dist/shared/components/panels/CommentPanel.js +345 -327
  31. package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
  32. package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
  33. package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
  34. package/dist/shared/components/queue/QueueItemSheet.js +171 -130
  35. package/dist/shared/components/record-grid-guard.js +85 -0
  36. package/dist/shared/components/support/TicketDetailSheet.js +213 -174
  37. package/dist/shared/components/trackers/MirroredText.js +40 -0
  38. package/dist/shared/components/trackers/SourceTracker.js +168 -0
  39. package/dist/shared/components/trackers/TrackerChip.js +71 -0
  40. package/dist/shared/components/trackers/TrackerLinkPanel.js +1039 -0
  41. package/dist/shared/components/trackers/TrackerPickers.js +245 -0
  42. package/dist/shared/components/trackers/tracker-model.js +126 -0
  43. package/dist/shared/components/trackers/use-tracker-link.js +159 -0
  44. package/dist/shared/lib/at-risk-fields.js +14 -0
  45. package/dist/shared/lib/live-queries.js +9 -8
  46. package/dist/shared/lib/live-screen.js +77 -76
  47. package/dist/shared/lib/presence-hooks.js +190 -127
  48. package/dist/shared/lib/user-sync.js +78 -65
  49. package/dist/shared/lib/waiting-count.js +40 -29
  50. package/package.json +1 -1
@@ -0,0 +1,85 @@
1
+ var a = Object.defineProperty;
2
+ var h = (s, t, e) => t in s ? a(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e;
3
+ var l = (s, t, e) => h(s, typeof t != "symbol" ? t + "" : t, e);
4
+ import { rowBaseBookFor as b, writeLineGuarded as k } from "./item-edit/line-midair.js";
5
+ function j(s, t, e, n) {
6
+ const i = {};
7
+ for (const [o, c] of Object.entries(s)) {
8
+ if (!e(o)) continue;
9
+ const f = t[o] == null ? "" : String(t[o]);
10
+ c !== f && (c !== "" && f !== "" && Number(c) === Number(f) || (i[o] = c === "" ? null : Number.isNaN(Number(c)) ? c : Number(c)));
11
+ }
12
+ return Object.keys(i).length === 0 ? null : (n && n.of.length > 0 && (i._sum_into = { field: n.field, of: n.of }), i);
13
+ }
14
+ function m(s, t) {
15
+ const e = {};
16
+ for (const n of t) e[n.field] = n.current_value;
17
+ return { [s]: e };
18
+ }
19
+ function y(s, t) {
20
+ const e = { ...s };
21
+ for (const [n, i] of Object.entries(t)) {
22
+ const o = { ...e[n] ?? {} };
23
+ for (const c of Object.keys(i)) delete o[c];
24
+ Object.keys(o).length === 0 ? delete e[n] : e[n] = o;
25
+ }
26
+ return e;
27
+ }
28
+ class g {
29
+ constructor(t, e) {
30
+ l(this, "pins", /* @__PURE__ */ new Map());
31
+ l(this, "book");
32
+ this.client = t, this.collection = e, this.book = b(t, e);
33
+ }
34
+ /** Every read of the rows: their read-time bases (one batched read). */
35
+ noteRows(t) {
36
+ this.book.noteRows(t);
37
+ }
38
+ /** The person started editing this row: its base is the row they see now. */
39
+ pin(t) {
40
+ !t || this.pins.has(t) || this.pins.set(t, this.book.baseOf(t));
41
+ }
42
+ /** Drop pins (after a save that landed, a discard or a scope change). */
43
+ release(t) {
44
+ if (!t) this.pins.clear();
45
+ else for (const e of t) this.pins.delete(e);
46
+ }
47
+ async write(t, e) {
48
+ const n = await k(
49
+ this.client,
50
+ this.book,
51
+ `/items/${this.collection}/${t}`,
52
+ t,
53
+ e,
54
+ { key: this.collection, label: `#${t}`, base: this.pins.get(t) }
55
+ );
56
+ return n.ok ? (this.pins.delete(t), { ok: !0 }) : (n.conflict.latest > 0 && this.pins.set(t, n.conflict.latest), { ok: !1, conflicts: n.conflict.conflicts });
57
+ }
58
+ }
59
+ function N(s, t, e) {
60
+ const n = {};
61
+ for (const [i, o] of Object.entries(s)) {
62
+ if (e.has(i)) {
63
+ n[i] = o;
64
+ continue;
65
+ }
66
+ const c = t[i] ?? {}, f = {};
67
+ for (const [r, u] of Object.entries(o)) (!(r in c) || c[r] !== u) && (f[r] = u);
68
+ Object.keys(f).length > 0 && (n[i] = f);
69
+ }
70
+ return n;
71
+ }
72
+ function v(s, t, e) {
73
+ const n = {};
74
+ for (const [i, o] of Object.entries(s))
75
+ (e.has(i) || !(i in t) || t[i] !== o) && (n[i] = o);
76
+ return n;
77
+ }
78
+ export {
79
+ g as GridRowGuard,
80
+ m as conflictsOf,
81
+ j as gridRowPatch,
82
+ N as settleDraftAfterSave,
83
+ v as settleEditsAfterSave,
84
+ y as takeTheirs
85
+ };