@nextsparkjs/core 0.1.0-beta.188 → 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.js +2 -2
- 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
|
@@ -9,6 +9,11 @@ import {
|
|
|
9
9
|
import { authenticateRequest, createAuthFailureResponse } from '@nextsparkjs/core/lib/api/auth/dual-auth'
|
|
10
10
|
import { withRateLimitTier } from '@nextsparkjs/core/lib/api/rate-limit'
|
|
11
11
|
import { TeamService } from '@nextsparkjs/core/lib/services'
|
|
12
|
+
import {
|
|
13
|
+
ACTIVE_TEAM_COOKIE,
|
|
14
|
+
ACTIVE_TEAM_COOKIE_MAX_AGE,
|
|
15
|
+
activeTeamCookieValue,
|
|
16
|
+
} from '@nextsparkjs/core/lib/teams/active-team-cookie'
|
|
12
17
|
import { z } from 'zod'
|
|
13
18
|
|
|
14
19
|
const switchTeamSchema = z.object({
|
|
@@ -35,6 +40,19 @@ export const POST = withRateLimitTier(withApiLogging(async (req: NextRequest): P
|
|
|
35
40
|
return authResult.rateLimitResponse as NextResponse
|
|
36
41
|
}
|
|
37
42
|
|
|
43
|
+
// The active team is remembered per browser session, in the activeTeamId
|
|
44
|
+
// cookie. An API key chooses the team on each request with x-team-id, so for
|
|
45
|
+
// it there is nothing to switch.
|
|
46
|
+
if (authResult.type !== 'session' || !authResult.sessionId) {
|
|
47
|
+
const response = createApiError(
|
|
48
|
+
'API keys choose the team on each request with the x-team-id header',
|
|
49
|
+
400,
|
|
50
|
+
null,
|
|
51
|
+
'SESSION_REQUIRED'
|
|
52
|
+
)
|
|
53
|
+
return addCorsHeaders(response, req)
|
|
54
|
+
}
|
|
55
|
+
|
|
38
56
|
const body = await req.json()
|
|
39
57
|
const validatedData = switchTeamSchema.parse(body)
|
|
40
58
|
|
|
@@ -48,15 +66,16 @@ export const POST = withRateLimitTier(withApiLogging(async (req: NextRequest): P
|
|
|
48
66
|
message: 'Active team switched successfully',
|
|
49
67
|
})
|
|
50
68
|
|
|
51
|
-
//
|
|
52
|
-
//
|
|
69
|
+
// Remember the team for server-side reads (the dashboard layouts through
|
|
70
|
+
// the proxy, server actions, resolveTeamContext), bound to this session so
|
|
71
|
+
// a later session on the same browser does not inherit it.
|
|
53
72
|
// SECURITY: httpOnly prevents client-side JS manipulation
|
|
54
|
-
response.cookies.set(
|
|
73
|
+
response.cookies.set(ACTIVE_TEAM_COOKIE, activeTeamCookieValue(authResult.sessionId, validatedData.teamId), {
|
|
55
74
|
path: '/',
|
|
56
|
-
httpOnly: true,
|
|
75
|
+
httpOnly: true,
|
|
57
76
|
secure: process.env.NODE_ENV === 'production',
|
|
58
77
|
sameSite: 'lax',
|
|
59
|
-
maxAge:
|
|
78
|
+
maxAge: ACTIVE_TEAM_COOKIE_MAX_AGE,
|
|
60
79
|
})
|
|
61
80
|
|
|
62
81
|
return addCorsHeaders(response, req)
|
|
@@ -8,14 +8,17 @@
|
|
|
8
8
|
*
|
|
9
9
|
* Flow:
|
|
10
10
|
* 1. User navigates to /dashboard/companies/create
|
|
11
|
-
* 2.
|
|
12
|
-
*
|
|
11
|
+
* 2. The proxy forwards the session's active team, taken from the
|
|
12
|
+
* activeTeamId cookie only when this session wrote it; without one, the
|
|
13
|
+
* user's default team is checked
|
|
14
|
+
* 3. This layout takes that team (getDashboardTeamId) and checks permission via checkPermission()
|
|
13
15
|
* 4. If denied, redirects to /dashboard/permission-denied
|
|
14
16
|
* 5. If allowed, renders the page (children)
|
|
15
17
|
*/
|
|
16
|
-
import { headers
|
|
18
|
+
import { headers } from 'next/headers'
|
|
17
19
|
import { redirect } from 'next/navigation'
|
|
18
20
|
import { checkPermission } from '@nextsparkjs/core/lib/permissions/check'
|
|
21
|
+
import { getDashboardTeamId } from '@nextsparkjs/core/lib/teams/dashboard-team'
|
|
19
22
|
import { isValidPermission } from '@nextsparkjs/core/lib/permissions/init'
|
|
20
23
|
import type { Permission } from '@nextsparkjs/core/lib/permissions/types'
|
|
21
24
|
|
|
@@ -59,7 +62,6 @@ export default async function EntityPermissionLayout({
|
|
|
59
62
|
}: EntityLayoutProps) {
|
|
60
63
|
const { entity } = await params
|
|
61
64
|
const headersList = await headers()
|
|
62
|
-
const cookieStore = await cookies()
|
|
63
65
|
|
|
64
66
|
// Get pathname from middleware header
|
|
65
67
|
const pathname = headersList.get('x-pathname') || ''
|
|
@@ -67,12 +69,12 @@ export default async function EntityPermissionLayout({
|
|
|
67
69
|
// Get userId from middleware header (set for all authenticated routes)
|
|
68
70
|
const userId = headersList.get('x-user-id')
|
|
69
71
|
|
|
70
|
-
//
|
|
71
|
-
const teamId =
|
|
72
|
+
// The team this session chose, or the user's default team until it has one
|
|
73
|
+
const teamId = userId ? await getDashboardTeamId(headersList, userId) : null
|
|
72
74
|
|
|
73
75
|
// Skip validation if missing required data
|
|
74
76
|
// - No userId: middleware will redirect to login (shouldn't happen for dashboard routes)
|
|
75
|
-
// - No teamId: user
|
|
77
|
+
// - No teamId: the user belongs to no team, let page handle it
|
|
76
78
|
if (!userId || !teamId) {
|
|
77
79
|
console.log('[EntityPermissionLayout] Skipping validation - missing data:', {
|
|
78
80
|
entity,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* IMPORTANT: Permission checking MUST be in this layout (not in [entity]/layout.tsx)
|
|
10
10
|
* because (templates) routes with specific paths take precedence over dynamic [entity] routes.
|
|
11
11
|
*/
|
|
12
|
-
import { headers
|
|
12
|
+
import { headers } from 'next/headers'
|
|
13
13
|
import { redirect } from 'next/navigation'
|
|
14
14
|
import { DashboardShell } from '@nextsparkjs/core/components/dashboard/layouts/DashboardShell'
|
|
15
15
|
import { serializeEntityConfig, type SerializableEntityConfig } from '@nextsparkjs/core/lib/entities/serialization'
|
|
@@ -17,6 +17,7 @@ import { setEntityRegistry } from '@nextsparkjs/core/lib/entities/queries'
|
|
|
17
17
|
import { getTemplateOrDefault } from '@nextsparkjs/core/lib/template-resolver'
|
|
18
18
|
import type { EntityConfig, ChildEntityDefinition } from '@nextsparkjs/core/lib/entities/types'
|
|
19
19
|
import { checkPermission } from '@nextsparkjs/core/lib/permissions/check'
|
|
20
|
+
import { getDashboardTeamId } from '@nextsparkjs/core/lib/teams/dashboard-team'
|
|
20
21
|
import { isValidPermission } from '@nextsparkjs/core/lib/permissions/init'
|
|
21
22
|
import type { Permission } from '@nextsparkjs/core/lib/permissions/types'
|
|
22
23
|
// Import registry directly - webpack resolves @nextsparkjs/registries alias at compile time
|
|
@@ -64,11 +65,11 @@ async function DefaultMainDashboardLayout({
|
|
|
64
65
|
|
|
65
66
|
// === PERMISSION CHECK ===
|
|
66
67
|
const headersList = await headers()
|
|
67
|
-
const cookieStore = await cookies()
|
|
68
68
|
|
|
69
69
|
const pathname = headersList.get('x-pathname') || ''
|
|
70
70
|
const userId = headersList.get('x-user-id')
|
|
71
|
-
|
|
71
|
+
// The team this session chose, or the user's default team until it has one
|
|
72
|
+
const teamId = userId ? await getDashboardTeamId(headersList, userId) : null
|
|
72
73
|
|
|
73
74
|
if (userId && teamId && pathname) {
|
|
74
75
|
const parsed = parseEntityFromPathname(pathname)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useState } from 'react';
|
|
4
|
+
import { useLocale } from 'next-intl';
|
|
4
5
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
|
5
6
|
import { Button } from '@nextsparkjs/core/components/ui/button';
|
|
6
7
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@nextsparkjs/core/components/ui/card';
|
|
@@ -66,6 +67,7 @@ function ApiKeysPage() {
|
|
|
66
67
|
const [newApiKey, setNewApiKey] = useState<NewApiKeyResponse | null>(null);
|
|
67
68
|
const [selectedKey, setSelectedKey] = useState<string | null>(null);
|
|
68
69
|
const queryClient = useQueryClient();
|
|
70
|
+
const locale = useLocale();
|
|
69
71
|
|
|
70
72
|
// Fetch API keys
|
|
71
73
|
const { data: apiKeys, isLoading, error } = useQuery<ApiKey[]>({
|
|
@@ -138,7 +140,7 @@ function ApiKeysPage() {
|
|
|
138
140
|
};
|
|
139
141
|
|
|
140
142
|
const formatDate = (dateString: string) => {
|
|
141
|
-
return new Date(dateString).toLocaleDateString(
|
|
143
|
+
return new Date(dateString).toLocaleDateString(locale, {
|
|
142
144
|
year: 'numeric',
|
|
143
145
|
month: 'short',
|
|
144
146
|
day: 'numeric',
|
|
@@ -162,7 +164,7 @@ function ApiKeysPage() {
|
|
|
162
164
|
<div>
|
|
163
165
|
<h1 className="text-2xl font-bold">API Keys</h1>
|
|
164
166
|
<p className="text-muted-foreground">
|
|
165
|
-
|
|
167
|
+
Manage API keys for external integration
|
|
166
168
|
</p>
|
|
167
169
|
</div>
|
|
168
170
|
<Alert variant={isPermissionError ? "default" : "destructive"}>
|
|
@@ -170,10 +172,10 @@ function ApiKeysPage() {
|
|
|
170
172
|
<AlertDescription>
|
|
171
173
|
{isPermissionError ? (
|
|
172
174
|
<div>
|
|
173
|
-
<strong>
|
|
175
|
+
<strong>Restricted access</strong>
|
|
174
176
|
<p className="mt-1">
|
|
175
|
-
|
|
176
|
-
|
|
177
|
+
Only administrators can manage API keys.
|
|
178
|
+
Contact an administrator if you need access to this feature.
|
|
177
179
|
</p>
|
|
178
180
|
</div>
|
|
179
181
|
) : (
|
|
@@ -191,12 +193,12 @@ function ApiKeysPage() {
|
|
|
191
193
|
<div>
|
|
192
194
|
<h1 className="text-2xl font-bold" data-cy={sel('settings.apiKeys.header')}>API Keys</h1>
|
|
193
195
|
<p className="text-muted-foreground">
|
|
194
|
-
|
|
196
|
+
Manage API keys for external integration
|
|
195
197
|
</p>
|
|
196
198
|
</div>
|
|
197
199
|
<Button onClick={() => setShowCreateDialog(true)} data-cy={sel('settings.apiKeys.createButton')}>
|
|
198
200
|
<Plus className="h-4 w-4 mr-2" />
|
|
199
|
-
|
|
201
|
+
Create API Key
|
|
200
202
|
</Button>
|
|
201
203
|
</div>
|
|
202
204
|
|
|
@@ -239,11 +241,11 @@ function ApiKeysPage() {
|
|
|
239
241
|
<Key className="h-12 w-12 text-muted-foreground mb-4" />
|
|
240
242
|
<h3 className="text-lg font-semibold mb-2">No API Keys</h3>
|
|
241
243
|
<p className="text-muted-foreground text-center mb-4">
|
|
242
|
-
|
|
244
|
+
You don't have any API keys yet. Create one to start using the external API.
|
|
243
245
|
</p>
|
|
244
246
|
<Button onClick={() => setShowCreateDialog(true)} data-cy={sel('settings.apiKeys.createButton')}>
|
|
245
247
|
<Plus className="h-4 w-4 mr-2" />
|
|
246
|
-
|
|
248
|
+
Create first API Key
|
|
247
249
|
</Button>
|
|
248
250
|
</CardContent>
|
|
249
251
|
</Card>
|
|
@@ -257,7 +259,7 @@ function ApiKeysPage() {
|
|
|
257
259
|
{apiKey.name}
|
|
258
260
|
{apiKey.status !== 'active' && (
|
|
259
261
|
<Badge variant="secondary" data-cy={sel('settings.apiKeys.row.status', { id: apiKey.id })}>
|
|
260
|
-
{apiKey.status === 'inactive' ? '
|
|
262
|
+
{apiKey.status === 'inactive' ? 'Inactive' : 'Expired'}
|
|
261
263
|
</Badge>
|
|
262
264
|
)}
|
|
263
265
|
</CardTitle>
|
|
@@ -276,7 +278,7 @@ function ApiKeysPage() {
|
|
|
276
278
|
</div>
|
|
277
279
|
<div className="flex items-center gap-2">
|
|
278
280
|
<Badge variant={apiKey.status === 'active' ? "default" : "secondary"} data-cy={sel('settings.apiKeys.row.status', { id: apiKey.id })}>
|
|
279
|
-
{apiKey.status === 'active' ? '
|
|
281
|
+
{apiKey.status === 'active' ? 'Active' : apiKey.status === 'inactive' ? 'Inactive' : 'Expired'}
|
|
280
282
|
</Badge>
|
|
281
283
|
<DropdownMenu>
|
|
282
284
|
<DropdownMenuTrigger asChild>
|
|
@@ -290,7 +292,7 @@ function ApiKeysPage() {
|
|
|
290
292
|
data-cy={sel('settings.apiKeys.row.menu.viewDetails', { id: apiKey.id })}
|
|
291
293
|
>
|
|
292
294
|
<Eye className="h-4 w-4 mr-2" />
|
|
293
|
-
|
|
295
|
+
View details
|
|
294
296
|
</DropdownMenuItem>
|
|
295
297
|
<DropdownMenuItem
|
|
296
298
|
onClick={() => toggleApiKey.mutate({
|
|
@@ -303,12 +305,12 @@ function ApiKeysPage() {
|
|
|
303
305
|
{apiKey.status === 'active' ? (
|
|
304
306
|
<>
|
|
305
307
|
<EyeOff className="h-4 w-4 mr-2" />
|
|
306
|
-
|
|
308
|
+
Deactivate
|
|
307
309
|
</>
|
|
308
310
|
) : (
|
|
309
311
|
<>
|
|
310
312
|
<Eye className="h-4 w-4 mr-2" />
|
|
311
|
-
|
|
313
|
+
Activate
|
|
312
314
|
</>
|
|
313
315
|
)}
|
|
314
316
|
</DropdownMenuItem>
|
|
@@ -319,7 +321,7 @@ function ApiKeysPage() {
|
|
|
319
321
|
data-cy={sel('settings.apiKeys.row.menu.revoke', { id: apiKey.id })}
|
|
320
322
|
>
|
|
321
323
|
<Trash2 className="h-4 w-4 mr-2" />
|
|
322
|
-
|
|
324
|
+
Revoke
|
|
323
325
|
</DropdownMenuItem>
|
|
324
326
|
</DropdownMenuContent>
|
|
325
327
|
</DropdownMenu>
|
|
@@ -330,7 +332,7 @@ function ApiKeysPage() {
|
|
|
330
332
|
<div className="space-y-4">
|
|
331
333
|
{/* Scopes */}
|
|
332
334
|
<div data-cy={sel('settings.apiKeys.row.scopes', { id: apiKey.id })}>
|
|
333
|
-
<strong className="text-sm">
|
|
335
|
+
<strong className="text-sm">Permissions:</strong>
|
|
334
336
|
<div className="flex flex-wrap gap-1 mt-1">
|
|
335
337
|
{apiKey.scopes.map((scope) => (
|
|
336
338
|
<Badge
|
|
@@ -352,11 +354,11 @@ function ApiKeysPage() {
|
|
|
352
354
|
<div className="font-semibold">{apiKey.usage_stats.total_requests.toLocaleString()}</div>
|
|
353
355
|
</div>
|
|
354
356
|
<div data-cy={sel('settings.apiKeys.row.stats.last24h', { id: apiKey.id })}>
|
|
355
|
-
<div className="text-muted-foreground"
|
|
357
|
+
<div className="text-muted-foreground">Last 24h</div>
|
|
356
358
|
<div className="font-semibold">{apiKey.usage_stats.last_24h.toLocaleString()}</div>
|
|
357
359
|
</div>
|
|
358
360
|
<div data-cy={sel('settings.apiKeys.row.stats.avgTime', { id: apiKey.id })}>
|
|
359
|
-
<div className="text-muted-foreground">
|
|
361
|
+
<div className="text-muted-foreground">Avg time</div>
|
|
360
362
|
<div className="font-semibold">
|
|
361
363
|
{apiKey.usage_stats.avg_response_time
|
|
362
364
|
? `${Math.round(apiKey.usage_stats.avg_response_time)}ms`
|
|
@@ -368,12 +370,12 @@ function ApiKeysPage() {
|
|
|
368
370
|
|
|
369
371
|
{/* Metadata */}
|
|
370
372
|
<div className="text-sm text-muted-foreground space-y-1" data-cy={sel('settings.apiKeys.row.metadata.container', { id: apiKey.id })}>
|
|
371
|
-
<div data-cy={sel('settings.apiKeys.row.metadata.createdAt', { id: apiKey.id })}>
|
|
373
|
+
<div data-cy={sel('settings.apiKeys.row.metadata.createdAt', { id: apiKey.id })}>Created: {formatDate(apiKey.createdAt)}</div>
|
|
372
374
|
{apiKey.lastUsedAt && (
|
|
373
|
-
<div data-cy={sel('settings.apiKeys.row.metadata.lastUsed', { id: apiKey.id })}>
|
|
375
|
+
<div data-cy={sel('settings.apiKeys.row.metadata.lastUsed', { id: apiKey.id })}>Last used: {formatDate(apiKey.lastUsedAt)}</div>
|
|
374
376
|
)}
|
|
375
377
|
{apiKey.expiresAt && (
|
|
376
|
-
<div data-cy={sel('settings.apiKeys.row.metadata.expiresAt', { id: apiKey.id })}>
|
|
378
|
+
<div data-cy={sel('settings.apiKeys.row.metadata.expiresAt', { id: apiKey.id })}>Expires: {formatDate(apiKey.expiresAt)}</div>
|
|
377
379
|
)}
|
|
378
380
|
</div>
|
|
379
381
|
</div>
|
|
@@ -427,9 +429,9 @@ function ApiKeyDetailsDialog({
|
|
|
427
429
|
<Dialog open={open} onOpenChange={onClose}>
|
|
428
430
|
<DialogContent className="max-w-2xl" data-cy={sel('settings.apiKeys.detailsDialog.container')}>
|
|
429
431
|
<DialogHeader>
|
|
430
|
-
<DialogTitle data-cy={sel('settings.apiKeys.detailsDialog.title')}>
|
|
432
|
+
<DialogTitle data-cy={sel('settings.apiKeys.detailsDialog.title')}>API Key Details</DialogTitle>
|
|
431
433
|
<DialogDescription>
|
|
432
|
-
|
|
434
|
+
Usage statistics and configuration
|
|
433
435
|
</DialogDescription>
|
|
434
436
|
</DialogHeader>
|
|
435
437
|
|
|
@@ -443,17 +445,17 @@ function ApiKeyDetailsDialog({
|
|
|
443
445
|
<div className="space-y-6" data-cy={sel('settings.apiKeys.detailsDialog.content')}>
|
|
444
446
|
{/* Basic Info */}
|
|
445
447
|
<div data-cy={sel('settings.apiKeys.detailsDialog.basicInfo.container')}>
|
|
446
|
-
<h4 className="font-semibold mb-2">
|
|
448
|
+
<h4 className="font-semibold mb-2">Basic information</h4>
|
|
447
449
|
<div className="grid grid-cols-2 gap-4 text-sm">
|
|
448
450
|
<div>
|
|
449
|
-
<span className="text-muted-foreground">
|
|
451
|
+
<span className="text-muted-foreground">Name:</span>
|
|
450
452
|
<div className="font-medium" data-cy={sel('settings.apiKeys.detailsDialog.basicInfo.name')}>{keyDetails.name}</div>
|
|
451
453
|
</div>
|
|
452
454
|
<div>
|
|
453
|
-
<span className="text-muted-foreground">
|
|
455
|
+
<span className="text-muted-foreground">Status:</span>
|
|
454
456
|
<div>
|
|
455
457
|
<Badge variant={keyDetails.status === 'active' ? "default" : "secondary"} data-cy={sel('settings.apiKeys.detailsDialog.basicInfo.status')}>
|
|
456
|
-
{keyDetails.status === 'active' ? '
|
|
458
|
+
{keyDetails.status === 'active' ? 'Active' : keyDetails.status === 'inactive' ? 'Inactive' : 'Expired'}
|
|
457
459
|
</Badge>
|
|
458
460
|
</div>
|
|
459
461
|
</div>
|
|
@@ -464,27 +466,27 @@ function ApiKeyDetailsDialog({
|
|
|
464
466
|
<div data-cy={sel('settings.apiKeys.detailsDialog.stats.container')}>
|
|
465
467
|
<h4 className="font-semibold mb-2 flex items-center gap-2">
|
|
466
468
|
<Activity className="h-4 w-4" />
|
|
467
|
-
|
|
469
|
+
Usage statistics
|
|
468
470
|
</h4>
|
|
469
471
|
<div className="grid grid-cols-2 gap-4 text-sm">
|
|
470
472
|
<div>
|
|
471
|
-
<span className="text-muted-foreground">Total
|
|
473
|
+
<span className="text-muted-foreground">Total requests:</span>
|
|
472
474
|
<div className="font-medium" data-cy={sel('settings.apiKeys.detailsDialog.stats.totalRequests')}>{keyDetails.usage_stats.total_requests.toLocaleString()}</div>
|
|
473
475
|
</div>
|
|
474
476
|
<div>
|
|
475
|
-
<span className="text-muted-foreground">
|
|
477
|
+
<span className="text-muted-foreground">Last 24 hours:</span>
|
|
476
478
|
<div className="font-medium" data-cy={sel('settings.apiKeys.detailsDialog.stats.last24h')}>{keyDetails.usage_stats.last_24h.toLocaleString()}</div>
|
|
477
479
|
</div>
|
|
478
480
|
<div>
|
|
479
|
-
<span className="text-muted-foreground">
|
|
481
|
+
<span className="text-muted-foreground">Last 7 days:</span>
|
|
480
482
|
<div className="font-medium" data-cy={sel('settings.apiKeys.detailsDialog.stats.last7d')}>{keyDetails.usage_stats.last_7d.toLocaleString()}</div>
|
|
481
483
|
</div>
|
|
482
484
|
<div>
|
|
483
|
-
<span className="text-muted-foreground">
|
|
485
|
+
<span className="text-muted-foreground">Last 30 days:</span>
|
|
484
486
|
<div className="font-medium" data-cy={sel('settings.apiKeys.detailsDialog.stats.last30d')}>{keyDetails.usage_stats.last_30d.toLocaleString()}</div>
|
|
485
487
|
</div>
|
|
486
488
|
<div>
|
|
487
|
-
<span className="text-muted-foreground">
|
|
489
|
+
<span className="text-muted-foreground">Avg response time:</span>
|
|
488
490
|
<div className="font-medium" data-cy={sel('settings.apiKeys.detailsDialog.stats.avgTime')}>
|
|
489
491
|
{keyDetails.usage_stats.avg_response_time
|
|
490
492
|
? `${Math.round(keyDetails.usage_stats.avg_response_time)}ms`
|
|
@@ -493,7 +495,7 @@ function ApiKeyDetailsDialog({
|
|
|
493
495
|
</div>
|
|
494
496
|
</div>
|
|
495
497
|
<div>
|
|
496
|
-
<span className="text-muted-foreground">
|
|
498
|
+
<span className="text-muted-foreground">Success rate:</span>
|
|
497
499
|
<div className="font-medium" data-cy={sel('settings.apiKeys.detailsDialog.stats.successRate')}>
|
|
498
500
|
{keyDetails.usage_stats.success_rate
|
|
499
501
|
? `${Math.round(keyDetails.usage_stats.success_rate)}%`
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
import { profileSchema, ProfileFormData } from '@nextsparkjs/core/lib/validation'
|
|
63
63
|
import { countries, timezones } from '@nextsparkjs/core/lib/countries-timezones'
|
|
64
64
|
import { sel } from '@nextsparkjs/core/selectors'
|
|
65
|
-
import { useTranslations } from 'next-intl'
|
|
65
|
+
import { useLocale, useTranslations } from 'next-intl'
|
|
66
66
|
import { getTemplateOrDefaultClient } from '@nextsparkjs/registries/template-registry.client'
|
|
67
67
|
|
|
68
68
|
// Language options
|
|
@@ -82,6 +82,7 @@ function ProfilePage() {
|
|
|
82
82
|
const [timezoneOpen, setTimezoneOpen] = useState(false)
|
|
83
83
|
const [countryOpen, setCountryOpen] = useState(false)
|
|
84
84
|
const t = useTranslations('settings')
|
|
85
|
+
const locale = useLocale()
|
|
85
86
|
|
|
86
87
|
// Form setup
|
|
87
88
|
const {
|
|
@@ -450,9 +451,9 @@ function ProfilePage() {
|
|
|
450
451
|
</PopoverTrigger>
|
|
451
452
|
<PopoverContent className="w-[400px] p-0">
|
|
452
453
|
<Command>
|
|
453
|
-
<CommandInput placeholder=
|
|
454
|
+
<CommandInput placeholder={t('profile.form.countrySearchPlaceholder')} className="h-9" />
|
|
454
455
|
<CommandList>
|
|
455
|
-
<CommandEmpty>
|
|
456
|
+
<CommandEmpty>{t('profile.form.countryNotFound')}</CommandEmpty>
|
|
456
457
|
<CommandGroup>
|
|
457
458
|
{countries.map((country) => (
|
|
458
459
|
<CommandItem
|
|
@@ -502,9 +503,9 @@ function ProfilePage() {
|
|
|
502
503
|
</PopoverTrigger>
|
|
503
504
|
<PopoverContent className="w-[400px] p-0">
|
|
504
505
|
<Command>
|
|
505
|
-
<CommandInput placeholder=
|
|
506
|
+
<CommandInput placeholder={t('profile.form.timezoneSearchPlaceholder')} className="h-9" />
|
|
506
507
|
<CommandList>
|
|
507
|
-
<CommandEmpty>
|
|
508
|
+
<CommandEmpty>{t('profile.form.timezoneNotFound')}</CommandEmpty>
|
|
508
509
|
<CommandGroup>
|
|
509
510
|
{timezones.map((timezone) => (
|
|
510
511
|
<CommandItem
|
|
@@ -540,7 +541,7 @@ function ProfilePage() {
|
|
|
540
541
|
<Calendar className="h-4 w-4" />
|
|
541
542
|
<span className="font-medium">{t('profile.form.memberSince')}:</span>
|
|
542
543
|
<span>
|
|
543
|
-
{profile && new Date(profile.createdAt).toLocaleDateString(
|
|
544
|
+
{profile && new Date(profile.createdAt).toLocaleDateString(locale, {
|
|
544
545
|
month: 'long',
|
|
545
546
|
day: 'numeric',
|
|
546
547
|
year: 'numeric'
|
|
@@ -39,6 +39,7 @@ import { getTemplateOrDefaultClient } from '@nextsparkjs/registries/template-reg
|
|
|
39
39
|
|
|
40
40
|
function SecurityPage() {
|
|
41
41
|
const t = useTranslations('settings')
|
|
42
|
+
const tCommon = useTranslations('common')
|
|
42
43
|
|
|
43
44
|
// Hook para manejar user metadata con autenticación de sesión
|
|
44
45
|
const {
|
|
@@ -79,7 +80,7 @@ function SecurityPage() {
|
|
|
79
80
|
browser: 'Chrome 120',
|
|
80
81
|
location: 'Buenos Aires, Argentina',
|
|
81
82
|
ip: '192.168.1.100',
|
|
82
|
-
lastActive: '2
|
|
83
|
+
lastActive: tCommon('relativeTime.minutesAgo', { minutes: 2 }),
|
|
83
84
|
current: true,
|
|
84
85
|
icon: <Monitor className="h-4 w-4" />
|
|
85
86
|
},
|
|
@@ -89,7 +90,7 @@ function SecurityPage() {
|
|
|
89
90
|
browser: 'Safari Mobile',
|
|
90
91
|
location: 'Buenos Aires, Argentina',
|
|
91
92
|
ip: '192.168.1.101',
|
|
92
|
-
lastActive: '1
|
|
93
|
+
lastActive: tCommon('relativeTime.hoursAgo', { hours: 1 }),
|
|
93
94
|
current: false,
|
|
94
95
|
icon: <Smartphone className="h-4 w-4" />
|
|
95
96
|
},
|
|
@@ -99,7 +100,7 @@ function SecurityPage() {
|
|
|
99
100
|
browser: 'Chrome 119',
|
|
100
101
|
location: 'Córdoba, Argentina',
|
|
101
102
|
ip: '200.45.123.45',
|
|
102
|
-
lastActive: '3
|
|
103
|
+
lastActive: tCommon('relativeTime.daysAgo', { days: 3 }),
|
|
103
104
|
current: false,
|
|
104
105
|
icon: <Globe className="h-4 w-4" />
|
|
105
106
|
}
|
|
@@ -126,7 +127,7 @@ function SecurityPage() {
|
|
|
126
127
|
{
|
|
127
128
|
id: '3',
|
|
128
129
|
success: false,
|
|
129
|
-
location: 'Madrid,
|
|
130
|
+
location: 'Madrid, Spain',
|
|
130
131
|
device: 'Unknown - Chrome',
|
|
131
132
|
timestamp: '2024-01-14 22:15:00',
|
|
132
133
|
ip: '85.123.45.67'
|
|
@@ -27,10 +27,9 @@ import "./globals.css"
|
|
|
27
27
|
import { getBillingResourceHints } from "@nextsparkjs/core/lib/billing/gateways/factory"
|
|
28
28
|
import { StaticIntlProvider } from "@nextsparkjs/core/providers/static-intl-provider"
|
|
29
29
|
import { QueryProvider } from "@nextsparkjs/core/providers/query-provider"
|
|
30
|
+
import { SessionCookieRefresher } from "@nextsparkjs/core/components/auth/SessionCookieRefresher"
|
|
30
31
|
import { ThemeProvider as NextThemeProvider } from "@nextsparkjs/core/providers/theme-provider"
|
|
31
32
|
import { ThemeProvider as CustomThemeProvider } from "@nextsparkjs/core/lib/theme/ThemeProvider"
|
|
32
|
-
import { TeamProvider } from "@nextsparkjs/core/contexts/TeamContext"
|
|
33
|
-
import { SubscriptionProvider } from "@nextsparkjs/core/contexts/SubscriptionContext"
|
|
34
33
|
import { Toaster } from "@nextsparkjs/core/components/ui/sonner"
|
|
35
34
|
import { getMetadataOrDefault } from '@nextsparkjs/core/lib/template-resolver'
|
|
36
35
|
import { DEFAULT_LOCALE, DEFAULT_THEME_MODE, STATIC_MESSAGES } from '@nextsparkjs/registries/translation-registry'
|
|
@@ -88,13 +87,14 @@ export default async function RootLayout({
|
|
|
88
87
|
disableTransitionOnChange
|
|
89
88
|
>
|
|
90
89
|
<CustomThemeProvider>
|
|
90
|
+
{/* TeamProvider and SubscriptionProvider are mounted by DashboardProviders in the
|
|
91
|
+
dashboard, superadmin and devtools layouts, not here: on a public page they
|
|
92
|
+
would fetch a signed-in visitor's teams and subscription and re-sync the
|
|
93
|
+
activeTeamId cookie for nothing. */}
|
|
91
94
|
<QueryProvider>
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
<Suspense><Toaster position="bottom-left" /></Suspense>
|
|
96
|
-
</SubscriptionProvider>
|
|
97
|
-
</TeamProvider>
|
|
95
|
+
<main>{children}</main>
|
|
96
|
+
<SessionCookieRefresher />
|
|
97
|
+
<Suspense><Toaster position="bottom-left" /></Suspense>
|
|
98
98
|
</QueryProvider>
|
|
99
99
|
</CustomThemeProvider>
|
|
100
100
|
</NextThemeProvider>
|
package/templates/app/layout.tsx
CHANGED
|
@@ -16,8 +16,6 @@ import { ThemeProvider as NextThemeProvider } from "@nextsparkjs/core/providers/
|
|
|
16
16
|
import { ThemeProvider as CustomThemeProvider } from "@nextsparkjs/core/lib/theme/ThemeProvider"
|
|
17
17
|
import { Toaster } from "@nextsparkjs/core/components/ui/sonner"
|
|
18
18
|
import { QueryProvider } from "@nextsparkjs/core/providers/query-provider"
|
|
19
|
-
import { TeamProvider } from "@nextsparkjs/core/contexts/TeamContext"
|
|
20
|
-
import { SubscriptionProvider } from "@nextsparkjs/core/contexts/SubscriptionContext"
|
|
21
19
|
import { getUserLocale } from '@nextsparkjs/core/lib/locale'
|
|
22
20
|
import { TranslationContextManager } from "@nextsparkjs/core/providers/TranslationContextManager"
|
|
23
21
|
import { SessionCookieRefresher } from "@nextsparkjs/core/components/auth/SessionCookieRefresher"
|
|
@@ -97,22 +95,19 @@ export default async function RootLayout({
|
|
|
97
95
|
disableTransitionOnChange
|
|
98
96
|
>
|
|
99
97
|
<CustomThemeProvider>
|
|
100
|
-
{/*
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
{/* TeamProvider and SubscriptionProvider are mounted by DashboardProviders in the
|
|
99
|
+
dashboard, superadmin and devtools layouts, not here: on a public page they
|
|
100
|
+
would fetch a signed-in visitor's teams and subscription and re-sync the
|
|
101
|
+
activeTeamId cookie for nothing. */}
|
|
103
102
|
<QueryProvider>
|
|
104
|
-
<
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
<main>{children}</main>
|
|
113
|
-
<Suspense><Toaster position="bottom-left" /></Suspense>
|
|
114
|
-
</SubscriptionProvider>
|
|
115
|
-
</TeamProvider>
|
|
103
|
+
<TranslationContextManager />
|
|
104
|
+
{/* Real session-cookie renewal for installed PWAs: the render-time
|
|
105
|
+
session reads above (getUserLocale/getThemeSettings) cannot
|
|
106
|
+
write cookies, so the rolling refresh is triggered from the
|
|
107
|
+
client through the auth Route Handler instead. */}
|
|
108
|
+
<SessionCookieRefresher />
|
|
109
|
+
<main>{children}</main>
|
|
110
|
+
<Suspense><Toaster position="bottom-left" /></Suspense>
|
|
116
111
|
</QueryProvider>
|
|
117
112
|
</CustomThemeProvider>
|
|
118
113
|
</NextThemeProvider>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import { Button } from '
|
|
3
|
-
import { buildSectionClasses } from '
|
|
2
|
+
import { Button } from '@nextsparkjs/core/components/ui/button'
|
|
3
|
+
import { buildSectionClasses } from '@nextsparkjs/core/types/blocks'
|
|
4
4
|
import type { CTASectionBlockProps } from './schema'
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -97,3 +97,6 @@ export function CTASectionBlock({
|
|
|
97
97
|
</section>
|
|
98
98
|
)
|
|
99
99
|
}
|
|
100
|
+
|
|
101
|
+
// The generated block registry imports this as the module's default.
|
|
102
|
+
export default CTASectionBlock
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BlockConfig } from '
|
|
1
|
+
import type { BlockConfig } from '@nextsparkjs/core/types/blocks'
|
|
2
2
|
|
|
3
3
|
export const config: Omit<BlockConfig, 'schema' | 'fieldDefinitions' | 'Component' | 'examples'> = {
|
|
4
4
|
slug: 'cta-section',
|
|
@@ -6,5 +6,6 @@ export const config: Omit<BlockConfig, 'schema' | 'fieldDefinitions' | 'Componen
|
|
|
6
6
|
description: 'Call-to-action section with title, description, and action buttons',
|
|
7
7
|
category: 'cta',
|
|
8
8
|
icon: 'Megaphone',
|
|
9
|
-
thumbnail: '/theme/blocks/cta-section/thumbnail.png'
|
|
9
|
+
thumbnail: '/theme/blocks/cta-section/thumbnail.png',
|
|
10
|
+
scope: ['pages']
|
|
10
11
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { FieldDefinition } from '
|
|
1
|
+
import type { FieldDefinition } from '@nextsparkjs/core/types/blocks'
|
|
2
2
|
import {
|
|
3
3
|
baseContentFields,
|
|
4
4
|
baseDesignFields,
|
|
5
5
|
baseAdvancedFields,
|
|
6
|
-
} from '
|
|
6
|
+
} from '@nextsparkjs/core/types/blocks'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* CTA Section Block Field Definitions
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import { baseBlockSchema, ctaSchema } from '
|
|
2
|
+
import { baseBlockSchema, ctaSchema } from '@nextsparkjs/core/types/blocks'
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Secondary Button Schema (CTA-specific)
|
|
@@ -27,6 +27,6 @@ export const ctaSectionSpecificSchema = z.object({
|
|
|
27
27
|
/**
|
|
28
28
|
* Complete CTA Section Block Schema
|
|
29
29
|
*/
|
|
30
|
-
export const schema = baseBlockSchema.
|
|
30
|
+
export const schema = baseBlockSchema.extend(ctaSectionSpecificSchema.shape)
|
|
31
31
|
|
|
32
32
|
export type CTASectionBlockProps = z.infer<typeof schema>
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
+
// Icon names come from page content, so there is no build-time set to import
|
|
3
|
+
// from the way entity and sidebar icons have (see core's lib/icons). lucide's
|
|
4
|
+
// by-name loader resolves them, but it declares a chunk per icon and that map
|
|
5
|
+
// lands in webpack's runtime, which every route in the app pays for — to spare
|
|
6
|
+
// the few that render this block.
|
|
2
7
|
import * as Icons from 'lucide-react'
|
|
3
|
-
import { cn } from '
|
|
4
|
-
import { buildSectionClasses } from '
|
|
8
|
+
import { cn } from '@nextsparkjs/core/lib/utils'
|
|
9
|
+
import { buildSectionClasses } from '@nextsparkjs/core/types/blocks'
|
|
5
10
|
import type { FeaturesGridBlockProps, FeatureItem } from './schema'
|
|
6
11
|
|
|
7
12
|
/**
|
|
@@ -109,3 +114,6 @@ export function FeaturesGridBlock({
|
|
|
109
114
|
</section>
|
|
110
115
|
)
|
|
111
116
|
}
|
|
117
|
+
|
|
118
|
+
// The generated block registry imports this as the module's default.
|
|
119
|
+
export default FeaturesGridBlock
|