@payloadcms/ui 3.0.0-beta.49 → 3.0.0-beta.50
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Logout/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/Logout/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAuCvC,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;IAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAUA,CAAA"}
|
|
@@ -10,11 +10,12 @@ const DefaultLogout = ({ Link, tabIndex })=>{
|
|
|
10
10
|
const { t } = useTranslation();
|
|
11
11
|
const config = useConfig();
|
|
12
12
|
const { admin: { routes: { logout: logoutRoute } }, routes: { admin } } = config;
|
|
13
|
+
const basePath = process.env.NEXT_BASE_PATH ?? '';
|
|
13
14
|
const LinkElement = Link || 'a';
|
|
14
15
|
return /*#__PURE__*/ _jsx(LinkElement, {
|
|
15
16
|
"aria-label": t('authentication:logOut'),
|
|
16
17
|
className: `${baseClass}__log-out`,
|
|
17
|
-
href: `${admin}${logoutRoute}`,
|
|
18
|
+
href: `${basePath}${admin}${logoutRoute}`,
|
|
18
19
|
tabIndex: tabIndex,
|
|
19
20
|
children: /*#__PURE__*/ _jsx(LogOutIcon, {})
|
|
20
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/elements/Logout/index.tsx"],"sourcesContent":["'use client'\nimport React, { Fragment } from 'react'\n\nimport { LogOutIcon } from '../../icons/LogOut/index.js'\nimport { useComponentMap } from '../../providers/ComponentMap/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\n\nconst baseClass = 'nav'\n\nconst DefaultLogout: React.FC<{\n Link: React.ComponentType\n tabIndex?: number\n}> = ({ Link, tabIndex }) => {\n const { t } = useTranslation()\n const config = useConfig()\n\n const {\n admin: {\n routes: { logout: logoutRoute },\n },\n routes: { admin },\n } = config\n\n const LinkElement = Link || 'a'\n\n return (\n <LinkElement\n aria-label={t('authentication:logOut')}\n className={`${baseClass}__log-out`}\n href={`${admin}${logoutRoute}`}\n tabIndex={tabIndex}\n >\n <LogOutIcon />\n </LinkElement>\n )\n}\n\nexport const Logout: React.FC<{\n Link?: React.ComponentType\n tabIndex?: number\n}> = ({ Link, tabIndex = 0 }) => {\n const {\n componentMap: { LogoutButton: CustomLogout },\n } = useComponentMap()\n\n if (CustomLogout) {\n return <Fragment>{CustomLogout}</Fragment>\n }\n\n return <DefaultLogout Link={Link} tabIndex={tabIndex} />\n}\n"],"names":["React","Fragment","LogOutIcon","useComponentMap","useConfig","useTranslation","baseClass","DefaultLogout","Link","tabIndex","t","config","admin","routes","logout","logoutRoute","LinkElement","aria-label","className","href","Logout","componentMap","LogoutButton","CustomLogout"],"rangeMappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/elements/Logout/index.tsx"],"sourcesContent":["'use client'\nimport React, { Fragment } from 'react'\n\nimport { LogOutIcon } from '../../icons/LogOut/index.js'\nimport { useComponentMap } from '../../providers/ComponentMap/index.js'\nimport { useConfig } from '../../providers/Config/index.js'\nimport { useTranslation } from '../../providers/Translation/index.js'\n\nconst baseClass = 'nav'\n\nconst DefaultLogout: React.FC<{\n Link: React.ComponentType\n tabIndex?: number\n}> = ({ Link, tabIndex }) => {\n const { t } = useTranslation()\n const config = useConfig()\n\n const {\n admin: {\n routes: { logout: logoutRoute },\n },\n routes: { admin },\n } = config\n\n const basePath = process.env.NEXT_BASE_PATH ?? ''\n\n const LinkElement = Link || 'a'\n\n return (\n <LinkElement\n aria-label={t('authentication:logOut')}\n className={`${baseClass}__log-out`}\n href={`${basePath}${admin}${logoutRoute}`}\n tabIndex={tabIndex}\n >\n <LogOutIcon />\n </LinkElement>\n )\n}\n\nexport const Logout: React.FC<{\n Link?: React.ComponentType\n tabIndex?: number\n}> = ({ Link, tabIndex = 0 }) => {\n const {\n componentMap: { LogoutButton: CustomLogout },\n } = useComponentMap()\n\n if (CustomLogout) {\n return <Fragment>{CustomLogout}</Fragment>\n }\n\n return <DefaultLogout Link={Link} tabIndex={tabIndex} />\n}\n"],"names":["React","Fragment","LogOutIcon","useComponentMap","useConfig","useTranslation","baseClass","DefaultLogout","Link","tabIndex","t","config","admin","routes","logout","logoutRoute","basePath","process","env","NEXT_BASE_PATH","LinkElement","aria-label","className","href","Logout","componentMap","LogoutButton","CustomLogout"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AACA,OAAOA,SAASC,QAAQ,QAAQ,QAAO;AAEvC,SAASC,UAAU,QAAQ,8BAA6B;AACxD,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AAErE,MAAMC,YAAY;AAElB,MAAMC,gBAGD,CAAC,EAAEC,IAAI,EAAEC,QAAQ,EAAE;IACtB,MAAM,EAAEC,CAAC,EAAE,GAAGL;IACd,MAAMM,SAASP;IAEf,MAAM,EACJQ,OAAO,EACLC,QAAQ,EAAEC,QAAQC,WAAW,EAAE,EAChC,EACDF,QAAQ,EAAED,KAAK,EAAE,EAClB,GAAGD;IAEJ,MAAMK,WAAWC,QAAQC,GAAG,CAACC,cAAc,IAAI;IAE/C,MAAMC,cAAcZ,QAAQ;IAE5B,qBACE,KAACY;QACCC,cAAYX,EAAE;QACdY,WAAW,CAAC,EAAEhB,UAAU,SAAS,CAAC;QAClCiB,MAAM,CAAC,EAAEP,SAAS,EAAEJ,MAAM,EAAEG,YAAY,CAAC;QACzCN,UAAUA;kBAEV,cAAA,KAACP;;AAGP;AAEA,OAAO,MAAMsB,SAGR,CAAC,EAAEhB,IAAI,EAAEC,WAAW,CAAC,EAAE;IAC1B,MAAM,EACJgB,cAAc,EAAEC,cAAcC,YAAY,EAAE,EAC7C,GAAGxB;IAEJ,IAAIwB,cAAc;QAChB,qBAAO,KAAC1B;sBAAU0B;;IACpB;IAEA,qBAAO,KAACpB;QAAcC,MAAMA;QAAMC,UAAUA;;AAC9C,EAAC"}
|