@frontify/guideline-blocks-settings 0.33.2 → 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 +11 -0
- package/package.json +35 -35
- 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 -1193
- 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.cjs.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("@frontify/sidebar-settings"),r=require("react/jsx-runtime"),o=require("@frontify/fondue"),x=require("react"),G=require("@frontify/app-bridge"),E=require("@dnd-kit/core"),bn=require("@dnd-kit/modifiers"),ce=require("@dnd-kit/sortable"),et=require("@react-aria/focus"),i=require("@udecode/plate"),tt=require("slate-react"),vn=require("@react-stately/overlays"),Cn=require("slate"),_=require("@ctrl/tinycolor");const O=e=>e.filter(Boolean).join(" "),kn=({onDrop:e,label:n,icon:t,secondaryLabel:s,isLoading:a,fillParentContainer:l,onAssetChooseClick:u,onUploadClick:d,withMenu:c=!0,onClick:w,validFileType:h,verticalLayout:g})=>{const[f,p]=x.useState(!1),[C,v]=x.useState(),P=x.useRef(null),[B,A]=x.useState(void 0),R=S=>{if(S.preventDefault(),p(!1),!M(S.dataTransfer.files)){A("Invalid"),setTimeout(()=>{A(void 0)},1e3);return}e==null||e(S.dataTransfer.files)},M=S=>{if(!h)return!0;for(let L=0;L<S.length;L++){const F=S[L].name.split(".").pop()??"";if(!G.FileExtensionSets[h].includes(F))return!1}return!0},U=S=>{if(!P.current||a)return;const{left:L,top:F}=P.current.getBoundingClientRect(),le=S.clientX-L,ue=S.clientY-F;v([le,ue])};return r.jsxs("button",{ref:P,"data-test-id":"block-inject-button",className:O(["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",g?"[&: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",l?"tw-h-full":"tw-h-[72px]",f&&!a?"tw-border-dashed":"tw-border-solid",C&&"tw-bg-blank-state-pressed-inverse",f&&"tw-bg-blank-state-weak-inverse",B?"!tw-border-red-50 !tw-cursor-not-allowed":" tw-border-blank-state-line",a||C||f||B?"":"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",(f||C)&&!B?"[&>*]:tw-pointer-events-none tw-border-blank-state-line-hover":"tw-bg-blank-state-shaded-inverse tw-text-blank-state-shaded"]),onDragEnter:e?S=>{var L;if(p(!0),h==="Images")for(const F of Array.from(S.dataTransfer.items))(L=F==null?void 0:F.type)!=null&&L.startsWith("image/")?A(void 0):A("Invalid")}:void 0,onDragLeave:e?()=>{p(!1),A(void 0)}:void 0,onDrop:e?R:void 0,onClick:S=>{c&&U(S),w==null||w()},children:[a?r.jsx(o.LoadingCircle,{}):B?r.jsxs("div",{className:" tw-flex tw-items-center tw-justify-center tw-text-red-60 tw-font-medium",children:[r.jsx(o.IconExclamationMarkTriangle,{}),B]}):r.jsxs(r.Fragment,{children:[t&&r.jsx("div",{children:t}),(n||s)&&r.jsxs("div",{className:"tw-flex tw-flex-col tw-items-start",children:[n&&r.jsx("div",{className:"tw-font-medium",children:n}),s&&r.jsx("div",{className:"tw-font-normal",children:s})]})]}),C&&r.jsx("div",{className:"tw-absolute tw-left-0 tw-top-full tw-z-20",style:{left:C[0],top:C[1]},children:r.jsx(o.Flyout,{onOpenChange:S=>!S&&v(void 0),isOpen:!0,fitContent:!0,hug:!1,legacyFooter:!1,trigger:r.jsx("div",{}),children:r.jsx(o.ActionMenu,{menuBlocks:[{id:"menu",menuItems:[...d?[{id:"upload",size:o.MenuItemContentSize.XSmall,title:"Upload asset",onClick:()=>{d(),v(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconArrowCircleUp20,{})})}]:[],...u?[{id:"asset",size:o.MenuItemContentSize.XSmall,title:"Browse asset",onClick:()=>{u(),v(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconImageStack20,{})})}]:[]]}]})})})]})},X=e=>{const n=s=>typeof s=="object"&&["red","green","blue"].every(l=>s.hasOwnProperty(l)),t=s=>{const a=typeof s.alpha=="number"?s.alpha:1;return{r:s.red,g:s.green,b:s.blue,a}};return n(e)?t(e):e},Sn=e=>typeof e=="object"&&["red","green","blue"].every(t=>e==null?void 0:e.hasOwnProperty(t)),Pn=(e,n)=>{const t=Sn(e)?X(e):e,s=new _.TinyColor(t);return n?s.getBrightness()<n:s.isDark()||s.getAlpha()>.25&&s.getAlpha()<1},En=e=>new _.TinyColor(X(e)).toHex8String(),Tn=e=>new _.TinyColor(X(e)).toHexString(),je=e=>new _.TinyColor(X(e)).toRgbString(),In=(e,n)=>new _.TinyColor(n).setAlpha(e).toRgbString(),Bn=e=>{const{r:n,g:t,b:s,a}=new _.TinyColor(e);return{red:n,green:t,blue:s,alpha:a}},Je=e=>typeof e=="object"&&["red","green","blue"].every(t=>e==null?void 0:e.hasOwnProperty(t)),jn=(e,n)=>{const t=Je(e)?X(e):e,s=Je(n)?X(n):n;let a=new _.TinyColor(t);const l=new _.TinyColor(s);for(;_.readability(a,l)<4.5;)a=a.darken(1);return a.toRgbString()},Nn=(e,n,t)=>{const s=[...e],a=t<0?s.length+t:t;if(a>=0&&a<s.length){const l=s.splice(n,1)[0];s.splice(a,0,l)}return s},Ln=e=>({backgroundColor:je(e)});var D=(e=>(e.Solid="Solid",e.Dashed="Dashed",e.Dotted="Dotted",e))(D||{});const nt={Solid:"solid",Dotted:"dotted",Dashed:"dashed"};var H=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(H||{});const q={None:"0px",Small:"2px",Medium:"4px",Large:"12px"};var z=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))(z||{});const Y={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var $=(e=>(e.None="None",e.Small="Small",e.Medium="Medium",e.Large="Large",e))($||{});const J={None:"0px",Small:"24px",Medium:"36px",Large:"60px"};var K=(e=>(e.Global="Global",e.Custom="Custom",e))(K||{}),W=(e=>(e.Auto="Auto",e.S="S",e.M="M",e.L="L",e))(W||{});const rt={Auto:"4px",S:"10px",M:"30px",L:"50px"},An={red:241,green:241,blue:241,alpha:1},st={red:234,green:235,blue:235,alpha:1},Rn="1px",se="24px",ae="24px",Fn=(e=D.Solid,n="1px",t=st)=>({borderStyle:nt[e],borderWidth:n,borderColor:je(t)}),Mn=(e,n=!1,t)=>({borderRadius:n?t:q[e]}),at=x.createContext(!1),ot=({children:e,isDragPreview:n})=>r.jsx(at.Provider,{value:n,children:e}),oe=()=>x.useContext(at),it=x.createContext({openFlyoutIds:[],setOpenFlyoutIds:()=>console.error("No MultiFlyoutContext Provider found")}),lt=({children:e,openFlyoutIds:n,setOpenFlyoutIds:t})=>{const s=x.useMemo(()=>({openFlyoutIds:n,setOpenFlyoutIds:t}),[n,t]);return r.jsx(it.Provider,{value:s,children:e})},ut=()=>x.useContext(it),xe=e=>{const{openFlyoutIds:n,setOpenFlyoutIds:t}=ut(),s=x.useCallback(a=>{t(l=>{const u=l.filter(d=>d!==e);return a?[...u,e]:u})},[e,t]);return{isOpen:n.includes(e),onOpenChange:s}},Ze=({children:e})=>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:e}),ct=(e,n)=>{const{blockAssets:t,addAssetIdsToKey:s,deleteAssetIdsFromKey:a,updateAssetIdsFromKey:l}=G.useBlockAssets(e),u=(t==null?void 0:t[n])||[];return{onAttachmentsAdd:async g=>{await s(n,g.map(f=>f.id))},onAttachmentDelete:async g=>{await a(n,[g.id])},onAttachmentReplace:async(g,f)=>{const p=u.map(C=>C.id===g.id?f.id:C.id);await l(n,p)},onAttachmentsSorted:async g=>{const f=g.map(p=>p.id);await l(n,f)},attachments:u,appBridge:e}},dt=x.createContext(null),gt=({appBridge:e,children:n,assetId:t})=>{const s=ct(e,t);return r.jsx(dt.Provider,{value:s,children:n})},mt=()=>{const e=x.useContext(dt);if(!e)throw new Error("No AttachmentsContext Provided. Component must be wrapped in an 'AttachmentsProvider' or the 'withAttachmentsProvider' HOC");return e},Dn=(e,n)=>{const t=s=>r.jsx(gt,{appBridge:s.appBridge,assetId:n,children:r.jsx(e,{...s})});return t.displayName="withAttachmentsProvider",t},On=[E.KeyboardCode.Down,E.KeyboardCode.Right,E.KeyboardCode.Up,E.KeyboardCode.Left],ht=(e,n)=>(t,{currentCoordinates:s,context:{activeNode:a}})=>{if(t.preventDefault(),On.includes(t.code)){const l=(a==null?void 0:a.offsetWidth)??0,u=(a==null?void 0:a.offsetHeight)??0;switch(t.code){case E.KeyboardCode.Right:return{...s,x:s.x+l+e};case E.KeyboardCode.Left:return{...s,x:s.x-l-e};case E.KeyboardCode.Down:return{...s,y:s.y+u+n};case E.KeyboardCode.Up:return{...s,y:s.y-u-n}}}},Un={start:["Space","Enter"],cancel:[],end:["Space","Enter","Escape"]},_n=(e=0,n=0)=>{const t=ht(e,n);return E.useSensors(E.useSensor(E.PointerSensor),E.useSensor(E.KeyboardSensor,{coordinateGetter:t,keyboardCodes:Un}))},Hn=e=>e==="IMAGE"?r.jsx(o.IconImage24,{}):e==="VIDEO"?r.jsx(o.IconPlayFrame24,{}):e==="AUDIO"?r.jsx(o.IconMusicNote24,{}):r.jsx(o.IconDocument24,{}),Ne=x.forwardRef(({item:e,isEditing:n,draggableProps:t,transformStyle:s,isDragging:a,isOverlay:l,isLoading:u,onDelete:d,onReplaceWithBrowse:c,onReplaceWithUpload:w,onDownload:h},g)=>{const[f,p]=x.useState(),[C,{selectedFiles:v}]=G.useFileInput({multiple:!0,accept:"image/*"}),[P,{results:B,doneAll:A}]=G.useAssetUpload(),{focusProps:R,isFocusVisible:M}=et.useFocusRing();x.useEffect(()=>{v&&P(v[0])},[v]),x.useEffect(()=>{A&&w(B[0])},[A,B]);const U=u||v&&!A;return r.jsxs("button",{"aria-label":"Download attachment","data-test-id":"attachments-item",onClick:()=>h==null?void 0:h(),ref:g,style:{...s,opacity:a&&!l?.3:1,fontFamily:"var(-f-theme-settings-body-font-family)"},className:O(["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",a?"tw-bg-box-neutral-hover":""]),children:[r.jsx("div",{className:"tw-text-text-weak group-hover:tw-text-box-neutral-inverse-hover",children:U?r.jsx(o.LoadingCircle,{size:o.LoadingCircleSize.Small}):Hn(e.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:e.title}),r.jsx("div",{className:"tw-text-text-weak",children:`${e.fileSizeHumanReadable} - ${e.extension}`})]}),n&&r.jsxs("div",{"data-test-id":"attachments-actionbar",className:O(["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",l||(f==null?void 0:f.id)===e.id?"tw-opacity-100":"tw-opacity-0"]),children:[r.jsx("button",{...R,...t,"aria-label":"Drag attachment",className:O([" 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 ",a||l?"tw-cursor-grabbing tw-bg-button-background-pressed hover:tw-bg-button-background-pressed":"tw-cursor-grab hover:tw-bg-button-background-hover",M&&o.FOCUS_STYLE,M&&"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:(f==null?void 0:f.id)===e.id,fitContent:!0,legacyFooter:!1,onOpenChange:S=>p(S?e:void 0),trigger:(S,L)=>r.jsx(o.Button,{ref:L,icon:r.jsx(o.IconPen20,{}),emphasis:o.ButtonEmphasis.Default,onClick:()=>p(e)}),children:r.jsx(o.ActionMenu,{menuBlocks:[{id:"menu",menuItems:[{id:"upload",size:o.MenuItemContentSize.XSmall,title:"Replace with upload",onClick:()=>{C(),p(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:()=>{c(),p(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:()=>{d(),p(void 0)},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:r.jsx(o.IconTrashBin20,{})})}]}]})})})]})]})});Ne.displayName="AttachmentItem";const Vn=e=>{const{attributes:n,listeners:t,setNodeRef:s,transform:a,transition:l,isDragging:u}=ce.useSortable({id:e.item.id}),d={transform:a?`translate(${a.x}px, ${a.y}px)`:"",transition:l,zIndex:u?2:1},c={...n,...t};return r.jsx(Ne,{ref:s,isDragging:u,transformStyle:d,draggableProps:c,...e})},zn=({children:e,isFlyoutOpen:n,triggerProps:t,triggerRef:s})=>r.jsxs("button",{className:O(["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"]),...t,ref:s,"data-test-id":"attachments-button-trigger",children:[r.jsx(o.IconPaperclip16,{}),e,r.jsx(o.IconCaretDown12,{})]}),ft=({items:e=[],onDelete:n,onReplaceWithBrowse:t,onReplaceWithUpload:s,onBrowse:a,onUpload:l,onSorted:u,appBridge:d,triggerComponent:c=zn,isOpen:w,onOpenChange:h})=>{const[g,f]=x.useState(e),[p,C]=x.useState(!1),v=E.useSensors(E.useSensor(E.PointerSensor),E.useSensor(E.KeyboardSensor)),[P,B]=x.useState(void 0),[A,R]=x.useState(!1),[M,U]=x.useState([]),[S,L]=x.useState(null),F=G.useEditorState(d),{openAssetChooser:le,closeAssetChooser:ue}=G.useAssetChooser(d),qe=w!==void 0,ve=qe?w:p,Q=g==null?void 0:g.find(b=>b.id===P),[hn,{results:Ge,doneAll:Ke}]=G.useAssetUpload({onUploadProgress:()=>!A&&R(!0)}),re=b=>{const I=qe?h:C;I==null||I(b)};x.useEffect(()=>{f(e)},[e]),x.useEffect(()=>{S&&(R(!0),hn(S))},[S]),x.useEffect(()=>{(async()=>{Ke&&(await l(Ge),R(!1))})()},[Ke,Ge]);const fn=()=>{re(!1),le(b=>{a(b),ue(),re(!0)},{multiSelection:!0,selectedValueIds:g.map(b=>b.id)})},Xe=b=>{re(!1),le(async I=>{re(!0),ue(),U([...M,b.id]),await t(b,I[0]),U(M.filter(V=>V!==b.id))},{multiSelection:!1,selectedValueIds:g.map(I=>I.id)})},Qe=async(b,I)=>{U([...M,b.id]),await s(b,I),U(M.filter(V=>V!==b.id))},xn=b=>{const{active:I}=b;B(I.id)},wn=b=>{const{active:I,over:V}=b;if(V&&I.id!==V.id&&g){const pn=g.findIndex(Ce=>Ce.id===I.id),yn=g.findIndex(Ce=>Ce.id===V.id),Ye=ce.arrayMove(g,pn,yn);f(Ye),u(Ye)}B(void 0)};return F||((g==null?void 0:g.length)??0)>0?r.jsx(o.LegacyTooltip,{withArrow:!0,position:o.TooltipPosition.Top,content:"Attachments",disabled:ve,enterDelay:500,triggerElement:r.jsx("div",{"data-test-id":"attachments-flyout-button",children:r.jsx(o.Flyout,{placement:o.FlyoutPlacement.BottomRight,onOpenChange:b=>re(Q?!0:b),isOpen:ve,hug:!1,fitContent:!0,legacyFooter:!1,trigger:(b,I)=>r.jsx(c,{isFlyoutOpen:ve,triggerProps:b,triggerRef:I,children:r.jsx("div",{children:e.length>0?e.length:"Add"})}),children:r.jsxs("div",{className:"tw-w-[300px]","data-test-id":"attachments-flyout-content",children:[g.length>0&&r.jsxs(E.DndContext,{sensors:v,collisionDetection:E.closestCenter,onDragStart:xn,onDragEnd:wn,modifiers:[bn.restrictToWindowEdges],children:[r.jsx(ce.SortableContext,{items:g,strategy:ce.rectSortingStrategy,children:r.jsx("div",{className:"tw-border-b tw-border-b-line",children:g.map(b=>r.jsx(Vn,{isEditing:F,isLoading:M.includes(b.id),item:b,onDelete:()=>n(b),onReplaceWithBrowse:()=>Xe(b),onReplaceWithUpload:I=>Qe(b,I),onDownload:()=>d.dispatch({name:"downloadAsset",payload:b})},b.id))})}),r.jsx(E.DragOverlay,{children:Q&&r.jsx(Ne,{isOverlay:!0,isEditing:F,item:Q,isDragging:!0,onDelete:()=>n(Q),onReplaceWithBrowse:()=>Xe(Q),onReplaceWithUpload:b=>Qe(Q,b)},P)})]}),F&&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:A,size:o.AssetInputSize.Small,onUploadClick:b=>L(b),onLibraryClick:fn})]})]})})})}):null},$n=(e,n)=>{const t=[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?t.push("tw-bg-box-neutral-pressed","tw-text-box-neutral-inverse-pressed",e==="grab"?"tw-cursor-grabbing":"tw-cursor-pointer"):t.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",e==="grab"?"!tw-cursor-grab active:tw-cursor-grabbing":"tw-cursor-pointer"),O(t)},ie=x.forwardRef(({onClick:e,children:n,forceActiveStyle:t,cursor:s="pointer","data-test-id":a="base-toolbar-button",...l},u)=>r.jsx("button",{onClick:e,className:$n(s,t),"data-test-id":a,...l,ref:u,children:n}));ie.displayName="BaseToolbarButton";const Wn=({children:e,isFlyoutOpen:n,triggerProps:t,triggerRef:s})=>r.jsxs(ie,{forceActiveStyle:n,"data-test-id":"attachments-toolbar-button-trigger",...t,ref:s,children:[r.jsx(o.IconPaperclip16,{}),e,r.jsx(o.IconCaretDown12,{})]}),xt="attachments",wt=({flyoutId:e=xt})=>{const n=o.useMemoizedId(e),{appBridge:t,attachments:s,onAttachmentsAdd:a,onAttachmentDelete:l,onAttachmentReplace:u,onAttachmentsSorted:d}=mt(),{isOpen:c,onOpenChange:w}=xe(n),h=oe();return r.jsx(ft,{onUpload:a,onDelete:l,onReplaceWithBrowse:u,onReplaceWithUpload:u,onSorted:d,onBrowse:a,items:s,appBridge:t,triggerComponent:Wn,isOpen:c&&!h,onOpenChange:w})},Le=({open:e,content:n,children:t,disabled:s})=>r.jsx(o.LegacyTooltip,{withArrow:!0,hoverDelay:0,enterDelay:300,open:e,disabled:s,position:o.TooltipPosition.Top,content:r.jsx("div",{children:n}),triggerElement:t,"data-test-id":"toolbar-button-tooltip"}),qn=({tooltip:e,icon:n,onClick:t})=>{const s=oe();return r.jsx(Le,{disabled:s,content:e??"",children:r.jsx(ie,{"data-test-id":"block-item-wrapper-toolbar-btn",onClick:t,children:n})})},pt="Drag or press ↵ to move",yt="Move with ↑↓←→ and confirm with ↵",bt=({tooltip:e,icon:n,setActivatorNodeRef:t,draggableProps:s})=>{const a=oe();return r.jsx(Le,{open:a,content:r.jsx("div",{children:a?yt:e??pt}),children:r.jsx(ie,{ref:t,"data-test-id":"block-item-wrapper-toolbar-btn",forceActiveStyle:a,cursor:"grab",...s,children:n})})},Ae=({content:e,icon:n,tooltip:t,flyoutId:s,flyoutFooter:a,flyoutHeader:l})=>{const u=o.useMemoizedId(s),{isOpen:d,onOpenChange:c}=xe(u),w=oe();return r.jsx(Le,{disabled:w||d,content:t,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:d&&!w,legacyFooter:!1,fixedFooter:a,fixedHeader:l,fitContent:!0,hug:!1,placement:o.FlyoutPlacement.BottomRight,onOpenChange:c,trigger:(h,g)=>r.jsx(ie,{"data-test-id":"block-item-wrapper-toolbar-flyout",forceActiveStyle:d&&!w,...h,ref:g,children:n}),children:e})})})},vt=({items:e,flyoutId:n})=>{const{onOpenChange:t}=xe(n);return r.jsx(o.ActionMenu,{menuBlocks:e.map((s,a)=>({id:a.toString(),menuItems:s.map((l,u)=>({id:a.toString()+u.toString(),size:o.MenuItemContentSize.XSmall,title:l.title,style:l.style,onClick:()=>{t(!1),l.onClick()},initialValue:!0,decorator:r.jsx("div",{className:"tw-mr-2",children:l.icon})}))}))})},Re="menu",Ct=({items:e,flyoutId:n=Re,tooltip:t="Options"})=>{const s=o.useMemoizedId(n);return r.jsx(Ae,{icon:r.jsx(o.IconDotsHorizontal16,{}),tooltip:t,flyoutId:s,content:r.jsx(vt,{items:e,flyoutId:s})})},kt=({items:e,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(Ze,{children:r.jsx(wt,{})}),r.jsx(Ze,{children:e.map(t=>t.type==="dragHandle"?r.jsx(bt,{...t},t.tooltip+t.type):t.type==="menu"?r.jsx(Ct,{...t},t.tooltip+t.type):t.type==="flyout"?r.jsx(Ae,{...t},t.tooltip+t.type):r.jsx(qn,{...t},t.tooltip+t.type))})]}),Gn=({children:e,toolbarItems:n,shouldHideWrapper:t,shouldHideComponent:s=!1,isDragging:a=!1,shouldFillContainer:l,outlineOffset:u=2,shouldBeShown:d=!1,showAttachments:c=!1})=>{const[w,h]=x.useState(d?[Re]:[]),g=x.useRef(null);if(t)return r.jsx(r.Fragment,{children:e});const f=n==null?void 0:n.filter(C=>C!==void 0),p=w.length>0||d;return r.jsx(ot,{isDragPreview:a,children:r.jsx(lt,{openFlyoutIds:w,setOpenFlyoutIds:h,children:r.jsxs("div",{ref:g,"data-test-id":"block-item-wrapper",style:{outlineOffset:u},className:O(["tw-relative tw-group tw-outline-1 tw-outline-box-selected-inverse",l&&"tw-flex-1 tw-h-full tw-w-full","hover:tw-outline focus-within:tw-outline",p&&"tw-outline",s&&"tw-opacity-0"]),children:[r.jsx("div",{style:{right:-1-u,bottom:`calc(100% - ${2+u}px)`},className:O(["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",p&&"tw-opacity-100"]),children:r.jsx(kt,{attachments:{isEnabled:c},items:f})}),e]})})})},Kn=({onDownload:e})=>{const{isFocused:n,focusProps:t}=et.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",...t,className:O(["tw-outline-none tw-rounded",n&&o.FOCUS_STYLE]),onClick:e,onPointerDown:s=>s.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,{})})})})},Xn=({value:e="",gap:n,columns:t,show:s=!0,plugins:a})=>{const[l,u]=x.useState(null);return x.useEffect(()=>{(async()=>u(await o.serializeRawToHtmlAsync(e,a,t,n)))()},[e,t,n,a]),!s||l==="<br />"?null:l!==null?r.jsx("div",{className:"tw-w-full tw-whitespace-pre-wrap","data-test-id":"rte-content-html",dangerouslySetInnerHTML:{__html:l}}):r.jsx("div",{className:"tw-rounded-sm tw-bg-base-alt tw-animate-pulse tw-h-full tw-min-h-[10px] tw-w-full"})},St=e=>{if(!e)return!1;const n=t=>t.some(s=>s.text?s.text!=="":s.children?n(s.children):!1);try{const t=JSON.parse(e);return n(t)}catch{return!1}},Qn=(e="p",n="",t)=>St(n)?n:JSON.stringify([{type:e,children:[{text:n,textStyle:e}],align:t}]),Yn=(e,n,t)=>e===K.Custom?n:t,Jn=e=>e.map(Pt),Pt=e=>({id:e.id,title:e.name,colors:e.colors.map(er)}),Zn=e=>"revision"in e,er=e=>{if(Zn(e)){const{title:n,revision:t}=e;return{alpha:t.rgba.alpha?t.rgba.alpha/255:1,red:t.rgba.red??0,green:t.rgba.green??0,blue:t.rgba.blue??0,name:n??""}}return{alpha:e.alpha?e.alpha/255:1,red:e.red??0,green:e.green??0,blue:e.blue??0,name:e.name??""}},Fe=(e,n)=>{const t=i.getAboveNode(e,{match:{type:i.ELEMENT_LINK}});return Array.isArray(t)?n(t[0]):""},Et=e=>Fe(e,n=>{var t,s;return((s=(t=n.chosenLink)==null?void 0:t.searchResult)==null?void 0:s.link)||""}),Tt=e=>Fe(e,n=>n.url||""),It=e=>{var n,t;return e.url||((t=(n=e.chosenLink)==null?void 0:n.searchResult)==null?void 0:t.link)||""},Bt=e=>Fe(e,It),Me=/^\/(document|r)\/\S+$/i,we=e=>{if(Me.test(e))return e;try{return new URL(e),e}catch{return`https://${e}`}},pe=e=>{if(Me.test(e))return!0;try{const n=new URL(e);return["http:","https:","mailto:","tel:"].includes(n.protocol)&&n.pathname!==""}catch{return!1}},ee=e=>pe(we(e))||e==="",jt=(e,{type:n})=>{const{apply:t,normalizeNode:s}=e;return e.apply=a=>{if(a.type!=="set_selection"){t(a);return}const l=a.newProperties;if(!(l!=null&&l.focus)||!l.anchor||!i.isCollapsed(l)){t(a);return}const u=i.getAboveNode(e,{at:l,match:{type:i.getPluginType(e,k)}});if(u){const[,d]=u;let c;i.isStartPoint(e,l.focus,d)&&(c=i.getPreviousNodeEndPoint(e,d)),i.isEndPoint(e,l.focus,d)&&(c=i.getNextNodeStartPoint(e,d)),c&&(a.newProperties={anchor:c,focus:c})}t(a)},e.normalizeNode=([a,l])=>{if(a.type===i.getPluginType(e,k)){const u=e.selection;if(u&&i.isCollapsed(u)&&i.isEndPoint(e,u.focus,l)){const d=i.getNextNodeStartPoint(e,l);if(d)i.select(e,d);else{const c=Cn.Path.next(l);i.insertNodes(e,{text:""},{at:c}),i.select(e,c)}}}s([a,l])},i.withRemoveEmptyNodes(e,i.mockPlugin({options:{types:n}}))},Nt=(e,n,t)=>{i.insertNodes(e,[Ft(e,n)],t)},De=i.createStore("floatingButton")({openEditorId:null,mouseDown:!1,updated:!1,url:"",text:"",buttonStyle:"primary",newTab:!1,mode:"",isEditing:!1}).extendActions(e=>({reset:()=>{e.url(""),e.text(""),e.buttonStyle("primary"),e.newTab(!1),e.mode(""),e.isEditing(!1)}})).extendActions(e=>({show:(n,t)=>{e.mode(n),e.isEditing(!1),e.openEditorId(t)},hide:()=>{e.reset(),e.openEditorId(null)}})).extendSelectors(e=>({isOpen:n=>e.openEditorId===n})),T=De.set,N=De.get,te=()=>De.use,Oe=e=>{if(!e.selection)return;const{isUrl:n,forceSubmit:t}=i.getPluginOptions(e,k),s=N.url();if(!((n==null?void 0:n(s))||t))return;const l=N.text(),u=N.buttonStyle(),d=N.newTab()?void 0:"_self";return T.hide(),Lt(e,{url:s,text:l,buttonStyle:u,target:d,isUrl:c=>t||!n?!0:n(c)}),setTimeout(()=>{i.focusEditor(e,e.selection??void 0)},0),!0},ne=(e,n)=>i.withoutNormalizing(e,()=>{var t,s,a,l,u,d;if(n!=null&&n.split){if(i.getAboveNode(e,{at:(t=e.selection)==null?void 0:t.anchor,match:{type:i.getPluginType(e,k)}}))return i.splitNodes(e,{at:(s=e.selection)==null?void 0:s.anchor,match:h=>i.isElement(h)&&h.type===i.getPluginType(e,k)}),ne(e,{at:(a=e.selection)==null?void 0:a.anchor}),!0;if(i.getAboveNode(e,{at:(l=e.selection)==null?void 0:l.focus,match:{type:i.getPluginType(e,k)}}))return i.splitNodes(e,{at:(u=e.selection)==null?void 0:u.focus,match:h=>i.isElement(h)&&h.type===i.getPluginType(e,k)}),ne(e,{at:(d=e.selection)==null?void 0:d.focus}),!0}i.unwrapNodes(e,{match:{type:i.getPluginType(e,k)},...n})}),Lt=(e,{url:n,text:t,buttonStyle:s,target:a,insertTextInButton:l,insertNodesOptions:u,isUrl:d=i.getPluginOptions(e,k).isUrl})=>{var B;const c=e.selection;if(!c)return;const w=i.getAboveNode(e,{at:c,match:{type:i.getPluginType(e,k)}});if(l&&w)return e.insertText(n),!0;if(!(d!=null&&d(n)))return;if(i.isDefined(t)&&t.length===0&&(t=n),w)return rr(n,e,w,a,s,t),!0;const h=i.findNode(e,{at:c,match:{type:i.getPluginType(e,k)}}),[g,f]=h??[],p=tr(e,f,t);if(i.isExpanded(c))return nr(w,e,n,s,a,t),!0;p&&i.removeNodes(e,{at:f});const C=i.getNodeProps(g??{}),v=(B=e.selection)==null?void 0:B.focus.path;if(!v)return;const P=i.getNodeLeaf(e,v);return t!=null&&t.length||(t=n),Nt(e,{...C,url:n,target:a,children:[{...P,text:t}]},u),!0};function tr(e,n,t){return n&&(t==null?void 0:t.length)&&t!==i.getEditorString(e,n)}function nr(e,n,t,s,a,l){e?ne(n,{at:e[1]}):ne(n,{split:!0}),At(n,{url:t,buttonStyle:s,target:a}),Ue(n,{url:t,target:a,text:l})}function rr(e,n,t,s,a,l){var u,d,c;(e!==((u=t[0])==null?void 0:u.url)||s!==((d=t[0])==null?void 0:d.target)||a!==((c=t[0])==null?void 0:c.buttonStyle))&&i.setNodes(n,{url:e,target:s,buttonStyle:a},{at:t[1]}),Ue(n,{url:e,text:l,target:s})}const Ue=(e,{text:n})=>{const t=i.getAboveNode(e,{match:{type:i.getPluginType(e,k)}});if(t){const[s,a]=t;if(n!=null&&n.length&&n!==i.getEditorString(e,a)){const l=s.children[0];i.replaceNodeChildren(e,{at:a,nodes:{...l,text:n},insertOptions:{select:!0}})}}},At=(e,{url:n,buttonStyle:t,target:s,...a})=>{i.wrapNodes(e,{type:i.getPluginType(e,k),url:n,buttonStyle:t,target:s,children:[]},{split:!0,...a})},sr=(e,n)=>{const t=i.getAboveNode(e,{match:{type:k}});return Array.isArray(t)?n(t[0]):""},Rt=e=>sr(e,n=>n.url??""),Ft=(e,{url:n,text:t="",buttonStyle:s="primary",target:a,children:l})=>({type:i.getPluginType(e,k),url:n,target:a,buttonStyle:s,children:l??[{text:t}]}),Mt=(e,{focused:n}={})=>{if(N.mode()==="edit"){ye(e);return}_e(e,{focused:n})},ye=e=>{const n=i.findNode(e,{match:{type:i.getPluginType(e,k)}});if(!n)return;const[t,s]=n;let a=i.getEditorString(e,s);T.url(t.url),T.newTab(t.target===void 0),a===t.url&&(a=""),T.text(a),T.isEditing(!0)},_e=(e,{focused:n}={})=>{N.mode()||!n||i.isRangeAcrossBlocks(e,{at:e.selection})||i.someNode(e,{match:{type:i.getPluginType(e,k)}})||(T.text(i.getEditorString(e,e.selection)),T.show("insert",e.id))},be={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)"}}},ar=e=>({...i.useElementProps({...e,elementToAttributes:t=>({url:t.href,buttonStyle:t.buttonStyle||"primary",target:t.target||"_blank"})}),onMouseOver:t=>{t.stopPropagation()}}),or=e=>{const{href:n,target:t,buttonStyle:s}=ar(e),{attributes:a,children:l}=e;return r.jsx(ir,{attributes:a,href:n,target:t,styles:be[`button${s.charAt(0).toUpperCase()+s.slice(1)}`],children:l})},ir=({attributes:e,styles:n={hover:{}},children:t,href:s="#",target:a})=>{const[l,u]=x.useState(!1);return r.jsx("a",{...e,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),href:s,target:a,style:l?{...n,...n.hover}:n,children:t})};class lr extends o.MarkupElement{constructor(n=k,t=or){super(n,t)}}const ur=({type:e,...n})=>{const t=i.useEditorRef(),s=!!i.isRangeInSameBlock(t,{at:t.selection}),a=!!(t!=null&&t.selection)&&i.someNode(t,{match:{type:e}});return r.jsx(i.ToolbarButton,{tooltip:o.getTooltip(s?`Button
|
|
2
|
-
${o.getHotkeyByPlatform("Ctrl+Shift+K")}`:"Buttons can only be set for a single text block."),classNames:o.getButtonClassNames(s),active:a,onMouseDown:async l=>{t&&(l.preventDefault(),l.stopPropagation(),i.focusEditor(t,t.selection??t.prevSelection??void 0),setTimeout(()=>{Mt(t,{focused:!0})},0))},...n})},cr=({editor:e,id:n})=>r.jsx("div",{"data-plugin-id":n,children:r.jsx(ur,{type:i.getPluginType(e,k),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})}),dr=()=>{const e=Nr({});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:e.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(ge.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(ge.UnlinkButton,{children:r.jsx(o.IconTrashBin16,{})})})]})]})})},gr=({section:e,selectedUrl:n,onSelectUrl:t})=>{const s=e.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",s?"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:()=>t(e.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:e.title}),r.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Section"})]})})},mr=({page:e,selectedUrl:n,onSelectUrl:t,itemsToExpandInitially:s,getDocumentSectionsByDocumentPageId:a})=>{const[l,u]=x.useState(e.id===s.documentId),[d,c]=x.useState([]),w=e.permanentLink===n;x.useEffect(()=>{(async()=>{const p=await a(e.id);c(p)})()},[e.id,a]),x.useEffect(()=>{e.id===s.pageId&&u(!0)},[s,e.id]);const h=[...d.values()],g=h.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",g?"tw-pl-7":"tw-pl-12",w?"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:()=>t(e.permanentLink),children:r.jsxs("div",{className:"tw-flex tw-flex-1 tw-space-x-1 tw-items-center tw-h-6",children:[g&&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:()=>u(!l),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",l?"tw-rotate-90":""])})}),r.jsx("span",{className:"tw-text-s",children:e.title}),r.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Page"})]},e.id)}),l&&h.length>0&&h.map(f=>r.jsx(gr,{section:f,selectedUrl:n,onSelectUrl:t},f.id))]})},Dt=()=>r.jsx("div",{className:"tw-flex tw-justify-center tw-h-10 tw-items-center",children:r.jsx(o.LoadingCircle,{size:o.LoadingCircleSize.Small})}),hr=({documentId:e,selectedUrl:n,onSelectUrl:t,itemsToExpandInitially:s,getDocumentSectionsByDocumentPageId:a,getDocumentPagesByDocumentId:l})=>{const[u,d]=x.useState([]),[c,w]=x.useState(!0),h=[...u.values()],g=!c&&h.length>0;return x.useEffect(()=>{l(e).then(f=>{const p=f.filter(v=>!!v.category).sort((v,P)=>v.category.sort===P.category.sort?v.sort-P.sort:v.category.sort-P.category.sort),C=f.filter(v=>!v.category).sort((v,P)=>v.sort-P.sort);d([...p,...C])}).finally(()=>{w(!1)})},[]),c?r.jsx(Dt,{}):g?r.jsx(r.Fragment,{children:h.map(f=>r.jsx(mr,{page:f,selectedUrl:n,onSelectUrl:t,itemsToExpandInitially:s,getDocumentSectionsByDocumentPageId:a},f.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."})},fr=({document:e,selectedUrl:n,onSelectUrl:t,itemsToExpandInitially:s,getDocumentSectionsByDocumentPageId:a,getDocumentPagesByDocumentId:l})=>{const[u,d]=x.useState(e.id===s.documentId),c=e.permanentLink===n;return x.useEffect(()=>{e.id===s.documentId&&d(!0)},[s,e.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",c?"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:()=>t(e.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:()=>d(!u),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",u?"tw-rotate-90":""])})}),r.jsx(o.IconColorFan16,{}),r.jsx("span",{className:"tw-text-s",children:e.title}),r.jsx("span",{className:"tw-flex-auto tw-font-sans tw-text-xs tw-text-right",children:"Document"})]}),u&&r.jsx(hr,{documentId:e.id,selectedUrl:n,onSelectUrl:t,itemsToExpandInitially:s,getDocumentSectionsByDocumentPageId:a,getDocumentPagesByDocumentId:l})]})},xr=({selectedUrl:e,onSelectUrl:n,getAllDocuments:t,getDocumentPagesByDocumentId:s,getDocumentSectionsByDocumentPageId:a})=>{const[l,u]=x.useState(!0),[d,c]=x.useState([]),[w,h]=x.useState({documentId:void 0,pageId:void 0}),g=[...d.values()];x.useEffect(()=>{e&&g.length>0&&f().then(p=>{h(p)})},[g.length]),x.useEffect(()=>{t().then(p=>{c(p)}).finally(()=>{u(!1)})},[]);const f=async()=>{const p={documentId:void 0,pageId:void 0};if(g.find(v=>v.permanentLink===e))return p;for(const v of g){const B=[...(await s(v.id)).values()];if(!!B.find(R=>R.permanentLink===e))return p.documentId=v.id,p;for(const R of B)if(!![...(await a(R.id)).values()].find(L=>L.permanentLink===e))return p.documentId=v.id,p.pageId=R.id,p}return p};return l?r.jsx(Dt,{}):r.jsx(r.Fragment,{children:g.map(p=>r.jsx(fr,{document:p,selectedUrl:e,onSelectUrl:n,itemsToExpandInitially:w,getDocumentSectionsByDocumentPageId:a,getDocumentPagesByDocumentId:s},p.id))})},Ot=({url:e,onUrlChange:n,buttonSize:t=o.ButtonSize.Medium,getAllDocuments:s,getDocumentPagesByDocumentId:a,getDocumentSectionsByDocumentPageId:l})=>{const{open:u,isOpen:d,close:c}=vn.useOverlayTriggerState({}),[w,h]=x.useState(e),g=C=>{h(C)},f=C=>{C.key==="Enter"&&p()};x.useEffect(()=>{e&&!w&&h(e)},[e,w]);const p=()=>{n==null||n(w),c()};return r.jsxs("div",{"data-test-id":"internal-link-selector",onKeyDown:f,children:[r.jsx(o.Button,{icon:r.jsx(o.IconLink,{}),size:t,type:o.ButtonType.Button,style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Default,onClick:()=>u(),children:"Internal link"}),r.jsxs(o.Modal,{zIndex:1001,onClose:()=>c(),isOpen:d,isDismissable:!0,children:[r.jsx(o.Modal.Header,{title:"Select internal link"}),r.jsx(o.Modal.Body,{children:r.jsx(xr,{selectedUrl:w,onSelectUrl:g,getAllDocuments:s,getDocumentPagesByDocumentId:a,getDocumentSectionsByDocumentPageId:l})}),r.jsx(o.Modal.Footer,{buttons:[{children:"Cancel",onClick:()=>c(),style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Default},{children:"Choose",onClick:C=>{C==null||C.preventDefault(),p()},style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Strong,disabled:!w}]})]})]})},Ut=({onUrlChange:e,onToggleTab:n,isValidUrlOrEmpty:t,appBridge:s,clearable:a,placeholder:l,newTab:u,openInNewTab:d,url:c="",required:w,info:h,label:g,buttonSize:f,hideInternalLinkButton:p})=>{const C=t?t(c):ee(c),v=u??(d?o.CheckboxState.Checked:o.CheckboxState.Unchecked);return r.jsxs("div",{"data-test-id":"link-input",children:[r.jsx(o.FormControl,{label:{children:g,htmlFor:"url",required:w,tooltip:h?{content:h,position:o.TooltipPosition.Top}:void 0},children:r.jsx(o.TextInput,{id:"url",value:c,clearable:a,onChange:e,placeholder:l??"https://example.com",focusOnMount:!0})}),!C&&r.jsx("div",{className:"tw-text-text-negative tw-mt-1 tw-text-s",children:"Please enter a valid URL."}),!p&&r.jsx("div",{className:"tw-mt-3",children:r.jsx(Ot,{url:c,onUrlChange:e,buttonSize:f??o.ButtonSize.Medium,getAllDocuments:()=>s.getAllDocuments(),getDocumentPagesByDocumentId:P=>s.getDocumentPagesByDocumentId(P),getDocumentSectionsByDocumentPageId:P=>s.getDocumentSectionsByDocumentPageId(P)})}),r.jsx("div",{className:"tw-mt-3",children:r.jsx(o.Checkbox,{value:"new-tab",label:"Open in new tab",state:v,onChange:n})})]})},_t=({state:e,onTextChange:n,onUrlChange:t,onToggleTab:s,onCancel:a,onSave:l,isValidUrlOrEmpty:u,hasValues:d,testId:c,appBridge:w,children:h})=>r.jsxs("div",{"data-test-id":c,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:e.text,placeholder:"Link Text",onChange:n})}),h,r.jsx("div",{className:"tw-mt-5",children:r.jsx(Ut,{url:e.url,newTab:e.newTab,onUrlChange:t,onToggleTab:s,isValidUrlOrEmpty:u,appBridge:w})}),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:a,size:o.ButtonSize.Medium,style:o.ButtonStyle.Default,emphasis:o.ButtonEmphasis.Default,children:"Cancel"}),r.jsx(o.Button,{onClick:l,size:o.ButtonSize.Medium,icon:r.jsx(o.IconCheckMark20,{}),disabled:!d||!u(e==null?void 0:e.url),children:"Save"})]})})]}),wr=e=>{var t;const n=i.getAboveNode(e,{match:{type:k}});return Array.isArray(n)&&((t=n[0])==null?void 0:t.buttonStyle)||"primary"},pr={url:"",text:"",buttonStyle:"primary",newTab:o.CheckboxState.Unchecked},yr=()=>{const[e,n]=x.useReducer((t,s)=>{const{type:a,payload:l}=s;switch(a){case"NEW_TAB":return{...t,newTab:o.CheckboxState.Checked};case"SAME_TAB":return{...t,newTab:o.CheckboxState.Unchecked};case"URL":case"TEXT":case"BUTTON_STYLE":case"INIT":return{...t,...l};default:return t}},pr);return[e,n]},br=()=>{const e=i.useEditorRef(),[n,t]=yr();x.useEffect(()=>{const g=wr(e);t({type:"INIT",payload:{text:N.text(),buttonStyle:g,newTab:N.newTab()?o.CheckboxState.Checked:o.CheckboxState.Unchecked,url:N.url()}})},[t,e]);const s=g=>{t({type:"TEXT",payload:{text:g}})},a=g=>{t({type:"BUTTON_STYLE",payload:{buttonStyle:g}})},l=g=>{t({type:"URL",payload:{url:g}})},u=g=>{t(g?{type:"NEW_TAB"}:{type:"SAME_TAB"})},d=()=>{T.hide()},c=g=>{if(!ee(n.url)||!w)return;const f=we(n.url);T.text(n.text),T.url(f),T.buttonStyle(n.buttonStyle),T.newTab(n.newTab===o.CheckboxState.Checked),Oe(e)&&(g==null||g.preventDefault())},w=n.url!==""&&n.text!=="",{appBridge:h}=i.getPluginOptions(e,k);return i.useHotkeys("enter",c,{enableOnFormTags:["INPUT"]},[]),{state:n,onTextChange:s,onButtonStyleChange:a,onUrlChange:l,onToggleTab:u,onCancel:d,onSave:c,hasValues:w,isValidUrlOrEmpty:ee,appBridge:h}},de="link-plugin";var y=(e=>(e.heading1="heading1",e.heading2="heading2",e.heading3="heading3",e.heading4="heading4",e.custom1="custom1",e.custom2="custom2",e.custom3="custom3",e.quote="quote",e.imageCaption="imageCaption",e.imageTitle="imageTitle",e.p="p",e))(y||{});const j={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)"},[de]:{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)"},...be},vr=()=>{const e=br(),{state:n,onButtonStyleChange:t}=e;return r.jsx(_t,{...e,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(ke,{id:"primary",styles:j.buttonPrimary,isActive:n.buttonStyle==="primary",onClick:()=>t("primary"),children:n.text||"Primary Button"}),r.jsx(ke,{id:"secondary",styles:j.buttonSecondary,isActive:n.buttonStyle==="secondary",onClick:()=>t("secondary"),children:n.text||"Secondary Button"}),r.jsx(ke,{id:"tertiary",styles:j.buttonTertiary,isActive:n.buttonStyle==="tertiary",onClick:()=>t("tertiary"),children:n.text||"Tertiary Button"})]})})})},ke=({id:e,styles:n,isActive:t,onClick:s,children:a})=>{const[l,u]=x.useState(!1),d=()=>n&&n.hover&&l?{...n,...n.hover}:n;return r.jsx("button",{"data-test-id":`floating-button-insert-${e}`,onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),onClick:s,style:{...d(),marginTop:0,marginBottom:0},className:t?"tw-outline tw-outline-1 tw-outline-violet-60 tw-outline-offset-2 tw-w-fit":"tw-w-fit",children:a})},Cr=()=>{const e=te().isEditing(),n=r.jsx(vr,{}),t=e?n:r.jsx(dr,{});return r.jsxs(r.Fragment,{children:[r.jsx(ge.InsertRoot,{children:n}),r.jsx(ge.EditRoot,{children:t})]})},k="button",Ht="button-plugin",Vt=e=>i.createPluginFactory({key:k,isElement:!0,isInline:!0,props:({element:n})=>({nodeProps:{href:n==null?void 0:n.url,target:n==null?void 0:n.target}}),withOverrides:jt,renderAfterEditable:Cr,options:{isUrl:pe,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingButtonHotkeys:"command+shift+k, ctrl+shift+k",appBridge:e},then:(n,{type:t})=>({deserializeHtml:{rules:[{validNodeName:"A",validClassName:"btn"}],getNode:s=>({type:t,url:s.getAttribute("href"),target:s.getAttribute("target")||"_blank"})}})})();class zt extends o.Plugin{constructor({styles:n=be,...t}){super(Ht,{button:cr,markupElement:new lr,...t}),this.styles={},this.styles=n,this.appBridge=t==null?void 0:t.appBridge}plugins(){return[Vt(this.appBridge)]}}const kr=({floatingOptions:e,...n})=>{const t=i.useEditorRef(),s=i.usePlateSelectors(t.id).keyEditor(),a=te().mode(),l=te().isOpen(t.id),{triggerFloatingButtonHotkeys:u}=i.getPluginOptions(t,k),d=x.useCallback(()=>{const f=i.getAboveNode(t,{match:{type:i.getPluginType(t,k)}});if(f){const[,p]=f;return i.getRangeBoundingClientRect(t,{anchor:i.getStartPoint(t,p),focus:i.getEndPoint(t,p)})}return i.getDefaultBoundingClientRect()},[t]),c=l&&a==="edit",{update:w,style:h,floating:g}=Wt({open:c,getBoundingClientRect:d,...e});return x.useEffect(()=>{const f=Rt(t);if(f&&T.url(f),t.selection&&i.someNode(t,{match:{type:i.getPluginType(t,k)}})){T.show("edit",t.id),w();return}N.mode()==="edit"&&T.hide()},[t,s,w]),i.useHotkeys(u,f=>{f.preventDefault(),N.mode()==="edit"&&ye(t)},{enableOnContentEditable:!0},[]),Lr(),$t(),{style:{...h,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,g)}},Sr=({floatingOptions:e,...n})=>{const t=i.useEditorRef(),s=tt.useFocused(),a=te().mode(),l=te().isOpen(t.id),{triggerFloatingButtonHotkeys:u}=i.getPluginOptions(t,k);i.useHotkeys(u,h=>{h.preventDefault(),_e(t,{focused:s})},{enableOnContentEditable:!0},[s]);const{update:d,style:c,floating:w}=Wt({open:l&&a==="insert",getBoundingClientRect:i.getSelectionBoundingClientRect,whileElementsMounted:void 0,...e});return x.useEffect(()=>{l&&d(),T.updated(l)},[l,d]),$t(),{style:{...c,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,w)}},Pr=e=>{const n=i.useEditorRef();return{onClick:x.useCallback(()=>{ye(n)},[n]),...e}},Er=i.createComponentAs(e=>{const n=Pr(e);return i.createElementAs("button",n)}),Tr=e=>{const n=i.useEditorRef();return{onClick:x.useCallback(()=>{ne(n),i.focusEditor(n,n.selection??void 0)},[n]),...e}},Ir=i.createComponentAs(e=>{const n=Tr(e);return i.createElementAs(i.Button,n)}),Br=i.createComponentAs(e=>{var t;const n=kr(e);return((t=n.style)==null?void 0:t.display)==="none"?null:i.createElementAs("div",n)}),jr=i.createComponentAs(e=>{var t;const n=Sr(e);return((t=n.style)==null?void 0:t.display)==="none"?null:i.createElementAs("div",n)}),ge={EditRoot:Br,InsertRoot:jr,EditButton:Er,UnlinkButton:Ir},Nr=e=>{const n=te().updated(),t=x.useRef(null);x.useEffect(()=>{t.current&&n&&setTimeout(()=>{var a;(a=t.current)==null||a.focus()},0)},[n]);const s=x.useCallback(a=>{T.url(a.target.value)},[]);return i.mergeProps({onChange:s,defaultValue:N.url()},{...e,ref:i.useComposedRef(e.ref,t)})},Lr=()=>{const e=i.useEditorRef();i.useHotkeys("*",n=>{n.key==="Enter"&&Oe(e)&&n.preventDefault()},{enableOnFormTags:["INPUT"]},[])},$t=()=>{const e=i.useEditorRef();i.useHotkeys("escape",()=>{if(N.mode()==="edit"){if(N.isEditing()){T.show("edit",e.id),i.focusEditor(e,e.selection??void 0);return}T.hide()}},{enableOnFormTags:["INPUT"],enableOnContentEditable:!0},[])},Ar=12,Rr=-22,Fr=96,Wt=e=>i.useVirtualFloating({placement:"bottom-start",middleware:[i.offset({mainAxis:Ar,alignmentAxis:Rr}),i.flip({padding:Fr})],...e}),Mr=({id:e="rte",isEditing:n,value:t,columns:s,gap:a,placeholder:l,plugins:u,onTextChange:d,showSerializedText:c})=>{const[w,h]=x.useState(!1),g=f=>{d&&f!==t&&d(f),h(!1)};return x.useEffect(()=>{const f=p=>(p.preventDefault(),p.returnValue="Unprocessed changes");return w&&window.addEventListener("beforeunload",f),()=>window.removeEventListener("beforeunload",f)},[w]),n?r.jsx(o.RichTextEditor,{id:e,value:t,border:!1,placeholder:l,plugins:u,onValueChanged:()=>h(!0),onTextChange:g,hideExternalFloatingModals:f=>{N.isOpen(f)&&T.reset()}}):r.jsx(Xn,{value:t,columns:s,gap:a,show:c,plugins:u})},Dr=({floatingOptions:e,...n})=>{const t=i.useEditorRef(),s=tt.useFocused(),a=i.useFloatingLinkSelectors().mode(),l=i.useFloatingLinkSelectors().isOpen(t.id),{triggerFloatingLinkHotkeys:u}=i.getPluginOptions(t,i.ELEMENT_LINK);i.useHotkeys(u,h=>{i.triggerFloatingLinkInsert(t,{focused:s})&&h.preventDefault()},{enableOnContentEditable:!0},[s]);const{update:d,style:c,floating:w}=i.useVirtualFloatingLink({editorId:t.id,open:l&&a==="insert",getBoundingClientRect:i.getSelectionBoundingClientRect,whileElementsMounted:()=>{},...e});return x.useEffect(()=>{l?(d(),i.floatingLinkActions.updated(!0)):i.floatingLinkActions.updated(!1)},[l,d]),i.useFloatingLinkEscape(),{style:{...c,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,w)}},Or=i.createComponentAs(e=>{var t;const n=Dr({...e,floatingOptions:{strategy:"absolute"}});return((t=n.style)==null?void 0:t.display)==="none"?null:i.createElementAs("div",n)}),Ur=i.createComponentAs(e=>{var t;const n=Hr({...e,floatingOptions:{strategy:"absolute"}});return((t=n.style)==null?void 0:t.display)==="none"?null:i.createElementAs("div",n)});i.FloatingLink.EditRoot=Ur;i.FloatingLink.InsertRoot=Or;const me=i.FloatingLink,_r=()=>{const e=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:e.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(me.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(me.UnlinkButton,{children:r.jsx(o.IconTrashBin16,{})})})]})]})})},Hr=({floatingOptions:e,...n})=>{const t=i.useEditorRef(),s=i.usePlateSelectors().keyEditor(),a=i.useFloatingLinkSelectors().mode(),l=i.useFloatingLinkSelectors().isOpen(t.id),{triggerFloatingLinkHotkeys:u="command+k, ctrl+k"}=i.getPluginOptions(t,i.ELEMENT_LINK),d=x.useCallback(()=>{const f=i.getAboveNode(t,{match:{type:i.getPluginType(t,i.ELEMENT_LINK)}});if(f){const[,p]=f;return i.getRangeBoundingClientRect(t,{anchor:i.getStartPoint(t,p),focus:i.getEndPoint(t,p)})}return i.getDefaultBoundingClientRect()},[t]),c=l&&a==="edit",{update:w,style:h,floating:g}=i.useVirtualFloatingLink({editorId:t.id,open:c,getBoundingClientRect:d,...e});return x.useEffect(()=>{const f=Bt(t);if(f&&i.floatingLinkActions.url(f),t.selection&&i.someNode(t,{match:{type:i.getPluginType(t,i.ELEMENT_LINK)}})){i.floatingLinkActions.show("edit",t.id),w();return}i.floatingLinkSelectors.mode()==="edit"&&i.floatingLinkActions.hide()},[t,s,w]),i.useHotkeys(u,f=>{f.preventDefault(),i.floatingLinkSelectors.mode()==="edit"&&i.triggerFloatingLinkEdit(t)},{enableOnContentEditable:!0},[]),i.useFloatingLinkEnter(),i.useFloatingLinkEscape(),{style:{...h,zIndex:1e3},...n,ref:i.useComposedRef(n.ref,g)}},Vr={url:"",text:"",newTab:o.CheckboxState.Unchecked},zr=()=>{const[e,n]=x.useReducer((t,s)=>{const{type:a,payload:l}=s;switch(a){case"NEW_TAB":return{...t,newTab:o.CheckboxState.Checked};case"SAME_TAB":return{...t,newTab:o.CheckboxState.Unchecked};case"URL":case"TEXT":case"INIT":return{...t,...l};default:return t}},Vr);return[e,n]},$r=()=>{const e=i.useEditorRef(),[n,t]=zr();x.useEffect(()=>{const h=Et(e),g=Tt(e);t({type:"INIT",payload:{text:i.floatingLinkSelectors.text(),newTab:i.floatingLinkSelectors.newTab()?o.CheckboxState.Checked:o.CheckboxState.Unchecked,url:h&&g===""?h:i.floatingLinkSelectors.url()}})},[t,e]);const s=h=>{t({type:"TEXT",payload:{text:h}})},a=h=>{t({type:"URL",payload:{url:h}})},l=h=>{t(h?{type:"NEW_TAB"}:{type:"SAME_TAB"})},u=()=>{i.floatingLinkActions.hide()},d=h=>{if(!ee(n.url)||!c)return;const g=we(n.url);i.floatingLinkActions.text(n.text),i.floatingLinkActions.url(g),i.floatingLinkActions.newTab(n.newTab===o.CheckboxState.Checked),i.submitFloatingLink(e)&&(h==null||h.preventDefault())},c=n.url!==""&&n.text!=="",{appBridge:w}=i.getPluginOptions(e,i.ELEMENT_LINK);return i.useHotkeys("enter",d,{enableOnFormTags:["INPUT"]},[]),{state:n,onTextChange:s,onUrlChange:a,onToggleTab:l,onCancel:u,onSave:d,hasValues:c,isValidUrlOrEmpty:ee,appBridge:w}},Wr=()=>r.jsx(_t,{...$r(),testId:"floating-link-insert"}),qr=({readOnly:e})=>{const n=i.useFloatingLinkSelectors().isEditing();if(e)return null;const t=r.jsx(Wr,{}),s=n?t:r.jsx(_r,{});return r.jsxs(r.Fragment,{children:[r.jsx(me.InsertRoot,{children:t}),r.jsx(me.EditRoot,{children:s})]})},Gr=({id:e,editorId:n})=>{const t=i.usePlateEditorState(i.useEventPlateId(n)),s=!!i.isRangeInSameBlock(t,{at:t.selection});return r.jsx("div",{"data-plugin-id":e,children:r.jsx(i.LinkToolbarButton,{tooltip:o.getTooltip(s?`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(s),styles:{root:{width:"24px",height:"24px"}},actionHandler:"onMouseDown"})})},Kr=e=>({...i.useElementProps({...e,elementToAttributes:t=>{var s,a;return{href:t.url||((a=(s=t.chosenLink)==null?void 0:s.searchResult)==null?void 0:a.link)||"",target:t.target||"_self"}}}),onMouseOver:t=>{t.stopPropagation()}}),Xr=e=>{const n=Kr(e),{attributes:t,children:s}=e;return r.jsx("a",{...t,href:n.href,target:n.target,style:j[de],children:s})};class Qr extends o.MarkupElement{constructor(n=i.ELEMENT_LINK,t=Xr){super(n,t)}}const qt=e=>i.createPluginFactory({...i.createLinkPlugin(),renderAfterEditable:qr,options:{isUrl:pe,rangeBeforeOptions:{matchString:" ",skipInvalid:!0,afterMatch:!0},triggerFloatingLinkHotkeys:"command+k, ctrl+k",appBridge:e}})();class Gt extends o.Plugin{constructor(n,t=j[de]){super(de,{button:Gr,markupElement:new Qr,...n}),this.styles={},this.styles=t,this.appBridge=n==null?void 0:n.appBridge}plugins(){return[qt(this.appBridge)]}}const Yr="textstyle-custom1-plugin";class Kt extends o.Plugin{constructor({styles:n=j.custom1,...t}={}){super(y.custom1,{label:"Custom 1",markupElement:new Jr,...t}),this.styles={},this.styles=n}plugins(){return[Zr(this.styles)]}}class Jr extends o.MarkupElement{constructor(n=Yr,t=Xt){super(n,t)}}const Xt=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("p",{...n,style:s,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),children:t})},Zr=e=>i.createPluginFactory({key:y.custom1,isElement:!0,deserializeHtml:{rules:[{validClassName:y.custom1}]}})({component:n=>r.jsx(Xt,{...n,styles:e})}),es="textstyle-custom2-plugin";class Qt extends o.Plugin{constructor({styles:n=j.custom2,...t}={}){super(y.custom2,{label:"Custom 2",markupElement:new ts,...t}),this.styles={},this.styles=n}plugins(){return[ns(this.styles)]}}class ts extends o.MarkupElement{constructor(n=es,t=Yt){super(n,t)}}const Yt=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("p",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},ns=e=>i.createPluginFactory({key:y.custom2,isElement:!0,deserializeHtml:{rules:[{validClassName:y.custom2}]}})({component:n=>r.jsx(Yt,{...n,styles:e})}),rs="textstyle-custom3-plugin";class Jt extends o.Plugin{constructor({styles:n=j.custom3,...t}={}){super(o.TextStyles.custom3,{label:"Custom 3",markupElement:new ss,...t}),this.styles={},this.styles=n}plugins(){return[as(this.styles)]}}class ss extends o.MarkupElement{constructor(n=rs,t=Zt){super(n,t)}}const Zt=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("p",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},as=e=>i.createPluginFactory({key:o.TextStyles.custom3,isElement:!0,deserializeHtml:{rules:[{validClassName:o.TextStyles.custom3}]}})({component:n=>r.jsx(Zt,{...n,styles:e})}),os="textstyle-heading1-plugin";class en extends o.Plugin{constructor({styles:n=j.heading1,...t}={}){super(y.heading1,{label:"Heading 1",markupElement:new is,...t}),this.styles={},this.styles=n}plugins(){return[ls(this.styles)]}}class is extends o.MarkupElement{constructor(n=os,t=Se){super(n,t)}}const Se=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("h1",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},ls=e=>i.createPluginFactory({key:y.heading1,isElement:!0,component:Se,deserializeHtml:{rules:[{validNodeName:["h1","H1"]}]}})({component:n=>r.jsx(Se,{...n,styles:e})}),us="textstyle-heading2-plugin";class tn extends o.Plugin{constructor({styles:n=j.heading2,...t}={}){super(y.heading2,{label:"Heading 2",markupElement:new cs,...t}),this.styles={},this.styles=n}plugins(){return[ds(this.styles)]}}class cs extends o.MarkupElement{constructor(n=us,t=Pe){super(n,t)}}const Pe=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("h2",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},ds=e=>i.createPluginFactory({key:y.heading2,isElement:!0,component:Pe,deserializeHtml:{rules:[{validNodeName:["h2","H2"]}]}})({component:n=>r.jsx(Pe,{...n,styles:e})}),gs="textstyle-heading3-plugin";class nn extends o.Plugin{constructor({styles:n=j.heading3,...t}={}){super(y.heading3,{label:"Heading 3",markupElement:new ms,...t}),this.styles={},this.styles=n}plugins(){return[hs(this.styles)]}}class ms extends o.MarkupElement{constructor(n=gs,t=Ee){super(n,t)}}const Ee=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("h3",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},hs=e=>i.createPluginFactory({key:y.heading3,isElement:!0,component:Ee,deserializeHtml:{rules:[{validNodeName:["h3","H3"]}]}})({component:n=>r.jsx(Ee,{...n,styles:e})}),fs="textstyle-heading4-plugin";class rn extends o.Plugin{constructor({styles:n=j.heading4,...t}={}){super(y.heading4,{label:"Heading 4",markupElement:new xs,...t}),this.styles={},this.styles=n}plugins(){return[ws(this.styles)]}}class xs extends o.MarkupElement{constructor(n=fs,t=Te){super(n,t)}}const Te=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("h4",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},ws=e=>i.createPluginFactory({key:y.heading4,isElement:!0,component:Te,deserializeHtml:{rules:[{validNodeName:["h4","H4"]}]}})({component:n=>r.jsx(Te,{...n,styles:e})}),ps="textstyle-imageCaption-plugin";class sn extends o.Plugin{constructor({styles:n=j.imageCaption,...t}={}){super(y.imageCaption,{label:"Image Caption",markupElement:new ys,...t}),this.styles={},this.styles=n}plugins(){return[bs(this.styles)]}}class ys extends o.MarkupElement{constructor(n=ps,t=Ie){super(n,t)}}const Ie=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("p",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},bs=e=>i.createPluginFactory({key:y.imageCaption,isElement:!0,component:Ie,deserializeHtml:{rules:[{validClassName:y.imageCaption}]}})({component:n=>r.jsx(Ie,{...n,styles:e})}),vs="textstyle-imageTitle-plugin";class an extends o.Plugin{constructor({styles:n=j.imageTitle,...t}={}){super(y.imageTitle,{label:"Image Title",markupElement:new Cs,...t}),this.styles={},this.styles=n}plugins(){return[ks(this.styles)]}}class Cs extends o.MarkupElement{constructor(n=vs,t=Be){super(n,t)}}const Be=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("p",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},ks=e=>i.createPluginFactory({key:y.imageTitle,isElement:!0,component:Be,deserializeHtml:{rules:[{validClassName:y.imageTitle}]}})({component:n=>r.jsx(Be,{...n,styles:e})});class on extends o.Plugin{constructor({styles:n=j.p,...t}={}){super(y.p,{markupElement:new un,label:"Body Text",...t}),this.styles={},this.styles=n}plugins(){return[cn(this.styles)]}}const ln="tw-m-0 tw-px-0 tw-py-0",he=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align,l=o.merge([a&&o.alignmentClassnames[a],ln,o.getColumnBreakClasses(e)]);return r.jsx("p",{...n,className:l,style:s,children:t})};class un extends o.MarkupElement{constructor(n=y.p,t=he){super(n,t)}}const cn=e=>i.createPluginFactory({...i.createParagraphPlugin(),key:y.p,isElement:!0,component:he})({component:n=>r.jsx(he,{...n,styles:e})}),Ss="textstyle-quote-plugin";class dn extends o.Plugin{constructor({styles:n=j.quote,...t}={}){super(y.quote,{label:"Quote",markupElement:new Ps,...t}),this.styles={},this.styles=n}plugins(){return[gn(this.styles)]}}class Ps extends o.MarkupElement{constructor(n=Ss,t=fe){super(n,t)}}const fe=({element:e,attributes:n,children:t,styles:s})=>{const a=e.align;return r.jsx("blockquote",{...n,className:o.merge([a&&o.alignmentClassnames[a],o.getColumnBreakClasses(e)]),style:s,children:t})},gn=e=>i.createPluginFactory({key:y.quote,isElement:!0,component:fe,deserializeHtml:{rules:[{validNodeName:["blockquote","BLOCKQUOTE"]}]}})({component:n=>r.jsx(fe,{...n,styles:e})}),He=[new en,new tn,new nn,new rn,new Kt,new Qt,new Jt,new dn,new on],Z=[y.heading1,y.heading2,y.heading3,y.heading4,y.custom1,y.custom2,y.custom3,y.quote,y.p],Es=[...He,new sn,new an],Ts=[...Z,y.imageCaption,y.imageTitle],Is=e=>new o.PluginComposer().setPlugin(new o.SoftBreakPlugin,new o.TextStylePlugin({textStyles:He})).setPlugin([new o.BoldPlugin,new o.ItalicPlugin,new o.UnderlinePlugin,new o.StrikethroughPlugin,new Gt({appBridge:e}),new zt({appBridge:e}),new o.CodePlugin],[new o.AlignLeftPlugin({validTypes:Z}),new o.AlignCenterPlugin({validTypes:Z}),new o.AlignRightPlugin({validTypes:Z}),new o.AlignJustifyPlugin({validTypes:Z}),new o.UnorderedListPlugin,new o.CheckboxListPlugin,new o.OrderedListPlugin,new o.ResetFormattingPlugin,new o.AutoformatPlugin]),Bs="--f-theme-settings-",js=e=>{const n=e!=null&&e.id?`hasBackground${e.id}`:"hasBackground",t=e!=null&&e.id?`backgroundColor${e.id}`:"backgroundColor",s=e!=null&&e.preventDefaultColor?void 0:(e==null?void 0:e.defaultColor)||An,a=e!=null&&e.label?e.label:"Background",l=e!=null&&e.switchLabel?e.switchLabel:void 0;return{id:n,label:a,type:"switch",switchLabel:l,defaultValue:!!(e!=null&&e.defaultValue),on:[{id:t,defaultValue:s,type:"colorInput"}]}},Ns=e=>{const n=e!=null&&e.id?`hasBorder_${e.id}`:"hasBorder",t=e!=null&&e.id?`borderSelection_${e.id}`:"borderSelection",s=e!=null&&e.id?`borderStyle_${e.id}`:"borderStyle",a=e!=null&&e.id?`borderWidth_${e.id}`:"borderWidth",l=e!=null&&e.id?`borderColor_${e.id}`:"borderColor",u=(e==null?void 0:e.defaultColor)||st,d=e!=null&&e.switchLabel?e.switchLabel:void 0;return{id:n,label:"Border",type:"switch",switchLabel:d,defaultValue:!!(e!=null&&e.defaultValue),on:[{id:t,type:"multiInput",onChange:c=>m.appendUnit(c,a),layout:m.MultiInputLayout.Columns,lastItemFullWidth:!0,blocks:[{id:s,type:"dropdown",defaultValue:D.Solid,choices:[{value:D.Solid,label:D.Solid},{value:D.Dotted,label:D.Dotted},{value:D.Dashed,label:D.Dashed}]},{id:a,type:"input",defaultValue:Rn,rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)],placeholder:"e.g. 3px"},{id:l,type:"colorInput",defaultValue:u}]}],off:[]}},Ve=(e,n=H.None)=>({id:e,type:"segmentedControls",defaultValue:n,choices:[{value:H.None,label:"None"},{value:H.Small,label:"S"},{value:H.Medium,label:"M"},{value:H.Large,label:"L"}]}),Ls=e=>{const n=e!=null&&e.id?`hasRadius_${e.id}`:"hasRadius",t=e!=null&&e.id?`radiusValue_${e.id}`:"radiusValue",s=e!=null&&e.id?`radiusChoice_${e.id}`:"radiusChoice",a=(e==null?void 0:e.defaultRadius)||H.None;return{id:n,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:l=>{var u;return e!=null&&e.dependentSettingId?!!((u=l.getBlock(e.dependentSettingId))!=null&&u.value):!0},onChange:l=>m.presetCustomValue(l,s,t,(e==null?void 0:e.radiusStyleMap)||q),on:[{id:t,type:"input",placeholder:"e.g. 10px",rules:[m.numericalOrPixelRule],onChange:l=>m.appendUnit(l,t)}],off:[Ve(s,a)]}},As=e=>{const n=e!=null&&e.id?`hasExtendedCustomRadius_${e.id}`:"hasExtendedCustomRadius",t=e!=null&&e.id?`extendedRadiusValue_${e.id}`:"extendedRadiusValue",s=e!=null&&e.id?`extendedRadiusChoice_${e.id}`:"extendedRadiusChoice",a=e!=null&&e.id?`extendedRadiusTopLeft_${e.id}`:"extendedRadiusTopLeft",l=e!=null&&e.id?`extendedRadiusTopRight_${e.id}`:"extendedRadiusTopRight",u=e!=null&&e.id?`extendedRadiusBottomLeft_${e.id}`:"extendedRadiusBottomLeft",d=e!=null&&e.id?`extendedRadiusBottomRight_${e.id}`:"extendedRadiusBottomRight";return{id:n,label:"Corner radius",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"Determining how rounded the corners are.",show:c=>{var w;return e!=null&&e.dependentSettingId?!!((w=c.getBlock(e.dependentSettingId))!=null&&w.value):!0},onChange:c=>{m.presetCustomValue(c,s,a,q),m.presetCustomValue(c,s,l,q),m.presetCustomValue(c,s,u,q),m.presetCustomValue(c,s,d,q)},on:[{id:t,type:"multiInput",layout:m.MultiInputLayout.Columns,blocks:[{id:a,type:"input",label:"Top Left",rules:[m.numericalOrPixelRule],onChange:c=>m.appendUnit(c,a)},{id:l,type:"input",label:"Top Right",rules:[m.numericalOrPixelRule],onChange:c=>m.appendUnit(c,l)},{id:u,type:"input",label:"Bottom Left",rules:[m.numericalOrPixelRule],onChange:c=>m.appendUnit(c,u)},{id:d,type:"input",label:"Bottom Right",rules:[m.numericalOrPixelRule],onChange:c=>m.appendUnit(c,d)}]}],off:[Ve(s,e==null?void 0:e.defaultValue)]}},Rs=e=>{const n=e!=null&&e.id?e.id:"hasCustomSpacing",t=e!=null&&e.dependentSettingId?e.dependentSettingId:"columns",s=e!=null&&e.spacingChoiceId?e.spacingChoiceId:"spacingChoice",a=e!=null&&e.spacingCustomId?e.spacingCustomId:"spacingCustom",l=e!=null&&e.defaultValueChoices?e.defaultValueChoices:W.M;return{id:n,type:"switch",defaultValue:!1,switchLabel:"Custom",label:"Gutter",info:"An official nerds term for ‘gap’",onChange:u=>m.presetCustomValue(u,s,a,rt),show:u=>{var d;return((d=u.getBlock(t))==null?void 0:d.value)!=="1"},on:[{id:a,type:"input",rules:[m.numericalOrPixelRule],onChange:u=>m.appendUnit(u,a)}],off:[{id:s,type:"slider",defaultValue:l,choices:[{value:W.Auto,label:"Auto"},{value:W.S,label:"S"},{value:W.M,label:"M"},{value:W.L,label:"L"}]}]}},ze=e=>({id:e,type:"segmentedControls",defaultValue:$.None,choices:[{value:$.None,label:"None"},{value:$.Small,label:"S"},{value:$.Medium,label:"M"},{value:$.Large,label:"L"}]}),Fs=e=>{const n=e!=null&&e.id?`hasCustomMarginValue_${e==null?void 0:e.id}`:"hasCustomMarginValue",t=e!=null&&e.id?`marginValue_${e==null?void 0:e.id}`:"marginValue",s=e!=null&&e.id?`marginChoice_${e==null?void 0:e.id}`:"marginChoice";return{id:n,label:"Margin",type:"switch",switchLabel:"Custom",defaultValue:!1,info:"The spacing around UI elements to create more space",onChange:a=>m.presetCustomValue(a,s,t,(e==null?void 0:e.marginStyleMap)||J),on:[{id:t,type:"input",placeholder:ae,rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)],onChange:a=>m.appendUnit(a,t)}],off:[ze(s)]}},Ms=e=>{const n=e!=null&&e.id?`hasExtendedCustomMargin_${e==null?void 0:e.id}`:"hasExtendedCustomMargin",t=e!=null&&e.id?`extendedMarginValues_${e==null?void 0:e.id}`:"extendedMarginValues",s=e!=null&&e.id?`extendedMarginChoice_${e==null?void 0:e.id}`:"extendedMarginChoice",a=e!=null&&e.id?`extendedMarginTop_${e==null?void 0:e.id}`:"extendedMarginTop",l=e!=null&&e.id?`extendedMarginLeft_${e==null?void 0:e.id}`:"extendedMarginLeft",u=e!=null&&e.id?`extendedMarginRight_${e==null?void 0:e.id}`:"extendedMarginRight",d=e!=null&&e.id?`extendedMarginBottom_${e==null?void 0:e.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:c=>{m.presetCustomValue(c,s,a,J),m.presetCustomValue(c,s,l,J),m.presetCustomValue(c,s,u,J),m.presetCustomValue(c,s,d,J)},on:[{id:t,type:"multiInput",layout:m.MultiInputLayout.Spider,blocks:[{id:a,type:"input",label:"Top",placeholder:ae,onChange:c=>m.appendUnit(c,a),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:l,type:"input",label:"Left",placeholder:ae,onChange:c=>m.appendUnit(c,l),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:u,type:"input",label:"Right",placeholder:ae,onChange:c=>m.appendUnit(c,u),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:d,type:"input",label:"Bottom",placeholder:ae,onChange:c=>m.appendUnit(c,d),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[ze(s)]}},$e=e=>({id:e,type:"segmentedControls",defaultValue:z.Small,choices:[{value:z.None,label:"None"},{value:z.Small,label:"S"},{value:z.Medium,label:"M"},{value:z.Large,label:"L"}]}),Ds=e=>{const n=e!=null&&e.id?`hasCustomPaddingValue_${e==null?void 0:e.id}`:"hasCustomPaddingValue",t=e!=null&&e.id?`paddingValue_${e==null?void 0:e.id}`:"paddingValue",s=e!=null&&e.id?`paddingChoice_${e==null?void 0:e.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:a=>m.presetCustomValue(a,s,t,(e==null?void 0:e.paddingStyleMap)||Y),on:[{id:t,type:"input",placeholder:se,rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)],onChange:a=>m.appendUnit(a,t)}],off:[$e(s)]}},Os=e=>{const n=e!=null&&e.id?`hasExtendedCustomPadding_${e==null?void 0:e.id}`:"hasExtendedCustomPadding",t=e!=null&&e.id?`extendedPaddingValues_${e==null?void 0:e.id}`:"extendedPaddingValues",s=e!=null&&e.id?`extendedPaddingChoice_${e==null?void 0:e.id}`:"extendedPaddingChoice",a=e!=null&&e.id?`extendedPaddingTop_${e==null?void 0:e.id}`:"extendedPaddingTop",l=e!=null&&e.id?`extendedPaddingLeft_${e==null?void 0:e.id}`:"extendedPaddingLeft",u=e!=null&&e.id?`extendedPaddingRight_${e==null?void 0:e.id}`:"extendedPaddingRight",d=e!=null&&e.id?`extendedPaddingBottom_${e==null?void 0:e.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:c=>{m.presetCustomValue(c,s,a,Y),m.presetCustomValue(c,s,l,Y),m.presetCustomValue(c,s,u,Y),m.presetCustomValue(c,s,d,Y)},on:[{id:t,type:"multiInput",layout:m.MultiInputLayout.Spider,blocks:[{id:a,type:"input",label:"Top",placeholder:se,onChange:c=>m.appendUnit(c,a),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:l,type:"input",label:"Left",placeholder:se,onChange:c=>m.appendUnit(c,l),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:u,type:"input",label:"Right",placeholder:se,onChange:c=>m.appendUnit(c,u),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]},{id:d,type:"input",label:"Bottom",placeholder:se,onChange:c=>m.appendUnit(c,d),rules:[m.numericalOrPixelRule,m.maximumNumericalOrPixelOrAutoRule(500)]}]}],off:[$e(s)]}},Us=e=>{const n=We(e==null?void 0:e.globalControlId);return{id:e!=null&&e.id?e.id:"downloadable",type:"switch",defaultValue:!1,label:"Downloadable",show:t=>{var s;return((s=t.getBlock(n))==null?void 0:s.value)===K.Custom}}},We=e=>e||"security",_s=e=>[{id:We(e),type:"segmentedControls",defaultValue:K.Global,choices:[{value:K.Global,label:"Global Settings"},{value:K.Custom,label:"Custom"}]},{id:"globalSettingsInfo",type:"notification",footer:m.createFooter({label:"Change global settings [here].",replace:{here:{event:"general-settings.open"}}})}];var mn=(e=>(e.Main="main",e.Basics="basics",e.Layout="layout",e.Style="style",e.Security="security",e.Targets="targets",e))(mn||{});const Hs=e=>e,Vs=e=>e;exports.AllTextStylePlugins=Es;exports.AllTextStyles=Ts;exports.Attachments=ft;exports.AttachmentsProvider=gt;exports.AttachmentsToolbarButton=wt;exports.BUTTON_PLUGIN=Ht;exports.BlockButtonStyles=be;exports.BlockInjectButton=kn;exports.BlockItemWrapper=Gn;exports.BlockStyles=j;exports.BorderStyle=D;exports.ButtonPlugin=zt;exports.Custom1Plugin=Kt;exports.Custom2Plugin=Qt;exports.Custom3Plugin=Jt;exports.DEFAULT_ATTACHMENTS_BUTTON_ID=xt;exports.DEFAULT_DRAGGING_TOOLTIP=yt;exports.DEFAULT_DRAG_TOOLTIP=pt;exports.DEFAULT_MENU_BUTTON_ID=Re;exports.DownloadButton=Kn;exports.DragHandleToolbarButton=bt;exports.DragPreviewContextProvider=ot;exports.ELEMENT_BUTTON=k;exports.FlyoutToolbarButton=Ae;exports.GutterSpacing=W;exports.Heading1Plugin=en;exports.Heading2Plugin=tn;exports.Heading3Plugin=nn;exports.Heading4Plugin=rn;exports.ImageCaptionPlugin=sn;exports.ImageTitlePlugin=an;exports.LinkInput=Ut;exports.LinkPlugin=Gt;exports.LinkSelector=Ot;exports.Margin=$;exports.MenuToolbarButton=Ct;exports.MultiFlyoutContextProvider=lt;exports.PARAGRAPH_CLASSES=ln;exports.Padding=z;exports.ParagraphMarkupElement=un;exports.ParagraphMarkupElementNode=he;exports.ParagraphPlugin=on;exports.QuoteMarkupElementNode=fe;exports.QuotePlugin=dn;exports.Radius=H;exports.RichTextEditor=Mr;exports.Sections=mn;exports.Security=K;exports.THEME_PREFIX=Bs;exports.TextStylePluginsWithoutImage=He;exports.TextStyles=y;exports.TextStylesWithoutImage=Z;exports.Toolbar=kt;exports.ToolbarFlyoutMenu=vt;exports.addHttps=we;exports.borderStyleMap=nt;exports.convertToRteValue=Qn;exports.createButtonNode=Ft;exports.createButtonPlugin=Vt;exports.createLinkPlugin=qt;exports.createParagraphPlugin=cn;exports.createQuotePlugin=gn;exports.customCoordinatesGetterFactory=ht;exports.defineBlock=Hs;exports.defineSettings=Vs;exports.getBackgroundColorStyles=Ln;exports.getBackgroundSettings=js;exports.getBorderRadiusSettings=Ls;exports.getBorderRadiusSlider=Ve;exports.getBorderSettings=Ns;exports.getBorderStyles=Fn;exports.getDefaultPluginsWithLinkChooser=Is;exports.getExtendedBorderRadiusSettings=As;exports.getGutterSettings=Rs;exports.getLegacyUrl=Et;exports.getLinkFromEditor=Bt;exports.getMarginExtendedSettings=Ms;exports.getMarginSettings=Fs;exports.getMarginSlider=ze;exports.getPaddingExtendedSettings=Os;exports.getPaddingSettings=Ds;exports.getPaddingSlider=$e;exports.getRadiusStyles=Mn;exports.getReadableColor=jn;exports.getSecurityDownloadableSetting=Us;exports.getSecurityGlobalControlId=We;exports.getSecurityGlobalControlSetting=_s;exports.getUrl=Tt;exports.getUrlFromEditor=Rt;exports.getUrlFromLinkOrLegacyLink=It;exports.gutterSpacingStyleMap=rt;exports.hasRichTextValue=St;exports.insertButton=Nt;exports.isDark=Pn;exports.isDownloadable=Yn;exports.isValidUrl=pe;exports.isValidUrlOrEmpty=ee;exports.joinClassNames=O;exports.mapAppBridgeColorPaletteToFonduePalette=Pt;exports.mapAppBridgeColorPalettesToFonduePalettes=Jn;exports.marginStyleMap=J;exports.moveItemInArray=Nn;exports.paddingStyleMap=Y;exports.radiusStyleMap=q;exports.relativeUrlRegex=Me;exports.setAlpha=In;exports.submitFloatingButton=Oe;exports.toColorObject=Bn;exports.toHex8String=En;exports.toHexString=Tn;exports.toRgbaString=je;exports.toShortRgba=X;exports.triggerFloatingButton=Mt;exports.triggerFloatingButtonEdit=ye;exports.triggerFloatingButtonInsert=_e;exports.unwrapButton=ne;exports.upsertButton=Lt;exports.upsertButtonText=Ue;exports.useAttachments=ct;exports.useAttachmentsContext=mt;exports.useDndSensors=_n;exports.useDragPreviewContext=oe;exports.useMultiFlyoutContext=ut;exports.useMultiFlyoutState=xe;exports.withAttachmentsProvider=Dn;exports.withButton=jt;exports.wrapButton=At;Object.keys(m).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>m[e]})});
|
|
4
|
-
//# sourceMappingURL=index.cjs.js.map
|