@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
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Identifier Safety
|
|
3
|
+
*
|
|
4
|
+
* Registries import user-named things — themes, plugins, blocks — under aliases
|
|
5
|
+
* built from those names. The names come from slugs, so they carry whatever a
|
|
6
|
+
* directory name allows: hyphens, dots, and a leading digit ('7startups').
|
|
7
|
+
*
|
|
8
|
+
* Replacing hyphens is not enough. `as 7startupsAppConfig` is a parse error,
|
|
9
|
+
* and because every route reaches the app through these registries, one bad
|
|
10
|
+
* alias takes down the whole project rather than just that theme.
|
|
11
|
+
*
|
|
12
|
+
* @module core/scripts/build/registry/generators/identifier
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Turn a name into a valid JavaScript identifier.
|
|
17
|
+
*
|
|
18
|
+
* Only used to build aliases, never to look anything up: the real name stays
|
|
19
|
+
* in the string keys the registry is indexed by.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} name
|
|
22
|
+
* @returns {string}
|
|
23
|
+
*/
|
|
24
|
+
export function toSafeIdentifier(name) {
|
|
25
|
+
const cleaned = String(name).replace(/[^A-Za-z0-9_$]/g, '_')
|
|
26
|
+
if (cleaned === '') return '_'
|
|
27
|
+
return /^[0-9]/.test(cleaned) ? `_${cleaned}` : cleaned
|
|
28
|
+
}
|
|
@@ -12,6 +12,7 @@ export { generateEntityRegistry, generateEntityRegistryClient } from './entity-r
|
|
|
12
12
|
export { generateThemeRegistry } from './theme-registry.mjs'
|
|
13
13
|
export { generateTemplateRegistry, generateTemplateRegistryClient } from './template-registry.mjs'
|
|
14
14
|
export { generateBlockRegistry } from './block-registry.mjs'
|
|
15
|
+
export { generateIconRegistry } from './icon-registry.mjs'
|
|
15
16
|
export { generateMiddlewareRegistry } from './middleware-registry.mjs'
|
|
16
17
|
export { generateTranslationRegistry } from './translation-registry.mjs'
|
|
17
18
|
export { generateRouteHandlersRegistry } from './route-handlers.mjs'
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { join } from 'path'
|
|
10
|
+
import { toSafeIdentifier } from './identifier.mjs'
|
|
10
11
|
import { convertCorePath } from '../config.mjs'
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -27,7 +28,7 @@ export function generatePluginRegistry(plugins, config) {
|
|
|
27
28
|
const pagesServerImports = plugins
|
|
28
29
|
.filter(p => p.hasPagesServer)
|
|
29
30
|
.map(plugin =>
|
|
30
|
-
`import { devtoolsPage as ${plugin.name
|
|
31
|
+
`import { devtoolsPage as ${toSafeIdentifier(plugin.name)}DevtoolsPage, superadminPage as ${toSafeIdentifier(plugin.name)}SuperadminPage } from '@/contents/plugins/${plugin.name}/plugin.pages.server'`
|
|
31
32
|
)
|
|
32
33
|
.join('\n')
|
|
33
34
|
|
|
@@ -150,7 +151,7 @@ export type PluginName = keyof typeof PLUGIN_REGISTRY
|
|
|
150
151
|
|
|
151
152
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
152
153
|
export const PLUGIN_DEVTOOLS_PAGES: Record<string, any> = {
|
|
153
|
-
${plugins.filter(p => p.hasPagesServer).map(p => ` '${p.name}': ${p.name
|
|
154
|
+
${plugins.filter(p => p.hasPagesServer).map(p => ` '${p.name}': ${toSafeIdentifier(p.name)}DevtoolsPage,`).join('\n')}
|
|
154
155
|
}
|
|
155
156
|
|
|
156
157
|
// Maps plugin names to their superadmin page components.
|
|
@@ -159,7 +160,7 @@ ${plugins.filter(p => p.hasPagesServer).map(p => ` '${p.name}': ${p.name.replac
|
|
|
159
160
|
|
|
160
161
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
161
162
|
export const PLUGIN_SUPERADMIN_PAGES: Record<string, any> = {
|
|
162
|
-
${plugins.filter(p => p.hasPagesServer).map(p => ` '${p.name}': ${p.name
|
|
163
|
+
${plugins.filter(p => p.hasPagesServer).map(p => ` '${p.name}': ${toSafeIdentifier(p.name)}SuperadminPage,`).join('\n')}
|
|
163
164
|
}
|
|
164
165
|
|
|
165
166
|
// ==================== Navigation Helpers ====================
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* @module core/scripts/build/registry/generators/scheduled-actions-registry
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
import { toSafeIdentifier } from './identifier.mjs'
|
|
14
|
+
|
|
13
15
|
/**
|
|
14
16
|
* Generate the scheduled actions registry file
|
|
15
17
|
* @param {Array} themes - Discovered themes with hasScheduledActions property
|
|
@@ -22,13 +24,13 @@ export function generateScheduledActionsRegistry(themes, config) {
|
|
|
22
24
|
|
|
23
25
|
// Generate imports for each theme with scheduled actions
|
|
24
26
|
const imports = themesWithScheduledActions.map(theme => {
|
|
25
|
-
const safeThemeName = theme.name
|
|
27
|
+
const safeThemeName = toSafeIdentifier(theme.name)
|
|
26
28
|
return `import * as ${safeThemeName}ScheduledActions from '${theme.scheduledActionsPath}'`
|
|
27
29
|
}).join('\n')
|
|
28
30
|
|
|
29
31
|
// Generate the registry entries
|
|
30
32
|
const registryEntries = themesWithScheduledActions.map(theme => {
|
|
31
|
-
const safeThemeName = theme.name
|
|
33
|
+
const safeThemeName = toSafeIdentifier(theme.name)
|
|
32
34
|
return ` '${theme.name}': {
|
|
33
35
|
registerAllHandlers: ${safeThemeName}ScheduledActions.registerAllHandlers,
|
|
34
36
|
registerRecurringActions: ${safeThemeName}ScheduledActions.registerRecurringActions,
|
|
@@ -44,11 +44,11 @@ export function generateTemplateRegistry(templates, config) {
|
|
|
44
44
|
templatesByPath[appPath].sort((a, b) => b.priority - a.priority)
|
|
45
45
|
})
|
|
46
46
|
|
|
47
|
-
// Generate
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
// Generate registry entries. Each component is a deferred import, so a route
|
|
48
|
+
// pulls in the template it renders and no others.
|
|
49
|
+
const registryEntries = Object.entries(templatesByPath)
|
|
50
|
+
.map(([appPath, pathTemplates]) => {
|
|
50
51
|
const highestPriorityTemplate = pathTemplates[0]
|
|
51
|
-
const safeName = `Template_${index}`
|
|
52
52
|
// Strip .tsx/.ts extension - Next.js resolves extensions automatically on all platforms
|
|
53
53
|
let templatePath = highestPriorityTemplate.templatePath
|
|
54
54
|
if (templatePath.endsWith('.tsx')) {
|
|
@@ -57,25 +57,12 @@ export function generateTemplateRegistry(templates, config) {
|
|
|
57
57
|
templatePath = templatePath.slice(0, -3)
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
//
|
|
60
|
+
// Metadata-only templates (PROTECTED_RENDER or standalone .meta.ts) have
|
|
61
|
+
// no component to load
|
|
61
62
|
const isMetaOnly = highestPriorityTemplate.fileName?.endsWith('.meta.ts')
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return `import ${safeName} from '${templatePath}'`
|
|
67
|
-
})
|
|
68
|
-
.join('\n')
|
|
69
|
-
|
|
70
|
-
// Generate registry entries
|
|
71
|
-
const registryEntries = Object.entries(templatesByPath)
|
|
72
|
-
.map(([appPath, pathTemplates], index) => {
|
|
73
|
-
const highestPriorityTemplate = pathTemplates[0]
|
|
74
|
-
const safeName = `Template_${index}`
|
|
75
|
-
|
|
76
|
-
// For metadata-only templates (PROTECTED_RENDER or standalone .meta.ts), don't reference component
|
|
77
|
-
const isMetaOnly = highestPriorityTemplate.fileName?.endsWith('.meta.ts')
|
|
78
|
-
const componentRef = (!canOverrideComponent(appPath) || isMetaOnly) ? 'null' : safeName
|
|
63
|
+
const componentRef = (!canOverrideComponent(appPath) || isMetaOnly)
|
|
64
|
+
? 'null'
|
|
65
|
+
: `lazyTemplate('${appPath}', () => import('${templatePath}'))`
|
|
79
66
|
|
|
80
67
|
return ` '${appPath}': {
|
|
81
68
|
appPath: '${appPath}',
|
|
@@ -107,7 +94,35 @@ export function generateTemplateRegistry(templates, config) {
|
|
|
107
94
|
* DO NOT EDIT - This file is auto-generated by scripts/build-registry.mjs
|
|
108
95
|
*/
|
|
109
96
|
|
|
110
|
-
|
|
97
|
+
import React from 'react'
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Wrap a template module in an async Server Component that imports it while
|
|
101
|
+
* rendering, so a route's bundle carries the template it renders instead of
|
|
102
|
+
* every template in the app.
|
|
103
|
+
*
|
|
104
|
+
* Deliberately not next/dynamic: that wraps the component in a Suspense
|
|
105
|
+
* boundary, which would let a response commit a 200 before a template's own
|
|
106
|
+
* notFound() could run (#129). An async component has no such boundary — it
|
|
107
|
+
* awaits exactly like the data fetching these routes already do.
|
|
108
|
+
*/
|
|
109
|
+
function lazyTemplate(appPath: string, loader: () => Promise<{ default: any }>) {
|
|
110
|
+
return async function TemplateOverride(props: any) {
|
|
111
|
+
const templateModule = await loader()
|
|
112
|
+
|
|
113
|
+
// A template with no default export used to fall back to the app's own
|
|
114
|
+
// component; now that the module is only read at render time, name the
|
|
115
|
+
// template that is wrong instead of failing as an invalid element type.
|
|
116
|
+
if (!templateModule.default) {
|
|
117
|
+
throw new Error(
|
|
118
|
+
'Template override for "' + appPath + '" has no default export. ' +
|
|
119
|
+
'Add a default export to the template, or remove it from the theme.'
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return React.createElement(templateModule.default, props)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
111
126
|
|
|
112
127
|
export interface TemplateOverride {
|
|
113
128
|
name: string
|
|
@@ -200,7 +215,7 @@ async function hasServerOnlyExports(filePath) {
|
|
|
200
215
|
}
|
|
201
216
|
|
|
202
217
|
/**
|
|
203
|
-
* Generate client-safe template registry with
|
|
218
|
+
* Generate client-safe template registry with deferred imports
|
|
204
219
|
* Only includes page templates that can be safely imported in client components
|
|
205
220
|
* Excludes templates with server-only exports (generateMetadata, revalidate, etc.)
|
|
206
221
|
* @param {Array} templates - Discovered templates
|
|
@@ -256,11 +271,11 @@ export async function generateTemplateRegistryClient(templates, config) {
|
|
|
256
271
|
const clientCompatibleTemplatesResults = await Promise.all(clientCompatibleTemplatesPromises)
|
|
257
272
|
const clientCompatibleTemplates = clientCompatibleTemplatesResults.filter(Boolean)
|
|
258
273
|
|
|
259
|
-
// Generate
|
|
260
|
-
|
|
261
|
-
|
|
274
|
+
// Generate registry entries as deferred imports, so a route loads the
|
|
275
|
+
// template it renders and no others
|
|
276
|
+
const registryEntries = clientCompatibleTemplates
|
|
277
|
+
.map(([appPath, pathTemplates]) => {
|
|
262
278
|
const template = pathTemplates[0]
|
|
263
|
-
const safeName = `ClientTemplate_${index}`
|
|
264
279
|
// Strip .tsx/.ts extension - Next.js resolves extensions automatically on all platforms
|
|
265
280
|
let templatePath = template.templatePath
|
|
266
281
|
if (templatePath.endsWith('.tsx')) {
|
|
@@ -268,15 +283,7 @@ export async function generateTemplateRegistryClient(templates, config) {
|
|
|
268
283
|
} else if (templatePath.endsWith('.ts')) {
|
|
269
284
|
templatePath = templatePath.slice(0, -3)
|
|
270
285
|
}
|
|
271
|
-
return `
|
|
272
|
-
})
|
|
273
|
-
.join('\n')
|
|
274
|
-
|
|
275
|
-
// Generate registry entries with direct component references
|
|
276
|
-
const registryEntries = clientCompatibleTemplates
|
|
277
|
-
.map(([appPath, pathTemplates], index) => {
|
|
278
|
-
const safeName = `ClientTemplate_${index}`
|
|
279
|
-
return ` '${appPath}': ${safeName}`
|
|
286
|
+
return ` '${appPath}': dynamic(() => import('${templatePath}'))`
|
|
280
287
|
})
|
|
281
288
|
.join(',\n')
|
|
282
289
|
|
|
@@ -292,11 +299,12 @@ export async function generateTemplateRegistryClient(templates, config) {
|
|
|
292
299
|
'use client'
|
|
293
300
|
|
|
294
301
|
import { ComponentType } from 'react'
|
|
302
|
+
import dynamic from 'next/dynamic'
|
|
295
303
|
import { isProtectedPath } from '${convertCorePath('@/core/config/protected-paths', outputFilePath, config)}'
|
|
296
304
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
//
|
|
305
|
+
// Client-safe registry of deferred imports (auto-generated).
|
|
306
|
+
// next/dynamic rather than a static import: these are client components, so
|
|
307
|
+
// the lazy binding needs the Suspense boundary next/dynamic provides.
|
|
300
308
|
const CLIENT_TEMPLATE_REGISTRY: Record<string, ComponentType<any>> = {
|
|
301
309
|
${registryEntries}
|
|
302
310
|
}
|
|
@@ -309,7 +317,7 @@ export function hasTemplateOverrideClient(appPath: string): boolean {
|
|
|
309
317
|
}
|
|
310
318
|
|
|
311
319
|
/**
|
|
312
|
-
* Get template component
|
|
320
|
+
* Get template component (client-safe)
|
|
313
321
|
* Use this in client components to avoid metadata conflicts
|
|
314
322
|
*/
|
|
315
323
|
export function getTemplateOrDefaultClient<T extends ComponentType<any>>(
|
|
@@ -15,6 +15,8 @@ import { convertCorePath } from '../config.mjs'
|
|
|
15
15
|
* @param {object} config - Configuration object from getConfig()
|
|
16
16
|
* @returns {string} Generated TypeScript content
|
|
17
17
|
*/
|
|
18
|
+
import { toSafeIdentifier } from './identifier.mjs'
|
|
19
|
+
|
|
18
20
|
export function generateThemeRegistry(themes, config) {
|
|
19
21
|
const outputFilePath = join(config.outputDir, 'theme-registry.ts')
|
|
20
22
|
// Generate theme config imports
|
|
@@ -28,8 +30,7 @@ export function generateThemeRegistry(themes, config) {
|
|
|
28
30
|
const dashboardImports = themes
|
|
29
31
|
.filter(theme => theme.hasDashboardConfig)
|
|
30
32
|
.map(theme => {
|
|
31
|
-
|
|
32
|
-
const safeThemeName = theme.name.replace(/-/g, '_')
|
|
33
|
+
const safeThemeName = toSafeIdentifier(theme.name)
|
|
33
34
|
return `import { ${theme.dashboardConfigExportName || 'DASHBOARD_CONFIG'} as ${safeThemeName}DashboardConfig } from '${theme.dashboardConfigPath}'`
|
|
34
35
|
}).join('\n')
|
|
35
36
|
|
|
@@ -37,8 +38,7 @@ export function generateThemeRegistry(themes, config) {
|
|
|
37
38
|
const appImports = themes
|
|
38
39
|
.filter(theme => theme.hasAppConfig)
|
|
39
40
|
.map(theme => {
|
|
40
|
-
|
|
41
|
-
const safeThemeName = theme.name.replace(/-/g, '_')
|
|
41
|
+
const safeThemeName = toSafeIdentifier(theme.name)
|
|
42
42
|
return `import { ${theme.appConfigExportName || 'APP_CONFIG_OVERRIDES'} as ${safeThemeName}AppConfig } from '${theme.appConfigPath}'`
|
|
43
43
|
}).join('\n')
|
|
44
44
|
|
|
@@ -46,8 +46,7 @@ export function generateThemeRegistry(themes, config) {
|
|
|
46
46
|
const devImports = themes
|
|
47
47
|
.filter(theme => theme.hasDevConfig)
|
|
48
48
|
.map(theme => {
|
|
49
|
-
|
|
50
|
-
const safeThemeName = theme.name.replace(/-/g, '_')
|
|
49
|
+
const safeThemeName = toSafeIdentifier(theme.name)
|
|
51
50
|
return `import { ${theme.devConfigExportName || 'DEV_CONFIG_OVERRIDES'} as ${safeThemeName}DevConfig } from '${theme.devConfigPath}'`
|
|
52
51
|
}).join('\n')
|
|
53
52
|
|
|
@@ -59,7 +58,7 @@ export function generateThemeRegistry(themes, config) {
|
|
|
59
58
|
|
|
60
59
|
const registryEntries = themes.map(theme => {
|
|
61
60
|
const configName = theme.exportName || `${theme.name}ThemeConfig`
|
|
62
|
-
const safeThemeName = theme.name
|
|
61
|
+
const safeThemeName = toSafeIdentifier(theme.name)
|
|
63
62
|
const dashboardConfigName = theme.hasDashboardConfig ? `${safeThemeName}DashboardConfig` : 'null'
|
|
64
63
|
const appConfigName = theme.hasAppConfig ? `${safeThemeName}AppConfig` : 'null'
|
|
65
64
|
const devConfigName = theme.hasDevConfig ? `${safeThemeName}DevConfig` : 'null'
|