@mhamz.01/easyflow-texteditor 0.1.81 → 0.1.83
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/index.css +24 -33
- package/dist/index.css.map +1 -1
- package/dist/index.js +1103 -1266
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +977 -1140
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -80,35 +80,16 @@ function Button({
|
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
// src/components/ui/input.tsx
|
|
84
|
-
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
85
|
-
function Input({ className, type, ...props }) {
|
|
86
|
-
return /* @__PURE__ */ jsx2(
|
|
87
|
-
"input",
|
|
88
|
-
{
|
|
89
|
-
type,
|
|
90
|
-
"data-slot": "input",
|
|
91
|
-
className: cn(
|
|
92
|
-
"file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
|
93
|
-
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
|
|
94
|
-
"aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
95
|
-
className
|
|
96
|
-
),
|
|
97
|
-
...props
|
|
98
|
-
}
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
83
|
// src/components/ui/separator.tsx
|
|
103
84
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
104
|
-
import { jsx as
|
|
85
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
105
86
|
function Separator({
|
|
106
87
|
className,
|
|
107
88
|
orientation = "horizontal",
|
|
108
89
|
decorative = true,
|
|
109
90
|
...props
|
|
110
91
|
}) {
|
|
111
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ jsx2(
|
|
112
93
|
SeparatorPrimitive.Root,
|
|
113
94
|
{
|
|
114
95
|
"data-slot": "separator",
|
|
@@ -126,20 +107,20 @@ function Separator({
|
|
|
126
107
|
// src/components/ui/sheet.tsx
|
|
127
108
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
128
109
|
import { XIcon } from "lucide-react";
|
|
129
|
-
import { jsx as
|
|
110
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
130
111
|
function Sheet({ ...props }) {
|
|
131
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
132
113
|
}
|
|
133
114
|
function SheetPortal({
|
|
134
115
|
...props
|
|
135
116
|
}) {
|
|
136
|
-
return /* @__PURE__ */
|
|
117
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
137
118
|
}
|
|
138
119
|
function SheetOverlay({
|
|
139
120
|
className,
|
|
140
121
|
...props
|
|
141
122
|
}) {
|
|
142
|
-
return /* @__PURE__ */
|
|
123
|
+
return /* @__PURE__ */ jsx3(
|
|
143
124
|
SheetPrimitive.Overlay,
|
|
144
125
|
{
|
|
145
126
|
"data-slot": "sheet-overlay",
|
|
@@ -158,7 +139,7 @@ function SheetContent({
|
|
|
158
139
|
...props
|
|
159
140
|
}) {
|
|
160
141
|
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
161
|
-
/* @__PURE__ */
|
|
142
|
+
/* @__PURE__ */ jsx3(SheetOverlay, {}),
|
|
162
143
|
/* @__PURE__ */ jsxs(
|
|
163
144
|
SheetPrimitive.Content,
|
|
164
145
|
{
|
|
@@ -175,8 +156,8 @@ function SheetContent({
|
|
|
175
156
|
children: [
|
|
176
157
|
children,
|
|
177
158
|
/* @__PURE__ */ jsxs(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
178
|
-
/* @__PURE__ */
|
|
179
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ jsx3(XIcon, { className: "size-4" }),
|
|
160
|
+
/* @__PURE__ */ jsx3("span", { className: "sr-only", children: "Close" })
|
|
180
161
|
] })
|
|
181
162
|
]
|
|
182
163
|
}
|
|
@@ -184,7 +165,7 @@ function SheetContent({
|
|
|
184
165
|
] });
|
|
185
166
|
}
|
|
186
167
|
function SheetHeader({ className, ...props }) {
|
|
187
|
-
return /* @__PURE__ */
|
|
168
|
+
return /* @__PURE__ */ jsx3(
|
|
188
169
|
"div",
|
|
189
170
|
{
|
|
190
171
|
"data-slot": "sheet-header",
|
|
@@ -197,7 +178,7 @@ function SheetTitle({
|
|
|
197
178
|
className,
|
|
198
179
|
...props
|
|
199
180
|
}) {
|
|
200
|
-
return /* @__PURE__ */
|
|
181
|
+
return /* @__PURE__ */ jsx3(
|
|
201
182
|
SheetPrimitive.Title,
|
|
202
183
|
{
|
|
203
184
|
"data-slot": "sheet-title",
|
|
@@ -210,7 +191,7 @@ function SheetDescription({
|
|
|
210
191
|
className,
|
|
211
192
|
...props
|
|
212
193
|
}) {
|
|
213
|
-
return /* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ jsx3(
|
|
214
195
|
SheetPrimitive.Description,
|
|
215
196
|
{
|
|
216
197
|
"data-slot": "sheet-description",
|
|
@@ -222,12 +203,12 @@ function SheetDescription({
|
|
|
222
203
|
|
|
223
204
|
// src/components/ui/tooltip.tsx
|
|
224
205
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
225
|
-
import { jsx as
|
|
206
|
+
import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
226
207
|
function TooltipProvider({
|
|
227
208
|
delayDuration = 0,
|
|
228
209
|
...props
|
|
229
210
|
}) {
|
|
230
|
-
return /* @__PURE__ */
|
|
211
|
+
return /* @__PURE__ */ jsx4(
|
|
231
212
|
TooltipPrimitive.Provider,
|
|
232
213
|
{
|
|
233
214
|
"data-slot": "tooltip-provider",
|
|
@@ -238,7 +219,7 @@ function TooltipProvider({
|
|
|
238
219
|
}
|
|
239
220
|
|
|
240
221
|
// src/components/ui/sidebar.tsx
|
|
241
|
-
import { jsx as
|
|
222
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
242
223
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
243
224
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
244
225
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -293,7 +274,7 @@ function SidebarProvider({
|
|
|
293
274
|
}),
|
|
294
275
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
295
276
|
);
|
|
296
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ jsx5(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx5(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx5(
|
|
297
278
|
"div",
|
|
298
279
|
{
|
|
299
280
|
"data-slot": "sidebar-wrapper",
|
|
@@ -322,7 +303,7 @@ function Sidebar({
|
|
|
322
303
|
}) {
|
|
323
304
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
324
305
|
if (collapsible === "none") {
|
|
325
|
-
return /* @__PURE__ */
|
|
306
|
+
return /* @__PURE__ */ jsx5(
|
|
326
307
|
"div",
|
|
327
308
|
{
|
|
328
309
|
"data-slot": "sidebar",
|
|
@@ -336,7 +317,7 @@ function Sidebar({
|
|
|
336
317
|
);
|
|
337
318
|
}
|
|
338
319
|
if (isMobile) {
|
|
339
|
-
return /* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ jsx5(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs3(
|
|
340
321
|
SheetContent,
|
|
341
322
|
{
|
|
342
323
|
"data-sidebar": "sidebar",
|
|
@@ -349,10 +330,10 @@ function Sidebar({
|
|
|
349
330
|
side,
|
|
350
331
|
children: [
|
|
351
332
|
/* @__PURE__ */ jsxs3(SheetHeader, { className: "sr-only", children: [
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ jsx5(SheetTitle, { children: "Sidebar" }),
|
|
334
|
+
/* @__PURE__ */ jsx5(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
354
335
|
] }),
|
|
355
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ jsx5("div", { className: "flex h-full w-full flex-col", children })
|
|
356
337
|
]
|
|
357
338
|
}
|
|
358
339
|
) });
|
|
@@ -367,7 +348,7 @@ function Sidebar({
|
|
|
367
348
|
"data-side": side,
|
|
368
349
|
"data-slot": "sidebar",
|
|
369
350
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ jsx5(
|
|
371
352
|
"div",
|
|
372
353
|
{
|
|
373
354
|
"data-slot": "sidebar-gap",
|
|
@@ -379,7 +360,7 @@ function Sidebar({
|
|
|
379
360
|
)
|
|
380
361
|
}
|
|
381
362
|
),
|
|
382
|
-
/* @__PURE__ */
|
|
363
|
+
/* @__PURE__ */ jsx5(
|
|
383
364
|
"div",
|
|
384
365
|
{
|
|
385
366
|
"data-slot": "sidebar-container",
|
|
@@ -392,7 +373,7 @@ function Sidebar({
|
|
|
392
373
|
className
|
|
393
374
|
),
|
|
394
375
|
...props,
|
|
395
|
-
children: /* @__PURE__ */
|
|
376
|
+
children: /* @__PURE__ */ jsx5(
|
|
396
377
|
"div",
|
|
397
378
|
{
|
|
398
379
|
"data-sidebar": "sidebar",
|
|
@@ -427,14 +408,14 @@ function SidebarTrigger({
|
|
|
427
408
|
},
|
|
428
409
|
...props,
|
|
429
410
|
children: [
|
|
430
|
-
/* @__PURE__ */
|
|
431
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ jsx5(PanelLeftIcon, { color: "white" }),
|
|
412
|
+
/* @__PURE__ */ jsx5("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
432
413
|
]
|
|
433
414
|
}
|
|
434
415
|
);
|
|
435
416
|
}
|
|
436
417
|
function SidebarInset({ className, ...props }) {
|
|
437
|
-
return /* @__PURE__ */
|
|
418
|
+
return /* @__PURE__ */ jsx5(
|
|
438
419
|
"main",
|
|
439
420
|
{
|
|
440
421
|
"data-slot": "sidebar-inset",
|
|
@@ -448,7 +429,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
448
429
|
);
|
|
449
430
|
}
|
|
450
431
|
function SidebarContent({ className, ...props }) {
|
|
451
|
-
return /* @__PURE__ */
|
|
432
|
+
return /* @__PURE__ */ jsx5(
|
|
452
433
|
"div",
|
|
453
434
|
{
|
|
454
435
|
"data-slot": "sidebar-content",
|
|
@@ -462,7 +443,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
462
443
|
);
|
|
463
444
|
}
|
|
464
445
|
function SidebarGroup({ className, ...props }) {
|
|
465
|
-
return /* @__PURE__ */
|
|
446
|
+
return /* @__PURE__ */ jsx5(
|
|
466
447
|
"div",
|
|
467
448
|
{
|
|
468
449
|
"data-slot": "sidebar-group",
|
|
@@ -478,7 +459,7 @@ function SidebarGroupLabel({
|
|
|
478
459
|
...props
|
|
479
460
|
}) {
|
|
480
461
|
const Comp = asChild ? Slot2 : "div";
|
|
481
|
-
return /* @__PURE__ */
|
|
462
|
+
return /* @__PURE__ */ jsx5(
|
|
482
463
|
Comp,
|
|
483
464
|
{
|
|
484
465
|
"data-slot": "sidebar-group-label",
|
|
@@ -493,7 +474,7 @@ function SidebarGroupLabel({
|
|
|
493
474
|
);
|
|
494
475
|
}
|
|
495
476
|
function SidebarMenu({ className, ...props }) {
|
|
496
|
-
return /* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ jsx5(
|
|
497
478
|
"ul",
|
|
498
479
|
{
|
|
499
480
|
"data-slot": "sidebar-menu",
|
|
@@ -504,7 +485,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
504
485
|
);
|
|
505
486
|
}
|
|
506
487
|
function SidebarMenuItem({ className, ...props }) {
|
|
507
|
-
return /* @__PURE__ */
|
|
488
|
+
return /* @__PURE__ */ jsx5(
|
|
508
489
|
"li",
|
|
509
490
|
{
|
|
510
491
|
"data-slot": "sidebar-menu-item",
|
|
@@ -536,101 +517,151 @@ var sidebarMenuButtonVariants = cva2(
|
|
|
536
517
|
);
|
|
537
518
|
|
|
538
519
|
// src/components/editor-shell/EditorShell.tsx
|
|
539
|
-
import { jsx as
|
|
520
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
540
521
|
function EditorShell({ children }) {
|
|
541
|
-
return /* @__PURE__ */
|
|
522
|
+
return /* @__PURE__ */ jsx6(
|
|
542
523
|
"div",
|
|
543
524
|
{
|
|
544
525
|
className: "\r\n relative w-full h-full flex flex-col min-h-0 isolate\r\n ",
|
|
545
526
|
"data-easyflow-editor": true,
|
|
546
|
-
children: /* @__PURE__ */
|
|
527
|
+
children: /* @__PURE__ */ jsx6(SidebarProvider, { children })
|
|
547
528
|
}
|
|
548
529
|
);
|
|
549
530
|
}
|
|
550
531
|
|
|
551
532
|
// src/components/editorLayout/editorLayout.tsx
|
|
552
|
-
import { useState as
|
|
533
|
+
import { useState as useState7, useEffect as useEffect2, useRef, useCallback as useCallback5, useMemo as useMemo2 } from "react";
|
|
553
534
|
|
|
554
535
|
// src/components/sidebar/EditorSidebar.tsx
|
|
555
|
-
import {
|
|
556
|
-
import {
|
|
557
|
-
import {
|
|
536
|
+
import { memo as memo5 } from "react";
|
|
537
|
+
import { Plus } from "lucide-react";
|
|
538
|
+
import { AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
558
539
|
|
|
559
|
-
// src/components/
|
|
560
|
-
import
|
|
561
|
-
import {
|
|
562
|
-
import {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
540
|
+
// src/components/sidebar/tabItem.tsx
|
|
541
|
+
import { useState as useState6, memo as memo4, useCallback as useCallback4 } from "react";
|
|
542
|
+
import { FileText as FileText2, ChevronRight } from "lucide-react";
|
|
543
|
+
import { motion as motion2, AnimatePresence } from "framer-motion";
|
|
544
|
+
|
|
545
|
+
// src/components/sidebar/inlineInput.tsx
|
|
546
|
+
import { useState as useState3, memo, useCallback as useCallback2 } from "react";
|
|
547
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
548
|
+
var InlineInput = memo(function InlineInput2({
|
|
549
|
+
value,
|
|
550
|
+
onCommit,
|
|
551
|
+
onCancel,
|
|
552
|
+
className = ""
|
|
570
553
|
}) {
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
554
|
+
const [tempValue, setTempValue] = useState3(value);
|
|
555
|
+
const handleCommit = useCallback2(() => {
|
|
556
|
+
onCommit(tempValue.trim() || "Untitled");
|
|
557
|
+
}, [tempValue, onCommit]);
|
|
558
|
+
const handleKeyDown = useCallback2(
|
|
559
|
+
(e) => {
|
|
560
|
+
if (e.key === "Enter") {
|
|
561
|
+
e.preventDefault();
|
|
562
|
+
handleCommit();
|
|
563
|
+
} else if (e.key === "Escape") {
|
|
564
|
+
e.preventDefault();
|
|
565
|
+
onCancel();
|
|
566
|
+
}
|
|
567
|
+
},
|
|
568
|
+
[handleCommit, onCancel]
|
|
577
569
|
);
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
className,
|
|
581
|
-
sideOffset = 4,
|
|
582
|
-
...props
|
|
583
|
-
}) {
|
|
584
|
-
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx8(
|
|
585
|
-
DropdownMenuPrimitive.Content,
|
|
570
|
+
return /* @__PURE__ */ jsx7(
|
|
571
|
+
"input",
|
|
586
572
|
{
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
573
|
+
type: "text",
|
|
574
|
+
value: tempValue,
|
|
575
|
+
autoFocus: true,
|
|
576
|
+
onChange: (e) => setTempValue(e.target.value),
|
|
577
|
+
onBlur: handleCommit,
|
|
578
|
+
onKeyDown: handleKeyDown,
|
|
579
|
+
className: `bg-background border border-input rounded px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-ring ${className}`,
|
|
580
|
+
onClick: (e) => e.stopPropagation()
|
|
594
581
|
}
|
|
595
|
-
)
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
582
|
+
);
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
// src/components/sidebar/optionsMenu.tsx
|
|
586
|
+
import { useState as useState4, memo as memo2 } from "react";
|
|
587
|
+
import { MoreHorizontal } from "lucide-react";
|
|
588
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
589
|
+
var OptionsMenu = memo2(function OptionsMenu2({
|
|
590
|
+
canDelete = true,
|
|
591
|
+
onAddSubTab,
|
|
592
|
+
onDelete
|
|
602
593
|
}) {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
"
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
594
|
+
const [isOpen, setIsOpen] = useState4(false);
|
|
595
|
+
return /* @__PURE__ */ jsxs4("div", { className: "relative", children: [
|
|
596
|
+
/* @__PURE__ */ jsx8(
|
|
597
|
+
"button",
|
|
598
|
+
{
|
|
599
|
+
onClick: (e) => {
|
|
600
|
+
e.stopPropagation();
|
|
601
|
+
setIsOpen(!isOpen);
|
|
602
|
+
},
|
|
603
|
+
className: "opacity-0 group-hover:opacity-100 rounded p-1 transition-all duration-150 hover:bg-accent/80",
|
|
604
|
+
"aria-label": "Options",
|
|
605
|
+
children: /* @__PURE__ */ jsx8(MoreHorizontal, { size: 14 })
|
|
606
|
+
}
|
|
607
|
+
),
|
|
608
|
+
isOpen && /* @__PURE__ */ jsxs4(Fragment, { children: [
|
|
609
|
+
/* @__PURE__ */ jsx8(
|
|
610
|
+
"div",
|
|
611
|
+
{
|
|
612
|
+
className: "fixed inset-0 z-10",
|
|
613
|
+
onClick: () => setIsOpen(false)
|
|
614
|
+
}
|
|
612
615
|
),
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
616
|
+
/* @__PURE__ */ jsxs4("div", { className: "absolute right-0 top-full mt-1 z-20 w-40 rounded-md border bg-popover shadow-lg", children: [
|
|
617
|
+
onAddSubTab && /* @__PURE__ */ jsx8(
|
|
618
|
+
"button",
|
|
619
|
+
{
|
|
620
|
+
onClick: (e) => {
|
|
621
|
+
e.stopPropagation();
|
|
622
|
+
onAddSubTab();
|
|
623
|
+
setIsOpen(false);
|
|
624
|
+
},
|
|
625
|
+
className: "w-full px-3 py-2 text-left text-sm hover:bg-accent transition-colors",
|
|
626
|
+
children: "Add subtab"
|
|
627
|
+
}
|
|
628
|
+
),
|
|
629
|
+
canDelete && /* @__PURE__ */ jsx8(
|
|
630
|
+
"button",
|
|
631
|
+
{
|
|
632
|
+
onClick: (e) => {
|
|
633
|
+
e.stopPropagation();
|
|
634
|
+
onDelete();
|
|
635
|
+
setIsOpen(false);
|
|
636
|
+
},
|
|
637
|
+
className: "w-full px-3 py-2 text-left text-sm text-red-500 hover:bg-accent hover:text-red-600 transition-colors",
|
|
638
|
+
children: "Delete"
|
|
639
|
+
}
|
|
640
|
+
)
|
|
641
|
+
] })
|
|
642
|
+
] })
|
|
643
|
+
] });
|
|
644
|
+
});
|
|
617
645
|
|
|
618
|
-
// src/components/sidebar/
|
|
619
|
-
import {
|
|
620
|
-
import {
|
|
646
|
+
// src/components/sidebar/subtabItem.tsx
|
|
647
|
+
import { useState as useState5, memo as memo3, useCallback as useCallback3 } from "react";
|
|
648
|
+
import { FileText } from "lucide-react";
|
|
649
|
+
import { motion } from "framer-motion";
|
|
650
|
+
|
|
651
|
+
// src/types/animations.ts
|
|
621
652
|
var tabVariants = {
|
|
622
653
|
initial: { opacity: 0, x: -20, height: 0 },
|
|
623
654
|
animate: {
|
|
624
655
|
opacity: 1,
|
|
625
656
|
x: 0,
|
|
626
657
|
height: "auto",
|
|
627
|
-
transition: { duration: 0.
|
|
658
|
+
transition: { duration: 0.2, ease: "easeOut" }
|
|
628
659
|
},
|
|
629
660
|
exit: {
|
|
630
661
|
opacity: 0,
|
|
631
662
|
x: -20,
|
|
632
663
|
height: 0,
|
|
633
|
-
transition: { duration: 0.
|
|
664
|
+
transition: { duration: 0.15, ease: "easeIn" }
|
|
634
665
|
}
|
|
635
666
|
};
|
|
636
667
|
var subtabVariants = {
|
|
@@ -639,176 +670,45 @@ var subtabVariants = {
|
|
|
639
670
|
opacity: 1,
|
|
640
671
|
x: 0,
|
|
641
672
|
height: "auto",
|
|
642
|
-
transition: { duration: 0.
|
|
673
|
+
transition: { duration: 0.15, ease: "easeOut" }
|
|
643
674
|
},
|
|
644
675
|
exit: {
|
|
645
676
|
opacity: 0,
|
|
646
677
|
x: -10,
|
|
647
678
|
height: 0,
|
|
648
|
-
transition: { duration: 0.
|
|
679
|
+
transition: { duration: 0.1, ease: "easeIn" }
|
|
649
680
|
}
|
|
650
681
|
};
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
onTitleChange,
|
|
656
|
-
onStartEdit,
|
|
657
|
-
onCommit,
|
|
658
|
-
onCancel,
|
|
659
|
-
onSelect,
|
|
660
|
-
tabId,
|
|
661
|
-
subTabId
|
|
662
|
-
}) {
|
|
663
|
-
return isEditing ? /* @__PURE__ */ jsx9(
|
|
664
|
-
Input,
|
|
665
|
-
{
|
|
666
|
-
value: tempTitle,
|
|
667
|
-
autoFocus: true,
|
|
668
|
-
onChange: (e) => onTitleChange(e.target.value),
|
|
669
|
-
onBlur: onCommit,
|
|
670
|
-
onKeyDown: (e) => {
|
|
671
|
-
if (e.key === "Enter") onCommit();
|
|
672
|
-
if (e.key === "Escape") onCancel();
|
|
673
|
-
},
|
|
674
|
-
className: "h-6 transition-all duration-200"
|
|
675
|
-
}
|
|
676
|
-
) : /* @__PURE__ */ jsx9(
|
|
677
|
-
"button",
|
|
678
|
-
{
|
|
679
|
-
className: "w-full truncate text-left transition-colors duration-200 hover:text-foreground",
|
|
680
|
-
onClick: onSelect,
|
|
681
|
-
onDoubleClick: onStartEdit,
|
|
682
|
-
children: title
|
|
683
|
-
}
|
|
684
|
-
);
|
|
685
|
-
});
|
|
686
|
-
var TabTitle = memo(function TabTitle2({
|
|
687
|
-
isEditing,
|
|
688
|
-
title,
|
|
689
|
-
tempTitle,
|
|
690
|
-
onTitleChange,
|
|
691
|
-
onStartEdit,
|
|
692
|
-
onCommit,
|
|
693
|
-
onCancel,
|
|
694
|
-
onSelect
|
|
695
|
-
}) {
|
|
696
|
-
return isEditing ? /* @__PURE__ */ jsx9(
|
|
697
|
-
Input,
|
|
698
|
-
{
|
|
699
|
-
value: tempTitle,
|
|
700
|
-
autoFocus: true,
|
|
701
|
-
onChange: (e) => onTitleChange(e.target.value),
|
|
702
|
-
onBlur: onCommit,
|
|
703
|
-
onKeyDown: (e) => {
|
|
704
|
-
if (e.key === "Enter") onCommit();
|
|
705
|
-
if (e.key === "Escape") onCancel();
|
|
706
|
-
},
|
|
707
|
-
className: "h-7 transition-all duration-200"
|
|
708
|
-
}
|
|
709
|
-
) : /* @__PURE__ */ jsx9(
|
|
710
|
-
"button",
|
|
711
|
-
{
|
|
712
|
-
className: "w-full truncate text-left text-sm transition-colors duration-200 hover:text-foreground",
|
|
713
|
-
onClick: onSelect,
|
|
714
|
-
onDoubleClick: onStartEdit,
|
|
715
|
-
children: title
|
|
716
|
-
}
|
|
717
|
-
);
|
|
718
|
-
});
|
|
719
|
-
var SubTabMenu = memo(function SubTabMenu2({
|
|
720
|
-
onDelete
|
|
721
|
-
}) {
|
|
722
|
-
return /* @__PURE__ */ jsxs5(DropdownMenu, { children: [
|
|
723
|
-
/* @__PURE__ */ jsx9(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(
|
|
724
|
-
"button",
|
|
725
|
-
{
|
|
726
|
-
className: "opacity-0 group-hover:opacity-100 rounded p-1 transition-all duration-200 hover:bg-accent/80",
|
|
727
|
-
"aria-label": "Subtab options",
|
|
728
|
-
children: /* @__PURE__ */ jsx9(MoreHorizontal, { size: 14 })
|
|
729
|
-
}
|
|
730
|
-
) }),
|
|
731
|
-
/* @__PURE__ */ jsx9(DropdownMenuContent, { align: "end", className: "w-40", children: /* @__PURE__ */ jsx9(
|
|
732
|
-
DropdownMenuItem,
|
|
733
|
-
{
|
|
734
|
-
className: "text-red-500 cursor-pointer transition-colors duration-150 focus:text-red-600",
|
|
735
|
-
onClick: onDelete,
|
|
736
|
-
children: "Delete"
|
|
737
|
-
}
|
|
738
|
-
) })
|
|
739
|
-
] });
|
|
740
|
-
});
|
|
741
|
-
var TabMenu = memo(function TabMenu2({
|
|
742
|
-
canDelete,
|
|
743
|
-
onAddSubTab,
|
|
744
|
-
onDelete
|
|
745
|
-
}) {
|
|
746
|
-
return /* @__PURE__ */ jsxs5(DropdownMenu, { children: [
|
|
747
|
-
/* @__PURE__ */ jsx9(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx9(
|
|
748
|
-
"button",
|
|
749
|
-
{
|
|
750
|
-
className: "opacity-0 group-hover:opacity-100 rounded p-1 transition-all duration-200 hover:bg-accent/80",
|
|
751
|
-
"aria-label": "Tab options",
|
|
752
|
-
children: /* @__PURE__ */ jsx9(MoreHorizontal, { size: 14 })
|
|
753
|
-
}
|
|
754
|
-
) }),
|
|
755
|
-
/* @__PURE__ */ jsxs5(DropdownMenuContent, { align: "end", className: "w-40", children: [
|
|
756
|
-
/* @__PURE__ */ jsx9(
|
|
757
|
-
DropdownMenuItem,
|
|
758
|
-
{
|
|
759
|
-
onClick: onAddSubTab,
|
|
760
|
-
className: "cursor-pointer transition-colors duration-150",
|
|
761
|
-
children: "Add subtab"
|
|
762
|
-
}
|
|
763
|
-
),
|
|
764
|
-
canDelete && /* @__PURE__ */ jsx9(
|
|
765
|
-
DropdownMenuItem,
|
|
766
|
-
{
|
|
767
|
-
className: "text-red-500 cursor-pointer transition-colors duration-150 focus:text-red-600",
|
|
768
|
-
onClick: onDelete,
|
|
769
|
-
children: "Delete"
|
|
770
|
-
}
|
|
771
|
-
)
|
|
772
|
-
] })
|
|
773
|
-
] });
|
|
774
|
-
});
|
|
775
|
-
var SubTabItem = memo(
|
|
682
|
+
|
|
683
|
+
// src/components/sidebar/subtabItem.tsx
|
|
684
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
685
|
+
var SubTabItem = memo3(
|
|
776
686
|
function SubTabItem2({
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
editingSubId,
|
|
781
|
-
tempTitle,
|
|
687
|
+
subTab,
|
|
688
|
+
tabId,
|
|
689
|
+
isActive,
|
|
782
690
|
onSelect,
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
setEditingSubId,
|
|
786
|
-
setTempTitle,
|
|
787
|
-
onDeleteSubTab
|
|
691
|
+
onRename,
|
|
692
|
+
onDelete
|
|
788
693
|
}) {
|
|
789
|
-
const
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
const handleEdit = useCallback2(() => {
|
|
795
|
-
startRenameSubTab(st.id, st.title);
|
|
796
|
-
}, [startRenameSubTab, st.id, st.title]);
|
|
797
|
-
const handleCommit = useCallback2(() => {
|
|
798
|
-
commitRenameSubTab(tab.id);
|
|
799
|
-
}, [commitRenameSubTab, tab.id]);
|
|
800
|
-
const handleDelete = useCallback2(() => {
|
|
801
|
-
onDeleteSubTab(tab.id, st.id);
|
|
802
|
-
}, [onDeleteSubTab, tab.id, st.id]);
|
|
803
|
-
const handleTitleChange = useCallback2(
|
|
804
|
-
(val) => {
|
|
805
|
-
setTempTitle(val);
|
|
694
|
+
const [isEditing, setIsEditing] = useState5(false);
|
|
695
|
+
const handleDoubleClick = useCallback3(
|
|
696
|
+
(e) => {
|
|
697
|
+
e.stopPropagation();
|
|
698
|
+
setIsEditing(true);
|
|
806
699
|
},
|
|
807
|
-
[
|
|
700
|
+
[]
|
|
808
701
|
);
|
|
809
|
-
const
|
|
810
|
-
|
|
811
|
-
|
|
702
|
+
const handleCommit = useCallback3(
|
|
703
|
+
(title) => {
|
|
704
|
+
onRename(title);
|
|
705
|
+
setIsEditing(false);
|
|
706
|
+
},
|
|
707
|
+
[onRename]
|
|
708
|
+
);
|
|
709
|
+
const handleCancel = useCallback3(() => {
|
|
710
|
+
setIsEditing(false);
|
|
711
|
+
}, []);
|
|
812
712
|
return /* @__PURE__ */ jsxs5(
|
|
813
713
|
motion.div,
|
|
814
714
|
{
|
|
@@ -819,206 +719,191 @@ var SubTabItem = memo(
|
|
|
819
719
|
layout: true,
|
|
820
720
|
className: `
|
|
821
721
|
group ml-9 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm
|
|
822
|
-
transition-
|
|
823
|
-
${
|
|
722
|
+
transition-colors duration-150
|
|
723
|
+
${isActive ? "bg-accent" : "hover:bg-accent/50"}
|
|
824
724
|
`,
|
|
825
725
|
children: [
|
|
826
726
|
/* @__PURE__ */ jsx9(
|
|
827
727
|
FileText,
|
|
828
728
|
{
|
|
829
729
|
size: 14,
|
|
830
|
-
className: `flex-shrink-0 transition-
|
|
730
|
+
className: `flex-shrink-0 transition-opacity duration-150 ${isActive ? "opacity-100" : "opacity-50 group-hover:opacity-100"}`
|
|
831
731
|
}
|
|
832
732
|
),
|
|
833
|
-
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx9(
|
|
834
|
-
|
|
733
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children: isEditing ? /* @__PURE__ */ jsx9(
|
|
734
|
+
InlineInput,
|
|
835
735
|
{
|
|
836
|
-
|
|
837
|
-
title: st.title,
|
|
838
|
-
tempTitle,
|
|
839
|
-
onTitleChange: handleTitleChange,
|
|
840
|
-
onStartEdit: handleEdit,
|
|
736
|
+
value: subTab.title,
|
|
841
737
|
onCommit: handleCommit,
|
|
842
738
|
onCancel: handleCancel,
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
739
|
+
className: "h-6 w-full"
|
|
740
|
+
}
|
|
741
|
+
) : /* @__PURE__ */ jsx9(
|
|
742
|
+
"button",
|
|
743
|
+
{
|
|
744
|
+
className: "w-full truncate text-left transition-colors duration-150 hover:text-foreground",
|
|
745
|
+
onClick: onSelect,
|
|
746
|
+
onDoubleClick: handleDoubleClick,
|
|
747
|
+
children: subTab.title
|
|
846
748
|
}
|
|
847
749
|
) }),
|
|
848
|
-
/* @__PURE__ */ jsx9(
|
|
750
|
+
/* @__PURE__ */ jsx9(OptionsMenu, { onDelete })
|
|
849
751
|
]
|
|
850
|
-
}
|
|
851
|
-
st.id
|
|
752
|
+
}
|
|
852
753
|
);
|
|
853
754
|
},
|
|
854
|
-
(
|
|
855
|
-
return prevProps.st.id === nextProps.st.id && prevProps.activeSubTabId === nextProps.activeSubTabId && prevProps.editingSubId === nextProps.editingSubId && prevProps.tempTitle === nextProps.tempTitle && prevProps.st.title === nextProps.st.title;
|
|
856
|
-
}
|
|
755
|
+
(prev, next) => prev.subTab.id === next.subTab.id && prev.subTab.title === next.subTab.title && prev.isActive === next.isActive
|
|
857
756
|
);
|
|
858
|
-
|
|
757
|
+
|
|
758
|
+
// src/components/sidebar/tabItem.tsx
|
|
759
|
+
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
760
|
+
var TabItem = memo4(
|
|
859
761
|
function TabItem2({
|
|
860
762
|
tab,
|
|
861
|
-
|
|
763
|
+
isActive,
|
|
764
|
+
hasActiveSubTab,
|
|
862
765
|
activeSubTabId,
|
|
863
|
-
|
|
864
|
-
editingId,
|
|
865
|
-
editingSubId,
|
|
866
|
-
tempTitle,
|
|
867
|
-
openTabs,
|
|
766
|
+
canDelete,
|
|
868
767
|
onSelect,
|
|
869
|
-
|
|
768
|
+
onRename,
|
|
870
769
|
onDelete,
|
|
871
|
-
|
|
872
|
-
startRenameSubTab,
|
|
873
|
-
commitRenameTab,
|
|
874
|
-
commitRenameSubTab,
|
|
875
|
-
setEditingId,
|
|
876
|
-
setEditingSubId,
|
|
877
|
-
setTempTitle,
|
|
878
|
-
toggleTabOpen,
|
|
770
|
+
onAddSubTab,
|
|
879
771
|
onRenameSubTab,
|
|
880
|
-
onDeleteSubTab
|
|
881
|
-
setOpenTabs
|
|
772
|
+
onDeleteSubTab
|
|
882
773
|
}) {
|
|
883
|
-
const
|
|
774
|
+
const [isEditing, setIsEditing] = useState6(false);
|
|
775
|
+
const [isOpen, setIsOpen] = useState6(hasActiveSubTab);
|
|
884
776
|
const hasSubtabs = tab.subtabs.length > 0;
|
|
885
|
-
const
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
const handleTitleChange = useCallback2(
|
|
897
|
-
(val) => {
|
|
898
|
-
setTempTitle(val);
|
|
777
|
+
const handleDoubleClick = useCallback4(
|
|
778
|
+
(e) => {
|
|
779
|
+
e.stopPropagation();
|
|
780
|
+
setIsEditing(true);
|
|
781
|
+
},
|
|
782
|
+
[]
|
|
783
|
+
);
|
|
784
|
+
const handleCommit = useCallback4(
|
|
785
|
+
(title) => {
|
|
786
|
+
onRename(title);
|
|
787
|
+
setIsEditing(false);
|
|
899
788
|
},
|
|
900
|
-
[
|
|
789
|
+
[onRename]
|
|
901
790
|
);
|
|
902
|
-
const handleCancel =
|
|
903
|
-
|
|
904
|
-
}, [
|
|
905
|
-
const
|
|
906
|
-
onAddSubTab(tab.id);
|
|
907
|
-
setOpenTabs((prev) => ({
|
|
908
|
-
...prev,
|
|
909
|
-
[tab.id]: true
|
|
910
|
-
}));
|
|
911
|
-
}, [onAddSubTab, tab.id, setOpenTabs]);
|
|
912
|
-
const handleToggle = useCallback2(
|
|
791
|
+
const handleCancel = useCallback4(() => {
|
|
792
|
+
setIsEditing(false);
|
|
793
|
+
}, []);
|
|
794
|
+
const handleToggle = useCallback4(
|
|
913
795
|
(e) => {
|
|
914
796
|
e.stopPropagation();
|
|
915
|
-
|
|
797
|
+
setIsOpen((prev) => !prev);
|
|
916
798
|
},
|
|
917
|
-
[
|
|
799
|
+
[]
|
|
918
800
|
);
|
|
919
|
-
const
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
801
|
+
const handleAddSubTab = useCallback4(() => {
|
|
802
|
+
onAddSubTab();
|
|
803
|
+
setIsOpen(true);
|
|
804
|
+
}, [onAddSubTab]);
|
|
805
|
+
if (hasActiveSubTab && !isOpen) {
|
|
806
|
+
setIsOpen(true);
|
|
807
|
+
}
|
|
808
|
+
return /* @__PURE__ */ jsxs6(
|
|
809
|
+
motion2.div,
|
|
924
810
|
{
|
|
925
811
|
variants: tabVariants,
|
|
926
812
|
initial: "initial",
|
|
927
813
|
animate: "animate",
|
|
928
814
|
exit: "exit",
|
|
929
815
|
layout: true,
|
|
930
|
-
children:
|
|
931
|
-
/* @__PURE__ */
|
|
816
|
+
children: [
|
|
817
|
+
/* @__PURE__ */ jsxs6(
|
|
932
818
|
"div",
|
|
933
819
|
{
|
|
934
820
|
className: `
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
821
|
+
group flex items-center gap-2 rounded-md px-2 py-1.5
|
|
822
|
+
transition-colors duration-150
|
|
823
|
+
${isActive ? "bg-accent" : "hover:bg-accent/50"}
|
|
824
|
+
`,
|
|
939
825
|
children: [
|
|
940
|
-
hasSubtabs && /* @__PURE__ */
|
|
826
|
+
hasSubtabs && /* @__PURE__ */ jsx10(
|
|
941
827
|
"button",
|
|
942
828
|
{
|
|
943
829
|
onClick: handleToggle,
|
|
944
|
-
className: "flex h-5 w-5 items-center justify-center rounded transition-all duration-
|
|
945
|
-
"aria-label": isOpen ? "Collapse
|
|
946
|
-
children: /* @__PURE__ */
|
|
830
|
+
className: "flex h-5 w-5 items-center justify-center rounded transition-all duration-150 hover:bg-accent/80",
|
|
831
|
+
"aria-label": isOpen ? "Collapse" : "Expand",
|
|
832
|
+
children: /* @__PURE__ */ jsx10(
|
|
947
833
|
ChevronRight,
|
|
948
834
|
{
|
|
949
835
|
size: 14,
|
|
950
|
-
className: `transition-transform duration-
|
|
836
|
+
className: `transition-transform duration-200 ${isOpen ? "rotate-90" : ""}`
|
|
951
837
|
}
|
|
952
838
|
)
|
|
953
839
|
}
|
|
954
840
|
),
|
|
955
|
-
/* @__PURE__ */
|
|
956
|
-
|
|
841
|
+
/* @__PURE__ */ jsx10(
|
|
842
|
+
FileText2,
|
|
957
843
|
{
|
|
958
844
|
size: 16,
|
|
959
|
-
className: `flex-shrink-0 transition-
|
|
845
|
+
className: `flex-shrink-0 transition-opacity duration-150 ${hasSubtabs ? "" : "ml-5"} ${isActive ? "opacity-100" : "opacity-60 group-hover:opacity-100"}`
|
|
960
846
|
}
|
|
961
847
|
),
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
|
|
848
|
+
/* @__PURE__ */ jsx10("div", { className: "flex-1 min-w-0", children: isEditing ? /* @__PURE__ */ jsx10(
|
|
849
|
+
InlineInput,
|
|
964
850
|
{
|
|
965
|
-
|
|
966
|
-
title: tab.title,
|
|
967
|
-
tempTitle,
|
|
968
|
-
onTitleChange: handleTitleChange,
|
|
969
|
-
onStartEdit: handleEdit,
|
|
851
|
+
value: tab.title,
|
|
970
852
|
onCommit: handleCommit,
|
|
971
853
|
onCancel: handleCancel,
|
|
972
|
-
|
|
854
|
+
className: "h-7 w-full"
|
|
855
|
+
}
|
|
856
|
+
) : /* @__PURE__ */ jsx10(
|
|
857
|
+
"button",
|
|
858
|
+
{
|
|
859
|
+
className: "w-full truncate text-left text-sm transition-colors duration-150 hover:text-foreground",
|
|
860
|
+
onClick: onSelect,
|
|
861
|
+
onDoubleClick: handleDoubleClick,
|
|
862
|
+
children: tab.title
|
|
973
863
|
}
|
|
974
864
|
) }),
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
|
|
865
|
+
/* @__PURE__ */ jsx10(
|
|
866
|
+
OptionsMenu,
|
|
977
867
|
{
|
|
978
|
-
canDelete
|
|
868
|
+
canDelete,
|
|
979
869
|
onAddSubTab: handleAddSubTab,
|
|
980
|
-
onDelete
|
|
870
|
+
onDelete
|
|
981
871
|
}
|
|
982
872
|
)
|
|
983
873
|
]
|
|
984
874
|
}
|
|
985
875
|
),
|
|
986
|
-
hasSubtabs && /* @__PURE__ */
|
|
876
|
+
hasSubtabs && /* @__PURE__ */ jsx10(
|
|
987
877
|
"div",
|
|
988
878
|
{
|
|
989
879
|
className: `
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
children: /* @__PURE__ */
|
|
880
|
+
grid transition-all duration-200 ease-in-out
|
|
881
|
+
${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}
|
|
882
|
+
`,
|
|
883
|
+
children: /* @__PURE__ */ jsx10("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx10("div", { className: "pt-1 space-y-1", children: /* @__PURE__ */ jsx10(AnimatePresence, { mode: "popLayout", children: tab.subtabs.map((subTab) => /* @__PURE__ */ jsx10(
|
|
994
884
|
SubTabItem,
|
|
995
885
|
{
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
activeSubTabId,
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
startRenameSubTab,
|
|
1003
|
-
commitRenameSubTab,
|
|
1004
|
-
setEditingSubId,
|
|
1005
|
-
setTempTitle,
|
|
1006
|
-
onDeleteSubTab
|
|
886
|
+
subTab,
|
|
887
|
+
tabId: tab.id,
|
|
888
|
+
isActive: subTab.id === activeSubTabId,
|
|
889
|
+
onSelect: () => onSelect(),
|
|
890
|
+
onRename: (title) => onRenameSubTab(subTab.id, title),
|
|
891
|
+
onDelete: () => onDeleteSubTab(subTab.id)
|
|
1007
892
|
},
|
|
1008
|
-
|
|
893
|
+
subTab.id
|
|
1009
894
|
)) }) }) })
|
|
1010
895
|
}
|
|
1011
896
|
)
|
|
1012
|
-
]
|
|
1013
|
-
}
|
|
1014
|
-
tab.id
|
|
897
|
+
]
|
|
898
|
+
}
|
|
1015
899
|
);
|
|
1016
900
|
},
|
|
1017
|
-
(
|
|
1018
|
-
return prevProps.tab.id === nextProps.tab.id && prevProps.tab.title === nextProps.tab.title && prevProps.tab.subtabs.length === nextProps.tab.subtabs.length && prevProps.activeTabId === nextProps.activeTabId && prevProps.activeSubTabId === nextProps.activeSubTabId && prevProps.editingId === nextProps.editingId && prevProps.editingSubId === nextProps.editingSubId && prevProps.openTabs[prevProps.tab.id] === nextProps.openTabs[nextProps.tab.id];
|
|
1019
|
-
}
|
|
901
|
+
(prev, next) => prev.tab.id === next.tab.id && prev.tab.title === next.tab.title && prev.tab.subtabs.length === next.tab.subtabs.length && prev.isActive === next.isActive && prev.activeSubTabId === next.activeSubTabId && prev.hasActiveSubTab === next.hasActiveSubTab
|
|
1020
902
|
);
|
|
1021
|
-
|
|
903
|
+
|
|
904
|
+
// src/components/sidebar/EditorSidebar.tsx
|
|
905
|
+
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
906
|
+
var AppSidebar = memo5(
|
|
1022
907
|
function AppSidebar2({
|
|
1023
908
|
tabs,
|
|
1024
909
|
activeTabId,
|
|
@@ -1032,90 +917,42 @@ var AppSidebar = memo(
|
|
|
1032
917
|
onRenameSubTab,
|
|
1033
918
|
onDeleteSubTab
|
|
1034
919
|
}) {
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
const [tempTitle, setTempTitle] = useState3("");
|
|
1038
|
-
const [openTabs, setOpenTabs] = useState3({});
|
|
1039
|
-
const startRenameTab = useCallback2((id, title) => {
|
|
1040
|
-
setEditingId(id);
|
|
1041
|
-
setEditingSubId(null);
|
|
1042
|
-
setTempTitle(title);
|
|
1043
|
-
}, []);
|
|
1044
|
-
const startRenameSubTab = useCallback2((id, title) => {
|
|
1045
|
-
setEditingSubId(id);
|
|
1046
|
-
setEditingId(null);
|
|
1047
|
-
setTempTitle(title);
|
|
1048
|
-
}, []);
|
|
1049
|
-
const commitRenameTab = useCallback2(() => {
|
|
1050
|
-
if (!editingId) return;
|
|
1051
|
-
onRename(editingId, tempTitle.trim() || "Untitled");
|
|
1052
|
-
setEditingId(null);
|
|
1053
|
-
}, [editingId, tempTitle, onRename]);
|
|
1054
|
-
const commitRenameSubTab = useCallback2(
|
|
1055
|
-
(tabId) => {
|
|
1056
|
-
if (!editingSubId || !onRenameSubTab) return;
|
|
1057
|
-
onRenameSubTab(tabId, editingSubId, tempTitle.trim() || "Untitled");
|
|
1058
|
-
setEditingSubId(null);
|
|
1059
|
-
},
|
|
1060
|
-
[editingSubId, tempTitle, onRenameSubTab]
|
|
1061
|
-
);
|
|
1062
|
-
const toggleTabOpen = useCallback2((tabId) => {
|
|
1063
|
-
setOpenTabs((prev) => ({
|
|
1064
|
-
...prev,
|
|
1065
|
-
[tabId]: !prev[tabId]
|
|
1066
|
-
}));
|
|
1067
|
-
}, []);
|
|
1068
|
-
return /* @__PURE__ */ jsx9(Sidebar, { children: /* @__PURE__ */ jsx9(SidebarContent, { children: /* @__PURE__ */ jsxs5(SidebarGroup, { children: [
|
|
1069
|
-
/* @__PURE__ */ jsxs5(SidebarGroupLabel, { className: "flex items-center justify-between", children: [
|
|
920
|
+
return /* @__PURE__ */ jsx11(Sidebar, { children: /* @__PURE__ */ jsx11(SidebarContent, { children: /* @__PURE__ */ jsxs7(SidebarGroup, { children: [
|
|
921
|
+
/* @__PURE__ */ jsxs7(SidebarGroupLabel, { className: "flex items-center justify-between", children: [
|
|
1070
922
|
"Documents",
|
|
1071
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ jsx11(
|
|
1072
924
|
"button",
|
|
1073
925
|
{
|
|
1074
926
|
onClick: onAddTab,
|
|
1075
|
-
className: "rounded p-1 transition-all duration-
|
|
927
|
+
className: "rounded p-1 transition-all duration-150 hover:bg-accent hover:scale-110",
|
|
1076
928
|
"aria-label": "Add new document",
|
|
1077
|
-
children: /* @__PURE__ */
|
|
929
|
+
children: /* @__PURE__ */ jsx11(Plus, { size: 16 })
|
|
1078
930
|
}
|
|
1079
931
|
)
|
|
1080
932
|
] }),
|
|
1081
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ jsx11(SidebarMenu, { children: /* @__PURE__ */ jsx11(AnimatePresence2, { mode: "popLayout", children: tabs?.map((tab) => /* @__PURE__ */ jsx11(SidebarMenuItem, { className: "list-none", children: /* @__PURE__ */ jsx11(
|
|
1082
934
|
TabItem,
|
|
1083
935
|
{
|
|
1084
936
|
tab,
|
|
1085
|
-
activeTabId,
|
|
937
|
+
isActive: tab.id === activeTabId && !activeSubTabId,
|
|
938
|
+
hasActiveSubTab: tab.id === activeTabId && activeSubTabId !== null,
|
|
1086
939
|
activeSubTabId,
|
|
1087
|
-
canDeleteTab,
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
startRenameSubTab,
|
|
1097
|
-
commitRenameTab,
|
|
1098
|
-
commitRenameSubTab,
|
|
1099
|
-
setEditingId,
|
|
1100
|
-
setEditingSubId,
|
|
1101
|
-
setTempTitle,
|
|
1102
|
-
toggleTabOpen,
|
|
1103
|
-
onRenameSubTab,
|
|
1104
|
-
onDeleteSubTab,
|
|
1105
|
-
setOpenTabs
|
|
1106
|
-
},
|
|
1107
|
-
tab.id
|
|
1108
|
-
)) }) })
|
|
940
|
+
canDelete: canDeleteTab,
|
|
941
|
+
onSelect: () => onSelect(tab.id),
|
|
942
|
+
onRename: (title) => onRename(tab.id, title),
|
|
943
|
+
onDelete: () => onDelete(tab.id),
|
|
944
|
+
onAddSubTab: () => onAddSubTab(tab.id),
|
|
945
|
+
onRenameSubTab: (subTabId, title) => onRenameSubTab(tab.id, subTabId, title),
|
|
946
|
+
onDeleteSubTab: (subTabId) => onDeleteSubTab(tab.id, subTabId)
|
|
947
|
+
}
|
|
948
|
+
) }, tab.id)) }) })
|
|
1109
949
|
] }) }) });
|
|
1110
|
-
},
|
|
1111
|
-
(prevProps, nextProps) => {
|
|
1112
|
-
return JSON.stringify(prevProps.tabs) === JSON.stringify(nextProps.tabs) && prevProps.activeTabId === nextProps.activeTabId && prevProps.activeSubTabId === nextProps.activeSubTabId;
|
|
1113
950
|
}
|
|
1114
951
|
);
|
|
1115
952
|
|
|
1116
953
|
// src/contexts/EditorBridge.tsx
|
|
1117
954
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
1118
|
-
import { jsx as
|
|
955
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1119
956
|
var EditorBridgeContext = createContext2(
|
|
1120
957
|
void 0
|
|
1121
958
|
);
|
|
@@ -1123,7 +960,7 @@ function EditorBridgeProvider({
|
|
|
1123
960
|
children,
|
|
1124
961
|
value
|
|
1125
962
|
}) {
|
|
1126
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ jsx12(EditorBridgeContext.Provider, { value, children });
|
|
1127
964
|
}
|
|
1128
965
|
function useEditorBridge() {
|
|
1129
966
|
const ctx = useContext2(EditorBridgeContext);
|
|
@@ -1135,42 +972,42 @@ function useEditorBridge() {
|
|
|
1135
972
|
|
|
1136
973
|
// src/contexts/EditorStateProvider.tsx
|
|
1137
974
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
1138
|
-
import { jsx as
|
|
975
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1139
976
|
var EditorStateContext = createContext3(null);
|
|
1140
977
|
function EditorStateProvider({ children, value }) {
|
|
1141
|
-
return /* @__PURE__ */
|
|
978
|
+
return /* @__PURE__ */ jsx13(EditorStateContext.Provider, { value, children });
|
|
1142
979
|
}
|
|
1143
980
|
|
|
1144
981
|
// src/contexts/EditorActionsProvider.tsx
|
|
1145
982
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
1146
|
-
import { jsx as
|
|
983
|
+
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1147
984
|
var EditorActionsContext = createContext4(null);
|
|
1148
985
|
function EditorActionsProvider({ children, value }) {
|
|
1149
|
-
return /* @__PURE__ */
|
|
986
|
+
return /* @__PURE__ */ jsx14(EditorActionsContext.Provider, { value, children });
|
|
1150
987
|
}
|
|
1151
988
|
|
|
1152
989
|
// src/contexts/themeProvider.tsx
|
|
1153
990
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
1154
|
-
import { jsx as
|
|
991
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1155
992
|
function ThemeProvider({ children, ...props }) {
|
|
1156
|
-
return /* @__PURE__ */
|
|
993
|
+
return /* @__PURE__ */ jsx15(NextThemesProvider, { ...props, children });
|
|
1157
994
|
}
|
|
1158
995
|
|
|
1159
996
|
// src/components/editorLayout/editorLayout.tsx
|
|
1160
|
-
import { jsx as
|
|
997
|
+
import { jsx as jsx16, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1161
998
|
function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
1162
|
-
const [editor, setEditor] =
|
|
1163
|
-
const [tabs, setTabs] =
|
|
1164
|
-
const [activeTabId, setActiveTabId] =
|
|
1165
|
-
const [activeSubTabId, setActiveSubTabId] =
|
|
1166
|
-
const debouncedSaveRef =
|
|
1167
|
-
const onChangeDebounceRef =
|
|
1168
|
-
const isRestoringRef =
|
|
1169
|
-
const editorState =
|
|
999
|
+
const [editor, setEditor] = useState7(null);
|
|
1000
|
+
const [tabs, setTabs] = useState7([]);
|
|
1001
|
+
const [activeTabId, setActiveTabId] = useState7("");
|
|
1002
|
+
const [activeSubTabId, setActiveSubTabId] = useState7(null);
|
|
1003
|
+
const debouncedSaveRef = useRef(null);
|
|
1004
|
+
const onChangeDebounceRef = useRef(null);
|
|
1005
|
+
const isRestoringRef = useRef(false);
|
|
1006
|
+
const editorState = useMemo2(
|
|
1170
1007
|
() => ({ tabs, activeTabId, activeSubTabId }),
|
|
1171
1008
|
[tabs, activeTabId, activeSubTabId]
|
|
1172
1009
|
);
|
|
1173
|
-
const emitChangeDebounced =
|
|
1010
|
+
const emitChangeDebounced = useCallback5(
|
|
1174
1011
|
(payload) => {
|
|
1175
1012
|
if (!onChange) return;
|
|
1176
1013
|
if (onChangeDebounceRef.current) clearTimeout(onChangeDebounceRef.current);
|
|
@@ -1178,7 +1015,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1178
1015
|
},
|
|
1179
1016
|
[onChange]
|
|
1180
1017
|
);
|
|
1181
|
-
const emitChange =
|
|
1018
|
+
const emitChange = useCallback5(
|
|
1182
1019
|
(source) => {
|
|
1183
1020
|
if (!onChange) return;
|
|
1184
1021
|
emitChangeDebounced({ tabs, activeTabId, activeSubTabId, source });
|
|
@@ -1197,7 +1034,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1197
1034
|
useEffect2(() => {
|
|
1198
1035
|
onTabsChange?.(tabs);
|
|
1199
1036
|
}, [tabs, onTabsChange]);
|
|
1200
|
-
const saveCurrentContent =
|
|
1037
|
+
const saveCurrentContent = useCallback5(() => {
|
|
1201
1038
|
if (!editor) return tabs;
|
|
1202
1039
|
const json = editor.getJSON();
|
|
1203
1040
|
return tabs.map((tab) => {
|
|
@@ -1213,7 +1050,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1213
1050
|
return { ...tab, content: json };
|
|
1214
1051
|
});
|
|
1215
1052
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1216
|
-
const saveFromEditor =
|
|
1053
|
+
const saveFromEditor = useCallback5(
|
|
1217
1054
|
(editorInstance, source = "editor") => {
|
|
1218
1055
|
const json = editorInstance.getJSON();
|
|
1219
1056
|
setTabs((prev) => {
|
|
@@ -1242,7 +1079,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1242
1079
|
},
|
|
1243
1080
|
[activeTabId, activeSubTabId, emitChangeDebounced]
|
|
1244
1081
|
);
|
|
1245
|
-
const debouncedSave =
|
|
1082
|
+
const debouncedSave = useCallback5(
|
|
1246
1083
|
(editorInstance) => {
|
|
1247
1084
|
if (debouncedSaveRef.current) clearTimeout(debouncedSaveRef.current);
|
|
1248
1085
|
debouncedSaveRef.current = setTimeout(() => {
|
|
@@ -1251,7 +1088,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1251
1088
|
},
|
|
1252
1089
|
[saveFromEditor]
|
|
1253
1090
|
);
|
|
1254
|
-
const addTab =
|
|
1091
|
+
const addTab = useCallback5(() => {
|
|
1255
1092
|
if (debouncedSaveRef.current) {
|
|
1256
1093
|
clearTimeout(debouncedSaveRef.current);
|
|
1257
1094
|
debouncedSaveRef.current = null;
|
|
@@ -1273,7 +1110,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1273
1110
|
source: "add-tab"
|
|
1274
1111
|
});
|
|
1275
1112
|
}, [saveCurrentContent, editor, emitChangeDebounced]);
|
|
1276
|
-
const addSubTab =
|
|
1113
|
+
const addSubTab = useCallback5(
|
|
1277
1114
|
(tabId) => {
|
|
1278
1115
|
if (debouncedSaveRef.current) {
|
|
1279
1116
|
clearTimeout(debouncedSaveRef.current);
|
|
@@ -1300,7 +1137,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1300
1137
|
},
|
|
1301
1138
|
[saveCurrentContent, editor, emitChangeDebounced]
|
|
1302
1139
|
);
|
|
1303
|
-
const selectNode =
|
|
1140
|
+
const selectNode = useCallback5(
|
|
1304
1141
|
(tabId, subId) => {
|
|
1305
1142
|
if (debouncedSaveRef.current) {
|
|
1306
1143
|
clearTimeout(debouncedSaveRef.current);
|
|
@@ -1319,13 +1156,13 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1319
1156
|
},
|
|
1320
1157
|
[saveCurrentContent, emitChangeDebounced]
|
|
1321
1158
|
);
|
|
1322
|
-
const renameTab =
|
|
1159
|
+
const renameTab = useCallback5(
|
|
1323
1160
|
(id, title) => {
|
|
1324
1161
|
setTabs((prev) => prev.map((t) => t.id === id ? { ...t, title } : t));
|
|
1325
1162
|
},
|
|
1326
1163
|
[]
|
|
1327
1164
|
);
|
|
1328
|
-
const deleteTab =
|
|
1165
|
+
const deleteTab = useCallback5(
|
|
1329
1166
|
(id) => {
|
|
1330
1167
|
if (debouncedSaveRef.current) {
|
|
1331
1168
|
clearTimeout(debouncedSaveRef.current);
|
|
@@ -1348,7 +1185,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1348
1185
|
},
|
|
1349
1186
|
[activeTabId, tabs, saveCurrentContent, editor, emitChange]
|
|
1350
1187
|
);
|
|
1351
|
-
const deleteSubTab =
|
|
1188
|
+
const deleteSubTab = useCallback5(
|
|
1352
1189
|
(tabId, subTabId) => {
|
|
1353
1190
|
setTabs(
|
|
1354
1191
|
(prev) => prev.map((tab) => {
|
|
@@ -1365,7 +1202,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1365
1202
|
},
|
|
1366
1203
|
[activeSubTabId, editor, emitChange]
|
|
1367
1204
|
);
|
|
1368
|
-
const renameSubTab =
|
|
1205
|
+
const renameSubTab = useCallback5(
|
|
1369
1206
|
(tabId, subTabId, title) => {
|
|
1370
1207
|
setTabs(
|
|
1371
1208
|
(prev) => prev.map(
|
|
@@ -1380,7 +1217,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1380
1217
|
},
|
|
1381
1218
|
[]
|
|
1382
1219
|
);
|
|
1383
|
-
const editorActions =
|
|
1220
|
+
const editorActions = useMemo2(
|
|
1384
1221
|
() => ({
|
|
1385
1222
|
addTab,
|
|
1386
1223
|
addSubTab,
|
|
@@ -1407,8 +1244,8 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1407
1244
|
}
|
|
1408
1245
|
isRestoringRef.current = false;
|
|
1409
1246
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1410
|
-
return /* @__PURE__ */
|
|
1411
|
-
/* @__PURE__ */
|
|
1247
|
+
return /* @__PURE__ */ jsx16(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, children: /* @__PURE__ */ jsx16(EditorBridgeProvider, { value: { editorContent: editor, setEditorContent: setEditor, debouncedSave }, children: /* @__PURE__ */ jsx16(EditorStateProvider, { value: editorState, children: /* @__PURE__ */ jsx16(EditorActionsProvider, { value: editorActions, children: /* @__PURE__ */ jsx16(SidebarProvider, { children: /* @__PURE__ */ jsxs8("div", { className: "flex h-full w-full min-h-0 relative", children: [
|
|
1248
|
+
/* @__PURE__ */ jsx16(
|
|
1412
1249
|
AppSidebar,
|
|
1413
1250
|
{
|
|
1414
1251
|
tabs,
|
|
@@ -1424,15 +1261,15 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1424
1261
|
onDeleteSubTab: deleteSubTab
|
|
1425
1262
|
}
|
|
1426
1263
|
),
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1429
|
-
/* @__PURE__ */
|
|
1264
|
+
/* @__PURE__ */ jsxs8(SidebarInset, { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
1265
|
+
/* @__PURE__ */ jsx16("header", { className: "h-12 flex-shrink-0 border-b flex items-center px-4", children: /* @__PURE__ */ jsx16(SidebarTrigger, {}) }),
|
|
1266
|
+
/* @__PURE__ */ jsx16("div", { className: "flex-1 min-h-0 overflow-auto", children })
|
|
1430
1267
|
] })
|
|
1431
1268
|
] }) }) }) }) }) });
|
|
1432
1269
|
}
|
|
1433
1270
|
|
|
1434
1271
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
1435
|
-
import { useEffect as useEffect23, useRef as
|
|
1272
|
+
import { useEffect as useEffect23, useRef as useRef7, useState as useState33 } from "react";
|
|
1436
1273
|
import { EditorContent, EditorContext, useEditor } from "@tiptap/react";
|
|
1437
1274
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
1438
1275
|
import Image from "@tiptap/extension-image";
|
|
@@ -1615,7 +1452,7 @@ var FontSizeStepper = Extension.create({
|
|
|
1615
1452
|
});
|
|
1616
1453
|
|
|
1617
1454
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1618
|
-
import { forwardRef as forwardRef2, Fragment, useMemo as
|
|
1455
|
+
import { forwardRef as forwardRef2, Fragment as Fragment2, useMemo as useMemo4 } from "react";
|
|
1619
1456
|
|
|
1620
1457
|
// src/components/tiptap-ui-primitive/tooltip/tooltip.tsx
|
|
1621
1458
|
import {
|
|
@@ -1624,8 +1461,8 @@ import {
|
|
|
1624
1461
|
forwardRef,
|
|
1625
1462
|
isValidElement,
|
|
1626
1463
|
useContext as useContext5,
|
|
1627
|
-
useMemo as
|
|
1628
|
-
useState as
|
|
1464
|
+
useMemo as useMemo3,
|
|
1465
|
+
useState as useState8,
|
|
1629
1466
|
version
|
|
1630
1467
|
} from "react";
|
|
1631
1468
|
import {
|
|
@@ -1643,7 +1480,7 @@ import {
|
|
|
1643
1480
|
FloatingPortal,
|
|
1644
1481
|
FloatingDelayGroup
|
|
1645
1482
|
} from "@floating-ui/react";
|
|
1646
|
-
import { jsx as
|
|
1483
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1647
1484
|
function useTooltip({
|
|
1648
1485
|
initialOpen = false,
|
|
1649
1486
|
placement = "top",
|
|
@@ -1652,7 +1489,7 @@ function useTooltip({
|
|
|
1652
1489
|
delay = 600,
|
|
1653
1490
|
closeDelay = 0
|
|
1654
1491
|
} = {}) {
|
|
1655
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
1492
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState8(initialOpen);
|
|
1656
1493
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
1657
1494
|
const setOpen = setControlledOpen ?? setUncontrolledOpen;
|
|
1658
1495
|
const data = useFloating({
|
|
@@ -1686,7 +1523,7 @@ function useTooltip({
|
|
|
1686
1523
|
const dismiss = useDismiss(context);
|
|
1687
1524
|
const role = useRole(context, { role: "tooltip" });
|
|
1688
1525
|
const interactions = useInteractions([hover, focus, dismiss, role]);
|
|
1689
|
-
return
|
|
1526
|
+
return useMemo3(
|
|
1690
1527
|
() => ({
|
|
1691
1528
|
open,
|
|
1692
1529
|
setOpen,
|
|
@@ -1707,14 +1544,14 @@ function useTooltipContext() {
|
|
|
1707
1544
|
function Tooltip2({ children, ...props }) {
|
|
1708
1545
|
const tooltip = useTooltip(props);
|
|
1709
1546
|
if (!props.useDelayGroup) {
|
|
1710
|
-
return /* @__PURE__ */
|
|
1547
|
+
return /* @__PURE__ */ jsx17(TooltipContext.Provider, { value: tooltip, children });
|
|
1711
1548
|
}
|
|
1712
|
-
return /* @__PURE__ */
|
|
1549
|
+
return /* @__PURE__ */ jsx17(
|
|
1713
1550
|
FloatingDelayGroup,
|
|
1714
1551
|
{
|
|
1715
1552
|
delay: { open: props.delay ?? 0, close: props.closeDelay ?? 0 },
|
|
1716
1553
|
timeoutMs: props.timeout,
|
|
1717
|
-
children: /* @__PURE__ */
|
|
1554
|
+
children: /* @__PURE__ */ jsx17(TooltipContext.Provider, { value: tooltip, children })
|
|
1718
1555
|
}
|
|
1719
1556
|
);
|
|
1720
1557
|
}
|
|
@@ -1743,7 +1580,7 @@ var TooltipTrigger2 = forwardRef(
|
|
|
1743
1580
|
})
|
|
1744
1581
|
);
|
|
1745
1582
|
}
|
|
1746
|
-
return /* @__PURE__ */
|
|
1583
|
+
return /* @__PURE__ */ jsx17(
|
|
1747
1584
|
"button",
|
|
1748
1585
|
{
|
|
1749
1586
|
ref,
|
|
@@ -1759,7 +1596,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1759
1596
|
const context = useTooltipContext();
|
|
1760
1597
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
1761
1598
|
if (!context.open) return null;
|
|
1762
|
-
const content = /* @__PURE__ */
|
|
1599
|
+
const content = /* @__PURE__ */ jsx17(
|
|
1763
1600
|
"div",
|
|
1764
1601
|
{
|
|
1765
1602
|
ref,
|
|
@@ -1773,7 +1610,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1773
1610
|
}
|
|
1774
1611
|
);
|
|
1775
1612
|
if (portal) {
|
|
1776
|
-
return /* @__PURE__ */
|
|
1613
|
+
return /* @__PURE__ */ jsx17(FloatingPortal, { ...portalProps, children: content });
|
|
1777
1614
|
}
|
|
1778
1615
|
return content;
|
|
1779
1616
|
}
|
|
@@ -2090,14 +1927,14 @@ var FontSizeExtension = Extension2.create({
|
|
|
2090
1927
|
});
|
|
2091
1928
|
|
|
2092
1929
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
2093
|
-
import { jsx as
|
|
1930
|
+
import { jsx as jsx18, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2094
1931
|
var ShortcutDisplay = ({
|
|
2095
1932
|
shortcuts
|
|
2096
1933
|
}) => {
|
|
2097
1934
|
if (shortcuts.length === 0) return null;
|
|
2098
|
-
return /* @__PURE__ */
|
|
2099
|
-
index > 0 && /* @__PURE__ */
|
|
2100
|
-
/* @__PURE__ */
|
|
1935
|
+
return /* @__PURE__ */ jsx18("div", { children: shortcuts.map((key, index) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1936
|
+
index > 0 && /* @__PURE__ */ jsx18("kbd", { children: "+" }),
|
|
1937
|
+
/* @__PURE__ */ jsx18("kbd", { children: key })
|
|
2101
1938
|
] }, index)) });
|
|
2102
1939
|
};
|
|
2103
1940
|
var Button2 = forwardRef2(
|
|
@@ -2110,12 +1947,12 @@ var Button2 = forwardRef2(
|
|
|
2110
1947
|
"aria-label": ariaLabel,
|
|
2111
1948
|
...props
|
|
2112
1949
|
}, ref) => {
|
|
2113
|
-
const shortcuts =
|
|
1950
|
+
const shortcuts = useMemo4(
|
|
2114
1951
|
() => parseShortcutKeys({ shortcutKeys }),
|
|
2115
1952
|
[shortcutKeys]
|
|
2116
1953
|
);
|
|
2117
1954
|
if (!tooltip || !showTooltip) {
|
|
2118
|
-
return /* @__PURE__ */
|
|
1955
|
+
return /* @__PURE__ */ jsx18(
|
|
2119
1956
|
"button",
|
|
2120
1957
|
{
|
|
2121
1958
|
className: cn2("tiptap-button", className),
|
|
@@ -2126,8 +1963,8 @@ var Button2 = forwardRef2(
|
|
|
2126
1963
|
}
|
|
2127
1964
|
);
|
|
2128
1965
|
}
|
|
2129
|
-
return /* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
1966
|
+
return /* @__PURE__ */ jsxs9(Tooltip2, { delay: 200, children: [
|
|
1967
|
+
/* @__PURE__ */ jsx18(
|
|
2131
1968
|
TooltipTrigger2,
|
|
2132
1969
|
{
|
|
2133
1970
|
className: cn2("tiptap-button", className),
|
|
@@ -2137,16 +1974,16 @@ var Button2 = forwardRef2(
|
|
|
2137
1974
|
children
|
|
2138
1975
|
}
|
|
2139
1976
|
),
|
|
2140
|
-
/* @__PURE__ */
|
|
1977
|
+
/* @__PURE__ */ jsxs9(TooltipContent2, { children: [
|
|
2141
1978
|
tooltip,
|
|
2142
|
-
/* @__PURE__ */
|
|
1979
|
+
/* @__PURE__ */ jsx18(ShortcutDisplay, { shortcuts })
|
|
2143
1980
|
] })
|
|
2144
1981
|
] });
|
|
2145
1982
|
}
|
|
2146
1983
|
);
|
|
2147
1984
|
Button2.displayName = "Button";
|
|
2148
1985
|
var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical", ...props }, ref) => {
|
|
2149
|
-
return /* @__PURE__ */
|
|
1986
|
+
return /* @__PURE__ */ jsx18(
|
|
2150
1987
|
"div",
|
|
2151
1988
|
{
|
|
2152
1989
|
ref,
|
|
@@ -2161,7 +1998,7 @@ var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical",
|
|
|
2161
1998
|
ButtonGroup.displayName = "ButtonGroup";
|
|
2162
1999
|
|
|
2163
2000
|
// src/components/tiptap-ui-primitive/spacer/spacer.tsx
|
|
2164
|
-
import { jsx as
|
|
2001
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2165
2002
|
function Spacer({
|
|
2166
2003
|
orientation = "horizontal",
|
|
2167
2004
|
size,
|
|
@@ -2176,20 +2013,20 @@ function Spacer({
|
|
|
2176
2013
|
height: orientation === "horizontal" ? "1px" : size
|
|
2177
2014
|
}
|
|
2178
2015
|
};
|
|
2179
|
-
return /* @__PURE__ */
|
|
2016
|
+
return /* @__PURE__ */ jsx19("div", { ...props, style: computedStyle });
|
|
2180
2017
|
}
|
|
2181
2018
|
|
|
2182
2019
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2183
|
-
import { forwardRef as forwardRef4, useCallback as
|
|
2020
|
+
import { forwardRef as forwardRef4, useCallback as useCallback7, useEffect as useEffect4, useRef as useRef3, useState as useState10 } from "react";
|
|
2184
2021
|
|
|
2185
2022
|
// src/components/tiptap-ui-primitive/separator/separator.tsx
|
|
2186
2023
|
import { forwardRef as forwardRef3 } from "react";
|
|
2187
|
-
import { jsx as
|
|
2188
|
-
var
|
|
2024
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
2025
|
+
var Separator2 = forwardRef3(
|
|
2189
2026
|
({ decorative, orientation = "vertical", className, ...divProps }, ref) => {
|
|
2190
2027
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
2191
2028
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
2192
|
-
return /* @__PURE__ */
|
|
2029
|
+
return /* @__PURE__ */ jsx20(
|
|
2193
2030
|
"div",
|
|
2194
2031
|
{
|
|
2195
2032
|
className: cn2("tiptap-separator", className),
|
|
@@ -2201,10 +2038,10 @@ var Separator3 = forwardRef3(
|
|
|
2201
2038
|
);
|
|
2202
2039
|
}
|
|
2203
2040
|
);
|
|
2204
|
-
|
|
2041
|
+
Separator2.displayName = "Separator";
|
|
2205
2042
|
|
|
2206
2043
|
// src/hooks/use-menu-navigation.ts
|
|
2207
|
-
import { useEffect as useEffect3, useState as
|
|
2044
|
+
import { useEffect as useEffect3, useState as useState9 } from "react";
|
|
2208
2045
|
function useMenuNavigation({
|
|
2209
2046
|
editor,
|
|
2210
2047
|
containerRef,
|
|
@@ -2215,7 +2052,7 @@ function useMenuNavigation({
|
|
|
2215
2052
|
orientation = "vertical",
|
|
2216
2053
|
autoSelectFirstItem = true
|
|
2217
2054
|
}) {
|
|
2218
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2055
|
+
const [selectedIndex, setSelectedIndex] = useState9(
|
|
2219
2056
|
autoSelectFirstItem ? 0 : -1
|
|
2220
2057
|
);
|
|
2221
2058
|
useEffect3(() => {
|
|
@@ -2328,7 +2165,7 @@ function useMenuNavigation({
|
|
|
2328
2165
|
}
|
|
2329
2166
|
|
|
2330
2167
|
// src/hooks/use-composed-ref.ts
|
|
2331
|
-
import { useCallback as
|
|
2168
|
+
import { useCallback as useCallback6, useRef as useRef2 } from "react";
|
|
2332
2169
|
var updateRef = (ref, value) => {
|
|
2333
2170
|
if (typeof ref === "function") {
|
|
2334
2171
|
ref(value);
|
|
@@ -2338,8 +2175,8 @@ var updateRef = (ref, value) => {
|
|
|
2338
2175
|
}
|
|
2339
2176
|
};
|
|
2340
2177
|
var useComposedRef = (libRef, userRef) => {
|
|
2341
|
-
const prevUserRef =
|
|
2342
|
-
return
|
|
2178
|
+
const prevUserRef = useRef2(null);
|
|
2179
|
+
return useCallback6(
|
|
2343
2180
|
(instance) => {
|
|
2344
2181
|
if (libRef && "current" in libRef) {
|
|
2345
2182
|
;
|
|
@@ -2358,10 +2195,10 @@ var useComposedRef = (libRef, userRef) => {
|
|
|
2358
2195
|
};
|
|
2359
2196
|
|
|
2360
2197
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2361
|
-
import { jsx as
|
|
2198
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2362
2199
|
var useToolbarNavigation = (toolbarRef) => {
|
|
2363
|
-
const [items, setItems] =
|
|
2364
|
-
const collectItems =
|
|
2200
|
+
const [items, setItems] = useState10([]);
|
|
2201
|
+
const collectItems = useCallback7(() => {
|
|
2365
2202
|
if (!toolbarRef.current) return [];
|
|
2366
2203
|
return Array.from(
|
|
2367
2204
|
toolbarRef.current.querySelectorAll(
|
|
@@ -2412,10 +2249,10 @@ var useToolbarNavigation = (toolbarRef) => {
|
|
|
2412
2249
|
};
|
|
2413
2250
|
var Toolbar = forwardRef4(
|
|
2414
2251
|
({ children, className, variant = "fixed", ...props }, ref) => {
|
|
2415
|
-
const toolbarRef =
|
|
2252
|
+
const toolbarRef = useRef3(null);
|
|
2416
2253
|
const composedRef = useComposedRef(toolbarRef, ref);
|
|
2417
2254
|
useToolbarNavigation(toolbarRef);
|
|
2418
|
-
return /* @__PURE__ */
|
|
2255
|
+
return /* @__PURE__ */ jsx21(
|
|
2419
2256
|
"div",
|
|
2420
2257
|
{
|
|
2421
2258
|
ref: composedRef,
|
|
@@ -2431,7 +2268,7 @@ var Toolbar = forwardRef4(
|
|
|
2431
2268
|
);
|
|
2432
2269
|
Toolbar.displayName = "Toolbar";
|
|
2433
2270
|
var ToolbarGroup = forwardRef4(
|
|
2434
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2271
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx21(
|
|
2435
2272
|
"div",
|
|
2436
2273
|
{
|
|
2437
2274
|
ref,
|
|
@@ -2444,7 +2281,7 @@ var ToolbarGroup = forwardRef4(
|
|
|
2444
2281
|
);
|
|
2445
2282
|
ToolbarGroup.displayName = "ToolbarGroup";
|
|
2446
2283
|
var ToolbarSeparator = forwardRef4(
|
|
2447
|
-
({ ...props }, ref) => /* @__PURE__ */
|
|
2284
|
+
({ ...props }, ref) => /* @__PURE__ */ jsx21(Separator2, { ref, orientation: "vertical", decorative: true, ...props })
|
|
2448
2285
|
);
|
|
2449
2286
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
2450
2287
|
|
|
@@ -2460,11 +2297,11 @@ import {
|
|
|
2460
2297
|
Heading3,
|
|
2461
2298
|
Code
|
|
2462
2299
|
} from "lucide-react";
|
|
2463
|
-
import { jsx as
|
|
2300
|
+
import { jsx as jsx22, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2464
2301
|
function BubbleMenuInline() {
|
|
2465
2302
|
const { editor } = useCurrentEditor();
|
|
2466
2303
|
if (!editor) return null;
|
|
2467
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ jsx22(
|
|
2468
2305
|
BubbleMenu,
|
|
2469
2306
|
{
|
|
2470
2307
|
editor,
|
|
@@ -2483,81 +2320,81 @@ function BubbleMenuInline() {
|
|
|
2483
2320
|
if (hasImage) return false;
|
|
2484
2321
|
return true;
|
|
2485
2322
|
},
|
|
2486
|
-
children: /* @__PURE__ */
|
|
2323
|
+
children: /* @__PURE__ */ jsxs10(
|
|
2487
2324
|
"div",
|
|
2488
2325
|
{
|
|
2489
2326
|
className: "relative flex items-center gap-1 rounded-md border bg-[#171717] text-[#a1a1a6] p-1 shadow-md z-[15]\r\n animate-in fade-in slide-in-from-top-2 duration-200",
|
|
2490
2327
|
children: [
|
|
2491
|
-
/* @__PURE__ */
|
|
2328
|
+
/* @__PURE__ */ jsx22(
|
|
2492
2329
|
Button,
|
|
2493
2330
|
{
|
|
2494
2331
|
variant: "ghost",
|
|
2495
2332
|
size: "sm",
|
|
2496
2333
|
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
2497
2334
|
className: editor.isActive("heading", { level: 1 }) ? "bg-accent" : "",
|
|
2498
|
-
children: /* @__PURE__ */
|
|
2335
|
+
children: /* @__PURE__ */ jsx22(Heading1, { size: 15 })
|
|
2499
2336
|
}
|
|
2500
2337
|
),
|
|
2501
|
-
/* @__PURE__ */
|
|
2338
|
+
/* @__PURE__ */ jsx22(
|
|
2502
2339
|
Button,
|
|
2503
2340
|
{
|
|
2504
2341
|
variant: "ghost",
|
|
2505
2342
|
size: "sm",
|
|
2506
2343
|
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
2507
2344
|
className: editor.isActive("heading", { level: 2 }) ? "bg-accent" : "",
|
|
2508
|
-
children: /* @__PURE__ */
|
|
2345
|
+
children: /* @__PURE__ */ jsx22(Heading2, { size: 15 })
|
|
2509
2346
|
}
|
|
2510
2347
|
),
|
|
2511
|
-
/* @__PURE__ */
|
|
2348
|
+
/* @__PURE__ */ jsx22(
|
|
2512
2349
|
Button,
|
|
2513
2350
|
{
|
|
2514
2351
|
variant: "ghost",
|
|
2515
2352
|
size: "sm",
|
|
2516
2353
|
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
2517
2354
|
className: editor.isActive("heading", { level: 3 }) ? "bg-accent" : "",
|
|
2518
|
-
children: /* @__PURE__ */
|
|
2355
|
+
children: /* @__PURE__ */ jsx22(Heading3, { size: 15 })
|
|
2519
2356
|
}
|
|
2520
2357
|
),
|
|
2521
|
-
/* @__PURE__ */
|
|
2522
|
-
/* @__PURE__ */
|
|
2358
|
+
/* @__PURE__ */ jsx22(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2359
|
+
/* @__PURE__ */ jsx22(
|
|
2523
2360
|
Button,
|
|
2524
2361
|
{
|
|
2525
2362
|
variant: "ghost",
|
|
2526
2363
|
size: "sm",
|
|
2527
2364
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
2528
2365
|
className: editor.isActive("bulletList") ? "bg-accent" : "",
|
|
2529
|
-
children: /* @__PURE__ */
|
|
2366
|
+
children: /* @__PURE__ */ jsx22(List, { size: 15 })
|
|
2530
2367
|
}
|
|
2531
2368
|
),
|
|
2532
|
-
/* @__PURE__ */
|
|
2369
|
+
/* @__PURE__ */ jsx22(
|
|
2533
2370
|
Button,
|
|
2534
2371
|
{
|
|
2535
2372
|
variant: "ghost",
|
|
2536
2373
|
size: "sm",
|
|
2537
2374
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
2538
2375
|
className: editor.isActive("orderedList") ? "bg-accent" : "",
|
|
2539
|
-
children: /* @__PURE__ */
|
|
2376
|
+
children: /* @__PURE__ */ jsx22(ListOrdered, { size: 15 })
|
|
2540
2377
|
}
|
|
2541
2378
|
),
|
|
2542
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ jsx22(
|
|
2543
2380
|
Button,
|
|
2544
2381
|
{
|
|
2545
2382
|
variant: "ghost",
|
|
2546
2383
|
size: "sm",
|
|
2547
2384
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
2548
2385
|
className: editor.isActive("taskList") ? "bg-accent" : "",
|
|
2549
|
-
children: /* @__PURE__ */
|
|
2386
|
+
children: /* @__PURE__ */ jsx22(CheckSquare, { size: 15 })
|
|
2550
2387
|
}
|
|
2551
2388
|
),
|
|
2552
|
-
/* @__PURE__ */
|
|
2553
|
-
/* @__PURE__ */
|
|
2389
|
+
/* @__PURE__ */ jsx22(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2390
|
+
/* @__PURE__ */ jsx22(
|
|
2554
2391
|
Button,
|
|
2555
2392
|
{
|
|
2556
2393
|
variant: "ghost",
|
|
2557
2394
|
size: "sm",
|
|
2558
2395
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
2559
2396
|
className: editor.isActive("codeBlock") ? "bg-accent" : "",
|
|
2560
|
-
children: /* @__PURE__ */
|
|
2397
|
+
children: /* @__PURE__ */ jsx22(Code, { size: 15 })
|
|
2561
2398
|
}
|
|
2562
2399
|
)
|
|
2563
2400
|
]
|
|
@@ -2572,14 +2409,14 @@ import { mergeAttributes as mergeAttributes2, Node as Node4 } from "@tiptap/reac
|
|
|
2572
2409
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
2573
2410
|
|
|
2574
2411
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2575
|
-
import { useRef as
|
|
2412
|
+
import { useRef as useRef4, useState as useState11 } from "react";
|
|
2576
2413
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
2577
2414
|
|
|
2578
2415
|
// src/components/tiptap-icons/close-icon.tsx
|
|
2579
|
-
import { memo as
|
|
2580
|
-
import { jsx as
|
|
2581
|
-
var CloseIcon =
|
|
2582
|
-
return /* @__PURE__ */
|
|
2416
|
+
import { memo as memo6 } from "react";
|
|
2417
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
2418
|
+
var CloseIcon = memo6(({ className, ...props }) => {
|
|
2419
|
+
return /* @__PURE__ */ jsx23(
|
|
2583
2420
|
"svg",
|
|
2584
2421
|
{
|
|
2585
2422
|
width: "24",
|
|
@@ -2589,7 +2426,7 @@ var CloseIcon = memo2(({ className, ...props }) => {
|
|
|
2589
2426
|
fill: "currentColor",
|
|
2590
2427
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2591
2428
|
...props,
|
|
2592
|
-
children: /* @__PURE__ */
|
|
2429
|
+
children: /* @__PURE__ */ jsx23(
|
|
2593
2430
|
"path",
|
|
2594
2431
|
{
|
|
2595
2432
|
d: "M18.7071 6.70711C19.0976 6.31658 19.0976 5.68342 18.7071 5.29289C18.3166 4.90237 17.6834 4.90237 17.2929 5.29289L12 10.5858L6.70711 5.29289C6.31658 4.90237 5.68342 4.90237 5.29289 5.29289C4.90237 5.68342 4.90237 6.31658 5.29289 6.70711L10.5858 12L5.29289 17.2929C4.90237 17.6834 4.90237 18.3166 5.29289 18.7071C5.68342 19.0976 6.31658 19.0976 6.70711 18.7071L12 13.4142L17.2929 18.7071C17.6834 19.0976 18.3166 19.0976 18.7071 18.7071C19.0976 18.3166 19.0976 17.6834 18.7071 17.2929L13.4142 12L18.7071 6.70711Z",
|
|
@@ -2602,9 +2439,9 @@ var CloseIcon = memo2(({ className, ...props }) => {
|
|
|
2602
2439
|
CloseIcon.displayName = "CloseIcon";
|
|
2603
2440
|
|
|
2604
2441
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2605
|
-
import { Fragment as
|
|
2442
|
+
import { Fragment as Fragment3, jsx as jsx24, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2606
2443
|
function useFileUpload(options) {
|
|
2607
|
-
const [fileItems, setFileItems] =
|
|
2444
|
+
const [fileItems, setFileItems] = useState11([]);
|
|
2608
2445
|
const uploadFile = async (file) => {
|
|
2609
2446
|
if (file.size > options.maxSize) {
|
|
2610
2447
|
const error = new Error(
|
|
@@ -2710,7 +2547,7 @@ function useFileUpload(options) {
|
|
|
2710
2547
|
clearAllFiles
|
|
2711
2548
|
};
|
|
2712
2549
|
}
|
|
2713
|
-
var CloudUploadIcon = () => /* @__PURE__ */
|
|
2550
|
+
var CloudUploadIcon = () => /* @__PURE__ */ jsxs11(
|
|
2714
2551
|
"svg",
|
|
2715
2552
|
{
|
|
2716
2553
|
width: "24",
|
|
@@ -2720,14 +2557,14 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs9(
|
|
|
2720
2557
|
fill: "currentColor",
|
|
2721
2558
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2722
2559
|
children: [
|
|
2723
|
-
/* @__PURE__ */
|
|
2560
|
+
/* @__PURE__ */ jsx24(
|
|
2724
2561
|
"path",
|
|
2725
2562
|
{
|
|
2726
2563
|
d: "M11.1953 4.41771C10.3478 4.08499 9.43578 3.94949 8.5282 4.02147C7.62062 4.09345 6.74133 4.37102 5.95691 4.83316C5.1725 5.2953 4.50354 5.92989 4.00071 6.68886C3.49788 7.44783 3.17436 8.31128 3.05465 9.2138C2.93495 10.1163 3.0222 11.0343 3.3098 11.8981C3.5974 12.7619 4.07781 13.5489 4.71463 14.1995C5.10094 14.5942 5.09414 15.2274 4.69945 15.6137C4.30476 16 3.67163 15.9932 3.28532 15.5985C2.43622 14.731 1.79568 13.6816 1.41221 12.5299C1.02875 11.3781 0.91241 10.1542 1.07201 8.95084C1.23162 7.74748 1.66298 6.59621 2.33343 5.58425C3.00387 4.57229 3.89581 3.72617 4.9417 3.10998C5.98758 2.4938 7.15998 2.1237 8.37008 2.02773C9.58018 1.93176 10.7963 2.11243 11.9262 2.55605C13.0561 2.99968 14.0703 3.69462 14.8919 4.58825C15.5423 5.29573 16.0585 6.11304 16.4177 7.00002H17.4999C18.6799 6.99991 19.8288 7.37933 20.7766 8.08222C21.7245 8.78515 22.4212 9.7743 22.7637 10.9036C23.1062 12.0328 23.0765 13.2423 22.6788 14.3534C22.2812 15.4644 21.5367 16.4181 20.5554 17.0736C20.0962 17.3803 19.4752 17.2567 19.1684 16.7975C18.8617 16.3382 18.9853 15.7172 19.4445 15.4105C20.069 14.9934 20.5427 14.3865 20.7958 13.6794C21.0488 12.9724 21.0678 12.2027 20.8498 11.4841C20.6318 10.7655 20.1885 10.136 19.5853 9.6887C18.9821 9.24138 18.251 8.99993 17.5001 9.00002H15.71C15.2679 9.00002 14.8783 8.70973 14.7518 8.28611C14.4913 7.41374 14.0357 6.61208 13.4195 5.94186C12.8034 5.27164 12.0427 4.75043 11.1953 4.41771Z",
|
|
2727
2564
|
fill: "currentColor"
|
|
2728
2565
|
}
|
|
2729
2566
|
),
|
|
2730
|
-
/* @__PURE__ */
|
|
2567
|
+
/* @__PURE__ */ jsx24(
|
|
2731
2568
|
"path",
|
|
2732
2569
|
{
|
|
2733
2570
|
d: "M11 14.4142V21C11 21.5523 11.4477 22 12 22C12.5523 22 13 21.5523 13 21V14.4142L15.2929 16.7071C15.6834 17.0976 16.3166 17.0976 16.7071 16.7071C17.0976 16.3166 17.0976 15.6834 16.7071 15.2929L12.7078 11.2936C12.7054 11.2912 12.703 11.2888 12.7005 11.2864C12.5208 11.1099 12.2746 11.0008 12.003 11L12 11L11.997 11C11.8625 11.0004 11.7343 11.0273 11.6172 11.0759C11.502 11.1236 11.3938 11.1937 11.2995 11.2864C11.297 11.2888 11.2946 11.2912 11.2922 11.2936L7.29289 15.2929C6.90237 15.6834 6.90237 16.3166 7.29289 16.7071C7.68342 17.0976 8.31658 17.0976 8.70711 16.7071L11 14.4142Z",
|
|
@@ -2737,7 +2574,7 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs9(
|
|
|
2737
2574
|
]
|
|
2738
2575
|
}
|
|
2739
2576
|
);
|
|
2740
|
-
var FileIcon = () => /* @__PURE__ */
|
|
2577
|
+
var FileIcon = () => /* @__PURE__ */ jsx24(
|
|
2741
2578
|
"svg",
|
|
2742
2579
|
{
|
|
2743
2580
|
width: "43",
|
|
@@ -2746,7 +2583,7 @@ var FileIcon = () => /* @__PURE__ */ jsx22(
|
|
|
2746
2583
|
fill: "currentColor",
|
|
2747
2584
|
className: "tiptap-image-upload-dropzone-rect-primary",
|
|
2748
2585
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2749
|
-
children: /* @__PURE__ */
|
|
2586
|
+
children: /* @__PURE__ */ jsx24(
|
|
2750
2587
|
"path",
|
|
2751
2588
|
{
|
|
2752
2589
|
d: "M0.75 10.75C0.75 5.64137 4.89137 1.5 10 1.5H32.3431C33.2051 1.5 34.0317 1.84241 34.6412 2.4519L40.2981 8.10876C40.9076 8.71825 41.25 9.5449 41.25 10.4069V46.75C41.25 51.8586 37.1086 56 32 56H10C4.89137 56 0.75 51.8586 0.75 46.75V10.75Z",
|
|
@@ -2758,7 +2595,7 @@ var FileIcon = () => /* @__PURE__ */ jsx22(
|
|
|
2758
2595
|
)
|
|
2759
2596
|
}
|
|
2760
2597
|
);
|
|
2761
|
-
var FileCornerIcon = () => /* @__PURE__ */
|
|
2598
|
+
var FileCornerIcon = () => /* @__PURE__ */ jsx24(
|
|
2762
2599
|
"svg",
|
|
2763
2600
|
{
|
|
2764
2601
|
width: "10",
|
|
@@ -2767,7 +2604,7 @@ var FileCornerIcon = () => /* @__PURE__ */ jsx22(
|
|
|
2767
2604
|
viewBox: "0 0 10 10",
|
|
2768
2605
|
fill: "currentColor",
|
|
2769
2606
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2770
|
-
children: /* @__PURE__ */
|
|
2607
|
+
children: /* @__PURE__ */ jsx24(
|
|
2771
2608
|
"path",
|
|
2772
2609
|
{
|
|
2773
2610
|
d: "M0 0.75H0.343146C1.40401 0.75 2.42143 1.17143 3.17157 1.92157L8.82843 7.57843C9.57857 8.32857 10 9.34599 10 10.4069V10.75H4C1.79086 10.75 0 8.95914 0 6.75V0.75Z",
|
|
@@ -2780,8 +2617,8 @@ var ImageUploadDragArea = ({
|
|
|
2780
2617
|
onFile,
|
|
2781
2618
|
children
|
|
2782
2619
|
}) => {
|
|
2783
|
-
const [isDragOver, setIsDragOver] =
|
|
2784
|
-
const [isDragActive, setIsDragActive] =
|
|
2620
|
+
const [isDragOver, setIsDragOver] = useState11(false);
|
|
2621
|
+
const [isDragActive, setIsDragActive] = useState11(false);
|
|
2785
2622
|
const handleDragEnter = (e) => {
|
|
2786
2623
|
e.preventDefault();
|
|
2787
2624
|
e.stopPropagation();
|
|
@@ -2810,7 +2647,7 @@ var ImageUploadDragArea = ({
|
|
|
2810
2647
|
onFile(files);
|
|
2811
2648
|
}
|
|
2812
2649
|
};
|
|
2813
|
-
return /* @__PURE__ */
|
|
2650
|
+
return /* @__PURE__ */ jsx24(
|
|
2814
2651
|
"div",
|
|
2815
2652
|
{
|
|
2816
2653
|
className: `tiptap-image-upload-drag-area ${isDragActive ? "drag-active" : ""} ${isDragOver ? "drag-over" : ""}`,
|
|
@@ -2833,28 +2670,28 @@ var ImageUploadPreview = ({
|
|
|
2833
2670
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2834
2671
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
2835
2672
|
};
|
|
2836
|
-
return /* @__PURE__ */
|
|
2837
|
-
fileItem.status === "uploading" && /* @__PURE__ */
|
|
2673
|
+
return /* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-preview", children: [
|
|
2674
|
+
fileItem.status === "uploading" && /* @__PURE__ */ jsx24(
|
|
2838
2675
|
"div",
|
|
2839
2676
|
{
|
|
2840
2677
|
className: "tiptap-image-upload-progress",
|
|
2841
2678
|
style: { width: `${fileItem.progress}%` }
|
|
2842
2679
|
}
|
|
2843
2680
|
),
|
|
2844
|
-
/* @__PURE__ */
|
|
2845
|
-
/* @__PURE__ */
|
|
2846
|
-
/* @__PURE__ */
|
|
2847
|
-
/* @__PURE__ */
|
|
2848
|
-
/* @__PURE__ */
|
|
2849
|
-
/* @__PURE__ */
|
|
2681
|
+
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-preview-content", children: [
|
|
2682
|
+
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-file-info", children: [
|
|
2683
|
+
/* @__PURE__ */ jsx24("div", { className: "tiptap-image-upload-file-icon", children: /* @__PURE__ */ jsx24(CloudUploadIcon, {}) }),
|
|
2684
|
+
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-details", children: [
|
|
2685
|
+
/* @__PURE__ */ jsx24("span", { className: "tiptap-image-upload-text", children: fileItem.file.name }),
|
|
2686
|
+
/* @__PURE__ */ jsx24("span", { className: "tiptap-image-upload-subtext", children: formatFileSize(fileItem.file.size) })
|
|
2850
2687
|
] })
|
|
2851
2688
|
] }),
|
|
2852
|
-
/* @__PURE__ */
|
|
2853
|
-
fileItem.status === "uploading" && /* @__PURE__ */
|
|
2689
|
+
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-actions", children: [
|
|
2690
|
+
fileItem.status === "uploading" && /* @__PURE__ */ jsxs11("span", { className: "tiptap-image-upload-progress-text", children: [
|
|
2854
2691
|
fileItem.progress,
|
|
2855
2692
|
"%"
|
|
2856
2693
|
] }),
|
|
2857
|
-
/* @__PURE__ */
|
|
2694
|
+
/* @__PURE__ */ jsx24(
|
|
2858
2695
|
Button2,
|
|
2859
2696
|
{
|
|
2860
2697
|
type: "button",
|
|
@@ -2863,7 +2700,7 @@ var ImageUploadPreview = ({
|
|
|
2863
2700
|
e.stopPropagation();
|
|
2864
2701
|
onRemove();
|
|
2865
2702
|
},
|
|
2866
|
-
children: /* @__PURE__ */
|
|
2703
|
+
children: /* @__PURE__ */ jsx24(CloseIcon, { className: "tiptap-button-icon" })
|
|
2867
2704
|
}
|
|
2868
2705
|
)
|
|
2869
2706
|
] })
|
|
@@ -2873,18 +2710,18 @@ var ImageUploadPreview = ({
|
|
|
2873
2710
|
var DropZoneContent = ({
|
|
2874
2711
|
maxSize,
|
|
2875
2712
|
limit
|
|
2876
|
-
}) => /* @__PURE__ */
|
|
2877
|
-
/* @__PURE__ */
|
|
2878
|
-
/* @__PURE__ */
|
|
2879
|
-
/* @__PURE__ */
|
|
2880
|
-
/* @__PURE__ */
|
|
2713
|
+
}) => /* @__PURE__ */ jsxs11(Fragment3, { children: [
|
|
2714
|
+
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-dropzone", children: [
|
|
2715
|
+
/* @__PURE__ */ jsx24(FileIcon, {}),
|
|
2716
|
+
/* @__PURE__ */ jsx24(FileCornerIcon, {}),
|
|
2717
|
+
/* @__PURE__ */ jsx24("div", { className: "tiptap-image-upload-icon-container", children: /* @__PURE__ */ jsx24(CloudUploadIcon, {}) })
|
|
2881
2718
|
] }),
|
|
2882
|
-
/* @__PURE__ */
|
|
2883
|
-
/* @__PURE__ */
|
|
2884
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-content", children: [
|
|
2720
|
+
/* @__PURE__ */ jsxs11("span", { className: "tiptap-image-upload-text", children: [
|
|
2721
|
+
/* @__PURE__ */ jsx24("em", { children: "Click to upload" }),
|
|
2885
2722
|
" or drag and drop"
|
|
2886
2723
|
] }),
|
|
2887
|
-
/* @__PURE__ */
|
|
2724
|
+
/* @__PURE__ */ jsxs11("span", { className: "tiptap-image-upload-subtext", children: [
|
|
2888
2725
|
"Maximum ",
|
|
2889
2726
|
limit,
|
|
2890
2727
|
" file",
|
|
@@ -2897,7 +2734,7 @@ var DropZoneContent = ({
|
|
|
2897
2734
|
] });
|
|
2898
2735
|
var ImageUploadNode = (props) => {
|
|
2899
2736
|
const { accept, limit, maxSize } = props.node.attrs;
|
|
2900
|
-
const inputRef =
|
|
2737
|
+
const inputRef = useRef4(null);
|
|
2901
2738
|
const extension = props.extension;
|
|
2902
2739
|
const uploadOptions = {
|
|
2903
2740
|
maxSize,
|
|
@@ -2945,22 +2782,22 @@ var ImageUploadNode = (props) => {
|
|
|
2945
2782
|
}
|
|
2946
2783
|
};
|
|
2947
2784
|
const hasFiles = fileItems.length > 0;
|
|
2948
|
-
return /* @__PURE__ */
|
|
2785
|
+
return /* @__PURE__ */ jsxs11(
|
|
2949
2786
|
NodeViewWrapper,
|
|
2950
2787
|
{
|
|
2951
2788
|
className: "tiptap-image-upload",
|
|
2952
2789
|
tabIndex: 0,
|
|
2953
2790
|
onClick: handleClick,
|
|
2954
2791
|
children: [
|
|
2955
|
-
!hasFiles && /* @__PURE__ */
|
|
2956
|
-
hasFiles && /* @__PURE__ */
|
|
2957
|
-
fileItems.length > 1 && /* @__PURE__ */
|
|
2958
|
-
/* @__PURE__ */
|
|
2792
|
+
!hasFiles && /* @__PURE__ */ jsx24(ImageUploadDragArea, { onFile: handleUpload, children: /* @__PURE__ */ jsx24(DropZoneContent, { maxSize, limit }) }),
|
|
2793
|
+
hasFiles && /* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-previews", children: [
|
|
2794
|
+
fileItems.length > 1 && /* @__PURE__ */ jsxs11("div", { className: "tiptap-image-upload-header", children: [
|
|
2795
|
+
/* @__PURE__ */ jsxs11("span", { children: [
|
|
2959
2796
|
"Uploading ",
|
|
2960
2797
|
fileItems.length,
|
|
2961
2798
|
" files"
|
|
2962
2799
|
] }),
|
|
2963
|
-
/* @__PURE__ */
|
|
2800
|
+
/* @__PURE__ */ jsx24(
|
|
2964
2801
|
Button2,
|
|
2965
2802
|
{
|
|
2966
2803
|
type: "button",
|
|
@@ -2973,7 +2810,7 @@ var ImageUploadNode = (props) => {
|
|
|
2973
2810
|
}
|
|
2974
2811
|
)
|
|
2975
2812
|
] }),
|
|
2976
|
-
fileItems.map((fileItem) => /* @__PURE__ */
|
|
2813
|
+
fileItems.map((fileItem) => /* @__PURE__ */ jsx24(
|
|
2977
2814
|
ImageUploadPreview,
|
|
2978
2815
|
{
|
|
2979
2816
|
fileItem,
|
|
@@ -2982,7 +2819,7 @@ var ImageUploadNode = (props) => {
|
|
|
2982
2819
|
fileItem.id
|
|
2983
2820
|
))
|
|
2984
2821
|
] }),
|
|
2985
|
-
/* @__PURE__ */
|
|
2822
|
+
/* @__PURE__ */ jsx24(
|
|
2986
2823
|
"input",
|
|
2987
2824
|
{
|
|
2988
2825
|
ref: inputRef,
|
|
@@ -3091,13 +2928,13 @@ var HorizontalRule = TiptapHorizontalRule.extend({
|
|
|
3091
2928
|
});
|
|
3092
2929
|
|
|
3093
2930
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
3094
|
-
import { forwardRef as forwardRef9, useCallback as
|
|
2931
|
+
import { forwardRef as forwardRef9, useCallback as useCallback10, useState as useState13 } from "react";
|
|
3095
2932
|
|
|
3096
2933
|
// src/components/tiptap-icons/chevron-down-icon.tsx
|
|
3097
|
-
import { memo as
|
|
3098
|
-
import { jsx as
|
|
3099
|
-
var ChevronDownIcon =
|
|
3100
|
-
return /* @__PURE__ */
|
|
2934
|
+
import { memo as memo7 } from "react";
|
|
2935
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
2936
|
+
var ChevronDownIcon = memo7(({ className, ...props }) => {
|
|
2937
|
+
return /* @__PURE__ */ jsx25(
|
|
3101
2938
|
"svg",
|
|
3102
2939
|
{
|
|
3103
2940
|
width: "24",
|
|
@@ -3107,7 +2944,7 @@ var ChevronDownIcon = memo3(({ className, ...props }) => {
|
|
|
3107
2944
|
fill: "currentColor",
|
|
3108
2945
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3109
2946
|
...props,
|
|
3110
|
-
children: /* @__PURE__ */
|
|
2947
|
+
children: /* @__PURE__ */ jsx25(
|
|
3111
2948
|
"path",
|
|
3112
2949
|
{
|
|
3113
2950
|
fillRule: "evenodd",
|
|
@@ -3123,10 +2960,10 @@ ChevronDownIcon.displayName = "ChevronDownIcon";
|
|
|
3123
2960
|
|
|
3124
2961
|
// src/hooks/use-tiptap-editor.ts
|
|
3125
2962
|
import { useCurrentEditor as useCurrentEditor2, useEditorState } from "@tiptap/react";
|
|
3126
|
-
import { useMemo as
|
|
2963
|
+
import { useMemo as useMemo5 } from "react";
|
|
3127
2964
|
function useTiptapEditor(providedEditor) {
|
|
3128
2965
|
const { editor: coreEditor } = useCurrentEditor2();
|
|
3129
|
-
const mainEditor =
|
|
2966
|
+
const mainEditor = useMemo5(
|
|
3130
2967
|
() => providedEditor || coreEditor,
|
|
3131
2968
|
[providedEditor, coreEditor]
|
|
3132
2969
|
);
|
|
@@ -3151,11 +2988,11 @@ function useTiptapEditor(providedEditor) {
|
|
|
3151
2988
|
}
|
|
3152
2989
|
|
|
3153
2990
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
3154
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
2991
|
+
import { forwardRef as forwardRef6, useCallback as useCallback8 } from "react";
|
|
3155
2992
|
|
|
3156
2993
|
// src/components/tiptap-ui-primitive/badge/badge.tsx
|
|
3157
2994
|
import { forwardRef as forwardRef5 } from "react";
|
|
3158
|
-
import { jsx as
|
|
2995
|
+
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
3159
2996
|
var Badge = forwardRef5(
|
|
3160
2997
|
({
|
|
3161
2998
|
variant,
|
|
@@ -3166,7 +3003,7 @@ var Badge = forwardRef5(
|
|
|
3166
3003
|
children,
|
|
3167
3004
|
...props
|
|
3168
3005
|
}, ref) => {
|
|
3169
|
-
return /* @__PURE__ */
|
|
3006
|
+
return /* @__PURE__ */ jsx26(
|
|
3170
3007
|
"div",
|
|
3171
3008
|
{
|
|
3172
3009
|
ref,
|
|
@@ -3184,12 +3021,12 @@ var Badge = forwardRef5(
|
|
|
3184
3021
|
Badge.displayName = "Badge";
|
|
3185
3022
|
|
|
3186
3023
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
3187
|
-
import { Fragment as
|
|
3024
|
+
import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3188
3025
|
function HeadingShortcutBadge({
|
|
3189
3026
|
level,
|
|
3190
3027
|
shortcutKeys = HEADING_SHORTCUT_KEYS[level]
|
|
3191
3028
|
}) {
|
|
3192
|
-
return /* @__PURE__ */
|
|
3029
|
+
return /* @__PURE__ */ jsx27(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3193
3030
|
}
|
|
3194
3031
|
var HeadingButton = forwardRef6(
|
|
3195
3032
|
({
|
|
@@ -3218,7 +3055,7 @@ var HeadingButton = forwardRef6(
|
|
|
3218
3055
|
hideWhenUnavailable,
|
|
3219
3056
|
onToggled
|
|
3220
3057
|
});
|
|
3221
|
-
const handleClick =
|
|
3058
|
+
const handleClick = useCallback8(
|
|
3222
3059
|
(event) => {
|
|
3223
3060
|
onClick?.(event);
|
|
3224
3061
|
if (event.defaultPrevented) return;
|
|
@@ -3229,7 +3066,7 @@ var HeadingButton = forwardRef6(
|
|
|
3229
3066
|
if (!isVisible) {
|
|
3230
3067
|
return null;
|
|
3231
3068
|
}
|
|
3232
|
-
return /* @__PURE__ */
|
|
3069
|
+
return /* @__PURE__ */ jsx27(
|
|
3233
3070
|
Button2,
|
|
3234
3071
|
{
|
|
3235
3072
|
type: "button",
|
|
@@ -3245,10 +3082,10 @@ var HeadingButton = forwardRef6(
|
|
|
3245
3082
|
onClick: handleClick,
|
|
3246
3083
|
...buttonProps,
|
|
3247
3084
|
ref,
|
|
3248
|
-
children: children ?? /* @__PURE__ */
|
|
3249
|
-
/* @__PURE__ */
|
|
3250
|
-
text && /* @__PURE__ */
|
|
3251
|
-
showShortcut && /* @__PURE__ */
|
|
3085
|
+
children: children ?? /* @__PURE__ */ jsxs12(Fragment4, { children: [
|
|
3086
|
+
/* @__PURE__ */ jsx27(Icon, { className: "tiptap-button-icon" }),
|
|
3087
|
+
text && /* @__PURE__ */ jsx27("span", { className: "tiptap-button-text", children: text }),
|
|
3088
|
+
showShortcut && /* @__PURE__ */ jsx27(HeadingShortcutBadge, { level, shortcutKeys })
|
|
3252
3089
|
] })
|
|
3253
3090
|
}
|
|
3254
3091
|
);
|
|
@@ -3257,14 +3094,14 @@ var HeadingButton = forwardRef6(
|
|
|
3257
3094
|
HeadingButton.displayName = "HeadingButton";
|
|
3258
3095
|
|
|
3259
3096
|
// src/components/tiptap-ui/heading-button/use-heading.ts
|
|
3260
|
-
import { useCallback as
|
|
3097
|
+
import { useCallback as useCallback9, useEffect as useEffect5, useState as useState12 } from "react";
|
|
3261
3098
|
import { NodeSelection as NodeSelection2, TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
3262
3099
|
|
|
3263
3100
|
// src/components/tiptap-icons/heading-one-icon.tsx
|
|
3264
|
-
import { memo as
|
|
3265
|
-
import { jsx as
|
|
3266
|
-
var HeadingOneIcon =
|
|
3267
|
-
return /* @__PURE__ */
|
|
3101
|
+
import { memo as memo8 } from "react";
|
|
3102
|
+
import { jsx as jsx28, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3103
|
+
var HeadingOneIcon = memo8(({ className, ...props }) => {
|
|
3104
|
+
return /* @__PURE__ */ jsxs13(
|
|
3268
3105
|
"svg",
|
|
3269
3106
|
{
|
|
3270
3107
|
width: "24",
|
|
@@ -3275,14 +3112,14 @@ var HeadingOneIcon = memo4(({ className, ...props }) => {
|
|
|
3275
3112
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3276
3113
|
...props,
|
|
3277
3114
|
children: [
|
|
3278
|
-
/* @__PURE__ */
|
|
3115
|
+
/* @__PURE__ */ jsx28(
|
|
3279
3116
|
"path",
|
|
3280
3117
|
{
|
|
3281
3118
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3282
3119
|
fill: "currentColor"
|
|
3283
3120
|
}
|
|
3284
3121
|
),
|
|
3285
|
-
/* @__PURE__ */
|
|
3122
|
+
/* @__PURE__ */ jsx28(
|
|
3286
3123
|
"path",
|
|
3287
3124
|
{
|
|
3288
3125
|
d: "M21.0001 10C21.0001 9.63121 20.7971 9.29235 20.472 9.11833C20.1468 8.94431 19.7523 8.96338 19.4454 9.16795L16.4454 11.168C15.9859 11.4743 15.8617 12.0952 16.1681 12.5547C16.4744 13.0142 17.0953 13.1384 17.5548 12.8321L19.0001 11.8685V18C19.0001 18.5523 19.4478 19 20.0001 19C20.5524 19 21.0001 18.5523 21.0001 18V10Z",
|
|
@@ -3296,10 +3133,10 @@ var HeadingOneIcon = memo4(({ className, ...props }) => {
|
|
|
3296
3133
|
HeadingOneIcon.displayName = "HeadingOneIcon";
|
|
3297
3134
|
|
|
3298
3135
|
// src/components/tiptap-icons/heading-two-icon.tsx
|
|
3299
|
-
import { memo as
|
|
3300
|
-
import { jsx as
|
|
3301
|
-
var HeadingTwoIcon =
|
|
3302
|
-
return /* @__PURE__ */
|
|
3136
|
+
import { memo as memo9 } from "react";
|
|
3137
|
+
import { jsx as jsx29, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3138
|
+
var HeadingTwoIcon = memo9(({ className, ...props }) => {
|
|
3139
|
+
return /* @__PURE__ */ jsxs14(
|
|
3303
3140
|
"svg",
|
|
3304
3141
|
{
|
|
3305
3142
|
width: "24",
|
|
@@ -3310,14 +3147,14 @@ var HeadingTwoIcon = memo5(({ className, ...props }) => {
|
|
|
3310
3147
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3311
3148
|
...props,
|
|
3312
3149
|
children: [
|
|
3313
|
-
/* @__PURE__ */
|
|
3150
|
+
/* @__PURE__ */ jsx29(
|
|
3314
3151
|
"path",
|
|
3315
3152
|
{
|
|
3316
3153
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3317
3154
|
fill: "currentColor"
|
|
3318
3155
|
}
|
|
3319
3156
|
),
|
|
3320
|
-
/* @__PURE__ */
|
|
3157
|
+
/* @__PURE__ */ jsx29(
|
|
3321
3158
|
"path",
|
|
3322
3159
|
{
|
|
3323
3160
|
d: "M22.0001 12C22.0001 10.7611 21.1663 9.79297 20.0663 9.42632C18.9547 9.05578 17.6171 9.28724 16.4001 10.2C15.9582 10.5314 15.8687 11.1582 16.2001 11.6C16.5314 12.0418 17.1582 12.1314 17.6001 11.8C18.383 11.2128 19.0455 11.1942 19.4338 11.3237C19.8339 11.457 20.0001 11.7389 20.0001 12C20.0001 12.4839 19.8554 12.7379 19.6537 12.9481C19.4275 13.1837 19.1378 13.363 18.7055 13.6307C18.6313 13.6767 18.553 13.7252 18.4701 13.777C17.9572 14.0975 17.3128 14.5261 16.8163 15.2087C16.3007 15.9177 16.0001 16.8183 16.0001 18C16.0001 18.5523 16.4478 19 17.0001 19H21.0001C21.5523 19 22.0001 18.5523 22.0001 18C22.0001 17.4477 21.5523 17 21.0001 17H18.131C18.21 16.742 18.3176 16.5448 18.4338 16.385C18.6873 16.0364 19.0429 15.7775 19.5301 15.473C19.5898 15.4357 19.6536 15.3966 19.7205 15.3556C20.139 15.0992 20.6783 14.7687 21.0964 14.3332C21.6447 13.7621 22.0001 13.0161 22.0001 12Z",
|
|
@@ -3331,10 +3168,10 @@ var HeadingTwoIcon = memo5(({ className, ...props }) => {
|
|
|
3331
3168
|
HeadingTwoIcon.displayName = "HeadingTwoIcon";
|
|
3332
3169
|
|
|
3333
3170
|
// src/components/tiptap-icons/heading-three-icon.tsx
|
|
3334
|
-
import { memo as
|
|
3335
|
-
import { jsx as
|
|
3336
|
-
var HeadingThreeIcon =
|
|
3337
|
-
return /* @__PURE__ */
|
|
3171
|
+
import { memo as memo10 } from "react";
|
|
3172
|
+
import { jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3173
|
+
var HeadingThreeIcon = memo10(({ className, ...props }) => {
|
|
3174
|
+
return /* @__PURE__ */ jsxs15(
|
|
3338
3175
|
"svg",
|
|
3339
3176
|
{
|
|
3340
3177
|
width: "24",
|
|
@@ -3345,14 +3182,14 @@ var HeadingThreeIcon = memo6(({ className, ...props }) => {
|
|
|
3345
3182
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3346
3183
|
...props,
|
|
3347
3184
|
children: [
|
|
3348
|
-
/* @__PURE__ */
|
|
3185
|
+
/* @__PURE__ */ jsx30(
|
|
3349
3186
|
"path",
|
|
3350
3187
|
{
|
|
3351
3188
|
d: "M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",
|
|
3352
3189
|
fill: "currentColor"
|
|
3353
3190
|
}
|
|
3354
3191
|
),
|
|
3355
|
-
/* @__PURE__ */
|
|
3192
|
+
/* @__PURE__ */ jsx30(
|
|
3356
3193
|
"path",
|
|
3357
3194
|
{
|
|
3358
3195
|
fillRule: "evenodd",
|
|
@@ -3361,7 +3198,7 @@ var HeadingThreeIcon = memo6(({ className, ...props }) => {
|
|
|
3361
3198
|
fill: "currentColor"
|
|
3362
3199
|
}
|
|
3363
3200
|
),
|
|
3364
|
-
/* @__PURE__ */
|
|
3201
|
+
/* @__PURE__ */ jsx30(
|
|
3365
3202
|
"path",
|
|
3366
3203
|
{
|
|
3367
3204
|
fillRule: "evenodd",
|
|
@@ -3377,10 +3214,10 @@ var HeadingThreeIcon = memo6(({ className, ...props }) => {
|
|
|
3377
3214
|
HeadingThreeIcon.displayName = "HeadingThreeIcon";
|
|
3378
3215
|
|
|
3379
3216
|
// src/components/tiptap-icons/heading-four-icon.tsx
|
|
3380
|
-
import { memo as
|
|
3381
|
-
import { jsx as
|
|
3382
|
-
var HeadingFourIcon =
|
|
3383
|
-
return /* @__PURE__ */
|
|
3217
|
+
import { memo as memo11 } from "react";
|
|
3218
|
+
import { jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3219
|
+
var HeadingFourIcon = memo11(({ className, ...props }) => {
|
|
3220
|
+
return /* @__PURE__ */ jsxs16(
|
|
3384
3221
|
"svg",
|
|
3385
3222
|
{
|
|
3386
3223
|
width: "24",
|
|
@@ -3391,14 +3228,14 @@ var HeadingFourIcon = memo7(({ className, ...props }) => {
|
|
|
3391
3228
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3392
3229
|
...props,
|
|
3393
3230
|
children: [
|
|
3394
|
-
/* @__PURE__ */
|
|
3231
|
+
/* @__PURE__ */ jsx31(
|
|
3395
3232
|
"path",
|
|
3396
3233
|
{
|
|
3397
3234
|
d: "M4 5C4.55228 5 5 5.44772 5 6V11H11V6C11 5.44772 11.4477 5 12 5C12.5523 5 13 5.44772 13 6V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V13H5V18C5 18.5523 4.55228 19 4 19C3.44772 19 3 18.5523 3 18V6C3 5.44772 3.44772 5 4 5Z",
|
|
3398
3235
|
fill: "currentColor"
|
|
3399
3236
|
}
|
|
3400
3237
|
),
|
|
3401
|
-
/* @__PURE__ */
|
|
3238
|
+
/* @__PURE__ */ jsx31(
|
|
3402
3239
|
"path",
|
|
3403
3240
|
{
|
|
3404
3241
|
d: "M17 9C17.5523 9 18 9.44772 18 10V13H20V10C20 9.44772 20.4477 9 21 9C21.5523 9 22 9.44772 22 10V18C22 18.5523 21.5523 19 21 19C20.4477 19 20 18.5523 20 18V15H17C16.4477 15 16 14.5523 16 14V10C16 9.44772 16.4477 9 17 9Z",
|
|
@@ -3412,10 +3249,10 @@ var HeadingFourIcon = memo7(({ className, ...props }) => {
|
|
|
3412
3249
|
HeadingFourIcon.displayName = "HeadingFourIcon";
|
|
3413
3250
|
|
|
3414
3251
|
// src/components/tiptap-icons/heading-five-icon.tsx
|
|
3415
|
-
import { memo as
|
|
3416
|
-
import { jsx as
|
|
3417
|
-
var HeadingFiveIcon =
|
|
3418
|
-
return /* @__PURE__ */
|
|
3252
|
+
import { memo as memo12 } from "react";
|
|
3253
|
+
import { jsx as jsx32, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3254
|
+
var HeadingFiveIcon = memo12(({ className, ...props }) => {
|
|
3255
|
+
return /* @__PURE__ */ jsxs17(
|
|
3419
3256
|
"svg",
|
|
3420
3257
|
{
|
|
3421
3258
|
width: "24",
|
|
@@ -3426,14 +3263,14 @@ var HeadingFiveIcon = memo8(({ className, ...props }) => {
|
|
|
3426
3263
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3427
3264
|
...props,
|
|
3428
3265
|
children: [
|
|
3429
|
-
/* @__PURE__ */
|
|
3266
|
+
/* @__PURE__ */ jsx32(
|
|
3430
3267
|
"path",
|
|
3431
3268
|
{
|
|
3432
3269
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3433
3270
|
fill: "currentColor"
|
|
3434
3271
|
}
|
|
3435
3272
|
),
|
|
3436
|
-
/* @__PURE__ */
|
|
3273
|
+
/* @__PURE__ */ jsx32(
|
|
3437
3274
|
"path",
|
|
3438
3275
|
{
|
|
3439
3276
|
d: "M16 10C16 9.44772 16.4477 9 17 9H21C21.5523 9 22 9.44772 22 10C22 10.5523 21.5523 11 21 11H18V12H18.3C20.2754 12 22 13.4739 22 15.5C22 17.5261 20.2754 19 18.3 19C17.6457 19 17.0925 18.8643 16.5528 18.5944C16.0588 18.3474 15.8586 17.7468 16.1055 17.2528C16.3525 16.7588 16.9532 16.5586 17.4472 16.8056C17.7074 16.9357 17.9542 17 18.3 17C19.3246 17 20 16.2739 20 15.5C20 14.7261 19.3246 14 18.3 14H17C16.4477 14 16 13.5523 16 13L16 12.9928V10Z",
|
|
@@ -3447,10 +3284,10 @@ var HeadingFiveIcon = memo8(({ className, ...props }) => {
|
|
|
3447
3284
|
HeadingFiveIcon.displayName = "HeadingFiveIcon";
|
|
3448
3285
|
|
|
3449
3286
|
// src/components/tiptap-icons/heading-six-icon.tsx
|
|
3450
|
-
import { memo as
|
|
3451
|
-
import { jsx as
|
|
3452
|
-
var HeadingSixIcon =
|
|
3453
|
-
return /* @__PURE__ */
|
|
3287
|
+
import { memo as memo13 } from "react";
|
|
3288
|
+
import { jsx as jsx33, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3289
|
+
var HeadingSixIcon = memo13(({ className, ...props }) => {
|
|
3290
|
+
return /* @__PURE__ */ jsxs18(
|
|
3454
3291
|
"svg",
|
|
3455
3292
|
{
|
|
3456
3293
|
width: "24",
|
|
@@ -3461,14 +3298,14 @@ var HeadingSixIcon = memo9(({ className, ...props }) => {
|
|
|
3461
3298
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3462
3299
|
...props,
|
|
3463
3300
|
children: [
|
|
3464
|
-
/* @__PURE__ */
|
|
3301
|
+
/* @__PURE__ */ jsx33(
|
|
3465
3302
|
"path",
|
|
3466
3303
|
{
|
|
3467
3304
|
d: "M5 6C5 5.44772 4.55228 5 4 5C3.44772 5 3 5.44772 3 6V18C3 18.5523 3.44772 19 4 19C4.55228 19 5 18.5523 5 18V13H11V18C11 18.5523 11.4477 19 12 19C12.5523 19 13 18.5523 13 18V6C13 5.44772 12.5523 5 12 5C11.4477 5 11 5.44772 11 6V11H5V6Z",
|
|
3468
3305
|
fill: "currentColor"
|
|
3469
3306
|
}
|
|
3470
3307
|
),
|
|
3471
|
-
/* @__PURE__ */
|
|
3308
|
+
/* @__PURE__ */ jsx33(
|
|
3472
3309
|
"path",
|
|
3473
3310
|
{
|
|
3474
3311
|
fillRule: "evenodd",
|
|
@@ -3587,7 +3424,7 @@ function useHeading(config) {
|
|
|
3587
3424
|
onToggled
|
|
3588
3425
|
} = config;
|
|
3589
3426
|
const { editor } = useTiptapEditor(providedEditor);
|
|
3590
|
-
const [isVisible, setIsVisible] =
|
|
3427
|
+
const [isVisible, setIsVisible] = useState12(true);
|
|
3591
3428
|
const canToggleState = canToggle(editor, level);
|
|
3592
3429
|
const isActive = isHeadingActive(editor, level);
|
|
3593
3430
|
useEffect5(() => {
|
|
@@ -3601,7 +3438,7 @@ function useHeading(config) {
|
|
|
3601
3438
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
3602
3439
|
};
|
|
3603
3440
|
}, [editor, level, hideWhenUnavailable]);
|
|
3604
|
-
const handleToggle =
|
|
3441
|
+
const handleToggle = useCallback9(() => {
|
|
3605
3442
|
if (!editor) return false;
|
|
3606
3443
|
const success = toggleHeading(editor, level);
|
|
3607
3444
|
if (success) {
|
|
@@ -3622,36 +3459,36 @@ function useHeading(config) {
|
|
|
3622
3459
|
|
|
3623
3460
|
// src/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx
|
|
3624
3461
|
import { forwardRef as forwardRef7 } from "react";
|
|
3625
|
-
import * as
|
|
3626
|
-
import { jsx as
|
|
3627
|
-
function
|
|
3462
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
3463
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
3464
|
+
function DropdownMenu({
|
|
3628
3465
|
...props
|
|
3629
3466
|
}) {
|
|
3630
|
-
return /* @__PURE__ */
|
|
3467
|
+
return /* @__PURE__ */ jsx34(DropdownMenuPrimitive.Root, { modal: false, ...props });
|
|
3631
3468
|
}
|
|
3632
3469
|
function DropdownMenuPortal({
|
|
3633
3470
|
...props
|
|
3634
3471
|
}) {
|
|
3635
|
-
return /* @__PURE__ */
|
|
3472
|
+
return /* @__PURE__ */ jsx34(DropdownMenuPrimitive.Portal, { ...props });
|
|
3636
3473
|
}
|
|
3637
|
-
var
|
|
3638
|
-
|
|
3639
|
-
var
|
|
3474
|
+
var DropdownMenuTrigger = forwardRef7(({ ...props }, ref) => /* @__PURE__ */ jsx34(DropdownMenuPrimitive.Trigger, { ref, ...props }));
|
|
3475
|
+
DropdownMenuTrigger.displayName = DropdownMenuPrimitive.Trigger.displayName;
|
|
3476
|
+
var DropdownMenuItem = DropdownMenuPrimitive.Item;
|
|
3640
3477
|
var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }, ref) => {
|
|
3641
|
-
const content = /* @__PURE__ */
|
|
3642
|
-
|
|
3478
|
+
const content = /* @__PURE__ */ jsx34(
|
|
3479
|
+
DropdownMenuPrimitive.SubContent,
|
|
3643
3480
|
{
|
|
3644
3481
|
ref,
|
|
3645
3482
|
className: cn2("tiptap-dropdown-menu", className),
|
|
3646
3483
|
...props
|
|
3647
3484
|
}
|
|
3648
3485
|
);
|
|
3649
|
-
return portal ? /* @__PURE__ */
|
|
3486
|
+
return portal ? /* @__PURE__ */ jsx34(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3650
3487
|
});
|
|
3651
|
-
DropdownMenuSubContent.displayName =
|
|
3652
|
-
var
|
|
3653
|
-
const content = /* @__PURE__ */
|
|
3654
|
-
|
|
3488
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
3489
|
+
var DropdownMenuContent = forwardRef7(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
3490
|
+
const content = /* @__PURE__ */ jsx34(
|
|
3491
|
+
DropdownMenuPrimitive.Content,
|
|
3655
3492
|
{
|
|
3656
3493
|
ref,
|
|
3657
3494
|
sideOffset,
|
|
@@ -3660,22 +3497,22 @@ var DropdownMenuContent2 = forwardRef7(({ className, sideOffset = 4, portal = fa
|
|
|
3660
3497
|
...props
|
|
3661
3498
|
}
|
|
3662
3499
|
);
|
|
3663
|
-
return portal ? /* @__PURE__ */
|
|
3500
|
+
return portal ? /* @__PURE__ */ jsx34(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3664
3501
|
});
|
|
3665
|
-
|
|
3502
|
+
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
3666
3503
|
|
|
3667
3504
|
// src/components/tiptap-ui-primitive/card/card.tsx
|
|
3668
3505
|
import { forwardRef as forwardRef8 } from "react";
|
|
3669
|
-
import { jsx as
|
|
3506
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3670
3507
|
var Card = forwardRef8(
|
|
3671
3508
|
({ className, ...props }, ref) => {
|
|
3672
|
-
return /* @__PURE__ */
|
|
3509
|
+
return /* @__PURE__ */ jsx35("div", { ref, className: cn2("tiptap-card", className), ...props });
|
|
3673
3510
|
}
|
|
3674
3511
|
);
|
|
3675
3512
|
Card.displayName = "Card";
|
|
3676
3513
|
var CardHeader = forwardRef8(
|
|
3677
3514
|
({ className, ...props }, ref) => {
|
|
3678
|
-
return /* @__PURE__ */
|
|
3515
|
+
return /* @__PURE__ */ jsx35(
|
|
3679
3516
|
"div",
|
|
3680
3517
|
{
|
|
3681
3518
|
ref,
|
|
@@ -3688,12 +3525,12 @@ var CardHeader = forwardRef8(
|
|
|
3688
3525
|
CardHeader.displayName = "CardHeader";
|
|
3689
3526
|
var CardBody = forwardRef8(
|
|
3690
3527
|
({ className, ...props }, ref) => {
|
|
3691
|
-
return /* @__PURE__ */
|
|
3528
|
+
return /* @__PURE__ */ jsx35("div", { ref, className: cn2("tiptap-card-body", className), ...props });
|
|
3692
3529
|
}
|
|
3693
3530
|
);
|
|
3694
3531
|
CardBody.displayName = "CardBody";
|
|
3695
3532
|
var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props }, ref) => {
|
|
3696
|
-
return /* @__PURE__ */
|
|
3533
|
+
return /* @__PURE__ */ jsx35(
|
|
3697
3534
|
"div",
|
|
3698
3535
|
{
|
|
3699
3536
|
ref,
|
|
@@ -3706,7 +3543,7 @@ var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props
|
|
|
3706
3543
|
CardItemGroup.displayName = "CardItemGroup";
|
|
3707
3544
|
var CardGroupLabel = forwardRef8(
|
|
3708
3545
|
({ className, ...props }, ref) => {
|
|
3709
|
-
return /* @__PURE__ */
|
|
3546
|
+
return /* @__PURE__ */ jsx35(
|
|
3710
3547
|
"div",
|
|
3711
3548
|
{
|
|
3712
3549
|
ref,
|
|
@@ -3719,7 +3556,7 @@ var CardGroupLabel = forwardRef8(
|
|
|
3719
3556
|
CardGroupLabel.displayName = "CardGroupLabel";
|
|
3720
3557
|
var CardFooter = forwardRef8(
|
|
3721
3558
|
({ className, ...props }, ref) => {
|
|
3722
|
-
return /* @__PURE__ */
|
|
3559
|
+
return /* @__PURE__ */ jsx35(
|
|
3723
3560
|
"div",
|
|
3724
3561
|
{
|
|
3725
3562
|
ref,
|
|
@@ -3732,7 +3569,7 @@ var CardFooter = forwardRef8(
|
|
|
3732
3569
|
CardFooter.displayName = "CardFooter";
|
|
3733
3570
|
|
|
3734
3571
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
3735
|
-
import { jsx as
|
|
3572
|
+
import { jsx as jsx36, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3736
3573
|
var HeadingDropdownMenu = forwardRef9(
|
|
3737
3574
|
({
|
|
3738
3575
|
editor: providedEditor,
|
|
@@ -3743,13 +3580,13 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3743
3580
|
...buttonProps
|
|
3744
3581
|
}, ref) => {
|
|
3745
3582
|
const { editor } = useTiptapEditor(providedEditor);
|
|
3746
|
-
const [isOpen, setIsOpen] =
|
|
3583
|
+
const [isOpen, setIsOpen] = useState13(false);
|
|
3747
3584
|
const { isVisible, isActive, canToggle: canToggle2, Icon } = useHeadingDropdownMenu({
|
|
3748
3585
|
editor,
|
|
3749
3586
|
levels,
|
|
3750
3587
|
hideWhenUnavailable
|
|
3751
3588
|
});
|
|
3752
|
-
const handleOpenChange =
|
|
3589
|
+
const handleOpenChange = useCallback10(
|
|
3753
3590
|
(open) => {
|
|
3754
3591
|
if (!editor || !canToggle2) return;
|
|
3755
3592
|
setIsOpen(open);
|
|
@@ -3760,8 +3597,8 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3760
3597
|
if (!isVisible) {
|
|
3761
3598
|
return null;
|
|
3762
3599
|
}
|
|
3763
|
-
return /* @__PURE__ */
|
|
3764
|
-
/* @__PURE__ */
|
|
3600
|
+
return /* @__PURE__ */ jsxs19(DropdownMenu, { modal: true, open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
3601
|
+
/* @__PURE__ */ jsx36(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs19(
|
|
3765
3602
|
Button2,
|
|
3766
3603
|
{
|
|
3767
3604
|
type: "button",
|
|
@@ -3777,12 +3614,12 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3777
3614
|
...buttonProps,
|
|
3778
3615
|
ref,
|
|
3779
3616
|
children: [
|
|
3780
|
-
/* @__PURE__ */
|
|
3781
|
-
/* @__PURE__ */
|
|
3617
|
+
/* @__PURE__ */ jsx36(Icon, { className: "tiptap-button-icon" }),
|
|
3618
|
+
/* @__PURE__ */ jsx36(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
3782
3619
|
]
|
|
3783
3620
|
}
|
|
3784
3621
|
) }),
|
|
3785
|
-
/* @__PURE__ */
|
|
3622
|
+
/* @__PURE__ */ jsx36(DropdownMenuContent, { align: "start", portal, children: /* @__PURE__ */ jsx36(Card, { children: /* @__PURE__ */ jsx36(CardBody, { children: /* @__PURE__ */ jsx36(ButtonGroup, { children: levels.map((level) => /* @__PURE__ */ jsx36(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx36(
|
|
3786
3623
|
HeadingButton,
|
|
3787
3624
|
{
|
|
3788
3625
|
editor,
|
|
@@ -3797,13 +3634,13 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3797
3634
|
HeadingDropdownMenu.displayName = "HeadingDropdownMenu";
|
|
3798
3635
|
|
|
3799
3636
|
// src/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.ts
|
|
3800
|
-
import { useEffect as useEffect6, useState as
|
|
3637
|
+
import { useEffect as useEffect6, useState as useState14 } from "react";
|
|
3801
3638
|
|
|
3802
3639
|
// src/components/tiptap-icons/heading-icon.tsx
|
|
3803
|
-
import { memo as
|
|
3804
|
-
import { jsx as
|
|
3805
|
-
var HeadingIcon =
|
|
3806
|
-
return /* @__PURE__ */
|
|
3640
|
+
import { memo as memo14 } from "react";
|
|
3641
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3642
|
+
var HeadingIcon = memo14(({ className, ...props }) => {
|
|
3643
|
+
return /* @__PURE__ */ jsx37(
|
|
3807
3644
|
"svg",
|
|
3808
3645
|
{
|
|
3809
3646
|
width: "24",
|
|
@@ -3813,7 +3650,7 @@ var HeadingIcon = memo10(({ className, ...props }) => {
|
|
|
3813
3650
|
fill: "currentColor",
|
|
3814
3651
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3815
3652
|
...props,
|
|
3816
|
-
children: /* @__PURE__ */
|
|
3653
|
+
children: /* @__PURE__ */ jsx37(
|
|
3817
3654
|
"path",
|
|
3818
3655
|
{
|
|
3819
3656
|
d: "M6 3C6.55228 3 7 3.44772 7 4V11H17V4C17 3.44772 17.4477 3 18 3C18.5523 3 19 3.44772 19 4V20C19 20.5523 18.5523 21 18 21C17.4477 21 17 20.5523 17 20V13H7V20C7 20.5523 6.55228 21 6 21C5.44772 21 5 20.5523 5 20V4C5 3.44772 5.44772 3 6 3Z",
|
|
@@ -3837,7 +3674,7 @@ function useHeadingDropdownMenu(config) {
|
|
|
3837
3674
|
hideWhenUnavailable = false
|
|
3838
3675
|
} = config || {};
|
|
3839
3676
|
const { editor } = useTiptapEditor(providedEditor);
|
|
3840
|
-
const [isVisible, setIsVisible] =
|
|
3677
|
+
const [isVisible, setIsVisible] = useState14(true);
|
|
3841
3678
|
const activeLevel = getActiveHeadingLevel(editor, levels);
|
|
3842
3679
|
const isActive = isHeadingActive(editor);
|
|
3843
3680
|
const canToggleState = canToggle(editor);
|
|
@@ -3866,12 +3703,12 @@ function useHeadingDropdownMenu(config) {
|
|
|
3866
3703
|
}
|
|
3867
3704
|
|
|
3868
3705
|
// src/components/tiptap-ui/image-upload-button/image-upload-button.tsx
|
|
3869
|
-
import { forwardRef as forwardRef10, useCallback as
|
|
3870
|
-
import { Fragment as
|
|
3706
|
+
import { forwardRef as forwardRef10, useCallback as useCallback11 } from "react";
|
|
3707
|
+
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
3871
3708
|
function ImageShortcutBadge({
|
|
3872
3709
|
shortcutKeys = IMAGE_UPLOAD_SHORTCUT_KEY
|
|
3873
3710
|
}) {
|
|
3874
|
-
return /* @__PURE__ */
|
|
3711
|
+
return /* @__PURE__ */ jsx38(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3875
3712
|
}
|
|
3876
3713
|
var ImageUploadButton = forwardRef10(
|
|
3877
3714
|
({
|
|
@@ -3899,7 +3736,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3899
3736
|
hideWhenUnavailable,
|
|
3900
3737
|
onInserted
|
|
3901
3738
|
});
|
|
3902
|
-
const handleClick =
|
|
3739
|
+
const handleClick = useCallback11(
|
|
3903
3740
|
async (event) => {
|
|
3904
3741
|
onClick?.(event);
|
|
3905
3742
|
if (event.defaultPrevented) return;
|
|
@@ -3911,7 +3748,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3911
3748
|
return null;
|
|
3912
3749
|
}
|
|
3913
3750
|
const RenderIcon = CustomIcon ?? Icon;
|
|
3914
|
-
return /* @__PURE__ */
|
|
3751
|
+
return /* @__PURE__ */ jsx38(
|
|
3915
3752
|
Button2,
|
|
3916
3753
|
{
|
|
3917
3754
|
type: "button",
|
|
@@ -3927,10 +3764,10 @@ var ImageUploadButton = forwardRef10(
|
|
|
3927
3764
|
onClick: handleClick,
|
|
3928
3765
|
...buttonProps,
|
|
3929
3766
|
ref,
|
|
3930
|
-
children: children ?? /* @__PURE__ */
|
|
3931
|
-
/* @__PURE__ */
|
|
3932
|
-
text && /* @__PURE__ */
|
|
3933
|
-
showShortcut && /* @__PURE__ */
|
|
3767
|
+
children: children ?? /* @__PURE__ */ jsxs20(Fragment5, { children: [
|
|
3768
|
+
/* @__PURE__ */ jsx38(RenderIcon, { className: "tiptap-button-icon" }),
|
|
3769
|
+
text && /* @__PURE__ */ jsx38("span", { className: "tiptap-button-text", children: text }),
|
|
3770
|
+
showShortcut && /* @__PURE__ */ jsx38(ImageShortcutBadge, { shortcutKeys })
|
|
3934
3771
|
] })
|
|
3935
3772
|
}
|
|
3936
3773
|
);
|
|
@@ -3939,13 +3776,13 @@ var ImageUploadButton = forwardRef10(
|
|
|
3939
3776
|
ImageUploadButton.displayName = "ImageUploadButton";
|
|
3940
3777
|
|
|
3941
3778
|
// src/components/tiptap-ui/image-upload-button/use-image-upload.ts
|
|
3942
|
-
import { useCallback as
|
|
3779
|
+
import { useCallback as useCallback12, useEffect as useEffect8, useState as useState16 } from "react";
|
|
3943
3780
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
3944
3781
|
|
|
3945
3782
|
// src/hooks/use-is-breakpoint.ts
|
|
3946
|
-
import { useEffect as useEffect7, useState as
|
|
3783
|
+
import { useEffect as useEffect7, useState as useState15 } from "react";
|
|
3947
3784
|
function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
3948
|
-
const [matches, setMatches] =
|
|
3785
|
+
const [matches, setMatches] = useState15(void 0);
|
|
3949
3786
|
useEffect7(() => {
|
|
3950
3787
|
const query = mode === "min" ? `(min-width: ${breakpoint}px)` : `(max-width: ${breakpoint - 1}px)`;
|
|
3951
3788
|
const mql = window.matchMedia(query);
|
|
@@ -3958,10 +3795,10 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
3958
3795
|
}
|
|
3959
3796
|
|
|
3960
3797
|
// src/components/tiptap-icons/image-plus-icon.tsx
|
|
3961
|
-
import { memo as
|
|
3962
|
-
import { jsx as
|
|
3963
|
-
var ImagePlusIcon =
|
|
3964
|
-
return /* @__PURE__ */
|
|
3798
|
+
import { memo as memo15 } from "react";
|
|
3799
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
3800
|
+
var ImagePlusIcon = memo15(({ className, ...props }) => {
|
|
3801
|
+
return /* @__PURE__ */ jsx39(
|
|
3965
3802
|
"svg",
|
|
3966
3803
|
{
|
|
3967
3804
|
width: "24",
|
|
@@ -3971,7 +3808,7 @@ var ImagePlusIcon = memo11(({ className, ...props }) => {
|
|
|
3971
3808
|
fill: "currentColor",
|
|
3972
3809
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3973
3810
|
...props,
|
|
3974
|
-
children: /* @__PURE__ */
|
|
3811
|
+
children: /* @__PURE__ */ jsx39(
|
|
3975
3812
|
"path",
|
|
3976
3813
|
{
|
|
3977
3814
|
fillRule: "evenodd",
|
|
@@ -4045,7 +3882,7 @@ function useImageUpload(config) {
|
|
|
4045
3882
|
} = config || {};
|
|
4046
3883
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4047
3884
|
const isMobile = useIsBreakpoint();
|
|
4048
|
-
const [isVisible, setIsVisible] =
|
|
3885
|
+
const [isVisible, setIsVisible] = useState16(true);
|
|
4049
3886
|
const canInsert = canInsertImage(editor);
|
|
4050
3887
|
const isActive = isImageActive(editor);
|
|
4051
3888
|
useEffect8(() => {
|
|
@@ -4059,7 +3896,7 @@ function useImageUpload(config) {
|
|
|
4059
3896
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4060
3897
|
};
|
|
4061
3898
|
}, [editor, hideWhenUnavailable]);
|
|
4062
|
-
const handleImage =
|
|
3899
|
+
const handleImage = useCallback12(async () => {
|
|
4063
3900
|
if (!editor) return false;
|
|
4064
3901
|
const success = insertImage(editor);
|
|
4065
3902
|
if (await success) {
|
|
@@ -4091,16 +3928,16 @@ function useImageUpload(config) {
|
|
|
4091
3928
|
}
|
|
4092
3929
|
|
|
4093
3930
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
4094
|
-
import { useCallback as
|
|
3931
|
+
import { useCallback as useCallback15, useState as useState19 } from "react";
|
|
4095
3932
|
|
|
4096
3933
|
// src/components/tiptap-ui/list-button/list-button.tsx
|
|
4097
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
4098
|
-
import { Fragment as
|
|
3934
|
+
import { forwardRef as forwardRef11, useCallback as useCallback13 } from "react";
|
|
3935
|
+
import { Fragment as Fragment6, jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4099
3936
|
function ListShortcutBadge({
|
|
4100
3937
|
type,
|
|
4101
3938
|
shortcutKeys = LIST_SHORTCUT_KEYS[type]
|
|
4102
3939
|
}) {
|
|
4103
|
-
return /* @__PURE__ */
|
|
3940
|
+
return /* @__PURE__ */ jsx40(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4104
3941
|
}
|
|
4105
3942
|
var ListButton = forwardRef11(
|
|
4106
3943
|
({
|
|
@@ -4129,7 +3966,7 @@ var ListButton = forwardRef11(
|
|
|
4129
3966
|
hideWhenUnavailable,
|
|
4130
3967
|
onToggled
|
|
4131
3968
|
});
|
|
4132
|
-
const handleClick =
|
|
3969
|
+
const handleClick = useCallback13(
|
|
4133
3970
|
(event) => {
|
|
4134
3971
|
onClick?.(event);
|
|
4135
3972
|
if (event.defaultPrevented) return;
|
|
@@ -4140,7 +3977,7 @@ var ListButton = forwardRef11(
|
|
|
4140
3977
|
if (!isVisible) {
|
|
4141
3978
|
return null;
|
|
4142
3979
|
}
|
|
4143
|
-
return /* @__PURE__ */
|
|
3980
|
+
return /* @__PURE__ */ jsx40(
|
|
4144
3981
|
Button2,
|
|
4145
3982
|
{
|
|
4146
3983
|
type: "button",
|
|
@@ -4156,10 +3993,10 @@ var ListButton = forwardRef11(
|
|
|
4156
3993
|
onClick: handleClick,
|
|
4157
3994
|
...buttonProps,
|
|
4158
3995
|
ref,
|
|
4159
|
-
children: children ?? /* @__PURE__ */
|
|
4160
|
-
/* @__PURE__ */
|
|
4161
|
-
text && /* @__PURE__ */
|
|
4162
|
-
showShortcut && /* @__PURE__ */
|
|
3996
|
+
children: children ?? /* @__PURE__ */ jsxs21(Fragment6, { children: [
|
|
3997
|
+
/* @__PURE__ */ jsx40(Icon, { className: "tiptap-button-icon" }),
|
|
3998
|
+
text && /* @__PURE__ */ jsx40("span", { className: "tiptap-button-text", children: text }),
|
|
3999
|
+
showShortcut && /* @__PURE__ */ jsx40(ListShortcutBadge, { type, shortcutKeys })
|
|
4163
4000
|
] })
|
|
4164
4001
|
}
|
|
4165
4002
|
);
|
|
@@ -4168,14 +4005,14 @@ var ListButton = forwardRef11(
|
|
|
4168
4005
|
ListButton.displayName = "ListButton";
|
|
4169
4006
|
|
|
4170
4007
|
// src/components/tiptap-ui/list-button/use-list.ts
|
|
4171
|
-
import { useCallback as
|
|
4008
|
+
import { useCallback as useCallback14, useEffect as useEffect9, useState as useState17 } from "react";
|
|
4172
4009
|
import { NodeSelection as NodeSelection3, TextSelection as TextSelection3 } from "@tiptap/pm/state";
|
|
4173
4010
|
|
|
4174
4011
|
// src/components/tiptap-icons/list-icon.tsx
|
|
4175
|
-
import { memo as
|
|
4176
|
-
import { jsx as
|
|
4177
|
-
var ListIcon =
|
|
4178
|
-
return /* @__PURE__ */
|
|
4012
|
+
import { memo as memo16 } from "react";
|
|
4013
|
+
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4014
|
+
var ListIcon = memo16(({ className, ...props }) => {
|
|
4015
|
+
return /* @__PURE__ */ jsxs22(
|
|
4179
4016
|
"svg",
|
|
4180
4017
|
{
|
|
4181
4018
|
width: "24",
|
|
@@ -4186,7 +4023,7 @@ var ListIcon = memo12(({ className, ...props }) => {
|
|
|
4186
4023
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4187
4024
|
...props,
|
|
4188
4025
|
children: [
|
|
4189
|
-
/* @__PURE__ */
|
|
4026
|
+
/* @__PURE__ */ jsx41(
|
|
4190
4027
|
"path",
|
|
4191
4028
|
{
|
|
4192
4029
|
fillRule: "evenodd",
|
|
@@ -4195,7 +4032,7 @@ var ListIcon = memo12(({ className, ...props }) => {
|
|
|
4195
4032
|
fill: "currentColor"
|
|
4196
4033
|
}
|
|
4197
4034
|
),
|
|
4198
|
-
/* @__PURE__ */
|
|
4035
|
+
/* @__PURE__ */ jsx41(
|
|
4199
4036
|
"path",
|
|
4200
4037
|
{
|
|
4201
4038
|
fillRule: "evenodd",
|
|
@@ -4204,7 +4041,7 @@ var ListIcon = memo12(({ className, ...props }) => {
|
|
|
4204
4041
|
fill: "currentColor"
|
|
4205
4042
|
}
|
|
4206
4043
|
),
|
|
4207
|
-
/* @__PURE__ */
|
|
4044
|
+
/* @__PURE__ */ jsx41(
|
|
4208
4045
|
"path",
|
|
4209
4046
|
{
|
|
4210
4047
|
fillRule: "evenodd",
|
|
@@ -4213,7 +4050,7 @@ var ListIcon = memo12(({ className, ...props }) => {
|
|
|
4213
4050
|
fill: "currentColor"
|
|
4214
4051
|
}
|
|
4215
4052
|
),
|
|
4216
|
-
/* @__PURE__ */
|
|
4053
|
+
/* @__PURE__ */ jsx41(
|
|
4217
4054
|
"path",
|
|
4218
4055
|
{
|
|
4219
4056
|
fillRule: "evenodd",
|
|
@@ -4222,7 +4059,7 @@ var ListIcon = memo12(({ className, ...props }) => {
|
|
|
4222
4059
|
fill: "currentColor"
|
|
4223
4060
|
}
|
|
4224
4061
|
),
|
|
4225
|
-
/* @__PURE__ */
|
|
4062
|
+
/* @__PURE__ */ jsx41(
|
|
4226
4063
|
"path",
|
|
4227
4064
|
{
|
|
4228
4065
|
fillRule: "evenodd",
|
|
@@ -4231,7 +4068,7 @@ var ListIcon = memo12(({ className, ...props }) => {
|
|
|
4231
4068
|
fill: "currentColor"
|
|
4232
4069
|
}
|
|
4233
4070
|
),
|
|
4234
|
-
/* @__PURE__ */
|
|
4071
|
+
/* @__PURE__ */ jsx41(
|
|
4235
4072
|
"path",
|
|
4236
4073
|
{
|
|
4237
4074
|
fillRule: "evenodd",
|
|
@@ -4247,10 +4084,10 @@ var ListIcon = memo12(({ className, ...props }) => {
|
|
|
4247
4084
|
ListIcon.displayName = "ListIcon";
|
|
4248
4085
|
|
|
4249
4086
|
// src/components/tiptap-icons/list-ordered-icon.tsx
|
|
4250
|
-
import { memo as
|
|
4251
|
-
import { jsx as
|
|
4252
|
-
var ListOrderedIcon =
|
|
4253
|
-
return /* @__PURE__ */
|
|
4087
|
+
import { memo as memo17 } from "react";
|
|
4088
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4089
|
+
var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
4090
|
+
return /* @__PURE__ */ jsxs23(
|
|
4254
4091
|
"svg",
|
|
4255
4092
|
{
|
|
4256
4093
|
width: "24",
|
|
@@ -4261,7 +4098,7 @@ var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
|
4261
4098
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4262
4099
|
...props,
|
|
4263
4100
|
children: [
|
|
4264
|
-
/* @__PURE__ */
|
|
4101
|
+
/* @__PURE__ */ jsx42(
|
|
4265
4102
|
"path",
|
|
4266
4103
|
{
|
|
4267
4104
|
fillRule: "evenodd",
|
|
@@ -4270,7 +4107,7 @@ var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
|
4270
4107
|
fill: "currentColor"
|
|
4271
4108
|
}
|
|
4272
4109
|
),
|
|
4273
|
-
/* @__PURE__ */
|
|
4110
|
+
/* @__PURE__ */ jsx42(
|
|
4274
4111
|
"path",
|
|
4275
4112
|
{
|
|
4276
4113
|
fillRule: "evenodd",
|
|
@@ -4279,7 +4116,7 @@ var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
|
4279
4116
|
fill: "currentColor"
|
|
4280
4117
|
}
|
|
4281
4118
|
),
|
|
4282
|
-
/* @__PURE__ */
|
|
4119
|
+
/* @__PURE__ */ jsx42(
|
|
4283
4120
|
"path",
|
|
4284
4121
|
{
|
|
4285
4122
|
fillRule: "evenodd",
|
|
@@ -4288,7 +4125,7 @@ var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
|
4288
4125
|
fill: "currentColor"
|
|
4289
4126
|
}
|
|
4290
4127
|
),
|
|
4291
|
-
/* @__PURE__ */
|
|
4128
|
+
/* @__PURE__ */ jsx42(
|
|
4292
4129
|
"path",
|
|
4293
4130
|
{
|
|
4294
4131
|
fillRule: "evenodd",
|
|
@@ -4297,7 +4134,7 @@ var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
|
4297
4134
|
fill: "currentColor"
|
|
4298
4135
|
}
|
|
4299
4136
|
),
|
|
4300
|
-
/* @__PURE__ */
|
|
4137
|
+
/* @__PURE__ */ jsx42(
|
|
4301
4138
|
"path",
|
|
4302
4139
|
{
|
|
4303
4140
|
fillRule: "evenodd",
|
|
@@ -4306,7 +4143,7 @@ var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
|
4306
4143
|
fill: "currentColor"
|
|
4307
4144
|
}
|
|
4308
4145
|
),
|
|
4309
|
-
/* @__PURE__ */
|
|
4146
|
+
/* @__PURE__ */ jsx42(
|
|
4310
4147
|
"path",
|
|
4311
4148
|
{
|
|
4312
4149
|
fillRule: "evenodd",
|
|
@@ -4322,10 +4159,10 @@ var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
|
4322
4159
|
ListOrderedIcon.displayName = "ListOrderedIcon";
|
|
4323
4160
|
|
|
4324
4161
|
// src/components/tiptap-icons/list-todo-icon.tsx
|
|
4325
|
-
import { memo as
|
|
4326
|
-
import { jsx as
|
|
4327
|
-
var ListTodoIcon =
|
|
4328
|
-
return /* @__PURE__ */
|
|
4162
|
+
import { memo as memo18 } from "react";
|
|
4163
|
+
import { jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4164
|
+
var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
4165
|
+
return /* @__PURE__ */ jsxs24(
|
|
4329
4166
|
"svg",
|
|
4330
4167
|
{
|
|
4331
4168
|
width: "24",
|
|
@@ -4336,7 +4173,7 @@ var ListTodoIcon = memo14(({ className, ...props }) => {
|
|
|
4336
4173
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4337
4174
|
...props,
|
|
4338
4175
|
children: [
|
|
4339
|
-
/* @__PURE__ */
|
|
4176
|
+
/* @__PURE__ */ jsx43(
|
|
4340
4177
|
"path",
|
|
4341
4178
|
{
|
|
4342
4179
|
fillRule: "evenodd",
|
|
@@ -4345,7 +4182,7 @@ var ListTodoIcon = memo14(({ className, ...props }) => {
|
|
|
4345
4182
|
fill: "currentColor"
|
|
4346
4183
|
}
|
|
4347
4184
|
),
|
|
4348
|
-
/* @__PURE__ */
|
|
4185
|
+
/* @__PURE__ */ jsx43(
|
|
4349
4186
|
"path",
|
|
4350
4187
|
{
|
|
4351
4188
|
fillRule: "evenodd",
|
|
@@ -4354,7 +4191,7 @@ var ListTodoIcon = memo14(({ className, ...props }) => {
|
|
|
4354
4191
|
fill: "currentColor"
|
|
4355
4192
|
}
|
|
4356
4193
|
),
|
|
4357
|
-
/* @__PURE__ */
|
|
4194
|
+
/* @__PURE__ */ jsx43(
|
|
4358
4195
|
"path",
|
|
4359
4196
|
{
|
|
4360
4197
|
fillRule: "evenodd",
|
|
@@ -4363,7 +4200,7 @@ var ListTodoIcon = memo14(({ className, ...props }) => {
|
|
|
4363
4200
|
fill: "currentColor"
|
|
4364
4201
|
}
|
|
4365
4202
|
),
|
|
4366
|
-
/* @__PURE__ */
|
|
4203
|
+
/* @__PURE__ */ jsx43(
|
|
4367
4204
|
"path",
|
|
4368
4205
|
{
|
|
4369
4206
|
fillRule: "evenodd",
|
|
@@ -4372,7 +4209,7 @@ var ListTodoIcon = memo14(({ className, ...props }) => {
|
|
|
4372
4209
|
fill: "currentColor"
|
|
4373
4210
|
}
|
|
4374
4211
|
),
|
|
4375
|
-
/* @__PURE__ */
|
|
4212
|
+
/* @__PURE__ */ jsx43(
|
|
4376
4213
|
"path",
|
|
4377
4214
|
{
|
|
4378
4215
|
fillRule: "evenodd",
|
|
@@ -4516,7 +4353,7 @@ function useList(config) {
|
|
|
4516
4353
|
onToggled
|
|
4517
4354
|
} = config;
|
|
4518
4355
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4519
|
-
const [isVisible, setIsVisible] =
|
|
4356
|
+
const [isVisible, setIsVisible] = useState17(true);
|
|
4520
4357
|
const canToggle2 = canToggleList(editor, type);
|
|
4521
4358
|
const isActive = isListActive(editor, type);
|
|
4522
4359
|
useEffect9(() => {
|
|
@@ -4530,7 +4367,7 @@ function useList(config) {
|
|
|
4530
4367
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4531
4368
|
};
|
|
4532
4369
|
}, [editor, type, hideWhenUnavailable]);
|
|
4533
|
-
const handleToggle =
|
|
4370
|
+
const handleToggle = useCallback14(() => {
|
|
4534
4371
|
if (!editor) return false;
|
|
4535
4372
|
const success = toggleList(editor, type);
|
|
4536
4373
|
if (success) {
|
|
@@ -4550,7 +4387,7 @@ function useList(config) {
|
|
|
4550
4387
|
}
|
|
4551
4388
|
|
|
4552
4389
|
// src/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts
|
|
4553
|
-
import { useEffect as useEffect10, useMemo as
|
|
4390
|
+
import { useEffect as useEffect10, useMemo as useMemo6, useState as useState18 } from "react";
|
|
4554
4391
|
var listOptions = [
|
|
4555
4392
|
{
|
|
4556
4393
|
label: "Bullet List",
|
|
@@ -4602,9 +4439,9 @@ function useListDropdownMenu(config) {
|
|
|
4602
4439
|
hideWhenUnavailable = false
|
|
4603
4440
|
} = config || {};
|
|
4604
4441
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4605
|
-
const [isVisible, setIsVisible] =
|
|
4442
|
+
const [isVisible, setIsVisible] = useState18(true);
|
|
4606
4443
|
const listInSchema = types.some((type) => isNodeInSchema(type, editor));
|
|
4607
|
-
const filteredLists =
|
|
4444
|
+
const filteredLists = useMemo6(() => getFilteredListOptions(types), [types]);
|
|
4608
4445
|
const canToggleAny = canToggleAnyList(editor, types);
|
|
4609
4446
|
const isAnyActive = isAnyListActive(editor, types);
|
|
4610
4447
|
const activeType = getActiveListType(editor, types);
|
|
@@ -4641,7 +4478,7 @@ function useListDropdownMenu(config) {
|
|
|
4641
4478
|
}
|
|
4642
4479
|
|
|
4643
4480
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
4644
|
-
import { jsx as
|
|
4481
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4645
4482
|
function ListDropdownMenu({
|
|
4646
4483
|
editor: providedEditor,
|
|
4647
4484
|
types = ["bulletList", "orderedList", "taskList"],
|
|
@@ -4651,13 +4488,13 @@ function ListDropdownMenu({
|
|
|
4651
4488
|
...props
|
|
4652
4489
|
}) {
|
|
4653
4490
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4654
|
-
const [isOpen, setIsOpen] =
|
|
4491
|
+
const [isOpen, setIsOpen] = useState19(false);
|
|
4655
4492
|
const { filteredLists, canToggle: canToggle2, isActive, isVisible, Icon } = useListDropdownMenu({
|
|
4656
4493
|
editor,
|
|
4657
4494
|
types,
|
|
4658
4495
|
hideWhenUnavailable
|
|
4659
4496
|
});
|
|
4660
|
-
const handleOnOpenChange =
|
|
4497
|
+
const handleOnOpenChange = useCallback15(
|
|
4661
4498
|
(open) => {
|
|
4662
4499
|
setIsOpen(open);
|
|
4663
4500
|
onOpenChange?.(open);
|
|
@@ -4667,8 +4504,8 @@ function ListDropdownMenu({
|
|
|
4667
4504
|
if (!isVisible) {
|
|
4668
4505
|
return null;
|
|
4669
4506
|
}
|
|
4670
|
-
return /* @__PURE__ */
|
|
4671
|
-
/* @__PURE__ */
|
|
4507
|
+
return /* @__PURE__ */ jsxs25(DropdownMenu, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4508
|
+
/* @__PURE__ */ jsx44(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs25(
|
|
4672
4509
|
Button2,
|
|
4673
4510
|
{
|
|
4674
4511
|
type: "button",
|
|
@@ -4682,12 +4519,12 @@ function ListDropdownMenu({
|
|
|
4682
4519
|
tooltip: "List",
|
|
4683
4520
|
...props,
|
|
4684
4521
|
children: [
|
|
4685
|
-
/* @__PURE__ */
|
|
4686
|
-
/* @__PURE__ */
|
|
4522
|
+
/* @__PURE__ */ jsx44(Icon, { className: "tiptap-button-icon" }),
|
|
4523
|
+
/* @__PURE__ */ jsx44(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
4687
4524
|
]
|
|
4688
4525
|
}
|
|
4689
4526
|
) }),
|
|
4690
|
-
/* @__PURE__ */
|
|
4527
|
+
/* @__PURE__ */ jsx44(DropdownMenuContent, { align: "start", portal, children: /* @__PURE__ */ jsx44(Card, { children: /* @__PURE__ */ jsx44(CardBody, { children: /* @__PURE__ */ jsx44(ButtonGroup, { children: filteredLists.map((option) => /* @__PURE__ */ jsx44(DropdownMenuItem, { asChild: true, children: /* @__PURE__ */ jsx44(
|
|
4691
4528
|
ListButton,
|
|
4692
4529
|
{
|
|
4693
4530
|
editor,
|
|
@@ -4700,12 +4537,12 @@ function ListDropdownMenu({
|
|
|
4700
4537
|
}
|
|
4701
4538
|
|
|
4702
4539
|
// src/components/tiptap-ui/blockquote-button/blockquote-button.tsx
|
|
4703
|
-
import { forwardRef as forwardRef12, useCallback as
|
|
4704
|
-
import { Fragment as
|
|
4540
|
+
import { forwardRef as forwardRef12, useCallback as useCallback16 } from "react";
|
|
4541
|
+
import { Fragment as Fragment7, jsx as jsx45, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4705
4542
|
function BlockquoteShortcutBadge({
|
|
4706
4543
|
shortcutKeys = BLOCKQUOTE_SHORTCUT_KEY
|
|
4707
4544
|
}) {
|
|
4708
|
-
return /* @__PURE__ */
|
|
4545
|
+
return /* @__PURE__ */ jsx45(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4709
4546
|
}
|
|
4710
4547
|
var BlockquoteButton = forwardRef12(
|
|
4711
4548
|
({
|
|
@@ -4732,7 +4569,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4732
4569
|
hideWhenUnavailable,
|
|
4733
4570
|
onToggled
|
|
4734
4571
|
});
|
|
4735
|
-
const handleClick =
|
|
4572
|
+
const handleClick = useCallback16(
|
|
4736
4573
|
(event) => {
|
|
4737
4574
|
onClick?.(event);
|
|
4738
4575
|
if (event.defaultPrevented) return;
|
|
@@ -4743,7 +4580,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4743
4580
|
if (!isVisible) {
|
|
4744
4581
|
return null;
|
|
4745
4582
|
}
|
|
4746
|
-
return /* @__PURE__ */
|
|
4583
|
+
return /* @__PURE__ */ jsx45(
|
|
4747
4584
|
Button2,
|
|
4748
4585
|
{
|
|
4749
4586
|
type: "button",
|
|
@@ -4759,10 +4596,10 @@ var BlockquoteButton = forwardRef12(
|
|
|
4759
4596
|
onClick: handleClick,
|
|
4760
4597
|
...buttonProps,
|
|
4761
4598
|
ref,
|
|
4762
|
-
children: children ?? /* @__PURE__ */
|
|
4763
|
-
/* @__PURE__ */
|
|
4764
|
-
text && /* @__PURE__ */
|
|
4765
|
-
showShortcut && /* @__PURE__ */
|
|
4599
|
+
children: children ?? /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
4600
|
+
/* @__PURE__ */ jsx45(Icon, { className: "tiptap-button-icon" }),
|
|
4601
|
+
text && /* @__PURE__ */ jsx45("span", { className: "tiptap-button-text", children: text }),
|
|
4602
|
+
showShortcut && /* @__PURE__ */ jsx45(BlockquoteShortcutBadge, { shortcutKeys })
|
|
4766
4603
|
] })
|
|
4767
4604
|
}
|
|
4768
4605
|
);
|
|
@@ -4771,14 +4608,14 @@ var BlockquoteButton = forwardRef12(
|
|
|
4771
4608
|
BlockquoteButton.displayName = "BlockquoteButton";
|
|
4772
4609
|
|
|
4773
4610
|
// src/components/tiptap-ui/blockquote-button/use-blockquote.ts
|
|
4774
|
-
import { useCallback as
|
|
4611
|
+
import { useCallback as useCallback17, useEffect as useEffect11, useState as useState20 } from "react";
|
|
4775
4612
|
import { NodeSelection as NodeSelection4, TextSelection as TextSelection4 } from "@tiptap/pm/state";
|
|
4776
4613
|
|
|
4777
4614
|
// src/components/tiptap-icons/blockquote-icon.tsx
|
|
4778
|
-
import { memo as
|
|
4779
|
-
import { jsx as
|
|
4780
|
-
var BlockquoteIcon =
|
|
4781
|
-
return /* @__PURE__ */
|
|
4615
|
+
import { memo as memo19 } from "react";
|
|
4616
|
+
import { jsx as jsx46, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4617
|
+
var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
4618
|
+
return /* @__PURE__ */ jsxs27(
|
|
4782
4619
|
"svg",
|
|
4783
4620
|
{
|
|
4784
4621
|
width: "24",
|
|
@@ -4789,7 +4626,7 @@ var BlockquoteIcon = memo15(({ className, ...props }) => {
|
|
|
4789
4626
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4790
4627
|
...props,
|
|
4791
4628
|
children: [
|
|
4792
|
-
/* @__PURE__ */
|
|
4629
|
+
/* @__PURE__ */ jsx46(
|
|
4793
4630
|
"path",
|
|
4794
4631
|
{
|
|
4795
4632
|
fillRule: "evenodd",
|
|
@@ -4798,7 +4635,7 @@ var BlockquoteIcon = memo15(({ className, ...props }) => {
|
|
|
4798
4635
|
fill: "currentColor"
|
|
4799
4636
|
}
|
|
4800
4637
|
),
|
|
4801
|
-
/* @__PURE__ */
|
|
4638
|
+
/* @__PURE__ */ jsx46(
|
|
4802
4639
|
"path",
|
|
4803
4640
|
{
|
|
4804
4641
|
fillRule: "evenodd",
|
|
@@ -4807,7 +4644,7 @@ var BlockquoteIcon = memo15(({ className, ...props }) => {
|
|
|
4807
4644
|
fill: "currentColor"
|
|
4808
4645
|
}
|
|
4809
4646
|
),
|
|
4810
|
-
/* @__PURE__ */
|
|
4647
|
+
/* @__PURE__ */ jsx46(
|
|
4811
4648
|
"path",
|
|
4812
4649
|
{
|
|
4813
4650
|
fillRule: "evenodd",
|
|
@@ -4816,7 +4653,7 @@ var BlockquoteIcon = memo15(({ className, ...props }) => {
|
|
|
4816
4653
|
fill: "currentColor"
|
|
4817
4654
|
}
|
|
4818
4655
|
),
|
|
4819
|
-
/* @__PURE__ */
|
|
4656
|
+
/* @__PURE__ */ jsx46(
|
|
4820
4657
|
"path",
|
|
4821
4658
|
{
|
|
4822
4659
|
fillRule: "evenodd",
|
|
@@ -4904,7 +4741,7 @@ function useBlockquote(config) {
|
|
|
4904
4741
|
onToggled
|
|
4905
4742
|
} = config || {};
|
|
4906
4743
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4907
|
-
const [isVisible, setIsVisible] =
|
|
4744
|
+
const [isVisible, setIsVisible] = useState20(true);
|
|
4908
4745
|
const canToggle2 = canToggleBlockquote(editor);
|
|
4909
4746
|
const isActive = editor?.isActive("blockquote") || false;
|
|
4910
4747
|
useEffect11(() => {
|
|
@@ -4918,7 +4755,7 @@ function useBlockquote(config) {
|
|
|
4918
4755
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4919
4756
|
};
|
|
4920
4757
|
}, [editor, hideWhenUnavailable]);
|
|
4921
|
-
const handleToggle =
|
|
4758
|
+
const handleToggle = useCallback17(() => {
|
|
4922
4759
|
if (!editor) return false;
|
|
4923
4760
|
const success = toggleBlockquote(editor);
|
|
4924
4761
|
if (success) {
|
|
@@ -4938,13 +4775,13 @@ function useBlockquote(config) {
|
|
|
4938
4775
|
}
|
|
4939
4776
|
|
|
4940
4777
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
4941
|
-
import { forwardRef as forwardRef14, useMemo as
|
|
4778
|
+
import { forwardRef as forwardRef14, useMemo as useMemo8, useRef as useRef5, useState as useState22 } from "react";
|
|
4942
4779
|
|
|
4943
4780
|
// src/components/tiptap-icons/ban-icon.tsx
|
|
4944
|
-
import { memo as
|
|
4945
|
-
import { jsx as
|
|
4946
|
-
var BanIcon =
|
|
4947
|
-
return /* @__PURE__ */
|
|
4781
|
+
import { memo as memo20 } from "react";
|
|
4782
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4783
|
+
var BanIcon = memo20(({ className, ...props }) => {
|
|
4784
|
+
return /* @__PURE__ */ jsx47(
|
|
4948
4785
|
"svg",
|
|
4949
4786
|
{
|
|
4950
4787
|
width: "24",
|
|
@@ -4954,7 +4791,7 @@ var BanIcon = memo16(({ className, ...props }) => {
|
|
|
4954
4791
|
fill: "currentColor",
|
|
4955
4792
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4956
4793
|
...props,
|
|
4957
|
-
children: /* @__PURE__ */
|
|
4794
|
+
children: /* @__PURE__ */ jsx47(
|
|
4958
4795
|
"path",
|
|
4959
4796
|
{
|
|
4960
4797
|
fillRule: "evenodd",
|
|
@@ -4969,10 +4806,10 @@ var BanIcon = memo16(({ className, ...props }) => {
|
|
|
4969
4806
|
BanIcon.displayName = "BanIcon";
|
|
4970
4807
|
|
|
4971
4808
|
// src/components/tiptap-icons/highlighter-icon.tsx
|
|
4972
|
-
import { memo as
|
|
4973
|
-
import { jsx as
|
|
4974
|
-
var HighlighterIcon =
|
|
4975
|
-
return /* @__PURE__ */
|
|
4809
|
+
import { memo as memo21 } from "react";
|
|
4810
|
+
import { jsx as jsx48 } from "react/jsx-runtime";
|
|
4811
|
+
var HighlighterIcon = memo21(({ className, ...props }) => {
|
|
4812
|
+
return /* @__PURE__ */ jsx48(
|
|
4976
4813
|
"svg",
|
|
4977
4814
|
{
|
|
4978
4815
|
width: "24",
|
|
@@ -4982,7 +4819,7 @@ var HighlighterIcon = memo17(({ className, ...props }) => {
|
|
|
4982
4819
|
fill: "currentColor",
|
|
4983
4820
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4984
4821
|
...props,
|
|
4985
|
-
children: /* @__PURE__ */
|
|
4822
|
+
children: /* @__PURE__ */ jsx48(
|
|
4986
4823
|
"path",
|
|
4987
4824
|
{
|
|
4988
4825
|
fillRule: "evenodd",
|
|
@@ -4998,16 +4835,16 @@ HighlighterIcon.displayName = "HighlighterIcon";
|
|
|
4998
4835
|
|
|
4999
4836
|
// src/components/tiptap-ui-primitive/popover/popover.tsx
|
|
5000
4837
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
5001
|
-
import { jsx as
|
|
4838
|
+
import { jsx as jsx49 } from "react/jsx-runtime";
|
|
5002
4839
|
function Popover({
|
|
5003
4840
|
...props
|
|
5004
4841
|
}) {
|
|
5005
|
-
return /* @__PURE__ */
|
|
4842
|
+
return /* @__PURE__ */ jsx49(PopoverPrimitive.Root, { ...props });
|
|
5006
4843
|
}
|
|
5007
4844
|
function PopoverTrigger({
|
|
5008
4845
|
...props
|
|
5009
4846
|
}) {
|
|
5010
|
-
return /* @__PURE__ */
|
|
4847
|
+
return /* @__PURE__ */ jsx49(PopoverPrimitive.Trigger, { ...props });
|
|
5011
4848
|
}
|
|
5012
4849
|
function PopoverContent({
|
|
5013
4850
|
className,
|
|
@@ -5015,7 +4852,7 @@ function PopoverContent({
|
|
|
5015
4852
|
sideOffset = 4,
|
|
5016
4853
|
...props
|
|
5017
4854
|
}) {
|
|
5018
|
-
return /* @__PURE__ */
|
|
4855
|
+
return /* @__PURE__ */ jsx49(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx49(
|
|
5019
4856
|
PopoverPrimitive.Content,
|
|
5020
4857
|
{
|
|
5021
4858
|
align,
|
|
@@ -5027,12 +4864,12 @@ function PopoverContent({
|
|
|
5027
4864
|
}
|
|
5028
4865
|
|
|
5029
4866
|
// src/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx
|
|
5030
|
-
import { forwardRef as forwardRef13, useCallback as
|
|
5031
|
-
import { Fragment as
|
|
4867
|
+
import { forwardRef as forwardRef13, useCallback as useCallback18, useMemo as useMemo7 } from "react";
|
|
4868
|
+
import { Fragment as Fragment8, jsx as jsx50, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5032
4869
|
function ColorHighlightShortcutBadge({
|
|
5033
4870
|
shortcutKeys = COLOR_HIGHLIGHT_SHORTCUT_KEY
|
|
5034
4871
|
}) {
|
|
5035
|
-
return /* @__PURE__ */
|
|
4872
|
+
return /* @__PURE__ */ jsx50(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
5036
4873
|
}
|
|
5037
4874
|
var ColorHighlightButton = forwardRef13(
|
|
5038
4875
|
({
|
|
@@ -5064,7 +4901,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
5064
4901
|
mode,
|
|
5065
4902
|
onApplied
|
|
5066
4903
|
});
|
|
5067
|
-
const handleClick =
|
|
4904
|
+
const handleClick = useCallback18(
|
|
5068
4905
|
(event) => {
|
|
5069
4906
|
onClick?.(event);
|
|
5070
4907
|
if (event.defaultPrevented) return;
|
|
@@ -5072,7 +4909,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
5072
4909
|
},
|
|
5073
4910
|
[handleColorHighlight, onClick]
|
|
5074
4911
|
);
|
|
5075
|
-
const buttonStyle =
|
|
4912
|
+
const buttonStyle = useMemo7(
|
|
5076
4913
|
() => ({
|
|
5077
4914
|
...style,
|
|
5078
4915
|
"--highlight-color": highlightColor
|
|
@@ -5082,7 +4919,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
5082
4919
|
if (!isVisible) {
|
|
5083
4920
|
return null;
|
|
5084
4921
|
}
|
|
5085
|
-
return /* @__PURE__ */
|
|
4922
|
+
return /* @__PURE__ */ jsx50(
|
|
5086
4923
|
Button2,
|
|
5087
4924
|
{
|
|
5088
4925
|
type: "button",
|
|
@@ -5099,16 +4936,16 @@ var ColorHighlightButton = forwardRef13(
|
|
|
5099
4936
|
style: buttonStyle,
|
|
5100
4937
|
...buttonProps,
|
|
5101
4938
|
ref,
|
|
5102
|
-
children: children ?? /* @__PURE__ */
|
|
5103
|
-
/* @__PURE__ */
|
|
4939
|
+
children: children ?? /* @__PURE__ */ jsxs28(Fragment8, { children: [
|
|
4940
|
+
/* @__PURE__ */ jsx50(
|
|
5104
4941
|
"span",
|
|
5105
4942
|
{
|
|
5106
4943
|
className: "tiptap-button-highlight",
|
|
5107
4944
|
style: { "--highlight-color": highlightColor }
|
|
5108
4945
|
}
|
|
5109
4946
|
),
|
|
5110
|
-
text && /* @__PURE__ */
|
|
5111
|
-
showShortcut && /* @__PURE__ */
|
|
4947
|
+
text && /* @__PURE__ */ jsx50("span", { className: "tiptap-button-text", children: text }),
|
|
4948
|
+
showShortcut && /* @__PURE__ */ jsx50(ColorHighlightShortcutBadge, { shortcutKeys })
|
|
5112
4949
|
] })
|
|
5113
4950
|
}
|
|
5114
4951
|
);
|
|
@@ -5117,7 +4954,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
5117
4954
|
ColorHighlightButton.displayName = "ColorHighlightButton";
|
|
5118
4955
|
|
|
5119
4956
|
// src/components/tiptap-ui/color-highlight-button/use-color-highlight.ts
|
|
5120
|
-
import { useCallback as
|
|
4957
|
+
import { useCallback as useCallback19, useEffect as useEffect12, useState as useState21 } from "react";
|
|
5121
4958
|
import { useHotkeys as useHotkeys2 } from "react-hotkeys-hook";
|
|
5122
4959
|
var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
5123
4960
|
var HIGHLIGHT_COLORS = [
|
|
@@ -5248,7 +5085,7 @@ function useColorHighlight(config) {
|
|
|
5248
5085
|
} = config;
|
|
5249
5086
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5250
5087
|
const isMobile = useIsBreakpoint();
|
|
5251
|
-
const [isVisible, setIsVisible] =
|
|
5088
|
+
const [isVisible, setIsVisible] = useState21(true);
|
|
5252
5089
|
const canColorHighlightState = canColorHighlight(editor, mode);
|
|
5253
5090
|
const isActive = isColorHighlightActive(editor, highlightColor, mode);
|
|
5254
5091
|
useEffect12(() => {
|
|
@@ -5262,7 +5099,7 @@ function useColorHighlight(config) {
|
|
|
5262
5099
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
5263
5100
|
};
|
|
5264
5101
|
}, [editor, hideWhenUnavailable, mode]);
|
|
5265
|
-
const handleColorHighlight =
|
|
5102
|
+
const handleColorHighlight = useCallback19(() => {
|
|
5266
5103
|
if (!editor || !canColorHighlightState || !highlightColor || !label)
|
|
5267
5104
|
return false;
|
|
5268
5105
|
if (mode === "mark") {
|
|
@@ -5290,7 +5127,7 @@ function useColorHighlight(config) {
|
|
|
5290
5127
|
return success;
|
|
5291
5128
|
}
|
|
5292
5129
|
}, [canColorHighlightState, highlightColor, editor, label, onApplied, mode]);
|
|
5293
|
-
const handleRemoveHighlight =
|
|
5130
|
+
const handleRemoveHighlight = useCallback19(() => {
|
|
5294
5131
|
const success = removeHighlight(editor, mode);
|
|
5295
5132
|
if (success) {
|
|
5296
5133
|
onApplied?.({ color: "", label: "Remove highlight", mode });
|
|
@@ -5323,8 +5160,8 @@ function useColorHighlight(config) {
|
|
|
5323
5160
|
}
|
|
5324
5161
|
|
|
5325
5162
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
5326
|
-
import { jsx as
|
|
5327
|
-
var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
5163
|
+
import { jsx as jsx51, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5164
|
+
var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx51(
|
|
5328
5165
|
Button2,
|
|
5329
5166
|
{
|
|
5330
5167
|
type: "button",
|
|
@@ -5337,7 +5174,7 @@ var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props
|
|
|
5337
5174
|
tooltip: "Highlight",
|
|
5338
5175
|
ref,
|
|
5339
5176
|
...props,
|
|
5340
|
-
children: children ?? /* @__PURE__ */
|
|
5177
|
+
children: children ?? /* @__PURE__ */ jsx51(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
5341
5178
|
}
|
|
5342
5179
|
));
|
|
5343
5180
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
@@ -5353,8 +5190,8 @@ function ColorHighlightPopoverContent({
|
|
|
5353
5190
|
}) {
|
|
5354
5191
|
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
5355
5192
|
const isMobile = useIsBreakpoint();
|
|
5356
|
-
const containerRef =
|
|
5357
|
-
const menuItems =
|
|
5193
|
+
const containerRef = useRef5(null);
|
|
5194
|
+
const menuItems = useMemo8(
|
|
5358
5195
|
() => [...colors, { label: "Remove highlight", value: "none" }],
|
|
5359
5196
|
[colors]
|
|
5360
5197
|
);
|
|
@@ -5373,14 +5210,14 @@ function ColorHighlightPopoverContent({
|
|
|
5373
5210
|
},
|
|
5374
5211
|
autoSelectFirstItem: false
|
|
5375
5212
|
});
|
|
5376
|
-
return /* @__PURE__ */
|
|
5213
|
+
return /* @__PURE__ */ jsx51(
|
|
5377
5214
|
Card,
|
|
5378
5215
|
{
|
|
5379
5216
|
ref: containerRef,
|
|
5380
5217
|
tabIndex: 0,
|
|
5381
5218
|
style: isMobile ? { boxShadow: "none", border: 0 } : {},
|
|
5382
|
-
children: /* @__PURE__ */
|
|
5383
|
-
/* @__PURE__ */
|
|
5219
|
+
children: /* @__PURE__ */ jsx51(CardBody, { style: isMobile ? { padding: 0 } : {}, children: /* @__PURE__ */ jsxs29(CardItemGroup, { orientation: "horizontal", children: [
|
|
5220
|
+
/* @__PURE__ */ jsx51(ButtonGroup, { orientation: "horizontal", children: colors.map((color, index) => /* @__PURE__ */ jsx51(
|
|
5384
5221
|
ColorHighlightButton,
|
|
5385
5222
|
{
|
|
5386
5223
|
editor,
|
|
@@ -5392,8 +5229,8 @@ function ColorHighlightPopoverContent({
|
|
|
5392
5229
|
},
|
|
5393
5230
|
color.value
|
|
5394
5231
|
)) }),
|
|
5395
|
-
/* @__PURE__ */
|
|
5396
|
-
/* @__PURE__ */
|
|
5232
|
+
/* @__PURE__ */ jsx51(Separator2, {}),
|
|
5233
|
+
/* @__PURE__ */ jsx51(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx51(
|
|
5397
5234
|
Button2,
|
|
5398
5235
|
{
|
|
5399
5236
|
onClick: handleRemoveHighlight,
|
|
@@ -5404,7 +5241,7 @@ function ColorHighlightPopoverContent({
|
|
|
5404
5241
|
role: "menuitem",
|
|
5405
5242
|
"data-style": "ghost",
|
|
5406
5243
|
"data-highlighted": selectedIndex === colors.length,
|
|
5407
|
-
children: /* @__PURE__ */
|
|
5244
|
+
children: /* @__PURE__ */ jsx51(BanIcon, { className: "tiptap-button-icon" })
|
|
5408
5245
|
}
|
|
5409
5246
|
) })
|
|
5410
5247
|
] }) })
|
|
@@ -5413,13 +5250,13 @@ function ColorHighlightPopoverContent({
|
|
|
5413
5250
|
}
|
|
5414
5251
|
|
|
5415
5252
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5416
|
-
import { forwardRef as forwardRef15, useCallback as
|
|
5253
|
+
import { forwardRef as forwardRef15, useCallback as useCallback20, useEffect as useEffect13, useState as useState23 } from "react";
|
|
5417
5254
|
|
|
5418
5255
|
// src/components/tiptap-icons/corner-down-left-icon.tsx
|
|
5419
|
-
import { memo as
|
|
5420
|
-
import { jsx as
|
|
5421
|
-
var CornerDownLeftIcon =
|
|
5422
|
-
return /* @__PURE__ */
|
|
5256
|
+
import { memo as memo22 } from "react";
|
|
5257
|
+
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
5258
|
+
var CornerDownLeftIcon = memo22(({ className, ...props }) => {
|
|
5259
|
+
return /* @__PURE__ */ jsx52(
|
|
5423
5260
|
"svg",
|
|
5424
5261
|
{
|
|
5425
5262
|
width: "24",
|
|
@@ -5429,7 +5266,7 @@ var CornerDownLeftIcon = memo18(({ className, ...props }) => {
|
|
|
5429
5266
|
fill: "currentColor",
|
|
5430
5267
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5431
5268
|
...props,
|
|
5432
|
-
children: /* @__PURE__ */
|
|
5269
|
+
children: /* @__PURE__ */ jsx52(
|
|
5433
5270
|
"path",
|
|
5434
5271
|
{
|
|
5435
5272
|
fillRule: "evenodd",
|
|
@@ -5444,10 +5281,10 @@ var CornerDownLeftIcon = memo18(({ className, ...props }) => {
|
|
|
5444
5281
|
CornerDownLeftIcon.displayName = "CornerDownLeftIcon";
|
|
5445
5282
|
|
|
5446
5283
|
// src/components/tiptap-icons/external-link-icon.tsx
|
|
5447
|
-
import { memo as
|
|
5448
|
-
import { jsx as
|
|
5449
|
-
var ExternalLinkIcon =
|
|
5450
|
-
return /* @__PURE__ */
|
|
5284
|
+
import { memo as memo23 } from "react";
|
|
5285
|
+
import { jsx as jsx53, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5286
|
+
var ExternalLinkIcon = memo23(({ className, ...props }) => {
|
|
5287
|
+
return /* @__PURE__ */ jsxs30(
|
|
5451
5288
|
"svg",
|
|
5452
5289
|
{
|
|
5453
5290
|
width: "24",
|
|
@@ -5458,14 +5295,14 @@ var ExternalLinkIcon = memo19(({ className, ...props }) => {
|
|
|
5458
5295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5459
5296
|
...props,
|
|
5460
5297
|
children: [
|
|
5461
|
-
/* @__PURE__ */
|
|
5298
|
+
/* @__PURE__ */ jsx53(
|
|
5462
5299
|
"path",
|
|
5463
5300
|
{
|
|
5464
5301
|
d: "M14 3C14 2.44772 14.4477 2 15 2H21C21.5523 2 22 2.44772 22 3V9C22 9.55228 21.5523 10 21 10C20.4477 10 20 9.55228 20 9V5.41421L10.7071 14.7071C10.3166 15.0976 9.68342 15.0976 9.29289 14.7071C8.90237 14.3166 8.90237 13.6834 9.29289 13.2929L18.5858 4H15C14.4477 4 14 3.55228 14 3Z",
|
|
5465
5302
|
fill: "currentColor"
|
|
5466
5303
|
}
|
|
5467
5304
|
),
|
|
5468
|
-
/* @__PURE__ */
|
|
5305
|
+
/* @__PURE__ */ jsx53(
|
|
5469
5306
|
"path",
|
|
5470
5307
|
{
|
|
5471
5308
|
d: "M4.29289 7.29289C4.48043 7.10536 4.73478 7 5 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5H5C4.20435 5 3.44129 5.31607 2.87868 5.87868C2.31607 6.44129 2 7.20435 2 8V19C2 19.7957 2.31607 20.5587 2.87868 21.1213C3.44129 21.6839 4.20435 22 5 22H16C16.7957 22 17.5587 21.6839 18.1213 21.1213C18.6839 20.5587 19 19.7957 19 19V13C19 12.4477 18.5523 12 18 12C17.4477 12 17 12.4477 17 13V19C17 19.2652 16.8946 19.5196 16.7071 19.7071C16.5196 19.8946 16.2652 20 16 20H5C4.73478 20 4.48043 19.8946 4.29289 19.7071C4.10536 19.5196 4 19.2652 4 19V8C4 7.73478 4.10536 7.48043 4.29289 7.29289Z",
|
|
@@ -5479,10 +5316,10 @@ var ExternalLinkIcon = memo19(({ className, ...props }) => {
|
|
|
5479
5316
|
ExternalLinkIcon.displayName = "ExternalLinkIcon";
|
|
5480
5317
|
|
|
5481
5318
|
// src/components/tiptap-icons/link-icon.tsx
|
|
5482
|
-
import { memo as
|
|
5483
|
-
import { jsx as
|
|
5484
|
-
var LinkIcon =
|
|
5485
|
-
return /* @__PURE__ */
|
|
5319
|
+
import { memo as memo24 } from "react";
|
|
5320
|
+
import { jsx as jsx54, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5321
|
+
var LinkIcon = memo24(({ className, ...props }) => {
|
|
5322
|
+
return /* @__PURE__ */ jsxs31(
|
|
5486
5323
|
"svg",
|
|
5487
5324
|
{
|
|
5488
5325
|
width: "24",
|
|
@@ -5493,14 +5330,14 @@ var LinkIcon = memo20(({ className, ...props }) => {
|
|
|
5493
5330
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5494
5331
|
...props,
|
|
5495
5332
|
children: [
|
|
5496
|
-
/* @__PURE__ */
|
|
5333
|
+
/* @__PURE__ */ jsx54(
|
|
5497
5334
|
"path",
|
|
5498
5335
|
{
|
|
5499
5336
|
d: "M16.9958 1.06669C15.4226 1.05302 13.907 1.65779 12.7753 2.75074L12.765 2.76086L11.045 4.47086C10.6534 4.86024 10.6515 5.49341 11.0409 5.88507C11.4303 6.27673 12.0634 6.27858 12.4551 5.88919L14.1697 4.18456C14.9236 3.45893 15.9319 3.05752 16.9784 3.06662C18.0272 3.07573 19.0304 3.49641 19.772 4.23804C20.5137 4.97967 20.9344 5.98292 20.9435 7.03171C20.9526 8.07776 20.5515 9.08563 19.8265 9.83941L16.833 12.8329C16.4274 13.2386 15.9393 13.5524 15.4019 13.7529C14.8645 13.9533 14.2903 14.0359 13.7181 13.9949C13.146 13.9539 12.5894 13.7904 12.0861 13.5154C11.5827 13.2404 11.1444 12.8604 10.8008 12.401C10.47 11.9588 9.84333 11.8685 9.40108 12.1993C8.95883 12.5301 8.86849 13.1568 9.1993 13.599C9.71464 14.288 10.3721 14.858 11.1272 15.2705C11.8822 15.683 12.7171 15.9283 13.5753 15.9898C14.4334 16.0513 15.2948 15.9274 16.1009 15.6267C16.907 15.326 17.639 14.8555 18.2473 14.247L21.2472 11.2471L21.2593 11.2347C22.3523 10.1031 22.9571 8.58751 22.9434 7.01433C22.9297 5.44115 22.2987 3.93628 21.1863 2.82383C20.0738 1.71138 18.5689 1.08036 16.9958 1.06669Z",
|
|
5500
5337
|
fill: "currentColor"
|
|
5501
5338
|
}
|
|
5502
5339
|
),
|
|
5503
|
-
/* @__PURE__ */
|
|
5340
|
+
/* @__PURE__ */ jsx54(
|
|
5504
5341
|
"path",
|
|
5505
5342
|
{
|
|
5506
5343
|
d: "M10.4247 8.0102C9.56657 7.94874 8.70522 8.07256 7.89911 8.37326C7.09305 8.67395 6.36096 9.14458 5.75272 9.753L2.75285 12.7529L2.74067 12.7653C1.64772 13.8969 1.04295 15.4125 1.05662 16.9857C1.07029 18.5589 1.70131 20.0637 2.81376 21.1762C3.9262 22.2886 5.43108 22.9196 7.00426 22.9333C8.57744 22.947 10.0931 22.3422 11.2247 21.2493L11.2371 21.2371L12.9471 19.5271C13.3376 19.1366 13.3376 18.5034 12.9471 18.1129C12.5565 17.7223 11.9234 17.7223 11.5328 18.1129L9.82932 19.8164C9.07555 20.5414 8.06768 20.9425 7.02164 20.9334C5.97285 20.9243 4.9696 20.5036 4.22797 19.762C3.48634 19.0203 3.06566 18.0171 3.05655 16.9683C3.04746 15.9222 3.44851 14.9144 4.17355 14.1606L7.16719 11.167C7.5727 10.7613 8.06071 10.4476 8.59811 10.2471C9.13552 10.0467 9.70976 9.96412 10.2819 10.0051C10.854 10.0461 11.4106 10.2096 11.9139 10.4846C12.4173 10.7596 12.8556 11.1397 13.1992 11.599C13.53 12.0412 14.1567 12.1316 14.5989 11.8007C15.0412 11.4699 15.1315 10.8433 14.8007 10.401C14.2854 9.71205 13.6279 9.14198 12.8729 8.72948C12.1178 8.31697 11.2829 8.07166 10.4247 8.0102Z",
|
|
@@ -5514,10 +5351,10 @@ var LinkIcon = memo20(({ className, ...props }) => {
|
|
|
5514
5351
|
LinkIcon.displayName = "LinkIcon";
|
|
5515
5352
|
|
|
5516
5353
|
// src/components/tiptap-icons/trash-icon.tsx
|
|
5517
|
-
import { memo as
|
|
5518
|
-
import { jsx as
|
|
5519
|
-
var TrashIcon =
|
|
5520
|
-
return /* @__PURE__ */
|
|
5354
|
+
import { memo as memo25 } from "react";
|
|
5355
|
+
import { jsx as jsx55 } from "react/jsx-runtime";
|
|
5356
|
+
var TrashIcon = memo25(({ className, ...props }) => {
|
|
5357
|
+
return /* @__PURE__ */ jsx55(
|
|
5521
5358
|
"svg",
|
|
5522
5359
|
{
|
|
5523
5360
|
width: "24",
|
|
@@ -5527,7 +5364,7 @@ var TrashIcon = memo21(({ className, ...props }) => {
|
|
|
5527
5364
|
fill: "currentColor",
|
|
5528
5365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5529
5366
|
...props,
|
|
5530
|
-
children: /* @__PURE__ */
|
|
5367
|
+
children: /* @__PURE__ */ jsx55(
|
|
5531
5368
|
"path",
|
|
5532
5369
|
{
|
|
5533
5370
|
fillRule: "evenodd",
|
|
@@ -5542,23 +5379,23 @@ var TrashIcon = memo21(({ className, ...props }) => {
|
|
|
5542
5379
|
TrashIcon.displayName = "TrashIcon";
|
|
5543
5380
|
|
|
5544
5381
|
// src/components/tiptap-ui-primitive/input/input.tsx
|
|
5545
|
-
import { jsx as
|
|
5546
|
-
function
|
|
5547
|
-
return /* @__PURE__ */
|
|
5382
|
+
import { jsx as jsx56 } from "react/jsx-runtime";
|
|
5383
|
+
function Input({ className, type, ...props }) {
|
|
5384
|
+
return /* @__PURE__ */ jsx56("input", { type, className: cn2("tiptap-input", className), ...props });
|
|
5548
5385
|
}
|
|
5549
5386
|
function InputGroup({
|
|
5550
5387
|
className,
|
|
5551
5388
|
children,
|
|
5552
5389
|
...props
|
|
5553
5390
|
}) {
|
|
5554
|
-
return /* @__PURE__ */
|
|
5391
|
+
return /* @__PURE__ */ jsx56("div", { className: cn2("tiptap-input-group", className), ...props, children });
|
|
5555
5392
|
}
|
|
5556
5393
|
|
|
5557
5394
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5558
|
-
import { jsx as
|
|
5395
|
+
import { jsx as jsx57, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5559
5396
|
var LinkButton = forwardRef15(
|
|
5560
5397
|
({ className, children, ...props }, ref) => {
|
|
5561
|
-
return /* @__PURE__ */
|
|
5398
|
+
return /* @__PURE__ */ jsx57(
|
|
5562
5399
|
Button2,
|
|
5563
5400
|
{
|
|
5564
5401
|
type: "button",
|
|
@@ -5570,7 +5407,7 @@ var LinkButton = forwardRef15(
|
|
|
5570
5407
|
tooltip: "Link",
|
|
5571
5408
|
ref,
|
|
5572
5409
|
...props,
|
|
5573
|
-
children: children || /* @__PURE__ */
|
|
5410
|
+
children: children || /* @__PURE__ */ jsx57(LinkIcon, { className: "tiptap-button-icon" })
|
|
5574
5411
|
}
|
|
5575
5412
|
);
|
|
5576
5413
|
}
|
|
@@ -5591,21 +5428,21 @@ var LinkMain = ({
|
|
|
5591
5428
|
setLink();
|
|
5592
5429
|
}
|
|
5593
5430
|
};
|
|
5594
|
-
return /* @__PURE__ */
|
|
5431
|
+
return /* @__PURE__ */ jsx57(
|
|
5595
5432
|
Card,
|
|
5596
5433
|
{
|
|
5597
5434
|
style: {
|
|
5598
5435
|
...isMobile ? { boxShadow: "none", border: 0 } : {}
|
|
5599
5436
|
},
|
|
5600
|
-
children: /* @__PURE__ */
|
|
5437
|
+
children: /* @__PURE__ */ jsx57(
|
|
5601
5438
|
CardBody,
|
|
5602
5439
|
{
|
|
5603
5440
|
style: {
|
|
5604
5441
|
...isMobile ? { padding: 0 } : {}
|
|
5605
5442
|
},
|
|
5606
|
-
children: /* @__PURE__ */
|
|
5607
|
-
/* @__PURE__ */
|
|
5608
|
-
|
|
5443
|
+
children: /* @__PURE__ */ jsxs32(CardItemGroup, { orientation: "horizontal", children: [
|
|
5444
|
+
/* @__PURE__ */ jsx57(InputGroup, { children: /* @__PURE__ */ jsx57(
|
|
5445
|
+
Input,
|
|
5609
5446
|
{
|
|
5610
5447
|
type: "url",
|
|
5611
5448
|
placeholder: "Paste a link...",
|
|
@@ -5618,7 +5455,7 @@ var LinkMain = ({
|
|
|
5618
5455
|
autoCapitalize: "off"
|
|
5619
5456
|
}
|
|
5620
5457
|
) }),
|
|
5621
|
-
/* @__PURE__ */
|
|
5458
|
+
/* @__PURE__ */ jsx57(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx57(
|
|
5622
5459
|
Button2,
|
|
5623
5460
|
{
|
|
5624
5461
|
type: "button",
|
|
@@ -5626,12 +5463,12 @@ var LinkMain = ({
|
|
|
5626
5463
|
title: "Apply link",
|
|
5627
5464
|
disabled: !url && !isActive,
|
|
5628
5465
|
"data-style": "ghost",
|
|
5629
|
-
children: /* @__PURE__ */
|
|
5466
|
+
children: /* @__PURE__ */ jsx57(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
5630
5467
|
}
|
|
5631
5468
|
) }),
|
|
5632
|
-
/* @__PURE__ */
|
|
5633
|
-
/* @__PURE__ */
|
|
5634
|
-
/* @__PURE__ */
|
|
5469
|
+
/* @__PURE__ */ jsx57(Separator2, {}),
|
|
5470
|
+
/* @__PURE__ */ jsxs32(ButtonGroup, { orientation: "horizontal", children: [
|
|
5471
|
+
/* @__PURE__ */ jsx57(
|
|
5635
5472
|
Button2,
|
|
5636
5473
|
{
|
|
5637
5474
|
type: "button",
|
|
@@ -5639,10 +5476,10 @@ var LinkMain = ({
|
|
|
5639
5476
|
title: "Open in new window",
|
|
5640
5477
|
disabled: !url && !isActive,
|
|
5641
5478
|
"data-style": "ghost",
|
|
5642
|
-
children: /* @__PURE__ */
|
|
5479
|
+
children: /* @__PURE__ */ jsx57(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
5643
5480
|
}
|
|
5644
5481
|
),
|
|
5645
|
-
/* @__PURE__ */
|
|
5482
|
+
/* @__PURE__ */ jsx57(
|
|
5646
5483
|
Button2,
|
|
5647
5484
|
{
|
|
5648
5485
|
type: "button",
|
|
@@ -5650,7 +5487,7 @@ var LinkMain = ({
|
|
|
5650
5487
|
title: "Remove link",
|
|
5651
5488
|
disabled: !url && !isActive,
|
|
5652
5489
|
"data-style": "ghost",
|
|
5653
|
-
children: /* @__PURE__ */
|
|
5490
|
+
children: /* @__PURE__ */ jsx57(TrashIcon, { className: "tiptap-button-icon" })
|
|
5654
5491
|
}
|
|
5655
5492
|
)
|
|
5656
5493
|
] })
|
|
@@ -5664,7 +5501,7 @@ var LinkContent = ({ editor }) => {
|
|
|
5664
5501
|
const linkPopover = useLinkPopover({
|
|
5665
5502
|
editor
|
|
5666
5503
|
});
|
|
5667
|
-
return /* @__PURE__ */
|
|
5504
|
+
return /* @__PURE__ */ jsx57(LinkMain, { ...linkPopover });
|
|
5668
5505
|
};
|
|
5669
5506
|
var LinkPopover = forwardRef15(
|
|
5670
5507
|
({
|
|
@@ -5678,7 +5515,7 @@ var LinkPopover = forwardRef15(
|
|
|
5678
5515
|
...buttonProps
|
|
5679
5516
|
}, ref) => {
|
|
5680
5517
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5681
|
-
const [isOpen, setIsOpen] =
|
|
5518
|
+
const [isOpen, setIsOpen] = useState23(false);
|
|
5682
5519
|
const {
|
|
5683
5520
|
isVisible,
|
|
5684
5521
|
canSet,
|
|
@@ -5695,18 +5532,18 @@ var LinkPopover = forwardRef15(
|
|
|
5695
5532
|
hideWhenUnavailable,
|
|
5696
5533
|
onSetLink
|
|
5697
5534
|
});
|
|
5698
|
-
const handleOnOpenChange =
|
|
5535
|
+
const handleOnOpenChange = useCallback20(
|
|
5699
5536
|
(nextIsOpen) => {
|
|
5700
5537
|
setIsOpen(nextIsOpen);
|
|
5701
5538
|
onOpenChange?.(nextIsOpen);
|
|
5702
5539
|
},
|
|
5703
5540
|
[onOpenChange]
|
|
5704
5541
|
);
|
|
5705
|
-
const handleSetLink =
|
|
5542
|
+
const handleSetLink = useCallback20(() => {
|
|
5706
5543
|
setLink();
|
|
5707
5544
|
setIsOpen(false);
|
|
5708
5545
|
}, [setLink]);
|
|
5709
|
-
const handleClick =
|
|
5546
|
+
const handleClick = useCallback20(
|
|
5710
5547
|
(event) => {
|
|
5711
5548
|
onClick?.(event);
|
|
5712
5549
|
if (event.defaultPrevented) return;
|
|
@@ -5722,8 +5559,8 @@ var LinkPopover = forwardRef15(
|
|
|
5722
5559
|
if (!isVisible) {
|
|
5723
5560
|
return null;
|
|
5724
5561
|
}
|
|
5725
|
-
return /* @__PURE__ */
|
|
5726
|
-
/* @__PURE__ */
|
|
5562
|
+
return /* @__PURE__ */ jsxs32(Popover, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
5563
|
+
/* @__PURE__ */ jsx57(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx57(
|
|
5727
5564
|
LinkButton,
|
|
5728
5565
|
{
|
|
5729
5566
|
disabled: !canSet,
|
|
@@ -5734,10 +5571,10 @@ var LinkPopover = forwardRef15(
|
|
|
5734
5571
|
onClick: handleClick,
|
|
5735
5572
|
...buttonProps,
|
|
5736
5573
|
ref,
|
|
5737
|
-
children: children ?? /* @__PURE__ */
|
|
5574
|
+
children: children ?? /* @__PURE__ */ jsx57(Icon, { className: "tiptap-button-icon" })
|
|
5738
5575
|
}
|
|
5739
5576
|
) }),
|
|
5740
|
-
/* @__PURE__ */
|
|
5577
|
+
/* @__PURE__ */ jsx57(PopoverContent, { children: /* @__PURE__ */ jsx57(
|
|
5741
5578
|
LinkMain,
|
|
5742
5579
|
{
|
|
5743
5580
|
url,
|
|
@@ -5754,7 +5591,7 @@ var LinkPopover = forwardRef15(
|
|
|
5754
5591
|
LinkPopover.displayName = "LinkPopover";
|
|
5755
5592
|
|
|
5756
5593
|
// src/components/tiptap-ui/link-popover/use-link-popover.ts
|
|
5757
|
-
import { useCallback as
|
|
5594
|
+
import { useCallback as useCallback21, useEffect as useEffect14, useState as useState24 } from "react";
|
|
5758
5595
|
function canSetLink(editor) {
|
|
5759
5596
|
if (!editor || !editor.isEditable) return false;
|
|
5760
5597
|
if (isNodeTypeSelected(editor, ["image"], true)) return false;
|
|
@@ -5777,7 +5614,7 @@ function shouldShowLinkButton(props) {
|
|
|
5777
5614
|
}
|
|
5778
5615
|
function useLinkHandler(props) {
|
|
5779
5616
|
const { editor, onSetLink } = props;
|
|
5780
|
-
const [url, setUrl] =
|
|
5617
|
+
const [url, setUrl] = useState24(null);
|
|
5781
5618
|
useEffect14(() => {
|
|
5782
5619
|
if (!editor) return;
|
|
5783
5620
|
const { href } = editor.getAttributes("link");
|
|
@@ -5796,7 +5633,7 @@ function useLinkHandler(props) {
|
|
|
5796
5633
|
editor.off("selectionUpdate", updateLinkState);
|
|
5797
5634
|
};
|
|
5798
5635
|
}, [editor]);
|
|
5799
|
-
const setLink =
|
|
5636
|
+
const setLink = useCallback21(() => {
|
|
5800
5637
|
if (!url || !editor) return;
|
|
5801
5638
|
const { selection } = editor.state;
|
|
5802
5639
|
const isEmpty = selection.empty;
|
|
@@ -5809,12 +5646,12 @@ function useLinkHandler(props) {
|
|
|
5809
5646
|
setUrl(null);
|
|
5810
5647
|
onSetLink?.();
|
|
5811
5648
|
}, [editor, onSetLink, url]);
|
|
5812
|
-
const removeLink =
|
|
5649
|
+
const removeLink = useCallback21(() => {
|
|
5813
5650
|
if (!editor) return;
|
|
5814
5651
|
editor.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink", true).run();
|
|
5815
5652
|
setUrl("");
|
|
5816
5653
|
}, [editor]);
|
|
5817
|
-
const openLink =
|
|
5654
|
+
const openLink = useCallback21(
|
|
5818
5655
|
(target = "_blank", features = "noopener,noreferrer") => {
|
|
5819
5656
|
if (!url) return;
|
|
5820
5657
|
const safeUrl = sanitizeUrl(url, window.location.href);
|
|
@@ -5836,7 +5673,7 @@ function useLinkState(props) {
|
|
|
5836
5673
|
const { editor, hideWhenUnavailable = false } = props;
|
|
5837
5674
|
const canSet = canSetLink(editor);
|
|
5838
5675
|
const isActive = isLinkActive(editor);
|
|
5839
|
-
const [isVisible, setIsVisible] =
|
|
5676
|
+
const [isVisible, setIsVisible] = useState24(true);
|
|
5840
5677
|
useEffect14(() => {
|
|
5841
5678
|
if (!editor) return;
|
|
5842
5679
|
const handleSelectionUpdate = () => {
|
|
@@ -5885,13 +5722,13 @@ function useLinkPopover(config) {
|
|
|
5885
5722
|
}
|
|
5886
5723
|
|
|
5887
5724
|
// src/components/tiptap-ui/mark-button/mark-button.tsx
|
|
5888
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
5889
|
-
import { Fragment as
|
|
5725
|
+
import { forwardRef as forwardRef16, useCallback as useCallback22 } from "react";
|
|
5726
|
+
import { Fragment as Fragment9, jsx as jsx58, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
5890
5727
|
function MarkShortcutBadge({
|
|
5891
5728
|
type,
|
|
5892
5729
|
shortcutKeys = MARK_SHORTCUT_KEYS[type]
|
|
5893
5730
|
}) {
|
|
5894
|
-
return /* @__PURE__ */
|
|
5731
|
+
return /* @__PURE__ */ jsx58(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
5895
5732
|
}
|
|
5896
5733
|
var MarkButton = forwardRef16(
|
|
5897
5734
|
({
|
|
@@ -5920,7 +5757,7 @@ var MarkButton = forwardRef16(
|
|
|
5920
5757
|
hideWhenUnavailable,
|
|
5921
5758
|
onToggled
|
|
5922
5759
|
});
|
|
5923
|
-
const handleClick =
|
|
5760
|
+
const handleClick = useCallback22(
|
|
5924
5761
|
(event) => {
|
|
5925
5762
|
onClick?.(event);
|
|
5926
5763
|
if (event.defaultPrevented) return;
|
|
@@ -5931,7 +5768,7 @@ var MarkButton = forwardRef16(
|
|
|
5931
5768
|
if (!isVisible) {
|
|
5932
5769
|
return null;
|
|
5933
5770
|
}
|
|
5934
|
-
return /* @__PURE__ */
|
|
5771
|
+
return /* @__PURE__ */ jsx58(
|
|
5935
5772
|
Button2,
|
|
5936
5773
|
{
|
|
5937
5774
|
type: "button",
|
|
@@ -5947,10 +5784,10 @@ var MarkButton = forwardRef16(
|
|
|
5947
5784
|
onClick: handleClick,
|
|
5948
5785
|
...buttonProps,
|
|
5949
5786
|
ref,
|
|
5950
|
-
children: children ?? /* @__PURE__ */
|
|
5951
|
-
/* @__PURE__ */
|
|
5952
|
-
text && /* @__PURE__ */
|
|
5953
|
-
showShortcut && /* @__PURE__ */
|
|
5787
|
+
children: children ?? /* @__PURE__ */ jsxs33(Fragment9, { children: [
|
|
5788
|
+
/* @__PURE__ */ jsx58(Icon, { className: "tiptap-button-icon" }),
|
|
5789
|
+
text && /* @__PURE__ */ jsx58("span", { className: "tiptap-button-text", children: text }),
|
|
5790
|
+
showShortcut && /* @__PURE__ */ jsx58(MarkShortcutBadge, { type, shortcutKeys })
|
|
5954
5791
|
] })
|
|
5955
5792
|
}
|
|
5956
5793
|
);
|
|
@@ -5959,13 +5796,13 @@ var MarkButton = forwardRef16(
|
|
|
5959
5796
|
MarkButton.displayName = "MarkButton";
|
|
5960
5797
|
|
|
5961
5798
|
// src/components/tiptap-ui/mark-button/use-mark.ts
|
|
5962
|
-
import { useCallback as
|
|
5799
|
+
import { useCallback as useCallback23, useEffect as useEffect15, useState as useState25 } from "react";
|
|
5963
5800
|
|
|
5964
5801
|
// src/components/tiptap-icons/bold-icon.tsx
|
|
5965
|
-
import { memo as
|
|
5966
|
-
import { jsx as
|
|
5967
|
-
var BoldIcon =
|
|
5968
|
-
return /* @__PURE__ */
|
|
5802
|
+
import { memo as memo26 } from "react";
|
|
5803
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
5804
|
+
var BoldIcon = memo26(({ className, ...props }) => {
|
|
5805
|
+
return /* @__PURE__ */ jsx59(
|
|
5969
5806
|
"svg",
|
|
5970
5807
|
{
|
|
5971
5808
|
width: "24",
|
|
@@ -5975,7 +5812,7 @@ var BoldIcon = memo22(({ className, ...props }) => {
|
|
|
5975
5812
|
fill: "currentColor",
|
|
5976
5813
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5977
5814
|
...props,
|
|
5978
|
-
children: /* @__PURE__ */
|
|
5815
|
+
children: /* @__PURE__ */ jsx59(
|
|
5979
5816
|
"path",
|
|
5980
5817
|
{
|
|
5981
5818
|
fillRule: "evenodd",
|
|
@@ -5990,10 +5827,10 @@ var BoldIcon = memo22(({ className, ...props }) => {
|
|
|
5990
5827
|
BoldIcon.displayName = "BoldIcon";
|
|
5991
5828
|
|
|
5992
5829
|
// src/components/tiptap-icons/code2-icon.tsx
|
|
5993
|
-
import { memo as
|
|
5994
|
-
import { jsx as
|
|
5995
|
-
var Code2Icon =
|
|
5996
|
-
return /* @__PURE__ */
|
|
5830
|
+
import { memo as memo27 } from "react";
|
|
5831
|
+
import { jsx as jsx60, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
5832
|
+
var Code2Icon = memo27(({ className, ...props }) => {
|
|
5833
|
+
return /* @__PURE__ */ jsxs34(
|
|
5997
5834
|
"svg",
|
|
5998
5835
|
{
|
|
5999
5836
|
width: "24",
|
|
@@ -6004,21 +5841,21 @@ var Code2Icon = memo23(({ className, ...props }) => {
|
|
|
6004
5841
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6005
5842
|
...props,
|
|
6006
5843
|
children: [
|
|
6007
|
-
/* @__PURE__ */
|
|
5844
|
+
/* @__PURE__ */ jsx60(
|
|
6008
5845
|
"path",
|
|
6009
5846
|
{
|
|
6010
5847
|
d: "M15.4545 4.2983C15.6192 3.77115 15.3254 3.21028 14.7983 3.04554C14.2712 2.88081 13.7103 3.1746 13.5455 3.70175L8.54554 19.7017C8.38081 20.2289 8.6746 20.7898 9.20175 20.9545C9.72889 21.1192 10.2898 20.8254 10.4545 20.2983L15.4545 4.2983Z",
|
|
6011
5848
|
fill: "currentColor"
|
|
6012
5849
|
}
|
|
6013
5850
|
),
|
|
6014
|
-
/* @__PURE__ */
|
|
5851
|
+
/* @__PURE__ */ jsx60(
|
|
6015
5852
|
"path",
|
|
6016
5853
|
{
|
|
6017
5854
|
d: "M6.70711 7.29289C7.09763 7.68342 7.09763 8.31658 6.70711 8.70711L3.41421 12L6.70711 15.2929C7.09763 15.6834 7.09763 16.3166 6.70711 16.7071C6.31658 17.0976 5.68342 17.0976 5.29289 16.7071L1.29289 12.7071C0.902369 12.3166 0.902369 11.6834 1.29289 11.2929L5.29289 7.29289C5.68342 6.90237 6.31658 6.90237 6.70711 7.29289Z",
|
|
6018
5855
|
fill: "currentColor"
|
|
6019
5856
|
}
|
|
6020
5857
|
),
|
|
6021
|
-
/* @__PURE__ */
|
|
5858
|
+
/* @__PURE__ */ jsx60(
|
|
6022
5859
|
"path",
|
|
6023
5860
|
{
|
|
6024
5861
|
d: "M17.2929 7.29289C17.6834 6.90237 18.3166 6.90237 18.7071 7.29289L22.7071 11.2929C23.0976 11.6834 23.0976 12.3166 22.7071 12.7071L18.7071 16.7071C18.3166 17.0976 17.6834 17.0976 17.2929 16.7071C16.9024 16.3166 16.9024 15.6834 17.2929 15.2929L20.5858 12L17.2929 8.70711C16.9024 8.31658 16.9024 7.68342 17.2929 7.29289Z",
|
|
@@ -6032,10 +5869,10 @@ var Code2Icon = memo23(({ className, ...props }) => {
|
|
|
6032
5869
|
Code2Icon.displayName = "Code2Icon";
|
|
6033
5870
|
|
|
6034
5871
|
// src/components/tiptap-icons/italic-icon.tsx
|
|
6035
|
-
import { memo as
|
|
6036
|
-
import { jsx as
|
|
6037
|
-
var ItalicIcon =
|
|
6038
|
-
return /* @__PURE__ */
|
|
5872
|
+
import { memo as memo28 } from "react";
|
|
5873
|
+
import { jsx as jsx61 } from "react/jsx-runtime";
|
|
5874
|
+
var ItalicIcon = memo28(({ className, ...props }) => {
|
|
5875
|
+
return /* @__PURE__ */ jsx61(
|
|
6039
5876
|
"svg",
|
|
6040
5877
|
{
|
|
6041
5878
|
width: "24",
|
|
@@ -6045,7 +5882,7 @@ var ItalicIcon = memo24(({ className, ...props }) => {
|
|
|
6045
5882
|
fill: "currentColor",
|
|
6046
5883
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6047
5884
|
...props,
|
|
6048
|
-
children: /* @__PURE__ */
|
|
5885
|
+
children: /* @__PURE__ */ jsx61(
|
|
6049
5886
|
"path",
|
|
6050
5887
|
{
|
|
6051
5888
|
d: "M15.0222 3H19C19.5523 3 20 3.44772 20 4C20 4.55228 19.5523 5 19 5H15.693L10.443 19H14C14.5523 19 15 19.4477 15 20C15 20.5523 14.5523 21 14 21H9.02418C9.00802 21.0004 8.99181 21.0004 8.97557 21H5C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19H8.30704L13.557 5H10C9.44772 5 9 4.55228 9 4C9 3.44772 9.44772 3 10 3H14.9782C14.9928 2.99968 15.0075 2.99967 15.0222 3Z",
|
|
@@ -6058,10 +5895,10 @@ var ItalicIcon = memo24(({ className, ...props }) => {
|
|
|
6058
5895
|
ItalicIcon.displayName = "ItalicIcon";
|
|
6059
5896
|
|
|
6060
5897
|
// src/components/tiptap-icons/strike-icon.tsx
|
|
6061
|
-
import { memo as
|
|
6062
|
-
import { jsx as
|
|
6063
|
-
var StrikeIcon =
|
|
6064
|
-
return /* @__PURE__ */
|
|
5898
|
+
import { memo as memo29 } from "react";
|
|
5899
|
+
import { jsx as jsx62, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
5900
|
+
var StrikeIcon = memo29(({ className, ...props }) => {
|
|
5901
|
+
return /* @__PURE__ */ jsxs35(
|
|
6065
5902
|
"svg",
|
|
6066
5903
|
{
|
|
6067
5904
|
width: "24",
|
|
@@ -6072,14 +5909,14 @@ var StrikeIcon = memo25(({ className, ...props }) => {
|
|
|
6072
5909
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6073
5910
|
...props,
|
|
6074
5911
|
children: [
|
|
6075
|
-
/* @__PURE__ */
|
|
5912
|
+
/* @__PURE__ */ jsx62(
|
|
6076
5913
|
"path",
|
|
6077
5914
|
{
|
|
6078
5915
|
d: "M9.00039 3H16.0001C16.5524 3 17.0001 3.44772 17.0001 4C17.0001 4.55229 16.5524 5 16.0001 5H9.00011C8.68006 4.99983 8.36412 5.07648 8.07983 5.22349C7.79555 5.37051 7.55069 5.5836 7.36585 5.84487C7.181 6.10614 7.06155 6.40796 7.01754 6.72497C6.97352 7.04198 7.00623 7.36492 7.11292 7.66667C7.29701 8.18737 7.02414 8.75872 6.50344 8.94281C5.98274 9.1269 5.4114 8.85403 5.2273 8.33333C5.01393 7.72984 4.94851 7.08396 5.03654 6.44994C5.12456 5.81592 5.36346 5.21229 5.73316 4.68974C6.10285 4.1672 6.59256 3.74101 7.16113 3.44698C7.72955 3.15303 8.36047 2.99975 9.00039 3Z",
|
|
6079
5916
|
fill: "currentColor"
|
|
6080
5917
|
}
|
|
6081
5918
|
),
|
|
6082
|
-
/* @__PURE__ */
|
|
5919
|
+
/* @__PURE__ */ jsx62(
|
|
6083
5920
|
"path",
|
|
6084
5921
|
{
|
|
6085
5922
|
d: "M18 13H20C20.5523 13 21 12.5523 21 12C21 11.4477 20.5523 11 20 11H4C3.44772 11 3 11.4477 3 12C3 12.5523 3.44772 13 4 13H14C14.7956 13 15.5587 13.3161 16.1213 13.8787C16.6839 14.4413 17 15.2044 17 16C17 16.7956 16.6839 17.5587 16.1213 18.1213C15.5587 18.6839 14.7956 19 14 19H6C5.44772 19 5 19.4477 5 20C5 20.5523 5.44772 21 6 21H14C15.3261 21 16.5979 20.4732 17.5355 19.5355C18.4732 18.5979 19 17.3261 19 16C19 14.9119 18.6453 13.8604 18 13Z",
|
|
@@ -6093,10 +5930,10 @@ var StrikeIcon = memo25(({ className, ...props }) => {
|
|
|
6093
5930
|
StrikeIcon.displayName = "StrikeIcon";
|
|
6094
5931
|
|
|
6095
5932
|
// src/components/tiptap-icons/subscript-icon.tsx
|
|
6096
|
-
import { memo as
|
|
6097
|
-
import { jsx as
|
|
6098
|
-
var SubscriptIcon =
|
|
6099
|
-
return /* @__PURE__ */
|
|
5933
|
+
import { memo as memo30 } from "react";
|
|
5934
|
+
import { jsx as jsx63, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
5935
|
+
var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
5936
|
+
return /* @__PURE__ */ jsxs36(
|
|
6100
5937
|
"svg",
|
|
6101
5938
|
{
|
|
6102
5939
|
width: "24",
|
|
@@ -6107,7 +5944,7 @@ var SubscriptIcon = memo26(({ className, ...props }) => {
|
|
|
6107
5944
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6108
5945
|
...props,
|
|
6109
5946
|
children: [
|
|
6110
|
-
/* @__PURE__ */
|
|
5947
|
+
/* @__PURE__ */ jsx63(
|
|
6111
5948
|
"path",
|
|
6112
5949
|
{
|
|
6113
5950
|
fillRule: "evenodd",
|
|
@@ -6116,7 +5953,7 @@ var SubscriptIcon = memo26(({ className, ...props }) => {
|
|
|
6116
5953
|
fill: "currentColor"
|
|
6117
5954
|
}
|
|
6118
5955
|
),
|
|
6119
|
-
/* @__PURE__ */
|
|
5956
|
+
/* @__PURE__ */ jsx63(
|
|
6120
5957
|
"path",
|
|
6121
5958
|
{
|
|
6122
5959
|
fillRule: "evenodd",
|
|
@@ -6125,7 +5962,7 @@ var SubscriptIcon = memo26(({ className, ...props }) => {
|
|
|
6125
5962
|
fill: "currentColor"
|
|
6126
5963
|
}
|
|
6127
5964
|
),
|
|
6128
|
-
/* @__PURE__ */
|
|
5965
|
+
/* @__PURE__ */ jsx63(
|
|
6129
5966
|
"path",
|
|
6130
5967
|
{
|
|
6131
5968
|
fillRule: "evenodd",
|
|
@@ -6141,10 +5978,10 @@ var SubscriptIcon = memo26(({ className, ...props }) => {
|
|
|
6141
5978
|
SubscriptIcon.displayName = "SubscriptIcon";
|
|
6142
5979
|
|
|
6143
5980
|
// src/components/tiptap-icons/superscript-icon.tsx
|
|
6144
|
-
import { memo as
|
|
6145
|
-
import { jsx as
|
|
6146
|
-
var SuperscriptIcon =
|
|
6147
|
-
return /* @__PURE__ */
|
|
5981
|
+
import { memo as memo31 } from "react";
|
|
5982
|
+
import { jsx as jsx64, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
5983
|
+
var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
5984
|
+
return /* @__PURE__ */ jsxs37(
|
|
6148
5985
|
"svg",
|
|
6149
5986
|
{
|
|
6150
5987
|
width: "24",
|
|
@@ -6155,7 +5992,7 @@ var SuperscriptIcon = memo27(({ className, ...props }) => {
|
|
|
6155
5992
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6156
5993
|
...props,
|
|
6157
5994
|
children: [
|
|
6158
|
-
/* @__PURE__ */
|
|
5995
|
+
/* @__PURE__ */ jsx64(
|
|
6159
5996
|
"path",
|
|
6160
5997
|
{
|
|
6161
5998
|
fillRule: "evenodd",
|
|
@@ -6164,7 +6001,7 @@ var SuperscriptIcon = memo27(({ className, ...props }) => {
|
|
|
6164
6001
|
fill: "currentColor"
|
|
6165
6002
|
}
|
|
6166
6003
|
),
|
|
6167
|
-
/* @__PURE__ */
|
|
6004
|
+
/* @__PURE__ */ jsx64(
|
|
6168
6005
|
"path",
|
|
6169
6006
|
{
|
|
6170
6007
|
fillRule: "evenodd",
|
|
@@ -6173,7 +6010,7 @@ var SuperscriptIcon = memo27(({ className, ...props }) => {
|
|
|
6173
6010
|
fill: "currentColor"
|
|
6174
6011
|
}
|
|
6175
6012
|
),
|
|
6176
|
-
/* @__PURE__ */
|
|
6013
|
+
/* @__PURE__ */ jsx64(
|
|
6177
6014
|
"path",
|
|
6178
6015
|
{
|
|
6179
6016
|
fillRule: "evenodd",
|
|
@@ -6189,10 +6026,10 @@ var SuperscriptIcon = memo27(({ className, ...props }) => {
|
|
|
6189
6026
|
SuperscriptIcon.displayName = "SuperscriptIcon";
|
|
6190
6027
|
|
|
6191
6028
|
// src/components/tiptap-icons/underline-icon.tsx
|
|
6192
|
-
import { memo as
|
|
6193
|
-
import { jsx as
|
|
6194
|
-
var UnderlineIcon =
|
|
6195
|
-
return /* @__PURE__ */
|
|
6029
|
+
import { memo as memo32 } from "react";
|
|
6030
|
+
import { jsx as jsx65 } from "react/jsx-runtime";
|
|
6031
|
+
var UnderlineIcon = memo32(({ className, ...props }) => {
|
|
6032
|
+
return /* @__PURE__ */ jsx65(
|
|
6196
6033
|
"svg",
|
|
6197
6034
|
{
|
|
6198
6035
|
width: "24",
|
|
@@ -6202,7 +6039,7 @@ var UnderlineIcon = memo28(({ className, ...props }) => {
|
|
|
6202
6039
|
fill: "currentColor",
|
|
6203
6040
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6204
6041
|
...props,
|
|
6205
|
-
children: /* @__PURE__ */
|
|
6042
|
+
children: /* @__PURE__ */ jsx65(
|
|
6206
6043
|
"path",
|
|
6207
6044
|
{
|
|
6208
6045
|
fillRule: "evenodd",
|
|
@@ -6270,7 +6107,7 @@ function useMark(config) {
|
|
|
6270
6107
|
onToggled
|
|
6271
6108
|
} = config;
|
|
6272
6109
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6273
|
-
const [isVisible, setIsVisible] =
|
|
6110
|
+
const [isVisible, setIsVisible] = useState25(true);
|
|
6274
6111
|
const canToggle2 = canToggleMark(editor, type);
|
|
6275
6112
|
const isActive = isMarkActive(editor, type);
|
|
6276
6113
|
useEffect15(() => {
|
|
@@ -6284,7 +6121,7 @@ function useMark(config) {
|
|
|
6284
6121
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6285
6122
|
};
|
|
6286
6123
|
}, [editor, type, hideWhenUnavailable]);
|
|
6287
|
-
const handleMark =
|
|
6124
|
+
const handleMark = useCallback23(() => {
|
|
6288
6125
|
if (!editor) return false;
|
|
6289
6126
|
const success = toggleMark(editor, type);
|
|
6290
6127
|
if (success) {
|
|
@@ -6304,13 +6141,13 @@ function useMark(config) {
|
|
|
6304
6141
|
}
|
|
6305
6142
|
|
|
6306
6143
|
// src/components/tiptap-ui/text-align-button/text-align-button.tsx
|
|
6307
|
-
import { forwardRef as forwardRef17, useCallback as
|
|
6308
|
-
import { Fragment as
|
|
6144
|
+
import { forwardRef as forwardRef17, useCallback as useCallback24 } from "react";
|
|
6145
|
+
import { Fragment as Fragment10, jsx as jsx66, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6309
6146
|
function TextAlignShortcutBadge({
|
|
6310
6147
|
align,
|
|
6311
6148
|
shortcutKeys = TEXT_ALIGN_SHORTCUT_KEYS[align]
|
|
6312
6149
|
}) {
|
|
6313
|
-
return /* @__PURE__ */
|
|
6150
|
+
return /* @__PURE__ */ jsx66(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6314
6151
|
}
|
|
6315
6152
|
var TextAlignButton = forwardRef17(
|
|
6316
6153
|
({
|
|
@@ -6340,7 +6177,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6340
6177
|
hideWhenUnavailable,
|
|
6341
6178
|
onAligned
|
|
6342
6179
|
});
|
|
6343
|
-
const handleClick =
|
|
6180
|
+
const handleClick = useCallback24(
|
|
6344
6181
|
(event) => {
|
|
6345
6182
|
onClick?.(event);
|
|
6346
6183
|
if (event.defaultPrevented) return;
|
|
@@ -6352,7 +6189,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6352
6189
|
return null;
|
|
6353
6190
|
}
|
|
6354
6191
|
const RenderIcon = CustomIcon ?? Icon;
|
|
6355
|
-
return /* @__PURE__ */
|
|
6192
|
+
return /* @__PURE__ */ jsx66(
|
|
6356
6193
|
Button2,
|
|
6357
6194
|
{
|
|
6358
6195
|
type: "button",
|
|
@@ -6368,10 +6205,10 @@ var TextAlignButton = forwardRef17(
|
|
|
6368
6205
|
onClick: handleClick,
|
|
6369
6206
|
...buttonProps,
|
|
6370
6207
|
ref,
|
|
6371
|
-
children: children ?? /* @__PURE__ */
|
|
6372
|
-
/* @__PURE__ */
|
|
6373
|
-
text && /* @__PURE__ */
|
|
6374
|
-
showShortcut && /* @__PURE__ */
|
|
6208
|
+
children: children ?? /* @__PURE__ */ jsxs38(Fragment10, { children: [
|
|
6209
|
+
/* @__PURE__ */ jsx66(RenderIcon, { className: "tiptap-button-icon" }),
|
|
6210
|
+
text && /* @__PURE__ */ jsx66("span", { className: "tiptap-button-text", children: text }),
|
|
6211
|
+
showShortcut && /* @__PURE__ */ jsx66(
|
|
6375
6212
|
TextAlignShortcutBadge,
|
|
6376
6213
|
{
|
|
6377
6214
|
align,
|
|
@@ -6386,13 +6223,13 @@ var TextAlignButton = forwardRef17(
|
|
|
6386
6223
|
TextAlignButton.displayName = "TextAlignButton";
|
|
6387
6224
|
|
|
6388
6225
|
// src/components/tiptap-ui/text-align-button/use-text-align.ts
|
|
6389
|
-
import { useCallback as
|
|
6226
|
+
import { useCallback as useCallback25, useEffect as useEffect16, useState as useState26 } from "react";
|
|
6390
6227
|
|
|
6391
6228
|
// src/components/tiptap-icons/align-center-icon.tsx
|
|
6392
|
-
import { memo as
|
|
6393
|
-
import { jsx as
|
|
6394
|
-
var AlignCenterIcon =
|
|
6395
|
-
return /* @__PURE__ */
|
|
6229
|
+
import { memo as memo33 } from "react";
|
|
6230
|
+
import { jsx as jsx67, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6231
|
+
var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
6232
|
+
return /* @__PURE__ */ jsxs39(
|
|
6396
6233
|
"svg",
|
|
6397
6234
|
{
|
|
6398
6235
|
width: "24",
|
|
@@ -6403,7 +6240,7 @@ var AlignCenterIcon = memo29(({ className, ...props }) => {
|
|
|
6403
6240
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6404
6241
|
...props,
|
|
6405
6242
|
children: [
|
|
6406
|
-
/* @__PURE__ */
|
|
6243
|
+
/* @__PURE__ */ jsx67(
|
|
6407
6244
|
"path",
|
|
6408
6245
|
{
|
|
6409
6246
|
fillRule: "evenodd",
|
|
@@ -6412,7 +6249,7 @@ var AlignCenterIcon = memo29(({ className, ...props }) => {
|
|
|
6412
6249
|
fill: "currentColor"
|
|
6413
6250
|
}
|
|
6414
6251
|
),
|
|
6415
|
-
/* @__PURE__ */
|
|
6252
|
+
/* @__PURE__ */ jsx67(
|
|
6416
6253
|
"path",
|
|
6417
6254
|
{
|
|
6418
6255
|
fillRule: "evenodd",
|
|
@@ -6421,7 +6258,7 @@ var AlignCenterIcon = memo29(({ className, ...props }) => {
|
|
|
6421
6258
|
fill: "currentColor"
|
|
6422
6259
|
}
|
|
6423
6260
|
),
|
|
6424
|
-
/* @__PURE__ */
|
|
6261
|
+
/* @__PURE__ */ jsx67(
|
|
6425
6262
|
"path",
|
|
6426
6263
|
{
|
|
6427
6264
|
fillRule: "evenodd",
|
|
@@ -6437,10 +6274,10 @@ var AlignCenterIcon = memo29(({ className, ...props }) => {
|
|
|
6437
6274
|
AlignCenterIcon.displayName = "AlignCenterIcon";
|
|
6438
6275
|
|
|
6439
6276
|
// src/components/tiptap-icons/align-justify-icon.tsx
|
|
6440
|
-
import { memo as
|
|
6441
|
-
import { jsx as
|
|
6442
|
-
var AlignJustifyIcon =
|
|
6443
|
-
return /* @__PURE__ */
|
|
6277
|
+
import { memo as memo34 } from "react";
|
|
6278
|
+
import { jsx as jsx68, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6279
|
+
var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
6280
|
+
return /* @__PURE__ */ jsxs40(
|
|
6444
6281
|
"svg",
|
|
6445
6282
|
{
|
|
6446
6283
|
width: "24",
|
|
@@ -6451,7 +6288,7 @@ var AlignJustifyIcon = memo30(({ className, ...props }) => {
|
|
|
6451
6288
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6452
6289
|
...props,
|
|
6453
6290
|
children: [
|
|
6454
|
-
/* @__PURE__ */
|
|
6291
|
+
/* @__PURE__ */ jsx68(
|
|
6455
6292
|
"path",
|
|
6456
6293
|
{
|
|
6457
6294
|
fillRule: "evenodd",
|
|
@@ -6460,7 +6297,7 @@ var AlignJustifyIcon = memo30(({ className, ...props }) => {
|
|
|
6460
6297
|
fill: "currentColor"
|
|
6461
6298
|
}
|
|
6462
6299
|
),
|
|
6463
|
-
/* @__PURE__ */
|
|
6300
|
+
/* @__PURE__ */ jsx68(
|
|
6464
6301
|
"path",
|
|
6465
6302
|
{
|
|
6466
6303
|
fillRule: "evenodd",
|
|
@@ -6469,7 +6306,7 @@ var AlignJustifyIcon = memo30(({ className, ...props }) => {
|
|
|
6469
6306
|
fill: "currentColor"
|
|
6470
6307
|
}
|
|
6471
6308
|
),
|
|
6472
|
-
/* @__PURE__ */
|
|
6309
|
+
/* @__PURE__ */ jsx68(
|
|
6473
6310
|
"path",
|
|
6474
6311
|
{
|
|
6475
6312
|
fillRule: "evenodd",
|
|
@@ -6485,10 +6322,10 @@ var AlignJustifyIcon = memo30(({ className, ...props }) => {
|
|
|
6485
6322
|
AlignJustifyIcon.displayName = "AlignJustifyIcon";
|
|
6486
6323
|
|
|
6487
6324
|
// src/components/tiptap-icons/align-left-icon.tsx
|
|
6488
|
-
import { memo as
|
|
6489
|
-
import { jsx as
|
|
6490
|
-
var AlignLeftIcon =
|
|
6491
|
-
return /* @__PURE__ */
|
|
6325
|
+
import { memo as memo35 } from "react";
|
|
6326
|
+
import { jsx as jsx69, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6327
|
+
var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
6328
|
+
return /* @__PURE__ */ jsxs41(
|
|
6492
6329
|
"svg",
|
|
6493
6330
|
{
|
|
6494
6331
|
width: "24",
|
|
@@ -6499,7 +6336,7 @@ var AlignLeftIcon = memo31(({ className, ...props }) => {
|
|
|
6499
6336
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6500
6337
|
...props,
|
|
6501
6338
|
children: [
|
|
6502
|
-
/* @__PURE__ */
|
|
6339
|
+
/* @__PURE__ */ jsx69(
|
|
6503
6340
|
"path",
|
|
6504
6341
|
{
|
|
6505
6342
|
fillRule: "evenodd",
|
|
@@ -6508,7 +6345,7 @@ var AlignLeftIcon = memo31(({ className, ...props }) => {
|
|
|
6508
6345
|
fill: "currentColor"
|
|
6509
6346
|
}
|
|
6510
6347
|
),
|
|
6511
|
-
/* @__PURE__ */
|
|
6348
|
+
/* @__PURE__ */ jsx69(
|
|
6512
6349
|
"path",
|
|
6513
6350
|
{
|
|
6514
6351
|
fillRule: "evenodd",
|
|
@@ -6517,7 +6354,7 @@ var AlignLeftIcon = memo31(({ className, ...props }) => {
|
|
|
6517
6354
|
fill: "currentColor"
|
|
6518
6355
|
}
|
|
6519
6356
|
),
|
|
6520
|
-
/* @__PURE__ */
|
|
6357
|
+
/* @__PURE__ */ jsx69(
|
|
6521
6358
|
"path",
|
|
6522
6359
|
{
|
|
6523
6360
|
fillRule: "evenodd",
|
|
@@ -6533,10 +6370,10 @@ var AlignLeftIcon = memo31(({ className, ...props }) => {
|
|
|
6533
6370
|
AlignLeftIcon.displayName = "AlignLeftIcon";
|
|
6534
6371
|
|
|
6535
6372
|
// src/components/tiptap-icons/align-right-icon.tsx
|
|
6536
|
-
import { memo as
|
|
6537
|
-
import { jsx as
|
|
6538
|
-
var AlignRightIcon =
|
|
6539
|
-
return /* @__PURE__ */
|
|
6373
|
+
import { memo as memo36 } from "react";
|
|
6374
|
+
import { jsx as jsx70, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6375
|
+
var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
6376
|
+
return /* @__PURE__ */ jsxs42(
|
|
6540
6377
|
"svg",
|
|
6541
6378
|
{
|
|
6542
6379
|
width: "24",
|
|
@@ -6547,7 +6384,7 @@ var AlignRightIcon = memo32(({ className, ...props }) => {
|
|
|
6547
6384
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6548
6385
|
...props,
|
|
6549
6386
|
children: [
|
|
6550
|
-
/* @__PURE__ */
|
|
6387
|
+
/* @__PURE__ */ jsx70(
|
|
6551
6388
|
"path",
|
|
6552
6389
|
{
|
|
6553
6390
|
fillRule: "evenodd",
|
|
@@ -6556,7 +6393,7 @@ var AlignRightIcon = memo32(({ className, ...props }) => {
|
|
|
6556
6393
|
fill: "currentColor"
|
|
6557
6394
|
}
|
|
6558
6395
|
),
|
|
6559
|
-
/* @__PURE__ */
|
|
6396
|
+
/* @__PURE__ */ jsx70(
|
|
6560
6397
|
"path",
|
|
6561
6398
|
{
|
|
6562
6399
|
fillRule: "evenodd",
|
|
@@ -6565,7 +6402,7 @@ var AlignRightIcon = memo32(({ className, ...props }) => {
|
|
|
6565
6402
|
fill: "currentColor"
|
|
6566
6403
|
}
|
|
6567
6404
|
),
|
|
6568
|
-
/* @__PURE__ */
|
|
6405
|
+
/* @__PURE__ */ jsx70(
|
|
6569
6406
|
"path",
|
|
6570
6407
|
{
|
|
6571
6408
|
fillRule: "evenodd",
|
|
@@ -6638,7 +6475,7 @@ function useTextAlign(config) {
|
|
|
6638
6475
|
onAligned
|
|
6639
6476
|
} = config;
|
|
6640
6477
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6641
|
-
const [isVisible, setIsVisible] =
|
|
6478
|
+
const [isVisible, setIsVisible] = useState26(true);
|
|
6642
6479
|
const canAlign = canSetTextAlign(editor, align);
|
|
6643
6480
|
const isActive = isTextAlignActive(editor, align);
|
|
6644
6481
|
useEffect16(() => {
|
|
@@ -6652,7 +6489,7 @@ function useTextAlign(config) {
|
|
|
6652
6489
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6653
6490
|
};
|
|
6654
6491
|
}, [editor, hideWhenUnavailable, align]);
|
|
6655
|
-
const handleTextAlign =
|
|
6492
|
+
const handleTextAlign = useCallback25(() => {
|
|
6656
6493
|
if (!editor) return false;
|
|
6657
6494
|
const success = setTextAlign(editor, align);
|
|
6658
6495
|
if (success) {
|
|
@@ -6672,13 +6509,13 @@ function useTextAlign(config) {
|
|
|
6672
6509
|
}
|
|
6673
6510
|
|
|
6674
6511
|
// src/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx
|
|
6675
|
-
import { forwardRef as forwardRef18, useCallback as
|
|
6676
|
-
import { Fragment as
|
|
6512
|
+
import { forwardRef as forwardRef18, useCallback as useCallback26 } from "react";
|
|
6513
|
+
import { Fragment as Fragment11, jsx as jsx71, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6677
6514
|
function HistoryShortcutBadge({
|
|
6678
6515
|
action,
|
|
6679
6516
|
shortcutKeys = UNDO_REDO_SHORTCUT_KEYS[action]
|
|
6680
6517
|
}) {
|
|
6681
|
-
return /* @__PURE__ */
|
|
6518
|
+
return /* @__PURE__ */ jsx71(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6682
6519
|
}
|
|
6683
6520
|
var UndoRedoButton = forwardRef18(
|
|
6684
6521
|
({
|
|
@@ -6699,7 +6536,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6699
6536
|
hideWhenUnavailable,
|
|
6700
6537
|
onExecuted
|
|
6701
6538
|
});
|
|
6702
|
-
const handleClick =
|
|
6539
|
+
const handleClick = useCallback26(
|
|
6703
6540
|
(event) => {
|
|
6704
6541
|
onClick?.(event);
|
|
6705
6542
|
if (event.defaultPrevented) return;
|
|
@@ -6710,7 +6547,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6710
6547
|
if (!isVisible) {
|
|
6711
6548
|
return null;
|
|
6712
6549
|
}
|
|
6713
|
-
return /* @__PURE__ */
|
|
6550
|
+
return /* @__PURE__ */ jsx71(
|
|
6714
6551
|
Button2,
|
|
6715
6552
|
{
|
|
6716
6553
|
type: "button",
|
|
@@ -6724,10 +6561,10 @@ var UndoRedoButton = forwardRef18(
|
|
|
6724
6561
|
onClick: handleClick,
|
|
6725
6562
|
...buttonProps,
|
|
6726
6563
|
ref,
|
|
6727
|
-
children: children ?? /* @__PURE__ */
|
|
6728
|
-
/* @__PURE__ */
|
|
6729
|
-
text && /* @__PURE__ */
|
|
6730
|
-
showShortcut && /* @__PURE__ */
|
|
6564
|
+
children: children ?? /* @__PURE__ */ jsxs43(Fragment11, { children: [
|
|
6565
|
+
/* @__PURE__ */ jsx71(Icon, { className: "tiptap-button-icon" }),
|
|
6566
|
+
text && /* @__PURE__ */ jsx71("span", { className: "tiptap-button-text", children: text }),
|
|
6567
|
+
showShortcut && /* @__PURE__ */ jsx71(
|
|
6731
6568
|
HistoryShortcutBadge,
|
|
6732
6569
|
{
|
|
6733
6570
|
action,
|
|
@@ -6742,13 +6579,13 @@ var UndoRedoButton = forwardRef18(
|
|
|
6742
6579
|
UndoRedoButton.displayName = "UndoRedoButton";
|
|
6743
6580
|
|
|
6744
6581
|
// src/components/tiptap-ui/undo-redo-button/use-undo-redo.ts
|
|
6745
|
-
import { useCallback as
|
|
6582
|
+
import { useCallback as useCallback27, useEffect as useEffect17, useState as useState27 } from "react";
|
|
6746
6583
|
|
|
6747
6584
|
// src/components/tiptap-icons/redo2-icon.tsx
|
|
6748
|
-
import { memo as
|
|
6749
|
-
import { jsx as
|
|
6750
|
-
var Redo2Icon =
|
|
6751
|
-
return /* @__PURE__ */
|
|
6585
|
+
import { memo as memo37 } from "react";
|
|
6586
|
+
import { jsx as jsx72 } from "react/jsx-runtime";
|
|
6587
|
+
var Redo2Icon = memo37(({ className, ...props }) => {
|
|
6588
|
+
return /* @__PURE__ */ jsx72(
|
|
6752
6589
|
"svg",
|
|
6753
6590
|
{
|
|
6754
6591
|
width: "24",
|
|
@@ -6758,7 +6595,7 @@ var Redo2Icon = memo33(({ className, ...props }) => {
|
|
|
6758
6595
|
fill: "currentColor",
|
|
6759
6596
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6760
6597
|
...props,
|
|
6761
|
-
children: /* @__PURE__ */
|
|
6598
|
+
children: /* @__PURE__ */ jsx72(
|
|
6762
6599
|
"path",
|
|
6763
6600
|
{
|
|
6764
6601
|
fillRule: "evenodd",
|
|
@@ -6773,10 +6610,10 @@ var Redo2Icon = memo33(({ className, ...props }) => {
|
|
|
6773
6610
|
Redo2Icon.displayName = "Redo2Icon";
|
|
6774
6611
|
|
|
6775
6612
|
// src/components/tiptap-icons/undo2-icon.tsx
|
|
6776
|
-
import { memo as
|
|
6777
|
-
import { jsx as
|
|
6778
|
-
var Undo2Icon =
|
|
6779
|
-
return /* @__PURE__ */
|
|
6613
|
+
import { memo as memo38 } from "react";
|
|
6614
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
6615
|
+
var Undo2Icon = memo38(({ className, ...props }) => {
|
|
6616
|
+
return /* @__PURE__ */ jsx73(
|
|
6780
6617
|
"svg",
|
|
6781
6618
|
{
|
|
6782
6619
|
width: "24",
|
|
@@ -6786,7 +6623,7 @@ var Undo2Icon = memo34(({ className, ...props }) => {
|
|
|
6786
6623
|
fill: "currentColor",
|
|
6787
6624
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6788
6625
|
...props,
|
|
6789
|
-
children: /* @__PURE__ */
|
|
6626
|
+
children: /* @__PURE__ */ jsx73(
|
|
6790
6627
|
"path",
|
|
6791
6628
|
{
|
|
6792
6629
|
fillRule: "evenodd",
|
|
@@ -6840,7 +6677,7 @@ function useUndoRedo(config) {
|
|
|
6840
6677
|
onExecuted
|
|
6841
6678
|
} = config;
|
|
6842
6679
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6843
|
-
const [isVisible, setIsVisible] =
|
|
6680
|
+
const [isVisible, setIsVisible] = useState27(true);
|
|
6844
6681
|
const canExecute = canExecuteUndoRedoAction(editor, action);
|
|
6845
6682
|
useEffect17(() => {
|
|
6846
6683
|
if (!editor) return;
|
|
@@ -6853,7 +6690,7 @@ function useUndoRedo(config) {
|
|
|
6853
6690
|
editor.off("transaction", handleUpdate);
|
|
6854
6691
|
};
|
|
6855
6692
|
}, [editor, hideWhenUnavailable, action]);
|
|
6856
|
-
const handleAction =
|
|
6693
|
+
const handleAction = useCallback27(() => {
|
|
6857
6694
|
if (!editor) return false;
|
|
6858
6695
|
const success = executeUndoRedoAction(editor, action);
|
|
6859
6696
|
if (success) {
|
|
@@ -6873,7 +6710,7 @@ function useUndoRedo(config) {
|
|
|
6873
6710
|
|
|
6874
6711
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
6875
6712
|
import { useCurrentEditor as useCurrentEditor3 } from "@tiptap/react";
|
|
6876
|
-
import { useState as
|
|
6713
|
+
import { useState as useState28 } from "react";
|
|
6877
6714
|
|
|
6878
6715
|
// src/lib/font.ts
|
|
6879
6716
|
var FONT_OPTIONS = [
|
|
@@ -6917,12 +6754,12 @@ import { ChevronDown } from "lucide-react";
|
|
|
6917
6754
|
// src/components/ui/command.tsx
|
|
6918
6755
|
import { Command as CommandPrimitive } from "cmdk";
|
|
6919
6756
|
import { SearchIcon } from "lucide-react";
|
|
6920
|
-
import { jsx as
|
|
6757
|
+
import { jsx as jsx74, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
6921
6758
|
function Command({
|
|
6922
6759
|
className,
|
|
6923
6760
|
...props
|
|
6924
6761
|
}) {
|
|
6925
|
-
return /* @__PURE__ */
|
|
6762
|
+
return /* @__PURE__ */ jsx74(
|
|
6926
6763
|
CommandPrimitive,
|
|
6927
6764
|
{
|
|
6928
6765
|
"data-slot": "command",
|
|
@@ -6938,14 +6775,14 @@ function CommandInput({
|
|
|
6938
6775
|
className,
|
|
6939
6776
|
...props
|
|
6940
6777
|
}) {
|
|
6941
|
-
return /* @__PURE__ */
|
|
6778
|
+
return /* @__PURE__ */ jsxs44(
|
|
6942
6779
|
"div",
|
|
6943
6780
|
{
|
|
6944
6781
|
"data-slot": "command-input-wrapper",
|
|
6945
6782
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
6946
6783
|
children: [
|
|
6947
|
-
/* @__PURE__ */
|
|
6948
|
-
/* @__PURE__ */
|
|
6784
|
+
/* @__PURE__ */ jsx74(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
6785
|
+
/* @__PURE__ */ jsx74(
|
|
6949
6786
|
CommandPrimitive.Input,
|
|
6950
6787
|
{
|
|
6951
6788
|
"data-slot": "command-input",
|
|
@@ -6964,7 +6801,7 @@ function CommandList({
|
|
|
6964
6801
|
className,
|
|
6965
6802
|
...props
|
|
6966
6803
|
}) {
|
|
6967
|
-
return /* @__PURE__ */
|
|
6804
|
+
return /* @__PURE__ */ jsx74(
|
|
6968
6805
|
CommandPrimitive.List,
|
|
6969
6806
|
{
|
|
6970
6807
|
"data-slot": "command-list",
|
|
@@ -6979,7 +6816,7 @@ function CommandList({
|
|
|
6979
6816
|
function CommandEmpty({
|
|
6980
6817
|
...props
|
|
6981
6818
|
}) {
|
|
6982
|
-
return /* @__PURE__ */
|
|
6819
|
+
return /* @__PURE__ */ jsx74(
|
|
6983
6820
|
CommandPrimitive.Empty,
|
|
6984
6821
|
{
|
|
6985
6822
|
"data-slot": "command-empty",
|
|
@@ -6992,7 +6829,7 @@ function CommandGroup({
|
|
|
6992
6829
|
className,
|
|
6993
6830
|
...props
|
|
6994
6831
|
}) {
|
|
6995
|
-
return /* @__PURE__ */
|
|
6832
|
+
return /* @__PURE__ */ jsx74(
|
|
6996
6833
|
CommandPrimitive.Group,
|
|
6997
6834
|
{
|
|
6998
6835
|
"data-slot": "command-group",
|
|
@@ -7008,7 +6845,7 @@ function CommandItem({
|
|
|
7008
6845
|
className,
|
|
7009
6846
|
...props
|
|
7010
6847
|
}) {
|
|
7011
|
-
return /* @__PURE__ */
|
|
6848
|
+
return /* @__PURE__ */ jsx74(
|
|
7012
6849
|
CommandPrimitive.Item,
|
|
7013
6850
|
{
|
|
7014
6851
|
"data-slot": "command-item",
|
|
@@ -7023,16 +6860,16 @@ function CommandItem({
|
|
|
7023
6860
|
|
|
7024
6861
|
// src/components/ui/popover.tsx
|
|
7025
6862
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
7026
|
-
import { jsx as
|
|
6863
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
7027
6864
|
function Popover2({
|
|
7028
6865
|
...props
|
|
7029
6866
|
}) {
|
|
7030
|
-
return /* @__PURE__ */
|
|
6867
|
+
return /* @__PURE__ */ jsx75(PopoverPrimitive2.Root, { "data-slot": "popover", ...props });
|
|
7031
6868
|
}
|
|
7032
6869
|
function PopoverTrigger2({
|
|
7033
6870
|
...props
|
|
7034
6871
|
}) {
|
|
7035
|
-
return /* @__PURE__ */
|
|
6872
|
+
return /* @__PURE__ */ jsx75(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
7036
6873
|
}
|
|
7037
6874
|
function PopoverContent2({
|
|
7038
6875
|
className,
|
|
@@ -7040,7 +6877,7 @@ function PopoverContent2({
|
|
|
7040
6877
|
sideOffset = 4,
|
|
7041
6878
|
...props
|
|
7042
6879
|
}) {
|
|
7043
|
-
return /* @__PURE__ */
|
|
6880
|
+
return /* @__PURE__ */ jsx75(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx75(
|
|
7044
6881
|
PopoverPrimitive2.Content,
|
|
7045
6882
|
{
|
|
7046
6883
|
"data-slot": "popover-content",
|
|
@@ -7056,10 +6893,10 @@ function PopoverContent2({
|
|
|
7056
6893
|
}
|
|
7057
6894
|
|
|
7058
6895
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
7059
|
-
import { jsx as
|
|
6896
|
+
import { jsx as jsx76, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
7060
6897
|
function FontFamilyDropdown() {
|
|
7061
6898
|
const { editor } = useCurrentEditor3();
|
|
7062
|
-
const [open, setOpen] =
|
|
6899
|
+
const [open, setOpen] = useState28(false);
|
|
7063
6900
|
if (!editor) return null;
|
|
7064
6901
|
const currentFont = editor.getAttributes("textStyle").fontFamily || "Font Family";
|
|
7065
6902
|
const applyFont = (family) => {
|
|
@@ -7077,19 +6914,19 @@ function FontFamilyDropdown() {
|
|
|
7077
6914
|
}
|
|
7078
6915
|
}, 0);
|
|
7079
6916
|
};
|
|
7080
|
-
return /* @__PURE__ */
|
|
7081
|
-
/* @__PURE__ */
|
|
6917
|
+
return /* @__PURE__ */ jsxs45(Popover2, { open, onOpenChange: setOpen, children: [
|
|
6918
|
+
/* @__PURE__ */ jsx76(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs45(
|
|
7082
6919
|
Button,
|
|
7083
6920
|
{
|
|
7084
6921
|
variant: "outlineFontFamily",
|
|
7085
6922
|
className: "\r\n min-w-[90px] h-7 px-2 flex items-center justify-between rounded-sm\r\n border-[#a3a3a8] text-[#a3a3a8]\r\n hover:border-[#000] hover:text-[#fff] transition-colors\r\n ",
|
|
7086
6923
|
children: [
|
|
7087
6924
|
currentFont,
|
|
7088
|
-
/* @__PURE__ */
|
|
6925
|
+
/* @__PURE__ */ jsx76(ChevronDown, { className: "w-4 h-4" })
|
|
7089
6926
|
]
|
|
7090
6927
|
}
|
|
7091
6928
|
) }),
|
|
7092
|
-
/* @__PURE__ */
|
|
6929
|
+
/* @__PURE__ */ jsx76(
|
|
7093
6930
|
PopoverContent2,
|
|
7094
6931
|
{
|
|
7095
6932
|
className: "w-[300px] p-0",
|
|
@@ -7100,12 +6937,12 @@ function FontFamilyDropdown() {
|
|
|
7100
6937
|
e.preventDefault();
|
|
7101
6938
|
}
|
|
7102
6939
|
},
|
|
7103
|
-
children: /* @__PURE__ */
|
|
7104
|
-
/* @__PURE__ */
|
|
7105
|
-
/* @__PURE__ */
|
|
7106
|
-
/* @__PURE__ */
|
|
7107
|
-
/* @__PURE__ */
|
|
7108
|
-
/* @__PURE__ */
|
|
6940
|
+
children: /* @__PURE__ */ jsxs45(Command, { children: [
|
|
6941
|
+
/* @__PURE__ */ jsx76("div", { className: "cmd-input-wrapper", children: /* @__PURE__ */ jsx76(CommandInput, { placeholder: "Search font..." }) }),
|
|
6942
|
+
/* @__PURE__ */ jsxs45(CommandList, { className: "max-h-[220px]", children: [
|
|
6943
|
+
/* @__PURE__ */ jsx76(CommandEmpty, { children: "No font found." }),
|
|
6944
|
+
/* @__PURE__ */ jsxs45(CommandGroup, { children: [
|
|
6945
|
+
/* @__PURE__ */ jsx76(
|
|
7109
6946
|
CommandItem,
|
|
7110
6947
|
{
|
|
7111
6948
|
onSelect: () => {
|
|
@@ -7128,7 +6965,7 @@ function FontFamilyDropdown() {
|
|
|
7128
6965
|
},
|
|
7129
6966
|
"default"
|
|
7130
6967
|
),
|
|
7131
|
-
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */
|
|
6968
|
+
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */ jsx76(
|
|
7132
6969
|
CommandItem,
|
|
7133
6970
|
{
|
|
7134
6971
|
onSelect: () => {
|
|
@@ -7149,7 +6986,7 @@ function FontFamilyDropdown() {
|
|
|
7149
6986
|
}
|
|
7150
6987
|
|
|
7151
6988
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
7152
|
-
import { useState as
|
|
6989
|
+
import { useState as useState29, useEffect as useEffect18 } from "react";
|
|
7153
6990
|
import { useCurrentEditor as useCurrentEditor4 } from "@tiptap/react";
|
|
7154
6991
|
import { HexColorPicker } from "react-colorful";
|
|
7155
6992
|
|
|
@@ -7239,12 +7076,12 @@ import { debounce } from "lodash";
|
|
|
7239
7076
|
|
|
7240
7077
|
// src/components/ui/label.tsx
|
|
7241
7078
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7242
|
-
import { jsx as
|
|
7243
|
-
function
|
|
7079
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
7080
|
+
function Label({
|
|
7244
7081
|
className,
|
|
7245
7082
|
...props
|
|
7246
7083
|
}) {
|
|
7247
|
-
return /* @__PURE__ */
|
|
7084
|
+
return /* @__PURE__ */ jsx77(
|
|
7248
7085
|
LabelPrimitive.Root,
|
|
7249
7086
|
{
|
|
7250
7087
|
"data-slot": "label",
|
|
@@ -7259,14 +7096,14 @@ function Label2({
|
|
|
7259
7096
|
|
|
7260
7097
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
7261
7098
|
import React4 from "react";
|
|
7262
|
-
import { jsx as
|
|
7099
|
+
import { jsx as jsx78, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7263
7100
|
function ColorPicker({ type = "text" }) {
|
|
7264
7101
|
const { editor } = useCurrentEditor4();
|
|
7265
|
-
const [open, setOpen] =
|
|
7266
|
-
const [color, setColor] =
|
|
7267
|
-
const [showCustom, setShowCustom] =
|
|
7268
|
-
const [tempHex, setTempHex] =
|
|
7269
|
-
const [canApply, setCanApply] =
|
|
7102
|
+
const [open, setOpen] = useState29(false);
|
|
7103
|
+
const [color, setColor] = useState29("#000000");
|
|
7104
|
+
const [showCustom, setShowCustom] = useState29(false);
|
|
7105
|
+
const [tempHex, setTempHex] = useState29("#000000");
|
|
7106
|
+
const [canApply, setCanApply] = useState29(false);
|
|
7270
7107
|
useEffect18(() => {
|
|
7271
7108
|
const current = type === "text" ? editor?.getAttributes("textStyle").color || "#000000" : editor?.getAttributes("highlight")?.color || "#FFFF00";
|
|
7272
7109
|
setColor(current);
|
|
@@ -7309,15 +7146,15 @@ function ColorPicker({ type = "text" }) {
|
|
|
7309
7146
|
[]
|
|
7310
7147
|
);
|
|
7311
7148
|
if (!editor) return null;
|
|
7312
|
-
return /* @__PURE__ */
|
|
7313
|
-
/* @__PURE__ */
|
|
7149
|
+
return /* @__PURE__ */ jsxs46(Popover2, { open, onOpenChange: (v) => setOpen(v), children: [
|
|
7150
|
+
/* @__PURE__ */ jsx78(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs46(
|
|
7314
7151
|
Button,
|
|
7315
7152
|
{
|
|
7316
7153
|
variant: "outlineFontFamily",
|
|
7317
7154
|
className: "flex items-center h-7 rounded-sm px-2 border-[#a3a3a8] text-[#a3a3a8] hover:text-white",
|
|
7318
7155
|
children: [
|
|
7319
7156
|
"Color",
|
|
7320
|
-
/* @__PURE__ */
|
|
7157
|
+
/* @__PURE__ */ jsx78(
|
|
7321
7158
|
"span",
|
|
7322
7159
|
{
|
|
7323
7160
|
className: "w-3 h-3 ml-2 rounded-sm border border-black/20",
|
|
@@ -7327,16 +7164,16 @@ function ColorPicker({ type = "text" }) {
|
|
|
7327
7164
|
]
|
|
7328
7165
|
}
|
|
7329
7166
|
) }),
|
|
7330
|
-
/* @__PURE__ */
|
|
7167
|
+
/* @__PURE__ */ jsxs46(
|
|
7331
7168
|
PopoverContent2,
|
|
7332
7169
|
{
|
|
7333
7170
|
className: "w-[260px] p-3",
|
|
7334
7171
|
align: "start",
|
|
7335
7172
|
onClick: (e) => e.stopPropagation(),
|
|
7336
7173
|
children: [
|
|
7337
|
-
/* @__PURE__ */
|
|
7338
|
-
!showCustom && /* @__PURE__ */
|
|
7339
|
-
/* @__PURE__ */
|
|
7174
|
+
/* @__PURE__ */ jsx78(Label, { className: "text-xs mb-2", children: type === "text" ? "Text Color" : "Highlight Color" }),
|
|
7175
|
+
!showCustom && /* @__PURE__ */ jsxs46("div", { className: "flex flex-col gap-3", children: [
|
|
7176
|
+
/* @__PURE__ */ jsx78("div", { className: "grid grid-cols-7 gap-1", children: GRADIENT_ROWS_70.map((c) => /* @__PURE__ */ jsx78(
|
|
7340
7177
|
"div",
|
|
7341
7178
|
{
|
|
7342
7179
|
onClick: () => {
|
|
@@ -7348,7 +7185,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7348
7185
|
},
|
|
7349
7186
|
c
|
|
7350
7187
|
)) }),
|
|
7351
|
-
/* @__PURE__ */
|
|
7188
|
+
/* @__PURE__ */ jsx78(
|
|
7352
7189
|
Button,
|
|
7353
7190
|
{
|
|
7354
7191
|
size: "sm",
|
|
@@ -7362,7 +7199,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7362
7199
|
)
|
|
7363
7200
|
] }),
|
|
7364
7201
|
showCustom && // stop mouse/pointer events from bubbling so popover doesn't treat them as outside clicks
|
|
7365
|
-
/* @__PURE__ */
|
|
7202
|
+
/* @__PURE__ */ jsxs46(
|
|
7366
7203
|
"div",
|
|
7367
7204
|
{
|
|
7368
7205
|
className: "flex flex-col gap-3",
|
|
@@ -7372,7 +7209,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7372
7209
|
onPointerUp: (e) => e.stopPropagation(),
|
|
7373
7210
|
onClick: (e) => e.stopPropagation(),
|
|
7374
7211
|
children: [
|
|
7375
|
-
/* @__PURE__ */
|
|
7212
|
+
/* @__PURE__ */ jsx78(
|
|
7376
7213
|
HexColorPicker,
|
|
7377
7214
|
{
|
|
7378
7215
|
color: tempHex,
|
|
@@ -7383,8 +7220,8 @@ function ColorPicker({ type = "text" }) {
|
|
|
7383
7220
|
onMouseUp: (e) => e.stopPropagation()
|
|
7384
7221
|
}
|
|
7385
7222
|
),
|
|
7386
|
-
/* @__PURE__ */
|
|
7387
|
-
/* @__PURE__ */
|
|
7223
|
+
/* @__PURE__ */ jsxs46("div", { className: "flex gap-2 items-center", children: [
|
|
7224
|
+
/* @__PURE__ */ jsx78(
|
|
7388
7225
|
"input",
|
|
7389
7226
|
{
|
|
7390
7227
|
value: tempHex,
|
|
@@ -7395,7 +7232,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7395
7232
|
className: "w-full px-2 py-1 border rounded text-sm"
|
|
7396
7233
|
}
|
|
7397
7234
|
),
|
|
7398
|
-
/* @__PURE__ */
|
|
7235
|
+
/* @__PURE__ */ jsx78(
|
|
7399
7236
|
Button,
|
|
7400
7237
|
{
|
|
7401
7238
|
size: "sm",
|
|
@@ -7408,7 +7245,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7408
7245
|
}
|
|
7409
7246
|
)
|
|
7410
7247
|
] }),
|
|
7411
|
-
/* @__PURE__ */
|
|
7248
|
+
/* @__PURE__ */ jsx78("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ jsx78(
|
|
7412
7249
|
Button,
|
|
7413
7250
|
{
|
|
7414
7251
|
size: "sm",
|
|
@@ -7433,13 +7270,13 @@ function ColorPicker({ type = "text" }) {
|
|
|
7433
7270
|
}
|
|
7434
7271
|
|
|
7435
7272
|
// src/components/tiptap-ui/table-dropdown-menu/table-dropdown-menu.tsx
|
|
7436
|
-
import { useState as
|
|
7273
|
+
import { useState as useState30 } from "react";
|
|
7437
7274
|
import { useCurrentEditor as useCurrentEditor5 } from "@tiptap/react";
|
|
7438
7275
|
import { FiTable } from "react-icons/fi";
|
|
7439
|
-
import { jsx as
|
|
7276
|
+
import { jsx as jsx79, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
7440
7277
|
function TableDropdownMenu() {
|
|
7441
7278
|
const { editor } = useCurrentEditor5();
|
|
7442
|
-
const [open, setOpen] =
|
|
7279
|
+
const [open, setOpen] = useState30(false);
|
|
7443
7280
|
if (!editor) return null;
|
|
7444
7281
|
const handleAction = (action) => {
|
|
7445
7282
|
switch (action) {
|
|
@@ -7478,31 +7315,31 @@ function TableDropdownMenu() {
|
|
|
7478
7315
|
}
|
|
7479
7316
|
setOpen(false);
|
|
7480
7317
|
};
|
|
7481
|
-
return /* @__PURE__ */
|
|
7482
|
-
/* @__PURE__ */
|
|
7483
|
-
/* @__PURE__ */
|
|
7484
|
-
/* @__PURE__ */
|
|
7485
|
-
/* @__PURE__ */
|
|
7486
|
-
/* @__PURE__ */
|
|
7487
|
-
/* @__PURE__ */
|
|
7488
|
-
/* @__PURE__ */
|
|
7489
|
-
/* @__PURE__ */
|
|
7490
|
-
/* @__PURE__ */
|
|
7491
|
-
/* @__PURE__ */
|
|
7492
|
-
/* @__PURE__ */
|
|
7493
|
-
/* @__PURE__ */
|
|
7494
|
-
/* @__PURE__ */
|
|
7495
|
-
/* @__PURE__ */
|
|
7318
|
+
return /* @__PURE__ */ jsxs47(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7319
|
+
/* @__PURE__ */ jsx79(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx79(Button, { variant: "tableButton", size: "sm", children: /* @__PURE__ */ jsx79(FiTable, { size: 16, color: "#a3a3a8" }) }) }),
|
|
7320
|
+
/* @__PURE__ */ jsx79(PopoverContent2, { className: "w-[220px] p-0", align: "start", children: /* @__PURE__ */ jsxs47(Command, { children: [
|
|
7321
|
+
/* @__PURE__ */ jsx79(CommandInput, { placeholder: "Search table actions..." }),
|
|
7322
|
+
/* @__PURE__ */ jsx79(CommandList, { className: "max-h-[260px]", children: /* @__PURE__ */ jsxs47(CommandGroup, { children: [
|
|
7323
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("insert"), children: "Insert Table" }),
|
|
7324
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("addColBefore"), children: "Add Column Before" }),
|
|
7325
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("addColAfter"), children: "Add Column After" }),
|
|
7326
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("delCol"), children: "Delete Column" }),
|
|
7327
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("addRowBefore"), children: "Add Row Before" }),
|
|
7328
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("addRowAfter"), children: "Add Row After" }),
|
|
7329
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("delRow"), children: "Delete Row" }),
|
|
7330
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("merge"), children: "Merge Cells" }),
|
|
7331
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("split"), children: "Split Cells" }),
|
|
7332
|
+
/* @__PURE__ */ jsx79(CommandItem, { onSelect: () => handleAction("deleteTable"), children: "Delete Table" })
|
|
7496
7333
|
] }) })
|
|
7497
7334
|
] }) })
|
|
7498
7335
|
] });
|
|
7499
7336
|
}
|
|
7500
7337
|
|
|
7501
7338
|
// src/components/tiptap-icons/arrow-left-icon.tsx
|
|
7502
|
-
import { memo as
|
|
7503
|
-
import { jsx as
|
|
7504
|
-
var ArrowLeftIcon =
|
|
7505
|
-
return /* @__PURE__ */
|
|
7339
|
+
import { memo as memo39 } from "react";
|
|
7340
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
7341
|
+
var ArrowLeftIcon = memo39(({ className, ...props }) => {
|
|
7342
|
+
return /* @__PURE__ */ jsx80(
|
|
7506
7343
|
"svg",
|
|
7507
7344
|
{
|
|
7508
7345
|
width: "24",
|
|
@@ -7512,7 +7349,7 @@ var ArrowLeftIcon = memo35(({ className, ...props }) => {
|
|
|
7512
7349
|
fill: "currentColor",
|
|
7513
7350
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7514
7351
|
...props,
|
|
7515
|
-
children: /* @__PURE__ */
|
|
7352
|
+
children: /* @__PURE__ */ jsx80(
|
|
7516
7353
|
"path",
|
|
7517
7354
|
{
|
|
7518
7355
|
d: "M12.7071 5.70711C13.0976 5.31658 13.0976 4.68342 12.7071 4.29289C12.3166 3.90237 11.6834 3.90237 11.2929 4.29289L4.29289 11.2929C3.90237 11.6834 3.90237 12.3166 4.29289 12.7071L11.2929 19.7071C11.6834 20.0976 12.3166 20.0976 12.7071 19.7071C13.0976 19.3166 13.0976 18.6834 12.7071 18.2929L7.41421 13L19 13C19.5523 13 20 12.5523 20 12C20 11.4477 19.5523 11 19 11L7.41421 11L12.7071 5.70711Z",
|
|
@@ -7525,15 +7362,15 @@ var ArrowLeftIcon = memo35(({ className, ...props }) => {
|
|
|
7525
7362
|
ArrowLeftIcon.displayName = "ArrowLeftIcon";
|
|
7526
7363
|
|
|
7527
7364
|
// src/hooks/use-window-size.ts
|
|
7528
|
-
import { useEffect as useEffect20, useState as
|
|
7365
|
+
import { useEffect as useEffect20, useState as useState31 } from "react";
|
|
7529
7366
|
|
|
7530
7367
|
// src/hooks/use-throttled-callback.ts
|
|
7531
7368
|
import throttle from "lodash.throttle";
|
|
7532
7369
|
|
|
7533
7370
|
// src/hooks/use-unmount.ts
|
|
7534
|
-
import { useRef as
|
|
7371
|
+
import { useRef as useRef6, useEffect as useEffect19 } from "react";
|
|
7535
7372
|
var useUnmount = (callback) => {
|
|
7536
|
-
const ref =
|
|
7373
|
+
const ref = useRef6(callback);
|
|
7537
7374
|
ref.current = callback;
|
|
7538
7375
|
useEffect19(
|
|
7539
7376
|
() => () => {
|
|
@@ -7544,13 +7381,13 @@ var useUnmount = (callback) => {
|
|
|
7544
7381
|
};
|
|
7545
7382
|
|
|
7546
7383
|
// src/hooks/use-throttled-callback.ts
|
|
7547
|
-
import { useMemo as
|
|
7384
|
+
import { useMemo as useMemo9 } from "react";
|
|
7548
7385
|
var defaultOptions = {
|
|
7549
7386
|
leading: false,
|
|
7550
7387
|
trailing: true
|
|
7551
7388
|
};
|
|
7552
7389
|
function useThrottledCallback(fn, wait = 250, dependencies = [], options = defaultOptions) {
|
|
7553
|
-
const handler =
|
|
7390
|
+
const handler = useMemo9(
|
|
7554
7391
|
() => throttle(fn, wait, options),
|
|
7555
7392
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7556
7393
|
dependencies
|
|
@@ -7563,7 +7400,7 @@ function useThrottledCallback(fn, wait = 250, dependencies = [], options = defau
|
|
|
7563
7400
|
|
|
7564
7401
|
// src/hooks/use-window-size.ts
|
|
7565
7402
|
function useWindowSize() {
|
|
7566
|
-
const [windowSize, setWindowSize] =
|
|
7403
|
+
const [windowSize, setWindowSize] = useState31({
|
|
7567
7404
|
width: 0,
|
|
7568
7405
|
height: 0,
|
|
7569
7406
|
offsetTop: 0,
|
|
@@ -7601,7 +7438,7 @@ function useWindowSize() {
|
|
|
7601
7438
|
}
|
|
7602
7439
|
|
|
7603
7440
|
// src/hooks/use-element-rect.ts
|
|
7604
|
-
import { useCallback as
|
|
7441
|
+
import { useCallback as useCallback28, useEffect as useEffect21, useState as useState32 } from "react";
|
|
7605
7442
|
var initialRect = {
|
|
7606
7443
|
x: 0,
|
|
7607
7444
|
y: 0,
|
|
@@ -7621,8 +7458,8 @@ function useElementRect({
|
|
|
7621
7458
|
throttleMs = 100,
|
|
7622
7459
|
useResizeObserver = true
|
|
7623
7460
|
} = {}) {
|
|
7624
|
-
const [rect, setRect] =
|
|
7625
|
-
const getTargetElement =
|
|
7461
|
+
const [rect, setRect] = useState32(initialRect);
|
|
7462
|
+
const getTargetElement = useCallback28(() => {
|
|
7626
7463
|
if (!enabled || !isClientSide()) return null;
|
|
7627
7464
|
if (!element) {
|
|
7628
7465
|
return document.body;
|
|
@@ -7738,71 +7575,71 @@ function useCursorVisibility({
|
|
|
7738
7575
|
}
|
|
7739
7576
|
|
|
7740
7577
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
7741
|
-
import { Fragment as
|
|
7578
|
+
import { Fragment as Fragment12, jsx as jsx81, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
7742
7579
|
var MainToolbarContent = ({
|
|
7743
7580
|
onHighlighterClick,
|
|
7744
7581
|
onLinkClick,
|
|
7745
7582
|
isMobile
|
|
7746
7583
|
}) => {
|
|
7747
|
-
return /* @__PURE__ */
|
|
7748
|
-
/* @__PURE__ */
|
|
7749
|
-
/* @__PURE__ */
|
|
7750
|
-
/* @__PURE__ */
|
|
7751
|
-
/* @__PURE__ */
|
|
7752
|
-
/* @__PURE__ */
|
|
7753
|
-
/* @__PURE__ */
|
|
7754
|
-
/* @__PURE__ */
|
|
7755
|
-
/* @__PURE__ */
|
|
7756
|
-
/* @__PURE__ */
|
|
7757
|
-
/* @__PURE__ */
|
|
7758
|
-
/* @__PURE__ */
|
|
7584
|
+
return /* @__PURE__ */ jsxs48(Fragment12, { children: [
|
|
7585
|
+
/* @__PURE__ */ jsx81(Spacer, {}),
|
|
7586
|
+
/* @__PURE__ */ jsx81(FontFamilyDropdown, {}),
|
|
7587
|
+
/* @__PURE__ */ jsx81(ColorPicker, { type: "text" }),
|
|
7588
|
+
/* @__PURE__ */ jsxs48(ToolbarGroup, { children: [
|
|
7589
|
+
/* @__PURE__ */ jsx81(MarkButton, { type: "bold" }),
|
|
7590
|
+
/* @__PURE__ */ jsx81(MarkButton, { type: "italic" }),
|
|
7591
|
+
/* @__PURE__ */ jsx81(MarkButton, { type: "strike" }),
|
|
7592
|
+
/* @__PURE__ */ jsx81(MarkButton, { type: "code" }),
|
|
7593
|
+
/* @__PURE__ */ jsx81(MarkButton, { type: "underline" }),
|
|
7594
|
+
/* @__PURE__ */ jsx81(UndoRedoButton, { action: "undo" }),
|
|
7595
|
+
/* @__PURE__ */ jsx81(UndoRedoButton, { action: "redo" })
|
|
7759
7596
|
] }),
|
|
7760
|
-
/* @__PURE__ */
|
|
7761
|
-
/* @__PURE__ */
|
|
7762
|
-
/* @__PURE__ */
|
|
7763
|
-
/* @__PURE__ */
|
|
7764
|
-
/* @__PURE__ */
|
|
7765
|
-
/* @__PURE__ */
|
|
7597
|
+
/* @__PURE__ */ jsx81(ToolbarSeparator, {}),
|
|
7598
|
+
/* @__PURE__ */ jsxs48(ToolbarGroup, { children: [
|
|
7599
|
+
/* @__PURE__ */ jsx81(TextAlignButton, { align: "left" }),
|
|
7600
|
+
/* @__PURE__ */ jsx81(TextAlignButton, { align: "center" }),
|
|
7601
|
+
/* @__PURE__ */ jsx81(TextAlignButton, { align: "right" }),
|
|
7602
|
+
/* @__PURE__ */ jsx81(TextAlignButton, { align: "justify" })
|
|
7766
7603
|
] }),
|
|
7767
|
-
/* @__PURE__ */
|
|
7768
|
-
/* @__PURE__ */
|
|
7769
|
-
/* @__PURE__ */
|
|
7770
|
-
/* @__PURE__ */
|
|
7604
|
+
/* @__PURE__ */ jsx81(ToolbarSeparator, {}),
|
|
7605
|
+
/* @__PURE__ */ jsxs48(ToolbarGroup, { children: [
|
|
7606
|
+
/* @__PURE__ */ jsx81(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
7607
|
+
/* @__PURE__ */ jsx81(
|
|
7771
7608
|
ListDropdownMenu,
|
|
7772
7609
|
{
|
|
7773
7610
|
types: ["bulletList", "orderedList", "taskList"],
|
|
7774
7611
|
portal: isMobile
|
|
7775
7612
|
}
|
|
7776
7613
|
),
|
|
7777
|
-
/* @__PURE__ */
|
|
7614
|
+
/* @__PURE__ */ jsx81(BlockquoteButton, {})
|
|
7778
7615
|
] }),
|
|
7779
|
-
/* @__PURE__ */
|
|
7780
|
-
/* @__PURE__ */
|
|
7781
|
-
/* @__PURE__ */
|
|
7782
|
-
/* @__PURE__ */
|
|
7783
|
-
/* @__PURE__ */
|
|
7784
|
-
isMobile && /* @__PURE__ */
|
|
7616
|
+
/* @__PURE__ */ jsx81(ToolbarGroup, { children: /* @__PURE__ */ jsx81(TableDropdownMenu, {}) }),
|
|
7617
|
+
/* @__PURE__ */ jsx81(ToolbarGroup, {}),
|
|
7618
|
+
/* @__PURE__ */ jsx81(ToolbarSeparator, {}),
|
|
7619
|
+
/* @__PURE__ */ jsx81(ToolbarGroup, { children: /* @__PURE__ */ jsx81(ImageUploadButton, { text: "Add" }) }),
|
|
7620
|
+
/* @__PURE__ */ jsx81(Spacer, {}),
|
|
7621
|
+
isMobile && /* @__PURE__ */ jsx81(ToolbarSeparator, {})
|
|
7785
7622
|
] });
|
|
7786
7623
|
};
|
|
7787
7624
|
var MobileToolbarContent = ({
|
|
7788
7625
|
type,
|
|
7789
7626
|
onBack
|
|
7790
|
-
}) => /* @__PURE__ */
|
|
7791
|
-
/* @__PURE__ */
|
|
7792
|
-
/* @__PURE__ */
|
|
7793
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
7627
|
+
}) => /* @__PURE__ */ jsxs48(Fragment12, { children: [
|
|
7628
|
+
/* @__PURE__ */ jsx81(ToolbarGroup, { children: /* @__PURE__ */ jsxs48(Button2, { "data-style": "ghost", onClick: onBack, children: [
|
|
7629
|
+
/* @__PURE__ */ jsx81(ArrowLeftIcon, { className: "tiptap-button-icon" }),
|
|
7630
|
+
type === "highlighter" ? /* @__PURE__ */ jsx81(HighlighterIcon, { className: "tiptap-button-icon" }) : /* @__PURE__ */ jsx81(LinkIcon, { className: "tiptap-button-icon" })
|
|
7794
7631
|
] }) }),
|
|
7795
|
-
/* @__PURE__ */
|
|
7796
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
7632
|
+
/* @__PURE__ */ jsx81(ToolbarSeparator, {}),
|
|
7633
|
+
type === "highlighter" ? /* @__PURE__ */ jsx81(ColorHighlightPopoverContent, {}) : /* @__PURE__ */ jsx81(LinkContent, {})
|
|
7797
7634
|
] });
|
|
7798
7635
|
function SimpleEditor() {
|
|
7799
7636
|
const { setEditorContent, debouncedSave } = useEditorBridge();
|
|
7800
7637
|
const isMobile = useIsBreakpoint();
|
|
7801
7638
|
const { height } = useWindowSize();
|
|
7802
|
-
const [mobileView, setMobileView] =
|
|
7639
|
+
const [mobileView, setMobileView] = useState33(
|
|
7803
7640
|
"main"
|
|
7804
7641
|
);
|
|
7805
|
-
const toolbarRef =
|
|
7642
|
+
const toolbarRef = useRef7(null);
|
|
7806
7643
|
const editor = useEditor({
|
|
7807
7644
|
immediatelyRender: false,
|
|
7808
7645
|
editorProps: {
|
|
@@ -7903,8 +7740,8 @@ function SimpleEditor() {
|
|
|
7903
7740
|
window.visualViewport?.removeEventListener("scroll", updatePosition);
|
|
7904
7741
|
};
|
|
7905
7742
|
}, []);
|
|
7906
|
-
return /* @__PURE__ */
|
|
7907
|
-
/* @__PURE__ */
|
|
7743
|
+
return /* @__PURE__ */ jsx81("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ jsxs48(EditorContext.Provider, { value: { editor }, children: [
|
|
7744
|
+
/* @__PURE__ */ jsx81(
|
|
7908
7745
|
Toolbar,
|
|
7909
7746
|
{
|
|
7910
7747
|
ref: toolbarRef,
|
|
@@ -7913,14 +7750,14 @@ function SimpleEditor() {
|
|
|
7913
7750
|
bottom: `calc(100% - ${height - rect.y}px)`
|
|
7914
7751
|
} : {}
|
|
7915
7752
|
},
|
|
7916
|
-
children: mobileView === "main" ? /* @__PURE__ */
|
|
7753
|
+
children: mobileView === "main" ? /* @__PURE__ */ jsx81(
|
|
7917
7754
|
MainToolbarContent,
|
|
7918
7755
|
{
|
|
7919
7756
|
onHighlighterClick: () => setMobileView("highlighter"),
|
|
7920
7757
|
onLinkClick: () => setMobileView("link"),
|
|
7921
7758
|
isMobile
|
|
7922
7759
|
}
|
|
7923
|
-
) : /* @__PURE__ */
|
|
7760
|
+
) : /* @__PURE__ */ jsx81(
|
|
7924
7761
|
MobileToolbarContent,
|
|
7925
7762
|
{
|
|
7926
7763
|
type: mobileView === "highlighter" ? "highlighter" : "link",
|
|
@@ -7929,14 +7766,14 @@ function SimpleEditor() {
|
|
|
7929
7766
|
)
|
|
7930
7767
|
}
|
|
7931
7768
|
),
|
|
7932
|
-
/* @__PURE__ */
|
|
7769
|
+
/* @__PURE__ */ jsx81(
|
|
7933
7770
|
EditorContent,
|
|
7934
7771
|
{
|
|
7935
7772
|
editor,
|
|
7936
7773
|
role: "presentation",
|
|
7937
7774
|
autoFocus: true,
|
|
7938
7775
|
className: "simple-editor-content",
|
|
7939
|
-
children: editor && /* @__PURE__ */
|
|
7776
|
+
children: editor && /* @__PURE__ */ jsx81(BubbleMenuInline, {})
|
|
7940
7777
|
}
|
|
7941
7778
|
)
|
|
7942
7779
|
] }) });
|
|
@@ -7944,9 +7781,9 @@ function SimpleEditor() {
|
|
|
7944
7781
|
|
|
7945
7782
|
// src/components/editor/editor.tsx
|
|
7946
7783
|
import clsx2 from "clsx";
|
|
7947
|
-
import { jsx as
|
|
7784
|
+
import { jsx as jsx82 } from "react/jsx-runtime";
|
|
7948
7785
|
function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
7949
|
-
return /* @__PURE__ */
|
|
7786
|
+
return /* @__PURE__ */ jsx82(
|
|
7950
7787
|
"div",
|
|
7951
7788
|
{
|
|
7952
7789
|
className: clsx2(
|
|
@@ -7954,16 +7791,16 @@ function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
|
7954
7791
|
className
|
|
7955
7792
|
),
|
|
7956
7793
|
style,
|
|
7957
|
-
children: /* @__PURE__ */
|
|
7794
|
+
children: /* @__PURE__ */ jsx82(EditorShell, { children: /* @__PURE__ */ jsx82(EditorLayout, { onChange, initialTabs, onTabsChange, children: /* @__PURE__ */ jsx82(SimpleEditor, {}) }) })
|
|
7958
7795
|
}
|
|
7959
7796
|
);
|
|
7960
7797
|
}
|
|
7961
7798
|
|
|
7962
7799
|
// src/hooks/use-scrolling.ts
|
|
7963
|
-
import { useEffect as useEffect24, useState as
|
|
7800
|
+
import { useEffect as useEffect24, useState as useState34 } from "react";
|
|
7964
7801
|
function useScrolling(target, options = {}) {
|
|
7965
7802
|
const { debounce: debounce2 = 150, fallbackToDocument = true } = options;
|
|
7966
|
-
const [isScrolling, setIsScrolling] =
|
|
7803
|
+
const [isScrolling, setIsScrolling] = useState34(false);
|
|
7967
7804
|
useEffect24(() => {
|
|
7968
7805
|
const element = target && typeof Window !== "undefined" && target instanceof Window ? target : target?.current ?? window;
|
|
7969
7806
|
const eventTarget = fallbackToDocument && element === window && typeof document !== "undefined" ? document : element;
|