@keycloakify/keycloak-account-ui 26.0.6-rc.1 → 260007.0.0
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/KcAccountUiLoader.d.ts +2 -4
- package/KcAccountUiLoader.js +34 -41
- package/KcAccountUiLoader.js.map +1 -1
- package/README.md +0 -49
- package/index.js.map +1 -1
- package/{KcAccountUi.js → keycloak-theme/account/KcAccountUi.tsx} +15 -7
- package/keycloak-theme/account/KcContext.ts +8 -0
- package/keycloak-theme/account/KcPage.tsx +11 -0
- package/{src → keycloak-theme/account}/account-security/AccountRow.tsx +8 -4
- package/{src → keycloak-theme/account}/account-security/DeviceActivity.tsx +11 -7
- package/{src → keycloak-theme/account}/account-security/LinkedAccounts.tsx +12 -8
- package/{src → keycloak-theme/account}/account-security/LinkedAccountsToolbar.tsx +4 -0
- package/{src → keycloak-theme/account}/account-security/SigningIn.tsx +12 -8
- package/{src → keycloak-theme/account}/api/constants.ts +4 -0
- package/{src → keycloak-theme/account}/api/methods.ts +9 -5
- package/{src → keycloak-theme/account}/api/parse-links.ts +4 -0
- package/{src → keycloak-theme/account}/api/parse-response.ts +6 -2
- package/{src → keycloak-theme/account}/api/representations.ts +4 -0
- package/{src → keycloak-theme/account}/api/request.ts +7 -3
- package/{src → keycloak-theme/account}/api.ts +11 -7
- package/{src → keycloak-theme/account}/applications/Applications.tsx +12 -8
- package/{src/public → keycloak-theme/account/assets}/content.ts +14 -20
- package/keycloak-theme/account/assets/favicon.svg +63 -0
- package/{src → keycloak-theme/account}/components/datalist/EmptyRow.tsx +4 -0
- package/{src → keycloak-theme/account}/components/page/Page.tsx +4 -0
- package/{src → keycloak-theme/account}/content/ContentComponent.tsx +10 -6
- package/keycloak-theme/account/content/fetchContent.ts +13 -0
- package/{src → keycloak-theme/account}/environment.ts +5 -1
- package/{src → keycloak-theme/account}/groups/Groups.tsx +9 -5
- package/{src → keycloak-theme/account/i18n}/i18n.ts +7 -5
- package/keycloak-theme/account/i18n/index.ts +5 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ar.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ca.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_cs.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_da.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_de.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_el.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_en.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_es.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_fa.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_fi.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_fr.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_hu.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_it.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ja.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ka.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_lt.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_lv.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_nl.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_no.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_pl.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_pt.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_pt_BR.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_ru.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_sk.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_sv.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_th.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_tr.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_uk.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_zh_CN.properties +8 -0
- package/{messages → keycloak-theme/account/i18n}/messages_zh_TW.properties +8 -0
- package/{src → keycloak-theme/account}/i18next.d.ts +4 -0
- package/{src → keycloak-theme/account}/oid4vci/Oid4Vci.tsx +9 -5
- package/{src → keycloak-theme/account}/organizations/Organizations.tsx +9 -5
- package/{src → keycloak-theme/account}/personal-info/PersonalInfo.tsx +13 -10
- package/{src → keycloak-theme/account}/resources/EditTheResource.tsx +8 -4
- package/{src → keycloak-theme/account}/resources/PermissionRequest.tsx +8 -4
- package/{src → keycloak-theme/account}/resources/ResourceToolbar.tsx +4 -0
- package/{src → keycloak-theme/account}/resources/Resources.tsx +6 -2
- package/{src → keycloak-theme/account}/resources/ResourcesTab.tsx +16 -12
- package/{src → keycloak-theme/account}/resources/ShareTheResource.tsx +9 -5
- package/{src → keycloak-theme/account}/resources/SharedWith.tsx +5 -1
- package/{src → keycloak-theme/account}/root/ErrorPage.tsx +4 -0
- package/{src → keycloak-theme/account}/root/Header.tsx +11 -6
- package/{src → keycloak-theme/account}/root/PageNav.tsx +9 -5
- package/{src → keycloak-theme/account}/root/Root.tsx +8 -4
- package/{src → keycloak-theme/account}/routes.tsx +18 -14
- package/{src → keycloak-theme/account}/utils/formatDate.ts +6 -3
- package/{src → keycloak-theme/account}/utils/joinPath.ts +4 -0
- package/{src → keycloak-theme/account}/utils/useAccountAlerts.ts +6 -2
- package/{src → keycloak-theme/account}/utils/usePromise.ts +4 -0
- package/package.json +18 -525
- package/src/KcAccountUiLoader.tsx +391 -370
- package/src/zKcContextLike.ts +31 -74
- package/tsconfig.tsbuildinfo +1 -0
- package/zKcContextLike.js +7 -7
- package/zKcContextLike.js.map +1 -1
- package/KcAccountUi.d.ts +0 -3
- package/KcAccountUi.js.map +0 -1
- package/account-security/AccountRow.d.ts +0 -8
- package/account-security/AccountRow.js +0 -37
- package/account-security/AccountRow.js.map +0 -1
- package/account-security/DeviceActivity.d.ts +0 -2
- package/account-security/DeviceActivity.js +0 -71
- package/account-security/DeviceActivity.js.map +0 -1
- package/account-security/LinkedAccounts.d.ts +0 -2
- package/account-security/LinkedAccounts.js +0 -40
- package/account-security/LinkedAccounts.js.map +0 -1
- package/account-security/LinkedAccountsToolbar.d.ts +0 -12
- package/account-security/LinkedAccountsToolbar.js +0 -24
- package/account-security/LinkedAccountsToolbar.js.map +0 -1
- package/account-security/SigningIn.d.ts +0 -2
- package/account-security/SigningIn.js +0 -65
- package/account-security/SigningIn.js.map +0 -1
- package/api/constants.d.ts +0 -2
- package/api/constants.js +0 -3
- package/api/constants.js.map +0 -1
- package/api/methods.d.ts +0 -31
- package/api/methods.js +0 -80
- package/api/methods.js.map +0 -1
- package/api/parse-links.d.ts +0 -5
- package/api/parse-links.js +0 -23
- package/api/parse-links.js.map +0 -1
- package/api/parse-response.d.ts +0 -5
- package/api/parse-response.js +0 -36
- package/api/parse-response.js.map +0 -1
- package/api/representations.d.ts +0 -202
- package/api/representations.js +0 -3
- package/api/representations.js.map +0 -1
- package/api/request.d.ts +0 -12
- package/api/request.js +0 -33
- package/api/request.js.map +0 -1
- package/api.d.ts +0 -13
- package/api.js +0 -46
- package/api.js.map +0 -1
- package/applications/Applications.d.ts +0 -2
- package/applications/Applications.js +0 -53
- package/applications/Applications.js.map +0 -1
- package/components/datalist/EmptyRow.d.ts +0 -5
- package/components/datalist/EmptyRow.js +0 -20
- package/components/datalist/EmptyRow.js.map +0 -1
- package/components/page/Page.d.ts +0 -7
- package/components/page/Page.js +0 -6
- package/components/page/Page.js.map +0 -1
- package/content/ContentComponent.d.ts +0 -2
- package/content/ContentComponent.js +0 -36
- package/content/ContentComponent.js.map +0 -1
- package/content/fetchContent.d.ts +0 -3
- package/content/fetchContent.js +0 -6
- package/content/fetchContent.js.map +0 -1
- package/environment.d.ts +0 -26
- package/environment.js +0 -3
- package/environment.js.map +0 -1
- package/groups/Groups.d.ts +0 -2
- package/groups/Groups.js +0 -45
- package/groups/Groups.js.map +0 -1
- package/i18n.d.ts +0 -4
- package/i18n.js +0 -32
- package/i18n.js.map +0 -1
- package/oid4vci/Oid4Vci.d.ts +0 -2
- package/oid4vci/Oid4Vci.js +0 -54
- package/oid4vci/Oid4Vci.js.map +0 -1
- package/organizations/Organizations.d.ts +0 -2
- package/organizations/Organizations.js +0 -19
- package/organizations/Organizations.js.map +0 -1
- package/personal-info/PersonalInfo.d.ts +0 -2
- package/personal-info/PersonalInfo.js +0 -69
- package/personal-info/PersonalInfo.js.map +0 -1
- package/public/content.d.ts +0 -37
- package/public/content.js +0 -50
- package/public/content.js.map +0 -1
- package/resources/EditTheResource.d.ts +0 -8
- package/resources/EditTheResource.js +0 -37
- package/resources/EditTheResource.js.map +0 -1
- package/resources/PermissionRequest.d.ts +0 -7
- package/resources/PermissionRequest.js +0 -40
- package/resources/PermissionRequest.js.map +0 -1
- package/resources/ResourceToolbar.d.ts +0 -12
- package/resources/ResourceToolbar.js +0 -24
- package/resources/ResourceToolbar.js.map +0 -1
- package/resources/Resources.d.ts +0 -2
- package/resources/Resources.js +0 -13
- package/resources/Resources.js.map +0 -1
- package/resources/ResourcesTab.d.ts +0 -5
- package/resources/ResourcesTab.js +0 -104
- package/resources/ResourcesTab.js.map +0 -1
- package/resources/ShareTheResource.d.ts +0 -9
- package/resources/ShareTheResource.js +0 -71
- package/resources/ShareTheResource.js.map +0 -1
- package/resources/SharedWith.d.ts +0 -6
- package/resources/SharedWith.js +0 -8
- package/resources/SharedWith.js.map +0 -1
- package/root/ErrorPage.d.ts +0 -5
- package/root/ErrorPage.js +0 -29
- package/root/ErrorPage.js.map +0 -1
- package/root/Header.d.ts +0 -1
- package/root/Header.js +0 -31
- package/root/Header.js.map +0 -1
- package/root/PageNav.d.ts +0 -22
- package/root/PageNav.js +0 -47
- package/root/PageNav.js.map +0 -1
- package/root/Root.d.ts +0 -1
- package/root/Root.js +0 -12
- package/root/Root.js.map +0 -1
- package/routes.d.ts +0 -16
- package/routes.js +0 -75
- package/routes.js.map +0 -1
- package/src/KcAccountUi.tsx +0 -25
- package/src/content/fetchContent.ts +0 -13
- package/src/global.d.ts +0 -9
- package/src/public/logo.svg +0 -1
- package/src/root/header.module.css +0 -3
- package/src/ui-shared/alerts/AlertPanel.tsx +0 -43
- package/src/ui-shared/alerts/Alerts.tsx +0 -82
- package/src/ui-shared/buttons/FormSubmitButton.tsx +0 -47
- package/src/ui-shared/context/ErrorPage.tsx +0 -60
- package/src/ui-shared/context/HelpContext.tsx +0 -30
- package/src/ui-shared/context/KeycloakContext.tsx +0 -97
- package/src/ui-shared/context/environment.ts +0 -50
- package/src/ui-shared/continue-cancel/ContinueCancelModal.tsx +0 -75
- package/src/ui-shared/controls/FormErrorText.tsx +0 -23
- package/src/ui-shared/controls/FormLabel.tsx +0 -40
- package/src/ui-shared/controls/HelpItem.tsx +0 -43
- package/src/ui-shared/controls/KeycloakSpinner.tsx +0 -12
- package/src/ui-shared/controls/NumberControl.tsx +0 -93
- package/src/ui-shared/controls/OrganizationTable.tsx +0 -122
- package/src/ui-shared/controls/PasswordControl.tsx +0 -71
- package/src/ui-shared/controls/PasswordInput.tsx +0 -50
- package/src/ui-shared/controls/SwitchControl.tsx +0 -67
- package/src/ui-shared/controls/TextAreaControl.tsx +0 -60
- package/src/ui-shared/controls/TextControl.tsx +0 -75
- package/src/ui-shared/controls/keycloak-text-area/KeycloakTextArea.tsx +0 -23
- package/src/ui-shared/controls/select-control/SelectControl.tsx +0 -75
- package/src/ui-shared/controls/select-control/SingleSelectControl.tsx +0 -109
- package/src/ui-shared/controls/select-control/TypeaheadSelectControl.tsx +0 -285
- package/src/ui-shared/controls/table/KeycloakDataTable.tsx +0 -597
- package/src/ui-shared/controls/table/ListEmptyState.tsx +0 -86
- package/src/ui-shared/controls/table/PaginatingTableToolbar.tsx +0 -106
- package/src/ui-shared/controls/table/TableToolbar.tsx +0 -92
- package/src/ui-shared/icons/IconMapper.tsx +0 -63
- package/src/ui-shared/index.ts +0 -1
- package/src/ui-shared/main.ts +0 -96
- package/src/ui-shared/masthead/DefaultAvatar.tsx +0 -109
- package/src/ui-shared/masthead/KeycloakDropdown.tsx +0 -48
- package/src/ui-shared/masthead/Masthead.tsx +0 -161
- package/src/ui-shared/scroll-form/FormPanel.tsx +0 -29
- package/src/ui-shared/scroll-form/FormTitle.tsx +0 -28
- package/src/ui-shared/scroll-form/ScrollForm.tsx +0 -98
- package/src/ui-shared/scroll-form/ScrollPanel.tsx +0 -21
- package/src/ui-shared/scroll-form/form-title.module.css +0 -4
- package/src/ui-shared/scroll-form/scroll-form.module.css +0 -8
- package/src/ui-shared/select/KeycloakSelect.tsx +0 -49
- package/src/ui-shared/select/SingleSelect.tsx +0 -89
- package/src/ui-shared/select/TypeaheadSelect.tsx +0 -198
- package/src/ui-shared/user-profile/LocaleSelector.tsx +0 -51
- package/src/ui-shared/user-profile/MultiInputComponent.tsx +0 -146
- package/src/ui-shared/user-profile/OptionsComponent.tsx +0 -63
- package/src/ui-shared/user-profile/SelectComponent.tsx +0 -109
- package/src/ui-shared/user-profile/TextAreaComponent.tsx +0 -23
- package/src/ui-shared/user-profile/TextComponent.tsx +0 -32
- package/src/ui-shared/user-profile/UserProfileFields.tsx +0 -243
- package/src/ui-shared/user-profile/UserProfileGroup.tsx +0 -71
- package/src/ui-shared/user-profile/utils.ts +0 -170
- package/src/ui-shared/utils/ErrorBoundary.tsx +0 -77
- package/src/ui-shared/utils/createNamedContext.ts +0 -11
- package/src/ui-shared/utils/darkMode.ts +0 -19
- package/src/ui-shared/utils/errors.ts +0 -55
- package/src/ui-shared/utils/generateId.ts +0 -1
- package/src/ui-shared/utils/getRuleValue.ts +0 -17
- package/src/ui-shared/utils/isDefined.ts +0 -3
- package/src/ui-shared/utils/useFetch.ts +0 -44
- package/src/ui-shared/utils/useRequiredContext.ts +0 -24
- package/src/ui-shared/utils/useSetTimeout.ts +0 -40
- package/src/ui-shared/utils/useStorageItem.ts +0 -51
- package/src/ui-shared/utils/useStoredState.ts +0 -38
- package/ui-shared/alerts/AlertPanel.d.ts +0 -6
- package/ui-shared/alerts/AlertPanel.js +0 -6
- package/ui-shared/alerts/AlertPanel.js.map +0 -1
- package/ui-shared/alerts/Alerts.d.ts +0 -16
- package/ui-shared/alerts/Alerts.js +0 -37
- package/ui-shared/alerts/Alerts.js.map +0 -1
- package/ui-shared/buttons/FormSubmitButton.d.ts +0 -10
- package/ui-shared/buttons/FormSubmitButton.js +0 -26
- package/ui-shared/buttons/FormSubmitButton.js.map +0 -1
- package/ui-shared/context/ErrorPage.d.ts +0 -5
- package/ui-shared/context/ErrorPage.js +0 -24
- package/ui-shared/context/ErrorPage.js.map +0 -1
- package/ui-shared/context/HelpContext.d.ts +0 -9
- package/ui-shared/context/HelpContext.js +0 -14
- package/ui-shared/context/HelpContext.js.map +0 -1
- package/ui-shared/context/KeycloakContext.d.ts +0 -12
- package/ui-shared/context/KeycloakContext.js +0 -53
- package/ui-shared/context/KeycloakContext.js.map +0 -1
- package/ui-shared/context/environment.d.ts +0 -36
- package/ui-shared/context/environment.js +0 -27
- package/ui-shared/context/environment.js.map +0 -1
- package/ui-shared/continue-cancel/ContinueCancelModal.d.ts +0 -15
- package/ui-shared/continue-cancel/ContinueCancelModal.js +0 -27
- package/ui-shared/continue-cancel/ContinueCancelModal.js.map +0 -1
- package/ui-shared/controls/FormErrorText.d.ts +0 -5
- package/ui-shared/controls/FormErrorText.js +0 -19
- package/ui-shared/controls/FormErrorText.js.map +0 -1
- package/ui-shared/controls/FormLabel.d.ts +0 -13
- package/ui-shared/controls/FormLabel.js +0 -20
- package/ui-shared/controls/FormLabel.js.map +0 -1
- package/ui-shared/controls/HelpItem.d.ts +0 -9
- package/ui-shared/controls/HelpItem.js +0 -9
- package/ui-shared/controls/HelpItem.js.map +0 -1
- package/ui-shared/controls/KeycloakSpinner.d.ts +0 -1
- package/ui-shared/controls/KeycloakSpinner.js +0 -8
- package/ui-shared/controls/KeycloakSpinner.js.map +0 -1
- package/ui-shared/controls/NumberControl.d.ts +0 -13
- package/ui-shared/controls/NumberControl.js +0 -33
- package/ui-shared/controls/NumberControl.js.map +0 -1
- package/ui-shared/controls/OrganizationTable.d.ts +0 -16
- package/ui-shared/controls/OrganizationTable.js +0 -45
- package/ui-shared/controls/OrganizationTable.js.map +0 -1
- package/ui-shared/controls/PasswordControl.d.ts +0 -9
- package/ui-shared/controls/PasswordControl.js +0 -25
- package/ui-shared/controls/PasswordControl.js.map +0 -1
- package/ui-shared/controls/PasswordInput.d.ts +0 -7
- package/ui-shared/controls/PasswordInput.js +0 -25
- package/ui-shared/controls/PasswordInput.js.map +0 -1
- package/ui-shared/controls/SwitchControl.d.ts +0 -11
- package/ui-shared/controls/SwitchControl.js +0 -29
- package/ui-shared/controls/SwitchControl.js.map +0 -1
- package/ui-shared/controls/TextAreaControl.d.ts +0 -8
- package/ui-shared/controls/TextAreaControl.js +0 -12
- package/ui-shared/controls/TextAreaControl.js.map +0 -1
- package/ui-shared/controls/TextControl.d.ts +0 -11
- package/ui-shared/controls/TextControl.js +0 -24
- package/ui-shared/controls/TextControl.js.map +0 -1
- package/ui-shared/controls/keycloak-text-area/KeycloakTextArea.d.ts +0 -4
- package/ui-shared/controls/keycloak-text-area/KeycloakTextArea.js +0 -5
- package/ui-shared/controls/keycloak-text-area/KeycloakTextArea.js.map +0 -1
- package/ui-shared/controls/select-control/SelectControl.d.ts +0 -31
- package/ui-shared/controls/select-control/SelectControl.js +0 -28
- package/ui-shared/controls/select-control/SelectControl.js.map +0 -1
- package/ui-shared/controls/select-control/SingleSelectControl.d.ts +0 -3
- package/ui-shared/controls/select-control/SingleSelectControl.js +0 -43
- package/ui-shared/controls/select-control/SingleSelectControl.js.map +0 -1
- package/ui-shared/controls/select-control/TypeaheadSelectControl.d.ts +0 -3
- package/ui-shared/controls/select-control/TypeaheadSelectControl.js +0 -140
- package/ui-shared/controls/select-control/TypeaheadSelectControl.js.map +0 -1
- package/ui-shared/controls/table/KeycloakDataTable.d.ts +0 -64
- package/ui-shared/controls/table/KeycloakDataTable.js +0 -279
- package/ui-shared/controls/table/KeycloakDataTable.js.map +0 -1
- package/ui-shared/controls/table/ListEmptyState.d.ts +0 -20
- package/ui-shared/controls/table/ListEmptyState.js +0 -11
- package/ui-shared/controls/table/ListEmptyState.js.map +0 -1
- package/ui-shared/controls/table/PaginatingTableToolbar.d.ts +0 -21
- package/ui-shared/controls/table/PaginatingTableToolbar.js +0 -27
- package/ui-shared/controls/table/PaginatingTableToolbar.js.map +0 -1
- package/ui-shared/controls/table/TableToolbar.d.ts +0 -12
- package/ui-shared/controls/table/TableToolbar.js +0 -30
- package/ui-shared/controls/table/TableToolbar.js.map +0 -1
- package/ui-shared/icons/IconMapper.d.ts +0 -5
- package/ui-shared/icons/IconMapper.js +0 -40
- package/ui-shared/icons/IconMapper.js.map +0 -1
- package/ui-shared/index.d.ts +0 -1
- package/ui-shared/index.js +0 -2
- package/ui-shared/index.js.map +0 -1
- package/ui-shared/main.d.ts +0 -45
- package/ui-shared/main.js +0 -41
- package/ui-shared/main.js.map +0 -1
- package/ui-shared/masthead/DefaultAvatar.d.ts +0 -7
- package/ui-shared/masthead/DefaultAvatar.js +0 -26
- package/ui-shared/masthead/DefaultAvatar.js.map +0 -1
- package/ui-shared/masthead/KeycloakDropdown.d.ts +0 -10
- package/ui-shared/masthead/KeycloakDropdown.js +0 -23
- package/ui-shared/masthead/KeycloakDropdown.js.map +0 -1
- package/ui-shared/masthead/Masthead.d.ts +0 -19
- package/ui-shared/masthead/Masthead.js +0 -55
- package/ui-shared/masthead/Masthead.js.map +0 -1
- package/ui-shared/scroll-form/FormPanel.d.ts +0 -8
- package/ui-shared/scroll-form/FormPanel.js +0 -9
- package/ui-shared/scroll-form/FormPanel.js.map +0 -1
- package/ui-shared/scroll-form/FormTitle.d.ts +0 -8
- package/ui-shared/scroll-form/FormTitle.js +0 -19
- package/ui-shared/scroll-form/FormTitle.js.map +0 -1
- package/ui-shared/scroll-form/ScrollForm.d.ts +0 -15
- package/ui-shared/scroll-form/ScrollForm.js +0 -38
- package/ui-shared/scroll-form/ScrollForm.js.map +0 -1
- package/ui-shared/scroll-form/ScrollPanel.d.ts +0 -7
- package/ui-shared/scroll-form/ScrollPanel.js +0 -18
- package/ui-shared/scroll-form/ScrollPanel.js.map +0 -1
- package/ui-shared/scroll-form/form-title.module.css +0 -4
- package/ui-shared/scroll-form/scroll-form.module.css +0 -8
- package/ui-shared/select/KeycloakSelect.d.ts +0 -30
- package/ui-shared/select/KeycloakSelect.js +0 -31
- package/ui-shared/select/KeycloakSelect.js.map +0 -1
- package/ui-shared/select/SingleSelect.d.ts +0 -4
- package/ui-shared/select/SingleSelect.js +0 -49
- package/ui-shared/select/SingleSelect.js.map +0 -1
- package/ui-shared/select/TypeaheadSelect.d.ts +0 -2
- package/ui-shared/select/TypeaheadSelect.js +0 -96
- package/ui-shared/select/TypeaheadSelect.js.map +0 -1
- package/ui-shared/user-profile/LocaleSelector.d.ts +0 -7
- package/ui-shared/user-profile/LocaleSelector.js +0 -28
- package/ui-shared/user-profile/LocaleSelector.js.map +0 -1
- package/ui-shared/user-profile/MultiInputComponent.d.ts +0 -15
- package/ui-shared/user-profile/MultiInputComponent.js +0 -61
- package/ui-shared/user-profile/MultiInputComponent.js.map +0 -1
- package/ui-shared/user-profile/OptionsComponent.d.ts +0 -2
- package/ui-shared/user-profile/OptionsComponent.js +0 -29
- package/ui-shared/user-profile/OptionsComponent.js.map +0 -1
- package/ui-shared/user-profile/SelectComponent.d.ts +0 -2
- package/ui-shared/user-profile/SelectComponent.js +0 -56
- package/ui-shared/user-profile/SelectComponent.js.map +0 -1
- package/ui-shared/user-profile/TextAreaComponent.d.ts +0 -2
- package/ui-shared/user-profile/TextAreaComponent.js +0 -11
- package/ui-shared/user-profile/TextAreaComponent.js.map +0 -1
- package/ui-shared/user-profile/TextComponent.d.ts +0 -2
- package/ui-shared/user-profile/TextComponent.js +0 -14
- package/ui-shared/user-profile/TextComponent.js.map +0 -1
- package/ui-shared/user-profile/UserProfileFields.d.ts +0 -37
- package/ui-shared/user-profile/UserProfileFields.js +0 -94
- package/ui-shared/user-profile/UserProfileFields.js.map +0 -1
- package/ui-shared/user-profile/UserProfileGroup.d.ts +0 -12
- package/ui-shared/user-profile/UserProfileGroup.js +0 -15
- package/ui-shared/user-profile/UserProfileGroup.js.map +0 -1
- package/ui-shared/user-profile/utils.d.ts +0 -32
- package/ui-shared/user-profile/utils.js +0 -84
- package/ui-shared/user-profile/utils.js.map +0 -1
- package/ui-shared/utils/ErrorBoundary.d.ts +0 -26
- package/ui-shared/utils/ErrorBoundary.js +0 -29
- package/ui-shared/utils/ErrorBoundary.js.map +0 -1
- package/ui-shared/utils/createNamedContext.d.ts +0 -3
- package/ui-shared/utils/createNamedContext.js +0 -7
- package/ui-shared/utils/createNamedContext.js.map +0 -1
- package/ui-shared/utils/darkMode.d.ts +0 -1
- package/ui-shared/utils/darkMode.js +0 -16
- package/ui-shared/utils/darkMode.js.map +0 -1
- package/ui-shared/utils/errors.d.ts +0 -4
- package/ui-shared/utils/errors.js +0 -42
- package/ui-shared/utils/errors.js.map +0 -1
- package/ui-shared/utils/generateId.d.ts +0 -1
- package/ui-shared/utils/generateId.js +0 -2
- package/ui-shared/utils/generateId.js.map +0 -1
- package/ui-shared/utils/getRuleValue.d.ts +0 -2
- package/ui-shared/utils/getRuleValue.js +0 -12
- package/ui-shared/utils/getRuleValue.js.map +0 -1
- package/ui-shared/utils/isDefined.d.ts +0 -1
- package/ui-shared/utils/isDefined.js +0 -4
- package/ui-shared/utils/isDefined.js.map +0 -1
- package/ui-shared/utils/useFetch.d.ts +0 -17
- package/ui-shared/utils/useFetch.js +0 -38
- package/ui-shared/utils/useFetch.js.map +0 -1
- package/ui-shared/utils/useRequiredContext.d.ts +0 -9
- package/ui-shared/utils/useRequiredContext.js +0 -17
- package/ui-shared/utils/useRequiredContext.js.map +0 -1
- package/ui-shared/utils/useSetTimeout.d.ts +0 -1
- package/ui-shared/utils/useSetTimeout.js +0 -32
- package/ui-shared/utils/useSetTimeout.js.map +0 -1
- package/ui-shared/utils/useStorageItem.d.ts +0 -10
- package/ui-shared/utils/useStorageItem.js +0 -40
- package/ui-shared/utils/useStorageItem.js.map +0 -1
- package/ui-shared/utils/useStoredState.d.ts +0 -13
- package/ui-shared/utils/useStoredState.js +0 -21
- package/ui-shared/utils/useStoredState.js.map +0 -1
- package/utils/formatDate.d.ts +0 -4
- package/utils/formatDate.js +0 -12
- package/utils/formatDate.js.map +0 -1
- package/utils/joinPath.d.ts +0 -1
- package/utils/joinPath.js +0 -18
- package/utils/joinPath.js.map +0 -1
- package/utils/useAccountAlerts.d.ts +0 -4
- package/utils/useAccountAlerts.js +0 -19
- package/utils/useAccountAlerts.js.map +0 -1
- package/utils/usePromise.d.ts +0 -41
- package/utils/usePromise.js +0 -59
- package/utils/usePromise.js.map +0 -1
- /package/{public → keycloak-theme/account/assets}/logo.svg +0 -0
- /package/{root → keycloak-theme/account/root}/header.module.css +0 -0
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Component, } from "react";
|
|
3
|
-
import { createNamedContext } from "../../ui-shared/utils/createNamedContext";
|
|
4
|
-
import { useRequiredContext } from "../../ui-shared/utils/useRequiredContext";
|
|
5
|
-
const ErrorBoundaryContext = createNamedContext("ErrorBoundaryContext", undefined);
|
|
6
|
-
export const useErrorBoundary = () => useRequiredContext(ErrorBoundaryContext);
|
|
7
|
-
export class ErrorBoundaryProvider extends Component {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.state = {};
|
|
11
|
-
this.showBoundary = (error) => {
|
|
12
|
-
this.setState({ error });
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
render() {
|
|
16
|
-
return (_jsx(ErrorBoundaryContext.Provider, { value: { error: this.state.error, showBoundary: this.showBoundary }, children: this.props.children }));
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
ErrorBoundaryProvider.getDerivedStateFromError = (error) => {
|
|
20
|
-
return { error };
|
|
21
|
-
};
|
|
22
|
-
export const ErrorBoundaryFallback = ({ children, fallback: FallbackComponent }) => {
|
|
23
|
-
const { error } = useErrorBoundary();
|
|
24
|
-
if (error) {
|
|
25
|
-
return _jsx(FallbackComponent, { error: error });
|
|
26
|
-
}
|
|
27
|
-
return children;
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=ErrorBoundary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorBoundary.js","sourceRoot":"","sources":["../../src/ui-shared/utils/ErrorBoundary.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,SAAS,GAKV,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,kBAAkB,EAAE,MAAM,qEAAqE,CAAC;AACzG,OAAO,EAAE,kBAAkB,EAAE,MAAM,qEAAqE,CAAC;AAOzG,MAAM,oBAAoB,GAAG,kBAAkB,CAE7C,sBAAsB,EAAE,SAAS,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;AAU/E,MAAM,OAAO,qBAAsB,SAAQ,SAG1C;IAHD;;QAIE,UAAK,GAA+B,EAAE,CAAC;QASvC,iBAAY,GAAG,CAAC,KAAa,EAAE,EAAE;YAC/B,IAAI,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QAC3B,CAAC,CAAC;IAWJ,CAAC;IATC,MAAM;QACJ,OAAO,CACL,KAAC,oBAAoB,CAAC,QAAQ,IAC5B,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,YAElE,IAAI,CAAC,KAAK,CAAC,QAAQ,GACU,CACjC,CAAC;IACJ,CAAC;;AAnBM,8CAAwB,GAG3B,CAAC,KAAK,EAAE,EAAE;IACZ,OAAO,EAAE,KAAK,EAAE,CAAC;AACnB,CAAC,AAL8B,CAK7B;AA0BJ,MAAM,CAAC,MAAM,qBAAqB,GAE9B,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,iBAAiB,EAAE,EAAE,EAAE;IAChD,MAAM,EAAE,KAAK,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAErC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,KAAC,iBAAiB,IAAC,KAAK,EAAE,KAAK,GAAI,CAAC;IAC7C,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createNamedContext.js","sourceRoot":"","sources":["../../src/ui-shared/utils/createNamedContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,MAAM,UAAU,kBAAkB,CAAI,WAAmB,EAAE,YAAe;IACxE,MAAM,OAAO,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;IAC5C,OAAO,CAAC,WAAW,GAAG,WAAW,CAAC;IAClC,OAAO,OAA0B,CAAC;AACpC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function initializeDarkMode(): void;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const DARK_MODE_CLASS = "pf-v5-theme-dark";
|
|
2
|
-
const mediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
3
|
-
function updateDarkMode(isEnabled) {
|
|
4
|
-
const { classList } = document.documentElement;
|
|
5
|
-
if (isEnabled) {
|
|
6
|
-
classList.add(DARK_MODE_CLASS);
|
|
7
|
-
}
|
|
8
|
-
else {
|
|
9
|
-
classList.remove(DARK_MODE_CLASS);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export function initializeDarkMode() {
|
|
13
|
-
updateDarkMode(mediaQuery.matches);
|
|
14
|
-
mediaQuery.addEventListener("change", (event) => updateDarkMode(event.matches));
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=darkMode.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"darkMode.js","sourceRoot":"","sources":["../../src/ui-shared/utils/darkMode.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,kBAAkB,CAAC;AAC3C,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,8BAA8B,CAAC,CAAC;AAErE,SAAS,cAAc,CAAC,SAAkB;IACxC,MAAM,EAAE,SAAS,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC;IAE/C,IAAI,SAAS,EAAE,CAAC;QACd,SAAS,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACjC,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;IACpC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACnC,UAAU,CAAC,gBAAgB,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAC9C,cAAc,CAAC,KAAK,CAAC,OAAO,CAAC,CAC9B,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare function getErrorMessage(error: unknown): string | undefined;
|
|
2
|
-
export declare function getErrorDescription(error: unknown): string | undefined;
|
|
3
|
-
export declare function getNetworkErrorDescription(data: unknown): string | undefined;
|
|
4
|
-
export declare function getNetworkErrorMessage(data: unknown): string | undefined;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { NetworkError } from "@keycloak/keycloak-admin-client";
|
|
2
|
-
const ERROR_FIELDS = ["error", "errorMessage"];
|
|
3
|
-
const ERROR_DESCRIPTION_FIELD = "error_description";
|
|
4
|
-
export function getErrorMessage(error) {
|
|
5
|
-
if (typeof error === "string") {
|
|
6
|
-
return error;
|
|
7
|
-
}
|
|
8
|
-
if (error instanceof NetworkError) {
|
|
9
|
-
return getNetworkErrorMessage(error.responseData);
|
|
10
|
-
}
|
|
11
|
-
if (error instanceof Error) {
|
|
12
|
-
return error.message;
|
|
13
|
-
}
|
|
14
|
-
throw new Error("Unable to determine error message.");
|
|
15
|
-
}
|
|
16
|
-
export function getErrorDescription(error) {
|
|
17
|
-
if (!(error instanceof NetworkError)) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const data = error.responseData;
|
|
21
|
-
return getNetworkErrorDescription(data);
|
|
22
|
-
}
|
|
23
|
-
export function getNetworkErrorDescription(data) {
|
|
24
|
-
if (typeof data === "object" &&
|
|
25
|
-
data !== null &&
|
|
26
|
-
ERROR_DESCRIPTION_FIELD in data &&
|
|
27
|
-
typeof data[ERROR_DESCRIPTION_FIELD] === "string") {
|
|
28
|
-
return data[ERROR_DESCRIPTION_FIELD];
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
export function getNetworkErrorMessage(data) {
|
|
32
|
-
if (typeof data !== "object" || data === null) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
for (const key of ERROR_FIELDS) {
|
|
36
|
-
const value = data[key];
|
|
37
|
-
if (typeof value === "string") {
|
|
38
|
-
return value;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/ui-shared/utils/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAC/C,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAEpD,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;QAClC,OAAO,sBAAsB,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;IACpD,CAAC;IAED,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,OAAO,CAAC;IACvB,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;AACxD,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,KAAc;IAChD,IAAI,CAAC,CAAC,KAAK,YAAY,YAAY,CAAC,EAAE,CAAC;QACrC,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,YAAY,CAAC;IAEhC,OAAO,0BAA0B,CAAC,IAAI,CAAC,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,0BAA0B,CAAC,IAAa;IACtD,IACE,OAAO,IAAI,KAAK,QAAQ;QACxB,IAAI,KAAK,IAAI;QACb,uBAAuB,IAAI,IAAI;QAC/B,OAAO,IAAI,CAAC,uBAAuB,CAAC,KAAK,QAAQ,EACjD,CAAC;QACD,OAAO,IAAI,CAAC,uBAAuB,CAAC,CAAC;IACvC,CAAC;AACH,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,IAAa;IAClD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO;IACT,CAAC;IAED,KAAK,MAAM,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,MAAM,KAAK,GAAI,IAAgC,CAAC,GAAG,CAAC,CAAC;QAErD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YAC9B,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const generateId: () => number;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generateId.js","sourceRoot":"","sources":["../../src/ui-shared/utils/generateId.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Simplified version of https://github.com/react-hook-form/react-hook-form/blob/ea0f3ed86457691f79987a703ae8d50b9e16e2ad/src/logic/getRuleValue.ts#L10-L21
|
|
2
|
-
// TODO: Can be removed if https://github.com/react-hook-form/react-hook-form/issues/12178 is resolved
|
|
3
|
-
export function getRuleValue(rule) {
|
|
4
|
-
if (typeof rule === "undefined" || rule instanceof RegExp) {
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
if (typeof rule === "object") {
|
|
8
|
-
return rule.value;
|
|
9
|
-
}
|
|
10
|
-
return rule;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=getRuleValue.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRuleValue.js","sourceRoot":"","sources":["../../src/ui-shared/utils/getRuleValue.ts"],"names":[],"mappings":"AAEA,2JAA2J;AAC3J,sGAAsG;AACtG,MAAM,UAAU,YAAY,CAC1B,IAAwB;IAExB,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,IAAI,YAAY,MAAM,EAAE,CAAC;QAC1D,OAAO;IACT,CAAC;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isDefined<T>(value: T): value is NonNullable<T>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isDefined.js","sourceRoot":"","sources":["../../src/ui-shared/utils/isDefined.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,SAAS,CAAI,KAAQ;IACnC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC;AAC/C,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DependencyList } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Util function to only set the state when the component is still mounted.
|
|
4
|
-
*
|
|
5
|
-
* It takes 2 functions one you do your adminClient call in and the other to set your state
|
|
6
|
-
*
|
|
7
|
-
* @example
|
|
8
|
-
* useFetch(
|
|
9
|
-
* () => adminClient.components.findOne({ id }),
|
|
10
|
-
* (component) => setupForm(component),
|
|
11
|
-
* []
|
|
12
|
-
* );
|
|
13
|
-
*
|
|
14
|
-
* @param adminClientCall use this to do your adminClient call
|
|
15
|
-
* @param callback when the data is fetched this is where you set your state
|
|
16
|
-
*/
|
|
17
|
-
export declare function useFetch<T>(adminClientCall: () => Promise<T>, callback: (param: T) => void, deps?: DependencyList): void;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import { useErrorBoundary } from "../../ui-shared/utils/ErrorBoundary";
|
|
3
|
-
/**
|
|
4
|
-
* Util function to only set the state when the component is still mounted.
|
|
5
|
-
*
|
|
6
|
-
* It takes 2 functions one you do your adminClient call in and the other to set your state
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* useFetch(
|
|
10
|
-
* () => adminClient.components.findOne({ id }),
|
|
11
|
-
* (component) => setupForm(component),
|
|
12
|
-
* []
|
|
13
|
-
* );
|
|
14
|
-
*
|
|
15
|
-
* @param adminClientCall use this to do your adminClient call
|
|
16
|
-
* @param callback when the data is fetched this is where you set your state
|
|
17
|
-
*/
|
|
18
|
-
export function useFetch(adminClientCall, callback, deps) {
|
|
19
|
-
const { showBoundary } = useErrorBoundary();
|
|
20
|
-
useEffect(() => {
|
|
21
|
-
const controller = new AbortController();
|
|
22
|
-
const { signal } = controller;
|
|
23
|
-
adminClientCall()
|
|
24
|
-
.then((result) => {
|
|
25
|
-
if (!signal.aborted) {
|
|
26
|
-
callback(result);
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
.catch((error) => {
|
|
30
|
-
console.error(error);
|
|
31
|
-
if (!signal.aborted) {
|
|
32
|
-
showBoundary(error);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
return () => controller.abort();
|
|
36
|
-
}, deps);
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=useFetch.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useFetch.js","sourceRoot":"","sources":["../../src/ui-shared/utils/useFetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,OAAO,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gEAAgE,CAAC;AAElG;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,QAAQ,CACtB,eAAiC,EACjC,QAA4B,EAC5B,IAAqB;IAErB,MAAM,EAAE,YAAY,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAE5C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QAC9B,eAAe,EAAE;aACd,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACf,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;gBACpB,YAAY,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;QACH,CAAC,CAAC,CAAC;QAEL,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC,EAAE,IAAI,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Context } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Passes the call to `useContext` and throw an exception if the resolved value is either `null` or `undefined`.
|
|
4
|
-
* Can be used for contexts that are required and should always have a non nullable value.
|
|
5
|
-
*
|
|
6
|
-
* @param context The context to pass to `useContext`
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function useRequiredContext<T>(context: Context<T>): NonNullable<T>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { useContext } from "react";
|
|
2
|
-
import { isDefined } from "../../ui-shared/utils/isDefined";
|
|
3
|
-
/**
|
|
4
|
-
* Passes the call to `useContext` and throw an exception if the resolved value is either `null` or `undefined`.
|
|
5
|
-
* Can be used for contexts that are required and should always have a non nullable value.
|
|
6
|
-
*
|
|
7
|
-
* @param context The context to pass to `useContext`
|
|
8
|
-
* @returns
|
|
9
|
-
*/
|
|
10
|
-
export function useRequiredContext(context) {
|
|
11
|
-
const resolved = useContext(context);
|
|
12
|
-
if (isDefined(resolved)) {
|
|
13
|
-
return resolved;
|
|
14
|
-
}
|
|
15
|
-
throw new Error(`No provider found for ${context.displayName ? `the '${context.displayName}'` : "an unknown"} context, make sure it is included in your component hierarchy.`);
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=useRequiredContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRequiredContext.js","sourceRoot":"","sources":["../../src/ui-shared/utils/useRequiredContext.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,4DAA4D,CAAC;AAEvF;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAI,OAAmB;IACvD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;IAErC,IAAI,SAAS,CAAC,QAAQ,CAAC,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,MAAM,IAAI,KAAK,CACb,yBACE,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,OAAO,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,YACzD,iEAAiE,CAClE,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function useSetTimeout(): (callback: () => void, delay: number) => () => void;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef, useCallback } from "react";
|
|
2
|
-
export function useSetTimeout() {
|
|
3
|
-
const didUnmountRef = useRef(false);
|
|
4
|
-
const scheduledTimersRef = useRef(new Set());
|
|
5
|
-
useEffect(() => {
|
|
6
|
-
didUnmountRef.current = false;
|
|
7
|
-
return () => {
|
|
8
|
-
didUnmountRef.current = true;
|
|
9
|
-
clearAll();
|
|
10
|
-
};
|
|
11
|
-
}, []);
|
|
12
|
-
function clearAll() {
|
|
13
|
-
scheduledTimersRef.current.forEach((timer) => clearTimeout(timer));
|
|
14
|
-
scheduledTimersRef.current.clear();
|
|
15
|
-
}
|
|
16
|
-
return useCallback((callback, delay) => {
|
|
17
|
-
if (didUnmountRef.current) {
|
|
18
|
-
throw new Error("Can't schedule a timeout on an unmounted component.");
|
|
19
|
-
}
|
|
20
|
-
const timer = Number(setTimeout(handleCallback, delay));
|
|
21
|
-
scheduledTimersRef.current.add(timer);
|
|
22
|
-
function handleCallback() {
|
|
23
|
-
scheduledTimersRef.current.delete(timer);
|
|
24
|
-
callback();
|
|
25
|
-
}
|
|
26
|
-
return function cancelTimeout() {
|
|
27
|
-
clearTimeout(timer);
|
|
28
|
-
scheduledTimersRef.current.delete(timer);
|
|
29
|
-
};
|
|
30
|
-
}, []);
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=useSetTimeout.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSetTimeout.js","sourceRoot":"","sources":["../../src/ui-shared/utils/useSetTimeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEvD,MAAM,UAAU,aAAa;IAC3B,MAAM,aAAa,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACpC,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,GAAG,EAAU,CAAC,CAAC;IAErD,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,OAAO,GAAG,KAAK,CAAC;QAE9B,OAAO,GAAG,EAAE;YACV,aAAa,CAAC,OAAO,GAAG,IAAI,CAAC;YAC7B,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,QAAQ;QACf,kBAAkB,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;QACnE,kBAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,WAAW,CAAC,CAAC,QAAoB,EAAE,KAAa,EAAE,EAAE;QACzD,IAAI,aAAa,CAAC,OAAO,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;QACzE,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC,CAAC;QAExD,kBAAkB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QAEtC,SAAS,cAAc;YACrB,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACzC,QAAQ,EAAE,CAAC;QACb,CAAC;QAED,OAAO,SAAS,aAAa;YAC3B,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A hook that allows you to get a specific item stored by the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).
|
|
4
|
-
* Automatically updates the value when modified in the context of another document (such as an open tab) trough the [`storage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event) event.
|
|
5
|
-
*
|
|
6
|
-
* @param storageArea The storage area to target, must implement the [`Storage`](https://developer.mozilla.org/en-US/docs/Web/API/Storage) interface (such as [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) and [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)).
|
|
7
|
-
* @param keyName The key of the item to get from storage, same as passed to [`Storage.getItem()`](https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem)
|
|
8
|
-
* @param The default value to fall back to in case no stored value was retrieved.
|
|
9
|
-
*/
|
|
10
|
-
export declare function useStorageItem(storageArea: Storage, keyName: string, defaultValue: string): [string, Dispatch<string>];
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useState } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A hook that allows you to get a specific item stored by the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).
|
|
4
|
-
* Automatically updates the value when modified in the context of another document (such as an open tab) trough the [`storage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event) event.
|
|
5
|
-
*
|
|
6
|
-
* @param storageArea The storage area to target, must implement the [`Storage`](https://developer.mozilla.org/en-US/docs/Web/API/Storage) interface (such as [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) and [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)).
|
|
7
|
-
* @param keyName The key of the item to get from storage, same as passed to [`Storage.getItem()`](https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem)
|
|
8
|
-
* @param The default value to fall back to in case no stored value was retrieved.
|
|
9
|
-
*/
|
|
10
|
-
export function useStorageItem(storageArea, keyName, defaultValue) {
|
|
11
|
-
const [value, setInnerValue] = useState(() => { var _a; return (_a = storageArea.getItem(keyName)) !== null && _a !== void 0 ? _a : defaultValue; });
|
|
12
|
-
const setValue = useCallback((newValue) => {
|
|
13
|
-
setInnerValue(newValue);
|
|
14
|
-
storageArea.setItem(keyName, newValue);
|
|
15
|
-
}, []);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
var _a;
|
|
18
|
-
// If the key name or storage area has changed, we want to update the value.
|
|
19
|
-
// React will only set state if it actually changed, so no need to worry about re-renders.
|
|
20
|
-
setInnerValue((_a = storageArea.getItem(keyName)) !== null && _a !== void 0 ? _a : defaultValue);
|
|
21
|
-
// Subscribe to storage events so we can update the value when it is changed within the context of another document.
|
|
22
|
-
window.addEventListener("storage", handleStorage);
|
|
23
|
-
function handleStorage(event) {
|
|
24
|
-
var _a;
|
|
25
|
-
// If the affected storage area is different we can ignore this event.
|
|
26
|
-
// For example, if we're using session storage we're not interested in changes from local storage.
|
|
27
|
-
if (event.storageArea !== storageArea) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
// If the event key is null then it means all storage was cleared.
|
|
31
|
-
// Therefore we're interested in keys that are, or that match the key name.
|
|
32
|
-
if (event.key === null || event.key === keyName) {
|
|
33
|
-
setInnerValue((_a = event.newValue) !== null && _a !== void 0 ? _a : defaultValue);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return () => window.removeEventListener("storage", handleStorage);
|
|
37
|
-
}, [storageArea, keyName]);
|
|
38
|
-
return [value, setValue];
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=useStorageItem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useStorageItem.js","sourceRoot":"","sources":["../../src/ui-shared/utils/useStorageItem.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnE;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAC5B,WAAoB,EACpB,OAAe,EACf,YAAoB;IAEpB,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,GAAG,QAAQ,CACrC,GAAG,EAAE,WAAC,OAAA,MAAA,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,mCAAI,YAAY,CAAA,EAAA,CACnD,CAAC;IAEF,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,QAAgB,EAAE,EAAE;QAChD,aAAa,CAAC,QAAQ,CAAC,CAAC;QACxB,WAAW,CAAC,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,SAAS,CAAC,GAAG,EAAE;;QACb,4EAA4E;QAC5E,0FAA0F;QAC1F,aAAa,CAAC,MAAA,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,mCAAI,YAAY,CAAC,CAAC;QAE5D,oHAAoH;QACpH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAElD,SAAS,aAAa,CAAC,KAAmB;;YACxC,sEAAsE;YACtE,kGAAkG;YAClG,IAAI,KAAK,CAAC,WAAW,KAAK,WAAW,EAAE,CAAC;gBACtC,OAAO;YACT,CAAC;YAED,kEAAkE;YAClE,2EAA2E;YAC3E,IAAI,KAAK,CAAC,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;gBAChD,aAAa,CAAC,MAAA,KAAK,CAAC,QAAQ,mCAAI,YAAY,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAED,OAAO,GAAG,EAAE,CAAC,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACpE,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3B,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Dispatch } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* A hook that acts similarly to React's `useState()`, but persists the state using [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).
|
|
4
|
-
* Automatically updates the value when modified in the context of another document (such as an open tab) trough the [`storage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event) event.
|
|
5
|
-
*
|
|
6
|
-
* The value is serialized as [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) and therefore the value provided must be serializable as such.
|
|
7
|
-
* Because the value is always serialized it will never be referentially equal to originally provided value.
|
|
8
|
-
*
|
|
9
|
-
* @param storageArea The storage area to target, must implement the [`Storage`](https://developer.mozilla.org/en-US/docs/Web/API/Storage) interface (such as [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) and [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)).
|
|
10
|
-
* @param keyName The key of the item to get from storage, same as passed to [`Storage.getItem()`](https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem)
|
|
11
|
-
* @param defaultValue The default value to fall back to in case no stored value was retrieved (must be serializable as JSON).
|
|
12
|
-
*/
|
|
13
|
-
export declare function useStoredState<S>(storageArea: Storage, keyName: string, defaultValue: S): [S, Dispatch<S>];
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useCallback, useMemo } from "react";
|
|
2
|
-
import { useStorageItem } from "../../ui-shared/utils/useStorageItem";
|
|
3
|
-
/**
|
|
4
|
-
* A hook that acts similarly to React's `useState()`, but persists the state using [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API).
|
|
5
|
-
* Automatically updates the value when modified in the context of another document (such as an open tab) trough the [`storage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/storage_event) event.
|
|
6
|
-
*
|
|
7
|
-
* The value is serialized as [JSON](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON) and therefore the value provided must be serializable as such.
|
|
8
|
-
* Because the value is always serialized it will never be referentially equal to originally provided value.
|
|
9
|
-
*
|
|
10
|
-
* @param storageArea The storage area to target, must implement the [`Storage`](https://developer.mozilla.org/en-US/docs/Web/API/Storage) interface (such as [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) and [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage)).
|
|
11
|
-
* @param keyName The key of the item to get from storage, same as passed to [`Storage.getItem()`](https://developer.mozilla.org/en-US/docs/Web/API/Storage/getItem)
|
|
12
|
-
* @param defaultValue The default value to fall back to in case no stored value was retrieved (must be serializable as JSON).
|
|
13
|
-
*/
|
|
14
|
-
export function useStoredState(storageArea, keyName, defaultValue) {
|
|
15
|
-
const defaultValueSerialized = useMemo(() => JSON.stringify(defaultValue), [defaultValue]);
|
|
16
|
-
const [storedValue, setStoredValue] = useStorageItem(storageArea, keyName, defaultValueSerialized);
|
|
17
|
-
const value = useMemo(() => JSON.parse(storedValue), [storedValue]);
|
|
18
|
-
const setValue = useCallback((value) => setStoredValue(JSON.stringify(value)), []);
|
|
19
|
-
return [value, setValue];
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=useStoredState.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useStoredState.js","sourceRoot":"","sources":["../../src/ui-shared/utils/useStoredState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,iEAAiE,CAAC;AAEjG;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAC5B,WAAoB,EACpB,OAAe,EACf,YAAe;IAEf,MAAM,sBAAsB,GAAG,OAAO,CACpC,GAAG,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAClC,CAAC,YAAY,CAAC,CACf,CAAC;IAEF,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,cAAc,CAClD,WAAW,EACX,OAAO,EACP,sBAAsB,CACvB,CAAC;IAEF,MAAM,KAAK,GAAG,OAAO,CAAI,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAG,WAAW,CAC1B,CAAC,KAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EACnD,EAAE,CACH,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC3B,CAAC"}
|
package/utils/formatDate.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const FORMAT_DATE_ONLY: Intl.DateTimeFormatOptions;
|
|
2
|
-
export declare const FORMAT_TIME_ONLY: Intl.DateTimeFormatOptions;
|
|
3
|
-
export declare const FORMAT_DATE_AND_TIME: Intl.DateTimeFormatOptions;
|
|
4
|
-
export declare function formatDate(date: Date, options?: Intl.DateTimeFormatOptions): string;
|
package/utils/formatDate.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { getI18n } from "react-i18next";
|
|
2
|
-
export const FORMAT_DATE_ONLY = {
|
|
3
|
-
dateStyle: "long",
|
|
4
|
-
};
|
|
5
|
-
export const FORMAT_TIME_ONLY = {
|
|
6
|
-
timeStyle: "short",
|
|
7
|
-
};
|
|
8
|
-
export const FORMAT_DATE_AND_TIME = Object.assign(Object.assign({}, FORMAT_DATE_ONLY), FORMAT_TIME_ONLY);
|
|
9
|
-
export function formatDate(date, options = FORMAT_DATE_AND_TIME) {
|
|
10
|
-
return date.toLocaleString(getI18n().languages, options);
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=formatDate.js.map
|
package/utils/formatDate.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formatDate.js","sourceRoot":"","sources":["../src/utils/formatDate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAGxC,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,SAAS,EAAE,MAAM;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAA+B;IAC1D,SAAS,EAAE,OAAO;CACnB,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,mCAC5B,gBAAgB,GAChB,gBAAgB,CACpB,CAAC;AAEF,MAAM,UAAU,UAAU,CAAC,IAAU,EAAE,OAAO,GAAG,oBAAoB;IACnE,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;AAC3D,CAAC"}
|
package/utils/joinPath.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function joinPath(...paths: string[]): string;
|
package/utils/joinPath.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
const PATH_SEPARATOR = "/";
|
|
2
|
-
export function joinPath(...paths) {
|
|
3
|
-
const normalizedPaths = paths.map((path, index) => {
|
|
4
|
-
const isFirst = index === 0;
|
|
5
|
-
const isLast = index === paths.length - 1;
|
|
6
|
-
// Strip out any leading slashes from the path.
|
|
7
|
-
if (!isFirst && path.startsWith(PATH_SEPARATOR)) {
|
|
8
|
-
path = path.slice(1);
|
|
9
|
-
}
|
|
10
|
-
// Strip out any trailing slashes from the path.
|
|
11
|
-
if (!isLast && path.endsWith(PATH_SEPARATOR)) {
|
|
12
|
-
path = path.slice(0, -1);
|
|
13
|
-
}
|
|
14
|
-
return path;
|
|
15
|
-
}, []);
|
|
16
|
-
return normalizedPaths.join(PATH_SEPARATOR);
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=joinPath.js.map
|
package/utils/joinPath.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"joinPath.js","sourceRoot":"","sources":["../src/utils/joinPath.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,GAAG,CAAC;AAE3B,MAAM,UAAU,QAAQ,CAAC,GAAG,KAAe;IACzC,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE;QAChD,MAAM,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC;QAC5B,MAAM,MAAM,GAAG,KAAK,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;QAE1C,+CAA+C;QAC/C,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,CAAC;YAChD,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;QAED,gDAAgD;QAChD,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YAC7C,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,eAAe,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { useAlerts } from "../ui-shared";
|
|
2
|
-
import { AlertVariant } from "@patternfly/react-core";
|
|
3
|
-
import { useCallback, useMemo } from "react";
|
|
4
|
-
import { useTranslation } from "react-i18next";
|
|
5
|
-
import { ApiError } from "../api/parse-response";
|
|
6
|
-
export function useAccountAlerts() {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
const { addAlert, addError } = useAlerts();
|
|
9
|
-
const addAccountError = useCallback((messageKey, error) => {
|
|
10
|
-
if (!(error instanceof ApiError)) {
|
|
11
|
-
addError(messageKey, error);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const message = t(messageKey, { error: error.message });
|
|
15
|
-
addAlert(message, AlertVariant.danger, error.description);
|
|
16
|
-
}, [addAlert, addError, t]);
|
|
17
|
-
return useMemo(() => ({ addAlert, addError: addAccountError }), [addAccountError, addAlert]);
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=useAccountAlerts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountAlerts.js","sourceRoot":"","sources":["../src/utils/useAccountAlerts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,4CAA4C,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,QAAQ,EAAE,MAAM,qDAAqD,CAAC;AAE/E,MAAM,UAAU,gBAAgB;IAC9B,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,CAAC;IAC3C,MAAM,eAAe,GAAG,WAAW,CACjC,CAAC,UAAkB,EAAE,KAAc,EAAE,EAAE;QACrC,IAAI,CAAC,CAAC,KAAK,YAAY,QAAQ,CAAC,EAAE,CAAC;YACjC,QAAQ,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,MAAM,OAAO,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACxD,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,EACD,CAAC,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,CACxB,CAAC;IAEF,OAAO,OAAO,CACZ,GAAG,EAAE,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAC/C,CAAC,eAAe,EAAE,QAAQ,CAAC,CAC5B,CAAC;AACJ,CAAC"}
|
package/utils/usePromise.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import type { DependencyList } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Function that creates a Promise. Receives an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)
|
|
4
|
-
* which is aborted when the component unmounts, or the dependencies of the hook have changed.
|
|
5
|
-
*/
|
|
6
|
-
export type PromiseFactoryFn<T> = (signal: AbortSignal) => Promise<T>;
|
|
7
|
-
/**
|
|
8
|
-
* Function which is called with the value of the Promise when it resolves.
|
|
9
|
-
*/
|
|
10
|
-
export type PromiseResolvedFn<T> = (value: T) => void;
|
|
11
|
-
/**
|
|
12
|
-
* Takes a function that creates a Promise and returns its resolved result through a callback.
|
|
13
|
-
*
|
|
14
|
-
* ```ts
|
|
15
|
-
* const [products, setProducts] = useState();
|
|
16
|
-
*
|
|
17
|
-
* function getProducts() {
|
|
18
|
-
* return fetch('/api/products').then((res) => res.json());
|
|
19
|
-
* }
|
|
20
|
-
*
|
|
21
|
-
* usePromise(() => getProducts(), setProducts);
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* Also takes a list of dependencies, when the dependencies change the Promise is recreated.
|
|
25
|
-
*
|
|
26
|
-
* ```ts
|
|
27
|
-
* usePromise(() => getProduct(id), setProduct, [id]);
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* Can abort a fetch request, an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) is provided from the factory function to do so.
|
|
31
|
-
* This signal will be aborted if the component unmounts, or if the dependencies of the hook have changed.
|
|
32
|
-
*
|
|
33
|
-
* ```ts
|
|
34
|
-
* usePromise((signal) => fetch(`/api/products/${id}`, { signal }).then((res) => res.json()), setProduct, [id]);
|
|
35
|
-
* ```
|
|
36
|
-
*
|
|
37
|
-
* @param factory Function that creates the Promise.
|
|
38
|
-
* @param callback Function that gets called with the value of the Promise when it resolves.
|
|
39
|
-
* @param deps If present, Promise will be recreated if the values in the list change.
|
|
40
|
-
*/
|
|
41
|
-
export declare function usePromise<T>(factory: PromiseFactoryFn<T>, callback: PromiseResolvedFn<T>, deps?: DependencyList): void;
|
package/utils/usePromise.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
/**
|
|
3
|
-
* Takes a function that creates a Promise and returns its resolved result through a callback.
|
|
4
|
-
*
|
|
5
|
-
* ```ts
|
|
6
|
-
* const [products, setProducts] = useState();
|
|
7
|
-
*
|
|
8
|
-
* function getProducts() {
|
|
9
|
-
* return fetch('/api/products').then((res) => res.json());
|
|
10
|
-
* }
|
|
11
|
-
*
|
|
12
|
-
* usePromise(() => getProducts(), setProducts);
|
|
13
|
-
* ```
|
|
14
|
-
*
|
|
15
|
-
* Also takes a list of dependencies, when the dependencies change the Promise is recreated.
|
|
16
|
-
*
|
|
17
|
-
* ```ts
|
|
18
|
-
* usePromise(() => getProduct(id), setProduct, [id]);
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* Can abort a fetch request, an [AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal) is provided from the factory function to do so.
|
|
22
|
-
* This signal will be aborted if the component unmounts, or if the dependencies of the hook have changed.
|
|
23
|
-
*
|
|
24
|
-
* ```ts
|
|
25
|
-
* usePromise((signal) => fetch(`/api/products/${id}`, { signal }).then((res) => res.json()), setProduct, [id]);
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* @param factory Function that creates the Promise.
|
|
29
|
-
* @param callback Function that gets called with the value of the Promise when it resolves.
|
|
30
|
-
* @param deps If present, Promise will be recreated if the values in the list change.
|
|
31
|
-
*/
|
|
32
|
-
export function usePromise(factory, callback, deps = []) {
|
|
33
|
-
const [error, setError] = useState();
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
const controller = new AbortController();
|
|
36
|
-
const { signal } = controller;
|
|
37
|
-
async function handlePromise() {
|
|
38
|
-
// Try to resolve the Promise, if it fails, check if it was aborted.
|
|
39
|
-
try {
|
|
40
|
-
callback(await factory(signal));
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
// Ignore errors caused by aborting the Promise.
|
|
44
|
-
if (error instanceof Error && error.name === "AbortError") {
|
|
45
|
-
return;
|
|
46
|
-
}
|
|
47
|
-
setError(error);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
handlePromise();
|
|
51
|
-
// Abort the Promise when the component unmounts, or the dependencies change.
|
|
52
|
-
return () => controller.abort();
|
|
53
|
-
}, deps);
|
|
54
|
-
// Rethrow other errors.
|
|
55
|
-
if (error) {
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
//# sourceMappingURL=usePromise.js.map
|
package/utils/usePromise.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"usePromise.js","sourceRoot":"","sources":["../src/utils/usePromise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAa5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,UAAU,CACxB,OAA4B,EAC5B,QAA8B,EAC9B,OAAuB,EAAE;IAEzB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,EAAW,CAAC;IAC9C,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;QAE9B,KAAK,UAAU,aAAa;YAC1B,oEAAoE;YACpE,IAAI,CAAC;gBACH,QAAQ,CAAC,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;YAClC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,gDAAgD;gBAChD,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,YAAY,EAAE,CAAC;oBAC1D,OAAO;gBACT,CAAC;gBAED,QAAQ,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;QACH,CAAC;QAED,aAAa,EAAE,CAAC;QAEhB,6EAA6E;QAC7E,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAClC,CAAC,EAAE,IAAI,CAAC,CAAC;IAET,wBAAwB;IACxB,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
File without changes
|
|
File without changes
|