ultisuite-client/lib/ai/tiptap-syntax-guide.ts
R3D347HR4Y 303b2b1074
Some checks are pending
E2E / Playwright e2e (push) Waiting to run
wow
2026-06-11 01:22:40 +02:00

21 lines
1.1 KiB
TypeScript

/** Référence concise pour l'IA — structure TipTap / ProseMirror UltiDocs. */
export const TIPTAP_SYNTAX_GUIDE = `
UltiDocs utilise TipTap (ProseMirror). Le document est un JSON \`{ type: "doc", content: [...] }\`.
Blocs courants:
- paragraph: { type: "paragraph", content?: inline[] }
- heading: { type: "heading", attrs: { level: 1-6 }, content?: inline[] }
- bulletList / orderedList: { type: "bulletList", content: [listItem...] }
- listItem: { type: "listItem", content: [paragraph|...] }
- blockquote, codeBlock, horizontalRule, table (tableRow > tableCell)
Inline:
- text: { type: "text", text: "...", marks?: [{ type: "bold"|"italic"|"underline"|"link", attrs? }] }
Règles d'édition:
- Préserver la structure doc valide (toujours des blocs dans doc.content).
- Pour modifier: préférer remplacer la sélection ou insérer du texte/markdown converti en paragraphes.
- Ne pas inventer de nœuds custom (docsGraphic, table) sans connaître le schéma — utiliser les tools docs_save avec JSON validé.
- Titres: un seul h1 recommandé en tête de document.
`.trim()