@zengenti/contensis-react-base 4.0.0-beta.3 → 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.
Files changed (54) hide show
  1. package/cjs/{App-BNcmM8rN.js → App-DXro6av4.js} +5 -5
  2. package/cjs/{App-BNcmM8rN.js.map → App-DXro6av4.js.map} +1 -1
  3. package/cjs/{ChangePassword.container-642SYfpS.js → ChangePassword.container-ECjEXixF.js} +2 -2
  4. package/cjs/{ChangePassword.container-642SYfpS.js.map → ChangePassword.container-ECjEXixF.js.map} +1 -1
  5. package/cjs/{CookieHelper.class-BoY5TrIi.js → CookieHelper.class-C3Eqoze9.js} +170 -261
  6. package/cjs/CookieHelper.class-C3Eqoze9.js.map +1 -0
  7. package/cjs/{RouteLoader-DvyYYyIE.js → RouteLoader-BFc-Wl6M.js} +2 -2
  8. package/cjs/{RouteLoader-DvyYYyIE.js.map → RouteLoader-BFc-Wl6M.js.map} +1 -1
  9. package/cjs/{SSRContext-D66GKlH7.js → SSRContext-CFeZxG9H.js} +3 -3
  10. package/cjs/{SSRContext-D66GKlH7.js.map → SSRContext-CFeZxG9H.js.map} +1 -1
  11. package/cjs/client.js +8 -8
  12. package/cjs/contensis-react-base.js +8 -8
  13. package/cjs/redux.js +3 -3
  14. package/cjs/routing.js +5 -5
  15. package/cjs/{store-CADDS7cV.js → store-D07FOXvM.js} +4 -7
  16. package/cjs/store-D07FOXvM.js.map +1 -0
  17. package/cjs/user.js +2 -2
  18. package/cjs/util.js +4 -4
  19. package/cjs/{version-ASZx0NDG.js → version-B7XFkBhY.js} +2 -2
  20. package/cjs/{version-ASZx0NDG.js.map → version-B7XFkBhY.js.map} +1 -1
  21. package/esm/{App-CfIZbvU9.js → App-CIlf4cl4.js} +5 -5
  22. package/esm/{App-CfIZbvU9.js.map → App-CIlf4cl4.js.map} +1 -1
  23. package/esm/{ChangePassword.container-Q7bElOVz.js → ChangePassword.container-C0tFq0Tf.js} +2 -2
  24. package/esm/{ChangePassword.container-Q7bElOVz.js.map → ChangePassword.container-C0tFq0Tf.js.map} +1 -1
  25. package/esm/{CookieHelper.class-DzleKOOc.js → CookieHelper.class-FTURFpz3.js} +170 -261
  26. package/esm/CookieHelper.class-FTURFpz3.js.map +1 -0
  27. package/esm/{RouteLoader-qJA3UqTM.js → RouteLoader-D7HmVx5l.js} +2 -2
  28. package/esm/{RouteLoader-qJA3UqTM.js.map → RouteLoader-D7HmVx5l.js.map} +1 -1
  29. package/esm/{SSRContext-C743Oeli.js → SSRContext-CkiWIvde.js} +3 -3
  30. package/esm/{SSRContext-C743Oeli.js.map → SSRContext-CkiWIvde.js.map} +1 -1
  31. package/esm/client.js +9 -9
  32. package/esm/contensis-react-base.js +9 -9
  33. package/esm/redux.js +5 -5
  34. package/esm/routing.js +5 -5
  35. package/esm/{store-uQZKjfA8.js → store-v2gyr6u2.js} +4 -6
  36. package/esm/store-v2gyr6u2.js.map +1 -0
  37. package/esm/user.js +3 -3
  38. package/esm/util.js +4 -4
  39. package/esm/{version-B9nPx4IF.js → version-DvjTUbcA.js} +2 -2
  40. package/esm/{version-B9nPx4IF.js.map → version-DvjTUbcA.js.map} +1 -1
  41. package/models/app/pages/VersionInfo/components/VersionInfo.d.ts +4 -1
  42. package/models/models/AppState.d.ts +3 -3
  43. package/models/models/StaticRoute.d.ts +3 -2
  44. package/models/redux/store/injectors.d.ts +4 -4
  45. package/models/redux/store/store.d.ts +1 -1
  46. package/models/search/containers/withListing.d.ts +4 -1
  47. package/models/search/containers/withSearch.d.ts +4 -1
  48. package/models/user/hocs/withRegistration.d.ts +6 -3
  49. package/package.json +11 -11
  50. package/cjs/CookieHelper.class-BoY5TrIi.js.map +0 -1
  51. package/cjs/store-CADDS7cV.js.map +0 -1
  52. package/esm/CookieHelper.class-DzleKOOc.js.map +0 -1
  53. package/esm/store-uQZKjfA8.js.map +0 -1
  54. package/models/routing/routes.d.ts +0 -133
@@ -1 +1 @@
1
- {"version":3,"file":"RouteLoader-qJA3UqTM.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,WAAW,gBAAGC,aAAa,CAAoB,EAAE;AACvD,MAAMC,cAAc,GAAGA,MAAM;EAClC,OAAOC,UAAU,CAACH,WAAW,CAAC;AAChC;;ACRO,MAAMI,iBAAiB,GAAGC,kBAAkB,IAAI;EACrD,IAAIC,UAAuB,GAAG,EAAE;AAChC,EAAA,KAAK,MAAM,CAACC,CAAC,EAAEC,KAAK,CAAC,IAAIH,kBAAkB,CAACI,OAAO,EAAE,EAAE;AACrD,IAAA,MAAMC,eAAe,GAAG;AAAE,MAAA,GAAGF,KAAK,CAACA;KAAO;AAC1C,IAAA,IAAID,CAAC,KAAKF,kBAAkB,CAACM,MAAM,GAAG,CAAC,EAAE;AACvCL,MAAAA,UAAU,GAAG;AACX,QAAA,GAAGA,UAAU;AACb,QAAA,GAAGI,eAAe;QAClBE,QAAQ,EAAE,GAAGN,UAAU,CAACM,QAAQ,IAAI,EAAE,GACpCJ,KAAK,CAACA,KAAK,CAACK,IAAI,GAAGL,KAAK,CAACA,KAAK,CAACK,IAAI,GAAG,EAAE,CAAA;OAE3C;AACDR,MAAAA,kBAAkB,CAACE,CAAC,CAAC,CAACC,KAAK,GAAGF,UAAU;AAC1C,IAAA,CAAC,MAAM;MACL,OAAOI,eAAe,CAACI,QAAQ;MAC/B,OAAOJ,eAAe,CAACK,KAAK;MAC5B,OAAOL,eAAe,CAACG,IAAI;MAC3B,OAAOH,eAAe,CAACM,SAAS;MAChC,OAAON,eAAe,CAACO,OAAO;AAC9BX,MAAAA,UAAU,GAAG;AACX,QAAA,GAAGA,UAAU;AACb,QAAA,GAAGI,eAAe;AAClBE,QAAAA,QAAQ,EAAE,CAAA,EAAGN,UAAU,CAACM,QAAQ,IAAI,EAAE,CAAA,EACpCJ,KAAK,CAACA,KAAK,CA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IAAI,EAAEG;AAAW,KAAA,eACvBE,KAAA,CAAAC,aAAA,CAAC8F,iBAAiB,EAAA;AAACjG,MAAAA,UAAU,EAAEA,UAAW;AAACQ,MAAAA,UAAU,EAAEA;AAAW,KAAE,CAC9D,CAAC;AAEb,EAAA;AAEA,EAAA,OAAO,IAAI;AACb,CAAC;AACD,MAAM4F,uBAAuB,GAAGC,cAAc,CAC5CC,6BAA6B,EAC7BC,gBAAgB,EAChBC,kBAAkB,EAClBC,gBAAgB,EAChBC,kBAAkB,EAClBC,yBAAyB,EACzBC,iBAAiB,EACjBC,oBAAoB,EACpBC,iBAAiB,EACjBC,qBAAqB,EACrBC,uBAAuB,EACvBC,gBAAgB,EAChB,CACErF,aAAa,EACbC,KAAK,EACLQ,OAAO,EACPE,UAAU,EACVD,SAAS,EACTP,UAAU,EACVD,WAAW,EACXH,SAAS,EACTiB,SAAS,EACT5C,UAAU,EACVQ,UAAU,EACVqC,UAAU,MACN;EACJjB,aAAa;EACbC,KAAK;EACLQ,OAAO;EACPE,UAAU;EACVD,SAAS;EACTP,UAAU;EACVD,WAAW;EACXH,SAAS;EACTiB,SAAS;EACT5C,UAAU;EACVQ,UAAU;AACVqC,EAAAA;AACF,CAAC,CACH,CAAC;AAED,MAAMqE,kBAAkB,GAAG;AACzBvE,EAAAA;AACF,CAAC;AAED,oBAAewE,OAAO,CACpBf,uBAAuB,EACvBc,kBACF,CAAC,CAACE,IAAI,CAAChF,WAAkB,CAAC,CAAC;;;;"}
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,WAAW,gBAAGC,aAAa,CAAoB,EAAE;AACvD,MAAMC,cAAc,GAAGA,MAAM;EAClC,OAAOC,UAAU,CAACH,WAAW,CAAC;AAChC;;ACRO,MAAMI,iBAAiB,GAAGC,kBAAkB,IAAI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BC,gBAAgB,EAChBC,kBAAkB,EAClBC,yBAAyB,EACzBC,iBAAiB,EACjBC,oBAAoB,EACpBC,iBAAiB,EACjBC,qBAAqB,EACrBC,uBAAuB,EACvBC,gBAAgB,EAChB,CACErF,aAAa,EACbC,KAAK,EACLQ,OAAO,EACPE,UAAU,EACVD,SAAS,EACTP,UAAU,EACVD,WAAW,EACXH,SAAS,EACTiB,SAAS,EACT5C,UAAU,EACVQ,UAAU,EACVqC,UAAU,MACN;EACJjB,aAAa;EACbC,KAAK;EACLQ,OAAO;EACPE,UAAU;EACVD,SAAS;EACTP,UAAU;EACVD,WAAW;EACXH,SAAS;EACTiB,SAAS;EACT5C,UAAU;EACVQ,UAAU;AACVqC,EAAAA;AACF,CAAC,CACH,CAAC;AAED,MAAMqE,kBAAkB,GAAG;AACzBvE,EAAAA;AACF,CAAC;AAED,oBAAewE,OAAO,CACpBf,uBAAuB,EACvBc,kBACF,CAAC,CAACE,IAAI,CAAChF,WAAkB,CAAC,CAAC;;;;"}
@@ -4,8 +4,8 @@ import { useDispatch } from 'react-redux';
4
4
  import { Client } from 'contensis-delivery-api';
5
5
  import { parse } from 'query-string';
6
6
  import { s as setSurrogateKeys } from './selectors-CBdCY0u3.js';
7
- import { r as reduxStore } from './store-uQZKjfA8.js';
8
- import { f as findLoginCookies, C as CookieHelper } from './CookieHelper.class-DzleKOOc.js';
7
+ import { r as reduxStore } from './store-v2gyr6u2.js';
8
+ import { f as findLoginCookies, C as CookieHelper } from './CookieHelper.class-FTURFpz3.js';
9
9
 
10
10
  class CacheNode {
11
11
  constructor(key, value) {
@@ -349,4 +349,4 @@ const useDeliveryApi = () => {
349
349
  };
350
350
 
351
351
  export { SSRContextProvider as S, cachedSearchWithCookies as a, deliveryApiWithCookies as b, cachedSearch as c, deliveryApi as d, useSSRContext as e, getClientConfig as g, useDeliveryApi as u };
352
- //# sourceMappingURL=SSRContext-C743Oeli.js.map
352
+ //# sourceMappingURL=SSRContext-CkiWIvde.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SSRContext-C743Oeli.js","sources":["../src/util/LruCache.js","../src/util/CachedDeliveryApi.ts","../src/util/ContensisDeliveryApi.ts","../src/util/SSRContext.tsx"],"sourcesContent":["class CacheNode {\n constructor(key, value) {\n this.key = key;\n this.value = value;\n this.next = null;\n this.prev = null;\n }\n}\n\nexport class LruCache {\n constructor(limit = 100) {\n this.map = {};\n this.head = null;\n this.tail = null;\n this.limit = limit || 100;\n this.size = 0;\n }\n\n get(key) {\n if (this.map[key]) {\n let value = this.map[key].value;\n let node = new CacheNode(key, value);\n this.remove(key);\n this.setHead(node);\n return value;\n }\n }\n\n set(key, value) {\n let node = new CacheNode(key, value);\n if (this.map[key]) {\n this.remove(key);\n } else {\n if (this.size >= this.limit) {\n delete this.map[this.tail.key];\n this.size--;\n this.tail = this.tail.prev;\n this.tail.next = null;\n }\n }\n this.setHead(node);\n }\n\n setHead(node) {\n node.next = this.head;\n node.prev = null;\n if (this.head) {\n this.head.prev = node;\n }\n this.head = node;\n if (!this.tail) {\n this.tail = node;\n }\n this.size++;\n this.map[node.key] = node;\n }\n\n remove(key) {\n let node = this.map[key];\n if (!node) return; // This is sometimes null and crashes the container without this check\n\n if (node.prev) {\n node.prev.next = node.next;\n } else {\n this.head = node.next;\n }\n if (node.next) {\n node.next.prev = node.prev;\n } else {\n this.tail = node.prev;\n }\n delete this.map[key];\n this.size--;\n }\n}\n","import { VersionStatus } from 'contensis-core-api';\nimport { Client, Query } from 'contensis-delivery-api';\nimport {\n INodeOperations,\n NodeGetRootOptions,\n} from 'contensis-delivery-api/lib/models';\n\nimport {\n DeliveryApi,\n SSRContext,\n getClientConfig,\n} from './ContensisDeliveryApi';\nimport { LruCache } from './LruCache';\nimport { CookieObject } from '~/user/util/CookieConstants';\n\n// CachedSearch does not cache results in SSR by design\nclass CachedSearch {\n cache = new LruCache();\n cookies?: CookieObject;\n ssr?: SSRContext;\n\n constructor(ssr?: SSRContext) {\n this.ssr = ssr;\n this.cookies = this.ssr?.cookies.raw;\n }\n\n getClient(...args: Parameters<DeliveryApi['getClient']>) {\n return new DeliveryApi(this.ssr).getClient(...args);\n }\n\n search(query: Query, linkDepth = 0, project?: string) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project}+${JSON.stringify(query)}+${linkDepth}`,\n () => client.entries.search(query, linkDepth)\n );\n }\n\n searchUsingPost(query: Query, linkDepth = 0, project = '') {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project}+${JSON.stringify(query)}+${linkDepth}`,\n () => (client.entries as any).searchUsingPost(query, linkDepth)\n );\n }\n\n get(\n id: string,\n linkDepth = 0,\n versionStatus: VersionStatus = 'published',\n project?: string,\n fields?: string[]\n ) {\n const client = Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n return this.request(id, () =>\n client.entries.get({ id, linkDepth, fields })\n );\n }\n\n getContentType(id: string, project?: string) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(`[CONTENT TYPE] ${id} ${project}`, () =>\n client.contentTypes.get(id)\n );\n }\n\n getRootNode(\n options: NodeGetRootOptions,\n versionStatus: VersionStatus = 'published',\n project?: string\n ) {\n const client = Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n return this.request(`${project} / ${JSON.stringify(options)}`, () =>\n client.nodes.getRoot(options)\n );\n }\n\n getNode(options: Parameters<INodeOperations['get']>[0], project?: string) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} ${\n options && typeof options !== 'string'\n ? 'path' in options\n ? options.path\n : options.id\n : options\n } ${JSON.stringify(options)}`,\n () => client.nodes.get(options)\n );\n }\n\n getAncestors(\n options: Parameters<INodeOperations['getAncestors']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} [A] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getAncestors(options)\n );\n }\n\n getChildren(\n options: Parameters<INodeOperations['getChildren']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} [C] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getChildren(options)\n );\n }\n\n getSiblings(\n options: Parameters<INodeOperations['getSiblings']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} [S] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getSiblings(options)\n );\n }\n\n request<T extends () => Promise<any>>(key: string, execute: T) {\n // do not cache results in SSR\n if (!this.cache.get(key) || typeof window == 'undefined') {\n const promise = execute();\n this.cache.set(key, promise);\n promise.catch(() => {\n this.cache.remove(key);\n });\n }\n return this.cache.get(key) as ReturnType<T>;\n }\n}\n\nexport const cachedSearch = new CachedSearch();\nexport const cachedSearchWithCookies = (ssr?: SSRContext) =>\n new CachedSearch(ssr);\n","import { VersionStatus } from 'contensis-core-api';\nimport { Client, Query } from 'contensis-delivery-api';\nimport { Config } from 'contensis-delivery-api/lib/models';\nimport { parse } from 'query-string';\nimport { setSurrogateKeys } from '~/routing/redux/actions';\nimport { reduxStore } from '~/redux/store/store';\n\nimport { CookieObject, findLoginCookies } from '~/user/util/CookieConstants';\nimport { Request } from 'express';\nimport { IncomingHttpHeaders } from 'http';\nimport { SSRContext as SSRContextType } from '~/models';\n\nexport type SSRContext = Omit<SSRContextType, 'api'>;\n\nconst mapCookieHeader = (cookies: CookieObject | string) =>\n typeof cookies === 'object'\n ? Object.entries(cookies)\n .map(([name, value]) => `${name}=${value}`)\n .join('; ')\n : cookies;\n\nconst getSsrReferer = ({ request }: SSRContext) => {\n if (request) {\n try {\n const url = new URL(\n request.url,\n `${request.protocol || `http`}://${request.headers.host}`\n );\n return url.href;\n } catch (ex) {\n console.error(\n `getSsrReferer cannot parse url ${request.url} and host ${request.headers.host}`\n );\n\n return request.url;\n }\n }\n\n // if (typeof window === 'undefined') {\n // const state = reduxStore.getState();\n // const referer = `${selectCurrentHostname(state)}${selectCurrentPath(\n // state\n // )}${selectCurrentSearch(state)}`;\n\n // return referer;\n // }\n return '';\n};\n\n/**\n * Store the surrogate-key header contents in redux state to output in SSR response\n */\nconst storeSurrogateKeys = (ssr?: SSRContext) => (response: any) => {\n let keys = '';\n if (response.status === 200) {\n keys = response.headers.get\n ? response.headers.get('surrogate-key')\n : response.headers.map['surrogate-key'];\n if (!keys) console.info(`[storeSurrogateKeys] No keys in ${response.url}`);\n }\n // Using imported reduxStore in SSR is unreliable during high\n // concurrent loads and exists here as a best effort fallback\n // in case the SSRContext is not provided\n const put = ssr?.dispatch || reduxStore?.dispatch;\n put?.(setSurrogateKeys(keys, response.url, response.status));\n};\n\n/**\n * Create a new Config object to create a DeliveryAPI Client\n */\nconst deliveryApiConfig = (ssr?: SSRContext) => {\n const config: Config = {\n ...DELIVERY_API_CONFIG /* global DELIVERY_API_CONFIG */,\n };\n\n // Add SSR headers and handlers\n if (typeof window === 'undefined') {\n config.defaultHeaders = {\n 'x-require-surrogate-key': 'true', // request surrogate-key response header\n 'x-crb-ssr': 'true', // add this for support tracing\n };\n if (ssr) config.defaultHeaders.referer = getSsrReferer(ssr); // add this for support tracing\n\n config.responseHandler = { [200]: storeSurrogateKeys(ssr) }; // for handling page cache invalidation\n }\n\n if (\n typeof window !== 'undefined' &&\n PROXY_DELIVERY_API /* global PROXY_DELIVERY_API */\n ) {\n // ensure a relative url is used to bypass the need for CORS (separate OPTIONS calls)\n config.rootUrl = '';\n config.responseHandler = { [404]: () => null };\n }\n return config;\n};\n\nexport const getClientConfig = (project?: string, ssr?: SSRContext) => {\n const config = deliveryApiConfig(ssr);\n\n if (project) {\n config.projectId = project;\n }\n\n if (ssr?.cookies) {\n const cookieHeader = mapCookieHeader(findLoginCookies(ssr.cookies));\n if (cookieHeader) {\n config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {\n Cookie: cookieHeader,\n });\n }\n }\n\n return config;\n};\n\n// export * from 'contensis-delivery-api';\n\ndeclare let window: Window &\n typeof globalThis & {\n versionStatus?: VersionStatus;\n };\n\nexport class DeliveryApi {\n cookies?: CookieObject;\n ssr?: SSRContext;\n\n constructor(ssr?: SSRContext) {\n this.ssr = ssr;\n this.cookies = ssr?.cookies.raw;\n }\n\n getClientSideVersionStatus = () => {\n if (typeof window !== 'undefined') {\n // Allow overriding versionStatus with the querystring\n const { versionStatus } = parse(window.location.search);\n if (versionStatus) return versionStatus;\n // Client-side we will have a global variable set if rendered by SSR in production\n if (typeof window.versionStatus !== 'undefined')\n return window.versionStatus;\n // For localhost development we can only work out versionStatus from the current hostname\n const currentHostname = window.location.hostname;\n return this.getVersionStatusFromHostname(currentHostname);\n }\n return null;\n };\n\n getServerSideVersionStatus = (request: Request) =>\n request.query.versionStatus ||\n deliveryApi.getVersionStatusFromHeaders(request.headers) ||\n deliveryApi.getVersionStatusFromHostname(request.hostname);\n\n getVersionStatusFromHeaders = (headers: IncomingHttpHeaders) => {\n const versionStatusHeader = headers['x-entry-versionstatus'];\n if (typeof versionStatusHeader !== 'undefined') return versionStatusHeader;\n return null;\n };\n\n getVersionStatusFromHostname = (currentHostname: string) => {\n if (currentHostname.indexOf('localhost') > -1) return 'latest';\n\n if (currentHostname.endsWith('contensis.cloud')) {\n if (currentHostname.indexOf('preview.') > -1) {\n return 'latest';\n } else {\n return 'published';\n }\n }\n\n if (currentHostname.endsWith('cloud.contensis.com')) {\n if (currentHostname.indexOf('preview-') > -1) {\n return 'latest';\n } else {\n return 'published';\n }\n }\n\n return 'published';\n };\n\n search = (query: Query, linkDepth = 0, project?: string) => {\n const client = Client.create(getClientConfig(project, this.ssr));\n return client.entries.search(\n query,\n typeof linkDepth !== 'undefined' ? linkDepth : 1\n );\n };\n\n getClient = (versionStatus: VersionStatus = 'published', project?: string) =>\n Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n\n getEntry = (\n id: string,\n linkDepth = 0,\n versionStatus: VersionStatus = 'published',\n project?: string\n ) => {\n const client = Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n return client.entries.get({ id, linkDepth });\n };\n}\n\nexport const deliveryApi = new DeliveryApi();\n\nexport const deliveryApiWithCookies = (ssr?: SSRContext) =>\n new DeliveryApi(ssr);\n\nexport * from './CachedDeliveryApi';\n","import { Request, Response } from 'express';\nimport React, {\n PropsWithChildren,\n createContext,\n useContext,\n useState,\n} from 'react';\nimport { useCookies } from 'react-cookie';\nimport { useDispatch } from 'react-redux';\nimport { SSRContext as SSRContextType } from '~/models';\nimport { cachedSearchWithCookies } from '~/util/CachedDeliveryApi';\nimport { CookieHelper } from '~/user/util/CookieHelper.class';\n\nconst SSRContext = createContext<SSRContextType | null>(null);\n\n/** SSRContextProvider allows us to hold and access request-scoped references\n * throughout the component tree\n *\n * adding this in client side allows consumers to write universal code and use\n * the same helpers and refs as in SSR */\nexport const SSRContextProvider = ({\n children,\n request,\n response,\n}: PropsWithChildren<{ request?: Request; response?: Response }>) => {\n // In SSR pass references to things in backing sagas\n // we cannot access in a global scope\n const dispatch = useDispatch();\n const cookies = new CookieHelper(...useCookies());\n const api = cachedSearchWithCookies({ cookies, dispatch, request, response });\n\n const [context] = useState<SSRContextType>({\n api,\n cookies,\n dispatch,\n request,\n response,\n });\n\n return (\n <SSRContext.Provider value={{ ...context }}>{children}</SSRContext.Provider>\n );\n};\n\nexport const useSSRContext = () => useContext(SSRContext) as SSRContextType;\n\nexport const useDeliveryApi = () => {\n const { api } = useSSRContext();\n return api;\n};\n"],"names":["CacheNode","constructor","key","value","next","prev","LruCache","limit","map","head","tail","size","get","node","remove","setHead","set","CachedSearch","ssr","_this$ssr","cache","cookies","raw","getClient","args","DeliveryApi","search","query","linkDepth","project","client","Client","create","getClientConfig","request","JSON","stringify","entries","searchUsingPost","id","versionStatus","fields","getContentType","contentTypes","getRootNode","options","nodes","getRoot","getNode","path","getAncestors","getChildren","getSiblings","execute","window","promise","catch","cachedSearch","cachedSearchWithCookies","mapCookieHeader","Object","name","join","getSsrReferer","url","URL","protocol","headers","host","href","ex","console","error","storeSurrogateKeys","response","keys","status","info","put","dispatch","reduxStore","setSurrogateKeys","deliveryApiConfig","config","DELIVERY_API_CONFIG","defaultHeaders","referer","responseHandler","PROXY_DELIVERY_API","rootUrl","projectId","cookieHeader","findLoginCookies","assign","Cookie","getClientSideVersionStatus","parse","location","currentHostname","hostname","getVersionStatusFromHostname","getServerSideVersionStatus","deliveryApi","getVersionStatusFromHeaders","versionStatusHeader","indexOf","endsWith","getEntry","deliveryApiWithCookies","SSRContext","createContext","SSRContextProvider","children","useDispatch","CookieHelper","useCookies","api","context","useState","React","createElement","Provider","useSSRContext","useContext","useDeliveryApi"],"mappings":";;;;;;;;;AAAA,MAAMA,SAAS,CAAC;AACdC,EAAAA,WAAWA,CAACC,GAAG,EAAEC,KAAK,EAAE;IACtB,IAAI,CAACD,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB,IAAI,CAACC,IAAI,GAAG,IAAI;AAClB,EAAA;AACF;AAEO,MAAMC,QAAQ,CAAC;AACpBL,EAAAA,WAAWA,CAACM,KAAK,GAAG,GAAG,EAAE;AACvB,IAAA,IAAI,CAACC,GAAG,GAAG,EAAE;IACb,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB,IAAI,CAACC,IAAI,GAAG,IAAI;AAChB,IAAA,IAAI,CAACH,KAAK,GAAGA,KAAK,IAAI,GAAG;IACzB,IAAI,CAACI,IAAI,GAAG,CAAC;AACf,EAAA;EAEAC,GAAGA,CAACV,GAAG,EAAE;AACP,IAAA,IAAI,IAAI,CAACM,GAAG,CAACN,GAAG,CAAC,EAAE;MACjB,IAAIC,KAAK,GAAG,IAAI,CAACK,GAAG,CAACN,GAAG,CAAC,CAACC,KAAK;MAC/B,IAAIU,IAAI,GAAG,IAAIb,SAAS,CAACE,GAAG,EAAEC,KA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H/F,OAAO;IACP0D,QAAQ;IACR7C,OAAO;AACPwC,IAAAA;AACF,GAAC,CAAC;AAEF,EAAA,oBACE6C,KAAA,CAAAC,aAAA,CAACX,UAAU,CAACY,QAAQ,EAAA;AAACtH,IAAAA,KAAK,EAAE;MAAE,GAAGkH;AAAQ;AAAE,GAAA,EAAEL,QAA8B,CAAC;AAEhF;AAEO,MAAMU,aAAa,GAAGA,MAAMC,UAAU,CAACd,UAAU;AAEjD,MAAMe,cAAc,GAAGA,MAAM;EAClC,MAAM;AAAER,IAAAA;GAAK,GAAGM,aAAa,EAAE;AAC/B,EAAA,OAAON,GAAG;AACZ;;;;"}
1
+ {"version":3,"file":"SSRContext-CkiWIvde.js","sources":["../src/util/LruCache.js","../src/util/CachedDeliveryApi.ts","../src/util/ContensisDeliveryApi.ts","../src/util/SSRContext.tsx"],"sourcesContent":["class CacheNode {\n constructor(key, value) {\n this.key = key;\n this.value = value;\n this.next = null;\n this.prev = null;\n }\n}\n\nexport class LruCache {\n constructor(limit = 100) {\n this.map = {};\n this.head = null;\n this.tail = null;\n this.limit = limit || 100;\n this.size = 0;\n }\n\n get(key) {\n if (this.map[key]) {\n let value = this.map[key].value;\n let node = new CacheNode(key, value);\n this.remove(key);\n this.setHead(node);\n return value;\n }\n }\n\n set(key, value) {\n let node = new CacheNode(key, value);\n if (this.map[key]) {\n this.remove(key);\n } else {\n if (this.size >= this.limit) {\n delete this.map[this.tail.key];\n this.size--;\n this.tail = this.tail.prev;\n this.tail.next = null;\n }\n }\n this.setHead(node);\n }\n\n setHead(node) {\n node.next = this.head;\n node.prev = null;\n if (this.head) {\n this.head.prev = node;\n }\n this.head = node;\n if (!this.tail) {\n this.tail = node;\n }\n this.size++;\n this.map[node.key] = node;\n }\n\n remove(key) {\n let node = this.map[key];\n if (!node) return; // This is sometimes null and crashes the container without this check\n\n if (node.prev) {\n node.prev.next = node.next;\n } else {\n this.head = node.next;\n }\n if (node.next) {\n node.next.prev = node.prev;\n } else {\n this.tail = node.prev;\n }\n delete this.map[key];\n this.size--;\n }\n}\n","import { VersionStatus } from 'contensis-core-api';\nimport { Client, Query } from 'contensis-delivery-api';\nimport {\n INodeOperations,\n NodeGetRootOptions,\n} from 'contensis-delivery-api/lib/models';\n\nimport {\n DeliveryApi,\n SSRContext,\n getClientConfig,\n} from './ContensisDeliveryApi';\nimport { LruCache } from './LruCache';\nimport { CookieObject } from '~/user/util/CookieConstants';\n\n// CachedSearch does not cache results in SSR by design\nclass CachedSearch {\n cache = new LruCache();\n cookies?: CookieObject;\n ssr?: SSRContext;\n\n constructor(ssr?: SSRContext) {\n this.ssr = ssr;\n this.cookies = this.ssr?.cookies.raw;\n }\n\n getClient(...args: Parameters<DeliveryApi['getClient']>) {\n return new DeliveryApi(this.ssr).getClient(...args);\n }\n\n search(query: Query, linkDepth = 0, project?: string) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project}+${JSON.stringify(query)}+${linkDepth}`,\n () => client.entries.search(query, linkDepth)\n );\n }\n\n searchUsingPost(query: Query, linkDepth = 0, project = '') {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project}+${JSON.stringify(query)}+${linkDepth}`,\n () => (client.entries as any).searchUsingPost(query, linkDepth)\n );\n }\n\n get(\n id: string,\n linkDepth = 0,\n versionStatus: VersionStatus = 'published',\n project?: string,\n fields?: string[]\n ) {\n const client = Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n return this.request(id, () =>\n client.entries.get({ id, linkDepth, fields })\n );\n }\n\n getContentType(id: string, project?: string) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(`[CONTENT TYPE] ${id} ${project}`, () =>\n client.contentTypes.get(id)\n );\n }\n\n getRootNode(\n options: NodeGetRootOptions,\n versionStatus: VersionStatus = 'published',\n project?: string\n ) {\n const client = Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n return this.request(`${project} / ${JSON.stringify(options)}`, () =>\n client.nodes.getRoot(options)\n );\n }\n\n getNode(options: Parameters<INodeOperations['get']>[0], project?: string) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} ${\n options && typeof options !== 'string'\n ? 'path' in options\n ? options.path\n : options.id\n : options\n } ${JSON.stringify(options)}`,\n () => client.nodes.get(options)\n );\n }\n\n getAncestors(\n options: Parameters<INodeOperations['getAncestors']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} [A] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getAncestors(options)\n );\n }\n\n getChildren(\n options: Parameters<INodeOperations['getChildren']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} [C] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getChildren(options)\n );\n }\n\n getSiblings(\n options: Parameters<INodeOperations['getSiblings']>[0],\n project?: string\n ) {\n const client = Client.create(getClientConfig(project, this.ssr));\n return this.request(\n `${project} [S] ${\n (options && typeof options !== 'string' && options.id) || options\n } ${JSON.stringify(options)}`,\n () => client.nodes.getSiblings(options)\n );\n }\n\n request<T extends () => Promise<any>>(key: string, execute: T) {\n // do not cache results in SSR\n if (!this.cache.get(key) || typeof window == 'undefined') {\n const promise = execute();\n this.cache.set(key, promise);\n promise.catch(() => {\n this.cache.remove(key);\n });\n }\n return this.cache.get(key) as ReturnType<T>;\n }\n}\n\nexport const cachedSearch = new CachedSearch();\nexport const cachedSearchWithCookies = (ssr?: SSRContext) =>\n new CachedSearch(ssr);\n","import { VersionStatus } from 'contensis-core-api';\nimport { Client, Query } from 'contensis-delivery-api';\nimport { Config } from 'contensis-delivery-api/lib/models';\nimport { parse } from 'query-string';\nimport { setSurrogateKeys } from '~/routing/redux/actions';\nimport { reduxStore } from '~/redux/store/store';\n\nimport { CookieObject, findLoginCookies } from '~/user/util/CookieConstants';\nimport { Request } from 'express';\nimport { IncomingHttpHeaders } from 'http';\nimport { SSRContext as SSRContextType } from '~/models';\n\nexport type SSRContext = Omit<SSRContextType, 'api'>;\n\nconst mapCookieHeader = (cookies: CookieObject | string) =>\n typeof cookies === 'object'\n ? Object.entries(cookies)\n .map(([name, value]) => `${name}=${value}`)\n .join('; ')\n : cookies;\n\nconst getSsrReferer = ({ request }: SSRContext) => {\n if (request) {\n try {\n const url = new URL(\n request.url,\n `${request.protocol || `http`}://${request.headers.host}`\n );\n return url.href;\n } catch (ex) {\n console.error(\n `getSsrReferer cannot parse url ${request.url} and host ${request.headers.host}`\n );\n\n return request.url;\n }\n }\n\n // if (typeof window === 'undefined') {\n // const state = reduxStore.getState();\n // const referer = `${selectCurrentHostname(state)}${selectCurrentPath(\n // state\n // )}${selectCurrentSearch(state)}`;\n\n // return referer;\n // }\n return '';\n};\n\n/**\n * Store the surrogate-key header contents in redux state to output in SSR response\n */\nconst storeSurrogateKeys = (ssr?: SSRContext) => (response: any) => {\n let keys = '';\n if (response.status === 200) {\n keys = response.headers.get\n ? response.headers.get('surrogate-key')\n : response.headers.map['surrogate-key'];\n if (!keys) console.info(`[storeSurrogateKeys] No keys in ${response.url}`);\n }\n // Using imported reduxStore in SSR is unreliable during high\n // concurrent loads and exists here as a best effort fallback\n // in case the SSRContext is not provided\n const put = ssr?.dispatch || reduxStore?.dispatch;\n put?.(setSurrogateKeys(keys, response.url, response.status));\n};\n\n/**\n * Create a new Config object to create a DeliveryAPI Client\n */\nconst deliveryApiConfig = (ssr?: SSRContext) => {\n const config: Config = {\n ...DELIVERY_API_CONFIG /* global DELIVERY_API_CONFIG */,\n };\n\n // Add SSR headers and handlers\n if (typeof window === 'undefined') {\n config.defaultHeaders = {\n 'x-require-surrogate-key': 'true', // request surrogate-key response header\n 'x-crb-ssr': 'true', // add this for support tracing\n };\n if (ssr) config.defaultHeaders.referer = getSsrReferer(ssr); // add this for support tracing\n\n config.responseHandler = { [200]: storeSurrogateKeys(ssr) }; // for handling page cache invalidation\n }\n\n if (\n typeof window !== 'undefined' &&\n PROXY_DELIVERY_API /* global PROXY_DELIVERY_API */\n ) {\n // ensure a relative url is used to bypass the need for CORS (separate OPTIONS calls)\n config.rootUrl = '';\n config.responseHandler = { [404]: () => null };\n }\n return config;\n};\n\nexport const getClientConfig = (project?: string, ssr?: SSRContext) => {\n const config = deliveryApiConfig(ssr);\n\n if (project) {\n config.projectId = project;\n }\n\n if (ssr?.cookies) {\n const cookieHeader = mapCookieHeader(findLoginCookies(ssr.cookies));\n if (cookieHeader) {\n config.defaultHeaders = Object.assign(config.defaultHeaders || {}, {\n Cookie: cookieHeader,\n });\n }\n }\n\n return config;\n};\n\n// export * from 'contensis-delivery-api';\n\ndeclare let window: Window &\n typeof globalThis & {\n versionStatus?: VersionStatus;\n };\n\nexport class DeliveryApi {\n cookies?: CookieObject;\n ssr?: SSRContext;\n\n constructor(ssr?: SSRContext) {\n this.ssr = ssr;\n this.cookies = ssr?.cookies.raw;\n }\n\n getClientSideVersionStatus = () => {\n if (typeof window !== 'undefined') {\n // Allow overriding versionStatus with the querystring\n const { versionStatus } = parse(window.location.search);\n if (versionStatus) return versionStatus;\n // Client-side we will have a global variable set if rendered by SSR in production\n if (typeof window.versionStatus !== 'undefined')\n return window.versionStatus;\n // For localhost development we can only work out versionStatus from the current hostname\n const currentHostname = window.location.hostname;\n return this.getVersionStatusFromHostname(currentHostname);\n }\n return null;\n };\n\n getServerSideVersionStatus = (request: Request) =>\n request.query.versionStatus ||\n deliveryApi.getVersionStatusFromHeaders(request.headers) ||\n deliveryApi.getVersionStatusFromHostname(request.hostname);\n\n getVersionStatusFromHeaders = (headers: IncomingHttpHeaders) => {\n const versionStatusHeader = headers['x-entry-versionstatus'];\n if (typeof versionStatusHeader !== 'undefined') return versionStatusHeader;\n return null;\n };\n\n getVersionStatusFromHostname = (currentHostname: string) => {\n if (currentHostname.indexOf('localhost') > -1) return 'latest';\n\n if (currentHostname.endsWith('contensis.cloud')) {\n if (currentHostname.indexOf('preview.') > -1) {\n return 'latest';\n } else {\n return 'published';\n }\n }\n\n if (currentHostname.endsWith('cloud.contensis.com')) {\n if (currentHostname.indexOf('preview-') > -1) {\n return 'latest';\n } else {\n return 'published';\n }\n }\n\n return 'published';\n };\n\n search = (query: Query, linkDepth = 0, project?: string) => {\n const client = Client.create(getClientConfig(project, this.ssr));\n return client.entries.search(\n query,\n typeof linkDepth !== 'undefined' ? linkDepth : 1\n );\n };\n\n getClient = (versionStatus: VersionStatus = 'published', project?: string) =>\n Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n\n getEntry = (\n id: string,\n linkDepth = 0,\n versionStatus: VersionStatus = 'published',\n project?: string\n ) => {\n const client = Client.create({\n ...getClientConfig(project, this.ssr),\n versionStatus,\n });\n return client.entries.get({ id, linkDepth });\n };\n}\n\nexport const deliveryApi = new DeliveryApi();\n\nexport const deliveryApiWithCookies = (ssr?: SSRContext) =>\n new DeliveryApi(ssr);\n\nexport * from './CachedDeliveryApi';\n","import { Request, Response } from 'express';\nimport React, {\n PropsWithChildren,\n createContext,\n useContext,\n useState,\n} from 'react';\nimport { useCookies } from 'react-cookie';\nimport { useDispatch } from 'react-redux';\nimport { SSRContext as SSRContextType } from '~/models';\nimport { cachedSearchWithCookies } from '~/util/CachedDeliveryApi';\nimport { CookieHelper } from '~/user/util/CookieHelper.class';\n\nconst SSRContext = createContext<SSRContextType | null>(null);\n\n/** SSRContextProvider allows us to hold and access request-scoped references\n * throughout the component tree\n *\n * adding this in client side allows consumers to write universal code and use\n * the same helpers and refs as in SSR */\nexport const SSRContextProvider = ({\n children,\n request,\n response,\n}: PropsWithChildren<{ request?: Request; response?: Response }>) => {\n // In SSR pass references to things in backing sagas\n // we cannot access in a global scope\n const dispatch = useDispatch();\n const cookies = new CookieHelper(...useCookies());\n const api = cachedSearchWithCookies({ cookies, dispatch, request, response });\n\n const [context] = useState<SSRContextType>({\n api,\n cookies,\n dispatch,\n request,\n response,\n });\n\n return (\n <SSRContext.Provider value={{ ...context }}>{children}</SSRContext.Provider>\n );\n};\n\nexport const useSSRContext = () => useContext(SSRContext) as SSRContextType;\n\nexport const useDeliveryApi = () => {\n const { api } = useSSRContext();\n return api;\n};\n"],"names":["CacheNode","constructor","key","value","next","prev","LruCache","limit","map","head","tail","size","get","node","remove","setHead","set","CachedSearch","ssr","_this$ssr","cache","cookies","raw","getClient","args","DeliveryApi","search","query","linkDepth","project","client","Client","create","getClientConfig","request","JSON","stringify","entries","searchUsingPost","id","versionStatus","fields","getContentType","contentTypes","getRootNode","options","nodes","getRoot","getNode","path","getAncestors","getChildren","getSiblings","execute","window","promise","catch","cachedSearch","cachedSearchWithCookies","mapCookieHeader","Object","name","join","getSsrReferer","url","URL","protocol","headers","host","href","ex","console","error","storeSurrogateKeys","response","keys","status","info","put","dispatch","reduxStore","setSurrogateKeys","deliveryApiConfig","config","DELIVERY_API_CONFIG","defaultHeaders","referer","responseHandler","PROXY_DELIVERY_API","rootUrl","projectId","cookieHeader","findLoginCookies","assign","Cookie","getClientSideVersionStatus","parse","location","currentHostname","hostname","getVersionStatusFromHostname","getServerSideVersionStatus","deliveryApi","getVersionStatusFromHeaders","versionStatusHeader","indexOf","endsWith","getEntry","deliveryApiWithCookies","SSRContext","createContext","SSRContextProvider","children","useDispatch","CookieHelper","useCookies","api","context","useState","React","createElement","Provider","useSSRContext","useContext","useDeliveryApi"],"mappings":";;;;;;;;;AAAA,MAAMA,SAAS,CAAC;AACdC,EAAAA,WAAWA,CAACC,GAAG,EAAEC,KAAK,EAAE;IACtB,IAAI,CAACD,GAAG,GAAGA,GAAG;IACd,IAAI,CAACC,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,IAAI,GAAG,IAAI;IAChB,IAAI,CAACC,IAAI,GAAG,IAAI;AAClB,EAAA;AACF;AAEO,MAAMC,QAAQ,CAAC;AACpBL,EAAAA,WAAWA,CAACM,KAAK,GAAG,GAAG,EAAE;AACvB,IAAA,IAAI,CAACC,GAAG,GAAG,EAAE;IACb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A,CAAC;EACjCC,QAAQ;EACR9E,OAAO;AACPwC,EAAAA;AAC6D,CAAC,KAAK;AACnE;AACA;AACA,EAAA,MAAMK,QAAQ,GAAGkC,WAAW,EAAE;EAC9B,MAAM5F,OAAO,GAAG,IAAI6F,YAAY,CAAC,GAAGC,UAAU,EAAE,CAAC;EACjD,MAAMC,GAAG,GAAG1D,uBAAuB,CAAC;IAAErC,OAAO;IAAE0D,QAAQ;IAAE7C,OAAO;AAAEwC,IAAAA;AAAS,GAAC,CAAC;AAE7E,EAAA,MAAM,CAAC2C,OAAO,CAAC,GAAGC,QAAQ,CAAiB;IACzCF,GAAG;IACH/F,OAAO;IACP0D,QAAQ;IACR7C,OAAO;AACPwC,IAAAA;AACF,GAAC,CAAC;AAEF,EAAA,oBACE6C,KAAA,CAAAC,aAAA,CAACX,UAAU,CAACY,QAAQ,EAAA;AAACtH,IAAAA,KAAK,EAAE;MAAE,GAAGkH;AAAQ;AAAE,GAAA,EAAEL,QAA8B,CAAC;AAEhF;AAEO,MAAMU,aAAa,GAAGA,MAAMC,UAAU,CAACd,UAAU;AAEjD,MAAMe,cAAc,GAAGA,MAAM;EAClC,MAAM;AAAER,IAAAA;GAAK,GAAGM,aAAa,EAAE;AAC/B,EAAA,OAAON,GAAG;AACZ;;;;"}
package/esm/client.js CHANGED
@@ -7,27 +7,27 @@ import { loadableReady } from '@loadable/component';
7
7
  import { parse } from 'query-string';
8
8
  import { CookiesProvider } from 'react-cookie';
9
9
  import { s as selectVersionStatus } from './version-D773TD9j.js';
10
- import { s as setVersionStatus } from './version-B9nPx4IF.js';
11
- import { b as browserHistory, r as rootSaga, p as pickProject } from './App-CfIZbvU9.js';
12
- export { A as ReactApp } from './App-CfIZbvU9.js';
13
- import { c as createStore } from './store-uQZKjfA8.js';
10
+ import { s as setVersionStatus } from './version-DvjTUbcA.js';
11
+ import { b as browserHistory, r as rootSaga, p as pickProject } from './App-CIlf4cl4.js';
12
+ export { A as ReactApp } from './App-CIlf4cl4.js';
13
+ import { c as createStore } from './store-v2gyr6u2.js';
14
14
  import { d as setCurrentProject } from './selectors-CBdCY0u3.js';
15
- import { d as deliveryApi, S as SSRContextProvider } from './SSRContext-C743Oeli.js';
15
+ import { d as deliveryApi, S as SSRContextProvider } from './SSRContext-CkiWIvde.js';
16
16
  import '@redux-saga/core/effects';
17
17
  import 'history';
18
18
  import 'loglevel';
19
19
  import 'await-to-js';
20
- import './ChangePassword.container-Q7bElOVz.js';
20
+ import './ChangePassword.container-C0tFq0Tf.js';
21
21
  import './ToJs-CpPNdcXS.js';
22
22
  import 'jsonpath-mapper';
23
- import './CookieHelper.class-DzleKOOc.js';
23
+ import './CookieHelper.class-FTURFpz3.js';
24
24
  import 'contensis-delivery-api';
25
- import './RouteLoader-qJA3UqTM.js';
25
+ import './RouteLoader-D7HmVx5l.js';
26
26
  import 'reselect';
27
27
  import 'redux';
28
28
  import 'redux-thunk';
29
29
  import 'redux-saga';
30
- import 'redux-injectors';
30
+ import 'redux-injectors-19';
31
31
  import 'immer';
32
32
 
33
33
  var client = {};
@@ -1,4 +1,4 @@
1
- import { c as cachedSearch, d as deliveryApi, S as SSRContextProvider } from './SSRContext-C743Oeli.js';
1
+ import { c as cachedSearch, d as deliveryApi, S as SSRContextProvider } from './SSRContext-CkiWIvde.js';
2
2
  import { Query as Query$1 } from 'contensis-delivery-api';
3
3
  import React from 'react';
4
4
  import { Provider } from 'react-redux';
@@ -29,13 +29,13 @@ import { ChunkExtractor, ChunkExtractorManager } from '@loadable/server';
29
29
  import { noop, identity } from 'lodash';
30
30
  import { buildCleaner } from 'lodash-clean';
31
31
  import { CookiesProvider } from 'react-cookie';
32
- import { a as Cookies } from './CookieHelper.class-DzleKOOc.js';
32
+ import { a as Cookies } from './CookieHelper.class-FTURFpz3.js';
33
33
  import cookiesMiddleware from 'universal-cookie-express';
34
- import { c as createStore } from './store-uQZKjfA8.js';
35
- import { h as history, p as pickProject, r as rootSaga } from './App-CfIZbvU9.js';
36
- export { A as ReactApp } from './App-CfIZbvU9.js';
37
- import { s as setVersionStatus, d as setVersion } from './version-B9nPx4IF.js';
38
- import { m as mergeStaticRoutes, H as HttpContext } from './RouteLoader-qJA3UqTM.js';
34
+ import { c as createStore } from './store-v2gyr6u2.js';
35
+ import { h as history, p as pickProject, r as rootSaga } from './App-CIlf4cl4.js';
36
+ export { A as ReactApp } from './App-CIlf4cl4.js';
37
+ import { s as setVersionStatus, d as setVersion } from './version-DvjTUbcA.js';
38
+ import { m as mergeStaticRoutes, H as HttpContext } from './RouteLoader-D7HmVx5l.js';
39
39
  import { a3 as selectSurrogateKeys, a4 as selectSsrApiCalls, j as selectRouteEntry, f as selectCurrentProject, g as getImmutableOrJS, d as setCurrentProject, K as selectCurrentSearch } from './selectors-CBdCY0u3.js';
40
40
  import chalk from 'chalk';
41
41
  import 'loglevel';
@@ -44,11 +44,11 @@ import './_commonjsHelpers-BFTU3MAI.js';
44
44
  import 'redux';
45
45
  import 'redux-thunk';
46
46
  import 'redux-saga';
47
- import 'redux-injectors';
47
+ import 'redux-injectors-19';
48
48
  import 'history';
49
49
  import 'await-to-js';
50
50
  import './version-D773TD9j.js';
51
- import './ChangePassword.container-Q7bElOVz.js';
51
+ import './ChangePassword.container-C0tFq0Tf.js';
52
52
  import './ToJs-CpPNdcXS.js';
53
53
 
54
54
  /**
package/esm/redux.js CHANGED
@@ -1,14 +1,14 @@
1
- import { n as navigation$2, v as version$1, G as GET_NODE_TREE } from './store-uQZKjfA8.js';
2
- export { r as store } from './store-uQZKjfA8.js';
1
+ import { n as navigation$2, v as version$1, G as GET_NODE_TREE } from './store-v2gyr6u2.js';
2
+ export { r as store } from './store-v2gyr6u2.js';
3
3
  import { r as routing$1, c as action, a as routing$2, b as routing$3 } from './selectors-CBdCY0u3.js';
4
4
  export { g as getIn, e as getJS } from './selectors-CBdCY0u3.js';
5
- import { v as version$2, n as navigation$3 } from './version-B9nPx4IF.js';
6
- export { c as convertSagaArray, a as injectReducer, i as injectRedux, b as injectSaga, u as useInjectRedux } from './version-B9nPx4IF.js';
5
+ import { v as version$2, n as navigation$3 } from './version-DvjTUbcA.js';
6
+ export { c as convertSagaArray, a as injectReducer, i as injectRedux, b as injectSaga, u as useInjectRedux } from './version-DvjTUbcA.js';
7
7
  import { v as version$3 } from './version-D773TD9j.js';
8
8
  import 'redux';
9
9
  import 'redux-thunk';
10
10
  import 'redux-saga';
11
- import 'redux-injectors';
11
+ import 'redux-injectors-19';
12
12
  import 'immer';
13
13
  import 'jsonpath-mapper';
14
14
  import 'query-string';
package/esm/routing.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { a as actions, b as selectors, r as types } from './selectors-CBdCY0u3.js';
2
- export { R as Redirect, a as RouteLoader, S as Status, u as useHttpContext } from './RouteLoader-qJA3UqTM.js';
2
+ export { R as Redirect, a as RouteLoader, S as Status, u as useHttpContext } from './RouteLoader-D7HmVx5l.js';
3
3
  import 'immer';
4
4
  import 'jsonpath-mapper';
5
5
  import 'query-string';
@@ -8,13 +8,13 @@ import 'react-redux';
8
8
  import 'react-router-dom';
9
9
  import 'reselect';
10
10
  import './ToJs-CpPNdcXS.js';
11
- import './SSRContext-C743Oeli.js';
11
+ import './SSRContext-CkiWIvde.js';
12
12
  import 'react-cookie';
13
13
  import 'contensis-delivery-api';
14
- import './store-uQZKjfA8.js';
14
+ import './store-v2gyr6u2.js';
15
15
  import 'redux';
16
16
  import 'redux-thunk';
17
17
  import 'redux-saga';
18
- import 'redux-injectors';
19
- import './CookieHelper.class-DzleKOOc.js';
18
+ import 'redux-injectors-19';
19
+ import './CookieHelper.class-FTURFpz3.js';
20
20
  //# sourceMappingURL=routing.js.map
@@ -1,7 +1,7 @@
1
1
  import { compose, applyMiddleware, createStore as createStore$1, combineReducers } from 'redux';
2
- import thunkMiddleware from 'redux-thunk';
2
+ import { thunk } from 'redux-thunk';
3
3
  import createSagaMiddleware, { END } from 'redux-saga';
4
- import { createInjectorsEnhancer } from 'redux-injectors';
4
+ import { createInjectorsEnhancer } from 'redux-injectors-19';
5
5
  import { produce, original } from 'immer';
6
6
  import { S as SET_TARGET_PROJECT, v as SET_SURROGATE_KEYS, w as SET_SIBLINGS, x as SET_ROUTE, y as SET_NAVIGATION_PATH, z as UPDATE_LOADING_STATE, A as SET_ENTRY, B as SET_ANCESTORS, U as UserReducer } from './selectors-CBdCY0u3.js';
7
7
 
@@ -256,8 +256,6 @@ const routerMiddleware = history => store => next => action => {
256
256
  history[method](...args);
257
257
  };
258
258
 
259
- /* eslint-disable no-underscore-dangle */
260
-
261
259
  let reduxStore;
262
260
  var createStore = async (featureReducers, initialState, history, stateType) => {
263
261
  let reduxDevToolsMiddleware = f => f;
@@ -293,7 +291,7 @@ var createStore = async (featureReducers, initialState, history, stateType) => {
293
291
  };
294
292
  const store = initialState => {
295
293
  const runSaga = sagaMiddleware.run;
296
- const middleware = compose(applyMiddleware(thunkMiddleware, sagaMiddleware, routerMiddleware(history)), createInjectorsEnhancer({
294
+ const middleware = compose(applyMiddleware(thunk, sagaMiddleware, routerMiddleware(history)), createInjectorsEnhancer({
297
295
  createReducer,
298
296
  runSaga
299
297
  }), reduxDevToolsMiddleware);
@@ -307,4 +305,4 @@ var createStore = async (featureReducers, initialState, history, stateType) => {
307
305
  };
308
306
 
309
307
  export { GET_NODE_TREE as G, SET_VERSION as S, SET_VERSION_STATUS as a, SET_NODE_TREE as b, createStore as c, GET_NODE_TREE_ERROR as d, navigation as n, reduxStore as r, version as v };
310
- //# sourceMappingURL=store-uQZKjfA8.js.map
308
+ //# sourceMappingURL=store-v2gyr6u2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store-v2gyr6u2.js","sources":["../src/redux/types/navigation.js","../src/redux/reducers/navigation.ts","../src/routing/redux/reducers.ts","../src/redux/types/version.js","../src/redux/reducers/version.ts","../src/redux/store/routerMiddleware.js","../src/redux/store/store.ts"],"sourcesContent":["const ACTION_PREFIX = '@NAVIGATION/';\nexport const GET_NODE_TREE = `${ACTION_PREFIX}_GET_NODE_TREE`;\nexport const SET_NODE_TREE = `${ACTION_PREFIX}_SET_NODE_TREE`;\nexport const GET_NODE_TREE_ERROR = `${ACTION_PREFIX}_GET_NODE_TREE_ERROR`;\n","import { Draft, produce } from 'immer';\nimport { SET_NODE_TREE, GET_NODE_TREE_ERROR } from '~/redux/types/navigation';\n\nconst initialState = {\n root: null,\n error: {\n isError: false,\n message: null,\n },\n isReady: false,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_NODE_TREE: {\n state.root = action.nodes;\n state.isReady = true;\n return;\n }\n case GET_NODE_TREE_ERROR: {\n state.error.isError = true;\n state.error.message = action.error || 'Unknown error occurred';\n return;\n }\n default:\n return;\n }\n}, initialState);\n","import { Draft, original, produce } from 'immer';\n\nimport {\n SET_ENTRY,\n SET_NAVIGATION_PATH,\n SET_ANCESTORS,\n SET_TARGET_PROJECT,\n SET_ROUTE,\n SET_SIBLINGS,\n SET_SURROGATE_KEYS,\n UPDATE_LOADING_STATE,\n} from './types';\n\nconst initialState = {\n canonicalPath: null,\n currentHostname: null,\n currentPath: '/',\n currentNode: {},\n currentNodeAncestors: [],\n currentProject: 'unknown',\n entryID: null,\n entry: null,\n error: undefined,\n isError: false,\n isLoading: false,\n location: {},\n mappedEntry: null,\n notFound: false,\n staticRoute: null,\n statusCode: 200,\n surrogateKeys: [],\n apiCalls: [],\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_ANCESTORS: {\n state.currentNodeAncestors = action.ancestors;\n return;\n }\n case SET_ENTRY: {\n const {\n entry,\n error,\n mappedEntry,\n node = {},\n isError = false,\n isLoading = false,\n notFound = false,\n statusCode,\n currentPath,\n } = action;\n\n let defaultStatus = 200;\n if (notFound === true && isError === false) defaultStatus = 404;\n else if (isError === true) defaultStatus = statusCode || 500;\n\n if (!entry) {\n state.entryID = null;\n state.entry = null;\n state.error = error;\n state.mappedEntry = null;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n state.canonicalPath = currentPath;\n } else {\n state.entryID = action.id;\n state.entry = entry;\n state.error = error;\n state.isError = isError;\n state.isLoading = isLoading;\n state.notFound = notFound;\n state.statusCode = statusCode || defaultStatus;\n state.canonicalPath = entry.sys.uri || currentPath;\n\n if (mappedEntry && Object.keys(mappedEntry).length > 0) {\n state.mappedEntry = mappedEntry;\n state.entry = { sys: entry.sys };\n }\n }\n\n if (!node) {\n state.currentNode = null;\n } else {\n // On Set Node, we reset all dependants.\n state.currentNode = node;\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { entry, ...nodeWithoutEntry } = node; // We have the entry stored elsewhere, so lets not keep it twice.\n state.currentNode = nodeWithoutEntry;\n }\n\n return;\n }\n case UPDATE_LOADING_STATE: {\n state.isLoading = action.isLoading;\n return;\n }\n case SET_NAVIGATION_PATH: {\n let staticRoute = {} as any;\n if (action.staticRoute) {\n staticRoute = { ...action.staticRoute };\n }\n if (action.path) {\n // Don't run a path update on initial load as we allready should have it in redux\n const entryUri = state?.entry?.sys?.uri;\n if (entryUri !== action.path) {\n state.currentPath = action.path;\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, element: null },\n };\n state.isLoading = typeof window !== 'undefined';\n } else {\n state.location = action.location;\n state.staticRoute = {\n ...staticRoute,\n route: { ...staticRoute.route, element: null },\n };\n }\n }\n return;\n }\n case SET_ROUTE: {\n state.nextPath = action.path;\n return;\n }\n case SET_SIBLINGS: {\n // Can be null in some cases like the homepage.\n let currentNodeSiblingParent = null;\n if (action.siblings && action.siblings.length > 0) {\n currentNodeSiblingParent = action.siblings[0].parentId;\n }\n\n state.currentNodeSiblings = action.siblings;\n state.currentNodeSiblingsParent = currentNodeSiblingParent;\n return;\n }\n case SET_SURROGATE_KEYS: {\n const newKeys = (action.keys || '').split(' ');\n const allKeys = [...original(state.surrogateKeys), ...newKeys];\n const uniqueKeys = [...new Set(allKeys)];\n state.surrogateKeys = uniqueKeys;\n\n state.apiCalls = [\n ...original(state.apiCalls),\n [action.status, newKeys.length, action.url],\n ];\n return;\n }\n case SET_TARGET_PROJECT: {\n state.currentProject = action.project;\n state.allowedGroups = action.allowedGroups;\n state.currentHostname = action.hostname;\n return;\n }\n default:\n return state;\n }\n}, initialState);\n","const VERSION_PREFIX = '@VERSION/';\nexport const SET_VERSION = `${VERSION_PREFIX}SET_VERSION`;\nexport const SET_VERSION_STATUS = `${VERSION_PREFIX}SET_VERSION_STATUS`;\n","import { Draft, produce } from 'immer';\nimport { SET_VERSION, SET_VERSION_STATUS } from '~/redux/types/version';\n\nconst initialState = {\n commitRef: null,\n buildNo: null,\n contensisVersionStatus: null as 'latest' | 'published' | null,\n};\n\nexport default produce((state: Draft<any>, action) => {\n switch (action.type) {\n case SET_VERSION_STATUS: {\n state.contensisVersionStatus = action.status;\n return;\n }\n case SET_VERSION: {\n state.commitRef = action.commitRef;\n state.buildNo = action.buildNo;\n return;\n }\n default:\n return;\n }\n}, initialState);\n","/**\n * This middleware captures 'CALL_HISTORY_METHOD' actions to redirect to the\n * provided history object. This will prevent these actions from reaching your\n * reducer or any middleware that comes after this one.\n */\n/* eslint-disable no-unused-vars */\nconst routerMiddleware = history => store => next => action => {\n if (action.type !== 'CALL_HISTORY_METHOD') {\n return next(action);\n }\n\n const {\n payload: { method, args },\n } = action;\n history[method](...args);\n};\n\nexport default routerMiddleware;\n","import {\n applyMiddleware,\n combineReducers,\n compose,\n createStore,\n Action,\n Store,\n StoreEnhancer,\n} from 'redux';\nimport { thunk as thunkMiddleware } from 'redux-thunk';\nimport createSagaMiddleware, { END } from 'redux-saga';\nimport { createInjectorsEnhancer } from 'redux-injectors-19';\n\n// Core reducers\nimport NavigationReducer from '../reducers/navigation';\nimport RoutingReducer from '~/routing/redux/reducers';\nimport UserReducer from '~/user/redux/reducers';\nimport VersionReducer from '../reducers/version';\nimport routerMiddleware from './routerMiddleware';\nimport { AppState, StateType } from '~/models';\nimport { History, MemoryHistory } from 'history';\n\ndeclare let window: Window &\n typeof globalThis & {\n __REDUX_DEVTOOLS_EXTENSION__: any;\n };\n\ntype ReduxAppStore = Store<AppState, Action>;\n\ntype ReduxSagaAppStore = ReduxAppStore & {\n runSaga: ReturnType<typeof createSagaMiddleware>['run'];\n close: () => void;\n};\n\nexport let reduxStore: ReduxSagaAppStore;\n\nexport default async (\n featureReducers: any,\n initialState: AppState,\n history: History | MemoryHistory,\n stateType: StateType\n) => {\n let reduxDevToolsMiddleware = f => f;\n\n if (typeof window != 'undefined') {\n reduxDevToolsMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__\n ? window.__REDUX_DEVTOOLS_EXTENSION__()\n : f => f;\n }\n\n const sagaMiddleware = createSagaMiddleware();\n\n const reducers = {\n navigation: NavigationReducer,\n routing: RoutingReducer,\n user: UserReducer,\n version: VersionReducer,\n ...featureReducers,\n };\n\n // Reassign the combiner and fromJS functions when\n // stateType is 'immutable' with dynamic imports\n let combiner = combineReducers;\n let fromJS = <T = any>(obj: T) => obj;\n globalThis.STATE_TYPE = stateType;\n\n if (stateType === 'immutable') {\n globalThis.immutable = await import(\n /* webpackChunkName: \"immutable\" */ 'immutable'\n );\n\n fromJS = (\n await import(/* webpackChunkName: \"from-js\" */ '~/util/fromJSLeaveImmer')\n ).default;\n\n combiner = (\n await import(/* webpackChunkName: \"redux-immutable\" */ 'redux-immutable')\n ).combineReducers;\n }\n\n const createReducer = (injectedReducers = {}) => {\n const rootReducer = combiner<AppState>({\n ...injectedReducers,\n // other non-injected reducers go here\n ...reducers,\n });\n\n return rootReducer;\n };\n\n const store = (initialState: AppState) => {\n const runSaga = sagaMiddleware.run;\n\n const middleware: StoreEnhancer<{\n runSaga: ReturnType<typeof createSagaMiddleware>['run'];\n close: () => void;\n }> = compose(\n applyMiddleware(\n thunkMiddleware,\n sagaMiddleware,\n routerMiddleware(history)\n ),\n createInjectorsEnhancer({\n createReducer,\n runSaga,\n }),\n reduxDevToolsMiddleware\n );\n\n const store = createStore(createReducer(), initialState, middleware);\n\n store.runSaga = runSaga;\n store.close = () => store.dispatch(END);\n return store;\n };\n\n reduxStore = store(fromJS(initialState)) as ReduxSagaAppStore;\n return reduxStore;\n};\n"],"names":["ACTION_PREFIX","GET_NODE_TREE","SET_NODE_TREE","GET_NODE_TREE_ERROR","initialState","root","error","isError","message","isReady","produce","state","action","type","nodes","canonicalPath","currentHostname","currentPath","currentNode","currentNodeAncestors","currentProject","entryID","entry","undefined","isLoading","location","mappedEntry","notFound","staticRoute","statusCode","surrogateKeys","apiCalls","SET_ANCESTORS","ancestors","SET_ENTRY","node","defaultStatus","id","sys","uri","Object","keys","length","nodeWithoutEntry","UPDATE_LOADING_STATE","SET_NAVIGATION_PATH","path","_state$entry","entryUri","route","element","window","SET_ROUTE","nextPath","SET_SIBLINGS","currentNodeSiblingParent","siblings","parentId","currentNodeSiblings","currentNodeSiblingsParent","SET_SURROGATE_KEYS","newKeys","split","allKeys","original","uniqueKeys","Set","status","url","SET_TARGET_PROJECT","project","allowedGroups","hostname","VERSION_PREFIX","SET_VERSION","SET_VERSION_STATUS","commitRef","buildNo","contensisVersionStatus","routerMiddleware","history","store","next","payload","method","args","reduxStore","featureReducers","stateType","reduxDevToolsMiddleware","f","__REDUX_DEVTOOLS_EXTENSION__","sagaMiddleware","createSagaMiddleware","reducers","navigation","NavigationReducer","routing","RoutingReducer","user","UserReducer","version","VersionReducer","combiner","combineReducers","fromJS","obj","globalThis","STATE_TYPE","immutable","default","createReducer","injectedReducers","rootReducer","runSaga","run","middleware","compose","applyMiddleware","thunkMiddleware","createInjectorsEnhancer","createStore","close","dispatch","END"],"mappings":";;;;;;;AAAA,MAAMA,aAAa,GAAG,cAAc;AAC7B,MAAMC,aAAa,GAAG,CAAA,EAAGD,aAAa,CAAA,cAAA;AACtC,MAAME,aAAa,GAAG,CAAA,EAAGF,aAAa,CAAA,cAAA;AACtC,MAAMG,mBAAmB,GAAG,CAAA,EAAGH,aAAa,CAAA,oBAAA;;;;;;;;;ACAnD,MAAM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,MAAAA;KACD,CAAC,EACFzB,uBACF,CAAC;IAED,MAAMR,KAAK,GAAGwC,aAAW,CAACV,aAAa,EAAE,EAAE3G,YAAY,EAAEgH,UAAU,CAAC;IAEpEnC,KAAK,CAACiC,OAAO,GAAGA,OAAO;IACvBjC,KAAK,CAACyC,KAAK,GAAG,MAAMzC,KAAK,CAAC0C,QAAQ,CAACC,GAAG,CAAC;AACvC,IAAA,OAAO3C,KAAK;EACd,CAAC;AAEDK,EAAAA,UAAU,GAAGL,KAAK,CAACwB,MAAM,CAACrG,YAAY,CAAC,CAAsB;AAC7D,EAAA,OAAOkF,UAAU;AACnB,CAAC;;;;"}
package/esm/user.js CHANGED
@@ -1,11 +1,11 @@
1
- import { l as logoutUser, a as loginUser, r as registerUser } from './ChangePassword.container-Q7bElOVz.js';
2
- export { C as ChangePassword, F as ForgotPasswordContainer, c as LoginContainer, L as LoginHelper, R as RegistrationContainer, b as actions, h as handleRequiresLoginSaga, g as refreshSecurityToken, f as useChangePassword, e as useForgotPassword, u as useLogin, d as useRegistration } from './ChangePassword.container-Q7bElOVz.js';
1
+ import { l as logoutUser, a as loginUser, r as registerUser } from './ChangePassword.container-C0tFq0Tf.js';
2
+ export { C as ChangePassword, F as ForgotPasswordContainer, c as LoginContainer, L as LoginHelper, R as RegistrationContainer, b as actions, h as handleRequiresLoginSaga, g as refreshSecurityToken, f as useChangePassword, e as useForgotPassword, u as useLogin, d as useRegistration } from './ChangePassword.container-C0tFq0Tf.js';
3
3
  import React from 'react';
4
4
  import { useCookies } from 'react-cookie';
5
5
  import { connect } from 'react-redux';
6
6
  import { t as toJS, s as selectUserIsError, a as selectUserIsAuthenticationError, b as selectUser, c as selectUserIsLoading, d as selectUserIsAuthenticated, e as selectUserErrorMessage, f as selectUserRegistration, g as selectUserRegistrationIsSuccess, h as selectUserRegistrationIsLoading, i as selectUserRegistrationError } from './ToJs-CpPNdcXS.js';
7
7
  export { j as selectors } from './ToJs-CpPNdcXS.js';
8
- import { C as CookieHelper } from './CookieHelper.class-DzleKOOc.js';
8
+ import { C as CookieHelper } from './CookieHelper.class-FTURFpz3.js';
9
9
  export { i as initialUserState, U as reducer, t as types } from './selectors-CBdCY0u3.js';
10
10
  import '@redux-saga/core/effects';
11
11
  import 'jsonpath-mapper';
package/esm/util.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { s as setCachingHeaders, u as urls } from './urls-DfCisos-.js';
2
- export { S as SSRContextProvider, c as cachedSearch, a as cachedSearchWithCookies, d as deliveryApi, b as deliveryApiWithCookies, g as getClientConfig, u as useDeliveryApi, e as useSSRContext } from './SSRContext-C743Oeli.js';
2
+ export { S as SSRContextProvider, c as cachedSearch, a as cachedSearchWithCookies, d as deliveryApi, b as deliveryApiWithCookies, g as getClientConfig, u as useDeliveryApi, e as useSSRContext } from './SSRContext-CkiWIvde.js';
3
3
  import { g as getDefaultExportFromCjs } from './_commonjsHelpers-BFTU3MAI.js';
4
4
  import mapJson, { jpath } from 'jsonpath-mapper';
5
5
  export { jpath, default as mapJson } from 'jsonpath-mapper';
@@ -11,13 +11,13 @@ import styled from 'styled-components';
11
11
  import 'react-cookie';
12
12
  import 'contensis-delivery-api';
13
13
  import 'query-string';
14
- import './store-uQZKjfA8.js';
14
+ import './store-v2gyr6u2.js';
15
15
  import 'redux';
16
16
  import 'redux-thunk';
17
17
  import 'redux-saga';
18
- import 'redux-injectors';
18
+ import 'redux-injectors-19';
19
19
  import 'immer';
20
- import './CookieHelper.class-DzleKOOc.js';
20
+ import './CookieHelper.class-FTURFpz3.js';
21
21
 
22
22
  /**
23
23
  *
@@ -1,6 +1,6 @@
1
1
  import { g as getImmutableOrJS, c as action } from './selectors-CBdCY0u3.js';
2
2
  import { all } from '@redux-saga/core/effects';
3
- import { r as reduxStore, S as SET_VERSION, a as SET_VERSION_STATUS } from './store-uQZKjfA8.js';
3
+ import { r as reduxStore, S as SET_VERSION, a as SET_VERSION_STATUS } from './store-v2gyr6u2.js';
4
4
 
5
5
  const hasNavigationTree = state => getImmutableOrJS(state, ['navigation', 'isReady']);
6
6
  const selectNavigationRoot = state => getImmutableOrJS(state, ['navigation', 'root']);
@@ -84,4 +84,4 @@ var version = /*#__PURE__*/Object.freeze({
84
84
  });
85
85
 
86
86
  export { injectReducer as a, injectSaga as b, convertSagaArray as c, setVersion as d, hasNavigationTree as h, injectRedux as i, navigation as n, setVersionStatus as s, useInjectRedux as u, version as v };
87
- //# sourceMappingURL=version-B9nPx4IF.js.map
87
+ //# sourceMappingURL=version-DvjTUbcA.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version-B9nPx4IF.js","sources":["../src/redux/selectors/navigation.js","../src/redux/store/injectors.js","../src/redux/actions/version.js"],"sourcesContent":["import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const hasNavigationTree = state =>\n getIn(state, ['navigation', 'isReady']);\n\nexport const selectNavigationRoot = state =>\n getIn(state, ['navigation', 'root']);\n\nexport const selectNavigationChildren = state =>\n getIn(state, ['navigation', 'root', 'children']);\n\nexport const selectNavigationDepends = () => [];\n","import { all } from 'redux-saga/effects';\nimport { reduxStore as DefaultStore } from './store';\n\nexport const convertSagaArray = sagas => {\n if (Array.isArray(sagas))\n return function* rootSaga() {\n yield all(sagas);\n };\n return sagas;\n};\n\nexport const injectReducer = ({ key, reducer }, store = DefaultStore) => {\n if (\n Reflect.has(store.injectedReducers, key) &&\n store.injectedReducers[key] === reducer\n )\n return;\n store.injectedReducers[key] = reducer;\n\n store.replaceReducer(store.createReducer(store.injectedReducers));\n};\n\nexport const injectSaga = ({ key, saga }, store = DefaultStore) => {\n const rootSaga = convertSagaArray(saga);\n let hasSaga = Reflect.has(store.injectedSagas, key);\n\n if (process.env.NODE_ENV !== 'production') {\n const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas\n\n if (hasSaga && oldDescriptor.saga !== rootSaga) {\n oldDescriptor.task.cancel();\n hasSaga = false;\n }\n }\n console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);\n\n if (!hasSaga) {\n store.injectedSagas[key] = {\n key,\n saga: rootSaga,\n task: store.runSaga(rootSaga),\n };\n }\n};\n\nexport const injectRedux = ({ key, reducer, saga }, store = DefaultStore) => {\n console.info('injectRedux, key: ', key);\n if (reducer) injectReducer({ key, reducer }, store);\n if (saga) injectSaga({ key, saga }, store);\n};\n\nexport const useInjectRedux = injectRedux;\n","import { action } from '../util';\nimport { SET_VERSION, SET_VERSION_STATUS } from '../types/version';\n\nexport const setVersion = (commitRef, buildNo) =>\n action(SET_VERSION, { commitRef, buildNo });\n\nexport const setVersionStatus = status =>\n action(SET_VERSION_STATUS, { status });\n"],"names":["hasNavigationTree","state","getIn","selectNavigationRoot","selectNavigationChildren","selectNavigationDepends","convertSagaArray","sagas","Array","isArray","rootSaga","all","injectReducer","key","reducer","store","DefaultStore","Reflect","has","injectedReducers","replaceReducer","createReducer","injectSaga","saga","hasSaga","injectedSagas","process","env","NODE_ENV","oldDescriptor","task","cancel","console","info","runSaga","injectRedux","useInjectRedux","setVersion","commitRef","buildNo","action","SET_VERSION","setVersionStatus","status","SET_VERSION_STATUS"],"mappings":";;;;AAEO,MAAMA,iBAAiB,GAAGC,KAAK,IACpCC,gBAAK,CAACD,KAAK,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;AAEjC,MAAME,oBAAoB,GAAGF,KAAK,IACvCC,gBAAK,CAACD,KAAK,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAE/B,MAAMG,wBAAwB,GAAGH,KAAK,IAC3CC,gBAAK,CAACD,KAAK,EAAE,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;AAE3C,MAAMI,uBAAuB,GAAGA,MAAM,EAAE;;;;;;;;;;ACRxC,MAAMC,gBAAgB,GAAGC,KAAK,IAAI;EACvC,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EACtB,OAAO,UAAUG,QAAQA,GAAG;IAC1B,MAAMC,GAAG,CAACJ,KAAK,CAA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IAAI,EAAEb,QAAQ;AACdoB,MAAAA,IAAI,EAAEf,KAAK,CAACmB,OAAO,CAACxB,QAAQ;KAC7B;AACH,EAAA;AACF;AAEO,MAAMyB,WAAW,GAAGA,CAAC;EAAEtB,GAAG;EAAEC,OAAO;AAAES,EAAAA;AAAK,CAAC,EAAER,KAAK,GAAGC,UAAY,KAAK;AAC3EgB,EAAAA,OAAO,CAACC,IAAI,CAAC,oBAAoB,EAAEpB,GAAG,CAAC;EACvC,IAAIC,OAAO,EAAEF,aAAa,CAAC;IAAEC,GAAG;AAAEC,IAAAA;GAAS,EAAEC,KAAK,CAAC;EACnD,IAAIQ,IAAI,EAAED,UAAU,CAAC;IAAET,GAAG;AAAEU,IAAAA;GAAM,EAAER,KAAK,CAAC;AAC5C;AAEO,MAAMqB,cAAc,GAAGD;;AChDvB,MAAME,UAAU,GAAGA,CAACC,SAAS,EAAEC,OAAO,KAC3CC,MAAM,CAACC,WAAW,EAAE;EAAEH,SAAS;AAAEC,EAAAA;AAAQ,CAAC;AAErC,MAAMG,gBAAgB,GAAGC,MAAM,IACpCH,MAAM,CAACI,kBAAkB,EAAE;AAAED,EAAAA;AAAO,CAAC;;;;;;;;;;"}
1
+ {"version":3,"file":"version-DvjTUbcA.js","sources":["../src/redux/selectors/navigation.js","../src/redux/store/injectors.js","../src/redux/actions/version.js"],"sourcesContent":["import { getImmutableOrJS as getIn } from '~/redux/util';\n\nexport const hasNavigationTree = state =>\n getIn(state, ['navigation', 'isReady']);\n\nexport const selectNavigationRoot = state =>\n getIn(state, ['navigation', 'root']);\n\nexport const selectNavigationChildren = state =>\n getIn(state, ['navigation', 'root', 'children']);\n\nexport const selectNavigationDepends = () => [];\n","import { all } from 'redux-saga/effects';\nimport { reduxStore as DefaultStore } from './store';\n\nexport const convertSagaArray = sagas => {\n if (Array.isArray(sagas))\n return function* rootSaga() {\n yield all(sagas);\n };\n return sagas;\n};\n\nexport const injectReducer = ({ key, reducer }, store = DefaultStore) => {\n if (\n Reflect.has(store.injectedReducers, key) &&\n store.injectedReducers[key] === reducer\n )\n return;\n store.injectedReducers[key] = reducer;\n\n store.replaceReducer(store.createReducer(store.injectedReducers));\n};\n\nexport const injectSaga = ({ key, saga }, store = DefaultStore) => {\n const rootSaga = convertSagaArray(saga);\n let hasSaga = Reflect.has(store.injectedSagas, key);\n\n if (process.env.NODE_ENV !== 'production') {\n const oldDescriptor = store.injectedSagas[key]; // enable hot reloading of daemon and once-till-unmount sagas\n\n if (hasSaga && oldDescriptor.saga !== rootSaga) {\n oldDescriptor.task.cancel();\n hasSaga = false;\n }\n }\n console.info('injectSaga, key: ', key, 'hasSaga: ', hasSaga);\n\n if (!hasSaga) {\n store.injectedSagas[key] = {\n key,\n saga: rootSaga,\n task: store.runSaga(rootSaga),\n };\n }\n};\n\nexport const injectRedux = ({ key, reducer, saga }, store = DefaultStore) => {\n console.info('injectRedux, key: ', key);\n if (reducer) injectReducer({ key, reducer }, store);\n if (saga) injectSaga({ key, saga }, store);\n};\n\nexport const useInjectRedux = injectRedux;\n","import { action } from '../util';\nimport { SET_VERSION, SET_VERSION_STATUS } from '../types/version';\n\nexport const setVersion = (commitRef, buildNo) =>\n action(SET_VERSION, { commitRef, buildNo });\n\nexport const setVersionStatus = status =>\n action(SET_VERSION_STATUS, { status });\n"],"names":["hasNavigationTree","state","getIn","selectNavigationRoot","selectNavigationChildren","selectNavigationDepends","convertSagaArray","sagas","Array","isArray","rootSaga","all","injectReducer","key","reducer","store","DefaultStore","Reflect","has","injectedReducers","replaceReducer","createReducer","injectSaga","saga","hasSaga","injectedSagas","process","env","NODE_ENV","oldDescriptor","task","cancel","console","info","runSaga","injectRedux","useInjectRedux","setVersion","commitRef","buildNo","action","SET_VERSION","setVersionStatus","status","SET_VERSION_STATUS"],"mappings":";;;;AAEO,MAAMA,iBAAiB,GAAGC,KAAK,IACpCC,gBAAK,CAACD,KAAK,EAAE,CAAC,YAAY,EAAE,SAAS,CAAC;AAEjC,MAAME,oBAAoB,GAAGF,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