@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":"useInsertModal.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n ELEMENT_LINK,\n floatingLinkActions,\n floatingLinkSelectors,\n getPluginOptions,\n submitFloatingLink,\n useEditorRef,\n useHotkeys,\n} from '@frontify/fondue/rte';\nimport { type Dispatch, type MouseEvent, type Reducer, useEffect, useReducer } from 'react';\n\nimport { addHttps } from '../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../../Link';\nimport { getLegacyUrl, getUrl } from '../../utils';\n\nimport { type InsertModalDispatchType, type InsertModalStateProps } from './types';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n newTab: false,\n};\n\nexport const InsertModalState = (): [InsertModalStateProps, Dispatch<InsertModalDispatchType>] => {\n const [state, dispatch] = useReducer<Reducer<InsertModalStateProps, InsertModalDispatchType>>((state, action) => {\n const { type, payload } = action;\n\n switch (type) {\n case 'NEW_TAB':\n return {\n ...state,\n newTab: true,\n };\n case 'SAME_TAB':\n return {\n ...state,\n newTab: false,\n };\n case 'URL':\n case 'TEXT':\n case 'INIT':\n return {\n ...state,\n ...payload,\n };\n default:\n return state;\n }\n }, initialState);\n\n return [state, dispatch];\n};\n\nexport const useInsertModal = () => {\n const editor = useEditorRef();\n const [state, dispatch] = InsertModalState();\n\n useEffect(() => {\n const legacyUrl = getLegacyUrl(editor);\n const url = getUrl(editor);\n const isNewTab = floatingLinkSelectors.newTab();\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingLinkSelectors.text() || floatingLinkSelectors.url(),\n newTab: isNewTab,\n url: legacyUrl && url === '' ? legacyUrl : floatingLinkSelectors.url(),\n },\n });\n }, [dispatch, editor]);\n\n const onTextChange = (value: string) => {\n dispatch({\n type: 'TEXT',\n payload: { text: value },\n });\n };\n\n const onUrlChange = (value: string) => {\n dispatch({\n type: 'URL',\n payload: { url: value },\n });\n };\n\n const onToggleTab = (checked: boolean) => {\n checked ? dispatch({ type: 'NEW_TAB' }) : dispatch({ type: 'SAME_TAB' });\n };\n\n const onCancel = () => {\n floatingLinkActions.reset();\n };\n\n const onSave = (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n floatingLinkActions.text(state.text);\n floatingLinkActions.url(addHttps(state.url));\n floatingLinkActions.newTab(state.newTab);\n\n if (submitFloatingLink(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_LINK);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return { state, onTextChange, onUrlChange, onToggleTab, onCancel, onSave, hasValues, isValidUrlOrEmpty, appBridge };\n};\n"],"
|
|
1
|
+
{"version":3,"file":"useInsertModal.es.js","names":[],"sources":["../../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n ELEMENT_LINK,\n floatingLinkActions,\n floatingLinkSelectors,\n getPluginOptions,\n submitFloatingLink,\n useEditorRef,\n useHotkeys,\n} from '@frontify/fondue/rte';\nimport { type Dispatch, type MouseEvent, type Reducer, useEffect, useReducer } from 'react';\n\nimport { addHttps } from '../../../../../../helpers';\nimport { isValidUrlOrEmpty } from '../../../../../Link';\nimport { getLegacyUrl, getUrl } from '../../utils';\n\nimport { type InsertModalDispatchType, type InsertModalStateProps } from './types';\n\nconst initialState: InsertModalStateProps = {\n url: '',\n text: '',\n newTab: false,\n};\n\nexport const InsertModalState = (): [InsertModalStateProps, Dispatch<InsertModalDispatchType>] => {\n const [state, dispatch] = useReducer<Reducer<InsertModalStateProps, InsertModalDispatchType>>((state, action) => {\n const { type, payload } = action;\n\n switch (type) {\n case 'NEW_TAB':\n return {\n ...state,\n newTab: true,\n };\n case 'SAME_TAB':\n return {\n ...state,\n newTab: false,\n };\n case 'URL':\n case 'TEXT':\n case 'INIT':\n return {\n ...state,\n ...payload,\n };\n default:\n return state;\n }\n }, initialState);\n\n return [state, dispatch];\n};\n\nexport const useInsertModal = () => {\n const editor = useEditorRef();\n const [state, dispatch] = InsertModalState();\n\n useEffect(() => {\n const legacyUrl = getLegacyUrl(editor);\n const url = getUrl(editor);\n const isNewTab = floatingLinkSelectors.newTab();\n dispatch({\n type: 'INIT',\n payload: {\n text: floatingLinkSelectors.text() || floatingLinkSelectors.url(),\n newTab: isNewTab,\n url: legacyUrl && url === '' ? legacyUrl : floatingLinkSelectors.url(),\n },\n });\n }, [dispatch, editor]);\n\n const onTextChange = (value: string) => {\n dispatch({\n type: 'TEXT',\n payload: { text: value },\n });\n };\n\n const onUrlChange = (value: string) => {\n dispatch({\n type: 'URL',\n payload: { url: value },\n });\n };\n\n const onToggleTab = (checked: boolean) => {\n checked ? dispatch({ type: 'NEW_TAB' }) : dispatch({ type: 'SAME_TAB' });\n };\n\n const onCancel = () => {\n floatingLinkActions.reset();\n };\n\n const onSave = (event: MouseEvent<HTMLButtonElement, globalThis.MouseEvent> | KeyboardEvent | undefined) => {\n if (!isValidUrlOrEmpty(state.url) || !hasValues) {\n return;\n }\n\n floatingLinkActions.text(state.text);\n floatingLinkActions.url(addHttps(state.url));\n floatingLinkActions.newTab(state.newTab);\n\n if (submitFloatingLink(editor)) {\n event?.preventDefault();\n }\n };\n\n const hasValues = state.url !== '' && state.text !== '';\n\n const { appBridge } = getPluginOptions<{ appBridge: AppBridgeBlock }>(editor, ELEMENT_LINK);\n\n useHotkeys(\n 'enter',\n onSave,\n {\n enableOnFormTags: ['INPUT'],\n },\n [],\n );\n\n return { state, onTextChange, onUrlChange, onToggleTab, onCancel, onSave, hasValues, isValidUrlOrEmpty, appBridge };\n};\n"],"mappings":";;;;;;AAoBA,IAAM,IAAsC;CACxC,KAAK;CACL,MAAM;CACN,QAAQ;AACZ,GAEa,UAAqF;CAC9F,IAAM,CAAC,GAAO,KAAY,GAAqE,GAAO,MAAW;EAC7G,IAAM,EAAE,SAAM,eAAY;EAE1B,QAAQ,GAAR;GACI,KAAK,WACD,OAAO;IACH,GAAG;IACH,QAAQ;GACZ;GACJ,KAAK,YACD,OAAO;IACH,GAAG;IACH,QAAQ;GACZ;GACJ,KAAK;GACL,KAAK;GACL,KAAK,QACD,OAAO;IACH,GAAG;IACH,GAAG;GACP;GACJ,SACI,OAAO;EACf;CACJ,GAAG,CAAY;CAEf,OAAO,CAAC,GAAO,CAAQ;AAC3B,GAEa,UAAuB;CAChC,IAAM,IAAS,EAAa,GACtB,CAAC,GAAO,KAAY,EAAiB;CAE3C,QAAgB;EACZ,IAAM,IAAY,EAAa,CAAM,GAC/B,IAAM,EAAO,CAAM,GACnB,IAAW,EAAsB,OAAO;EAC9C,EAAS;GACL,MAAM;GACN,SAAS;IACL,MAAM,EAAsB,KAAK,KAAK,EAAsB,IAAI;IAChE,QAAQ;IACR,KAAK,KAAa,MAAQ,KAAK,IAAY,EAAsB,IAAI;GACzE;EACJ,CAAC;CACL,GAAG,CAAC,GAAU,CAAM,CAAC;CAErB,IAAM,KAAgB,MAAkB;EACpC,EAAS;GACL,MAAM;GACN,SAAS,EAAE,MAAM,EAAM;EAC3B,CAAC;CACL,GAEM,KAAe,MAAkB;EACnC,EAAS;GACL,MAAM;GACN,SAAS,EAAE,KAAK,EAAM;EAC1B,CAAC;CACL,GAEM,KAAe,MAAqB;EACtC,AAAU,EAAV,IAAmB,EAAE,MAAM,UAAU,IAAc,EAAE,MAAM,WAAW,CAAC;CAC3E,GAEM,UAAiB;EACnB,EAAoB,MAAM;CAC9B,GAEM,KAAU,MAA4F;EACpG,CAAC,EAAkB,EAAM,GAAG,KAAK,CAAC,MAItC,EAAoB,KAAK,EAAM,IAAI,GACnC,EAAoB,IAAI,EAAS,EAAM,GAAG,CAAC,GAC3C,EAAoB,OAAO,EAAM,MAAM,GAEnC,EAAmB,CAAM,KACzB,GAAO,eAAe;CAE9B,GAEM,IAAY,EAAM,QAAQ,MAAM,EAAM,SAAS,IAE/C,EAAE,iBAAc,EAAgD,GAAQ,CAAY;CAW1F,OATA,EACI,SACA,GACA,EACI,kBAAkB,CAAC,OAAO,EAC9B,GACA,CAAC,CACL,GAEO;EAAE;EAAO;EAAc;EAAa;EAAa;EAAU;EAAQ;EAAW;EAAmB;CAAU;AACtH"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
${d("Ctrl+K")}` : "Links can only be set for a single text block."
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
) });
|
|
1
|
+
import { LinkToolbarButton as e } from "./LinkToolbarButton.es.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { getHotkeyByPlatform as n, getTooltip as r, isRangeInSameBlock as i, useEditorState as a, useEventPlateId as o } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx
|
|
5
|
+
var s = ({ id: s, editorId: c }) => {
|
|
6
|
+
let l = a(o(c)), u = !!i(l, { at: l.selection });
|
|
7
|
+
return /* @__PURE__ */ t("div", {
|
|
8
|
+
"data-plugin-id": s,
|
|
9
|
+
children: /* @__PURE__ */ t(e, {
|
|
10
|
+
disabled: !u,
|
|
11
|
+
tooltip: r(u ? `Link\n${n("Ctrl+K")}` : "Links can only be set for a single text block.")
|
|
12
|
+
})
|
|
13
|
+
});
|
|
18
14
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=LinkButton.es.js.map
|
|
15
|
+
//#endregion
|
|
16
|
+
export { s as LinkButton };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=LinkButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkButton.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PluginButtonProps,\n getHotkeyByPlatform,\n getTooltip,\n isRangeInSameBlock,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue/rte';\n\nimport { LinkToolbarButton } from './LinkToolbarButton';\n\nexport const LinkButton = ({ id, editorId }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n\n return (\n <div data-plugin-id={id}>\n <LinkToolbarButton\n disabled={!isEnabled}\n tooltip={getTooltip(\n isEnabled\n ? `Link\\n${getHotkeyByPlatform('Ctrl+K')}`\n : 'Links can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"LinkButton.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PluginButtonProps,\n getHotkeyByPlatform,\n getTooltip,\n isRangeInSameBlock,\n useEditorState,\n useEventPlateId,\n} from '@frontify/fondue/rte';\n\nimport { LinkToolbarButton } from './LinkToolbarButton';\n\nexport const LinkButton = ({ id, editorId }: PluginButtonProps) => {\n const editor = useEditorState(useEventPlateId(editorId));\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n\n return (\n <div data-plugin-id={id}>\n <LinkToolbarButton\n disabled={!isEnabled}\n tooltip={getTooltip(\n isEnabled\n ? `Link\\n${getHotkeyByPlatform('Ctrl+K')}`\n : 'Links can only be set for a single text block.',\n )}\n />\n </div>\n );\n};\n"],"mappings":";;;;AAaA,IAAa,KAAc,EAAE,OAAI,kBAAkC;CAC/D,IAAM,IAAS,EAAe,EAAgB,CAAQ,CAAC,GACjD,IAAY,CAAC,CAAC,EAAmB,GAAQ,EAC3C,IAAI,EAAO,UACf,CAAC;CAED,OACI,kBAAC,OAAD;EAAK,kBAAgB;EACjB,UAAA,kBAAC,GAAD;GACI,UAAU,CAAC;GACX,SAAS,EACL,IACM,SAAS,EAAoB,QAAQ,MACrC,gDACV;EACH,CAAA;CACA,CAAA;AAEb"}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { LINK_PLUGIN as e } from "../id.es.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { useRichTextEditorContext as n } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx
|
|
5
|
+
var r = (r) => {
|
|
6
|
+
let { attributes: i, children: a } = r, { styles: o } = n(), s = r.element.url || r.element.chosenLink?.searchResult?.link || "", c = r.element.target || "_self";
|
|
7
|
+
return /* @__PURE__ */ t("a", {
|
|
8
|
+
...i,
|
|
9
|
+
href: s,
|
|
10
|
+
target: c,
|
|
11
|
+
style: o[e],
|
|
12
|
+
children: a
|
|
13
|
+
});
|
|
7
14
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
//# sourceMappingURL=LinkMarkupElementNode.es.js.map
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as LinkMarkupElementNode };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=LinkMarkupElementNode.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkMarkupElementNode.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PlateRenderElementProps,\n type TLinkElement as TPlateLinkElement,\n useRichTextEditorContext,\n} from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../id';\n\nexport type TLinkElement = TPlateLinkElement & {\n chosenLink?: {\n searchResult?: {\n link?: string;\n };\n openInNewTab?: boolean;\n };\n};\n\nexport const LinkMarkupElementNode = (props: PlateRenderElementProps & { element: TLinkElement }) => {\n const { attributes, children } = props;\n\n const { styles } = useRichTextEditorContext();\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n\n return (\n <a {...attributes} href={href} target={target} style={styles[LINK_PLUGIN]}>\n {children}\n </a>\n );\n};\n"],"
|
|
1
|
+
{"version":3,"file":"LinkMarkupElementNode.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n type PlateRenderElementProps,\n type TLinkElement as TPlateLinkElement,\n useRichTextEditorContext,\n} from '@frontify/fondue/rte';\n\nimport { LINK_PLUGIN } from '../id';\n\nexport type TLinkElement = TPlateLinkElement & {\n chosenLink?: {\n searchResult?: {\n link?: string;\n };\n openInNewTab?: boolean;\n };\n};\n\nexport const LinkMarkupElementNode = (props: PlateRenderElementProps & { element: TLinkElement }) => {\n const { attributes, children } = props;\n\n const { styles } = useRichTextEditorContext();\n const href = props.element.url || props.element.chosenLink?.searchResult?.link || '';\n const target = props.element.target || '_self';\n\n return (\n <a {...attributes} href={href} target={target} style={styles[LINK_PLUGIN]}>\n {children}\n </a>\n );\n};\n"],"mappings":";;;;AAmBA,IAAa,KAAyB,MAA+D;CACjG,IAAM,EAAE,eAAY,gBAAa,GAE3B,EAAE,cAAW,EAAyB,GACtC,IAAO,EAAM,QAAQ,OAAO,EAAM,QAAQ,YAAY,cAAc,QAAQ,IAC5E,IAAS,EAAM,QAAQ,UAAU;CAEvC,OACI,kBAAC,KAAD;EAAG,GAAI;EAAkB;EAAc;EAAQ,OAAO,EAAO;EACxD;CACF,CAAA;AAEX"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
export {
|
|
9
|
-
k as LinkMarkupElement
|
|
1
|
+
import { LinkMarkupElementNode as e } from "./LinkMarkupElementNode.es.js";
|
|
2
|
+
import { ELEMENT_LINK as t, MarkupElement as n } from "@frontify/fondue/rte";
|
|
3
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts
|
|
4
|
+
var r = class extends n {
|
|
5
|
+
constructor(n = t, r = e) {
|
|
6
|
+
super(n, r);
|
|
7
|
+
}
|
|
10
8
|
};
|
|
11
|
-
//#
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as LinkMarkupElement };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, MarkupElement, type PlateRenderElementProps } from '@frontify/fondue/rte';\n\nimport { LinkMarkupElementNode, type TLinkElement } from './LinkMarkupElementNode';\n\nexport class LinkMarkupElement extends MarkupElement {\n constructor(\n id = ELEMENT_LINK,\n node: (props: PlateRenderElementProps & { element: TLinkElement }) => JSX.Element = LinkMarkupElementNode,\n ) {\n super(id, node);\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { ELEMENT_LINK, MarkupElement, type PlateRenderElementProps } from '@frontify/fondue/rte';\n\nimport { LinkMarkupElementNode, type TLinkElement } from './LinkMarkupElementNode';\n\nexport class LinkMarkupElement extends MarkupElement {\n constructor(\n id = ELEMENT_LINK,\n node: (props: PlateRenderElementProps & { element: TLinkElement }) => JSX.Element = LinkMarkupElementNode,\n ) {\n super(id, node);\n }\n}\n"],"mappings":";;;AAMA,IAAa,IAAb,cAAuC,EAAc;CACjD,YACI,IAAK,GACL,IAAoF,GACtF;EACE,MAAM,GAAI,CAAI;CAClB;AACJ"}
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
b as LinkToolbarButton
|
|
25
|
-
};
|
|
26
|
-
//# sourceMappingURL=LinkToolbarButton.es.js.map
|
|
1
|
+
import { IconLink as e } from "@frontify/fondue/icons";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import { IconStylingWrapper as r, ToolbarButton as i, focusEditor as a, useEditorRef as o, useLinkToolbarButton as s, useLinkToolbarButtonState as c } from "@frontify/fondue/rte";
|
|
5
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.tsx
|
|
6
|
+
var l = t((t, l) => {
|
|
7
|
+
let u = o(), d = c(), { props: f } = s(d);
|
|
8
|
+
return /* @__PURE__ */ n(i, {
|
|
9
|
+
onMouseDown: (e) => {
|
|
10
|
+
e.preventDefault(), a(u, u.selection ?? u.prevSelection ?? void 0);
|
|
11
|
+
},
|
|
12
|
+
ref: l,
|
|
13
|
+
...f,
|
|
14
|
+
...t,
|
|
15
|
+
children: /* @__PURE__ */ n(r, { icon: /* @__PURE__ */ n(e, { size: 16 }) })
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
l.displayName = "LinkToolbarButton";
|
|
19
|
+
//#endregion
|
|
20
|
+
export { l as LinkToolbarButton };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=LinkToolbarButton.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkToolbarButton.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconLink } from '@frontify/fondue/icons';\nimport {\n IconStylingWrapper,\n ToolbarButton,\n focusEditor,\n useEditorRef,\n useLinkToolbarButton,\n useLinkToolbarButtonState,\n} from '@frontify/fondue/rte';\nimport { type ReactNode, forwardRef } from 'react';\n\nexport const LinkToolbarButton = forwardRef<HTMLButtonElement, { disabled: boolean; tooltip: ReactNode }>(\n (rootProps, ref) => {\n const editor = useEditorRef();\n const state = useLinkToolbarButtonState();\n const { props } = useLinkToolbarButton(state);\n return (\n <ToolbarButton\n onMouseDown={(event) => {\n event.preventDefault();\n focusEditor(editor, editor.selection ?? editor.prevSelection ?? undefined);\n }}\n ref={ref}\n {...props}\n {...rootProps}\n >\n <IconStylingWrapper icon={<IconLink size={16} />} />\n </ToolbarButton>\n );\n },\n);\n\nLinkToolbarButton.displayName = 'LinkToolbarButton';\n"],"
|
|
1
|
+
{"version":3,"file":"LinkToolbarButton.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconLink } from '@frontify/fondue/icons';\nimport {\n IconStylingWrapper,\n ToolbarButton,\n focusEditor,\n useEditorRef,\n useLinkToolbarButton,\n useLinkToolbarButtonState,\n} from '@frontify/fondue/rte';\nimport { type ReactNode, forwardRef } from 'react';\n\nexport const LinkToolbarButton = forwardRef<HTMLButtonElement, { disabled: boolean; tooltip: ReactNode }>(\n (rootProps, ref) => {\n const editor = useEditorRef();\n const state = useLinkToolbarButtonState();\n const { props } = useLinkToolbarButton(state);\n return (\n <ToolbarButton\n onMouseDown={(event) => {\n event.preventDefault();\n focusEditor(editor, editor.selection ?? editor.prevSelection ?? undefined);\n }}\n ref={ref}\n {...props}\n {...rootProps}\n >\n <IconStylingWrapper icon={<IconLink size={16} />} />\n </ToolbarButton>\n );\n },\n);\n\nLinkToolbarButton.displayName = 'LinkToolbarButton';\n"],"mappings":";;;;;AAaA,IAAa,IAAoB,GAC5B,GAAW,MAAQ;CAChB,IAAM,IAAS,EAAa,GACtB,IAAQ,EAA0B,GAClC,EAAE,aAAU,EAAqB,CAAK;CAC5C,OACI,kBAAC,GAAD;EACI,cAAc,MAAU;GAEpB,AADA,EAAM,eAAe,GACrB,EAAY,GAAQ,EAAO,aAAa,EAAO,iBAAiB,KAAA,CAAS;EAC7E;EACK;EACL,GAAI;EACJ,GAAI;EAEJ,UAAA,kBAAC,GAAD,EAAoB,MAAM,kBAAC,GAAD,EAAU,MAAM,GAAK,CAAA,EAAI,CAAA;CACxC,CAAA;AAEvB,CACJ;AAEA,EAAkB,cAAc"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
1
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/id.ts
|
|
2
|
+
var e = "link-plugin";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as LINK_PLUGIN };
|
|
5
|
+
|
|
6
|
+
//# sourceMappingURL=id.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"id.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/id.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const LINK_PLUGIN = 'link-plugin';\n"],"
|
|
1
|
+
{"version":3,"file":"id.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/id.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const LINK_PLUGIN = 'link-plugin';\n"],"mappings":";AAEA,IAAa,IAAc"}
|
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { LinkButton as
|
|
6
|
-
import { LinkMarkupElement as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
class
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
export {
|
|
38
|
-
h as LinkPlugin,
|
|
39
|
-
g as createLinkPlugin
|
|
1
|
+
import { isValidUrl as e } from "../../../Link/utils/url.es.js";
|
|
2
|
+
import { LINK_PLUGIN as t } from "./id.es.js";
|
|
3
|
+
import { BlockStyles as n } from "../styles.es.js";
|
|
4
|
+
import { CustomFloatingLink as r } from "./FloatingLink/CustomFloatingLink.es.js";
|
|
5
|
+
import { LinkButton as i } from "./LinkButton.es.js";
|
|
6
|
+
import { LinkMarkupElement as a } from "./LinkMarkupElement/index.es.js";
|
|
7
|
+
import { Plugin as o, createLinkPlugin as s, createPluginFactory as c } from "@frontify/fondue/rte";
|
|
8
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/index.ts
|
|
9
|
+
var l = (t) => c({
|
|
10
|
+
...s(),
|
|
11
|
+
renderAfterEditable: r,
|
|
12
|
+
options: {
|
|
13
|
+
isUrl: e,
|
|
14
|
+
rangeBeforeOptions: {
|
|
15
|
+
matchString: " ",
|
|
16
|
+
skipInvalid: !0,
|
|
17
|
+
afterMatch: !0
|
|
18
|
+
},
|
|
19
|
+
triggerFloatingLinkHotkeys: "meta+k, ctrl+k",
|
|
20
|
+
keepSelectedTextOnPaste: !0,
|
|
21
|
+
appBridge: t
|
|
22
|
+
}
|
|
23
|
+
})(), u = class extends o {
|
|
24
|
+
styles = {};
|
|
25
|
+
appBridge;
|
|
26
|
+
constructor({ styles: e = n[t], ...r }) {
|
|
27
|
+
super(t, {
|
|
28
|
+
button: i,
|
|
29
|
+
markupElement: new a(),
|
|
30
|
+
...r
|
|
31
|
+
}), this.styles = e, this.appBridge = r.appBridge;
|
|
32
|
+
}
|
|
33
|
+
plugins() {
|
|
34
|
+
return [l(this.appBridge)];
|
|
35
|
+
}
|
|
40
36
|
};
|
|
41
|
-
//#
|
|
37
|
+
//#endregion
|
|
38
|
+
export { u as LinkPlugin, l as createLinkPlugin };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n type PlatePlugin,\n Plugin,\n type PluginProps,\n createLinkPlugin as createPlateLinkPlugin,\n createPluginFactory,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { isValidUrl } from '../../../Link';\nimport { BlockStyles } from '../styles';\n\nimport { CustomFloatingLink } from './FloatingLink/CustomFloatingLink';\nimport { LINK_PLUGIN } from './id';\nimport { LinkButton } from './LinkButton';\nimport { LinkMarkupElement } from './LinkMarkupElement';\n\nexport const createLinkPlugin = (appBridge: AppBridgeBlock): PlatePlugin =>\n createPluginFactory({\n ...createPlateLinkPlugin(),\n renderAfterEditable: CustomFloatingLink,\n options: {\n isUrl: isValidUrl,\n rangeBeforeOptions: {\n matchString: ' ',\n skipInvalid: true,\n afterMatch: true,\n },\n triggerFloatingLinkHotkeys: 'meta+k, ctrl+k',\n keepSelectedTextOnPaste: true,\n appBridge,\n },\n })();\n\nexport type LinkPluginProps = PluginProps & { appBridge: AppBridgeBlock };\n\nexport class LinkPlugin extends Plugin {\n public styles: CSSProperties = {};\n private appBridge: AppBridgeBlock;\n constructor({ styles = BlockStyles[LINK_PLUGIN], ...props }: LinkPluginProps) {\n super(LINK_PLUGIN, {\n button: LinkButton,\n markupElement: new LinkMarkupElement(),\n ...props,\n });\n this.styles = styles;\n this.appBridge = props.appBridge;\n }\n\n plugins(): PlatePlugin[] {\n return [createLinkPlugin(this.appBridge)];\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/LinkPlugin/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { type AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n type PlatePlugin,\n Plugin,\n type PluginProps,\n createLinkPlugin as createPlateLinkPlugin,\n createPluginFactory,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { isValidUrl } from '../../../Link';\nimport { BlockStyles } from '../styles';\n\nimport { CustomFloatingLink } from './FloatingLink/CustomFloatingLink';\nimport { LINK_PLUGIN } from './id';\nimport { LinkButton } from './LinkButton';\nimport { LinkMarkupElement } from './LinkMarkupElement';\n\nexport const createLinkPlugin = (appBridge: AppBridgeBlock): PlatePlugin =>\n createPluginFactory({\n ...createPlateLinkPlugin(),\n renderAfterEditable: CustomFloatingLink,\n options: {\n isUrl: isValidUrl,\n rangeBeforeOptions: {\n matchString: ' ',\n skipInvalid: true,\n afterMatch: true,\n },\n triggerFloatingLinkHotkeys: 'meta+k, ctrl+k',\n keepSelectedTextOnPaste: true,\n appBridge,\n },\n })();\n\nexport type LinkPluginProps = PluginProps & { appBridge: AppBridgeBlock };\n\nexport class LinkPlugin extends Plugin {\n public styles: CSSProperties = {};\n private appBridge: AppBridgeBlock;\n constructor({ styles = BlockStyles[LINK_PLUGIN], ...props }: LinkPluginProps) {\n super(LINK_PLUGIN, {\n button: LinkButton,\n markupElement: new LinkMarkupElement(),\n ...props,\n });\n this.styles = styles;\n this.appBridge = props.appBridge;\n }\n\n plugins(): PlatePlugin[] {\n return [createLinkPlugin(this.appBridge)];\n }\n}\n"],"mappings":";;;;;;;;AAoBA,IAAa,KAAoB,MAC7B,EAAoB;CAChB,GAAG,EAAsB;CACzB,qBAAqB;CACrB,SAAS;EACL,OAAO;EACP,oBAAoB;GAChB,aAAa;GACb,aAAa;GACb,YAAY;EAChB;EACA,4BAA4B;EAC5B,yBAAyB;EACzB;CACJ;AACJ,CAAC,CAAC,CAAC,GAIM,IAAb,cAAgC,EAAO;CACnC,SAA+B,CAAC;CAChC;CACA,YAAY,EAAE,YAAS,EAAY,IAAc,GAAG,KAA0B;EAO1E,AANA,MAAM,GAAa;GACf,QAAQ;GACR,eAAe,IAAI,EAAkB;GACrC,GAAG;EACP,CAAC,GACD,KAAK,SAAS,GACd,KAAK,YAAY,EAAM;CAC3B;CAEA,UAAyB;EACrB,OAAO,CAAC,EAAiB,KAAK,SAAS,CAAC;CAC5C;AACJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=getUrl.es.js.map
|
|
1
|
+
import { ELEMENT_LINK as e, getAboveNode as t } from "@frontify/fondue/rte";
|
|
2
|
+
//#region src/components/RichTextEditor/plugins/LinkPlugin/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 || "");
|
|
7
|
+
//#endregion
|
|
8
|
+
export { r as getLegacyUrl, i as getUrl };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=getUrl.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUrl.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/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 '../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 getUrlFromEditor = (editor: PlateEditor) => {\n return getLinkNode(editor, getUrlFromLinkOrLegacyLink);\n};\n"],"
|
|
1
|
+
{"version":3,"file":"getUrl.es.js","names":[],"sources":["../../../../../../src/components/RichTextEditor/plugins/LinkPlugin/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 '../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 getUrlFromEditor = (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"}
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { OrderedListPlugin as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
export {
|
|
25
|
-
n as OrderedListPlugin
|
|
1
|
+
import { OrderedListPlugin as e } from "@frontify/fondue/rte";
|
|
2
|
+
//#region src/components/RichTextEditor/plugins/OrderedListPlugin/index.ts
|
|
3
|
+
var t = [
|
|
4
|
+
{
|
|
5
|
+
counterType: "var(--f-theme-settings-list-numbered1-counter-type, decimal)",
|
|
6
|
+
color: "var(--f-theme-settings-list-numbered1-color, currentColor)"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
counterType: "var(--f-theme-settings-list-numbered2-counter-type, lower-alpha)",
|
|
10
|
+
color: "var(--f-theme-settings-list-numbered2-color, currentColor)"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
counterType: "var(--f-theme-settings-list-numbered3-counter-type, lower-roman)",
|
|
14
|
+
color: "var(--f-theme-settings-list-numbered3-color, currentColor)"
|
|
15
|
+
}
|
|
16
|
+
], n = class extends e {
|
|
17
|
+
constructor(e) {
|
|
18
|
+
super({
|
|
19
|
+
listStyles: t,
|
|
20
|
+
...e
|
|
21
|
+
});
|
|
22
|
+
}
|
|
26
23
|
};
|
|
27
|
-
//#
|
|
24
|
+
//#endregion
|
|
25
|
+
export { n as OrderedListPlugin };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/OrderedListPlugin/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { OrderedListPlugin as FondueOrderedListPlugin, type OrderedListPluginProps } from '@frontify/fondue/rte';\n\nconst DEFAULT_LIST_STYLES = [\n {\n counterType: 'var(--f-theme-settings-list-numbered1-counter-type, decimal)',\n color: 'var(--f-theme-settings-list-numbered1-color, currentColor)',\n },\n {\n counterType: 'var(--f-theme-settings-list-numbered2-counter-type, lower-alpha)',\n color: 'var(--f-theme-settings-list-numbered2-color, currentColor)',\n },\n {\n counterType: 'var(--f-theme-settings-list-numbered3-counter-type, lower-roman)',\n color: 'var(--f-theme-settings-list-numbered3-color, currentColor)',\n },\n];\n\nexport class OrderedListPlugin extends FondueOrderedListPlugin {\n constructor(props?: OrderedListPluginProps) {\n super({\n listStyles: DEFAULT_LIST_STYLES,\n ...props,\n });\n }\n}\n"],"
|
|
1
|
+
{"version":3,"file":"index.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/OrderedListPlugin/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { OrderedListPlugin as FondueOrderedListPlugin, type OrderedListPluginProps } from '@frontify/fondue/rte';\n\nconst DEFAULT_LIST_STYLES = [\n {\n counterType: 'var(--f-theme-settings-list-numbered1-counter-type, decimal)',\n color: 'var(--f-theme-settings-list-numbered1-color, currentColor)',\n },\n {\n counterType: 'var(--f-theme-settings-list-numbered2-counter-type, lower-alpha)',\n color: 'var(--f-theme-settings-list-numbered2-color, currentColor)',\n },\n {\n counterType: 'var(--f-theme-settings-list-numbered3-counter-type, lower-roman)',\n color: 'var(--f-theme-settings-list-numbered3-color, currentColor)',\n },\n];\n\nexport class OrderedListPlugin extends FondueOrderedListPlugin {\n constructor(props?: OrderedListPluginProps) {\n super({\n listStyles: DEFAULT_LIST_STYLES,\n ...props,\n });\n }\n}\n"],"mappings":";;AAIA,IAAM,IAAsB;CACxB;EACI,aAAa;EACb,OAAO;CACX;CACA;EACI,aAAa;EACb,OAAO;CACX;CACA;EACI,aAAa;EACb,OAAO;CACX;AACJ,GAEa,IAAb,cAAuC,EAAwB;CAC3D,YAAY,GAAgC;EACxC,MAAM;GACF,YAAY;GACZ,GAAG;EACP,CAAC;CACL;AACJ"}
|
|
@@ -1,46 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
component: (s) => /* @__PURE__ */ m(n, { ...s, styles: t })
|
|
42
|
-
});
|
|
43
|
-
export {
|
|
44
|
-
f as Custom1Plugin
|
|
45
|
-
};
|
|
46
|
-
//# sourceMappingURL=custom1Plugin.es.js.map
|
|
1
|
+
import { BlockStyles as e, TextStyles as t } from "../styles.es.js";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { MarkupElement as r, Plugin as i, alignmentClassnames as a, createPluginFactory as o, getColumnBreakClasses as s, merge as c } from "@frontify/fondue/rte";
|
|
4
|
+
//#region src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx
|
|
5
|
+
var l = "textstyle-custom1-plugin", u = class extends i {
|
|
6
|
+
styles = {};
|
|
7
|
+
constructor({ styles: n = e.custom1, ...r } = {}) {
|
|
8
|
+
super(t.custom1, {
|
|
9
|
+
label: "Custom 1",
|
|
10
|
+
markupElement: new d(),
|
|
11
|
+
...r
|
|
12
|
+
}), this.styles = n;
|
|
13
|
+
}
|
|
14
|
+
plugins() {
|
|
15
|
+
return [p(this.styles)];
|
|
16
|
+
}
|
|
17
|
+
}, d = class extends r {
|
|
18
|
+
constructor(e = l, t = f) {
|
|
19
|
+
super(e, t);
|
|
20
|
+
}
|
|
21
|
+
}, f = ({ element: e, attributes: t, children: r, styles: i }) => {
|
|
22
|
+
let o = e.align;
|
|
23
|
+
return /* @__PURE__ */ n("p", {
|
|
24
|
+
...t,
|
|
25
|
+
style: i,
|
|
26
|
+
className: c([o && a[o], s(e)]),
|
|
27
|
+
children: r
|
|
28
|
+
});
|
|
29
|
+
}, p = (e) => o({
|
|
30
|
+
key: t.custom1,
|
|
31
|
+
isElement: !0,
|
|
32
|
+
deserializeHtml: { rules: [{ validClassName: t.custom1 }] }
|
|
33
|
+
})({ component: (t) => /* @__PURE__ */ n(f, {
|
|
34
|
+
...t,
|
|
35
|
+
styles: e
|
|
36
|
+
}) });
|
|
37
|
+
//#endregion
|
|
38
|
+
export { u as Custom1Plugin };
|
|
39
|
+
|
|
40
|
+
//# sourceMappingURL=custom1Plugin.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom1Plugin.es.js","sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-custom1-plugin';\n\nexport class Custom1Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.custom1, ...props }: PluginProps = {}) {\n super(TextStyles.custom1, {\n label: 'Custom 1',\n markupElement: new Custom1MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createCustom1Plugin(this.styles)];\n }\n}\n\nclass Custom1MarkupElement extends MarkupElement {\n constructor(id = ID, node = Custom1MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Custom1MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n style={styles}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}\n >\n {children}\n </p>\n );\n};\n\nconst createCustom1Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.custom1,\n isElement: true,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.custom1 }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <Custom1MarkupElementNode {...props} styles={styles} />,\n });\n"],"
|
|
1
|
+
{"version":3,"file":"custom1Plugin.es.js","names":[],"sources":["../../../../../src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MarkupElement,\n type PlatePlugin,\n Plugin,\n type PluginProps,\n type TextStyleRenderElementProps,\n alignmentClassnames,\n createPluginFactory,\n getColumnBreakClasses,\n merge,\n} from '@frontify/fondue/rte';\nimport { type CSSProperties } from 'react';\n\nimport { BlockStyles, TextStyles } from '../styles';\n\nconst ID = 'textstyle-custom1-plugin';\n\nexport class Custom1Plugin extends Plugin {\n public styles: CSSProperties = {};\n constructor({ styles = BlockStyles.custom1, ...props }: PluginProps = {}) {\n super(TextStyles.custom1, {\n label: 'Custom 1',\n markupElement: new Custom1MarkupElement(),\n ...props,\n });\n this.styles = styles;\n }\n\n plugins(): PlatePlugin[] {\n return [createCustom1Plugin(this.styles)];\n }\n}\n\nclass Custom1MarkupElement extends MarkupElement {\n constructor(id = ID, node = Custom1MarkupElementNode) {\n super(id, node);\n }\n}\n\nconst Custom1MarkupElementNode = ({ element, attributes, children, styles }: TextStyleRenderElementProps) => {\n const align = element.align as string;\n return (\n <p\n {...attributes}\n style={styles}\n className={merge([align && alignmentClassnames[align], getColumnBreakClasses(element)])}\n >\n {children}\n </p>\n );\n};\n\nconst createCustom1Plugin = (styles: CSSProperties) =>\n createPluginFactory({\n key: TextStyles.custom1,\n isElement: true,\n deserializeHtml: {\n rules: [{ validClassName: TextStyles.custom1 }],\n },\n })({\n component: (props: TextStyleRenderElementProps) => <Custom1MarkupElementNode {...props} styles={styles} />,\n });\n"],"mappings":";;;;AAiBA,IAAM,IAAK,4BAEE,IAAb,cAAmC,EAAO;CACtC,SAA+B,CAAC;CAChC,YAAY,EAAE,YAAS,EAAY,SAAS,GAAG,MAAuB,CAAC,GAAG;EAMtE,AALA,MAAM,EAAW,SAAS;GACtB,OAAO;GACP,eAAe,IAAI,EAAqB;GACxC,GAAG;EACP,CAAC,GACD,KAAK,SAAS;CAClB;CAEA,UAAyB;EACrB,OAAO,CAAC,EAAoB,KAAK,MAAM,CAAC;CAC5C;AACJ,GAEM,IAAN,cAAmC,EAAc;CAC7C,YAAY,IAAK,GAAI,IAAO,GAA0B;EAClD,MAAM,GAAI,CAAI;CAClB;AACJ,GAEM,KAA4B,EAAE,YAAS,eAAY,aAAU,gBAA0C;CACzG,IAAM,IAAQ,EAAQ;CACtB,OACI,kBAAC,KAAD;EACI,GAAI;EACJ,OAAO;EACP,WAAW,EAAM,CAAC,KAAS,EAAoB,IAAQ,EAAsB,CAAO,CAAC,CAAC;EAErF;CACF,CAAA;AAEX,GAEM,KAAuB,MACzB,EAAoB;CAChB,KAAK,EAAW;CAChB,WAAW;CACX,iBAAiB,EACb,OAAO,CAAC,EAAE,gBAAgB,EAAW,QAAQ,CAAC,EAClD;AACJ,CAAC,CAAC,CAAC,EACC,YAAY,MAAuC,kBAAC,GAAD;CAA0B,GAAI;CAAe;AAAS,CAAA,EAC7G,CAAC"}
|