@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
|
@@ -101,32 +101,31 @@ class EntityErrorBoundary extends React.Component {
|
|
|
101
101
|
};
|
|
102
102
|
getErrorMessage = (error, entityType) => {
|
|
103
103
|
const errorType = this.getErrorType(error);
|
|
104
|
-
const entityName = entityType ? ` de ${entityType}` : "";
|
|
105
104
|
switch (errorType) {
|
|
106
105
|
case "network":
|
|
107
106
|
return {
|
|
108
|
-
title: "Error
|
|
109
|
-
description: `
|
|
107
|
+
title: "Connection Error",
|
|
108
|
+
description: `Could not connect to the server${entityType ? ` to load ${entityType}` : ""}. Check your internet connection.`
|
|
110
109
|
};
|
|
111
110
|
case "permission":
|
|
112
111
|
return {
|
|
113
|
-
title: "
|
|
114
|
-
description: `
|
|
112
|
+
title: "No Permissions",
|
|
113
|
+
description: `You don't have the necessary permissions to access ${entityType || "this data"}.`
|
|
115
114
|
};
|
|
116
115
|
case "not-found":
|
|
117
116
|
return {
|
|
118
|
-
title: "
|
|
119
|
-
description: `
|
|
117
|
+
title: "Resource Not Found",
|
|
118
|
+
description: `What you requested${entityType ? ` from ${entityType}` : ""} is not available or has been deleted.`
|
|
120
119
|
};
|
|
121
120
|
case "configuration":
|
|
122
121
|
return {
|
|
123
|
-
title: "Error
|
|
124
|
-
description: `
|
|
122
|
+
title: "Configuration Error",
|
|
123
|
+
description: `There is a problem with the configuration${entityType ? ` of ${entityType}` : ""}. Contact the administrator.`
|
|
125
124
|
};
|
|
126
125
|
default:
|
|
127
126
|
return {
|
|
128
|
-
title: "Error
|
|
129
|
-
description: `
|
|
127
|
+
title: "Unexpected Error",
|
|
128
|
+
description: `An unexpected error occurred${entityType ? ` while loading ${entityType}` : ""}. Our team has been notified.`
|
|
130
129
|
};
|
|
131
130
|
}
|
|
132
131
|
};
|
|
@@ -156,9 +155,9 @@ class EntityErrorBoundary extends React.Component {
|
|
|
156
155
|
className: "inline-flex items-center",
|
|
157
156
|
children: [
|
|
158
157
|
/* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4 mr-2" }),
|
|
159
|
-
"
|
|
158
|
+
"Retry (",
|
|
160
159
|
this.maxRetries - this.retryCount,
|
|
161
|
-
"
|
|
160
|
+
" attempts remaining)"
|
|
162
161
|
]
|
|
163
162
|
}
|
|
164
163
|
),
|
|
@@ -170,7 +169,7 @@ class EntityErrorBoundary extends React.Component {
|
|
|
170
169
|
className: "inline-flex items-center",
|
|
171
170
|
children: [
|
|
172
171
|
/* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4 mr-2" }),
|
|
173
|
-
"
|
|
172
|
+
"Reset"
|
|
174
173
|
]
|
|
175
174
|
}
|
|
176
175
|
),
|
|
@@ -182,7 +181,7 @@ class EntityErrorBoundary extends React.Component {
|
|
|
182
181
|
className: "inline-flex items-center",
|
|
183
182
|
children: [
|
|
184
183
|
/* @__PURE__ */ jsx(Home, { className: "h-4 w-4 mr-2" }),
|
|
185
|
-
"
|
|
184
|
+
"Go to Dashboard"
|
|
186
185
|
]
|
|
187
186
|
}
|
|
188
187
|
),
|
|
@@ -194,14 +193,14 @@ class EntityErrorBoundary extends React.Component {
|
|
|
194
193
|
className: "inline-flex items-center",
|
|
195
194
|
children: [
|
|
196
195
|
/* @__PURE__ */ jsx(RefreshCw, { className: "h-4 w-4 mr-2" }),
|
|
197
|
-
"
|
|
196
|
+
"Reload Page"
|
|
198
197
|
]
|
|
199
198
|
}
|
|
200
199
|
)
|
|
201
200
|
] }),
|
|
202
201
|
(showDetails || process.env.NODE_ENV === "development") && errorInfo && /* @__PURE__ */ jsxs(Alert, { children: [
|
|
203
202
|
/* @__PURE__ */ jsx(Bug, { className: "h-4 w-4" }),
|
|
204
|
-
/* @__PURE__ */ jsx(AlertTitle, { children: "
|
|
203
|
+
/* @__PURE__ */ jsx(AlertTitle, { children: "Error Details (Development)" }),
|
|
205
204
|
/* @__PURE__ */ jsx(AlertDescription, { className: "mt-2", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2 text-sm font-mono", children: [
|
|
206
205
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
207
206
|
/* @__PURE__ */ jsx("strong", { children: "Error ID:" }),
|
|
@@ -209,17 +208,17 @@ class EntityErrorBoundary extends React.Component {
|
|
|
209
208
|
errorId
|
|
210
209
|
] }),
|
|
211
210
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
212
|
-
/* @__PURE__ */ jsx("strong", { children: "
|
|
211
|
+
/* @__PURE__ */ jsx("strong", { children: "Type:" }),
|
|
213
212
|
" ",
|
|
214
213
|
errorType
|
|
215
214
|
] }),
|
|
216
215
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
217
|
-
/* @__PURE__ */ jsx("strong", { children: "
|
|
216
|
+
/* @__PURE__ */ jsx("strong", { children: "Entity:" }),
|
|
218
217
|
" ",
|
|
219
218
|
entityType || "N/A"
|
|
220
219
|
] }),
|
|
221
220
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
222
|
-
/* @__PURE__ */ jsx("strong", { children: "
|
|
221
|
+
/* @__PURE__ */ jsx("strong", { children: "Message:" }),
|
|
223
222
|
" ",
|
|
224
223
|
error.message
|
|
225
224
|
] }),
|
|
@@ -234,7 +233,7 @@ class EntityErrorBoundary extends React.Component {
|
|
|
234
233
|
] }) })
|
|
235
234
|
] }),
|
|
236
235
|
/* @__PURE__ */ jsxs("div", { className: "text-center text-sm text-gray-500", children: [
|
|
237
|
-
"
|
|
236
|
+
"If the problem persists, contact technical support with the ID: ",
|
|
238
237
|
/* @__PURE__ */ jsx("code", { className: "bg-gray-100 px-1 rounded", children: errorId })
|
|
239
238
|
] })
|
|
240
239
|
] })
|
|
@@ -79,7 +79,7 @@ function EntityDetailWrapper({
|
|
|
79
79
|
if (!entityConfig || !id) return;
|
|
80
80
|
if (dataLoadedRef.current) return;
|
|
81
81
|
if (!entityConfig.enabled) {
|
|
82
|
-
const error = new Error(`
|
|
82
|
+
const error = new Error(`Entity "${entityType}" is disabled`);
|
|
83
83
|
setDataError(error.message);
|
|
84
84
|
onError == null ? void 0 : onError(error);
|
|
85
85
|
return;
|
|
@@ -124,7 +124,7 @@ function EntityDetailWrapper({
|
|
|
124
124
|
dataLoadedRef.current = true;
|
|
125
125
|
} catch (err) {
|
|
126
126
|
console.error(`[EntityDetailWrapper] Error loading data for "${entityType}" ${id}:`, err);
|
|
127
|
-
const errorMessage = `Error
|
|
127
|
+
const errorMessage = `Error loading data: ${err instanceof Error ? err.message : "Unknown error"}`;
|
|
128
128
|
setDataError(errorMessage);
|
|
129
129
|
setData(null);
|
|
130
130
|
if (onError) {
|
|
@@ -179,7 +179,7 @@ function EntityDetailWrapper({
|
|
|
179
179
|
setDataError(null);
|
|
180
180
|
} catch (err) {
|
|
181
181
|
console.error(`[EntityDetailWrapper] Error reloading data:`, err);
|
|
182
|
-
const errorMessage = `Error
|
|
182
|
+
const errorMessage = `Error reloading data: ${err instanceof Error ? err.message : "Unknown error"}`;
|
|
183
183
|
setDataError(errorMessage);
|
|
184
184
|
} finally {
|
|
185
185
|
setIsLoadingData(false);
|
|
@@ -266,7 +266,7 @@ function EntityDetailWrapper({
|
|
|
266
266
|
return /* @__PURE__ */ jsx(SkeletonEntityDetail, {});
|
|
267
267
|
}
|
|
268
268
|
if (configError || !entityConfig) {
|
|
269
|
-
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: configError || `
|
|
269
|
+
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: configError || `Could not load the configuration for entity "${entityType}".` }) });
|
|
270
270
|
}
|
|
271
271
|
if (isLoadingData) {
|
|
272
272
|
return /* @__PURE__ */ jsx(SkeletonEntityDetail, {});
|
|
@@ -275,7 +275,7 @@ function EntityDetailWrapper({
|
|
|
275
275
|
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: dataError }) });
|
|
276
276
|
}
|
|
277
277
|
if (!data) {
|
|
278
|
-
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: "No
|
|
278
|
+
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: "No data found for this entity." }) });
|
|
279
279
|
}
|
|
280
280
|
return /* @__PURE__ */ jsx(
|
|
281
281
|
EntityDetail,
|
|
@@ -34,7 +34,7 @@ function EntityFormWrapper({
|
|
|
34
34
|
const loadInitialData = async () => {
|
|
35
35
|
if (mode === "edit" && id && entityConfig) {
|
|
36
36
|
if (!entityConfig.enabled) {
|
|
37
|
-
onError == null ? void 0 : onError(new Error(`
|
|
37
|
+
onError == null ? void 0 : onError(new Error(`Entity "${entityType}" is disabled`));
|
|
38
38
|
return;
|
|
39
39
|
}
|
|
40
40
|
try {
|
|
@@ -87,7 +87,7 @@ function EntityFormWrapper({
|
|
|
87
87
|
);
|
|
88
88
|
}
|
|
89
89
|
if (configError || !entityConfig) {
|
|
90
|
-
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: configError || `
|
|
90
|
+
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: configError || `Could not load the configuration for entity "${entityType}".` }) });
|
|
91
91
|
}
|
|
92
92
|
const customActions = additionalHeaderActions ? /* @__PURE__ */ jsx(Fragment, { children: additionalHeaderActions }) : void 0;
|
|
93
93
|
return /* @__PURE__ */ jsx("div", { className: "p-6", children: /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto space-y-6", children: [
|
|
@@ -68,7 +68,7 @@ function EntityListWrapper({
|
|
|
68
68
|
const loadData = useCallback(async (isInitial = false) => {
|
|
69
69
|
if (!entityConfig) return;
|
|
70
70
|
if (!entityConfig.enabled) {
|
|
71
|
-
setDataError(`
|
|
71
|
+
setDataError(`Entity "${entityType}" is disabled`);
|
|
72
72
|
return;
|
|
73
73
|
}
|
|
74
74
|
try {
|
|
@@ -90,7 +90,7 @@ function EntityListWrapper({
|
|
|
90
90
|
setDataError(null);
|
|
91
91
|
} catch (err) {
|
|
92
92
|
console.error(`[EntityListWrapper] Error loading data for "${entityType}":`, err);
|
|
93
|
-
setDataError(`Error
|
|
93
|
+
setDataError(`Error loading data: ${err instanceof Error ? err.message : "Unknown error"}`);
|
|
94
94
|
setData([]);
|
|
95
95
|
} finally {
|
|
96
96
|
setIsInitialLoad(false);
|
|
@@ -191,7 +191,7 @@ function EntityListWrapper({
|
|
|
191
191
|
return /* @__PURE__ */ jsx(SkeletonEntityList, {});
|
|
192
192
|
}
|
|
193
193
|
if (configError || !entityConfig) {
|
|
194
|
-
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: configError || `
|
|
194
|
+
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: configError || `Could not load the configuration for entity "${entityType}".` }) });
|
|
195
195
|
}
|
|
196
196
|
if (dataError) {
|
|
197
197
|
return /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(AlertDescription, { children: dataError }) });
|
|
@@ -18,21 +18,21 @@ function NoPermission({
|
|
|
18
18
|
const getActionText = () => {
|
|
19
19
|
switch (action) {
|
|
20
20
|
case "list":
|
|
21
|
-
return "
|
|
21
|
+
return "view the list of";
|
|
22
22
|
case "read":
|
|
23
|
-
return "
|
|
23
|
+
return "view the details of";
|
|
24
24
|
case "create":
|
|
25
|
-
return "
|
|
25
|
+
return "create";
|
|
26
26
|
case "update":
|
|
27
|
-
return "
|
|
27
|
+
return "edit";
|
|
28
28
|
case "delete":
|
|
29
|
-
return "
|
|
29
|
+
return "delete";
|
|
30
30
|
default:
|
|
31
|
-
return "
|
|
31
|
+
return "access";
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
const defaultTitle = title || "
|
|
35
|
-
const defaultDescription = description || (entityName ? `
|
|
34
|
+
const defaultTitle = title || "Access denied";
|
|
35
|
+
const defaultDescription = description || (entityName ? `You don't have permission to ${getActionText()} ${entityName}. Contact your administrator if you need access.` : "You don't have permission to access this section. Contact your administrator if you need access.");
|
|
36
36
|
return /* @__PURE__ */ jsx(
|
|
37
37
|
"div",
|
|
38
38
|
{
|
|
@@ -53,13 +53,13 @@ function NoPermission({
|
|
|
53
53
|
className: "w-full",
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }),
|
|
56
|
-
"
|
|
56
|
+
"Go back"
|
|
57
57
|
]
|
|
58
58
|
}
|
|
59
59
|
),
|
|
60
60
|
showHomeButton && /* @__PURE__ */ jsx(Button, { asChild: true, className: "w-full", children: /* @__PURE__ */ jsxs(Link, { href: redirectPath, children: [
|
|
61
61
|
/* @__PURE__ */ jsx(Home, { className: "mr-2 h-4 w-4" }),
|
|
62
|
-
"
|
|
62
|
+
"Go to Dashboard"
|
|
63
63
|
] }) })
|
|
64
64
|
] })
|
|
65
65
|
] }) })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/public/pageBuilder/PageRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"PageRenderer.d.ts","sourceRoot":"","sources":["../../../../src/components/public/pageBuilder/PageRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAkC1D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,aAAa,EAAE,CAAA;QACvB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CA+BvD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { normalizeBlockProps } from "../../../lib/blocks/loader.js";
|
|
3
|
+
import { getBlockComponentSSR } from "../../../lib/blocks/loader.server.js";
|
|
3
4
|
function BlockError({ blockSlug }) {
|
|
4
5
|
return /* @__PURE__ */ jsx("div", { className: "w-full py-12 px-4 bg-destructive/10 border border-destructive/20 rounded", children: /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto text-center", children: [
|
|
5
6
|
/* @__PURE__ */ jsxs("p", { className: "text-destructive", children: [
|
|
@@ -56,8 +56,8 @@ function NotificationsPageSkeleton() {
|
|
|
56
56
|
return /* @__PURE__ */ jsx(
|
|
57
57
|
SettingsPageSkeleton,
|
|
58
58
|
{
|
|
59
|
-
title: "
|
|
60
|
-
description: "
|
|
59
|
+
title: "Notifications",
|
|
60
|
+
description: "Choose how and when you want to be notified.",
|
|
61
61
|
sectionsCount: 3,
|
|
62
62
|
itemsPerSection: 3
|
|
63
63
|
}
|
|
@@ -67,8 +67,8 @@ function SecurityPageSkeleton() {
|
|
|
67
67
|
return /* @__PURE__ */ jsxs("div", { className: "container mx-auto p-6 max-w-4xl", children: [
|
|
68
68
|
/* @__PURE__ */ jsx("div", { className: "mb-8", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-4", children: [
|
|
69
69
|
/* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
70
|
-
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "
|
|
71
|
-
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "
|
|
70
|
+
/* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold tracking-tight", children: "Security" }),
|
|
71
|
+
/* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Keep your account safe with these security settings." })
|
|
72
72
|
] }),
|
|
73
73
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-10 w-32" }),
|
|
74
74
|
" "
|
|
@@ -66,14 +66,14 @@ function SettingsSidebar({ className }) {
|
|
|
66
66
|
}));
|
|
67
67
|
}, [hasPassword]);
|
|
68
68
|
const handleNavigation = useCallback((itemName, itemDescription) => {
|
|
69
|
-
setStatusMessage(
|
|
70
|
-
}, []);
|
|
69
|
+
setStatusMessage(t("a11y.navigatingToAnnouncement", { name: itemName, description: itemDescription }));
|
|
70
|
+
}, [t]);
|
|
71
71
|
const handleKeyDown = useCallback((e, href, itemName, itemDescription) => {
|
|
72
72
|
if (e.key === "Enter" || e.key === " ") {
|
|
73
73
|
e.preventDefault();
|
|
74
|
-
setStatusMessage(
|
|
74
|
+
setStatusMessage(t("a11y.navigatingToAnnouncement", { name: itemName, description: itemDescription }));
|
|
75
75
|
}
|
|
76
|
-
}, []);
|
|
76
|
+
}, [t]);
|
|
77
77
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
78
78
|
/* @__PURE__ */ jsx(
|
|
79
79
|
"div",
|
|
@@ -89,7 +89,7 @@ function SettingsSidebar({ className }) {
|
|
|
89
89
|
{
|
|
90
90
|
className: cn("space-y-2", className),
|
|
91
91
|
role: "navigation",
|
|
92
|
-
"aria-label": "
|
|
92
|
+
"aria-label": t("a11y.settingsNavigation"),
|
|
93
93
|
"data-cy": sel("settings.sidebar.container"),
|
|
94
94
|
children: /* @__PURE__ */ jsxs("div", { className: "px-3 py-2", children: [
|
|
95
95
|
/* @__PURE__ */ jsxs(
|
|
@@ -144,7 +144,7 @@ function SettingsSidebar({ className }) {
|
|
|
144
144
|
{
|
|
145
145
|
name: tSettings(`navigation.${item.name}`),
|
|
146
146
|
description: tSettings(`overview.${item.name}Description`),
|
|
147
|
-
current: isActive ? "
|
|
147
|
+
current: isActive ? t("a11y.currentPageSuffix") : ""
|
|
148
148
|
}
|
|
149
149
|
),
|
|
150
150
|
className: cn(
|
|
@@ -13,6 +13,8 @@ export interface MultiSelectFilterProps {
|
|
|
13
13
|
onChange: (values: string[]) => void;
|
|
14
14
|
/** Additional class names for the trigger button */
|
|
15
15
|
className?: string;
|
|
16
|
+
/** Label for the button that clears the whole field */
|
|
17
|
+
clearLabel?: string;
|
|
16
18
|
/** data-cy attribute for E2E testing */
|
|
17
19
|
'data-cy'?: string;
|
|
18
20
|
}
|
|
@@ -37,5 +39,5 @@ export interface MultiSelectFilterProps {
|
|
|
37
39
|
* data-cy="filter-status"
|
|
38
40
|
* />
|
|
39
41
|
*/
|
|
40
|
-
export declare function MultiSelectFilter({ label, options, values, onChange, className, 'data-cy': dataCy, }: MultiSelectFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare function MultiSelectFilter({ label, options, values, onChange, className, clearLabel, 'data-cy': dataCy, }: MultiSelectFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
41
43
|
//# sourceMappingURL=MultiSelectFilter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MultiSelectFilter.d.ts","sourceRoot":"","sources":["../../../src/components/shared/MultiSelectFilter.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,+BAA+B;IAC/B,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,sCAAsC;IACtC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACpC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EAAE,MAA8B,GAC1C,EAAE,sBAAsB,
|
|
1
|
+
{"version":3,"file":"MultiSelectFilter.d.ts","sourceRoot":"","sources":["../../../src/components/shared/MultiSelectFilter.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB;IACrC,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,+BAA+B;IAC/B,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,gCAAgC;IAChC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,sCAAsC;IACtC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IACpC,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uDAAuD;IACvD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,EACR,SAAS,EACT,UAAoB,EACpB,SAAS,EAAE,MAA8B,GAC1C,EAAE,sBAAsB,2CA8HxB"}
|
|
@@ -15,6 +15,7 @@ function MultiSelectFilter({
|
|
|
15
15
|
values,
|
|
16
16
|
onChange,
|
|
17
17
|
className,
|
|
18
|
+
clearLabel = "Clear",
|
|
18
19
|
"data-cy": dataCy = "multi-select-filter"
|
|
19
20
|
}) {
|
|
20
21
|
const [open, setOpen] = useState(false);
|
|
@@ -74,6 +75,7 @@ function MultiSelectFilter({
|
|
|
74
75
|
return /* @__PURE__ */ jsxs(
|
|
75
76
|
"button",
|
|
76
77
|
{
|
|
78
|
+
type: "button",
|
|
77
79
|
onClick: () => handleToggle(option.value),
|
|
78
80
|
className: cn(
|
|
79
81
|
"w-full text-left px-3 py-2 text-sm rounded-md",
|
|
@@ -108,6 +110,7 @@ function MultiSelectFilter({
|
|
|
108
110
|
/* @__PURE__ */ jsx(
|
|
109
111
|
"button",
|
|
110
112
|
{
|
|
113
|
+
type: "button",
|
|
111
114
|
onClick: (e) => handleRemove(option.value, e),
|
|
112
115
|
className: "hover:bg-primary/20 rounded-sm p-0.5 transition-colors",
|
|
113
116
|
"aria-label": `Remove ${option.label}`,
|
|
@@ -119,17 +122,18 @@ function MultiSelectFilter({
|
|
|
119
122
|
},
|
|
120
123
|
option.value
|
|
121
124
|
)),
|
|
122
|
-
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
123
126
|
"button",
|
|
124
127
|
{
|
|
128
|
+
type: "button",
|
|
125
129
|
onClick: handleClearAll,
|
|
126
130
|
className: cn(
|
|
127
131
|
"text-xs text-muted-foreground hover:text-foreground",
|
|
128
132
|
"px-1.5 py-1 transition-colors"
|
|
129
133
|
),
|
|
130
|
-
"aria-label":
|
|
134
|
+
"aria-label": `Clear ${label} filter`,
|
|
131
135
|
"data-cy": `${dataCy}-clear-all`,
|
|
132
|
-
children:
|
|
136
|
+
children: clearLabel
|
|
133
137
|
}
|
|
134
138
|
)
|
|
135
139
|
] })
|
|
@@ -4,6 +4,8 @@ export interface SearchInputProps extends Omit<InputHTMLAttributes<HTMLInputElem
|
|
|
4
4
|
icon?: ReactNode;
|
|
5
5
|
/** Container class name */
|
|
6
6
|
containerClassName?: string;
|
|
7
|
+
/** Accessible name for the clear button */
|
|
8
|
+
clearLabel?: string;
|
|
7
9
|
/** data-cy attribute for E2E testing */
|
|
8
10
|
'data-cy'?: string;
|
|
9
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/shared/SearchInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAO3D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3D,oDAAoD;IACpD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"SearchInput.d.ts","sourceRoot":"","sources":["../../../src/components/shared/SearchInput.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAA;AAO3D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC3D,oDAAoD;IACpD,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAMD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,WAAW,+GAyGvB,CAAA"}
|
|
@@ -2,10 +2,48 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../lib/utils/index.js";
|
|
4
4
|
import { Input } from "../ui/input.js";
|
|
5
|
-
import { Search } from "lucide-react";
|
|
6
|
-
import { forwardRef } from "react";
|
|
5
|
+
import { Search, X } from "lucide-react";
|
|
6
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from "react";
|
|
7
7
|
const SearchInput = forwardRef(
|
|
8
|
-
({
|
|
8
|
+
({
|
|
9
|
+
className,
|
|
10
|
+
containerClassName,
|
|
11
|
+
icon,
|
|
12
|
+
clearLabel = "Clear search",
|
|
13
|
+
"data-cy": dataCy = "search-input",
|
|
14
|
+
...props
|
|
15
|
+
}, ref) => {
|
|
16
|
+
const innerRef = useRef(null);
|
|
17
|
+
useImperativeHandle(ref, () => innerRef.current);
|
|
18
|
+
const isControlled = props.value !== void 0;
|
|
19
|
+
const [typedValue, setTypedValue] = useState(() => String(props.defaultValue ?? ""));
|
|
20
|
+
const currentValue = isControlled ? props.value : typedValue;
|
|
21
|
+
const hasValue = currentValue !== null && currentValue !== void 0 && String(currentValue) !== "";
|
|
22
|
+
const showClear = hasValue && !props.disabled && !props.readOnly;
|
|
23
|
+
const handleChange = (event) => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (!isControlled) setTypedValue(event.target.value);
|
|
26
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, event);
|
|
27
|
+
};
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
var _a;
|
|
30
|
+
if (isControlled) return;
|
|
31
|
+
const inDom = ((_a = innerRef.current) == null ? void 0 : _a.value) ?? "";
|
|
32
|
+
setTypedValue((current) => current === inDom ? current : inDom);
|
|
33
|
+
});
|
|
34
|
+
const handleClear = () => {
|
|
35
|
+
var _a;
|
|
36
|
+
const input = innerRef.current;
|
|
37
|
+
if (!input) return;
|
|
38
|
+
const setValue = (_a = Object.getOwnPropertyDescriptor(
|
|
39
|
+
window.HTMLInputElement.prototype,
|
|
40
|
+
"value"
|
|
41
|
+
)) == null ? void 0 : _a.set;
|
|
42
|
+
setValue == null ? void 0 : setValue.call(input, "");
|
|
43
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
44
|
+
if (!isControlled) setTypedValue("");
|
|
45
|
+
input.focus();
|
|
46
|
+
};
|
|
9
47
|
return /* @__PURE__ */ jsxs(
|
|
10
48
|
"div",
|
|
11
49
|
{
|
|
@@ -23,11 +61,31 @@ const SearchInput = forwardRef(
|
|
|
23
61
|
/* @__PURE__ */ jsx(
|
|
24
62
|
Input,
|
|
25
63
|
{
|
|
26
|
-
ref,
|
|
64
|
+
ref: innerRef,
|
|
27
65
|
type: "search",
|
|
28
|
-
className: cn(
|
|
66
|
+
className: cn(
|
|
67
|
+
"pl-10 h-10 rounded-lg",
|
|
68
|
+
// The browser draws its own clear affordance on type="search", which
|
|
69
|
+
// carries no test hook and would sit on top of the button below.
|
|
70
|
+
"[&::-webkit-search-cancel-button]:appearance-none",
|
|
71
|
+
showClear && "pr-10",
|
|
72
|
+
className
|
|
73
|
+
),
|
|
29
74
|
"data-cy": `${dataCy}-input`,
|
|
30
|
-
...props
|
|
75
|
+
...props,
|
|
76
|
+
onChange: handleChange
|
|
77
|
+
}
|
|
78
|
+
),
|
|
79
|
+
showClear && /* @__PURE__ */ jsx(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
type: "button",
|
|
83
|
+
onClick: handleClear,
|
|
84
|
+
"aria-label": clearLabel,
|
|
85
|
+
title: clearLabel,
|
|
86
|
+
className: "absolute right-2 top-1/2 -translate-y-1/2 rounded-sm p-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
87
|
+
"data-cy": `${dataCy}-clear`,
|
|
88
|
+
children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" })
|
|
31
89
|
}
|
|
32
90
|
)
|
|
33
91
|
]
|