@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,52 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { Color } from '@frontify/fondue';
|
|
4
|
-
import { BACKGROUND_COLOR_DEFAULT_VALUE } from './defaultValues';
|
|
5
|
-
import { SettingBlock } from '../';
|
|
6
|
-
|
|
7
|
-
type BackgroundSettingsType = {
|
|
8
|
-
id?: string;
|
|
9
|
-
defaultValue?: boolean;
|
|
10
|
-
defaultColor?: Color;
|
|
11
|
-
preventDefaultColor?: boolean;
|
|
12
|
-
switchLabel?: string;
|
|
13
|
-
label?: string;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Returns background settings: background switch, background color
|
|
18
|
-
*
|
|
19
|
-
* @param options Options for the settings
|
|
20
|
-
* @param options.id Custom suffix for the setting ids
|
|
21
|
-
* @param options.defaultValue Default value for the background switch
|
|
22
|
-
* @param options.defaultColor Default value for the background color
|
|
23
|
-
* @param options.preventDefaultColor Whether the background color should be empty by default
|
|
24
|
-
* @param options.label Label for the background input
|
|
25
|
-
* @param options.switchLabel Label for the background switch
|
|
26
|
-
* @returns {SettingBlock} Returns background settings
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
export const getBackgroundSettings = (options?: BackgroundSettingsType): SettingBlock => {
|
|
30
|
-
const hasId = options?.id ? `hasBackground${options.id}` : 'hasBackground';
|
|
31
|
-
const colorId = options?.id ? `backgroundColor${options.id}` : 'backgroundColor';
|
|
32
|
-
const defaultColor = !!options?.preventDefaultColor
|
|
33
|
-
? undefined
|
|
34
|
-
: options?.defaultColor || BACKGROUND_COLOR_DEFAULT_VALUE;
|
|
35
|
-
const label = options?.label ? options.label : 'Background';
|
|
36
|
-
const switchLabel = options?.switchLabel ? options.switchLabel : undefined;
|
|
37
|
-
|
|
38
|
-
return {
|
|
39
|
-
id: hasId,
|
|
40
|
-
label,
|
|
41
|
-
type: 'switch',
|
|
42
|
-
switchLabel,
|
|
43
|
-
defaultValue: !!options?.defaultValue,
|
|
44
|
-
on: [
|
|
45
|
-
{
|
|
46
|
-
id: colorId,
|
|
47
|
-
defaultValue: defaultColor,
|
|
48
|
-
type: 'colorInput',
|
|
49
|
-
},
|
|
50
|
-
],
|
|
51
|
-
};
|
|
52
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { getBorderSettings } from './border';
|
|
5
|
-
import { MultiInputBlock, MultiInputLayout } from '@frontify/sidebar-settings';
|
|
6
|
-
import { BorderStyle } from '../settings';
|
|
7
|
-
import { BORDER_COLOR_DEFAULT_VALUE } from '../settings/defaultValues';
|
|
8
|
-
import { SwitchBlock } from '../';
|
|
9
|
-
import { AppBridgeBlock } from '@frontify/app-bridge';
|
|
10
|
-
|
|
11
|
-
describe('getBorderSettings', () => {
|
|
12
|
-
it('should return border settings without arguments', () => {
|
|
13
|
-
const borderSettings = getBorderSettings() as SwitchBlock;
|
|
14
|
-
|
|
15
|
-
expect(borderSettings).toHaveProperty('id', 'hasBorder');
|
|
16
|
-
expect(borderSettings).toHaveProperty('label', 'Border');
|
|
17
|
-
expect(borderSettings).toHaveProperty('type', 'switch');
|
|
18
|
-
expect(borderSettings).toHaveProperty('defaultValue', false);
|
|
19
|
-
expect(borderSettings.on?.[0]).toHaveProperty('id', 'borderSelection');
|
|
20
|
-
expect(borderSettings.on?.[0]).toHaveProperty('type', 'multiInput');
|
|
21
|
-
expect(borderSettings.on?.[0]).toHaveProperty('lastItemFullWidth', true);
|
|
22
|
-
expect(borderSettings.on?.[0]).toHaveProperty('layout', MultiInputLayout.Columns);
|
|
23
|
-
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[0]).toEqual({
|
|
24
|
-
id: 'borderStyle',
|
|
25
|
-
type: 'dropdown',
|
|
26
|
-
defaultValue: BorderStyle.Solid,
|
|
27
|
-
choices: [
|
|
28
|
-
{
|
|
29
|
-
value: BorderStyle.Solid,
|
|
30
|
-
label: BorderStyle.Solid,
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: BorderStyle.Dotted,
|
|
34
|
-
label: BorderStyle.Dotted,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
value: BorderStyle.Dashed,
|
|
38
|
-
label: BorderStyle.Dashed,
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
});
|
|
42
|
-
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty(
|
|
43
|
-
'id',
|
|
44
|
-
'borderWidth',
|
|
45
|
-
);
|
|
46
|
-
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty('type', 'input');
|
|
47
|
-
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toEqual({
|
|
48
|
-
id: 'borderColor',
|
|
49
|
-
type: 'colorInput',
|
|
50
|
-
defaultValue: BORDER_COLOR_DEFAULT_VALUE,
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('should return border settings with custom id', () => {
|
|
55
|
-
expect(getBorderSettings({ id: 'Test' })).toHaveProperty('id', 'hasBorder_Test');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('should return border settings with custom color', () => {
|
|
59
|
-
const borderSettings = getBorderSettings({ defaultColor: { red: 255, green: 0, blue: 0 } }) as SwitchBlock;
|
|
60
|
-
expect((borderSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toEqual({
|
|
61
|
-
id: 'borderColor',
|
|
62
|
-
type: 'colorInput',
|
|
63
|
-
defaultValue: { red: 255, green: 0, blue: 0 },
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('should return border settings with custom default value', () => {
|
|
68
|
-
const borderSettings = getBorderSettings({ defaultValue: true }) as SwitchBlock;
|
|
69
|
-
expect(borderSettings).toHaveProperty('defaultValue', true);
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('should return border settings with custom switch label', () => {
|
|
73
|
-
const borderSettings = getBorderSettings({ switchLabel: 'mock' }) as SwitchBlock;
|
|
74
|
-
expect(borderSettings).toHaveProperty('switchLabel', 'mock');
|
|
75
|
-
});
|
|
76
|
-
});
|
package/src/settings/border.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
Color,
|
|
5
|
-
MultiInputLayout,
|
|
6
|
-
SettingBlock,
|
|
7
|
-
appendUnit,
|
|
8
|
-
maximumNumericalOrPixelOrAutoRule,
|
|
9
|
-
numericalOrPixelRule,
|
|
10
|
-
} from '../';
|
|
11
|
-
import { BORDER_COLOR_DEFAULT_VALUE, BORDER_WIDTH_DEFAULT_VALUE } from './defaultValues';
|
|
12
|
-
import { BorderStyle } from './types';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Returns border settings: border switch, border style, border width, border color
|
|
16
|
-
*
|
|
17
|
-
* @param options Options for the settings
|
|
18
|
-
* @param options.id Custom suffix for the setting ids
|
|
19
|
-
* @param options.switchLabel Label for the border switch
|
|
20
|
-
* @param options.defaultValue Default value for the border switch
|
|
21
|
-
* @returns {SettingBlock} Returns border settings
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
type BorderSettingsType = {
|
|
25
|
-
id?: string;
|
|
26
|
-
defaultValue?: boolean;
|
|
27
|
-
defaultColor?: Color;
|
|
28
|
-
switchLabel?: string;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export const getBorderSettings = (options?: BorderSettingsType): SettingBlock => {
|
|
32
|
-
const hasId = options?.id ? `hasBorder_${options.id}` : 'hasBorder';
|
|
33
|
-
const selectionId = options?.id ? `borderSelection_${options.id}` : 'borderSelection';
|
|
34
|
-
const styleId = options?.id ? `borderStyle_${options.id}` : 'borderStyle';
|
|
35
|
-
const widthId = options?.id ? `borderWidth_${options.id}` : 'borderWidth';
|
|
36
|
-
const colorId = options?.id ? `borderColor_${options.id}` : 'borderColor';
|
|
37
|
-
const defaultColor = options?.defaultColor || BORDER_COLOR_DEFAULT_VALUE;
|
|
38
|
-
const switchLabel = options?.switchLabel ? options.switchLabel : undefined;
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
id: hasId,
|
|
42
|
-
label: 'Border',
|
|
43
|
-
type: 'switch',
|
|
44
|
-
switchLabel,
|
|
45
|
-
defaultValue: !!options?.defaultValue,
|
|
46
|
-
on: [
|
|
47
|
-
{
|
|
48
|
-
id: selectionId,
|
|
49
|
-
type: 'multiInput',
|
|
50
|
-
onChange: (bundle) => appendUnit(bundle, widthId),
|
|
51
|
-
layout: MultiInputLayout.Columns,
|
|
52
|
-
lastItemFullWidth: true,
|
|
53
|
-
blocks: [
|
|
54
|
-
{
|
|
55
|
-
id: styleId,
|
|
56
|
-
type: 'dropdown',
|
|
57
|
-
defaultValue: BorderStyle.Solid,
|
|
58
|
-
choices: [
|
|
59
|
-
{
|
|
60
|
-
value: BorderStyle.Solid,
|
|
61
|
-
label: BorderStyle.Solid,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
value: BorderStyle.Dotted,
|
|
65
|
-
label: BorderStyle.Dotted,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
value: BorderStyle.Dashed,
|
|
69
|
-
label: BorderStyle.Dashed,
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: widthId,
|
|
75
|
-
type: 'input',
|
|
76
|
-
defaultValue: BORDER_WIDTH_DEFAULT_VALUE,
|
|
77
|
-
rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],
|
|
78
|
-
placeholder: 'e.g. 3px',
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
id: colorId,
|
|
82
|
-
type: 'colorInput',
|
|
83
|
-
defaultValue: defaultColor,
|
|
84
|
-
},
|
|
85
|
-
],
|
|
86
|
-
},
|
|
87
|
-
],
|
|
88
|
-
off: [],
|
|
89
|
-
};
|
|
90
|
-
};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { Radius, getBorderRadiusSettings } from '.';
|
|
5
|
-
import { SwitchBlock } from '..';
|
|
6
|
-
|
|
7
|
-
describe('getBorderRadiusSettings', () => {
|
|
8
|
-
it('should return border radius settings without arguments', () => {
|
|
9
|
-
const borderRadiusSettings = getBorderRadiusSettings() as SwitchBlock;
|
|
10
|
-
|
|
11
|
-
expect(borderRadiusSettings).toHaveProperty('id', 'hasRadius');
|
|
12
|
-
expect(borderRadiusSettings).toHaveProperty('label', 'Corner radius');
|
|
13
|
-
expect(borderRadiusSettings).toHaveProperty('type', 'switch');
|
|
14
|
-
expect(borderRadiusSettings).toHaveProperty('defaultValue', false);
|
|
15
|
-
expect(borderRadiusSettings.on?.[0]).toHaveProperty('id', 'radiusValue');
|
|
16
|
-
expect(borderRadiusSettings.on?.[0]).toHaveProperty('type', 'input');
|
|
17
|
-
expect(borderRadiusSettings.off?.[0]).toHaveProperty('id', 'radiusChoice');
|
|
18
|
-
expect(borderRadiusSettings.off?.[0]).toHaveProperty('type', 'segmentedControls');
|
|
19
|
-
expect(borderRadiusSettings.off?.[0]).toHaveProperty('defaultValue', Radius.None);
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should return border radius settings with custom id', () => {
|
|
23
|
-
expect(getBorderRadiusSettings({ id: 'Test' })).toHaveProperty('id', 'hasRadius_Test');
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it('should return border settings with custom default radius', () => {
|
|
27
|
-
const borderRadiusSettings = getBorderRadiusSettings({ defaultRadius: Radius.Large }) as SwitchBlock;
|
|
28
|
-
expect(borderRadiusSettings.off?.[0]).toHaveProperty('defaultValue', Radius.Large);
|
|
29
|
-
});
|
|
30
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';
|
|
4
|
-
|
|
5
|
-
import { Radius, radiusStyleMap } from './types';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns border radius settings: border radius switch, radius slider, custom radius input
|
|
9
|
-
*
|
|
10
|
-
* @param options Options for the settings
|
|
11
|
-
* @param options.id Custom suffix for the setting ids
|
|
12
|
-
* @param options.dependentSettingId Id of setting which the border radius is dependent on
|
|
13
|
-
* @returns {SettingBlock} Returns border settings
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
type BorderRadiusSettingsType = {
|
|
17
|
-
id?: string;
|
|
18
|
-
dependentSettingId?: string;
|
|
19
|
-
radiusStyleMap?: Record<Radius, string>;
|
|
20
|
-
defaultRadius?: Radius;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const getBorderRadiusSlider = (id: string, defaultValue: Radius = Radius.None): SettingBlock => ({
|
|
24
|
-
id,
|
|
25
|
-
type: 'segmentedControls',
|
|
26
|
-
defaultValue,
|
|
27
|
-
choices: [
|
|
28
|
-
{
|
|
29
|
-
value: Radius.None,
|
|
30
|
-
label: 'None',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: Radius.Small,
|
|
34
|
-
label: 'S',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
value: Radius.Medium,
|
|
38
|
-
label: 'M',
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
value: Radius.Large,
|
|
42
|
-
label: 'L',
|
|
43
|
-
},
|
|
44
|
-
],
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export const getBorderRadiusSettings = (options?: BorderRadiusSettingsType): SettingBlock => {
|
|
48
|
-
const hasId = options?.id ? `hasRadius_${options.id}` : 'hasRadius';
|
|
49
|
-
const valueId = options?.id ? `radiusValue_${options.id}` : 'radiusValue';
|
|
50
|
-
const choiceId = options?.id ? `radiusChoice_${options.id}` : 'radiusChoice';
|
|
51
|
-
const defaultValue = options?.defaultRadius || Radius.None;
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
id: hasId,
|
|
55
|
-
label: 'Corner radius',
|
|
56
|
-
type: 'switch',
|
|
57
|
-
switchLabel: 'Custom',
|
|
58
|
-
defaultValue: false,
|
|
59
|
-
info: 'Determining how rounded the corners are.',
|
|
60
|
-
show: (bundle) => (options?.dependentSettingId ? !!bundle.getBlock(options.dependentSettingId)?.value : true),
|
|
61
|
-
onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.radiusStyleMap || radiusStyleMap),
|
|
62
|
-
on: [
|
|
63
|
-
{
|
|
64
|
-
id: valueId,
|
|
65
|
-
type: 'input',
|
|
66
|
-
placeholder: 'e.g. 10px',
|
|
67
|
-
rules: [numericalOrPixelRule],
|
|
68
|
-
onChange: (bundle) => appendUnit(bundle, valueId),
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
off: [getBorderRadiusSlider(choiceId, defaultValue)],
|
|
72
|
-
};
|
|
73
|
-
};
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { MultiInputBlock, MultiInputLayout } from '@frontify/sidebar-settings';
|
|
5
|
-
import { Radius, getExtendedBorderRadiusSettings } from '.';
|
|
6
|
-
import { SwitchBlock } from '..';
|
|
7
|
-
import { AppBridgeBlock } from '@frontify/app-bridge';
|
|
8
|
-
|
|
9
|
-
describe('getBorderRadiusExtendedSettings', () => {
|
|
10
|
-
it('should return extended border radius settings without arguments', () => {
|
|
11
|
-
const extendedBorderRadiusSettings = getExtendedBorderRadiusSettings() as SwitchBlock;
|
|
12
|
-
|
|
13
|
-
expect(extendedBorderRadiusSettings).toHaveProperty('id', 'hasExtendedCustomRadius');
|
|
14
|
-
expect(extendedBorderRadiusSettings).toHaveProperty('label', 'Corner radius');
|
|
15
|
-
expect(extendedBorderRadiusSettings).toHaveProperty('type', 'switch');
|
|
16
|
-
expect(extendedBorderRadiusSettings).toHaveProperty('defaultValue', false);
|
|
17
|
-
expect(extendedBorderRadiusSettings.on?.[0]).toHaveProperty('id', 'extendedRadiusValue');
|
|
18
|
-
expect(extendedBorderRadiusSettings.on?.[0]).toHaveProperty('type', 'multiInput');
|
|
19
|
-
expect(extendedBorderRadiusSettings.on?.[0]).toHaveProperty('layout', MultiInputLayout.Columns);
|
|
20
|
-
|
|
21
|
-
expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[0]).toHaveProperty(
|
|
22
|
-
'id',
|
|
23
|
-
'extendedRadiusTopLeft',
|
|
24
|
-
);
|
|
25
|
-
expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[1]).toHaveProperty(
|
|
26
|
-
'id',
|
|
27
|
-
'extendedRadiusTopRight',
|
|
28
|
-
);
|
|
29
|
-
expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[2]).toHaveProperty(
|
|
30
|
-
'id',
|
|
31
|
-
'extendedRadiusBottomLeft',
|
|
32
|
-
);
|
|
33
|
-
expect((extendedBorderRadiusSettings.on?.[0] as MultiInputBlock<AppBridgeBlock>).blocks[3]).toHaveProperty(
|
|
34
|
-
'id',
|
|
35
|
-
'extendedRadiusBottomRight',
|
|
36
|
-
);
|
|
37
|
-
expect(extendedBorderRadiusSettings.off?.[0]).toHaveProperty('id', 'extendedRadiusChoice');
|
|
38
|
-
expect(extendedBorderRadiusSettings.off?.[0]).toHaveProperty('type', 'segmentedControls');
|
|
39
|
-
expect(extendedBorderRadiusSettings.off?.[0]).toHaveProperty('defaultValue', Radius.None);
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it('should return extended border radius settings with id', () => {
|
|
43
|
-
expect(getExtendedBorderRadiusSettings({ id: 'Test' })).toHaveProperty('id', 'hasExtendedCustomRadius_Test');
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
it('should return extended border settings with custom default value', () => {
|
|
47
|
-
const extendedBorderRadiusSettings = getExtendedBorderRadiusSettings({
|
|
48
|
-
defaultValue: Radius.Large,
|
|
49
|
-
}) as SwitchBlock;
|
|
50
|
-
expect(extendedBorderRadiusSettings.off?.[0]).toHaveProperty('defaultValue', Radius.Large);
|
|
51
|
-
});
|
|
52
|
-
});
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { MultiInputLayout, SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';
|
|
4
|
-
import { getBorderRadiusSlider } from './borderRadius';
|
|
5
|
-
import { Radius, radiusStyleMap } from './types';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Returns border radius settings: border radius switch, radius slider, custom radius inputs for every corner
|
|
9
|
-
*
|
|
10
|
-
* @param options Options for the settings
|
|
11
|
-
* @param options.id Custom suffix for the setting ids
|
|
12
|
-
* @param options.dependentSettingId Id of setting which the border radius is dependent on
|
|
13
|
-
* @returns {SettingBlock} Returns border settings
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
type BorderRadiusSettingsType = {
|
|
17
|
-
id?: string;
|
|
18
|
-
dependentSettingId?: string;
|
|
19
|
-
defaultValue?: Radius;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const getExtendedBorderRadiusSettings = (options?: BorderRadiusSettingsType): SettingBlock => {
|
|
23
|
-
const hasId = options?.id ? `hasExtendedCustomRadius_${options.id}` : 'hasExtendedCustomRadius';
|
|
24
|
-
const valueId = options?.id ? `extendedRadiusValue_${options.id}` : 'extendedRadiusValue';
|
|
25
|
-
const choiceId = options?.id ? `extendedRadiusChoice_${options.id}` : 'extendedRadiusChoice';
|
|
26
|
-
const topLeftId = options?.id ? `extendedRadiusTopLeft_${options.id}` : 'extendedRadiusTopLeft';
|
|
27
|
-
const topRightId = options?.id ? `extendedRadiusTopRight_${options.id}` : 'extendedRadiusTopRight';
|
|
28
|
-
const bottomLeftId = options?.id ? `extendedRadiusBottomLeft_${options.id}` : 'extendedRadiusBottomLeft';
|
|
29
|
-
const bottomRightId = options?.id ? `extendedRadiusBottomRight_${options.id}` : 'extendedRadiusBottomRight';
|
|
30
|
-
|
|
31
|
-
return {
|
|
32
|
-
id: hasId,
|
|
33
|
-
label: 'Corner radius',
|
|
34
|
-
type: 'switch',
|
|
35
|
-
switchLabel: 'Custom',
|
|
36
|
-
defaultValue: false,
|
|
37
|
-
info: 'Determining how rounded the corners are.',
|
|
38
|
-
show: (bundle) => (options?.dependentSettingId ? !!bundle.getBlock(options.dependentSettingId)?.value : true),
|
|
39
|
-
onChange: (bundle) => {
|
|
40
|
-
presetCustomValue(bundle, choiceId, topLeftId, radiusStyleMap);
|
|
41
|
-
presetCustomValue(bundle, choiceId, topRightId, radiusStyleMap);
|
|
42
|
-
presetCustomValue(bundle, choiceId, bottomLeftId, radiusStyleMap);
|
|
43
|
-
presetCustomValue(bundle, choiceId, bottomRightId, radiusStyleMap);
|
|
44
|
-
},
|
|
45
|
-
on: [
|
|
46
|
-
{
|
|
47
|
-
id: valueId,
|
|
48
|
-
type: 'multiInput',
|
|
49
|
-
layout: MultiInputLayout.Columns,
|
|
50
|
-
blocks: [
|
|
51
|
-
{
|
|
52
|
-
id: topLeftId,
|
|
53
|
-
type: 'input',
|
|
54
|
-
label: 'Top Left',
|
|
55
|
-
rules: [numericalOrPixelRule],
|
|
56
|
-
onChange: (bundle) => appendUnit(bundle, topLeftId),
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
id: topRightId,
|
|
60
|
-
type: 'input',
|
|
61
|
-
label: 'Top Right',
|
|
62
|
-
rules: [numericalOrPixelRule],
|
|
63
|
-
onChange: (bundle) => appendUnit(bundle, topRightId),
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: bottomLeftId,
|
|
67
|
-
type: 'input',
|
|
68
|
-
label: 'Bottom Left',
|
|
69
|
-
rules: [numericalOrPixelRule],
|
|
70
|
-
onChange: (bundle) => appendUnit(bundle, bottomLeftId),
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
id: bottomRightId,
|
|
74
|
-
type: 'input',
|
|
75
|
-
label: 'Bottom Right',
|
|
76
|
-
rules: [numericalOrPixelRule],
|
|
77
|
-
onChange: (bundle) => appendUnit(bundle, bottomRightId),
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
off: [getBorderRadiusSlider(choiceId, options?.defaultValue)],
|
|
83
|
-
};
|
|
84
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
export const BACKGROUND_COLOR_DEFAULT_VALUE = {
|
|
4
|
-
red: 241,
|
|
5
|
-
green: 241,
|
|
6
|
-
blue: 241,
|
|
7
|
-
alpha: 1,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const BORDER_COLOR_DEFAULT_VALUE = {
|
|
11
|
-
red: 234,
|
|
12
|
-
green: 235,
|
|
13
|
-
blue: 235,
|
|
14
|
-
alpha: 1,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const BORDER_WIDTH_DEFAULT_VALUE = '1px';
|
|
18
|
-
|
|
19
|
-
export const PADDING_DEFAULT_PLACEHOLDER = '24px';
|
|
20
|
-
|
|
21
|
-
export const MARGIN_DEFAULT_PLACEHOLDER = '24px';
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { GutterSpacing, getGutterSettings } from '.';
|
|
5
|
-
import { SwitchBlock } from '..';
|
|
6
|
-
|
|
7
|
-
describe('getGutterSettings', () => {
|
|
8
|
-
it('should return gutter settings without arguments', () => {
|
|
9
|
-
const gutterSettings = getGutterSettings() as SwitchBlock;
|
|
10
|
-
|
|
11
|
-
expect(gutterSettings).toHaveProperty('id', 'hasCustomSpacing');
|
|
12
|
-
expect(gutterSettings).toHaveProperty('label', 'Gutter');
|
|
13
|
-
expect(gutterSettings).toHaveProperty('type', 'switch');
|
|
14
|
-
expect(gutterSettings).toHaveProperty('defaultValue', false);
|
|
15
|
-
expect(gutterSettings.on?.[0]).toHaveProperty('id', 'spacingCustom');
|
|
16
|
-
expect(gutterSettings.on?.[0]).toHaveProperty('type', 'input');
|
|
17
|
-
expect(gutterSettings.off?.[0]).toHaveProperty('id', 'spacingChoice');
|
|
18
|
-
expect(gutterSettings.off?.[0]).toHaveProperty('type', 'slider');
|
|
19
|
-
expect(gutterSettings.off?.[0]).toHaveProperty('choices', [
|
|
20
|
-
{
|
|
21
|
-
value: GutterSpacing.Auto,
|
|
22
|
-
label: 'Auto',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
value: GutterSpacing.S,
|
|
26
|
-
label: 'S',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: GutterSpacing.M,
|
|
30
|
-
label: 'M',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: GutterSpacing.L,
|
|
34
|
-
label: 'L',
|
|
35
|
-
},
|
|
36
|
-
]);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should return gutter settings with id', () => {
|
|
40
|
-
expect(getGutterSettings({ id: 'Test' })).toHaveProperty('id', 'Test');
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should return gutter settings with custom spacing choice id', () => {
|
|
44
|
-
const gutterSettings = getGutterSettings({ spacingChoiceId: 'Choice_ID' }) as SwitchBlock;
|
|
45
|
-
|
|
46
|
-
expect(gutterSettings.off?.[0]).toHaveProperty('id', 'Choice_ID');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('should return gutter settings with custom spacing custom id', () => {
|
|
50
|
-
const gutterSettings = getGutterSettings({ spacingCustomId: 'Custom_ID' }) as SwitchBlock;
|
|
51
|
-
|
|
52
|
-
expect(gutterSettings.on?.[0]).toHaveProperty('id', 'Custom_ID');
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should return gutter settings with custom spacing custom id', () => {
|
|
56
|
-
const gutterSettings = getGutterSettings({ defaultValueChoices: GutterSpacing.L }) as SwitchBlock;
|
|
57
|
-
|
|
58
|
-
expect(gutterSettings.off?.[0]).toHaveProperty('defaultValue', GutterSpacing.L);
|
|
59
|
-
});
|
|
60
|
-
});
|
package/src/settings/gutter.ts
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';
|
|
4
|
-
import { GutterSpacing, gutterSpacingStyleMap } from './types';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Returns gutter settings: gutter switch, gutter choices or gutter custom input
|
|
8
|
-
*
|
|
9
|
-
* @param options Options for the settings
|
|
10
|
-
* @param options.id Custom id for the gutters switch
|
|
11
|
-
* @param options.dependentSettingId Id of the dependent setting
|
|
12
|
-
* @param options.spacingChoiceId Id of the spacing choice
|
|
13
|
-
* @param options.defaultValueChoices Default value for the spacing choice
|
|
14
|
-
* @returns {SettingBlock} Returns the gutter settings
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
type GutterSettingsType = {
|
|
18
|
-
id?: string;
|
|
19
|
-
dependentSettingId?: string;
|
|
20
|
-
spacingChoiceId?: string;
|
|
21
|
-
spacingCustomId?: string;
|
|
22
|
-
defaultValueChoices?: GutterSpacing;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const getGutterSettings = (options?: GutterSettingsType): SettingBlock => {
|
|
26
|
-
const id = options?.id ? options.id : 'hasCustomSpacing';
|
|
27
|
-
const dependentSettingId = options?.dependentSettingId ? options.dependentSettingId : 'columns';
|
|
28
|
-
const spacingChoiceId = options?.spacingChoiceId ? options.spacingChoiceId : 'spacingChoice';
|
|
29
|
-
const spacingCustomId = options?.spacingCustomId ? options.spacingCustomId : 'spacingCustom';
|
|
30
|
-
const defaultValueChoices = options?.defaultValueChoices ? options.defaultValueChoices : GutterSpacing.M;
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
id,
|
|
34
|
-
type: 'switch',
|
|
35
|
-
defaultValue: false,
|
|
36
|
-
switchLabel: 'Custom',
|
|
37
|
-
label: 'Gutter',
|
|
38
|
-
info: 'An official nerds term for ‘gap’',
|
|
39
|
-
onChange: (bundle) => presetCustomValue(bundle, spacingChoiceId, spacingCustomId, gutterSpacingStyleMap),
|
|
40
|
-
show: (bundle) => bundle.getBlock(dependentSettingId)?.value !== '1',
|
|
41
|
-
on: [
|
|
42
|
-
{
|
|
43
|
-
id: spacingCustomId,
|
|
44
|
-
type: 'input',
|
|
45
|
-
rules: [numericalOrPixelRule],
|
|
46
|
-
onChange: (bundle) => appendUnit(bundle, spacingCustomId),
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
off: [
|
|
50
|
-
{
|
|
51
|
-
id: spacingChoiceId,
|
|
52
|
-
type: 'slider',
|
|
53
|
-
defaultValue: defaultValueChoices,
|
|
54
|
-
choices: [
|
|
55
|
-
{
|
|
56
|
-
value: GutterSpacing.Auto,
|
|
57
|
-
label: 'Auto',
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
value: GutterSpacing.S,
|
|
61
|
-
label: 'S',
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
value: GutterSpacing.M,
|
|
65
|
-
label: 'M',
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
value: GutterSpacing.L,
|
|
69
|
-
label: 'L',
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
};
|
|
75
|
-
};
|
package/src/settings/index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
export * from './background';
|
|
4
|
-
export * from './border';
|
|
5
|
-
export * from './borderRadius';
|
|
6
|
-
export * from './borderRadiusExtended';
|
|
7
|
-
export * from './gutter';
|
|
8
|
-
export * from './margin';
|
|
9
|
-
export * from './marginExtended';
|
|
10
|
-
export * from './padding';
|
|
11
|
-
export * from './paddingExtended';
|
|
12
|
-
export * from './types';
|
|
13
|
-
export * from './securityDownloadable';
|
|
14
|
-
export * from './securityGlobalControl';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { describe, expect, it } from 'vitest';
|
|
4
|
-
import { Margin, getMarginSettings } from '.';
|
|
5
|
-
import { SwitchBlock } from '..';
|
|
6
|
-
|
|
7
|
-
describe('getMarginSettings', () => {
|
|
8
|
-
it('should return margin settings without arguments', () => {
|
|
9
|
-
const marginSettings = getMarginSettings() as SwitchBlock;
|
|
10
|
-
|
|
11
|
-
expect(marginSettings).toHaveProperty('id', 'hasCustomMarginValue');
|
|
12
|
-
expect(marginSettings).toHaveProperty('label', 'Margin');
|
|
13
|
-
expect(marginSettings).toHaveProperty('type', 'switch');
|
|
14
|
-
expect(marginSettings).toHaveProperty('defaultValue', false);
|
|
15
|
-
expect(marginSettings.on?.[0]).toHaveProperty('id', 'marginValue');
|
|
16
|
-
expect(marginSettings.on?.[0]).toHaveProperty('type', 'input');
|
|
17
|
-
expect(marginSettings.off?.[0]).toHaveProperty('id', 'marginChoice');
|
|
18
|
-
expect(marginSettings.off?.[0]).toHaveProperty('type', 'segmentedControls');
|
|
19
|
-
expect(marginSettings.off?.[0]).toHaveProperty('choices', [
|
|
20
|
-
{
|
|
21
|
-
value: Margin.None,
|
|
22
|
-
label: 'None',
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
value: Margin.Small,
|
|
26
|
-
label: 'S',
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
value: Margin.Medium,
|
|
30
|
-
label: 'M',
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
value: Margin.Large,
|
|
34
|
-
label: 'L',
|
|
35
|
-
},
|
|
36
|
-
]);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it('should return margin settings with id', () => {
|
|
40
|
-
expect(getMarginSettings({ id: 'Test' })).toHaveProperty('id', 'hasCustomMarginValue_Test');
|
|
41
|
-
});
|
|
42
|
-
});
|