@edifice.io/react 2.6.10-develop-pedago.20261022131512 → 2.6.10-develop-b2school.20261023141442
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/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Layout/Layout.js +12 -4
- package/dist/components/Layout/components/Header.js +4 -4
- package/dist/components/Layout/components/NavLink.d.ts +3 -3
- package/dist/components/Layout/components/NavLink.js +5 -3
- package/dist/editor.js +0 -2
- package/dist/homepage.js +74 -24
- package/dist/hooks/useZendeskGuide/useZendeskGuide.d.ts +2 -6
- package/dist/hooks/useZendeskGuide/useZendeskGuide.js +11 -8
- package/dist/icons.js +406 -402
- package/dist/modules/HelpZone/HelpZone.js +6 -8
- package/dist/modules/HelpZone/HelpZoneContainer.js +2 -5
- package/dist/modules/editor/components/BubbleMenuEditImage/BubbleMenuEditImage.js +91 -110
- package/dist/modules/editor/components/BubbleMenuEditInformationPane/BubbleMenuEditInformationPane.js +96 -123
- package/dist/modules/editor/components/Editor/Editor.d.ts +5 -0
- package/dist/modules/editor/components/Editor/Editor.js +3 -0
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.HighlightColor.js +8 -5
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.TextColor.js +8 -5
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.Typography.js +2 -3
- package/dist/modules/editor/components/EditorToolbar/EditorToolbar.js +4 -6
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.d.ts +2 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.TippyOptions.js +8 -0
- package/dist/modules/editor/components/Toolbar/LinkToolbar.d.ts +3 -6
- package/dist/modules/editor/components/Toolbar/LinkToolbar.js +7 -29
- package/dist/modules/editor/components/Toolbar/TableToolbar.CellColor.js +2 -3
- package/dist/modules/editor/components/Toolbar/TableToolbar.js +45 -65
- package/dist/modules/editor/hooks/index.d.ts +0 -1
- package/dist/modules/editor/hooks/useCommentEditor.d.ts +1 -1
- package/dist/modules/editor/hooks/useCommentEditor.js +4 -12
- package/dist/modules/editor/hooks/useLinkToolbar.d.ts +2 -2
- package/dist/modules/editor/hooks/useLinkToolbar.js +1 -2
- package/dist/modules/editor/hooks/useTipTapEditor.d.ts +3 -3
- package/dist/modules/editor/hooks/useTipTapEditor.js +24 -81
- package/dist/modules/homepage/components/Agenda/Agenda.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/Agenda.js +54 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Agenda/AgendaContainer.js +14 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.d.ts +10 -0
- package/dist/modules/homepage/components/Agenda/AgendaEventCard.js +30 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.d.ts +14 -0
- package/dist/modules/homepage/components/Agenda/hooks/useAgendaContainer.js +27 -0
- package/dist/modules/homepage/components/Agenda/index.d.ts +3 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.d.ts +24 -0
- package/dist/modules/homepage/components/Agenda/services/api/agendaService.js +45 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.d.ts +4 -0
- package/dist/modules/homepage/components/Agenda/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.d.ts +19 -0
- package/dist/modules/homepage/components/Agenda/services/queries/agenda.js +26 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.d.ts +9 -0
- package/dist/modules/homepage/components/BriefMe/BriefMe.js +59 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/BriefMeContainer.js +17 -0
- package/dist/modules/homepage/components/BriefMe/index.d.ts +4 -0
- package/dist/modules/homepage/components/BriefMe/types.d.ts +17 -0
- package/dist/modules/homepage/components/BriefMe/types.js +8 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.d.ts +31 -0
- package/dist/modules/homepage/components/BriefMe/useBriefMe.js +51 -0
- package/dist/modules/homepage/components/Cantine/Cantine.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/Cantine.js +44 -0
- package/dist/modules/homepage/components/Cantine/CantineContainer.d.ts +4 -0
- package/dist/modules/homepage/components/Cantine/CantineContainer.js +18 -0
- package/dist/modules/homepage/components/Cantine/CantineModal.d.ts +24 -0
- package/dist/modules/homepage/components/Cantine/CantineModal.js +88 -0
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/CantineModalContainer.js +12 -0
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.d.ts +5 -0
- package/dist/modules/homepage/components/Cantine/components/CantineLegend.js +22 -0
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.d.ts +6 -0
- package/dist/modules/homepage/components/Cantine/components/CantineMenuSection.js +28 -0
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.d.ts +12 -0
- package/dist/modules/homepage/components/Cantine/components/cantineLabels.js +60 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.d.ts +11 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantine.js +20 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.d.ts +24 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineMenu.js +65 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.d.ts +23 -0
- package/dist/modules/homepage/components/Cantine/hooks/useCantineModal.js +43 -0
- package/dist/modules/homepage/components/Cantine/index.d.ts +7 -0
- package/dist/modules/homepage/components/Cantine/types.d.ts +42 -0
- package/dist/modules/homepage/components/Communities/Communities.js +4 -4
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.d.ts +16 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdf.js +48 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.d.ts +4 -0
- package/dist/modules/homepage/components/GenerationHdf/GenerationHdfContainer.js +12 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.d.ts +1 -0
- package/dist/modules/homepage/components/GenerationHdf/formatSolde.js +6 -0
- package/dist/modules/homepage/components/GenerationHdf/index.d.ts +3 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.d.ts +10 -0
- package/dist/modules/homepage/components/GenerationHdf/useGenerationHdf.js +68 -0
- package/dist/modules/homepage/components/Header/AccountActionListPopover.d.ts +13 -0
- package/dist/modules/homepage/components/Header/AccountActionListPopover.js +26 -0
- package/dist/modules/homepage/components/Header/ActionItem.d.ts +38 -0
- package/dist/modules/homepage/components/Header/ActionItem.js +34 -0
- package/dist/modules/homepage/components/Header/Header.js +28 -22
- package/dist/modules/homepage/components/Header/MyAppsPopover.d.ts +5 -0
- package/dist/modules/homepage/components/Header/MyAppsPopover.js +28 -0
- package/dist/modules/homepage/components/Header/useSafeHoverPopover.js +32 -0
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.d.ts +5 -1
- package/dist/modules/homepage/components/HomeCard/HomeCardHeader.js +1 -1
- package/dist/modules/homepage/components/MessageFlashList/MessageFlash.js +1 -1
- package/dist/modules/homepage/components/Notifications/NotificationList.js +7 -8
- package/dist/modules/homepage/components/Notifications/NotificationListSkeleton.js +7 -12
- package/dist/modules/homepage/components/Notifications/NotificationSkeleton.js +7 -4
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterMenu.js +1 -5
- package/dist/modules/homepage/components/Notifications/components/NotificationFilterModal.js +10 -12
- package/dist/modules/homepage/components/Notifications/components/NotificationOptionsMenu.js +3 -9
- package/dist/modules/homepage/components/Notifications/components/ReportNotificationModal.js +6 -12
- package/dist/modules/homepage/components/Notifications/components/notificationAdapter.js +12 -10
- package/dist/modules/homepage/components/Notifications/hooks/useNotificationList.js +9 -10
- package/dist/modules/homepage/components/Qwant/Qwant.d.ts +4 -0
- package/dist/modules/homepage/components/Qwant/Qwant.js +41 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Qwant/QwantContainer.js +10 -0
- package/dist/modules/homepage/components/Qwant/index.d.ts +3 -0
- package/dist/modules/homepage/components/Rss/Rss.d.ts +11 -0
- package/dist/modules/homepage/components/Rss/Rss.js +64 -0
- package/dist/modules/homepage/components/Rss/RssContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Rss/RssContainer.js +45 -0
- package/dist/modules/homepage/components/Rss/RssFeedForm.d.ts +13 -0
- package/dist/modules/homepage/components/Rss/RssFeedForm.js +69 -0
- package/dist/modules/homepage/components/Rss/RssFeedsModal.d.ts +11 -0
- package/dist/modules/homepage/components/Rss/RssFeedsModal.js +58 -0
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.d.ts +25 -0
- package/dist/modules/homepage/components/Rss/hooks/useRssContainer.js +43 -0
- package/dist/modules/homepage/components/Rss/index.d.ts +6 -0
- package/dist/modules/homepage/components/Rss/services/api/index.d.ts +5 -0
- package/dist/modules/homepage/components/Rss/services/api/index.js +5 -0
- package/dist/modules/homepage/components/Rss/services/api/rssService.d.ts +38 -0
- package/dist/modules/homepage/components/Rss/services/api/rssService.js +51 -0
- package/dist/modules/homepage/components/Rss/services/queries/rss.d.ts +28 -0
- package/dist/modules/homepage/components/Rss/services/queries/rss.js +71 -0
- package/dist/modules/homepage/components/Rss/types.d.ts +25 -0
- package/dist/modules/homepage/components/Rss/utils.d.ts +7 -0
- package/dist/modules/homepage/components/Rss/utils.js +19 -0
- package/dist/modules/homepage/components/SchoolSpace/SchoolSpaceContainer.js +1 -1
- package/dist/modules/homepage/components/Universalis/Universalis.d.ts +8 -0
- package/dist/modules/homepage/components/Universalis/Universalis.js +62 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.d.ts +1 -0
- package/dist/modules/homepage/components/Universalis/UniversalisContainer.js +16 -0
- package/dist/modules/homepage/components/Universalis/index.d.ts +3 -0
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinks.js +2 -2
- package/dist/modules/homepage/components/UsefulLinks/UsefulLinksModal.js +2 -2
- package/dist/modules/homepage/components/UserSpace/UserSpace.d.ts +3 -1
- package/dist/modules/homepage/components/UserSpace/UserSpace.js +13 -7
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.d.ts +4 -2
- package/dist/modules/homepage/components/UserSpace/UserSpaceContainer.js +3 -2
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.d.ts +16 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetToggle.js +15 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.d.ts +21 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/WidgetsPersonalizationPanel.js +47 -0
- package/dist/modules/homepage/components/WidgetsPersonalizationPanel/index.d.ts +2 -0
- package/dist/modules/homepage/components/index.d.ts +9 -1
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.d.ts +2 -2
- package/dist/modules/homepage/{components/SchoolSpace → hooks}/useUserSchools.js +4 -4
- package/dist/modules/icons/components/IconAddWidget.d.ts +7 -0
- package/dist/modules/icons/components/IconAddWidget.js +12 -0
- package/dist/modules/icons/components/IconLogout.d.ts +7 -0
- package/dist/modules/icons/components/IconLogout.js +13 -0
- package/dist/modules/icons/components/index.d.ts +2 -0
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.d.ts +1 -7
- package/dist/modules/multimedia/Linker/InternalLinker/InternalLinker.js +0 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.d.ts +0 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibrary.js +0 -2
- package/dist/modules/multimedia/MediaLibrary/MediaLibraryContext.d.ts +0 -4
- package/dist/modules/multimedia/MediaLibrary/innertabs/Upload.js +1 -2
- package/dist/modules/multimedia/MediaLibrary/innertabs/Workspace.js +0 -3
- package/package.json +43 -35
- package/dist/modules/editor/components/Toolbar/FloatingMenuOptions.d.ts +0 -29
- package/dist/modules/editor/components/Toolbar/FloatingMenuOptions.js +0 -22
- package/dist/modules/editor/hooks/useEditorState.d.ts +0 -20
- package/dist/modules/editor/hooks/useEditorState.js +0 -16
- package/dist/node_modules/.pnpm/@tiptap_extension-floating-menu@3.32.0_@floating-ui_dom@1.6.0_@tiptap_core@3.32.0_@tiptap_pm@3.32.0__@tiptap_pm@3.32.0/node_modules/@tiptap/extension-floating-menu/dist/index.js +0 -159
- package/dist/node_modules/.pnpm/@tiptap_react@3.32.0_@floating-ui_dom@1.6.0_@tiptap_core@3.32.0_@tiptap_pm@3.32.0__@tiptap_pm_6inmb43gajy4fnlwtngbwkv7um/node_modules/@tiptap/react/dist/menus/index.js +0 -341
- package/dist/node_modules/.pnpm/prosemirror-model@1.25.12/node_modules/prosemirror-model/dist/index.js +0 -549
- package/dist/node_modules/.pnpm/prosemirror-state@1.4.4/node_modules/prosemirror-state/dist/index.js +0 -489
- package/dist/node_modules/.pnpm/prosemirror-transform@1.12.3/node_modules/prosemirror-transform/dist/index.js +0 -659
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState,
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { createPortal } from "react-dom";
|
|
5
5
|
import { useTranslation } from "react-i18next";
|
|
@@ -16,22 +16,20 @@ const HelpZone = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
18
18
|
t
|
|
19
|
-
} = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1)
|
|
19
|
+
} = useTranslation(), [portalRoot, setPortalRoot] = useState(null), [isCompact, setIsCompact] = useState(!1);
|
|
20
20
|
if (useEffect(() => (document.body.classList.add("help-zone-active"), setPortalRoot(document.getElementById("portal")), () => {
|
|
21
21
|
document.body.classList.remove("help-zone-active");
|
|
22
22
|
}), []), useEffect(() => {
|
|
23
23
|
if (isCompact)
|
|
24
24
|
return;
|
|
25
|
-
const goCompact = () => setIsCompact(!0)
|
|
26
|
-
questionButtonRef.current && event.target instanceof Node && questionButtonRef.current.contains(event.target) || goCompact();
|
|
27
|
-
};
|
|
25
|
+
const goCompact = () => setIsCompact(!0);
|
|
28
26
|
return document.addEventListener("scroll", goCompact, {
|
|
29
27
|
capture: !0,
|
|
30
28
|
passive: !0
|
|
31
|
-
}),
|
|
29
|
+
}), () => {
|
|
32
30
|
document.removeEventListener("scroll", goCompact, {
|
|
33
31
|
capture: !0
|
|
34
|
-
})
|
|
32
|
+
});
|
|
35
33
|
};
|
|
36
34
|
}, [isCompact]), !isReady || !portalRoot)
|
|
37
35
|
return null;
|
|
@@ -44,7 +42,7 @@ const HelpZone = ({
|
|
|
44
42
|
"help-zone-logo--full": !isCompact
|
|
45
43
|
}), children: isCompact ? /* @__PURE__ */ jsx(SvgIconLogoEdificeSmall, { width: 18, height: 18 }) : /* @__PURE__ */ jsx(SvgIconLogoEdificeFull, { width: 81, height: 18 }) }) }) }),
|
|
46
44
|
/* @__PURE__ */ jsx("span", { className: "help-zone-divider" }),
|
|
47
|
-
/* @__PURE__ */ jsx(ButtonBeta, {
|
|
45
|
+
/* @__PURE__ */ jsx(ButtonBeta, { className: "help-zone-question", "aria-label": t("help-zone.support.open"), color: "tertiary", variant: "ghost", onClick: handleOpenHelpZone, children: /* @__PURE__ */ jsx(Tooltip, { message: t("help-zone.support.open"), placement: "top", children: /* @__PURE__ */ jsx(SvgIconQuestion, { width: 24, height: 24, color: "white" }) }) })
|
|
48
46
|
] }), portalRoot);
|
|
49
47
|
};
|
|
50
48
|
export {
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import HelpZone from "./HelpZone.js";
|
|
3
3
|
import useZendeskGuide from "../../hooks/useZendeskGuide/useZendeskGuide.js";
|
|
4
|
-
function getHeaderColor() {
|
|
5
|
-
return getComputedStyle(document.documentElement).getPropertyValue("--primitive-blue-400").trim();
|
|
6
|
-
}
|
|
7
4
|
function HelpZoneContainer() {
|
|
8
|
-
const
|
|
5
|
+
const {
|
|
9
6
|
isReady,
|
|
10
7
|
isOpen,
|
|
11
8
|
open,
|
|
12
9
|
close
|
|
13
|
-
} = useZendeskGuide(
|
|
10
|
+
} = useZendeskGuide();
|
|
14
11
|
return /* @__PURE__ */ jsx(HelpZone, { isReady, isOpen, onOpen: open, onClose: close });
|
|
15
12
|
}
|
|
16
13
|
export {
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { BubbleMenu } from "
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { BubbleMenu } from "@tiptap/react";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { useEditorState } from "../../hooks/useEditorState.js";
|
|
6
5
|
import { Toolbar } from "../../../../components/Toolbar/Toolbar.js";
|
|
7
|
-
import { getFloatingMenuOptions, useReferencedVirtualElement, FLOATING_MENU_Z_INDEX } from "../Toolbar/FloatingMenuOptions.js";
|
|
8
6
|
import SvgIconImageSizeLarge from "../../../icons/components/IconImageSizeLarge.js";
|
|
9
7
|
import SvgIconImageSizeMedium from "../../../icons/components/IconImageSizeMedium.js";
|
|
10
8
|
import SvgIconImageSizeSmall from "../../../icons/components/IconImageSizeSmall.js";
|
|
@@ -17,93 +15,90 @@ const BubbleMenuEditImage = ({
|
|
|
17
15
|
}) => {
|
|
18
16
|
const {
|
|
19
17
|
t
|
|
20
|
-
} = useTranslation(),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
selection
|
|
25
|
-
} = editor.view.state, selectedNode = editor.view.state.doc.nodeAt(selection.anchor);
|
|
26
|
-
setCurrentSize(((_a = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _a.size) ?? null), setCurrentWidth(((_b = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _b.width) ?? null);
|
|
27
|
-
}, [editor, editorState]);
|
|
28
|
-
const handleButtonClick = useCallback((buttonSize) => {
|
|
29
|
-
editor.chain().focus().updateAttributes("custom-image", {
|
|
18
|
+
} = useTranslation(), {
|
|
19
|
+
selection
|
|
20
|
+
} = editor.view.state, selectedNode = editor.view.state.doc.nodeAt(selection.anchor), handleButtonClick = (buttonSize) => {
|
|
21
|
+
editor.chain().focus().setAttributes({
|
|
30
22
|
width: buttonSize.width,
|
|
31
23
|
height: buttonSize.height,
|
|
32
24
|
size: buttonSize.size
|
|
33
25
|
}).run();
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
26
|
+
}, ImageSizeItems = useMemo(() => {
|
|
27
|
+
var _a, _b, _c, _d, _e, _f;
|
|
28
|
+
return [{
|
|
29
|
+
type: "button",
|
|
30
|
+
name: "edit",
|
|
31
|
+
props: {
|
|
32
|
+
size: "lg",
|
|
33
|
+
color: "secondary",
|
|
34
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconWand, {}),
|
|
35
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.image.edit"),
|
|
36
|
+
children: t("tiptap.bubblemenu.edit"),
|
|
37
|
+
onClick: onEditImage
|
|
38
|
+
},
|
|
39
|
+
tooltip: {
|
|
40
|
+
message: t("tiptap.tooltip.bubblemenu.image.edit"),
|
|
41
|
+
position: "top"
|
|
42
|
+
}
|
|
43
|
+
}, {
|
|
44
|
+
type: "divider",
|
|
45
|
+
name: "div-4"
|
|
46
|
+
}, {
|
|
47
|
+
type: "icon",
|
|
48
|
+
name: "small",
|
|
49
|
+
props: {
|
|
50
|
+
icon: /* @__PURE__ */ jsx(SvgIconImageSizeSmall, {}),
|
|
51
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.image.small"),
|
|
52
|
+
color: "tertiary",
|
|
53
|
+
className: ((_a = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _a.size) === "small" && ((_b = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _b.width) === 250 ? "is-selected" : "",
|
|
54
|
+
onClick: () => handleButtonClick({
|
|
55
|
+
size: "small",
|
|
56
|
+
width: 250,
|
|
57
|
+
height: "auto"
|
|
58
|
+
})
|
|
59
|
+
},
|
|
60
|
+
tooltip: {
|
|
61
|
+
message: t("tiptap.tooltip.bubblemenu.image.small"),
|
|
62
|
+
position: "top"
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
type: "icon",
|
|
66
|
+
name: "medium",
|
|
67
|
+
props: {
|
|
68
|
+
icon: /* @__PURE__ */ jsx(SvgIconImageSizeMedium, {}),
|
|
69
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.image.medium"),
|
|
70
|
+
color: "tertiary",
|
|
71
|
+
className: ((_c = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _c.size) === "medium" && ((_d = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _d.width) === 350 ? "is-selected" : "",
|
|
72
|
+
onClick: () => handleButtonClick({
|
|
73
|
+
size: "medium",
|
|
74
|
+
width: 350,
|
|
75
|
+
height: "auto"
|
|
76
|
+
})
|
|
77
|
+
},
|
|
78
|
+
tooltip: {
|
|
79
|
+
message: t("tiptap.tooltip.bubblemenu.image.medium"),
|
|
80
|
+
position: "top"
|
|
81
|
+
}
|
|
82
|
+
}, {
|
|
83
|
+
type: "icon",
|
|
84
|
+
name: "large",
|
|
85
|
+
props: {
|
|
86
|
+
icon: /* @__PURE__ */ jsx(SvgIconImageSizeLarge, {}),
|
|
87
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.image.big"),
|
|
88
|
+
color: "tertiary",
|
|
89
|
+
className: ((_e = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _e.size) === "large" && ((_f = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _f.width) === 500 ? "is-selected" : "",
|
|
90
|
+
onClick: () => handleButtonClick({
|
|
91
|
+
size: "large",
|
|
92
|
+
width: 500,
|
|
93
|
+
height: "auto"
|
|
94
|
+
})
|
|
95
|
+
},
|
|
96
|
+
tooltip: {
|
|
97
|
+
message: t("tiptap.tooltip.bubblemenu.image.big"),
|
|
98
|
+
position: "top"
|
|
99
|
+
}
|
|
100
|
+
}];
|
|
101
|
+
}, [t, selectedNode]), tippyOptions = useMemo(() => {
|
|
107
102
|
function adjustRect(rect) {
|
|
108
103
|
let yOffset = 0;
|
|
109
104
|
if (window.visualViewport) {
|
|
@@ -113,7 +108,12 @@ const BubbleMenuEditImage = ({
|
|
|
113
108
|
return new DOMRect(rect.x, rect.y - yOffset, rect.width, rect.height);
|
|
114
109
|
}
|
|
115
110
|
return {
|
|
116
|
-
|
|
111
|
+
placement: "bottom-start",
|
|
112
|
+
offset: [0, 0],
|
|
113
|
+
zIndex: 999,
|
|
114
|
+
duration: 100,
|
|
115
|
+
// Try to get the bounding rect of the table.
|
|
116
|
+
getReferenceClientRect: () => {
|
|
117
117
|
const parentDiv = editor != null && editor.isActive("custom-image") ? editor.state.selection.$anchor : null;
|
|
118
118
|
if (parentDiv) {
|
|
119
119
|
const parentDomNode = editor == null ? void 0 : editor.view.nodeDOM(parentDiv.pos);
|
|
@@ -125,29 +125,10 @@ const BubbleMenuEditImage = ({
|
|
|
125
125
|
return new DOMRect(0, 0, 100, 100);
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
}, [editor])
|
|
129
|
-
|
|
130
|
-
offset: {
|
|
131
|
-
mainAxis: 0,
|
|
132
|
-
crossAxis: 0
|
|
133
|
-
}
|
|
134
|
-
}), []), getReferencedVirtualElement = useReferencedVirtualElement(reference), handleShouldShow = useCallback(({
|
|
128
|
+
}, [editor]);
|
|
129
|
+
return /* @__PURE__ */ jsx(BubbleMenu, { className: openEditImage ? "d-none" : "", shouldShow: ({
|
|
135
130
|
editor: editor2
|
|
136
|
-
}) => editor2.isActive("custom-image") && !openEditImage,
|
|
137
|
-
return /* @__PURE__ */ jsx(
|
|
138
|
-
BubbleMenu,
|
|
139
|
-
{
|
|
140
|
-
className: openEditImage ? "d-none" : "",
|
|
141
|
-
shouldShow: handleShouldShow,
|
|
142
|
-
editor,
|
|
143
|
-
options: floatingOptions,
|
|
144
|
-
getReferencedVirtualElement,
|
|
145
|
-
style: {
|
|
146
|
-
zIndex: FLOATING_MENU_Z_INDEX
|
|
147
|
-
},
|
|
148
|
-
children: editable && /* @__PURE__ */ jsx(Toolbar, { className: "p-8", items: ImageSizeItems }, `toolbar-${currentSize}-${currentWidth}`)
|
|
149
|
-
}
|
|
150
|
-
);
|
|
131
|
+
}) => editor2.isActive("custom-image") && !openEditImage, editor, tippyOptions, children: editable && /* @__PURE__ */ jsx(Toolbar, { className: "p-8", items: ImageSizeItems }) });
|
|
151
132
|
};
|
|
152
133
|
export {
|
|
153
134
|
BubbleMenuEditImage as default
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { BubbleMenu } from "
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { BubbleMenu } from "@tiptap/react";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { useEditorState } from "../../hooks/useEditorState.js";
|
|
6
5
|
import { Toolbar } from "../../../../components/Toolbar/Toolbar.js";
|
|
7
|
-
import { getFloatingMenuOptions, useReferencedVirtualElement, FLOATING_MENU_Z_INDEX } from "../Toolbar/FloatingMenuOptions.js";
|
|
8
6
|
import SvgIconAlertTriangle from "../../../icons/components/IconAlertTriangle.js";
|
|
9
7
|
import SvgIconDelete from "../../../icons/components/IconDelete.js";
|
|
10
8
|
import SvgIconInfoCircle from "../../../icons/components/IconInfoCircle.js";
|
|
@@ -16,105 +14,98 @@ const BubbleMenuEditInformationPane = ({
|
|
|
16
14
|
}) => {
|
|
17
15
|
const {
|
|
18
16
|
t
|
|
19
|
-
} = useTranslation(),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
} = useTranslation(), {
|
|
18
|
+
selection
|
|
19
|
+
} = editor.view.state, selectedNode = selection.$from.node(1), InformationPaneTypeItems = useMemo(() => {
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
|
+
return [{
|
|
22
|
+
type: "icon",
|
|
23
|
+
name: "info",
|
|
24
|
+
props: {
|
|
25
|
+
size: "lg",
|
|
26
|
+
icon: /* @__PURE__ */ jsx(SvgIconInfoCircle, {}),
|
|
27
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.information.pane.info"),
|
|
28
|
+
className: ((_a = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _a.type) === "info" ? "is-selected" : "",
|
|
29
|
+
onClick: () => editor.chain().focus().updateAttributes("information-pane", {
|
|
30
|
+
type: "info"
|
|
31
|
+
}).run()
|
|
32
|
+
},
|
|
33
|
+
tooltip: {
|
|
34
|
+
message: t("tiptap.tooltip.bubblemenu.information.pane.info"),
|
|
35
|
+
position: "top"
|
|
31
36
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
name: "delete",
|
|
105
|
-
props: {
|
|
106
|
-
size: "lg",
|
|
107
|
-
leftIcon: /* @__PURE__ */ jsx(SvgIconDelete, {}),
|
|
108
|
-
"aria-label": t("tiptap.bubblemenu.delete"),
|
|
109
|
-
children: t("tiptap.bubblemenu.delete"),
|
|
110
|
-
onClick: () => editor.chain().focus().deleteNode("information-pane").run()
|
|
111
|
-
},
|
|
112
|
-
tooltip: {
|
|
113
|
-
message: t("tiptap.bubblemenu.delete"),
|
|
114
|
-
position: "top"
|
|
115
|
-
}
|
|
116
|
-
}], [t, editor, currentType]), reference = useMemo(() => ({
|
|
117
|
-
getBoundingClientRect: () => {
|
|
37
|
+
}, {
|
|
38
|
+
type: "icon",
|
|
39
|
+
name: "success",
|
|
40
|
+
props: {
|
|
41
|
+
size: "lg",
|
|
42
|
+
icon: /* @__PURE__ */ jsx(SvgIconSuccessOutline, {}),
|
|
43
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.information.pane.success"),
|
|
44
|
+
className: ((_b = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _b.type) === "success" ? "is-selected" : "",
|
|
45
|
+
onClick: () => editor.chain().focus().updateAttributes("information-pane", {
|
|
46
|
+
type: "success"
|
|
47
|
+
}).run()
|
|
48
|
+
},
|
|
49
|
+
tooltip: {
|
|
50
|
+
message: t("tiptap.tooltip.bubblemenu.information.pane.success"),
|
|
51
|
+
position: "top"
|
|
52
|
+
}
|
|
53
|
+
}, {
|
|
54
|
+
type: "icon",
|
|
55
|
+
name: "warning",
|
|
56
|
+
props: {
|
|
57
|
+
size: "lg",
|
|
58
|
+
icon: /* @__PURE__ */ jsx(SvgIconAlertTriangle, {}),
|
|
59
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.information.pane.warning"),
|
|
60
|
+
className: ((_c = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _c.type) === "warning" ? "is-selected" : "",
|
|
61
|
+
onClick: () => editor.chain().focus().updateAttributes("information-pane", {
|
|
62
|
+
type: "warning"
|
|
63
|
+
}).run()
|
|
64
|
+
},
|
|
65
|
+
tooltip: {
|
|
66
|
+
message: t("tiptap.tooltip.bubblemenu.information.pane.warning"),
|
|
67
|
+
position: "top"
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
type: "icon",
|
|
71
|
+
name: "question",
|
|
72
|
+
props: {
|
|
73
|
+
size: "lg",
|
|
74
|
+
icon: /* @__PURE__ */ jsx(SvgIconQuestion, {}),
|
|
75
|
+
"aria-label": t("tiptap.tooltip.bubblemenu.information.pane.question"),
|
|
76
|
+
className: ((_d = selectedNode == null ? void 0 : selectedNode.attrs) == null ? void 0 : _d.type) === "question" ? "is-selected" : "",
|
|
77
|
+
onClick: () => editor.chain().focus().updateAttributes("information-pane", {
|
|
78
|
+
type: "question"
|
|
79
|
+
}).run()
|
|
80
|
+
},
|
|
81
|
+
tooltip: {
|
|
82
|
+
message: t("tiptap.tooltip.bubblemenu.information.pane.question"),
|
|
83
|
+
position: "top"
|
|
84
|
+
}
|
|
85
|
+
}, {
|
|
86
|
+
type: "divider",
|
|
87
|
+
name: "div-4"
|
|
88
|
+
}, {
|
|
89
|
+
type: "button",
|
|
90
|
+
name: "delete",
|
|
91
|
+
props: {
|
|
92
|
+
size: "lg",
|
|
93
|
+
leftIcon: /* @__PURE__ */ jsx(SvgIconDelete, {}),
|
|
94
|
+
"aria-label": t("tiptap.bubblemenu.delete"),
|
|
95
|
+
children: t("tiptap.bubblemenu.delete"),
|
|
96
|
+
onClick: () => editor.chain().focus().deleteNode("information-pane").run()
|
|
97
|
+
},
|
|
98
|
+
tooltip: {
|
|
99
|
+
message: t("tiptap.bubblemenu.delete"),
|
|
100
|
+
position: "top"
|
|
101
|
+
}
|
|
102
|
+
}];
|
|
103
|
+
}, [t, selectedNode]), tippyOptions = useMemo(() => ({
|
|
104
|
+
placement: "bottom",
|
|
105
|
+
offset: [0, 0],
|
|
106
|
+
zIndex: 999,
|
|
107
|
+
duration: 100,
|
|
108
|
+
getReferenceClientRect: () => {
|
|
118
109
|
const {
|
|
119
110
|
state
|
|
120
111
|
} = editor, {
|
|
@@ -135,28 +126,10 @@ const BubbleMenuEditInformationPane = ({
|
|
|
135
126
|
}
|
|
136
127
|
return new DOMRect(0, 0, 0, 0);
|
|
137
128
|
}
|
|
138
|
-
}), [editor])
|
|
139
|
-
|
|
140
|
-
offset: {
|
|
141
|
-
mainAxis: 0,
|
|
142
|
-
crossAxis: 0
|
|
143
|
-
}
|
|
144
|
-
}), []), getReferencedVirtualElement = useReferencedVirtualElement(reference), handleShouldShow = useCallback(({
|
|
129
|
+
}), [editor]);
|
|
130
|
+
return /* @__PURE__ */ jsx(BubbleMenu, { shouldShow: ({
|
|
145
131
|
editor: editor2
|
|
146
|
-
}) => editor2.isActive("information-pane"),
|
|
147
|
-
return /* @__PURE__ */ jsx(
|
|
148
|
-
BubbleMenu,
|
|
149
|
-
{
|
|
150
|
-
shouldShow: handleShouldShow,
|
|
151
|
-
editor,
|
|
152
|
-
options: floatingOptions,
|
|
153
|
-
getReferencedVirtualElement,
|
|
154
|
-
style: {
|
|
155
|
-
zIndex: FLOATING_MENU_Z_INDEX
|
|
156
|
-
},
|
|
157
|
-
children: editable && /* @__PURE__ */ jsx(Toolbar, { className: "p-8", items: InformationPaneTypeItems })
|
|
158
|
-
}
|
|
159
|
-
);
|
|
132
|
+
}) => editor2.isActive("information-pane"), editor, tippyOptions, children: editable && /* @__PURE__ */ jsx(Toolbar, { className: "p-8", items: InformationPaneTypeItems }) });
|
|
160
133
|
};
|
|
161
134
|
export {
|
|
162
135
|
BubbleMenuEditInformationPane as default
|
|
@@ -3,6 +3,11 @@ import { Content, Extensions, FocusPosition, JSONContent } from '@tiptap/react';
|
|
|
3
3
|
export interface EditorRef {
|
|
4
4
|
/** Get the current content. */
|
|
5
5
|
getContent: (as: 'html' | 'json' | 'plain') => undefined | string | JSONContent;
|
|
6
|
+
/**
|
|
7
|
+
* Whether the editor has no content (TipTap's `editor.isEmpty`).
|
|
8
|
+
* Evaluated on each access, so it always reflects the current document.
|
|
9
|
+
*/
|
|
10
|
+
readonly isEmpty: boolean;
|
|
6
11
|
/** Get speech synthetisis current state */
|
|
7
12
|
isSpeeching: () => boolean;
|
|
8
13
|
/** [De]activate speech synthetisis */
|
|
@@ -60,6 +60,9 @@ const MathsModal = /* @__PURE__ */ lazy(async () => await import("../MathsModal/
|
|
|
60
60
|
throw `[Editor] Unknown content format ${as}`;
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
|
+
get isEmpty() {
|
|
64
|
+
return (editor == null ? void 0 : editor.isEmpty) ?? !0;
|
|
65
|
+
},
|
|
63
66
|
toogleSpeechSynthetisis: speechSynthetisis.toggle,
|
|
64
67
|
isSpeeching: () => speechSynthetisis.isActivated,
|
|
65
68
|
setFocus: (position) => {
|
|
@@ -3,7 +3,6 @@ import { useState, useMemo, useCallback, useEffect } from "react";
|
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import SvgIconTextHighlight from "../../../icons/components/IconTextHighlight.js";
|
|
5
5
|
import { useEditorContext } from "../../hooks/useEditorContext.js";
|
|
6
|
-
import { useEditorState } from "../../hooks/useEditorState.js";
|
|
7
6
|
import { DefaultPalette } from "../../../../components/ColorPicker/ColorPalette.js";
|
|
8
7
|
import Tooltip from "../../../../components/Tooltip/Tooltip.js";
|
|
9
8
|
import IconButton from "../../../../components/Button/IconButton.js";
|
|
@@ -17,16 +16,20 @@ const EditorToolbarHighlightColor = ({
|
|
|
17
16
|
t
|
|
18
17
|
} = useTranslation(), {
|
|
19
18
|
editor
|
|
20
|
-
} = useEditorContext(), [color, setColor] = useState("#4A4A4A"),
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
} = useEditorContext(), [color, setColor] = useState("#4A4A4A"), isActive = useMemo(
|
|
20
|
+
() => editor == null ? void 0 : editor.isActive("customHighlight", {
|
|
21
|
+
color: /^#([0-9a-f]{3}){1,2}$/i
|
|
22
|
+
}),
|
|
23
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
+
[editor, editor == null ? void 0 : editor.state]
|
|
25
|
+
), applyColor = useCallback((value) => {
|
|
23
26
|
value === color || value === "" ? (setColor(""), editor == null || editor.chain().focus().unsetHighlight().run()) : (setColor(value), editor == null || editor.chain().focus().setHighlight({
|
|
24
27
|
color: value
|
|
25
28
|
}).run());
|
|
26
29
|
}, [color, editor]);
|
|
27
30
|
useEffect(() => {
|
|
28
31
|
setColor((editor == null ? void 0 : editor.getAttributes("customHighlight").color) ?? "");
|
|
29
|
-
}, [editor,
|
|
32
|
+
}, [editor, editor == null ? void 0 : editor.state]);
|
|
30
33
|
const palettes = [{
|
|
31
34
|
...DefaultPalette,
|
|
32
35
|
reset: {
|
|
@@ -3,7 +3,6 @@ import { useState, useMemo, useCallback, useEffect } from "react";
|
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import SvgIconTextColor from "../../../icons/components/IconTextColor.js";
|
|
5
5
|
import { useEditorContext } from "../../hooks/useEditorContext.js";
|
|
6
|
-
import { useEditorState } from "../../hooks/useEditorState.js";
|
|
7
6
|
import { DefaultPalette, AccessiblePalette } from "../../../../components/ColorPicker/ColorPalette.js";
|
|
8
7
|
import Tooltip from "../../../../components/Tooltip/Tooltip.js";
|
|
9
8
|
import IconButton from "../../../../components/Button/IconButton.js";
|
|
@@ -17,15 +16,19 @@ const EditorToolbarTextColor = ({
|
|
|
17
16
|
t
|
|
18
17
|
} = useTranslation(), {
|
|
19
18
|
editor
|
|
20
|
-
} = useEditorContext(), [color, setColor] = useState("#4A4A4A"),
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
} = useEditorContext(), [color, setColor] = useState("#4A4A4A"), isActive = useMemo(
|
|
20
|
+
() => editor == null ? void 0 : editor.isActive("textStyle", {
|
|
21
|
+
color: /^#([0-9a-f]{3}){1,2}$/i
|
|
22
|
+
}),
|
|
23
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
+
[editor, editor == null ? void 0 : editor.state]
|
|
25
|
+
), applyColor = useCallback((value) => {
|
|
23
26
|
value === color ? (setColor(""), editor == null || editor.chain().focus().unsetColor().run()) : (setColor(value), editor == null || editor.chain().focus().setColor(value).run());
|
|
24
27
|
}, [color, editor]);
|
|
25
28
|
useEffect(() => {
|
|
26
29
|
const textStyle = editor == null ? void 0 : editor.getAttributes("textStyle");
|
|
27
30
|
setColor((textStyle == null ? void 0 : textStyle.color) ?? "#4A4A4A");
|
|
28
|
-
}, [editor,
|
|
31
|
+
}, [editor, editor == null ? void 0 : editor.state]);
|
|
29
32
|
const palettes = [{
|
|
30
33
|
...DefaultPalette,
|
|
31
34
|
label: t("tiptap.toolbar.color.text")
|