@zengenti/contensis-react-base 4.0.0-beta.2 → 4.0.0-beta.4
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/LICENSE +7 -0
- package/README.md +18 -478
- package/cjs/{App-b56aca04.js → App-DXro6av4.js} +215 -234
- package/cjs/App-DXro6av4.js.map +1 -0
- package/cjs/{ChangePassword.container-ae35785e.js → ChangePassword.container-ECjEXixF.js} +209 -286
- package/cjs/ChangePassword.container-ECjEXixF.js.map +1 -0
- package/cjs/CookieHelper.class-C3Eqoze9.js +471 -0
- package/cjs/CookieHelper.class-C3Eqoze9.js.map +1 -0
- package/cjs/{RouteLoader-c06dccd5.js → RouteLoader-BFc-Wl6M.js} +55 -68
- package/cjs/RouteLoader-BFc-Wl6M.js.map +1 -0
- package/cjs/{ContensisDeliveryApi-4fcf049d.js → SSRContext-CFeZxG9H.js} +165 -119
- package/cjs/SSRContext-CFeZxG9H.js.map +1 -0
- package/cjs/{ToJs-a8d8f3f0.js → ToJs-C9jwV7YB.js} +26 -80
- package/cjs/ToJs-C9jwV7YB.js.map +1 -0
- package/cjs/{_commonjsHelpers-b3309d7b.js → _commonjsHelpers-BJu3ubxk.js} +1 -1
- package/cjs/_commonjsHelpers-BJu3ubxk.js.map +1 -0
- package/cjs/client.js +67 -65
- package/cjs/client.js.map +1 -1
- package/cjs/contensis-react-base.js +387 -3294
- package/cjs/contensis-react-base.js.map +1 -1
- package/cjs/{fromJSLeaveImmer-e74c673c.js → fromJSLeaveImmer-Blvlk4t2.js} +3 -7
- package/{esm/fromJSLeaveImmer-0114ffcf.js.map → cjs/fromJSLeaveImmer-Blvlk4t2.js.map} +1 -1
- package/cjs/redux.js +19 -20
- package/cjs/redux.js.map +1 -1
- package/cjs/routing.js +13 -6
- package/cjs/routing.js.map +1 -1
- package/cjs/sagas-CbZhaRNd.js +6010 -0
- package/cjs/sagas-CbZhaRNd.js.map +1 -0
- package/cjs/search.js +105 -305
- package/cjs/search.js.map +1 -1
- package/cjs/selectors-wCs5fHD4.js +460 -0
- package/cjs/selectors-wCs5fHD4.js.map +1 -0
- package/cjs/{version-34d91f68.js → store-D07FOXvM.js} +44 -114
- package/cjs/store-D07FOXvM.js.map +1 -0
- package/cjs/{urls-6fcaf4c6.js → urls-DVIwGZmd.js} +1 -1
- package/{esm/urls-eac9a747.js.map → cjs/urls-DVIwGZmd.js.map} +1 -1
- package/cjs/user.js +12 -20
- package/cjs/user.js.map +1 -1
- package/cjs/util.js +109 -116
- package/cjs/util.js.map +1 -1
- package/cjs/{version-a410c88e.js → version-B7XFkBhY.js} +19 -22
- package/{esm/version-9f29becb.js.map → cjs/version-B7XFkBhY.js.map} +1 -1
- package/cjs/version-CM-bJ62L.js +20 -0
- package/cjs/version-CM-bJ62L.js.map +1 -0
- package/esm/{App-83107d7e.js → App-CIlf4cl4.js} +176 -195
- package/esm/App-CIlf4cl4.js.map +1 -0
- package/esm/{ChangePassword.container-76fd5e9b.js → ChangePassword.container-C0tFq0Tf.js} +191 -250
- package/esm/ChangePassword.container-C0tFq0Tf.js.map +1 -0
- package/esm/CookieHelper.class-FTURFpz3.js +464 -0
- package/esm/CookieHelper.class-FTURFpz3.js.map +1 -0
- package/esm/{RouteLoader-29fd689a.js → RouteLoader-D7HmVx5l.js} +40 -53
- package/esm/RouteLoader-D7HmVx5l.js.map +1 -0
- package/esm/{ContensisDeliveryApi-fe57a037.js → SSRContext-CkiWIvde.js} +159 -120
- package/esm/SSRContext-CkiWIvde.js.map +1 -0
- package/esm/{ToJs-df57f31d.js → ToJs-CpPNdcXS.js} +24 -77
- package/esm/ToJs-CpPNdcXS.js.map +1 -0
- package/esm/{_commonjsHelpers-1789f0cf.js → _commonjsHelpers-BFTU3MAI.js} +1 -1
- package/esm/_commonjsHelpers-BFTU3MAI.js.map +1 -0
- package/esm/client.js +55 -53
- package/esm/client.js.map +1 -1
- package/esm/contensis-react-base.js +318 -3223
- package/esm/contensis-react-base.js.map +1 -1
- package/esm/{fromJSLeaveImmer-0114ffcf.js → fromJSLeaveImmer-C_YACmOf.js} +2 -6
- package/{cjs/fromJSLeaveImmer-e74c673c.js.map → esm/fromJSLeaveImmer-C_YACmOf.js.map} +1 -1
- package/esm/redux.js +10 -9
- package/esm/redux.js.map +1 -1
- package/esm/routing.js +13 -4
- package/esm/routing.js.map +1 -1
- package/esm/sagas-xJU-zOpn.js +5916 -0
- package/esm/sagas-xJU-zOpn.js.map +1 -0
- package/esm/search.js +113 -311
- package/esm/search.js.map +1 -1
- package/esm/selectors-CBdCY0u3.js +396 -0
- package/esm/selectors-CBdCY0u3.js.map +1 -0
- package/esm/{version-3d9911e2.js → store-v2gyr6u2.js} +38 -85
- package/esm/store-v2gyr6u2.js.map +1 -0
- package/esm/{urls-eac9a747.js → urls-DfCisos-.js} +1 -1
- package/{cjs/urls-6fcaf4c6.js.map → esm/urls-DfCisos-.js.map} +1 -1
- package/esm/user.js +7 -13
- package/esm/user.js.map +1 -1
- package/esm/util.js +67 -75
- package/esm/util.js.map +1 -1
- package/esm/version-D773TD9j.js +15 -0
- package/esm/version-D773TD9j.js.map +1 -0
- package/esm/{version-9f29becb.js → version-DvjTUbcA.js} +6 -9
- package/{cjs/version-a410c88e.js.map → esm/version-DvjTUbcA.js.map} +1 -1
- package/models/app/App.d.ts +1 -1
- package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +4 -1
- package/models/app/pages/VersionInfo/components/VersionInfo.styled.d.ts +2 -1
- package/models/client/client.d.ts +1 -1
- package/models/index.d.ts +1 -2
- package/models/models/AppRouteProps.d.ts +11 -0
- package/models/{redux/appstate.d.ts → models/AppState.d.ts} +3 -3
- package/models/models/ContentTypeMapping.d.ts +89 -0
- package/models/models/EntryMapper.d.ts +3 -0
- package/models/models/GetRouteActionArgs.d.ts +15 -0
- package/models/models/MatchedRoute.d.ts +4 -0
- package/models/models/ReduxInjector.d.ts +5 -0
- package/models/models/RequireLogin.d.ts +6 -0
- package/models/models/RouteComponent.d.ts +4 -0
- package/models/models/RouteComponentProps.d.ts +9 -0
- package/models/models/RouteLoaderProps.d.ts +9 -0
- package/models/models/RouteNode.d.ts +5 -0
- package/models/models/SSRContext.d.ts +11 -0
- package/models/models/StaticRoute.d.ts +61 -0
- package/models/models/WithEvents.d.ts +58 -0
- package/models/models/config/AppConfig.d.ts +12 -0
- package/models/{config.d.ts → models/config/ServerConfig.d.ts} +3 -12
- package/models/models/config/StateType.d.ts +1 -0
- package/models/models/config/index.d.ts +3 -0
- package/models/models/index.d.ts +16 -0
- package/models/redux/actions/index.d.ts +2 -2
- package/models/redux/sagas/navigation.d.ts +1 -3
- package/models/redux/selectors/index.d.ts +2 -2
- package/models/redux/store/injectors.d.ts +16 -4
- package/models/redux/store/store.d.ts +10 -4
- package/models/redux/types/index.d.ts +2 -2
- package/models/redux/types/navigation.d.ts +3 -3
- package/models/redux/types/version.d.ts +2 -2
- package/models/routing/components/Redirect.d.ts +1 -1
- package/models/routing/components/RouteLoader.d.ts +1 -1
- package/models/routing/components/StaticRouteLoader.d.ts +1 -1
- package/models/routing/components/Status.d.ts +1 -1
- package/models/routing/redux/actions.d.ts +3 -4
- package/models/routing/redux/selectors.d.ts +2 -2
- package/models/routing/redux/types.d.ts +11 -11
- package/models/routing/util/find-contenttype-mapping.d.ts +1 -1
- package/models/routing/util/queries.d.ts +2 -2
- package/models/search/containers/withListing.d.ts +4 -1
- package/models/search/containers/withSearch.d.ts +4 -1
- package/models/search/models/Queries.d.ts +4 -2
- package/models/search/models/Search.d.ts +8 -1
- package/models/search/models/SearchActions.d.ts +3 -2
- package/models/search/models/SearchState.d.ts +5 -1
- package/models/search/redux/reducers.d.ts +2 -257
- package/models/search/redux/schema.d.ts +1 -1
- package/models/search/redux/selectors.d.ts +5 -5
- package/models/search/search/ContensisDeliveryApi.d.ts +2 -2
- package/models/search/search/ToJs.d.ts +1 -1
- package/models/search/search/expressions.d.ts +3 -3
- package/models/search/search/util.d.ts +17 -2
- package/models/search/transformations/searchresult-to-state.mapper.d.ts +1 -2
- package/models/server/features/caching/cacheDuration.schema.d.ts +1 -0
- package/models/server/features/linkdepth-api/search.d.ts +1 -1
- package/models/server/features/static-assets/index.d.ts +1 -1
- package/models/server/internalServer.d.ts +1 -1
- package/models/server/util/bundles.d.ts +1 -1
- package/models/server/util/headers.d.ts +1 -1
- package/models/server/webApp.d.ts +1 -1
- package/models/user/components/Login.d.ts +1 -1
- package/models/user/components/LoginForm.d.ts +6 -6
- package/models/user/components/LogoutForm.d.ts +4 -4
- package/models/user/components.styled/Login.styled.d.ts +1 -1
- package/models/user/components.styled/LoginForm.styled.d.ts +1 -1
- package/models/user/hocs/withLogin.d.ts +4 -4
- package/models/user/hocs/withRegistration.d.ts +6 -3
- package/models/user/hooks/useLogin.d.ts +4 -4
- package/models/user/redux/actions.d.ts +7 -6
- package/models/user/redux/sagas/index.d.ts +1 -1
- package/models/user/redux/sagas/login.d.ts +5 -17
- package/models/user/redux/selectors.d.ts +1 -2
- package/models/user/redux/types.d.ts +21 -21
- package/models/user/state.d.ts +12 -0
- package/models/user/transformations/mapClientCredentials.d.ts +3 -1
- package/models/user/util/ContensisManagementApi.d.ts +10 -9
- package/models/user/util/CookieConstants.d.ts +1 -0
- package/models/user/util/CookieHelper.class.d.ts +8 -4
- package/models/user/util/LoginHelper.class.d.ts +25 -37
- package/models/user/util/OidcUserManager.d.ts +1 -1
- package/models/user/util/matchGroups.d.ts +1 -1
- package/models/util/CachedDeliveryApi.d.ts +11 -10
- package/models/util/ContensisDeliveryApi.d.ts +11 -7
- package/models/util/SSRContext.d.ts +29 -0
- package/models/util/index.d.ts +1 -0
- package/models/util/json-mapper.d.ts +4 -5
- package/package.json +71 -92
- package/cjs/App-b56aca04.js.map +0 -1
- package/cjs/ChangePassword.container-ae35785e.js.map +0 -1
- package/cjs/ContensisDeliveryApi-4fcf049d.js.map +0 -1
- package/cjs/CookieConstants-000427db.js +0 -10
- package/cjs/CookieConstants-000427db.js.map +0 -1
- package/cjs/RouteLoader-c06dccd5.js.map +0 -1
- package/cjs/ToJs-a8d8f3f0.js.map +0 -1
- package/cjs/_commonjsHelpers-b3309d7b.js.map +0 -1
- package/cjs/forms.js +0 -5998
- package/cjs/forms.js.map +0 -1
- package/cjs/reducers-73a03ef4.js +0 -257
- package/cjs/reducers-73a03ef4.js.map +0 -1
- package/cjs/sagas-570f23ba.js +0 -2175
- package/cjs/sagas-570f23ba.js.map +0 -1
- package/cjs/selectors-14caa813.js +0 -228
- package/cjs/selectors-14caa813.js.map +0 -1
- package/cjs/version-34d91f68.js.map +0 -1
- package/esm/App-83107d7e.js.map +0 -1
- package/esm/ChangePassword.container-76fd5e9b.js.map +0 -1
- package/esm/ContensisDeliveryApi-fe57a037.js.map +0 -1
- package/esm/CookieConstants-3d3b6531.js +0 -6
- package/esm/CookieConstants-3d3b6531.js.map +0 -1
- package/esm/RouteLoader-29fd689a.js.map +0 -1
- package/esm/ToJs-df57f31d.js.map +0 -1
- package/esm/_commonjsHelpers-1789f0cf.js.map +0 -1
- package/esm/forms.js +0 -5984
- package/esm/forms.js.map +0 -1
- package/esm/reducers-aa8cef1e.js +0 -234
- package/esm/reducers-aa8cef1e.js.map +0 -1
- package/esm/sagas-07e82e18.js +0 -2083
- package/esm/sagas-07e82e18.js.map +0 -1
- package/esm/selectors-691caf02.js +0 -186
- package/esm/selectors-691caf02.js.map +0 -1
- package/esm/version-3d9911e2.js.map +0 -1
- package/models/forms/index.d.ts +0 -1
- package/models/routing/routes.d.ts +0 -133
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CookieHelper.class-FTURFpz3.js","sources":["../src/user/util/CookieConstants.ts","../node_modules/universal-cookie/esm/index.mjs","../src/user/util/CookieHelper.class.ts"],"sourcesContent":["export const BEARER_TOKEN_COOKIE = 'ContensisSecurityBearerToken';\nexport const LOGIN_COOKIE = 'ContensisCMSUserName';\nexport const REFRESH_TOKEN_COOKIE = 'RefreshToken';\n\nexport type CookieObject = { [name: string]: any };\n\nexport const findLoginCookies = (cookies: CookieObject | string) =>\n typeof cookies === 'object'\n ? Object.fromEntries(\n Object.entries(cookies).filter(([name]) =>\n [LOGIN_COOKIE, REFRESH_TOKEN_COOKIE].includes(name)\n )\n )\n : cookies;\n","var dist = {};\n\nvar hasRequiredDist;\n\nfunction requireDist () {\n\tif (hasRequiredDist) return dist;\n\thasRequiredDist = 1;\n\tObject.defineProperty(dist, \"__esModule\", { value: true });\n\tdist.parse = parse;\n\tdist.serialize = serialize;\n\t/**\n\t * RegExp to match cookie-name in RFC 6265 sec 4.1.1\n\t * This refers out to the obsoleted definition of token in RFC 2616 sec 2.2\n\t * which has been replaced by the token definition in RFC 7230 appendix B.\n\t *\n\t * cookie-name = token\n\t * token = 1*tchar\n\t * tchar = \"!\" / \"#\" / \"$\" / \"%\" / \"&\" / \"'\" /\n\t * \"*\" / \"+\" / \"-\" / \".\" / \"^\" / \"_\" /\n\t * \"`\" / \"|\" / \"~\" / DIGIT / ALPHA\n\t *\n\t * Note: Allowing more characters - https://github.com/jshttp/cookie/issues/191\n\t * Allow same range as cookie value, except `=`, which delimits end of name.\n\t */\n\tconst cookieNameRegExp = /^[\\u0021-\\u003A\\u003C\\u003E-\\u007E]+$/;\n\t/**\n\t * RegExp to match cookie-value in RFC 6265 sec 4.1.1\n\t *\n\t * cookie-value = *cookie-octet / ( DQUOTE *cookie-octet DQUOTE )\n\t * cookie-octet = %x21 / %x23-2B / %x2D-3A / %x3C-5B / %x5D-7E\n\t * ; US-ASCII characters excluding CTLs,\n\t * ; whitespace DQUOTE, comma, semicolon,\n\t * ; and backslash\n\t *\n\t * Allowing more characters: https://github.com/jshttp/cookie/issues/191\n\t * Comma, backslash, and DQUOTE are not part of the parsing algorithm.\n\t */\n\tconst cookieValueRegExp = /^[\\u0021-\\u003A\\u003C-\\u007E]*$/;\n\t/**\n\t * RegExp to match domain-value in RFC 6265 sec 4.1.1\n\t *\n\t * domain-value = <subdomain>\n\t * ; defined in [RFC1034], Section 3.5, as\n\t * ; enhanced by [RFC1123], Section 2.1\n\t * <subdomain> = <label> | <subdomain> \".\" <label>\n\t * <label> = <let-dig> [ [ <ldh-str> ] <let-dig> ]\n\t * Labels must be 63 characters or less.\n\t * 'let-dig' not 'letter' in the first char, per RFC1123\n\t * <ldh-str> = <let-dig-hyp> | <let-dig-hyp> <ldh-str>\n\t * <let-dig-hyp> = <let-dig> | \"-\"\n\t * <let-dig> = <letter> | <digit>\n\t * <letter> = any one of the 52 alphabetic characters A through Z in\n\t * upper case and a through z in lower case\n\t * <digit> = any one of the ten digits 0 through 9\n\t *\n\t * Keep support for leading dot: https://github.com/jshttp/cookie/issues/173\n\t *\n\t * > (Note that a leading %x2E (\".\"), if present, is ignored even though that\n\t * character is not permitted, but a trailing %x2E (\".\"), if present, will\n\t * cause the user agent to ignore the attribute.)\n\t */\n\tconst domainValueRegExp = /^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i;\n\t/**\n\t * RegExp to match path-value in RFC 6265 sec 4.1.1\n\t *\n\t * path-value = <any CHAR except CTLs or \";\">\n\t * CHAR = %x01-7F\n\t * ; defined in RFC 5234 appendix B.1\n\t */\n\tconst pathValueRegExp = /^[\\u0020-\\u003A\\u003D-\\u007E]*$/;\n\tconst __toString = Object.prototype.toString;\n\tconst NullObject = /* @__PURE__ */ (() => {\n\t const C = function () { };\n\t C.prototype = Object.create(null);\n\t return C;\n\t})();\n\t/**\n\t * Parse a cookie header.\n\t *\n\t * Parse the given cookie header string into an object\n\t * The object has the various cookies as keys(names) => values\n\t */\n\tfunction parse(str, options) {\n\t const obj = new NullObject();\n\t const len = str.length;\n\t // RFC 6265 sec 4.1.1, RFC 2616 2.2 defines a cookie name consists of one char minimum, plus '='.\n\t if (len < 2)\n\t return obj;\n\t const dec = options?.decode || decode;\n\t let index = 0;\n\t do {\n\t const eqIdx = str.indexOf(\"=\", index);\n\t if (eqIdx === -1)\n\t break; // No more cookie pairs.\n\t const colonIdx = str.indexOf(\";\", index);\n\t const endIdx = colonIdx === -1 ? len : colonIdx;\n\t if (eqIdx > endIdx) {\n\t // backtrack on prior semicolon\n\t index = str.lastIndexOf(\";\", eqIdx - 1) + 1;\n\t continue;\n\t }\n\t const keyStartIdx = startIndex(str, index, eqIdx);\n\t const keyEndIdx = endIndex(str, eqIdx, keyStartIdx);\n\t const key = str.slice(keyStartIdx, keyEndIdx);\n\t // only assign once\n\t if (obj[key] === undefined) {\n\t let valStartIdx = startIndex(str, eqIdx + 1, endIdx);\n\t let valEndIdx = endIndex(str, endIdx, valStartIdx);\n\t const value = dec(str.slice(valStartIdx, valEndIdx));\n\t obj[key] = value;\n\t }\n\t index = endIdx + 1;\n\t } while (index < len);\n\t return obj;\n\t}\n\tfunction startIndex(str, index, max) {\n\t do {\n\t const code = str.charCodeAt(index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n\t return index;\n\t } while (++index < max);\n\t return max;\n\t}\n\tfunction endIndex(str, index, min) {\n\t while (index > min) {\n\t const code = str.charCodeAt(--index);\n\t if (code !== 0x20 /* */ && code !== 0x09 /* \\t */)\n\t return index + 1;\n\t }\n\t return min;\n\t}\n\t/**\n\t * Serialize data into a cookie header.\n\t *\n\t * Serialize a name value pair into a cookie string suitable for\n\t * http headers. An optional options object specifies cookie parameters.\n\t *\n\t * serialize('foo', 'bar', { httpOnly: true })\n\t * => \"foo=bar; httpOnly\"\n\t */\n\tfunction serialize(name, val, options) {\n\t const enc = options?.encode || encodeURIComponent;\n\t if (!cookieNameRegExp.test(name)) {\n\t throw new TypeError(`argument name is invalid: ${name}`);\n\t }\n\t const value = enc(val);\n\t if (!cookieValueRegExp.test(value)) {\n\t throw new TypeError(`argument val is invalid: ${val}`);\n\t }\n\t let str = name + \"=\" + value;\n\t if (!options)\n\t return str;\n\t if (options.maxAge !== undefined) {\n\t if (!Number.isInteger(options.maxAge)) {\n\t throw new TypeError(`option maxAge is invalid: ${options.maxAge}`);\n\t }\n\t str += \"; Max-Age=\" + options.maxAge;\n\t }\n\t if (options.domain) {\n\t if (!domainValueRegExp.test(options.domain)) {\n\t throw new TypeError(`option domain is invalid: ${options.domain}`);\n\t }\n\t str += \"; Domain=\" + options.domain;\n\t }\n\t if (options.path) {\n\t if (!pathValueRegExp.test(options.path)) {\n\t throw new TypeError(`option path is invalid: ${options.path}`);\n\t }\n\t str += \"; Path=\" + options.path;\n\t }\n\t if (options.expires) {\n\t if (!isDate(options.expires) ||\n\t !Number.isFinite(options.expires.valueOf())) {\n\t throw new TypeError(`option expires is invalid: ${options.expires}`);\n\t }\n\t str += \"; Expires=\" + options.expires.toUTCString();\n\t }\n\t if (options.httpOnly) {\n\t str += \"; HttpOnly\";\n\t }\n\t if (options.secure) {\n\t str += \"; Secure\";\n\t }\n\t if (options.partitioned) {\n\t str += \"; Partitioned\";\n\t }\n\t if (options.priority) {\n\t const priority = typeof options.priority === \"string\"\n\t ? options.priority.toLowerCase()\n\t : undefined;\n\t switch (priority) {\n\t case \"low\":\n\t str += \"; Priority=Low\";\n\t break;\n\t case \"medium\":\n\t str += \"; Priority=Medium\";\n\t break;\n\t case \"high\":\n\t str += \"; Priority=High\";\n\t break;\n\t default:\n\t throw new TypeError(`option priority is invalid: ${options.priority}`);\n\t }\n\t }\n\t if (options.sameSite) {\n\t const sameSite = typeof options.sameSite === \"string\"\n\t ? options.sameSite.toLowerCase()\n\t : options.sameSite;\n\t switch (sameSite) {\n\t case true:\n\t case \"strict\":\n\t str += \"; SameSite=Strict\";\n\t break;\n\t case \"lax\":\n\t str += \"; SameSite=Lax\";\n\t break;\n\t case \"none\":\n\t str += \"; SameSite=None\";\n\t break;\n\t default:\n\t throw new TypeError(`option sameSite is invalid: ${options.sameSite}`);\n\t }\n\t }\n\t return str;\n\t}\n\t/**\n\t * URL-decode string value. Optimized to skip native call when no %.\n\t */\n\tfunction decode(str) {\n\t if (str.indexOf(\"%\") === -1)\n\t return str;\n\t try {\n\t return decodeURIComponent(str);\n\t }\n\t catch (e) {\n\t return str;\n\t }\n\t}\n\t/**\n\t * Determine if value is a Date.\n\t */\n\tfunction isDate(val) {\n\t return __toString.call(val) === \"[object Date]\";\n\t}\n\t\n\treturn dist;\n}\n\nvar distExports = requireDist();\n\nfunction hasDocumentCookie() {\n const testingValue = typeof global === 'undefined'\n ? undefined\n : global.TEST_HAS_DOCUMENT_COOKIE;\n if (typeof testingValue === 'boolean') {\n return testingValue;\n }\n // Can we get/set cookies on document.cookie?\n return typeof document === 'object' && typeof document.cookie === 'string';\n}\nfunction parseCookies(cookies) {\n if (typeof cookies === 'string') {\n return distExports.parse(cookies);\n }\n else if (typeof cookies === 'object' && cookies !== null) {\n return cookies;\n }\n else {\n return {};\n }\n}\nfunction readCookie(value, options = {}) {\n const cleanValue = cleanupCookieValue(value);\n if (!options.doNotParse) {\n try {\n return JSON.parse(cleanValue);\n }\n catch (e) {\n // At least we tried\n }\n }\n // Ignore clean value if we failed the deserialization\n // It is not relevant anymore to trim those values\n return value;\n}\nfunction cleanupCookieValue(value) {\n // express prepend j: before serializing a cookie\n if (value && value[0] === 'j' && value[1] === ':') {\n return value.substr(2);\n }\n return value;\n}\n\nclass Cookies {\n constructor(cookies, defaultSetOptions = {}) {\n this.changeListeners = [];\n this.HAS_DOCUMENT_COOKIE = false;\n this.update = () => {\n if (!this.HAS_DOCUMENT_COOKIE) {\n return;\n }\n const previousCookies = this.cookies;\n this.cookies = distExports.parse(document.cookie);\n this._checkChanges(previousCookies);\n };\n const domCookies = typeof document === 'undefined' ? '' : document.cookie;\n this.cookies = parseCookies(cookies || domCookies);\n this.defaultSetOptions = defaultSetOptions;\n this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\n }\n _emitChange(params) {\n for (let i = 0; i < this.changeListeners.length; ++i) {\n this.changeListeners[i](params);\n }\n }\n _checkChanges(previousCookies) {\n const names = new Set(Object.keys(previousCookies).concat(Object.keys(this.cookies)));\n names.forEach((name) => {\n if (previousCookies[name] !== this.cookies[name]) {\n this._emitChange({\n name,\n value: readCookie(this.cookies[name]),\n });\n }\n });\n }\n _startPolling() {\n this.pollingInterval = setInterval(this.update, 300);\n }\n _stopPolling() {\n if (this.pollingInterval) {\n clearInterval(this.pollingInterval);\n }\n }\n get(name, options = {}) {\n if (!options.doNotUpdate) {\n this.update();\n }\n return readCookie(this.cookies[name], options);\n }\n getAll(options = {}) {\n if (!options.doNotUpdate) {\n this.update();\n }\n const result = {};\n for (let name in this.cookies) {\n result[name] = readCookie(this.cookies[name], options);\n }\n return result;\n }\n set(name, value, options) {\n if (options) {\n options = Object.assign(Object.assign({}, this.defaultSetOptions), options);\n }\n else {\n options = this.defaultSetOptions;\n }\n const stringValue = typeof value === 'string' ? value : JSON.stringify(value);\n this.cookies = Object.assign(Object.assign({}, this.cookies), { [name]: stringValue });\n if (this.HAS_DOCUMENT_COOKIE) {\n document.cookie = distExports.serialize(name, stringValue, options);\n }\n this._emitChange({ name, value, options });\n }\n remove(name, options) {\n const finalOptions = (options = Object.assign(Object.assign(Object.assign({}, this.defaultSetOptions), options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\n this.cookies = Object.assign({}, this.cookies);\n delete this.cookies[name];\n if (this.HAS_DOCUMENT_COOKIE) {\n document.cookie = distExports.serialize(name, '', finalOptions);\n }\n this._emitChange({ name, value: undefined, options });\n }\n addChangeListener(callback) {\n this.changeListeners.push(callback);\n if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 1) {\n if (typeof window === 'object' && 'cookieStore' in window) {\n window.cookieStore.addEventListener('change', this.update);\n }\n else {\n this._startPolling();\n }\n }\n }\n removeChangeListener(callback) {\n const idx = this.changeListeners.indexOf(callback);\n if (idx >= 0) {\n this.changeListeners.splice(idx, 1);\n }\n if (this.HAS_DOCUMENT_COOKIE && this.changeListeners.length === 0) {\n if (typeof window === 'object' && 'cookieStore' in window) {\n window.cookieStore.removeEventListener('change', this.update);\n }\n else {\n this._stopPolling();\n }\n }\n }\n removeAllChangeListeners() {\n while (this.changeListeners.length > 0) {\n this.removeChangeListener(this.changeListeners[0]);\n }\n }\n}\n\nexport { Cookies as default };\n","import { useCookies } from 'react-cookie';\nimport FallbackCookies from 'universal-cookie';\n\nconst COOKIE_VALID_DAYS = 1; // 0 = Session cookie\n\ntype CookieHook = ReturnType<typeof useCookies>;\ntype Cookies = { [k: string]: string };\ntype SetCookie = CookieHook[1];\ntype RemoveCookie = CookieHook[2];\ntype UpdateCookie = CookieHook[3];\n\n// CookieHelper is a class that takes in and lets us pass around the methods provided\n// by `useCookie` react hook in backend code that is connected to the universal-cookies\n// instance created in SSR middleware (and provides browser cookies)\nexport class CookieHelper {\n private cookies: Cookies;\n private set?: SetCookie;\n private remove?: RemoveCookie;\n private update?: UpdateCookie;\n private fallback!: FallbackCookies;\n\n get raw() {\n return this.cookies;\n }\n\n get cookie(): FallbackCookies {\n return (this.set ? this : this.fallback) as FallbackCookies;\n }\n\n constructor(\n cookies?: { [k: string]: string },\n setCookie?: CookieHelper['set'],\n removeCookie?: CookieHelper['remove'],\n updateCookies?: CookieHelper['update']\n ) {\n // Add fallback methods if global cookies not supplied\n if (!cookies || !setCookie || !removeCookie)\n this.fallback = new FallbackCookies();\n\n this.cookies = cookies || this.fallback.getAll();\n if (setCookie) this.set = setCookie;\n if (removeCookie) this.remove = removeCookie;\n if (updateCookies) this.update = updateCookies;\n }\n\n GetCookie(name: string) {\n const cookie = this.cookies[name];\n if (typeof cookie === 'undefined') {\n return null;\n }\n return cookie;\n }\n\n SetCookie(name: string, value: string, maxAgeDays = COOKIE_VALID_DAYS) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n this.cookies[name] = value;\n\n // call the passed setCookie method so we can update the `universal-cookie` instance\n // with the change listener attached so the cookies can be set in SSR response\n if (maxAgeDays === 0) this.cookie.set(name, value);\n else\n this.cookie.set(name, value, {\n expires: addDays(new Date(), maxAgeDays),\n path: '/',\n });\n }\n\n DeleteCookie(name: string) {\n // update local cookies object as this is provided as a clone of `req.universalCookies`\n delete this.cookies[name];\n\n this.cookie.remove(name, {\n path: '/',\n });\n }\n}\nconst addDays = (date = new Date(), days: number) => {\n const result = new Date(date);\n result.setDate(result.getDate() + days);\n return result;\n};\n\nexport const mapCookieHeader = cookies =>\n typeof cookies === 'object'\n ? Object.entries(cookies)\n .map(([name, value]) => `${name}=${value}`)\n .join('; ')\n : cookies;\n"],"names":["BEARER_TOKEN_COOKIE","LOGIN_COOKIE","REFRESH_TOKEN_COOKIE","findLoginCookies","cookies","Object","fromEntries","entries","filter","name","includes","COOKIE_VALID_DAYS","CookieHelper","raw","cookie","set","fallback","constructor","setCookie","removeCookie","updateCookies","FallbackCookies","getAll","remove","update","GetCookie","SetCookie","value","maxAgeDays","expires","addDays","Date","path","DeleteCookie","date","days","result","setDate","getDate"],"mappings":"AAAO,MAAMA,mBAAmB,GAAG;AAC5B,MAAMC,YAAY,GAAG;AACrB,MAAMC,oBAAoB,GAAG;MAIvBC,gBAAgB,GAAIC,OAA8B,IAC7D,OAAOA,OAAO,KAAK,QAAQ,GACvBC,MAAM,CAACC,WAAW,CAChBD,MAAM,CAACE,OAAO,CAACH,OAAO,CAAC,CAACI,MAAM,CAAC,CAAC,CAACC,IAAI,CAAC,KACpC,CAACR,YAAY,EAAEC,oBAAoB,CAAC,CAACQ,QAAQ,CAACD,IAAI,CACpD,CACF,CAAC,GACDL;;ACbN,IAAI,IAAI,GAAG,EAAE;;AAEb,IAAI,eAAe;;AAEnB,SAAS,WAAW,IAAI;AACxB,CAAC,IAAI,eAAe,EAAE,OAAO,IAAI;AACjC,CAAC,eAAe,GAAG,CAAC;AACpB,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC3D,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK;AACnB,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA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CAAC;AACN,EAAA;EAEAC,YAAYA,CAACxB,IAAY,EAAE;AACzB;AACA,IAAA,OAAO,IAAI,CAACL,OAAO,CAACK,IAAI,CAAC;AAEzB,IAAA,IAAI,CAACK,MAAM,CAACS,MAAM,CAACd,IAAI,EAAE;AACvBuB,MAAAA,IAAI,EAAE;AACR,KAAC,CAAC;AACJ,EAAA;AACF;AACA,MAAMF,OAAO,GAAGA,CAACI,IAAI,GAAG,IAAIH,IAAI,EAAE,EAAEI,IAAY,KAAK;AACnD,EAAA,MAAMC,MAAM,GAAG,IAAIL,IAAI,CAACG,IAAI,CAAC;EAC7BE,MAAM,CAACC,OAAO,CAACD,MAAM,CAACE,OAAO,EAAE,GAAGH,IAAI,CAAC;AACvC,EAAA,OAAOC,MAAM;AACf,CAAC;;;;","x_google_ignoreList":[1]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React, { useContext, createContext,
|
|
2
|
-
import { useCookies } from 'react-cookie';
|
|
1
|
+
import React, { useContext, createContext, useCallback, useEffect, cloneElement } from 'react';
|
|
3
2
|
import { connect } from 'react-redux';
|
|
4
3
|
import { Navigate, useRoutes, useLocation, matchRoutes } from 'react-router-dom';
|
|
5
4
|
import { createSelector } from 'reselect';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { h as selectRouteEntryContentTypeId, j as selectRouteEntry, k as selectRouteIsError, l as selectIsNotFound, m as selectRouteLoading, n as selectMappedEntry, f as selectCurrentProject, o as selectCurrentPath, p as selectRouteStatusCode, q as selectRouteErrorMessage, u as setNavigationPath } from './selectors-CBdCY0u3.js';
|
|
6
|
+
import { d as selectUserIsAuthenticated, k as selectUserGroups, t as toJS, m as matchUserGroup } from './ToJs-CpPNdcXS.js';
|
|
7
|
+
import { e as useSSRContext } from './SSRContext-CkiWIvde.js';
|
|
8
8
|
|
|
9
9
|
const HttpContext = /*#__PURE__*/createContext({});
|
|
10
10
|
const useHttpContext = () => {
|
|
@@ -13,13 +13,13 @@ const useHttpContext = () => {
|
|
|
13
13
|
|
|
14
14
|
const mergeStaticRoutes = matchedStaticRoute => {
|
|
15
15
|
let finalRoute = {};
|
|
16
|
-
|
|
17
16
|
for (const [i, route] of matchedStaticRoute.entries()) {
|
|
18
|
-
const staticRouteCopy = {
|
|
17
|
+
const staticRouteCopy = {
|
|
18
|
+
...route.route
|
|
19
19
|
};
|
|
20
|
-
|
|
21
20
|
if (i === matchedStaticRoute.length - 1) {
|
|
22
|
-
finalRoute = {
|
|
21
|
+
finalRoute = {
|
|
22
|
+
...finalRoute,
|
|
23
23
|
...staticRouteCopy,
|
|
24
24
|
fullPath: `${finalRoute.fullPath || ''}${route.route.path ? route.route.path : ''}`
|
|
25
25
|
};
|
|
@@ -30,7 +30,8 @@ const mergeStaticRoutes = matchedStaticRoute => {
|
|
|
30
30
|
delete staticRouteCopy.path;
|
|
31
31
|
delete staticRouteCopy.component;
|
|
32
32
|
delete staticRouteCopy.element;
|
|
33
|
-
finalRoute = {
|
|
33
|
+
finalRoute = {
|
|
34
|
+
...finalRoute,
|
|
34
35
|
...staticRouteCopy,
|
|
35
36
|
fullPath: `${finalRoute.fullPath || ''}${route.route.path ? route.route.path.endsWith('/') ? route.route.path : route.route.path + '/' : ''}`
|
|
36
37
|
};
|
|
@@ -43,12 +44,10 @@ const Redirect = ({
|
|
|
43
44
|
to
|
|
44
45
|
}) => {
|
|
45
46
|
const httpContext = useHttpContext();
|
|
46
|
-
|
|
47
47
|
if (httpContext) {
|
|
48
48
|
httpContext.statusCode = code;
|
|
49
49
|
httpContext.url = to;
|
|
50
50
|
}
|
|
51
|
-
|
|
52
51
|
return /*#__PURE__*/React.createElement(Navigate, {
|
|
53
52
|
to: to
|
|
54
53
|
});
|
|
@@ -59,11 +58,9 @@ const Status = ({
|
|
|
59
58
|
children
|
|
60
59
|
}) => {
|
|
61
60
|
const httpContext = useHttpContext();
|
|
62
|
-
|
|
63
61
|
if (httpContext) {
|
|
64
62
|
httpContext.statusCode = code;
|
|
65
63
|
}
|
|
66
|
-
|
|
67
64
|
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
68
65
|
};
|
|
69
66
|
|
|
@@ -88,27 +85,21 @@ const StaticRouteLoader = ({
|
|
|
88
85
|
|
|
89
86
|
const replaceDoubleSlashRecursive = path => {
|
|
90
87
|
const nextPath = path.replace(/\/\//, '/');
|
|
91
|
-
|
|
92
88
|
if (nextPath.match(/\/\//)) {
|
|
93
89
|
return replaceDoubleSlashRecursive(nextPath);
|
|
94
90
|
}
|
|
95
|
-
|
|
96
91
|
return nextPath;
|
|
97
92
|
};
|
|
98
|
-
|
|
99
93
|
const getTrimmedPath = path => {
|
|
100
94
|
if (path !== '/') {
|
|
101
95
|
const nextPath = replaceDoubleSlashRecursive(path);
|
|
102
96
|
const lastChar = nextPath[nextPath.length - 1];
|
|
103
|
-
|
|
104
97
|
if (lastChar === '/') {
|
|
105
98
|
return nextPath.substring(0, nextPath.length - 1);
|
|
106
99
|
}
|
|
107
100
|
}
|
|
108
|
-
|
|
109
101
|
return path;
|
|
110
102
|
};
|
|
111
|
-
|
|
112
103
|
const processStaticRoutes = (staticRoutes, componentProps) => {
|
|
113
104
|
const {
|
|
114
105
|
projectId,
|
|
@@ -118,9 +109,9 @@ const processStaticRoutes = (staticRoutes, componentProps) => {
|
|
|
118
109
|
isLoggedIn
|
|
119
110
|
} = componentProps;
|
|
120
111
|
return staticRoutes.map(x => {
|
|
121
|
-
const route = {
|
|
112
|
+
const route = {
|
|
113
|
+
...x
|
|
122
114
|
};
|
|
123
|
-
|
|
124
115
|
if (route.component) {
|
|
125
116
|
route.element = /*#__PURE__*/React.createElement(route.component, {
|
|
126
117
|
projectId: projectId,
|
|
@@ -131,7 +122,6 @@ const processStaticRoutes = (staticRoutes, componentProps) => {
|
|
|
131
122
|
});
|
|
132
123
|
delete route.component;
|
|
133
124
|
}
|
|
134
|
-
|
|
135
125
|
if (route.element) {
|
|
136
126
|
route.element = /*#__PURE__*/cloneElement(route.element, {
|
|
137
127
|
projectId,
|
|
@@ -141,15 +131,12 @@ const processStaticRoutes = (staticRoutes, componentProps) => {
|
|
|
141
131
|
isLoggedIn
|
|
142
132
|
});
|
|
143
133
|
}
|
|
144
|
-
|
|
145
134
|
if (route.children) {
|
|
146
135
|
route.children = processStaticRoutes(route.children, componentProps);
|
|
147
136
|
}
|
|
148
|
-
|
|
149
137
|
return route;
|
|
150
138
|
});
|
|
151
139
|
};
|
|
152
|
-
|
|
153
140
|
const RouteLoader = ({
|
|
154
141
|
contentTypeId,
|
|
155
142
|
entry,
|
|
@@ -171,40 +158,43 @@ const RouteLoader = ({
|
|
|
171
158
|
trailingSlashRedirectCode = 302
|
|
172
159
|
}) => {
|
|
173
160
|
const location = useLocation();
|
|
174
|
-
const cookies = new CookieHelper(...useCookies()); // Always ensure paths are trimmed of trailing slashes so urls are always unique
|
|
175
161
|
|
|
176
|
-
|
|
162
|
+
// In SSR pass references to things in backing sagas
|
|
163
|
+
// we cannot access in a global scope
|
|
164
|
+
const ssrContext = useSSRContext();
|
|
177
165
|
|
|
166
|
+
// Always ensure paths are trimmed of trailing slashes so urls are always unique
|
|
167
|
+
const trimmedPath = getTrimmedPath(location.pathname);
|
|
168
|
+
|
|
169
|
+
// Convert any react-router-v5 style routes to react-router-v6 style routes.
|
|
178
170
|
const staticRoutes = processStaticRoutes(routes.StaticRoutes, {
|
|
179
171
|
projectId,
|
|
180
172
|
contentTypeId,
|
|
181
173
|
entry,
|
|
182
174
|
mappedEntry,
|
|
183
175
|
isLoggedIn
|
|
184
|
-
});
|
|
176
|
+
});
|
|
185
177
|
|
|
178
|
+
// Match any Static Routes a developer has defined
|
|
186
179
|
const matchedStaticRoute = matchRoutes(staticRoutes, location);
|
|
187
|
-
const isStaticRoute = matchedStaticRoute && matchedStaticRoute.length > 0;
|
|
180
|
+
const isStaticRoute = matchedStaticRoute && matchedStaticRoute.length > 0;
|
|
188
181
|
|
|
182
|
+
// Combine custom params for all static routes, with the furthest config taking precedence.
|
|
189
183
|
if (isStaticRoute) {
|
|
190
184
|
mergeStaticRoutes(matchedStaticRoute);
|
|
191
185
|
}
|
|
192
|
-
|
|
193
186
|
const staticRoute = isStaticRoute ? matchedStaticRoute.pop() || undefined : undefined;
|
|
194
187
|
const routeRequiresLogin = staticRoute ? staticRoute.route.requireLogin : undefined;
|
|
195
188
|
const setPath = useCallback(() => {
|
|
196
189
|
// Use serverPath to control the path we send to siteview node api to resolve a route
|
|
197
190
|
let serverPath = '';
|
|
198
|
-
|
|
199
191
|
if (staticRoute && staticRoute.pathname === staticRoute.pathnameBase) {
|
|
200
192
|
var _route$path, _route$fetchNode;
|
|
201
|
-
|
|
202
193
|
const {
|
|
203
194
|
route,
|
|
204
195
|
pathname,
|
|
205
196
|
params
|
|
206
197
|
} = staticRoute;
|
|
207
|
-
|
|
208
198
|
if ((_route$path = route.path) !== null && _route$path !== void 0 && _route$path.includes('*')) {
|
|
209
199
|
// Send the whole url to api if we have matched route containing wildcard
|
|
210
200
|
serverPath = pathname;
|
|
@@ -221,46 +211,47 @@ const RouteLoader = ({
|
|
|
221
211
|
}).replace(/\/$/, '');
|
|
222
212
|
} else {
|
|
223
213
|
var _route$fullPath;
|
|
224
|
-
|
|
225
214
|
// Send all non-parameterised url parts to api
|
|
226
215
|
serverPath = (_route$fullPath = route.fullPath) === null || _route$fullPath === void 0 ? void 0 : _route$fullPath.split('/').filter(p => !p.startsWith(':')).join('/');
|
|
227
216
|
}
|
|
228
217
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}, [setNavigationPath,
|
|
232
|
-
|
|
218
|
+
setNavigationPath(serverPath || trimmedPath, location, staticRoute, withEvents, statePath, routes, ssrContext);
|
|
219
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
220
|
+
}, [setNavigationPath,
|
|
221
|
+
// staticRoute,
|
|
222
|
+
withEvents, location, routes,
|
|
223
|
+
// statePath,
|
|
233
224
|
trimmedPath]);
|
|
234
225
|
if (typeof window == 'undefined') setPath();
|
|
235
226
|
useEffect(() => {
|
|
236
227
|
setPath();
|
|
237
|
-
}, [location, setPath]);
|
|
228
|
+
}, [location, setPath]);
|
|
238
229
|
|
|
230
|
+
// Need to redirect when url endswith a /
|
|
239
231
|
if (location.pathname.length > trimmedPath.length) {
|
|
240
232
|
return /*#__PURE__*/React.createElement(Redirect, {
|
|
241
233
|
code: trailingSlashRedirectCode || 302,
|
|
242
234
|
to: `${trimmedPath}${location.search}${location.hash}`
|
|
243
235
|
});
|
|
244
|
-
}
|
|
245
|
-
|
|
236
|
+
}
|
|
246
237
|
|
|
238
|
+
// Render any Static Routes a developer has defined
|
|
247
239
|
if (isStaticRoute && !(!isLoggedIn && routeRequiresLogin)) {
|
|
248
240
|
if (matchUserGroup(userGroups, routeRequiresLogin)) return /*#__PURE__*/React.createElement(StaticRouteLoader, {
|
|
249
241
|
staticRoutes: staticRoutes
|
|
250
242
|
});
|
|
251
|
-
}
|
|
252
|
-
// is not a static route and is in a loading state
|
|
253
|
-
|
|
243
|
+
}
|
|
254
244
|
|
|
245
|
+
// Render a supplied Loading component if the route
|
|
246
|
+
// is not a static route and is in a loading state
|
|
255
247
|
if (isLoading && !isNotFound && loadingComponent) {
|
|
256
248
|
const LoadingComponent = loadingComponent;
|
|
257
249
|
return /*#__PURE__*/React.createElement(LoadingComponent, null);
|
|
258
|
-
}
|
|
259
|
-
|
|
250
|
+
}
|
|
260
251
|
|
|
252
|
+
// Match any defined Content Type Mappings
|
|
261
253
|
if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) {
|
|
262
254
|
const MatchedComponent = routes.ContentTypeMappings.find(item => item.contentTypeID === contentTypeId);
|
|
263
|
-
|
|
264
255
|
if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) {
|
|
265
256
|
if (matchUserGroup(userGroups, MatchedComponent.requireLogin)) return /*#__PURE__*/React.createElement(MatchedComponent.component, {
|
|
266
257
|
projectId: projectId,
|
|
@@ -271,9 +262,7 @@ const RouteLoader = ({
|
|
|
271
262
|
});
|
|
272
263
|
}
|
|
273
264
|
}
|
|
274
|
-
|
|
275
265
|
const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound;
|
|
276
|
-
|
|
277
266
|
if (isNotFound || isError) {
|
|
278
267
|
console.info(`RouteLoader rendering NotFound component: statusCode ${statusCode}, isNotFound ${isNotFound}, isError ${isError}`);
|
|
279
268
|
return /*#__PURE__*/React.createElement(Status, {
|
|
@@ -283,10 +272,8 @@ const RouteLoader = ({
|
|
|
283
272
|
statusText: statusText
|
|
284
273
|
}));
|
|
285
274
|
}
|
|
286
|
-
|
|
287
275
|
return null;
|
|
288
276
|
};
|
|
289
|
-
|
|
290
277
|
const mapStateToPropsMemoized = createSelector(selectRouteEntryContentTypeId, selectRouteEntry, selectRouteIsError, selectIsNotFound, selectRouteLoading, selectUserIsAuthenticated, selectMappedEntry, selectCurrentProject, selectCurrentPath, selectRouteStatusCode, selectRouteErrorMessage, selectUserGroups, (contentTypeId, entry, isError, isNotFound, isLoading, isLoggedIn, mappedEntry, projectId, statePath, statusCode, statusText, userGroups) => ({
|
|
291
278
|
contentTypeId,
|
|
292
279
|
entry,
|
|
@@ -306,5 +293,5 @@ const mapDispatchToProps = {
|
|
|
306
293
|
};
|
|
307
294
|
var RouteLoader$1 = connect(mapStateToPropsMemoized, mapDispatchToProps)(toJS(RouteLoader));
|
|
308
295
|
|
|
309
|
-
export { HttpContext as H,
|
|
310
|
-
//# sourceMappingURL=RouteLoader-
|
|
296
|
+
export { HttpContext as H, Redirect as R, Status as S, RouteLoader$1 as a, mergeStaticRoutes as m, useHttpContext as u };
|
|
297
|
+
//# sourceMappingURL=RouteLoader-D7HmVx5l.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouteLoader-D7HmVx5l.js","sources":["../src/routing/httpContext.ts","../src/util/mergeStaticRoutes.ts","../src/routing/components/Redirect.tsx","../src/routing/components/Status.tsx","../src/routing/components/NotFound.tsx","../src/routing/components/StaticRouteLoader.tsx","../src/routing/components/RouteLoader.tsx"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nexport type HttpContextValues = {\n statusCode?: number;\n url?: string;\n};\n\nexport const HttpContext = createContext<HttpContextValues>({});\nexport const useHttpContext = () => {\n return useContext(HttpContext);\n};\n","import { StaticRoute } from '../';\n\nexport const mergeStaticRoutes = matchedStaticRoute => {\n let finalRoute: StaticRoute = {};\n for (const [i, route] of matchedStaticRoute.entries()) {\n const staticRouteCopy = { ...route.route };\n if (i === matchedStaticRoute.length - 1) {\n finalRoute = {\n ...finalRoute,\n ...staticRouteCopy,\n fullPath: `${finalRoute.fullPath || ''}${\n route.route.path ? route.route.path : ''\n }`,\n };\n matchedStaticRoute[i].route = finalRoute;\n } else {\n delete staticRouteCopy.children;\n delete staticRouteCopy.index;\n delete staticRouteCopy.path;\n delete staticRouteCopy.component;\n delete staticRouteCopy.element;\n finalRoute = {\n ...finalRoute,\n ...staticRouteCopy,\n fullPath: `${finalRoute.fullPath || ''}${\n route.route.path\n ? route.route.path.endsWith('/')\n ? route.route.path\n : route.route.path + '/'\n : ''\n }`,\n };\n }\n }\n};\n","import React, { PropsWithChildren } from 'react';\nimport { Navigate } from 'react-router-dom';\nimport { useHttpContext } from '../httpContext';\n\nexport const Redirect = ({\n code,\n to,\n}: PropsWithChildren<{ code: 301 | 302; to: string }>) => {\n const httpContext = useHttpContext();\n if (httpContext) {\n httpContext.statusCode = code;\n httpContext.url = to;\n }\n return <Navigate to={to} />;\n};\n","import React, { PropsWithChildren } from 'react';\nimport { useHttpContext } from '../httpContext';\n\nexport const Status = ({\n code,\n children,\n}: PropsWithChildren<{ code: number }>) => {\n const httpContext = useHttpContext();\n if (httpContext) {\n httpContext.statusCode = code;\n }\n return <>{children}</>;\n};\n","import React from 'react';\n\nconst NotFound = ({\n statusCode,\n statusText,\n}: {\n statusCode: number;\n statusText: string;\n}) => (\n <>\n <header>\n <h1>{statusCode || '404'} Page Not Found</h1>\n {statusText && (\n <h2\n style={{\n background: '#eee',\n color: '#666',\n fontSize: '100%',\n padding: '10px',\n }}\n >\n {statusText}\n </h2>\n )}\n </header>\n </>\n);\n\nexport default NotFound;\n","import React from 'react';\nimport { RouteObject, useRoutes } from 'react-router-dom';\nimport type { StaticRoute } from '~/models';\n\nexport interface StaticRouteLoaderProps {\n staticRoutes: StaticRoute[];\n}\n\nexport const StaticRouteLoader = ({ staticRoutes }: StaticRouteLoaderProps) => {\n const staticRouteElement = useRoutes(staticRoutes as RouteObject[]);\n return <>{staticRouteElement}</>;\n};\n","import React, { useEffect, useCallback, cloneElement } from 'react';\nimport { connect } from 'react-redux';\nimport { useLocation, matchRoutes, RouteObject } from 'react-router-dom';\n\nimport { createSelector } from 'reselect';\n\nimport NotFound from './NotFound';\nimport { Status } from './Status';\n\nimport {\n selectCurrentPath,\n selectCurrentProject,\n selectIsNotFound,\n selectMappedEntry,\n selectRouteEntry,\n selectRouteEntryContentTypeId,\n selectRouteErrorMessage,\n selectRouteIsError,\n selectRouteLoading,\n selectRouteStatusCode,\n} from '../redux/selectors';\nimport { setNavigationPath } from '../redux/actions';\n\nimport {\n selectUserGroups,\n selectUserIsAuthenticated,\n} from '~/user/redux/selectors';\nimport { matchUserGroup } from '~/user/util/matchGroups';\nimport { toJS } from '~/util/ToJs';\nimport { useSSRContext } from '~/util/SSRContext';\n\nimport { mergeStaticRoutes } from '~/util/mergeStaticRoutes';\nimport { Entry } from 'contensis-delivery-api/lib/models';\nimport { AppRootProps, MatchedRoute, RouteComponentProps, RouteLoaderProps, StaticRoute } from '~/models';\nimport { StaticRouteLoader } from './StaticRouteLoader';\nimport { Redirect } from './Redirect';\n\nconst replaceDoubleSlashRecursive = (path: string) => {\n const nextPath = path.replace(/\\/\\//, '/');\n\n if (nextPath.match(/\\/\\//)) {\n return replaceDoubleSlashRecursive(nextPath);\n }\n\n return nextPath;\n};\n\nconst getTrimmedPath = path => {\n if (path !== '/') {\n const nextPath = replaceDoubleSlashRecursive(path);\n const lastChar = nextPath[nextPath.length - 1];\n if (lastChar === '/') {\n return nextPath.substring(0, nextPath.length - 1);\n }\n }\n return path;\n};\n\nconst processStaticRoutes = (\n staticRoutes: StaticRoute[],\n componentProps: Partial<IReduxProps>\n) => {\n const { projectId, contentTypeId, entry, mappedEntry, isLoggedIn } =\n componentProps;\n return staticRoutes.map(x => {\n const route = { ...x };\n if (route.component) {\n route.element = (\n <route.component\n projectId={projectId}\n contentTypeId={contentTypeId ? contentTypeId : undefined}\n entry={entry}\n mappedEntry={mappedEntry}\n isLoggedIn={isLoggedIn}\n />\n );\n delete route.component;\n }\n if (route.element) {\n route.element = cloneElement(route.element as React.ReactElement<any>, {\n projectId,\n contentTypeId,\n entry,\n mappedEntry,\n isLoggedIn,\n });\n }\n if (route.children) {\n route.children = processStaticRoutes(route.children, componentProps);\n }\n return route;\n });\n};\n\ninterface IReduxProps {\n contentTypeId: string | null;\n entry: Entry | null;\n isError: boolean;\n isNotFound: boolean;\n isLoading: boolean;\n isLoggedIn: boolean;\n mappedEntry: any;\n projectId: string;\n setNavigationPath: typeof setNavigationPath;\n statePath: string;\n statusCode: any;\n statusText: string;\n userGroups: any;\n}\n\nconst RouteLoader = ({\n contentTypeId,\n entry,\n isError,\n isLoading,\n isLoggedIn,\n isNotFound,\n loadingComponent,\n mappedEntry,\n notFoundComponent,\n projectId,\n routes,\n setNavigationPath,\n statePath,\n statusCode,\n statusText,\n userGroups,\n withEvents,\n trailingSlashRedirectCode = 302,\n}: AppRootProps & RouteLoaderProps & IReduxProps) => {\n const location = useLocation();\n\n // In SSR pass references to things in backing sagas\n // we cannot access in a global scope\n const ssrContext = useSSRContext();\n\n // Always ensure paths are trimmed of trailing slashes so urls are always unique\n const trimmedPath = getTrimmedPath(location.pathname);\n\n // Convert any react-router-v5 style routes to react-router-v6 style routes.\n const staticRoutes = processStaticRoutes(routes.StaticRoutes, {\n projectId,\n contentTypeId,\n entry,\n mappedEntry,\n isLoggedIn,\n });\n\n // Match any Static Routes a developer has defined\n const matchedStaticRoute = matchRoutes(\n staticRoutes as RouteObject[],\n location\n );\n const isStaticRoute = matchedStaticRoute && matchedStaticRoute.length > 0;\n\n // Combine custom params for all static routes, with the furthest config taking precedence.\n if (isStaticRoute) {\n mergeStaticRoutes(matchedStaticRoute);\n }\n\n const staticRoute: MatchedRoute<string, StaticRoute> | undefined =\n isStaticRoute ? matchedStaticRoute.pop() || undefined : undefined;\n\n const routeRequiresLogin = staticRoute\n ? staticRoute.route.requireLogin\n : undefined;\n\n const setPath = useCallback(() => {\n // Use serverPath to control the path we send to siteview node api to resolve a route\n let serverPath = '';\n if (staticRoute && staticRoute.pathname === staticRoute.pathnameBase) {\n const { route, pathname, params } = staticRoute;\n\n if (route.path?.includes('*')) {\n // Send the whole url to api if we have matched route containing wildcard\n serverPath = pathname;\n } else if (typeof route.fetchNodeLevel === 'number') {\n // Send all url parts to a specified level to api\n serverPath = pathname\n .split('/')\n .splice(0, route.fetchNodeLevel + 1)\n .join('/');\n } else if (\n typeof route.fetchNode === 'object' &&\n route.fetchNode?.params\n ) {\n const fetchNodeParams: string[] = route.fetchNode.params;\n const routeParams = params;\n\n const regexExp = new RegExp(\n Object.keys(routeParams)\n .map(p => `:${p}`)\n .join('|'),\n 'g'\n );\n\n serverPath = pathname\n .replace(/\\?/g, '')\n .replace(regexExp, matched => {\n const param = matched.replace(':', '');\n if (fetchNodeParams.includes(param))\n return routeParams[param] || '';\n else return '';\n })\n .replace(/\\/$/, '');\n } else {\n // Send all non-parameterised url parts to api\n serverPath = (route.fullPath as string)\n ?.split('/')\n .filter(p => !p.startsWith(':'))\n .join('/');\n }\n }\n\n setNavigationPath(\n serverPath || trimmedPath,\n location,\n staticRoute,\n withEvents,\n statePath,\n routes,\n ssrContext\n );\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [\n setNavigationPath,\n // staticRoute,\n withEvents,\n location,\n routes,\n // statePath,\n trimmedPath,\n ]);\n\n if (typeof window == 'undefined') setPath();\n\n useEffect(() => {\n setPath();\n }, [location, setPath]);\n\n // Need to redirect when url endswith a /\n if (location.pathname.length > trimmedPath.length) {\n return (\n <Redirect\n code={trailingSlashRedirectCode || 302}\n to={`${trimmedPath}${location.search}${location.hash}`}\n />\n );\n }\n\n // Render any Static Routes a developer has defined\n if (isStaticRoute && !(!isLoggedIn && routeRequiresLogin)) {\n if (matchUserGroup(userGroups, routeRequiresLogin))\n return <StaticRouteLoader staticRoutes={staticRoutes} />;\n }\n\n // Render a supplied Loading component if the route\n // is not a static route and is in a loading state\n if (isLoading && !isNotFound && loadingComponent) {\n const LoadingComponent = loadingComponent;\n return <LoadingComponent />;\n }\n\n // Match any defined Content Type Mappings\n if (contentTypeId && !(!isLoggedIn && routeRequiresLogin)) {\n const MatchedComponent = routes.ContentTypeMappings.find(\n item => item.contentTypeID === contentTypeId\n );\n\n if (MatchedComponent && !(MatchedComponent.requireLogin && !isLoggedIn)) {\n if (matchUserGroup(userGroups, MatchedComponent.requireLogin))\n return (\n <MatchedComponent.component\n projectId={projectId}\n contentTypeId={contentTypeId}\n entry={entry}\n mappedEntry={mappedEntry}\n isLoggedIn={isLoggedIn}\n />\n );\n }\n }\n\n const NotFoundComponent = notFoundComponent ? notFoundComponent : NotFound;\n if (isNotFound || isError) {\n console.info(\n `RouteLoader rendering NotFound component: statusCode ${statusCode}, isNotFound ${isNotFound}, isError ${isError}`\n );\n\n return (\n <Status code={statusCode}>\n <NotFoundComponent statusCode={statusCode} statusText={statusText} />\n </Status>\n );\n }\n\n return null;\n};\nconst mapStateToPropsMemoized = createSelector(\n selectRouteEntryContentTypeId,\n selectRouteEntry,\n selectRouteIsError,\n selectIsNotFound,\n selectRouteLoading,\n selectUserIsAuthenticated,\n selectMappedEntry,\n selectCurrentProject,\n selectCurrentPath,\n selectRouteStatusCode,\n selectRouteErrorMessage,\n selectUserGroups,\n (\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups\n ) => ({\n contentTypeId,\n entry,\n isError,\n isNotFound,\n isLoading,\n isLoggedIn,\n mappedEntry,\n projectId,\n statePath,\n statusCode,\n statusText,\n userGroups,\n })\n);\n\nconst mapDispatchToProps = {\n setNavigationPath,\n};\n\nexport default connect(\n mapStateToPropsMemoized,\n mapDispatchToProps\n)(toJS(RouteLoader as any)) as unknown as (\n props: AppRootProps & RouteLoaderProps\n) => JSX.Element;\n"],"names":["HttpContext","createContext","useHttpContext","useContext","mergeStaticRoutes","matchedStaticRoute","finalRoute","i","route","entries","staticRouteCopy","length","fullPath","path","children","index","component","element","endsWith","Redirect","code","to","httpContext","statusCode","url","React","createElement","Navigate","Status","Fragment","NotFound","statusText","style","background","color","fontSize","padding","StaticRouteLoader","staticRoutes","staticRouteElement","useRoutes","replaceDoubleSlashRecursive","nextPath","replace","match","getTrimmedPath","lastChar","substring","processStaticRoutes","componentProps","projectId","contentTypeId","entry","mappedEntry","isLoggedIn","map","x","undefined","cloneElement","RouteLoader","isError","isLoading","isNotFound","loadingComponent","notFoundComponent","routes","setNavigationPath","statePath","userGroups","withEvents","trailingSlashRedirectCode","location","useLocation","ssrContext","useSSRContext","trimmedPath","pathname","StaticRoutes","matchRoutes","isStaticRoute","staticRoute","pop","routeRequiresLogin","requireLogin","setPath","useCallback","serverPath","pathnameBase","_route$path","_route$fetchNode","params","includes","fetchNodeLevel","split","splice","join","fetchNode","fetchNodeParams","routeParams","regexExp","RegExp","Object","keys","p","matched","param","_route$fullPath","filter","startsWith","window","useEffect","search","hash","matchUserGroup","LoadingComponent","MatchedComponent","ContentTypeMappings","find","item","contentTypeID","NotFoundComponent","console","info","mapStateToPropsMemoized","createSelector","selectRouteEntryContentTypeId","selectRouteEntry","selectRouteIsError","selectIsNotFound","selectRouteLoading","selectUserIsAuthenticated","selectMappedEntry","selectCurrentProject","selectCurrentPath","selectRouteStatusCode","selectRouteErrorMessage","selectUserGroups","mapDispatchToProps","connect","toJS"],"mappings":";;;;;;;;MAOaA,WA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