@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,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OryConsentPreview, OryScopeCatalog } from '../../types/ory';
|
|
3
|
+
type OryConsentProps = {
|
|
4
|
+
consentUrl: string;
|
|
5
|
+
csrfUrl?: string;
|
|
6
|
+
sessionUrl?: string;
|
|
7
|
+
/** Endpoint that declines the request; defaults to `<consentUrl>/reject`. */
|
|
8
|
+
rejectUrl?: string;
|
|
9
|
+
scopeCatalog?: OryScopeCatalog;
|
|
10
|
+
/** Render fixture data instead of calling the IAM API. */
|
|
11
|
+
preview?: OryConsentPreview;
|
|
12
|
+
onCancel?: () => void;
|
|
13
|
+
/** End the browser session so another account can sign in. */
|
|
14
|
+
onSwitchAccount?: () => Promise<unknown> | void;
|
|
15
|
+
};
|
|
16
|
+
export declare const OryConsent: React.FC<OryConsentProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
3
|
+
import { Button } from '../../../../atoms/Button';
|
|
4
|
+
import { Flex } from '../../../../atoms/Flex';
|
|
5
|
+
import { Spin } from '../../../../atoms/Spin';
|
|
6
|
+
import { Text } from '../../../../atoms/Text';
|
|
7
|
+
import { Result } from '../../../../molecules/Result';
|
|
8
|
+
import { buildOryConsentGrant, declineOryConsent, getInitialOryPortalId, getInitialSelectedScopes, getOryAccount, getOryPortals, requiresOryPortal, shouldPromptForOryPortal, } from '../../utils/oryConsent';
|
|
9
|
+
import { OryAuthLayout } from './OryAuthLayout';
|
|
10
|
+
import { PortalSelect } from './PortalSelect';
|
|
11
|
+
import { ScopeConsent } from './ScopeConsent';
|
|
12
|
+
const JSON_HEADERS = { Accept: 'application/json' };
|
|
13
|
+
const readJSON = async (response) => {
|
|
14
|
+
try {
|
|
15
|
+
return await response.json();
|
|
16
|
+
}
|
|
17
|
+
catch (error) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const errorText = (cause, fallback) => cause?.userMessage ||
|
|
22
|
+
(cause instanceof Error && cause.message) ||
|
|
23
|
+
fallback;
|
|
24
|
+
export const OryConsent = ({ consentUrl, csrfUrl = '/api/csrf', sessionUrl = '/api/session', rejectUrl, scopeCatalog, preview, onCancel, onSwitchAccount, }) => {
|
|
25
|
+
const [loading, setLoading] = useState(true);
|
|
26
|
+
const [loadError, setLoadError] = useState('');
|
|
27
|
+
const [request, setRequest] = useState(null);
|
|
28
|
+
const [portals, setPortals] = useState([]);
|
|
29
|
+
const [account, setAccount] = useState({});
|
|
30
|
+
const [step, setStep] = useState('scopes');
|
|
31
|
+
const [portalId, setPortalId] = useState('');
|
|
32
|
+
const [selected, setSelected] = useState([]);
|
|
33
|
+
const [remember, setRemember] = useState(false);
|
|
34
|
+
const [saving, setSaving] = useState(false);
|
|
35
|
+
const [switching, setSwitching] = useState(false);
|
|
36
|
+
const [declining, setDeclining] = useState(false);
|
|
37
|
+
const [submitError, setSubmitError] = useState('');
|
|
38
|
+
const challenge = useMemo(() => new URLSearchParams(window.location.search).get('consent_challenge') || '', []);
|
|
39
|
+
const catalog = useMemo(() => scopeCatalog || {}, [scopeCatalog]);
|
|
40
|
+
const canChoosePortal = shouldPromptForOryPortal(portals);
|
|
41
|
+
const portal = portals.find(item => item.id === portalId);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const hydrate = (nextRequest, nextPortals, nextAccount, portalsLoaded) => {
|
|
44
|
+
const needs = requiresOryPortal(nextRequest);
|
|
45
|
+
const preferred = new URLSearchParams(window.location.search).get('portal_id');
|
|
46
|
+
setRequest(nextRequest);
|
|
47
|
+
setPortals(nextPortals);
|
|
48
|
+
setAccount(nextAccount);
|
|
49
|
+
setSelected(getInitialSelectedScopes(nextRequest));
|
|
50
|
+
setPortalId(getInitialOryPortalId(nextPortals, preferred));
|
|
51
|
+
setStep(shouldPromptForOryPortal(nextPortals, preferred) ? 'portal' : 'scopes');
|
|
52
|
+
if (needs && nextPortals.length === 0) {
|
|
53
|
+
setLoadError(portalsLoaded
|
|
54
|
+
? 'Your account does not have a portal that can authorize this application.'
|
|
55
|
+
: 'Unable to load your portals. Please try again.');
|
|
56
|
+
}
|
|
57
|
+
setLoading(false);
|
|
58
|
+
};
|
|
59
|
+
if (preview) {
|
|
60
|
+
hydrate(preview.request, preview.portals, preview.account, true);
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
const controller = new AbortController();
|
|
64
|
+
if (!challenge) {
|
|
65
|
+
setLoadError('Consent challenge is required');
|
|
66
|
+
setLoading(false);
|
|
67
|
+
return () => controller.abort();
|
|
68
|
+
}
|
|
69
|
+
const consent = new URL(consentUrl, window.location.origin);
|
|
70
|
+
consent.searchParams.set('consent_challenge', challenge);
|
|
71
|
+
const get = (url) => fetch(url, { credentials: 'include', headers: JSON_HEADERS, signal: controller.signal });
|
|
72
|
+
Promise.all([
|
|
73
|
+
get(consent.toString()),
|
|
74
|
+
// The session is optional context: without it only portal choice is lost.
|
|
75
|
+
get(sessionUrl).catch(cause => {
|
|
76
|
+
if (cause?.name === 'AbortError')
|
|
77
|
+
throw cause;
|
|
78
|
+
return null;
|
|
79
|
+
}),
|
|
80
|
+
])
|
|
81
|
+
.then(async ([consentResponse, sessionResponse]) => {
|
|
82
|
+
const consentPayload = await readJSON(consentResponse);
|
|
83
|
+
if (!consentResponse.ok || !consentPayload?.data) {
|
|
84
|
+
throw new Error('Unable to load the authorization request');
|
|
85
|
+
}
|
|
86
|
+
const sessionPayload = sessionResponse?.ok ? await readJSON(sessionResponse) : null;
|
|
87
|
+
hydrate(consentPayload.data, getOryPortals(sessionPayload), getOryAccount(sessionPayload, consentPayload.data.subject), Boolean(sessionPayload));
|
|
88
|
+
})
|
|
89
|
+
.catch(cause => {
|
|
90
|
+
if (cause?.name === 'AbortError')
|
|
91
|
+
return;
|
|
92
|
+
setLoadError('Unable to load the authorization request');
|
|
93
|
+
setLoading(false);
|
|
94
|
+
});
|
|
95
|
+
return () => controller.abort();
|
|
96
|
+
}, [challenge, consentUrl, sessionUrl, preview]);
|
|
97
|
+
const leave = () => {
|
|
98
|
+
if (onCancel)
|
|
99
|
+
onCancel();
|
|
100
|
+
window.history.replaceState({}, document.title, window.location.pathname);
|
|
101
|
+
};
|
|
102
|
+
// Declining tells Hydra, which sends the user back to the application with
|
|
103
|
+
// access_denied. If that call fails the user can still leave the page.
|
|
104
|
+
const close = async () => {
|
|
105
|
+
if (preview || !challenge) {
|
|
106
|
+
leave();
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
setDeclining(true);
|
|
110
|
+
try {
|
|
111
|
+
const { redirectTo } = await declineOryConsent({
|
|
112
|
+
location: window.location,
|
|
113
|
+
rejectUrl: rejectUrl || `${consentUrl.replace(/\/$/, '')}/reject`,
|
|
114
|
+
csrfUrl,
|
|
115
|
+
challenge,
|
|
116
|
+
});
|
|
117
|
+
window.location.assign(redirectTo);
|
|
118
|
+
}
|
|
119
|
+
catch (cause) {
|
|
120
|
+
leave();
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const switchAccount = async () => {
|
|
124
|
+
if (!onSwitchAccount)
|
|
125
|
+
return;
|
|
126
|
+
setSwitching(true);
|
|
127
|
+
setSubmitError('');
|
|
128
|
+
try {
|
|
129
|
+
await onSwitchAccount();
|
|
130
|
+
}
|
|
131
|
+
catch (cause) {
|
|
132
|
+
setSubmitError(errorText(cause, 'Unable to sign out. Please try again.'));
|
|
133
|
+
setSwitching(false);
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
const toggleScope = (scope, granted) => setSelected(current => granted
|
|
137
|
+
? [...current.filter(item => item !== scope), scope]
|
|
138
|
+
: current.filter(item => item !== scope));
|
|
139
|
+
const authorize = async () => {
|
|
140
|
+
if (!request)
|
|
141
|
+
return;
|
|
142
|
+
const grant = buildOryConsentGrant({
|
|
143
|
+
request,
|
|
144
|
+
selected,
|
|
145
|
+
portalId: portal?.id || '',
|
|
146
|
+
remember,
|
|
147
|
+
catalog,
|
|
148
|
+
});
|
|
149
|
+
setSaving(true);
|
|
150
|
+
setSubmitError('');
|
|
151
|
+
if (preview) {
|
|
152
|
+
preview.onAuthorize?.(grant);
|
|
153
|
+
window.setTimeout(() => setSaving(false), 600);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
const csrfResponse = await fetch(csrfUrl, { credentials: 'include', headers: JSON_HEADERS });
|
|
158
|
+
const csrfPayload = await readJSON(csrfResponse);
|
|
159
|
+
const csrfToken = csrfPayload?.token || csrfPayload?.data?.token;
|
|
160
|
+
if (!csrfResponse.ok || !csrfToken)
|
|
161
|
+
throw new Error('CSRF token is unavailable');
|
|
162
|
+
// The chosen portal travels in the body only; a portal_id in the query
|
|
163
|
+
// string would have to match it exactly.
|
|
164
|
+
const url = new URL(consentUrl, window.location.origin);
|
|
165
|
+
url.searchParams.set('consent_challenge', challenge);
|
|
166
|
+
const response = await fetch(url.toString(), {
|
|
167
|
+
method: 'POST',
|
|
168
|
+
credentials: 'include',
|
|
169
|
+
redirect: 'manual',
|
|
170
|
+
headers: { ...JSON_HEADERS, 'Content-Type': 'application/json', 'X-CSRF-Token': csrfToken },
|
|
171
|
+
body: JSON.stringify(grant),
|
|
172
|
+
});
|
|
173
|
+
if (response.status >= 300 && response.status < 400) {
|
|
174
|
+
const location = response.headers.get('Location');
|
|
175
|
+
if (!location)
|
|
176
|
+
throw new Error('Authorization did not provide a redirect');
|
|
177
|
+
window.location.assign(location);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
const payload = await readJSON(response);
|
|
181
|
+
const redirectTo = payload?.data?.redirectTo || payload?.redirectTo;
|
|
182
|
+
if (!response.ok || !redirectTo)
|
|
183
|
+
throw new Error('Authorization request was rejected');
|
|
184
|
+
window.location.assign(new URL(redirectTo, window.location.origin).toString());
|
|
185
|
+
}
|
|
186
|
+
catch (cause) {
|
|
187
|
+
setSubmitError(errorText(cause, 'Unable to authorize application'));
|
|
188
|
+
setSaving(false);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
if (loading) {
|
|
192
|
+
return (_jsx(OryAuthLayout, { title: "Authorize application", children: _jsxs(Flex, { vertical: true, align: "center", gap: 12, style: { padding: '48px 0' }, role: "status", children: [_jsx(Spin, {}), _jsx(Text, { type: "secondary", children: "Loading authorization request\u2026" })] }) }));
|
|
193
|
+
}
|
|
194
|
+
if (loadError || !request) {
|
|
195
|
+
return (_jsx(OryAuthLayout, { title: "Authorize application", children: _jsx(Result, { status: "warning", title: "We couldn't continue", subTitle: loadError || 'Unable to load the authorization request', extra: [
|
|
196
|
+
_jsx(Button, { type: "primary", onClick: () => window.location.reload(), children: "Try again" }, "retry"),
|
|
197
|
+
_jsx(Button, { onClick: close, children: "Cancel & Return" }, "cancel"),
|
|
198
|
+
] }) }));
|
|
199
|
+
}
|
|
200
|
+
if (step === 'portal' && canChoosePortal) {
|
|
201
|
+
return (_jsx(PortalSelect, { account: account, clientName: request.client?.client_name || request.client?.client_id, portals: portals, selectedId: portalId, onSelect: setPortalId, onContinue: () => setStep('scopes'), onSwitchAccount: onSwitchAccount ? switchAccount : undefined, switching: switching, error: submitError }));
|
|
202
|
+
}
|
|
203
|
+
return (_jsx(ScopeConsent, { request: request, account: account, catalog: catalog, portal: portal, selected: selected, remember: remember, saving: saving, declining: declining, error: submitError, onToggle: toggleScope, onRememberChange: setRemember, onAuthorize: authorize, onCancel: close, onSwitchPortal: canChoosePortal ? () => setStep('portal') : undefined }));
|
|
204
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Antsomi theme and class prefix for the Ory screens. It is the antd part of
|
|
4
|
+
* the full antsomi ConfigProvider, without its global styles and app services,
|
|
5
|
+
* so the screens look the same in a host that has not mounted that provider.
|
|
6
|
+
* Inside a host that has, it is a no-op.
|
|
7
|
+
*/
|
|
8
|
+
export declare const OryThemeProvider: React.FC<React.PropsWithChildren>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ConfigProvider } from 'antd';
|
|
3
|
+
import { ANTSOMI_COMPONENT_PREFIX_CLS, THEME } from '@antscorp/antsomi-ui/es/constants';
|
|
4
|
+
/**
|
|
5
|
+
* Antsomi theme and class prefix for the Ory screens. It is the antd part of
|
|
6
|
+
* the full antsomi ConfigProvider, without its global styles and app services,
|
|
7
|
+
* so the screens look the same in a host that has not mounted that provider.
|
|
8
|
+
* Inside a host that has, it is a no-op.
|
|
9
|
+
*/
|
|
10
|
+
export const OryThemeProvider = ({ children }) => (_jsx(ConfigProvider, { theme: THEME, prefixCls: ANTSOMI_COMPONENT_PREFIX_CLS, children: children }));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OryAccount, OryPortal } from '../../types/ory';
|
|
3
|
+
type PortalSelectProps = {
|
|
4
|
+
account: OryAccount;
|
|
5
|
+
clientName?: string;
|
|
6
|
+
portals: OryPortal[];
|
|
7
|
+
selectedId: string;
|
|
8
|
+
onSelect: (portalId: string) => void;
|
|
9
|
+
onContinue: () => void;
|
|
10
|
+
onSwitchAccount?: () => void;
|
|
11
|
+
switching?: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const PortalSelect: React.FC<PortalSelectProps>;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
3
|
+
import { Alert } from '../../../../atoms/Alert';
|
|
4
|
+
import { Button } from '../../../../atoms/Button';
|
|
5
|
+
import { Flex } from '../../../../atoms/Flex';
|
|
6
|
+
import { Icon } from '../../../../atoms/Icon';
|
|
7
|
+
import { EmptyData } from '../../../../molecules/EmptyData';
|
|
8
|
+
import { InputSearch } from '../../../../molecules/InputSearch';
|
|
9
|
+
import { CheckSlimIcon } from '../../../../icons/CheckSlimIcon';
|
|
10
|
+
import { ExitLogOutIcon } from '../../../../icons/ExitLogOutIcon';
|
|
11
|
+
import { SearchNotFoundIcon } from '../../../../icons/SearchNotFoundIcon';
|
|
12
|
+
import { StoreIcon } from '../../../../icons/StoreIcon';
|
|
13
|
+
import { filterOryPortals, getOryAccountLabel } from '../../utils/oryConsent';
|
|
14
|
+
import { OryAuthLayout } from './OryAuthLayout';
|
|
15
|
+
import { Indicator, PortalGrid, PortalLogo, PortalName, PortalOption, SearchBox, } from './styled';
|
|
16
|
+
export const PortalSelect = ({ account, clientName, portals, selectedId, onSelect, onContinue, onSwitchAccount, switching = false, error, }) => {
|
|
17
|
+
const [query, setQuery] = useState('');
|
|
18
|
+
const visible = useMemo(() => filterOryPortals(portals, { query }), [portals, query]);
|
|
19
|
+
const selected = portals.find(portal => portal.id === selectedId);
|
|
20
|
+
const footer = (_jsxs(_Fragment, { children: [error ? _jsx(Alert, { type: "error", showIcon: true, role: "alert", message: error }) : null, _jsx(Button, { type: "primary", size: "large", block: true, disabled: !selected, onClick: onContinue, children: _jsxs(Flex, { align: "center", justify: "center", gap: 8, children: [selected ? `Continue with ${selected.name}` : 'Select a portal to continue', _jsx(Icon, { type: "icon-ants-arrow-forward", size: 16 })] }) }), onSwitchAccount ? (_jsx(Button, { type: "text", loading: switching, onClick: onSwitchAccount, icon: _jsx(ExitLogOutIcon, { size: 16 }), children: "Sign in with a different account" })) : null] }));
|
|
21
|
+
return (_jsxs(OryAuthLayout, { title: "Select Portal", description: _jsxs(_Fragment, { children: ["Choose a portal to authorize ", _jsx("b", { children: clientName || 'the requested app' }), ".", _jsx("br", {}), _jsxs("small", { children: ["Signed in as ", _jsx("b", { children: getOryAccountLabel(account) })] })] }), footer: footer, children: [_jsx(SearchBox, { children: _jsx(InputSearch, { value: query, placeholder: "Search portals", "aria-label": "Search portals", onChange: event => setQuery(event.target.value) }) }), visible.length === 0 ? (_jsx(EmptyData, { icon: _jsx(SearchNotFoundIcon, {}), title: "No portal found", subTitle: "Check the spelling or try another name" })) : (_jsx(PortalGrid, { role: "radiogroup", "aria-label": "Available portals", children: visible.map(portal => {
|
|
22
|
+
const isSelected = portal.id === selectedId;
|
|
23
|
+
return (_jsxs(PortalOption, { "$selected": isSelected, role: "radio", "aria-checked": isSelected, tabIndex: 0, onClick: () => onSelect(portal.id), onKeyDown: event => {
|
|
24
|
+
if (event.key === 'Enter' || event.key === ' ') {
|
|
25
|
+
event.preventDefault();
|
|
26
|
+
onSelect(portal.id);
|
|
27
|
+
}
|
|
28
|
+
}, children: [_jsx(Indicator, { "$selected": isSelected, "aria-hidden": "true", children: _jsx(CheckSlimIcon, { size: 12 }) }), _jsx(PortalLogo, { children: portal.logo ? (_jsx("img", { src: portal.logo, alt: "" })) : (_jsx(StoreIcon, { size: 28, fill: "currentColor" })) }), _jsx(PortalName, { "$selected": isSelected, children: portal.name })] }, portal.id));
|
|
29
|
+
}) }))] }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { OryAccount, OryConsentRequest, OryPortal, OryScopeCatalog } from '../../types/ory';
|
|
3
|
+
type ScopeConsentProps = {
|
|
4
|
+
request: OryConsentRequest;
|
|
5
|
+
account: OryAccount;
|
|
6
|
+
catalog: OryScopeCatalog;
|
|
7
|
+
portal?: OryPortal;
|
|
8
|
+
selected: string[];
|
|
9
|
+
remember: boolean;
|
|
10
|
+
saving: boolean;
|
|
11
|
+
declining?: boolean;
|
|
12
|
+
error?: string;
|
|
13
|
+
onToggle: (scope: string, granted: boolean) => void;
|
|
14
|
+
onRememberChange: (remember: boolean) => void;
|
|
15
|
+
onAuthorize: () => void;
|
|
16
|
+
onCancel: () => void;
|
|
17
|
+
onSwitchPortal?: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const ScopeConsent: React.FC<ScopeConsentProps>;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Alert } from '../../../../atoms/Alert';
|
|
3
|
+
import { Avatar } from '../../../../atoms/Avatar';
|
|
4
|
+
import { Button } from '../../../../atoms/Button';
|
|
5
|
+
import { Checkbox } from '../../../../atoms/Checkbox';
|
|
6
|
+
import { Flex } from '../../../../atoms/Flex';
|
|
7
|
+
import { Icon } from '../../../../atoms/Icon';
|
|
8
|
+
import { Switch } from '../../../../atoms/Switch';
|
|
9
|
+
import { Tag } from '../../../../atoms/Tag';
|
|
10
|
+
import { Text } from '../../../../atoms/Text';
|
|
11
|
+
import { StoreIcon } from '../../../../icons/StoreIcon';
|
|
12
|
+
import { getInitials, getOryAccountLabel, getOryScopeInfo, OIDC_SCOPES, } from '../../utils/oryConsent';
|
|
13
|
+
import { OryAuthLayout } from './OryAuthLayout';
|
|
14
|
+
import { Caption, List, Mono, ScopeCard, ScopeGroup, ScopeGroups, SectionHeader, SummaryCard, SummaryRow, Truncate, } from './styled';
|
|
15
|
+
export const ScopeConsent = ({ request, account, catalog, portal, selected, remember, saving, declining = false, error, onToggle, onRememberChange, onAuthorize, onCancel, onSwitchPortal, }) => {
|
|
16
|
+
const scopes = request.requested_scope || [];
|
|
17
|
+
const identityScopes = scopes.filter(scope => OIDC_SCOPES.includes(scope));
|
|
18
|
+
const resourceScopes = scopes.filter(scope => !OIDC_SCOPES.includes(scope));
|
|
19
|
+
const { client } = request;
|
|
20
|
+
const clientName = client?.client_name || client?.client_id || 'This application';
|
|
21
|
+
const isGranted = (scope) => Boolean(getOryScopeInfo(scope, catalog).required) || selected.includes(scope);
|
|
22
|
+
const grantedCount = scopes.filter(isGranted).length;
|
|
23
|
+
const footer = (_jsxs(_Fragment, { children: [error ? _jsx(Alert, { type: "error", showIcon: true, role: "alert", message: error }) : null, _jsx(Button, { type: "primary", size: "large", block: true, loading: saving, disabled: grantedCount === 0 || declining, onClick: onAuthorize, children: _jsxs(Flex, { align: "center", justify: "center", gap: 8, children: [_jsx(Icon, { type: "icon-ants-check-circle", size: 18 }), "Authorize Access"] }) }), _jsx(Button, { size: "large", block: true, loading: declining, disabled: saving, onClick: onCancel, children: "Cancel & Return" })] }));
|
|
24
|
+
const renderScopes = (items) => (_jsx(List, { children: items.map(scope => {
|
|
25
|
+
const info = getOryScopeInfo(scope, catalog);
|
|
26
|
+
return (_jsx(ScopeCard, { "$locked": info.required, children: _jsxs(Flex, { vertical: true, gap: 4, children: [_jsxs(Flex, { align: "flex-start", justify: "space-between", gap: 12, children: [_jsxs(Flex, { align: "center", gap: 8, wrap: "wrap", style: { minWidth: 0 }, children: [_jsx(Text, { bold: true, size: "medium", children: info.title }), info.sensitive ? (_jsx(Tag, { color: "warning", bordered: false, style: { marginInlineEnd: 0 }, children: "Can edit data" })) : null] }), info.required ? (_jsx(Tag, { bordered: false, style: { marginInlineEnd: 0 }, children: "Required" })) : (_jsx(Switch, { checked: isGranted(scope), disabled: saving, "aria-label": `Allow ${info.title}`, onChange: granted => onToggle(scope, granted) }))] }), _jsx(Mono, { children: scope }), _jsx(Text, { type: "secondary", children: info.description })] }) }, scope));
|
|
27
|
+
}) }));
|
|
28
|
+
return (_jsxs(OryAuthLayout, { title: "Resource Consent", description: _jsxs(_Fragment, { children: [_jsx("b", { children: clientName }), " is requesting permission to access", ' ', portal ? (_jsxs(_Fragment, { children: ["resources in your ", _jsx("b", { children: portal.name }), " portal"] })) : ('your Antsomi account'), "."] }), footer: footer, children: [_jsxs(SummaryCard, { children: [_jsxs(SummaryRow, { children: [_jsx(Avatar, { shape: "square", size: 40, src: client?.logo_uri, style: { flex: 'none', color: '#005eb8', background: '#eaf1fb' }, children: getInitials(clientName) }), _jsxs(Flex, { vertical: true, style: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { bold: true, size: "medium", children: _jsx(Truncate, { children: clientName }) }), client?.client_id ? (_jsx(Text, { type: "secondary", children: _jsx(Truncate, { children: client.client_id }) })) : null] })] }), portal ? (_jsxs(SummaryRow, { children: [_jsx(Avatar, { shape: "square", size: 40, icon: _jsx(StoreIcon, { size: 20, fill: "currentColor" }), style: { flex: 'none', color: '#005eb8', background: '#eaf1fb' } }), _jsxs(Flex, { vertical: true, style: { flex: 1, minWidth: 0 }, children: [_jsx(Text, { bold: true, size: "medium", children: _jsx(Truncate, { children: portal.name }) }), _jsx(Text, { type: "secondary", children: _jsx(Truncate, { children: portal.slug || portal.id }) })] }), onSwitchPortal ? (_jsx(Button, { type: "text", size: "small", onClick: onSwitchPortal, children: "Switch" })) : null] })) : null] }), _jsxs(Flex, { vertical: true, gap: 12, children: [_jsxs(SectionHeader, { children: [_jsx(Text, { bold: true, size: "medium", children: "Requested scopes" }), _jsxs(Text, { type: "secondary", children: [grantedCount, " of ", scopes.length, " selected"] })] }), _jsxs(ScopeGroups, { children: [identityScopes.length ? (_jsxs(ScopeGroup, { children: [_jsx(Caption, { children: "Your identity" }), renderScopes(identityScopes)] })) : null, resourceScopes.length ? (_jsxs(ScopeGroup, { children: [_jsxs(Caption, { children: ["Portal data", portal ? ` · ${portal.name}` : ''] }), renderScopes(resourceScopes)] })) : null] })] }), _jsxs(Flex, { vertical: true, gap: 12, children: [_jsx(Alert, { type: "info", showIcon: true, message: "Only the permissions you keep switched on will be granted to this application." }), _jsx(Checkbox, { checked: remember, disabled: saving, onChange: e => onRememberChange(e.target.checked), children: "Remember my choice for this application" }), account.email || account.name ? (_jsxs(Text, { type: "secondary", style: { textAlign: 'center' }, children: ["Signed in as ", _jsx("b", { children: getOryAccountLabel(account) })] })) : null] })] }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export declare const Page: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const Panel: import("styled-components").StyledComponent<"main", any, {}, never>;
|
|
3
|
+
export declare const Banner: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const Body: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
5
|
+
export declare const AuthHeader: import("styled-components").StyledComponent<"header", any, {}, never>;
|
|
6
|
+
export declare const HeaderLogo: import("styled-components").StyledComponent<"img", any, {}, never>;
|
|
7
|
+
export declare const Footer: import("styled-components").StyledComponent<"footer", any, {}, never>;
|
|
8
|
+
export declare const SearchBox: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
9
|
+
export declare const List: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
|
+
export declare const PortalGrid: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
11
|
+
export declare const PortalOption: import("styled-components").StyledComponent<"div", any, {
|
|
12
|
+
$selected: boolean;
|
|
13
|
+
}, never>;
|
|
14
|
+
export declare const PortalLogo: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
15
|
+
export declare const PortalName: import("styled-components").StyledComponent<"span", any, {
|
|
16
|
+
$selected: boolean;
|
|
17
|
+
}, never>;
|
|
18
|
+
export declare const Indicator: import("styled-components").StyledComponent<"span", any, {
|
|
19
|
+
$selected: boolean;
|
|
20
|
+
}, never>;
|
|
21
|
+
export declare const SummaryCard: import("styled-components").StyledComponent<"section", any, {}, never>;
|
|
22
|
+
export declare const SummaryRow: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
23
|
+
export declare const SectionHeader: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
24
|
+
export declare const ScopeGroups: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
25
|
+
export declare const ScopeGroup: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
26
|
+
export declare const Caption: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
27
|
+
export declare const ScopeCard: import("styled-components").StyledComponent<"div", any, {
|
|
28
|
+
$locked?: boolean | undefined;
|
|
29
|
+
}, never>;
|
|
30
|
+
export declare const Mono: import("styled-components").StyledComponent<"code", any, {}, never>;
|
|
31
|
+
export declare const Truncate: import("styled-components").StyledComponent<"span", any, {}, never>;
|