@nivaro/react 0.3.21 → 0.3.23
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/full.css +11 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/shared/components/chat/ChatPanel.js +258 -251
- package/dist/shared/components/help-videos/viewer/HelpVideoButton.js +106 -99
- package/dist/shared/components/item-edit/CompareSeries.js +92 -90
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/package.json +1 -1
- package/styles.css +10 -0
|
@@ -9,8 +9,8 @@ import { useHelpVideoRecording as te, RECORDING_BUSY as oe } from "../recorder/H
|
|
|
9
9
|
import { useHelpVideoUpload as re } from "../upload/HelpVideoUpload.js";
|
|
10
10
|
import { registerHelpVideoPage as ne } from "../walk/store.js";
|
|
11
11
|
import { collectPageLabels as ie } from "../walk/target.js";
|
|
12
|
-
import { showButton as se, isGettingReady as q, progressLabel as
|
|
13
|
-
import { LazyHelpVideoSheet as
|
|
12
|
+
import { showButton as se, isGettingReady as q, progressLabel as le, listMeta as ae } from "./format.js";
|
|
13
|
+
import { LazyHelpVideoSheet as de } from "./LazyHelpVideoSheet.js";
|
|
14
14
|
import { useHelpVideosPath as ce } from "./useHelpVideosPath.js";
|
|
15
15
|
import { RECORD_UNSUPPORTED as ue } from "../recorder/RecorderStatus.js";
|
|
16
16
|
const s = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan motion-reduce:transition-none", me = 3e3;
|
|
@@ -22,9 +22,9 @@ function $e({
|
|
|
22
22
|
compact: y
|
|
23
23
|
}) {
|
|
24
24
|
var $, _, H;
|
|
25
|
-
const N = z(), w = W(), R = ce(),
|
|
25
|
+
const N = z(), w = W(), R = ce(), a = Z({ collection: m, item: B, page: o }), [D, l] = k(!1), [C, p] = k(null), f = te(), [U, x] = k(!1), b = ee(), d = O(null), P = Y(), g = O(N);
|
|
26
26
|
g.current = N;
|
|
27
|
-
const r = (($ =
|
|
27
|
+
const r = (($ = a.data) == null ? void 0 : $.data) ?? [], c = !!((_ = a.data) != null && _.can_author);
|
|
28
28
|
A(() => o ? ne(o) : void 0, [o]), A(() => {
|
|
29
29
|
if (o && c) {
|
|
30
30
|
S(g.current).registerPage(o, h ?? o).catch(() => null);
|
|
@@ -35,14 +35,14 @@ function $e({
|
|
|
35
35
|
return () => window.clearTimeout(e);
|
|
36
36
|
}
|
|
37
37
|
}, [o, h, c]);
|
|
38
|
-
const j = !!
|
|
38
|
+
const j = !!a.data && se(r.length, c), u = r.filter(
|
|
39
39
|
(e) => {
|
|
40
40
|
var i;
|
|
41
41
|
return e.required && !((i = e.my_progress) != null && i.completed) && !q(e);
|
|
42
42
|
}
|
|
43
|
-
).length, V = m ? [{ kind: "collection", key: m, state_key: ((H =
|
|
43
|
+
).length, V = m ? [{ kind: "collection", key: m, state_key: ((H = a.data) == null ? void 0 : H.state) ?? null }] : o ? [{ kind: "page", key: o, state_key: null }] : [], v = re({
|
|
44
44
|
contexts: V,
|
|
45
|
-
host: J(
|
|
45
|
+
host: J(d.current) ?? null,
|
|
46
46
|
onDone: (e) => w.navigate(R(`?edit=${e.id}`))
|
|
47
47
|
});
|
|
48
48
|
return /* @__PURE__ */ n(L, { children: [
|
|
@@ -51,13 +51,13 @@ function $e({
|
|
|
51
51
|
{
|
|
52
52
|
open: D,
|
|
53
53
|
onOpenChange: (e) => {
|
|
54
|
-
|
|
54
|
+
l(e), e || x(!1);
|
|
55
55
|
},
|
|
56
56
|
children: [
|
|
57
57
|
/* @__PURE__ */ t(Q, { asChild: !0, children: /* @__PURE__ */ n(
|
|
58
58
|
"button",
|
|
59
59
|
{
|
|
60
|
-
ref:
|
|
60
|
+
ref: d,
|
|
61
61
|
type: "button",
|
|
62
62
|
"aria-label": r.length ? `Videos for this screen (${r.length}${u ? `, ${u} required` : ""})` : "Record a video for this screen",
|
|
63
63
|
title: r.length ? "Videos about this screen" : "Record a video for this screen",
|
|
@@ -78,106 +78,113 @@ function $e({
|
|
|
78
78
|
]
|
|
79
79
|
}
|
|
80
80
|
) }),
|
|
81
|
-
/* @__PURE__ */ n(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
{
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
{
|
|
101
|
-
|
|
102
|
-
children:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
81
|
+
/* @__PURE__ */ n(
|
|
82
|
+
X,
|
|
83
|
+
{
|
|
84
|
+
align: "end",
|
|
85
|
+
className: "flex max-h-[min(70vh,var(--radix-popover-content-available-height))] w-[340px] flex-col p-1.5 text-[13px]",
|
|
86
|
+
children: [
|
|
87
|
+
r.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-1.5 text-muted-foreground", children: "No videos for this screen yet. Record one to show people how it works." }),
|
|
88
|
+
/* @__PURE__ */ t("ul", { className: "-mr-1 min-h-0 flex-1 overflow-y-auto overscroll-contain pr-1", children: r.map((e) => {
|
|
89
|
+
const i = le(e), E = ae(e), I = q(e);
|
|
90
|
+
return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
|
|
91
|
+
"button",
|
|
92
|
+
{
|
|
93
|
+
type: "button",
|
|
94
|
+
className: `flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted ${s}`,
|
|
95
|
+
onClick: () => {
|
|
96
|
+
l(!1), p(e.id);
|
|
97
|
+
},
|
|
98
|
+
"data-hv-pick": e.id,
|
|
99
|
+
children: [
|
|
100
|
+
I ? /* @__PURE__ */ t(F, { className: "h-4 w-4 shrink-0 text-muted-foreground" }) : i.done ? /* @__PURE__ */ t(G, { className: "h-4 w-4 shrink-0 text-emerald-600 dark:text-emerald-400" }) : /* @__PURE__ */ t(M, { className: "h-4 w-4 shrink-0 text-[#2563eb] dark:text-sky-300" }),
|
|
101
|
+
/* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
|
|
102
|
+
/* @__PURE__ */ t("span", { className: "block truncate font-medium", children: e.title }),
|
|
103
|
+
/* @__PURE__ */ t(
|
|
104
|
+
"span",
|
|
105
|
+
{
|
|
106
|
+
className: `block text-[12px] ${E.overdue ? "text-rose-700 dark:text-rose-300" : "text-muted-foreground"}`,
|
|
107
|
+
children: E.text
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] })
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
) }, e.id);
|
|
114
|
+
}) }),
|
|
115
|
+
/* @__PURE__ */ n("div", { className: "mt-1 flex shrink-0 flex-wrap items-start gap-x-3 gap-y-1 border-t border-border px-2 pt-1.5", children: [
|
|
116
|
+
/* @__PURE__ */ t(
|
|
117
|
+
"button",
|
|
118
|
+
{
|
|
119
|
+
type: "button",
|
|
120
|
+
className: `rounded text-[12px] text-muted-foreground hover:underline ${s}`,
|
|
121
|
+
onClick: () => {
|
|
122
|
+
l(!1), w.navigate(R());
|
|
123
|
+
},
|
|
124
|
+
children: "All videos"
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
c && /* @__PURE__ */ n("div", { className: "ml-auto flex flex-col items-end", children: [
|
|
128
|
+
/* @__PURE__ */ t(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
disabled: !b,
|
|
133
|
+
"aria-describedby": b ? void 0 : P,
|
|
134
|
+
className: `rounded text-[12px] font-medium text-[#2563eb] hover:underline disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:no-underline dark:text-sky-300 ${s}`,
|
|
135
|
+
onClick: () => {
|
|
136
|
+
f.start({ contexts: V, from: d.current }) ? (x(!1), l(!1)) : x(!0);
|
|
137
|
+
},
|
|
138
|
+
"data-hv-record-here": !0,
|
|
139
|
+
children: "Record one for this screen"
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
/* @__PURE__ */ t(
|
|
143
|
+
"button",
|
|
144
|
+
{
|
|
145
|
+
type: "button",
|
|
146
|
+
disabled: v.busy,
|
|
147
|
+
className: `mt-0.5 rounded text-[12px] font-medium text-[#2563eb] hover:underline disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:no-underline dark:text-sky-300 ${s}`,
|
|
148
|
+
onClick: () => {
|
|
149
|
+
v.pick(), l(!1);
|
|
150
|
+
},
|
|
151
|
+
"data-hv-upload-here": !0,
|
|
152
|
+
children: "Upload a video"
|
|
153
|
+
}
|
|
154
|
+
),
|
|
155
|
+
!b && /* @__PURE__ */ t(
|
|
156
|
+
"p",
|
|
157
|
+
{
|
|
158
|
+
id: P,
|
|
159
|
+
className: "mt-0.5 max-w-[220px] text-right text-[12px] text-muted-foreground",
|
|
160
|
+
children: ue
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
U && f.active && /* @__PURE__ */ t(
|
|
164
|
+
"p",
|
|
165
|
+
{
|
|
166
|
+
role: "status",
|
|
167
|
+
className: "mt-0.5 max-w-[220px] text-right text-[12px] text-rose-700 dark:text-rose-300",
|
|
168
|
+
children: oe
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] })
|
|
172
|
+
] })
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
)
|
|
169
176
|
]
|
|
170
177
|
}
|
|
171
178
|
),
|
|
172
179
|
/* @__PURE__ */ t(
|
|
173
|
-
|
|
180
|
+
de,
|
|
174
181
|
{
|
|
175
182
|
videoId: C,
|
|
176
183
|
open: !!C,
|
|
177
184
|
onOpenChange: (e) => !e && p(null),
|
|
178
185
|
upNext: r,
|
|
179
186
|
onPick: p,
|
|
180
|
-
returnFocusRef:
|
|
187
|
+
returnFocusRef: d
|
|
181
188
|
}
|
|
182
189
|
),
|
|
183
190
|
f.fallback,
|