betterstart-cli 0.0.97 → 0.0.98
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/assets/adapters/next/integrations/mailchimp/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/r2/actions/r2.ts +1 -1
- package/dist/assets/adapters/next/integrations/r2/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/railway-bucket/actions/railway-bucket.ts +1 -1
- package/dist/assets/adapters/next/integrations/railway-bucket/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/resend/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/vercel-blob/actions/vercel-blob.ts +1 -1
- package/dist/assets/adapters/next/integrations/vercel-blob/integration.ts +1 -1
- package/dist/assets/adapters/next/presets/blog/preset.ts +1 -1
- package/dist/assets/adapters/next/presets/portfolio/preset.ts +1 -1
- package/dist/assets/adapters/next/templates/init/api/storage-read-route.ts +2 -1
- package/dist/assets/adapters/next/templates/init/api/upload-route.ts +3 -2
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-providers.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar-nav-link-skeleton.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-grid.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table-pagination.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table.tsx +2 -5
- package/dist/assets/adapters/next/templates/init/components/shared/delete-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/copyable-code-block.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/dev-mode-code-mirror.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/lifecycle-hooks-tab.tsx +7 -17
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/snippets-tab.tsx +3 -13
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode-integrate.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/components/shared/entity-filters-bar.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-version-restore-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-versions-button.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/edit-media-dialog-content.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/edit-media-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-delete-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-delete-drawer.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-filters-bar.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-gallery-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-item.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-pagination.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-preview.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-url-importer.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/search-input.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-dialog.tsx +3 -4
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-item.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-blockquote.ts +1 -70
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-code-block.ts +1 -77
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-color-highlight.ts +3 -51
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-media-insertion.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-slash-menu.ts +6 -8
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-source-mode.tsx +10 -8
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor-table-add-controls.ts +4 -4
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-content-editor.ts +7 -4
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-heading-dropdown-menu.ts +3 -66
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-heading.ts +1 -41
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-is-breakpoint.ts +0 -8
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-link-popover.ts +1 -83
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-list-dropdown-menu.ts +3 -61
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-list.ts +1 -43
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-mark.ts +1 -72
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-menu-navigation.ts +0 -35
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-table-button.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-tiptap-editor.ts +0 -11
- package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-undo-redo.ts +1 -65
- package/dist/assets/adapters/next/templates/init/hooks/use-admin-theme.tsx +2 -4
- package/dist/assets/adapters/next/templates/init/hooks/use-dev-mode-integration.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-entity-versions.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-local-storage.ts +2 -7
- package/dist/assets/adapters/next/templates/init/hooks/use-media-filters-bar.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-media.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/use-page-boundary-blur-visibility.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-page-scroll-threshold.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-table-utils.ts +2 -2
- package/dist/assets/adapters/next/templates/init/hooks/use-upload.ts +6 -12
- package/dist/assets/adapters/next/templates/init/hooks/use-users.ts +1 -1
- package/dist/assets/adapters/next/templates/init/hooks/use-webhooks.ts +3 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/audit/cleanup-audit-logs.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/audit/get-audit-logs.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/audit/record-audit-event.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/auth/auth.ts +4 -4
- package/dist/assets/adapters/next/templates/init/lib/actions/auth/middleware.ts +2 -10
- package/dist/assets/adapters/next/templates/init/lib/actions/email/form-delivery.ts +2 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/email/provider.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/entity-versions/get-entity-versions.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/entity-versions/internal-create-entity-version.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/forms/get-all-form-settings.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/forms/get-form-settings.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/forms/upsert-form-settings.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/create-media.ts +2 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/delete-media-bulk.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/delete-media.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/get-media-by-id.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/get-media-by-ids.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/get-media.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/media/update-media.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/profile/change-own-password.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/profile/update-email.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/storage/provider.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/upload/upload-files.ts +2 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/upload/upload-media-from-url.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/change-user-password.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/create-user.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/delete-user.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/get-users.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/users/update-user-role.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/create-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/delete-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/dispatch.ts +1 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhook-deliveries.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhook-secret.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhook-subscriptions.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/get-webhooks.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/regenerate-webhook-secret.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/register.ts +2 -2
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/send-test-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/actions/webhooks/update-webhook.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/db/client.ts +1 -1
- package/dist/assets/adapters/next/templates/init/lib/db/core/schema.ts +0 -24
- package/dist/assets/adapters/next/templates/init/lib/lifecycle-hooks/register.ts +0 -7
- package/dist/assets/adapters/next/templates/init/lib/lifecycle-hooks/runner.ts +1 -1
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/login-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/media/media-page-content.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/reset-password-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-columns.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-page-content.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-table.tsx +3 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-page-content.tsx +3 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-table.tsx +4 -3
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhook-endpoint-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-columns.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-columns.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-page-content.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-table.tsx +2 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-page-content.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-table.tsx +2 -1
- package/dist/assets/adapters/next/templates/init/pages/users/change-password-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/columns.tsx +3 -2
- package/dist/assets/adapters/next/templates/init/pages/users/create-user-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/delete-user-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/edit-role-dialog.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/users-page-content.tsx +2 -1
- package/dist/assets/adapters/next/templates/init/pages/users/users-table.tsx +4 -3
- package/dist/assets/adapters/next/templates/init/types/index.ts +0 -5
- package/dist/assets/adapters/next/templates/init/utils/date/date.ts +1 -6
- package/dist/assets/adapters/next/templates/init/utils/editor/content-editor-rich-extensions.ts +2 -2
- package/dist/assets/adapters/next/templates/init/utils/editor/markdown.ts +5 -5
- package/dist/assets/adapters/next/templates/init/utils/editor/slash-commands.ts +2 -2
- package/dist/assets/adapters/next/templates/init/utils/editor/table-add-controls.ts +1 -1
- package/dist/assets/adapters/next/templates/init/utils/editor/tiptap.ts +8 -127
- package/dist/assets/adapters/next/templates/init/utils/media/query.ts +1 -1
- package/dist/assets/adapters/next/templates/init/utils/seo/seo.ts +0 -10
- package/dist/assets/adapters/next/templates/init/utils/shared/cn.ts +2 -1
- package/dist/assets/adapters/next/templates/init/utils/validation/validation.ts +0 -12
- package/dist/assets/shared-assets/react-admin/custom/content-editor/editor-toolbar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/horizontal-rule-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/index.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/main-toolbar-content.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-bubble-menu.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-editor-controls.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-popover-button.tsx +4 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/remove-table-part-icon.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/selection-bubble-menu.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/slash-command-menu.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode-dropdown-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode.tsx +5 -11
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-add-controls.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-bubble-menu.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-button.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-extension/node-background-extension.ts +2 -25
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-node/media-gallery-placeholder-node/media-gallery-placeholder-node-extension.ts +0 -20
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-node/media-gallery-placeholder-node/media-gallery-placeholder-node.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-node/removable-image-node/removable-image-node.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/blockquote-button/blockquote-button.tsx +3 -18
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/code-block-button/code-block-button.tsx +3 -18
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-button/color-highlight-button.tsx +2 -37
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-button.tsx +3 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover-content.tsx +3 -9
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +6 -12
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/highlight-color-button.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/highlight-colors.ts +2 -4
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/source-color-highlight-popover.tsx +4 -9
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu-item.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +4 -19
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-button.tsx +3 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-content.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-control-popover.tsx +5 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-main.tsx +1 -13
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-popover.tsx +5 -16
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu-item.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +4 -19
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/mark-button/mark-button.tsx +3 -19
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/undo-redo-button/undo-redo-button.tsx +3 -19
- package/dist/assets/shared-assets/react-admin/custom/date-picker.tsx +1 -3
- package/dist/assets/shared-assets/react-admin/custom/date-range-picker.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/gallery-field.tsx +5 -10
- package/dist/assets/shared-assets/react-admin/custom/icon-picker.tsx +7 -4
- package/dist/assets/shared-assets/react-admin/custom/media-field-empty-state.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/media-field.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/nested-object-list-field.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/placeholder-card.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/placeholder.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/progressive-blur.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/sortable-gallery-item.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/upload-dropzone.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/accordion.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/alert-dialog.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/alert.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/avatar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/badge.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/breadcrumb.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/button-group.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/button.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/calendar.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/card.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/carousel.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/chart.tsx +1 -2
- package/dist/assets/shared-assets/react-admin/ui/checkbox.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/combobox.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/command.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/context-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/dialog.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/direction.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/drawer.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/dropdown-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/empty.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/field.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/form.tsx +4 -10
- package/dist/assets/shared-assets/react-admin/ui/hover-card.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/input-group.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/input-otp.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/input.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/item.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/label.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/menubar.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/native-select.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/navigation-menu.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/pagination.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/popover.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/progress.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/radio-group.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/resizable.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/scroll-area.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/select.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/separator.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sheet.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sidebar.tsx +3 -10
- package/dist/assets/shared-assets/react-admin/ui/slider.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/sonner.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/switch.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/table.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/tabs.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/textarea.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/toggle-group.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/toggle.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/tooltip.tsx +1 -1
- package/dist/{chunk-MJWUGEMK.js → chunk-AIQWGMU7.js} +136 -5
- package/dist/chunk-AIQWGMU7.js.map +1 -0
- package/dist/cli.js +1097 -1194
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{template-reader-R2JIWUNK.js → template-reader-F2VFSDKV.js} +2 -2
- package/package.json +3 -3
- package/dist/assets/shared-assets/react-admin/dependencies.ts +0 -74
- package/dist/chunk-MJWUGEMK.js.map +0 -1
- /package/dist/{template-reader-R2JIWUNK.js.map → template-reader-F2VFSDKV.js.map} +0 -0
package/dist/assets/adapters/next/templates/init/hooks/content-editor/use-menu-navigation.ts
CHANGED
|
@@ -13,51 +13,16 @@ interface SelectionState {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
interface MenuNavigationOptions<T> {
|
|
16
|
-
/**
|
|
17
|
-
* The Tiptap editor instance, if using with a Tiptap editor.
|
|
18
|
-
*/
|
|
19
16
|
editor?: Editor | null
|
|
20
|
-
/**
|
|
21
|
-
* Reference to the container element for handling keyboard events.
|
|
22
|
-
*/
|
|
23
17
|
containerRef?: React.RefObject<HTMLElement | null>
|
|
24
|
-
/**
|
|
25
|
-
* Search query that affects the selected item.
|
|
26
|
-
*/
|
|
27
18
|
query?: string
|
|
28
|
-
/**
|
|
29
|
-
* Array of items to navigate through.
|
|
30
|
-
*/
|
|
31
19
|
items: T[]
|
|
32
|
-
/**
|
|
33
|
-
* Callback fired when an item is selected.
|
|
34
|
-
*/
|
|
35
20
|
onSelect?: (item: T) => void
|
|
36
|
-
/**
|
|
37
|
-
* Callback fired when the menu should close.
|
|
38
|
-
*/
|
|
39
21
|
onClose?: () => void
|
|
40
|
-
/**
|
|
41
|
-
* The navigation orientation of the menu.
|
|
42
|
-
* @default "vertical"
|
|
43
|
-
*/
|
|
44
22
|
orientation?: Orientation
|
|
45
|
-
/**
|
|
46
|
-
* Whether to automatically select the first item when the menu opens.
|
|
47
|
-
* @default true
|
|
48
|
-
*/
|
|
49
23
|
autoSelectFirstItem?: boolean
|
|
50
24
|
}
|
|
51
25
|
|
|
52
|
-
/**
|
|
53
|
-
* Hook that implements keyboard navigation for dropdown menus and command palettes.
|
|
54
|
-
*
|
|
55
|
-
* Handles arrow keys, tab, home/end, enter for selection, and escape to close.
|
|
56
|
-
* Works with both Tiptap editors and regular DOM elements.
|
|
57
|
-
*
|
|
58
|
-
* @param options - Configuration options for the menu navigation
|
|
59
|
-
* @returns Object containing the selected index and a setter function
|
|
60
|
-
*/
|
|
61
26
|
export function useMenuNavigation<T>({
|
|
62
27
|
editor,
|
|
63
28
|
containerRef,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { Editor } from '@tiptap/core'
|
|
3
5
|
import { normalizeCount } from '@admin/utils/editor/table-input'
|
|
4
6
|
import { insertContentEditorTable } from '@admin/utils/editor/tiptap'
|
|
5
|
-
import type { Editor } from '@tiptap/core'
|
|
6
|
-
import * as React from 'react'
|
|
7
7
|
|
|
8
8
|
const DEFAULT_TABLE_ROWS = 3
|
|
9
9
|
const DEFAULT_TABLE_COLS = 3
|
|
@@ -4,17 +4,6 @@ import type { Editor } from '@tiptap/react'
|
|
|
4
4
|
import { useCurrentEditor, useEditorState } from '@tiptap/react'
|
|
5
5
|
import { useMemo } from 'react'
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Hook that provides access to a Tiptap editor instance.
|
|
9
|
-
*
|
|
10
|
-
* Accepts an optional editor instance directly, or falls back to retrieving
|
|
11
|
-
* the editor from the Tiptap context if available. This allows components
|
|
12
|
-
* to work both when given an editor directly and when used within a Tiptap
|
|
13
|
-
* editor context.
|
|
14
|
-
*
|
|
15
|
-
* @param providedEditor - Optional editor instance to use instead of the context editor
|
|
16
|
-
* @returns The provided editor or the editor from context, whichever is available
|
|
17
|
-
*/
|
|
18
7
|
export function useTiptapEditor(providedEditor?: Editor | null): {
|
|
19
8
|
editor: Editor | null
|
|
20
9
|
editorState?: Editor['state']
|
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import type { Editor } from '@tiptap/react'
|
|
4
4
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
5
|
-
// --- Lib ---
|
|
6
5
|
import { isNodeTypeSelected } from '@admin/utils/editor/tiptap'
|
|
7
|
-
import type { Editor } from '@tiptap/react'
|
|
8
|
-
// --- Icons ---
|
|
9
6
|
import { Redo2Icon, Undo2Icon } from 'lucide-react'
|
|
10
7
|
import { useCallback, useEffect, useState } from 'react'
|
|
11
8
|
|
|
12
9
|
export type UndoRedoAction = 'undo' | 'redo'
|
|
13
10
|
|
|
14
|
-
/**
|
|
15
|
-
* Configuration for the history functionality
|
|
16
|
-
*/
|
|
17
11
|
export interface UseUndoRedoConfig {
|
|
18
|
-
/**
|
|
19
|
-
* The Tiptap editor instance.
|
|
20
|
-
*/
|
|
21
12
|
editor?: Editor | null
|
|
22
|
-
/**
|
|
23
|
-
* The history action to perform (undo or redo).
|
|
24
|
-
*/
|
|
25
13
|
action: UndoRedoAction
|
|
26
|
-
/**
|
|
27
|
-
* Whether the button should hide when action is not available.
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
14
|
hideWhenUnavailable?: boolean
|
|
31
|
-
/**
|
|
32
|
-
* Callback function called after a successful action execution.
|
|
33
|
-
*/
|
|
34
15
|
onExecuted?: () => void
|
|
35
16
|
}
|
|
36
17
|
|
|
@@ -49,9 +30,6 @@ export const historyIcons = {
|
|
|
49
30
|
redo: Redo2Icon
|
|
50
31
|
}
|
|
51
32
|
|
|
52
|
-
/**
|
|
53
|
-
* Checks if a history action can be executed
|
|
54
|
-
*/
|
|
55
33
|
export function canExecuteUndoRedoAction(editor: Editor | null, action: UndoRedoAction): boolean {
|
|
56
34
|
if (!editor || !editor.isEditable) return false
|
|
57
35
|
if (isNodeTypeSelected(editor, ['image'])) return false
|
|
@@ -59,9 +37,6 @@ export function canExecuteUndoRedoAction(editor: Editor | null, action: UndoRedo
|
|
|
59
37
|
return action === 'undo' ? editor.can().undo() : editor.can().redo()
|
|
60
38
|
}
|
|
61
39
|
|
|
62
|
-
/**
|
|
63
|
-
* Executes a history action on the editor
|
|
64
|
-
*/
|
|
65
40
|
export function executeUndoRedoAction(editor: Editor | null, action: UndoRedoAction): boolean {
|
|
66
41
|
if (!editor || !editor.isEditable) return false
|
|
67
42
|
if (!canExecuteUndoRedoAction(editor, action)) return false
|
|
@@ -70,9 +45,6 @@ export function executeUndoRedoAction(editor: Editor | null, action: UndoRedoAct
|
|
|
70
45
|
return action === 'undo' ? chain.undo().run() : chain.redo().run()
|
|
71
46
|
}
|
|
72
47
|
|
|
73
|
-
/**
|
|
74
|
-
* Determines if the history button should be shown
|
|
75
|
-
*/
|
|
76
48
|
export function shouldShowButton(props: {
|
|
77
49
|
editor: Editor | null
|
|
78
50
|
hideWhenUnavailable: boolean
|
|
@@ -89,42 +61,6 @@ export function shouldShowButton(props: {
|
|
|
89
61
|
return true
|
|
90
62
|
}
|
|
91
63
|
|
|
92
|
-
/**
|
|
93
|
-
* Custom hook that provides history functionality for Tiptap editor
|
|
94
|
-
*
|
|
95
|
-
* @example
|
|
96
|
-
* ```tsx
|
|
97
|
-
* // Simple usage
|
|
98
|
-
* function MySimpleUndoButton() {
|
|
99
|
-
* const { isVisible, handleAction } = useHistory({ action: "undo" })
|
|
100
|
-
*
|
|
101
|
-
* if (!isVisible) return null
|
|
102
|
-
*
|
|
103
|
-
* return <button onClick={handleAction}>Undo</button>
|
|
104
|
-
* }
|
|
105
|
-
*
|
|
106
|
-
* // Advanced usage with configuration
|
|
107
|
-
* function MyAdvancedRedoButton() {
|
|
108
|
-
* const { isVisible, handleAction, label } = useHistory({
|
|
109
|
-
* editor: myEditor,
|
|
110
|
-
* action: "redo",
|
|
111
|
-
* hideWhenUnavailable: true,
|
|
112
|
-
* onExecuted: () => console.log('Action executed!')
|
|
113
|
-
* })
|
|
114
|
-
*
|
|
115
|
-
* if (!isVisible) return null
|
|
116
|
-
*
|
|
117
|
-
* return (
|
|
118
|
-
* <MyButton
|
|
119
|
-
* onClick={handleAction}
|
|
120
|
-
* aria-label={label}
|
|
121
|
-
* >
|
|
122
|
-
* Redo
|
|
123
|
-
* </MyButton>
|
|
124
|
-
* )
|
|
125
|
-
* }
|
|
126
|
-
* ```
|
|
127
|
-
*/
|
|
128
64
|
export function useUndoRedo(config: UseUndoRedoConfig) {
|
|
129
65
|
const { editor: providedEditor, action, hideWhenUnavailable = false, onExecuted } = config
|
|
130
66
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { getSystemTheme, type ResolvedTheme } from '@admin/utils/theme/system'
|
|
4
3
|
import * as React from 'react'
|
|
4
|
+
import type { ResolvedTheme } from '@admin/utils/theme/system'
|
|
5
|
+
import { getSystemTheme } from '@admin/utils/theme/system'
|
|
5
6
|
|
|
6
7
|
type Theme = 'light' | 'dark' | 'system'
|
|
7
8
|
|
|
@@ -19,7 +20,6 @@ export function AdminThemeProvider({ children }: { children: React.ReactNode })
|
|
|
19
20
|
const [theme, setThemeState] = React.useState<Theme>('system')
|
|
20
21
|
const [resolved, setResolved] = React.useState<ResolvedTheme>('light')
|
|
21
22
|
|
|
22
|
-
// Read from localStorage on mount
|
|
23
23
|
React.useEffect(() => {
|
|
24
24
|
const stored = localStorage.getItem(STORAGE_KEY) as Theme | null
|
|
25
25
|
if (stored && ['light', 'dark', 'system'].includes(stored)) {
|
|
@@ -27,7 +27,6 @@ export function AdminThemeProvider({ children }: { children: React.ReactNode })
|
|
|
27
27
|
}
|
|
28
28
|
}, [])
|
|
29
29
|
|
|
30
|
-
// Resolve theme and apply .dark class to .admin-root
|
|
31
30
|
React.useEffect(() => {
|
|
32
31
|
const actual = theme === 'system' ? getSystemTheme() : theme
|
|
33
32
|
setResolved(actual)
|
|
@@ -38,7 +37,6 @@ export function AdminThemeProvider({ children }: { children: React.ReactNode })
|
|
|
38
37
|
}
|
|
39
38
|
}, [theme])
|
|
40
39
|
|
|
41
|
-
// Listen for system theme changes
|
|
42
40
|
React.useEffect(() => {
|
|
43
41
|
if (theme !== 'system') return
|
|
44
42
|
const mq = window.matchMedia('(prefers-color-scheme: dark)')
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
3
4
|
import type {
|
|
4
5
|
DevModeIntegration,
|
|
5
6
|
DevModeIntegrationLoader
|
|
6
7
|
} from '@admin/components/shared/dev-mode/dev-mode-types'
|
|
7
|
-
import * as React from 'react'
|
|
8
8
|
|
|
9
9
|
export function useDevModeIntegration(loadIntegration: DevModeIntegrationLoader) {
|
|
10
10
|
const [integration, setIntegration] = React.useState<DevModeIntegration | null>(null)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import type { EntityVersionWithAuthor } from '@admin/actions/entity-versions'
|
|
4
3
|
import * as React from 'react'
|
|
4
|
+
import type { EntityVersionWithAuthor } from '@admin/actions/entity-versions'
|
|
5
5
|
import { toast } from 'sonner'
|
|
6
6
|
|
|
7
7
|
interface UseEntityVersionsOptions {
|
|
@@ -2,7 +2,6 @@ import * as React from 'react'
|
|
|
2
2
|
|
|
3
3
|
const ADMIN_STORAGE_PREFIX = 'admin-'
|
|
4
4
|
|
|
5
|
-
/** Type-safe wrapper for localStorage operations with admin- prefix. */
|
|
6
5
|
export function useLocalStorage<T>(key: string) {
|
|
7
6
|
const prefixedKey = ADMIN_STORAGE_PREFIX + key
|
|
8
7
|
|
|
@@ -10,9 +9,7 @@ export function useLocalStorage<T>(key: string) {
|
|
|
10
9
|
(value: T) => {
|
|
11
10
|
try {
|
|
12
11
|
localStorage.setItem(prefixedKey, JSON.stringify(value))
|
|
13
|
-
} catch {
|
|
14
|
-
// Silent failure for localStorage access errors
|
|
15
|
-
}
|
|
12
|
+
} catch {}
|
|
16
13
|
},
|
|
17
14
|
[prefixedKey]
|
|
18
15
|
)
|
|
@@ -29,9 +26,7 @@ export function useLocalStorage<T>(key: string) {
|
|
|
29
26
|
const removeItem = React.useCallback(() => {
|
|
30
27
|
try {
|
|
31
28
|
localStorage.removeItem(prefixedKey)
|
|
32
|
-
} catch {
|
|
33
|
-
// Silent failure for localStorage access errors
|
|
34
|
-
}
|
|
29
|
+
} catch {}
|
|
35
30
|
}, [prefixedKey])
|
|
36
31
|
|
|
37
32
|
const hasItem = React.useCallback((): boolean => {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
4
|
import type { AdminMedia, MediaListParams, MediaListResult } from '@admin/types'
|
|
5
|
+
import { getMedia, getMediaById, getMediaByIds } from '@admin/actions/media'
|
|
5
6
|
import { useQuery } from '@tanstack/react-query'
|
|
6
|
-
import * as React from 'react'
|
|
7
7
|
|
|
8
8
|
const DEFAULT_MEDIA_PAGE = 1
|
|
9
9
|
const DEFAULT_MEDIA_PAGE_SIZE = 40
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
3
4
|
import { getPageScrollBoundary } from '@admin/utils/page/boundary'
|
|
4
5
|
import { useMotionValueEvent, useScroll } from 'motion/react'
|
|
5
|
-
import * as React from 'react'
|
|
6
6
|
|
|
7
7
|
interface UsePageBoundaryBlurVisibilityOptions {
|
|
8
8
|
disabled?: boolean
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { useMotionValueEvent, useScroll } from 'motion/react'
|
|
4
3
|
import * as React from 'react'
|
|
4
|
+
import { useMotionValueEvent, useScroll } from 'motion/react'
|
|
5
5
|
|
|
6
6
|
export function usePageScrollThreshold(threshold = 0) {
|
|
7
7
|
const { scrollY } = useScroll()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
4
|
import type {
|
|
5
5
|
ColumnSizingState,
|
|
6
6
|
OnChangeFn,
|
|
@@ -10,7 +10,7 @@ import type {
|
|
|
10
10
|
SortingState,
|
|
11
11
|
Table
|
|
12
12
|
} from '@tanstack/react-table'
|
|
13
|
-
import
|
|
13
|
+
import { defaultGetId, isString } from '@admin/utils/table/table'
|
|
14
14
|
|
|
15
15
|
interface ColumnResizeInfo {
|
|
16
16
|
id: string
|
|
@@ -1,28 +1,22 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as React from 'react'
|
|
4
4
|
import type { UploadFileResult, UploadProgress } from '@admin/types'
|
|
5
|
+
import type { FileValidationConfig } from '@admin/utils/validation/validation'
|
|
6
|
+
import type { UseMutationResult } from '@tanstack/react-query'
|
|
7
|
+
import { uploadMediaFromUrl } from '@admin/actions/upload'
|
|
5
8
|
import { parseAcceptTypes } from '@admin/utils/upload/upload'
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import * as React from 'react'
|
|
9
|
+
import { validateFiles } from '@admin/utils/validation/validation'
|
|
10
|
+
import { useMutation } from '@tanstack/react-query'
|
|
9
11
|
|
|
10
12
|
export interface UseUploadOptions {
|
|
11
|
-
/** File validation configuration */
|
|
12
13
|
validationConfig?: FileValidationConfig
|
|
13
|
-
/** Accept string (e.g., "image/*") */
|
|
14
14
|
accept?: string
|
|
15
|
-
/** Optional maximum file size in MB */
|
|
16
15
|
maxSizeInMB?: number
|
|
17
|
-
/** Callback fired when upload progress changes */
|
|
18
16
|
onProgress?: (progress: UploadProgress[]) => void
|
|
19
|
-
/** Callback fired when upload succeeds */
|
|
20
17
|
onSuccess?: (result: UploadFileResult) => void
|
|
21
|
-
/** Callback fired when upload fails */
|
|
22
18
|
onError?: (error: Error) => void
|
|
23
|
-
/** Optional prefix for file paths in R2 */
|
|
24
19
|
prefix?: string
|
|
25
|
-
/** Whether completion callbacks should run for this upload surface */
|
|
26
20
|
isActive?: boolean
|
|
27
21
|
}
|
|
28
22
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import type { FormSettingsData } from '@admin/actions/forms'
|
|
4
|
-
import { getAllFormSettings } from '@admin/actions/forms'
|
|
5
4
|
import type {
|
|
6
5
|
WebhookDeliveriesPage,
|
|
7
6
|
WebhookDeliveriesQuery,
|
|
@@ -9,6 +8,8 @@ import type {
|
|
|
9
8
|
WebhooksPage,
|
|
10
9
|
WebhooksQuery
|
|
11
10
|
} from '@admin/actions/webhooks'
|
|
11
|
+
import type { UseQueryResult } from '@tanstack/react-query'
|
|
12
|
+
import { getAllFormSettings } from '@admin/actions/forms'
|
|
12
13
|
import {
|
|
13
14
|
getWebhookDeliveries,
|
|
14
15
|
getWebhookSubscriptions,
|
|
@@ -16,7 +17,7 @@ import {
|
|
|
16
17
|
sendTestWebhook,
|
|
17
18
|
updateWebhook
|
|
18
19
|
} from '@admin/actions/webhooks'
|
|
19
|
-
import {
|
|
20
|
+
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
|
|
20
21
|
import { toast } from 'sonner'
|
|
21
22
|
|
|
22
23
|
export function useWebhooks(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { CleanupAuditLogsResult } from './types'
|
|
3
4
|
import { getSetting } from '@admin/actions/settings'
|
|
4
5
|
import { requireRole, UserRole } from '@admin/auth/middleware'
|
|
5
6
|
import db from '@admin/db'
|
|
@@ -7,7 +8,6 @@ import { auditLog } from '@admin/db/schema'
|
|
|
7
8
|
import { runAdminEventHooks } from '@admin/lib/lifecycle-hooks'
|
|
8
9
|
import { lt } from 'drizzle-orm'
|
|
9
10
|
import { getAuditRequestMetadata } from './request-metadata'
|
|
10
|
-
import type { CleanupAuditLogsResult } from './types'
|
|
11
11
|
|
|
12
12
|
const MS_PER_DAY = 24 * 60 * 60 * 1000
|
|
13
13
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { AuditLogEntry, AuditLogPage, AuditLogQuery } from './types'
|
|
3
4
|
import { requireRole, UserRole } from '@admin/auth/middleware'
|
|
4
5
|
import db from '@admin/db'
|
|
5
6
|
import { auditLog } from '@admin/db/schema'
|
|
6
7
|
import { getExclusiveDateUpperBound } from '@admin/utils/date/date'
|
|
7
8
|
import { and, asc, desc, eq, gte, ilike, lt, or, sql } from 'drizzle-orm'
|
|
8
|
-
import type { AuditLogEntry, AuditLogPage, AuditLogQuery } from './types'
|
|
9
9
|
|
|
10
10
|
const DEFAULT_AUDIT_LOG_PAGE = 0
|
|
11
11
|
const DEFAULT_AUDIT_LOG_PAGE_SIZE = 20
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { AdminEventContext } from '@admin/lib/lifecycle-hooks/types'
|
|
1
2
|
import db from '@admin/db'
|
|
2
3
|
import { auditLog } from '@admin/db/schema'
|
|
3
|
-
import type { AdminEventContext } from '@admin/lib/lifecycle-hooks/types'
|
|
4
4
|
|
|
5
5
|
const MAX_TARGET_TYPE_LENGTH = 100
|
|
6
6
|
const MAX_SOURCE_TYPE_LENGTH = 50
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as schema from '@admin/db/schema'
|
|
1
2
|
import { sendPasswordResetEmail } from '@admin/actions/email'
|
|
2
3
|
import db from '@admin/db'
|
|
3
|
-
import * as schema from '@admin/db/schema'
|
|
4
4
|
import { UserRole } from '@admin/types/auth'
|
|
5
5
|
import { betterAuth } from 'better-auth'
|
|
6
6
|
import { drizzleAdapter } from 'better-auth/adapters/drizzle'
|
|
@@ -37,11 +37,11 @@ export const auth = betterAuth({
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
session: {
|
|
40
|
-
expiresIn: 60 * 60 * 24 * 7,
|
|
41
|
-
updateAge: 60 * 60 * 24,
|
|
40
|
+
expiresIn: 60 * 60 * 24 * 7,
|
|
41
|
+
updateAge: 60 * 60 * 24,
|
|
42
42
|
cookieCache: {
|
|
43
43
|
enabled: true,
|
|
44
|
-
maxAge: 15 * 60
|
|
44
|
+
maxAge: 15 * 60
|
|
45
45
|
}
|
|
46
46
|
},
|
|
47
47
|
plugins: [
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { User } from './auth'
|
|
1
2
|
import { UserRole } from '@admin/types/auth'
|
|
2
3
|
import { getAdminPostLoginPath, isUserRole } from '@admin/utils/auth/roles'
|
|
3
4
|
import { headers } from 'next/headers'
|
|
4
5
|
import { redirect } from 'next/navigation'
|
|
5
6
|
import { cache } from 'react'
|
|
6
|
-
import { auth
|
|
7
|
+
import { auth } from './auth'
|
|
7
8
|
|
|
8
9
|
export { UserRole } from '@admin/types/auth'
|
|
9
10
|
|
|
@@ -11,10 +12,6 @@ interface GetSessionOptions {
|
|
|
11
12
|
disableCookieCache?: boolean
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
/**
|
|
15
|
-
* Get the current session from Better Auth.
|
|
16
|
-
* Wrapped with React.cache to deduplicate within a single request.
|
|
17
|
-
*/
|
|
18
15
|
export const getSession = cache(async (options: GetSessionOptions = {}) => {
|
|
19
16
|
const session = await auth.api.getSession({
|
|
20
17
|
query: options.disableCookieCache ? { disableCookieCache: true } : undefined,
|
|
@@ -23,11 +20,6 @@ export const getSession = cache(async (options: GetSessionOptions = {}) => {
|
|
|
23
20
|
return session
|
|
24
21
|
})
|
|
25
22
|
|
|
26
|
-
/**
|
|
27
|
-
* Require the user to have one of the specified roles.
|
|
28
|
-
* Redirects to /admin/login if unauthenticated and to /admin/profile if authenticated
|
|
29
|
-
* without the required Admin role.
|
|
30
|
-
*/
|
|
31
23
|
export async function requireRole(allowedRoles: readonly UserRole[]): Promise<User> {
|
|
32
24
|
const session = await getSession({ disableCookieCache: true })
|
|
33
25
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { sendEmail } from '@admin/actions/email'
|
|
2
1
|
import type { SendEmailResult } from '@admin/actions/email/types'
|
|
2
|
+
import type { FormEmailDeliveryInput } from '@admin/utils/email/form-delivery'
|
|
3
|
+
import { sendEmail } from '@admin/actions/email'
|
|
3
4
|
import {
|
|
4
|
-
type FormEmailDeliveryInput,
|
|
5
5
|
isValidEmail,
|
|
6
6
|
normalizeEmailList,
|
|
7
7
|
renderNotificationEmail,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { noneEmailProvider } from '@admin/actions/email/none'
|
|
2
1
|
import type { AdminEmailProvider } from '@admin/actions/email/types'
|
|
2
|
+
import { noneEmailProvider } from '@admin/actions/email/none'
|
|
3
3
|
|
|
4
4
|
export function getEmailProvider(): AdminEmailProvider {
|
|
5
5
|
return noneEmailProvider
|
package/dist/assets/adapters/next/templates/init/lib/actions/entity-versions/get-entity-versions.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { EntityVersionWithAuthor } from './types'
|
|
3
4
|
import db from '@admin/db'
|
|
4
5
|
import { entityVersions, user } from '@admin/db/schema'
|
|
5
6
|
import { and, desc, eq } from 'drizzle-orm'
|
|
6
7
|
import { alias } from 'drizzle-orm/pg-core'
|
|
7
8
|
import { cacheLife, cacheTag } from 'next/cache'
|
|
8
|
-
import type { EntityVersionWithAuthor } from './types'
|
|
9
9
|
import { entityVersionsCacheTags } from './types'
|
|
10
10
|
|
|
11
11
|
const createdByUser = alias(user, 'entity_version_created_by_user')
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { EntityVersionData } from './types'
|
|
1
2
|
import type db from '@admin/db'
|
|
2
3
|
import { entityVersions } from '@admin/db/schema'
|
|
3
4
|
import { and, desc, eq, sql } from 'drizzle-orm'
|
|
4
|
-
import type { EntityVersionData } from './types'
|
|
5
5
|
|
|
6
6
|
type EntityVersionClient = Parameters<Parameters<typeof db.transaction>[0]>[0]
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { FormSettingsData } from './types'
|
|
3
4
|
import db from '@admin/db'
|
|
4
5
|
import { formSettings } from '@admin/db/schema'
|
|
5
6
|
import { cacheLife, cacheTag } from 'next/cache'
|
|
6
|
-
import type { FormSettingsData } from './types'
|
|
7
7
|
import { formSettingsCacheTags } from './types'
|
|
8
8
|
|
|
9
9
|
export async function getAllFormSettings(): Promise<FormSettingsData[]> {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { FormSettingsData } from './types'
|
|
3
4
|
import db from '@admin/db'
|
|
4
5
|
import { formSettings } from '@admin/db/schema'
|
|
5
6
|
import { eq } from 'drizzle-orm'
|
|
6
7
|
import { cacheLife, cacheTag } from 'next/cache'
|
|
7
|
-
import type { FormSettingsData } from './types'
|
|
8
8
|
import { formSettingsCacheTags } from './types'
|
|
9
9
|
|
|
10
10
|
export async function getFormSettings(formName: string): Promise<FormSettingsData | null> {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { FormSettingsData, FormSettingsResult, UpsertFormSettingsInput } from './types'
|
|
3
4
|
import { requireRole, UserRole } from '@admin/auth/middleware'
|
|
4
5
|
import db from '@admin/db'
|
|
5
6
|
import { formSettings } from '@admin/db/schema'
|
|
6
7
|
import { updateTag } from 'next/cache'
|
|
7
|
-
import type { FormSettingsData, FormSettingsResult, UpsertFormSettingsInput } from './types'
|
|
8
8
|
import { formSettingsCacheTags } from './types'
|
|
9
9
|
|
|
10
10
|
export async function upsertFormSettings(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { CreateMediaInput, CreateMediaResult } from './types'
|
|
3
4
|
import { getAuditRequestMetadata } from '@admin/actions/audit/request-metadata'
|
|
4
5
|
import { requireRole, UserRole } from '@admin/auth/middleware'
|
|
5
6
|
import db from '@admin/db'
|
|
@@ -8,7 +9,7 @@ import { runAdminEventHooks } from '@admin/lib/lifecycle-hooks'
|
|
|
8
9
|
import { getTouchedFieldNames } from '@admin/utils/audit/audit'
|
|
9
10
|
import { updateTag } from 'next/cache'
|
|
10
11
|
import { getMediaById } from './get-media-by-id'
|
|
11
|
-
import {
|
|
12
|
+
import { mediaCacheTags } from './types'
|
|
12
13
|
|
|
13
14
|
export async function createMedia(data: CreateMediaInput): Promise<CreateMediaResult> {
|
|
14
15
|
const actor = await requireRole([UserRole.ADMIN, UserRole.EDITOR])
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { DeleteMediaBulkResult } from './types'
|
|
3
4
|
import { getAuditRequestMetadata } from '@admin/actions/audit/request-metadata'
|
|
4
5
|
import { requireRole, UserRole } from '@admin/auth/middleware'
|
|
5
6
|
import db from '@admin/db'
|
|
@@ -7,7 +8,6 @@ import { adminMedia } from '@admin/db/schema'
|
|
|
7
8
|
import { runAdminEventHooks } from '@admin/lib/lifecycle-hooks'
|
|
8
9
|
import { inArray } from 'drizzle-orm'
|
|
9
10
|
import { updateTag } from 'next/cache'
|
|
10
|
-
import type { DeleteMediaBulkResult } from './types'
|
|
11
11
|
import { mediaCacheTags } from './types'
|
|
12
12
|
|
|
13
13
|
export async function deleteMediaBulk(ids: string[]): Promise<DeleteMediaBulkResult> {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
+
import type { DeleteMediaResult } from './types'
|
|
3
4
|
import { getAuditRequestMetadata } from '@admin/actions/audit/request-metadata'
|
|
4
5
|
import { requireRole, UserRole } from '@admin/auth/middleware'
|
|
5
6
|
import db from '@admin/db'
|
|
@@ -7,7 +8,6 @@ import { adminMedia } from '@admin/db/schema'
|
|
|
7
8
|
import { runAdminEventHooks } from '@admin/lib/lifecycle-hooks'
|
|
8
9
|
import { eq } from 'drizzle-orm'
|
|
9
10
|
import { updateTag } from 'next/cache'
|
|
10
|
-
import type { DeleteMediaResult } from './types'
|
|
11
11
|
import { mediaCacheTags } from './types'
|
|
12
12
|
|
|
13
13
|
export async function deleteMedia(id: string): Promise<DeleteMediaResult> {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use server'
|
|
2
2
|
|
|
3
|
-
import { adminMedia } from '@admin/db/schema'
|
|
4
3
|
import type { AdminMedia } from '@admin/types'
|
|
4
|
+
import { adminMedia } from '@admin/db/schema'
|
|
5
5
|
import { mapMediaRow, selectMedia } from '@admin/utils/media/query'
|
|
6
6
|
import { eq } from 'drizzle-orm'
|
|
7
7
|
import { cacheLife, cacheTag } from 'next/cache'
|