@frontify/guideline-blocks-settings 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.es.js +17 -0
- package/dist/components/Attachments/AttachmentItem.es.js +116 -168
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -1
- package/dist/components/Attachments/Attachments.es.js +145 -137
- package/dist/components/Attachments/Attachments.es.js.map +1 -1
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +25 -28
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +1 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +114 -126
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +53 -74
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +26 -31
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +22 -25
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +17 -28
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +25 -35
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +41 -34
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +41 -36
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +24 -33
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +20 -11
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +18 -10
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +10 -12
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +13 -13
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +21 -19
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +18 -25
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +18 -17
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +1 -1
- package/dist/components/BlockItemWrapper/constants.es.js +6 -6
- package/dist/components/BlockItemWrapper/constants.es.js.map +1 -1
- package/dist/components/Link/LinkInput.es.js +63 -63
- package/dist/components/Link/LinkInput.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/DocumentLink.es.js +46 -63
- package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js +50 -64
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/LinkSelector2.es.js +77 -0
- package/dist/components/Link/LinkSelector/LinkSelector2.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +10 -6
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/PageLink.es.js +53 -67
- package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/PageLinks.es.js +28 -37
- package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -1
- package/dist/components/Link/LinkSelector/SectionLink.es.js +31 -24
- package/dist/components/Link/LinkSelector/SectionLink.es.js.map +1 -1
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +6 -5
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +1 -1
- package/dist/components/Link/utils/getUrl.es.js +10 -12
- package/dist/components/Link/utils/getUrl.es.js.map +1 -1
- package/dist/components/Link/utils/relativeUrlRegex.es.js +6 -5
- package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -1
- package/dist/components/Link/utils/url.es.js +21 -17
- package/dist/components/Link/utils/url.es.js.map +1 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +61 -68
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +25 -22
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -1
- package/dist/components/RichTextEditor/constants.es.js +6 -5
- package/dist/components/RichTextEditor/constants.es.js.map +1 -1
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +30 -37
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +31 -39
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -11
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +19 -23
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +24 -26
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +46 -53
- 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 +52 -54
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +68 -68
- 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 +91 -103
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +26 -32
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +47 -53
- 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 +12 -18
- 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 +21 -25
- 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 +29 -37
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +13 -17
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +56 -62
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +9 -12
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +23 -24
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +28 -33
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +61 -80
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +23 -23
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +18 -18
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -12
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +9 -8
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +11 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +85 -84
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +13 -16
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +13 -16
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +10 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +45 -51
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js +20 -22
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js +12 -12
- package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +48 -57
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +46 -48
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +12 -8
- 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 +62 -71
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +76 -77
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +17 -21
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +17 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +11 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js +22 -26
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +6 -5
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -40
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +10 -10
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js +26 -26
- package/dist/components/RichTextEditor/plugins/OrderedListPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +44 -38
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +41 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +40 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +45 -41
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +40 -48
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js +29 -29
- package/dist/components/RichTextEditor/plugins/UnorderedListPlugin/index.es.js.map +1 -1
- package/dist/components/RichTextEditor/plugins/styles.es.js +167 -166
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -1
- package/dist/helpers/addHttps.es.js +12 -12
- package/dist/helpers/addHttps.es.js.map +1 -1
- package/dist/helpers/convertToRichTextValue.es.js +14 -6
- package/dist/helpers/convertToRichTextValue.es.js.map +1 -1
- package/dist/helpers/hasRichTextValue.es.js +13 -14
- package/dist/helpers/hasRichTextValue.es.js.map +1 -1
- package/dist/helpers/isDownloadable.es.js +6 -5
- package/dist/helpers/isDownloadable.es.js.map +1 -1
- package/dist/hooks/useAttachments.es.js +65 -73
- package/dist/hooks/useAttachments.es.js.map +1 -1
- package/dist/hooks/useIsInViewport.es.js +20 -21
- package/dist/hooks/useIsInViewport.es.js.map +1 -1
- package/dist/index.cjs.js +6 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.es.js +221 -213
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js +20 -21
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +62 -64
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +49 -52
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +58 -60
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/defaultValues.es.js +16 -19
- package/dist/settings/defaultValues.es.js.map +1 -1
- package/dist/settings/gutter.es.js +48 -52
- package/dist/settings/gutter.es.js.map +1 -1
- package/dist/settings/margin.es.js +49 -52
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +62 -64
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +49 -52
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +62 -64
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityDownloadable.es.js +16 -16
- package/dist/settings/securityDownloadable.es.js.map +1 -1
- package/dist/settings/securityGlobalControl.es.js +26 -32
- package/dist/settings/securityGlobalControl.es.js.map +1 -1
- package/dist/settings/types.es.js +41 -47
- package/dist/settings/types.es.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/utilities/color/getReadableColor.es.js +15 -13
- package/dist/utilities/color/getReadableColor.es.js.map +1 -1
- package/dist/utilities/color/isDark.es.js +14 -9
- package/dist/utilities/color/isDark.es.js.map +1 -1
- package/dist/utilities/color/setAlpha.es.js +7 -6
- package/dist/utilities/color/setAlpha.es.js.map +1 -1
- package/dist/utilities/color/toColorObject.es.js +14 -8
- package/dist/utilities/color/toColorObject.es.js.map +1 -1
- package/dist/utilities/color/toHex8String.es.js +7 -6
- package/dist/utilities/color/toHex8String.es.js.map +1 -1
- package/dist/utilities/color/toHexString.es.js +7 -6
- package/dist/utilities/color/toHexString.es.js.map +1 -1
- package/dist/utilities/color/toRgbaString.es.js +7 -6
- package/dist/utilities/color/toRgbaString.es.js.map +1 -1
- package/dist/utilities/color/toShortRgba.es.js +18 -11
- package/dist/utilities/color/toShortRgba.es.js.map +1 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js +7 -8
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
- package/dist/utilities/react/getBorderStyles.es.js +12 -11
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
- package/dist/utilities/react/getRadiusStyles.es.js +7 -8
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
- package/dist/utilities/react/joinClassNames.es.js +6 -5
- package/dist/utilities/react/joinClassNames.es.js.map +1 -1
- package/package.json +8 -10
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js
CHANGED
|
@@ -1,49 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
] })
|
|
44
|
-
] }) });
|
|
1
|
+
import { getUrlFromLinkOrLegacyLink as e } from "../../../../../Link/utils/getUrl.es.js";
|
|
2
|
+
import { LINK_PLUGIN as t } from "../../id.es.js";
|
|
3
|
+
import { BlockStyles as n } from "../../../styles.es.js";
|
|
4
|
+
import { IconPen as r, IconTrashBin as i } from "@frontify/fondue/icons";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
import { FloatingModalWrapper as s, useLinkOpenButtonState as c } from "@frontify/fondue/rte";
|
|
7
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx
|
|
8
|
+
var l = ({ editButtonProps: l, unlinkButtonProps: u }) => {
|
|
9
|
+
let { element: d } = c(), f = d ? e(d) : "";
|
|
10
|
+
return /* @__PURE__ */ a(s, {
|
|
11
|
+
"data-test-id": "floating-link-edit",
|
|
12
|
+
padding: "16px",
|
|
13
|
+
minWidth: "400px",
|
|
14
|
+
children: /* @__PURE__ */ o("span", {
|
|
15
|
+
"data-test-id": "preview-link-flyout",
|
|
16
|
+
className: "tw-flex tw-justify-between tw-items-center tw-gap-2",
|
|
17
|
+
children: [/* @__PURE__ */ a("a", {
|
|
18
|
+
"data-test-id": "floating-link-edit-url",
|
|
19
|
+
href: f,
|
|
20
|
+
target: "_blank",
|
|
21
|
+
rel: "noopener noreferrer",
|
|
22
|
+
style: n[t],
|
|
23
|
+
className: "tw-break-all",
|
|
24
|
+
children: f
|
|
25
|
+
}), /* @__PURE__ */ o("span", {
|
|
26
|
+
className: "tw-flex tw-gap-2",
|
|
27
|
+
children: [/* @__PURE__ */ a("button", {
|
|
28
|
+
tabIndex: 0,
|
|
29
|
+
"data-test-id": "edit-link-button",
|
|
30
|
+
className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
|
|
31
|
+
...l,
|
|
32
|
+
children: /* @__PURE__ */ a(r, { size: 16 })
|
|
33
|
+
}), /* @__PURE__ */ a("button", {
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
"data-test-id": "remove-link-button",
|
|
36
|
+
className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
|
|
37
|
+
...u,
|
|
38
|
+
children: /* @__PURE__ */ a(i, { size: 16 })
|
|
39
|
+
})]
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
42
|
+
});
|
|
45
43
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=EditModal.es.js.map
|
|
44
|
+
//#endregion
|
|
45
|
+
export { l as EditModal };
|
|
46
|
+
|
|
47
|
+
//# 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 { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, useLinkOpenButtonState } from '@frontify/fondue/rte';\nimport { type MouseEvent } from 'react';\n\nimport { getUrlFromLinkOrLegacyLink } from '../../../../../Link';\nimport { BlockStyles } from '../../../styles';\nimport { LINK_PLUGIN } from '../../id';\n\ntype EditModalProps = {\n editButtonProps: {\n onClick: () => void;\n };\n unlinkButtonProps: {\n onMouseDown: (e: MouseEvent<HTMLButtonElement>) => void;\n onClick: () => void;\n };\n};\n\nexport const EditModal = ({ editButtonProps, unlinkButtonProps }: EditModalProps) => {\n const { element } = useLinkOpenButtonState();\n const url = element ? getUrlFromLinkOrLegacyLink(element) : '';\n\n return (\n <FloatingModalWrapper data-test-id=\"floating-link-edit\" padding=\"16px\" minWidth=\"400px\">\n <span data-test-id=\"preview-link-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-link-edit-url\"\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {url}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n tabIndex={0}\n data-test-id=\"edit-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n {...editButtonProps}\n >\n <IconPen size={16} />\n </button>\n\n <button\n tabIndex={0}\n data-test-id=\"remove-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n {...unlinkButtonProps}\n >\n <IconTrashBin size={16} />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"EditModal.es.js","names":[],"sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, useLinkOpenButtonState } from '@frontify/fondue/rte';\nimport { type MouseEvent } from 'react';\n\nimport { getUrlFromLinkOrLegacyLink } from '../../../../../Link';\nimport { BlockStyles } from '../../../styles';\nimport { LINK_PLUGIN } from '../../id';\n\ntype EditModalProps = {\n editButtonProps: {\n onClick: () => void;\n };\n unlinkButtonProps: {\n onMouseDown: (e: MouseEvent<HTMLButtonElement>) => void;\n onClick: () => void;\n };\n};\n\nexport const EditModal = ({ editButtonProps, unlinkButtonProps }: EditModalProps) => {\n const { element } = useLinkOpenButtonState();\n const url = element ? getUrlFromLinkOrLegacyLink(element) : '';\n\n return (\n <FloatingModalWrapper data-test-id=\"floating-link-edit\" padding=\"16px\" minWidth=\"400px\">\n <span data-test-id=\"preview-link-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-link-edit-url\"\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {url}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n tabIndex={0}\n data-test-id=\"edit-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n {...editButtonProps}\n >\n <IconPen size={16} />\n </button>\n\n <button\n tabIndex={0}\n data-test-id=\"remove-link-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n {...unlinkButtonProps}\n >\n <IconTrashBin size={16} />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"mappings":";;;;;;;AAoBA,IAAa,KAAa,EAAE,oBAAiB,2BAAwC;CACjF,IAAM,EAAE,eAAY,EAAuB,GACrC,IAAM,IAAU,EAA2B,CAAO,IAAI;CAE5D,OACI,kBAAC,GAAD;EAAsB,gBAAa;EAAqB,SAAQ;EAAO,UAAS;EAC5E,UAAA,kBAAC,QAAD;GAAM,gBAAa;GAAsB,WAAU;GAAnD,UAAA,CACI,kBAAC,KAAD;IACI,gBAAa;IACb,MAAM;IACN,QAAO;IACP,KAAI;IACJ,OAAO,EAAY;IACnB,WAAU;IAET,UAAA;GACF,CAAA,GACH,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACI,kBAAC,UAAD;KACI,UAAU;KACV,gBAAa;KACb,WAAU;KACV,GAAI;KAEJ,UAAA,kBAAC,GAAD,EAAS,MAAM,GAAK,CAAA;IAChB,CAAA,GAER,kBAAC,UAAD;KACI,UAAU;KACV,gBAAa;KACb,WAAU;KACV,GAAI;KAEJ,UAAA,kBAAC,GAAD,EAAc,MAAM,GAAK,CAAA;IACrB,CAAA,CACN;GACJ,CAAA,CAAA;;CACY,CAAA;AAE9B"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { InsertModal as e } from "./InsertModal.es.js";
|
|
2
|
+
import { useInsertModal as t } from "./useInsertModal.es.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx
|
|
5
|
+
var r = () => /* @__PURE__ */ n(e, {
|
|
6
|
+
...t(),
|
|
7
|
+
testId: "floating-link-insert"
|
|
8
|
+
});
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as InsertLinkModal };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=InsertLinkModal.es.js.map
|
|
@@ -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 } from './InsertModal';\nimport { useInsertModal } from './useInsertModal';\n\nexport const InsertLinkModal = () => <InsertModal {...useInsertModal()} testId=\"floating-link-insert\" />;\n"],"
|
|
1
|
+
{"version":3,"file":"InsertLinkModal.es.js","names":[],"sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { InsertModal } from './InsertModal';\nimport { useInsertModal } from './useInsertModal';\n\nexport const InsertLinkModal = () => <InsertModal {...useInsertModal()} testId=\"floating-link-insert\" />;\n"],"mappings":";;;;AAKA,IAAa,UAAwB,kBAAC,GAAD;CAAa,GAAI,EAAe;CAAG,QAAO;AAAwB,CAAA"}
|
|
@@ -1,71 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
)
|
|
66
|
-
] }) })
|
|
67
|
-
] });
|
|
68
|
-
export {
|
|
69
|
-
z as InsertModal
|
|
70
|
-
};
|
|
71
|
-
//# sourceMappingURL=InsertModal.es.js.map
|
|
1
|
+
import { LinkInput as e } from "../../../../../Link/LinkInput.es.js";
|
|
2
|
+
import { Button as t, TextInput as n } from "@frontify/fondue/components";
|
|
3
|
+
import { IconCheckMark as r } from "@frontify/fondue/icons";
|
|
4
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { FormControl as o } from "@frontify/fondue";
|
|
6
|
+
import { FloatingModalWrapper as s } from "@frontify/fondue/rte";
|
|
7
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx
|
|
8
|
+
var c = ({ state: c, onTextChange: l, onUrlChange: u, onToggleTab: d, onCancel: f, onSave: p, isValidUrlOrEmpty: m, hasValues: h, testId: g, appBridge: _, children: v }) => /* @__PURE__ */ a(s, {
|
|
9
|
+
"data-test-id": g,
|
|
10
|
+
padding: "28px",
|
|
11
|
+
minWidth: "400px",
|
|
12
|
+
children: [
|
|
13
|
+
/* @__PURE__ */ i(o, {
|
|
14
|
+
label: {
|
|
15
|
+
children: "Text",
|
|
16
|
+
htmlFor: "linkText",
|
|
17
|
+
required: !0
|
|
18
|
+
},
|
|
19
|
+
children: /* @__PURE__ */ i(n, {
|
|
20
|
+
id: "linkText",
|
|
21
|
+
value: c.text,
|
|
22
|
+
placeholder: "Link Text",
|
|
23
|
+
onChange: (e) => l(e.target.value)
|
|
24
|
+
})
|
|
25
|
+
}),
|
|
26
|
+
v,
|
|
27
|
+
/* @__PURE__ */ i("div", {
|
|
28
|
+
className: "tw-mt-5",
|
|
29
|
+
children: /* @__PURE__ */ i(e, {
|
|
30
|
+
url: c.url,
|
|
31
|
+
newTab: c.newTab,
|
|
32
|
+
onUrlChange: u,
|
|
33
|
+
onToggleTab: d,
|
|
34
|
+
isValidUrlOrEmpty: m,
|
|
35
|
+
appBridge: _
|
|
36
|
+
})
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ i("div", {
|
|
39
|
+
className: "tw-mt-3",
|
|
40
|
+
children: /* @__PURE__ */ a("div", {
|
|
41
|
+
className: "tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10",
|
|
42
|
+
children: [/* @__PURE__ */ i(t, {
|
|
43
|
+
"data-test-id": "button",
|
|
44
|
+
onPress: f,
|
|
45
|
+
size: "medium",
|
|
46
|
+
emphasis: "default",
|
|
47
|
+
children: "Cancel"
|
|
48
|
+
}), /* @__PURE__ */ a(t, {
|
|
49
|
+
"data-test-id": "button",
|
|
50
|
+
onPress: p,
|
|
51
|
+
size: "medium",
|
|
52
|
+
disabled: !m(c?.url) || !h,
|
|
53
|
+
children: [/* @__PURE__ */ i(r, { size: "20" }), "Save"]
|
|
54
|
+
})]
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
//#endregion
|
|
60
|
+
export { c as InsertModal };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=InsertModal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsertModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport { FormControl } from '@frontify/fondue';\nimport { Button, TextInput } from '@frontify/fondue/components';\nimport { IconCheckMark } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper } from '@frontify/fondue/rte';\nimport { type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { LinkInput } from '../../../../../Link';\n\nimport { type InsertModalStateProps } from './types';\n\ntype Props = {\n state: InsertModalStateProps;\n onTextChange: (value: string) => void;\n onUrlChange: (value: string) => void;\n onToggleTab: (checked: boolean) => void;\n onCancel: () => void;\n onSave: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => void;\n hasValues: boolean;\n isValidUrlOrEmpty: (url: string) => boolean;\n testId?: string;\n children?: ReactNode;\n appBridge: AppBridgeBlock;\n};\n\nexport const InsertModal = ({\n state,\n onTextChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n isValidUrlOrEmpty,\n hasValues,\n testId,\n appBridge,\n children,\n}: Props): ReactElement => (\n <FloatingModalWrapper data-test-id={testId} padding=\"28px\" minWidth=\"400px\">\n <FormControl\n label={{\n children: 'Text',\n htmlFor: 'linkText',\n required: true,\n }}\n >\n <TextInput\n id=\"linkText\"\n value={state.text}\n placeholder=\"Link Text\"\n onChange={(event) => onTextChange(event.target.value)}\n />\n </FormControl>\n\n {children}\n\n <div className=\"tw-mt-5\">\n <LinkInput\n url={state.url}\n newTab={state.newTab}\n onUrlChange={onUrlChange}\n onToggleTab={onToggleTab}\n isValidUrlOrEmpty={isValidUrlOrEmpty}\n appBridge={appBridge}\n />\n </div>\n <div className=\"tw-mt-3\">\n <div className={'tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10'}>\n <Button data-test-id=\"button\" onPress={onCancel} size=\"medium\" emphasis=\"default\">\n Cancel\n </Button>\n <Button\n data-test-id=\"button\"\n onPress={onSave}\n size=\"medium\"\n disabled={!isValidUrlOrEmpty(state?.url) || !hasValues}\n >\n <IconCheckMark size=\"20\" />\n Save\n </Button>\n </div>\n </div>\n </FloatingModalWrapper>\n);\n"],"
|
|
1
|
+
{"version":3,"file":"InsertModal.es.js","names":[],"sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport { FormControl } from '@frontify/fondue';\nimport { Button, TextInput } from '@frontify/fondue/components';\nimport { IconCheckMark } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper } from '@frontify/fondue/rte';\nimport { type MouseEvent, type ReactElement, type ReactNode } from 'react';\n\nimport { LinkInput } from '../../../../../Link';\n\nimport { type InsertModalStateProps } from './types';\n\ntype Props = {\n state: InsertModalStateProps;\n onTextChange: (value: string) => void;\n onUrlChange: (value: string) => void;\n onToggleTab: (checked: boolean) => void;\n onCancel: () => void;\n onSave: (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => void;\n hasValues: boolean;\n isValidUrlOrEmpty: (url: string) => boolean;\n testId?: string;\n children?: ReactNode;\n appBridge: AppBridgeBlock;\n};\n\nexport const InsertModal = ({\n state,\n onTextChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n isValidUrlOrEmpty,\n hasValues,\n testId,\n appBridge,\n children,\n}: Props): ReactElement => (\n <FloatingModalWrapper data-test-id={testId} padding=\"28px\" minWidth=\"400px\">\n <FormControl\n label={{\n children: 'Text',\n htmlFor: 'linkText',\n required: true,\n }}\n >\n <TextInput\n id=\"linkText\"\n value={state.text}\n placeholder=\"Link Text\"\n onChange={(event) => onTextChange(event.target.value)}\n />\n </FormControl>\n\n {children}\n\n <div className=\"tw-mt-5\">\n <LinkInput\n url={state.url}\n newTab={state.newTab}\n onUrlChange={onUrlChange}\n onToggleTab={onToggleTab}\n isValidUrlOrEmpty={isValidUrlOrEmpty}\n appBridge={appBridge}\n />\n </div>\n <div className=\"tw-mt-3\">\n <div className={'tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10'}>\n <Button data-test-id=\"button\" onPress={onCancel} size=\"medium\" emphasis=\"default\">\n Cancel\n </Button>\n <Button\n data-test-id=\"button\"\n onPress={onSave}\n size=\"medium\"\n disabled={!isValidUrlOrEmpty(state?.url) || !hasValues}\n >\n <IconCheckMark size=\"20\" />\n Save\n </Button>\n </div>\n </div>\n </FloatingModalWrapper>\n);\n"],"mappings":";;;;;;;AA2BA,IAAa,KAAe,EACxB,UACA,iBACA,gBACA,gBACA,aACA,WACA,sBACA,cACA,WACA,cACA,kBAEA,kBAAC,GAAD;CAAsB,gBAAc;CAAQ,SAAQ;CAAO,UAAS;CAApE,UAAA;EACI,kBAAC,GAAD;GACI,OAAO;IACH,UAAU;IACV,SAAS;IACT,UAAU;GACd;GAEA,UAAA,kBAAC,GAAD;IACI,IAAG;IACH,OAAO,EAAM;IACb,aAAY;IACZ,WAAW,MAAU,EAAa,EAAM,OAAO,KAAK;GACvD,CAAA;EACQ,CAAA;EAEZ;EAED,kBAAC,OAAD;GAAK,WAAU;GACX,UAAA,kBAAC,GAAD;IACI,KAAK,EAAM;IACX,QAAQ,EAAM;IACD;IACA;IACM;IACR;GACd,CAAA;EACA,CAAA;EACL,kBAAC,OAAD;GAAK,WAAU;GACX,UAAA,kBAAC,OAAD;IAAK,WAAW;IAAhB,UAAA,CACI,kBAAC,GAAD;KAAQ,gBAAa;KAAS,SAAS;KAAU,MAAK;KAAS,UAAS;KAAU,UAAA;IAE1E,CAAA,GACR,kBAAC,GAAD;KACI,gBAAa;KACb,SAAS;KACT,MAAK;KACL,UAAU,CAAC,EAAkB,GAAO,GAAG,KAAK,CAAC;KAJjD,UAAA,CAMI,kBAAC,GAAD,EAAe,MAAK,KAAM,CAAA,GAAC,MAEvB;IACP,CAAA,CAAA;;EACJ,CAAA;CACa"}
|
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { getLegacyUrl as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { addHttps as e } from "../../../../../../helpers/addHttps.es.js";
|
|
2
|
+
import { isValidUrlOrEmpty as t } from "../../../../../Link/utils/url.es.js";
|
|
3
|
+
import { getLegacyUrl as n, getUrl as r } from "../../utils/getUrl.es.js";
|
|
4
|
+
import { useEffect as i, useReducer as a } from "react";
|
|
5
|
+
import { ELEMENT_LINK as o, floatingLinkActions as s, floatingLinkSelectors as c, getPluginOptions as l, submitFloatingLink as u, useEditorRef as d, useHotkeys as f } from "@frontify/fondue/rte";
|
|
6
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts
|
|
7
|
+
var p = {
|
|
8
|
+
url: "",
|
|
9
|
+
text: "",
|
|
10
|
+
newTab: !1
|
|
11
|
+
}, m = () => {
|
|
12
|
+
let [e, t] = a((e, t) => {
|
|
13
|
+
let { type: n, payload: r } = t;
|
|
14
|
+
switch (n) {
|
|
15
|
+
case "NEW_TAB": return {
|
|
16
|
+
...e,
|
|
17
|
+
newTab: !0
|
|
18
|
+
};
|
|
19
|
+
case "SAME_TAB": return {
|
|
20
|
+
...e,
|
|
21
|
+
newTab: !1
|
|
22
|
+
};
|
|
23
|
+
case "URL":
|
|
24
|
+
case "TEXT":
|
|
25
|
+
case "INIT": return {
|
|
26
|
+
...e,
|
|
27
|
+
...r
|
|
28
|
+
};
|
|
29
|
+
default: return e;
|
|
30
|
+
}
|
|
31
|
+
}, p);
|
|
32
|
+
return [e, t];
|
|
10
33
|
}, h = () => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
type: "TEXT",
|
|
52
|
-
payload: { text: e }
|
|
53
|
-
});
|
|
54
|
-
}, l = (e) => {
|
|
55
|
-
t({
|
|
56
|
-
type: "URL",
|
|
57
|
-
payload: { url: e }
|
|
58
|
-
});
|
|
59
|
-
}, c = (e) => {
|
|
60
|
-
t(e ? { type: "NEW_TAB" } : { type: "SAME_TAB" });
|
|
61
|
-
}, T = () => {
|
|
62
|
-
a.reset();
|
|
63
|
-
}, i = (e) => {
|
|
64
|
-
!p(n.url) || !u || (a.text(n.text), a.url(U(n.url)), a.newTab(n.newTab), w(r) && e?.preventDefault());
|
|
65
|
-
}, u = n.url !== "" && n.text !== "", { appBridge: d } = m(r, E);
|
|
66
|
-
return b(
|
|
67
|
-
"enter",
|
|
68
|
-
i,
|
|
69
|
-
{
|
|
70
|
-
enableOnFormTags: ["INPUT"]
|
|
71
|
-
},
|
|
72
|
-
[]
|
|
73
|
-
), { state: n, onTextChange: s, onUrlChange: l, onToggleTab: c, onCancel: T, onSave: i, hasValues: u, isValidUrlOrEmpty: p, appBridge: d };
|
|
34
|
+
let a = d(), [p, h] = m();
|
|
35
|
+
i(() => {
|
|
36
|
+
let e = n(a), t = r(a), i = c.newTab();
|
|
37
|
+
h({
|
|
38
|
+
type: "INIT",
|
|
39
|
+
payload: {
|
|
40
|
+
text: c.text() || c.url(),
|
|
41
|
+
newTab: i,
|
|
42
|
+
url: e && t === "" ? e : c.url()
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}, [h, a]);
|
|
46
|
+
let g = (e) => {
|
|
47
|
+
h({
|
|
48
|
+
type: "TEXT",
|
|
49
|
+
payload: { text: e }
|
|
50
|
+
});
|
|
51
|
+
}, _ = (e) => {
|
|
52
|
+
h({
|
|
53
|
+
type: "URL",
|
|
54
|
+
payload: { url: e }
|
|
55
|
+
});
|
|
56
|
+
}, v = (e) => {
|
|
57
|
+
h(e ? { type: "NEW_TAB" } : { type: "SAME_TAB" });
|
|
58
|
+
}, y = () => {
|
|
59
|
+
s.reset();
|
|
60
|
+
}, b = (n) => {
|
|
61
|
+
!t(p.url) || !x || (s.text(p.text), s.url(e(p.url)), s.newTab(p.newTab), u(a) && n?.preventDefault());
|
|
62
|
+
}, x = p.url !== "" && p.text !== "", { appBridge: S } = l(a, o);
|
|
63
|
+
return f("enter", b, { enableOnFormTags: ["INPUT"] }, []), {
|
|
64
|
+
state: p,
|
|
65
|
+
onTextChange: g,
|
|
66
|
+
onUrlChange: _,
|
|
67
|
+
onToggleTab: v,
|
|
68
|
+
onCancel: y,
|
|
69
|
+
onSave: b,
|
|
70
|
+
hasValues: x,
|
|
71
|
+
isValidUrlOrEmpty: t,
|
|
72
|
+
appBridge: S
|
|
73
|
+
};
|
|
74
74
|
};
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
//# sourceMappingURL=useInsertModal.es.js.map
|
|
75
|
+
//#endregion
|
|
76
|
+
export { m as InsertModalState, h as useInsertModal };
|
|
77
|
+
|
|
78
|
+
//# sourceMappingURL=useInsertModal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInsertModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n ELEMENT_LINK,\n floatingLinkActions,\n floatingLinkSelectors,\n getPluginOptions,\n submitFloatingLink,\n useEditorRef,\n useHotkeys,\n} from '@frontify/fondue/rte';\nimport { type Dispatch, type MouseEvent, type Reducer, useEffect, useReducer } from 'react';\n\nimport { addHttps } from '../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../../Link';\nimport { getLegacyUrl, getUrl } from '../../utils';\n\nimport { type InsertModalDispatchType, type InsertModalStateProps } from './types';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n newTab: false,\n};\n\nexport const InsertModalState = (): [InsertModalStateProps, Dispatch<InsertModalDispatchType>] => {\n const [state, dispatch] = useReducer<Reducer<InsertModalStateProps, InsertModalDispatchType>>((state, action) => {\n const { type, payload } = action;\n\n switch (type) {\n case 'NEW_TAB':\n return {\n ...state,\n newTab: true,\n };\n case 'SAME_TAB':\n return {\n ...state,\n newTab: false,\n };\n case 'URL':\n case 'TEXT':\n case 'INIT':\n return {\n ...state,\n ...payload,\n };\n default:\n return state;\n }\n }, initialState);\n\n return [state, dispatch];\n};\n\nexport const useInsertModal = () => {\n const editor = useEditorRef();\n const [state, dispatch] = InsertModalState();\n\n useEffect(() => {\n const legacyUrl = getLegacyUrl(editor);\n const url = getUrl(editor);\n const isNewTab = floatingLinkSelectors.newTab();\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingLinkSelectors.text() || floatingLinkSelectors.url(),\n newTab: isNewTab,\n url: legacyUrl && url === '' ? legacyUrl : floatingLinkSelectors.url(),\n },\n });\n }, [dispatch, editor]);\n\n const onTextChange = (value: string) => {\n dispatch({\n type: 'TEXT',\n payload: { text: value },\n });\n };\n\n const onUrlChange = (value: string) => {\n dispatch({\n type: 'URL',\n payload: { url: value },\n });\n };\n\n const onToggleTab = (checked: boolean) => {\n checked ? dispatch({ type: 'NEW_TAB' }) : dispatch({ type: 'SAME_TAB' });\n };\n\n const onCancel = () => {\n floatingLinkActions.reset();\n };\n\n const onSave = (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n floatingLinkActions.text(state.text);\n floatingLinkActions.url(addHttps(state.url));\n floatingLinkActions.newTab(state.newTab);\n\n if (submitFloatingLink(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_LINK);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return { state, onTextChange, onUrlChange, onToggleTab, onCancel, onSave, hasValues, isValidUrlOrEmpty, appBridge };\n};\n"],"
|
|
1
|
+
{"version":3,"file":"useInsertModal.es.js","names":[],"sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n ELEMENT_LINK,\n floatingLinkActions,\n floatingLinkSelectors,\n getPluginOptions,\n submitFloatingLink,\n useEditorRef,\n useHotkeys,\n} from '@frontify/fondue/rte';\nimport { type Dispatch, type MouseEvent, type Reducer, useEffect, useReducer } from 'react';\n\nimport { addHttps } from '../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../../Link';\nimport { getLegacyUrl, getUrl } from '../../utils';\n\nimport { type InsertModalDispatchType, type InsertModalStateProps } from './types';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n newTab: false,\n};\n\nexport const InsertModalState = (): [InsertModalStateProps, Dispatch<InsertModalDispatchType>] => {\n const [state, dispatch] = useReducer<Reducer<InsertModalStateProps, InsertModalDispatchType>>((state, action) => {\n const { type, payload } = action;\n\n switch (type) {\n case 'NEW_TAB':\n return {\n ...state,\n newTab: true,\n };\n case 'SAME_TAB':\n return {\n ...state,\n newTab: false,\n };\n case 'URL':\n case 'TEXT':\n case 'INIT':\n return {\n ...state,\n ...payload,\n };\n default:\n return state;\n }\n }, initialState);\n\n return [state, dispatch];\n};\n\nexport const useInsertModal = () => {\n const editor = useEditorRef();\n const [state, dispatch] = InsertModalState();\n\n useEffect(() => {\n const legacyUrl = getLegacyUrl(editor);\n const url = getUrl(editor);\n const isNewTab = floatingLinkSelectors.newTab();\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingLinkSelectors.text() || floatingLinkSelectors.url(),\n newTab: isNewTab,\n url: legacyUrl && url === '' ? legacyUrl : floatingLinkSelectors.url(),\n },\n });\n }, [dispatch, editor]);\n\n const onTextChange = (value: string) => {\n dispatch({\n type: 'TEXT',\n payload: { text: value },\n });\n };\n\n const onUrlChange = (value: string) => {\n dispatch({\n type: 'URL',\n payload: { url: value },\n });\n };\n\n const onToggleTab = (checked: boolean) => {\n checked ? dispatch({ type: 'NEW_TAB' }) : dispatch({ type: 'SAME_TAB' });\n };\n\n const onCancel = () => {\n floatingLinkActions.reset();\n };\n\n const onSave = (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n floatingLinkActions.text(state.text);\n floatingLinkActions.url(addHttps(state.url));\n floatingLinkActions.newTab(state.newTab);\n\n if (submitFloatingLink(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_LINK);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return { state, onTextChange, onUrlChange, onToggleTab, onCancel, onSave, hasValues, isValidUrlOrEmpty, appBridge };\n};\n"],"mappings":";;;;;;AAoBA,IAAM,IAAsC;CACxC,KAAK;CACL,MAAM;CACN,QAAQ;AACZ,GAEa,UAAqF;CAC9F,IAAM,CAAC,GAAO,KAAY,GAAqE,GAAO,MAAW;EAC7G,IAAM,EAAE,SAAM,eAAY;EAE1B,QAAQ,GAAR;GACI,KAAK,WACD,OAAO;IACH,GAAG;IACH,QAAQ;GACZ;GACJ,KAAK,YACD,OAAO;IACH,GAAG;IACH,QAAQ;GACZ;GACJ,KAAK;GACL,KAAK;GACL,KAAK,QACD,OAAO;IACH,GAAG;IACH,GAAG;GACP;GACJ,SACI,OAAO;EACf;CACJ,GAAG,CAAY;CAEf,OAAO,CAAC,GAAO,CAAQ;AAC3B,GAEa,UAAuB;CAChC,IAAM,IAAS,EAAa,GACtB,CAAC,GAAO,KAAY,EAAiB;CAE3C,QAAgB;EACZ,IAAM,IAAY,EAAa,CAAM,GAC/B,IAAM,EAAO,CAAM,GACnB,IAAW,EAAsB,OAAO;EAC9C,EAAS;GACL,MAAM;GACN,SAAS;IACL,MAAM,EAAsB,KAAK,KAAK,EAAsB,IAAI;IAChE,QAAQ;IACR,KAAK,KAAa,MAAQ,KAAK,IAAY,EAAsB,IAAI;GACzE;EACJ,CAAC;CACL,GAAG,CAAC,GAAU,CAAM,CAAC;CAErB,IAAM,KAAgB,MAAkB;EACpC,EAAS;GACL,MAAM;GACN,SAAS,EAAE,MAAM,EAAM;EAC3B,CAAC;CACL,GAEM,KAAe,MAAkB;EACnC,EAAS;GACL,MAAM;GACN,SAAS,EAAE,KAAK,EAAM;EAC1B,CAAC;CACL,GAEM,KAAe,MAAqB;EACtC,AAAU,EAAV,IAAmB,EAAE,MAAM,UAAU,IAAc,EAAE,MAAM,WAAW,CAAC;CAC3E,GAEM,UAAiB;EACnB,EAAoB,MAAM;CAC9B,GAEM,KAAU,MAA4F;EACpG,CAAC,EAAkB,EAAM,GAAG,KAAK,CAAC,MAItC,EAAoB,KAAK,EAAM,IAAI,GACnC,EAAoB,IAAI,EAAS,EAAM,GAAG,CAAC,GAC3C,EAAoB,OAAO,EAAM,MAAM,GAEnC,EAAmB,CAAM,KACzB,GAAO,eAAe;CAE9B,GAEM,IAAY,EAAM,QAAQ,MAAM,EAAM,SAAS,IAE/C,EAAE,iBAAc,EAAgD,GAAQ,CAAY;CAW1F,OATA,EACI,SACA,GACA,EACI,kBAAkB,CAAC,OAAO,EAC9B,GACA,CAAC,CACL,GAEO;EAAE;EAAO;EAAc;EAAa;EAAa;EAAU;EAAQ;EAAW;EAAmB;CAAU;AACtH"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${d("Ctrl+K")}` : "Links can only be set for a single text block."
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
) });
|
|
1
|
+
import { LinkToolbarButton as e } from "./LinkToolbarButton.es.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { getHotkeyByPlatform as n, getTooltip as r, isRangeInSameBlock as i, useEditorState as a, useEventPlateId as o } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx
|
|
5
|
+
var s = ({ id: s, editorId: c }) => {
|
|
6
|
+
let l = a(o(c)), u = !!i(l, { at: l.selection });
|
|
7
|
+
return /* @__PURE__ */ t("div", {
|
|
8
|
+
"data-plugin-id": s,
|
|
9
|
+
children: /* @__PURE__ */ t(e, {
|
|
10
|
+
disabled: !u,
|
|
11
|
+
tooltip: r(u ? `Link\n${n("Ctrl+K")}` : "Links can only be set for a single text block.")
|
|
12
|
+
})
|
|
13
|
+
});
|
|
18
14
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=LinkButton.es.js.map
|
|
15
|
+
//#endregion
|
|
16
|
+
export { s as LinkButton };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=LinkButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PluginButtonProps,\n getHotkeyByPlatform,\n getTooltip,\n isRangeInSameBlock,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue/rte';\n\nimport { LinkToolbarButton } from './LinkToolbarButton';\n\nexport const LinkButton = ({ id, editorId }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n\n return (\n <div data-plugin-id={id}>\n <LinkToolbarButton\n disabled={!isEnabled}\n tooltip={getTooltip(\n isEnabled\n ? `Link\\n${getHotkeyByPlatform('Ctrl+K')}`\n : 'Links can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"LinkButton.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PluginButtonProps,\n getHotkeyByPlatform,\n getTooltip,\n isRangeInSameBlock,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue/rte';\n\nimport { LinkToolbarButton } from './LinkToolbarButton';\n\nexport const LinkButton = ({ id, editorId }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n\n return (\n <div data-plugin-id={id}>\n <LinkToolbarButton\n disabled={!isEnabled}\n tooltip={getTooltip(\n isEnabled\n ? `Link\\n${getHotkeyByPlatform('Ctrl+K')}`\n : 'Links can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"mappings":";;;;AAaA,IAAa,KAAc,EAAE,OAAI,kBAAkC;CAC/D,IAAM,IAAS,EAAe,EAAgB,CAAQ,CAAC,GACjD,IAAY,CAAC,CAAC,EAAmB,GAAQ,EAC3C,IAAI,EAAO,UACf,CAAC;CAED,OACI,kBAAC,OAAD;EAAK,kBAAgB;EACjB,UAAA,kBAAC,GAAD;GACI,UAAU,CAAC;GACX,SAAS,EACL,IACM,SAAS,EAAoB,QAAQ,MACrC,gDACV;EACH,CAAA;CACA,CAAA;AAEb"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { LINK_PLUGIN as e } from "../id.es.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useRichTextEditorContext as n } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx
|
|
5
|
+
var r = (r) => {
|
|
6
|
+
let { attributes: i, children: a } = r, { styles: o } = n(), s = r.element.url || r.element.chosenLink?.searchResult?.link || "", c = r.element.target || "_self";
|
|
7
|
+
return /* @__PURE__ */ t("a", {
|
|
8
|
+
...i,
|
|
9
|
+
href: s,
|
|
10
|
+
target: c,
|
|
11
|
+
style: o[e],
|
|
12
|
+
children: a
|
|
13
|
+
});
|
|
7
14
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=LinkMarkupElementNode.es.js.map
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as LinkMarkupElementNode };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=LinkMarkupElementNode.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkMarkupElementNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PlateRenderElementProps,\n type TLinkElement as TPlateLinkElement,\n useRichTextEditorContext,\n} from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../id';\n\nexport type TLinkElement = TPlateLinkElement & {\n chosenLink?: {\n searchResult?: {\n link?: string;\n };\n openInNewTab?: boolean;\n };\n};\n\nexport const LinkMarkupElementNode = (props: PlateRenderElementProps & { element: TLinkElement }) => {\n const { attributes, children } = props;\n\n const { styles } = useRichTextEditorContext();\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n\n return (\n <a {...attributes} href={href} target={target} style={styles[LINK_PLUGIN]}>\n {children}\n </a>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"LinkMarkupElementNode.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PlateRenderElementProps,\n type TLinkElement as TPlateLinkElement,\n useRichTextEditorContext,\n} from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../id';\n\nexport type TLinkElement = TPlateLinkElement & {\n chosenLink?: {\n searchResult?: {\n link?: string;\n };\n openInNewTab?: boolean;\n };\n};\n\nexport const LinkMarkupElementNode = (props: PlateRenderElementProps & { element: TLinkElement }) => {\n const { attributes, children } = props;\n\n const { styles } = useRichTextEditorContext();\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n\n return (\n <a {...attributes} href={href} target={target} style={styles[LINK_PLUGIN]}>\n {children}\n </a>\n );\n};\n"],"mappings":";;;;AAmBA,IAAa,KAAyB,MAA+D;CACjG,IAAM,EAAE,eAAY,gBAAa,GAE3B,EAAE,cAAW,EAAyB,GACtC,IAAO,EAAM,QAAQ,OAAO,EAAM,QAAQ,YAAY,cAAc,QAAQ,IAC5E,IAAS,EAAM,QAAQ,UAAU;CAEvC,OACI,kBAAC,KAAD;EAAG,GAAI;EAAkB;EAAc;EAAQ,OAAO,EAAO;EACxD;CACF,CAAA;AAEX"}
|