@antscorp/antsomi-ui 1.3.7-beta.7 → 1.3.7-beta.71
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/README.md +70 -0
- package/es/components/atoms/Input/Input.js +3 -1
- package/es/components/atoms/InputDynamic/InputDynamic.js +3 -3
- package/es/components/atoms/Tag/Tag.js +1 -1
- package/es/components/icons/LazyIcon/LazyIcon.d.ts +2 -0
- package/es/components/icons/LazyIcon/LazyIcon.js +2 -0
- package/es/components/icons/QRCodeManagementIcon.d.ts +3 -0
- package/es/components/icons/QRCodeManagementIcon.js +7 -0
- package/es/components/icons/QRSetDashboardIcon.d.ts +3 -0
- package/es/components/icons/QRSetDashboardIcon.js +7 -0
- package/es/components/icons/index.d.ts +2 -0
- package/es/components/icons/index.js +2 -0
- package/es/components/molecules/AddDynamicContent/AddDynamicContent.js +28 -2
- package/es/components/molecules/AddDynamicContent/components/DisplayFormat/DisplayFormat.d.ts +1 -0
- package/es/components/molecules/AddDynamicContent/constants.d.ts +2 -0
- package/es/components/molecules/AddDynamicContent/constants.js +2 -0
- package/es/components/molecules/ColorPicker/index.d.ts +2 -0
- package/es/components/molecules/ColorPicker/index.js +8 -3
- package/es/components/molecules/EmojiPopover/EmojiPopover.d.ts +1 -0
- package/es/components/molecules/EmojiPopover/EmojiPopover.js +2 -2
- package/es/components/molecules/EmojiPopover/styled.d.ts +2 -2
- package/es/components/molecules/EmojiPopover/styled.js +1 -1
- package/es/components/molecules/EmptyData/EmptyData.d.ts +1 -1
- package/es/components/molecules/EmptyData/EmptyData.js +4 -2
- package/es/components/molecules/HeaderV2/HeaderV2.d.ts +1 -1
- package/es/components/molecules/InputSearch/index.d.ts +1 -1
- package/es/components/molecules/InputSearch/index.js +2 -1
- package/es/components/molecules/Modal/Modal.js +7 -1
- package/es/components/molecules/ModalV2/ModalV2.js +2 -1
- package/es/components/molecules/SearchPopover/SearchPopover.js +2 -2
- package/es/components/molecules/SearchPopover/styled.d.ts +12 -1
- package/es/components/molecules/SearchPopover/styled.js +1 -2
- package/es/components/molecules/SearchPopover/types.d.ts +4 -3
- package/es/components/molecules/Select/Select.js +3 -3
- package/es/components/molecules/Select/styled.d.ts +3 -1
- package/es/components/molecules/Select/styled.js +50 -6
- package/es/components/molecules/ShareAccess/ShareAccess.d.ts +2 -1
- package/es/components/molecules/ShareAccess/ShareAccess.js +12 -9
- package/es/components/molecules/ShareAccess/components/LayoutContent/LayoutContent.js +5 -5
- package/es/components/molecules/ShareAccess/components/PeopleAccess/PeopleAccess.js +2 -2
- package/es/components/molecules/ShareAccess/hooks/useShareAccess.d.ts +2 -1
- package/es/components/molecules/ShareAccess/index.d.ts +1 -0
- package/es/components/molecules/ShareAccess/reducer.d.ts +1 -1
- package/es/components/molecules/ShareAccess/reducer.js +7 -4
- package/es/components/molecules/ShareAccess/types.d.ts +22 -0
- package/es/components/molecules/ShareAccess/utils.d.ts +3 -1
- package/es/components/molecules/ShareAccess/utils.js +35 -2
- package/es/components/molecules/TagifyInput/TagifyInput.js +48 -27
- package/es/components/molecules/TagifyInput/types.d.ts +14 -8
- package/es/components/molecules/TagifyInput/utils.d.ts +6 -1
- package/es/components/molecules/TagifyInput/utils.js +19 -0
- package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +1 -0
- package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +3 -7
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +10 -10
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +46 -327
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.d.ts +9 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/index.js +5 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.d.ts +23 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useFocusManagement.js +81 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.d.ts +24 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useItemInteraction.js +32 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.d.ts +26 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useKeyboardNavigation.js +93 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.d.ts +24 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useTreeState.js +94 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.d.ts +7 -0
- package/es/components/molecules/VirtualizedMenu/components/MenuInline/hooks/useVisibleItems.js +132 -0
- package/es/components/molecules/VirtualizedMenu/styled.js +14 -3
- package/es/components/molecules/VirtualizedMenu/types.d.ts +1 -0
- package/es/components/molecules/VirtualizedMenu/utils.d.ts +1 -0
- package/es/components/molecules/VirtualizedMenu/utils.js +1 -0
- package/es/components/molecules/index.d.ts +1 -0
- package/es/components/organism/AccountSharing/AccountSharing.d.ts +1 -0
- package/es/components/organism/AccountSharing/AccountSharing.js +17 -33
- package/es/components/organism/AccountSharing/styled.js +1 -1
- package/es/components/organism/ActivityTimeline/ActivityTimeline.js +3 -3
- package/es/components/organism/ActivityTimeline/constants.d.ts +9 -9
- package/es/components/organism/ActivityTimeline/constants.js +3 -3
- package/es/components/organism/ActivityTimeline/index.d.ts +530 -1
- package/es/components/organism/ActivityTimeline/index.js +9 -1
- package/es/components/organism/ActivityTimeline/utils.js +186 -15
- package/es/components/organism/LeftMenu/LeftMenu.js +6 -6
- package/es/components/organism/LeftMenu/hooks/usePermission.js +1 -1
- package/es/components/organism/LeftMenu/styled.js +2 -0
- package/es/components/organism/LeftMenu/types/index.d.ts +7 -0
- package/es/components/organism/LeftMenu/utils/index.js +1 -1
- package/es/components/organism/Login/Login.js +19 -36
- package/es/components/organism/Login/components/IconInfo/IconInfo.js +1 -1
- package/es/components/organism/Login/components/LoginSelectPortal/LoginSelectPortal.js +1 -1
- package/es/components/organism/Login/components/SignIn/SignIn.js +2 -2
- package/es/components/organism/Login/types/index.d.ts +2 -0
- package/es/components/organism/LoginV2/LoginV2.d.ts +3 -0
- package/es/components/organism/LoginV2/LoginV2.js +957 -0
- package/es/components/organism/LoginV2/components/Avatar/Avatar.d.ts +8 -0
- package/es/components/organism/LoginV2/components/Avatar/Avatar.js +11 -0
- package/es/components/organism/LoginV2/components/Avatar/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/Avatar/index.js +1 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/ChooseMethod.d.ts +9 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/ChooseMethod.js +54 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/Method.d.ts +10 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/Method.js +13 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/index.js +1 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/styled.d.ts +10 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/styled.js +24 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/utils.d.ts +1 -0
- package/es/components/organism/LoginV2/components/ChooseMethod/utils.js +1 -0
- package/es/components/organism/LoginV2/components/ForgotPassword/ForgotPassword.d.ts +14 -0
- package/es/components/organism/LoginV2/components/ForgotPassword/ForgotPassword.js +195 -0
- package/es/components/organism/LoginV2/components/ForgotPassword/index.d.ts +2 -0
- package/es/components/organism/LoginV2/components/ForgotPassword/index.js +2 -0
- package/es/components/organism/LoginV2/components/ForgotPassword/styled.d.ts +1 -0
- package/es/components/organism/LoginV2/components/ForgotPassword/styled.js +10 -0
- package/es/components/organism/LoginV2/components/IconInfo/IconInfo.d.ts +7 -0
- package/es/components/organism/LoginV2/components/IconInfo/IconInfo.js +18 -0
- package/es/components/organism/LoginV2/components/IconInfo/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/IconInfo/index.js +1 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/Item.d.ts +10 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/Item.js +12 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/index.js +1 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/styled.d.ts +2 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/Item/styled.js +34 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/LoginSelectPortal.d.ts +19 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/LoginSelectPortal.js +194 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/index.js +1 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/styled.d.ts +1 -0
- package/es/components/organism/LoginV2/components/LoginSelectPortal/styled.js +5 -0
- package/es/components/organism/LoginV2/components/LoginWithEmail/LoginWithEmail.d.ts +15 -0
- package/es/components/organism/LoginV2/components/LoginWithEmail/LoginWithEmail.js +211 -0
- package/es/components/organism/LoginV2/components/LoginWithEmail/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/LoginWithEmail/index.js +1 -0
- package/es/components/organism/LoginV2/components/LoginWithEmail/styled.d.ts +3 -0
- package/es/components/organism/LoginV2/components/LoginWithEmail/styled.js +5 -0
- package/es/components/organism/LoginV2/components/LoginWithGG/LoginWithGG.d.ts +14 -0
- package/es/components/organism/LoginV2/components/LoginWithGG/LoginWithGG.js +116 -0
- package/es/components/organism/LoginV2/components/LoginWithGG/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/LoginWithGG/index.js +1 -0
- package/es/components/organism/LoginV2/components/LoginWithGG/styled.d.ts +3 -0
- package/es/components/organism/LoginV2/components/LoginWithGG/styled.js +5 -0
- package/es/components/organism/LoginV2/components/Logo/Logo.d.ts +6 -0
- package/es/components/organism/LoginV2/components/Logo/Logo.js +9 -0
- package/es/components/organism/LoginV2/components/Logo/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/Logo/index.js +1 -0
- package/es/components/organism/LoginV2/components/OryConsent/OryAuthLayout.d.ts +9 -0
- package/es/components/organism/LoginV2/components/OryConsent/OryAuthLayout.js +4 -0
- package/es/components/organism/LoginV2/components/OryConsent/OryConsent.d.ts +17 -0
- package/es/components/organism/LoginV2/components/OryConsent/OryConsent.js +204 -0
- package/es/components/organism/LoginV2/components/OryConsent/OryThemeProvider.d.ts +8 -0
- package/es/components/organism/LoginV2/components/OryConsent/OryThemeProvider.js +10 -0
- package/es/components/organism/LoginV2/components/OryConsent/PortalSelect.d.ts +15 -0
- package/es/components/organism/LoginV2/components/OryConsent/PortalSelect.js +30 -0
- package/es/components/organism/LoginV2/components/OryConsent/ScopeConsent.d.ts +20 -0
- package/es/components/organism/LoginV2/components/OryConsent/ScopeConsent.js +29 -0
- package/es/components/organism/LoginV2/components/OryConsent/index.d.ts +2 -0
- package/es/components/organism/LoginV2/components/OryConsent/index.js +2 -0
- package/es/components/organism/LoginV2/components/OryConsent/styled.d.ts +31 -0
- package/es/components/organism/LoginV2/components/OryConsent/styled.js +292 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryFormShell.d.ts +9 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryFormShell.js +36 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryMfa.d.ts +11 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryMfa.js +144 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryRecovery.d.ts +9 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryRecovery.js +128 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryStatus.d.ts +17 -0
- package/es/components/organism/LoginV2/components/OrySignIn/OryStatus.js +33 -0
- package/es/components/organism/LoginV2/components/OrySignIn/index.d.ts +3 -0
- package/es/components/organism/LoginV2/components/OrySignIn/index.js +3 -0
- package/es/components/organism/LoginV2/components/SetupGGAuthenticator/SetupGGAuthenticator.d.ts +14 -0
- package/es/components/organism/LoginV2/components/SetupGGAuthenticator/SetupGGAuthenticator.js +100 -0
- package/es/components/organism/LoginV2/components/SetupGGAuthenticator/index.d.ts +2 -0
- package/es/components/organism/LoginV2/components/SetupGGAuthenticator/index.js +2 -0
- package/es/components/organism/LoginV2/components/SetupGGAuthenticator/styled.d.ts +4 -0
- package/es/components/organism/LoginV2/components/SetupGGAuthenticator/styled.js +10 -0
- package/es/components/organism/LoginV2/components/SignIn/SignIn.d.ts +22 -0
- package/es/components/organism/LoginV2/components/SignIn/SignIn.js +107 -0
- package/es/components/organism/LoginV2/components/SignIn/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/SignIn/index.js +1 -0
- package/es/components/organism/LoginV2/components/SignIn/styled.d.ts +3 -0
- package/es/components/organism/LoginV2/components/SignIn/styled.js +10 -0
- package/es/components/organism/LoginV2/components/VerifyAccount/VerifyAccount.d.ts +25 -0
- package/es/components/organism/LoginV2/components/VerifyAccount/VerifyAccount.js +42 -0
- package/es/components/organism/LoginV2/components/VerifyAccount/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/VerifyAccount/index.js +1 -0
- package/es/components/organism/LoginV2/components/VerifyAccount/styled.d.ts +22 -0
- package/es/components/organism/LoginV2/components/VerifyAccount/styled.js +17 -0
- package/es/components/organism/LoginV2/components/WidgetLayout/WidgetLayout.d.ts +13 -0
- package/es/components/organism/LoginV2/components/WidgetLayout/WidgetLayout.js +18 -0
- package/es/components/organism/LoginV2/components/WidgetLayout/index.d.ts +1 -0
- package/es/components/organism/LoginV2/components/WidgetLayout/index.js +1 -0
- package/es/components/organism/LoginV2/components/WidgetLayout/styled.d.ts +5 -0
- package/es/components/organism/LoginV2/components/WidgetLayout/styled.js +22 -0
- package/es/components/organism/LoginV2/components/index.d.ts +11 -0
- package/es/components/organism/LoginV2/components/index.js +11 -0
- package/es/components/organism/LoginV2/constants/index.d.ts +48 -0
- package/es/components/organism/LoginV2/constants/index.js +48 -0
- package/es/components/organism/LoginV2/hooks/index.d.ts +1 -0
- package/es/components/organism/LoginV2/hooks/index.js +1 -0
- package/es/components/organism/LoginV2/hooks/useResize.d.ts +7 -0
- package/es/components/organism/LoginV2/hooks/useResize.js +21 -0
- package/es/components/organism/LoginV2/index.d.ts +6 -0
- package/es/components/organism/LoginV2/index.js +4 -0
- package/es/components/organism/LoginV2/styled.d.ts +51 -0
- package/es/components/organism/LoginV2/styled.js +129 -0
- package/es/components/organism/LoginV2/types/index.d.ts +79 -0
- package/es/components/organism/LoginV2/types/index.js +1 -0
- package/es/components/organism/LoginV2/types/ory.d.ts +52 -0
- package/es/components/organism/LoginV2/types/ory.js +1 -0
- package/es/components/organism/LoginV2/utils/index.d.ts +14 -0
- package/es/components/organism/LoginV2/utils/index.js +49 -0
- package/es/components/organism/LoginV2/utils/ory.d.ts +138 -0
- package/es/components/organism/LoginV2/utils/ory.js +408 -0
- package/es/components/organism/LoginV2/utils/oryConsent.d.ts +52 -0
- package/es/components/organism/LoginV2/utils/oryConsent.js +174 -0
- package/es/components/organism/LoginV2/utils/oryFlows.d.ts +100 -0
- package/es/components/organism/LoginV2/utils/oryFlows.js +319 -0
- package/es/components/organism/TextEditor/TextEditor.d.ts +9 -2
- package/es/components/organism/TextEditor/TextEditor.js +203 -42
- package/es/components/organism/TextEditor/constants.d.ts +9 -0
- package/es/components/organism/TextEditor/constants.js +66 -0
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +6 -128
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +7 -292
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +1 -1
- package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +4 -0
- package/es/components/organism/TextEditor/extensions/Link.js +33 -14
- package/es/components/organism/TextEditor/extensions/ListItem.d.ts +10 -0
- package/es/components/organism/TextEditor/extensions/ListItem.js +93 -0
- package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +5 -6
- package/es/components/organism/TextEditor/extensions/SmartTag.js +96 -4
- package/es/components/organism/TextEditor/hooks/useColorSet.js +7 -0
- package/es/components/organism/TextEditor/hooks/useMarkTracking.js +2 -1
- package/es/components/organism/TextEditor/index.d.ts +7 -5
- package/es/components/organism/TextEditor/index.scss +4 -7
- package/es/components/organism/TextEditor/provider.d.ts +1 -0
- package/es/components/organism/TextEditor/provider.js +6 -3
- package/es/components/organism/TextEditor/store.d.ts +11 -4
- package/es/components/organism/TextEditor/store.js +22 -2
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/froala-legacy-format.settings.json +95 -0
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.d.ts +111 -0
- package/es/components/organism/TextEditor/stories/WithOldDynAndLink/shared.js +82 -0
- package/es/components/organism/TextEditor/stories/shared.d.ts +64 -0
- package/es/components/organism/TextEditor/stories/shared.js +57 -0
- package/es/components/organism/TextEditor/styled.d.ts +1 -1
- package/es/components/organism/TextEditor/styled.js +1 -0
- package/es/components/organism/TextEditor/types.d.ts +161 -11
- package/es/components/organism/TextEditor/types.js +1 -0
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +2 -1
- package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +80 -51
- package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +1 -1
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +1 -1
- package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +2 -2
- package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +12 -2
- package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.d.ts +16 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/LinkInsertForm.js +61 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/LinkInsertForm/index.js +1 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.d.ts +9 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/LinkPopover.js +126 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/index.d.ts +2 -0
- package/es/components/organism/TextEditor/ui/LinkPopover/index.js +1 -0
- package/es/components/organism/TextEditor/ui/Popover/Popover.js +1 -1
- package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +1 -3
- package/es/components/organism/TextEditor/ui/Toolbar/{Toolbar.d.ts → FormattingToolbar.d.ts} +3 -4
- package/es/components/organism/TextEditor/ui/Toolbar/FormattingToolbar.js +90 -0
- package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.d.ts +10 -0
- package/es/components/organism/TextEditor/ui/Toolbar/LinkPreviewToolbar.js +39 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +4 -3
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +1 -0
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +2 -2
- package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +6 -1
- package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +2 -1
- package/es/components/organism/TextEditor/ui/Toolbar/index.js +2 -1
- package/es/components/organism/TextEditor/utils/documentState.d.ts +14 -0
- package/es/components/organism/TextEditor/utils/documentState.js +25 -0
- package/es/components/organism/TextEditor/utils/htmlProcessing.js +60 -0
- package/es/components/organism/TextEditor/utils/link.d.ts +10 -1
- package/es/components/organism/TextEditor/utils/link.js +161 -7
- package/es/components/organism/TextEditor/utils/menu.js +2 -1
- package/es/components/organism/TextEditor/utils/selection.js +3 -2
- package/es/components/organism/TextEditor/utils/smartTag.js +2 -1
- package/es/components/organism/index.d.ts +3 -1
- package/es/components/organism/index.js +1 -0
- package/es/components/template/TemplateListing/Loadable.d.ts +1 -0
- package/es/hooks/index.d.ts +1 -1
- package/es/hooks/index.js +1 -1
- package/es/providers/ConfigProvider/ConfigProvider.d.ts +4 -0
- package/es/providers/ConfigProvider/ConfigProvider.js +2 -3
- package/es/providers/ConfigProvider/GlobalStyle.d.ts +2 -2
- package/es/providers/ConfigProvider/GlobalStyle.js +67 -64
- package/es/services/MediaTemplateDesign/UploadFile/index.js +4 -4
- package/es/utils/common.d.ts +1 -1
- package/es/utils/common.js +3 -3
- package/es/utils/cookie.js +2 -1
- package/es/utils/crossSubdomainCookieOptions.d.ts +14 -0
- package/es/utils/crossSubdomainCookieOptions.js +12 -0
- package/package.json +26 -30
- package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.d.ts +0 -1
- package/es/components/organism/TextEditor/ui/BubbleToolbar/BubbleToolbar.js +0 -1
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.d.ts +0 -0
- package/es/components/organism/TextEditor/ui/BubbleToolbar/index.js +0 -1
- package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +0 -39
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import styled, { css } from 'styled-components';
|
|
2
|
+
import { globalToken } from '@antscorp/antsomi-ui/es/constants';
|
|
3
|
+
const primary = globalToken?.colorPrimary || '#005eb8';
|
|
4
|
+
const border = '#e2e8f0';
|
|
5
|
+
const borderBlue = '#bdd0e0';
|
|
6
|
+
const muted = '#64748b';
|
|
7
|
+
const tint = '#f5fbff';
|
|
8
|
+
export const Page = styled.div `
|
|
9
|
+
display: flex;
|
|
10
|
+
height: 100vh;
|
|
11
|
+
overflow: hidden;
|
|
12
|
+
background: #eaf1fb;
|
|
13
|
+
|
|
14
|
+
@media (max-width: 768px) {
|
|
15
|
+
height: auto;
|
|
16
|
+
min-height: 100vh;
|
|
17
|
+
overflow: visible;
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
export const Panel = styled.main `
|
|
21
|
+
position: relative;
|
|
22
|
+
z-index: 2;
|
|
23
|
+
display: flex;
|
|
24
|
+
flex: none;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: center;
|
|
27
|
+
width: 404px;
|
|
28
|
+
height: 100%;
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
background: #fff;
|
|
31
|
+
box-shadow: 3px 0 9px rgba(15, 23, 42, 0.15);
|
|
32
|
+
|
|
33
|
+
@media (max-width: 768px) {
|
|
34
|
+
width: 100%;
|
|
35
|
+
height: auto;
|
|
36
|
+
min-height: 100vh;
|
|
37
|
+
overflow: visible;
|
|
38
|
+
box-shadow: none;
|
|
39
|
+
}
|
|
40
|
+
`;
|
|
41
|
+
export const Banner = styled.div `
|
|
42
|
+
display: flex;
|
|
43
|
+
flex: 1;
|
|
44
|
+
align-items: flex-end;
|
|
45
|
+
justify-content: flex-end;
|
|
46
|
+
padding: 16px 20px;
|
|
47
|
+
color: ${muted};
|
|
48
|
+
font-size: 11px;
|
|
49
|
+
line-height: 14px;
|
|
50
|
+
|
|
51
|
+
@media (max-width: 768px) {
|
|
52
|
+
display: none;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
export const Body = styled.div `
|
|
56
|
+
display: flex;
|
|
57
|
+
flex: 1 0 auto;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
gap: 24px;
|
|
60
|
+
width: 100%;
|
|
61
|
+
padding: 72px 24px 24px;
|
|
62
|
+
|
|
63
|
+
@media (max-width: 768px) {
|
|
64
|
+
padding: 72px 16px 24px;
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
67
|
+
export const AuthHeader = styled.header `
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
align-items: center;
|
|
71
|
+
gap: 20px;
|
|
72
|
+
text-align: center;
|
|
73
|
+
|
|
74
|
+
h1,
|
|
75
|
+
p {
|
|
76
|
+
margin: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
h1 {
|
|
80
|
+
font-size: 18px;
|
|
81
|
+
line-height: 24px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
p {
|
|
85
|
+
color: #767676;
|
|
86
|
+
font-size: 14px;
|
|
87
|
+
line-height: 20px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
p b {
|
|
91
|
+
color: #000;
|
|
92
|
+
font-weight: 500;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
small {
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
line-height: 18px;
|
|
98
|
+
}
|
|
99
|
+
`;
|
|
100
|
+
export const HeaderLogo = styled.img `
|
|
101
|
+
width: 180px;
|
|
102
|
+
height: 40px;
|
|
103
|
+
object-fit: contain;
|
|
104
|
+
`;
|
|
105
|
+
export const Footer = styled.footer `
|
|
106
|
+
position: sticky;
|
|
107
|
+
bottom: 0;
|
|
108
|
+
z-index: 3;
|
|
109
|
+
display: flex;
|
|
110
|
+
flex: none;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
gap: 8px;
|
|
113
|
+
width: 100%;
|
|
114
|
+
padding: 16px 24px;
|
|
115
|
+
background: #fff;
|
|
116
|
+
border-top: 1px solid #eaf1fb;
|
|
117
|
+
box-shadow: 0 -8px 14px -10px rgba(15, 23, 42, 0.14);
|
|
118
|
+
|
|
119
|
+
@media (max-width: 768px) {
|
|
120
|
+
padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
|
|
121
|
+
}
|
|
122
|
+
`;
|
|
123
|
+
export const SearchBox = styled.div `
|
|
124
|
+
> div {
|
|
125
|
+
align-items: center;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
input {
|
|
129
|
+
height: 36px;
|
|
130
|
+
padding-right: 38px;
|
|
131
|
+
border: 1px solid ${borderBlue};
|
|
132
|
+
border-radius: 0;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.__icon-search {
|
|
136
|
+
position: absolute;
|
|
137
|
+
top: 50%;
|
|
138
|
+
right: 11px;
|
|
139
|
+
height: auto;
|
|
140
|
+
padding: 0;
|
|
141
|
+
background: transparent !important;
|
|
142
|
+
border: 0 !important;
|
|
143
|
+
transform: translateY(-50%);
|
|
144
|
+
pointer-events: none;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
@media (max-width: 768px) {
|
|
148
|
+
input {
|
|
149
|
+
height: 44px;
|
|
150
|
+
font-size: 16px;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
`;
|
|
154
|
+
export const List = styled.div `
|
|
155
|
+
display: flex;
|
|
156
|
+
flex-direction: column;
|
|
157
|
+
gap: 10px;
|
|
158
|
+
`;
|
|
159
|
+
export const PortalGrid = styled.div `
|
|
160
|
+
display: grid;
|
|
161
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
162
|
+
gap: 12px;
|
|
163
|
+
`;
|
|
164
|
+
export const PortalOption = styled.div `
|
|
165
|
+
position: relative;
|
|
166
|
+
display: flex;
|
|
167
|
+
flex-direction: column;
|
|
168
|
+
gap: 10px;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
padding: 12px;
|
|
171
|
+
background: #fff;
|
|
172
|
+
border: 1px solid ${borderBlue};
|
|
173
|
+
border-radius: 10px;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
transition:
|
|
176
|
+
border-color 0.15s ease,
|
|
177
|
+
background 0.15s ease;
|
|
178
|
+
|
|
179
|
+
&:hover {
|
|
180
|
+
background: ${tint};
|
|
181
|
+
border-color: ${primary};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&:focus-visible {
|
|
185
|
+
border-color: ${primary};
|
|
186
|
+
outline: 2px solid ${primary};
|
|
187
|
+
outline-offset: 2px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
${p => p.$selected &&
|
|
191
|
+
css `
|
|
192
|
+
background: ${tint};
|
|
193
|
+
border-color: ${primary};
|
|
194
|
+
box-shadow: 0 0 0 1px ${primary};
|
|
195
|
+
`}
|
|
196
|
+
`;
|
|
197
|
+
export const PortalLogo = styled.span `
|
|
198
|
+
display: grid;
|
|
199
|
+
place-items: center;
|
|
200
|
+
height: 56px;
|
|
201
|
+
color: ${muted};
|
|
202
|
+
|
|
203
|
+
img {
|
|
204
|
+
max-width: 100%;
|
|
205
|
+
max-height: 100%;
|
|
206
|
+
object-fit: contain;
|
|
207
|
+
}
|
|
208
|
+
`;
|
|
209
|
+
export const PortalName = styled.span `
|
|
210
|
+
padding-top: 10px;
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
color: ${p => (p.$selected ? '#000' : '#767676')};
|
|
213
|
+
font-size: 14px;
|
|
214
|
+
line-height: 20px;
|
|
215
|
+
text-align: center;
|
|
216
|
+
text-overflow: ellipsis;
|
|
217
|
+
white-space: nowrap;
|
|
218
|
+
border-top: 1px solid #eaf1fb;
|
|
219
|
+
`;
|
|
220
|
+
export const Indicator = styled.span `
|
|
221
|
+
position: absolute;
|
|
222
|
+
top: 8px;
|
|
223
|
+
right: 8px;
|
|
224
|
+
display: ${p => (p.$selected ? 'grid' : 'none')};
|
|
225
|
+
place-items: center;
|
|
226
|
+
width: 20px;
|
|
227
|
+
height: 20px;
|
|
228
|
+
color: #fff;
|
|
229
|
+
background: ${primary};
|
|
230
|
+
border-radius: 50%;
|
|
231
|
+
`;
|
|
232
|
+
export const SummaryCard = styled.section `
|
|
233
|
+
overflow: hidden;
|
|
234
|
+
background: #fff;
|
|
235
|
+
border: 1px solid ${borderBlue};
|
|
236
|
+
border-radius: 10px;
|
|
237
|
+
`;
|
|
238
|
+
export const SummaryRow = styled.div `
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: 12px;
|
|
242
|
+
padding: 12px 14px;
|
|
243
|
+
|
|
244
|
+
& + & {
|
|
245
|
+
border-top: 1px solid #eaf1fb;
|
|
246
|
+
}
|
|
247
|
+
`;
|
|
248
|
+
export const SectionHeader = styled.div `
|
|
249
|
+
display: flex;
|
|
250
|
+
align-items: baseline;
|
|
251
|
+
justify-content: space-between;
|
|
252
|
+
gap: 8px;
|
|
253
|
+
`;
|
|
254
|
+
export const ScopeGroups = styled.div `
|
|
255
|
+
display: flex;
|
|
256
|
+
flex-direction: column;
|
|
257
|
+
gap: 20px;
|
|
258
|
+
`;
|
|
259
|
+
export const ScopeGroup = styled.div `
|
|
260
|
+
display: flex;
|
|
261
|
+
flex-direction: column;
|
|
262
|
+
gap: 10px;
|
|
263
|
+
`;
|
|
264
|
+
export const Caption = styled.span `
|
|
265
|
+
color: ${muted};
|
|
266
|
+
font-size: 12px;
|
|
267
|
+
font-weight: 500;
|
|
268
|
+
line-height: 16px;
|
|
269
|
+
`;
|
|
270
|
+
export const ScopeCard = styled.div `
|
|
271
|
+
padding: 12px 14px;
|
|
272
|
+
background: ${p => (p.$locked ? '#f4f6f8' : '#fff')};
|
|
273
|
+
border: 1px solid ${p => (p.$locked ? border : borderBlue)};
|
|
274
|
+
border-radius: 10px;
|
|
275
|
+
`;
|
|
276
|
+
export const Mono = styled.code `
|
|
277
|
+
align-self: flex-start;
|
|
278
|
+
padding: 1px 6px;
|
|
279
|
+
color: #475569;
|
|
280
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
281
|
+
font-size: 12px;
|
|
282
|
+
line-height: 18px;
|
|
283
|
+
background: #f1f5f9;
|
|
284
|
+
border-radius: 6px;
|
|
285
|
+
`;
|
|
286
|
+
export const Truncate = styled.span `
|
|
287
|
+
display: block;
|
|
288
|
+
min-width: 0;
|
|
289
|
+
overflow: hidden;
|
|
290
|
+
text-overflow: ellipsis;
|
|
291
|
+
white-space: nowrap;
|
|
292
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type OryFormShellProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
/** Same column and logo as the sign-in form, for the steps that follow or replace it. */
|
|
8
|
+
export declare const OryFormShell: React.FC<OryFormShellProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
import { Flex } from '../../../../atoms/Flex';
|
|
4
|
+
import { Text } from '../../../../atoms/Text';
|
|
5
|
+
import logoAntsomi from '../../../../../assets/images/logo/antsomi_logo.png';
|
|
6
|
+
const Shell = styled.div `
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
gap: 32px;
|
|
10
|
+
width: 100%;
|
|
11
|
+
padding: 100px 50px;
|
|
12
|
+
|
|
13
|
+
@media (max-width: 768px) {
|
|
14
|
+
padding: 100px 30px;
|
|
15
|
+
}
|
|
16
|
+
`;
|
|
17
|
+
const Logo = styled.img `
|
|
18
|
+
width: 180px;
|
|
19
|
+
height: 40px;
|
|
20
|
+
object-fit: contain;
|
|
21
|
+
`;
|
|
22
|
+
const Fields = styled.div `
|
|
23
|
+
input {
|
|
24
|
+
height: 36px;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media (max-width: 768px) {
|
|
29
|
+
input {
|
|
30
|
+
height: 44px;
|
|
31
|
+
font-size: 16px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
35
|
+
/** Same column and logo as the sign-in form, for the steps that follow or replace it. */
|
|
36
|
+
export const OryFormShell = ({ title, description, children }) => (_jsxs(Shell, { children: [_jsxs(Flex, { vertical: true, align: "center", gap: 20, children: [_jsx(Logo, { src: logoAntsomi, alt: "Antsomi" }), _jsxs(Flex, { vertical: true, align: "center", gap: 8, style: { textAlign: 'center' }, children: [_jsx(Text, { bold: true, size: 18, children: title }), description ? _jsx(Text, { type: "secondary", children: description }) : null] })] }), _jsx(Fields, { children: children })] }));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type OryMfaProps = {
|
|
3
|
+
kratosLoginUrl?: string;
|
|
4
|
+
sessionUrl?: string;
|
|
5
|
+
/** Called once the second factor is verified; usually continues the OAuth flow. */
|
|
6
|
+
onVerified: () => void | Promise<void>;
|
|
7
|
+
onBack: () => void;
|
|
8
|
+
};
|
|
9
|
+
/** Second step of sign-in for accounts with two-step verification. */
|
|
10
|
+
export declare const OryMfa: React.FC<OryMfaProps>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Form, Input } from 'antd';
|
|
4
|
+
import { Alert } from '../../../../atoms/Alert';
|
|
5
|
+
import { Button } from '../../../../atoms/Button';
|
|
6
|
+
import { Flex } from '../../../../atoms/Flex';
|
|
7
|
+
import { prepareOryMfa, sendOryEmailMfa, submitOryMfa, submitOryWebauthn, } from '../../utils/oryFlows';
|
|
8
|
+
import { maskEmail } from '../ChooseMethod/utils';
|
|
9
|
+
import { OryFormShell } from './OryFormShell';
|
|
10
|
+
const COPY = {
|
|
11
|
+
totp: {
|
|
12
|
+
description: 'Enter the 6-digit code from your authenticator app.',
|
|
13
|
+
placeholder: '6-digit code',
|
|
14
|
+
rule: /^\d{6}$/,
|
|
15
|
+
hint: 'Enter the 6-digit code',
|
|
16
|
+
},
|
|
17
|
+
lookup_secret: {
|
|
18
|
+
description: 'Enter one of your backup codes. Each code works once.',
|
|
19
|
+
placeholder: 'Backup code',
|
|
20
|
+
rule: /^\S{6,}$/,
|
|
21
|
+
hint: 'Enter a backup code',
|
|
22
|
+
},
|
|
23
|
+
code: {
|
|
24
|
+
description: 'Enter the 6-digit code sent to your login email.',
|
|
25
|
+
placeholder: '6-digit code',
|
|
26
|
+
rule: /^\d{6}$/,
|
|
27
|
+
hint: 'Enter the 6-digit code',
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
const METHOD_LABEL = {
|
|
31
|
+
totp: 'Use your authenticator app',
|
|
32
|
+
lookup_secret: 'Use a backup code',
|
|
33
|
+
code: 'Send a code to your email',
|
|
34
|
+
webauthn: 'Use a security key or device',
|
|
35
|
+
};
|
|
36
|
+
/** Second step of sign-in for accounts with two-step verification. */
|
|
37
|
+
export const OryMfa = ({ kratosLoginUrl, sessionUrl, onVerified, onBack, }) => {
|
|
38
|
+
const [form] = Form.useForm();
|
|
39
|
+
const [method, setMethod] = useState();
|
|
40
|
+
const [preparation, setPreparation] = useState();
|
|
41
|
+
const [loading, setLoading] = useState(true);
|
|
42
|
+
const [error, setError] = useState('');
|
|
43
|
+
const copy = method && method !== 'webauthn' ? COPY[method] : COPY.totp;
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
let active = true;
|
|
46
|
+
prepareOryMfa({ location: window.location, kratosLoginUrl })
|
|
47
|
+
.then(result => {
|
|
48
|
+
if (!active)
|
|
49
|
+
return;
|
|
50
|
+
setPreparation(result);
|
|
51
|
+
setMethod(result.methods.includes('totp') ? 'totp' : result.methods[0]);
|
|
52
|
+
})
|
|
53
|
+
.catch(cause => {
|
|
54
|
+
if (active) {
|
|
55
|
+
setError(cause?.userMessage ||
|
|
56
|
+
'Verification could not be started. Please sign in again.');
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
.finally(() => {
|
|
60
|
+
if (active)
|
|
61
|
+
setLoading(false);
|
|
62
|
+
});
|
|
63
|
+
return () => {
|
|
64
|
+
active = false;
|
|
65
|
+
};
|
|
66
|
+
}, [kratosLoginUrl]);
|
|
67
|
+
const switchMethod = async (next) => {
|
|
68
|
+
if (!preparation || next === method)
|
|
69
|
+
return;
|
|
70
|
+
setLoading(true);
|
|
71
|
+
setError('');
|
|
72
|
+
form.resetFields();
|
|
73
|
+
try {
|
|
74
|
+
if (next === 'code' && !preparation.emailSent) {
|
|
75
|
+
await sendOryEmailMfa({
|
|
76
|
+
location: window.location,
|
|
77
|
+
flowId: preparation.flowId,
|
|
78
|
+
kratosLoginUrl,
|
|
79
|
+
});
|
|
80
|
+
setPreparation(current => (current ? { ...current, emailSent: true } : current));
|
|
81
|
+
}
|
|
82
|
+
setMethod(next);
|
|
83
|
+
}
|
|
84
|
+
catch (cause) {
|
|
85
|
+
setError(cause?.userMessage ||
|
|
86
|
+
'We could not send a verification code. Please try again.');
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
setLoading(false);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
const onFinish = async ({ code }) => {
|
|
93
|
+
if (!method || method === 'webauthn' || !preparation)
|
|
94
|
+
return;
|
|
95
|
+
setLoading(true);
|
|
96
|
+
setError('');
|
|
97
|
+
try {
|
|
98
|
+
await submitOryMfa({
|
|
99
|
+
location: window.location,
|
|
100
|
+
method,
|
|
101
|
+
code,
|
|
102
|
+
flowId: preparation.flowId,
|
|
103
|
+
kratosLoginUrl,
|
|
104
|
+
sessionUrl,
|
|
105
|
+
});
|
|
106
|
+
await onVerified();
|
|
107
|
+
}
|
|
108
|
+
catch (cause) {
|
|
109
|
+
setError(cause?.userMessage ||
|
|
110
|
+
'Verification failed. Please try again.');
|
|
111
|
+
setLoading(false);
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const verifyWebauthn = async () => {
|
|
115
|
+
if (!preparation)
|
|
116
|
+
return;
|
|
117
|
+
setLoading(true);
|
|
118
|
+
setError('');
|
|
119
|
+
try {
|
|
120
|
+
await submitOryWebauthn({
|
|
121
|
+
location: window.location,
|
|
122
|
+
flowId: preparation.flowId,
|
|
123
|
+
kratosLoginUrl,
|
|
124
|
+
sessionUrl,
|
|
125
|
+
});
|
|
126
|
+
await onVerified();
|
|
127
|
+
}
|
|
128
|
+
catch (cause) {
|
|
129
|
+
setError(cause?.userMessage ||
|
|
130
|
+
'Security key verification failed. Please try again.');
|
|
131
|
+
setLoading(false);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return (_jsx(OryFormShell, { title: "Two-step verification", description: method === 'webauthn'
|
|
135
|
+
? 'Use your registered security key or this device to verify your identity.'
|
|
136
|
+
: method === 'code' && preparation?.email
|
|
137
|
+
? `Enter the 6-digit code sent to ${maskEmail(preparation.email)}`
|
|
138
|
+
: copy.description, children: _jsxs(Form, { form: form, name: "ory_mfa_form", onFinish: onFinish, validateTrigger: "onSubmit", children: [method !== 'webauthn' ? _jsx(Form.Item, { name: "code", rules: [
|
|
139
|
+
{ required: true, message: copy.hint },
|
|
140
|
+
{ pattern: copy.rule, message: copy.hint },
|
|
141
|
+
], children: _jsx(Input, { autoFocus: true, autoComplete: "one-time-code", inputMode: method === 'lookup_secret' ? 'text' : 'numeric', placeholder: copy.placeholder, disabled: !method || loading }) }) : null, error ? _jsx(Alert, { type: "error", showIcon: true, role: "alert", message: error }) : null, _jsxs(Flex, { vertical: true, gap: 8, style: { marginTop: 24 }, children: [_jsx(Button, { type: "primary", size: "large", htmlType: method === 'webauthn' ? 'button' : 'submit', onClick: method === 'webauthn' ? verifyWebauthn : undefined, block: true, loading: loading, children: method === 'webauthn' ? 'Verify with security key' : 'Verify' }), preparation?.methods
|
|
142
|
+
.filter(available => available !== method)
|
|
143
|
+
.map(available => (_jsx(Button, { type: "text", onClick: () => switchMethod(available), disabled: loading, children: METHOD_LABEL[available] }, available))), _jsx(Button, { type: "text", onClick: onBack, disabled: loading, children: "Back to sign in" })] })] }) }));
|
|
144
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type OryRecoveryProps = {
|
|
3
|
+
kratosRecoveryUrl?: string;
|
|
4
|
+
initialFlowId?: string;
|
|
5
|
+
onBack: () => void;
|
|
6
|
+
};
|
|
7
|
+
/** Forgot-password flow: email a code, verify it, set a new password. */
|
|
8
|
+
export declare const OryRecovery: React.FC<OryRecoveryProps>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Form, Input } from 'antd';
|
|
4
|
+
import { Alert } from '../../../../atoms/Alert';
|
|
5
|
+
import { Button } from '../../../../atoms/Button';
|
|
6
|
+
import { Flex } from '../../../../atoms/Flex';
|
|
7
|
+
import { isOryRecoveryRequest, resumeOryRecovery, setOryRecoveredPassword, startOryRecovery, verifyOryRecoveryCode, } from '../../utils/oryFlows';
|
|
8
|
+
import { OryFormShell } from './OryFormShell';
|
|
9
|
+
const EMAIL_PATTERN = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
10
|
+
const TITLES = {
|
|
11
|
+
email: 'Reset your password',
|
|
12
|
+
code: 'Check your email',
|
|
13
|
+
password: 'Choose a new password',
|
|
14
|
+
done: 'Password updated',
|
|
15
|
+
};
|
|
16
|
+
/** Forgot-password flow: email a code, verify it, set a new password. */
|
|
17
|
+
export const OryRecovery = ({ kratosRecoveryUrl, initialFlowId, onBack }) => {
|
|
18
|
+
const [step, setStep] = useState('email');
|
|
19
|
+
const [email, setEmail] = useState('');
|
|
20
|
+
const [flowId, setFlowId] = useState('');
|
|
21
|
+
const [settingsFlowId, setSettingsFlowId] = useState('');
|
|
22
|
+
const [loading, setLoading] = useState(Boolean(initialFlowId));
|
|
23
|
+
const [error, setError] = useState('');
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!initialFlowId)
|
|
26
|
+
return;
|
|
27
|
+
let active = true;
|
|
28
|
+
setLoading(true);
|
|
29
|
+
resumeOryRecovery({ location: window.location, flowId: initialFlowId, recoveryUrl: kratosRecoveryUrl })
|
|
30
|
+
.then(result => {
|
|
31
|
+
if (!active)
|
|
32
|
+
return;
|
|
33
|
+
setFlowId(result.flowId);
|
|
34
|
+
setStep(result.step);
|
|
35
|
+
})
|
|
36
|
+
.catch(cause => {
|
|
37
|
+
if (active)
|
|
38
|
+
setError(cause?.userMessage || 'Recovery is unavailable. Please start again.');
|
|
39
|
+
})
|
|
40
|
+
.finally(() => { if (active)
|
|
41
|
+
setLoading(false); });
|
|
42
|
+
return () => { active = false; };
|
|
43
|
+
}, [initialFlowId, kratosRecoveryUrl]);
|
|
44
|
+
const restart = () => {
|
|
45
|
+
setError('');
|
|
46
|
+
setFlowId('');
|
|
47
|
+
setSettingsFlowId('');
|
|
48
|
+
setEmail('');
|
|
49
|
+
setStep('email');
|
|
50
|
+
if (isOryRecoveryRequest(window.location)) {
|
|
51
|
+
const url = new URL(window.location.href);
|
|
52
|
+
url.searchParams.delete('flow');
|
|
53
|
+
window.history.replaceState(null, '', url.toString());
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const run = async (action) => {
|
|
57
|
+
setLoading(true);
|
|
58
|
+
setError('');
|
|
59
|
+
try {
|
|
60
|
+
await action();
|
|
61
|
+
}
|
|
62
|
+
catch (cause) {
|
|
63
|
+
setError(cause?.userMessage ||
|
|
64
|
+
'Something went wrong. Please try again.');
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
setLoading(false);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
const sendCode = ({ email: value }) => run(async () => {
|
|
71
|
+
const result = await startOryRecovery({
|
|
72
|
+
location: window.location,
|
|
73
|
+
email: value,
|
|
74
|
+
recoveryUrl: kratosRecoveryUrl,
|
|
75
|
+
});
|
|
76
|
+
setEmail(value);
|
|
77
|
+
if (isOryRecoveryRequest(window.location)) {
|
|
78
|
+
const url = new URL(window.location.href);
|
|
79
|
+
url.searchParams.set('flow', result.flowId);
|
|
80
|
+
window.history.replaceState(null, '', url.toString());
|
|
81
|
+
}
|
|
82
|
+
setFlowId(result.flowId);
|
|
83
|
+
setStep('code');
|
|
84
|
+
});
|
|
85
|
+
const verifyCode = ({ code }) => run(async () => {
|
|
86
|
+
const result = await verifyOryRecoveryCode({
|
|
87
|
+
location: window.location,
|
|
88
|
+
flowId,
|
|
89
|
+
code,
|
|
90
|
+
recoveryUrl: kratosRecoveryUrl,
|
|
91
|
+
});
|
|
92
|
+
setSettingsFlowId(result.settingsFlowId);
|
|
93
|
+
setStep('password');
|
|
94
|
+
});
|
|
95
|
+
const savePassword = ({ password }) => run(async () => {
|
|
96
|
+
await setOryRecoveredPassword({
|
|
97
|
+
location: window.location,
|
|
98
|
+
settingsFlowId,
|
|
99
|
+
password,
|
|
100
|
+
recoveryUrl: kratosRecoveryUrl,
|
|
101
|
+
});
|
|
102
|
+
setStep('done');
|
|
103
|
+
});
|
|
104
|
+
const errorAlert = error ? _jsx(Alert, { type: "error", showIcon: true, role: "alert", message: error }) : null;
|
|
105
|
+
const description = {
|
|
106
|
+
email: "Enter your email and we'll send you a verification code.",
|
|
107
|
+
code: email ? `If an account exists for ${email}, we sent a code to it. Enter it below.` : 'Enter the code from your recovery email.',
|
|
108
|
+
password: 'Use at least 8 characters that you do not use anywhere else.',
|
|
109
|
+
done: 'You can now sign in with your new password.',
|
|
110
|
+
}[step];
|
|
111
|
+
return (_jsxs(OryFormShell, { title: TITLES[step], description: description, children: [step === 'email' ? (_jsxs(Form, { name: "ory_recovery_email", onFinish: sendCode, validateTrigger: "onSubmit", children: [_jsx(Form.Item, { name: "email", rules: [
|
|
112
|
+
{ required: true, message: 'Please enter your email' },
|
|
113
|
+
{ pattern: EMAIL_PATTERN, message: 'Please enter a valid email' },
|
|
114
|
+
], children: _jsx(Input, { autoFocus: true, autoComplete: "username", placeholder: "Email" }) }), errorAlert, _jsxs(Flex, { vertical: true, gap: 8, style: { marginTop: 24 }, children: [_jsx(Button, { type: "primary", size: "large", htmlType: "submit", block: true, loading: loading, children: "Send code" }), error ? _jsx(Button, { type: "text", onClick: restart, disabled: loading, children: "Start again" }) : null, _jsx(Button, { type: "text", onClick: onBack, disabled: loading, children: "Back to sign in" })] })] }, "email")) : null, step === 'code' ? (_jsxs(Form, { name: "ory_recovery_code", onFinish: verifyCode, validateTrigger: "onSubmit", children: [_jsx(Form.Item, { name: "code", rules: [
|
|
115
|
+
{ required: true, message: 'Enter the 6-digit code' },
|
|
116
|
+
{ pattern: /^\d{6}$/, message: 'Enter the 6-digit code' },
|
|
117
|
+
], children: _jsx(Input, { autoFocus: true, autoComplete: "one-time-code", inputMode: "numeric", placeholder: "6-digit code" }) }), errorAlert, _jsxs(Flex, { vertical: true, gap: 8, style: { marginTop: 24 }, children: [_jsx(Button, { type: "primary", size: "large", htmlType: "submit", block: true, loading: loading, children: "Verify code" }), _jsx(Button, { type: "text", disabled: loading, onClick: restart, children: "Start again" })] })] }, "code")) : null, step === 'password' ? (_jsxs(Form, { name: "ory_recovery_password", onFinish: savePassword, validateTrigger: "onSubmit", children: [_jsx(Form.Item, { name: "password", rules: [
|
|
118
|
+
{ required: true, message: 'Please enter a new password' },
|
|
119
|
+
{ min: 8, message: 'Password must be at least 8 characters long' },
|
|
120
|
+
], children: _jsx(Input.Password, { autoFocus: true, autoComplete: "new-password", placeholder: "New password" }) }), _jsx(Form.Item, { name: "confirm", dependencies: ['password'], rules: [
|
|
121
|
+
{ required: true, message: 'Please confirm your password' },
|
|
122
|
+
({ getFieldValue }) => ({
|
|
123
|
+
validator: (_, value) => !value || getFieldValue('password') === value
|
|
124
|
+
? Promise.resolve()
|
|
125
|
+
: Promise.reject(new Error('Passwords do not match')),
|
|
126
|
+
}),
|
|
127
|
+
], children: _jsx(Input.Password, { autoComplete: "new-password", placeholder: "Confirm password" }) }), errorAlert, _jsxs(Flex, { vertical: true, gap: 8, style: { marginTop: 24 }, children: [_jsx(Button, { type: "text", onClick: restart, disabled: loading, children: "Start again" }), _jsx(Button, { type: "primary", size: "large", htmlType: "submit", block: true, loading: loading, children: "Update password" })] })] }, "password")) : null, step === 'done' ? (_jsxs(Flex, { vertical: true, gap: 16, children: [_jsx(Alert, { type: "success", showIcon: true, message: "Your password was changed." }), _jsx(Button, { type: "primary", size: "large", block: true, onClick: onBack, children: "Back to sign in" })] })) : null] }));
|
|
128
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type OryStatusError = {
|
|
3
|
+
title: string;
|
|
4
|
+
message: string;
|
|
5
|
+
/** `info` for an outcome the user chose (declined), `warning` for a failure. */
|
|
6
|
+
tone?: 'info' | 'warning';
|
|
7
|
+
retryLabel?: string;
|
|
8
|
+
};
|
|
9
|
+
type OryStatusProps = {
|
|
10
|
+
error?: OryStatusError | null;
|
|
11
|
+
onRetry: () => void;
|
|
12
|
+
};
|
|
13
|
+
/** What to tell the user for an Ory flow failure code. */
|
|
14
|
+
export declare const describeOryFailure: (code: string) => OryStatusError;
|
|
15
|
+
/** Shown while the browser is handed between Kratos, Hydra and the client, or when that fails. */
|
|
16
|
+
export declare const OryStatus: React.FC<OryStatusProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from '../../../../atoms/Button';
|
|
3
|
+
import { Flex } from '../../../../atoms/Flex';
|
|
4
|
+
import { Spin } from '../../../../atoms/Spin';
|
|
5
|
+
import { Text } from '../../../../atoms/Text';
|
|
6
|
+
import { Result } from '../../../../molecules/Result';
|
|
7
|
+
/** What to tell the user for an Ory flow failure code. */
|
|
8
|
+
export const describeOryFailure = (code) => {
|
|
9
|
+
switch (code) {
|
|
10
|
+
case 'ORY_AUTHORIZATION_DENIED':
|
|
11
|
+
return {
|
|
12
|
+
tone: 'info',
|
|
13
|
+
title: 'Access denied',
|
|
14
|
+
message: 'The request was declined, so no access was granted to the application.',
|
|
15
|
+
retryLabel: 'Start over',
|
|
16
|
+
};
|
|
17
|
+
case 'ORY_STATE_MISSING':
|
|
18
|
+
case 'ORY_STATE_MISMATCH':
|
|
19
|
+
case 'ORY_STATE_INVALID':
|
|
20
|
+
return {
|
|
21
|
+
title: 'This sign-in link is no longer valid',
|
|
22
|
+
message: 'It may have expired or been opened in a different browser. Please start again.',
|
|
23
|
+
retryLabel: 'Start over',
|
|
24
|
+
};
|
|
25
|
+
default:
|
|
26
|
+
return {
|
|
27
|
+
title: "We couldn't sign you in",
|
|
28
|
+
message: 'Unable to continue with secure sign-in. Please try again.',
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/** Shown while the browser is handed between Kratos, Hydra and the client, or when that fails. */
|
|
33
|
+
export const OryStatus = ({ error, onRetry }) => error ? (_jsx("div", { role: "alert", children: _jsx(Result, { status: error.tone || 'warning', title: error.title, subTitle: error.message, extra: _jsx(Button, { type: "primary", onClick: onRetry, children: error.retryLabel || 'Try again' }) }) })) : (_jsxs(Flex, { vertical: true, align: "center", gap: 12, role: "status", "aria-live": "polite", children: [_jsx(Spin, {}), _jsx(Text, { type: "secondary", children: "Redirecting to secure sign-in\u2026" })] }));
|