@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,168 @@
|
|
|
1
|
+
import { LINK_PLUGIN as e } from "./LinkPlugin/id.es.js";
|
|
2
|
+
import { BlockButtonStyles as i } from "./ButtonPlugin/utils/styles.es.js";
|
|
3
|
+
var n = /* @__PURE__ */ ((t) => (t.heading1 = "heading1", t.heading2 = "heading2", t.heading3 = "heading3", t.heading4 = "heading4", t.custom1 = "custom1", t.custom2 = "custom2", t.custom3 = "custom3", t.quote = "quote", t.imageCaption = "imageCaption", t.imageTitle = "imageTitle", t.p = "p", t))(n || {});
|
|
4
|
+
const s = {
|
|
5
|
+
heading1: {
|
|
6
|
+
display: "inline-block",
|
|
7
|
+
fontSize: "var(--f-theme-settings-heading1-font-size)",
|
|
8
|
+
lineHeight: "var(--f-theme-settings-heading1-line-height)",
|
|
9
|
+
marginTop: "var(--f-theme-settings-heading1-margin-top)",
|
|
10
|
+
marginBottom: "var(--f-theme-settings-heading1-margin-bottom)",
|
|
11
|
+
textDecoration: "var(--f-theme-settings-heading1-text-decoration)",
|
|
12
|
+
fontStyle: "var(--f-theme-settings-heading1-font-style)",
|
|
13
|
+
textTransform: "var(--f-theme-settings-heading1-text-transform)",
|
|
14
|
+
letterSpacing: "var(--f-theme-settings-heading1-letter-spacing)",
|
|
15
|
+
fontWeight: "var(--f-theme-settings-heading1-font-weight)",
|
|
16
|
+
fontFamily: "var(--f-theme-settings-heading1-font-family)",
|
|
17
|
+
color: "var(--f-theme-settings-heading1-color)"
|
|
18
|
+
},
|
|
19
|
+
heading2: {
|
|
20
|
+
fontSize: "var(--f-theme-settings-heading2-font-size)",
|
|
21
|
+
lineHeight: "var(--f-theme-settings-heading2-line-height)",
|
|
22
|
+
marginTop: "var(--f-theme-settings-heading2-margin-top)",
|
|
23
|
+
marginBottom: "var(--f-theme-settings-heading2-margin-bottom)",
|
|
24
|
+
textDecoration: "var(--f-theme-settings-heading2-text-decoration)",
|
|
25
|
+
fontStyle: "var(--f-theme-settings-heading2-font-style)",
|
|
26
|
+
textTransform: "var(--f-theme-settings-heading2-text-transform)",
|
|
27
|
+
letterSpacing: "var(--f-theme-settings-heading2-letter-spacing)",
|
|
28
|
+
fontWeight: "var(--f-theme-settings-heading2-font-weight)",
|
|
29
|
+
fontFamily: "var(--f-theme-settings-heading2-font-family)",
|
|
30
|
+
color: "var(--f-theme-settings-heading2-color)"
|
|
31
|
+
},
|
|
32
|
+
heading3: {
|
|
33
|
+
fontSize: "var(--f-theme-settings-heading3-font-size)",
|
|
34
|
+
lineHeight: "var(--f-theme-settings-heading3-line-height)",
|
|
35
|
+
marginTop: "var(--f-theme-settings-heading3-margin-top)",
|
|
36
|
+
marginBottom: "var(--f-theme-settings-heading3-margin-bottom)",
|
|
37
|
+
textDecoration: "var(--f-theme-settings-heading3-text-decoration)",
|
|
38
|
+
fontStyle: "var(--f-theme-settings-heading3-font-style)",
|
|
39
|
+
textTransform: "var(--f-theme-settings-heading3-text-transform)",
|
|
40
|
+
letterSpacing: "var(--f-theme-settings-heading3-letter-spacing)",
|
|
41
|
+
fontWeight: "var(--f-theme-settings-heading3-font-weight)",
|
|
42
|
+
fontFamily: "var(--f-theme-settings-heading3-font-family)",
|
|
43
|
+
color: "var(--f-theme-settings-heading3-color)"
|
|
44
|
+
},
|
|
45
|
+
heading4: {
|
|
46
|
+
fontSize: "var(--f-theme-settings-heading4-font-size)",
|
|
47
|
+
lineHeight: "var(--f-theme-settings-heading4-line-height)",
|
|
48
|
+
marginTop: "var(--f-theme-settings-heading4-margin-top)",
|
|
49
|
+
marginBottom: "var(--f-theme-settings-heading4-margin-bottom)",
|
|
50
|
+
textDecoration: "var(--f-theme-settings-heading4-text-decoration)",
|
|
51
|
+
fontStyle: "var(--f-theme-settings-heading4-font-style)",
|
|
52
|
+
textTransform: "var(--f-theme-settings-heading4-text-transform)",
|
|
53
|
+
letterSpacing: "var(--f-theme-settings-heading4-letter-spacing)",
|
|
54
|
+
fontWeight: "var(--f-theme-settings-heading4-font-weight)",
|
|
55
|
+
fontFamily: "var(--f-theme-settings-heading4-font-family)",
|
|
56
|
+
color: "var(--f-theme-settings-heading4-color)"
|
|
57
|
+
},
|
|
58
|
+
custom1: {
|
|
59
|
+
fontSize: "var(--f-theme-settings-custom1-font-size)",
|
|
60
|
+
lineHeight: "var(--f-theme-settings-custom1-line-height)",
|
|
61
|
+
marginTop: "var(--f-theme-settings-custom1-margin-top)",
|
|
62
|
+
marginBottom: "var(--f-theme-settings-custom1-margin-bottom)",
|
|
63
|
+
textDecoration: "var(--f-theme-settings-custom1-text-decoration)",
|
|
64
|
+
fontStyle: "var(--f-theme-settings-custom1-font-style)",
|
|
65
|
+
textTransform: "var(--f-theme-settings-custom1-text-transform)",
|
|
66
|
+
letterSpacing: "var(--f-theme-settings-custom1-letter-spacing)",
|
|
67
|
+
fontWeight: "var(--f-theme-settings-custom1-font-weight)",
|
|
68
|
+
fontFamily: "var(--f-theme-settings-custom1-font-family)",
|
|
69
|
+
color: "var(--f-theme-settings-custom1-color)"
|
|
70
|
+
},
|
|
71
|
+
custom2: {
|
|
72
|
+
fontSize: "var(--f-theme-settings-custom2-font-size)",
|
|
73
|
+
lineHeight: "var(--f-theme-settings-custom2-line-height)",
|
|
74
|
+
marginTop: "var(--f-theme-settings-custom2-margin-top)",
|
|
75
|
+
marginBottom: "var(--f-theme-settings-custom2-margin-bottom)",
|
|
76
|
+
textDecoration: "var(--f-theme-settings-custom2-text-decoration)",
|
|
77
|
+
fontStyle: "var(--f-theme-settings-custom2-font-style)",
|
|
78
|
+
textTransform: "var(--f-theme-settings-custom2-text-transform)",
|
|
79
|
+
letterSpacing: "var(--f-theme-settings-custom2-letter-spacing)",
|
|
80
|
+
fontWeight: "var(--f-theme-settings-custom2-font-weight)",
|
|
81
|
+
fontFamily: "var(--f-theme-settings-custom2-font-family)",
|
|
82
|
+
color: "var(--f-theme-settings-custom2-color)"
|
|
83
|
+
},
|
|
84
|
+
custom3: {
|
|
85
|
+
fontSize: "var(--f-theme-settings-custom3-font-size)",
|
|
86
|
+
lineHeight: "var(--f-theme-settings-custom3-line-height)",
|
|
87
|
+
marginTop: "var(--f-theme-settings-custom3-margin-top)",
|
|
88
|
+
marginBottom: "var(--f-theme-settings-custom3-margin-bottom)",
|
|
89
|
+
textDecoration: "var(--f-theme-settings-custom3-text-decoration)",
|
|
90
|
+
fontStyle: "var(--f-theme-settings-custom3-font-style)",
|
|
91
|
+
textTransform: "var(--f-theme-settings-custom3-text-transform)",
|
|
92
|
+
letterSpacing: "var(--f-theme-settings-custom3-letter-spacing)",
|
|
93
|
+
fontWeight: "var(--f-theme-settings-custom3-font-weight)",
|
|
94
|
+
fontFamily: "var(--f-theme-settings-custom3-font-family)",
|
|
95
|
+
color: "var(--f-theme-settings-custom3-color)"
|
|
96
|
+
},
|
|
97
|
+
p: {
|
|
98
|
+
fontSize: "var(--f-theme-settings-body-font-size)",
|
|
99
|
+
lineHeight: "var(--f-theme-settings-body-line-height)",
|
|
100
|
+
marginTop: "var(--f-theme-settings-body-margin-top)",
|
|
101
|
+
marginBottom: "var(--f-theme-settings-body-margin-bottom)",
|
|
102
|
+
textDecoration: "var(--f-theme-settings-body-text-decoration)",
|
|
103
|
+
fontStyle: "var(--f-theme-settings-body-font-style)",
|
|
104
|
+
textTransform: "var(--f-theme-settings-body-text-transform)",
|
|
105
|
+
letterSpacing: "var(--f-theme-settings-body-letter-spacing)",
|
|
106
|
+
fontWeight: "var(--f-theme-settings-body-font-weight)",
|
|
107
|
+
fontFamily: "var(--f-theme-settings-body-font-family)",
|
|
108
|
+
color: "var(--f-theme-settings-body-color)"
|
|
109
|
+
},
|
|
110
|
+
quote: {
|
|
111
|
+
fontSize: "var(--f-theme-settings-quote-font-size)",
|
|
112
|
+
lineHeight: "var(--f-theme-settings-quote-line-height)",
|
|
113
|
+
marginTop: "var(--f-theme-settings-quote-margin-top)",
|
|
114
|
+
marginBottom: "var(--f-theme-settings-quote-margin-bottom)",
|
|
115
|
+
textDecoration: "var(--f-theme-settings-quote-text-decoration)",
|
|
116
|
+
fontStyle: "var(--f-theme-settings-quote-font-style)",
|
|
117
|
+
textTransform: "var(--f-theme-settings-quote-text-transform)",
|
|
118
|
+
letterSpacing: "var(--f-theme-settings-quote-letter-spacing)",
|
|
119
|
+
fontWeight: "var(--f-theme-settings-quote-font-weight)",
|
|
120
|
+
fontFamily: "var(--f-theme-settings-quote-font-family)",
|
|
121
|
+
color: "var(--f-theme-settings-quote-color)"
|
|
122
|
+
},
|
|
123
|
+
imageCaption: {
|
|
124
|
+
fontSize: "var(--f-theme-settings-image-caption-font-size)",
|
|
125
|
+
lineHeight: "var(--f-theme-settings-image-caption-line-height)",
|
|
126
|
+
marginTop: "var(--f-theme-settings-image-caption-margin-top)",
|
|
127
|
+
marginBottom: "var(--f-theme-settings-image-caption-margin-bottom)",
|
|
128
|
+
textDecoration: "var(--f-theme-settings-image-caption-text-decoration)",
|
|
129
|
+
fontStyle: "var(--f-theme-settings-image-caption-font-style)",
|
|
130
|
+
textTransform: "var(--f-theme-settings-image-caption-text-transform)",
|
|
131
|
+
letterSpacing: "var(--f-theme-settings-image-caption-letter-spacing)",
|
|
132
|
+
fontWeight: "var(--f-theme-settings-image-caption-font-weight)",
|
|
133
|
+
fontFamily: "var(--f-theme-settings-image-caption-font-family)",
|
|
134
|
+
color: "var(--f-theme-settings-image-caption-color)"
|
|
135
|
+
},
|
|
136
|
+
imageTitle: {
|
|
137
|
+
fontSize: "var(--f-theme-settings-image-title-font-size)",
|
|
138
|
+
lineHeight: "var(--f-theme-settings-image-title-line-height)",
|
|
139
|
+
marginTop: "var(--f-theme-settings-image-title-margin-top)",
|
|
140
|
+
marginBottom: "var(--f-theme-settings-image-title-margin-bottom)",
|
|
141
|
+
textDecoration: "var(--f-theme-settings-image-title-text-decoration)",
|
|
142
|
+
fontStyle: "var(--f-theme-settings-image-title-font-style)",
|
|
143
|
+
textTransform: "var(--f-theme-settings-image-title-text-transform)",
|
|
144
|
+
letterSpacing: "var(--f-theme-settings-image-title-letter-spacing)",
|
|
145
|
+
fontWeight: "var(--f-theme-settings-image-title-font-weight)",
|
|
146
|
+
fontFamily: "var(--f-theme-settings-image-title-font-family)",
|
|
147
|
+
color: "var(--f-theme-settings-image-title-color)"
|
|
148
|
+
},
|
|
149
|
+
[e]: {
|
|
150
|
+
fontSize: "var(--f-theme-settings-link-font-size)",
|
|
151
|
+
lineHeight: "var(--f-theme-settings-link-line-height)",
|
|
152
|
+
marginTop: "var(--f-theme-settings-link-margin-top)",
|
|
153
|
+
marginBottom: "var(--f-theme-settings-link-margin-bottom)",
|
|
154
|
+
textDecoration: "var(--f-theme-settings-link-text-decoration)",
|
|
155
|
+
fontStyle: "var(--f-theme-settings-link-font-style)",
|
|
156
|
+
textTransform: "var(--f-theme-settings-link-text-transform)",
|
|
157
|
+
letterSpacing: "var(--f-theme-settings-link-letter-spacing)",
|
|
158
|
+
fontWeight: "var(--f-theme-settings-link-font-weight)",
|
|
159
|
+
fontFamily: "var(--f-theme-settings-link-font-family)",
|
|
160
|
+
color: "var(--f-theme-settings-link-color)"
|
|
161
|
+
},
|
|
162
|
+
...i
|
|
163
|
+
};
|
|
164
|
+
export {
|
|
165
|
+
s as BlockStyles,
|
|
166
|
+
n as TextStyles
|
|
167
|
+
};
|
|
168
|
+
//# sourceMappingURL=styles.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.es.js","sources":["../../../../src/components/RichTextEditor/plugins/styles.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\nimport { LINK_PLUGIN } from './LinkPlugin/id';\nimport { BlockButtonStyles } from './ButtonPlugin';\n\nexport const enum TextStyles {\n heading1 = 'heading1',\n heading2 = 'heading2',\n heading3 = 'heading3',\n heading4 = 'heading4',\n custom1 = 'custom1',\n custom2 = 'custom2',\n custom3 = 'custom3',\n quote = 'quote',\n imageCaption = 'imageCaption',\n imageTitle = 'imageTitle',\n p = 'p',\n}\nexport const BlockStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {\n [TextStyles.heading1]: {\n display: 'inline-block',\n fontSize: 'var(--f-theme-settings-heading1-font-size)',\n lineHeight: 'var(--f-theme-settings-heading1-line-height)',\n marginTop: 'var(--f-theme-settings-heading1-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading1-font-style)',\n textTransform: 'var(--f-theme-settings-heading1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading1-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading1-font-family)',\n color: 'var(--f-theme-settings-heading1-color)',\n },\n [TextStyles.heading2]: {\n fontSize: 'var(--f-theme-settings-heading2-font-size)',\n lineHeight: 'var(--f-theme-settings-heading2-line-height)',\n marginTop: 'var(--f-theme-settings-heading2-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading2-font-style)',\n textTransform: 'var(--f-theme-settings-heading2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading2-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading2-font-family)',\n color: 'var(--f-theme-settings-heading2-color)',\n },\n [TextStyles.heading3]: {\n fontSize: 'var(--f-theme-settings-heading3-font-size)',\n lineHeight: 'var(--f-theme-settings-heading3-line-height)',\n marginTop: 'var(--f-theme-settings-heading3-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading3-font-style)',\n textTransform: 'var(--f-theme-settings-heading3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading3-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading3-font-family)',\n color: 'var(--f-theme-settings-heading3-color)',\n },\n [TextStyles.heading4]: {\n fontSize: 'var(--f-theme-settings-heading4-font-size)',\n lineHeight: 'var(--f-theme-settings-heading4-line-height)',\n marginTop: 'var(--f-theme-settings-heading4-margin-top)',\n marginBottom: 'var(--f-theme-settings-heading4-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-heading4-text-decoration)',\n fontStyle: 'var(--f-theme-settings-heading4-font-style)',\n textTransform: 'var(--f-theme-settings-heading4-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-heading4-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-heading4-font-weight)',\n fontFamily: 'var(--f-theme-settings-heading4-font-family)',\n color: 'var(--f-theme-settings-heading4-color)',\n },\n [TextStyles.custom1]: {\n fontSize: 'var(--f-theme-settings-custom1-font-size)',\n lineHeight: 'var(--f-theme-settings-custom1-line-height)',\n marginTop: 'var(--f-theme-settings-custom1-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom1-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom1-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom1-font-style)',\n textTransform: 'var(--f-theme-settings-custom1-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom1-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom1-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom1-font-family)',\n color: 'var(--f-theme-settings-custom1-color)',\n },\n [TextStyles.custom2]: {\n fontSize: 'var(--f-theme-settings-custom2-font-size)',\n lineHeight: 'var(--f-theme-settings-custom2-line-height)',\n marginTop: 'var(--f-theme-settings-custom2-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom2-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom2-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom2-font-style)',\n textTransform: 'var(--f-theme-settings-custom2-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom2-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom2-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom2-font-family)',\n color: 'var(--f-theme-settings-custom2-color)',\n },\n [TextStyles.custom3]: {\n fontSize: 'var(--f-theme-settings-custom3-font-size)',\n lineHeight: 'var(--f-theme-settings-custom3-line-height)',\n marginTop: 'var(--f-theme-settings-custom3-margin-top)',\n marginBottom: 'var(--f-theme-settings-custom3-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-custom3-text-decoration)',\n fontStyle: 'var(--f-theme-settings-custom3-font-style)',\n textTransform: 'var(--f-theme-settings-custom3-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-custom3-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-custom3-font-weight)',\n fontFamily: 'var(--f-theme-settings-custom3-font-family)',\n color: 'var(--f-theme-settings-custom3-color)',\n },\n [TextStyles.p]: {\n fontSize: 'var(--f-theme-settings-body-font-size)',\n lineHeight: 'var(--f-theme-settings-body-line-height)',\n marginTop: 'var(--f-theme-settings-body-margin-top)',\n marginBottom: 'var(--f-theme-settings-body-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-body-text-decoration)',\n fontStyle: 'var(--f-theme-settings-body-font-style)',\n textTransform: 'var(--f-theme-settings-body-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-body-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-body-font-weight)',\n fontFamily: 'var(--f-theme-settings-body-font-family)',\n color: 'var(--f-theme-settings-body-color)',\n },\n [TextStyles.quote]: {\n fontSize: 'var(--f-theme-settings-quote-font-size)',\n lineHeight: 'var(--f-theme-settings-quote-line-height)',\n marginTop: 'var(--f-theme-settings-quote-margin-top)',\n marginBottom: 'var(--f-theme-settings-quote-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-quote-text-decoration)',\n fontStyle: 'var(--f-theme-settings-quote-font-style)',\n textTransform: 'var(--f-theme-settings-quote-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-quote-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-quote-font-weight)',\n fontFamily: 'var(--f-theme-settings-quote-font-family)',\n color: 'var(--f-theme-settings-quote-color)',\n },\n [TextStyles.imageCaption]: {\n fontSize: 'var(--f-theme-settings-image-caption-font-size)',\n lineHeight: 'var(--f-theme-settings-image-caption-line-height)',\n marginTop: 'var(--f-theme-settings-image-caption-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-caption-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-caption-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-caption-font-style)',\n textTransform: 'var(--f-theme-settings-image-caption-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-caption-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-caption-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-caption-font-family)',\n color: 'var(--f-theme-settings-image-caption-color)',\n },\n [TextStyles.imageTitle]: {\n fontSize: 'var(--f-theme-settings-image-title-font-size)',\n lineHeight: 'var(--f-theme-settings-image-title-line-height)',\n marginTop: 'var(--f-theme-settings-image-title-margin-top)',\n marginBottom: 'var(--f-theme-settings-image-title-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-image-title-text-decoration)',\n fontStyle: 'var(--f-theme-settings-image-title-font-style)',\n textTransform: 'var(--f-theme-settings-image-title-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-image-title-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-image-title-font-weight)',\n fontFamily: 'var(--f-theme-settings-image-title-font-family)',\n color: 'var(--f-theme-settings-image-title-color)',\n },\n [LINK_PLUGIN]: {\n fontSize: 'var(--f-theme-settings-link-font-size)',\n lineHeight: 'var(--f-theme-settings-link-line-height)',\n marginTop: 'var(--f-theme-settings-link-margin-top)',\n marginBottom: 'var(--f-theme-settings-link-margin-bottom)',\n textDecoration: 'var(--f-theme-settings-link-text-decoration)',\n fontStyle: 'var(--f-theme-settings-link-font-style)',\n textTransform: 'var(--f-theme-settings-link-text-transform)' as CSSProperties['textTransform'],\n letterSpacing: 'var(--f-theme-settings-link-letter-spacing)',\n fontWeight: 'var(--f-theme-settings-link-font-weight)',\n fontFamily: 'var(--f-theme-settings-link-font-family)',\n color: 'var(--f-theme-settings-link-color)',\n },\n ...BlockButtonStyles,\n};\n"],"names":["TextStyles","BlockStyles","LINK_PLUGIN","BlockButtonStyles"],"mappings":"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"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { reactCssPropsToCss as s } from "../utlis/reactCssPropsToCss.es.js";
|
|
2
|
+
import { BUTTON_PLUGIN as $ } from "../../plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
3
|
+
const b = (e, n, a, u) => {
|
|
4
|
+
const l = u[$], o = e.buttonStyle ?? "primary", c = `button${o.charAt(0).toUpperCase()}${o.slice(1)}`, t = l[c], r = s(t);
|
|
5
|
+
return `<a href="${e.url}"
|
|
6
|
+
target="${e.target ?? "_blank"}"
|
|
7
|
+
style="${r}"
|
|
8
|
+
class="${a}"
|
|
9
|
+
onmouseenter="this.setAttribute('style', '${r} ${s(t == null ? void 0 : t.hover)}');"
|
|
10
|
+
onmouseleave="this.setAttribute('style', '${s(t)}');"
|
|
11
|
+
>${n}</a>`;
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
b as buttonNode
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=button.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/button.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport { CSSProperties } from 'react';\nimport { BUTTON_PLUGIN } from '../../plugins';\n\nexport type ButtonStylesType = Record<string, Record<string, CSSProperties & { hover?: CSSProperties }>>;\n\nexport const buttonNode = (node: TElement, children: string, defaultClassNames: string, styles: ButtonStylesType) => {\n const buttonStyles = styles[BUTTON_PLUGIN];\n const buttonTypeString = (node.buttonStyle as string) ?? 'primary';\n const buttonType = `button${buttonTypeString.charAt(0).toUpperCase()}${buttonTypeString.slice(1)}`;\n const buttonStyle = buttonStyles[buttonType];\n\n const defaultStyles = reactCssPropsToCss(buttonStyle);\n\n return `<a href=\"${node.url}\"\n target=\"${node.target ?? '_blank'}\"\n style=\"${defaultStyles}\"\n class=\"${defaultClassNames}\"\n onmouseenter=\"this.setAttribute('style', '${defaultStyles} ${reactCssPropsToCss(buttonStyle?.hover)}');\"\n onmouseleave=\"this.setAttribute('style', '${reactCssPropsToCss(buttonStyle)}');\"\n >${children}</a>`;\n};\n"],"names":["buttonNode","node","children","defaultClassNames","styles","buttonStyles","BUTTON_PLUGIN","buttonTypeString","buttonType","buttonStyle","defaultStyles","reactCssPropsToCss"],"mappings":";;AASO,MAAMA,IAAa,CAACC,GAAgBC,GAAkBC,GAA2BC,MAA6B;AAC3G,QAAAC,IAAeD,EAAOE,CAAa,GACnCC,IAAoBN,EAAK,eAA0B,WACnDO,IAAa,SAASD,EAAiB,OAAO,CAAC,EAAE,YAAY,CAAC,GAAGA,EAAiB,MAAM,CAAC,CAAC,IAC1FE,IAAcJ,EAAaG,CAAU,GAErCE,IAAgBC,EAAmBF,CAAW;AAE7C,SAAA,YAAYR,EAAK,GAAG;AAAA,0BACLA,EAAK,UAAU,QAAQ;AAAA,yBACxBS,CAAa;AAAA,yBACbP,CAAiB;AAAA,4DACkBO,CAAa,IAAIC,EAAmBF,KAAA,gBAAAA,EAAa,KAAK,CAAC;AAAA,4DACvDE,EAAmBF,CAAW,CAAC;AAAA,mBACxEP,CAAQ;AAC3B;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { merge as l } from "@frontify/fondue";
|
|
2
|
+
import { reactCssPropsToCss as r } from "../utlis/reactCssPropsToCss.es.js";
|
|
3
|
+
const n = (t, e, s, c) => `<div disabled class="tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${s}" style="margin-left:${(t.indent ?? 0) * 24}px;">
|
|
4
|
+
<div class="tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5">
|
|
5
|
+
<input
|
|
6
|
+
class="tw-w-4 tw-h-4 tw-m-0"
|
|
7
|
+
type="checkbox"
|
|
8
|
+
${t.checked ? "checked" : ""}
|
|
9
|
+
onclick="return false;" />
|
|
10
|
+
</div>
|
|
11
|
+
<span class="${l([
|
|
12
|
+
"tw-flex-1 tw-focus:outline-none",
|
|
13
|
+
t.checked ? "!tw-line-through" : ""
|
|
14
|
+
])}" style="${r(c[t.children[0].textStyle])}">${e}</span>
|
|
15
|
+
</div>`;
|
|
16
|
+
export {
|
|
17
|
+
n as checkItemNode
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=checkItemNode.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkItemNode.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/checkItemNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { merge } from '@frontify/fondue';\nimport { TElement } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\n\nexport const checkItemNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>,\n) => {\n return `<div disabled class=\"tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${defaultClassNames}\" style=\"margin-left:${\n ((node.indent as number) ?? 0) * 24\n }px;\">\n <div class=\"tw-flex tw-items-center tw-justify-center tw-select-none tw-mr-1.5\">\n <input\n class=\"tw-w-4 tw-h-4 tw-m-0\"\n type=\"checkbox\"\n ${node.checked ? 'checked' : ''}\n onclick=\"return false;\" />\n </div>\n <span class=\"${merge([\n 'tw-flex-1 tw-focus:outline-none',\n node.checked ? '!tw-line-through' : '',\n ])}\" style=\"${reactCssPropsToCss(styles[node.children[0].textStyle as string])}\">${children}</span>\n</div>`;\n};\n"],"names":["checkItemNode","node","children","defaultClassNames","styles","merge","reactCssPropsToCss"],"mappings":";;AAOO,MAAMA,IAAgB,CACzBC,GACAC,GACAC,GACAC,MAEO,0EAA0ED,CAAiB,yBAC5FF,EAAK,UAAqB,KAAK,EACrC;AAAA;AAAA;AAAA;AAAA;AAAA,cAKUA,EAAK,UAAU,YAAY,EAAE;AAAA;AAAA;AAAA,mBAGxBI,EAAM;AAAA,EACjB;AAAA,EACAJ,EAAK,UAAU,qBAAqB;AACvC,CAAA,CAAC,YAAYK,EAAmBF,EAAOH,EAAK,SAAS,CAAC,EAAE,SAAmB,CAAC,CAAC,KAAKC,CAAQ;AAAA;"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { reactCssPropsToCss as s } from "../utlis/reactCssPropsToCss.es.js";
|
|
2
|
+
import { merge as y } from "@frontify/fondue";
|
|
3
|
+
import { TextStyles as o } from "../../plugins/styles.es.js";
|
|
4
|
+
const m = (p, t, c, $) => {
|
|
5
|
+
const r = s(c);
|
|
6
|
+
return p.type === o.heading1 ? `<h1 class="${y([$, "a-h1"])}">${i(t, r)}</h1>` : p.type === o.heading2 ? `<h2 class="${$}">${i(t, r)}</h2>` : p.type === o.heading3 ? `<h3 class="${$}">${i(t, r)}</h3>` : p.type === o.heading4 ? `<h4 class="${$}">${i(t, r)}</h4>` : p.type === o.custom1 ? `<p class="${y([$, "a-custom1"])}">${i(t, r)}</p>` : p.type === o.custom2 ? `<p class="${y([$, "a-custom2"])}">${i(t, r)}</p>` : p.type === o.custom3 ? `<p class="${y([$, "a-custom3"])}">${i(t, r)}</p>` : p.type === o.quote ? `<p class="${y([$, "a-quote"])}">${i(t, r)}</p>` : p.type === o.imageTitle ? `<p class="${y([$, "a-image-title"])}">${i(
|
|
7
|
+
t,
|
|
8
|
+
r
|
|
9
|
+
)}</p>` : p.type === o.imageCaption ? `<p class="${y([$, "a-image-caption"])}">${i(
|
|
10
|
+
t,
|
|
11
|
+
r
|
|
12
|
+
)}</p>` : `<p class="${$}">${i(t, r)}</p>`;
|
|
13
|
+
}, i = (p, t) => `<span style="${t}">${p}</span>`;
|
|
14
|
+
export {
|
|
15
|
+
m as defaultNode
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=default.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/default.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { CSSProperties } from 'react';\nimport { TextStyles } from '../../plugins';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport { merge } from '@frontify/fondue';\n\nexport const defaultNode = (node: TElement, children: string, styles: CSSProperties, defaultClassNames: string) => {\n const defaultStyles = reactCssPropsToCss(styles);\n\n if (node.type === TextStyles.heading1) {\n return `<h1 class=\"${merge([defaultClassNames, 'a-h1'])}\">${getStyledChild(children, defaultStyles)}</h1>`;\n }\n if (node.type === TextStyles.heading2) {\n return `<h2 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h2>`;\n }\n if (node.type === TextStyles.heading3) {\n return `<h3 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h3>`;\n }\n if (node.type === TextStyles.heading4) {\n return `<h4 class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</h4>`;\n }\n if (node.type === TextStyles.custom1) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom1'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom2) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom2'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.custom3) {\n return `<p class=\"${merge([defaultClassNames, 'a-custom3'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.quote) {\n return `<p class=\"${merge([defaultClassNames, 'a-quote'])}\">${getStyledChild(children, defaultStyles)}</p>`;\n }\n if (node.type === TextStyles.imageTitle) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-title'])}\">${getStyledChild(\n children,\n defaultStyles,\n )}</p>`;\n }\n if (node.type === TextStyles.imageCaption) {\n return `<p class=\"${merge([defaultClassNames, 'a-image-caption'])}\">${getStyledChild(\n children,\n defaultStyles,\n )}</p>`;\n }\n\n return `<p class=\"${defaultClassNames}\">${getStyledChild(children, defaultStyles)}</p>`;\n};\n\nconst getStyledChild = (children: string, styles: string) => `<span style=\"${styles}\">${children}</span>`;\n"],"names":["defaultNode","node","children","styles","defaultClassNames","defaultStyles","reactCssPropsToCss","TextStyles","merge","getStyledChild"],"mappings":";;;AAQO,MAAMA,IAAc,CAACC,GAAgBC,GAAkBC,GAAuBC,MAA8B;AACzG,QAAAC,IAAgBC,EAAmBH,CAAM;AAE3C,SAAAF,EAAK,SAASM,EAAW,WAClB,cAAcC,EAAM,CAACJ,GAAmB,MAAM,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAEnGJ,EAAK,SAASM,EAAW,WAClB,cAAcH,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAElFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAElFJ,EAAK,SAASM,EAAW,WAClB,cAAcH,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC,UAElFJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAEvGJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAEvGJ,EAAK,SAASM,EAAW,UAClB,aAAaC,EAAM,CAACJ,GAAmB,WAAW,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAEvGJ,EAAK,SAASM,EAAW,QAClB,aAAaC,EAAM,CAACJ,GAAmB,SAAS,CAAC,CAAC,KAAKK,EAAeP,GAAUG,CAAa,CAAC,SAErGJ,EAAK,SAASM,EAAW,aAClB,aAAaC,EAAM,CAACJ,GAAmB,eAAe,CAAC,CAAC,KAAKK;AAAA,IAChEP;AAAA,IACAG;AAAA,EACH,CAAA,SAEDJ,EAAK,SAASM,EAAW,eAClB,aAAaC,EAAM,CAACJ,GAAmB,iBAAiB,CAAC,CAAC,KAAKK;AAAA,IAClEP;AAAA,IACAG;AAAA,EACH,CAAA,SAGE,aAAaD,CAAiB,KAAKK,EAAeP,GAAUG,CAAa,CAAC;AACrF,GAEMI,IAAiB,CAACP,GAAkBC,MAAmB,gBAAgBA,CAAM,KAAKD,CAAQ;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { LINK_PLUGIN as p } from "../../plugins/LinkPlugin/id.es.js";
|
|
2
|
+
import { reactCssPropsToCss as e } from "../utlis/reactCssPropsToCss.es.js";
|
|
3
|
+
import f from "escape-html";
|
|
4
|
+
const _ = (r, a, s, $) => {
|
|
5
|
+
var l;
|
|
6
|
+
if (r.chosenLink) {
|
|
7
|
+
const { chosenLink: t } = r;
|
|
8
|
+
return `<a class="${s}" style="${e($[p])}" target=${t != null && t.openInNewTab ? "_blank" : "_self"} href="${f((l = t == null ? void 0 : t.searchResult) == null ? void 0 : l.link)}">${a}</a>`;
|
|
9
|
+
}
|
|
10
|
+
return `<a class="${s}" style="${e($[p])}" target="${(r == null ? void 0 : r.target) ?? "_blank"}" href="${f(r.url)}">${a}</a>`;
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
_ as linkNode
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=link.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/link.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TElement } from '@udecode/plate';\nimport { LINK_PLUGIN } from '../../plugins/LinkPlugin/id';\nimport { TLinkElement } from '../../plugins/LinkPlugin/types';\nimport { reactCssPropsToCss } from '../utlis/reactCssPropsToCss';\nimport escapeHtml from 'escape-html';\nimport { CSSProperties } from 'react';\n\nexport const linkNode = (\n node: TElement,\n children: string,\n defaultClassNames: string,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }>,\n) => {\n if (node.chosenLink) {\n const { chosenLink } = node as TLinkElement;\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=${\n chosenLink?.openInNewTab ? '_blank' : '_self'\n } href=\"${escapeHtml(chosenLink?.searchResult?.link)}\">${children}</a>`;\n }\n return `<a class=\"${defaultClassNames}\" style=\"${reactCssPropsToCss(styles[LINK_PLUGIN])}\" target=\"${\n node?.target ?? '_blank'\n }\" href=\"${escapeHtml(node.url as string)}\">${children}</a>`;\n};\n"],"names":["linkNode","node","children","defaultClassNames","styles","chosenLink","reactCssPropsToCss","LINK_PLUGIN","escapeHtml","_a"],"mappings":";;;AASO,MAAMA,IAAW,CACpBC,GACAC,GACAC,GACAC,MACC;;AACD,MAAIH,EAAK,YAAY;AACX,UAAA,EAAE,YAAAI,EAAe,IAAAJ;AAChB,WAAA,aAAaE,CAAiB,YAAYG,EAAmBF,EAAOG,CAAW,CAAC,CAAC,YACpFF,KAAA,QAAAA,EAAY,eAAe,WAAW,OAC1C,UAAUG,GAAWC,IAAAJ,KAAA,gBAAAA,EAAY,iBAAZ,gBAAAI,EAA0B,IAAI,CAAC,KAAKP,CAAQ;AAAA,EACrE;AACA,SAAO,aAAaC,CAAiB,YAAYG,EAAmBF,EAAOG,CAAW,CAAC,CAAC,cACpFN,KAAA,gBAAAA,EAAM,WAAU,QACpB,WAAWO,EAAWP,EAAK,GAAa,CAAC,KAAKC,CAAQ;AAC1D;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import n from "react-dom";
|
|
2
|
+
import { MentionMarkupElementNode as o } from "@frontify/fondue";
|
|
3
|
+
const d = (r, { mentionable: e } = {}) => {
|
|
4
|
+
if (!e)
|
|
5
|
+
return "";
|
|
6
|
+
const t = document.createElement("div");
|
|
7
|
+
return n.render(o(e)({ element: r }), t), t.innerHTML;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
d as mentionHtmlNode
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=mentionHtmlNode.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mentionHtmlNode.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/nodes/mentionHtmlNode.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport ReactDOM from 'react-dom';\nimport { TElement, TMentionElement } from '@udecode/plate';\nimport { MappedMentionableItems, MentionMarkupElementNode } from '@frontify/fondue';\n\ntype MentionHtmlNodeProps = { mentionable?: MappedMentionableItems };\n\nexport const mentionHtmlNode = (node: TElement, { mentionable }: MentionHtmlNodeProps = {}) => {\n if (!mentionable) {\n return '';\n }\n\n const div = document.createElement('div');\n ReactDOM.render(MentionMarkupElementNode(mentionable)({ element: node as TMentionElement }), div);\n return div.innerHTML;\n};\n"],"names":["mentionHtmlNode","node","mentionable","div","ReactDOM","MentionMarkupElementNode"],"mappings":";;AAQO,MAAMA,IAAkB,CAACC,GAAgB,EAAE,aAAAC,EAAY,IAA0B,CAAA,MAAO;AAC3F,MAAI,CAACA;AACM,WAAA;AAGL,QAAAC,IAAM,SAAS,cAAc,KAAK;AAC/B,SAAAC,EAAA,OAAOC,EAAyBH,CAAW,EAAE,EAAE,SAASD,EAAA,CAAyB,GAAGE,CAAG,GACzFA,EAAI;AACf;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { UL_CLASSES as N, getOrderedListClasses as p, LI_CLASSNAMES as f, getLiStyles as L, getLicElementClassNames as u, ELEMENT_CHECK_ITEM as T, alignmentClassnames as C, merge as $, OL_STYLES as M } from "@frontify/fondue";
|
|
2
|
+
import { isText as _, ELEMENT_UL as g, ELEMENT_OL as n, ELEMENT_LI as k, ELEMENT_LIC as y, ELEMENT_LINK as S, ELEMENT_MENTION as h } from "@udecode/plate";
|
|
3
|
+
import { serializeLeafToHtml as b } from "./utlis/serializeLeafToHtml.es.js";
|
|
4
|
+
import { reactCssPropsToCss as E } from "./utlis/reactCssPropsToCss.es.js";
|
|
5
|
+
import { buttonNode as d } from "./nodes/button.es.js";
|
|
6
|
+
import { linkNode as I } from "./nodes/link.es.js";
|
|
7
|
+
import { defaultNode as O } from "./nodes/default.es.js";
|
|
8
|
+
import { checkItemNode as A } from "./nodes/checkItemNode.es.js";
|
|
9
|
+
import { mentionHtmlNode as H } from "./nodes/mentionHtmlNode.es.js";
|
|
10
|
+
import { ELEMENT_BUTTON as v } from "../plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
11
|
+
const i = (e, t) => e.reduce((r, s) => (s.type === t && r++, s.children ? r + i(s.children, t) : r), 0), w = (e, t, { mappedMentionable: r, nestingCount: s = {} }) => {
|
|
12
|
+
if (_(e))
|
|
13
|
+
return b(e);
|
|
14
|
+
const o = s[e.type] || i([e], e.type);
|
|
15
|
+
let l = "";
|
|
16
|
+
for (const a of e.children)
|
|
17
|
+
l += w(a, t, {
|
|
18
|
+
nestingCount: {
|
|
19
|
+
...s,
|
|
20
|
+
[a.type]: o
|
|
21
|
+
},
|
|
22
|
+
mappedMentionable: r
|
|
23
|
+
});
|
|
24
|
+
const m = x[e.type];
|
|
25
|
+
return typeof m < "u" ? m({
|
|
26
|
+
classNames: c(e.breakAfterColumn, e.align),
|
|
27
|
+
children: l,
|
|
28
|
+
rootNestingCount: o,
|
|
29
|
+
node: e,
|
|
30
|
+
mappedMentionable: r,
|
|
31
|
+
styles: t
|
|
32
|
+
}) : O(
|
|
33
|
+
e,
|
|
34
|
+
l,
|
|
35
|
+
t[e.type],
|
|
36
|
+
c(e.breakAfterColumn, e.align)
|
|
37
|
+
);
|
|
38
|
+
}, x = {
|
|
39
|
+
[g]: (e) => `<ul class="${N} ${e.classNames}">${e.children}</ul>`,
|
|
40
|
+
[n]: ({ classNames: e, children: t, node: r, rootNestingCount: s }) => {
|
|
41
|
+
const o = Math.max(s - i([r], n), 0);
|
|
42
|
+
return `<ol class="${p(o)} ${e}" style="${E(
|
|
43
|
+
M
|
|
44
|
+
)}">${t}</ol>`;
|
|
45
|
+
},
|
|
46
|
+
[k]: ({ classNames: e, children: t, node: r, styles: s }) => `<li class="${e} ${f}" style="${E(
|
|
47
|
+
L(r, s)
|
|
48
|
+
)}">${t}</li>`,
|
|
49
|
+
[y]: ({ classNames: e, children: t, node: r }) => `<p class="${e} ${u(r)}"><span>${t}</span></p>`,
|
|
50
|
+
[S]: ({ node: e, children: t, classNames: r, styles: s }) => I(e, t, r, s),
|
|
51
|
+
[v]: ({ node: e, children: t, classNames: r, styles: s }) => d(e, t, r, s),
|
|
52
|
+
[T]: ({ node: e, children: t, classNames: r, styles: s }) => A(e, t, r, s),
|
|
53
|
+
[h]: ({ node: e, mappedMentionable: t }) => H(e, { mentionable: t })
|
|
54
|
+
}, c = (e, t) => {
|
|
55
|
+
const r = "tw-break-words", s = e === "active" ? "tw-break-after-column tw-break-inside-avoid-column" : "", o = t ? C[t] : "";
|
|
56
|
+
return $([o, r, s]);
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
w as serializeNodeToHtmlRecursive
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=serializeNodesToHtmlRecursive.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeNodesToHtmlRecursive.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ELEMENT_CHECK_ITEM,\n LI_CLASSNAMES,\n MappedMentionableItems,\n OL_STYLES,\n UL_CLASSES,\n alignmentClassnames,\n getLiStyles,\n getLicElementClassNames,\n getOrderedListClasses,\n merge,\n} from '@frontify/fondue';\nimport {\n ELEMENT_LI,\n ELEMENT_LIC,\n ELEMENT_LINK,\n ELEMENT_MENTION,\n ELEMENT_OL,\n ELEMENT_UL,\n TDescendant,\n TElement,\n isText,\n} from '@udecode/plate';\nimport { serializeLeafToHtml } from './utlis/serializeLeafToHtml';\nimport { reactCssPropsToCss } from './utlis/reactCssPropsToCss';\nimport { CSSProperties } from 'react';\nimport { ButtonStylesType, buttonNode } from './nodes/button';\nimport { linkNode } from './nodes/link';\nimport { defaultNode } from './nodes/default';\nimport { checkItemNode } from './nodes/checkItemNode';\nimport { mentionHtmlNode } from './nodes/mentionHtmlNode';\nimport { ELEMENT_BUTTON } from '../plugins';\n\nconst countNodesOfType = (nodes: TDescendant[], type: string): number => {\n return nodes.reduce((acc, node) => {\n if (node.type === type) {\n acc++;\n }\n if (node.children) {\n return acc + countNodesOfType(node.children as TDescendant[], type);\n }\n return acc;\n }, 0);\n};\n\ntype NestingCount = {\n [type: string]: number;\n};\n\ntype SerializeNodeToHtmlRecursiveOptions = {\n mappedMentionable?: MappedMentionableItems;\n nestingCount?: NestingCount;\n};\n\nexport const serializeNodeToHtmlRecursive = (\n node: TDescendant,\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType,\n { mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions,\n): string => {\n if (isText(node)) {\n return serializeLeafToHtml(node);\n }\n\n const rootNestingCount = nestingCount[node.type] || countNodesOfType([node], node.type);\n let children = '';\n for (const element of node.children) {\n children += serializeNodeToHtmlRecursive(element, styles, {\n nestingCount: {\n ...nestingCount,\n [element.type as string]: rootNestingCount,\n },\n mappedMentionable,\n });\n }\n\n const htmlMapper = MapNodeTypesToHtml[node.type];\n if (typeof htmlMapper !== 'undefined') {\n return htmlMapper({\n classNames: getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),\n children,\n rootNestingCount,\n node,\n mappedMentionable,\n styles,\n });\n } else {\n return defaultNode(\n node,\n children,\n styles[node.type],\n getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),\n );\n }\n};\n\ntype Arguments = {\n classNames: string;\n children: string;\n rootNestingCount: number;\n node: TElement;\n mappedMentionable?: MappedMentionableItems;\n styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType;\n};\n\nconst MapNodeTypesToHtml: { [key: string]: ({ ...args }: Arguments) => string } = {\n [ELEMENT_UL]: (args) => `<ul class=\"${UL_CLASSES} ${args.classNames}\">${args.children}</ul>`,\n [ELEMENT_OL]: ({ classNames, children, node, rootNestingCount }) => {\n const nestingLevel = Math.max(rootNestingCount - countNodesOfType([node], ELEMENT_OL), 0);\n return `<ol class=\"${getOrderedListClasses(nestingLevel)} ${classNames}\" style=\"${reactCssPropsToCss(\n OL_STYLES,\n )}\">${children}</ol>`;\n },\n [ELEMENT_LI]: ({ classNames, children, node, styles }) =>\n `<li class=\"${classNames} ${LI_CLASSNAMES}\" style=\"${reactCssPropsToCss(\n getLiStyles(node, styles),\n )}\">${children}</li>`,\n [ELEMENT_LIC]: ({ classNames, children, node }) =>\n `<p class=\"${classNames} ${getLicElementClassNames(node)}\"><span>${children}</span></p>`,\n [ELEMENT_LINK]: ({ node, children, classNames, styles }) => linkNode(node, children, classNames, styles),\n [ELEMENT_BUTTON]: ({ node, children, classNames, styles }) =>\n buttonNode(node, children, classNames, styles as ButtonStylesType),\n [ELEMENT_CHECK_ITEM]: ({ node, children, classNames, styles }) => checkItemNode(node, children, classNames, styles),\n [ELEMENT_MENTION]: ({ node, mappedMentionable }) => mentionHtmlNode(node, { mentionable: mappedMentionable }),\n};\n\nconst getClassNames = (breakAfterColumn?: string, align?: string) => {\n const breakWordsClass = 'tw-break-words';\n const columnBreakClasses =\n breakAfterColumn === 'active' ? 'tw-break-after-column tw-break-inside-avoid-column' : '';\n const alignClass = align ? alignmentClassnames[align] : '';\n return merge([alignClass, breakWordsClass, columnBreakClasses]);\n};\n"],"names":["countNodesOfType","nodes","type","acc","node","serializeNodeToHtmlRecursive","styles","mappedMentionable","nestingCount","isText","serializeLeafToHtml","rootNestingCount","children","element","htmlMapper","MapNodeTypesToHtml","getClassNames","defaultNode","ELEMENT_UL","args","UL_CLASSES","ELEMENT_OL","classNames","nestingLevel","getOrderedListClasses","reactCssPropsToCss","OL_STYLES","ELEMENT_LI","LI_CLASSNAMES","getLiStyles","ELEMENT_LIC","getLicElementClassNames","ELEMENT_LINK","linkNode","ELEMENT_BUTTON","buttonNode","ELEMENT_CHECK_ITEM","checkItemNode","ELEMENT_MENTION","mentionHtmlNode","breakAfterColumn","align","breakWordsClass","columnBreakClasses","alignClass","alignmentClassnames","merge"],"mappings":"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"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { parseRawValue as c, PluginComposer as p, mapMentionable as y } from "@frontify/fondue";
|
|
2
|
+
import { serializeNodeToHtmlRecursive as f } from "./serializeNodesToHtmlRecursive.es.js";
|
|
3
|
+
import { BlockStyles as u } from "../plugins/styles.es.js";
|
|
4
|
+
const A = async (e, r = 1, t = "normal", l = new p()) => {
|
|
5
|
+
const i = c({ raw: e, plugins: l }), o = l.getStyles;
|
|
6
|
+
return Promise.resolve(v(i, { columns: r, columnGap: t, styles: o }));
|
|
7
|
+
}, v = (e, { mentionable: r, columns: t = 1, columnGap: l = "normal", styles: i = u } = {}) => {
|
|
8
|
+
const o = r ? y(r) : /* @__PURE__ */ new Map();
|
|
9
|
+
let s = "";
|
|
10
|
+
for (let a = 0, n = e.length; a < n; a++) {
|
|
11
|
+
const m = e[a];
|
|
12
|
+
h(m) ? s += "<br />" : s += f(m, i, {
|
|
13
|
+
mappedMentionable: o
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return t > 1 ? `<div style="columns:${t}; column-gap:${l};">${s}</div>` : s;
|
|
17
|
+
}, h = (e) => {
|
|
18
|
+
var r;
|
|
19
|
+
return Array.isArray(e == null ? void 0 : e.children) ? (r = e == null ? void 0 : e.children) == null ? void 0 : r.every((t) => t.text === "") : !1;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
v as serializeNodesToHtml,
|
|
23
|
+
A as serializeRawToHtmlAsync
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=serializeToHtml.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeToHtml.es.js","sources":["../../../../src/components/RichTextEditor/serializer/serializeToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { TDescendant } from '@udecode/plate';\nimport { PluginComposer, SerializeNodesToHtmlOptions, mapMentionable, parseRawValue } from '@frontify/fondue';\nimport { BlockStyles } from '../plugins';\nimport { serializeNodeToHtmlRecursive } from './serializeNodesToHtmlRecursive';\n\nexport const serializeRawToHtmlAsync = async (\n raw: string,\n columns: SerializeNodesToHtmlOptions['columns'] = 1,\n columnGap: SerializeNodesToHtmlOptions['columnGap'] = 'normal',\n plugins: PluginComposer = new PluginComposer(),\n): Promise<string> => {\n const nodes = parseRawValue({ raw, plugins });\n const styles = plugins.getStyles;\n return Promise.resolve(serializeNodesToHtml(nodes, { columns, columnGap, styles }));\n};\n\nexport const serializeNodesToHtml = (\n nodes: TDescendant[],\n { mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {},\n): string => {\n const mappedMentionable = mentionable ? mapMentionable(mentionable) : new Map();\n\n let html = '';\n for (let i = 0, len = nodes.length; i < len; i++) {\n const node = nodes[i];\n if (isEmptyNode(node)) {\n html += '<br />';\n } else {\n html += serializeNodeToHtmlRecursive(node, styles, {\n mappedMentionable,\n });\n }\n }\n\n if (columns > 1) {\n return `<div style=\"columns:${columns}; column-gap:${columnGap};\">${html}</div>`;\n }\n\n return html;\n};\n\nconst isEmptyNode = (node: TDescendant): boolean => {\n if (!Array.isArray(node?.children)) {\n return false;\n }\n return node?.children?.every((child) => child.text === '');\n};\n"],"names":["serializeRawToHtmlAsync","raw","columns","columnGap","plugins","PluginComposer","nodes","parseRawValue","styles","serializeNodesToHtml","mentionable","BlockStyles","mappedMentionable","mapMentionable","html","i","len","node","isEmptyNode","serializeNodeToHtmlRecursive","_a","child"],"mappings":";;;AAOa,MAAAA,IAA0B,OACnCC,GACAC,IAAkD,GAClDC,IAAsD,UACtDC,IAA0B,IAAIC,QACZ;AAClB,QAAMC,IAAQC,EAAc,EAAE,KAAAN,GAAK,SAAAG,EAAS,CAAA,GACtCI,IAASJ,EAAQ;AAChB,SAAA,QAAQ,QAAQK,EAAqBH,GAAO,EAAE,SAAAJ,GAAS,WAAAC,GAAW,QAAAK,EAAQ,CAAA,CAAC;AACtF,GAEaC,IAAuB,CAChCH,GACA,EAAE,aAAAI,GAAa,SAAAR,IAAU,GAAG,WAAAC,IAAY,UAAU,QAAAK,IAASG,EAAY,IAAiC,CAAA,MAC/F;AACT,QAAMC,IAAoBF,IAAcG,EAAeH,CAAW,wBAAQ;AAE1E,MAAII,IAAO;AACX,WAASC,IAAI,GAAGC,IAAMV,EAAM,QAAQS,IAAIC,GAAKD,KAAK;AACxC,UAAAE,IAAOX,EAAMS,CAAC;AAChB,IAAAG,EAAYD,CAAI,IACRH,KAAA,WAEAA,KAAAK,EAA6BF,GAAMT,GAAQ;AAAA,MAC/C,mBAAAI;AAAA,IAAA,CACH;AAAA,EAET;AAEA,SAAIV,IAAU,IACH,uBAAuBA,CAAO,gBAAgBC,CAAS,MAAMW,CAAI,WAGrEA;AACX,GAEMI,IAAc,CAACD,MAA+B;;AAChD,SAAK,MAAM,QAAQA,KAAA,gBAAAA,EAAM,QAAQ,KAG1BG,IAAAH,KAAA,gBAAAA,EAAM,aAAN,gBAAAG,EAAgB,MAAM,CAACC,MAAUA,EAAM,SAAS,MAF5C;AAGf;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const l = (e) => e ? Object.keys(e).reduce((r, t) => {
|
|
2
|
+
const s = e[t];
|
|
3
|
+
return s ? `${r}${a(t)}: ${s}; ` : r;
|
|
4
|
+
}, "").trim().replaceAll('"', "'") : "", a = (e) => e.replaceAll(/([A-Z])/g, "-$1").toLowerCase();
|
|
5
|
+
export {
|
|
6
|
+
l as reactCssPropsToCss
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=reactCssPropsToCss.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactCssPropsToCss.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { CSSProperties } from 'react';\n\nexport const reactCssPropsToCss = (props?: CSSProperties): string => {\n if (!props) {\n return '';\n }\n\n return Object.keys(props)\n .reduce<string>((acc, key) => {\n const value = props[key as keyof CSSProperties];\n return value ? `${acc}${convertCamelCaseToKebabCase(key)}: ${value}; ` : acc;\n }, '')\n .trim()\n .replaceAll('\"', \"'\");\n};\n\nconst convertCamelCaseToKebabCase = (str: string): string => {\n return str.replaceAll(/([A-Z])/g, '-$1').toLowerCase();\n};\n"],"names":["reactCssPropsToCss","props","acc","key","value","convertCamelCaseToKebabCase","str"],"mappings":"AAIa,MAAAA,IAAqB,CAACC,MAC1BA,IAIE,OAAO,KAAKA,CAAK,EACnB,OAAe,CAACC,GAAKC,MAAQ;AACpB,QAAAC,IAAQH,EAAME,CAA0B;AACvC,SAAAC,IAAQ,GAAGF,CAAG,GAAGG,EAA4BF,CAAG,CAAC,KAAKC,CAAK,OAAOF;AAAA,GAC1E,EAAE,EACJ,OACA,WAAW,KAAK,GAAG,IATb,IAYTG,IAA8B,CAACC,MAC1BA,EAAI,WAAW,YAAY,KAAK,EAAE,YAAY;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BOLD_CLASSES as S, ITALIC_CLASSES as c, UNDERLINE_CLASSES as $, STRIKETHROUGH_CLASSES as f, CODE_CLASSES as o } from "@frontify/fondue";
|
|
2
|
+
import u from "escape-html";
|
|
3
|
+
const A = (a) => {
|
|
4
|
+
let s = u(a.text);
|
|
5
|
+
s = s.replaceAll(`
|
|
6
|
+
`, "<br />");
|
|
7
|
+
const { bold: p, italic: i, underline: e, strikethrough: r, code: t, subscript: l, superscript: n } = a;
|
|
8
|
+
return p && (s = `<span class="${S}">${s}</span>`), i && (s = `<span class="${c}">${s}</span>`), e && (s = `<span class="${$}">${s}</span>`), r && (s = `<span class="${f}">${s}</span>`), t && (s = `<span class="${o}">${s}</span>`), l ? s = `<sub>${s}</sub>` : n && (s = `<sup>${s}</sup>`), s;
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
A as serializeLeafToHtml
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=serializeLeafToHtml.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializeLeafToHtml.es.js","sources":["../../../../../src/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { BOLD_CLASSES, CODE_CLASSES, ITALIC_CLASSES, STRIKETHROUGH_CLASSES, UNDERLINE_CLASSES } from '@frontify/fondue';\nimport { TText } from '@udecode/plate';\nimport escapeHtml from 'escape-html';\n\nexport const serializeLeafToHtml = (node: TText): string => {\n let string = escapeHtml(node.text);\n string = string.replaceAll('\\n', '<br />');\n const { bold, italic, underline, strikethrough, code, subscript, superscript } = node;\n if (bold) {\n string = `<span class=\"${BOLD_CLASSES}\">${string}</span>`;\n }\n if (italic) {\n string = `<span class=\"${ITALIC_CLASSES}\">${string}</span>`;\n }\n if (underline) {\n string = `<span class=\"${UNDERLINE_CLASSES}\">${string}</span>`;\n }\n if (strikethrough) {\n string = `<span class=\"${STRIKETHROUGH_CLASSES}\">${string}</span>`;\n }\n if (code) {\n string = `<span class=\"${CODE_CLASSES}\">${string}</span>`;\n }\n if (subscript) {\n string = `<sub>${string}</sub>`;\n } else if (superscript) {\n string = `<sup>${string}</sup>`;\n }\n return string;\n};\n"],"names":["serializeLeafToHtml","node","string","escapeHtml","bold","italic","underline","strikethrough","code","subscript","superscript","BOLD_CLASSES","ITALIC_CLASSES","UNDERLINE_CLASSES","STRIKETHROUGH_CLASSES","CODE_CLASSES"],"mappings":";;AAMa,MAAAA,IAAsB,CAACC,MAAwB;AACpD,MAAAC,IAASC,EAAWF,EAAK,IAAI;AACxB,EAAAC,IAAAA,EAAO,WAAW;AAAA,GAAM,QAAQ;AACnC,QAAA,EAAE,MAAAE,GAAM,QAAAC,GAAQ,WAAAC,GAAW,eAAAC,GAAe,MAAAC,GAAM,WAAAC,GAAW,aAAAC,EAAgB,IAAAT;AACjF,SAAIG,MACSF,IAAA,gBAAgBS,CAAY,KAAKT,CAAM,YAEhDG,MACSH,IAAA,gBAAgBU,CAAc,KAAKV,CAAM,YAElDI,MACSJ,IAAA,gBAAgBW,CAAiB,KAAKX,CAAM,YAErDK,MACSL,IAAA,gBAAgBY,CAAqB,KAAKZ,CAAM,YAEzDM,MACSN,IAAA,gBAAgBa,CAAY,KAAKb,CAAM,YAEhDO,IACAP,IAAS,QAAQA,CAAM,WAChBQ,MACPR,IAAS,QAAQA,CAAM,WAEpBA;AACX;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { relativeUrlRegex as e } from "../components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js";
|
|
2
|
+
const n = (t) => {
|
|
3
|
+
if (e.test(t))
|
|
4
|
+
return t;
|
|
5
|
+
try {
|
|
6
|
+
return new URL(t), t;
|
|
7
|
+
} catch {
|
|
8
|
+
return `https://${t}`;
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
n as addHttps
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=addHttps.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addHttps.es.js","sources":["../../src/helpers/addHttps.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { relativeUrlRegex } from '../components/RichTextEditor/plugins/LinkPlugin/utils';\n\nexport const addHttps = (url: string) => {\n if (relativeUrlRegex.test(url)) {\n return url;\n }\n try {\n new URL(url);\n return url;\n } catch {\n return `https://${url}`;\n }\n};\n"],"names":["addHttps","url","relativeUrlRegex"],"mappings":";AAIa,MAAAA,IAAW,CAACC,MAAgB;AACjC,MAAAC,EAAiB,KAAKD,CAAG;AAClB,WAAAA;AAEP,MAAA;AACA,eAAI,IAAIA,CAAG,GACJA;AAAA,EAAA,QACH;AACJ,WAAO,WAAWA,CAAG;AAAA,EACzB;AACJ;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { hasRichTextValue as c } from "./hasRichTextValue.es.js";
|
|
2
|
+
const n = (r = "p", o = "", i) => c(o) ? o : JSON.stringify([{ type: r, children: [{ text: o, textStyle: r }], align: i }]);
|
|
3
|
+
export {
|
|
4
|
+
n as convertToRteValue
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=convertToRichTextValue.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"convertToRichTextValue.es.js","sources":["../../src/helpers/convertToRichTextValue.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { hasRichTextValue } from './hasRichTextValue';\n\nexport const convertToRteValue = (textStyle = 'p', text = '', align?: 'center' | 'right' | 'left' | 'justify') =>\n hasRichTextValue(text) ? text : JSON.stringify([{ type: textStyle, children: [{ text, textStyle }], align }]);\n"],"names":["convertToRteValue","textStyle","text","align","hasRichTextValue"],"mappings":";AAIa,MAAAA,IAAoB,CAACC,IAAY,KAAKC,IAAO,IAAIC,MAC1DC,EAAiBF,CAAI,IAAIA,IAAO,KAAK,UAAU,CAAC,EAAE,MAAMD,GAAW,UAAU,CAAC,EAAE,MAAAC,GAAM,WAAAD,EAAA,CAAW,GAAG,OAAAE,GAAO,CAAC;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { KeyboardCode as h } from "@dnd-kit/core";
|
|
2
|
+
const w = [h.Down, h.Right, h.Up, h.Left], m = (x, y) => (t, { currentCoordinates: f, context: { activeNode: s } }) => {
|
|
3
|
+
if (t.preventDefault(), w.includes(t.code)) {
|
|
4
|
+
const g = (s == null ? void 0 : s.offsetWidth) ?? 0, p = (s == null ? void 0 : s.offsetHeight) ?? 0;
|
|
5
|
+
switch (t.code) {
|
|
6
|
+
case h.Right:
|
|
7
|
+
return {
|
|
8
|
+
...f,
|
|
9
|
+
x: f.x + g + x
|
|
10
|
+
};
|
|
11
|
+
case h.Left:
|
|
12
|
+
return {
|
|
13
|
+
...f,
|
|
14
|
+
x: f.x - g - x
|
|
15
|
+
};
|
|
16
|
+
case h.Down:
|
|
17
|
+
return {
|
|
18
|
+
...f,
|
|
19
|
+
y: f.y + p + y
|
|
20
|
+
};
|
|
21
|
+
case h.Up:
|
|
22
|
+
return {
|
|
23
|
+
...f,
|
|
24
|
+
y: f.y - p - y
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
m as customCoordinatesGetterFactory
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=customCoordinatesGetterFactory.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customCoordinatesGetterFactory.es.js","sources":["../../src/helpers/customCoordinatesGetterFactory.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { KeyboardCode, KeyboardCoordinateGetter } from '@dnd-kit/core';\n\nconst directions: string[] = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];\n\nexport const customCoordinatesGetterFactory =\n (columnGap: number, rowGap: number): KeyboardCoordinateGetter =>\n (event, { currentCoordinates, context: { activeNode } }) => {\n event.preventDefault();\n if (directions.includes(event.code)) {\n const width = activeNode?.offsetWidth ?? 0;\n const height = activeNode?.offsetHeight ?? 0;\n\n switch (event.code) {\n case KeyboardCode.Right:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x + width + columnGap,\n };\n case KeyboardCode.Left:\n return {\n ...currentCoordinates,\n x: currentCoordinates.x - width - columnGap,\n };\n case KeyboardCode.Down:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y + height + rowGap,\n };\n case KeyboardCode.Up:\n return {\n ...currentCoordinates,\n y: currentCoordinates.y - height - rowGap,\n };\n }\n }\n return undefined;\n };\n"],"names":["directions","KeyboardCode","customCoordinatesGetterFactory","columnGap","rowGap","event","currentCoordinates","activeNode","width","height"],"mappings":";AAIA,MAAMA,IAAuB,CAACC,EAAa,MAAMA,EAAa,OAAOA,EAAa,IAAIA,EAAa,IAAI,GAE1FC,IACT,CAACC,GAAmBC,MACpB,CAACC,GAAO,EAAE,oBAAAC,GAAoB,SAAS,EAAE,YAAAC,EAAW,QAAQ;AAExD,MADAF,EAAM,eAAe,GACjBL,EAAW,SAASK,EAAM,IAAI,GAAG;AAC3B,UAAAG,KAAQD,KAAA,gBAAAA,EAAY,gBAAe,GACnCE,KAASF,KAAA,gBAAAA,EAAY,iBAAgB;AAE3C,YAAQF,EAAM,MAAM;AAAA,MAChB,KAAKJ,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIE,IAAQL;AAAA,QAAA;AAAA,MAE1C,KAAKF,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIE,IAAQL;AAAA,QAAA;AAAA,MAE1C,KAAKF,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIG,IAASL;AAAA,QAAA;AAAA,MAE3C,KAAKH,EAAa;AACP,eAAA;AAAA,UACH,GAAGK;AAAA,UACH,GAAGA,EAAmB,IAAIG,IAASL;AAAA,QAAA;AAAA,IAE/C;AAAA,EACJ;AAEJ;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const s = (t) => {
|
|
2
|
+
if (!t)
|
|
3
|
+
return !1;
|
|
4
|
+
const n = (e) => e.some((r) => r.text ? r.text !== "" : r.children ? n(r.children) : !1);
|
|
5
|
+
try {
|
|
6
|
+
const e = JSON.parse(t);
|
|
7
|
+
return n(e);
|
|
8
|
+
} catch {
|
|
9
|
+
return !1;
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
s as hasRichTextValue
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=hasRichTextValue.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hasRichTextValue.es.js","sources":["../../src/helpers/hasRichTextValue.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\ntype TextElement = {\n text: string;\n children?: TextElement[];\n};\n\nexport const hasRichTextValue = (string?: string): boolean => {\n if (!string) {\n return false;\n }\n const hasText = (children: TextElement[]): boolean =>\n children.some((child: TextElement) => {\n if (child.text) {\n return child.text !== '';\n }\n if (child.children) {\n return hasText(child.children);\n }\n return false;\n });\n\n try {\n const json = JSON.parse(string);\n return hasText(json);\n } catch (error) {\n return false;\n }\n};\n"],"names":["hasRichTextValue","string","hasText","children","child","json"],"mappings":"AAOa,MAAAA,IAAmB,CAACC,MAA6B;AAC1D,MAAI,CAACA;AACM,WAAA;AAEX,QAAMC,IAAU,CAACC,MACbA,EAAS,KAAK,CAACC,MACPA,EAAM,OACCA,EAAM,SAAS,KAEtBA,EAAM,WACCF,EAAQE,EAAM,QAAQ,IAE1B,EACV;AAED,MAAA;AACM,UAAAC,IAAO,KAAK,MAAMJ,CAAM;AAC9B,WAAOC,EAAQG,CAAI;AAAA,UACP;AACL,WAAA;AAAA,EACX;AACJ;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isDownloadable.es.js","sources":["../../src/helpers/isDownloadable.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Security } from '../settings/types';\n\nexport const isDownloadable = (security: Security, downloadable: boolean, globalAssetDownloadEnabled: boolean) => {\n return security === Security.Custom ? downloadable : globalAssetDownloadEnabled;\n};\n"],"names":["isDownloadable","security","downloadable","globalAssetDownloadEnabled","Security"],"mappings":";AAIO,MAAMA,IAAiB,CAACC,GAAoBC,GAAuBC,MAC/DF,MAAaG,EAAS,SAASF,IAAeC;"}
|