doxa-maps-cdn/app/utils/tiptapExtensions.ts
corsacca 01cd6ba4f4 support vimeo video embeds alongside youtube in cms editor
add framework-agnostic vimeo tiptap node (id-only src, renders player iframe)
register vimeo in shared extension set for editor and server renderer
replace youtube prompt with generic insert-video modal (detects platform)
allowlist vimeo in validator with digits-only src check
track vimeo as a lossy node for markdown round-trip detection
2026-05-21 14:31:27 +01:00

42 lines
1.5 KiB
TypeScript

// Shared Tiptap extension set — used by both the editor
// (app/components/admin/RichTextEditor.vue) and the server-side HTML
// renderer (server/utils/renderTiptap.ts) so authored content round-trips
// cleanly to the public page. Keep all extensions framework-agnostic here
// (@tiptap/core + @tiptap/extension-*): no @tiptap/vue-3 imports, or the
// server renderer will drag the Vue runtime into the Nitro bundle.
import StarterKit from '@tiptap/starter-kit'
import TextAlign from '@tiptap/extension-text-align'
import { CmsImage } from './tiptapImage'
import { TextStyle } from '@tiptap/extension-text-style'
import Color from '@tiptap/extension-color'
import Highlight from '@tiptap/extension-highlight'
import Typography from '@tiptap/extension-typography'
import Subscript from '@tiptap/extension-subscript'
import Superscript from '@tiptap/extension-superscript'
import Youtube from '@tiptap/extension-youtube'
import { Vimeo } from './tiptapVimeo'
import { Div } from './tiptapDiv'
import { UupgsListNode } from './tiptapUupgsList'
import { GeneralResourcesNode } from './tiptapGeneralResources'
import { Verse } from './tiptapVerse'
export function buildTiptapExtensions() {
return [
StarterKit.configure({ link: { openOnClick: false, autolink: true } }),
CmsImage,
TextAlign.configure({ types: ['heading', 'paragraph'] }),
TextStyle,
Color,
Highlight,
Typography,
Subscript,
Superscript,
Youtube,
Vimeo,
Div,
UupgsListNode,
GeneralResourcesNode,
Verse
]
}