@nivaro/react 0.2.53 → 0.2.54
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 +1 -1
- package/dist/index.d.ts +113 -2
- package/dist/layout-editor.d.ts +248 -2
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +4058 -3942
- package/dist/shared/components/RecordReadView.js +219 -211
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/help-videos/api.js +51 -41
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/FieldAffordances.js +7 -6
- package/dist/shared/components/item-edit/FieldRow.js +353 -304
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +419 -396
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/lock-why.js +87 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +59 -0
- package/dist/shared/components/layout-editor/AddPanel.js +204 -146
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +146 -0
- package/dist/shared/components/layout-editor/CollabParts.js +170 -0
- package/dist/shared/components/layout-editor/DesignNode.js +304 -115
- package/dist/shared/components/layout-editor/EditorCanvas.js +21 -20
- package/dist/shared/components/layout-editor/EditorTopBar.js +452 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +234 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1101 -307
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +413 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +342 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +77 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +179 -163
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +61 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +175 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +146 -92
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +256 -175
- package/dist/shared/components/layout-editor/inspector/LookTab.js +46 -40
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +167 -141
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +175 -128
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +3 -3
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +18 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +123 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +174 -100
- package/dist/shared/components/layout-editor/settings/WhoSection.js +136 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +35 -11
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/structure-ops.js +399 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +551 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +393 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +158 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -307
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/form-usage-beacon.js +84 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +110 -106
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/visible-when.js +34 -0
- package/package.json +1 -1
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useQueryClient as I, useQuery as _ } from "@tanstack/react-query";
|
|
3
|
+
import { PlayCircle as L, X as Q, Plus as R, StickyNote as V } from "lucide-react";
|
|
4
|
+
import { useState as y, useEffect as j } from "react";
|
|
5
|
+
import { useNivaroClient as T } from "../../../context.js";
|
|
6
|
+
import { get as $ } from "../../../lib/commands.js";
|
|
7
|
+
import { cn as K } from "../../../lib/utils.js";
|
|
8
|
+
import { useHelpVideosForForm as X, fetchHelpVideo as M, helpVideoApi as D } from "../../help-videos/api.js";
|
|
9
|
+
import { Command as z, CommandInput as G, CommandList as J, CommandEmpty as U, CommandItem as W } from "../../ui/command.js";
|
|
10
|
+
import { Popover as Y, PopoverTrigger as Z, PopoverContent as ee } from "../../ui/popover.js";
|
|
11
|
+
import { noteOf as te, NOTE_TEXT_MAX as oe, noteByline as ae, noteOps as re } from "../editor-notes.js";
|
|
12
|
+
import { inputBase as ne } from "../panel-style.js";
|
|
13
|
+
import { useInspectorEnv as q, Setting as A } from "./kit.js";
|
|
14
|
+
const E = "inline-flex h-7 items-center gap-1 rounded-md border border-slate-200 bg-white px-2.5 text-[12px] font-medium text-slate-700 transition-colors hover:bg-slate-50 disabled:opacity-40 dark:border-border dark:bg-background dark:text-foreground dark:hover:bg-muted", ie = "inline-flex h-7 items-center rounded-md bg-nvr-cyan px-2.5 text-[12px] font-medium text-white transition-colors hover:bg-[#00b8e0] disabled:opacity-40";
|
|
15
|
+
function se() {
|
|
16
|
+
const n = T();
|
|
17
|
+
return _({
|
|
18
|
+
queryKey: ["layout-editor", "me"],
|
|
19
|
+
staleTime: 10 * 6e4,
|
|
20
|
+
queryFn: () => n.request($("/users/me")).then((r) => r.data)
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function ke({ target: n, name: r }) {
|
|
24
|
+
const c = q(), { data: a } = se(), t = te(c.bundle, n), [p, i] = y((t == null ? void 0 : t.text) ?? "");
|
|
25
|
+
j(() => i((t == null ? void 0 : t.text) ?? ""), [t == null ? void 0 : t.text]);
|
|
26
|
+
const m = p.trim() !== ((t == null ? void 0 : t.text) ?? ""), d = (l, f) => {
|
|
27
|
+
const h = re(c.bundle, n, l);
|
|
28
|
+
h.length && c.apply(h, { label: f });
|
|
29
|
+
}, u = () => {
|
|
30
|
+
if (!p.trim()) return d(null, `Remove the note on ${r}`);
|
|
31
|
+
const l = [a == null ? void 0 : a.first_name, a == null ? void 0 : a.last_name].filter(Boolean).join(" ") || (a == null ? void 0 : a.email) || null;
|
|
32
|
+
d(
|
|
33
|
+
{ text: p, by: (a == null ? void 0 : a.id) ?? null, by_name: l, at: (/* @__PURE__ */ new Date()).toISOString() },
|
|
34
|
+
t ? `Change the note on ${r}` : `Pin a note to ${r}`
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
return /* @__PURE__ */ s(
|
|
38
|
+
A,
|
|
39
|
+
{
|
|
40
|
+
k: "editor.note",
|
|
41
|
+
label: /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
42
|
+
/* @__PURE__ */ o(V, { "aria-hidden": !0, className: "h-3.5 w-3.5 text-amber-500" }),
|
|
43
|
+
"Note for editors"
|
|
44
|
+
] }),
|
|
45
|
+
effect: "Only people editing this form see it, as a marker on the canvas. Record pages never show it.",
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ o(
|
|
48
|
+
"textarea",
|
|
49
|
+
{
|
|
50
|
+
"aria-label": "Note for editors",
|
|
51
|
+
rows: 3,
|
|
52
|
+
maxLength: oe,
|
|
53
|
+
value: p,
|
|
54
|
+
placeholder: "Finance asked for this in Q3",
|
|
55
|
+
onChange: (l) => i(l.target.value),
|
|
56
|
+
className: K(ne, "h-auto py-1.5 leading-snug")
|
|
57
|
+
}
|
|
58
|
+
),
|
|
59
|
+
t && /* @__PURE__ */ o("p", { "data-note-byline": "", className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: ae(t) }),
|
|
60
|
+
/* @__PURE__ */ s("div", { className: "flex flex-wrap gap-2", children: [
|
|
61
|
+
/* @__PURE__ */ o(
|
|
62
|
+
"button",
|
|
63
|
+
{
|
|
64
|
+
type: "button",
|
|
65
|
+
"data-note-save": "",
|
|
66
|
+
className: ie,
|
|
67
|
+
disabled: !m,
|
|
68
|
+
onClick: u,
|
|
69
|
+
children: t ? "Save note" : "Pin note"
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
t && /* @__PURE__ */ o(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
"data-note-remove": "",
|
|
77
|
+
className: E,
|
|
78
|
+
onClick: () => d(null, `Remove the note on ${r}`),
|
|
79
|
+
children: "Remove"
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
] })
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
function Ne({
|
|
88
|
+
kind: n,
|
|
89
|
+
name: r,
|
|
90
|
+
label: c
|
|
91
|
+
}) {
|
|
92
|
+
var w, C;
|
|
93
|
+
const a = q(), t = T(), p = I(), { data: i } = X(a.collection), m = n === "field" ? (w = i == null ? void 0 : i.fields) == null ? void 0 : w[r] : (C = i == null ? void 0 : i.sections) == null ? void 0 : C[r], d = Array.isArray(m) ? m : [], [u, l] = y(!1), [f, h] = y(!1), [v, k] = y(null), x = _({
|
|
94
|
+
queryKey: ["help-videos", "library", { status: "published", picker: !0 }],
|
|
95
|
+
enabled: u,
|
|
96
|
+
staleTime: 6e4,
|
|
97
|
+
queryFn: () => t.request($("/help-videos", { status: "published", limit: 100 })).then((e) => e.data)
|
|
98
|
+
}), b = { kind: n, key: a.collection, state_key: r }, O = (e) => e.kind === b.kind && e.key === b.key && e.state_key === b.state_key, N = async (e, F) => {
|
|
99
|
+
h(!0), k(null);
|
|
100
|
+
try {
|
|
101
|
+
const S = ((await M(t, e)).contexts ?? []).filter((H) => !O(H));
|
|
102
|
+
await D(t).setContexts(e, F ? [...S, b] : S), await p.invalidateQueries({ queryKey: ["help-videos"] });
|
|
103
|
+
} catch (g) {
|
|
104
|
+
k(g instanceof Error ? g.message : "Could not change the video");
|
|
105
|
+
} finally {
|
|
106
|
+
h(!1);
|
|
107
|
+
}
|
|
108
|
+
}, P = new Set(d.map((e) => e.id)), B = (Array.isArray(x.data) ? x.data : []).filter(
|
|
109
|
+
(e) => !P.has(e.id)
|
|
110
|
+
);
|
|
111
|
+
return /* @__PURE__ */ s(
|
|
112
|
+
A,
|
|
113
|
+
{
|
|
114
|
+
k: n === "field" ? "field.help_video" : "group.help_video",
|
|
115
|
+
label: "Help video",
|
|
116
|
+
scope: n === "field" ? "field" : "form",
|
|
117
|
+
effect: `A play button beside ${c} opens the video on the record page, for the roles allowed to see it.`,
|
|
118
|
+
children: [
|
|
119
|
+
d.length > 0 && /* @__PURE__ */ o("ul", { className: "space-y-1", children: d.map((e) => /* @__PURE__ */ s(
|
|
120
|
+
"li",
|
|
121
|
+
{
|
|
122
|
+
"data-help-video-attached": e.id,
|
|
123
|
+
className: "flex items-center gap-2 rounded-md border border-slate-200 bg-white px-2 py-1 text-[12.5px] dark:border-border dark:bg-background",
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ o(L, { "aria-hidden": !0, className: "h-3.5 w-3.5 shrink-0 text-nvr-cyan" }),
|
|
126
|
+
/* @__PURE__ */ o("span", { className: "min-w-0 flex-1 truncate text-slate-800 dark:text-foreground", children: e.title }),
|
|
127
|
+
/* @__PURE__ */ o(
|
|
128
|
+
"button",
|
|
129
|
+
{
|
|
130
|
+
type: "button",
|
|
131
|
+
"aria-label": `Take ${e.title} off ${c}`,
|
|
132
|
+
"data-tip": "Take it off",
|
|
133
|
+
disabled: f,
|
|
134
|
+
onClick: () => void N(e.id, !1),
|
|
135
|
+
className: "rounded p-0.5 text-slate-400 hover:bg-muted hover:text-slate-700 disabled:opacity-40 dark:hover:text-foreground",
|
|
136
|
+
children: /* @__PURE__ */ o(Q, { className: "h-3.5 w-3.5" })
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
e.id
|
|
142
|
+
)) }),
|
|
143
|
+
/* @__PURE__ */ s(Y, { open: u, onOpenChange: l, children: [
|
|
144
|
+
/* @__PURE__ */ o(Z, { asChild: !0, children: /* @__PURE__ */ s("button", { type: "button", className: E, disabled: f, "data-help-video-pick": "", children: [
|
|
145
|
+
/* @__PURE__ */ o(R, { className: "h-3.5 w-3.5" }),
|
|
146
|
+
"Attach a video"
|
|
147
|
+
] }) }),
|
|
148
|
+
/* @__PURE__ */ o(ee, { align: "start", className: "w-[300px] p-0", children: /* @__PURE__ */ s(z, { children: [
|
|
149
|
+
/* @__PURE__ */ o(G, { placeholder: "Find a published video…" }),
|
|
150
|
+
/* @__PURE__ */ s(J, { className: "max-h-[260px] overscroll-contain", children: [
|
|
151
|
+
/* @__PURE__ */ o(U, { children: x.isLoading ? "Loading videos…" : "No published videos to attach." }),
|
|
152
|
+
B.map((e) => /* @__PURE__ */ o(
|
|
153
|
+
W,
|
|
154
|
+
{
|
|
155
|
+
value: `${e.title} ${e.id}`,
|
|
156
|
+
onSelect: () => {
|
|
157
|
+
l(!1), N(e.id, !0);
|
|
158
|
+
},
|
|
159
|
+
children: /* @__PURE__ */ o("span", { className: "truncate", children: e.title })
|
|
160
|
+
},
|
|
161
|
+
e.id
|
|
162
|
+
))
|
|
163
|
+
] })
|
|
164
|
+
] }) })
|
|
165
|
+
] }),
|
|
166
|
+
v && /* @__PURE__ */ o("p", { role: "alert", className: "text-[12px] text-red-700 dark:text-red-300", children: v })
|
|
167
|
+
]
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
Ne as HelpVideoSetting,
|
|
173
|
+
ke as NoteSetting
|
|
174
|
+
};
|