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,5 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { ContentEditorSlashCommand } from '@admin/utils/editor/slash-commands'
|
|
5
|
+
import type { SlashMenuState } from '@admin/utils/editor/tiptap'
|
|
3
6
|
import {
|
|
4
7
|
Combobox,
|
|
5
8
|
ComboboxContent,
|
|
@@ -8,10 +11,7 @@ import {
|
|
|
8
11
|
ComboboxItem,
|
|
9
12
|
ComboboxList
|
|
10
13
|
} from '@admin/components/ui/combobox'
|
|
11
|
-
import type { ContentEditorSlashCommand } from '@admin/utils/editor/slash-commands'
|
|
12
|
-
import type { SlashMenuState } from '@admin/utils/editor/tiptap'
|
|
13
14
|
import { cn } from '@admin/utils/shared/cn'
|
|
14
|
-
import * as React from 'react'
|
|
15
15
|
|
|
16
16
|
export function SlashCommandMenu({
|
|
17
17
|
activeIndex,
|
|
@@ -130,7 +130,7 @@ export function SlashCommandMenu({
|
|
|
130
130
|
<ComboboxContent
|
|
131
131
|
anchor={slashAnchor}
|
|
132
132
|
align="start"
|
|
133
|
-
className="
|
|
133
|
+
className="flex w-72 max-w-[calc(100vw-2rem)] min-w-72 flex-col gap-2 p-2"
|
|
134
134
|
collisionPadding={8}
|
|
135
135
|
finalFocus={false}
|
|
136
136
|
initialFocus={false}
|
|
@@ -166,17 +166,17 @@ export function SlashCommandMenu({
|
|
|
166
166
|
onMouseEnter={() => onActiveIndexChange(index)}
|
|
167
167
|
value={command}
|
|
168
168
|
className={cn(
|
|
169
|
-
'border border-transparent p-2 data-highlighted:
|
|
169
|
+
'border border-transparent p-2 data-highlighted:border-border! data-highlighted:bg-card!',
|
|
170
170
|
{
|
|
171
|
-
'bg-card
|
|
171
|
+
'border-border bg-card text-foreground shadow-input': isActive
|
|
172
172
|
}
|
|
173
173
|
)}
|
|
174
174
|
>
|
|
175
|
-
<span className="flex size-8 shrink-0 items-center justify-center rounded-sm
|
|
175
|
+
<span className="flex size-8 shrink-0 items-center justify-center rounded-sm border border-border bg-card shadow-input">
|
|
176
176
|
<Icon />
|
|
177
177
|
</span>
|
|
178
|
-
<span className="min-w-0 space-y-1
|
|
179
|
-
<span className="font-medium
|
|
178
|
+
<span className="flex w-full min-w-0 flex-col space-y-1">
|
|
179
|
+
<span className="leading-none font-medium">{command.title}</span>
|
|
180
180
|
<span className="truncate text-xs text-muted-foreground">
|
|
181
181
|
{command.description}
|
|
182
182
|
</span>
|
package/dist/assets/shared-assets/react-admin/custom/content-editor/source-mode-dropdown-button.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
3
4
|
import { Button } from '@admin/components/ui/button'
|
|
4
5
|
import {
|
|
5
6
|
DropdownMenu,
|
|
@@ -8,7 +9,6 @@ import {
|
|
|
8
9
|
DropdownMenuTrigger
|
|
9
10
|
} from '@admin/components/ui/dropdown-menu'
|
|
10
11
|
import { ChevronDownIcon } from 'lucide-react'
|
|
11
|
-
import * as React from 'react'
|
|
12
12
|
|
|
13
13
|
type SvgIcon = React.ComponentType<{ className?: string }>
|
|
14
14
|
|
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type * as React from 'react'
|
|
4
|
+
import type { ContentEditorSelectionRequest } from '@admin/utils/editor/content-editor'
|
|
5
|
+
import type { MarkdownHeadingLevel, MarkdownListType } from '@admin/utils/editor/markdown'
|
|
3
6
|
import { SourceColorHighlightPopover } from '@admin/components/custom/content-editor/tiptap-ui/color-highlight-popover'
|
|
4
7
|
import { LinkControlPopover } from '@admin/components/custom/content-editor/tiptap-ui/link-popover'
|
|
5
8
|
import { Button } from '@admin/components/ui/button'
|
|
6
9
|
import { DropdownMenuItem } from '@admin/components/ui/dropdown-menu'
|
|
7
10
|
import { Separator } from '@admin/components/ui/separator'
|
|
8
11
|
import { useContentEditorSourceMode } from '@admin/hooks/content-editor/use-content-editor-source-mode'
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
getContentEditorHighlightColorName
|
|
12
|
-
} from '@admin/utils/editor/content-editor'
|
|
13
|
-
import {
|
|
14
|
-
MARKDOWN_HEADING_OPTIONS,
|
|
15
|
-
MARKDOWN_LIST_OPTIONS,
|
|
16
|
-
type MarkdownHeadingLevel,
|
|
17
|
-
type MarkdownListType
|
|
18
|
-
} from '@admin/utils/editor/markdown'
|
|
12
|
+
import { getContentEditorHighlightColorName } from '@admin/utils/editor/content-editor'
|
|
13
|
+
import { MARKDOWN_HEADING_OPTIONS, MARKDOWN_LIST_OPTIONS } from '@admin/utils/editor/markdown'
|
|
19
14
|
import { cn } from '@admin/utils/shared/cn'
|
|
20
15
|
import CodeMirror from '@uiw/react-codemirror'
|
|
21
16
|
import {
|
|
@@ -40,7 +35,6 @@ import {
|
|
|
40
35
|
UnderlineIcon,
|
|
41
36
|
Undo2Icon
|
|
42
37
|
} from 'lucide-react'
|
|
43
|
-
import type * as React from 'react'
|
|
44
38
|
import { EditorToolbar } from './editor-toolbar'
|
|
45
39
|
import { MathPopoverButton } from './math-popover'
|
|
46
40
|
import { SourceModeDropdownButton } from './source-mode-dropdown-button'
|
|
@@ -124,13 +118,13 @@ export function SourceMode({
|
|
|
124
118
|
return (
|
|
125
119
|
<div
|
|
126
120
|
className={cn(
|
|
127
|
-
'content-editor-wrapper relative flex
|
|
121
|
+
'content-editor-wrapper relative flex max-h-[90vh] min-h-[240px] resize-y flex-col overflow-hidden rounded-md border bg-background',
|
|
128
122
|
{ 'opacity-50': disabled },
|
|
129
123
|
className
|
|
130
124
|
)}
|
|
131
125
|
>
|
|
132
126
|
<EditorToolbar ariaLabel="Markdown editor toolbar" className="shrink-0">
|
|
133
|
-
<div className="flex min-w-0
|
|
127
|
+
<div className="flex h-full min-w-0 flex-1 items-center overflow-x-auto">
|
|
134
128
|
<div className="flex items-center gap-0.5">
|
|
135
129
|
<Button
|
|
136
130
|
type="button"
|
|
@@ -159,7 +153,7 @@ export function SourceMode({
|
|
|
159
153
|
<Separator
|
|
160
154
|
orientation="vertical"
|
|
161
155
|
decorative
|
|
162
|
-
className="my-auto h-[65%]
|
|
156
|
+
className="mx-1 my-auto h-[65%] self-center"
|
|
163
157
|
/>
|
|
164
158
|
|
|
165
159
|
<div className="flex items-center gap-0.5">
|
|
@@ -241,7 +235,7 @@ export function SourceMode({
|
|
|
241
235
|
<Separator
|
|
242
236
|
orientation="vertical"
|
|
243
237
|
decorative
|
|
244
|
-
className="my-auto h-[65%]
|
|
238
|
+
className="mx-1 my-auto h-[65%] self-center"
|
|
245
239
|
/>
|
|
246
240
|
|
|
247
241
|
<div className="flex items-center gap-0.5">
|
|
@@ -307,7 +301,7 @@ export function SourceMode({
|
|
|
307
301
|
<Separator
|
|
308
302
|
orientation="vertical"
|
|
309
303
|
decorative
|
|
310
|
-
className="my-auto h-[65%]
|
|
304
|
+
className="mx-1 my-auto h-[65%] self-center"
|
|
311
305
|
/>
|
|
312
306
|
|
|
313
307
|
<div className="flex items-center">
|
|
@@ -348,9 +342,9 @@ export function SourceMode({
|
|
|
348
342
|
highlightActiveLineGutter: false
|
|
349
343
|
}}
|
|
350
344
|
className={cn(
|
|
351
|
-
'flex min-h-0 flex-1 flex-col overflow-hidden font-mono text-sm font-normal
|
|
345
|
+
'flex min-h-0 flex-1 flex-col overflow-hidden font-mono text-sm leading-6 font-normal [&_.cm-content]:!bg-transparent [&_.cm-editor]:!bg-input [&_.cm-gutters]:!bg-input [&_.cm-scroller]:!bg-input',
|
|
352
346
|
{
|
|
353
|
-
'
|
|
347
|
+
'cursor-not-allowed opacity-50': disabled
|
|
354
348
|
}
|
|
355
349
|
)}
|
|
356
350
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { Button } from '@admin/components/ui/button'
|
|
4
3
|
import type { ContentEditorTableAddControls } from '@admin/hooks/content-editor/use-content-editor-table-add-controls'
|
|
4
|
+
import { Button } from '@admin/components/ui/button'
|
|
5
5
|
import { PlusIcon } from 'lucide-react'
|
|
6
6
|
import { createPortal } from 'react-dom'
|
|
7
7
|
|
|
@@ -13,10 +13,10 @@ export function TableAddControls({ controls }: TableAddControlsProps) {
|
|
|
13
13
|
if (!controls) return null
|
|
14
14
|
|
|
15
15
|
return createPortal(
|
|
16
|
-
<div className="
|
|
16
|
+
<div className="not-prose contents" contentEditable={false}>
|
|
17
17
|
<Button
|
|
18
18
|
aria-label="Add table column"
|
|
19
|
-
className="group absolute top-0 right-0 bottom-6 z-[1] inline-flex h-auto w-4 shrink-0 cursor-pointer items-center justify-center rounded-none border border-border bg-muted/80 p-0 whitespace-nowrap outline-none
|
|
19
|
+
className="group absolute top-0 right-0 bottom-6 z-[1] inline-flex h-auto w-4 shrink-0 cursor-pointer items-center justify-center rounded-none border border-border bg-muted/80 p-0 whitespace-nowrap transition-colors outline-none select-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
20
20
|
onClick={controls.addColumn}
|
|
21
21
|
onPointerDown={(event) => event.preventDefault()}
|
|
22
22
|
title="Add table column"
|
|
@@ -29,7 +29,7 @@ export function TableAddControls({ controls }: TableAddControlsProps) {
|
|
|
29
29
|
</Button>
|
|
30
30
|
<Button
|
|
31
31
|
aria-label="Add table row"
|
|
32
|
-
className="group absolute right-6 bottom-0 left-0 z-[1] inline-flex h-4 w-auto shrink-0 cursor-pointer items-center justify-center rounded-none border border-border bg-muted/80 p-0 whitespace-nowrap outline-none
|
|
32
|
+
className="group absolute right-6 bottom-0 left-0 z-[1] inline-flex h-4 w-auto shrink-0 cursor-pointer items-center justify-center rounded-none border border-border bg-muted/80 p-0 whitespace-nowrap transition-colors outline-none select-none hover:bg-muted focus-visible:bg-muted focus-visible:ring-[3px] focus-visible:ring-ring/50"
|
|
33
33
|
onClick={controls.addRow}
|
|
34
34
|
onPointerDown={(event) => event.preventDefault()}
|
|
35
35
|
title="Add table row"
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { ContentEditorTableAlignment } from '@admin/utils/editor/tiptap'
|
|
5
|
+
import type { Editor } from '@tiptap/core'
|
|
3
6
|
import { Button } from '@admin/components/ui/button'
|
|
4
7
|
import { Separator } from '@admin/components/ui/separator'
|
|
5
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
@@ -14,12 +17,10 @@ import {
|
|
|
14
17
|
showTablePartPreview
|
|
15
18
|
} from '@admin/utils/editor/table-bubble'
|
|
16
19
|
import {
|
|
17
|
-
type ContentEditorTableAlignment,
|
|
18
20
|
getActiveTableColumnAlignment,
|
|
19
21
|
setActiveTableColumnAlignment
|
|
20
22
|
} from '@admin/utils/editor/tiptap'
|
|
21
23
|
import { cn } from '@admin/utils/shared/cn'
|
|
22
|
-
import type { Editor } from '@tiptap/core'
|
|
23
24
|
import { BubbleMenu } from '@tiptap/react/menus'
|
|
24
25
|
import {
|
|
25
26
|
AlignCenterIcon,
|
|
@@ -28,7 +29,6 @@ import {
|
|
|
28
29
|
Columns3Icon,
|
|
29
30
|
Rows3Icon
|
|
30
31
|
} from 'lucide-react'
|
|
31
|
-
import * as React from 'react'
|
|
32
32
|
import { RemoveTablePartIcon } from './remove-table-part-icon'
|
|
33
33
|
|
|
34
34
|
const ALIGNMENT_CONTROLS: Array<{
|
|
@@ -202,7 +202,7 @@ export function TableBubbleMenu({ editor }: { editor: Editor }) {
|
|
|
202
202
|
role="toolbar"
|
|
203
203
|
aria-label="Table formatting toolbar"
|
|
204
204
|
className={cn(
|
|
205
|
-
'flex items-center gap-1 overflow-x-auto
|
|
205
|
+
'flex items-center gap-1 overflow-x-auto rounded-sm border border-border bg-popover p-1 text-popover-foreground shadow-menu [scrollbar-width:none] [&::-webkit-scrollbar]:hidden',
|
|
206
206
|
'relative z-50'
|
|
207
207
|
)}
|
|
208
208
|
>
|
|
@@ -235,7 +235,7 @@ export function TableBubbleMenu({ editor }: { editor: Editor }) {
|
|
|
235
235
|
<Separator
|
|
236
236
|
orientation="vertical"
|
|
237
237
|
decorative
|
|
238
|
-
className="my-auto h-5 w-px
|
|
238
|
+
className="mx-1 my-auto h-5 w-px self-center bg-border opacity-100"
|
|
239
239
|
/>
|
|
240
240
|
<div className="flex items-center gap-0.5">
|
|
241
241
|
<Button
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { Editor } from '@tiptap/core'
|
|
3
4
|
import { Button } from '@admin/components/ui/button'
|
|
4
5
|
import { Input } from '@admin/components/ui/input'
|
|
5
6
|
import { Label } from '@admin/components/ui/label'
|
|
6
7
|
import { Popover, PopoverContent, PopoverTrigger } from '@admin/components/ui/popover'
|
|
7
8
|
import { useTableButton } from '@admin/hooks/content-editor/use-table-button'
|
|
8
|
-
import type { Editor } from '@tiptap/core'
|
|
9
9
|
import { TableIcon } from 'lucide-react'
|
|
10
10
|
|
|
11
11
|
interface TableButtonProps {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getSelectedNodesOfType, updateNodesAttr } from '@admin/utils/editor/tiptap'
|
|
2
1
|
import type { NodeWithPos } from '@tiptap/core'
|
|
3
|
-
import { Extension } from '@tiptap/core'
|
|
4
2
|
import type { EditorState, Transaction } from '@tiptap/pm/state'
|
|
3
|
+
import { getSelectedNodesOfType, updateNodesAttr } from '@admin/utils/editor/tiptap'
|
|
4
|
+
import { Extension } from '@tiptap/core'
|
|
5
5
|
|
|
6
6
|
declare module '@tiptap/core' {
|
|
7
7
|
interface Commands<ReturnType> {
|
|
@@ -14,21 +14,10 @@ declare module '@tiptap/core' {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export interface NodeBackgroundOptions {
|
|
17
|
-
/**
|
|
18
|
-
* Node types that should support background colors
|
|
19
|
-
* @default ["paragraph", "heading", "blockquote", "taskList", "bulletList", "orderedList", "tableCell", "tableHeader"]
|
|
20
|
-
*/
|
|
21
17
|
types: string[]
|
|
22
|
-
/**
|
|
23
|
-
* Use inline style instead of data attribute
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
18
|
useStyle?: boolean
|
|
27
19
|
}
|
|
28
20
|
|
|
29
|
-
/**
|
|
30
|
-
* Determines the target color for toggle operations
|
|
31
|
-
*/
|
|
32
21
|
function getToggleColor(targets: NodeWithPos[], inputColor: string): string | null {
|
|
33
22
|
if (targets.length === 0) return null
|
|
34
23
|
|
|
@@ -98,9 +87,6 @@ export const NodeBackground = Extension.create<NodeBackgroundOptions>({
|
|
|
98
87
|
},
|
|
99
88
|
|
|
100
89
|
addCommands() {
|
|
101
|
-
/**
|
|
102
|
-
* Generic command executor for background color operations
|
|
103
|
-
*/
|
|
104
90
|
const executeBackgroundCommand = (
|
|
105
91
|
getTargetColor: (targets: NodeWithPos[], inputColor?: string) => string | null
|
|
106
92
|
) => {
|
|
@@ -117,19 +103,10 @@ export const NodeBackground = Extension.create<NodeBackgroundOptions>({
|
|
|
117
103
|
}
|
|
118
104
|
|
|
119
105
|
return {
|
|
120
|
-
/**
|
|
121
|
-
* Set background color to specific value
|
|
122
|
-
*/
|
|
123
106
|
setNodeBackgroundColor: executeBackgroundCommand((_, inputColor) => inputColor || null),
|
|
124
107
|
|
|
125
|
-
/**
|
|
126
|
-
* Remove background color
|
|
127
|
-
*/
|
|
128
108
|
unsetNodeBackgroundColor: executeBackgroundCommand(() => null),
|
|
129
109
|
|
|
130
|
-
/**
|
|
131
|
-
* Toggle background color (set if different/missing, unset if all have it)
|
|
132
|
-
*/
|
|
133
110
|
toggleNodeBackgroundColor: executeBackgroundCommand((targets, inputColor) =>
|
|
134
111
|
getToggleColor(targets, inputColor || '')
|
|
135
112
|
)
|
|
@@ -3,21 +3,8 @@ import { mergeAttributes, Node, ReactNodeViewRenderer } from '@tiptap/react'
|
|
|
3
3
|
import { MediaGalleryPlaceholderNode as MediaGalleryPlaceholderNodeComponent } from './media-gallery-placeholder-node'
|
|
4
4
|
|
|
5
5
|
export interface MediaGalleryPlaceholderNodeOptions {
|
|
6
|
-
/**
|
|
7
|
-
* The type of the node.
|
|
8
|
-
* @default 'image'
|
|
9
|
-
*/
|
|
10
6
|
type?: string | NodeType | undefined
|
|
11
|
-
/**
|
|
12
|
-
* Acceptable media types for the gallery dialog.
|
|
13
|
-
* @default 'image/*'
|
|
14
|
-
*/
|
|
15
7
|
accept?: string
|
|
16
|
-
/**
|
|
17
|
-
* HTML attributes to add to the image element.
|
|
18
|
-
* @default {}
|
|
19
|
-
* @example { class: 'foo' }
|
|
20
|
-
*/
|
|
21
8
|
HTMLAttributes: Record<string, unknown>
|
|
22
9
|
}
|
|
23
10
|
|
|
@@ -29,10 +16,6 @@ declare module '@tiptap/react' {
|
|
|
29
16
|
}
|
|
30
17
|
}
|
|
31
18
|
|
|
32
|
-
/**
|
|
33
|
-
* A Tiptap node extension that creates a media gallery placeholder.
|
|
34
|
-
* @see registry/tiptap-node/media-gallery-placeholder-node/media-gallery-placeholder-node
|
|
35
|
-
*/
|
|
36
19
|
export const MediaGalleryPlaceholderNode = Node.create<MediaGalleryPlaceholderNodeOptions>({
|
|
37
20
|
name: 'mediaGalleryPlaceholder',
|
|
38
21
|
|
|
@@ -85,9 +68,6 @@ export const MediaGalleryPlaceholderNode = Node.create<MediaGalleryPlaceholderNo
|
|
|
85
68
|
}
|
|
86
69
|
},
|
|
87
70
|
|
|
88
|
-
/**
|
|
89
|
-
* Adds Enter key handler to reopen the media gallery when the placeholder is selected.
|
|
90
|
-
*/
|
|
91
71
|
addKeyboardShortcuts() {
|
|
92
72
|
return {
|
|
93
73
|
Enter: ({ editor }) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { NodeViewProps } from '@tiptap/react'
|
|
3
5
|
import { ContentEditorMediaGalleryBlock } from '@admin/components/custom/content-editor/media-gallery-block'
|
|
4
6
|
import { getMediaLabel } from '@admin/utils/editor/source-media'
|
|
5
7
|
import { focusNextNode, isValidPosition } from '@admin/utils/editor/tiptap'
|
|
6
|
-
import type { NodeViewProps } from '@tiptap/react'
|
|
7
8
|
import { NodeViewWrapper } from '@tiptap/react'
|
|
8
|
-
import * as React from 'react'
|
|
9
9
|
|
|
10
10
|
export const MediaGalleryPlaceholderNode: React.FC<NodeViewProps> = (props) => {
|
|
11
11
|
const { accept } = props.node.attrs
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import type { AdminMedia } from '@admin/types'
|
|
5
|
+
import type { NodeViewProps } from '@tiptap/react'
|
|
3
6
|
import { MediaGalleryDialog } from '@admin/components/shared/media/media-gallery-dialog'
|
|
4
7
|
import { Button } from '@admin/components/ui/button'
|
|
5
|
-
import type { AdminMedia } from '@admin/types'
|
|
6
8
|
import { getNumberAttr, getStringAttr } from '@admin/utils/editor/node-attrs'
|
|
7
9
|
import { getMediaLabel } from '@admin/utils/editor/source-media'
|
|
8
10
|
import { focusNextNode, isValidPosition } from '@admin/utils/editor/tiptap'
|
|
9
11
|
import { cn } from '@admin/utils/shared/cn'
|
|
10
|
-
import type { NodeViewProps } from '@tiptap/react'
|
|
11
12
|
import { NodeViewWrapper } from '@tiptap/react'
|
|
12
13
|
import NextImage from 'next/image'
|
|
13
|
-
import * as React from 'react'
|
|
14
14
|
|
|
15
15
|
export const RemovableImageNode: React.FC<NodeViewProps> = (props) => {
|
|
16
16
|
const { editor, node } = props
|
|
@@ -126,7 +126,7 @@ export const RemovableImageNode: React.FC<NodeViewProps> = (props) => {
|
|
|
126
126
|
<div
|
|
127
127
|
data-content-editor-image-controls-overlay=""
|
|
128
128
|
className={cn(
|
|
129
|
-
'pointer-events-none
|
|
129
|
+
'pointer-events-none absolute inset-0 flex items-center justify-center gap-1 rounded-md bg-black/10 backdrop-blur-xs transition-opacity duration-200 ease-out',
|
|
130
130
|
{
|
|
131
131
|
'opacity-100': isControlsVisible,
|
|
132
132
|
'opacity-0': !isControlsVisible
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
|
+
import type { UseBlockquoteConfig } from '@admin/hooks/content-editor/use-blockquote'
|
|
3
5
|
import { Badge } from '@admin/components/ui/badge'
|
|
4
6
|
import { Button } from '@admin/components/ui/button'
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
BLOCKQUOTE_SHORTCUT_KEY,
|
|
8
|
-
type UseBlockquoteConfig,
|
|
9
|
-
useBlockquote
|
|
10
|
-
} from '@admin/hooks/content-editor/use-blockquote'
|
|
7
|
+
import { BLOCKQUOTE_SHORTCUT_KEY, useBlockquote } from '@admin/hooks/content-editor/use-blockquote'
|
|
11
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
12
|
-
// --- Lib ---
|
|
13
9
|
import { parseShortcutKeys } from '@admin/utils/editor/tiptap'
|
|
14
10
|
import { useCallback } from 'react'
|
|
15
11
|
import {
|
|
16
|
-
type ControlAvailability,
|
|
17
|
-
type ControlShortcut,
|
|
18
|
-
type ControlTooltip,
|
|
19
12
|
getControlTooltipTitle,
|
|
20
13
|
shouldHideUnavailableControl,
|
|
21
14
|
shouldShowControlShortcut
|
|
@@ -26,12 +19,8 @@ type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
|
26
19
|
}
|
|
27
20
|
|
|
28
21
|
export interface BlockquoteButtonProps
|
|
29
|
-
extends Omit<EditorButtonProps, 'type'>,
|
|
30
|
-
Omit<UseBlockquoteConfig, 'hideWhenUnavailable'> {
|
|
22
|
+
extends Omit<EditorButtonProps, 'type'>, Omit<UseBlockquoteConfig, 'hideWhenUnavailable'> {
|
|
31
23
|
availability?: ControlAvailability
|
|
32
|
-
/**
|
|
33
|
-
* Optional text to display alongside the icon.
|
|
34
|
-
*/
|
|
35
24
|
text?: string
|
|
36
25
|
shortcut?: ControlShortcut
|
|
37
26
|
}
|
|
@@ -44,11 +33,6 @@ export function BlockquoteShortcutBadge({
|
|
|
44
33
|
return <Badge>{parseShortcutKeys({ shortcutKeys })}</Badge>
|
|
45
34
|
}
|
|
46
35
|
|
|
47
|
-
/**
|
|
48
|
-
* Button component for toggling blockquote in a Tiptap editor.
|
|
49
|
-
*
|
|
50
|
-
* For custom button implementations, use the `useBlockquote` hook instead.
|
|
51
|
-
*/
|
|
52
36
|
export function BlockquoteButton({
|
|
53
37
|
editor: providedEditor,
|
|
54
38
|
availability,
|
|
@@ -1,21 +1,14 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
|
+
import type { UseCodeBlockConfig } from '@admin/hooks/content-editor/use-code-block'
|
|
3
5
|
import { Badge } from '@admin/components/ui/badge'
|
|
4
6
|
import { Button } from '@admin/components/ui/button'
|
|
5
|
-
|
|
6
|
-
import {
|
|
7
|
-
CODE_BLOCK_SHORTCUT_KEY,
|
|
8
|
-
type UseCodeBlockConfig,
|
|
9
|
-
useCodeBlock
|
|
10
|
-
} from '@admin/hooks/content-editor/use-code-block'
|
|
7
|
+
import { CODE_BLOCK_SHORTCUT_KEY, useCodeBlock } from '@admin/hooks/content-editor/use-code-block'
|
|
11
8
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
12
|
-
// --- Lib ---
|
|
13
9
|
import { parseShortcutKeys } from '@admin/utils/editor/tiptap'
|
|
14
10
|
import { useCallback } from 'react'
|
|
15
11
|
import {
|
|
16
|
-
type ControlAvailability,
|
|
17
|
-
type ControlShortcut,
|
|
18
|
-
type ControlTooltip,
|
|
19
12
|
getControlTooltipTitle,
|
|
20
13
|
shouldHideUnavailableControl,
|
|
21
14
|
shouldShowControlShortcut
|
|
@@ -26,12 +19,8 @@ type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
|
26
19
|
}
|
|
27
20
|
|
|
28
21
|
export interface CodeBlockButtonProps
|
|
29
|
-
extends Omit<EditorButtonProps, 'type'>,
|
|
30
|
-
Omit<UseCodeBlockConfig, 'hideWhenUnavailable'> {
|
|
22
|
+
extends Omit<EditorButtonProps, 'type'>, Omit<UseCodeBlockConfig, 'hideWhenUnavailable'> {
|
|
31
23
|
availability?: ControlAvailability
|
|
32
|
-
/**
|
|
33
|
-
* Optional text to display alongside the icon.
|
|
34
|
-
*/
|
|
35
24
|
text?: string
|
|
36
25
|
shortcut?: ControlShortcut
|
|
37
26
|
}
|
|
@@ -44,11 +33,6 @@ export function CodeBlockShortcutBadge({
|
|
|
44
33
|
return <Badge>{parseShortcutKeys({ shortcutKeys })}</Badge>
|
|
45
34
|
}
|
|
46
35
|
|
|
47
|
-
/**
|
|
48
|
-
* Button component for toggling code block in a Tiptap editor.
|
|
49
|
-
*
|
|
50
|
-
* For custom button implementations, use the `useCodeBlock` hook instead.
|
|
51
|
-
*/
|
|
52
36
|
export function CodeBlockButton({
|
|
53
37
|
editor: providedEditor,
|
|
54
38
|
availability,
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { ControlAvailability, ControlShortcut, ControlTooltip } from '../control-options'
|
|
4
|
+
import type { UseColorHighlightConfig } from '@admin/hooks/content-editor/use-color-highlight'
|
|
3
5
|
import { Badge } from '@admin/components/ui/badge'
|
|
4
6
|
import { Button } from '@admin/components/ui/button'
|
|
5
|
-
// --- Hooks ---
|
|
6
7
|
import {
|
|
7
8
|
COLOR_HIGHLIGHT_SHORTCUT_KEY,
|
|
8
|
-
type UseColorHighlightConfig,
|
|
9
9
|
useColorHighlight
|
|
10
10
|
} from '@admin/hooks/content-editor/use-color-highlight'
|
|
11
11
|
import { useTiptapEditor } from '@admin/hooks/content-editor/use-tiptap-editor'
|
|
12
|
-
// --- Lib ---
|
|
13
12
|
import { parseShortcutKeys } from '@admin/utils/editor/tiptap'
|
|
14
13
|
import { cn } from '@admin/utils/shared/cn'
|
|
15
14
|
import { useCallback, useMemo } from 'react'
|
|
16
15
|
import {
|
|
17
|
-
type ControlAvailability,
|
|
18
|
-
type ControlShortcut,
|
|
19
|
-
type ControlTooltip,
|
|
20
16
|
getControlTooltipTitle,
|
|
21
17
|
shouldHideUnavailableControl,
|
|
22
18
|
shouldShowControlShortcut
|
|
@@ -27,12 +23,8 @@ type EditorButtonProps = React.ComponentProps<typeof Button> & {
|
|
|
27
23
|
}
|
|
28
24
|
|
|
29
25
|
export interface ColorHighlightButtonProps
|
|
30
|
-
extends Omit<EditorButtonProps, 'type'>,
|
|
31
|
-
Omit<UseColorHighlightConfig, 'hideWhenUnavailable'> {
|
|
26
|
+
extends Omit<EditorButtonProps, 'type'>, Omit<UseColorHighlightConfig, 'hideWhenUnavailable'> {
|
|
32
27
|
availability?: ControlAvailability
|
|
33
|
-
/**
|
|
34
|
-
* Optional text to display alongside the icon.
|
|
35
|
-
*/
|
|
36
28
|
text?: string
|
|
37
29
|
shortcut?: ControlShortcut
|
|
38
30
|
}
|
|
@@ -52,7 +44,7 @@ export function HighlightSwatch({ highlightColor }: { highlightColor: string })
|
|
|
52
44
|
'relative -mx-[0.175rem] size-5 rounded-sm transition-transform duration-200 ease-in-out',
|
|
53
45
|
'bg-[var(--highlight-color)]',
|
|
54
46
|
'shadow-[inset_0_0_0_1px_var(--highlight-shadow),_0_1px_2px_var(--highlight-shadow-soft)]',
|
|
55
|
-
"after:
|
|
47
|
+
"after:absolute after:inset-0 after:box-border after:size-full after:rounded-sm after:border after:opacity-0 after:transition-opacity after:duration-200 after:ease-in-out after:content-['']",
|
|
56
48
|
'after:border-[var(--highlight-after-border)]',
|
|
57
49
|
'group-data-[active-state=on]/highlight:scale-110',
|
|
58
50
|
'group-data-[highlighted=true]/highlight:scale-110',
|
|
@@ -73,34 +65,6 @@ export function HighlightSwatch({ highlightColor }: { highlightColor: string })
|
|
|
73
65
|
)
|
|
74
66
|
}
|
|
75
67
|
|
|
76
|
-
/**
|
|
77
|
-
* Button component for applying color highlights in a Tiptap editor.
|
|
78
|
-
*
|
|
79
|
-
* Supports two highlighting modes:
|
|
80
|
-
* - "mark": Uses the highlight mark extension (default)
|
|
81
|
-
* - "node": Uses the node background extension
|
|
82
|
-
*
|
|
83
|
-
* For custom button implementations, use the `useColorHighlight` hook instead.
|
|
84
|
-
*
|
|
85
|
-
* @example
|
|
86
|
-
* ```tsx
|
|
87
|
-
* // Mark-based highlighting (default)
|
|
88
|
-
* <ColorHighlightButton highlightColor="yellow" />
|
|
89
|
-
*
|
|
90
|
-
* // Node-based background coloring
|
|
91
|
-
* <ColorHighlightButton
|
|
92
|
-
* highlightColor="var(--tt-color-highlight-blue)"
|
|
93
|
-
* mode="node"
|
|
94
|
-
* />
|
|
95
|
-
*
|
|
96
|
-
* // With custom callback
|
|
97
|
-
* <ColorHighlightButton
|
|
98
|
-
* highlightColor="red"
|
|
99
|
-
* mode="mark"
|
|
100
|
-
* onApplied={({ color, mode }) => console.log(`Applied ${color} in ${mode} mode`)}
|
|
101
|
-
* />
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
68
|
export function ColorHighlightButton({
|
|
105
69
|
editor: providedEditor,
|
|
106
70
|
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 { HighlighterIcon } from 'lucide-react'
|
|
9
|
-
import type * as React from 'react'
|
|
10
8
|
|
|
11
9
|
export type ColorHighlightPopoverButtonProps = React.ComponentProps<typeof Button> & {
|
|
12
10
|
tooltip?: ControlTooltip
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { HighlightColor } from './highlight-colors'
|
|
4
|
+
import type { Editor } from '@tiptap/react'
|
|
3
5
|
import { Button } from '@admin/components/ui/button'
|
|
4
6
|
import { useColorHighlight } from '@admin/hooks/content-editor/use-color-highlight'
|
|
5
7
|
import { useMenuNavigation } from '@admin/hooks/content-editor/use-menu-navigation'
|
|
6
|
-
import type { Editor } from '@tiptap/react'
|
|
7
8
|
import { BanIcon } from 'lucide-react'
|
|
8
9
|
import { useMemo, useRef } from 'react'
|
|
9
10
|
import { HighlightColorButton } from './highlight-color-button'
|
|
10
|
-
import { DEFAULT_HIGHLIGHT_COLORS
|
|
11
|
+
import { DEFAULT_HIGHLIGHT_COLORS } from './highlight-colors'
|
|
11
12
|
|
|
12
13
|
interface ColorHighlightPopoverContentBaseProps {
|
|
13
|
-
/**
|
|
14
|
-
* The Tiptap editor instance.
|
|
15
|
-
*/
|
|
16
14
|
editor?: Editor | null
|
|
17
|
-
/**
|
|
18
|
-
* Optional colors to use in the highlight popover.
|
|
19
|
-
* If not provided, defaults to a predefined set of colors.
|
|
20
|
-
*/
|
|
21
15
|
colors?: HighlightColor[]
|
|
22
16
|
useColorValue?: boolean
|
|
23
17
|
disabled?: boolean
|
|
@@ -29,8 +23,10 @@ interface EditorColorHighlightPopoverContentProps extends ColorHighlightPopoverC
|
|
|
29
23
|
onRemoveHighlight?: never
|
|
30
24
|
}
|
|
31
25
|
|
|
32
|
-
interface SourceColorHighlightPopoverContentProps
|
|
33
|
-
|
|
26
|
+
interface SourceColorHighlightPopoverContentProps extends Omit<
|
|
27
|
+
ColorHighlightPopoverContentBaseProps,
|
|
28
|
+
'editor'
|
|
29
|
+
> {
|
|
34
30
|
editor?: never
|
|
35
31
|
mode: 'source'
|
|
36
32
|
onHighlightColorSelect: (color: HighlightColor) => void
|