@nextsparkjs/core 0.1.0-beta.187 → 0.1.0-beta.189
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/dist/components/api/keys/ApiKeyDisplay.js +19 -19
- package/dist/components/api/keys/CreateApiKeyDialog.js +21 -21
- package/dist/components/app/layouts/PublicNavbar.d.ts.map +1 -1
- package/dist/components/app/layouts/PublicNavbar.js +34 -16
- package/dist/components/app/misc/ThemeToggle.d.ts.map +1 -1
- package/dist/components/app/misc/ThemeToggle.js +3 -4
- package/dist/components/auth/SessionCookieRefresher.d.ts +5 -0
- package/dist/components/auth/SessionCookieRefresher.d.ts.map +1 -1
- package/dist/components/auth/SessionCookieRefresher.js +7 -1
- package/dist/components/auth/forms/LoginForm.d.ts.map +1 -1
- package/dist/components/auth/forms/LoginForm.js +49 -12
- package/dist/components/auth/forms/SignupForm.d.ts.map +1 -1
- package/dist/components/auth/forms/SignupForm.js +4 -3
- package/dist/components/dashboard/block-editor/block-settings-panel.js +1 -1
- package/dist/components/dashboard/block-editor/floating-block-toolbar.js +1 -1
- package/dist/components/dashboard/block-editor/sortable-block.js +1 -1
- package/dist/components/dashboard/layouts/Sidebar.d.ts.map +1 -1
- package/dist/components/dashboard/layouts/Sidebar.js +8 -6
- package/dist/components/dashboard/layouts/TopNavbar.d.ts.map +1 -1
- package/dist/components/dashboard/layouts/TopNavbar.js +51 -54
- package/dist/components/dashboard/misc/NotificationsDropdown.d.ts.map +1 -1
- package/dist/components/dashboard/misc/NotificationsDropdown.js +17 -15
- package/dist/components/dashboard/misc/SearchDropdown.d.ts.map +1 -1
- package/dist/components/dashboard/misc/SearchDropdown.js +19 -22
- package/dist/components/dashboard/mobile/MobileBottomNav.js +1 -1
- package/dist/components/dashboard/mobile/MobileTopBar.d.ts +10 -1
- package/dist/components/dashboard/mobile/MobileTopBar.d.ts.map +1 -1
- package/dist/components/dashboard/mobile/MobileTopBar.js +4 -3
- package/dist/components/dashboard/navigation/DynamicNavigation.js +5 -5
- package/dist/components/devtools/BlockDetailViewer.js +1 -1
- package/dist/components/devtools/BlocksViewer.js +1 -1
- package/dist/components/entities/EntityChildManager.js +5 -5
- package/dist/components/entities/EntityDetailPage.d.ts.map +1 -1
- package/dist/components/entities/EntityDetailPage.js +16 -15
- package/dist/components/entities/EntityFieldRenderer.d.ts.map +1 -1
- package/dist/components/entities/EntityFieldRenderer.js +12 -7
- package/dist/components/entities/EntityPageHeader.js +5 -5
- package/dist/components/entities/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/entities/ErrorBoundary.js +20 -21
- package/dist/components/entities/wrappers/EntityDetailWrapper.js +5 -5
- package/dist/components/entities/wrappers/EntityFormWrapper.js +2 -2
- package/dist/components/entities/wrappers/EntityListWrapper.js +3 -3
- package/dist/components/permissions/NoPermission.js +10 -10
- package/dist/components/public/pageBuilder/PageRenderer.d.ts.map +1 -1
- package/dist/components/public/pageBuilder/PageRenderer.js +2 -1
- package/dist/components/settings/SettingsPageSkeleton.js +4 -4
- package/dist/components/settings/layouts/SettingsSidebar.js +6 -6
- package/dist/components/shared/MultiSelectFilter.d.ts +3 -1
- package/dist/components/shared/MultiSelectFilter.d.ts.map +1 -1
- package/dist/components/shared/MultiSelectFilter.js +7 -3
- package/dist/components/shared/SearchInput.d.ts +2 -0
- package/dist/components/shared/SearchInput.d.ts.map +1 -1
- package/dist/components/shared/SearchInput.js +64 -6
- package/dist/components/ui/address-input.js +18 -18
- package/dist/components/ui/audio-upload.js +9 -9
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +4 -4
- package/dist/components/ui/country-select.d.ts.map +1 -1
- package/dist/components/ui/country-select.js +3 -3
- package/dist/components/ui/currency-select.d.ts.map +1 -1
- package/dist/components/ui/currency-select.js +3 -3
- package/dist/components/ui/dynamic-icon.d.ts.map +1 -1
- package/dist/components/ui/dynamic-icon.js +3 -2
- package/dist/components/ui/file-upload.js +7 -7
- package/dist/components/ui/image-upload.js +8 -8
- package/dist/components/ui/multi-select.d.ts +2 -1
- package/dist/components/ui/multi-select.d.ts.map +1 -1
- package/dist/components/ui/multi-select.js +4 -3
- package/dist/components/ui/phone-input.d.ts.map +1 -1
- package/dist/components/ui/phone-input.js +3 -3
- package/dist/components/ui/relation-display.js +1 -1
- package/dist/components/ui/simple-relation-select.d.ts +2 -1
- package/dist/components/ui/simple-relation-select.d.ts.map +1 -1
- package/dist/components/ui/simple-relation-select.js +7 -6
- package/dist/components/ui/tags-input.d.ts.map +1 -1
- package/dist/components/ui/tags-input.js +1 -1
- package/dist/components/ui/timezone-select.d.ts.map +1 -1
- package/dist/components/ui/timezone-select.js +3 -3
- package/dist/components/ui/user-display.js +4 -4
- package/dist/components/ui/user-select.d.ts.map +1 -1
- package/dist/components/ui/user-select.js +9 -9
- package/dist/components/ui/video-upload.js +9 -9
- package/dist/contexts/SubscriptionContext.d.ts.map +1 -1
- package/dist/contexts/SubscriptionContext.js +5 -1
- package/dist/contexts/TeamContext.d.ts.map +1 -1
- package/dist/contexts/TeamContext.js +83 -26
- package/dist/emails/otp-verification.d.ts.map +1 -1
- package/dist/emails/otp-verification.js +3 -2
- package/dist/hooks/useAccountPreferencesSync.d.ts +13 -0
- package/dist/hooks/useAccountPreferencesSync.d.ts.map +1 -0
- package/dist/hooks/useAccountPreferencesSync.js +95 -0
- package/dist/hooks/useAuth.d.ts +202 -15
- package/dist/hooks/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth.js +49 -13
- package/dist/hooks/useEntityConfig.js +2 -2
- package/dist/hooks/useEntitySearch.js +10 -10
- package/dist/hooks/useNotifications.js +12 -12
- package/dist/hooks/usePrefetch.d.ts.map +1 -1
- package/dist/hooks/usePrefetch.js +6 -2
- package/dist/hooks/useSearch.js +15 -15
- package/dist/hooks/useSessionCookieRefresh.d.ts +18 -1
- package/dist/hooks/useSessionCookieRefresh.d.ts.map +1 -1
- package/dist/hooks/useSessionCookieRefresh.js +17 -4
- package/dist/hooks/useSessionHint.d.ts +12 -0
- package/dist/hooks/useSessionHint.d.ts.map +1 -0
- package/dist/hooks/useSessionHint.js +15 -0
- package/dist/hooks/useTranslationPreload.js +6 -6
- package/dist/i18n.d.ts +13 -0
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +2 -27
- package/dist/lib/actions/entity.actions.d.ts.map +1 -1
- package/dist/lib/actions/entity.actions.js +3 -2
- package/dist/lib/api/auth/dual-auth.d.ts +4 -1
- package/dist/lib/api/auth/dual-auth.d.ts.map +1 -1
- package/dist/lib/api/auth/dual-auth.js +5 -16
- package/dist/lib/api/entities.js +33 -33
- package/dist/lib/api/keys.d.ts +27 -27
- package/dist/lib/api/keys.js +27 -27
- package/dist/lib/auth/callback-url.d.ts +11 -0
- package/dist/lib/auth/callback-url.d.ts.map +1 -0
- package/dist/lib/auth/callback-url.js +14 -0
- package/dist/lib/auth/otp-config.d.ts +55 -0
- package/dist/lib/auth/otp-config.d.ts.map +1 -0
- package/dist/lib/auth/otp-config.js +48 -0
- package/dist/lib/auth/registration-helpers.d.ts.map +1 -1
- package/dist/lib/auth/registration-helpers.js +3 -1
- package/dist/lib/auth/session-hint.d.ts +31 -0
- package/dist/lib/auth/session-hint.d.ts.map +1 -0
- package/dist/lib/auth/session-hint.js +37 -0
- package/dist/lib/auth.d.ts.map +1 -1
- package/dist/lib/auth.js +6 -4
- package/dist/lib/blocks/loader.d.ts +3 -11
- package/dist/lib/blocks/loader.d.ts.map +1 -1
- package/dist/lib/blocks/loader.js +1 -9
- package/dist/lib/blocks/loader.server.d.ts +18 -0
- package/dist/lib/blocks/loader.server.d.ts.map +1 -0
- package/dist/lib/blocks/loader.server.js +11 -0
- package/dist/lib/blocks/sanitize-html.d.ts +31 -0
- package/dist/lib/blocks/sanitize-html.d.ts.map +1 -0
- package/dist/lib/blocks/sanitize-html.js +60 -0
- package/dist/lib/config/config-sync.d.ts +1 -0
- package/dist/lib/config/config-sync.d.ts.map +1 -1
- package/dist/lib/config/config-sync.js +4 -1
- package/dist/lib/config/types.d.ts +48 -0
- package/dist/lib/config/types.d.ts.map +1 -1
- package/dist/lib/email/types.d.ts +6 -0
- package/dist/lib/email/types.d.ts.map +1 -1
- package/dist/lib/entities/serialization.d.ts.map +1 -1
- package/dist/lib/entities/serialization.js +3 -6
- package/dist/lib/icons.d.ts +12 -0
- package/dist/lib/icons.d.ts.map +1 -0
- package/dist/lib/icons.js +30 -0
- package/dist/lib/locale.d.ts +25 -1
- package/dist/lib/locale.d.ts.map +1 -1
- package/dist/lib/locale.js +49 -35
- package/dist/lib/mcp/engine.js +1 -1
- package/dist/lib/mcp/errors.js +17 -17
- package/dist/lib/mcp/schema-builder.js +16 -16
- package/dist/lib/mcp/tool-generator.js +18 -18
- package/dist/lib/search-highlighting.d.ts +7 -0
- package/dist/lib/search-highlighting.d.ts.map +1 -1
- package/dist/lib/search-highlighting.js +6 -2
- package/dist/lib/selectors/core-selectors.d.ts +2 -0
- package/dist/lib/selectors/core-selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/auth.selectors.d.ts +1 -0
- package/dist/lib/selectors/domains/auth.selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/auth.selectors.js +1 -0
- package/dist/lib/selectors/domains/entities.selectors.d.ts +2 -0
- package/dist/lib/selectors/domains/entities.selectors.d.ts.map +1 -1
- package/dist/lib/selectors/domains/entities.selectors.js +2 -0
- package/dist/lib/selectors/selectors.d.ts +4 -0
- package/dist/lib/selectors/selectors.d.ts.map +1 -1
- package/dist/lib/services/block.service.js +1 -1
- package/dist/lib/teams/active-team-cookie.d.ts +24 -0
- package/dist/lib/teams/active-team-cookie.d.ts.map +1 -0
- package/dist/lib/teams/active-team-cookie.js +17 -0
- package/dist/lib/teams/dashboard-team.d.ts +20 -0
- package/dist/lib/teams/dashboard-team.d.ts.map +1 -0
- package/dist/lib/teams/dashboard-team.js +38 -0
- package/dist/lib/teams/schema.d.ts.map +1 -1
- package/dist/lib/teams/schema.js +1 -1
- package/dist/lib/template-resolver.d.ts.map +1 -1
- package/dist/lib/template-resolver.js +0 -1
- package/dist/lib/theme/get-default-theme-mode.d.ts +7 -4
- package/dist/lib/theme/get-default-theme-mode.d.ts.map +1 -1
- package/dist/lib/theme/get-default-theme-mode.js +2 -44
- package/dist/messages/de/auth.json +4 -2
- package/dist/messages/de/common.json +83 -3
- package/dist/messages/de/email.json +1 -1
- package/dist/messages/de/index.d.ts +87 -0
- package/dist/messages/de/index.d.ts.map +1 -1
- package/dist/messages/de/settings.json +5 -0
- package/dist/messages/en/auth.json +4 -2
- package/dist/messages/en/common.json +83 -3
- package/dist/messages/en/email.json +1 -1
- package/dist/messages/en/index.d.ts +86 -0
- package/dist/messages/en/index.d.ts.map +1 -1
- package/dist/messages/en/settings.json +4 -0
- package/dist/messages/es/auth.json +4 -2
- package/dist/messages/es/common.json +83 -3
- package/dist/messages/es/email.json +1 -1
- package/dist/messages/es/index.d.ts +86 -0
- package/dist/messages/es/index.d.ts.map +1 -1
- package/dist/messages/es/settings.json +4 -0
- package/dist/messages/fr/auth.json +4 -2
- package/dist/messages/fr/common.json +83 -3
- package/dist/messages/fr/email.json +1 -1
- package/dist/messages/fr/index.d.ts +87 -0
- package/dist/messages/fr/index.d.ts.map +1 -1
- package/dist/messages/fr/settings.json +5 -0
- package/dist/messages/it/auth.json +4 -2
- package/dist/messages/it/common.json +83 -3
- package/dist/messages/it/email.json +1 -1
- package/dist/messages/it/index.d.ts +87 -0
- package/dist/messages/it/index.d.ts.map +1 -1
- package/dist/messages/it/settings.json +5 -0
- package/dist/messages/pt/auth.json +4 -2
- package/dist/messages/pt/common.json +83 -3
- package/dist/messages/pt/email.json +1 -1
- package/dist/messages/pt/index.d.ts +87 -0
- package/dist/messages/pt/index.d.ts.map +1 -1
- package/dist/messages/pt/settings.json +5 -0
- package/dist/nextspark-registries.d.ts +54 -0
- package/dist/providers/DashboardProviders.d.ts +13 -10
- package/dist/providers/DashboardProviders.d.ts.map +1 -1
- package/dist/providers/DashboardProviders.js +7 -1
- package/dist/templates/app/(auth)/forgot-password/page.tsx +2 -2
- package/dist/templates/app/(auth)/reset-password/page.tsx +6 -6
- package/dist/templates/app/403/page.tsx +6 -6
- package/dist/templates/app/api/v1/teams/switch/route.ts +24 -5
- package/dist/templates/app/dashboard/(main)/[entity]/layout.tsx +9 -7
- package/dist/templates/app/dashboard/(main)/layout.tsx +4 -3
- package/dist/templates/app/dashboard/settings/api-keys/page.tsx +36 -34
- package/dist/templates/app/dashboard/settings/profile/page.tsx +7 -6
- package/dist/templates/app/dashboard/settings/security/page.tsx +5 -4
- package/dist/templates/app/layout.ppr.tsx +8 -8
- package/dist/templates/app/layout.tsx +12 -17
- package/dist/templates/blocks/cta-section/component.tsx +5 -2
- package/dist/templates/blocks/cta-section/config.ts +3 -2
- package/dist/templates/blocks/cta-section/fields.ts +2 -2
- package/dist/templates/blocks/cta-section/schema.ts +2 -2
- package/dist/templates/blocks/features-grid/component.tsx +10 -2
- package/dist/templates/blocks/features-grid/config.ts +3 -2
- package/dist/templates/blocks/features-grid/fields.ts +2 -2
- package/dist/templates/blocks/features-grid/schema.ts +2 -2
- package/dist/templates/blocks/hero/component.tsx +6 -3
- package/dist/templates/blocks/hero/config.ts +3 -2
- package/dist/templates/blocks/hero/fields.ts +2 -2
- package/dist/templates/blocks/hero/schema.ts +2 -2
- package/dist/templates/blocks/testimonials/component.tsx +6 -3
- package/dist/templates/blocks/testimonials/config.ts +3 -2
- package/dist/templates/blocks/testimonials/fields.ts +2 -2
- package/dist/templates/blocks/testimonials/schema.ts +2 -2
- package/dist/templates/blocks/text-content/component.tsx +7 -3
- package/dist/templates/blocks/text-content/config.ts +3 -2
- package/dist/templates/blocks/text-content/fields.ts +2 -2
- package/dist/templates/blocks/text-content/schema.ts +2 -2
- package/dist/templates/contents/themes/starter/blocks/cta-section/component.tsx +102 -0
- package/dist/templates/contents/themes/starter/blocks/cta-section/config.ts +11 -0
- package/dist/templates/contents/themes/starter/blocks/cta-section/fields.ts +89 -0
- package/dist/templates/contents/themes/starter/blocks/cta-section/index.ts +6 -0
- package/dist/templates/contents/themes/starter/blocks/cta-section/schema.ts +32 -0
- package/dist/templates/contents/themes/starter/blocks/cta-section/thumbnail.png +0 -0
- package/dist/templates/contents/themes/starter/blocks/features-grid/component.tsx +119 -0
- package/dist/templates/contents/themes/starter/blocks/features-grid/config.ts +11 -0
- package/dist/templates/contents/themes/starter/blocks/features-grid/fields.ts +97 -0
- package/dist/templates/contents/themes/starter/blocks/features-grid/index.ts +6 -0
- package/dist/templates/contents/themes/starter/blocks/features-grid/schema.ts +40 -0
- package/dist/templates/contents/themes/starter/blocks/features-grid/thumbnail.png +0 -0
- package/dist/templates/contents/themes/starter/blocks/hero/component.tsx +105 -0
- package/dist/templates/contents/themes/starter/blocks/hero/config.ts +11 -0
- package/dist/templates/contents/themes/starter/blocks/hero/fields.ts +60 -0
- package/dist/templates/contents/themes/starter/blocks/hero/index.ts +6 -0
- package/dist/templates/contents/themes/starter/blocks/hero/schema.ts +33 -0
- package/dist/templates/contents/themes/starter/blocks/hero/thumbnail.png +0 -0
- package/dist/templates/contents/themes/starter/blocks/testimonials/component.tsx +116 -0
- package/dist/templates/contents/themes/starter/blocks/testimonials/config.ts +11 -0
- package/dist/templates/contents/themes/starter/blocks/testimonials/fields.ts +105 -0
- package/dist/templates/contents/themes/starter/blocks/testimonials/index.ts +6 -0
- package/dist/templates/contents/themes/starter/blocks/testimonials/schema.ts +41 -0
- package/dist/templates/contents/themes/starter/blocks/testimonials/thumbnail.png +0 -0
- package/dist/templates/contents/themes/starter/blocks/text-content/component.tsx +100 -0
- package/dist/templates/contents/themes/starter/blocks/text-content/config.ts +11 -0
- package/dist/templates/contents/themes/starter/blocks/text-content/fields.ts +88 -0
- package/dist/templates/contents/themes/starter/blocks/text-content/index.ts +6 -0
- package/dist/templates/contents/themes/starter/blocks/text-content/schema.ts +30 -0
- package/dist/templates/contents/themes/starter/blocks/text-content/thumbnail.png +0 -0
- package/dist/templates/contents/themes/starter/config/app.config.ts +8 -0
- package/dist/templates/contents/themes/starter/entities/tasks/tasks.config.ts +7 -0
- package/dist/templates/contents/themes/starter/tests/cypress/e2e/_utils/devtools/access.cy.ts +9 -1
- package/dist/templates/contents/themes/starter/tests/cypress/e2e/api/entities/tasks/TaskAPIController.js +2 -2
- package/dist/templates/contents/themes/starter/tests/cypress/e2e/uat/entities/tasks/tasks-crud.cy.ts +45 -38
- package/dist/templates/contents/themes/starter/tests/cypress/fixtures/entities.json +16 -0
- package/dist/templates/contents/themes/starter/tests/cypress/src/components/DevKeyringPOM.ts +3 -1
- package/dist/templates/contents/themes/starter/tests/cypress/src/core/BlockEditorBasePOM.ts +3 -3
- package/dist/templates/contents/themes/starter/tests/cypress/src/entities/PagesPOM.ts +137 -0
- package/dist/templates/contents/themes/starter/tests/cypress/src/entities/index.ts +2 -0
- package/dist/templates/contents/themes/starter/tests/cypress/src/index.ts +1 -0
- package/dist/templates/contents/themes/starter/tests/cypress/src/session-helpers.ts +42 -11
- package/dist/templates/contents/themes/starter/tests/cypress/support/commands.ts +29 -18
- package/dist/templates/features/blog/blocks/post-content/component.tsx +5 -1
- package/dist/templates/features/blog/blocks/post-content/schema.ts +1 -1
- package/dist/templates/features/pages/blocks/hero/component.tsx +3 -0
- package/dist/templates/features/pages/blocks/hero/schema.ts +1 -1
- package/dist/templates/proxy.ts +138 -53
- package/dist/types/blocks.d.ts.map +1 -1
- package/dist/types/blocks.js +1 -1
- package/dist/types/task.types.d.ts +1 -1
- package/dist/types/task.types.js +7 -7
- package/dist/utils/dev/TranslationDebugger.js +2 -2
- package/package.json +14 -5
- package/scripts/build/registry/__tests__/block-registry.test.mjs +73 -0
- package/scripts/build/registry/__tests__/icons-discovery.test.mjs +130 -0
- package/scripts/build/registry/__tests__/identifier.test.mjs +65 -0
- package/scripts/build/registry/__tests__/page-generator.test.mjs +430 -0
- package/scripts/build/registry/__tests__/scheduled-actions-registry.test.mjs +41 -0
- package/scripts/build/registry/__tests__/template-registry.test.mjs +89 -0
- package/scripts/build/registry/discovery/icons.mjs +275 -0
- package/scripts/build/registry/discovery/index.mjs +1 -0
- package/scripts/build/registry/generators/block-registry.mjs +203 -55
- package/scripts/build/registry/generators/feature-registry.mjs +9 -2
- package/scripts/build/registry/generators/icon-registry.mjs +56 -0
- package/scripts/build/registry/generators/identifier.mjs +28 -0
- package/scripts/build/registry/generators/index.mjs +1 -0
- package/scripts/build/registry/generators/plugin-registry.mjs +4 -3
- package/scripts/build/registry/generators/scheduled-actions-registry.mjs +4 -2
- package/scripts/build/registry/generators/template-registry.mjs +49 -41
- package/scripts/build/registry/generators/theme-registry.mjs +6 -7
- package/scripts/build/registry/post-build/page-generator.mjs +380 -59
- package/scripts/build/registry.mjs +9 -1
- package/templates/app/(auth)/forgot-password/page.tsx +2 -2
- package/templates/app/(auth)/reset-password/page.tsx +6 -6
- package/templates/app/403/page.tsx +6 -6
- package/templates/app/api/v1/teams/switch/route.ts +24 -5
- package/templates/app/dashboard/(main)/[entity]/layout.tsx +9 -7
- package/templates/app/dashboard/(main)/layout.tsx +4 -3
- package/templates/app/dashboard/settings/api-keys/page.tsx +36 -34
- package/templates/app/dashboard/settings/profile/page.tsx +7 -6
- package/templates/app/dashboard/settings/security/page.tsx +5 -4
- package/templates/app/layout.ppr.tsx +8 -8
- package/templates/app/layout.tsx +12 -17
- package/templates/blocks/cta-section/component.tsx +5 -2
- package/templates/blocks/cta-section/config.ts +3 -2
- package/templates/blocks/cta-section/fields.ts +2 -2
- package/templates/blocks/cta-section/schema.ts +2 -2
- package/templates/blocks/features-grid/component.tsx +10 -2
- package/templates/blocks/features-grid/config.ts +3 -2
- package/templates/blocks/features-grid/fields.ts +2 -2
- package/templates/blocks/features-grid/schema.ts +2 -2
- package/templates/blocks/hero/component.tsx +6 -3
- package/templates/blocks/hero/config.ts +3 -2
- package/templates/blocks/hero/fields.ts +2 -2
- package/templates/blocks/hero/schema.ts +2 -2
- package/templates/blocks/testimonials/component.tsx +6 -3
- package/templates/blocks/testimonials/config.ts +3 -2
- package/templates/blocks/testimonials/fields.ts +2 -2
- package/templates/blocks/testimonials/schema.ts +2 -2
- package/templates/blocks/text-content/component.tsx +7 -3
- package/templates/blocks/text-content/config.ts +3 -2
- package/templates/blocks/text-content/fields.ts +2 -2
- package/templates/blocks/text-content/schema.ts +2 -2
- package/templates/contents/themes/starter/blocks/cta-section/component.tsx +102 -0
- package/templates/contents/themes/starter/blocks/cta-section/config.ts +11 -0
- package/templates/contents/themes/starter/blocks/cta-section/fields.ts +89 -0
- package/templates/contents/themes/starter/blocks/cta-section/index.ts +6 -0
- package/templates/contents/themes/starter/blocks/cta-section/schema.ts +32 -0
- package/templates/contents/themes/starter/blocks/cta-section/thumbnail.png +0 -0
- package/templates/contents/themes/starter/blocks/features-grid/component.tsx +119 -0
- package/templates/contents/themes/starter/blocks/features-grid/config.ts +11 -0
- package/templates/contents/themes/starter/blocks/features-grid/fields.ts +97 -0
- package/templates/contents/themes/starter/blocks/features-grid/index.ts +6 -0
- package/templates/contents/themes/starter/blocks/features-grid/schema.ts +40 -0
- package/templates/contents/themes/starter/blocks/features-grid/thumbnail.png +0 -0
- package/templates/contents/themes/starter/blocks/hero/component.tsx +105 -0
- package/templates/contents/themes/starter/blocks/hero/config.ts +11 -0
- package/templates/contents/themes/starter/blocks/hero/fields.ts +60 -0
- package/templates/contents/themes/starter/blocks/hero/index.ts +6 -0
- package/templates/contents/themes/starter/blocks/hero/schema.ts +33 -0
- package/templates/contents/themes/starter/blocks/hero/thumbnail.png +0 -0
- package/templates/contents/themes/starter/blocks/testimonials/component.tsx +116 -0
- package/templates/contents/themes/starter/blocks/testimonials/config.ts +11 -0
- package/templates/contents/themes/starter/blocks/testimonials/fields.ts +105 -0
- package/templates/contents/themes/starter/blocks/testimonials/index.ts +6 -0
- package/templates/contents/themes/starter/blocks/testimonials/schema.ts +41 -0
- package/templates/contents/themes/starter/blocks/testimonials/thumbnail.png +0 -0
- package/templates/contents/themes/starter/blocks/text-content/component.tsx +100 -0
- package/templates/contents/themes/starter/blocks/text-content/config.ts +11 -0
- package/templates/contents/themes/starter/blocks/text-content/fields.ts +88 -0
- package/templates/contents/themes/starter/blocks/text-content/index.ts +6 -0
- package/templates/contents/themes/starter/blocks/text-content/schema.ts +30 -0
- package/templates/contents/themes/starter/blocks/text-content/thumbnail.png +0 -0
- package/templates/contents/themes/starter/config/app.config.ts +8 -0
- package/templates/contents/themes/starter/entities/tasks/tasks.config.ts +7 -0
- package/templates/contents/themes/starter/tests/cypress/e2e/_utils/devtools/access.cy.ts +9 -1
- package/templates/contents/themes/starter/tests/cypress/e2e/api/entities/tasks/TaskAPIController.js +2 -2
- package/templates/contents/themes/starter/tests/cypress/e2e/uat/entities/tasks/tasks-crud.cy.ts +45 -38
- package/templates/contents/themes/starter/tests/cypress/fixtures/entities.json +16 -0
- package/templates/contents/themes/starter/tests/cypress/src/components/DevKeyringPOM.ts +3 -1
- package/templates/contents/themes/starter/tests/cypress/src/core/BlockEditorBasePOM.ts +3 -3
- package/templates/contents/themes/starter/tests/cypress/src/entities/PagesPOM.ts +137 -0
- package/templates/contents/themes/starter/tests/cypress/src/entities/index.ts +2 -0
- package/templates/contents/themes/starter/tests/cypress/src/index.ts +1 -0
- package/templates/contents/themes/starter/tests/cypress/src/session-helpers.ts +42 -11
- package/templates/contents/themes/starter/tests/cypress/support/commands.ts +29 -18
- package/templates/features/blog/blocks/post-content/component.tsx +5 -1
- package/templates/features/blog/blocks/post-content/schema.ts +1 -1
- package/templates/features/pages/blocks/hero/component.tsx +3 -0
- package/templates/features/pages/blocks/hero/schema.ts +1 -1
- package/templates/proxy.ts +138 -53
- package/tests/jest/__mocks__/@nextsparkjs/registries/block-registry.client.ts +9 -0
- package/tests/jest/__mocks__/@nextsparkjs/registries/block-registry.lazy.ts +5 -0
- package/tests/jest/__mocks__/@nextsparkjs/registries/icon-registry.ts +42 -0
- package/tests/jest/__mocks__/next-intl-server.js +85 -5
- package/tests/jest/__mocks__/next-server.js +32 -0
package/dist/hooks/useAuth.d.ts
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import type { SessionUser } from '../lib/auth';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Sign-in, sign-up and account actions, without subscribing to the session: a
|
|
4
|
+
* page that only acts, like the login and signup forms, makes no session request.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useAuthActions(): {
|
|
7
|
+
signIn: ({ email, password, redirectTo }: {
|
|
8
|
+
email: string;
|
|
9
|
+
password: string;
|
|
10
|
+
redirectTo?: string;
|
|
11
|
+
}) => Promise<Omit<{
|
|
12
|
+
redirect: boolean;
|
|
13
|
+
token: string;
|
|
14
|
+
url?: string | undefined;
|
|
15
|
+
user: {
|
|
16
|
+
id: string;
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
email: string;
|
|
20
|
+
emailVerified: boolean;
|
|
21
|
+
name: string;
|
|
22
|
+
image?: string | null | undefined;
|
|
23
|
+
};
|
|
24
|
+
}, "user"> & {
|
|
5
25
|
user: import("better-auth").StripEmptyObjects<{
|
|
6
26
|
id: string;
|
|
7
27
|
createdAt: Date;
|
|
@@ -11,18 +31,166 @@ export declare function useAuth(): {
|
|
|
11
31
|
email?: string;
|
|
12
32
|
image?: string;
|
|
13
33
|
} & {} & {}>;
|
|
14
|
-
|
|
34
|
+
}>;
|
|
35
|
+
signUp: ({ email, password, firstName, lastName, intent }: {
|
|
36
|
+
email: string;
|
|
37
|
+
password: string;
|
|
38
|
+
firstName?: string;
|
|
39
|
+
lastName?: string;
|
|
40
|
+
intent?: string;
|
|
41
|
+
}) => Promise<(Omit<{
|
|
42
|
+
token: null;
|
|
43
|
+
user: {
|
|
15
44
|
id: string;
|
|
16
45
|
createdAt: Date;
|
|
17
46
|
updatedAt: Date;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
47
|
+
email: string;
|
|
48
|
+
emailVerified: boolean;
|
|
49
|
+
name: string;
|
|
50
|
+
image?: string | null | undefined;
|
|
51
|
+
};
|
|
52
|
+
}, "user"> & {
|
|
53
|
+
user: import("better-auth").StripEmptyObjects<{
|
|
54
|
+
id: string;
|
|
55
|
+
createdAt: Date;
|
|
56
|
+
updatedAt: Date;
|
|
57
|
+
emailVerified: boolean;
|
|
58
|
+
name: string;
|
|
59
|
+
email?: string;
|
|
60
|
+
image?: string;
|
|
23
61
|
} & {} & {}>;
|
|
24
|
-
}
|
|
25
|
-
|
|
62
|
+
}) | (Omit<{
|
|
63
|
+
token: string;
|
|
64
|
+
user: {
|
|
65
|
+
id: string;
|
|
66
|
+
createdAt: Date;
|
|
67
|
+
updatedAt: Date;
|
|
68
|
+
email: string;
|
|
69
|
+
emailVerified: boolean;
|
|
70
|
+
name: string;
|
|
71
|
+
image?: string | null | undefined;
|
|
72
|
+
};
|
|
73
|
+
}, "user"> & {
|
|
74
|
+
user: import("better-auth").StripEmptyObjects<{
|
|
75
|
+
id: string;
|
|
76
|
+
createdAt: Date;
|
|
77
|
+
updatedAt: Date;
|
|
78
|
+
emailVerified: boolean;
|
|
79
|
+
name: string;
|
|
80
|
+
email?: string;
|
|
81
|
+
image?: string;
|
|
82
|
+
} & {} & {}>;
|
|
83
|
+
})>;
|
|
84
|
+
signOut: () => Promise<void>;
|
|
85
|
+
googleSignIn: (redirectTo?: string) => Promise<void>;
|
|
86
|
+
sendOtp: (email: string) => Promise<{
|
|
87
|
+
success: boolean;
|
|
88
|
+
}>;
|
|
89
|
+
signInWithOtp: ({ email, otp, redirectTo }: {
|
|
90
|
+
email: string;
|
|
91
|
+
otp: string;
|
|
92
|
+
redirectTo?: string;
|
|
93
|
+
}) => Promise<Omit<{
|
|
94
|
+
token: string;
|
|
95
|
+
user: {
|
|
96
|
+
id: string;
|
|
97
|
+
createdAt: Date;
|
|
98
|
+
updatedAt: Date;
|
|
99
|
+
email: string;
|
|
100
|
+
emailVerified: boolean;
|
|
101
|
+
name: string;
|
|
102
|
+
image?: string | null | undefined;
|
|
103
|
+
};
|
|
104
|
+
}, "user"> & {
|
|
105
|
+
user: import("better-auth").StripEmptyObjects<{
|
|
106
|
+
id: string;
|
|
107
|
+
createdAt: Date;
|
|
108
|
+
updatedAt: Date;
|
|
109
|
+
emailVerified: boolean;
|
|
110
|
+
name: string;
|
|
111
|
+
email?: string;
|
|
112
|
+
image?: string;
|
|
113
|
+
} & {} & {}>;
|
|
114
|
+
}>;
|
|
115
|
+
resetPassword: (email: string) => Promise<{
|
|
116
|
+
success: boolean;
|
|
117
|
+
data: any;
|
|
118
|
+
error: string;
|
|
119
|
+
} | {
|
|
120
|
+
success: boolean;
|
|
121
|
+
data: {
|
|
122
|
+
status: boolean;
|
|
123
|
+
message: string;
|
|
124
|
+
};
|
|
125
|
+
error: any;
|
|
126
|
+
}>;
|
|
127
|
+
updatePassword: (newPassword: string, token?: string) => Promise<{
|
|
128
|
+
success: boolean;
|
|
129
|
+
data: any;
|
|
130
|
+
error: string;
|
|
131
|
+
} | {
|
|
132
|
+
success: boolean;
|
|
133
|
+
data: {
|
|
134
|
+
status: boolean;
|
|
135
|
+
};
|
|
136
|
+
error: any;
|
|
137
|
+
}>;
|
|
138
|
+
changePassword: (currentPassword: string, newPassword: string, revokeOtherSessions?: boolean) => Promise<{
|
|
139
|
+
success: boolean;
|
|
140
|
+
data: any;
|
|
141
|
+
error: string;
|
|
142
|
+
} | {
|
|
143
|
+
success: boolean;
|
|
144
|
+
data: Omit<{
|
|
145
|
+
token: string | null;
|
|
146
|
+
user: {
|
|
147
|
+
id: string;
|
|
148
|
+
createdAt: Date;
|
|
149
|
+
updatedAt: Date;
|
|
150
|
+
email: string;
|
|
151
|
+
emailVerified: boolean;
|
|
152
|
+
name: string;
|
|
153
|
+
image?: string | null | undefined;
|
|
154
|
+
} & Record<string, any> & {
|
|
155
|
+
id: string;
|
|
156
|
+
createdAt: Date;
|
|
157
|
+
updatedAt: Date;
|
|
158
|
+
email: string;
|
|
159
|
+
emailVerified: boolean;
|
|
160
|
+
name: string;
|
|
161
|
+
image?: string | null | undefined;
|
|
162
|
+
};
|
|
163
|
+
}, "user"> & {
|
|
164
|
+
user: import("better-auth").StripEmptyObjects<{
|
|
165
|
+
id: string;
|
|
166
|
+
createdAt: Date;
|
|
167
|
+
updatedAt: Date;
|
|
168
|
+
emailVerified: boolean;
|
|
169
|
+
name: string;
|
|
170
|
+
email?: string;
|
|
171
|
+
image?: string;
|
|
172
|
+
} & {} & {}>;
|
|
173
|
+
};
|
|
174
|
+
error: any;
|
|
175
|
+
}>;
|
|
176
|
+
resendVerificationEmail: (email: string) => Promise<{
|
|
177
|
+
success: boolean;
|
|
178
|
+
data: any;
|
|
179
|
+
error: string;
|
|
180
|
+
} | {
|
|
181
|
+
success: boolean;
|
|
182
|
+
data: {
|
|
183
|
+
status: boolean;
|
|
184
|
+
};
|
|
185
|
+
error: any;
|
|
186
|
+
}>;
|
|
187
|
+
};
|
|
188
|
+
/** The session (user, loading state) and the auth actions. */
|
|
189
|
+
export declare function useAuth(): {
|
|
190
|
+
isSigningIn: boolean;
|
|
191
|
+
isSigningUp: boolean;
|
|
192
|
+
signInError: any;
|
|
193
|
+
signUpError: any;
|
|
26
194
|
signIn: ({ email, password, redirectTo }: {
|
|
27
195
|
email: string;
|
|
28
196
|
password: string;
|
|
@@ -203,9 +371,28 @@ export declare function useAuth(): {
|
|
|
203
371
|
};
|
|
204
372
|
error: any;
|
|
205
373
|
}>;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
374
|
+
user: SessionUser | null;
|
|
375
|
+
session: {
|
|
376
|
+
user: import("better-auth").StripEmptyObjects<{
|
|
377
|
+
id: string;
|
|
378
|
+
createdAt: Date;
|
|
379
|
+
updatedAt: Date;
|
|
380
|
+
emailVerified: boolean;
|
|
381
|
+
name: string;
|
|
382
|
+
email?: string;
|
|
383
|
+
image?: string;
|
|
384
|
+
} & {} & {}>;
|
|
385
|
+
session: import("better-auth").StripEmptyObjects<{
|
|
386
|
+
id: string;
|
|
387
|
+
createdAt: Date;
|
|
388
|
+
updatedAt: Date;
|
|
389
|
+
userId: string;
|
|
390
|
+
expiresAt: Date;
|
|
391
|
+
token: string;
|
|
392
|
+
ipAddress?: string;
|
|
393
|
+
userAgent?: string;
|
|
394
|
+
} & {} & {}>;
|
|
395
|
+
};
|
|
396
|
+
isLoading: boolean;
|
|
210
397
|
};
|
|
211
398
|
//# sourceMappingURL=useAuth.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../src/hooks/useAuth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../src/hooks/useAuth.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AA0C9C;;;GAGG;AACH,wBAAgB,cAAc;8CAYiC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;+DAqBvC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA2E1H,MAAM;qBAlCjB,MAAM;;;gDAgBiB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;iBA4G3D,CAAC;;;;;;;;;;;;;2BAjFV,MAAM;;;;;;;;;;;;kCA6BC,MAAM,UAAU,MAAM;;;;;;;;;;;sCAwClB,MAAM,eAAe,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA8B5B,MAAM;;;;;;;;;;;EAwC3D;AAED,8DAA8D;AAC9D,wBAAgB,OAAO;;;;;8CAvPwC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;+DAqBvC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA2E1H,MAAM;qBAlCjB,MAAM;;;gDAgBiB;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;iBA4G3D,CAAC;;;;;;;;;;;;;2BAjFV,MAAM;;;;;;;;;;;;kCA6BC,MAAM,UAAU,MAAM;;;;;;;;;;;sCAwClB,MAAM,eAAe,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCA8B5B,MAAM;;;;;;;;;;;UAqD5B,WAAW,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;EASjD"}
|
package/dist/hooks/useAuth.js
CHANGED
|
@@ -1,25 +1,46 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { useContext, useEffect } from "react";
|
|
2
3
|
import { useRouter } from "next/navigation";
|
|
4
|
+
import { QueryClientContext } from "@tanstack/react-query";
|
|
3
5
|
import { authClient } from "../lib/auth-client.js";
|
|
4
6
|
import { useOrigin } from "./useOrigin.js";
|
|
5
7
|
import { useLastAuthMethod } from "./useLastAuthMethod.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
import { safeCallbackPath } from "../lib/auth/callback-url.js";
|
|
9
|
+
import { setSessionHint } from "../lib/auth/session-hint.js";
|
|
10
|
+
import { setUserLocaleClient } from "../lib/locale-client.js";
|
|
11
|
+
import { I18N_CONFIG } from "../lib/config/index.js";
|
|
12
|
+
function googleCallbackURL(redirectTo) {
|
|
13
|
+
const url = new URL(safeCallbackPath(redirectTo) ?? "/dashboard", "http://callback.invalid");
|
|
14
|
+
url.searchParams.set("auth_method", "google");
|
|
15
|
+
return `${url.pathname}${url.search.replace(/\*/g, "%2A")}`;
|
|
16
|
+
}
|
|
17
|
+
function rememberSignedIn(user) {
|
|
18
|
+
setSessionHint(true);
|
|
19
|
+
const language = user == null ? void 0 : user.language;
|
|
20
|
+
const localeDetected = I18N_CONFIG.supportedLocales.length > 1 && I18N_CONFIG.localeDetection !== false;
|
|
21
|
+
if (localeDetected && typeof language === "string" && I18N_CONFIG.supportedLocales.includes(language)) {
|
|
22
|
+
setUserLocaleClient(language);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function useAuthActions() {
|
|
8
26
|
const router = useRouter();
|
|
9
|
-
const session = authClient.useSession();
|
|
10
27
|
const origin = useOrigin();
|
|
11
28
|
const { saveAuthMethod } = useLastAuthMethod();
|
|
29
|
+
const queryClient = useContext(QueryClientContext);
|
|
30
|
+
const forgetSignedInData = () => queryClient == null ? void 0 : queryClient.clear();
|
|
12
31
|
const handleSignIn = async ({ email, password, redirectTo }) => {
|
|
13
32
|
const { data, error } = await authClient.signIn.email({
|
|
14
33
|
email,
|
|
15
34
|
password
|
|
16
35
|
});
|
|
17
36
|
if (error) {
|
|
18
|
-
throw new Error(error.message || "
|
|
37
|
+
throw new Error(error.message || "Failed to sign in");
|
|
19
38
|
}
|
|
20
39
|
if (data) {
|
|
21
40
|
saveAuthMethod("email");
|
|
22
|
-
|
|
41
|
+
forgetSignedInData();
|
|
42
|
+
rememberSignedIn(data.user);
|
|
43
|
+
router.push(safeCallbackPath(redirectTo) ?? "/dashboard");
|
|
23
44
|
}
|
|
24
45
|
return data;
|
|
25
46
|
};
|
|
@@ -47,6 +68,8 @@ function useAuth() {
|
|
|
47
68
|
localStorage.removeItem("activeTeamId");
|
|
48
69
|
}
|
|
49
70
|
await authClient.signOut();
|
|
71
|
+
setSessionHint(false);
|
|
72
|
+
forgetSignedInData();
|
|
50
73
|
router.push("/login");
|
|
51
74
|
};
|
|
52
75
|
const handleSendOtp = async (email) => {
|
|
@@ -66,15 +89,16 @@ function useAuth() {
|
|
|
66
89
|
}
|
|
67
90
|
if (data) {
|
|
68
91
|
saveAuthMethod("email");
|
|
69
|
-
|
|
92
|
+
forgetSignedInData();
|
|
93
|
+
rememberSignedIn(data.user);
|
|
94
|
+
router.push(safeCallbackPath(redirectTo) ?? "/dashboard");
|
|
70
95
|
}
|
|
71
96
|
return data;
|
|
72
97
|
};
|
|
73
98
|
const handleGoogleSignIn = async (redirectTo) => {
|
|
74
|
-
const callbackURL = redirectTo ? `${redirectTo}${redirectTo.includes("?") ? "&" : "?"}auth_method=google` : "/dashboard?auth_method=google";
|
|
75
99
|
await authClient.signIn.social({
|
|
76
100
|
provider: "google",
|
|
77
|
-
callbackURL
|
|
101
|
+
callbackURL: googleCallbackURL(redirectTo)
|
|
78
102
|
});
|
|
79
103
|
};
|
|
80
104
|
const handleResetPassword = async (email) => {
|
|
@@ -189,9 +213,6 @@ function useAuth() {
|
|
|
189
213
|
}
|
|
190
214
|
};
|
|
191
215
|
return {
|
|
192
|
-
user: (_a = session.data) == null ? void 0 : _a.user,
|
|
193
|
-
session: session.data,
|
|
194
|
-
isLoading: session.isPending,
|
|
195
216
|
signIn: handleSignIn,
|
|
196
217
|
signUp: handleSignUp,
|
|
197
218
|
signOut: handleSignOut,
|
|
@@ -201,7 +222,21 @@ function useAuth() {
|
|
|
201
222
|
resetPassword: handleResetPassword,
|
|
202
223
|
updatePassword: handleUpdatePassword,
|
|
203
224
|
changePassword: handleChangePassword,
|
|
204
|
-
resendVerificationEmail: handleResendVerificationEmail
|
|
225
|
+
resendVerificationEmail: handleResendVerificationEmail
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
function useAuth() {
|
|
229
|
+
var _a;
|
|
230
|
+
const session = authClient.useSession();
|
|
231
|
+
const actions = useAuthActions();
|
|
232
|
+
useEffect(() => {
|
|
233
|
+
if (!session.isPending && !session.error) setSessionHint(Boolean(session.data));
|
|
234
|
+
}, [session.isPending, session.error, session.data]);
|
|
235
|
+
return {
|
|
236
|
+
user: (_a = session.data) == null ? void 0 : _a.user,
|
|
237
|
+
session: session.data,
|
|
238
|
+
isLoading: session.isPending,
|
|
239
|
+
...actions,
|
|
205
240
|
isSigningIn: false,
|
|
206
241
|
// BetterAuth doesn't provide this directly
|
|
207
242
|
isSigningUp: false,
|
|
@@ -211,5 +246,6 @@ function useAuth() {
|
|
|
211
246
|
};
|
|
212
247
|
}
|
|
213
248
|
export {
|
|
214
|
-
useAuth
|
|
249
|
+
useAuth,
|
|
250
|
+
useAuthActions
|
|
215
251
|
};
|
|
@@ -45,7 +45,7 @@ function useEntityConfig(entityType, options = {}) {
|
|
|
45
45
|
const allEntities = getAllEntityConfigs();
|
|
46
46
|
const foundEntity = allEntities.find((entity) => entity.slug === entityType);
|
|
47
47
|
if (!foundEntity) {
|
|
48
|
-
const error = `
|
|
48
|
+
const error = `Entity "${entityType}" not found in the registry`;
|
|
49
49
|
setState({
|
|
50
50
|
config: null,
|
|
51
51
|
isLoading: false,
|
|
@@ -78,7 +78,7 @@ function useEntityConfig(entityType, options = {}) {
|
|
|
78
78
|
});
|
|
79
79
|
}
|
|
80
80
|
} catch (err) {
|
|
81
|
-
const error = err instanceof Error ? err.message : "
|
|
81
|
+
const error = err instanceof Error ? err.message : "Unknown error loading entity configuration";
|
|
82
82
|
setState({
|
|
83
83
|
config: null,
|
|
84
84
|
isLoading: false,
|
|
@@ -35,35 +35,35 @@ function useEntitySearch() {
|
|
|
35
35
|
{
|
|
36
36
|
id: "dashboard",
|
|
37
37
|
title: "Dashboard",
|
|
38
|
-
description: "
|
|
38
|
+
description: "Main panel with statistics and quick actions",
|
|
39
39
|
url: "/dashboard",
|
|
40
40
|
category: "Navigation"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
id: "profile",
|
|
44
|
-
title: "
|
|
45
|
-
description: "
|
|
44
|
+
title: "Profile Settings",
|
|
45
|
+
description: "Update personal information and preferences",
|
|
46
46
|
url: "/dashboard/settings/profile",
|
|
47
47
|
category: "Settings"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
id: "security",
|
|
51
|
-
title: "
|
|
52
|
-
description: "
|
|
51
|
+
title: "Security Settings",
|
|
52
|
+
description: "Two-factor authentication and active sessions",
|
|
53
53
|
url: "/dashboard/settings/security",
|
|
54
54
|
category: "Settings"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
id: "notifications",
|
|
58
|
-
title: "
|
|
59
|
-
description: "
|
|
58
|
+
title: "Notification Settings",
|
|
59
|
+
description: "Email and push notification preferences",
|
|
60
60
|
url: "/dashboard/settings/notifications",
|
|
61
61
|
category: "Settings"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
id: "billing",
|
|
65
|
-
title: "
|
|
66
|
-
description: "
|
|
65
|
+
title: "Billing",
|
|
66
|
+
description: "Plans, payment methods and billing history",
|
|
67
67
|
url: "/dashboard/settings/billing",
|
|
68
68
|
category: "Settings"
|
|
69
69
|
}
|
|
@@ -80,7 +80,7 @@ function useEntitySearch() {
|
|
|
80
80
|
return availableEntities.map((entity) => ({
|
|
81
81
|
id: `entity-${entity.slug}`,
|
|
82
82
|
title: entity.names.singular,
|
|
83
|
-
description: `
|
|
83
|
+
description: `Manage ${entity.names.plural.toLowerCase()}`,
|
|
84
84
|
entityType: entity.slug,
|
|
85
85
|
type: "entity",
|
|
86
86
|
url: `/dashboard/${entity.slug}`,
|
|
@@ -3,8 +3,8 @@ import { useState } from "react";
|
|
|
3
3
|
const EXAMPLE_NOTIFICATIONS = [
|
|
4
4
|
{
|
|
5
5
|
id: "1",
|
|
6
|
-
title: "
|
|
7
|
-
message: "
|
|
6
|
+
title: "Welcome to the Dashboard",
|
|
7
|
+
message: "Your account has been set up successfully. Explore all the available features.",
|
|
8
8
|
type: "success",
|
|
9
9
|
timestamp: new Date(Date.now() - 2 * 60 * 1e3),
|
|
10
10
|
// 2 minutos atrás
|
|
@@ -13,8 +13,8 @@ const EXAMPLE_NOTIFICATIONS = [
|
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
id: "2",
|
|
16
|
-
title: "
|
|
17
|
-
message: "
|
|
16
|
+
title: "New pending task",
|
|
17
|
+
message: "You have 3 incomplete tasks. Want to review them now?",
|
|
18
18
|
type: "info",
|
|
19
19
|
timestamp: new Date(Date.now() - 15 * 60 * 1e3),
|
|
20
20
|
// 15 minutos atrás
|
|
@@ -23,8 +23,8 @@ const EXAMPLE_NOTIFICATIONS = [
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
id: "3",
|
|
26
|
-
title: "
|
|
27
|
-
message: "
|
|
26
|
+
title: "Security settings",
|
|
27
|
+
message: "We recommend enabling two-factor authentication for extra security.",
|
|
28
28
|
type: "warning",
|
|
29
29
|
timestamp: new Date(Date.now() - 2 * 60 * 60 * 1e3),
|
|
30
30
|
// 2 horas atrás
|
|
@@ -33,8 +33,8 @@ const EXAMPLE_NOTIFICATIONS = [
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
id: "4",
|
|
36
|
-
title: "
|
|
37
|
-
message: "
|
|
36
|
+
title: "Profile updated",
|
|
37
|
+
message: "Your profile information has been updated successfully.",
|
|
38
38
|
type: "success",
|
|
39
39
|
timestamp: new Date(Date.now() - 24 * 60 * 60 * 1e3),
|
|
40
40
|
// 1 día atrás
|
|
@@ -43,8 +43,8 @@ const EXAMPLE_NOTIFICATIONS = [
|
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
id: "5",
|
|
46
|
-
title: "
|
|
47
|
-
message: "
|
|
46
|
+
title: "New login detected",
|
|
47
|
+
message: "A new sign-in was detected from Chrome in Mexico City.",
|
|
48
48
|
type: "info",
|
|
49
49
|
timestamp: new Date(Date.now() - 3 * 24 * 60 * 60 * 1e3),
|
|
50
50
|
// 3 días atrás
|
|
@@ -52,8 +52,8 @@ const EXAMPLE_NOTIFICATIONS = [
|
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
54
|
id: "6",
|
|
55
|
-
title: "Backup
|
|
56
|
-
message: "
|
|
55
|
+
title: "Backup completed",
|
|
56
|
+
message: "Your data has been backed up successfully.",
|
|
57
57
|
type: "success",
|
|
58
58
|
timestamp: new Date(Date.now() - 7 * 24 * 60 * 60 * 1e3),
|
|
59
59
|
// 1 semana atrás
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePrefetch.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrefetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"usePrefetch.d.ts","sourceRoot":"","sources":["../../src/hooks/usePrefetch.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,mBAAmB;;;EA0BlC;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,cAgBnD"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useQueryClient } from "@tanstack/react-query";
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import { TEAMS_QUERY_KEY, fetchUserTeams } from "../contexts/TeamContext.js";
|
|
5
|
+
import { useAuth } from "./useAuth.js";
|
|
5
6
|
const USER_PROFILE_QUERY_KEY = ["user-profile"];
|
|
6
7
|
async function fetchUserProfile() {
|
|
7
8
|
const response = await fetch("/api/user/profile");
|
|
@@ -12,6 +13,7 @@ async function fetchUserProfile() {
|
|
|
12
13
|
}
|
|
13
14
|
function usePrefetchSettings() {
|
|
14
15
|
const queryClient = useQueryClient();
|
|
16
|
+
const { user } = useAuth();
|
|
15
17
|
const prefetchProfile = useCallback(() => {
|
|
16
18
|
queryClient.prefetchQuery({
|
|
17
19
|
queryKey: USER_PROFILE_QUERY_KEY,
|
|
@@ -21,13 +23,15 @@ function usePrefetchSettings() {
|
|
|
21
23
|
});
|
|
22
24
|
}, [queryClient]);
|
|
23
25
|
const prefetchTeams = useCallback(() => {
|
|
26
|
+
if (!user) return;
|
|
24
27
|
queryClient.prefetchQuery({
|
|
25
|
-
|
|
28
|
+
// The key TeamProvider reads: the teams of this user
|
|
29
|
+
queryKey: [...TEAMS_QUERY_KEY, user.id],
|
|
26
30
|
queryFn: fetchUserTeams,
|
|
27
31
|
staleTime: 1e3 * 60 * 5
|
|
28
32
|
// 5 minutes
|
|
29
33
|
});
|
|
30
|
-
}, [queryClient]);
|
|
34
|
+
}, [queryClient, user]);
|
|
31
35
|
return {
|
|
32
36
|
prefetchProfile,
|
|
33
37
|
prefetchTeams
|
package/dist/hooks/useSearch.js
CHANGED
|
@@ -21,11 +21,11 @@ const generateEntitySearchResults = () => {
|
|
|
21
21
|
return {
|
|
22
22
|
id: `entity-${entry.name}`,
|
|
23
23
|
title: displayName,
|
|
24
|
-
description: `
|
|
24
|
+
description: `Manage ${((_c = (_b = config.names) == null ? void 0 : _b.plural) == null ? void 0 : _c.toLowerCase()) || displayName.toLowerCase()}`,
|
|
25
25
|
type: entry.name,
|
|
26
26
|
// Map to specific entity types
|
|
27
27
|
url: `/dashboard/${config.slug || entry.name}`,
|
|
28
|
-
category: "
|
|
28
|
+
category: "Entities",
|
|
29
29
|
entityType: entry.name,
|
|
30
30
|
priority: "medium"
|
|
31
31
|
};
|
|
@@ -41,43 +41,43 @@ const getSearchableFields = (entityConfig) => {
|
|
|
41
41
|
const SYSTEM_PAGES = [
|
|
42
42
|
{
|
|
43
43
|
title: "Dashboard",
|
|
44
|
-
description: "
|
|
44
|
+
description: "Main panel with statistics and quick actions",
|
|
45
45
|
type: "page",
|
|
46
46
|
url: "/dashboard"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
title: "
|
|
50
|
-
description: "
|
|
49
|
+
title: "Task Management",
|
|
50
|
+
description: "Create, edit and organize your tasks",
|
|
51
51
|
type: "page",
|
|
52
52
|
url: "/dashboard/tasks"
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
|
-
title: "
|
|
56
|
-
description: "
|
|
55
|
+
title: "Profile Settings",
|
|
56
|
+
description: "Update personal information and preferences",
|
|
57
57
|
type: "setting",
|
|
58
58
|
url: "/dashboard/settings/profile"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
title: "
|
|
62
|
-
description: "
|
|
61
|
+
title: "Security Settings",
|
|
62
|
+
description: "Two-factor authentication and active sessions",
|
|
63
63
|
type: "setting",
|
|
64
64
|
url: "/dashboard/settings/security"
|
|
65
65
|
},
|
|
66
66
|
{
|
|
67
|
-
title: "
|
|
68
|
-
description: "
|
|
67
|
+
title: "Notification Settings",
|
|
68
|
+
description: "Email and push notification preferences",
|
|
69
69
|
type: "setting",
|
|
70
70
|
url: "/dashboard/settings/notifications"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
title: "
|
|
74
|
-
description: "
|
|
73
|
+
title: "Password Settings",
|
|
74
|
+
description: "Change password and security options",
|
|
75
75
|
type: "setting",
|
|
76
76
|
url: "/dashboard/settings/password"
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
|
-
title: "
|
|
80
|
-
description: "
|
|
79
|
+
title: "Billing",
|
|
80
|
+
description: "Plans, payment methods and billing history",
|
|
81
81
|
type: "setting",
|
|
82
82
|
url: "/dashboard/settings/billing"
|
|
83
83
|
}
|
|
@@ -12,6 +12,21 @@ export interface UseSessionCookieRefreshOptions {
|
|
|
12
12
|
refreshOnMount?: boolean;
|
|
13
13
|
/** Set to false to turn the hook off (e.g. on public/auth pages). Default: true. */
|
|
14
14
|
enabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Called with each refresh's answer: the session, or `data: null` when there is
|
|
17
|
+
* none. `session.isCurrent()` turns false once the hook is turned off (a
|
|
18
|
+
* sign-out), so work the answer starts can drop what arrives after that.
|
|
19
|
+
*/
|
|
20
|
+
onRefresh?: (result: SessionRefreshResult, session: SessionRefreshContext) => void;
|
|
21
|
+
}
|
|
22
|
+
/** What `refreshSessionCookie()` answers. */
|
|
23
|
+
export type SessionRefreshResult = {
|
|
24
|
+
data?: unknown;
|
|
25
|
+
error?: unknown;
|
|
26
|
+
} | null | undefined;
|
|
27
|
+
/** Passed with each answer: whether the session it belongs to is still the page's. */
|
|
28
|
+
export interface SessionRefreshContext {
|
|
29
|
+
isCurrent: () => boolean;
|
|
15
30
|
}
|
|
16
31
|
export declare const DEFAULT_SESSION_REFRESH_INTERVAL_MS: number;
|
|
17
32
|
/**
|
|
@@ -29,7 +44,9 @@ export declare const DEFAULT_SESSION_REFRESH_INTERVAL_MS: number;
|
|
|
29
44
|
*
|
|
30
45
|
* Calls are throttled by `minIntervalMs`; a failed call (offline, server
|
|
31
46
|
* down) does not count towards the throttle, so the next trigger retries.
|
|
32
|
-
* Anonymous visitors just get a cheap `null` session response.
|
|
47
|
+
* Anonymous visitors just get a cheap `null` session response. Turning the
|
|
48
|
+
* hook off (a sign-out) drops the answer of a call still on the wire, and
|
|
49
|
+
* turning it on again reads the session at once, whatever the throttle says.
|
|
33
50
|
*/
|
|
34
51
|
export declare function useSessionCookieRefresh(options?: UseSessionCookieRefreshOptions): void;
|
|
35
52
|
//# sourceMappingURL=useSessionCookieRefresh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSessionCookieRefresh.d.ts","sourceRoot":"","sources":["../../src/hooks/useSessionCookieRefresh.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"useSessionCookieRefresh.d.ts","sourceRoot":"","sources":["../../src/hooks/useSessionCookieRefresh.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,oFAAoF;IACpF,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAA;CACnF;AAED,6CAA6C;AAC7C,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,CAAC,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,CAAA;AAEzF,sFAAsF;AACtF,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,OAAO,CAAA;CACzB;AAED,eAAO,MAAM,mCAAmC,QAAgB,CAAA;AAEhE;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,GAAE,8BAAmC,QAiEnF"}
|