@frontify/guideline-blocks-settings 0.28.1 → 0.28.3
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/CHANGELOG.md +17 -0
- package/dist/components/Attachments/AttachmentItem.es.js +78 -78
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +86 -86
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +68 -68
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +34 -34
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar.es.js +33 -33
- package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -1
- package/dist/components/DownloadButton/DownloadButton.es.js +12 -12
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +22 -22
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +8 -8
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +8 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +6 -6
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +13 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +19 -19
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +7 -7
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +8 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +11 -11
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +15 -15
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +3 -3
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +40 -40
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +7 -7
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +29 -29
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +4 -4
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +20 -20
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +18 -18
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +16 -16
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +19 -19
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +15 -15
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +34 -34
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +28 -28
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +36 -36
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +30 -30
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +17 -17
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +14 -14
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js +5 -5
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +1 -1
- package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -1
- package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -1
- package/dist/helpers/addHttps.es.js.map +1 -1
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -1
- package/dist/helpers/hasRichTextValue.es.js.map +1 -1
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/hooks/useDndSensors.es.js.map +1 -1
- package/dist/index.cjs.js +13 -246
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +12 -10
- package/dist/index.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +13 -246
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +1 -1
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +1 -1
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +1 -1
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/gutter.es.js +1 -1
- package/dist/settings/margin.es.js +1 -1
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +1 -1
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +1 -1
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +1 -1
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityGlobalControl.es.js +1 -1
- package/dist/styles.css +1 -0
- package/dist/styles.css.es.js +5 -0
- package/dist/styles.css.es.js.map +1 -0
- package/dist/utilities/moveItemInArray.es.js.map +1 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
- package/package.json +26 -24
- package/src/components/Attachments/AttachmentItem.tsx +2 -2
- package/src/components/Attachments/Attachments.spec.ct.tsx +4 -4
- package/src/components/Attachments/Attachments.tsx +2 -2
- package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +2 -2
- package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +8 -8
- package/src/components/BlockItemWrapper/Toolbar.tsx +1 -1
- package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +8 -8
- package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +3 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +5 -5
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +2 -2
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +2 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.spec.ts +24 -27
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +1 -1
- package/src/components/RichTextEditor/plugins/styles.ts +1 -1
- package/src/components/RichTextEditor/serializer/nodes/button.ts +2 -1
- package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +3 -2
- package/src/components/RichTextEditor/serializer/nodes/default.ts +5 -4
- package/src/components/RichTextEditor/serializer/nodes/link.ts +4 -3
- package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +5 -5
- package/src/components/RichTextEditor/serializer/serializeToHtml.ts +2 -2
- package/src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts +1 -1
- package/src/hooks/useAttachments.ts +1 -1
- package/src/hooks/useDndSensors.ts +1 -1
- package/src/index.ts +3 -3
- package/src/settings/background.spec.ts +1 -1
- package/src/settings/border.spec.ts +1 -1
- package/src/settings/borderRadiusExtended.spec.ts +4 -4
- package/src/settings/marginExtended.spec.ts +4 -4
- package/src/settings/paddingExtended.spec.ts +4 -4
- package/src/styles.css +3 -0
- package/src/utilities/react/getBackgroundColorStyles.ts +2 -3
- package/src/utilities/react/getBorderStyles.ts +3 -4
- package/src/utilities/react/getRadiusStyles.ts +1 -1
- package/vite.config.ts +25 -3
- package/dist/_virtual/_commonjsHelpers.es.js +0 -7
- package/dist/_virtual/_commonjsHelpers.es.js.map +0 -1
- package/dist/_virtual/index.es.js +0 -5
- package/dist/_virtual/index.es.js.map +0 -1
- package/dist/_virtual/index.es2.js +0 -5
- package/dist/_virtual/index.es2.js.map +0 -1
- package/dist/_virtual/index.es3.js +0 -5
- package/dist/_virtual/index.es3.js.map +0 -1
- package/dist/_virtual/jsx-runtime.es.js +0 -5
- package/dist/_virtual/jsx-runtime.es.js.map +0 -1
- package/dist/_virtual/react-dom.development.es.js +0 -5
- package/dist/_virtual/react-dom.development.es.js.map +0 -1
- package/dist/_virtual/react-dom.production.min.es.js +0 -5
- package/dist/_virtual/react-dom.production.min.es.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.development.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.development.es.js.map +0 -1
- package/dist/_virtual/react-jsx-runtime.production.min.es.js +0 -5
- package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +0 -1
- package/dist/_virtual/react.development.es.js +0 -5
- package/dist/_virtual/react.development.es.js.map +0 -1
- package/dist/_virtual/react.production.min.es.js +0 -5
- package/dist/_virtual/react.production.min.es.js.map +0 -1
- package/dist/_virtual/scheduler.development.es.js +0 -5
- package/dist/_virtual/scheduler.development.es.js.map +0 -1
- package/dist/_virtual/scheduler.production.min.es.js +0 -5
- package/dist/_virtual/scheduler.production.min.es.js.map +0 -1
- package/dist/style.css +0 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { useEditorRef as
|
|
2
|
-
import {
|
|
1
|
+
import { useEditorRef as d, getPluginOptions as c, useHotkeys as p, getSelectionBoundingClientRect as a, useComposedRef as B } from "@udecode/plate";
|
|
2
|
+
import { useEffect as E } from "react";
|
|
3
3
|
import { useFocused as F } from "slate-react";
|
|
4
4
|
import { ELEMENT_BUTTON as y } from "../../createButtonPlugin.es.js";
|
|
5
5
|
import { triggerFloatingButtonInsert as C } from "../../utils/triggerFloatingButtonInsert.es.js";
|
|
6
6
|
import { useFloatingButtonSelectors as r, floatingButtonActions as O } from "./floatingButtonStore.es.js";
|
|
7
7
|
import { useVirtualFloatingButton as R } from "./useVirtualFloatingButton.es.js";
|
|
8
|
-
import { useFloatingButtonEscape as
|
|
8
|
+
import { useFloatingButtonEscape as I } from "./useFloatingButtonEscape.es.js";
|
|
9
9
|
const S = ({ floatingOptions: s, ...o }) => {
|
|
10
|
-
const e =
|
|
11
|
-
|
|
10
|
+
const e = d(), n = F(), u = r().mode(), t = r().isOpen(e.id), { triggerFloatingButtonHotkeys: l } = c(e, y);
|
|
11
|
+
p(
|
|
12
12
|
l,
|
|
13
13
|
(g) => {
|
|
14
14
|
g.preventDefault(), C(e, {
|
|
@@ -22,13 +22,13 @@ const S = ({ floatingOptions: s, ...o }) => {
|
|
|
22
22
|
);
|
|
23
23
|
const { update: i, style: m, floating: f } = R({
|
|
24
24
|
open: t && u === "insert",
|
|
25
|
-
getBoundingClientRect:
|
|
25
|
+
getBoundingClientRect: a,
|
|
26
26
|
whileElementsMounted: void 0,
|
|
27
27
|
...s
|
|
28
28
|
});
|
|
29
|
-
return E
|
|
29
|
+
return E(() => {
|
|
30
30
|
t && i(), O.updated(t);
|
|
31
|
-
}, [t, i]),
|
|
31
|
+
}, [t, i]), I(), {
|
|
32
32
|
style: {
|
|
33
33
|
...m,
|
|
34
34
|
zIndex: 1e3
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFloatingButtonInsert.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n HTMLPropsAs,\n getPluginOptions,\n getSelectionBoundingClientRect,\n useComposedRef,\n useEditorRef,\n useHotkeys,\n} from '@udecode/plate';\nimport { useEffect } from 'react';\nimport { useFocused } from 'slate-react';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../../createButtonPlugin';\nimport { triggerFloatingButtonInsert } from '../../utils/triggerFloatingButtonInsert';\nimport {\n FloatingButtonProps,\n floatingButtonActions,\n useFloatingButtonEscape,\n useFloatingButtonSelectors,\n useVirtualFloatingButton,\n} from '.';\n\nexport const useFloatingButtonInsert = ({ floatingOptions, ...props }: FloatingButtonProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const focused = useFocused();\n const mode = useFloatingButtonSelectors().mode();\n const open = useFloatingButtonSelectors().isOpen(editor.id);\n\n const { triggerFloatingButtonHotkeys } = getPluginOptions<ButtonPlugin>(editor, ELEMENT_BUTTON);\n\n useHotkeys(\n triggerFloatingButtonHotkeys,\n (e) => {\n e.preventDefault();\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n },\n {\n enableOnContentEditable: true,\n },\n [focused]
|
|
1
|
+
{"version":3,"file":"useFloatingButtonInsert.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n HTMLPropsAs,\n getPluginOptions,\n getSelectionBoundingClientRect,\n useComposedRef,\n useEditorRef,\n useHotkeys,\n} from '@udecode/plate';\nimport { useEffect } from 'react';\nimport { useFocused } from 'slate-react';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../../createButtonPlugin';\nimport { triggerFloatingButtonInsert } from '../../utils/triggerFloatingButtonInsert';\nimport {\n FloatingButtonProps,\n floatingButtonActions,\n useFloatingButtonEscape,\n useFloatingButtonSelectors,\n useVirtualFloatingButton,\n} from '.';\n\nexport const useFloatingButtonInsert = ({ floatingOptions, ...props }: FloatingButtonProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const focused = useFocused();\n const mode = useFloatingButtonSelectors().mode();\n const open = useFloatingButtonSelectors().isOpen(editor.id);\n\n const { triggerFloatingButtonHotkeys } = getPluginOptions<ButtonPlugin>(editor, ELEMENT_BUTTON);\n\n useHotkeys(\n triggerFloatingButtonHotkeys,\n (e) => {\n e.preventDefault();\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n },\n {\n enableOnContentEditable: true,\n },\n [focused],\n );\n\n const { update, style, floating } = useVirtualFloatingButton({\n open: open && mode === 'insert',\n getBoundingClientRect: getSelectionBoundingClientRect,\n whileElementsMounted: undefined,\n ...floatingOptions,\n });\n\n // wait for update before focusing input\n useEffect(() => {\n if (open) {\n update();\n }\n floatingButtonActions.updated(open);\n }, [open, update]);\n\n useFloatingButtonEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1000,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n"],"names":["useFloatingButtonInsert","floatingOptions","props","editor","useEditorRef","focused","useFocused","mode","useFloatingButtonSelectors","open","triggerFloatingButtonHotkeys","getPluginOptions","ELEMENT_BUTTON","useHotkeys","e","triggerFloatingButtonInsert","update","style","floating","useVirtualFloatingButton","getSelectionBoundingClientRect","useEffect","floatingButtonActions","useFloatingButtonEscape","useComposedRef"],"mappings":";;;;;;;;AAsBO,MAAMA,IAA0B,CAAC,EAAE,iBAAAC,GAAiB,GAAGC,QAAqD;AAC/G,QAAMC,IAASC,KACTC,IAAUC,KACVC,IAAOC,IAA6B,QACpCC,IAAOD,EAA6B,EAAA,OAAOL,EAAO,EAAE,GAEpD,EAAE,8BAAAO,EAAiC,IAAAC,EAA+BR,GAAQS,CAAc;AAE9F,EAAAC;AAAA,IACIH;AAAA,IACA,CAACI,MAAM;AACH,MAAAA,EAAE,eAAe,GAEjBC,EAA4BZ,GAAQ;AAAA,QAChC,SAAAE;AAAA,MAAA,CACH;AAAA,IACL;AAAA,IACA;AAAA,MACI,yBAAyB;AAAA,IAC7B;AAAA,IACA,CAACA,CAAO;AAAA,EAAA;AAGZ,QAAM,EAAE,QAAAW,GAAQ,OAAAC,GAAO,UAAAC,EAAA,IAAaC,EAAyB;AAAA,IACzD,MAAMV,KAAQF,MAAS;AAAA,IACvB,uBAAuBa;AAAA,IACvB,sBAAsB;AAAA,IACtB,GAAGnB;AAAA,EAAA,CACN;AAGD,SAAAoB,EAAU,MAAM;AACZ,IAAIZ,KACOO,KAEXM,EAAsB,QAAQb,CAAI;AAAA,EAAA,GACnC,CAACA,GAAMO,CAAM,CAAC,GAEOO,KAEjB;AAAA,IACH,OAAO;AAAA,MACH,GAAGN;AAAA,MACH,QAAQ;AAAA,IACZ;AAAA,IACA,GAAGf;AAAA,IACH,KAAKsB,EAAmCtB,EAAM,KAAKgB,CAAQ;AAAA,EAAA;AAEnE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createButtonPlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { Plugin, PluginProps } from '@frontify/fondue';\nimport { RangeBeforeOptions, createPluginFactory } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { isValidUrl } from '../LinkPlugin/utils/url';\nimport { ButtonMarkupElement } from './ButtonMarkupElement';\nimport { ButtonButton } from './components/ButtonButton';\nimport { CustomFloatingButton } from './components/FloatingButton/CustomFloatingButton';\nimport { BlockButtonStyles } from './utils';\nimport { withButton } from './withButton';\n\nexport const ELEMENT_BUTTON = 'button';\nexport const BUTTON_PLUGIN = 'button-plugin';\n\nexport interface ButtonPlugin {\n forceSubmit?: boolean;\n\n /**\n * Allow custom config for rangeBeforeOptions.\n * @example default\n * {\n * matchString: ' ',\n * skipInvalid: true,\n * afterMatch: true,\n * }\n */\n rangeBeforeOptions?: RangeBeforeOptions;\n\n /**\n * Hotkeys to trigger floating button.\n * @default 'command+k, ctrl+k'\n */\n triggerFloatingButtonHotkeys: string;\n\n /**\n * Callback to validate an url.\n * @default isUrl\n */\n isUrl: (text: string) => boolean;\n\n /**\n * Callback to optionally get the href for a url\n * @returns href: an optional link to be used that is different from the text content (example https://google.com for google.com)\n */\n getUrlHref?: (url: string) => string | undefined;\n\n /**\n * On keyboard shortcut or toolbar mousedown, get the link url by calling this promise. The\n * default behavior is to use the browser's native `prompt`.\n */\n getLinkUrl?: (prevUrl: string | null) => Promise<string | null>;\n}\n\n/**\n * Enables support for hyperlinks.\n */\nexport const createButtonPlugin = (appBridge: AppBridgeBlock) =>\n createPluginFactory({\n key: ELEMENT_BUTTON,\n isElement: true,\n isInline: true,\n props: ({ element }) => ({\n nodeProps: { href: element?.url, target: element?.target },\n }),\n withOverrides: withButton,\n renderAfterEditable: CustomFloatingButton,\n options: {\n isUrl: isValidUrl,\n rangeBeforeOptions: {\n matchString: ' ',\n skipInvalid: true,\n afterMatch: true,\n },\n triggerFloatingButtonHotkeys: 'command+shift+k, ctrl+shift+k',\n appBridge,\n },\n then: (editor, { type }) => ({\n deserializeHtml: {\n rules: [\n {\n validNodeName: 'A',\n validClassName: 'btn',\n },\n ],\n getNode: (el) => ({\n type,\n url: el.getAttribute('href'),\n target: el.getAttribute('target') || '_blank',\n }),\n },\n }),\n })();\n\nexport type ButtonPluginProps = Omit<PluginProps, 'styles'> & {\n styles?: Record<string, CSSProperties & { hover?: CSSProperties }>;\n} & { appBridge: AppBridgeBlock };\n\nexport class ButtonPlugin extends Plugin {\n public styles: CSSProperties = {};\n private appBridge: AppBridgeBlock;\n constructor({ styles = BlockButtonStyles, ...props }: ButtonPluginProps) {\n super(BUTTON_PLUGIN, {\n button: ButtonButton,\n markupElement: new ButtonMarkupElement(),\n ...props,\n });\n this.styles = styles;\n this.appBridge = props?.appBridge as AppBridgeBlock;\n }\n\n plugins() {\n return [createButtonPlugin(this.appBridge)];\n }\n}\n"],"names":["ELEMENT_BUTTON","BUTTON_PLUGIN","createButtonPlugin","appBridge","createPluginFactory","element","withButton","CustomFloatingButton","isValidUrl","editor","type","el","ButtonPlugin","Plugin","styles","BlockButtonStyles","props","ButtonButton","ButtonMarkupElement"],"mappings":";;;;;;;;AAaO,MAAMA,IAAiB,UACjBC,IAAgB,
|
|
1
|
+
{"version":3,"file":"createButtonPlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport { Plugin, PluginProps } from '@frontify/fondue';\nimport { RangeBeforeOptions, createPluginFactory } from '@udecode/plate';\nimport type { CSSProperties } from 'react';\nimport { isValidUrl } from '../LinkPlugin/utils/url';\nimport { ButtonMarkupElement } from './ButtonMarkupElement';\nimport { ButtonButton } from './components/ButtonButton';\nimport { CustomFloatingButton } from './components/FloatingButton/CustomFloatingButton';\nimport { BlockButtonStyles } from './utils';\nimport { withButton } from './withButton';\n\nexport const ELEMENT_BUTTON = 'button';\nexport const BUTTON_PLUGIN = 'button-plugin';\n\n// eslint-disable-next-line\nexport interface ButtonPlugin {\n forceSubmit?: boolean;\n\n /**\n * Allow custom config for rangeBeforeOptions.\n * @example default\n * {\n * matchString: ' ',\n * skipInvalid: true,\n * afterMatch: true,\n * }\n */\n rangeBeforeOptions?: RangeBeforeOptions;\n\n /**\n * Hotkeys to trigger floating button.\n * @default 'command+k, ctrl+k'\n */\n triggerFloatingButtonHotkeys: string;\n\n /**\n * Callback to validate an url.\n * @default isUrl\n */\n isUrl: (text: string) => boolean;\n\n /**\n * Callback to optionally get the href for a url\n * @returns href: an optional link to be used that is different from the text content (example https://google.com for google.com)\n */\n getUrlHref?: (url: string) => string | undefined;\n\n /**\n * On keyboard shortcut or toolbar mousedown, get the link url by calling this promise. The\n * default behavior is to use the browser's native `prompt`.\n */\n getLinkUrl?: (prevUrl: string | null) => Promise<string | null>;\n}\n\n/**\n * Enables support for hyperlinks.\n */\nexport const createButtonPlugin = (appBridge: AppBridgeBlock) =>\n createPluginFactory({\n key: ELEMENT_BUTTON,\n isElement: true,\n isInline: true,\n props: ({ element }) => ({\n nodeProps: { href: element?.url, target: element?.target },\n }),\n withOverrides: withButton,\n renderAfterEditable: CustomFloatingButton,\n options: {\n isUrl: isValidUrl,\n rangeBeforeOptions: {\n matchString: ' ',\n skipInvalid: true,\n afterMatch: true,\n },\n triggerFloatingButtonHotkeys: 'command+shift+k, ctrl+shift+k',\n appBridge,\n },\n then: (editor, { type }) => ({\n deserializeHtml: {\n rules: [\n {\n validNodeName: 'A',\n validClassName: 'btn',\n },\n ],\n getNode: (el) => ({\n type,\n url: el.getAttribute('href'),\n target: el.getAttribute('target') || '_blank',\n }),\n },\n }),\n })();\n\nexport type ButtonPluginProps = Omit<PluginProps, 'styles'> & {\n styles?: Record<string, CSSProperties & { hover?: CSSProperties }>;\n} & { appBridge: AppBridgeBlock };\n\n// eslint-disable-next-line\nexport class ButtonPlugin extends Plugin {\n public styles: CSSProperties = {};\n private appBridge: AppBridgeBlock;\n constructor({ styles = BlockButtonStyles, ...props }: ButtonPluginProps) {\n super(BUTTON_PLUGIN, {\n button: ButtonButton,\n markupElement: new ButtonMarkupElement(),\n ...props,\n });\n this.styles = styles;\n this.appBridge = props?.appBridge as AppBridgeBlock;\n }\n\n plugins() {\n return [createButtonPlugin(this.appBridge)];\n }\n}\n"],"names":["ELEMENT_BUTTON","BUTTON_PLUGIN","createButtonPlugin","appBridge","createPluginFactory","element","withButton","CustomFloatingButton","isValidUrl","editor","type","el","ButtonPlugin","Plugin","styles","BlockButtonStyles","props","ButtonButton","ButtonMarkupElement"],"mappings":";;;;;;;;AAaO,MAAMA,IAAiB,UACjBC,IAAgB,iBA6ChBC,IAAqB,CAACC,MAC/BC,EAAoB;AAAA,EAChB,KAAKJ;AAAA,EACL,WAAW;AAAA,EACX,UAAU;AAAA,EACV,OAAO,CAAC,EAAE,SAAAK,SAAe;AAAA,IACrB,WAAW,EAAE,MAAMA,KAAA,gBAAAA,EAAS,KAAK,QAAQA,KAAA,gBAAAA,EAAS,OAAO;AAAA,EAAA;AAAA,EAE7D,eAAeC;AAAA,EACf,qBAAqBC;AAAA,EACrB,SAAS;AAAA,IACL,OAAOC;AAAA,IACP,oBAAoB;AAAA,MAChB,aAAa;AAAA,MACb,aAAa;AAAA,MACb,YAAY;AAAA,IAChB;AAAA,IACA,8BAA8B;AAAA,IAC9B,WAAAL;AAAA,EACJ;AAAA,EACA,MAAM,CAACM,GAAQ,EAAE,MAAAC,SAAY;AAAA,IACzB,iBAAiB;AAAA,MACb,OAAO;AAAA,QACH;AAAA,UACI,eAAe;AAAA,UACf,gBAAgB;AAAA,QACpB;AAAA,MACJ;AAAA,MACA,SAAS,CAACC,OAAQ;AAAA,QACd,MAAAD;AAAA,QACA,KAAKC,EAAG,aAAa,MAAM;AAAA,QAC3B,QAAQA,EAAG,aAAa,QAAQ,KAAK;AAAA,MAAA;AAAA,IAE7C;AAAA,EAAA;AAER,CAAC,EAAE;AAOA,MAAMC,UAAqBC,EAAO;AAAA,EAGrC,YAAY,EAAE,QAAAC,IAASC,GAAmB,GAAGC,KAA4B;AACrE,UAAMf,GAAe;AAAA,MACjB,QAAQgB;AAAA,MACR,eAAe,IAAIC,EAAoB;AAAA,MACvC,GAAGF;AAAA,IAAA,CACN,GAPL,KAAO,SAAwB,IAQ3B,KAAK,SAASF,GACd,KAAK,YAAYE,KAAA,gBAAAA,EAAO;AAAA,EAC5B;AAAA,EAEA,UAAU;AACN,WAAO,CAACd,EAAmB,KAAK,SAAS,CAAC;AAAA,EAC9C;AACJ;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"insertButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertNodesOptions, PlateEditor, TText, Value, insertNodes } from '@udecode/plate';\nimport { TButtonElement } from '../types';\nimport { CreateButtonNodeOptions, createButtonNode } from '../utils/index';\n\nexport const insertButton = <V extends Value>(\n editor: PlateEditor<V>,\n createButtonNodeOptions: CreateButtonNodeOptions,\n options?: InsertNodesOptions<V
|
|
1
|
+
{"version":3,"file":"insertButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertNodesOptions, PlateEditor, TText, Value, insertNodes } from '@udecode/plate';\nimport { TButtonElement } from '../types';\nimport { CreateButtonNodeOptions, createButtonNode } from '../utils/index';\n\nexport const insertButton = <V extends Value>(\n editor: PlateEditor<V>,\n createButtonNodeOptions: CreateButtonNodeOptions,\n options?: InsertNodesOptions<V>,\n) => {\n insertNodes<TButtonElement | TText>(\n editor,\n [createButtonNode(editor, createButtonNodeOptions)],\n options as InsertNodesOptions,\n );\n};\n"],"names":["insertButton","editor","createButtonNodeOptions","options","insertNodes","createButtonNode"],"mappings":";;AAMO,MAAMA,IAAe,CACxBC,GACAC,GACAC,MACC;AACD,EAAAC;AAAA,IACIH;AAAA,IACA,CAACI,EAAiBJ,GAAQC,CAAuB,CAAC;AAAA,IAClDC;AAAA,EAAA;AAER;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unwrapButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n PlateEditor,\n UnwrapNodesOptions,\n Value,\n getAboveNode,\n getPluginType,\n isElement,\n splitNodes,\n unwrapNodes,\n withoutNormalizing,\n} from '@udecode/plate';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Unwrap button node.\n */\nexport const unwrapButton = <V extends Value>(\n editor: PlateEditor<V>,\n options?: UnwrapNodesOptions & {\n split?: boolean;\n }
|
|
1
|
+
{"version":3,"file":"unwrapButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n PlateEditor,\n UnwrapNodesOptions,\n Value,\n getAboveNode,\n getPluginType,\n isElement,\n splitNodes,\n unwrapNodes,\n withoutNormalizing,\n} from '@udecode/plate';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Unwrap button node.\n */\nexport const unwrapButton = <V extends Value>(\n editor: PlateEditor<V>,\n options?: UnwrapNodesOptions & {\n split?: boolean;\n },\n) => {\n return withoutNormalizing(editor, () => {\n if (options?.split) {\n const buttonAboveAnchor = getAboveNode(editor, {\n at: editor.selection?.anchor,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n // anchor in button\n if (buttonAboveAnchor) {\n splitNodes(editor, {\n at: editor.selection?.anchor,\n match: (n) => isElement(n) && n.type === getPluginType(editor, ELEMENT_BUTTON),\n });\n unwrapButton(editor, {\n at: editor.selection?.anchor,\n });\n return true;\n }\n const buttonAboveFocus = getAboveNode(editor, {\n at: editor.selection?.focus,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n // focus in button\n if (buttonAboveFocus) {\n splitNodes(editor, {\n at: editor.selection?.focus,\n match: (n) => isElement(n) && n.type === getPluginType(editor, ELEMENT_BUTTON),\n });\n unwrapButton(editor, {\n at: editor.selection?.focus,\n });\n return true;\n }\n }\n\n unwrapNodes(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n ...options,\n });\n\n return;\n });\n};\n"],"names":["unwrapButton","editor","options","withoutNormalizing","getAboveNode","_a","getPluginType","ELEMENT_BUTTON","splitNodes","_b","n","isElement","_c","_d","_e","_f","unwrapNodes"],"mappings":";;AAkBa,MAAAA,IAAe,CACxBC,GACAC,MAIOC,EAAmBF,GAAQ,MAAM;;AACpC,MAAIC,KAAA,QAAAA,EAAS,OAAO;AAOhB,QAN0BE,EAAaH,GAAQ;AAAA,MAC3C,KAAII,IAAAJ,EAAO,cAAP,gBAAAI,EAAkB;AAAA,MACtB,OAAO,EAAE,MAAMC,EAAcL,GAAQM,CAAc,EAAE;AAAA,IAAA,CACxD;AAIG,aAAAC,EAAWP,GAAQ;AAAA,QACf,KAAIQ,IAAAR,EAAO,cAAP,gBAAAQ,EAAkB;AAAA,QACtB,OAAO,CAACC,MAAMC,EAAUD,CAAC,KAAKA,EAAE,SAASJ,EAAcL,GAAQM,CAAc;AAAA,MAAA,CAChF,GACDP,EAAaC,GAAQ;AAAA,QACjB,KAAIW,IAAAX,EAAO,cAAP,gBAAAW,EAAkB;AAAA,MAAA,CACzB,GACM;AAQX,QANyBR,EAAaH,GAAQ;AAAA,MAC1C,KAAIY,IAAAZ,EAAO,cAAP,gBAAAY,EAAkB;AAAA,MACtB,OAAO,EAAE,MAAMP,EAAcL,GAAQM,CAAc,EAAE;AAAA,IAAA,CACxD;AAIG,aAAAC,EAAWP,GAAQ;AAAA,QACf,KAAIa,IAAAb,EAAO,cAAP,gBAAAa,EAAkB;AAAA,QACtB,OAAO,CAACJ,MAAMC,EAAUD,CAAC,KAAKA,EAAE,SAASJ,EAAcL,GAAQM,CAAc;AAAA,MAAA,CAChF,GACDP,EAAaC,GAAQ;AAAA,QACjB,KAAIc,IAAAd,EAAO,cAAP,gBAAAc,EAAkB;AAAA,MAAA,CACzB,GACM;AAAA,EAEf;AAEA,EAAAC,EAAYf,GAAQ;AAAA,IAChB,OAAO,EAAE,MAAMK,EAAcL,GAAQM,CAAc,EAAE;AAAA,IACrD,GAAGL;AAAA,EAAA,CACN;AAED,CACH;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsertButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n InsertNodesOptions,\n PlateEditor,\n TNode,\n TNodeEntry,\n UnwrapNodesOptions,\n Value,\n WrapNodesOptions,\n findNode,\n getAboveNode,\n getEditorString,\n getNodeLeaf,\n getNodeProps,\n getPluginOptions,\n getPluginType,\n isDefined,\n isExpanded,\n removeNodes,\n setNodes,\n} from '@udecode/plate';\nimport { Path } from 'slate';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { RichTextButtonStyle, TButtonElement } from '../types';\nimport { CreateButtonNodeOptions } from '../utils/index';\nimport { insertButton, unwrapButton, upsertButtonText, wrapButton } from '.';\n\nexport type UpsertButtonOptions<V extends Value = Value> = CreateButtonNodeOptions & {\n /**\n * If true, insert text when selection is in url.\n */\n insertTextInButton?: boolean;\n insertNodesOptions?: InsertNodesOptions<V>;\n unwrapNodesOptions?: UnwrapNodesOptions<V>;\n wrapNodesOptions?: WrapNodesOptions<V>;\n isUrl?: (url: string) => boolean;\n};\n\n/**\n * If selection in a button or is not url:\n * - insert text with url, exit\n * If selection is expanded or `update` in a button:\n * - remove button node, get button text\n * Then:\n * - insert button node\n */\nexport const upsertButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n url,\n text,\n buttonStyle,\n target,\n insertTextInButton,\n insertNodesOptions,\n isUrl = getPluginOptions<ButtonPlugin, V>(editor, ELEMENT_BUTTON).isUrl,\n }: UpsertButtonOptions<V
|
|
1
|
+
{"version":3,"file":"upsertButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n InsertNodesOptions,\n PlateEditor,\n TNode,\n TNodeEntry,\n UnwrapNodesOptions,\n Value,\n WrapNodesOptions,\n findNode,\n getAboveNode,\n getEditorString,\n getNodeLeaf,\n getNodeProps,\n getPluginOptions,\n getPluginType,\n isDefined,\n isExpanded,\n removeNodes,\n setNodes,\n} from '@udecode/plate';\nimport { Path } from 'slate';\nimport { ButtonPlugin, ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { RichTextButtonStyle, TButtonElement } from '../types';\nimport { CreateButtonNodeOptions } from '../utils/index';\nimport { insertButton, unwrapButton, upsertButtonText, wrapButton } from '.';\n\nexport type UpsertButtonOptions<V extends Value = Value> = CreateButtonNodeOptions & {\n /**\n * If true, insert text when selection is in url.\n */\n insertTextInButton?: boolean;\n insertNodesOptions?: InsertNodesOptions<V>;\n unwrapNodesOptions?: UnwrapNodesOptions<V>;\n wrapNodesOptions?: WrapNodesOptions<V>;\n isUrl?: (url: string) => boolean;\n};\n\n/**\n * If selection in a button or is not url:\n * - insert text with url, exit\n * If selection is expanded or `update` in a button:\n * - remove button node, get button text\n * Then:\n * - insert button node\n */\nexport const upsertButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n url,\n text,\n buttonStyle,\n target,\n insertTextInButton,\n insertNodesOptions,\n isUrl = getPluginOptions<ButtonPlugin, V>(editor, ELEMENT_BUTTON).isUrl,\n }: UpsertButtonOptions<V>,\n) => {\n const at = editor.selection;\n if (!at) {\n return;\n }\n\n const buttonAbove = getAboveNode<TButtonElement>(editor, {\n at,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n // anchor and focus in button -> insert text\n if (insertTextInButton && buttonAbove) {\n // we don't want to insert marks in buttons\n editor.insertText(url);\n return true;\n }\n\n if (!isUrl?.(url)) {\n return;\n }\n\n if (isDefined(text) && text.length === 0) {\n text = url;\n }\n\n if (buttonAbove) {\n editButtonUrlAndTarget<V>(url, editor, buttonAbove, target, buttonStyle, text);\n return true;\n }\n\n // selection contains at one edge edge or between the edges\n const buttonEntry = findNode<TButtonElement>(editor, {\n at,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n const [buttonNode, buttonPath] = buttonEntry ?? [];\n\n const shouldReplaceText = shouldReplaceButtonText<V>(editor, buttonPath, text);\n\n if (isExpanded(at)) {\n anchorAndFocusInButton<V>(buttonAbove, editor, url, buttonStyle, target, text);\n return true;\n }\n\n if (shouldReplaceText) {\n removeNodes(editor, {\n at: buttonPath,\n });\n }\n\n const props = getNodeProps(buttonNode ?? ({} as TNode));\n\n const path = editor.selection?.focus.path;\n if (!path) {\n return;\n }\n\n // button text should have the focused leaf marks\n const leaf = getNodeLeaf(editor, path);\n\n // if text is empty, text is url\n if (!text?.length) {\n text = url;\n }\n\n insertButton(\n editor,\n {\n ...props,\n url,\n target,\n children: [\n {\n ...leaf,\n text,\n },\n ],\n },\n insertNodesOptions,\n );\n return true;\n};\n\nfunction shouldReplaceButtonText<V extends Value>(editor: PlateEditor<V>, buttonPath?: Path, text?: string) {\n return buttonPath && text?.length && text !== getEditorString(editor, buttonPath);\n}\n\nfunction anchorAndFocusInButton<V extends Value>(\n buttonAbove: undefined,\n editor: PlateEditor<V>,\n url: string,\n buttonStyle?: RichTextButtonStyle,\n target?: string,\n text?: string,\n) {\n if (buttonAbove) {\n unwrapButton(editor, {\n at: buttonAbove[1],\n });\n } else {\n unwrapButton(editor, {\n split: true,\n });\n }\n\n wrapButton(editor, {\n url,\n buttonStyle,\n target,\n });\n\n upsertButtonText(editor, { url, target, text });\n}\n\nfunction editButtonUrlAndTarget<V extends Value>(\n url: string,\n editor: PlateEditor<V>,\n buttonAbove: TNodeEntry<TButtonElement>,\n target?: string,\n buttonStyle?: string,\n text?: string,\n) {\n if (\n url !== buttonAbove[0]?.url ||\n target !== buttonAbove[0]?.target ||\n buttonStyle !== buttonAbove[0]?.buttonStyle\n ) {\n setNodes<TButtonElement>(\n editor,\n { url, target, buttonStyle },\n {\n at: buttonAbove[1],\n },\n );\n }\n\n upsertButtonText(editor, { url, text, target });\n}\n"],"names":["upsertButton","editor","url","text","buttonStyle","target","insertTextInButton","insertNodesOptions","isUrl","getPluginOptions","ELEMENT_BUTTON","at","buttonAbove","getAboveNode","getPluginType","isDefined","editButtonUrlAndTarget","buttonEntry","findNode","buttonNode","buttonPath","shouldReplaceText","shouldReplaceButtonText","isExpanded","anchorAndFocusInButton","removeNodes","props","getNodeProps","path","_a","leaf","getNodeLeaf","insertButton","getEditorString","unwrapButton","wrapButton","upsertButtonText","_b","_c","setNodes"],"mappings":";;;;;;AA+Ca,MAAAA,IAAe,CACxBC,GACA;AAAA,EACI,KAAAC;AAAA,EACA,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,QAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,OAAAC,IAAQC,EAAkCR,GAAQS,CAAc,EAAE;AACtE,MACC;;AACD,QAAMC,IAAKV,EAAO;AAClB,MAAI,CAACU;AACD;AAGE,QAAAC,IAAcC,EAA6BZ,GAAQ;AAAA,IACrD,IAAAU;AAAA,IACA,OAAO,EAAE,MAAMG,EAAcb,GAAQS,CAAc,EAAE;AAAA,EAAA,CACxD;AAGD,MAAIJ,KAAsBM;AAEtB,WAAAX,EAAO,WAAWC,CAAG,GACd;AAGP,MAAA,EAACM,KAAA,QAAAA,EAAQN;AACT;AAOJ,MAJIa,EAAUZ,CAAI,KAAKA,EAAK,WAAW,MAC5BA,IAAAD,IAGPU;AACA,WAAAI,EAA0Bd,GAAKD,GAAQW,GAAaP,GAAQD,GAAaD,CAAI,GACtE;AAIL,QAAAc,IAAcC,EAAyBjB,GAAQ;AAAA,IACjD,IAAAU;AAAA,IACA,OAAO,EAAE,MAAMG,EAAcb,GAAQS,CAAc,EAAE;AAAA,EAAA,CACxD,GAEK,CAACS,GAAYC,CAAU,IAAIH,KAAe,CAAA,GAE1CI,IAAoBC,EAA2BrB,GAAQmB,GAAYjB,CAAI;AAEzE,MAAAoB,EAAWZ,CAAE;AACb,WAAAa,EAA0BZ,GAAaX,GAAQC,GAAKE,GAAaC,GAAQF,CAAI,GACtE;AAGX,EAAIkB,KACAI,EAAYxB,GAAQ;AAAA,IAChB,IAAImB;AAAA,EAAA,CACP;AAGL,QAAMM,IAAQC,EAAaR,KAAe,CAAY,CAAA,GAEhDS,KAAOC,IAAA5B,EAAO,cAAP,gBAAA4B,EAAkB,MAAM;AACrC,MAAI,CAACD;AACD;AAIE,QAAAE,IAAOC,EAAY9B,GAAQ2B,CAAI;AAGjC,SAACzB,KAAA,QAAAA,EAAM,WACAA,IAAAD,IAGX8B;AAAA,IACI/B;AAAA,IACA;AAAA,MACI,GAAGyB;AAAA,MACH,KAAAxB;AAAA,MACA,QAAAG;AAAA,MACA,UAAU;AAAA,QACN;AAAA,UACI,GAAGyB;AAAA,UACH,MAAA3B;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,IACAI;AAAA,EAAA,GAEG;AACX;AAEA,SAASe,EAAyCrB,GAAwBmB,GAAmBjB,GAAe;AACxG,SAAOiB,MAAcjB,KAAA,gBAAAA,EAAM,WAAUA,MAAS8B,EAAgBhC,GAAQmB,CAAU;AACpF;AAEA,SAASI,EACLZ,GACAX,GACAC,GACAE,GACAC,GACAF,GACF;AACE,EAAIS,IACAsB,EAAajC,GAAQ;AAAA,IACjB,IAAIW,EAAY,CAAC;AAAA,EAAA,CACpB,IAEDsB,EAAajC,GAAQ;AAAA,IACjB,OAAO;AAAA,EAAA,CACV,GAGLkC,EAAWlC,GAAQ;AAAA,IACf,KAAAC;AAAA,IACA,aAAAE;AAAA,IACA,QAAAC;AAAA,EAAA,CACH,GAED+B,EAAiBnC,GAAQ,EAAE,KAAAC,GAAK,QAAAG,GAAQ,MAAAF,EAAM,CAAA;AAClD;AAEA,SAASa,EACLd,GACAD,GACAW,GACAP,GACAD,GACAD,GACF;;AACE,GACID,QAAQ2B,IAAAjB,EAAY,CAAC,MAAb,gBAAAiB,EAAgB,QACxBxB,QAAWgC,IAAAzB,EAAY,CAAC,MAAb,gBAAAyB,EAAgB,WAC3BjC,QAAgBkC,IAAA1B,EAAY,CAAC,MAAb,gBAAA0B,EAAgB,iBAEhCC;AAAA,IACItC;AAAA,IACA,EAAE,KAAAC,GAAK,QAAAG,GAAQ,aAAAD,EAAY;AAAA,IAC3B;AAAA,MACI,IAAIQ,EAAY,CAAC;AAAA,IACrB;AAAA,EAAA,GAIRwB,EAAiBnC,GAAQ,EAAE,KAAAC,GAAK,MAAAC,GAAM,QAAAE,EAAQ,CAAA;AAClD;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upsertButtonText.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n PlateEditor,\n TText,\n Value,\n getAboveNode,\n getEditorString,\n getPluginType,\n replaceNodeChildren,\n} from '@udecode/plate';\nimport { ELEMENT_BUTTON, TButtonElement } from '..';\nimport { UpsertButtonOptions } from './upsertButton';\n\n/**\n * If the text is different than the button above text, replace button children by a new text.\n * The new text has the same marks than the first text replaced.\n */\nexport const upsertButtonText = <V extends Value>(editor: PlateEditor<V>, { text }: UpsertButtonOptions<V>) => {\n const newButton = getAboveNode<TButtonElement>(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (newButton) {\n const [newButtonNode, newButtonPath] = newButton;\n\n if (text?.length && text !== getEditorString(editor, newButtonPath)) {\n const firstText = newButtonNode.children[0];\n\n // remove button children\n replaceNodeChildren<TText>(editor, {\n at: newButtonPath,\n nodes: { ...firstText, text },\n insertOptions: {\n select: true,\n },\n });\n }\n }\n};\n"],"names":["upsertButtonText","editor","text","newButton","getAboveNode","getPluginType","ELEMENT_BUTTON","newButtonNode","newButtonPath","getEditorString","firstText","replaceNodeChildren"],"mappings":";;AAkBO,MAAMA,IAAmB,CAAkBC,GAAwB,EAAE,MAAAC,QAAmC;AACrG,QAAAC,IAAYC,EAA6BH,GAAQ;AAAA,IACnD,OAAO,EAAE,MAAMI,EAAcJ,GAAQK,CAAc,EAAE;AAAA,EAAA,CACxD;AAED,MAAIH,GAAW;AACL,UAAA,CAACI,GAAeC,CAAa,IAAIL;AAEvC,QAAID,KAAA,QAAAA,EAAM,UAAUA,MAASO,EAAgBR,GAAQO,CAAa,GAAG;AAC3D,YAAAE,IAAYH,EAAc,SAAS,CAAC;AAG1C,MAAAI,EAA2BV,GAAQ;AAAA,QAC/B,IAAIO;AAAA,QACJ,OAAO,EAAE,GAAGE,GAAW,MAAAR,EAAK;AAAA,QAC5B,eAAe;AAAA,UACX,QAAQ;AAAA,QACZ;AAAA,MAAA,CACH;AAAA;AAAA;
|
|
1
|
+
{"version":3,"file":"upsertButtonText.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n PlateEditor,\n TText,\n Value,\n getAboveNode,\n getEditorString,\n getPluginType,\n replaceNodeChildren,\n} from '@udecode/plate';\nimport { ELEMENT_BUTTON, TButtonElement } from '..';\nimport { UpsertButtonOptions } from './upsertButton';\n\n/**\n * If the text is different than the button above text, replace button children by a new text.\n * The new text has the same marks than the first text replaced.\n */\nexport const upsertButtonText = <V extends Value>(editor: PlateEditor<V>, { text }: UpsertButtonOptions<V>) => {\n const newButton = getAboveNode<TButtonElement>(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (newButton) {\n const [newButtonNode, newButtonPath] = newButton;\n\n if (text?.length && text !== getEditorString(editor, newButtonPath)) {\n const firstText = newButtonNode.children[0];\n\n // remove button children\n replaceNodeChildren<TText>(editor, {\n at: newButtonPath,\n nodes: { ...firstText, text },\n insertOptions: {\n select: true,\n },\n });\n }\n }\n};\n"],"names":["upsertButtonText","editor","text","newButton","getAboveNode","getPluginType","ELEMENT_BUTTON","newButtonNode","newButtonPath","getEditorString","firstText","replaceNodeChildren"],"mappings":";;AAkBO,MAAMA,IAAmB,CAAkBC,GAAwB,EAAE,MAAAC,QAAmC;AACrG,QAAAC,IAAYC,EAA6BH,GAAQ;AAAA,IACnD,OAAO,EAAE,MAAMI,EAAcJ,GAAQK,CAAc,EAAE;AAAA,EAAA,CACxD;AAED,MAAIH,GAAW;AACL,UAAA,CAACI,GAAeC,CAAa,IAAIL;AAEvC,QAAID,KAAA,QAAAA,EAAM,UAAUA,MAASO,EAAgBR,GAAQO,CAAa,GAAG;AAC3D,YAAAE,IAAYH,EAAc,SAAS,CAAC;AAG1C,MAAAI,EAA2BV,GAAQ;AAAA,QAC/B,IAAIO;AAAA,QACJ,OAAO,EAAE,GAAGE,GAAW,MAAAR,EAAK;AAAA,QAC5B,eAAe;AAAA,UACX,QAAQ;AAAA,QACZ;AAAA,MAAA,CACH;AAAA,IACL;AAAA,EACJ;AACJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, WrapNodesOptions, getPluginType, wrapNodes } from '@udecode/plate';\nimport { ELEMENT_BUTTON, RichTextButtonStyle, TButtonElement } from '..';\n\nexport interface WrapButtonOptions<V extends Value = Value> extends WrapNodesOptions<V> {\n url: string;\n buttonStyle?: RichTextButtonStyle;\n target?: string;\n}\n\n/**\n * Wrap a button node with split.\n */\nexport const wrapButton = <V extends Value>(\n editor: PlateEditor<V>,\n { url, buttonStyle, target, ...options }: WrapButtonOptions<V
|
|
1
|
+
{"version":3,"file":"wrapButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, WrapNodesOptions, getPluginType, wrapNodes } from '@udecode/plate';\nimport { ELEMENT_BUTTON, RichTextButtonStyle, TButtonElement } from '..';\n\nexport interface WrapButtonOptions<V extends Value = Value> extends WrapNodesOptions<V> {\n url: string;\n buttonStyle?: RichTextButtonStyle;\n target?: string;\n}\n\n/**\n * Wrap a button node with split.\n */\nexport const wrapButton = <V extends Value>(\n editor: PlateEditor<V>,\n { url, buttonStyle, target, ...options }: WrapButtonOptions<V>,\n) => {\n wrapNodes<TButtonElement, Value>(\n editor,\n {\n type: getPluginType(editor, ELEMENT_BUTTON),\n url,\n buttonStyle,\n target,\n children: [],\n },\n { split: true, ...options } as WrapNodesOptions,\n );\n};\n"],"names":["wrapButton","editor","url","buttonStyle","target","options","wrapNodes","getPluginType","ELEMENT_BUTTON"],"mappings":";;AAca,MAAAA,IAAa,CACtBC,GACA,EAAE,KAAAC,GAAK,aAAAC,GAAa,QAAAC,GAAQ,GAAGC,QAC9B;AACD,EAAAC;AAAA,IACIL;AAAA,IACA;AAAA,MACI,MAAMM,EAAcN,GAAQO,CAAc;AAAA,MAC1C,KAAAN;AAAA,MACA,aAAAC;AAAA,MACA,QAAAC;AAAA,MACA,UAAU,CAAC;AAAA,IACf;AAAA,IACA,EAAE,OAAO,IAAM,GAAGC,EAAQ;AAAA,EAAA;AAElC;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createButtonNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, TText, Value, getPluginType } from '@udecode/plate';\nimport { RichTextButtonStyle, TButtonElement } from '..';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nexport interface CreateButtonNodeOptions {\n url: string;\n text?: string;\n buttonStyle?: RichTextButtonStyle;\n target?: string;\n children?: TText[];\n}\n\nexport const createButtonNode = <V extends Value>(\n editor: PlateEditor<V>,\n { url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions
|
|
1
|
+
{"version":3,"file":"createButtonNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, TText, Value, getPluginType } from '@udecode/plate';\nimport { RichTextButtonStyle, TButtonElement } from '..';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nexport interface CreateButtonNodeOptions {\n url: string;\n text?: string;\n buttonStyle?: RichTextButtonStyle;\n target?: string;\n children?: TText[];\n}\n\nexport const createButtonNode = <V extends Value>(\n editor: PlateEditor<V>,\n { url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions,\n): TButtonElement => {\n const type = getPluginType(editor, ELEMENT_BUTTON);\n\n return {\n type,\n url,\n target,\n buttonStyle,\n children: children ?? [{ text }],\n };\n};\n"],"names":["createButtonNode","editor","url","text","buttonStyle","target","children","getPluginType","ELEMENT_BUTTON"],"mappings":";;AAca,MAAAA,IAAmB,CAC5BC,GACA,EAAE,KAAAC,GAAK,MAAAC,IAAO,IAAI,aAAAC,IAAc,WAAW,QAAAC,GAAQ,UAAAC,SAI5C;AAAA,EACH,MAHSC,EAAcN,GAAQO,CAAc;AAAA,EAI7C,KAAAN;AAAA,EACA,QAAAG;AAAA,EACA,aAAAD;AAAA,EACA,UAAUE,KAAY,CAAC,EAAE,MAAAH,GAAM;AAAA;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggerFloatingButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value } from '@udecode/plate';\nimport { floatingButtonSelectors } from '../components';\nimport { triggerFloatingButtonEdit, triggerFloatingButtonInsert } from '.';\n\nexport const triggerFloatingButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {}
|
|
1
|
+
{"version":3,"file":"triggerFloatingButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value } from '@udecode/plate';\nimport { floatingButtonSelectors } from '../components';\nimport { triggerFloatingButtonEdit, triggerFloatingButtonInsert } from '.';\n\nexport const triggerFloatingButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode() === 'edit') {\n triggerFloatingButtonEdit(editor);\n return;\n }\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n};\n"],"names":["triggerFloatingButton","editor","focused","floatingButtonSelectors","triggerFloatingButtonEdit","triggerFloatingButtonInsert"],"mappings":";;;AAMa,MAAAA,IAAwB,CACjCC,GACA;AAAA,EACI,SAAAC;AACJ,IAEI,OACH;AACG,MAAAC,EAAwB,KAAK,MAAM,QAAQ;AAC3C,IAAAC,EAA0BH,CAAM;AAChC;AAAA,EACJ;AAEA,EAAAI,EAA4BJ,GAAQ;AAAA,IAChC,SAAAC;AAAA,EAAA,CACH;AACL;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggerFloatingButtonInsert.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, getEditorString, getPluginType, isRangeAcrossBlocks, someNode } from '@udecode/plate';\nimport { floatingButtonActions, floatingButtonSelectors } from '../components/FloatingButton/floatingButtonStore';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Trigger floating button.\n *\n * Do not trigger when:\n * - selection is across blocks\n * - selection has more than one leaf node\n * - lowest selection is not text\n * - selection has a button node\n */\nexport const triggerFloatingButtonInsert = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {}
|
|
1
|
+
{"version":3,"file":"triggerFloatingButtonInsert.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PlateEditor, Value, getEditorString, getPluginType, isRangeAcrossBlocks, someNode } from '@udecode/plate';\nimport { floatingButtonActions, floatingButtonSelectors } from '../components/FloatingButton/floatingButtonStore';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Trigger floating button.\n *\n * Do not trigger when:\n * - selection is across blocks\n * - selection has more than one leaf node\n * - lowest selection is not text\n * - selection has a button node\n */\nexport const triggerFloatingButtonInsert = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode()) {\n return;\n }\n\n if (!focused) {\n return;\n }\n\n if (isRangeAcrossBlocks(editor, { at: editor.selection })) {\n return;\n }\n\n const hasButton = someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (hasButton) {\n return;\n }\n\n floatingButtonActions.text(getEditorString(editor, editor.selection));\n floatingButtonActions.show('insert', editor.id);\n};\n"],"names":["triggerFloatingButtonInsert","editor","focused","floatingButtonSelectors","isRangeAcrossBlocks","someNode","getPluginType","ELEMENT_BUTTON","floatingButtonActions","getEditorString"],"mappings":";;;AAea,MAAAA,IAA8B,CACvCC,GACA;AAAA,EACI,SAAAC;AACJ,IAEI,OACH;AAgBD,EAfIC,EAAwB,UAIxB,CAACD,KAIDE,EAAoBH,GAAQ,EAAE,IAAIA,EAAO,UAAA,CAAW,KAItCI,EAASJ,GAAQ;AAAA,IAC/B,OAAO,EAAE,MAAMK,EAAcL,GAAQM,CAAc,EAAE;AAAA,EAAA,CACxD,MAKDC,EAAsB,KAAKC,EAAgBR,GAAQA,EAAO,SAAS,CAAC,GAC9CO,EAAA,KAAK,UAAUP,EAAO,EAAE;AAClD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withButton.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n AnyObject,\n EText,\n PlateEditor,\n Value,\n WithOverride,\n getAboveNode,\n getNextNodeStartPoint,\n getPluginType,\n getPreviousNodeEndPoint,\n insertNodes,\n isCollapsed,\n isEndPoint,\n isStartPoint,\n mockPlugin,\n select,\n withRemoveEmptyNodes,\n} from '@udecode/plate';\nimport { Path, Point, Range } from 'slate';\nimport { ELEMENT_BUTTON } from './createButtonPlugin';\n\n/**\n * Insert space after a url to wrap a button.\n * Lookup from the block start to the cursor to check if there is an url.\n * If not found, lookup before the cursor for a space character to check the url.\n *\n * On insert data:\n * Paste a string inside a button element will edit its children text but not its url.\n *\n */\n\nexport const withButton: WithOverride = (editor, { type }) => {\n const { apply, normalizeNode } = editor;\n\n editor.apply = (operation) => {\n if (operation.type !== 'set_selection') {\n apply(operation);\n return;\n }\n\n const range = operation.newProperties;\n if (!range?.focus || !range.anchor || !isCollapsed(range as Range)) {\n apply(operation);\n return;\n }\n\n const entry = getAboveNode(editor, {\n at: range as Range,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (entry) {\n const [, path] = entry;\n\n let newPoint: Point | undefined;\n\n if (isStartPoint(editor, range.focus, path)) {\n newPoint = getPreviousNodeEndPoint(editor, path);\n }\n\n if (isEndPoint(editor, range.focus, path)) {\n newPoint = getNextNodeStartPoint(editor, path);\n }\n\n if (newPoint) {\n operation.newProperties = {\n anchor: newPoint,\n focus: newPoint,\n };\n }\n }\n\n apply(operation);\n };\n\n editor.normalizeNode = ([node, path]) => {\n if (node.type === getPluginType(editor, ELEMENT_BUTTON)) {\n const range = editor.selection as Range | null;\n\n if (range && isCollapsed(range) && isEndPoint(editor, range.focus, path)) {\n const nextPoint = getNextNodeStartPoint(editor, path);\n\n // select next text node if any\n if (nextPoint) {\n select(editor, nextPoint);\n } else {\n // insert text node then select\n const nextPath = Path.next(path);\n insertNodes(editor, { text: '' } as EText<Value>, { at: nextPath });\n select(editor, nextPath);\n }\n }\n }\n\n normalizeNode([node, path]);\n };\n\n return withRemoveEmptyNodes<Value, PlateEditor<Value>>(\n editor,\n mockPlugin<AnyObject, Value, PlateEditor<Value>>({\n options: { types: type },\n })
|
|
1
|
+
{"version":3,"file":"withButton.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n AnyObject,\n EText,\n PlateEditor,\n Value,\n WithOverride,\n getAboveNode,\n getNextNodeStartPoint,\n getPluginType,\n getPreviousNodeEndPoint,\n insertNodes,\n isCollapsed,\n isEndPoint,\n isStartPoint,\n mockPlugin,\n select,\n withRemoveEmptyNodes,\n} from '@udecode/plate';\nimport { Path, Point, Range } from 'slate';\nimport { ELEMENT_BUTTON } from './createButtonPlugin';\n\n/**\n * Insert space after a url to wrap a button.\n * Lookup from the block start to the cursor to check if there is an url.\n * If not found, lookup before the cursor for a space character to check the url.\n *\n * On insert data:\n * Paste a string inside a button element will edit its children text but not its url.\n *\n */\n\nexport const withButton: WithOverride = (editor, { type }) => {\n const { apply, normalizeNode } = editor;\n\n editor.apply = (operation) => {\n if (operation.type !== 'set_selection') {\n apply(operation);\n return;\n }\n\n const range = operation.newProperties;\n if (!range?.focus || !range.anchor || !isCollapsed(range as Range)) {\n apply(operation);\n return;\n }\n\n const entry = getAboveNode(editor, {\n at: range as Range,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (entry) {\n const [, path] = entry;\n\n let newPoint: Point | undefined;\n\n if (isStartPoint(editor, range.focus, path)) {\n newPoint = getPreviousNodeEndPoint(editor, path);\n }\n\n if (isEndPoint(editor, range.focus, path)) {\n newPoint = getNextNodeStartPoint(editor, path);\n }\n\n if (newPoint) {\n operation.newProperties = {\n anchor: newPoint,\n focus: newPoint,\n };\n }\n }\n\n apply(operation);\n };\n\n editor.normalizeNode = ([node, path]) => {\n if (node.type === getPluginType(editor, ELEMENT_BUTTON)) {\n const range = editor.selection as Range | null;\n\n if (range && isCollapsed(range) && isEndPoint(editor, range.focus, path)) {\n const nextPoint = getNextNodeStartPoint(editor, path);\n\n // select next text node if any\n if (nextPoint) {\n select(editor, nextPoint);\n } else {\n // insert text node then select\n const nextPath = Path.next(path);\n insertNodes(editor, { text: '' } as EText<Value>, { at: nextPath });\n select(editor, nextPath);\n }\n }\n }\n\n normalizeNode([node, path]);\n };\n\n return withRemoveEmptyNodes<Value, PlateEditor<Value>>(\n editor,\n mockPlugin<AnyObject, Value, PlateEditor<Value>>({\n options: { types: type },\n }),\n );\n};\n"],"names":["withButton","editor","type","apply","normalizeNode","operation","range","isCollapsed","entry","getAboveNode","getPluginType","ELEMENT_BUTTON","path","newPoint","isStartPoint","getPreviousNodeEndPoint","isEndPoint","getNextNodeStartPoint","node","nextPoint","select","nextPath","Path","insertNodes","withRemoveEmptyNodes","mockPlugin"],"mappings":";;;AAiCO,MAAMA,IAA2B,CAACC,GAAQ,EAAE,MAAAC,QAAW;AACpD,QAAA,EAAE,OAAAC,GAAO,eAAAC,EAAkB,IAAAH;AAE1B,SAAAA,EAAA,QAAQ,CAACI,MAAc;AACtB,QAAAA,EAAU,SAAS,iBAAiB;AACpC,MAAAF,EAAME,CAAS;AACf;AAAA,IACJ;AAEA,UAAMC,IAAQD,EAAU;AACpB,QAAA,EAACC,KAAA,QAAAA,EAAO,UAAS,CAACA,EAAM,UAAU,CAACC,EAAYD,CAAc,GAAG;AAChE,MAAAH,EAAME,CAAS;AACf;AAAA,IACJ;AAEM,UAAAG,IAAQC,EAAaR,GAAQ;AAAA,MAC/B,IAAIK;AAAA,MACJ,OAAO,EAAE,MAAMI,EAAcT,GAAQU,CAAc,EAAE;AAAA,IAAA,CACxD;AAED,QAAIH,GAAO;AACD,YAAA,CAAG,EAAAI,CAAI,IAAIJ;AAEb,UAAAK;AAEJ,MAAIC,EAAab,GAAQK,EAAM,OAAOM,CAAI,MAC3BC,IAAAE,EAAwBd,GAAQW,CAAI,IAG/CI,EAAWf,GAAQK,EAAM,OAAOM,CAAI,MACzBC,IAAAI,EAAsBhB,GAAQW,CAAI,IAG7CC,MACAR,EAAU,gBAAgB;AAAA,QACtB,QAAQQ;AAAA,QACR,OAAOA;AAAA,MAAA;AAAA,IAGnB;AAEA,IAAAV,EAAME,CAAS;AAAA,EAAA,GAGnBJ,EAAO,gBAAgB,CAAC,CAACiB,GAAMN,CAAI,MAAM;AACrC,QAAIM,EAAK,SAASR,EAAcT,GAAQU,CAAc,GAAG;AACrD,YAAML,IAAQL,EAAO;AAEjB,UAAAK,KAASC,EAAYD,CAAK,KAAKU,EAAWf,GAAQK,EAAM,OAAOM,CAAI,GAAG;AAChE,cAAAO,IAAYF,EAAsBhB,GAAQW,CAAI;AAGpD,YAAIO;AACA,UAAAC,EAAOnB,GAAQkB,CAAS;AAAA,aACrB;AAEG,gBAAAE,IAAWC,EAAK,KAAKV,CAAI;AACnB,UAAAW,EAAAtB,GAAQ,EAAE,MAAM,MAAsB,EAAE,IAAIoB,GAAU,GAClED,EAAOnB,GAAQoB,CAAQ;AAAA,QAC3B;AAAA,MACJ;AAAA,IACJ;AAEc,IAAAjB,EAAA,CAACc,GAAMN,CAAI,CAAC;AAAA,EAAA,GAGvBY;AAAA,IACHvB;AAAA,IACAwB,EAAiD;AAAA,MAC7C,SAAS,EAAE,OAAOvB,EAAK;AAAA,IAAA,CAC1B;AAAA,EAAA;AAET;"}
|
package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useFloatingLinkSelectors as
|
|
1
|
+
import { jsxs as s, Fragment as m, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useFloatingLinkSelectors as l } from "@udecode/plate";
|
|
3
3
|
import { FloatingLink as i } from "./FloatingLink.es.js";
|
|
4
|
-
import { InsertLinkModal as
|
|
5
|
-
import { EditModal as
|
|
6
|
-
const
|
|
7
|
-
const r =
|
|
4
|
+
import { InsertLinkModal as d } from "./InsertLinkModal/InsertLinkModal.es.js";
|
|
5
|
+
import { EditModal as c } from "./EditLinkModal/EditModal.es.js";
|
|
6
|
+
const k = ({ readOnly: n }) => {
|
|
7
|
+
const r = l().isEditing();
|
|
8
8
|
if (n)
|
|
9
9
|
return null;
|
|
10
|
-
const o = /* @__PURE__ */ t
|
|
11
|
-
return /* @__PURE__ */
|
|
12
|
-
/* @__PURE__ */ t
|
|
13
|
-
/* @__PURE__ */ t
|
|
10
|
+
const o = /* @__PURE__ */ t(d, {}), e = r ? o : /* @__PURE__ */ t(c, {});
|
|
11
|
+
return /* @__PURE__ */ s(m, { children: [
|
|
12
|
+
/* @__PURE__ */ t(i.InsertRoot, { children: o }),
|
|
13
|
+
/* @__PURE__ */ t(i.EditRoot, { children: e })
|
|
14
14
|
] });
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
k as CustomFloatingLink
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=CustomFloatingLink.es.js.map
|
package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TEditableProps, useFloatingLinkSelectors } from '@udecode/plate';\n\nimport { EditModal } from './EditLinkModal';\nimport { FloatingLink } from './FloatingLink';\nimport { InsertLinkModal } from './InsertLinkModal/InsertLinkModal';\n\nexport const CustomFloatingLink = ({ readOnly }: TEditableProps) => {\n const isEditing = useFloatingLinkSelectors().isEditing();\n\n if (readOnly) {\n return null;\n }\n\n const input = <InsertLinkModal />;\n const editContent = isEditing ? input : <EditModal />;\n\n return (\n <>\n <FloatingLink.InsertRoot>{input}</FloatingLink.InsertRoot>\n\n <FloatingLink.EditRoot>{editContent}</FloatingLink.EditRoot>\n </>\n );\n};\n"],"names":["CustomFloatingLink","readOnly","isEditing","useFloatingLinkSelectors","input","InsertLinkModal","editContent","jsx","EditModal","jsxs","Fragment","FloatingLink"],"mappings":";;;;;AAQO,MAAMA,IAAqB,CAAC,EAAE,UAAAC,QAA+B;AAC1D,QAAAC,IAAYC,IAA2B;AAE7C,MAAIF;AACO,WAAA;AAGL,QAAAG,
|
|
1
|
+
{"version":3,"file":"CustomFloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TEditableProps, useFloatingLinkSelectors } from '@udecode/plate';\n\nimport { EditModal } from './EditLinkModal';\nimport { FloatingLink } from './FloatingLink';\nimport { InsertLinkModal } from './InsertLinkModal/InsertLinkModal';\n\nexport const CustomFloatingLink = ({ readOnly }: TEditableProps) => {\n const isEditing = useFloatingLinkSelectors().isEditing();\n\n if (readOnly) {\n return null;\n }\n\n const input = <InsertLinkModal />;\n const editContent = isEditing ? input : <EditModal />;\n\n return (\n <>\n <FloatingLink.InsertRoot>{input}</FloatingLink.InsertRoot>\n\n <FloatingLink.EditRoot>{editContent}</FloatingLink.EditRoot>\n </>\n );\n};\n"],"names":["CustomFloatingLink","readOnly","isEditing","useFloatingLinkSelectors","input","InsertLinkModal","editContent","jsx","EditModal","jsxs","Fragment","FloatingLink"],"mappings":";;;;;AAQO,MAAMA,IAAqB,CAAC,EAAE,UAAAC,QAA+B;AAC1D,QAAAC,IAAYC,IAA2B;AAE7C,MAAIF;AACO,WAAA;AAGL,QAAAG,sBAASC,GAAgB,CAAA,CAAA,GACzBC,IAAcJ,IAAYE,IAAQ,gBAAAG,EAACC,GAAU,CAAA,CAAA;AAEnD,SAEQ,gBAAAC,EAAAC,GAAA,EAAA,UAAA;AAAA,IAAC,gBAAAH,EAAAI,EAAa,YAAb,EAAyB,UAAMP,EAAA,CAAA;AAAA,IAE/B,gBAAAG,EAAAI,EAAa,UAAb,EAAuB,UAAYL,EAAA,CAAA;AAAA,EACxC,EAAA,CAAA;AAER;"}
|
package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IconPen16 as
|
|
3
|
-
import { useFloatingLinkUrlInput as
|
|
4
|
-
import { FloatingLink as
|
|
5
|
-
import { BlockStyles as
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
return /* @__PURE__ */ t
|
|
9
|
-
/* @__PURE__ */ t
|
|
10
|
-
/* @__PURE__ */
|
|
11
|
-
/* @__PURE__ */ t
|
|
1
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { IconPen16 as i, IconTrashBin16 as r } from "@frontify/fondue";
|
|
3
|
+
import { useFloatingLinkUrlInput as a } from "@udecode/plate";
|
|
4
|
+
import { FloatingLink as e } from "../FloatingLink.es.js";
|
|
5
|
+
import { BlockStyles as l } from "../../../styles.es.js";
|
|
6
|
+
const m = () => {
|
|
7
|
+
const o = a({});
|
|
8
|
+
return /* @__PURE__ */ t("div", { "data-test-id": "floating-link-edit", className: "tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]", children: /* @__PURE__ */ n("span", { "data-test-id": "preview-link-flyout", className: "tw-flex tw-justify-between", children: [
|
|
9
|
+
/* @__PURE__ */ t("span", { className: "tw-pointer-events-none", style: l.p, children: o.defaultValue }),
|
|
10
|
+
/* @__PURE__ */ n("span", { className: "tw-flex tw-gap-2", children: [
|
|
11
|
+
/* @__PURE__ */ t(
|
|
12
12
|
"span",
|
|
13
13
|
{
|
|
14
14
|
role: "button",
|
|
15
15
|
tabIndex: 0,
|
|
16
16
|
"data-test-id": "edit-link-button",
|
|
17
17
|
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
18
|
-
children: /* @__PURE__ */ t
|
|
18
|
+
children: /* @__PURE__ */ t(e.EditButton, { children: /* @__PURE__ */ t(i, {}) })
|
|
19
19
|
}
|
|
20
20
|
),
|
|
21
|
-
/* @__PURE__ */ t
|
|
21
|
+
/* @__PURE__ */ t(
|
|
22
22
|
"span",
|
|
23
23
|
{
|
|
24
24
|
role: "button",
|
|
25
25
|
tabIndex: 0,
|
|
26
26
|
"data-test-id": "remove-link-button",
|
|
27
27
|
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
28
|
-
children: /* @__PURE__ */ t
|
|
28
|
+
children: /* @__PURE__ */ t(e.UnlinkButton, { children: /* @__PURE__ */ t(r, {}) })
|
|
29
29
|
}
|
|
30
30
|
)
|
|
31
31
|
] })
|
|
32
32
|
] }) });
|
|
33
33
|
};
|
|
34
34
|
export {
|
|
35
|
-
|
|
35
|
+
m as EditModal
|
|
36
36
|
};
|
|
37
37
|
//# sourceMappingURL=EditModal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen16, IconTrashBin16 } from '@frontify/fondue';\nimport { useFloatingLinkUrlInput } from '@udecode/plate';\nimport { FloatingLink } from '../FloatingLink';\nimport { BlockStyles } from '../../../styles';\n\nexport const EditModal = () => {\n const urlHtmlProps = useFloatingLinkUrlInput({});\n\n return (\n <div data-test-id=\"floating-link-edit\" className=\"tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]\">\n <span data-test-id={'preview-link-flyout'} className=\"tw-flex tw-justify-between\">\n <span className=\"tw-pointer-events-none\" style={BlockStyles.p}>\n {urlHtmlProps.defaultValue}\n </span>\n <span className=\"tw-flex tw-gap-2\">\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'edit-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.EditButton>\n <IconPen16 />\n </FloatingLink.EditButton>\n </span>\n\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'remove-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.UnlinkButton>\n <IconTrashBin16 />\n </FloatingLink.UnlinkButton>\n </span>\n </span>\n </span>\n </div>\n );\n};\n"],"names":["EditModal","urlHtmlProps","useFloatingLinkUrlInput","jsx","jsxs","BlockStyles","FloatingLink","IconPen16","IconTrashBin16"],"mappings":";;;;;AAOO,MAAMA,IAAY,MAAM;AACrB,QAAAC,IAAeC,EAAwB,CAAA,CAAE;AAG3C,
|
|
1
|
+
{"version":3,"file":"EditModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen16, IconTrashBin16 } from '@frontify/fondue';\nimport { useFloatingLinkUrlInput } from '@udecode/plate';\nimport { FloatingLink } from '../FloatingLink';\nimport { BlockStyles } from '../../../styles';\n\nexport const EditModal = () => {\n const urlHtmlProps = useFloatingLinkUrlInput({});\n\n return (\n <div data-test-id=\"floating-link-edit\" className=\"tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]\">\n <span data-test-id={'preview-link-flyout'} className=\"tw-flex tw-justify-between\">\n <span className=\"tw-pointer-events-none\" style={BlockStyles.p}>\n {urlHtmlProps.defaultValue}\n </span>\n <span className=\"tw-flex tw-gap-2\">\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'edit-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.EditButton>\n <IconPen16 />\n </FloatingLink.EditButton>\n </span>\n\n <span\n role=\"button\"\n tabIndex={0}\n data-test-id={'remove-link-button'}\n className=\"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1\"\n >\n <FloatingLink.UnlinkButton>\n <IconTrashBin16 />\n </FloatingLink.UnlinkButton>\n </span>\n </span>\n </span>\n </div>\n );\n};\n"],"names":["EditModal","urlHtmlProps","useFloatingLinkUrlInput","jsx","jsxs","BlockStyles","FloatingLink","IconPen16","IconTrashBin16"],"mappings":";;;;;AAOO,MAAMA,IAAY,MAAM;AACrB,QAAAC,IAAeC,EAAwB,CAAA,CAAE;AAG3C,SAAA,gBAAAC,EAAC,OAAI,EAAA,gBAAa,sBAAqB,WAAU,4DAC7C,UAAA,gBAAAC,EAAC,QAAK,EAAA,gBAAc,uBAAuB,WAAU,8BACjD,UAAA;AAAA,IAAA,gBAAAD,EAAC,UAAK,WAAU,0BAAyB,OAAOE,EAAY,GACvD,YAAa,aAClB,CAAA;AAAA,IACA,gBAAAD,EAAC,QAAK,EAAA,WAAU,oBACZ,UAAA;AAAA,MAAA,gBAAAD;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,UAAU;AAAA,UACV,gBAAc;AAAA,UACd,WAAU;AAAA,UAEV,4BAACG,EAAa,YAAb,EACG,UAAA,gBAAAH,EAACI,IAAU,CAAA,GACf;AAAA,QAAA;AAAA,MACJ;AAAA,MAEA,gBAAAJ;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,MAAK;AAAA,UACL,UAAU;AAAA,UACV,gBAAc;AAAA,UACd,WAAU;AAAA,UAEV,4BAACG,EAAa,cAAb,EACG,UAAA,gBAAAH,EAACK,IAAe,CAAA,GACpB;AAAA,QAAA;AAAA,MACJ;AAAA,IAAA,GACJ;AAAA,EAAA,EACJ,CAAA,EACJ,CAAA;AAER;"}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { useEditorRef as
|
|
2
|
-
import {
|
|
3
|
-
import { getUrlFromEditor as
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
match: { type: d(
|
|
1
|
+
import { useEditorRef as y, usePlateSelectors as F, useFloatingLinkSelectors as l, getPluginOptions as h, ELEMENT_LINK as n, getAboveNode as C, getPluginType as d, getRangeBoundingClientRect as R, getStartPoint as P, getEndPoint as b, getDefaultBoundingClientRect as N, useVirtualFloatingLink as O, floatingLinkActions as o, someNode as S, floatingLinkSelectors as c, useHotkeys as B, triggerFloatingLinkEdit as I, useFloatingLinkEnter as v, useFloatingLinkEscape as x, useComposedRef as A } from "@udecode/plate";
|
|
2
|
+
import { useCallback as D, useEffect as H } from "react";
|
|
3
|
+
import { getUrlFromEditor as T } from "../../utils/getUrl.es.js";
|
|
4
|
+
const M = ({ floatingOptions: g, ...i }) => {
|
|
5
|
+
const e = y(), u = F().keyEditor(), a = l().mode(), f = l().isOpen(e.id), { triggerFloatingLinkHotkeys: m = "command+k, ctrl+k" } = h(e, n), k = D(() => {
|
|
6
|
+
const t = C(e, {
|
|
7
|
+
match: { type: d(e, n) }
|
|
8
8
|
});
|
|
9
|
-
if (
|
|
10
|
-
const [, s] =
|
|
11
|
-
return
|
|
12
|
-
anchor:
|
|
13
|
-
focus:
|
|
9
|
+
if (t) {
|
|
10
|
+
const [, s] = t;
|
|
11
|
+
return R(e, {
|
|
12
|
+
anchor: P(e, s),
|
|
13
|
+
focus: b(e, s)
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
return
|
|
17
|
-
}, [
|
|
18
|
-
editorId:
|
|
19
|
-
open:
|
|
20
|
-
getBoundingClientRect:
|
|
16
|
+
return N();
|
|
17
|
+
}, [e]), p = f && a === "edit", { update: r, style: E, floating: L } = O({
|
|
18
|
+
editorId: e.id,
|
|
19
|
+
open: p,
|
|
20
|
+
getBoundingClientRect: k,
|
|
21
21
|
...g
|
|
22
22
|
});
|
|
23
|
-
return
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
match: { type: d(
|
|
23
|
+
return H(() => {
|
|
24
|
+
const t = T(e);
|
|
25
|
+
if (t && o.url(t), e.selection && S(e, {
|
|
26
|
+
match: { type: d(e, n) }
|
|
27
27
|
})) {
|
|
28
|
-
o.show("edit",
|
|
28
|
+
o.show("edit", e.id), r();
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
c.mode() === "edit" && o.hide();
|
|
32
|
-
}, [
|
|
33
|
-
|
|
34
|
-
(
|
|
35
|
-
|
|
32
|
+
}, [e, u, r]), B(
|
|
33
|
+
m,
|
|
34
|
+
(t) => {
|
|
35
|
+
t.preventDefault(), c.mode() === "edit" && I(e);
|
|
36
36
|
},
|
|
37
37
|
{
|
|
38
38
|
enableOnContentEditable: !0
|
|
39
39
|
},
|
|
40
40
|
[]
|
|
41
|
-
), v(),
|
|
41
|
+
), v(), x(), {
|
|
42
42
|
style: {
|
|
43
|
-
...
|
|
43
|
+
...E,
|
|
44
44
|
zIndex: 1e3
|
|
45
45
|
},
|
|
46
46
|
...i,
|
|
47
|
-
ref:
|
|
47
|
+
ref: A(i.ref, L)
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
50
|
export {
|
|
51
|
-
|
|
51
|
+
M as useFloatingLinkEdit
|
|
52
52
|
};
|
|
53
53
|
//# sourceMappingURL=useFloatingLinkEdit.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFloatingLinkEdit.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n LinkPlugin,\n floatingLinkActions,\n floatingLinkSelectors,\n getAboveNode,\n getDefaultBoundingClientRect,\n getEndPoint,\n getPluginOptions,\n getPluginType,\n getRangeBoundingClientRect,\n getStartPoint,\n someNode,\n triggerFloatingLinkEdit,\n useComposedRef,\n useEditorRef,\n useFloatingLinkEnter,\n useFloatingLinkEscape,\n useFloatingLinkSelectors,\n useHotkeys,\n usePlateSelectors,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { useCallback, useEffect } from 'react';\nimport { getUrlFromEditor } from '../../utils';\n\nexport const useFloatingLinkEdit = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const keyEditor = usePlateSelectors().keyEditor();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().isOpen(editor.id);\n\n const { triggerFloatingLinkHotkeys = 'command+k, ctrl+k' } = getPluginOptions<LinkPlugin>(editor, ELEMENT_LINK);\n\n const getBoundingClientRect = useCallback(() => {\n const entry = getAboveNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n });\n\n if (entry) {\n const [, path] = entry;\n return getRangeBoundingClientRect(editor, {\n anchor: getStartPoint(editor, path),\n focus: getEndPoint(editor, path),\n });\n }\n\n return getDefaultBoundingClientRect();\n }, [editor]);\n\n const isOpen = open && mode === 'edit';\n\n const { update, style, floating } = useVirtualFloatingLink({\n editorId: editor.id,\n open: isOpen,\n getBoundingClientRect,\n ...floatingOptions,\n });\n\n useEffect(() => {\n const url = getUrlFromEditor(editor);\n if (url) {\n floatingLinkActions.url(url);\n }\n\n if (\n editor.selection &&\n someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n })\n ) {\n floatingLinkActions.show('edit', editor.id);\n update();\n return;\n }\n\n if (floatingLinkSelectors.mode() === 'edit') {\n floatingLinkActions.hide();\n }\n }, [editor, keyEditor, update]);\n\n useHotkeys(\n triggerFloatingLinkHotkeys,\n (e) => {\n e.preventDefault();\n\n if (floatingLinkSelectors.mode() === 'edit') {\n triggerFloatingLinkEdit(editor);\n }\n },\n {\n enableOnContentEditable: true,\n },\n []
|
|
1
|
+
{"version":3,"file":"useFloatingLinkEdit.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_LINK,\n FloatingLinkProps,\n HTMLPropsAs,\n LinkPlugin,\n floatingLinkActions,\n floatingLinkSelectors,\n getAboveNode,\n getDefaultBoundingClientRect,\n getEndPoint,\n getPluginOptions,\n getPluginType,\n getRangeBoundingClientRect,\n getStartPoint,\n someNode,\n triggerFloatingLinkEdit,\n useComposedRef,\n useEditorRef,\n useFloatingLinkEnter,\n useFloatingLinkEscape,\n useFloatingLinkSelectors,\n useHotkeys,\n usePlateSelectors,\n useVirtualFloatingLink,\n} from '@udecode/plate';\nimport { useCallback, useEffect } from 'react';\nimport { getUrlFromEditor } from '../../utils';\n\nexport const useFloatingLinkEdit = ({ floatingOptions, ...props }: FloatingLinkProps): HTMLPropsAs<'div'> => {\n const editor = useEditorRef();\n const keyEditor = usePlateSelectors().keyEditor();\n const mode = useFloatingLinkSelectors().mode();\n const open = useFloatingLinkSelectors().isOpen(editor.id);\n\n const { triggerFloatingLinkHotkeys = 'command+k, ctrl+k' } = getPluginOptions<LinkPlugin>(editor, ELEMENT_LINK);\n\n const getBoundingClientRect = useCallback(() => {\n const entry = getAboveNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n });\n\n if (entry) {\n const [, path] = entry;\n return getRangeBoundingClientRect(editor, {\n anchor: getStartPoint(editor, path),\n focus: getEndPoint(editor, path),\n });\n }\n\n return getDefaultBoundingClientRect();\n }, [editor]);\n\n const isOpen = open && mode === 'edit';\n\n const { update, style, floating } = useVirtualFloatingLink({\n editorId: editor.id,\n open: isOpen,\n getBoundingClientRect,\n ...floatingOptions,\n });\n\n useEffect(() => {\n const url = getUrlFromEditor(editor);\n if (url) {\n floatingLinkActions.url(url);\n }\n\n if (\n editor.selection &&\n someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_LINK) },\n })\n ) {\n floatingLinkActions.show('edit', editor.id);\n update();\n return;\n }\n\n if (floatingLinkSelectors.mode() === 'edit') {\n floatingLinkActions.hide();\n }\n }, [editor, keyEditor, update]);\n\n useHotkeys(\n triggerFloatingLinkHotkeys,\n (e) => {\n e.preventDefault();\n\n if (floatingLinkSelectors.mode() === 'edit') {\n triggerFloatingLinkEdit(editor);\n }\n },\n {\n enableOnContentEditable: true,\n },\n [],\n );\n\n useFloatingLinkEnter();\n\n useFloatingLinkEscape();\n\n return {\n style: {\n ...style,\n zIndex: 1000,\n },\n ...props,\n ref: useComposedRef<HTMLElement | null>(props.ref, floating),\n };\n};\n"],"names":["useFloatingLinkEdit","floatingOptions","props","editor","useEditorRef","keyEditor","usePlateSelectors","mode","useFloatingLinkSelectors","open","triggerFloatingLinkHotkeys","getPluginOptions","ELEMENT_LINK","getBoundingClientRect","useCallback","entry","getAboveNode","getPluginType","path","getRangeBoundingClientRect","getStartPoint","getEndPoint","getDefaultBoundingClientRect","isOpen","update","style","floating","useVirtualFloatingLink","useEffect","url","getUrlFromEditor","floatingLinkActions","someNode","floatingLinkSelectors","useHotkeys","e","triggerFloatingLinkEdit","useFloatingLinkEnter","useFloatingLinkEscape","useComposedRef"],"mappings":";;;AA8BO,MAAMA,IAAsB,CAAC,EAAE,iBAAAC,GAAiB,GAAGC,QAAmD;AACzG,QAAMC,IAASC,KACTC,IAAYC,IAAoB,aAChCC,IAAOC,IAA2B,QAClCC,IAAOD,EAA2B,EAAA,OAAOL,EAAO,EAAE,GAElD,EAAE,4BAAAO,IAA6B,oBAAA,IAAwBC,EAA6BR,GAAQS,CAAY,GAExGC,IAAwBC,EAAY,MAAM;AACtC,UAAAC,IAAQC,EAAab,GAAQ;AAAA,MAC/B,OAAO,EAAE,MAAMc,EAAcd,GAAQS,CAAY,EAAE;AAAA,IAAA,CACtD;AAED,QAAIG,GAAO;AACD,YAAA,CAAG,EAAAG,CAAI,IAAIH;AACjB,aAAOI,EAA2BhB,GAAQ;AAAA,QACtC,QAAQiB,EAAcjB,GAAQe,CAAI;AAAA,QAClC,OAAOG,EAAYlB,GAAQe,CAAI;AAAA,MAAA,CAClC;AAAA,IACL;AAEA,WAAOI,EAA6B;AAAA,EAAA,GACrC,CAACnB,CAAM,CAAC,GAELoB,IAASd,KAAQF,MAAS,QAE1B,EAAE,QAAAiB,GAAQ,OAAAC,GAAO,UAAAC,EAAA,IAAaC,EAAuB;AAAA,IACvD,UAAUxB,EAAO;AAAA,IACjB,MAAMoB;AAAA,IACN,uBAAAV;AAAA,IACA,GAAGZ;AAAA,EAAA,CACN;AAED,SAAA2B,EAAU,MAAM;AACN,UAAAC,IAAMC,EAAiB3B,CAAM;AAM/B,QALA0B,KACAE,EAAoB,IAAIF,CAAG,GAI3B1B,EAAO,aACP6B,EAAS7B,GAAQ;AAAA,MACb,OAAO,EAAE,MAAMc,EAAcd,GAAQS,CAAY,EAAE;AAAA,IAAA,CACtD,GACH;AACsB,MAAAmB,EAAA,KAAK,QAAQ5B,EAAO,EAAE,GACnCqB;AACP;AAAA,IACJ;AAEI,IAAAS,EAAsB,KAAK,MAAM,UACjCF,EAAoB,KAAK;AAAA,EAE9B,GAAA,CAAC5B,GAAQE,GAAWmB,CAAM,CAAC,GAE9BU;AAAA,IACIxB;AAAA,IACA,CAACyB,MAAM;AACH,MAAAA,EAAE,eAAe,GAEbF,EAAsB,KAAK,MAAM,UACjCG,EAAwBjC,CAAM;AAAA,IAEtC;AAAA,IACA;AAAA,MACI,yBAAyB;AAAA,IAC7B;AAAA,IACA,CAAC;AAAA,EAAA,GAGgBkC,KAECC,KAEf;AAAA,IACH,OAAO;AAAA,MACH,GAAGb;AAAA,MACH,QAAQ;AAAA,IACZ;AAAA,IACA,GAAGvB;AAAA,IACH,KAAKqC,EAAmCrC,EAAM,KAAKwB,CAAQ;AAAA,EAAA;AAEnE;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { InsertModal as
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { InsertModal as t } from "./InsertModal.es.js";
|
|
3
3
|
import { useInsertModal as r } from "./useInsertModal.es.js";
|
|
4
|
-
const i = () => /* @__PURE__ */ t
|
|
4
|
+
const i = () => /* @__PURE__ */ o(t, { ...r(), testId: "floating-link-insert" });
|
|
5
5
|
export {
|
|
6
6
|
i as InsertLinkModal
|
|
7
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsertLinkModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertModal, useInsertModal } from '.';\n\nexport const InsertLinkModal = () => <InsertModal {...useInsertModal()} testId=\"floating-link-insert\" />;\n"],"names":["InsertLinkModal","jsx","InsertModal","useInsertModal"],"mappings":";;;AAIa,MAAAA,IAAkB,
|
|
1
|
+
{"version":3,"file":"InsertLinkModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertModal, useInsertModal } from '.';\n\nexport const InsertLinkModal = () => <InsertModal {...useInsertModal()} testId=\"floating-link-insert\" />;\n"],"names":["InsertLinkModal","jsx","InsertModal","useInsertModal"],"mappings":";;;AAIa,MAAAA,IAAkB,MAAO,gBAAAC,EAAAC,GAAA,EAAa,GAAGC,EAAe,GAAG,QAAO,uBAAuB,CAAA;"}
|