@nivaro/react 0.3.116 → 0.3.118
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 +140 -14
- package/dist/index.js +488 -485
- package/dist/shared/components/ActivityEntry.js +130 -125
- package/dist/shared/components/AgentPresenceChip.js +36 -26
- package/dist/shared/components/CellCopyLayer.js +50 -45
- package/dist/shared/components/CollectionBrowserView.js +3855 -3785
- package/dist/shared/components/FilePreviewLightbox.js +96 -58
- package/dist/shared/components/InStep.js +18 -17
- package/dist/shared/components/ItemEditForm.js +4220 -4175
- package/dist/shared/components/JobsTray.js +8 -8
- package/dist/shared/components/LiveNewMatchesPill.js +21 -14
- package/dist/shared/components/LiveOffNote.js +3 -2
- package/dist/shared/components/LiveRowMark.js +53 -23
- package/dist/shared/components/LiveTraceView.js +162 -123
- package/dist/shared/components/MyWorkView.js +320 -299
- package/dist/shared/components/NotificationBell.js +14 -14
- package/dist/shared/components/OverflowRail.js +1 -1
- package/dist/shared/components/PageRenderer.js +120 -116
- package/dist/shared/components/ProfileView.js +203 -202
- package/dist/shared/components/RealtimeStatusBanner.js +31 -29
- package/dist/shared/components/RecordDrilldownSheet.js +7 -7
- package/dist/shared/components/RecordHoverCard.js +102 -84
- package/dist/shared/components/RecordReadView.js +146 -146
- package/dist/shared/components/ReportView.js +1086 -1091
- package/dist/shared/components/ScreenRefreshButton.js +34 -32
- package/dist/shared/components/TipLayer.js +65 -58
- package/dist/shared/components/WidgetImageMenu.js +83 -43
- package/dist/shared/components/activity/RecordActivityStream.js +175 -173
- package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
- package/dist/shared/components/cbv/column-totals.js +62 -57
- package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
- package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
- package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
- package/dist/shared/components/charts/category-axis.js +93 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
- package/dist/shared/components/collections-directory/page-model.js +72 -67
- package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
- package/dist/shared/components/integrations/SendStatus.js +65 -59
- package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
- package/dist/shared/components/integrations/console/SignalCard.js +237 -230
- package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
- package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
- package/dist/shared/components/item-edit/CloneDialog.js +191 -161
- package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
- package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
- package/dist/shared/components/item-edit/FieldComments.js +54 -53
- package/dist/shared/components/item-edit/FieldPointer.js +82 -67
- package/dist/shared/components/item-edit/FieldRow.js +106 -100
- package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
- package/dist/shared/components/item-edit/FilePickerField.js +452 -387
- package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
- package/dist/shared/components/item-edit/HeaderTools.js +94 -85
- package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
- package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
- package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
- package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
- package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
- package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
- package/dist/shared/components/item-edit/RecalcValue.js +57 -32
- package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
- package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
- package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
- package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
- package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
- package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
- package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
- package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
- package/dist/shared/components/item-edit/SectionPresence.js +18 -10
- package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
- package/dist/shared/components/item-edit/UserChip.js +1 -1
- package/dist/shared/components/item-edit/file-live.js +69 -54
- package/dist/shared/components/item-edit/layout-switch.js +98 -89
- package/dist/shared/components/item-edit/partner-needs.js +12 -12
- package/dist/shared/components/item-edit/removed-line.js +31 -25
- package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
- package/dist/shared/components/list/ListViewers.js +46 -35
- package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
- package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
- package/dist/shared/components/panels/AlertBanners.js +82 -72
- package/dist/shared/components/panels/BranchLanes.js +22 -22
- package/dist/shared/components/panels/CommentImages.js +123 -102
- package/dist/shared/components/panels/CommentPanel.js +186 -185
- package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
- package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
- package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
- package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
- package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
- package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
- package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
- package/dist/shared/components/profile/AgentNameField.js +107 -81
- package/dist/shared/components/profile/AgentsPanel.js +184 -184
- package/dist/shared/components/profile/PersonAccess.js +599 -495
- package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
- package/dist/shared/components/profile/SignedInDevices.js +17 -17
- package/dist/shared/components/profile/primitives.js +1 -1
- package/dist/shared/components/queue/OwnerAvatars.js +91 -54
- package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
- package/dist/shared/components/queue/QueueWorklist.js +1002 -983
- package/dist/shared/components/support/AssignRules.js +1733 -0
- package/dist/shared/components/support/PersonPick.js +88 -0
- package/dist/shared/components/support/RequestList.js +790 -0
- package/dist/shared/components/support/ScreenShare.js +158 -152
- package/dist/shared/components/support/SupportRequestDialog.js +50 -48
- package/dist/shared/components/support/SupportView.js +140 -246
- package/dist/shared/components/support/TicketDetailSheet.js +82 -75
- package/dist/shared/components/support/TicketSlowScreens.js +9 -9
- package/dist/shared/components/support/assign-rules-text.js +171 -0
- package/dist/shared/components/support/support-list.js +125 -0
- package/dist/shared/components/ui/SimpleSelect.js +28 -20
- package/dist/shared/components/ui/checkbox.js +6 -6
- package/dist/shared/components/ui/select.js +43 -39
- package/dist/shared/components/ui/sheet.js +9 -9
- package/dist/shared/components/ui/switch.js +12 -11
- package/dist/shared/components/watch-list/WatchDock.js +532 -459
- package/dist/shared/components/watch-list/WatchExtras.js +332 -286
- package/dist/shared/components/watch-list/WatchRows.js +164 -140
- package/dist/shared/lib/activity-sentence.js +103 -91
- package/dist/shared/lib/agent-presence.js +27 -21
- package/dist/shared/lib/approval-progress.js +2 -2
- package/dist/shared/lib/copy-rules.js +31 -24
- package/dist/shared/lib/derived-causes.js +113 -78
- package/dist/shared/lib/grid-cursors.js +26 -26
- package/dist/shared/lib/label-flash.js +27 -0
- package/dist/shared/lib/list-return.js +137 -125
- package/dist/shared/lib/live-deltas.js +40 -34
- package/dist/shared/lib/live-groups.js +56 -52
- package/dist/shared/lib/live-preference.js +64 -59
- package/dist/shared/lib/live-screen.js +223 -192
- package/dist/shared/lib/partner-failure.js +11 -11
- package/dist/shared/lib/rollup-recalc.js +68 -64
- package/dist/shared/lib/screen-refresh.js +74 -68
- package/dist/shared/lib/screen-share.js +108 -104
- package/dist/shared/lib/send-status.js +77 -61
- package/dist/shared/lib/text-diff-window.js +29 -0
- package/dist/shared/lib/use-query-entry.js +17 -0
- package/dist/shared/lib/watch-list.js +210 -209
- package/dist/shared/lib/widget-image-render.js +72 -49
- package/package.json +1 -1
|
@@ -1,112 +1,114 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useQuery as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useEditor as
|
|
7
|
-
import
|
|
8
|
-
import { Bold as
|
|
9
|
-
import { useState as w, useRef as
|
|
10
|
-
import { useApiFetchConfig as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
|
|
1
|
+
import { jsxs as g, Fragment as Y, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery as U } from "@tanstack/react-query";
|
|
3
|
+
import G from "@tiptap/extension-link";
|
|
4
|
+
import Z from "@tiptap/extension-placeholder";
|
|
5
|
+
import ee from "@tiptap/extension-underline";
|
|
6
|
+
import { useEditor as te, EditorContent as re } from "@tiptap/react";
|
|
7
|
+
import ie from "@tiptap/starter-kit";
|
|
8
|
+
import { Bold as ne, Italic as oe, UnderlineIcon as ae, Strikethrough as le, Heading1 as se, Heading2 as ce, Heading3 as de, List as pe, ListOrdered as ue, Quote as he, Code as fe, Minus as me, Link as ge, Link2Off as be, FileSymlink as K, Check as ke, X as J, Loader2 as xe } from "lucide-react";
|
|
9
|
+
import { useState as w, useRef as S, useMemo as F, useEffect as R } from "react";
|
|
10
|
+
import { useApiFetchConfig as ve, useItemNavigation as _e } from "../../context.js";
|
|
11
|
+
import { useFieldEditors as ye } from "../../lib/co-edit.js";
|
|
12
|
+
import { cn as z } from "../../lib/utils.js";
|
|
13
|
+
import { SimpleSelect as we } from "../ui/SimpleSelect.js";
|
|
14
|
+
import { COEDIT_REMOTE as Ne } from "./coedit/collab.js";
|
|
15
|
+
import { CoeditCursors as Ce, COEDIT_CURSOR_CSS as Le } from "./coedit/cursors.js";
|
|
16
|
+
import { isSafeLinkHref as Se } from "./coedit/safe-link.js";
|
|
17
|
+
import { coeditColor as De } from "./coedit/session.js";
|
|
18
|
+
import { useCoedit as Ae } from "./coedit/useCoedit.js";
|
|
19
|
+
function E(t) {
|
|
18
20
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
19
21
|
}
|
|
20
|
-
function
|
|
22
|
+
function $e(t) {
|
|
21
23
|
try {
|
|
22
24
|
return (JSON.parse(t || "{}").blocks ?? []).map((a) => {
|
|
23
|
-
const
|
|
25
|
+
const s = E(String(a.data.text ?? "")), c = Math.max(1, Math.min(6, Number(a.data.level ?? 2)));
|
|
24
26
|
switch (a.type) {
|
|
25
27
|
case "paragraph":
|
|
26
|
-
return `<p>${
|
|
28
|
+
return `<p>${s}</p>`;
|
|
27
29
|
case "header":
|
|
28
|
-
return `<h${c}>${
|
|
30
|
+
return `<h${c}>${s}</h${c}>`;
|
|
29
31
|
case "list": {
|
|
30
|
-
const
|
|
31
|
-
return a.data.style === "ordered" ? `<ol>${
|
|
32
|
+
const l = (a.data.items ?? []).map((N) => `<li>${E(N)}</li>`).join("");
|
|
33
|
+
return a.data.style === "ordered" ? `<ol>${l}</ol>` : `<ul>${l}</ul>`;
|
|
32
34
|
}
|
|
33
35
|
case "quote":
|
|
34
|
-
return `<blockquote><p>${
|
|
36
|
+
return `<blockquote><p>${s}</p></blockquote>`;
|
|
35
37
|
default:
|
|
36
|
-
return
|
|
38
|
+
return s ? `<p>${s}</p>` : "";
|
|
37
39
|
}
|
|
38
40
|
}).join("");
|
|
39
41
|
} catch {
|
|
40
|
-
return `<p>${
|
|
42
|
+
return `<p>${E(t)}</p>`;
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
|
-
const
|
|
45
|
+
const He = 2e3;
|
|
44
46
|
function M(t) {
|
|
45
|
-
return t ? t.trimStart().startsWith('{"time":') && t.includes('"blocks":') ?
|
|
47
|
+
return t ? t.trimStart().startsWith('{"time":') && t.includes('"blocks":') ? $e(t) : t : "";
|
|
46
48
|
}
|
|
47
|
-
function
|
|
49
|
+
function d({
|
|
48
50
|
active: t,
|
|
49
|
-
title:
|
|
51
|
+
title: p,
|
|
50
52
|
onClick: a,
|
|
51
|
-
children:
|
|
53
|
+
children: s
|
|
52
54
|
}) {
|
|
53
55
|
return /* @__PURE__ */ e(
|
|
54
56
|
"button",
|
|
55
57
|
{
|
|
56
58
|
type: "button",
|
|
57
|
-
title:
|
|
59
|
+
title: p,
|
|
58
60
|
onMouseDown: (c) => {
|
|
59
61
|
c.preventDefault(), a();
|
|
60
62
|
},
|
|
61
|
-
className:
|
|
63
|
+
className: z(
|
|
62
64
|
"flex h-6 w-6 items-center justify-center rounded text-slate-500 transition-colors hover:bg-slate-200 hover:text-slate-700 dark:text-slate-300 dark:hover:bg-[#334155] dark:hover:text-white",
|
|
63
65
|
t && "bg-slate-200 text-slate-900 dark:bg-[#334155] dark:text-white"
|
|
64
66
|
),
|
|
65
|
-
children:
|
|
67
|
+
children: s
|
|
66
68
|
}
|
|
67
69
|
);
|
|
68
70
|
}
|
|
69
|
-
function
|
|
71
|
+
function H() {
|
|
70
72
|
return /* @__PURE__ */ e("div", { className: "mx-0.5 h-4 w-px bg-slate-200 dark:bg-[#475569]" });
|
|
71
73
|
}
|
|
72
|
-
function
|
|
74
|
+
function et({
|
|
73
75
|
value: t,
|
|
74
|
-
onChange:
|
|
76
|
+
onChange: p,
|
|
75
77
|
placeholder: a,
|
|
76
|
-
disabled:
|
|
78
|
+
disabled: s,
|
|
77
79
|
pastePlain: c,
|
|
78
|
-
coedit:
|
|
80
|
+
coedit: l
|
|
79
81
|
}) {
|
|
80
|
-
const [N,
|
|
82
|
+
const [N, x] = w(!1), [C, b] = w(""), [D, y] = w(!1), v = S(null), _ = ve(), k = _e(), A = F(() => M(t), [t]), n = S(null), u = S([]), r = te({
|
|
81
83
|
immediatelyRender: !1,
|
|
82
84
|
extensions: [
|
|
83
85
|
// StarterKit 3 bundles its own Link (autolink on) and Underline; they are
|
|
84
86
|
// registered below with this editor's options, so the kit's copies stay out.
|
|
85
|
-
|
|
87
|
+
ie.configure({
|
|
86
88
|
bulletList: { keepMarks: !0 },
|
|
87
89
|
orderedList: { keepMarks: !0 },
|
|
88
90
|
link: !1,
|
|
89
91
|
underline: !1
|
|
90
92
|
}),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
ee,
|
|
94
|
+
Z.configure({ placeholder: a ?? "Start writing…" }),
|
|
93
95
|
// 'record' protocol (#666): record://<collection>/<id> links survive the
|
|
94
96
|
// Link extension's allowed-URI validation and render as record chips.
|
|
95
97
|
// No autolink while typing: EFP site codes read like domains (byron.il,
|
|
96
98
|
// oswego.il) and every one became a bogus http:// link in notes that go
|
|
97
99
|
// to suppliers. Links are explicit — the toolbar, or pasting a URL.
|
|
98
100
|
// Never a script / data / file href, whoever typed it (co-edited text included, L7).
|
|
99
|
-
|
|
101
|
+
G.configure({
|
|
100
102
|
openOnClick: !1,
|
|
101
103
|
autolink: !1,
|
|
102
104
|
protocols: ["record"],
|
|
103
|
-
isAllowedUri: (i, o) =>
|
|
105
|
+
isAllowedUri: (i, o) => Se(i) && o.defaultValidate(i)
|
|
104
106
|
}),
|
|
105
107
|
// Others' cursors while people write here together (inert otherwise).
|
|
106
|
-
|
|
108
|
+
Ce
|
|
107
109
|
],
|
|
108
110
|
content: A,
|
|
109
|
-
editable: !
|
|
111
|
+
editable: !s,
|
|
110
112
|
// NEVER undefined: an explicit `editorProps: undefined` overrides tiptap's
|
|
111
113
|
// `{}` default in the options merge, and 3.26's createView reads
|
|
112
114
|
// `editorProps.dispatchTransaction` unguarded — every non-pastePlain
|
|
@@ -114,208 +116,211 @@ function ze({
|
|
|
114
116
|
editorProps: c ? {
|
|
115
117
|
handlePaste(i, o) {
|
|
116
118
|
var h;
|
|
117
|
-
const
|
|
118
|
-
return
|
|
119
|
+
const m = (h = o.clipboardData) == null ? void 0 : h.getData("text/plain");
|
|
120
|
+
return m == null ? !1 : (o.preventDefault(), i.dispatch(i.state.tr.insertText(m)), !0);
|
|
119
121
|
}
|
|
120
122
|
} : {},
|
|
121
123
|
onUpdate({ editor: i, transaction: o }) {
|
|
122
124
|
var L;
|
|
123
|
-
if (o.getMeta(
|
|
124
|
-
const
|
|
125
|
-
h.push({ html:
|
|
125
|
+
if (o.getMeta(Ne) && !((L = n.current) != null && L.tracking())) return;
|
|
126
|
+
const m = i.getHTML(), h = u.current;
|
|
127
|
+
h.push({ html: m, at: Date.now() }), h.length > 64 && h.shift(), p(m);
|
|
126
128
|
}
|
|
127
|
-
}),
|
|
128
|
-
n.current =
|
|
129
|
-
const
|
|
129
|
+
}), f = Ae(r, l ?? null, t, M);
|
|
130
|
+
n.current = f.session;
|
|
131
|
+
const Q = ye(l == null ? void 0 : l.collection, l == null ? void 0 : l.item), $ = l ? Q[l.field] : void 0, V = F(
|
|
132
|
+
() => f.peers.length || !f.diverged || !$ ? f.peers : [{ name: $.name, color: De(String($.id)) }],
|
|
133
|
+
[f.peers, f.diverged, $]
|
|
134
|
+
), q = S(null);
|
|
130
135
|
R(() => {
|
|
131
136
|
var o;
|
|
132
137
|
const i = (o = q.current) == null ? void 0 : o.closest("[data-field]");
|
|
133
138
|
if (i)
|
|
134
|
-
return i.toggleAttribute("data-coedit-live",
|
|
135
|
-
}, [
|
|
136
|
-
const O =
|
|
139
|
+
return i.toggleAttribute("data-coedit-live", f.live), () => i.removeAttribute("data-coedit-live");
|
|
140
|
+
}, [f.live]);
|
|
141
|
+
const O = S(t);
|
|
137
142
|
if (R(() => {
|
|
138
143
|
if (!r || O.current === t) return;
|
|
139
144
|
O.current = t;
|
|
140
145
|
const i = Date.now();
|
|
141
|
-
if (u.current.some((h) => h.html === t && i - h.at <
|
|
146
|
+
if (u.current.some((h) => h.html === t && i - h.at < He)) return;
|
|
142
147
|
const o = n.current;
|
|
143
148
|
if (o != null && o.isLive() && (r.isFocused || !o.tracking())) return;
|
|
144
|
-
const
|
|
145
|
-
r.getHTML() !==
|
|
149
|
+
const m = M(t);
|
|
150
|
+
r.getHTML() !== m && r.commands.setContent(m, { emitUpdate: !1 });
|
|
146
151
|
}, [r, t]), !r) return null;
|
|
147
|
-
const
|
|
152
|
+
const X = () => {
|
|
148
153
|
const i = r.getAttributes("link").href;
|
|
149
|
-
|
|
154
|
+
b(i ?? "https://"), x(!0), setTimeout(() => {
|
|
150
155
|
var o;
|
|
151
|
-
return (o =
|
|
156
|
+
return (o = v.current) == null ? void 0 : o.select();
|
|
152
157
|
}, 0);
|
|
153
158
|
}, T = () => {
|
|
154
|
-
C === "" ? r.chain().focus().extendMarkRange("link").unsetLink().run() : r.chain().focus().extendMarkRange("link").setLink({ href: C }).run(),
|
|
155
|
-
},
|
|
156
|
-
|
|
159
|
+
C === "" ? r.chain().focus().extendMarkRange("link").unsetLink().run() : r.chain().focus().extendMarkRange("link").setLink({ href: C }).run(), x(!1), b("");
|
|
160
|
+
}, I = () => {
|
|
161
|
+
x(!1), b("");
|
|
157
162
|
};
|
|
158
|
-
return /* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ g(
|
|
159
164
|
"div",
|
|
160
165
|
{
|
|
161
166
|
ref: q,
|
|
162
|
-
className:
|
|
167
|
+
className: z(
|
|
163
168
|
"overflow-hidden rounded-md border border-slate-200 bg-background focus-within:ring-1 focus-within:ring-nvr-cyan focus-within:border-nvr-cyan dark:border-border",
|
|
164
|
-
|
|
169
|
+
s && "opacity-60"
|
|
165
170
|
),
|
|
166
171
|
children: [
|
|
167
|
-
!
|
|
168
|
-
/* @__PURE__ */
|
|
172
|
+
!s && /* @__PURE__ */ g(Y, { children: [
|
|
173
|
+
/* @__PURE__ */ g("div", { className: "flex flex-wrap items-center gap-0.5 border-b border-slate-200 bg-slate-50 px-2 py-1.5 dark:border-border dark:bg-muted", children: [
|
|
169
174
|
/* @__PURE__ */ e(
|
|
170
|
-
|
|
175
|
+
d,
|
|
171
176
|
{
|
|
172
177
|
title: "Bold",
|
|
173
178
|
active: r.isActive("bold"),
|
|
174
179
|
onClick: () => r.chain().focus().toggleBold().run(),
|
|
175
|
-
children: /* @__PURE__ */ e(
|
|
180
|
+
children: /* @__PURE__ */ e(ne, { className: "h-3.5 w-3.5" })
|
|
176
181
|
}
|
|
177
182
|
),
|
|
178
183
|
/* @__PURE__ */ e(
|
|
179
|
-
|
|
184
|
+
d,
|
|
180
185
|
{
|
|
181
186
|
title: "Italic",
|
|
182
187
|
active: r.isActive("italic"),
|
|
183
188
|
onClick: () => r.chain().focus().toggleItalic().run(),
|
|
184
|
-
children: /* @__PURE__ */ e(
|
|
189
|
+
children: /* @__PURE__ */ e(oe, { className: "h-3.5 w-3.5" })
|
|
185
190
|
}
|
|
186
191
|
),
|
|
187
192
|
/* @__PURE__ */ e(
|
|
188
|
-
|
|
193
|
+
d,
|
|
189
194
|
{
|
|
190
195
|
title: "Underline",
|
|
191
196
|
active: r.isActive("underline"),
|
|
192
197
|
onClick: () => r.chain().focus().toggleUnderline().run(),
|
|
193
|
-
children: /* @__PURE__ */ e(
|
|
198
|
+
children: /* @__PURE__ */ e(ae, { className: "h-3.5 w-3.5" })
|
|
194
199
|
}
|
|
195
200
|
),
|
|
196
201
|
/* @__PURE__ */ e(
|
|
197
|
-
|
|
202
|
+
d,
|
|
198
203
|
{
|
|
199
204
|
title: "Strikethrough",
|
|
200
205
|
active: r.isActive("strike"),
|
|
201
206
|
onClick: () => r.chain().focus().toggleStrike().run(),
|
|
202
|
-
children: /* @__PURE__ */ e(
|
|
207
|
+
children: /* @__PURE__ */ e(le, { className: "h-3.5 w-3.5" })
|
|
203
208
|
}
|
|
204
209
|
),
|
|
205
|
-
/* @__PURE__ */ e(
|
|
210
|
+
/* @__PURE__ */ e(H, {}),
|
|
206
211
|
/* @__PURE__ */ e(
|
|
207
|
-
|
|
212
|
+
d,
|
|
208
213
|
{
|
|
209
214
|
title: "Heading 1",
|
|
210
215
|
active: r.isActive("heading", { level: 1 }),
|
|
211
216
|
onClick: () => r.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
212
|
-
children: /* @__PURE__ */ e(
|
|
217
|
+
children: /* @__PURE__ */ e(se, { className: "h-3.5 w-3.5" })
|
|
213
218
|
}
|
|
214
219
|
),
|
|
215
220
|
/* @__PURE__ */ e(
|
|
216
|
-
|
|
221
|
+
d,
|
|
217
222
|
{
|
|
218
223
|
title: "Heading 2",
|
|
219
224
|
active: r.isActive("heading", { level: 2 }),
|
|
220
225
|
onClick: () => r.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
221
|
-
children: /* @__PURE__ */ e(
|
|
226
|
+
children: /* @__PURE__ */ e(ce, { className: "h-3.5 w-3.5" })
|
|
222
227
|
}
|
|
223
228
|
),
|
|
224
229
|
/* @__PURE__ */ e(
|
|
225
|
-
|
|
230
|
+
d,
|
|
226
231
|
{
|
|
227
232
|
title: "Heading 3",
|
|
228
233
|
active: r.isActive("heading", { level: 3 }),
|
|
229
234
|
onClick: () => r.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
230
|
-
children: /* @__PURE__ */ e(
|
|
235
|
+
children: /* @__PURE__ */ e(de, { className: "h-3.5 w-3.5" })
|
|
231
236
|
}
|
|
232
237
|
),
|
|
233
|
-
/* @__PURE__ */ e(
|
|
238
|
+
/* @__PURE__ */ e(H, {}),
|
|
234
239
|
/* @__PURE__ */ e(
|
|
235
|
-
|
|
240
|
+
d,
|
|
236
241
|
{
|
|
237
242
|
title: "Bullet list",
|
|
238
243
|
active: r.isActive("bulletList"),
|
|
239
244
|
onClick: () => r.chain().focus().toggleBulletList().run(),
|
|
240
|
-
children: /* @__PURE__ */ e(
|
|
245
|
+
children: /* @__PURE__ */ e(pe, { className: "h-3.5 w-3.5" })
|
|
241
246
|
}
|
|
242
247
|
),
|
|
243
248
|
/* @__PURE__ */ e(
|
|
244
|
-
|
|
249
|
+
d,
|
|
245
250
|
{
|
|
246
251
|
title: "Ordered list",
|
|
247
252
|
active: r.isActive("orderedList"),
|
|
248
253
|
onClick: () => r.chain().focus().toggleOrderedList().run(),
|
|
249
|
-
children: /* @__PURE__ */ e(
|
|
254
|
+
children: /* @__PURE__ */ e(ue, { className: "h-3.5 w-3.5" })
|
|
250
255
|
}
|
|
251
256
|
),
|
|
252
|
-
/* @__PURE__ */ e(
|
|
257
|
+
/* @__PURE__ */ e(H, {}),
|
|
253
258
|
/* @__PURE__ */ e(
|
|
254
|
-
|
|
259
|
+
d,
|
|
255
260
|
{
|
|
256
261
|
title: "Blockquote",
|
|
257
262
|
active: r.isActive("blockquote"),
|
|
258
263
|
onClick: () => r.chain().focus().toggleBlockquote().run(),
|
|
259
|
-
children: /* @__PURE__ */ e(
|
|
264
|
+
children: /* @__PURE__ */ e(he, { className: "h-3.5 w-3.5" })
|
|
260
265
|
}
|
|
261
266
|
),
|
|
262
267
|
/* @__PURE__ */ e(
|
|
263
|
-
|
|
268
|
+
d,
|
|
264
269
|
{
|
|
265
270
|
title: "Code block",
|
|
266
271
|
active: r.isActive("codeBlock"),
|
|
267
272
|
onClick: () => r.chain().focus().toggleCodeBlock().run(),
|
|
268
|
-
children: /* @__PURE__ */ e(
|
|
273
|
+
children: /* @__PURE__ */ e(fe, { className: "h-3.5 w-3.5" })
|
|
269
274
|
}
|
|
270
275
|
),
|
|
271
276
|
/* @__PURE__ */ e(
|
|
272
|
-
|
|
277
|
+
d,
|
|
273
278
|
{
|
|
274
279
|
title: "Horizontal rule",
|
|
275
280
|
onClick: () => r.chain().focus().setHorizontalRule().run(),
|
|
276
|
-
children: /* @__PURE__ */ e(
|
|
281
|
+
children: /* @__PURE__ */ e(me, { className: "h-3.5 w-3.5" })
|
|
277
282
|
}
|
|
278
283
|
),
|
|
279
|
-
/* @__PURE__ */ e(
|
|
284
|
+
/* @__PURE__ */ e(H, {}),
|
|
280
285
|
/* @__PURE__ */ e(
|
|
281
|
-
|
|
286
|
+
d,
|
|
282
287
|
{
|
|
283
288
|
title: "Link",
|
|
284
289
|
active: r.isActive("link"),
|
|
285
|
-
onClick:
|
|
286
|
-
children: /* @__PURE__ */ e(
|
|
290
|
+
onClick: X,
|
|
291
|
+
children: /* @__PURE__ */ e(ge, { className: "h-3.5 w-3.5" })
|
|
287
292
|
}
|
|
288
293
|
),
|
|
289
294
|
r.isActive("link") && /* @__PURE__ */ e(
|
|
290
|
-
|
|
295
|
+
d,
|
|
291
296
|
{
|
|
292
297
|
title: "Remove link",
|
|
293
298
|
onClick: () => r.chain().focus().unsetLink().run(),
|
|
294
|
-
children: /* @__PURE__ */ e(
|
|
299
|
+
children: /* @__PURE__ */ e(be, { className: "h-3.5 w-3.5" })
|
|
295
300
|
}
|
|
296
301
|
),
|
|
297
302
|
/* @__PURE__ */ e(
|
|
298
|
-
|
|
303
|
+
d,
|
|
299
304
|
{
|
|
300
305
|
title: "Link record",
|
|
301
|
-
active:
|
|
306
|
+
active: D,
|
|
302
307
|
onClick: () => {
|
|
303
|
-
y((i) => !i),
|
|
308
|
+
y((i) => !i), x(!1);
|
|
304
309
|
},
|
|
305
|
-
children: /* @__PURE__ */ e(
|
|
310
|
+
children: /* @__PURE__ */ e(K, { className: "h-3.5 w-3.5" })
|
|
306
311
|
}
|
|
307
312
|
)
|
|
308
313
|
] }),
|
|
309
|
-
N && /* @__PURE__ */
|
|
314
|
+
N && /* @__PURE__ */ g("div", { className: "flex items-center gap-1.5 border-b border-slate-200 bg-slate-50 px-2 py-1.5 dark:border-border dark:bg-muted", children: [
|
|
310
315
|
/* @__PURE__ */ e(
|
|
311
316
|
"input",
|
|
312
317
|
{
|
|
313
|
-
ref:
|
|
318
|
+
ref: v,
|
|
314
319
|
type: "url",
|
|
315
320
|
value: C,
|
|
316
|
-
onChange: (i) =>
|
|
321
|
+
onChange: (i) => b(i.target.value),
|
|
317
322
|
onKeyDown: (i) => {
|
|
318
|
-
i.key === "Enter" && (i.preventDefault(), T()), i.key === "Escape" && (i.preventDefault(),
|
|
323
|
+
i.key === "Enter" && (i.preventDefault(), T()), i.key === "Escape" && (i.preventDefault(), I());
|
|
319
324
|
},
|
|
320
325
|
placeholder: "https://example.com",
|
|
321
326
|
"aria-label": "Link URL",
|
|
@@ -331,7 +336,7 @@ function ze({
|
|
|
331
336
|
i.preventDefault(), T();
|
|
332
337
|
},
|
|
333
338
|
className: "flex h-5 w-5 items-center justify-center rounded text-emerald-600 hover:bg-emerald-50",
|
|
334
|
-
children: /* @__PURE__ */ e(
|
|
339
|
+
children: /* @__PURE__ */ e(ke, { className: "h-3.5 w-3.5" })
|
|
335
340
|
}
|
|
336
341
|
),
|
|
337
342
|
/* @__PURE__ */ e(
|
|
@@ -340,19 +345,19 @@ function ze({
|
|
|
340
345
|
type: "button",
|
|
341
346
|
title: "Cancel",
|
|
342
347
|
onMouseDown: (i) => {
|
|
343
|
-
i.preventDefault(),
|
|
348
|
+
i.preventDefault(), I();
|
|
344
349
|
},
|
|
345
350
|
className: "flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100 dark:hover:bg-[#334155]",
|
|
346
|
-
children: /* @__PURE__ */ e(
|
|
351
|
+
children: /* @__PURE__ */ e(J, { className: "h-3.5 w-3.5" })
|
|
347
352
|
}
|
|
348
353
|
)
|
|
349
354
|
] }),
|
|
350
|
-
|
|
351
|
-
|
|
355
|
+
D && /* @__PURE__ */ e(
|
|
356
|
+
qe,
|
|
352
357
|
{
|
|
353
|
-
apiBase:
|
|
354
|
-
authHeaders:
|
|
355
|
-
credentials:
|
|
358
|
+
apiBase: _.apiBase,
|
|
359
|
+
authHeaders: _.authHeaders,
|
|
360
|
+
credentials: _.credentials,
|
|
356
361
|
onInsert: (i, o) => {
|
|
357
362
|
r.chain().focus().insertContent([
|
|
358
363
|
{ type: "text", text: i, marks: [{ type: "link", attrs: { href: o } }] },
|
|
@@ -372,41 +377,41 @@ function ze({
|
|
|
372
377
|
}
|
|
373
378
|
.nivaro-rich-text a[href^="record://"]::before { content: '↗ '; opacity: 0.55; }
|
|
374
379
|
.nivaro-rich-text .tiptap ::selection { background: rgb(var(--nvr-cyan-rgb, 0 206 255) / 0.26); }
|
|
375
|
-
${
|
|
380
|
+
${Le}
|
|
376
381
|
.nivaro-rich-text .tiptap > :first-child .nvr-coedit-flag {
|
|
377
382
|
bottom: auto; top: 100%; margin: 1px 0 0; border-radius: 0 3px 3px 3px;
|
|
378
383
|
}
|
|
379
384
|
` }),
|
|
380
385
|
/* @__PURE__ */ e(
|
|
381
|
-
|
|
386
|
+
re,
|
|
382
387
|
{
|
|
383
388
|
onClick: (i) => {
|
|
384
389
|
var h, L;
|
|
385
|
-
const o = (L = (h = i.target).closest) == null ? void 0 : L.call(h, "a"),
|
|
386
|
-
if (
|
|
390
|
+
const o = (L = (h = i.target).closest) == null ? void 0 : L.call(h, "a"), m = (o == null ? void 0 : o.getAttribute("href")) ?? "";
|
|
391
|
+
if (m.startsWith("record://")) {
|
|
387
392
|
i.preventDefault();
|
|
388
|
-
const [
|
|
389
|
-
|
|
393
|
+
const [j, B] = m.slice(9).split("/");
|
|
394
|
+
j && B && k.open({ collection: j, itemId: B });
|
|
390
395
|
}
|
|
391
396
|
},
|
|
392
397
|
editor: r,
|
|
393
398
|
className: "nivaro-rich-text min-h-[120px] px-3 py-2 text-[13px] [&_.tiptap]:outline-none [&_.tiptap]:min-h-[100px] [&_.tiptap_p]:my-1 [&_.tiptap_h1]:text-xl [&_.tiptap_h2]:text-lg [&_.tiptap_h3]:text-base [&_.tiptap_h1,&_.tiptap_h2,&_.tiptap_h3]:font-semibold [&_.tiptap_ul]:list-disc [&_.tiptap_ol]:list-decimal [&_.tiptap_ul]:!pl-6 [&_.tiptap_ol]:!pl-6 [&_.tiptap_ul]:list-outside [&_.tiptap_ol]:list-outside [&_.tiptap_li]:my-0.5 [&_.tiptap_blockquote]:border-l-2 [&_.tiptap_blockquote]:border-slate-300 [&_.tiptap_blockquote]:pl-3 [&_.tiptap_blockquote]:text-slate-500 dark:[&_.tiptap_blockquote]:border-slate-600 dark:[&_.tiptap_blockquote]:text-slate-400 [&_.tiptap_code]:bg-slate-100 dark:[&_.tiptap_code]:bg-[#1e293b] [&_.tiptap_code]:rounded [&_.tiptap_code]:px-1 [&_.tiptap_pre]:bg-slate-100 dark:[&_.tiptap_pre]:bg-[#1e293b] [&_.tiptap_pre]:rounded [&_.tiptap_pre]:p-2 [&_.tiptap_pre]:font-mono [&_.tiptap_p.is-editor-empty:first-child::before]:content-[attr(data-placeholder)] [&_.tiptap_p.is-editor-empty:first-child::before]:text-slate-400 dark:[&_.tiptap_p.is-editor-empty:first-child::before]:text-slate-500 [&_.tiptap_p.is-editor-empty:first-child::before]:pointer-events-none [&_.tiptap_p.is-editor-empty:first-child::before]:float-left [&_.tiptap_p.is-editor-empty:first-child::before]:h-0"
|
|
394
399
|
}
|
|
395
400
|
),
|
|
396
|
-
/* @__PURE__ */ e(
|
|
401
|
+
/* @__PURE__ */ e(Ee, { peers: V, diverged: f.diverged })
|
|
397
402
|
]
|
|
398
403
|
}
|
|
399
404
|
);
|
|
400
405
|
}
|
|
401
|
-
const
|
|
402
|
-
function
|
|
406
|
+
const P = (t) => t.trim().split(/\s+/)[0] || t;
|
|
407
|
+
function W(t) {
|
|
403
408
|
return t.length <= 1 ? t[0] ?? "" : t.length === 2 ? `${t[0]} and ${t[1]}` : `${t[0]}, ${t[1]} and ${t.length - 2} more`;
|
|
404
409
|
}
|
|
405
|
-
function
|
|
410
|
+
function Ee({
|
|
406
411
|
peers: t,
|
|
407
|
-
diverged:
|
|
412
|
+
diverged: p
|
|
408
413
|
}) {
|
|
409
|
-
return !
|
|
414
|
+
return !p && t.length === 0 ? null : /* @__PURE__ */ g(
|
|
410
415
|
"div",
|
|
411
416
|
{
|
|
412
417
|
className: "flex min-h-[26px] items-center gap-1.5 border-t border-slate-100 px-3 py-1 text-[11px] text-slate-500 dark:border-border dark:text-slate-400",
|
|
@@ -420,54 +425,54 @@ function De({
|
|
|
420
425
|
},
|
|
421
426
|
a.name || "someone"
|
|
422
427
|
)) }),
|
|
423
|
-
|
|
424
|
-
t.length ?
|
|
428
|
+
p ? /* @__PURE__ */ g("span", { className: "min-w-0", children: [
|
|
429
|
+
t.length ? W(t.map((a) => P(a.name))) : "Someone else",
|
|
425
430
|
" ",
|
|
426
431
|
t.length > 1 ? "are" : "is",
|
|
427
432
|
" writing here too. Your unsaved changes stay separate until you save."
|
|
428
|
-
] }) : /* @__PURE__ */
|
|
433
|
+
] }) : /* @__PURE__ */ g("span", { className: "truncate", children: [
|
|
429
434
|
"Writing together with ",
|
|
430
|
-
|
|
435
|
+
W(t.map((a) => P(a.name)))
|
|
431
436
|
] })
|
|
432
437
|
]
|
|
433
438
|
}
|
|
434
439
|
);
|
|
435
440
|
}
|
|
436
|
-
function
|
|
437
|
-
return t ? t.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (a,
|
|
438
|
-
if (
|
|
439
|
-
const c =
|
|
441
|
+
function Me(t, p) {
|
|
442
|
+
return t ? t.replace(/\{\{\s*([^}]+?)\s*\}\}/g, (a, s) => {
|
|
443
|
+
if (s.includes(".")) return "";
|
|
444
|
+
const c = p[s];
|
|
440
445
|
return c == null ? "" : String(c);
|
|
441
446
|
}).replace(/\s+/g, " ").trim() : "";
|
|
442
447
|
}
|
|
443
|
-
function
|
|
444
|
-
const a =
|
|
448
|
+
function Re(t, p) {
|
|
449
|
+
const a = Me(p, t);
|
|
445
450
|
if (a) return a;
|
|
446
|
-
for (const
|
|
447
|
-
const c = t[
|
|
451
|
+
for (const s of ["name", "title", "label", "subject"]) {
|
|
452
|
+
const c = t[s];
|
|
448
453
|
if (typeof c == "string" && c.trim()) return c.trim();
|
|
449
454
|
}
|
|
450
455
|
return `#${String(t.id ?? "")}`;
|
|
451
456
|
}
|
|
452
|
-
function
|
|
457
|
+
function qe({
|
|
453
458
|
apiBase: t,
|
|
454
|
-
authHeaders:
|
|
459
|
+
authHeaders: p,
|
|
455
460
|
credentials: a,
|
|
456
|
-
onInsert:
|
|
461
|
+
onInsert: s,
|
|
457
462
|
onClose: c
|
|
458
463
|
}) {
|
|
459
|
-
const [
|
|
464
|
+
const [l, N] = w(""), [x, C] = w(""), [b, D] = w("");
|
|
460
465
|
R(() => {
|
|
461
|
-
const n = setTimeout(() =>
|
|
466
|
+
const n = setTimeout(() => D(x), 300);
|
|
462
467
|
return () => clearTimeout(n);
|
|
463
|
-
}, [
|
|
468
|
+
}, [x]);
|
|
464
469
|
const y = (n) => fetch(`${t}${n}`, {
|
|
465
|
-
headers:
|
|
470
|
+
headers: p,
|
|
466
471
|
credentials: a
|
|
467
472
|
}).then((u) => {
|
|
468
473
|
if (!u.ok) throw new Error(String(u.status));
|
|
469
474
|
return u.json();
|
|
470
|
-
}), { data:
|
|
475
|
+
}), { data: v } = U({
|
|
471
476
|
queryKey: ["rte-record-link-collections"],
|
|
472
477
|
queryFn: () => y("/collections").then(
|
|
473
478
|
(n) => (Array.isArray(n == null ? void 0 : n.data) ? n.data : []).filter(
|
|
@@ -475,27 +480,27 @@ function $e({
|
|
|
475
480
|
)
|
|
476
481
|
),
|
|
477
482
|
staleTime: 5 * 6e4
|
|
478
|
-
}),
|
|
479
|
-
queryKey: ["rte-record-link-search",
|
|
480
|
-
enabled: !!
|
|
483
|
+
}), _ = v == null ? void 0 : v.find((n) => n.collection === l), { data: k, isFetching: A } = U({
|
|
484
|
+
queryKey: ["rte-record-link-search", l, b],
|
|
485
|
+
enabled: !!l && b.trim().length > 0,
|
|
481
486
|
queryFn: () => y(
|
|
482
|
-
`/items/${
|
|
487
|
+
`/items/${l}?limit=10&search=${encodeURIComponent(b.trim())}`
|
|
483
488
|
).then(
|
|
484
489
|
(n) => Array.isArray(n == null ? void 0 : n.data) ? n.data : []
|
|
485
490
|
)
|
|
486
491
|
});
|
|
487
|
-
return /* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
492
|
+
return /* @__PURE__ */ g("div", { className: "space-y-1.5 border-b border-slate-200 bg-slate-50 px-2 py-1.5 dark:border-border dark:bg-muted", children: [
|
|
493
|
+
/* @__PURE__ */ g("div", { className: "flex items-center gap-1.5", children: [
|
|
489
494
|
/* @__PURE__ */ e(
|
|
490
|
-
|
|
495
|
+
we,
|
|
491
496
|
{
|
|
492
|
-
value:
|
|
497
|
+
value: l,
|
|
493
498
|
onChange: N,
|
|
494
499
|
ariaLabel: "Collection",
|
|
495
500
|
className: "h-6 w-44 rounded border-slate-200 bg-white text-[12px] dark:border-border dark:bg-background",
|
|
496
501
|
options: [
|
|
497
502
|
{ value: "", label: "Collection…" },
|
|
498
|
-
...(
|
|
503
|
+
...(v ?? []).map((n) => ({
|
|
499
504
|
value: n.collection,
|
|
500
505
|
label: n.display_name || n.collection
|
|
501
506
|
}))
|
|
@@ -505,16 +510,16 @@ function $e({
|
|
|
505
510
|
/* @__PURE__ */ e(
|
|
506
511
|
"input",
|
|
507
512
|
{
|
|
508
|
-
value:
|
|
513
|
+
value: x,
|
|
509
514
|
onChange: (n) => C(n.target.value),
|
|
510
515
|
onKeyDown: (n) => n.key === "Escape" && c(),
|
|
511
|
-
placeholder:
|
|
512
|
-
disabled: !
|
|
516
|
+
placeholder: l ? "Search records…" : "Pick a collection first",
|
|
517
|
+
disabled: !l,
|
|
513
518
|
"aria-label": "Search records",
|
|
514
519
|
className: "flex-1 rounded border border-slate-200 bg-white px-2 py-0.5 text-[12px] text-slate-700 outline-none focus:border-nvr-cyan disabled:opacity-50"
|
|
515
520
|
}
|
|
516
521
|
),
|
|
517
|
-
A && /* @__PURE__ */ e(
|
|
522
|
+
A && /* @__PURE__ */ e(xe, { className: "h-3.5 w-3.5 animate-spin text-slate-400" }),
|
|
518
523
|
/* @__PURE__ */ e(
|
|
519
524
|
"button",
|
|
520
525
|
{
|
|
@@ -524,25 +529,25 @@ function $e({
|
|
|
524
529
|
n.preventDefault(), c();
|
|
525
530
|
},
|
|
526
531
|
className: "flex h-5 w-5 items-center justify-center rounded text-slate-400 hover:bg-slate-100",
|
|
527
|
-
children: /* @__PURE__ */ e(
|
|
532
|
+
children: /* @__PURE__ */ e(J, { className: "h-3.5 w-3.5" })
|
|
528
533
|
}
|
|
529
534
|
)
|
|
530
535
|
] }),
|
|
531
|
-
|
|
532
|
-
((
|
|
533
|
-
const u =
|
|
534
|
-
return /* @__PURE__ */
|
|
536
|
+
l && b.trim() && ((k == null ? void 0 : k.length) ?? 0) === 0 && !A && /* @__PURE__ */ e("p", { className: "px-1 text-[11px] text-slate-400", children: "No matching records." }),
|
|
537
|
+
((k == null ? void 0 : k.length) ?? 0) > 0 && /* @__PURE__ */ e("div", { className: "max-h-40 overflow-y-auto rounded border border-slate-200 bg-white", children: (k ?? []).map((n) => {
|
|
538
|
+
const u = Re(n, _ == null ? void 0 : _.display_template), r = String(n.id ?? "");
|
|
539
|
+
return /* @__PURE__ */ g(
|
|
535
540
|
"button",
|
|
536
541
|
{
|
|
537
542
|
type: "button",
|
|
538
|
-
onMouseDown: (
|
|
539
|
-
|
|
543
|
+
onMouseDown: (f) => {
|
|
544
|
+
f.preventDefault(), r && s(u, `record://${l}/${r}`);
|
|
540
545
|
},
|
|
541
546
|
className: "flex w-full items-center gap-1.5 px-2 py-1 text-left text-[12px] text-slate-700 hover:bg-muted",
|
|
542
547
|
children: [
|
|
543
|
-
/* @__PURE__ */ e(
|
|
548
|
+
/* @__PURE__ */ e(K, { className: "h-3 w-3 shrink-0 text-[#00a5cc]" }),
|
|
544
549
|
/* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: u }),
|
|
545
|
-
/* @__PURE__ */
|
|
550
|
+
/* @__PURE__ */ g("span", { className: "shrink-0 font-mono text-[10.5px] text-slate-400", children: [
|
|
546
551
|
"#",
|
|
547
552
|
r
|
|
548
553
|
] })
|
|
@@ -554,8 +559,8 @@ function $e({
|
|
|
554
559
|
] });
|
|
555
560
|
}
|
|
556
561
|
export {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
562
|
+
et as RichTextEditor,
|
|
563
|
+
H as TiptapDivider,
|
|
564
|
+
d as TiptapToolbarButton,
|
|
565
|
+
$e as editorJsToHtml
|
|
561
566
|
};
|