@frontify/guideline-blocks-settings 3.0.2 → 4.0.0-alpha.0
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 +70 -63
- package/dist/components/Link/LinkInput.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 +2 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +16 -34
- package/dist/index.es.js +219 -213
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -10
- 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 +7 -9
- package/dist/components/Link/LinkSelector/DocumentLink.es.js +0 -64
- package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js +0 -65
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +0 -7
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/PageLink.es.js +0 -69
- package/dist/components/Link/LinkSelector/PageLink.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/PageLinks.es.js +0 -38
- package/dist/components/Link/LinkSelector/PageLinks.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/SectionLink.es.js +0 -26
- package/dist/components/Link/LinkSelector/SectionLink.es.js.map +0 -1
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js +0 -5
- package/dist/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.es.js.map +0 -1
|
@@ -1,55 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { LINK_PLUGIN as
|
|
5
|
-
import { BlockStyles as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
] }) });
|
|
1
|
+
import { floatingButtonSelectors as e } from "../floatingButtonStore.es.js";
|
|
2
|
+
import { unwrapButton as t } from "../../../transforms/unwrapButton.es.js";
|
|
3
|
+
import { triggerFloatingButtonEdit as n } from "../../../utils/triggerFloatingButtonEdit.es.js";
|
|
4
|
+
import { LINK_PLUGIN as r } from "../../../../LinkPlugin/id.es.js";
|
|
5
|
+
import { BlockStyles as i } from "../../../../styles.es.js";
|
|
6
|
+
import { IconPen as a, IconTrashBin as o } from "@frontify/fondue/icons";
|
|
7
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import { FloatingModalWrapper as l, focusEditor as u, useEditorRef as d } from "@frontify/fondue/rte";
|
|
9
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx
|
|
10
|
+
var f = () => {
|
|
11
|
+
let f = d();
|
|
12
|
+
return /* @__PURE__ */ s(l, {
|
|
13
|
+
padding: "16px",
|
|
14
|
+
minWidth: "400px",
|
|
15
|
+
"data-test-id": "floating-button-edit",
|
|
16
|
+
children: /* @__PURE__ */ c("span", {
|
|
17
|
+
"data-test-id": "preview-button-flyout",
|
|
18
|
+
className: "tw-flex tw-justify-between tw-items-center tw-gap-2",
|
|
19
|
+
children: [/* @__PURE__ */ s("a", {
|
|
20
|
+
"data-test-id": "floating-button-edit-url",
|
|
21
|
+
href: e.url(),
|
|
22
|
+
target: "_blank",
|
|
23
|
+
rel: "noopener noreferrer",
|
|
24
|
+
style: i[r],
|
|
25
|
+
className: "tw-break-all",
|
|
26
|
+
children: e.url()
|
|
27
|
+
}), /* @__PURE__ */ c("span", {
|
|
28
|
+
className: "tw-flex tw-gap-2",
|
|
29
|
+
children: [/* @__PURE__ */ s("button", {
|
|
30
|
+
onClick: () => {
|
|
31
|
+
n(f);
|
|
32
|
+
},
|
|
33
|
+
tabIndex: 0,
|
|
34
|
+
"data-test-id": "edit-button-button",
|
|
35
|
+
className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
|
|
36
|
+
children: /* @__PURE__ */ s(a, { size: 16 })
|
|
37
|
+
}), /* @__PURE__ */ s("button", {
|
|
38
|
+
onClick: () => {
|
|
39
|
+
t(f), u(f, f.selection ?? void 0);
|
|
40
|
+
},
|
|
41
|
+
tabIndex: 0,
|
|
42
|
+
"data-test-id": "remove-button-button",
|
|
43
|
+
className: "tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1",
|
|
44
|
+
children: /* @__PURE__ */ s(o, { size: 16 })
|
|
45
|
+
})]
|
|
46
|
+
})]
|
|
47
|
+
})
|
|
48
|
+
});
|
|
51
49
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
//# sourceMappingURL=EditModal.es.js.map
|
|
50
|
+
//#endregion
|
|
51
|
+
export { f as EditModal };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=EditModal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, focusEditor, useEditorRef } from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../../../../LinkPlugin/id';\nimport { BlockStyles } from '../../../../styles';\nimport { unwrapButton } from '../../../transforms';\nimport { triggerFloatingButtonEdit } from '../../../utils';\nimport { floatingButtonSelectors } from '../floatingButtonStore';\n\nexport const EditModal = () => {\n const editor = useEditorRef();\n return (\n <FloatingModalWrapper padding=\"16px\" minWidth=\"400px\" data-test-id=\"floating-button-edit\">\n <span data-test-id=\"preview-button-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-button-edit-url\"\n href={floatingButtonSelectors.url()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {floatingButtonSelectors.url()}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n onClick={() => {\n triggerFloatingButtonEdit(editor);\n }}\n tabIndex={0}\n data-test-id=\"edit-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n >\n <IconPen size={16} />\n </button>\n\n <button\n onClick={() => {\n unwrapButton(editor);\n focusEditor(editor, editor.selection ?? undefined);\n }}\n tabIndex={0}\n data-test-id=\"remove-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\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/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconPen, IconTrashBin } from '@frontify/fondue/icons';\nimport { FloatingModalWrapper, focusEditor, useEditorRef } from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../../../../LinkPlugin/id';\nimport { BlockStyles } from '../../../../styles';\nimport { unwrapButton } from '../../../transforms';\nimport { triggerFloatingButtonEdit } from '../../../utils';\nimport { floatingButtonSelectors } from '../floatingButtonStore';\n\nexport const EditModal = () => {\n const editor = useEditorRef();\n return (\n <FloatingModalWrapper padding=\"16px\" minWidth=\"400px\" data-test-id=\"floating-button-edit\">\n <span data-test-id=\"preview-button-flyout\" className=\"tw-flex tw-justify-between tw-items-center tw-gap-2\">\n <a\n data-test-id=\"floating-button-edit-url\"\n href={floatingButtonSelectors.url()}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n style={BlockStyles[LINK_PLUGIN]}\n className=\"tw-break-all\"\n >\n {floatingButtonSelectors.url()}\n </a>\n <span className=\"tw-flex tw-gap-2\">\n <button\n onClick={() => {\n triggerFloatingButtonEdit(editor);\n }}\n tabIndex={0}\n data-test-id=\"edit-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n >\n <IconPen size={16} />\n </button>\n\n <button\n onClick={() => {\n unwrapButton(editor);\n focusEditor(editor, editor.selection ?? undefined);\n }}\n tabIndex={0}\n data-test-id=\"remove-button-button\"\n className=\"tw-transition tw-cursor-pointer tw-rounded-medium hover:tw-bg-black-10 tw-p-1\"\n >\n <IconTrashBin size={16} />\n </button>\n </span>\n </span>\n </FloatingModalWrapper>\n );\n};\n"],"mappings":";;;;;;;;;AAWA,IAAa,UAAkB;CAC3B,IAAM,IAAS,EAAa;CAC5B,OACI,kBAAC,GAAD;EAAsB,SAAQ;EAAO,UAAS;EAAQ,gBAAa;EAC/D,UAAA,kBAAC,QAAD;GAAM,gBAAa;GAAwB,WAAU;GAArD,UAAA,CACI,kBAAC,KAAD;IACI,gBAAa;IACb,MAAM,EAAwB,IAAI;IAClC,QAAO;IACP,KAAI;IACJ,OAAO,EAAY;IACnB,WAAU;IAET,UAAA,EAAwB,IAAI;GAC9B,CAAA,GACH,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACI,kBAAC,UAAD;KACI,eAAe;MACX,EAA0B,CAAM;KACpC;KACA,UAAU;KACV,gBAAa;KACb,WAAU;KAEV,UAAA,kBAAC,GAAD,EAAS,MAAM,GAAK,CAAA;IAChB,CAAA,GAER,kBAAC,UAAD;KACI,eAAe;MAEX,AADA,EAAa,CAAM,GACnB,EAAY,GAAQ,EAAO,aAAa,KAAA,CAAS;KACrD;KACA,UAAU;KACV,gBAAa;KACb,WAAU;KAEV,UAAA,kBAAC,GAAD,EAAc,MAAM,GAAK,CAAA;IACrB,CAAA,CACN;GACJ,CAAA,CAAA;;CACY,CAAA;AAE9B"}
|
|
@@ -1,69 +1,69 @@
|
|
|
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
|
-
|
|
1
|
+
import { BlockStyles as e } from "../../../../styles.es.js";
|
|
2
|
+
import { InsertModal as t } from "../../../../LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js";
|
|
3
|
+
import { useInsertModal as n } from "./useInsertModal.es.js";
|
|
4
|
+
import { useState as r } from "react";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { FormControl as o } from "@frontify/fondue";
|
|
7
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx
|
|
8
|
+
var s = () => {
|
|
9
|
+
let r = n(), { state: s, onButtonStyleChange: l } = r;
|
|
10
|
+
return /* @__PURE__ */ i(t, {
|
|
11
|
+
...r,
|
|
12
|
+
testId: "floating-button-insert",
|
|
13
|
+
children: /* @__PURE__ */ i("div", {
|
|
14
|
+
className: "tw-pt-5",
|
|
15
|
+
children: /* @__PURE__ */ a(o, {
|
|
16
|
+
label: {
|
|
17
|
+
children: "Button Style",
|
|
18
|
+
htmlFor: "buttonStyle",
|
|
19
|
+
required: !0
|
|
20
|
+
},
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ i(c, {
|
|
23
|
+
id: "primary",
|
|
24
|
+
styles: e.buttonPrimary,
|
|
25
|
+
isActive: s.buttonStyle === "primary",
|
|
26
|
+
onClick: () => l("primary"),
|
|
27
|
+
children: s.text || "Primary Button"
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ i(c, {
|
|
30
|
+
id: "secondary",
|
|
31
|
+
styles: e.buttonSecondary,
|
|
32
|
+
isActive: s.buttonStyle === "secondary",
|
|
33
|
+
onClick: () => l("secondary"),
|
|
34
|
+
children: s.text || "Secondary Button"
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ i(c, {
|
|
37
|
+
id: "tertiary",
|
|
38
|
+
styles: e.buttonTertiary,
|
|
39
|
+
isActive: s.buttonStyle === "tertiary",
|
|
40
|
+
onClick: () => l("tertiary"),
|
|
41
|
+
children: s.text || "Tertiary Button"
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}, c = ({ id: e, styles: t, isActive: n, onClick: a, children: o }) => {
|
|
48
|
+
let [s, c] = r(!1);
|
|
49
|
+
return /* @__PURE__ */ i("button", {
|
|
50
|
+
"data-test-id": `floating-button-insert-${e}`,
|
|
51
|
+
onMouseEnter: () => c(!0),
|
|
52
|
+
onMouseLeave: () => c(!1),
|
|
53
|
+
onClick: a,
|
|
54
|
+
style: {
|
|
55
|
+
...t && t.hover && s ? {
|
|
56
|
+
...t,
|
|
57
|
+
...t.hover
|
|
58
|
+
} : t,
|
|
59
|
+
marginTop: 0,
|
|
60
|
+
marginBottom: 0
|
|
61
|
+
},
|
|
62
|
+
className: n ? "tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit" : "tw-w-fit",
|
|
63
|
+
children: o
|
|
64
|
+
});
|
|
65
65
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=InsertButtonModal.es.js.map
|
|
66
|
+
//#endregion
|
|
67
|
+
export { s as InsertButtonModal };
|
|
68
|
+
|
|
69
|
+
//# sourceMappingURL=InsertButtonModal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsertButtonModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FormControl } from '@frontify/fondue';\nimport { type CSSProperties, type ReactElement, type ReactNode, useState } from 'react';\n\nimport { InsertModal } from '../../../../LinkPlugin/FloatingLink/InsertLinkModal/InsertModal';\nimport { BlockStyles } from '../../../../styles';\n\nimport { useInsertModal } from './useInsertModal';\n\nexport const InsertButtonModal = () => {\n const modalProps = useInsertModal();\n const { state, onButtonStyleChange } = modalProps;\n\n return (\n <InsertModal {...modalProps} testId=\"floating-button-insert\">\n <div className=\"tw-pt-5\">\n <FormControl\n label={{\n children: 'Button Style',\n htmlFor: 'buttonStyle',\n required: true,\n }}\n >\n <HoverableButton\n id=\"primary\"\n styles={BlockStyles.buttonPrimary}\n isActive={state.buttonStyle === 'primary'}\n onClick={() => onButtonStyleChange('primary')}\n >\n {state.text || 'Primary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"secondary\"\n styles={BlockStyles.buttonSecondary}\n isActive={state.buttonStyle === 'secondary'}\n onClick={() => onButtonStyleChange('secondary')}\n >\n {state.text || 'Secondary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"tertiary\"\n styles={BlockStyles.buttonTertiary}\n isActive={state.buttonStyle === 'tertiary'}\n onClick={() => onButtonStyleChange('tertiary')}\n >\n {state.text || 'Tertiary Button'}\n </HoverableButton>\n </FormControl>\n </div>\n </InsertModal>\n );\n};\n\ntype Props = {\n id: string;\n styles?: CSSProperties & { hover?: CSSProperties };\n isActive: boolean;\n onClick: () => void;\n children: ReactNode;\n};\n\nconst HoverableButton = ({ id, styles, isActive, onClick, children }: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n const getStyles = () => (styles && styles.hover && hovered ? { ...styles, ...styles.hover } : styles);\n\n return (\n <button\n data-test-id={`floating-button-insert-${id}`}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={onClick}\n style={{ ...getStyles(), marginTop: 0, marginBottom: 0 }}\n className={\n isActive ? 'tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit' : 'tw-w-fit'\n }\n >\n {children}\n </button>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"InsertButtonModal.es.js","names":[],"sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { FormControl } from '@frontify/fondue';\nimport { type CSSProperties, type ReactElement, type ReactNode, useState } from 'react';\n\nimport { InsertModal } from '../../../../LinkPlugin/FloatingLink/InsertLinkModal/InsertModal';\nimport { BlockStyles } from '../../../../styles';\n\nimport { useInsertModal } from './useInsertModal';\n\nexport const InsertButtonModal = () => {\n const modalProps = useInsertModal();\n const { state, onButtonStyleChange } = modalProps;\n\n return (\n <InsertModal {...modalProps} testId=\"floating-button-insert\">\n <div className=\"tw-pt-5\">\n <FormControl\n label={{\n children: 'Button Style',\n htmlFor: 'buttonStyle',\n required: true,\n }}\n >\n <HoverableButton\n id=\"primary\"\n styles={BlockStyles.buttonPrimary}\n isActive={state.buttonStyle === 'primary'}\n onClick={() => onButtonStyleChange('primary')}\n >\n {state.text || 'Primary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"secondary\"\n styles={BlockStyles.buttonSecondary}\n isActive={state.buttonStyle === 'secondary'}\n onClick={() => onButtonStyleChange('secondary')}\n >\n {state.text || 'Secondary Button'}\n </HoverableButton>\n\n <HoverableButton\n id=\"tertiary\"\n styles={BlockStyles.buttonTertiary}\n isActive={state.buttonStyle === 'tertiary'}\n onClick={() => onButtonStyleChange('tertiary')}\n >\n {state.text || 'Tertiary Button'}\n </HoverableButton>\n </FormControl>\n </div>\n </InsertModal>\n );\n};\n\ntype Props = {\n id: string;\n styles?: CSSProperties & { hover?: CSSProperties };\n isActive: boolean;\n onClick: () => void;\n children: ReactNode;\n};\n\nconst HoverableButton = ({ id, styles, isActive, onClick, children }: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n const getStyles = () => (styles && styles.hover && hovered ? { ...styles, ...styles.hover } : styles);\n\n return (\n <button\n data-test-id={`floating-button-insert-${id}`}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n onClick={onClick}\n style={{ ...getStyles(), marginTop: 0, marginBottom: 0 }}\n className={\n isActive ? 'tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit' : 'tw-w-fit'\n }\n >\n {children}\n </button>\n );\n};\n"],"mappings":";;;;;;;AAUA,IAAa,UAA0B;CACnC,IAAM,IAAa,EAAe,GAC5B,EAAE,UAAO,2BAAwB;CAEvC,OACI,kBAAC,GAAD;EAAa,GAAI;EAAY,QAAO;EAChC,UAAA,kBAAC,OAAD;GAAK,WAAU;GACX,UAAA,kBAAC,GAAD;IACI,OAAO;KACH,UAAU;KACV,SAAS;KACT,UAAU;IACd;IALJ,UAAA;KAOI,kBAAC,GAAD;MACI,IAAG;MACH,QAAQ,EAAY;MACpB,UAAU,EAAM,gBAAgB;MAChC,eAAe,EAAoB,SAAS;MAE3C,UAAA,EAAM,QAAQ;KACF,CAAA;KAEjB,kBAAC,GAAD;MACI,IAAG;MACH,QAAQ,EAAY;MACpB,UAAU,EAAM,gBAAgB;MAChC,eAAe,EAAoB,WAAW;MAE7C,UAAA,EAAM,QAAQ;KACF,CAAA;KAEjB,kBAAC,GAAD;MACI,IAAG;MACH,QAAQ,EAAY;MACpB,UAAU,EAAM,gBAAgB;MAChC,eAAe,EAAoB,UAAU;MAE5C,UAAA,EAAM,QAAQ;KACF,CAAA;IACR;;EACZ,CAAA;CACI,CAAA;AAErB,GAUM,KAAmB,EAAE,OAAI,WAAQ,aAAU,YAAS,kBAAoC;CAC1F,IAAM,CAAC,GAAS,KAAc,EAAS,EAAK;CAG5C,OACI,kBAAC,UAAD;EACI,gBAAc,0BAA0B;EACxC,oBAAoB,EAAW,EAAI;EACnC,oBAAoB,EAAW,EAAK;EAC3B;EACT,OAAO;GAAE,GARQ,KAAU,EAAO,SAAS,IAAU;IAAE,GAAG;IAAQ,GAAG,EAAO;GAAM,IAAI;GAQ7D,WAAW;GAAG,cAAc;EAAE;EACvD,WACI,IAAW,8EAA8E;EAG5F;CACG,CAAA;AAEhB"}
|
|
@@ -1,104 +1,92 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { isValidUrlOrEmpty as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
state: o,
|
|
89
|
-
onTextChange: s,
|
|
90
|
-
onButtonStyleChange: l,
|
|
91
|
-
onUrlChange: u,
|
|
92
|
-
onToggleTab: i,
|
|
93
|
-
onCancel: y,
|
|
94
|
-
onSave: T,
|
|
95
|
-
hasValues: c,
|
|
96
|
-
isValidUrlOrEmpty: p,
|
|
97
|
-
appBridge: m
|
|
98
|
-
};
|
|
1
|
+
import { floatingButtonActions as e, floatingButtonSelectors as t } from "../floatingButtonStore.es.js";
|
|
2
|
+
import { addHttps as n } from "../../../../../../../helpers/addHttps.es.js";
|
|
3
|
+
import { isValidUrlOrEmpty as r } from "../../../../../../Link/utils/url.es.js";
|
|
4
|
+
import { submitFloatingButton as i } from "../../../transforms/submitFloatingButton.es.js";
|
|
5
|
+
import { getButtonStyle as a } from "../../../utils/getButtonStyle.es.js";
|
|
6
|
+
import { ELEMENT_BUTTON as o } from "../../../createButtonPlugin.es.js";
|
|
7
|
+
import { useEffect as s, useReducer as c } from "react";
|
|
8
|
+
import { getPluginOptions as l, useEditorRef as u, useHotkeys as d } from "@frontify/fondue/rte";
|
|
9
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts
|
|
10
|
+
var f = {
|
|
11
|
+
url: "",
|
|
12
|
+
text: "",
|
|
13
|
+
buttonStyle: "primary",
|
|
14
|
+
newTab: !1
|
|
15
|
+
}, p = () => {
|
|
16
|
+
let [e, t] = c((e, t) => {
|
|
17
|
+
let { type: n, payload: r } = t;
|
|
18
|
+
switch (n) {
|
|
19
|
+
case "NEW_TAB": return {
|
|
20
|
+
...e,
|
|
21
|
+
newTab: !0
|
|
22
|
+
};
|
|
23
|
+
case "SAME_TAB": return {
|
|
24
|
+
...e,
|
|
25
|
+
newTab: !1
|
|
26
|
+
};
|
|
27
|
+
case "URL":
|
|
28
|
+
case "TEXT":
|
|
29
|
+
case "BUTTON_STYLE":
|
|
30
|
+
case "INIT": return {
|
|
31
|
+
...e,
|
|
32
|
+
...r
|
|
33
|
+
};
|
|
34
|
+
default: return e;
|
|
35
|
+
}
|
|
36
|
+
}, f);
|
|
37
|
+
return [e, t];
|
|
38
|
+
}, m = () => {
|
|
39
|
+
let c = u(), [f, m] = p();
|
|
40
|
+
s(() => {
|
|
41
|
+
let e = a(c);
|
|
42
|
+
m({
|
|
43
|
+
type: "INIT",
|
|
44
|
+
payload: {
|
|
45
|
+
text: t.text() || t.url(),
|
|
46
|
+
buttonStyle: e,
|
|
47
|
+
newTab: !!t.newTab(),
|
|
48
|
+
url: t.url()
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}, [m, c]);
|
|
52
|
+
let h = (e) => {
|
|
53
|
+
m({
|
|
54
|
+
type: "TEXT",
|
|
55
|
+
payload: { text: e }
|
|
56
|
+
});
|
|
57
|
+
}, g = (e) => {
|
|
58
|
+
m({
|
|
59
|
+
type: "BUTTON_STYLE",
|
|
60
|
+
payload: { buttonStyle: e }
|
|
61
|
+
});
|
|
62
|
+
}, _ = (e) => {
|
|
63
|
+
m({
|
|
64
|
+
type: "URL",
|
|
65
|
+
payload: { url: e }
|
|
66
|
+
});
|
|
67
|
+
}, v = (e) => {
|
|
68
|
+
m(e ? { type: "NEW_TAB" } : { type: "SAME_TAB" });
|
|
69
|
+
}, y = () => {
|
|
70
|
+
e.reset();
|
|
71
|
+
}, b = (t) => {
|
|
72
|
+
if (!r(f.url) || !x) return;
|
|
73
|
+
let a = n(f.url);
|
|
74
|
+
e.text(f.text), e.url(a), e.buttonStyle(f.buttonStyle), e.newTab(f.newTab), i(c) && t?.preventDefault();
|
|
75
|
+
}, x = f.url !== "" && f.text !== "", { appBridge: S } = l(c, o);
|
|
76
|
+
return d("enter", b, { enableOnFormTags: ["INPUT"] }, []), {
|
|
77
|
+
state: f,
|
|
78
|
+
onTextChange: h,
|
|
79
|
+
onButtonStyleChange: g,
|
|
80
|
+
onUrlChange: _,
|
|
81
|
+
onToggleTab: v,
|
|
82
|
+
onCancel: y,
|
|
83
|
+
onSave: b,
|
|
84
|
+
hasValues: x,
|
|
85
|
+
isValidUrlOrEmpty: r,
|
|
86
|
+
appBridge: S
|
|
87
|
+
};
|
|
99
88
|
};
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
//# sourceMappingURL=useInsertModal.es.js.map
|
|
89
|
+
//#endregion
|
|
90
|
+
export { p as InsertModalState, m as useInsertModal };
|
|
91
|
+
|
|
92
|
+
//# sourceMappingURL=useInsertModal.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInsertModal.es.js","sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport { getPluginOptions, useEditorRef, useHotkeys } from '@frontify/fondue/rte';\nimport { type Dispatch, type Reducer, useEffect, useReducer } from 'react';\n\nimport { addHttps } from '../../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../../../Link/utils/url';\nimport { ELEMENT_BUTTON } from '../../../createButtonPlugin';\nimport { submitFloatingButton } from '../../../transforms/submitFloatingButton';\nimport { type RichTextButtonStyle } from '../../../types';\nimport { getButtonStyle } from '../../../utils/getButtonStyle';\nimport { floatingButtonActions, floatingButtonSelectors } from '../floatingButtonStore';\n\nimport { type InsertModalDispatchType, type InsertModalStateProps } from './types';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n buttonStyle: 'primary',\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 'BUTTON_STYLE':\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 buttonStyle = getButtonStyle(editor);\n\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingButtonSelectors.text() || floatingButtonSelectors.url(),\n buttonStyle,\n newTab: !!floatingButtonSelectors.newTab(),\n url: floatingButtonSelectors.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 onButtonStyleChange = (value: RichTextButtonStyle) => {\n dispatch({\n type: 'BUTTON_STYLE',\n payload: { buttonStyle: 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 floatingButtonActions.reset();\n };\n\n const onSave = (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n const urlToSave = addHttps(state.url);\n\n floatingButtonActions.text(state.text);\n floatingButtonActions.url(urlToSave);\n floatingButtonActions.buttonStyle(state.buttonStyle);\n floatingButtonActions.newTab(state.newTab);\n\n if (submitFloatingButton(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_BUTTON);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return {\n state,\n onTextChange,\n onButtonStyleChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n hasValues,\n isValidUrlOrEmpty,\n appBridge,\n };\n};\n"],"
|
|
1
|
+
{"version":3,"file":"useInsertModal.es.js","names":[],"sources":["../../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport { getPluginOptions, useEditorRef, useHotkeys } from '@frontify/fondue/rte';\nimport { type Dispatch, type Reducer, useEffect, useReducer } from 'react';\n\nimport { addHttps } from '../../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../../../Link/utils/url';\nimport { ELEMENT_BUTTON } from '../../../createButtonPlugin';\nimport { submitFloatingButton } from '../../../transforms/submitFloatingButton';\nimport { type RichTextButtonStyle } from '../../../types';\nimport { getButtonStyle } from '../../../utils/getButtonStyle';\nimport { floatingButtonActions, floatingButtonSelectors } from '../floatingButtonStore';\n\nimport { type InsertModalDispatchType, type InsertModalStateProps } from './types';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n buttonStyle: 'primary',\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 'BUTTON_STYLE':\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 buttonStyle = getButtonStyle(editor);\n\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingButtonSelectors.text() || floatingButtonSelectors.url(),\n buttonStyle,\n newTab: !!floatingButtonSelectors.newTab(),\n url: floatingButtonSelectors.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 onButtonStyleChange = (value: RichTextButtonStyle) => {\n dispatch({\n type: 'BUTTON_STYLE',\n payload: { buttonStyle: 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 floatingButtonActions.reset();\n };\n\n const onSave = (event: React.MouseEvent<HTMLButtonElement, MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n const urlToSave = addHttps(state.url);\n\n floatingButtonActions.text(state.text);\n floatingButtonActions.url(urlToSave);\n floatingButtonActions.buttonStyle(state.buttonStyle);\n floatingButtonActions.newTab(state.newTab);\n\n if (submitFloatingButton(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_BUTTON);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return {\n state,\n onTextChange,\n onButtonStyleChange,\n onUrlChange,\n onToggleTab,\n onCancel,\n onSave,\n hasValues,\n isValidUrlOrEmpty,\n appBridge,\n };\n};\n"],"mappings":";;;;;;;;;AAgBA,IAAM,IAAsC;CACxC,KAAK;CACL,MAAM;CACN,aAAa;CACb,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;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,IAAc,EAAe,CAAM;EAEzC,EAAS;GACL,MAAM;GACN,SAAS;IACL,MAAM,EAAwB,KAAK,KAAK,EAAwB,IAAI;IACpE;IACA,QAAQ,CAAC,CAAC,EAAwB,OAAO;IACzC,KAAK,EAAwB,IAAI;GACrC;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,KAAuB,MAA+B;EACxD,EAAS;GACL,MAAM;GACN,SAAS,EAAE,aAAa,EAAM;EAClC,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,EAAsB,MAAM;CAChC,GAEM,KAAU,MAAuF;EACnG,IAAI,CAAC,EAAkB,EAAM,GAAG,KAAK,CAAC,GAClC;EAGJ,IAAM,IAAY,EAAS,EAAM,GAAG;EAOpC,AALA,EAAsB,KAAK,EAAM,IAAI,GACrC,EAAsB,IAAI,CAAS,GACnC,EAAsB,YAAY,EAAM,WAAW,GACnD,EAAsB,OAAO,EAAM,MAAM,GAErC,EAAqB,CAAM,KAC3B,GAAO,eAAe;CAE9B,GAEM,IAAY,EAAM,QAAQ,MAAM,EAAM,SAAS,IAE/C,EAAE,iBAAc,EAAgD,GAAQ,CAAc;CAW5F,OATA,EACI,SACA,GACA,EACI,kBAAkB,CAAC,OAAO,EAC9B,GACA,CAAC,CACL,GAEO;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACJ;AACJ"}
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import { createStore as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
r as floatingButtonActions,
|
|
28
|
-
d as floatingButtonSelectors,
|
|
29
|
-
e as floatingButtonStore,
|
|
30
|
-
s as useFloatingButtonSelectors
|
|
31
|
-
};
|
|
32
|
-
//# sourceMappingURL=floatingButtonStore.es.js.map
|
|
1
|
+
import { createStore as e } from "@frontify/fondue/rte";
|
|
2
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts
|
|
3
|
+
var t = e("floatingButton")({
|
|
4
|
+
openEditorId: null,
|
|
5
|
+
mouseDown: !1,
|
|
6
|
+
updated: !1,
|
|
7
|
+
url: "",
|
|
8
|
+
text: "",
|
|
9
|
+
buttonStyle: "primary",
|
|
10
|
+
newTab: !1,
|
|
11
|
+
mode: "",
|
|
12
|
+
isEditing: !1
|
|
13
|
+
}).extendActions((e) => ({ reset: () => {
|
|
14
|
+
e.url(""), e.text(""), e.buttonStyle("primary"), e.newTab(!1), e.mode(""), e.isEditing(!1);
|
|
15
|
+
} })).extendActions((e) => ({
|
|
16
|
+
show: (t, n) => {
|
|
17
|
+
e.mode(t), e.isEditing(!1), e.openEditorId(n);
|
|
18
|
+
},
|
|
19
|
+
hide: () => {
|
|
20
|
+
e.reset(), e.openEditorId(null);
|
|
21
|
+
}
|
|
22
|
+
})).extendSelectors((e) => ({ isOpen: (t) => e.openEditorId === t })), n = t.set, r = t.get, i = () => t.use;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { n as floatingButtonActions, r as floatingButtonSelectors, t as floatingButtonStore, i as useFloatingButtonSelectors };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=floatingButtonStore.es.js.map
|