@frontify/guideline-blocks-settings 0.33.1 → 0.33.3
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/{.eslintrc.js → .eslintrc.cjs} +5 -0
- package/CHANGELOG.md +20 -0
- package/package.json +47 -47
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.spec.tsx +1 -1
- package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.tsx +1 -1
- package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.spec.tsx +2 -2
- package/src/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.spec.tsx +1 -1
- package/src/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.ts +1 -1
- package/tsconfig.json +17 -20
- package/tsconfig.node.json +12 -0
- package/dist/components/Attachments/AttachmentItem.es.js +0 -174
- package/dist/components/Attachments/AttachmentItem.es.js.map +0 -1
- package/dist/components/Attachments/Attachments.es.js +0 -160
- package/dist/components/Attachments/Attachments.es.js.map +0 -1
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js +0 -29
- package/dist/components/Attachments/AttachmentsButtonTrigger.es.js.map +0 -1
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js +0 -150
- package/dist/components/BlockInjectButton/BlockInjectButton.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js +0 -71
- package/dist/components/BlockItemWrapper/BlockItemWrapper.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js +0 -33
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js +0 -26
- package/dist/components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButtonTrigger.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js +0 -28
- package/dist/components/BlockItemWrapper/Toolbar/BaseToolbarButton.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js +0 -35
- package/dist/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js +0 -44
- package/dist/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js +0 -25
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js +0 -29
- package/dist/components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js +0 -22
- package/dist/components/BlockItemWrapper/Toolbar/Toolbar.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js +0 -12
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButton/ToolbarButton.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js +0 -20
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarButtonTooltip.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js +0 -6
- package/dist/components/BlockItemWrapper/Toolbar/ToolbarSegment.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js +0 -11
- package/dist/components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js +0 -18
- package/dist/components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js +0 -26
- package/dist/components/BlockItemWrapper/Toolbar/helpers.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js +0 -18
- package/dist/components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js.map +0 -1
- package/dist/components/BlockItemWrapper/constants.es.js +0 -6
- package/dist/components/BlockItemWrapper/constants.es.js.map +0 -1
- package/dist/components/DownloadButton/DownloadButton.es.js +0 -39
- package/dist/components/DownloadButton/DownloadButton.es.js.map +0 -1
- package/dist/components/Link/LinkInput.es.js +0 -63
- package/dist/components/Link/LinkInput.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/DocumentLink.es.js +0 -68
- package/dist/components/Link/LinkSelector/DocumentLink.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js +0 -60
- package/dist/components/Link/LinkSelector/DocumentLinks.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/LinkSelector.es.js +0 -78
- package/dist/components/Link/LinkSelector/LinkSelector.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js +0 -7
- package/dist/components/Link/LinkSelector/LoadingIndicator.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/PageLink.es.js +0 -70
- package/dist/components/Link/LinkSelector/PageLink.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/PageLinks.es.js +0 -38
- package/dist/components/Link/LinkSelector/PageLinks.es.js.map +0 -1
- package/dist/components/Link/LinkSelector/SectionLink.es.js +0 -25
- package/dist/components/Link/LinkSelector/SectionLink.es.js.map +0 -1
- package/dist/components/Link/utils/getUrl.es.js +0 -18
- package/dist/components/Link/utils/getUrl.es.js.map +0 -1
- package/dist/components/Link/utils/relativeUrlRegex.es.js +0 -5
- package/dist/components/Link/utils/relativeUrlRegex.es.js.map +0 -1
- package/dist/components/Link/utils/url.es.js +0 -17
- package/dist/components/Link/utils/url.es.js.map +0 -1
- package/dist/components/RichTextEditor/RichTextEditor.es.js +0 -42
- package/dist/components/RichTextEditor/RichTextEditor.es.js.map +0 -1
- package/dist/components/RichTextEditor/SerializedText.es.js +0 -20
- package/dist/components/RichTextEditor/SerializedText.es.js.map +0 -1
- package/dist/components/RichTextEditor/constants.es.js +0 -5
- package/dist/components/RichTextEditor/constants.es.js.map +0 -1
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js +0 -35
- package/dist/components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js +0 -54
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/ButtonMarkupElementNode.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js +0 -12
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/ButtonMarkupElement/index.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js +0 -17
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js +0 -30
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/ButtonToolbarButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js +0 -16
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/CustomFloatingButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js +0 -43
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/EditButtonModal/EditModal.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js +0 -25
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js +0 -20
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonEditButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js +0 -26
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/FloatingButtonUrlInput.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js +0 -69
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/InsertButtonModal.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js +0 -105
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/InsertButtonModal/useInsertModal.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js +0 -20
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/UnlinkButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js +0 -32
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/floatingButtonStore.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js +0 -58
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEdit.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js +0 -19
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEnter.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js +0 -26
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonEscape.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js +0 -43
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useFloatingButtonInsert.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js +0 -18
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/components/FloatingButton/useVirtualFloatingButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js +0 -62
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js +0 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js +0 -25
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js +0 -35
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js +0 -86
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js +0 -24
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js +0 -19
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js +0 -13
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js +0 -11
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getButtonStyle.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js +0 -10
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js +0 -81
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js +0 -18
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js +0 -17
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js +0 -14
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js +0 -53
- package/dist/components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js +0 -19
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/CustomFloatingLink.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js +0 -43
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/EditModal.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js +0 -53
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/EditLinkModal/useFloatingLinkEdit.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js +0 -29
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/FloatingLink.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js +0 -8
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertLinkModal.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js +0 -66
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/InsertModal.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js +0 -40
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useFloatingLinkInsert.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js +0 -93
- package/dist/components/RichTextEditor/plugins/LinkPlugin/FloatingLink/InsertLinkModal/useInsertModal.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js +0 -25
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkButton.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js +0 -27
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/LinkMarkupElementNode.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js +0 -12
- package/dist/components/RichTextEditor/plugins/LinkPlugin/LinkMarkupElement/index.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js +0 -5
- package/dist/components/RichTextEditor/plugins/LinkPlugin/id.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js +0 -39
- package/dist/components/RichTextEditor/plugins/LinkPlugin/index.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js +0 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js +0 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js +0 -46
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js +0 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js +0 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js +0 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js +0 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js +0 -40
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js +0 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js +0 -47
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js +0 -41
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js +0 -49
- package/dist/components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js.map +0 -1
- package/dist/components/RichTextEditor/plugins/styles.es.js +0 -167
- package/dist/components/RichTextEditor/plugins/styles.es.js.map +0 -1
- package/dist/helpers/addHttps.es.js +0 -14
- package/dist/helpers/addHttps.es.js.map +0 -1
- package/dist/helpers/convertToRichTextValue.es.js +0 -6
- package/dist/helpers/convertToRichTextValue.es.js.map +0 -1
- package/dist/helpers/customCoordinatesGetterFactory.es.js +0 -32
- package/dist/helpers/customCoordinatesGetterFactory.es.js.map +0 -1
- package/dist/helpers/hasRichTextValue.es.js +0 -15
- package/dist/helpers/hasRichTextValue.es.js.map +0 -1
- package/dist/helpers/isDownloadable.es.js +0 -6
- package/dist/helpers/isDownloadable.es.js.map +0 -1
- package/dist/helpers/mapColorPalettes.es.js +0 -28
- package/dist/helpers/mapColorPalettes.es.js.map +0 -1
- package/dist/hooks/useAttachments.es.js +0 -53
- package/dist/hooks/useAttachments.es.js.map +0 -1
- package/dist/hooks/useDndSensors.es.js +0 -20
- package/dist/hooks/useDndSensors.es.js.map +0 -1
- package/dist/index.cjs.js +0 -4
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -1191
- package/dist/index.es.js +0 -217
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -4
- package/dist/index.umd.js.map +0 -1
- package/dist/settings/background.es.js +0 -22
- package/dist/settings/background.es.js.map +0 -1
- package/dist/settings/border.es.js +0 -61
- package/dist/settings/border.es.js.map +0 -1
- package/dist/settings/borderRadius.es.js +0 -56
- package/dist/settings/borderRadius.es.js.map +0 -1
- package/dist/settings/borderRadiusExtended.es.js +0 -64
- package/dist/settings/borderRadiusExtended.es.js.map +0 -1
- package/dist/settings/defaultValues.es.js +0 -19
- package/dist/settings/defaultValues.es.js.map +0 -1
- package/dist/settings/gutter.es.js +0 -56
- package/dist/settings/gutter.es.js.map +0 -1
- package/dist/settings/margin.es.js +0 -53
- package/dist/settings/margin.es.js.map +0 -1
- package/dist/settings/marginExtended.es.js +0 -65
- package/dist/settings/marginExtended.es.js.map +0 -1
- package/dist/settings/padding.es.js +0 -53
- package/dist/settings/padding.es.js.map +0 -1
- package/dist/settings/paddingExtended.es.js +0 -65
- package/dist/settings/paddingExtended.es.js.map +0 -1
- package/dist/settings/securityDownloadable.es.js +0 -19
- package/dist/settings/securityDownloadable.es.js.map +0 -1
- package/dist/settings/securityGlobalControl.es.js +0 -33
- package/dist/settings/securityGlobalControl.es.js.map +0 -1
- package/dist/settings/types.es.js +0 -48
- package/dist/settings/types.es.js.map +0 -1
- package/dist/styles.css +0 -1
- package/dist/styles.css.es.js +0 -5
- package/dist/styles.css.es.js.map +0 -1
- package/dist/utilities/color/getReadableColor.es.js +0 -14
- package/dist/utilities/color/getReadableColor.es.js.map +0 -1
- package/dist/utilities/color/isDark.es.js +0 -10
- package/dist/utilities/color/isDark.es.js.map +0 -1
- package/dist/utilities/color/setAlpha.es.js +0 -6
- package/dist/utilities/color/setAlpha.es.js.map +0 -1
- package/dist/utilities/color/toColorObject.es.js +0 -9
- package/dist/utilities/color/toColorObject.es.js.map +0 -1
- package/dist/utilities/color/toHex8String.es.js +0 -7
- package/dist/utilities/color/toHex8String.es.js.map +0 -1
- package/dist/utilities/color/toHexString.es.js +0 -7
- package/dist/utilities/color/toHexString.es.js.map +0 -1
- package/dist/utilities/color/toRgbaString.es.js +0 -7
- package/dist/utilities/color/toRgbaString.es.js.map +0 -1
- package/dist/utilities/color/toShortRgba.es.js +0 -11
- package/dist/utilities/color/toShortRgba.es.js.map +0 -1
- package/dist/utilities/moveItemInArray.es.js +0 -12
- package/dist/utilities/moveItemInArray.es.js.map +0 -1
- package/dist/utilities/react/getBackgroundColorStyles.es.js +0 -8
- package/dist/utilities/react/getBackgroundColorStyles.es.js.map +0 -1
- package/dist/utilities/react/getBorderStyles.es.js +0 -12
- package/dist/utilities/react/getBorderStyles.es.js.map +0 -1
- package/dist/utilities/react/getRadiusStyles.es.js +0 -8
- package/dist/utilities/react/getRadiusStyles.es.js.map +0 -1
- package/dist/utilities/react/joinClassNames.es.js +0 -5
- package/dist/utilities/react/joinClassNames.es.js.map +0 -1
- /package/{postcss.config.js → postcss.config.cjs} +0 -0
- /package/{tailwind.config.js → tailwind.config.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @frontify/guideline-blocks-settings
|
|
2
2
|
|
|
3
|
+
## 0.33.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies
|
|
8
|
+
|
|
9
|
+
- [#776](https://github.com/Frontify/brand-sdk/pull/776) [`29ef8e1`](https://github.com/Frontify/brand-sdk/commit/29ef8e1e64a6372d580af06a86ef39ca2052662a) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Remove CJS to embrace ESM
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [[`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7), [`29ef8e1`](https://github.com/Frontify/brand-sdk/commit/29ef8e1e64a6372d580af06a86ef39ca2052662a), [`b0424c0`](https://github.com/Frontify/brand-sdk/commit/b0424c0a6dc1beef011c0d32124f53aed2e2a4b7)]:
|
|
12
|
+
- @frontify/sidebar-settings@0.9.4
|
|
13
|
+
|
|
14
|
+
## 0.33.2
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [#766](https://github.com/Frontify/brand-sdk/pull/766) [`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6) Thanks [@SamuelAlev](https://github.com/SamuelAlev)! - Update dependencies
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [[`3775b46`](https://github.com/Frontify/brand-sdk/commit/3775b4651b6d700e7179a360190a92e7f0fe51e6)]:
|
|
21
|
+
- @frontify/sidebar-settings@0.9.3
|
|
22
|
+
|
|
3
23
|
## 0.33.1
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,76 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/guideline-blocks-settings",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.33.3",
|
|
4
5
|
"description": "Provides types and helpers for the guideline block development",
|
|
5
|
-
"sideEffects": false,
|
|
6
|
-
"main": "dist/index.umd.js",
|
|
7
|
-
"unpkg": "dist/index.umd.js",
|
|
8
|
-
"jsdelivr": "dist/index.umd.js",
|
|
9
|
-
"module": "dist/index.es.js",
|
|
10
|
-
"types": "dist/index.d.ts",
|
|
11
6
|
"author": "Frontify Developers <developers@frontify.com>",
|
|
12
7
|
"repository": {
|
|
13
8
|
"type": "git",
|
|
14
9
|
"url": "https://github.com/Frontify/brand-sdk",
|
|
15
10
|
"directory": "packages/guideline-blocks-settings"
|
|
16
11
|
},
|
|
12
|
+
"sideEffects": false,
|
|
17
13
|
"exports": {
|
|
18
14
|
".": {
|
|
19
15
|
"types": "./dist/index.d.ts",
|
|
20
|
-
"
|
|
21
|
-
"
|
|
16
|
+
"require": "./dist/index.umd.js",
|
|
17
|
+
"import": "./dist/index.es.js"
|
|
22
18
|
},
|
|
23
19
|
"./styles": "./dist/styles.css"
|
|
24
20
|
},
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"@
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"@types/node": "^18.18.11",
|
|
32
|
-
"@types/react": "^18.2.38",
|
|
33
|
-
"@types/react-dom": "^18.2.16",
|
|
34
|
-
"@types/sinon": "^17.0.2",
|
|
35
|
-
"@vitejs/plugin-react": "^4.2.0",
|
|
36
|
-
"autoprefixer": "^10.4.16",
|
|
37
|
-
"cypress": "^13.5.1",
|
|
38
|
-
"cypress-real-events": "^1.11.0",
|
|
39
|
-
"eslint": "^8.54.0",
|
|
40
|
-
"eslint-plugin-notice": "^0.9.10",
|
|
41
|
-
"happy-dom": "^12.10.3",
|
|
42
|
-
"mitt": "^3.0.1",
|
|
43
|
-
"msw": "^1.3.2",
|
|
44
|
-
"postcss": "^8.4.31",
|
|
45
|
-
"prettier": "^3.1.0",
|
|
46
|
-
"react": "^18.2.0",
|
|
47
|
-
"react-dom": "^18.2.0",
|
|
48
|
-
"rollup": "^3.29.4",
|
|
49
|
-
"sinon": "17.0.1",
|
|
50
|
-
"tailwindcss": "^3.4.1",
|
|
51
|
-
"typescript": "^5.3.2",
|
|
52
|
-
"vite": "^4.5.0",
|
|
53
|
-
"vite-plugin-dts": "^3.6.3",
|
|
54
|
-
"vite-plugin-externals": "^0.6.2",
|
|
55
|
-
"vitest": "^0.34.6"
|
|
21
|
+
"main": "./dist/index.es.js",
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"@frontify/app-bridge": "^3.0.0 || ^4.0.0-alpha.0",
|
|
25
|
+
"react": "^18",
|
|
26
|
+
"react-dom": "^18"
|
|
56
27
|
},
|
|
57
28
|
"dependencies": {
|
|
58
|
-
"@ctrl/tinycolor": "^4.0.
|
|
29
|
+
"@ctrl/tinycolor": "^4.0.3",
|
|
59
30
|
"@dnd-kit/core": "^6.1.0",
|
|
60
31
|
"@dnd-kit/modifiers": "^7.0.0",
|
|
61
32
|
"@dnd-kit/sortable": "^8.0.0",
|
|
62
|
-
"@frontify/fondue": "12.0.0-beta.
|
|
33
|
+
"@frontify/fondue": "12.0.0-beta.404",
|
|
63
34
|
"@react-aria/focus": "^3.14.0",
|
|
64
35
|
"@react-stately/overlays": "^3.6.1",
|
|
65
36
|
"@udecode/plate": "^21.5.0",
|
|
66
37
|
"slate": "^0.94.1",
|
|
67
38
|
"slate-react": "^0.98.3",
|
|
68
|
-
"@frontify/sidebar-settings": "^0.9.
|
|
39
|
+
"@frontify/sidebar-settings": "^0.9.4"
|
|
69
40
|
},
|
|
70
|
-
"
|
|
71
|
-
"@
|
|
72
|
-
"react": "^
|
|
73
|
-
"
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@babel/core": "^7.23.9",
|
|
43
|
+
"@frontify/eslint-config-react": "^0.16.1",
|
|
44
|
+
"@testing-library/jest-dom": "^6.4.2",
|
|
45
|
+
"@testing-library/react": "^14.2.1",
|
|
46
|
+
"@testing-library/user-event": "14.5.2",
|
|
47
|
+
"@types/node": "^18.19.18",
|
|
48
|
+
"@types/react": "^18.2.58",
|
|
49
|
+
"@types/react-dom": "^18.2.19",
|
|
50
|
+
"@types/sinon": "^17.0.3",
|
|
51
|
+
"@vitejs/plugin-react": "^4.2.1",
|
|
52
|
+
"@vitest/ui": "^1.3.1",
|
|
53
|
+
"autoprefixer": "^10.4.17",
|
|
54
|
+
"cypress": "^13.6.6",
|
|
55
|
+
"cypress-real-events": "^1.12.0",
|
|
56
|
+
"eslint": "^8.56.0",
|
|
57
|
+
"eslint-plugin-notice": "^0.9.10",
|
|
58
|
+
"happy-dom": "^13.4.1",
|
|
59
|
+
"mitt": "^3.0.1",
|
|
60
|
+
"msw": "^1.3.2",
|
|
61
|
+
"postcss": "^8.4.35",
|
|
62
|
+
"prettier": "^3.2.5",
|
|
63
|
+
"react": "^18.2.0",
|
|
64
|
+
"react-dom": "^18.2.0",
|
|
65
|
+
"rollup": "^4.12.0",
|
|
66
|
+
"sinon": "17.0.1",
|
|
67
|
+
"tailwindcss": "^3.4.1",
|
|
68
|
+
"typescript": "^5.3.3",
|
|
69
|
+
"vite": "^5.1.4",
|
|
70
|
+
"vite-plugin-dts": "^3.7.3",
|
|
71
|
+
"vite-plugin-externals": "^0.6.2",
|
|
72
|
+
"vitest": "^1.3.1"
|
|
74
73
|
},
|
|
75
74
|
"scripts": {
|
|
76
75
|
"build": "vite build",
|
|
@@ -80,6 +79,7 @@
|
|
|
80
79
|
"prettier:fix": "prettier --write .",
|
|
81
80
|
"test": "vitest run --silent",
|
|
82
81
|
"test:watch": "vitest",
|
|
82
|
+
"test:ui": "vitest --ui",
|
|
83
83
|
"typecheck": "tsc --noEmit"
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -82,7 +82,7 @@ describe('DragHandleToolbarButton', () => {
|
|
|
82
82
|
<DragHandleToolbarButton tooltip={TOOLTIP_CONTENT} icon={<IconAdobeCreativeCloud />} draggableProps={{}} />,
|
|
83
83
|
);
|
|
84
84
|
|
|
85
|
-
const icons = [...getByTestId(TOOLBAR_BUTTON_ID).
|
|
85
|
+
const icons = [...getByTestId(TOOLBAR_BUTTON_ID).getElementsByTagName('svg')];
|
|
86
86
|
expect(icons).toHaveLength(1);
|
|
87
87
|
expect(icons[0].outerHTML).toMatch('IconAdobeCreativeCloud');
|
|
88
88
|
});
|
package/src/components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
2
|
|
|
3
|
-
import { ReactNode } from 'react';
|
|
3
|
+
import { type ReactNode } from 'react';
|
|
4
4
|
import { DEFAULT_DRAGGING_TOOLTIP, DEFAULT_DRAG_TOOLTIP } from '../../constants';
|
|
5
5
|
import { useDragPreviewContext } from '../context/DragPreviewContext';
|
|
6
6
|
import { BaseToolbarButton } from '../BaseToolbarButton';
|
package/src/components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.spec.tsx
CHANGED
|
@@ -12,10 +12,10 @@ const TOOLTIP_ID = 'toolbar-button-tooltip';
|
|
|
12
12
|
|
|
13
13
|
const TEST_FLYOUT_ID = 'test';
|
|
14
14
|
const TEST_TOOLTIP = 'tooltip';
|
|
15
|
+
|
|
15
16
|
/**
|
|
16
17
|
* @vitest-environment happy-dom
|
|
17
18
|
*/
|
|
18
|
-
|
|
19
19
|
describe('FlyoutToolbarButton', () => {
|
|
20
20
|
it('should log error if not inside a flyout provider when opening', async () => {
|
|
21
21
|
vi.spyOn(console, 'error');
|
|
@@ -109,7 +109,7 @@ describe('FlyoutToolbarButton', () => {
|
|
|
109
109
|
</MultiFlyoutContextProvider>,
|
|
110
110
|
);
|
|
111
111
|
|
|
112
|
-
const icons = [...getByTestId(BUTTON_ID).
|
|
112
|
+
const icons = [...getByTestId(BUTTON_ID).getElementsByTagName('svg')];
|
|
113
113
|
expect(icons).toHaveLength(1);
|
|
114
114
|
expect(icons[0].outerHTML).toMatch('IconAdobeCreativeCloud');
|
|
115
115
|
});
|
|
@@ -63,7 +63,7 @@ describe('ToolbarButton', () => {
|
|
|
63
63
|
<ToolbarButton onClick={vi.fn()} tooltip={TOOLTIP_CONTENT} icon={<IconAdobeCreativeCloud />} />,
|
|
64
64
|
);
|
|
65
65
|
|
|
66
|
-
const icons = [...getByTestId(TOOLBAR_BUTTON_ID).
|
|
66
|
+
const icons = [...getByTestId(TOOLBAR_BUTTON_ID).getElementsByTagName('svg')];
|
|
67
67
|
expect(icons).toHaveLength(1);
|
|
68
68
|
expect(icons[0].outerHTML).toMatch('IconAdobeCreativeCloud');
|
|
69
69
|
});
|
package/tsconfig.json
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"alwaysStrict": true,
|
|
7
|
-
"isolatedModules": true,
|
|
3
|
+
"target": "ES2021",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"lib": ["ES2021", "DOM", "DOM.Iterable"],
|
|
8
6
|
"module": "ESNext",
|
|
7
|
+
"skipLibCheck": true,
|
|
9
8
|
"moduleResolution": "bundler",
|
|
10
|
-
"
|
|
11
|
-
"noImplicitReturns": true,
|
|
12
|
-
"noImplicitThis": true,
|
|
13
|
-
"noUnusedLocals": true,
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"strict": true,
|
|
16
|
-
"target": "es6",
|
|
17
|
-
"jsx": "react-jsx",
|
|
18
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
19
10
|
"resolveJsonModule": true,
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
11
|
+
"isolatedModules": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"jsx": "react-jsx",
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noUncheckedIndexedAccess": false,
|
|
16
|
+
"noUnusedLocals": true,
|
|
17
|
+
"noUnusedParameters": true,
|
|
18
|
+
"noFallthroughCasesInSwitch": true,
|
|
19
|
+
"baseUrl": ".",
|
|
20
|
+
"types": ["@testing-library/jest-dom", "cypress", "cypress-real-events", "node"]
|
|
24
21
|
},
|
|
25
|
-
"include": ["src
|
|
26
|
-
"
|
|
22
|
+
"include": ["src", "setupTests.ts"],
|
|
23
|
+
"references": [{ "path": "./tsconfig.node.json" }]
|
|
27
24
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "Node",
|
|
6
|
+
"allowSyntheticDefaultImports": true,
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"lib": ["ESNext"],
|
|
9
|
+
"target": "ESNext"
|
|
10
|
+
},
|
|
11
|
+
"include": [".eslintrc.cjs", "tailwind.config.ts", "vite.config.ts", "package.json"]
|
|
12
|
+
}
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { jsxs as b, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as A, useState as j, useEffect as I } from "react";
|
|
3
|
-
import { useFileInput as D, useAssetUpload as E } from "@frontify/app-bridge";
|
|
4
|
-
import { useSortable as M } from "@dnd-kit/sortable";
|
|
5
|
-
import { LoadingCircle as P, LoadingCircleSize as V, FOCUS_STYLE as B, IconGrabHandle20 as L, Flyout as U, FlyoutPlacement as $, Button as O, IconPen20 as T, ButtonEmphasis as X, ActionMenu as G, MenuItemContentSize as f, IconArrowCircleUp20 as H, IconImageStack20 as _, MenuItemStyle as Y, IconTrashBin20 as q, IconImage24 as J, IconPlayFrame24 as K, IconMusicNote24 as Q, IconDocument24 as W } from "@frontify/fondue";
|
|
6
|
-
import { useFocusRing as Z } from "@react-aria/focus";
|
|
7
|
-
import { joinClassNames as h } from "../../utilities/react/joinClassNames.es.js";
|
|
8
|
-
const tt = (e) => e === "IMAGE" ? /* @__PURE__ */ t(J, {}) : e === "VIDEO" ? /* @__PURE__ */ t(K, {}) : e === "AUDIO" ? /* @__PURE__ */ t(Q, {}) : /* @__PURE__ */ t(W, {}), y = A(
|
|
9
|
-
({
|
|
10
|
-
item: e,
|
|
11
|
-
isEditing: s,
|
|
12
|
-
draggableProps: c,
|
|
13
|
-
transformStyle: u,
|
|
14
|
-
isDragging: o,
|
|
15
|
-
isOverlay: a,
|
|
16
|
-
isLoading: n,
|
|
17
|
-
onDelete: d,
|
|
18
|
-
onReplaceWithBrowse: m,
|
|
19
|
-
onReplaceWithUpload: S,
|
|
20
|
-
onDownload: w
|
|
21
|
-
}, k) => {
|
|
22
|
-
const [r, i] = j(), [C, { selectedFiles: l }] = D({ multiple: !0, accept: "image/*" }), [N, { results: g, doneAll: p }] = E(), { focusProps: F, isFocusVisible: v } = Z();
|
|
23
|
-
I(() => {
|
|
24
|
-
l && N(l[0]);
|
|
25
|
-
}, [l]), I(() => {
|
|
26
|
-
p && S(g[0]);
|
|
27
|
-
}, [p, g]);
|
|
28
|
-
const z = n || l && !p;
|
|
29
|
-
return /* @__PURE__ */ b(
|
|
30
|
-
"button",
|
|
31
|
-
{
|
|
32
|
-
"aria-label": "Download attachment",
|
|
33
|
-
"data-test-id": "attachments-item",
|
|
34
|
-
onClick: () => w == null ? void 0 : w(),
|
|
35
|
-
ref: k,
|
|
36
|
-
style: {
|
|
37
|
-
...u,
|
|
38
|
-
opacity: o && !a ? 0.3 : 1,
|
|
39
|
-
fontFamily: "var(-f-theme-settings-body-font-family)"
|
|
40
|
-
},
|
|
41
|
-
className: h([
|
|
42
|
-
"tw-cursor-pointer tw-text-left tw-w-full tw-relative tw-flex tw-gap-3 tw-px-5 tw-py-3 tw-items-center tw-group hover:tw-bg-box-neutral-hover",
|
|
43
|
-
o ? "tw-bg-box-neutral-hover" : ""
|
|
44
|
-
]),
|
|
45
|
-
children: [
|
|
46
|
-
/* @__PURE__ */ t("div", { className: "tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover", children: z ? /* @__PURE__ */ t(P, { size: V.Small }) : tt(e.objectType) }),
|
|
47
|
-
/* @__PURE__ */ b("div", { className: "tw-text-s tw-flex-1 tw-min-w-0", children: [
|
|
48
|
-
/* @__PURE__ */ t("div", { className: "tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis tw-font-bold tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover", children: e.title }),
|
|
49
|
-
/* @__PURE__ */ t("div", { className: "tw-text-text-weak", children: `${e.fileSizeHumanReadable} - ${e.extension}` })
|
|
50
|
-
] }),
|
|
51
|
-
s && /* @__PURE__ */ b(
|
|
52
|
-
"div",
|
|
53
|
-
{
|
|
54
|
-
"data-test-id": "attachments-actionbar",
|
|
55
|
-
className: h([
|
|
56
|
-
"tw-flex tw-gap-0.5 group-focus:tw-opacity-100 focus-visible:tw-opacity-100 focus-within:tw-opacity-100 group-hover:tw-opacity-100",
|
|
57
|
-
a || (r == null ? void 0 : r.id) === e.id ? "tw-opacity-100" : "tw-opacity-0"
|
|
58
|
-
]),
|
|
59
|
-
children: [
|
|
60
|
-
/* @__PURE__ */ t(
|
|
61
|
-
"button",
|
|
62
|
-
{
|
|
63
|
-
...F,
|
|
64
|
-
...c,
|
|
65
|
-
"aria-label": "Drag attachment",
|
|
66
|
-
className: h([
|
|
67
|
-
" tw-border-button-border tw-bg-button-background active:tw-bg-button-background-pressed tw-group tw-border tw-box-box tw-relative tw-flex tw-items-center tw-justify-center tw-outline-none tw-font-medium tw-rounded tw-h-9 tw-w-9 ",
|
|
68
|
-
o || a ? "tw-cursor-grabbing tw-bg-button-background-pressed hover:tw-bg-button-background-pressed" : "tw-cursor-grab hover:tw-bg-button-background-hover",
|
|
69
|
-
v && B,
|
|
70
|
-
v && "tw-z-[2]"
|
|
71
|
-
]),
|
|
72
|
-
children: /* @__PURE__ */ t(L, {})
|
|
73
|
-
}
|
|
74
|
-
),
|
|
75
|
-
/* @__PURE__ */ t("div", { "data-test-id": "attachments-actionbar-flyout", children: /* @__PURE__ */ t(
|
|
76
|
-
U,
|
|
77
|
-
{
|
|
78
|
-
placement: $.Right,
|
|
79
|
-
isOpen: (r == null ? void 0 : r.id) === e.id,
|
|
80
|
-
fitContent: !0,
|
|
81
|
-
legacyFooter: !1,
|
|
82
|
-
onOpenChange: (x) => i(x ? e : void 0),
|
|
83
|
-
trigger: (x, R) => /* @__PURE__ */ t(
|
|
84
|
-
O,
|
|
85
|
-
{
|
|
86
|
-
ref: R,
|
|
87
|
-
icon: /* @__PURE__ */ t(T, {}),
|
|
88
|
-
emphasis: X.Default,
|
|
89
|
-
onClick: () => i(e)
|
|
90
|
-
}
|
|
91
|
-
),
|
|
92
|
-
children: /* @__PURE__ */ t(
|
|
93
|
-
G,
|
|
94
|
-
{
|
|
95
|
-
menuBlocks: [
|
|
96
|
-
{
|
|
97
|
-
id: "menu",
|
|
98
|
-
menuItems: [
|
|
99
|
-
{
|
|
100
|
-
id: "upload",
|
|
101
|
-
size: f.XSmall,
|
|
102
|
-
title: "Replace with upload",
|
|
103
|
-
onClick: () => {
|
|
104
|
-
C(), i(void 0);
|
|
105
|
-
},
|
|
106
|
-
initialValue: !0,
|
|
107
|
-
decorator: /* @__PURE__ */ t("div", { className: "tw-mr-2", children: /* @__PURE__ */ t(H, {}) })
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
id: "asset",
|
|
111
|
-
size: f.XSmall,
|
|
112
|
-
title: "Replace with asset",
|
|
113
|
-
onClick: () => {
|
|
114
|
-
m(), i(void 0);
|
|
115
|
-
},
|
|
116
|
-
initialValue: !0,
|
|
117
|
-
decorator: /* @__PURE__ */ t("div", { className: "tw-mr-2", children: /* @__PURE__ */ t(_, {}) })
|
|
118
|
-
}
|
|
119
|
-
]
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
id: "menu-delete",
|
|
123
|
-
menuItems: [
|
|
124
|
-
{
|
|
125
|
-
id: "delete",
|
|
126
|
-
size: f.XSmall,
|
|
127
|
-
title: "Delete",
|
|
128
|
-
style: Y.Danger,
|
|
129
|
-
onClick: () => {
|
|
130
|
-
d(), i(void 0);
|
|
131
|
-
},
|
|
132
|
-
initialValue: !0,
|
|
133
|
-
decorator: /* @__PURE__ */ t("div", { className: "tw-mr-2", children: /* @__PURE__ */ t(q, {}) })
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
]
|
|
138
|
-
}
|
|
139
|
-
)
|
|
140
|
-
}
|
|
141
|
-
) })
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
);
|
|
150
|
-
y.displayName = "AttachmentItem";
|
|
151
|
-
const st = (e) => {
|
|
152
|
-
const { attributes: s, listeners: c, setNodeRef: u, transform: o, transition: a, isDragging: n } = M({
|
|
153
|
-
id: e.item.id
|
|
154
|
-
}), d = {
|
|
155
|
-
transform: o ? `translate(${o.x}px, ${o.y}px)` : "",
|
|
156
|
-
transition: a,
|
|
157
|
-
zIndex: n ? 2 : 1
|
|
158
|
-
}, m = { ...s, ...c };
|
|
159
|
-
return /* @__PURE__ */ t(
|
|
160
|
-
y,
|
|
161
|
-
{
|
|
162
|
-
ref: u,
|
|
163
|
-
isDragging: n,
|
|
164
|
-
transformStyle: d,
|
|
165
|
-
draggableProps: m,
|
|
166
|
-
...e
|
|
167
|
-
}
|
|
168
|
-
);
|
|
169
|
-
};
|
|
170
|
-
export {
|
|
171
|
-
y as AttachmentItem,
|
|
172
|
-
st as SortableAttachmentItem
|
|
173
|
-
};
|
|
174
|
-
//# sourceMappingURL=AttachmentItem.es.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AttachmentItem.es.js","sources":["../../../src/components/Attachments/AttachmentItem.tsx"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport { MutableRefObject, forwardRef, useEffect, useState } from 'react';\nimport { Asset, useAssetUpload, useFileInput } from '@frontify/app-bridge';\nimport { useSortable } from '@dnd-kit/sortable';\n\nimport {\n ActionMenu,\n Button,\n ButtonEmphasis,\n FOCUS_STYLE,\n Flyout,\n FlyoutPlacement,\n IconArrowCircleUp20,\n IconDocument24,\n IconGrabHandle20,\n IconImage24,\n IconImageStack20,\n IconMusicNote24,\n IconPen20,\n IconPlayFrame24,\n IconTrashBin20,\n LoadingCircle,\n LoadingCircleSize,\n MenuItemContentSize,\n MenuItemStyle,\n} from '@frontify/fondue';\nimport { AttachmentItemProps, SortableAttachmentItemProps } from './types';\nimport { joinClassNames } from '../../utilities';\nimport { useFocusRing } from '@react-aria/focus';\n\nconst getDecorator = (type: string) => {\n if (type === 'IMAGE') {\n return <IconImage24 />;\n } else if (type === 'VIDEO') {\n return <IconPlayFrame24 />;\n } else if (type === 'AUDIO') {\n return <IconMusicNote24 />;\n } else {\n return <IconDocument24 />;\n }\n};\n\nexport const AttachmentItem = forwardRef<HTMLButtonElement, AttachmentItemProps>(\n (\n {\n item,\n isEditing,\n draggableProps,\n transformStyle,\n isDragging,\n isOverlay,\n isLoading,\n onDelete,\n onReplaceWithBrowse,\n onReplaceWithUpload,\n onDownload,\n },\n ref,\n ) => {\n const [selectedAsset, setSelectedAsset] = useState<Asset | undefined>();\n const [openFileDialog, { selectedFiles }] = useFileInput({ multiple: true, accept: 'image/*' });\n const [uploadFile, { results: uploadResults, doneAll }] = useAssetUpload();\n\n const { focusProps, isFocusVisible } = useFocusRing();\n\n useEffect(() => {\n if (selectedFiles) {\n uploadFile(selectedFiles[0]);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [selectedFiles]);\n\n useEffect(() => {\n if (doneAll) {\n onReplaceWithUpload(uploadResults[0]);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [doneAll, uploadResults]);\n\n const showLoadingCircle = isLoading || (selectedFiles && !doneAll);\n\n return (\n <button\n aria-label=\"Download attachment\"\n data-test-id=\"attachments-item\"\n onClick={() => onDownload?.()}\n ref={ref}\n style={{\n ...transformStyle,\n opacity: isDragging && !isOverlay ? 0.3 : 1,\n fontFamily: 'var(-f-theme-settings-body-font-family)',\n }}\n className={joinClassNames([\n 'tw-cursor-pointer tw-text-left tw-w-full tw-relative tw-flex tw-gap-3 tw-px-5 tw-py-3 tw-items-center tw-group hover:tw-bg-box-neutral-hover',\n isDragging ? 'tw-bg-box-neutral-hover' : '',\n ])}\n >\n <div className=\"tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover\">\n {showLoadingCircle ? (\n <LoadingCircle size={LoadingCircleSize.Small} />\n ) : (\n getDecorator(item.objectType)\n )}\n </div>\n <div className=\"tw-text-s tw-flex-1 tw-min-w-0\">\n <div className=\"tw-whitespace-nowrap tw-overflow-hidden tw-text-ellipsis tw-font-bold tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover\">\n {item.title}\n </div>\n <div className=\"tw-text-text-weak\">{`${item.fileSizeHumanReadable} - ${item.extension}`}</div>\n </div>\n {isEditing && (\n <div\n data-test-id=\"attachments-actionbar\"\n className={joinClassNames([\n 'tw-flex tw-gap-0.5 group-focus:tw-opacity-100 focus-visible:tw-opacity-100 focus-within:tw-opacity-100 group-hover:tw-opacity-100',\n isOverlay || selectedAsset?.id === item.id ? 'tw-opacity-100' : 'tw-opacity-0',\n ])}\n >\n <button\n {...focusProps}\n {...draggableProps}\n aria-label=\"Drag attachment\"\n className={joinClassNames([\n ' tw-border-button-border tw-bg-button-background active:tw-bg-button-background-pressed tw-group tw-border tw-box-box tw-relative tw-flex tw-items-center tw-justify-center tw-outline-none tw-font-medium tw-rounded tw-h-9 tw-w-9 ',\n isDragging || isOverlay\n ? 'tw-cursor-grabbing tw-bg-button-background-pressed hover:tw-bg-button-background-pressed'\n : 'tw-cursor-grab hover:tw-bg-button-background-hover',\n isFocusVisible && FOCUS_STYLE,\n isFocusVisible && 'tw-z-[2]',\n ])}\n >\n <IconGrabHandle20 />\n </button>\n <div data-test-id=\"attachments-actionbar-flyout\">\n <Flyout\n placement={FlyoutPlacement.Right}\n isOpen={selectedAsset?.id === item.id}\n fitContent\n legacyFooter={false}\n onOpenChange={(isOpen) => setSelectedAsset(isOpen ? item : undefined)}\n trigger={(_, ref) => (\n <Button\n ref={ref as MutableRefObject<HTMLButtonElement>}\n icon={<IconPen20 />}\n emphasis={ButtonEmphasis.Default}\n onClick={() => setSelectedAsset(item)}\n />\n )}\n >\n <ActionMenu\n menuBlocks={[\n {\n id: 'menu',\n menuItems: [\n {\n id: 'upload',\n size: MenuItemContentSize.XSmall,\n title: 'Replace with upload',\n onClick: () => {\n openFileDialog();\n setSelectedAsset(undefined);\n },\n\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconArrowCircleUp20 />\n </div>\n ),\n },\n\n {\n id: 'asset',\n size: MenuItemContentSize.XSmall,\n title: 'Replace with asset',\n onClick: () => {\n onReplaceWithBrowse();\n setSelectedAsset(undefined);\n },\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconImageStack20 />\n </div>\n ),\n },\n ],\n },\n {\n id: 'menu-delete',\n menuItems: [\n {\n id: 'delete',\n size: MenuItemContentSize.XSmall,\n title: 'Delete',\n style: MenuItemStyle.Danger,\n onClick: () => {\n onDelete();\n setSelectedAsset(undefined);\n },\n\n initialValue: true,\n decorator: (\n <div className=\"tw-mr-2\">\n <IconTrashBin20 />\n </div>\n ),\n },\n ],\n },\n ]}\n />\n </Flyout>\n </div>\n </div>\n )}\n </button>\n );\n },\n);\n\nAttachmentItem.displayName = 'AttachmentItem';\n\nexport const SortableAttachmentItem = (props: SortableAttachmentItemProps) => {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id: props.item.id,\n });\n\n const transformStyle = {\n transform: transform ? `translate(${transform.x}px, ${transform.y}px)` : '',\n transition,\n zIndex: isDragging ? 2 : 1,\n };\n\n const draggableProps = { ...attributes, ...listeners };\n\n return (\n <AttachmentItem\n ref={setNodeRef}\n isDragging={isDragging}\n transformStyle={transformStyle}\n draggableProps={draggableProps}\n {...props}\n />\n );\n};\n"],"names":["getDecorator","type","IconImage24","IconPlayFrame24","IconMusicNote24","IconDocument24","AttachmentItem","forwardRef","item","isEditing","draggableProps","transformStyle","isDragging","isOverlay","isLoading","onDelete","onReplaceWithBrowse","onReplaceWithUpload","onDownload","ref","selectedAsset","setSelectedAsset","useState","openFileDialog","selectedFiles","useFileInput","uploadFile","uploadResults","doneAll","useAssetUpload","focusProps","isFocusVisible","useFocusRing","useEffect","showLoadingCircle","jsxs","joinClassNames","jsx","LoadingCircle","LoadingCircleSize","FOCUS_STYLE","IconGrabHandle20","Flyout","FlyoutPlacement","isOpen","_","Button","IconPen20","ButtonEmphasis","ActionMenu","MenuItemContentSize","IconArrowCircleUp20","IconImageStack20","MenuItemStyle","IconTrashBin20","SortableAttachmentItem","props","attributes","listeners","setNodeRef","transform","transition","useSortable"],"mappings":"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"}
|