@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
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import { Link } from '@tanstack/react-router'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { starterNavItems } from '@/config/starter-nav'
|
|
4
4
|
|
|
5
5
|
export function StarterNav() {
|
|
6
6
|
return (
|
|
7
7
|
<header className="border-b border-[#cbd6e2] bg-white/90 backdrop-blur">
|
|
8
8
|
<div className="mx-auto flex max-w-4xl items-center justify-between gap-4 px-6 py-3 sm:px-10">
|
|
9
9
|
<span className="text-sm font-semibold text-[#0091ae]">WoodsCLI starter</span>
|
|
10
|
-
<nav className="flex gap-4 text-sm font-medium">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
>
|
|
22
|
-
Developer guide
|
|
23
|
-
</Link>
|
|
10
|
+
<nav className="flex flex-wrap gap-4 text-sm font-medium">
|
|
11
|
+
{starterNavItems.map((item) => (
|
|
12
|
+
<Link
|
|
13
|
+
key={item.to}
|
|
14
|
+
to={item.to}
|
|
15
|
+
className="text-[#516f90] hover:text-[#0091ae] [&.active]:text-[#0091ae]"
|
|
16
|
+
activeOptions={{ exact: item.to === '/' }}
|
|
17
|
+
>
|
|
18
|
+
{item.label}
|
|
19
|
+
</Link>
|
|
20
|
+
))}
|
|
24
21
|
</nav>
|
|
25
22
|
</div>
|
|
26
23
|
</header>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ROUTES } from '@/config/routes'
|
|
2
|
+
|
|
3
|
+
/** No-auth module navigation — edit once; StarterNav reads this file. */
|
|
4
|
+
export const starterNavItems = [
|
|
5
|
+
{ to: ROUTES.home, label: 'Home' },
|
|
6
|
+
{ to: ROUTES.guide, label: 'Developer guide' },
|
|
7
|
+
] as const
|
|
8
|
+
|
|
9
|
+
export type StarterNavItem = (typeof starterNavItems)[number]
|
|
@@ -2,35 +2,33 @@ import { useStarterPreview } from '../hooks/use-starter-preview'
|
|
|
2
2
|
import { STARTER_FEATURES, WOODSCLI_ABOUT } from '../content/woodscli-guide-content'
|
|
3
3
|
|
|
4
4
|
export function StarterHome() {
|
|
5
|
-
const { title, tagline, showFeatureCards,
|
|
5
|
+
const { title, tagline, showFeatureCards, heroStyle } = useStarterPreview()
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
8
|
<>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</section>
|
|
33
|
-
</div>
|
|
9
|
+
<section
|
|
10
|
+
className={
|
|
11
|
+
heroStyle === 'minimal'
|
|
12
|
+
? 'px-6 py-14 sm:px-10 sm:py-16 bg-[var(--mc-bg-shell,#f5f8fa)] text-[var(--mc-text,#33475b)] border-b border-[var(--mc-border,#cbd6e2)]'
|
|
13
|
+
: heroStyle === 'bold'
|
|
14
|
+
? 'px-6 py-14 sm:px-10 sm:py-16 bg-[#1c1c1f] text-white'
|
|
15
|
+
: 'px-6 py-14 sm:px-10 sm:py-16 bg-gradient-to-br from-[var(--primary-color,#FF7A59)] to-[var(--secondary-color,#2797AF)] text-white'
|
|
16
|
+
}
|
|
17
|
+
>
|
|
18
|
+
<div className="mx-auto max-w-4xl">
|
|
19
|
+
<p className="mb-2 text-xs font-semibold uppercase tracking-widest opacity-80">
|
|
20
|
+
{WOODSCLI_ABOUT.package} · local dev
|
|
21
|
+
</p>
|
|
22
|
+
<h1 className="text-3xl font-semibold tracking-tight sm:text-4xl">{title}</h1>
|
|
23
|
+
<p className="mt-4 max-w-2xl text-base leading-relaxed opacity-90 sm:text-lg">{tagline}</p>
|
|
24
|
+
<p className="mt-6 text-sm opacity-75">
|
|
25
|
+
Module config overlay:{' '}
|
|
26
|
+
<kbd className="rounded bg-black/10 px-1.5 py-0.5 font-mono text-xs">Ctrl+Shift+Z</kbd>
|
|
27
|
+
{' · '}
|
|
28
|
+
Mac: <kbd className="rounded bg-black/10 px-1.5 py-0.5 font-mono text-xs">⌃⇧Z</kbd>
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
</section>
|
|
34
32
|
|
|
35
33
|
{showFeatureCards ? (
|
|
36
34
|
<div className="mx-auto grid max-w-4xl gap-4 px-6 py-10 sm:grid-cols-3 sm:px-10">
|
|
@@ -39,7 +37,7 @@ export function StarterHome() {
|
|
|
39
37
|
key={feature.title}
|
|
40
38
|
className="rounded-lg border border-[#cbd6e2] bg-white p-5 shadow-sm"
|
|
41
39
|
>
|
|
42
|
-
<h2 className="text-sm font-semibold text-[
|
|
40
|
+
<h2 className="text-sm font-semibold text-[var(--primary-color,#FF7A59)]">{feature.title}</h2>
|
|
43
41
|
<p className="mt-2 text-sm leading-relaxed text-[#516f90]">{feature.body}</p>
|
|
44
42
|
</article>
|
|
45
43
|
))}
|
|
@@ -2,7 +2,6 @@ export type StarterPreviewValues = {
|
|
|
2
2
|
title: string
|
|
3
3
|
tagline: string
|
|
4
4
|
showFeatureCards: boolean
|
|
5
|
-
accentColor: string
|
|
6
5
|
heroStyle: 'gradient' | 'minimal' | 'bold'
|
|
7
6
|
}
|
|
8
7
|
|
|
@@ -21,8 +20,12 @@ function readContentField(module: Record<string, unknown>, key: string): unknown
|
|
|
21
20
|
return module[key]
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
/** STYLE-tab fields may live under a `
|
|
23
|
+
/** STYLE-tab fields may live under a `style` group (fields.json) or legacy `styles` / flat keys. */
|
|
25
24
|
function readStyleField(module: Record<string, unknown>, key: string): unknown {
|
|
25
|
+
const style = module.style
|
|
26
|
+
if (style && typeof style === 'object' && key in (style as Record<string, unknown>)) {
|
|
27
|
+
return (style as Record<string, unknown>)[key]
|
|
28
|
+
}
|
|
26
29
|
const styles = module.styles
|
|
27
30
|
if (styles && typeof styles === 'object' && key in (styles as Record<string, unknown>)) {
|
|
28
31
|
return (styles as Record<string, unknown>)[key]
|
|
@@ -31,8 +34,6 @@ function readStyleField(module: Record<string, unknown>, key: string): unknown {
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export function mapStarterPreviewValues(module: Record<string, unknown>): StarterPreviewValues {
|
|
34
|
-
const accent = readStyleField(module, 'accent_color') as { color?: string } | undefined
|
|
35
|
-
|
|
36
37
|
return {
|
|
37
38
|
title: String(readContentField(module, 'title') ?? 'My HubSpot Portal'),
|
|
38
39
|
tagline: String(
|
|
@@ -40,7 +41,6 @@ export function mapStarterPreviewValues(module: Record<string, unknown>): Starte
|
|
|
40
41
|
'Customize this preview with Ctrl+Shift+Z, then replace this page with your portal app.',
|
|
41
42
|
),
|
|
42
43
|
showFeatureCards: readContentField(module, 'show_feature_cards') !== false,
|
|
43
|
-
accentColor: accent?.color ?? '#0091ae',
|
|
44
44
|
heroStyle: normalizeHeroStyle(readStyleField(module, 'hero_style')),
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -24,15 +24,58 @@
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
"type": "group",
|
|
27
|
-
"name": "
|
|
28
|
-
"label": "
|
|
27
|
+
"name": "style",
|
|
28
|
+
"label": "Style",
|
|
29
29
|
"tab": "STYLE",
|
|
30
30
|
"children": [
|
|
31
31
|
{
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
32
|
+
"type": "group",
|
|
33
|
+
"name": "module_global_colors",
|
|
34
|
+
"label": "Module Global Colors",
|
|
35
|
+
"tab": "STYLE",
|
|
36
|
+
"children": [
|
|
37
|
+
{
|
|
38
|
+
"name": "primary_color",
|
|
39
|
+
"label": "Primary Color",
|
|
40
|
+
"type": "color",
|
|
41
|
+
"default": {
|
|
42
|
+
"color": "#FF7A59",
|
|
43
|
+
"opacity": 100
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "secondary_color",
|
|
48
|
+
"label": "Secondary Color",
|
|
49
|
+
"type": "color",
|
|
50
|
+
"default": {
|
|
51
|
+
"color": "#2797AF",
|
|
52
|
+
"opacity": 100
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "button_text_color",
|
|
57
|
+
"label": "Button Text Color",
|
|
58
|
+
"type": "color",
|
|
59
|
+
"default": {
|
|
60
|
+
"color": "#FFFFFF",
|
|
61
|
+
"opacity": 100
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"default": {
|
|
66
|
+
"primary_color": {
|
|
67
|
+
"color": "#FF7A59",
|
|
68
|
+
"opacity": 100
|
|
69
|
+
},
|
|
70
|
+
"secondary_color": {
|
|
71
|
+
"color": "#2797AF",
|
|
72
|
+
"opacity": 100
|
|
73
|
+
},
|
|
74
|
+
"button_text_color": {
|
|
75
|
+
"color": "#FFFFFF",
|
|
76
|
+
"opacity": 100
|
|
77
|
+
}
|
|
78
|
+
}
|
|
36
79
|
},
|
|
37
80
|
{
|
|
38
81
|
"name": "hero_style",
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
@import 'tailwindcss';
|
|
2
2
|
|
|
3
|
+
/* WoodsPortal module global colors — defaults until HubSpot fields / module-config apply overrides */
|
|
4
|
+
:root {
|
|
5
|
+
--primary-color: #ff7a59;
|
|
6
|
+
--secondary-color: #2797af;
|
|
7
|
+
--button-text-color: #ffffff;
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
/* Kit dev-module-config — paths relative to this file (src/assets/css/) */
|
|
4
11
|
@source '../../../.wphs/.kit-module-config/**/*.{ts,tsx}';
|
|
5
12
|
@source '../../../.wphs/.kit-bootstrap.tsx';
|
|
@@ -1,26 +1,23 @@
|
|
|
1
1
|
import { Link } from '@tanstack/react-router'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { starterNavItems } from '@/config/starter-nav'
|
|
4
4
|
|
|
5
5
|
export function StarterNav() {
|
|
6
6
|
return (
|
|
7
7
|
<header className="border-b border-[#cbd6e2] bg-white/90 backdrop-blur">
|
|
8
8
|
<div className="mx-auto flex max-w-4xl items-center justify-between gap-4 px-6 py-3 sm:px-10">
|
|
9
9
|
<span className="text-sm font-semibold text-[#0091ae]">WoodsCLI starter</span>
|
|
10
|
-
<nav className="flex gap-4 text-sm font-medium">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
>
|
|
22
|
-
Developer guide
|
|
23
|
-
</Link>
|
|
10
|
+
<nav className="flex flex-wrap gap-4 text-sm font-medium">
|
|
11
|
+
{starterNavItems.map((item) => (
|
|
12
|
+
<Link
|
|
13
|
+
key={item.to}
|
|
14
|
+
to={item.to}
|
|
15
|
+
className="text-[#516f90] hover:text-[#0091ae] [&.active]:text-[#0091ae]"
|
|
16
|
+
activeOptions={{ exact: item.to === '/' }}
|
|
17
|
+
>
|
|
18
|
+
{item.label}
|
|
19
|
+
</Link>
|
|
20
|
+
))}
|
|
24
21
|
</nav>
|
|
25
22
|
</div>
|
|
26
23
|
</header>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ROUTES } from '@/config/routes'
|
|
2
|
+
|
|
3
|
+
/** No-auth module navigation — edit once; StarterNav reads this file. */
|
|
4
|
+
export const starterNavItems = [
|
|
5
|
+
{ to: ROUTES.home, label: 'Home' },
|
|
6
|
+
{ to: ROUTES.guide, label: 'Developer guide' },
|
|
7
|
+
] as const
|
|
8
|
+
|
|
9
|
+
export type StarterNavItem = (typeof starterNavItems)[number]
|
|
@@ -2,35 +2,33 @@ import { useStarterPreview } from '../hooks/use-starter-preview'
|
|
|
2
2
|
import { STARTER_FEATURES, WOODSCLI_ABOUT } from '../content/woodscli-guide-content'
|
|
3
3
|
|
|
4
4
|
export function StarterHome() {
|
|
5
|
-
const { title, tagline, showFeatureCards,
|
|
5
|
+
const { title, tagline, showFeatureCards, heroStyle } = useStarterPreview()
|
|
6
6
|
|
|
7
7
|
return (
|
|
8
8
|
<>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
>
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</section>
|
|
33
|
-
</div>
|
|
9
|
+
<section
|
|
10
|
+
className={
|
|
11
|
+
heroStyle === 'minimal'
|
|
12
|
+
? 'px-6 py-14 sm:px-10 sm:py-16 bg-[var(--mc-bg-shell,#f5f8fa)] text-[var(--mc-text,#33475b)] border-b border-[var(--mc-border,#cbd6e2)]'
|
|
13
|
+
: heroStyle === 'bold'
|
|
14
|
+
? 'px-6 py-14 sm:px-10 sm:py-16 bg-[#1c1c1f] text-white'
|
|
15
|
+
: 'px-6 py-14 sm:px-10 sm:py-16 bg-gradient-to-br from-[var(--primary-color,#FF7A59)] to-[var(--secondary-color,#2797AF)] text-white'
|
|
16
|
+
}
|
|
17
|
+
>
|
|
18
|
+
<div className="mx-auto max-w-4xl">
|
|
19
|
+
<p className="mb-2 text-xs font-semibold uppercase tracking-widest opacity-80">
|
|
20
|
+
{WOODSCLI_ABOUT.package} · local dev
|
|
21
|
+
</p>
|
|
22
|
+
<h1 className="text-3xl font-semibold tracking-tight sm:text-4xl">{title}</h1>
|
|
23
|
+
<p className="mt-4 max-w-2xl text-base leading-relaxed opacity-90 sm:text-lg">{tagline}</p>
|
|
24
|
+
<p className="mt-6 text-sm opacity-75">
|
|
25
|
+
Module config overlay:{' '}
|
|
26
|
+
<kbd className="rounded bg-black/10 px-1.5 py-0.5 font-mono text-xs">Ctrl+Shift+Z</kbd>
|
|
27
|
+
{' · '}
|
|
28
|
+
Mac: <kbd className="rounded bg-black/10 px-1.5 py-0.5 font-mono text-xs">⌃⇧Z</kbd>
|
|
29
|
+
</p>
|
|
30
|
+
</div>
|
|
31
|
+
</section>
|
|
34
32
|
|
|
35
33
|
{showFeatureCards ? (
|
|
36
34
|
<div className="mx-auto grid max-w-4xl gap-4 px-6 py-10 sm:grid-cols-3 sm:px-10">
|
|
@@ -39,7 +37,7 @@ export function StarterHome() {
|
|
|
39
37
|
key={feature.title}
|
|
40
38
|
className="rounded-lg border border-[#cbd6e2] bg-white p-5 shadow-sm"
|
|
41
39
|
>
|
|
42
|
-
<h2 className="text-sm font-semibold text-[
|
|
40
|
+
<h2 className="text-sm font-semibold text-[var(--primary-color,#FF7A59)]">{feature.title}</h2>
|
|
43
41
|
<p className="mt-2 text-sm leading-relaxed text-[#516f90]">{feature.body}</p>
|
|
44
42
|
</article>
|
|
45
43
|
))}
|
|
@@ -2,7 +2,6 @@ export type StarterPreviewValues = {
|
|
|
2
2
|
title: string
|
|
3
3
|
tagline: string
|
|
4
4
|
showFeatureCards: boolean
|
|
5
|
-
accentColor: string
|
|
6
5
|
heroStyle: 'gradient' | 'minimal' | 'bold'
|
|
7
6
|
}
|
|
8
7
|
|
|
@@ -21,8 +20,12 @@ function readContentField(module: Record<string, unknown>, key: string): unknown
|
|
|
21
20
|
return module[key]
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
/** STYLE-tab fields may live under a `
|
|
23
|
+
/** STYLE-tab fields may live under a `style` group (fields.json) or legacy `styles` / flat keys. */
|
|
25
24
|
function readStyleField(module: Record<string, unknown>, key: string): unknown {
|
|
25
|
+
const style = module.style
|
|
26
|
+
if (style && typeof style === 'object' && key in (style as Record<string, unknown>)) {
|
|
27
|
+
return (style as Record<string, unknown>)[key]
|
|
28
|
+
}
|
|
26
29
|
const styles = module.styles
|
|
27
30
|
if (styles && typeof styles === 'object' && key in (styles as Record<string, unknown>)) {
|
|
28
31
|
return (styles as Record<string, unknown>)[key]
|
|
@@ -31,8 +34,6 @@ function readStyleField(module: Record<string, unknown>, key: string): unknown {
|
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
export function mapStarterPreviewValues(module: Record<string, unknown>): StarterPreviewValues {
|
|
34
|
-
const accent = readStyleField(module, 'accent_color') as { color?: string } | undefined
|
|
35
|
-
|
|
36
37
|
return {
|
|
37
38
|
title: String(readContentField(module, 'title') ?? 'My HubSpot Portal'),
|
|
38
39
|
tagline: String(
|
|
@@ -40,7 +41,6 @@ export function mapStarterPreviewValues(module: Record<string, unknown>): Starte
|
|
|
40
41
|
'Customize this preview with Ctrl+Shift+Z, then replace this page with your portal app.',
|
|
41
42
|
),
|
|
42
43
|
showFeatureCards: readContentField(module, 'show_feature_cards') !== false,
|
|
43
|
-
accentColor: accent?.color ?? '#0091ae',
|
|
44
44
|
heroStyle: normalizeHeroStyle(readStyleField(module, 'hero_style')),
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { useEffect, useRef, useState } from 'react'
|
|
2
|
+
import { RouterProvider } from '@tanstack/react-router'
|
|
3
|
+
import { installCrossTabSessionListener } from 'woodsportal-client-sdk'
|
|
4
|
+
|
|
5
|
+
import { api } from '@/integrations/woodsportal-sdk'
|
|
6
|
+
import * as TanStackQueryProvider from '@/integrations/tanstack-query/root-provider'
|
|
7
|
+
import { env } from '@/env'
|
|
8
|
+
import Loader from '@/components/ui/loader/loader'
|
|
9
|
+
import { skipCurrentPublicPath } from '@/utils/ValidationSchema'
|
|
10
|
+
import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
|
|
11
|
+
import { navigateAfterFullAuth, navigateToLogin } from '@/features/auth/auth-navigation'
|
|
12
|
+
import { isProtectedHashPath, readHashPathname, isPublicAuthRoute } from '@/features/auth/auth-route-paths'
|
|
13
|
+
import { hardReplaceToHashPath } from '@/utils/safe-router-navigation'
|
|
14
|
+
import {
|
|
15
|
+
isFullyAuthenticatedSession,
|
|
16
|
+
isMfaPendingSession,
|
|
17
|
+
recoverMfaGateOnBoot,
|
|
18
|
+
} from '@/features/auth/auth-session'
|
|
19
|
+
import { shouldBootstrapRefreshSession } from '@/features/auth/app-bootstrap-guards'
|
|
20
|
+
import {
|
|
21
|
+
clearClientAuthSession,
|
|
22
|
+
registerClientSessionQueryClear,
|
|
23
|
+
} from '@/features/auth/clear-client-auth-session'
|
|
24
|
+
import { Routes } from '@/config/routes'
|
|
25
|
+
import type { router } from '@/integrations/tanstack-router/router'
|
|
26
|
+
|
|
27
|
+
const BOOTSTRAP_TIMEOUT_MS = 35_000
|
|
28
|
+
|
|
29
|
+
type AppProps = {
|
|
30
|
+
router: typeof router
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function App({ router }: AppProps) {
|
|
34
|
+
const session = api.auth.session
|
|
35
|
+
const [isLoading, setIsLoading] = useState(true)
|
|
36
|
+
const inCmsEditor = isHubSpotCmsEditor()
|
|
37
|
+
const initialBootstrapDone = useRef(false)
|
|
38
|
+
const bootstrapStarted = useRef(false)
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
const queryClient = TanStackQueryProvider.getContext().queryClient
|
|
42
|
+
registerClientSessionQueryClear(() => {
|
|
43
|
+
queryClient.cancelQueries()
|
|
44
|
+
queryClient.clear()
|
|
45
|
+
})
|
|
46
|
+
return installCrossTabSessionListener((kind) => {
|
|
47
|
+
if (kind === 'rev') {
|
|
48
|
+
clearClientAuthSession({ signalCrossTab: false })
|
|
49
|
+
queryClient.cancelQueries()
|
|
50
|
+
queryClient.clear()
|
|
51
|
+
}
|
|
52
|
+
})
|
|
53
|
+
}, [])
|
|
54
|
+
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
if (bootstrapStarted.current) {
|
|
57
|
+
return
|
|
58
|
+
}
|
|
59
|
+
bootstrapStarted.current = true
|
|
60
|
+
|
|
61
|
+
if (!initialBootstrapDone.current) {
|
|
62
|
+
setIsLoading(true)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
let mounted = true
|
|
66
|
+
const { logout } = api.auth.logout({})
|
|
67
|
+
|
|
68
|
+
const redirectProtectedPathToLogin = async (): Promise<void> => {
|
|
69
|
+
if (!skipCurrentPublicPath() || inCmsEditor) {
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
const hashPath = readHashPathname()
|
|
73
|
+
const routerPath = router?.state?.location?.pathname
|
|
74
|
+
const currentPath = routerPath && routerPath !== '/' ? routerPath : hashPath
|
|
75
|
+
const returnHref = router?.state?.location?.href ?? window.location.hash.replace(/^#/, '') ?? ''
|
|
76
|
+
const redirectPath =
|
|
77
|
+
currentPath !== Routes.login ? `?r=${encodeURIComponent(returnHref)}` : ''
|
|
78
|
+
const loginTarget = `${Routes.login}${redirectPath}`
|
|
79
|
+
await navigateToLogin(router, loginTarget)
|
|
80
|
+
if (isProtectedHashPath()) {
|
|
81
|
+
hardReplaceToHashPath(loginTarget)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const teardownAndRedirectToLogin = async (): Promise<void> => {
|
|
86
|
+
clearClientAuthSession()
|
|
87
|
+
try {
|
|
88
|
+
await logout()
|
|
89
|
+
} catch {
|
|
90
|
+
// stale session
|
|
91
|
+
}
|
|
92
|
+
await redirectProtectedPathToLogin()
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const runBootstrap = async (): Promise<void> => {
|
|
96
|
+
await recoverMfaGateOnBoot()
|
|
97
|
+
|
|
98
|
+
const sessionRefreshExhausted = session.isSessionRefreshExhausted?.() ?? false
|
|
99
|
+
const refreshToken = session.getRefreshToken()
|
|
100
|
+
const hasRefresh =
|
|
101
|
+
!sessionRefreshExhausted &&
|
|
102
|
+
Boolean(refreshToken) &&
|
|
103
|
+
!session.isCookieExpired(env.VITE_REFRESH_TOKEN)
|
|
104
|
+
|
|
105
|
+
if (
|
|
106
|
+
!shouldBootstrapRefreshSession({
|
|
107
|
+
isMfaPendingSession: isMfaPendingSession(),
|
|
108
|
+
hasRefresh,
|
|
109
|
+
isPublicAuthRoute: isPublicAuthRoute(readHashPathname()),
|
|
110
|
+
})
|
|
111
|
+
) {
|
|
112
|
+
if (!hasRefresh && skipCurrentPublicPath() && !inCmsEditor) {
|
|
113
|
+
await teardownAndRedirectToLogin()
|
|
114
|
+
}
|
|
115
|
+
return
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
try {
|
|
119
|
+
await session.refreshSession({ force: true })
|
|
120
|
+
} catch {
|
|
121
|
+
if (!inCmsEditor) {
|
|
122
|
+
await teardownAndRedirectToLogin()
|
|
123
|
+
}
|
|
124
|
+
return
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (isFullyAuthenticatedSession()) {
|
|
128
|
+
const hashPath = readHashPathname()
|
|
129
|
+
if (hashPath === Routes.twoFa || hashPath === Routes.login) {
|
|
130
|
+
navigateAfterFullAuth(router)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const bootstrap = async () => {
|
|
136
|
+
try {
|
|
137
|
+
await Promise.race([
|
|
138
|
+
runBootstrap(),
|
|
139
|
+
new Promise<never>((_, reject) => {
|
|
140
|
+
window.setTimeout(() => reject(new Error('bootstrap_timeout')), BOOTSTRAP_TIMEOUT_MS)
|
|
141
|
+
}),
|
|
142
|
+
])
|
|
143
|
+
} catch (error) {
|
|
144
|
+
if (!inCmsEditor && skipCurrentPublicPath()) {
|
|
145
|
+
await teardownAndRedirectToLogin()
|
|
146
|
+
} else if (error instanceof Error && error.message !== 'bootstrap_timeout') {
|
|
147
|
+
throw error
|
|
148
|
+
}
|
|
149
|
+
} finally {
|
|
150
|
+
if (mounted) {
|
|
151
|
+
initialBootstrapDone.current = true
|
|
152
|
+
setIsLoading(false)
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
void bootstrap()
|
|
158
|
+
return () => {
|
|
159
|
+
mounted = false
|
|
160
|
+
}
|
|
161
|
+
}, [inCmsEditor, router])
|
|
162
|
+
|
|
163
|
+
if (isLoading) {
|
|
164
|
+
return <Loader showText={false} />
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<TanStackQueryProvider.Provider>
|
|
169
|
+
<RouterProvider router={router} />
|
|
170
|
+
</TanStackQueryProvider.Provider>
|
|
171
|
+
)
|
|
172
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import {
|
|
2
|
+
api,
|
|
3
|
+
clearMfaPendingAccessToken,
|
|
4
|
+
hydrateMfaPendingAccessToken,
|
|
5
|
+
recoverMfaGateOnBoot as sdkRecoverMfaGateOnBoot,
|
|
6
|
+
} from '@/integrations/woodsportal-sdk'
|
|
7
|
+
import { AUTH_SESSION_CHANGED } from '@/features/auth/auth-session-events'
|
|
8
|
+
import { clearMfaPendingState, getMfaPendingContext } from '@/features/auth/mfa-pending-storage'
|
|
9
|
+
|
|
10
|
+
export function isMfaPendingSession(): boolean {
|
|
11
|
+
return getMfaPendingContext() != null && Boolean(api.auth.session.getAccessToken())
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function isFullyAuthenticatedSession(): boolean {
|
|
15
|
+
if (isMfaPendingSession()) {
|
|
16
|
+
return false
|
|
17
|
+
}
|
|
18
|
+
return api.auth.session.isFullyAuthenticated()
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function clearMfaPendingLoginSession(): void {
|
|
22
|
+
clearMfaPendingState()
|
|
23
|
+
clearMfaPendingAccessToken('c')
|
|
24
|
+
api.auth.session.clearAccessToken()
|
|
25
|
+
if (typeof window !== 'undefined') {
|
|
26
|
+
window.dispatchEvent(new CustomEvent(AUTH_SESSION_CHANGED))
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export type MfaBootRecoveryResult = 'pending' | 'orphan_cleared' | 'stale_token_cleared' | 'none'
|
|
31
|
+
|
|
32
|
+
export async function recoverMfaGateOnBoot(): Promise<MfaBootRecoveryResult> {
|
|
33
|
+
return sdkRecoverMfaGateOnBoot({
|
|
34
|
+
hasMfaContext: () => getMfaPendingContext() != null,
|
|
35
|
+
hasAccessToken: () => Boolean(api.auth.session.getAccessToken()),
|
|
36
|
+
hasRefreshToken: () => Boolean(api.auth.session.getRefreshToken()),
|
|
37
|
+
clearMfaOrphan: () => clearMfaPendingLoginSession(),
|
|
38
|
+
clearStaleAccessToken: () => {
|
|
39
|
+
clearMfaPendingAccessToken('c')
|
|
40
|
+
api.auth.session.clearAccessToken()
|
|
41
|
+
if (typeof window !== 'undefined') {
|
|
42
|
+
window.dispatchEvent(new CustomEvent(AUTH_SESSION_CHANGED))
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
tryHydrateMfaAccessToken: () =>
|
|
46
|
+
hydrateMfaPendingAccessToken({
|
|
47
|
+
lane: 'c',
|
|
48
|
+
setAccessToken: (token, expiresIn) => api.auth.session.setAccessToken(token, expiresIn),
|
|
49
|
+
}),
|
|
50
|
+
})
|
|
51
|
+
}
|