@woodsportal/hubspot-kit 1.0.41-dev.4 → 1.0.41-dev.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +191 -157
- package/dist/{chunk-S2YJDWZU.js → chunk-NWBK3XBZ.js} +1 -1
- package/dist/chunk-NWBK3XBZ.js.map +1 -0
- package/dist/chunk-WHYTQEZX.js +554 -0
- package/dist/chunk-WHYTQEZX.js.map +1 -0
- package/dist/cli.js +1494 -650
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/scaffold-page-lifecycle-EHMPWPPE.js +194 -0
- package/dist/scaffold-page-lifecycle-EHMPWPPE.js.map +1 -0
- package/dist/vite/index.js +1 -1
- package/examples/greenfield/module-hybrid-cdn/public/fields.json +73 -28
- package/examples/greenfield/module-hybrid-cdn/public/module.html +21 -5
- package/examples/greenfield/module-hybrid-cdn/src/assets/css/main.dev.css +15 -0
- package/examples/greenfield/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
- package/examples/greenfield/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -29
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.ts +20 -37
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/app.tsx +172 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session.ts +51 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/components/starter-login.tsx +83 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-session-bridge.ts +74 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-otp-utils.ts +24 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-pending-storage.ts +108 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-portal.ts +45 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/sso-callback.ts +120 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/configure-woodsportal-sdk.ts +98 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-portal.tsx +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routeTree.gen.ts +182 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login/sso.tsx +27 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/two-fa.tsx +91 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/app.tsx +180 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/components/starter-login.tsx +83 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/sso-callback.ts +120 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-portal.tsx +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routeTree.gen.ts +155 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login/sso.tsx +27 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/app.tsx +173 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/components/starter-login.tsx +76 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-guide-page.tsx +218 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/auth-guide-content.ts +91 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-portal.tsx +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routeTree.gen.ts +134 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/app.tsx +173 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/components/starter-login.tsx +76 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-portal.tsx +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routeTree.gen.ts +134 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-monolith/public/fields.json +66 -16
- package/examples/greenfield/module-monolith/src/assets/css/main.dev.css +7 -0
- package/examples/greenfield/module-monolith/src/components/layout/starter-nav.tsx +12 -15
- package/examples/greenfield/module-monolith/src/config/starter-nav.ts +9 -0
- package/examples/greenfield/module-monolith/src/features/starter/components/starter-home.tsx +25 -29
- package/examples/greenfield/module-monolith/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.ts +20 -37
- package/examples/manifest.json +5 -1
- package/examples/smoke/run-matrix.mjs +37 -0
- package/package.json +7 -5
- package/scripts/cli-smoke-helpers.mjs +150 -0
- package/scripts/regenerate-route-tree.mjs +71 -0
- package/scripts/sync-auth-scaffold-from-client.mjs +41 -0
- package/scripts/wp-cli-smoke.test.mjs +263 -0
- package/src/dev/bootstrap-greenfield.tsx +6 -0
- package/templates/module-hybrid-cdn/public/fields.json +47 -7
- package/templates/module-hybrid-cdn/public/module.html +7 -6
- package/templates/module-hybrid-cdn/src/assets/css/main.dev.css +7 -0
- package/templates/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
- package/templates/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
- package/templates/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -27
- package/templates/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +5 -5
- package/templates/module-monolith/public/fields.json +49 -6
- package/templates/module-monolith/src/assets/css/main.dev.css +7 -0
- package/templates/module-monolith/src/components/layout/starter-nav.tsx +12 -15
- package/templates/module-monolith/src/config/starter-nav.ts +9 -0
- package/templates/module-monolith/src/features/starter/components/starter-home.tsx +25 -27
- package/templates/module-monolith/src/features/starter/hooks/starter-preview-values.ts +5 -5
- package/templates/scaffold/auth/_full/src/app.tsx +172 -0
- package/templates/scaffold/auth/_full/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_full/src/features/auth/auth-session.ts +51 -0
- package/templates/scaffold/auth/_full/src/features/auth/login-session-bridge.ts +74 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-otp-utils.ts +24 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-pending-storage.ts +108 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-portal.ts +45 -0
- package/templates/scaffold/auth/_full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
- package/templates/scaffold/auth/_full/src/routeTree.gen.ts +182 -0
- package/templates/scaffold/auth/_full/src/routes/_auth/two-fa.tsx +91 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
- package/templates/scaffold/auth/_nav-top/src/components/Layouts/MainLayout.tsx +42 -0
- package/templates/scaffold/auth/_shared/src/app.tsx +178 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/AuthLayout.tsx +7 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/index.ts +13 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Button.tsx +22 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Form.tsx +22 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Input.tsx +12 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Toaster.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/ui/link.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/components/ui/loader/loader.tsx +18 -0
- package/templates/scaffold/auth/_shared/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_shared/src/config/nav-scaffold.ts +4 -0
- package/templates/scaffold/auth/_shared/src/config/portal-nav.ts +9 -0
- package/templates/scaffold/auth/_shared/src/config/router.ts +1 -0
- package/templates/scaffold/auth/_shared/src/config/routes.ts +10 -0
- package/templates/scaffold/auth/_shared/src/data/hubSpotContext.ts +57 -0
- package/templates/scaffold/auth/_shared/src/data/sync-sdk-hub-context.ts +44 -0
- package/templates/scaffold/auth/_shared/src/env.ts +59 -0
- package/templates/scaffold/auth/_shared/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-navigation.ts +81 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-route-paths.ts +29 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-session-events.ts +2 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-session.ts +26 -0
- package/templates/scaffold/auth/_shared/src/features/auth/clear-client-auth-session.ts +62 -0
- package/templates/scaffold/auth/_shared/src/features/auth/components/starter-login.tsx +76 -0
- package/templates/scaffold/auth/_shared/src/features/auth/login-email-storage.ts +64 -0
- package/templates/scaffold/auth/_shared/src/features/auth/login-session-bridge.ts +72 -0
- package/templates/scaffold/auth/_shared/src/features/auth/post-login-path.ts +17 -0
- package/templates/scaffold/auth/_shared/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/templates/scaffold/auth/_shared/src/features/auth/resolve-post-login-path.ts +21 -0
- package/templates/scaffold/auth/_shared/src/features/auth/use-portal-session.ts +25 -0
- package/templates/scaffold/auth/_shared/src/features/auth/use-signed-in-email.ts +55 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-guide-page.tsx +218 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/templates/scaffold/auth/_shared/src/features/starter/content/auth-guide-content.ts +91 -0
- package/templates/scaffold/auth/_shared/src/hubspot/is-cms-editor.ts +78 -0
- package/templates/scaffold/auth/_shared/src/integrations/configure-woodsportal-sdk.ts +100 -0
- package/templates/scaffold/auth/_shared/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/templates/scaffold/auth/_shared/src/integrations/tanstack-router/router.tsx +39 -0
- package/templates/scaffold/auth/_shared/src/integrations/woodsportal-sdk.ts +37 -0
- package/templates/scaffold/auth/_shared/src/portal/mount-portal.tsx +59 -0
- package/templates/scaffold/auth/_shared/src/routeTree.gen.ts +134 -0
- package/templates/scaffold/auth/_shared/src/routes/__root.tsx +12 -0
- package/templates/scaffold/auth/_shared/src/routes/_app/portal.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/routes/_auth/login.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/routes/guide.tsx +9 -0
- package/templates/scaffold/auth/_shared/src/routes/index.tsx +8 -0
- package/templates/scaffold/auth/_shared/src/routes/unauthorized.tsx +50 -0
- package/templates/scaffold/auth/_shared/src/utils/ValidationSchema.ts +1 -0
- package/templates/scaffold/auth/_shared/src/utils/cookie.ts +23 -0
- package/templates/scaffold/auth/_shared/src/utils/normalize-router-path.ts +10 -0
- package/templates/scaffold/auth/_shared/src/utils/private-route.tsx +100 -0
- package/templates/scaffold/auth/_shared/src/utils/public-route.tsx +64 -0
- package/templates/scaffold/auth/_shared/src/utils/resolve-api-base-url.ts +44 -0
- package/templates/scaffold/auth/_shared/src/utils/safe-router-navigation.ts +82 -0
- package/templates/scaffold/auth/_sso/src/app.tsx +180 -0
- package/templates/scaffold/auth/_sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/templates/scaffold/auth/_sso/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_sso/src/features/auth/components/starter-login.tsx +83 -0
- package/templates/scaffold/auth/_sso/src/features/auth/sso-callback.ts +120 -0
- package/templates/scaffold/auth/_sso/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/templates/scaffold/auth/_sso/src/routeTree.gen.ts +155 -0
- package/templates/scaffold/auth/_sso/src/routes/_auth/login/sso.tsx +27 -0
- package/templates/scaffold/auth/nav-manifest.json +8 -0
- package/templates/scaffold/auth/sync-manifest.json +16 -0
- package/templates/scaffold/auth/tier-manifest.json +18 -0
- package/templates/scaffold/page/page-component-auth.tsx.tpl +10 -0
- package/templates/scaffold/page/page-component-plain.tsx.tpl +11 -0
- package/templates/scaffold/page/route-protected-auth.tsx.tpl +10 -0
- package/templates/scaffold/page/route-public-auth.tsx.tpl +9 -0
- package/templates/scaffold/page/route-public-plain.tsx.tpl +6 -0
- package/dist/chunk-S2YJDWZU.js.map +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createRoot } from 'react-dom/client'
|
|
2
|
+
import type { AnyRouter } from '@tanstack/react-router'
|
|
3
|
+
|
|
4
|
+
import { configureWoodsPortalSdk } from '@/integrations/configure-woodsportal-sdk'
|
|
5
|
+
import { syncSdkHubContextFromRuntime } from '@/data/sync-sdk-hub-context'
|
|
6
|
+
import { App } from '@/app'
|
|
7
|
+
import { getRouter } from '@/integrations/tanstack-router/router'
|
|
8
|
+
|
|
9
|
+
export type MountPortalOptions = {
|
|
10
|
+
includeGlobalStyles?: boolean
|
|
11
|
+
skipRuntimeCss?: boolean
|
|
12
|
+
skipAppRender?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
let portalRouter: AnyRouter | null = null
|
|
16
|
+
|
|
17
|
+
/** Lazy router — created after optional SSO URL normalization. */
|
|
18
|
+
export function getPortalRouter(): AnyRouter {
|
|
19
|
+
if (!portalRouter) {
|
|
20
|
+
portalRouter = getRouter()
|
|
21
|
+
}
|
|
22
|
+
return portalRouter
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** @deprecated Prefer getPortalRouter() after mount/bootstrap. */
|
|
26
|
+
export const router = new Proxy({} as AnyRouter, {
|
|
27
|
+
get(_target, prop) {
|
|
28
|
+
return Reflect.get(getPortalRouter(), prop)
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
/** Mount the portal into `#app` with SDK bootstrap and router. */
|
|
33
|
+
export async function mountPortal(options: MountPortalOptions = {}) {
|
|
34
|
+
const { skipAppRender = false } = options
|
|
35
|
+
|
|
36
|
+
syncSdkHubContextFromRuntime()
|
|
37
|
+
configureWoodsPortalSdk()
|
|
38
|
+
|
|
39
|
+
// WPHS_AUTH_SSO
|
|
40
|
+
const { clearLegacySsoCallbackInFlight, ensureSsoCallbackRoute } = await import(
|
|
41
|
+
'@/features/auth/sso-callback'
|
|
42
|
+
)
|
|
43
|
+
clearLegacySsoCallbackInFlight()
|
|
44
|
+
ensureSsoCallbackRoute()
|
|
45
|
+
// /WPHS_AUTH_SSO
|
|
46
|
+
|
|
47
|
+
const activeRouter = getPortalRouter()
|
|
48
|
+
|
|
49
|
+
if (skipAppRender) {
|
|
50
|
+
return
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const rootElement = document.getElementById('app')
|
|
54
|
+
if (!rootElement) {
|
|
55
|
+
return
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
createRoot(rootElement).render(<App router={activeRouter} />)
|
|
59
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// TanStack Router generated route tree (starter tier). Regenerate after adding routes.
|
|
4
|
+
|
|
5
|
+
import { Route as rootRouteImport } from './routes/__root'
|
|
6
|
+
import { Route as UnauthorizedRouteImport } from './routes/unauthorized'
|
|
7
|
+
import { Route as GuideRouteImport } from './routes/guide'
|
|
8
|
+
import { Route as IndexRouteImport } from './routes/index'
|
|
9
|
+
import { Route as AuthLoginRouteImport } from './routes/_auth/login'
|
|
10
|
+
import { Route as AppPortalRouteImport } from './routes/_app/portal'
|
|
11
|
+
|
|
12
|
+
const UnauthorizedRoute = UnauthorizedRouteImport.update({
|
|
13
|
+
id: '/unauthorized',
|
|
14
|
+
path: '/unauthorized',
|
|
15
|
+
getParentRoute: () => rootRouteImport,
|
|
16
|
+
} as any)
|
|
17
|
+
|
|
18
|
+
const GuideRoute = GuideRouteImport.update({
|
|
19
|
+
id: '/guide',
|
|
20
|
+
path: '/guide',
|
|
21
|
+
getParentRoute: () => rootRouteImport,
|
|
22
|
+
} as any)
|
|
23
|
+
|
|
24
|
+
const IndexRoute = IndexRouteImport.update({
|
|
25
|
+
id: '/',
|
|
26
|
+
path: '/',
|
|
27
|
+
getParentRoute: () => rootRouteImport,
|
|
28
|
+
} as any)
|
|
29
|
+
|
|
30
|
+
const AuthLoginRoute = AuthLoginRouteImport.update({
|
|
31
|
+
id: '/_auth/login',
|
|
32
|
+
path: '/login',
|
|
33
|
+
getParentRoute: () => rootRouteImport,
|
|
34
|
+
} as any)
|
|
35
|
+
|
|
36
|
+
const AppPortalRoute = AppPortalRouteImport.update({
|
|
37
|
+
id: '/_app/portal',
|
|
38
|
+
path: '/portal',
|
|
39
|
+
getParentRoute: () => rootRouteImport,
|
|
40
|
+
} as any)
|
|
41
|
+
|
|
42
|
+
export interface FileRoutesByFullPath {
|
|
43
|
+
'/': typeof IndexRoute
|
|
44
|
+
'/guide': typeof GuideRoute
|
|
45
|
+
'/login': typeof AuthLoginRoute
|
|
46
|
+
'/portal': typeof AppPortalRoute
|
|
47
|
+
'/unauthorized': typeof UnauthorizedRoute
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface FileRoutesByTo {
|
|
51
|
+
'/': typeof IndexRoute
|
|
52
|
+
'/guide': typeof GuideRoute
|
|
53
|
+
'/login': typeof AuthLoginRoute
|
|
54
|
+
'/portal': typeof AppPortalRoute
|
|
55
|
+
'/unauthorized': typeof UnauthorizedRoute
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface FileRoutesById {
|
|
59
|
+
__root__: typeof rootRouteImport
|
|
60
|
+
'/': typeof IndexRoute
|
|
61
|
+
'/guide': typeof GuideRoute
|
|
62
|
+
'/_auth/login': typeof AuthLoginRoute
|
|
63
|
+
'/_app/portal': typeof AppPortalRoute
|
|
64
|
+
'/unauthorized': typeof UnauthorizedRoute
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface FileRouteTypes {
|
|
68
|
+
fileRoutesByFullPath: FileRoutesByFullPath
|
|
69
|
+
fullPaths: '/' | '/guide' | '/login' | '/portal' | '/unauthorized'
|
|
70
|
+
fileRoutesByTo: FileRoutesByTo
|
|
71
|
+
to: '/' | '/guide' | '/login' | '/portal' | '/unauthorized'
|
|
72
|
+
id: '__root__' | '/' | '/guide' | '/_auth/login' | '/_app/portal' | '/unauthorized'
|
|
73
|
+
fileRoutesById: FileRoutesById
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface RootRouteChildren {
|
|
77
|
+
IndexRoute: typeof IndexRoute
|
|
78
|
+
GuideRoute: typeof GuideRoute
|
|
79
|
+
AuthLoginRoute: typeof AuthLoginRoute
|
|
80
|
+
AppPortalRoute: typeof AppPortalRoute
|
|
81
|
+
UnauthorizedRoute: typeof UnauthorizedRoute
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare module '@tanstack/react-router' {
|
|
85
|
+
interface FileRoutesByPath {
|
|
86
|
+
'/unauthorized': {
|
|
87
|
+
id: '/unauthorized'
|
|
88
|
+
path: '/unauthorized'
|
|
89
|
+
fullPath: '/unauthorized'
|
|
90
|
+
preLoaderRoute: typeof UnauthorizedRouteImport
|
|
91
|
+
parentRoute: typeof rootRouteImport
|
|
92
|
+
}
|
|
93
|
+
'/guide': {
|
|
94
|
+
id: '/guide'
|
|
95
|
+
path: '/guide'
|
|
96
|
+
fullPath: '/guide'
|
|
97
|
+
preLoaderRoute: typeof GuideRouteImport
|
|
98
|
+
parentRoute: typeof rootRouteImport
|
|
99
|
+
}
|
|
100
|
+
'/': {
|
|
101
|
+
id: '/'
|
|
102
|
+
path: '/'
|
|
103
|
+
fullPath: '/'
|
|
104
|
+
preLoaderRoute: typeof IndexRouteImport
|
|
105
|
+
parentRoute: typeof rootRouteImport
|
|
106
|
+
}
|
|
107
|
+
'/login': {
|
|
108
|
+
id: '/_auth/login'
|
|
109
|
+
path: '/login'
|
|
110
|
+
fullPath: '/login'
|
|
111
|
+
preLoaderRoute: typeof AuthLoginRouteImport
|
|
112
|
+
parentRoute: typeof rootRouteImport
|
|
113
|
+
}
|
|
114
|
+
'/portal': {
|
|
115
|
+
id: '/_app/portal'
|
|
116
|
+
path: '/portal'
|
|
117
|
+
fullPath: '/portal'
|
|
118
|
+
preLoaderRoute: typeof AppPortalRouteImport
|
|
119
|
+
parentRoute: typeof rootRouteImport
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const rootRouteChildren: RootRouteChildren = {
|
|
125
|
+
IndexRoute,
|
|
126
|
+
GuideRoute,
|
|
127
|
+
AuthLoginRoute,
|
|
128
|
+
AppPortalRoute,
|
|
129
|
+
UnauthorizedRoute,
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export const routeTree = rootRouteImport
|
|
133
|
+
._addFileChildren(rootRouteChildren)
|
|
134
|
+
._addFileTypes<FileRouteTypes>()
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRootRouteWithContext } from '@tanstack/react-router'
|
|
2
|
+
|
|
3
|
+
import AppLayoutWrapper from '@/components/Layouts/AppLayoutWrapper'
|
|
4
|
+
import { Provider } from '@/integrations/tanstack-query/root-provider'
|
|
5
|
+
|
|
6
|
+
export const Route = createRootRouteWithContext()({
|
|
7
|
+
component: () => (
|
|
8
|
+
<Provider>
|
|
9
|
+
<AppLayoutWrapper />
|
|
10
|
+
</Provider>
|
|
11
|
+
),
|
|
12
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { StarterProtectedPage } from '@/features/starter/components/starter-protected-page'
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/_app/portal')({
|
|
5
|
+
component: StarterProtectedPage,
|
|
6
|
+
beforeLoad: () => ({
|
|
7
|
+
layout: 'MainLayout' as const,
|
|
8
|
+
requiresAuth: true,
|
|
9
|
+
}),
|
|
10
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { StarterLogin } from '@/features/auth/components/starter-login'
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/_auth/login')({
|
|
5
|
+
component: StarterLogin,
|
|
6
|
+
beforeLoad: () => ({
|
|
7
|
+
layout: 'AuthLayout' as const,
|
|
8
|
+
requiresAuth: false,
|
|
9
|
+
}),
|
|
10
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { StarterGuidePage } from '@/features/starter/components/starter-guide-page'
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/guide')({
|
|
5
|
+
component: StarterGuidePage,
|
|
6
|
+
beforeLoad: () => ({
|
|
7
|
+
layout: 'MainLayout' as const,
|
|
8
|
+
}),
|
|
9
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createFileRoute, useNavigate, useRouter } from '@tanstack/react-router'
|
|
2
|
+
import { useEffect } from 'react'
|
|
3
|
+
import { Button } from '@/components/ui/Button'
|
|
4
|
+
import { Routes } from '@/config/routes'
|
|
5
|
+
import { readPersistedAuthError, WP_STORAGE_KEYS } from 'woodsportal-client-sdk'
|
|
6
|
+
import { clearClientAuthSession } from '@/features/auth/clear-client-auth-session'
|
|
7
|
+
import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
|
|
8
|
+
|
|
9
|
+
function Unauthorized() {
|
|
10
|
+
const router = useRouter()
|
|
11
|
+
const navigate = useNavigate()
|
|
12
|
+
const inCmsEditor = isHubSpotCmsEditor()
|
|
13
|
+
const authError = readPersistedAuthError()
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (authError != null) {
|
|
17
|
+
clearClientAuthSession()
|
|
18
|
+
} else if (!inCmsEditor) {
|
|
19
|
+
router.navigate({ to: Routes.guide })
|
|
20
|
+
}
|
|
21
|
+
}, [authError, inCmsEditor, router])
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
return () => {
|
|
25
|
+
sessionStorage.removeItem(WP_STORAGE_KEYS.c.auth.err)
|
|
26
|
+
}
|
|
27
|
+
}, [])
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex min-h-screen items-center justify-center p-4">
|
|
31
|
+
<div className="w-full max-w-md rounded-lg border border-gray-200 bg-white p-6 text-center shadow-sm">
|
|
32
|
+
<h1 className="mb-2 text-xl font-semibold">401 Unauthorized</h1>
|
|
33
|
+
<p className="mb-6 text-sm text-gray-600">
|
|
34
|
+
{authError?.errorMessage ??
|
|
35
|
+
'Your session may have expired. Please sign in again to continue.'}
|
|
36
|
+
</p>
|
|
37
|
+
<Button className="w-full" onClick={() => navigate({ to: Routes.login })}>
|
|
38
|
+
Go to login
|
|
39
|
+
</Button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Route = createFileRoute('/unauthorized')({
|
|
46
|
+
component: Unauthorized,
|
|
47
|
+
beforeLoad: () => ({
|
|
48
|
+
layout: 'UnauthorizedLayout' as const,
|
|
49
|
+
}),
|
|
50
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isProtectedHashPath as skipCurrentPublicPath } from '@/features/auth/auth-route-paths'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { env } from '@/env'
|
|
2
|
+
|
|
3
|
+
const COOKIE_KEYS = [
|
|
4
|
+
env.VITE_LOGIN_DETAILS,
|
|
5
|
+
env.VITE_REFRESH_TOKEN,
|
|
6
|
+
env.VITE_PORTAL,
|
|
7
|
+
env.VITE_SUBSCRIPTION_TYPE,
|
|
8
|
+
env.VITE_AUTH_USER_KEY,
|
|
9
|
+
env.VITE_PAGINATION_DATA,
|
|
10
|
+
env.VITE_ROUTE_MENU_CONFIG_KEY,
|
|
11
|
+
env.VITE_ASSOCIATION_VIEW_URL_KEY,
|
|
12
|
+
env.VITE_AUTH_TOKEN_KEY,
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
export function clearClientAuthCookies(): void {
|
|
16
|
+
if (typeof document === 'undefined') {
|
|
17
|
+
return
|
|
18
|
+
}
|
|
19
|
+
for (const name of COOKIE_KEYS) {
|
|
20
|
+
document.cookie = `${name}=; Max-Age=0; path=/`
|
|
21
|
+
document.cookie = `${name}=; Max-Age=0; path=/; domain=${window.location.hostname}`
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Routes } from '@/config/routes'
|
|
2
|
+
|
|
3
|
+
export function normalizeRouterPath(path: string): string {
|
|
4
|
+
const trimmed = (path ?? '').trim()
|
|
5
|
+
if (!trimmed || trimmed === '/') {
|
|
6
|
+
return Routes.app
|
|
7
|
+
}
|
|
8
|
+
const withLeadingSlash = trimmed.startsWith('/') ? trimmed : `/${trimmed}`
|
|
9
|
+
return withLeadingSlash.replace(/\/{2,}/g, '/')
|
|
10
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react'
|
|
2
|
+
import { useRouter } from '@tanstack/react-router'
|
|
3
|
+
import Loader from '@/components/ui/loader/loader'
|
|
4
|
+
import { Routes } from '@/config/routes'
|
|
5
|
+
import { isPublicAuthRoute } from '@/features/auth/auth-route-paths'
|
|
6
|
+
import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
|
|
7
|
+
import { api, resolveAuthRouteAction } from '@/integrations/woodsportal-sdk'
|
|
8
|
+
import { useAuthSessionRevision } from '@/features/auth/use-portal-session'
|
|
9
|
+
import { navigateToLogin, navigateToMfaGate } from '@/features/auth/auth-navigation'
|
|
10
|
+
import { isMfaPendingSession } from '@/features/auth/auth-session'
|
|
11
|
+
|
|
12
|
+
const SESSION_RESTORE_LOADER_MS = 5_000
|
|
13
|
+
|
|
14
|
+
function redirectUnauthenticatedToLogin(
|
|
15
|
+
router: ReturnType<typeof useRouter>,
|
|
16
|
+
inCmsEditor: boolean,
|
|
17
|
+
): void {
|
|
18
|
+
const currentPath = router?.state?.location?.pathname
|
|
19
|
+
if (inCmsEditor) {
|
|
20
|
+
navigateToLogin(router)
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
const redirectPath =
|
|
24
|
+
currentPath !== Routes.login ? `?r=${router?.state?.location?.href}` : ''
|
|
25
|
+
navigateToLogin(router, `${Routes.login}${redirectPath}`)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const PrivateRoute: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
|
29
|
+
const router = useRouter()
|
|
30
|
+
const sessionRevision = useAuthSessionRevision()
|
|
31
|
+
const inCmsEditor = isHubSpotCmsEditor()
|
|
32
|
+
const sessionRefreshExhausted = api.auth.session.isSessionRefreshExhausted?.() ?? false
|
|
33
|
+
const refreshInFlight = api.auth.session.isRefreshInFlight?.() ?? false
|
|
34
|
+
const hasRefreshHint = api.auth.session.hasRefreshSession()
|
|
35
|
+
const hasValidAccess = api.auth.session.hasValidAccessToken()
|
|
36
|
+
|
|
37
|
+
const sessionRestoring =
|
|
38
|
+
!sessionRefreshExhausted && refreshInFlight && hasRefreshHint && !hasValidAccess
|
|
39
|
+
|
|
40
|
+
const [restoreLoaderTimedOut, setRestoreLoaderTimedOut] = useState(false)
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!sessionRestoring) {
|
|
44
|
+
setRestoreLoaderTimedOut(false)
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
const id = window.setTimeout(() => setRestoreLoaderTimedOut(true), SESSION_RESTORE_LOADER_MS)
|
|
48
|
+
return () => window.clearTimeout(id)
|
|
49
|
+
}, [sessionRestoring])
|
|
50
|
+
|
|
51
|
+
const effectiveSessionRestoring = sessionRestoring && !restoreLoaderTimedOut
|
|
52
|
+
|
|
53
|
+
const routeAction = useMemo(() => {
|
|
54
|
+
const currentPath = router?.state?.location?.pathname
|
|
55
|
+
const session = api.auth.session.contract()
|
|
56
|
+
return resolveAuthRouteAction({
|
|
57
|
+
pathname: currentPath,
|
|
58
|
+
isPublicAuthRoute,
|
|
59
|
+
session: {
|
|
60
|
+
...session,
|
|
61
|
+
isMfaPending: () => isMfaPendingSession(),
|
|
62
|
+
},
|
|
63
|
+
mfaRoute: Routes.twoFa,
|
|
64
|
+
previewMode: false,
|
|
65
|
+
sessionRestoring: effectiveSessionRestoring,
|
|
66
|
+
sessionRefreshExhausted,
|
|
67
|
+
})
|
|
68
|
+
}, [
|
|
69
|
+
router,
|
|
70
|
+
sessionRefreshExhausted,
|
|
71
|
+
effectiveSessionRestoring,
|
|
72
|
+
sessionRevision,
|
|
73
|
+
refreshInFlight,
|
|
74
|
+
hasRefreshHint,
|
|
75
|
+
hasValidAccess,
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
useEffect((): void => {
|
|
79
|
+
if (routeAction.kind === 'redirect_mfa') {
|
|
80
|
+
navigateToMfaGate(router)
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
if (
|
|
84
|
+
routeAction.kind === 'redirect_login' ||
|
|
85
|
+
(routeAction.kind === 'show_loader' && restoreLoaderTimedOut)
|
|
86
|
+
) {
|
|
87
|
+
redirectUnauthenticatedToLogin(router, inCmsEditor)
|
|
88
|
+
}
|
|
89
|
+
}, [routeAction, router, inCmsEditor, restoreLoaderTimedOut])
|
|
90
|
+
|
|
91
|
+
if (routeAction.kind === 'allow') {
|
|
92
|
+
return <>{children}</>
|
|
93
|
+
}
|
|
94
|
+
if (routeAction.kind === 'show_loader' && !restoreLoaderTimedOut) {
|
|
95
|
+
return <Loader showText={false} />
|
|
96
|
+
}
|
|
97
|
+
return null
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default PrivateRoute
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { useLayoutEffect } from 'react'
|
|
2
|
+
import { useRouter, useRouterState } from '@tanstack/react-router'
|
|
3
|
+
import Loader from '@/components/ui/loader/loader'
|
|
4
|
+
import { Routes } from '@/config/routes'
|
|
5
|
+
import { isPublicAuthRoute } from '@/features/auth/auth-route-paths'
|
|
6
|
+
import {
|
|
7
|
+
isRouterAtPath,
|
|
8
|
+
navigateAfterFullAuth,
|
|
9
|
+
navigateToLogin,
|
|
10
|
+
navigateToMfaGate,
|
|
11
|
+
} from '@/features/auth/auth-navigation'
|
|
12
|
+
import { resolvePostLoginPath } from '@/features/auth/resolve-post-login-path'
|
|
13
|
+
import {
|
|
14
|
+
useAuthSessionRevision,
|
|
15
|
+
useIsMfaPendingSession,
|
|
16
|
+
usePortalSession,
|
|
17
|
+
} from '@/features/auth/use-portal-session'
|
|
18
|
+
import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
|
|
19
|
+
|
|
20
|
+
const PublicRoute: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
|
21
|
+
const router = useRouter()
|
|
22
|
+
const routeState = useRouterState()
|
|
23
|
+
const currentRoute = routeState.location.pathname
|
|
24
|
+
const isAuthenticated = usePortalSession()
|
|
25
|
+
const isMfaPending = useIsMfaPendingSession()
|
|
26
|
+
const sessionRevision = useAuthSessionRevision()
|
|
27
|
+
const inCmsEditor = isHubSpotCmsEditor()
|
|
28
|
+
const postLoginTarget = resolvePostLoginPath(router)
|
|
29
|
+
|
|
30
|
+
useLayoutEffect(() => {
|
|
31
|
+
const isPublicPath = isPublicAuthRoute(currentRoute)
|
|
32
|
+
|
|
33
|
+
if (isMfaPending && currentRoute !== Routes.twoFa) {
|
|
34
|
+
navigateToMfaGate(router)
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!isAuthenticated && !isMfaPending && !isPublicPath) {
|
|
39
|
+
navigateToLogin(router)
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (isAuthenticated && isPublicPath && !(inCmsEditor && currentRoute === Routes.twoFa)) {
|
|
44
|
+
navigateAfterFullAuth(router)
|
|
45
|
+
}
|
|
46
|
+
}, [router, isAuthenticated, isMfaPending, inCmsEditor, currentRoute, sessionRevision])
|
|
47
|
+
|
|
48
|
+
if (isMfaPending) {
|
|
49
|
+
return currentRoute === Routes.twoFa ? <>{children}</> : <Loader showText={false} />
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (isAuthenticated && isPublicAuthRoute(currentRoute)) {
|
|
53
|
+
return isRouterAtPath(router, postLoginTarget) ? <>{children}</> : <Loader showText={false} />
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (!isAuthenticated) {
|
|
57
|
+
return <>{children}</>
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Authenticated on a general public page (e.g. /guide) — no redirect gate.
|
|
61
|
+
return <>{children}</>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default PublicRoute
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { env } from '@/env'
|
|
2
|
+
|
|
3
|
+
type HubSpotRuntimeData = {
|
|
4
|
+
developerOption?: boolean
|
|
5
|
+
developerOptionTempUrl?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type HubSpotRuntimeWindow = Window & {
|
|
9
|
+
hubSpotData?: HubSpotRuntimeData
|
|
10
|
+
/** Module-config live exports in `wp dev` / `yarn local` (see wphs.adapter.ts). */
|
|
11
|
+
__WPHS_DATA__?: HubSpotRuntimeData
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function readHubSpotRuntimeData(): HubSpotRuntimeData | undefined {
|
|
15
|
+
if (typeof window === 'undefined') {
|
|
16
|
+
return undefined
|
|
17
|
+
}
|
|
18
|
+
const win = window as HubSpotRuntimeWindow
|
|
19
|
+
return win.hubSpotData ?? win.__WPHS_DATA__
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* API host for woodsportal-client-sdk.
|
|
24
|
+
* Priority: developer temp URL (HubSpot embed) → `VITE_PUBLIC_REST_API_ENDPOINT`.
|
|
25
|
+
* WoodsCLI dev (`__WPHS_DATA__` without HubL `hubSpotData`) always uses the Vite env URL.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveWoodsPortalApiBaseUrl(
|
|
28
|
+
hubSpotData: HubSpotRuntimeData | undefined = readHubSpotRuntimeData(),
|
|
29
|
+
): string {
|
|
30
|
+
const envApi = env.VITE_PUBLIC_REST_API_ENDPOINT
|
|
31
|
+
|
|
32
|
+
if (import.meta.env.DEV && typeof window !== 'undefined') {
|
|
33
|
+
const win = window as HubSpotRuntimeWindow
|
|
34
|
+
if (win.__WPHS_DATA__ != null && win.hubSpotData == null) {
|
|
35
|
+
return envApi
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (hubSpotData?.developerOption === true && hubSpotData.developerOptionTempUrl) {
|
|
40
|
+
return hubSpotData.developerOptionTempUrl
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return envApi
|
|
44
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type SafeAuthRouter = {
|
|
2
|
+
navigate: (opts: { to: string; replace?: boolean }) => void | Promise<void>
|
|
3
|
+
history?: { replace: (path: string) => unknown }
|
|
4
|
+
state?: { location?: { pathname?: string; href?: string } }
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const NAVIGATION_WAIT_MS = 2500
|
|
8
|
+
|
|
9
|
+
const PATHNAME_VERIFY_DELAY_MS = 100
|
|
10
|
+
|
|
11
|
+
export function hashPath(path: string): string {
|
|
12
|
+
const trimmed = (path ?? '').trim()
|
|
13
|
+
if (!trimmed) {
|
|
14
|
+
return '#/'
|
|
15
|
+
}
|
|
16
|
+
if (trimmed.startsWith('#')) {
|
|
17
|
+
return trimmed
|
|
18
|
+
}
|
|
19
|
+
return trimmed.startsWith('/') ? `#${trimmed}` : `#/${trimmed}`
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function syncHashToPath(path: string): void {
|
|
23
|
+
if (typeof window === 'undefined') {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
const expectedHash = hashPath(path)
|
|
27
|
+
if (window.location.hash !== expectedHash) {
|
|
28
|
+
window.location.hash = expectedHash
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function raceNavigation(
|
|
33
|
+
router: SafeAuthRouter,
|
|
34
|
+
target: string,
|
|
35
|
+
timeoutMs: number = NAVIGATION_WAIT_MS,
|
|
36
|
+
): Promise<void> {
|
|
37
|
+
await Promise.race([
|
|
38
|
+
Promise.resolve(router.navigate({ to: target, replace: true })).catch(() => undefined),
|
|
39
|
+
new Promise<void>((resolve) => window.setTimeout(resolve, timeoutMs)),
|
|
40
|
+
])
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function historyReplaceFirstNavigate(
|
|
44
|
+
router: SafeAuthRouter,
|
|
45
|
+
target: string,
|
|
46
|
+
): Promise<void> {
|
|
47
|
+
const normalized = target.trim()
|
|
48
|
+
if (!normalized) {
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
router.history?.replace(normalized)
|
|
53
|
+
} catch {
|
|
54
|
+
// fall through
|
|
55
|
+
}
|
|
56
|
+
await raceNavigation(router, normalized, NAVIGATION_WAIT_MS)
|
|
57
|
+
syncHashToPath(normalized)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function hardReplaceToHashPath(target: string): void {
|
|
61
|
+
if (typeof window === 'undefined') {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
const hash = hashPath(target)
|
|
65
|
+
window.location.replace(`${window.location.pathname}${hash}`)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function readRouterPathname(router: SafeAuthRouter): string {
|
|
69
|
+
return router.state?.location?.pathname ?? ''
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function readHashPathname(): string {
|
|
73
|
+
if (typeof window === 'undefined') {
|
|
74
|
+
return ''
|
|
75
|
+
}
|
|
76
|
+
const raw = window.location.hash.replace(/^#/, '').split('?')[0]
|
|
77
|
+
return raw || '/'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function safeRouterReplace(router: SafeAuthRouter, path: string): void {
|
|
81
|
+
void historyReplaceFirstNavigate(router, path.trim())
|
|
82
|
+
}
|