@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
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BACKGROUND_COLOR_DEFAULT_VALUE as u } from "./defaultValues.es.js";
|
|
2
|
+
const g = (l) => {
|
|
3
|
+
const a = l != null && l.id ? `hasBackground${l.id}` : "hasBackground", e = l != null && l.id ? `backgroundColor${l.id}` : "backgroundColor", d = l != null && l.preventDefaultColor ? void 0 : (l == null ? void 0 : l.defaultColor) || u, r = l != null && l.label ? l.label : "Background", c = l != null && l.switchLabel ? l.switchLabel : void 0;
|
|
4
|
+
return {
|
|
5
|
+
id: a,
|
|
6
|
+
label: r,
|
|
7
|
+
type: "switch",
|
|
8
|
+
switchLabel: c,
|
|
9
|
+
defaultValue: !!(l != null && l.defaultValue),
|
|
10
|
+
on: [
|
|
11
|
+
{
|
|
12
|
+
id: e,
|
|
13
|
+
defaultValue: d,
|
|
14
|
+
type: "colorInput"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
g as getBackgroundSettings
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=background.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"background.es.js","sources":["../../src/settings/background.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { Color } from '@frontify/fondue';\nimport { BACKGROUND_COLOR_DEFAULT_VALUE } from './defaultValues';\nimport { SettingBlock } from '../';\n\ntype BackgroundSettingsType = {\n id?: string;\n defaultValue?: boolean;\n defaultColor?: Color;\n preventDefaultColor?: boolean;\n switchLabel?: string;\n label?: string;\n};\n\n/**\n * Returns background settings: background switch, background color\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.defaultValue Default value for the background switch\n * @param options.defaultColor Default value for the background color\n * @param options.preventDefaultColor Whether the background color should be empty by default\n * @param options.label Label for the background input\n * @param options.switchLabel Label for the background switch\n * @returns {SettingBlock} Returns background settings\n */\n\nexport const getBackgroundSettings = (options?: BackgroundSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasBackground${options.id}` : 'hasBackground';\n const colorId = options?.id ? `backgroundColor${options.id}` : 'backgroundColor';\n const defaultColor = !!options?.preventDefaultColor\n ? undefined\n : options?.defaultColor || BACKGROUND_COLOR_DEFAULT_VALUE;\n const label = options?.label ? options.label : 'Background';\n const switchLabel = options?.switchLabel ? options.switchLabel : undefined;\n\n return {\n id: hasId,\n label,\n type: 'switch',\n switchLabel,\n defaultValue: !!options?.defaultValue,\n on: [\n {\n id: colorId,\n defaultValue: defaultColor,\n type: 'colorInput',\n },\n ],\n };\n};\n"],"names":["getBackgroundSettings","options","hasId","colorId","defaultColor","BACKGROUND_COLOR_DEFAULT_VALUE","label","switchLabel"],"mappings":";AA4Ba,MAAAA,IAAwB,CAACC,MAAmD;AACrF,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,gBAAgBA,EAAQ,EAAE,KAAK,iBACrDE,IAAUF,KAAA,QAAAA,EAAS,KAAK,kBAAkBA,EAAQ,EAAE,KAAK,mBACzDG,IAAiBH,KAAA,QAAAA,EAAS,sBAC1B,UACAA,KAAA,gBAAAA,EAAS,iBAAgBI,GACzBC,IAAQL,KAAA,QAAAA,EAAS,QAAQA,EAAQ,QAAQ,cACzCM,IAAcN,KAAA,QAAAA,EAAS,cAAcA,EAAQ,cAAc;AAE1D,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAAI;AAAA,IACA,MAAM;AAAA,IACN,aAAAC;AAAA,IACA,cAAc,CAAC,EAACN,KAAA,QAAAA,EAAS;AAAA,IACzB,IAAI;AAAA,MACA;AAAA,QACI,IAAIE;AAAA,QACJ,cAAcC;AAAA,QACd,MAAM;AAAA,MACV;AAAA,IACJ;AAAA,EAAA;AAER;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { appendUnit as m, MultiInputLayout as f, numericalOrPixelRule as y, maximumNumericalOrPixelOrAutoRule as _ } from "@frontify/sidebar-settings";
|
|
3
|
+
import { BORDER_COLOR_DEFAULT_VALUE as I, BORDER_WIDTH_DEFAULT_VALUE as D } from "./defaultValues.es.js";
|
|
4
|
+
import { BorderStyle as l } from "./types.es.js";
|
|
5
|
+
const O = (e) => {
|
|
6
|
+
const r = e != null && e.id ? `hasBorder_${e.id}` : "hasBorder", a = e != null && e.id ? `borderSelection_${e.id}` : "borderSelection", u = e != null && e.id ? `borderStyle_${e.id}` : "borderStyle", d = e != null && e.id ? `borderWidth_${e.id}` : "borderWidth", c = e != null && e.id ? `borderColor_${e.id}` : "borderColor", b = (e == null ? void 0 : e.defaultColor) || I, h = e != null && e.switchLabel ? e.switchLabel : void 0;
|
|
7
|
+
return {
|
|
8
|
+
id: r,
|
|
9
|
+
label: "Border",
|
|
10
|
+
type: "switch",
|
|
11
|
+
switchLabel: h,
|
|
12
|
+
defaultValue: !!(e != null && e.defaultValue),
|
|
13
|
+
on: [
|
|
14
|
+
{
|
|
15
|
+
id: a,
|
|
16
|
+
type: "multiInput",
|
|
17
|
+
onChange: (t) => m(t, d),
|
|
18
|
+
layout: f.Columns,
|
|
19
|
+
lastItemFullWidth: !0,
|
|
20
|
+
blocks: [
|
|
21
|
+
{
|
|
22
|
+
id: u,
|
|
23
|
+
type: "dropdown",
|
|
24
|
+
defaultValue: l.Solid,
|
|
25
|
+
choices: [
|
|
26
|
+
{
|
|
27
|
+
value: l.Solid,
|
|
28
|
+
label: l.Solid
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: l.Dotted,
|
|
32
|
+
label: l.Dotted
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
value: l.Dashed,
|
|
36
|
+
label: l.Dashed
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: d,
|
|
42
|
+
type: "input",
|
|
43
|
+
defaultValue: D,
|
|
44
|
+
rules: [y, _(500)],
|
|
45
|
+
placeholder: "e.g. 3px"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: c,
|
|
49
|
+
type: "colorInput",
|
|
50
|
+
defaultValue: b
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
off: []
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
O as getBorderSettings
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=border.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"border.es.js","sources":["../../src/settings/border.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n Color,\n MultiInputLayout,\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n} from '../';\nimport { BORDER_COLOR_DEFAULT_VALUE, BORDER_WIDTH_DEFAULT_VALUE } from './defaultValues';\nimport { BorderStyle } from './types';\n\n/**\n * Returns border settings: border switch, border style, border width, border color\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.switchLabel Label for the border switch\n * @param options.defaultValue Default value for the border switch\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderSettingsType = {\n id?: string;\n defaultValue?: boolean;\n defaultColor?: Color;\n switchLabel?: string;\n};\n\nexport const getBorderSettings = (options?: BorderSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasBorder_${options.id}` : 'hasBorder';\n const selectionId = options?.id ? `borderSelection_${options.id}` : 'borderSelection';\n const styleId = options?.id ? `borderStyle_${options.id}` : 'borderStyle';\n const widthId = options?.id ? `borderWidth_${options.id}` : 'borderWidth';\n const colorId = options?.id ? `borderColor_${options.id}` : 'borderColor';\n const defaultColor = options?.defaultColor || BORDER_COLOR_DEFAULT_VALUE;\n const switchLabel = options?.switchLabel ? options.switchLabel : undefined;\n\n return {\n id: hasId,\n label: 'Border',\n type: 'switch',\n switchLabel,\n defaultValue: !!options?.defaultValue,\n on: [\n {\n id: selectionId,\n type: 'multiInput',\n onChange: (bundle) => appendUnit(bundle, widthId),\n layout: MultiInputLayout.Columns,\n lastItemFullWidth: true,\n blocks: [\n {\n id: styleId,\n type: 'dropdown',\n defaultValue: BorderStyle.Solid,\n choices: [\n {\n value: BorderStyle.Solid,\n label: BorderStyle.Solid,\n },\n {\n value: BorderStyle.Dotted,\n label: BorderStyle.Dotted,\n },\n {\n value: BorderStyle.Dashed,\n label: BorderStyle.Dashed,\n },\n ],\n },\n {\n id: widthId,\n type: 'input',\n defaultValue: BORDER_WIDTH_DEFAULT_VALUE,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n placeholder: 'e.g. 3px',\n },\n {\n id: colorId,\n type: 'colorInput',\n defaultValue: defaultColor,\n },\n ],\n },\n ],\n off: [],\n };\n};\n"],"names":["getBorderSettings","options","hasId","selectionId","styleId","widthId","colorId","defaultColor","BORDER_COLOR_DEFAULT_VALUE","switchLabel","bundle","appendUnit","MultiInputLayout","BorderStyle","BORDER_WIDTH_DEFAULT_VALUE","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule"],"mappings":";;;;AA8Ba,MAAAA,IAAoB,CAACC,MAA+C;AAC7E,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,aAAaA,EAAQ,EAAE,KAAK,aAClDE,IAAcF,KAAA,QAAAA,EAAS,KAAK,mBAAmBA,EAAQ,EAAE,KAAK,mBAC9DG,IAAUH,KAAA,QAAAA,EAAS,KAAK,eAAeA,EAAQ,EAAE,KAAK,eACtDI,IAAUJ,KAAA,QAAAA,EAAS,KAAK,eAAeA,EAAQ,EAAE,KAAK,eACtDK,IAAUL,KAAA,QAAAA,EAAS,KAAK,eAAeA,EAAQ,EAAE,KAAK,eACtDM,KAAeN,KAAA,gBAAAA,EAAS,iBAAgBO,GACxCC,IAAcR,KAAA,QAAAA,EAAS,cAAcA,EAAQ,cAAc;AAE1D,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAAO;AAAA,IACA,cAAc,CAAC,EAACR,KAAA,QAAAA,EAAS;AAAA,IACzB,IAAI;AAAA,MACA;AAAA,QACI,IAAIE;AAAA,QACJ,MAAM;AAAA,QACN,UAAU,CAACO,MAAWC,EAAWD,GAAQL,CAAO;AAAA,QAChD,QAAQO,EAAiB;AAAA,QACzB,mBAAmB;AAAA,QACnB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,cAAcS,EAAY;AAAA,YAC1B,SAAS;AAAA,cACL;AAAA,gBACI,OAAOA,EAAY;AAAA,gBACnB,OAAOA,EAAY;AAAA,cACvB;AAAA,cACA;AAAA,gBACI,OAAOA,EAAY;AAAA,gBACnB,OAAOA,EAAY;AAAA,cACvB;AAAA,cACA;AAAA,gBACI,OAAOA,EAAY;AAAA,gBACnB,OAAOA,EAAY;AAAA,cACvB;AAAA,YACJ;AAAA,UACJ;AAAA,UACA;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,cAAcS;AAAA,YACd,OAAO,CAACC,GAAsBC,EAAkC,GAAG,CAAC;AAAA,YACpE,aAAa;AAAA,UACjB;AAAA,UACA;AAAA,YACI,IAAIV;AAAA,YACJ,MAAM;AAAA,YACN,cAAcC;AAAA,UAClB;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,KAAK,CAAC;AAAA,EAAA;AAEd;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { presetCustomValue as g, numericalOrPixelRule as m, appendUnit as f } from "@frontify/sidebar-settings";
|
|
3
|
+
import { Radius as a, radiusStyleMap as i } from "./types.es.js";
|
|
4
|
+
const t = (e, l = a.None) => ({
|
|
5
|
+
id: e,
|
|
6
|
+
type: "segmentedControls",
|
|
7
|
+
defaultValue: l,
|
|
8
|
+
choices: [
|
|
9
|
+
{
|
|
10
|
+
value: a.None,
|
|
11
|
+
label: "None"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
value: a.Small,
|
|
15
|
+
label: "S"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
value: a.Medium,
|
|
19
|
+
label: "M"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
value: a.Large,
|
|
23
|
+
label: "L"
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}), b = (e) => {
|
|
27
|
+
const l = e != null && e.id ? `hasRadius_${e.id}` : "hasRadius", u = e != null && e.id ? `radiusValue_${e.id}` : "radiusValue", r = e != null && e.id ? `radiusChoice_${e.id}` : "radiusChoice", h = (e == null ? void 0 : e.defaultRadius) || a.None;
|
|
28
|
+
return {
|
|
29
|
+
id: l,
|
|
30
|
+
label: "Corner radius",
|
|
31
|
+
type: "switch",
|
|
32
|
+
switchLabel: "Custom",
|
|
33
|
+
defaultValue: !1,
|
|
34
|
+
info: "Determining how rounded the corners are.",
|
|
35
|
+
show: (d) => {
|
|
36
|
+
var c;
|
|
37
|
+
return e != null && e.dependentSettingId ? !!((c = d.getBlock(e.dependentSettingId)) != null && c.value) : !0;
|
|
38
|
+
},
|
|
39
|
+
onChange: (d) => g(d, r, u, (e == null ? void 0 : e.radiusStyleMap) || i),
|
|
40
|
+
on: [
|
|
41
|
+
{
|
|
42
|
+
id: u,
|
|
43
|
+
type: "input",
|
|
44
|
+
placeholder: "e.g. 10px",
|
|
45
|
+
rules: [m],
|
|
46
|
+
onChange: (d) => f(d, u)
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
off: [t(r, h)]
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
b as getBorderRadiusSettings,
|
|
54
|
+
t as getBorderRadiusSlider
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=borderRadius.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borderRadius.es.js","sources":["../../src/settings/borderRadius.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\n\nimport { Radius, radiusStyleMap } from './types';\n\n/**\n * Returns border radius settings: border radius switch, radius slider, custom radius input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.dependentSettingId Id of setting which the border radius is dependent on\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderRadiusSettingsType = {\n id?: string;\n dependentSettingId?: string;\n radiusStyleMap?: Record<Radius, string>;\n defaultRadius?: Radius;\n};\n\nexport const getBorderRadiusSlider = (id: string, defaultValue: Radius = Radius.None): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue,\n choices: [\n {\n value: Radius.None,\n label: 'None',\n },\n {\n value: Radius.Small,\n label: 'S',\n },\n {\n value: Radius.Medium,\n label: 'M',\n },\n {\n value: Radius.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getBorderRadiusSettings = (options?: BorderRadiusSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasRadius_${options.id}` : 'hasRadius';\n const valueId = options?.id ? `radiusValue_${options.id}` : 'radiusValue';\n const choiceId = options?.id ? `radiusChoice_${options.id}` : 'radiusChoice';\n const defaultValue = options?.defaultRadius || Radius.None;\n\n return {\n id: hasId,\n label: 'Corner radius',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'Determining how rounded the corners are.',\n show: (bundle) => (options?.dependentSettingId ? !!bundle.getBlock(options.dependentSettingId)?.value : true),\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.radiusStyleMap || radiusStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: 'e.g. 10px',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getBorderRadiusSlider(choiceId, defaultValue)],\n };\n};\n"],"names":["getBorderRadiusSlider","id","defaultValue","Radius","getBorderRadiusSettings","options","hasId","valueId","choiceId","bundle","_a","presetCustomValue","radiusStyleMap","numericalOrPixelRule","appendUnit"],"mappings":";;;AAsBO,MAAMA,IAAwB,CAACC,GAAYC,IAAuBC,EAAO,UAAwB;AAAA,EACpG,IAAAF;AAAA,EACA,MAAM;AAAA,EACN,cAAAC;AAAA,EACA,SAAS;AAAA,IACL;AAAA,MACI,OAAOC,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,EACJ;AACJ,IAEaC,IAA0B,CAACC,MAAqD;AACzF,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,aAAaA,EAAQ,EAAE,KAAK,aAClDE,IAAUF,KAAA,QAAAA,EAAS,KAAK,eAAeA,EAAQ,EAAE,KAAK,eACtDG,IAAWH,KAAA,QAAAA,EAAS,KAAK,gBAAgBA,EAAQ,EAAE,KAAK,gBACxDH,KAAeG,KAAA,gBAAAA,EAAS,kBAAiBF,EAAO;AAE/C,SAAA;AAAA,IACH,IAAIG;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM,CAACG;;AAAY,aAAAJ,KAAA,QAAAA,EAAS,qBAAqB,CAAC,GAACK,IAAAD,EAAO,SAASJ,EAAQ,kBAAkB,MAA1C,QAAAK,EAA6C,SAAQ;AAAA;AAAA,IACxG,UAAU,CAACD,MAAWE,EAAkBF,GAAQD,GAAUD,IAASF,KAAA,gBAAAA,EAAS,mBAAkBO,CAAc;AAAA,IAC5G,IAAI;AAAA,MACA;AAAA,QACI,IAAIL;AAAA,QACJ,MAAM;AAAA,QACN,aAAa;AAAA,QACb,OAAO,CAACM,CAAoB;AAAA,QAC5B,UAAU,CAACJ,MAAWK,EAAWL,GAAQF,CAAO;AAAA,MACpD;AAAA,IACJ;AAAA,IACA,KAAK,CAACP,EAAsBQ,GAAUN,CAAY,CAAC;AAAA,EAAA;AAE3D;"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { presetCustomValue as a, MultiInputLayout as x, numericalOrPixelRule as u, appendUnit as l } from "@frontify/sidebar-settings";
|
|
3
|
+
import { getBorderRadiusSlider as C } from "./borderRadius.es.js";
|
|
4
|
+
import { radiusStyleMap as r } from "./types.es.js";
|
|
5
|
+
const _ = (e) => {
|
|
6
|
+
const c = e != null && e.id ? `hasExtendedCustomRadius_${e.id}` : "hasExtendedCustomRadius", f = e != null && e.id ? `extendedRadiusValue_${e.id}` : "extendedRadiusValue", t = e != null && e.id ? `extendedRadiusChoice_${e.id}` : "extendedRadiusChoice", R = e != null && e.id ? `extendedRadiusTopLeft_${e.id}` : "extendedRadiusTopLeft", h = e != null && e.id ? `extendedRadiusTopRight_${e.id}` : "extendedRadiusTopRight", m = e != null && e.id ? `extendedRadiusBottomLeft_${e.id}` : "extendedRadiusBottomLeft", g = e != null && e.id ? `extendedRadiusBottomRight_${e.id}` : "extendedRadiusBottomRight";
|
|
7
|
+
return {
|
|
8
|
+
id: c,
|
|
9
|
+
label: "Corner radius",
|
|
10
|
+
type: "switch",
|
|
11
|
+
switchLabel: "Custom",
|
|
12
|
+
defaultValue: !1,
|
|
13
|
+
info: "Determining how rounded the corners are.",
|
|
14
|
+
show: (d) => {
|
|
15
|
+
var i;
|
|
16
|
+
return e != null && e.dependentSettingId ? !!((i = d.getBlock(e.dependentSettingId)) != null && i.value) : !0;
|
|
17
|
+
},
|
|
18
|
+
onChange: (d) => {
|
|
19
|
+
a(d, t, R, r), a(d, t, h, r), a(d, t, m, r), a(d, t, g, r);
|
|
20
|
+
},
|
|
21
|
+
on: [
|
|
22
|
+
{
|
|
23
|
+
id: f,
|
|
24
|
+
type: "multiInput",
|
|
25
|
+
layout: x.Columns,
|
|
26
|
+
blocks: [
|
|
27
|
+
{
|
|
28
|
+
id: R,
|
|
29
|
+
type: "input",
|
|
30
|
+
label: "Top Left",
|
|
31
|
+
rules: [u],
|
|
32
|
+
onChange: (d) => l(d, R)
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: h,
|
|
36
|
+
type: "input",
|
|
37
|
+
label: "Top Right",
|
|
38
|
+
rules: [u],
|
|
39
|
+
onChange: (d) => l(d, h)
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: m,
|
|
43
|
+
type: "input",
|
|
44
|
+
label: "Bottom Left",
|
|
45
|
+
rules: [u],
|
|
46
|
+
onChange: (d) => l(d, m)
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: g,
|
|
50
|
+
type: "input",
|
|
51
|
+
label: "Bottom Right",
|
|
52
|
+
rules: [u],
|
|
53
|
+
onChange: (d) => l(d, g)
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
}
|
|
57
|
+
],
|
|
58
|
+
off: [C(t, e == null ? void 0 : e.defaultValue)]
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
_ as getExtendedBorderRadiusSettings
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=borderRadiusExtended.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"borderRadiusExtended.es.js","sources":["../../src/settings/borderRadiusExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MultiInputLayout, SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\nimport { getBorderRadiusSlider } from './borderRadius';\nimport { Radius, radiusStyleMap } from './types';\n\n/**\n * Returns border radius settings: border radius switch, radius slider, custom radius inputs for every corner\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @param options.dependentSettingId Id of setting which the border radius is dependent on\n * @returns {SettingBlock} Returns border settings\n */\n\ntype BorderRadiusSettingsType = {\n id?: string;\n dependentSettingId?: string;\n defaultValue?: Radius;\n};\n\nexport const getExtendedBorderRadiusSettings = (options?: BorderRadiusSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomRadius_${options.id}` : 'hasExtendedCustomRadius';\n const valueId = options?.id ? `extendedRadiusValue_${options.id}` : 'extendedRadiusValue';\n const choiceId = options?.id ? `extendedRadiusChoice_${options.id}` : 'extendedRadiusChoice';\n const topLeftId = options?.id ? `extendedRadiusTopLeft_${options.id}` : 'extendedRadiusTopLeft';\n const topRightId = options?.id ? `extendedRadiusTopRight_${options.id}` : 'extendedRadiusTopRight';\n const bottomLeftId = options?.id ? `extendedRadiusBottomLeft_${options.id}` : 'extendedRadiusBottomLeft';\n const bottomRightId = options?.id ? `extendedRadiusBottomRight_${options.id}` : 'extendedRadiusBottomRight';\n\n return {\n id: hasId,\n label: 'Corner radius',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'Determining how rounded the corners are.',\n show: (bundle) => (options?.dependentSettingId ? !!bundle.getBlock(options.dependentSettingId)?.value : true),\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topLeftId, radiusStyleMap);\n presetCustomValue(bundle, choiceId, topRightId, radiusStyleMap);\n presetCustomValue(bundle, choiceId, bottomLeftId, radiusStyleMap);\n presetCustomValue(bundle, choiceId, bottomRightId, radiusStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Columns,\n blocks: [\n {\n id: topLeftId,\n type: 'input',\n label: 'Top Left',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, topLeftId),\n },\n {\n id: topRightId,\n type: 'input',\n label: 'Top Right',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, topRightId),\n },\n {\n id: bottomLeftId,\n type: 'input',\n label: 'Bottom Left',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, bottomLeftId),\n },\n {\n id: bottomRightId,\n type: 'input',\n label: 'Bottom Right',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, bottomRightId),\n },\n ],\n },\n ],\n off: [getBorderRadiusSlider(choiceId, options?.defaultValue)],\n };\n};\n"],"names":["getExtendedBorderRadiusSettings","options","hasId","valueId","choiceId","topLeftId","topRightId","bottomLeftId","bottomRightId","bundle","_a","presetCustomValue","radiusStyleMap","MultiInputLayout","numericalOrPixelRule","appendUnit","getBorderRadiusSlider"],"mappings":";;;;AAqBa,MAAAA,IAAkC,CAACC,MAAqD;AACjG,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,2BAA2BA,EAAQ,EAAE,KAAK,2BAChEE,IAAUF,KAAA,QAAAA,EAAS,KAAK,uBAAuBA,EAAQ,EAAE,KAAK,uBAC9DG,IAAWH,KAAA,QAAAA,EAAS,KAAK,wBAAwBA,EAAQ,EAAE,KAAK,wBAChEI,IAAYJ,KAAA,QAAAA,EAAS,KAAK,yBAAyBA,EAAQ,EAAE,KAAK,yBAClEK,IAAaL,KAAA,QAAAA,EAAS,KAAK,0BAA0BA,EAAQ,EAAE,KAAK,0BACpEM,IAAeN,KAAA,QAAAA,EAAS,KAAK,4BAA4BA,EAAQ,EAAE,KAAK,4BACxEO,IAAgBP,KAAA,QAAAA,EAAS,KAAK,6BAA6BA,EAAQ,EAAE,KAAK;AAEzE,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,MAAM,CAACO;;AAAY,aAAAR,KAAA,QAAAA,EAAS,qBAAqB,CAAC,GAACS,IAAAD,EAAO,SAASR,EAAQ,kBAAkB,MAA1C,QAAAS,EAA6C,SAAQ;AAAA;AAAA,IACxG,UAAU,CAACD,MAAW;AACA,MAAAE,EAAAF,GAAQL,GAAUC,GAAWO,CAAc,GAC3CD,EAAAF,GAAQL,GAAUE,GAAYM,CAAc,GAC5CD,EAAAF,GAAQL,GAAUG,GAAcK,CAAc,GAC9CD,EAAAF,GAAQL,GAAUI,GAAeI,CAAc;AAAA,IACrE;AAAA,IACA,IAAI;AAAA,MACA;AAAA,QACI,IAAIT;AAAA,QACJ,MAAM;AAAA,QACN,QAAQU,EAAiB;AAAA,QACzB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,OAAO,CAACS,CAAoB;AAAA,YAC5B,UAAU,CAACL,MAAWM,EAAWN,GAAQJ,CAAS;AAAA,UACtD;AAAA,UACA;AAAA,YACI,IAAIC;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,OAAO,CAACQ,CAAoB;AAAA,YAC5B,UAAU,CAACL,MAAWM,EAAWN,GAAQH,CAAU;AAAA,UACvD;AAAA,UACA;AAAA,YACI,IAAIC;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,OAAO,CAACO,CAAoB;AAAA,YAC5B,UAAU,CAACL,MAAWM,EAAWN,GAAQF,CAAY;AAAA,UACzD;AAAA,UACA;AAAA,YACI,IAAIC;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,OAAO,CAACM,CAAoB;AAAA,YAC5B,UAAU,CAACL,MAAWM,EAAWN,GAAQD,CAAa;AAAA,UAC1D;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,KAAK,CAACQ,EAAsBZ,GAAUH,KAAA,gBAAAA,EAAS,YAAY,CAAC;AAAA,EAAA;AAEpE;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const E = {
|
|
2
|
+
red: 241,
|
|
3
|
+
green: 241,
|
|
4
|
+
blue: 241,
|
|
5
|
+
alpha: 1
|
|
6
|
+
}, L = {
|
|
7
|
+
red: 234,
|
|
8
|
+
green: 235,
|
|
9
|
+
blue: 235,
|
|
10
|
+
alpha: 1
|
|
11
|
+
}, A = "1px", D = "24px", _ = "24px";
|
|
12
|
+
export {
|
|
13
|
+
E as BACKGROUND_COLOR_DEFAULT_VALUE,
|
|
14
|
+
L as BORDER_COLOR_DEFAULT_VALUE,
|
|
15
|
+
A as BORDER_WIDTH_DEFAULT_VALUE,
|
|
16
|
+
_ as MARGIN_DEFAULT_PLACEHOLDER,
|
|
17
|
+
D as PADDING_DEFAULT_PLACEHOLDER
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=defaultValues.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultValues.es.js","sources":["../../src/settings/defaultValues.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const BACKGROUND_COLOR_DEFAULT_VALUE = {\n red: 241,\n green: 241,\n blue: 241,\n alpha: 1,\n};\n\nexport const BORDER_COLOR_DEFAULT_VALUE = {\n red: 234,\n green: 235,\n blue: 235,\n alpha: 1,\n};\n\nexport const BORDER_WIDTH_DEFAULT_VALUE = '1px';\n\nexport const PADDING_DEFAULT_PLACEHOLDER = '24px';\n\nexport const MARGIN_DEFAULT_PLACEHOLDER = '24px';\n"],"names":["BACKGROUND_COLOR_DEFAULT_VALUE","BORDER_COLOR_DEFAULT_VALUE","BORDER_WIDTH_DEFAULT_VALUE","PADDING_DEFAULT_PLACEHOLDER","MARGIN_DEFAULT_PLACEHOLDER"],"mappings":"AAEO,MAAMA,IAAiC;AAAA,EAC1C,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AACX,GAEaC,IAA6B;AAAA,EACtC,KAAK;AAAA,EACL,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AACX,GAEaC,IAA6B,OAE7BC,IAA8B,QAE9BC,IAA6B;"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { presetCustomValue as C, numericalOrPixelRule as m, appendUnit as f } from "@frontify/sidebar-settings";
|
|
3
|
+
import { GutterSpacing as l, gutterSpacingStyleMap as h } from "./types.es.js";
|
|
4
|
+
const I = (e) => {
|
|
5
|
+
const t = e != null && e.id ? e.id : "hasCustomSpacing", g = e != null && e.dependentSettingId ? e.dependentSettingId : "columns", c = e != null && e.spacingChoiceId ? e.spacingChoiceId : "spacingChoice", u = e != null && e.spacingCustomId ? e.spacingCustomId : "spacingCustom", r = e != null && e.defaultValueChoices ? e.defaultValueChoices : l.M;
|
|
6
|
+
return {
|
|
7
|
+
id: t,
|
|
8
|
+
type: "switch",
|
|
9
|
+
defaultValue: !1,
|
|
10
|
+
switchLabel: "Custom",
|
|
11
|
+
label: "Gutter",
|
|
12
|
+
info: "An official nerds term for ‘gap’",
|
|
13
|
+
onChange: (a) => C(a, c, u, h),
|
|
14
|
+
show: (a) => {
|
|
15
|
+
var d;
|
|
16
|
+
return ((d = a.getBlock(g)) == null ? void 0 : d.value) !== "1";
|
|
17
|
+
},
|
|
18
|
+
on: [
|
|
19
|
+
{
|
|
20
|
+
id: u,
|
|
21
|
+
type: "input",
|
|
22
|
+
rules: [m],
|
|
23
|
+
onChange: (a) => f(a, u)
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
off: [
|
|
27
|
+
{
|
|
28
|
+
id: c,
|
|
29
|
+
type: "slider",
|
|
30
|
+
defaultValue: r,
|
|
31
|
+
choices: [
|
|
32
|
+
{
|
|
33
|
+
value: l.Auto,
|
|
34
|
+
label: "Auto"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: l.S,
|
|
38
|
+
label: "S"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: l.M,
|
|
42
|
+
label: "M"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
value: l.L,
|
|
46
|
+
label: "L"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
I as getGutterSettings
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=gutter.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gutter.es.js","sources":["../../src/settings/gutter.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { SettingBlock, appendUnit, numericalOrPixelRule, presetCustomValue } from '../';\nimport { GutterSpacing, gutterSpacingStyleMap } from './types';\n\n/**\n * Returns gutter settings: gutter switch, gutter choices or gutter custom input\n *\n * @param options Options for the settings\n * @param options.id Custom id for the gutters switch\n * @param options.dependentSettingId Id of the dependent setting\n * @param options.spacingChoiceId Id of the spacing choice\n * @param options.defaultValueChoices Default value for the spacing choice\n * @returns {SettingBlock} Returns the gutter settings\n */\n\ntype GutterSettingsType = {\n id?: string;\n dependentSettingId?: string;\n spacingChoiceId?: string;\n spacingCustomId?: string;\n defaultValueChoices?: GutterSpacing;\n};\n\nexport const getGutterSettings = (options?: GutterSettingsType): SettingBlock => {\n const id = options?.id ? options.id : 'hasCustomSpacing';\n const dependentSettingId = options?.dependentSettingId ? options.dependentSettingId : 'columns';\n const spacingChoiceId = options?.spacingChoiceId ? options.spacingChoiceId : 'spacingChoice';\n const spacingCustomId = options?.spacingCustomId ? options.spacingCustomId : 'spacingCustom';\n const defaultValueChoices = options?.defaultValueChoices ? options.defaultValueChoices : GutterSpacing.M;\n\n return {\n id,\n type: 'switch',\n defaultValue: false,\n switchLabel: 'Custom',\n label: 'Gutter',\n info: 'An official nerds term for ‘gap’',\n onChange: (bundle) => presetCustomValue(bundle, spacingChoiceId, spacingCustomId, gutterSpacingStyleMap),\n show: (bundle) => bundle.getBlock(dependentSettingId)?.value !== '1',\n on: [\n {\n id: spacingCustomId,\n type: 'input',\n rules: [numericalOrPixelRule],\n onChange: (bundle) => appendUnit(bundle, spacingCustomId),\n },\n ],\n off: [\n {\n id: spacingChoiceId,\n type: 'slider',\n defaultValue: defaultValueChoices,\n choices: [\n {\n value: GutterSpacing.Auto,\n label: 'Auto',\n },\n {\n value: GutterSpacing.S,\n label: 'S',\n },\n {\n value: GutterSpacing.M,\n label: 'M',\n },\n {\n value: GutterSpacing.L,\n label: 'L',\n },\n ],\n },\n ],\n };\n};\n"],"names":["getGutterSettings","options","id","dependentSettingId","spacingChoiceId","spacingCustomId","defaultValueChoices","GutterSpacing","bundle","presetCustomValue","gutterSpacingStyleMap","_a","numericalOrPixelRule","appendUnit"],"mappings":";;;AAwBa,MAAAA,IAAoB,CAACC,MAA+C;AAC7E,QAAMC,IAAKD,KAAA,QAAAA,EAAS,KAAKA,EAAQ,KAAK,oBAChCE,IAAqBF,KAAA,QAAAA,EAAS,qBAAqBA,EAAQ,qBAAqB,WAChFG,IAAkBH,KAAA,QAAAA,EAAS,kBAAkBA,EAAQ,kBAAkB,iBACvEI,IAAkBJ,KAAA,QAAAA,EAAS,kBAAkBA,EAAQ,kBAAkB,iBACvEK,IAAsBL,KAAA,QAAAA,EAAS,sBAAsBA,EAAQ,sBAAsBM,EAAc;AAEhG,SAAA;AAAA,IACH,IAAAL;AAAA,IACA,MAAM;AAAA,IACN,cAAc;AAAA,IACd,aAAa;AAAA,IACb,OAAO;AAAA,IACP,MAAM;AAAA,IACN,UAAU,CAACM,MAAWC,EAAkBD,GAAQJ,GAAiBC,GAAiBK,CAAqB;AAAA,IACvG,MAAM,CAACF;;AAAW,eAAAG,IAAAH,EAAO,SAASL,CAAkB,MAAlC,gBAAAQ,EAAqC,WAAU;AAAA;AAAA,IACjE,IAAI;AAAA,MACA;AAAA,QACI,IAAIN;AAAA,QACJ,MAAM;AAAA,QACN,OAAO,CAACO,CAAoB;AAAA,QAC5B,UAAU,CAACJ,MAAWK,EAAWL,GAAQH,CAAe;AAAA,MAC5D;AAAA,IACJ;AAAA,IACA,KAAK;AAAA,MACD;AAAA,QACI,IAAID;AAAA,QACJ,MAAM;AAAA,QACN,cAAcE;AAAA,QACd,SAAS;AAAA,UACL;AAAA,YACI,OAAOC,EAAc;AAAA,YACrB,OAAO;AAAA,UACX;AAAA,UACA;AAAA,YACI,OAAOA,EAAc;AAAA,YACrB,OAAO;AAAA,UACX;AAAA,UACA;AAAA,YACI,OAAOA,EAAc;AAAA,YACrB,OAAO;AAAA,UACX;AAAA,UACA;AAAA,YACI,OAAOA,EAAc;AAAA,YACrB,OAAO;AAAA,UACX;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EAAA;AAER;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { presetCustomValue as g, numericalOrPixelRule as c, maximumNumericalOrPixelOrAutoRule as d, appendUnit as h } from "@frontify/sidebar-settings";
|
|
3
|
+
import { MARGIN_DEFAULT_PLACEHOLDER as M } from "./defaultValues.es.js";
|
|
4
|
+
import { Margin as a, marginStyleMap as C } from "./types.es.js";
|
|
5
|
+
const f = (e) => ({
|
|
6
|
+
id: e,
|
|
7
|
+
type: "segmentedControls",
|
|
8
|
+
defaultValue: a.None,
|
|
9
|
+
choices: [
|
|
10
|
+
{
|
|
11
|
+
value: a.None,
|
|
12
|
+
label: "None"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: a.Small,
|
|
16
|
+
label: "S"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: a.Medium,
|
|
20
|
+
label: "M"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: a.Large,
|
|
24
|
+
label: "L"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}), S = (e) => {
|
|
28
|
+
const m = e != null && e.id ? `hasCustomMarginValue_${e == null ? void 0 : e.id}` : "hasCustomMarginValue", l = e != null && e.id ? `marginValue_${e == null ? void 0 : e.id}` : "marginValue", u = e != null && e.id ? `marginChoice_${e == null ? void 0 : e.id}` : "marginChoice";
|
|
29
|
+
return {
|
|
30
|
+
id: m,
|
|
31
|
+
label: "Margin",
|
|
32
|
+
type: "switch",
|
|
33
|
+
switchLabel: "Custom",
|
|
34
|
+
defaultValue: !1,
|
|
35
|
+
info: "The spacing around UI elements to create more space",
|
|
36
|
+
onChange: (r) => g(r, u, l, (e == null ? void 0 : e.marginStyleMap) || C),
|
|
37
|
+
on: [
|
|
38
|
+
{
|
|
39
|
+
id: l,
|
|
40
|
+
type: "input",
|
|
41
|
+
placeholder: M,
|
|
42
|
+
rules: [c, d(500)],
|
|
43
|
+
onChange: (r) => h(r, l)
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
off: [f(u)]
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
S as getMarginSettings,
|
|
51
|
+
f as getMarginSlider
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=margin.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"margin.es.js","sources":["../../src/settings/margin.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Margin, marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n marginStyleMap?: Record<Margin, string>;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input\n *\n * @param {string} id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Margin.None,\n choices: [\n {\n value: Margin.None,\n label: 'None',\n },\n {\n value: Margin.Small,\n label: 'S',\n },\n {\n value: Margin.Medium,\n label: 'M',\n },\n {\n value: Margin.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getMarginSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomMarginValue_${options?.id}` : 'hasCustomMarginValue';\n const valueId = options?.id ? `marginValue_${options?.id}` : 'marginValue';\n const choiceId = options?.id ? `marginChoice_${options?.id}` : 'marginChoice';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.marginStyleMap || marginStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"names":["getMarginSlider","id","Margin","getMarginSettings","options","hasId","valueId","choiceId","bundle","presetCustomValue","marginStyleMap","MARGIN_DEFAULT_PLACEHOLDER","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","appendUnit"],"mappings":";;;;AAuBa,MAAAA,IAAkB,CAACC,OAA8B;AAAA,EAC1D,IAAAA;AAAA,EACA,MAAM;AAAA,EACN,cAAcC,EAAO;AAAA,EACrB,SAAS;AAAA,IACL;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAO;AAAA,MACd,OAAO;AAAA,IACX;AAAA,EACJ;AACJ,IAEaC,IAAoB,CAACC,MAA+C;AAC7E,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,wBAAwBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,wBAC9DE,IAAUF,KAAA,QAAAA,EAAS,KAAK,eAAeA,KAAA,gBAAAA,EAAS,EAAE,KAAK,eACvDG,IAAWH,KAAA,QAAAA,EAAS,KAAK,gBAAgBA,KAAA,gBAAAA,EAAS,EAAE,KAAK;AAExD,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACG,MAAWC,EAAkBD,GAAQD,GAAUD,IAASF,KAAA,gBAAAA,EAAS,mBAAkBM,CAAc;AAAA,IAC5G,IAAI;AAAA,MACA;AAAA,QACI,IAAIJ;AAAA,QACJ,MAAM;AAAA,QACN,aAAaK;AAAA,QACb,OAAO,CAACC,GAAsBC,EAAkC,GAAG,CAAC;AAAA,QACpE,UAAU,CAACL,MAAWM,EAAWN,GAAQF,CAAO;AAAA,MACpD;AAAA,IACJ;AAAA,IACA,KAAK,CAACN,EAAgBO,CAAQ,CAAC;AAAA,EAAA;AAEvC;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { presetCustomValue as r, MultiInputLayout as I, appendUnit as l, numericalOrPixelRule as g, maximumNumericalOrPixelOrAutoRule as u } from "@frontify/sidebar-settings";
|
|
3
|
+
import { MARGIN_DEFAULT_PLACEHOLDER as m } from "./defaultValues.es.js";
|
|
4
|
+
import { getMarginSlider as y } from "./margin.es.js";
|
|
5
|
+
import { marginStyleMap as c } from "./types.es.js";
|
|
6
|
+
const b = (e) => {
|
|
7
|
+
const t = e != null && e.id ? `hasExtendedCustomMargin_${e == null ? void 0 : e.id}` : "hasExtendedCustomMargin", C = e != null && e.id ? `extendedMarginValues_${e == null ? void 0 : e.id}` : "extendedMarginValues", a = e != null && e.id ? `extendedMarginChoice_${e == null ? void 0 : e.id}` : "extendedMarginChoice", h = e != null && e.id ? `extendedMarginTop_${e == null ? void 0 : e.id}` : "extendedMarginTop", M = e != null && e.id ? `extendedMarginLeft_${e == null ? void 0 : e.id}` : "extendedMarginLeft", x = e != null && e.id ? `extendedMarginRight_${e == null ? void 0 : e.id}` : "extendedMarginRight", f = e != null && e.id ? `extendedMarginBottom_${e == null ? void 0 : e.id}` : "extendedMarginBottom";
|
|
8
|
+
return {
|
|
9
|
+
id: t,
|
|
10
|
+
label: "Margin",
|
|
11
|
+
type: "switch",
|
|
12
|
+
switchLabel: "Custom",
|
|
13
|
+
defaultValue: !1,
|
|
14
|
+
info: "The spacing around UI elements to create more negative space",
|
|
15
|
+
onChange: (d) => {
|
|
16
|
+
r(d, a, h, c), r(d, a, M, c), r(d, a, x, c), r(d, a, f, c);
|
|
17
|
+
},
|
|
18
|
+
on: [
|
|
19
|
+
{
|
|
20
|
+
id: C,
|
|
21
|
+
type: "multiInput",
|
|
22
|
+
layout: I.Spider,
|
|
23
|
+
blocks: [
|
|
24
|
+
{
|
|
25
|
+
id: h,
|
|
26
|
+
type: "input",
|
|
27
|
+
label: "Top",
|
|
28
|
+
placeholder: m,
|
|
29
|
+
onChange: (d) => l(d, h),
|
|
30
|
+
rules: [g, u(500)]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: M,
|
|
34
|
+
type: "input",
|
|
35
|
+
label: "Left",
|
|
36
|
+
placeholder: m,
|
|
37
|
+
onChange: (d) => l(d, M),
|
|
38
|
+
rules: [g, u(500)]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: x,
|
|
42
|
+
type: "input",
|
|
43
|
+
label: "Right",
|
|
44
|
+
placeholder: m,
|
|
45
|
+
onChange: (d) => l(d, x),
|
|
46
|
+
rules: [g, u(500)]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: f,
|
|
50
|
+
type: "input",
|
|
51
|
+
label: "Bottom",
|
|
52
|
+
placeholder: m,
|
|
53
|
+
onChange: (d) => l(d, f),
|
|
54
|
+
rules: [g, u(500)]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
off: [y(a)]
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
b as getMarginExtendedSettings
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=marginExtended.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marginExtended.es.js","sources":["../../src/settings/marginExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { MARGIN_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getMarginSlider } from './margin';\nimport { marginStyleMap } from './types';\n\ntype MarginSettingsType = {\n id?: string;\n};\n\n/**\n * Returns margin settings: margin switch, margin slider, custom margin input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns margin settings\n */\nexport const getMarginExtendedSettings = (options?: MarginSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomMargin_${options?.id}` : 'hasExtendedCustomMargin';\n const valueId = options?.id ? `extendedMarginValues_${options?.id}` : 'extendedMarginValues';\n const choiceId = options?.id ? `extendedMarginChoice_${options?.id}` : 'extendedMarginChoice';\n const topId = options?.id ? `extendedMarginTop_${options?.id}` : 'extendedMarginTop';\n const leftId = options?.id ? `extendedMarginLeft_${options?.id}` : 'extendedMarginLeft';\n const rightId = options?.id ? `extendedMarginRight_${options?.id}` : 'extendedMarginRight';\n const bottomId = options?.id ? `extendedMarginBottom_${options?.id}` : 'extendedMarginBottom';\n\n return {\n id: hasId,\n label: 'Margin',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, marginStyleMap);\n presetCustomValue(bundle, choiceId, leftId, marginStyleMap);\n presetCustomValue(bundle, choiceId, rightId, marginStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, marginStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: MARGIN_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getMarginSlider(choiceId)],\n };\n};\n"],"names":["getMarginExtendedSettings","options","hasId","valueId","choiceId","topId","leftId","rightId","bottomId","bundle","presetCustomValue","marginStyleMap","MultiInputLayout","MARGIN_DEFAULT_PLACEHOLDER","appendUnit","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getMarginSlider"],"mappings":";;;;;AAyBa,MAAAA,IAA4B,CAACC,MAA+C;AACrF,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,2BAA2BA,KAAA,gBAAAA,EAAS,EAAE,KAAK,2BACjEE,IAAUF,KAAA,QAAAA,EAAS,KAAK,wBAAwBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,wBAChEG,IAAWH,KAAA,QAAAA,EAAS,KAAK,wBAAwBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,wBACjEI,IAAQJ,KAAA,QAAAA,EAAS,KAAK,qBAAqBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,qBAC3DK,IAASL,KAAA,QAAAA,EAAS,KAAK,sBAAsBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,sBAC7DM,IAAUN,KAAA,QAAAA,EAAS,KAAK,uBAAuBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,uBAC/DO,IAAWP,KAAA,QAAAA,EAAS,KAAK,wBAAwBA,KAAA,gBAAAA,EAAS,EAAE,KAAK;AAEhE,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACO,MAAW;AACA,MAAAC,EAAAD,GAAQL,GAAUC,GAAOM,CAAc,GACvCD,EAAAD,GAAQL,GAAUE,GAAQK,CAAc,GACxCD,EAAAD,GAAQL,GAAUG,GAASI,CAAc,GACzCD,EAAAD,GAAQL,GAAUI,GAAUG,CAAc;AAAA,IAChE;AAAA,IACA,IAAI;AAAA,MACA;AAAA,QACI,IAAIR;AAAA,QACJ,MAAM;AAAA,QACN,QAAQS,EAAiB;AAAA,QACzB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIP;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaQ;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQJ,CAAK;AAAA,YAC9C,OAAO,CAACU,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,UACA;AAAA,YACI,IAAIV;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaO;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQH,CAAM;AAAA,YAC/C,OAAO,CAACS,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,UACA;AAAA,YACI,IAAIT;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaM;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQF,CAAO;AAAA,YAChD,OAAO,CAACQ,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,UACA;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaK;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQD,CAAQ;AAAA,YACjD,OAAO,CAACO,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,KAAK,CAACC,EAAgBb,CAAQ,CAAC;AAAA,EAAA;AAEvC;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { presetCustomValue as m, numericalOrPixelRule as g, maximumNumericalOrPixelOrAutoRule as c, appendUnit as h } from "@frontify/sidebar-settings";
|
|
3
|
+
import { PADDING_DEFAULT_PLACEHOLDER as C } from "./defaultValues.es.js";
|
|
4
|
+
import { Padding as a, paddingStyleMap as P } from "./types.es.js";
|
|
5
|
+
const f = (e) => ({
|
|
6
|
+
id: e,
|
|
7
|
+
type: "segmentedControls",
|
|
8
|
+
defaultValue: a.Small,
|
|
9
|
+
choices: [
|
|
10
|
+
{
|
|
11
|
+
value: a.None,
|
|
12
|
+
label: "None"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
value: a.Small,
|
|
16
|
+
label: "S"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
value: a.Medium,
|
|
20
|
+
label: "M"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: a.Large,
|
|
24
|
+
label: "L"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
}), v = (e) => {
|
|
28
|
+
const r = e != null && e.id ? `hasCustomPaddingValue_${e == null ? void 0 : e.id}` : "hasCustomPaddingValue", l = e != null && e.id ? `paddingValue_${e == null ? void 0 : e.id}` : "paddingValue", u = e != null && e.id ? `paddingChoice_${e == null ? void 0 : e.id}` : "paddingChoice";
|
|
29
|
+
return {
|
|
30
|
+
id: r,
|
|
31
|
+
label: "Padding",
|
|
32
|
+
type: "switch",
|
|
33
|
+
switchLabel: "Custom",
|
|
34
|
+
defaultValue: !1,
|
|
35
|
+
info: "The spacing around UI elements to create more negative space",
|
|
36
|
+
onChange: (d) => m(d, u, l, (e == null ? void 0 : e.paddingStyleMap) || P),
|
|
37
|
+
on: [
|
|
38
|
+
{
|
|
39
|
+
id: l,
|
|
40
|
+
type: "input",
|
|
41
|
+
placeholder: C,
|
|
42
|
+
rules: [g, c(500)],
|
|
43
|
+
onChange: (d) => h(d, l)
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
off: [f(u)]
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export {
|
|
50
|
+
v as getPaddingSettings,
|
|
51
|
+
f as getPaddingSlider
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=padding.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"padding.es.js","sources":["../../src/settings/padding.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { Padding, paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n paddingStyleMap?: Record<Padding, string>;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingSlider = (id: string): SettingBlock => ({\n id,\n type: 'segmentedControls',\n defaultValue: Padding.Small,\n choices: [\n {\n value: Padding.None,\n label: 'None',\n },\n {\n value: Padding.Small,\n label: 'S',\n },\n {\n value: Padding.Medium,\n label: 'M',\n },\n {\n value: Padding.Large,\n label: 'L',\n },\n ],\n});\n\nexport const getPaddingSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasCustomPaddingValue_${options?.id}` : 'hasCustomPaddingValue';\n const valueId = options?.id ? `paddingValue_${options?.id}` : 'paddingValue';\n const choiceId = options?.id ? `paddingChoice_${options?.id}` : 'paddingChoice';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => presetCustomValue(bundle, choiceId, valueId, options?.paddingStyleMap || paddingStyleMap),\n on: [\n {\n id: valueId,\n type: 'input',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n onChange: (bundle) => appendUnit(bundle, valueId),\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"names":["getPaddingSlider","id","Padding","getPaddingSettings","options","hasId","valueId","choiceId","bundle","presetCustomValue","paddingStyleMap","PADDING_DEFAULT_PLACEHOLDER","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","appendUnit"],"mappings":";;;;AAwBa,MAAAA,IAAmB,CAACC,OAA8B;AAAA,EAC3D,IAAAA;AAAA,EACA,MAAM;AAAA,EACN,cAAcC,EAAQ;AAAA,EACtB,SAAS;AAAA,IACL;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IACX;AAAA,IACA;AAAA,MACI,OAAOA,EAAQ;AAAA,MACf,OAAO;AAAA,IACX;AAAA,EACJ;AACJ,IAEaC,IAAqB,CAACC,MAAgD;AAC/E,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,yBAAyBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,yBAC/DE,IAAUF,KAAA,QAAAA,EAAS,KAAK,gBAAgBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,gBACxDG,IAAWH,KAAA,QAAAA,EAAS,KAAK,iBAAiBA,KAAA,gBAAAA,EAAS,EAAE,KAAK;AAEzD,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACG,MAAWC,EAAkBD,GAAQD,GAAUD,IAASF,KAAA,gBAAAA,EAAS,oBAAmBM,CAAe;AAAA,IAC9G,IAAI;AAAA,MACA;AAAA,QACI,IAAIJ;AAAA,QACJ,MAAM;AAAA,QACN,aAAaK;AAAA,QACb,OAAO,CAACC,GAAsBC,EAAkC,GAAG,CAAC;AAAA,QACpE,UAAU,CAACL,MAAWM,EAAWN,GAAQF,CAAO;AAAA,MACpD;AAAA,IACJ;AAAA,IACA,KAAK,CAACN,EAAiBO,CAAQ,CAAC;AAAA,EAAA;AAExC;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import "../styles.css.es.js";
|
|
2
|
+
import { presetCustomValue as l, MultiInputLayout as I, appendUnit as g, numericalOrPixelRule as r, maximumNumericalOrPixelOrAutoRule as u } from "@frontify/sidebar-settings";
|
|
3
|
+
import { PADDING_DEFAULT_PLACEHOLDER as m } from "./defaultValues.es.js";
|
|
4
|
+
import { getPaddingSlider as y } from "./padding.es.js";
|
|
5
|
+
import { paddingStyleMap as c } from "./types.es.js";
|
|
6
|
+
const b = (e) => {
|
|
7
|
+
const t = e != null && e.id ? `hasExtendedCustomPadding_${e == null ? void 0 : e.id}` : "hasExtendedCustomPadding", C = e != null && e.id ? `extendedPaddingValues_${e == null ? void 0 : e.id}` : "extendedPaddingValues", a = e != null && e.id ? `extendedPaddingChoice_${e == null ? void 0 : e.id}` : "extendedPaddingChoice", h = e != null && e.id ? `extendedPaddingTop_${e == null ? void 0 : e.id}` : "extendedPaddingTop", P = e != null && e.id ? `extendedPaddingLeft_${e == null ? void 0 : e.id}` : "extendedPaddingLeft", x = e != null && e.id ? `extendedPaddingRight_${e == null ? void 0 : e.id}` : "extendedPaddingRight", f = e != null && e.id ? `extendedPaddingBottom_${e == null ? void 0 : e.id}` : "extendedPaddingBottom";
|
|
8
|
+
return {
|
|
9
|
+
id: t,
|
|
10
|
+
label: "Padding",
|
|
11
|
+
type: "switch",
|
|
12
|
+
switchLabel: "Custom",
|
|
13
|
+
defaultValue: !1,
|
|
14
|
+
info: "The spacing around UI elements to create more negative space",
|
|
15
|
+
onChange: (d) => {
|
|
16
|
+
l(d, a, h, c), l(d, a, P, c), l(d, a, x, c), l(d, a, f, c);
|
|
17
|
+
},
|
|
18
|
+
on: [
|
|
19
|
+
{
|
|
20
|
+
id: C,
|
|
21
|
+
type: "multiInput",
|
|
22
|
+
layout: I.Spider,
|
|
23
|
+
blocks: [
|
|
24
|
+
{
|
|
25
|
+
id: h,
|
|
26
|
+
type: "input",
|
|
27
|
+
label: "Top",
|
|
28
|
+
placeholder: m,
|
|
29
|
+
onChange: (d) => g(d, h),
|
|
30
|
+
rules: [r, u(500)]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: P,
|
|
34
|
+
type: "input",
|
|
35
|
+
label: "Left",
|
|
36
|
+
placeholder: m,
|
|
37
|
+
onChange: (d) => g(d, P),
|
|
38
|
+
rules: [r, u(500)]
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: x,
|
|
42
|
+
type: "input",
|
|
43
|
+
label: "Right",
|
|
44
|
+
placeholder: m,
|
|
45
|
+
onChange: (d) => g(d, x),
|
|
46
|
+
rules: [r, u(500)]
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: f,
|
|
50
|
+
type: "input",
|
|
51
|
+
label: "Bottom",
|
|
52
|
+
placeholder: m,
|
|
53
|
+
onChange: (d) => g(d, f),
|
|
54
|
+
rules: [r, u(500)]
|
|
55
|
+
}
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
off: [y(a)]
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export {
|
|
63
|
+
b as getPaddingExtendedSettings
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=paddingExtended.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paddingExtended.es.js","sources":["../../src/settings/paddingExtended.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n MultiInputLayout,\n SettingBlock,\n appendUnit,\n maximumNumericalOrPixelOrAutoRule,\n numericalOrPixelRule,\n presetCustomValue,\n} from '../';\nimport { PADDING_DEFAULT_PLACEHOLDER } from './defaultValues';\nimport { getPaddingSlider } from './padding';\nimport { paddingStyleMap } from './types';\n\ntype PaddingSettingsType = {\n id?: string;\n};\n\n/**\n * Returns padding settings: padding switch, padding slider, custom padding input for every direction\n *\n * @param options Options for the settings\n * @param options.id Custom suffix for the setting ids\n * @returns {SettingBlock} Returns padding settings\n */\nexport const getPaddingExtendedSettings = (options?: PaddingSettingsType): SettingBlock => {\n const hasId = options?.id ? `hasExtendedCustomPadding_${options?.id}` : 'hasExtendedCustomPadding';\n const valueId = options?.id ? `extendedPaddingValues_${options?.id}` : 'extendedPaddingValues';\n const choiceId = options?.id ? `extendedPaddingChoice_${options?.id}` : 'extendedPaddingChoice';\n const topId = options?.id ? `extendedPaddingTop_${options?.id}` : 'extendedPaddingTop';\n const leftId = options?.id ? `extendedPaddingLeft_${options?.id}` : 'extendedPaddingLeft';\n const rightId = options?.id ? `extendedPaddingRight_${options?.id}` : 'extendedPaddingRight';\n const bottomId = options?.id ? `extendedPaddingBottom_${options?.id}` : 'extendedPaddingBottom';\n\n return {\n id: hasId,\n label: 'Padding',\n type: 'switch',\n switchLabel: 'Custom',\n defaultValue: false,\n info: 'The spacing around UI elements to create more negative space',\n onChange: (bundle) => {\n presetCustomValue(bundle, choiceId, topId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, leftId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, rightId, paddingStyleMap);\n presetCustomValue(bundle, choiceId, bottomId, paddingStyleMap);\n },\n on: [\n {\n id: valueId,\n type: 'multiInput',\n layout: MultiInputLayout.Spider,\n blocks: [\n {\n id: topId,\n type: 'input',\n label: 'Top',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, topId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: leftId,\n type: 'input',\n label: 'Left',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, leftId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: rightId,\n type: 'input',\n label: 'Right',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, rightId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n {\n id: bottomId,\n type: 'input',\n label: 'Bottom',\n placeholder: PADDING_DEFAULT_PLACEHOLDER,\n onChange: (bundle) => appendUnit(bundle, bottomId),\n rules: [numericalOrPixelRule, maximumNumericalOrPixelOrAutoRule(500)],\n },\n ],\n },\n ],\n off: [getPaddingSlider(choiceId)],\n };\n};\n"],"names":["getPaddingExtendedSettings","options","hasId","valueId","choiceId","topId","leftId","rightId","bottomId","bundle","presetCustomValue","paddingStyleMap","MultiInputLayout","PADDING_DEFAULT_PLACEHOLDER","appendUnit","numericalOrPixelRule","maximumNumericalOrPixelOrAutoRule","getPaddingSlider"],"mappings":";;;;;AAyBa,MAAAA,IAA6B,CAACC,MAAgD;AACvF,QAAMC,IAAQD,KAAA,QAAAA,EAAS,KAAK,4BAA4BA,KAAA,gBAAAA,EAAS,EAAE,KAAK,4BAClEE,IAAUF,KAAA,QAAAA,EAAS,KAAK,yBAAyBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,yBACjEG,IAAWH,KAAA,QAAAA,EAAS,KAAK,yBAAyBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,yBAClEI,IAAQJ,KAAA,QAAAA,EAAS,KAAK,sBAAsBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,sBAC5DK,IAASL,KAAA,QAAAA,EAAS,KAAK,uBAAuBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,uBAC9DM,IAAUN,KAAA,QAAAA,EAAS,KAAK,wBAAwBA,KAAA,gBAAAA,EAAS,EAAE,KAAK,wBAChEO,IAAWP,KAAA,QAAAA,EAAS,KAAK,yBAAyBA,KAAA,gBAAAA,EAAS,EAAE,KAAK;AAEjE,SAAA;AAAA,IACH,IAAIC;AAAA,IACJ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,IACb,cAAc;AAAA,IACd,MAAM;AAAA,IACN,UAAU,CAACO,MAAW;AACA,MAAAC,EAAAD,GAAQL,GAAUC,GAAOM,CAAe,GACxCD,EAAAD,GAAQL,GAAUE,GAAQK,CAAe,GACzCD,EAAAD,GAAQL,GAAUG,GAASI,CAAe,GAC1CD,EAAAD,GAAQL,GAAUI,GAAUG,CAAe;AAAA,IACjE;AAAA,IACA,IAAI;AAAA,MACA;AAAA,QACI,IAAIR;AAAA,QACJ,MAAM;AAAA,QACN,QAAQS,EAAiB;AAAA,QACzB,QAAQ;AAAA,UACJ;AAAA,YACI,IAAIP;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaQ;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQJ,CAAK;AAAA,YAC9C,OAAO,CAACU,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,UACA;AAAA,YACI,IAAIV;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaO;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQH,CAAM;AAAA,YAC/C,OAAO,CAACS,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,UACA;AAAA,YACI,IAAIT;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaM;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQF,CAAO;AAAA,YAChD,OAAO,CAACQ,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,UACA;AAAA,YACI,IAAIR;AAAA,YACJ,MAAM;AAAA,YACN,OAAO;AAAA,YACP,aAAaK;AAAA,YACb,UAAU,CAACJ,MAAWK,EAAWL,GAAQD,CAAQ;AAAA,YACjD,OAAO,CAACO,GAAsBC,EAAkC,GAAG,CAAC;AAAA,UACxE;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,IACA,KAAK,CAACC,EAAiBb,CAAQ,CAAC;AAAA,EAAA;AAExC;"}
|