@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.
- package/dist/components/slots/CommentsSlot.js +124 -95
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +29 -3
- package/dist/index.js +150 -147
- package/dist/shared/components/CollectionBrowserView.js +3259 -3211
- package/dist/shared/components/DataTable.js +406 -401
- package/dist/shared/components/ItemEditForm.js +4485 -4409
- package/dist/shared/components/MatrixEditor.js +548 -490
- package/dist/shared/components/MyWorkView.js +284 -274
- package/dist/shared/components/NotificationBell.js +264 -218
- package/dist/shared/components/RecordGridEditor.js +582 -472
- package/dist/shared/components/ai/AiMarkdown.js +215 -196
- package/dist/shared/components/chat/chat-core.js +331 -346
- package/dist/shared/components/chat/chat-typing.js +25 -0
- package/dist/shared/components/command-center/CommandCenterView.js +1 -1
- package/dist/shared/components/command-center/PeekPanel.js +8 -1
- package/dist/shared/components/command-center/api.js +17 -9
- package/dist/shared/components/command-center/panels/AttentionPanel.js +4 -1
- package/dist/shared/components/command-center/panels/PartnersPanel.js +2 -1
- package/dist/shared/components/item-edit/GroupSection.js +1 -1
- package/dist/shared/components/item-edit/HeaderTools.js +216 -210
- package/dist/shared/components/item-edit/InlineTableField.js +432 -429
- package/dist/shared/components/item-edit/RecordLiveSync.js +115 -108
- package/dist/shared/components/item-edit/RecordViewersChip.js +17 -16
- package/dist/shared/components/item-edit/RowComments.js +33 -30
- package/dist/shared/components/item-edit/cascade-clear-notice.js +30 -28
- package/dist/shared/components/item-edit/live-related.js +29 -16
- package/dist/shared/components/item-edit/record-opened-live.js +86 -0
- package/dist/shared/components/panels/CommentPanel.js +345 -327
- package/dist/shared/components/panels/OwnerOpenedLine.js +24 -23
- package/dist/shared/components/panels/RecordIntegrityBanner.js +1 -1
- package/dist/shared/components/pipeline/TeamSuggestions.js +1 -1
- package/dist/shared/components/queue/QueueItemSheet.js +171 -130
- package/dist/shared/components/record-grid-guard.js +85 -0
- package/dist/shared/components/support/TicketDetailSheet.js +213 -174
- package/dist/shared/components/trackers/MirroredText.js +40 -0
- package/dist/shared/components/trackers/SourceTracker.js +168 -0
- package/dist/shared/components/trackers/TrackerChip.js +71 -0
- package/dist/shared/components/trackers/TrackerLinkPanel.js +1039 -0
- package/dist/shared/components/trackers/TrackerPickers.js +245 -0
- package/dist/shared/components/trackers/tracker-model.js +126 -0
- package/dist/shared/components/trackers/use-tracker-link.js +159 -0
- package/dist/shared/lib/at-risk-fields.js +14 -0
- package/dist/shared/lib/live-queries.js +9 -8
- package/dist/shared/lib/live-screen.js +77 -76
- package/dist/shared/lib/presence-hooks.js +190 -127
- package/dist/shared/lib/user-sync.js +78 -65
- package/dist/shared/lib/waiting-count.js +40 -29
- package/package.json +1 -1
|
@@ -1,299 +1,304 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { MoreHorizontal as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import { createPortal as
|
|
1
|
+
import { jsx as g, jsxs as O } from "react/jsx-runtime";
|
|
2
|
+
import { MoreHorizontal as K } from "lucide-react";
|
|
3
|
+
import { useRef as v, useCallback as H, useState as L, useEffect as E, useContext as A, createContext as U } from "react";
|
|
4
|
+
import { createPortal as J } from "react-dom";
|
|
5
5
|
import { cn as W } from "../../lib/utils.js";
|
|
6
|
-
function
|
|
7
|
-
const
|
|
8
|
-
if (!(
|
|
9
|
-
if (
|
|
10
|
-
const
|
|
11
|
-
return !
|
|
6
|
+
function Q(n, t) {
|
|
7
|
+
const d = n.target;
|
|
8
|
+
if (!(d != null && d.closest)) return !0;
|
|
9
|
+
if (d.closest("[data-radix-popper-content-wrapper]")) return !1;
|
|
10
|
+
const r = d.closest('[role="dialog"]');
|
|
11
|
+
return !r || !!(t && r.contains(t));
|
|
12
12
|
}
|
|
13
|
-
const
|
|
14
|
-
function
|
|
15
|
-
|
|
13
|
+
const B = U(!0), N = U(null);
|
|
14
|
+
function oe() {
|
|
15
|
+
const n = A(N);
|
|
16
|
+
return H(() => (n == null ? void 0 : n()) ?? null, [n]);
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
18
|
+
const j = '[role="dialog"],[role="alertdialog"]';
|
|
19
|
+
function X(n, t) {
|
|
20
|
+
return n instanceof Element ? (n.matches(j) ? [n] : Array.from(n.querySelectorAll(j))).some((r) => !r.closest("[data-radix-popper-content-wrapper]") && !t(r)) : !1;
|
|
21
|
+
}
|
|
22
|
+
const Y = 1500;
|
|
23
|
+
function V(n, t, d) {
|
|
24
|
+
const r = v(t);
|
|
25
|
+
r.current = t;
|
|
26
|
+
const u = v(d);
|
|
27
|
+
u.current = d, E(() => {
|
|
28
|
+
if (!n) return;
|
|
29
|
+
let l = 0;
|
|
30
|
+
const o = [], a = (i) => {
|
|
31
|
+
const s = i.target;
|
|
32
|
+
if (!(s != null && s.closest) || !u.current(s)) return;
|
|
33
|
+
const c = window.location.href, p = !!s.closest("a[href]");
|
|
34
|
+
l = Date.now() + Y;
|
|
35
|
+
const h = () => {
|
|
36
|
+
(p || window.location.href !== c) && r.current();
|
|
32
37
|
};
|
|
33
|
-
o.push(setTimeout(
|
|
34
|
-
},
|
|
35
|
-
if (!(Date.now() >
|
|
36
|
-
for (const
|
|
37
|
-
for (const
|
|
38
|
-
if (
|
|
39
|
-
|
|
38
|
+
o.push(setTimeout(h, 0), setTimeout(h, 250));
|
|
39
|
+
}, f = typeof MutationObserver > "u" ? null : new MutationObserver((i) => {
|
|
40
|
+
if (!(Date.now() > l)) {
|
|
41
|
+
for (const s of i)
|
|
42
|
+
for (const c of Array.from(s.addedNodes))
|
|
43
|
+
if (X(c, u.current)) {
|
|
44
|
+
l = 0, r.current();
|
|
40
45
|
return;
|
|
41
46
|
}
|
|
42
47
|
}
|
|
43
48
|
});
|
|
44
|
-
return
|
|
45
|
-
|
|
46
|
-
for (const
|
|
49
|
+
return f == null || f.observe(document.body, { childList: !0, subtree: !0 }), window.addEventListener("click", a, !0), () => {
|
|
50
|
+
f == null || f.disconnect(), window.removeEventListener("click", a, !0);
|
|
51
|
+
for (const i of o) clearTimeout(i);
|
|
47
52
|
};
|
|
48
|
-
}, [
|
|
53
|
+
}, [n]);
|
|
49
54
|
}
|
|
50
|
-
function
|
|
51
|
-
const
|
|
52
|
-
if (!
|
|
53
|
-
const
|
|
54
|
-
if (t.getBoundingClientRect().top >=
|
|
55
|
-
const
|
|
56
|
-
(
|
|
55
|
+
function S(n, t) {
|
|
56
|
+
const d = n.querySelector("[data-nvr-header-title]"), r = d == null ? void 0 : d.querySelector("[data-nvr-record-title]"), u = r == null ? void 0 : r.parentElement;
|
|
57
|
+
if (!d || !r || !u || !t) return 0;
|
|
58
|
+
const l = d.getBoundingClientRect();
|
|
59
|
+
if (t.getBoundingClientRect().top >= l.bottom - 1) return 0;
|
|
60
|
+
const a = r.getBoundingClientRect().top, f = Array.from(u.children).filter(
|
|
61
|
+
(c) => c instanceof HTMLElement && c.offsetWidth > 0
|
|
57
62
|
);
|
|
58
|
-
if (!
|
|
59
|
-
const
|
|
60
|
-
return Math.max(0, Math.ceil(
|
|
63
|
+
if (!f.some((c) => c.getBoundingClientRect().top > a + 2)) return 0;
|
|
64
|
+
const i = Number.parseFloat(getComputedStyle(u).columnGap) || 0, s = f.reduce((c, p) => c + p.offsetWidth, 0) + i * (f.length - 1);
|
|
65
|
+
return Math.max(0, Math.ceil(s - u.clientWidth));
|
|
61
66
|
}
|
|
62
|
-
function
|
|
63
|
-
var
|
|
64
|
-
const t =
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
if (
|
|
68
|
-
|
|
69
|
-
() =>
|
|
67
|
+
function ae({ children: n }) {
|
|
68
|
+
var k, y;
|
|
69
|
+
const t = v(null), d = v(null), r = H(() => d.current, []), [u, l] = L(!1), o = v(!1);
|
|
70
|
+
o.current = u;
|
|
71
|
+
const a = v(0), f = v(0), [i, s] = L(!1), c = v(null), p = v(!1);
|
|
72
|
+
if (u ? i && (p.current = !0) : p.current = !1, V(
|
|
73
|
+
i,
|
|
74
|
+
() => s(!1),
|
|
70
75
|
(e) => {
|
|
71
|
-
var
|
|
72
|
-
return !!((
|
|
76
|
+
var m;
|
|
77
|
+
return !!((m = c.current) != null && m.contains(e) || e.closest("[data-nvr-header-menu-panel]"));
|
|
73
78
|
}
|
|
74
|
-
),
|
|
75
|
-
var
|
|
76
|
-
const e = (
|
|
79
|
+
), E(() => {
|
|
80
|
+
var T, I;
|
|
81
|
+
const e = (T = t.current) == null ? void 0 : T.closest("[data-nvr-header-row]");
|
|
77
82
|
if (!e) return;
|
|
78
|
-
const
|
|
79
|
-
var
|
|
80
|
-
if (!
|
|
83
|
+
const m = () => {
|
|
84
|
+
var F, q;
|
|
85
|
+
if (!o.current) {
|
|
81
86
|
if (e.scrollWidth > e.clientWidth + 2) {
|
|
82
|
-
|
|
87
|
+
a.current = e.scrollWidth, l(!0), s(!1);
|
|
83
88
|
return;
|
|
84
89
|
}
|
|
85
|
-
const
|
|
86
|
-
|
|
90
|
+
const z = S(e, ((F = t.current) == null ? void 0 : F.parentElement) ?? null);
|
|
91
|
+
z > 0 && (a.current = e.clientWidth + z, l(!0), s(!1));
|
|
87
92
|
return;
|
|
88
93
|
}
|
|
89
|
-
const
|
|
90
|
-
!
|
|
91
|
-
|
|
92
|
-
e.clientWidth +
|
|
93
|
-
), e.setAttribute("data-nvr-header-wrap", "")) :
|
|
94
|
+
const M = e.hasAttribute("data-nvr-header-wrap"), P = e.scrollWidth > e.clientWidth + 2, D = M || e.querySelector('[data-nvr-header-fold="inline"]') ? 0 : S(e, ((q = t.current) == null ? void 0 : q.parentElement) ?? null);
|
|
95
|
+
!M && (P || D > 0) ? (f.current = Math.max(
|
|
96
|
+
P ? e.scrollWidth : 0,
|
|
97
|
+
e.clientWidth + D
|
|
98
|
+
), e.setAttribute("data-nvr-header-wrap", "")) : M && e.clientWidth > f.current + 32 ? e.removeAttribute("data-nvr-header-wrap") : !M && a.current > 0 && e.clientWidth > a.current + 32 && l(!1);
|
|
94
99
|
};
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
let
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
m();
|
|
101
|
+
const _ = new ResizeObserver(m);
|
|
102
|
+
_.observe(e);
|
|
103
|
+
const x = (I = t.current) == null ? void 0 : I.parentElement;
|
|
104
|
+
x && x !== e && _.observe(x);
|
|
105
|
+
let R = 0;
|
|
106
|
+
const C = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
|
|
107
|
+
R || (R = requestAnimationFrame(() => {
|
|
108
|
+
R = 0, m();
|
|
104
109
|
}));
|
|
105
110
|
});
|
|
106
|
-
return
|
|
107
|
-
|
|
111
|
+
return C == null || C.observe(e, { childList: !0, subtree: !0 }), () => {
|
|
112
|
+
_.disconnect(), C == null || C.disconnect(), R && cancelAnimationFrame(R);
|
|
108
113
|
};
|
|
109
|
-
}),
|
|
110
|
-
if (!
|
|
111
|
-
const e = (
|
|
112
|
-
|
|
114
|
+
}), E(() => {
|
|
115
|
+
if (!i) return;
|
|
116
|
+
const e = (m) => {
|
|
117
|
+
m.key !== "Escape" || !Q(m, t.current) || (m.stopPropagation(), s(!1));
|
|
113
118
|
};
|
|
114
119
|
return window.addEventListener("keydown", e, !0), () => window.removeEventListener("keydown", e, !0);
|
|
115
|
-
}, [
|
|
116
|
-
if (!
|
|
117
|
-
const e = (
|
|
118
|
-
const
|
|
119
|
-
if (
|
|
120
|
+
}, [i]), E(() => {
|
|
121
|
+
if (!i) return;
|
|
122
|
+
const e = (_) => {
|
|
123
|
+
const x = _.target;
|
|
124
|
+
if (x.closest("[data-nvr-header-tools-panel]") || x.closest("[data-nvr-header-tools-btn]") || x.closest("[data-nvr-header-menu-panel]") || x.closest("[data-radix-popper-content-wrapper]"))
|
|
120
125
|
return;
|
|
121
|
-
const
|
|
122
|
-
|
|
123
|
-
},
|
|
124
|
-
|
|
126
|
+
const R = x.closest('[role="dialog"]');
|
|
127
|
+
R && !R.contains(t.current) || s(!1);
|
|
128
|
+
}, m = (_) => {
|
|
129
|
+
_.target.closest("[data-nvr-header-menu-panel] [data-nvr-menu-close]") && s(!1);
|
|
125
130
|
};
|
|
126
|
-
return window.addEventListener("mousedown", e, !0), window.addEventListener("click",
|
|
127
|
-
window.removeEventListener("mousedown", e, !0), window.removeEventListener("click",
|
|
131
|
+
return window.addEventListener("mousedown", e, !0), window.addEventListener("click", m), () => {
|
|
132
|
+
window.removeEventListener("mousedown", e, !0), window.removeEventListener("click", m);
|
|
128
133
|
};
|
|
129
|
-
}, [
|
|
130
|
-
return /* @__PURE__ */
|
|
131
|
-
const h =
|
|
132
|
-
return /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
134
|
+
}, [i]), !u)
|
|
135
|
+
return /* @__PURE__ */ g("div", { ref: t, className: "contents", "data-nvr-header-tools": "inline", children: /* @__PURE__ */ g(B.Provider, { value: !0, children: n }) });
|
|
136
|
+
const h = i ? (k = d.current) == null ? void 0 : k.getBoundingClientRect() : void 0, b = ((y = d.current) == null ? void 0 : y.closest('[role="dialog"]')) ?? document.body, w = h ? h.right - (b === document.body ? 0 : b.getBoundingClientRect().left) - 16 : 440;
|
|
137
|
+
return /* @__PURE__ */ O("div", { ref: t, className: "flex shrink-0 items-center", "data-nvr-header-tools": "folded", children: [
|
|
138
|
+
/* @__PURE__ */ g(
|
|
134
139
|
"button",
|
|
135
140
|
{
|
|
136
|
-
ref:
|
|
141
|
+
ref: d,
|
|
137
142
|
type: "button",
|
|
138
143
|
"data-nvr-header-tools-btn": !0,
|
|
139
|
-
"aria-expanded":
|
|
144
|
+
"aria-expanded": i,
|
|
140
145
|
"aria-label": "More tools",
|
|
141
146
|
"data-tip": "More tools",
|
|
142
|
-
onClick: () =>
|
|
147
|
+
onClick: () => s((e) => !e),
|
|
143
148
|
className: W(
|
|
144
149
|
"inline-flex h-9 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
|
|
145
|
-
|
|
150
|
+
i && "bg-accent text-accent-foreground dark:bg-accent"
|
|
146
151
|
),
|
|
147
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ g(K, { className: "h-4 w-4" })
|
|
148
153
|
}
|
|
149
154
|
),
|
|
150
|
-
|
|
151
|
-
/* @__PURE__ */
|
|
155
|
+
p.current && J(
|
|
156
|
+
/* @__PURE__ */ g(
|
|
152
157
|
"div",
|
|
153
158
|
{
|
|
154
159
|
ref: c,
|
|
155
160
|
"data-nvr-header-tools-panel": !0,
|
|
156
|
-
style:
|
|
161
|
+
style: i && h ? b === document.body ? {
|
|
157
162
|
position: "fixed",
|
|
158
163
|
top: h.bottom + 6,
|
|
159
164
|
right: Math.max(8, window.innerWidth - h.right),
|
|
160
|
-
maxWidth: Math.min(440,
|
|
165
|
+
maxWidth: Math.min(440, w),
|
|
161
166
|
zIndex: 110
|
|
162
167
|
} : {
|
|
163
168
|
position: "absolute",
|
|
164
|
-
top: h.bottom -
|
|
165
|
-
right: Math.max(8,
|
|
166
|
-
maxWidth: Math.min(440,
|
|
169
|
+
top: h.bottom - b.getBoundingClientRect().top + 6,
|
|
170
|
+
right: Math.max(8, b.getBoundingClientRect().right - h.right),
|
|
171
|
+
maxWidth: Math.min(440, w),
|
|
167
172
|
zIndex: 110
|
|
168
173
|
} : { display: "none" },
|
|
169
174
|
className: "flex flex-wrap items-center justify-end gap-1.5 rounded-lg border border-slate-200 bg-white p-2 shadow-xl dark:border-border dark:bg-card [&_[data-nvr-header-tool-group]]:h-auto [&_[data-nvr-header-tool-group]]:min-h-9 [&_[data-nvr-header-tool-group]]:max-w-full [&_[data-nvr-header-tool-group]]:shrink [&_[data-nvr-header-tool-group]]:flex-wrap",
|
|
170
|
-
children: /* @__PURE__ */
|
|
175
|
+
children: /* @__PURE__ */ g(N.Provider, { value: r, children: /* @__PURE__ */ g(B.Provider, { value: i, children: n }) })
|
|
171
176
|
}
|
|
172
177
|
),
|
|
173
|
-
|
|
178
|
+
b
|
|
174
179
|
)
|
|
175
180
|
] });
|
|
176
181
|
}
|
|
177
|
-
function
|
|
178
|
-
const [
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
return
|
|
182
|
-
const o =
|
|
183
|
-
if (!t || !o || !
|
|
184
|
-
!t &&
|
|
182
|
+
function ie(n, t) {
|
|
183
|
+
const [d, r] = L(!1), u = v(!1);
|
|
184
|
+
u.current = d;
|
|
185
|
+
const l = v(0);
|
|
186
|
+
return E(() => {
|
|
187
|
+
const o = n.current, a = o == null ? void 0 : o.closest("[data-nvr-header-row]");
|
|
188
|
+
if (!t || !o || !a) {
|
|
189
|
+
!t && u.current && r(!1);
|
|
185
190
|
return;
|
|
186
191
|
}
|
|
187
|
-
o.setAttribute("data-nvr-header-fold",
|
|
188
|
-
const
|
|
189
|
-
if (
|
|
190
|
-
|
|
192
|
+
o.setAttribute("data-nvr-header-fold", u.current ? "folded" : "inline");
|
|
193
|
+
const f = () => {
|
|
194
|
+
if (u.current)
|
|
195
|
+
l.current > 0 && a.clientWidth > l.current + 32 && r(!1);
|
|
191
196
|
else {
|
|
192
|
-
const
|
|
193
|
-
if ((
|
|
197
|
+
const p = a.scrollWidth > a.clientWidth + 2, h = a.querySelector("[data-nvr-header-tools]");
|
|
198
|
+
if ((h == null ? void 0 : h.getAttribute("data-nvr-header-tools")) === "inline" && h.childElementCount > 0)
|
|
194
199
|
return;
|
|
195
|
-
const
|
|
196
|
-
if (!
|
|
197
|
-
|
|
200
|
+
const b = p ? 0 : S(a, o.parentElement);
|
|
201
|
+
if (!p && b <= 0) return;
|
|
202
|
+
l.current = p ? a.scrollWidth : a.clientWidth + b, r(!0);
|
|
198
203
|
}
|
|
199
204
|
};
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
let
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
f();
|
|
206
|
+
const i = new ResizeObserver(f);
|
|
207
|
+
i.observe(a), o.parentElement && o.parentElement !== a && i.observe(o.parentElement);
|
|
208
|
+
let s = 0;
|
|
209
|
+
const c = typeof MutationObserver > "u" ? null : new MutationObserver(() => {
|
|
210
|
+
s || (s = requestAnimationFrame(() => {
|
|
211
|
+
s = 0, f();
|
|
207
212
|
}));
|
|
208
213
|
});
|
|
209
|
-
return
|
|
210
|
-
|
|
214
|
+
return c == null || c.observe(a, { childList: !0, subtree: !0 }), () => {
|
|
215
|
+
i.disconnect(), c == null || c.disconnect(), s && cancelAnimationFrame(s);
|
|
211
216
|
};
|
|
212
|
-
}),
|
|
217
|
+
}), E(() => {
|
|
213
218
|
var o;
|
|
214
|
-
t || (o =
|
|
215
|
-
}, [t,
|
|
219
|
+
t || (o = n.current) == null || o.removeAttribute("data-nvr-header-fold");
|
|
220
|
+
}, [t, n]), d;
|
|
216
221
|
}
|
|
217
|
-
const
|
|
218
|
-
function
|
|
219
|
-
return Math.max(8, Math.min(
|
|
222
|
+
const Z = 240;
|
|
223
|
+
function G(n, t) {
|
|
224
|
+
return Math.max(8, Math.min(n, t - Z - 8));
|
|
220
225
|
}
|
|
221
|
-
function
|
|
222
|
-
children:
|
|
226
|
+
function se({
|
|
227
|
+
children: n,
|
|
223
228
|
label: t = "More",
|
|
224
|
-
className:
|
|
229
|
+
className: d
|
|
225
230
|
}) {
|
|
226
|
-
var
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
231
|
+
var h, b;
|
|
232
|
+
const r = v(null), u = v(null), [l, o] = L(!1), a = A(N), f = H(() => (a == null ? void 0 : a()) ?? r.current, [a]), i = v(!1);
|
|
233
|
+
l && (i.current = !0), V(
|
|
234
|
+
l,
|
|
230
235
|
() => o(!1),
|
|
231
|
-
(
|
|
232
|
-
var
|
|
233
|
-
return !!((
|
|
236
|
+
(w) => {
|
|
237
|
+
var k;
|
|
238
|
+
return !!((k = u.current) != null && k.contains(w));
|
|
234
239
|
}
|
|
235
240
|
);
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
}, [
|
|
240
|
-
if (!
|
|
241
|
-
const
|
|
242
|
-
var
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
|
|
241
|
+
const s = A(B);
|
|
242
|
+
E(() => {
|
|
243
|
+
s || o(!1);
|
|
244
|
+
}, [s]), E(() => {
|
|
245
|
+
if (!l) return;
|
|
246
|
+
const w = (y) => {
|
|
247
|
+
var m;
|
|
248
|
+
const e = y.target;
|
|
249
|
+
e.closest("[data-nvr-header-menu-panel]") || e.closest("[data-nvr-header-menu-btn]") || e.closest("[data-radix-popper-content-wrapper]") || // A dialog opened from a menu row, not one hosting the form.
|
|
250
|
+
e.closest('[role="dialog"]') && !((m = e.closest('[role="dialog"]')) != null && m.contains(r.current)) || o(!1);
|
|
251
|
+
}, k = (y) => {
|
|
252
|
+
y.key !== "Escape" || !Q(y, r.current) || (y.stopPropagation(), o(!1));
|
|
248
253
|
};
|
|
249
|
-
return window.addEventListener("mousedown",
|
|
250
|
-
window.removeEventListener("mousedown",
|
|
254
|
+
return window.addEventListener("mousedown", w, !0), window.addEventListener("keydown", k, !0), () => {
|
|
255
|
+
window.removeEventListener("mousedown", w, !0), window.removeEventListener("keydown", k, !0);
|
|
251
256
|
};
|
|
252
|
-
}, [
|
|
253
|
-
const
|
|
254
|
-
return /* @__PURE__ */
|
|
255
|
-
/* @__PURE__ */
|
|
257
|
+
}, [l]);
|
|
258
|
+
const c = l ? (h = r.current) == null ? void 0 : h.getBoundingClientRect() : void 0, p = ((b = r.current) == null ? void 0 : b.closest('[role="dialog"]')) ?? document.body;
|
|
259
|
+
return /* @__PURE__ */ O("div", { className: W("relative shrink-0", d), children: [
|
|
260
|
+
/* @__PURE__ */ O(
|
|
256
261
|
"button",
|
|
257
262
|
{
|
|
258
|
-
ref:
|
|
263
|
+
ref: r,
|
|
259
264
|
type: "button",
|
|
260
265
|
"data-nvr-header-menu-btn": !0,
|
|
261
266
|
"aria-haspopup": "menu",
|
|
262
|
-
"aria-expanded":
|
|
267
|
+
"aria-expanded": l,
|
|
263
268
|
"aria-label": t,
|
|
264
269
|
"data-tip": "More actions",
|
|
265
|
-
onClick: () => o((
|
|
270
|
+
onClick: () => o((w) => !w),
|
|
266
271
|
className: W(
|
|
267
272
|
"inline-flex h-9 items-center gap-1 rounded-md border border-input bg-background px-2.5 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground dark:bg-transparent dark:hover:bg-accent",
|
|
268
|
-
|
|
273
|
+
l && "bg-accent text-accent-foreground dark:bg-accent"
|
|
269
274
|
),
|
|
270
275
|
children: [
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
/* @__PURE__ */
|
|
276
|
+
/* @__PURE__ */ g(K, { className: "h-4 w-4" }),
|
|
277
|
+
/* @__PURE__ */ g("span", { className: "hidden lg:inline", children: t })
|
|
273
278
|
]
|
|
274
279
|
}
|
|
275
280
|
),
|
|
276
|
-
|
|
277
|
-
/* @__PURE__ */
|
|
281
|
+
i.current && J(
|
|
282
|
+
/* @__PURE__ */ g(
|
|
278
283
|
"div",
|
|
279
284
|
{
|
|
280
|
-
ref:
|
|
285
|
+
ref: u,
|
|
281
286
|
"data-nvr-header-menu-panel": !0,
|
|
282
287
|
role: "menu",
|
|
283
|
-
onClick: (
|
|
284
|
-
|
|
288
|
+
onClick: (w) => {
|
|
289
|
+
w.target.closest("[data-nvr-menu-close]") && o(!1);
|
|
285
290
|
},
|
|
286
|
-
style:
|
|
291
|
+
style: l && c ? p === document.body ? {
|
|
287
292
|
position: "fixed",
|
|
288
|
-
top:
|
|
289
|
-
right:
|
|
293
|
+
top: c.bottom + 6,
|
|
294
|
+
right: G(window.innerWidth - c.right, window.innerWidth),
|
|
290
295
|
zIndex: 110
|
|
291
296
|
} : {
|
|
292
297
|
position: "absolute",
|
|
293
|
-
top:
|
|
294
|
-
right:
|
|
295
|
-
|
|
296
|
-
|
|
298
|
+
top: c.bottom - p.getBoundingClientRect().top + 6,
|
|
299
|
+
right: G(
|
|
300
|
+
p.getBoundingClientRect().right - c.right,
|
|
301
|
+
p.getBoundingClientRect().width
|
|
297
302
|
),
|
|
298
303
|
zIndex: 110
|
|
299
304
|
} : { display: "none" },
|
|
@@ -303,18 +308,18 @@ function re({
|
|
|
303
308
|
"[&_button:hover]:bg-accent [&_button:hover]:text-accent-foreground [&_button_svg]:h-3.5 [&_button_svg]:w-3.5 [&_button_svg]:shrink-0 [&_button_svg]:text-slate-500",
|
|
304
309
|
"[&>[data-nvr-menu-divider]]:my-1 [&>[data-nvr-menu-divider]]:h-px [&>[data-nvr-menu-divider]]:bg-slate-100 dark:[&>[data-nvr-menu-divider]]:bg-border"
|
|
305
310
|
),
|
|
306
|
-
children:
|
|
311
|
+
children: /* @__PURE__ */ g(N.Provider, { value: f, children: n })
|
|
307
312
|
}
|
|
308
313
|
),
|
|
309
|
-
|
|
314
|
+
p
|
|
310
315
|
)
|
|
311
316
|
] });
|
|
312
317
|
}
|
|
313
|
-
function
|
|
314
|
-
children:
|
|
318
|
+
function ce({
|
|
319
|
+
children: n,
|
|
315
320
|
className: t
|
|
316
321
|
}) {
|
|
317
|
-
return /* @__PURE__ */
|
|
322
|
+
return /* @__PURE__ */ g(
|
|
318
323
|
"div",
|
|
319
324
|
{
|
|
320
325
|
"data-nvr-header-tool-group": !0,
|
|
@@ -322,17 +327,18 @@ function oe({
|
|
|
322
327
|
"inline-flex h-9 shrink-0 items-center rounded-md border border-input bg-background px-0.5 shadow-sm [&>*+*]:border-l [&>*+*]:border-input/70",
|
|
323
328
|
t
|
|
324
329
|
),
|
|
325
|
-
children:
|
|
330
|
+
children: n
|
|
326
331
|
}
|
|
327
332
|
);
|
|
328
333
|
}
|
|
329
334
|
export {
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
335
|
+
se as HeaderMenu,
|
|
336
|
+
ce as HeaderToolGroup,
|
|
337
|
+
ae as HeaderTools,
|
|
338
|
+
G as menuRight,
|
|
339
|
+
X as openedLayerIn,
|
|
340
|
+
S as titleChipDeficit,
|
|
341
|
+
V as useCloseWhenRowOpensLayer,
|
|
342
|
+
oe as useHeaderAnchor,
|
|
343
|
+
ie as useHeaderFold
|
|
338
344
|
};
|