@mhamz.01/easyflow-texteditor 0.1.75 → 0.1.77
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 +170 -227
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +1374 -1157
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1152 -936
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -549,10 +549,10 @@ function EditorShell({ children }) {
|
|
|
549
549
|
}
|
|
550
550
|
|
|
551
551
|
// src/components/editorLayout/editorLayout.tsx
|
|
552
|
-
import { useState as useState4, useEffect as useEffect2, useRef, useCallback as
|
|
552
|
+
import { useState as useState4, useEffect as useEffect2, useRef as useRef2, useCallback as useCallback3, useMemo as useMemo3 } from "react";
|
|
553
553
|
|
|
554
554
|
// src/components/sidebar/EditorSidebar.tsx
|
|
555
|
-
import { useState as useState3 } from "react";
|
|
555
|
+
import { useState as useState3, memo, useCallback as useCallback2 } from "react";
|
|
556
556
|
import { MoreHorizontal, Plus, FileText } from "lucide-react";
|
|
557
557
|
import { motion, AnimatePresence } from "framer-motion";
|
|
558
558
|
|
|
@@ -624,19 +624,13 @@ var tabVariants = {
|
|
|
624
624
|
opacity: 1,
|
|
625
625
|
x: 0,
|
|
626
626
|
height: "auto",
|
|
627
|
-
transition: {
|
|
628
|
-
duration: 0.3,
|
|
629
|
-
ease: "easeOut"
|
|
630
|
-
}
|
|
627
|
+
transition: { duration: 0.3, ease: "easeOut" }
|
|
631
628
|
},
|
|
632
629
|
exit: {
|
|
633
630
|
opacity: 0,
|
|
634
631
|
x: -20,
|
|
635
632
|
height: 0,
|
|
636
|
-
transition: {
|
|
637
|
-
duration: 0.2,
|
|
638
|
-
ease: "easeIn"
|
|
639
|
-
}
|
|
633
|
+
transition: { duration: 0.2, ease: "easeIn" }
|
|
640
634
|
}
|
|
641
635
|
};
|
|
642
636
|
var subtabVariants = {
|
|
@@ -645,279 +639,479 @@ var subtabVariants = {
|
|
|
645
639
|
opacity: 1,
|
|
646
640
|
x: 0,
|
|
647
641
|
height: "auto",
|
|
648
|
-
transition: {
|
|
649
|
-
duration: 0.25,
|
|
650
|
-
ease: "easeOut"
|
|
651
|
-
}
|
|
642
|
+
transition: { duration: 0.25, ease: "easeOut" }
|
|
652
643
|
},
|
|
653
644
|
exit: {
|
|
654
645
|
opacity: 0,
|
|
655
646
|
x: -10,
|
|
656
647
|
height: 0,
|
|
657
|
-
transition: {
|
|
658
|
-
duration: 0.15,
|
|
659
|
-
ease: "easeIn"
|
|
660
|
-
}
|
|
648
|
+
transition: { duration: 0.15, ease: "easeIn" }
|
|
661
649
|
}
|
|
662
650
|
};
|
|
663
|
-
function
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
651
|
+
var SubTabTitle = memo(function SubTabTitle2({
|
|
652
|
+
isEditing,
|
|
653
|
+
title,
|
|
654
|
+
tempTitle,
|
|
655
|
+
onTitleChange,
|
|
656
|
+
onStartEdit,
|
|
657
|
+
onCommit,
|
|
658
|
+
onCancel,
|
|
670
659
|
onSelect,
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
onRenameSubTab,
|
|
674
|
-
onDeleteSubTab
|
|
660
|
+
tabId,
|
|
661
|
+
subTabId
|
|
675
662
|
}) {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
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: [
|
|
709
756
|
/* @__PURE__ */ jsx9(
|
|
710
|
-
|
|
757
|
+
DropdownMenuItem,
|
|
711
758
|
{
|
|
712
|
-
onClick:
|
|
713
|
-
className: "
|
|
714
|
-
|
|
715
|
-
children: /* @__PURE__ */ jsx9(Plus, { size: 16 })
|
|
759
|
+
onClick: onAddSubTab,
|
|
760
|
+
className: "cursor-pointer transition-colors duration-150",
|
|
761
|
+
children: "Add subtab"
|
|
716
762
|
}
|
|
717
|
-
)
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
const isOpen = openTabs[tab.id];
|
|
721
|
-
const hasSubtabs = tab.subtabs.length > 0;
|
|
722
|
-
const isActiveTab = tab.id === activeTabId && !activeSubTabId;
|
|
723
|
-
return /* @__PURE__ */ jsx9(
|
|
724
|
-
motion.div,
|
|
763
|
+
),
|
|
764
|
+
canDelete && /* @__PURE__ */ jsx9(
|
|
765
|
+
DropdownMenuItem,
|
|
725
766
|
{
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
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(
|
|
776
|
+
function SubTabItem2({
|
|
777
|
+
tab,
|
|
778
|
+
st,
|
|
779
|
+
activeSubTabId,
|
|
780
|
+
editingSubId,
|
|
781
|
+
tempTitle,
|
|
782
|
+
onSelect,
|
|
783
|
+
startRenameSubTab,
|
|
784
|
+
commitRenameSubTab,
|
|
785
|
+
setEditingSubId,
|
|
786
|
+
setTempTitle,
|
|
787
|
+
onDeleteSubTab
|
|
788
|
+
}) {
|
|
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);
|
|
806
|
+
},
|
|
807
|
+
[setTempTitle]
|
|
808
|
+
);
|
|
809
|
+
const handleCancel = useCallback2(() => {
|
|
810
|
+
setEditingSubId(null);
|
|
811
|
+
}, [setEditingSubId]);
|
|
812
|
+
return /* @__PURE__ */ jsxs5(
|
|
813
|
+
motion.div,
|
|
814
|
+
{
|
|
815
|
+
variants: subtabVariants,
|
|
816
|
+
initial: "initial",
|
|
817
|
+
animate: "animate",
|
|
818
|
+
exit: "exit",
|
|
819
|
+
layout: true,
|
|
820
|
+
className: `
|
|
821
|
+
group ml-9 flex items-center gap-2 rounded-md px-2 py-1.5 text-sm
|
|
822
|
+
transition-all duration-200 ease-in-out
|
|
823
|
+
${isActiveSubTab ? "bg-accent" : "hover:bg-accent/50"}
|
|
824
|
+
`,
|
|
825
|
+
children: [
|
|
826
|
+
/* @__PURE__ */ jsx9(
|
|
827
|
+
FileText,
|
|
828
|
+
{
|
|
829
|
+
size: 14,
|
|
830
|
+
className: `flex-shrink-0 transition-all duration-200 ${isActiveSubTab ? "opacity-100" : "opacity-50 group-hover:opacity-100"}`
|
|
831
|
+
}
|
|
832
|
+
),
|
|
833
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx9(
|
|
834
|
+
SubTabTitle,
|
|
835
|
+
{
|
|
836
|
+
isEditing,
|
|
837
|
+
title: st.title,
|
|
838
|
+
tempTitle,
|
|
839
|
+
onTitleChange: handleTitleChange,
|
|
840
|
+
onStartEdit: handleEdit,
|
|
841
|
+
onCommit: handleCommit,
|
|
842
|
+
onCancel: handleCancel,
|
|
843
|
+
onSelect: handleSelect,
|
|
844
|
+
tabId: tab.id,
|
|
845
|
+
subTabId: st.id
|
|
846
|
+
}
|
|
847
|
+
) }),
|
|
848
|
+
/* @__PURE__ */ jsx9(SubTabMenu, { onDelete: handleDelete })
|
|
849
|
+
]
|
|
850
|
+
},
|
|
851
|
+
st.id
|
|
852
|
+
);
|
|
853
|
+
},
|
|
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
|
+
}
|
|
857
|
+
);
|
|
858
|
+
var TabItem = memo(
|
|
859
|
+
function TabItem2({
|
|
860
|
+
tab,
|
|
861
|
+
activeTabId,
|
|
862
|
+
activeSubTabId,
|
|
863
|
+
canDeleteTab,
|
|
864
|
+
editingId,
|
|
865
|
+
editingSubId,
|
|
866
|
+
tempTitle,
|
|
867
|
+
openTabs,
|
|
868
|
+
onSelect,
|
|
869
|
+
onAddSubTab,
|
|
870
|
+
onDelete,
|
|
871
|
+
startRenameTab,
|
|
872
|
+
startRenameSubTab,
|
|
873
|
+
commitRenameTab,
|
|
874
|
+
commitRenameSubTab,
|
|
875
|
+
setEditingId,
|
|
876
|
+
setEditingSubId,
|
|
877
|
+
setTempTitle,
|
|
878
|
+
toggleTabOpen,
|
|
879
|
+
onRenameSubTab,
|
|
880
|
+
onDeleteSubTab,
|
|
881
|
+
setOpenTabs
|
|
882
|
+
}) {
|
|
883
|
+
const isOpen = openTabs[tab.id];
|
|
884
|
+
const hasSubtabs = tab.subtabs.length > 0;
|
|
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);
|
|
899
|
+
},
|
|
900
|
+
[setTempTitle]
|
|
901
|
+
);
|
|
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(
|
|
913
|
+
(e) => {
|
|
914
|
+
e.stopPropagation();
|
|
915
|
+
toggleTabOpen(tab.id);
|
|
916
|
+
},
|
|
917
|
+
[toggleTabOpen, tab.id]
|
|
918
|
+
);
|
|
919
|
+
const handleDelete = useCallback2(() => {
|
|
920
|
+
onDelete(tab.id);
|
|
921
|
+
}, [onDelete, tab.id]);
|
|
922
|
+
return /* @__PURE__ */ jsx9(
|
|
923
|
+
motion.div,
|
|
924
|
+
{
|
|
925
|
+
variants: tabVariants,
|
|
926
|
+
initial: "initial",
|
|
927
|
+
animate: "animate",
|
|
928
|
+
exit: "exit",
|
|
929
|
+
layout: true,
|
|
930
|
+
children: /* @__PURE__ */ jsxs5(SidebarMenuItem, { className: "list-none", children: [
|
|
931
|
+
/* @__PURE__ */ jsxs5(
|
|
932
|
+
"div",
|
|
933
|
+
{
|
|
934
|
+
className: `
|
|
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
|
+
`,
|
|
939
|
+
children: [
|
|
940
|
+
hasSubtabs && /* @__PURE__ */ jsx9(
|
|
941
|
+
"button",
|
|
942
|
+
{
|
|
943
|
+
onClick: handleToggle,
|
|
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(
|
|
947
|
+
ChevronRight,
|
|
791
948
|
{
|
|
792
|
-
|
|
793
|
-
"
|
|
794
|
-
children: /* @__PURE__ */ jsx9(MoreHorizontal, { size: 14 })
|
|
949
|
+
size: 14,
|
|
950
|
+
className: `transition-transform duration-300 ease-in-out ${isOpen ? "rotate-90" : ""}`
|
|
795
951
|
}
|
|
796
|
-
)
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
952
|
+
)
|
|
953
|
+
}
|
|
954
|
+
),
|
|
955
|
+
/* @__PURE__ */ jsx9(
|
|
956
|
+
FileText,
|
|
957
|
+
{
|
|
958
|
+
size: 16,
|
|
959
|
+
className: `flex-shrink-0 transition-all duration-200 ${hasSubtabs ? "" : "ml-5"} ${isActiveTab ? "opacity-100" : "opacity-60 group-hover:opacity-100"}`
|
|
960
|
+
}
|
|
961
|
+
),
|
|
962
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx9(
|
|
963
|
+
TabTitle,
|
|
964
|
+
{
|
|
965
|
+
isEditing,
|
|
966
|
+
title: tab.title,
|
|
967
|
+
tempTitle,
|
|
968
|
+
onTitleChange: handleTitleChange,
|
|
969
|
+
onStartEdit: handleEdit,
|
|
970
|
+
onCommit: handleCommit,
|
|
971
|
+
onCancel: handleCancel,
|
|
972
|
+
onSelect: handleSelect
|
|
973
|
+
}
|
|
974
|
+
) }),
|
|
975
|
+
/* @__PURE__ */ jsx9(
|
|
976
|
+
TabMenu,
|
|
977
|
+
{
|
|
978
|
+
canDelete: canDeleteTab,
|
|
979
|
+
onAddSubTab: handleAddSubTab,
|
|
980
|
+
onDelete: handleDelete
|
|
981
|
+
}
|
|
982
|
+
)
|
|
983
|
+
]
|
|
984
|
+
}
|
|
985
|
+
),
|
|
986
|
+
hasSubtabs && /* @__PURE__ */ jsx9(
|
|
987
|
+
"div",
|
|
988
|
+
{
|
|
989
|
+
className: `
|
|
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(
|
|
994
|
+
SubTabItem,
|
|
995
|
+
{
|
|
996
|
+
tab,
|
|
997
|
+
st,
|
|
998
|
+
activeSubTabId,
|
|
999
|
+
editingSubId,
|
|
1000
|
+
tempTitle,
|
|
1001
|
+
onSelect,
|
|
1002
|
+
startRenameSubTab,
|
|
1003
|
+
commitRenameSubTab,
|
|
1004
|
+
setEditingSubId,
|
|
1005
|
+
setTempTitle,
|
|
1006
|
+
onDeleteSubTab
|
|
1007
|
+
},
|
|
1008
|
+
st.id
|
|
1009
|
+
)) }) }) })
|
|
1010
|
+
}
|
|
1011
|
+
)
|
|
1012
|
+
] })
|
|
1013
|
+
},
|
|
1014
|
+
tab.id
|
|
1015
|
+
);
|
|
1016
|
+
},
|
|
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
|
+
}
|
|
1020
|
+
);
|
|
1021
|
+
var AppSidebar = memo(
|
|
1022
|
+
function AppSidebar2({
|
|
1023
|
+
tabs,
|
|
1024
|
+
activeTabId,
|
|
1025
|
+
activeSubTabId,
|
|
1026
|
+
canDeleteTab,
|
|
1027
|
+
onAddTab,
|
|
1028
|
+
onAddSubTab,
|
|
1029
|
+
onSelect,
|
|
1030
|
+
onRename,
|
|
1031
|
+
onDelete,
|
|
1032
|
+
onRenameSubTab,
|
|
1033
|
+
onDeleteSubTab
|
|
1034
|
+
}) {
|
|
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: [
|
|
1070
|
+
"Documents",
|
|
1071
|
+
/* @__PURE__ */ jsx9(
|
|
1072
|
+
"button",
|
|
1073
|
+
{
|
|
1074
|
+
onClick: onAddTab,
|
|
1075
|
+
className: "rounded p-1 transition-all duration-200 hover:bg-accent hover:scale-110",
|
|
1076
|
+
"aria-label": "Add new document",
|
|
1077
|
+
children: /* @__PURE__ */ jsx9(Plus, { size: 16 })
|
|
1078
|
+
}
|
|
1079
|
+
)
|
|
1080
|
+
] }),
|
|
1081
|
+
/* @__PURE__ */ jsx9(SidebarMenu, { children: /* @__PURE__ */ jsx9(AnimatePresence, { mode: "popLayout", children: tabs.map((tab) => /* @__PURE__ */ jsx9(
|
|
1082
|
+
TabItem,
|
|
1083
|
+
{
|
|
1084
|
+
tab,
|
|
1085
|
+
activeTabId,
|
|
1086
|
+
activeSubTabId,
|
|
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
|
|
915
1106
|
},
|
|
916
1107
|
tab.id
|
|
917
|
-
)
|
|
918
|
-
}) }) })
|
|
919
|
-
|
|
920
|
-
|
|
1108
|
+
)) }) })
|
|
1109
|
+
] }) }) });
|
|
1110
|
+
},
|
|
1111
|
+
(prevProps, nextProps) => {
|
|
1112
|
+
return JSON.stringify(prevProps.tabs) === JSON.stringify(nextProps.tabs) && prevProps.activeTabId === nextProps.activeTabId && prevProps.activeSubTabId === nextProps.activeSubTabId;
|
|
1113
|
+
}
|
|
1114
|
+
);
|
|
921
1115
|
|
|
922
1116
|
// src/contexts/EditorBridge.tsx
|
|
923
1117
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
@@ -939,38 +1133,55 @@ function useEditorBridge() {
|
|
|
939
1133
|
return ctx;
|
|
940
1134
|
}
|
|
941
1135
|
|
|
1136
|
+
// src/contexts/EditorStateProvider.tsx
|
|
1137
|
+
import { createContext as createContext3, useContext as useContext3 } from "react";
|
|
1138
|
+
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
1139
|
+
var EditorStateContext = createContext3(null);
|
|
1140
|
+
function EditorStateProvider({ children, value }) {
|
|
1141
|
+
return /* @__PURE__ */ jsx11(EditorStateContext.Provider, { value, children });
|
|
1142
|
+
}
|
|
1143
|
+
|
|
1144
|
+
// src/contexts/EditorActionsProvider.tsx
|
|
1145
|
+
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
1146
|
+
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
1147
|
+
var EditorActionsContext = createContext4(null);
|
|
1148
|
+
function EditorActionsProvider({ children, value }) {
|
|
1149
|
+
return /* @__PURE__ */ jsx12(EditorActionsContext.Provider, { value, children });
|
|
1150
|
+
}
|
|
1151
|
+
|
|
1152
|
+
// src/contexts/themeProvider.tsx
|
|
1153
|
+
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
1154
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
1155
|
+
function ThemeProvider({ children, ...props }) {
|
|
1156
|
+
return /* @__PURE__ */ jsx13(NextThemesProvider, { ...props, children });
|
|
1157
|
+
}
|
|
1158
|
+
|
|
942
1159
|
// src/components/editorLayout/editorLayout.tsx
|
|
943
|
-
import { jsx as
|
|
1160
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
944
1161
|
function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
945
1162
|
const [editor, setEditor] = useState4(null);
|
|
946
1163
|
const [tabs, setTabs] = useState4([]);
|
|
947
1164
|
const [activeTabId, setActiveTabId] = useState4("");
|
|
948
1165
|
const [activeSubTabId, setActiveSubTabId] = useState4(null);
|
|
949
|
-
const debouncedSaveRef =
|
|
950
|
-
const
|
|
951
|
-
const isRestoringRef =
|
|
952
|
-
const
|
|
953
|
-
|
|
1166
|
+
const debouncedSaveRef = useRef2(null);
|
|
1167
|
+
const onChangeDebounceRef = useRef2(null);
|
|
1168
|
+
const isRestoringRef = useRef2(false);
|
|
1169
|
+
const editorState = useMemo3(
|
|
1170
|
+
() => ({ tabs, activeTabId, activeSubTabId }),
|
|
1171
|
+
[tabs, activeTabId, activeSubTabId]
|
|
1172
|
+
);
|
|
1173
|
+
const emitChangeDebounced = useCallback3(
|
|
954
1174
|
(payload) => {
|
|
955
1175
|
if (!onChange) return;
|
|
956
|
-
if (onChangeDebounceRef.current)
|
|
957
|
-
|
|
958
|
-
}
|
|
959
|
-
onChangeDebounceRef.current = setTimeout(() => {
|
|
960
|
-
onChange(payload);
|
|
961
|
-
}, 100);
|
|
1176
|
+
if (onChangeDebounceRef.current) clearTimeout(onChangeDebounceRef.current);
|
|
1177
|
+
onChangeDebounceRef.current = setTimeout(() => onChange(payload), 100);
|
|
962
1178
|
},
|
|
963
1179
|
[onChange]
|
|
964
1180
|
);
|
|
965
|
-
const emitChange =
|
|
1181
|
+
const emitChange = useCallback3(
|
|
966
1182
|
(source) => {
|
|
967
1183
|
if (!onChange) return;
|
|
968
|
-
emitChangeDebounced({
|
|
969
|
-
tabs,
|
|
970
|
-
activeTabId,
|
|
971
|
-
activeSubTabId,
|
|
972
|
-
source
|
|
973
|
-
});
|
|
1184
|
+
emitChangeDebounced({ tabs, activeTabId, activeSubTabId, source });
|
|
974
1185
|
},
|
|
975
1186
|
[emitChangeDebounced, tabs, activeTabId, activeSubTabId]
|
|
976
1187
|
);
|
|
@@ -986,10 +1197,10 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
986
1197
|
useEffect2(() => {
|
|
987
1198
|
onTabsChange?.(tabs);
|
|
988
1199
|
}, [tabs, onTabsChange]);
|
|
989
|
-
const saveCurrentContent =
|
|
1200
|
+
const saveCurrentContent = useCallback3(() => {
|
|
990
1201
|
if (!editor) return tabs;
|
|
991
1202
|
const json = editor.getJSON();
|
|
992
|
-
|
|
1203
|
+
return tabs.map((tab) => {
|
|
993
1204
|
if (tab.id !== activeTabId) return tab;
|
|
994
1205
|
if (activeSubTabId) {
|
|
995
1206
|
return {
|
|
@@ -1001,9 +1212,8 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1001
1212
|
}
|
|
1002
1213
|
return { ...tab, content: json };
|
|
1003
1214
|
});
|
|
1004
|
-
return updatedTabs;
|
|
1005
1215
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1006
|
-
const saveFromEditor =
|
|
1216
|
+
const saveFromEditor = useCallback3(
|
|
1007
1217
|
(editorInstance, source = "editor") => {
|
|
1008
1218
|
const json = editorInstance.getJSON();
|
|
1009
1219
|
setTabs((prev) => {
|
|
@@ -1032,18 +1242,16 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1032
1242
|
},
|
|
1033
1243
|
[activeTabId, activeSubTabId, emitChangeDebounced]
|
|
1034
1244
|
);
|
|
1035
|
-
const debouncedSave =
|
|
1245
|
+
const debouncedSave = useCallback3(
|
|
1036
1246
|
(editorInstance) => {
|
|
1037
|
-
if (debouncedSaveRef.current)
|
|
1038
|
-
clearTimeout(debouncedSaveRef.current);
|
|
1039
|
-
}
|
|
1247
|
+
if (debouncedSaveRef.current) clearTimeout(debouncedSaveRef.current);
|
|
1040
1248
|
debouncedSaveRef.current = setTimeout(() => {
|
|
1041
1249
|
saveFromEditor(editorInstance, "editor");
|
|
1042
1250
|
}, 800);
|
|
1043
1251
|
},
|
|
1044
1252
|
[saveFromEditor]
|
|
1045
1253
|
);
|
|
1046
|
-
const addTab = () => {
|
|
1254
|
+
const addTab = useCallback3(() => {
|
|
1047
1255
|
if (debouncedSaveRef.current) {
|
|
1048
1256
|
clearTimeout(debouncedSaveRef.current);
|
|
1049
1257
|
debouncedSaveRef.current = null;
|
|
@@ -1057,125 +1265,137 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1057
1265
|
setTabs(newTabs);
|
|
1058
1266
|
setActiveTabId(id);
|
|
1059
1267
|
setActiveSubTabId(null);
|
|
1060
|
-
setTimeout(() =>
|
|
1061
|
-
editor?.commands.clearContent();
|
|
1062
|
-
}, 0);
|
|
1268
|
+
setTimeout(() => editor?.commands.clearContent(), 0);
|
|
1063
1269
|
emitChangeDebounced({
|
|
1064
1270
|
tabs: newTabs,
|
|
1065
1271
|
activeTabId: id,
|
|
1066
1272
|
activeSubTabId: null,
|
|
1067
1273
|
source: "add-tab"
|
|
1068
1274
|
});
|
|
1069
|
-
};
|
|
1070
|
-
const addSubTab = (
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
...tab,
|
|
1080
|
-
subtabs: [
|
|
1081
|
-
...tab.subtabs,
|
|
1082
|
-
{ id: subId, title: "New Subtab", content: null }
|
|
1083
|
-
]
|
|
1084
|
-
} : tab
|
|
1085
|
-
);
|
|
1086
|
-
setTabs(newTabs);
|
|
1087
|
-
setActiveTabId(tabId);
|
|
1088
|
-
setActiveSubTabId(subId);
|
|
1089
|
-
setTimeout(() => {
|
|
1090
|
-
editor?.commands.clearContent();
|
|
1091
|
-
}, 0);
|
|
1092
|
-
emitChangeDebounced({
|
|
1093
|
-
tabs: newTabs,
|
|
1094
|
-
activeTabId: tabId,
|
|
1095
|
-
activeSubTabId: subId,
|
|
1096
|
-
source: "add-subtab"
|
|
1097
|
-
});
|
|
1098
|
-
};
|
|
1099
|
-
const selectNode = (tabId, subId) => {
|
|
1100
|
-
if (debouncedSaveRef.current) {
|
|
1101
|
-
clearTimeout(debouncedSaveRef.current);
|
|
1102
|
-
debouncedSaveRef.current = null;
|
|
1103
|
-
}
|
|
1104
|
-
const updatedTabs = saveCurrentContent();
|
|
1105
|
-
setTabs(updatedTabs);
|
|
1106
|
-
setActiveTabId(tabId);
|
|
1107
|
-
setActiveSubTabId(subId ?? null);
|
|
1108
|
-
emitChangeDebounced({
|
|
1109
|
-
tabs: updatedTabs,
|
|
1110
|
-
activeTabId: tabId,
|
|
1111
|
-
activeSubTabId: subId ?? null,
|
|
1112
|
-
source: "tab-switch"
|
|
1113
|
-
});
|
|
1114
|
-
};
|
|
1115
|
-
const renameTab = (id, title) => {
|
|
1116
|
-
setTabs((prev) => prev.map((t) => t.id === id ? { ...t, title } : t));
|
|
1117
|
-
};
|
|
1118
|
-
const deleteSubTab = (tabId, subTabId) => {
|
|
1119
|
-
console.log("\u{1F5D1}\uFE0F Deleting subtab:", subTabId);
|
|
1120
|
-
setTabs(
|
|
1121
|
-
(prev) => prev.map((tab) => {
|
|
1122
|
-
if (tab.id !== tabId) return tab;
|
|
1123
|
-
const remainingSubTabs = tab.subtabs.filter((st) => st.id !== subTabId);
|
|
1124
|
-
if (subTabId === activeSubTabId) {
|
|
1125
|
-
setActiveSubTabId(null);
|
|
1126
|
-
setTimeout(() => {
|
|
1127
|
-
editor?.commands.clearContent();
|
|
1128
|
-
}, 0);
|
|
1129
|
-
}
|
|
1130
|
-
return {
|
|
1131
|
-
...tab,
|
|
1132
|
-
subtabs: remainingSubTabs
|
|
1133
|
-
};
|
|
1134
|
-
})
|
|
1135
|
-
);
|
|
1136
|
-
emitChange("delete-subtab");
|
|
1137
|
-
};
|
|
1138
|
-
const renameSubTab = (tabId, subTabId, title) => {
|
|
1139
|
-
setTabs(
|
|
1140
|
-
(prev) => prev.map(
|
|
1275
|
+
}, [saveCurrentContent, editor, emitChangeDebounced]);
|
|
1276
|
+
const addSubTab = useCallback3(
|
|
1277
|
+
(tabId) => {
|
|
1278
|
+
if (debouncedSaveRef.current) {
|
|
1279
|
+
clearTimeout(debouncedSaveRef.current);
|
|
1280
|
+
debouncedSaveRef.current = null;
|
|
1281
|
+
}
|
|
1282
|
+
const updatedTabs = saveCurrentContent();
|
|
1283
|
+
const subId = Date.now().toString();
|
|
1284
|
+
const newTabs = updatedTabs.map(
|
|
1141
1285
|
(tab) => tab.id === tabId ? {
|
|
1142
1286
|
...tab,
|
|
1143
|
-
subtabs: tab.subtabs
|
|
1144
|
-
(st) => st.id === subTabId ? { ...st, title } : st
|
|
1145
|
-
)
|
|
1287
|
+
subtabs: [...tab.subtabs, { id: subId, title: "New Subtab", content: null }]
|
|
1146
1288
|
} : tab
|
|
1147
|
-
)
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
}, 0);
|
|
1167
|
-
}
|
|
1289
|
+
);
|
|
1290
|
+
setTabs(newTabs);
|
|
1291
|
+
setActiveTabId(tabId);
|
|
1292
|
+
setActiveSubTabId(subId);
|
|
1293
|
+
setTimeout(() => editor?.commands.clearContent(), 0);
|
|
1294
|
+
emitChangeDebounced({
|
|
1295
|
+
tabs: newTabs,
|
|
1296
|
+
activeTabId: tabId,
|
|
1297
|
+
activeSubTabId: subId,
|
|
1298
|
+
source: "add-subtab"
|
|
1299
|
+
});
|
|
1300
|
+
},
|
|
1301
|
+
[saveCurrentContent, editor, emitChangeDebounced]
|
|
1302
|
+
);
|
|
1303
|
+
const selectNode = useCallback3(
|
|
1304
|
+
(tabId, subId) => {
|
|
1305
|
+
if (debouncedSaveRef.current) {
|
|
1306
|
+
clearTimeout(debouncedSaveRef.current);
|
|
1307
|
+
debouncedSaveRef.current = null;
|
|
1168
1308
|
}
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1309
|
+
const updatedTabs = saveCurrentContent();
|
|
1310
|
+
setTabs(updatedTabs);
|
|
1311
|
+
setActiveTabId(tabId);
|
|
1312
|
+
setActiveSubTabId(subId ?? null);
|
|
1313
|
+
emitChangeDebounced({
|
|
1314
|
+
tabs: updatedTabs,
|
|
1315
|
+
activeTabId: tabId,
|
|
1316
|
+
activeSubTabId: subId ?? null,
|
|
1317
|
+
source: "tab-switch"
|
|
1318
|
+
});
|
|
1319
|
+
},
|
|
1320
|
+
[saveCurrentContent, emitChangeDebounced]
|
|
1321
|
+
);
|
|
1322
|
+
const renameTab = useCallback3(
|
|
1323
|
+
(id, title) => {
|
|
1324
|
+
setTabs((prev) => prev.map((t) => t.id === id ? { ...t, title } : t));
|
|
1325
|
+
},
|
|
1326
|
+
[]
|
|
1327
|
+
);
|
|
1328
|
+
const deleteTab = useCallback3(
|
|
1329
|
+
(id) => {
|
|
1330
|
+
if (debouncedSaveRef.current) {
|
|
1331
|
+
clearTimeout(debouncedSaveRef.current);
|
|
1332
|
+
debouncedSaveRef.current = null;
|
|
1333
|
+
}
|
|
1334
|
+
const updatedTabs = id === activeTabId ? tabs : saveCurrentContent();
|
|
1335
|
+
setTabs((prev) => {
|
|
1336
|
+
const remaining = (id === activeTabId ? prev : updatedTabs).filter((t) => t.id !== id);
|
|
1337
|
+
if (id === activeTabId) {
|
|
1338
|
+
const next = remaining[0];
|
|
1339
|
+
setActiveTabId(next?.id ?? "");
|
|
1340
|
+
setActiveSubTabId(null);
|
|
1341
|
+
if (!next) {
|
|
1342
|
+
setTimeout(() => editor?.commands.clearContent(), 0);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
return remaining;
|
|
1346
|
+
});
|
|
1347
|
+
emitChange("delete-tab");
|
|
1348
|
+
},
|
|
1349
|
+
[activeTabId, tabs, saveCurrentContent, editor, emitChange]
|
|
1350
|
+
);
|
|
1351
|
+
const deleteSubTab = useCallback3(
|
|
1352
|
+
(tabId, subTabId) => {
|
|
1353
|
+
setTabs(
|
|
1354
|
+
(prev) => prev.map((tab) => {
|
|
1355
|
+
if (tab.id !== tabId) return tab;
|
|
1356
|
+
const remainingSubTabs = tab.subtabs.filter((st) => st.id !== subTabId);
|
|
1357
|
+
if (subTabId === activeSubTabId) {
|
|
1358
|
+
setActiveSubTabId(null);
|
|
1359
|
+
setTimeout(() => editor?.commands.clearContent(), 0);
|
|
1360
|
+
}
|
|
1361
|
+
return { ...tab, subtabs: remainingSubTabs };
|
|
1362
|
+
})
|
|
1363
|
+
);
|
|
1364
|
+
emitChange("delete-subtab");
|
|
1365
|
+
},
|
|
1366
|
+
[activeSubTabId, editor, emitChange]
|
|
1367
|
+
);
|
|
1368
|
+
const renameSubTab = useCallback3(
|
|
1369
|
+
(tabId, subTabId, title) => {
|
|
1370
|
+
setTabs(
|
|
1371
|
+
(prev) => prev.map(
|
|
1372
|
+
(tab) => tab.id === tabId ? {
|
|
1373
|
+
...tab,
|
|
1374
|
+
subtabs: tab.subtabs.map(
|
|
1375
|
+
(st) => st.id === subTabId ? { ...st, title } : st
|
|
1376
|
+
)
|
|
1377
|
+
} : tab
|
|
1378
|
+
)
|
|
1379
|
+
);
|
|
1380
|
+
},
|
|
1381
|
+
[]
|
|
1382
|
+
);
|
|
1383
|
+
const editorActions = useMemo3(
|
|
1384
|
+
() => ({
|
|
1385
|
+
addTab,
|
|
1386
|
+
addSubTab,
|
|
1387
|
+
selectNode,
|
|
1388
|
+
renameTab,
|
|
1389
|
+
deleteTab,
|
|
1390
|
+
deleteSubTab,
|
|
1391
|
+
renameSubTab,
|
|
1392
|
+
debouncedSave
|
|
1393
|
+
}),
|
|
1394
|
+
[addTab, addSubTab, selectNode, renameTab, deleteTab, deleteSubTab, renameSubTab, debouncedSave]
|
|
1395
|
+
);
|
|
1173
1396
|
useEffect2(() => {
|
|
1174
1397
|
if (!editor) return;
|
|
1175
1398
|
const key = { tabId: activeTabId, subTabId: activeSubTabId };
|
|
1176
|
-
if (lastRestoredRef.current && lastRestoredRef.current.tabId === key.tabId && lastRestoredRef.current.subTabId === key.subTabId) {
|
|
1177
|
-
return;
|
|
1178
|
-
}
|
|
1179
1399
|
if (isRestoringRef.current) return;
|
|
1180
1400
|
isRestoringRef.current = true;
|
|
1181
1401
|
const tab = tabs.find((t) => t.id === activeTabId);
|
|
@@ -1185,15 +1405,10 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1185
1405
|
} else {
|
|
1186
1406
|
editor.commands.clearContent();
|
|
1187
1407
|
}
|
|
1188
|
-
lastRestoredRef.current = key;
|
|
1189
1408
|
isRestoringRef.current = false;
|
|
1190
1409
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1191
|
-
return /* @__PURE__ */
|
|
1192
|
-
|
|
1193
|
-
setEditorContent: setEditor,
|
|
1194
|
-
debouncedSave
|
|
1195
|
-
}, children: /* @__PURE__ */ jsx11(SidebarProvider, { children: /* @__PURE__ */ jsxs6("div", { className: "flex h-full w-full min-h-0 relative", children: [
|
|
1196
|
-
/* @__PURE__ */ jsx11(
|
|
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(
|
|
1197
1412
|
AppSidebar,
|
|
1198
1413
|
{
|
|
1199
1414
|
tabs,
|
|
@@ -1210,14 +1425,14 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1210
1425
|
}
|
|
1211
1426
|
),
|
|
1212
1427
|
/* @__PURE__ */ jsxs6(SidebarInset, { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
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 })
|
|
1215
1430
|
] })
|
|
1216
|
-
] }) }) });
|
|
1431
|
+
] }) }) }) }) }) });
|
|
1217
1432
|
}
|
|
1218
1433
|
|
|
1219
1434
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
1220
|
-
import { useEffect as useEffect23, useRef as
|
|
1435
|
+
import { useEffect as useEffect23, useRef as useRef8, useState as useState30 } from "react";
|
|
1221
1436
|
import { EditorContent, EditorContext, useEditor } from "@tiptap/react";
|
|
1222
1437
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
1223
1438
|
import Image from "@tiptap/extension-image";
|
|
@@ -1400,16 +1615,16 @@ var FontSizeStepper = Extension.create({
|
|
|
1400
1615
|
});
|
|
1401
1616
|
|
|
1402
1617
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1403
|
-
import { forwardRef as forwardRef2, Fragment, useMemo as
|
|
1618
|
+
import { forwardRef as forwardRef2, Fragment, useMemo as useMemo5 } from "react";
|
|
1404
1619
|
|
|
1405
1620
|
// src/components/tiptap-ui-primitive/tooltip/tooltip.tsx
|
|
1406
1621
|
import {
|
|
1407
1622
|
cloneElement,
|
|
1408
|
-
createContext as
|
|
1623
|
+
createContext as createContext5,
|
|
1409
1624
|
forwardRef,
|
|
1410
1625
|
isValidElement,
|
|
1411
|
-
useContext as
|
|
1412
|
-
useMemo as
|
|
1626
|
+
useContext as useContext5,
|
|
1627
|
+
useMemo as useMemo4,
|
|
1413
1628
|
useState as useState5,
|
|
1414
1629
|
version
|
|
1415
1630
|
} from "react";
|
|
@@ -1428,7 +1643,7 @@ import {
|
|
|
1428
1643
|
FloatingPortal,
|
|
1429
1644
|
FloatingDelayGroup
|
|
1430
1645
|
} from "@floating-ui/react";
|
|
1431
|
-
import { jsx as
|
|
1646
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1432
1647
|
function useTooltip({
|
|
1433
1648
|
initialOpen = false,
|
|
1434
1649
|
placement = "top",
|
|
@@ -1471,7 +1686,7 @@ function useTooltip({
|
|
|
1471
1686
|
const dismiss = useDismiss(context);
|
|
1472
1687
|
const role = useRole(context, { role: "tooltip" });
|
|
1473
1688
|
const interactions = useInteractions([hover, focus, dismiss, role]);
|
|
1474
|
-
return
|
|
1689
|
+
return useMemo4(
|
|
1475
1690
|
() => ({
|
|
1476
1691
|
open,
|
|
1477
1692
|
setOpen,
|
|
@@ -1481,9 +1696,9 @@ function useTooltip({
|
|
|
1481
1696
|
[open, setOpen, interactions, data]
|
|
1482
1697
|
);
|
|
1483
1698
|
}
|
|
1484
|
-
var TooltipContext =
|
|
1699
|
+
var TooltipContext = createContext5(null);
|
|
1485
1700
|
function useTooltipContext() {
|
|
1486
|
-
const context =
|
|
1701
|
+
const context = useContext5(TooltipContext);
|
|
1487
1702
|
if (context == null) {
|
|
1488
1703
|
throw new Error("Tooltip components must be wrapped in <TooltipProvider />");
|
|
1489
1704
|
}
|
|
@@ -1492,14 +1707,14 @@ function useTooltipContext() {
|
|
|
1492
1707
|
function Tooltip2({ children, ...props }) {
|
|
1493
1708
|
const tooltip = useTooltip(props);
|
|
1494
1709
|
if (!props.useDelayGroup) {
|
|
1495
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ jsx15(TooltipContext.Provider, { value: tooltip, children });
|
|
1496
1711
|
}
|
|
1497
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ jsx15(
|
|
1498
1713
|
FloatingDelayGroup,
|
|
1499
1714
|
{
|
|
1500
1715
|
delay: { open: props.delay ?? 0, close: props.closeDelay ?? 0 },
|
|
1501
1716
|
timeoutMs: props.timeout,
|
|
1502
|
-
children: /* @__PURE__ */
|
|
1717
|
+
children: /* @__PURE__ */ jsx15(TooltipContext.Provider, { value: tooltip, children })
|
|
1503
1718
|
}
|
|
1504
1719
|
);
|
|
1505
1720
|
}
|
|
@@ -1528,7 +1743,7 @@ var TooltipTrigger2 = forwardRef(
|
|
|
1528
1743
|
})
|
|
1529
1744
|
);
|
|
1530
1745
|
}
|
|
1531
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsx15(
|
|
1532
1747
|
"button",
|
|
1533
1748
|
{
|
|
1534
1749
|
ref,
|
|
@@ -1544,7 +1759,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1544
1759
|
const context = useTooltipContext();
|
|
1545
1760
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
1546
1761
|
if (!context.open) return null;
|
|
1547
|
-
const content = /* @__PURE__ */
|
|
1762
|
+
const content = /* @__PURE__ */ jsx15(
|
|
1548
1763
|
"div",
|
|
1549
1764
|
{
|
|
1550
1765
|
ref,
|
|
@@ -1558,7 +1773,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1558
1773
|
}
|
|
1559
1774
|
);
|
|
1560
1775
|
if (portal) {
|
|
1561
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsx15(FloatingPortal, { ...portalProps, children: content });
|
|
1562
1777
|
}
|
|
1563
1778
|
return content;
|
|
1564
1779
|
}
|
|
@@ -1875,14 +2090,14 @@ var FontSizeExtension = Extension2.create({
|
|
|
1875
2090
|
});
|
|
1876
2091
|
|
|
1877
2092
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1878
|
-
import { jsx as
|
|
2093
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1879
2094
|
var ShortcutDisplay = ({
|
|
1880
2095
|
shortcuts
|
|
1881
2096
|
}) => {
|
|
1882
2097
|
if (shortcuts.length === 0) return null;
|
|
1883
|
-
return /* @__PURE__ */
|
|
1884
|
-
index > 0 && /* @__PURE__ */
|
|
1885
|
-
/* @__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 })
|
|
1886
2101
|
] }, index)) });
|
|
1887
2102
|
};
|
|
1888
2103
|
var Button2 = forwardRef2(
|
|
@@ -1895,12 +2110,12 @@ var Button2 = forwardRef2(
|
|
|
1895
2110
|
"aria-label": ariaLabel,
|
|
1896
2111
|
...props
|
|
1897
2112
|
}, ref) => {
|
|
1898
|
-
const shortcuts =
|
|
2113
|
+
const shortcuts = useMemo5(
|
|
1899
2114
|
() => parseShortcutKeys({ shortcutKeys }),
|
|
1900
2115
|
[shortcutKeys]
|
|
1901
2116
|
);
|
|
1902
2117
|
if (!tooltip || !showTooltip) {
|
|
1903
|
-
return /* @__PURE__ */
|
|
2118
|
+
return /* @__PURE__ */ jsx16(
|
|
1904
2119
|
"button",
|
|
1905
2120
|
{
|
|
1906
2121
|
className: cn2("tiptap-button", className),
|
|
@@ -1912,7 +2127,7 @@ var Button2 = forwardRef2(
|
|
|
1912
2127
|
);
|
|
1913
2128
|
}
|
|
1914
2129
|
return /* @__PURE__ */ jsxs7(Tooltip2, { delay: 200, children: [
|
|
1915
|
-
/* @__PURE__ */
|
|
2130
|
+
/* @__PURE__ */ jsx16(
|
|
1916
2131
|
TooltipTrigger2,
|
|
1917
2132
|
{
|
|
1918
2133
|
className: cn2("tiptap-button", className),
|
|
@@ -1924,14 +2139,14 @@ var Button2 = forwardRef2(
|
|
|
1924
2139
|
),
|
|
1925
2140
|
/* @__PURE__ */ jsxs7(TooltipContent2, { children: [
|
|
1926
2141
|
tooltip,
|
|
1927
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx16(ShortcutDisplay, { shortcuts })
|
|
1928
2143
|
] })
|
|
1929
2144
|
] });
|
|
1930
2145
|
}
|
|
1931
2146
|
);
|
|
1932
2147
|
Button2.displayName = "Button";
|
|
1933
2148
|
var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical", ...props }, ref) => {
|
|
1934
|
-
return /* @__PURE__ */
|
|
2149
|
+
return /* @__PURE__ */ jsx16(
|
|
1935
2150
|
"div",
|
|
1936
2151
|
{
|
|
1937
2152
|
ref,
|
|
@@ -1946,7 +2161,7 @@ var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical",
|
|
|
1946
2161
|
ButtonGroup.displayName = "ButtonGroup";
|
|
1947
2162
|
|
|
1948
2163
|
// src/components/tiptap-ui-primitive/spacer/spacer.tsx
|
|
1949
|
-
import { jsx as
|
|
2164
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1950
2165
|
function Spacer({
|
|
1951
2166
|
orientation = "horizontal",
|
|
1952
2167
|
size,
|
|
@@ -1961,20 +2176,20 @@ function Spacer({
|
|
|
1961
2176
|
height: orientation === "horizontal" ? "1px" : size
|
|
1962
2177
|
}
|
|
1963
2178
|
};
|
|
1964
|
-
return /* @__PURE__ */
|
|
2179
|
+
return /* @__PURE__ */ jsx17("div", { ...props, style: computedStyle });
|
|
1965
2180
|
}
|
|
1966
2181
|
|
|
1967
2182
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
1968
|
-
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";
|
|
1969
2184
|
|
|
1970
2185
|
// src/components/tiptap-ui-primitive/separator/separator.tsx
|
|
1971
2186
|
import { forwardRef as forwardRef3 } from "react";
|
|
1972
|
-
import { jsx as
|
|
2187
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1973
2188
|
var Separator3 = forwardRef3(
|
|
1974
2189
|
({ decorative, orientation = "vertical", className, ...divProps }, ref) => {
|
|
1975
2190
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
1976
2191
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
1977
|
-
return /* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsx18(
|
|
1978
2193
|
"div",
|
|
1979
2194
|
{
|
|
1980
2195
|
className: cn2("tiptap-separator", className),
|
|
@@ -2113,7 +2328,7 @@ function useMenuNavigation({
|
|
|
2113
2328
|
}
|
|
2114
2329
|
|
|
2115
2330
|
// src/hooks/use-composed-ref.ts
|
|
2116
|
-
import { useCallback as
|
|
2331
|
+
import { useCallback as useCallback4, useRef as useRef3 } from "react";
|
|
2117
2332
|
var updateRef = (ref, value) => {
|
|
2118
2333
|
if (typeof ref === "function") {
|
|
2119
2334
|
ref(value);
|
|
@@ -2123,8 +2338,8 @@ var updateRef = (ref, value) => {
|
|
|
2123
2338
|
}
|
|
2124
2339
|
};
|
|
2125
2340
|
var useComposedRef = (libRef, userRef) => {
|
|
2126
|
-
const prevUserRef =
|
|
2127
|
-
return
|
|
2341
|
+
const prevUserRef = useRef3(null);
|
|
2342
|
+
return useCallback4(
|
|
2128
2343
|
(instance) => {
|
|
2129
2344
|
if (libRef && "current" in libRef) {
|
|
2130
2345
|
;
|
|
@@ -2143,10 +2358,10 @@ var useComposedRef = (libRef, userRef) => {
|
|
|
2143
2358
|
};
|
|
2144
2359
|
|
|
2145
2360
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2146
|
-
import { jsx as
|
|
2361
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2147
2362
|
var useToolbarNavigation = (toolbarRef) => {
|
|
2148
2363
|
const [items, setItems] = useState7([]);
|
|
2149
|
-
const collectItems =
|
|
2364
|
+
const collectItems = useCallback5(() => {
|
|
2150
2365
|
if (!toolbarRef.current) return [];
|
|
2151
2366
|
return Array.from(
|
|
2152
2367
|
toolbarRef.current.querySelectorAll(
|
|
@@ -2197,10 +2412,10 @@ var useToolbarNavigation = (toolbarRef) => {
|
|
|
2197
2412
|
};
|
|
2198
2413
|
var Toolbar = forwardRef4(
|
|
2199
2414
|
({ children, className, variant = "fixed", ...props }, ref) => {
|
|
2200
|
-
const toolbarRef =
|
|
2415
|
+
const toolbarRef = useRef4(null);
|
|
2201
2416
|
const composedRef = useComposedRef(toolbarRef, ref);
|
|
2202
2417
|
useToolbarNavigation(toolbarRef);
|
|
2203
|
-
return /* @__PURE__ */
|
|
2418
|
+
return /* @__PURE__ */ jsx19(
|
|
2204
2419
|
"div",
|
|
2205
2420
|
{
|
|
2206
2421
|
ref: composedRef,
|
|
@@ -2216,7 +2431,7 @@ var Toolbar = forwardRef4(
|
|
|
2216
2431
|
);
|
|
2217
2432
|
Toolbar.displayName = "Toolbar";
|
|
2218
2433
|
var ToolbarGroup = forwardRef4(
|
|
2219
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2434
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
2220
2435
|
"div",
|
|
2221
2436
|
{
|
|
2222
2437
|
ref,
|
|
@@ -2229,7 +2444,7 @@ var ToolbarGroup = forwardRef4(
|
|
|
2229
2444
|
);
|
|
2230
2445
|
ToolbarGroup.displayName = "ToolbarGroup";
|
|
2231
2446
|
var ToolbarSeparator = forwardRef4(
|
|
2232
|
-
({ ...props }, ref) => /* @__PURE__ */
|
|
2447
|
+
({ ...props }, ref) => /* @__PURE__ */ jsx19(Separator3, { ref, orientation: "vertical", decorative: true, ...props })
|
|
2233
2448
|
);
|
|
2234
2449
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
2235
2450
|
|
|
@@ -2245,11 +2460,11 @@ import {
|
|
|
2245
2460
|
Heading3,
|
|
2246
2461
|
Code
|
|
2247
2462
|
} from "lucide-react";
|
|
2248
|
-
import { jsx as
|
|
2463
|
+
import { jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2249
2464
|
function BubbleMenuInline() {
|
|
2250
2465
|
const { editor } = useCurrentEditor();
|
|
2251
2466
|
if (!editor) return null;
|
|
2252
|
-
return /* @__PURE__ */
|
|
2467
|
+
return /* @__PURE__ */ jsx20(
|
|
2253
2468
|
BubbleMenu,
|
|
2254
2469
|
{
|
|
2255
2470
|
editor,
|
|
@@ -2273,76 +2488,76 @@ function BubbleMenuInline() {
|
|
|
2273
2488
|
{
|
|
2274
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",
|
|
2275
2490
|
children: [
|
|
2276
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx20(
|
|
2277
2492
|
Button,
|
|
2278
2493
|
{
|
|
2279
2494
|
variant: "ghost",
|
|
2280
2495
|
size: "sm",
|
|
2281
2496
|
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
2282
2497
|
className: editor.isActive("heading", { level: 1 }) ? "bg-accent" : "",
|
|
2283
|
-
children: /* @__PURE__ */
|
|
2498
|
+
children: /* @__PURE__ */ jsx20(Heading1, { size: 15 })
|
|
2284
2499
|
}
|
|
2285
2500
|
),
|
|
2286
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ jsx20(
|
|
2287
2502
|
Button,
|
|
2288
2503
|
{
|
|
2289
2504
|
variant: "ghost",
|
|
2290
2505
|
size: "sm",
|
|
2291
2506
|
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
2292
2507
|
className: editor.isActive("heading", { level: 2 }) ? "bg-accent" : "",
|
|
2293
|
-
children: /* @__PURE__ */
|
|
2508
|
+
children: /* @__PURE__ */ jsx20(Heading2, { size: 15 })
|
|
2294
2509
|
}
|
|
2295
2510
|
),
|
|
2296
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx20(
|
|
2297
2512
|
Button,
|
|
2298
2513
|
{
|
|
2299
2514
|
variant: "ghost",
|
|
2300
2515
|
size: "sm",
|
|
2301
2516
|
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
2302
2517
|
className: editor.isActive("heading", { level: 3 }) ? "bg-accent" : "",
|
|
2303
|
-
children: /* @__PURE__ */
|
|
2518
|
+
children: /* @__PURE__ */ jsx20(Heading3, { size: 15 })
|
|
2304
2519
|
}
|
|
2305
2520
|
),
|
|
2306
|
-
/* @__PURE__ */
|
|
2307
|
-
/* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsx20(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2522
|
+
/* @__PURE__ */ jsx20(
|
|
2308
2523
|
Button,
|
|
2309
2524
|
{
|
|
2310
2525
|
variant: "ghost",
|
|
2311
2526
|
size: "sm",
|
|
2312
2527
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
2313
2528
|
className: editor.isActive("bulletList") ? "bg-accent" : "",
|
|
2314
|
-
children: /* @__PURE__ */
|
|
2529
|
+
children: /* @__PURE__ */ jsx20(List, { size: 15 })
|
|
2315
2530
|
}
|
|
2316
2531
|
),
|
|
2317
|
-
/* @__PURE__ */
|
|
2532
|
+
/* @__PURE__ */ jsx20(
|
|
2318
2533
|
Button,
|
|
2319
2534
|
{
|
|
2320
2535
|
variant: "ghost",
|
|
2321
2536
|
size: "sm",
|
|
2322
2537
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
2323
2538
|
className: editor.isActive("orderedList") ? "bg-accent" : "",
|
|
2324
|
-
children: /* @__PURE__ */
|
|
2539
|
+
children: /* @__PURE__ */ jsx20(ListOrdered, { size: 15 })
|
|
2325
2540
|
}
|
|
2326
2541
|
),
|
|
2327
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ jsx20(
|
|
2328
2543
|
Button,
|
|
2329
2544
|
{
|
|
2330
2545
|
variant: "ghost",
|
|
2331
2546
|
size: "sm",
|
|
2332
2547
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
2333
2548
|
className: editor.isActive("taskList") ? "bg-accent" : "",
|
|
2334
|
-
children: /* @__PURE__ */
|
|
2549
|
+
children: /* @__PURE__ */ jsx20(CheckSquare, { size: 15 })
|
|
2335
2550
|
}
|
|
2336
2551
|
),
|
|
2337
|
-
/* @__PURE__ */
|
|
2338
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ jsx20(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2553
|
+
/* @__PURE__ */ jsx20(
|
|
2339
2554
|
Button,
|
|
2340
2555
|
{
|
|
2341
2556
|
variant: "ghost",
|
|
2342
2557
|
size: "sm",
|
|
2343
2558
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
2344
2559
|
className: editor.isActive("codeBlock") ? "bg-accent" : "",
|
|
2345
|
-
children: /* @__PURE__ */
|
|
2560
|
+
children: /* @__PURE__ */ jsx20(Code, { size: 15 })
|
|
2346
2561
|
}
|
|
2347
2562
|
)
|
|
2348
2563
|
]
|
|
@@ -2357,14 +2572,14 @@ import { mergeAttributes as mergeAttributes2, Node as Node4 } from "@tiptap/reac
|
|
|
2357
2572
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
2358
2573
|
|
|
2359
2574
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2360
|
-
import { useRef as
|
|
2575
|
+
import { useRef as useRef5, useState as useState8 } from "react";
|
|
2361
2576
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
2362
2577
|
|
|
2363
2578
|
// src/components/tiptap-icons/close-icon.tsx
|
|
2364
|
-
import { memo } from "react";
|
|
2365
|
-
import { jsx as
|
|
2366
|
-
var CloseIcon =
|
|
2367
|
-
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(
|
|
2368
2583
|
"svg",
|
|
2369
2584
|
{
|
|
2370
2585
|
width: "24",
|
|
@@ -2374,7 +2589,7 @@ var CloseIcon = memo(({ className, ...props }) => {
|
|
|
2374
2589
|
fill: "currentColor",
|
|
2375
2590
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2376
2591
|
...props,
|
|
2377
|
-
children: /* @__PURE__ */
|
|
2592
|
+
children: /* @__PURE__ */ jsx21(
|
|
2378
2593
|
"path",
|
|
2379
2594
|
{
|
|
2380
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",
|
|
@@ -2387,7 +2602,7 @@ var CloseIcon = memo(({ className, ...props }) => {
|
|
|
2387
2602
|
CloseIcon.displayName = "CloseIcon";
|
|
2388
2603
|
|
|
2389
2604
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2390
|
-
import { Fragment as Fragment2, jsx as
|
|
2605
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2391
2606
|
function useFileUpload(options) {
|
|
2392
2607
|
const [fileItems, setFileItems] = useState8([]);
|
|
2393
2608
|
const uploadFile = async (file) => {
|
|
@@ -2505,14 +2720,14 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs9(
|
|
|
2505
2720
|
fill: "currentColor",
|
|
2506
2721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2507
2722
|
children: [
|
|
2508
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ jsx22(
|
|
2509
2724
|
"path",
|
|
2510
2725
|
{
|
|
2511
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",
|
|
2512
2727
|
fill: "currentColor"
|
|
2513
2728
|
}
|
|
2514
2729
|
),
|
|
2515
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ jsx22(
|
|
2516
2731
|
"path",
|
|
2517
2732
|
{
|
|
2518
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",
|
|
@@ -2522,7 +2737,7 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs9(
|
|
|
2522
2737
|
]
|
|
2523
2738
|
}
|
|
2524
2739
|
);
|
|
2525
|
-
var FileIcon = () => /* @__PURE__ */
|
|
2740
|
+
var FileIcon = () => /* @__PURE__ */ jsx22(
|
|
2526
2741
|
"svg",
|
|
2527
2742
|
{
|
|
2528
2743
|
width: "43",
|
|
@@ -2531,7 +2746,7 @@ var FileIcon = () => /* @__PURE__ */ jsx19(
|
|
|
2531
2746
|
fill: "currentColor",
|
|
2532
2747
|
className: "tiptap-image-upload-dropzone-rect-primary",
|
|
2533
2748
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2534
|
-
children: /* @__PURE__ */
|
|
2749
|
+
children: /* @__PURE__ */ jsx22(
|
|
2535
2750
|
"path",
|
|
2536
2751
|
{
|
|
2537
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",
|
|
@@ -2543,7 +2758,7 @@ var FileIcon = () => /* @__PURE__ */ jsx19(
|
|
|
2543
2758
|
)
|
|
2544
2759
|
}
|
|
2545
2760
|
);
|
|
2546
|
-
var FileCornerIcon = () => /* @__PURE__ */
|
|
2761
|
+
var FileCornerIcon = () => /* @__PURE__ */ jsx22(
|
|
2547
2762
|
"svg",
|
|
2548
2763
|
{
|
|
2549
2764
|
width: "10",
|
|
@@ -2552,7 +2767,7 @@ var FileCornerIcon = () => /* @__PURE__ */ jsx19(
|
|
|
2552
2767
|
viewBox: "0 0 10 10",
|
|
2553
2768
|
fill: "currentColor",
|
|
2554
2769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2555
|
-
children: /* @__PURE__ */
|
|
2770
|
+
children: /* @__PURE__ */ jsx22(
|
|
2556
2771
|
"path",
|
|
2557
2772
|
{
|
|
2558
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",
|
|
@@ -2595,7 +2810,7 @@ var ImageUploadDragArea = ({
|
|
|
2595
2810
|
onFile(files);
|
|
2596
2811
|
}
|
|
2597
2812
|
};
|
|
2598
|
-
return /* @__PURE__ */
|
|
2813
|
+
return /* @__PURE__ */ jsx22(
|
|
2599
2814
|
"div",
|
|
2600
2815
|
{
|
|
2601
2816
|
className: `tiptap-image-upload-drag-area ${isDragActive ? "drag-active" : ""} ${isDragOver ? "drag-over" : ""}`,
|
|
@@ -2619,7 +2834,7 @@ var ImageUploadPreview = ({
|
|
|
2619
2834
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
2620
2835
|
};
|
|
2621
2836
|
return /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-preview", children: [
|
|
2622
|
-
fileItem.status === "uploading" && /* @__PURE__ */
|
|
2837
|
+
fileItem.status === "uploading" && /* @__PURE__ */ jsx22(
|
|
2623
2838
|
"div",
|
|
2624
2839
|
{
|
|
2625
2840
|
className: "tiptap-image-upload-progress",
|
|
@@ -2628,10 +2843,10 @@ var ImageUploadPreview = ({
|
|
|
2628
2843
|
),
|
|
2629
2844
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-preview-content", children: [
|
|
2630
2845
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-file-info", children: [
|
|
2631
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsx22("div", { className: "tiptap-image-upload-file-icon", children: /* @__PURE__ */ jsx22(CloudUploadIcon, {}) }),
|
|
2632
2847
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-details", children: [
|
|
2633
|
-
/* @__PURE__ */
|
|
2634
|
-
/* @__PURE__ */
|
|
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) })
|
|
2635
2850
|
] })
|
|
2636
2851
|
] }),
|
|
2637
2852
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-actions", children: [
|
|
@@ -2639,7 +2854,7 @@ var ImageUploadPreview = ({
|
|
|
2639
2854
|
fileItem.progress,
|
|
2640
2855
|
"%"
|
|
2641
2856
|
] }),
|
|
2642
|
-
/* @__PURE__ */
|
|
2857
|
+
/* @__PURE__ */ jsx22(
|
|
2643
2858
|
Button2,
|
|
2644
2859
|
{
|
|
2645
2860
|
type: "button",
|
|
@@ -2648,7 +2863,7 @@ var ImageUploadPreview = ({
|
|
|
2648
2863
|
e.stopPropagation();
|
|
2649
2864
|
onRemove();
|
|
2650
2865
|
},
|
|
2651
|
-
children: /* @__PURE__ */
|
|
2866
|
+
children: /* @__PURE__ */ jsx22(CloseIcon, { className: "tiptap-button-icon" })
|
|
2652
2867
|
}
|
|
2653
2868
|
)
|
|
2654
2869
|
] })
|
|
@@ -2660,13 +2875,13 @@ var DropZoneContent = ({
|
|
|
2660
2875
|
limit
|
|
2661
2876
|
}) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
2662
2877
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-dropzone", children: [
|
|
2663
|
-
/* @__PURE__ */
|
|
2664
|
-
/* @__PURE__ */
|
|
2665
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsx22(FileIcon, {}),
|
|
2879
|
+
/* @__PURE__ */ jsx22(FileCornerIcon, {}),
|
|
2880
|
+
/* @__PURE__ */ jsx22("div", { className: "tiptap-image-upload-icon-container", children: /* @__PURE__ */ jsx22(CloudUploadIcon, {}) })
|
|
2666
2881
|
] }),
|
|
2667
2882
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-content", children: [
|
|
2668
2883
|
/* @__PURE__ */ jsxs9("span", { className: "tiptap-image-upload-text", children: [
|
|
2669
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsx22("em", { children: "Click to upload" }),
|
|
2670
2885
|
" or drag and drop"
|
|
2671
2886
|
] }),
|
|
2672
2887
|
/* @__PURE__ */ jsxs9("span", { className: "tiptap-image-upload-subtext", children: [
|
|
@@ -2682,7 +2897,7 @@ var DropZoneContent = ({
|
|
|
2682
2897
|
] });
|
|
2683
2898
|
var ImageUploadNode = (props) => {
|
|
2684
2899
|
const { accept, limit, maxSize } = props.node.attrs;
|
|
2685
|
-
const inputRef =
|
|
2900
|
+
const inputRef = useRef5(null);
|
|
2686
2901
|
const extension = props.extension;
|
|
2687
2902
|
const uploadOptions = {
|
|
2688
2903
|
maxSize,
|
|
@@ -2737,7 +2952,7 @@ var ImageUploadNode = (props) => {
|
|
|
2737
2952
|
tabIndex: 0,
|
|
2738
2953
|
onClick: handleClick,
|
|
2739
2954
|
children: [
|
|
2740
|
-
!hasFiles && /* @__PURE__ */
|
|
2955
|
+
!hasFiles && /* @__PURE__ */ jsx22(ImageUploadDragArea, { onFile: handleUpload, children: /* @__PURE__ */ jsx22(DropZoneContent, { maxSize, limit }) }),
|
|
2741
2956
|
hasFiles && /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-previews", children: [
|
|
2742
2957
|
fileItems.length > 1 && /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-header", children: [
|
|
2743
2958
|
/* @__PURE__ */ jsxs9("span", { children: [
|
|
@@ -2745,7 +2960,7 @@ var ImageUploadNode = (props) => {
|
|
|
2745
2960
|
fileItems.length,
|
|
2746
2961
|
" files"
|
|
2747
2962
|
] }),
|
|
2748
|
-
/* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ jsx22(
|
|
2749
2964
|
Button2,
|
|
2750
2965
|
{
|
|
2751
2966
|
type: "button",
|
|
@@ -2758,7 +2973,7 @@ var ImageUploadNode = (props) => {
|
|
|
2758
2973
|
}
|
|
2759
2974
|
)
|
|
2760
2975
|
] }),
|
|
2761
|
-
fileItems.map((fileItem) => /* @__PURE__ */
|
|
2976
|
+
fileItems.map((fileItem) => /* @__PURE__ */ jsx22(
|
|
2762
2977
|
ImageUploadPreview,
|
|
2763
2978
|
{
|
|
2764
2979
|
fileItem,
|
|
@@ -2767,7 +2982,7 @@ var ImageUploadNode = (props) => {
|
|
|
2767
2982
|
fileItem.id
|
|
2768
2983
|
))
|
|
2769
2984
|
] }),
|
|
2770
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsx22(
|
|
2771
2986
|
"input",
|
|
2772
2987
|
{
|
|
2773
2988
|
ref: inputRef,
|
|
@@ -2876,13 +3091,13 @@ var HorizontalRule = TiptapHorizontalRule.extend({
|
|
|
2876
3091
|
});
|
|
2877
3092
|
|
|
2878
3093
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
2879
|
-
import { forwardRef as forwardRef9, useCallback as
|
|
3094
|
+
import { forwardRef as forwardRef9, useCallback as useCallback8, useState as useState10 } from "react";
|
|
2880
3095
|
|
|
2881
3096
|
// src/components/tiptap-icons/chevron-down-icon.tsx
|
|
2882
|
-
import { memo as
|
|
2883
|
-
import { jsx as
|
|
2884
|
-
var ChevronDownIcon =
|
|
2885
|
-
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(
|
|
2886
3101
|
"svg",
|
|
2887
3102
|
{
|
|
2888
3103
|
width: "24",
|
|
@@ -2892,7 +3107,7 @@ var ChevronDownIcon = memo2(({ className, ...props }) => {
|
|
|
2892
3107
|
fill: "currentColor",
|
|
2893
3108
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2894
3109
|
...props,
|
|
2895
|
-
children: /* @__PURE__ */
|
|
3110
|
+
children: /* @__PURE__ */ jsx23(
|
|
2896
3111
|
"path",
|
|
2897
3112
|
{
|
|
2898
3113
|
fillRule: "evenodd",
|
|
@@ -2908,10 +3123,10 @@ ChevronDownIcon.displayName = "ChevronDownIcon";
|
|
|
2908
3123
|
|
|
2909
3124
|
// src/hooks/use-tiptap-editor.ts
|
|
2910
3125
|
import { useCurrentEditor as useCurrentEditor2, useEditorState } from "@tiptap/react";
|
|
2911
|
-
import { useMemo as
|
|
3126
|
+
import { useMemo as useMemo6 } from "react";
|
|
2912
3127
|
function useTiptapEditor(providedEditor) {
|
|
2913
3128
|
const { editor: coreEditor } = useCurrentEditor2();
|
|
2914
|
-
const mainEditor =
|
|
3129
|
+
const mainEditor = useMemo6(
|
|
2915
3130
|
() => providedEditor || coreEditor,
|
|
2916
3131
|
[providedEditor, coreEditor]
|
|
2917
3132
|
);
|
|
@@ -2936,11 +3151,11 @@ function useTiptapEditor(providedEditor) {
|
|
|
2936
3151
|
}
|
|
2937
3152
|
|
|
2938
3153
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
2939
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
3154
|
+
import { forwardRef as forwardRef6, useCallback as useCallback6 } from "react";
|
|
2940
3155
|
|
|
2941
3156
|
// src/components/tiptap-ui-primitive/badge/badge.tsx
|
|
2942
3157
|
import { forwardRef as forwardRef5 } from "react";
|
|
2943
|
-
import { jsx as
|
|
3158
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2944
3159
|
var Badge = forwardRef5(
|
|
2945
3160
|
({
|
|
2946
3161
|
variant,
|
|
@@ -2951,7 +3166,7 @@ var Badge = forwardRef5(
|
|
|
2951
3166
|
children,
|
|
2952
3167
|
...props
|
|
2953
3168
|
}, ref) => {
|
|
2954
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsx24(
|
|
2955
3170
|
"div",
|
|
2956
3171
|
{
|
|
2957
3172
|
ref,
|
|
@@ -2969,12 +3184,12 @@ var Badge = forwardRef5(
|
|
|
2969
3184
|
Badge.displayName = "Badge";
|
|
2970
3185
|
|
|
2971
3186
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
2972
|
-
import { Fragment as Fragment3, jsx as
|
|
3187
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2973
3188
|
function HeadingShortcutBadge({
|
|
2974
3189
|
level,
|
|
2975
3190
|
shortcutKeys = HEADING_SHORTCUT_KEYS[level]
|
|
2976
3191
|
}) {
|
|
2977
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx25(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
2978
3193
|
}
|
|
2979
3194
|
var HeadingButton = forwardRef6(
|
|
2980
3195
|
({
|
|
@@ -3003,7 +3218,7 @@ var HeadingButton = forwardRef6(
|
|
|
3003
3218
|
hideWhenUnavailable,
|
|
3004
3219
|
onToggled
|
|
3005
3220
|
});
|
|
3006
|
-
const handleClick =
|
|
3221
|
+
const handleClick = useCallback6(
|
|
3007
3222
|
(event) => {
|
|
3008
3223
|
onClick?.(event);
|
|
3009
3224
|
if (event.defaultPrevented) return;
|
|
@@ -3014,7 +3229,7 @@ var HeadingButton = forwardRef6(
|
|
|
3014
3229
|
if (!isVisible) {
|
|
3015
3230
|
return null;
|
|
3016
3231
|
}
|
|
3017
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx25(
|
|
3018
3233
|
Button2,
|
|
3019
3234
|
{
|
|
3020
3235
|
type: "button",
|
|
@@ -3031,9 +3246,9 @@ var HeadingButton = forwardRef6(
|
|
|
3031
3246
|
...buttonProps,
|
|
3032
3247
|
ref,
|
|
3033
3248
|
children: children ?? /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
3034
|
-
/* @__PURE__ */
|
|
3035
|
-
text && /* @__PURE__ */
|
|
3036
|
-
showShortcut && /* @__PURE__ */
|
|
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 })
|
|
3037
3252
|
] })
|
|
3038
3253
|
}
|
|
3039
3254
|
);
|
|
@@ -3042,13 +3257,13 @@ var HeadingButton = forwardRef6(
|
|
|
3042
3257
|
HeadingButton.displayName = "HeadingButton";
|
|
3043
3258
|
|
|
3044
3259
|
// src/components/tiptap-ui/heading-button/use-heading.ts
|
|
3045
|
-
import { useCallback as
|
|
3260
|
+
import { useCallback as useCallback7, useEffect as useEffect5, useState as useState9 } from "react";
|
|
3046
3261
|
import { NodeSelection as NodeSelection2, TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
3047
3262
|
|
|
3048
3263
|
// src/components/tiptap-icons/heading-one-icon.tsx
|
|
3049
|
-
import { memo as
|
|
3050
|
-
import { jsx as
|
|
3051
|
-
var HeadingOneIcon =
|
|
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 }) => {
|
|
3052
3267
|
return /* @__PURE__ */ jsxs11(
|
|
3053
3268
|
"svg",
|
|
3054
3269
|
{
|
|
@@ -3060,14 +3275,14 @@ var HeadingOneIcon = memo3(({ className, ...props }) => {
|
|
|
3060
3275
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3061
3276
|
...props,
|
|
3062
3277
|
children: [
|
|
3063
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ jsx26(
|
|
3064
3279
|
"path",
|
|
3065
3280
|
{
|
|
3066
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",
|
|
3067
3282
|
fill: "currentColor"
|
|
3068
3283
|
}
|
|
3069
3284
|
),
|
|
3070
|
-
/* @__PURE__ */
|
|
3285
|
+
/* @__PURE__ */ jsx26(
|
|
3071
3286
|
"path",
|
|
3072
3287
|
{
|
|
3073
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",
|
|
@@ -3081,9 +3296,9 @@ var HeadingOneIcon = memo3(({ className, ...props }) => {
|
|
|
3081
3296
|
HeadingOneIcon.displayName = "HeadingOneIcon";
|
|
3082
3297
|
|
|
3083
3298
|
// src/components/tiptap-icons/heading-two-icon.tsx
|
|
3084
|
-
import { memo as
|
|
3085
|
-
import { jsx as
|
|
3086
|
-
var HeadingTwoIcon =
|
|
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 }) => {
|
|
3087
3302
|
return /* @__PURE__ */ jsxs12(
|
|
3088
3303
|
"svg",
|
|
3089
3304
|
{
|
|
@@ -3095,14 +3310,14 @@ var HeadingTwoIcon = memo4(({ className, ...props }) => {
|
|
|
3095
3310
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3096
3311
|
...props,
|
|
3097
3312
|
children: [
|
|
3098
|
-
/* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ jsx27(
|
|
3099
3314
|
"path",
|
|
3100
3315
|
{
|
|
3101
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",
|
|
3102
3317
|
fill: "currentColor"
|
|
3103
3318
|
}
|
|
3104
3319
|
),
|
|
3105
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ jsx27(
|
|
3106
3321
|
"path",
|
|
3107
3322
|
{
|
|
3108
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",
|
|
@@ -3116,9 +3331,9 @@ var HeadingTwoIcon = memo4(({ className, ...props }) => {
|
|
|
3116
3331
|
HeadingTwoIcon.displayName = "HeadingTwoIcon";
|
|
3117
3332
|
|
|
3118
3333
|
// src/components/tiptap-icons/heading-three-icon.tsx
|
|
3119
|
-
import { memo as
|
|
3120
|
-
import { jsx as
|
|
3121
|
-
var HeadingThreeIcon =
|
|
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 }) => {
|
|
3122
3337
|
return /* @__PURE__ */ jsxs13(
|
|
3123
3338
|
"svg",
|
|
3124
3339
|
{
|
|
@@ -3130,14 +3345,14 @@ var HeadingThreeIcon = memo5(({ className, ...props }) => {
|
|
|
3130
3345
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3131
3346
|
...props,
|
|
3132
3347
|
children: [
|
|
3133
|
-
/* @__PURE__ */
|
|
3348
|
+
/* @__PURE__ */ jsx28(
|
|
3134
3349
|
"path",
|
|
3135
3350
|
{
|
|
3136
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",
|
|
3137
3352
|
fill: "currentColor"
|
|
3138
3353
|
}
|
|
3139
3354
|
),
|
|
3140
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx28(
|
|
3141
3356
|
"path",
|
|
3142
3357
|
{
|
|
3143
3358
|
fillRule: "evenodd",
|
|
@@ -3146,7 +3361,7 @@ var HeadingThreeIcon = memo5(({ className, ...props }) => {
|
|
|
3146
3361
|
fill: "currentColor"
|
|
3147
3362
|
}
|
|
3148
3363
|
),
|
|
3149
|
-
/* @__PURE__ */
|
|
3364
|
+
/* @__PURE__ */ jsx28(
|
|
3150
3365
|
"path",
|
|
3151
3366
|
{
|
|
3152
3367
|
fillRule: "evenodd",
|
|
@@ -3162,9 +3377,9 @@ var HeadingThreeIcon = memo5(({ className, ...props }) => {
|
|
|
3162
3377
|
HeadingThreeIcon.displayName = "HeadingThreeIcon";
|
|
3163
3378
|
|
|
3164
3379
|
// src/components/tiptap-icons/heading-four-icon.tsx
|
|
3165
|
-
import { memo as
|
|
3166
|
-
import { jsx as
|
|
3167
|
-
var HeadingFourIcon =
|
|
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 }) => {
|
|
3168
3383
|
return /* @__PURE__ */ jsxs14(
|
|
3169
3384
|
"svg",
|
|
3170
3385
|
{
|
|
@@ -3176,14 +3391,14 @@ var HeadingFourIcon = memo6(({ className, ...props }) => {
|
|
|
3176
3391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3177
3392
|
...props,
|
|
3178
3393
|
children: [
|
|
3179
|
-
/* @__PURE__ */
|
|
3394
|
+
/* @__PURE__ */ jsx29(
|
|
3180
3395
|
"path",
|
|
3181
3396
|
{
|
|
3182
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",
|
|
3183
3398
|
fill: "currentColor"
|
|
3184
3399
|
}
|
|
3185
3400
|
),
|
|
3186
|
-
/* @__PURE__ */
|
|
3401
|
+
/* @__PURE__ */ jsx29(
|
|
3187
3402
|
"path",
|
|
3188
3403
|
{
|
|
3189
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",
|
|
@@ -3197,9 +3412,9 @@ var HeadingFourIcon = memo6(({ className, ...props }) => {
|
|
|
3197
3412
|
HeadingFourIcon.displayName = "HeadingFourIcon";
|
|
3198
3413
|
|
|
3199
3414
|
// src/components/tiptap-icons/heading-five-icon.tsx
|
|
3200
|
-
import { memo as
|
|
3201
|
-
import { jsx as
|
|
3202
|
-
var HeadingFiveIcon =
|
|
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 }) => {
|
|
3203
3418
|
return /* @__PURE__ */ jsxs15(
|
|
3204
3419
|
"svg",
|
|
3205
3420
|
{
|
|
@@ -3211,14 +3426,14 @@ var HeadingFiveIcon = memo7(({ className, ...props }) => {
|
|
|
3211
3426
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3212
3427
|
...props,
|
|
3213
3428
|
children: [
|
|
3214
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ jsx30(
|
|
3215
3430
|
"path",
|
|
3216
3431
|
{
|
|
3217
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",
|
|
3218
3433
|
fill: "currentColor"
|
|
3219
3434
|
}
|
|
3220
3435
|
),
|
|
3221
|
-
/* @__PURE__ */
|
|
3436
|
+
/* @__PURE__ */ jsx30(
|
|
3222
3437
|
"path",
|
|
3223
3438
|
{
|
|
3224
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",
|
|
@@ -3232,9 +3447,9 @@ var HeadingFiveIcon = memo7(({ className, ...props }) => {
|
|
|
3232
3447
|
HeadingFiveIcon.displayName = "HeadingFiveIcon";
|
|
3233
3448
|
|
|
3234
3449
|
// src/components/tiptap-icons/heading-six-icon.tsx
|
|
3235
|
-
import { memo as
|
|
3236
|
-
import { jsx as
|
|
3237
|
-
var HeadingSixIcon =
|
|
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 }) => {
|
|
3238
3453
|
return /* @__PURE__ */ jsxs16(
|
|
3239
3454
|
"svg",
|
|
3240
3455
|
{
|
|
@@ -3246,14 +3461,14 @@ var HeadingSixIcon = memo8(({ className, ...props }) => {
|
|
|
3246
3461
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3247
3462
|
...props,
|
|
3248
3463
|
children: [
|
|
3249
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ jsx31(
|
|
3250
3465
|
"path",
|
|
3251
3466
|
{
|
|
3252
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",
|
|
3253
3468
|
fill: "currentColor"
|
|
3254
3469
|
}
|
|
3255
3470
|
),
|
|
3256
|
-
/* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ jsx31(
|
|
3257
3472
|
"path",
|
|
3258
3473
|
{
|
|
3259
3474
|
fillRule: "evenodd",
|
|
@@ -3386,7 +3601,7 @@ function useHeading(config) {
|
|
|
3386
3601
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
3387
3602
|
};
|
|
3388
3603
|
}, [editor, level, hideWhenUnavailable]);
|
|
3389
|
-
const handleToggle =
|
|
3604
|
+
const handleToggle = useCallback7(() => {
|
|
3390
3605
|
if (!editor) return false;
|
|
3391
3606
|
const success = toggleHeading(editor, level);
|
|
3392
3607
|
if (success) {
|
|
@@ -3408,22 +3623,22 @@ function useHeading(config) {
|
|
|
3408
3623
|
// src/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx
|
|
3409
3624
|
import { forwardRef as forwardRef7 } from "react";
|
|
3410
3625
|
import * as DropdownMenuPrimitive2 from "@radix-ui/react-dropdown-menu";
|
|
3411
|
-
import { jsx as
|
|
3626
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3412
3627
|
function DropdownMenu2({
|
|
3413
3628
|
...props
|
|
3414
3629
|
}) {
|
|
3415
|
-
return /* @__PURE__ */
|
|
3630
|
+
return /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Root, { modal: false, ...props });
|
|
3416
3631
|
}
|
|
3417
3632
|
function DropdownMenuPortal({
|
|
3418
3633
|
...props
|
|
3419
3634
|
}) {
|
|
3420
|
-
return /* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Portal, { ...props });
|
|
3421
3636
|
}
|
|
3422
|
-
var DropdownMenuTrigger2 = forwardRef7(({ ...props }, ref) => /* @__PURE__ */
|
|
3637
|
+
var DropdownMenuTrigger2 = forwardRef7(({ ...props }, ref) => /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Trigger, { ref, ...props }));
|
|
3423
3638
|
DropdownMenuTrigger2.displayName = DropdownMenuPrimitive2.Trigger.displayName;
|
|
3424
3639
|
var DropdownMenuItem2 = DropdownMenuPrimitive2.Item;
|
|
3425
3640
|
var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }, ref) => {
|
|
3426
|
-
const content = /* @__PURE__ */
|
|
3641
|
+
const content = /* @__PURE__ */ jsx32(
|
|
3427
3642
|
DropdownMenuPrimitive2.SubContent,
|
|
3428
3643
|
{
|
|
3429
3644
|
ref,
|
|
@@ -3431,11 +3646,11 @@ var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }
|
|
|
3431
3646
|
...props
|
|
3432
3647
|
}
|
|
3433
3648
|
);
|
|
3434
|
-
return portal ? /* @__PURE__ */
|
|
3649
|
+
return portal ? /* @__PURE__ */ jsx32(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3435
3650
|
});
|
|
3436
3651
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive2.SubContent.displayName;
|
|
3437
3652
|
var DropdownMenuContent2 = forwardRef7(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
3438
|
-
const content = /* @__PURE__ */
|
|
3653
|
+
const content = /* @__PURE__ */ jsx32(
|
|
3439
3654
|
DropdownMenuPrimitive2.Content,
|
|
3440
3655
|
{
|
|
3441
3656
|
ref,
|
|
@@ -3445,22 +3660,22 @@ var DropdownMenuContent2 = forwardRef7(({ className, sideOffset = 4, portal = fa
|
|
|
3445
3660
|
...props
|
|
3446
3661
|
}
|
|
3447
3662
|
);
|
|
3448
|
-
return portal ? /* @__PURE__ */
|
|
3663
|
+
return portal ? /* @__PURE__ */ jsx32(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3449
3664
|
});
|
|
3450
3665
|
DropdownMenuContent2.displayName = DropdownMenuPrimitive2.Content.displayName;
|
|
3451
3666
|
|
|
3452
3667
|
// src/components/tiptap-ui-primitive/card/card.tsx
|
|
3453
3668
|
import { forwardRef as forwardRef8 } from "react";
|
|
3454
|
-
import { jsx as
|
|
3669
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3455
3670
|
var Card = forwardRef8(
|
|
3456
3671
|
({ className, ...props }, ref) => {
|
|
3457
|
-
return /* @__PURE__ */
|
|
3672
|
+
return /* @__PURE__ */ jsx33("div", { ref, className: cn2("tiptap-card", className), ...props });
|
|
3458
3673
|
}
|
|
3459
3674
|
);
|
|
3460
3675
|
Card.displayName = "Card";
|
|
3461
3676
|
var CardHeader = forwardRef8(
|
|
3462
3677
|
({ className, ...props }, ref) => {
|
|
3463
|
-
return /* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsx33(
|
|
3464
3679
|
"div",
|
|
3465
3680
|
{
|
|
3466
3681
|
ref,
|
|
@@ -3473,12 +3688,12 @@ var CardHeader = forwardRef8(
|
|
|
3473
3688
|
CardHeader.displayName = "CardHeader";
|
|
3474
3689
|
var CardBody = forwardRef8(
|
|
3475
3690
|
({ className, ...props }, ref) => {
|
|
3476
|
-
return /* @__PURE__ */
|
|
3691
|
+
return /* @__PURE__ */ jsx33("div", { ref, className: cn2("tiptap-card-body", className), ...props });
|
|
3477
3692
|
}
|
|
3478
3693
|
);
|
|
3479
3694
|
CardBody.displayName = "CardBody";
|
|
3480
3695
|
var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props }, ref) => {
|
|
3481
|
-
return /* @__PURE__ */
|
|
3696
|
+
return /* @__PURE__ */ jsx33(
|
|
3482
3697
|
"div",
|
|
3483
3698
|
{
|
|
3484
3699
|
ref,
|
|
@@ -3491,7 +3706,7 @@ var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props
|
|
|
3491
3706
|
CardItemGroup.displayName = "CardItemGroup";
|
|
3492
3707
|
var CardGroupLabel = forwardRef8(
|
|
3493
3708
|
({ className, ...props }, ref) => {
|
|
3494
|
-
return /* @__PURE__ */
|
|
3709
|
+
return /* @__PURE__ */ jsx33(
|
|
3495
3710
|
"div",
|
|
3496
3711
|
{
|
|
3497
3712
|
ref,
|
|
@@ -3504,7 +3719,7 @@ var CardGroupLabel = forwardRef8(
|
|
|
3504
3719
|
CardGroupLabel.displayName = "CardGroupLabel";
|
|
3505
3720
|
var CardFooter = forwardRef8(
|
|
3506
3721
|
({ className, ...props }, ref) => {
|
|
3507
|
-
return /* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ jsx33(
|
|
3508
3723
|
"div",
|
|
3509
3724
|
{
|
|
3510
3725
|
ref,
|
|
@@ -3517,7 +3732,7 @@ var CardFooter = forwardRef8(
|
|
|
3517
3732
|
CardFooter.displayName = "CardFooter";
|
|
3518
3733
|
|
|
3519
3734
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
3520
|
-
import { jsx as
|
|
3735
|
+
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3521
3736
|
var HeadingDropdownMenu = forwardRef9(
|
|
3522
3737
|
({
|
|
3523
3738
|
editor: providedEditor,
|
|
@@ -3534,7 +3749,7 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3534
3749
|
levels,
|
|
3535
3750
|
hideWhenUnavailable
|
|
3536
3751
|
});
|
|
3537
|
-
const handleOpenChange =
|
|
3752
|
+
const handleOpenChange = useCallback8(
|
|
3538
3753
|
(open) => {
|
|
3539
3754
|
if (!editor || !canToggle2) return;
|
|
3540
3755
|
setIsOpen(open);
|
|
@@ -3546,7 +3761,7 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3546
3761
|
return null;
|
|
3547
3762
|
}
|
|
3548
3763
|
return /* @__PURE__ */ jsxs17(DropdownMenu2, { modal: true, open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
3549
|
-
/* @__PURE__ */
|
|
3764
|
+
/* @__PURE__ */ jsx34(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
3550
3765
|
Button2,
|
|
3551
3766
|
{
|
|
3552
3767
|
type: "button",
|
|
@@ -3562,12 +3777,12 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3562
3777
|
...buttonProps,
|
|
3563
3778
|
ref,
|
|
3564
3779
|
children: [
|
|
3565
|
-
/* @__PURE__ */
|
|
3566
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ jsx34(Icon, { className: "tiptap-button-icon" }),
|
|
3781
|
+
/* @__PURE__ */ jsx34(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
3567
3782
|
]
|
|
3568
3783
|
}
|
|
3569
3784
|
) }),
|
|
3570
|
-
/* @__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(
|
|
3571
3786
|
HeadingButton,
|
|
3572
3787
|
{
|
|
3573
3788
|
editor,
|
|
@@ -3585,10 +3800,10 @@ HeadingDropdownMenu.displayName = "HeadingDropdownMenu";
|
|
|
3585
3800
|
import { useEffect as useEffect6, useState as useState11 } from "react";
|
|
3586
3801
|
|
|
3587
3802
|
// src/components/tiptap-icons/heading-icon.tsx
|
|
3588
|
-
import { memo as
|
|
3589
|
-
import { jsx as
|
|
3590
|
-
var HeadingIcon =
|
|
3591
|
-
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(
|
|
3592
3807
|
"svg",
|
|
3593
3808
|
{
|
|
3594
3809
|
width: "24",
|
|
@@ -3598,7 +3813,7 @@ var HeadingIcon = memo9(({ className, ...props }) => {
|
|
|
3598
3813
|
fill: "currentColor",
|
|
3599
3814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3600
3815
|
...props,
|
|
3601
|
-
children: /* @__PURE__ */
|
|
3816
|
+
children: /* @__PURE__ */ jsx35(
|
|
3602
3817
|
"path",
|
|
3603
3818
|
{
|
|
3604
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",
|
|
@@ -3651,12 +3866,12 @@ function useHeadingDropdownMenu(config) {
|
|
|
3651
3866
|
}
|
|
3652
3867
|
|
|
3653
3868
|
// src/components/tiptap-ui/image-upload-button/image-upload-button.tsx
|
|
3654
|
-
import { forwardRef as forwardRef10, useCallback as
|
|
3655
|
-
import { Fragment as Fragment4, jsx 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";
|
|
3656
3871
|
function ImageShortcutBadge({
|
|
3657
3872
|
shortcutKeys = IMAGE_UPLOAD_SHORTCUT_KEY
|
|
3658
3873
|
}) {
|
|
3659
|
-
return /* @__PURE__ */
|
|
3874
|
+
return /* @__PURE__ */ jsx36(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3660
3875
|
}
|
|
3661
3876
|
var ImageUploadButton = forwardRef10(
|
|
3662
3877
|
({
|
|
@@ -3684,7 +3899,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3684
3899
|
hideWhenUnavailable,
|
|
3685
3900
|
onInserted
|
|
3686
3901
|
});
|
|
3687
|
-
const handleClick =
|
|
3902
|
+
const handleClick = useCallback9(
|
|
3688
3903
|
async (event) => {
|
|
3689
3904
|
onClick?.(event);
|
|
3690
3905
|
if (event.defaultPrevented) return;
|
|
@@ -3696,7 +3911,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3696
3911
|
return null;
|
|
3697
3912
|
}
|
|
3698
3913
|
const RenderIcon = CustomIcon ?? Icon;
|
|
3699
|
-
return /* @__PURE__ */
|
|
3914
|
+
return /* @__PURE__ */ jsx36(
|
|
3700
3915
|
Button2,
|
|
3701
3916
|
{
|
|
3702
3917
|
type: "button",
|
|
@@ -3713,9 +3928,9 @@ var ImageUploadButton = forwardRef10(
|
|
|
3713
3928
|
...buttonProps,
|
|
3714
3929
|
ref,
|
|
3715
3930
|
children: children ?? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
3716
|
-
/* @__PURE__ */
|
|
3717
|
-
text && /* @__PURE__ */
|
|
3718
|
-
showShortcut && /* @__PURE__ */
|
|
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 })
|
|
3719
3934
|
] })
|
|
3720
3935
|
}
|
|
3721
3936
|
);
|
|
@@ -3724,7 +3939,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3724
3939
|
ImageUploadButton.displayName = "ImageUploadButton";
|
|
3725
3940
|
|
|
3726
3941
|
// src/components/tiptap-ui/image-upload-button/use-image-upload.ts
|
|
3727
|
-
import { useCallback as
|
|
3942
|
+
import { useCallback as useCallback10, useEffect as useEffect8, useState as useState13 } from "react";
|
|
3728
3943
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
3729
3944
|
|
|
3730
3945
|
// src/hooks/use-is-breakpoint.ts
|
|
@@ -3743,10 +3958,10 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
3743
3958
|
}
|
|
3744
3959
|
|
|
3745
3960
|
// src/components/tiptap-icons/image-plus-icon.tsx
|
|
3746
|
-
import { memo as
|
|
3747
|
-
import { jsx as
|
|
3748
|
-
var ImagePlusIcon =
|
|
3749
|
-
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(
|
|
3750
3965
|
"svg",
|
|
3751
3966
|
{
|
|
3752
3967
|
width: "24",
|
|
@@ -3756,7 +3971,7 @@ var ImagePlusIcon = memo10(({ className, ...props }) => {
|
|
|
3756
3971
|
fill: "currentColor",
|
|
3757
3972
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3758
3973
|
...props,
|
|
3759
|
-
children: /* @__PURE__ */
|
|
3974
|
+
children: /* @__PURE__ */ jsx37(
|
|
3760
3975
|
"path",
|
|
3761
3976
|
{
|
|
3762
3977
|
fillRule: "evenodd",
|
|
@@ -3844,7 +4059,7 @@ function useImageUpload(config) {
|
|
|
3844
4059
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
3845
4060
|
};
|
|
3846
4061
|
}, [editor, hideWhenUnavailable]);
|
|
3847
|
-
const handleImage =
|
|
4062
|
+
const handleImage = useCallback10(async () => {
|
|
3848
4063
|
if (!editor) return false;
|
|
3849
4064
|
const success = insertImage(editor);
|
|
3850
4065
|
if (await success) {
|
|
@@ -3876,16 +4091,16 @@ function useImageUpload(config) {
|
|
|
3876
4091
|
}
|
|
3877
4092
|
|
|
3878
4093
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
3879
|
-
import { useCallback as
|
|
4094
|
+
import { useCallback as useCallback13, useState as useState16 } from "react";
|
|
3880
4095
|
|
|
3881
4096
|
// src/components/tiptap-ui/list-button/list-button.tsx
|
|
3882
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
3883
|
-
import { Fragment as Fragment5, jsx 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";
|
|
3884
4099
|
function ListShortcutBadge({
|
|
3885
4100
|
type,
|
|
3886
4101
|
shortcutKeys = LIST_SHORTCUT_KEYS[type]
|
|
3887
4102
|
}) {
|
|
3888
|
-
return /* @__PURE__ */
|
|
4103
|
+
return /* @__PURE__ */ jsx38(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3889
4104
|
}
|
|
3890
4105
|
var ListButton = forwardRef11(
|
|
3891
4106
|
({
|
|
@@ -3914,7 +4129,7 @@ var ListButton = forwardRef11(
|
|
|
3914
4129
|
hideWhenUnavailable,
|
|
3915
4130
|
onToggled
|
|
3916
4131
|
});
|
|
3917
|
-
const handleClick =
|
|
4132
|
+
const handleClick = useCallback11(
|
|
3918
4133
|
(event) => {
|
|
3919
4134
|
onClick?.(event);
|
|
3920
4135
|
if (event.defaultPrevented) return;
|
|
@@ -3925,7 +4140,7 @@ var ListButton = forwardRef11(
|
|
|
3925
4140
|
if (!isVisible) {
|
|
3926
4141
|
return null;
|
|
3927
4142
|
}
|
|
3928
|
-
return /* @__PURE__ */
|
|
4143
|
+
return /* @__PURE__ */ jsx38(
|
|
3929
4144
|
Button2,
|
|
3930
4145
|
{
|
|
3931
4146
|
type: "button",
|
|
@@ -3942,9 +4157,9 @@ var ListButton = forwardRef11(
|
|
|
3942
4157
|
...buttonProps,
|
|
3943
4158
|
ref,
|
|
3944
4159
|
children: children ?? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
3945
|
-
/* @__PURE__ */
|
|
3946
|
-
text && /* @__PURE__ */
|
|
3947
|
-
showShortcut && /* @__PURE__ */
|
|
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 })
|
|
3948
4163
|
] })
|
|
3949
4164
|
}
|
|
3950
4165
|
);
|
|
@@ -3953,13 +4168,13 @@ var ListButton = forwardRef11(
|
|
|
3953
4168
|
ListButton.displayName = "ListButton";
|
|
3954
4169
|
|
|
3955
4170
|
// src/components/tiptap-ui/list-button/use-list.ts
|
|
3956
|
-
import { useCallback as
|
|
4171
|
+
import { useCallback as useCallback12, useEffect as useEffect9, useState as useState14 } from "react";
|
|
3957
4172
|
import { NodeSelection as NodeSelection3, TextSelection as TextSelection3 } from "@tiptap/pm/state";
|
|
3958
4173
|
|
|
3959
4174
|
// src/components/tiptap-icons/list-icon.tsx
|
|
3960
|
-
import { memo as
|
|
3961
|
-
import { jsx as
|
|
3962
|
-
var ListIcon =
|
|
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 }) => {
|
|
3963
4178
|
return /* @__PURE__ */ jsxs20(
|
|
3964
4179
|
"svg",
|
|
3965
4180
|
{
|
|
@@ -3971,7 +4186,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
3971
4186
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3972
4187
|
...props,
|
|
3973
4188
|
children: [
|
|
3974
|
-
/* @__PURE__ */
|
|
4189
|
+
/* @__PURE__ */ jsx39(
|
|
3975
4190
|
"path",
|
|
3976
4191
|
{
|
|
3977
4192
|
fillRule: "evenodd",
|
|
@@ -3980,7 +4195,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
3980
4195
|
fill: "currentColor"
|
|
3981
4196
|
}
|
|
3982
4197
|
),
|
|
3983
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ jsx39(
|
|
3984
4199
|
"path",
|
|
3985
4200
|
{
|
|
3986
4201
|
fillRule: "evenodd",
|
|
@@ -3989,7 +4204,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
3989
4204
|
fill: "currentColor"
|
|
3990
4205
|
}
|
|
3991
4206
|
),
|
|
3992
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsx39(
|
|
3993
4208
|
"path",
|
|
3994
4209
|
{
|
|
3995
4210
|
fillRule: "evenodd",
|
|
@@ -3998,7 +4213,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
3998
4213
|
fill: "currentColor"
|
|
3999
4214
|
}
|
|
4000
4215
|
),
|
|
4001
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ jsx39(
|
|
4002
4217
|
"path",
|
|
4003
4218
|
{
|
|
4004
4219
|
fillRule: "evenodd",
|
|
@@ -4007,7 +4222,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
4007
4222
|
fill: "currentColor"
|
|
4008
4223
|
}
|
|
4009
4224
|
),
|
|
4010
|
-
/* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ jsx39(
|
|
4011
4226
|
"path",
|
|
4012
4227
|
{
|
|
4013
4228
|
fillRule: "evenodd",
|
|
@@ -4016,7 +4231,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
4016
4231
|
fill: "currentColor"
|
|
4017
4232
|
}
|
|
4018
4233
|
),
|
|
4019
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ jsx39(
|
|
4020
4235
|
"path",
|
|
4021
4236
|
{
|
|
4022
4237
|
fillRule: "evenodd",
|
|
@@ -4032,9 +4247,9 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
4032
4247
|
ListIcon.displayName = "ListIcon";
|
|
4033
4248
|
|
|
4034
4249
|
// src/components/tiptap-icons/list-ordered-icon.tsx
|
|
4035
|
-
import { memo as
|
|
4036
|
-
import { jsx as
|
|
4037
|
-
var ListOrderedIcon =
|
|
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 }) => {
|
|
4038
4253
|
return /* @__PURE__ */ jsxs21(
|
|
4039
4254
|
"svg",
|
|
4040
4255
|
{
|
|
@@ -4046,7 +4261,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4046
4261
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4047
4262
|
...props,
|
|
4048
4263
|
children: [
|
|
4049
|
-
/* @__PURE__ */
|
|
4264
|
+
/* @__PURE__ */ jsx40(
|
|
4050
4265
|
"path",
|
|
4051
4266
|
{
|
|
4052
4267
|
fillRule: "evenodd",
|
|
@@ -4055,7 +4270,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4055
4270
|
fill: "currentColor"
|
|
4056
4271
|
}
|
|
4057
4272
|
),
|
|
4058
|
-
/* @__PURE__ */
|
|
4273
|
+
/* @__PURE__ */ jsx40(
|
|
4059
4274
|
"path",
|
|
4060
4275
|
{
|
|
4061
4276
|
fillRule: "evenodd",
|
|
@@ -4064,7 +4279,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4064
4279
|
fill: "currentColor"
|
|
4065
4280
|
}
|
|
4066
4281
|
),
|
|
4067
|
-
/* @__PURE__ */
|
|
4282
|
+
/* @__PURE__ */ jsx40(
|
|
4068
4283
|
"path",
|
|
4069
4284
|
{
|
|
4070
4285
|
fillRule: "evenodd",
|
|
@@ -4073,7 +4288,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4073
4288
|
fill: "currentColor"
|
|
4074
4289
|
}
|
|
4075
4290
|
),
|
|
4076
|
-
/* @__PURE__ */
|
|
4291
|
+
/* @__PURE__ */ jsx40(
|
|
4077
4292
|
"path",
|
|
4078
4293
|
{
|
|
4079
4294
|
fillRule: "evenodd",
|
|
@@ -4082,7 +4297,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4082
4297
|
fill: "currentColor"
|
|
4083
4298
|
}
|
|
4084
4299
|
),
|
|
4085
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ jsx40(
|
|
4086
4301
|
"path",
|
|
4087
4302
|
{
|
|
4088
4303
|
fillRule: "evenodd",
|
|
@@ -4091,7 +4306,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4091
4306
|
fill: "currentColor"
|
|
4092
4307
|
}
|
|
4093
4308
|
),
|
|
4094
|
-
/* @__PURE__ */
|
|
4309
|
+
/* @__PURE__ */ jsx40(
|
|
4095
4310
|
"path",
|
|
4096
4311
|
{
|
|
4097
4312
|
fillRule: "evenodd",
|
|
@@ -4107,9 +4322,9 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4107
4322
|
ListOrderedIcon.displayName = "ListOrderedIcon";
|
|
4108
4323
|
|
|
4109
4324
|
// src/components/tiptap-icons/list-todo-icon.tsx
|
|
4110
|
-
import { memo as
|
|
4111
|
-
import { jsx as
|
|
4112
|
-
var ListTodoIcon =
|
|
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 }) => {
|
|
4113
4328
|
return /* @__PURE__ */ jsxs22(
|
|
4114
4329
|
"svg",
|
|
4115
4330
|
{
|
|
@@ -4121,7 +4336,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4121
4336
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4122
4337
|
...props,
|
|
4123
4338
|
children: [
|
|
4124
|
-
/* @__PURE__ */
|
|
4339
|
+
/* @__PURE__ */ jsx41(
|
|
4125
4340
|
"path",
|
|
4126
4341
|
{
|
|
4127
4342
|
fillRule: "evenodd",
|
|
@@ -4130,7 +4345,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4130
4345
|
fill: "currentColor"
|
|
4131
4346
|
}
|
|
4132
4347
|
),
|
|
4133
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ jsx41(
|
|
4134
4349
|
"path",
|
|
4135
4350
|
{
|
|
4136
4351
|
fillRule: "evenodd",
|
|
@@ -4139,7 +4354,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4139
4354
|
fill: "currentColor"
|
|
4140
4355
|
}
|
|
4141
4356
|
),
|
|
4142
|
-
/* @__PURE__ */
|
|
4357
|
+
/* @__PURE__ */ jsx41(
|
|
4143
4358
|
"path",
|
|
4144
4359
|
{
|
|
4145
4360
|
fillRule: "evenodd",
|
|
@@ -4148,7 +4363,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4148
4363
|
fill: "currentColor"
|
|
4149
4364
|
}
|
|
4150
4365
|
),
|
|
4151
|
-
/* @__PURE__ */
|
|
4366
|
+
/* @__PURE__ */ jsx41(
|
|
4152
4367
|
"path",
|
|
4153
4368
|
{
|
|
4154
4369
|
fillRule: "evenodd",
|
|
@@ -4157,7 +4372,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4157
4372
|
fill: "currentColor"
|
|
4158
4373
|
}
|
|
4159
4374
|
),
|
|
4160
|
-
/* @__PURE__ */
|
|
4375
|
+
/* @__PURE__ */ jsx41(
|
|
4161
4376
|
"path",
|
|
4162
4377
|
{
|
|
4163
4378
|
fillRule: "evenodd",
|
|
@@ -4315,7 +4530,7 @@ function useList(config) {
|
|
|
4315
4530
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4316
4531
|
};
|
|
4317
4532
|
}, [editor, type, hideWhenUnavailable]);
|
|
4318
|
-
const handleToggle =
|
|
4533
|
+
const handleToggle = useCallback12(() => {
|
|
4319
4534
|
if (!editor) return false;
|
|
4320
4535
|
const success = toggleList(editor, type);
|
|
4321
4536
|
if (success) {
|
|
@@ -4335,7 +4550,7 @@ function useList(config) {
|
|
|
4335
4550
|
}
|
|
4336
4551
|
|
|
4337
4552
|
// src/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts
|
|
4338
|
-
import { useEffect as useEffect10, useMemo as
|
|
4553
|
+
import { useEffect as useEffect10, useMemo as useMemo7, useState as useState15 } from "react";
|
|
4339
4554
|
var listOptions = [
|
|
4340
4555
|
{
|
|
4341
4556
|
label: "Bullet List",
|
|
@@ -4389,7 +4604,7 @@ function useListDropdownMenu(config) {
|
|
|
4389
4604
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4390
4605
|
const [isVisible, setIsVisible] = useState15(true);
|
|
4391
4606
|
const listInSchema = types.some((type) => isNodeInSchema(type, editor));
|
|
4392
|
-
const filteredLists =
|
|
4607
|
+
const filteredLists = useMemo7(() => getFilteredListOptions(types), [types]);
|
|
4393
4608
|
const canToggleAny = canToggleAnyList(editor, types);
|
|
4394
4609
|
const isAnyActive = isAnyListActive(editor, types);
|
|
4395
4610
|
const activeType = getActiveListType(editor, types);
|
|
@@ -4426,7 +4641,7 @@ function useListDropdownMenu(config) {
|
|
|
4426
4641
|
}
|
|
4427
4642
|
|
|
4428
4643
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
4429
|
-
import { jsx as
|
|
4644
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4430
4645
|
function ListDropdownMenu({
|
|
4431
4646
|
editor: providedEditor,
|
|
4432
4647
|
types = ["bulletList", "orderedList", "taskList"],
|
|
@@ -4442,7 +4657,7 @@ function ListDropdownMenu({
|
|
|
4442
4657
|
types,
|
|
4443
4658
|
hideWhenUnavailable
|
|
4444
4659
|
});
|
|
4445
|
-
const handleOnOpenChange =
|
|
4660
|
+
const handleOnOpenChange = useCallback13(
|
|
4446
4661
|
(open) => {
|
|
4447
4662
|
setIsOpen(open);
|
|
4448
4663
|
onOpenChange?.(open);
|
|
@@ -4453,7 +4668,7 @@ function ListDropdownMenu({
|
|
|
4453
4668
|
return null;
|
|
4454
4669
|
}
|
|
4455
4670
|
return /* @__PURE__ */ jsxs23(DropdownMenu2, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4456
|
-
/* @__PURE__ */
|
|
4671
|
+
/* @__PURE__ */ jsx42(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs23(
|
|
4457
4672
|
Button2,
|
|
4458
4673
|
{
|
|
4459
4674
|
type: "button",
|
|
@@ -4467,12 +4682,12 @@ function ListDropdownMenu({
|
|
|
4467
4682
|
tooltip: "List",
|
|
4468
4683
|
...props,
|
|
4469
4684
|
children: [
|
|
4470
|
-
/* @__PURE__ */
|
|
4471
|
-
/* @__PURE__ */
|
|
4685
|
+
/* @__PURE__ */ jsx42(Icon, { className: "tiptap-button-icon" }),
|
|
4686
|
+
/* @__PURE__ */ jsx42(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
4472
4687
|
]
|
|
4473
4688
|
}
|
|
4474
4689
|
) }),
|
|
4475
|
-
/* @__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(
|
|
4476
4691
|
ListButton,
|
|
4477
4692
|
{
|
|
4478
4693
|
editor,
|
|
@@ -4485,12 +4700,12 @@ function ListDropdownMenu({
|
|
|
4485
4700
|
}
|
|
4486
4701
|
|
|
4487
4702
|
// src/components/tiptap-ui/blockquote-button/blockquote-button.tsx
|
|
4488
|
-
import { forwardRef as forwardRef12, useCallback as
|
|
4489
|
-
import { Fragment as Fragment6, jsx 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";
|
|
4490
4705
|
function BlockquoteShortcutBadge({
|
|
4491
4706
|
shortcutKeys = BLOCKQUOTE_SHORTCUT_KEY
|
|
4492
4707
|
}) {
|
|
4493
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsx43(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4494
4709
|
}
|
|
4495
4710
|
var BlockquoteButton = forwardRef12(
|
|
4496
4711
|
({
|
|
@@ -4517,7 +4732,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4517
4732
|
hideWhenUnavailable,
|
|
4518
4733
|
onToggled
|
|
4519
4734
|
});
|
|
4520
|
-
const handleClick =
|
|
4735
|
+
const handleClick = useCallback14(
|
|
4521
4736
|
(event) => {
|
|
4522
4737
|
onClick?.(event);
|
|
4523
4738
|
if (event.defaultPrevented) return;
|
|
@@ -4528,7 +4743,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4528
4743
|
if (!isVisible) {
|
|
4529
4744
|
return null;
|
|
4530
4745
|
}
|
|
4531
|
-
return /* @__PURE__ */
|
|
4746
|
+
return /* @__PURE__ */ jsx43(
|
|
4532
4747
|
Button2,
|
|
4533
4748
|
{
|
|
4534
4749
|
type: "button",
|
|
@@ -4545,9 +4760,9 @@ var BlockquoteButton = forwardRef12(
|
|
|
4545
4760
|
...buttonProps,
|
|
4546
4761
|
ref,
|
|
4547
4762
|
children: children ?? /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
4548
|
-
/* @__PURE__ */
|
|
4549
|
-
text && /* @__PURE__ */
|
|
4550
|
-
showShortcut && /* @__PURE__ */
|
|
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 })
|
|
4551
4766
|
] })
|
|
4552
4767
|
}
|
|
4553
4768
|
);
|
|
@@ -4556,13 +4771,13 @@ var BlockquoteButton = forwardRef12(
|
|
|
4556
4771
|
BlockquoteButton.displayName = "BlockquoteButton";
|
|
4557
4772
|
|
|
4558
4773
|
// src/components/tiptap-ui/blockquote-button/use-blockquote.ts
|
|
4559
|
-
import { useCallback as
|
|
4774
|
+
import { useCallback as useCallback15, useEffect as useEffect11, useState as useState17 } from "react";
|
|
4560
4775
|
import { NodeSelection as NodeSelection4, TextSelection as TextSelection4 } from "@tiptap/pm/state";
|
|
4561
4776
|
|
|
4562
4777
|
// src/components/tiptap-icons/blockquote-icon.tsx
|
|
4563
|
-
import { memo as
|
|
4564
|
-
import { jsx as
|
|
4565
|
-
var BlockquoteIcon =
|
|
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 }) => {
|
|
4566
4781
|
return /* @__PURE__ */ jsxs25(
|
|
4567
4782
|
"svg",
|
|
4568
4783
|
{
|
|
@@ -4574,7 +4789,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4574
4789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4575
4790
|
...props,
|
|
4576
4791
|
children: [
|
|
4577
|
-
/* @__PURE__ */
|
|
4792
|
+
/* @__PURE__ */ jsx44(
|
|
4578
4793
|
"path",
|
|
4579
4794
|
{
|
|
4580
4795
|
fillRule: "evenodd",
|
|
@@ -4583,7 +4798,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4583
4798
|
fill: "currentColor"
|
|
4584
4799
|
}
|
|
4585
4800
|
),
|
|
4586
|
-
/* @__PURE__ */
|
|
4801
|
+
/* @__PURE__ */ jsx44(
|
|
4587
4802
|
"path",
|
|
4588
4803
|
{
|
|
4589
4804
|
fillRule: "evenodd",
|
|
@@ -4592,7 +4807,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4592
4807
|
fill: "currentColor"
|
|
4593
4808
|
}
|
|
4594
4809
|
),
|
|
4595
|
-
/* @__PURE__ */
|
|
4810
|
+
/* @__PURE__ */ jsx44(
|
|
4596
4811
|
"path",
|
|
4597
4812
|
{
|
|
4598
4813
|
fillRule: "evenodd",
|
|
@@ -4601,7 +4816,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4601
4816
|
fill: "currentColor"
|
|
4602
4817
|
}
|
|
4603
4818
|
),
|
|
4604
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ jsx44(
|
|
4605
4820
|
"path",
|
|
4606
4821
|
{
|
|
4607
4822
|
fillRule: "evenodd",
|
|
@@ -4703,7 +4918,7 @@ function useBlockquote(config) {
|
|
|
4703
4918
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4704
4919
|
};
|
|
4705
4920
|
}, [editor, hideWhenUnavailable]);
|
|
4706
|
-
const handleToggle =
|
|
4921
|
+
const handleToggle = useCallback15(() => {
|
|
4707
4922
|
if (!editor) return false;
|
|
4708
4923
|
const success = toggleBlockquote(editor);
|
|
4709
4924
|
if (success) {
|
|
@@ -4723,13 +4938,13 @@ function useBlockquote(config) {
|
|
|
4723
4938
|
}
|
|
4724
4939
|
|
|
4725
4940
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
4726
|
-
import { forwardRef as forwardRef14, useMemo as
|
|
4941
|
+
import { forwardRef as forwardRef14, useMemo as useMemo9, useRef as useRef6, useState as useState19 } from "react";
|
|
4727
4942
|
|
|
4728
4943
|
// src/components/tiptap-icons/ban-icon.tsx
|
|
4729
|
-
import { memo as
|
|
4730
|
-
import { jsx as
|
|
4731
|
-
var BanIcon =
|
|
4732
|
-
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(
|
|
4733
4948
|
"svg",
|
|
4734
4949
|
{
|
|
4735
4950
|
width: "24",
|
|
@@ -4739,7 +4954,7 @@ var BanIcon = memo15(({ className, ...props }) => {
|
|
|
4739
4954
|
fill: "currentColor",
|
|
4740
4955
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4741
4956
|
...props,
|
|
4742
|
-
children: /* @__PURE__ */
|
|
4957
|
+
children: /* @__PURE__ */ jsx45(
|
|
4743
4958
|
"path",
|
|
4744
4959
|
{
|
|
4745
4960
|
fillRule: "evenodd",
|
|
@@ -4754,10 +4969,10 @@ var BanIcon = memo15(({ className, ...props }) => {
|
|
|
4754
4969
|
BanIcon.displayName = "BanIcon";
|
|
4755
4970
|
|
|
4756
4971
|
// src/components/tiptap-icons/highlighter-icon.tsx
|
|
4757
|
-
import { memo as
|
|
4758
|
-
import { jsx as
|
|
4759
|
-
var HighlighterIcon =
|
|
4760
|
-
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(
|
|
4761
4976
|
"svg",
|
|
4762
4977
|
{
|
|
4763
4978
|
width: "24",
|
|
@@ -4767,7 +4982,7 @@ var HighlighterIcon = memo16(({ className, ...props }) => {
|
|
|
4767
4982
|
fill: "currentColor",
|
|
4768
4983
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4769
4984
|
...props,
|
|
4770
|
-
children: /* @__PURE__ */
|
|
4985
|
+
children: /* @__PURE__ */ jsx46(
|
|
4771
4986
|
"path",
|
|
4772
4987
|
{
|
|
4773
4988
|
fillRule: "evenodd",
|
|
@@ -4783,16 +4998,16 @@ HighlighterIcon.displayName = "HighlighterIcon";
|
|
|
4783
4998
|
|
|
4784
4999
|
// src/components/tiptap-ui-primitive/popover/popover.tsx
|
|
4785
5000
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4786
|
-
import { jsx as
|
|
5001
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4787
5002
|
function Popover({
|
|
4788
5003
|
...props
|
|
4789
5004
|
}) {
|
|
4790
|
-
return /* @__PURE__ */
|
|
5005
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Root, { ...props });
|
|
4791
5006
|
}
|
|
4792
5007
|
function PopoverTrigger({
|
|
4793
5008
|
...props
|
|
4794
5009
|
}) {
|
|
4795
|
-
return /* @__PURE__ */
|
|
5010
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Trigger, { ...props });
|
|
4796
5011
|
}
|
|
4797
5012
|
function PopoverContent({
|
|
4798
5013
|
className,
|
|
@@ -4800,7 +5015,7 @@ function PopoverContent({
|
|
|
4800
5015
|
sideOffset = 4,
|
|
4801
5016
|
...props
|
|
4802
5017
|
}) {
|
|
4803
|
-
return /* @__PURE__ */
|
|
5018
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx47(
|
|
4804
5019
|
PopoverPrimitive.Content,
|
|
4805
5020
|
{
|
|
4806
5021
|
align,
|
|
@@ -4812,12 +5027,12 @@ function PopoverContent({
|
|
|
4812
5027
|
}
|
|
4813
5028
|
|
|
4814
5029
|
// src/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx
|
|
4815
|
-
import { forwardRef as forwardRef13, useCallback as
|
|
4816
|
-
import { Fragment as Fragment7, jsx 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";
|
|
4817
5032
|
function ColorHighlightShortcutBadge({
|
|
4818
5033
|
shortcutKeys = COLOR_HIGHLIGHT_SHORTCUT_KEY
|
|
4819
5034
|
}) {
|
|
4820
|
-
return /* @__PURE__ */
|
|
5035
|
+
return /* @__PURE__ */ jsx48(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4821
5036
|
}
|
|
4822
5037
|
var ColorHighlightButton = forwardRef13(
|
|
4823
5038
|
({
|
|
@@ -4849,7 +5064,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4849
5064
|
mode,
|
|
4850
5065
|
onApplied
|
|
4851
5066
|
});
|
|
4852
|
-
const handleClick =
|
|
5067
|
+
const handleClick = useCallback16(
|
|
4853
5068
|
(event) => {
|
|
4854
5069
|
onClick?.(event);
|
|
4855
5070
|
if (event.defaultPrevented) return;
|
|
@@ -4857,7 +5072,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4857
5072
|
},
|
|
4858
5073
|
[handleColorHighlight, onClick]
|
|
4859
5074
|
);
|
|
4860
|
-
const buttonStyle =
|
|
5075
|
+
const buttonStyle = useMemo8(
|
|
4861
5076
|
() => ({
|
|
4862
5077
|
...style,
|
|
4863
5078
|
"--highlight-color": highlightColor
|
|
@@ -4867,7 +5082,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4867
5082
|
if (!isVisible) {
|
|
4868
5083
|
return null;
|
|
4869
5084
|
}
|
|
4870
|
-
return /* @__PURE__ */
|
|
5085
|
+
return /* @__PURE__ */ jsx48(
|
|
4871
5086
|
Button2,
|
|
4872
5087
|
{
|
|
4873
5088
|
type: "button",
|
|
@@ -4885,15 +5100,15 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4885
5100
|
...buttonProps,
|
|
4886
5101
|
ref,
|
|
4887
5102
|
children: children ?? /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
4888
|
-
/* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ jsx48(
|
|
4889
5104
|
"span",
|
|
4890
5105
|
{
|
|
4891
5106
|
className: "tiptap-button-highlight",
|
|
4892
5107
|
style: { "--highlight-color": highlightColor }
|
|
4893
5108
|
}
|
|
4894
5109
|
),
|
|
4895
|
-
text && /* @__PURE__ */
|
|
4896
|
-
showShortcut && /* @__PURE__ */
|
|
5110
|
+
text && /* @__PURE__ */ jsx48("span", { className: "tiptap-button-text", children: text }),
|
|
5111
|
+
showShortcut && /* @__PURE__ */ jsx48(ColorHighlightShortcutBadge, { shortcutKeys })
|
|
4897
5112
|
] })
|
|
4898
5113
|
}
|
|
4899
5114
|
);
|
|
@@ -4902,7 +5117,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4902
5117
|
ColorHighlightButton.displayName = "ColorHighlightButton";
|
|
4903
5118
|
|
|
4904
5119
|
// src/components/tiptap-ui/color-highlight-button/use-color-highlight.ts
|
|
4905
|
-
import { useCallback as
|
|
5120
|
+
import { useCallback as useCallback17, useEffect as useEffect12, useState as useState18 } from "react";
|
|
4906
5121
|
import { useHotkeys as useHotkeys2 } from "react-hotkeys-hook";
|
|
4907
5122
|
var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
4908
5123
|
var HIGHLIGHT_COLORS = [
|
|
@@ -5047,7 +5262,7 @@ function useColorHighlight(config) {
|
|
|
5047
5262
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
5048
5263
|
};
|
|
5049
5264
|
}, [editor, hideWhenUnavailable, mode]);
|
|
5050
|
-
const handleColorHighlight =
|
|
5265
|
+
const handleColorHighlight = useCallback17(() => {
|
|
5051
5266
|
if (!editor || !canColorHighlightState || !highlightColor || !label)
|
|
5052
5267
|
return false;
|
|
5053
5268
|
if (mode === "mark") {
|
|
@@ -5075,7 +5290,7 @@ function useColorHighlight(config) {
|
|
|
5075
5290
|
return success;
|
|
5076
5291
|
}
|
|
5077
5292
|
}, [canColorHighlightState, highlightColor, editor, label, onApplied, mode]);
|
|
5078
|
-
const handleRemoveHighlight =
|
|
5293
|
+
const handleRemoveHighlight = useCallback17(() => {
|
|
5079
5294
|
const success = removeHighlight(editor, mode);
|
|
5080
5295
|
if (success) {
|
|
5081
5296
|
onApplied?.({ color: "", label: "Remove highlight", mode });
|
|
@@ -5108,8 +5323,8 @@ function useColorHighlight(config) {
|
|
|
5108
5323
|
}
|
|
5109
5324
|
|
|
5110
5325
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
5111
|
-
import { jsx as
|
|
5112
|
-
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(
|
|
5113
5328
|
Button2,
|
|
5114
5329
|
{
|
|
5115
5330
|
type: "button",
|
|
@@ -5122,7 +5337,7 @@ var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props
|
|
|
5122
5337
|
tooltip: "Highlight",
|
|
5123
5338
|
ref,
|
|
5124
5339
|
...props,
|
|
5125
|
-
children: children ?? /* @__PURE__ */
|
|
5340
|
+
children: children ?? /* @__PURE__ */ jsx49(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
5126
5341
|
}
|
|
5127
5342
|
));
|
|
5128
5343
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
@@ -5138,8 +5353,8 @@ function ColorHighlightPopoverContent({
|
|
|
5138
5353
|
}) {
|
|
5139
5354
|
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
5140
5355
|
const isMobile = useIsBreakpoint();
|
|
5141
|
-
const containerRef =
|
|
5142
|
-
const menuItems =
|
|
5356
|
+
const containerRef = useRef6(null);
|
|
5357
|
+
const menuItems = useMemo9(
|
|
5143
5358
|
() => [...colors, { label: "Remove highlight", value: "none" }],
|
|
5144
5359
|
[colors]
|
|
5145
5360
|
);
|
|
@@ -5158,14 +5373,14 @@ function ColorHighlightPopoverContent({
|
|
|
5158
5373
|
},
|
|
5159
5374
|
autoSelectFirstItem: false
|
|
5160
5375
|
});
|
|
5161
|
-
return /* @__PURE__ */
|
|
5376
|
+
return /* @__PURE__ */ jsx49(
|
|
5162
5377
|
Card,
|
|
5163
5378
|
{
|
|
5164
5379
|
ref: containerRef,
|
|
5165
5380
|
tabIndex: 0,
|
|
5166
5381
|
style: isMobile ? { boxShadow: "none", border: 0 } : {},
|
|
5167
|
-
children: /* @__PURE__ */
|
|
5168
|
-
/* @__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(
|
|
5169
5384
|
ColorHighlightButton,
|
|
5170
5385
|
{
|
|
5171
5386
|
editor,
|
|
@@ -5177,8 +5392,8 @@ function ColorHighlightPopoverContent({
|
|
|
5177
5392
|
},
|
|
5178
5393
|
color.value
|
|
5179
5394
|
)) }),
|
|
5180
|
-
/* @__PURE__ */
|
|
5181
|
-
/* @__PURE__ */
|
|
5395
|
+
/* @__PURE__ */ jsx49(Separator3, {}),
|
|
5396
|
+
/* @__PURE__ */ jsx49(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx49(
|
|
5182
5397
|
Button2,
|
|
5183
5398
|
{
|
|
5184
5399
|
onClick: handleRemoveHighlight,
|
|
@@ -5189,7 +5404,7 @@ function ColorHighlightPopoverContent({
|
|
|
5189
5404
|
role: "menuitem",
|
|
5190
5405
|
"data-style": "ghost",
|
|
5191
5406
|
"data-highlighted": selectedIndex === colors.length,
|
|
5192
|
-
children: /* @__PURE__ */
|
|
5407
|
+
children: /* @__PURE__ */ jsx49(BanIcon, { className: "tiptap-button-icon" })
|
|
5193
5408
|
}
|
|
5194
5409
|
) })
|
|
5195
5410
|
] }) })
|
|
@@ -5198,13 +5413,13 @@ function ColorHighlightPopoverContent({
|
|
|
5198
5413
|
}
|
|
5199
5414
|
|
|
5200
5415
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5201
|
-
import { forwardRef as forwardRef15, useCallback as
|
|
5416
|
+
import { forwardRef as forwardRef15, useCallback as useCallback18, useEffect as useEffect13, useState as useState20 } from "react";
|
|
5202
5417
|
|
|
5203
5418
|
// src/components/tiptap-icons/corner-down-left-icon.tsx
|
|
5204
|
-
import { memo as
|
|
5205
|
-
import { jsx as
|
|
5206
|
-
var CornerDownLeftIcon =
|
|
5207
|
-
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(
|
|
5208
5423
|
"svg",
|
|
5209
5424
|
{
|
|
5210
5425
|
width: "24",
|
|
@@ -5214,7 +5429,7 @@ var CornerDownLeftIcon = memo17(({ className, ...props }) => {
|
|
|
5214
5429
|
fill: "currentColor",
|
|
5215
5430
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5216
5431
|
...props,
|
|
5217
|
-
children: /* @__PURE__ */
|
|
5432
|
+
children: /* @__PURE__ */ jsx50(
|
|
5218
5433
|
"path",
|
|
5219
5434
|
{
|
|
5220
5435
|
fillRule: "evenodd",
|
|
@@ -5229,9 +5444,9 @@ var CornerDownLeftIcon = memo17(({ className, ...props }) => {
|
|
|
5229
5444
|
CornerDownLeftIcon.displayName = "CornerDownLeftIcon";
|
|
5230
5445
|
|
|
5231
5446
|
// src/components/tiptap-icons/external-link-icon.tsx
|
|
5232
|
-
import { memo as
|
|
5233
|
-
import { jsx as
|
|
5234
|
-
var ExternalLinkIcon =
|
|
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 }) => {
|
|
5235
5450
|
return /* @__PURE__ */ jsxs28(
|
|
5236
5451
|
"svg",
|
|
5237
5452
|
{
|
|
@@ -5243,14 +5458,14 @@ var ExternalLinkIcon = memo18(({ className, ...props }) => {
|
|
|
5243
5458
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5244
5459
|
...props,
|
|
5245
5460
|
children: [
|
|
5246
|
-
/* @__PURE__ */
|
|
5461
|
+
/* @__PURE__ */ jsx51(
|
|
5247
5462
|
"path",
|
|
5248
5463
|
{
|
|
5249
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",
|
|
5250
5465
|
fill: "currentColor"
|
|
5251
5466
|
}
|
|
5252
5467
|
),
|
|
5253
|
-
/* @__PURE__ */
|
|
5468
|
+
/* @__PURE__ */ jsx51(
|
|
5254
5469
|
"path",
|
|
5255
5470
|
{
|
|
5256
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",
|
|
@@ -5264,9 +5479,9 @@ var ExternalLinkIcon = memo18(({ className, ...props }) => {
|
|
|
5264
5479
|
ExternalLinkIcon.displayName = "ExternalLinkIcon";
|
|
5265
5480
|
|
|
5266
5481
|
// src/components/tiptap-icons/link-icon.tsx
|
|
5267
|
-
import { memo as
|
|
5268
|
-
import { jsx as
|
|
5269
|
-
var LinkIcon =
|
|
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 }) => {
|
|
5270
5485
|
return /* @__PURE__ */ jsxs29(
|
|
5271
5486
|
"svg",
|
|
5272
5487
|
{
|
|
@@ -5278,14 +5493,14 @@ var LinkIcon = memo19(({ className, ...props }) => {
|
|
|
5278
5493
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5279
5494
|
...props,
|
|
5280
5495
|
children: [
|
|
5281
|
-
/* @__PURE__ */
|
|
5496
|
+
/* @__PURE__ */ jsx52(
|
|
5282
5497
|
"path",
|
|
5283
5498
|
{
|
|
5284
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",
|
|
5285
5500
|
fill: "currentColor"
|
|
5286
5501
|
}
|
|
5287
5502
|
),
|
|
5288
|
-
/* @__PURE__ */
|
|
5503
|
+
/* @__PURE__ */ jsx52(
|
|
5289
5504
|
"path",
|
|
5290
5505
|
{
|
|
5291
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",
|
|
@@ -5299,10 +5514,10 @@ var LinkIcon = memo19(({ className, ...props }) => {
|
|
|
5299
5514
|
LinkIcon.displayName = "LinkIcon";
|
|
5300
5515
|
|
|
5301
5516
|
// src/components/tiptap-icons/trash-icon.tsx
|
|
5302
|
-
import { memo as
|
|
5303
|
-
import { jsx as
|
|
5304
|
-
var TrashIcon =
|
|
5305
|
-
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(
|
|
5306
5521
|
"svg",
|
|
5307
5522
|
{
|
|
5308
5523
|
width: "24",
|
|
@@ -5312,7 +5527,7 @@ var TrashIcon = memo20(({ className, ...props }) => {
|
|
|
5312
5527
|
fill: "currentColor",
|
|
5313
5528
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5314
5529
|
...props,
|
|
5315
|
-
children: /* @__PURE__ */
|
|
5530
|
+
children: /* @__PURE__ */ jsx53(
|
|
5316
5531
|
"path",
|
|
5317
5532
|
{
|
|
5318
5533
|
fillRule: "evenodd",
|
|
@@ -5327,23 +5542,23 @@ var TrashIcon = memo20(({ className, ...props }) => {
|
|
|
5327
5542
|
TrashIcon.displayName = "TrashIcon";
|
|
5328
5543
|
|
|
5329
5544
|
// src/components/tiptap-ui-primitive/input/input.tsx
|
|
5330
|
-
import { jsx as
|
|
5545
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
5331
5546
|
function Input2({ className, type, ...props }) {
|
|
5332
|
-
return /* @__PURE__ */
|
|
5547
|
+
return /* @__PURE__ */ jsx54("input", { type, className: cn2("tiptap-input", className), ...props });
|
|
5333
5548
|
}
|
|
5334
5549
|
function InputGroup({
|
|
5335
5550
|
className,
|
|
5336
5551
|
children,
|
|
5337
5552
|
...props
|
|
5338
5553
|
}) {
|
|
5339
|
-
return /* @__PURE__ */
|
|
5554
|
+
return /* @__PURE__ */ jsx54("div", { className: cn2("tiptap-input-group", className), ...props, children });
|
|
5340
5555
|
}
|
|
5341
5556
|
|
|
5342
5557
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5343
|
-
import { jsx as
|
|
5558
|
+
import { jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5344
5559
|
var LinkButton = forwardRef15(
|
|
5345
5560
|
({ className, children, ...props }, ref) => {
|
|
5346
|
-
return /* @__PURE__ */
|
|
5561
|
+
return /* @__PURE__ */ jsx55(
|
|
5347
5562
|
Button2,
|
|
5348
5563
|
{
|
|
5349
5564
|
type: "button",
|
|
@@ -5355,7 +5570,7 @@ var LinkButton = forwardRef15(
|
|
|
5355
5570
|
tooltip: "Link",
|
|
5356
5571
|
ref,
|
|
5357
5572
|
...props,
|
|
5358
|
-
children: children || /* @__PURE__ */
|
|
5573
|
+
children: children || /* @__PURE__ */ jsx55(LinkIcon, { className: "tiptap-button-icon" })
|
|
5359
5574
|
}
|
|
5360
5575
|
);
|
|
5361
5576
|
}
|
|
@@ -5376,20 +5591,20 @@ var LinkMain = ({
|
|
|
5376
5591
|
setLink();
|
|
5377
5592
|
}
|
|
5378
5593
|
};
|
|
5379
|
-
return /* @__PURE__ */
|
|
5594
|
+
return /* @__PURE__ */ jsx55(
|
|
5380
5595
|
Card,
|
|
5381
5596
|
{
|
|
5382
5597
|
style: {
|
|
5383
5598
|
...isMobile ? { boxShadow: "none", border: 0 } : {}
|
|
5384
5599
|
},
|
|
5385
|
-
children: /* @__PURE__ */
|
|
5600
|
+
children: /* @__PURE__ */ jsx55(
|
|
5386
5601
|
CardBody,
|
|
5387
5602
|
{
|
|
5388
5603
|
style: {
|
|
5389
5604
|
...isMobile ? { padding: 0 } : {}
|
|
5390
5605
|
},
|
|
5391
5606
|
children: /* @__PURE__ */ jsxs30(CardItemGroup, { orientation: "horizontal", children: [
|
|
5392
|
-
/* @__PURE__ */
|
|
5607
|
+
/* @__PURE__ */ jsx55(InputGroup, { children: /* @__PURE__ */ jsx55(
|
|
5393
5608
|
Input2,
|
|
5394
5609
|
{
|
|
5395
5610
|
type: "url",
|
|
@@ -5403,7 +5618,7 @@ var LinkMain = ({
|
|
|
5403
5618
|
autoCapitalize: "off"
|
|
5404
5619
|
}
|
|
5405
5620
|
) }),
|
|
5406
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ jsx55(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx55(
|
|
5407
5622
|
Button2,
|
|
5408
5623
|
{
|
|
5409
5624
|
type: "button",
|
|
@@ -5411,12 +5626,12 @@ var LinkMain = ({
|
|
|
5411
5626
|
title: "Apply link",
|
|
5412
5627
|
disabled: !url && !isActive,
|
|
5413
5628
|
"data-style": "ghost",
|
|
5414
|
-
children: /* @__PURE__ */
|
|
5629
|
+
children: /* @__PURE__ */ jsx55(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
5415
5630
|
}
|
|
5416
5631
|
) }),
|
|
5417
|
-
/* @__PURE__ */
|
|
5632
|
+
/* @__PURE__ */ jsx55(Separator3, {}),
|
|
5418
5633
|
/* @__PURE__ */ jsxs30(ButtonGroup, { orientation: "horizontal", children: [
|
|
5419
|
-
/* @__PURE__ */
|
|
5634
|
+
/* @__PURE__ */ jsx55(
|
|
5420
5635
|
Button2,
|
|
5421
5636
|
{
|
|
5422
5637
|
type: "button",
|
|
@@ -5424,10 +5639,10 @@ var LinkMain = ({
|
|
|
5424
5639
|
title: "Open in new window",
|
|
5425
5640
|
disabled: !url && !isActive,
|
|
5426
5641
|
"data-style": "ghost",
|
|
5427
|
-
children: /* @__PURE__ */
|
|
5642
|
+
children: /* @__PURE__ */ jsx55(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
5428
5643
|
}
|
|
5429
5644
|
),
|
|
5430
|
-
/* @__PURE__ */
|
|
5645
|
+
/* @__PURE__ */ jsx55(
|
|
5431
5646
|
Button2,
|
|
5432
5647
|
{
|
|
5433
5648
|
type: "button",
|
|
@@ -5435,7 +5650,7 @@ var LinkMain = ({
|
|
|
5435
5650
|
title: "Remove link",
|
|
5436
5651
|
disabled: !url && !isActive,
|
|
5437
5652
|
"data-style": "ghost",
|
|
5438
|
-
children: /* @__PURE__ */
|
|
5653
|
+
children: /* @__PURE__ */ jsx55(TrashIcon, { className: "tiptap-button-icon" })
|
|
5439
5654
|
}
|
|
5440
5655
|
)
|
|
5441
5656
|
] })
|
|
@@ -5449,7 +5664,7 @@ var LinkContent = ({ editor }) => {
|
|
|
5449
5664
|
const linkPopover = useLinkPopover({
|
|
5450
5665
|
editor
|
|
5451
5666
|
});
|
|
5452
|
-
return /* @__PURE__ */
|
|
5667
|
+
return /* @__PURE__ */ jsx55(LinkMain, { ...linkPopover });
|
|
5453
5668
|
};
|
|
5454
5669
|
var LinkPopover = forwardRef15(
|
|
5455
5670
|
({
|
|
@@ -5480,18 +5695,18 @@ var LinkPopover = forwardRef15(
|
|
|
5480
5695
|
hideWhenUnavailable,
|
|
5481
5696
|
onSetLink
|
|
5482
5697
|
});
|
|
5483
|
-
const handleOnOpenChange =
|
|
5698
|
+
const handleOnOpenChange = useCallback18(
|
|
5484
5699
|
(nextIsOpen) => {
|
|
5485
5700
|
setIsOpen(nextIsOpen);
|
|
5486
5701
|
onOpenChange?.(nextIsOpen);
|
|
5487
5702
|
},
|
|
5488
5703
|
[onOpenChange]
|
|
5489
5704
|
);
|
|
5490
|
-
const handleSetLink =
|
|
5705
|
+
const handleSetLink = useCallback18(() => {
|
|
5491
5706
|
setLink();
|
|
5492
5707
|
setIsOpen(false);
|
|
5493
5708
|
}, [setLink]);
|
|
5494
|
-
const handleClick =
|
|
5709
|
+
const handleClick = useCallback18(
|
|
5495
5710
|
(event) => {
|
|
5496
5711
|
onClick?.(event);
|
|
5497
5712
|
if (event.defaultPrevented) return;
|
|
@@ -5508,7 +5723,7 @@ var LinkPopover = forwardRef15(
|
|
|
5508
5723
|
return null;
|
|
5509
5724
|
}
|
|
5510
5725
|
return /* @__PURE__ */ jsxs30(Popover, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
5511
|
-
/* @__PURE__ */
|
|
5726
|
+
/* @__PURE__ */ jsx55(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
5512
5727
|
LinkButton,
|
|
5513
5728
|
{
|
|
5514
5729
|
disabled: !canSet,
|
|
@@ -5519,10 +5734,10 @@ var LinkPopover = forwardRef15(
|
|
|
5519
5734
|
onClick: handleClick,
|
|
5520
5735
|
...buttonProps,
|
|
5521
5736
|
ref,
|
|
5522
|
-
children: children ?? /* @__PURE__ */
|
|
5737
|
+
children: children ?? /* @__PURE__ */ jsx55(Icon, { className: "tiptap-button-icon" })
|
|
5523
5738
|
}
|
|
5524
5739
|
) }),
|
|
5525
|
-
/* @__PURE__ */
|
|
5740
|
+
/* @__PURE__ */ jsx55(PopoverContent, { children: /* @__PURE__ */ jsx55(
|
|
5526
5741
|
LinkMain,
|
|
5527
5742
|
{
|
|
5528
5743
|
url,
|
|
@@ -5539,7 +5754,7 @@ var LinkPopover = forwardRef15(
|
|
|
5539
5754
|
LinkPopover.displayName = "LinkPopover";
|
|
5540
5755
|
|
|
5541
5756
|
// src/components/tiptap-ui/link-popover/use-link-popover.ts
|
|
5542
|
-
import { useCallback as
|
|
5757
|
+
import { useCallback as useCallback19, useEffect as useEffect14, useState as useState21 } from "react";
|
|
5543
5758
|
function canSetLink(editor) {
|
|
5544
5759
|
if (!editor || !editor.isEditable) return false;
|
|
5545
5760
|
if (isNodeTypeSelected(editor, ["image"], true)) return false;
|
|
@@ -5581,7 +5796,7 @@ function useLinkHandler(props) {
|
|
|
5581
5796
|
editor.off("selectionUpdate", updateLinkState);
|
|
5582
5797
|
};
|
|
5583
5798
|
}, [editor]);
|
|
5584
|
-
const setLink =
|
|
5799
|
+
const setLink = useCallback19(() => {
|
|
5585
5800
|
if (!url || !editor) return;
|
|
5586
5801
|
const { selection } = editor.state;
|
|
5587
5802
|
const isEmpty = selection.empty;
|
|
@@ -5594,12 +5809,12 @@ function useLinkHandler(props) {
|
|
|
5594
5809
|
setUrl(null);
|
|
5595
5810
|
onSetLink?.();
|
|
5596
5811
|
}, [editor, onSetLink, url]);
|
|
5597
|
-
const removeLink =
|
|
5812
|
+
const removeLink = useCallback19(() => {
|
|
5598
5813
|
if (!editor) return;
|
|
5599
5814
|
editor.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink", true).run();
|
|
5600
5815
|
setUrl("");
|
|
5601
5816
|
}, [editor]);
|
|
5602
|
-
const openLink =
|
|
5817
|
+
const openLink = useCallback19(
|
|
5603
5818
|
(target = "_blank", features = "noopener,noreferrer") => {
|
|
5604
5819
|
if (!url) return;
|
|
5605
5820
|
const safeUrl = sanitizeUrl(url, window.location.href);
|
|
@@ -5670,13 +5885,13 @@ function useLinkPopover(config) {
|
|
|
5670
5885
|
}
|
|
5671
5886
|
|
|
5672
5887
|
// src/components/tiptap-ui/mark-button/mark-button.tsx
|
|
5673
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
5674
|
-
import { Fragment as Fragment8, jsx 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";
|
|
5675
5890
|
function MarkShortcutBadge({
|
|
5676
5891
|
type,
|
|
5677
5892
|
shortcutKeys = MARK_SHORTCUT_KEYS[type]
|
|
5678
5893
|
}) {
|
|
5679
|
-
return /* @__PURE__ */
|
|
5894
|
+
return /* @__PURE__ */ jsx56(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
5680
5895
|
}
|
|
5681
5896
|
var MarkButton = forwardRef16(
|
|
5682
5897
|
({
|
|
@@ -5705,7 +5920,7 @@ var MarkButton = forwardRef16(
|
|
|
5705
5920
|
hideWhenUnavailable,
|
|
5706
5921
|
onToggled
|
|
5707
5922
|
});
|
|
5708
|
-
const handleClick =
|
|
5923
|
+
const handleClick = useCallback20(
|
|
5709
5924
|
(event) => {
|
|
5710
5925
|
onClick?.(event);
|
|
5711
5926
|
if (event.defaultPrevented) return;
|
|
@@ -5716,7 +5931,7 @@ var MarkButton = forwardRef16(
|
|
|
5716
5931
|
if (!isVisible) {
|
|
5717
5932
|
return null;
|
|
5718
5933
|
}
|
|
5719
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ jsx56(
|
|
5720
5935
|
Button2,
|
|
5721
5936
|
{
|
|
5722
5937
|
type: "button",
|
|
@@ -5733,9 +5948,9 @@ var MarkButton = forwardRef16(
|
|
|
5733
5948
|
...buttonProps,
|
|
5734
5949
|
ref,
|
|
5735
5950
|
children: children ?? /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
5736
|
-
/* @__PURE__ */
|
|
5737
|
-
text && /* @__PURE__ */
|
|
5738
|
-
showShortcut && /* @__PURE__ */
|
|
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 })
|
|
5739
5954
|
] })
|
|
5740
5955
|
}
|
|
5741
5956
|
);
|
|
@@ -5744,13 +5959,13 @@ var MarkButton = forwardRef16(
|
|
|
5744
5959
|
MarkButton.displayName = "MarkButton";
|
|
5745
5960
|
|
|
5746
5961
|
// src/components/tiptap-ui/mark-button/use-mark.ts
|
|
5747
|
-
import { useCallback as
|
|
5962
|
+
import { useCallback as useCallback21, useEffect as useEffect15, useState as useState22 } from "react";
|
|
5748
5963
|
|
|
5749
5964
|
// src/components/tiptap-icons/bold-icon.tsx
|
|
5750
|
-
import { memo as
|
|
5751
|
-
import { jsx as
|
|
5752
|
-
var BoldIcon =
|
|
5753
|
-
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(
|
|
5754
5969
|
"svg",
|
|
5755
5970
|
{
|
|
5756
5971
|
width: "24",
|
|
@@ -5760,7 +5975,7 @@ var BoldIcon = memo21(({ className, ...props }) => {
|
|
|
5760
5975
|
fill: "currentColor",
|
|
5761
5976
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5762
5977
|
...props,
|
|
5763
|
-
children: /* @__PURE__ */
|
|
5978
|
+
children: /* @__PURE__ */ jsx57(
|
|
5764
5979
|
"path",
|
|
5765
5980
|
{
|
|
5766
5981
|
fillRule: "evenodd",
|
|
@@ -5775,9 +5990,9 @@ var BoldIcon = memo21(({ className, ...props }) => {
|
|
|
5775
5990
|
BoldIcon.displayName = "BoldIcon";
|
|
5776
5991
|
|
|
5777
5992
|
// src/components/tiptap-icons/code2-icon.tsx
|
|
5778
|
-
import { memo as
|
|
5779
|
-
import { jsx as
|
|
5780
|
-
var Code2Icon =
|
|
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 }) => {
|
|
5781
5996
|
return /* @__PURE__ */ jsxs32(
|
|
5782
5997
|
"svg",
|
|
5783
5998
|
{
|
|
@@ -5789,21 +6004,21 @@ var Code2Icon = memo22(({ className, ...props }) => {
|
|
|
5789
6004
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5790
6005
|
...props,
|
|
5791
6006
|
children: [
|
|
5792
|
-
/* @__PURE__ */
|
|
6007
|
+
/* @__PURE__ */ jsx58(
|
|
5793
6008
|
"path",
|
|
5794
6009
|
{
|
|
5795
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",
|
|
5796
6011
|
fill: "currentColor"
|
|
5797
6012
|
}
|
|
5798
6013
|
),
|
|
5799
|
-
/* @__PURE__ */
|
|
6014
|
+
/* @__PURE__ */ jsx58(
|
|
5800
6015
|
"path",
|
|
5801
6016
|
{
|
|
5802
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",
|
|
5803
6018
|
fill: "currentColor"
|
|
5804
6019
|
}
|
|
5805
6020
|
),
|
|
5806
|
-
/* @__PURE__ */
|
|
6021
|
+
/* @__PURE__ */ jsx58(
|
|
5807
6022
|
"path",
|
|
5808
6023
|
{
|
|
5809
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",
|
|
@@ -5817,10 +6032,10 @@ var Code2Icon = memo22(({ className, ...props }) => {
|
|
|
5817
6032
|
Code2Icon.displayName = "Code2Icon";
|
|
5818
6033
|
|
|
5819
6034
|
// src/components/tiptap-icons/italic-icon.tsx
|
|
5820
|
-
import { memo as
|
|
5821
|
-
import { jsx as
|
|
5822
|
-
var ItalicIcon =
|
|
5823
|
-
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(
|
|
5824
6039
|
"svg",
|
|
5825
6040
|
{
|
|
5826
6041
|
width: "24",
|
|
@@ -5830,7 +6045,7 @@ var ItalicIcon = memo23(({ className, ...props }) => {
|
|
|
5830
6045
|
fill: "currentColor",
|
|
5831
6046
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5832
6047
|
...props,
|
|
5833
|
-
children: /* @__PURE__ */
|
|
6048
|
+
children: /* @__PURE__ */ jsx59(
|
|
5834
6049
|
"path",
|
|
5835
6050
|
{
|
|
5836
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",
|
|
@@ -5843,9 +6058,9 @@ var ItalicIcon = memo23(({ className, ...props }) => {
|
|
|
5843
6058
|
ItalicIcon.displayName = "ItalicIcon";
|
|
5844
6059
|
|
|
5845
6060
|
// src/components/tiptap-icons/strike-icon.tsx
|
|
5846
|
-
import { memo as
|
|
5847
|
-
import { jsx as
|
|
5848
|
-
var StrikeIcon =
|
|
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 }) => {
|
|
5849
6064
|
return /* @__PURE__ */ jsxs33(
|
|
5850
6065
|
"svg",
|
|
5851
6066
|
{
|
|
@@ -5857,14 +6072,14 @@ var StrikeIcon = memo24(({ className, ...props }) => {
|
|
|
5857
6072
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5858
6073
|
...props,
|
|
5859
6074
|
children: [
|
|
5860
|
-
/* @__PURE__ */
|
|
6075
|
+
/* @__PURE__ */ jsx60(
|
|
5861
6076
|
"path",
|
|
5862
6077
|
{
|
|
5863
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",
|
|
5864
6079
|
fill: "currentColor"
|
|
5865
6080
|
}
|
|
5866
6081
|
),
|
|
5867
|
-
/* @__PURE__ */
|
|
6082
|
+
/* @__PURE__ */ jsx60(
|
|
5868
6083
|
"path",
|
|
5869
6084
|
{
|
|
5870
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",
|
|
@@ -5878,9 +6093,9 @@ var StrikeIcon = memo24(({ className, ...props }) => {
|
|
|
5878
6093
|
StrikeIcon.displayName = "StrikeIcon";
|
|
5879
6094
|
|
|
5880
6095
|
// src/components/tiptap-icons/subscript-icon.tsx
|
|
5881
|
-
import { memo as
|
|
5882
|
-
import { jsx as
|
|
5883
|
-
var SubscriptIcon =
|
|
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 }) => {
|
|
5884
6099
|
return /* @__PURE__ */ jsxs34(
|
|
5885
6100
|
"svg",
|
|
5886
6101
|
{
|
|
@@ -5892,7 +6107,7 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5892
6107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5893
6108
|
...props,
|
|
5894
6109
|
children: [
|
|
5895
|
-
/* @__PURE__ */
|
|
6110
|
+
/* @__PURE__ */ jsx61(
|
|
5896
6111
|
"path",
|
|
5897
6112
|
{
|
|
5898
6113
|
fillRule: "evenodd",
|
|
@@ -5901,7 +6116,7 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5901
6116
|
fill: "currentColor"
|
|
5902
6117
|
}
|
|
5903
6118
|
),
|
|
5904
|
-
/* @__PURE__ */
|
|
6119
|
+
/* @__PURE__ */ jsx61(
|
|
5905
6120
|
"path",
|
|
5906
6121
|
{
|
|
5907
6122
|
fillRule: "evenodd",
|
|
@@ -5910,7 +6125,7 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5910
6125
|
fill: "currentColor"
|
|
5911
6126
|
}
|
|
5912
6127
|
),
|
|
5913
|
-
/* @__PURE__ */
|
|
6128
|
+
/* @__PURE__ */ jsx61(
|
|
5914
6129
|
"path",
|
|
5915
6130
|
{
|
|
5916
6131
|
fillRule: "evenodd",
|
|
@@ -5926,9 +6141,9 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5926
6141
|
SubscriptIcon.displayName = "SubscriptIcon";
|
|
5927
6142
|
|
|
5928
6143
|
// src/components/tiptap-icons/superscript-icon.tsx
|
|
5929
|
-
import { memo as
|
|
5930
|
-
import { jsx as
|
|
5931
|
-
var SuperscriptIcon =
|
|
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 }) => {
|
|
5932
6147
|
return /* @__PURE__ */ jsxs35(
|
|
5933
6148
|
"svg",
|
|
5934
6149
|
{
|
|
@@ -5940,7 +6155,7 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5940
6155
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5941
6156
|
...props,
|
|
5942
6157
|
children: [
|
|
5943
|
-
/* @__PURE__ */
|
|
6158
|
+
/* @__PURE__ */ jsx62(
|
|
5944
6159
|
"path",
|
|
5945
6160
|
{
|
|
5946
6161
|
fillRule: "evenodd",
|
|
@@ -5949,7 +6164,7 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5949
6164
|
fill: "currentColor"
|
|
5950
6165
|
}
|
|
5951
6166
|
),
|
|
5952
|
-
/* @__PURE__ */
|
|
6167
|
+
/* @__PURE__ */ jsx62(
|
|
5953
6168
|
"path",
|
|
5954
6169
|
{
|
|
5955
6170
|
fillRule: "evenodd",
|
|
@@ -5958,7 +6173,7 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5958
6173
|
fill: "currentColor"
|
|
5959
6174
|
}
|
|
5960
6175
|
),
|
|
5961
|
-
/* @__PURE__ */
|
|
6176
|
+
/* @__PURE__ */ jsx62(
|
|
5962
6177
|
"path",
|
|
5963
6178
|
{
|
|
5964
6179
|
fillRule: "evenodd",
|
|
@@ -5974,10 +6189,10 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5974
6189
|
SuperscriptIcon.displayName = "SuperscriptIcon";
|
|
5975
6190
|
|
|
5976
6191
|
// src/components/tiptap-icons/underline-icon.tsx
|
|
5977
|
-
import { memo as
|
|
5978
|
-
import { jsx as
|
|
5979
|
-
var UnderlineIcon =
|
|
5980
|
-
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(
|
|
5981
6196
|
"svg",
|
|
5982
6197
|
{
|
|
5983
6198
|
width: "24",
|
|
@@ -5987,7 +6202,7 @@ var UnderlineIcon = memo27(({ className, ...props }) => {
|
|
|
5987
6202
|
fill: "currentColor",
|
|
5988
6203
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5989
6204
|
...props,
|
|
5990
|
-
children: /* @__PURE__ */
|
|
6205
|
+
children: /* @__PURE__ */ jsx63(
|
|
5991
6206
|
"path",
|
|
5992
6207
|
{
|
|
5993
6208
|
fillRule: "evenodd",
|
|
@@ -6069,7 +6284,7 @@ function useMark(config) {
|
|
|
6069
6284
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6070
6285
|
};
|
|
6071
6286
|
}, [editor, type, hideWhenUnavailable]);
|
|
6072
|
-
const handleMark =
|
|
6287
|
+
const handleMark = useCallback21(() => {
|
|
6073
6288
|
if (!editor) return false;
|
|
6074
6289
|
const success = toggleMark(editor, type);
|
|
6075
6290
|
if (success) {
|
|
@@ -6089,13 +6304,13 @@ function useMark(config) {
|
|
|
6089
6304
|
}
|
|
6090
6305
|
|
|
6091
6306
|
// src/components/tiptap-ui/text-align-button/text-align-button.tsx
|
|
6092
|
-
import { forwardRef as forwardRef17, useCallback as
|
|
6093
|
-
import { Fragment as Fragment9, jsx 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";
|
|
6094
6309
|
function TextAlignShortcutBadge({
|
|
6095
6310
|
align,
|
|
6096
6311
|
shortcutKeys = TEXT_ALIGN_SHORTCUT_KEYS[align]
|
|
6097
6312
|
}) {
|
|
6098
|
-
return /* @__PURE__ */
|
|
6313
|
+
return /* @__PURE__ */ jsx64(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6099
6314
|
}
|
|
6100
6315
|
var TextAlignButton = forwardRef17(
|
|
6101
6316
|
({
|
|
@@ -6125,7 +6340,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6125
6340
|
hideWhenUnavailable,
|
|
6126
6341
|
onAligned
|
|
6127
6342
|
});
|
|
6128
|
-
const handleClick =
|
|
6343
|
+
const handleClick = useCallback22(
|
|
6129
6344
|
(event) => {
|
|
6130
6345
|
onClick?.(event);
|
|
6131
6346
|
if (event.defaultPrevented) return;
|
|
@@ -6137,7 +6352,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6137
6352
|
return null;
|
|
6138
6353
|
}
|
|
6139
6354
|
const RenderIcon = CustomIcon ?? Icon;
|
|
6140
|
-
return /* @__PURE__ */
|
|
6355
|
+
return /* @__PURE__ */ jsx64(
|
|
6141
6356
|
Button2,
|
|
6142
6357
|
{
|
|
6143
6358
|
type: "button",
|
|
@@ -6154,9 +6369,9 @@ var TextAlignButton = forwardRef17(
|
|
|
6154
6369
|
...buttonProps,
|
|
6155
6370
|
ref,
|
|
6156
6371
|
children: children ?? /* @__PURE__ */ jsxs36(Fragment9, { children: [
|
|
6157
|
-
/* @__PURE__ */
|
|
6158
|
-
text && /* @__PURE__ */
|
|
6159
|
-
showShortcut && /* @__PURE__ */
|
|
6372
|
+
/* @__PURE__ */ jsx64(RenderIcon, { className: "tiptap-button-icon" }),
|
|
6373
|
+
text && /* @__PURE__ */ jsx64("span", { className: "tiptap-button-text", children: text }),
|
|
6374
|
+
showShortcut && /* @__PURE__ */ jsx64(
|
|
6160
6375
|
TextAlignShortcutBadge,
|
|
6161
6376
|
{
|
|
6162
6377
|
align,
|
|
@@ -6171,12 +6386,12 @@ var TextAlignButton = forwardRef17(
|
|
|
6171
6386
|
TextAlignButton.displayName = "TextAlignButton";
|
|
6172
6387
|
|
|
6173
6388
|
// src/components/tiptap-ui/text-align-button/use-text-align.ts
|
|
6174
|
-
import { useCallback as
|
|
6389
|
+
import { useCallback as useCallback23, useEffect as useEffect16, useState as useState23 } from "react";
|
|
6175
6390
|
|
|
6176
6391
|
// src/components/tiptap-icons/align-center-icon.tsx
|
|
6177
|
-
import { memo as
|
|
6178
|
-
import { jsx as
|
|
6179
|
-
var AlignCenterIcon =
|
|
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 }) => {
|
|
6180
6395
|
return /* @__PURE__ */ jsxs37(
|
|
6181
6396
|
"svg",
|
|
6182
6397
|
{
|
|
@@ -6188,7 +6403,7 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6188
6403
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6189
6404
|
...props,
|
|
6190
6405
|
children: [
|
|
6191
|
-
/* @__PURE__ */
|
|
6406
|
+
/* @__PURE__ */ jsx65(
|
|
6192
6407
|
"path",
|
|
6193
6408
|
{
|
|
6194
6409
|
fillRule: "evenodd",
|
|
@@ -6197,7 +6412,7 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6197
6412
|
fill: "currentColor"
|
|
6198
6413
|
}
|
|
6199
6414
|
),
|
|
6200
|
-
/* @__PURE__ */
|
|
6415
|
+
/* @__PURE__ */ jsx65(
|
|
6201
6416
|
"path",
|
|
6202
6417
|
{
|
|
6203
6418
|
fillRule: "evenodd",
|
|
@@ -6206,7 +6421,7 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6206
6421
|
fill: "currentColor"
|
|
6207
6422
|
}
|
|
6208
6423
|
),
|
|
6209
|
-
/* @__PURE__ */
|
|
6424
|
+
/* @__PURE__ */ jsx65(
|
|
6210
6425
|
"path",
|
|
6211
6426
|
{
|
|
6212
6427
|
fillRule: "evenodd",
|
|
@@ -6222,9 +6437,9 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6222
6437
|
AlignCenterIcon.displayName = "AlignCenterIcon";
|
|
6223
6438
|
|
|
6224
6439
|
// src/components/tiptap-icons/align-justify-icon.tsx
|
|
6225
|
-
import { memo as
|
|
6226
|
-
import { jsx as
|
|
6227
|
-
var AlignJustifyIcon =
|
|
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 }) => {
|
|
6228
6443
|
return /* @__PURE__ */ jsxs38(
|
|
6229
6444
|
"svg",
|
|
6230
6445
|
{
|
|
@@ -6236,7 +6451,7 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6236
6451
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6237
6452
|
...props,
|
|
6238
6453
|
children: [
|
|
6239
|
-
/* @__PURE__ */
|
|
6454
|
+
/* @__PURE__ */ jsx66(
|
|
6240
6455
|
"path",
|
|
6241
6456
|
{
|
|
6242
6457
|
fillRule: "evenodd",
|
|
@@ -6245,7 +6460,7 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6245
6460
|
fill: "currentColor"
|
|
6246
6461
|
}
|
|
6247
6462
|
),
|
|
6248
|
-
/* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ jsx66(
|
|
6249
6464
|
"path",
|
|
6250
6465
|
{
|
|
6251
6466
|
fillRule: "evenodd",
|
|
@@ -6254,7 +6469,7 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6254
6469
|
fill: "currentColor"
|
|
6255
6470
|
}
|
|
6256
6471
|
),
|
|
6257
|
-
/* @__PURE__ */
|
|
6472
|
+
/* @__PURE__ */ jsx66(
|
|
6258
6473
|
"path",
|
|
6259
6474
|
{
|
|
6260
6475
|
fillRule: "evenodd",
|
|
@@ -6270,9 +6485,9 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6270
6485
|
AlignJustifyIcon.displayName = "AlignJustifyIcon";
|
|
6271
6486
|
|
|
6272
6487
|
// src/components/tiptap-icons/align-left-icon.tsx
|
|
6273
|
-
import { memo as
|
|
6274
|
-
import { jsx as
|
|
6275
|
-
var AlignLeftIcon =
|
|
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 }) => {
|
|
6276
6491
|
return /* @__PURE__ */ jsxs39(
|
|
6277
6492
|
"svg",
|
|
6278
6493
|
{
|
|
@@ -6284,7 +6499,7 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6284
6499
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6285
6500
|
...props,
|
|
6286
6501
|
children: [
|
|
6287
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx67(
|
|
6288
6503
|
"path",
|
|
6289
6504
|
{
|
|
6290
6505
|
fillRule: "evenodd",
|
|
@@ -6293,7 +6508,7 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6293
6508
|
fill: "currentColor"
|
|
6294
6509
|
}
|
|
6295
6510
|
),
|
|
6296
|
-
/* @__PURE__ */
|
|
6511
|
+
/* @__PURE__ */ jsx67(
|
|
6297
6512
|
"path",
|
|
6298
6513
|
{
|
|
6299
6514
|
fillRule: "evenodd",
|
|
@@ -6302,7 +6517,7 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6302
6517
|
fill: "currentColor"
|
|
6303
6518
|
}
|
|
6304
6519
|
),
|
|
6305
|
-
/* @__PURE__ */
|
|
6520
|
+
/* @__PURE__ */ jsx67(
|
|
6306
6521
|
"path",
|
|
6307
6522
|
{
|
|
6308
6523
|
fillRule: "evenodd",
|
|
@@ -6318,9 +6533,9 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6318
6533
|
AlignLeftIcon.displayName = "AlignLeftIcon";
|
|
6319
6534
|
|
|
6320
6535
|
// src/components/tiptap-icons/align-right-icon.tsx
|
|
6321
|
-
import { memo as
|
|
6322
|
-
import { jsx as
|
|
6323
|
-
var AlignRightIcon =
|
|
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 }) => {
|
|
6324
6539
|
return /* @__PURE__ */ jsxs40(
|
|
6325
6540
|
"svg",
|
|
6326
6541
|
{
|
|
@@ -6332,7 +6547,7 @@ var AlignRightIcon = memo31(({ className, ...props }) => {
|
|
|
6332
6547
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6333
6548
|
...props,
|
|
6334
6549
|
children: [
|
|
6335
|
-
/* @__PURE__ */
|
|
6550
|
+
/* @__PURE__ */ jsx68(
|
|
6336
6551
|
"path",
|
|
6337
6552
|
{
|
|
6338
6553
|
fillRule: "evenodd",
|
|
@@ -6341,7 +6556,7 @@ var AlignRightIcon = memo31(({ className, ...props }) => {
|
|
|
6341
6556
|
fill: "currentColor"
|
|
6342
6557
|
}
|
|
6343
6558
|
),
|
|
6344
|
-
/* @__PURE__ */
|
|
6559
|
+
/* @__PURE__ */ jsx68(
|
|
6345
6560
|
"path",
|
|
6346
6561
|
{
|
|
6347
6562
|
fillRule: "evenodd",
|
|
@@ -6350,7 +6565,7 @@ var AlignRightIcon = memo31(({ className, ...props }) => {
|
|
|
6350
6565
|
fill: "currentColor"
|
|
6351
6566
|
}
|
|
6352
6567
|
),
|
|
6353
|
-
/* @__PURE__ */
|
|
6568
|
+
/* @__PURE__ */ jsx68(
|
|
6354
6569
|
"path",
|
|
6355
6570
|
{
|
|
6356
6571
|
fillRule: "evenodd",
|
|
@@ -6437,7 +6652,7 @@ function useTextAlign(config) {
|
|
|
6437
6652
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6438
6653
|
};
|
|
6439
6654
|
}, [editor, hideWhenUnavailable, align]);
|
|
6440
|
-
const handleTextAlign =
|
|
6655
|
+
const handleTextAlign = useCallback23(() => {
|
|
6441
6656
|
if (!editor) return false;
|
|
6442
6657
|
const success = setTextAlign(editor, align);
|
|
6443
6658
|
if (success) {
|
|
@@ -6457,13 +6672,13 @@ function useTextAlign(config) {
|
|
|
6457
6672
|
}
|
|
6458
6673
|
|
|
6459
6674
|
// src/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx
|
|
6460
|
-
import { forwardRef as forwardRef18, useCallback as
|
|
6461
|
-
import { Fragment as Fragment10, jsx 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";
|
|
6462
6677
|
function HistoryShortcutBadge({
|
|
6463
6678
|
action,
|
|
6464
6679
|
shortcutKeys = UNDO_REDO_SHORTCUT_KEYS[action]
|
|
6465
6680
|
}) {
|
|
6466
|
-
return /* @__PURE__ */
|
|
6681
|
+
return /* @__PURE__ */ jsx69(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6467
6682
|
}
|
|
6468
6683
|
var UndoRedoButton = forwardRef18(
|
|
6469
6684
|
({
|
|
@@ -6484,7 +6699,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6484
6699
|
hideWhenUnavailable,
|
|
6485
6700
|
onExecuted
|
|
6486
6701
|
});
|
|
6487
|
-
const handleClick =
|
|
6702
|
+
const handleClick = useCallback24(
|
|
6488
6703
|
(event) => {
|
|
6489
6704
|
onClick?.(event);
|
|
6490
6705
|
if (event.defaultPrevented) return;
|
|
@@ -6495,7 +6710,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6495
6710
|
if (!isVisible) {
|
|
6496
6711
|
return null;
|
|
6497
6712
|
}
|
|
6498
|
-
return /* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ jsx69(
|
|
6499
6714
|
Button2,
|
|
6500
6715
|
{
|
|
6501
6716
|
type: "button",
|
|
@@ -6510,9 +6725,9 @@ var UndoRedoButton = forwardRef18(
|
|
|
6510
6725
|
...buttonProps,
|
|
6511
6726
|
ref,
|
|
6512
6727
|
children: children ?? /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
6513
|
-
/* @__PURE__ */
|
|
6514
|
-
text && /* @__PURE__ */
|
|
6515
|
-
showShortcut && /* @__PURE__ */
|
|
6728
|
+
/* @__PURE__ */ jsx69(Icon, { className: "tiptap-button-icon" }),
|
|
6729
|
+
text && /* @__PURE__ */ jsx69("span", { className: "tiptap-button-text", children: text }),
|
|
6730
|
+
showShortcut && /* @__PURE__ */ jsx69(
|
|
6516
6731
|
HistoryShortcutBadge,
|
|
6517
6732
|
{
|
|
6518
6733
|
action,
|
|
@@ -6527,13 +6742,13 @@ var UndoRedoButton = forwardRef18(
|
|
|
6527
6742
|
UndoRedoButton.displayName = "UndoRedoButton";
|
|
6528
6743
|
|
|
6529
6744
|
// src/components/tiptap-ui/undo-redo-button/use-undo-redo.ts
|
|
6530
|
-
import { useCallback as
|
|
6745
|
+
import { useCallback as useCallback25, useEffect as useEffect17, useState as useState24 } from "react";
|
|
6531
6746
|
|
|
6532
6747
|
// src/components/tiptap-icons/redo2-icon.tsx
|
|
6533
|
-
import { memo as
|
|
6534
|
-
import { jsx as
|
|
6535
|
-
var Redo2Icon =
|
|
6536
|
-
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(
|
|
6537
6752
|
"svg",
|
|
6538
6753
|
{
|
|
6539
6754
|
width: "24",
|
|
@@ -6543,7 +6758,7 @@ var Redo2Icon = memo32(({ className, ...props }) => {
|
|
|
6543
6758
|
fill: "currentColor",
|
|
6544
6759
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6545
6760
|
...props,
|
|
6546
|
-
children: /* @__PURE__ */
|
|
6761
|
+
children: /* @__PURE__ */ jsx70(
|
|
6547
6762
|
"path",
|
|
6548
6763
|
{
|
|
6549
6764
|
fillRule: "evenodd",
|
|
@@ -6558,10 +6773,10 @@ var Redo2Icon = memo32(({ className, ...props }) => {
|
|
|
6558
6773
|
Redo2Icon.displayName = "Redo2Icon";
|
|
6559
6774
|
|
|
6560
6775
|
// src/components/tiptap-icons/undo2-icon.tsx
|
|
6561
|
-
import { memo as
|
|
6562
|
-
import { jsx as
|
|
6563
|
-
var Undo2Icon =
|
|
6564
|
-
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(
|
|
6565
6780
|
"svg",
|
|
6566
6781
|
{
|
|
6567
6782
|
width: "24",
|
|
@@ -6571,7 +6786,7 @@ var Undo2Icon = memo33(({ className, ...props }) => {
|
|
|
6571
6786
|
fill: "currentColor",
|
|
6572
6787
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6573
6788
|
...props,
|
|
6574
|
-
children: /* @__PURE__ */
|
|
6789
|
+
children: /* @__PURE__ */ jsx71(
|
|
6575
6790
|
"path",
|
|
6576
6791
|
{
|
|
6577
6792
|
fillRule: "evenodd",
|
|
@@ -6638,7 +6853,7 @@ function useUndoRedo(config) {
|
|
|
6638
6853
|
editor.off("transaction", handleUpdate);
|
|
6639
6854
|
};
|
|
6640
6855
|
}, [editor, hideWhenUnavailable, action]);
|
|
6641
|
-
const handleAction =
|
|
6856
|
+
const handleAction = useCallback25(() => {
|
|
6642
6857
|
if (!editor) return false;
|
|
6643
6858
|
const success = executeUndoRedoAction(editor, action);
|
|
6644
6859
|
if (success) {
|
|
@@ -6702,12 +6917,12 @@ import { ChevronDown } from "lucide-react";
|
|
|
6702
6917
|
// src/components/ui/command.tsx
|
|
6703
6918
|
import { Command as CommandPrimitive } from "cmdk";
|
|
6704
6919
|
import { SearchIcon } from "lucide-react";
|
|
6705
|
-
import { jsx as
|
|
6920
|
+
import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6706
6921
|
function Command({
|
|
6707
6922
|
className,
|
|
6708
6923
|
...props
|
|
6709
6924
|
}) {
|
|
6710
|
-
return /* @__PURE__ */
|
|
6925
|
+
return /* @__PURE__ */ jsx72(
|
|
6711
6926
|
CommandPrimitive,
|
|
6712
6927
|
{
|
|
6713
6928
|
"data-slot": "command",
|
|
@@ -6729,8 +6944,8 @@ function CommandInput({
|
|
|
6729
6944
|
"data-slot": "command-input-wrapper",
|
|
6730
6945
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
6731
6946
|
children: [
|
|
6732
|
-
/* @__PURE__ */
|
|
6733
|
-
/* @__PURE__ */
|
|
6947
|
+
/* @__PURE__ */ jsx72(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
6948
|
+
/* @__PURE__ */ jsx72(
|
|
6734
6949
|
CommandPrimitive.Input,
|
|
6735
6950
|
{
|
|
6736
6951
|
"data-slot": "command-input",
|
|
@@ -6749,7 +6964,7 @@ function CommandList({
|
|
|
6749
6964
|
className,
|
|
6750
6965
|
...props
|
|
6751
6966
|
}) {
|
|
6752
|
-
return /* @__PURE__ */
|
|
6967
|
+
return /* @__PURE__ */ jsx72(
|
|
6753
6968
|
CommandPrimitive.List,
|
|
6754
6969
|
{
|
|
6755
6970
|
"data-slot": "command-list",
|
|
@@ -6764,7 +6979,7 @@ function CommandList({
|
|
|
6764
6979
|
function CommandEmpty({
|
|
6765
6980
|
...props
|
|
6766
6981
|
}) {
|
|
6767
|
-
return /* @__PURE__ */
|
|
6982
|
+
return /* @__PURE__ */ jsx72(
|
|
6768
6983
|
CommandPrimitive.Empty,
|
|
6769
6984
|
{
|
|
6770
6985
|
"data-slot": "command-empty",
|
|
@@ -6777,7 +6992,7 @@ function CommandGroup({
|
|
|
6777
6992
|
className,
|
|
6778
6993
|
...props
|
|
6779
6994
|
}) {
|
|
6780
|
-
return /* @__PURE__ */
|
|
6995
|
+
return /* @__PURE__ */ jsx72(
|
|
6781
6996
|
CommandPrimitive.Group,
|
|
6782
6997
|
{
|
|
6783
6998
|
"data-slot": "command-group",
|
|
@@ -6793,7 +7008,7 @@ function CommandItem({
|
|
|
6793
7008
|
className,
|
|
6794
7009
|
...props
|
|
6795
7010
|
}) {
|
|
6796
|
-
return /* @__PURE__ */
|
|
7011
|
+
return /* @__PURE__ */ jsx72(
|
|
6797
7012
|
CommandPrimitive.Item,
|
|
6798
7013
|
{
|
|
6799
7014
|
"data-slot": "command-item",
|
|
@@ -6808,16 +7023,16 @@ function CommandItem({
|
|
|
6808
7023
|
|
|
6809
7024
|
// src/components/ui/popover.tsx
|
|
6810
7025
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
6811
|
-
import { jsx as
|
|
7026
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
6812
7027
|
function Popover2({
|
|
6813
7028
|
...props
|
|
6814
7029
|
}) {
|
|
6815
|
-
return /* @__PURE__ */
|
|
7030
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Root, { "data-slot": "popover", ...props });
|
|
6816
7031
|
}
|
|
6817
7032
|
function PopoverTrigger2({
|
|
6818
7033
|
...props
|
|
6819
7034
|
}) {
|
|
6820
|
-
return /* @__PURE__ */
|
|
7035
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
6821
7036
|
}
|
|
6822
7037
|
function PopoverContent2({
|
|
6823
7038
|
className,
|
|
@@ -6825,7 +7040,7 @@ function PopoverContent2({
|
|
|
6825
7040
|
sideOffset = 4,
|
|
6826
7041
|
...props
|
|
6827
7042
|
}) {
|
|
6828
|
-
return /* @__PURE__ */
|
|
7043
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx73(
|
|
6829
7044
|
PopoverPrimitive2.Content,
|
|
6830
7045
|
{
|
|
6831
7046
|
"data-slot": "popover-content",
|
|
@@ -6841,7 +7056,7 @@ function PopoverContent2({
|
|
|
6841
7056
|
}
|
|
6842
7057
|
|
|
6843
7058
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
6844
|
-
import { jsx as
|
|
7059
|
+
import { jsx as jsx74, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6845
7060
|
function FontFamilyDropdown() {
|
|
6846
7061
|
const { editor } = useCurrentEditor3();
|
|
6847
7062
|
const [open, setOpen] = useState25(false);
|
|
@@ -6863,18 +7078,18 @@ function FontFamilyDropdown() {
|
|
|
6863
7078
|
}, 0);
|
|
6864
7079
|
};
|
|
6865
7080
|
return /* @__PURE__ */ jsxs43(Popover2, { open, onOpenChange: setOpen, children: [
|
|
6866
|
-
/* @__PURE__ */
|
|
7081
|
+
/* @__PURE__ */ jsx74(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs43(
|
|
6867
7082
|
Button,
|
|
6868
7083
|
{
|
|
6869
7084
|
variant: "outlineFontFamily",
|
|
6870
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 ",
|
|
6871
7086
|
children: [
|
|
6872
7087
|
currentFont,
|
|
6873
|
-
/* @__PURE__ */
|
|
7088
|
+
/* @__PURE__ */ jsx74(ChevronDown, { className: "w-4 h-4" })
|
|
6874
7089
|
]
|
|
6875
7090
|
}
|
|
6876
7091
|
) }),
|
|
6877
|
-
/* @__PURE__ */
|
|
7092
|
+
/* @__PURE__ */ jsx74(
|
|
6878
7093
|
PopoverContent2,
|
|
6879
7094
|
{
|
|
6880
7095
|
className: "w-[300px] p-0",
|
|
@@ -6886,11 +7101,11 @@ function FontFamilyDropdown() {
|
|
|
6886
7101
|
}
|
|
6887
7102
|
},
|
|
6888
7103
|
children: /* @__PURE__ */ jsxs43(Command, { children: [
|
|
6889
|
-
/* @__PURE__ */
|
|
7104
|
+
/* @__PURE__ */ jsx74("div", { className: "cmd-input-wrapper", children: /* @__PURE__ */ jsx74(CommandInput, { placeholder: "Search font..." }) }),
|
|
6890
7105
|
/* @__PURE__ */ jsxs43(CommandList, { className: "max-h-[220px]", children: [
|
|
6891
|
-
/* @__PURE__ */
|
|
7106
|
+
/* @__PURE__ */ jsx74(CommandEmpty, { children: "No font found." }),
|
|
6892
7107
|
/* @__PURE__ */ jsxs43(CommandGroup, { children: [
|
|
6893
|
-
/* @__PURE__ */
|
|
7108
|
+
/* @__PURE__ */ jsx74(
|
|
6894
7109
|
CommandItem,
|
|
6895
7110
|
{
|
|
6896
7111
|
onSelect: () => {
|
|
@@ -6913,7 +7128,7 @@ function FontFamilyDropdown() {
|
|
|
6913
7128
|
},
|
|
6914
7129
|
"default"
|
|
6915
7130
|
),
|
|
6916
|
-
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */
|
|
7131
|
+
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */ jsx74(
|
|
6917
7132
|
CommandItem,
|
|
6918
7133
|
{
|
|
6919
7134
|
onSelect: () => {
|
|
@@ -7024,12 +7239,12 @@ import { debounce } from "lodash";
|
|
|
7024
7239
|
|
|
7025
7240
|
// src/components/ui/label.tsx
|
|
7026
7241
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7027
|
-
import { jsx as
|
|
7242
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
7028
7243
|
function Label2({
|
|
7029
7244
|
className,
|
|
7030
7245
|
...props
|
|
7031
7246
|
}) {
|
|
7032
|
-
return /* @__PURE__ */
|
|
7247
|
+
return /* @__PURE__ */ jsx75(
|
|
7033
7248
|
LabelPrimitive.Root,
|
|
7034
7249
|
{
|
|
7035
7250
|
"data-slot": "label",
|
|
@@ -7044,7 +7259,7 @@ function Label2({
|
|
|
7044
7259
|
|
|
7045
7260
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
7046
7261
|
import React4 from "react";
|
|
7047
|
-
import { jsx as
|
|
7262
|
+
import { jsx as jsx76, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
7048
7263
|
function ColorPicker({ type = "text" }) {
|
|
7049
7264
|
const { editor } = useCurrentEditor4();
|
|
7050
7265
|
const [open, setOpen] = useState26(false);
|
|
@@ -7095,14 +7310,14 @@ function ColorPicker({ type = "text" }) {
|
|
|
7095
7310
|
);
|
|
7096
7311
|
if (!editor) return null;
|
|
7097
7312
|
return /* @__PURE__ */ jsxs44(Popover2, { open, onOpenChange: (v) => setOpen(v), children: [
|
|
7098
|
-
/* @__PURE__ */
|
|
7313
|
+
/* @__PURE__ */ jsx76(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs44(
|
|
7099
7314
|
Button,
|
|
7100
7315
|
{
|
|
7101
7316
|
variant: "outlineFontFamily",
|
|
7102
7317
|
className: "flex items-center h-7 rounded-sm px-2 border-[#a3a3a8] text-[#a3a3a8] hover:text-white",
|
|
7103
7318
|
children: [
|
|
7104
7319
|
"Color",
|
|
7105
|
-
/* @__PURE__ */
|
|
7320
|
+
/* @__PURE__ */ jsx76(
|
|
7106
7321
|
"span",
|
|
7107
7322
|
{
|
|
7108
7323
|
className: "w-3 h-3 ml-2 rounded-sm border border-black/20",
|
|
@@ -7119,9 +7334,9 @@ function ColorPicker({ type = "text" }) {
|
|
|
7119
7334
|
align: "start",
|
|
7120
7335
|
onClick: (e) => e.stopPropagation(),
|
|
7121
7336
|
children: [
|
|
7122
|
-
/* @__PURE__ */
|
|
7337
|
+
/* @__PURE__ */ jsx76(Label2, { className: "text-xs mb-2", children: type === "text" ? "Text Color" : "Highlight Color" }),
|
|
7123
7338
|
!showCustom && /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-3", children: [
|
|
7124
|
-
/* @__PURE__ */
|
|
7339
|
+
/* @__PURE__ */ jsx76("div", { className: "grid grid-cols-7 gap-1", children: GRADIENT_ROWS_70.map((c) => /* @__PURE__ */ jsx76(
|
|
7125
7340
|
"div",
|
|
7126
7341
|
{
|
|
7127
7342
|
onClick: () => {
|
|
@@ -7133,7 +7348,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7133
7348
|
},
|
|
7134
7349
|
c
|
|
7135
7350
|
)) }),
|
|
7136
|
-
/* @__PURE__ */
|
|
7351
|
+
/* @__PURE__ */ jsx76(
|
|
7137
7352
|
Button,
|
|
7138
7353
|
{
|
|
7139
7354
|
size: "sm",
|
|
@@ -7157,7 +7372,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7157
7372
|
onPointerUp: (e) => e.stopPropagation(),
|
|
7158
7373
|
onClick: (e) => e.stopPropagation(),
|
|
7159
7374
|
children: [
|
|
7160
|
-
/* @__PURE__ */
|
|
7375
|
+
/* @__PURE__ */ jsx76(
|
|
7161
7376
|
HexColorPicker,
|
|
7162
7377
|
{
|
|
7163
7378
|
color: tempHex,
|
|
@@ -7169,7 +7384,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7169
7384
|
}
|
|
7170
7385
|
),
|
|
7171
7386
|
/* @__PURE__ */ jsxs44("div", { className: "flex gap-2 items-center", children: [
|
|
7172
|
-
/* @__PURE__ */
|
|
7387
|
+
/* @__PURE__ */ jsx76(
|
|
7173
7388
|
"input",
|
|
7174
7389
|
{
|
|
7175
7390
|
value: tempHex,
|
|
@@ -7180,7 +7395,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7180
7395
|
className: "w-full px-2 py-1 border rounded text-sm"
|
|
7181
7396
|
}
|
|
7182
7397
|
),
|
|
7183
|
-
/* @__PURE__ */
|
|
7398
|
+
/* @__PURE__ */ jsx76(
|
|
7184
7399
|
Button,
|
|
7185
7400
|
{
|
|
7186
7401
|
size: "sm",
|
|
@@ -7193,7 +7408,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7193
7408
|
}
|
|
7194
7409
|
)
|
|
7195
7410
|
] }),
|
|
7196
|
-
/* @__PURE__ */
|
|
7411
|
+
/* @__PURE__ */ jsx76("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ jsx76(
|
|
7197
7412
|
Button,
|
|
7198
7413
|
{
|
|
7199
7414
|
size: "sm",
|
|
@@ -7221,7 +7436,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7221
7436
|
import { useState as useState27 } from "react";
|
|
7222
7437
|
import { useCurrentEditor as useCurrentEditor5 } from "@tiptap/react";
|
|
7223
7438
|
import { FiTable } from "react-icons/fi";
|
|
7224
|
-
import { jsx as
|
|
7439
|
+
import { jsx as jsx77, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
7225
7440
|
function TableDropdownMenu() {
|
|
7226
7441
|
const { editor } = useCurrentEditor5();
|
|
7227
7442
|
const [open, setOpen] = useState27(false);
|
|
@@ -7264,30 +7479,30 @@ function TableDropdownMenu() {
|
|
|
7264
7479
|
setOpen(false);
|
|
7265
7480
|
};
|
|
7266
7481
|
return /* @__PURE__ */ jsxs45(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7267
|
-
/* @__PURE__ */
|
|
7268
|
-
/* @__PURE__ */
|
|
7269
|
-
/* @__PURE__ */
|
|
7270
|
-
/* @__PURE__ */
|
|
7271
|
-
/* @__PURE__ */
|
|
7272
|
-
/* @__PURE__ */
|
|
7273
|
-
/* @__PURE__ */
|
|
7274
|
-
/* @__PURE__ */
|
|
7275
|
-
/* @__PURE__ */
|
|
7276
|
-
/* @__PURE__ */
|
|
7277
|
-
/* @__PURE__ */
|
|
7278
|
-
/* @__PURE__ */
|
|
7279
|
-
/* @__PURE__ */
|
|
7280
|
-
/* @__PURE__ */
|
|
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" })
|
|
7281
7496
|
] }) })
|
|
7282
7497
|
] }) })
|
|
7283
7498
|
] });
|
|
7284
7499
|
}
|
|
7285
7500
|
|
|
7286
7501
|
// src/components/tiptap-icons/arrow-left-icon.tsx
|
|
7287
|
-
import { memo as
|
|
7288
|
-
import { jsx as
|
|
7289
|
-
var ArrowLeftIcon =
|
|
7290
|
-
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(
|
|
7291
7506
|
"svg",
|
|
7292
7507
|
{
|
|
7293
7508
|
width: "24",
|
|
@@ -7297,7 +7512,7 @@ var ArrowLeftIcon = memo34(({ className, ...props }) => {
|
|
|
7297
7512
|
fill: "currentColor",
|
|
7298
7513
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7299
7514
|
...props,
|
|
7300
|
-
children: /* @__PURE__ */
|
|
7515
|
+
children: /* @__PURE__ */ jsx78(
|
|
7301
7516
|
"path",
|
|
7302
7517
|
{
|
|
7303
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",
|
|
@@ -7316,9 +7531,9 @@ import { useEffect as useEffect20, useState as useState28 } from "react";
|
|
|
7316
7531
|
import throttle from "lodash.throttle";
|
|
7317
7532
|
|
|
7318
7533
|
// src/hooks/use-unmount.ts
|
|
7319
|
-
import { useRef as
|
|
7534
|
+
import { useRef as useRef7, useEffect as useEffect19 } from "react";
|
|
7320
7535
|
var useUnmount = (callback) => {
|
|
7321
|
-
const ref =
|
|
7536
|
+
const ref = useRef7(callback);
|
|
7322
7537
|
ref.current = callback;
|
|
7323
7538
|
useEffect19(
|
|
7324
7539
|
() => () => {
|
|
@@ -7329,13 +7544,13 @@ var useUnmount = (callback) => {
|
|
|
7329
7544
|
};
|
|
7330
7545
|
|
|
7331
7546
|
// src/hooks/use-throttled-callback.ts
|
|
7332
|
-
import { useMemo as
|
|
7547
|
+
import { useMemo as useMemo10 } from "react";
|
|
7333
7548
|
var defaultOptions = {
|
|
7334
7549
|
leading: false,
|
|
7335
7550
|
trailing: true
|
|
7336
7551
|
};
|
|
7337
7552
|
function useThrottledCallback(fn, wait = 250, dependencies = [], options = defaultOptions) {
|
|
7338
|
-
const handler =
|
|
7553
|
+
const handler = useMemo10(
|
|
7339
7554
|
() => throttle(fn, wait, options),
|
|
7340
7555
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7341
7556
|
dependencies
|
|
@@ -7386,7 +7601,7 @@ function useWindowSize() {
|
|
|
7386
7601
|
}
|
|
7387
7602
|
|
|
7388
7603
|
// src/hooks/use-element-rect.ts
|
|
7389
|
-
import { useCallback as
|
|
7604
|
+
import { useCallback as useCallback26, useEffect as useEffect21, useState as useState29 } from "react";
|
|
7390
7605
|
var initialRect = {
|
|
7391
7606
|
x: 0,
|
|
7392
7607
|
y: 0,
|
|
@@ -7407,7 +7622,7 @@ function useElementRect({
|
|
|
7407
7622
|
useResizeObserver = true
|
|
7408
7623
|
} = {}) {
|
|
7409
7624
|
const [rect, setRect] = useState29(initialRect);
|
|
7410
|
-
const getTargetElement =
|
|
7625
|
+
const getTargetElement = useCallback26(() => {
|
|
7411
7626
|
if (!enabled || !isClientSide()) return null;
|
|
7412
7627
|
if (!element) {
|
|
7413
7628
|
return document.body;
|
|
@@ -7523,62 +7738,62 @@ function useCursorVisibility({
|
|
|
7523
7738
|
}
|
|
7524
7739
|
|
|
7525
7740
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
7526
|
-
import { Fragment as Fragment11, jsx as
|
|
7741
|
+
import { Fragment as Fragment11, jsx as jsx79, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7527
7742
|
var MainToolbarContent = ({
|
|
7528
7743
|
onHighlighterClick,
|
|
7529
7744
|
onLinkClick,
|
|
7530
7745
|
isMobile
|
|
7531
7746
|
}) => {
|
|
7532
7747
|
return /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
7533
|
-
/* @__PURE__ */
|
|
7534
|
-
/* @__PURE__ */
|
|
7535
|
-
/* @__PURE__ */
|
|
7748
|
+
/* @__PURE__ */ jsx79(Spacer, {}),
|
|
7749
|
+
/* @__PURE__ */ jsx79(FontFamilyDropdown, {}),
|
|
7750
|
+
/* @__PURE__ */ jsx79(ColorPicker, { type: "text" }),
|
|
7536
7751
|
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7537
|
-
/* @__PURE__ */
|
|
7538
|
-
/* @__PURE__ */
|
|
7539
|
-
/* @__PURE__ */
|
|
7540
|
-
/* @__PURE__ */
|
|
7541
|
-
/* @__PURE__ */
|
|
7542
|
-
/* @__PURE__ */
|
|
7543
|
-
/* @__PURE__ */
|
|
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" })
|
|
7544
7759
|
] }),
|
|
7545
|
-
/* @__PURE__ */
|
|
7760
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7546
7761
|
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7547
|
-
/* @__PURE__ */
|
|
7548
|
-
/* @__PURE__ */
|
|
7549
|
-
/* @__PURE__ */
|
|
7550
|
-
/* @__PURE__ */
|
|
7762
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "left" }),
|
|
7763
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "center" }),
|
|
7764
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "right" }),
|
|
7765
|
+
/* @__PURE__ */ jsx79(TextAlignButton, { align: "justify" })
|
|
7551
7766
|
] }),
|
|
7552
|
-
/* @__PURE__ */
|
|
7767
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7553
7768
|
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7554
|
-
/* @__PURE__ */
|
|
7555
|
-
/* @__PURE__ */
|
|
7769
|
+
/* @__PURE__ */ jsx79(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
7770
|
+
/* @__PURE__ */ jsx79(
|
|
7556
7771
|
ListDropdownMenu,
|
|
7557
7772
|
{
|
|
7558
7773
|
types: ["bulletList", "orderedList", "taskList"],
|
|
7559
7774
|
portal: isMobile
|
|
7560
7775
|
}
|
|
7561
7776
|
),
|
|
7562
|
-
/* @__PURE__ */
|
|
7777
|
+
/* @__PURE__ */ jsx79(BlockquoteButton, {})
|
|
7563
7778
|
] }),
|
|
7564
|
-
/* @__PURE__ */
|
|
7565
|
-
/* @__PURE__ */
|
|
7566
|
-
/* @__PURE__ */
|
|
7567
|
-
/* @__PURE__ */
|
|
7568
|
-
/* @__PURE__ */
|
|
7569
|
-
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, {})
|
|
7570
7785
|
] });
|
|
7571
7786
|
};
|
|
7572
7787
|
var MobileToolbarContent = ({
|
|
7573
7788
|
type,
|
|
7574
7789
|
onBack
|
|
7575
7790
|
}) => /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
7576
|
-
/* @__PURE__ */
|
|
7577
|
-
/* @__PURE__ */
|
|
7578
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
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" })
|
|
7579
7794
|
] }) }),
|
|
7580
|
-
/* @__PURE__ */
|
|
7581
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
7795
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7796
|
+
type === "highlighter" ? /* @__PURE__ */ jsx79(ColorHighlightPopoverContent, {}) : /* @__PURE__ */ jsx79(LinkContent, {})
|
|
7582
7797
|
] });
|
|
7583
7798
|
function SimpleEditor() {
|
|
7584
7799
|
const { setEditorContent, debouncedSave } = useEditorBridge();
|
|
@@ -7587,7 +7802,7 @@ function SimpleEditor() {
|
|
|
7587
7802
|
const [mobileView, setMobileView] = useState30(
|
|
7588
7803
|
"main"
|
|
7589
7804
|
);
|
|
7590
|
-
const toolbarRef =
|
|
7805
|
+
const toolbarRef = useRef8(null);
|
|
7591
7806
|
const editor = useEditor({
|
|
7592
7807
|
immediatelyRender: false,
|
|
7593
7808
|
editorProps: {
|
|
@@ -7688,8 +7903,8 @@ function SimpleEditor() {
|
|
|
7688
7903
|
window.visualViewport?.removeEventListener("scroll", updatePosition);
|
|
7689
7904
|
};
|
|
7690
7905
|
}, []);
|
|
7691
|
-
return /* @__PURE__ */
|
|
7692
|
-
/* @__PURE__ */
|
|
7906
|
+
return /* @__PURE__ */ jsx79("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ jsxs46(EditorContext.Provider, { value: { editor }, children: [
|
|
7907
|
+
/* @__PURE__ */ jsx79(
|
|
7693
7908
|
Toolbar,
|
|
7694
7909
|
{
|
|
7695
7910
|
ref: toolbarRef,
|
|
@@ -7698,14 +7913,14 @@ function SimpleEditor() {
|
|
|
7698
7913
|
bottom: `calc(100% - ${height - rect.y}px)`
|
|
7699
7914
|
} : {}
|
|
7700
7915
|
},
|
|
7701
|
-
children: mobileView === "main" ? /* @__PURE__ */
|
|
7916
|
+
children: mobileView === "main" ? /* @__PURE__ */ jsx79(
|
|
7702
7917
|
MainToolbarContent,
|
|
7703
7918
|
{
|
|
7704
7919
|
onHighlighterClick: () => setMobileView("highlighter"),
|
|
7705
7920
|
onLinkClick: () => setMobileView("link"),
|
|
7706
7921
|
isMobile
|
|
7707
7922
|
}
|
|
7708
|
-
) : /* @__PURE__ */
|
|
7923
|
+
) : /* @__PURE__ */ jsx79(
|
|
7709
7924
|
MobileToolbarContent,
|
|
7710
7925
|
{
|
|
7711
7926
|
type: mobileView === "highlighter" ? "highlighter" : "link",
|
|
@@ -7714,14 +7929,14 @@ function SimpleEditor() {
|
|
|
7714
7929
|
)
|
|
7715
7930
|
}
|
|
7716
7931
|
),
|
|
7717
|
-
/* @__PURE__ */
|
|
7932
|
+
/* @__PURE__ */ jsx79(
|
|
7718
7933
|
EditorContent,
|
|
7719
7934
|
{
|
|
7720
7935
|
editor,
|
|
7721
7936
|
role: "presentation",
|
|
7722
7937
|
autoFocus: true,
|
|
7723
7938
|
className: "simple-editor-content",
|
|
7724
|
-
children: editor && /* @__PURE__ */
|
|
7939
|
+
children: editor && /* @__PURE__ */ jsx79(BubbleMenuInline, {})
|
|
7725
7940
|
}
|
|
7726
7941
|
)
|
|
7727
7942
|
] }) });
|
|
@@ -7729,9 +7944,9 @@ function SimpleEditor() {
|
|
|
7729
7944
|
|
|
7730
7945
|
// src/components/editor/editor.tsx
|
|
7731
7946
|
import clsx2 from "clsx";
|
|
7732
|
-
import { jsx as
|
|
7947
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
7733
7948
|
function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
7734
|
-
return /* @__PURE__ */
|
|
7949
|
+
return /* @__PURE__ */ jsx80(
|
|
7735
7950
|
"div",
|
|
7736
7951
|
{
|
|
7737
7952
|
className: clsx2(
|
|
@@ -7739,7 +7954,7 @@ function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
|
7739
7954
|
className
|
|
7740
7955
|
),
|
|
7741
7956
|
style,
|
|
7742
|
-
children: /* @__PURE__ */
|
|
7957
|
+
children: /* @__PURE__ */ jsx80(EditorShell, { children: /* @__PURE__ */ jsx80(EditorLayout, { onChange, initialTabs, onTabsChange, children: /* @__PURE__ */ jsx80(SimpleEditor, {}) }) })
|
|
7743
7958
|
}
|
|
7744
7959
|
);
|
|
7745
7960
|
}
|
|
@@ -7827,6 +8042,7 @@ export {
|
|
|
7827
8042
|
EditorBridgeProvider,
|
|
7828
8043
|
FONT_OPTIONS,
|
|
7829
8044
|
GRADIENT_ROWS_70,
|
|
8045
|
+
ThemeProvider,
|
|
7830
8046
|
cn,
|
|
7831
8047
|
fileToBase64,
|
|
7832
8048
|
loadActiveTab,
|