betterstart-cli 0.0.96 → 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 +5 -5
- package/dist/assets/adapters/next/integrations/r2/integration.ts +1 -1
- package/dist/assets/adapters/next/integrations/railway-bucket/actions/railway-bucket.ts +6 -6
- 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-header.tsx +6 -6
- 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-branding-skeleton.tsx +2 -2
- 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-user-menu-skeleton.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar-user-menu.tsx +8 -8
- package/dist/assets/adapters/next/templates/init/components/layouts/admin-sidebar.tsx +5 -5
- package/dist/assets/adapters/next/templates/init/components/layouts/content-skeleton.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/components/layouts/sidebar-branding.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-grid.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table-pagination.tsx +5 -5
- package/dist/assets/adapters/next/templates/init/components/shared/data-table/data-table.tsx +3 -6
- package/dist/assets/adapters/next/templates/init/components/shared/delete-dialog.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/dev-mode/copyable-code-block.tsx +7 -7
- 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/plain-code-fallback.tsx +1 -1
- 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 +5 -5
- package/dist/assets/adapters/next/templates/init/components/shared/entity-filters-bar.tsx +6 -6
- package/dist/assets/adapters/next/templates/init/components/shared/entity-metadata.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/components/shared/entity-versions/entity-version-item.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/entity-versions/entity-versions-current-row.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/media/edit-media-dialog-content.tsx +5 -5
- 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 +3 -3
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-filters-bar.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-gallery-dialog.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-item.tsx +5 -5
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-grid-pagination.tsx +5 -5
- 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 +4 -4
- package/dist/assets/adapters/next/templates/init/components/shared/media/media-url-importer.tsx +5 -5
- package/dist/assets/adapters/next/templates/init/components/shared/page-header.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/components/shared/search-input.tsx +6 -6
- package/dist/assets/adapters/next/templates/init/components/shared/sort-indicator.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-dialog.tsx +4 -5
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-drag-overlay-item.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/components/shared/sort-order-item.tsx +3 -3
- 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 -67
- 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 -62
- 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 +5 -2
- 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/index.ts +1 -5
- 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 +5 -2
- 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/index.ts +1 -5
- 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/index.ts +1 -5
- 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 +4 -25
- 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 +2 -2
- package/dist/assets/adapters/next/templates/init/pages/admin-layout.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/auth-gate-rsc.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/dashboard-page.tsx +6 -6
- package/dist/assets/adapters/next/templates/init/pages/forgot-password-form.tsx +5 -5
- package/dist/assets/adapters/next/templates/init/pages/login-form.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/media/media-page-content.tsx +7 -7
- package/dist/assets/adapters/next/templates/init/pages/media/media-page-skeleton.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/minimal-account-shell.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-form.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/profile/profile-page.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/reset-password-form.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-columns.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-detail-drawer.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-detail-row.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-page-content.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/audit-log/audit-log-page-skeleton.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 +5 -4
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-page-content.tsx +4 -3
- package/dist/assets/adapters/next/templates/init/pages/settings/forms/forms-settings-page-skeleton.tsx +1 -1
- 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 +5 -4
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhook-endpoint-dialog.tsx +4 -4
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-columns.tsx +7 -7
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-columns.tsx +8 -8
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-logs-page-content.tsx +2 -2
- 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 +4 -3
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-page-content.tsx +2 -2
- package/dist/assets/adapters/next/templates/init/pages/settings/webhooks/webhooks-page-skeleton.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 +4 -3
- 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 +7 -6
- 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 +3 -2
- package/dist/assets/adapters/next/templates/init/pages/users/users-page-skeleton.tsx +1 -1
- package/dist/assets/adapters/next/templates/init/pages/users/users-table.tsx +9 -8
- package/dist/assets/adapters/next/templates/init/types/index.ts +0 -5
- package/dist/assets/adapters/next/templates/init/types/table-meta.ts +1 -1
- 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 +2 -2
- 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 +3 -3
- package/dist/assets/shared-assets/react-admin/custom/content-editor/main-toolbar-content.tsx +5 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/math-bubble-menu.tsx +3 -3
- 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 +2 -2
- 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/mobile-toolbar-content.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/custom/content-editor/remove-table-part-icon.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/content-editor/selection-bubble-menu.tsx +5 -5
- package/dist/assets/shared-assets/react-admin/custom/content-editor/slash-command-menu.tsx +9 -9
- 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 +12 -18
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-add-controls.tsx +4 -4
- package/dist/assets/shared-assets/react-admin/custom/content-editor/table-bubble-menu.tsx +5 -5
- 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 +4 -4
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/blockquote-button/blockquote-button.tsx +4 -20
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/code-block-button/code-block-button.tsx +4 -20
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-button/color-highlight-button.tsx +4 -40
- 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 +7 -11
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +9 -14
- 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 +9 -12
- 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 +6 -20
- 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 +3 -15
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/link-popover/link-popover.tsx +6 -18
- 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 +4 -21
- package/dist/assets/shared-assets/react-admin/custom/content-editor/tiptap-ui/undo-redo-button/undo-redo-button.tsx +4 -21
- package/dist/assets/shared-assets/react-admin/custom/date-picker.tsx +3 -5
- 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 +11 -16
- package/dist/assets/shared-assets/react-admin/custom/icon-picker.tsx +17 -12
- package/dist/assets/shared-assets/react-admin/custom/icons-column-skeleton.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/media-field-empty-state.tsx +6 -6
- package/dist/assets/shared-assets/react-admin/custom/media-field.tsx +9 -9
- package/dist/assets/shared-assets/react-admin/custom/nested-object-list-field.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/custom/placeholder-card.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/placeholder.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/progressive-blur.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/custom/sortable-gallery-item.tsx +4 -4
- package/dist/assets/shared-assets/react-admin/custom/upload-dropzone.tsx +8 -8
- package/dist/assets/shared-assets/react-admin/ui/accordion.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/alert-dialog.tsx +5 -5
- 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 +4 -3
- package/dist/assets/shared-assets/react-admin/ui/breadcrumb.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/button-group.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/button.tsx +9 -8
- package/dist/assets/shared-assets/react-admin/ui/calendar.tsx +3 -2
- package/dist/assets/shared-assets/react-admin/ui/card.tsx +6 -6
- 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 +2 -2
- package/dist/assets/shared-assets/react-admin/ui/combobox.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/command.tsx +1 -2
- package/dist/assets/shared-assets/react-admin/ui/context-menu.tsx +3 -3
- package/dist/assets/shared-assets/react-admin/ui/dialog.tsx +4 -4
- package/dist/assets/shared-assets/react-admin/ui/direction.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/drawer.tsx +2 -2
- package/dist/assets/shared-assets/react-admin/ui/dropdown-menu.tsx +4 -4
- package/dist/assets/shared-assets/react-admin/ui/empty.tsx +2 -1
- package/dist/assets/shared-assets/react-admin/ui/field.tsx +2 -2
- 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 +5 -4
- package/dist/assets/shared-assets/react-admin/ui/input-otp.tsx +1 -1
- package/dist/assets/shared-assets/react-admin/ui/input.tsx +2 -2
- 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 +3 -3
- 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 -2
- 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 +2 -2
- package/dist/assets/shared-assets/react-admin/ui/select.tsx +3 -3
- 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 +7 -14
- 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 +2 -2
- package/dist/assets/shared-assets/react-admin/ui/tabs.tsx +5 -4
- package/dist/assets/shared-assets/react-admin/ui/textarea.tsx +2 -2
- 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 +2 -2
- package/dist/{chunk-LGZBMR7E.js → chunk-AIQWGMU7.js} +138 -7
- package/dist/chunk-AIQWGMU7.js.map +1 -0
- package/dist/cli.js +9633 -9704
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/{template-reader-WRTNGRZV.js → template-reader-F2VFSDKV.js} +2 -2
- package/package.json +5 -5
- package/dist/assets/shared-assets/react-admin/dependencies.ts +0 -74
- package/dist/chunk-LGZBMR7E.js.map +0 -1
- /package/dist/{template-reader-WRTNGRZV.js.map → template-reader-F2VFSDKV.js.map} +0 -0
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { ColorHighlightPopoverButtonProps } from './color-highlight-popover-button'
|
|
5
|
+
import type { HighlightColor } from './highlight-colors'
|
|
3
6
|
import type {
|
|
4
7
|
ControlAvailability,
|
|
5
8
|
ControlTooltip
|
|
6
9
|
} from '@admin/components/custom/content-editor/tiptap-ui/control-options'
|
|
7
|
-
import { Popover, PopoverContent, PopoverTrigger } from '@admin/components/ui/popover'
|
|
8
|
-
// --- Hooks ---
|
|
9
10
|
import type { UseColorHighlightConfig } from '@admin/hooks/content-editor/use-color-highlight'
|
|
11
|
+
import { Popover, PopoverContent, PopoverTrigger } from '@admin/components/ui/popover'
|
|
10
12
|
import { useColorHighlight } from '@admin/hooks/content-editor/use-color-highlight'
|
|
11
13
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
12
|
-
import * as React from 'react'
|
|
13
14
|
import { shouldHideUnavailableControl } from '../control-options'
|
|
14
|
-
import {
|
|
15
|
-
ColorHighlightPopoverButton,
|
|
16
|
-
type ColorHighlightPopoverButtonProps
|
|
17
|
-
} from './color-highlight-popover-button'
|
|
15
|
+
import { ColorHighlightPopoverButton } from './color-highlight-popover-button'
|
|
18
16
|
import { ColorHighlightPopoverContent } from './color-highlight-popover-content'
|
|
19
|
-
import { DEFAULT_HIGHLIGHT_COLORS
|
|
17
|
+
import { DEFAULT_HIGHLIGHT_COLORS } from './highlight-colors'
|
|
20
18
|
|
|
21
19
|
export { ColorHighlightPopoverButton } from './color-highlight-popover-button'
|
|
22
20
|
export type { ColorHighlightPopoverContentProps } from './color-highlight-popover-content'
|
|
@@ -25,13 +23,10 @@ export type { SourceColorHighlightPopoverProps } from './source-color-highlight-
|
|
|
25
23
|
export { SourceColorHighlightPopover } from './source-color-highlight-popover'
|
|
26
24
|
|
|
27
25
|
export interface ColorHighlightPopoverProps
|
|
28
|
-
extends
|
|
26
|
+
extends
|
|
27
|
+
Omit<ColorHighlightPopoverButtonProps, 'type'>,
|
|
29
28
|
Pick<UseColorHighlightConfig, 'editor' | 'onApplied'> {
|
|
30
29
|
availability?: ControlAvailability
|
|
31
|
-
/**
|
|
32
|
-
* Optional colors to use in the highlight popover.
|
|
33
|
-
* If not provided, defaults to a predefined set of colors.
|
|
34
|
-
*/
|
|
35
30
|
colors?: HighlightColor[]
|
|
36
31
|
onOpenChange?: (isOpen: boolean) => void
|
|
37
32
|
tooltip?: ControlTooltip
|
|
@@ -91,7 +86,7 @@ export function ColorHighlightPopover({
|
|
|
91
86
|
</PopoverTrigger>
|
|
92
87
|
<PopoverContent
|
|
93
88
|
aria-label="Highlight colors"
|
|
94
|
-
className="w-auto max-w-[calc(100vw-2rem)] gap-0 p-0
|
|
89
|
+
className="w-auto max-w-[calc(100vw-2rem)] gap-0 rounded-sm p-0"
|
|
95
90
|
>
|
|
96
91
|
<ColorHighlightPopoverContent
|
|
97
92
|
editor={editor}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { HighlightButtonStyle, HighlightColor } from './highlight-colors'
|
|
4
|
+
import type { Editor } from '@tiptap/react'
|
|
3
5
|
import { Button } from '@admin/components/ui/button'
|
|
4
6
|
import { cn } from '@admin/utils/shared/cn'
|
|
5
|
-
import type { Editor } from '@tiptap/react'
|
|
6
7
|
import { ColorHighlightButton, HighlightSwatch } from '../color-highlight-button'
|
|
7
|
-
import type { HighlightButtonStyle, HighlightColor } from './highlight-colors'
|
|
8
8
|
|
|
9
9
|
export function HighlightColorButton({
|
|
10
10
|
color,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type HighlightColor,
|
|
3
|
-
pickHighlightColorsByValue
|
|
4
|
-
} from '@admin/hooks/content-editor/use-color-highlight'
|
|
5
1
|
import type * as React from 'react'
|
|
2
|
+
import type { HighlightColor } from '@admin/hooks/content-editor/use-color-highlight'
|
|
3
|
+
import { pickHighlightColorsByValue } from '@admin/hooks/content-editor/use-color-highlight'
|
|
6
4
|
|
|
7
5
|
export type HighlightButtonStyle = React.CSSProperties & {
|
|
8
6
|
'--highlight-color': string
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ColorHighlightPopoverButtonProps } from './color-highlight-popover-button'
|
|
4
|
+
import type { HighlightColor } from './highlight-colors'
|
|
3
5
|
import { Popover, PopoverContent, PopoverTrigger } from '@admin/components/ui/popover'
|
|
4
6
|
import { HighlighterIcon } from 'lucide-react'
|
|
5
7
|
import { useState } from 'react'
|
|
6
|
-
import {
|
|
7
|
-
ColorHighlightPopoverButton,
|
|
8
|
-
type ColorHighlightPopoverButtonProps
|
|
9
|
-
} from './color-highlight-popover-button'
|
|
8
|
+
import { ColorHighlightPopoverButton } from './color-highlight-popover-button'
|
|
10
9
|
import { ColorHighlightPopoverContent } from './color-highlight-popover-content'
|
|
11
|
-
import { DEFAULT_HIGHLIGHT_COLORS
|
|
10
|
+
import { DEFAULT_HIGHLIGHT_COLORS } from './highlight-colors'
|
|
12
11
|
|
|
13
|
-
export interface SourceColorHighlightPopoverProps
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
* If not provided, defaults to a predefined set of colors.
|
|
18
|
-
*/
|
|
12
|
+
export interface SourceColorHighlightPopoverProps extends Omit<
|
|
13
|
+
ColorHighlightPopoverButtonProps,
|
|
14
|
+
'type'
|
|
15
|
+
> {
|
|
19
16
|
colors?: HighlightColor[]
|
|
20
17
|
disabled?: boolean
|
|
21
18
|
onHighlightColorSelect: (color: HighlightColor) => void
|
|
@@ -50,7 +47,7 @@ export function SourceColorHighlightPopover({
|
|
|
50
47
|
</PopoverTrigger>
|
|
51
48
|
<PopoverContent
|
|
52
49
|
aria-label="Highlight colors"
|
|
53
|
-
className="w-auto max-w-[calc(100vw-2rem)] gap-0 p-0
|
|
50
|
+
className="w-auto max-w-[calc(100vw-2rem)] gap-0 rounded-sm p-0"
|
|
54
51
|
>
|
|
55
52
|
<ColorHighlightPopoverContent
|
|
56
53
|
mode="source"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { type Level, useHeading } from '@admin/hooks/content-editor/use-heading'
|
|
3
|
+
import type { Level } from '@admin/hooks/content-editor/use-heading'
|
|
5
4
|
import type { Editor } from '@tiptap/react'
|
|
5
|
+
import { DropdownMenuItem } from '@admin/components/ui/dropdown-menu'
|
|
6
|
+
import { useHeading } from '@admin/hooks/content-editor/use-heading'
|
|
6
7
|
|
|
7
8
|
export function HeadingDropdownMenuItem({
|
|
8
9
|
editor,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ControlAvailability, ControlTooltip } from '../control-options'
|
|
4
|
+
import type { UseHeadingDropdownMenuConfig } from '@admin/hooks/content-editor/use-heading-dropdown-menu'
|
|
3
5
|
import { Button } from '@admin/components/ui/button'
|
|
4
6
|
import {
|
|
5
7
|
DropdownMenu,
|
|
@@ -7,20 +9,11 @@ import {
|
|
|
7
9
|
DropdownMenuGroup,
|
|
8
10
|
DropdownMenuTrigger
|
|
9
11
|
} from '@admin/components/ui/dropdown-menu'
|
|
10
|
-
import {
|
|
11
|
-
type UseHeadingDropdownMenuConfig,
|
|
12
|
-
useHeadingDropdownMenu
|
|
13
|
-
} from '@admin/hooks/content-editor/use-heading-dropdown-menu'
|
|
12
|
+
import { useHeadingDropdownMenu } from '@admin/hooks/content-editor/use-heading-dropdown-menu'
|
|
14
13
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
15
|
-
// --- Icons ---
|
|
16
14
|
import { ChevronDownIcon } from 'lucide-react'
|
|
17
15
|
import { useCallback, useState } from 'react'
|
|
18
|
-
import {
|
|
19
|
-
type ControlAvailability,
|
|
20
|
-
type ControlTooltip,
|
|
21
|
-
getControlTooltipTitle,
|
|
22
|
-
shouldHideUnavailableControl
|
|
23
|
-
} from '../control-options'
|
|
16
|
+
import { getControlTooltipTitle, shouldHideUnavailableControl } from '../control-options'
|
|
24
17
|
import { HeadingDropdownMenuItem } from './heading-dropdown-menu-item'
|
|
25
18
|
|
|
26
19
|
type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
@@ -28,20 +21,13 @@ type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
|
28
21
|
}
|
|
29
22
|
|
|
30
23
|
export interface HeadingDropdownMenuProps
|
|
31
|
-
extends
|
|
24
|
+
extends
|
|
25
|
+
Omit<EditorButtonProps, 'type'>,
|
|
32
26
|
Omit<UseHeadingDropdownMenuConfig, 'hideWhenUnavailable'> {
|
|
33
27
|
availability?: ControlAvailability
|
|
34
|
-
/**
|
|
35
|
-
* Callback for when the dropdown opens or closes
|
|
36
|
-
*/
|
|
37
28
|
onOpenChange?: (isOpen: boolean) => void
|
|
38
29
|
}
|
|
39
30
|
|
|
40
|
-
/**
|
|
41
|
-
* Dropdown menu component for selecting heading levels in a Tiptap editor.
|
|
42
|
-
*
|
|
43
|
-
* For custom dropdown implementations, use the `useHeadingDropdownMenu` hook instead.
|
|
44
|
-
*/
|
|
45
31
|
export function HeadingDropdownMenu({
|
|
46
32
|
editor: providedEditor,
|
|
47
33
|
availability,
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from '@admin/components/custom/content-editor/tiptap-ui/control-options'
|
|
3
|
+
import type * as React from 'react'
|
|
4
|
+
import type { ControlTooltip } from '@admin/components/custom/content-editor/tiptap-ui/control-options'
|
|
5
|
+
import { getControlTooltipTitle } from '@admin/components/custom/content-editor/tiptap-ui/control-options'
|
|
7
6
|
import { Button } from '@admin/components/ui/button'
|
|
8
7
|
import { LinkIcon } from 'lucide-react'
|
|
9
|
-
import type * as React from 'react'
|
|
10
8
|
|
|
11
9
|
export type LinkButtonProps = React.ComponentProps<typeof Button> & {
|
|
12
10
|
tooltip?: ControlTooltip
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { useLinkPopover } from '@admin/hooks/content-editor/use-link-popover'
|
|
4
3
|
import type { Editor } from '@tiptap/react'
|
|
4
|
+
import { useLinkPopover } from '@admin/hooks/content-editor/use-link-popover'
|
|
5
5
|
import { LinkMain } from './link-main'
|
|
6
6
|
|
|
7
7
|
export function LinkContent({ editor }: { editor?: Editor | null }) {
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type * as React from 'react'
|
|
4
|
+
import type { LinkButtonProps } from './link-button'
|
|
5
|
+
import type { LinkMainProps } from './link-main'
|
|
3
6
|
import { Popover, PopoverContent, PopoverTrigger } from '@admin/components/ui/popover'
|
|
4
7
|
import { LinkIcon } from 'lucide-react'
|
|
5
|
-
import type * as React from 'react'
|
|
6
8
|
import { useCallback, useState } from 'react'
|
|
7
|
-
import { LinkButton
|
|
8
|
-
import { LinkMain
|
|
9
|
+
import { LinkButton } from './link-button'
|
|
10
|
+
import { LinkMain } from './link-main'
|
|
9
11
|
|
|
10
12
|
export interface LinkControlPopoverProps extends Omit<LinkButtonProps, 'type'>, LinkMainProps {
|
|
11
13
|
canSet?: boolean
|
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type * as React from 'react'
|
|
3
4
|
import { Button } from '@admin/components/ui/button'
|
|
4
5
|
import { InputGroup, InputGroupInput } from '@admin/components/ui/input-group'
|
|
5
6
|
import { TrashIcon } from 'lucide-react'
|
|
6
|
-
import type * as React from 'react'
|
|
7
7
|
|
|
8
8
|
export interface LinkMainProps {
|
|
9
|
-
/**
|
|
10
|
-
* The URL to set for the link.
|
|
11
|
-
*/
|
|
12
9
|
url: string
|
|
13
|
-
/**
|
|
14
|
-
* Function to update the URL state.
|
|
15
|
-
*/
|
|
16
10
|
setUrl: React.Dispatch<React.SetStateAction<string | null>>
|
|
17
|
-
/**
|
|
18
|
-
* Function to set the link in the editor.
|
|
19
|
-
*/
|
|
20
11
|
setLink: () => void
|
|
21
|
-
/**
|
|
22
|
-
* Function to remove the link from the editor.
|
|
23
|
-
*/
|
|
24
12
|
removeLink: () => void
|
|
25
13
|
}
|
|
26
14
|
|
|
@@ -33,7 +21,7 @@ export function LinkMain({ url, setUrl, setLink, removeLink }: LinkMainProps) {
|
|
|
33
21
|
}
|
|
34
22
|
|
|
35
23
|
return (
|
|
36
|
-
<div className="flex
|
|
24
|
+
<div className="flex min-w-max flex-col items-center gap-2">
|
|
37
25
|
<InputGroup className="h-9 min-w-64">
|
|
38
26
|
<InputGroupInput
|
|
39
27
|
type="url"
|
|
@@ -48,7 +36,7 @@ export function LinkMain({ url, setUrl, setLink, removeLink }: LinkMainProps) {
|
|
|
48
36
|
/>
|
|
49
37
|
</InputGroup>
|
|
50
38
|
|
|
51
|
-
<div className="flex items-center gap-1
|
|
39
|
+
<div className="flex w-full items-center gap-1">
|
|
52
40
|
{url && (
|
|
53
41
|
<Button type="button" onClick={removeLink} title="Remove link" variant="destructive">
|
|
54
42
|
<TrashIcon />
|
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
// --- Hooks ---
|
|
4
|
-
import {
|
|
5
|
-
type UseLinkPopoverConfig,
|
|
6
|
-
useLinkPopover
|
|
7
|
-
} from '@admin/hooks/content-editor/use-link-popover'
|
|
8
|
-
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
9
3
|
import * as React from 'react'
|
|
10
4
|
import type { LinkPopoverOpenMode } from '../control-options'
|
|
5
|
+
import type { ControlAvailability } from '../control-options'
|
|
6
|
+
import type { LinkButtonProps } from './link-button'
|
|
7
|
+
import type { UseLinkPopoverConfig } from '@admin/hooks/content-editor/use-link-popover'
|
|
8
|
+
import { useLinkPopover } from '@admin/hooks/content-editor/use-link-popover'
|
|
9
|
+
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
11
10
|
import {
|
|
12
|
-
type ControlAvailability,
|
|
13
11
|
shouldHideUnavailableControl,
|
|
14
12
|
shouldOpenLinkPopoverFromActiveLink
|
|
15
13
|
} from '../control-options'
|
|
16
|
-
import type { LinkButtonProps } from './link-button'
|
|
17
14
|
import { LinkControlPopover } from './link-control-popover'
|
|
18
15
|
|
|
19
16
|
export { LinkButton } from './link-button'
|
|
@@ -23,12 +20,8 @@ export { LinkControlPopover } from './link-control-popover'
|
|
|
23
20
|
export type { LinkMainProps } from './link-main'
|
|
24
21
|
|
|
25
22
|
export interface LinkPopoverProps
|
|
26
|
-
extends Omit<LinkButtonProps, 'type'>,
|
|
27
|
-
Omit<UseLinkPopoverConfig, 'hideWhenUnavailable'> {
|
|
23
|
+
extends Omit<LinkButtonProps, 'type'>, Omit<UseLinkPopoverConfig, 'hideWhenUnavailable'> {
|
|
28
24
|
availability?: ControlAvailability
|
|
29
|
-
/**
|
|
30
|
-
* Callback for when the popover opens or closes.
|
|
31
|
-
*/
|
|
32
25
|
onOpenChange?: (isOpen: boolean) => void
|
|
33
26
|
openMode?: LinkPopoverOpenMode
|
|
34
27
|
}
|
|
@@ -39,11 +32,6 @@ type LinkPopoverOpenState = {
|
|
|
39
32
|
open: boolean | null
|
|
40
33
|
}
|
|
41
34
|
|
|
42
|
-
/**
|
|
43
|
-
* Link popover component for Tiptap editors.
|
|
44
|
-
*
|
|
45
|
-
* For custom popover implementations, use the `useLinkPopover` hook instead.
|
|
46
|
-
*/
|
|
47
35
|
export function LinkPopover({
|
|
48
36
|
editor: providedEditor,
|
|
49
37
|
availability,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { type ListType, useList } from '@admin/hooks/content-editor/use-list'
|
|
3
|
+
import type { ListType } from '@admin/hooks/content-editor/use-list'
|
|
5
4
|
import type { Editor } from '@tiptap/react'
|
|
5
|
+
import { DropdownMenuItem } from '@admin/components/ui/dropdown-menu'
|
|
6
|
+
import { useList } from '@admin/hooks/content-editor/use-list'
|
|
6
7
|
|
|
7
8
|
export function ListDropdownMenuItem({
|
|
8
9
|
editor,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ControlAvailability, ControlTooltip } from '../control-options'
|
|
4
|
+
import type { ListType } from '@admin/hooks/content-editor/use-list'
|
|
5
|
+
import type { Editor } from '@tiptap/react'
|
|
3
6
|
import { Button } from '@admin/components/ui/button'
|
|
4
7
|
import {
|
|
5
8
|
DropdownMenu,
|
|
@@ -7,20 +10,11 @@ import {
|
|
|
7
10
|
DropdownMenuGroup,
|
|
8
11
|
DropdownMenuTrigger
|
|
9
12
|
} from '@admin/components/ui/dropdown-menu'
|
|
10
|
-
// --- Hooks ---
|
|
11
|
-
import type { ListType } from '@admin/hooks/content-editor/use-list'
|
|
12
13
|
import { useListDropdownMenu } from '@admin/hooks/content-editor/use-list-dropdown-menu'
|
|
13
14
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
14
|
-
import type { Editor } from '@tiptap/react'
|
|
15
|
-
// --- Icons ---
|
|
16
15
|
import { ChevronDownIcon } from 'lucide-react'
|
|
17
16
|
import { useCallback, useState } from 'react'
|
|
18
|
-
import {
|
|
19
|
-
type ControlAvailability,
|
|
20
|
-
type ControlTooltip,
|
|
21
|
-
getControlTooltipTitle,
|
|
22
|
-
shouldHideUnavailableControl
|
|
23
|
-
} from '../control-options'
|
|
17
|
+
import { getControlTooltipTitle, shouldHideUnavailableControl } from '../control-options'
|
|
24
18
|
import { ListDropdownMenuItem } from './list-dropdown-menu-item'
|
|
25
19
|
|
|
26
20
|
type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
@@ -29,17 +23,8 @@ type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
|
29
23
|
|
|
30
24
|
export interface ListDropdownMenuProps extends Omit<EditorButtonProps, 'type'> {
|
|
31
25
|
availability?: ControlAvailability
|
|
32
|
-
/**
|
|
33
|
-
* The Tiptap editor instance.
|
|
34
|
-
*/
|
|
35
26
|
editor?: Editor
|
|
36
|
-
/**
|
|
37
|
-
* The list types to display in the dropdown.
|
|
38
|
-
*/
|
|
39
27
|
types?: ListType[]
|
|
40
|
-
/**
|
|
41
|
-
* Callback for when the dropdown opens or closes
|
|
42
|
-
*/
|
|
43
28
|
onOpenChange?: (isOpen: boolean) => void
|
|
44
29
|
}
|
|
45
30
|
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
|
+
import type { Mark, UseMarkConfig } from '@admin/hooks/content-editor/use-mark'
|
|
3
5
|
import { Badge } from '@admin/components/ui/badge'
|
|
4
6
|
import { Button } from '@admin/components/ui/button'
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
MARK_SHORTCUT_KEYS,
|
|
8
|
-
type Mark,
|
|
9
|
-
type UseMarkConfig,
|
|
10
|
-
useMark
|
|
11
|
-
} from '@admin/hooks/content-editor/use-mark'
|
|
7
|
+
import { MARK_SHORTCUT_KEYS, useMark } from '@admin/hooks/content-editor/use-mark'
|
|
12
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
13
|
-
// --- Lib ---
|
|
14
9
|
import { parseShortcutKeys } from '@admin/utils/editor/tiptap'
|
|
15
10
|
import { useCallback } from 'react'
|
|
16
11
|
import {
|
|
17
|
-
type ControlAvailability,
|
|
18
|
-
type ControlShortcut,
|
|
19
|
-
type ControlTooltip,
|
|
20
12
|
getControlTooltipTitle,
|
|
21
13
|
shouldHideUnavailableControl,
|
|
22
14
|
shouldShowControlShortcut
|
|
@@ -27,12 +19,8 @@ type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
export interface MarkButtonProps
|
|
30
|
-
extends Omit<EditorButtonProps, 'type'>,
|
|
31
|
-
Omit<UseMarkConfig, 'hideWhenUnavailable'> {
|
|
22
|
+
extends Omit<EditorButtonProps, 'type'>, Omit<UseMarkConfig, 'hideWhenUnavailable'> {
|
|
32
23
|
availability?: ControlAvailability
|
|
33
|
-
/**
|
|
34
|
-
* Optional text to display alongside the icon.
|
|
35
|
-
*/
|
|
36
24
|
text?: string
|
|
37
25
|
shortcut?: ControlShortcut
|
|
38
26
|
}
|
|
@@ -47,11 +35,6 @@ export function MarkShortcutBadge({
|
|
|
47
35
|
return <Badge>{parseShortcutKeys({ shortcutKeys })}</Badge>
|
|
48
36
|
}
|
|
49
37
|
|
|
50
|
-
/**
|
|
51
|
-
* Button component for toggling marks in a Tiptap editor.
|
|
52
|
-
*
|
|
53
|
-
* For custom button implementations, use the `useMark` hook instead.
|
|
54
|
-
*/
|
|
55
38
|
export function MarkButton({
|
|
56
39
|
editor: providedEditor,
|
|
57
40
|
availability,
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
|
+
import type { UndoRedoAction, UseUndoRedoConfig } from '@admin/hooks/content-editor/use-undo-redo'
|
|
3
5
|
import { Badge } from '@admin/components/ui/badge'
|
|
4
6
|
import { Button } from '@admin/components/ui/button'
|
|
5
7
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
UNDO_REDO_SHORTCUT_KEYS,
|
|
9
|
-
type UndoRedoAction,
|
|
10
|
-
type UseUndoRedoConfig,
|
|
11
|
-
useUndoRedo
|
|
12
|
-
} from '@admin/hooks/content-editor/use-undo-redo'
|
|
13
|
-
// --- Lib ---
|
|
8
|
+
import { UNDO_REDO_SHORTCUT_KEYS, useUndoRedo } from '@admin/hooks/content-editor/use-undo-redo'
|
|
14
9
|
import { parseShortcutKeys } from '@admin/utils/editor/tiptap'
|
|
15
10
|
import { useCallback } from 'react'
|
|
16
11
|
import {
|
|
17
|
-
type ControlAvailability,
|
|
18
|
-
type ControlShortcut,
|
|
19
|
-
type ControlTooltip,
|
|
20
12
|
getControlTooltipTitle,
|
|
21
13
|
shouldHideUnavailableControl,
|
|
22
14
|
shouldShowControlShortcut
|
|
@@ -27,12 +19,8 @@ type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
|
27
19
|
}
|
|
28
20
|
|
|
29
21
|
export interface UndoRedoButtonProps
|
|
30
|
-
extends Omit<EditorButtonProps, 'type'>,
|
|
31
|
-
Omit<UseUndoRedoConfig, 'hideWhenUnavailable'> {
|
|
22
|
+
extends Omit<EditorButtonProps, 'type'>, Omit<UseUndoRedoConfig, 'hideWhenUnavailable'> {
|
|
32
23
|
availability?: ControlAvailability
|
|
33
|
-
/**
|
|
34
|
-
* Optional text to display alongside the icon.
|
|
35
|
-
*/
|
|
36
24
|
text?: string
|
|
37
25
|
shortcut?: ControlShortcut
|
|
38
26
|
}
|
|
@@ -47,11 +35,6 @@ export function HistoryShortcutBadge({
|
|
|
47
35
|
return <Badge>{parseShortcutKeys({ shortcutKeys })}</Badge>
|
|
48
36
|
}
|
|
49
37
|
|
|
50
|
-
/**
|
|
51
|
-
* Button component for triggering undo/redo actions in a Tiptap editor.
|
|
52
|
-
*
|
|
53
|
-
* For custom button implementations, use the `useHistory` hook instead.
|
|
54
|
-
*/
|
|
55
38
|
export function UndoRedoButton({
|
|
56
39
|
editor: providedEditor,
|
|
57
40
|
action,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
3
4
|
import { Button } from '@admin/components/ui/button'
|
|
4
5
|
import { Calendar } from '@admin/components/ui/calendar'
|
|
5
6
|
import { Popover, PopoverContent, PopoverTrigger } from '@admin/components/ui/popover'
|
|
6
7
|
import { cn } from '@admin/utils/shared/cn'
|
|
7
8
|
import { format } from 'date-fns'
|
|
8
9
|
import { CalendarIcon } from 'lucide-react'
|
|
9
|
-
import * as React from 'react'
|
|
10
10
|
|
|
11
11
|
interface DatePickerProps {
|
|
12
12
|
value?: string
|
|
@@ -14,9 +14,7 @@ interface DatePickerProps {
|
|
|
14
14
|
disabled?: boolean
|
|
15
15
|
placeholder?: string
|
|
16
16
|
className?: string
|
|
17
|
-
/** Start year for the year dropdown (defaults to 1900) */
|
|
18
17
|
startYear?: number
|
|
19
|
-
/** End year for the year dropdown (defaults to current year + 100) */
|
|
20
18
|
endYear?: number
|
|
21
19
|
}
|
|
22
20
|
|
|
@@ -39,7 +37,7 @@ export function DatePicker({
|
|
|
39
37
|
variant="outline"
|
|
40
38
|
size="lg"
|
|
41
39
|
className={cn(
|
|
42
|
-
'w-full justify-start text-left font-normal
|
|
40
|
+
'w-full justify-start pl-3! text-left font-normal',
|
|
43
41
|
{ 'text-muted-foreground': !date },
|
|
44
42
|
className
|
|
45
43
|
)}
|
|
@@ -49,7 +47,7 @@ export function DatePicker({
|
|
|
49
47
|
{date ? format(date, 'PPP') : <span>{placeholder}</span>}
|
|
50
48
|
</Button>
|
|
51
49
|
</PopoverTrigger>
|
|
52
|
-
<PopoverContent className="w-auto p-0
|
|
50
|
+
<PopoverContent className="w-auto overflow-hidden p-0" align="start">
|
|
53
51
|
<Calendar
|
|
54
52
|
mode="single"
|
|
55
53
|
selected={date}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { DateRange } from 'react-day-picker'
|
|
3
5
|
import { Button } from '@admin/components/ui/button'
|
|
4
6
|
import { Calendar } from '@admin/components/ui/calendar'
|
|
5
7
|
import { Input } from '@admin/components/ui/input'
|
|
@@ -18,8 +20,6 @@ import {
|
|
|
18
20
|
} from '@admin/utils/date/date'
|
|
19
21
|
import { cn } from '@admin/utils/shared/cn'
|
|
20
22
|
import { CalendarIcon, ChevronDown, CornerDownLeft } from 'lucide-react'
|
|
21
|
-
import * as React from 'react'
|
|
22
|
-
import type { DateRange } from 'react-day-picker'
|
|
23
23
|
|
|
24
24
|
interface DateRangePickerProps {
|
|
25
25
|
from?: string
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { CarouselApi } from '@admin/components/ui/carousel'
|
|
5
|
+
import type { AdminMedia } from '@admin/types'
|
|
6
|
+
import type { DragEndEvent, DragStartEvent } from '@dnd-kit/core'
|
|
3
7
|
import { MediaGalleryDialog } from '@admin/components/shared/media/media-gallery-dialog'
|
|
4
8
|
import { Card, CardContent, CardFooter } from '@admin/components/ui/card'
|
|
5
|
-
import {
|
|
6
|
-
Carousel,
|
|
7
|
-
type CarouselApi,
|
|
8
|
-
CarouselContent,
|
|
9
|
-
CarouselItem
|
|
10
|
-
} from '@admin/components/ui/carousel'
|
|
9
|
+
import { Carousel, CarouselContent, CarouselItem } from '@admin/components/ui/carousel'
|
|
11
10
|
import { Skeleton } from '@admin/components/ui/skeleton'
|
|
12
11
|
import { useMediaByIds } from '@admin/hooks/use-media'
|
|
13
|
-
import type { AdminMedia } from '@admin/types'
|
|
14
12
|
import {
|
|
15
13
|
closestCenter,
|
|
16
14
|
DndContext,
|
|
17
|
-
type DragEndEvent,
|
|
18
15
|
DragOverlay,
|
|
19
|
-
type DragStartEvent,
|
|
20
16
|
KeyboardSensor,
|
|
21
17
|
PointerSensor,
|
|
22
18
|
useSensor,
|
|
@@ -24,7 +20,6 @@ import {
|
|
|
24
20
|
} from '@dnd-kit/core'
|
|
25
21
|
import { arrayMove, horizontalListSortingStrategy, SortableContext } from '@dnd-kit/sortable'
|
|
26
22
|
import { Plus } from 'lucide-react'
|
|
27
|
-
import * as React from 'react'
|
|
28
23
|
import { MediaField } from './media-field'
|
|
29
24
|
import { MediaFieldEmptyState } from './media-field-empty-state'
|
|
30
25
|
import { SortableGalleryItem } from './sortable-gallery-item'
|
|
@@ -196,8 +191,8 @@ export function GalleryField({
|
|
|
196
191
|
{canAdd && !disabled ? (
|
|
197
192
|
<CarouselItem className="basis-[168px] pl-3 sm:basis-[184px]">
|
|
198
193
|
<Card className="h-full" onClick={() => setOpen(true)}>
|
|
199
|
-
<CardContent className="
|
|
200
|
-
<div className="flex size-full
|
|
194
|
+
<CardContent className="flex cursor-pointer flex-col p-2">
|
|
195
|
+
<div className="flex aspect-square size-full flex-col items-center justify-center gap-1 overflow-hidden rounded-sm border border-border bg-background text-muted-foreground transition-colors hover:text-foreground">
|
|
201
196
|
<Plus className="size-6" strokeWidth={1.5} />
|
|
202
197
|
<span className="text-sm">Add Images</span>
|
|
203
198
|
</div>
|
|
@@ -228,8 +223,8 @@ export function GalleryField({
|
|
|
228
223
|
/>
|
|
229
224
|
) : (
|
|
230
225
|
<Card>
|
|
231
|
-
<CardContent className="
|
|
232
|
-
<div className="flex size-full
|
|
226
|
+
<CardContent className="flex flex-col p-2">
|
|
227
|
+
<div className="flex aspect-square size-full overflow-hidden rounded-sm border border-border bg-background">
|
|
233
228
|
<Skeleton className="size-full" />
|
|
234
229
|
</div>
|
|
235
230
|
</CardContent>
|
|
@@ -262,8 +257,8 @@ export function GalleryField({
|
|
|
262
257
|
/>
|
|
263
258
|
) : (
|
|
264
259
|
<Card>
|
|
265
|
-
<CardContent className="
|
|
266
|
-
<div className="flex size-full
|
|
260
|
+
<CardContent className="flex flex-col p-2">
|
|
261
|
+
<div className="flex aspect-square size-full overflow-hidden rounded-sm border border-border bg-background">
|
|
267
262
|
<Skeleton className="size-full" />
|
|
268
263
|
</div>
|
|
269
264
|
</CardContent>
|