@frontify/guideline-blocks-settings 0.28.0 → 0.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/_virtual/_commonjsHelpers.es.js +7 -0
- package/dist/_virtual/_commonjsHelpers.es.js.map +1 -0
- package/dist/_virtual/index.es.js +5 -0
- package/dist/_virtual/index.es.js.map +1 -0
- package/dist/_virtual/index.es2.js +5 -0
- package/dist/_virtual/index.es2.js.map +1 -0
- package/dist/_virtual/index.es3.js +5 -0
- package/dist/_virtual/index.es3.js.map +1 -0
- package/dist/_virtual/jsx-runtime.es.js +5 -0
- package/dist/_virtual/jsx-runtime.es.js.map +1 -0
- package/dist/_virtual/react-dom.development.es.js +5 -0
- package/dist/_virtual/react-dom.development.es.js.map +1 -0
- package/dist/_virtual/react-dom.production.min.es.js +5 -0
- package/dist/_virtual/react-dom.production.min.es.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.development.es.js +5 -0
- package/dist/_virtual/react-jsx-runtime.development.es.js.map +1 -0
- package/dist/_virtual/react-jsx-runtime.production.min.es.js +5 -0
- package/dist/_virtual/react-jsx-runtime.production.min.es.js.map +1 -0
- package/dist/_virtual/react.development.es.js +5 -0
- package/dist/_virtual/react.development.es.js.map +1 -0
- package/dist/_virtual/react.production.min.es.js +5 -0
- package/dist/_virtual/react.production.min.es.js.map +1 -0
- package/dist/_virtual/scheduler.development.es.js +5 -0
- package/dist/_virtual/scheduler.development.es.js.map +1 -0
- package/dist/_virtual/scheduler.production.min.es.js +5 -0
- package/dist/_virtual/scheduler.production.min.es.js.map +1 -0
- package/dist/components/Attachments/AttachmentItem.es.js +180 -0
- package/dist/components/Attachments/AttachmentItem.es.js.map +1 -0
- package/dist/components/Attachments/Attachments.es.js +145 -0
- package/dist/components/Attachments/Attachments.es.js.map +1 -0
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +150 -0
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +73 -0
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/Toolbar.es.js +113 -0
- package/dist/components/BlockItemWrapper/Toolbar.es.js.map +1 -0
- package/dist/components/BlockItemWrapper/constants.es.js +6 -0
- package/dist/components/BlockItemWrapper/constants.es.js.map +1 -0
- package/dist/components/DownloadButton/DownloadButton.es.js +39 -0
- package/dist/components/DownloadButton/DownloadButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/RichTextEditor.es.js +42 -0
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +1 -0
- package/dist/components/RichTextEditor/SerializedText.es.js +13 -0
- package/dist/components/RichTextEditor/SerializedText.es.js.map +1 -0
- package/dist/components/RichTextEditor/constants.es.js +5 -0
- package/dist/components/RichTextEditor/constants.es.js.map +1 -0
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +34 -0
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +54 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +12 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +17 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +30 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +16 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +37 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js +25 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +20 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +26 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +69 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +105 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +20 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +32 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +58 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +19 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +26 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +43 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +18 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +62 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +13 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +25 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +35 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +86 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +24 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +19 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +13 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +11 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +10 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +75 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +18 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +17 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +14 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +53 -0
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +19 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +37 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +53 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +29 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +8 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +80 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +40 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +93 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +25 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +27 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +12 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +5 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js +18 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/getUrl.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js +5 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/relativeUrlRegex.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js +17 -0
- package/dist/components/RichTextEditor/plugins/LinkPlugin/utils/url.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +45 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +45 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +45 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +46 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +39 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +40 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +46 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +46 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +41 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +48 -0
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js +68 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js +55 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/DocumentLinks.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js +62 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/LinkSelector.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js +61 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js +34 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/PageLinks.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js +26 -0
- package/dist/components/RichTextEditor/plugins/shared/LinkSelector/SectionLink.es.js.map +1 -0
- package/dist/components/RichTextEditor/plugins/styles.es.js +168 -0
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/button.es.js +16 -0
- package/dist/components/RichTextEditor/serializer/nodes/button.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js +19 -0
- package/dist/components/RichTextEditor/serializer/nodes/checkItemNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js +17 -0
- package/dist/components/RichTextEditor/serializer/nodes/default.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js +15 -0
- package/dist/components/RichTextEditor/serializer/nodes/link.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js +12 -0
- package/dist/components/RichTextEditor/serializer/nodes/mentionHtmlNode.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js +61 -0
- package/dist/components/RichTextEditor/serializer/serializeNodesToHtmlRecursive.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js +25 -0
- package/dist/components/RichTextEditor/serializer/serializeToHtml.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js +8 -0
- package/dist/components/RichTextEditor/serializer/utlis/reactCssPropsToCss.es.js.map +1 -0
- package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js +13 -0
- package/dist/components/RichTextEditor/serializer/utlis/serializeLeafToHtml.es.js.map +1 -0
- package/dist/helpers/addHttps.es.js +14 -0
- package/dist/helpers/addHttps.es.js.map +1 -0
- package/dist/helpers/convertToRichTextValue.es.js +6 -0
- package/dist/helpers/convertToRichTextValue.es.js.map +1 -0
- package/dist/helpers/customCoordinatesGetterFactory.es.js +32 -0
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +1 -0
- package/dist/helpers/hasRichTextValue.es.js +15 -0
- package/dist/helpers/hasRichTextValue.es.js.map +1 -0
- package/dist/helpers/isDownloadable.es.js +6 -0
- package/dist/helpers/isDownloadable.es.js.map +1 -0
- package/dist/helpers/mapColorPalettes.es.js +16 -0
- package/dist/helpers/mapColorPalettes.es.js.map +1 -0
- package/dist/hooks/useAttachments.es.js +31 -0
- package/dist/hooks/useAttachments.es.js.map +1 -0
- package/dist/hooks/useDndSensors.es.js +20 -0
- package/dist/hooks/useDndSensors.es.js.map +1 -0
- package/dist/index.cjs.js +253 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +962 -0
- package/dist/index.es.js +178 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +253 -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/style.css +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 +1 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { j as t } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { LoadingCircle as y, IconExclamationMarkTriangle as z, Flyout as O, ActionMenu as R, MenuItemContentSize as j, IconArrowCircleUp20 as X, IconImageStack20 as A } from "@frontify/fondue";
|
|
3
|
+
import { r as w } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.es.js";
|
|
4
|
+
import { joinClassNames as F } from "../../utilities/react/joinClassNames.es.js";
|
|
5
|
+
import { FileExtensionSets as T } from "@frontify/app-bridge";
|
|
6
|
+
const q = ({
|
|
7
|
+
onDrop: n,
|
|
8
|
+
label: u,
|
|
9
|
+
icon: h,
|
|
10
|
+
secondaryLabel: f,
|
|
11
|
+
isLoading: l,
|
|
12
|
+
fillParentContainer: k,
|
|
13
|
+
onAssetChooseClick: g,
|
|
14
|
+
onUploadClick: p,
|
|
15
|
+
withMenu: I = !0,
|
|
16
|
+
onClick: m,
|
|
17
|
+
validFileType: v,
|
|
18
|
+
verticalLayout: N
|
|
19
|
+
}) => {
|
|
20
|
+
const [d, x] = w.useState(!1), [i, c] = w.useState(), b = w.useRef(null), [a, o] = w.useState(void 0), S = (e) => {
|
|
21
|
+
if (e.preventDefault(), x(!1), !E(e.dataTransfer.files)) {
|
|
22
|
+
o("Invalid"), setTimeout(() => {
|
|
23
|
+
o(void 0);
|
|
24
|
+
}, 1e3);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
n == null || n(e.dataTransfer.files);
|
|
28
|
+
}, E = (e) => {
|
|
29
|
+
if (!v)
|
|
30
|
+
return !0;
|
|
31
|
+
for (let r = 0; r < e.length; r++) {
|
|
32
|
+
const s = e[r].name.split(".").pop() ?? "";
|
|
33
|
+
if (!T[v].includes(s))
|
|
34
|
+
return !1;
|
|
35
|
+
}
|
|
36
|
+
return !0;
|
|
37
|
+
}, M = (e) => {
|
|
38
|
+
if (!b.current || l)
|
|
39
|
+
return;
|
|
40
|
+
const { left: r, top: s } = b.current.getBoundingClientRect(), B = e.clientX - r, C = e.clientY - s;
|
|
41
|
+
c([B, C]);
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ t.jsxs(
|
|
44
|
+
"button",
|
|
45
|
+
{
|
|
46
|
+
ref: b,
|
|
47
|
+
"data-test-id": "block-inject-button",
|
|
48
|
+
className: F([
|
|
49
|
+
"tw-font-body tw-relative tw-text-sm tw-leading-4 tw-border tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-gap-3 tw-w-full first:tw-rounded-tl last:tw-rounded-br",
|
|
50
|
+
N ? "[&:not(:first-child)]:tw-border-t-0 first:tw-rounded-tr last:tw-rounded-bl" : "[&:not(:first-child)]:tw-border-l-0 first:tw-rounded-bl last:tw-rounded-tr",
|
|
51
|
+
k ? "tw-h-full" : "tw-h-[72px]",
|
|
52
|
+
d && !l ? "tw-border-dashed" : "tw-border-solid",
|
|
53
|
+
i && "tw-bg-blank-state-pressed-inverse",
|
|
54
|
+
d && "tw-bg-blank-state-weak-inverse",
|
|
55
|
+
a ? "!tw-border-red-50 !tw-cursor-not-allowed" : " tw-border-blank-state-line",
|
|
56
|
+
l || i || d || a ? "" : "tw-text-text-weak hover:tw-text-blank-state-hover hover:tw-bg-blank-state-hover-inverse hover:tw-border-blank-state-line-hover active:tw-text-blank-state-pressed active:tw-bg-blank-state-pressed-inverse active:tw-border-blank-state-line-hover",
|
|
57
|
+
(d || i) && !a ? "[&>*]:tw-pointer-events-none tw-border-blank-state-line-hover" : "tw-bg-blank-state-shaded-inverse tw-text-blank-state-shaded"
|
|
58
|
+
]),
|
|
59
|
+
onDragEnter: n ? (e) => {
|
|
60
|
+
var r;
|
|
61
|
+
if (x(!0), v === "Images")
|
|
62
|
+
for (const s of Array.from(e.dataTransfer.items))
|
|
63
|
+
(r = s == null ? void 0 : s.type) != null && r.startsWith("image/") ? o(void 0) : o("Invalid");
|
|
64
|
+
} : void 0,
|
|
65
|
+
onDragLeave: n ? () => {
|
|
66
|
+
x(!1), o(void 0);
|
|
67
|
+
} : void 0,
|
|
68
|
+
onDrop: n ? S : void 0,
|
|
69
|
+
onClick: (e) => {
|
|
70
|
+
I && M(e), m == null || m();
|
|
71
|
+
},
|
|
72
|
+
children: [
|
|
73
|
+
l ? /* @__PURE__ */ t.jsx(y, {}) : (
|
|
74
|
+
// eslint-disable-next-line unicorn/no-nested-ternary
|
|
75
|
+
a ? /* @__PURE__ */ t.jsxs("div", { className: " tw-flex tw-items-center tw-justify-center tw-text-red-60 tw-font-medium", children: [
|
|
76
|
+
/* @__PURE__ */ t.jsx(z, {}),
|
|
77
|
+
a
|
|
78
|
+
] }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
79
|
+
h && /* @__PURE__ */ t.jsx("div", { children: h }),
|
|
80
|
+
(u || f) && /* @__PURE__ */ t.jsxs("div", { className: "tw-flex tw-flex-col tw-items-start", children: [
|
|
81
|
+
u && /* @__PURE__ */ t.jsx("div", { className: "tw-font-medium", children: u }),
|
|
82
|
+
f && /* @__PURE__ */ t.jsx("div", { className: "tw-font-normal", children: f })
|
|
83
|
+
] })
|
|
84
|
+
] })
|
|
85
|
+
),
|
|
86
|
+
i && /* @__PURE__ */ t.jsx(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
className: "tw-absolute tw-left-0 tw-top-full tw-z-20",
|
|
90
|
+
style: {
|
|
91
|
+
left: i[0],
|
|
92
|
+
top: i[1]
|
|
93
|
+
},
|
|
94
|
+
children: /* @__PURE__ */ t.jsx(
|
|
95
|
+
O,
|
|
96
|
+
{
|
|
97
|
+
onOpenChange: (e) => !e && c(void 0),
|
|
98
|
+
isOpen: !0,
|
|
99
|
+
fitContent: !0,
|
|
100
|
+
hug: !1,
|
|
101
|
+
legacyFooter: !1,
|
|
102
|
+
trigger: /* @__PURE__ */ t.jsx("div", {}),
|
|
103
|
+
children: /* @__PURE__ */ t.jsx(
|
|
104
|
+
R,
|
|
105
|
+
{
|
|
106
|
+
menuBlocks: [
|
|
107
|
+
{
|
|
108
|
+
id: "menu",
|
|
109
|
+
menuItems: [
|
|
110
|
+
...p ? [
|
|
111
|
+
{
|
|
112
|
+
id: "upload",
|
|
113
|
+
size: j.XSmall,
|
|
114
|
+
title: "Upload asset",
|
|
115
|
+
onClick: () => {
|
|
116
|
+
p(), c(void 0);
|
|
117
|
+
},
|
|
118
|
+
initialValue: !0,
|
|
119
|
+
decorator: /* @__PURE__ */ t.jsx("div", { className: "tw-mr-2", children: /* @__PURE__ */ t.jsx(X, {}) })
|
|
120
|
+
}
|
|
121
|
+
] : [],
|
|
122
|
+
...g ? [
|
|
123
|
+
{
|
|
124
|
+
id: "asset",
|
|
125
|
+
size: j.XSmall,
|
|
126
|
+
title: "Browse asset",
|
|
127
|
+
onClick: () => {
|
|
128
|
+
g(), c(void 0);
|
|
129
|
+
},
|
|
130
|
+
initialValue: !0,
|
|
131
|
+
decorator: /* @__PURE__ */ t.jsx("div", { className: "tw-mr-2", children: /* @__PURE__ */ t.jsx(A, {}) })
|
|
132
|
+
}
|
|
133
|
+
] : []
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
}
|
|
140
|
+
)
|
|
141
|
+
}
|
|
142
|
+
)
|
|
143
|
+
]
|
|
144
|
+
}
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
export {
|
|
148
|
+
q as BlockInjectButton
|
|
149
|
+
};
|
|
150
|
+
//# sourceMappingURL=BlockInjectButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockInjectButton.es.js","sources":["../../../src/components/BlockInjectButton/BlockInjectButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ActionMenu,\n Flyout,\n IconArrowCircleUp20,\n IconExclamationMarkTriangle,\n IconImageStack20,\n LoadingCircle,\n MenuItemContentSize,\n} from '@frontify/fondue';\nimport { DragEventHandler, MouseEventHandler, useRef, useState } from 'react';\nimport { joinClassNames } from '../../utilities/react/joinClassNames';\nimport { BlockInjectButtonProps } from './types';\nimport { FileExtension, FileExtensionSets } from '@frontify/app-bridge';\n\nexport const BlockInjectButton = ({\n onDrop,\n label,\n icon,\n secondaryLabel,\n isLoading,\n fillParentContainer,\n onAssetChooseClick,\n onUploadClick,\n withMenu = true,\n onClick,\n validFileType,\n verticalLayout,\n}: BlockInjectButtonProps) => {\n const [isDraggingOver, setIsDraggingOver] = useState(false);\n const [menuPosition, setMenuPosition] = useState<[number, number] | undefined>();\n const buttonRef = useRef<HTMLButtonElement>(null);\n const [errorMsg, setErrorMsg] = useState<string | undefined>(undefined);\n\n const handleDrop: DragEventHandler<HTMLButtonElement> = (event) => {\n event.preventDefault();\n setIsDraggingOver(false);\n if (!isValidAsset(event.dataTransfer.files)) {\n setErrorMsg('Invalid');\n setTimeout(() => {\n setErrorMsg(undefined);\n }, 1000);\n return;\n }\n onDrop?.(event.dataTransfer.files);\n };\n\n const isValidAsset = (files: FileList) => {\n if (!validFileType) {\n return true;\n }\n for (let i = 0; i < files.length; i++) {\n const droppedFileExtension = (files[i].name.split('.').pop() ?? '') as FileExtension;\n if (!FileExtensionSets[validFileType].includes(droppedFileExtension)) {\n return false;\n }\n }\n return true;\n };\n\n const openMenu: MouseEventHandler<HTMLButtonElement> = (event) => {\n if (!buttonRef.current || isLoading) {\n return;\n }\n const { left, top } = buttonRef.current.getBoundingClientRect();\n const XInsideComponent = event.clientX - left;\n const YInsideComponent = event.clientY - top;\n setMenuPosition([XInsideComponent, YInsideComponent]);\n };\n\n return (\n <button\n ref={buttonRef}\n data-test-id=\"block-inject-button\"\n className={joinClassNames([\n 'tw-font-body tw-relative tw-text-sm tw-leading-4 tw-border tw-flex tw-items-center tw-justify-center tw-cursor-pointer tw-gap-3 tw-w-full first:tw-rounded-tl last:tw-rounded-br',\n verticalLayout\n ? '[&:not(:first-child)]:tw-border-t-0 first:tw-rounded-tr last:tw-rounded-bl'\n : '[&:not(:first-child)]:tw-border-l-0 first:tw-rounded-bl last:tw-rounded-tr',\n fillParentContainer ? 'tw-h-full' : 'tw-h-[72px]',\n isDraggingOver && !isLoading ? 'tw-border-dashed' : 'tw-border-solid',\n menuPosition && 'tw-bg-blank-state-pressed-inverse',\n isDraggingOver && 'tw-bg-blank-state-weak-inverse',\n errorMsg ? '!tw-border-red-50 !tw-cursor-not-allowed' : ' tw-border-blank-state-line',\n isLoading || menuPosition || isDraggingOver || errorMsg\n ? ''\n : 'tw-text-text-weak hover:tw-text-blank-state-hover hover:tw-bg-blank-state-hover-inverse hover:tw-border-blank-state-line-hover active:tw-text-blank-state-pressed active:tw-bg-blank-state-pressed-inverse active:tw-border-blank-state-line-hover',\n (isDraggingOver || !!menuPosition) && !errorMsg\n ? '[&>*]:tw-pointer-events-none tw-border-blank-state-line-hover'\n : 'tw-bg-blank-state-shaded-inverse tw-text-blank-state-shaded',\n ])}\n onDragEnter={\n onDrop\n ? (event) => {\n setIsDraggingOver(true);\n // is now only used for images, can be adapted if needed\n if (validFileType === 'Images') {\n for (const item of Array.from(event.dataTransfer.items)) {\n if (!item?.type?.startsWith('image/')) {\n setErrorMsg('Invalid');\n } else {\n setErrorMsg(undefined);\n }\n }\n }\n }\n : undefined\n }\n onDragLeave={\n onDrop\n ? () => {\n setIsDraggingOver(false);\n setErrorMsg(undefined);\n }\n : undefined\n }\n onDrop={onDrop ? handleDrop : undefined}\n onClick={(event) => {\n withMenu && openMenu(event);\n onClick?.();\n }}\n >\n {isLoading ? (\n <LoadingCircle />\n ) : // eslint-disable-next-line unicorn/no-nested-ternary\n errorMsg ? (\n <div className=\" tw-flex tw-items-center tw-justify-center tw-text-red-60 tw-font-medium\">\n <IconExclamationMarkTriangle />\n {errorMsg}\n </div>\n ) : (\n <>\n {icon && <div>{icon}</div>}\n {(label || secondaryLabel) && (\n <div className=\"tw-flex tw-flex-col tw-items-start\">\n {label && <div className=\"tw-font-medium\">{label}</div>}\n {secondaryLabel && <div className=\"tw-font-normal\">{secondaryLabel}</div>}\n </div>\n )}\n </>\n )}\n {menuPosition && (\n <div\n className=\"tw-absolute tw-left-0 tw-top-full tw-z-20\"\n style={{\n left: menuPosition[0],\n top: menuPosition[1],\n }}\n >\n <Flyout\n onOpenChange={(isOpen) => !isOpen && setMenuPosition(undefined)}\n isOpen={true}\n fitContent\n hug={false}\n legacyFooter={false}\n trigger={<div />}\n >\n <ActionMenu\n menuBlocks={[\n {\n id: 'menu',\n menuItems: [\n ...(onUploadClick\n ? [\n {\n id: 'upload',\n size: MenuItemContentSize.XSmall,\n title: 'Upload asset',\n onClick: () => {\n onUploadClick();\n setMenuPosition(undefined);\n },\n\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconArrowCircleUp20 />\n </div>\n ),\n },\n ]\n : []),\n ...(onAssetChooseClick\n ? [\n {\n id: 'asset',\n size: MenuItemContentSize.XSmall,\n title: 'Browse asset',\n onClick: () => {\n onAssetChooseClick();\n setMenuPosition(undefined);\n },\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconImageStack20 />\n </div>\n ),\n },\n ]\n : []),\n ],\n },\n ]}\n />\n </Flyout>\n </div>\n )}\n </button>\n );\n};\n"],"names":["BlockInjectButton","onDrop","label","icon","secondaryLabel","isLoading","fillParentContainer","onAssetChooseClick","onUploadClick","withMenu","onClick","validFileType","verticalLayout","isDraggingOver","setIsDraggingOver","useState","menuPosition","setMenuPosition","buttonRef","useRef","errorMsg","setErrorMsg","handleDrop","event","isValidAsset","files","i","droppedFileExtension","FileExtensionSets","openMenu","left","top","XInsideComponent","YInsideComponent","jsxs","joinClassNames","item","_a","LoadingCircle","jsx","IconExclamationMarkTriangle","Fragment","Flyout","isOpen","ActionMenu","MenuItemContentSize","IconArrowCircleUp20","IconImageStack20"],"mappings":"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"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { j as l } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { r as e } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.es.js";
|
|
3
|
+
import { Toolbar as j } from "./Toolbar.es.js";
|
|
4
|
+
import { joinClassNames as p } from "../../utilities/react/joinClassNames.es.js";
|
|
5
|
+
const E = ({
|
|
6
|
+
children: a,
|
|
7
|
+
toolbarFlyoutItems: c,
|
|
8
|
+
toolbarItems: o,
|
|
9
|
+
shouldHideWrapper: u,
|
|
10
|
+
shouldHideComponent: w = !1,
|
|
11
|
+
isDragging: n,
|
|
12
|
+
shouldFillContainer: f,
|
|
13
|
+
outlineOffset: s = 2,
|
|
14
|
+
shouldBeShown: i = !1
|
|
15
|
+
}) => {
|
|
16
|
+
const [t, m] = e.useState(i), [y, r] = e.useState(!1), x = e.useRef(null);
|
|
17
|
+
if (e.useEffect(() => {
|
|
18
|
+
t || r(!0);
|
|
19
|
+
}, [t]), u)
|
|
20
|
+
return a;
|
|
21
|
+
const v = o == null ? void 0 : o.filter((d) => d !== void 0);
|
|
22
|
+
return /* @__PURE__ */ l.jsxs(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
ref: x,
|
|
26
|
+
onFocus: () => r(!1),
|
|
27
|
+
onPointerEnter: () => r(!1),
|
|
28
|
+
"data-test-id": "block-item-wrapper",
|
|
29
|
+
style: {
|
|
30
|
+
outlineOffset: s
|
|
31
|
+
},
|
|
32
|
+
className: p([
|
|
33
|
+
"tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse",
|
|
34
|
+
f && "tw-flex-1 tw-h-full tw-w-full",
|
|
35
|
+
"hover:tw-outline focus-within:tw-outline",
|
|
36
|
+
(t || i) && "tw-outline",
|
|
37
|
+
w && "tw-opacity-0"
|
|
38
|
+
]),
|
|
39
|
+
children: [
|
|
40
|
+
/* @__PURE__ */ l.jsx(
|
|
41
|
+
"div",
|
|
42
|
+
{
|
|
43
|
+
style: {
|
|
44
|
+
right: -1 - s,
|
|
45
|
+
bottom: `calc(100% - ${2 + s}px)`
|
|
46
|
+
},
|
|
47
|
+
className: p([
|
|
48
|
+
"tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-10",
|
|
49
|
+
"group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100",
|
|
50
|
+
(t || i) && "tw-opacity-100"
|
|
51
|
+
]),
|
|
52
|
+
children: /* @__PURE__ */ l.jsx(
|
|
53
|
+
j,
|
|
54
|
+
{
|
|
55
|
+
isFlyoutOpen: t,
|
|
56
|
+
isFlyoutDisabled: y,
|
|
57
|
+
setIsFlyoutOpen: m,
|
|
58
|
+
flyoutItems: c,
|
|
59
|
+
items: v,
|
|
60
|
+
isDragging: n
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
),
|
|
65
|
+
a
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
E as BlockItemWrapper
|
|
72
|
+
};
|
|
73
|
+
//# sourceMappingURL=BlockItemWrapper.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockItemWrapper.es.js","sources":["../../../src/components/BlockItemWrapper/BlockItemWrapper.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { PropsWithChildren, useEffect, useRef, useState } from 'react';\nimport { joinClassNames } from '../../utilities';\nimport { Toolbar } from './Toolbar';\nimport { BlockItemWrapperProps, ToolbarItem } from './types';\n\nexport const BlockItemWrapper = ({\n children,\n toolbarFlyoutItems,\n toolbarItems,\n shouldHideWrapper,\n shouldHideComponent = false,\n isDragging,\n shouldFillContainer,\n outlineOffset = 2,\n shouldBeShown = false,\n}: PropsWithChildren<BlockItemWrapperProps>) => {\n const [isFlyoutOpen, setIsFlyoutOpen] = useState(shouldBeShown);\n const [isFlyoutDisabled, setIsFlyoutDisabled] = useState(false);\n const wrapperRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n if (!isFlyoutOpen) {\n // This prevents automatic refocusing of the trigger element\n setIsFlyoutDisabled(true);\n }\n }, [isFlyoutOpen]);\n\n if (shouldHideWrapper) {\n return children;\n }\n\n const items = toolbarItems?.filter((item): item is ToolbarItem => item !== undefined);\n\n return (\n <div\n ref={wrapperRef}\n onFocus={() => setIsFlyoutDisabled(false)}\n onPointerEnter={() => setIsFlyoutDisabled(false)}\n data-test-id=\"block-item-wrapper\"\n style={{\n outlineOffset,\n }}\n className={joinClassNames([\n 'tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse',\n shouldFillContainer && 'tw-flex-1 tw-h-full tw-w-full',\n 'hover:tw-outline focus-within:tw-outline',\n (isFlyoutOpen || shouldBeShown) && 'tw-outline',\n shouldHideComponent && 'tw-opacity-0',\n ])}\n >\n <div\n style={{\n right: -1 - outlineOffset,\n bottom: `calc(100% - ${2 + outlineOffset}px)`,\n }}\n className={joinClassNames([\n 'tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-10',\n 'group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100',\n (isFlyoutOpen || shouldBeShown) && 'tw-opacity-100',\n ])}\n >\n <Toolbar\n isFlyoutOpen={isFlyoutOpen}\n isFlyoutDisabled={isFlyoutDisabled}\n setIsFlyoutOpen={setIsFlyoutOpen}\n flyoutItems={toolbarFlyoutItems}\n items={items}\n isDragging={isDragging}\n />\n </div>\n {children}\n </div>\n );\n};\n"],"names":["BlockItemWrapper","children","toolbarFlyoutItems","toolbarItems","shouldHideWrapper","shouldHideComponent","isDragging","shouldFillContainer","outlineOffset","shouldBeShown","isFlyoutOpen","setIsFlyoutOpen","useState","isFlyoutDisabled","setIsFlyoutDisabled","wrapperRef","useRef","useEffect","items","item","jsxs","joinClassNames","jsx","Toolbar"],"mappings":";;;;AAOO,MAAMA,IAAmB,CAAC;AAAA,EAC7B,UAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,cAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,YAAAC;AAAA,EACA,qBAAAC;AAAA,EACA,eAAAC,IAAgB;AAAA,EAChB,eAAAC,IAAgB;AACpB,MAAgD;AAC5C,QAAM,CAACC,GAAcC,CAAe,IAAIC,WAASH,CAAa,GACxD,CAACI,GAAkBC,CAAmB,IAAIF,WAAS,EAAK,GACxDG,IAAaC,SAAuB,IAAI;AAS9C,MAPAC,EAAAA,UAAU,MAAM;AACZ,IAAKP,KAEDI,EAAoB,EAAI;AAAA,EAC5B,GACD,CAACJ,CAAY,CAAC,GAEbN;AACO,WAAAH;AAGX,QAAMiB,IAAQf,KAAA,gBAAAA,EAAc,OAAO,CAACgB,MAA8BA,MAAS;AAGvE,SAAAC,gBAAAA,EAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACG,KAAKL;AAAA,MACL,SAAS,MAAMD,EAAoB,EAAK;AAAA,MACxC,gBAAgB,MAAMA,EAAoB,EAAK;AAAA,MAC/C,gBAAa;AAAA,MACb,OAAO;AAAA,QACH,eAAAN;AAAA,MACJ;AAAA,MACA,WAAWa,EAAe;AAAA,QACtB;AAAA,QACAd,KAAuB;AAAA,QACvB;AAAA,SACCG,KAAgBD,MAAkB;AAAA,QACnCJ,KAAuB;AAAA,MAAA,CAC1B;AAAA,MAED,UAAA;AAAA,QAAAiB,gBAAAA,EAAA;AAAA,UAAC;AAAA,UAAA;AAAA,YACG,OAAO;AAAA,cACH,OAAO,KAAKd;AAAA,cACZ,QAAQ,eAAe,IAAIA;AAAA,YAC/B;AAAA,YACA,WAAWa,EAAe;AAAA,cACtB;AAAA,cACA;AAAA,eACCX,KAAgBD,MAAkB;AAAA,YAAA,CACtC;AAAA,YAED,UAAAa,gBAAAA,EAAA;AAAA,cAACC;AAAA,cAAA;AAAA,gBACG,cAAAb;AAAA,gBACA,kBAAAG;AAAA,gBACA,iBAAAF;AAAA,gBACA,aAAaT;AAAA,gBACb,OAAAgB;AAAA,gBACA,YAAAZ;AAAA,cAAA;AAAA,YACJ;AAAA,UAAA;AAAA,QACJ;AAAA,QACCL;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGb;"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { j as e } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { Tooltip as i, TooltipPosition as n, Flyout as p, IconDotsHorizontal16 as x, ActionMenu as h, MenuItemContentSize as m } from "@frontify/fondue";
|
|
3
|
+
import { DEFAULT_DRAGGING_TOOLTIP as u, DEFAULT_DRAG_TOOLTIP as f } from "./constants.es.js";
|
|
4
|
+
import { joinClassNames as j } from "../../utilities/react/joinClassNames.es.js";
|
|
5
|
+
const k = ({
|
|
6
|
+
items: w,
|
|
7
|
+
flyoutItems: l,
|
|
8
|
+
isFlyoutOpen: c,
|
|
9
|
+
setIsFlyoutOpen: a,
|
|
10
|
+
isDragging: r,
|
|
11
|
+
isFlyoutDisabled: d
|
|
12
|
+
}) => /* @__PURE__ */ e.jsx("div", { "data-test-id": "block-item-wrapper-toolbar", className: "tw-flex tw-justify-end", children: /* @__PURE__ */ e.jsxs("div", { className: "tw-bg-white tw-text-box-selected-inverse tw-pointer-events-auto tw-flex tw-flex-shrink-0 tw-gap-[2px] tw-px-[1px] tw-spacing tw-items-center tw-h-7 tw-self-start tw-border tw-border-box-selected-inverse tw-rounded", children: [
|
|
13
|
+
w.map(
|
|
14
|
+
(t, o) => "draggableProps" in t ? /* @__PURE__ */ e.jsx(
|
|
15
|
+
i,
|
|
16
|
+
{
|
|
17
|
+
withArrow: !0,
|
|
18
|
+
hoverDelay: 0,
|
|
19
|
+
enterDelay: 300,
|
|
20
|
+
open: r,
|
|
21
|
+
position: n.Top,
|
|
22
|
+
content: /* @__PURE__ */ e.jsx("div", { children: r ? u : t.tooltip ?? f }),
|
|
23
|
+
triggerElement: /* @__PURE__ */ e.jsx(
|
|
24
|
+
"button",
|
|
25
|
+
{
|
|
26
|
+
ref: t.setActivatorNodeRef,
|
|
27
|
+
"data-test-id": "block-item-wrapper-toolbar-btn",
|
|
28
|
+
...t.draggableProps,
|
|
29
|
+
className: j([
|
|
30
|
+
"tw-bg-base tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm",
|
|
31
|
+
r ? "tw-cursor-grabbing tw-bg-box-selected-pressed" : "tw-cursor-grab hover:tw-bg-box-selected-hover"
|
|
32
|
+
]),
|
|
33
|
+
children: t.icon
|
|
34
|
+
}
|
|
35
|
+
)
|
|
36
|
+
},
|
|
37
|
+
o
|
|
38
|
+
) : /* @__PURE__ */ e.jsx(
|
|
39
|
+
i,
|
|
40
|
+
{
|
|
41
|
+
withArrow: !0,
|
|
42
|
+
enterDelay: 300,
|
|
43
|
+
hoverDelay: 0,
|
|
44
|
+
disabled: r,
|
|
45
|
+
position: n.Top,
|
|
46
|
+
content: /* @__PURE__ */ e.jsx("div", { children: t.tooltip ?? "" }),
|
|
47
|
+
triggerElement: /* @__PURE__ */ e.jsx(
|
|
48
|
+
"button",
|
|
49
|
+
{
|
|
50
|
+
"data-test-id": "block-item-wrapper-toolbar-btn",
|
|
51
|
+
onClick: t.onClick,
|
|
52
|
+
className: "tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm",
|
|
53
|
+
children: t.icon
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
},
|
|
57
|
+
o
|
|
58
|
+
)
|
|
59
|
+
),
|
|
60
|
+
l.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6", children: /* @__PURE__ */ e.jsx(
|
|
61
|
+
p,
|
|
62
|
+
{
|
|
63
|
+
isOpen: c && !r,
|
|
64
|
+
isTriggerDisabled: d,
|
|
65
|
+
legacyFooter: !1,
|
|
66
|
+
fitContent: !0,
|
|
67
|
+
hug: !1,
|
|
68
|
+
onOpenChange: a,
|
|
69
|
+
trigger: /* @__PURE__ */ e.jsx(
|
|
70
|
+
i,
|
|
71
|
+
{
|
|
72
|
+
withArrow: !0,
|
|
73
|
+
hoverDelay: 0,
|
|
74
|
+
enterDelay: 300,
|
|
75
|
+
disabled: r,
|
|
76
|
+
position: n.Top,
|
|
77
|
+
content: /* @__PURE__ */ e.jsx("div", { children: "Options" }),
|
|
78
|
+
triggerElement: /* @__PURE__ */ e.jsx(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
"data-test-id": "block-item-wrapper-toolbar-flyout",
|
|
82
|
+
className: "tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm",
|
|
83
|
+
children: /* @__PURE__ */ e.jsx(x, {})
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
}
|
|
87
|
+
),
|
|
88
|
+
children: /* @__PURE__ */ e.jsx(
|
|
89
|
+
h,
|
|
90
|
+
{
|
|
91
|
+
menuBlocks: l.map((t, o) => ({
|
|
92
|
+
id: o.toString(),
|
|
93
|
+
menuItems: t.map((s, b) => ({
|
|
94
|
+
id: o.toString() + b.toString(),
|
|
95
|
+
size: m.XSmall,
|
|
96
|
+
title: s.title,
|
|
97
|
+
style: s.style,
|
|
98
|
+
onClick: () => {
|
|
99
|
+
a(!1), s.onClick();
|
|
100
|
+
},
|
|
101
|
+
initialValue: !0,
|
|
102
|
+
decorator: /* @__PURE__ */ e.jsx("div", { className: "tw-mr-2", children: s.icon })
|
|
103
|
+
}))
|
|
104
|
+
}))
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
) })
|
|
109
|
+
] }) });
|
|
110
|
+
export {
|
|
111
|
+
k as Toolbar
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=Toolbar.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.es.js","sources":["../../../src/components/BlockItemWrapper/Toolbar.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport {\n ActionMenu,\n Flyout,\n IconDotsHorizontal16,\n MenuItemContentSize,\n Tooltip,\n TooltipPosition,\n} from '@frontify/fondue';\nimport { ToolbarProps } from './types';\nimport { joinClassNames } from '../../utilities';\nimport { DEFAULT_DRAGGING_TOOLTIP, DEFAULT_DRAG_TOOLTIP } from './constants';\n\nexport const Toolbar = ({\n items,\n flyoutItems,\n isFlyoutOpen,\n setIsFlyoutOpen,\n isDragging,\n isFlyoutDisabled,\n}: ToolbarProps) => {\n return (\n <div data-test-id=\"block-item-wrapper-toolbar\" className=\"tw-flex tw-justify-end\">\n <div className=\"tw-bg-white tw-text-box-selected-inverse tw-pointer-events-auto tw-flex tw-flex-shrink-0 tw-gap-[2px] tw-px-[1px] tw-spacing tw-items-center tw-h-7 tw-self-start tw-border tw-border-box-selected-inverse tw-rounded\">\n {items.map((item, i) =>\n 'draggableProps' in item ? (\n <Tooltip\n key={i}\n withArrow\n hoverDelay={0}\n enterDelay={300}\n open={isDragging}\n position={TooltipPosition.Top}\n content={\n <div>\n {isDragging ? DEFAULT_DRAGGING_TOOLTIP : item.tooltip ?? DEFAULT_DRAG_TOOLTIP}\n </div>\n }\n triggerElement={\n <button\n ref={item.setActivatorNodeRef}\n data-test-id=\"block-item-wrapper-toolbar-btn\"\n {...item.draggableProps}\n className={joinClassNames([\n 'tw-bg-base tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm',\n isDragging\n ? 'tw-cursor-grabbing tw-bg-box-selected-pressed'\n : 'tw-cursor-grab hover:tw-bg-box-selected-hover',\n ])}\n >\n {item.icon}\n </button>\n }\n />\n ) : (\n <Tooltip\n key={i}\n withArrow\n enterDelay={300}\n hoverDelay={0}\n disabled={isDragging}\n position={TooltipPosition.Top}\n content={<div>{item.tooltip ?? ''}</div>}\n triggerElement={\n <button\n data-test-id=\"block-item-wrapper-toolbar-btn\"\n onClick={item.onClick}\n className=\"tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm\"\n >\n {item.icon}\n </button>\n }\n />\n )\n )}\n {flyoutItems.length > 0 && (\n <div className=\"tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6\">\n <Flyout\n isOpen={isFlyoutOpen && !isDragging}\n isTriggerDisabled={isFlyoutDisabled}\n legacyFooter={false}\n fitContent\n hug={false}\n onOpenChange={setIsFlyoutOpen}\n trigger={\n <Tooltip\n withArrow\n hoverDelay={0}\n enterDelay={300}\n disabled={isDragging}\n position={TooltipPosition.Top}\n content={<div>Options</div>}\n triggerElement={\n <div\n data-test-id=\"block-item-wrapper-toolbar-flyout\"\n className=\"tw-bg-base hover:tw-bg-box-selected-hover active:tw-bg-box-selected-pressed tw-cursor-pointer tw-inline-flex tw-items-center tw-justify-center tw-w-6 tw-h-6 tw-rounded-sm\"\n >\n <IconDotsHorizontal16 />\n </div>\n }\n />\n }\n >\n <ActionMenu\n menuBlocks={flyoutItems.map((block, blockIndex) => ({\n id: blockIndex.toString(),\n menuItems: block.map((item, itemIndex) => ({\n id: blockIndex.toString() + itemIndex.toString(),\n size: MenuItemContentSize.XSmall,\n title: item.title,\n style: item.style,\n onClick: () => {\n setIsFlyoutOpen(false);\n item.onClick();\n },\n initialValue: true,\n decorator: <div className=\"tw-mr-2\">{item.icon}</div>,\n })),\n }))}\n />\n </Flyout>\n </div>\n )}\n </div>\n </div>\n );\n};\n"],"names":["Toolbar","items","flyoutItems","isFlyoutOpen","setIsFlyoutOpen","isDragging","isFlyoutDisabled","jsx","jsxs","item","i","Tooltip","TooltipPosition","DEFAULT_DRAGGING_TOOLTIP","DEFAULT_DRAG_TOOLTIP","joinClassNames","Flyout","IconDotsHorizontal16","ActionMenu","block","blockIndex","itemIndex","MenuItemContentSize"],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.es.js","sources":["../../../src/components/BlockItemWrapper/constants.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const DEFAULT_DRAG_TOOLTIP = 'Drag or press ↵ to move';\nexport const DEFAULT_DRAGGING_TOOLTIP = 'Move with ↑↓←→ and confirm with ↵';\n"],"names":["DEFAULT_DRAG_TOOLTIP","DEFAULT_DRAGGING_TOOLTIP"],"mappings":"AAEO,MAAMA,IAAuB,2BACvBC,IAA2B;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { j as t } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { useFocusRing as s } from "@react-aria/focus";
|
|
3
|
+
import { Tooltip as i, TooltipPosition as l, FOCUS_STYLE as a, IconArrowCircleDown16 as w } from "@frontify/fondue";
|
|
4
|
+
import { joinClassNames as u } from "../../utilities/react/joinClassNames.es.js";
|
|
5
|
+
const m = ({ onDownload: o }) => {
|
|
6
|
+
const { isFocused: e, focusProps: n } = s();
|
|
7
|
+
return /* @__PURE__ */ t.jsx(
|
|
8
|
+
i,
|
|
9
|
+
{
|
|
10
|
+
withArrow: !0,
|
|
11
|
+
position: l.Top,
|
|
12
|
+
content: "Download",
|
|
13
|
+
enterDelay: 500,
|
|
14
|
+
triggerElement: /* @__PURE__ */ t.jsx(
|
|
15
|
+
"button",
|
|
16
|
+
{
|
|
17
|
+
tabIndex: 0,
|
|
18
|
+
"aria-label": "Download",
|
|
19
|
+
...n,
|
|
20
|
+
className: u(["tw-outline-none tw-rounded", e && a]),
|
|
21
|
+
onClick: o,
|
|
22
|
+
onPointerDown: (r) => r.preventDefault(),
|
|
23
|
+
children: /* @__PURE__ */ t.jsx(
|
|
24
|
+
"span",
|
|
25
|
+
{
|
|
26
|
+
"data-test-id": "download-button",
|
|
27
|
+
className: "tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line",
|
|
28
|
+
children: /* @__PURE__ */ t.jsx(w, {})
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
m as DownloadButton
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=DownloadButton.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DownloadButton.es.js","sources":["../../../src/components/DownloadButton/DownloadButton.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { DownloadButtonProps } from './types';\nimport { useFocusRing } from '@react-aria/focus';\nimport { FOCUS_STYLE, IconArrowCircleDown16, Tooltip, TooltipPosition } from '@frontify/fondue';\nimport { joinClassNames } from '../../utilities';\n\nexport const DownloadButton = ({ onDownload }: DownloadButtonProps) => {\n const { isFocused, focusProps } = useFocusRing();\n\n return (\n <Tooltip\n withArrow\n position={TooltipPosition.Top}\n content=\"Download\"\n enterDelay={500}\n triggerElement={\n <button\n tabIndex={0}\n aria-label=\"Download\"\n {...focusProps}\n className={joinClassNames(['tw-outline-none tw-rounded', isFocused && FOCUS_STYLE])}\n onClick={onDownload}\n onPointerDown={(e) => e.preventDefault()}\n >\n <span\n data-test-id=\"download-button\"\n className=\"tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-bg-box-neutral-strong-inverse hover:tw-bg-box-neutral-strong-inverse-hover active:tw-bg-box-neutral-strong-inverse-pressed tw-text-box-neutral-strong tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line\"\n >\n <IconArrowCircleDown16 />\n </span>\n </button>\n }\n />\n );\n};\n"],"names":["DownloadButton","onDownload","isFocused","focusProps","useFocusRing","jsx","Tooltip","TooltipPosition","joinClassNames","FOCUS_STYLE","e","IconArrowCircleDown16"],"mappings":";;;;AAOO,MAAMA,IAAiB,CAAC,EAAE,YAAAC,QAAsC;AACnE,QAAM,EAAE,WAAAC,GAAW,YAAAC,EAAW,IAAIC,EAAa;AAG3C,SAAAC,gBAAAA,EAAA;AAAA,IAACC;AAAA,IAAA;AAAA,MACG,WAAS;AAAA,MACT,UAAUC,EAAgB;AAAA,MAC1B,SAAQ;AAAA,MACR,YAAY;AAAA,MACZ,gBACIF,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACG,UAAU;AAAA,UACV,cAAW;AAAA,UACV,GAAGF;AAAA,UACJ,WAAWK,EAAe,CAAC,8BAA8BN,KAAaO,CAAW,CAAC;AAAA,UAClF,SAASR;AAAA,UACT,eAAe,CAACS,MAAMA,EAAE,eAAe;AAAA,UAEvC,UAAAL,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACG,gBAAa;AAAA,cACb,WAAU;AAAA,cAEV,gCAACM,GAAsB,EAAA;AAAA,YAAA;AAAA,UAC3B;AAAA,QAAA;AAAA,MACJ;AAAA,IAAA;AAAA,EAAA;AAIhB;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { j as i } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { r as d } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.es.js";
|
|
3
|
+
import { RichTextEditor as h } from "@frontify/fondue";
|
|
4
|
+
import { SerializedText as E } from "./SerializedText.es.js";
|
|
5
|
+
import { floatingButtonSelectors as g, floatingButtonActions as v } from "./plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js";
|
|
6
|
+
const R = ({
|
|
7
|
+
id: f = "rte",
|
|
8
|
+
isEditing: l,
|
|
9
|
+
value: t,
|
|
10
|
+
columns: u,
|
|
11
|
+
gap: c,
|
|
12
|
+
placeholder: m,
|
|
13
|
+
plugins: r,
|
|
14
|
+
onTextChange: o,
|
|
15
|
+
showSerializedText: x
|
|
16
|
+
}) => {
|
|
17
|
+
const [n, s] = d.useState(!1), p = (e) => {
|
|
18
|
+
o && e !== t && o(e), s(!1);
|
|
19
|
+
};
|
|
20
|
+
return d.useEffect(() => {
|
|
21
|
+
const e = (a) => (a.preventDefault(), a.returnValue = "Unprocessed changes");
|
|
22
|
+
return n && window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
|
|
23
|
+
}, [n]), l ? /* @__PURE__ */ i.jsx(
|
|
24
|
+
h,
|
|
25
|
+
{
|
|
26
|
+
id: f,
|
|
27
|
+
value: t,
|
|
28
|
+
border: !1,
|
|
29
|
+
placeholder: m,
|
|
30
|
+
plugins: r,
|
|
31
|
+
onValueChanged: () => s(!0),
|
|
32
|
+
onTextChange: p,
|
|
33
|
+
hideExternalFloatingModals: (e) => {
|
|
34
|
+
g.isOpen(e) && v.reset();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
) : /* @__PURE__ */ i.jsx(E, { value: t, columns: u, gap: c, show: x, plugins: r });
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
R as RichTextEditor
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=RichTextEditor.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RichTextEditor.es.js","sources":["../../../src/components/RichTextEditor/RichTextEditor.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useState } from 'react';\n\nimport { RichTextEditor as FondueRichTextEditor } from '@frontify/fondue';\nimport { RichTextEditorProps } from './types';\nimport { SerializedText } from './SerializedText';\nimport { floatingButtonActions, floatingButtonSelectors } from './plugins/ButtonPlugin/components';\n\nexport const RichTextEditor = ({\n id = 'rte',\n isEditing,\n value,\n columns,\n gap,\n placeholder,\n plugins,\n onTextChange,\n showSerializedText,\n}: RichTextEditorProps) => {\n const [shouldPreventPageLeave, setShouldPreventPageLeave] = useState(false);\n\n const saveText = (newContent: string) => {\n if (onTextChange && newContent !== value) {\n onTextChange(newContent);\n }\n setShouldPreventPageLeave(false);\n };\n\n useEffect(() => {\n const unloadHandler = (event: BeforeUnloadEvent) => {\n event.preventDefault();\n return (event.returnValue = 'Unprocessed changes');\n };\n\n if (shouldPreventPageLeave) {\n window.addEventListener('beforeunload', unloadHandler);\n }\n\n return () => window.removeEventListener('beforeunload', unloadHandler);\n }, [shouldPreventPageLeave]);\n\n if (isEditing) {\n return (\n <FondueRichTextEditor\n id={id}\n value={value}\n border={false}\n placeholder={placeholder}\n plugins={plugins}\n onValueChanged={() => setShouldPreventPageLeave(true)}\n onTextChange={saveText}\n hideExternalFloatingModals={(editorId: string) => {\n if (floatingButtonSelectors.isOpen(editorId)) {\n floatingButtonActions.reset();\n }\n }}\n />\n );\n }\n return <SerializedText value={value} columns={columns} gap={gap} show={showSerializedText} plugins={plugins} />;\n};\n"],"names":["RichTextEditor","id","isEditing","value","columns","gap","placeholder","plugins","onTextChange","showSerializedText","shouldPreventPageLeave","setShouldPreventPageLeave","useState","saveText","newContent","useEffect","unloadHandler","event","jsx","FondueRichTextEditor","editorId","floatingButtonSelectors","floatingButtonActions","SerializedText"],"mappings":";;;;;AASO,MAAMA,IAAiB,CAAC;AAAA,EAC3B,IAAAC,IAAK;AAAA,EACL,WAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC;AAAA,EACA,KAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,cAAAC;AAAA,EACA,oBAAAC;AACJ,MAA2B;AACvB,QAAM,CAACC,GAAwBC,CAAyB,IAAIC,WAAS,EAAK,GAEpEC,IAAW,CAACC,MAAuB;AACjC,IAAAN,KAAgBM,MAAeX,KAC/BK,EAAaM,CAAU,GAE3BH,EAA0B,EAAK;AAAA,EAAA;AAgBnC,SAbAI,EAAAA,UAAU,MAAM;AACN,UAAAC,IAAgB,CAACC,OACnBA,EAAM,eAAe,GACbA,EAAM,cAAc;AAGhC,WAAIP,KACO,OAAA,iBAAiB,gBAAgBM,CAAa,GAGlD,MAAM,OAAO,oBAAoB,gBAAgBA,CAAa;AAAA,EAAA,GACtE,CAACN,CAAsB,CAAC,GAEvBR,IAEIgB,gBAAAA,EAAA;AAAA,IAACC;AAAAA,IAAA;AAAA,MACG,IAAAlB;AAAA,MACA,OAAAE;AAAA,MACA,QAAQ;AAAA,MACR,aAAAG;AAAA,MACA,SAAAC;AAAA,MACA,gBAAgB,MAAMI,EAA0B,EAAI;AAAA,MACpD,cAAcE;AAAA,MACd,4BAA4B,CAACO,MAAqB;AAC1C,QAAAC,EAAwB,OAAOD,CAAQ,KACvCE,EAAsB,MAAM;AAAA,MAEpC;AAAA,IAAA;AAAA,EAAA,0BAIJC,GAAe,EAAA,OAAApB,GAAc,SAAAC,GAAkB,KAAAC,GAAU,MAAMI,GAAoB,SAAAF,EAAkB,CAAA;AACjH;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { j as a } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.es.js";
|
|
2
|
+
import { r as m } from "../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.es.js";
|
|
3
|
+
import { serializeRawToHtmlAsync as o } from "./serializer/serializeToHtml.es.js";
|
|
4
|
+
const c = ({ value: e = "", gap: r, columns: s, show: n = !0, plugins: l }) => {
|
|
5
|
+
const [t, i] = m.useState(null);
|
|
6
|
+
return m.useEffect(() => {
|
|
7
|
+
(async () => i(await o(e, s, r, l)))();
|
|
8
|
+
}, [e, s, r, l]), !n || t === "<br />" ? null : t !== null ? /* @__PURE__ */ a.jsx("div", { className: "tw-w-full", "data-test-id": "rte-content-html", dangerouslySetInnerHTML: { __html: t } }) : /* @__PURE__ */ a.jsx("div", { className: "tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full" });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
c as SerializedText
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=SerializedText.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SerializedText.es.js","sources":["../../../src/components/RichTextEditor/SerializedText.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { useEffect, useState } from 'react';\nimport { SerializedTextProps } from './types';\nimport { serializeRawToHtmlAsync } from './serializer';\n\nexport const SerializedText = ({ value = '', gap, columns, show = true, plugins }: SerializedTextProps) => {\n const [html, setHtml] = useState<string | null>(null);\n\n useEffect(() => {\n (async () => {\n setHtml(await serializeRawToHtmlAsync(value, columns, gap, plugins));\n })();\n }, [value, columns, gap, plugins]);\n\n if (!show || html === '<br />') {\n return null;\n }\n\n return html !== null ? (\n <div className=\"tw-w-full\" data-test-id=\"rte-content-html\" dangerouslySetInnerHTML={{ __html: html }} />\n ) : (\n <div className=\"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full\" />\n );\n};\n"],"names":["SerializedText","value","gap","columns","show","plugins","html","setHtml","useState","useEffect","serializeRawToHtmlAsync","jsx"],"mappings":";;;AAMa,MAAAA,IAAiB,CAAC,EAAE,OAAAC,IAAQ,IAAI,KAAAC,GAAK,SAAAC,GAAS,MAAAC,IAAO,IAAM,SAAAC,QAAmC;AACvG,QAAM,CAACC,GAAMC,CAAO,IAAIC,WAAwB,IAAI;AAQhD,SANJC,EAAAA,UAAU,MAAM;AACZ,KAAC,YACGF,EAAQ,MAAMG,EAAwBT,GAAOE,GAASD,GAAKG,CAAO,CAAC;AAAA,KAExE,CAACJ,GAAOE,GAASD,GAAKG,CAAO,CAAC,GAE7B,CAACD,KAAQE,MAAS,WACX,OAGJA,MAAS,OACZK,gBAAAA,MAAC,OAAI,EAAA,WAAU,aAAY,gBAAa,oBAAmB,yBAAyB,EAAE,QAAQL,EAAK,EAAA,CAAG,IAErGK,gBAAAA,EAAAA,IAAA,OAAA,EAAI,WAAU,oFAAoF,CAAA;AAE3G;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.es.js","sources":["../../../src/components/RichTextEditor/constants.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nexport const THEME_PREFIX = '--f-theme-settings-';\n"],"names":["THEME_PREFIX"],"mappings":"AAEO,MAAMA,IAAe;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { PluginComposer as i, SoftBreakPlugin as t, TextStylePlugin as l, BoldPlugin as g, ItalicPlugin as u, UnderlinePlugin as o, StrikethroughPlugin as r, CodePlugin as P, AlignLeftPlugin as s, AlignCenterPlugin as w, AlignRightPlugin as m, AlignJustifyPlugin as d, UnorderedListPlugin as a, CheckboxListPlugin as y, OrderedListPlugin as f, ResetFormattingPlugin as h } from "@frontify/fondue";
|
|
2
|
+
import { TextStylePluginsWithoutImage as p, TextStylesWithoutImage as e } from "../plugins/TextStylePlugins/helpers.es.js";
|
|
3
|
+
import { LinkPlugin as T } from "../plugins/LinkPlugin/index.es.js";
|
|
4
|
+
import { ButtonPlugin as x } from "../plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
5
|
+
const v = (n) => new i().setPlugin(
|
|
6
|
+
new t(),
|
|
7
|
+
new l({
|
|
8
|
+
textStyles: p
|
|
9
|
+
})
|
|
10
|
+
).setPlugin(
|
|
11
|
+
[
|
|
12
|
+
new g(),
|
|
13
|
+
new u(),
|
|
14
|
+
new o(),
|
|
15
|
+
new r(),
|
|
16
|
+
new T({ appBridge: n }),
|
|
17
|
+
new x({ appBridge: n }),
|
|
18
|
+
new P()
|
|
19
|
+
],
|
|
20
|
+
[
|
|
21
|
+
new s({ validTypes: e }),
|
|
22
|
+
new w({ validTypes: e }),
|
|
23
|
+
new m({ validTypes: e }),
|
|
24
|
+
new d({ validTypes: e }),
|
|
25
|
+
new a(),
|
|
26
|
+
new y(),
|
|
27
|
+
new f(),
|
|
28
|
+
new h()
|
|
29
|
+
]
|
|
30
|
+
);
|
|
31
|
+
export {
|
|
32
|
+
v as getDefaultPluginsWithLinkChooser
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=defaultPluginsWithLinkChooser.es.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaultPluginsWithLinkChooser.es.js","sources":["../../../../src/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { AppBridgeBlock } from '@frontify/app-bridge';\nimport {\n AlignCenterPlugin,\n AlignJustifyPlugin,\n AlignLeftPlugin,\n AlignRightPlugin,\n BoldPlugin,\n CheckboxListPlugin,\n CodePlugin,\n ItalicPlugin,\n OrderedListPlugin,\n PluginComposer,\n ResetFormattingPlugin,\n SoftBreakPlugin,\n StrikethroughPlugin,\n TextStylePlugin,\n UnderlinePlugin,\n UnorderedListPlugin,\n} from '@frontify/fondue';\nimport { ButtonPlugin, LinkPlugin, TextStylePluginsWithoutImage, TextStylesWithoutImage } from '../plugins';\n\nexport const getDefaultPluginsWithLinkChooser = (appBridge: AppBridgeBlock) => {\n return new PluginComposer()\n .setPlugin(\n new SoftBreakPlugin(),\n new TextStylePlugin({\n textStyles: TextStylePluginsWithoutImage,\n })\n )\n .setPlugin(\n [\n new BoldPlugin(),\n new ItalicPlugin(),\n new UnderlinePlugin(),\n new StrikethroughPlugin(),\n new LinkPlugin({ appBridge }),\n new ButtonPlugin({ appBridge }),\n new CodePlugin(),\n ],\n [\n new AlignLeftPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignCenterPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignRightPlugin({ validTypes: TextStylesWithoutImage }),\n new AlignJustifyPlugin({ validTypes: TextStylesWithoutImage }),\n new UnorderedListPlugin(),\n new CheckboxListPlugin(),\n new OrderedListPlugin(),\n new ResetFormattingPlugin(),\n ]\n );\n};\n"],"names":["getDefaultPluginsWithLinkChooser","appBridge","PluginComposer","SoftBreakPlugin","TextStylePlugin","TextStylePluginsWithoutImage","BoldPlugin","ItalicPlugin","UnderlinePlugin","StrikethroughPlugin","LinkPlugin","ButtonPlugin","CodePlugin","AlignLeftPlugin","TextStylesWithoutImage","AlignCenterPlugin","AlignRightPlugin","AlignJustifyPlugin","UnorderedListPlugin","CheckboxListPlugin","OrderedListPlugin","ResetFormattingPlugin"],"mappings":";;;;AAuBa,MAAAA,IAAmC,CAACC,MACtC,IAAIC,IACN;AAAA,EACG,IAAIC,EAAgB;AAAA,EACpB,IAAIC,EAAgB;AAAA,IAChB,YAAYC;AAAA,EAAA,CACf;AAAA,EAEJ;AAAA,EACG;AAAA,IACI,IAAIC,EAAW;AAAA,IACf,IAAIC,EAAa;AAAA,IACjB,IAAIC,EAAgB;AAAA,IACpB,IAAIC,EAAoB;AAAA,IACxB,IAAIC,EAAW,EAAE,WAAAT,GAAW;AAAA,IAC5B,IAAIU,EAAa,EAAE,WAAAV,GAAW;AAAA,IAC9B,IAAIW,EAAW;AAAA,EACnB;AAAA,EACA;AAAA,IACI,IAAIC,EAAgB,EAAE,YAAYC,GAAwB;AAAA,IAC1D,IAAIC,EAAkB,EAAE,YAAYD,GAAwB;AAAA,IAC5D,IAAIE,EAAiB,EAAE,YAAYF,GAAwB;AAAA,IAC3D,IAAIG,EAAmB,EAAE,YAAYH,GAAwB;AAAA,IAC7D,IAAII,EAAoB;AAAA,IACxB,IAAIC,EAAmB;AAAA,IACvB,IAAIC,EAAkB;AAAA,IACtB,IAAIC,EAAsB;AAAA,EAC9B;AAAA;"}
|