@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.
@@ -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 de, listMeta as le } from "./format.js";
13
- import { LazyHelpVideoSheet as ae } from "./LazyHelpVideoSheet.js";
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(), l = Z({ collection: m, item: B, page: o }), [D, d] = k(!1), [C, p] = k(null), f = te(), [U, x] = k(!1), b = ee(), a = O(null), P = Y(), g = O(N);
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 = (($ = l.data) == null ? void 0 : $.data) ?? [], c = !!((_ = l.data) != null && _.can_author);
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 = !!l.data && se(r.length, c), u = r.filter(
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 = l.data) == null ? void 0 : H.state) ?? null }] : o ? [{ kind: "page", key: o, state_key: null }] : [], v = re({
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(a.current) ?? null,
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
- d(e), e || x(!1);
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: a,
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(X, { align: "end", className: "w-[340px] p-1.5 text-[13px]", children: [
82
- 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." }),
83
- /* @__PURE__ */ t("ul", { children: r.map((e) => {
84
- const i = de(e), E = le(e), I = q(e);
85
- return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ n(
86
- "button",
87
- {
88
- type: "button",
89
- className: `flex w-full items-center gap-2.5 rounded-md px-2 py-1.5 text-left transition-colors hover:bg-muted ${s}`,
90
- onClick: () => {
91
- d(!1), p(e.id);
92
- },
93
- "data-hv-pick": e.id,
94
- children: [
95
- 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" }),
96
- /* @__PURE__ */ n("span", { className: "min-w-0 flex-1", children: [
97
- /* @__PURE__ */ t("span", { className: "block truncate font-medium", children: e.title }),
98
- /* @__PURE__ */ t(
99
- "span",
100
- {
101
- className: `block text-[12px] ${E.overdue ? "text-rose-700 dark:text-rose-300" : "text-muted-foreground"}`,
102
- children: E.text
103
- }
104
- )
105
- ] })
106
- ]
107
- }
108
- ) }, e.id);
109
- }) }),
110
- /* @__PURE__ */ n("div", { className: "mt-1 flex flex-wrap items-start gap-x-3 gap-y-1 border-t border-border px-2 pt-1.5", children: [
111
- /* @__PURE__ */ t(
112
- "button",
113
- {
114
- type: "button",
115
- className: `rounded text-[12px] text-muted-foreground hover:underline ${s}`,
116
- onClick: () => {
117
- d(!1), w.navigate(R());
118
- },
119
- children: "All videos"
120
- }
121
- ),
122
- c && /* @__PURE__ */ n("div", { className: "ml-auto flex flex-col items-end", children: [
123
- /* @__PURE__ */ t(
124
- "button",
125
- {
126
- type: "button",
127
- disabled: !b,
128
- "aria-describedby": b ? void 0 : P,
129
- 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}`,
130
- onClick: () => {
131
- f.start({ contexts: V, from: a.current }) ? (x(!1), d(!1)) : x(!0);
132
- },
133
- "data-hv-record-here": !0,
134
- children: "Record one for this screen"
135
- }
136
- ),
137
- /* @__PURE__ */ t(
138
- "button",
139
- {
140
- type: "button",
141
- disabled: v.busy,
142
- 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}`,
143
- onClick: () => {
144
- v.pick(), d(!1);
145
- },
146
- "data-hv-upload-here": !0,
147
- children: "Upload a video"
148
- }
149
- ),
150
- !b && /* @__PURE__ */ t(
151
- "p",
152
- {
153
- id: P,
154
- className: "mt-0.5 max-w-[220px] text-right text-[12px] text-muted-foreground",
155
- children: ue
156
- }
157
- ),
158
- U && f.active && /* @__PURE__ */ t(
159
- "p",
160
- {
161
- role: "status",
162
- className: "mt-0.5 max-w-[220px] text-right text-[12px] text-rose-700 dark:text-rose-300",
163
- children: oe
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
- ae,
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: a
187
+ returnFocusRef: d
181
188
  }
182
189
  ),
183
190
  f.fallback,