@mhamz.01/easyflow-texteditor 0.1.80 → 0.1.81
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 +33 -24
- package/dist/index.css.map +1 -1
- package/dist/index.js +1263 -1103
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1137 -977
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -80,16 +80,35 @@ 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
|
+
|
|
83
102
|
// src/components/ui/separator.tsx
|
|
84
103
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
85
|
-
import { jsx as
|
|
104
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
86
105
|
function Separator({
|
|
87
106
|
className,
|
|
88
107
|
orientation = "horizontal",
|
|
89
108
|
decorative = true,
|
|
90
109
|
...props
|
|
91
110
|
}) {
|
|
92
|
-
return /* @__PURE__ */
|
|
111
|
+
return /* @__PURE__ */ jsx3(
|
|
93
112
|
SeparatorPrimitive.Root,
|
|
94
113
|
{
|
|
95
114
|
"data-slot": "separator",
|
|
@@ -107,20 +126,20 @@ function Separator({
|
|
|
107
126
|
// src/components/ui/sheet.tsx
|
|
108
127
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
109
128
|
import { XIcon } from "lucide-react";
|
|
110
|
-
import { jsx as
|
|
129
|
+
import { jsx as jsx4, jsxs } from "react/jsx-runtime";
|
|
111
130
|
function Sheet({ ...props }) {
|
|
112
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ jsx4(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
113
132
|
}
|
|
114
133
|
function SheetPortal({
|
|
115
134
|
...props
|
|
116
135
|
}) {
|
|
117
|
-
return /* @__PURE__ */
|
|
136
|
+
return /* @__PURE__ */ jsx4(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
118
137
|
}
|
|
119
138
|
function SheetOverlay({
|
|
120
139
|
className,
|
|
121
140
|
...props
|
|
122
141
|
}) {
|
|
123
|
-
return /* @__PURE__ */
|
|
142
|
+
return /* @__PURE__ */ jsx4(
|
|
124
143
|
SheetPrimitive.Overlay,
|
|
125
144
|
{
|
|
126
145
|
"data-slot": "sheet-overlay",
|
|
@@ -139,7 +158,7 @@ function SheetContent({
|
|
|
139
158
|
...props
|
|
140
159
|
}) {
|
|
141
160
|
return /* @__PURE__ */ jsxs(SheetPortal, { children: [
|
|
142
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ jsx4(SheetOverlay, {}),
|
|
143
162
|
/* @__PURE__ */ jsxs(
|
|
144
163
|
SheetPrimitive.Content,
|
|
145
164
|
{
|
|
@@ -156,8 +175,8 @@ function SheetContent({
|
|
|
156
175
|
children: [
|
|
157
176
|
children,
|
|
158
177
|
/* @__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: [
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
/* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ jsx4(XIcon, { className: "size-4" }),
|
|
179
|
+
/* @__PURE__ */ jsx4("span", { className: "sr-only", children: "Close" })
|
|
161
180
|
] })
|
|
162
181
|
]
|
|
163
182
|
}
|
|
@@ -165,7 +184,7 @@ function SheetContent({
|
|
|
165
184
|
] });
|
|
166
185
|
}
|
|
167
186
|
function SheetHeader({ className, ...props }) {
|
|
168
|
-
return /* @__PURE__ */
|
|
187
|
+
return /* @__PURE__ */ jsx4(
|
|
169
188
|
"div",
|
|
170
189
|
{
|
|
171
190
|
"data-slot": "sheet-header",
|
|
@@ -178,7 +197,7 @@ function SheetTitle({
|
|
|
178
197
|
className,
|
|
179
198
|
...props
|
|
180
199
|
}) {
|
|
181
|
-
return /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ jsx4(
|
|
182
201
|
SheetPrimitive.Title,
|
|
183
202
|
{
|
|
184
203
|
"data-slot": "sheet-title",
|
|
@@ -191,7 +210,7 @@ function SheetDescription({
|
|
|
191
210
|
className,
|
|
192
211
|
...props
|
|
193
212
|
}) {
|
|
194
|
-
return /* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ jsx4(
|
|
195
214
|
SheetPrimitive.Description,
|
|
196
215
|
{
|
|
197
216
|
"data-slot": "sheet-description",
|
|
@@ -203,12 +222,12 @@ function SheetDescription({
|
|
|
203
222
|
|
|
204
223
|
// src/components/ui/tooltip.tsx
|
|
205
224
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
206
|
-
import { jsx as
|
|
225
|
+
import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
207
226
|
function TooltipProvider({
|
|
208
227
|
delayDuration = 0,
|
|
209
228
|
...props
|
|
210
229
|
}) {
|
|
211
|
-
return /* @__PURE__ */
|
|
230
|
+
return /* @__PURE__ */ jsx5(
|
|
212
231
|
TooltipPrimitive.Provider,
|
|
213
232
|
{
|
|
214
233
|
"data-slot": "tooltip-provider",
|
|
@@ -219,7 +238,7 @@ function TooltipProvider({
|
|
|
219
238
|
}
|
|
220
239
|
|
|
221
240
|
// src/components/ui/sidebar.tsx
|
|
222
|
-
import { jsx as
|
|
241
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
223
242
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
224
243
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
225
244
|
var SIDEBAR_WIDTH = "16rem";
|
|
@@ -274,7 +293,7 @@ function SidebarProvider({
|
|
|
274
293
|
}),
|
|
275
294
|
[state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
|
|
276
295
|
);
|
|
277
|
-
return /* @__PURE__ */
|
|
296
|
+
return /* @__PURE__ */ jsx6(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx6(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx6(
|
|
278
297
|
"div",
|
|
279
298
|
{
|
|
280
299
|
"data-slot": "sidebar-wrapper",
|
|
@@ -303,7 +322,7 @@ function Sidebar({
|
|
|
303
322
|
}) {
|
|
304
323
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
305
324
|
if (collapsible === "none") {
|
|
306
|
-
return /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ jsx6(
|
|
307
326
|
"div",
|
|
308
327
|
{
|
|
309
328
|
"data-slot": "sidebar",
|
|
@@ -317,7 +336,7 @@ function Sidebar({
|
|
|
317
336
|
);
|
|
318
337
|
}
|
|
319
338
|
if (isMobile) {
|
|
320
|
-
return /* @__PURE__ */
|
|
339
|
+
return /* @__PURE__ */ jsx6(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs3(
|
|
321
340
|
SheetContent,
|
|
322
341
|
{
|
|
323
342
|
"data-sidebar": "sidebar",
|
|
@@ -330,10 +349,10 @@ function Sidebar({
|
|
|
330
349
|
side,
|
|
331
350
|
children: [
|
|
332
351
|
/* @__PURE__ */ jsxs3(SheetHeader, { className: "sr-only", children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ jsx6(SheetTitle, { children: "Sidebar" }),
|
|
353
|
+
/* @__PURE__ */ jsx6(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
335
354
|
] }),
|
|
336
|
-
/* @__PURE__ */
|
|
355
|
+
/* @__PURE__ */ jsx6("div", { className: "flex h-full w-full flex-col", children })
|
|
337
356
|
]
|
|
338
357
|
}
|
|
339
358
|
) });
|
|
@@ -348,7 +367,7 @@ function Sidebar({
|
|
|
348
367
|
"data-side": side,
|
|
349
368
|
"data-slot": "sidebar",
|
|
350
369
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ jsx6(
|
|
352
371
|
"div",
|
|
353
372
|
{
|
|
354
373
|
"data-slot": "sidebar-gap",
|
|
@@ -360,7 +379,7 @@ function Sidebar({
|
|
|
360
379
|
)
|
|
361
380
|
}
|
|
362
381
|
),
|
|
363
|
-
/* @__PURE__ */
|
|
382
|
+
/* @__PURE__ */ jsx6(
|
|
364
383
|
"div",
|
|
365
384
|
{
|
|
366
385
|
"data-slot": "sidebar-container",
|
|
@@ -373,7 +392,7 @@ function Sidebar({
|
|
|
373
392
|
className
|
|
374
393
|
),
|
|
375
394
|
...props,
|
|
376
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ jsx6(
|
|
377
396
|
"div",
|
|
378
397
|
{
|
|
379
398
|
"data-sidebar": "sidebar",
|
|
@@ -408,14 +427,14 @@ function SidebarTrigger({
|
|
|
408
427
|
},
|
|
409
428
|
...props,
|
|
410
429
|
children: [
|
|
411
|
-
/* @__PURE__ */
|
|
412
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ jsx6(PanelLeftIcon, { color: "white" }),
|
|
431
|
+
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
413
432
|
]
|
|
414
433
|
}
|
|
415
434
|
);
|
|
416
435
|
}
|
|
417
436
|
function SidebarInset({ className, ...props }) {
|
|
418
|
-
return /* @__PURE__ */
|
|
437
|
+
return /* @__PURE__ */ jsx6(
|
|
419
438
|
"main",
|
|
420
439
|
{
|
|
421
440
|
"data-slot": "sidebar-inset",
|
|
@@ -429,7 +448,7 @@ function SidebarInset({ className, ...props }) {
|
|
|
429
448
|
);
|
|
430
449
|
}
|
|
431
450
|
function SidebarContent({ className, ...props }) {
|
|
432
|
-
return /* @__PURE__ */
|
|
451
|
+
return /* @__PURE__ */ jsx6(
|
|
433
452
|
"div",
|
|
434
453
|
{
|
|
435
454
|
"data-slot": "sidebar-content",
|
|
@@ -443,7 +462,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
443
462
|
);
|
|
444
463
|
}
|
|
445
464
|
function SidebarGroup({ className, ...props }) {
|
|
446
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ jsx6(
|
|
447
466
|
"div",
|
|
448
467
|
{
|
|
449
468
|
"data-slot": "sidebar-group",
|
|
@@ -459,7 +478,7 @@ function SidebarGroupLabel({
|
|
|
459
478
|
...props
|
|
460
479
|
}) {
|
|
461
480
|
const Comp = asChild ? Slot2 : "div";
|
|
462
|
-
return /* @__PURE__ */
|
|
481
|
+
return /* @__PURE__ */ jsx6(
|
|
463
482
|
Comp,
|
|
464
483
|
{
|
|
465
484
|
"data-slot": "sidebar-group-label",
|
|
@@ -474,7 +493,7 @@ function SidebarGroupLabel({
|
|
|
474
493
|
);
|
|
475
494
|
}
|
|
476
495
|
function SidebarMenu({ className, ...props }) {
|
|
477
|
-
return /* @__PURE__ */
|
|
496
|
+
return /* @__PURE__ */ jsx6(
|
|
478
497
|
"ul",
|
|
479
498
|
{
|
|
480
499
|
"data-slot": "sidebar-menu",
|
|
@@ -485,7 +504,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
485
504
|
);
|
|
486
505
|
}
|
|
487
506
|
function SidebarMenuItem({ className, ...props }) {
|
|
488
|
-
return /* @__PURE__ */
|
|
507
|
+
return /* @__PURE__ */ jsx6(
|
|
489
508
|
"li",
|
|
490
509
|
{
|
|
491
510
|
"data-slot": "sidebar-menu-item",
|
|
@@ -517,151 +536,101 @@ var sidebarMenuButtonVariants = cva2(
|
|
|
517
536
|
);
|
|
518
537
|
|
|
519
538
|
// src/components/editor-shell/EditorShell.tsx
|
|
520
|
-
import { jsx as
|
|
539
|
+
import { jsx as jsx7 } from "react/jsx-runtime";
|
|
521
540
|
function EditorShell({ children }) {
|
|
522
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ jsx7(
|
|
523
542
|
"div",
|
|
524
543
|
{
|
|
525
544
|
className: "\r\n relative w-full h-full flex flex-col min-h-0 isolate\r\n ",
|
|
526
545
|
"data-easyflow-editor": true,
|
|
527
|
-
children: /* @__PURE__ */
|
|
546
|
+
children: /* @__PURE__ */ jsx7(SidebarProvider, { children })
|
|
528
547
|
}
|
|
529
548
|
);
|
|
530
549
|
}
|
|
531
550
|
|
|
532
551
|
// src/components/editorLayout/editorLayout.tsx
|
|
533
|
-
import { useState as
|
|
552
|
+
import { useState as useState4, useEffect as useEffect2, useRef as useRef2, useCallback as useCallback3, useMemo as useMemo3 } from "react";
|
|
534
553
|
|
|
535
554
|
// src/components/sidebar/EditorSidebar.tsx
|
|
536
|
-
import { memo as memo5 } from "react";
|
|
537
|
-
import { Plus } from "lucide-react";
|
|
538
|
-
import { AnimatePresence as AnimatePresence2 } from "framer-motion";
|
|
539
|
-
|
|
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
555
|
import { useState as useState3, memo, useCallback as useCallback2 } from "react";
|
|
547
|
-
import {
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
556
|
+
import { MoreHorizontal, Plus, FileText } from "lucide-react";
|
|
557
|
+
import { motion, AnimatePresence } from "framer-motion";
|
|
558
|
+
|
|
559
|
+
// src/components/ui/dropdown-menu.tsx
|
|
560
|
+
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
561
|
+
import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
|
|
562
|
+
import { jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
563
|
+
function DropdownMenu({
|
|
564
|
+
...props
|
|
553
565
|
}) {
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
e.preventDefault();
|
|
562
|
-
handleCommit();
|
|
563
|
-
} else if (e.key === "Escape") {
|
|
564
|
-
e.preventDefault();
|
|
565
|
-
onCancel();
|
|
566
|
-
}
|
|
567
|
-
},
|
|
568
|
-
[handleCommit, onCancel]
|
|
569
|
-
);
|
|
570
|
-
return /* @__PURE__ */ jsx7(
|
|
571
|
-
"input",
|
|
566
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Root, { "data-slot": "dropdown-menu", ...props });
|
|
567
|
+
}
|
|
568
|
+
function DropdownMenuTrigger({
|
|
569
|
+
...props
|
|
570
|
+
}) {
|
|
571
|
+
return /* @__PURE__ */ jsx8(
|
|
572
|
+
DropdownMenuPrimitive.Trigger,
|
|
572
573
|
{
|
|
573
|
-
|
|
574
|
-
|
|
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()
|
|
574
|
+
"data-slot": "dropdown-menu-trigger",
|
|
575
|
+
...props
|
|
581
576
|
}
|
|
582
577
|
);
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
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
|
|
578
|
+
}
|
|
579
|
+
function DropdownMenuContent({
|
|
580
|
+
className,
|
|
581
|
+
sideOffset = 4,
|
|
582
|
+
...props
|
|
593
583
|
}) {
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
"
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
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
|
-
}
|
|
584
|
+
return /* @__PURE__ */ jsx8(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx8(
|
|
585
|
+
DropdownMenuPrimitive.Content,
|
|
586
|
+
{
|
|
587
|
+
"data-slot": "dropdown-menu-content",
|
|
588
|
+
sideOffset,
|
|
589
|
+
className: cn(
|
|
590
|
+
"bg-[#171717] text-[#a1a1a5] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-[10px] border-[#e8e8fd0d] border p-1 shadow-md",
|
|
591
|
+
className
|
|
615
592
|
),
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
)
|
|
641
|
-
] })
|
|
642
|
-
] })
|
|
643
|
-
] });
|
|
644
|
-
});
|
|
645
|
-
|
|
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";
|
|
593
|
+
...props
|
|
594
|
+
}
|
|
595
|
+
) });
|
|
596
|
+
}
|
|
597
|
+
function DropdownMenuItem({
|
|
598
|
+
className,
|
|
599
|
+
inset,
|
|
600
|
+
variant = "default",
|
|
601
|
+
...props
|
|
602
|
+
}) {
|
|
603
|
+
return /* @__PURE__ */ jsx8(
|
|
604
|
+
DropdownMenuPrimitive.Item,
|
|
605
|
+
{
|
|
606
|
+
"data-slot": "dropdown-menu-item",
|
|
607
|
+
"data-inset": inset,
|
|
608
|
+
"data-variant": variant,
|
|
609
|
+
className: cn(
|
|
610
|
+
"focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
611
|
+
className
|
|
612
|
+
),
|
|
613
|
+
...props
|
|
614
|
+
}
|
|
615
|
+
);
|
|
616
|
+
}
|
|
650
617
|
|
|
651
|
-
// src/
|
|
618
|
+
// src/components/sidebar/EditorSidebar.tsx
|
|
619
|
+
import { ChevronRight } from "lucide-react";
|
|
620
|
+
import { jsx as jsx9, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
652
621
|
var tabVariants = {
|
|
653
622
|
initial: { opacity: 0, x: -20, height: 0 },
|
|
654
623
|
animate: {
|
|
655
624
|
opacity: 1,
|
|
656
625
|
x: 0,
|
|
657
626
|
height: "auto",
|
|
658
|
-
transition: { duration: 0.
|
|
627
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
659
628
|
},
|
|
660
629
|
exit: {
|
|
661
630
|
opacity: 0,
|
|
662
631
|
x: -20,
|
|
663
632
|
height: 0,
|
|
664
|
-
transition: { duration: 0.
|
|
633
|
+
transition: { duration: 0.2, ease: "easeIn" }
|
|
665
634
|
}
|
|
666
635
|
};
|
|
667
636
|
var subtabVariants = {
|
|
@@ -670,45 +639,176 @@ var subtabVariants = {
|
|
|
670
639
|
opacity: 1,
|
|
671
640
|
x: 0,
|
|
672
641
|
height: "auto",
|
|
673
|
-
transition: { duration: 0.
|
|
642
|
+
transition: { duration: 0.25, ease: "easeOut" }
|
|
674
643
|
},
|
|
675
644
|
exit: {
|
|
676
645
|
opacity: 0,
|
|
677
646
|
x: -10,
|
|
678
647
|
height: 0,
|
|
679
|
-
transition: { duration: 0.
|
|
648
|
+
transition: { duration: 0.15, ease: "easeIn" }
|
|
680
649
|
}
|
|
681
650
|
};
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
651
|
+
var SubTabTitle = memo(function SubTabTitle2({
|
|
652
|
+
isEditing,
|
|
653
|
+
title,
|
|
654
|
+
tempTitle,
|
|
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(
|
|
686
776
|
function SubTabItem2({
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
777
|
+
tab,
|
|
778
|
+
st,
|
|
779
|
+
activeSubTabId,
|
|
780
|
+
editingSubId,
|
|
781
|
+
tempTitle,
|
|
690
782
|
onSelect,
|
|
691
|
-
|
|
692
|
-
|
|
783
|
+
startRenameSubTab,
|
|
784
|
+
commitRenameSubTab,
|
|
785
|
+
setEditingSubId,
|
|
786
|
+
setTempTitle,
|
|
787
|
+
onDeleteSubTab
|
|
693
788
|
}) {
|
|
694
|
-
const
|
|
695
|
-
const
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
);
|
|
702
|
-
const handleCommit =
|
|
703
|
-
(
|
|
704
|
-
|
|
705
|
-
|
|
789
|
+
const isActiveSubTab = st.id === activeSubTabId;
|
|
790
|
+
const isEditing = editingSubId === st.id;
|
|
791
|
+
const handleSelect = useCallback2(() => {
|
|
792
|
+
onSelect(tab.id, st.id);
|
|
793
|
+
}, [onSelect, tab.id, st.id]);
|
|
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);
|
|
706
806
|
},
|
|
707
|
-
[
|
|
807
|
+
[setTempTitle]
|
|
708
808
|
);
|
|
709
|
-
const handleCancel =
|
|
710
|
-
|
|
711
|
-
}, []);
|
|
809
|
+
const handleCancel = useCallback2(() => {
|
|
810
|
+
setEditingSubId(null);
|
|
811
|
+
}, [setEditingSubId]);
|
|
712
812
|
return /* @__PURE__ */ jsxs5(
|
|
713
813
|
motion.div,
|
|
714
814
|
{
|
|
@@ -719,191 +819,206 @@ var SubTabItem = memo3(
|
|
|
719
819
|
layout: true,
|
|
720
820
|
className: `
|
|
721
821
|
group ml-9 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm
|
|
722
|
-
transition-
|
|
723
|
-
${
|
|
822
|
+
transition-all duration-200 ease-in-out
|
|
823
|
+
${isActiveSubTab ? "bg-accent" : "hover:bg-accent/50"}
|
|
724
824
|
`,
|
|
725
825
|
children: [
|
|
726
826
|
/* @__PURE__ */ jsx9(
|
|
727
827
|
FileText,
|
|
728
828
|
{
|
|
729
829
|
size: 14,
|
|
730
|
-
className: `flex-shrink-0 transition-
|
|
830
|
+
className: `flex-shrink-0 transition-all duration-200 ${isActiveSubTab ? "opacity-100" : "opacity-50 group-hover:opacity-100"}`
|
|
731
831
|
}
|
|
732
832
|
),
|
|
733
|
-
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children:
|
|
734
|
-
|
|
833
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx9(
|
|
834
|
+
SubTabTitle,
|
|
735
835
|
{
|
|
736
|
-
|
|
836
|
+
isEditing,
|
|
837
|
+
title: st.title,
|
|
838
|
+
tempTitle,
|
|
839
|
+
onTitleChange: handleTitleChange,
|
|
840
|
+
onStartEdit: handleEdit,
|
|
737
841
|
onCommit: handleCommit,
|
|
738
842
|
onCancel: handleCancel,
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
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
|
|
843
|
+
onSelect: handleSelect,
|
|
844
|
+
tabId: tab.id,
|
|
845
|
+
subTabId: st.id
|
|
748
846
|
}
|
|
749
847
|
) }),
|
|
750
|
-
/* @__PURE__ */ jsx9(
|
|
848
|
+
/* @__PURE__ */ jsx9(SubTabMenu, { onDelete: handleDelete })
|
|
751
849
|
]
|
|
752
|
-
}
|
|
850
|
+
},
|
|
851
|
+
st.id
|
|
753
852
|
);
|
|
754
853
|
},
|
|
755
|
-
(
|
|
854
|
+
(prevProps, nextProps) => {
|
|
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
|
+
}
|
|
756
857
|
);
|
|
757
|
-
|
|
758
|
-
// src/components/sidebar/tabItem.tsx
|
|
759
|
-
import { jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
760
|
-
var TabItem = memo4(
|
|
858
|
+
var TabItem = memo(
|
|
761
859
|
function TabItem2({
|
|
762
860
|
tab,
|
|
763
|
-
|
|
764
|
-
hasActiveSubTab,
|
|
861
|
+
activeTabId,
|
|
765
862
|
activeSubTabId,
|
|
766
|
-
|
|
863
|
+
canDeleteTab,
|
|
864
|
+
editingId,
|
|
865
|
+
editingSubId,
|
|
866
|
+
tempTitle,
|
|
867
|
+
openTabs,
|
|
767
868
|
onSelect,
|
|
768
|
-
onRename,
|
|
769
|
-
onDelete,
|
|
770
869
|
onAddSubTab,
|
|
870
|
+
onDelete,
|
|
871
|
+
startRenameTab,
|
|
872
|
+
startRenameSubTab,
|
|
873
|
+
commitRenameTab,
|
|
874
|
+
commitRenameSubTab,
|
|
875
|
+
setEditingId,
|
|
876
|
+
setEditingSubId,
|
|
877
|
+
setTempTitle,
|
|
878
|
+
toggleTabOpen,
|
|
771
879
|
onRenameSubTab,
|
|
772
|
-
onDeleteSubTab
|
|
880
|
+
onDeleteSubTab,
|
|
881
|
+
setOpenTabs
|
|
773
882
|
}) {
|
|
774
|
-
const
|
|
775
|
-
const [isOpen, setIsOpen] = useState6(hasActiveSubTab);
|
|
883
|
+
const isOpen = openTabs[tab.id];
|
|
776
884
|
const hasSubtabs = tab.subtabs.length > 0;
|
|
777
|
-
const
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
885
|
+
const isActiveTab = tab.id === activeTabId && !activeSubTabId;
|
|
886
|
+
const isEditing = editingId === tab.id;
|
|
887
|
+
const handleSelect = useCallback2(() => {
|
|
888
|
+
onSelect(tab.id);
|
|
889
|
+
}, [onSelect, tab.id]);
|
|
890
|
+
const handleEdit = useCallback2(() => {
|
|
891
|
+
startRenameTab(tab.id, tab.title);
|
|
892
|
+
}, [startRenameTab, tab.id, tab.title]);
|
|
893
|
+
const handleCommit = useCallback2(() => {
|
|
894
|
+
commitRenameTab();
|
|
895
|
+
}, [commitRenameTab]);
|
|
896
|
+
const handleTitleChange = useCallback2(
|
|
897
|
+
(val) => {
|
|
898
|
+
setTempTitle(val);
|
|
788
899
|
},
|
|
789
|
-
[
|
|
900
|
+
[setTempTitle]
|
|
790
901
|
);
|
|
791
|
-
const handleCancel =
|
|
792
|
-
|
|
793
|
-
}, []);
|
|
794
|
-
const
|
|
902
|
+
const handleCancel = useCallback2(() => {
|
|
903
|
+
setEditingId(null);
|
|
904
|
+
}, [setEditingId]);
|
|
905
|
+
const handleAddSubTab = useCallback2(() => {
|
|
906
|
+
onAddSubTab(tab.id);
|
|
907
|
+
setOpenTabs((prev) => ({
|
|
908
|
+
...prev,
|
|
909
|
+
[tab.id]: true
|
|
910
|
+
}));
|
|
911
|
+
}, [onAddSubTab, tab.id, setOpenTabs]);
|
|
912
|
+
const handleToggle = useCallback2(
|
|
795
913
|
(e) => {
|
|
796
914
|
e.stopPropagation();
|
|
797
|
-
|
|
915
|
+
toggleTabOpen(tab.id);
|
|
798
916
|
},
|
|
799
|
-
[]
|
|
917
|
+
[toggleTabOpen, tab.id]
|
|
800
918
|
);
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
setIsOpen(true);
|
|
807
|
-
}
|
|
808
|
-
return /* @__PURE__ */ jsxs6(
|
|
809
|
-
motion2.div,
|
|
919
|
+
const handleDelete = useCallback2(() => {
|
|
920
|
+
onDelete(tab.id);
|
|
921
|
+
}, [onDelete, tab.id]);
|
|
922
|
+
return /* @__PURE__ */ jsx9(
|
|
923
|
+
motion.div,
|
|
810
924
|
{
|
|
811
925
|
variants: tabVariants,
|
|
812
926
|
initial: "initial",
|
|
813
927
|
animate: "animate",
|
|
814
928
|
exit: "exit",
|
|
815
929
|
layout: true,
|
|
816
|
-
children: [
|
|
817
|
-
/* @__PURE__ */
|
|
930
|
+
children: /* @__PURE__ */ jsxs5(SidebarMenuItem, { className: "list-none", children: [
|
|
931
|
+
/* @__PURE__ */ jsxs5(
|
|
818
932
|
"div",
|
|
819
933
|
{
|
|
820
934
|
className: `
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
935
|
+
group flex items-center gap-2 rounded-md px-2 py-1.5
|
|
936
|
+
transition-all duration-200 ease-in-out
|
|
937
|
+
${isActiveTab ? "bg-accent" : "hover:bg-accent/50"}
|
|
938
|
+
`,
|
|
825
939
|
children: [
|
|
826
|
-
hasSubtabs && /* @__PURE__ */
|
|
940
|
+
hasSubtabs && /* @__PURE__ */ jsx9(
|
|
827
941
|
"button",
|
|
828
942
|
{
|
|
829
943
|
onClick: handleToggle,
|
|
830
|
-
className: "flex h-5 w-5 items-center justify-center rounded transition-all duration-
|
|
831
|
-
"aria-label": isOpen ? "Collapse" : "Expand",
|
|
832
|
-
children: /* @__PURE__ */
|
|
944
|
+
className: "flex h-5 w-5 items-center justify-center rounded transition-all duration-200 hover:bg-accent/80",
|
|
945
|
+
"aria-label": isOpen ? "Collapse subtabs" : "Expand subtabs",
|
|
946
|
+
children: /* @__PURE__ */ jsx9(
|
|
833
947
|
ChevronRight,
|
|
834
948
|
{
|
|
835
949
|
size: 14,
|
|
836
|
-
className: `transition-transform duration-
|
|
950
|
+
className: `transition-transform duration-300 ease-in-out ${isOpen ? "rotate-90" : ""}`
|
|
837
951
|
}
|
|
838
952
|
)
|
|
839
953
|
}
|
|
840
954
|
),
|
|
841
|
-
/* @__PURE__ */
|
|
842
|
-
|
|
955
|
+
/* @__PURE__ */ jsx9(
|
|
956
|
+
FileText,
|
|
843
957
|
{
|
|
844
958
|
size: 16,
|
|
845
|
-
className: `flex-shrink-0 transition-
|
|
959
|
+
className: `flex-shrink-0 transition-all duration-200 ${hasSubtabs ? "" : "ml-5"} ${isActiveTab ? "opacity-100" : "opacity-60 group-hover:opacity-100"}`
|
|
846
960
|
}
|
|
847
961
|
),
|
|
848
|
-
/* @__PURE__ */
|
|
849
|
-
|
|
962
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx9(
|
|
963
|
+
TabTitle,
|
|
850
964
|
{
|
|
851
|
-
|
|
965
|
+
isEditing,
|
|
966
|
+
title: tab.title,
|
|
967
|
+
tempTitle,
|
|
968
|
+
onTitleChange: handleTitleChange,
|
|
969
|
+
onStartEdit: handleEdit,
|
|
852
970
|
onCommit: handleCommit,
|
|
853
971
|
onCancel: handleCancel,
|
|
854
|
-
|
|
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
|
|
972
|
+
onSelect: handleSelect
|
|
863
973
|
}
|
|
864
974
|
) }),
|
|
865
|
-
/* @__PURE__ */
|
|
866
|
-
|
|
975
|
+
/* @__PURE__ */ jsx9(
|
|
976
|
+
TabMenu,
|
|
867
977
|
{
|
|
868
|
-
canDelete,
|
|
978
|
+
canDelete: canDeleteTab,
|
|
869
979
|
onAddSubTab: handleAddSubTab,
|
|
870
|
-
onDelete
|
|
980
|
+
onDelete: handleDelete
|
|
871
981
|
}
|
|
872
982
|
)
|
|
873
983
|
]
|
|
874
984
|
}
|
|
875
985
|
),
|
|
876
|
-
hasSubtabs && /* @__PURE__ */
|
|
986
|
+
hasSubtabs && /* @__PURE__ */ jsx9(
|
|
877
987
|
"div",
|
|
878
988
|
{
|
|
879
989
|
className: `
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
children: /* @__PURE__ */
|
|
990
|
+
grid transition-all duration-300 ease-in-out
|
|
991
|
+
${isOpen ? "grid-rows-[1fr] opacity-100" : "grid-rows-[0fr] opacity-0"}
|
|
992
|
+
`,
|
|
993
|
+
children: /* @__PURE__ */ jsx9("div", { className: "overflow-hidden", children: /* @__PURE__ */ jsx9("div", { className: "pt-1 space-y-1", children: /* @__PURE__ */ jsx9(AnimatePresence, { mode: "popLayout", children: tab.subtabs.map((st) => /* @__PURE__ */ jsx9(
|
|
884
994
|
SubTabItem,
|
|
885
995
|
{
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
996
|
+
tab,
|
|
997
|
+
st,
|
|
998
|
+
activeSubTabId,
|
|
999
|
+
editingSubId,
|
|
1000
|
+
tempTitle,
|
|
1001
|
+
onSelect,
|
|
1002
|
+
startRenameSubTab,
|
|
1003
|
+
commitRenameSubTab,
|
|
1004
|
+
setEditingSubId,
|
|
1005
|
+
setTempTitle,
|
|
1006
|
+
onDeleteSubTab
|
|
892
1007
|
},
|
|
893
|
-
|
|
1008
|
+
st.id
|
|
894
1009
|
)) }) }) })
|
|
895
1010
|
}
|
|
896
1011
|
)
|
|
897
|
-
]
|
|
898
|
-
}
|
|
1012
|
+
] })
|
|
1013
|
+
},
|
|
1014
|
+
tab.id
|
|
899
1015
|
);
|
|
900
1016
|
},
|
|
901
|
-
(
|
|
1017
|
+
(prevProps, nextProps) => {
|
|
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
|
+
}
|
|
902
1020
|
);
|
|
903
|
-
|
|
904
|
-
// src/components/sidebar/EditorSidebar.tsx
|
|
905
|
-
import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
906
|
-
var AppSidebar = memo5(
|
|
1021
|
+
var AppSidebar = memo(
|
|
907
1022
|
function AppSidebar2({
|
|
908
1023
|
tabs,
|
|
909
1024
|
activeTabId,
|
|
@@ -917,35 +1032,80 @@ var AppSidebar = memo5(
|
|
|
917
1032
|
onRenameSubTab,
|
|
918
1033
|
onDeleteSubTab
|
|
919
1034
|
}) {
|
|
920
|
-
|
|
921
|
-
|
|
1035
|
+
const [editingId, setEditingId] = useState3(null);
|
|
1036
|
+
const [editingSubId, setEditingSubId] = useState3(null);
|
|
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: [
|
|
922
1070
|
"Documents",
|
|
923
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ jsx9(
|
|
924
1072
|
"button",
|
|
925
1073
|
{
|
|
926
1074
|
onClick: onAddTab,
|
|
927
|
-
className: "rounded p-1 transition-all duration-
|
|
1075
|
+
className: "rounded p-1 transition-all duration-200 hover:bg-accent hover:scale-110",
|
|
928
1076
|
"aria-label": "Add new document",
|
|
929
|
-
children: /* @__PURE__ */
|
|
1077
|
+
children: /* @__PURE__ */ jsx9(Plus, { size: 16 })
|
|
930
1078
|
}
|
|
931
1079
|
)
|
|
932
1080
|
] }),
|
|
933
|
-
/* @__PURE__ */
|
|
1081
|
+
/* @__PURE__ */ jsx9(SidebarMenu, { children: /* @__PURE__ */ jsx9(AnimatePresence, { mode: "popLayout", children: tabs.map((tab) => /* @__PURE__ */ jsx9(
|
|
934
1082
|
TabItem,
|
|
935
1083
|
{
|
|
936
1084
|
tab,
|
|
937
|
-
|
|
938
|
-
hasActiveSubTab: tab.id === activeTabId && activeSubTabId !== null,
|
|
1085
|
+
activeTabId,
|
|
939
1086
|
activeSubTabId,
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
1087
|
+
canDeleteTab,
|
|
1088
|
+
editingId,
|
|
1089
|
+
editingSubId,
|
|
1090
|
+
tempTitle,
|
|
1091
|
+
openTabs,
|
|
1092
|
+
onSelect,
|
|
1093
|
+
onAddSubTab,
|
|
1094
|
+
onDelete,
|
|
1095
|
+
startRenameTab,
|
|
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
|
+
)) }) })
|
|
949
1109
|
] }) }) });
|
|
950
1110
|
},
|
|
951
1111
|
(prevProps, nextProps) => {
|
|
@@ -955,7 +1115,7 @@ var AppSidebar = memo5(
|
|
|
955
1115
|
|
|
956
1116
|
// src/contexts/EditorBridge.tsx
|
|
957
1117
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
958
|
-
import { jsx as
|
|
1118
|
+
import { jsx as jsx10 } from "react/jsx-runtime";
|
|
959
1119
|
var EditorBridgeContext = createContext2(
|
|
960
1120
|
void 0
|
|
961
1121
|
);
|
|
@@ -963,7 +1123,7 @@ function EditorBridgeProvider({
|
|
|
963
1123
|
children,
|
|
964
1124
|
value
|
|
965
1125
|
}) {
|
|
966
|
-
return /* @__PURE__ */
|
|
1126
|
+
return /* @__PURE__ */ jsx10(EditorBridgeContext.Provider, { value, children });
|
|
967
1127
|
}
|
|
968
1128
|
function useEditorBridge() {
|
|
969
1129
|
const ctx = useContext2(EditorBridgeContext);
|
|
@@ -975,42 +1135,42 @@ function useEditorBridge() {
|
|
|
975
1135
|
|
|
976
1136
|
// src/contexts/EditorStateProvider.tsx
|
|
977
1137
|
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
978
|
-
import { jsx as
|
|
1138
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
979
1139
|
var EditorStateContext = createContext3(null);
|
|
980
1140
|
function EditorStateProvider({ children, value }) {
|
|
981
|
-
return /* @__PURE__ */
|
|
1141
|
+
return /* @__PURE__ */ jsx11(EditorStateContext.Provider, { value, children });
|
|
982
1142
|
}
|
|
983
1143
|
|
|
984
1144
|
// src/contexts/EditorActionsProvider.tsx
|
|
985
1145
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
986
|
-
import { jsx as
|
|
1146
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
987
1147
|
var EditorActionsContext = createContext4(null);
|
|
988
1148
|
function EditorActionsProvider({ children, value }) {
|
|
989
|
-
return /* @__PURE__ */
|
|
1149
|
+
return /* @__PURE__ */ jsx12(EditorActionsContext.Provider, { value, children });
|
|
990
1150
|
}
|
|
991
1151
|
|
|
992
1152
|
// src/contexts/themeProvider.tsx
|
|
993
1153
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
994
|
-
import { jsx as
|
|
1154
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
995
1155
|
function ThemeProvider({ children, ...props }) {
|
|
996
|
-
return /* @__PURE__ */
|
|
1156
|
+
return /* @__PURE__ */ jsx13(NextThemesProvider, { ...props, children });
|
|
997
1157
|
}
|
|
998
1158
|
|
|
999
1159
|
// src/components/editorLayout/editorLayout.tsx
|
|
1000
|
-
import { jsx as
|
|
1160
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1001
1161
|
function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
1002
|
-
const [editor, setEditor] =
|
|
1003
|
-
const [tabs, setTabs] =
|
|
1004
|
-
const [activeTabId, setActiveTabId] =
|
|
1005
|
-
const [activeSubTabId, setActiveSubTabId] =
|
|
1006
|
-
const debouncedSaveRef =
|
|
1007
|
-
const onChangeDebounceRef =
|
|
1008
|
-
const isRestoringRef =
|
|
1009
|
-
const editorState =
|
|
1162
|
+
const [editor, setEditor] = useState4(null);
|
|
1163
|
+
const [tabs, setTabs] = useState4([]);
|
|
1164
|
+
const [activeTabId, setActiveTabId] = useState4("");
|
|
1165
|
+
const [activeSubTabId, setActiveSubTabId] = useState4(null);
|
|
1166
|
+
const debouncedSaveRef = useRef2(null);
|
|
1167
|
+
const onChangeDebounceRef = useRef2(null);
|
|
1168
|
+
const isRestoringRef = useRef2(false);
|
|
1169
|
+
const editorState = useMemo3(
|
|
1010
1170
|
() => ({ tabs, activeTabId, activeSubTabId }),
|
|
1011
1171
|
[tabs, activeTabId, activeSubTabId]
|
|
1012
1172
|
);
|
|
1013
|
-
const emitChangeDebounced =
|
|
1173
|
+
const emitChangeDebounced = useCallback3(
|
|
1014
1174
|
(payload) => {
|
|
1015
1175
|
if (!onChange) return;
|
|
1016
1176
|
if (onChangeDebounceRef.current) clearTimeout(onChangeDebounceRef.current);
|
|
@@ -1018,7 +1178,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1018
1178
|
},
|
|
1019
1179
|
[onChange]
|
|
1020
1180
|
);
|
|
1021
|
-
const emitChange =
|
|
1181
|
+
const emitChange = useCallback3(
|
|
1022
1182
|
(source) => {
|
|
1023
1183
|
if (!onChange) return;
|
|
1024
1184
|
emitChangeDebounced({ tabs, activeTabId, activeSubTabId, source });
|
|
@@ -1037,7 +1197,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1037
1197
|
useEffect2(() => {
|
|
1038
1198
|
onTabsChange?.(tabs);
|
|
1039
1199
|
}, [tabs, onTabsChange]);
|
|
1040
|
-
const saveCurrentContent =
|
|
1200
|
+
const saveCurrentContent = useCallback3(() => {
|
|
1041
1201
|
if (!editor) return tabs;
|
|
1042
1202
|
const json = editor.getJSON();
|
|
1043
1203
|
return tabs.map((tab) => {
|
|
@@ -1053,7 +1213,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1053
1213
|
return { ...tab, content: json };
|
|
1054
1214
|
});
|
|
1055
1215
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1056
|
-
const saveFromEditor =
|
|
1216
|
+
const saveFromEditor = useCallback3(
|
|
1057
1217
|
(editorInstance, source = "editor") => {
|
|
1058
1218
|
const json = editorInstance.getJSON();
|
|
1059
1219
|
setTabs((prev) => {
|
|
@@ -1082,7 +1242,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1082
1242
|
},
|
|
1083
1243
|
[activeTabId, activeSubTabId, emitChangeDebounced]
|
|
1084
1244
|
);
|
|
1085
|
-
const debouncedSave =
|
|
1245
|
+
const debouncedSave = useCallback3(
|
|
1086
1246
|
(editorInstance) => {
|
|
1087
1247
|
if (debouncedSaveRef.current) clearTimeout(debouncedSaveRef.current);
|
|
1088
1248
|
debouncedSaveRef.current = setTimeout(() => {
|
|
@@ -1091,7 +1251,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1091
1251
|
},
|
|
1092
1252
|
[saveFromEditor]
|
|
1093
1253
|
);
|
|
1094
|
-
const addTab =
|
|
1254
|
+
const addTab = useCallback3(() => {
|
|
1095
1255
|
if (debouncedSaveRef.current) {
|
|
1096
1256
|
clearTimeout(debouncedSaveRef.current);
|
|
1097
1257
|
debouncedSaveRef.current = null;
|
|
@@ -1113,7 +1273,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1113
1273
|
source: "add-tab"
|
|
1114
1274
|
});
|
|
1115
1275
|
}, [saveCurrentContent, editor, emitChangeDebounced]);
|
|
1116
|
-
const addSubTab =
|
|
1276
|
+
const addSubTab = useCallback3(
|
|
1117
1277
|
(tabId) => {
|
|
1118
1278
|
if (debouncedSaveRef.current) {
|
|
1119
1279
|
clearTimeout(debouncedSaveRef.current);
|
|
@@ -1140,7 +1300,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1140
1300
|
},
|
|
1141
1301
|
[saveCurrentContent, editor, emitChangeDebounced]
|
|
1142
1302
|
);
|
|
1143
|
-
const selectNode =
|
|
1303
|
+
const selectNode = useCallback3(
|
|
1144
1304
|
(tabId, subId) => {
|
|
1145
1305
|
if (debouncedSaveRef.current) {
|
|
1146
1306
|
clearTimeout(debouncedSaveRef.current);
|
|
@@ -1159,13 +1319,13 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1159
1319
|
},
|
|
1160
1320
|
[saveCurrentContent, emitChangeDebounced]
|
|
1161
1321
|
);
|
|
1162
|
-
const renameTab =
|
|
1322
|
+
const renameTab = useCallback3(
|
|
1163
1323
|
(id, title) => {
|
|
1164
1324
|
setTabs((prev) => prev.map((t) => t.id === id ? { ...t, title } : t));
|
|
1165
1325
|
},
|
|
1166
1326
|
[]
|
|
1167
1327
|
);
|
|
1168
|
-
const deleteTab =
|
|
1328
|
+
const deleteTab = useCallback3(
|
|
1169
1329
|
(id) => {
|
|
1170
1330
|
if (debouncedSaveRef.current) {
|
|
1171
1331
|
clearTimeout(debouncedSaveRef.current);
|
|
@@ -1188,7 +1348,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1188
1348
|
},
|
|
1189
1349
|
[activeTabId, tabs, saveCurrentContent, editor, emitChange]
|
|
1190
1350
|
);
|
|
1191
|
-
const deleteSubTab =
|
|
1351
|
+
const deleteSubTab = useCallback3(
|
|
1192
1352
|
(tabId, subTabId) => {
|
|
1193
1353
|
setTabs(
|
|
1194
1354
|
(prev) => prev.map((tab) => {
|
|
@@ -1205,7 +1365,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1205
1365
|
},
|
|
1206
1366
|
[activeSubTabId, editor, emitChange]
|
|
1207
1367
|
);
|
|
1208
|
-
const renameSubTab =
|
|
1368
|
+
const renameSubTab = useCallback3(
|
|
1209
1369
|
(tabId, subTabId, title) => {
|
|
1210
1370
|
setTabs(
|
|
1211
1371
|
(prev) => prev.map(
|
|
@@ -1220,7 +1380,7 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1220
1380
|
},
|
|
1221
1381
|
[]
|
|
1222
1382
|
);
|
|
1223
|
-
const editorActions =
|
|
1383
|
+
const editorActions = useMemo3(
|
|
1224
1384
|
() => ({
|
|
1225
1385
|
addTab,
|
|
1226
1386
|
addSubTab,
|
|
@@ -1247,8 +1407,8 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1247
1407
|
}
|
|
1248
1408
|
isRestoringRef.current = false;
|
|
1249
1409
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1250
|
-
return /* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1410
|
+
return /* @__PURE__ */ jsx14(ThemeProvider, { attribute: "class", defaultTheme: "system", enableSystem: true, children: /* @__PURE__ */ jsx14(EditorBridgeProvider, { value: { editorContent: editor, setEditorContent: setEditor, debouncedSave }, children: /* @__PURE__ */ jsx14(EditorStateProvider, { value: editorState, children: /* @__PURE__ */ jsx14(EditorActionsProvider, { value: editorActions, children: /* @__PURE__ */ jsx14(SidebarProvider, { children: /* @__PURE__ */ jsxs6("div", { className: "flex h-full w-full min-h-0 relative", children: [
|
|
1411
|
+
/* @__PURE__ */ jsx14(
|
|
1252
1412
|
AppSidebar,
|
|
1253
1413
|
{
|
|
1254
1414
|
tabs,
|
|
@@ -1264,15 +1424,15 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1264
1424
|
onDeleteSubTab: deleteSubTab
|
|
1265
1425
|
}
|
|
1266
1426
|
),
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
/* @__PURE__ */
|
|
1269
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ jsxs6(SidebarInset, { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
1428
|
+
/* @__PURE__ */ jsx14("header", { className: "h-12 flex-shrink-0 border-b flex items-center px-4", children: /* @__PURE__ */ jsx14(SidebarTrigger, {}) }),
|
|
1429
|
+
/* @__PURE__ */ jsx14("div", { className: "flex-1 min-h-0 overflow-auto", children })
|
|
1270
1430
|
] })
|
|
1271
1431
|
] }) }) }) }) }) });
|
|
1272
1432
|
}
|
|
1273
1433
|
|
|
1274
1434
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
1275
|
-
import { useEffect as useEffect23, useRef as
|
|
1435
|
+
import { useEffect as useEffect23, useRef as useRef8, useState as useState30 } from "react";
|
|
1276
1436
|
import { EditorContent, EditorContext, useEditor } from "@tiptap/react";
|
|
1277
1437
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
1278
1438
|
import Image from "@tiptap/extension-image";
|
|
@@ -1455,7 +1615,7 @@ var FontSizeStepper = Extension.create({
|
|
|
1455
1615
|
});
|
|
1456
1616
|
|
|
1457
1617
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1458
|
-
import { forwardRef as forwardRef2, Fragment
|
|
1618
|
+
import { forwardRef as forwardRef2, Fragment, useMemo as useMemo5 } from "react";
|
|
1459
1619
|
|
|
1460
1620
|
// src/components/tiptap-ui-primitive/tooltip/tooltip.tsx
|
|
1461
1621
|
import {
|
|
@@ -1464,8 +1624,8 @@ import {
|
|
|
1464
1624
|
forwardRef,
|
|
1465
1625
|
isValidElement,
|
|
1466
1626
|
useContext as useContext5,
|
|
1467
|
-
useMemo as
|
|
1468
|
-
useState as
|
|
1627
|
+
useMemo as useMemo4,
|
|
1628
|
+
useState as useState5,
|
|
1469
1629
|
version
|
|
1470
1630
|
} from "react";
|
|
1471
1631
|
import {
|
|
@@ -1483,7 +1643,7 @@ import {
|
|
|
1483
1643
|
FloatingPortal,
|
|
1484
1644
|
FloatingDelayGroup
|
|
1485
1645
|
} from "@floating-ui/react";
|
|
1486
|
-
import { jsx as
|
|
1646
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1487
1647
|
function useTooltip({
|
|
1488
1648
|
initialOpen = false,
|
|
1489
1649
|
placement = "top",
|
|
@@ -1492,7 +1652,7 @@ function useTooltip({
|
|
|
1492
1652
|
delay = 600,
|
|
1493
1653
|
closeDelay = 0
|
|
1494
1654
|
} = {}) {
|
|
1495
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
1655
|
+
const [uncontrolledOpen, setUncontrolledOpen] = useState5(initialOpen);
|
|
1496
1656
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
1497
1657
|
const setOpen = setControlledOpen ?? setUncontrolledOpen;
|
|
1498
1658
|
const data = useFloating({
|
|
@@ -1526,7 +1686,7 @@ function useTooltip({
|
|
|
1526
1686
|
const dismiss = useDismiss(context);
|
|
1527
1687
|
const role = useRole(context, { role: "tooltip" });
|
|
1528
1688
|
const interactions = useInteractions([hover, focus, dismiss, role]);
|
|
1529
|
-
return
|
|
1689
|
+
return useMemo4(
|
|
1530
1690
|
() => ({
|
|
1531
1691
|
open,
|
|
1532
1692
|
setOpen,
|
|
@@ -1547,14 +1707,14 @@ function useTooltipContext() {
|
|
|
1547
1707
|
function Tooltip2({ children, ...props }) {
|
|
1548
1708
|
const tooltip = useTooltip(props);
|
|
1549
1709
|
if (!props.useDelayGroup) {
|
|
1550
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ jsx15(TooltipContext.Provider, { value: tooltip, children });
|
|
1551
1711
|
}
|
|
1552
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ jsx15(
|
|
1553
1713
|
FloatingDelayGroup,
|
|
1554
1714
|
{
|
|
1555
1715
|
delay: { open: props.delay ?? 0, close: props.closeDelay ?? 0 },
|
|
1556
1716
|
timeoutMs: props.timeout,
|
|
1557
|
-
children: /* @__PURE__ */
|
|
1717
|
+
children: /* @__PURE__ */ jsx15(TooltipContext.Provider, { value: tooltip, children })
|
|
1558
1718
|
}
|
|
1559
1719
|
);
|
|
1560
1720
|
}
|
|
@@ -1583,7 +1743,7 @@ var TooltipTrigger2 = forwardRef(
|
|
|
1583
1743
|
})
|
|
1584
1744
|
);
|
|
1585
1745
|
}
|
|
1586
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsx15(
|
|
1587
1747
|
"button",
|
|
1588
1748
|
{
|
|
1589
1749
|
ref,
|
|
@@ -1599,7 +1759,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1599
1759
|
const context = useTooltipContext();
|
|
1600
1760
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
1601
1761
|
if (!context.open) return null;
|
|
1602
|
-
const content = /* @__PURE__ */
|
|
1762
|
+
const content = /* @__PURE__ */ jsx15(
|
|
1603
1763
|
"div",
|
|
1604
1764
|
{
|
|
1605
1765
|
ref,
|
|
@@ -1613,7 +1773,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1613
1773
|
}
|
|
1614
1774
|
);
|
|
1615
1775
|
if (portal) {
|
|
1616
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsx15(FloatingPortal, { ...portalProps, children: content });
|
|
1617
1777
|
}
|
|
1618
1778
|
return content;
|
|
1619
1779
|
}
|
|
@@ -1930,14 +2090,14 @@ var FontSizeExtension = Extension2.create({
|
|
|
1930
2090
|
});
|
|
1931
2091
|
|
|
1932
2092
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1933
|
-
import { jsx as
|
|
2093
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1934
2094
|
var ShortcutDisplay = ({
|
|
1935
2095
|
shortcuts
|
|
1936
2096
|
}) => {
|
|
1937
2097
|
if (shortcuts.length === 0) return null;
|
|
1938
|
-
return /* @__PURE__ */
|
|
1939
|
-
index > 0 && /* @__PURE__ */
|
|
1940
|
-
/* @__PURE__ */
|
|
2098
|
+
return /* @__PURE__ */ jsx16("div", { children: shortcuts.map((key, index) => /* @__PURE__ */ jsxs7(Fragment, { children: [
|
|
2099
|
+
index > 0 && /* @__PURE__ */ jsx16("kbd", { children: "+" }),
|
|
2100
|
+
/* @__PURE__ */ jsx16("kbd", { children: key })
|
|
1941
2101
|
] }, index)) });
|
|
1942
2102
|
};
|
|
1943
2103
|
var Button2 = forwardRef2(
|
|
@@ -1950,12 +2110,12 @@ var Button2 = forwardRef2(
|
|
|
1950
2110
|
"aria-label": ariaLabel,
|
|
1951
2111
|
...props
|
|
1952
2112
|
}, ref) => {
|
|
1953
|
-
const shortcuts =
|
|
2113
|
+
const shortcuts = useMemo5(
|
|
1954
2114
|
() => parseShortcutKeys({ shortcutKeys }),
|
|
1955
2115
|
[shortcutKeys]
|
|
1956
2116
|
);
|
|
1957
2117
|
if (!tooltip || !showTooltip) {
|
|
1958
|
-
return /* @__PURE__ */
|
|
2118
|
+
return /* @__PURE__ */ jsx16(
|
|
1959
2119
|
"button",
|
|
1960
2120
|
{
|
|
1961
2121
|
className: cn2("tiptap-button", className),
|
|
@@ -1966,8 +2126,8 @@ var Button2 = forwardRef2(
|
|
|
1966
2126
|
}
|
|
1967
2127
|
);
|
|
1968
2128
|
}
|
|
1969
|
-
return /* @__PURE__ */
|
|
1970
|
-
/* @__PURE__ */
|
|
2129
|
+
return /* @__PURE__ */ jsxs7(Tooltip2, { delay: 200, children: [
|
|
2130
|
+
/* @__PURE__ */ jsx16(
|
|
1971
2131
|
TooltipTrigger2,
|
|
1972
2132
|
{
|
|
1973
2133
|
className: cn2("tiptap-button", className),
|
|
@@ -1977,16 +2137,16 @@ var Button2 = forwardRef2(
|
|
|
1977
2137
|
children
|
|
1978
2138
|
}
|
|
1979
2139
|
),
|
|
1980
|
-
/* @__PURE__ */
|
|
2140
|
+
/* @__PURE__ */ jsxs7(TooltipContent2, { children: [
|
|
1981
2141
|
tooltip,
|
|
1982
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx16(ShortcutDisplay, { shortcuts })
|
|
1983
2143
|
] })
|
|
1984
2144
|
] });
|
|
1985
2145
|
}
|
|
1986
2146
|
);
|
|
1987
2147
|
Button2.displayName = "Button";
|
|
1988
2148
|
var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical", ...props }, ref) => {
|
|
1989
|
-
return /* @__PURE__ */
|
|
2149
|
+
return /* @__PURE__ */ jsx16(
|
|
1990
2150
|
"div",
|
|
1991
2151
|
{
|
|
1992
2152
|
ref,
|
|
@@ -2001,7 +2161,7 @@ var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical",
|
|
|
2001
2161
|
ButtonGroup.displayName = "ButtonGroup";
|
|
2002
2162
|
|
|
2003
2163
|
// src/components/tiptap-ui-primitive/spacer/spacer.tsx
|
|
2004
|
-
import { jsx as
|
|
2164
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
2005
2165
|
function Spacer({
|
|
2006
2166
|
orientation = "horizontal",
|
|
2007
2167
|
size,
|
|
@@ -2016,20 +2176,20 @@ function Spacer({
|
|
|
2016
2176
|
height: orientation === "horizontal" ? "1px" : size
|
|
2017
2177
|
}
|
|
2018
2178
|
};
|
|
2019
|
-
return /* @__PURE__ */
|
|
2179
|
+
return /* @__PURE__ */ jsx17("div", { ...props, style: computedStyle });
|
|
2020
2180
|
}
|
|
2021
2181
|
|
|
2022
2182
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2023
|
-
import { forwardRef as forwardRef4, useCallback as
|
|
2183
|
+
import { forwardRef as forwardRef4, useCallback as useCallback5, useEffect as useEffect4, useRef as useRef4, useState as useState7 } from "react";
|
|
2024
2184
|
|
|
2025
2185
|
// src/components/tiptap-ui-primitive/separator/separator.tsx
|
|
2026
2186
|
import { forwardRef as forwardRef3 } from "react";
|
|
2027
|
-
import { jsx as
|
|
2028
|
-
var
|
|
2187
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
2188
|
+
var Separator3 = forwardRef3(
|
|
2029
2189
|
({ decorative, orientation = "vertical", className, ...divProps }, ref) => {
|
|
2030
2190
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
2031
2191
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
2032
|
-
return /* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsx18(
|
|
2033
2193
|
"div",
|
|
2034
2194
|
{
|
|
2035
2195
|
className: cn2("tiptap-separator", className),
|
|
@@ -2041,10 +2201,10 @@ var Separator2 = forwardRef3(
|
|
|
2041
2201
|
);
|
|
2042
2202
|
}
|
|
2043
2203
|
);
|
|
2044
|
-
|
|
2204
|
+
Separator3.displayName = "Separator";
|
|
2045
2205
|
|
|
2046
2206
|
// src/hooks/use-menu-navigation.ts
|
|
2047
|
-
import { useEffect as useEffect3, useState as
|
|
2207
|
+
import { useEffect as useEffect3, useState as useState6 } from "react";
|
|
2048
2208
|
function useMenuNavigation({
|
|
2049
2209
|
editor,
|
|
2050
2210
|
containerRef,
|
|
@@ -2055,7 +2215,7 @@ function useMenuNavigation({
|
|
|
2055
2215
|
orientation = "vertical",
|
|
2056
2216
|
autoSelectFirstItem = true
|
|
2057
2217
|
}) {
|
|
2058
|
-
const [selectedIndex, setSelectedIndex] =
|
|
2218
|
+
const [selectedIndex, setSelectedIndex] = useState6(
|
|
2059
2219
|
autoSelectFirstItem ? 0 : -1
|
|
2060
2220
|
);
|
|
2061
2221
|
useEffect3(() => {
|
|
@@ -2168,7 +2328,7 @@ function useMenuNavigation({
|
|
|
2168
2328
|
}
|
|
2169
2329
|
|
|
2170
2330
|
// src/hooks/use-composed-ref.ts
|
|
2171
|
-
import { useCallback as
|
|
2331
|
+
import { useCallback as useCallback4, useRef as useRef3 } from "react";
|
|
2172
2332
|
var updateRef = (ref, value) => {
|
|
2173
2333
|
if (typeof ref === "function") {
|
|
2174
2334
|
ref(value);
|
|
@@ -2178,8 +2338,8 @@ var updateRef = (ref, value) => {
|
|
|
2178
2338
|
}
|
|
2179
2339
|
};
|
|
2180
2340
|
var useComposedRef = (libRef, userRef) => {
|
|
2181
|
-
const prevUserRef =
|
|
2182
|
-
return
|
|
2341
|
+
const prevUserRef = useRef3(null);
|
|
2342
|
+
return useCallback4(
|
|
2183
2343
|
(instance) => {
|
|
2184
2344
|
if (libRef && "current" in libRef) {
|
|
2185
2345
|
;
|
|
@@ -2198,10 +2358,10 @@ var useComposedRef = (libRef, userRef) => {
|
|
|
2198
2358
|
};
|
|
2199
2359
|
|
|
2200
2360
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2201
|
-
import { jsx as
|
|
2361
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2202
2362
|
var useToolbarNavigation = (toolbarRef) => {
|
|
2203
|
-
const [items, setItems] =
|
|
2204
|
-
const collectItems =
|
|
2363
|
+
const [items, setItems] = useState7([]);
|
|
2364
|
+
const collectItems = useCallback5(() => {
|
|
2205
2365
|
if (!toolbarRef.current) return [];
|
|
2206
2366
|
return Array.from(
|
|
2207
2367
|
toolbarRef.current.querySelectorAll(
|
|
@@ -2252,10 +2412,10 @@ var useToolbarNavigation = (toolbarRef) => {
|
|
|
2252
2412
|
};
|
|
2253
2413
|
var Toolbar = forwardRef4(
|
|
2254
2414
|
({ children, className, variant = "fixed", ...props }, ref) => {
|
|
2255
|
-
const toolbarRef =
|
|
2415
|
+
const toolbarRef = useRef4(null);
|
|
2256
2416
|
const composedRef = useComposedRef(toolbarRef, ref);
|
|
2257
2417
|
useToolbarNavigation(toolbarRef);
|
|
2258
|
-
return /* @__PURE__ */
|
|
2418
|
+
return /* @__PURE__ */ jsx19(
|
|
2259
2419
|
"div",
|
|
2260
2420
|
{
|
|
2261
2421
|
ref: composedRef,
|
|
@@ -2271,7 +2431,7 @@ var Toolbar = forwardRef4(
|
|
|
2271
2431
|
);
|
|
2272
2432
|
Toolbar.displayName = "Toolbar";
|
|
2273
2433
|
var ToolbarGroup = forwardRef4(
|
|
2274
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2434
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
2275
2435
|
"div",
|
|
2276
2436
|
{
|
|
2277
2437
|
ref,
|
|
@@ -2284,7 +2444,7 @@ var ToolbarGroup = forwardRef4(
|
|
|
2284
2444
|
);
|
|
2285
2445
|
ToolbarGroup.displayName = "ToolbarGroup";
|
|
2286
2446
|
var ToolbarSeparator = forwardRef4(
|
|
2287
|
-
({ ...props }, ref) => /* @__PURE__ */
|
|
2447
|
+
({ ...props }, ref) => /* @__PURE__ */ jsx19(Separator3, { ref, orientation: "vertical", decorative: true, ...props })
|
|
2288
2448
|
);
|
|
2289
2449
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
2290
2450
|
|
|
@@ -2300,11 +2460,11 @@ import {
|
|
|
2300
2460
|
Heading3,
|
|
2301
2461
|
Code
|
|
2302
2462
|
} from "lucide-react";
|
|
2303
|
-
import { jsx as
|
|
2463
|
+
import { jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2304
2464
|
function BubbleMenuInline() {
|
|
2305
2465
|
const { editor } = useCurrentEditor();
|
|
2306
2466
|
if (!editor) return null;
|
|
2307
|
-
return /* @__PURE__ */
|
|
2467
|
+
return /* @__PURE__ */ jsx20(
|
|
2308
2468
|
BubbleMenu,
|
|
2309
2469
|
{
|
|
2310
2470
|
editor,
|
|
@@ -2323,81 +2483,81 @@ function BubbleMenuInline() {
|
|
|
2323
2483
|
if (hasImage) return false;
|
|
2324
2484
|
return true;
|
|
2325
2485
|
},
|
|
2326
|
-
children: /* @__PURE__ */
|
|
2486
|
+
children: /* @__PURE__ */ jsxs8(
|
|
2327
2487
|
"div",
|
|
2328
2488
|
{
|
|
2329
2489
|
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",
|
|
2330
2490
|
children: [
|
|
2331
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx20(
|
|
2332
2492
|
Button,
|
|
2333
2493
|
{
|
|
2334
2494
|
variant: "ghost",
|
|
2335
2495
|
size: "sm",
|
|
2336
2496
|
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
2337
2497
|
className: editor.isActive("heading", { level: 1 }) ? "bg-accent" : "",
|
|
2338
|
-
children: /* @__PURE__ */
|
|
2498
|
+
children: /* @__PURE__ */ jsx20(Heading1, { size: 15 })
|
|
2339
2499
|
}
|
|
2340
2500
|
),
|
|
2341
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ jsx20(
|
|
2342
2502
|
Button,
|
|
2343
2503
|
{
|
|
2344
2504
|
variant: "ghost",
|
|
2345
2505
|
size: "sm",
|
|
2346
2506
|
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
2347
2507
|
className: editor.isActive("heading", { level: 2 }) ? "bg-accent" : "",
|
|
2348
|
-
children: /* @__PURE__ */
|
|
2508
|
+
children: /* @__PURE__ */ jsx20(Heading2, { size: 15 })
|
|
2349
2509
|
}
|
|
2350
2510
|
),
|
|
2351
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx20(
|
|
2352
2512
|
Button,
|
|
2353
2513
|
{
|
|
2354
2514
|
variant: "ghost",
|
|
2355
2515
|
size: "sm",
|
|
2356
2516
|
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
2357
2517
|
className: editor.isActive("heading", { level: 3 }) ? "bg-accent" : "",
|
|
2358
|
-
children: /* @__PURE__ */
|
|
2518
|
+
children: /* @__PURE__ */ jsx20(Heading3, { size: 15 })
|
|
2359
2519
|
}
|
|
2360
2520
|
),
|
|
2361
|
-
/* @__PURE__ */
|
|
2362
|
-
/* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsx20(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2522
|
+
/* @__PURE__ */ jsx20(
|
|
2363
2523
|
Button,
|
|
2364
2524
|
{
|
|
2365
2525
|
variant: "ghost",
|
|
2366
2526
|
size: "sm",
|
|
2367
2527
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
2368
2528
|
className: editor.isActive("bulletList") ? "bg-accent" : "",
|
|
2369
|
-
children: /* @__PURE__ */
|
|
2529
|
+
children: /* @__PURE__ */ jsx20(List, { size: 15 })
|
|
2370
2530
|
}
|
|
2371
2531
|
),
|
|
2372
|
-
/* @__PURE__ */
|
|
2532
|
+
/* @__PURE__ */ jsx20(
|
|
2373
2533
|
Button,
|
|
2374
2534
|
{
|
|
2375
2535
|
variant: "ghost",
|
|
2376
2536
|
size: "sm",
|
|
2377
2537
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
2378
2538
|
className: editor.isActive("orderedList") ? "bg-accent" : "",
|
|
2379
|
-
children: /* @__PURE__ */
|
|
2539
|
+
children: /* @__PURE__ */ jsx20(ListOrdered, { size: 15 })
|
|
2380
2540
|
}
|
|
2381
2541
|
),
|
|
2382
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ jsx20(
|
|
2383
2543
|
Button,
|
|
2384
2544
|
{
|
|
2385
2545
|
variant: "ghost",
|
|
2386
2546
|
size: "sm",
|
|
2387
2547
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
2388
2548
|
className: editor.isActive("taskList") ? "bg-accent" : "",
|
|
2389
|
-
children: /* @__PURE__ */
|
|
2549
|
+
children: /* @__PURE__ */ jsx20(CheckSquare, { size: 15 })
|
|
2390
2550
|
}
|
|
2391
2551
|
),
|
|
2392
|
-
/* @__PURE__ */
|
|
2393
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ jsx20(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2553
|
+
/* @__PURE__ */ jsx20(
|
|
2394
2554
|
Button,
|
|
2395
2555
|
{
|
|
2396
2556
|
variant: "ghost",
|
|
2397
2557
|
size: "sm",
|
|
2398
2558
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
2399
2559
|
className: editor.isActive("codeBlock") ? "bg-accent" : "",
|
|
2400
|
-
children: /* @__PURE__ */
|
|
2560
|
+
children: /* @__PURE__ */ jsx20(Code, { size: 15 })
|
|
2401
2561
|
}
|
|
2402
2562
|
)
|
|
2403
2563
|
]
|
|
@@ -2412,14 +2572,14 @@ import { mergeAttributes as mergeAttributes2, Node as Node4 } from "@tiptap/reac
|
|
|
2412
2572
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
2413
2573
|
|
|
2414
2574
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2415
|
-
import { useRef as
|
|
2575
|
+
import { useRef as useRef5, useState as useState8 } from "react";
|
|
2416
2576
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
2417
2577
|
|
|
2418
2578
|
// src/components/tiptap-icons/close-icon.tsx
|
|
2419
|
-
import { memo as
|
|
2420
|
-
import { jsx as
|
|
2421
|
-
var CloseIcon =
|
|
2422
|
-
return /* @__PURE__ */
|
|
2579
|
+
import { memo as memo2 } from "react";
|
|
2580
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
2581
|
+
var CloseIcon = memo2(({ className, ...props }) => {
|
|
2582
|
+
return /* @__PURE__ */ jsx21(
|
|
2423
2583
|
"svg",
|
|
2424
2584
|
{
|
|
2425
2585
|
width: "24",
|
|
@@ -2429,7 +2589,7 @@ var CloseIcon = memo6(({ className, ...props }) => {
|
|
|
2429
2589
|
fill: "currentColor",
|
|
2430
2590
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2431
2591
|
...props,
|
|
2432
|
-
children: /* @__PURE__ */
|
|
2592
|
+
children: /* @__PURE__ */ jsx21(
|
|
2433
2593
|
"path",
|
|
2434
2594
|
{
|
|
2435
2595
|
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",
|
|
@@ -2442,9 +2602,9 @@ var CloseIcon = memo6(({ className, ...props }) => {
|
|
|
2442
2602
|
CloseIcon.displayName = "CloseIcon";
|
|
2443
2603
|
|
|
2444
2604
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2445
|
-
import { Fragment as
|
|
2605
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2446
2606
|
function useFileUpload(options) {
|
|
2447
|
-
const [fileItems, setFileItems] =
|
|
2607
|
+
const [fileItems, setFileItems] = useState8([]);
|
|
2448
2608
|
const uploadFile = async (file) => {
|
|
2449
2609
|
if (file.size > options.maxSize) {
|
|
2450
2610
|
const error = new Error(
|
|
@@ -2550,7 +2710,7 @@ function useFileUpload(options) {
|
|
|
2550
2710
|
clearAllFiles
|
|
2551
2711
|
};
|
|
2552
2712
|
}
|
|
2553
|
-
var CloudUploadIcon = () => /* @__PURE__ */
|
|
2713
|
+
var CloudUploadIcon = () => /* @__PURE__ */ jsxs9(
|
|
2554
2714
|
"svg",
|
|
2555
2715
|
{
|
|
2556
2716
|
width: "24",
|
|
@@ -2560,14 +2720,14 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs11(
|
|
|
2560
2720
|
fill: "currentColor",
|
|
2561
2721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2562
2722
|
children: [
|
|
2563
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ jsx22(
|
|
2564
2724
|
"path",
|
|
2565
2725
|
{
|
|
2566
2726
|
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",
|
|
2567
2727
|
fill: "currentColor"
|
|
2568
2728
|
}
|
|
2569
2729
|
),
|
|
2570
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ jsx22(
|
|
2571
2731
|
"path",
|
|
2572
2732
|
{
|
|
2573
2733
|
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",
|
|
@@ -2577,7 +2737,7 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs11(
|
|
|
2577
2737
|
]
|
|
2578
2738
|
}
|
|
2579
2739
|
);
|
|
2580
|
-
var FileIcon = () => /* @__PURE__ */
|
|
2740
|
+
var FileIcon = () => /* @__PURE__ */ jsx22(
|
|
2581
2741
|
"svg",
|
|
2582
2742
|
{
|
|
2583
2743
|
width: "43",
|
|
@@ -2586,7 +2746,7 @@ var FileIcon = () => /* @__PURE__ */ jsx24(
|
|
|
2586
2746
|
fill: "currentColor",
|
|
2587
2747
|
className: "tiptap-image-upload-dropzone-rect-primary",
|
|
2588
2748
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2589
|
-
children: /* @__PURE__ */
|
|
2749
|
+
children: /* @__PURE__ */ jsx22(
|
|
2590
2750
|
"path",
|
|
2591
2751
|
{
|
|
2592
2752
|
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",
|
|
@@ -2598,7 +2758,7 @@ var FileIcon = () => /* @__PURE__ */ jsx24(
|
|
|
2598
2758
|
)
|
|
2599
2759
|
}
|
|
2600
2760
|
);
|
|
2601
|
-
var FileCornerIcon = () => /* @__PURE__ */
|
|
2761
|
+
var FileCornerIcon = () => /* @__PURE__ */ jsx22(
|
|
2602
2762
|
"svg",
|
|
2603
2763
|
{
|
|
2604
2764
|
width: "10",
|
|
@@ -2607,7 +2767,7 @@ var FileCornerIcon = () => /* @__PURE__ */ jsx24(
|
|
|
2607
2767
|
viewBox: "0 0 10 10",
|
|
2608
2768
|
fill: "currentColor",
|
|
2609
2769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2610
|
-
children: /* @__PURE__ */
|
|
2770
|
+
children: /* @__PURE__ */ jsx22(
|
|
2611
2771
|
"path",
|
|
2612
2772
|
{
|
|
2613
2773
|
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",
|
|
@@ -2620,8 +2780,8 @@ var ImageUploadDragArea = ({
|
|
|
2620
2780
|
onFile,
|
|
2621
2781
|
children
|
|
2622
2782
|
}) => {
|
|
2623
|
-
const [isDragOver, setIsDragOver] =
|
|
2624
|
-
const [isDragActive, setIsDragActive] =
|
|
2783
|
+
const [isDragOver, setIsDragOver] = useState8(false);
|
|
2784
|
+
const [isDragActive, setIsDragActive] = useState8(false);
|
|
2625
2785
|
const handleDragEnter = (e) => {
|
|
2626
2786
|
e.preventDefault();
|
|
2627
2787
|
e.stopPropagation();
|
|
@@ -2650,7 +2810,7 @@ var ImageUploadDragArea = ({
|
|
|
2650
2810
|
onFile(files);
|
|
2651
2811
|
}
|
|
2652
2812
|
};
|
|
2653
|
-
return /* @__PURE__ */
|
|
2813
|
+
return /* @__PURE__ */ jsx22(
|
|
2654
2814
|
"div",
|
|
2655
2815
|
{
|
|
2656
2816
|
className: `tiptap-image-upload-drag-area ${isDragActive ? "drag-active" : ""} ${isDragOver ? "drag-over" : ""}`,
|
|
@@ -2673,28 +2833,28 @@ var ImageUploadPreview = ({
|
|
|
2673
2833
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
2674
2834
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
2675
2835
|
};
|
|
2676
|
-
return /* @__PURE__ */
|
|
2677
|
-
fileItem.status === "uploading" && /* @__PURE__ */
|
|
2836
|
+
return /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-preview", children: [
|
|
2837
|
+
fileItem.status === "uploading" && /* @__PURE__ */ jsx22(
|
|
2678
2838
|
"div",
|
|
2679
2839
|
{
|
|
2680
2840
|
className: "tiptap-image-upload-progress",
|
|
2681
2841
|
style: { width: `${fileItem.progress}%` }
|
|
2682
2842
|
}
|
|
2683
2843
|
),
|
|
2684
|
-
/* @__PURE__ */
|
|
2685
|
-
/* @__PURE__ */
|
|
2686
|
-
/* @__PURE__ */
|
|
2687
|
-
/* @__PURE__ */
|
|
2688
|
-
/* @__PURE__ */
|
|
2689
|
-
/* @__PURE__ */
|
|
2844
|
+
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-preview-content", children: [
|
|
2845
|
+
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-file-info", children: [
|
|
2846
|
+
/* @__PURE__ */ jsx22("div", { className: "tiptap-image-upload-file-icon", children: /* @__PURE__ */ jsx22(CloudUploadIcon, {}) }),
|
|
2847
|
+
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-details", children: [
|
|
2848
|
+
/* @__PURE__ */ jsx22("span", { className: "tiptap-image-upload-text", children: fileItem.file.name }),
|
|
2849
|
+
/* @__PURE__ */ jsx22("span", { className: "tiptap-image-upload-subtext", children: formatFileSize(fileItem.file.size) })
|
|
2690
2850
|
] })
|
|
2691
2851
|
] }),
|
|
2692
|
-
/* @__PURE__ */
|
|
2693
|
-
fileItem.status === "uploading" && /* @__PURE__ */
|
|
2852
|
+
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-actions", children: [
|
|
2853
|
+
fileItem.status === "uploading" && /* @__PURE__ */ jsxs9("span", { className: "tiptap-image-upload-progress-text", children: [
|
|
2694
2854
|
fileItem.progress,
|
|
2695
2855
|
"%"
|
|
2696
2856
|
] }),
|
|
2697
|
-
/* @__PURE__ */
|
|
2857
|
+
/* @__PURE__ */ jsx22(
|
|
2698
2858
|
Button2,
|
|
2699
2859
|
{
|
|
2700
2860
|
type: "button",
|
|
@@ -2703,7 +2863,7 @@ var ImageUploadPreview = ({
|
|
|
2703
2863
|
e.stopPropagation();
|
|
2704
2864
|
onRemove();
|
|
2705
2865
|
},
|
|
2706
|
-
children: /* @__PURE__ */
|
|
2866
|
+
children: /* @__PURE__ */ jsx22(CloseIcon, { className: "tiptap-button-icon" })
|
|
2707
2867
|
}
|
|
2708
2868
|
)
|
|
2709
2869
|
] })
|
|
@@ -2713,18 +2873,18 @@ var ImageUploadPreview = ({
|
|
|
2713
2873
|
var DropZoneContent = ({
|
|
2714
2874
|
maxSize,
|
|
2715
2875
|
limit
|
|
2716
|
-
}) => /* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2719
|
-
/* @__PURE__ */
|
|
2720
|
-
/* @__PURE__ */
|
|
2876
|
+
}) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
2877
|
+
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-dropzone", children: [
|
|
2878
|
+
/* @__PURE__ */ jsx22(FileIcon, {}),
|
|
2879
|
+
/* @__PURE__ */ jsx22(FileCornerIcon, {}),
|
|
2880
|
+
/* @__PURE__ */ jsx22("div", { className: "tiptap-image-upload-icon-container", children: /* @__PURE__ */ jsx22(CloudUploadIcon, {}) })
|
|
2721
2881
|
] }),
|
|
2722
|
-
/* @__PURE__ */
|
|
2723
|
-
/* @__PURE__ */
|
|
2724
|
-
/* @__PURE__ */
|
|
2882
|
+
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-content", children: [
|
|
2883
|
+
/* @__PURE__ */ jsxs9("span", { className: "tiptap-image-upload-text", children: [
|
|
2884
|
+
/* @__PURE__ */ jsx22("em", { children: "Click to upload" }),
|
|
2725
2885
|
" or drag and drop"
|
|
2726
2886
|
] }),
|
|
2727
|
-
/* @__PURE__ */
|
|
2887
|
+
/* @__PURE__ */ jsxs9("span", { className: "tiptap-image-upload-subtext", children: [
|
|
2728
2888
|
"Maximum ",
|
|
2729
2889
|
limit,
|
|
2730
2890
|
" file",
|
|
@@ -2737,7 +2897,7 @@ var DropZoneContent = ({
|
|
|
2737
2897
|
] });
|
|
2738
2898
|
var ImageUploadNode = (props) => {
|
|
2739
2899
|
const { accept, limit, maxSize } = props.node.attrs;
|
|
2740
|
-
const inputRef =
|
|
2900
|
+
const inputRef = useRef5(null);
|
|
2741
2901
|
const extension = props.extension;
|
|
2742
2902
|
const uploadOptions = {
|
|
2743
2903
|
maxSize,
|
|
@@ -2785,22 +2945,22 @@ var ImageUploadNode = (props) => {
|
|
|
2785
2945
|
}
|
|
2786
2946
|
};
|
|
2787
2947
|
const hasFiles = fileItems.length > 0;
|
|
2788
|
-
return /* @__PURE__ */
|
|
2948
|
+
return /* @__PURE__ */ jsxs9(
|
|
2789
2949
|
NodeViewWrapper,
|
|
2790
2950
|
{
|
|
2791
2951
|
className: "tiptap-image-upload",
|
|
2792
2952
|
tabIndex: 0,
|
|
2793
2953
|
onClick: handleClick,
|
|
2794
2954
|
children: [
|
|
2795
|
-
!hasFiles && /* @__PURE__ */
|
|
2796
|
-
hasFiles && /* @__PURE__ */
|
|
2797
|
-
fileItems.length > 1 && /* @__PURE__ */
|
|
2798
|
-
/* @__PURE__ */
|
|
2955
|
+
!hasFiles && /* @__PURE__ */ jsx22(ImageUploadDragArea, { onFile: handleUpload, children: /* @__PURE__ */ jsx22(DropZoneContent, { maxSize, limit }) }),
|
|
2956
|
+
hasFiles && /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-previews", children: [
|
|
2957
|
+
fileItems.length > 1 && /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-header", children: [
|
|
2958
|
+
/* @__PURE__ */ jsxs9("span", { children: [
|
|
2799
2959
|
"Uploading ",
|
|
2800
2960
|
fileItems.length,
|
|
2801
2961
|
" files"
|
|
2802
2962
|
] }),
|
|
2803
|
-
/* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ jsx22(
|
|
2804
2964
|
Button2,
|
|
2805
2965
|
{
|
|
2806
2966
|
type: "button",
|
|
@@ -2813,7 +2973,7 @@ var ImageUploadNode = (props) => {
|
|
|
2813
2973
|
}
|
|
2814
2974
|
)
|
|
2815
2975
|
] }),
|
|
2816
|
-
fileItems.map((fileItem) => /* @__PURE__ */
|
|
2976
|
+
fileItems.map((fileItem) => /* @__PURE__ */ jsx22(
|
|
2817
2977
|
ImageUploadPreview,
|
|
2818
2978
|
{
|
|
2819
2979
|
fileItem,
|
|
@@ -2822,7 +2982,7 @@ var ImageUploadNode = (props) => {
|
|
|
2822
2982
|
fileItem.id
|
|
2823
2983
|
))
|
|
2824
2984
|
] }),
|
|
2825
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsx22(
|
|
2826
2986
|
"input",
|
|
2827
2987
|
{
|
|
2828
2988
|
ref: inputRef,
|
|
@@ -2931,13 +3091,13 @@ var HorizontalRule = TiptapHorizontalRule.extend({
|
|
|
2931
3091
|
});
|
|
2932
3092
|
|
|
2933
3093
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
2934
|
-
import { forwardRef as forwardRef9, useCallback as
|
|
3094
|
+
import { forwardRef as forwardRef9, useCallback as useCallback8, useState as useState10 } from "react";
|
|
2935
3095
|
|
|
2936
3096
|
// src/components/tiptap-icons/chevron-down-icon.tsx
|
|
2937
|
-
import { memo as
|
|
2938
|
-
import { jsx as
|
|
2939
|
-
var ChevronDownIcon =
|
|
2940
|
-
return /* @__PURE__ */
|
|
3097
|
+
import { memo as memo3 } from "react";
|
|
3098
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
3099
|
+
var ChevronDownIcon = memo3(({ className, ...props }) => {
|
|
3100
|
+
return /* @__PURE__ */ jsx23(
|
|
2941
3101
|
"svg",
|
|
2942
3102
|
{
|
|
2943
3103
|
width: "24",
|
|
@@ -2947,7 +3107,7 @@ var ChevronDownIcon = memo7(({ className, ...props }) => {
|
|
|
2947
3107
|
fill: "currentColor",
|
|
2948
3108
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2949
3109
|
...props,
|
|
2950
|
-
children: /* @__PURE__ */
|
|
3110
|
+
children: /* @__PURE__ */ jsx23(
|
|
2951
3111
|
"path",
|
|
2952
3112
|
{
|
|
2953
3113
|
fillRule: "evenodd",
|
|
@@ -2963,10 +3123,10 @@ ChevronDownIcon.displayName = "ChevronDownIcon";
|
|
|
2963
3123
|
|
|
2964
3124
|
// src/hooks/use-tiptap-editor.ts
|
|
2965
3125
|
import { useCurrentEditor as useCurrentEditor2, useEditorState } from "@tiptap/react";
|
|
2966
|
-
import { useMemo as
|
|
3126
|
+
import { useMemo as useMemo6 } from "react";
|
|
2967
3127
|
function useTiptapEditor(providedEditor) {
|
|
2968
3128
|
const { editor: coreEditor } = useCurrentEditor2();
|
|
2969
|
-
const mainEditor =
|
|
3129
|
+
const mainEditor = useMemo6(
|
|
2970
3130
|
() => providedEditor || coreEditor,
|
|
2971
3131
|
[providedEditor, coreEditor]
|
|
2972
3132
|
);
|
|
@@ -2991,11 +3151,11 @@ function useTiptapEditor(providedEditor) {
|
|
|
2991
3151
|
}
|
|
2992
3152
|
|
|
2993
3153
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
2994
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
3154
|
+
import { forwardRef as forwardRef6, useCallback as useCallback6 } from "react";
|
|
2995
3155
|
|
|
2996
3156
|
// src/components/tiptap-ui-primitive/badge/badge.tsx
|
|
2997
3157
|
import { forwardRef as forwardRef5 } from "react";
|
|
2998
|
-
import { jsx as
|
|
3158
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2999
3159
|
var Badge = forwardRef5(
|
|
3000
3160
|
({
|
|
3001
3161
|
variant,
|
|
@@ -3006,7 +3166,7 @@ var Badge = forwardRef5(
|
|
|
3006
3166
|
children,
|
|
3007
3167
|
...props
|
|
3008
3168
|
}, ref) => {
|
|
3009
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsx24(
|
|
3010
3170
|
"div",
|
|
3011
3171
|
{
|
|
3012
3172
|
ref,
|
|
@@ -3024,12 +3184,12 @@ var Badge = forwardRef5(
|
|
|
3024
3184
|
Badge.displayName = "Badge";
|
|
3025
3185
|
|
|
3026
3186
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
3027
|
-
import { Fragment as
|
|
3187
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
3028
3188
|
function HeadingShortcutBadge({
|
|
3029
3189
|
level,
|
|
3030
3190
|
shortcutKeys = HEADING_SHORTCUT_KEYS[level]
|
|
3031
3191
|
}) {
|
|
3032
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx25(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3033
3193
|
}
|
|
3034
3194
|
var HeadingButton = forwardRef6(
|
|
3035
3195
|
({
|
|
@@ -3058,7 +3218,7 @@ var HeadingButton = forwardRef6(
|
|
|
3058
3218
|
hideWhenUnavailable,
|
|
3059
3219
|
onToggled
|
|
3060
3220
|
});
|
|
3061
|
-
const handleClick =
|
|
3221
|
+
const handleClick = useCallback6(
|
|
3062
3222
|
(event) => {
|
|
3063
3223
|
onClick?.(event);
|
|
3064
3224
|
if (event.defaultPrevented) return;
|
|
@@ -3069,7 +3229,7 @@ var HeadingButton = forwardRef6(
|
|
|
3069
3229
|
if (!isVisible) {
|
|
3070
3230
|
return null;
|
|
3071
3231
|
}
|
|
3072
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx25(
|
|
3073
3233
|
Button2,
|
|
3074
3234
|
{
|
|
3075
3235
|
type: "button",
|
|
@@ -3085,10 +3245,10 @@ var HeadingButton = forwardRef6(
|
|
|
3085
3245
|
onClick: handleClick,
|
|
3086
3246
|
...buttonProps,
|
|
3087
3247
|
ref,
|
|
3088
|
-
children: children ?? /* @__PURE__ */
|
|
3089
|
-
/* @__PURE__ */
|
|
3090
|
-
text && /* @__PURE__ */
|
|
3091
|
-
showShortcut && /* @__PURE__ */
|
|
3248
|
+
children: children ?? /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
3249
|
+
/* @__PURE__ */ jsx25(Icon, { className: "tiptap-button-icon" }),
|
|
3250
|
+
text && /* @__PURE__ */ jsx25("span", { className: "tiptap-button-text", children: text }),
|
|
3251
|
+
showShortcut && /* @__PURE__ */ jsx25(HeadingShortcutBadge, { level, shortcutKeys })
|
|
3092
3252
|
] })
|
|
3093
3253
|
}
|
|
3094
3254
|
);
|
|
@@ -3097,14 +3257,14 @@ var HeadingButton = forwardRef6(
|
|
|
3097
3257
|
HeadingButton.displayName = "HeadingButton";
|
|
3098
3258
|
|
|
3099
3259
|
// src/components/tiptap-ui/heading-button/use-heading.ts
|
|
3100
|
-
import { useCallback as
|
|
3260
|
+
import { useCallback as useCallback7, useEffect as useEffect5, useState as useState9 } from "react";
|
|
3101
3261
|
import { NodeSelection as NodeSelection2, TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
3102
3262
|
|
|
3103
3263
|
// src/components/tiptap-icons/heading-one-icon.tsx
|
|
3104
|
-
import { memo as
|
|
3105
|
-
import { jsx as
|
|
3106
|
-
var HeadingOneIcon =
|
|
3107
|
-
return /* @__PURE__ */
|
|
3264
|
+
import { memo as memo4 } from "react";
|
|
3265
|
+
import { jsx as jsx26, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
3266
|
+
var HeadingOneIcon = memo4(({ className, ...props }) => {
|
|
3267
|
+
return /* @__PURE__ */ jsxs11(
|
|
3108
3268
|
"svg",
|
|
3109
3269
|
{
|
|
3110
3270
|
width: "24",
|
|
@@ -3115,14 +3275,14 @@ var HeadingOneIcon = memo8(({ className, ...props }) => {
|
|
|
3115
3275
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3116
3276
|
...props,
|
|
3117
3277
|
children: [
|
|
3118
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ jsx26(
|
|
3119
3279
|
"path",
|
|
3120
3280
|
{
|
|
3121
3281
|
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",
|
|
3122
3282
|
fill: "currentColor"
|
|
3123
3283
|
}
|
|
3124
3284
|
),
|
|
3125
|
-
/* @__PURE__ */
|
|
3285
|
+
/* @__PURE__ */ jsx26(
|
|
3126
3286
|
"path",
|
|
3127
3287
|
{
|
|
3128
3288
|
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",
|
|
@@ -3136,10 +3296,10 @@ var HeadingOneIcon = memo8(({ className, ...props }) => {
|
|
|
3136
3296
|
HeadingOneIcon.displayName = "HeadingOneIcon";
|
|
3137
3297
|
|
|
3138
3298
|
// src/components/tiptap-icons/heading-two-icon.tsx
|
|
3139
|
-
import { memo as
|
|
3140
|
-
import { jsx as
|
|
3141
|
-
var HeadingTwoIcon =
|
|
3142
|
-
return /* @__PURE__ */
|
|
3299
|
+
import { memo as memo5 } from "react";
|
|
3300
|
+
import { jsx as jsx27, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3301
|
+
var HeadingTwoIcon = memo5(({ className, ...props }) => {
|
|
3302
|
+
return /* @__PURE__ */ jsxs12(
|
|
3143
3303
|
"svg",
|
|
3144
3304
|
{
|
|
3145
3305
|
width: "24",
|
|
@@ -3150,14 +3310,14 @@ var HeadingTwoIcon = memo9(({ className, ...props }) => {
|
|
|
3150
3310
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3151
3311
|
...props,
|
|
3152
3312
|
children: [
|
|
3153
|
-
/* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ jsx27(
|
|
3154
3314
|
"path",
|
|
3155
3315
|
{
|
|
3156
3316
|
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",
|
|
3157
3317
|
fill: "currentColor"
|
|
3158
3318
|
}
|
|
3159
3319
|
),
|
|
3160
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ jsx27(
|
|
3161
3321
|
"path",
|
|
3162
3322
|
{
|
|
3163
3323
|
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",
|
|
@@ -3171,10 +3331,10 @@ var HeadingTwoIcon = memo9(({ className, ...props }) => {
|
|
|
3171
3331
|
HeadingTwoIcon.displayName = "HeadingTwoIcon";
|
|
3172
3332
|
|
|
3173
3333
|
// src/components/tiptap-icons/heading-three-icon.tsx
|
|
3174
|
-
import { memo as
|
|
3175
|
-
import { jsx as
|
|
3176
|
-
var HeadingThreeIcon =
|
|
3177
|
-
return /* @__PURE__ */
|
|
3334
|
+
import { memo as memo6 } from "react";
|
|
3335
|
+
import { jsx as jsx28, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3336
|
+
var HeadingThreeIcon = memo6(({ className, ...props }) => {
|
|
3337
|
+
return /* @__PURE__ */ jsxs13(
|
|
3178
3338
|
"svg",
|
|
3179
3339
|
{
|
|
3180
3340
|
width: "24",
|
|
@@ -3185,14 +3345,14 @@ var HeadingThreeIcon = memo10(({ className, ...props }) => {
|
|
|
3185
3345
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3186
3346
|
...props,
|
|
3187
3347
|
children: [
|
|
3188
|
-
/* @__PURE__ */
|
|
3348
|
+
/* @__PURE__ */ jsx28(
|
|
3189
3349
|
"path",
|
|
3190
3350
|
{
|
|
3191
3351
|
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",
|
|
3192
3352
|
fill: "currentColor"
|
|
3193
3353
|
}
|
|
3194
3354
|
),
|
|
3195
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx28(
|
|
3196
3356
|
"path",
|
|
3197
3357
|
{
|
|
3198
3358
|
fillRule: "evenodd",
|
|
@@ -3201,7 +3361,7 @@ var HeadingThreeIcon = memo10(({ className, ...props }) => {
|
|
|
3201
3361
|
fill: "currentColor"
|
|
3202
3362
|
}
|
|
3203
3363
|
),
|
|
3204
|
-
/* @__PURE__ */
|
|
3364
|
+
/* @__PURE__ */ jsx28(
|
|
3205
3365
|
"path",
|
|
3206
3366
|
{
|
|
3207
3367
|
fillRule: "evenodd",
|
|
@@ -3217,10 +3377,10 @@ var HeadingThreeIcon = memo10(({ className, ...props }) => {
|
|
|
3217
3377
|
HeadingThreeIcon.displayName = "HeadingThreeIcon";
|
|
3218
3378
|
|
|
3219
3379
|
// src/components/tiptap-icons/heading-four-icon.tsx
|
|
3220
|
-
import { memo as
|
|
3221
|
-
import { jsx as
|
|
3222
|
-
var HeadingFourIcon =
|
|
3223
|
-
return /* @__PURE__ */
|
|
3380
|
+
import { memo as memo7 } from "react";
|
|
3381
|
+
import { jsx as jsx29, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3382
|
+
var HeadingFourIcon = memo7(({ className, ...props }) => {
|
|
3383
|
+
return /* @__PURE__ */ jsxs14(
|
|
3224
3384
|
"svg",
|
|
3225
3385
|
{
|
|
3226
3386
|
width: "24",
|
|
@@ -3231,14 +3391,14 @@ var HeadingFourIcon = memo11(({ className, ...props }) => {
|
|
|
3231
3391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3232
3392
|
...props,
|
|
3233
3393
|
children: [
|
|
3234
|
-
/* @__PURE__ */
|
|
3394
|
+
/* @__PURE__ */ jsx29(
|
|
3235
3395
|
"path",
|
|
3236
3396
|
{
|
|
3237
3397
|
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",
|
|
3238
3398
|
fill: "currentColor"
|
|
3239
3399
|
}
|
|
3240
3400
|
),
|
|
3241
|
-
/* @__PURE__ */
|
|
3401
|
+
/* @__PURE__ */ jsx29(
|
|
3242
3402
|
"path",
|
|
3243
3403
|
{
|
|
3244
3404
|
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",
|
|
@@ -3252,10 +3412,10 @@ var HeadingFourIcon = memo11(({ className, ...props }) => {
|
|
|
3252
3412
|
HeadingFourIcon.displayName = "HeadingFourIcon";
|
|
3253
3413
|
|
|
3254
3414
|
// src/components/tiptap-icons/heading-five-icon.tsx
|
|
3255
|
-
import { memo as
|
|
3256
|
-
import { jsx as
|
|
3257
|
-
var HeadingFiveIcon =
|
|
3258
|
-
return /* @__PURE__ */
|
|
3415
|
+
import { memo as memo8 } from "react";
|
|
3416
|
+
import { jsx as jsx30, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3417
|
+
var HeadingFiveIcon = memo8(({ className, ...props }) => {
|
|
3418
|
+
return /* @__PURE__ */ jsxs15(
|
|
3259
3419
|
"svg",
|
|
3260
3420
|
{
|
|
3261
3421
|
width: "24",
|
|
@@ -3266,14 +3426,14 @@ var HeadingFiveIcon = memo12(({ className, ...props }) => {
|
|
|
3266
3426
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3267
3427
|
...props,
|
|
3268
3428
|
children: [
|
|
3269
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ jsx30(
|
|
3270
3430
|
"path",
|
|
3271
3431
|
{
|
|
3272
3432
|
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",
|
|
3273
3433
|
fill: "currentColor"
|
|
3274
3434
|
}
|
|
3275
3435
|
),
|
|
3276
|
-
/* @__PURE__ */
|
|
3436
|
+
/* @__PURE__ */ jsx30(
|
|
3277
3437
|
"path",
|
|
3278
3438
|
{
|
|
3279
3439
|
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",
|
|
@@ -3287,10 +3447,10 @@ var HeadingFiveIcon = memo12(({ className, ...props }) => {
|
|
|
3287
3447
|
HeadingFiveIcon.displayName = "HeadingFiveIcon";
|
|
3288
3448
|
|
|
3289
3449
|
// src/components/tiptap-icons/heading-six-icon.tsx
|
|
3290
|
-
import { memo as
|
|
3291
|
-
import { jsx as
|
|
3292
|
-
var HeadingSixIcon =
|
|
3293
|
-
return /* @__PURE__ */
|
|
3450
|
+
import { memo as memo9 } from "react";
|
|
3451
|
+
import { jsx as jsx31, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
3452
|
+
var HeadingSixIcon = memo9(({ className, ...props }) => {
|
|
3453
|
+
return /* @__PURE__ */ jsxs16(
|
|
3294
3454
|
"svg",
|
|
3295
3455
|
{
|
|
3296
3456
|
width: "24",
|
|
@@ -3301,14 +3461,14 @@ var HeadingSixIcon = memo13(({ className, ...props }) => {
|
|
|
3301
3461
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3302
3462
|
...props,
|
|
3303
3463
|
children: [
|
|
3304
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ jsx31(
|
|
3305
3465
|
"path",
|
|
3306
3466
|
{
|
|
3307
3467
|
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",
|
|
3308
3468
|
fill: "currentColor"
|
|
3309
3469
|
}
|
|
3310
3470
|
),
|
|
3311
|
-
/* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ jsx31(
|
|
3312
3472
|
"path",
|
|
3313
3473
|
{
|
|
3314
3474
|
fillRule: "evenodd",
|
|
@@ -3427,7 +3587,7 @@ function useHeading(config) {
|
|
|
3427
3587
|
onToggled
|
|
3428
3588
|
} = config;
|
|
3429
3589
|
const { editor } = useTiptapEditor(providedEditor);
|
|
3430
|
-
const [isVisible, setIsVisible] =
|
|
3590
|
+
const [isVisible, setIsVisible] = useState9(true);
|
|
3431
3591
|
const canToggleState = canToggle(editor, level);
|
|
3432
3592
|
const isActive = isHeadingActive(editor, level);
|
|
3433
3593
|
useEffect5(() => {
|
|
@@ -3441,7 +3601,7 @@ function useHeading(config) {
|
|
|
3441
3601
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
3442
3602
|
};
|
|
3443
3603
|
}, [editor, level, hideWhenUnavailable]);
|
|
3444
|
-
const handleToggle =
|
|
3604
|
+
const handleToggle = useCallback7(() => {
|
|
3445
3605
|
if (!editor) return false;
|
|
3446
3606
|
const success = toggleHeading(editor, level);
|
|
3447
3607
|
if (success) {
|
|
@@ -3462,36 +3622,36 @@ function useHeading(config) {
|
|
|
3462
3622
|
|
|
3463
3623
|
// src/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx
|
|
3464
3624
|
import { forwardRef as forwardRef7 } from "react";
|
|
3465
|
-
import * as
|
|
3466
|
-
import { jsx as
|
|
3467
|
-
function
|
|
3625
|
+
import * as DropdownMenuPrimitive2 from "@radix-ui/react-dropdown-menu";
|
|
3626
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3627
|
+
function DropdownMenu2({
|
|
3468
3628
|
...props
|
|
3469
3629
|
}) {
|
|
3470
|
-
return /* @__PURE__ */
|
|
3630
|
+
return /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Root, { modal: false, ...props });
|
|
3471
3631
|
}
|
|
3472
3632
|
function DropdownMenuPortal({
|
|
3473
3633
|
...props
|
|
3474
3634
|
}) {
|
|
3475
|
-
return /* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Portal, { ...props });
|
|
3476
3636
|
}
|
|
3477
|
-
var
|
|
3478
|
-
|
|
3479
|
-
var
|
|
3637
|
+
var DropdownMenuTrigger2 = forwardRef7(({ ...props }, ref) => /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Trigger, { ref, ...props }));
|
|
3638
|
+
DropdownMenuTrigger2.displayName = DropdownMenuPrimitive2.Trigger.displayName;
|
|
3639
|
+
var DropdownMenuItem2 = DropdownMenuPrimitive2.Item;
|
|
3480
3640
|
var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }, ref) => {
|
|
3481
|
-
const content = /* @__PURE__ */
|
|
3482
|
-
|
|
3641
|
+
const content = /* @__PURE__ */ jsx32(
|
|
3642
|
+
DropdownMenuPrimitive2.SubContent,
|
|
3483
3643
|
{
|
|
3484
3644
|
ref,
|
|
3485
3645
|
className: cn2("tiptap-dropdown-menu", className),
|
|
3486
3646
|
...props
|
|
3487
3647
|
}
|
|
3488
3648
|
);
|
|
3489
|
-
return portal ? /* @__PURE__ */
|
|
3649
|
+
return portal ? /* @__PURE__ */ jsx32(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3490
3650
|
});
|
|
3491
|
-
DropdownMenuSubContent.displayName =
|
|
3492
|
-
var
|
|
3493
|
-
const content = /* @__PURE__ */
|
|
3494
|
-
|
|
3651
|
+
DropdownMenuSubContent.displayName = DropdownMenuPrimitive2.SubContent.displayName;
|
|
3652
|
+
var DropdownMenuContent2 = forwardRef7(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
3653
|
+
const content = /* @__PURE__ */ jsx32(
|
|
3654
|
+
DropdownMenuPrimitive2.Content,
|
|
3495
3655
|
{
|
|
3496
3656
|
ref,
|
|
3497
3657
|
sideOffset,
|
|
@@ -3500,22 +3660,22 @@ var DropdownMenuContent = forwardRef7(({ className, sideOffset = 4, portal = fal
|
|
|
3500
3660
|
...props
|
|
3501
3661
|
}
|
|
3502
3662
|
);
|
|
3503
|
-
return portal ? /* @__PURE__ */
|
|
3663
|
+
return portal ? /* @__PURE__ */ jsx32(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3504
3664
|
});
|
|
3505
|
-
|
|
3665
|
+
DropdownMenuContent2.displayName = DropdownMenuPrimitive2.Content.displayName;
|
|
3506
3666
|
|
|
3507
3667
|
// src/components/tiptap-ui-primitive/card/card.tsx
|
|
3508
3668
|
import { forwardRef as forwardRef8 } from "react";
|
|
3509
|
-
import { jsx as
|
|
3669
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3510
3670
|
var Card = forwardRef8(
|
|
3511
3671
|
({ className, ...props }, ref) => {
|
|
3512
|
-
return /* @__PURE__ */
|
|
3672
|
+
return /* @__PURE__ */ jsx33("div", { ref, className: cn2("tiptap-card", className), ...props });
|
|
3513
3673
|
}
|
|
3514
3674
|
);
|
|
3515
3675
|
Card.displayName = "Card";
|
|
3516
3676
|
var CardHeader = forwardRef8(
|
|
3517
3677
|
({ className, ...props }, ref) => {
|
|
3518
|
-
return /* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsx33(
|
|
3519
3679
|
"div",
|
|
3520
3680
|
{
|
|
3521
3681
|
ref,
|
|
@@ -3528,12 +3688,12 @@ var CardHeader = forwardRef8(
|
|
|
3528
3688
|
CardHeader.displayName = "CardHeader";
|
|
3529
3689
|
var CardBody = forwardRef8(
|
|
3530
3690
|
({ className, ...props }, ref) => {
|
|
3531
|
-
return /* @__PURE__ */
|
|
3691
|
+
return /* @__PURE__ */ jsx33("div", { ref, className: cn2("tiptap-card-body", className), ...props });
|
|
3532
3692
|
}
|
|
3533
3693
|
);
|
|
3534
3694
|
CardBody.displayName = "CardBody";
|
|
3535
3695
|
var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props }, ref) => {
|
|
3536
|
-
return /* @__PURE__ */
|
|
3696
|
+
return /* @__PURE__ */ jsx33(
|
|
3537
3697
|
"div",
|
|
3538
3698
|
{
|
|
3539
3699
|
ref,
|
|
@@ -3546,7 +3706,7 @@ var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props
|
|
|
3546
3706
|
CardItemGroup.displayName = "CardItemGroup";
|
|
3547
3707
|
var CardGroupLabel = forwardRef8(
|
|
3548
3708
|
({ className, ...props }, ref) => {
|
|
3549
|
-
return /* @__PURE__ */
|
|
3709
|
+
return /* @__PURE__ */ jsx33(
|
|
3550
3710
|
"div",
|
|
3551
3711
|
{
|
|
3552
3712
|
ref,
|
|
@@ -3559,7 +3719,7 @@ var CardGroupLabel = forwardRef8(
|
|
|
3559
3719
|
CardGroupLabel.displayName = "CardGroupLabel";
|
|
3560
3720
|
var CardFooter = forwardRef8(
|
|
3561
3721
|
({ className, ...props }, ref) => {
|
|
3562
|
-
return /* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ jsx33(
|
|
3563
3723
|
"div",
|
|
3564
3724
|
{
|
|
3565
3725
|
ref,
|
|
@@ -3572,7 +3732,7 @@ var CardFooter = forwardRef8(
|
|
|
3572
3732
|
CardFooter.displayName = "CardFooter";
|
|
3573
3733
|
|
|
3574
3734
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
3575
|
-
import { jsx as
|
|
3735
|
+
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3576
3736
|
var HeadingDropdownMenu = forwardRef9(
|
|
3577
3737
|
({
|
|
3578
3738
|
editor: providedEditor,
|
|
@@ -3583,13 +3743,13 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3583
3743
|
...buttonProps
|
|
3584
3744
|
}, ref) => {
|
|
3585
3745
|
const { editor } = useTiptapEditor(providedEditor);
|
|
3586
|
-
const [isOpen, setIsOpen] =
|
|
3746
|
+
const [isOpen, setIsOpen] = useState10(false);
|
|
3587
3747
|
const { isVisible, isActive, canToggle: canToggle2, Icon } = useHeadingDropdownMenu({
|
|
3588
3748
|
editor,
|
|
3589
3749
|
levels,
|
|
3590
3750
|
hideWhenUnavailable
|
|
3591
3751
|
});
|
|
3592
|
-
const handleOpenChange =
|
|
3752
|
+
const handleOpenChange = useCallback8(
|
|
3593
3753
|
(open) => {
|
|
3594
3754
|
if (!editor || !canToggle2) return;
|
|
3595
3755
|
setIsOpen(open);
|
|
@@ -3600,8 +3760,8 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3600
3760
|
if (!isVisible) {
|
|
3601
3761
|
return null;
|
|
3602
3762
|
}
|
|
3603
|
-
return /* @__PURE__ */
|
|
3604
|
-
/* @__PURE__ */
|
|
3763
|
+
return /* @__PURE__ */ jsxs17(DropdownMenu2, { modal: true, open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
3764
|
+
/* @__PURE__ */ jsx34(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
3605
3765
|
Button2,
|
|
3606
3766
|
{
|
|
3607
3767
|
type: "button",
|
|
@@ -3617,12 +3777,12 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3617
3777
|
...buttonProps,
|
|
3618
3778
|
ref,
|
|
3619
3779
|
children: [
|
|
3620
|
-
/* @__PURE__ */
|
|
3621
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ jsx34(Icon, { className: "tiptap-button-icon" }),
|
|
3781
|
+
/* @__PURE__ */ jsx34(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
3622
3782
|
]
|
|
3623
3783
|
}
|
|
3624
3784
|
) }),
|
|
3625
|
-
/* @__PURE__ */
|
|
3785
|
+
/* @__PURE__ */ jsx34(DropdownMenuContent2, { align: "start", portal, children: /* @__PURE__ */ jsx34(Card, { children: /* @__PURE__ */ jsx34(CardBody, { children: /* @__PURE__ */ jsx34(ButtonGroup, { children: levels.map((level) => /* @__PURE__ */ jsx34(DropdownMenuItem2, { asChild: true, children: /* @__PURE__ */ jsx34(
|
|
3626
3786
|
HeadingButton,
|
|
3627
3787
|
{
|
|
3628
3788
|
editor,
|
|
@@ -3637,13 +3797,13 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3637
3797
|
HeadingDropdownMenu.displayName = "HeadingDropdownMenu";
|
|
3638
3798
|
|
|
3639
3799
|
// src/components/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.ts
|
|
3640
|
-
import { useEffect as useEffect6, useState as
|
|
3800
|
+
import { useEffect as useEffect6, useState as useState11 } from "react";
|
|
3641
3801
|
|
|
3642
3802
|
// src/components/tiptap-icons/heading-icon.tsx
|
|
3643
|
-
import { memo as
|
|
3644
|
-
import { jsx as
|
|
3645
|
-
var HeadingIcon =
|
|
3646
|
-
return /* @__PURE__ */
|
|
3803
|
+
import { memo as memo10 } from "react";
|
|
3804
|
+
import { jsx as jsx35 } from "react/jsx-runtime";
|
|
3805
|
+
var HeadingIcon = memo10(({ className, ...props }) => {
|
|
3806
|
+
return /* @__PURE__ */ jsx35(
|
|
3647
3807
|
"svg",
|
|
3648
3808
|
{
|
|
3649
3809
|
width: "24",
|
|
@@ -3653,7 +3813,7 @@ var HeadingIcon = memo14(({ className, ...props }) => {
|
|
|
3653
3813
|
fill: "currentColor",
|
|
3654
3814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3655
3815
|
...props,
|
|
3656
|
-
children: /* @__PURE__ */
|
|
3816
|
+
children: /* @__PURE__ */ jsx35(
|
|
3657
3817
|
"path",
|
|
3658
3818
|
{
|
|
3659
3819
|
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",
|
|
@@ -3677,7 +3837,7 @@ function useHeadingDropdownMenu(config) {
|
|
|
3677
3837
|
hideWhenUnavailable = false
|
|
3678
3838
|
} = config || {};
|
|
3679
3839
|
const { editor } = useTiptapEditor(providedEditor);
|
|
3680
|
-
const [isVisible, setIsVisible] =
|
|
3840
|
+
const [isVisible, setIsVisible] = useState11(true);
|
|
3681
3841
|
const activeLevel = getActiveHeadingLevel(editor, levels);
|
|
3682
3842
|
const isActive = isHeadingActive(editor);
|
|
3683
3843
|
const canToggleState = canToggle(editor);
|
|
@@ -3706,12 +3866,12 @@ function useHeadingDropdownMenu(config) {
|
|
|
3706
3866
|
}
|
|
3707
3867
|
|
|
3708
3868
|
// src/components/tiptap-ui/image-upload-button/image-upload-button.tsx
|
|
3709
|
-
import { forwardRef as forwardRef10, useCallback as
|
|
3710
|
-
import { Fragment as
|
|
3869
|
+
import { forwardRef as forwardRef10, useCallback as useCallback9 } from "react";
|
|
3870
|
+
import { Fragment as Fragment4, jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3711
3871
|
function ImageShortcutBadge({
|
|
3712
3872
|
shortcutKeys = IMAGE_UPLOAD_SHORTCUT_KEY
|
|
3713
3873
|
}) {
|
|
3714
|
-
return /* @__PURE__ */
|
|
3874
|
+
return /* @__PURE__ */ jsx36(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3715
3875
|
}
|
|
3716
3876
|
var ImageUploadButton = forwardRef10(
|
|
3717
3877
|
({
|
|
@@ -3739,7 +3899,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3739
3899
|
hideWhenUnavailable,
|
|
3740
3900
|
onInserted
|
|
3741
3901
|
});
|
|
3742
|
-
const handleClick =
|
|
3902
|
+
const handleClick = useCallback9(
|
|
3743
3903
|
async (event) => {
|
|
3744
3904
|
onClick?.(event);
|
|
3745
3905
|
if (event.defaultPrevented) return;
|
|
@@ -3751,7 +3911,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3751
3911
|
return null;
|
|
3752
3912
|
}
|
|
3753
3913
|
const RenderIcon = CustomIcon ?? Icon;
|
|
3754
|
-
return /* @__PURE__ */
|
|
3914
|
+
return /* @__PURE__ */ jsx36(
|
|
3755
3915
|
Button2,
|
|
3756
3916
|
{
|
|
3757
3917
|
type: "button",
|
|
@@ -3767,10 +3927,10 @@ var ImageUploadButton = forwardRef10(
|
|
|
3767
3927
|
onClick: handleClick,
|
|
3768
3928
|
...buttonProps,
|
|
3769
3929
|
ref,
|
|
3770
|
-
children: children ?? /* @__PURE__ */
|
|
3771
|
-
/* @__PURE__ */
|
|
3772
|
-
text && /* @__PURE__ */
|
|
3773
|
-
showShortcut && /* @__PURE__ */
|
|
3930
|
+
children: children ?? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
3931
|
+
/* @__PURE__ */ jsx36(RenderIcon, { className: "tiptap-button-icon" }),
|
|
3932
|
+
text && /* @__PURE__ */ jsx36("span", { className: "tiptap-button-text", children: text }),
|
|
3933
|
+
showShortcut && /* @__PURE__ */ jsx36(ImageShortcutBadge, { shortcutKeys })
|
|
3774
3934
|
] })
|
|
3775
3935
|
}
|
|
3776
3936
|
);
|
|
@@ -3779,13 +3939,13 @@ var ImageUploadButton = forwardRef10(
|
|
|
3779
3939
|
ImageUploadButton.displayName = "ImageUploadButton";
|
|
3780
3940
|
|
|
3781
3941
|
// src/components/tiptap-ui/image-upload-button/use-image-upload.ts
|
|
3782
|
-
import { useCallback as
|
|
3942
|
+
import { useCallback as useCallback10, useEffect as useEffect8, useState as useState13 } from "react";
|
|
3783
3943
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
3784
3944
|
|
|
3785
3945
|
// src/hooks/use-is-breakpoint.ts
|
|
3786
|
-
import { useEffect as useEffect7, useState as
|
|
3946
|
+
import { useEffect as useEffect7, useState as useState12 } from "react";
|
|
3787
3947
|
function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
3788
|
-
const [matches, setMatches] =
|
|
3948
|
+
const [matches, setMatches] = useState12(void 0);
|
|
3789
3949
|
useEffect7(() => {
|
|
3790
3950
|
const query = mode === "min" ? `(min-width: ${breakpoint}px)` : `(max-width: ${breakpoint - 1}px)`;
|
|
3791
3951
|
const mql = window.matchMedia(query);
|
|
@@ -3798,10 +3958,10 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
3798
3958
|
}
|
|
3799
3959
|
|
|
3800
3960
|
// src/components/tiptap-icons/image-plus-icon.tsx
|
|
3801
|
-
import { memo as
|
|
3802
|
-
import { jsx as
|
|
3803
|
-
var ImagePlusIcon =
|
|
3804
|
-
return /* @__PURE__ */
|
|
3961
|
+
import { memo as memo11 } from "react";
|
|
3962
|
+
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
3963
|
+
var ImagePlusIcon = memo11(({ className, ...props }) => {
|
|
3964
|
+
return /* @__PURE__ */ jsx37(
|
|
3805
3965
|
"svg",
|
|
3806
3966
|
{
|
|
3807
3967
|
width: "24",
|
|
@@ -3811,7 +3971,7 @@ var ImagePlusIcon = memo15(({ className, ...props }) => {
|
|
|
3811
3971
|
fill: "currentColor",
|
|
3812
3972
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3813
3973
|
...props,
|
|
3814
|
-
children: /* @__PURE__ */
|
|
3974
|
+
children: /* @__PURE__ */ jsx37(
|
|
3815
3975
|
"path",
|
|
3816
3976
|
{
|
|
3817
3977
|
fillRule: "evenodd",
|
|
@@ -3885,7 +4045,7 @@ function useImageUpload(config) {
|
|
|
3885
4045
|
} = config || {};
|
|
3886
4046
|
const { editor } = useTiptapEditor(providedEditor);
|
|
3887
4047
|
const isMobile = useIsBreakpoint();
|
|
3888
|
-
const [isVisible, setIsVisible] =
|
|
4048
|
+
const [isVisible, setIsVisible] = useState13(true);
|
|
3889
4049
|
const canInsert = canInsertImage(editor);
|
|
3890
4050
|
const isActive = isImageActive(editor);
|
|
3891
4051
|
useEffect8(() => {
|
|
@@ -3899,7 +4059,7 @@ function useImageUpload(config) {
|
|
|
3899
4059
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
3900
4060
|
};
|
|
3901
4061
|
}, [editor, hideWhenUnavailable]);
|
|
3902
|
-
const handleImage =
|
|
4062
|
+
const handleImage = useCallback10(async () => {
|
|
3903
4063
|
if (!editor) return false;
|
|
3904
4064
|
const success = insertImage(editor);
|
|
3905
4065
|
if (await success) {
|
|
@@ -3931,16 +4091,16 @@ function useImageUpload(config) {
|
|
|
3931
4091
|
}
|
|
3932
4092
|
|
|
3933
4093
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
3934
|
-
import { useCallback as
|
|
4094
|
+
import { useCallback as useCallback13, useState as useState16 } from "react";
|
|
3935
4095
|
|
|
3936
4096
|
// src/components/tiptap-ui/list-button/list-button.tsx
|
|
3937
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
3938
|
-
import { Fragment as
|
|
4097
|
+
import { forwardRef as forwardRef11, useCallback as useCallback11 } from "react";
|
|
4098
|
+
import { Fragment as Fragment5, jsx as jsx38, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3939
4099
|
function ListShortcutBadge({
|
|
3940
4100
|
type,
|
|
3941
4101
|
shortcutKeys = LIST_SHORTCUT_KEYS[type]
|
|
3942
4102
|
}) {
|
|
3943
|
-
return /* @__PURE__ */
|
|
4103
|
+
return /* @__PURE__ */ jsx38(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3944
4104
|
}
|
|
3945
4105
|
var ListButton = forwardRef11(
|
|
3946
4106
|
({
|
|
@@ -3969,7 +4129,7 @@ var ListButton = forwardRef11(
|
|
|
3969
4129
|
hideWhenUnavailable,
|
|
3970
4130
|
onToggled
|
|
3971
4131
|
});
|
|
3972
|
-
const handleClick =
|
|
4132
|
+
const handleClick = useCallback11(
|
|
3973
4133
|
(event) => {
|
|
3974
4134
|
onClick?.(event);
|
|
3975
4135
|
if (event.defaultPrevented) return;
|
|
@@ -3980,7 +4140,7 @@ var ListButton = forwardRef11(
|
|
|
3980
4140
|
if (!isVisible) {
|
|
3981
4141
|
return null;
|
|
3982
4142
|
}
|
|
3983
|
-
return /* @__PURE__ */
|
|
4143
|
+
return /* @__PURE__ */ jsx38(
|
|
3984
4144
|
Button2,
|
|
3985
4145
|
{
|
|
3986
4146
|
type: "button",
|
|
@@ -3996,10 +4156,10 @@ var ListButton = forwardRef11(
|
|
|
3996
4156
|
onClick: handleClick,
|
|
3997
4157
|
...buttonProps,
|
|
3998
4158
|
ref,
|
|
3999
|
-
children: children ?? /* @__PURE__ */
|
|
4000
|
-
/* @__PURE__ */
|
|
4001
|
-
text && /* @__PURE__ */
|
|
4002
|
-
showShortcut && /* @__PURE__ */
|
|
4159
|
+
children: children ?? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
4160
|
+
/* @__PURE__ */ jsx38(Icon, { className: "tiptap-button-icon" }),
|
|
4161
|
+
text && /* @__PURE__ */ jsx38("span", { className: "tiptap-button-text", children: text }),
|
|
4162
|
+
showShortcut && /* @__PURE__ */ jsx38(ListShortcutBadge, { type, shortcutKeys })
|
|
4003
4163
|
] })
|
|
4004
4164
|
}
|
|
4005
4165
|
);
|
|
@@ -4008,14 +4168,14 @@ var ListButton = forwardRef11(
|
|
|
4008
4168
|
ListButton.displayName = "ListButton";
|
|
4009
4169
|
|
|
4010
4170
|
// src/components/tiptap-ui/list-button/use-list.ts
|
|
4011
|
-
import { useCallback as
|
|
4171
|
+
import { useCallback as useCallback12, useEffect as useEffect9, useState as useState14 } from "react";
|
|
4012
4172
|
import { NodeSelection as NodeSelection3, TextSelection as TextSelection3 } from "@tiptap/pm/state";
|
|
4013
4173
|
|
|
4014
4174
|
// src/components/tiptap-icons/list-icon.tsx
|
|
4015
|
-
import { memo as
|
|
4016
|
-
import { jsx as
|
|
4017
|
-
var ListIcon =
|
|
4018
|
-
return /* @__PURE__ */
|
|
4175
|
+
import { memo as memo12 } from "react";
|
|
4176
|
+
import { jsx as jsx39, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4177
|
+
var ListIcon = memo12(({ className, ...props }) => {
|
|
4178
|
+
return /* @__PURE__ */ jsxs20(
|
|
4019
4179
|
"svg",
|
|
4020
4180
|
{
|
|
4021
4181
|
width: "24",
|
|
@@ -4026,7 +4186,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4026
4186
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4027
4187
|
...props,
|
|
4028
4188
|
children: [
|
|
4029
|
-
/* @__PURE__ */
|
|
4189
|
+
/* @__PURE__ */ jsx39(
|
|
4030
4190
|
"path",
|
|
4031
4191
|
{
|
|
4032
4192
|
fillRule: "evenodd",
|
|
@@ -4035,7 +4195,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4035
4195
|
fill: "currentColor"
|
|
4036
4196
|
}
|
|
4037
4197
|
),
|
|
4038
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ jsx39(
|
|
4039
4199
|
"path",
|
|
4040
4200
|
{
|
|
4041
4201
|
fillRule: "evenodd",
|
|
@@ -4044,7 +4204,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4044
4204
|
fill: "currentColor"
|
|
4045
4205
|
}
|
|
4046
4206
|
),
|
|
4047
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsx39(
|
|
4048
4208
|
"path",
|
|
4049
4209
|
{
|
|
4050
4210
|
fillRule: "evenodd",
|
|
@@ -4053,7 +4213,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4053
4213
|
fill: "currentColor"
|
|
4054
4214
|
}
|
|
4055
4215
|
),
|
|
4056
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ jsx39(
|
|
4057
4217
|
"path",
|
|
4058
4218
|
{
|
|
4059
4219
|
fillRule: "evenodd",
|
|
@@ -4062,7 +4222,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4062
4222
|
fill: "currentColor"
|
|
4063
4223
|
}
|
|
4064
4224
|
),
|
|
4065
|
-
/* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ jsx39(
|
|
4066
4226
|
"path",
|
|
4067
4227
|
{
|
|
4068
4228
|
fillRule: "evenodd",
|
|
@@ -4071,7 +4231,7 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4071
4231
|
fill: "currentColor"
|
|
4072
4232
|
}
|
|
4073
4233
|
),
|
|
4074
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ jsx39(
|
|
4075
4235
|
"path",
|
|
4076
4236
|
{
|
|
4077
4237
|
fillRule: "evenodd",
|
|
@@ -4087,10 +4247,10 @@ var ListIcon = memo16(({ className, ...props }) => {
|
|
|
4087
4247
|
ListIcon.displayName = "ListIcon";
|
|
4088
4248
|
|
|
4089
4249
|
// src/components/tiptap-icons/list-ordered-icon.tsx
|
|
4090
|
-
import { memo as
|
|
4091
|
-
import { jsx as
|
|
4092
|
-
var ListOrderedIcon =
|
|
4093
|
-
return /* @__PURE__ */
|
|
4250
|
+
import { memo as memo13 } from "react";
|
|
4251
|
+
import { jsx as jsx40, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
4252
|
+
var ListOrderedIcon = memo13(({ className, ...props }) => {
|
|
4253
|
+
return /* @__PURE__ */ jsxs21(
|
|
4094
4254
|
"svg",
|
|
4095
4255
|
{
|
|
4096
4256
|
width: "24",
|
|
@@ -4101,7 +4261,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4101
4261
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4102
4262
|
...props,
|
|
4103
4263
|
children: [
|
|
4104
|
-
/* @__PURE__ */
|
|
4264
|
+
/* @__PURE__ */ jsx40(
|
|
4105
4265
|
"path",
|
|
4106
4266
|
{
|
|
4107
4267
|
fillRule: "evenodd",
|
|
@@ -4110,7 +4270,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4110
4270
|
fill: "currentColor"
|
|
4111
4271
|
}
|
|
4112
4272
|
),
|
|
4113
|
-
/* @__PURE__ */
|
|
4273
|
+
/* @__PURE__ */ jsx40(
|
|
4114
4274
|
"path",
|
|
4115
4275
|
{
|
|
4116
4276
|
fillRule: "evenodd",
|
|
@@ -4119,7 +4279,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4119
4279
|
fill: "currentColor"
|
|
4120
4280
|
}
|
|
4121
4281
|
),
|
|
4122
|
-
/* @__PURE__ */
|
|
4282
|
+
/* @__PURE__ */ jsx40(
|
|
4123
4283
|
"path",
|
|
4124
4284
|
{
|
|
4125
4285
|
fillRule: "evenodd",
|
|
@@ -4128,7 +4288,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4128
4288
|
fill: "currentColor"
|
|
4129
4289
|
}
|
|
4130
4290
|
),
|
|
4131
|
-
/* @__PURE__ */
|
|
4291
|
+
/* @__PURE__ */ jsx40(
|
|
4132
4292
|
"path",
|
|
4133
4293
|
{
|
|
4134
4294
|
fillRule: "evenodd",
|
|
@@ -4137,7 +4297,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4137
4297
|
fill: "currentColor"
|
|
4138
4298
|
}
|
|
4139
4299
|
),
|
|
4140
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ jsx40(
|
|
4141
4301
|
"path",
|
|
4142
4302
|
{
|
|
4143
4303
|
fillRule: "evenodd",
|
|
@@ -4146,7 +4306,7 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4146
4306
|
fill: "currentColor"
|
|
4147
4307
|
}
|
|
4148
4308
|
),
|
|
4149
|
-
/* @__PURE__ */
|
|
4309
|
+
/* @__PURE__ */ jsx40(
|
|
4150
4310
|
"path",
|
|
4151
4311
|
{
|
|
4152
4312
|
fillRule: "evenodd",
|
|
@@ -4162,10 +4322,10 @@ var ListOrderedIcon = memo17(({ className, ...props }) => {
|
|
|
4162
4322
|
ListOrderedIcon.displayName = "ListOrderedIcon";
|
|
4163
4323
|
|
|
4164
4324
|
// src/components/tiptap-icons/list-todo-icon.tsx
|
|
4165
|
-
import { memo as
|
|
4166
|
-
import { jsx as
|
|
4167
|
-
var ListTodoIcon =
|
|
4168
|
-
return /* @__PURE__ */
|
|
4325
|
+
import { memo as memo14 } from "react";
|
|
4326
|
+
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
4327
|
+
var ListTodoIcon = memo14(({ className, ...props }) => {
|
|
4328
|
+
return /* @__PURE__ */ jsxs22(
|
|
4169
4329
|
"svg",
|
|
4170
4330
|
{
|
|
4171
4331
|
width: "24",
|
|
@@ -4176,7 +4336,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4176
4336
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4177
4337
|
...props,
|
|
4178
4338
|
children: [
|
|
4179
|
-
/* @__PURE__ */
|
|
4339
|
+
/* @__PURE__ */ jsx41(
|
|
4180
4340
|
"path",
|
|
4181
4341
|
{
|
|
4182
4342
|
fillRule: "evenodd",
|
|
@@ -4185,7 +4345,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4185
4345
|
fill: "currentColor"
|
|
4186
4346
|
}
|
|
4187
4347
|
),
|
|
4188
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ jsx41(
|
|
4189
4349
|
"path",
|
|
4190
4350
|
{
|
|
4191
4351
|
fillRule: "evenodd",
|
|
@@ -4194,7 +4354,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4194
4354
|
fill: "currentColor"
|
|
4195
4355
|
}
|
|
4196
4356
|
),
|
|
4197
|
-
/* @__PURE__ */
|
|
4357
|
+
/* @__PURE__ */ jsx41(
|
|
4198
4358
|
"path",
|
|
4199
4359
|
{
|
|
4200
4360
|
fillRule: "evenodd",
|
|
@@ -4203,7 +4363,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4203
4363
|
fill: "currentColor"
|
|
4204
4364
|
}
|
|
4205
4365
|
),
|
|
4206
|
-
/* @__PURE__ */
|
|
4366
|
+
/* @__PURE__ */ jsx41(
|
|
4207
4367
|
"path",
|
|
4208
4368
|
{
|
|
4209
4369
|
fillRule: "evenodd",
|
|
@@ -4212,7 +4372,7 @@ var ListTodoIcon = memo18(({ className, ...props }) => {
|
|
|
4212
4372
|
fill: "currentColor"
|
|
4213
4373
|
}
|
|
4214
4374
|
),
|
|
4215
|
-
/* @__PURE__ */
|
|
4375
|
+
/* @__PURE__ */ jsx41(
|
|
4216
4376
|
"path",
|
|
4217
4377
|
{
|
|
4218
4378
|
fillRule: "evenodd",
|
|
@@ -4356,7 +4516,7 @@ function useList(config) {
|
|
|
4356
4516
|
onToggled
|
|
4357
4517
|
} = config;
|
|
4358
4518
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4359
|
-
const [isVisible, setIsVisible] =
|
|
4519
|
+
const [isVisible, setIsVisible] = useState14(true);
|
|
4360
4520
|
const canToggle2 = canToggleList(editor, type);
|
|
4361
4521
|
const isActive = isListActive(editor, type);
|
|
4362
4522
|
useEffect9(() => {
|
|
@@ -4370,7 +4530,7 @@ function useList(config) {
|
|
|
4370
4530
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4371
4531
|
};
|
|
4372
4532
|
}, [editor, type, hideWhenUnavailable]);
|
|
4373
|
-
const handleToggle =
|
|
4533
|
+
const handleToggle = useCallback12(() => {
|
|
4374
4534
|
if (!editor) return false;
|
|
4375
4535
|
const success = toggleList(editor, type);
|
|
4376
4536
|
if (success) {
|
|
@@ -4390,7 +4550,7 @@ function useList(config) {
|
|
|
4390
4550
|
}
|
|
4391
4551
|
|
|
4392
4552
|
// src/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts
|
|
4393
|
-
import { useEffect as useEffect10, useMemo as
|
|
4553
|
+
import { useEffect as useEffect10, useMemo as useMemo7, useState as useState15 } from "react";
|
|
4394
4554
|
var listOptions = [
|
|
4395
4555
|
{
|
|
4396
4556
|
label: "Bullet List",
|
|
@@ -4442,9 +4602,9 @@ function useListDropdownMenu(config) {
|
|
|
4442
4602
|
hideWhenUnavailable = false
|
|
4443
4603
|
} = config || {};
|
|
4444
4604
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4445
|
-
const [isVisible, setIsVisible] =
|
|
4605
|
+
const [isVisible, setIsVisible] = useState15(true);
|
|
4446
4606
|
const listInSchema = types.some((type) => isNodeInSchema(type, editor));
|
|
4447
|
-
const filteredLists =
|
|
4607
|
+
const filteredLists = useMemo7(() => getFilteredListOptions(types), [types]);
|
|
4448
4608
|
const canToggleAny = canToggleAnyList(editor, types);
|
|
4449
4609
|
const isAnyActive = isAnyListActive(editor, types);
|
|
4450
4610
|
const activeType = getActiveListType(editor, types);
|
|
@@ -4481,7 +4641,7 @@ function useListDropdownMenu(config) {
|
|
|
4481
4641
|
}
|
|
4482
4642
|
|
|
4483
4643
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
4484
|
-
import { jsx as
|
|
4644
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4485
4645
|
function ListDropdownMenu({
|
|
4486
4646
|
editor: providedEditor,
|
|
4487
4647
|
types = ["bulletList", "orderedList", "taskList"],
|
|
@@ -4491,13 +4651,13 @@ function ListDropdownMenu({
|
|
|
4491
4651
|
...props
|
|
4492
4652
|
}) {
|
|
4493
4653
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4494
|
-
const [isOpen, setIsOpen] =
|
|
4654
|
+
const [isOpen, setIsOpen] = useState16(false);
|
|
4495
4655
|
const { filteredLists, canToggle: canToggle2, isActive, isVisible, Icon } = useListDropdownMenu({
|
|
4496
4656
|
editor,
|
|
4497
4657
|
types,
|
|
4498
4658
|
hideWhenUnavailable
|
|
4499
4659
|
});
|
|
4500
|
-
const handleOnOpenChange =
|
|
4660
|
+
const handleOnOpenChange = useCallback13(
|
|
4501
4661
|
(open) => {
|
|
4502
4662
|
setIsOpen(open);
|
|
4503
4663
|
onOpenChange?.(open);
|
|
@@ -4507,8 +4667,8 @@ function ListDropdownMenu({
|
|
|
4507
4667
|
if (!isVisible) {
|
|
4508
4668
|
return null;
|
|
4509
4669
|
}
|
|
4510
|
-
return /* @__PURE__ */
|
|
4511
|
-
/* @__PURE__ */
|
|
4670
|
+
return /* @__PURE__ */ jsxs23(DropdownMenu2, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4671
|
+
/* @__PURE__ */ jsx42(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs23(
|
|
4512
4672
|
Button2,
|
|
4513
4673
|
{
|
|
4514
4674
|
type: "button",
|
|
@@ -4522,12 +4682,12 @@ function ListDropdownMenu({
|
|
|
4522
4682
|
tooltip: "List",
|
|
4523
4683
|
...props,
|
|
4524
4684
|
children: [
|
|
4525
|
-
/* @__PURE__ */
|
|
4526
|
-
/* @__PURE__ */
|
|
4685
|
+
/* @__PURE__ */ jsx42(Icon, { className: "tiptap-button-icon" }),
|
|
4686
|
+
/* @__PURE__ */ jsx42(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
4527
4687
|
]
|
|
4528
4688
|
}
|
|
4529
4689
|
) }),
|
|
4530
|
-
/* @__PURE__ */
|
|
4690
|
+
/* @__PURE__ */ jsx42(DropdownMenuContent2, { align: "start", portal, children: /* @__PURE__ */ jsx42(Card, { children: /* @__PURE__ */ jsx42(CardBody, { children: /* @__PURE__ */ jsx42(ButtonGroup, { children: filteredLists.map((option) => /* @__PURE__ */ jsx42(DropdownMenuItem2, { asChild: true, children: /* @__PURE__ */ jsx42(
|
|
4531
4691
|
ListButton,
|
|
4532
4692
|
{
|
|
4533
4693
|
editor,
|
|
@@ -4540,12 +4700,12 @@ function ListDropdownMenu({
|
|
|
4540
4700
|
}
|
|
4541
4701
|
|
|
4542
4702
|
// src/components/tiptap-ui/blockquote-button/blockquote-button.tsx
|
|
4543
|
-
import { forwardRef as forwardRef12, useCallback as
|
|
4544
|
-
import { Fragment as
|
|
4703
|
+
import { forwardRef as forwardRef12, useCallback as useCallback14 } from "react";
|
|
4704
|
+
import { Fragment as Fragment6, jsx as jsx43, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
4545
4705
|
function BlockquoteShortcutBadge({
|
|
4546
4706
|
shortcutKeys = BLOCKQUOTE_SHORTCUT_KEY
|
|
4547
4707
|
}) {
|
|
4548
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsx43(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4549
4709
|
}
|
|
4550
4710
|
var BlockquoteButton = forwardRef12(
|
|
4551
4711
|
({
|
|
@@ -4572,7 +4732,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4572
4732
|
hideWhenUnavailable,
|
|
4573
4733
|
onToggled
|
|
4574
4734
|
});
|
|
4575
|
-
const handleClick =
|
|
4735
|
+
const handleClick = useCallback14(
|
|
4576
4736
|
(event) => {
|
|
4577
4737
|
onClick?.(event);
|
|
4578
4738
|
if (event.defaultPrevented) return;
|
|
@@ -4583,7 +4743,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4583
4743
|
if (!isVisible) {
|
|
4584
4744
|
return null;
|
|
4585
4745
|
}
|
|
4586
|
-
return /* @__PURE__ */
|
|
4746
|
+
return /* @__PURE__ */ jsx43(
|
|
4587
4747
|
Button2,
|
|
4588
4748
|
{
|
|
4589
4749
|
type: "button",
|
|
@@ -4599,10 +4759,10 @@ var BlockquoteButton = forwardRef12(
|
|
|
4599
4759
|
onClick: handleClick,
|
|
4600
4760
|
...buttonProps,
|
|
4601
4761
|
ref,
|
|
4602
|
-
children: children ?? /* @__PURE__ */
|
|
4603
|
-
/* @__PURE__ */
|
|
4604
|
-
text && /* @__PURE__ */
|
|
4605
|
-
showShortcut && /* @__PURE__ */
|
|
4762
|
+
children: children ?? /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
4763
|
+
/* @__PURE__ */ jsx43(Icon, { className: "tiptap-button-icon" }),
|
|
4764
|
+
text && /* @__PURE__ */ jsx43("span", { className: "tiptap-button-text", children: text }),
|
|
4765
|
+
showShortcut && /* @__PURE__ */ jsx43(BlockquoteShortcutBadge, { shortcutKeys })
|
|
4606
4766
|
] })
|
|
4607
4767
|
}
|
|
4608
4768
|
);
|
|
@@ -4611,14 +4771,14 @@ var BlockquoteButton = forwardRef12(
|
|
|
4611
4771
|
BlockquoteButton.displayName = "BlockquoteButton";
|
|
4612
4772
|
|
|
4613
4773
|
// src/components/tiptap-ui/blockquote-button/use-blockquote.ts
|
|
4614
|
-
import { useCallback as
|
|
4774
|
+
import { useCallback as useCallback15, useEffect as useEffect11, useState as useState17 } from "react";
|
|
4615
4775
|
import { NodeSelection as NodeSelection4, TextSelection as TextSelection4 } from "@tiptap/pm/state";
|
|
4616
4776
|
|
|
4617
4777
|
// src/components/tiptap-icons/blockquote-icon.tsx
|
|
4618
|
-
import { memo as
|
|
4619
|
-
import { jsx as
|
|
4620
|
-
var BlockquoteIcon =
|
|
4621
|
-
return /* @__PURE__ */
|
|
4778
|
+
import { memo as memo15 } from "react";
|
|
4779
|
+
import { jsx as jsx44, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
4780
|
+
var BlockquoteIcon = memo15(({ className, ...props }) => {
|
|
4781
|
+
return /* @__PURE__ */ jsxs25(
|
|
4622
4782
|
"svg",
|
|
4623
4783
|
{
|
|
4624
4784
|
width: "24",
|
|
@@ -4629,7 +4789,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4629
4789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4630
4790
|
...props,
|
|
4631
4791
|
children: [
|
|
4632
|
-
/* @__PURE__ */
|
|
4792
|
+
/* @__PURE__ */ jsx44(
|
|
4633
4793
|
"path",
|
|
4634
4794
|
{
|
|
4635
4795
|
fillRule: "evenodd",
|
|
@@ -4638,7 +4798,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4638
4798
|
fill: "currentColor"
|
|
4639
4799
|
}
|
|
4640
4800
|
),
|
|
4641
|
-
/* @__PURE__ */
|
|
4801
|
+
/* @__PURE__ */ jsx44(
|
|
4642
4802
|
"path",
|
|
4643
4803
|
{
|
|
4644
4804
|
fillRule: "evenodd",
|
|
@@ -4647,7 +4807,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4647
4807
|
fill: "currentColor"
|
|
4648
4808
|
}
|
|
4649
4809
|
),
|
|
4650
|
-
/* @__PURE__ */
|
|
4810
|
+
/* @__PURE__ */ jsx44(
|
|
4651
4811
|
"path",
|
|
4652
4812
|
{
|
|
4653
4813
|
fillRule: "evenodd",
|
|
@@ -4656,7 +4816,7 @@ var BlockquoteIcon = memo19(({ className, ...props }) => {
|
|
|
4656
4816
|
fill: "currentColor"
|
|
4657
4817
|
}
|
|
4658
4818
|
),
|
|
4659
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ jsx44(
|
|
4660
4820
|
"path",
|
|
4661
4821
|
{
|
|
4662
4822
|
fillRule: "evenodd",
|
|
@@ -4744,7 +4904,7 @@ function useBlockquote(config) {
|
|
|
4744
4904
|
onToggled
|
|
4745
4905
|
} = config || {};
|
|
4746
4906
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4747
|
-
const [isVisible, setIsVisible] =
|
|
4907
|
+
const [isVisible, setIsVisible] = useState17(true);
|
|
4748
4908
|
const canToggle2 = canToggleBlockquote(editor);
|
|
4749
4909
|
const isActive = editor?.isActive("blockquote") || false;
|
|
4750
4910
|
useEffect11(() => {
|
|
@@ -4758,7 +4918,7 @@ function useBlockquote(config) {
|
|
|
4758
4918
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4759
4919
|
};
|
|
4760
4920
|
}, [editor, hideWhenUnavailable]);
|
|
4761
|
-
const handleToggle =
|
|
4921
|
+
const handleToggle = useCallback15(() => {
|
|
4762
4922
|
if (!editor) return false;
|
|
4763
4923
|
const success = toggleBlockquote(editor);
|
|
4764
4924
|
if (success) {
|
|
@@ -4778,13 +4938,13 @@ function useBlockquote(config) {
|
|
|
4778
4938
|
}
|
|
4779
4939
|
|
|
4780
4940
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
4781
|
-
import { forwardRef as forwardRef14, useMemo as
|
|
4941
|
+
import { forwardRef as forwardRef14, useMemo as useMemo9, useRef as useRef6, useState as useState19 } from "react";
|
|
4782
4942
|
|
|
4783
4943
|
// src/components/tiptap-icons/ban-icon.tsx
|
|
4784
|
-
import { memo as
|
|
4785
|
-
import { jsx as
|
|
4786
|
-
var BanIcon =
|
|
4787
|
-
return /* @__PURE__ */
|
|
4944
|
+
import { memo as memo16 } from "react";
|
|
4945
|
+
import { jsx as jsx45 } from "react/jsx-runtime";
|
|
4946
|
+
var BanIcon = memo16(({ className, ...props }) => {
|
|
4947
|
+
return /* @__PURE__ */ jsx45(
|
|
4788
4948
|
"svg",
|
|
4789
4949
|
{
|
|
4790
4950
|
width: "24",
|
|
@@ -4794,7 +4954,7 @@ var BanIcon = memo20(({ className, ...props }) => {
|
|
|
4794
4954
|
fill: "currentColor",
|
|
4795
4955
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4796
4956
|
...props,
|
|
4797
|
-
children: /* @__PURE__ */
|
|
4957
|
+
children: /* @__PURE__ */ jsx45(
|
|
4798
4958
|
"path",
|
|
4799
4959
|
{
|
|
4800
4960
|
fillRule: "evenodd",
|
|
@@ -4809,10 +4969,10 @@ var BanIcon = memo20(({ className, ...props }) => {
|
|
|
4809
4969
|
BanIcon.displayName = "BanIcon";
|
|
4810
4970
|
|
|
4811
4971
|
// src/components/tiptap-icons/highlighter-icon.tsx
|
|
4812
|
-
import { memo as
|
|
4813
|
-
import { jsx as
|
|
4814
|
-
var HighlighterIcon =
|
|
4815
|
-
return /* @__PURE__ */
|
|
4972
|
+
import { memo as memo17 } from "react";
|
|
4973
|
+
import { jsx as jsx46 } from "react/jsx-runtime";
|
|
4974
|
+
var HighlighterIcon = memo17(({ className, ...props }) => {
|
|
4975
|
+
return /* @__PURE__ */ jsx46(
|
|
4816
4976
|
"svg",
|
|
4817
4977
|
{
|
|
4818
4978
|
width: "24",
|
|
@@ -4822,7 +4982,7 @@ var HighlighterIcon = memo21(({ className, ...props }) => {
|
|
|
4822
4982
|
fill: "currentColor",
|
|
4823
4983
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4824
4984
|
...props,
|
|
4825
|
-
children: /* @__PURE__ */
|
|
4985
|
+
children: /* @__PURE__ */ jsx46(
|
|
4826
4986
|
"path",
|
|
4827
4987
|
{
|
|
4828
4988
|
fillRule: "evenodd",
|
|
@@ -4838,16 +4998,16 @@ HighlighterIcon.displayName = "HighlighterIcon";
|
|
|
4838
4998
|
|
|
4839
4999
|
// src/components/tiptap-ui-primitive/popover/popover.tsx
|
|
4840
5000
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4841
|
-
import { jsx as
|
|
5001
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4842
5002
|
function Popover({
|
|
4843
5003
|
...props
|
|
4844
5004
|
}) {
|
|
4845
|
-
return /* @__PURE__ */
|
|
5005
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Root, { ...props });
|
|
4846
5006
|
}
|
|
4847
5007
|
function PopoverTrigger({
|
|
4848
5008
|
...props
|
|
4849
5009
|
}) {
|
|
4850
|
-
return /* @__PURE__ */
|
|
5010
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Trigger, { ...props });
|
|
4851
5011
|
}
|
|
4852
5012
|
function PopoverContent({
|
|
4853
5013
|
className,
|
|
@@ -4855,7 +5015,7 @@ function PopoverContent({
|
|
|
4855
5015
|
sideOffset = 4,
|
|
4856
5016
|
...props
|
|
4857
5017
|
}) {
|
|
4858
|
-
return /* @__PURE__ */
|
|
5018
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx47(
|
|
4859
5019
|
PopoverPrimitive.Content,
|
|
4860
5020
|
{
|
|
4861
5021
|
align,
|
|
@@ -4867,12 +5027,12 @@ function PopoverContent({
|
|
|
4867
5027
|
}
|
|
4868
5028
|
|
|
4869
5029
|
// src/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx
|
|
4870
|
-
import { forwardRef as forwardRef13, useCallback as
|
|
4871
|
-
import { Fragment as
|
|
5030
|
+
import { forwardRef as forwardRef13, useCallback as useCallback16, useMemo as useMemo8 } from "react";
|
|
5031
|
+
import { Fragment as Fragment7, jsx as jsx48, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
4872
5032
|
function ColorHighlightShortcutBadge({
|
|
4873
5033
|
shortcutKeys = COLOR_HIGHLIGHT_SHORTCUT_KEY
|
|
4874
5034
|
}) {
|
|
4875
|
-
return /* @__PURE__ */
|
|
5035
|
+
return /* @__PURE__ */ jsx48(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4876
5036
|
}
|
|
4877
5037
|
var ColorHighlightButton = forwardRef13(
|
|
4878
5038
|
({
|
|
@@ -4904,7 +5064,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4904
5064
|
mode,
|
|
4905
5065
|
onApplied
|
|
4906
5066
|
});
|
|
4907
|
-
const handleClick =
|
|
5067
|
+
const handleClick = useCallback16(
|
|
4908
5068
|
(event) => {
|
|
4909
5069
|
onClick?.(event);
|
|
4910
5070
|
if (event.defaultPrevented) return;
|
|
@@ -4912,7 +5072,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4912
5072
|
},
|
|
4913
5073
|
[handleColorHighlight, onClick]
|
|
4914
5074
|
);
|
|
4915
|
-
const buttonStyle =
|
|
5075
|
+
const buttonStyle = useMemo8(
|
|
4916
5076
|
() => ({
|
|
4917
5077
|
...style,
|
|
4918
5078
|
"--highlight-color": highlightColor
|
|
@@ -4922,7 +5082,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4922
5082
|
if (!isVisible) {
|
|
4923
5083
|
return null;
|
|
4924
5084
|
}
|
|
4925
|
-
return /* @__PURE__ */
|
|
5085
|
+
return /* @__PURE__ */ jsx48(
|
|
4926
5086
|
Button2,
|
|
4927
5087
|
{
|
|
4928
5088
|
type: "button",
|
|
@@ -4939,16 +5099,16 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4939
5099
|
style: buttonStyle,
|
|
4940
5100
|
...buttonProps,
|
|
4941
5101
|
ref,
|
|
4942
|
-
children: children ?? /* @__PURE__ */
|
|
4943
|
-
/* @__PURE__ */
|
|
5102
|
+
children: children ?? /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
5103
|
+
/* @__PURE__ */ jsx48(
|
|
4944
5104
|
"span",
|
|
4945
5105
|
{
|
|
4946
5106
|
className: "tiptap-button-highlight",
|
|
4947
5107
|
style: { "--highlight-color": highlightColor }
|
|
4948
5108
|
}
|
|
4949
5109
|
),
|
|
4950
|
-
text && /* @__PURE__ */
|
|
4951
|
-
showShortcut && /* @__PURE__ */
|
|
5110
|
+
text && /* @__PURE__ */ jsx48("span", { className: "tiptap-button-text", children: text }),
|
|
5111
|
+
showShortcut && /* @__PURE__ */ jsx48(ColorHighlightShortcutBadge, { shortcutKeys })
|
|
4952
5112
|
] })
|
|
4953
5113
|
}
|
|
4954
5114
|
);
|
|
@@ -4957,7 +5117,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4957
5117
|
ColorHighlightButton.displayName = "ColorHighlightButton";
|
|
4958
5118
|
|
|
4959
5119
|
// src/components/tiptap-ui/color-highlight-button/use-color-highlight.ts
|
|
4960
|
-
import { useCallback as
|
|
5120
|
+
import { useCallback as useCallback17, useEffect as useEffect12, useState as useState18 } from "react";
|
|
4961
5121
|
import { useHotkeys as useHotkeys2 } from "react-hotkeys-hook";
|
|
4962
5122
|
var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
4963
5123
|
var HIGHLIGHT_COLORS = [
|
|
@@ -5088,7 +5248,7 @@ function useColorHighlight(config) {
|
|
|
5088
5248
|
} = config;
|
|
5089
5249
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5090
5250
|
const isMobile = useIsBreakpoint();
|
|
5091
|
-
const [isVisible, setIsVisible] =
|
|
5251
|
+
const [isVisible, setIsVisible] = useState18(true);
|
|
5092
5252
|
const canColorHighlightState = canColorHighlight(editor, mode);
|
|
5093
5253
|
const isActive = isColorHighlightActive(editor, highlightColor, mode);
|
|
5094
5254
|
useEffect12(() => {
|
|
@@ -5102,7 +5262,7 @@ function useColorHighlight(config) {
|
|
|
5102
5262
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
5103
5263
|
};
|
|
5104
5264
|
}, [editor, hideWhenUnavailable, mode]);
|
|
5105
|
-
const handleColorHighlight =
|
|
5265
|
+
const handleColorHighlight = useCallback17(() => {
|
|
5106
5266
|
if (!editor || !canColorHighlightState || !highlightColor || !label)
|
|
5107
5267
|
return false;
|
|
5108
5268
|
if (mode === "mark") {
|
|
@@ -5130,7 +5290,7 @@ function useColorHighlight(config) {
|
|
|
5130
5290
|
return success;
|
|
5131
5291
|
}
|
|
5132
5292
|
}, [canColorHighlightState, highlightColor, editor, label, onApplied, mode]);
|
|
5133
|
-
const handleRemoveHighlight =
|
|
5293
|
+
const handleRemoveHighlight = useCallback17(() => {
|
|
5134
5294
|
const success = removeHighlight(editor, mode);
|
|
5135
5295
|
if (success) {
|
|
5136
5296
|
onApplied?.({ color: "", label: "Remove highlight", mode });
|
|
@@ -5163,8 +5323,8 @@ function useColorHighlight(config) {
|
|
|
5163
5323
|
}
|
|
5164
5324
|
|
|
5165
5325
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
5166
|
-
import { jsx as
|
|
5167
|
-
var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props }, ref) => /* @__PURE__ */
|
|
5326
|
+
import { jsx as jsx49, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
5327
|
+
var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx49(
|
|
5168
5328
|
Button2,
|
|
5169
5329
|
{
|
|
5170
5330
|
type: "button",
|
|
@@ -5177,7 +5337,7 @@ var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props
|
|
|
5177
5337
|
tooltip: "Highlight",
|
|
5178
5338
|
ref,
|
|
5179
5339
|
...props,
|
|
5180
|
-
children: children ?? /* @__PURE__ */
|
|
5340
|
+
children: children ?? /* @__PURE__ */ jsx49(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
5181
5341
|
}
|
|
5182
5342
|
));
|
|
5183
5343
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
@@ -5193,8 +5353,8 @@ function ColorHighlightPopoverContent({
|
|
|
5193
5353
|
}) {
|
|
5194
5354
|
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
5195
5355
|
const isMobile = useIsBreakpoint();
|
|
5196
|
-
const containerRef =
|
|
5197
|
-
const menuItems =
|
|
5356
|
+
const containerRef = useRef6(null);
|
|
5357
|
+
const menuItems = useMemo9(
|
|
5198
5358
|
() => [...colors, { label: "Remove highlight", value: "none" }],
|
|
5199
5359
|
[colors]
|
|
5200
5360
|
);
|
|
@@ -5213,14 +5373,14 @@ function ColorHighlightPopoverContent({
|
|
|
5213
5373
|
},
|
|
5214
5374
|
autoSelectFirstItem: false
|
|
5215
5375
|
});
|
|
5216
|
-
return /* @__PURE__ */
|
|
5376
|
+
return /* @__PURE__ */ jsx49(
|
|
5217
5377
|
Card,
|
|
5218
5378
|
{
|
|
5219
5379
|
ref: containerRef,
|
|
5220
5380
|
tabIndex: 0,
|
|
5221
5381
|
style: isMobile ? { boxShadow: "none", border: 0 } : {},
|
|
5222
|
-
children: /* @__PURE__ */
|
|
5223
|
-
/* @__PURE__ */
|
|
5382
|
+
children: /* @__PURE__ */ jsx49(CardBody, { style: isMobile ? { padding: 0 } : {}, children: /* @__PURE__ */ jsxs27(CardItemGroup, { orientation: "horizontal", children: [
|
|
5383
|
+
/* @__PURE__ */ jsx49(ButtonGroup, { orientation: "horizontal", children: colors.map((color, index) => /* @__PURE__ */ jsx49(
|
|
5224
5384
|
ColorHighlightButton,
|
|
5225
5385
|
{
|
|
5226
5386
|
editor,
|
|
@@ -5232,8 +5392,8 @@ function ColorHighlightPopoverContent({
|
|
|
5232
5392
|
},
|
|
5233
5393
|
color.value
|
|
5234
5394
|
)) }),
|
|
5235
|
-
/* @__PURE__ */
|
|
5236
|
-
/* @__PURE__ */
|
|
5395
|
+
/* @__PURE__ */ jsx49(Separator3, {}),
|
|
5396
|
+
/* @__PURE__ */ jsx49(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx49(
|
|
5237
5397
|
Button2,
|
|
5238
5398
|
{
|
|
5239
5399
|
onClick: handleRemoveHighlight,
|
|
@@ -5244,7 +5404,7 @@ function ColorHighlightPopoverContent({
|
|
|
5244
5404
|
role: "menuitem",
|
|
5245
5405
|
"data-style": "ghost",
|
|
5246
5406
|
"data-highlighted": selectedIndex === colors.length,
|
|
5247
|
-
children: /* @__PURE__ */
|
|
5407
|
+
children: /* @__PURE__ */ jsx49(BanIcon, { className: "tiptap-button-icon" })
|
|
5248
5408
|
}
|
|
5249
5409
|
) })
|
|
5250
5410
|
] }) })
|
|
@@ -5253,13 +5413,13 @@ function ColorHighlightPopoverContent({
|
|
|
5253
5413
|
}
|
|
5254
5414
|
|
|
5255
5415
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5256
|
-
import { forwardRef as forwardRef15, useCallback as
|
|
5416
|
+
import { forwardRef as forwardRef15, useCallback as useCallback18, useEffect as useEffect13, useState as useState20 } from "react";
|
|
5257
5417
|
|
|
5258
5418
|
// src/components/tiptap-icons/corner-down-left-icon.tsx
|
|
5259
|
-
import { memo as
|
|
5260
|
-
import { jsx as
|
|
5261
|
-
var CornerDownLeftIcon =
|
|
5262
|
-
return /* @__PURE__ */
|
|
5419
|
+
import { memo as memo18 } from "react";
|
|
5420
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
5421
|
+
var CornerDownLeftIcon = memo18(({ className, ...props }) => {
|
|
5422
|
+
return /* @__PURE__ */ jsx50(
|
|
5263
5423
|
"svg",
|
|
5264
5424
|
{
|
|
5265
5425
|
width: "24",
|
|
@@ -5269,7 +5429,7 @@ var CornerDownLeftIcon = memo22(({ className, ...props }) => {
|
|
|
5269
5429
|
fill: "currentColor",
|
|
5270
5430
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5271
5431
|
...props,
|
|
5272
|
-
children: /* @__PURE__ */
|
|
5432
|
+
children: /* @__PURE__ */ jsx50(
|
|
5273
5433
|
"path",
|
|
5274
5434
|
{
|
|
5275
5435
|
fillRule: "evenodd",
|
|
@@ -5284,10 +5444,10 @@ var CornerDownLeftIcon = memo22(({ className, ...props }) => {
|
|
|
5284
5444
|
CornerDownLeftIcon.displayName = "CornerDownLeftIcon";
|
|
5285
5445
|
|
|
5286
5446
|
// src/components/tiptap-icons/external-link-icon.tsx
|
|
5287
|
-
import { memo as
|
|
5288
|
-
import { jsx as
|
|
5289
|
-
var ExternalLinkIcon =
|
|
5290
|
-
return /* @__PURE__ */
|
|
5447
|
+
import { memo as memo19 } from "react";
|
|
5448
|
+
import { jsx as jsx51, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
5449
|
+
var ExternalLinkIcon = memo19(({ className, ...props }) => {
|
|
5450
|
+
return /* @__PURE__ */ jsxs28(
|
|
5291
5451
|
"svg",
|
|
5292
5452
|
{
|
|
5293
5453
|
width: "24",
|
|
@@ -5298,14 +5458,14 @@ var ExternalLinkIcon = memo23(({ className, ...props }) => {
|
|
|
5298
5458
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5299
5459
|
...props,
|
|
5300
5460
|
children: [
|
|
5301
|
-
/* @__PURE__ */
|
|
5461
|
+
/* @__PURE__ */ jsx51(
|
|
5302
5462
|
"path",
|
|
5303
5463
|
{
|
|
5304
5464
|
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",
|
|
5305
5465
|
fill: "currentColor"
|
|
5306
5466
|
}
|
|
5307
5467
|
),
|
|
5308
|
-
/* @__PURE__ */
|
|
5468
|
+
/* @__PURE__ */ jsx51(
|
|
5309
5469
|
"path",
|
|
5310
5470
|
{
|
|
5311
5471
|
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",
|
|
@@ -5319,10 +5479,10 @@ var ExternalLinkIcon = memo23(({ className, ...props }) => {
|
|
|
5319
5479
|
ExternalLinkIcon.displayName = "ExternalLinkIcon";
|
|
5320
5480
|
|
|
5321
5481
|
// src/components/tiptap-icons/link-icon.tsx
|
|
5322
|
-
import { memo as
|
|
5323
|
-
import { jsx as
|
|
5324
|
-
var LinkIcon =
|
|
5325
|
-
return /* @__PURE__ */
|
|
5482
|
+
import { memo as memo20 } from "react";
|
|
5483
|
+
import { jsx as jsx52, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
5484
|
+
var LinkIcon = memo20(({ className, ...props }) => {
|
|
5485
|
+
return /* @__PURE__ */ jsxs29(
|
|
5326
5486
|
"svg",
|
|
5327
5487
|
{
|
|
5328
5488
|
width: "24",
|
|
@@ -5333,14 +5493,14 @@ var LinkIcon = memo24(({ className, ...props }) => {
|
|
|
5333
5493
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5334
5494
|
...props,
|
|
5335
5495
|
children: [
|
|
5336
|
-
/* @__PURE__ */
|
|
5496
|
+
/* @__PURE__ */ jsx52(
|
|
5337
5497
|
"path",
|
|
5338
5498
|
{
|
|
5339
5499
|
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",
|
|
5340
5500
|
fill: "currentColor"
|
|
5341
5501
|
}
|
|
5342
5502
|
),
|
|
5343
|
-
/* @__PURE__ */
|
|
5503
|
+
/* @__PURE__ */ jsx52(
|
|
5344
5504
|
"path",
|
|
5345
5505
|
{
|
|
5346
5506
|
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",
|
|
@@ -5354,10 +5514,10 @@ var LinkIcon = memo24(({ className, ...props }) => {
|
|
|
5354
5514
|
LinkIcon.displayName = "LinkIcon";
|
|
5355
5515
|
|
|
5356
5516
|
// src/components/tiptap-icons/trash-icon.tsx
|
|
5357
|
-
import { memo as
|
|
5358
|
-
import { jsx as
|
|
5359
|
-
var TrashIcon =
|
|
5360
|
-
return /* @__PURE__ */
|
|
5517
|
+
import { memo as memo21 } from "react";
|
|
5518
|
+
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
5519
|
+
var TrashIcon = memo21(({ className, ...props }) => {
|
|
5520
|
+
return /* @__PURE__ */ jsx53(
|
|
5361
5521
|
"svg",
|
|
5362
5522
|
{
|
|
5363
5523
|
width: "24",
|
|
@@ -5367,7 +5527,7 @@ var TrashIcon = memo25(({ className, ...props }) => {
|
|
|
5367
5527
|
fill: "currentColor",
|
|
5368
5528
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5369
5529
|
...props,
|
|
5370
|
-
children: /* @__PURE__ */
|
|
5530
|
+
children: /* @__PURE__ */ jsx53(
|
|
5371
5531
|
"path",
|
|
5372
5532
|
{
|
|
5373
5533
|
fillRule: "evenodd",
|
|
@@ -5382,23 +5542,23 @@ var TrashIcon = memo25(({ className, ...props }) => {
|
|
|
5382
5542
|
TrashIcon.displayName = "TrashIcon";
|
|
5383
5543
|
|
|
5384
5544
|
// src/components/tiptap-ui-primitive/input/input.tsx
|
|
5385
|
-
import { jsx as
|
|
5386
|
-
function
|
|
5387
|
-
return /* @__PURE__ */
|
|
5545
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
5546
|
+
function Input2({ className, type, ...props }) {
|
|
5547
|
+
return /* @__PURE__ */ jsx54("input", { type, className: cn2("tiptap-input", className), ...props });
|
|
5388
5548
|
}
|
|
5389
5549
|
function InputGroup({
|
|
5390
5550
|
className,
|
|
5391
5551
|
children,
|
|
5392
5552
|
...props
|
|
5393
5553
|
}) {
|
|
5394
|
-
return /* @__PURE__ */
|
|
5554
|
+
return /* @__PURE__ */ jsx54("div", { className: cn2("tiptap-input-group", className), ...props, children });
|
|
5395
5555
|
}
|
|
5396
5556
|
|
|
5397
5557
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5398
|
-
import { jsx as
|
|
5558
|
+
import { jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5399
5559
|
var LinkButton = forwardRef15(
|
|
5400
5560
|
({ className, children, ...props }, ref) => {
|
|
5401
|
-
return /* @__PURE__ */
|
|
5561
|
+
return /* @__PURE__ */ jsx55(
|
|
5402
5562
|
Button2,
|
|
5403
5563
|
{
|
|
5404
5564
|
type: "button",
|
|
@@ -5410,7 +5570,7 @@ var LinkButton = forwardRef15(
|
|
|
5410
5570
|
tooltip: "Link",
|
|
5411
5571
|
ref,
|
|
5412
5572
|
...props,
|
|
5413
|
-
children: children || /* @__PURE__ */
|
|
5573
|
+
children: children || /* @__PURE__ */ jsx55(LinkIcon, { className: "tiptap-button-icon" })
|
|
5414
5574
|
}
|
|
5415
5575
|
);
|
|
5416
5576
|
}
|
|
@@ -5431,21 +5591,21 @@ var LinkMain = ({
|
|
|
5431
5591
|
setLink();
|
|
5432
5592
|
}
|
|
5433
5593
|
};
|
|
5434
|
-
return /* @__PURE__ */
|
|
5594
|
+
return /* @__PURE__ */ jsx55(
|
|
5435
5595
|
Card,
|
|
5436
5596
|
{
|
|
5437
5597
|
style: {
|
|
5438
5598
|
...isMobile ? { boxShadow: "none", border: 0 } : {}
|
|
5439
5599
|
},
|
|
5440
|
-
children: /* @__PURE__ */
|
|
5600
|
+
children: /* @__PURE__ */ jsx55(
|
|
5441
5601
|
CardBody,
|
|
5442
5602
|
{
|
|
5443
5603
|
style: {
|
|
5444
5604
|
...isMobile ? { padding: 0 } : {}
|
|
5445
5605
|
},
|
|
5446
|
-
children: /* @__PURE__ */
|
|
5447
|
-
/* @__PURE__ */
|
|
5448
|
-
|
|
5606
|
+
children: /* @__PURE__ */ jsxs30(CardItemGroup, { orientation: "horizontal", children: [
|
|
5607
|
+
/* @__PURE__ */ jsx55(InputGroup, { children: /* @__PURE__ */ jsx55(
|
|
5608
|
+
Input2,
|
|
5449
5609
|
{
|
|
5450
5610
|
type: "url",
|
|
5451
5611
|
placeholder: "Paste a link...",
|
|
@@ -5458,7 +5618,7 @@ var LinkMain = ({
|
|
|
5458
5618
|
autoCapitalize: "off"
|
|
5459
5619
|
}
|
|
5460
5620
|
) }),
|
|
5461
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ jsx55(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx55(
|
|
5462
5622
|
Button2,
|
|
5463
5623
|
{
|
|
5464
5624
|
type: "button",
|
|
@@ -5466,12 +5626,12 @@ var LinkMain = ({
|
|
|
5466
5626
|
title: "Apply link",
|
|
5467
5627
|
disabled: !url && !isActive,
|
|
5468
5628
|
"data-style": "ghost",
|
|
5469
|
-
children: /* @__PURE__ */
|
|
5629
|
+
children: /* @__PURE__ */ jsx55(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
5470
5630
|
}
|
|
5471
5631
|
) }),
|
|
5472
|
-
/* @__PURE__ */
|
|
5473
|
-
/* @__PURE__ */
|
|
5474
|
-
/* @__PURE__ */
|
|
5632
|
+
/* @__PURE__ */ jsx55(Separator3, {}),
|
|
5633
|
+
/* @__PURE__ */ jsxs30(ButtonGroup, { orientation: "horizontal", children: [
|
|
5634
|
+
/* @__PURE__ */ jsx55(
|
|
5475
5635
|
Button2,
|
|
5476
5636
|
{
|
|
5477
5637
|
type: "button",
|
|
@@ -5479,10 +5639,10 @@ var LinkMain = ({
|
|
|
5479
5639
|
title: "Open in new window",
|
|
5480
5640
|
disabled: !url && !isActive,
|
|
5481
5641
|
"data-style": "ghost",
|
|
5482
|
-
children: /* @__PURE__ */
|
|
5642
|
+
children: /* @__PURE__ */ jsx55(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
5483
5643
|
}
|
|
5484
5644
|
),
|
|
5485
|
-
/* @__PURE__ */
|
|
5645
|
+
/* @__PURE__ */ jsx55(
|
|
5486
5646
|
Button2,
|
|
5487
5647
|
{
|
|
5488
5648
|
type: "button",
|
|
@@ -5490,7 +5650,7 @@ var LinkMain = ({
|
|
|
5490
5650
|
title: "Remove link",
|
|
5491
5651
|
disabled: !url && !isActive,
|
|
5492
5652
|
"data-style": "ghost",
|
|
5493
|
-
children: /* @__PURE__ */
|
|
5653
|
+
children: /* @__PURE__ */ jsx55(TrashIcon, { className: "tiptap-button-icon" })
|
|
5494
5654
|
}
|
|
5495
5655
|
)
|
|
5496
5656
|
] })
|
|
@@ -5504,7 +5664,7 @@ var LinkContent = ({ editor }) => {
|
|
|
5504
5664
|
const linkPopover = useLinkPopover({
|
|
5505
5665
|
editor
|
|
5506
5666
|
});
|
|
5507
|
-
return /* @__PURE__ */
|
|
5667
|
+
return /* @__PURE__ */ jsx55(LinkMain, { ...linkPopover });
|
|
5508
5668
|
};
|
|
5509
5669
|
var LinkPopover = forwardRef15(
|
|
5510
5670
|
({
|
|
@@ -5518,7 +5678,7 @@ var LinkPopover = forwardRef15(
|
|
|
5518
5678
|
...buttonProps
|
|
5519
5679
|
}, ref) => {
|
|
5520
5680
|
const { editor } = useTiptapEditor(providedEditor);
|
|
5521
|
-
const [isOpen, setIsOpen] =
|
|
5681
|
+
const [isOpen, setIsOpen] = useState20(false);
|
|
5522
5682
|
const {
|
|
5523
5683
|
isVisible,
|
|
5524
5684
|
canSet,
|
|
@@ -5535,18 +5695,18 @@ var LinkPopover = forwardRef15(
|
|
|
5535
5695
|
hideWhenUnavailable,
|
|
5536
5696
|
onSetLink
|
|
5537
5697
|
});
|
|
5538
|
-
const handleOnOpenChange =
|
|
5698
|
+
const handleOnOpenChange = useCallback18(
|
|
5539
5699
|
(nextIsOpen) => {
|
|
5540
5700
|
setIsOpen(nextIsOpen);
|
|
5541
5701
|
onOpenChange?.(nextIsOpen);
|
|
5542
5702
|
},
|
|
5543
5703
|
[onOpenChange]
|
|
5544
5704
|
);
|
|
5545
|
-
const handleSetLink =
|
|
5705
|
+
const handleSetLink = useCallback18(() => {
|
|
5546
5706
|
setLink();
|
|
5547
5707
|
setIsOpen(false);
|
|
5548
5708
|
}, [setLink]);
|
|
5549
|
-
const handleClick =
|
|
5709
|
+
const handleClick = useCallback18(
|
|
5550
5710
|
(event) => {
|
|
5551
5711
|
onClick?.(event);
|
|
5552
5712
|
if (event.defaultPrevented) return;
|
|
@@ -5562,8 +5722,8 @@ var LinkPopover = forwardRef15(
|
|
|
5562
5722
|
if (!isVisible) {
|
|
5563
5723
|
return null;
|
|
5564
5724
|
}
|
|
5565
|
-
return /* @__PURE__ */
|
|
5566
|
-
/* @__PURE__ */
|
|
5725
|
+
return /* @__PURE__ */ jsxs30(Popover, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
5726
|
+
/* @__PURE__ */ jsx55(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
5567
5727
|
LinkButton,
|
|
5568
5728
|
{
|
|
5569
5729
|
disabled: !canSet,
|
|
@@ -5574,10 +5734,10 @@ var LinkPopover = forwardRef15(
|
|
|
5574
5734
|
onClick: handleClick,
|
|
5575
5735
|
...buttonProps,
|
|
5576
5736
|
ref,
|
|
5577
|
-
children: children ?? /* @__PURE__ */
|
|
5737
|
+
children: children ?? /* @__PURE__ */ jsx55(Icon, { className: "tiptap-button-icon" })
|
|
5578
5738
|
}
|
|
5579
5739
|
) }),
|
|
5580
|
-
/* @__PURE__ */
|
|
5740
|
+
/* @__PURE__ */ jsx55(PopoverContent, { children: /* @__PURE__ */ jsx55(
|
|
5581
5741
|
LinkMain,
|
|
5582
5742
|
{
|
|
5583
5743
|
url,
|
|
@@ -5594,7 +5754,7 @@ var LinkPopover = forwardRef15(
|
|
|
5594
5754
|
LinkPopover.displayName = "LinkPopover";
|
|
5595
5755
|
|
|
5596
5756
|
// src/components/tiptap-ui/link-popover/use-link-popover.ts
|
|
5597
|
-
import { useCallback as
|
|
5757
|
+
import { useCallback as useCallback19, useEffect as useEffect14, useState as useState21 } from "react";
|
|
5598
5758
|
function canSetLink(editor) {
|
|
5599
5759
|
if (!editor || !editor.isEditable) return false;
|
|
5600
5760
|
if (isNodeTypeSelected(editor, ["image"], true)) return false;
|
|
@@ -5617,7 +5777,7 @@ function shouldShowLinkButton(props) {
|
|
|
5617
5777
|
}
|
|
5618
5778
|
function useLinkHandler(props) {
|
|
5619
5779
|
const { editor, onSetLink } = props;
|
|
5620
|
-
const [url, setUrl] =
|
|
5780
|
+
const [url, setUrl] = useState21(null);
|
|
5621
5781
|
useEffect14(() => {
|
|
5622
5782
|
if (!editor) return;
|
|
5623
5783
|
const { href } = editor.getAttributes("link");
|
|
@@ -5636,7 +5796,7 @@ function useLinkHandler(props) {
|
|
|
5636
5796
|
editor.off("selectionUpdate", updateLinkState);
|
|
5637
5797
|
};
|
|
5638
5798
|
}, [editor]);
|
|
5639
|
-
const setLink =
|
|
5799
|
+
const setLink = useCallback19(() => {
|
|
5640
5800
|
if (!url || !editor) return;
|
|
5641
5801
|
const { selection } = editor.state;
|
|
5642
5802
|
const isEmpty = selection.empty;
|
|
@@ -5649,12 +5809,12 @@ function useLinkHandler(props) {
|
|
|
5649
5809
|
setUrl(null);
|
|
5650
5810
|
onSetLink?.();
|
|
5651
5811
|
}, [editor, onSetLink, url]);
|
|
5652
|
-
const removeLink =
|
|
5812
|
+
const removeLink = useCallback19(() => {
|
|
5653
5813
|
if (!editor) return;
|
|
5654
5814
|
editor.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink", true).run();
|
|
5655
5815
|
setUrl("");
|
|
5656
5816
|
}, [editor]);
|
|
5657
|
-
const openLink =
|
|
5817
|
+
const openLink = useCallback19(
|
|
5658
5818
|
(target = "_blank", features = "noopener,noreferrer") => {
|
|
5659
5819
|
if (!url) return;
|
|
5660
5820
|
const safeUrl = sanitizeUrl(url, window.location.href);
|
|
@@ -5676,7 +5836,7 @@ function useLinkState(props) {
|
|
|
5676
5836
|
const { editor, hideWhenUnavailable = false } = props;
|
|
5677
5837
|
const canSet = canSetLink(editor);
|
|
5678
5838
|
const isActive = isLinkActive(editor);
|
|
5679
|
-
const [isVisible, setIsVisible] =
|
|
5839
|
+
const [isVisible, setIsVisible] = useState21(true);
|
|
5680
5840
|
useEffect14(() => {
|
|
5681
5841
|
if (!editor) return;
|
|
5682
5842
|
const handleSelectionUpdate = () => {
|
|
@@ -5725,13 +5885,13 @@ function useLinkPopover(config) {
|
|
|
5725
5885
|
}
|
|
5726
5886
|
|
|
5727
5887
|
// src/components/tiptap-ui/mark-button/mark-button.tsx
|
|
5728
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
5729
|
-
import { Fragment as
|
|
5888
|
+
import { forwardRef as forwardRef16, useCallback as useCallback20 } from "react";
|
|
5889
|
+
import { Fragment as Fragment8, jsx as jsx56, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
5730
5890
|
function MarkShortcutBadge({
|
|
5731
5891
|
type,
|
|
5732
5892
|
shortcutKeys = MARK_SHORTCUT_KEYS[type]
|
|
5733
5893
|
}) {
|
|
5734
|
-
return /* @__PURE__ */
|
|
5894
|
+
return /* @__PURE__ */ jsx56(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
5735
5895
|
}
|
|
5736
5896
|
var MarkButton = forwardRef16(
|
|
5737
5897
|
({
|
|
@@ -5760,7 +5920,7 @@ var MarkButton = forwardRef16(
|
|
|
5760
5920
|
hideWhenUnavailable,
|
|
5761
5921
|
onToggled
|
|
5762
5922
|
});
|
|
5763
|
-
const handleClick =
|
|
5923
|
+
const handleClick = useCallback20(
|
|
5764
5924
|
(event) => {
|
|
5765
5925
|
onClick?.(event);
|
|
5766
5926
|
if (event.defaultPrevented) return;
|
|
@@ -5771,7 +5931,7 @@ var MarkButton = forwardRef16(
|
|
|
5771
5931
|
if (!isVisible) {
|
|
5772
5932
|
return null;
|
|
5773
5933
|
}
|
|
5774
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ jsx56(
|
|
5775
5935
|
Button2,
|
|
5776
5936
|
{
|
|
5777
5937
|
type: "button",
|
|
@@ -5787,10 +5947,10 @@ var MarkButton = forwardRef16(
|
|
|
5787
5947
|
onClick: handleClick,
|
|
5788
5948
|
...buttonProps,
|
|
5789
5949
|
ref,
|
|
5790
|
-
children: children ?? /* @__PURE__ */
|
|
5791
|
-
/* @__PURE__ */
|
|
5792
|
-
text && /* @__PURE__ */
|
|
5793
|
-
showShortcut && /* @__PURE__ */
|
|
5950
|
+
children: children ?? /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
5951
|
+
/* @__PURE__ */ jsx56(Icon, { className: "tiptap-button-icon" }),
|
|
5952
|
+
text && /* @__PURE__ */ jsx56("span", { className: "tiptap-button-text", children: text }),
|
|
5953
|
+
showShortcut && /* @__PURE__ */ jsx56(MarkShortcutBadge, { type, shortcutKeys })
|
|
5794
5954
|
] })
|
|
5795
5955
|
}
|
|
5796
5956
|
);
|
|
@@ -5799,13 +5959,13 @@ var MarkButton = forwardRef16(
|
|
|
5799
5959
|
MarkButton.displayName = "MarkButton";
|
|
5800
5960
|
|
|
5801
5961
|
// src/components/tiptap-ui/mark-button/use-mark.ts
|
|
5802
|
-
import { useCallback as
|
|
5962
|
+
import { useCallback as useCallback21, useEffect as useEffect15, useState as useState22 } from "react";
|
|
5803
5963
|
|
|
5804
5964
|
// src/components/tiptap-icons/bold-icon.tsx
|
|
5805
|
-
import { memo as
|
|
5806
|
-
import { jsx as
|
|
5807
|
-
var BoldIcon =
|
|
5808
|
-
return /* @__PURE__ */
|
|
5965
|
+
import { memo as memo22 } from "react";
|
|
5966
|
+
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
5967
|
+
var BoldIcon = memo22(({ className, ...props }) => {
|
|
5968
|
+
return /* @__PURE__ */ jsx57(
|
|
5809
5969
|
"svg",
|
|
5810
5970
|
{
|
|
5811
5971
|
width: "24",
|
|
@@ -5815,7 +5975,7 @@ var BoldIcon = memo26(({ className, ...props }) => {
|
|
|
5815
5975
|
fill: "currentColor",
|
|
5816
5976
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5817
5977
|
...props,
|
|
5818
|
-
children: /* @__PURE__ */
|
|
5978
|
+
children: /* @__PURE__ */ jsx57(
|
|
5819
5979
|
"path",
|
|
5820
5980
|
{
|
|
5821
5981
|
fillRule: "evenodd",
|
|
@@ -5830,10 +5990,10 @@ var BoldIcon = memo26(({ className, ...props }) => {
|
|
|
5830
5990
|
BoldIcon.displayName = "BoldIcon";
|
|
5831
5991
|
|
|
5832
5992
|
// src/components/tiptap-icons/code2-icon.tsx
|
|
5833
|
-
import { memo as
|
|
5834
|
-
import { jsx as
|
|
5835
|
-
var Code2Icon =
|
|
5836
|
-
return /* @__PURE__ */
|
|
5993
|
+
import { memo as memo23 } from "react";
|
|
5994
|
+
import { jsx as jsx58, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
5995
|
+
var Code2Icon = memo23(({ className, ...props }) => {
|
|
5996
|
+
return /* @__PURE__ */ jsxs32(
|
|
5837
5997
|
"svg",
|
|
5838
5998
|
{
|
|
5839
5999
|
width: "24",
|
|
@@ -5844,21 +6004,21 @@ var Code2Icon = memo27(({ className, ...props }) => {
|
|
|
5844
6004
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5845
6005
|
...props,
|
|
5846
6006
|
children: [
|
|
5847
|
-
/* @__PURE__ */
|
|
6007
|
+
/* @__PURE__ */ jsx58(
|
|
5848
6008
|
"path",
|
|
5849
6009
|
{
|
|
5850
6010
|
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",
|
|
5851
6011
|
fill: "currentColor"
|
|
5852
6012
|
}
|
|
5853
6013
|
),
|
|
5854
|
-
/* @__PURE__ */
|
|
6014
|
+
/* @__PURE__ */ jsx58(
|
|
5855
6015
|
"path",
|
|
5856
6016
|
{
|
|
5857
6017
|
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",
|
|
5858
6018
|
fill: "currentColor"
|
|
5859
6019
|
}
|
|
5860
6020
|
),
|
|
5861
|
-
/* @__PURE__ */
|
|
6021
|
+
/* @__PURE__ */ jsx58(
|
|
5862
6022
|
"path",
|
|
5863
6023
|
{
|
|
5864
6024
|
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",
|
|
@@ -5872,10 +6032,10 @@ var Code2Icon = memo27(({ className, ...props }) => {
|
|
|
5872
6032
|
Code2Icon.displayName = "Code2Icon";
|
|
5873
6033
|
|
|
5874
6034
|
// src/components/tiptap-icons/italic-icon.tsx
|
|
5875
|
-
import { memo as
|
|
5876
|
-
import { jsx as
|
|
5877
|
-
var ItalicIcon =
|
|
5878
|
-
return /* @__PURE__ */
|
|
6035
|
+
import { memo as memo24 } from "react";
|
|
6036
|
+
import { jsx as jsx59 } from "react/jsx-runtime";
|
|
6037
|
+
var ItalicIcon = memo24(({ className, ...props }) => {
|
|
6038
|
+
return /* @__PURE__ */ jsx59(
|
|
5879
6039
|
"svg",
|
|
5880
6040
|
{
|
|
5881
6041
|
width: "24",
|
|
@@ -5885,7 +6045,7 @@ var ItalicIcon = memo28(({ className, ...props }) => {
|
|
|
5885
6045
|
fill: "currentColor",
|
|
5886
6046
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5887
6047
|
...props,
|
|
5888
|
-
children: /* @__PURE__ */
|
|
6048
|
+
children: /* @__PURE__ */ jsx59(
|
|
5889
6049
|
"path",
|
|
5890
6050
|
{
|
|
5891
6051
|
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",
|
|
@@ -5898,10 +6058,10 @@ var ItalicIcon = memo28(({ className, ...props }) => {
|
|
|
5898
6058
|
ItalicIcon.displayName = "ItalicIcon";
|
|
5899
6059
|
|
|
5900
6060
|
// src/components/tiptap-icons/strike-icon.tsx
|
|
5901
|
-
import { memo as
|
|
5902
|
-
import { jsx as
|
|
5903
|
-
var StrikeIcon =
|
|
5904
|
-
return /* @__PURE__ */
|
|
6061
|
+
import { memo as memo25 } from "react";
|
|
6062
|
+
import { jsx as jsx60, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
6063
|
+
var StrikeIcon = memo25(({ className, ...props }) => {
|
|
6064
|
+
return /* @__PURE__ */ jsxs33(
|
|
5905
6065
|
"svg",
|
|
5906
6066
|
{
|
|
5907
6067
|
width: "24",
|
|
@@ -5912,14 +6072,14 @@ var StrikeIcon = memo29(({ className, ...props }) => {
|
|
|
5912
6072
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5913
6073
|
...props,
|
|
5914
6074
|
children: [
|
|
5915
|
-
/* @__PURE__ */
|
|
6075
|
+
/* @__PURE__ */ jsx60(
|
|
5916
6076
|
"path",
|
|
5917
6077
|
{
|
|
5918
6078
|
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",
|
|
5919
6079
|
fill: "currentColor"
|
|
5920
6080
|
}
|
|
5921
6081
|
),
|
|
5922
|
-
/* @__PURE__ */
|
|
6082
|
+
/* @__PURE__ */ jsx60(
|
|
5923
6083
|
"path",
|
|
5924
6084
|
{
|
|
5925
6085
|
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",
|
|
@@ -5933,10 +6093,10 @@ var StrikeIcon = memo29(({ className, ...props }) => {
|
|
|
5933
6093
|
StrikeIcon.displayName = "StrikeIcon";
|
|
5934
6094
|
|
|
5935
6095
|
// src/components/tiptap-icons/subscript-icon.tsx
|
|
5936
|
-
import { memo as
|
|
5937
|
-
import { jsx as
|
|
5938
|
-
var SubscriptIcon =
|
|
5939
|
-
return /* @__PURE__ */
|
|
6096
|
+
import { memo as memo26 } from "react";
|
|
6097
|
+
import { jsx as jsx61, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
6098
|
+
var SubscriptIcon = memo26(({ className, ...props }) => {
|
|
6099
|
+
return /* @__PURE__ */ jsxs34(
|
|
5940
6100
|
"svg",
|
|
5941
6101
|
{
|
|
5942
6102
|
width: "24",
|
|
@@ -5947,7 +6107,7 @@ var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
|
5947
6107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5948
6108
|
...props,
|
|
5949
6109
|
children: [
|
|
5950
|
-
/* @__PURE__ */
|
|
6110
|
+
/* @__PURE__ */ jsx61(
|
|
5951
6111
|
"path",
|
|
5952
6112
|
{
|
|
5953
6113
|
fillRule: "evenodd",
|
|
@@ -5956,7 +6116,7 @@ var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
|
5956
6116
|
fill: "currentColor"
|
|
5957
6117
|
}
|
|
5958
6118
|
),
|
|
5959
|
-
/* @__PURE__ */
|
|
6119
|
+
/* @__PURE__ */ jsx61(
|
|
5960
6120
|
"path",
|
|
5961
6121
|
{
|
|
5962
6122
|
fillRule: "evenodd",
|
|
@@ -5965,7 +6125,7 @@ var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
|
5965
6125
|
fill: "currentColor"
|
|
5966
6126
|
}
|
|
5967
6127
|
),
|
|
5968
|
-
/* @__PURE__ */
|
|
6128
|
+
/* @__PURE__ */ jsx61(
|
|
5969
6129
|
"path",
|
|
5970
6130
|
{
|
|
5971
6131
|
fillRule: "evenodd",
|
|
@@ -5981,10 +6141,10 @@ var SubscriptIcon = memo30(({ className, ...props }) => {
|
|
|
5981
6141
|
SubscriptIcon.displayName = "SubscriptIcon";
|
|
5982
6142
|
|
|
5983
6143
|
// src/components/tiptap-icons/superscript-icon.tsx
|
|
5984
|
-
import { memo as
|
|
5985
|
-
import { jsx as
|
|
5986
|
-
var SuperscriptIcon =
|
|
5987
|
-
return /* @__PURE__ */
|
|
6144
|
+
import { memo as memo27 } from "react";
|
|
6145
|
+
import { jsx as jsx62, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
6146
|
+
var SuperscriptIcon = memo27(({ className, ...props }) => {
|
|
6147
|
+
return /* @__PURE__ */ jsxs35(
|
|
5988
6148
|
"svg",
|
|
5989
6149
|
{
|
|
5990
6150
|
width: "24",
|
|
@@ -5995,7 +6155,7 @@ var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
|
5995
6155
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5996
6156
|
...props,
|
|
5997
6157
|
children: [
|
|
5998
|
-
/* @__PURE__ */
|
|
6158
|
+
/* @__PURE__ */ jsx62(
|
|
5999
6159
|
"path",
|
|
6000
6160
|
{
|
|
6001
6161
|
fillRule: "evenodd",
|
|
@@ -6004,7 +6164,7 @@ var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
|
6004
6164
|
fill: "currentColor"
|
|
6005
6165
|
}
|
|
6006
6166
|
),
|
|
6007
|
-
/* @__PURE__ */
|
|
6167
|
+
/* @__PURE__ */ jsx62(
|
|
6008
6168
|
"path",
|
|
6009
6169
|
{
|
|
6010
6170
|
fillRule: "evenodd",
|
|
@@ -6013,7 +6173,7 @@ var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
|
6013
6173
|
fill: "currentColor"
|
|
6014
6174
|
}
|
|
6015
6175
|
),
|
|
6016
|
-
/* @__PURE__ */
|
|
6176
|
+
/* @__PURE__ */ jsx62(
|
|
6017
6177
|
"path",
|
|
6018
6178
|
{
|
|
6019
6179
|
fillRule: "evenodd",
|
|
@@ -6029,10 +6189,10 @@ var SuperscriptIcon = memo31(({ className, ...props }) => {
|
|
|
6029
6189
|
SuperscriptIcon.displayName = "SuperscriptIcon";
|
|
6030
6190
|
|
|
6031
6191
|
// src/components/tiptap-icons/underline-icon.tsx
|
|
6032
|
-
import { memo as
|
|
6033
|
-
import { jsx as
|
|
6034
|
-
var UnderlineIcon =
|
|
6035
|
-
return /* @__PURE__ */
|
|
6192
|
+
import { memo as memo28 } from "react";
|
|
6193
|
+
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
6194
|
+
var UnderlineIcon = memo28(({ className, ...props }) => {
|
|
6195
|
+
return /* @__PURE__ */ jsx63(
|
|
6036
6196
|
"svg",
|
|
6037
6197
|
{
|
|
6038
6198
|
width: "24",
|
|
@@ -6042,7 +6202,7 @@ var UnderlineIcon = memo32(({ className, ...props }) => {
|
|
|
6042
6202
|
fill: "currentColor",
|
|
6043
6203
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6044
6204
|
...props,
|
|
6045
|
-
children: /* @__PURE__ */
|
|
6205
|
+
children: /* @__PURE__ */ jsx63(
|
|
6046
6206
|
"path",
|
|
6047
6207
|
{
|
|
6048
6208
|
fillRule: "evenodd",
|
|
@@ -6110,7 +6270,7 @@ function useMark(config) {
|
|
|
6110
6270
|
onToggled
|
|
6111
6271
|
} = config;
|
|
6112
6272
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6113
|
-
const [isVisible, setIsVisible] =
|
|
6273
|
+
const [isVisible, setIsVisible] = useState22(true);
|
|
6114
6274
|
const canToggle2 = canToggleMark(editor, type);
|
|
6115
6275
|
const isActive = isMarkActive(editor, type);
|
|
6116
6276
|
useEffect15(() => {
|
|
@@ -6124,7 +6284,7 @@ function useMark(config) {
|
|
|
6124
6284
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6125
6285
|
};
|
|
6126
6286
|
}, [editor, type, hideWhenUnavailable]);
|
|
6127
|
-
const handleMark =
|
|
6287
|
+
const handleMark = useCallback21(() => {
|
|
6128
6288
|
if (!editor) return false;
|
|
6129
6289
|
const success = toggleMark(editor, type);
|
|
6130
6290
|
if (success) {
|
|
@@ -6144,13 +6304,13 @@ function useMark(config) {
|
|
|
6144
6304
|
}
|
|
6145
6305
|
|
|
6146
6306
|
// src/components/tiptap-ui/text-align-button/text-align-button.tsx
|
|
6147
|
-
import { forwardRef as forwardRef17, useCallback as
|
|
6148
|
-
import { Fragment as
|
|
6307
|
+
import { forwardRef as forwardRef17, useCallback as useCallback22 } from "react";
|
|
6308
|
+
import { Fragment as Fragment9, jsx as jsx64, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
6149
6309
|
function TextAlignShortcutBadge({
|
|
6150
6310
|
align,
|
|
6151
6311
|
shortcutKeys = TEXT_ALIGN_SHORTCUT_KEYS[align]
|
|
6152
6312
|
}) {
|
|
6153
|
-
return /* @__PURE__ */
|
|
6313
|
+
return /* @__PURE__ */ jsx64(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6154
6314
|
}
|
|
6155
6315
|
var TextAlignButton = forwardRef17(
|
|
6156
6316
|
({
|
|
@@ -6180,7 +6340,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6180
6340
|
hideWhenUnavailable,
|
|
6181
6341
|
onAligned
|
|
6182
6342
|
});
|
|
6183
|
-
const handleClick =
|
|
6343
|
+
const handleClick = useCallback22(
|
|
6184
6344
|
(event) => {
|
|
6185
6345
|
onClick?.(event);
|
|
6186
6346
|
if (event.defaultPrevented) return;
|
|
@@ -6192,7 +6352,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6192
6352
|
return null;
|
|
6193
6353
|
}
|
|
6194
6354
|
const RenderIcon = CustomIcon ?? Icon;
|
|
6195
|
-
return /* @__PURE__ */
|
|
6355
|
+
return /* @__PURE__ */ jsx64(
|
|
6196
6356
|
Button2,
|
|
6197
6357
|
{
|
|
6198
6358
|
type: "button",
|
|
@@ -6208,10 +6368,10 @@ var TextAlignButton = forwardRef17(
|
|
|
6208
6368
|
onClick: handleClick,
|
|
6209
6369
|
...buttonProps,
|
|
6210
6370
|
ref,
|
|
6211
|
-
children: children ?? /* @__PURE__ */
|
|
6212
|
-
/* @__PURE__ */
|
|
6213
|
-
text && /* @__PURE__ */
|
|
6214
|
-
showShortcut && /* @__PURE__ */
|
|
6371
|
+
children: children ?? /* @__PURE__ */ jsxs36(Fragment9, { children: [
|
|
6372
|
+
/* @__PURE__ */ jsx64(RenderIcon, { className: "tiptap-button-icon" }),
|
|
6373
|
+
text && /* @__PURE__ */ jsx64("span", { className: "tiptap-button-text", children: text }),
|
|
6374
|
+
showShortcut && /* @__PURE__ */ jsx64(
|
|
6215
6375
|
TextAlignShortcutBadge,
|
|
6216
6376
|
{
|
|
6217
6377
|
align,
|
|
@@ -6226,13 +6386,13 @@ var TextAlignButton = forwardRef17(
|
|
|
6226
6386
|
TextAlignButton.displayName = "TextAlignButton";
|
|
6227
6387
|
|
|
6228
6388
|
// src/components/tiptap-ui/text-align-button/use-text-align.ts
|
|
6229
|
-
import { useCallback as
|
|
6389
|
+
import { useCallback as useCallback23, useEffect as useEffect16, useState as useState23 } from "react";
|
|
6230
6390
|
|
|
6231
6391
|
// src/components/tiptap-icons/align-center-icon.tsx
|
|
6232
|
-
import { memo as
|
|
6233
|
-
import { jsx as
|
|
6234
|
-
var AlignCenterIcon =
|
|
6235
|
-
return /* @__PURE__ */
|
|
6392
|
+
import { memo as memo29 } from "react";
|
|
6393
|
+
import { jsx as jsx65, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
6394
|
+
var AlignCenterIcon = memo29(({ className, ...props }) => {
|
|
6395
|
+
return /* @__PURE__ */ jsxs37(
|
|
6236
6396
|
"svg",
|
|
6237
6397
|
{
|
|
6238
6398
|
width: "24",
|
|
@@ -6243,7 +6403,7 @@ var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
|
6243
6403
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6244
6404
|
...props,
|
|
6245
6405
|
children: [
|
|
6246
|
-
/* @__PURE__ */
|
|
6406
|
+
/* @__PURE__ */ jsx65(
|
|
6247
6407
|
"path",
|
|
6248
6408
|
{
|
|
6249
6409
|
fillRule: "evenodd",
|
|
@@ -6252,7 +6412,7 @@ var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
|
6252
6412
|
fill: "currentColor"
|
|
6253
6413
|
}
|
|
6254
6414
|
),
|
|
6255
|
-
/* @__PURE__ */
|
|
6415
|
+
/* @__PURE__ */ jsx65(
|
|
6256
6416
|
"path",
|
|
6257
6417
|
{
|
|
6258
6418
|
fillRule: "evenodd",
|
|
@@ -6261,7 +6421,7 @@ var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
|
6261
6421
|
fill: "currentColor"
|
|
6262
6422
|
}
|
|
6263
6423
|
),
|
|
6264
|
-
/* @__PURE__ */
|
|
6424
|
+
/* @__PURE__ */ jsx65(
|
|
6265
6425
|
"path",
|
|
6266
6426
|
{
|
|
6267
6427
|
fillRule: "evenodd",
|
|
@@ -6277,10 +6437,10 @@ var AlignCenterIcon = memo33(({ className, ...props }) => {
|
|
|
6277
6437
|
AlignCenterIcon.displayName = "AlignCenterIcon";
|
|
6278
6438
|
|
|
6279
6439
|
// src/components/tiptap-icons/align-justify-icon.tsx
|
|
6280
|
-
import { memo as
|
|
6281
|
-
import { jsx as
|
|
6282
|
-
var AlignJustifyIcon =
|
|
6283
|
-
return /* @__PURE__ */
|
|
6440
|
+
import { memo as memo30 } from "react";
|
|
6441
|
+
import { jsx as jsx66, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
6442
|
+
var AlignJustifyIcon = memo30(({ className, ...props }) => {
|
|
6443
|
+
return /* @__PURE__ */ jsxs38(
|
|
6284
6444
|
"svg",
|
|
6285
6445
|
{
|
|
6286
6446
|
width: "24",
|
|
@@ -6291,7 +6451,7 @@ var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
|
6291
6451
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6292
6452
|
...props,
|
|
6293
6453
|
children: [
|
|
6294
|
-
/* @__PURE__ */
|
|
6454
|
+
/* @__PURE__ */ jsx66(
|
|
6295
6455
|
"path",
|
|
6296
6456
|
{
|
|
6297
6457
|
fillRule: "evenodd",
|
|
@@ -6300,7 +6460,7 @@ var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
|
6300
6460
|
fill: "currentColor"
|
|
6301
6461
|
}
|
|
6302
6462
|
),
|
|
6303
|
-
/* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ jsx66(
|
|
6304
6464
|
"path",
|
|
6305
6465
|
{
|
|
6306
6466
|
fillRule: "evenodd",
|
|
@@ -6309,7 +6469,7 @@ var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
|
6309
6469
|
fill: "currentColor"
|
|
6310
6470
|
}
|
|
6311
6471
|
),
|
|
6312
|
-
/* @__PURE__ */
|
|
6472
|
+
/* @__PURE__ */ jsx66(
|
|
6313
6473
|
"path",
|
|
6314
6474
|
{
|
|
6315
6475
|
fillRule: "evenodd",
|
|
@@ -6325,10 +6485,10 @@ var AlignJustifyIcon = memo34(({ className, ...props }) => {
|
|
|
6325
6485
|
AlignJustifyIcon.displayName = "AlignJustifyIcon";
|
|
6326
6486
|
|
|
6327
6487
|
// src/components/tiptap-icons/align-left-icon.tsx
|
|
6328
|
-
import { memo as
|
|
6329
|
-
import { jsx as
|
|
6330
|
-
var AlignLeftIcon =
|
|
6331
|
-
return /* @__PURE__ */
|
|
6488
|
+
import { memo as memo31 } from "react";
|
|
6489
|
+
import { jsx as jsx67, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
6490
|
+
var AlignLeftIcon = memo31(({ className, ...props }) => {
|
|
6491
|
+
return /* @__PURE__ */ jsxs39(
|
|
6332
6492
|
"svg",
|
|
6333
6493
|
{
|
|
6334
6494
|
width: "24",
|
|
@@ -6339,7 +6499,7 @@ var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
|
6339
6499
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6340
6500
|
...props,
|
|
6341
6501
|
children: [
|
|
6342
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx67(
|
|
6343
6503
|
"path",
|
|
6344
6504
|
{
|
|
6345
6505
|
fillRule: "evenodd",
|
|
@@ -6348,7 +6508,7 @@ var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
|
6348
6508
|
fill: "currentColor"
|
|
6349
6509
|
}
|
|
6350
6510
|
),
|
|
6351
|
-
/* @__PURE__ */
|
|
6511
|
+
/* @__PURE__ */ jsx67(
|
|
6352
6512
|
"path",
|
|
6353
6513
|
{
|
|
6354
6514
|
fillRule: "evenodd",
|
|
@@ -6357,7 +6517,7 @@ var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
|
6357
6517
|
fill: "currentColor"
|
|
6358
6518
|
}
|
|
6359
6519
|
),
|
|
6360
|
-
/* @__PURE__ */
|
|
6520
|
+
/* @__PURE__ */ jsx67(
|
|
6361
6521
|
"path",
|
|
6362
6522
|
{
|
|
6363
6523
|
fillRule: "evenodd",
|
|
@@ -6373,10 +6533,10 @@ var AlignLeftIcon = memo35(({ className, ...props }) => {
|
|
|
6373
6533
|
AlignLeftIcon.displayName = "AlignLeftIcon";
|
|
6374
6534
|
|
|
6375
6535
|
// src/components/tiptap-icons/align-right-icon.tsx
|
|
6376
|
-
import { memo as
|
|
6377
|
-
import { jsx as
|
|
6378
|
-
var AlignRightIcon =
|
|
6379
|
-
return /* @__PURE__ */
|
|
6536
|
+
import { memo as memo32 } from "react";
|
|
6537
|
+
import { jsx as jsx68, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
6538
|
+
var AlignRightIcon = memo32(({ className, ...props }) => {
|
|
6539
|
+
return /* @__PURE__ */ jsxs40(
|
|
6380
6540
|
"svg",
|
|
6381
6541
|
{
|
|
6382
6542
|
width: "24",
|
|
@@ -6387,7 +6547,7 @@ var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
|
6387
6547
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6388
6548
|
...props,
|
|
6389
6549
|
children: [
|
|
6390
|
-
/* @__PURE__ */
|
|
6550
|
+
/* @__PURE__ */ jsx68(
|
|
6391
6551
|
"path",
|
|
6392
6552
|
{
|
|
6393
6553
|
fillRule: "evenodd",
|
|
@@ -6396,7 +6556,7 @@ var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
|
6396
6556
|
fill: "currentColor"
|
|
6397
6557
|
}
|
|
6398
6558
|
),
|
|
6399
|
-
/* @__PURE__ */
|
|
6559
|
+
/* @__PURE__ */ jsx68(
|
|
6400
6560
|
"path",
|
|
6401
6561
|
{
|
|
6402
6562
|
fillRule: "evenodd",
|
|
@@ -6405,7 +6565,7 @@ var AlignRightIcon = memo36(({ className, ...props }) => {
|
|
|
6405
6565
|
fill: "currentColor"
|
|
6406
6566
|
}
|
|
6407
6567
|
),
|
|
6408
|
-
/* @__PURE__ */
|
|
6568
|
+
/* @__PURE__ */ jsx68(
|
|
6409
6569
|
"path",
|
|
6410
6570
|
{
|
|
6411
6571
|
fillRule: "evenodd",
|
|
@@ -6478,7 +6638,7 @@ function useTextAlign(config) {
|
|
|
6478
6638
|
onAligned
|
|
6479
6639
|
} = config;
|
|
6480
6640
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6481
|
-
const [isVisible, setIsVisible] =
|
|
6641
|
+
const [isVisible, setIsVisible] = useState23(true);
|
|
6482
6642
|
const canAlign = canSetTextAlign(editor, align);
|
|
6483
6643
|
const isActive = isTextAlignActive(editor, align);
|
|
6484
6644
|
useEffect16(() => {
|
|
@@ -6492,7 +6652,7 @@ function useTextAlign(config) {
|
|
|
6492
6652
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6493
6653
|
};
|
|
6494
6654
|
}, [editor, hideWhenUnavailable, align]);
|
|
6495
|
-
const handleTextAlign =
|
|
6655
|
+
const handleTextAlign = useCallback23(() => {
|
|
6496
6656
|
if (!editor) return false;
|
|
6497
6657
|
const success = setTextAlign(editor, align);
|
|
6498
6658
|
if (success) {
|
|
@@ -6512,13 +6672,13 @@ function useTextAlign(config) {
|
|
|
6512
6672
|
}
|
|
6513
6673
|
|
|
6514
6674
|
// src/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx
|
|
6515
|
-
import { forwardRef as forwardRef18, useCallback as
|
|
6516
|
-
import { Fragment as
|
|
6675
|
+
import { forwardRef as forwardRef18, useCallback as useCallback24 } from "react";
|
|
6676
|
+
import { Fragment as Fragment10, jsx as jsx69, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
6517
6677
|
function HistoryShortcutBadge({
|
|
6518
6678
|
action,
|
|
6519
6679
|
shortcutKeys = UNDO_REDO_SHORTCUT_KEYS[action]
|
|
6520
6680
|
}) {
|
|
6521
|
-
return /* @__PURE__ */
|
|
6681
|
+
return /* @__PURE__ */ jsx69(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6522
6682
|
}
|
|
6523
6683
|
var UndoRedoButton = forwardRef18(
|
|
6524
6684
|
({
|
|
@@ -6539,7 +6699,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6539
6699
|
hideWhenUnavailable,
|
|
6540
6700
|
onExecuted
|
|
6541
6701
|
});
|
|
6542
|
-
const handleClick =
|
|
6702
|
+
const handleClick = useCallback24(
|
|
6543
6703
|
(event) => {
|
|
6544
6704
|
onClick?.(event);
|
|
6545
6705
|
if (event.defaultPrevented) return;
|
|
@@ -6550,7 +6710,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6550
6710
|
if (!isVisible) {
|
|
6551
6711
|
return null;
|
|
6552
6712
|
}
|
|
6553
|
-
return /* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ jsx69(
|
|
6554
6714
|
Button2,
|
|
6555
6715
|
{
|
|
6556
6716
|
type: "button",
|
|
@@ -6564,10 +6724,10 @@ var UndoRedoButton = forwardRef18(
|
|
|
6564
6724
|
onClick: handleClick,
|
|
6565
6725
|
...buttonProps,
|
|
6566
6726
|
ref,
|
|
6567
|
-
children: children ?? /* @__PURE__ */
|
|
6568
|
-
/* @__PURE__ */
|
|
6569
|
-
text && /* @__PURE__ */
|
|
6570
|
-
showShortcut && /* @__PURE__ */
|
|
6727
|
+
children: children ?? /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
6728
|
+
/* @__PURE__ */ jsx69(Icon, { className: "tiptap-button-icon" }),
|
|
6729
|
+
text && /* @__PURE__ */ jsx69("span", { className: "tiptap-button-text", children: text }),
|
|
6730
|
+
showShortcut && /* @__PURE__ */ jsx69(
|
|
6571
6731
|
HistoryShortcutBadge,
|
|
6572
6732
|
{
|
|
6573
6733
|
action,
|
|
@@ -6582,13 +6742,13 @@ var UndoRedoButton = forwardRef18(
|
|
|
6582
6742
|
UndoRedoButton.displayName = "UndoRedoButton";
|
|
6583
6743
|
|
|
6584
6744
|
// src/components/tiptap-ui/undo-redo-button/use-undo-redo.ts
|
|
6585
|
-
import { useCallback as
|
|
6745
|
+
import { useCallback as useCallback25, useEffect as useEffect17, useState as useState24 } from "react";
|
|
6586
6746
|
|
|
6587
6747
|
// src/components/tiptap-icons/redo2-icon.tsx
|
|
6588
|
-
import { memo as
|
|
6589
|
-
import { jsx as
|
|
6590
|
-
var Redo2Icon =
|
|
6591
|
-
return /* @__PURE__ */
|
|
6748
|
+
import { memo as memo33 } from "react";
|
|
6749
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
6750
|
+
var Redo2Icon = memo33(({ className, ...props }) => {
|
|
6751
|
+
return /* @__PURE__ */ jsx70(
|
|
6592
6752
|
"svg",
|
|
6593
6753
|
{
|
|
6594
6754
|
width: "24",
|
|
@@ -6598,7 +6758,7 @@ var Redo2Icon = memo37(({ className, ...props }) => {
|
|
|
6598
6758
|
fill: "currentColor",
|
|
6599
6759
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6600
6760
|
...props,
|
|
6601
|
-
children: /* @__PURE__ */
|
|
6761
|
+
children: /* @__PURE__ */ jsx70(
|
|
6602
6762
|
"path",
|
|
6603
6763
|
{
|
|
6604
6764
|
fillRule: "evenodd",
|
|
@@ -6613,10 +6773,10 @@ var Redo2Icon = memo37(({ className, ...props }) => {
|
|
|
6613
6773
|
Redo2Icon.displayName = "Redo2Icon";
|
|
6614
6774
|
|
|
6615
6775
|
// src/components/tiptap-icons/undo2-icon.tsx
|
|
6616
|
-
import { memo as
|
|
6617
|
-
import { jsx as
|
|
6618
|
-
var Undo2Icon =
|
|
6619
|
-
return /* @__PURE__ */
|
|
6776
|
+
import { memo as memo34 } from "react";
|
|
6777
|
+
import { jsx as jsx71 } from "react/jsx-runtime";
|
|
6778
|
+
var Undo2Icon = memo34(({ className, ...props }) => {
|
|
6779
|
+
return /* @__PURE__ */ jsx71(
|
|
6620
6780
|
"svg",
|
|
6621
6781
|
{
|
|
6622
6782
|
width: "24",
|
|
@@ -6626,7 +6786,7 @@ var Undo2Icon = memo38(({ className, ...props }) => {
|
|
|
6626
6786
|
fill: "currentColor",
|
|
6627
6787
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6628
6788
|
...props,
|
|
6629
|
-
children: /* @__PURE__ */
|
|
6789
|
+
children: /* @__PURE__ */ jsx71(
|
|
6630
6790
|
"path",
|
|
6631
6791
|
{
|
|
6632
6792
|
fillRule: "evenodd",
|
|
@@ -6680,7 +6840,7 @@ function useUndoRedo(config) {
|
|
|
6680
6840
|
onExecuted
|
|
6681
6841
|
} = config;
|
|
6682
6842
|
const { editor } = useTiptapEditor(providedEditor);
|
|
6683
|
-
const [isVisible, setIsVisible] =
|
|
6843
|
+
const [isVisible, setIsVisible] = useState24(true);
|
|
6684
6844
|
const canExecute = canExecuteUndoRedoAction(editor, action);
|
|
6685
6845
|
useEffect17(() => {
|
|
6686
6846
|
if (!editor) return;
|
|
@@ -6693,7 +6853,7 @@ function useUndoRedo(config) {
|
|
|
6693
6853
|
editor.off("transaction", handleUpdate);
|
|
6694
6854
|
};
|
|
6695
6855
|
}, [editor, hideWhenUnavailable, action]);
|
|
6696
|
-
const handleAction =
|
|
6856
|
+
const handleAction = useCallback25(() => {
|
|
6697
6857
|
if (!editor) return false;
|
|
6698
6858
|
const success = executeUndoRedoAction(editor, action);
|
|
6699
6859
|
if (success) {
|
|
@@ -6713,7 +6873,7 @@ function useUndoRedo(config) {
|
|
|
6713
6873
|
|
|
6714
6874
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
6715
6875
|
import { useCurrentEditor as useCurrentEditor3 } from "@tiptap/react";
|
|
6716
|
-
import { useState as
|
|
6876
|
+
import { useState as useState25 } from "react";
|
|
6717
6877
|
|
|
6718
6878
|
// src/lib/font.ts
|
|
6719
6879
|
var FONT_OPTIONS = [
|
|
@@ -6757,12 +6917,12 @@ import { ChevronDown } from "lucide-react";
|
|
|
6757
6917
|
// src/components/ui/command.tsx
|
|
6758
6918
|
import { Command as CommandPrimitive } from "cmdk";
|
|
6759
6919
|
import { SearchIcon } from "lucide-react";
|
|
6760
|
-
import { jsx as
|
|
6920
|
+
import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6761
6921
|
function Command({
|
|
6762
6922
|
className,
|
|
6763
6923
|
...props
|
|
6764
6924
|
}) {
|
|
6765
|
-
return /* @__PURE__ */
|
|
6925
|
+
return /* @__PURE__ */ jsx72(
|
|
6766
6926
|
CommandPrimitive,
|
|
6767
6927
|
{
|
|
6768
6928
|
"data-slot": "command",
|
|
@@ -6778,14 +6938,14 @@ function CommandInput({
|
|
|
6778
6938
|
className,
|
|
6779
6939
|
...props
|
|
6780
6940
|
}) {
|
|
6781
|
-
return /* @__PURE__ */
|
|
6941
|
+
return /* @__PURE__ */ jsxs42(
|
|
6782
6942
|
"div",
|
|
6783
6943
|
{
|
|
6784
6944
|
"data-slot": "command-input-wrapper",
|
|
6785
6945
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
6786
6946
|
children: [
|
|
6787
|
-
/* @__PURE__ */
|
|
6788
|
-
/* @__PURE__ */
|
|
6947
|
+
/* @__PURE__ */ jsx72(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
6948
|
+
/* @__PURE__ */ jsx72(
|
|
6789
6949
|
CommandPrimitive.Input,
|
|
6790
6950
|
{
|
|
6791
6951
|
"data-slot": "command-input",
|
|
@@ -6804,7 +6964,7 @@ function CommandList({
|
|
|
6804
6964
|
className,
|
|
6805
6965
|
...props
|
|
6806
6966
|
}) {
|
|
6807
|
-
return /* @__PURE__ */
|
|
6967
|
+
return /* @__PURE__ */ jsx72(
|
|
6808
6968
|
CommandPrimitive.List,
|
|
6809
6969
|
{
|
|
6810
6970
|
"data-slot": "command-list",
|
|
@@ -6819,7 +6979,7 @@ function CommandList({
|
|
|
6819
6979
|
function CommandEmpty({
|
|
6820
6980
|
...props
|
|
6821
6981
|
}) {
|
|
6822
|
-
return /* @__PURE__ */
|
|
6982
|
+
return /* @__PURE__ */ jsx72(
|
|
6823
6983
|
CommandPrimitive.Empty,
|
|
6824
6984
|
{
|
|
6825
6985
|
"data-slot": "command-empty",
|
|
@@ -6832,7 +6992,7 @@ function CommandGroup({
|
|
|
6832
6992
|
className,
|
|
6833
6993
|
...props
|
|
6834
6994
|
}) {
|
|
6835
|
-
return /* @__PURE__ */
|
|
6995
|
+
return /* @__PURE__ */ jsx72(
|
|
6836
6996
|
CommandPrimitive.Group,
|
|
6837
6997
|
{
|
|
6838
6998
|
"data-slot": "command-group",
|
|
@@ -6848,7 +7008,7 @@ function CommandItem({
|
|
|
6848
7008
|
className,
|
|
6849
7009
|
...props
|
|
6850
7010
|
}) {
|
|
6851
|
-
return /* @__PURE__ */
|
|
7011
|
+
return /* @__PURE__ */ jsx72(
|
|
6852
7012
|
CommandPrimitive.Item,
|
|
6853
7013
|
{
|
|
6854
7014
|
"data-slot": "command-item",
|
|
@@ -6863,16 +7023,16 @@ function CommandItem({
|
|
|
6863
7023
|
|
|
6864
7024
|
// src/components/ui/popover.tsx
|
|
6865
7025
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
6866
|
-
import { jsx as
|
|
7026
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
6867
7027
|
function Popover2({
|
|
6868
7028
|
...props
|
|
6869
7029
|
}) {
|
|
6870
|
-
return /* @__PURE__ */
|
|
7030
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Root, { "data-slot": "popover", ...props });
|
|
6871
7031
|
}
|
|
6872
7032
|
function PopoverTrigger2({
|
|
6873
7033
|
...props
|
|
6874
7034
|
}) {
|
|
6875
|
-
return /* @__PURE__ */
|
|
7035
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
6876
7036
|
}
|
|
6877
7037
|
function PopoverContent2({
|
|
6878
7038
|
className,
|
|
@@ -6880,7 +7040,7 @@ function PopoverContent2({
|
|
|
6880
7040
|
sideOffset = 4,
|
|
6881
7041
|
...props
|
|
6882
7042
|
}) {
|
|
6883
|
-
return /* @__PURE__ */
|
|
7043
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx73(
|
|
6884
7044
|
PopoverPrimitive2.Content,
|
|
6885
7045
|
{
|
|
6886
7046
|
"data-slot": "popover-content",
|
|
@@ -6896,10 +7056,10 @@ function PopoverContent2({
|
|
|
6896
7056
|
}
|
|
6897
7057
|
|
|
6898
7058
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
6899
|
-
import { jsx as
|
|
7059
|
+
import { jsx as jsx74, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6900
7060
|
function FontFamilyDropdown() {
|
|
6901
7061
|
const { editor } = useCurrentEditor3();
|
|
6902
|
-
const [open, setOpen] =
|
|
7062
|
+
const [open, setOpen] = useState25(false);
|
|
6903
7063
|
if (!editor) return null;
|
|
6904
7064
|
const currentFont = editor.getAttributes("textStyle").fontFamily || "Font Family";
|
|
6905
7065
|
const applyFont = (family) => {
|
|
@@ -6917,19 +7077,19 @@ function FontFamilyDropdown() {
|
|
|
6917
7077
|
}
|
|
6918
7078
|
}, 0);
|
|
6919
7079
|
};
|
|
6920
|
-
return /* @__PURE__ */
|
|
6921
|
-
/* @__PURE__ */
|
|
7080
|
+
return /* @__PURE__ */ jsxs43(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7081
|
+
/* @__PURE__ */ jsx74(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs43(
|
|
6922
7082
|
Button,
|
|
6923
7083
|
{
|
|
6924
7084
|
variant: "outlineFontFamily",
|
|
6925
7085
|
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 ",
|
|
6926
7086
|
children: [
|
|
6927
7087
|
currentFont,
|
|
6928
|
-
/* @__PURE__ */
|
|
7088
|
+
/* @__PURE__ */ jsx74(ChevronDown, { className: "w-4 h-4" })
|
|
6929
7089
|
]
|
|
6930
7090
|
}
|
|
6931
7091
|
) }),
|
|
6932
|
-
/* @__PURE__ */
|
|
7092
|
+
/* @__PURE__ */ jsx74(
|
|
6933
7093
|
PopoverContent2,
|
|
6934
7094
|
{
|
|
6935
7095
|
className: "w-[300px] p-0",
|
|
@@ -6940,12 +7100,12 @@ function FontFamilyDropdown() {
|
|
|
6940
7100
|
e.preventDefault();
|
|
6941
7101
|
}
|
|
6942
7102
|
},
|
|
6943
|
-
children: /* @__PURE__ */
|
|
6944
|
-
/* @__PURE__ */
|
|
6945
|
-
/* @__PURE__ */
|
|
6946
|
-
/* @__PURE__ */
|
|
6947
|
-
/* @__PURE__ */
|
|
6948
|
-
/* @__PURE__ */
|
|
7103
|
+
children: /* @__PURE__ */ jsxs43(Command, { children: [
|
|
7104
|
+
/* @__PURE__ */ jsx74("div", { className: "cmd-input-wrapper", children: /* @__PURE__ */ jsx74(CommandInput, { placeholder: "Search font..." }) }),
|
|
7105
|
+
/* @__PURE__ */ jsxs43(CommandList, { className: "max-h-[220px]", children: [
|
|
7106
|
+
/* @__PURE__ */ jsx74(CommandEmpty, { children: "No font found." }),
|
|
7107
|
+
/* @__PURE__ */ jsxs43(CommandGroup, { children: [
|
|
7108
|
+
/* @__PURE__ */ jsx74(
|
|
6949
7109
|
CommandItem,
|
|
6950
7110
|
{
|
|
6951
7111
|
onSelect: () => {
|
|
@@ -6968,7 +7128,7 @@ function FontFamilyDropdown() {
|
|
|
6968
7128
|
},
|
|
6969
7129
|
"default"
|
|
6970
7130
|
),
|
|
6971
|
-
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */
|
|
7131
|
+
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */ jsx74(
|
|
6972
7132
|
CommandItem,
|
|
6973
7133
|
{
|
|
6974
7134
|
onSelect: () => {
|
|
@@ -6989,7 +7149,7 @@ function FontFamilyDropdown() {
|
|
|
6989
7149
|
}
|
|
6990
7150
|
|
|
6991
7151
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
6992
|
-
import { useState as
|
|
7152
|
+
import { useState as useState26, useEffect as useEffect18 } from "react";
|
|
6993
7153
|
import { useCurrentEditor as useCurrentEditor4 } from "@tiptap/react";
|
|
6994
7154
|
import { HexColorPicker } from "react-colorful";
|
|
6995
7155
|
|
|
@@ -7079,12 +7239,12 @@ import { debounce } from "lodash";
|
|
|
7079
7239
|
|
|
7080
7240
|
// src/components/ui/label.tsx
|
|
7081
7241
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7082
|
-
import { jsx as
|
|
7083
|
-
function
|
|
7242
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
7243
|
+
function Label2({
|
|
7084
7244
|
className,
|
|
7085
7245
|
...props
|
|
7086
7246
|
}) {
|
|
7087
|
-
return /* @__PURE__ */
|
|
7247
|
+
return /* @__PURE__ */ jsx75(
|
|
7088
7248
|
LabelPrimitive.Root,
|
|
7089
7249
|
{
|
|
7090
7250
|
"data-slot": "label",
|
|
@@ -7099,14 +7259,14 @@ function Label({
|
|
|
7099
7259
|
|
|
7100
7260
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
7101
7261
|
import React4 from "react";
|
|
7102
|
-
import { jsx as
|
|
7262
|
+
import { jsx as jsx76, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
7103
7263
|
function ColorPicker({ type = "text" }) {
|
|
7104
7264
|
const { editor } = useCurrentEditor4();
|
|
7105
|
-
const [open, setOpen] =
|
|
7106
|
-
const [color, setColor] =
|
|
7107
|
-
const [showCustom, setShowCustom] =
|
|
7108
|
-
const [tempHex, setTempHex] =
|
|
7109
|
-
const [canApply, setCanApply] =
|
|
7265
|
+
const [open, setOpen] = useState26(false);
|
|
7266
|
+
const [color, setColor] = useState26("#000000");
|
|
7267
|
+
const [showCustom, setShowCustom] = useState26(false);
|
|
7268
|
+
const [tempHex, setTempHex] = useState26("#000000");
|
|
7269
|
+
const [canApply, setCanApply] = useState26(false);
|
|
7110
7270
|
useEffect18(() => {
|
|
7111
7271
|
const current = type === "text" ? editor?.getAttributes("textStyle").color || "#000000" : editor?.getAttributes("highlight")?.color || "#FFFF00";
|
|
7112
7272
|
setColor(current);
|
|
@@ -7149,15 +7309,15 @@ function ColorPicker({ type = "text" }) {
|
|
|
7149
7309
|
[]
|
|
7150
7310
|
);
|
|
7151
7311
|
if (!editor) return null;
|
|
7152
|
-
return /* @__PURE__ */
|
|
7153
|
-
/* @__PURE__ */
|
|
7312
|
+
return /* @__PURE__ */ jsxs44(Popover2, { open, onOpenChange: (v) => setOpen(v), children: [
|
|
7313
|
+
/* @__PURE__ */ jsx76(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs44(
|
|
7154
7314
|
Button,
|
|
7155
7315
|
{
|
|
7156
7316
|
variant: "outlineFontFamily",
|
|
7157
7317
|
className: "flex items-center h-7 rounded-sm px-2 border-[#a3a3a8] text-[#a3a3a8] hover:text-white",
|
|
7158
7318
|
children: [
|
|
7159
7319
|
"Color",
|
|
7160
|
-
/* @__PURE__ */
|
|
7320
|
+
/* @__PURE__ */ jsx76(
|
|
7161
7321
|
"span",
|
|
7162
7322
|
{
|
|
7163
7323
|
className: "w-3 h-3 ml-2 rounded-sm border border-black/20",
|
|
@@ -7167,16 +7327,16 @@ function ColorPicker({ type = "text" }) {
|
|
|
7167
7327
|
]
|
|
7168
7328
|
}
|
|
7169
7329
|
) }),
|
|
7170
|
-
/* @__PURE__ */
|
|
7330
|
+
/* @__PURE__ */ jsxs44(
|
|
7171
7331
|
PopoverContent2,
|
|
7172
7332
|
{
|
|
7173
7333
|
className: "w-[260px] p-3",
|
|
7174
7334
|
align: "start",
|
|
7175
7335
|
onClick: (e) => e.stopPropagation(),
|
|
7176
7336
|
children: [
|
|
7177
|
-
/* @__PURE__ */
|
|
7178
|
-
!showCustom && /* @__PURE__ */
|
|
7179
|
-
/* @__PURE__ */
|
|
7337
|
+
/* @__PURE__ */ jsx76(Label2, { className: "text-xs mb-2", children: type === "text" ? "Text Color" : "Highlight Color" }),
|
|
7338
|
+
!showCustom && /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-3", children: [
|
|
7339
|
+
/* @__PURE__ */ jsx76("div", { className: "grid grid-cols-7 gap-1", children: GRADIENT_ROWS_70.map((c) => /* @__PURE__ */ jsx76(
|
|
7180
7340
|
"div",
|
|
7181
7341
|
{
|
|
7182
7342
|
onClick: () => {
|
|
@@ -7188,7 +7348,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7188
7348
|
},
|
|
7189
7349
|
c
|
|
7190
7350
|
)) }),
|
|
7191
|
-
/* @__PURE__ */
|
|
7351
|
+
/* @__PURE__ */ jsx76(
|
|
7192
7352
|
Button,
|
|
7193
7353
|
{
|
|
7194
7354
|
size: "sm",
|
|
@@ -7202,7 +7362,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7202
7362
|
)
|
|
7203
7363
|
] }),
|
|
7204
7364
|
showCustom && // stop mouse/pointer events from bubbling so popover doesn't treat them as outside clicks
|
|
7205
|
-
/* @__PURE__ */
|
|
7365
|
+
/* @__PURE__ */ jsxs44(
|
|
7206
7366
|
"div",
|
|
7207
7367
|
{
|
|
7208
7368
|
className: "flex flex-col gap-3",
|
|
@@ -7212,7 +7372,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7212
7372
|
onPointerUp: (e) => e.stopPropagation(),
|
|
7213
7373
|
onClick: (e) => e.stopPropagation(),
|
|
7214
7374
|
children: [
|
|
7215
|
-
/* @__PURE__ */
|
|
7375
|
+
/* @__PURE__ */ jsx76(
|
|
7216
7376
|
HexColorPicker,
|
|
7217
7377
|
{
|
|
7218
7378
|
color: tempHex,
|
|
@@ -7223,8 +7383,8 @@ function ColorPicker({ type = "text" }) {
|
|
|
7223
7383
|
onMouseUp: (e) => e.stopPropagation()
|
|
7224
7384
|
}
|
|
7225
7385
|
),
|
|
7226
|
-
/* @__PURE__ */
|
|
7227
|
-
/* @__PURE__ */
|
|
7386
|
+
/* @__PURE__ */ jsxs44("div", { className: "flex gap-2 items-center", children: [
|
|
7387
|
+
/* @__PURE__ */ jsx76(
|
|
7228
7388
|
"input",
|
|
7229
7389
|
{
|
|
7230
7390
|
value: tempHex,
|
|
@@ -7235,7 +7395,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7235
7395
|
className: "w-full px-2 py-1 border rounded text-sm"
|
|
7236
7396
|
}
|
|
7237
7397
|
),
|
|
7238
|
-
/* @__PURE__ */
|
|
7398
|
+
/* @__PURE__ */ jsx76(
|
|
7239
7399
|
Button,
|
|
7240
7400
|
{
|
|
7241
7401
|
size: "sm",
|
|
@@ -7248,7 +7408,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7248
7408
|
}
|
|
7249
7409
|
)
|
|
7250
7410
|
] }),
|
|
7251
|
-
/* @__PURE__ */
|
|
7411
|
+
/* @__PURE__ */ jsx76("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ jsx76(
|
|
7252
7412
|
Button,
|
|
7253
7413
|
{
|
|
7254
7414
|
size: "sm",
|
|
@@ -7273,13 +7433,13 @@ function ColorPicker({ type = "text" }) {
|
|
|
7273
7433
|
}
|
|
7274
7434
|
|
|
7275
7435
|
// src/components/tiptap-ui/table-dropdown-menu/table-dropdown-menu.tsx
|
|
7276
|
-
import { useState as
|
|
7436
|
+
import { useState as useState27 } from "react";
|
|
7277
7437
|
import { useCurrentEditor as useCurrentEditor5 } from "@tiptap/react";
|
|
7278
7438
|
import { FiTable } from "react-icons/fi";
|
|
7279
|
-
import { jsx as
|
|
7439
|
+
import { jsx as jsx77, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
7280
7440
|
function TableDropdownMenu() {
|
|
7281
7441
|
const { editor } = useCurrentEditor5();
|
|
7282
|
-
const [open, setOpen] =
|
|
7442
|
+
const [open, setOpen] = useState27(false);
|
|
7283
7443
|
if (!editor) return null;
|
|
7284
7444
|
const handleAction = (action) => {
|
|
7285
7445
|
switch (action) {
|
|
@@ -7318,31 +7478,31 @@ function TableDropdownMenu() {
|
|
|
7318
7478
|
}
|
|
7319
7479
|
setOpen(false);
|
|
7320
7480
|
};
|
|
7321
|
-
return /* @__PURE__ */
|
|
7322
|
-
/* @__PURE__ */
|
|
7323
|
-
/* @__PURE__ */
|
|
7324
|
-
/* @__PURE__ */
|
|
7325
|
-
/* @__PURE__ */
|
|
7326
|
-
/* @__PURE__ */
|
|
7327
|
-
/* @__PURE__ */
|
|
7328
|
-
/* @__PURE__ */
|
|
7329
|
-
/* @__PURE__ */
|
|
7330
|
-
/* @__PURE__ */
|
|
7331
|
-
/* @__PURE__ */
|
|
7332
|
-
/* @__PURE__ */
|
|
7333
|
-
/* @__PURE__ */
|
|
7334
|
-
/* @__PURE__ */
|
|
7335
|
-
/* @__PURE__ */
|
|
7481
|
+
return /* @__PURE__ */ jsxs45(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7482
|
+
/* @__PURE__ */ jsx77(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsx77(Button, { variant: "tableButton", size: "sm", children: /* @__PURE__ */ jsx77(FiTable, { size: 16, color: "#a3a3a8" }) }) }),
|
|
7483
|
+
/* @__PURE__ */ jsx77(PopoverContent2, { className: "w-[220px] p-0", align: "start", children: /* @__PURE__ */ jsxs45(Command, { children: [
|
|
7484
|
+
/* @__PURE__ */ jsx77(CommandInput, { placeholder: "Search table actions..." }),
|
|
7485
|
+
/* @__PURE__ */ jsx77(CommandList, { className: "max-h-[260px]", children: /* @__PURE__ */ jsxs45(CommandGroup, { children: [
|
|
7486
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("insert"), children: "Insert Table" }),
|
|
7487
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("addColBefore"), children: "Add Column Before" }),
|
|
7488
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("addColAfter"), children: "Add Column After" }),
|
|
7489
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("delCol"), children: "Delete Column" }),
|
|
7490
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("addRowBefore"), children: "Add Row Before" }),
|
|
7491
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("addRowAfter"), children: "Add Row After" }),
|
|
7492
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("delRow"), children: "Delete Row" }),
|
|
7493
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("merge"), children: "Merge Cells" }),
|
|
7494
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("split"), children: "Split Cells" }),
|
|
7495
|
+
/* @__PURE__ */ jsx77(CommandItem, { onSelect: () => handleAction("deleteTable"), children: "Delete Table" })
|
|
7336
7496
|
] }) })
|
|
7337
7497
|
] }) })
|
|
7338
7498
|
] });
|
|
7339
7499
|
}
|
|
7340
7500
|
|
|
7341
7501
|
// src/components/tiptap-icons/arrow-left-icon.tsx
|
|
7342
|
-
import { memo as
|
|
7343
|
-
import { jsx as
|
|
7344
|
-
var ArrowLeftIcon =
|
|
7345
|
-
return /* @__PURE__ */
|
|
7502
|
+
import { memo as memo35 } from "react";
|
|
7503
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
7504
|
+
var ArrowLeftIcon = memo35(({ className, ...props }) => {
|
|
7505
|
+
return /* @__PURE__ */ jsx78(
|
|
7346
7506
|
"svg",
|
|
7347
7507
|
{
|
|
7348
7508
|
width: "24",
|
|
@@ -7352,7 +7512,7 @@ var ArrowLeftIcon = memo39(({ className, ...props }) => {
|
|
|
7352
7512
|
fill: "currentColor",
|
|
7353
7513
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7354
7514
|
...props,
|
|
7355
|
-
children: /* @__PURE__ */
|
|
7515
|
+
children: /* @__PURE__ */ jsx78(
|
|
7356
7516
|
"path",
|
|
7357
7517
|
{
|
|
7358
7518
|
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",
|
|
@@ -7365,15 +7525,15 @@ var ArrowLeftIcon = memo39(({ className, ...props }) => {
|
|
|
7365
7525
|
ArrowLeftIcon.displayName = "ArrowLeftIcon";
|
|
7366
7526
|
|
|
7367
7527
|
// src/hooks/use-window-size.ts
|
|
7368
|
-
import { useEffect as useEffect20, useState as
|
|
7528
|
+
import { useEffect as useEffect20, useState as useState28 } from "react";
|
|
7369
7529
|
|
|
7370
7530
|
// src/hooks/use-throttled-callback.ts
|
|
7371
7531
|
import throttle from "lodash.throttle";
|
|
7372
7532
|
|
|
7373
7533
|
// src/hooks/use-unmount.ts
|
|
7374
|
-
import { useRef as
|
|
7534
|
+
import { useRef as useRef7, useEffect as useEffect19 } from "react";
|
|
7375
7535
|
var useUnmount = (callback) => {
|
|
7376
|
-
const ref =
|
|
7536
|
+
const ref = useRef7(callback);
|
|
7377
7537
|
ref.current = callback;
|
|
7378
7538
|
useEffect19(
|
|
7379
7539
|
() => () => {
|
|
@@ -7384,13 +7544,13 @@ var useUnmount = (callback) => {
|
|
|
7384
7544
|
};
|
|
7385
7545
|
|
|
7386
7546
|
// src/hooks/use-throttled-callback.ts
|
|
7387
|
-
import { useMemo as
|
|
7547
|
+
import { useMemo as useMemo10 } from "react";
|
|
7388
7548
|
var defaultOptions = {
|
|
7389
7549
|
leading: false,
|
|
7390
7550
|
trailing: true
|
|
7391
7551
|
};
|
|
7392
7552
|
function useThrottledCallback(fn, wait = 250, dependencies = [], options = defaultOptions) {
|
|
7393
|
-
const handler =
|
|
7553
|
+
const handler = useMemo10(
|
|
7394
7554
|
() => throttle(fn, wait, options),
|
|
7395
7555
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7396
7556
|
dependencies
|
|
@@ -7403,7 +7563,7 @@ function useThrottledCallback(fn, wait = 250, dependencies = [], options = defau
|
|
|
7403
7563
|
|
|
7404
7564
|
// src/hooks/use-window-size.ts
|
|
7405
7565
|
function useWindowSize() {
|
|
7406
|
-
const [windowSize, setWindowSize] =
|
|
7566
|
+
const [windowSize, setWindowSize] = useState28({
|
|
7407
7567
|
width: 0,
|
|
7408
7568
|
height: 0,
|
|
7409
7569
|
offsetTop: 0,
|
|
@@ -7441,7 +7601,7 @@ function useWindowSize() {
|
|
|
7441
7601
|
}
|
|
7442
7602
|
|
|
7443
7603
|
// src/hooks/use-element-rect.ts
|
|
7444
|
-
import { useCallback as
|
|
7604
|
+
import { useCallback as useCallback26, useEffect as useEffect21, useState as useState29 } from "react";
|
|
7445
7605
|
var initialRect = {
|
|
7446
7606
|
x: 0,
|
|
7447
7607
|
y: 0,
|
|
@@ -7461,8 +7621,8 @@ function useElementRect({
|
|
|
7461
7621
|
throttleMs = 100,
|
|
7462
7622
|
useResizeObserver = true
|
|
7463
7623
|
} = {}) {
|
|
7464
|
-
const [rect, setRect] =
|
|
7465
|
-
const getTargetElement =
|
|
7624
|
+
const [rect, setRect] = useState29(initialRect);
|
|
7625
|
+
const getTargetElement = useCallback26(() => {
|
|
7466
7626
|
if (!enabled || !isClientSide()) return null;
|
|
7467
7627
|
if (!element) {
|
|
7468
7628
|
return document.body;
|
|
@@ -7578,71 +7738,71 @@ function useCursorVisibility({
|
|
|
7578
7738
|
}
|
|
7579
7739
|
|
|
7580
7740
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
7581
|
-
import { Fragment as
|
|
7741
|
+
import { Fragment as Fragment11, jsx as jsx79, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7582
7742
|
var MainToolbarContent = ({
|
|
7583
7743
|
onHighlighterClick,
|
|
7584
7744
|
onLinkClick,
|
|
7585
7745
|
isMobile
|
|
7586
7746
|
}) => {
|
|
7587
|
-
return /* @__PURE__ */
|
|
7588
|
-
/* @__PURE__ */
|
|
7589
|
-
/* @__PURE__ */
|
|
7590
|
-
/* @__PURE__ */
|
|
7591
|
-
/* @__PURE__ */
|
|
7592
|
-
/* @__PURE__ */
|
|
7593
|
-
/* @__PURE__ */
|
|
7594
|
-
/* @__PURE__ */
|
|
7595
|
-
/* @__PURE__ */
|
|
7596
|
-
/* @__PURE__ */
|
|
7597
|
-
/* @__PURE__ */
|
|
7598
|
-
/* @__PURE__ */
|
|
7747
|
+
return /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
7748
|
+
/* @__PURE__ */ jsx79(Spacer, {}),
|
|
7749
|
+
/* @__PURE__ */ jsx79(FontFamilyDropdown, {}),
|
|
7750
|
+
/* @__PURE__ */ jsx79(ColorPicker, { type: "text" }),
|
|
7751
|
+
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7752
|
+
/* @__PURE__ */ jsx79(MarkButton, { type: "bold" }),
|
|
7753
|
+
/* @__PURE__ */ jsx79(MarkButton, { type: "italic" }),
|
|
7754
|
+
/* @__PURE__ */ jsx79(MarkButton, { type: "strike" }),
|
|
7755
|
+
/* @__PURE__ */ jsx79(MarkButton, { type: "code" }),
|
|
7756
|
+
/* @__PURE__ */ jsx79(MarkButton, { type: "underline" }),
|
|
7757
|
+
/* @__PURE__ */ jsx79(UndoRedoButton, { action: "undo" }),
|
|
7758
|
+
/* @__PURE__ */ jsx79(UndoRedoButton, { action: "redo" })
|
|
7599
7759
|
] }),
|
|
7600
|
-
/* @__PURE__ */
|
|
7601
|
-
/* @__PURE__ */
|
|
7602
|
-
/* @__PURE__ */
|
|
7603
|
-
/* @__PURE__ */
|
|
7604
|
-
/* @__PURE__ */
|
|
7605
|
-
/* @__PURE__ */
|
|
7760
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7761
|
+
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7762
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "left" }),
|
|
7763
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "center" }),
|
|
7764
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "right" }),
|
|
7765
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "justify" })
|
|
7606
7766
|
] }),
|
|
7607
|
-
/* @__PURE__ */
|
|
7608
|
-
/* @__PURE__ */
|
|
7609
|
-
/* @__PURE__ */
|
|
7610
|
-
/* @__PURE__ */
|
|
7767
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7768
|
+
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7769
|
+
/* @__PURE__ */ jsx79(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
7770
|
+
/* @__PURE__ */ jsx79(
|
|
7611
7771
|
ListDropdownMenu,
|
|
7612
7772
|
{
|
|
7613
7773
|
types: ["bulletList", "orderedList", "taskList"],
|
|
7614
7774
|
portal: isMobile
|
|
7615
7775
|
}
|
|
7616
7776
|
),
|
|
7617
|
-
/* @__PURE__ */
|
|
7777
|
+
/* @__PURE__ */ jsx79(BlockquoteButton, {})
|
|
7618
7778
|
] }),
|
|
7619
|
-
/* @__PURE__ */
|
|
7620
|
-
/* @__PURE__ */
|
|
7621
|
-
/* @__PURE__ */
|
|
7622
|
-
/* @__PURE__ */
|
|
7623
|
-
/* @__PURE__ */
|
|
7624
|
-
isMobile && /* @__PURE__ */
|
|
7779
|
+
/* @__PURE__ */ jsx79(ToolbarGroup, { children: /* @__PURE__ */ jsx79(TableDropdownMenu, {}) }),
|
|
7780
|
+
/* @__PURE__ */ jsx79(ToolbarGroup, {}),
|
|
7781
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7782
|
+
/* @__PURE__ */ jsx79(ToolbarGroup, { children: /* @__PURE__ */ jsx79(ImageUploadButton, { text: "Add" }) }),
|
|
7783
|
+
/* @__PURE__ */ jsx79(Spacer, {}),
|
|
7784
|
+
isMobile && /* @__PURE__ */ jsx79(ToolbarSeparator, {})
|
|
7625
7785
|
] });
|
|
7626
7786
|
};
|
|
7627
7787
|
var MobileToolbarContent = ({
|
|
7628
7788
|
type,
|
|
7629
7789
|
onBack
|
|
7630
|
-
}) => /* @__PURE__ */
|
|
7631
|
-
/* @__PURE__ */
|
|
7632
|
-
/* @__PURE__ */
|
|
7633
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
7790
|
+
}) => /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
7791
|
+
/* @__PURE__ */ jsx79(ToolbarGroup, { children: /* @__PURE__ */ jsxs46(Button2, { "data-style": "ghost", onClick: onBack, children: [
|
|
7792
|
+
/* @__PURE__ */ jsx79(ArrowLeftIcon, { className: "tiptap-button-icon" }),
|
|
7793
|
+
type === "highlighter" ? /* @__PURE__ */ jsx79(HighlighterIcon, { className: "tiptap-button-icon" }) : /* @__PURE__ */ jsx79(LinkIcon, { className: "tiptap-button-icon" })
|
|
7634
7794
|
] }) }),
|
|
7635
|
-
/* @__PURE__ */
|
|
7636
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
7795
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7796
|
+
type === "highlighter" ? /* @__PURE__ */ jsx79(ColorHighlightPopoverContent, {}) : /* @__PURE__ */ jsx79(LinkContent, {})
|
|
7637
7797
|
] });
|
|
7638
7798
|
function SimpleEditor() {
|
|
7639
7799
|
const { setEditorContent, debouncedSave } = useEditorBridge();
|
|
7640
7800
|
const isMobile = useIsBreakpoint();
|
|
7641
7801
|
const { height } = useWindowSize();
|
|
7642
|
-
const [mobileView, setMobileView] =
|
|
7802
|
+
const [mobileView, setMobileView] = useState30(
|
|
7643
7803
|
"main"
|
|
7644
7804
|
);
|
|
7645
|
-
const toolbarRef =
|
|
7805
|
+
const toolbarRef = useRef8(null);
|
|
7646
7806
|
const editor = useEditor({
|
|
7647
7807
|
immediatelyRender: false,
|
|
7648
7808
|
editorProps: {
|
|
@@ -7743,8 +7903,8 @@ function SimpleEditor() {
|
|
|
7743
7903
|
window.visualViewport?.removeEventListener("scroll", updatePosition);
|
|
7744
7904
|
};
|
|
7745
7905
|
}, []);
|
|
7746
|
-
return /* @__PURE__ */
|
|
7747
|
-
/* @__PURE__ */
|
|
7906
|
+
return /* @__PURE__ */ jsx79("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ jsxs46(EditorContext.Provider, { value: { editor }, children: [
|
|
7907
|
+
/* @__PURE__ */ jsx79(
|
|
7748
7908
|
Toolbar,
|
|
7749
7909
|
{
|
|
7750
7910
|
ref: toolbarRef,
|
|
@@ -7753,14 +7913,14 @@ function SimpleEditor() {
|
|
|
7753
7913
|
bottom: `calc(100% - ${height - rect.y}px)`
|
|
7754
7914
|
} : {}
|
|
7755
7915
|
},
|
|
7756
|
-
children: mobileView === "main" ? /* @__PURE__ */
|
|
7916
|
+
children: mobileView === "main" ? /* @__PURE__ */ jsx79(
|
|
7757
7917
|
MainToolbarContent,
|
|
7758
7918
|
{
|
|
7759
7919
|
onHighlighterClick: () => setMobileView("highlighter"),
|
|
7760
7920
|
onLinkClick: () => setMobileView("link"),
|
|
7761
7921
|
isMobile
|
|
7762
7922
|
}
|
|
7763
|
-
) : /* @__PURE__ */
|
|
7923
|
+
) : /* @__PURE__ */ jsx79(
|
|
7764
7924
|
MobileToolbarContent,
|
|
7765
7925
|
{
|
|
7766
7926
|
type: mobileView === "highlighter" ? "highlighter" : "link",
|
|
@@ -7769,14 +7929,14 @@ function SimpleEditor() {
|
|
|
7769
7929
|
)
|
|
7770
7930
|
}
|
|
7771
7931
|
),
|
|
7772
|
-
/* @__PURE__ */
|
|
7932
|
+
/* @__PURE__ */ jsx79(
|
|
7773
7933
|
EditorContent,
|
|
7774
7934
|
{
|
|
7775
7935
|
editor,
|
|
7776
7936
|
role: "presentation",
|
|
7777
7937
|
autoFocus: true,
|
|
7778
7938
|
className: "simple-editor-content",
|
|
7779
|
-
children: editor && /* @__PURE__ */
|
|
7939
|
+
children: editor && /* @__PURE__ */ jsx79(BubbleMenuInline, {})
|
|
7780
7940
|
}
|
|
7781
7941
|
)
|
|
7782
7942
|
] }) });
|
|
@@ -7784,9 +7944,9 @@ function SimpleEditor() {
|
|
|
7784
7944
|
|
|
7785
7945
|
// src/components/editor/editor.tsx
|
|
7786
7946
|
import clsx2 from "clsx";
|
|
7787
|
-
import { jsx as
|
|
7947
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
7788
7948
|
function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
7789
|
-
return /* @__PURE__ */
|
|
7949
|
+
return /* @__PURE__ */ jsx80(
|
|
7790
7950
|
"div",
|
|
7791
7951
|
{
|
|
7792
7952
|
className: clsx2(
|
|
@@ -7794,16 +7954,16 @@ function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
|
7794
7954
|
className
|
|
7795
7955
|
),
|
|
7796
7956
|
style,
|
|
7797
|
-
children: /* @__PURE__ */
|
|
7957
|
+
children: /* @__PURE__ */ jsx80(EditorShell, { children: /* @__PURE__ */ jsx80(EditorLayout, { onChange, initialTabs, onTabsChange, children: /* @__PURE__ */ jsx80(SimpleEditor, {}) }) })
|
|
7798
7958
|
}
|
|
7799
7959
|
);
|
|
7800
7960
|
}
|
|
7801
7961
|
|
|
7802
7962
|
// src/hooks/use-scrolling.ts
|
|
7803
|
-
import { useEffect as useEffect24, useState as
|
|
7963
|
+
import { useEffect as useEffect24, useState as useState31 } from "react";
|
|
7804
7964
|
function useScrolling(target, options = {}) {
|
|
7805
7965
|
const { debounce: debounce2 = 150, fallbackToDocument = true } = options;
|
|
7806
|
-
const [isScrolling, setIsScrolling] =
|
|
7966
|
+
const [isScrolling, setIsScrolling] = useState31(false);
|
|
7807
7967
|
useEffect24(() => {
|
|
7808
7968
|
const element = target && typeof Window !== "undefined" && target instanceof Window ? target : target?.current ?? window;
|
|
7809
7969
|
const eventTarget = fallbackToDocument && element === window && typeof document !== "undefined" ? document : element;
|