@frontify/guideline-blocks-settings 0.28.0 → 0.28.2
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/CHANGELOG.md +17 -0
- package/dist/_virtual/jsx-runtime.es.js +5 -0
- package/dist/_virtual/jsx-runtime.es.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.development.es.js +5 -0
- package/dist/_virtual/react-jsx-runtime.development.es.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.production.min.es.js +5 -0
- package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +1 -0
- package/dist/components/Attachments/AttachmentItem.es.js +180 -0
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -0
- package/dist/components/Attachments/Attachments.es.js +145 -0
- package/dist/components/Attachments/Attachments.es.js.map +1 -0
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +150 -0
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +73 -0
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar.es.js +113 -0
- package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/constants.es.js +6 -0
- package/dist/components/BlockItemWrapper/constants.es.js.map +1 -0
- package/dist/components/DownloadButton/DownloadButton.es.js +39 -0
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/RichTextEditor.es.js +42 -0
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -0
- package/dist/components/RichTextEditor/SerializedText.es.js +13 -0
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -0
- package/dist/components/RichTextEditor/constants.es.js +5 -0
- package/dist/components/RichTextEditor/constants.es.js.map +1 -0
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +34 -0
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +54 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +17 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +30 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +16 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +37 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js +25 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +20 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +26 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +69 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +105 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +20 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +32 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +58 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +19 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +26 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +43 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +18 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +62 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +13 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +25 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +35 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +86 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +24 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +19 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +11 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +10 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +75 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +18 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +17 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +14 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +53 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +19 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +37 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +53 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +29 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +8 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +80 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +40 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +93 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +25 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +27 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +12 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +5 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +18 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js +5 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js +17 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +45 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +45 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +45 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +46 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +40 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +46 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +46 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +41 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +48 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +68 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +55 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +62 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +61 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +34 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +26 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/styles.es.js +168 -0
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/button.es.js +16 -0
- package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js +19 -0
- package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js +17 -0
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js +15 -0
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +12 -0
- package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js +61 -0
- package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js +25 -0
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js +8 -0
- package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js +13 -0
- package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -0
- package/dist/helpers/addHttps.es.js +14 -0
- package/dist/helpers/addHttps.es.js.map +1 -0
- package/dist/helpers/convertToRichTextValue.es.js +6 -0
- package/dist/helpers/convertToRichTextValue.es.js.map +1 -0
- package/dist/helpers/customCoordinatesGetterFactory.es.js +32 -0
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -0
- package/dist/helpers/hasRichTextValue.es.js +15 -0
- package/dist/helpers/hasRichTextValue.es.js.map +1 -0
- package/dist/helpers/isDownloadable.es.js +6 -0
- package/dist/helpers/isDownloadable.es.js.map +1 -0
- package/dist/helpers/mapColorPalettes.es.js +16 -0
- package/dist/helpers/mapColorPalettes.es.js.map +1 -0
- package/dist/hooks/useAttachments.es.js +31 -0
- package/dist/hooks/useAttachments.es.js.map +1 -0
- package/dist/hooks/useDndSensors.es.js +20 -0
- package/dist/hooks/useDndSensors.es.js.map +1 -0
- package/dist/index.cjs.js +46 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +964 -0
- package/dist/index.es.js +178 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +46 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/settings/background.es.js +22 -0
- package/dist/settings/background.es.js.map +1 -0
- package/dist/settings/border.es.js +61 -0
- package/dist/settings/border.es.js.map +1 -0
- package/dist/settings/borderRadius.es.js +56 -0
- package/dist/settings/borderRadius.es.js.map +1 -0
- package/dist/settings/borderRadiusExtended.es.js +64 -0
- package/dist/settings/borderRadiusExtended.es.js.map +1 -0
- package/dist/settings/defaultValues.es.js +19 -0
- package/dist/settings/defaultValues.es.js.map +1 -0
- package/dist/settings/gutter.es.js +56 -0
- package/dist/settings/gutter.es.js.map +1 -0
- package/dist/settings/margin.es.js +53 -0
- package/dist/settings/margin.es.js.map +1 -0
- package/dist/settings/marginExtended.es.js +65 -0
- package/dist/settings/marginExtended.es.js.map +1 -0
- package/dist/settings/padding.es.js +53 -0
- package/dist/settings/padding.es.js.map +1 -0
- package/dist/settings/paddingExtended.es.js +65 -0
- package/dist/settings/paddingExtended.es.js.map +1 -0
- package/dist/settings/securityDownloadable.es.js +19 -0
- package/dist/settings/securityDownloadable.es.js.map +1 -0
- package/dist/settings/securityGlobalControl.es.js +33 -0
- package/dist/settings/securityGlobalControl.es.js.map +1 -0
- package/dist/settings/types.es.js +48 -0
- package/dist/settings/types.es.js.map +1 -0
- package/dist/styles.css +1 -0
- package/dist/styles.css.es.js +5 -0
- package/dist/styles.css.es.js.map +1 -0
- package/dist/utilities/color/getReadableColor.es.js +14 -0
- package/dist/utilities/color/getReadableColor.es.js.map +1 -0
- package/dist/utilities/color/isDark.es.js +10 -0
- package/dist/utilities/color/isDark.es.js.map +1 -0
- package/dist/utilities/color/setAlpha.es.js +6 -0
- package/dist/utilities/color/setAlpha.es.js.map +1 -0
- package/dist/utilities/color/toColorObject.es.js +9 -0
- package/dist/utilities/color/toColorObject.es.js.map +1 -0
- package/dist/utilities/color/toHex8String.es.js +7 -0
- package/dist/utilities/color/toHex8String.es.js.map +1 -0
- package/dist/utilities/color/toHexString.es.js +7 -0
- package/dist/utilities/color/toHexString.es.js.map +1 -0
- package/dist/utilities/color/toRgbaString.es.js +7 -0
- package/dist/utilities/color/toRgbaString.es.js.map +1 -0
- package/dist/utilities/color/toShortRgba.es.js +11 -0
- package/dist/utilities/color/toShortRgba.es.js.map +1 -0
- package/dist/utilities/moveItemInArray.es.js +12 -0
- package/dist/utilities/moveItemInArray.es.js.map +1 -0
- package/dist/utilities/react/getBackgroundColorStyles.es.js +8 -0
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +1 -0
- package/dist/utilities/react/getBorderStyles.es.js +12 -0
- package/dist/utilities/react/getBorderStyles.es.js.map +1 -0
- package/dist/utilities/react/getRadiusStyles.es.js +8 -0
- package/dist/utilities/react/getRadiusStyles.es.js.map +1 -0
- package/dist/utilities/react/joinClassNames.es.js +5 -0
- package/dist/utilities/react/joinClassNames.es.js.map +1 -0
- package/package.json +25 -24
- package/src/components/Attachments/AttachmentItem.tsx +2 -2
- package/src/components/Attachments/Attachments.spec.ct.tsx +4 -4
- package/src/components/Attachments/Attachments.tsx +2 -2
- package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +2 -2
- package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +8 -8
- package/src/components/BlockItemWrapper/Toolbar.tsx +1 -1
- package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +8 -8
- package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +2 -0
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +5 -5
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +2 -2
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +1 -1
- package/src/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.spec.ts +24 -27
- package/src/components/RichTextEditor/serializer/nodes/checkItemNode.ts +1 -1
- package/src/components/RichTextEditor/serializer/nodes/default.ts +2 -2
- package/src/components/RichTextEditor/serializer/nodes/link.ts +1 -1
- package/src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts +4 -4
- package/src/components/RichTextEditor/serializer/serializeToHtml.ts +2 -2
- package/src/hooks/useAttachments.ts +1 -1
- package/src/hooks/useDndSensors.ts +1 -1
- package/src/index.ts +3 -3
- package/src/settings/background.spec.ts +1 -1
- package/src/settings/border.spec.ts +1 -1
- package/src/settings/borderRadiusExtended.spec.ts +4 -4
- package/src/settings/marginExtended.spec.ts +4 -4
- package/src/settings/paddingExtended.spec.ts +4 -4
- package/src/styles.css +3 -0
- package/src/utilities/react/getBorderStyles.ts +1 -1
- package/vite.config.ts +22 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { j as l } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useState as a, useRef as j, useEffect as g } from "react";
|
|
3
|
+
import { Toolbar as F } from "./Toolbar.es.js";
|
|
4
|
+
import { joinClassNames as p } from "../../utilities/react/joinClassNames.es.js";
|
|
5
|
+
const R = ({
|
|
6
|
+
children: r,
|
|
7
|
+
toolbarFlyoutItems: c,
|
|
8
|
+
toolbarItems: e,
|
|
9
|
+
shouldHideWrapper: w,
|
|
10
|
+
shouldHideComponent: n = !1,
|
|
11
|
+
isDragging: u,
|
|
12
|
+
shouldFillContainer: f,
|
|
13
|
+
outlineOffset: o = 2,
|
|
14
|
+
shouldBeShown: s = !1
|
|
15
|
+
}) => {
|
|
16
|
+
const [t, m] = a(s), [y, i] = a(!1), x = j(null);
|
|
17
|
+
if (g(() => {
|
|
18
|
+
t || i(!0);
|
|
19
|
+
}, [t]), w)
|
|
20
|
+
return r;
|
|
21
|
+
const v = e == null ? void 0 : e.filter((d) => d !== void 0);
|
|
22
|
+
return /* @__PURE__ */ l.jsxs(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref: x,
|
|
26
|
+
onFocus: () => i(!1),
|
|
27
|
+
onPointerEnter: () => i(!1),
|
|
28
|
+
"data-test-id": "block-item-wrapper",
|
|
29
|
+
style: {
|
|
30
|
+
outlineOffset: o
|
|
31
|
+
},
|
|
32
|
+
className: p([
|
|
33
|
+
"tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse",
|
|
34
|
+
f && "tw-flex-1 tw-h-full tw-w-full",
|
|
35
|
+
"hover:tw-outline focus-within:tw-outline",
|
|
36
|
+
(t || s) && "tw-outline",
|
|
37
|
+
n && "tw-opacity-0"
|
|
38
|
+
]),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ l.jsx(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
style: {
|
|
44
|
+
right: -1 - o,
|
|
45
|
+
bottom: `calc(100% - ${2 + o}px)`
|
|
46
|
+
},
|
|
47
|
+
className: p([
|
|
48
|
+
"tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-10",
|
|
49
|
+
"group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100",
|
|
50
|
+
(t || s) && "tw-opacity-100"
|
|
51
|
+
]),
|
|
52
|
+
children: /* @__PURE__ */ l.jsx(
|
|
53
|
+
F,
|
|
54
|
+
{
|
|
55
|
+
isFlyoutOpen: t,
|
|
56
|
+
isFlyoutDisabled: y,
|
|
57
|
+
setIsFlyoutOpen: m,
|
|
58
|
+
flyoutItems: c,
|
|
59
|
+
items: v,
|
|
60
|
+
isDragging: u
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
r
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
R as BlockItemWrapper
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=BlockItemWrapper.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockItemWrapper.es.js","sources":["../../../src/components/BlockItemWrapper/BlockItemWrapper.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PropsWithChildren, useEffect, useRef, useState } from 'react';\nimport { joinClassNames } from '../../utilities';\nimport { Toolbar } from './Toolbar';\nimport { BlockItemWrapperProps, ToolbarItem } from './types';\n\nexport const BlockItemWrapper = ({\n children,\n toolbarFlyoutItems,\n toolbarItems,\n shouldHideWrapper,\n shouldHideComponent = false,\n isDragging,\n shouldFillContainer,\n outlineOffset = 2,\n shouldBeShown = false,\n}: PropsWithChildren<BlockItemWrapperProps>) => {\n const [isFlyoutOpen, setIsFlyoutOpen] = useState(shouldBeShown);\n const [isFlyoutDisabled, setIsFlyoutDisabled] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!isFlyoutOpen) {\n // This prevents automatic refocusing of the trigger element\n setIsFlyoutDisabled(true);\n }\n }, [isFlyoutOpen]);\n\n if (shouldHideWrapper) {\n return children;\n }\n\n const items = toolbarItems?.filter((item): item is ToolbarItem => item !== undefined);\n\n return (\n <div\n ref={wrapperRef}\n onFocus={() => setIsFlyoutDisabled(false)}\n onPointerEnter={() => setIsFlyoutDisabled(false)}\n data-test-id=\"block-item-wrapper\"\n style={{\n outlineOffset,\n }}\n className={joinClassNames([\n 'tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse',\n shouldFillContainer && 'tw-flex-1 tw-h-full tw-w-full',\n 'hover:tw-outline focus-within:tw-outline',\n (isFlyoutOpen || shouldBeShown) && 'tw-outline',\n shouldHideComponent && 'tw-opacity-0',\n ])}\n >\n <div\n style={{\n right: -1 - outlineOffset,\n bottom: `calc(100% - ${2 + outlineOffset}px)`,\n }}\n className={joinClassNames([\n 'tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-10',\n 'group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100',\n (isFlyoutOpen || shouldBeShown) && 'tw-opacity-100',\n ])}\n >\n <Toolbar\n isFlyoutOpen={isFlyoutOpen}\n isFlyoutDisabled={isFlyoutDisabled}\n setIsFlyoutOpen={setIsFlyoutOpen}\n flyoutItems={toolbarFlyoutItems}\n items={items}\n isDragging={isDragging}\n />\n </div>\n {children}\n </div>\n );\n};\n"],"names":["BlockItemWrapper","children","toolbarFlyoutItems","toolbarItems","shouldHideWrapper","shouldHideComponent","isDragging","shouldFillContainer","outlineOffset","shouldBeShown","isFlyoutOpen","setIsFlyoutOpen","useState","isFlyoutDisabled","setIsFlyoutDisabled","wrapperRef","useRef","useEffect","items","item","jsxs","joinClassNames","jsx","Toolbar"],"mappings":";;;;AAOO,MAAMA,IAAmB,CAAC;AAAA,EAC7B,UAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,YAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,eAAAC,IAAgB;AACpB,MAAgD;AAC5C,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAASH,CAAa,GACxD,CAACI,GAAkBC,CAAmB,IAAIF,EAAS,EAAK,GACxDG,IAAaC,EAAuB,IAAI;AAS9C,MAPAC,EAAU,MAAM;AACZ,IAAKP,KAEDI,EAAoB,EAAI;AAAA,EAC5B,GACD,CAACJ,CAAY,CAAC,GAEbN;AACO,WAAAH;AAGX,QAAMiB,IAAQf,KAAA,gBAAAA,EAAc,OAAO,CAACgB,MAA8BA,MAAS;AAGvE,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKL;AAAA,MACL,SAAS,MAAMD,EAAoB,EAAK;AAAA,MACxC,gBAAgB,MAAMA,EAAoB,EAAK;AAAA,MAC/C,gBAAa;AAAA,MACb,OAAO;AAAA,QACH,eAAAN;AAAA,MACJ;AAAA,MACA,WAAWa,EAAe;AAAA,QACtB;AAAA,QACAd,KAAuB;AAAA,QACvB;AAAA,SACCG,KAAgBD,MAAkB;AAAA,QACnCJ,KAAuB;AAAA,MAAA,CAC1B;AAAA,MAED,UAAA;AAAA,QAAAiB,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,OAAO;AAAA,cACH,OAAO,KAAKd;AAAA,cACZ,QAAQ,eAAe,IAAIA,CAAa;AAAA,YAC5C;AAAA,YACA,WAAWa,EAAe;AAAA,cACtB;AAAA,cACA;AAAA,eACCX,KAAgBD,MAAkB;AAAA,YAAA,CACtC;AAAA,YAED,UAAAa,gBAAAA,EAAA;AAAA,cAACC;AAAA,cAAA;AAAA,gBACG,cAAAb;AAAA,gBACA,kBAAAG;AAAA,gBACA,iBAAAF;AAAA,gBACA,aAAaT;AAAA,gBACb,OAAAgB;AAAA,gBACA,YAAAZ;AAAA,cAAA;AAAA,YACJ;AAAA,UAAA;AAAA,QACJ;AAAA,QACCL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { j as e } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { Tooltip as i, TooltipPosition as n, Flyout as p, IconDotsHorizontal16 as x, ActionMenu as h, MenuItemContentSize as m } from "@frontify/fondue";
|
|
3
|
+
import { DEFAULT_DRAGGING_TOOLTIP as u, DEFAULT_DRAG_TOOLTIP as f } from "./constants.es.js";
|
|
4
|
+
import { joinClassNames as j } from "../../utilities/react/joinClassNames.es.js";
|
|
5
|
+
const k = ({
|
|
6
|
+
items: w,
|
|
7
|
+
flyoutItems: l,
|
|
8
|
+
isFlyoutOpen: c,
|
|
9
|
+
setIsFlyoutOpen: a,
|
|
10
|
+
isDragging: r,
|
|
11
|
+
isFlyoutDisabled: d
|
|
12
|
+
}) => /* @__PURE__ */ e.jsx("div", { "data-test-id": "block-item-wrapper-toolbar", className: "tw-flex tw-justify-end", children: /* @__PURE__ */ e.jsxs("div", { className: "tw-bg-white tw-text-box-selected-inverse tw-pointer-events-auto tw-flex tw-flex-shrink-0 tw-gap-[2px] tw-px-[1px] tw-spacing tw-items-center tw-h-7 tw-self-start tw-border tw-border-box-selected-inverse tw-rounded", children: [
|
|
13
|
+
w.map(
|
|
14
|
+
(t, o) => "draggableProps" in t ? /* @__PURE__ */ e.jsx(
|
|
15
|
+
i,
|
|
16
|
+
{
|
|
17
|
+
withArrow: !0,
|
|
18
|
+
hoverDelay: 0,
|
|
19
|
+
enterDelay: 300,
|
|
20
|
+
open: r,
|
|
21
|
+
position: n.Top,
|
|
22
|
+
content: /* @__PURE__ */ e.jsx("div", { children: r ? u : t.tooltip ?? f }),
|
|
23
|
+
triggerElement: /* @__PURE__ */ e.jsx(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
ref: t.setActivatorNodeRef,
|
|
27
|
+
"data-test-id": "block-item-wrapper-toolbar-btn",
|
|
28
|
+
...t.draggableProps,
|
|
29
|
+
className: j([
|
|
30
|
+
"tw-bg-base tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm",
|
|
31
|
+
r ? "tw-cursor-grabbing tw-bg-box-selected-pressed" : "tw-cursor-grab hover:tw-bg-box-selected-hover"
|
|
32
|
+
]),
|
|
33
|
+
children: t.icon
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
},
|
|
37
|
+
o
|
|
38
|
+
) : /* @__PURE__ */ e.jsx(
|
|
39
|
+
i,
|
|
40
|
+
{
|
|
41
|
+
withArrow: !0,
|
|
42
|
+
enterDelay: 300,
|
|
43
|
+
hoverDelay: 0,
|
|
44
|
+
disabled: r,
|
|
45
|
+
position: n.Top,
|
|
46
|
+
content: /* @__PURE__ */ e.jsx("div", { children: t.tooltip ?? "" }),
|
|
47
|
+
triggerElement: /* @__PURE__ */ e.jsx(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
"data-test-id": "block-item-wrapper-toolbar-btn",
|
|
51
|
+
onClick: t.onClick,
|
|
52
|
+
className: "tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm",
|
|
53
|
+
children: t.icon
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
},
|
|
57
|
+
o
|
|
58
|
+
)
|
|
59
|
+
),
|
|
60
|
+
l.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6", children: /* @__PURE__ */ e.jsx(
|
|
61
|
+
p,
|
|
62
|
+
{
|
|
63
|
+
isOpen: c && !r,
|
|
64
|
+
isTriggerDisabled: d,
|
|
65
|
+
legacyFooter: !1,
|
|
66
|
+
fitContent: !0,
|
|
67
|
+
hug: !1,
|
|
68
|
+
onOpenChange: a,
|
|
69
|
+
trigger: /* @__PURE__ */ e.jsx(
|
|
70
|
+
i,
|
|
71
|
+
{
|
|
72
|
+
withArrow: !0,
|
|
73
|
+
hoverDelay: 0,
|
|
74
|
+
enterDelay: 300,
|
|
75
|
+
disabled: r,
|
|
76
|
+
position: n.Top,
|
|
77
|
+
content: /* @__PURE__ */ e.jsx("div", { children: "Options" }),
|
|
78
|
+
triggerElement: /* @__PURE__ */ e.jsx(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
"data-test-id": "block-item-wrapper-toolbar-flyout",
|
|
82
|
+
className: "tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm",
|
|
83
|
+
children: /* @__PURE__ */ e.jsx(x, {})
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
children: /* @__PURE__ */ e.jsx(
|
|
89
|
+
h,
|
|
90
|
+
{
|
|
91
|
+
menuBlocks: l.map((t, o) => ({
|
|
92
|
+
id: o.toString(),
|
|
93
|
+
menuItems: t.map((s, b) => ({
|
|
94
|
+
id: o.toString() + b.toString(),
|
|
95
|
+
size: m.XSmall,
|
|
96
|
+
title: s.title,
|
|
97
|
+
style: s.style,
|
|
98
|
+
onClick: () => {
|
|
99
|
+
a(!1), s.onClick();
|
|
100
|
+
},
|
|
101
|
+
initialValue: !0,
|
|
102
|
+
decorator: /* @__PURE__ */ e.jsx("div", { className: "tw-mr-2", children: s.icon })
|
|
103
|
+
}))
|
|
104
|
+
}))
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
] }) });
|
|
110
|
+
export {
|
|
111
|
+
k as Toolbar
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=Toolbar.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.es.js","sources":["../../../src/components/BlockItemWrapper/Toolbar.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ActionMenu,\n Flyout,\n IconDotsHorizontal16,\n MenuItemContentSize,\n Tooltip,\n TooltipPosition,\n} from '@frontify/fondue';\nimport { ToolbarProps } from './types';\nimport { joinClassNames } from '../../utilities';\nimport { DEFAULT_DRAGGING_TOOLTIP, DEFAULT_DRAG_TOOLTIP } from './constants';\n\nexport const Toolbar = ({\n items,\n flyoutItems,\n isFlyoutOpen,\n setIsFlyoutOpen,\n isDragging,\n isFlyoutDisabled,\n}: ToolbarProps) => {\n return (\n <div data-test-id=\"block-item-wrapper-toolbar\" className=\"tw-flex tw-justify-end\">\n <div className=\"tw-bg-white tw-text-box-selected-inverse tw-pointer-events-auto tw-flex tw-flex-shrink-0 tw-gap-[2px] tw-px-[1px] tw-spacing tw-items-center tw-h-7 tw-self-start tw-border tw-border-box-selected-inverse tw-rounded\">\n {items.map((item, i) =>\n 'draggableProps' in item ? (\n <Tooltip\n key={i}\n withArrow\n hoverDelay={0}\n enterDelay={300}\n open={isDragging}\n position={TooltipPosition.Top}\n content={\n <div>\n {isDragging ? DEFAULT_DRAGGING_TOOLTIP : item.tooltip ?? DEFAULT_DRAG_TOOLTIP}\n </div>\n }\n triggerElement={\n <button\n ref={item.setActivatorNodeRef}\n data-test-id=\"block-item-wrapper-toolbar-btn\"\n {...item.draggableProps}\n className={joinClassNames([\n 'tw-bg-base tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm',\n isDragging\n ? 'tw-cursor-grabbing tw-bg-box-selected-pressed'\n : 'tw-cursor-grab hover:tw-bg-box-selected-hover',\n ])}\n >\n {item.icon}\n </button>\n }\n />\n ) : (\n <Tooltip\n key={i}\n withArrow\n enterDelay={300}\n hoverDelay={0}\n disabled={isDragging}\n position={TooltipPosition.Top}\n content={<div>{item.tooltip ?? ''}</div>}\n triggerElement={\n <button\n data-test-id=\"block-item-wrapper-toolbar-btn\"\n onClick={item.onClick}\n className=\"tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm\"\n >\n {item.icon}\n </button>\n }\n />\n ),\n )}\n {flyoutItems.length > 0 && (\n <div className=\"tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6\">\n <Flyout\n isOpen={isFlyoutOpen && !isDragging}\n isTriggerDisabled={isFlyoutDisabled}\n legacyFooter={false}\n fitContent\n hug={false}\n onOpenChange={setIsFlyoutOpen}\n trigger={\n <Tooltip\n withArrow\n hoverDelay={0}\n enterDelay={300}\n disabled={isDragging}\n position={TooltipPosition.Top}\n content={<div>Options</div>}\n triggerElement={\n <div\n data-test-id=\"block-item-wrapper-toolbar-flyout\"\n className=\"tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm\"\n >\n <IconDotsHorizontal16 />\n </div>\n }\n />\n }\n >\n <ActionMenu\n menuBlocks={flyoutItems.map((block, blockIndex) => ({\n id: blockIndex.toString(),\n menuItems: block.map((item, itemIndex) => ({\n id: blockIndex.toString() + itemIndex.toString(),\n size: MenuItemContentSize.XSmall,\n title: item.title,\n style: item.style,\n onClick: () => {\n setIsFlyoutOpen(false);\n item.onClick();\n },\n initialValue: true,\n decorator: <div className=\"tw-mr-2\">{item.icon}</div>,\n })),\n }))}\n />\n </Flyout>\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["Toolbar","items","flyoutItems","isFlyoutOpen","setIsFlyoutOpen","isDragging","isFlyoutDisabled","jsx","jsxs","item","i","Tooltip","TooltipPosition","DEFAULT_DRAGGING_TOOLTIP","DEFAULT_DRAG_TOOLTIP","joinClassNames","Flyout","IconDotsHorizontal16","ActionMenu","block","blockIndex","itemIndex","MenuItemContentSize"],"mappings":";;;;AAcO,MAAMA,IAAU,CAAC;AAAA,EACpB,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,cAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,YAAAC;AAAA,EACA,kBAAAC;AACJ,MAEQC,gBAAAA,EAAA,IAAC,SAAI,gBAAa,8BAA6B,WAAU,0BACrD,UAAAC,gBAAAA,EAAA,KAAC,OAAI,EAAA,WAAU,yNACV,UAAA;AAAA,EAAMP,EAAA;AAAA,IAAI,CAACQ,GAAMC,MACd,oBAAoBD,IAChBF,gBAAAA,EAAA;AAAA,MAACI;AAAA,MAAA;AAAA,QAEG,WAAS;AAAA,QACT,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,MAAMN;AAAA,QACN,UAAUO,EAAgB;AAAA,QAC1B,SACKL,gBAAAA,EAAAA,IAAA,OAAA,EACI,cAAaM,IAA2BJ,EAAK,WAAWK,GAC7D;AAAA,QAEJ,gBACIP,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,KAAKE,EAAK;AAAA,YACV,gBAAa;AAAA,YACZ,GAAGA,EAAK;AAAA,YACT,WAAWM,EAAe;AAAA,cACtB;AAAA,cACAV,IACM,kDACA;AAAA,YAAA,CACT;AAAA,YAEA,UAAKI,EAAA;AAAA,UAAA;AAAA,QACV;AAAA,MAAA;AAAA,MAxBCC;AAAA,IAAA,IA4BTH,gBAAAA,EAAA;AAAA,MAACI;AAAA,MAAA;AAAA,QAEG,WAAS;AAAA,QACT,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,UAAUN;AAAA,QACV,UAAUO,EAAgB;AAAA,QAC1B,SAASL,gBAAAA,EAAA,IAAC,OAAK,EAAA,UAAAE,EAAK,WAAW,IAAG;AAAA,QAClC,gBACIF,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,gBAAa;AAAA,YACb,SAASE,EAAK;AAAA,YACd,WAAU;AAAA,YAET,UAAKA,EAAA;AAAA,UAAA;AAAA,QACV;AAAA,MAAA;AAAA,MAdCC;AAAA,IAgBT;AAAA,EAER;AAAA,EACCR,EAAY,SAAS,KACjBK,gBAAAA,EAAA,IAAA,OAAA,EAAI,WAAU,6CACX,UAAAA,gBAAAA,EAAA;AAAA,IAACS;AAAA,IAAA;AAAA,MACG,QAAQb,KAAgB,CAACE;AAAA,MACzB,mBAAmBC;AAAA,MACnB,cAAc;AAAA,MACd,YAAU;AAAA,MACV,KAAK;AAAA,MACL,cAAcF;AAAA,MACd,SACIG,gBAAAA,EAAA;AAAA,QAACI;AAAA,QAAA;AAAA,UACG,WAAS;AAAA,UACT,YAAY;AAAA,UACZ,YAAY;AAAA,UACZ,UAAUN;AAAA,UACV,UAAUO,EAAgB;AAAA,UAC1B,SAAUL,gBAAAA,EAAAA,IAAA,OAAA,EAAI,UAAO,UAAA,CAAA;AAAA,UACrB,gBACIA,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,gBAAa;AAAA,cACb,WAAU;AAAA,cAEV,gCAACU,GAAqB,EAAA;AAAA,YAAA;AAAA,UAC1B;AAAA,QAAA;AAAA,MAER;AAAA,MAGJ,UAAAV,gBAAAA,EAAA;AAAA,QAACW;AAAA,QAAA;AAAA,UACG,YAAYhB,EAAY,IAAI,CAACiB,GAAOC,OAAgB;AAAA,YAChD,IAAIA,EAAW,SAAS;AAAA,YACxB,WAAWD,EAAM,IAAI,CAACV,GAAMY,OAAe;AAAA,cACvC,IAAID,EAAW,aAAaC,EAAU,SAAS;AAAA,cAC/C,MAAMC,EAAoB;AAAA,cAC1B,OAAOb,EAAK;AAAA,cACZ,OAAOA,EAAK;AAAA,cACZ,SAAS,MAAM;AACX,gBAAAL,EAAgB,EAAK,GACrBK,EAAK,QAAQ;AAAA,cACjB;AAAA,cACA,cAAc;AAAA,cACd,WAAYF,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,WAAW,YAAK,MAAK;AAAA,YAAA,EACjD;AAAA,UAAA,EACJ;AAAA,QAAA;AAAA,MACN;AAAA,IAAA;AAAA,EAAA,GAER;AAAA,EAER,CAAA,EACJ,CAAA;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.es.js","sources":["../../../src/components/BlockItemWrapper/constants.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const DEFAULT_DRAG_TOOLTIP = 'Drag or press ↵ to move';\nexport const DEFAULT_DRAGGING_TOOLTIP = 'Move with ↑↓←→ and confirm with ↵';\n"],"names":["DEFAULT_DRAG_TOOLTIP","DEFAULT_DRAGGING_TOOLTIP"],"mappings":"AAEO,MAAMA,IAAuB,2BACvBC,IAA2B;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { j as t } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useFocusRing as s } from "@react-aria/focus";
|
|
3
|
+
import { Tooltip as i, TooltipPosition as l, FOCUS_STYLE as a, IconArrowCircleDown16 as w } from "@frontify/fondue";
|
|
4
|
+
import { joinClassNames as u } from "../../utilities/react/joinClassNames.es.js";
|
|
5
|
+
const m = ({ onDownload: o }) => {
|
|
6
|
+
const { isFocused: e, focusProps: n } = s();
|
|
7
|
+
return /* @__PURE__ */ t.jsx(
|
|
8
|
+
i,
|
|
9
|
+
{
|
|
10
|
+
withArrow: !0,
|
|
11
|
+
position: l.Top,
|
|
12
|
+
content: "Download",
|
|
13
|
+
enterDelay: 500,
|
|
14
|
+
triggerElement: /* @__PURE__ */ t.jsx(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
tabIndex: 0,
|
|
18
|
+
"aria-label": "Download",
|
|
19
|
+
...n,
|
|
20
|
+
className: u(["tw-outline-none tw-rounded", e && a]),
|
|
21
|
+
onClick: o,
|
|
22
|
+
onPointerDown: (r) => r.preventDefault(),
|
|
23
|
+
children: /* @__PURE__ */ t.jsx(
|
|
24
|
+
"span",
|
|
25
|
+
{
|
|
26
|
+
"data-test-id": "download-button",
|
|
27
|
+
className: "tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line",
|
|
28
|
+
children: /* @__PURE__ */ t.jsx(w, {})
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
m as DownloadButton
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=DownloadButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadButton.es.js","sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { DownloadButtonProps } from './types';\nimport { useFocusRing } from '@react-aria/focus';\nimport { FOCUS_STYLE, IconArrowCircleDown16, Tooltip, TooltipPosition } from '@frontify/fondue';\nimport { joinClassNames } from '../../utilities';\n\nexport const DownloadButton = ({ onDownload }: DownloadButtonProps) => {\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <Tooltip\n withArrow\n position={TooltipPosition.Top}\n content=\"Download\"\n enterDelay={500}\n triggerElement={\n <button\n tabIndex={0}\n aria-label=\"Download\"\n {...focusProps}\n className={joinClassNames(['tw-outline-none tw-rounded', isFocused && FOCUS_STYLE])}\n onClick={onDownload}\n onPointerDown={(e) => e.preventDefault()}\n >\n <span\n data-test-id=\"download-button\"\n className=\"tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line\"\n >\n <IconArrowCircleDown16 />\n </span>\n </button>\n }\n />\n );\n};\n"],"names":["DownloadButton","onDownload","isFocused","focusProps","useFocusRing","jsx","Tooltip","TooltipPosition","joinClassNames","FOCUS_STYLE","e","IconArrowCircleDown16"],"mappings":";;;;AAOO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,QAAsC;AACnE,QAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAa;AAG3C,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,WAAS;AAAA,MACT,UAAUC,EAAgB;AAAA,MAC1B,SAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBACIF,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,cAAW;AAAA,UACV,GAAGF;AAAA,UACJ,WAAWK,EAAe,CAAC,8BAA8BN,KAAaO,CAAW,CAAC;AAAA,UAClF,SAASR;AAAA,UACT,eAAe,CAACS,MAAMA,EAAE,eAAe;AAAA,UAEvC,UAAAL,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,gBAAa;AAAA,cACb,WAAU;AAAA,cAEV,gCAACM,GAAsB,EAAA;AAAA,YAAA;AAAA,UAC3B;AAAA,QAAA;AAAA,MACJ;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { j as a } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useState as h, useEffect as p } from "react";
|
|
3
|
+
import { RichTextEditor as E } from "@frontify/fondue";
|
|
4
|
+
import { SerializedText as g } from "./SerializedText.es.js";
|
|
5
|
+
import { floatingButtonSelectors as v, floatingButtonActions as T } from "./plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js";
|
|
6
|
+
const S = ({
|
|
7
|
+
id: d = "rte",
|
|
8
|
+
isEditing: f,
|
|
9
|
+
value: t,
|
|
10
|
+
columns: l,
|
|
11
|
+
gap: u,
|
|
12
|
+
placeholder: c,
|
|
13
|
+
plugins: r,
|
|
14
|
+
onTextChange: o,
|
|
15
|
+
showSerializedText: m
|
|
16
|
+
}) => {
|
|
17
|
+
const [n, s] = h(!1), x = (e) => {
|
|
18
|
+
o && e !== t && o(e), s(!1);
|
|
19
|
+
};
|
|
20
|
+
return p(() => {
|
|
21
|
+
const e = (i) => (i.preventDefault(), i.returnValue = "Unprocessed changes");
|
|
22
|
+
return n && window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
23
|
+
}, [n]), f ? /* @__PURE__ */ a.jsx(
|
|
24
|
+
E,
|
|
25
|
+
{
|
|
26
|
+
id: d,
|
|
27
|
+
value: t,
|
|
28
|
+
border: !1,
|
|
29
|
+
placeholder: c,
|
|
30
|
+
plugins: r,
|
|
31
|
+
onValueChanged: () => s(!0),
|
|
32
|
+
onTextChange: x,
|
|
33
|
+
hideExternalFloatingModals: (e) => {
|
|
34
|
+
v.isOpen(e) && T.reset();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ a.jsx(g, { value: t, columns: l, gap: u, show: m, plugins: r });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
S as RichTextEditor
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=RichTextEditor.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextEditor.es.js","sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useState } from 'react';\n\nimport { RichTextEditor as FondueRichTextEditor } from '@frontify/fondue';\nimport { RichTextEditorProps } from './types';\nimport { SerializedText } from './SerializedText';\nimport { floatingButtonActions, floatingButtonSelectors } from './plugins/ButtonPlugin/components';\n\nexport const RichTextEditor = ({\n id = 'rte',\n isEditing,\n value,\n columns,\n gap,\n placeholder,\n plugins,\n onTextChange,\n showSerializedText,\n}: RichTextEditorProps) => {\n const [shouldPreventPageLeave, setShouldPreventPageLeave] = useState(false);\n\n const saveText = (newContent: string) => {\n if (onTextChange && newContent !== value) {\n onTextChange(newContent);\n }\n setShouldPreventPageLeave(false);\n };\n\n useEffect(() => {\n const unloadHandler = (event: BeforeUnloadEvent) => {\n event.preventDefault();\n return (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 (isEditing) {\n return (\n <FondueRichTextEditor\n id={id}\n value={value}\n border={false}\n placeholder={placeholder}\n plugins={plugins}\n onValueChanged={() => setShouldPreventPageLeave(true)}\n onTextChange={saveText}\n hideExternalFloatingModals={(editorId: string) => {\n if (floatingButtonSelectors.isOpen(editorId)) {\n floatingButtonActions.reset();\n }\n }}\n />\n );\n }\n return <SerializedText value={value} columns={columns} gap={gap} show={showSerializedText} plugins={plugins} />;\n};\n"],"names":["RichTextEditor","id","isEditing","value","columns","gap","placeholder","plugins","onTextChange","showSerializedText","shouldPreventPageLeave","setShouldPreventPageLeave","useState","saveText","newContent","useEffect","unloadHandler","event","jsx","FondueRichTextEditor","editorId","floatingButtonSelectors","floatingButtonActions","SerializedText"],"mappings":";;;;;AASO,MAAMA,IAAiB,CAAC;AAAA,EAC3B,IAAAC,IAAK;AAAA,EACL,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,KAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,oBAAAC;AACJ,MAA2B;AACvB,QAAM,CAACC,GAAwBC,CAAyB,IAAIC,EAAS,EAAK,GAEpEC,IAAW,CAACC,MAAuB;AACjC,IAAAN,KAAgBM,MAAeX,KAC/BK,EAAaM,CAAU,GAE3BH,EAA0B,EAAK;AAAA,EAAA;AAgBnC,SAbAI,EAAU,MAAM;AACN,UAAAC,IAAgB,CAACC,OACnBA,EAAM,eAAe,GACbA,EAAM,cAAc;AAGhC,WAAIP,KACO,OAAA,iBAAiB,gBAAgBM,CAAa,GAGlD,MAAM,OAAO,oBAAoB,gBAAgBA,CAAa;AAAA,EAAA,GACtE,CAACN,CAAsB,CAAC,GAEvBR,IAEIgB,gBAAAA,EAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACG,IAAAlB;AAAA,MACA,OAAAE;AAAA,MACA,QAAQ;AAAA,MACR,aAAAG;AAAA,MACA,SAAAC;AAAA,MACA,gBAAgB,MAAMI,EAA0B,EAAI;AAAA,MACpD,cAAcE;AAAA,MACd,4BAA4B,CAACO,MAAqB;AAC1C,QAAAC,EAAwB,OAAOD,CAAQ,KACvCE,EAAsB,MAAM;AAAA,MAEpC;AAAA,IAAA;AAAA,EAAA,0BAIJC,GAAe,EAAA,OAAApB,GAAc,SAAAC,GAAkB,KAAAC,GAAU,MAAMI,GAAoB,SAAAF,EAAkB,CAAA;AACjH;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { j as a } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useState as i, useEffect as o } from "react";
|
|
3
|
+
import { serializeRawToHtmlAsync as u } from "./serializer/serializeToHtml.es.js";
|
|
4
|
+
const c = ({ value: e = "", gap: l, columns: r, show: m = !0, plugins: s }) => {
|
|
5
|
+
const [t, n] = i(null);
|
|
6
|
+
return o(() => {
|
|
7
|
+
(async () => n(await u(e, r, l, s)))();
|
|
8
|
+
}, [e, r, l, s]), !m || t === "<br />" ? null : t !== null ? /* @__PURE__ */ a.jsx("div", { className: "tw-w-full", "data-test-id": "rte-content-html", dangerouslySetInnerHTML: { __html: t } }) : /* @__PURE__ */ a.jsx("div", { className: "tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full" });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
c as SerializedText
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=SerializedText.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SerializedText.es.js","sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useState } from 'react';\nimport { SerializedTextProps } from './types';\nimport { serializeRawToHtmlAsync } from './serializer';\n\nexport const SerializedText = ({ value = '', gap, columns, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n (async () => {\n setHtml(await serializeRawToHtmlAsync(value, columns, gap, plugins));\n })();\n }, [value, columns, gap, plugins]);\n\n if (!show || html === '<br />') {\n return null;\n }\n\n return html !== null ? (\n <div className=\"tw-w-full\" data-test-id=\"rte-content-html\" dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <div className=\"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full\" />\n );\n};\n"],"names":["SerializedText","value","gap","columns","show","plugins","html","setHtml","useState","useEffect","serializeRawToHtmlAsync","jsx"],"mappings":";;;AAMa,MAAAA,IAAiB,CAAC,EAAE,OAAAC,IAAQ,IAAI,KAAAC,GAAK,SAAAC,GAAS,MAAAC,IAAO,IAAM,SAAAC,QAAmC;AACvG,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAwB,IAAI;AAQhD,SANJC,EAAU,MAAM;AACZ,KAAC,YACGF,EAAQ,MAAMG,EAAwBT,GAAOE,GAASD,GAAKG,CAAO,CAAC;AAAA,KAExE,CAACJ,GAAOE,GAASD,GAAKG,CAAO,CAAC,GAE7B,CAACD,KAAQE,MAAS,WACX,OAGJA,MAAS,OACZK,gBAAAA,MAAC,OAAI,EAAA,WAAU,aAAY,gBAAa,oBAAmB,yBAAyB,EAAE,QAAQL,EAAK,EAAA,CAAG,IAErGK,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,oFAAoF,CAAA;AAE3G;"}
|
|
@@ -0,0 +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"],"names":["THEME_PREFIX"],"mappings":"AAEO,MAAMA,IAAe;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PluginComposer as i, SoftBreakPlugin as t, TextStylePlugin as l, BoldPlugin as g, ItalicPlugin as u, UnderlinePlugin as o, StrikethroughPlugin as r, CodePlugin as P, AlignLeftPlugin as s, AlignCenterPlugin as w, AlignRightPlugin as m, AlignJustifyPlugin as d, UnorderedListPlugin as a, CheckboxListPlugin as y, OrderedListPlugin as f, ResetFormattingPlugin as h } from "@frontify/fondue";
|
|
2
|
+
import { TextStylePluginsWithoutImage as p, TextStylesWithoutImage as e } from "../plugins/TextStylePlugins/helpers.es.js";
|
|
3
|
+
import { LinkPlugin as T } from "../plugins/LinkPlugin/index.es.js";
|
|
4
|
+
import { ButtonPlugin as x } from "../plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
5
|
+
const v = (n) => new i().setPlugin(
|
|
6
|
+
new t(),
|
|
7
|
+
new l({
|
|
8
|
+
textStyles: p
|
|
9
|
+
})
|
|
10
|
+
).setPlugin(
|
|
11
|
+
[
|
|
12
|
+
new g(),
|
|
13
|
+
new u(),
|
|
14
|
+
new o(),
|
|
15
|
+
new r(),
|
|
16
|
+
new T({ appBridge: n }),
|
|
17
|
+
new x({ appBridge: n }),
|
|
18
|
+
new P()
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
new s({ validTypes: e }),
|
|
22
|
+
new w({ validTypes: e }),
|
|
23
|
+
new m({ validTypes: e }),
|
|
24
|
+
new d({ validTypes: e }),
|
|
25
|
+
new a(),
|
|
26
|
+
new y(),
|
|
27
|
+
new f(),
|
|
28
|
+
new h()
|
|
29
|
+
]
|
|
30
|
+
);
|
|
31
|
+
export {
|
|
32
|
+
v as getDefaultPluginsWithLinkChooser
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=defaultPluginsWithLinkChooser.es.js.map
|
|
@@ -0,0 +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 { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n OrderedListPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n UnorderedListPlugin,\n} from '@frontify/fondue';\nimport { ButtonPlugin, LinkPlugin, TextStylePluginsWithoutImage, TextStylesWithoutImage } 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 ],\n );\n};\n"],"names":["getDefaultPluginsWithLinkChooser","appBridge","PluginComposer","SoftBreakPlugin","TextStylePlugin","TextStylePluginsWithoutImage","BoldPlugin","ItalicPlugin","UnderlinePlugin","StrikethroughPlugin","LinkPlugin","ButtonPlugin","CodePlugin","AlignLeftPlugin","TextStylesWithoutImage","AlignCenterPlugin","AlignRightPlugin","AlignJustifyPlugin","UnorderedListPlugin","CheckboxListPlugin","OrderedListPlugin","ResetFormattingPlugin"],"mappings":";;;;AAuBa,MAAAA,IAAmC,CAACC,MACtC,IAAIC,IACN;AAAA,EACG,IAAIC,EAAgB;AAAA,EACpB,IAAIC,EAAgB;AAAA,IAChB,YAAYC;AAAA,EAAA,CACf;AAAA,EAEJ;AAAA,EACG;AAAA,IACI,IAAIC,EAAW;AAAA,IACf,IAAIC,EAAa;AAAA,IACjB,IAAIC,EAAgB;AAAA,IACpB,IAAIC,EAAoB;AAAA,IACxB,IAAIC,EAAW,EAAE,WAAAT,GAAW;AAAA,IAC5B,IAAIU,EAAa,EAAE,WAAAV,GAAW;AAAA,IAC9B,IAAIW,EAAW;AAAA,EACnB;AAAA,EACA;AAAA,IACI,IAAIC,EAAgB,EAAE,YAAYC,GAAwB;AAAA,IAC1D,IAAIC,EAAkB,EAAE,YAAYD,GAAwB;AAAA,IAC5D,IAAIE,EAAiB,EAAE,YAAYF,GAAwB;AAAA,IAC3D,IAAIG,EAAmB,EAAE,YAAYH,GAAwB;AAAA,IAC7D,IAAII,EAAoB;AAAA,IACxB,IAAIC,EAAmB;AAAA,IACvB,IAAIC,EAAkB;AAAA,IACtB,IAAIC,EAAsB;AAAA,EAC9B;AAAA;"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { j as a } from "../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useElementProps as p } from "@udecode/plate";
|
|
3
|
+
import { useState as l } from "react";
|
|
4
|
+
import { BlockButtonStyles as i } from "../utils/styles.es.js";
|
|
5
|
+
const c = (e) => ({
|
|
6
|
+
...p({
|
|
7
|
+
...e,
|
|
8
|
+
elementToAttributes: (t) => ({
|
|
9
|
+
url: t.href,
|
|
10
|
+
buttonStyle: t.buttonStyle || "primary",
|
|
11
|
+
target: t.target || "_blank"
|
|
12
|
+
})
|
|
13
|
+
}),
|
|
14
|
+
// quick fix: hovering <a> with href loses the editor focus
|
|
15
|
+
onMouseOver: (t) => {
|
|
16
|
+
t.stopPropagation();
|
|
17
|
+
}
|
|
18
|
+
}), x = (e) => {
|
|
19
|
+
const { href: o, target: t, buttonStyle: r } = c(e), { attributes: n, children: s } = e;
|
|
20
|
+
return /* @__PURE__ */ a.jsx(
|
|
21
|
+
m,
|
|
22
|
+
{
|
|
23
|
+
attributes: n,
|
|
24
|
+
href: o,
|
|
25
|
+
target: t,
|
|
26
|
+
styles: i[`button${r.charAt(0).toUpperCase() + r.slice(1)}`],
|
|
27
|
+
children: s
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}, m = ({
|
|
31
|
+
attributes: e,
|
|
32
|
+
styles: o = { hover: {} },
|
|
33
|
+
children: t,
|
|
34
|
+
href: r = "#",
|
|
35
|
+
target: n
|
|
36
|
+
}) => {
|
|
37
|
+
const [s, u] = l(!1);
|
|
38
|
+
return /* @__PURE__ */ a.jsx(
|
|
39
|
+
"a",
|
|
40
|
+
{
|
|
41
|
+
...e,
|
|
42
|
+
onMouseEnter: () => u(!0),
|
|
43
|
+
onMouseLeave: () => u(!1),
|
|
44
|
+
href: r,
|
|
45
|
+
target: n,
|
|
46
|
+
style: s ? { ...o, ...o.hover } : o,
|
|
47
|
+
children: t
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
x as ButtonMarkupElementNode
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=ButtonMarkupElementNode.es.js.map
|
|
@@ -0,0 +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 { HTMLPropsAs, PlateRenderElementProps, Value, useElementProps } from '@udecode/plate';\nimport { CSSProperties, HTMLAttributeAnchorTarget, ReactElement, ReactNode, useState } from 'react';\nimport { RichTextButtonStyle, TButtonElement } from '../types';\nimport { BlockButtonStyles } from '../utils';\n\nexport type ButtonRootProps = PlateRenderElementProps<Value, TButtonElement> & HTMLPropsAs<'a'>;\n\nconst useButton = (props: ButtonRootProps): HTMLPropsAs<'a'> & { buttonStyle: RichTextButtonStyle } => {\n const _props = useElementProps<TButtonElement, 'a'>({\n ...props,\n elementToAttributes: (element) => ({\n url: element.href,\n buttonStyle: element.buttonStyle || 'primary',\n target: element.target || '_blank',\n }),\n });\n\n return {\n ...(_props as HTMLPropsAs<'a'> & { buttonStyle: RichTextButtonStyle }),\n // quick fix: hovering <a> with href loses the editor focus\n onMouseOver: (e) => {\n e.stopPropagation();\n },\n };\n};\n\nexport const ButtonMarkupElementNode = (props: ButtonRootProps) => {\n const { href, target, buttonStyle } = useButton(props);\n const { attributes, children } = props;\n\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"],"names":["useButton","props","useElementProps","element","e","ButtonMarkupElementNode","href","target","buttonStyle","attributes","children","jsx","HoverableButtonLink","BlockButtonStyles","styles","hovered","setHovered","useState"],"mappings":";;;;AASA,MAAMA,IAAY,CAACC,OAUR;AAAA,EACH,GAVWC,EAAqC;AAAA,IAChD,GAAGD;AAAA,IACH,qBAAqB,CAACE,OAAa;AAAA,MAC/B,KAAKA,EAAQ;AAAA,MACb,aAAaA,EAAQ,eAAe;AAAA,MACpC,QAAQA,EAAQ,UAAU;AAAA,IAAA;AAAA,EAC9B,CACH;AAAA;AAAA,EAKG,aAAa,CAACC,MAAM;AAChB,IAAAA,EAAE,gBAAgB;AAAA,EACtB;AAAA,IAIKC,IAA0B,CAACJ,MAA2B;AAC/D,QAAM,EAAE,MAAAK,GAAM,QAAAC,GAAQ,aAAAC,EAAY,IAAIR,EAAUC,CAAK,GAC/C,EAAE,YAAAQ,GAAY,UAAAC,EAAa,IAAAT;AAG7B,SAAAU,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,YAAAH;AAAA,MACA,MAAAH;AAAA,MACA,QAAAC;AAAA,MACA,QAAQM,EAAkB,SAASL,EAAY,OAAO,CAAC,EAAE,YAAgB,IAAAA,EAAY,MAAM,CAAC,CAAC,EAAE;AAAA,MAE9F,UAAAE;AAAA,IAAA;AAAA,EAAA;AAGb,GAUME,IAAsB,CAAC;AAAA,EACzB,YAAAH;AAAA,EACA,QAAAK,IAAS,EAAE,OAAO,GAAG;AAAA,EACrB,UAAAJ;AAAA,EACA,MAAAJ,IAAO;AAAA,EACP,QAAAC;AACJ,MAA2B;AACvB,QAAM,CAACQ,GAASC,CAAU,IAAIC,EAAS,EAAK;AAGxC,SAAAN,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACI,GAAGF;AAAA,MACJ,cAAc,MAAMO,EAAW,EAAI;AAAA,MACnC,cAAc,MAAMA,EAAW,EAAK;AAAA,MACpC,MAAAV;AAAA,MACA,QAAAC;AAAA,MACA,OAAOQ,IAAU,EAAE,GAAGD,GAAQ,GAAGA,EAAO,UAAUA;AAAA,MAEjD,UAAAJ;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MarkupElement as o } from "@frontify/fondue";
|
|
2
|
+
import { ELEMENT_BUTTON as e } from "../createButtonPlugin.es.js";
|
|
3
|
+
import { ButtonMarkupElementNode as m } from "./ButtonMarkupElementNode.es.js";
|
|
4
|
+
class s extends o {
|
|
5
|
+
constructor(t = e, r = m) {
|
|
6
|
+
super(t, r);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
s as ButtonMarkupElement
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.es.js.map
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map
ADDED
|
@@ -0,0 +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';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { ButtonMarkupElementNode } from './ButtonMarkupElementNode';\n\nexport class ButtonMarkupElement extends MarkupElement {\n constructor(id = ELEMENT_BUTTON, node = ButtonMarkupElementNode) {\n super(id, node);\n }\n}\n"],"names":["ButtonMarkupElement","MarkupElement","id","ELEMENT_BUTTON","node","ButtonMarkupElementNode"],"mappings":";;;AAMO,MAAMA,UAA4BC,EAAc;AAAA,EACnD,YAAYC,IAAKC,GAAgBC,IAAOC,GAAyB;AAC7D,UAAMH,GAAIE,CAAI;AAAA,EAClB;AACJ;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { j as t } from "../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { IconButton16 as r, buttonStyles as e } from "@frontify/fondue";
|
|
3
|
+
import { getPluginType as s } from "@udecode/plate";
|
|
4
|
+
import { ELEMENT_BUTTON as i } from "../createButtonPlugin.es.js";
|
|
5
|
+
import { ButtonToolbarButton as m } from "./ButtonToolbarButton.es.js";
|
|
6
|
+
const a = ({ editor: o, id: n }) => /* @__PURE__ */ t.jsx("div", { "data-plugin-id": n, children: /* @__PURE__ */ t.jsx(
|
|
7
|
+
m,
|
|
8
|
+
{
|
|
9
|
+
type: s(o, i),
|
|
10
|
+
icon: /* @__PURE__ */ t.jsx("span", { className: "tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex", children: /* @__PURE__ */ t.jsx(r, {}) }),
|
|
11
|
+
styles: e
|
|
12
|
+
}
|
|
13
|
+
) });
|
|
14
|
+
export {
|
|
15
|
+
a as ButtonButton
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=ButtonButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { IconButton16, PluginButtonProps, buttonStyles } from '@frontify/fondue';\nimport { getPluginType } from '@udecode/plate';\nimport { ELEMENT_BUTTON } from '../createButtonPlugin';\nimport { ButtonToolbarButton } from './ButtonToolbarButton';\n\nexport const ButtonButton = ({ editor, id }: PluginButtonProps) => (\n <div data-plugin-id={id}>\n <ButtonToolbarButton\n type={getPluginType(editor, ELEMENT_BUTTON)}\n icon={\n <span className=\"tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex\">\n <IconButton16 />\n </span>\n }\n styles={buttonStyles}\n />\n </div>\n);\n"],"names":["ButtonButton","editor","id","jsx","ButtonToolbarButton","getPluginType","ELEMENT_BUTTON","IconButton16","buttonStyles"],"mappings":";;;;;AAOa,MAAAA,IAAe,CAAC,EAAE,QAAAC,GAAQ,IAAAC,QACnCC,gBAAAA,EAAAA,IAAC,OAAI,EAAA,kBAAgBD,GACjB,UAAAC,gBAAAA,EAAA;AAAA,EAACC;AAAA,EAAA;AAAA,IACG,MAAMC,EAAcJ,GAAQK,CAAc;AAAA,IAC1C,MACKH,gBAAAA,EAAA,IAAA,QAAA,EAAK,WAAU,2DACZ,UAAAA,gBAAAA,MAACI,IAAa,CAAA,GAClB;AAAA,IAEJ,QAAQC;AAAA,EAAA;AACZ,EACJ,CAAA;"}
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { j as i } from "../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { getTooltip as a, getHotkeyByPlatform as l, getButtonClassNames as c } from "@frontify/fondue";
|
|
3
|
+
import { useEditorRef as u, isRangeInSameBlock as m, someNode as f, ToolbarButton as p, focusEditor as g } from "@udecode/plate";
|
|
4
|
+
import { triggerFloatingButton as B } from "../utils/triggerFloatingButton.es.js";
|
|
5
|
+
const y = ({ type: s, ...n }) => {
|
|
6
|
+
const t = u(), o = !!m(t, {
|
|
7
|
+
at: t.selection
|
|
8
|
+
}), r = !!(t != null && t.selection) && f(t, { match: { type: s } });
|
|
9
|
+
return /* @__PURE__ */ i.jsx(
|
|
10
|
+
p,
|
|
11
|
+
{
|
|
12
|
+
tooltip: a(
|
|
13
|
+
o ? `Button
|
|
14
|
+
${l("Ctrl+Shift+K")}` : "Buttons can only be set for a single text block."
|
|
15
|
+
),
|
|
16
|
+
classNames: c(o),
|
|
17
|
+
active: r,
|
|
18
|
+
onMouseDown: async (e) => {
|
|
19
|
+
t && (e.preventDefault(), e.stopPropagation(), g(t, t.selection ?? t.prevSelection ?? void 0), setTimeout(() => {
|
|
20
|
+
B(t, { focused: !0 });
|
|
21
|
+
}, 0));
|
|
22
|
+
},
|
|
23
|
+
...n
|
|
24
|
+
}
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
y as ButtonToolbarButton
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=ButtonToolbarButton.es.js.map
|
package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ButtonToolbarButton.es.js","sources":["../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { getButtonClassNames, getHotkeyByPlatform, getTooltip } from '@frontify/fondue';\nimport {\n BlockToolbarButtonProps,\n ToolbarButton,\n focusEditor,\n isRangeInSameBlock,\n someNode,\n useEditorRef,\n} from '@udecode/plate';\n\nimport { triggerFloatingButton } from '../utils';\n\nexport interface LinkToolbarButtonProps extends BlockToolbarButtonProps {\n /**\n * Default onMouseDown is getting the link url by calling this promise before inserting the image.\n */\n getLinkUrl?: (prevUrl: string | null) => Promise<string | null>;\n}\n\nexport const ButtonToolbarButton = ({ type, ...props }: LinkToolbarButtonProps) => {\n const editor = useEditorRef();\n const isEnabled = !!isRangeInSameBlock(editor, {\n at: editor.selection,\n });\n\n const isLink = !!editor?.selection && someNode(editor, { match: { type } });\n\n return (\n <ToolbarButton\n tooltip={getTooltip(\n isEnabled\n ? `Button\\n${getHotkeyByPlatform('Ctrl+Shift+K')}`\n : 'Buttons can only be set for a single text block.',\n )}\n classNames={getButtonClassNames(isEnabled)}\n active={isLink}\n onMouseDown={async (event) => {\n if (!editor) {\n return;\n }\n\n event.preventDefault();\n event.stopPropagation();\n\n focusEditor(editor, editor.selection ?? editor.prevSelection ?? undefined);\n\n setTimeout(() => {\n triggerFloatingButton(editor, { focused: true });\n }, 0);\n }}\n {...props}\n />\n );\n};\n"],"names":["ButtonToolbarButton","type","props","editor","useEditorRef","isEnabled","isRangeInSameBlock","isLink","someNode","jsx","ToolbarButton","getTooltip","getHotkeyByPlatform","getButtonClassNames","event","focusEditor","triggerFloatingButton"],"mappings":";;;;AAqBO,MAAMA,IAAsB,CAAC,EAAE,MAAAC,GAAM,GAAGC,QAAoC;AAC/E,QAAMC,IAASC,KACTC,IAAY,CAAC,CAACC,EAAmBH,GAAQ;AAAA,IAC3C,IAAIA,EAAO;AAAA,EAAA,CACd,GAEKI,IAAS,CAAC,EAACJ,KAAA,QAAAA,EAAQ,cAAaK,EAASL,GAAQ,EAAE,OAAO,EAAE,MAAAF,EAAK,EAAG,CAAA;AAGtE,SAAAQ,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,SAASC;AAAA,QACLN,IACM;AAAA,EAAWO,EAAoB,cAAc,CAAC,KAC9C;AAAA,MACV;AAAA,MACA,YAAYC,EAAoBR,CAAS;AAAA,MACzC,QAAQE;AAAA,MACR,aAAa,OAAOO,MAAU;AAC1B,QAAKX,MAILW,EAAM,eAAe,GACrBA,EAAM,gBAAgB,GAEtBC,EAAYZ,GAAQA,EAAO,aAAaA,EAAO,iBAAiB,MAAS,GAEzE,WAAW,MAAM;AACb,UAAAa,EAAsBb,GAAQ,EAAE,SAAS,GAAM,CAAA;AAAA,WAChD,CAAC;AAAA,MACR;AAAA,MACC,GAAGD;AAAA,IAAA;AAAA,EAAA;AAGhB;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { j as t } from "../../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { EditModal as s } from "./EditButtonModal/EditModal.es.js";
|
|
3
|
+
import { FloatingButton as n } from "./FloatingButton.es.js";
|
|
4
|
+
import { useFloatingButtonSelectors as e } from "./floatingButtonStore.es.js";
|
|
5
|
+
import { InsertButtonModal as m } from "./InsertButtonModal/InsertButtonModal.es.js";
|
|
6
|
+
const x = () => {
|
|
7
|
+
const i = e().isEditing(), o = /* @__PURE__ */ t.jsx(m, {}), r = i ? o : /* @__PURE__ */ t.jsx(s, {});
|
|
8
|
+
return /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
9
|
+
/* @__PURE__ */ t.jsx(n.InsertRoot, { children: o }),
|
|
10
|
+
/* @__PURE__ */ t.jsx(n.EditRoot, { children: r })
|
|
11
|
+
] });
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
x as CustomFloatingButton
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=CustomFloatingButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomFloatingButton.es.js","sources":["../../../../../../../src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { EditModal } from './EditButtonModal/EditModal';\nimport { FloatingButton } from './FloatingButton';\nimport { useFloatingButtonSelectors } from './floatingButtonStore';\nimport { InsertButtonModal } from './InsertButtonModal/InsertButtonModal';\n\nexport const CustomFloatingButton = () => {\n const isEditing = useFloatingButtonSelectors().isEditing();\n\n const input = <InsertButtonModal />;\n const editContent = isEditing ? input : <EditModal />;\n return (\n <>\n <FloatingButton.InsertRoot>{input}</FloatingButton.InsertRoot>\n <FloatingButton.EditRoot>{editContent}</FloatingButton.EditRoot>\n </>\n );\n};\n"],"names":["CustomFloatingButton","isEditing","useFloatingButtonSelectors","input","InsertButtonModal","editContent","jsx","EditModal","jsxs","Fragment","FloatingButton"],"mappings":";;;;;AAOO,MAAMA,IAAuB,MAAM;AAChC,QAAAC,IAAYC,IAA6B,aAEzCC,0BAASC,GAAkB,CAAA,CAAA,GAC3BC,IAAcJ,IAAYE,IAAQG,gBAAAA,EAAAA,IAACC,GAAU,CAAA,CAAA;AACnD,SAEQC,gBAAAA,EAAA,KAAAC,YAAA,EAAA,UAAA;AAAA,IAACH,gBAAAA,EAAAA,IAAAI,EAAe,YAAf,EAA2B,UAAMP,EAAA,CAAA;AAAA,IACjCG,gBAAAA,EAAAA,IAAAI,EAAe,UAAf,EAAyB,UAAYL,EAAA,CAAA;AAAA,EAC1C,EAAA,CAAA;AAER;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { j as t } from "../../../../../../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { IconPen16 as o, IconTrashBin16 as s } from "@frontify/fondue";
|
|
3
|
+
import { useFloatingButtonUrlInput as r } from "../FloatingButtonUrlInput.es.js";
|
|
4
|
+
import { BlockStyles as a } from "../../../../styles.es.js";
|
|
5
|
+
import { FloatingButton as n } from "../FloatingButton.es.js";
|
|
6
|
+
const p = () => {
|
|
7
|
+
const e = r({});
|
|
8
|
+
return /* @__PURE__ */ t.jsx("div", { "data-test-id": "floating-button-edit", className: "tw-bg-white tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]", children: /* @__PURE__ */ t.jsxs("span", { "data-test-id": "preview-button-flyout", className: "tw-flex tw-justify-between", children: [
|
|
9
|
+
/* @__PURE__ */ t.jsx("span", { className: "tw-pointer-events-none", style: a.p, children: e.defaultValue }),
|
|
10
|
+
/* @__PURE__ */ t.jsxs("span", { className: "tw-flex tw-gap-2", children: [
|
|
11
|
+
/* @__PURE__ */ t.jsx(
|
|
12
|
+
"span",
|
|
13
|
+
{
|
|
14
|
+
role: "button",
|
|
15
|
+
tabIndex: 0,
|
|
16
|
+
"data-test-id": "edit-button-button",
|
|
17
|
+
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
18
|
+
children: /* @__PURE__ */ t.jsx(n.EditButton, { children: /* @__PURE__ */ t.jsx(o, {}) })
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ t.jsx(
|
|
22
|
+
"span",
|
|
23
|
+
{
|
|
24
|
+
role: "button",
|
|
25
|
+
tabIndex: 0,
|
|
26
|
+
"data-test-id": "remove-button-button",
|
|
27
|
+
className: "tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",
|
|
28
|
+
children: /* @__PURE__ */ t.jsx(n.UnlinkButton, { children: /* @__PURE__ */ t.jsx(s, {}) })
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
] })
|
|
32
|
+
] }) });
|
|
33
|
+
};
|
|
34
|
+
export {
|
|
35
|
+
p as EditModal
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=EditModal.es.js.map
|