@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
|
@@ -16,7 +16,7 @@ describe('Block Item Wrapper', () => {
|
|
|
16
16
|
mount(
|
|
17
17
|
<BlockItemWrapper toolbarFlyoutItems={[]} toolbarItems={[]}>
|
|
18
18
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
19
|
-
</BlockItemWrapper
|
|
19
|
+
</BlockItemWrapper>,
|
|
20
20
|
);
|
|
21
21
|
cy.get(BlockItemWrapperSelector).should('exist');
|
|
22
22
|
cy.get(ChildSelector).should('exist');
|
|
@@ -26,7 +26,7 @@ describe('Block Item Wrapper', () => {
|
|
|
26
26
|
mount(
|
|
27
27
|
<BlockItemWrapper toolbarFlyoutItems={[]} toolbarItems={[]}>
|
|
28
28
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
29
|
-
</BlockItemWrapper
|
|
29
|
+
</BlockItemWrapper>,
|
|
30
30
|
);
|
|
31
31
|
cy.get(BlockItemWrapperSelector).should('have.class', 'hover:tw-outline');
|
|
32
32
|
});
|
|
@@ -35,7 +35,7 @@ describe('Block Item Wrapper', () => {
|
|
|
35
35
|
mount(
|
|
36
36
|
<BlockItemWrapper toolbarFlyoutItems={[]} toolbarItems={[]} shouldHideWrapper>
|
|
37
37
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
38
|
-
</BlockItemWrapper
|
|
38
|
+
</BlockItemWrapper>,
|
|
39
39
|
);
|
|
40
40
|
cy.get(BlockItemWrapperSelector).should('not.exist');
|
|
41
41
|
});
|
|
@@ -50,7 +50,7 @@ describe('Block Item Wrapper', () => {
|
|
|
50
50
|
]}
|
|
51
51
|
>
|
|
52
52
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
53
|
-
</BlockItemWrapper
|
|
53
|
+
</BlockItemWrapper>,
|
|
54
54
|
);
|
|
55
55
|
cy.get(ToolbarButtonSelector).should('have.length', 2);
|
|
56
56
|
});
|
|
@@ -85,7 +85,7 @@ describe('Block Item Wrapper', () => {
|
|
|
85
85
|
]}
|
|
86
86
|
>
|
|
87
87
|
<div data-test-id="block-item-wrapper-child" className="tw-mt-8 tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
88
|
-
</BlockItemWrapper
|
|
88
|
+
</BlockItemWrapper>,
|
|
89
89
|
);
|
|
90
90
|
cy.get(ToolbarButtonSelector).eq(0).focus();
|
|
91
91
|
cy.get(FlyoutSelector).should('exist');
|
|
@@ -103,7 +103,7 @@ describe('Block Item Wrapper', () => {
|
|
|
103
103
|
]}
|
|
104
104
|
>
|
|
105
105
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
106
|
-
</BlockItemWrapper
|
|
106
|
+
</BlockItemWrapper>,
|
|
107
107
|
);
|
|
108
108
|
cy.get(ToolbarButtonSelector).eq(0).focus();
|
|
109
109
|
cy.get(BlockItemWrapperSelector).should('have.css', 'outline-style', 'solid');
|
|
@@ -120,7 +120,7 @@ describe('Block Item Wrapper', () => {
|
|
|
120
120
|
]}
|
|
121
121
|
>
|
|
122
122
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
123
|
-
</BlockItemWrapper
|
|
123
|
+
</BlockItemWrapper>,
|
|
124
124
|
);
|
|
125
125
|
cy.get(ToolbarButtonSelector).eq(0).focus();
|
|
126
126
|
cy.get(ToolbarSelector).should('be.visible');
|
|
@@ -137,7 +137,7 @@ describe('Block Item Wrapper', () => {
|
|
|
137
137
|
shouldBeShown
|
|
138
138
|
>
|
|
139
139
|
<div data-test-id="block-item-wrapper-child" className="tw-w-8 tw-h-8 tw-bg-red-50" />
|
|
140
|
-
</BlockItemWrapper
|
|
140
|
+
</BlockItemWrapper>,
|
|
141
141
|
);
|
|
142
142
|
cy.get(ChildSelector).should('exist');
|
|
143
143
|
cy.get(BlockItemWrapperSelector).should('have.css', 'outline-style', 'solid');
|
|
@@ -62,7 +62,7 @@ describe('RichTextEditor', () => {
|
|
|
62
62
|
isEditing={true}
|
|
63
63
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
64
64
|
value={convertToRteValue('p', 'This is a link')}
|
|
65
|
-
|
|
65
|
+
/>,
|
|
66
66
|
);
|
|
67
67
|
cy.get(RichTextSelector).click();
|
|
68
68
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -83,7 +83,7 @@ describe('RichTextEditor', () => {
|
|
|
83
83
|
isEditing={true}
|
|
84
84
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
85
85
|
value={convertToRteValue('p', 'This is a link')}
|
|
86
|
-
|
|
86
|
+
/>,
|
|
87
87
|
);
|
|
88
88
|
cy.get(RichTextSelector).click();
|
|
89
89
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -102,7 +102,7 @@ describe('RichTextEditor', () => {
|
|
|
102
102
|
isEditing={true}
|
|
103
103
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
104
104
|
value={convertToRteValue('p', 'This is a link')}
|
|
105
|
-
|
|
105
|
+
/>,
|
|
106
106
|
);
|
|
107
107
|
|
|
108
108
|
cy.get(RichTextSelector).click();
|
|
@@ -122,7 +122,7 @@ describe('RichTextEditor', () => {
|
|
|
122
122
|
isEditing={true}
|
|
123
123
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
124
124
|
value={convertToRteValue('p', 'This is a link')}
|
|
125
|
-
|
|
125
|
+
/>,
|
|
126
126
|
);
|
|
127
127
|
cy.get(RichTextSelector).click();
|
|
128
128
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -140,7 +140,7 @@ describe('RichTextEditor', () => {
|
|
|
140
140
|
<RichTextEditor
|
|
141
141
|
isEditing={true}
|
|
142
142
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
143
|
-
|
|
143
|
+
/>,
|
|
144
144
|
);
|
|
145
145
|
cy.get(RichTextSelector).click();
|
|
146
146
|
cy.get(RichTextSelector).type('mailto:info@frontify.com {enter}');
|
|
@@ -155,7 +155,7 @@ describe('RichTextEditor', () => {
|
|
|
155
155
|
<RichTextEditor
|
|
156
156
|
isEditing={true}
|
|
157
157
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
158
|
-
|
|
158
|
+
/>,
|
|
159
159
|
);
|
|
160
160
|
cy.get(RichTextSelector).click();
|
|
161
161
|
cy.get(RichTextSelector).type('list:{enter}');
|
|
@@ -171,7 +171,7 @@ describe('RichTextEditor', () => {
|
|
|
171
171
|
isEditing={true}
|
|
172
172
|
plugins={new PluginComposer().setPlugin([new LinkPlugin({ appBridge })])}
|
|
173
173
|
value={convertToRteValue('p', 'This is a link')}
|
|
174
|
-
|
|
174
|
+
/>,
|
|
175
175
|
);
|
|
176
176
|
cy.get(RichTextSelector).click();
|
|
177
177
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -190,7 +190,7 @@ describe('RichTextEditor', () => {
|
|
|
190
190
|
isEditing={true}
|
|
191
191
|
plugins={new PluginComposer().setPlugin([new ButtonPlugin({ appBridge })])}
|
|
192
192
|
value={convertToRteValue('p', 'This is a button')}
|
|
193
|
-
|
|
193
|
+
/>,
|
|
194
194
|
);
|
|
195
195
|
cy.get(RichTextSelector).click();
|
|
196
196
|
cy.get(RichTextSelector).type('{selectall}');
|
|
@@ -27,7 +27,7 @@ export const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {
|
|
|
27
27
|
new SoftBreakPlugin(),
|
|
28
28
|
new TextStylePlugin({
|
|
29
29
|
textStyles: TextStylePluginsWithoutImage,
|
|
30
|
-
})
|
|
30
|
+
}),
|
|
31
31
|
)
|
|
32
32
|
.setPlugin(
|
|
33
33
|
[
|
|
@@ -48,6 +48,6 @@ export const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {
|
|
|
48
48
|
new CheckboxListPlugin(),
|
|
49
49
|
new OrderedListPlugin(),
|
|
50
50
|
new ResetFormattingPlugin(),
|
|
51
|
-
]
|
|
51
|
+
],
|
|
52
52
|
);
|
|
53
53
|
};
|
package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx
CHANGED
|
@@ -32,7 +32,7 @@ export const ButtonToolbarButton = ({ type, ...props }: LinkToolbarButtonProps)
|
|
|
32
32
|
tooltip={getTooltip(
|
|
33
33
|
isEnabled
|
|
34
34
|
? `Button\n${getHotkeyByPlatform('Ctrl+Shift+K')}`
|
|
35
|
-
: 'Buttons can only be set for a single text block.'
|
|
35
|
+
: 'Buttons can only be set for a single text block.',
|
|
36
36
|
)}
|
|
37
37
|
classNames={getButtonClassNames(isEnabled)}
|
|
38
38
|
active={isLink}
|
|
@@ -25,6 +25,6 @@ export const useFloatingButtonUrlInput = (props: HTMLPropsAs<'input'>): HTMLProp
|
|
|
25
25
|
onChange,
|
|
26
26
|
defaultValue: floatingButtonSelectors.url(),
|
|
27
27
|
},
|
|
28
|
-
{ ...props, ref: useComposedRef<HTMLInputElement>(props.ref, ref) }
|
|
28
|
+
{ ...props, ref: useComposedRef<HTMLInputElement>(props.ref, ref) },
|
|
29
29
|
);
|
|
30
30
|
};
|
|
@@ -14,6 +14,7 @@ import { withButton } from './withButton';
|
|
|
14
14
|
export const ELEMENT_BUTTON = 'button';
|
|
15
15
|
export const BUTTON_PLUGIN = 'button-plugin';
|
|
16
16
|
|
|
17
|
+
// eslint-disable-next-line
|
|
17
18
|
export interface ButtonPlugin {
|
|
18
19
|
forceSubmit?: boolean;
|
|
19
20
|
|
|
@@ -97,6 +98,7 @@ export type ButtonPluginProps = Omit<PluginProps, 'styles'> & {
|
|
|
97
98
|
styles?: Record<string, CSSProperties & { hover?: CSSProperties }>;
|
|
98
99
|
} & { appBridge: AppBridgeBlock };
|
|
99
100
|
|
|
101
|
+
// eslint-disable-next-line
|
|
100
102
|
export class ButtonPlugin extends Plugin {
|
|
101
103
|
public styles: CSSProperties = {};
|
|
102
104
|
private appBridge: AppBridgeBlock;
|
|
@@ -7,11 +7,11 @@ import { CreateButtonNodeOptions, createButtonNode } from '../utils/index';
|
|
|
7
7
|
export const insertButton = <V extends Value>(
|
|
8
8
|
editor: PlateEditor<V>,
|
|
9
9
|
createButtonNodeOptions: CreateButtonNodeOptions,
|
|
10
|
-
options?: InsertNodesOptions<V
|
|
10
|
+
options?: InsertNodesOptions<V>,
|
|
11
11
|
) => {
|
|
12
12
|
insertNodes<TButtonElement | TText>(
|
|
13
13
|
editor,
|
|
14
14
|
[createButtonNode(editor, createButtonNodeOptions)],
|
|
15
|
-
options as InsertNodesOptions
|
|
15
|
+
options as InsertNodesOptions,
|
|
16
16
|
);
|
|
17
17
|
};
|
|
@@ -55,7 +55,7 @@ export const upsertButton = <V extends Value>(
|
|
|
55
55
|
insertTextInButton,
|
|
56
56
|
insertNodesOptions,
|
|
57
57
|
isUrl = getPluginOptions<ButtonPlugin, V>(editor, ELEMENT_BUTTON).isUrl,
|
|
58
|
-
}: UpsertButtonOptions<V
|
|
58
|
+
}: UpsertButtonOptions<V>,
|
|
59
59
|
) => {
|
|
60
60
|
const at = editor.selection;
|
|
61
61
|
if (!at) {
|
|
@@ -136,7 +136,7 @@ export const upsertButton = <V extends Value>(
|
|
|
136
136
|
},
|
|
137
137
|
],
|
|
138
138
|
},
|
|
139
|
-
insertNodesOptions
|
|
139
|
+
insertNodesOptions,
|
|
140
140
|
);
|
|
141
141
|
return true;
|
|
142
142
|
};
|
|
@@ -151,7 +151,7 @@ function anchorAndFocusInButton<V extends Value>(
|
|
|
151
151
|
url: string,
|
|
152
152
|
buttonStyle?: RichTextButtonStyle,
|
|
153
153
|
target?: string,
|
|
154
|
-
text?: string
|
|
154
|
+
text?: string,
|
|
155
155
|
) {
|
|
156
156
|
if (buttonAbove) {
|
|
157
157
|
unwrapButton(editor, {
|
|
@@ -178,7 +178,7 @@ function editButtonUrlAndTarget<V extends Value>(
|
|
|
178
178
|
buttonAbove: TNodeEntry<TButtonElement>,
|
|
179
179
|
target?: string,
|
|
180
180
|
buttonStyle?: string,
|
|
181
|
-
text?: string
|
|
181
|
+
text?: string,
|
|
182
182
|
) {
|
|
183
183
|
if (
|
|
184
184
|
url !== buttonAbove[0]?.url ||
|
|
@@ -190,7 +190,7 @@ function editButtonUrlAndTarget<V extends Value>(
|
|
|
190
190
|
{ url, target, buttonStyle },
|
|
191
191
|
{
|
|
192
192
|
at: buttonAbove[1],
|
|
193
|
-
}
|
|
193
|
+
},
|
|
194
194
|
);
|
|
195
195
|
}
|
|
196
196
|
|
|
@@ -14,7 +14,7 @@ export interface WrapButtonOptions<V extends Value = Value> extends WrapNodesOpt
|
|
|
14
14
|
*/
|
|
15
15
|
export const wrapButton = <V extends Value>(
|
|
16
16
|
editor: PlateEditor<V>,
|
|
17
|
-
{ url, buttonStyle, target, ...options }: WrapButtonOptions<V
|
|
17
|
+
{ url, buttonStyle, target, ...options }: WrapButtonOptions<V>,
|
|
18
18
|
) => {
|
|
19
19
|
wrapNodes<TButtonElement, Value>(
|
|
20
20
|
editor,
|
|
@@ -25,6 +25,6 @@ export const wrapButton = <V extends Value>(
|
|
|
25
25
|
target,
|
|
26
26
|
children: [],
|
|
27
27
|
},
|
|
28
|
-
{ split: true, ...options } as WrapNodesOptions
|
|
28
|
+
{ split: true, ...options } as WrapNodesOptions,
|
|
29
29
|
);
|
|
30
30
|
};
|
|
@@ -14,7 +14,7 @@ export interface CreateButtonNodeOptions {
|
|
|
14
14
|
|
|
15
15
|
export const createButtonNode = <V extends Value>(
|
|
16
16
|
editor: PlateEditor<V>,
|
|
17
|
-
{ url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions
|
|
17
|
+
{ url, text = '', buttonStyle = 'primary', target, children }: CreateButtonNodeOptions,
|
|
18
18
|
): TButtonElement => {
|
|
19
19
|
const type = getPluginType(editor, ELEMENT_BUTTON);
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ export const LinkButton = ({ id, editorId }: PluginButtonProps) => {
|
|
|
22
22
|
tooltip={getTooltip(
|
|
23
23
|
isEnabled
|
|
24
24
|
? `Link\n${getHotkeyByPlatform('Ctrl+K')}`
|
|
25
|
-
: 'Links can only be set for a single text block.'
|
|
25
|
+
: 'Links can only be set for a single text block.',
|
|
26
26
|
)}
|
|
27
27
|
icon={
|
|
28
28
|
<span className="tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex">
|
|
@@ -4,32 +4,29 @@ import { describe, expect, it } from 'vitest';
|
|
|
4
4
|
import { relativeUrlRegex } from './relativeUrlRegex';
|
|
5
5
|
|
|
6
6
|
describe('Regex values', () => {
|
|
7
|
-
it(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const isMatching = relativeUrlRegex.test(data.input);
|
|
32
|
-
expect(isMatching).toBe(data.shouldMatch);
|
|
33
|
-
}
|
|
7
|
+
it.each([
|
|
8
|
+
{
|
|
9
|
+
input: '/document/123',
|
|
10
|
+
shouldMatch: true,
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
input: '/r/123',
|
|
14
|
+
shouldMatch: true,
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
input: '/wrong/123',
|
|
18
|
+
shouldMatch: false,
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
input: '/r/',
|
|
22
|
+
shouldMatch: false,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
input: '/document/',
|
|
26
|
+
shouldMatch: false,
|
|
27
|
+
},
|
|
28
|
+
])('should only match internal documents starting with /r/ or /document/', ({ input, shouldMatch }) => {
|
|
29
|
+
const isMatching = relativeUrlRegex.test(input);
|
|
30
|
+
expect(isMatching).toBe(shouldMatch);
|
|
34
31
|
});
|
|
35
32
|
});
|
|
@@ -9,7 +9,7 @@ export const checkItemNode = (
|
|
|
9
9
|
node: TElement,
|
|
10
10
|
children: string,
|
|
11
11
|
defaultClassNames: string,
|
|
12
|
-
styles: Record<string, CSSProperties & { hover?: CSSProperties }
|
|
12
|
+
styles: Record<string, CSSProperties & { hover?: CSSProperties }>,
|
|
13
13
|
) => {
|
|
14
14
|
return `<div disabled class="tw-flex tw-flex-row tw-pb-2 first-of-type:tw-ml-0 ${defaultClassNames}" style="margin-left:${
|
|
15
15
|
((node.indent as number) ?? 0) * 24
|
|
@@ -36,13 +36,13 @@ export const defaultNode = (node: TElement, children: string, styles: CSSPropert
|
|
|
36
36
|
if (node.type === TextStyles.imageTitle) {
|
|
37
37
|
return `<p class="${merge([defaultClassNames, 'a-image-title'])}">${getStyledChild(
|
|
38
38
|
children,
|
|
39
|
-
defaultStyles
|
|
39
|
+
defaultStyles,
|
|
40
40
|
)}</p>`;
|
|
41
41
|
}
|
|
42
42
|
if (node.type === TextStyles.imageCaption) {
|
|
43
43
|
return `<p class="${merge([defaultClassNames, 'a-image-caption'])}">${getStyledChild(
|
|
44
44
|
children,
|
|
45
|
-
defaultStyles
|
|
45
|
+
defaultStyles,
|
|
46
46
|
)}</p>`;
|
|
47
47
|
}
|
|
48
48
|
|
|
@@ -11,7 +11,7 @@ export const linkNode = (
|
|
|
11
11
|
node: TElement,
|
|
12
12
|
children: string,
|
|
13
13
|
defaultClassNames: string,
|
|
14
|
-
styles: Record<string, CSSProperties & { hover?: CSSProperties }
|
|
14
|
+
styles: Record<string, CSSProperties & { hover?: CSSProperties }>,
|
|
15
15
|
) => {
|
|
16
16
|
if (node.chosenLink) {
|
|
17
17
|
const { chosenLink } = node as TLinkElement;
|
|
@@ -57,7 +57,7 @@ type SerializeNodeToHtmlRecursiveOptions = {
|
|
|
57
57
|
export const serializeNodeToHtmlRecursive = (
|
|
58
58
|
node: TDescendant,
|
|
59
59
|
styles: Record<string, CSSProperties & { hover?: CSSProperties }> | ButtonStylesType,
|
|
60
|
-
{ mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions
|
|
60
|
+
{ mappedMentionable, nestingCount = {} }: SerializeNodeToHtmlRecursiveOptions,
|
|
61
61
|
): string => {
|
|
62
62
|
if (isText(node)) {
|
|
63
63
|
return serializeLeafToHtml(node);
|
|
@@ -90,7 +90,7 @@ export const serializeNodeToHtmlRecursive = (
|
|
|
90
90
|
node,
|
|
91
91
|
children,
|
|
92
92
|
styles[node.type],
|
|
93
|
-
getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined)
|
|
93
|
+
getClassNames(node.breakAfterColumn as string | undefined, node.align as string | undefined),
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
96
|
};
|
|
@@ -109,12 +109,12 @@ const MapNodeTypesToHtml: { [key: string]: ({ ...args }: Arguments) => string }
|
|
|
109
109
|
[ELEMENT_OL]: ({ classNames, children, node, rootNestingCount }) => {
|
|
110
110
|
const nestingLevel = Math.max(rootNestingCount - countNodesOfType([node], ELEMENT_OL), 0);
|
|
111
111
|
return `<ol class="${getOrderedListClasses(nestingLevel)} ${classNames}" style="${reactCssPropsToCss(
|
|
112
|
-
OL_STYLES
|
|
112
|
+
OL_STYLES,
|
|
113
113
|
)}">${children}</ol>`;
|
|
114
114
|
},
|
|
115
115
|
[ELEMENT_LI]: ({ classNames, children, node, styles }) =>
|
|
116
116
|
`<li class="${classNames} ${LI_CLASSNAMES}" style="${reactCssPropsToCss(
|
|
117
|
-
getLiStyles(node, styles)
|
|
117
|
+
getLiStyles(node, styles),
|
|
118
118
|
)}">${children}</li>`,
|
|
119
119
|
[ELEMENT_LIC]: ({ classNames, children, node }) =>
|
|
120
120
|
`<p class="${classNames} ${getLicElementClassNames(node)}"><span>${children}</span></p>`,
|
|
@@ -9,7 +9,7 @@ export const serializeRawToHtmlAsync = async (
|
|
|
9
9
|
raw: string,
|
|
10
10
|
columns: SerializeNodesToHtmlOptions['columns'] = 1,
|
|
11
11
|
columnGap: SerializeNodesToHtmlOptions['columnGap'] = 'normal',
|
|
12
|
-
plugins: PluginComposer = new PluginComposer()
|
|
12
|
+
plugins: PluginComposer = new PluginComposer(),
|
|
13
13
|
): Promise<string> => {
|
|
14
14
|
const nodes = parseRawValue({ raw, plugins });
|
|
15
15
|
const styles = plugins.getStyles;
|
|
@@ -18,7 +18,7 @@ export const serializeRawToHtmlAsync = async (
|
|
|
18
18
|
|
|
19
19
|
export const serializeNodesToHtml = (
|
|
20
20
|
nodes: TDescendant[],
|
|
21
|
-
{ mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {}
|
|
21
|
+
{ mentionable, columns = 1, columnGap = 'normal', styles = BlockStyles }: SerializeNodesToHtmlOptions = {},
|
|
22
22
|
): string => {
|
|
23
23
|
const mappedMentionable = mentionable ? mapMentionable(mentionable) : new Map();
|
|
24
24
|
|
|
@@ -24,7 +24,7 @@ export const useAttachments = (appBridge: AppBridgeBlock, assetId: string) => {
|
|
|
24
24
|
|
|
25
25
|
const onAttachmentReplace = async (attachmentToReplace: Asset, newAsset: Asset) => {
|
|
26
26
|
const newAssetIds = attachments.map((attachment) =>
|
|
27
|
-
attachment.id === attachmentToReplace.id ? newAsset.id : attachment.id
|
|
27
|
+
attachment.id === attachmentToReplace.id ? newAsset.id : attachment.id,
|
|
28
28
|
);
|
|
29
29
|
|
|
30
30
|
await updateAssetIdsFromKey(assetId, newAssetIds);
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
2
|
|
|
3
|
-
import '
|
|
3
|
+
import './styles.css';
|
|
4
4
|
|
|
5
5
|
import type { FC } from 'react';
|
|
6
6
|
import type { AppBridgeBlock } from '@frontify/app-bridge';
|
|
@@ -124,9 +124,9 @@ export const defineSettings = <
|
|
|
124
124
|
T extends
|
|
125
125
|
| BlockSettingsStructureExport
|
|
126
126
|
| (() => Promise<BlockSettingsStructureExport>)
|
|
127
|
-
| (() => BlockSettingsStructureExport)
|
|
127
|
+
| (() => BlockSettingsStructureExport),
|
|
128
128
|
>(
|
|
129
|
-
settingsStructure: T
|
|
129
|
+
settingsStructure: T,
|
|
130
130
|
): T => settingsStructure;
|
|
131
131
|
|
|
132
132
|
export * from './components';
|
|
@@ -41,7 +41,7 @@ describe('getBorderSettings', () => {
|
|
|
41
41
|
});
|
|
42
42
|
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty(
|
|
43
43
|
'id',
|
|
44
|
-
'borderWidth'
|
|
44
|
+
'borderWidth',
|
|
45
45
|
);
|
|
46
46
|
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty('type', 'input');
|
|
47
47
|
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toEqual({
|