@nivaro/react 0.2.54 → 0.2.56
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 +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +367 -2
- package/dist/index.js +645 -616
- package/dist/layout-editor.d.ts +4 -0
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/ItemEditForm.js +4066 -3832
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +599 -552
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +76 -73
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +2 -2
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +292 -279
- package/dist/shared/components/item-edit/GroupSection.js +698 -574
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +39 -32
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +51 -45
- package/dist/shared/components/layout-editor/AddPanel.js +134 -117
- package/dist/shared/components/layout-editor/ChangeNote.js +25 -24
- package/dist/shared/components/layout-editor/CollabParts.js +80 -75
- package/dist/shared/components/layout-editor/DesignNode.js +126 -120
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -27
- package/dist/shared/components/layout-editor/EditorTopBar.js +203 -192
- package/dist/shared/components/layout-editor/HistoryPanel.js +120 -104
- package/dist/shared/components/layout-editor/LayoutEditor.js +768 -671
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +237 -186
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +149 -103
- package/dist/shared/components/layout-editor/collab/collab-api.js +29 -26
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +81 -80
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/draft-recovery.js +113 -43
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +61 -57
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +247 -151
- package/dist/shared/components/layout-editor/inspector/Inspector.js +176 -155
- package/dist/shared/components/layout-editor/inspector/LookTab.js +167 -116
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +84 -82
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +66 -62
- package/dist/shared/components/layout-editor/inspector/kit.js +69 -68
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +6 -0
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/parity-keys.json.js +1 -1
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +41 -39
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +147 -111
- package/dist/shared/components/layout-editor/settings/WhoSection.js +29 -26
- package/dist/shared/components/layout-editor/settings/settings-registry.js +114 -17
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +81 -77
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +65 -60
- package/dist/shared/components/layout-editor/testing/testing-model.js +198 -185
- package/dist/shared/components/layout-editor/toolbar-kit.js +11 -11
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +144 -70
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +25 -24
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +101 -52
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-ops.js +84 -82
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/stale-chunk.js +60 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useQuery as u, useInfiniteQuery as b, useQueryClient as f } from "@tanstack/react-query";
|
|
2
2
|
import { useRef as F } from "react";
|
|
3
3
|
import { useNivaroClient as d } from "../../context.js";
|
|
4
|
-
import { patch as y, get as r, del as p, post as i, put as
|
|
4
|
+
import { patch as y, get as r, del as p, post as i, put as c } from "../../lib/commands.js";
|
|
5
5
|
import { useLiveEvent as m } from "../../lib/live.js";
|
|
6
|
-
import {
|
|
6
|
+
import { useLiveRefetchInterval as w } from "../../lib/live-queries.js";
|
|
7
|
+
import { cardAccent as _ } from "./cards.js";
|
|
7
8
|
const l = {
|
|
8
9
|
all: ["help-videos"],
|
|
9
10
|
one: (s) => ["help-videos", "one", s],
|
|
@@ -27,7 +28,7 @@ const l = {
|
|
|
27
28
|
* never refetch it. `n` bumps on Reload. */
|
|
28
29
|
draftEdits: (s, a) => ["help-video-draft", s, a]
|
|
29
30
|
}, q = (s, a) => String(s ?? "").toLowerCase() === String(a ?? "").toLowerCase();
|
|
30
|
-
function
|
|
31
|
+
function v(s, a) {
|
|
31
32
|
const e = f(), t = F(s);
|
|
32
33
|
t.current = s, m(
|
|
33
34
|
"help-video:changed",
|
|
@@ -42,26 +43,28 @@ function c(s, a) {
|
|
|
42
43
|
}
|
|
43
44
|
);
|
|
44
45
|
}
|
|
45
|
-
async function
|
|
46
|
+
async function K(s, a) {
|
|
46
47
|
return (await s.request(r(`/help-videos/${a}`))).data;
|
|
47
48
|
}
|
|
48
|
-
function
|
|
49
|
+
function I(s) {
|
|
49
50
|
const a = d();
|
|
50
|
-
|
|
51
|
+
v([l.one(s ?? "")], s);
|
|
52
|
+
const e = w(4e3);
|
|
53
|
+
return u({
|
|
51
54
|
queryKey: l.one(s ?? ""),
|
|
52
55
|
enabled: !!s,
|
|
53
|
-
queryFn: () =>
|
|
56
|
+
queryFn: () => K(a, s),
|
|
54
57
|
// Poll while a render runs so the status chip and the stream switch over by themselves.
|
|
55
|
-
refetchInterval: (
|
|
56
|
-
var
|
|
57
|
-
const
|
|
58
|
-
return
|
|
58
|
+
refetchInterval: (t) => {
|
|
59
|
+
var o, h;
|
|
60
|
+
const n = (h = (o = t.state.data) == null ? void 0 : o.published) == null ? void 0 : h.render_status;
|
|
61
|
+
return n === "queued" || n === "rendering" ? e : !1;
|
|
59
62
|
}
|
|
60
63
|
});
|
|
61
64
|
}
|
|
62
|
-
function
|
|
65
|
+
function M(s, a = !0) {
|
|
63
66
|
const e = d();
|
|
64
|
-
return
|
|
67
|
+
return v([["help-videos", "for"]]), u({
|
|
65
68
|
queryKey: l.forCtx(s),
|
|
66
69
|
enabled: a && !!(s.collection || s.page),
|
|
67
70
|
staleTime: 6e4,
|
|
@@ -73,31 +76,31 @@ function U(s, a = !0) {
|
|
|
73
76
|
)
|
|
74
77
|
});
|
|
75
78
|
}
|
|
76
|
-
function
|
|
79
|
+
function O(s, a = !0) {
|
|
77
80
|
const e = d();
|
|
78
|
-
return
|
|
81
|
+
return v([["help-videos", "form"]]), u({
|
|
79
82
|
queryKey: ["help-videos", "form", s ?? ""],
|
|
80
83
|
enabled: a && !!s,
|
|
81
84
|
staleTime: 6e4,
|
|
82
85
|
queryFn: () => e.request(r("/help-videos/for-form", { collection: s })).then((t) => t.data)
|
|
83
86
|
});
|
|
84
87
|
}
|
|
85
|
-
function
|
|
88
|
+
function V(s) {
|
|
86
89
|
const a = s[s.length - 1];
|
|
87
90
|
return a != null && a.data.length && s.reduce((t, n) => t + n.data.length, 0) < a.total ? s.length + 1 : void 0;
|
|
88
91
|
}
|
|
89
|
-
function
|
|
92
|
+
function z(s) {
|
|
90
93
|
const a = d();
|
|
91
|
-
return
|
|
94
|
+
return v([["help-videos", "library"]]), b({
|
|
92
95
|
queryKey: l.library(s),
|
|
93
96
|
initialPageParam: 1,
|
|
94
97
|
queryFn: ({ pageParam: e }) => a.request(r("/help-videos", { ...s, page: e })),
|
|
95
|
-
getNextPageParam: (e, t) =>
|
|
98
|
+
getNextPageParam: (e, t) => V(t),
|
|
96
99
|
placeholderData: (e) => e,
|
|
97
100
|
select: (e) => {
|
|
98
101
|
var t, n, o;
|
|
99
102
|
return {
|
|
100
|
-
data: e.pages.flatMap((
|
|
103
|
+
data: e.pages.flatMap((h) => h.data),
|
|
101
104
|
total: ((t = e.pages[e.pages.length - 1]) == null ? void 0 : t.total) ?? 0,
|
|
102
105
|
categories: ((n = e.pages[0]) == null ? void 0 : n.categories) ?? [],
|
|
103
106
|
can_author: ((o = e.pages[0]) == null ? void 0 : o.can_author) ?? !1
|
|
@@ -111,24 +114,24 @@ async function g(s) {
|
|
|
111
114
|
);
|
|
112
115
|
return { data: a.data ?? [], paths: a.paths ?? [] };
|
|
113
116
|
}
|
|
114
|
-
function
|
|
117
|
+
function Q() {
|
|
115
118
|
const s = d();
|
|
116
|
-
return
|
|
119
|
+
return v([l.required]), u({
|
|
117
120
|
queryKey: l.required,
|
|
118
121
|
staleTime: 6e4,
|
|
119
122
|
queryFn: () => g(s)
|
|
120
123
|
});
|
|
121
124
|
}
|
|
122
|
-
function
|
|
125
|
+
function S() {
|
|
123
126
|
const s = d();
|
|
124
|
-
return
|
|
127
|
+
return v([l.required]), u({
|
|
125
128
|
queryKey: l.required,
|
|
126
129
|
staleTime: 6e4,
|
|
127
130
|
queryFn: () => g(s),
|
|
128
131
|
select: (a) => a.data
|
|
129
132
|
});
|
|
130
133
|
}
|
|
131
|
-
function
|
|
134
|
+
function j(s = !0) {
|
|
132
135
|
const a = d();
|
|
133
136
|
return u({
|
|
134
137
|
queryKey: l.myPaths,
|
|
@@ -137,7 +140,7 @@ function Q(s = !0) {
|
|
|
137
140
|
queryFn: async () => (await a.request(r("/help-videos/paths/mine"))).data
|
|
138
141
|
});
|
|
139
142
|
}
|
|
140
|
-
function
|
|
143
|
+
function D(s = !0) {
|
|
141
144
|
const a = d();
|
|
142
145
|
return u({
|
|
143
146
|
queryKey: l.paths,
|
|
@@ -145,25 +148,25 @@ function S(s = !0) {
|
|
|
145
148
|
queryFn: async () => (await a.request(r("/help-videos/paths"))).data
|
|
146
149
|
});
|
|
147
150
|
}
|
|
148
|
-
function
|
|
151
|
+
function E(s) {
|
|
149
152
|
const a = s.request.bind(s);
|
|
150
153
|
return {
|
|
151
154
|
create: (e) => a(i("/help-videos/paths", e)).then((t) => t.data),
|
|
152
155
|
update: (e, t) => a(y(`/help-videos/paths/${e}`, t)).then((n) => n.data),
|
|
153
156
|
/** The ordered video list; unknown ids are dropped. */
|
|
154
|
-
setItems: (e, t) => a(
|
|
157
|
+
setItems: (e, t) => a(c(`/help-videos/paths/${e}/items`, { video_ids: t })).then(
|
|
155
158
|
(n) => n.data
|
|
156
159
|
),
|
|
157
160
|
/** The roles; a published path tells the roles that became required. */
|
|
158
161
|
setRoles: (e, t) => a(
|
|
159
|
-
|
|
162
|
+
c(`/help-videos/paths/${e}/roles`, {
|
|
160
163
|
roles: t
|
|
161
164
|
})
|
|
162
165
|
).then((n) => n.data),
|
|
163
166
|
remove: (e) => a(p(`/help-videos/paths/${e}`))
|
|
164
167
|
};
|
|
165
168
|
}
|
|
166
|
-
function
|
|
169
|
+
function N(s) {
|
|
167
170
|
const a = d();
|
|
168
171
|
return u({
|
|
169
172
|
queryKey: l.walk(s ?? ""),
|
|
@@ -174,7 +177,7 @@ function D(s) {
|
|
|
174
177
|
)).data
|
|
175
178
|
});
|
|
176
179
|
}
|
|
177
|
-
function
|
|
180
|
+
function B(s) {
|
|
178
181
|
const a = d(), e = f();
|
|
179
182
|
return m(
|
|
180
183
|
"help-video:question",
|
|
@@ -192,7 +195,7 @@ function E(s) {
|
|
|
192
195
|
queryFn: () => $(a).questions(s)
|
|
193
196
|
});
|
|
194
197
|
}
|
|
195
|
-
function
|
|
198
|
+
function J(s, a = !0) {
|
|
196
199
|
const e = d();
|
|
197
200
|
return u({
|
|
198
201
|
queryKey: l.next(s ?? ""),
|
|
@@ -201,7 +204,7 @@ function N(s, a = !0) {
|
|
|
201
204
|
queryFn: () => $(e).next(s)
|
|
202
205
|
});
|
|
203
206
|
}
|
|
204
|
-
function
|
|
207
|
+
function W(s) {
|
|
205
208
|
const a = d();
|
|
206
209
|
return u({
|
|
207
210
|
queryKey: l.clips(s ?? ""),
|
|
@@ -211,13 +214,13 @@ function B(s) {
|
|
|
211
214
|
const e = await a.request(r(`/help-videos/${s}/clips`));
|
|
212
215
|
return Array.isArray(e == null ? void 0 : e.data) ? e.data : [];
|
|
213
216
|
},
|
|
214
|
-
refetchInterval: (e) =>
|
|
217
|
+
refetchInterval: (e) => C(e.state.data) ? 2500 : !1
|
|
215
218
|
});
|
|
216
219
|
}
|
|
217
|
-
function
|
|
220
|
+
function C(s) {
|
|
218
221
|
return Array.isArray(s) && s.some((a) => a.status === "queued" || a.status === "rendering");
|
|
219
222
|
}
|
|
220
|
-
function
|
|
223
|
+
function G() {
|
|
221
224
|
const s = d();
|
|
222
225
|
return u({
|
|
223
226
|
queryKey: l.pages,
|
|
@@ -243,8 +246,8 @@ function $(s) {
|
|
|
243
246
|
...n ? { draft: 1 } : {}
|
|
244
247
|
})
|
|
245
248
|
).then((o) => o.data.url),
|
|
246
|
-
setContexts: (e, t) => a(
|
|
247
|
-
setRequirements: (e, t) => a(
|
|
249
|
+
setContexts: (e, t) => a(c(`/help-videos/${e}/contexts`, { contexts: t })),
|
|
250
|
+
setRequirements: (e, t) => a(c(`/help-videos/${e}/requirements`, { role_ids: t })),
|
|
248
251
|
archive: (e) => a(p(`/help-videos/${e}`)),
|
|
249
252
|
/** Deletes the video, its versions, files, views and requirements for good. Administrators
|
|
250
253
|
* only (403 ADMIN_ONLY otherwise); 404 when it is already gone. */
|
|
@@ -252,7 +255,7 @@ function $(s) {
|
|
|
252
255
|
draft: (e) => a(r(`/help-videos/${e}/draft/edits`)).then((t) => t.data),
|
|
253
256
|
/** 409 HELP_VIDEO_EDITS_CONFLICT (with `current_hash`) when `base_hash` is stale;
|
|
254
257
|
* 422 HELP_VIDEO_EDITS_INVALID when the edits keep under a second. */
|
|
255
|
-
saveDraft: (e, t, n) => a(
|
|
258
|
+
saveDraft: (e, t, n) => a(c(`/help-videos/${e}/draft/edits`, { edits: t, base_hash: n })).then(
|
|
256
259
|
(o) => o.data
|
|
257
260
|
),
|
|
258
261
|
publish: (e, t, n) => a(
|
|
@@ -275,7 +278,7 @@ function $(s) {
|
|
|
275
278
|
analytics: (e) => a(r(`/help-videos/${e}/analytics`)).then((t) => t.data),
|
|
276
279
|
/** "Was this helpful?" — one vote per person per video, changeable. 403
|
|
277
280
|
* HELP_VIDEO_MASQUERADE while viewing as someone else. */
|
|
278
|
-
rate: (e, t) => a(
|
|
281
|
+
rate: (e, t) => a(c(`/help-videos/${e}/rating`, { helpful: t })).then(
|
|
279
282
|
(n) => n.data
|
|
280
283
|
),
|
|
281
284
|
/** This person's questions on the video (authors: everyone's, with who
|
|
@@ -406,13 +409,13 @@ function $(s) {
|
|
|
406
409
|
authorRoles: () => a(r("/settings")).then(
|
|
407
410
|
(e) => {
|
|
408
411
|
var t;
|
|
409
|
-
return
|
|
412
|
+
return P((t = e.data) == null ? void 0 : t.help_video_author_roles);
|
|
410
413
|
}
|
|
411
414
|
),
|
|
412
415
|
setAuthorRoles: (e) => a(y("/settings", { help_video_author_roles: e }))
|
|
413
416
|
};
|
|
414
417
|
}
|
|
415
|
-
async function
|
|
418
|
+
async function X(s, a, e) {
|
|
416
419
|
const t = new FormData();
|
|
417
420
|
t.append("file", e, e.name);
|
|
418
421
|
const n = await fetch(`${s.apiBase}/help-videos/${encodeURIComponent(a)}/music`, {
|
|
@@ -422,15 +425,15 @@ async function W(s, a, e) {
|
|
|
422
425
|
body: t
|
|
423
426
|
}), o = await n.json().catch(() => ({}));
|
|
424
427
|
if (!n.ok || !o.data) {
|
|
425
|
-
const
|
|
426
|
-
throw Object.assign(new Error(
|
|
428
|
+
const h = o.message || o.error;
|
|
429
|
+
throw Object.assign(new Error(h || "The music could not be uploaded"), {
|
|
427
430
|
status: n.status,
|
|
428
431
|
code: o.code
|
|
429
432
|
});
|
|
430
433
|
}
|
|
431
434
|
return o.data;
|
|
432
435
|
}
|
|
433
|
-
function
|
|
436
|
+
function Y(s) {
|
|
434
437
|
var e, t;
|
|
435
438
|
if (!s || typeof s != "object") return null;
|
|
436
439
|
const a = s;
|
|
@@ -440,7 +443,7 @@ function G(s) {
|
|
|
440
443
|
...typeof ((t = a.response) == null ? void 0 : t.current_hash) == "string" ? { current_hash: a.response.current_hash } : {}
|
|
441
444
|
};
|
|
442
445
|
}
|
|
443
|
-
function
|
|
446
|
+
function P(s) {
|
|
444
447
|
return (() => {
|
|
445
448
|
if (Array.isArray(s)) return s;
|
|
446
449
|
if (typeof s != "string" || !s.trim()) return [];
|
|
@@ -452,16 +455,16 @@ function C(s) {
|
|
|
452
455
|
}
|
|
453
456
|
})().filter((e) => typeof e == "string" && e.length > 0);
|
|
454
457
|
}
|
|
455
|
-
function
|
|
458
|
+
function L(s, a) {
|
|
456
459
|
var t;
|
|
457
460
|
const e = s ? s.card_logo_url ?? s.logo_url : null;
|
|
458
461
|
return {
|
|
459
462
|
name: ((t = s == null ? void 0 : s.name) == null ? void 0 : t.trim()) || null,
|
|
460
|
-
color:
|
|
463
|
+
color: _(s == null ? void 0 : s.color),
|
|
461
464
|
logo: e ? `${a}${e}` : null
|
|
462
465
|
};
|
|
463
466
|
}
|
|
464
|
-
function
|
|
467
|
+
function Z(s, a) {
|
|
465
468
|
var n;
|
|
466
469
|
const e = d(), t = u({
|
|
467
470
|
queryKey: ["help-video-card-brand"],
|
|
@@ -469,32 +472,32 @@ function X(s, a) {
|
|
|
469
472
|
staleTime: 5 * 6e4,
|
|
470
473
|
queryFn: () => e.request(r("/auth/branding"))
|
|
471
474
|
});
|
|
472
|
-
return
|
|
475
|
+
return L((n = t.data) == null ? void 0 : n.data, a);
|
|
473
476
|
}
|
|
474
477
|
export {
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
+
L as cardBrandFrom,
|
|
479
|
+
C as clipsInFlight,
|
|
480
|
+
K as fetchHelpVideo,
|
|
478
481
|
$ as helpVideoApi,
|
|
479
|
-
|
|
482
|
+
Y as helpVideoError,
|
|
480
483
|
l as helpVideoKeys,
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
484
|
+
E as learningPathApi,
|
|
485
|
+
V as nextLibraryPage,
|
|
486
|
+
P as parseRoleIdList,
|
|
487
|
+
X as uploadMusicFile,
|
|
488
|
+
Z as useCardBrand,
|
|
489
|
+
I as useHelpVideo,
|
|
490
|
+
W as useHelpVideoClips,
|
|
491
|
+
z as useHelpVideoLibrary,
|
|
492
|
+
v as useHelpVideoLive,
|
|
493
|
+
J as useHelpVideoNext,
|
|
494
|
+
G as useHelpVideoPages,
|
|
495
|
+
B as useHelpVideoQuestions,
|
|
496
|
+
N as useHelpVideoWalk,
|
|
497
|
+
M as useHelpVideosFor,
|
|
498
|
+
O as useHelpVideosForForm,
|
|
499
|
+
D as useLearningPaths,
|
|
500
|
+
j as useMyLearningPaths,
|
|
501
|
+
Q as useRequiredList,
|
|
502
|
+
S as useRequiredVideos
|
|
500
503
|
};
|