@frontify/guideline-blocks-settings 3.0.2 → 3.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +1 -0
- 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 +6 -8
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type CSSProperties } from 'react';\n\nconst DefaultButtonStyles: CSSProperties = {\n marginTop: '10px',\n marginBottom: '10px',\n display: 'inline-block',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n maxWidth: '100%',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n overflowWrap: 'normal',\n};\n\nexport const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n buttonPrimary: {\n ...DefaultButtonStyles,\n fontFamily: 'var(--f-theme-settings-button-primary-font-family)',\n fontSize: 'var(--f-theme-settings-button-primary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-primary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-primary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-primary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-primary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-primary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-primary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-primary-font-style)',\n textTransform: 'var(--f-theme-settings-button-primary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-primary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-primary-border-width)',\n color: 'var(--f-theme-settings-button-primary-color)',\n\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color-hover)',\n color: 'var(--f-theme-settings-button-primary-color-hover)',\n },\n },\n\n buttonSecondary: {\n ...DefaultButtonStyles,\n fontFamily: 'var(--f-theme-settings-button-secondary-font-family)',\n fontSize: 'var(--f-theme-settings-button-secondary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-secondary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-secondary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-secondary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-secondary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-secondary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-secondary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-secondary-font-style)',\n textTransform: 'var(--f-theme-settings-button-secondary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-secondary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-secondary-border-width)',\n color: 'var(--f-theme-settings-button-secondary-color)',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color-hover)',\n color: 'var(--f-theme-settings-button-secondary-color-hover)',\n },\n },\n\n buttonTertiary: {\n ...DefaultButtonStyles,\n fontFamily: 'var(--f-theme-settings-button-tertiary-font-family)',\n fontSize: 'var(--f-theme-settings-button-tertiary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-tertiary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-tertiary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-tertiary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-tertiary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-tertiary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-tertiary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-tertiary-font-style)',\n textTransform: 'var(--f-theme-settings-button-tertiary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-tertiary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-tertiary-border-width)',\n color: 'var(--f-theme-settings-button-tertiary-color)',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color-hover)',\n color: 'var(--f-theme-settings-button-tertiary-color-hover)',\n },\n },\n};\n"],"
|
|
1
|
+
{"version":3,"file":"styles.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type CSSProperties } from 'react';\n\nconst DefaultButtonStyles: CSSProperties = {\n marginTop: '10px',\n marginBottom: '10px',\n display: 'inline-block',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n maxWidth: '100%',\n verticalAlign: 'middle',\n boxSizing: 'border-box',\n overflowWrap: 'normal',\n};\n\nexport const BlockButtonStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n buttonPrimary: {\n ...DefaultButtonStyles,\n fontFamily: 'var(--f-theme-settings-button-primary-font-family)',\n fontSize: 'var(--f-theme-settings-button-primary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-primary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-primary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-primary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-primary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-primary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-primary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-primary-font-style)',\n textTransform: 'var(--f-theme-settings-button-primary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-primary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-primary-border-width)',\n color: 'var(--f-theme-settings-button-primary-color)',\n\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-primary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-primary-border-color-hover)',\n color: 'var(--f-theme-settings-button-primary-color-hover)',\n },\n },\n\n buttonSecondary: {\n ...DefaultButtonStyles,\n fontFamily: 'var(--f-theme-settings-button-secondary-font-family)',\n fontSize: 'var(--f-theme-settings-button-secondary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-secondary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-secondary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-secondary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-secondary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-secondary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-secondary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-secondary-font-style)',\n textTransform: 'var(--f-theme-settings-button-secondary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-secondary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-secondary-border-width)',\n color: 'var(--f-theme-settings-button-secondary-color)',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-secondary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-secondary-border-color-hover)',\n color: 'var(--f-theme-settings-button-secondary-color-hover)',\n },\n },\n\n buttonTertiary: {\n ...DefaultButtonStyles,\n fontFamily: 'var(--f-theme-settings-button-tertiary-font-family)',\n fontSize: 'var(--f-theme-settings-button-tertiary-font-size)',\n fontWeight: 'var(--f-theme-settings-button-tertiary-font-weight)',\n lineHeight: 'var(--f-theme-settings-button-tertiary-line-height)',\n paddingTop: 'var(--f-theme-settings-button-tertiary-padding-top)',\n paddingRight: 'var(--f-theme-settings-button-tertiary-padding-right)',\n paddingBottom: 'var(--f-theme-settings-button-tertiary-padding-bottom)',\n paddingLeft: 'var(--f-theme-settings-button-tertiary-padding-left)',\n fontStyle: 'var(--f-theme-settings-button-tertiary-font-style)',\n textTransform: 'var(--f-theme-settings-button-tertiary-text-transform)' as CSSProperties['textTransform'],\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color)',\n borderRadius: 'var(--f-theme-settings-button-tertiary-border-radius)',\n borderWidth: 'var(--f-theme-settings-button-tertiary-border-width)',\n color: 'var(--f-theme-settings-button-tertiary-color)',\n hover: {\n backgroundColor: 'var(--f-theme-settings-button-tertiary-background-color-hover)',\n borderColor: 'var(--f-theme-settings-button-tertiary-border-color-hover)',\n color: 'var(--f-theme-settings-button-tertiary-color-hover)',\n },\n },\n};\n"],"mappings":";AAIA,IAAM,IAAqC;CACvC,WAAW;CACX,cAAc;CACd,SAAS;CACT,UAAU;CACV,cAAc;CACd,UAAU;CACV,eAAe;CACf,WAAW;CACX,cAAc;AAClB,GAEa,IAA+E;CACxF,eAAe;EACX,GAAG;EACH,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,eAAe;EACf,aAAa;EACb,WAAW;EACX,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,cAAc;EACd,aAAa;EACb,OAAO;EAEP,OAAO;GACH,iBAAiB;GACjB,aAAa;GACb,OAAO;EACX;CACJ;CAEA,iBAAiB;EACb,GAAG;EACH,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,eAAe;EACf,aAAa;EACb,WAAW;EACX,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,cAAc;EACd,aAAa;EACb,OAAO;EACP,OAAO;GACH,iBAAiB;GACjB,aAAa;GACb,OAAO;EACX;CACJ;CAEA,gBAAgB;EACZ,GAAG;EACH,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,YAAY;EACZ,YAAY;EACZ,cAAc;EACd,eAAe;EACf,aAAa;EACb,WAAW;EACX,eAAe;EACf,iBAAiB;EACjB,aAAa;EACb,cAAc;EACd,aAAa;EACb,OAAO;EACP,OAAO;GACH,iBAAiB;GACjB,aAAa;GACb,OAAO;EACX;CACJ;AACJ"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { floatingButtonSelectors as
|
|
2
|
-
import { triggerFloatingButtonEdit as
|
|
1
|
+
import { floatingButtonSelectors as e } from "../components/FloatingButton/floatingButtonStore.es.js";
|
|
2
|
+
import { triggerFloatingButtonEdit as t } from "./triggerFloatingButtonEdit.es.js";
|
|
3
3
|
import { triggerFloatingButtonInsert as n } from "./triggerFloatingButtonInsert.es.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
n(t, {
|
|
12
|
-
focused: o
|
|
13
|
-
});
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts
|
|
5
|
+
var r = (r, { focused: i } = {}) => {
|
|
6
|
+
if (e.mode() === "edit") {
|
|
7
|
+
t(r);
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
n(r, { focused: i });
|
|
14
11
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=triggerFloatingButton.es.js.map
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as triggerFloatingButton };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=triggerFloatingButton.es.js.map
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggerFloatingButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateEditor, type Value } from '@frontify/fondue/rte';\n\nimport { floatingButtonSelectors } from '../components';\n\nimport { triggerFloatingButtonEdit, triggerFloatingButtonInsert } from '.';\n\nexport const triggerFloatingButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode() === 'edit') {\n triggerFloatingButtonEdit(editor);\n return;\n }\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n};\n"],"
|
|
1
|
+
{"version":3,"file":"triggerFloatingButton.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateEditor, type Value } from '@frontify/fondue/rte';\n\nimport { floatingButtonSelectors } from '../components';\n\nimport { triggerFloatingButtonEdit, triggerFloatingButtonInsert } from '.';\n\nexport const triggerFloatingButton = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode() === 'edit') {\n triggerFloatingButtonEdit(editor);\n return;\n }\n\n triggerFloatingButtonInsert(editor, {\n focused,\n });\n};\n"],"mappings":";;;;AAQA,IAAa,KACT,GACA,EACI,eAGA,CAAC,MACJ;CACD,IAAI,EAAwB,KAAK,MAAM,QAAQ;EAC3C,EAA0B,CAAM;EAChC;CACJ;CAEA,EAA4B,GAAQ,EAChC,WACJ,CAAC;AACL"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const [r, e] = o;
|
|
11
|
-
let n = u(i, e);
|
|
12
|
-
t.url(r.url), t.newTab(r.target === void 0), n === r.url && (n = ""), t.text(n), t.isEditing(!0);
|
|
1
|
+
import { floatingButtonActions as e } from "../components/FloatingButton/floatingButtonStore.es.js";
|
|
2
|
+
import { ELEMENT_BUTTON as t } from "../createButtonPlugin.es.js";
|
|
3
|
+
import { findNode as n, getEditorString as r, getPluginType as i } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts
|
|
5
|
+
var a = (a) => {
|
|
6
|
+
let o = n(a, { match: { type: i(a, t) } });
|
|
7
|
+
if (!o) return;
|
|
8
|
+
let [s, c] = o, l = r(a, c);
|
|
9
|
+
e.url(s.url), e.newTab(s.target === void 0), l === s.url && (l = ""), e.text(l), e.isEditing(!0);
|
|
13
10
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=triggerFloatingButtonEdit.es.js.map
|
|
11
|
+
//#endregion
|
|
12
|
+
export { a as triggerFloatingButtonEdit };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=triggerFloatingButtonEdit.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggerFloatingButtonEdit.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateEditor, type Value, findNode, getEditorString, getPluginType } from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON, type TButtonElement } from '..';\nimport { floatingButtonActions } from '../components/FloatingButton/floatingButtonStore';\n\nexport const triggerFloatingButtonEdit = <V extends Value>(editor: PlateEditor<V>) => {\n const entry = findNode<TButtonElement>(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (!entry) {\n return;\n }\n\n const [link, path] = entry;\n\n let text = getEditorString(editor, path);\n\n floatingButtonActions.url(link.url);\n\n floatingButtonActions.newTab(link.target === undefined);\n\n if (text === link.url) {\n text = '';\n }\n\n floatingButtonActions.text(text);\n\n floatingButtonActions.isEditing(true);\n};\n"],"
|
|
1
|
+
{"version":3,"file":"triggerFloatingButtonEdit.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateEditor, type Value, findNode, getEditorString, getPluginType } from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON, type TButtonElement } from '..';\nimport { floatingButtonActions } from '../components/FloatingButton/floatingButtonStore';\n\nexport const triggerFloatingButtonEdit = <V extends Value>(editor: PlateEditor<V>) => {\n const entry = findNode<TButtonElement>(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (!entry) {\n return;\n }\n\n const [link, path] = entry;\n\n let text = getEditorString(editor, path);\n\n floatingButtonActions.url(link.url);\n\n floatingButtonActions.newTab(link.target === undefined);\n\n if (text === link.url) {\n text = '';\n }\n\n floatingButtonActions.text(text);\n\n floatingButtonActions.isEditing(true);\n};\n"],"mappings":";;;;AAOA,IAAa,KAA8C,MAA2B;CAClF,IAAM,IAAQ,EAAyB,GAAQ,EAC3C,OAAO,EAAE,MAAM,EAAc,GAAQ,CAAc,EAAE,EACzD,CAAC;CACD,IAAI,CAAC,GACD;CAGJ,IAAM,CAAC,GAAM,KAAQ,GAEjB,IAAO,EAAgB,GAAQ,CAAI;CAYvC,AAVA,EAAsB,IAAI,EAAK,GAAG,GAElC,EAAsB,OAAO,EAAK,WAAW,KAAA,CAAS,GAElD,MAAS,EAAK,QACd,IAAO,KAGX,EAAsB,KAAK,CAAI,GAE/B,EAAsB,UAAU,EAAI;AACxC"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
g.mode() || !o || e(t, { at: t.selection }) || r(t, {
|
|
8
|
-
match: { type: s(t, u) }
|
|
9
|
-
}) || (n.text(i(t, t.selection)), n.show("insert", t.id));
|
|
1
|
+
import { floatingButtonActions as e, floatingButtonSelectors as t } from "../components/FloatingButton/floatingButtonStore.es.js";
|
|
2
|
+
import "../createButtonPlugin.es.js";
|
|
3
|
+
import { getEditorString as n, getPluginType as r, isRangeAcrossBlocks as i, someNode as a } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts
|
|
5
|
+
var o = (o, { focused: s } = {}) => {
|
|
6
|
+
t.mode() || s && (i(o, { at: o.selection }) || a(o, { match: { type: r(o, "button") } }) || (e.text(n(o, o.selection)), e.show("insert", o.id)));
|
|
10
7
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//# sourceMappingURL=triggerFloatingButtonInsert.es.js.map
|
|
8
|
+
//#endregion
|
|
9
|
+
export { o as triggerFloatingButtonInsert };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=triggerFloatingButtonInsert.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triggerFloatingButtonInsert.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PlateEditor,\n type Value,\n getEditorString,\n getPluginType,\n isRangeAcrossBlocks,\n someNode,\n} from '@frontify/fondue/rte';\n\nimport { floatingButtonActions, floatingButtonSelectors } from '../components/FloatingButton/floatingButtonStore';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Trigger floating button.\n *\n * Do not trigger when:\n * - selection is across blocks\n * - selection has more than one leaf node\n * - lowest selection is not text\n * - selection has a button node\n */\nexport const triggerFloatingButtonInsert = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode()) {\n return;\n }\n\n if (!focused) {\n return;\n }\n\n if (isRangeAcrossBlocks(editor, { at: editor.selection })) {\n return;\n }\n\n const hasButton = someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (hasButton) {\n return;\n }\n floatingButtonActions.text(getEditorString(editor, editor.selection));\n floatingButtonActions.show('insert', editor.id);\n};\n"],"
|
|
1
|
+
{"version":3,"file":"triggerFloatingButtonInsert.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PlateEditor,\n type Value,\n getEditorString,\n getPluginType,\n isRangeAcrossBlocks,\n someNode,\n} from '@frontify/fondue/rte';\n\nimport { floatingButtonActions, floatingButtonSelectors } from '../components/FloatingButton/floatingButtonStore';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\n/**\n * Trigger floating button.\n *\n * Do not trigger when:\n * - selection is across blocks\n * - selection has more than one leaf node\n * - lowest selection is not text\n * - selection has a button node\n */\nexport const triggerFloatingButtonInsert = <V extends Value>(\n editor: PlateEditor<V>,\n {\n focused,\n }: {\n focused?: boolean;\n } = {},\n) => {\n if (floatingButtonSelectors.mode()) {\n return;\n }\n\n if (!focused) {\n return;\n }\n\n if (isRangeAcrossBlocks(editor, { at: editor.selection })) {\n return;\n }\n\n const hasButton = someNode(editor, {\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n if (hasButton) {\n return;\n }\n floatingButtonActions.text(getEditorString(editor, editor.selection));\n floatingButtonActions.show('insert', editor.id);\n};\n"],"mappings":";;;;AAuBA,IAAa,KACT,GACA,EACI,eAGA,CAAC,MACJ;CACG,EAAwB,KAAK,KAI5B,MAID,EAAoB,GAAQ,EAAE,IAAI,EAAO,UAAU,CAAC,KAItC,EAAS,GAAQ,EAC/B,OAAO,EAAE,MAAM,EAAc,GAAA,QAAsB,EAAE,EACzD,CACI,MAGJ,EAAsB,KAAK,EAAgB,GAAQ,EAAO,SAAS,CAAC,GACpE,EAAsB,KAAK,UAAU,EAAO,EAAE;AAClD"}
|
|
@@ -1,52 +1,46 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, r(
|
|
43
|
-
t,
|
|
44
|
-
w({
|
|
45
|
-
options: { types: N }
|
|
46
|
-
})
|
|
47
|
-
);
|
|
1
|
+
import { ELEMENT_BUTTON as e } from "./createButtonPlugin.es.js";
|
|
2
|
+
import { Path as t, getAboveNode as n, getNextNodeStartPoint as r, getPluginType as i, getPreviousNodeEndPoint as a, insertNodes as o, isCollapsed as s, isEndPoint as c, isStartPoint as l, mockPlugin as u, select as d, withRemoveEmptyNodes as f } from "@frontify/fondue/rte";
|
|
3
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts
|
|
4
|
+
var p = (p, { type: m }) => {
|
|
5
|
+
let { apply: h, normalizeNode: g } = p;
|
|
6
|
+
return p.apply = (t) => {
|
|
7
|
+
if (t.type !== "set_selection") {
|
|
8
|
+
h(t);
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
let o = t.newProperties;
|
|
12
|
+
if (!o?.focus || !o.anchor || !s(o)) {
|
|
13
|
+
h(t);
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
let u = n(p, {
|
|
17
|
+
at: o,
|
|
18
|
+
match: { type: i(p, e) }
|
|
19
|
+
});
|
|
20
|
+
if (u) {
|
|
21
|
+
let [, e] = u, n;
|
|
22
|
+
l(p, o.focus, e) && (n = a(p, e)), c(p, o.focus, e) && (n = r(p, e)), n && (t.newProperties = {
|
|
23
|
+
anchor: n,
|
|
24
|
+
focus: n
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
h(t);
|
|
28
|
+
}, p.normalizeNode = ([e, n]) => {
|
|
29
|
+
if (e.type === i(p, "button")) {
|
|
30
|
+
let e = p.selection;
|
|
31
|
+
if (e && s(e) && c(p, e.focus, n)) {
|
|
32
|
+
let e = r(p, n);
|
|
33
|
+
if (e) d(p, e);
|
|
34
|
+
else {
|
|
35
|
+
let e = t.next(n);
|
|
36
|
+
o(p, { text: "" }, { at: e }), d(p, e);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
g([e, n]);
|
|
41
|
+
}, f(p, u({ options: { types: m } }));
|
|
48
42
|
};
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//# sourceMappingURL=withButton.es.js.map
|
|
43
|
+
//#endregion
|
|
44
|
+
export { p as withButton };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=withButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withButton.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type EText,\n Path,\n type PlateEditor,\n type Point,\n type Range,\n type Value,\n type WithOverride,\n getAboveNode,\n getNextNodeStartPoint,\n getPluginType,\n getPreviousNodeEndPoint,\n insertNodes,\n isCollapsed,\n isEndPoint,\n isStartPoint,\n mockPlugin,\n select,\n withRemoveEmptyNodes,\n} from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON } from './createButtonPlugin';\n\n/**\n * Insert space after a url to wrap a button.\n * Lookup from the block start to the cursor to check if there is an url.\n * If not found, lookup before the cursor for a space character to check the url.\n *\n * On insert data:\n * Paste a string inside a button element will edit its children text but not its url.\n *\n */\n\nexport const withButton: WithOverride = (editor, { type }) => {\n const { apply, normalizeNode } = editor;\n\n editor.apply = (operation) => {\n if (operation.type !== 'set_selection') {\n apply(operation);\n return;\n }\n\n const range = operation.newProperties;\n if (!range?.focus || !range.anchor || !isCollapsed(range as Range)) {\n apply(operation);\n return;\n }\n\n const entry = getAboveNode(editor, {\n at: range as Range,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (entry) {\n const [, path] = entry;\n\n let newPoint: Point | undefined;\n\n if (isStartPoint(editor, range.focus, path)) {\n newPoint = getPreviousNodeEndPoint(editor, path);\n }\n\n if (isEndPoint(editor, range.focus, path)) {\n newPoint = getNextNodeStartPoint(editor, path);\n }\n\n if (newPoint) {\n operation.newProperties = {\n anchor: newPoint,\n focus: newPoint,\n };\n }\n }\n\n apply(operation);\n };\n\n editor.normalizeNode = ([node, path]) => {\n if (node.type === getPluginType(editor, ELEMENT_BUTTON)) {\n const range = editor.selection as Range | null;\n\n if (range && isCollapsed(range) && isEndPoint(editor, range.focus, path)) {\n const nextPoint = getNextNodeStartPoint(editor, path);\n\n // select next text node if any\n if (nextPoint) {\n select(editor, nextPoint);\n } else {\n // insert text node then select\n const nextPath = Path.next(path);\n insertNodes(editor, { text: '' } as EText<Value>, { at: nextPath });\n select(editor, nextPath);\n }\n }\n }\n\n normalizeNode([node, path]);\n };\n\n return withRemoveEmptyNodes<Value, PlateEditor<Value>>(\n editor,\n mockPlugin<Record<string, any>, Value, PlateEditor<Value>>({\n options: { types: type },\n }),\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"withButton.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type EText,\n Path,\n type PlateEditor,\n type Point,\n type Range,\n type Value,\n type WithOverride,\n getAboveNode,\n getNextNodeStartPoint,\n getPluginType,\n getPreviousNodeEndPoint,\n insertNodes,\n isCollapsed,\n isEndPoint,\n isStartPoint,\n mockPlugin,\n select,\n withRemoveEmptyNodes,\n} from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON } from './createButtonPlugin';\n\n/**\n * Insert space after a url to wrap a button.\n * Lookup from the block start to the cursor to check if there is an url.\n * If not found, lookup before the cursor for a space character to check the url.\n *\n * On insert data:\n * Paste a string inside a button element will edit its children text but not its url.\n *\n */\n\nexport const withButton: WithOverride = (editor, { type }) => {\n const { apply, normalizeNode } = editor;\n\n editor.apply = (operation) => {\n if (operation.type !== 'set_selection') {\n apply(operation);\n return;\n }\n\n const range = operation.newProperties;\n if (!range?.focus || !range.anchor || !isCollapsed(range as Range)) {\n apply(operation);\n return;\n }\n\n const entry = getAboveNode(editor, {\n at: range as Range,\n match: { type: getPluginType(editor, ELEMENT_BUTTON) },\n });\n\n if (entry) {\n const [, path] = entry;\n\n let newPoint: Point | undefined;\n\n if (isStartPoint(editor, range.focus, path)) {\n newPoint = getPreviousNodeEndPoint(editor, path);\n }\n\n if (isEndPoint(editor, range.focus, path)) {\n newPoint = getNextNodeStartPoint(editor, path);\n }\n\n if (newPoint) {\n operation.newProperties = {\n anchor: newPoint,\n focus: newPoint,\n };\n }\n }\n\n apply(operation);\n };\n\n editor.normalizeNode = ([node, path]) => {\n if (node.type === getPluginType(editor, ELEMENT_BUTTON)) {\n const range = editor.selection as Range | null;\n\n if (range && isCollapsed(range) && isEndPoint(editor, range.focus, path)) {\n const nextPoint = getNextNodeStartPoint(editor, path);\n\n // select next text node if any\n if (nextPoint) {\n select(editor, nextPoint);\n } else {\n // insert text node then select\n const nextPath = Path.next(path);\n insertNodes(editor, { text: '' } as EText<Value>, { at: nextPath });\n select(editor, nextPath);\n }\n }\n }\n\n normalizeNode([node, path]);\n };\n\n return withRemoveEmptyNodes<Value, PlateEditor<Value>>(\n editor,\n mockPlugin<Record<string, any>, Value, PlateEditor<Value>>({\n options: { types: type },\n }),\n );\n};\n"],"mappings":";;;AAmCA,IAAa,KAA4B,GAAQ,EAAE,cAAW;CAC1D,IAAM,EAAE,UAAO,qBAAkB;CAiEjC,OA/DA,EAAO,SAAS,MAAc;EAC1B,IAAI,EAAU,SAAS,iBAAiB;GACpC,EAAM,CAAS;GACf;EACJ;EAEA,IAAM,IAAQ,EAAU;EACxB,IAAI,CAAC,GAAO,SAAS,CAAC,EAAM,UAAU,CAAC,EAAY,CAAc,GAAG;GAChE,EAAM,CAAS;GACf;EACJ;EAEA,IAAM,IAAQ,EAAa,GAAQ;GAC/B,IAAI;GACJ,OAAO,EAAE,MAAM,EAAc,GAAQ,CAAc,EAAE;EACzD,CAAC;EAED,IAAI,GAAO;GACP,IAAM,GAAG,KAAQ,GAEb;GAUJ,AARI,EAAa,GAAQ,EAAM,OAAO,CAAI,MACtC,IAAW,EAAwB,GAAQ,CAAI,IAG/C,EAAW,GAAQ,EAAM,OAAO,CAAI,MACpC,IAAW,EAAsB,GAAQ,CAAI,IAG7C,MACA,EAAU,gBAAgB;IACtB,QAAQ;IACR,OAAO;GACX;EAER;EAEA,EAAM,CAAS;CACnB,GAEA,EAAO,iBAAiB,CAAC,GAAM,OAAU;EACrC,IAAI,EAAK,SAAS,EAAc,GAAA,QAAsB,GAAG;GACrD,IAAM,IAAQ,EAAO;GAErB,IAAI,KAAS,EAAY,CAAK,KAAK,EAAW,GAAQ,EAAM,OAAO,CAAI,GAAG;IACtE,IAAM,IAAY,EAAsB,GAAQ,CAAI;IAGpD,IAAI,GACA,EAAO,GAAQ,CAAS;SACrB;KAEH,IAAM,IAAW,EAAK,KAAK,CAAI;KAE/B,AADA,EAAY,GAAQ,EAAE,MAAM,GAAG,GAAmB,EAAE,IAAI,EAAS,CAAC,GAClE,EAAO,GAAQ,CAAQ;IAC3B;GACJ;EACJ;EAEA,EAAc,CAAC,GAAM,CAAI,CAAC;CAC9B,GAEO,EACH,GACA,EAA2D,EACvD,SAAS,EAAE,OAAO,EAAK,EAC3B,CAAC,CACL;AACJ"}
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
export {
|
|
19
|
-
i as BreakAfterPlugin,
|
|
20
|
-
l as GAP_DEFAULT,
|
|
21
|
-
m as KEY_ELEMENT_BREAK_AFTER_COLUMN
|
|
1
|
+
import { getResponsiveColumnClasses as e } from "./helpers.es.js";
|
|
2
|
+
import { ColumnBreakButton as t, Plugin as n, createColumnBreakPlugin as r } from "@frontify/fondue/rte";
|
|
3
|
+
//#region src/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.ts
|
|
4
|
+
var i = "breakAfterColumn", a = "normal", o = class extends n {
|
|
5
|
+
columns;
|
|
6
|
+
gap;
|
|
7
|
+
customClass;
|
|
8
|
+
constructor(n) {
|
|
9
|
+
super("break-after-plugin", {
|
|
10
|
+
button: t,
|
|
11
|
+
...n
|
|
12
|
+
}), this.columns = n?.columns ?? 1, this.gap = n?.gap ?? "normal", this.customClass = e(this.columns);
|
|
13
|
+
}
|
|
14
|
+
plugins() {
|
|
15
|
+
return [r(this.columns, this.gap, this.customClass)];
|
|
16
|
+
}
|
|
22
17
|
};
|
|
23
|
-
//#
|
|
18
|
+
//#endregion
|
|
19
|
+
export { o as BreakAfterPlugin, a as GAP_DEFAULT, i as KEY_ELEMENT_BREAK_AFTER_COLUMN };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=ColumnBreakPlugin.es.js.map
|
package/dist/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnBreakPlugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlatePlugin, Plugin, createColumnBreakPlugin, ColumnBreakButton } from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { getResponsiveColumnClasses } from './helpers';\n\nexport const KEY_ELEMENT_BREAK_AFTER_COLUMN = 'breakAfterColumn';\nexport const GAP_DEFAULT = 'normal';\n\nexport class BreakAfterPlugin extends Plugin {\n private columns: number;\n private gap: CSSProperties['gap'];\n private customClass: string | undefined;\n constructor(props?: { columns?: number; gap?: string | number }) {\n super('break-after-plugin', {\n button: ColumnBreakButton,\n ...props,\n });\n this.columns = props?.columns ?? 1;\n this.gap = props?.gap ?? GAP_DEFAULT;\n this.customClass = getResponsiveColumnClasses(this.columns);\n }\n\n plugins(): PlatePlugin[] {\n return [createColumnBreakPlugin(this.columns, this.gap, this.customClass)];\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"ColumnBreakPlugin.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/ColumnBreakPlugin/ColumnBreakPlugin.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlatePlugin, Plugin, createColumnBreakPlugin, ColumnBreakButton } from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { getResponsiveColumnClasses } from './helpers';\n\nexport const KEY_ELEMENT_BREAK_AFTER_COLUMN = 'breakAfterColumn';\nexport const GAP_DEFAULT = 'normal';\n\nexport class BreakAfterPlugin extends Plugin {\n private columns: number;\n private gap: CSSProperties['gap'];\n private customClass: string | undefined;\n constructor(props?: { columns?: number; gap?: string | number }) {\n super('break-after-plugin', {\n button: ColumnBreakButton,\n ...props,\n });\n this.columns = props?.columns ?? 1;\n this.gap = props?.gap ?? GAP_DEFAULT;\n this.customClass = getResponsiveColumnClasses(this.columns);\n }\n\n plugins(): PlatePlugin[] {\n return [createColumnBreakPlugin(this.columns, this.gap, this.customClass)];\n }\n}\n"],"mappings":";;;AAOA,IAAa,IAAiC,oBACjC,IAAc,UAEd,IAAb,cAAsC,EAAO;CACzC;CACA;CACA;CACA,YAAY,GAAqD;EAO7D,AANA,MAAM,sBAAsB;GACxB,QAAQ;GACR,GAAG;EACP,CAAC,GACD,KAAK,UAAU,GAAO,WAAW,GACjC,KAAK,MAAM,GAAO,OAAA,UAClB,KAAK,cAAc,EAA2B,KAAK,OAAO;CAC9D;CAEA,UAAyB;EACrB,OAAO,CAAC,EAAwB,KAAK,SAAS,KAAK,KAAK,KAAK,WAAW,CAAC;CAC7E;AACJ"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=helpers.es.js.map
|
|
1
|
+
//#region src/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.ts
|
|
2
|
+
var e = "[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @md:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @md:[&_.tw-break-after-column]:!tw-break-after-column @md:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column", t = {
|
|
3
|
+
1: "tw-columns-1",
|
|
4
|
+
2: "tw-columns-1 @sm:!tw-columns-2 [&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @sm:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @sm:[&_.tw-break-after-column]:!tw-break-after-column @sm:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column",
|
|
5
|
+
3: `tw-columns-1 @md:!tw-columns-3 ${e}`,
|
|
6
|
+
4: `tw-columns-1 @md:!tw-columns-4 ${e}`,
|
|
7
|
+
5: `tw-columns-1 @md:!tw-columns-5 ${e}`
|
|
8
|
+
}, n = (e) => e ? t[e] || t[1] : "";
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as columnClassMap, n as getResponsiveColumnClasses };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=helpers.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\n/**\n * As container queries lack a selector like @max-sm, as a workaround\n * the class is disabled by default and reenabled on bigger container sizes\n */\nconst columnBreakDisablingClassUnderMd =\n '[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @md:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @md:[&_.tw-break-after-column]:!tw-break-after-column @md:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column';\n\nconst columnBreakDisablingClassUnderSm =\n '[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @sm:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @sm:[&_.tw-break-after-column]:!tw-break-after-column @sm:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column';\n\nexport const columnClassMap = {\n 1: 'tw-columns-1',\n 2: `tw-columns-1 @sm:!tw-columns-2 ${columnBreakDisablingClassUnderSm}`,\n 3: `tw-columns-1 @md:!tw-columns-3 ${columnBreakDisablingClassUnderMd}`,\n 4: `tw-columns-1 @md:!tw-columns-4 ${columnBreakDisablingClassUnderMd}`,\n 5: `tw-columns-1 @md:!tw-columns-5 ${columnBreakDisablingClassUnderMd}`,\n};\n\nexport const getResponsiveColumnClasses = (columnCount?: number) => {\n if (!columnCount) {\n return '';\n }\n\n return columnClassMap[columnCount as keyof typeof columnClassMap] || columnClassMap[1];\n};\n"],"
|
|
1
|
+
{"version":3,"file":"helpers.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/ColumnBreakPlugin/helpers.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\n/**\n * As container queries lack a selector like @max-sm, as a workaround\n * the class is disabled by default and reenabled on bigger container sizes\n */\nconst columnBreakDisablingClassUnderMd =\n '[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @md:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @md:[&_.tw-break-after-column]:!tw-break-after-column @md:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column';\n\nconst columnBreakDisablingClassUnderSm =\n '[&_.tw-break-after-column]:tw-break-after-auto [&_.tw-break-inside-avoid-column]:tw-break-inside-auto [&_.tw-break-after-column.tw-pb-5]:tw-pb-0 @sm:[&_.tw-break-after-column.tw-pb-5]:!tw-pb-5 @sm:[&_.tw-break-after-column]:!tw-break-after-column @sm:[&_.tw-break-inside-avoid-column]:!tw-break-inside-avoid-column';\n\nexport const columnClassMap = {\n 1: 'tw-columns-1',\n 2: `tw-columns-1 @sm:!tw-columns-2 ${columnBreakDisablingClassUnderSm}`,\n 3: `tw-columns-1 @md:!tw-columns-3 ${columnBreakDisablingClassUnderMd}`,\n 4: `tw-columns-1 @md:!tw-columns-4 ${columnBreakDisablingClassUnderMd}`,\n 5: `tw-columns-1 @md:!tw-columns-5 ${columnBreakDisablingClassUnderMd}`,\n};\n\nexport const getResponsiveColumnClasses = (columnCount?: number) => {\n if (!columnCount) {\n return '';\n }\n\n return columnClassMap[columnCount as keyof typeof columnClassMap] || columnClassMap[1];\n};\n"],"mappings":";AAMA,IAAM,IACF,8TAKS,IAAiB;CAC1B,GAAG;CACH,GAAG;CACH,GAAG,kCAAkC;CACrC,GAAG,kCAAkC;CACrC,GAAG,kCAAkC;AACzC,GAEa,KAA8B,MAClC,IAIE,EAAe,MAA+C,EAAe,KAHzE"}
|
package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js
CHANGED
|
@@ -1,58 +1,49 @@
|
|
|
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
|
-
ref: u,
|
|
46
|
-
...i,
|
|
47
|
-
style: { ...i.style, ...d[a.p] },
|
|
48
|
-
children: y
|
|
49
|
-
}
|
|
50
|
-
),
|
|
51
|
-
document.body
|
|
52
|
-
)
|
|
53
|
-
] });
|
|
1
|
+
import { BlockStyles as e, TextStyles as t } from "../../styles.es.js";
|
|
2
|
+
import { EditModal as n } from "./EditLinkModal/EditModal.es.js";
|
|
3
|
+
import { InsertLinkModal as r } from "./InsertLinkModal/InsertLinkModal.es.js";
|
|
4
|
+
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { flip as s, offset as c, useFloatingLinkEdit as l, useFloatingLinkEditState as u, useFloatingLinkInsert as d, useFloatingLinkInsertState as f } from "@frontify/fondue/rte";
|
|
6
|
+
import { createPortal as p } from "react-dom";
|
|
7
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx
|
|
8
|
+
var m = {
|
|
9
|
+
placement: "bottom-start",
|
|
10
|
+
strategy: "absolute",
|
|
11
|
+
middleware: [c(12), s({
|
|
12
|
+
padding: 12,
|
|
13
|
+
fallbackPlacements: [
|
|
14
|
+
"bottom-end",
|
|
15
|
+
"top-start",
|
|
16
|
+
"top-end"
|
|
17
|
+
]
|
|
18
|
+
})]
|
|
19
|
+
}, h = () => {
|
|
20
|
+
let s = f({ floatingOptions: m }), { props: c, ref: h, hidden: g } = d(s), _ = u({ floatingOptions: m }), { props: v, ref: y, editButtonProps: b, unlinkButtonProps: x } = l(_);
|
|
21
|
+
if (g) return null;
|
|
22
|
+
let S = /* @__PURE__ */ a(r, {}), C = _.isEditing ? S : /* @__PURE__ */ a(n, {
|
|
23
|
+
editButtonProps: b,
|
|
24
|
+
unlinkButtonProps: x
|
|
25
|
+
});
|
|
26
|
+
return /* @__PURE__ */ o(i, { children: [s.isOpen && !_.isOpen && p(/* @__PURE__ */ a("div", {
|
|
27
|
+
"data-is-underlay": !0,
|
|
28
|
+
ref: h,
|
|
29
|
+
...c,
|
|
30
|
+
style: {
|
|
31
|
+
...c.style,
|
|
32
|
+
...e[t.p]
|
|
33
|
+
},
|
|
34
|
+
children: S
|
|
35
|
+
}), document.body), _.isOpen && p(/* @__PURE__ */ a("div", {
|
|
36
|
+
"data-is-underlay": !0,
|
|
37
|
+
ref: y,
|
|
38
|
+
...v,
|
|
39
|
+
style: {
|
|
40
|
+
...v.style,
|
|
41
|
+
...e[t.p]
|
|
42
|
+
},
|
|
43
|
+
children: C
|
|
44
|
+
}), document.body)] });
|
|
54
45
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
//# sourceMappingURL=CustomFloatingLink.es.js.map
|
|
46
|
+
//#endregion
|
|
47
|
+
export { h as CustomFloatingLink };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=CustomFloatingLink.es.js.map
|
package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFloatingLink.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type LinkFloatingToolbarState,\n type UseVirtualFloatingOptions,\n flip,\n offset,\n useFloatingLinkEdit,\n useFloatingLinkEditState,\n useFloatingLinkInsert,\n useFloatingLinkInsertState,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { BlockStyles, TextStyles } from '../../../../RichTextEditor/plugins/styles';\n\nimport { EditModal } from './EditLinkModal';\nimport { InsertLinkModal } from './InsertLinkModal/InsertLinkModal';\n\nconst floatingOptions: UseVirtualFloatingOptions = {\n placement: 'bottom-start',\n strategy: 'absolute',\n middleware: [\n offset(12),\n flip({\n padding: 12,\n fallbackPlacements: ['bottom-end', 'top-start', 'top-end'],\n }),\n ],\n};\n\nexport type LinkFloatingToolbarProps = {\n state?: LinkFloatingToolbarState;\n};\n\nexport const CustomFloatingLink = () => {\n const insertState = useFloatingLinkInsertState({\n floatingOptions,\n });\n const { props: insertProps, ref: insertRef, hidden } = useFloatingLinkInsert(insertState);\n\n const editState = useFloatingLinkEditState({\n floatingOptions,\n });\n\n const { props: editProps, ref: editRef, editButtonProps, unlinkButtonProps } = useFloatingLinkEdit(editState);\n\n if (hidden) {\n return null;\n }\n\n const input = <InsertLinkModal />;\n const editContent = editState.isEditing ? (\n input\n ) : (\n <EditModal editButtonProps={editButtonProps} unlinkButtonProps={unlinkButtonProps} />\n );\n\n return (\n <>\n {insertState.isOpen &&\n !editState.isOpen &&\n createPortal(\n <div\n data-is-underlay\n ref={insertRef}\n {...insertProps}\n style={{ ...(insertProps.style as CSSProperties), ...BlockStyles[TextStyles.p] }}\n >\n {input}\n </div>,\n document.body,\n )}\n\n {editState.isOpen &&\n createPortal(\n <div\n data-is-underlay\n ref={editRef}\n {...editProps}\n style={{ ...(editProps.style as CSSProperties), ...BlockStyles[TextStyles.p] }}\n >\n {editContent}\n </div>,\n document.body,\n )}\n </>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"CustomFloatingLink.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type LinkFloatingToolbarState,\n type UseVirtualFloatingOptions,\n flip,\n offset,\n useFloatingLinkEdit,\n useFloatingLinkEditState,\n useFloatingLinkInsert,\n useFloatingLinkInsertState,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { BlockStyles, TextStyles } from '../../../../RichTextEditor/plugins/styles';\n\nimport { EditModal } from './EditLinkModal';\nimport { InsertLinkModal } from './InsertLinkModal/InsertLinkModal';\n\nconst floatingOptions: UseVirtualFloatingOptions = {\n placement: 'bottom-start',\n strategy: 'absolute',\n middleware: [\n offset(12),\n flip({\n padding: 12,\n fallbackPlacements: ['bottom-end', 'top-start', 'top-end'],\n }),\n ],\n};\n\nexport type LinkFloatingToolbarProps = {\n state?: LinkFloatingToolbarState;\n};\n\nexport const CustomFloatingLink = () => {\n const insertState = useFloatingLinkInsertState({\n floatingOptions,\n });\n const { props: insertProps, ref: insertRef, hidden } = useFloatingLinkInsert(insertState);\n\n const editState = useFloatingLinkEditState({\n floatingOptions,\n });\n\n const { props: editProps, ref: editRef, editButtonProps, unlinkButtonProps } = useFloatingLinkEdit(editState);\n\n if (hidden) {\n return null;\n }\n\n const input = <InsertLinkModal />;\n const editContent = editState.isEditing ? (\n input\n ) : (\n <EditModal editButtonProps={editButtonProps} unlinkButtonProps={unlinkButtonProps} />\n );\n\n return (\n <>\n {insertState.isOpen &&\n !editState.isOpen &&\n createPortal(\n <div\n data-is-underlay\n ref={insertRef}\n {...insertProps}\n style={{ ...(insertProps.style as CSSProperties), ...BlockStyles[TextStyles.p] }}\n >\n {input}\n </div>,\n document.body,\n )}\n\n {editState.isOpen &&\n createPortal(\n <div\n data-is-underlay\n ref={editRef}\n {...editProps}\n style={{ ...(editProps.style as CSSProperties), ...BlockStyles[TextStyles.p] }}\n >\n {editContent}\n </div>,\n document.body,\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;AAoBA,IAAM,IAA6C;CAC/C,WAAW;CACX,UAAU;CACV,YAAY,CACR,EAAO,EAAE,GACT,EAAK;EACD,SAAS;EACT,oBAAoB;GAAC;GAAc;GAAa;EAAS;CAC7D,CAAC,CACL;AACJ,GAMa,UAA2B;CACpC,IAAM,IAAc,EAA2B,EAC3C,mBACJ,CAAC,GACK,EAAE,OAAO,GAAa,KAAK,GAAW,cAAW,EAAsB,CAAW,GAElF,IAAY,EAAyB,EACvC,mBACJ,CAAC,GAEK,EAAE,OAAO,GAAW,KAAK,GAAS,oBAAiB,yBAAsB,EAAoB,CAAS;CAE5G,IAAI,GACA,OAAO;CAGX,IAAM,IAAQ,kBAAC,GAAD,CAAkB,CAAA,GAC1B,IAAc,EAAU,YAC1B,IAEA,kBAAC,GAAD;EAA4B;EAAoC;CAAoB,CAAA;CAGxF,OACI,kBAAA,GAAA,EAAA,UAAA,CACK,EAAY,UACT,CAAC,EAAU,UACX,EACI,kBAAC,OAAD;EACI,oBAAA;EACA,KAAK;EACL,GAAI;EACJ,OAAO;GAAE,GAAI,EAAY;GAAyB,GAAG,EAAY,EAAW;EAAG;EAE9E,UAAA;CACA,CAAA,GACL,SAAS,IACb,GAEH,EAAU,UACP,EACI,kBAAC,OAAD;EACI,oBAAA;EACA,KAAK;EACL,GAAI;EACJ,OAAO;GAAE,GAAI,EAAU;GAAyB,GAAG,EAAY,EAAW;EAAG;EAE5E,UAAA;CACA,CAAA,GACL,SAAS,IACb,CACN,EAAA,CAAA;AAEV"}
|