@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/dist/index.es.js
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
import "./styles.css.es.js";
|
|
2
|
-
export * from "@frontify/sidebar-settings";
|
|
3
|
-
import { BlockInjectButton as m } from "./components/BlockInjectButton/BlockInjectButton.es.js";
|
|
4
|
-
import { BlockItemWrapper as g } from "./components/BlockItemWrapper/BlockItemWrapper.es.js";
|
|
5
|
-
import { DragPreviewContextProvider as u, useDragPreviewContext as f } from "./components/BlockItemWrapper/Toolbar/context/DragPreviewContext.es.js";
|
|
6
|
-
import { MultiFlyoutContextProvider as d, useMultiFlyoutContext as S } from "./components/BlockItemWrapper/Toolbar/context/MultiFlyoutContext.es.js";
|
|
7
|
-
import { useMultiFlyoutState as B } from "./components/BlockItemWrapper/Toolbar/hooks/useMultiFlyoutState.es.js";
|
|
8
|
-
import { Toolbar as y } from "./components/BlockItemWrapper/Toolbar/Toolbar.es.js";
|
|
9
|
-
import { AttachmentsToolbarButton as A, DEFAULT_ATTACHMENTS_BUTTON_ID as E } from "./components/BlockItemWrapper/Toolbar/AttachmentsToolbarButton/AttachmentsToolbarButton.es.js";
|
|
10
|
-
import { DragHandleToolbarButton as h } from "./components/BlockItemWrapper/Toolbar/DragHandleToolbarButton/DragHandleToolbarButton.es.js";
|
|
11
|
-
import { FlyoutToolbarButton as F } from "./components/BlockItemWrapper/Toolbar/FlyoutToolbarButton/FlyoutToolbarButton.es.js";
|
|
12
|
-
import { DEFAULT_MENU_BUTTON_ID as k, MenuToolbarButton as I } from "./components/BlockItemWrapper/Toolbar/MenuToolbarButton/MenuToolbarButton.es.js";
|
|
13
|
-
import { ToolbarFlyoutMenu as D } from "./components/BlockItemWrapper/Toolbar/MenuToolbarButton/ToolbarFlyoutMenu.es.js";
|
|
14
|
-
import { DEFAULT_DRAGGING_TOOLTIP as U, DEFAULT_DRAG_TOOLTIP as _ } from "./components/BlockItemWrapper/constants.es.js";
|
|
15
|
-
import { Attachments as G } from "./components/Attachments/Attachments.es.js";
|
|
16
|
-
import { DownloadButton as O } from "./components/DownloadButton/DownloadButton.es.js";
|
|
17
|
-
import { RichTextEditor as w } from "./components/RichTextEditor/RichTextEditor.es.js";
|
|
18
|
-
import { LinkPlugin as W, createLinkPlugin as j } from "./components/RichTextEditor/plugins/LinkPlugin/index.es.js";
|
|
19
|
-
import { BUTTON_PLUGIN as X, ButtonPlugin as q, ELEMENT_BUTTON as z, createButtonPlugin as J } from "./components/RichTextEditor/plugins/ButtonPlugin/createButtonPlugin.es.js";
|
|
20
|
-
import { withButton as Y } from "./components/RichTextEditor/plugins/ButtonPlugin/withButton.es.js";
|
|
21
|
-
import { insertButton as $ } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/insertButton.es.js";
|
|
22
|
-
import { submitFloatingButton as rt } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/submitFloatingButton.es.js";
|
|
23
|
-
import { unwrapButton as et } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/unwrapButton.es.js";
|
|
24
|
-
import { upsertButton as at } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButton.es.js";
|
|
25
|
-
import { upsertButtonText as pt } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/upsertButtonText.es.js";
|
|
26
|
-
import { wrapButton as lt } from "./components/RichTextEditor/plugins/ButtonPlugin/transforms/wrapButton.es.js";
|
|
27
|
-
import { getUrlFromEditor as xt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/getUrl.es.js";
|
|
28
|
-
import { createButtonNode as ft } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/createButtonNode.es.js";
|
|
29
|
-
import { triggerFloatingButton as dt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButton.es.js";
|
|
30
|
-
import { triggerFloatingButtonEdit as Pt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonEdit.es.js";
|
|
31
|
-
import { triggerFloatingButtonInsert as Tt } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/triggerFloatingButtonInsert.es.js";
|
|
32
|
-
import { BlockButtonStyles as ct } from "./components/RichTextEditor/plugins/ButtonPlugin/utils/styles.es.js";
|
|
33
|
-
import { Custom1Plugin as Et } from "./components/RichTextEditor/plugins/TextStylePlugins/custom1Plugin.es.js";
|
|
34
|
-
import { Custom2Plugin as ht } from "./components/RichTextEditor/plugins/TextStylePlugins/custom2Plugin.es.js";
|
|
35
|
-
import { Custom3Plugin as Ft } from "./components/RichTextEditor/plugins/TextStylePlugins/custom3Plugin.es.js";
|
|
36
|
-
import { Heading1Plugin as kt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading1Plugin.es.js";
|
|
37
|
-
import { Heading2Plugin as bt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading2Plugin.es.js";
|
|
38
|
-
import { Heading3Plugin as Rt } from "./components/RichTextEditor/plugins/TextStylePlugins/heading3Plugin.es.js";
|
|
39
|
-
import { Heading4Plugin as _t } from "./components/RichTextEditor/plugins/TextStylePlugins/heading4Plugin.es.js";
|
|
40
|
-
import { ImageCaptionPlugin as Gt } from "./components/RichTextEditor/plugins/TextStylePlugins/imageCaptionPlugin.es.js";
|
|
41
|
-
import { ImageTitlePlugin as Ot } from "./components/RichTextEditor/plugins/TextStylePlugins/imageTitlePlugin.es.js";
|
|
42
|
-
import { PARAGRAPH_CLASSES as wt, ParagraphMarkupElement as Vt, ParagraphMarkupElementNode as Wt, ParagraphPlugin as jt, createParagraphPlugin as Qt } from "./components/RichTextEditor/plugins/TextStylePlugins/paragraphPlugin.es.js";
|
|
43
|
-
import { QuoteMarkupElementNode as qt, QuotePlugin as zt, createQuotePlugin as Jt } from "./components/RichTextEditor/plugins/TextStylePlugins/quotePlugin.es.js";
|
|
44
|
-
import { AllTextStylePlugins as Yt, AllTextStyles as Zt, TextStylePluginsWithoutImage as $t, TextStylesWithoutImage as tr } from "./components/RichTextEditor/plugins/TextStylePlugins/helpers.es.js";
|
|
45
|
-
import { BlockStyles as or, TextStyles as er } from "./components/RichTextEditor/plugins/styles.es.js";
|
|
46
|
-
import { getDefaultPluginsWithLinkChooser as ar } from "./components/RichTextEditor/pluginPresets/defaultPluginsWithLinkChooser.es.js";
|
|
47
|
-
import { THEME_PREFIX as pr } from "./components/RichTextEditor/constants.es.js";
|
|
48
|
-
import { LinkSelector as lr } from "./components/Link/LinkSelector/LinkSelector.es.js";
|
|
49
|
-
import { LinkInput as xr } from "./components/Link/LinkInput.es.js";
|
|
50
|
-
import { getLegacyUrl as fr, getLinkFromEditor as sr, getUrl as dr, getUrlFromLinkOrLegacyLink as Sr } from "./components/Link/utils/getUrl.es.js";
|
|
51
|
-
import { relativeUrlRegex as Br } from "./components/Link/utils/relativeUrlRegex.es.js";
|
|
52
|
-
import { isValidUrl as yr, isValidUrlOrEmpty as cr } from "./components/Link/utils/url.es.js";
|
|
53
|
-
import { convertToRteValue as Er } from "./helpers/convertToRichTextValue.es.js";
|
|
54
|
-
import { customCoordinatesGetterFactory as hr } from "./helpers/customCoordinatesGetterFactory.es.js";
|
|
55
|
-
import { hasRichTextValue as Fr } from "./helpers/hasRichTextValue.es.js";
|
|
56
|
-
import { isDownloadable as kr } from "./helpers/isDownloadable.es.js";
|
|
57
|
-
import { mapAppBridgeColorPaletteToFonduePalette as br, mapAppBridgeColorPalettesToFonduePalettes as Dr } from "./helpers/mapColorPalettes.es.js";
|
|
58
|
-
import { addHttps as Ur } from "./helpers/addHttps.es.js";
|
|
59
|
-
import { AttachmentsProvider as Nr, useAttachments as Gr, useAttachmentsContext as Hr, withAttachmentsProvider as Or } from "./hooks/useAttachments.es.js";
|
|
60
|
-
import { useDndSensors as wr } from "./hooks/useDndSensors.es.js";
|
|
61
|
-
import { getBackgroundSettings as Wr } from "./settings/background.es.js";
|
|
62
|
-
import { getBorderSettings as Qr } from "./settings/border.es.js";
|
|
63
|
-
import { getBorderRadiusSettings as qr, getBorderRadiusSlider as zr } from "./settings/borderRadius.es.js";
|
|
64
|
-
import { getExtendedBorderRadiusSettings as Kr } from "./settings/borderRadiusExtended.es.js";
|
|
65
|
-
import { getGutterSettings as Zr } from "./settings/gutter.es.js";
|
|
66
|
-
import { getMarginSettings as to, getMarginSlider as ro } from "./settings/margin.es.js";
|
|
67
|
-
import { getMarginExtendedSettings as eo } from "./settings/marginExtended.es.js";
|
|
68
|
-
import { getPaddingSettings as ao, getPaddingSlider as io } from "./settings/padding.es.js";
|
|
69
|
-
import { getPaddingExtendedSettings as mo } from "./settings/paddingExtended.es.js";
|
|
70
|
-
import { BorderStyle as go, GutterSpacing as xo, Margin as uo, Padding as fo, Radius as so, Security as So, borderStyleMap as Po, gutterSpacingStyleMap as Bo, marginStyleMap as To, paddingStyleMap as yo, radiusStyleMap as co } from "./settings/types.es.js";
|
|
71
|
-
import { getSecurityDownloadableSetting as Eo, getSecurityGlobalControlId as Mo } from "./settings/securityDownloadable.es.js";
|
|
72
|
-
import { getSecurityGlobalControlSetting as Co } from "./settings/securityGlobalControl.es.js";
|
|
73
|
-
import { isDark as Lo } from "./utilities/color/isDark.es.js";
|
|
74
|
-
import { toHex8String as Io } from "./utilities/color/toHex8String.es.js";
|
|
75
|
-
import { toHexString as Do } from "./utilities/color/toHexString.es.js";
|
|
76
|
-
import { toRgbaString as Uo } from "./utilities/color/toRgbaString.es.js";
|
|
77
|
-
import { setAlpha as No } from "./utilities/color/setAlpha.es.js";
|
|
78
|
-
import { toColorObject as Ho } from "./utilities/color/toColorObject.es.js";
|
|
79
|
-
import { getReadableColor as vo } from "./utilities/color/getReadableColor.es.js";
|
|
80
|
-
import { toShortRgba as Vo } from "./utilities/color/toShortRgba.es.js";
|
|
81
|
-
import { moveItemInArray as jo } from "./utilities/moveItemInArray.es.js";
|
|
82
|
-
import { getBackgroundColorStyles as Xo } from "./utilities/react/getBackgroundColorStyles.es.js";
|
|
83
|
-
import { getBorderStyles as zo } from "./utilities/react/getBorderStyles.es.js";
|
|
84
|
-
import { getRadiusStyles as Ko } from "./utilities/react/getRadiusStyles.es.js";
|
|
85
|
-
import { joinClassNames as Zo } from "./utilities/react/joinClassNames.es.js";
|
|
86
|
-
var r = /* @__PURE__ */ ((t) => (t.Main = "main", t.Basics = "basics", t.Layout = "layout", t.Style = "style", t.Security = "security", t.Targets = "targets", t))(r || {});
|
|
87
|
-
const e = (t) => t, n = (t) => t;
|
|
88
|
-
export {
|
|
89
|
-
Yt as AllTextStylePlugins,
|
|
90
|
-
Zt as AllTextStyles,
|
|
91
|
-
G as Attachments,
|
|
92
|
-
Nr as AttachmentsProvider,
|
|
93
|
-
A as AttachmentsToolbarButton,
|
|
94
|
-
X as BUTTON_PLUGIN,
|
|
95
|
-
ct as BlockButtonStyles,
|
|
96
|
-
m as BlockInjectButton,
|
|
97
|
-
g as BlockItemWrapper,
|
|
98
|
-
or as BlockStyles,
|
|
99
|
-
go as BorderStyle,
|
|
100
|
-
q as ButtonPlugin,
|
|
101
|
-
Et as Custom1Plugin,
|
|
102
|
-
ht as Custom2Plugin,
|
|
103
|
-
Ft as Custom3Plugin,
|
|
104
|
-
E as DEFAULT_ATTACHMENTS_BUTTON_ID,
|
|
105
|
-
U as DEFAULT_DRAGGING_TOOLTIP,
|
|
106
|
-
_ as DEFAULT_DRAG_TOOLTIP,
|
|
107
|
-
k as DEFAULT_MENU_BUTTON_ID,
|
|
108
|
-
O as DownloadButton,
|
|
109
|
-
h as DragHandleToolbarButton,
|
|
110
|
-
u as DragPreviewContextProvider,
|
|
111
|
-
z as ELEMENT_BUTTON,
|
|
112
|
-
F as FlyoutToolbarButton,
|
|
113
|
-
xo as GutterSpacing,
|
|
114
|
-
kt as Heading1Plugin,
|
|
115
|
-
bt as Heading2Plugin,
|
|
116
|
-
Rt as Heading3Plugin,
|
|
117
|
-
_t as Heading4Plugin,
|
|
118
|
-
Gt as ImageCaptionPlugin,
|
|
119
|
-
Ot as ImageTitlePlugin,
|
|
120
|
-
xr as LinkInput,
|
|
121
|
-
W as LinkPlugin,
|
|
122
|
-
lr as LinkSelector,
|
|
123
|
-
uo as Margin,
|
|
124
|
-
I as MenuToolbarButton,
|
|
125
|
-
d as MultiFlyoutContextProvider,
|
|
126
|
-
wt as PARAGRAPH_CLASSES,
|
|
127
|
-
fo as Padding,
|
|
128
|
-
Vt as ParagraphMarkupElement,
|
|
129
|
-
Wt as ParagraphMarkupElementNode,
|
|
130
|
-
jt as ParagraphPlugin,
|
|
131
|
-
qt as QuoteMarkupElementNode,
|
|
132
|
-
zt as QuotePlugin,
|
|
133
|
-
so as Radius,
|
|
134
|
-
w as RichTextEditor,
|
|
135
|
-
r as Sections,
|
|
136
|
-
So as Security,
|
|
137
|
-
pr as THEME_PREFIX,
|
|
138
|
-
$t as TextStylePluginsWithoutImage,
|
|
139
|
-
er as TextStyles,
|
|
140
|
-
tr as TextStylesWithoutImage,
|
|
141
|
-
y as Toolbar,
|
|
142
|
-
D as ToolbarFlyoutMenu,
|
|
143
|
-
Ur as addHttps,
|
|
144
|
-
Po as borderStyleMap,
|
|
145
|
-
Er as convertToRteValue,
|
|
146
|
-
ft as createButtonNode,
|
|
147
|
-
J as createButtonPlugin,
|
|
148
|
-
j as createLinkPlugin,
|
|
149
|
-
Qt as createParagraphPlugin,
|
|
150
|
-
Jt as createQuotePlugin,
|
|
151
|
-
hr as customCoordinatesGetterFactory,
|
|
152
|
-
e as defineBlock,
|
|
153
|
-
n as defineSettings,
|
|
154
|
-
Xo as getBackgroundColorStyles,
|
|
155
|
-
Wr as getBackgroundSettings,
|
|
156
|
-
qr as getBorderRadiusSettings,
|
|
157
|
-
zr as getBorderRadiusSlider,
|
|
158
|
-
Qr as getBorderSettings,
|
|
159
|
-
zo as getBorderStyles,
|
|
160
|
-
ar as getDefaultPluginsWithLinkChooser,
|
|
161
|
-
Kr as getExtendedBorderRadiusSettings,
|
|
162
|
-
Zr as getGutterSettings,
|
|
163
|
-
fr as getLegacyUrl,
|
|
164
|
-
sr as getLinkFromEditor,
|
|
165
|
-
eo as getMarginExtendedSettings,
|
|
166
|
-
to as getMarginSettings,
|
|
167
|
-
ro as getMarginSlider,
|
|
168
|
-
mo as getPaddingExtendedSettings,
|
|
169
|
-
ao as getPaddingSettings,
|
|
170
|
-
io as getPaddingSlider,
|
|
171
|
-
Ko as getRadiusStyles,
|
|
172
|
-
vo as getReadableColor,
|
|
173
|
-
Eo as getSecurityDownloadableSetting,
|
|
174
|
-
Mo as getSecurityGlobalControlId,
|
|
175
|
-
Co as getSecurityGlobalControlSetting,
|
|
176
|
-
dr as getUrl,
|
|
177
|
-
xt as getUrlFromEditor,
|
|
178
|
-
Sr as getUrlFromLinkOrLegacyLink,
|
|
179
|
-
Bo as gutterSpacingStyleMap,
|
|
180
|
-
Fr as hasRichTextValue,
|
|
181
|
-
$ as insertButton,
|
|
182
|
-
Lo as isDark,
|
|
183
|
-
kr as isDownloadable,
|
|
184
|
-
yr as isValidUrl,
|
|
185
|
-
cr as isValidUrlOrEmpty,
|
|
186
|
-
Zo as joinClassNames,
|
|
187
|
-
br as mapAppBridgeColorPaletteToFonduePalette,
|
|
188
|
-
Dr as mapAppBridgeColorPalettesToFonduePalettes,
|
|
189
|
-
To as marginStyleMap,
|
|
190
|
-
jo as moveItemInArray,
|
|
191
|
-
yo as paddingStyleMap,
|
|
192
|
-
co as radiusStyleMap,
|
|
193
|
-
Br as relativeUrlRegex,
|
|
194
|
-
No as setAlpha,
|
|
195
|
-
rt as submitFloatingButton,
|
|
196
|
-
Ho as toColorObject,
|
|
197
|
-
Io as toHex8String,
|
|
198
|
-
Do as toHexString,
|
|
199
|
-
Uo as toRgbaString,
|
|
200
|
-
Vo as toShortRgba,
|
|
201
|
-
dt as triggerFloatingButton,
|
|
202
|
-
Pt as triggerFloatingButtonEdit,
|
|
203
|
-
Tt as triggerFloatingButtonInsert,
|
|
204
|
-
et as unwrapButton,
|
|
205
|
-
at as upsertButton,
|
|
206
|
-
pt as upsertButtonText,
|
|
207
|
-
Gr as useAttachments,
|
|
208
|
-
Hr as useAttachmentsContext,
|
|
209
|
-
wr as useDndSensors,
|
|
210
|
-
f as useDragPreviewContext,
|
|
211
|
-
S as useMultiFlyoutContext,
|
|
212
|
-
B as useMultiFlyoutState,
|
|
213
|
-
Or as withAttachmentsProvider,
|
|
214
|
-
Y as withButton,
|
|
215
|
-
lt as wrapButton
|
|
216
|
-
};
|
|
217
|
-
//# sourceMappingURL=index.es.js.map
|
package/dist/index.es.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../src/index.ts"],"sourcesContent":["/* (c) Copyright Frontify Ltd., all rights reserved. */\n\nimport './styles.css';\n\nimport type { FC } from 'react';\nimport type { AppBridgeBlock } from '@frontify/app-bridge';\nimport type {\n AssetInputBlock as AssetInputBlockSidebarSettings,\n BaseBlock as BaseBlockSidebarSettings,\n Bundle as BundleSidebarSettings,\n ChecklistBlock as ChecklistBlockSidebarSettings,\n ChoicesType as ChoicesTypeSidebarSettings,\n ColorInputBlock as ColorInputBlockSidebarSettings,\n DropdownBlock as DropdownBlockSidebarSettings,\n DynamicSettingBlock as DynamicSettingBlockSidebarSettings,\n DynamicSupportedBlock as DynamicSupportedBlockSidebarSettings,\n FontInputBlock as FontInputBlockSidebarSettings,\n InputBlock as InputBlockSidebarSettings,\n LegacyAssetInputBlock as LegacyAssetInputBlockSidebarSettings,\n LinkBlock as LinkBlockSidebarSettings,\n LinkChooserBlock as LinkChooserBlockSidebarSettings,\n MultiInputBlock as MultiInputBlockSidebarSettings,\n NotificationBlock as NotificationBlockSidebarSettings,\n SectionHeadingBlock as SectionHeadingBlockSidebarSettings,\n SegmentedControlsBlock as SegmentedControlsBlockSidebarSettings,\n SettingBlock as SettingBlockSidebarSettings,\n SimpleSettingBlock as SimpleSettingBlockSidebarSettings,\n SwitchBlock as SwitchBlockSidebarSettings,\n TemplateInputBlock as TemplateInputBlockSidebarSettings,\n TextareaBlock as TextareaBlockSidebarSettings,\n ValueOrPromisedValue as ValueOrPromisedValueSidebarSettings,\n} from '@frontify/sidebar-settings';\n\nexport * from '@frontify/sidebar-settings';\n\nexport type AssetInputBlock = AssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type BaseBlock<T = undefined> = BaseBlockSidebarSettings<AppBridgeBlock, T>;\nexport type Bundle = BundleSidebarSettings<AppBridgeBlock>;\nexport type ChecklistBlock = ChecklistBlockSidebarSettings<AppBridgeBlock>;\nexport type ChoicesType = ChoicesTypeSidebarSettings<AppBridgeBlock>;\nexport type ColorInputBlock = ColorInputBlockSidebarSettings<AppBridgeBlock>;\nexport type DropdownBlock = DropdownBlockSidebarSettings<AppBridgeBlock>;\nexport type DynamicSettingBlock<Block extends DynamicSupportedBlock = DynamicSupportedBlock> =\n DynamicSettingBlockSidebarSettings<AppBridgeBlock, Block>;\nexport type DynamicSupportedBlock = DynamicSupportedBlockSidebarSettings<AppBridgeBlock>;\nexport type FontInputBlock = FontInputBlockSidebarSettings<AppBridgeBlock>;\nexport type InputBlock = InputBlockSidebarSettings<AppBridgeBlock>;\nexport type LegacyAssetInputBlock = LegacyAssetInputBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkBlock = LinkBlockSidebarSettings<AppBridgeBlock>;\nexport type LinkChooserBlock = LinkChooserBlockSidebarSettings<AppBridgeBlock>;\nexport type MultiInputBlock = MultiInputBlockSidebarSettings<AppBridgeBlock>;\nexport type NotificationBlock = NotificationBlockSidebarSettings<AppBridgeBlock>;\nexport type SectionHeadingBlock = SectionHeadingBlockSidebarSettings<AppBridgeBlock>;\nexport type SegmentedControlsBlock = SegmentedControlsBlockSidebarSettings<AppBridgeBlock>;\nexport type SettingBlock = SettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SimpleSettingBlock = SimpleSettingBlockSidebarSettings<AppBridgeBlock>;\nexport type SwitchBlock = SwitchBlockSidebarSettings<AppBridgeBlock>;\nexport type TemplateInputBlock = TemplateInputBlockSidebarSettings<AppBridgeBlock>;\nexport type TextareaBlock = TextareaBlockSidebarSettings<AppBridgeBlock>;\nexport type ValueOrPromisedValue<T> = ValueOrPromisedValueSidebarSettings<AppBridgeBlock, T>;\n\nexport enum Sections {\n Main = 'main',\n Basics = 'basics',\n Layout = 'layout',\n Style = 'style',\n Security = 'security',\n Targets = 'targets',\n}\n\nexport type BlockSettingsStructureExport = {\n [Sections.Main]?: SettingBlock[];\n [Sections.Basics]?: SettingBlock[];\n [Sections.Layout]?: SettingBlock[];\n [Sections.Style]?: SettingBlock[];\n [Sections.Security]?: SettingBlock[];\n} & { [customSectionName: string]: SettingBlock[] };\n\nexport type BlockProps = {\n /**\n * The Frontify App Bridge provides an interface to the Frontify app internals.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks/introducing-the-app-bridge}\n */\n appBridge: AppBridgeBlock;\n};\n\nexport type BlockConfigExport = {\n /**\n * Block component to render.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/content-blocks}\n */\n block: FC<BlockProps>;\n /**\n * Contains the block settings and its structure.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-settings-1}\n */\n settings: ReturnType<typeof defineSettings>;\n /**\n * Block lifecycle hook ran before the block gets added in the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-creation}\n */\n onBlockCreated?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n /**\n * Block lifecycle hook ran before the block gets deleted from the Guideline.\n * The hook support both synchronous or asynchronous execution.\n * {@link https://developer.frontify.com/d/XFPCrGNrXQQM/content-blocks#/details-concepts-1/block-lifecycle/on-block-deletion}\n */\n onBlockDeleted?:\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => void)\n | (({ appBridge }: { appBridge: AppBridgeBlock }) => Promise<void>);\n};\n\n/**\n * Type helper to make it easier to export a theme, accepts a direct {@link BlockConfigExport} object.\n */\nexport const defineBlock = (config: BlockConfigExport): BlockConfigExport => config;\n\n/**\n * Type helper to make it easier to export block's settings structure, accepts a direct {@link BlockSettingsStructureExport} object\n * or a function return a direct {@link BlockSettingsStructureExport} or a function returning a Promise of {@link BlockSettingsStructureExport}.\n */\nexport const defineSettings = <\n T extends\n | BlockSettingsStructureExport\n | (() => Promise<BlockSettingsStructureExport>)\n | (() => BlockSettingsStructureExport),\n>(\n settingsStructure: T,\n): T => settingsStructure;\n\nexport * from './components';\nexport * from './helpers';\nexport * from './hooks';\nexport * from './settings';\nexport * from './utilities';\n"],"names":["Sections","defineBlock","config","defineSettings","settingsStructure"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DY,IAAAA,sBAAAA,OACRA,EAAA,OAAO,QACPA,EAAA,SAAS,UACTA,EAAA,SAAS,UACTA,EAAA,QAAQ,SACRA,EAAA,WAAW,YACXA,EAAA,UAAU,WANFA,IAAAA,KAAA,CAAA,CAAA;AAyDC,MAAAC,IAAc,CAACC,MAAiDA,GAMhEC,IAAiB,CAM1BC,MACIA;"}
|
package/dist/index.umd.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
(function(l,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("@frontify/sidebar-settings"),require("react/jsx-runtime"),require("@frontify/fondue"),require("react"),require("@frontify/app-bridge"),require("@dnd-kit/core"),require("@dnd-kit/modifiers"),require("@dnd-kit/sortable"),require("@react-aria/focus"),require("@udecode/plate"),require("slate-react"),require("@react-stately/overlays"),require("slate"),require("@ctrl/tinycolor")):typeof define=="function"&&define.amd?define(["exports","@frontify/sidebar-settings","react/jsx-runtime","@frontify/fondue","react","@frontify/app-bridge","@dnd-kit/core","@dnd-kit/modifiers","@dnd-kit/sortable","@react-aria/focus","@udecode/plate","slate-react","@react-stately/overlays","slate","@ctrl/tinycolor"],h):(l=typeof globalThis<"u"?globalThis:l||self,h(l.GuidelineBlocksSettings={},l.sidebarSettings,l.jsxRuntime,l.fondue,l.React,l.appBridge,l.core,l.modifiers,l.sortable,l.focus,l.plate,l.slateReact,l.overlays,l.slate,l.tinycolor))})(this,function(l,h,r,o,y,W,T,fn,ct,jt,i,Xt,wn,yn,V){"use strict";const qa="",_=t=>t.filter(Boolean).join(" "),bn=({onDrop:t,label:n,icon:e,secondaryLabel:a,isLoading:s,fillParentContainer:c,onAssetChooseClick:d,onUploadClick:g,withMenu:u=!0,onClick:b,validFileType:f,verticalLayout:m})=>{const[w,v]=y.useState(!1),[x,p]=y.useState(),E=y.useRef(null),[L,M]=y.useState(void 0),D=S=>{if(S.preventDefault(),v(!1),!U(S.dataTransfer.files)){M("Invalid"),setTimeout(()=>{M(void 0)},1e3);return}t==null||t(S.dataTransfer.files)},U=S=>{if(!f)return!0;for(let F=0;F<S.length;F++){const O=S[F].name.split(".").pop()??"";if(!W.FileExtensionSets[f].includes(O))return!1}return!0},z=S=>{if(!E.current||s)return;const{left:F,top:O}=E.current.getBoundingClientRect(),Ct=S.clientX-F,kt=S.clientY-O;p([Ct,kt])};return r.jsxs("button",{ref:E,"data-test-id":"block-inject-button",className:_(["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",m?"[&: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",c?"tw-h-full":"tw-h-[72px]",w&&!s?"tw-border-dashed":"tw-border-solid",x&&"tw-bg-blank-state-pressed-inverse",w&&"tw-bg-blank-state-weak-inverse",L?"!tw-border-red-50 !tw-cursor-not-allowed":" tw-border-blank-state-line",s||x||w||L?"":"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",(w||x)&&!L?"[&>*]:tw-pointer-events-none tw-border-blank-state-line-hover":"tw-bg-blank-state-shaded-inverse tw-text-blank-state-shaded"]),onDragEnter:t?S=>{var F;if(v(!0),f==="Images")for(const O of Array.from(S.dataTransfer.items))(F=O==null?void 0:O.type)!=null&&F.startsWith("image/")?M(void 0):M("Invalid")}:void 0,onDragLeave:t?()=>{v(!1),M(void 0)}:void 0,onDrop:t?D:void 0,onClick:S=>{u&&z(S),b==null||b()},children:[s?r.jsx(o.LoadingCircle,{}):L?r.jsxs("div",{className:" tw-flex tw-items-center tw-justify-center tw-text-red-60 tw-font-medium",children:[r.jsx(o.IconExclamationMarkTriangle,{}),L]}):r.jsxs(r.Fragment,{children:[e&&r.jsx("div",{children:e}),(n||a)&&r.jsxs("div",{className:"tw-flex tw-flex-col tw-items-start",children:[n&&r.jsx("div",{className:"tw-font-medium",children:n}),a&&r.jsx("div",{className:"tw-font-normal",children:a})]})]}),x&&r.jsx("div",{className:"tw-absolute tw-left-0 tw-top-full tw-z-20",style:{left:x[0],top:x[1]},children:r.jsx(o.Flyout,{onOpenChange:S=>!S&&p(void 0),isOpen:!0,fitContent:!0,hug:!1,legacyFooter:!1,trigger:r.jsx("div",{}),children:r.jsx(o.ActionMenu,{menuBlocks:[{id:"menu",menuItems:[...g?[{id:"upload",size:o.MenuItemContentSize.XSmall,title:"Upload asset",onClick:()=>{g(),p(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconArrowCircleUp20,{})})}]:[],...d?[{id:"asset",size:o.MenuItemContentSize.XSmall,title:"Browse asset",onClick:()=>{d(),p(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconImageStack20,{})})}]:[]]}]})})})]})},q=t=>{const n=a=>typeof a=="object"&&["red","green","blue"].every(c=>a.hasOwnProperty(c)),e=a=>{const s=typeof a.alpha=="number"?a.alpha:1;return{r:a.red,g:a.green,b:a.blue,a:s}};return n(t)?e(t):t},vn=t=>typeof t=="object"&&["red","green","blue"].every(e=>t==null?void 0:t.hasOwnProperty(e)),Cn=(t,n)=>{const e=vn(t)?q(t):t,a=new V.TinyColor(e);return n?a.getBrightness()<n:a.isDark()||a.getAlpha()>.25&&a.getAlpha()<1},kn=t=>new V.TinyColor(q(t)).toHex8String(),pn=t=>new V.TinyColor(q(t)).toHexString(),pt=t=>new V.TinyColor(q(t)).toRgbString(),xn=(t,n)=>new V.TinyColor(n).setAlpha(t).toRgbString(),Pn=t=>{const{r:n,g:e,b:a,a:s}=new V.TinyColor(t);return{red:n,green:e,blue:a,alpha:s}},Qt=t=>typeof t=="object"&&["red","green","blue"].every(e=>t==null?void 0:t.hasOwnProperty(e)),Sn=(t,n)=>{const e=Qt(t)?q(t):t,a=Qt(n)?q(n):n;let s=new V.TinyColor(e);const c=new V.TinyColor(a);for(;V.readability(s,c)<4.5;)s=s.darken(1);return s.toRgbString()},Tn=(t,n,e)=>{const a=[...t],s=e<0?a.length+e:e;if(s>=0&&s<a.length){const c=a.splice(n,1)[0];a.splice(s,0,c)}return a},En=t=>({backgroundColor:pt(t)});var H=(t=>(t.Solid="Solid",t.Dashed="Dashed",t.Dotted="Dotted",t))(H||{});const Yt={Solid:"solid",Dotted:"dotted",Dashed:"dashed"};var $=(t=>(t.None="None",t.Small="Small",t.Medium="Medium",t.Large="Large",t))($||{});const G={None:"0px",Small:"2px",Medium:"4px",Large:"12px"};var K=(t=>(t.None="None",t.Small="Small",t.Medium="Medium",t.Large="Large",t))(K||{});const J={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var j=(t=>(t.None="None",t.Small="Small",t.Medium="Medium",t.Large="Large",t))(j||{});const Z={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var X=(t=>(t.Global="Global",t.Custom="Custom",t))(X||{}),Q=(t=>(t.Auto="Auto",t.S="S",t.M="M",t.L="L",t))(Q||{});const Jt={Auto:"4px",S:"10px",M:"30px",L:"50px"},In={red:241,green:241,blue:241,alpha:1},Zt={red:234,green:235,blue:235,alpha:1},Bn="1px",at="24px",st="24px",Nn=(t=H.Solid,n="1px",e=Zt)=>({borderStyle:Yt[t],borderWidth:n,borderColor:pt(e)}),Ln=(t,n=!1,e)=>({borderRadius:n?e:G[t]}),Rt=y.createContext(!1),te=({children:t,isDragPreview:n})=>r.jsx(Rt.Provider,{value:n,children:t}),ot=()=>y.useContext(Rt),ee=y.createContext({openFlyoutIds:[],setOpenFlyoutIds:()=>console.error("No MultiFlyoutContext Provider found")}),ne=({children:t,openFlyoutIds:n,setOpenFlyoutIds:e})=>{const a=y.useMemo(()=>({openFlyoutIds:n,setOpenFlyoutIds:e}),[n,e]);return r.jsx(ee.Provider,{value:a,children:t})},re=()=>y.useContext(ee),dt=t=>{const{openFlyoutIds:n,setOpenFlyoutIds:e}=re(),a=y.useCallback(s=>{e(c=>{const d=c.filter(g=>g!==t);return s?[...d,t]:d})},[t,e]);return{isOpen:n.includes(t),onOpenChange:a}},ae=({children:t})=>r.jsx("div",{className:"tw-pointer-events-auto tw-flex tw-flex-shrink-0 tw-gap-px tw-px-px tw-h-[26px] tw-items-center tw-self-start tw-leading-none",children:t}),se=(t,n)=>{const{blockAssets:e,addAssetIdsToKey:a,deleteAssetIdsFromKey:s,updateAssetIdsFromKey:c}=W.useBlockAssets(t),d=(e==null?void 0:e[n])||[];return{onAttachmentsAdd:async m=>{await a(n,m.map(w=>w.id))},onAttachmentDelete:async m=>{await s(n,[m.id])},onAttachmentReplace:async(m,w)=>{const v=d.map(x=>x.id===m.id?w.id:x.id);await c(n,v)},onAttachmentsSorted:async m=>{const w=m.map(v=>v.id);await c(n,w)},attachments:d,appBridge:t}},oe=y.createContext(null),ie=({appBridge:t,children:n,assetId:e})=>{const a=se(t,e);return r.jsx(oe.Provider,{value:a,children:n})},le=()=>{const t=y.useContext(oe);if(!t)throw new Error("No AttachmentsContext Provided. Component must be wrapped in an 'AttachmentsProvider' or the 'withAttachmentsProvider' HOC");return t},An=(t,n)=>{const e=a=>r.jsx(ie,{appBridge:a.appBridge,assetId:n,children:r.jsx(t,{...a})});return e.displayName="withAttachmentsProvider",e},Fn=[T.KeyboardCode.Down,T.KeyboardCode.Right,T.KeyboardCode.Up,T.KeyboardCode.Left],ce=(t,n)=>(e,{currentCoordinates:a,context:{activeNode:s}})=>{if(e.preventDefault(),Fn.includes(e.code)){const c=(s==null?void 0:s.offsetWidth)??0,d=(s==null?void 0:s.offsetHeight)??0;switch(e.code){case T.KeyboardCode.Right:return{...a,x:a.x+c+t};case T.KeyboardCode.Left:return{...a,x:a.x-c-t};case T.KeyboardCode.Down:return{...a,y:a.y+d+n};case T.KeyboardCode.Up:return{...a,y:a.y-d-n}}}},Mn={start:["Space","Enter"],cancel:[],end:["Space","Enter","Escape"]},Dn=(t=0,n=0)=>{const e=ce(t,n);return T.useSensors(T.useSensor(T.PointerSensor),T.useSensor(T.KeyboardSensor,{coordinateGetter:e,keyboardCodes:Mn}))},On=t=>t==="IMAGE"?r.jsx(o.IconImage24,{}):t==="VIDEO"?r.jsx(o.IconPlayFrame24,{}):t==="AUDIO"?r.jsx(o.IconMusicNote24,{}):r.jsx(o.IconDocument24,{}),xt=y.forwardRef(({item:t,isEditing:n,draggableProps:e,transformStyle:a,isDragging:s,isOverlay:c,isLoading:d,onDelete:g,onReplaceWithBrowse:u,onReplaceWithUpload:b,onDownload:f},m)=>{const[w,v]=y.useState(),[x,{selectedFiles:p}]=W.useFileInput({multiple:!0,accept:"image/*"}),[E,{results:L,doneAll:M}]=W.useAssetUpload(),{focusProps:D,isFocusVisible:U}=jt.useFocusRing();y.useEffect(()=>{p&&E(p[0])},[p]),y.useEffect(()=>{M&&b(L[0])},[M,L]);const z=d||p&&!M;return r.jsxs("button",{"aria-label":"Download attachment","data-test-id":"attachments-item",onClick:()=>f==null?void 0:f(),ref:m,style:{...a,opacity:s&&!c?.3:1,fontFamily:"var(-f-theme-settings-body-font-family)"},className:_(["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",s?"tw-bg-box-neutral-hover":""]),children:[r.jsx("div",{className:"tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover",children:z?r.jsx(o.LoadingCircle,{size:o.LoadingCircleSize.Small}):On(t.objectType)}),r.jsxs("div",{className:"tw-text-s tw-flex-1 tw-min-w-0",children:[r.jsx("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:t.title}),r.jsx("div",{className:"tw-text-text-weak",children:`${t.fileSizeHumanReadable} - ${t.extension}`})]}),n&&r.jsxs("div",{"data-test-id":"attachments-actionbar",className:_(["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",c||(w==null?void 0:w.id)===t.id?"tw-opacity-100":"tw-opacity-0"]),children:[r.jsx("button",{...D,...e,"aria-label":"Drag attachment",className:_([" 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 ",s||c?"tw-cursor-grabbing tw-bg-button-background-pressed hover:tw-bg-button-background-pressed":"tw-cursor-grab hover:tw-bg-button-background-hover",U&&o.FOCUS_STYLE,U&&"tw-z-[2]"]),children:r.jsx(o.IconGrabHandle20,{})}),r.jsx("div",{"data-test-id":"attachments-actionbar-flyout",children:r.jsx(o.Flyout,{placement:o.FlyoutPlacement.Right,isOpen:(w==null?void 0:w.id)===t.id,fitContent:!0,legacyFooter:!1,onOpenChange:S=>v(S?t:void 0),trigger:(S,F)=>r.jsx(o.Button,{ref:F,icon:r.jsx(o.IconPen20,{}),emphasis:o.ButtonEmphasis.Default,onClick:()=>v(t)}),children:r.jsx(o.ActionMenu,{menuBlocks:[{id:"menu",menuItems:[{id:"upload",size:o.MenuItemContentSize.XSmall,title:"Replace with upload",onClick:()=>{x(),v(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconArrowCircleUp20,{})})},{id:"asset",size:o.MenuItemContentSize.XSmall,title:"Replace with asset",onClick:()=>{u(),v(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconImageStack20,{})})}]},{id:"menu-delete",menuItems:[{id:"delete",size:o.MenuItemContentSize.XSmall,title:"Delete",style:o.MenuItemStyle.Danger,onClick:()=>{g(),v(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconTrashBin20,{})})}]}]})})})]})]})});xt.displayName="AttachmentItem";const Un=t=>{const{attributes:n,listeners:e,setNodeRef:a,transform:s,transition:c,isDragging:d}=ct.useSortable({id:t.item.id}),g={transform:s?`translate(${s.x}px, ${s.y}px)`:"",transition:c,zIndex:d?2:1},u={...n,...e};return r.jsx(xt,{ref:a,isDragging:d,transformStyle:g,draggableProps:u,...t})},_n=({children:t,isFlyoutOpen:n,triggerProps:e,triggerRef:a})=>r.jsxs("button",{className:_(["tw-flex tw-text-xs tw-font-body tw-items-center tw-gap-1 tw-rounded-full tw-outline tw-outline-1 tw-outline-offset-1 tw-p-1.5 tw-outline-line",n?"tw-bg-box-neutral-pressed tw-text-box-neutral-inverse-pressed":"tw-bg-base hover:tw-bg-box-neutral-hover active:tw-bg-box-neutral-pressed tw-text-box-neutral-inverse hover:tw-text-box-neutral-inverse-hover active:tw-text-box-neutral-inverse-pressed"]),...e,ref:a,"data-test-id":"attachments-button-trigger",children:[r.jsx(o.IconPaperclip16,{}),t,r.jsx(o.IconCaretDown12,{})]}),de=({items:t=[],onDelete:n,onReplaceWithBrowse:e,onReplaceWithUpload:a,onBrowse:s,onUpload:c,onSorted:d,appBridge:g,triggerComponent:u=_n,isOpen:b,onOpenChange:f})=>{const[m,w]=y.useState(t),[v,x]=y.useState(!1),p=T.useSensors(T.useSensor(T.PointerSensor),T.useSensor(T.KeyboardSensor)),[E,L]=y.useState(void 0),[M,D]=y.useState(!1),[U,z]=y.useState([]),[S,F]=y.useState(null),O=W.useEditorState(g),{openAssetChooser:Ct,closeAssetChooser:kt}=W.useAssetChooser(g),cn=b!==void 0,Gt=cn?b:v,rt=m==null?void 0:m.find(k=>k.id===E),[_a,{results:dn,doneAll:un}]=W.useAssetUpload({onUploadProgress:()=>!M&&D(!0)}),lt=k=>{const B=cn?f:x;B==null||B(k)};y.useEffect(()=>{w(t)},[t]),y.useEffect(()=>{S&&(D(!0),_a(S))},[S]),y.useEffect(()=>{(async()=>{un&&(await c(dn),D(!1))})()},[un,dn]);const Ha=()=>{lt(!1),Ct(k=>{s(k),kt(),lt(!0)},{multiSelection:!0,selectedValueIds:m.map(k=>k.id)})},gn=k=>{lt(!1),Ct(async B=>{lt(!0),kt(),z([...U,k.id]),await e(k,B[0]),z(U.filter(Y=>Y!==k.id))},{multiSelection:!1,selectedValueIds:m.map(B=>B.id)})},hn=async(k,B)=>{z([...U,k.id]),await a(k,B),z(U.filter(Y=>Y!==k.id))},Va=k=>{const{active:B}=k;L(B.id)},za=k=>{const{active:B,over:Y}=k;if(Y&&B.id!==Y.id&&m){const $a=m.findIndex(Kt=>Kt.id===B.id),Wa=m.findIndex(Kt=>Kt.id===Y.id),mn=ct.arrayMove(m,$a,Wa);w(mn),d(mn)}L(void 0)};return O||((m==null?void 0:m.length)??0)>0?r.jsx(o.LegacyTooltip,{withArrow:!0,position:o.TooltipPosition.Top,content:"Attachments",disabled:Gt,enterDelay:500,triggerElement:r.jsx("div",{"data-test-id":"attachments-flyout-button",children:r.jsx(o.Flyout,{placement:o.FlyoutPlacement.BottomRight,onOpenChange:k=>lt(rt?!0:k),isOpen:Gt,hug:!1,fitContent:!0,legacyFooter:!1,trigger:(k,B)=>r.jsx(u,{isFlyoutOpen:Gt,triggerProps:k,triggerRef:B,children:r.jsx("div",{children:t.length>0?t.length:"Add"})}),children:r.jsxs("div",{className:"tw-w-[300px]","data-test-id":"attachments-flyout-content",children:[m.length>0&&r.jsxs(T.DndContext,{sensors:p,collisionDetection:T.closestCenter,onDragStart:Va,onDragEnd:za,modifiers:[fn.restrictToWindowEdges],children:[r.jsx(ct.SortableContext,{items:m,strategy:ct.rectSortingStrategy,children:r.jsx("div",{className:"tw-border-b tw-border-b-line",children:m.map(k=>r.jsx(Un,{isEditing:O,isLoading:U.includes(k.id),item:k,onDelete:()=>n(k),onReplaceWithBrowse:()=>gn(k),onReplaceWithUpload:B=>hn(k,B),onDownload:()=>g.dispatch({name:"downloadAsset",payload:k})},k.id))})}),r.jsx(T.DragOverlay,{children:rt&&r.jsx(xt,{isOverlay:!0,isEditing:O,item:rt,isDragging:!0,onDelete:()=>n(rt),onReplaceWithBrowse:()=>gn(rt),onReplaceWithUpload:k=>hn(rt,k)},E)})]}),O&&r.jsxs("div",{className:"tw-px-5 tw-py-3",children:[r.jsx("div",{className:"tw-font-body tw-font-medium tw-text-text tw-text-s tw-my-4",children:"Add attachments"}),r.jsx(o.AssetInput,{isLoading:M,size:o.AssetInputSize.Small,onUploadClick:k=>F(k),onLibraryClick:Ha})]})]})})})}):null},Hn=(t,n)=>{const e=[o.FOCUS_VISIBLE_STYLE,"tw-relative tw-inline-flex tw-items-center tw-justify-center","tw-h-6 tw-p-1","tw-rounded","tw-text-xs tw-font-medium","tw-gap-0.5","focus-visible:tw-z-10"];return n?e.push("tw-bg-box-neutral-pressed","tw-text-box-neutral-inverse-pressed",t==="grab"?"tw-cursor-grabbing":"tw-cursor-pointer"):e.push("hover:tw-bg-box-neutral-hover active:tw-bg-box-neutral-pressed","tw-text-text-weak hover:tw-text-box-neutral-inverse-hover active:tw-text-box-neutral-inverse-pressed",t==="grab"?"!tw-cursor-grab active:tw-cursor-grabbing":"tw-cursor-pointer"),_(e)},it=y.forwardRef(({onClick:t,children:n,forceActiveStyle:e,cursor:a="pointer","data-test-id":s="base-toolbar-button",...c},d)=>r.jsx("button",{onClick:t,className:Hn(a,e),"data-test-id":s,...c,ref:d,children:n}));it.displayName="BaseToolbarButton";const Vn=({children:t,isFlyoutOpen:n,triggerProps:e,triggerRef:a})=>r.jsxs(it,{forceActiveStyle:n,"data-test-id":"attachments-toolbar-button-trigger",...e,ref:a,children:[r.jsx(o.IconPaperclip16,{}),t,r.jsx(o.IconCaretDown12,{})]}),ue="attachments",ge=({flyoutId:t=ue})=>{const n=o.useMemoizedId(t),{appBridge:e,attachments:a,onAttachmentsAdd:s,onAttachmentDelete:c,onAttachmentReplace:d,onAttachmentsSorted:g}=le(),{isOpen:u,onOpenChange:b}=dt(n),f=ot();return r.jsx(de,{onUpload:s,onDelete:c,onReplaceWithBrowse:d,onReplaceWithUpload:d,onSorted:g,onBrowse:s,items:a,appBridge:e,triggerComponent:Vn,isOpen:u&&!f,onOpenChange:b})},Pt=({open:t,content:n,children:e,disabled:a})=>r.jsx(o.LegacyTooltip,{withArrow:!0,hoverDelay:0,enterDelay:300,open:t,disabled:a,position:o.TooltipPosition.Top,content:r.jsx("div",{children:n}),triggerElement:e,"data-test-id":"toolbar-button-tooltip"}),zn=({tooltip:t,icon:n,onClick:e})=>{const a=ot();return r.jsx(Pt,{disabled:a,content:t??"",children:r.jsx(it,{"data-test-id":"block-item-wrapper-toolbar-btn",onClick:e,children:n})})},he="Drag or press ↵ to move",me="Move with ↑↓←→ and confirm with ↵",fe=({tooltip:t,icon:n,setActivatorNodeRef:e,draggableProps:a})=>{const s=ot();return r.jsx(Pt,{open:s,content:r.jsx("div",{children:s?me:t??he}),children:r.jsx(it,{ref:e,"data-test-id":"block-item-wrapper-toolbar-btn",forceActiveStyle:s,cursor:"grab",...a,children:n})})},St=({content:t,icon:n,tooltip:e,flyoutId:a,flyoutFooter:s,flyoutHeader:c})=>{const d=o.useMemoizedId(a),{isOpen:g,onOpenChange:u}=dt(d),b=ot();return r.jsx(Pt,{disabled:b||g,content:e,children:r.jsx("div",{className:"tw-flex tw-flex-shrink-0 tw-flex-1 tw-h-6 tw-relative",children:r.jsx(o.Flyout,{isOpen:g&&!b,legacyFooter:!1,fixedFooter:s,fixedHeader:c,fitContent:!0,hug:!1,placement:o.FlyoutPlacement.BottomRight,onOpenChange:u,trigger:(f,m)=>r.jsx(it,{"data-test-id":"block-item-wrapper-toolbar-flyout",forceActiveStyle:g&&!b,...f,ref:m,children:n}),children:t})})})},we=({items:t,flyoutId:n})=>{const{onOpenChange:e}=dt(n);return r.jsx(o.ActionMenu,{menuBlocks:t.map((a,s)=>({id:s.toString(),menuItems:a.map((c,d)=>({id:s.toString()+d.toString(),size:o.MenuItemContentSize.XSmall,title:c.title,style:c.style,onClick:()=>{e(!1),c.onClick()},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:c.icon})}))}))})},Tt="menu",ye=({items:t,flyoutId:n=Tt,tooltip:e="Options"})=>{const a=o.useMemoizedId(n);return r.jsx(St,{icon:r.jsx(o.IconDotsHorizontal16,{}),tooltip:e,flyoutId:a,content:r.jsx(we,{items:t,flyoutId:a})})},be=({items:t,attachments:n})=>r.jsxs("div",{"data-test-id":"block-item-wrapper-toolbar",className:"tw-rounded-md tw-bg-base tw-border tw-border-line-strong tw-divide-x tw-divide-line-strong tw-shadow-lg tw-flex tw-flex-none tw-items-center tw-isolate",children:[n.isEnabled&&r.jsx(ae,{children:r.jsx(ge,{})}),r.jsx(ae,{children:t.map(e=>e.type==="dragHandle"?r.jsx(fe,{...e},e.tooltip+e.type):e.type==="menu"?r.jsx(ye,{...e},e.tooltip+e.type):e.type==="flyout"?r.jsx(St,{...e},e.tooltip+e.type):r.jsx(zn,{...e},e.tooltip+e.type))})]}),$n=({children:t,toolbarItems:n,shouldHideWrapper:e,shouldHideComponent:a=!1,isDragging:s=!1,shouldFillContainer:c,outlineOffset:d=2,shouldBeShown:g=!1,showAttachments:u=!1})=>{const[b,f]=y.useState(g?[Tt]:[]),m=y.useRef(null);if(e)return r.jsx(r.Fragment,{children:t});const w=n==null?void 0:n.filter(x=>x!==void 0),v=b.length>0||g;return r.jsx(te,{isDragPreview:s,children:r.jsx(ne,{openFlyoutIds:b,setOpenFlyoutIds:f,children:r.jsxs("div",{ref:m,"data-test-id":"block-item-wrapper",style:{outlineOffset:d},className:_(["tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse",c&&"tw-flex-1 tw-h-full tw-w-full","hover:tw-outline focus-within:tw-outline",v&&"tw-outline",a&&"tw-opacity-0"]),children:[r.jsx("div",{style:{right:-1-d,bottom:`calc(100% - ${2+d}px)`},className:_(["tw-pointer-events-none tw-absolute tw-bottom-[calc(100%-4px)] tw-right-[-3px] tw-w-full tw-opacity-0 tw-z-[60]","group-hover:tw-opacity-100 group-focus:tw-opacity-100 focus-within:tw-opacity-100","tw-flex tw-justify-end",v&&"tw-opacity-100"]),children:r.jsx(be,{attachments:{isEnabled:u},items:w})}),t]})})})},Wn=({onDownload:t})=>{const{isFocused:n,focusProps:e}=jt.useFocusRing();return r.jsx(o.LegacyTooltip,{withArrow:!0,position:o.TooltipPosition.Top,content:"Download",enterDelay:500,triggerElement:r.jsx("button",{tabIndex:0,"aria-label":"Download",...e,className:_(["tw-outline-none tw-rounded",n&&o.FOCUS_STYLE]),onClick:t,onPointerDown:a=>a.preventDefault(),children:r.jsx("span",{"data-test-id":"download-button",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",children:r.jsx(o.IconArrowCircleDown16,{})})})})},qn=({value:t="",gap:n,columns:e,show:a=!0,plugins:s})=>{const[c,d]=y.useState(null);return y.useEffect(()=>{(async()=>d(await o.serializeRawToHtmlAsync(t,s,e,n)))()},[t,e,n,s]),!a||c==="<br />"?null:c!==null?r.jsx("div",{className:"tw-w-full tw-whitespace-pre-wrap","data-test-id":"rte-content-html",dangerouslySetInnerHTML:{__html:c}}):r.jsx("div",{className:"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full"})},ve=t=>{if(!t)return!1;const n=e=>e.some(a=>a.text?a.text!=="":a.children?n(a.children):!1);try{const e=JSON.parse(t);return n(e)}catch{return!1}},Gn=(t="p",n="",e)=>ve(n)?n:JSON.stringify([{type:t,children:[{text:n,textStyle:t}],align:e}]),Kn=(t,n,e)=>t===X.Custom?n:e,jn=t=>t.map(Ce),Ce=t=>({id:t.id,title:t.name,colors:t.colors.map(Qn)}),Xn=t=>"revision"in t,Qn=t=>{if(Xn(t)){const{title:n,revision:e}=t;return{alpha:e.rgba.alpha?e.rgba.alpha/255:1,red:e.rgba.red??0,green:e.rgba.green??0,blue:e.rgba.blue??0,name:n??""}}return{alpha:t.alpha?t.alpha/255:1,red:t.red??0,green:t.green??0,blue:t.blue??0,name:t.name??""}},Et=(t,n)=>{const e=i.getAboveNode(t,{match:{type:i.ELEMENT_LINK}});return Array.isArray(e)?n(e[0]):""},ke=t=>Et(t,n=>{var e,a;return((a=(e=n.chosenLink)==null?void 0:e.searchResult)==null?void 0:a.link)||""}),pe=t=>Et(t,n=>n.url||""),xe=t=>{var n,e;return t.url||((e=(n=t.chosenLink)==null?void 0:n.searchResult)==null?void 0:e.link)||""},Pe=t=>Et(t,xe),It=/^\/(document|r)\/\S+$/i,ut=t=>{if(It.test(t))return t;try{return new URL(t),t}catch{return`https://${t}`}},gt=t=>{if(It.test(t))return!0;try{const n=new URL(t);return["http:","https:","mailto:","tel:"].includes(n.protocol)&&n.pathname!==""}catch{return!1}},R=t=>gt(ut(t))||t==="",Se=(t,{type:n})=>{const{apply:e,normalizeNode:a}=t;return t.apply=s=>{if(s.type!=="set_selection"){e(s);return}const c=s.newProperties;if(!(c!=null&&c.focus)||!c.anchor||!i.isCollapsed(c)){e(s);return}const d=i.getAboveNode(t,{at:c,match:{type:i.getPluginType(t,P)}});if(d){const[,g]=d;let u;i.isStartPoint(t,c.focus,g)&&(u=i.getPreviousNodeEndPoint(t,g)),i.isEndPoint(t,c.focus,g)&&(u=i.getNextNodeStartPoint(t,g)),u&&(s.newProperties={anchor:u,focus:u})}e(s)},t.normalizeNode=([s,c])=>{if(s.type===i.getPluginType(t,P)){const d=t.selection;if(d&&i.isCollapsed(d)&&i.isEndPoint(t,d.focus,c)){const g=i.getNextNodeStartPoint(t,c);if(g)i.select(t,g);else{const u=yn.Path.next(c);i.insertNodes(t,{text:""},{at:u}),i.select(t,u)}}}a([s,c])},i.withRemoveEmptyNodes(t,i.mockPlugin({options:{types:n}}))},Te=(t,n,e)=>{i.insertNodes(t,[Ne(t,n)],e)},Bt=i.createStore("floatingButton")({openEditorId:null,mouseDown:!1,updated:!1,url:"",text:"",buttonStyle:"primary",newTab:!1,mode:"",isEditing:!1}).extendActions(t=>({reset:()=>{t.url(""),t.text(""),t.buttonStyle("primary"),t.newTab(!1),t.mode(""),t.isEditing(!1)}})).extendActions(t=>({show:(n,e)=>{t.mode(n),t.isEditing(!1),t.openEditorId(e)},hide:()=>{t.reset(),t.openEditorId(null)}})).extendSelectors(t=>({isOpen:n=>t.openEditorId===n})),I=Bt.set,A=Bt.get,tt=()=>Bt.use,Nt=t=>{if(!t.selection)return;const{isUrl:n,forceSubmit:e}=i.getPluginOptions(t,P),a=A.url();if(!((n==null?void 0:n(a))||e))return;const c=A.text(),d=A.buttonStyle(),g=A.newTab()?void 0:"_self";return I.hide(),Ee(t,{url:a,text:c,buttonStyle:d,target:g,isUrl:u=>e||!n?!0:n(u)}),setTimeout(()=>{i.focusEditor(t,t.selection??void 0)},0),!0},et=(t,n)=>i.withoutNormalizing(t,()=>{var e,a,s,c,d,g;if(n!=null&&n.split){if(i.getAboveNode(t,{at:(e=t.selection)==null?void 0:e.anchor,match:{type:i.getPluginType(t,P)}}))return i.splitNodes(t,{at:(a=t.selection)==null?void 0:a.anchor,match:f=>i.isElement(f)&&f.type===i.getPluginType(t,P)}),et(t,{at:(s=t.selection)==null?void 0:s.anchor}),!0;if(i.getAboveNode(t,{at:(c=t.selection)==null?void 0:c.focus,match:{type:i.getPluginType(t,P)}}))return i.splitNodes(t,{at:(d=t.selection)==null?void 0:d.focus,match:f=>i.isElement(f)&&f.type===i.getPluginType(t,P)}),et(t,{at:(g=t.selection)==null?void 0:g.focus}),!0}i.unwrapNodes(t,{match:{type:i.getPluginType(t,P)},...n})}),Ee=(t,{url:n,text:e,buttonStyle:a,target:s,insertTextInButton:c,insertNodesOptions:d,isUrl:g=i.getPluginOptions(t,P).isUrl})=>{var L;const u=t.selection;if(!u)return;const b=i.getAboveNode(t,{at:u,match:{type:i.getPluginType(t,P)}});if(c&&b)return t.insertText(n),!0;if(!(g!=null&&g(n)))return;if(i.isDefined(e)&&e.length===0&&(e=n),b)return Zn(n,t,b,s,a,e),!0;const f=i.findNode(t,{at:u,match:{type:i.getPluginType(t,P)}}),[m,w]=f??[],v=Yn(t,w,e);if(i.isExpanded(u))return Jn(b,t,n,a,s,e),!0;v&&i.removeNodes(t,{at:w});const x=i.getNodeProps(m??{}),p=(L=t.selection)==null?void 0:L.focus.path;if(!p)return;const E=i.getNodeLeaf(t,p);return e!=null&&e.length||(e=n),Te(t,{...x,url:n,target:s,children:[{...E,text:e}]},d),!0};function Yn(t,n,e){return n&&(e==null?void 0:e.length)&&e!==i.getEditorString(t,n)}function Jn(t,n,e,a,s,c){t?et(n,{at:t[1]}):et(n,{split:!0}),Ie(n,{url:e,buttonStyle:a,target:s}),Lt(n,{url:e,target:s,text:c})}function Zn(t,n,e,a,s,c){var d,g,u;(t!==((d=e[0])==null?void 0:d.url)||a!==((g=e[0])==null?void 0:g.target)||s!==((u=e[0])==null?void 0:u.buttonStyle))&&i.setNodes(n,{url:t,target:a,buttonStyle:s},{at:e[1]}),Lt(n,{url:t,text:c,target:a})}const Lt=(t,{text:n})=>{const e=i.getAboveNode(t,{match:{type:i.getPluginType(t,P)}});if(e){const[a,s]=e;if(n!=null&&n.length&&n!==i.getEditorString(t,s)){const c=a.children[0];i.replaceNodeChildren(t,{at:s,nodes:{...c,text:n},insertOptions:{select:!0}})}}},Ie=(t,{url:n,buttonStyle:e,target:a,...s})=>{i.wrapNodes(t,{type:i.getPluginType(t,P),url:n,buttonStyle:e,target:a,children:[]},{split:!0,...s})},Rn=(t,n)=>{const e=i.getAboveNode(t,{match:{type:P}});return Array.isArray(e)?n(e[0]):""},Be=t=>Rn(t,n=>n.url??""),Ne=(t,{url:n,text:e="",buttonStyle:a="primary",target:s,children:c})=>({type:i.getPluginType(t,P),url:n,target:s,buttonStyle:a,children:c??[{text:e}]}),Le=(t,{focused:n}={})=>{if(A.mode()==="edit"){ht(t);return}At(t,{focused:n})},ht=t=>{const n=i.findNode(t,{match:{type:i.getPluginType(t,P)}});if(!n)return;const[e,a]=n;let s=i.getEditorString(t,a);I.url(e.url),I.newTab(e.target===void 0),s===e.url&&(s=""),I.text(s),I.isEditing(!0)},At=(t,{focused:n}={})=>{A.mode()||!n||i.isRangeAcrossBlocks(t,{at:t.selection})||i.someNode(t,{match:{type:i.getPluginType(t,P)}})||(I.text(i.getEditorString(t,t.selection)),I.show("insert",t.id))},mt={buttonPrimary:{fontFamily:"var(--f-theme-settings-button-primary-font-family)",fontSize:"var(--f-theme-settings-button-primary-font-size)",fontWeight:"var(--f-theme-settings-button-primary-font-weight)",lineHeight:"var(--f-theme-settings-button-primary-line-height)",paddingTop:"var(--f-theme-settings-button-primary-padding-top)",paddingRight:"var(--f-theme-settings-button-primary-padding-right)",paddingBottom:"var(--f-theme-settings-button-primary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-primary-padding-left)",fontStyle:"var(--f-theme-settings-button-primary-font-style)",textTransform:"var(--f-theme-settings-button-primary-text-transform)",backgroundColor:"var(--f-theme-settings-button-primary-background-color)",borderColor:"var(--f-theme-settings-button-primary-border-color)",borderRadius:"var(--f-theme-settings-button-primary-border-radius)",borderWidth:"var(--f-theme-settings-button-primary-border-width)",color:"var(--f-theme-settings-button-primary-color)",marginTop:"10px",marginBottom:"10px",display:"inline-block",hover:{backgroundColor:"var(--f-theme-settings-button-primary-background-color-hover)",borderColor:"var(--f-theme-settings-button-primary-border-color-hover)",color:"var(--f-theme-settings-button-primary-color-hover)"}},buttonSecondary:{fontFamily:"var(--f-theme-settings-button-secondary-font-family)",fontSize:"var(--f-theme-settings-button-secondary-font-size)",fontWeight:"var(--f-theme-settings-button-secondary-font-weight)",lineHeight:"var(--f-theme-settings-button-secondary-line-height)",paddingTop:"var(--f-theme-settings-button-secondary-padding-top)",paddingRight:"var(--f-theme-settings-button-secondary-padding-right)",paddingBottom:"var(--f-theme-settings-button-secondary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-secondary-padding-left)",fontStyle:"var(--f-theme-settings-button-secondary-font-style)",textTransform:"var(--f-theme-settings-button-secondary-text-transform)",backgroundColor:"var(--f-theme-settings-button-secondary-background-color)",borderColor:"var(--f-theme-settings-button-secondary-border-color)",borderRadius:"var(--f-theme-settings-button-secondary-border-radius)",borderWidth:"var(--f-theme-settings-button-secondary-border-width)",color:"var(--f-theme-settings-button-secondary-color)",display:"inline-block",marginTop:"10px",marginBottom:"10px",hover:{backgroundColor:"var(--f-theme-settings-button-secondary-background-color-hover)",borderColor:"var(--f-theme-settings-button-secondary-border-color-hover)",color:"var(--f-theme-settings-button-secondary-color-hover)"}},buttonTertiary:{fontFamily:"var(--f-theme-settings-button-tertiary-font-family)",fontSize:"var(--f-theme-settings-button-tertiary-font-size)",fontWeight:"var(--f-theme-settings-button-tertiary-font-weight)",lineHeight:"var(--f-theme-settings-button-tertiary-line-height)",paddingTop:"var(--f-theme-settings-button-tertiary-padding-top)",paddingRight:"var(--f-theme-settings-button-tertiary-padding-right)",paddingBottom:"var(--f-theme-settings-button-tertiary-padding-bottom)",paddingLeft:"var(--f-theme-settings-button-tertiary-padding-left)",fontStyle:"var(--f-theme-settings-button-tertiary-font-style)",textTransform:"var(--f-theme-settings-button-tertiary-text-transform)",backgroundColor:"var(--f-theme-settings-button-tertiary-background-color)",borderColor:"var(--f-theme-settings-button-tertiary-border-color)",borderRadius:"var(--f-theme-settings-button-tertiary-border-radius)",borderWidth:"var(--f-theme-settings-button-tertiary-border-width)",color:"var(--f-theme-settings-button-tertiary-color)",display:"inline-block",marginTop:"10px",marginBottom:"10px",hover:{backgroundColor:"var(--f-theme-settings-button-tertiary-background-color-hover)",borderColor:"var(--f-theme-settings-button-tertiary-border-color-hover)",color:"var(--f-theme-settings-button-tertiary-color-hover)"}}},tr=t=>({...i.useElementProps({...t,elementToAttributes:e=>({url:e.href,buttonStyle:e.buttonStyle||"primary",target:e.target||"_blank"})}),onMouseOver:e=>{e.stopPropagation()}}),er=t=>{const{href:n,target:e,buttonStyle:a}=tr(t),{attributes:s,children:c}=t;return r.jsx(nr,{attributes:s,href:n,target:e,styles:mt[`button${a.charAt(0).toUpperCase()+a.slice(1)}`],children:c})},nr=({attributes:t,styles:n={hover:{}},children:e,href:a="#",target:s})=>{const[c,d]=y.useState(!1);return r.jsx("a",{...t,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),href:a,target:s,style:c?{...n,...n.hover}:n,children:e})};class rr extends o.MarkupElement{constructor(n=P,e=er){super(n,e)}}const ar=({type:t,...n})=>{const e=i.useEditorRef(),a=!!i.isRangeInSameBlock(e,{at:e.selection}),s=!!(e!=null&&e.selection)&&i.someNode(e,{match:{type:t}});return r.jsx(i.ToolbarButton,{tooltip:o.getTooltip(a?`Button
|
|
2
|
-
${o.getHotkeyByPlatform("Ctrl+Shift+K")}`:"Buttons can only be set for a single text block."),classNames:o.getButtonClassNames(a),active:s,onMouseDown:async c=>{e&&(c.preventDefault(),c.stopPropagation(),i.focusEditor(e,e.selection??e.prevSelection??void 0),setTimeout(()=>{Le(e,{focused:!0})},0))},...n})},sr=({editor:t,id:n})=>r.jsx("div",{"data-plugin-id":n,children:r.jsx(ar,{type:i.getPluginType(t,P),icon:r.jsx("span",{className:"tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex",children:r.jsx(o.IconButton16,{})}),styles:o.buttonStyles})}),or=()=>{const t=Tr({});return r.jsx("div",{"data-test-id":"floating-button-edit",className:"tw-bg-white tw-text-text tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]",children:r.jsxs("span",{"data-test-id":"preview-button-flyout",className:"tw-flex tw-justify-between tw-items-center",children:[r.jsx("span",{className:"tw-pointer-events-none",children:t.defaultValue}),r.jsxs("span",{className:"tw-flex tw-gap-2",children:[r.jsx("span",{role:"button",tabIndex:0,"data-test-id":"edit-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:r.jsx(wt.EditButton,{children:r.jsx(o.IconPen16,{})})}),r.jsx("span",{role:"button",tabIndex:0,"data-test-id":"remove-button-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:r.jsx(wt.UnlinkButton,{children:r.jsx(o.IconTrashBin16,{})})})]})]})})},ir=({section:t,selectedUrl:n,onSelectUrl:e})=>{const a=t.permanentLink===n;return r.jsx("button",{"data-test-id":"internal-link-selector-section-link",className:o.merge(["tw-py-2 tw-px-2.5 tw-pl-14 tw-leading-5 tw-cursor-pointer tw-w-full",a?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>e(t.permanentLink),children:r.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-h-6",children:[r.jsx(o.IconDocumentText16,{}),r.jsx("span",{className:"tw-text-s",children:t.title}),r.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Section"})]})})},lr=({page:t,selectedUrl:n,onSelectUrl:e,itemsToExpandInitially:a,getDocumentSectionsByDocumentPageId:s})=>{const[c,d]=y.useState(t.id===a.documentId),[g,u]=y.useState([]),b=t.permanentLink===n;y.useEffect(()=>{(async()=>{const v=await s(t.id);u(v)})()},[t.id,s]),y.useEffect(()=>{t.id===a.pageId&&d(!0)},[a,t.id]);const f=[...g.values()],m=f.length>0;return r.jsxs(r.Fragment,{children:[r.jsx("button",{"data-test-id":"internal-link-selector-page-link",className:o.merge(["tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-flex tw-w-full",m?"tw-pl-7":"tw-pl-12",b?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>e(t.permanentLink),children:r.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6",children:[m&&r.jsx("button",{"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",onClick:()=>d(!c),children:r.jsx("div",{className:o.merge(["tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong",c?"tw-rotate-90":""])})}),r.jsx("span",{className:"tw-text-s",children:t.title}),r.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Page"})]},t.id)}),c&&f.length>0&&f.map(w=>r.jsx(ir,{section:w,selectedUrl:n,onSelectUrl:e},w.id))]})},Ae=()=>r.jsx("div",{className:"tw-flex tw-justify-center tw-h-10 tw-items-center",children:r.jsx(o.LoadingCircle,{size:o.LoadingCircleSize.Small})}),cr=({documentId:t,selectedUrl:n,onSelectUrl:e,itemsToExpandInitially:a,getDocumentSectionsByDocumentPageId:s,getDocumentPagesByDocumentId:c})=>{const[d,g]=y.useState([]),[u,b]=y.useState(!0),f=[...d.values()],m=!u&&f.length>0;return y.useEffect(()=>{c(t).then(w=>{const v=w.filter(p=>!!p.category).sort((p,E)=>p.category.sort===E.category.sort?p.sort-E.sort:p.category.sort-E.category.sort),x=w.filter(p=>!p.category).sort((p,E)=>p.sort-E.sort);g([...v,...x])}).finally(()=>{b(!1)})},[]),u?r.jsx(Ae,{}):m?r.jsx(r.Fragment,{children:f.map(w=>r.jsx(lr,{page:w,selectedUrl:n,onSelectUrl:e,itemsToExpandInitially:a,getDocumentSectionsByDocumentPageId:s},w.id))}):r.jsx("div",{className:"tw-h-10 tw-flex tw-items-center tw-pr-2.5 tw-pl-7 tw-leading-5 tw-text-s tw-text-text-weak",children:"This document does not contain any pages."})},dr=({document:t,selectedUrl:n,onSelectUrl:e,itemsToExpandInitially:a,getDocumentSectionsByDocumentPageId:s,getDocumentPagesByDocumentId:c})=>{const[d,g]=y.useState(t.id===a.documentId),u=t.permanentLink===n;return y.useEffect(()=>{t.id===a.documentId&&g(!0)},[a,t.id]),r.jsxs(r.Fragment,{children:[r.jsxs("button",{"data-test-id":"internal-link-selector-document-link",className:o.merge(["tw-flex tw-flex-1 tw-space-x-2 tw-items-center tw-py-2 tw-pr-2.5 tw-leading-5 tw-cursor-pointer tw-w-full",u?"tw-bg-box-selected-strong tw-text-box-selected-strong-inverse hover:tw-bg-box-selected-strong-hover:hover hover:tw-text-box-selected-strong-inverse-hover:hover":"hover:tw-bg-box-neutral-hover hover:tw-text-box-neutral-inverse-hover"]),onClick:()=>e(t.permanentLink),children:[r.jsx("button",{role:"button",tabIndex:0,"data-test-id":"tree-item-toggle",className:"tw-flex tw-items-center tw-justify-center -tw-mr-2 tw-pr-3.5 tw-pt-1.5 tw-pb-1.5 tw-pl-3.5 tw-cursor-pointer",onClick:()=>g(!d),children:r.jsx("div",{className:o.merge(["tw-transition-transform tw-w-0 tw-h-0 tw-font-normal tw-border-t-4 tw-border-t-transparent tw-border-b-4 tw-border-b-transparent tw-border-l-4 tw-border-l-x-strong",d?"tw-rotate-90":""])})}),r.jsx(o.IconColorFan16,{}),r.jsx("span",{className:"tw-text-s",children:t.title}),r.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Document"})]}),d&&r.jsx(cr,{documentId:t.id,selectedUrl:n,onSelectUrl:e,itemsToExpandInitially:a,getDocumentSectionsByDocumentPageId:s,getDocumentPagesByDocumentId:c})]})},ur=({selectedUrl:t,onSelectUrl:n,getAllDocuments:e,getDocumentPagesByDocumentId:a,getDocumentSectionsByDocumentPageId:s})=>{const[c,d]=y.useState(!0),[g,u]=y.useState([]),[b,f]=y.useState({documentId:void 0,pageId:void 0}),m=[...g.values()];y.useEffect(()=>{t&&m.length>0&&w().then(v=>{f(v)})},[m.length]),y.useEffect(()=>{e().then(v=>{u(v)}).finally(()=>{d(!1)})},[]);const w=async()=>{const v={documentId:void 0,pageId:void 0};if(m.find(p=>p.permanentLink===t))return v;for(const p of m){const L=[...(await a(p.id)).values()];if(!!L.find(D=>D.permanentLink===t))return v.documentId=p.id,v;for(const D of L)if(!![...(await s(D.id)).values()].find(F=>F.permanentLink===t))return v.documentId=p.id,v.pageId=D.id,v}return v};return c?r.jsx(Ae,{}):r.jsx(r.Fragment,{children:m.map(v=>r.jsx(dr,{document:v,selectedUrl:t,onSelectUrl:n,itemsToExpandInitially:b,getDocumentSectionsByDocumentPageId:s,getDocumentPagesByDocumentId:a},v.id))})},Fe=({url:t,onUrlChange:n,buttonSize:e=o.ButtonSize.Medium,getAllDocuments:a,getDocumentPagesByDocumentId:s,getDocumentSectionsByDocumentPageId:c})=>{const{open:d,isOpen:g,close:u}=wn.useOverlayTriggerState({}),[b,f]=y.useState(t),m=x=>{f(x)},w=x=>{x.key==="Enter"&&v()};y.useEffect(()=>{t&&!b&&f(t)},[t,b]);const v=()=>{n==null||n(b),u()};return r.jsxs("div",{"data-test-id":"internal-link-selector",onKeyDown:w,children:[r.jsx(o.Button,{icon:r.jsx(o.IconLink,{}),size:e,type:o.ButtonType.Button,style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Default,onClick:()=>d(),children:"Internal link"}),r.jsxs(o.Modal,{zIndex:1001,onClose:()=>u(),isOpen:g,isDismissable:!0,children:[r.jsx(o.Modal.Header,{title:"Select internal link"}),r.jsx(o.Modal.Body,{children:r.jsx(ur,{selectedUrl:b,onSelectUrl:m,getAllDocuments:a,getDocumentPagesByDocumentId:s,getDocumentSectionsByDocumentPageId:c})}),r.jsx(o.Modal.Footer,{buttons:[{children:"Cancel",onClick:()=>u(),style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Default},{children:"Choose",onClick:x=>{x==null||x.preventDefault(),v()},style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Strong,disabled:!b}]})]})]})},Me=({onUrlChange:t,onToggleTab:n,isValidUrlOrEmpty:e,appBridge:a,clearable:s,placeholder:c,newTab:d,openInNewTab:g,url:u="",required:b,info:f,label:m,buttonSize:w,hideInternalLinkButton:v})=>{const x=e?e(u):R(u),p=d??(g?o.CheckboxState.Checked:o.CheckboxState.Unchecked);return r.jsxs("div",{"data-test-id":"link-input",children:[r.jsx(o.FormControl,{label:{children:m,htmlFor:"url",required:b,tooltip:f?{content:f,position:o.TooltipPosition.Top}:void 0},children:r.jsx(o.TextInput,{id:"url",value:u,clearable:s,onChange:t,placeholder:c??"https://example.com",focusOnMount:!0})}),!x&&r.jsx("div",{className:"tw-text-text-negative tw-mt-1 tw-text-s",children:"Please enter a valid URL."}),!v&&r.jsx("div",{className:"tw-mt-3",children:r.jsx(Fe,{url:u,onUrlChange:t,buttonSize:w??o.ButtonSize.Medium,getAllDocuments:()=>a.getAllDocuments(),getDocumentPagesByDocumentId:E=>a.getDocumentPagesByDocumentId(E),getDocumentSectionsByDocumentPageId:E=>a.getDocumentSectionsByDocumentPageId(E)})}),r.jsx("div",{className:"tw-mt-3",children:r.jsx(o.Checkbox,{value:"new-tab",label:"Open in new tab",state:p,onChange:n})})]})},De=({state:t,onTextChange:n,onUrlChange:e,onToggleTab:a,onCancel:s,onSave:c,isValidUrlOrEmpty:d,hasValues:g,testId:u,appBridge:b,children:f})=>r.jsxs("div",{"data-test-id":u,className:"tw-bg-white tw-rounded tw-shadow tw-p-7 tw-min-w-[400px] tw-overflow-y-auto",children:[r.jsx(o.FormControl,{label:{children:"Text",htmlFor:"linkText",required:!0},children:r.jsx(o.TextInput,{id:"linkText",value:t.text,placeholder:"Link Text",onChange:n})}),f,r.jsx("div",{className:"tw-mt-5",children:r.jsx(Me,{url:t.url,newTab:t.newTab,onUrlChange:e,onToggleTab:a,isValidUrlOrEmpty:d,appBridge:b})}),r.jsx("div",{className:"tw-mt-3",children:r.jsxs("div",{className:"tw-pt-5 tw-flex tw-gap-x-3 tw-justify-end tw-border-t tw-border-t-black-10",children:[r.jsx(o.Button,{onClick:s,size:o.ButtonSize.Medium,style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Default,children:"Cancel"}),r.jsx(o.Button,{onClick:c,size:o.ButtonSize.Medium,icon:r.jsx(o.IconCheckMark20,{}),disabled:!g||!d(t==null?void 0:t.url),children:"Save"})]})})]}),gr=t=>{var e;const n=i.getAboveNode(t,{match:{type:P}});return Array.isArray(n)&&((e=n[0])==null?void 0:e.buttonStyle)||"primary"},hr={url:"",text:"",buttonStyle:"primary",newTab:o.CheckboxState.Unchecked},mr=()=>{const[t,n]=y.useReducer((e,a)=>{const{type:s,payload:c}=a;switch(s){case"NEW_TAB":return{...e,newTab:o.CheckboxState.Checked};case"SAME_TAB":return{...e,newTab:o.CheckboxState.Unchecked};case"URL":case"TEXT":case"BUTTON_STYLE":case"INIT":return{...e,...c};default:return e}},hr);return[t,n]},fr=()=>{const t=i.useEditorRef(),[n,e]=mr();y.useEffect(()=>{const m=gr(t);e({type:"INIT",payload:{text:A.text(),buttonStyle:m,newTab:A.newTab()?o.CheckboxState.Checked:o.CheckboxState.Unchecked,url:A.url()}})},[e,t]);const a=m=>{e({type:"TEXT",payload:{text:m}})},s=m=>{e({type:"BUTTON_STYLE",payload:{buttonStyle:m}})},c=m=>{e({type:"URL",payload:{url:m}})},d=m=>{e(m?{type:"NEW_TAB"}:{type:"SAME_TAB"})},g=()=>{I.hide()},u=m=>{if(!R(n.url)||!b)return;const w=ut(n.url);I.text(n.text),I.url(w),I.buttonStyle(n.buttonStyle),I.newTab(n.newTab===o.CheckboxState.Checked),Nt(t)&&(m==null||m.preventDefault())},b=n.url!==""&&n.text!=="",{appBridge:f}=i.getPluginOptions(t,P);return i.useHotkeys("enter",u,{enableOnFormTags:["INPUT"]},[]),{state:n,onTextChange:a,onButtonStyleChange:s,onUrlChange:c,onToggleTab:d,onCancel:g,onSave:u,hasValues:b,isValidUrlOrEmpty:R,appBridge:f}},ft="link-plugin";var C=(t=>(t.heading1="heading1",t.heading2="heading2",t.heading3="heading3",t.heading4="heading4",t.custom1="custom1",t.custom2="custom2",t.custom3="custom3",t.quote="quote",t.imageCaption="imageCaption",t.imageTitle="imageTitle",t.p="p",t))(C||{});const N={heading1:{fontSize:"var(--f-theme-settings-heading1-font-size)",lineHeight:"var(--f-theme-settings-heading1-line-height)",marginTop:"var(--f-theme-settings-heading1-margin-top)",marginBottom:"var(--f-theme-settings-heading1-margin-bottom)",textDecoration:"var(--f-theme-settings-heading1-text-decoration)",fontStyle:"var(--f-theme-settings-heading1-font-style)",textTransform:"var(--f-theme-settings-heading1-text-transform)",letterSpacing:"var(--f-theme-settings-heading1-letter-spacing)",fontWeight:"var(--f-theme-settings-heading1-font-weight)",fontFamily:"var(--f-theme-settings-heading1-font-family)",color:"var(--f-theme-settings-heading1-color)"},heading2:{fontSize:"var(--f-theme-settings-heading2-font-size)",lineHeight:"var(--f-theme-settings-heading2-line-height)",marginTop:"var(--f-theme-settings-heading2-margin-top)",marginBottom:"var(--f-theme-settings-heading2-margin-bottom)",textDecoration:"var(--f-theme-settings-heading2-text-decoration)",fontStyle:"var(--f-theme-settings-heading2-font-style)",textTransform:"var(--f-theme-settings-heading2-text-transform)",letterSpacing:"var(--f-theme-settings-heading2-letter-spacing)",fontWeight:"var(--f-theme-settings-heading2-font-weight)",fontFamily:"var(--f-theme-settings-heading2-font-family)",color:"var(--f-theme-settings-heading2-color)"},heading3:{fontSize:"var(--f-theme-settings-heading3-font-size)",lineHeight:"var(--f-theme-settings-heading3-line-height)",marginTop:"var(--f-theme-settings-heading3-margin-top)",marginBottom:"var(--f-theme-settings-heading3-margin-bottom)",textDecoration:"var(--f-theme-settings-heading3-text-decoration)",fontStyle:"var(--f-theme-settings-heading3-font-style)",textTransform:"var(--f-theme-settings-heading3-text-transform)",letterSpacing:"var(--f-theme-settings-heading3-letter-spacing)",fontWeight:"var(--f-theme-settings-heading3-font-weight)",fontFamily:"var(--f-theme-settings-heading3-font-family)",color:"var(--f-theme-settings-heading3-color)"},heading4:{fontSize:"var(--f-theme-settings-heading4-font-size)",lineHeight:"var(--f-theme-settings-heading4-line-height)",marginTop:"var(--f-theme-settings-heading4-margin-top)",marginBottom:"var(--f-theme-settings-heading4-margin-bottom)",textDecoration:"var(--f-theme-settings-heading4-text-decoration)",fontStyle:"var(--f-theme-settings-heading4-font-style)",textTransform:"var(--f-theme-settings-heading4-text-transform)",letterSpacing:"var(--f-theme-settings-heading4-letter-spacing)",fontWeight:"var(--f-theme-settings-heading4-font-weight)",fontFamily:"var(--f-theme-settings-heading4-font-family)",color:"var(--f-theme-settings-heading4-color)"},custom1:{fontSize:"var(--f-theme-settings-custom1-font-size)",lineHeight:"var(--f-theme-settings-custom1-line-height)",marginTop:"var(--f-theme-settings-custom1-margin-top)",marginBottom:"var(--f-theme-settings-custom1-margin-bottom)",textDecoration:"var(--f-theme-settings-custom1-text-decoration)",fontStyle:"var(--f-theme-settings-custom1-font-style)",textTransform:"var(--f-theme-settings-custom1-text-transform)",letterSpacing:"var(--f-theme-settings-custom1-letter-spacing)",fontWeight:"var(--f-theme-settings-custom1-font-weight)",fontFamily:"var(--f-theme-settings-custom1-font-family)",color:"var(--f-theme-settings-custom1-color)"},custom2:{fontSize:"var(--f-theme-settings-custom2-font-size)",lineHeight:"var(--f-theme-settings-custom2-line-height)",marginTop:"var(--f-theme-settings-custom2-margin-top)",marginBottom:"var(--f-theme-settings-custom2-margin-bottom)",textDecoration:"var(--f-theme-settings-custom2-text-decoration)",fontStyle:"var(--f-theme-settings-custom2-font-style)",textTransform:"var(--f-theme-settings-custom2-text-transform)",letterSpacing:"var(--f-theme-settings-custom2-letter-spacing)",fontWeight:"var(--f-theme-settings-custom2-font-weight)",fontFamily:"var(--f-theme-settings-custom2-font-family)",color:"var(--f-theme-settings-custom2-color)"},custom3:{fontSize:"var(--f-theme-settings-custom3-font-size)",lineHeight:"var(--f-theme-settings-custom3-line-height)",marginTop:"var(--f-theme-settings-custom3-margin-top)",marginBottom:"var(--f-theme-settings-custom3-margin-bottom)",textDecoration:"var(--f-theme-settings-custom3-text-decoration)",fontStyle:"var(--f-theme-settings-custom3-font-style)",textTransform:"var(--f-theme-settings-custom3-text-transform)",letterSpacing:"var(--f-theme-settings-custom3-letter-spacing)",fontWeight:"var(--f-theme-settings-custom3-font-weight)",fontFamily:"var(--f-theme-settings-custom3-font-family)",color:"var(--f-theme-settings-custom3-color)"},p:{fontSize:"var(--f-theme-settings-body-font-size)",lineHeight:"var(--f-theme-settings-body-line-height)",marginTop:"var(--f-theme-settings-body-margin-top)",marginBottom:"var(--f-theme-settings-body-margin-bottom)",textDecoration:"var(--f-theme-settings-body-text-decoration)",fontStyle:"var(--f-theme-settings-body-font-style)",textTransform:"var(--f-theme-settings-body-text-transform)",letterSpacing:"var(--f-theme-settings-body-letter-spacing)",fontWeight:"var(--f-theme-settings-body-font-weight)",fontFamily:"var(--f-theme-settings-body-font-family)",color:"var(--f-theme-settings-body-color)"},quote:{fontSize:"var(--f-theme-settings-quote-font-size)",lineHeight:"var(--f-theme-settings-quote-line-height)",marginTop:"var(--f-theme-settings-quote-margin-top)",marginBottom:"var(--f-theme-settings-quote-margin-bottom)",textDecoration:"var(--f-theme-settings-quote-text-decoration)",fontStyle:"var(--f-theme-settings-quote-font-style)",textTransform:"var(--f-theme-settings-quote-text-transform)",letterSpacing:"var(--f-theme-settings-quote-letter-spacing)",fontWeight:"var(--f-theme-settings-quote-font-weight)",fontFamily:"var(--f-theme-settings-quote-font-family)",color:"var(--f-theme-settings-quote-color)"},imageCaption:{fontSize:"var(--f-theme-settings-image-caption-font-size)",lineHeight:"var(--f-theme-settings-image-caption-line-height)",marginTop:"var(--f-theme-settings-image-caption-margin-top)",marginBottom:"var(--f-theme-settings-image-caption-margin-bottom)",textDecoration:"var(--f-theme-settings-image-caption-text-decoration)",fontStyle:"var(--f-theme-settings-image-caption-font-style)",textTransform:"var(--f-theme-settings-image-caption-text-transform)",letterSpacing:"var(--f-theme-settings-image-caption-letter-spacing)",fontWeight:"var(--f-theme-settings-image-caption-font-weight)",fontFamily:"var(--f-theme-settings-image-caption-font-family)",color:"var(--f-theme-settings-image-caption-color)"},imageTitle:{fontSize:"var(--f-theme-settings-image-title-font-size)",lineHeight:"var(--f-theme-settings-image-title-line-height)",marginTop:"var(--f-theme-settings-image-title-margin-top)",marginBottom:"var(--f-theme-settings-image-title-margin-bottom)",textDecoration:"var(--f-theme-settings-image-title-text-decoration)",fontStyle:"var(--f-theme-settings-image-title-font-style)",textTransform:"var(--f-theme-settings-image-title-text-transform)",letterSpacing:"var(--f-theme-settings-image-title-letter-spacing)",fontWeight:"var(--f-theme-settings-image-title-font-weight)",fontFamily:"var(--f-theme-settings-image-title-font-family)",color:"var(--f-theme-settings-image-title-color)"},[ft]:{fontSize:"var(--f-theme-settings-link-font-size)",lineHeight:"var(--f-theme-settings-link-line-height)",marginTop:"var(--f-theme-settings-link-margin-top)",marginBottom:"var(--f-theme-settings-link-margin-bottom)",textDecoration:"var(--f-theme-settings-link-text-decoration)",fontStyle:"var(--f-theme-settings-link-font-style)",textTransform:"var(--f-theme-settings-link-text-transform)",letterSpacing:"var(--f-theme-settings-link-letter-spacing)",fontWeight:"var(--f-theme-settings-link-font-weight)",fontFamily:"var(--f-theme-settings-link-font-family)",color:"var(--f-theme-settings-link-color)"},...mt},wr=()=>{const t=fr(),{state:n,onButtonStyleChange:e}=t;return r.jsx(De,{...t,testId:"floating-button-insert",children:r.jsx("div",{className:"tw-pt-5",children:r.jsxs(o.FormControl,{label:{children:"Button Style",htmlFor:"buttonStyle",required:!0},children:[r.jsx(Ft,{id:"primary",styles:N.buttonPrimary,isActive:n.buttonStyle==="primary",onClick:()=>e("primary"),children:n.text||"Primary Button"}),r.jsx(Ft,{id:"secondary",styles:N.buttonSecondary,isActive:n.buttonStyle==="secondary",onClick:()=>e("secondary"),children:n.text||"Secondary Button"}),r.jsx(Ft,{id:"tertiary",styles:N.buttonTertiary,isActive:n.buttonStyle==="tertiary",onClick:()=>e("tertiary"),children:n.text||"Tertiary Button"})]})})})},Ft=({id:t,styles:n,isActive:e,onClick:a,children:s})=>{const[c,d]=y.useState(!1),g=()=>n&&n.hover&&c?{...n,...n.hover}:n;return r.jsx("button",{"data-test-id":`floating-button-insert-${t}`,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onClick:a,style:{...g(),marginTop:0,marginBottom:0},className:e?"tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit":"tw-w-fit",children:s})},yr=()=>{const t=tt().isEditing(),n=r.jsx(wr,{}),e=t?n:r.jsx(or,{});return r.jsxs(r.Fragment,{children:[r.jsx(wt.InsertRoot,{children:n}),r.jsx(wt.EditRoot,{children:e})]})},P="button",Oe="button-plugin",Ue=t=>i.createPluginFactory({key:P,isElement:!0,isInline:!0,props:({element:n})=>({nodeProps:{href:n==null?void 0:n.url,target:n==null?void 0:n.target}}),withOverrides:Se,renderAfterEditable:yr,options:{isUrl:gt,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingButtonHotkeys:"command+shift+k, ctrl+shift+k",appBridge:t},then:(n,{type:e})=>({deserializeHtml:{rules:[{validNodeName:"A",validClassName:"btn"}],getNode:a=>({type:e,url:a.getAttribute("href"),target:a.getAttribute("target")||"_blank"})}})})();class _e extends o.Plugin{constructor({styles:n=mt,...e}){super(Oe,{button:sr,markupElement:new rr,...e}),this.styles={},this.styles=n,this.appBridge=e==null?void 0:e.appBridge}plugins(){return[Ue(this.appBridge)]}}const br=({floatingOptions:t,...n})=>{const e=i.useEditorRef(),a=i.usePlateSelectors(e.id).keyEditor(),s=tt().mode(),c=tt().isOpen(e.id),{triggerFloatingButtonHotkeys:d}=i.getPluginOptions(e,P),g=y.useCallback(()=>{const w=i.getAboveNode(e,{match:{type:i.getPluginType(e,P)}});if(w){const[,v]=w;return i.getRangeBoundingClientRect(e,{anchor:i.getStartPoint(e,v),focus:i.getEndPoint(e,v)})}return i.getDefaultBoundingClientRect()},[e]),u=c&&s==="edit",{update:b,style:f,floating:m}=Ve({open:u,getBoundingClientRect:g,...t});return y.useEffect(()=>{const w=Be(e);if(w&&I.url(w),e.selection&&i.someNode(e,{match:{type:i.getPluginType(e,P)}})){I.show("edit",e.id),b();return}A.mode()==="edit"&&I.hide()},[e,a,b]),i.useHotkeys(d,w=>{w.preventDefault(),A.mode()==="edit"&&ht(e)},{enableOnContentEditable:!0},[]),Er(),He(),{style:{...f,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,m)}},vr=({floatingOptions:t,...n})=>{const e=i.useEditorRef(),a=Xt.useFocused(),s=tt().mode(),c=tt().isOpen(e.id),{triggerFloatingButtonHotkeys:d}=i.getPluginOptions(e,P);i.useHotkeys(d,f=>{f.preventDefault(),At(e,{focused:a})},{enableOnContentEditable:!0},[a]);const{update:g,style:u,floating:b}=Ve({open:c&&s==="insert",getBoundingClientRect:i.getSelectionBoundingClientRect,whileElementsMounted:void 0,...t});return y.useEffect(()=>{c&&g(),I.updated(c)},[c,g]),He(),{style:{...u,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,b)}},Cr=t=>{const n=i.useEditorRef();return{onClick:y.useCallback(()=>{ht(n)},[n]),...t}},kr=i.createComponentAs(t=>{const n=Cr(t);return i.createElementAs("button",n)}),pr=t=>{const n=i.useEditorRef();return{onClick:y.useCallback(()=>{et(n),i.focusEditor(n,n.selection??void 0)},[n]),...t}},xr=i.createComponentAs(t=>{const n=pr(t);return i.createElementAs(i.Button,n)}),Pr=i.createComponentAs(t=>{var e;const n=br(t);return((e=n.style)==null?void 0:e.display)==="none"?null:i.createElementAs("div",n)}),Sr=i.createComponentAs(t=>{var e;const n=vr(t);return((e=n.style)==null?void 0:e.display)==="none"?null:i.createElementAs("div",n)}),wt={EditRoot:Pr,InsertRoot:Sr,EditButton:kr,UnlinkButton:xr},Tr=t=>{const n=tt().updated(),e=y.useRef(null);y.useEffect(()=>{e.current&&n&&setTimeout(()=>{var s;(s=e.current)==null||s.focus()},0)},[n]);const a=y.useCallback(s=>{I.url(s.target.value)},[]);return i.mergeProps({onChange:a,defaultValue:A.url()},{...t,ref:i.useComposedRef(t.ref,e)})},Er=()=>{const t=i.useEditorRef();i.useHotkeys("*",n=>{n.key==="Enter"&&Nt(t)&&n.preventDefault()},{enableOnFormTags:["INPUT"]},[])},He=()=>{const t=i.useEditorRef();i.useHotkeys("escape",()=>{if(A.mode()==="edit"){if(A.isEditing()){I.show("edit",t.id),i.focusEditor(t,t.selection??void 0);return}I.hide()}},{enableOnFormTags:["INPUT"],enableOnContentEditable:!0},[])},Ir=12,Br=-22,Nr=96,Ve=t=>i.useVirtualFloating({placement:"bottom-start",middleware:[i.offset({mainAxis:Ir,alignmentAxis:Br}),i.flip({padding:Nr})],...t}),Lr=({id:t="rte",isEditing:n,value:e,columns:a,gap:s,placeholder:c,plugins:d,onTextChange:g,showSerializedText:u})=>{const[b,f]=y.useState(!1),m=w=>{g&&w!==e&&g(w),f(!1)};return y.useEffect(()=>{const w=v=>(v.preventDefault(),v.returnValue="Unprocessed changes");return b&&window.addEventListener("beforeunload",w),()=>window.removeEventListener("beforeunload",w)},[b]),n?r.jsx(o.RichTextEditor,{id:t,value:e,border:!1,placeholder:c,plugins:d,onValueChanged:()=>f(!0),onTextChange:m,hideExternalFloatingModals:w=>{A.isOpen(w)&&I.reset()}}):r.jsx(qn,{value:e,columns:a,gap:s,show:u,plugins:d})},Ar=({floatingOptions:t,...n})=>{const e=i.useEditorRef(),a=Xt.useFocused(),s=i.useFloatingLinkSelectors().mode(),c=i.useFloatingLinkSelectors().isOpen(e.id),{triggerFloatingLinkHotkeys:d}=i.getPluginOptions(e,i.ELEMENT_LINK);i.useHotkeys(d,f=>{i.triggerFloatingLinkInsert(e,{focused:a})&&f.preventDefault()},{enableOnContentEditable:!0},[a]);const{update:g,style:u,floating:b}=i.useVirtualFloatingLink({editorId:e.id,open:c&&s==="insert",getBoundingClientRect:i.getSelectionBoundingClientRect,whileElementsMounted:()=>{},...t});return y.useEffect(()=>{c?(g(),i.floatingLinkActions.updated(!0)):i.floatingLinkActions.updated(!1)},[c,g]),i.useFloatingLinkEscape(),{style:{...u,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,b)}},Fr=i.createComponentAs(t=>{var e;const n=Ar({...t,floatingOptions:{strategy:"absolute"}});return((e=n.style)==null?void 0:e.display)==="none"?null:i.createElementAs("div",n)}),Mr=i.createComponentAs(t=>{var e;const n=Or({...t,floatingOptions:{strategy:"absolute"}});return((e=n.style)==null?void 0:e.display)==="none"?null:i.createElementAs("div",n)});i.FloatingLink.EditRoot=Mr,i.FloatingLink.InsertRoot=Fr;const yt=i.FloatingLink,Dr=()=>{const t=i.useFloatingLinkUrlInput({});return r.jsx("div",{"data-test-id":"floating-link-edit",className:"tw-bg-white tw-text-text tw-rounded tw-shadow tw-p-4 tw-min-w-[400px]",children:r.jsxs("span",{"data-test-id":"preview-link-flyout",className:"tw-flex tw-justify-between tw-items-center",children:[r.jsx("span",{className:"tw-pointer-events-none",children:t.defaultValue}),r.jsxs("span",{className:"tw-flex tw-gap-2",children:[r.jsx("span",{role:"button",tabIndex:0,"data-test-id":"edit-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:r.jsx(yt.EditButton,{children:r.jsx(o.IconPen16,{})})}),r.jsx("span",{role:"button",tabIndex:0,"data-test-id":"remove-link-button",className:"tw-transition tw-cursor-pointer tw-rounded hover:tw-bg-black-10 tw-p-1",children:r.jsx(yt.UnlinkButton,{children:r.jsx(o.IconTrashBin16,{})})})]})]})})},Or=({floatingOptions:t,...n})=>{const e=i.useEditorRef(),a=i.usePlateSelectors().keyEditor(),s=i.useFloatingLinkSelectors().mode(),c=i.useFloatingLinkSelectors().isOpen(e.id),{triggerFloatingLinkHotkeys:d="command+k, ctrl+k"}=i.getPluginOptions(e,i.ELEMENT_LINK),g=y.useCallback(()=>{const w=i.getAboveNode(e,{match:{type:i.getPluginType(e,i.ELEMENT_LINK)}});if(w){const[,v]=w;return i.getRangeBoundingClientRect(e,{anchor:i.getStartPoint(e,v),focus:i.getEndPoint(e,v)})}return i.getDefaultBoundingClientRect()},[e]),u=c&&s==="edit",{update:b,style:f,floating:m}=i.useVirtualFloatingLink({editorId:e.id,open:u,getBoundingClientRect:g,...t});return y.useEffect(()=>{const w=Pe(e);if(w&&i.floatingLinkActions.url(w),e.selection&&i.someNode(e,{match:{type:i.getPluginType(e,i.ELEMENT_LINK)}})){i.floatingLinkActions.show("edit",e.id),b();return}i.floatingLinkSelectors.mode()==="edit"&&i.floatingLinkActions.hide()},[e,a,b]),i.useHotkeys(d,w=>{w.preventDefault(),i.floatingLinkSelectors.mode()==="edit"&&i.triggerFloatingLinkEdit(e)},{enableOnContentEditable:!0},[]),i.useFloatingLinkEnter(),i.useFloatingLinkEscape(),{style:{...f,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,m)}},Ur={url:"",text:"",newTab:o.CheckboxState.Unchecked},_r=()=>{const[t,n]=y.useReducer((e,a)=>{const{type:s,payload:c}=a;switch(s){case"NEW_TAB":return{...e,newTab:o.CheckboxState.Checked};case"SAME_TAB":return{...e,newTab:o.CheckboxState.Unchecked};case"URL":case"TEXT":case"INIT":return{...e,...c};default:return e}},Ur);return[t,n]},Hr=()=>{const t=i.useEditorRef(),[n,e]=_r();y.useEffect(()=>{const f=ke(t),m=pe(t);e({type:"INIT",payload:{text:i.floatingLinkSelectors.text(),newTab:i.floatingLinkSelectors.newTab()?o.CheckboxState.Checked:o.CheckboxState.Unchecked,url:f&&m===""?f:i.floatingLinkSelectors.url()}})},[e,t]);const a=f=>{e({type:"TEXT",payload:{text:f}})},s=f=>{e({type:"URL",payload:{url:f}})},c=f=>{e(f?{type:"NEW_TAB"}:{type:"SAME_TAB"})},d=()=>{i.floatingLinkActions.hide()},g=f=>{if(!R(n.url)||!u)return;const m=ut(n.url);i.floatingLinkActions.text(n.text),i.floatingLinkActions.url(m),i.floatingLinkActions.newTab(n.newTab===o.CheckboxState.Checked),i.submitFloatingLink(t)&&(f==null||f.preventDefault())},u=n.url!==""&&n.text!=="",{appBridge:b}=i.getPluginOptions(t,i.ELEMENT_LINK);return i.useHotkeys("enter",g,{enableOnFormTags:["INPUT"]},[]),{state:n,onTextChange:a,onUrlChange:s,onToggleTab:c,onCancel:d,onSave:g,hasValues:u,isValidUrlOrEmpty:R,appBridge:b}},Vr=()=>r.jsx(De,{...Hr(),testId:"floating-link-insert"}),zr=({readOnly:t})=>{const n=i.useFloatingLinkSelectors().isEditing();if(t)return null;const e=r.jsx(Vr,{}),a=n?e:r.jsx(Dr,{});return r.jsxs(r.Fragment,{children:[r.jsx(yt.InsertRoot,{children:e}),r.jsx(yt.EditRoot,{children:a})]})},$r=({id:t,editorId:n})=>{const e=i.usePlateEditorState(i.useEventPlateId(n)),a=!!i.isRangeInSameBlock(e,{at:e.selection});return r.jsx("div",{"data-plugin-id":t,children:r.jsx(i.LinkToolbarButton,{tooltip:o.getTooltip(a?`Link
|
|
3
|
-
${o.getHotkeyByPlatform("Ctrl+K")}`:"Links can only be set for a single text block."),icon:r.jsx("span",{className:"tw-p-2 tw-h-8 tw-justify-center tw-items-center tw-flex",children:r.jsx(o.IconLink,{size:o.IconSize.Size16})}),classNames:o.getButtonClassNames(a),styles:{root:{width:"24px",height:"24px"}},actionHandler:"onMouseDown"})})},Wr=t=>({...i.useElementProps({...t,elementToAttributes:e=>{var a,s;return{href:e.url||((s=(a=e.chosenLink)==null?void 0:a.searchResult)==null?void 0:s.link)||"",target:e.target||"_self"}}}),onMouseOver:e=>{e.stopPropagation()}}),qr=t=>{const n=Wr(t),{attributes:e,children:a}=t;return r.jsx("a",{...e,href:n.href,target:n.target,style:N[ft],children:a})};class Gr extends o.MarkupElement{constructor(n=i.ELEMENT_LINK,e=qr){super(n,e)}}const ze=t=>i.createPluginFactory({...i.createLinkPlugin(),renderAfterEditable:zr,options:{isUrl:gt,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingLinkHotkeys:"command+k, ctrl+k",appBridge:t}})();class $e extends o.Plugin{constructor(n,e=N[ft]){super(ft,{button:$r,markupElement:new Gr,...n}),this.styles={},this.styles=e,this.appBridge=n==null?void 0:n.appBridge}plugins(){return[ze(this.appBridge)]}}const Kr="textstyle-custom1-plugin";class We extends o.Plugin{constructor({styles:n=N.custom1,...e}={}){super(C.custom1,{label:"Custom 1",markupElement:new jr,...e}),this.styles={},this.styles=n}plugins(){return[Xr(this.styles)]}}class jr extends o.MarkupElement{constructor(n=Kr,e=qe){super(n,e)}}const qe=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("p",{...n,style:a,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),children:e})},Xr=t=>i.createPluginFactory({key:C.custom1,isElement:!0,deserializeHtml:{rules:[{validClassName:C.custom1}]}})({component:n=>r.jsx(qe,{...n,styles:t})}),Qr="textstyle-custom2-plugin";class Ge extends o.Plugin{constructor({styles:n=N.custom2,...e}={}){super(C.custom2,{label:"Custom 2",markupElement:new Yr,...e}),this.styles={},this.styles=n}plugins(){return[Jr(this.styles)]}}class Yr extends o.MarkupElement{constructor(n=Qr,e=Ke){super(n,e)}}const Ke=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("p",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},Jr=t=>i.createPluginFactory({key:C.custom2,isElement:!0,deserializeHtml:{rules:[{validClassName:C.custom2}]}})({component:n=>r.jsx(Ke,{...n,styles:t})}),Zr="textstyle-custom3-plugin";class je extends o.Plugin{constructor({styles:n=N.custom3,...e}={}){super(o.TextStyles.custom3,{label:"Custom 3",markupElement:new Rr,...e}),this.styles={},this.styles=n}plugins(){return[ta(this.styles)]}}class Rr extends o.MarkupElement{constructor(n=Zr,e=Xe){super(n,e)}}const Xe=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("p",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},ta=t=>i.createPluginFactory({key:o.TextStyles.custom3,isElement:!0,deserializeHtml:{rules:[{validClassName:o.TextStyles.custom3}]}})({component:n=>r.jsx(Xe,{...n,styles:t})}),ea="textstyle-heading1-plugin";class Qe extends o.Plugin{constructor({styles:n=N.heading1,...e}={}){super(C.heading1,{label:"Heading 1",markupElement:new na,...e}),this.styles={},this.styles=n}plugins(){return[ra(this.styles)]}}class na extends o.MarkupElement{constructor(n=ea,e=Mt){super(n,e)}}const Mt=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("h1",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},ra=t=>i.createPluginFactory({key:C.heading1,isElement:!0,component:Mt,deserializeHtml:{rules:[{validNodeName:["h1","H1"]}]}})({component:n=>r.jsx(Mt,{...n,styles:t})}),aa="textstyle-heading2-plugin";class Ye extends o.Plugin{constructor({styles:n=N.heading2,...e}={}){super(C.heading2,{label:"Heading 2",markupElement:new sa,...e}),this.styles={},this.styles=n}plugins(){return[oa(this.styles)]}}class sa extends o.MarkupElement{constructor(n=aa,e=Dt){super(n,e)}}const Dt=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("h2",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},oa=t=>i.createPluginFactory({key:C.heading2,isElement:!0,component:Dt,deserializeHtml:{rules:[{validNodeName:["h2","H2"]}]}})({component:n=>r.jsx(Dt,{...n,styles:t})}),ia="textstyle-heading3-plugin";class Je extends o.Plugin{constructor({styles:n=N.heading3,...e}={}){super(C.heading3,{label:"Heading 3",markupElement:new la,...e}),this.styles={},this.styles=n}plugins(){return[ca(this.styles)]}}class la extends o.MarkupElement{constructor(n=ia,e=Ot){super(n,e)}}const Ot=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("h3",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},ca=t=>i.createPluginFactory({key:C.heading3,isElement:!0,component:Ot,deserializeHtml:{rules:[{validNodeName:["h3","H3"]}]}})({component:n=>r.jsx(Ot,{...n,styles:t})}),da="textstyle-heading4-plugin";class Ze extends o.Plugin{constructor({styles:n=N.heading4,...e}={}){super(C.heading4,{label:"Heading 4",markupElement:new ua,...e}),this.styles={},this.styles=n}plugins(){return[ga(this.styles)]}}class ua extends o.MarkupElement{constructor(n=da,e=Ut){super(n,e)}}const Ut=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("h4",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},ga=t=>i.createPluginFactory({key:C.heading4,isElement:!0,component:Ut,deserializeHtml:{rules:[{validNodeName:["h4","H4"]}]}})({component:n=>r.jsx(Ut,{...n,styles:t})}),ha="textstyle-imageCaption-plugin";class Re extends o.Plugin{constructor({styles:n=N.imageCaption,...e}={}){super(C.imageCaption,{label:"Image Caption",markupElement:new ma,...e}),this.styles={},this.styles=n}plugins(){return[fa(this.styles)]}}class ma extends o.MarkupElement{constructor(n=ha,e=_t){super(n,e)}}const _t=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("p",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},fa=t=>i.createPluginFactory({key:C.imageCaption,isElement:!0,component:_t,deserializeHtml:{rules:[{validClassName:C.imageCaption}]}})({component:n=>r.jsx(_t,{...n,styles:t})}),wa="textstyle-imageTitle-plugin";class tn extends o.Plugin{constructor({styles:n=N.imageTitle,...e}={}){super(C.imageTitle,{label:"Image Title",markupElement:new ya,...e}),this.styles={},this.styles=n}plugins(){return[ba(this.styles)]}}class ya extends o.MarkupElement{constructor(n=wa,e=Ht){super(n,e)}}const Ht=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("p",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},ba=t=>i.createPluginFactory({key:C.imageTitle,isElement:!0,component:Ht,deserializeHtml:{rules:[{validClassName:C.imageTitle}]}})({component:n=>r.jsx(Ht,{...n,styles:t})});class en extends o.Plugin{constructor({styles:n=N.p,...e}={}){super(C.p,{markupElement:new rn,label:"Body Text",...e}),this.styles={},this.styles=n}plugins(){return[an(this.styles)]}}const nn="tw-m-0 tw-px-0 tw-py-0",bt=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align,c=o.merge([s&&o.alignmentClassnames[s],nn,o.getColumnBreakClasses(t)]);return r.jsx("p",{...n,className:c,style:a,children:e})};class rn extends o.MarkupElement{constructor(n=C.p,e=bt){super(n,e)}}const an=t=>i.createPluginFactory({...i.createParagraphPlugin(),key:C.p,isElement:!0,component:bt})({component:n=>r.jsx(bt,{...n,styles:t})}),va="textstyle-quote-plugin";class sn extends o.Plugin{constructor({styles:n=N.quote,...e}={}){super(C.quote,{label:"Quote",markupElement:new Ca,...e}),this.styles={},this.styles=n}plugins(){return[on(this.styles)]}}class Ca extends o.MarkupElement{constructor(n=va,e=vt){super(n,e)}}const vt=({element:t,attributes:n,children:e,styles:a})=>{const s=t.align;return r.jsx("blockquote",{...n,className:o.merge([s&&o.alignmentClassnames[s],o.getColumnBreakClasses(t)]),style:a,children:e})},on=t=>i.createPluginFactory({key:C.quote,isElement:!0,component:vt,deserializeHtml:{rules:[{validNodeName:["blockquote","BLOCKQUOTE"]}]}})({component:n=>r.jsx(vt,{...n,styles:t})}),Vt=[new Qe,new Ye,new Je,new Ze,new We,new Ge,new je,new sn,new en],nt=[C.heading1,C.heading2,C.heading3,C.heading4,C.custom1,C.custom2,C.custom3,C.quote,C.p],ka=[...Vt,new Re,new tn],pa=[...nt,C.imageCaption,C.imageTitle],xa=t=>new o.PluginComposer().setPlugin(new o.SoftBreakPlugin,new o.TextStylePlugin({textStyles:Vt})).setPlugin([new o.BoldPlugin,new o.ItalicPlugin,new o.UnderlinePlugin,new o.StrikethroughPlugin,new $e({appBridge:t}),new _e({appBridge:t}),new o.CodePlugin],[new o.AlignLeftPlugin({validTypes:nt}),new o.AlignCenterPlugin({validTypes:nt}),new o.AlignRightPlugin({validTypes:nt}),new o.AlignJustifyPlugin({validTypes:nt}),new o.UnorderedListPlugin,new o.CheckboxListPlugin,new o.OrderedListPlugin,new o.ResetFormattingPlugin,new o.AutoformatPlugin]),Pa="--f-theme-settings-",Sa=t=>{const n=t!=null&&t.id?`hasBackground${t.id}`:"hasBackground",e=t!=null&&t.id?`backgroundColor${t.id}`:"backgroundColor",a=t!=null&&t.preventDefaultColor?void 0:(t==null?void 0:t.defaultColor)||In,s=t!=null&&t.label?t.label:"Background",c=t!=null&&t.switchLabel?t.switchLabel:void 0;return{id:n,label:s,type:"switch",switchLabel:c,defaultValue:!!(t!=null&&t.defaultValue),on:[{id:e,defaultValue:a,type:"colorInput"}]}},Ta=t=>{const n=t!=null&&t.id?`hasBorder_${t.id}`:"hasBorder",e=t!=null&&t.id?`borderSelection_${t.id}`:"borderSelection",a=t!=null&&t.id?`borderStyle_${t.id}`:"borderStyle",s=t!=null&&t.id?`borderWidth_${t.id}`:"borderWidth",c=t!=null&&t.id?`borderColor_${t.id}`:"borderColor",d=(t==null?void 0:t.defaultColor)||Zt,g=t!=null&&t.switchLabel?t.switchLabel:void 0;return{id:n,label:"Border",type:"switch",switchLabel:g,defaultValue:!!(t!=null&&t.defaultValue),on:[{id:e,type:"multiInput",onChange:u=>h.appendUnit(u,s),layout:h.MultiInputLayout.Columns,lastItemFullWidth:!0,blocks:[{id:a,type:"dropdown",defaultValue:H.Solid,choices:[{value:H.Solid,label:H.Solid},{value:H.Dotted,label:H.Dotted},{value:H.Dashed,label:H.Dashed}]},{id:s,type:"input",defaultValue:Bn,rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)],placeholder:"e.g. 3px"},{id:c,type:"colorInput",defaultValue:d}]}],off:[]}},zt=(t,n=$.None)=>({id:t,type:"segmentedControls",defaultValue:n,choices:[{value:$.None,label:"None"},{value:$.Small,label:"S"},{value:$.Medium,label:"M"},{value:$.Large,label:"L"}]}),Ea=t=>{const n=t!=null&&t.id?`hasRadius_${t.id}`:"hasRadius",e=t!=null&&t.id?`radiusValue_${t.id}`:"radiusValue",a=t!=null&&t.id?`radiusChoice_${t.id}`:"radiusChoice",s=(t==null?void 0:t.defaultRadius)||$.None;return{id:n,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:c=>{var d;return t!=null&&t.dependentSettingId?!!((d=c.getBlock(t.dependentSettingId))!=null&&d.value):!0},onChange:c=>h.presetCustomValue(c,a,e,(t==null?void 0:t.radiusStyleMap)||G),on:[{id:e,type:"input",placeholder:"e.g. 10px",rules:[h.numericalOrPixelRule],onChange:c=>h.appendUnit(c,e)}],off:[zt(a,s)]}},Ia=t=>{const n=t!=null&&t.id?`hasExtendedCustomRadius_${t.id}`:"hasExtendedCustomRadius",e=t!=null&&t.id?`extendedRadiusValue_${t.id}`:"extendedRadiusValue",a=t!=null&&t.id?`extendedRadiusChoice_${t.id}`:"extendedRadiusChoice",s=t!=null&&t.id?`extendedRadiusTopLeft_${t.id}`:"extendedRadiusTopLeft",c=t!=null&&t.id?`extendedRadiusTopRight_${t.id}`:"extendedRadiusTopRight",d=t!=null&&t.id?`extendedRadiusBottomLeft_${t.id}`:"extendedRadiusBottomLeft",g=t!=null&&t.id?`extendedRadiusBottomRight_${t.id}`:"extendedRadiusBottomRight";return{id:n,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:u=>{var b;return t!=null&&t.dependentSettingId?!!((b=u.getBlock(t.dependentSettingId))!=null&&b.value):!0},onChange:u=>{h.presetCustomValue(u,a,s,G),h.presetCustomValue(u,a,c,G),h.presetCustomValue(u,a,d,G),h.presetCustomValue(u,a,g,G)},on:[{id:e,type:"multiInput",layout:h.MultiInputLayout.Columns,blocks:[{id:s,type:"input",label:"Top Left",rules:[h.numericalOrPixelRule],onChange:u=>h.appendUnit(u,s)},{id:c,type:"input",label:"Top Right",rules:[h.numericalOrPixelRule],onChange:u=>h.appendUnit(u,c)},{id:d,type:"input",label:"Bottom Left",rules:[h.numericalOrPixelRule],onChange:u=>h.appendUnit(u,d)},{id:g,type:"input",label:"Bottom Right",rules:[h.numericalOrPixelRule],onChange:u=>h.appendUnit(u,g)}]}],off:[zt(a,t==null?void 0:t.defaultValue)]}},Ba=t=>{const n=t!=null&&t.id?t.id:"hasCustomSpacing",e=t!=null&&t.dependentSettingId?t.dependentSettingId:"columns",a=t!=null&&t.spacingChoiceId?t.spacingChoiceId:"spacingChoice",s=t!=null&&t.spacingCustomId?t.spacingCustomId:"spacingCustom",c=t!=null&&t.defaultValueChoices?t.defaultValueChoices:Q.M;return{id:n,type:"switch",defaultValue:!1,switchLabel:"Custom",label:"Gutter",info:"An official nerds term for ‘gap’",onChange:d=>h.presetCustomValue(d,a,s,Jt),show:d=>{var g;return((g=d.getBlock(e))==null?void 0:g.value)!=="1"},on:[{id:s,type:"input",rules:[h.numericalOrPixelRule],onChange:d=>h.appendUnit(d,s)}],off:[{id:a,type:"slider",defaultValue:c,choices:[{value:Q.Auto,label:"Auto"},{value:Q.S,label:"S"},{value:Q.M,label:"M"},{value:Q.L,label:"L"}]}]}},$t=t=>({id:t,type:"segmentedControls",defaultValue:j.None,choices:[{value:j.None,label:"None"},{value:j.Small,label:"S"},{value:j.Medium,label:"M"},{value:j.Large,label:"L"}]}),Na=t=>{const n=t!=null&&t.id?`hasCustomMarginValue_${t==null?void 0:t.id}`:"hasCustomMarginValue",e=t!=null&&t.id?`marginValue_${t==null?void 0:t.id}`:"marginValue",a=t!=null&&t.id?`marginChoice_${t==null?void 0:t.id}`:"marginChoice";return{id:n,label:"Margin",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more space",onChange:s=>h.presetCustomValue(s,a,e,(t==null?void 0:t.marginStyleMap)||Z),on:[{id:e,type:"input",placeholder:st,rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)],onChange:s=>h.appendUnit(s,e)}],off:[$t(a)]}},La=t=>{const n=t!=null&&t.id?`hasExtendedCustomMargin_${t==null?void 0:t.id}`:"hasExtendedCustomMargin",e=t!=null&&t.id?`extendedMarginValues_${t==null?void 0:t.id}`:"extendedMarginValues",a=t!=null&&t.id?`extendedMarginChoice_${t==null?void 0:t.id}`:"extendedMarginChoice",s=t!=null&&t.id?`extendedMarginTop_${t==null?void 0:t.id}`:"extendedMarginTop",c=t!=null&&t.id?`extendedMarginLeft_${t==null?void 0:t.id}`:"extendedMarginLeft",d=t!=null&&t.id?`extendedMarginRight_${t==null?void 0:t.id}`:"extendedMarginRight",g=t!=null&&t.id?`extendedMarginBottom_${t==null?void 0:t.id}`:"extendedMarginBottom";return{id:n,label:"Margin",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:u=>{h.presetCustomValue(u,a,s,Z),h.presetCustomValue(u,a,c,Z),h.presetCustomValue(u,a,d,Z),h.presetCustomValue(u,a,g,Z)},on:[{id:e,type:"multiInput",layout:h.MultiInputLayout.Spider,blocks:[{id:s,type:"input",label:"Top",placeholder:st,onChange:u=>h.appendUnit(u,s),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]},{id:c,type:"input",label:"Left",placeholder:st,onChange:u=>h.appendUnit(u,c),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]},{id:d,type:"input",label:"Right",placeholder:st,onChange:u=>h.appendUnit(u,d),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]},{id:g,type:"input",label:"Bottom",placeholder:st,onChange:u=>h.appendUnit(u,g),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[$t(a)]}},Wt=t=>({id:t,type:"segmentedControls",defaultValue:K.Small,choices:[{value:K.None,label:"None"},{value:K.Small,label:"S"},{value:K.Medium,label:"M"},{value:K.Large,label:"L"}]}),Aa=t=>{const n=t!=null&&t.id?`hasCustomPaddingValue_${t==null?void 0:t.id}`:"hasCustomPaddingValue",e=t!=null&&t.id?`paddingValue_${t==null?void 0:t.id}`:"paddingValue",a=t!=null&&t.id?`paddingChoice_${t==null?void 0:t.id}`:"paddingChoice";return{id:n,label:"Padding",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:s=>h.presetCustomValue(s,a,e,(t==null?void 0:t.paddingStyleMap)||J),on:[{id:e,type:"input",placeholder:at,rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)],onChange:s=>h.appendUnit(s,e)}],off:[Wt(a)]}},Fa=t=>{const n=t!=null&&t.id?`hasExtendedCustomPadding_${t==null?void 0:t.id}`:"hasExtendedCustomPadding",e=t!=null&&t.id?`extendedPaddingValues_${t==null?void 0:t.id}`:"extendedPaddingValues",a=t!=null&&t.id?`extendedPaddingChoice_${t==null?void 0:t.id}`:"extendedPaddingChoice",s=t!=null&&t.id?`extendedPaddingTop_${t==null?void 0:t.id}`:"extendedPaddingTop",c=t!=null&&t.id?`extendedPaddingLeft_${t==null?void 0:t.id}`:"extendedPaddingLeft",d=t!=null&&t.id?`extendedPaddingRight_${t==null?void 0:t.id}`:"extendedPaddingRight",g=t!=null&&t.id?`extendedPaddingBottom_${t==null?void 0:t.id}`:"extendedPaddingBottom";return{id:n,label:"Padding",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more negative space",onChange:u=>{h.presetCustomValue(u,a,s,J),h.presetCustomValue(u,a,c,J),h.presetCustomValue(u,a,d,J),h.presetCustomValue(u,a,g,J)},on:[{id:e,type:"multiInput",layout:h.MultiInputLayout.Spider,blocks:[{id:s,type:"input",label:"Top",placeholder:at,onChange:u=>h.appendUnit(u,s),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]},{id:c,type:"input",label:"Left",placeholder:at,onChange:u=>h.appendUnit(u,c),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]},{id:d,type:"input",label:"Right",placeholder:at,onChange:u=>h.appendUnit(u,d),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]},{id:g,type:"input",label:"Bottom",placeholder:at,onChange:u=>h.appendUnit(u,g),rules:[h.numericalOrPixelRule,h.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[Wt(a)]}},Ma=t=>{const n=qt(t==null?void 0:t.globalControlId);return{id:t!=null&&t.id?t.id:"downloadable",type:"switch",defaultValue:!1,label:"Downloadable",show:e=>{var a;return((a=e.getBlock(n))==null?void 0:a.value)===X.Custom}}},qt=t=>t||"security",Da=t=>[{id:qt(t),type:"segmentedControls",defaultValue:X.Global,choices:[{value:X.Global,label:"Global Settings"},{value:X.Custom,label:"Custom"}]},{id:"globalSettingsInfo",type:"notification",footer:h.createFooter({label:"Change global settings [here].",replace:{here:{event:"general-settings.open"}}})}];var ln=(t=>(t.Main="main",t.Basics="basics",t.Layout="layout",t.Style="style",t.Security="security",t.Targets="targets",t))(ln||{});const Oa=t=>t,Ua=t=>t;l.AllTextStylePlugins=ka,l.AllTextStyles=pa,l.Attachments=de,l.AttachmentsProvider=ie,l.AttachmentsToolbarButton=ge,l.BUTTON_PLUGIN=Oe,l.BlockButtonStyles=mt,l.BlockInjectButton=bn,l.BlockItemWrapper=$n,l.BlockStyles=N,l.BorderStyle=H,l.ButtonPlugin=_e,l.Custom1Plugin=We,l.Custom2Plugin=Ge,l.Custom3Plugin=je,l.DEFAULT_ATTACHMENTS_BUTTON_ID=ue,l.DEFAULT_DRAGGING_TOOLTIP=me,l.DEFAULT_DRAG_TOOLTIP=he,l.DEFAULT_MENU_BUTTON_ID=Tt,l.DownloadButton=Wn,l.DragHandleToolbarButton=fe,l.DragPreviewContextProvider=te,l.ELEMENT_BUTTON=P,l.FlyoutToolbarButton=St,l.GutterSpacing=Q,l.Heading1Plugin=Qe,l.Heading2Plugin=Ye,l.Heading3Plugin=Je,l.Heading4Plugin=Ze,l.ImageCaptionPlugin=Re,l.ImageTitlePlugin=tn,l.LinkInput=Me,l.LinkPlugin=$e,l.LinkSelector=Fe,l.Margin=j,l.MenuToolbarButton=ye,l.MultiFlyoutContextProvider=ne,l.PARAGRAPH_CLASSES=nn,l.Padding=K,l.ParagraphMarkupElement=rn,l.ParagraphMarkupElementNode=bt,l.ParagraphPlugin=en,l.QuoteMarkupElementNode=vt,l.QuotePlugin=sn,l.Radius=$,l.RichTextEditor=Lr,l.Sections=ln,l.Security=X,l.THEME_PREFIX=Pa,l.TextStylePluginsWithoutImage=Vt,l.TextStyles=C,l.TextStylesWithoutImage=nt,l.Toolbar=be,l.ToolbarFlyoutMenu=we,l.addHttps=ut,l.borderStyleMap=Yt,l.convertToRteValue=Gn,l.createButtonNode=Ne,l.createButtonPlugin=Ue,l.createLinkPlugin=ze,l.createParagraphPlugin=an,l.createQuotePlugin=on,l.customCoordinatesGetterFactory=ce,l.defineBlock=Oa,l.defineSettings=Ua,l.getBackgroundColorStyles=En,l.getBackgroundSettings=Sa,l.getBorderRadiusSettings=Ea,l.getBorderRadiusSlider=zt,l.getBorderSettings=Ta,l.getBorderStyles=Nn,l.getDefaultPluginsWithLinkChooser=xa,l.getExtendedBorderRadiusSettings=Ia,l.getGutterSettings=Ba,l.getLegacyUrl=ke,l.getLinkFromEditor=Pe,l.getMarginExtendedSettings=La,l.getMarginSettings=Na,l.getMarginSlider=$t,l.getPaddingExtendedSettings=Fa,l.getPaddingSettings=Aa,l.getPaddingSlider=Wt,l.getRadiusStyles=Ln,l.getReadableColor=Sn,l.getSecurityDownloadableSetting=Ma,l.getSecurityGlobalControlId=qt,l.getSecurityGlobalControlSetting=Da,l.getUrl=pe,l.getUrlFromEditor=Be,l.getUrlFromLinkOrLegacyLink=xe,l.gutterSpacingStyleMap=Jt,l.hasRichTextValue=ve,l.insertButton=Te,l.isDark=Cn,l.isDownloadable=Kn,l.isValidUrl=gt,l.isValidUrlOrEmpty=R,l.joinClassNames=_,l.mapAppBridgeColorPaletteToFonduePalette=Ce,l.mapAppBridgeColorPalettesToFonduePalettes=jn,l.marginStyleMap=Z,l.moveItemInArray=Tn,l.paddingStyleMap=J,l.radiusStyleMap=G,l.relativeUrlRegex=It,l.setAlpha=xn,l.submitFloatingButton=Nt,l.toColorObject=Pn,l.toHex8String=kn,l.toHexString=pn,l.toRgbaString=pt,l.toShortRgba=q,l.triggerFloatingButton=Le,l.triggerFloatingButtonEdit=ht,l.triggerFloatingButtonInsert=At,l.unwrapButton=et,l.upsertButton=Ee,l.upsertButtonText=Lt,l.useAttachments=se,l.useAttachmentsContext=le,l.useDndSensors=Dn,l.useDragPreviewContext=ot,l.useMultiFlyoutContext=re,l.useMultiFlyoutState=dt,l.withAttachmentsProvider=An,l.withButton=Se,l.wrapButton=Ie,Object.keys(h).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(l,t)&&Object.defineProperty(l,t,{enumerable:!0,get:()=>h[t]})}),Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
4
|
-
//# sourceMappingURL=index.umd.js.map
|