@os-team/profile 1.2.0 → 1.2.1
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/@types/emotion.d.js.map +1 -1
- package/dist/cjs/@types/i18next.d.js.map +1 -1
- package/dist/cjs/components/profile/ProfileButton.js +2 -2
- package/dist/cjs/components/profile/ProfileButton.js.map +1 -1
- package/dist/cjs/components/profile/ProfileConfigContext.js +1 -1
- package/dist/cjs/components/profile/ProfileConfigContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileContext.js +1 -1
- package/dist/cjs/components/profile/ProfileContext.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawer.js +4 -4
- package/dist/cjs/components/profile/ProfileDrawer.js.map +1 -1
- package/dist/cjs/components/profile/ProfileDrawerContent.js +3 -3
- package/dist/cjs/components/profile/ProfileDrawerContent.js.map +1 -1
- package/dist/cjs/components/profile/ProfileNavigationItem.js +2 -2
- package/dist/cjs/components/profile/ProfileNavigationItem.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js +3 -3
- package/dist/cjs/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js +3 -3
- package/dist/cjs/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/cjs/components/profile/ProtectedWrapper.js +2 -2
- package/dist/cjs/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatar.js +2 -2
- package/dist/cjs/components/profile/UserAvatar.js.map +1 -1
- package/dist/cjs/components/profile/UserAvatarAddon.js +3 -3
- package/dist/cjs/components/profile/UserAvatarAddon.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/cjs/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawer.js +4 -4
- package/dist/cjs/components/session/SessionDrawer.js.map +1 -1
- package/dist/cjs/components/session/SessionDrawerContent.js +2 -2
- package/dist/cjs/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/cjs/components/session/SessionList.js +3 -3
- package/dist/cjs/components/session/SessionList.js.map +1 -1
- package/dist/cjs/components/session/SessionListItem.js +3 -3
- package/dist/cjs/components/session/SessionListItem.js.map +1 -1
- package/dist/cjs/components/session/SessionListSkeleton.js +2 -2
- package/dist/cjs/components/session/SessionListSkeleton.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionListRefetchQuery.graphql.js.map +1 -1
- package/dist/cjs/components/session/__generated__/SessionList_sessions.graphql.js.map +1 -1
- package/dist/cjs/components/session/formatDate.js.map +1 -1
- package/dist/cjs/components/session/getLastSeen.js.map +1 -1
- package/dist/cjs/components/shared/ButtonUpdate.js +1 -1
- package/dist/cjs/components/shared/ButtonUpdate.js.map +1 -1
- package/dist/cjs/components/shared/ErrorResult.js +2 -2
- package/dist/cjs/components/shared/ErrorResult.js.map +1 -1
- package/dist/cjs/components/shared/FormError.js +1 -1
- package/dist/cjs/components/shared/FormError.js.map +1 -1
- package/dist/cjs/components/shared/MainLoader.js +2 -2
- package/dist/cjs/components/shared/MainLoader.js.map +1 -1
- package/dist/cjs/components/shared/icons/AndroidIcon.js +2 -2
- package/dist/cjs/components/shared/icons/AndroidIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/AppleIcon.js +2 -2
- package/dist/cjs/components/shared/icons/AppleIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/BrowserIcon.js +2 -2
- package/dist/cjs/components/shared/icons/BrowserIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/ProfileIcon.js +2 -2
- package/dist/cjs/components/shared/icons/ProfileIcon.js.map +1 -1
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js +2 -2
- package/dist/cjs/components/shared/icons/UnknownDeviceIcon.js.map +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/getError.js.map +1 -1
- package/dist/cjs/utils/getUserFullName.js.map +1 -1
- package/dist/cjs/utils/handleFormErrors.js +1 -1
- package/dist/cjs/utils/handleFormErrors.js.map +1 -1
- package/dist/esm/@types/emotion.d.js.map +1 -1
- package/dist/esm/@types/i18next.d.js.map +1 -1
- package/dist/esm/components/profile/ProfileButton.js +1 -1
- package/dist/esm/components/profile/ProfileButton.js.map +1 -1
- package/dist/esm/components/profile/ProfileConfigContext.js.map +1 -1
- package/dist/esm/components/profile/ProfileContext.js.map +1 -1
- package/dist/esm/components/profile/ProfileDrawer.js +1 -1
- package/dist/esm/components/profile/ProfileDrawer.js.map +1 -1
- package/dist/esm/components/profile/ProfileDrawerContent.js.map +1 -1
- package/dist/esm/components/profile/ProfileNavigationItem.js +1 -1
- package/dist/esm/components/profile/ProfileNavigationItem.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdateNameModal.js +1 -1
- package/dist/esm/components/profile/ProfileUpdateNameModal.js.map +1 -1
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js +1 -1
- package/dist/esm/components/profile/ProfileUpdatePasswordModal.js.map +1 -1
- package/dist/esm/components/profile/ProtectedWrapper.js.map +1 -1
- package/dist/esm/components/profile/UserAvatar.js +1 -1
- package/dist/esm/components/profile/UserAvatar.js.map +1 -1
- package/dist/esm/components/profile/UserAvatarAddon.js +1 -1
- package/dist/esm/components/profile/UserAvatarAddon.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map +1 -1
- package/dist/esm/components/profile/__generated__/ProtectedWrapperQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/SessionDrawer.js +1 -1
- package/dist/esm/components/session/SessionDrawer.js.map +1 -1
- package/dist/esm/components/session/SessionDrawerContent.js.map +1 -1
- package/dist/esm/components/session/SessionList.js.map +1 -1
- package/dist/esm/components/session/SessionListItem.js.map +1 -1
- package/dist/esm/components/session/SessionListSkeleton.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionDrawerContentQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListDestroyAllOtherSessionsMutation.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListItemDestroySessionMutation.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListItem_session.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionListRefetchQuery.graphql.js.map +1 -1
- package/dist/esm/components/session/__generated__/SessionList_sessions.graphql.js.map +1 -1
- package/dist/esm/components/session/formatDate.js.map +1 -1
- package/dist/esm/components/session/getLastSeen.js.map +1 -1
- package/dist/esm/components/shared/ButtonUpdate.js.map +1 -1
- package/dist/esm/components/shared/ErrorResult.js.map +1 -1
- package/dist/esm/components/shared/FormError.js.map +1 -1
- package/dist/esm/components/shared/MainLoader.js.map +1 -1
- package/dist/esm/components/shared/icons/AndroidIcon.js +1 -1
- package/dist/esm/components/shared/icons/AndroidIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/AppleIcon.js +1 -1
- package/dist/esm/components/shared/icons/AppleIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/BrowserIcon.js +1 -1
- package/dist/esm/components/shared/icons/BrowserIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/ProfileIcon.js +1 -1
- package/dist/esm/components/shared/icons/ProfileIcon.js.map +1 -1
- package/dist/esm/components/shared/icons/UnknownDeviceIcon.js +1 -1
- package/dist/esm/components/shared/icons/UnknownDeviceIcon.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/getError.js.map +1 -1
- package/dist/esm/utils/getUserFullName.js.map +1 -1
- package/dist/esm/utils/handleFormErrors.js.map +1 -1
- package/package.json +38 -38
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserFullName.js","names":["getUserFullName","_ref","email","firstName","lastName","parts","push","length","join","_default","exports","default"],"sources":["../../../src/lib/utils/getUserFullName.ts"],"sourcesContent":["export interface User {\n email: string;\n firstName?: string | null;\n lastName?: string | null;\n}\n\nconst getUserFullName = ({ email, firstName, lastName }: User): string => {\n const parts: string[] = [];\n if (firstName) parts.push(firstName);\n if (lastName) parts.push(lastName);\n return parts.length > 0 ? parts.join(' ') : email;\n};\n\nexport default getUserFullName;\n"],"mappings":";;;;;;AAMA,MAAMA,eAAe,GAAGC,IAAA,IAAkD;EAAA,IAAjD;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAAH,IAAA;EAC3D,MAAMI,KAAe,GAAG,EAAE;EAC1B,IAAIF,SAAS,EAAEE,KAAK,CAACC,IAAI,CAACH,SAAS,CAAC;EACpC,IAAIC,QAAQ,EAAEC,KAAK,CAACC,IAAI,CAACF,QAAQ,CAAC;EAClC,OAAOC,KAAK,CAACE,MAAM,GAAG,CAAC,GAAGF,KAAK,CAACG,IAAI,CAAC,GAAG,CAAC,GAAGN,KAAK;AACnD,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaX,eAAe"}
|
|
1
|
+
{"version":3,"file":"getUserFullName.js","names":["getUserFullName","_ref","email","firstName","lastName","parts","push","length","join","_default","exports","default"],"sources":["../../../src/lib/utils/getUserFullName.ts"],"sourcesContent":["export interface User {\n email: string;\n firstName?: string | null;\n lastName?: string | null;\n}\n\nconst getUserFullName = ({ email, firstName, lastName }: User): string => {\n const parts: string[] = [];\n if (firstName) parts.push(firstName);\n if (lastName) parts.push(lastName);\n return parts.length > 0 ? parts.join(' ') : email;\n};\n\nexport default getUserFullName;\n"],"mappings":";;;;;;AAMA,MAAMA,eAAe,GAAGC,IAAA,IAAkD;EAAA,IAAjD;IAAEC,KAAK;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAAH,IAAA;EAC3D,MAAMI,KAAe,GAAG,EAAE;EAC1B,IAAIF,SAAS,EAAEE,KAAK,CAACC,IAAI,CAACH,SAAS,CAAC;EACpC,IAAIC,QAAQ,EAAEC,KAAK,CAACC,IAAI,CAACF,QAAQ,CAAC;EAClC,OAAOC,KAAK,CAACE,MAAM,GAAG,CAAC,GAAGF,KAAK,CAACG,IAAI,CAAC,GAAG,CAAC,GAAGN,KAAK;AACnD,CAAC;AAAC,IAAAO,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEaX,eAAe","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _getError = _interopRequireDefault(require("./getError"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
10
|
const handleFormErrors = (form, error) => {
|
|
11
11
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleFormErrors.js","names":["_getError","_interopRequireDefault","require","
|
|
1
|
+
{"version":3,"file":"handleFormErrors.js","names":["_getError","_interopRequireDefault","require","e","__esModule","default","handleFormErrors","form","error","message","data","getError","Object","entries","forEach","_ref","key","constraint","errors","set","_default","exports"],"sources":["../../../src/lib/utils/handleFormErrors.ts"],"sourcesContent":["import { Form } from '@os-design/form';\nimport getError from './getError';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst handleFormErrors = (form: Form<any>, error: unknown): void => {\n const { message, data } = getError(error);\n if (data) {\n Object.entries(data).forEach(([key, constraint]) => {\n form.errors.set(key, constraint.message);\n });\n } else {\n form.errors.set('_error', message);\n }\n};\n\nexport default handleFormErrors;\n"],"mappings":";;;;;;AACA,IAAAA,SAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAElC;AACA,MAAMG,gBAAgB,GAAGA,CAACC,IAAe,EAAEC,KAAc,KAAW;EAClE,MAAM;IAAEC,OAAO;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAQ,EAACH,KAAK,CAAC;EACzC,IAAIE,IAAI,EAAE;IACRE,MAAM,CAACC,OAAO,CAACH,IAAI,CAAC,CAACI,OAAO,CAACC,IAAA,IAAuB;MAAA,IAAtB,CAACC,GAAG,EAAEC,UAAU,CAAC,GAAAF,IAAA;MAC7CR,IAAI,CAACW,MAAM,CAACC,GAAG,CAACH,GAAG,EAAEC,UAAU,CAACR,OAAO,CAAC;IAC1C,CAAC,CAAC;EACJ,CAAC,MAAM;IACLF,IAAI,CAACW,MAAM,CAACC,GAAG,CAAC,QAAQ,EAAEV,OAAO,CAAC;EACpC;AACF,CAAC;AAAC,IAAAW,QAAA,GAAAC,OAAA,CAAAhB,OAAA,GAEaC,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emotion.d.js","names":[],"sources":["../../../src/lib/@types/emotion.d.ts"],"sourcesContent":["import '@emotion/react';\nimport { Theme as BaseTheme } from '@os-design/theming';\n\ndeclare module '@emotion/react' {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface Theme extends BaseTheme {}\n}\n"],"mappings":"AAAA,OAAO,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"emotion.d.js","names":[],"sources":["../../../src/lib/@types/emotion.d.ts"],"sourcesContent":["import '@emotion/react';\nimport { Theme as BaseTheme } from '@os-design/theming';\n\ndeclare module '@emotion/react' {\n // eslint-disable-next-line @typescript-eslint/no-empty-interface\n export interface Theme extends BaseTheme {}\n}\n"],"mappings":"AAAA,OAAO,gBAAgB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18next.d.js","names":[],"sources":["../../../src/lib/@types/i18next.d.ts"],"sourcesContent":["import 'i18next';\nimport common from '../../../public/locales/en/common.json';\nimport profile from '../../../public/locales/en/profile.json';\n\ndeclare module 'i18next' {\n interface CustomTypeOptions {\n resources: {\n common: typeof common;\n profile: typeof profile;\n };\n }\n}\n"],"mappings":"AAAA,OAAO,SAAS"}
|
|
1
|
+
{"version":3,"file":"i18next.d.js","names":[],"sources":["../../../src/lib/@types/i18next.d.ts"],"sourcesContent":["import 'i18next';\nimport common from '../../../public/locales/en/common.json';\nimport profile from '../../../public/locales/en/profile.json';\n\ndeclare module 'i18next' {\n interface CustomTypeOptions {\n resources: {\n common: typeof common;\n profile: typeof profile;\n };\n }\n}\n"],"mappings":"AAAA,OAAO,SAAS","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { Button } from '@os-design/core';
|
|
4
4
|
const ProfileButton = props => /*#__PURE__*/React.createElement(Button, _extends({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileButton.js","names":["React","Button","ProfileButton","props","createElement","_extends","type","wide"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAqB,iBAAiB;AAErD,MAAMC,aAAoC,GAAIC,KAAK,iBACjDH,KAAA,CAAAI,aAAA,CAACH,MAAM,EAAAI,QAAA;EAACC,IAAI,EAAC,OAAO;EAACC,IAAI,EAAC;AAAQ,GAAKJ,KAAK,CAAG,CAChD;AAED,eAAeD,aAAa"}
|
|
1
|
+
{"version":3,"file":"ProfileButton.js","names":["React","Button","ProfileButton","props","createElement","_extends","type","wide"],"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,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,QAAqB,iBAAiB;AAErD,MAAMC,aAAoC,GAAIC,KAAK,iBACjDH,KAAA,CAAAI,aAAA,CAACH,MAAM,EAAAI,QAAA;EAACC,IAAI,EAAC,OAAO;EAACC,IAAI,EAAC;AAAQ,GAAKJ,KAAK,CAAG,CAChD;AAED,eAAeD,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileConfigContext.js","names":["React","useContext","ProfileConfig","createContext","bucketId","displayName","useProfileConfig"],"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,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAMzC,MAAMC,aAAa,gBAAGF,KAAK,CAACG,aAAa,CAAqB;EAC5DC,QAAQ,EAAE;AACZ,CAAC,CAAC;AAEFF,aAAa,CAACG,WAAW,GAAG,eAAe;AAE3C,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAC9BL,UAAU,CAACC,aAAa,CAAC;AAE3B,eAAeA,aAAa"}
|
|
1
|
+
{"version":3,"file":"ProfileConfigContext.js","names":["React","useContext","ProfileConfig","createContext","bucketId","displayName","useProfileConfig"],"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,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAMzC,MAAMC,aAAa,gBAAGF,KAAK,CAACG,aAAa,CAAqB;EAC5DC,QAAQ,EAAE;AACZ,CAAC,CAAC;AAEFF,aAAa,CAACG,WAAW,GAAG,eAAe;AAE3C,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAC9BL,UAAU,CAACC,aAAa,CAAC;AAE3B,eAAeA,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileContext.js","names":["React","useContext","ProfileContext","createContext","id","email","displayName","useProfile"],"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,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAUzC,MAAMC,cAAc,gBAAGF,KAAK,CAACG,aAAa,CAAsB;EAC9DC,EAAE,EAAE,EAAE;EACNC,KAAK,EAAE;AACT,CAAC,CAAC;AAEFH,cAAc,CAACI,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAMC,UAAU,GAAGA,CAAA,KAA2BN,UAAU,CAACC,cAAc,CAAC;AAE/E,eAAeA,cAAc"}
|
|
1
|
+
{"version":3,"file":"ProfileContext.js","names":["React","useContext","ProfileContext","createContext","id","email","displayName","useProfile"],"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,OAAOA,KAAK,IAAIC,UAAU,QAAQ,OAAO;AAUzC,MAAMC,cAAc,gBAAGF,KAAK,CAACG,aAAa,CAAsB;EAC9DC,EAAE,EAAE,EAAE;EACNC,KAAK,EAAE;AACT,CAAC,CAAC;AAEFH,cAAc,CAACI,WAAW,GAAG,gBAAgB;AAE7C,OAAO,MAAMC,UAAU,GAAGA,CAAA,KAA2BN,UAAU,CAACC,cAAc,CAAC;AAE/E,eAAeA,cAAc","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { lazy, Suspense } from 'react';
|
|
3
3
|
import { Drawer } from '@os-design/core';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawer.js","names":["React","lazy","Suspense","Drawer","styled","MainLoader","LazyProfileDrawerContent","StyledDrawer","ProfileDrawer","actions","children","rest","createElement","_extends","placement","width","fallback"],"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,OAAOA,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,MAAM,QAAqB,iBAAiB;AACrD,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,OAAOC,UAAU,MAAM,sBAAsB;AAE7C,MAAMC,wBAAwB,gBAAGL,IAAI,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAI7E,MAAMM,YAAY,GAAGH,MAAM,CAACD,MAAM,
|
|
1
|
+
{"version":3,"file":"ProfileDrawer.js","names":["React","lazy","Suspense","Drawer","styled","MainLoader","LazyProfileDrawerContent","StyledDrawer","ProfileDrawer","actions","children","rest","createElement","_extends","placement","width","fallback"],"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,OAAOA,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,MAAM,QAAqB,iBAAiB;AACrD,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,OAAOC,UAAU,MAAM,sBAAsB;AAE7C,MAAMC,wBAAwB,gBAAGL,IAAI,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAI7E,MAAMM,YAAY,GAAGH,MAAM,CAACD,MAAM,CAAC;AACnC;AACA;AACA;AACA,CAAC;AAED,MAAMK,aAA2C,GAAGA,CAAC;EACnDC,OAAO;EACPC,QAAQ;EACR,GAAGC;AACL,CAAC,kBACCX,KAAA,CAAAY,aAAA,CAACL,YAAY,EAAAM,QAAA;EAACC,SAAS,EAAC,OAAO;EAACC,KAAK,EAAC;AAAM,GAAKJ,IAAI,gBACnDX,KAAA,CAAAY,aAAA,CAACV,QAAQ;EAACc,QAAQ,eAAEhB,KAAA,CAAAY,aAAA,CAACP,UAAU,MAAE;AAAE,gBACjCL,KAAA,CAAAY,aAAA,CAACN,wBAAwB;EAACG,OAAO,EAAEA;AAAQ,GACxCC,QACuB,CAClB,CACE,CACf;AAED,eAAeF,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawerContent.js","names":["styled","ThemeSwitcher","message","clr","React","useCallback","useMemo","useRef","useState","useTranslation","useMutation","getError","ProfileButton","useProfile","ProfileUpdateNameModal","ProfileUpdatePasswordModal","UserAvatar","AvatarContainer","div","UserContent","FullName","p","theme","sizes","large","Email","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","query","_ProfileDrawerContentUpdateAvatarMutation","require","hash","console","error","DeleteAvatarButton","t","commit","loading","handler","variables","avatar","onError","e","onCompleted","success","createElement","onClick","UpdateAvatarButton","hasAvatar","fileInputRef","target","files","file","uploadables","Fragment","current","value","click","type","accept","onChange","ref","UpdateNameButton","hasName","modalVisible","setModalVisible","visible","onClose","ChangePasswordButton","SignOutButton","_ProfileDrawerContentSignOutMutation","window","location","href","danger","ProfileDrawerContent","actions","children","email","firstName","lastName","fullName","filter","i","join","size"],"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 getError from '../../utils/getError';\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: (e) => message.error(getError(e).message),\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(getError(error).message),\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: (e) => message.error(getError(e).message),\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,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,aAAa,EAAEC,OAAO,QAAQ,iBAAiB;AACxD,SAASC,GAAG,QAAQ,oBAAoB;AAExC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,0BAA0B,MAAM,8BAA8B;AACrE,OAAOC,UAAU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AC3CvC,KAAA,CAAA4C,aAAA,CAACiB,gBAAgB;IAACC,OAAO,EAAE,CAAC,CAACkB;EAAS,CAAE,CAAC,eACzChF,KAAA,CAAA4C,aAAA,CAACuB,oBAAoB,MAAE,CAAC,EAEvBQ,OAAO,eAER3E,KAAA,CAAA4C,aAAA,CAACwB,aAAa,MAAE,CAAC,EAEhBQ,QACe,CAAC,eAEnB5E,KAAA,CAAA4C,aAAA,CAACpB,MAAM,qBACLxB,KAAA,CAAA4C,aAAA,CAAC/C,aAAa,MAAE,CACV,CACR,CAAC;AAEP,CAAC;AAED,eAAe6E,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"ProfileDrawerContent.js","names":["styled","ThemeSwitcher","message","clr","React","useCallback","useMemo","useRef","useState","useTranslation","useMutation","getError","ProfileButton","useProfile","ProfileUpdateNameModal","ProfileUpdatePasswordModal","UserAvatar","AvatarContainer","div","UserContent","FullName","p","theme","sizes","large","Email","inputColorPlaceholder","ActionsContainer","Footer","HiddenInput","input","query","_ProfileDrawerContentUpdateAvatarMutation","require","hash","console","error","DeleteAvatarButton","t","commit","loading","handler","variables","avatar","onError","e","onCompleted","success","createElement","onClick","UpdateAvatarButton","hasAvatar","fileInputRef","target","files","file","uploadables","Fragment","current","value","click","type","accept","onChange","ref","UpdateNameButton","hasName","modalVisible","setModalVisible","visible","onClose","ChangePasswordButton","SignOutButton","_ProfileDrawerContentSignOutMutation","window","location","href","danger","ProfileDrawerContent","actions","children","email","firstName","lastName","fullName","filter","i","join","size"],"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 getError from '../../utils/getError';\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: (e) => message.error(getError(e).message),\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(getError(error).message),\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: (e) => message.error(getError(e).message),\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,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SAASC,aAAa,EAAEC,OAAO,QAAQ,iBAAiB;AACxD,SAASC,GAAG,QAAQ,oBAAoB;AAExC,OAAOC,KAAK,IAAIC,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACrE,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,OAAOC,QAAQ,MAAM,sBAAsB;AAC3C,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,OAAOC,sBAAsB,MAAM,0BAA0B;AAC7D,OAAOC,0BAA0B,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AAC,CAACR;EAAO,CAAE,CAAC,eAC3CvC,KAAA,CAAA4C,aAAA,CAACiB,gBAAgB;IAACC,OAAO,EAAE,CAAC,CAACkB;EAAS,CAAE,CAAC,eACzChF,KAAA,CAAA4C,aAAA,CAACuB,oBAAoB,MAAE,CAAC,EAEvBQ,OAAO,eAER3E,KAAA,CAAA4C,aAAA,CAACwB,aAAa,MAAE,CAAC,EAEhBQ,QACe,CAAC,eAEnB5E,KAAA,CAAA4C,aAAA,CAACpB,MAAM,qBACLxB,KAAA,CAAA4C,aAAA,CAAC/C,aAAa,MAAE,CACV,CACR,CAAC;AAEP,CAAC;AAED,eAAe6E,oBAAoB","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { useIsMinWidth } from '@os-design/media';
|
|
4
4
|
import { NavigationItem } from '@os-design/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileNavigationItem.js","names":["React","useIsMinWidth","NavigationItem","useTranslation","ProfileIcon","ProfileNavigationItem","onClick","rest","t","isMinMd","createElement","_extends","href","icon","onKeyDown","e","key"],"sources":["../../../../src/lib/components/profile/ProfileNavigationItem.tsx"],"sourcesContent":["import React from 'react';\nimport { useIsMinWidth } from '@os-design/media';\nimport { NavigationItem, NavigationItemProps } from '@os-design/core';\nimport { useTranslation } from 'react-i18next';\nimport ProfileIcon from '../shared/icons/ProfileIcon';\n\nexport interface ProfileNavigationItemProps\n extends Partial<NavigationItemProps> {\n onClick?: () => void;\n}\n\nconst ProfileNavigationItem: React.FC<ProfileNavigationItemProps> = ({\n onClick = () => {},\n ...rest\n}) => {\n const { t } = useTranslation(['profile']);\n const isMinMd = useIsMinWidth('md');\n\n if (isMinMd) return null;\n\n return (\n <NavigationItem\n href='#' // To make focusable\n icon={<ProfileIcon />}\n onClick={onClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onClick();\n }}\n {...rest}\n >\n {t('profile:menu')}\n </NavigationItem>\n );\n};\n\nexport default ProfileNavigationItem;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,cAAc,QAA6B,iBAAiB;AACrE,SAASC,cAAc,QAAQ,eAAe;AAC9C,OAAOC,WAAW,MAAM,6BAA6B;AAOrD,MAAMC,qBAA2D,GAAGA,CAAC;EACnEC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB,GAAGC;AACL,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGL,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;EACzC,MAAMM,OAAO,GAAGR,aAAa,CAAC,IAAI,CAAC;EAEnC,IAAIQ,OAAO,EAAE,OAAO,IAAI;EAExB,oBACET,KAAA,CAAAU,aAAA,CAACR,cAAc,EAAAS,QAAA;IACbC,IAAI,EAAC,GAAG,CAAC;IAAA;IACTC,IAAI,eAAEb,KAAA,CAAAU,aAAA,CAACN,WAAW,MAAE,CAAE;IACtBE,OAAO,EAAEA,OAAQ;IACjBQ,SAAS,EAAGC,CAAC,IAAK;MAChB,IAAIA,CAAC,CAACC,GAAG,KAAK,OAAO,EAAEV,OAAO,CAAC,CAAC;IAClC;EAAE,GACEC,IAAI,GAEPC,CAAC,CAAC,cAAc,CACH,CAAC;AAErB,CAAC;AAED,eAAeH,qBAAqB"}
|
|
1
|
+
{"version":3,"file":"ProfileNavigationItem.js","names":["React","useIsMinWidth","NavigationItem","useTranslation","ProfileIcon","ProfileNavigationItem","onClick","rest","t","isMinMd","createElement","_extends","href","icon","onKeyDown","e","key"],"sources":["../../../../src/lib/components/profile/ProfileNavigationItem.tsx"],"sourcesContent":["import React from 'react';\nimport { useIsMinWidth } from '@os-design/media';\nimport { NavigationItem, NavigationItemProps } from '@os-design/core';\nimport { useTranslation } from 'react-i18next';\nimport ProfileIcon from '../shared/icons/ProfileIcon';\n\nexport interface ProfileNavigationItemProps\n extends Partial<NavigationItemProps> {\n onClick?: () => void;\n}\n\nconst ProfileNavigationItem: React.FC<ProfileNavigationItemProps> = ({\n onClick = () => {},\n ...rest\n}) => {\n const { t } = useTranslation(['profile']);\n const isMinMd = useIsMinWidth('md');\n\n if (isMinMd) return null;\n\n return (\n <NavigationItem\n href='#' // To make focusable\n icon={<ProfileIcon />}\n onClick={onClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onClick();\n }}\n {...rest}\n >\n {t('profile:menu')}\n </NavigationItem>\n );\n};\n\nexport default ProfileNavigationItem;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAASC,cAAc,QAA6B,iBAAiB;AACrE,SAASC,cAAc,QAAQ,eAAe;AAC9C,OAAOC,WAAW,MAAM,6BAA6B;AAOrD,MAAMC,qBAA2D,GAAGA,CAAC;EACnEC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB,GAAGC;AACL,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGL,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;EACzC,MAAMM,OAAO,GAAGR,aAAa,CAAC,IAAI,CAAC;EAEnC,IAAIQ,OAAO,EAAE,OAAO,IAAI;EAExB,oBACET,KAAA,CAAAU,aAAA,CAACR,cAAc,EAAAS,QAAA;IACbC,IAAI,EAAC,GAAG,CAAC;IAAA;IACTC,IAAI,eAAEb,KAAA,CAAAU,aAAA,CAACN,WAAW,MAAE,CAAE;IACtBE,OAAO,EAAEA,OAAQ;IACjBQ,SAAS,EAAGC,CAAC,IAAK;MAChB,IAAIA,CAAC,CAACC,GAAG,KAAK,OAAO,EAAEV,OAAO,CAAC,CAAC;IAClC;EAAE,GACEC,IAAI,GAEPC,CAAC,CAAC,cAAc,CACH,CAAC;AAErB,CAAC;AAED,eAAeH,qBAAqB","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _ProfileUpdateNameModalMutation;
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { Form, FormItem, Input, message, Modal } from '@os-design/core';
|
|
4
4
|
import { FormProvider, useForm } from '@os-design/form';
|
|
5
5
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileUpdateNameModal.js","names":["Form","FormItem","Input","message","Modal","FormProvider","useForm","React","useCallback","useEffect","useMemo","useTranslation","useMutation","handleFormErrors","FormError","useProfile","ProfileUpdateNameModal","visible","onClose","t","firstName","lastName","initValues","form","Field","commit","loading","_ProfileUpdateNameModalMutation","require","hash","console","error","reset","onSubmit","variables","input","values","getAll","onError","onCompleted","success","firstNameData","label","placeholder","lastNameData","createElement","title","okText","okLoading","onOk","name","data","render","props","_extends"],"sources":["../../../../src/lib/components/profile/ProfileUpdateNameModal.tsx"],"sourcesContent":["import { Form, FormItem, Input, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdateNameModalMutation } from './__generated__/ProfileUpdateNameModalMutation.graphql';\nimport { useProfile } from './ProfileContext';\n\ninterface ProfileUpdateNameFormData {\n firstName: string;\n lastName: string;\n}\n\ninterface ProfileUpdateNameModalProps {\n visible: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdateNameModal: React.FC<ProfileUpdateNameModalProps> = ({\n visible,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n const { firstName = '', lastName = '' } = useProfile();\n\n const initValues = useMemo<ProfileUpdateNameFormData>(\n () => ({ firstName, lastName }),\n [firstName, lastName]\n );\n\n const { form, Field } = useForm(initValues);\n\n const [commit, loading] = useMutation<ProfileUpdateNameModalMutation>(graphql`\n mutation ProfileUpdateNameModalMutation($input: UpdateProfileInput!) {\n updateProfile(input: $input) {\n firstName\n lastName\n }\n }\n `);\n\n // Reset the form when the modal is opened\n useEffect(() => {\n if (visible) form.reset();\n }, [form, visible]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updated'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n const firstNameData = useMemo(\n () => ({\n label: t('profile:updateNameModal.firstName.label'),\n placeholder: t('profile:updateNameModal.firstName.placeholder'),\n }),\n [t]\n );\n\n const lastNameData = useMemo(\n () => ({\n label: t('profile:updateNameModal.lastName.label'),\n placeholder: t('profile:updateNameModal.lastName.placeholder'),\n }),\n [t]\n );\n\n return (\n <Modal\n title={t('profile:updateNameModal.title')}\n visible={visible}\n okText={t('profile:update')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='firstName'\n data={firstNameData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <Input placeholder={data.placeholder} {...props} />\n </FormItem>\n )}\n />\n\n <Field\n name='lastName'\n data={lastNameData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <Input placeholder={data.placeholder} {...props} />\n </FormItem>\n )}\n />\n\n <Form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C,aAAA,CAAC7C,IAAI,qBACHO,KAAA,CAAAsC,aAAA,CAACrB,KAAK;IACJ0B,IAAI,EAAC,WAAW;IAChBC,IAAI,EAAEV,aAAc;IACpBW,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAEtB;IAAM,CAAC,EAAEoB,IAAI,kBAC7B5C,KAAA,CAAAsC,aAAA,CAAC5C,QAAQ;MAACyC,KAAK,EAAES,IAAI,CAACT,KAAM;MAACX,KAAK,EAAEA;IAAM,gBACxCxB,KAAA,CAAAsC,aAAA,CAAC3C,KAAK,EAAAoD,QAAA;MAACX,WAAW,EAAEQ,IAAI,CAACR;IAAY,GAAKU,KAAK,CAAG,CAC1C;EACV,CACH,CAAC,eAEF9C,KAAA,CAAAsC,aAAA,CAACrB,KAAK;IACJ0B,IAAI,EAAC,UAAU;IACfC,IAAI,EAAEP,YAAa;IACnBQ,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAEtB;IAAM,CAAC,EAAEoB,IAAI,kBAC7B5C,KAAA,CAAAsC,aAAA,CAAC5C,QAAQ;MAACyC,KAAK,EAAES,IAAI,CAACT,KAAM;MAACX,KAAK,EAAEA;IAAM,gBACxCxB,KAAA,CAAAsC,aAAA,CAAC3C,KAAK,EAAAoD,QAAA;MAACX,WAAW,EAAEQ,IAAI,CAACR;IAAY,GAAKU,KAAK,CAAG,CAC1C;EACV,CACH,CAAC,eAEF9C,KAAA,CAAAsC,aAAA,CAAC/B,SAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAED,eAAeE,sBAAsB"}
|
|
1
|
+
{"version":3,"file":"ProfileUpdateNameModal.js","names":["Form","FormItem","Input","message","Modal","FormProvider","useForm","React","useCallback","useEffect","useMemo","useTranslation","useMutation","handleFormErrors","FormError","useProfile","ProfileUpdateNameModal","visible","onClose","t","firstName","lastName","initValues","form","Field","commit","loading","_ProfileUpdateNameModalMutation","require","hash","console","error","reset","onSubmit","variables","input","values","getAll","onError","onCompleted","success","firstNameData","label","placeholder","lastNameData","createElement","title","okText","okLoading","onOk","name","data","render","props","_extends"],"sources":["../../../../src/lib/components/profile/ProfileUpdateNameModal.tsx"],"sourcesContent":["import { Form, FormItem, Input, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdateNameModalMutation } from './__generated__/ProfileUpdateNameModalMutation.graphql';\nimport { useProfile } from './ProfileContext';\n\ninterface ProfileUpdateNameFormData {\n firstName: string;\n lastName: string;\n}\n\ninterface ProfileUpdateNameModalProps {\n visible: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdateNameModal: React.FC<ProfileUpdateNameModalProps> = ({\n visible,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n const { firstName = '', lastName = '' } = useProfile();\n\n const initValues = useMemo<ProfileUpdateNameFormData>(\n () => ({ firstName, lastName }),\n [firstName, lastName]\n );\n\n const { form, Field } = useForm(initValues);\n\n const [commit, loading] = useMutation<ProfileUpdateNameModalMutation>(graphql`\n mutation ProfileUpdateNameModalMutation($input: UpdateProfileInput!) {\n updateProfile(input: $input) {\n firstName\n lastName\n }\n }\n `);\n\n // Reset the form when the modal is opened\n useEffect(() => {\n if (visible) form.reset();\n }, [form, visible]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updated'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n const firstNameData = useMemo(\n () => ({\n label: t('profile:updateNameModal.firstName.label'),\n placeholder: t('profile:updateNameModal.firstName.placeholder'),\n }),\n [t]\n );\n\n const lastNameData = useMemo(\n () => ({\n label: t('profile:updateNameModal.lastName.label'),\n placeholder: t('profile:updateNameModal.lastName.placeholder'),\n }),\n [t]\n );\n\n return (\n <Modal\n title={t('profile:updateNameModal.title')}\n visible={visible}\n okText={t('profile:update')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='firstName'\n data={firstNameData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <Input placeholder={data.placeholder} {...props} />\n </FormItem>\n )}\n />\n\n <Field\n name='lastName'\n data={lastNameData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <Input placeholder={data.placeholder} {...props} />\n </FormItem>\n )}\n />\n\n <FormError />\n </Form>\n </FormProvider>\n </Modal>\n );\n};\n\nexport default ProfileUpdateNameModal;\n"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AACvE,SAASC,YAAY,EAAEC,OAAO,QAAQ,iBAAiB;AAEvD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,SAAS,MAAM,qBAAqB;AAE3C,SAASC,UAAU,QAAQ,kBAAkB;AAY7C,MAAMC,sBAA6D,GAAGA,CAAC;EACrEC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGR,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;EACzC,MAAM;IAAES,SAAS,GAAG,EAAE;IAAEC,QAAQ,GAAG;EAAG,CAAC,GAAGN,UAAU,CAAC,CAAC;EAEtD,MAAMO,UAAU,GAAGZ,OAAO,CACxB,OAAO;IAAEU,SAAS;IAAEC;EAAS,CAAC,CAAC,EAC/B,CAACD,SAAS,EAAEC,QAAQ,CACtB,CAAC;EAED,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,CAC1C;EACV,CACH,CAAC,eAEF9C,KAAA,CAAAsC,aAAA,CAAC/B,SAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAED,eAAeE,sBAAsB","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _ProfileUpdatePasswordModalMutation;
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
import { Form, FormItem, InputPassword, message, Modal } from '@os-design/core';
|
|
4
4
|
import { FormProvider, useForm } from '@os-design/form';
|
|
5
5
|
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileUpdatePasswordModal.js","names":["Form","FormItem","InputPassword","message","Modal","FormProvider","useForm","React","useCallback","useEffect","useMemo","useTranslation","useMutation","handleFormErrors","FormError","ProfileUpdatePasswordModal","visible","onClose","t","initValues","currentPassword","password","form","Field","commit","loading","_ProfileUpdatePasswordModalMutation","require","hash","console","error","reset","onSubmit","variables","input","values","getAll","onError","onCompleted","success","currentPasswordData","label","placeholder","passwordData","strengthNames","returnObjects","createElement","title","okText","okLoading","onOk","name","data","render","props","_extends","showStrengthMeter"],"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"sourcesContent":["import { Form, FormItem, InputPassword, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdatePasswordModalMutation } from './__generated__/ProfileUpdatePasswordModalMutation.graphql';\n\ninterface ProfileUpdatePasswordFormData {\n currentPassword: string;\n password: string;\n}\n\ninterface ProfileUpdatePasswordModalProps {\n visible: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdatePasswordModal: React.FC<ProfileUpdatePasswordModalProps> = ({\n visible,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n\n const initValues = useMemo<ProfileUpdatePasswordFormData>(\n () => ({\n currentPassword: '',\n password: '',\n }),\n []\n );\n\n const { form, Field } = useForm(initValues);\n\n const [commit, loading] = useMutation<ProfileUpdatePasswordModalMutation>(\n graphql`\n mutation ProfileUpdatePasswordModalMutation(\n $input: UpdatePasswordInput!\n ) {\n updatePassword(input: $input) {\n id\n }\n }\n `\n );\n\n // Reset the form when the modal is opened\n useEffect(() => {\n if (visible) form.reset();\n }, [form, visible]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updatePasswordModal.success'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n const currentPasswordData = useMemo(\n () => ({\n label: t('profile:updatePasswordModal.currentPassword.label'),\n placeholder: t('profile:updatePasswordModal.currentPassword.placeholder'),\n }),\n [t]\n );\n\n const passwordData = useMemo(\n () => ({\n label: t('profile:updatePasswordModal.newPassword.label'),\n placeholder: t('profile:updatePasswordModal.newPassword.placeholder'),\n strengthNames: t('profile:updatePasswordModal.passwordStrengthNames', {\n returnObjects: true,\n }),\n }),\n [t]\n );\n\n return (\n <Modal\n title={t('profile:updatePasswordModal.title')}\n visible={visible}\n okText={t('profile:updatePasswordModal.button')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='currentPassword'\n data={currentPasswordData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <InputPassword placeholder={data.placeholder} {...props} />\n </FormItem>\n )}\n />\n\n <Field\n name='password'\n data={passwordData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <InputPassword\n placeholder={data.placeholder}\n showStrengthMeter\n strengthNames={data.strengthNames}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <FormError />\n </Form>\n </FormProvider>\n </Modal>\n );\n};\n\nexport default ProfileUpdatePasswordModal;\n"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AAC/E,SAASC,YAAY,EAAEC,OAAO,QAAQ,iBAAiB;AAEvD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,SAAS,MAAM,qBAAqB;AAa3C,MAAMC,0BAAqE,GAAGA,CAAC;EAC7EC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAE,CAAC,GAAGP,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;EAEzC,MAAMQ,UAAU,GAAGT,OAAO,CACxB,OAAO;IACLU,eAAe,EAAE,EAAE;IACnBC,QAAQ,EAAE;EACZ,CAAC,CAAC,EACF,EACF,CAAC;EAED,MAAM;IAAEC,IAAI;IAAEC;EAAM,CAAC,GAAGjB,OAAO,CAACa,UAAU,CAAC;EAE3C,MAAM,CAACK,MAAM,EAAEC,OAAO,CAAC,GAAGb,WAAW,CAAAc,mCAAA,cAAAA,mCAAA,IAAAA,mCAAA,GAAAC,OAAA,gEAAAD,mCAAA,CAAAE,IAAA,IAAAF,mCAAA,CAAAE,IAAA,2CAAAC,OAAA,CAAAC,KAAA,sKAAAJ,mCAAA,CAUrC,CAAC;;EAED;EACAjB,SAAS,CAAC,MAAM;IACd,IAAIO,OAAO,EAAEM,IAAI,CAACS,K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,OAAO,EAAEA;EAAQ,gBAEjBV,KAAA,CAAAuC,aAAA,CAACzC,YAAY;IAACiB,IAAI,EAAEA;EAAK,gBACvBf,KAAA,CAAAuC,aAAA,CAAC9C,IAAI,qBACHO,KAAA,CAAAuC,aAAA,CAACvB,KAAK;IACJ4B,IAAI,EAAC,iBAAiB;IACtBC,IAAI,EAAEZ,mBAAoB;IAC1Ba,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAExB;IAAM,CAAC,EAAEsB,IAAI,kBAC7B7C,KAAA,CAAAuC,aAAA,CAAC7C,QAAQ;MAACwC,KAAK,EAAEW,IAAI,CAACX,KAAM;MAACX,KAAK,EAAEA;IAAM,gBACxCvB,KAAA,CAAAuC,aAAA,CAAC5C,aAAa,EAAAqD,QAAA;MAACb,WAAW,EAAEU,IAAI,CAACV;IAAY,GAAKY,KAAK,CAAG,CAClD;EACV,CACH,CAAC,eAEF/C,KAAA,CAAAuC,aAAA,CAACvB,KAAK;IACJ4B,IAAI,EAAC,UAAU;IACfC,IAAI,EAAET,YAAa;IACnBU,MAAM,EAAEA,CAACC,KAAK,EAAE;MAAExB;IAAM,CAAC,EAAEsB,IAAI,kBAC7B7C,KAAA,CAAAuC,aAAA,CAAC7C,QAAQ;MAACwC,KAAK,EAAEW,IAAI,CAACX,KAAM;MAACX,KAAK,EAAEA;IAAM,gBACxCvB,KAAA,CAAAuC,aAAA,CAAC5C,aAAa,EAAAqD,QAAA;MACZb,WAAW,EAAEU,IAAI,CAACV,WAAY;MAC9Bc,iBAAiB;MACjBZ,aAAa,EAAEQ,IAAI,CAACR;IAAc,GAC9BU,KAAK,CACV,CACO;EACV,CACH,CAAC,eAEF/C,KAAA,CAAAuC,aAAA,CAAChC,SAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAED,eAAeC,0BAA0B"}
|
|
1
|
+
{"version":3,"file":"ProfileUpdatePasswordModal.js","names":["Form","FormItem","InputPassword","message","Modal","FormProvider","useForm","React","useCallback","useEffect","useMemo","useTranslation","useMutation","handleFormErrors","FormError","ProfileUpdatePasswordModal","visible","onClose","t","initValues","currentPassword","password","form","Field","commit","loading","_ProfileUpdatePasswordModalMutation","require","hash","console","error","reset","onSubmit","variables","input","values","getAll","onError","onCompleted","success","currentPasswordData","label","placeholder","passwordData","strengthNames","returnObjects","createElement","title","okText","okLoading","onOk","name","data","render","props","_extends","showStrengthMeter"],"sources":["../../../../src/lib/components/profile/ProfileUpdatePasswordModal.tsx"],"sourcesContent":["import { Form, FormItem, InputPassword, message, Modal } from '@os-design/core';\nimport { FormProvider, useForm } from '@os-design/form';\nimport { graphql } from 'babel-plugin-relay/macro';\nimport React, { useCallback, useEffect, useMemo } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport { useMutation } from 'react-relay/hooks';\nimport handleFormErrors from '../../utils/handleFormErrors';\nimport FormError from '../shared/FormError';\nimport { ProfileUpdatePasswordModalMutation } from './__generated__/ProfileUpdatePasswordModalMutation.graphql';\n\ninterface ProfileUpdatePasswordFormData {\n currentPassword: string;\n password: string;\n}\n\ninterface ProfileUpdatePasswordModalProps {\n visible: boolean;\n onClose: () => void;\n}\n\nconst ProfileUpdatePasswordModal: React.FC<ProfileUpdatePasswordModalProps> = ({\n visible,\n onClose,\n}) => {\n const { t } = useTranslation(['profile']);\n\n const initValues = useMemo<ProfileUpdatePasswordFormData>(\n () => ({\n currentPassword: '',\n password: '',\n }),\n []\n );\n\n const { form, Field } = useForm(initValues);\n\n const [commit, loading] = useMutation<ProfileUpdatePasswordModalMutation>(\n graphql`\n mutation ProfileUpdatePasswordModalMutation(\n $input: UpdatePasswordInput!\n ) {\n updatePassword(input: $input) {\n id\n }\n }\n `\n );\n\n // Reset the form when the modal is opened\n useEffect(() => {\n if (visible) form.reset();\n }, [form, visible]);\n\n const onSubmit = useCallback(() => {\n commit({\n variables: {\n input: form.values.getAll(),\n },\n onError: (error) => handleFormErrors(form, error),\n onCompleted: () => {\n message.success(t('profile:updatePasswordModal.success'));\n onClose();\n },\n });\n }, [commit, form, onClose, t]);\n\n const currentPasswordData = useMemo(\n () => ({\n label: t('profile:updatePasswordModal.currentPassword.label'),\n placeholder: t('profile:updatePasswordModal.currentPassword.placeholder'),\n }),\n [t]\n );\n\n const passwordData = useMemo(\n () => ({\n label: t('profile:updatePasswordModal.newPassword.label'),\n placeholder: t('profile:updatePasswordModal.newPassword.placeholder'),\n strengthNames: t('profile:updatePasswordModal.passwordStrengthNames', {\n returnObjects: true,\n }),\n }),\n [t]\n );\n\n return (\n <Modal\n title={t('profile:updatePasswordModal.title')}\n visible={visible}\n okText={t('profile:updatePasswordModal.button')}\n okLoading={loading}\n onOk={onSubmit}\n onClose={onClose}\n >\n <FormProvider form={form}>\n <Form>\n <Field\n name='currentPassword'\n data={currentPasswordData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <InputPassword placeholder={data.placeholder} {...props} />\n </FormItem>\n )}\n />\n\n <Field\n name='password'\n data={passwordData}\n render={(props, { error }, data) => (\n <FormItem label={data.label} error={error}>\n <InputPassword\n placeholder={data.placeholder}\n showStrengthMeter\n strengthNames={data.strengthNames}\n {...props}\n />\n </FormItem>\n )}\n />\n\n <FormError />\n </Form>\n </FormProvider>\n </Modal>\n );\n};\n\nexport default ProfileUpdatePasswordModal;\n"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,OAAO,EAAEC,KAAK,QAAQ,iBAAiB;AAC/E,SAASC,YAAY,EAAEC,OAAO,QAAQ,iBAAiB;AAEvD,OAAOC,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,QAAQ,OAAO;AAC9D,SAASC,cAAc,QAAQ,eAAe;AAC9C,SAASC,WAAW,QAAQ,mBAAmB;AAC/C,OAAOC,gBAAgB,MAAM,8BAA8B;AAC3D,OAAOC,SAAS,MAAM,qBAAqB;AAa3C,MAAMC,0BAAqE,GAAGA,CAAC;EAC7EC,OAAO;EACPC;AACF,CAAC,KAAK;EACJ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EAAEA,CAACC,KAAK,EAAE;MAAExB;IAAM,CAAC,EAAEsB,IAAI,kBAC7B7C,KAAA,CAAAuC,aAAA,CAAC7C,QAAQ;MAACwC,KAAK,EAAEW,IAAI,CAACX,KAAM;MAACX,KAAK,EAAEA;IAAM,gBACxCvB,KAAA,CAAAuC,aAAA,CAAC5C,aAAa,EAAAqD,QAAA;MACZb,WAAW,EAAEU,IAAI,CAACV,WAAY;MAC9Bc,iBAAiB;MACjBZ,aAAa,EAAEQ,IAAI,CAACR;IAAc,GAC9BU,KAAK,CACV,CACO;EACV,CACH,CAAC,eAEF/C,KAAA,CAAAuC,aAAA,CAAChC,SAAS,MAAE,CACR,CACM,CACT,CAAC;AAEZ,CAAC;AAED,eAAeC,0BAA0B","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProtectedWrapper.js","names":["React","useMemo","useLazyLoadQuery","ErrorBoundary","ProfileConfigContext","ProfileContext","ProtectedWrapperLoader","children","profile","_ProtectedWrapperQuery","require","hash","console","error","fetchPolicy","profileContext","id","email","firstName","undefined","lastName","avatar","createElement","Provider","value","ProtectedWrapper","bucketId","profileConfigContext","fallback","window","location","href"],"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport graphql from 'babel-plugin-relay/macro';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport { ErrorBoundary } from '@os-design/utils';\nimport ProfileConfigContext from './ProfileConfigContext';\nimport ProfileContext from './ProfileContext';\nimport { ProtectedWrapperQuery } from './__generated__/ProtectedWrapperQuery.graphql';\n\ninterface ProtectedWrapperLoaderProps {\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapperLoader: React.FC<ProtectedWrapperLoaderProps> = ({\n children,\n}) => {\n const { profile } = useLazyLoadQuery<ProtectedWrapperQuery>(\n graphql`\n query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n }\n }\n `,\n {},\n { fetchPolicy: 'store-or-network' }\n );\n\n const profileContext = useMemo(\n () => ({\n id: profile.id,\n email: profile.email,\n firstName: profile.firstName || undefined,\n lastName: profile.lastName || undefined,\n avatar: profile.avatar || undefined,\n }),\n [\n profile.avatar,\n profile.email,\n profile.firstName,\n profile.id,\n profile.lastName,\n ]\n );\n\n return (\n <ProfileContext.Provider value={profileContext}>\n {children}\n </ProfileContext.Provider>\n );\n};\n\nexport interface ProtectedWrapperProps {\n bucketId: string;\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapper: React.FC<ProtectedWrapperProps> = ({\n bucketId,\n children,\n}) => {\n const profileConfigContext = useMemo(() => ({ bucketId }), [bucketId]);\n\n return (\n <ProfileConfigContext.Provider value={profileConfigContext}>\n <ErrorBoundary\n fallback={() => {\n window.location.href = '/auth/';\n return null;\n }}\n >\n <ProtectedWrapperLoader>{children}</ProtectedWrapperLoader>\n </ErrorBoundary>\n </ProfileConfigContext.Provider>\n );\n};\n\nexport default ProtectedWrapper;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,aAAa,QAAQ,kBAAkB;AAChD,OAAOC,oBAAoB,MAAM,wBAAwB;AACzD,OAAOC,cAAc,MAAM,kBAAkB;AAO7C,MAAMC,sBAA6D,GAAGA,CAAC;EACrEC;AACF,CAAC,KAAK;EACJ,MAAM;IAAEC;EAAQ,CAAC,GAAGN,gBAAgB,CAAAO,sBAAA,cAAAA,sBAAA,IAAAA,sBAAA,GAAAC,OAAA,mDAAAD,sBAAA,CAAAE,IAAA,IAAAF,sBAAA,CAAAE,IAAA,2CAAAC,OAAA,CAAAC,KAAA,yJAAAJ,sBAAA,GAYlC,CAAC,CAAC,EACF;IAAEK,WAAW,EAAE;EAAmB,CACpC,CAAC;EAED,MAAMC,cAAc,GAAGd,OAAO,CAC5B,OAAO;IACLe,EAAE,EAAER,OAAO,CAACQ,EAAE;IACdC,KAAK,EAAET,OAAO,CAACS,KAAK;IACpBC,SAAS,EAAEV,OAAO,CAACU,SAAS,IAAIC,SAAS;IACzCC,QAAQ,EAAEZ,OAAO,CAACY,QAAQ,IAAID,SAAS;IACvCE,MAAM,EAAEb,OAAO,CAACa,MAAM,IAAIF;EAC5B,CAAC,CAAC,EACF,CACEX,OAAO,CAACa,MAAM,EACdb,OAAO,CAACS,KAAK,EACbT,OAAO,CAACU,SAAS,EACjBV,OAAO,CAACQ,EAAE,EACVR,OAAO,CAACY,QAAQ,CAEpB,CAAC;EAED,oBACEpB,KAAA,CAAAsB,aAAA,CAACjB,cAAc,CAACkB,QAAQ;IAACC,KAAK,EAAET;EAAe,GAC5CR,QACsB,CAAC;AAE9B,CAAC;AAOD,MAAMkB,gBAAiD,GAAGA,CAAC;EACzDC,QAAQ;EACRnB;AACF,CAAC,KAAK;EACJ,MAAMoB,oBAAoB,GAAG1B,OAAO,CAAC,OAAO;IAAEyB;EAAS,CAAC,CAAC,EAAE,CAACA,QAAQ,CAAC,CAAC;EAEtE,oBACE1B,KAAA,CAAAsB,aAAA,CAAClB,oBAAoB,CAACmB,QAAQ;IAACC,KAAK,EAAEG;EAAqB,gBACzD3B,KAAA,CAAAsB,aAAA,CAACnB,aAAa;IACZyB,QAAQ,EAAEA,CAAA,KAAM;MACdC,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAG,QAAQ;MAC/B,OAAO,IAAI;IACb;EAAE,gBAEF/B,KAAA,CAAAsB,aAAA,CAAChB,sBAAsB,QAAEC,QAAiC,CAC7C,CACc,CAAC;AAEpC,CAAC;AAED,eAAekB,gBAAgB"}
|
|
1
|
+
{"version":3,"file":"ProtectedWrapper.js","names":["React","useMemo","useLazyLoadQuery","ErrorBoundary","ProfileConfigContext","ProfileContext","ProtectedWrapperLoader","children","profile","_ProtectedWrapperQuery","require","hash","console","error","fetchPolicy","profileContext","id","email","firstName","undefined","lastName","avatar","createElement","Provider","value","ProtectedWrapper","bucketId","profileConfigContext","fallback","window","location","href"],"sources":["../../../../src/lib/components/profile/ProtectedWrapper.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport graphql from 'babel-plugin-relay/macro';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport { ErrorBoundary } from '@os-design/utils';\nimport ProfileConfigContext from './ProfileConfigContext';\nimport ProfileContext from './ProfileContext';\nimport { ProtectedWrapperQuery } from './__generated__/ProtectedWrapperQuery.graphql';\n\ninterface ProtectedWrapperLoaderProps {\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapperLoader: React.FC<ProtectedWrapperLoaderProps> = ({\n children,\n}) => {\n const { profile } = useLazyLoadQuery<ProtectedWrapperQuery>(\n graphql`\n query ProtectedWrapperQuery {\n profile {\n id\n email\n firstName\n lastName\n avatar\n }\n }\n `,\n {},\n { fetchPolicy: 'store-or-network' }\n );\n\n const profileContext = useMemo(\n () => ({\n id: profile.id,\n email: profile.email,\n firstName: profile.firstName || undefined,\n lastName: profile.lastName || undefined,\n avatar: profile.avatar || undefined,\n }),\n [\n profile.avatar,\n profile.email,\n profile.firstName,\n profile.id,\n profile.lastName,\n ]\n );\n\n return (\n <ProfileContext.Provider value={profileContext}>\n {children}\n </ProfileContext.Provider>\n );\n};\n\nexport interface ProtectedWrapperProps {\n bucketId: string;\n children?: React.ReactNode;\n}\n\nconst ProtectedWrapper: React.FC<ProtectedWrapperProps> = ({\n bucketId,\n children,\n}) => {\n const profileConfigContext = useMemo(() => ({ bucketId }), [bucketId]);\n\n return (\n <ProfileConfigContext.Provider value={profileConfigContext}>\n <ErrorBoundary\n fallback={() => {\n window.location.href = '/auth/';\n return null;\n }}\n >\n <ProtectedWrapperLoader>{children}</ProtectedWrapperLoader>\n </ErrorBoundary>\n </ProfileConfigContext.Provider>\n );\n};\n\nexport default ProtectedWrapper;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AAEtC,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,aAAa,Q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AqB,gBACzD3B,KAAA,CAAAsB,aAAA,CAACnB,aAAa;IACZyB,QAAQ,EAAEA,CAAA,KAAM;MACdC,MAAM,CAACC,QAAQ,CAACC,IAAI,GAAG,QAAQ;MAC/B,OAAO,IAAI;IACb;EAAE,gBAEF/B,KAAA,CAAAsB,aAAA,CAAChB,sBAAsB,QAAEC,QAAiC,CAC7C,CACc,CAAC;AAEpC,CAAC;AAED,eAAekB,gBAAgB","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
3
|
import { Avatar } from '@os-design/core';
|
|
4
4
|
import { useProfile } from './ProfileContext';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAvatar.js","names":["React","useMemo","Avatar","useProfile","useProfileConfig","UserAvatar","props","email","firstName","lastName","avatar","bucketId","avatarProps","image","undefined","createElement","_extends"],"sources":["../../../../src/lib/components/profile/UserAvatar.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Avatar, AvatarProps } from '@os-design/core';\nimport { useProfile } from './ProfileContext';\nimport { useProfileConfig } from './ProfileConfigContext';\n\nconst UserAvatar: React.FC<AvatarProps> = (props) => {\n const { email, firstName, lastName, avatar } = useProfile();\n const { bucketId } = useProfileConfig();\n\n const avatarProps = useMemo(() => {\n if (firstName || lastName) return { firstName, lastName };\n return { firstName: email };\n }, [email, firstName, lastName]);\n\n const image = useMemo(() => {\n if (!avatar) return undefined;\n return `https://storage.yandexcloud.net/${bucketId}/users/${avatar}`;\n }, [avatar, bucketId]);\n\n return <Avatar {...avatarProps} image={image} {...props} />;\n};\n\nexport default UserAvatar;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,MAAM,QAAqB,iBAAiB;AACrD,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,gBAAgB,QAAQ,wBAAwB;AAEzD,MAAMC,UAAiC,GAAIC,KAAK,IAAK;EACnD,MAAM;IAAEC,KAAK;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGP,UAAU,CAAC,CAAC;EAC3D,MAAM;IAAEQ;EAAS,CAAC,GAAGP,gBAAgB,CAAC,CAAC;EAEvC,MAAMQ,WAAW,GAAGX,OAAO,CAAC,MAAM;IAChC,IAAIO,SAAS,IAAIC,QAAQ,EAAE,OAAO;MAAED,SAAS;MAAEC;IAAS,CAAC;IACzD,OAAO;MAAED,SAAS,EAAED;IAAM,CAAC;EAC7B,CAAC,EAAE,CAACA,KAAK,EAAEC,SAAS,EAAEC,QAAQ,CAAC,CAAC;EAEhC,MAAMI,KAAK,GAAGZ,OAAO,CAAC,MAAM;IAC1B,IAAI,CAACS,MAAM,EAAE,OAAOI,SAAS;IAC7B,
|
|
1
|
+
{"version":3,"file":"UserAvatar.js","names":["React","useMemo","Avatar","useProfile","useProfileConfig","UserAvatar","props","email","firstName","lastName","avatar","bucketId","avatarProps","image","undefined","createElement","_extends"],"sources":["../../../../src/lib/components/profile/UserAvatar.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { Avatar, AvatarProps } from '@os-design/core';\nimport { useProfile } from './ProfileContext';\nimport { useProfileConfig } from './ProfileConfigContext';\n\nconst UserAvatar: React.FC<AvatarProps> = (props) => {\n const { email, firstName, lastName, avatar } = useProfile();\n const { bucketId } = useProfileConfig();\n\n const avatarProps = useMemo(() => {\n if (firstName || lastName) return { firstName, lastName };\n return { firstName: email };\n }, [email, firstName, lastName]);\n\n const image = useMemo(() => {\n if (!avatar) return undefined;\n return `https://storage.yandexcloud.net/${bucketId}/users/${avatar}`;\n }, [avatar, bucketId]);\n\n return <Avatar {...avatarProps} image={image} {...props} />;\n};\n\nexport default UserAvatar;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,OAAO,QAAQ,OAAO;AACtC,SAASC,MAAM,QAAqB,iBAAiB;AACrD,SAASC,UAAU,QAAQ,kBAAkB;AAC7C,SAASC,gBAAgB,QAAQ,wBAAwB;AAEzD,MAAMC,UAAiC,GAAIC,KAAK,IAAK;EACnD,MAAM;IAAEC,KAAK;IAAEC,SAAS;IAAEC,QAAQ;IAAEC;EAAO,CAAC,GAAGP,UAAU,CAAC,CAAC;EAC3D,MAAM;IAAEQ;EAAS,CAAC,GAAGP,gBAAgB,CAAC,CAAC;EAEvC,MAAMQ,WAAW,GAAGX,OAAO,CAAC,MAAM;IAChC,IAAIO,SAAS,IAAIC,QAAQ,EAAE,OAAO;MAAED,SAAS;MAAEC;IAAS,CAAC;IACzD,OAAO;MAAED,SAAS,EAAED;IAAM,CAAC;EAC7B,CAAC,EAAE,CAACA,KAAK,EAAEC,SAAS,EAAEC,QAAQ,CAAC,CAAC;EAEhC,MAAMI,KAAK,GAAGZ,OAAO,CAAC,MAAM;IAC1B,IAAI,CAACS,MAAM,EAAE,OAAOI,SAAS;IAC7B,OAAO,mCAAmCH,QAAQ,UAAUD,MAAM,EAAE;EACtE,CAAC,EAAE,CAACA,MAAM,EAAEC,QAAQ,CAAC,CAAC;EAEtB,oBAAOX,KAAA,CAAAe,aAAA,CAACb,MAAM,EAAAc,QAAA,KAAKJ,WAAW;IAAEC,KAAK,EAAEA;EAAM,GAAKP,KAAK,CAAG,CAAC;AAC7D,CAAC;AAED,eAAeD,UAAU","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ThemeOverrider } from '@os-design/theming';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserAvatarAddon.js","names":["React","ThemeOverrider","styled","resetFocusStyles","transitionStyles","UserAvatar","Addon","div","p","theme","navigationSideWidth","AVATAR_SIZE","StyledUserAvatar","UserAvatarAddon","onClick","rest","createElement","overrides","avatarOnlineColorScoop","navigationColorBg","_extends","online","size","tabIndex","role","onKeyDown","e","key","onMouseDown","preventDefault"],"sources":["../../../../src/lib/components/profile/UserAvatarAddon.tsx"],"sourcesContent":["import React from 'react';\nimport { ThemeOverrider } from '@os-design/theming';\nimport styled from '@emotion/styled';\nimport { resetFocusStyles, transitionStyles } from '@os-design/styles';\nimport { AvatarProps } from '@os-design/core';\nimport UserAvatar from './UserAvatar';\n\nexport interface UserAvatarAddonProps extends AvatarProps {\n onClick?: () => void;\n}\n\nconst Addon = styled.div`\n width: 100%;\n height: ${(p) => p.theme.navigationSideWidth}em;\n min-height: ${(p) => p.theme.navigationSideWidth}em;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst AVATAR_SIZE = 2.5;\n\nconst StyledUserAvatar = styled(UserAvatar)`\n ${resetFocusStyles};\n cursor: pointer;\n\n @media (hover: hover) {\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n ${transitionStyles('opacity')};\n }\n`;\n\nconst UserAvatarAddon: React.FC<UserAvatarAddonProps> = ({\n onClick = () => {},\n ...rest\n}) => (\n <Addon>\n <ThemeOverrider\n overrides={(theme) => ({\n avatarOnlineColorScoop: theme.navigationColorBg,\n })}\n >\n <StyledUserAvatar\n online\n size={`${AVATAR_SIZE}em`}\n tabIndex={0}\n role='button'\n onClick={onClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onClick();\n }}\n onMouseDown={(e) => e.preventDefault()}\n {...rest}\n />\n </ThemeOverrider>\n </Addon>\n);\n\nexport default UserAvatarAddon;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,oBAAoB;AACnD,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,mBAAmB;AAEtE,OAAOC,UAAU,MAAM,cAAc;AAMrC,MAAMC,KAAK,GAAGJ,MAAM,CAACK,
|
|
1
|
+
{"version":3,"file":"UserAvatarAddon.js","names":["React","ThemeOverrider","styled","resetFocusStyles","transitionStyles","UserAvatar","Addon","div","p","theme","navigationSideWidth","AVATAR_SIZE","StyledUserAvatar","UserAvatarAddon","onClick","rest","createElement","overrides","avatarOnlineColorScoop","navigationColorBg","_extends","online","size","tabIndex","role","onKeyDown","e","key","onMouseDown","preventDefault"],"sources":["../../../../src/lib/components/profile/UserAvatarAddon.tsx"],"sourcesContent":["import React from 'react';\nimport { ThemeOverrider } from '@os-design/theming';\nimport styled from '@emotion/styled';\nimport { resetFocusStyles, transitionStyles } from '@os-design/styles';\nimport { AvatarProps } from '@os-design/core';\nimport UserAvatar from './UserAvatar';\n\nexport interface UserAvatarAddonProps extends AvatarProps {\n onClick?: () => void;\n}\n\nconst Addon = styled.div`\n width: 100%;\n height: ${(p) => p.theme.navigationSideWidth}em;\n min-height: ${(p) => p.theme.navigationSideWidth}em;\n display: flex;\n justify-content: center;\n align-items: center;\n`;\n\nconst AVATAR_SIZE = 2.5;\n\nconst StyledUserAvatar = styled(UserAvatar)`\n ${resetFocusStyles};\n cursor: pointer;\n\n @media (hover: hover) {\n &:hover,\n &:focus {\n opacity: 0.7;\n }\n ${transitionStyles('opacity')};\n }\n`;\n\nconst UserAvatarAddon: React.FC<UserAvatarAddonProps> = ({\n onClick = () => {},\n ...rest\n}) => (\n <Addon>\n <ThemeOverrider\n overrides={(theme) => ({\n avatarOnlineColorScoop: theme.navigationColorBg,\n })}\n >\n <StyledUserAvatar\n online\n size={`${AVATAR_SIZE}em`}\n tabIndex={0}\n role='button'\n onClick={onClick}\n onKeyDown={(e) => {\n if (e.key === 'Enter') onClick();\n }}\n onMouseDown={(e) => e.preventDefault()}\n {...rest}\n />\n </ThemeOverrider>\n </Addon>\n);\n\nexport default UserAvatarAddon;\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,cAAc,QAAQ,oBAAoB;AACnD,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,gBAAgB,EAAEC,gBAAgB,QAAQ,mBAAmB;AAEtE,OAAOC,UAAU,MAAM,cAAc;AAMrC,MAAMC,KAAK,GAAGJ,MAAM,CAACK,GAAG;AACxB;AACA,YAAaC,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,mBAAmB;AAC9C,gBAAiBF,CAAC,IAAKA,CAAC,CAACC,KAAK,CAACC,mBAAmB;AAClD;AACA;AACA;AACA,CAAC;AAED,MAAMC,WAAW,GAAG,GAAG;AAEvB,MAAMC,gBAAgB,GAAGV,MAAM,CAACG,UAAU,CAAC;AAC3C,IAAIF,gBAAgB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,CAAC,SAAS,CAAC;AACjC;AACA,CAAC;AAED,MAAMS,eAA+C,GAAGA,CAAC;EACvDC,OAAO,GAAGA,CAAA,KAAM,CAAC,CAAC;EAClB,GAAGC;AACL,CAAC,kBACCf,KAAA,CAAAgB,aAAA,CAACV,KAAK,qBACJN,KAAA,CAAAgB,aAAA,CAACf,cAAc;EACbgB,SAAS,EAAGR,KAAK,KAAM;IACrBS,sBAAsB,EAAET,KAAK,CAACU;EAChC,CAAC;AAAE,gBAEHnB,KAAA,CAAAgB,aAAA,CAACJ,gBAAgB,EAAAQ,QAAA;EACfC,MAAM;EACNC,IAAI,EAAE,GAAGX,WAAW,IAAK;EACzBY,QAAQ,EAAE,CAAE;EACZC,IAAI,EAAC,QAAQ;EACbV,OAAO,EAAEA,OAAQ;EACjBW,SAAS,EAAGC,CAAC,IAAK;IAChB,IAAIA,CAAC,CAACC,GAAG,KAAK,OAAO,EAAEb,OAAO,CAAC,CAAC;EAClC,CAAE;EACFc,WAAW,EAAGF,CAAC,IAAKA,CAAC,CAACG,cAAc,CAAC;AAAE,GACnCd,IAAI,CACT,CACa,CACX,CACR;AAED,eAAeF,eAAe","ignoreList":[]}
|
package/dist/esm/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawerContentSignOutMutation.graphql.js","names":["node","v0","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<e33309fd987bdd6745cb67403591410c>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type ProfileDrawerContentSignOutMutation$variables = Record<PropertyKey, never>;\nexport type ProfileDrawerContentSignOutMutation$data = {\n readonly signOut: {\n readonly ok: boolean;\n };\n};\nexport type ProfileDrawerContentSignOutMutation = {\n response: ProfileDrawerContentSignOutMutation$data;\n variables: ProfileDrawerContentSignOutMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"StatusPayload\",\n \"kind\": \"LinkedField\",\n \"name\": \"signOut\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"ok\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileDrawerContentSignOutMutation\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProfileDrawerContentSignOutMutation\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"f5241cc562af19628cf38a9731067807\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileDrawerContentSignOutMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileDrawerContentSignOutMutation {\\n signOut {\\n ok\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"c7ca96e9e713315606b0c22d196b6f7b\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAcA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;IACE,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,eAAe;IAC/B,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,CACZ;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,IAAI;MACZ,YAAY,EAAE;IAChB,CAAC,CACF;IACD,YAAY,EAAE;EAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,qCAAqC;MAC7C,YAAY,EAAGA,EAAE,UAAU;MAC3B,MAAM,EAAE,UAAU;MAClB,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,qCAAqC;MAC7C,YAAY,EAAGA,EAAE;IACnB,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,qCAAqC;MAC7C,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAEvD,eAAeF,IAAI"}
|
|
1
|
+
{"version":3,"file":"ProfileDrawerContentSignOutMutation.graphql.js","names":["node","v0","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerContentSignOutMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<e33309fd987bdd6745cb67403591410c>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type ProfileDrawerContentSignOutMutation$variables = Record<PropertyKey, never>;\nexport type ProfileDrawerContentSignOutMutation$data = {\n readonly signOut: {\n readonly ok: boolean;\n };\n};\nexport type ProfileDrawerContentSignOutMutation = {\n response: ProfileDrawerContentSignOutMutation$data;\n variables: ProfileDrawerContentSignOutMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"StatusPayload\",\n \"kind\": \"LinkedField\",\n \"name\": \"signOut\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"ok\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileDrawerContentSignOutMutation\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProfileDrawerContentSignOutMutation\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"f5241cc562af19628cf38a9731067807\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileDrawerContentSignOutMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileDrawerContentSignOutMutation {\\n signOut {\\n ok\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"c7ca96e9e713315606b0c22d196b6f7b\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAcA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;IACE,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,eAAe;IAC/B,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,CACZ;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,IAAI;MACZ,YAAY,EAAE;IAChB,CAAC,CACF;IACD,YAAY,EAAE;EAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,qCAAqC;MAC7C,YAAY,EAAGA,EAAE,UAAU;MAC3B,MAAM,EAAE,UAAU;MAClB,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,qCAAqC;MAC7C,YAAY,EAAGA,EAAE;IACnB,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,qCAAqC;MAC7C,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAEvD,eAAeF,IAAI","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileDrawerContentUpdateAvatarMutation.graphql.js","names":["node","v0","v1","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<f226c7545c1a2047606c6dcebdb03728>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdateAvatarInput = {\n avatar?: any | null | undefined;\n};\nexport type ProfileDrawerContentUpdateAvatarMutation$variables = {\n input: UpdateAvatarInput;\n};\nexport type ProfileDrawerContentUpdateAvatarMutation$data = {\n readonly updateAvatar: {\n readonly avatar: string | null | undefined;\n readonly id: string;\n };\n};\nexport type ProfileDrawerContentUpdateAvatarMutation = {\n response: ProfileDrawerContentUpdateAvatarMutation$data;\n variables: ProfileDrawerContentUpdateAvatarMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"alias\": null,\n \"args\": [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n ],\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateAvatar\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"avatar\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileDrawerContentUpdateAvatarMutation\",\n \"selections\": (v1/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileDrawerContentUpdateAvatarMutation\",\n \"selections\": (v1/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"b749732615af9f8027386d69ffb57b63\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileDrawerContentUpdateAvatarMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileDrawerContentUpdateAvatarMutation(\\n $input: UpdateAvatarInput!\\n) {\\n updateAvatar(input: $input) {\\n id\\n avatar\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"cf72a6314772ed0d1f182b197c858505\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAoBA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;MACE,cAAc,EAAE,IAAI;MACpB,MAAM,EAAE,eAAe;MACvB,MAAM,EAAE;IACV,CAAC,CACF;IACDC,EAAE,GAAG,CACH;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,CACN;QACE,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,OAAO;QACf,cAAc,EAAE;MAClB,CAAC,CACF;MACD,cAAc,EAAE,MAAM;MACtB,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,cAAc;MACtB,QAAQ,EAAE,KAAK;MACf,YAAY,EAAE,CACZ;QACE,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE;MAChB,CAAC,EACD;QACE,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,QAAQ;QAChB,YAAY,EAAE;MAChB,CAAC,CACF;MACD,YAAY,EAAE;IAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAGD,EAAE,UAAU;MACpC,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,0CAA0C;MAClD,YAAY,EAAGC,EAAE,UAAU;MAC3B,MAAM,EAAE,UAAU;MAClB,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAGD,EAAE,UAAU;MACpC,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,0CAA0C;MAClD,YAAY,EAAGC,EAAE;IACnB,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,0CAA0C;MAClD,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHF,IAAI,CAASG,IAAI,GAAG,kCAAkC;AAEvD,eAAeH,IAAI"}
|
|
1
|
+
{"version":3,"file":"ProfileDrawerContentUpdateAvatarMutation.graphql.js","names":["node","v0","v1","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileDrawerContentUpdateAvatarMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<f226c7545c1a2047606c6dcebdb03728>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdateAvatarInput = {\n avatar?: any | null | undefined;\n};\nexport type ProfileDrawerContentUpdateAvatarMutation$variables = {\n input: UpdateAvatarInput;\n};\nexport type ProfileDrawerContentUpdateAvatarMutation$data = {\n readonly updateAvatar: {\n readonly avatar: string | null | undefined;\n readonly id: string;\n };\n};\nexport type ProfileDrawerContentUpdateAvatarMutation = {\n response: ProfileDrawerContentUpdateAvatarMutation$data;\n variables: ProfileDrawerContentUpdateAvatarMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"alias\": null,\n \"args\": [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n ],\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateAvatar\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"avatar\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileDrawerContentUpdateAvatarMutation\",\n \"selections\": (v1/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileDrawerContentUpdateAvatarMutation\",\n \"selections\": (v1/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"b749732615af9f8027386d69ffb57b63\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileDrawerContentUpdateAvatarMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileDrawerContentUpdateAvatarMutation(\\n $input: UpdateAvatarInput!\\n) {\\n updateAvatar(input: $input) {\\n id\\n avatar\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"cf72a6314772ed0d1f182b197c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AAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,0CAA0C;MAClD,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHF,IAAI,CAASG,IAAI,GAAG,kCAAkC;AAEvD,eAAeH,IAAI","ignoreList":[]}
|
package/dist/esm/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileUpdateNameModalMutation.graphql.js","names":["node","v0","v1","v2","v3","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<26e40d9447fce4f5b8a56a5ff2f1fc8e>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdateProfileInput = {\n firstName?: string | null | undefined;\n lastName?: string | null | undefined;\n};\nexport type ProfileUpdateNameModalMutation$variables = {\n input: UpdateProfileInput;\n};\nexport type ProfileUpdateNameModalMutation$data = {\n readonly updateProfile: {\n readonly firstName: string | null | undefined;\n readonly lastName: string | null | undefined;\n };\n};\nexport type ProfileUpdateNameModalMutation = {\n response: ProfileUpdateNameModalMutation$data;\n variables: ProfileUpdateNameModalMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n],\nv2 = {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"firstName\",\n \"storageKey\": null\n},\nv3 = {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"lastName\",\n \"storageKey\": null\n};\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": (v1/*: any*/),\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateProfile\",\n \"plural\": false,\n \"selections\": [\n (v2/*: any*/),\n (v3/*: any*/)\n ],\n \"storageKey\": null\n }\n ],\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": (v1/*: any*/),\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateProfile\",\n \"plural\": false,\n \"selections\": [\n (v2/*: any*/),\n (v3/*: any*/),\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n ]\n },\n \"params\": {\n \"cacheID\": \"f70f0aaabf917dc446c3a71cf7b4f25f\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileUpdateNameModalMutation(\\n $input: UpdateProfileInput!\\n) {\\n updateProfile(input: $input) {\\n firstName\\n lastName\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"7264a05b6738d5417df9f1dc462486aa\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAqBA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;MACE,cAAc,EAAE,IAAI;MACpB,MAAM,EAAE,eAAe;MACvB,MAAM,EAAE;IACV,CAAC,CACF;IACDC,EAAE,GAAG,CACH;MACE,MAAM,EAAE,U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,YAAY,EAAE;QAChB,CAAC,CACF;QACD,YAAY,EAAE;MAChB,CAAC;IAEL,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,gCAAgC;MACxC,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHJ,IAAI,CAASK,IAAI,GAAG,kCAAkC;AAEvD,eAAeL,IAAI"}
|
|
1
|
+
{"version":3,"file":"ProfileUpdateNameModalMutation.graphql.js","names":["node","v0","v1","v2","v3","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdateNameModalMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<26e40d9447fce4f5b8a56a5ff2f1fc8e>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdateProfileInput = {\n firstName?: string | null | undefined;\n lastName?: string | null | undefined;\n};\nexport type ProfileUpdateNameModalMutation$variables = {\n input: UpdateProfileInput;\n};\nexport type ProfileUpdateNameModalMutation$data = {\n readonly updateProfile: {\n readonly firstName: string | null | undefined;\n readonly lastName: string | null | undefined;\n };\n};\nexport type ProfileUpdateNameModalMutation = {\n response: ProfileUpdateNameModalMutation$data;\n variables: ProfileUpdateNameModalMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n],\nv2 = {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"firstName\",\n \"storageKey\": null\n},\nv3 = {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"lastName\",\n \"storageKey\": null\n};\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": (v1/*: any*/),\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateProfile\",\n \"plural\": false,\n \"selections\": [\n (v2/*: any*/),\n (v3/*: any*/)\n ],\n \"storageKey\": null\n }\n ],\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"selections\": [\n {\n \"alias\": null,\n \"args\": (v1/*: any*/),\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updateProfile\",\n \"plural\": false,\n \"selections\": [\n (v2/*: any*/),\n (v3/*: any*/),\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n ]\n },\n \"params\": {\n \"cacheID\": \"f70f0aaabf917dc446c3a71cf7b4f25f\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileUpdateNameModalMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileUpdateNameModalMutation(\\n $input: UpdateProfileInput!\\n) {\\n updateProfile(input: $input) {\\n firstName\\n lastName\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"7264a05b6738d5417df9f1dc462486aa\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAqBA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;MACE,cAAc,EAAE,IAAI;MACpB,MAAM,EAAE,eAAe;MACvB,MAAM,EAAE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AAI;UACZ,MAAM,EAAE,aAAa;UACrB,MAAM,EAAE,IAAI;UACZ,YAAY,EAAE;QAChB,CAAC,CACF;QACD,YAAY,EAAE;MAChB,CAAC;IAEL,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,gCAAgC;MACxC,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHJ,IAAI,CAASK,IAAI,GAAG,kCAAkC;AAEvD,eAAeL,IAAI","ignoreList":[]}
|
package/dist/esm/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProfileUpdatePasswordModalMutation.graphql.js","names":["node","v0","v1","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<9f61f220f29facf328ddeea77698279f>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdatePasswordInput = {\n currentPassword: string;\n password: string;\n};\nexport type ProfileUpdatePasswordModalMutation$variables = {\n input: UpdatePasswordInput;\n};\nexport type ProfileUpdatePasswordModalMutation$data = {\n readonly updatePassword: {\n readonly id: string;\n };\n};\nexport type ProfileUpdatePasswordModalMutation = {\n response: ProfileUpdatePasswordModalMutation$data;\n variables: ProfileUpdatePasswordModalMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"alias\": null,\n \"args\": [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n ],\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updatePassword\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileUpdatePasswordModalMutation\",\n \"selections\": (v1/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileUpdatePasswordModalMutation\",\n \"selections\": (v1/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"64308136a7a18e3fb1ab2d16aa93add7\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileUpdatePasswordModalMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileUpdatePasswordModalMutation(\\n $input: UpdatePasswordInput!\\n) {\\n updatePassword(input: $input) {\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"efa37ccbe82fbace709f7e3992643c05\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAoBA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;MACE,cAAc,EAAE,IAAI;MACpB,MAAM,EAAE,eAAe;MACvB,MAAM,EAAE;IACV,CAAC,CACF;IACDC,EAAE,GAAG,CACH;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,CACN;QACE,MAAM,EAAE,UAAU;QAClB,MAAM,EAAE,OAAO;QACf,cAAc,EAAE;MAClB,CAAC,CACF;MACD,cAAc,EAAE,MAAM;MACtB,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,gBAAgB;MACxB,QAAQ,EAAE,KAAK;MACf,YAAY,EAAE,CACZ;QACE,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE,IAAI;QACZ,YAAY,EAAE;MAChB,CAAC,CACF;MACD,YAAY,EAAE;IAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAGD,EAAE,UAAU;MACpC,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,oCAAoC;MAC5C,YAAY,EAAGC,EAAE,UAAU;MAC3B,MAAM,EAAE,UAAU;MAClB,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAGD,EAAE,UAAU;MACpC,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,oCAAoC;MAC5C,YAAY,EAAGC,EAAE;IACnB,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,oCAAoC;MAC5C,eAAe,EAAE,UAAU;MAC3B,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHF,IAAI,CAASG,IAAI,GAAG,kCAAkC;AAEvD,eAAeH,IAAI"}
|
|
1
|
+
{"version":3,"file":"ProfileUpdatePasswordModalMutation.graphql.js","names":["node","v0","v1","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProfileUpdatePasswordModalMutation.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<9f61f220f29facf328ddeea77698279f>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Mutation } from 'relay-runtime';\nexport type UpdatePasswordInput = {\n currentPassword: string;\n password: string;\n};\nexport type ProfileUpdatePasswordModalMutation$variables = {\n input: UpdatePasswordInput;\n};\nexport type ProfileUpdatePasswordModalMutation$data = {\n readonly updatePassword: {\n readonly id: string;\n };\n};\nexport type ProfileUpdatePasswordModalMutation = {\n response: ProfileUpdatePasswordModalMutation$data;\n variables: ProfileUpdatePasswordModalMutation$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"defaultValue\": null,\n \"kind\": \"LocalArgument\",\n \"name\": \"input\"\n }\n],\nv1 = [\n {\n \"alias\": null,\n \"args\": [\n {\n \"kind\": \"Variable\",\n \"name\": \"input\",\n \"variableName\": \"input\"\n }\n ],\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"updatePassword\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProfileUpdatePasswordModalMutation\",\n \"selections\": (v1/*: any*/),\n \"type\": \"Mutation\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": (v0/*: any*/),\n \"kind\": \"Operation\",\n \"name\": \"ProfileUpdatePasswordModalMutation\",\n \"selections\": (v1/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"64308136a7a18e3fb1ab2d16aa93add7\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProfileUpdatePasswordModalMutation\",\n \"operationKind\": \"mutation\",\n \"text\": \"mutation ProfileUpdatePasswordModalMutation(\\n $input: UpdatePasswordInput!\\n) {\\n updatePassword(input: $input) {\\n id\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"efa37ccbe82fbace709f7e3992643c05\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAoBA,MAAMA,IAAqB,GAAI,YAAU;EACzC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-
{"version":3,"file":"ProtectedWrapperQuery.graphql.js","names":["node","v0","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<0489a6f56dfca495d1c3633c9a224274>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Query } from 'relay-runtime';\nexport type ProtectedWrapperQuery$variables = Record<PropertyKey, never>;\nexport type ProtectedWrapperQuery$data = {\n readonly profile: {\n readonly avatar: string | null | undefined;\n readonly email: string;\n readonly firstName: string | null | undefined;\n readonly id: string;\n readonly lastName: string | null | undefined;\n };\n};\nexport type ProtectedWrapperQuery = {\n response: ProtectedWrapperQuery$data;\n variables: ProtectedWrapperQuery$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"profile\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"email\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"firstName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"lastName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"avatar\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Query\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"c77ada94a5456167ef4c0c17a1fd7cd7\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProtectedWrapperQuery\",\n \"operationKind\": \"query\",\n \"text\": \"query ProtectedWrapperQuery {\\n profile {\\n id\\n email\\n firstName\\n lastName\\n avatar\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"903b234e48f53b4a44dc0b4974ebc521\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAkBA,MAAMA,IAAqB,GAAI,YAAU;EACzC,IAAIC,EAAE,GAAG,CACP;IACE,OAAO,EAAE,IAAI;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,MAAM;IACtB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,SAAS;IACjB,QAAQ,EAAE,KAAK;IACf,YAAY,EAAE,CACZ;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,IAAI;MACZ,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,OAAO;MACf,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,WAAW;MACnB,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,UAAU;MAClB,YAAY,EAAE;IAChB,CAAC,EACD;MACE,OAAO,EAAE,IAAI;MACb,MAAM,EAAE,IAAI;MACZ,MAAM,EAAE,aAAa;MACrB,MAAM,EAAE,QAAQ;MAChB,YAAY,EAAE;IAChB,CAAC,CACF;IACD,YAAY,EAAE;EAChB,CAAC,CACF;EACD,OAAO;IACL,UAAU,EAAE;MACV,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,UAAU;MAClB,UAAU,EAAE,IAAI;MAChB,MAAM,EAAE,uBAAuB;MAC/B,YAAY,EAAGA,EAAE,UAAU;MAC3B,MAAM,EAAE,OAAO;MACf,aAAa,EAAE;IACjB,CAAC;IACD,MAAM,EAAE,SAAS;IACjB,WAAW,EAAE;MACX,qBAAqB,EAAE,EAAE;MACzB,MAAM,EAAE,WAAW;MACnB,MAAM,EAAE,uBAAuB;MAC/B,YAAY,EAAGA,EAAE;IACnB,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,uBAAuB;MAC/B,eAAe,EAAE,OAAO;MACxB,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAEvD,eAAeF,IAAI"}
|
|
1
|
+
{"version":3,"file":"ProtectedWrapperQuery.graphql.js","names":["node","v0","hash"],"sources":["../../../../../src/lib/components/profile/__generated__/ProtectedWrapperQuery.graphql.ts"],"sourcesContent":["/**\n * @generated SignedSource<<0489a6f56dfca495d1c3633c9a224274>>\n * @lightSyntaxTransform\n * @nogrep\n */\n\n/* tslint:disable */\n/* eslint-disable */\n// @ts-nocheck\n\nimport { ConcreteRequest, Query } from 'relay-runtime';\nexport type ProtectedWrapperQuery$variables = Record<PropertyKey, never>;\nexport type ProtectedWrapperQuery$data = {\n readonly profile: {\n readonly avatar: string | null | undefined;\n readonly email: string;\n readonly firstName: string | null | undefined;\n readonly id: string;\n readonly lastName: string | null | undefined;\n };\n};\nexport type ProtectedWrapperQuery = {\n response: ProtectedWrapperQuery$data;\n variables: ProtectedWrapperQuery$variables;\n};\n\nconst node: ConcreteRequest = (function(){\nvar v0 = [\n {\n \"alias\": null,\n \"args\": null,\n \"concreteType\": \"User\",\n \"kind\": \"LinkedField\",\n \"name\": \"profile\",\n \"plural\": false,\n \"selections\": [\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"id\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"email\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"firstName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"lastName\",\n \"storageKey\": null\n },\n {\n \"alias\": null,\n \"args\": null,\n \"kind\": \"ScalarField\",\n \"name\": \"avatar\",\n \"storageKey\": null\n }\n ],\n \"storageKey\": null\n }\n];\nreturn {\n \"fragment\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Fragment\",\n \"metadata\": null,\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/),\n \"type\": \"Query\",\n \"abstractKey\": null\n },\n \"kind\": \"Request\",\n \"operation\": {\n \"argumentDefinitions\": [],\n \"kind\": \"Operation\",\n \"name\": \"ProtectedWrapperQuery\",\n \"selections\": (v0/*: any*/)\n },\n \"params\": {\n \"cacheID\": \"c77ada94a5456167ef4c0c17a1fd7cd7\",\n \"id\": null,\n \"metadata\": {},\n \"name\": \"ProtectedWrapperQuery\",\n \"operationKind\": \"query\",\n \"text\": \"query ProtectedWrapperQuery {\\n profile {\\n id\\n email\\n firstName\\n lastName\\n avatar\\n }\\n}\\n\"\n }\n};\n})();\n\n(node as any).hash = \"903b234e48f53b4a44dc0b4974ebc521\";\n\nexport default node;\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAkBA,MAAMA,IAAqB,G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GA,EAAE;IACnB,CAAC;IACD,QAAQ,EAAE;MACR,SAAS,EAAE,kCAAkC;MAC7C,IAAI,EAAE,IAAI;MACV,UAAU,EAAE,CAAC,CAAC;MACd,MAAM,EAAE,uBAAuB;MAC/B,eAAe,EAAE,OAAO;MACxB,MAAM,EAAE;IACV;EACF,CAAC;AACD,CAAC,CAAE,CAAC;AAEHD,IAAI,CAASE,IAAI,GAAG,kCAAkC;AAEvD,eAAeF,IAAI","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import { Alert, Drawer, Layout, PageHeader } from '@os-design/core';
|
|
4
4
|
import { useIsMinWidth } from '@os-design/media';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionDrawer.js","names":["styled","Alert","Drawer","Layout","PageHeader","useIsMinWidth","ThemeOverrider","React","lazy","Suspense","useTranslation","SessionListSkeleton","LazySessionDrawerContent","overrides","horizontalPadding","StyledPageHeader","StyledAlert","SessionDrawer","props","t","isMinSm","createElement","_extends","placement","width","title","type","size","fallback"],"sources":["../../../../src/lib/components/session/SessionDrawer.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport {\n Alert,\n Drawer,\n DrawerProps,\n Layout,\n PageHeader,\n} from '@os-design/core';\nimport { useIsMinWidth } from '@os-design/media';\nimport { Theme, ThemeOverrider } from '@os-design/theming';\nimport React, { lazy, Suspense } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport SessionListSkeleton from './SessionListSkeleton';\n\nconst LazySessionDrawerContent = lazy(() => import('./SessionDrawerContent'));\n\nconst overrides: Partial<Theme> = { horizontalPadding: [1, 1] };\n\nconst StyledPageHeader = styled(PageHeader)`\n position: relative;\n`;\n\nconst StyledAlert = styled(Alert)`\n border-radius: 0;\n`;\n\nconst SessionDrawer: React.FC<DrawerProps> = (props) => {\n const { t } = useTranslation(['profile']);\n const isMinSm = useIsMinWidth('sm');\n\n return (\n <Drawer placement='right' width={isMinSm ? '24em' : '90%'} {...props}>\n <ThemeOverrider overrides={overrides}>\n <Layout>\n <StyledPageHeader title={t('profile:sessions.title')} />\n\n <StyledAlert type='info' size='small'>\n {t('profile:sessions.description')}\n </StyledAlert>\n\n <Suspense fallback={<SessionListSkeleton />}>\n <LazySessionDrawerContent />\n </Suspense>\n </Layout>\n </ThemeOverrider>\n </Drawer>\n );\n};\n\nexport default SessionDrawer;\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,KAAK,EACLC,MAAM,EAENC,MAAM,EACNC,UAAU,QACL,iBAAiB;AACxB,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAAgBC,cAAc,QAAQ,oBAAoB;AAC1D,OAAOC,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,cAAc,QAAQ,eAAe;AAC9C,OAAOC,mBAAmB,MAAM,uBAAuB;AAEvD,MAAMC,wBAAwB,gBAAGJ,IAAI,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAE7E,MAAMK,SAAyB,GAAG;EAAEC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC;AAAE,CAAC;AAE/D,MAAMC,gBAAgB,GAAGf,MAAM,CAACI,UAAU,
|
|
1
|
+
{"version":3,"file":"SessionDrawer.js","names":["styled","Alert","Drawer","Layout","PageHeader","useIsMinWidth","ThemeOverrider","React","lazy","Suspense","useTranslation","SessionListSkeleton","LazySessionDrawerContent","overrides","horizontalPadding","StyledPageHeader","StyledAlert","SessionDrawer","props","t","isMinSm","createElement","_extends","placement","width","title","type","size","fallback"],"sources":["../../../../src/lib/components/session/SessionDrawer.tsx"],"sourcesContent":["import styled from '@emotion/styled';\nimport {\n Alert,\n Drawer,\n DrawerProps,\n Layout,\n PageHeader,\n} from '@os-design/core';\nimport { useIsMinWidth } from '@os-design/media';\nimport { Theme, ThemeOverrider } from '@os-design/theming';\nimport React, { lazy, Suspense } from 'react';\nimport { useTranslation } from 'react-i18next';\nimport SessionListSkeleton from './SessionListSkeleton';\n\nconst LazySessionDrawerContent = lazy(() => import('./SessionDrawerContent'));\n\nconst overrides: Partial<Theme> = { horizontalPadding: [1, 1] };\n\nconst StyledPageHeader = styled(PageHeader)`\n position: relative;\n`;\n\nconst StyledAlert = styled(Alert)`\n border-radius: 0;\n`;\n\nconst SessionDrawer: React.FC<DrawerProps> = (props) => {\n const { t } = useTranslation(['profile']);\n const isMinSm = useIsMinWidth('sm');\n\n return (\n <Drawer placement='right' width={isMinSm ? '24em' : '90%'} {...props}>\n <ThemeOverrider overrides={overrides}>\n <Layout>\n <StyledPageHeader title={t('profile:sessions.title')} />\n\n <StyledAlert type='info' size='small'>\n {t('profile:sessions.description')}\n </StyledAlert>\n\n <Suspense fallback={<SessionListSkeleton />}>\n <LazySessionDrawerContent />\n </Suspense>\n </Layout>\n </ThemeOverrider>\n </Drawer>\n );\n};\n\nexport default SessionDrawer;\n"],"mappings":";AAAA,OAAOA,MAAM,MAAM,iBAAiB;AACpC,SACEC,KAAK,EACLC,MAAM,EAENC,MAAM,EACNC,UAAU,QACL,iBAAiB;AACxB,SAASC,aAAa,QAAQ,kBAAkB;AAChD,SAAgBC,cAAc,QAAQ,oBAAoB;AAC1D,OAAOC,KAAK,IAAIC,IAAI,EAAEC,QAAQ,QAAQ,OAAO;AAC7C,SAASC,cAAc,QAAQ,eAAe;AAC9C,OAAOC,mBAAmB,MAAM,uBAAuB;AAEvD,MAAMC,wBAAwB,gBAAGJ,IAAI,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC;AAE7E,MAAMK,SAAyB,GAAG;EAAEC,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC;AAAE,CAAC;AAE/D,MAAMC,gBAAgB,GAAGf,MAAM,CAACI,UAAU,CAAC;AAC3C;AACA,CAAC;AAED,MAAMY,WAAW,GAAGhB,MAAM,CAACC,KAAK,CAAC;AACjC;AACA,CAAC;AAED,MAAMgB,aAAoC,GAAIC,KAAK,IAAK;EACtD,MAAM;IAAEC;EAAE,CAAC,GAAGT,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC;EACzC,MAAMU,OAAO,GAAGf,aAAa,CAAC,IAAI,CAAC;EAEnC,oBACEE,KAAA,CAAAc,aAAA,CAACnB,MAAM,EAAAoB,QAAA;IAACC,SAAS,EAAC,OAAO;IAACC,KAAK,EAAEJ,OAAO,GAAG,MAAM,GAAG;EAAM,GAAKF,KAAK,gBAClEX,KAAA,CAAAc,aAAA,CAACf,cAAc;IAACO,SAAS,EAAEA;EAAU,gBACnCN,KAAA,CAAAc,aAAA,CAAClB,MAAM,qBACLI,KAAA,CAAAc,aAAA,CAACN,gBAAgB;IAACU,KAAK,EAAEN,CAAC,CAAC,wBAAwB;EAAE,CAAE,CAAC,eAExDZ,KAAA,CAAAc,aAAA,CAACL,WAAW;IAACU,IAAI,EAAC,MAAM;IAACC,IAAI,EAAC;EAAO,GAClCR,CAAC,CAAC,8BAA8B,CACtB,CAAC,eAEdZ,KAAA,CAAAc,aAAA,CAACZ,QAAQ;IAACmB,QAAQ,eAAErB,KAAA,CAAAc,aAAA,CAACV,mBAAmB,MAAE;EAAE,gBAC1CJ,KAAA,CAAAc,aAAA,CAACT,wBAAwB,MAAE,CACnB,CACJ,CACM,CACV,CAAC;AAEb,CAAC;AAED,eAAeK,aAAa","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionDrawerContent.js","names":["React","Suspense","useLazyLoadQuery","ErrorBoundary","ErrorResult","SessionList","SessionListSkeleton","SessionDrawerContentLoader","props","_SessionDrawerContentQuery","require","hash","console","error","fetchPolicy","createElement","sessionsKey","errorFallback","SessionDrawerContent","fallback"],"sources":["../../../../src/lib/components/session/SessionDrawerContent.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport { ErrorBoundary, FallbackFn } from '@os-design/utils';\nimport graphql from 'babel-plugin-relay/macro';\nimport ErrorResult from '../shared/ErrorResult';\nimport SessionList from './SessionList';\nimport SessionListSkeleton from './SessionListSkeleton';\nimport { SessionDrawerContentQuery } from './__generated__/SessionDrawerContentQuery.graphql';\n\nconst SessionDrawerContentLoader: React.FC = () => {\n const props = useLazyLoadQuery<SessionDrawerContentQuery>(\n graphql`\n query SessionDrawerContentQuery {\n ...SessionList_sessions\n }\n `,\n {},\n { fetchPolicy: 'network-only' }\n );\n\n return <SessionList sessionsKey={props} />;\n};\n\nconst errorFallback: FallbackFn = ({ error }) => <ErrorResult error={error} />;\n\nconst SessionDrawerContent: React.FC = () => (\n <ErrorBoundary fallback={errorFallback}>\n <Suspense fallback={<SessionListSkeleton />}>\n <SessionDrawerContentLoader />\n </Suspense>\n </ErrorBoundary>\n);\n\nexport default SessionDrawerContent;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,aAAa,QAAoB,kBAAkB;AAE5D,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,mBAAmB,MAAM,uBAAuB;AAGvD,MAAMC,0BAAoC,GAAGA,CAAA,KAAM;EACjD,MAAMC,KAAK,GAAGN,gBAAgB,CAAAO,0BAAA,cAAAA,0BAAA,IAAAA,0BAAA,GAAAC,OAAA,uDAAAD,0BAAA,CAAAE,IAAA,IAAAF,0BAAA,CAAAE,IAAA,2CAAAC,OAAA,CAAAC,KAAA,6JAAAJ,0BAAA,GAM5B,CAAC,CAAC,EACF;IAAEK,WAAW,EAAE;EAAe,CAChC,CAAC;EAED,oBAAOd,KAAA,CAAAe,aAAA,CAACV,WAAW;IAACW,WAAW,EAAER;EAAM,CAAE,CAAC;AAC5C,CAAC;AAED,MAAMS,aAAyB,GAAGA,CAAC;EAAEJ;AAAM,CAAC,kBAAKb,KAAA,CAAAe,aAAA,CAACX,WAAW;EAACS,KAAK,EAAEA;AAAM,CAAE,CAAC;AAE9E,MAAMK,oBAA8B,GAAGA,CAAA,kBACrClB,KAAA,CAAAe,aAAA,CAACZ,aAAa;EAACgB,QAAQ,EAAEF;AAAc,gBACrCjB,KAAA,CAAAe,aAAA,CAACd,QAAQ;EAACkB,QAAQ,eAAEnB,KAAA,CAAAe,aAAA,CAACT,mBAAmB,MAAE;AAAE,gBAC1CN,KAAA,CAAAe,aAAA,CAACR,0BAA0B,MAAE,CACrB,CACG,CAChB;AAED,eAAeW,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"SessionDrawerContent.js","names":["React","Suspense","useLazyLoadQuery","ErrorBoundary","ErrorResult","SessionList","SessionListSkeleton","SessionDrawerContentLoader","props","_SessionDrawerContentQuery","require","hash","console","error","fetchPolicy","createElement","sessionsKey","errorFallback","SessionDrawerContent","fallback"],"sources":["../../../../src/lib/components/session/SessionDrawerContent.tsx"],"sourcesContent":["import React, { Suspense } from 'react';\nimport { useLazyLoadQuery } from 'react-relay/hooks';\nimport { ErrorBoundary, FallbackFn } from '@os-design/utils';\nimport graphql from 'babel-plugin-relay/macro';\nimport ErrorResult from '../shared/ErrorResult';\nimport SessionList from './SessionList';\nimport SessionListSkeleton from './SessionListSkeleton';\nimport { SessionDrawerContentQuery } from './__generated__/SessionDrawerContentQuery.graphql';\n\nconst SessionDrawerContentLoader: React.FC = () => {\n const props = useLazyLoadQuery<SessionDrawerContentQuery>(\n graphql`\n query SessionDrawerContentQuery {\n ...SessionList_sessions\n }\n `,\n {},\n { fetchPolicy: 'network-only' }\n );\n\n return <SessionList sessionsKey={props} />;\n};\n\nconst errorFallback: FallbackFn = ({ error }) => <ErrorResult error={error} />;\n\nconst SessionDrawerContent: React.FC = () => (\n <ErrorBoundary fallback={errorFallback}>\n <Suspense fallback={<SessionListSkeleton />}>\n <SessionDrawerContentLoader />\n </Suspense>\n </ErrorBoundary>\n);\n\nexport default SessionDrawerContent;\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,aAAa,QAAoB,kBAAkB;AAE5D,OAAOC,WAAW,MAAM,uBAAuB;AAC/C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,mBAAmB,MAAM,uBAAuB;AAGvD,MAAMC,0BAAoC,GAAGA,CAAA,KAAM;EACjD,MAAMC,KAAK,GAAGN,gBAAgB,CAAAO,0BAAA,cAAAA,0BAAA,IAAAA,0BAAA,GAAAC,OAAA,uDAAAD,0BAAA,CAAAE,IAAA,IAAAF,0BAAA,CAAAE,IAAA,2CAAAC,OAAA,CAAAC,KAAA,6JAAAJ,0BAAA,GAM5B,CAAC,CAAC,EACF;IAAEK,WAAW,EAAE;EAAe,CAChC,CAAC;EAED,oBAAOd,KAAA,CAAAe,aAAA,CAACV,WAAW;IAACW,WAAW,EAAER;EAAM,CAAE,CAAC;AAC5C,CAAC;AAED,MAAMS,aAAyB,GAAGA,CAAC;EAAEJ;AAAM,CAAC,kBAAKb,KAAA,CAAAe,aAAA,CAACX,WAAW;EAACS,KAAK,EAAEA;AAAM,CAAE,CAAC;AAE9E,MAAMK,oBAA8B,GAAGA,CAAA,kBACrClB,KAAA,CAAAe,aAAA,CAACZ,aAAa;EAACgB,QAAQ,EAAEF;AAAc,gBACrCjB,KAAA,CAAAe,aAAA,CAACd,QAAQ;EAACkB,QAAQ,eAAEnB,KAAA,CAAAe,aAAA,CAACT,mBAAmB,MAAE;AAAE,gBAC1CN,KAAA,CAAAe,aAAA,CAACR,0BAA0B,MAAE,CACrB,CACG,CAChB;AAED,eAAeW,oBAAoB","ignoreList":[]}
|