@frontify/guideline-blocks-settings 3.0.1 → 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 +9 -8
- package/dist/index.es.js +221 -213
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -8
- package/dist/index.umd.js.map +1 -1
- package/dist/settings/background.es.js +20 -21
- package/dist/settings/background.es.js.map +1 -1
- package/dist/settings/border.es.js +62 -64
- package/dist/settings/border.es.js.map +1 -1
- package/dist/settings/borderRadius.es.js +49 -52
- package/dist/settings/borderRadius.es.js.map +1 -1
- package/dist/settings/borderRadiusExtended.es.js +58 -60
- package/dist/settings/borderRadiusExtended.es.js.map +1 -1
- package/dist/settings/defaultValues.es.js +16 -19
- package/dist/settings/defaultValues.es.js.map +1 -1
- package/dist/settings/gutter.es.js +48 -52
- package/dist/settings/gutter.es.js.map +1 -1
- package/dist/settings/margin.es.js +49 -52
- package/dist/settings/margin.es.js.map +1 -1
- package/dist/settings/marginExtended.es.js +62 -64
- package/dist/settings/marginExtended.es.js.map +1 -1
- package/dist/settings/padding.es.js +49 -52
- package/dist/settings/padding.es.js.map +1 -1
- package/dist/settings/paddingExtended.es.js +62 -64
- package/dist/settings/paddingExtended.es.js.map +1 -1
- package/dist/settings/securityDownloadable.es.js +16 -16
- package/dist/settings/securityDownloadable.es.js.map +1 -1
- package/dist/settings/securityGlobalControl.es.js +26 -32
- package/dist/settings/securityGlobalControl.es.js.map +1 -1
- package/dist/settings/types.es.js +41 -47
- package/dist/settings/types.es.js.map +1 -1
- package/dist/styles.css +2 -1
- package/dist/utilities/color/getReadableColor.es.js +15 -13
- package/dist/utilities/color/getReadableColor.es.js.map +1 -1
- package/dist/utilities/color/isDark.es.js +14 -9
- package/dist/utilities/color/isDark.es.js.map +1 -1
- package/dist/utilities/color/setAlpha.es.js +7 -6
- package/dist/utilities/color/setAlpha.es.js.map +1 -1
- package/dist/utilities/color/toColorObject.es.js +14 -8
- package/dist/utilities/color/toColorObject.es.js.map +1 -1
- package/dist/utilities/color/toHex8String.es.js +7 -6
- package/dist/utilities/color/toHex8String.es.js.map +1 -1
- package/dist/utilities/color/toHexString.es.js +7 -6
- package/dist/utilities/color/toHexString.es.js.map +1 -1
- package/dist/utilities/color/toRgbaString.es.js +7 -6
- package/dist/utilities/color/toRgbaString.es.js.map +1 -1
- package/dist/utilities/color/toShortRgba.es.js +18 -11
- package/dist/utilities/color/toShortRgba.es.js.map +1 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js +7 -8
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -1
- package/dist/utilities/react/getBorderStyles.es.js +12 -11
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -1
- package/dist/utilities/react/getRadiusStyles.es.js +7 -8
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -1
- package/dist/utilities/react/joinClassNames.es.js +6 -5
- package/dist/utilities/react/joinClassNames.es.js.map +1 -1
- package/package.json +19 -20
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -72
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
1
|
+
//#region src/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.ts
|
|
2
|
+
var e = (e) => e.filter((e) => !!e.title?.trim());
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as filterDocumentSectionsWithUnreadableTitles };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=filterDocumentSectionsWithUnreadableTitles.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filterDocumentSectionsWithUnreadableTitles.es.js","sources":["../../../../src/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentSection } from '@frontify/app-bridge';\n\nimport { type DocumentSectionWithTitle } from '../types';\n\nexport const filterDocumentSectionsWithUnreadableTitles = (sections: DocumentSection[]) =>\n sections.filter((section) => !!section.title?.trim()) as DocumentSectionWithTitle[];\n"],"
|
|
1
|
+
{"version":3,"file":"filterDocumentSectionsWithUnreadableTitles.es.js","names":[],"sources":["../../../../src/components/Link/helpers/filterDocumentSectionsWithUnreadableTitles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type DocumentSection } from '@frontify/app-bridge';\n\nimport { type DocumentSectionWithTitle } from '../types';\n\nexport const filterDocumentSectionsWithUnreadableTitles = (sections: DocumentSection[]) =>\n sections.filter((section) => !!section.title?.trim()) as DocumentSectionWithTitle[];\n"],"mappings":";AAMA,IAAa,KAA8C,MACvD,EAAS,QAAQ,MAAY,CAAC,CAAC,EAAQ,OAAO,KAAK,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=getUrl.es.js.map
|
|
1
|
+
import { ELEMENT_LINK as e, getAboveNode as t } from "@frontify/fondue/rte";
|
|
2
|
+
//#region src/components/Link/utils/getUrl.ts
|
|
3
|
+
var n = (n, r) => {
|
|
4
|
+
let i = t(n, { match: { type: e } });
|
|
5
|
+
return Array.isArray(i) ? r(i[0]) : "";
|
|
6
|
+
}, r = (e) => n(e, (e) => e.chosenLink?.searchResult?.link || ""), i = (e) => n(e, (e) => e.url || ""), a = (e) => e.url || e.chosenLink?.searchResult?.link || "", o = (e) => n(e, a);
|
|
7
|
+
//#endregion
|
|
8
|
+
export { r as getLegacyUrl, o as getLinkFromEditor, i as getUrl, a as getUrlFromLinkOrLegacyLink };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=getUrl.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUrl.es.js","sources":["../../../../src/components/Link/utils/getUrl.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, type PlateEditor, getAboveNode } from '@frontify/fondue/rte';\n\nimport { type TLinkElement } from '../../RichTextEditor/plugins/LinkPlugin/types';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TLinkElement) => string): string => {\n const linkNode = getAboveNode<TLinkElement>(editor, { match: { type: ELEMENT_LINK } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getLegacyUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.chosenLink?.searchResult?.link || '');\n};\n\nexport const getUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url || '');\n};\n\nexport const getUrlFromLinkOrLegacyLink = (link: TLinkElement): string => {\n return link.url || link.chosenLink?.searchResult?.link || '';\n};\n\nexport const getLinkFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n"],"
|
|
1
|
+
{"version":3,"file":"getUrl.es.js","names":[],"sources":["../../../../src/components/Link/utils/getUrl.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, type PlateEditor, getAboveNode } from '@frontify/fondue/rte';\n\nimport { type TLinkElement } from '../../RichTextEditor/plugins/LinkPlugin/types';\n\nconst getLinkNode = (editor: PlateEditor, cb: (link: TLinkElement) => string): string => {\n const linkNode = getAboveNode<TLinkElement>(editor, { match: { type: ELEMENT_LINK } });\n\n if (!Array.isArray(linkNode)) {\n return '';\n }\n\n return cb(linkNode[0]);\n};\n\nexport const getLegacyUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.chosenLink?.searchResult?.link || '');\n};\n\nexport const getUrl = (editor: PlateEditor) => {\n return getLinkNode(editor, (link) => link.url || '');\n};\n\nexport const getUrlFromLinkOrLegacyLink = (link: TLinkElement): string => {\n return link.url || link.chosenLink?.searchResult?.link || '';\n};\n\nexport const getLinkFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n"],"mappings":";;AAMA,IAAM,KAAe,GAAqB,MAA+C;CACrF,IAAM,IAAW,EAA2B,GAAQ,EAAE,OAAO,EAAE,MAAM,EAAa,EAAE,CAAC;CAMrF,OAJK,MAAM,QAAQ,CAAQ,IAIpB,EAAG,EAAS,EAAE,IAHV;AAIf,GAEa,KAAgB,MAClB,EAAY,IAAS,MAAS,EAAK,YAAY,cAAc,QAAQ,EAAE,GAGrE,KAAU,MACZ,EAAY,IAAS,MAAS,EAAK,OAAO,EAAE,GAG1C,KAA8B,MAChC,EAAK,OAAO,EAAK,YAAY,cAAc,QAAQ,IAGjD,KAAqB,MACvB,EAAY,GAAQ,CAA0B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
1
|
+
//#region src/components/Link/utils/relativeUrlRegex.ts
|
|
2
|
+
var e = /^\/(document|r)\/\S+$/i;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as relativeUrlRegex };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=relativeUrlRegex.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relativeUrlRegex.es.js","sources":["../../../../src/components/Link/utils/relativeUrlRegex.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const relativeUrlRegex = /^\\/(document|r)\\/\\S+$/i;\n"],"
|
|
1
|
+
{"version":3,"file":"relativeUrlRegex.es.js","names":[],"sources":["../../../../src/components/Link/utils/relativeUrlRegex.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const relativeUrlRegex = /^\\/(document|r)\\/\\S+$/i;\n"],"mappings":";AAEA,IAAa,IAAmB"}
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import { relativeUrlRegex as
|
|
2
|
-
import { addHttps as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
1
|
+
import { relativeUrlRegex as e } from "./relativeUrlRegex.es.js";
|
|
2
|
+
import { addHttps as t } from "../../../helpers/addHttps.es.js";
|
|
3
|
+
//#region src/components/Link/utils/url.ts
|
|
4
|
+
var n = (t) => {
|
|
5
|
+
if (e.test(t)) return !0;
|
|
6
|
+
try {
|
|
7
|
+
let e = new URL(t);
|
|
8
|
+
return [
|
|
9
|
+
"http:",
|
|
10
|
+
"https:",
|
|
11
|
+
"mailto:",
|
|
12
|
+
"tel:"
|
|
13
|
+
].includes(e.protocol) && e.pathname !== "";
|
|
14
|
+
} catch {
|
|
15
|
+
return !1;
|
|
16
|
+
}
|
|
17
|
+
}, r = (e) => n(t(e)) || e === "";
|
|
18
|
+
//#endregion
|
|
19
|
+
export { n as isValidUrl, r as isValidUrlOrEmpty };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=url.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url.es.js","sources":["../../../../src/components/Link/utils/url.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { addHttps } from '../../../helpers';\n\nimport { relativeUrlRegex } from './relativeUrlRegex';\n\nexport const isValidUrl = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return true;\n }\n try {\n const parsedUrl = new URL(url);\n const validProtocols = ['http:', 'https:', 'mailto:', 'tel:'];\n return validProtocols.includes(parsedUrl.protocol) && parsedUrl.pathname !== '';\n } catch {\n return false;\n }\n};\n\nexport const isValidUrlOrEmpty = (url: string): boolean => {\n return isValidUrl(addHttps(url)) || url === '';\n};\n"],"
|
|
1
|
+
{"version":3,"file":"url.es.js","names":[],"sources":["../../../../src/components/Link/utils/url.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { addHttps } from '../../../helpers';\n\nimport { relativeUrlRegex } from './relativeUrlRegex';\n\nexport const isValidUrl = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return true;\n }\n try {\n const parsedUrl = new URL(url);\n const validProtocols = ['http:', 'https:', 'mailto:', 'tel:'];\n return validProtocols.includes(parsedUrl.protocol) && parsedUrl.pathname !== '';\n } catch {\n return false;\n }\n};\n\nexport const isValidUrlOrEmpty = (url: string): boolean => {\n return isValidUrl(addHttps(url)) || url === '';\n};\n"],"mappings":";;;AAMA,IAAa,KAAc,MAAgB;CACvC,IAAI,EAAiB,KAAK,CAAG,GACzB,OAAO;CAEX,IAAI;EACA,IAAM,IAAY,IAAI,IAAI,CAAG;EAE7B,OAAO;GADiB;GAAS;GAAU;GAAW;EAC/C,CAAA,CAAe,SAAS,EAAU,QAAQ,KAAK,EAAU,aAAa;CACjF,QAAQ;EACJ,OAAO;CACX;AACJ,GAEa,KAAqB,MACvB,EAAW,EAAS,CAAG,CAAC,KAAK,MAAQ"}
|
|
@@ -1,69 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
const j = (o) => {
|
|
59
|
-
const e = R(null), [l, r] = m(!1), { isEditing: t, ...i } = o, s = c((d) => {
|
|
60
|
-
d && r(!0);
|
|
61
|
-
}, []);
|
|
62
|
-
return v({ ref: e, disabled: !t, onChange: s }), p(() => {
|
|
63
|
-
t || r(!1);
|
|
64
|
-
}, [t]), /* @__PURE__ */ a("div", { "data-test-id": "rich-text-editor-container", className: "tw-block tw-w-full tw-@container", ref: e, children: /* @__PURE__ */ a(g, { ...i, isEnabled: t && l }) });
|
|
1
|
+
import { useIsInViewport as e } from "../../hooks/useIsInViewport.es.js";
|
|
2
|
+
import { floatingButtonActions as t, floatingButtonSelectors as n } from "./plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js";
|
|
3
|
+
import { getResponsiveColumnClasses as r } from "./plugins/ColumnBreakPlugin/helpers.es.js";
|
|
4
|
+
import { SerializedText as i } from "./SerializedText.es.js";
|
|
5
|
+
import { memo as a, useCallback as o, useEffect as s, useId as c, useRef as l, useState as u } from "react";
|
|
6
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
7
|
+
import { RichTextEditor as f } from "@frontify/fondue/rte";
|
|
8
|
+
//#region src/components/RichTextEditor/RichTextEditor.tsx
|
|
9
|
+
var p = (e) => {
|
|
10
|
+
n.isOpen(e) && t.reset();
|
|
11
|
+
}, m = a(({ isEnabled: e, value: t, columns: n, gap: a, placeholder: l, plugins: m, onTextChange: h, showSerializedText: g }) => {
|
|
12
|
+
let _ = r(n), [v, y] = u(!1), b = c(), x = o((e) => {
|
|
13
|
+
e !== t && h?.(e), y(!1);
|
|
14
|
+
}, [h, t]), S = o(() => y(!0), []);
|
|
15
|
+
return s(() => {
|
|
16
|
+
let e = (e) => {
|
|
17
|
+
e.preventDefault(), e.returnValue = "Unprocessed changes";
|
|
18
|
+
};
|
|
19
|
+
return v && window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
20
|
+
}, [v]), e ? /* @__PURE__ */ d(f, {
|
|
21
|
+
id: b,
|
|
22
|
+
value: t,
|
|
23
|
+
border: !1,
|
|
24
|
+
placeholder: l,
|
|
25
|
+
plugins: m,
|
|
26
|
+
onValueChanged: S,
|
|
27
|
+
onTextChange: x,
|
|
28
|
+
hideExternalFloatingModals: p,
|
|
29
|
+
placeholderOpacity: "high"
|
|
30
|
+
}) : /* @__PURE__ */ d(i, {
|
|
31
|
+
value: t,
|
|
32
|
+
gap: a,
|
|
33
|
+
customClass: _,
|
|
34
|
+
show: g,
|
|
35
|
+
plugins: m
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
m.displayName = "InternalRichTextEditor";
|
|
39
|
+
var h = (t) => {
|
|
40
|
+
let n = l(null), [r, i] = u(!1), { isEditing: a, ...c } = t, f = o((e) => {
|
|
41
|
+
e && i(!0);
|
|
42
|
+
}, []);
|
|
43
|
+
return e({
|
|
44
|
+
ref: n,
|
|
45
|
+
disabled: !a,
|
|
46
|
+
onChange: f
|
|
47
|
+
}), s(() => {
|
|
48
|
+
a || i(!1);
|
|
49
|
+
}, [a]), /* @__PURE__ */ d("div", {
|
|
50
|
+
"data-test-id": "rich-text-editor-container",
|
|
51
|
+
className: "tw-block tw-w-full tw-@container",
|
|
52
|
+
ref: n,
|
|
53
|
+
children: /* @__PURE__ */ d(m, {
|
|
54
|
+
...c,
|
|
55
|
+
isEnabled: a && r
|
|
56
|
+
})
|
|
57
|
+
});
|
|
65
58
|
};
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
//# sourceMappingURL=RichTextEditor.es.js.map
|
|
59
|
+
//#endregion
|
|
60
|
+
export { h as RichTextEditor };
|
|
61
|
+
|
|
62
|
+
//# sourceMappingURL=RichTextEditor.es.js.map
|
|
@@ -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 {
|
|
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"}
|