@os-team/profile 1.1.13 → 1.1.15
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/dist/cjs/components/profile/ProfileButton.js +4 -6
- package/dist/cjs/components/profile/ProfileButton.js.map +1 -1
- package/dist/cjs/components/profile/ProfileConfigContext.js +5 -7
- package/dist/cjs/components/profile/ProfileConfigContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileContext.js +5 -7
- package/dist/cjs/components/profile/ProfileContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawer.js +10 -16
- package/dist/cjs/components/profile/ProfileDrawer.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawerContent.js +73 -103
- package/dist/cjs/components/profile/ProfileDrawerContent.js.map +1 -1
- package/dist/cjs/components/profile/ProfileNavigationItem.js +10 -11
- package/dist/cjs/components/profile/ProfileNavigationItem.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js +43 -54
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js +42 -52
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/cjs/components/profile/ProtectedWrapper.js +27 -27
- package/dist/cjs/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatar.js +16 -15
- package/dist/cjs/components/profile/UserAvatar.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatarAddon.js +13 -23
- package/dist/cjs/components/profile/UserAvatarAddon.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js +1 -2
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js +1 -2
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +1 -2
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js +1 -2
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +1 -2
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawer.js +11 -15
- package/dist/cjs/components/session/SessionDrawer.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawerContent.js +13 -14
- package/dist/cjs/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/cjs/components/session/SessionList.js +31 -55
- package/dist/cjs/components/session/SessionList.js.map +1 -1
- package/dist/cjs/components/session/SessionListItem.js +59 -106
- package/dist/cjs/components/session/SessionListItem.js.map +1 -1
- package/dist/cjs/components/session/SessionListSkeleton.js +8 -9
- package/dist/cjs/components/session/SessionListSkeleton.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js +1 -1
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js +1 -2
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js +1 -2
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js +1 -1
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionList_sessions.graphql.js +1 -1
- package/dist/cjs/components/session/__generated__/SessionList_sessions.graphql.js.map +1 -1
- package/dist/cjs/components/session/formatDate.js +6 -6
- package/dist/cjs/components/session/formatDate.js.map +1 -1
- package/dist/cjs/components/session/getLastSeen.js +6 -6
- package/dist/cjs/components/session/getLastSeen.js.map +1 -1
- package/dist/cjs/components/shared/ButtonUpdate.js +4 -3
- package/dist/cjs/components/shared/ButtonUpdate.js.map +1 -1
- package/dist/cjs/components/shared/ErrorResult.js +8 -5
- package/dist/cjs/components/shared/ErrorResult.js.map +1 -1
- package/dist/cjs/components/shared/FormError.js +5 -4
- package/dist/cjs/components/shared/FormError.js.map +1 -1
- package/dist/cjs/components/shared/MainLoader.js +2 -6
- package/dist/cjs/components/shared/MainLoader.js.map +1 -1
- package/dist/cjs/components/shared/icons/AndroidIcon.js +5 -7
- package/dist/cjs/components/shared/icons/AndroidIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/AppleIcon.js +5 -7
- package/dist/cjs/components/shared/icons/AppleIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/BrowserIcon.js +5 -7
- package/dist/cjs/components/shared/icons/BrowserIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/ProfileIcon.js +5 -7
- package/dist/cjs/components/shared/icons/ProfileIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js +5 -7
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js.map +1 -1
- package/dist/cjs/index.js +16 -17
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/getErrorMessage.js +13 -13
- package/dist/cjs/utils/getErrorMessage.js.map +1 -1
- package/dist/cjs/utils/getUserFullName.js +7 -5
- package/dist/cjs/utils/getUserFullName.js.map +1 -1
- package/dist/cjs/utils/handleFormErrors.js +11 -16
- package/dist/cjs/utils/handleFormErrors.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js +0 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js +0 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js +0 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js +0 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js +0 -1
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js +0 -1
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js +0 -1
- package/dist/esm/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/esm/utils/getUserFullName.js.map +1 -1
- package/dist/types/components/profile/ProfileButton.d.ts.map +1 -0
- package/dist/types/components/profile/ProfileConfigContext.d.ts.map +1 -0
- package/dist/types/components/profile/ProfileContext.d.ts.map +1 -0
- package/dist/types/components/profile/ProfileDrawer.d.ts.map +1 -0
- package/dist/types/components/profile/ProfileDrawerContent.d.ts.map +1 -0
- package/dist/types/components/profile/ProfileNavigationItem.d.ts.map +1 -0
- package/dist/types/components/profile/ProfileUpdateNameModal.d.ts.map +1 -0
- package/dist/types/components/profile/ProfileUpdatePasswordModal.d.ts.map +1 -0
- package/dist/types/components/profile/ProtectedWrapper.d.ts.map +1 -0
- package/dist/types/components/profile/UserAvatar.d.ts.map +1 -0
- package/dist/types/components/profile/UserAvatarAddon.d.ts.map +1 -0
- package/dist/types/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts.map +1 -0
- package/dist/types/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts.map +1 -0
- package/dist/types/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts.map +1 -0
- package/dist/types/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts.map +1 -0
- package/dist/types/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts.map +1 -0
- package/dist/types/components/session/SessionDrawer.d.ts.map +1 -0
- package/dist/types/components/session/SessionDrawerContent.d.ts.map +1 -0
- package/dist/types/{src/lib/components → components}/session/SessionList.d.ts +2 -2
- package/dist/types/components/session/SessionList.d.ts.map +1 -0
- package/dist/types/{src/lib/components → components}/session/SessionListItem.d.ts +4 -4
- package/dist/types/components/session/SessionListItem.d.ts.map +1 -0
- package/dist/types/components/session/SessionListSkeleton.d.ts.map +1 -0
- package/dist/types/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts.map +1 -0
- package/dist/types/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts.map +1 -0
- package/dist/types/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts.map +1 -0
- package/dist/types/components/session/__generated__/SessionListItem_session.graphql.d.ts.map +1 -0
- package/dist/types/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts.map +1 -0
- package/dist/types/components/session/__generated__/SessionList_sessions.graphql.d.ts.map +1 -0
- package/dist/types/components/session/formatDate.d.ts.map +1 -0
- package/dist/types/components/session/getLastSeen.d.ts.map +1 -0
- package/dist/types/components/shared/ButtonUpdate.d.ts.map +1 -0
- package/dist/types/components/shared/ErrorResult.d.ts.map +1 -0
- package/dist/types/components/shared/FormError.d.ts.map +1 -0
- package/dist/types/components/shared/MainLoader.d.ts.map +1 -0
- package/dist/types/components/shared/icons/AndroidIcon.d.ts.map +1 -0
- package/dist/types/components/shared/icons/AppleIcon.d.ts.map +1 -0
- package/dist/types/components/shared/icons/BrowserIcon.d.ts.map +1 -0
- package/dist/types/components/shared/icons/ProfileIcon.d.ts.map +1 -0
- package/dist/types/components/shared/icons/UnknownDeviceIcon.d.ts.map +1 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/utils/getErrorMessage.d.ts.map +1 -0
- package/dist/types/{src/lib/utils → utils}/getUserFullName.d.ts +2 -2
- package/dist/types/utils/getUserFullName.d.ts.map +1 -0
- package/dist/types/utils/handleFormErrors.d.ts.map +1 -0
- package/package.json +41 -41
- package/dist/types/src/lib/components/profile/ProfileButton.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProfileConfigContext.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProfileContext.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProfileDrawer.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProfileDrawerContent.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProfileNavigationItem.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProfileUpdateNameModal.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProfileUpdatePasswordModal.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/ProtectedWrapper.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/UserAvatar.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/UserAvatarAddon.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/SessionDrawer.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/SessionDrawerContent.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/SessionList.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/SessionListItem.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/SessionListSkeleton.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/__generated__/SessionDrawerContentQuery.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListItem_session.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/__generated__/SessionListRefetchQuery.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/__generated__/SessionList_sessions.graphql.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/formatDate.d.ts.map +0 -1
- package/dist/types/src/lib/components/session/getLastSeen.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/ButtonUpdate.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/ErrorResult.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/FormError.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/MainLoader.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/icons/AndroidIcon.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/icons/AppleIcon.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/icons/BrowserIcon.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/icons/ProfileIcon.d.ts.map +0 -1
- package/dist/types/src/lib/components/shared/icons/UnknownDeviceIcon.d.ts.map +0 -1
- package/dist/types/src/lib/index.d.ts.map +0 -1
- package/dist/types/src/lib/utils/getErrorMessage.d.ts.map +0 -1
- package/dist/types/src/lib/utils/getUserFullName.d.ts.map +0 -1
- package/dist/types/src/lib/utils/handleFormErrors.d.ts.map +0 -1
- /package/dist/types/{src/lib/components → components}/profile/ProfileButton.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProfileConfigContext.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProfileContext.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProfileDrawer.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProfileDrawerContent.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProfileNavigationItem.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProfileUpdateNameModal.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProfileUpdatePasswordModal.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/ProtectedWrapper.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/UserAvatar.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/UserAvatarAddon.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/__generated__/ProfileUpdateNameModalMutation.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/profile/__generated__/ProtectedWrapperQuery.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/SessionDrawer.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/SessionDrawerContent.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/SessionListSkeleton.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/__generated__/SessionDrawerContentQuery.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/__generated__/SessionListItemDestroySessionMutation.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/__generated__/SessionListItem_session.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/__generated__/SessionListRefetchQuery.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/__generated__/SessionList_sessions.graphql.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/formatDate.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/session/getLastSeen.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/ButtonUpdate.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/ErrorResult.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/FormError.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/MainLoader.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/icons/AndroidIcon.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/icons/AppleIcon.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/icons/BrowserIcon.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/icons/ProfileIcon.d.ts +0 -0
- /package/dist/types/{src/lib/components → components}/shared/icons/UnknownDeviceIcon.d.ts +0 -0
- /package/dist/types/{src/lib/index.d.ts → index.d.ts} +0 -0
- /package/dist/types/{src/lib/utils → utils}/getErrorMessage.d.ts +0 -0
- /package/dist/types/{src/lib/utils → utils}/handleFormErrors.d.ts +0 -0
|
@@ -8,11 +8,9 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _core = require("@os-design/core");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}, props));
|
|
16
|
-
};
|
|
11
|
+
const ProfileButton = props => /*#__PURE__*/_react.default.createElement(_core.Button, _extends({
|
|
12
|
+
type: "ghost",
|
|
13
|
+
wide: "always"
|
|
14
|
+
}, props));
|
|
17
15
|
var _default = exports.default = ProfileButton;
|
|
18
16
|
//# sourceMappingURL=ProfileButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileButton.js","names":["_react","_interopRequireDefault","require","_core","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ProfileButton","props","createElement","Button","type","wide","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, ButtonProps } from '@os-design/core';\n\nconst ProfileButton: React.FC<ButtonProps> = (props) => (\n <Button type='ghost' wide='always' {...props} />\n);\n\nexport default ProfileButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAsD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAEtD,
|
|
1
|
+
{"version":3,"file":"ProfileButton.js","names":["_react","_interopRequireDefault","require","_core","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","ProfileButton","props","createElement","Button","type","wide","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileButton.tsx"],"sourcesContent":["import React from 'react';\nimport { Button, ButtonProps } from '@os-design/core';\n\nconst ProfileButton: React.FC<ButtonProps> = (props) => (\n <Button type='ghost' wide='always' {...props} />\n);\n\nexport default ProfileButton;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAAsD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAAAJ,QAAA,CAAAa,KAAA,OAAAP,SAAA;AAEtD,MAAMQ,aAAoC,GAAIC,KAAK,iBACjDtB,MAAA,CAAAM,OAAA,CAAAiB,aAAA,CAACpB,KAAA,CAAAqB,MAAM,EAAAjB,QAAA;EAACkB,IAAI,EAAC,OAAO;EAACC,IAAI,EAAC;AAAQ,GAAKJ,KAAK,CAAG,CAChD;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GAEae,aAAa"}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.useProfileConfig = exports.default = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
11
|
-
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const ProfileConfig = /*#__PURE__*/_react.default.createContext({
|
|
12
11
|
bucketId: ''
|
|
13
12
|
});
|
|
14
13
|
ProfileConfig.displayName = 'ProfileConfig';
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
14
|
+
const useProfileConfig = () => (0, _react.useContext)(ProfileConfig);
|
|
15
|
+
exports.useProfileConfig = useProfileConfig;
|
|
18
16
|
var _default = exports.default = ProfileConfig;
|
|
19
17
|
//# sourceMappingURL=ProfileConfigContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileConfigContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","
|
|
1
|
+
{"version":3,"file":"ProfileConfigContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ProfileConfig","React","createContext","bucketId","displayName","useProfileConfig","useContext","exports","_default"],"sources":["../../../../src/lib/components/profile/ProfileConfigContext.ts"],"sourcesContent":["import React, { useContext } from 'react';\n\nexport interface ProfileConfigProps {\n bucketId: string;\n}\n\nconst ProfileConfig = React.createContext<ProfileConfigProps>({\n bucketId: '',\n});\n\nProfileConfig.displayName = 'ProfileConfig';\n\nexport const useProfileConfig = (): ProfileConfigProps =>\n useContext(ProfileConfig);\n\nexport default ProfileConfig;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAM1C,MAAMY,aAAa,gBAAGC,cAAK,CAACC,aAAa,CAAqB;EAC5DC,QAAQ,EAAE;AACZ,CAAC,CAAC;AAEFH,aAAa,CAACI,WAAW,GAAG,eAAe;AAEpC,MAAMC,gBAAgB,GAAGA,CAAA,KAC9B,IAAAC,iBAAU,EAACN,aAAa,CAAC;AAACO,OAAA,CAAAF,gBAAA,GAAAA,gBAAA;AAAA,IAAAG,QAAA,GAAAD,OAAA,CAAAtB,OAAA,GAEbe,aAAa"}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.useProfile = exports.default = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
10
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
11
|
-
|
|
8
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
9
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
10
|
+
const ProfileContext = /*#__PURE__*/_react.default.createContext({
|
|
12
11
|
id: '',
|
|
13
12
|
email: ''
|
|
14
13
|
});
|
|
15
14
|
ProfileContext.displayName = 'ProfileContext';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
15
|
+
const useProfile = () => (0, _react.useContext)(ProfileContext);
|
|
16
|
+
exports.useProfile = useProfile;
|
|
19
17
|
var _default = exports.default = ProfileContext;
|
|
20
18
|
//# sourceMappingURL=ProfileContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","
|
|
1
|
+
{"version":3,"file":"ProfileContext.js","names":["_react","_interopRequireWildcard","require","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","ProfileContext","React","createContext","id","email","displayName","useProfile","useContext","exports","_default"],"sources":["../../../../src/lib/components/profile/ProfileContext.ts"],"sourcesContent":["import React, { useContext } from 'react';\n\nexport interface ProfileContextProps {\n id: string;\n email: string;\n firstName?: string;\n lastName?: string;\n avatar?: string;\n}\n\nconst ProfileContext = React.createContext<ProfileContextProps>({\n id: '',\n email: '',\n});\n\nProfileContext.displayName = 'ProfileContext';\n\nexport const useProfile = (): ProfileContextProps => useContext(ProfileContext);\n\nexport default ProfileContext;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA0C,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAQ,CAAA,GAAAA,CAAA;AAU1C,MAAMY,cAAc,gBAAGC,cAAK,CAACC,aAAa,CAAsB;EAC9DC,EAAE,EAAE,EAAE;EACNC,KAAK,EAAE;AACT,CAAC,CAAC;AAEFJ,cAAc,CAACK,WAAW,GAAG,gBAAgB;AAEtC,MAAMC,UAAU,GAAGA,CAAA,KAA2B,IAAAC,iBAAU,EAACP,cAAc,CAAC;AAACQ,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAAA,IAAAG,QAAA,GAAAD,OAAA,CAAAvB,OAAA,GAEjEe,cAAc"}
|
|
@@ -8,26 +8,20 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _core = require("@os-design/core");
|
|
9
9
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
10
10
|
var _MainLoader = _interopRequireDefault(require("../shared/MainLoader"));
|
|
11
|
-
var _excluded = ["actions", "children"];
|
|
12
11
|
var _templateObject;
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
15
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
16
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
17
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
18
14
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
20
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
children = _ref.children,
|
|
30
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
const LazyProfileDrawerContent = /*#__PURE__*/(0, _react.lazy)(() => Promise.resolve().then(() => _interopRequireWildcard(require('./ProfileDrawerContent'))));
|
|
18
|
+
const StyledDrawer = (0, _styled.default)(_core.Drawer)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n padding: 2em 1em;\n"])));
|
|
19
|
+
const ProfileDrawer = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
actions,
|
|
22
|
+
children,
|
|
23
|
+
...rest
|
|
24
|
+
} = _ref;
|
|
31
25
|
return /*#__PURE__*/_react.default.createElement(StyledDrawer, _extends({
|
|
32
26
|
placement: "right",
|
|
33
27
|
width: "15em"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawer.js","names":["_react","_interopRequireWildcard","require","_core","_styled","_interopRequireDefault","_MainLoader","
|
|
1
|
+
{"version":3,"file":"ProfileDrawer.js","names":["_react","_interopRequireWildcard","require","_core","_styled","_interopRequireDefault","_MainLoader","_templateObject","obj","__esModule","default","_extends","Object","assign","bind","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","_taggedTemplateLiteral","strings","raw","slice","freeze","defineProperties","value","_getRequireWildcardCache","e","WeakMap","r","t","has","get","n","__proto__","a","defineProperty","getOwnPropertyDescriptor","u","set","LazyProfileDrawerContent","lazy","Promise","resolve","then","StyledDrawer","styled","Drawer","ProfileDrawer","_ref","actions","children","rest","createElement","placement","width","Suspense","fallback","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileDrawer.tsx"],"sourcesContent":["import React, { lazy, Suspense } from 'react';\nimport { Drawer, DrawerProps } from '@os-design/core';\nimport styled from '@emotion/styled';\nimport { ProfileDrawerContentProps } from './ProfileDrawerContent';\nimport MainLoader from '../shared/MainLoader';\n\nconst LazyProfileDrawerContent = lazy(() => import('./ProfileDrawerContent'));\n\nexport type ProfileDrawerProps = ProfileDrawerContentProps & DrawerProps;\n\nconst StyledDrawer = styled(Drawer)`\n display: flex;\n flex-direction: column;\n padding: 2em 1em;\n`;\n\nconst ProfileDrawer: React.FC<ProfileDrawerProps> = ({\n actions,\n children,\n ...rest\n}) => (\n <StyledDrawer placement='right' width='15em' {...rest}>\n <Suspense fallback={<MainLoader />}>\n <LazyProfileDrawerContent actions={actions}>\n {children}\n </LazyProfileDrawerContent>\n </Suspense>\n </StyledDrawer>\n);\n\nexport default ProfileDrawer;\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAD,sBAAA,CAAAH,OAAA;AAA8C,IAAAK,eAAA;AAAA,SAAAF,uBAAAG,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAAA,SAAAG,SAAA,IAAAA,QAAA,GAAAC,MAAA,CAAAC,MAAA,GAAAD,MAAA,CAAAC,MAAA,CAAAC,IAAA,eAAAC,MAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAF,CAAA,UAAAG,MAAA,GAAAF,SAAA,CAAAD,CAAA,YAAAI,GAAA,IAAAD,MAAA,QAAAP,MAAA,CAAAS,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAJ,MAAA,EAAAC,GAAA,KAAAL,MAAA,CAAAK,GAAA,IAAAD,MAAA,CAAAC,GAAA,gBAAAL,MAAA,YAA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CAAA,CAAAK,CAAA,IAAAX,CAAA,CAAAW,CAAA,YAAAL,CAAA,CAAA7B,OAAA,GAAAuB,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAS,GAAA,CAAAZ,CAAA,EAAAM,CAAA,GAAAA,CAAA;AAE9C,MAAMO,wBAAwB,gBAAG,IAAAC,WAAI,EAAC,MAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAAjD,uBAAA,CAAAC,OAAA,CAAa,wBAAwB,GAAC,CAAC;AAI7E,MAAMiD,YAAY,GAAG,IAAAC,eAAM,EAACC,YAAM,CAAC,CAAA9C,eAAA,KAAAA,eAAA,GAAAkB,sBAAA,4EAIlC;AAED,MAAM6B,aAA2C,GAAGC,IAAA;EAAA,IAAC;IACnDC,OAAO;IACPC,QAAQ;IACR,GAAGC;EACL,CAAC,GAAAH,IAAA;EAAA,oBACCvD,MAAA,CAAAU,OAAA,CAAAiD,aAAA,CAACR,YAAY,EAAAxC,QAAA;IAACiD,SAAS,EAAC,OAAO;IAACC,KAAK,EAAC;EAAM,GAAKH,IAAI,gBACnD1D,MAAA,CAAAU,OAAA,CAAAiD,aAAA,CAAC3D,MAAA,CAAA8D,QAAQ;IAACC,QAAQ,eAAE/D,MAAA,CAAAU,OAAA,CAAAiD,aAAA,CAACrD,WAAA,CAAAI,OAAU,MAAE;EAAE,gBACjCV,MAAA,CAAAU,OAAA,CAAAiD,aAAA,CAACb,wBAAwB;IAACU,OAAO,EAAEA;EAAQ,GACxCC,QACuB,CAClB,CACE,CAAC;AAAA,CAChB;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAvD,OAAA,GAEa4C,aAAa"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -18,46 +17,32 @@ var _ProfileUpdateNameModal = _interopRequireDefault(require("./ProfileUpdateNam
|
|
|
18
17
|
var _ProfileUpdatePasswordModal = _interopRequireDefault(require("./ProfileUpdatePasswordModal"));
|
|
19
18
|
var _UserAvatar = _interopRequireDefault(require("./UserAvatar"));
|
|
20
19
|
var _ProfileDrawerContentUpdateAvatarMutation, _ProfileDrawerContentSignOutMutation, _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
21
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
20
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
21
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
25
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
28
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
29
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
30
23
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
t = _useTranslation.t;
|
|
46
|
-
var _useMutation = (0, _hooks.useMutation)(query),
|
|
47
|
-
_useMutation2 = _slicedToArray(_useMutation, 2),
|
|
48
|
-
commit = _useMutation2[0],
|
|
49
|
-
loading = _useMutation2[1];
|
|
50
|
-
var handler = (0, _react.useCallback)(function () {
|
|
24
|
+
const AvatarContainer = _styled.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n"])));
|
|
25
|
+
const UserContent = _styled.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n margin-top: 1em;\n"])));
|
|
26
|
+
const FullName = _styled.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n font-size: ", "em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n"])), p => p.theme.sizes.large);
|
|
27
|
+
const Email = _styled.default.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n margin-top: 0.2em;\n text-align: center;\n"])), p => (0, _theming.clr)(p.theme.inputColorPlaceholder));
|
|
28
|
+
const ActionsContainer = _styled.default.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n margin-top: 1.5em;\n"])));
|
|
29
|
+
const Footer = _styled.default.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n"])));
|
|
30
|
+
const HiddenInput = _styled.default.input(_templateObject7 || (_templateObject7 = _taggedTemplateLiteral(["\n display: none;\n"])));
|
|
31
|
+
const query = _ProfileDrawerContentUpdateAvatarMutation !== void 0 ? _ProfileDrawerContentUpdateAvatarMutation : (_ProfileDrawerContentUpdateAvatarMutation = require("./__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql"), _ProfileDrawerContentUpdateAvatarMutation.hash && _ProfileDrawerContentUpdateAvatarMutation.hash !== "cf72a6314772ed0d1f182b197c858505" && console.error("The definition of 'ProfileDrawerContentUpdateAvatarMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProfileDrawerContentUpdateAvatarMutation);
|
|
32
|
+
const DeleteAvatarButton = () => {
|
|
33
|
+
const {
|
|
34
|
+
t
|
|
35
|
+
} = (0, _reactI18next.useTranslation)(['profile']);
|
|
36
|
+
const [commit, loading] = (0, _hooks.useMutation)(query);
|
|
37
|
+
const handler = (0, _react.useCallback)(() => {
|
|
51
38
|
commit({
|
|
52
39
|
variables: {
|
|
53
40
|
input: {
|
|
54
41
|
avatar: null
|
|
55
42
|
}
|
|
56
43
|
},
|
|
57
|
-
onError:
|
|
58
|
-
|
|
59
|
-
},
|
|
60
|
-
onCompleted: function onCompleted() {
|
|
44
|
+
onError: error => _core.message.error((0, _getErrorMessage.default)(error)),
|
|
45
|
+
onCompleted: () => {
|
|
61
46
|
_core.message.success(t('profile:updated'));
|
|
62
47
|
}
|
|
63
48
|
});
|
|
@@ -67,21 +52,23 @@ var DeleteAvatarButton = function DeleteAvatarButton() {
|
|
|
67
52
|
onClick: handler
|
|
68
53
|
}, t('profile:deleteAvatar'));
|
|
69
54
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
55
|
+
const UpdateAvatarButton = _ref => {
|
|
56
|
+
let {
|
|
57
|
+
hasAvatar
|
|
58
|
+
} = _ref;
|
|
59
|
+
const {
|
|
60
|
+
t
|
|
61
|
+
} = (0, _reactI18next.useTranslation)(['profile']);
|
|
62
|
+
const fileInputRef = (0, _react.useRef)(null);
|
|
63
|
+
const [commit, loading] = (0, _hooks.useMutation)(query);
|
|
64
|
+
const handler = (0, _react.useCallback)(e => {
|
|
65
|
+
const target = e.target;
|
|
81
66
|
if (!target) return;
|
|
82
|
-
|
|
67
|
+
const {
|
|
68
|
+
files
|
|
69
|
+
} = target;
|
|
83
70
|
if (!files) return;
|
|
84
|
-
|
|
71
|
+
const file = files[0];
|
|
85
72
|
commit({
|
|
86
73
|
variables: {
|
|
87
74
|
input: {}
|
|
@@ -89,17 +76,15 @@ var UpdateAvatarButton = function UpdateAvatarButton(_ref) {
|
|
|
89
76
|
uploadables: {
|
|
90
77
|
avatar: file
|
|
91
78
|
},
|
|
92
|
-
onError:
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
onCompleted: function onCompleted() {
|
|
79
|
+
onError: error => _core.message.error((0, _getErrorMessage.default)(error)),
|
|
80
|
+
onCompleted: () => {
|
|
96
81
|
_core.message.success(t('profile:updated'));
|
|
97
82
|
}
|
|
98
83
|
});
|
|
99
84
|
}, [commit, t]);
|
|
100
85
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProfileButton.default, {
|
|
101
86
|
loading: loading,
|
|
102
|
-
onClick:
|
|
87
|
+
onClick: () => {
|
|
103
88
|
if (!fileInputRef.current) return;
|
|
104
89
|
fileInputRef.current.value = '';
|
|
105
90
|
fileInputRef.current.click();
|
|
@@ -111,57 +96,43 @@ var UpdateAvatarButton = function UpdateAvatarButton(_ref) {
|
|
|
111
96
|
ref: fileInputRef
|
|
112
97
|
}));
|
|
113
98
|
};
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
99
|
+
const UpdateNameButton = _ref2 => {
|
|
100
|
+
let {
|
|
101
|
+
hasName
|
|
102
|
+
} = _ref2;
|
|
103
|
+
const {
|
|
104
|
+
t
|
|
105
|
+
} = (0, _reactI18next.useTranslation)(['profile']);
|
|
106
|
+
const [modalVisible, setModalVisible] = (0, _react.useState)(false);
|
|
122
107
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProfileButton.default, {
|
|
123
|
-
onClick:
|
|
124
|
-
return setModalVisible(true);
|
|
125
|
-
}
|
|
108
|
+
onClick: () => setModalVisible(true)
|
|
126
109
|
}, t("profile:".concat(hasName ? 'changeName' : 'setName'))), /*#__PURE__*/_react.default.createElement(_ProfileUpdateNameModal.default, {
|
|
127
110
|
visible: modalVisible,
|
|
128
|
-
onClose:
|
|
129
|
-
return setModalVisible(false);
|
|
130
|
-
}
|
|
111
|
+
onClose: () => setModalVisible(false)
|
|
131
112
|
}));
|
|
132
113
|
};
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
t
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
modalVisible = _useState4[0],
|
|
139
|
-
setModalVisible = _useState4[1];
|
|
114
|
+
const ChangePasswordButton = () => {
|
|
115
|
+
const {
|
|
116
|
+
t
|
|
117
|
+
} = (0, _reactI18next.useTranslation)(['profile']);
|
|
118
|
+
const [modalVisible, setModalVisible] = (0, _react.useState)(false);
|
|
140
119
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ProfileButton.default, {
|
|
141
|
-
onClick:
|
|
142
|
-
return setModalVisible(true);
|
|
143
|
-
}
|
|
120
|
+
onClick: () => setModalVisible(true)
|
|
144
121
|
}, t('profile:changePassword')), /*#__PURE__*/_react.default.createElement(_ProfileUpdatePasswordModal.default, {
|
|
145
122
|
visible: modalVisible,
|
|
146
|
-
onClose:
|
|
147
|
-
return setModalVisible(false);
|
|
148
|
-
}
|
|
123
|
+
onClose: () => setModalVisible(false)
|
|
149
124
|
}));
|
|
150
125
|
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
t
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
loading = _useMutation6[1];
|
|
158
|
-
var handler = (0, _react.useCallback)(function () {
|
|
126
|
+
const SignOutButton = () => {
|
|
127
|
+
const {
|
|
128
|
+
t
|
|
129
|
+
} = (0, _reactI18next.useTranslation)(['profile']);
|
|
130
|
+
const [commit, loading] = (0, _hooks.useMutation)(_ProfileDrawerContentSignOutMutation !== void 0 ? _ProfileDrawerContentSignOutMutation : (_ProfileDrawerContentSignOutMutation = require("./__generated__/ProfileDrawerContentSignOutMutation.graphql"), _ProfileDrawerContentSignOutMutation.hash && _ProfileDrawerContentSignOutMutation.hash !== "c7ca96e9e713315606b0c22d196b6f7b" && console.error("The definition of 'ProfileDrawerContentSignOutMutation' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _ProfileDrawerContentSignOutMutation));
|
|
131
|
+
const handler = (0, _react.useCallback)(() => {
|
|
159
132
|
commit({
|
|
160
133
|
variables: {},
|
|
161
|
-
onError:
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
onCompleted: function onCompleted() {
|
|
134
|
+
onError: error => _core.message.error((0, _getErrorMessage.default)(error)),
|
|
135
|
+
onCompleted: () => {
|
|
165
136
|
window.location.href = '/auth/';
|
|
166
137
|
}
|
|
167
138
|
});
|
|
@@ -172,19 +143,18 @@ var SignOutButton = function SignOutButton() {
|
|
|
172
143
|
onClick: handler
|
|
173
144
|
}, t('profile:signOut'));
|
|
174
145
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}, [firstName, lastName]);
|
|
146
|
+
const ProfileDrawerContent = _ref3 => {
|
|
147
|
+
let {
|
|
148
|
+
actions,
|
|
149
|
+
children
|
|
150
|
+
} = _ref3;
|
|
151
|
+
const {
|
|
152
|
+
email,
|
|
153
|
+
firstName,
|
|
154
|
+
lastName,
|
|
155
|
+
avatar
|
|
156
|
+
} = (0, _ProfileContext.useProfile)();
|
|
157
|
+
const fullName = (0, _react.useMemo)(() => [firstName, lastName].filter(i => i).join(' '), [firstName, lastName]);
|
|
188
158
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(AvatarContainer, null, /*#__PURE__*/_react.default.createElement(_UserAvatar.default, {
|
|
189
159
|
size: "10em"
|
|
190
160
|
}), /*#__PURE__*/_react.default.createElement(UserContent, null, fullName && /*#__PURE__*/_react.default.createElement(FullName, null, fullName), /*#__PURE__*/_react.default.createElement(Email, null, email))), /*#__PURE__*/_react.default.createElement(ActionsContainer, null, avatar && /*#__PURE__*/_react.default.createElement(DeleteAvatarButton, null), /*#__PURE__*/_react.default.createElement(UpdateAvatarButton, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawerContent.js","names":["_styled","_interopRequireDefault","require","_core","_theming","_react","_interopRequireWildcard","_reactI18next","_hooks","_getErrorMessage","_ProfileButton","_ProfileContext","_ProfileUpdateNameModal","_ProfileUpdatePasswordModal","_UserAvatar","_ProfileDrawerContentUpdateAvatarMutation","_ProfileDrawerContentSignOutMutation","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","TypeError","o","minLen","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","len","length","arr2","l","Symbol","iterator","f","next","done","push","value","return","isArray","_taggedTemplateLiteral","strings","raw","freeze","defineProperties","AvatarContainer","styled","div","UserContent","FullName","p","theme","sizes","large","Email","clr","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","query","hash","console","error","DeleteAvatarButton","_useTranslation","useTranslation","_useMutation","useMutation","_useMutation2","commit","loading","handler","useCallback","variables","avatar","onError","message","getErrorMessage","onCompleted","success","createElement","onClick","UpdateAvatarButton","_ref","hasAvatar","_useTranslation2","fileInputRef","useRef","_useMutation3","_useMutation4","target","files","file","uploadables","Fragment","current","click","concat","type","accept","onChange","ref","UpdateNameButton","_ref2","hasName","_useTranslation3","_useState","useState","_useState2","modalVisible","setModalVisible","visible","onClose","ChangePasswordButton","_useTranslation4","_useState3","_useState4","SignOutButton","_useTranslation5","_useMutation5","_useMutation6","window","location","href","danger","ProfileDrawerContent","_ref3","actions","children","_useProfile","useProfile","email","firstName","lastName","fullName","useMemo","filter","join","size","ThemeSwitcher","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileDrawerContent.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { ThemeSwitcher, message } from '@os-design/core';\nimport { clr } from '@os-design/theming';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport getErrorMessage from '../../utils/getErrorMessage';\nimport ProfileButton from './ProfileButton';\nimport { useProfile } from './ProfileContext';\nimport ProfileUpdateNameModal from './ProfileUpdateNameModal';\nimport ProfileUpdatePasswordModal from './ProfileUpdatePasswordModal';\nimport UserAvatar from './UserAvatar';\nimport { ProfileDrawerContentSignOutMutation } from './__generated__/ProfileDrawerContentSignOutMutation.graphql';\nimport { ProfileDrawerContentUpdateAvatarMutation } from './__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql';\n\nexport interface ProfileDrawerContentProps {\n /**\n * Additional actions placed under the avatar.\n * @default undefined\n */\n actions?: React.ReactNode;\n /**\n * The children.\n */\n children?: React.ReactNode;\n}\n\nconst AvatarContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nconst UserContent = styled.div`\n margin-top: 1em;\n`;\n\nconst FullName = styled.div`\n font-size: ${(p) => p.theme.sizes.large}em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n`;\n\nconst Email = styled.div`\n color: ${(p) => clr(p.theme.inputColorPlaceholder)};\n margin-top: 0.2em;\n text-align: center;\n`;\n\nconst ActionsContainer = styled.div`\n margin-top: 1.5em;\n`;\n\nconst Footer = styled.div`\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n`;\n\nconst HiddenInput = styled.input`\n display: none;\n`;\n\nconst query = graphql`\n mutation ProfileDrawerContentUpdateAvatarMutation(\n $input: UpdateAvatarInput!\n ) {\n updateAvatar(input: $input) {\n id\n avatar\n }\n }\n`;\n\nconst DeleteAvatarButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(query);\n\n const handler = useCallback(() => {\n commit({\n variables: {\n input: { avatar: null },\n },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n }, [commit, t]);\n\n return (\n <ProfileButton loading={loading} onClick={handler}>\n {t('profile:deleteAvatar')}\n </ProfileButton>\n );\n};\n\ninterface UpdateAvatarButtonProps {\n hasAvatar: boolean;\n}\n\nconst UpdateAvatarButton: React.FC<UpdateAvatarButtonProps> = ({\n hasAvatar,\n}) => {\n const { t } = useTranslation(['profile']);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(query);\n\n const handler = useCallback(\n (e) => {\n const target = e.target as HTMLInputElement | null;\n if (!target) return;\n\n const { files } = target;\n if (!files) return;\n\n const file = files[0];\n\n commit({\n variables: {\n input: {},\n },\n uploadables: { avatar: file },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n },\n [commit, t]\n );\n\n return (\n <>\n <ProfileButton\n loading={loading}\n onClick={() => {\n if (!fileInputRef.current) return;\n fileInputRef.current.value = '';\n fileInputRef.current.click();\n }}\n >\n {t(`profile:${hasAvatar ? 'changeAvatar' : 'setAvatar'}`)}\n </ProfileButton>\n\n <HiddenInput\n type='file'\n accept='image/jpeg,image/png,image/webp'\n onChange={handler}\n ref={fileInputRef}\n />\n </>\n );\n};\n\ninterface UpdateNameButtonProps {\n hasName: boolean;\n}\n\nconst UpdateNameButton: React.FC<UpdateNameButtonProps> = ({ hasName }) => {\n const { t } = useTranslation(['profile']);\n const [modalVisible, setModalVisible] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisible(true)}>\n {t(`profile:${hasName ? 'changeName' : 'setName'}`)}\n </ProfileButton>\n\n <ProfileUpdateNameModal\n visible={modalVisible}\n onClose={() => setModalVisible(false)}\n />\n </>\n );\n};\n\nconst ChangePasswordButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n const [modalVisible, setModalVisible] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisible(true)}>\n {t('profile:changePassword')}\n </ProfileButton>\n\n <ProfileUpdatePasswordModal\n visible={modalVisible}\n onClose={() => setModalVisible(false)}\n />\n </>\n );\n};\n\nconst SignOutButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] = useMutation<ProfileDrawerContentSignOutMutation>(\n graphql`\n mutation ProfileDrawerContentSignOutMutation {\n signOut {\n ok\n }\n }\n `\n );\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n window.location.href = '/auth/';\n },\n });\n }, [commit]);\n\n return (\n <ProfileButton danger loading={loading} onClick={handler}>\n {t('profile:signOut')}\n </ProfileButton>\n );\n};\n\nconst ProfileDrawerContent: React.FC<ProfileDrawerContentProps> = ({\n actions,\n children,\n}) => {\n const { email, firstName, lastName, avatar } = useProfile();\n\n const fullName = useMemo(\n () => [firstName, lastName].filter((i) => i).join(' '),\n [firstName, lastName]\n );\n\n return (\n <>\n <AvatarContainer>\n <UserAvatar size='10em' />\n <UserContent>\n {fullName && <FullName>{fullName}</FullName>}\n <Email>{email}</Email>\n </UserContent>\n </AvatarContainer>\n\n <ActionsContainer>\n {avatar && <DeleteAvatarButton />}\n\n <UpdateAvatarButton hasAvatar={!!avatar} />\n <UpdateNameButton hasName={!!fullName} />\n <ChangePasswordButton />\n\n {actions}\n\n <SignOutButton />\n\n {children}\n </ActionsContainer>\n\n <Footer>\n <ThemeSwitcher />\n </Footer>\n </>\n );\n};\n\nexport default ProfileDrawerContent;\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,sBA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,CAAAwF,aAAA,CAACpH,KAAA,CAAA+K,aAAa,MAAE,CACV,CACR,CAAC;AAEP,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArJ,OAAA,GAEaqI,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"ProfileDrawerContent.js","names":["_styled","_interopRequireDefault","require","_core","_theming","_react","_interopRequireWildcard","_reactI18next","_hooks","_getErrorMessage","_ProfileButton","_ProfileContext","_ProfileUpdateNameModal","_ProfileUpdatePasswordModal","_UserAvatar","_ProfileDrawerContentUpdateAvatarMutation","_ProfileDrawerContentSignOutMutation","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","_taggedTemplateLiteral","strings","raw","slice","freeze","defineProperties","value","AvatarContainer","styled","div","UserContent","FullName","p","theme","sizes","large","Email","clr","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","query","hash","console","error","DeleteAvatarButton","useTranslation","commit","loading","useMutation","handler","useCallback","variables","avatar","onError","message","getErrorMessage","onCompleted","success","createElement","onClick","UpdateAvatarButton","_ref","hasAvatar","fileInputRef","useRef","target","files","file","uploadables","Fragment","current","click","concat","type","accept","onChange","ref","UpdateNameButton","_ref2","hasName","modalVisible","setModalVisible","useState","visible","onClose","ChangePasswordButton","SignOutButton","window","location","href","danger","ProfileDrawerContent","_ref3","actions","children","email","firstName","lastName","useProfile","fullName","useMemo","filter","join","size","ThemeSwitcher","_default","exports"],"sources":["../../../../src/lib/components/profile/ProfileDrawerContent.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport { ThemeSwitcher, message } from '@os-design/core';\nimport { clr } from '@os-design/theming';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport getErrorMessage from '../../utils/getErrorMessage';\nimport ProfileButton from './ProfileButton';\nimport { useProfile } from './ProfileContext';\nimport ProfileUpdateNameModal from './ProfileUpdateNameModal';\nimport ProfileUpdatePasswordModal from './ProfileUpdatePasswordModal';\nimport UserAvatar from './UserAvatar';\nimport { ProfileDrawerContentSignOutMutation } from './__generated__/ProfileDrawerContentSignOutMutation.graphql';\nimport { ProfileDrawerContentUpdateAvatarMutation } from './__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql';\n\nexport interface ProfileDrawerContentProps {\n /**\n * Additional actions placed under the avatar.\n * @default undefined\n */\n actions?: React.ReactNode;\n /**\n * The children.\n */\n children?: React.ReactNode;\n}\n\nconst AvatarContainer = styled.div`\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n`;\n\nconst UserContent = styled.div`\n margin-top: 1em;\n`;\n\nconst FullName = styled.div`\n font-size: ${(p) => p.theme.sizes.large}em;\n font-weight: 500;\n text-align: center;\n line-height: 1.2;\n`;\n\nconst Email = styled.div`\n color: ${(p) => clr(p.theme.inputColorPlaceholder)};\n margin-top: 0.2em;\n text-align: center;\n`;\n\nconst ActionsContainer = styled.div`\n margin-top: 1.5em;\n`;\n\nconst Footer = styled.div`\n display: flex;\n justify-content: center;\n margin-top: auto;\n padding-top: 1.5em;\n`;\n\nconst HiddenInput = styled.input`\n display: none;\n`;\n\nconst query = graphql`\n mutation ProfileDrawerContentUpdateAvatarMutation(\n $input: UpdateAvatarInput!\n ) {\n updateAvatar(input: $input) {\n id\n avatar\n }\n }\n`;\n\nconst DeleteAvatarButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(query);\n\n const handler = useCallback(() => {\n commit({\n variables: {\n input: { avatar: null },\n },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n }, [commit, t]);\n\n return (\n <ProfileButton loading={loading} onClick={handler}>\n {t('profile:deleteAvatar')}\n </ProfileButton>\n );\n};\n\ninterface UpdateAvatarButtonProps {\n hasAvatar: boolean;\n}\n\nconst UpdateAvatarButton: React.FC<UpdateAvatarButtonProps> = ({\n hasAvatar,\n}) => {\n const { t } = useTranslation(['profile']);\n const fileInputRef = useRef<HTMLInputElement>(null);\n\n const [commit, loading] =\n useMutation<ProfileDrawerContentUpdateAvatarMutation>(query);\n\n const handler = useCallback(\n (e) => {\n const target = e.target as HTMLInputElement | null;\n if (!target) return;\n\n const { files } = target;\n if (!files) return;\n\n const file = files[0];\n\n commit({\n variables: {\n input: {},\n },\n uploadables: { avatar: file },\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n message.success(t('profile:updated'));\n },\n });\n },\n [commit, t]\n );\n\n return (\n <>\n <ProfileButton\n loading={loading}\n onClick={() => {\n if (!fileInputRef.current) return;\n fileInputRef.current.value = '';\n fileInputRef.current.click();\n }}\n >\n {t(`profile:${hasAvatar ? 'changeAvatar' : 'setAvatar'}`)}\n </ProfileButton>\n\n <HiddenInput\n type='file'\n accept='image/jpeg,image/png,image/webp'\n onChange={handler}\n ref={fileInputRef}\n />\n </>\n );\n};\n\ninterface UpdateNameButtonProps {\n hasName: boolean;\n}\n\nconst UpdateNameButton: React.FC<UpdateNameButtonProps> = ({ hasName }) => {\n const { t } = useTranslation(['profile']);\n const [modalVisible, setModalVisible] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisible(true)}>\n {t(`profile:${hasName ? 'changeName' : 'setName'}`)}\n </ProfileButton>\n\n <ProfileUpdateNameModal\n visible={modalVisible}\n onClose={() => setModalVisible(false)}\n />\n </>\n );\n};\n\nconst ChangePasswordButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n const [modalVisible, setModalVisible] = useState(false);\n\n return (\n <>\n <ProfileButton onClick={() => setModalVisible(true)}>\n {t('profile:changePassword')}\n </ProfileButton>\n\n <ProfileUpdatePasswordModal\n visible={modalVisible}\n onClose={() => setModalVisible(false)}\n />\n </>\n );\n};\n\nconst SignOutButton: React.FC = () => {\n const { t } = useTranslation(['profile']);\n\n const [commit, loading] = useMutation<ProfileDrawerContentSignOutMutation>(\n graphql`\n mutation ProfileDrawerContentSignOutMutation {\n signOut {\n ok\n }\n }\n `\n );\n\n const handler = useCallback(() => {\n commit({\n variables: {},\n onError: (error) => message.error(getErrorMessage(error)),\n onCompleted: () => {\n window.location.href = '/auth/';\n },\n });\n }, [commit]);\n\n return (\n <ProfileButton danger loading={loading} onClick={handler}>\n {t('profile:signOut')}\n </ProfileButton>\n );\n};\n\nconst ProfileDrawerContent: React.FC<ProfileDrawerContentProps> = ({\n actions,\n children,\n}) => {\n const { email, firstName, lastName, avatar } = useProfile();\n\n const fullName = useMemo(\n () => [firstName, lastName].filter((i) => i).join(' '),\n [firstName, lastName]\n );\n\n return (\n <>\n <AvatarContainer>\n <UserAvatar size='10em' />\n <UserContent>\n {fullName && <FullName>{fullName}</FullName>}\n <Email>{email}</Email>\n </UserContent>\n </AvatarContainer>\n\n <ActionsContainer>\n {avatar && <DeleteAvatarButton />}\n\n <UpdateAvatarButton hasAvatar={!!avatar} />\n <UpdateNameButton hasName={!!fullName} />\n <ChangePasswordButton />\n\n {actions}\n\n <SignOutButton />\n\n {children}\n </ActionsContainer>\n\n <Footer>\n <ThemeSwitcher />\n </Footer>\n </>\n );\n};\n\nexport default ProfileDrawerContent;\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,aAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,cAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,eA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jCpE,MAAA,CAAAyB,OAAA,CAAAyD,aAAA,CAACE,kBAAkB;IAACE,SAAS,EAAE,CAAC,CAACV;EAAO,CAAE,CAAC,eAC3C5E,MAAA,CAAAyB,OAAA,CAAAyD,aAAA,CAACmB,gBAAgB;IAACE,OAAO,EAAE,CAAC,CAACoB;EAAS,CAAE,CAAC,eACzC3H,MAAA,CAAAyB,OAAA,CAAAyD,aAAA,CAAC2B,oBAAoB,MAAE,CAAC,EAEvBQ,OAAO,eAERrH,MAAA,CAAAyB,OAAA,CAAAyD,aAAA,CAAC4B,aAAa,MAAE,CAAC,EAEhBQ,QACe,CAAC,eAEnBtH,MAAA,CAAAyB,OAAA,CAAAyD,aAAA,CAACrB,MAAM,qBACL7D,MAAA,CAAAyB,OAAA,CAAAyD,aAAA,CAACpF,KAAA,CAAAkI,aAAa,MAAE,CACV,CACR,CAAC;AAEP,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAzG,OAAA,GAEa0F,oBAAoB"}
|
|
@@ -9,25 +9,24 @@ var _media = require("@os-design/media");
|
|
|
9
9
|
var _core = require("@os-design/core");
|
|
10
10
|
var _reactI18next = require("react-i18next");
|
|
11
11
|
var _ProfileIcon = _interopRequireDefault(require("../shared/icons/ProfileIcon"));
|
|
12
|
-
var _excluded = ["onClick"];
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
13
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
const ProfileNavigationItem = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
onClick = () => {},
|
|
17
|
+
...rest
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
t
|
|
21
|
+
} = (0, _reactI18next.useTranslation)(['profile']);
|
|
22
|
+
const isMinMd = (0, _media.useIsMinWidth)('md');
|
|
24
23
|
if (isMinMd) return null;
|
|
25
24
|
return /*#__PURE__*/_react.default.createElement(_core.NavigationItem, _extends({
|
|
26
25
|
href: "#" // To make focusable
|
|
27
26
|
,
|
|
28
27
|
icon: /*#__PURE__*/_react.default.createElement(_ProfileIcon.default, null),
|
|
29
28
|
onClick: onClick,
|
|
30
|
-
onKeyDown:
|
|
29
|
+
onKeyDown: e => {
|
|
31
30
|
if (e.key === 'Enter') onClick();
|
|
32
31
|
}
|
|
33
32
|
}, rest), t('profile:menu'));
|