@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichTextEditor.es.js","sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { RichTextEditor as FondueRichTextEditor } from '@frontify/fondue/rte';\nimport { memo, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nimport { useIsInViewport } from '../../hooks/useIsInViewport';\n\nimport { floatingButtonActions, floatingButtonSelectors } from './plugins/ButtonPlugin/components';\nimport { getResponsiveColumnClasses } from './plugins/ColumnBreakPlugin/helpers';\nimport { SerializedText } from './SerializedText';\nimport { type RichTextEditorProps } from './types';\n\nconst handleHideExternalFloatingModals = (editorId: string) => {\n if (floatingButtonSelectors.isOpen(editorId)) {\n floatingButtonActions.reset();\n }\n};\n\nconst InternalRichTextEditor = memo(\n ({\n isEnabled,\n value,\n columns,\n gap,\n placeholder,\n plugins,\n onTextChange,\n showSerializedText,\n }: Omit<RichTextEditorProps, 'isEditing'> & { isEnabled: boolean }) => {\n const customClass = getResponsiveColumnClasses(columns);\n const [shouldPreventPageLeave, setShouldPreventPageLeave] = useState(false);\n const editorId = useId();\n\n const handleTextChange = useCallback(\n (newContent: string) => {\n if (newContent !== value) {\n onTextChange?.(newContent);\n }\n setShouldPreventPageLeave(false);\n },\n [onTextChange, value],\n );\n\n const handleValueChange = useCallback(() => setShouldPreventPageLeave(true), []);\n\n useEffect(() => {\n const unloadHandler = (event: BeforeUnloadEvent) => {\n event.preventDefault();\n event.returnValue = 'Unprocessed changes';\n };\n\n if (shouldPreventPageLeave) {\n window.addEventListener('beforeunload', unloadHandler);\n }\n\n return () => window.removeEventListener('beforeunload', unloadHandler);\n }, [shouldPreventPageLeave]);\n\n if (isEnabled) {\n return (\n <FondueRichTextEditor\n id={editorId}\n value={value}\n border={false}\n placeholder={placeholder}\n plugins={plugins}\n onValueChanged={handleValueChange}\n onTextChange={handleTextChange}\n hideExternalFloatingModals={handleHideExternalFloatingModals}\n placeholderOpacity=\"high\"\n />\n );\n }\n return (\n <SerializedText\n value={value}\n gap={gap}\n customClass={customClass}\n show={showSerializedText}\n plugins={plugins}\n />\n );\n },\n);\nInternalRichTextEditor.displayName = 'InternalRichTextEditor';\n\nexport const RichTextEditor = (props: RichTextEditorProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const [hasEnteredViewport, setHasEnteredViewport] = useState(false);\n\n const { isEditing, ...internalRteProps } = props;\n\n const onViewportVisibilityChange = useCallback((isInViewport: boolean) => {\n if (isInViewport) {\n setHasEnteredViewport(true);\n }\n }, []);\n\n useIsInViewport({ ref, disabled: !isEditing, onChange: onViewportVisibilityChange });\n\n useEffect(() => {\n if (!isEditing) {\n // oxlint-disable-next-line @eslint-react/set-state-in-effect\n setHasEnteredViewport(false);\n }\n }, [isEditing]);\n\n return (\n <div data-test-id=\"rich-text-editor-container\" className=\"tw-block tw-w-full tw-@container\" ref={ref}>\n <InternalRichTextEditor {...internalRteProps} isEnabled={isEditing && hasEnteredViewport} />\n </div>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"RichTextEditor.es.js","names":[],"sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { RichTextEditor as FondueRichTextEditor } from '@frontify/fondue/rte';\nimport { memo, useCallback, useEffect, useId, useRef, useState } from 'react';\n\nimport { useIsInViewport } from '../../hooks/useIsInViewport';\n\nimport { floatingButtonActions, floatingButtonSelectors } from './plugins/ButtonPlugin/components';\nimport { getResponsiveColumnClasses } from './plugins/ColumnBreakPlugin/helpers';\nimport { SerializedText } from './SerializedText';\nimport { type RichTextEditorProps } from './types';\n\nconst handleHideExternalFloatingModals = (editorId: string) => {\n if (floatingButtonSelectors.isOpen(editorId)) {\n floatingButtonActions.reset();\n }\n};\n\nconst InternalRichTextEditor = memo(\n ({\n isEnabled,\n value,\n columns,\n gap,\n placeholder,\n plugins,\n onTextChange,\n showSerializedText,\n }: Omit<RichTextEditorProps, 'isEditing'> & { isEnabled: boolean }) => {\n const customClass = getResponsiveColumnClasses(columns);\n const [shouldPreventPageLeave, setShouldPreventPageLeave] = useState(false);\n const editorId = useId();\n\n const handleTextChange = useCallback(\n (newContent: string) => {\n if (newContent !== value) {\n onTextChange?.(newContent);\n }\n setShouldPreventPageLeave(false);\n },\n [onTextChange, value],\n );\n\n const handleValueChange = useCallback(() => setShouldPreventPageLeave(true), []);\n\n useEffect(() => {\n const unloadHandler = (event: BeforeUnloadEvent) => {\n event.preventDefault();\n event.returnValue = 'Unprocessed changes';\n };\n\n if (shouldPreventPageLeave) {\n window.addEventListener('beforeunload', unloadHandler);\n }\n\n return () => window.removeEventListener('beforeunload', unloadHandler);\n }, [shouldPreventPageLeave]);\n\n if (isEnabled) {\n return (\n <FondueRichTextEditor\n id={editorId}\n value={value}\n border={false}\n placeholder={placeholder}\n plugins={plugins}\n onValueChanged={handleValueChange}\n onTextChange={handleTextChange}\n hideExternalFloatingModals={handleHideExternalFloatingModals}\n placeholderOpacity=\"high\"\n />\n );\n }\n return (\n <SerializedText\n value={value}\n gap={gap}\n customClass={customClass}\n show={showSerializedText}\n plugins={plugins}\n />\n );\n },\n);\nInternalRichTextEditor.displayName = 'InternalRichTextEditor';\n\nexport const RichTextEditor = (props: RichTextEditorProps) => {\n const ref = useRef<HTMLDivElement>(null);\n const [hasEnteredViewport, setHasEnteredViewport] = useState(false);\n\n const { isEditing, ...internalRteProps } = props;\n\n const onViewportVisibilityChange = useCallback((isInViewport: boolean) => {\n if (isInViewport) {\n setHasEnteredViewport(true);\n }\n }, []);\n\n useIsInViewport({ ref, disabled: !isEditing, onChange: onViewportVisibilityChange });\n\n useEffect(() => {\n if (!isEditing) {\n // oxlint-disable-next-line @eslint-react/set-state-in-effect\n setHasEnteredViewport(false);\n }\n }, [isEditing]);\n\n return (\n <div data-test-id=\"rich-text-editor-container\" className=\"tw-block tw-w-full tw-@container\" ref={ref}>\n <InternalRichTextEditor {...internalRteProps} isEnabled={isEditing && hasEnteredViewport} />\n </div>\n );\n};\n"],"mappings":";;;;;;;;AAYA,IAAM,KAAoC,MAAqB;CAC3D,AAAI,EAAwB,OAAO,CAAQ,KACvC,EAAsB,MAAM;AAEpC,GAEM,IAAyB,GAC1B,EACG,cACA,UACA,YACA,QACA,gBACA,YACA,iBACA,4BACmE;CACnE,IAAM,IAAc,EAA2B,CAAO,GAChD,CAAC,GAAwB,KAA6B,EAAS,EAAK,GACpE,IAAW,EAAM,GAEjB,IAAmB,GACpB,MAAuB;EAIpB,AAHI,MAAe,KACf,IAAe,CAAU,GAE7B,EAA0B,EAAK;CACnC,GACA,CAAC,GAAc,CAAK,CACxB,GAEM,IAAoB,QAAkB,EAA0B,EAAI,GAAG,CAAC,CAAC;CA8B/E,OA5BA,QAAgB;EACZ,IAAM,KAAiB,MAA6B;GAEhD,AADA,EAAM,eAAe,GACrB,EAAM,cAAc;EACxB;EAMA,OAJI,KACA,OAAO,iBAAiB,gBAAgB,CAAa,SAG5C,OAAO,oBAAoB,gBAAgB,CAAa;CACzE,GAAG,CAAC,CAAsB,CAAC,GAEvB,IAEI,kBAAC,GAAD;EACI,IAAI;EACG;EACP,QAAQ;EACK;EACJ;EACT,gBAAgB;EAChB,cAAc;EACd,4BAA4B;EAC5B,oBAAmB;CACtB,CAAA,IAIL,kBAAC,GAAD;EACW;EACF;EACQ;EACb,MAAM;EACG;CACZ,CAAA;AAET,CACJ;AACA,EAAuB,cAAc;AAErC,IAAa,KAAkB,MAA+B;CAC1D,IAAM,IAAM,EAAuB,IAAI,GACjC,CAAC,GAAoB,KAAyB,EAAS,EAAK,GAE5D,EAAE,cAAW,GAAG,MAAqB,GAErC,IAA6B,GAAa,MAA0B;EACtE,AAAI,KACA,EAAsB,EAAI;CAElC,GAAG,CAAC,CAAC;CAWL,OATA,EAAgB;EAAE;EAAK,UAAU,CAAC;EAAW,UAAU;CAA2B,CAAC,GAEnF,QAAgB;EACZ,AAAK,KAED,EAAsB,EAAK;CAEnC,GAAG,CAAC,CAAS,CAAC,GAGV,kBAAC,OAAD;EAAK,gBAAa;EAA6B,WAAU;EAAwC;EAC7F,UAAA,kBAAC,GAAD;GAAwB,GAAI;GAAkB,WAAW,KAAa;EAAqB,CAAA;CAC1F,CAAA;AAEb"}
|
|
@@ -1,23 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { useEffect as e, useState as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { serializeRawToHtmlAsync as r } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/SerializedText.tsx
|
|
5
|
+
var i = ({ value: i = "", gap: a, customClass: o, show: s = !0, plugins: c }) => {
|
|
6
|
+
let [l, u] = t(null);
|
|
7
|
+
return e(() => {
|
|
8
|
+
(async () => {
|
|
9
|
+
let e = await r(i, c, void 0, a, o);
|
|
10
|
+
u(e);
|
|
11
|
+
})().catch(console.error);
|
|
12
|
+
}, [
|
|
13
|
+
i,
|
|
14
|
+
a,
|
|
15
|
+
c,
|
|
16
|
+
o
|
|
17
|
+
]), !s || l === "<br />" || l === null ? null : /* @__PURE__ */ n("div", {
|
|
18
|
+
className: "tw-w-full tw-whitespace-pre-wrap",
|
|
19
|
+
"data-test-id": "rte-content-html",
|
|
20
|
+
dangerouslySetInnerHTML: { __html: l }
|
|
21
|
+
});
|
|
19
22
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//# sourceMappingURL=SerializedText.es.js.map
|
|
23
|
+
//#endregion
|
|
24
|
+
export { i as SerializedText };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=SerializedText.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SerializedText.es.js","sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { serializeRawToHtmlAsync } from '@frontify/fondue/rte';\nimport { useEffect, useState } from 'react';\n\nimport { type SerializedTextProps } from './types';\n\nexport const SerializedText = ({ value = '', gap, customClass, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n const updateHtml = async () => {\n const htmlContent = await serializeRawToHtmlAsync(value, plugins, undefined, gap, customClass);\n setHtml(htmlContent);\n };\n updateHtml().catch(console.error);\n }, [value, gap, plugins, customClass]);\n\n if (!show || html === '<br />' || html === null) {\n return null;\n }\n\n return (\n <div\n className=\"tw-w-full tw-whitespace-pre-wrap\"\n data-test-id=\"rte-content-html\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"SerializedText.es.js","names":[],"sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { serializeRawToHtmlAsync } from '@frontify/fondue/rte';\nimport { useEffect, useState } from 'react';\n\nimport { type SerializedTextProps } from './types';\n\nexport const SerializedText = ({ value = '', gap, customClass, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n const updateHtml = async () => {\n const htmlContent = await serializeRawToHtmlAsync(value, plugins, undefined, gap, customClass);\n setHtml(htmlContent);\n };\n updateHtml().catch(console.error);\n }, [value, gap, plugins, customClass]);\n\n if (!show || html === '<br />' || html === null) {\n return null;\n }\n\n return (\n <div\n className=\"tw-w-full tw-whitespace-pre-wrap\"\n data-test-id=\"rte-content-html\"\n dangerouslySetInnerHTML={{ __html: html }}\n />\n );\n};\n"],"mappings":";;;;AAOA,IAAa,KAAkB,EAAE,WAAQ,IAAI,QAAK,gBAAa,UAAO,IAAM,iBAAmC;CAC3G,IAAM,CAAC,GAAM,KAAW,EAAwB,IAAI;CAcpD,OAZA,QAAgB;EAKZ,aAJ+B;GAC3B,IAAM,IAAc,MAAM,EAAwB,GAAO,GAAS,KAAA,GAAW,GAAK,CAAW;GAC7F,EAAQ,CAAW;EACvB,EACA,CAAW,CAAC,CAAC,MAAM,QAAQ,KAAK;CACpC,GAAG;EAAC;EAAO;EAAK;EAAS;CAAW,CAAC,GAEjC,CAAC,KAAQ,MAAS,YAAY,MAAS,OAChC,OAIP,kBAAC,OAAD;EACI,WAAU;EACV,gBAAa;EACb,yBAAyB,EAAE,QAAQ,EAAK;CAC3C,CAAA;AAET"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
1
|
+
//#region src/components/RichTextEditor/constants.ts
|
|
2
|
+
var e = "--f-theme-settings-";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as THEME_PREFIX };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=constants.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.es.js","sources":["../../../src/components/RichTextEditor/constants.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const THEME_PREFIX = '--f-theme-settings-';\n"],"
|
|
1
|
+
{"version":3,"file":"constants.es.js","names":[],"sources":["../../../src/components/RichTextEditor/constants.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const THEME_PREFIX = '--f-theme-settings-';\n"],"mappings":";AAEA,IAAa,IAAe"}
|
|
@@ -1,37 +1,30 @@
|
|
|
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
|
-
new p()
|
|
32
|
-
]
|
|
33
|
-
);
|
|
34
|
-
export {
|
|
35
|
-
I as getDefaultPluginsWithLinkChooser
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=defaultPluginsWithLinkChooser.es.js.map
|
|
1
|
+
import { ButtonPlugin as e } from "../plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
2
|
+
import { LinkPlugin as t } from "../plugins/LinkPlugin/index.es.js";
|
|
3
|
+
import { TextStylePluginsWithoutImage as n, TextStylesWithoutImage as r } from "../plugins/TextStylePlugins/helpers.es.js";
|
|
4
|
+
import { UnorderedListPlugin as i } from "../plugins/UnorderedListPlugin/index.es.js";
|
|
5
|
+
import { OrderedListPlugin as a } from "../plugins/OrderedListPlugin/index.es.js";
|
|
6
|
+
import { AlignCenterPlugin as o, AlignJustifyPlugin as s, AlignLeftPlugin as c, AlignRightPlugin as l, AutoformatPlugin as u, BoldPlugin as d, CheckboxListPlugin as f, CodePlugin as p, ItalicPlugin as m, PluginComposer as h, ResetFormattingPlugin as g, SoftBreakPlugin as _, StrikethroughPlugin as v, TextStylePlugin as y, UnderlinePlugin as b } from "@frontify/fondue/rte";
|
|
7
|
+
//#region src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx
|
|
8
|
+
var x = (x) => new h().setPlugin(new _(), new y({ textStyles: n })).setPlugin([
|
|
9
|
+
new d(),
|
|
10
|
+
new m(),
|
|
11
|
+
new b(),
|
|
12
|
+
new v(),
|
|
13
|
+
new t({ appBridge: x }),
|
|
14
|
+
new e({ appBridge: x }),
|
|
15
|
+
new p()
|
|
16
|
+
], [
|
|
17
|
+
new c({ validTypes: r }),
|
|
18
|
+
new o({ validTypes: r }),
|
|
19
|
+
new l({ validTypes: r }),
|
|
20
|
+
new s({ validTypes: r }),
|
|
21
|
+
new i(),
|
|
22
|
+
new f(),
|
|
23
|
+
new a(),
|
|
24
|
+
new g(),
|
|
25
|
+
new u()
|
|
26
|
+
]);
|
|
27
|
+
//#endregion
|
|
28
|
+
export { x as getDefaultPluginsWithLinkChooser };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=defaultPluginsWithLinkChooser.es.js.map
|
package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultPluginsWithLinkChooser.es.js","sources":["../../../../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n AutoformatPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n} from '@frontify/fondue/rte';\n\nimport {\n ButtonPlugin,\n LinkPlugin,\n OrderedListPlugin,\n TextStylePluginsWithoutImage,\n TextStylesWithoutImage,\n UnorderedListPlugin,\n} from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n }),\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n new AutoformatPlugin(),\n ],\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"defaultPluginsWithLinkChooser.es.js","names":[],"sources":["../../../../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n AutoformatPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n} from '@frontify/fondue/rte';\n\nimport {\n ButtonPlugin,\n LinkPlugin,\n OrderedListPlugin,\n TextStylePluginsWithoutImage,\n TextStylesWithoutImage,\n UnorderedListPlugin,\n} from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n }),\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n new AutoformatPlugin(),\n ],\n );\n};\n"],"mappings":";;;;;;;AA8BA,IAAa,KAAoC,MACtC,IAAI,EAAe,CAAC,CACtB,UACG,IAAI,EAAgB,GACpB,IAAI,EAAgB,EAChB,YAAY,EAChB,CAAC,CACL,CAAC,CACA,UACG;CACI,IAAI,EAAW;CACf,IAAI,EAAa;CACjB,IAAI,EAAgB;CACpB,IAAI,EAAoB;CACxB,IAAI,EAAW,EAAE,aAAU,CAAC;CAC5B,IAAI,EAAa,EAAE,aAAU,CAAC;CAC9B,IAAI,EAAW;AACnB,GACA;CACI,IAAI,EAAgB,EAAE,YAAY,EAAuB,CAAC;CAC1D,IAAI,EAAkB,EAAE,YAAY,EAAuB,CAAC;CAC5D,IAAI,EAAiB,EAAE,YAAY,EAAuB,CAAC;CAC3D,IAAI,EAAmB,EAAE,YAAY,EAAuB,CAAC;CAC7D,IAAI,EAAoB;CACxB,IAAI,EAAmB;CACvB,IAAI,EAAkB;CACtB,IAAI,EAAsB;CAC1B,IAAI,EAAiB;AACzB,CACJ"}
|
|
@@ -1,40 +1,32 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
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
|
-
onMouseEnter: () => s(!0),
|
|
29
|
-
onMouseLeave: () => s(!1),
|
|
30
|
-
href: r,
|
|
31
|
-
target: l,
|
|
32
|
-
style: n ? { ...t, ...t.hover } : t,
|
|
33
|
-
children: o
|
|
34
|
-
}
|
|
35
|
-
);
|
|
1
|
+
import { BlockButtonStyles as e } from "../utils/styles.es.js";
|
|
2
|
+
import { useState as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx
|
|
5
|
+
var r = (t) => {
|
|
6
|
+
let { attributes: r, children: a } = t, o = t.element.url || t.element.chosenLink?.searchResult?.link || "", s = t.element.target || "_self", c = String(t.element.buttonStyle) || "primary";
|
|
7
|
+
return /* @__PURE__ */ n(i, {
|
|
8
|
+
attributes: r,
|
|
9
|
+
href: o,
|
|
10
|
+
target: s,
|
|
11
|
+
styles: e[`button${c.charAt(0).toUpperCase() + c.slice(1)}`],
|
|
12
|
+
children: a
|
|
13
|
+
});
|
|
14
|
+
}, i = ({ attributes: e, styles: r = { hover: {} }, children: i, href: a = "#", target: o }) => {
|
|
15
|
+
let [s, c] = t(!1);
|
|
16
|
+
return /* @__PURE__ */ n("a", {
|
|
17
|
+
...e,
|
|
18
|
+
onMouseEnter: () => c(!0),
|
|
19
|
+
onMouseLeave: () => c(!1),
|
|
20
|
+
href: a,
|
|
21
|
+
target: o,
|
|
22
|
+
style: s ? {
|
|
23
|
+
...r,
|
|
24
|
+
...r.hover
|
|
25
|
+
} : r,
|
|
26
|
+
children: i
|
|
27
|
+
});
|
|
36
28
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=ButtonMarkupElementNode.es.js.map
|
|
29
|
+
//#endregion
|
|
30
|
+
export { r as ButtonMarkupElementNode };
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=ButtonMarkupElementNode.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonMarkupElementNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateRenderElementProps, type Value } from '@frontify/fondue/rte';\nimport { type CSSProperties, type HTMLAttributeAnchorTarget, type ReactElement, type ReactNode, useState } from 'react';\n\nimport { type TButtonElement } from '../types';\nimport { BlockButtonStyles } from '../utils';\n\nexport type ButtonRootProps = PlateRenderElementProps<Value, TButtonElement>;\n\nexport const ButtonMarkupElementNode = (props: ButtonRootProps) => {\n const { attributes, children } = props;\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n const buttonStyle = String(props.element.buttonStyle) || 'primary';\n return (\n <HoverableButtonLink\n attributes={attributes}\n href={href}\n target={target}\n styles={BlockButtonStyles[`button${buttonStyle.charAt(0).toUpperCase() + buttonStyle.slice(1)}`]}\n >\n {children}\n </HoverableButtonLink>\n );\n};\n\ntype Props = {\n attributes: ButtonRootProps['attributes'];\n children: ReactNode;\n styles?: CSSProperties & { hover?: CSSProperties };\n href?: string;\n target?: HTMLAttributeAnchorTarget;\n};\n\nconst HoverableButtonLink = ({\n attributes,\n styles = { hover: {} },\n children,\n href = '#',\n target,\n}: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n\n return (\n <a\n {...attributes}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n href={href}\n target={target}\n style={hovered ? { ...styles, ...styles.hover } : styles}\n >\n {children}\n </a>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"ButtonMarkupElementNode.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type PlateRenderElementProps, type Value } from '@frontify/fondue/rte';\nimport { type CSSProperties, type HTMLAttributeAnchorTarget, type ReactElement, type ReactNode, useState } from 'react';\n\nimport { type TButtonElement } from '../types';\nimport { BlockButtonStyles } from '../utils';\n\nexport type ButtonRootProps = PlateRenderElementProps<Value, TButtonElement>;\n\nexport const ButtonMarkupElementNode = (props: ButtonRootProps) => {\n const { attributes, children } = props;\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n const buttonStyle = String(props.element.buttonStyle) || 'primary';\n return (\n <HoverableButtonLink\n attributes={attributes}\n href={href}\n target={target}\n styles={BlockButtonStyles[`button${buttonStyle.charAt(0).toUpperCase() + buttonStyle.slice(1)}`]}\n >\n {children}\n </HoverableButtonLink>\n );\n};\n\ntype Props = {\n attributes: ButtonRootProps['attributes'];\n children: ReactNode;\n styles?: CSSProperties & { hover?: CSSProperties };\n href?: string;\n target?: HTMLAttributeAnchorTarget;\n};\n\nconst HoverableButtonLink = ({\n attributes,\n styles = { hover: {} },\n children,\n href = '#',\n target,\n}: Props): ReactElement => {\n const [hovered, setHovered] = useState(false);\n\n return (\n <a\n {...attributes}\n onMouseEnter={() => setHovered(true)}\n onMouseLeave={() => setHovered(false)}\n href={href}\n target={target}\n style={hovered ? { ...styles, ...styles.hover } : styles}\n >\n {children}\n </a>\n );\n};\n"],"mappings":";;;;AAUA,IAAa,KAA2B,MAA2B;CAC/D,IAAM,EAAE,eAAY,gBAAa,GAC3B,IAAO,EAAM,QAAQ,OAAO,EAAM,QAAQ,YAAY,cAAc,QAAQ,IAC5E,IAAS,EAAM,QAAQ,UAAU,SACjC,IAAc,OAAO,EAAM,QAAQ,WAAW,KAAK;CACzD,OACI,kBAAC,GAAD;EACgB;EACN;EACE;EACR,QAAQ,EAAkB,SAAS,EAAY,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,EAAY,MAAM,CAAC;EAE3F;CACgB,CAAA;AAE7B,GAUM,KAAuB,EACzB,eACA,YAAS,EAAE,OAAO,CAAC,EAAE,GACrB,aACA,UAAO,KACP,gBACuB;CACvB,IAAM,CAAC,GAAS,KAAc,EAAS,EAAK;CAE5C,OACI,kBAAC,KAAD;EACI,GAAI;EACJ,oBAAoB,EAAW,EAAI;EACnC,oBAAoB,EAAW,EAAK;EAC9B;EACE;EACR,OAAO,IAAU;GAAE,GAAG;GAAQ,GAAG,EAAO;EAAM,IAAI;EAEjD;CACF,CAAA;AAEX"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ELEMENT_BUTTON as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
export {
|
|
10
|
-
s as ButtonMarkupElement
|
|
1
|
+
import { ButtonMarkupElementNode as e } from "./ButtonMarkupElementNode.es.js";
|
|
2
|
+
import { ELEMENT_BUTTON as t } from "../createButtonPlugin.es.js";
|
|
3
|
+
import { MarkupElement as n } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts
|
|
5
|
+
var r = class extends n {
|
|
6
|
+
constructor(n = t, r = e) {
|
|
7
|
+
super(n, r);
|
|
8
|
+
}
|
|
11
9
|
};
|
|
12
|
-
//#
|
|
10
|
+
//#endregion
|
|
11
|
+
export { r as ButtonMarkupElement };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=index.es.js.map
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MarkupElement } from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nimport { ButtonMarkupElementNode } from './ButtonMarkupElementNode';\n\nexport class ButtonMarkupElement extends MarkupElement {\n constructor(id = ELEMENT_BUTTON, node = ButtonMarkupElementNode) {\n super(id, node);\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MarkupElement } from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nimport { ButtonMarkupElementNode } from './ButtonMarkupElementNode';\n\nexport class ButtonMarkupElement extends MarkupElement {\n constructor(id = ELEMENT_BUTTON, node = ButtonMarkupElementNode) {\n super(id, node);\n }\n}\n"],"mappings":";;;;AAQA,IAAa,IAAb,cAAyC,EAAc;CACnD,YAAY,IAAK,GAAgB,IAAO,GAAyB;EAC7D,MAAM,GAAI,CAAI;CAClB;AACJ"}
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
${u("Ctrl+Shift+K")}` : "Buttons can only be set for a single text block."
|
|
17
|
-
)
|
|
18
|
-
}
|
|
19
|
-
) });
|
|
1
|
+
import { ButtonToolbarButton as e } from "./ButtonToolbarButton.es.js";
|
|
2
|
+
import { ELEMENT_BUTTON as t } from "../createButtonPlugin.es.js";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { getHotkeyByPlatform as r, getPluginType as i, getTooltip as a, isRangeInSameBlock as o, someNode as s, useEditorState as c, useEventPlateId as l } from "@frontify/fondue/rte";
|
|
5
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx
|
|
6
|
+
var u = ({ editorId: u, id: d }) => {
|
|
7
|
+
let f = c(l(u)), p = !!o(f, { at: f.selection }), m = i(f, t), h = !!f?.selection && s(f, { match: { type: m } });
|
|
8
|
+
return /* @__PURE__ */ n("div", {
|
|
9
|
+
"data-plugin-id": d,
|
|
10
|
+
children: /* @__PURE__ */ n(e, {
|
|
11
|
+
pressed: h,
|
|
12
|
+
disabled: !p,
|
|
13
|
+
tooltip: a(p ? `Button\n${r("Ctrl+Shift+K")}` : "Buttons can only be set for a single text block.")
|
|
14
|
+
})
|
|
15
|
+
});
|
|
20
16
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=ButtonButton.es.js.map
|
|
17
|
+
//#endregion
|
|
18
|
+
export { u as ButtonButton };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=ButtonButton.es.js.map
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PluginButtonProps,\n getHotkeyByPlatform,\n getPluginType,\n getTooltip,\n isRangeInSameBlock,\n someNode,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nimport { ButtonToolbarButton } from './ButtonToolbarButton';\n\nexport const ButtonButton = ({ editorId, id }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n const type = getPluginType(editor, ELEMENT_BUTTON);\n const isLink = !!editor?.selection && someNode(editor, { match: { type } });\n\n return (\n <div data-plugin-id={id}>\n <ButtonToolbarButton\n pressed={isLink}\n disabled={!isEnabled} // maybe pressed\n tooltip={getTooltip(\n isEnabled\n ? `Button\\n${getHotkeyByPlatform('Ctrl+Shift+K')}`\n : 'Buttons can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"ButtonButton.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PluginButtonProps,\n getHotkeyByPlatform,\n getPluginType,\n getTooltip,\n isRangeInSameBlock,\n someNode,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue/rte';\n\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\n\nimport { ButtonToolbarButton } from './ButtonToolbarButton';\n\nexport const ButtonButton = ({ editorId, id }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n const type = getPluginType(editor, ELEMENT_BUTTON);\n const isLink = !!editor?.selection && someNode(editor, { match: { type } });\n\n return (\n <div data-plugin-id={id}>\n <ButtonToolbarButton\n pressed={isLink}\n disabled={!isEnabled} // maybe pressed\n tooltip={getTooltip(\n isEnabled\n ? `Button\\n${getHotkeyByPlatform('Ctrl+Shift+K')}`\n : 'Buttons can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"mappings":";;;;;AAiBA,IAAa,KAAgB,EAAE,aAAU,YAA4B;CACjE,IAAM,IAAS,EAAe,EAAgB,CAAQ,CAAC,GACjD,IAAY,CAAC,CAAC,EAAmB,GAAQ,EAC3C,IAAI,EAAO,UACf,CAAC,GACK,IAAO,EAAc,GAAQ,CAAc,GAC3C,IAAS,CAAC,CAAC,GAAQ,aAAa,EAAS,GAAQ,EAAE,OAAO,EAAE,QAAK,EAAE,CAAC;CAE1E,OACI,kBAAC,OAAD;EAAK,kBAAgB;EACjB,UAAA,kBAAC,GAAD;GACI,SAAS;GACT,UAAU,CAAC;GACX,SAAS,EACL,IACM,WAAW,EAAoB,cAAc,MAC7C,kDACV;EACH,CAAA;CACA,CAAA;AAEb"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js
CHANGED
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IconButton as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
);
|
|
1
|
+
import { triggerFloatingButton as e } from "../utils/triggerFloatingButton.es.js";
|
|
2
|
+
import { IconButton as t } from "@frontify/fondue/icons";
|
|
3
|
+
import { forwardRef as n } from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { IconStylingWrapper as i, ToolbarButton as a, focusEditor as o, useEditorRef as s } from "@frontify/fondue/rte";
|
|
6
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx
|
|
7
|
+
var c = n((n, c) => {
|
|
8
|
+
let l = s();
|
|
9
|
+
return /* @__PURE__ */ r(a, {
|
|
10
|
+
ref: c,
|
|
11
|
+
...n,
|
|
12
|
+
onMouseDown: (e) => {
|
|
13
|
+
e.preventDefault(), o(l, l.selection ?? l.prevSelection ?? void 0);
|
|
14
|
+
},
|
|
15
|
+
onClick: () => {
|
|
16
|
+
e(l, { focused: !0 });
|
|
17
|
+
},
|
|
18
|
+
children: /* @__PURE__ */ r(i, { icon: /* @__PURE__ */ r(t, { size: 16 }) })
|
|
19
|
+
});
|
|
22
20
|
});
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=ButtonToolbarButton.es.js.map
|
|
21
|
+
c.displayName = "ButtonToolbarButton";
|
|
22
|
+
//#endregion
|
|
23
|
+
export { c as ButtonToolbarButton };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=ButtonToolbarButton.es.js.map
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ButtonToolbarButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconButton } from '@frontify/fondue/icons';\nimport { IconStylingWrapper, ToolbarButton, focusEditor, useEditorRef } from '@frontify/fondue/rte';\nimport { type ReactNode, forwardRef } from 'react';\n\nimport { triggerFloatingButton } from '../utils';\n\nexport const ButtonToolbarButton = forwardRef<\n HTMLButtonElement,\n { disabled: boolean; tooltip: ReactNode; pressed: boolean }\n>((rootProps, ref) => {\n const editor = useEditorRef();\n\n return (\n <ToolbarButton\n ref={ref}\n {...rootProps}\n onMouseDown={(event) => {\n event.preventDefault();\n focusEditor(editor, editor.selection ?? editor.prevSelection ?? undefined);\n }}\n onClick={() => {\n triggerFloatingButton(editor, { focused: true });\n }}\n >\n <IconStylingWrapper icon={<IconButton size={16} />} />\n </ToolbarButton>\n );\n});\n\nButtonToolbarButton.displayName = 'ButtonToolbarButton';\n"],"
|
|
1
|
+
{"version":3,"file":"ButtonToolbarButton.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconButton } from '@frontify/fondue/icons';\nimport { IconStylingWrapper, ToolbarButton, focusEditor, useEditorRef } from '@frontify/fondue/rte';\nimport { type ReactNode, forwardRef } from 'react';\n\nimport { triggerFloatingButton } from '../utils';\n\nexport const ButtonToolbarButton = forwardRef<\n HTMLButtonElement,\n { disabled: boolean; tooltip: ReactNode; pressed: boolean }\n>((rootProps, ref) => {\n const editor = useEditorRef();\n\n return (\n <ToolbarButton\n ref={ref}\n {...rootProps}\n onMouseDown={(event) => {\n event.preventDefault();\n focusEditor(editor, editor.selection ?? editor.prevSelection ?? undefined);\n }}\n onClick={() => {\n triggerFloatingButton(editor, { focused: true });\n }}\n >\n <IconStylingWrapper icon={<IconButton size={16} />} />\n </ToolbarButton>\n );\n});\n\nButtonToolbarButton.displayName = 'ButtonToolbarButton';\n"],"mappings":";;;;;;AAQA,IAAa,IAAsB,GAGhC,GAAW,MAAQ;CAClB,IAAM,IAAS,EAAa;CAE5B,OACI,kBAAC,GAAD;EACS;EACL,GAAI;EACJ,cAAc,MAAU;GAEpB,AADA,EAAM,eAAe,GACrB,EAAY,GAAQ,EAAO,aAAa,EAAO,iBAAiB,KAAA,CAAS;EAC7E;EACA,eAAe;GACX,EAAsB,GAAQ,EAAE,SAAS,GAAK,CAAC;EACnD;EAEA,UAAA,kBAAC,GAAD,EAAoB,MAAM,kBAAC,GAAD,EAAY,MAAM,GAAK,CAAA,EAAI,CAAA;CAC1C,CAAA;AAEvB,CAAC;AAED,EAAoB,cAAc"}
|
|
@@ -1,54 +1,47 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
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
|
-
style: { ...r.style, ...l[d.p] },
|
|
44
|
-
children: y
|
|
45
|
-
}
|
|
46
|
-
),
|
|
47
|
-
document.body
|
|
48
|
-
)
|
|
49
|
-
] });
|
|
1
|
+
import { useFloatingButtonSelectors as e } from "./floatingButtonStore.es.js";
|
|
2
|
+
import { BlockStyles as t } from "../../../styles.es.js";
|
|
3
|
+
import { EditModal as n } from "./EditButtonModal/EditModal.es.js";
|
|
4
|
+
import { InsertButtonModal as r } from "./InsertButtonModal/InsertButtonModal.es.js";
|
|
5
|
+
import { useFloatingButtonEdit as i } from "./useFloatingButtonEdit.es.js";
|
|
6
|
+
import { useFloatingButtonInsert as a } from "./useFloatingButtonInsert.es.js";
|
|
7
|
+
import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
8
|
+
import { TextStyles as l, flip as u, offset as d, useEditorRef as f } from "@frontify/fondue/rte";
|
|
9
|
+
import { createPortal as p } from "react-dom";
|
|
10
|
+
//#region src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx
|
|
11
|
+
var m = {
|
|
12
|
+
placement: "bottom-start",
|
|
13
|
+
strategy: "absolute",
|
|
14
|
+
middleware: [d(12), u({
|
|
15
|
+
padding: 12,
|
|
16
|
+
fallbackPlacements: [
|
|
17
|
+
"bottom-end",
|
|
18
|
+
"top-start",
|
|
19
|
+
"top-end"
|
|
20
|
+
]
|
|
21
|
+
})]
|
|
22
|
+
}, h = () => {
|
|
23
|
+
let { ref: u, ...d } = a(m), { ref: h, ...g } = i(m), _ = f(), v = e(), y = v.isOpen(_.id), b = v.isEditing(), x = v.mode(), S = /* @__PURE__ */ s(r, {}), C = b ? S : /* @__PURE__ */ s(n, {});
|
|
24
|
+
return /* @__PURE__ */ c(o, { children: [y && x === "insert" && p(/* @__PURE__ */ s("div", {
|
|
25
|
+
"data-is-underlay": !0,
|
|
26
|
+
ref: u,
|
|
27
|
+
...d,
|
|
28
|
+
style: {
|
|
29
|
+
...d.style,
|
|
30
|
+
...t[l.p]
|
|
31
|
+
},
|
|
32
|
+
children: S
|
|
33
|
+
}), document.body), y && x === "edit" && p(/* @__PURE__ */ s("div", {
|
|
34
|
+
"data-is-underlay": !0,
|
|
35
|
+
ref: h,
|
|
36
|
+
...g,
|
|
37
|
+
style: {
|
|
38
|
+
...g.style,
|
|
39
|
+
...t[l.p]
|
|
40
|
+
},
|
|
41
|
+
children: C
|
|
42
|
+
}), document.body)] });
|
|
50
43
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=CustomFloatingButton.es.js.map
|
|
44
|
+
//#endregion
|
|
45
|
+
export { h as CustomFloatingButton };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=CustomFloatingButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomFloatingButton.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TextStyles, type UseVirtualFloatingOptions, flip, offset, useEditorRef } from '@frontify/fondue/rte';\nimport { createPortal } from 'react-dom';\n\nimport { BlockStyles } from '../../../../../RichTextEditor/plugins/styles';\nimport { useFloatingButtonEdit, useFloatingButtonInsert, useFloatingButtonSelectors } from '../FloatingButton';\n\nimport { EditModal } from './EditButtonModal/EditModal';\nimport { InsertButtonModal } from './InsertButtonModal/InsertButtonModal';\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 const CustomFloatingButton = () => {\n const { ref: insertRef, ...insertProps } = useFloatingButtonInsert(floatingOptions);\n const { ref: editRef, ...editProps } = useFloatingButtonEdit(floatingOptions);\n const editor = useEditorRef();\n const state = useFloatingButtonSelectors();\n const isOpen = state.isOpen(editor.id);\n const isEditing = state.isEditing();\n const mode = state.mode();\n\n const input = <InsertButtonModal />;\n const editContent = isEditing ? input : <EditModal />;\n\n return (\n <>\n {isOpen &&\n mode === 'insert' &&\n createPortal(\n <div\n data-is-underlay\n ref={insertRef}\n {...insertProps}\n style={{ ...insertProps.style, ...BlockStyles[TextStyles.p] }}\n >\n {input}\n </div>,\n document.body,\n )}\n\n {isOpen &&\n mode === 'edit' &&\n createPortal(\n <div\n data-is-underlay\n ref={editRef}\n {...editProps}\n style={{ ...editProps.style, ...BlockStyles[TextStyles.p] }}\n >\n {editContent}\n </div>,\n document.body,\n )}\n </>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"CustomFloatingButton.es.js","names":[],"sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TextStyles, type UseVirtualFloatingOptions, flip, offset, useEditorRef } from '@frontify/fondue/rte';\nimport { createPortal } from 'react-dom';\n\nimport { BlockStyles } from '../../../../../RichTextEditor/plugins/styles';\nimport { useFloatingButtonEdit, useFloatingButtonInsert, useFloatingButtonSelectors } from '../FloatingButton';\n\nimport { EditModal } from './EditButtonModal/EditModal';\nimport { InsertButtonModal } from './InsertButtonModal/InsertButtonModal';\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 const CustomFloatingButton = () => {\n const { ref: insertRef, ...insertProps } = useFloatingButtonInsert(floatingOptions);\n const { ref: editRef, ...editProps } = useFloatingButtonEdit(floatingOptions);\n const editor = useEditorRef();\n const state = useFloatingButtonSelectors();\n const isOpen = state.isOpen(editor.id);\n const isEditing = state.isEditing();\n const mode = state.mode();\n\n const input = <InsertButtonModal />;\n const editContent = isEditing ? input : <EditModal />;\n\n return (\n <>\n {isOpen &&\n mode === 'insert' &&\n createPortal(\n <div\n data-is-underlay\n ref={insertRef}\n {...insertProps}\n style={{ ...insertProps.style, ...BlockStyles[TextStyles.p] }}\n >\n {input}\n </div>,\n document.body,\n )}\n\n {isOpen &&\n mode === 'edit' &&\n createPortal(\n <div\n data-is-underlay\n ref={editRef}\n {...editProps}\n style={{ ...editProps.style, ...BlockStyles[TextStyles.p] }}\n >\n {editContent}\n </div>,\n document.body,\n )}\n </>\n );\n};\n"],"mappings":";;;;;;;;;;AAWA,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,GAEa,UAA6B;CACtC,IAAM,EAAE,KAAK,GAAW,GAAG,MAAgB,EAAwB,CAAe,GAC5E,EAAE,KAAK,GAAS,GAAG,MAAc,EAAsB,CAAe,GACtE,IAAS,EAAa,GACtB,IAAQ,EAA2B,GACnC,IAAS,EAAM,OAAO,EAAO,EAAE,GAC/B,IAAY,EAAM,UAAU,GAC5B,IAAO,EAAM,KAAK,GAElB,IAAQ,kBAAC,GAAD,CAAoB,CAAA,GAC5B,IAAc,IAAY,IAAQ,kBAAC,GAAD,CAAY,CAAA;CAEpD,OACI,kBAAA,GAAA,EAAA,UAAA,CACK,KACG,MAAS,YACT,EACI,kBAAC,OAAD;EACI,oBAAA;EACA,KAAK;EACL,GAAI;EACJ,OAAO;GAAE,GAAG,EAAY;GAAO,GAAG,EAAY,EAAW;EAAG;EAE3D,UAAA;CACA,CAAA,GACL,SAAS,IACb,GAEH,KACG,MAAS,UACT,EACI,kBAAC,OAAD;EACI,oBAAA;EACA,KAAK;EACL,GAAI;EACJ,OAAO;GAAE,GAAG,EAAU;GAAO,GAAG,EAAY,EAAW;EAAG;EAEzD,UAAA;CACA,CAAA,GACL,SAAS,IACb,CACN,EAAA,CAAA;AAEV"}
|