@frontify/guideline-blocks-settings 0.33.4 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Attachments/AttachmentItem.es.js +174 -0
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -0
- package/dist/components/Attachments/Attachments.es.js +160 -0
- package/dist/components/Attachments/Attachments.es.js.map +1 -0
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +29 -0
- package/dist/components/Attachments/AttachmentsButtonTrigger.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 +71 -0
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +33 -0
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +26 -0
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +28 -0
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +35 -0
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +44 -0
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +25 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js +29 -0
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +22 -0
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +12 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +20 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +6 -0
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +11 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +18 -0
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +26 -0
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +18 -0
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.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/Link/LinkInput.es.js +63 -0
- package/dist/components/Link/LinkInput.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/DocumentLink.es.js +68 -0
- package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js +60 -0
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +86 -0
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +7 -0
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/PageLink.es.js +70 -0
- package/dist/components/Link/LinkSelector/PageLink.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/PageLinks.es.js +38 -0
- package/dist/components/Link/LinkSelector/PageLinks.es.js.map +1 -0
- package/dist/components/Link/LinkSelector/SectionLink.es.js +25 -0
- package/dist/components/Link/LinkSelector/SectionLink.es.js.map +1 -0
- package/dist/components/Link/utils/getUrl.es.js +18 -0
- package/dist/components/Link/utils/getUrl.es.js.map +1 -0
- package/dist/components/Link/utils/relativeUrlRegex.es.js +5 -0
- package/dist/components/Link/utils/relativeUrlRegex.es.js.map +1 -0
- package/dist/components/Link/utils/url.es.js +17 -0
- package/dist/components/Link/utils/url.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 +20 -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 +35 -0
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +41 -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 +24 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +26 -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 +28 -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 +48 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.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 +104 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.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 +57 -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 +41 -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 +67 -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 +81 -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 +52 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +32 -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 +35 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.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 +66 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +79 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +22 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +12 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +11 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.es.js +25 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkToolbarButton.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 +45 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +13 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +50 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +50 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +50 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +51 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +51 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +51 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +51 -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 +51 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +51 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +45 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +53 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/styles.es.js +167 -0
- package/dist/components/RichTextEditor/plugins/styles.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 +28 -0
- package/dist/helpers/mapColorPalettes.es.js.map +1 -0
- package/dist/hooks/useAttachments.es.js +53 -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 +4 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +1190 -0
- package/dist/index.es.js +217 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +4 -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 +2 -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 +9 -6
- package/.eslintrc.cjs +0 -27
- package/.prettierrc +0 -7
- package/CHANGELOG.md +0 -787
- package/postcss.config.cjs +0 -8
- package/setupTests.ts +0 -23
- package/src/components/Attachments/AttachmentItem.tsx +0 -247
- package/src/components/Attachments/Attachments.spec.ct.tsx +0 -165
- package/src/components/Attachments/Attachments.tsx +0 -241
- package/src/components/Attachments/AttachmentsButtonTrigger.tsx +0 -30
- package/src/components/Attachments/index.ts +0 -4
- package/src/components/Attachments/types.ts +0 -40
- package/src/components/BlockInjectButton/BlockInjectButton.spec.ct.tsx +0 -48
- package/src/components/BlockInjectButton/BlockInjectButton.tsx +0 -212
- package/src/components/BlockInjectButton/index.ts +0 -4
- package/src/components/BlockInjectButton/types.ts +0 -18
- package/src/components/BlockItemWrapper/BlockItemWrapper.spec.ct.tsx +0 -145
- package/src/components/BlockItemWrapper/BlockItemWrapper.tsx +0 -76
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.spec.tsx +0 -96
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.tsx +0 -42
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.spec.tsx +0 -44
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.tsx +0 -24
- package/src/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/index.ts +0 -3
- package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.spec.tsx +0 -40
- package/src/components/BlockItemWrapper/Toolbar/BaseToolbarButton.tsx +0 -37
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.spec.tsx +0 -89
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.tsx +0 -40
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/index.ts +0 -3
- package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.spec.tsx +0 -140
- package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.tsx +0 -61
- package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/index.ts +0 -3
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.spec.tsx +0 -77
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.tsx +0 -30
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.spec.tsx +0 -63
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.tsx +0 -40
- package/src/components/BlockItemWrapper/Toolbar/MenuToolbarButton/index.ts +0 -4
- package/src/components/BlockItemWrapper/Toolbar/Toolbar.spec.tsx +0 -259
- package/src/components/BlockItemWrapper/Toolbar/Toolbar.tsx +0 -36
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.spec.tsx +0 -70
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.tsx +0 -19
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/index.ts +0 -3
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.tsx +0 -25
- package/src/components/BlockItemWrapper/Toolbar/ToolbarSegment.tsx +0 -9
- package/src/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.tsx +0 -15
- package/src/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.tsx +0 -25
- package/src/components/BlockItemWrapper/Toolbar/context/index.ts +0 -4
- package/src/components/BlockItemWrapper/Toolbar/helpers.ts +0 -33
- package/src/components/BlockItemWrapper/Toolbar/hooks/index.ts +0 -3
- package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.spec.tsx +0 -59
- package/src/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.ts +0 -24
- package/src/components/BlockItemWrapper/Toolbar/index.ts +0 -10
- package/src/components/BlockItemWrapper/Toolbar/types.ts +0 -18
- package/src/components/BlockItemWrapper/constants.ts +0 -4
- package/src/components/BlockItemWrapper/index.ts +0 -6
- package/src/components/BlockItemWrapper/types.ts +0 -24
- package/src/components/DownloadButton/DownloadButton.spec.ct.tsx +0 -20
- package/src/components/DownloadButton/DownloadButton.tsx +0 -36
- package/src/components/DownloadButton/index.ts +0 -3
- package/src/components/DownloadButton/types.ts +0 -5
- package/src/components/Link/LinkInput.spec.ct.tsx +0 -142
- package/src/components/Link/LinkInput.tsx +0 -86
- package/src/components/Link/LinkSelector/DocumentLink.tsx +0 -81
- package/src/components/Link/LinkSelector/DocumentLinks.tsx +0 -102
- package/src/components/Link/LinkSelector/LinkSelector.spec.ct.tsx +0 -196
- package/src/components/Link/LinkSelector/LinkSelector.tsx +0 -96
- package/src/components/Link/LinkSelector/LoadingIndicator.tsx +0 -11
- package/src/components/Link/LinkSelector/PageLink.tsx +0 -96
- package/src/components/Link/LinkSelector/PageLinks.tsx +0 -71
- package/src/components/Link/LinkSelector/SectionLink.tsx +0 -36
- package/src/components/Link/LinkSelector/index.ts +0 -3
- package/src/components/Link/index.ts +0 -6
- package/src/components/Link/types.ts +0 -6
- package/src/components/Link/utils/getUrl.ts +0 -30
- package/src/components/Link/utils/index.ts +0 -5
- package/src/components/Link/utils/relativeUrlRegex.spec.ts +0 -32
- package/src/components/Link/utils/relativeUrlRegex.ts +0 -3
- package/src/components/Link/utils/url.spec.ts +0 -75
- package/src/components/Link/utils/url.ts +0 -21
- package/src/components/RichTextEditor/RichTextEditor.spec.ct.tsx +0 -231
- package/src/components/RichTextEditor/RichTextEditor.tsx +0 -62
- package/src/components/RichTextEditor/SerializedText.tsx +0 -29
- package/src/components/RichTextEditor/constants.ts +0 -3
- package/src/components/RichTextEditor/index.ts +0 -6
- package/src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx +0 -55
- package/src/components/RichTextEditor/pluginPresets/index.ts +0 -3
- package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.tsx +0 -74
- package/src/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.ts +0 -11
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.tsx +0 -20
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.tsx +0 -56
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.tsx +0 -19
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.tsx +0 -42
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.tsx +0 -37
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.tsx +0 -22
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.tsx +0 -30
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.tsx +0 -81
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/types.ts +0 -13
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.ts +0 -143
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.tsx +0 -31
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.ts +0 -46
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/index.ts +0 -12
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.ts +0 -113
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.ts +0 -21
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.ts +0 -30
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.ts +0 -71
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.ts +0 -22
- package/src/components/RichTextEditor/plugins/ButtonPlugin/components/index.ts +0 -3
- package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +0 -118
- package/src/components/RichTextEditor/plugins/ButtonPlugin/index.ts +0 -7
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/index.ts +0 -8
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.ts +0 -17
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.ts +0 -40
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.ts +0 -68
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.ts +0 -198
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.ts +0 -40
- package/src/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.ts +0 -30
- package/src/components/RichTextEditor/plugins/ButtonPlugin/types.ts +0 -13
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.ts +0 -28
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.ts +0 -14
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.ts +0 -18
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/index.ts +0 -8
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.ts +0 -83
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.ts +0 -23
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.ts +0 -30
- package/src/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.ts +0 -45
- package/src/components/RichTextEditor/plugins/ButtonPlugin/withButton.ts +0 -106
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.tsx +0 -26
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.tsx +0 -43
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/index.ts +0 -4
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.ts +0 -113
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.tsx +0 -45
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.tsx +0 -5
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.tsx +0 -88
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/index.ts +0 -4
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/types.ts +0 -11
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.ts +0 -73
- package/src/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.ts +0 -136
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkButton.tsx +0 -38
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.tsx +0 -36
- package/src/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.ts +0 -11
- package/src/components/RichTextEditor/plugins/LinkPlugin/id.ts +0 -3
- package/src/components/RichTextEditor/plugins/LinkPlugin/index.ts +0 -49
- package/src/components/RichTextEditor/plugins/LinkPlugin/types.ts +0 -12
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.tsx +0 -62
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.tsx +0 -62
- package/src/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.tsx +0 -63
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.tsx +0 -62
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.tsx +0 -62
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.tsx +0 -62
- package/src/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.tsx +0 -63
- package/src/components/RichTextEditor/plugins/TextStylePlugins/helpers.tsx +0 -44
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.tsx +0 -62
- package/src/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.tsx +0 -62
- package/src/components/RichTextEditor/plugins/TextStylePlugins/index.ts +0 -15
- package/src/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.tsx +0 -58
- package/src/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.tsx +0 -63
- package/src/components/RichTextEditor/plugins/index.ts +0 -6
- package/src/components/RichTextEditor/plugins/styles.ts +0 -178
- package/src/components/RichTextEditor/types.ts +0 -23
- package/src/components/index.ts +0 -8
- package/src/helpers/addHttps.spec.ts +0 -42
- package/src/helpers/addHttps.ts +0 -15
- package/src/helpers/convertToRichTextValue.spec.ts +0 -32
- package/src/helpers/convertToRichTextValue.ts +0 -6
- package/src/helpers/customCoordinatesGetterFactory.spec.ts +0 -69
- package/src/helpers/customCoordinatesGetterFactory.ts +0 -39
- package/src/helpers/hasRichTextValue.spec.ts +0 -63
- package/src/helpers/hasRichTextValue.ts +0 -29
- package/src/helpers/index.ts +0 -8
- package/src/helpers/isDownloadable.spec.ts +0 -47
- package/src/helpers/isDownloadable.ts +0 -7
- package/src/helpers/mapColorPalettes.spec.ts +0 -47
- package/src/helpers/mapColorPalettes.ts +0 -65
- package/src/hooks/index.ts +0 -4
- package/src/hooks/useAttachments.spec.tsx +0 -127
- package/src/hooks/useAttachments.tsx +0 -90
- package/src/hooks/useDndSensors.spec.ts +0 -40
- package/src/hooks/useDndSensors.ts +0 -23
- package/src/index.ts +0 -138
- package/src/settings/background.spec.ts +0 -173
- package/src/settings/background.ts +0 -52
- package/src/settings/border.spec.ts +0 -76
- package/src/settings/border.ts +0 -90
- package/src/settings/borderRadius.spec.ts +0 -30
- package/src/settings/borderRadius.ts +0 -73
- package/src/settings/borderRadiusExtended.spec.ts +0 -52
- package/src/settings/borderRadiusExtended.ts +0 -84
- package/src/settings/defaultValues.ts +0 -21
- package/src/settings/gutter.spec.ts +0 -60
- package/src/settings/gutter.ts +0 -75
- package/src/settings/index.ts +0 -14
- package/src/settings/margin.spec.ts +0 -42
- package/src/settings/margin.ts +0 -72
- package/src/settings/marginExtended.spec.ts +0 -45
- package/src/settings/marginExtended.ts +0 -91
- package/src/settings/padding.spec.ts +0 -42
- package/src/settings/padding.ts +0 -73
- package/src/settings/paddingExtended.spec.ts +0 -45
- package/src/settings/paddingExtended.ts +0 -91
- package/src/settings/security.spec.ts +0 -87
- package/src/settings/security.ts +0 -61
- package/src/settings/securityDownloadable.spec.ts +0 -46
- package/src/settings/securityDownloadable.ts +0 -33
- package/src/settings/securityGlobalControl.ts +0 -42
- package/src/settings/types.ts +0 -128
- package/src/styles.css +0 -3
- package/src/utilities/color/getReadableColor.spec.ts +0 -32
- package/src/utilities/color/getReadableColor.ts +0 -34
- package/src/utilities/color/index.ts +0 -10
- package/src/utilities/color/isDark.spec.ts +0 -33
- package/src/utilities/color/isDark.ts +0 -29
- package/src/utilities/color/setAlpha.spec.ts +0 -28
- package/src/utilities/color/setAlpha.ts +0 -14
- package/src/utilities/color/toColorObject.spec.ts +0 -19
- package/src/utilities/color/toColorObject.ts +0 -16
- package/src/utilities/color/toHex8String.spec.ts +0 -17
- package/src/utilities/color/toHex8String.ts +0 -14
- package/src/utilities/color/toHexString.spec.ts +0 -17
- package/src/utilities/color/toHexString.ts +0 -10
- package/src/utilities/color/toRgbaString.spec.ts +0 -12
- package/src/utilities/color/toRgbaString.ts +0 -14
- package/src/utilities/color/toShortRgba.spec.ts +0 -16
- package/src/utilities/color/toShortRgba.ts +0 -35
- package/src/utilities/index.ts +0 -5
- package/src/utilities/moveItemInArray.spec.ts +0 -17
- package/src/utilities/moveItemInArray.ts +0 -21
- package/src/utilities/react/getBackgroundColorStyles.spec.ts +0 -18
- package/src/utilities/react/getBackgroundColorStyles.ts +0 -10
- package/src/utilities/react/getBorderStyles.spec.ts +0 -39
- package/src/utilities/react/getBorderStyles.ts +0 -20
- package/src/utilities/react/getRadiusStyles.spec.ts +0 -25
- package/src/utilities/react/getRadiusStyles.ts +0 -8
- package/src/utilities/react/index.ts +0 -6
- package/src/utilities/react/joinClassNames.spec.ts +0 -18
- package/src/utilities/react/joinClassNames.ts +0 -10
- package/tailwind.config.ts +0 -27
- package/tsconfig.json +0 -24
- package/tsconfig.node.json +0 -12
- package/vite.config.ts +0 -71
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import type { CSSProperties } from 'react';
|
|
4
|
-
import { LINK_PLUGIN } from './LinkPlugin/id';
|
|
5
|
-
import { BlockButtonStyles } from './ButtonPlugin';
|
|
6
|
-
|
|
7
|
-
export enum TextStyles {
|
|
8
|
-
heading1 = 'heading1',
|
|
9
|
-
heading2 = 'heading2',
|
|
10
|
-
heading3 = 'heading3',
|
|
11
|
-
heading4 = 'heading4',
|
|
12
|
-
custom1 = 'custom1',
|
|
13
|
-
custom2 = 'custom2',
|
|
14
|
-
custom3 = 'custom3',
|
|
15
|
-
quote = 'quote',
|
|
16
|
-
imageCaption = 'imageCaption',
|
|
17
|
-
imageTitle = 'imageTitle',
|
|
18
|
-
p = 'p',
|
|
19
|
-
}
|
|
20
|
-
export const BlockStyles: Record<string, CSSProperties & { hover?: CSSProperties }> = {
|
|
21
|
-
[TextStyles.heading1]: {
|
|
22
|
-
fontSize: 'var(--f-theme-settings-heading1-font-size)',
|
|
23
|
-
lineHeight: 'var(--f-theme-settings-heading1-line-height)',
|
|
24
|
-
marginTop: 'var(--f-theme-settings-heading1-margin-top)',
|
|
25
|
-
marginBottom: 'var(--f-theme-settings-heading1-margin-bottom)',
|
|
26
|
-
textDecoration: 'var(--f-theme-settings-heading1-text-decoration)',
|
|
27
|
-
fontStyle: 'var(--f-theme-settings-heading1-font-style)',
|
|
28
|
-
textTransform: 'var(--f-theme-settings-heading1-text-transform)' as CSSProperties['textTransform'],
|
|
29
|
-
letterSpacing: 'var(--f-theme-settings-heading1-letter-spacing)',
|
|
30
|
-
fontWeight: 'var(--f-theme-settings-heading1-font-weight)',
|
|
31
|
-
fontFamily: 'var(--f-theme-settings-heading1-font-family)',
|
|
32
|
-
color: 'var(--f-theme-settings-heading1-color)',
|
|
33
|
-
},
|
|
34
|
-
[TextStyles.heading2]: {
|
|
35
|
-
fontSize: 'var(--f-theme-settings-heading2-font-size)',
|
|
36
|
-
lineHeight: 'var(--f-theme-settings-heading2-line-height)',
|
|
37
|
-
marginTop: 'var(--f-theme-settings-heading2-margin-top)',
|
|
38
|
-
marginBottom: 'var(--f-theme-settings-heading2-margin-bottom)',
|
|
39
|
-
textDecoration: 'var(--f-theme-settings-heading2-text-decoration)',
|
|
40
|
-
fontStyle: 'var(--f-theme-settings-heading2-font-style)',
|
|
41
|
-
textTransform: 'var(--f-theme-settings-heading2-text-transform)' as CSSProperties['textTransform'],
|
|
42
|
-
letterSpacing: 'var(--f-theme-settings-heading2-letter-spacing)',
|
|
43
|
-
fontWeight: 'var(--f-theme-settings-heading2-font-weight)',
|
|
44
|
-
fontFamily: 'var(--f-theme-settings-heading2-font-family)',
|
|
45
|
-
color: 'var(--f-theme-settings-heading2-color)',
|
|
46
|
-
},
|
|
47
|
-
[TextStyles.heading3]: {
|
|
48
|
-
fontSize: 'var(--f-theme-settings-heading3-font-size)',
|
|
49
|
-
lineHeight: 'var(--f-theme-settings-heading3-line-height)',
|
|
50
|
-
marginTop: 'var(--f-theme-settings-heading3-margin-top)',
|
|
51
|
-
marginBottom: 'var(--f-theme-settings-heading3-margin-bottom)',
|
|
52
|
-
textDecoration: 'var(--f-theme-settings-heading3-text-decoration)',
|
|
53
|
-
fontStyle: 'var(--f-theme-settings-heading3-font-style)',
|
|
54
|
-
textTransform: 'var(--f-theme-settings-heading3-text-transform)' as CSSProperties['textTransform'],
|
|
55
|
-
letterSpacing: 'var(--f-theme-settings-heading3-letter-spacing)',
|
|
56
|
-
fontWeight: 'var(--f-theme-settings-heading3-font-weight)',
|
|
57
|
-
fontFamily: 'var(--f-theme-settings-heading3-font-family)',
|
|
58
|
-
color: 'var(--f-theme-settings-heading3-color)',
|
|
59
|
-
},
|
|
60
|
-
[TextStyles.heading4]: {
|
|
61
|
-
fontSize: 'var(--f-theme-settings-heading4-font-size)',
|
|
62
|
-
lineHeight: 'var(--f-theme-settings-heading4-line-height)',
|
|
63
|
-
marginTop: 'var(--f-theme-settings-heading4-margin-top)',
|
|
64
|
-
marginBottom: 'var(--f-theme-settings-heading4-margin-bottom)',
|
|
65
|
-
textDecoration: 'var(--f-theme-settings-heading4-text-decoration)',
|
|
66
|
-
fontStyle: 'var(--f-theme-settings-heading4-font-style)',
|
|
67
|
-
textTransform: 'var(--f-theme-settings-heading4-text-transform)' as CSSProperties['textTransform'],
|
|
68
|
-
letterSpacing: 'var(--f-theme-settings-heading4-letter-spacing)',
|
|
69
|
-
fontWeight: 'var(--f-theme-settings-heading4-font-weight)',
|
|
70
|
-
fontFamily: 'var(--f-theme-settings-heading4-font-family)',
|
|
71
|
-
color: 'var(--f-theme-settings-heading4-color)',
|
|
72
|
-
},
|
|
73
|
-
[TextStyles.custom1]: {
|
|
74
|
-
fontSize: 'var(--f-theme-settings-custom1-font-size)',
|
|
75
|
-
lineHeight: 'var(--f-theme-settings-custom1-line-height)',
|
|
76
|
-
marginTop: 'var(--f-theme-settings-custom1-margin-top)',
|
|
77
|
-
marginBottom: 'var(--f-theme-settings-custom1-margin-bottom)',
|
|
78
|
-
textDecoration: 'var(--f-theme-settings-custom1-text-decoration)',
|
|
79
|
-
fontStyle: 'var(--f-theme-settings-custom1-font-style)',
|
|
80
|
-
textTransform: 'var(--f-theme-settings-custom1-text-transform)' as CSSProperties['textTransform'],
|
|
81
|
-
letterSpacing: 'var(--f-theme-settings-custom1-letter-spacing)',
|
|
82
|
-
fontWeight: 'var(--f-theme-settings-custom1-font-weight)',
|
|
83
|
-
fontFamily: 'var(--f-theme-settings-custom1-font-family)',
|
|
84
|
-
color: 'var(--f-theme-settings-custom1-color)',
|
|
85
|
-
},
|
|
86
|
-
[TextStyles.custom2]: {
|
|
87
|
-
fontSize: 'var(--f-theme-settings-custom2-font-size)',
|
|
88
|
-
lineHeight: 'var(--f-theme-settings-custom2-line-height)',
|
|
89
|
-
marginTop: 'var(--f-theme-settings-custom2-margin-top)',
|
|
90
|
-
marginBottom: 'var(--f-theme-settings-custom2-margin-bottom)',
|
|
91
|
-
textDecoration: 'var(--f-theme-settings-custom2-text-decoration)',
|
|
92
|
-
fontStyle: 'var(--f-theme-settings-custom2-font-style)',
|
|
93
|
-
textTransform: 'var(--f-theme-settings-custom2-text-transform)' as CSSProperties['textTransform'],
|
|
94
|
-
letterSpacing: 'var(--f-theme-settings-custom2-letter-spacing)',
|
|
95
|
-
fontWeight: 'var(--f-theme-settings-custom2-font-weight)',
|
|
96
|
-
fontFamily: 'var(--f-theme-settings-custom2-font-family)',
|
|
97
|
-
color: 'var(--f-theme-settings-custom2-color)',
|
|
98
|
-
},
|
|
99
|
-
[TextStyles.custom3]: {
|
|
100
|
-
fontSize: 'var(--f-theme-settings-custom3-font-size)',
|
|
101
|
-
lineHeight: 'var(--f-theme-settings-custom3-line-height)',
|
|
102
|
-
marginTop: 'var(--f-theme-settings-custom3-margin-top)',
|
|
103
|
-
marginBottom: 'var(--f-theme-settings-custom3-margin-bottom)',
|
|
104
|
-
textDecoration: 'var(--f-theme-settings-custom3-text-decoration)',
|
|
105
|
-
fontStyle: 'var(--f-theme-settings-custom3-font-style)',
|
|
106
|
-
textTransform: 'var(--f-theme-settings-custom3-text-transform)' as CSSProperties['textTransform'],
|
|
107
|
-
letterSpacing: 'var(--f-theme-settings-custom3-letter-spacing)',
|
|
108
|
-
fontWeight: 'var(--f-theme-settings-custom3-font-weight)',
|
|
109
|
-
fontFamily: 'var(--f-theme-settings-custom3-font-family)',
|
|
110
|
-
color: 'var(--f-theme-settings-custom3-color)',
|
|
111
|
-
},
|
|
112
|
-
[TextStyles.p]: {
|
|
113
|
-
fontSize: 'var(--f-theme-settings-body-font-size)',
|
|
114
|
-
lineHeight: 'var(--f-theme-settings-body-line-height)',
|
|
115
|
-
marginTop: 'var(--f-theme-settings-body-margin-top)',
|
|
116
|
-
marginBottom: 'var(--f-theme-settings-body-margin-bottom)',
|
|
117
|
-
textDecoration: 'var(--f-theme-settings-body-text-decoration)',
|
|
118
|
-
fontStyle: 'var(--f-theme-settings-body-font-style)',
|
|
119
|
-
textTransform: 'var(--f-theme-settings-body-text-transform)' as CSSProperties['textTransform'],
|
|
120
|
-
letterSpacing: 'var(--f-theme-settings-body-letter-spacing)',
|
|
121
|
-
fontWeight: 'var(--f-theme-settings-body-font-weight)',
|
|
122
|
-
fontFamily: 'var(--f-theme-settings-body-font-family)',
|
|
123
|
-
color: 'var(--f-theme-settings-body-color)',
|
|
124
|
-
},
|
|
125
|
-
[TextStyles.quote]: {
|
|
126
|
-
fontSize: 'var(--f-theme-settings-quote-font-size)',
|
|
127
|
-
lineHeight: 'var(--f-theme-settings-quote-line-height)',
|
|
128
|
-
marginTop: 'var(--f-theme-settings-quote-margin-top)',
|
|
129
|
-
marginBottom: 'var(--f-theme-settings-quote-margin-bottom)',
|
|
130
|
-
textDecoration: 'var(--f-theme-settings-quote-text-decoration)',
|
|
131
|
-
fontStyle: 'var(--f-theme-settings-quote-font-style)',
|
|
132
|
-
textTransform: 'var(--f-theme-settings-quote-text-transform)' as CSSProperties['textTransform'],
|
|
133
|
-
letterSpacing: 'var(--f-theme-settings-quote-letter-spacing)',
|
|
134
|
-
fontWeight: 'var(--f-theme-settings-quote-font-weight)',
|
|
135
|
-
fontFamily: 'var(--f-theme-settings-quote-font-family)',
|
|
136
|
-
color: 'var(--f-theme-settings-quote-color)',
|
|
137
|
-
},
|
|
138
|
-
[TextStyles.imageCaption]: {
|
|
139
|
-
fontSize: 'var(--f-theme-settings-image-caption-font-size)',
|
|
140
|
-
lineHeight: 'var(--f-theme-settings-image-caption-line-height)',
|
|
141
|
-
marginTop: 'var(--f-theme-settings-image-caption-margin-top)',
|
|
142
|
-
marginBottom: 'var(--f-theme-settings-image-caption-margin-bottom)',
|
|
143
|
-
textDecoration: 'var(--f-theme-settings-image-caption-text-decoration)',
|
|
144
|
-
fontStyle: 'var(--f-theme-settings-image-caption-font-style)',
|
|
145
|
-
textTransform: 'var(--f-theme-settings-image-caption-text-transform)' as CSSProperties['textTransform'],
|
|
146
|
-
letterSpacing: 'var(--f-theme-settings-image-caption-letter-spacing)',
|
|
147
|
-
fontWeight: 'var(--f-theme-settings-image-caption-font-weight)',
|
|
148
|
-
fontFamily: 'var(--f-theme-settings-image-caption-font-family)',
|
|
149
|
-
color: 'var(--f-theme-settings-image-caption-color)',
|
|
150
|
-
},
|
|
151
|
-
[TextStyles.imageTitle]: {
|
|
152
|
-
fontSize: 'var(--f-theme-settings-image-title-font-size)',
|
|
153
|
-
lineHeight: 'var(--f-theme-settings-image-title-line-height)',
|
|
154
|
-
marginTop: 'var(--f-theme-settings-image-title-margin-top)',
|
|
155
|
-
marginBottom: 'var(--f-theme-settings-image-title-margin-bottom)',
|
|
156
|
-
textDecoration: 'var(--f-theme-settings-image-title-text-decoration)',
|
|
157
|
-
fontStyle: 'var(--f-theme-settings-image-title-font-style)',
|
|
158
|
-
textTransform: 'var(--f-theme-settings-image-title-text-transform)' as CSSProperties['textTransform'],
|
|
159
|
-
letterSpacing: 'var(--f-theme-settings-image-title-letter-spacing)',
|
|
160
|
-
fontWeight: 'var(--f-theme-settings-image-title-font-weight)',
|
|
161
|
-
fontFamily: 'var(--f-theme-settings-image-title-font-family)',
|
|
162
|
-
color: 'var(--f-theme-settings-image-title-color)',
|
|
163
|
-
},
|
|
164
|
-
[LINK_PLUGIN]: {
|
|
165
|
-
fontSize: 'var(--f-theme-settings-link-font-size)',
|
|
166
|
-
lineHeight: 'var(--f-theme-settings-link-line-height)',
|
|
167
|
-
marginTop: 'var(--f-theme-settings-link-margin-top)',
|
|
168
|
-
marginBottom: 'var(--f-theme-settings-link-margin-bottom)',
|
|
169
|
-
textDecoration: 'var(--f-theme-settings-link-text-decoration)',
|
|
170
|
-
fontStyle: 'var(--f-theme-settings-link-font-style)',
|
|
171
|
-
textTransform: 'var(--f-theme-settings-link-text-transform)' as CSSProperties['textTransform'],
|
|
172
|
-
letterSpacing: 'var(--f-theme-settings-link-letter-spacing)',
|
|
173
|
-
fontWeight: 'var(--f-theme-settings-link-font-weight)',
|
|
174
|
-
fontFamily: 'var(--f-theme-settings-link-font-family)',
|
|
175
|
-
color: 'var(--f-theme-settings-link-color)',
|
|
176
|
-
},
|
|
177
|
-
...BlockButtonStyles,
|
|
178
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { PluginComposer } from '@frontify/fondue';
|
|
4
|
-
|
|
5
|
-
export type RichTextEditorProps = {
|
|
6
|
-
id?: string;
|
|
7
|
-
isEditing: boolean;
|
|
8
|
-
value?: string;
|
|
9
|
-
placeholder?: string;
|
|
10
|
-
columns?: number;
|
|
11
|
-
gap?: string;
|
|
12
|
-
plugins?: PluginComposer;
|
|
13
|
-
showSerializedText?: boolean;
|
|
14
|
-
onTextChange?: (value: string) => void;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type SerializedTextProps = {
|
|
18
|
-
value?: string;
|
|
19
|
-
show?: boolean;
|
|
20
|
-
columns?: number;
|
|
21
|
-
gap?: string;
|
|
22
|
-
plugins?: PluginComposer;
|
|
23
|
-
};
|
package/src/components/index.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { addHttps } from './addHttps';
|
|
5
|
-
|
|
6
|
-
describe('String converted to Richtext value', () => {
|
|
7
|
-
it('should return rich text value with correct textStyle', () => {
|
|
8
|
-
const url = 'https://www.frontify.com';
|
|
9
|
-
const result = addHttps(url);
|
|
10
|
-
expect(result).toBe(url);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should not add https:// for mailto', () => {
|
|
14
|
-
const url = 'mailto:info@frontify.com';
|
|
15
|
-
const result = addHttps(url);
|
|
16
|
-
expect(result).toBe(url);
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('should not add https:// for tel', () => {
|
|
20
|
-
const url = 'tel:+41 44 552 02 22';
|
|
21
|
-
const result = addHttps(url);
|
|
22
|
-
expect(result).toBe(url);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should add https://', () => {
|
|
26
|
-
const url = 'frontify.com';
|
|
27
|
-
const result = addHttps(url);
|
|
28
|
-
expect(result).toBe('https://frontify.com');
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should not add https:// for relative url', () => {
|
|
32
|
-
const url = '/document/123';
|
|
33
|
-
const result = addHttps(url);
|
|
34
|
-
expect(result).toBe(url);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('should not add https:// for http://', () => {
|
|
38
|
-
const url = 'http://localhost:3000/document/123';
|
|
39
|
-
const result = addHttps(url);
|
|
40
|
-
expect(result).toBe(url);
|
|
41
|
-
});
|
|
42
|
-
});
|
package/src/helpers/addHttps.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { relativeUrlRegex } from '../components/Link/utils';
|
|
4
|
-
|
|
5
|
-
export const addHttps = (url: string) => {
|
|
6
|
-
if (relativeUrlRegex.test(url)) {
|
|
7
|
-
return url;
|
|
8
|
-
}
|
|
9
|
-
try {
|
|
10
|
-
new URL(url);
|
|
11
|
-
return url;
|
|
12
|
-
} catch {
|
|
13
|
-
return `https://${url}`;
|
|
14
|
-
}
|
|
15
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import type { TextStyles } from '@frontify/fondue';
|
|
4
|
-
import { describe, expect, it } from 'vitest';
|
|
5
|
-
import { convertToRteValue } from './convertToRichTextValue';
|
|
6
|
-
|
|
7
|
-
describe('String converted to Richtext value', () => {
|
|
8
|
-
it('should return rich text value with correct textStyle', () => {
|
|
9
|
-
const text = 'with text';
|
|
10
|
-
const result = convertToRteValue('p' as TextStyles, text);
|
|
11
|
-
expect(result).toBe('[{"type":"p","children":[{"text":"with text","textStyle":"p"}]}]');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should return rich text value with correct textStyle', () => {
|
|
15
|
-
const text = 'Heading 1';
|
|
16
|
-
const result = convertToRteValue('heading1' as TextStyles, text);
|
|
17
|
-
expect(result).toBe('[{"type":"heading1","children":[{"text":"Heading 1","textStyle":"heading1"}]}]');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should return rich text value with correct alignment', () => {
|
|
21
|
-
const text = 'text';
|
|
22
|
-
const result = convertToRteValue('p' as TextStyles, text, 'center');
|
|
23
|
-
expect(result).toBe('[{"type":"p","children":[{"text":"text","textStyle":"p"}],"align":"center"}]');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('should test if value is rich text value, it returns the rich text Value', () => {
|
|
27
|
-
const text =
|
|
28
|
-
'[{"type":"heading1","children":[{"text":"Hoi","bold":true,"underline":true}]},{"type":"heading1","children":[{"bold":true,"underline":true,"text":" "}]},{"type":"heading1","children":[{"text":"With Text"}]},{"type":"custom2","children":[{"text":""}]}]';
|
|
29
|
-
const result = convertToRteValue('p' as TextStyles, text);
|
|
30
|
-
expect(result).toBe(text);
|
|
31
|
-
});
|
|
32
|
-
});
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { hasRichTextValue } from './hasRichTextValue';
|
|
4
|
-
|
|
5
|
-
export const convertToRteValue = (textStyle = 'p', text = '', align?: 'center' | 'right' | 'left' | 'justify') =>
|
|
6
|
-
hasRichTextValue(text) ? text : JSON.stringify([{ type: textStyle, children: [{ text, textStyle }], align }]);
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { beforeEach, describe, expect, it } from 'vitest';
|
|
4
|
-
import { KeyboardCode, KeyboardCoordinateGetter, SensorContext } from '@dnd-kit/core';
|
|
5
|
-
import { customCoordinatesGetterFactory } from './customCoordinatesGetterFactory';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @vitest-environment happy-dom
|
|
9
|
-
*/
|
|
10
|
-
describe('customCoordinatesGetterFactory', () => {
|
|
11
|
-
const initialCoordinates = { x: 0, y: 0 };
|
|
12
|
-
const context = {
|
|
13
|
-
activeNode: {
|
|
14
|
-
offsetWidth: 100,
|
|
15
|
-
offsetHeight: 200,
|
|
16
|
-
},
|
|
17
|
-
} as SensorContext;
|
|
18
|
-
|
|
19
|
-
const active = 'mock-active-id';
|
|
20
|
-
let customCoordinatesGetter: KeyboardCoordinateGetter;
|
|
21
|
-
beforeEach(() => {
|
|
22
|
-
customCoordinatesGetter = customCoordinatesGetterFactory(10, 20);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should respond to ArrowRight', () => {
|
|
26
|
-
const result = customCoordinatesGetter(new KeyboardEvent(KeyboardCode.Right, { code: KeyboardCode.Right }), {
|
|
27
|
-
active,
|
|
28
|
-
currentCoordinates: initialCoordinates,
|
|
29
|
-
context,
|
|
30
|
-
});
|
|
31
|
-
expect(result).toEqual({ x: 110, y: 0 });
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should respond to ArrowLeft', () => {
|
|
35
|
-
const result = customCoordinatesGetter(new KeyboardEvent(KeyboardCode.Left, { code: KeyboardCode.Left }), {
|
|
36
|
-
active,
|
|
37
|
-
currentCoordinates: initialCoordinates,
|
|
38
|
-
context,
|
|
39
|
-
});
|
|
40
|
-
expect(result).toEqual({ x: -110, y: 0 });
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should respond to ArrowDown', () => {
|
|
44
|
-
const result = customCoordinatesGetter(new KeyboardEvent(KeyboardCode.Down, { code: KeyboardCode.Down }), {
|
|
45
|
-
active,
|
|
46
|
-
currentCoordinates: initialCoordinates,
|
|
47
|
-
context,
|
|
48
|
-
});
|
|
49
|
-
expect(result).toEqual({ x: 0, y: 220 });
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should respond to ArrowUp', () => {
|
|
53
|
-
const result = customCoordinatesGetter(new KeyboardEvent(KeyboardCode.Up, { code: KeyboardCode.Up }), {
|
|
54
|
-
active,
|
|
55
|
-
currentCoordinates: initialCoordinates,
|
|
56
|
-
context,
|
|
57
|
-
});
|
|
58
|
-
expect(result).toEqual({ x: 0, y: -220 });
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should return undefined for other keys', () => {
|
|
62
|
-
const result = customCoordinatesGetter(new KeyboardEvent(KeyboardCode.Enter, { code: KeyboardCode.Enter }), {
|
|
63
|
-
active,
|
|
64
|
-
currentCoordinates: initialCoordinates,
|
|
65
|
-
context,
|
|
66
|
-
});
|
|
67
|
-
expect(result).toBeUndefined();
|
|
68
|
-
});
|
|
69
|
-
});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { KeyboardCode, KeyboardCoordinateGetter } from '@dnd-kit/core';
|
|
4
|
-
|
|
5
|
-
const directions: string[] = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
|
|
6
|
-
|
|
7
|
-
export const customCoordinatesGetterFactory =
|
|
8
|
-
(columnGap: number, rowGap: number): KeyboardCoordinateGetter =>
|
|
9
|
-
(event, { currentCoordinates, context: { activeNode } }) => {
|
|
10
|
-
event.preventDefault();
|
|
11
|
-
if (directions.includes(event.code)) {
|
|
12
|
-
const width = activeNode?.offsetWidth ?? 0;
|
|
13
|
-
const height = activeNode?.offsetHeight ?? 0;
|
|
14
|
-
|
|
15
|
-
switch (event.code) {
|
|
16
|
-
case KeyboardCode.Right:
|
|
17
|
-
return {
|
|
18
|
-
...currentCoordinates,
|
|
19
|
-
x: currentCoordinates.x + width + columnGap,
|
|
20
|
-
};
|
|
21
|
-
case KeyboardCode.Left:
|
|
22
|
-
return {
|
|
23
|
-
...currentCoordinates,
|
|
24
|
-
x: currentCoordinates.x - width - columnGap,
|
|
25
|
-
};
|
|
26
|
-
case KeyboardCode.Down:
|
|
27
|
-
return {
|
|
28
|
-
...currentCoordinates,
|
|
29
|
-
y: currentCoordinates.y + height + rowGap,
|
|
30
|
-
};
|
|
31
|
-
case KeyboardCode.Up:
|
|
32
|
-
return {
|
|
33
|
-
...currentCoordinates,
|
|
34
|
-
y: currentCoordinates.y - height - rowGap,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return undefined;
|
|
39
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { hasRichTextValue } from './hasRichTextValue';
|
|
5
|
-
|
|
6
|
-
describe('Richtext has value', () => {
|
|
7
|
-
// Check if richtext has value
|
|
8
|
-
it('should return true if Richtext has value', () => {
|
|
9
|
-
const text = '[{"type":"p","children":[{"text":"with text"}]}]';
|
|
10
|
-
const result = hasRichTextValue(text);
|
|
11
|
-
expect(result).toBeTruthy();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should return true if Richtext has value', () => {
|
|
15
|
-
const text =
|
|
16
|
-
'[{"type":"heading1","children":[{"text":"Hoi","bold":true,"underline":true}]},{"type":"heading1","children":[{"bold":true,"underline":true,"text":" "}]},{"type":"heading1","children":[{"text":"With Text"}]},{"type":"custom2","children":[{"text":""}]}]';
|
|
17
|
-
const result = hasRichTextValue(text);
|
|
18
|
-
expect(result).toBeTruthy();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should return true if value has a space it', () => {
|
|
22
|
-
const text = '[{"type":"p","children":[{"text":" "}]}]';
|
|
23
|
-
const result = hasRichTextValue(text);
|
|
24
|
-
expect(result).toBeTruthy();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// Check if richtext has no value
|
|
28
|
-
it('should return false if RTE is empty', () => {
|
|
29
|
-
const text = '[{"type":"p","children":[{"text":""}]}]';
|
|
30
|
-
const result = hasRichTextValue(text);
|
|
31
|
-
expect(result).toBeFalsy();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
it('should return false if RTE is empty 2.0', () => {
|
|
35
|
-
const text = '[{"type":"heading1","children":[{"text":"","bold":true,"underline":true}]}]';
|
|
36
|
-
const result = hasRichTextValue(text);
|
|
37
|
-
expect(result).toBeFalsy();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('should return false if value is an invalid json', () => {
|
|
41
|
-
const text = 'abcd';
|
|
42
|
-
const result = hasRichTextValue(text);
|
|
43
|
-
expect(result).toBeFalsy();
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('should return false if RTE has only new lines', () => {
|
|
47
|
-
const text =
|
|
48
|
-
'[{"type":"quote","children":[{"text":""}]},{"type":"quote","children":[{"text":""}]},{"type":"quote","children":[{"text":""}]},{"type":"quote","children":[{"text":""}]},{"type":"quote","children":[{"text":""}]}]';
|
|
49
|
-
const result = hasRichTextValue(text);
|
|
50
|
-
expect(result).toBeFalsy();
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it('should return false on empty value', () => {
|
|
54
|
-
const text = '';
|
|
55
|
-
const result = hasRichTextValue(text);
|
|
56
|
-
expect(result).toBeFalsy();
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('should return false on undefined text value', () => {
|
|
60
|
-
const result = hasRichTextValue(undefined);
|
|
61
|
-
expect(result).toBeFalsy();
|
|
62
|
-
});
|
|
63
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
type TextElement = {
|
|
4
|
-
text: string;
|
|
5
|
-
children?: TextElement[];
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const hasRichTextValue = (string?: string): boolean => {
|
|
9
|
-
if (!string) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
const hasText = (children: TextElement[]): boolean =>
|
|
13
|
-
children.some((child: TextElement) => {
|
|
14
|
-
if (child.text) {
|
|
15
|
-
return child.text !== '';
|
|
16
|
-
}
|
|
17
|
-
if (child.children) {
|
|
18
|
-
return hasText(child.children);
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
const json = JSON.parse(string);
|
|
25
|
-
return hasText(json);
|
|
26
|
-
} catch (error) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
};
|
package/src/helpers/index.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
export * from './convertToRichTextValue';
|
|
4
|
-
export * from './customCoordinatesGetterFactory';
|
|
5
|
-
export * from './hasRichTextValue';
|
|
6
|
-
export * from './isDownloadable';
|
|
7
|
-
export * from './mapColorPalettes';
|
|
8
|
-
export * from './addHttps';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { isDownloadable } from './isDownloadable';
|
|
5
|
-
import { Security } from '../settings/types';
|
|
6
|
-
|
|
7
|
-
describe('isDownloadable', () => {
|
|
8
|
-
it('should return false if global is false and downloadable is false', () => {
|
|
9
|
-
const result = isDownloadable(Security.Global, false, false);
|
|
10
|
-
expect(result).toBeFalsy();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should return true if global is true and downloadable is true', () => {
|
|
14
|
-
const result = isDownloadable(Security.Global, true, true);
|
|
15
|
-
expect(result).toBeTruthy();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('should return true if global is true and downloadable is false', () => {
|
|
19
|
-
const result = isDownloadable(Security.Global, false, true);
|
|
20
|
-
expect(result).toBeTruthy();
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('should return false if global is false and downloadable is true', () => {
|
|
24
|
-
const result = isDownloadable(Security.Global, true, false);
|
|
25
|
-
expect(result).toBeFalsy();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should return true if global is false but its security is custom and downloadable is true ', () => {
|
|
29
|
-
const result = isDownloadable(Security.Custom, true, false);
|
|
30
|
-
expect(result).toBeTruthy();
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
it('should return false if global is true but its security is custom and downloadable is false ', () => {
|
|
34
|
-
const result = isDownloadable(Security.Custom, false, true);
|
|
35
|
-
expect(result).toBeFalsy();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it('should return false if global is true but its security is custom and downloadable is false ', () => {
|
|
39
|
-
const result = isDownloadable(Security.Custom, false, false);
|
|
40
|
-
expect(result).toBeFalsy();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should return true if global is true but its security is custom and downloadable is false ', () => {
|
|
44
|
-
const result = isDownloadable(Security.Custom, true, true);
|
|
45
|
-
expect(result).toBeTruthy();
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { Security } from '../settings/types';
|
|
4
|
-
|
|
5
|
-
export const isDownloadable = (security: Security, downloadable: boolean, globalAssetDownloadEnabled: boolean) => {
|
|
6
|
-
return security === Security.Custom ? downloadable : globalAssetDownloadEnabled;
|
|
7
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { mapAppBridgeColorPalettesToFonduePalettes } from './mapColorPalettes';
|
|
5
|
-
import { ColorDummy } from '@frontify/app-bridge';
|
|
6
|
-
|
|
7
|
-
describe('mapAppBridgeColorPalettesToFonduePalettes', () => {
|
|
8
|
-
it('should map app bridge color palette to fondue palette', () => {
|
|
9
|
-
const result = mapAppBridgeColorPalettesToFonduePalettes([
|
|
10
|
-
{
|
|
11
|
-
id: 19,
|
|
12
|
-
name: 'Awesome color palette',
|
|
13
|
-
description: 'This is an awesome color palette',
|
|
14
|
-
colors: [ColorDummy.green(), ColorDummy.yellow(), ColorDummy.red()],
|
|
15
|
-
},
|
|
16
|
-
]);
|
|
17
|
-
expect(result).toEqual([
|
|
18
|
-
{
|
|
19
|
-
id: 19,
|
|
20
|
-
title: 'Awesome color palette',
|
|
21
|
-
colors: [
|
|
22
|
-
{
|
|
23
|
-
alpha: 1,
|
|
24
|
-
blue: 0,
|
|
25
|
-
green: 255,
|
|
26
|
-
red: 0,
|
|
27
|
-
name: 'Green',
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
alpha: 1,
|
|
31
|
-
blue: 0,
|
|
32
|
-
green: 255,
|
|
33
|
-
red: 255,
|
|
34
|
-
name: 'Yellow',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
alpha: 1,
|
|
38
|
-
blue: 0,
|
|
39
|
-
green: 0,
|
|
40
|
-
red: 255,
|
|
41
|
-
name: 'Red',
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
]);
|
|
46
|
-
});
|
|
47
|
-
});
|