@mhamz.01/easyflow-texteditor 0.1.76 → 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 +180 -237
- package/dist/index.css.map +1 -1
- package/dist/index.js +1368 -1160
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1146 -938
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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,45 +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
|
+
|
|
942
1152
|
// src/contexts/themeProvider.tsx
|
|
943
1153
|
import { ThemeProvider as NextThemesProvider } from "next-themes";
|
|
944
|
-
import { jsx as
|
|
1154
|
+
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
945
1155
|
function ThemeProvider({ children, ...props }) {
|
|
946
|
-
return /* @__PURE__ */
|
|
1156
|
+
return /* @__PURE__ */ jsx13(NextThemesProvider, { ...props, children });
|
|
947
1157
|
}
|
|
948
1158
|
|
|
949
1159
|
// src/components/editorLayout/editorLayout.tsx
|
|
950
|
-
import { jsx as
|
|
1160
|
+
import { jsx as jsx14, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
951
1161
|
function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
952
1162
|
const [editor, setEditor] = useState4(null);
|
|
953
1163
|
const [tabs, setTabs] = useState4([]);
|
|
954
1164
|
const [activeTabId, setActiveTabId] = useState4("");
|
|
955
1165
|
const [activeSubTabId, setActiveSubTabId] = useState4(null);
|
|
956
|
-
const debouncedSaveRef =
|
|
957
|
-
const
|
|
958
|
-
const isRestoringRef =
|
|
959
|
-
const
|
|
960
|
-
|
|
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(
|
|
961
1174
|
(payload) => {
|
|
962
1175
|
if (!onChange) return;
|
|
963
|
-
if (onChangeDebounceRef.current)
|
|
964
|
-
|
|
965
|
-
}
|
|
966
|
-
onChangeDebounceRef.current = setTimeout(() => {
|
|
967
|
-
onChange(payload);
|
|
968
|
-
}, 100);
|
|
1176
|
+
if (onChangeDebounceRef.current) clearTimeout(onChangeDebounceRef.current);
|
|
1177
|
+
onChangeDebounceRef.current = setTimeout(() => onChange(payload), 100);
|
|
969
1178
|
},
|
|
970
1179
|
[onChange]
|
|
971
1180
|
);
|
|
972
|
-
const emitChange =
|
|
1181
|
+
const emitChange = useCallback3(
|
|
973
1182
|
(source) => {
|
|
974
1183
|
if (!onChange) return;
|
|
975
|
-
emitChangeDebounced({
|
|
976
|
-
tabs,
|
|
977
|
-
activeTabId,
|
|
978
|
-
activeSubTabId,
|
|
979
|
-
source
|
|
980
|
-
});
|
|
1184
|
+
emitChangeDebounced({ tabs, activeTabId, activeSubTabId, source });
|
|
981
1185
|
},
|
|
982
1186
|
[emitChangeDebounced, tabs, activeTabId, activeSubTabId]
|
|
983
1187
|
);
|
|
@@ -993,10 +1197,10 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
993
1197
|
useEffect2(() => {
|
|
994
1198
|
onTabsChange?.(tabs);
|
|
995
1199
|
}, [tabs, onTabsChange]);
|
|
996
|
-
const saveCurrentContent =
|
|
1200
|
+
const saveCurrentContent = useCallback3(() => {
|
|
997
1201
|
if (!editor) return tabs;
|
|
998
1202
|
const json = editor.getJSON();
|
|
999
|
-
|
|
1203
|
+
return tabs.map((tab) => {
|
|
1000
1204
|
if (tab.id !== activeTabId) return tab;
|
|
1001
1205
|
if (activeSubTabId) {
|
|
1002
1206
|
return {
|
|
@@ -1008,9 +1212,8 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1008
1212
|
}
|
|
1009
1213
|
return { ...tab, content: json };
|
|
1010
1214
|
});
|
|
1011
|
-
return updatedTabs;
|
|
1012
1215
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1013
|
-
const saveFromEditor =
|
|
1216
|
+
const saveFromEditor = useCallback3(
|
|
1014
1217
|
(editorInstance, source = "editor") => {
|
|
1015
1218
|
const json = editorInstance.getJSON();
|
|
1016
1219
|
setTabs((prev) => {
|
|
@@ -1039,18 +1242,16 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1039
1242
|
},
|
|
1040
1243
|
[activeTabId, activeSubTabId, emitChangeDebounced]
|
|
1041
1244
|
);
|
|
1042
|
-
const debouncedSave =
|
|
1245
|
+
const debouncedSave = useCallback3(
|
|
1043
1246
|
(editorInstance) => {
|
|
1044
|
-
if (debouncedSaveRef.current)
|
|
1045
|
-
clearTimeout(debouncedSaveRef.current);
|
|
1046
|
-
}
|
|
1247
|
+
if (debouncedSaveRef.current) clearTimeout(debouncedSaveRef.current);
|
|
1047
1248
|
debouncedSaveRef.current = setTimeout(() => {
|
|
1048
1249
|
saveFromEditor(editorInstance, "editor");
|
|
1049
1250
|
}, 800);
|
|
1050
1251
|
},
|
|
1051
1252
|
[saveFromEditor]
|
|
1052
1253
|
);
|
|
1053
|
-
const addTab = () => {
|
|
1254
|
+
const addTab = useCallback3(() => {
|
|
1054
1255
|
if (debouncedSaveRef.current) {
|
|
1055
1256
|
clearTimeout(debouncedSaveRef.current);
|
|
1056
1257
|
debouncedSaveRef.current = null;
|
|
@@ -1064,125 +1265,137 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1064
1265
|
setTabs(newTabs);
|
|
1065
1266
|
setActiveTabId(id);
|
|
1066
1267
|
setActiveSubTabId(null);
|
|
1067
|
-
setTimeout(() =>
|
|
1068
|
-
editor?.commands.clearContent();
|
|
1069
|
-
}, 0);
|
|
1268
|
+
setTimeout(() => editor?.commands.clearContent(), 0);
|
|
1070
1269
|
emitChangeDebounced({
|
|
1071
1270
|
tabs: newTabs,
|
|
1072
1271
|
activeTabId: id,
|
|
1073
1272
|
activeSubTabId: null,
|
|
1074
1273
|
source: "add-tab"
|
|
1075
1274
|
});
|
|
1076
|
-
};
|
|
1077
|
-
const addSubTab = (
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
...tab,
|
|
1087
|
-
subtabs: [
|
|
1088
|
-
...tab.subtabs,
|
|
1089
|
-
{ id: subId, title: "New Subtab", content: null }
|
|
1090
|
-
]
|
|
1091
|
-
} : tab
|
|
1092
|
-
);
|
|
1093
|
-
setTabs(newTabs);
|
|
1094
|
-
setActiveTabId(tabId);
|
|
1095
|
-
setActiveSubTabId(subId);
|
|
1096
|
-
setTimeout(() => {
|
|
1097
|
-
editor?.commands.clearContent();
|
|
1098
|
-
}, 0);
|
|
1099
|
-
emitChangeDebounced({
|
|
1100
|
-
tabs: newTabs,
|
|
1101
|
-
activeTabId: tabId,
|
|
1102
|
-
activeSubTabId: subId,
|
|
1103
|
-
source: "add-subtab"
|
|
1104
|
-
});
|
|
1105
|
-
};
|
|
1106
|
-
const selectNode = (tabId, subId) => {
|
|
1107
|
-
if (debouncedSaveRef.current) {
|
|
1108
|
-
clearTimeout(debouncedSaveRef.current);
|
|
1109
|
-
debouncedSaveRef.current = null;
|
|
1110
|
-
}
|
|
1111
|
-
const updatedTabs = saveCurrentContent();
|
|
1112
|
-
setTabs(updatedTabs);
|
|
1113
|
-
setActiveTabId(tabId);
|
|
1114
|
-
setActiveSubTabId(subId ?? null);
|
|
1115
|
-
emitChangeDebounced({
|
|
1116
|
-
tabs: updatedTabs,
|
|
1117
|
-
activeTabId: tabId,
|
|
1118
|
-
activeSubTabId: subId ?? null,
|
|
1119
|
-
source: "tab-switch"
|
|
1120
|
-
});
|
|
1121
|
-
};
|
|
1122
|
-
const renameTab = (id, title) => {
|
|
1123
|
-
setTabs((prev) => prev.map((t) => t.id === id ? { ...t, title } : t));
|
|
1124
|
-
};
|
|
1125
|
-
const deleteSubTab = (tabId, subTabId) => {
|
|
1126
|
-
console.log("\u{1F5D1}\uFE0F Deleting subtab:", subTabId);
|
|
1127
|
-
setTabs(
|
|
1128
|
-
(prev) => prev.map((tab) => {
|
|
1129
|
-
if (tab.id !== tabId) return tab;
|
|
1130
|
-
const remainingSubTabs = tab.subtabs.filter((st) => st.id !== subTabId);
|
|
1131
|
-
if (subTabId === activeSubTabId) {
|
|
1132
|
-
setActiveSubTabId(null);
|
|
1133
|
-
setTimeout(() => {
|
|
1134
|
-
editor?.commands.clearContent();
|
|
1135
|
-
}, 0);
|
|
1136
|
-
}
|
|
1137
|
-
return {
|
|
1138
|
-
...tab,
|
|
1139
|
-
subtabs: remainingSubTabs
|
|
1140
|
-
};
|
|
1141
|
-
})
|
|
1142
|
-
);
|
|
1143
|
-
emitChange("delete-subtab");
|
|
1144
|
-
};
|
|
1145
|
-
const renameSubTab = (tabId, subTabId, title) => {
|
|
1146
|
-
setTabs(
|
|
1147
|
-
(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(
|
|
1148
1285
|
(tab) => tab.id === tabId ? {
|
|
1149
1286
|
...tab,
|
|
1150
|
-
subtabs: tab.subtabs
|
|
1151
|
-
(st) => st.id === subTabId ? { ...st, title } : st
|
|
1152
|
-
)
|
|
1287
|
+
subtabs: [...tab.subtabs, { id: subId, title: "New Subtab", content: null }]
|
|
1153
1288
|
} : tab
|
|
1154
|
-
)
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
}, 0);
|
|
1174
|
-
}
|
|
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;
|
|
1175
1308
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
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
|
+
);
|
|
1180
1396
|
useEffect2(() => {
|
|
1181
1397
|
if (!editor) return;
|
|
1182
1398
|
const key = { tabId: activeTabId, subTabId: activeSubTabId };
|
|
1183
|
-
if (lastRestoredRef.current && lastRestoredRef.current.tabId === key.tabId && lastRestoredRef.current.subTabId === key.subTabId) {
|
|
1184
|
-
return;
|
|
1185
|
-
}
|
|
1186
1399
|
if (isRestoringRef.current) return;
|
|
1187
1400
|
isRestoringRef.current = true;
|
|
1188
1401
|
const tab = tabs.find((t) => t.id === activeTabId);
|
|
@@ -1192,15 +1405,10 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1192
1405
|
} else {
|
|
1193
1406
|
editor.commands.clearContent();
|
|
1194
1407
|
}
|
|
1195
|
-
lastRestoredRef.current = key;
|
|
1196
1408
|
isRestoringRef.current = false;
|
|
1197
1409
|
}, [editor, tabs, activeTabId, activeSubTabId]);
|
|
1198
|
-
return /* @__PURE__ */
|
|
1199
|
-
|
|
1200
|
-
setEditorContent: setEditor,
|
|
1201
|
-
debouncedSave
|
|
1202
|
-
}, children: /* @__PURE__ */ jsx12(SidebarProvider, { children: /* @__PURE__ */ jsxs6("div", { className: "flex h-full w-full min-h-0 relative", children: [
|
|
1203
|
-
/* @__PURE__ */ jsx12(
|
|
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(
|
|
1204
1412
|
AppSidebar,
|
|
1205
1413
|
{
|
|
1206
1414
|
tabs,
|
|
@@ -1217,14 +1425,14 @@ function EditorLayout({ children, onChange, initialTabs, onTabsChange }) {
|
|
|
1217
1425
|
}
|
|
1218
1426
|
),
|
|
1219
1427
|
/* @__PURE__ */ jsxs6(SidebarInset, { className: "flex flex-col flex-1 min-h-0 overflow-hidden", children: [
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
/* @__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 })
|
|
1222
1430
|
] })
|
|
1223
|
-
] }) }) }) });
|
|
1431
|
+
] }) }) }) }) }) });
|
|
1224
1432
|
}
|
|
1225
1433
|
|
|
1226
1434
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
1227
|
-
import { useEffect as useEffect23, useRef as
|
|
1435
|
+
import { useEffect as useEffect23, useRef as useRef8, useState as useState30 } from "react";
|
|
1228
1436
|
import { EditorContent, EditorContext, useEditor } from "@tiptap/react";
|
|
1229
1437
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
1230
1438
|
import Image from "@tiptap/extension-image";
|
|
@@ -1407,16 +1615,16 @@ var FontSizeStepper = Extension.create({
|
|
|
1407
1615
|
});
|
|
1408
1616
|
|
|
1409
1617
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1410
|
-
import { forwardRef as forwardRef2, Fragment, useMemo as
|
|
1618
|
+
import { forwardRef as forwardRef2, Fragment, useMemo as useMemo5 } from "react";
|
|
1411
1619
|
|
|
1412
1620
|
// src/components/tiptap-ui-primitive/tooltip/tooltip.tsx
|
|
1413
1621
|
import {
|
|
1414
1622
|
cloneElement,
|
|
1415
|
-
createContext as
|
|
1623
|
+
createContext as createContext5,
|
|
1416
1624
|
forwardRef,
|
|
1417
1625
|
isValidElement,
|
|
1418
|
-
useContext as
|
|
1419
|
-
useMemo as
|
|
1626
|
+
useContext as useContext5,
|
|
1627
|
+
useMemo as useMemo4,
|
|
1420
1628
|
useState as useState5,
|
|
1421
1629
|
version
|
|
1422
1630
|
} from "react";
|
|
@@ -1435,7 +1643,7 @@ import {
|
|
|
1435
1643
|
FloatingPortal,
|
|
1436
1644
|
FloatingDelayGroup
|
|
1437
1645
|
} from "@floating-ui/react";
|
|
1438
|
-
import { jsx as
|
|
1646
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1439
1647
|
function useTooltip({
|
|
1440
1648
|
initialOpen = false,
|
|
1441
1649
|
placement = "top",
|
|
@@ -1478,7 +1686,7 @@ function useTooltip({
|
|
|
1478
1686
|
const dismiss = useDismiss(context);
|
|
1479
1687
|
const role = useRole(context, { role: "tooltip" });
|
|
1480
1688
|
const interactions = useInteractions([hover, focus, dismiss, role]);
|
|
1481
|
-
return
|
|
1689
|
+
return useMemo4(
|
|
1482
1690
|
() => ({
|
|
1483
1691
|
open,
|
|
1484
1692
|
setOpen,
|
|
@@ -1488,9 +1696,9 @@ function useTooltip({
|
|
|
1488
1696
|
[open, setOpen, interactions, data]
|
|
1489
1697
|
);
|
|
1490
1698
|
}
|
|
1491
|
-
var TooltipContext =
|
|
1699
|
+
var TooltipContext = createContext5(null);
|
|
1492
1700
|
function useTooltipContext() {
|
|
1493
|
-
const context =
|
|
1701
|
+
const context = useContext5(TooltipContext);
|
|
1494
1702
|
if (context == null) {
|
|
1495
1703
|
throw new Error("Tooltip components must be wrapped in <TooltipProvider />");
|
|
1496
1704
|
}
|
|
@@ -1499,14 +1707,14 @@ function useTooltipContext() {
|
|
|
1499
1707
|
function Tooltip2({ children, ...props }) {
|
|
1500
1708
|
const tooltip = useTooltip(props);
|
|
1501
1709
|
if (!props.useDelayGroup) {
|
|
1502
|
-
return /* @__PURE__ */
|
|
1710
|
+
return /* @__PURE__ */ jsx15(TooltipContext.Provider, { value: tooltip, children });
|
|
1503
1711
|
}
|
|
1504
|
-
return /* @__PURE__ */
|
|
1712
|
+
return /* @__PURE__ */ jsx15(
|
|
1505
1713
|
FloatingDelayGroup,
|
|
1506
1714
|
{
|
|
1507
1715
|
delay: { open: props.delay ?? 0, close: props.closeDelay ?? 0 },
|
|
1508
1716
|
timeoutMs: props.timeout,
|
|
1509
|
-
children: /* @__PURE__ */
|
|
1717
|
+
children: /* @__PURE__ */ jsx15(TooltipContext.Provider, { value: tooltip, children })
|
|
1510
1718
|
}
|
|
1511
1719
|
);
|
|
1512
1720
|
}
|
|
@@ -1535,7 +1743,7 @@ var TooltipTrigger2 = forwardRef(
|
|
|
1535
1743
|
})
|
|
1536
1744
|
);
|
|
1537
1745
|
}
|
|
1538
|
-
return /* @__PURE__ */
|
|
1746
|
+
return /* @__PURE__ */ jsx15(
|
|
1539
1747
|
"button",
|
|
1540
1748
|
{
|
|
1541
1749
|
ref,
|
|
@@ -1551,7 +1759,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1551
1759
|
const context = useTooltipContext();
|
|
1552
1760
|
const ref = useMergeRefs([context.refs.setFloating, propRef]);
|
|
1553
1761
|
if (!context.open) return null;
|
|
1554
|
-
const content = /* @__PURE__ */
|
|
1762
|
+
const content = /* @__PURE__ */ jsx15(
|
|
1555
1763
|
"div",
|
|
1556
1764
|
{
|
|
1557
1765
|
ref,
|
|
@@ -1565,7 +1773,7 @@ var TooltipContent2 = forwardRef(
|
|
|
1565
1773
|
}
|
|
1566
1774
|
);
|
|
1567
1775
|
if (portal) {
|
|
1568
|
-
return /* @__PURE__ */
|
|
1776
|
+
return /* @__PURE__ */ jsx15(FloatingPortal, { ...portalProps, children: content });
|
|
1569
1777
|
}
|
|
1570
1778
|
return content;
|
|
1571
1779
|
}
|
|
@@ -1882,14 +2090,14 @@ var FontSizeExtension = Extension2.create({
|
|
|
1882
2090
|
});
|
|
1883
2091
|
|
|
1884
2092
|
// src/components/tiptap-ui-primitive/button/button.tsx
|
|
1885
|
-
import { jsx as
|
|
2093
|
+
import { jsx as jsx16, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
1886
2094
|
var ShortcutDisplay = ({
|
|
1887
2095
|
shortcuts
|
|
1888
2096
|
}) => {
|
|
1889
2097
|
if (shortcuts.length === 0) return null;
|
|
1890
|
-
return /* @__PURE__ */
|
|
1891
|
-
index > 0 && /* @__PURE__ */
|
|
1892
|
-
/* @__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 })
|
|
1893
2101
|
] }, index)) });
|
|
1894
2102
|
};
|
|
1895
2103
|
var Button2 = forwardRef2(
|
|
@@ -1902,12 +2110,12 @@ var Button2 = forwardRef2(
|
|
|
1902
2110
|
"aria-label": ariaLabel,
|
|
1903
2111
|
...props
|
|
1904
2112
|
}, ref) => {
|
|
1905
|
-
const shortcuts =
|
|
2113
|
+
const shortcuts = useMemo5(
|
|
1906
2114
|
() => parseShortcutKeys({ shortcutKeys }),
|
|
1907
2115
|
[shortcutKeys]
|
|
1908
2116
|
);
|
|
1909
2117
|
if (!tooltip || !showTooltip) {
|
|
1910
|
-
return /* @__PURE__ */
|
|
2118
|
+
return /* @__PURE__ */ jsx16(
|
|
1911
2119
|
"button",
|
|
1912
2120
|
{
|
|
1913
2121
|
className: cn2("tiptap-button", className),
|
|
@@ -1919,7 +2127,7 @@ var Button2 = forwardRef2(
|
|
|
1919
2127
|
);
|
|
1920
2128
|
}
|
|
1921
2129
|
return /* @__PURE__ */ jsxs7(Tooltip2, { delay: 200, children: [
|
|
1922
|
-
/* @__PURE__ */
|
|
2130
|
+
/* @__PURE__ */ jsx16(
|
|
1923
2131
|
TooltipTrigger2,
|
|
1924
2132
|
{
|
|
1925
2133
|
className: cn2("tiptap-button", className),
|
|
@@ -1931,14 +2139,14 @@ var Button2 = forwardRef2(
|
|
|
1931
2139
|
),
|
|
1932
2140
|
/* @__PURE__ */ jsxs7(TooltipContent2, { children: [
|
|
1933
2141
|
tooltip,
|
|
1934
|
-
/* @__PURE__ */
|
|
2142
|
+
/* @__PURE__ */ jsx16(ShortcutDisplay, { shortcuts })
|
|
1935
2143
|
] })
|
|
1936
2144
|
] });
|
|
1937
2145
|
}
|
|
1938
2146
|
);
|
|
1939
2147
|
Button2.displayName = "Button";
|
|
1940
2148
|
var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical", ...props }, ref) => {
|
|
1941
|
-
return /* @__PURE__ */
|
|
2149
|
+
return /* @__PURE__ */ jsx16(
|
|
1942
2150
|
"div",
|
|
1943
2151
|
{
|
|
1944
2152
|
ref,
|
|
@@ -1953,7 +2161,7 @@ var ButtonGroup = forwardRef2(({ className, children, orientation = "vertical",
|
|
|
1953
2161
|
ButtonGroup.displayName = "ButtonGroup";
|
|
1954
2162
|
|
|
1955
2163
|
// src/components/tiptap-ui-primitive/spacer/spacer.tsx
|
|
1956
|
-
import { jsx as
|
|
2164
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
1957
2165
|
function Spacer({
|
|
1958
2166
|
orientation = "horizontal",
|
|
1959
2167
|
size,
|
|
@@ -1968,20 +2176,20 @@ function Spacer({
|
|
|
1968
2176
|
height: orientation === "horizontal" ? "1px" : size
|
|
1969
2177
|
}
|
|
1970
2178
|
};
|
|
1971
|
-
return /* @__PURE__ */
|
|
2179
|
+
return /* @__PURE__ */ jsx17("div", { ...props, style: computedStyle });
|
|
1972
2180
|
}
|
|
1973
2181
|
|
|
1974
2182
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
1975
|
-
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";
|
|
1976
2184
|
|
|
1977
2185
|
// src/components/tiptap-ui-primitive/separator/separator.tsx
|
|
1978
2186
|
import { forwardRef as forwardRef3 } from "react";
|
|
1979
|
-
import { jsx as
|
|
2187
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
1980
2188
|
var Separator3 = forwardRef3(
|
|
1981
2189
|
({ decorative, orientation = "vertical", className, ...divProps }, ref) => {
|
|
1982
2190
|
const ariaOrientation = orientation === "vertical" ? orientation : void 0;
|
|
1983
2191
|
const semanticProps = decorative ? { role: "none" } : { "aria-orientation": ariaOrientation, role: "separator" };
|
|
1984
|
-
return /* @__PURE__ */
|
|
2192
|
+
return /* @__PURE__ */ jsx18(
|
|
1985
2193
|
"div",
|
|
1986
2194
|
{
|
|
1987
2195
|
className: cn2("tiptap-separator", className),
|
|
@@ -2120,7 +2328,7 @@ function useMenuNavigation({
|
|
|
2120
2328
|
}
|
|
2121
2329
|
|
|
2122
2330
|
// src/hooks/use-composed-ref.ts
|
|
2123
|
-
import { useCallback as
|
|
2331
|
+
import { useCallback as useCallback4, useRef as useRef3 } from "react";
|
|
2124
2332
|
var updateRef = (ref, value) => {
|
|
2125
2333
|
if (typeof ref === "function") {
|
|
2126
2334
|
ref(value);
|
|
@@ -2130,8 +2338,8 @@ var updateRef = (ref, value) => {
|
|
|
2130
2338
|
}
|
|
2131
2339
|
};
|
|
2132
2340
|
var useComposedRef = (libRef, userRef) => {
|
|
2133
|
-
const prevUserRef =
|
|
2134
|
-
return
|
|
2341
|
+
const prevUserRef = useRef3(null);
|
|
2342
|
+
return useCallback4(
|
|
2135
2343
|
(instance) => {
|
|
2136
2344
|
if (libRef && "current" in libRef) {
|
|
2137
2345
|
;
|
|
@@ -2150,10 +2358,10 @@ var useComposedRef = (libRef, userRef) => {
|
|
|
2150
2358
|
};
|
|
2151
2359
|
|
|
2152
2360
|
// src/components/tiptap-ui-primitive/toolbar/toolbar.tsx
|
|
2153
|
-
import { jsx as
|
|
2361
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
2154
2362
|
var useToolbarNavigation = (toolbarRef) => {
|
|
2155
2363
|
const [items, setItems] = useState7([]);
|
|
2156
|
-
const collectItems =
|
|
2364
|
+
const collectItems = useCallback5(() => {
|
|
2157
2365
|
if (!toolbarRef.current) return [];
|
|
2158
2366
|
return Array.from(
|
|
2159
2367
|
toolbarRef.current.querySelectorAll(
|
|
@@ -2204,10 +2412,10 @@ var useToolbarNavigation = (toolbarRef) => {
|
|
|
2204
2412
|
};
|
|
2205
2413
|
var Toolbar = forwardRef4(
|
|
2206
2414
|
({ children, className, variant = "fixed", ...props }, ref) => {
|
|
2207
|
-
const toolbarRef =
|
|
2415
|
+
const toolbarRef = useRef4(null);
|
|
2208
2416
|
const composedRef = useComposedRef(toolbarRef, ref);
|
|
2209
2417
|
useToolbarNavigation(toolbarRef);
|
|
2210
|
-
return /* @__PURE__ */
|
|
2418
|
+
return /* @__PURE__ */ jsx19(
|
|
2211
2419
|
"div",
|
|
2212
2420
|
{
|
|
2213
2421
|
ref: composedRef,
|
|
@@ -2223,7 +2431,7 @@ var Toolbar = forwardRef4(
|
|
|
2223
2431
|
);
|
|
2224
2432
|
Toolbar.displayName = "Toolbar";
|
|
2225
2433
|
var ToolbarGroup = forwardRef4(
|
|
2226
|
-
({ children, className, ...props }, ref) => /* @__PURE__ */
|
|
2434
|
+
({ children, className, ...props }, ref) => /* @__PURE__ */ jsx19(
|
|
2227
2435
|
"div",
|
|
2228
2436
|
{
|
|
2229
2437
|
ref,
|
|
@@ -2236,7 +2444,7 @@ var ToolbarGroup = forwardRef4(
|
|
|
2236
2444
|
);
|
|
2237
2445
|
ToolbarGroup.displayName = "ToolbarGroup";
|
|
2238
2446
|
var ToolbarSeparator = forwardRef4(
|
|
2239
|
-
({ ...props }, ref) => /* @__PURE__ */
|
|
2447
|
+
({ ...props }, ref) => /* @__PURE__ */ jsx19(Separator3, { ref, orientation: "vertical", decorative: true, ...props })
|
|
2240
2448
|
);
|
|
2241
2449
|
ToolbarSeparator.displayName = "ToolbarSeparator";
|
|
2242
2450
|
|
|
@@ -2252,11 +2460,11 @@ import {
|
|
|
2252
2460
|
Heading3,
|
|
2253
2461
|
Code
|
|
2254
2462
|
} from "lucide-react";
|
|
2255
|
-
import { jsx as
|
|
2463
|
+
import { jsx as jsx20, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2256
2464
|
function BubbleMenuInline() {
|
|
2257
2465
|
const { editor } = useCurrentEditor();
|
|
2258
2466
|
if (!editor) return null;
|
|
2259
|
-
return /* @__PURE__ */
|
|
2467
|
+
return /* @__PURE__ */ jsx20(
|
|
2260
2468
|
BubbleMenu,
|
|
2261
2469
|
{
|
|
2262
2470
|
editor,
|
|
@@ -2280,76 +2488,76 @@ function BubbleMenuInline() {
|
|
|
2280
2488
|
{
|
|
2281
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",
|
|
2282
2490
|
children: [
|
|
2283
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ jsx20(
|
|
2284
2492
|
Button,
|
|
2285
2493
|
{
|
|
2286
2494
|
variant: "ghost",
|
|
2287
2495
|
size: "sm",
|
|
2288
2496
|
onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
|
|
2289
2497
|
className: editor.isActive("heading", { level: 1 }) ? "bg-accent" : "",
|
|
2290
|
-
children: /* @__PURE__ */
|
|
2498
|
+
children: /* @__PURE__ */ jsx20(Heading1, { size: 15 })
|
|
2291
2499
|
}
|
|
2292
2500
|
),
|
|
2293
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ jsx20(
|
|
2294
2502
|
Button,
|
|
2295
2503
|
{
|
|
2296
2504
|
variant: "ghost",
|
|
2297
2505
|
size: "sm",
|
|
2298
2506
|
onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
|
|
2299
2507
|
className: editor.isActive("heading", { level: 2 }) ? "bg-accent" : "",
|
|
2300
|
-
children: /* @__PURE__ */
|
|
2508
|
+
children: /* @__PURE__ */ jsx20(Heading2, { size: 15 })
|
|
2301
2509
|
}
|
|
2302
2510
|
),
|
|
2303
|
-
/* @__PURE__ */
|
|
2511
|
+
/* @__PURE__ */ jsx20(
|
|
2304
2512
|
Button,
|
|
2305
2513
|
{
|
|
2306
2514
|
variant: "ghost",
|
|
2307
2515
|
size: "sm",
|
|
2308
2516
|
onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
|
|
2309
2517
|
className: editor.isActive("heading", { level: 3 }) ? "bg-accent" : "",
|
|
2310
|
-
children: /* @__PURE__ */
|
|
2518
|
+
children: /* @__PURE__ */ jsx20(Heading3, { size: 15 })
|
|
2311
2519
|
}
|
|
2312
2520
|
),
|
|
2313
|
-
/* @__PURE__ */
|
|
2314
|
-
/* @__PURE__ */
|
|
2521
|
+
/* @__PURE__ */ jsx20(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2522
|
+
/* @__PURE__ */ jsx20(
|
|
2315
2523
|
Button,
|
|
2316
2524
|
{
|
|
2317
2525
|
variant: "ghost",
|
|
2318
2526
|
size: "sm",
|
|
2319
2527
|
onClick: () => editor.chain().focus().toggleBulletList().run(),
|
|
2320
2528
|
className: editor.isActive("bulletList") ? "bg-accent" : "",
|
|
2321
|
-
children: /* @__PURE__ */
|
|
2529
|
+
children: /* @__PURE__ */ jsx20(List, { size: 15 })
|
|
2322
2530
|
}
|
|
2323
2531
|
),
|
|
2324
|
-
/* @__PURE__ */
|
|
2532
|
+
/* @__PURE__ */ jsx20(
|
|
2325
2533
|
Button,
|
|
2326
2534
|
{
|
|
2327
2535
|
variant: "ghost",
|
|
2328
2536
|
size: "sm",
|
|
2329
2537
|
onClick: () => editor.chain().focus().toggleOrderedList().run(),
|
|
2330
2538
|
className: editor.isActive("orderedList") ? "bg-accent" : "",
|
|
2331
|
-
children: /* @__PURE__ */
|
|
2539
|
+
children: /* @__PURE__ */ jsx20(ListOrdered, { size: 15 })
|
|
2332
2540
|
}
|
|
2333
2541
|
),
|
|
2334
|
-
/* @__PURE__ */
|
|
2542
|
+
/* @__PURE__ */ jsx20(
|
|
2335
2543
|
Button,
|
|
2336
2544
|
{
|
|
2337
2545
|
variant: "ghost",
|
|
2338
2546
|
size: "sm",
|
|
2339
2547
|
onClick: () => editor.chain().focus().toggleTaskList().run(),
|
|
2340
2548
|
className: editor.isActive("taskList") ? "bg-accent" : "",
|
|
2341
|
-
children: /* @__PURE__ */
|
|
2549
|
+
children: /* @__PURE__ */ jsx20(CheckSquare, { size: 15 })
|
|
2342
2550
|
}
|
|
2343
2551
|
),
|
|
2344
|
-
/* @__PURE__ */
|
|
2345
|
-
/* @__PURE__ */
|
|
2552
|
+
/* @__PURE__ */ jsx20(Separator, { orientation: "vertical", className: "mx-1" }),
|
|
2553
|
+
/* @__PURE__ */ jsx20(
|
|
2346
2554
|
Button,
|
|
2347
2555
|
{
|
|
2348
2556
|
variant: "ghost",
|
|
2349
2557
|
size: "sm",
|
|
2350
2558
|
onClick: () => editor.chain().focus().toggleCodeBlock().run(),
|
|
2351
2559
|
className: editor.isActive("codeBlock") ? "bg-accent" : "",
|
|
2352
|
-
children: /* @__PURE__ */
|
|
2560
|
+
children: /* @__PURE__ */ jsx20(Code, { size: 15 })
|
|
2353
2561
|
}
|
|
2354
2562
|
)
|
|
2355
2563
|
]
|
|
@@ -2364,14 +2572,14 @@ import { mergeAttributes as mergeAttributes2, Node as Node4 } from "@tiptap/reac
|
|
|
2364
2572
|
import { ReactNodeViewRenderer } from "@tiptap/react";
|
|
2365
2573
|
|
|
2366
2574
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2367
|
-
import { useRef as
|
|
2575
|
+
import { useRef as useRef5, useState as useState8 } from "react";
|
|
2368
2576
|
import { NodeViewWrapper } from "@tiptap/react";
|
|
2369
2577
|
|
|
2370
2578
|
// src/components/tiptap-icons/close-icon.tsx
|
|
2371
|
-
import { memo } from "react";
|
|
2372
|
-
import { jsx as
|
|
2373
|
-
var CloseIcon =
|
|
2374
|
-
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(
|
|
2375
2583
|
"svg",
|
|
2376
2584
|
{
|
|
2377
2585
|
width: "24",
|
|
@@ -2381,7 +2589,7 @@ var CloseIcon = memo(({ className, ...props }) => {
|
|
|
2381
2589
|
fill: "currentColor",
|
|
2382
2590
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2383
2591
|
...props,
|
|
2384
|
-
children: /* @__PURE__ */
|
|
2592
|
+
children: /* @__PURE__ */ jsx21(
|
|
2385
2593
|
"path",
|
|
2386
2594
|
{
|
|
2387
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",
|
|
@@ -2394,7 +2602,7 @@ var CloseIcon = memo(({ className, ...props }) => {
|
|
|
2394
2602
|
CloseIcon.displayName = "CloseIcon";
|
|
2395
2603
|
|
|
2396
2604
|
// src/components/tiptap-node/image-upload-node/image-upload-node.tsx
|
|
2397
|
-
import { Fragment as Fragment2, jsx as
|
|
2605
|
+
import { Fragment as Fragment2, jsx as jsx22, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2398
2606
|
function useFileUpload(options) {
|
|
2399
2607
|
const [fileItems, setFileItems] = useState8([]);
|
|
2400
2608
|
const uploadFile = async (file) => {
|
|
@@ -2512,14 +2720,14 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs9(
|
|
|
2512
2720
|
fill: "currentColor",
|
|
2513
2721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2514
2722
|
children: [
|
|
2515
|
-
/* @__PURE__ */
|
|
2723
|
+
/* @__PURE__ */ jsx22(
|
|
2516
2724
|
"path",
|
|
2517
2725
|
{
|
|
2518
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",
|
|
2519
2727
|
fill: "currentColor"
|
|
2520
2728
|
}
|
|
2521
2729
|
),
|
|
2522
|
-
/* @__PURE__ */
|
|
2730
|
+
/* @__PURE__ */ jsx22(
|
|
2523
2731
|
"path",
|
|
2524
2732
|
{
|
|
2525
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",
|
|
@@ -2529,7 +2737,7 @@ var CloudUploadIcon = () => /* @__PURE__ */ jsxs9(
|
|
|
2529
2737
|
]
|
|
2530
2738
|
}
|
|
2531
2739
|
);
|
|
2532
|
-
var FileIcon = () => /* @__PURE__ */
|
|
2740
|
+
var FileIcon = () => /* @__PURE__ */ jsx22(
|
|
2533
2741
|
"svg",
|
|
2534
2742
|
{
|
|
2535
2743
|
width: "43",
|
|
@@ -2538,7 +2746,7 @@ var FileIcon = () => /* @__PURE__ */ jsx20(
|
|
|
2538
2746
|
fill: "currentColor",
|
|
2539
2747
|
className: "tiptap-image-upload-dropzone-rect-primary",
|
|
2540
2748
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2541
|
-
children: /* @__PURE__ */
|
|
2749
|
+
children: /* @__PURE__ */ jsx22(
|
|
2542
2750
|
"path",
|
|
2543
2751
|
{
|
|
2544
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",
|
|
@@ -2550,7 +2758,7 @@ var FileIcon = () => /* @__PURE__ */ jsx20(
|
|
|
2550
2758
|
)
|
|
2551
2759
|
}
|
|
2552
2760
|
);
|
|
2553
|
-
var FileCornerIcon = () => /* @__PURE__ */
|
|
2761
|
+
var FileCornerIcon = () => /* @__PURE__ */ jsx22(
|
|
2554
2762
|
"svg",
|
|
2555
2763
|
{
|
|
2556
2764
|
width: "10",
|
|
@@ -2559,7 +2767,7 @@ var FileCornerIcon = () => /* @__PURE__ */ jsx20(
|
|
|
2559
2767
|
viewBox: "0 0 10 10",
|
|
2560
2768
|
fill: "currentColor",
|
|
2561
2769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2562
|
-
children: /* @__PURE__ */
|
|
2770
|
+
children: /* @__PURE__ */ jsx22(
|
|
2563
2771
|
"path",
|
|
2564
2772
|
{
|
|
2565
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",
|
|
@@ -2602,7 +2810,7 @@ var ImageUploadDragArea = ({
|
|
|
2602
2810
|
onFile(files);
|
|
2603
2811
|
}
|
|
2604
2812
|
};
|
|
2605
|
-
return /* @__PURE__ */
|
|
2813
|
+
return /* @__PURE__ */ jsx22(
|
|
2606
2814
|
"div",
|
|
2607
2815
|
{
|
|
2608
2816
|
className: `tiptap-image-upload-drag-area ${isDragActive ? "drag-active" : ""} ${isDragOver ? "drag-over" : ""}`,
|
|
@@ -2626,7 +2834,7 @@ var ImageUploadPreview = ({
|
|
|
2626
2834
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(2))} ${sizes[i]}`;
|
|
2627
2835
|
};
|
|
2628
2836
|
return /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-preview", children: [
|
|
2629
|
-
fileItem.status === "uploading" && /* @__PURE__ */
|
|
2837
|
+
fileItem.status === "uploading" && /* @__PURE__ */ jsx22(
|
|
2630
2838
|
"div",
|
|
2631
2839
|
{
|
|
2632
2840
|
className: "tiptap-image-upload-progress",
|
|
@@ -2635,10 +2843,10 @@ var ImageUploadPreview = ({
|
|
|
2635
2843
|
),
|
|
2636
2844
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-preview-content", children: [
|
|
2637
2845
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-file-info", children: [
|
|
2638
|
-
/* @__PURE__ */
|
|
2846
|
+
/* @__PURE__ */ jsx22("div", { className: "tiptap-image-upload-file-icon", children: /* @__PURE__ */ jsx22(CloudUploadIcon, {}) }),
|
|
2639
2847
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-details", children: [
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
/* @__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) })
|
|
2642
2850
|
] })
|
|
2643
2851
|
] }),
|
|
2644
2852
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-actions", children: [
|
|
@@ -2646,7 +2854,7 @@ var ImageUploadPreview = ({
|
|
|
2646
2854
|
fileItem.progress,
|
|
2647
2855
|
"%"
|
|
2648
2856
|
] }),
|
|
2649
|
-
/* @__PURE__ */
|
|
2857
|
+
/* @__PURE__ */ jsx22(
|
|
2650
2858
|
Button2,
|
|
2651
2859
|
{
|
|
2652
2860
|
type: "button",
|
|
@@ -2655,7 +2863,7 @@ var ImageUploadPreview = ({
|
|
|
2655
2863
|
e.stopPropagation();
|
|
2656
2864
|
onRemove();
|
|
2657
2865
|
},
|
|
2658
|
-
children: /* @__PURE__ */
|
|
2866
|
+
children: /* @__PURE__ */ jsx22(CloseIcon, { className: "tiptap-button-icon" })
|
|
2659
2867
|
}
|
|
2660
2868
|
)
|
|
2661
2869
|
] })
|
|
@@ -2667,13 +2875,13 @@ var DropZoneContent = ({
|
|
|
2667
2875
|
limit
|
|
2668
2876
|
}) => /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
2669
2877
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-dropzone", children: [
|
|
2670
|
-
/* @__PURE__ */
|
|
2671
|
-
/* @__PURE__ */
|
|
2672
|
-
/* @__PURE__ */
|
|
2878
|
+
/* @__PURE__ */ jsx22(FileIcon, {}),
|
|
2879
|
+
/* @__PURE__ */ jsx22(FileCornerIcon, {}),
|
|
2880
|
+
/* @__PURE__ */ jsx22("div", { className: "tiptap-image-upload-icon-container", children: /* @__PURE__ */ jsx22(CloudUploadIcon, {}) })
|
|
2673
2881
|
] }),
|
|
2674
2882
|
/* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-content", children: [
|
|
2675
2883
|
/* @__PURE__ */ jsxs9("span", { className: "tiptap-image-upload-text", children: [
|
|
2676
|
-
/* @__PURE__ */
|
|
2884
|
+
/* @__PURE__ */ jsx22("em", { children: "Click to upload" }),
|
|
2677
2885
|
" or drag and drop"
|
|
2678
2886
|
] }),
|
|
2679
2887
|
/* @__PURE__ */ jsxs9("span", { className: "tiptap-image-upload-subtext", children: [
|
|
@@ -2689,7 +2897,7 @@ var DropZoneContent = ({
|
|
|
2689
2897
|
] });
|
|
2690
2898
|
var ImageUploadNode = (props) => {
|
|
2691
2899
|
const { accept, limit, maxSize } = props.node.attrs;
|
|
2692
|
-
const inputRef =
|
|
2900
|
+
const inputRef = useRef5(null);
|
|
2693
2901
|
const extension = props.extension;
|
|
2694
2902
|
const uploadOptions = {
|
|
2695
2903
|
maxSize,
|
|
@@ -2744,7 +2952,7 @@ var ImageUploadNode = (props) => {
|
|
|
2744
2952
|
tabIndex: 0,
|
|
2745
2953
|
onClick: handleClick,
|
|
2746
2954
|
children: [
|
|
2747
|
-
!hasFiles && /* @__PURE__ */
|
|
2955
|
+
!hasFiles && /* @__PURE__ */ jsx22(ImageUploadDragArea, { onFile: handleUpload, children: /* @__PURE__ */ jsx22(DropZoneContent, { maxSize, limit }) }),
|
|
2748
2956
|
hasFiles && /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-previews", children: [
|
|
2749
2957
|
fileItems.length > 1 && /* @__PURE__ */ jsxs9("div", { className: "tiptap-image-upload-header", children: [
|
|
2750
2958
|
/* @__PURE__ */ jsxs9("span", { children: [
|
|
@@ -2752,7 +2960,7 @@ var ImageUploadNode = (props) => {
|
|
|
2752
2960
|
fileItems.length,
|
|
2753
2961
|
" files"
|
|
2754
2962
|
] }),
|
|
2755
|
-
/* @__PURE__ */
|
|
2963
|
+
/* @__PURE__ */ jsx22(
|
|
2756
2964
|
Button2,
|
|
2757
2965
|
{
|
|
2758
2966
|
type: "button",
|
|
@@ -2765,7 +2973,7 @@ var ImageUploadNode = (props) => {
|
|
|
2765
2973
|
}
|
|
2766
2974
|
)
|
|
2767
2975
|
] }),
|
|
2768
|
-
fileItems.map((fileItem) => /* @__PURE__ */
|
|
2976
|
+
fileItems.map((fileItem) => /* @__PURE__ */ jsx22(
|
|
2769
2977
|
ImageUploadPreview,
|
|
2770
2978
|
{
|
|
2771
2979
|
fileItem,
|
|
@@ -2774,7 +2982,7 @@ var ImageUploadNode = (props) => {
|
|
|
2774
2982
|
fileItem.id
|
|
2775
2983
|
))
|
|
2776
2984
|
] }),
|
|
2777
|
-
/* @__PURE__ */
|
|
2985
|
+
/* @__PURE__ */ jsx22(
|
|
2778
2986
|
"input",
|
|
2779
2987
|
{
|
|
2780
2988
|
ref: inputRef,
|
|
@@ -2883,13 +3091,13 @@ var HorizontalRule = TiptapHorizontalRule.extend({
|
|
|
2883
3091
|
});
|
|
2884
3092
|
|
|
2885
3093
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
2886
|
-
import { forwardRef as forwardRef9, useCallback as
|
|
3094
|
+
import { forwardRef as forwardRef9, useCallback as useCallback8, useState as useState10 } from "react";
|
|
2887
3095
|
|
|
2888
3096
|
// src/components/tiptap-icons/chevron-down-icon.tsx
|
|
2889
|
-
import { memo as
|
|
2890
|
-
import { jsx as
|
|
2891
|
-
var ChevronDownIcon =
|
|
2892
|
-
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(
|
|
2893
3101
|
"svg",
|
|
2894
3102
|
{
|
|
2895
3103
|
width: "24",
|
|
@@ -2899,7 +3107,7 @@ var ChevronDownIcon = memo2(({ className, ...props }) => {
|
|
|
2899
3107
|
fill: "currentColor",
|
|
2900
3108
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2901
3109
|
...props,
|
|
2902
|
-
children: /* @__PURE__ */
|
|
3110
|
+
children: /* @__PURE__ */ jsx23(
|
|
2903
3111
|
"path",
|
|
2904
3112
|
{
|
|
2905
3113
|
fillRule: "evenodd",
|
|
@@ -2915,10 +3123,10 @@ ChevronDownIcon.displayName = "ChevronDownIcon";
|
|
|
2915
3123
|
|
|
2916
3124
|
// src/hooks/use-tiptap-editor.ts
|
|
2917
3125
|
import { useCurrentEditor as useCurrentEditor2, useEditorState } from "@tiptap/react";
|
|
2918
|
-
import { useMemo as
|
|
3126
|
+
import { useMemo as useMemo6 } from "react";
|
|
2919
3127
|
function useTiptapEditor(providedEditor) {
|
|
2920
3128
|
const { editor: coreEditor } = useCurrentEditor2();
|
|
2921
|
-
const mainEditor =
|
|
3129
|
+
const mainEditor = useMemo6(
|
|
2922
3130
|
() => providedEditor || coreEditor,
|
|
2923
3131
|
[providedEditor, coreEditor]
|
|
2924
3132
|
);
|
|
@@ -2943,11 +3151,11 @@ function useTiptapEditor(providedEditor) {
|
|
|
2943
3151
|
}
|
|
2944
3152
|
|
|
2945
3153
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
2946
|
-
import { forwardRef as forwardRef6, useCallback as
|
|
3154
|
+
import { forwardRef as forwardRef6, useCallback as useCallback6 } from "react";
|
|
2947
3155
|
|
|
2948
3156
|
// src/components/tiptap-ui-primitive/badge/badge.tsx
|
|
2949
3157
|
import { forwardRef as forwardRef5 } from "react";
|
|
2950
|
-
import { jsx as
|
|
3158
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
2951
3159
|
var Badge = forwardRef5(
|
|
2952
3160
|
({
|
|
2953
3161
|
variant,
|
|
@@ -2958,7 +3166,7 @@ var Badge = forwardRef5(
|
|
|
2958
3166
|
children,
|
|
2959
3167
|
...props
|
|
2960
3168
|
}, ref) => {
|
|
2961
|
-
return /* @__PURE__ */
|
|
3169
|
+
return /* @__PURE__ */ jsx24(
|
|
2962
3170
|
"div",
|
|
2963
3171
|
{
|
|
2964
3172
|
ref,
|
|
@@ -2976,12 +3184,12 @@ var Badge = forwardRef5(
|
|
|
2976
3184
|
Badge.displayName = "Badge";
|
|
2977
3185
|
|
|
2978
3186
|
// src/components/tiptap-ui/heading-button/heading-button.tsx
|
|
2979
|
-
import { Fragment as Fragment3, jsx as
|
|
3187
|
+
import { Fragment as Fragment3, jsx as jsx25, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2980
3188
|
function HeadingShortcutBadge({
|
|
2981
3189
|
level,
|
|
2982
3190
|
shortcutKeys = HEADING_SHORTCUT_KEYS[level]
|
|
2983
3191
|
}) {
|
|
2984
|
-
return /* @__PURE__ */
|
|
3192
|
+
return /* @__PURE__ */ jsx25(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
2985
3193
|
}
|
|
2986
3194
|
var HeadingButton = forwardRef6(
|
|
2987
3195
|
({
|
|
@@ -3010,7 +3218,7 @@ var HeadingButton = forwardRef6(
|
|
|
3010
3218
|
hideWhenUnavailable,
|
|
3011
3219
|
onToggled
|
|
3012
3220
|
});
|
|
3013
|
-
const handleClick =
|
|
3221
|
+
const handleClick = useCallback6(
|
|
3014
3222
|
(event) => {
|
|
3015
3223
|
onClick?.(event);
|
|
3016
3224
|
if (event.defaultPrevented) return;
|
|
@@ -3021,7 +3229,7 @@ var HeadingButton = forwardRef6(
|
|
|
3021
3229
|
if (!isVisible) {
|
|
3022
3230
|
return null;
|
|
3023
3231
|
}
|
|
3024
|
-
return /* @__PURE__ */
|
|
3232
|
+
return /* @__PURE__ */ jsx25(
|
|
3025
3233
|
Button2,
|
|
3026
3234
|
{
|
|
3027
3235
|
type: "button",
|
|
@@ -3038,9 +3246,9 @@ var HeadingButton = forwardRef6(
|
|
|
3038
3246
|
...buttonProps,
|
|
3039
3247
|
ref,
|
|
3040
3248
|
children: children ?? /* @__PURE__ */ jsxs10(Fragment3, { children: [
|
|
3041
|
-
/* @__PURE__ */
|
|
3042
|
-
text && /* @__PURE__ */
|
|
3043
|
-
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 })
|
|
3044
3252
|
] })
|
|
3045
3253
|
}
|
|
3046
3254
|
);
|
|
@@ -3049,13 +3257,13 @@ var HeadingButton = forwardRef6(
|
|
|
3049
3257
|
HeadingButton.displayName = "HeadingButton";
|
|
3050
3258
|
|
|
3051
3259
|
// src/components/tiptap-ui/heading-button/use-heading.ts
|
|
3052
|
-
import { useCallback as
|
|
3260
|
+
import { useCallback as useCallback7, useEffect as useEffect5, useState as useState9 } from "react";
|
|
3053
3261
|
import { NodeSelection as NodeSelection2, TextSelection as TextSelection2 } from "@tiptap/pm/state";
|
|
3054
3262
|
|
|
3055
3263
|
// src/components/tiptap-icons/heading-one-icon.tsx
|
|
3056
|
-
import { memo as
|
|
3057
|
-
import { jsx as
|
|
3058
|
-
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 }) => {
|
|
3059
3267
|
return /* @__PURE__ */ jsxs11(
|
|
3060
3268
|
"svg",
|
|
3061
3269
|
{
|
|
@@ -3067,14 +3275,14 @@ var HeadingOneIcon = memo3(({ className, ...props }) => {
|
|
|
3067
3275
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3068
3276
|
...props,
|
|
3069
3277
|
children: [
|
|
3070
|
-
/* @__PURE__ */
|
|
3278
|
+
/* @__PURE__ */ jsx26(
|
|
3071
3279
|
"path",
|
|
3072
3280
|
{
|
|
3073
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",
|
|
3074
3282
|
fill: "currentColor"
|
|
3075
3283
|
}
|
|
3076
3284
|
),
|
|
3077
|
-
/* @__PURE__ */
|
|
3285
|
+
/* @__PURE__ */ jsx26(
|
|
3078
3286
|
"path",
|
|
3079
3287
|
{
|
|
3080
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",
|
|
@@ -3088,9 +3296,9 @@ var HeadingOneIcon = memo3(({ className, ...props }) => {
|
|
|
3088
3296
|
HeadingOneIcon.displayName = "HeadingOneIcon";
|
|
3089
3297
|
|
|
3090
3298
|
// src/components/tiptap-icons/heading-two-icon.tsx
|
|
3091
|
-
import { memo as
|
|
3092
|
-
import { jsx as
|
|
3093
|
-
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 }) => {
|
|
3094
3302
|
return /* @__PURE__ */ jsxs12(
|
|
3095
3303
|
"svg",
|
|
3096
3304
|
{
|
|
@@ -3102,14 +3310,14 @@ var HeadingTwoIcon = memo4(({ className, ...props }) => {
|
|
|
3102
3310
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3103
3311
|
...props,
|
|
3104
3312
|
children: [
|
|
3105
|
-
/* @__PURE__ */
|
|
3313
|
+
/* @__PURE__ */ jsx27(
|
|
3106
3314
|
"path",
|
|
3107
3315
|
{
|
|
3108
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",
|
|
3109
3317
|
fill: "currentColor"
|
|
3110
3318
|
}
|
|
3111
3319
|
),
|
|
3112
|
-
/* @__PURE__ */
|
|
3320
|
+
/* @__PURE__ */ jsx27(
|
|
3113
3321
|
"path",
|
|
3114
3322
|
{
|
|
3115
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",
|
|
@@ -3123,9 +3331,9 @@ var HeadingTwoIcon = memo4(({ className, ...props }) => {
|
|
|
3123
3331
|
HeadingTwoIcon.displayName = "HeadingTwoIcon";
|
|
3124
3332
|
|
|
3125
3333
|
// src/components/tiptap-icons/heading-three-icon.tsx
|
|
3126
|
-
import { memo as
|
|
3127
|
-
import { jsx as
|
|
3128
|
-
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 }) => {
|
|
3129
3337
|
return /* @__PURE__ */ jsxs13(
|
|
3130
3338
|
"svg",
|
|
3131
3339
|
{
|
|
@@ -3137,14 +3345,14 @@ var HeadingThreeIcon = memo5(({ className, ...props }) => {
|
|
|
3137
3345
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3138
3346
|
...props,
|
|
3139
3347
|
children: [
|
|
3140
|
-
/* @__PURE__ */
|
|
3348
|
+
/* @__PURE__ */ jsx28(
|
|
3141
3349
|
"path",
|
|
3142
3350
|
{
|
|
3143
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",
|
|
3144
3352
|
fill: "currentColor"
|
|
3145
3353
|
}
|
|
3146
3354
|
),
|
|
3147
|
-
/* @__PURE__ */
|
|
3355
|
+
/* @__PURE__ */ jsx28(
|
|
3148
3356
|
"path",
|
|
3149
3357
|
{
|
|
3150
3358
|
fillRule: "evenodd",
|
|
@@ -3153,7 +3361,7 @@ var HeadingThreeIcon = memo5(({ className, ...props }) => {
|
|
|
3153
3361
|
fill: "currentColor"
|
|
3154
3362
|
}
|
|
3155
3363
|
),
|
|
3156
|
-
/* @__PURE__ */
|
|
3364
|
+
/* @__PURE__ */ jsx28(
|
|
3157
3365
|
"path",
|
|
3158
3366
|
{
|
|
3159
3367
|
fillRule: "evenodd",
|
|
@@ -3169,9 +3377,9 @@ var HeadingThreeIcon = memo5(({ className, ...props }) => {
|
|
|
3169
3377
|
HeadingThreeIcon.displayName = "HeadingThreeIcon";
|
|
3170
3378
|
|
|
3171
3379
|
// src/components/tiptap-icons/heading-four-icon.tsx
|
|
3172
|
-
import { memo as
|
|
3173
|
-
import { jsx as
|
|
3174
|
-
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 }) => {
|
|
3175
3383
|
return /* @__PURE__ */ jsxs14(
|
|
3176
3384
|
"svg",
|
|
3177
3385
|
{
|
|
@@ -3183,14 +3391,14 @@ var HeadingFourIcon = memo6(({ className, ...props }) => {
|
|
|
3183
3391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3184
3392
|
...props,
|
|
3185
3393
|
children: [
|
|
3186
|
-
/* @__PURE__ */
|
|
3394
|
+
/* @__PURE__ */ jsx29(
|
|
3187
3395
|
"path",
|
|
3188
3396
|
{
|
|
3189
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",
|
|
3190
3398
|
fill: "currentColor"
|
|
3191
3399
|
}
|
|
3192
3400
|
),
|
|
3193
|
-
/* @__PURE__ */
|
|
3401
|
+
/* @__PURE__ */ jsx29(
|
|
3194
3402
|
"path",
|
|
3195
3403
|
{
|
|
3196
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",
|
|
@@ -3204,9 +3412,9 @@ var HeadingFourIcon = memo6(({ className, ...props }) => {
|
|
|
3204
3412
|
HeadingFourIcon.displayName = "HeadingFourIcon";
|
|
3205
3413
|
|
|
3206
3414
|
// src/components/tiptap-icons/heading-five-icon.tsx
|
|
3207
|
-
import { memo as
|
|
3208
|
-
import { jsx as
|
|
3209
|
-
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 }) => {
|
|
3210
3418
|
return /* @__PURE__ */ jsxs15(
|
|
3211
3419
|
"svg",
|
|
3212
3420
|
{
|
|
@@ -3218,14 +3426,14 @@ var HeadingFiveIcon = memo7(({ className, ...props }) => {
|
|
|
3218
3426
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3219
3427
|
...props,
|
|
3220
3428
|
children: [
|
|
3221
|
-
/* @__PURE__ */
|
|
3429
|
+
/* @__PURE__ */ jsx30(
|
|
3222
3430
|
"path",
|
|
3223
3431
|
{
|
|
3224
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",
|
|
3225
3433
|
fill: "currentColor"
|
|
3226
3434
|
}
|
|
3227
3435
|
),
|
|
3228
|
-
/* @__PURE__ */
|
|
3436
|
+
/* @__PURE__ */ jsx30(
|
|
3229
3437
|
"path",
|
|
3230
3438
|
{
|
|
3231
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",
|
|
@@ -3239,9 +3447,9 @@ var HeadingFiveIcon = memo7(({ className, ...props }) => {
|
|
|
3239
3447
|
HeadingFiveIcon.displayName = "HeadingFiveIcon";
|
|
3240
3448
|
|
|
3241
3449
|
// src/components/tiptap-icons/heading-six-icon.tsx
|
|
3242
|
-
import { memo as
|
|
3243
|
-
import { jsx as
|
|
3244
|
-
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 }) => {
|
|
3245
3453
|
return /* @__PURE__ */ jsxs16(
|
|
3246
3454
|
"svg",
|
|
3247
3455
|
{
|
|
@@ -3253,14 +3461,14 @@ var HeadingSixIcon = memo8(({ className, ...props }) => {
|
|
|
3253
3461
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3254
3462
|
...props,
|
|
3255
3463
|
children: [
|
|
3256
|
-
/* @__PURE__ */
|
|
3464
|
+
/* @__PURE__ */ jsx31(
|
|
3257
3465
|
"path",
|
|
3258
3466
|
{
|
|
3259
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",
|
|
3260
3468
|
fill: "currentColor"
|
|
3261
3469
|
}
|
|
3262
3470
|
),
|
|
3263
|
-
/* @__PURE__ */
|
|
3471
|
+
/* @__PURE__ */ jsx31(
|
|
3264
3472
|
"path",
|
|
3265
3473
|
{
|
|
3266
3474
|
fillRule: "evenodd",
|
|
@@ -3393,7 +3601,7 @@ function useHeading(config) {
|
|
|
3393
3601
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
3394
3602
|
};
|
|
3395
3603
|
}, [editor, level, hideWhenUnavailable]);
|
|
3396
|
-
const handleToggle =
|
|
3604
|
+
const handleToggle = useCallback7(() => {
|
|
3397
3605
|
if (!editor) return false;
|
|
3398
3606
|
const success = toggleHeading(editor, level);
|
|
3399
3607
|
if (success) {
|
|
@@ -3415,22 +3623,22 @@ function useHeading(config) {
|
|
|
3415
3623
|
// src/components/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx
|
|
3416
3624
|
import { forwardRef as forwardRef7 } from "react";
|
|
3417
3625
|
import * as DropdownMenuPrimitive2 from "@radix-ui/react-dropdown-menu";
|
|
3418
|
-
import { jsx as
|
|
3626
|
+
import { jsx as jsx32 } from "react/jsx-runtime";
|
|
3419
3627
|
function DropdownMenu2({
|
|
3420
3628
|
...props
|
|
3421
3629
|
}) {
|
|
3422
|
-
return /* @__PURE__ */
|
|
3630
|
+
return /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Root, { modal: false, ...props });
|
|
3423
3631
|
}
|
|
3424
3632
|
function DropdownMenuPortal({
|
|
3425
3633
|
...props
|
|
3426
3634
|
}) {
|
|
3427
|
-
return /* @__PURE__ */
|
|
3635
|
+
return /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Portal, { ...props });
|
|
3428
3636
|
}
|
|
3429
|
-
var DropdownMenuTrigger2 = forwardRef7(({ ...props }, ref) => /* @__PURE__ */
|
|
3637
|
+
var DropdownMenuTrigger2 = forwardRef7(({ ...props }, ref) => /* @__PURE__ */ jsx32(DropdownMenuPrimitive2.Trigger, { ref, ...props }));
|
|
3430
3638
|
DropdownMenuTrigger2.displayName = DropdownMenuPrimitive2.Trigger.displayName;
|
|
3431
3639
|
var DropdownMenuItem2 = DropdownMenuPrimitive2.Item;
|
|
3432
3640
|
var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }, ref) => {
|
|
3433
|
-
const content = /* @__PURE__ */
|
|
3641
|
+
const content = /* @__PURE__ */ jsx32(
|
|
3434
3642
|
DropdownMenuPrimitive2.SubContent,
|
|
3435
3643
|
{
|
|
3436
3644
|
ref,
|
|
@@ -3438,11 +3646,11 @@ var DropdownMenuSubContent = forwardRef7(({ className, portal = true, ...props }
|
|
|
3438
3646
|
...props
|
|
3439
3647
|
}
|
|
3440
3648
|
);
|
|
3441
|
-
return portal ? /* @__PURE__ */
|
|
3649
|
+
return portal ? /* @__PURE__ */ jsx32(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3442
3650
|
});
|
|
3443
3651
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive2.SubContent.displayName;
|
|
3444
3652
|
var DropdownMenuContent2 = forwardRef7(({ className, sideOffset = 4, portal = false, ...props }, ref) => {
|
|
3445
|
-
const content = /* @__PURE__ */
|
|
3653
|
+
const content = /* @__PURE__ */ jsx32(
|
|
3446
3654
|
DropdownMenuPrimitive2.Content,
|
|
3447
3655
|
{
|
|
3448
3656
|
ref,
|
|
@@ -3452,22 +3660,22 @@ var DropdownMenuContent2 = forwardRef7(({ className, sideOffset = 4, portal = fa
|
|
|
3452
3660
|
...props
|
|
3453
3661
|
}
|
|
3454
3662
|
);
|
|
3455
|
-
return portal ? /* @__PURE__ */
|
|
3663
|
+
return portal ? /* @__PURE__ */ jsx32(DropdownMenuPortal, { ...typeof portal === "object" ? portal : {}, children: content }) : content;
|
|
3456
3664
|
});
|
|
3457
3665
|
DropdownMenuContent2.displayName = DropdownMenuPrimitive2.Content.displayName;
|
|
3458
3666
|
|
|
3459
3667
|
// src/components/tiptap-ui-primitive/card/card.tsx
|
|
3460
3668
|
import { forwardRef as forwardRef8 } from "react";
|
|
3461
|
-
import { jsx as
|
|
3669
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
3462
3670
|
var Card = forwardRef8(
|
|
3463
3671
|
({ className, ...props }, ref) => {
|
|
3464
|
-
return /* @__PURE__ */
|
|
3672
|
+
return /* @__PURE__ */ jsx33("div", { ref, className: cn2("tiptap-card", className), ...props });
|
|
3465
3673
|
}
|
|
3466
3674
|
);
|
|
3467
3675
|
Card.displayName = "Card";
|
|
3468
3676
|
var CardHeader = forwardRef8(
|
|
3469
3677
|
({ className, ...props }, ref) => {
|
|
3470
|
-
return /* @__PURE__ */
|
|
3678
|
+
return /* @__PURE__ */ jsx33(
|
|
3471
3679
|
"div",
|
|
3472
3680
|
{
|
|
3473
3681
|
ref,
|
|
@@ -3480,12 +3688,12 @@ var CardHeader = forwardRef8(
|
|
|
3480
3688
|
CardHeader.displayName = "CardHeader";
|
|
3481
3689
|
var CardBody = forwardRef8(
|
|
3482
3690
|
({ className, ...props }, ref) => {
|
|
3483
|
-
return /* @__PURE__ */
|
|
3691
|
+
return /* @__PURE__ */ jsx33("div", { ref, className: cn2("tiptap-card-body", className), ...props });
|
|
3484
3692
|
}
|
|
3485
3693
|
);
|
|
3486
3694
|
CardBody.displayName = "CardBody";
|
|
3487
3695
|
var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props }, ref) => {
|
|
3488
|
-
return /* @__PURE__ */
|
|
3696
|
+
return /* @__PURE__ */ jsx33(
|
|
3489
3697
|
"div",
|
|
3490
3698
|
{
|
|
3491
3699
|
ref,
|
|
@@ -3498,7 +3706,7 @@ var CardItemGroup = forwardRef8(({ className, orientation = "vertical", ...props
|
|
|
3498
3706
|
CardItemGroup.displayName = "CardItemGroup";
|
|
3499
3707
|
var CardGroupLabel = forwardRef8(
|
|
3500
3708
|
({ className, ...props }, ref) => {
|
|
3501
|
-
return /* @__PURE__ */
|
|
3709
|
+
return /* @__PURE__ */ jsx33(
|
|
3502
3710
|
"div",
|
|
3503
3711
|
{
|
|
3504
3712
|
ref,
|
|
@@ -3511,7 +3719,7 @@ var CardGroupLabel = forwardRef8(
|
|
|
3511
3719
|
CardGroupLabel.displayName = "CardGroupLabel";
|
|
3512
3720
|
var CardFooter = forwardRef8(
|
|
3513
3721
|
({ className, ...props }, ref) => {
|
|
3514
|
-
return /* @__PURE__ */
|
|
3722
|
+
return /* @__PURE__ */ jsx33(
|
|
3515
3723
|
"div",
|
|
3516
3724
|
{
|
|
3517
3725
|
ref,
|
|
@@ -3524,7 +3732,7 @@ var CardFooter = forwardRef8(
|
|
|
3524
3732
|
CardFooter.displayName = "CardFooter";
|
|
3525
3733
|
|
|
3526
3734
|
// src/components/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx
|
|
3527
|
-
import { jsx as
|
|
3735
|
+
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
3528
3736
|
var HeadingDropdownMenu = forwardRef9(
|
|
3529
3737
|
({
|
|
3530
3738
|
editor: providedEditor,
|
|
@@ -3541,7 +3749,7 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3541
3749
|
levels,
|
|
3542
3750
|
hideWhenUnavailable
|
|
3543
3751
|
});
|
|
3544
|
-
const handleOpenChange =
|
|
3752
|
+
const handleOpenChange = useCallback8(
|
|
3545
3753
|
(open) => {
|
|
3546
3754
|
if (!editor || !canToggle2) return;
|
|
3547
3755
|
setIsOpen(open);
|
|
@@ -3553,7 +3761,7 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3553
3761
|
return null;
|
|
3554
3762
|
}
|
|
3555
3763
|
return /* @__PURE__ */ jsxs17(DropdownMenu2, { modal: true, open: isOpen, onOpenChange: handleOpenChange, children: [
|
|
3556
|
-
/* @__PURE__ */
|
|
3764
|
+
/* @__PURE__ */ jsx34(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs17(
|
|
3557
3765
|
Button2,
|
|
3558
3766
|
{
|
|
3559
3767
|
type: "button",
|
|
@@ -3569,12 +3777,12 @@ var HeadingDropdownMenu = forwardRef9(
|
|
|
3569
3777
|
...buttonProps,
|
|
3570
3778
|
ref,
|
|
3571
3779
|
children: [
|
|
3572
|
-
/* @__PURE__ */
|
|
3573
|
-
/* @__PURE__ */
|
|
3780
|
+
/* @__PURE__ */ jsx34(Icon, { className: "tiptap-button-icon" }),
|
|
3781
|
+
/* @__PURE__ */ jsx34(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
3574
3782
|
]
|
|
3575
3783
|
}
|
|
3576
3784
|
) }),
|
|
3577
|
-
/* @__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(
|
|
3578
3786
|
HeadingButton,
|
|
3579
3787
|
{
|
|
3580
3788
|
editor,
|
|
@@ -3592,10 +3800,10 @@ HeadingDropdownMenu.displayName = "HeadingDropdownMenu";
|
|
|
3592
3800
|
import { useEffect as useEffect6, useState as useState11 } from "react";
|
|
3593
3801
|
|
|
3594
3802
|
// src/components/tiptap-icons/heading-icon.tsx
|
|
3595
|
-
import { memo as
|
|
3596
|
-
import { jsx as
|
|
3597
|
-
var HeadingIcon =
|
|
3598
|
-
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(
|
|
3599
3807
|
"svg",
|
|
3600
3808
|
{
|
|
3601
3809
|
width: "24",
|
|
@@ -3605,7 +3813,7 @@ var HeadingIcon = memo9(({ className, ...props }) => {
|
|
|
3605
3813
|
fill: "currentColor",
|
|
3606
3814
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3607
3815
|
...props,
|
|
3608
|
-
children: /* @__PURE__ */
|
|
3816
|
+
children: /* @__PURE__ */ jsx35(
|
|
3609
3817
|
"path",
|
|
3610
3818
|
{
|
|
3611
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",
|
|
@@ -3658,12 +3866,12 @@ function useHeadingDropdownMenu(config) {
|
|
|
3658
3866
|
}
|
|
3659
3867
|
|
|
3660
3868
|
// src/components/tiptap-ui/image-upload-button/image-upload-button.tsx
|
|
3661
|
-
import { forwardRef as forwardRef10, useCallback as
|
|
3662
|
-
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";
|
|
3663
3871
|
function ImageShortcutBadge({
|
|
3664
3872
|
shortcutKeys = IMAGE_UPLOAD_SHORTCUT_KEY
|
|
3665
3873
|
}) {
|
|
3666
|
-
return /* @__PURE__ */
|
|
3874
|
+
return /* @__PURE__ */ jsx36(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3667
3875
|
}
|
|
3668
3876
|
var ImageUploadButton = forwardRef10(
|
|
3669
3877
|
({
|
|
@@ -3691,7 +3899,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3691
3899
|
hideWhenUnavailable,
|
|
3692
3900
|
onInserted
|
|
3693
3901
|
});
|
|
3694
|
-
const handleClick =
|
|
3902
|
+
const handleClick = useCallback9(
|
|
3695
3903
|
async (event) => {
|
|
3696
3904
|
onClick?.(event);
|
|
3697
3905
|
if (event.defaultPrevented) return;
|
|
@@ -3703,7 +3911,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3703
3911
|
return null;
|
|
3704
3912
|
}
|
|
3705
3913
|
const RenderIcon = CustomIcon ?? Icon;
|
|
3706
|
-
return /* @__PURE__ */
|
|
3914
|
+
return /* @__PURE__ */ jsx36(
|
|
3707
3915
|
Button2,
|
|
3708
3916
|
{
|
|
3709
3917
|
type: "button",
|
|
@@ -3720,9 +3928,9 @@ var ImageUploadButton = forwardRef10(
|
|
|
3720
3928
|
...buttonProps,
|
|
3721
3929
|
ref,
|
|
3722
3930
|
children: children ?? /* @__PURE__ */ jsxs18(Fragment4, { children: [
|
|
3723
|
-
/* @__PURE__ */
|
|
3724
|
-
text && /* @__PURE__ */
|
|
3725
|
-
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 })
|
|
3726
3934
|
] })
|
|
3727
3935
|
}
|
|
3728
3936
|
);
|
|
@@ -3731,7 +3939,7 @@ var ImageUploadButton = forwardRef10(
|
|
|
3731
3939
|
ImageUploadButton.displayName = "ImageUploadButton";
|
|
3732
3940
|
|
|
3733
3941
|
// src/components/tiptap-ui/image-upload-button/use-image-upload.ts
|
|
3734
|
-
import { useCallback as
|
|
3942
|
+
import { useCallback as useCallback10, useEffect as useEffect8, useState as useState13 } from "react";
|
|
3735
3943
|
import { useHotkeys } from "react-hotkeys-hook";
|
|
3736
3944
|
|
|
3737
3945
|
// src/hooks/use-is-breakpoint.ts
|
|
@@ -3750,10 +3958,10 @@ function useIsBreakpoint(mode = "max", breakpoint = 768) {
|
|
|
3750
3958
|
}
|
|
3751
3959
|
|
|
3752
3960
|
// src/components/tiptap-icons/image-plus-icon.tsx
|
|
3753
|
-
import { memo as
|
|
3754
|
-
import { jsx as
|
|
3755
|
-
var ImagePlusIcon =
|
|
3756
|
-
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(
|
|
3757
3965
|
"svg",
|
|
3758
3966
|
{
|
|
3759
3967
|
width: "24",
|
|
@@ -3763,7 +3971,7 @@ var ImagePlusIcon = memo10(({ className, ...props }) => {
|
|
|
3763
3971
|
fill: "currentColor",
|
|
3764
3972
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3765
3973
|
...props,
|
|
3766
|
-
children: /* @__PURE__ */
|
|
3974
|
+
children: /* @__PURE__ */ jsx37(
|
|
3767
3975
|
"path",
|
|
3768
3976
|
{
|
|
3769
3977
|
fillRule: "evenodd",
|
|
@@ -3851,7 +4059,7 @@ function useImageUpload(config) {
|
|
|
3851
4059
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
3852
4060
|
};
|
|
3853
4061
|
}, [editor, hideWhenUnavailable]);
|
|
3854
|
-
const handleImage =
|
|
4062
|
+
const handleImage = useCallback10(async () => {
|
|
3855
4063
|
if (!editor) return false;
|
|
3856
4064
|
const success = insertImage(editor);
|
|
3857
4065
|
if (await success) {
|
|
@@ -3883,16 +4091,16 @@ function useImageUpload(config) {
|
|
|
3883
4091
|
}
|
|
3884
4092
|
|
|
3885
4093
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
3886
|
-
import { useCallback as
|
|
4094
|
+
import { useCallback as useCallback13, useState as useState16 } from "react";
|
|
3887
4095
|
|
|
3888
4096
|
// src/components/tiptap-ui/list-button/list-button.tsx
|
|
3889
|
-
import { forwardRef as forwardRef11, useCallback as
|
|
3890
|
-
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";
|
|
3891
4099
|
function ListShortcutBadge({
|
|
3892
4100
|
type,
|
|
3893
4101
|
shortcutKeys = LIST_SHORTCUT_KEYS[type]
|
|
3894
4102
|
}) {
|
|
3895
|
-
return /* @__PURE__ */
|
|
4103
|
+
return /* @__PURE__ */ jsx38(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
3896
4104
|
}
|
|
3897
4105
|
var ListButton = forwardRef11(
|
|
3898
4106
|
({
|
|
@@ -3921,7 +4129,7 @@ var ListButton = forwardRef11(
|
|
|
3921
4129
|
hideWhenUnavailable,
|
|
3922
4130
|
onToggled
|
|
3923
4131
|
});
|
|
3924
|
-
const handleClick =
|
|
4132
|
+
const handleClick = useCallback11(
|
|
3925
4133
|
(event) => {
|
|
3926
4134
|
onClick?.(event);
|
|
3927
4135
|
if (event.defaultPrevented) return;
|
|
@@ -3932,7 +4140,7 @@ var ListButton = forwardRef11(
|
|
|
3932
4140
|
if (!isVisible) {
|
|
3933
4141
|
return null;
|
|
3934
4142
|
}
|
|
3935
|
-
return /* @__PURE__ */
|
|
4143
|
+
return /* @__PURE__ */ jsx38(
|
|
3936
4144
|
Button2,
|
|
3937
4145
|
{
|
|
3938
4146
|
type: "button",
|
|
@@ -3949,9 +4157,9 @@ var ListButton = forwardRef11(
|
|
|
3949
4157
|
...buttonProps,
|
|
3950
4158
|
ref,
|
|
3951
4159
|
children: children ?? /* @__PURE__ */ jsxs19(Fragment5, { children: [
|
|
3952
|
-
/* @__PURE__ */
|
|
3953
|
-
text && /* @__PURE__ */
|
|
3954
|
-
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 })
|
|
3955
4163
|
] })
|
|
3956
4164
|
}
|
|
3957
4165
|
);
|
|
@@ -3960,13 +4168,13 @@ var ListButton = forwardRef11(
|
|
|
3960
4168
|
ListButton.displayName = "ListButton";
|
|
3961
4169
|
|
|
3962
4170
|
// src/components/tiptap-ui/list-button/use-list.ts
|
|
3963
|
-
import { useCallback as
|
|
4171
|
+
import { useCallback as useCallback12, useEffect as useEffect9, useState as useState14 } from "react";
|
|
3964
4172
|
import { NodeSelection as NodeSelection3, TextSelection as TextSelection3 } from "@tiptap/pm/state";
|
|
3965
4173
|
|
|
3966
4174
|
// src/components/tiptap-icons/list-icon.tsx
|
|
3967
|
-
import { memo as
|
|
3968
|
-
import { jsx as
|
|
3969
|
-
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 }) => {
|
|
3970
4178
|
return /* @__PURE__ */ jsxs20(
|
|
3971
4179
|
"svg",
|
|
3972
4180
|
{
|
|
@@ -3978,7 +4186,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
3978
4186
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3979
4187
|
...props,
|
|
3980
4188
|
children: [
|
|
3981
|
-
/* @__PURE__ */
|
|
4189
|
+
/* @__PURE__ */ jsx39(
|
|
3982
4190
|
"path",
|
|
3983
4191
|
{
|
|
3984
4192
|
fillRule: "evenodd",
|
|
@@ -3987,7 +4195,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
3987
4195
|
fill: "currentColor"
|
|
3988
4196
|
}
|
|
3989
4197
|
),
|
|
3990
|
-
/* @__PURE__ */
|
|
4198
|
+
/* @__PURE__ */ jsx39(
|
|
3991
4199
|
"path",
|
|
3992
4200
|
{
|
|
3993
4201
|
fillRule: "evenodd",
|
|
@@ -3996,7 +4204,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
3996
4204
|
fill: "currentColor"
|
|
3997
4205
|
}
|
|
3998
4206
|
),
|
|
3999
|
-
/* @__PURE__ */
|
|
4207
|
+
/* @__PURE__ */ jsx39(
|
|
4000
4208
|
"path",
|
|
4001
4209
|
{
|
|
4002
4210
|
fillRule: "evenodd",
|
|
@@ -4005,7 +4213,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
4005
4213
|
fill: "currentColor"
|
|
4006
4214
|
}
|
|
4007
4215
|
),
|
|
4008
|
-
/* @__PURE__ */
|
|
4216
|
+
/* @__PURE__ */ jsx39(
|
|
4009
4217
|
"path",
|
|
4010
4218
|
{
|
|
4011
4219
|
fillRule: "evenodd",
|
|
@@ -4014,7 +4222,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
4014
4222
|
fill: "currentColor"
|
|
4015
4223
|
}
|
|
4016
4224
|
),
|
|
4017
|
-
/* @__PURE__ */
|
|
4225
|
+
/* @__PURE__ */ jsx39(
|
|
4018
4226
|
"path",
|
|
4019
4227
|
{
|
|
4020
4228
|
fillRule: "evenodd",
|
|
@@ -4023,7 +4231,7 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
4023
4231
|
fill: "currentColor"
|
|
4024
4232
|
}
|
|
4025
4233
|
),
|
|
4026
|
-
/* @__PURE__ */
|
|
4234
|
+
/* @__PURE__ */ jsx39(
|
|
4027
4235
|
"path",
|
|
4028
4236
|
{
|
|
4029
4237
|
fillRule: "evenodd",
|
|
@@ -4039,9 +4247,9 @@ var ListIcon = memo11(({ className, ...props }) => {
|
|
|
4039
4247
|
ListIcon.displayName = "ListIcon";
|
|
4040
4248
|
|
|
4041
4249
|
// src/components/tiptap-icons/list-ordered-icon.tsx
|
|
4042
|
-
import { memo as
|
|
4043
|
-
import { jsx as
|
|
4044
|
-
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 }) => {
|
|
4045
4253
|
return /* @__PURE__ */ jsxs21(
|
|
4046
4254
|
"svg",
|
|
4047
4255
|
{
|
|
@@ -4053,7 +4261,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4053
4261
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4054
4262
|
...props,
|
|
4055
4263
|
children: [
|
|
4056
|
-
/* @__PURE__ */
|
|
4264
|
+
/* @__PURE__ */ jsx40(
|
|
4057
4265
|
"path",
|
|
4058
4266
|
{
|
|
4059
4267
|
fillRule: "evenodd",
|
|
@@ -4062,7 +4270,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4062
4270
|
fill: "currentColor"
|
|
4063
4271
|
}
|
|
4064
4272
|
),
|
|
4065
|
-
/* @__PURE__ */
|
|
4273
|
+
/* @__PURE__ */ jsx40(
|
|
4066
4274
|
"path",
|
|
4067
4275
|
{
|
|
4068
4276
|
fillRule: "evenodd",
|
|
@@ -4071,7 +4279,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4071
4279
|
fill: "currentColor"
|
|
4072
4280
|
}
|
|
4073
4281
|
),
|
|
4074
|
-
/* @__PURE__ */
|
|
4282
|
+
/* @__PURE__ */ jsx40(
|
|
4075
4283
|
"path",
|
|
4076
4284
|
{
|
|
4077
4285
|
fillRule: "evenodd",
|
|
@@ -4080,7 +4288,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4080
4288
|
fill: "currentColor"
|
|
4081
4289
|
}
|
|
4082
4290
|
),
|
|
4083
|
-
/* @__PURE__ */
|
|
4291
|
+
/* @__PURE__ */ jsx40(
|
|
4084
4292
|
"path",
|
|
4085
4293
|
{
|
|
4086
4294
|
fillRule: "evenodd",
|
|
@@ -4089,7 +4297,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4089
4297
|
fill: "currentColor"
|
|
4090
4298
|
}
|
|
4091
4299
|
),
|
|
4092
|
-
/* @__PURE__ */
|
|
4300
|
+
/* @__PURE__ */ jsx40(
|
|
4093
4301
|
"path",
|
|
4094
4302
|
{
|
|
4095
4303
|
fillRule: "evenodd",
|
|
@@ -4098,7 +4306,7 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4098
4306
|
fill: "currentColor"
|
|
4099
4307
|
}
|
|
4100
4308
|
),
|
|
4101
|
-
/* @__PURE__ */
|
|
4309
|
+
/* @__PURE__ */ jsx40(
|
|
4102
4310
|
"path",
|
|
4103
4311
|
{
|
|
4104
4312
|
fillRule: "evenodd",
|
|
@@ -4114,9 +4322,9 @@ var ListOrderedIcon = memo12(({ className, ...props }) => {
|
|
|
4114
4322
|
ListOrderedIcon.displayName = "ListOrderedIcon";
|
|
4115
4323
|
|
|
4116
4324
|
// src/components/tiptap-icons/list-todo-icon.tsx
|
|
4117
|
-
import { memo as
|
|
4118
|
-
import { jsx as
|
|
4119
|
-
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 }) => {
|
|
4120
4328
|
return /* @__PURE__ */ jsxs22(
|
|
4121
4329
|
"svg",
|
|
4122
4330
|
{
|
|
@@ -4128,7 +4336,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4128
4336
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4129
4337
|
...props,
|
|
4130
4338
|
children: [
|
|
4131
|
-
/* @__PURE__ */
|
|
4339
|
+
/* @__PURE__ */ jsx41(
|
|
4132
4340
|
"path",
|
|
4133
4341
|
{
|
|
4134
4342
|
fillRule: "evenodd",
|
|
@@ -4137,7 +4345,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4137
4345
|
fill: "currentColor"
|
|
4138
4346
|
}
|
|
4139
4347
|
),
|
|
4140
|
-
/* @__PURE__ */
|
|
4348
|
+
/* @__PURE__ */ jsx41(
|
|
4141
4349
|
"path",
|
|
4142
4350
|
{
|
|
4143
4351
|
fillRule: "evenodd",
|
|
@@ -4146,7 +4354,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4146
4354
|
fill: "currentColor"
|
|
4147
4355
|
}
|
|
4148
4356
|
),
|
|
4149
|
-
/* @__PURE__ */
|
|
4357
|
+
/* @__PURE__ */ jsx41(
|
|
4150
4358
|
"path",
|
|
4151
4359
|
{
|
|
4152
4360
|
fillRule: "evenodd",
|
|
@@ -4155,7 +4363,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4155
4363
|
fill: "currentColor"
|
|
4156
4364
|
}
|
|
4157
4365
|
),
|
|
4158
|
-
/* @__PURE__ */
|
|
4366
|
+
/* @__PURE__ */ jsx41(
|
|
4159
4367
|
"path",
|
|
4160
4368
|
{
|
|
4161
4369
|
fillRule: "evenodd",
|
|
@@ -4164,7 +4372,7 @@ var ListTodoIcon = memo13(({ className, ...props }) => {
|
|
|
4164
4372
|
fill: "currentColor"
|
|
4165
4373
|
}
|
|
4166
4374
|
),
|
|
4167
|
-
/* @__PURE__ */
|
|
4375
|
+
/* @__PURE__ */ jsx41(
|
|
4168
4376
|
"path",
|
|
4169
4377
|
{
|
|
4170
4378
|
fillRule: "evenodd",
|
|
@@ -4322,7 +4530,7 @@ function useList(config) {
|
|
|
4322
4530
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4323
4531
|
};
|
|
4324
4532
|
}, [editor, type, hideWhenUnavailable]);
|
|
4325
|
-
const handleToggle =
|
|
4533
|
+
const handleToggle = useCallback12(() => {
|
|
4326
4534
|
if (!editor) return false;
|
|
4327
4535
|
const success = toggleList(editor, type);
|
|
4328
4536
|
if (success) {
|
|
@@ -4342,7 +4550,7 @@ function useList(config) {
|
|
|
4342
4550
|
}
|
|
4343
4551
|
|
|
4344
4552
|
// src/components/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts
|
|
4345
|
-
import { useEffect as useEffect10, useMemo as
|
|
4553
|
+
import { useEffect as useEffect10, useMemo as useMemo7, useState as useState15 } from "react";
|
|
4346
4554
|
var listOptions = [
|
|
4347
4555
|
{
|
|
4348
4556
|
label: "Bullet List",
|
|
@@ -4396,7 +4604,7 @@ function useListDropdownMenu(config) {
|
|
|
4396
4604
|
const { editor } = useTiptapEditor(providedEditor);
|
|
4397
4605
|
const [isVisible, setIsVisible] = useState15(true);
|
|
4398
4606
|
const listInSchema = types.some((type) => isNodeInSchema(type, editor));
|
|
4399
|
-
const filteredLists =
|
|
4607
|
+
const filteredLists = useMemo7(() => getFilteredListOptions(types), [types]);
|
|
4400
4608
|
const canToggleAny = canToggleAnyList(editor, types);
|
|
4401
4609
|
const isAnyActive = isAnyListActive(editor, types);
|
|
4402
4610
|
const activeType = getActiveListType(editor, types);
|
|
@@ -4433,7 +4641,7 @@ function useListDropdownMenu(config) {
|
|
|
4433
4641
|
}
|
|
4434
4642
|
|
|
4435
4643
|
// src/components/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx
|
|
4436
|
-
import { jsx as
|
|
4644
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
4437
4645
|
function ListDropdownMenu({
|
|
4438
4646
|
editor: providedEditor,
|
|
4439
4647
|
types = ["bulletList", "orderedList", "taskList"],
|
|
@@ -4449,7 +4657,7 @@ function ListDropdownMenu({
|
|
|
4449
4657
|
types,
|
|
4450
4658
|
hideWhenUnavailable
|
|
4451
4659
|
});
|
|
4452
|
-
const handleOnOpenChange =
|
|
4660
|
+
const handleOnOpenChange = useCallback13(
|
|
4453
4661
|
(open) => {
|
|
4454
4662
|
setIsOpen(open);
|
|
4455
4663
|
onOpenChange?.(open);
|
|
@@ -4460,7 +4668,7 @@ function ListDropdownMenu({
|
|
|
4460
4668
|
return null;
|
|
4461
4669
|
}
|
|
4462
4670
|
return /* @__PURE__ */ jsxs23(DropdownMenu2, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
4463
|
-
/* @__PURE__ */
|
|
4671
|
+
/* @__PURE__ */ jsx42(DropdownMenuTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs23(
|
|
4464
4672
|
Button2,
|
|
4465
4673
|
{
|
|
4466
4674
|
type: "button",
|
|
@@ -4474,12 +4682,12 @@ function ListDropdownMenu({
|
|
|
4474
4682
|
tooltip: "List",
|
|
4475
4683
|
...props,
|
|
4476
4684
|
children: [
|
|
4477
|
-
/* @__PURE__ */
|
|
4478
|
-
/* @__PURE__ */
|
|
4685
|
+
/* @__PURE__ */ jsx42(Icon, { className: "tiptap-button-icon" }),
|
|
4686
|
+
/* @__PURE__ */ jsx42(ChevronDownIcon, { className: "tiptap-button-dropdown-small" })
|
|
4479
4687
|
]
|
|
4480
4688
|
}
|
|
4481
4689
|
) }),
|
|
4482
|
-
/* @__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(
|
|
4483
4691
|
ListButton,
|
|
4484
4692
|
{
|
|
4485
4693
|
editor,
|
|
@@ -4492,12 +4700,12 @@ function ListDropdownMenu({
|
|
|
4492
4700
|
}
|
|
4493
4701
|
|
|
4494
4702
|
// src/components/tiptap-ui/blockquote-button/blockquote-button.tsx
|
|
4495
|
-
import { forwardRef as forwardRef12, useCallback as
|
|
4496
|
-
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";
|
|
4497
4705
|
function BlockquoteShortcutBadge({
|
|
4498
4706
|
shortcutKeys = BLOCKQUOTE_SHORTCUT_KEY
|
|
4499
4707
|
}) {
|
|
4500
|
-
return /* @__PURE__ */
|
|
4708
|
+
return /* @__PURE__ */ jsx43(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4501
4709
|
}
|
|
4502
4710
|
var BlockquoteButton = forwardRef12(
|
|
4503
4711
|
({
|
|
@@ -4524,7 +4732,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4524
4732
|
hideWhenUnavailable,
|
|
4525
4733
|
onToggled
|
|
4526
4734
|
});
|
|
4527
|
-
const handleClick =
|
|
4735
|
+
const handleClick = useCallback14(
|
|
4528
4736
|
(event) => {
|
|
4529
4737
|
onClick?.(event);
|
|
4530
4738
|
if (event.defaultPrevented) return;
|
|
@@ -4535,7 +4743,7 @@ var BlockquoteButton = forwardRef12(
|
|
|
4535
4743
|
if (!isVisible) {
|
|
4536
4744
|
return null;
|
|
4537
4745
|
}
|
|
4538
|
-
return /* @__PURE__ */
|
|
4746
|
+
return /* @__PURE__ */ jsx43(
|
|
4539
4747
|
Button2,
|
|
4540
4748
|
{
|
|
4541
4749
|
type: "button",
|
|
@@ -4552,9 +4760,9 @@ var BlockquoteButton = forwardRef12(
|
|
|
4552
4760
|
...buttonProps,
|
|
4553
4761
|
ref,
|
|
4554
4762
|
children: children ?? /* @__PURE__ */ jsxs24(Fragment6, { children: [
|
|
4555
|
-
/* @__PURE__ */
|
|
4556
|
-
text && /* @__PURE__ */
|
|
4557
|
-
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 })
|
|
4558
4766
|
] })
|
|
4559
4767
|
}
|
|
4560
4768
|
);
|
|
@@ -4563,13 +4771,13 @@ var BlockquoteButton = forwardRef12(
|
|
|
4563
4771
|
BlockquoteButton.displayName = "BlockquoteButton";
|
|
4564
4772
|
|
|
4565
4773
|
// src/components/tiptap-ui/blockquote-button/use-blockquote.ts
|
|
4566
|
-
import { useCallback as
|
|
4774
|
+
import { useCallback as useCallback15, useEffect as useEffect11, useState as useState17 } from "react";
|
|
4567
4775
|
import { NodeSelection as NodeSelection4, TextSelection as TextSelection4 } from "@tiptap/pm/state";
|
|
4568
4776
|
|
|
4569
4777
|
// src/components/tiptap-icons/blockquote-icon.tsx
|
|
4570
|
-
import { memo as
|
|
4571
|
-
import { jsx as
|
|
4572
|
-
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 }) => {
|
|
4573
4781
|
return /* @__PURE__ */ jsxs25(
|
|
4574
4782
|
"svg",
|
|
4575
4783
|
{
|
|
@@ -4581,7 +4789,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4581
4789
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4582
4790
|
...props,
|
|
4583
4791
|
children: [
|
|
4584
|
-
/* @__PURE__ */
|
|
4792
|
+
/* @__PURE__ */ jsx44(
|
|
4585
4793
|
"path",
|
|
4586
4794
|
{
|
|
4587
4795
|
fillRule: "evenodd",
|
|
@@ -4590,7 +4798,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4590
4798
|
fill: "currentColor"
|
|
4591
4799
|
}
|
|
4592
4800
|
),
|
|
4593
|
-
/* @__PURE__ */
|
|
4801
|
+
/* @__PURE__ */ jsx44(
|
|
4594
4802
|
"path",
|
|
4595
4803
|
{
|
|
4596
4804
|
fillRule: "evenodd",
|
|
@@ -4599,7 +4807,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4599
4807
|
fill: "currentColor"
|
|
4600
4808
|
}
|
|
4601
4809
|
),
|
|
4602
|
-
/* @__PURE__ */
|
|
4810
|
+
/* @__PURE__ */ jsx44(
|
|
4603
4811
|
"path",
|
|
4604
4812
|
{
|
|
4605
4813
|
fillRule: "evenodd",
|
|
@@ -4608,7 +4816,7 @@ var BlockquoteIcon = memo14(({ className, ...props }) => {
|
|
|
4608
4816
|
fill: "currentColor"
|
|
4609
4817
|
}
|
|
4610
4818
|
),
|
|
4611
|
-
/* @__PURE__ */
|
|
4819
|
+
/* @__PURE__ */ jsx44(
|
|
4612
4820
|
"path",
|
|
4613
4821
|
{
|
|
4614
4822
|
fillRule: "evenodd",
|
|
@@ -4710,7 +4918,7 @@ function useBlockquote(config) {
|
|
|
4710
4918
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
4711
4919
|
};
|
|
4712
4920
|
}, [editor, hideWhenUnavailable]);
|
|
4713
|
-
const handleToggle =
|
|
4921
|
+
const handleToggle = useCallback15(() => {
|
|
4714
4922
|
if (!editor) return false;
|
|
4715
4923
|
const success = toggleBlockquote(editor);
|
|
4716
4924
|
if (success) {
|
|
@@ -4730,13 +4938,13 @@ function useBlockquote(config) {
|
|
|
4730
4938
|
}
|
|
4731
4939
|
|
|
4732
4940
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
4733
|
-
import { forwardRef as forwardRef14, useMemo as
|
|
4941
|
+
import { forwardRef as forwardRef14, useMemo as useMemo9, useRef as useRef6, useState as useState19 } from "react";
|
|
4734
4942
|
|
|
4735
4943
|
// src/components/tiptap-icons/ban-icon.tsx
|
|
4736
|
-
import { memo as
|
|
4737
|
-
import { jsx as
|
|
4738
|
-
var BanIcon =
|
|
4739
|
-
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(
|
|
4740
4948
|
"svg",
|
|
4741
4949
|
{
|
|
4742
4950
|
width: "24",
|
|
@@ -4746,7 +4954,7 @@ var BanIcon = memo15(({ className, ...props }) => {
|
|
|
4746
4954
|
fill: "currentColor",
|
|
4747
4955
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4748
4956
|
...props,
|
|
4749
|
-
children: /* @__PURE__ */
|
|
4957
|
+
children: /* @__PURE__ */ jsx45(
|
|
4750
4958
|
"path",
|
|
4751
4959
|
{
|
|
4752
4960
|
fillRule: "evenodd",
|
|
@@ -4761,10 +4969,10 @@ var BanIcon = memo15(({ className, ...props }) => {
|
|
|
4761
4969
|
BanIcon.displayName = "BanIcon";
|
|
4762
4970
|
|
|
4763
4971
|
// src/components/tiptap-icons/highlighter-icon.tsx
|
|
4764
|
-
import { memo as
|
|
4765
|
-
import { jsx as
|
|
4766
|
-
var HighlighterIcon =
|
|
4767
|
-
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(
|
|
4768
4976
|
"svg",
|
|
4769
4977
|
{
|
|
4770
4978
|
width: "24",
|
|
@@ -4774,7 +4982,7 @@ var HighlighterIcon = memo16(({ className, ...props }) => {
|
|
|
4774
4982
|
fill: "currentColor",
|
|
4775
4983
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4776
4984
|
...props,
|
|
4777
|
-
children: /* @__PURE__ */
|
|
4985
|
+
children: /* @__PURE__ */ jsx46(
|
|
4778
4986
|
"path",
|
|
4779
4987
|
{
|
|
4780
4988
|
fillRule: "evenodd",
|
|
@@ -4790,16 +4998,16 @@ HighlighterIcon.displayName = "HighlighterIcon";
|
|
|
4790
4998
|
|
|
4791
4999
|
// src/components/tiptap-ui-primitive/popover/popover.tsx
|
|
4792
5000
|
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
4793
|
-
import { jsx as
|
|
5001
|
+
import { jsx as jsx47 } from "react/jsx-runtime";
|
|
4794
5002
|
function Popover({
|
|
4795
5003
|
...props
|
|
4796
5004
|
}) {
|
|
4797
|
-
return /* @__PURE__ */
|
|
5005
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Root, { ...props });
|
|
4798
5006
|
}
|
|
4799
5007
|
function PopoverTrigger({
|
|
4800
5008
|
...props
|
|
4801
5009
|
}) {
|
|
4802
|
-
return /* @__PURE__ */
|
|
5010
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Trigger, { ...props });
|
|
4803
5011
|
}
|
|
4804
5012
|
function PopoverContent({
|
|
4805
5013
|
className,
|
|
@@ -4807,7 +5015,7 @@ function PopoverContent({
|
|
|
4807
5015
|
sideOffset = 4,
|
|
4808
5016
|
...props
|
|
4809
5017
|
}) {
|
|
4810
|
-
return /* @__PURE__ */
|
|
5018
|
+
return /* @__PURE__ */ jsx47(PopoverPrimitive.Portal, { children: /* @__PURE__ */ jsx47(
|
|
4811
5019
|
PopoverPrimitive.Content,
|
|
4812
5020
|
{
|
|
4813
5021
|
align,
|
|
@@ -4819,12 +5027,12 @@ function PopoverContent({
|
|
|
4819
5027
|
}
|
|
4820
5028
|
|
|
4821
5029
|
// src/components/tiptap-ui/color-highlight-button/color-highlight-button.tsx
|
|
4822
|
-
import { forwardRef as forwardRef13, useCallback as
|
|
4823
|
-
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";
|
|
4824
5032
|
function ColorHighlightShortcutBadge({
|
|
4825
5033
|
shortcutKeys = COLOR_HIGHLIGHT_SHORTCUT_KEY
|
|
4826
5034
|
}) {
|
|
4827
|
-
return /* @__PURE__ */
|
|
5035
|
+
return /* @__PURE__ */ jsx48(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
4828
5036
|
}
|
|
4829
5037
|
var ColorHighlightButton = forwardRef13(
|
|
4830
5038
|
({
|
|
@@ -4856,7 +5064,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4856
5064
|
mode,
|
|
4857
5065
|
onApplied
|
|
4858
5066
|
});
|
|
4859
|
-
const handleClick =
|
|
5067
|
+
const handleClick = useCallback16(
|
|
4860
5068
|
(event) => {
|
|
4861
5069
|
onClick?.(event);
|
|
4862
5070
|
if (event.defaultPrevented) return;
|
|
@@ -4864,7 +5072,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4864
5072
|
},
|
|
4865
5073
|
[handleColorHighlight, onClick]
|
|
4866
5074
|
);
|
|
4867
|
-
const buttonStyle =
|
|
5075
|
+
const buttonStyle = useMemo8(
|
|
4868
5076
|
() => ({
|
|
4869
5077
|
...style,
|
|
4870
5078
|
"--highlight-color": highlightColor
|
|
@@ -4874,7 +5082,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4874
5082
|
if (!isVisible) {
|
|
4875
5083
|
return null;
|
|
4876
5084
|
}
|
|
4877
|
-
return /* @__PURE__ */
|
|
5085
|
+
return /* @__PURE__ */ jsx48(
|
|
4878
5086
|
Button2,
|
|
4879
5087
|
{
|
|
4880
5088
|
type: "button",
|
|
@@ -4892,15 +5100,15 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4892
5100
|
...buttonProps,
|
|
4893
5101
|
ref,
|
|
4894
5102
|
children: children ?? /* @__PURE__ */ jsxs26(Fragment7, { children: [
|
|
4895
|
-
/* @__PURE__ */
|
|
5103
|
+
/* @__PURE__ */ jsx48(
|
|
4896
5104
|
"span",
|
|
4897
5105
|
{
|
|
4898
5106
|
className: "tiptap-button-highlight",
|
|
4899
5107
|
style: { "--highlight-color": highlightColor }
|
|
4900
5108
|
}
|
|
4901
5109
|
),
|
|
4902
|
-
text && /* @__PURE__ */
|
|
4903
|
-
showShortcut && /* @__PURE__ */
|
|
5110
|
+
text && /* @__PURE__ */ jsx48("span", { className: "tiptap-button-text", children: text }),
|
|
5111
|
+
showShortcut && /* @__PURE__ */ jsx48(ColorHighlightShortcutBadge, { shortcutKeys })
|
|
4904
5112
|
] })
|
|
4905
5113
|
}
|
|
4906
5114
|
);
|
|
@@ -4909,7 +5117,7 @@ var ColorHighlightButton = forwardRef13(
|
|
|
4909
5117
|
ColorHighlightButton.displayName = "ColorHighlightButton";
|
|
4910
5118
|
|
|
4911
5119
|
// src/components/tiptap-ui/color-highlight-button/use-color-highlight.ts
|
|
4912
|
-
import { useCallback as
|
|
5120
|
+
import { useCallback as useCallback17, useEffect as useEffect12, useState as useState18 } from "react";
|
|
4913
5121
|
import { useHotkeys as useHotkeys2 } from "react-hotkeys-hook";
|
|
4914
5122
|
var COLOR_HIGHLIGHT_SHORTCUT_KEY = "mod+shift+h";
|
|
4915
5123
|
var HIGHLIGHT_COLORS = [
|
|
@@ -5054,7 +5262,7 @@ function useColorHighlight(config) {
|
|
|
5054
5262
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
5055
5263
|
};
|
|
5056
5264
|
}, [editor, hideWhenUnavailable, mode]);
|
|
5057
|
-
const handleColorHighlight =
|
|
5265
|
+
const handleColorHighlight = useCallback17(() => {
|
|
5058
5266
|
if (!editor || !canColorHighlightState || !highlightColor || !label)
|
|
5059
5267
|
return false;
|
|
5060
5268
|
if (mode === "mark") {
|
|
@@ -5082,7 +5290,7 @@ function useColorHighlight(config) {
|
|
|
5082
5290
|
return success;
|
|
5083
5291
|
}
|
|
5084
5292
|
}, [canColorHighlightState, highlightColor, editor, label, onApplied, mode]);
|
|
5085
|
-
const handleRemoveHighlight =
|
|
5293
|
+
const handleRemoveHighlight = useCallback17(() => {
|
|
5086
5294
|
const success = removeHighlight(editor, mode);
|
|
5087
5295
|
if (success) {
|
|
5088
5296
|
onApplied?.({ color: "", label: "Remove highlight", mode });
|
|
@@ -5115,8 +5323,8 @@ function useColorHighlight(config) {
|
|
|
5115
5323
|
}
|
|
5116
5324
|
|
|
5117
5325
|
// src/components/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx
|
|
5118
|
-
import { jsx as
|
|
5119
|
-
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(
|
|
5120
5328
|
Button2,
|
|
5121
5329
|
{
|
|
5122
5330
|
type: "button",
|
|
@@ -5129,7 +5337,7 @@ var ColorHighlightPopoverButton = forwardRef14(({ className, children, ...props
|
|
|
5129
5337
|
tooltip: "Highlight",
|
|
5130
5338
|
ref,
|
|
5131
5339
|
...props,
|
|
5132
|
-
children: children ?? /* @__PURE__ */
|
|
5340
|
+
children: children ?? /* @__PURE__ */ jsx49(HighlighterIcon, { className: "tiptap-button-icon" })
|
|
5133
5341
|
}
|
|
5134
5342
|
));
|
|
5135
5343
|
ColorHighlightPopoverButton.displayName = "ColorHighlightPopoverButton";
|
|
@@ -5145,8 +5353,8 @@ function ColorHighlightPopoverContent({
|
|
|
5145
5353
|
}) {
|
|
5146
5354
|
const { handleRemoveHighlight } = useColorHighlight({ editor });
|
|
5147
5355
|
const isMobile = useIsBreakpoint();
|
|
5148
|
-
const containerRef =
|
|
5149
|
-
const menuItems =
|
|
5356
|
+
const containerRef = useRef6(null);
|
|
5357
|
+
const menuItems = useMemo9(
|
|
5150
5358
|
() => [...colors, { label: "Remove highlight", value: "none" }],
|
|
5151
5359
|
[colors]
|
|
5152
5360
|
);
|
|
@@ -5165,14 +5373,14 @@ function ColorHighlightPopoverContent({
|
|
|
5165
5373
|
},
|
|
5166
5374
|
autoSelectFirstItem: false
|
|
5167
5375
|
});
|
|
5168
|
-
return /* @__PURE__ */
|
|
5376
|
+
return /* @__PURE__ */ jsx49(
|
|
5169
5377
|
Card,
|
|
5170
5378
|
{
|
|
5171
5379
|
ref: containerRef,
|
|
5172
5380
|
tabIndex: 0,
|
|
5173
5381
|
style: isMobile ? { boxShadow: "none", border: 0 } : {},
|
|
5174
|
-
children: /* @__PURE__ */
|
|
5175
|
-
/* @__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(
|
|
5176
5384
|
ColorHighlightButton,
|
|
5177
5385
|
{
|
|
5178
5386
|
editor,
|
|
@@ -5184,8 +5392,8 @@ function ColorHighlightPopoverContent({
|
|
|
5184
5392
|
},
|
|
5185
5393
|
color.value
|
|
5186
5394
|
)) }),
|
|
5187
|
-
/* @__PURE__ */
|
|
5188
|
-
/* @__PURE__ */
|
|
5395
|
+
/* @__PURE__ */ jsx49(Separator3, {}),
|
|
5396
|
+
/* @__PURE__ */ jsx49(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx49(
|
|
5189
5397
|
Button2,
|
|
5190
5398
|
{
|
|
5191
5399
|
onClick: handleRemoveHighlight,
|
|
@@ -5196,7 +5404,7 @@ function ColorHighlightPopoverContent({
|
|
|
5196
5404
|
role: "menuitem",
|
|
5197
5405
|
"data-style": "ghost",
|
|
5198
5406
|
"data-highlighted": selectedIndex === colors.length,
|
|
5199
|
-
children: /* @__PURE__ */
|
|
5407
|
+
children: /* @__PURE__ */ jsx49(BanIcon, { className: "tiptap-button-icon" })
|
|
5200
5408
|
}
|
|
5201
5409
|
) })
|
|
5202
5410
|
] }) })
|
|
@@ -5205,13 +5413,13 @@ function ColorHighlightPopoverContent({
|
|
|
5205
5413
|
}
|
|
5206
5414
|
|
|
5207
5415
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5208
|
-
import { forwardRef as forwardRef15, useCallback as
|
|
5416
|
+
import { forwardRef as forwardRef15, useCallback as useCallback18, useEffect as useEffect13, useState as useState20 } from "react";
|
|
5209
5417
|
|
|
5210
5418
|
// src/components/tiptap-icons/corner-down-left-icon.tsx
|
|
5211
|
-
import { memo as
|
|
5212
|
-
import { jsx as
|
|
5213
|
-
var CornerDownLeftIcon =
|
|
5214
|
-
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(
|
|
5215
5423
|
"svg",
|
|
5216
5424
|
{
|
|
5217
5425
|
width: "24",
|
|
@@ -5221,7 +5429,7 @@ var CornerDownLeftIcon = memo17(({ className, ...props }) => {
|
|
|
5221
5429
|
fill: "currentColor",
|
|
5222
5430
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5223
5431
|
...props,
|
|
5224
|
-
children: /* @__PURE__ */
|
|
5432
|
+
children: /* @__PURE__ */ jsx50(
|
|
5225
5433
|
"path",
|
|
5226
5434
|
{
|
|
5227
5435
|
fillRule: "evenodd",
|
|
@@ -5236,9 +5444,9 @@ var CornerDownLeftIcon = memo17(({ className, ...props }) => {
|
|
|
5236
5444
|
CornerDownLeftIcon.displayName = "CornerDownLeftIcon";
|
|
5237
5445
|
|
|
5238
5446
|
// src/components/tiptap-icons/external-link-icon.tsx
|
|
5239
|
-
import { memo as
|
|
5240
|
-
import { jsx as
|
|
5241
|
-
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 }) => {
|
|
5242
5450
|
return /* @__PURE__ */ jsxs28(
|
|
5243
5451
|
"svg",
|
|
5244
5452
|
{
|
|
@@ -5250,14 +5458,14 @@ var ExternalLinkIcon = memo18(({ className, ...props }) => {
|
|
|
5250
5458
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5251
5459
|
...props,
|
|
5252
5460
|
children: [
|
|
5253
|
-
/* @__PURE__ */
|
|
5461
|
+
/* @__PURE__ */ jsx51(
|
|
5254
5462
|
"path",
|
|
5255
5463
|
{
|
|
5256
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",
|
|
5257
5465
|
fill: "currentColor"
|
|
5258
5466
|
}
|
|
5259
5467
|
),
|
|
5260
|
-
/* @__PURE__ */
|
|
5468
|
+
/* @__PURE__ */ jsx51(
|
|
5261
5469
|
"path",
|
|
5262
5470
|
{
|
|
5263
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",
|
|
@@ -5271,9 +5479,9 @@ var ExternalLinkIcon = memo18(({ className, ...props }) => {
|
|
|
5271
5479
|
ExternalLinkIcon.displayName = "ExternalLinkIcon";
|
|
5272
5480
|
|
|
5273
5481
|
// src/components/tiptap-icons/link-icon.tsx
|
|
5274
|
-
import { memo as
|
|
5275
|
-
import { jsx as
|
|
5276
|
-
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 }) => {
|
|
5277
5485
|
return /* @__PURE__ */ jsxs29(
|
|
5278
5486
|
"svg",
|
|
5279
5487
|
{
|
|
@@ -5285,14 +5493,14 @@ var LinkIcon = memo19(({ className, ...props }) => {
|
|
|
5285
5493
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5286
5494
|
...props,
|
|
5287
5495
|
children: [
|
|
5288
|
-
/* @__PURE__ */
|
|
5496
|
+
/* @__PURE__ */ jsx52(
|
|
5289
5497
|
"path",
|
|
5290
5498
|
{
|
|
5291
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",
|
|
5292
5500
|
fill: "currentColor"
|
|
5293
5501
|
}
|
|
5294
5502
|
),
|
|
5295
|
-
/* @__PURE__ */
|
|
5503
|
+
/* @__PURE__ */ jsx52(
|
|
5296
5504
|
"path",
|
|
5297
5505
|
{
|
|
5298
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",
|
|
@@ -5306,10 +5514,10 @@ var LinkIcon = memo19(({ className, ...props }) => {
|
|
|
5306
5514
|
LinkIcon.displayName = "LinkIcon";
|
|
5307
5515
|
|
|
5308
5516
|
// src/components/tiptap-icons/trash-icon.tsx
|
|
5309
|
-
import { memo as
|
|
5310
|
-
import { jsx as
|
|
5311
|
-
var TrashIcon =
|
|
5312
|
-
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(
|
|
5313
5521
|
"svg",
|
|
5314
5522
|
{
|
|
5315
5523
|
width: "24",
|
|
@@ -5319,7 +5527,7 @@ var TrashIcon = memo20(({ className, ...props }) => {
|
|
|
5319
5527
|
fill: "currentColor",
|
|
5320
5528
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5321
5529
|
...props,
|
|
5322
|
-
children: /* @__PURE__ */
|
|
5530
|
+
children: /* @__PURE__ */ jsx53(
|
|
5323
5531
|
"path",
|
|
5324
5532
|
{
|
|
5325
5533
|
fillRule: "evenodd",
|
|
@@ -5334,23 +5542,23 @@ var TrashIcon = memo20(({ className, ...props }) => {
|
|
|
5334
5542
|
TrashIcon.displayName = "TrashIcon";
|
|
5335
5543
|
|
|
5336
5544
|
// src/components/tiptap-ui-primitive/input/input.tsx
|
|
5337
|
-
import { jsx as
|
|
5545
|
+
import { jsx as jsx54 } from "react/jsx-runtime";
|
|
5338
5546
|
function Input2({ className, type, ...props }) {
|
|
5339
|
-
return /* @__PURE__ */
|
|
5547
|
+
return /* @__PURE__ */ jsx54("input", { type, className: cn2("tiptap-input", className), ...props });
|
|
5340
5548
|
}
|
|
5341
5549
|
function InputGroup({
|
|
5342
5550
|
className,
|
|
5343
5551
|
children,
|
|
5344
5552
|
...props
|
|
5345
5553
|
}) {
|
|
5346
|
-
return /* @__PURE__ */
|
|
5554
|
+
return /* @__PURE__ */ jsx54("div", { className: cn2("tiptap-input-group", className), ...props, children });
|
|
5347
5555
|
}
|
|
5348
5556
|
|
|
5349
5557
|
// src/components/tiptap-ui/link-popover/link-popover.tsx
|
|
5350
|
-
import { jsx as
|
|
5558
|
+
import { jsx as jsx55, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
5351
5559
|
var LinkButton = forwardRef15(
|
|
5352
5560
|
({ className, children, ...props }, ref) => {
|
|
5353
|
-
return /* @__PURE__ */
|
|
5561
|
+
return /* @__PURE__ */ jsx55(
|
|
5354
5562
|
Button2,
|
|
5355
5563
|
{
|
|
5356
5564
|
type: "button",
|
|
@@ -5362,7 +5570,7 @@ var LinkButton = forwardRef15(
|
|
|
5362
5570
|
tooltip: "Link",
|
|
5363
5571
|
ref,
|
|
5364
5572
|
...props,
|
|
5365
|
-
children: children || /* @__PURE__ */
|
|
5573
|
+
children: children || /* @__PURE__ */ jsx55(LinkIcon, { className: "tiptap-button-icon" })
|
|
5366
5574
|
}
|
|
5367
5575
|
);
|
|
5368
5576
|
}
|
|
@@ -5383,20 +5591,20 @@ var LinkMain = ({
|
|
|
5383
5591
|
setLink();
|
|
5384
5592
|
}
|
|
5385
5593
|
};
|
|
5386
|
-
return /* @__PURE__ */
|
|
5594
|
+
return /* @__PURE__ */ jsx55(
|
|
5387
5595
|
Card,
|
|
5388
5596
|
{
|
|
5389
5597
|
style: {
|
|
5390
5598
|
...isMobile ? { boxShadow: "none", border: 0 } : {}
|
|
5391
5599
|
},
|
|
5392
|
-
children: /* @__PURE__ */
|
|
5600
|
+
children: /* @__PURE__ */ jsx55(
|
|
5393
5601
|
CardBody,
|
|
5394
5602
|
{
|
|
5395
5603
|
style: {
|
|
5396
5604
|
...isMobile ? { padding: 0 } : {}
|
|
5397
5605
|
},
|
|
5398
5606
|
children: /* @__PURE__ */ jsxs30(CardItemGroup, { orientation: "horizontal", children: [
|
|
5399
|
-
/* @__PURE__ */
|
|
5607
|
+
/* @__PURE__ */ jsx55(InputGroup, { children: /* @__PURE__ */ jsx55(
|
|
5400
5608
|
Input2,
|
|
5401
5609
|
{
|
|
5402
5610
|
type: "url",
|
|
@@ -5410,7 +5618,7 @@ var LinkMain = ({
|
|
|
5410
5618
|
autoCapitalize: "off"
|
|
5411
5619
|
}
|
|
5412
5620
|
) }),
|
|
5413
|
-
/* @__PURE__ */
|
|
5621
|
+
/* @__PURE__ */ jsx55(ButtonGroup, { orientation: "horizontal", children: /* @__PURE__ */ jsx55(
|
|
5414
5622
|
Button2,
|
|
5415
5623
|
{
|
|
5416
5624
|
type: "button",
|
|
@@ -5418,12 +5626,12 @@ var LinkMain = ({
|
|
|
5418
5626
|
title: "Apply link",
|
|
5419
5627
|
disabled: !url && !isActive,
|
|
5420
5628
|
"data-style": "ghost",
|
|
5421
|
-
children: /* @__PURE__ */
|
|
5629
|
+
children: /* @__PURE__ */ jsx55(CornerDownLeftIcon, { className: "tiptap-button-icon" })
|
|
5422
5630
|
}
|
|
5423
5631
|
) }),
|
|
5424
|
-
/* @__PURE__ */
|
|
5632
|
+
/* @__PURE__ */ jsx55(Separator3, {}),
|
|
5425
5633
|
/* @__PURE__ */ jsxs30(ButtonGroup, { orientation: "horizontal", children: [
|
|
5426
|
-
/* @__PURE__ */
|
|
5634
|
+
/* @__PURE__ */ jsx55(
|
|
5427
5635
|
Button2,
|
|
5428
5636
|
{
|
|
5429
5637
|
type: "button",
|
|
@@ -5431,10 +5639,10 @@ var LinkMain = ({
|
|
|
5431
5639
|
title: "Open in new window",
|
|
5432
5640
|
disabled: !url && !isActive,
|
|
5433
5641
|
"data-style": "ghost",
|
|
5434
|
-
children: /* @__PURE__ */
|
|
5642
|
+
children: /* @__PURE__ */ jsx55(ExternalLinkIcon, { className: "tiptap-button-icon" })
|
|
5435
5643
|
}
|
|
5436
5644
|
),
|
|
5437
|
-
/* @__PURE__ */
|
|
5645
|
+
/* @__PURE__ */ jsx55(
|
|
5438
5646
|
Button2,
|
|
5439
5647
|
{
|
|
5440
5648
|
type: "button",
|
|
@@ -5442,7 +5650,7 @@ var LinkMain = ({
|
|
|
5442
5650
|
title: "Remove link",
|
|
5443
5651
|
disabled: !url && !isActive,
|
|
5444
5652
|
"data-style": "ghost",
|
|
5445
|
-
children: /* @__PURE__ */
|
|
5653
|
+
children: /* @__PURE__ */ jsx55(TrashIcon, { className: "tiptap-button-icon" })
|
|
5446
5654
|
}
|
|
5447
5655
|
)
|
|
5448
5656
|
] })
|
|
@@ -5456,7 +5664,7 @@ var LinkContent = ({ editor }) => {
|
|
|
5456
5664
|
const linkPopover = useLinkPopover({
|
|
5457
5665
|
editor
|
|
5458
5666
|
});
|
|
5459
|
-
return /* @__PURE__ */
|
|
5667
|
+
return /* @__PURE__ */ jsx55(LinkMain, { ...linkPopover });
|
|
5460
5668
|
};
|
|
5461
5669
|
var LinkPopover = forwardRef15(
|
|
5462
5670
|
({
|
|
@@ -5487,18 +5695,18 @@ var LinkPopover = forwardRef15(
|
|
|
5487
5695
|
hideWhenUnavailable,
|
|
5488
5696
|
onSetLink
|
|
5489
5697
|
});
|
|
5490
|
-
const handleOnOpenChange =
|
|
5698
|
+
const handleOnOpenChange = useCallback18(
|
|
5491
5699
|
(nextIsOpen) => {
|
|
5492
5700
|
setIsOpen(nextIsOpen);
|
|
5493
5701
|
onOpenChange?.(nextIsOpen);
|
|
5494
5702
|
},
|
|
5495
5703
|
[onOpenChange]
|
|
5496
5704
|
);
|
|
5497
|
-
const handleSetLink =
|
|
5705
|
+
const handleSetLink = useCallback18(() => {
|
|
5498
5706
|
setLink();
|
|
5499
5707
|
setIsOpen(false);
|
|
5500
5708
|
}, [setLink]);
|
|
5501
|
-
const handleClick =
|
|
5709
|
+
const handleClick = useCallback18(
|
|
5502
5710
|
(event) => {
|
|
5503
5711
|
onClick?.(event);
|
|
5504
5712
|
if (event.defaultPrevented) return;
|
|
@@ -5515,7 +5723,7 @@ var LinkPopover = forwardRef15(
|
|
|
5515
5723
|
return null;
|
|
5516
5724
|
}
|
|
5517
5725
|
return /* @__PURE__ */ jsxs30(Popover, { open: isOpen, onOpenChange: handleOnOpenChange, children: [
|
|
5518
|
-
/* @__PURE__ */
|
|
5726
|
+
/* @__PURE__ */ jsx55(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx55(
|
|
5519
5727
|
LinkButton,
|
|
5520
5728
|
{
|
|
5521
5729
|
disabled: !canSet,
|
|
@@ -5526,10 +5734,10 @@ var LinkPopover = forwardRef15(
|
|
|
5526
5734
|
onClick: handleClick,
|
|
5527
5735
|
...buttonProps,
|
|
5528
5736
|
ref,
|
|
5529
|
-
children: children ?? /* @__PURE__ */
|
|
5737
|
+
children: children ?? /* @__PURE__ */ jsx55(Icon, { className: "tiptap-button-icon" })
|
|
5530
5738
|
}
|
|
5531
5739
|
) }),
|
|
5532
|
-
/* @__PURE__ */
|
|
5740
|
+
/* @__PURE__ */ jsx55(PopoverContent, { children: /* @__PURE__ */ jsx55(
|
|
5533
5741
|
LinkMain,
|
|
5534
5742
|
{
|
|
5535
5743
|
url,
|
|
@@ -5546,7 +5754,7 @@ var LinkPopover = forwardRef15(
|
|
|
5546
5754
|
LinkPopover.displayName = "LinkPopover";
|
|
5547
5755
|
|
|
5548
5756
|
// src/components/tiptap-ui/link-popover/use-link-popover.ts
|
|
5549
|
-
import { useCallback as
|
|
5757
|
+
import { useCallback as useCallback19, useEffect as useEffect14, useState as useState21 } from "react";
|
|
5550
5758
|
function canSetLink(editor) {
|
|
5551
5759
|
if (!editor || !editor.isEditable) return false;
|
|
5552
5760
|
if (isNodeTypeSelected(editor, ["image"], true)) return false;
|
|
@@ -5588,7 +5796,7 @@ function useLinkHandler(props) {
|
|
|
5588
5796
|
editor.off("selectionUpdate", updateLinkState);
|
|
5589
5797
|
};
|
|
5590
5798
|
}, [editor]);
|
|
5591
|
-
const setLink =
|
|
5799
|
+
const setLink = useCallback19(() => {
|
|
5592
5800
|
if (!url || !editor) return;
|
|
5593
5801
|
const { selection } = editor.state;
|
|
5594
5802
|
const isEmpty = selection.empty;
|
|
@@ -5601,12 +5809,12 @@ function useLinkHandler(props) {
|
|
|
5601
5809
|
setUrl(null);
|
|
5602
5810
|
onSetLink?.();
|
|
5603
5811
|
}, [editor, onSetLink, url]);
|
|
5604
|
-
const removeLink =
|
|
5812
|
+
const removeLink = useCallback19(() => {
|
|
5605
5813
|
if (!editor) return;
|
|
5606
5814
|
editor.chain().focus().extendMarkRange("link").unsetLink().setMeta("preventAutolink", true).run();
|
|
5607
5815
|
setUrl("");
|
|
5608
5816
|
}, [editor]);
|
|
5609
|
-
const openLink =
|
|
5817
|
+
const openLink = useCallback19(
|
|
5610
5818
|
(target = "_blank", features = "noopener,noreferrer") => {
|
|
5611
5819
|
if (!url) return;
|
|
5612
5820
|
const safeUrl = sanitizeUrl(url, window.location.href);
|
|
@@ -5677,13 +5885,13 @@ function useLinkPopover(config) {
|
|
|
5677
5885
|
}
|
|
5678
5886
|
|
|
5679
5887
|
// src/components/tiptap-ui/mark-button/mark-button.tsx
|
|
5680
|
-
import { forwardRef as forwardRef16, useCallback as
|
|
5681
|
-
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";
|
|
5682
5890
|
function MarkShortcutBadge({
|
|
5683
5891
|
type,
|
|
5684
5892
|
shortcutKeys = MARK_SHORTCUT_KEYS[type]
|
|
5685
5893
|
}) {
|
|
5686
|
-
return /* @__PURE__ */
|
|
5894
|
+
return /* @__PURE__ */ jsx56(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
5687
5895
|
}
|
|
5688
5896
|
var MarkButton = forwardRef16(
|
|
5689
5897
|
({
|
|
@@ -5712,7 +5920,7 @@ var MarkButton = forwardRef16(
|
|
|
5712
5920
|
hideWhenUnavailable,
|
|
5713
5921
|
onToggled
|
|
5714
5922
|
});
|
|
5715
|
-
const handleClick =
|
|
5923
|
+
const handleClick = useCallback20(
|
|
5716
5924
|
(event) => {
|
|
5717
5925
|
onClick?.(event);
|
|
5718
5926
|
if (event.defaultPrevented) return;
|
|
@@ -5723,7 +5931,7 @@ var MarkButton = forwardRef16(
|
|
|
5723
5931
|
if (!isVisible) {
|
|
5724
5932
|
return null;
|
|
5725
5933
|
}
|
|
5726
|
-
return /* @__PURE__ */
|
|
5934
|
+
return /* @__PURE__ */ jsx56(
|
|
5727
5935
|
Button2,
|
|
5728
5936
|
{
|
|
5729
5937
|
type: "button",
|
|
@@ -5740,9 +5948,9 @@ var MarkButton = forwardRef16(
|
|
|
5740
5948
|
...buttonProps,
|
|
5741
5949
|
ref,
|
|
5742
5950
|
children: children ?? /* @__PURE__ */ jsxs31(Fragment8, { children: [
|
|
5743
|
-
/* @__PURE__ */
|
|
5744
|
-
text && /* @__PURE__ */
|
|
5745
|
-
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 })
|
|
5746
5954
|
] })
|
|
5747
5955
|
}
|
|
5748
5956
|
);
|
|
@@ -5751,13 +5959,13 @@ var MarkButton = forwardRef16(
|
|
|
5751
5959
|
MarkButton.displayName = "MarkButton";
|
|
5752
5960
|
|
|
5753
5961
|
// src/components/tiptap-ui/mark-button/use-mark.ts
|
|
5754
|
-
import { useCallback as
|
|
5962
|
+
import { useCallback as useCallback21, useEffect as useEffect15, useState as useState22 } from "react";
|
|
5755
5963
|
|
|
5756
5964
|
// src/components/tiptap-icons/bold-icon.tsx
|
|
5757
|
-
import { memo as
|
|
5758
|
-
import { jsx as
|
|
5759
|
-
var BoldIcon =
|
|
5760
|
-
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(
|
|
5761
5969
|
"svg",
|
|
5762
5970
|
{
|
|
5763
5971
|
width: "24",
|
|
@@ -5767,7 +5975,7 @@ var BoldIcon = memo21(({ className, ...props }) => {
|
|
|
5767
5975
|
fill: "currentColor",
|
|
5768
5976
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5769
5977
|
...props,
|
|
5770
|
-
children: /* @__PURE__ */
|
|
5978
|
+
children: /* @__PURE__ */ jsx57(
|
|
5771
5979
|
"path",
|
|
5772
5980
|
{
|
|
5773
5981
|
fillRule: "evenodd",
|
|
@@ -5782,9 +5990,9 @@ var BoldIcon = memo21(({ className, ...props }) => {
|
|
|
5782
5990
|
BoldIcon.displayName = "BoldIcon";
|
|
5783
5991
|
|
|
5784
5992
|
// src/components/tiptap-icons/code2-icon.tsx
|
|
5785
|
-
import { memo as
|
|
5786
|
-
import { jsx as
|
|
5787
|
-
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 }) => {
|
|
5788
5996
|
return /* @__PURE__ */ jsxs32(
|
|
5789
5997
|
"svg",
|
|
5790
5998
|
{
|
|
@@ -5796,21 +6004,21 @@ var Code2Icon = memo22(({ className, ...props }) => {
|
|
|
5796
6004
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5797
6005
|
...props,
|
|
5798
6006
|
children: [
|
|
5799
|
-
/* @__PURE__ */
|
|
6007
|
+
/* @__PURE__ */ jsx58(
|
|
5800
6008
|
"path",
|
|
5801
6009
|
{
|
|
5802
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",
|
|
5803
6011
|
fill: "currentColor"
|
|
5804
6012
|
}
|
|
5805
6013
|
),
|
|
5806
|
-
/* @__PURE__ */
|
|
6014
|
+
/* @__PURE__ */ jsx58(
|
|
5807
6015
|
"path",
|
|
5808
6016
|
{
|
|
5809
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",
|
|
5810
6018
|
fill: "currentColor"
|
|
5811
6019
|
}
|
|
5812
6020
|
),
|
|
5813
|
-
/* @__PURE__ */
|
|
6021
|
+
/* @__PURE__ */ jsx58(
|
|
5814
6022
|
"path",
|
|
5815
6023
|
{
|
|
5816
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",
|
|
@@ -5824,10 +6032,10 @@ var Code2Icon = memo22(({ className, ...props }) => {
|
|
|
5824
6032
|
Code2Icon.displayName = "Code2Icon";
|
|
5825
6033
|
|
|
5826
6034
|
// src/components/tiptap-icons/italic-icon.tsx
|
|
5827
|
-
import { memo as
|
|
5828
|
-
import { jsx as
|
|
5829
|
-
var ItalicIcon =
|
|
5830
|
-
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(
|
|
5831
6039
|
"svg",
|
|
5832
6040
|
{
|
|
5833
6041
|
width: "24",
|
|
@@ -5837,7 +6045,7 @@ var ItalicIcon = memo23(({ className, ...props }) => {
|
|
|
5837
6045
|
fill: "currentColor",
|
|
5838
6046
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5839
6047
|
...props,
|
|
5840
|
-
children: /* @__PURE__ */
|
|
6048
|
+
children: /* @__PURE__ */ jsx59(
|
|
5841
6049
|
"path",
|
|
5842
6050
|
{
|
|
5843
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",
|
|
@@ -5850,9 +6058,9 @@ var ItalicIcon = memo23(({ className, ...props }) => {
|
|
|
5850
6058
|
ItalicIcon.displayName = "ItalicIcon";
|
|
5851
6059
|
|
|
5852
6060
|
// src/components/tiptap-icons/strike-icon.tsx
|
|
5853
|
-
import { memo as
|
|
5854
|
-
import { jsx as
|
|
5855
|
-
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 }) => {
|
|
5856
6064
|
return /* @__PURE__ */ jsxs33(
|
|
5857
6065
|
"svg",
|
|
5858
6066
|
{
|
|
@@ -5864,14 +6072,14 @@ var StrikeIcon = memo24(({ className, ...props }) => {
|
|
|
5864
6072
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5865
6073
|
...props,
|
|
5866
6074
|
children: [
|
|
5867
|
-
/* @__PURE__ */
|
|
6075
|
+
/* @__PURE__ */ jsx60(
|
|
5868
6076
|
"path",
|
|
5869
6077
|
{
|
|
5870
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",
|
|
5871
6079
|
fill: "currentColor"
|
|
5872
6080
|
}
|
|
5873
6081
|
),
|
|
5874
|
-
/* @__PURE__ */
|
|
6082
|
+
/* @__PURE__ */ jsx60(
|
|
5875
6083
|
"path",
|
|
5876
6084
|
{
|
|
5877
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",
|
|
@@ -5885,9 +6093,9 @@ var StrikeIcon = memo24(({ className, ...props }) => {
|
|
|
5885
6093
|
StrikeIcon.displayName = "StrikeIcon";
|
|
5886
6094
|
|
|
5887
6095
|
// src/components/tiptap-icons/subscript-icon.tsx
|
|
5888
|
-
import { memo as
|
|
5889
|
-
import { jsx as
|
|
5890
|
-
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 }) => {
|
|
5891
6099
|
return /* @__PURE__ */ jsxs34(
|
|
5892
6100
|
"svg",
|
|
5893
6101
|
{
|
|
@@ -5899,7 +6107,7 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5899
6107
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5900
6108
|
...props,
|
|
5901
6109
|
children: [
|
|
5902
|
-
/* @__PURE__ */
|
|
6110
|
+
/* @__PURE__ */ jsx61(
|
|
5903
6111
|
"path",
|
|
5904
6112
|
{
|
|
5905
6113
|
fillRule: "evenodd",
|
|
@@ -5908,7 +6116,7 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5908
6116
|
fill: "currentColor"
|
|
5909
6117
|
}
|
|
5910
6118
|
),
|
|
5911
|
-
/* @__PURE__ */
|
|
6119
|
+
/* @__PURE__ */ jsx61(
|
|
5912
6120
|
"path",
|
|
5913
6121
|
{
|
|
5914
6122
|
fillRule: "evenodd",
|
|
@@ -5917,7 +6125,7 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5917
6125
|
fill: "currentColor"
|
|
5918
6126
|
}
|
|
5919
6127
|
),
|
|
5920
|
-
/* @__PURE__ */
|
|
6128
|
+
/* @__PURE__ */ jsx61(
|
|
5921
6129
|
"path",
|
|
5922
6130
|
{
|
|
5923
6131
|
fillRule: "evenodd",
|
|
@@ -5933,9 +6141,9 @@ var SubscriptIcon = memo25(({ className, ...props }) => {
|
|
|
5933
6141
|
SubscriptIcon.displayName = "SubscriptIcon";
|
|
5934
6142
|
|
|
5935
6143
|
// src/components/tiptap-icons/superscript-icon.tsx
|
|
5936
|
-
import { memo as
|
|
5937
|
-
import { jsx as
|
|
5938
|
-
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 }) => {
|
|
5939
6147
|
return /* @__PURE__ */ jsxs35(
|
|
5940
6148
|
"svg",
|
|
5941
6149
|
{
|
|
@@ -5947,7 +6155,7 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5947
6155
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5948
6156
|
...props,
|
|
5949
6157
|
children: [
|
|
5950
|
-
/* @__PURE__ */
|
|
6158
|
+
/* @__PURE__ */ jsx62(
|
|
5951
6159
|
"path",
|
|
5952
6160
|
{
|
|
5953
6161
|
fillRule: "evenodd",
|
|
@@ -5956,7 +6164,7 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5956
6164
|
fill: "currentColor"
|
|
5957
6165
|
}
|
|
5958
6166
|
),
|
|
5959
|
-
/* @__PURE__ */
|
|
6167
|
+
/* @__PURE__ */ jsx62(
|
|
5960
6168
|
"path",
|
|
5961
6169
|
{
|
|
5962
6170
|
fillRule: "evenodd",
|
|
@@ -5965,7 +6173,7 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5965
6173
|
fill: "currentColor"
|
|
5966
6174
|
}
|
|
5967
6175
|
),
|
|
5968
|
-
/* @__PURE__ */
|
|
6176
|
+
/* @__PURE__ */ jsx62(
|
|
5969
6177
|
"path",
|
|
5970
6178
|
{
|
|
5971
6179
|
fillRule: "evenodd",
|
|
@@ -5981,10 +6189,10 @@ var SuperscriptIcon = memo26(({ className, ...props }) => {
|
|
|
5981
6189
|
SuperscriptIcon.displayName = "SuperscriptIcon";
|
|
5982
6190
|
|
|
5983
6191
|
// src/components/tiptap-icons/underline-icon.tsx
|
|
5984
|
-
import { memo as
|
|
5985
|
-
import { jsx as
|
|
5986
|
-
var UnderlineIcon =
|
|
5987
|
-
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(
|
|
5988
6196
|
"svg",
|
|
5989
6197
|
{
|
|
5990
6198
|
width: "24",
|
|
@@ -5994,7 +6202,7 @@ var UnderlineIcon = memo27(({ className, ...props }) => {
|
|
|
5994
6202
|
fill: "currentColor",
|
|
5995
6203
|
xmlns: "http://www.w3.org/2000/svg",
|
|
5996
6204
|
...props,
|
|
5997
|
-
children: /* @__PURE__ */
|
|
6205
|
+
children: /* @__PURE__ */ jsx63(
|
|
5998
6206
|
"path",
|
|
5999
6207
|
{
|
|
6000
6208
|
fillRule: "evenodd",
|
|
@@ -6076,7 +6284,7 @@ function useMark(config) {
|
|
|
6076
6284
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6077
6285
|
};
|
|
6078
6286
|
}, [editor, type, hideWhenUnavailable]);
|
|
6079
|
-
const handleMark =
|
|
6287
|
+
const handleMark = useCallback21(() => {
|
|
6080
6288
|
if (!editor) return false;
|
|
6081
6289
|
const success = toggleMark(editor, type);
|
|
6082
6290
|
if (success) {
|
|
@@ -6096,13 +6304,13 @@ function useMark(config) {
|
|
|
6096
6304
|
}
|
|
6097
6305
|
|
|
6098
6306
|
// src/components/tiptap-ui/text-align-button/text-align-button.tsx
|
|
6099
|
-
import { forwardRef as forwardRef17, useCallback as
|
|
6100
|
-
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";
|
|
6101
6309
|
function TextAlignShortcutBadge({
|
|
6102
6310
|
align,
|
|
6103
6311
|
shortcutKeys = TEXT_ALIGN_SHORTCUT_KEYS[align]
|
|
6104
6312
|
}) {
|
|
6105
|
-
return /* @__PURE__ */
|
|
6313
|
+
return /* @__PURE__ */ jsx64(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6106
6314
|
}
|
|
6107
6315
|
var TextAlignButton = forwardRef17(
|
|
6108
6316
|
({
|
|
@@ -6132,7 +6340,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6132
6340
|
hideWhenUnavailable,
|
|
6133
6341
|
onAligned
|
|
6134
6342
|
});
|
|
6135
|
-
const handleClick =
|
|
6343
|
+
const handleClick = useCallback22(
|
|
6136
6344
|
(event) => {
|
|
6137
6345
|
onClick?.(event);
|
|
6138
6346
|
if (event.defaultPrevented) return;
|
|
@@ -6144,7 +6352,7 @@ var TextAlignButton = forwardRef17(
|
|
|
6144
6352
|
return null;
|
|
6145
6353
|
}
|
|
6146
6354
|
const RenderIcon = CustomIcon ?? Icon;
|
|
6147
|
-
return /* @__PURE__ */
|
|
6355
|
+
return /* @__PURE__ */ jsx64(
|
|
6148
6356
|
Button2,
|
|
6149
6357
|
{
|
|
6150
6358
|
type: "button",
|
|
@@ -6161,9 +6369,9 @@ var TextAlignButton = forwardRef17(
|
|
|
6161
6369
|
...buttonProps,
|
|
6162
6370
|
ref,
|
|
6163
6371
|
children: children ?? /* @__PURE__ */ jsxs36(Fragment9, { children: [
|
|
6164
|
-
/* @__PURE__ */
|
|
6165
|
-
text && /* @__PURE__ */
|
|
6166
|
-
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(
|
|
6167
6375
|
TextAlignShortcutBadge,
|
|
6168
6376
|
{
|
|
6169
6377
|
align,
|
|
@@ -6178,12 +6386,12 @@ var TextAlignButton = forwardRef17(
|
|
|
6178
6386
|
TextAlignButton.displayName = "TextAlignButton";
|
|
6179
6387
|
|
|
6180
6388
|
// src/components/tiptap-ui/text-align-button/use-text-align.ts
|
|
6181
|
-
import { useCallback as
|
|
6389
|
+
import { useCallback as useCallback23, useEffect as useEffect16, useState as useState23 } from "react";
|
|
6182
6390
|
|
|
6183
6391
|
// src/components/tiptap-icons/align-center-icon.tsx
|
|
6184
|
-
import { memo as
|
|
6185
|
-
import { jsx as
|
|
6186
|
-
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 }) => {
|
|
6187
6395
|
return /* @__PURE__ */ jsxs37(
|
|
6188
6396
|
"svg",
|
|
6189
6397
|
{
|
|
@@ -6195,7 +6403,7 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6195
6403
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6196
6404
|
...props,
|
|
6197
6405
|
children: [
|
|
6198
|
-
/* @__PURE__ */
|
|
6406
|
+
/* @__PURE__ */ jsx65(
|
|
6199
6407
|
"path",
|
|
6200
6408
|
{
|
|
6201
6409
|
fillRule: "evenodd",
|
|
@@ -6204,7 +6412,7 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6204
6412
|
fill: "currentColor"
|
|
6205
6413
|
}
|
|
6206
6414
|
),
|
|
6207
|
-
/* @__PURE__ */
|
|
6415
|
+
/* @__PURE__ */ jsx65(
|
|
6208
6416
|
"path",
|
|
6209
6417
|
{
|
|
6210
6418
|
fillRule: "evenodd",
|
|
@@ -6213,7 +6421,7 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6213
6421
|
fill: "currentColor"
|
|
6214
6422
|
}
|
|
6215
6423
|
),
|
|
6216
|
-
/* @__PURE__ */
|
|
6424
|
+
/* @__PURE__ */ jsx65(
|
|
6217
6425
|
"path",
|
|
6218
6426
|
{
|
|
6219
6427
|
fillRule: "evenodd",
|
|
@@ -6229,9 +6437,9 @@ var AlignCenterIcon = memo28(({ className, ...props }) => {
|
|
|
6229
6437
|
AlignCenterIcon.displayName = "AlignCenterIcon";
|
|
6230
6438
|
|
|
6231
6439
|
// src/components/tiptap-icons/align-justify-icon.tsx
|
|
6232
|
-
import { memo as
|
|
6233
|
-
import { jsx as
|
|
6234
|
-
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 }) => {
|
|
6235
6443
|
return /* @__PURE__ */ jsxs38(
|
|
6236
6444
|
"svg",
|
|
6237
6445
|
{
|
|
@@ -6243,7 +6451,7 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6243
6451
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6244
6452
|
...props,
|
|
6245
6453
|
children: [
|
|
6246
|
-
/* @__PURE__ */
|
|
6454
|
+
/* @__PURE__ */ jsx66(
|
|
6247
6455
|
"path",
|
|
6248
6456
|
{
|
|
6249
6457
|
fillRule: "evenodd",
|
|
@@ -6252,7 +6460,7 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6252
6460
|
fill: "currentColor"
|
|
6253
6461
|
}
|
|
6254
6462
|
),
|
|
6255
|
-
/* @__PURE__ */
|
|
6463
|
+
/* @__PURE__ */ jsx66(
|
|
6256
6464
|
"path",
|
|
6257
6465
|
{
|
|
6258
6466
|
fillRule: "evenodd",
|
|
@@ -6261,7 +6469,7 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6261
6469
|
fill: "currentColor"
|
|
6262
6470
|
}
|
|
6263
6471
|
),
|
|
6264
|
-
/* @__PURE__ */
|
|
6472
|
+
/* @__PURE__ */ jsx66(
|
|
6265
6473
|
"path",
|
|
6266
6474
|
{
|
|
6267
6475
|
fillRule: "evenodd",
|
|
@@ -6277,9 +6485,9 @@ var AlignJustifyIcon = memo29(({ className, ...props }) => {
|
|
|
6277
6485
|
AlignJustifyIcon.displayName = "AlignJustifyIcon";
|
|
6278
6486
|
|
|
6279
6487
|
// src/components/tiptap-icons/align-left-icon.tsx
|
|
6280
|
-
import { memo as
|
|
6281
|
-
import { jsx as
|
|
6282
|
-
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 }) => {
|
|
6283
6491
|
return /* @__PURE__ */ jsxs39(
|
|
6284
6492
|
"svg",
|
|
6285
6493
|
{
|
|
@@ -6291,7 +6499,7 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6291
6499
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6292
6500
|
...props,
|
|
6293
6501
|
children: [
|
|
6294
|
-
/* @__PURE__ */
|
|
6502
|
+
/* @__PURE__ */ jsx67(
|
|
6295
6503
|
"path",
|
|
6296
6504
|
{
|
|
6297
6505
|
fillRule: "evenodd",
|
|
@@ -6300,7 +6508,7 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6300
6508
|
fill: "currentColor"
|
|
6301
6509
|
}
|
|
6302
6510
|
),
|
|
6303
|
-
/* @__PURE__ */
|
|
6511
|
+
/* @__PURE__ */ jsx67(
|
|
6304
6512
|
"path",
|
|
6305
6513
|
{
|
|
6306
6514
|
fillRule: "evenodd",
|
|
@@ -6309,7 +6517,7 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6309
6517
|
fill: "currentColor"
|
|
6310
6518
|
}
|
|
6311
6519
|
),
|
|
6312
|
-
/* @__PURE__ */
|
|
6520
|
+
/* @__PURE__ */ jsx67(
|
|
6313
6521
|
"path",
|
|
6314
6522
|
{
|
|
6315
6523
|
fillRule: "evenodd",
|
|
@@ -6325,9 +6533,9 @@ var AlignLeftIcon = memo30(({ className, ...props }) => {
|
|
|
6325
6533
|
AlignLeftIcon.displayName = "AlignLeftIcon";
|
|
6326
6534
|
|
|
6327
6535
|
// src/components/tiptap-icons/align-right-icon.tsx
|
|
6328
|
-
import { memo as
|
|
6329
|
-
import { jsx as
|
|
6330
|
-
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 }) => {
|
|
6331
6539
|
return /* @__PURE__ */ jsxs40(
|
|
6332
6540
|
"svg",
|
|
6333
6541
|
{
|
|
@@ -6339,7 +6547,7 @@ var AlignRightIcon = memo31(({ className, ...props }) => {
|
|
|
6339
6547
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6340
6548
|
...props,
|
|
6341
6549
|
children: [
|
|
6342
|
-
/* @__PURE__ */
|
|
6550
|
+
/* @__PURE__ */ jsx68(
|
|
6343
6551
|
"path",
|
|
6344
6552
|
{
|
|
6345
6553
|
fillRule: "evenodd",
|
|
@@ -6348,7 +6556,7 @@ var AlignRightIcon = memo31(({ className, ...props }) => {
|
|
|
6348
6556
|
fill: "currentColor"
|
|
6349
6557
|
}
|
|
6350
6558
|
),
|
|
6351
|
-
/* @__PURE__ */
|
|
6559
|
+
/* @__PURE__ */ jsx68(
|
|
6352
6560
|
"path",
|
|
6353
6561
|
{
|
|
6354
6562
|
fillRule: "evenodd",
|
|
@@ -6357,7 +6565,7 @@ var AlignRightIcon = memo31(({ className, ...props }) => {
|
|
|
6357
6565
|
fill: "currentColor"
|
|
6358
6566
|
}
|
|
6359
6567
|
),
|
|
6360
|
-
/* @__PURE__ */
|
|
6568
|
+
/* @__PURE__ */ jsx68(
|
|
6361
6569
|
"path",
|
|
6362
6570
|
{
|
|
6363
6571
|
fillRule: "evenodd",
|
|
@@ -6444,7 +6652,7 @@ function useTextAlign(config) {
|
|
|
6444
6652
|
editor.off("selectionUpdate", handleSelectionUpdate);
|
|
6445
6653
|
};
|
|
6446
6654
|
}, [editor, hideWhenUnavailable, align]);
|
|
6447
|
-
const handleTextAlign =
|
|
6655
|
+
const handleTextAlign = useCallback23(() => {
|
|
6448
6656
|
if (!editor) return false;
|
|
6449
6657
|
const success = setTextAlign(editor, align);
|
|
6450
6658
|
if (success) {
|
|
@@ -6464,13 +6672,13 @@ function useTextAlign(config) {
|
|
|
6464
6672
|
}
|
|
6465
6673
|
|
|
6466
6674
|
// src/components/tiptap-ui/undo-redo-button/undo-redo-button.tsx
|
|
6467
|
-
import { forwardRef as forwardRef18, useCallback as
|
|
6468
|
-
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";
|
|
6469
6677
|
function HistoryShortcutBadge({
|
|
6470
6678
|
action,
|
|
6471
6679
|
shortcutKeys = UNDO_REDO_SHORTCUT_KEYS[action]
|
|
6472
6680
|
}) {
|
|
6473
|
-
return /* @__PURE__ */
|
|
6681
|
+
return /* @__PURE__ */ jsx69(Badge, { children: parseShortcutKeys({ shortcutKeys }) });
|
|
6474
6682
|
}
|
|
6475
6683
|
var UndoRedoButton = forwardRef18(
|
|
6476
6684
|
({
|
|
@@ -6491,7 +6699,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6491
6699
|
hideWhenUnavailable,
|
|
6492
6700
|
onExecuted
|
|
6493
6701
|
});
|
|
6494
|
-
const handleClick =
|
|
6702
|
+
const handleClick = useCallback24(
|
|
6495
6703
|
(event) => {
|
|
6496
6704
|
onClick?.(event);
|
|
6497
6705
|
if (event.defaultPrevented) return;
|
|
@@ -6502,7 +6710,7 @@ var UndoRedoButton = forwardRef18(
|
|
|
6502
6710
|
if (!isVisible) {
|
|
6503
6711
|
return null;
|
|
6504
6712
|
}
|
|
6505
|
-
return /* @__PURE__ */
|
|
6713
|
+
return /* @__PURE__ */ jsx69(
|
|
6506
6714
|
Button2,
|
|
6507
6715
|
{
|
|
6508
6716
|
type: "button",
|
|
@@ -6517,9 +6725,9 @@ var UndoRedoButton = forwardRef18(
|
|
|
6517
6725
|
...buttonProps,
|
|
6518
6726
|
ref,
|
|
6519
6727
|
children: children ?? /* @__PURE__ */ jsxs41(Fragment10, { children: [
|
|
6520
|
-
/* @__PURE__ */
|
|
6521
|
-
text && /* @__PURE__ */
|
|
6522
|
-
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(
|
|
6523
6731
|
HistoryShortcutBadge,
|
|
6524
6732
|
{
|
|
6525
6733
|
action,
|
|
@@ -6534,13 +6742,13 @@ var UndoRedoButton = forwardRef18(
|
|
|
6534
6742
|
UndoRedoButton.displayName = "UndoRedoButton";
|
|
6535
6743
|
|
|
6536
6744
|
// src/components/tiptap-ui/undo-redo-button/use-undo-redo.ts
|
|
6537
|
-
import { useCallback as
|
|
6745
|
+
import { useCallback as useCallback25, useEffect as useEffect17, useState as useState24 } from "react";
|
|
6538
6746
|
|
|
6539
6747
|
// src/components/tiptap-icons/redo2-icon.tsx
|
|
6540
|
-
import { memo as
|
|
6541
|
-
import { jsx as
|
|
6542
|
-
var Redo2Icon =
|
|
6543
|
-
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(
|
|
6544
6752
|
"svg",
|
|
6545
6753
|
{
|
|
6546
6754
|
width: "24",
|
|
@@ -6550,7 +6758,7 @@ var Redo2Icon = memo32(({ className, ...props }) => {
|
|
|
6550
6758
|
fill: "currentColor",
|
|
6551
6759
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6552
6760
|
...props,
|
|
6553
|
-
children: /* @__PURE__ */
|
|
6761
|
+
children: /* @__PURE__ */ jsx70(
|
|
6554
6762
|
"path",
|
|
6555
6763
|
{
|
|
6556
6764
|
fillRule: "evenodd",
|
|
@@ -6565,10 +6773,10 @@ var Redo2Icon = memo32(({ className, ...props }) => {
|
|
|
6565
6773
|
Redo2Icon.displayName = "Redo2Icon";
|
|
6566
6774
|
|
|
6567
6775
|
// src/components/tiptap-icons/undo2-icon.tsx
|
|
6568
|
-
import { memo as
|
|
6569
|
-
import { jsx as
|
|
6570
|
-
var Undo2Icon =
|
|
6571
|
-
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(
|
|
6572
6780
|
"svg",
|
|
6573
6781
|
{
|
|
6574
6782
|
width: "24",
|
|
@@ -6578,7 +6786,7 @@ var Undo2Icon = memo33(({ className, ...props }) => {
|
|
|
6578
6786
|
fill: "currentColor",
|
|
6579
6787
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6580
6788
|
...props,
|
|
6581
|
-
children: /* @__PURE__ */
|
|
6789
|
+
children: /* @__PURE__ */ jsx71(
|
|
6582
6790
|
"path",
|
|
6583
6791
|
{
|
|
6584
6792
|
fillRule: "evenodd",
|
|
@@ -6645,7 +6853,7 @@ function useUndoRedo(config) {
|
|
|
6645
6853
|
editor.off("transaction", handleUpdate);
|
|
6646
6854
|
};
|
|
6647
6855
|
}, [editor, hideWhenUnavailable, action]);
|
|
6648
|
-
const handleAction =
|
|
6856
|
+
const handleAction = useCallback25(() => {
|
|
6649
6857
|
if (!editor) return false;
|
|
6650
6858
|
const success = executeUndoRedoAction(editor, action);
|
|
6651
6859
|
if (success) {
|
|
@@ -6709,12 +6917,12 @@ import { ChevronDown } from "lucide-react";
|
|
|
6709
6917
|
// src/components/ui/command.tsx
|
|
6710
6918
|
import { Command as CommandPrimitive } from "cmdk";
|
|
6711
6919
|
import { SearchIcon } from "lucide-react";
|
|
6712
|
-
import { jsx as
|
|
6920
|
+
import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
6713
6921
|
function Command({
|
|
6714
6922
|
className,
|
|
6715
6923
|
...props
|
|
6716
6924
|
}) {
|
|
6717
|
-
return /* @__PURE__ */
|
|
6925
|
+
return /* @__PURE__ */ jsx72(
|
|
6718
6926
|
CommandPrimitive,
|
|
6719
6927
|
{
|
|
6720
6928
|
"data-slot": "command",
|
|
@@ -6736,8 +6944,8 @@ function CommandInput({
|
|
|
6736
6944
|
"data-slot": "command-input-wrapper",
|
|
6737
6945
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
6738
6946
|
children: [
|
|
6739
|
-
/* @__PURE__ */
|
|
6740
|
-
/* @__PURE__ */
|
|
6947
|
+
/* @__PURE__ */ jsx72(SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
6948
|
+
/* @__PURE__ */ jsx72(
|
|
6741
6949
|
CommandPrimitive.Input,
|
|
6742
6950
|
{
|
|
6743
6951
|
"data-slot": "command-input",
|
|
@@ -6756,7 +6964,7 @@ function CommandList({
|
|
|
6756
6964
|
className,
|
|
6757
6965
|
...props
|
|
6758
6966
|
}) {
|
|
6759
|
-
return /* @__PURE__ */
|
|
6967
|
+
return /* @__PURE__ */ jsx72(
|
|
6760
6968
|
CommandPrimitive.List,
|
|
6761
6969
|
{
|
|
6762
6970
|
"data-slot": "command-list",
|
|
@@ -6771,7 +6979,7 @@ function CommandList({
|
|
|
6771
6979
|
function CommandEmpty({
|
|
6772
6980
|
...props
|
|
6773
6981
|
}) {
|
|
6774
|
-
return /* @__PURE__ */
|
|
6982
|
+
return /* @__PURE__ */ jsx72(
|
|
6775
6983
|
CommandPrimitive.Empty,
|
|
6776
6984
|
{
|
|
6777
6985
|
"data-slot": "command-empty",
|
|
@@ -6784,7 +6992,7 @@ function CommandGroup({
|
|
|
6784
6992
|
className,
|
|
6785
6993
|
...props
|
|
6786
6994
|
}) {
|
|
6787
|
-
return /* @__PURE__ */
|
|
6995
|
+
return /* @__PURE__ */ jsx72(
|
|
6788
6996
|
CommandPrimitive.Group,
|
|
6789
6997
|
{
|
|
6790
6998
|
"data-slot": "command-group",
|
|
@@ -6800,7 +7008,7 @@ function CommandItem({
|
|
|
6800
7008
|
className,
|
|
6801
7009
|
...props
|
|
6802
7010
|
}) {
|
|
6803
|
-
return /* @__PURE__ */
|
|
7011
|
+
return /* @__PURE__ */ jsx72(
|
|
6804
7012
|
CommandPrimitive.Item,
|
|
6805
7013
|
{
|
|
6806
7014
|
"data-slot": "command-item",
|
|
@@ -6815,16 +7023,16 @@ function CommandItem({
|
|
|
6815
7023
|
|
|
6816
7024
|
// src/components/ui/popover.tsx
|
|
6817
7025
|
import * as PopoverPrimitive2 from "@radix-ui/react-popover";
|
|
6818
|
-
import { jsx as
|
|
7026
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
6819
7027
|
function Popover2({
|
|
6820
7028
|
...props
|
|
6821
7029
|
}) {
|
|
6822
|
-
return /* @__PURE__ */
|
|
7030
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Root, { "data-slot": "popover", ...props });
|
|
6823
7031
|
}
|
|
6824
7032
|
function PopoverTrigger2({
|
|
6825
7033
|
...props
|
|
6826
7034
|
}) {
|
|
6827
|
-
return /* @__PURE__ */
|
|
7035
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Trigger, { "data-slot": "popover-trigger", ...props });
|
|
6828
7036
|
}
|
|
6829
7037
|
function PopoverContent2({
|
|
6830
7038
|
className,
|
|
@@ -6832,7 +7040,7 @@ function PopoverContent2({
|
|
|
6832
7040
|
sideOffset = 4,
|
|
6833
7041
|
...props
|
|
6834
7042
|
}) {
|
|
6835
|
-
return /* @__PURE__ */
|
|
7043
|
+
return /* @__PURE__ */ jsx73(PopoverPrimitive2.Portal, { children: /* @__PURE__ */ jsx73(
|
|
6836
7044
|
PopoverPrimitive2.Content,
|
|
6837
7045
|
{
|
|
6838
7046
|
"data-slot": "popover-content",
|
|
@@ -6848,7 +7056,7 @@ function PopoverContent2({
|
|
|
6848
7056
|
}
|
|
6849
7057
|
|
|
6850
7058
|
// src/components/tiptap-ui/font-family-dropdown/font-family-dropdown.tsx
|
|
6851
|
-
import { jsx as
|
|
7059
|
+
import { jsx as jsx74, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
6852
7060
|
function FontFamilyDropdown() {
|
|
6853
7061
|
const { editor } = useCurrentEditor3();
|
|
6854
7062
|
const [open, setOpen] = useState25(false);
|
|
@@ -6870,18 +7078,18 @@ function FontFamilyDropdown() {
|
|
|
6870
7078
|
}, 0);
|
|
6871
7079
|
};
|
|
6872
7080
|
return /* @__PURE__ */ jsxs43(Popover2, { open, onOpenChange: setOpen, children: [
|
|
6873
|
-
/* @__PURE__ */
|
|
7081
|
+
/* @__PURE__ */ jsx74(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs43(
|
|
6874
7082
|
Button,
|
|
6875
7083
|
{
|
|
6876
7084
|
variant: "outlineFontFamily",
|
|
6877
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 ",
|
|
6878
7086
|
children: [
|
|
6879
7087
|
currentFont,
|
|
6880
|
-
/* @__PURE__ */
|
|
7088
|
+
/* @__PURE__ */ jsx74(ChevronDown, { className: "w-4 h-4" })
|
|
6881
7089
|
]
|
|
6882
7090
|
}
|
|
6883
7091
|
) }),
|
|
6884
|
-
/* @__PURE__ */
|
|
7092
|
+
/* @__PURE__ */ jsx74(
|
|
6885
7093
|
PopoverContent2,
|
|
6886
7094
|
{
|
|
6887
7095
|
className: "w-[300px] p-0",
|
|
@@ -6893,11 +7101,11 @@ function FontFamilyDropdown() {
|
|
|
6893
7101
|
}
|
|
6894
7102
|
},
|
|
6895
7103
|
children: /* @__PURE__ */ jsxs43(Command, { children: [
|
|
6896
|
-
/* @__PURE__ */
|
|
7104
|
+
/* @__PURE__ */ jsx74("div", { className: "cmd-input-wrapper", children: /* @__PURE__ */ jsx74(CommandInput, { placeholder: "Search font..." }) }),
|
|
6897
7105
|
/* @__PURE__ */ jsxs43(CommandList, { className: "max-h-[220px]", children: [
|
|
6898
|
-
/* @__PURE__ */
|
|
7106
|
+
/* @__PURE__ */ jsx74(CommandEmpty, { children: "No font found." }),
|
|
6899
7107
|
/* @__PURE__ */ jsxs43(CommandGroup, { children: [
|
|
6900
|
-
/* @__PURE__ */
|
|
7108
|
+
/* @__PURE__ */ jsx74(
|
|
6901
7109
|
CommandItem,
|
|
6902
7110
|
{
|
|
6903
7111
|
onSelect: () => {
|
|
@@ -6920,7 +7128,7 @@ function FontFamilyDropdown() {
|
|
|
6920
7128
|
},
|
|
6921
7129
|
"default"
|
|
6922
7130
|
),
|
|
6923
|
-
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */
|
|
7131
|
+
FONT_OPTIONS.map(({ label, cssFontFamily }) => /* @__PURE__ */ jsx74(
|
|
6924
7132
|
CommandItem,
|
|
6925
7133
|
{
|
|
6926
7134
|
onSelect: () => {
|
|
@@ -7031,12 +7239,12 @@ import { debounce } from "lodash";
|
|
|
7031
7239
|
|
|
7032
7240
|
// src/components/ui/label.tsx
|
|
7033
7241
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
7034
|
-
import { jsx as
|
|
7242
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
7035
7243
|
function Label2({
|
|
7036
7244
|
className,
|
|
7037
7245
|
...props
|
|
7038
7246
|
}) {
|
|
7039
|
-
return /* @__PURE__ */
|
|
7247
|
+
return /* @__PURE__ */ jsx75(
|
|
7040
7248
|
LabelPrimitive.Root,
|
|
7041
7249
|
{
|
|
7042
7250
|
"data-slot": "label",
|
|
@@ -7051,7 +7259,7 @@ function Label2({
|
|
|
7051
7259
|
|
|
7052
7260
|
// src/components/tiptap-ui/color-picker/color-picker.tsx
|
|
7053
7261
|
import React4 from "react";
|
|
7054
|
-
import { jsx as
|
|
7262
|
+
import { jsx as jsx76, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
7055
7263
|
function ColorPicker({ type = "text" }) {
|
|
7056
7264
|
const { editor } = useCurrentEditor4();
|
|
7057
7265
|
const [open, setOpen] = useState26(false);
|
|
@@ -7102,14 +7310,14 @@ function ColorPicker({ type = "text" }) {
|
|
|
7102
7310
|
);
|
|
7103
7311
|
if (!editor) return null;
|
|
7104
7312
|
return /* @__PURE__ */ jsxs44(Popover2, { open, onOpenChange: (v) => setOpen(v), children: [
|
|
7105
|
-
/* @__PURE__ */
|
|
7313
|
+
/* @__PURE__ */ jsx76(PopoverTrigger2, { asChild: true, children: /* @__PURE__ */ jsxs44(
|
|
7106
7314
|
Button,
|
|
7107
7315
|
{
|
|
7108
7316
|
variant: "outlineFontFamily",
|
|
7109
7317
|
className: "flex items-center h-7 rounded-sm px-2 border-[#a3a3a8] text-[#a3a3a8] hover:text-white",
|
|
7110
7318
|
children: [
|
|
7111
7319
|
"Color",
|
|
7112
|
-
/* @__PURE__ */
|
|
7320
|
+
/* @__PURE__ */ jsx76(
|
|
7113
7321
|
"span",
|
|
7114
7322
|
{
|
|
7115
7323
|
className: "w-3 h-3 ml-2 rounded-sm border border-black/20",
|
|
@@ -7126,9 +7334,9 @@ function ColorPicker({ type = "text" }) {
|
|
|
7126
7334
|
align: "start",
|
|
7127
7335
|
onClick: (e) => e.stopPropagation(),
|
|
7128
7336
|
children: [
|
|
7129
|
-
/* @__PURE__ */
|
|
7337
|
+
/* @__PURE__ */ jsx76(Label2, { className: "text-xs mb-2", children: type === "text" ? "Text Color" : "Highlight Color" }),
|
|
7130
7338
|
!showCustom && /* @__PURE__ */ jsxs44("div", { className: "flex flex-col gap-3", children: [
|
|
7131
|
-
/* @__PURE__ */
|
|
7339
|
+
/* @__PURE__ */ jsx76("div", { className: "grid grid-cols-7 gap-1", children: GRADIENT_ROWS_70.map((c) => /* @__PURE__ */ jsx76(
|
|
7132
7340
|
"div",
|
|
7133
7341
|
{
|
|
7134
7342
|
onClick: () => {
|
|
@@ -7140,7 +7348,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7140
7348
|
},
|
|
7141
7349
|
c
|
|
7142
7350
|
)) }),
|
|
7143
|
-
/* @__PURE__ */
|
|
7351
|
+
/* @__PURE__ */ jsx76(
|
|
7144
7352
|
Button,
|
|
7145
7353
|
{
|
|
7146
7354
|
size: "sm",
|
|
@@ -7164,7 +7372,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7164
7372
|
onPointerUp: (e) => e.stopPropagation(),
|
|
7165
7373
|
onClick: (e) => e.stopPropagation(),
|
|
7166
7374
|
children: [
|
|
7167
|
-
/* @__PURE__ */
|
|
7375
|
+
/* @__PURE__ */ jsx76(
|
|
7168
7376
|
HexColorPicker,
|
|
7169
7377
|
{
|
|
7170
7378
|
color: tempHex,
|
|
@@ -7176,7 +7384,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7176
7384
|
}
|
|
7177
7385
|
),
|
|
7178
7386
|
/* @__PURE__ */ jsxs44("div", { className: "flex gap-2 items-center", children: [
|
|
7179
|
-
/* @__PURE__ */
|
|
7387
|
+
/* @__PURE__ */ jsx76(
|
|
7180
7388
|
"input",
|
|
7181
7389
|
{
|
|
7182
7390
|
value: tempHex,
|
|
@@ -7187,7 +7395,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7187
7395
|
className: "w-full px-2 py-1 border rounded text-sm"
|
|
7188
7396
|
}
|
|
7189
7397
|
),
|
|
7190
|
-
/* @__PURE__ */
|
|
7398
|
+
/* @__PURE__ */ jsx76(
|
|
7191
7399
|
Button,
|
|
7192
7400
|
{
|
|
7193
7401
|
size: "sm",
|
|
@@ -7200,7 +7408,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7200
7408
|
}
|
|
7201
7409
|
)
|
|
7202
7410
|
] }),
|
|
7203
|
-
/* @__PURE__ */
|
|
7411
|
+
/* @__PURE__ */ jsx76("div", { className: "flex justify-end mt-2", children: /* @__PURE__ */ jsx76(
|
|
7204
7412
|
Button,
|
|
7205
7413
|
{
|
|
7206
7414
|
size: "sm",
|
|
@@ -7228,7 +7436,7 @@ function ColorPicker({ type = "text" }) {
|
|
|
7228
7436
|
import { useState as useState27 } from "react";
|
|
7229
7437
|
import { useCurrentEditor as useCurrentEditor5 } from "@tiptap/react";
|
|
7230
7438
|
import { FiTable } from "react-icons/fi";
|
|
7231
|
-
import { jsx as
|
|
7439
|
+
import { jsx as jsx77, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
7232
7440
|
function TableDropdownMenu() {
|
|
7233
7441
|
const { editor } = useCurrentEditor5();
|
|
7234
7442
|
const [open, setOpen] = useState27(false);
|
|
@@ -7271,30 +7479,30 @@ function TableDropdownMenu() {
|
|
|
7271
7479
|
setOpen(false);
|
|
7272
7480
|
};
|
|
7273
7481
|
return /* @__PURE__ */ jsxs45(Popover2, { open, onOpenChange: setOpen, children: [
|
|
7274
|
-
/* @__PURE__ */
|
|
7275
|
-
/* @__PURE__ */
|
|
7276
|
-
/* @__PURE__ */
|
|
7277
|
-
/* @__PURE__ */
|
|
7278
|
-
/* @__PURE__ */
|
|
7279
|
-
/* @__PURE__ */
|
|
7280
|
-
/* @__PURE__ */
|
|
7281
|
-
/* @__PURE__ */
|
|
7282
|
-
/* @__PURE__ */
|
|
7283
|
-
/* @__PURE__ */
|
|
7284
|
-
/* @__PURE__ */
|
|
7285
|
-
/* @__PURE__ */
|
|
7286
|
-
/* @__PURE__ */
|
|
7287
|
-
/* @__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" })
|
|
7288
7496
|
] }) })
|
|
7289
7497
|
] }) })
|
|
7290
7498
|
] });
|
|
7291
7499
|
}
|
|
7292
7500
|
|
|
7293
7501
|
// src/components/tiptap-icons/arrow-left-icon.tsx
|
|
7294
|
-
import { memo as
|
|
7295
|
-
import { jsx as
|
|
7296
|
-
var ArrowLeftIcon =
|
|
7297
|
-
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(
|
|
7298
7506
|
"svg",
|
|
7299
7507
|
{
|
|
7300
7508
|
width: "24",
|
|
@@ -7304,7 +7512,7 @@ var ArrowLeftIcon = memo34(({ className, ...props }) => {
|
|
|
7304
7512
|
fill: "currentColor",
|
|
7305
7513
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7306
7514
|
...props,
|
|
7307
|
-
children: /* @__PURE__ */
|
|
7515
|
+
children: /* @__PURE__ */ jsx78(
|
|
7308
7516
|
"path",
|
|
7309
7517
|
{
|
|
7310
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",
|
|
@@ -7323,9 +7531,9 @@ import { useEffect as useEffect20, useState as useState28 } from "react";
|
|
|
7323
7531
|
import throttle from "lodash.throttle";
|
|
7324
7532
|
|
|
7325
7533
|
// src/hooks/use-unmount.ts
|
|
7326
|
-
import { useRef as
|
|
7534
|
+
import { useRef as useRef7, useEffect as useEffect19 } from "react";
|
|
7327
7535
|
var useUnmount = (callback) => {
|
|
7328
|
-
const ref =
|
|
7536
|
+
const ref = useRef7(callback);
|
|
7329
7537
|
ref.current = callback;
|
|
7330
7538
|
useEffect19(
|
|
7331
7539
|
() => () => {
|
|
@@ -7336,13 +7544,13 @@ var useUnmount = (callback) => {
|
|
|
7336
7544
|
};
|
|
7337
7545
|
|
|
7338
7546
|
// src/hooks/use-throttled-callback.ts
|
|
7339
|
-
import { useMemo as
|
|
7547
|
+
import { useMemo as useMemo10 } from "react";
|
|
7340
7548
|
var defaultOptions = {
|
|
7341
7549
|
leading: false,
|
|
7342
7550
|
trailing: true
|
|
7343
7551
|
};
|
|
7344
7552
|
function useThrottledCallback(fn, wait = 250, dependencies = [], options = defaultOptions) {
|
|
7345
|
-
const handler =
|
|
7553
|
+
const handler = useMemo10(
|
|
7346
7554
|
() => throttle(fn, wait, options),
|
|
7347
7555
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
7348
7556
|
dependencies
|
|
@@ -7393,7 +7601,7 @@ function useWindowSize() {
|
|
|
7393
7601
|
}
|
|
7394
7602
|
|
|
7395
7603
|
// src/hooks/use-element-rect.ts
|
|
7396
|
-
import { useCallback as
|
|
7604
|
+
import { useCallback as useCallback26, useEffect as useEffect21, useState as useState29 } from "react";
|
|
7397
7605
|
var initialRect = {
|
|
7398
7606
|
x: 0,
|
|
7399
7607
|
y: 0,
|
|
@@ -7414,7 +7622,7 @@ function useElementRect({
|
|
|
7414
7622
|
useResizeObserver = true
|
|
7415
7623
|
} = {}) {
|
|
7416
7624
|
const [rect, setRect] = useState29(initialRect);
|
|
7417
|
-
const getTargetElement =
|
|
7625
|
+
const getTargetElement = useCallback26(() => {
|
|
7418
7626
|
if (!enabled || !isClientSide()) return null;
|
|
7419
7627
|
if (!element) {
|
|
7420
7628
|
return document.body;
|
|
@@ -7530,62 +7738,62 @@ function useCursorVisibility({
|
|
|
7530
7738
|
}
|
|
7531
7739
|
|
|
7532
7740
|
// src/components/tiptap-templates/simple/simple-editor.tsx
|
|
7533
|
-
import { Fragment as Fragment11, jsx as
|
|
7741
|
+
import { Fragment as Fragment11, jsx as jsx79, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
7534
7742
|
var MainToolbarContent = ({
|
|
7535
7743
|
onHighlighterClick,
|
|
7536
7744
|
onLinkClick,
|
|
7537
7745
|
isMobile
|
|
7538
7746
|
}) => {
|
|
7539
7747
|
return /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
7540
|
-
/* @__PURE__ */
|
|
7541
|
-
/* @__PURE__ */
|
|
7542
|
-
/* @__PURE__ */
|
|
7748
|
+
/* @__PURE__ */ jsx79(Spacer, {}),
|
|
7749
|
+
/* @__PURE__ */ jsx79(FontFamilyDropdown, {}),
|
|
7750
|
+
/* @__PURE__ */ jsx79(ColorPicker, { type: "text" }),
|
|
7543
7751
|
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7544
|
-
/* @__PURE__ */
|
|
7545
|
-
/* @__PURE__ */
|
|
7546
|
-
/* @__PURE__ */
|
|
7547
|
-
/* @__PURE__ */
|
|
7548
|
-
/* @__PURE__ */
|
|
7549
|
-
/* @__PURE__ */
|
|
7550
|
-
/* @__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" })
|
|
7551
7759
|
] }),
|
|
7552
|
-
/* @__PURE__ */
|
|
7760
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7553
7761
|
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7554
|
-
/* @__PURE__ */
|
|
7555
|
-
/* @__PURE__ */
|
|
7556
|
-
/* @__PURE__ */
|
|
7557
|
-
/* @__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" })
|
|
7558
7766
|
] }),
|
|
7559
|
-
/* @__PURE__ */
|
|
7767
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7560
7768
|
/* @__PURE__ */ jsxs46(ToolbarGroup, { children: [
|
|
7561
|
-
/* @__PURE__ */
|
|
7562
|
-
/* @__PURE__ */
|
|
7769
|
+
/* @__PURE__ */ jsx79(HeadingDropdownMenu, { levels: [1, 2, 3, 4], portal: isMobile }),
|
|
7770
|
+
/* @__PURE__ */ jsx79(
|
|
7563
7771
|
ListDropdownMenu,
|
|
7564
7772
|
{
|
|
7565
7773
|
types: ["bulletList", "orderedList", "taskList"],
|
|
7566
7774
|
portal: isMobile
|
|
7567
7775
|
}
|
|
7568
7776
|
),
|
|
7569
|
-
/* @__PURE__ */
|
|
7777
|
+
/* @__PURE__ */ jsx79(BlockquoteButton, {})
|
|
7570
7778
|
] }),
|
|
7571
|
-
/* @__PURE__ */
|
|
7572
|
-
/* @__PURE__ */
|
|
7573
|
-
/* @__PURE__ */
|
|
7574
|
-
/* @__PURE__ */
|
|
7575
|
-
/* @__PURE__ */
|
|
7576
|
-
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, {})
|
|
7577
7785
|
] });
|
|
7578
7786
|
};
|
|
7579
7787
|
var MobileToolbarContent = ({
|
|
7580
7788
|
type,
|
|
7581
7789
|
onBack
|
|
7582
7790
|
}) => /* @__PURE__ */ jsxs46(Fragment11, { children: [
|
|
7583
|
-
/* @__PURE__ */
|
|
7584
|
-
/* @__PURE__ */
|
|
7585
|
-
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" })
|
|
7586
7794
|
] }) }),
|
|
7587
|
-
/* @__PURE__ */
|
|
7588
|
-
type === "highlighter" ? /* @__PURE__ */
|
|
7795
|
+
/* @__PURE__ */ jsx79(ToolbarSeparator, {}),
|
|
7796
|
+
type === "highlighter" ? /* @__PURE__ */ jsx79(ColorHighlightPopoverContent, {}) : /* @__PURE__ */ jsx79(LinkContent, {})
|
|
7589
7797
|
] });
|
|
7590
7798
|
function SimpleEditor() {
|
|
7591
7799
|
const { setEditorContent, debouncedSave } = useEditorBridge();
|
|
@@ -7594,7 +7802,7 @@ function SimpleEditor() {
|
|
|
7594
7802
|
const [mobileView, setMobileView] = useState30(
|
|
7595
7803
|
"main"
|
|
7596
7804
|
);
|
|
7597
|
-
const toolbarRef =
|
|
7805
|
+
const toolbarRef = useRef8(null);
|
|
7598
7806
|
const editor = useEditor({
|
|
7599
7807
|
immediatelyRender: false,
|
|
7600
7808
|
editorProps: {
|
|
@@ -7695,8 +7903,8 @@ function SimpleEditor() {
|
|
|
7695
7903
|
window.visualViewport?.removeEventListener("scroll", updatePosition);
|
|
7696
7904
|
};
|
|
7697
7905
|
}, []);
|
|
7698
|
-
return /* @__PURE__ */
|
|
7699
|
-
/* @__PURE__ */
|
|
7906
|
+
return /* @__PURE__ */ jsx79("div", { className: "simple-editor-wrapper", children: /* @__PURE__ */ jsxs46(EditorContext.Provider, { value: { editor }, children: [
|
|
7907
|
+
/* @__PURE__ */ jsx79(
|
|
7700
7908
|
Toolbar,
|
|
7701
7909
|
{
|
|
7702
7910
|
ref: toolbarRef,
|
|
@@ -7705,14 +7913,14 @@ function SimpleEditor() {
|
|
|
7705
7913
|
bottom: `calc(100% - ${height - rect.y}px)`
|
|
7706
7914
|
} : {}
|
|
7707
7915
|
},
|
|
7708
|
-
children: mobileView === "main" ? /* @__PURE__ */
|
|
7916
|
+
children: mobileView === "main" ? /* @__PURE__ */ jsx79(
|
|
7709
7917
|
MainToolbarContent,
|
|
7710
7918
|
{
|
|
7711
7919
|
onHighlighterClick: () => setMobileView("highlighter"),
|
|
7712
7920
|
onLinkClick: () => setMobileView("link"),
|
|
7713
7921
|
isMobile
|
|
7714
7922
|
}
|
|
7715
|
-
) : /* @__PURE__ */
|
|
7923
|
+
) : /* @__PURE__ */ jsx79(
|
|
7716
7924
|
MobileToolbarContent,
|
|
7717
7925
|
{
|
|
7718
7926
|
type: mobileView === "highlighter" ? "highlighter" : "link",
|
|
@@ -7721,14 +7929,14 @@ function SimpleEditor() {
|
|
|
7721
7929
|
)
|
|
7722
7930
|
}
|
|
7723
7931
|
),
|
|
7724
|
-
/* @__PURE__ */
|
|
7932
|
+
/* @__PURE__ */ jsx79(
|
|
7725
7933
|
EditorContent,
|
|
7726
7934
|
{
|
|
7727
7935
|
editor,
|
|
7728
7936
|
role: "presentation",
|
|
7729
7937
|
autoFocus: true,
|
|
7730
7938
|
className: "simple-editor-content",
|
|
7731
|
-
children: editor && /* @__PURE__ */
|
|
7939
|
+
children: editor && /* @__PURE__ */ jsx79(BubbleMenuInline, {})
|
|
7732
7940
|
}
|
|
7733
7941
|
)
|
|
7734
7942
|
] }) });
|
|
@@ -7736,9 +7944,9 @@ function SimpleEditor() {
|
|
|
7736
7944
|
|
|
7737
7945
|
// src/components/editor/editor.tsx
|
|
7738
7946
|
import clsx2 from "clsx";
|
|
7739
|
-
import { jsx as
|
|
7947
|
+
import { jsx as jsx80 } from "react/jsx-runtime";
|
|
7740
7948
|
function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
7741
|
-
return /* @__PURE__ */
|
|
7949
|
+
return /* @__PURE__ */ jsx80(
|
|
7742
7950
|
"div",
|
|
7743
7951
|
{
|
|
7744
7952
|
className: clsx2(
|
|
@@ -7746,7 +7954,7 @@ function Editor({ onChange, className, style, onTabsChange, initialTabs }) {
|
|
|
7746
7954
|
className
|
|
7747
7955
|
),
|
|
7748
7956
|
style,
|
|
7749
|
-
children: /* @__PURE__ */
|
|
7957
|
+
children: /* @__PURE__ */ jsx80(EditorShell, { children: /* @__PURE__ */ jsx80(EditorLayout, { onChange, initialTabs, onTabsChange, children: /* @__PURE__ */ jsx80(SimpleEditor, {}) }) })
|
|
7750
7958
|
}
|
|
7751
7959
|
);
|
|
7752
7960
|
}
|