@flogeez/angular-tiptap-editor 0.5.0 → 0.5.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flogeez-angular-tiptap-editor.mjs","sources":["../../../projects/angular-tiptap-editor/src/lib/extensions/resizable-image.extension.ts","../../../projects/angular-tiptap-editor/src/lib/extensions/upload-progress.extension.ts","../../../projects/angular-tiptap-editor/src/lib/extensions/table.extension.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-button.component.ts","../../../projects/angular-tiptap-editor/src/lib/services/color-picker.service.ts","../../../projects/angular-tiptap-editor/src/lib/services/i18n.service.ts","../../../projects/angular-tiptap-editor/src/lib/components/tiptap-text-color-picker.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-separator.component.ts","../../../projects/angular-tiptap-editor/src/lib/services/image.service.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-image-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/services/editor-commands.service.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-table-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-cell-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-toolbar.component.ts","../../../projects/angular-tiptap-editor/src/lib/config/slash-commands.config.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-slash-commands.component.ts","../../../projects/angular-tiptap-editor/src/lib/index.ts","../../../projects/angular-tiptap-editor/src/lib/noop-value-accessor.directive.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-editor.component.ts","../../../projects/angular-tiptap-editor/src/public-api.ts","../../../projects/angular-tiptap-editor/src/flogeez-angular-tiptap-editor.ts"],"sourcesContent":["import { Node, mergeAttributes, nodeInputRule } from \"@tiptap/core\";\r\n\r\nexport interface ResizableImageOptions {\r\n inline: boolean;\r\n allowBase64: boolean;\r\n HTMLAttributes: Record<string, any>;\r\n}\r\n\r\ndeclare module \"@tiptap/core\" {\r\n interface Commands<ReturnType> {\r\n resizableImage: {\r\n setResizableImage: (options: {\r\n src: string;\r\n alt?: string;\r\n title?: string;\r\n width?: number;\r\n height?: number;\r\n }) => ReturnType;\r\n updateResizableImage: (options: {\r\n src?: string;\r\n alt?: string;\r\n title?: string;\r\n width?: number;\r\n height?: number;\r\n }) => ReturnType;\r\n };\r\n }\r\n}\r\n\r\nexport const ResizableImage = Node.create<ResizableImageOptions>({\r\n name: \"resizableImage\",\r\n\r\n addOptions() {\r\n return {\r\n inline: false,\r\n allowBase64: false,\r\n HTMLAttributes: {},\r\n };\r\n },\r\n\r\n inline() {\r\n return this.options.inline;\r\n },\r\n\r\n group() {\r\n return this.options.inline ? \"inline\" : \"block\";\r\n },\r\n\r\n draggable: true,\r\n\r\n addAttributes() {\r\n return {\r\n src: {\r\n default: null,\r\n },\r\n alt: {\r\n default: null,\r\n },\r\n title: {\r\n default: null,\r\n },\r\n width: {\r\n default: null,\r\n parseHTML: (element) => {\r\n const width = element.getAttribute(\"width\");\r\n return width ? parseInt(width, 10) : null;\r\n },\r\n renderHTML: (attributes) => {\r\n if (!attributes[\"width\"]) {\r\n return {};\r\n }\r\n return {\r\n width: attributes[\"width\"],\r\n };\r\n },\r\n },\r\n height: {\r\n default: null,\r\n parseHTML: (element) => {\r\n const height = element.getAttribute(\"height\");\r\n return height ? parseInt(height, 10) : null;\r\n },\r\n renderHTML: (attributes) => {\r\n if (!attributes[\"height\"]) {\r\n return {};\r\n }\r\n return {\r\n height: attributes[\"height\"],\r\n };\r\n },\r\n },\r\n };\r\n },\r\n\r\n parseHTML() {\r\n return [\r\n {\r\n tag: \"img[src]\",\r\n },\r\n ];\r\n },\r\n\r\n renderHTML({ HTMLAttributes }) {\r\n return [\r\n \"img\",\r\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\r\n ];\r\n },\r\n\r\n addCommands() {\r\n return {\r\n setResizableImage:\r\n (options) =>\r\n ({ commands }) => {\r\n return commands.insertContent({\r\n type: this.name,\r\n attrs: options,\r\n });\r\n },\r\n updateResizableImage:\r\n (options) =>\r\n ({ commands }) => {\r\n return commands.updateAttributes(this.name, options);\r\n },\r\n };\r\n },\r\n\r\n addInputRules() {\r\n return [\r\n nodeInputRule({\r\n find: /!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\)/,\r\n type: this.type,\r\n getAttributes: (match) => {\r\n const [, alt, src, title] = match;\r\n return { src, alt, title };\r\n },\r\n }),\r\n ];\r\n },\r\n\r\n addNodeView() {\r\n return ({ node, getPos, editor }) => {\r\n const container = document.createElement(\"div\");\r\n container.className = \"resizable-image-container\";\r\n container.style.position = \"relative\";\r\n container.style.display = \"inline-block\";\r\n\r\n const img = document.createElement(\"img\");\r\n img.src = node.attrs[\"src\"];\r\n img.alt = node.attrs[\"alt\"] || \"\";\r\n img.title = node.attrs[\"title\"] || \"\";\r\n img.className = \"tiptap-image\";\r\n\r\n if (node.attrs[\"width\"]) img.width = node.attrs[\"width\"];\r\n if (node.attrs[\"height\"]) img.height = node.attrs[\"height\"];\r\n\r\n img.parentNode?.insertBefore(container, img);\r\n container.appendChild(img);\r\n\r\n // Ajouter les contrôles de redimensionnement modernes\r\n const resizeControls = document.createElement(\"div\");\r\n resizeControls.className = \"resize-controls\";\r\n resizeControls.style.display = \"none\";\r\n\r\n // Créer les 8 poignées pour un redimensionnement complet\r\n const handles = [\"nw\", \"n\", \"ne\", \"w\", \"e\", \"sw\", \"s\", \"se\"];\r\n handles.forEach((direction) => {\r\n const handle = document.createElement(\"div\");\r\n handle.className = `resize-handle resize-handle-${direction}`;\r\n handle.setAttribute(\"data-direction\", direction);\r\n resizeControls.appendChild(handle);\r\n });\r\n\r\n // Attacher les contrôles au conteneur\r\n container.appendChild(resizeControls);\r\n\r\n // Variables pour le redimensionnement\r\n let isResizing = false;\r\n let startX = 0;\r\n let startY = 0;\r\n let startWidth = 0;\r\n let startHeight = 0;\r\n let aspectRatio = 1;\r\n\r\n // Calculer le ratio d'aspect\r\n img.onload = () => {\r\n aspectRatio = img.naturalWidth / img.naturalHeight;\r\n };\r\n\r\n // Gestion du redimensionnement\r\n const handleMouseDown = (e: MouseEvent, direction: string) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n isResizing = true;\r\n startX = e.clientX;\r\n startY = e.clientY;\r\n\r\n // Utiliser les dimensions actuelles de l'image au lieu des dimensions initiales\r\n startWidth =\r\n parseInt(img.getAttribute(\"width\") || \"0\") ||\r\n node.attrs[\"width\"] ||\r\n img.naturalWidth;\r\n startHeight =\r\n parseInt(img.getAttribute(\"height\") || \"0\") ||\r\n node.attrs[\"height\"] ||\r\n img.naturalHeight;\r\n\r\n // Ajouter la classe de redimensionnement au body\r\n document.body.classList.add(\"resizing\");\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n if (!isResizing) return;\r\n\r\n const deltaX = e.clientX - startX;\r\n const deltaY = e.clientY - startY;\r\n\r\n let newWidth = startWidth;\r\n let newHeight = startHeight;\r\n\r\n // Redimensionnement selon la direction\r\n switch (direction) {\r\n case \"e\":\r\n newWidth = startWidth + deltaX;\r\n newHeight = newWidth / aspectRatio;\r\n break;\r\n case \"w\":\r\n newWidth = startWidth - deltaX;\r\n newHeight = newWidth / aspectRatio;\r\n break;\r\n case \"s\":\r\n newHeight = startHeight + deltaY;\r\n newWidth = newHeight * aspectRatio;\r\n break;\r\n case \"n\":\r\n newHeight = startHeight - deltaY;\r\n newWidth = newHeight * aspectRatio;\r\n break;\r\n case \"se\":\r\n newWidth = startWidth + deltaX;\r\n newHeight = startHeight + deltaY;\r\n break;\r\n case \"sw\":\r\n newWidth = startWidth - deltaX;\r\n newHeight = startHeight + deltaY;\r\n break;\r\n case \"ne\":\r\n newWidth = startWidth + deltaX;\r\n newHeight = startHeight - deltaY;\r\n break;\r\n case \"nw\":\r\n newWidth = startWidth - deltaX;\r\n newHeight = startHeight - deltaY;\r\n break;\r\n }\r\n\r\n // Limites\r\n newWidth = Math.max(50, Math.min(2000, newWidth));\r\n newHeight = Math.max(50, Math.min(2000, newHeight));\r\n\r\n // Mettre à jour directement les attributs de l'image\r\n img.setAttribute(\"width\", Math.round(newWidth).toString());\r\n img.setAttribute(\"height\", Math.round(newHeight).toString());\r\n };\r\n\r\n const handleMouseUp = () => {\r\n isResizing = false;\r\n document.body.classList.remove(\"resizing\");\r\n\r\n // Mettre à jour le nœud Tiptap avec les nouvelles dimensions\r\n if (typeof getPos === \"function\") {\r\n const finalWidth = parseInt(img.getAttribute(\"width\") || \"0\");\r\n const finalHeight = parseInt(img.getAttribute(\"height\") || \"0\");\r\n\r\n if (finalWidth && finalHeight) {\r\n editor.commands.updateAttributes(\"resizableImage\", {\r\n width: finalWidth,\r\n height: finalHeight,\r\n });\r\n }\r\n }\r\n\r\n document.removeEventListener(\"mousemove\", handleMouseMove);\r\n document.removeEventListener(\"mouseup\", handleMouseUp);\r\n };\r\n\r\n document.addEventListener(\"mousemove\", handleMouseMove);\r\n document.addEventListener(\"mouseup\", handleMouseUp);\r\n };\r\n\r\n // Ajouter les événements aux poignées\r\n resizeControls.addEventListener(\"mousedown\", (e) => {\r\n const target = e.target as HTMLElement;\r\n if (target.classList.contains(\"resize-handle\")) {\r\n const direction = target.getAttribute(\"data-direction\");\r\n if (direction) {\r\n handleMouseDown(e, direction);\r\n }\r\n }\r\n });\r\n\r\n // Gestion des événements\r\n img.addEventListener(\"click\", () => {\r\n // Masquer tous les autres contrôles\r\n document.querySelectorAll(\".resize-controls\").forEach((control) => {\r\n (control as HTMLElement).style.display = \"none\";\r\n });\r\n\r\n // Afficher les contrôles de cette image\r\n resizeControls.style.display = \"block\";\r\n img.classList.add(\"selected\");\r\n });\r\n\r\n // Masquer les contrôles quand on clique ailleurs\r\n document.addEventListener(\"click\", (e) => {\r\n const target = e.target as Element;\r\n if (\r\n target &&\r\n !img.contains(target) &&\r\n !resizeControls.contains(target)\r\n ) {\r\n resizeControls.style.display = \"none\";\r\n img.classList.remove(\"selected\");\r\n }\r\n });\r\n\r\n return {\r\n dom: container,\r\n update: (updatedNode) => {\r\n if (updatedNode.type.name !== \"resizableImage\") return false;\r\n\r\n img.src = updatedNode.attrs[\"src\"];\r\n img.alt = updatedNode.attrs[\"alt\"] || \"\";\r\n img.title = updatedNode.attrs[\"title\"] || \"\";\r\n\r\n if (updatedNode.attrs[\"width\"])\r\n img.width = updatedNode.attrs[\"width\"];\r\n if (updatedNode.attrs[\"height\"])\r\n img.height = updatedNode.attrs[\"height\"];\r\n\r\n return true;\r\n },\r\n };\r\n };\r\n },\r\n});\r\n","import { Extension } from \"@tiptap/core\";\r\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\r\nimport { Decoration, DecorationSet } from \"@tiptap/pm/view\";\r\n\r\nexport interface UploadProgressOptions {\r\n isUploading: () => boolean;\r\n uploadProgress: () => number;\r\n uploadMessage: () => string;\r\n}\r\n\r\nexport const UploadProgress = Extension.create<UploadProgressOptions>({\r\n name: \"uploadProgress\",\r\n\r\n addOptions() {\r\n return {\r\n isUploading: () => false,\r\n uploadProgress: () => 0,\r\n uploadMessage: () => \"\",\r\n };\r\n },\r\n\r\n addProseMirrorPlugins() {\r\n const options = this.options;\r\n\r\n return [\r\n new Plugin({\r\n key: new PluginKey(\"uploadProgress\"),\r\n state: {\r\n init() {\r\n return {\r\n decorations: DecorationSet.empty,\r\n isUploading: false,\r\n uploadPosition: null as number | null,\r\n };\r\n },\r\n apply: (tr, state) => {\r\n const isUploading = options.isUploading();\r\n\r\n // Si l'upload commence, sauvegarder la position\r\n if (isUploading && !state.isUploading) {\r\n const uploadPosition = tr.selection.from;\r\n const uploadProgress = options.uploadProgress();\r\n const uploadMessage = options.uploadMessage();\r\n\r\n // Créer un élément de progression\r\n const uploadElement = document.createElement(\"div\");\r\n uploadElement.className = \"upload-progress-widget\";\r\n uploadElement.innerHTML = `\r\n <div class=\"upload-skeleton\">\r\n <div class=\"upload-content\">\r\n <div class=\"upload-icon\">\r\n <span class=\"material-symbols-outlined spinning\">image</span>\r\n </div>\r\n <div class=\"upload-info\">\r\n <div class=\"upload-message\">${uploadMessage}</div>\r\n <div class=\"progress-bar\">\r\n <div class=\"progress-fill\" style=\"width: ${uploadProgress}%\"></div>\r\n </div>\r\n <div class=\"progress-text\">${uploadProgress}%</div>\r\n </div>\r\n </div>\r\n </div>\r\n `;\r\n\r\n // Ajouter les styles si pas déjà fait\r\n if (!document.querySelector(\"#upload-progress-styles\")) {\r\n const style = document.createElement(\"style\");\r\n style.id = \"upload-progress-styles\";\r\n style.textContent = `\r\n .upload-progress-widget {\r\n display: block;\r\n margin: 8px 0;\r\n max-width: 400px;\r\n }\r\n .upload-skeleton {\r\n background: var(--ate-surface-secondary);\r\n border: 2px dashed var(--ate-border-color);\r\n border-radius: var(--ate-border-radius);\r\n padding: 16px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n min-height: 120px;\r\n animation: pulse 2s infinite;\r\n }\r\n @keyframes pulse {\r\n 0%, 100% { background-color: var(--ate-surface-secondary); }\r\n 50% { background-color: var(--ate-surface-tertiary); }\r\n }\r\n .upload-content {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n gap: 12px;\r\n text-align: center;\r\n }\r\n .upload-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 48px;\r\n height: 48px;\r\n background: var(--ate-primary-light);\r\n border-radius: 50%;\r\n color: var(--ate-primary);\r\n }\r\n .upload-icon .material-symbols-outlined {\r\n font-size: 24px;\r\n }\r\n .spinning {\r\n animation: spin 1s linear infinite;\r\n }\r\n @keyframes spin {\r\n from { transform: rotate(0deg); }\r\n to { transform: rotate(360deg); }\r\n }\r\n .upload-info {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n width: 100%;\r\n max-width: 200px;\r\n }\r\n .upload-message {\r\n font-size: 14px;\r\n color: var(--ate-text);\r\n font-weight: 500;\r\n }\r\n .progress-bar {\r\n width: 100%;\r\n height: 6px;\r\n background: var(--ate-border-color);\r\n border-radius: 3px;\r\n overflow: hidden;\r\n }\r\n .progress-fill {\r\n height: 100%;\r\n background: var(--ate-primary);\r\n border-radius: 3px;\r\n transition: width 0.3s ease;\r\n }\r\n .progress-text {\r\n font-size: 12px;\r\n color: var(--ate-text-secondary);\r\n font-weight: 500;\r\n }\r\n `;\r\n document.head.appendChild(style);\r\n }\r\n\r\n // Créer une décoration widget à la position sauvegardée\r\n const decoration = Decoration.widget(\r\n uploadPosition,\r\n uploadElement,\r\n {\r\n side: 1,\r\n key: \"upload-progress\",\r\n }\r\n );\r\n\r\n return {\r\n decorations: DecorationSet.create(tr.doc, [decoration]),\r\n isUploading: true,\r\n uploadPosition,\r\n };\r\n }\r\n\r\n // Si l'upload continue, mettre à jour le contenu\r\n if (\r\n isUploading &&\r\n state.isUploading &&\r\n state.uploadPosition !== null\r\n ) {\r\n const uploadProgress = options.uploadProgress();\r\n const uploadMessage = options.uploadMessage();\r\n\r\n // Mettre à jour le contenu de l'élément existant\r\n const existingElement = document.querySelector(\r\n \".upload-progress-widget\"\r\n );\r\n if (existingElement) {\r\n existingElement.innerHTML = `\r\n <div class=\"upload-skeleton\">\r\n <div class=\"upload-content\">\r\n <div class=\"upload-icon\">\r\n <span class=\"material-symbols-outlined spinning\">image</span>\r\n </div>\r\n <div class=\"upload-info\">\r\n <div class=\"upload-message\">${uploadMessage}</div>\r\n <div class=\"progress-bar\">\r\n <div class=\"progress-fill\" style=\"width: ${uploadProgress}%\"></div>\r\n </div>\r\n <div class=\"progress-text\">${uploadProgress}%</div>\r\n </div>\r\n </div>\r\n </div>\r\n `;\r\n }\r\n\r\n return state; // Garder les décorations existantes\r\n }\r\n\r\n // Si l'upload se termine, supprimer les décorations\r\n if (!isUploading && state.isUploading) {\r\n return {\r\n decorations: DecorationSet.empty,\r\n isUploading: false,\r\n uploadPosition: null,\r\n };\r\n }\r\n\r\n return state;\r\n },\r\n },\r\n props: {\r\n decorations(state) {\r\n const pluginState = this.getState(state);\r\n return pluginState ? pluginState.decorations : DecorationSet.empty;\r\n },\r\n },\r\n }),\r\n ];\r\n },\r\n});\r\n","import { Extension } from \"@tiptap/core\";\r\nimport Table from \"@tiptap/extension-table\";\r\nimport TableRow from \"@tiptap/extension-table-row\";\r\nimport TableCell from \"@tiptap/extension-table-cell\";\r\nimport TableHeader from \"@tiptap/extension-table-header\";\r\n\r\nexport const TableExtension = Extension.create({\r\n name: \"tableExtension\",\r\n\r\n addExtensions() {\r\n return [\r\n Table.configure({\r\n resizable: true,\r\n handleWidth: 5,\r\n cellMinWidth: 100,\r\n }),\r\n TableRow,\r\n TableHeader.configure({\r\n HTMLAttributes: {\r\n class: \"table-header\",\r\n },\r\n }),\r\n TableCell.configure({\r\n HTMLAttributes: {\r\n class: \"table-cell\",\r\n },\r\n }),\r\n ];\r\n },\r\n});\r\n","import { Component, input, output } from \"@angular/core\";\r\n\r\nexport interface TiptapButtonConfig {\r\n icon: string;\r\n title: string;\r\n active?: boolean;\r\n disabled?: boolean;\r\n variant?: \"default\" | \"text\" | \"danger\";\r\n size?: \"small\" | \"medium\" | \"large\";\r\n iconSize?: \"small\" | \"medium\" | \"large\";\r\n}\r\n\r\n@Component({\r\n selector: \"tiptap-button\",\r\n standalone: true,\r\n template: `\r\n <button\r\n class=\"tiptap-button\"\r\n [class.is-active]=\"active()\"\r\n [class.is-disabled]=\"disabled()\"\r\n [class.text-button]=\"variant() === 'text'\"\r\n [class.danger]=\"variant() === 'danger'\"\r\n [class.small]=\"size() === 'small'\"\r\n [class.medium]=\"size() === 'medium'\"\r\n [class.large]=\"size() === 'large'\"\r\n [class.has-custom-color]=\"!!color()\"\r\n [disabled]=\"disabled()\"\r\n [style.color]=\"color()\"\r\n [attr.title]=\"title()\"\r\n (mousedown)=\"onMouseDown($event)\"\r\n (click)=\"onClick.emit($event)\"\r\n type=\"button\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined\"\r\n [class.icon-small]=\"iconSize() === 'small'\"\r\n [class.icon-medium]=\"iconSize() === 'medium'\"\r\n [class.icon-large]=\"iconSize() === 'large'\"\r\n >{{ icon() }}</span\r\n >\r\n <ng-content></ng-content>\r\n </button>\r\n `,\r\n styles: [\r\n `\r\n /* Styles de base pour les boutons Tiptap */\r\n .tiptap-button {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n border: none;\r\n background: transparent;\r\n border-radius: var(--ate-border-radius, 8px);\r\n cursor: pointer;\r\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\r\n color: var(--ate-toolbar-button-color, var(--ate-text-secondary));\r\n position: relative;\r\n overflow: hidden;\r\n }\r\n\r\n .tiptap-button::before {\r\n content: \"\";\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background: var(--ate-primary);\r\n opacity: 0;\r\n transition: opacity 0.2s ease;\r\n border-radius: var(--ate-border-radius, 8px);\r\n }\r\n\r\n .tiptap-button:hover:not(.has-custom-color) {\r\n color: var(--ate-toolbar-button-active-color, var(--ate-primary));\r\n background: var(--ate-toolbar-button-hover-background, transparent);\r\n transform: translateY(-1px);\r\n }\r\n \r\n /* If has custom color, we still want the hover background but not the color change */\r\n .tiptap-button.has-custom-color:hover {\r\n background: var(--ate-toolbar-button-hover-background, transparent);\r\n transform: translateY(-1px);\r\n }\r\n\r\n .tiptap-button:hover::before {\r\n opacity: 0.1;\r\n }\r\n\r\n .tiptap-button:active {\r\n transform: translateY(0);\r\n }\r\n\r\n .tiptap-button.is-active:not(.has-custom-color) {\r\n color: var(--ate-toolbar-button-active-color, var(--ate-primary));\r\n background: var(--ate-toolbar-button-active-background, var(--ate-primary-light));\r\n }\r\n\r\n /* If has custom color and active, prioritize the custom color */\r\n .tiptap-button.is-active.has-custom-color {\r\n background: var(--ate-toolbar-button-active-background, var(--ate-primary-light));\r\n }\r\n\r\n .tiptap-button:disabled {\r\n opacity: 0.4;\r\n cursor: not-allowed;\r\n pointer-events: none;\r\n }\r\n\r\n /* Icônes Material Symbols */\r\n .tiptap-button .material-symbols-outlined {\r\n font-size: 20px;\r\n position: relative;\r\n z-index: 1;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined.icon-small {\r\n font-size: 16px;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined.icon-medium {\r\n font-size: 20px;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined.icon-large {\r\n font-size: 24px;\r\n }\r\n\r\n /* Boutons avec texte */\r\n .tiptap-button.text-button {\r\n width: auto;\r\n padding: 0 12px;\r\n font-size: 14px;\r\n font-weight: 500;\r\n gap: 8px;\r\n }\r\n\r\n /* Boutons de couleur */\r\n .tiptap-button.color-button {\r\n width: 28px;\r\n height: 28px;\r\n border-radius: 50%;\r\n border: 2px solid transparent;\r\n transition: all 0.2s ease;\r\n }\r\n\r\n .tiptap-button.color-button:hover {\r\n border-color: var(--ate-border);\r\n transform: scale(1.1);\r\n }\r\n\r\n .tiptap-button.color-button.is-active {\r\n border-color: var(--ate-primary);\r\n box-shadow: 0 0 0 2px var(--ate-primary-light);\r\n }\r\n\r\n /* Boutons avec variantes */\r\n .tiptap-button.danger {\r\n color: var(--ate-error-color, #ef4444);\r\n }\r\n\r\n .tiptap-button.danger:hover {\r\n background: var(--ate-error-bg, rgba(239, 68, 68, 0.1));\r\n }\r\n\r\n .tiptap-button.danger::before {\r\n background: var(--ate-error-color, #ef4444);\r\n }\r\n\r\n /* Boutons de taille différente */\r\n .tiptap-button.small {\r\n width: 24px;\r\n height: 24px;\r\n }\r\n\r\n .tiptap-button.medium {\r\n width: 32px;\r\n height: 32px;\r\n }\r\n\r\n .tiptap-button.large {\r\n width: 40px;\r\n height: 40px;\r\n }\r\n\r\n /* Animation de pulsation pour les boutons actifs */\r\n @keyframes pulse {\r\n 0%,\r\n 100% {\r\n box-shadow: 0 0 0 0 var(--ate-primary-light-alpha);\r\n }\r\n 50% {\r\n box-shadow: 0 0 0 4px transparent;\r\n }\r\n }\r\n\r\n .tiptap-button.is-active.pulse {\r\n animation: pulse 2s infinite;\r\n }\r\n\r\n /* Responsive */\r\n @media (max-width: 768px) {\r\n .tiptap-button {\r\n width: 32px;\r\n height: 32px;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined {\r\n font-size: 18px;\r\n }\r\n\r\n .tiptap-button.text-button {\r\n padding: 0 8px;\r\n font-size: 13px;\r\n }\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapButtonComponent {\r\n // Inputs\r\n icon = input.required<string>();\r\n title = input.required<string>();\r\n active = input(false);\r\n disabled = input(false);\r\n color = input<string>();\r\n variant = input<\"default\" | \"text\" | \"danger\">(\"default\");\r\n size = input<\"small\" | \"medium\" | \"large\">(\"medium\");\r\n iconSize = input<\"small\" | \"medium\" | \"large\">(\"medium\");\r\n\r\n // Outputs\r\n onClick = output<Event>();\r\n\r\n onMouseDown(event: MouseEvent) {\r\n event.preventDefault();\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport type { Editor } from \"@tiptap/core\";\r\n\r\nexport interface ColorPickerSelection {\r\n from: number;\r\n to: number;\r\n}\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class ColorPickerService {\r\n private storedSelection: ColorPickerSelection | null = null;\r\n\r\n /**\r\n * Find the first explicitly applied color within a selection.\r\n */\r\n private findFirstAppliedColor(\r\n editor: Editor,\r\n selection: ColorPickerSelection\r\n ): string | null {\r\n const { from, to } = selection;\r\n let found: string | null = null;\r\n\r\n editor.state.doc.nodesBetween(from, to, (node) => {\r\n if (found) return false;\r\n if (!node.isText) return;\r\n\r\n const textStyleMark = node.marks.find((m) => m.type.name === \"textStyle\");\r\n const color = (textStyleMark?.attrs as any)?.color as string | undefined;\r\n if (color) {\r\n found = this.normalizeColor(color);\r\n return false;\r\n }\r\n\r\n return;\r\n });\r\n\r\n return found;\r\n }\r\n\r\n /**\r\n * Capture current editor selection.\r\n */\r\n captureSelection(editor: Editor) {\r\n const sel = {\r\n from: editor.state.selection.from,\r\n to: editor.state.selection.to,\r\n };\r\n this.storedSelection = sel;\r\n }\r\n\r\n /**\r\n * Get last captured selection for an editor (if any).\r\n */\r\n getStoredSelection(): ColorPickerSelection | null {\r\n return this.storedSelection;\r\n }\r\n\r\n /**\r\n * To be called when color picking is done (picker closes).\r\n */\r\n done() {\r\n this.storedSelection = null;\r\n }\r\n\r\n /**\r\n * Get the current text color for the selection.\r\n * If multiple colors are present, returns the first found.\r\n */\r\n getCurrentColor(editor: Editor, selection?: ColorPickerSelection): string {\r\n const sel =\r\n selection ??\r\n ({\r\n from: editor.state.selection.from,\r\n to: editor.state.selection.to,\r\n } satisfies ColorPickerSelection);\r\n\r\n const found = this.findFirstAppliedColor(editor, sel);\r\n if (found) return found;\r\n\r\n const attrs = (editor.getAttributes(\"textStyle\") as any) || {};\r\n if (attrs.color) return this.normalizeColor(attrs.color);\r\n\r\n // Dynamic fallback: get current computed text color from editor's DOM\r\n try {\r\n if (typeof window !== \"undefined\" && editor.view?.dom) {\r\n const computedColor = window.getComputedStyle(editor.view.dom).color;\r\n return this.normalizeColor(computedColor);\r\n }\r\n } catch (e) {\r\n // Fail silently and use basic fallback\r\n }\r\n\r\n return \"#000000\";\r\n }\r\n\r\n /**\r\n * Check if a color is explicitly applied on the selection.\r\n */\r\n hasColorApplied(editor: Editor, selection?: ColorPickerSelection): boolean {\r\n const sel =\r\n selection ??\r\n ({\r\n from: editor.state.selection.from,\r\n to: editor.state.selection.to,\r\n } satisfies ColorPickerSelection);\r\n const { from, to } = sel;\r\n\r\n if (from === to) {\r\n const attrs = (editor.getAttributes(\"textStyle\") as any) || {};\r\n return !!attrs.color;\r\n }\r\n\r\n const found = this.findFirstAppliedColor(editor, sel);\r\n if (found) return true;\r\n\r\n const attrs = (editor.getAttributes(\"textStyle\") as any) || {};\r\n return !!attrs.color;\r\n }\r\n\r\n /**\r\n * Normalize color values so they can be used by <input type=\"color\">.\r\n */\r\n normalizeColor(color: string): string {\r\n if (color.startsWith(\"#\")) return color;\r\n\r\n const rgbMatch = color\r\n .trim()\r\n .match(\r\n /^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)(?:\\s*,\\s*([0-9.]+))?\\s*\\)$/i\r\n );\r\n\r\n if (!rgbMatch) return \"#000000\";\r\n\r\n const r = Math.max(0, Math.min(255, parseInt(rgbMatch[1]!, 10)));\r\n const g = Math.max(0, Math.min(255, parseInt(rgbMatch[2]!, 10)));\r\n const b = Math.max(0, Math.min(255, parseInt(rgbMatch[3]!, 10)));\r\n\r\n return (\r\n \"#\" +\r\n [r, g, b]\r\n .map((n) => n.toString(16).padStart(2, \"0\"))\r\n .join(\"\")\r\n .toLowerCase()\r\n );\r\n }\r\n\r\n /**\r\n * Apply a color to the current selection.\r\n */\r\n applyColor(\r\n editor: Editor,\r\n color: string,\r\n options: { addToHistory?: boolean } = {}\r\n ) {\r\n const sel = this.getStoredSelection() ?? editor.state.selection;\r\n const { addToHistory = true } = options;\r\n\r\n let chain = editor.chain().focus();\r\n\r\n if (sel) {\r\n chain = chain.setTextSelection(sel);\r\n }\r\n\r\n (chain as any).setColor(color);\r\n\r\n if (!addToHistory) {\r\n (chain as any).setMeta(\"addToHistory\", false);\r\n }\r\n\r\n chain.run();\r\n }\r\n\r\n /**\r\n * Unset color on the current selection.\r\n */\r\n unsetColor(editor: Editor, options: { addToHistory?: boolean } = {}) {\r\n const sel = this.getStoredSelection() ?? editor.state.selection;\r\n const { addToHistory = true } = options;\r\n\r\n let chain = editor.chain().focus();\r\n\r\n if (sel) {\r\n chain = chain.setTextSelection(sel);\r\n }\r\n\r\n (chain as any).unsetColor();\r\n\r\n if (!addToHistory) {\r\n (chain as any).setMeta(\"addToHistory\", false);\r\n }\r\n\r\n chain.run();\r\n }\r\n}\r\n","import { Injectable, signal, computed } from \"@angular/core\";\r\n\r\nexport type SupportedLocale = \"en\" | \"fr\";\r\n\r\nexport interface TiptapTranslations {\r\n // Toolbar\r\n toolbar: {\r\n bold: string;\r\n italic: string;\r\n underline: string;\r\n strike: string;\r\n code: string;\r\n superscript: string;\r\n subscript: string;\r\n highlight: string;\r\n heading1: string;\r\n heading2: string;\r\n heading3: string;\r\n bulletList: string;\r\n orderedList: string;\r\n blockquote: string;\r\n alignLeft: string;\r\n alignCenter: string;\r\n alignRight: string;\r\n alignJustify: string;\r\n link: string;\r\n image: string;\r\n horizontalRule: string;\r\n table: string;\r\n undo: string;\r\n redo: string;\r\n clear: string;\r\n textColor: string;\r\n };\r\n\r\n // Bubble Menu\r\n bubbleMenu: {\r\n bold: string;\r\n italic: string;\r\n underline: string;\r\n strike: string;\r\n code: string;\r\n superscript: string;\r\n subscript: string;\r\n highlight: string;\r\n textColor: string;\r\n link: string;\r\n addLink: string;\r\n editLink: string;\r\n removeLink: string;\r\n linkUrl: string;\r\n linkText: string;\r\n openLink: string;\r\n };\r\n\r\n // Slash Commands\r\n slashCommands: {\r\n heading1: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n heading2: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n heading3: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n bulletList: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n orderedList: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n blockquote: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n code: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n image: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n horizontalRule: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n table: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n };\r\n\r\n // Table Actions\r\n table: {\r\n addRowBefore: string;\r\n addRowAfter: string;\r\n deleteRow: string;\r\n addColumnBefore: string;\r\n addColumnAfter: string;\r\n deleteColumn: string;\r\n deleteTable: string;\r\n toggleHeaderRow: string;\r\n toggleHeaderColumn: string;\r\n mergeCells: string;\r\n splitCell: string;\r\n };\r\n\r\n // Image Upload\r\n imageUpload: {\r\n selectImage: string;\r\n loadError: string;\r\n uploadingImage: string;\r\n uploadProgress: string;\r\n uploadError: string;\r\n uploadSuccess: string;\r\n imageTooLarge: string;\r\n invalidFileType: string;\r\n dragDropText: string;\r\n changeImage: string;\r\n deleteImage: string;\r\n resizeSmall: string;\r\n resizeMedium: string;\r\n resizeLarge: string;\r\n resizeOriginal: string;\r\n resizing: string;\r\n compressing: string;\r\n compressionError: string;\r\n validating: string;\r\n uploadingToServer: string;\r\n replacingImage: string;\r\n insertingImage: string;\r\n noFileSelected: string;\r\n selectionCancelled: string;\r\n };\r\n\r\n // Editor\r\n editor: {\r\n placeholder: string;\r\n character: string;\r\n word: string;\r\n linkPrompt: string;\r\n linkUrlPrompt: string;\r\n confirmDelete: string;\r\n };\r\n\r\n // Common\r\n common: {\r\n cancel: string;\r\n confirm: string;\r\n apply: string;\r\n delete: string;\r\n save: string;\r\n close: string;\r\n loading: string;\r\n error: string;\r\n success: string;\r\n };\r\n}\r\n\r\nconst ENGLISH_TRANSLATIONS: TiptapTranslations = {\r\n toolbar: {\r\n bold: \"Bold\",\r\n italic: \"Italic\",\r\n underline: \"Underline\",\r\n strike: \"Strikethrough\",\r\n code: \"Code\",\r\n superscript: \"Superscript\",\r\n subscript: \"Subscript\",\r\n highlight: \"Highlight\",\r\n heading1: \"Heading 1\",\r\n heading2: \"Heading 2\",\r\n heading3: \"Heading 3\",\r\n bulletList: \"Bullet List\",\r\n orderedList: \"Ordered List\",\r\n blockquote: \"Blockquote\",\r\n alignLeft: \"Align Left\",\r\n alignCenter: \"Align Center\",\r\n alignRight: \"Align Right\",\r\n alignJustify: \"Align Justify\",\r\n link: \"Add Link\",\r\n image: \"Add Image\",\r\n horizontalRule: \"Horizontal Rule\",\r\n table: \"Insert Table\",\r\n undo: \"Undo\",\r\n redo: \"Redo\",\r\n clear: \"Clear\",\r\n textColor: \"Text Color\",\r\n },\r\n bubbleMenu: {\r\n bold: \"Bold\",\r\n italic: \"Italic\",\r\n underline: \"Underline\",\r\n strike: \"Strikethrough\",\r\n code: \"Code\",\r\n superscript: \"Superscript\",\r\n subscript: \"Subscript\",\r\n highlight: \"Highlight\",\r\n textColor: \"Text Color\",\r\n link: \"Link\",\r\n addLink: \"Add Link\",\r\n editLink: \"Edit Link\",\r\n removeLink: \"Remove Link\",\r\n linkUrl: \"Link URL\",\r\n linkText: \"Link Text\",\r\n openLink: \"Open Link\",\r\n },\r\n slashCommands: {\r\n heading1: {\r\n title: \"Heading 1\",\r\n description: \"Large section heading\",\r\n keywords: [\"heading\", \"h1\", \"title\", \"1\", \"header\"],\r\n },\r\n heading2: {\r\n title: \"Heading 2\",\r\n description: \"Medium section heading\",\r\n keywords: [\"heading\", \"h2\", \"title\", \"2\", \"header\"],\r\n },\r\n heading3: {\r\n title: \"Heading 3\",\r\n description: \"Small section heading\",\r\n keywords: [\"heading\", \"h3\", \"title\", \"3\", \"header\"],\r\n },\r\n bulletList: {\r\n title: \"Bullet List\",\r\n description: \"Create a bullet list\",\r\n keywords: [\"bullet\", \"list\", \"ul\", \"unordered\"],\r\n },\r\n orderedList: {\r\n title: \"Ordered List\",\r\n description: \"Create an ordered list\",\r\n keywords: [\"ordered\", \"list\", \"ol\", \"numbered\"],\r\n },\r\n blockquote: {\r\n title: \"Blockquote\",\r\n description: \"Add a blockquote\",\r\n keywords: [\"quote\", \"blockquote\", \"citation\"],\r\n },\r\n code: {\r\n title: \"Code Block\",\r\n description: \"Add a code block\",\r\n keywords: [\"code\", \"codeblock\", \"pre\", \"programming\"],\r\n },\r\n image: {\r\n title: \"Image\",\r\n description: \"Insert an image\",\r\n keywords: [\"image\", \"photo\", \"picture\", \"img\"],\r\n },\r\n horizontalRule: {\r\n title: \"Horizontal Rule\",\r\n description: \"Add a horizontal line\",\r\n keywords: [\"hr\", \"horizontal\", \"rule\", \"line\", \"separator\"],\r\n },\r\n table: {\r\n title: \"Table\",\r\n description: \"Insert a table\",\r\n keywords: [\"table\", \"grid\", \"data\", \"rows\", \"columns\"],\r\n },\r\n },\r\n table: {\r\n addRowBefore: \"Add row before\",\r\n addRowAfter: \"Add row after\",\r\n deleteRow: \"Delete row\",\r\n addColumnBefore: \"Add column before\",\r\n addColumnAfter: \"Add column after\",\r\n deleteColumn: \"Delete column\",\r\n deleteTable: \"Delete table\",\r\n toggleHeaderRow: \"Toggle header row\",\r\n toggleHeaderColumn: \"Toggle header column\",\r\n mergeCells: \"Merge cells\",\r\n splitCell: \"Split cell\",\r\n },\r\n imageUpload: {\r\n selectImage: \"Select Image\",\r\n loadError: \"Error loading image\",\r\n uploadingImage: \"Uploading image...\",\r\n uploadProgress: \"Upload Progress\",\r\n uploadError: \"Upload Error\",\r\n uploadSuccess: \"Upload Success\",\r\n imageTooLarge: \"Image too large\",\r\n invalidFileType: \"Invalid file type\",\r\n dragDropText: \"Drag and drop images here\",\r\n changeImage: \"Change Image\",\r\n deleteImage: \"Delete Image\",\r\n resizeSmall: \"Small\",\r\n resizeMedium: \"Medium\",\r\n resizeLarge: \"Large\",\r\n resizeOriginal: \"Original\",\r\n resizing: \"Resizing...\",\r\n compressing: \"Compressing...\",\r\n compressionError: \"Error during compression\",\r\n validating: \"Validating file...\",\r\n uploadingToServer: \"Uploading to server...\",\r\n replacingImage: \"Replacing image...\",\r\n insertingImage: \"Inserting into editor...\",\r\n noFileSelected: \"No image file selected\",\r\n selectionCancelled: \"Selection cancelled\",\r\n },\r\n editor: {\r\n placeholder: \"Start typing...\",\r\n character: \"character\",\r\n word: \"word\",\r\n linkPrompt: \"Enter link URL\",\r\n linkUrlPrompt: \"Enter URL\",\r\n confirmDelete: \"Are you sure you want to delete this?\",\r\n },\r\n common: {\r\n cancel: \"Cancel\",\r\n confirm: \"Confirm\",\r\n apply: \"Apply\",\r\n delete: \"Delete\",\r\n save: \"Save\",\r\n close: \"Close\",\r\n loading: \"Loading\",\r\n error: \"Error\",\r\n success: \"Success\",\r\n },\r\n};\r\n\r\nconst FRENCH_TRANSLATIONS: TiptapTranslations = {\r\n toolbar: {\r\n bold: \"Gras\",\r\n italic: \"Italique\",\r\n underline: \"Souligné\",\r\n strike: \"Barré\",\r\n code: \"Code\",\r\n superscript: \"Exposant\",\r\n subscript: \"Indice\",\r\n highlight: \"Surligner\",\r\n heading1: \"Titre 1\",\r\n heading2: \"Titre 2\",\r\n heading3: \"Titre 3\",\r\n bulletList: \"Liste à puces\",\r\n orderedList: \"Liste numérotée\",\r\n blockquote: \"Citation\",\r\n alignLeft: \"Aligner à gauche\",\r\n alignCenter: \"Centrer\",\r\n alignRight: \"Aligner à droite\",\r\n alignJustify: \"Justifier\",\r\n link: \"Ajouter un lien\",\r\n image: \"Ajouter une image\",\r\n horizontalRule: \"Ligne horizontale\",\r\n table: \"Insérer un tableau\",\r\n undo: \"Annuler\",\r\n redo: \"Refaire\",\r\n clear: \"Vider\",\r\n textColor: \"Couleur texte\",\r\n },\r\n bubbleMenu: {\r\n bold: \"Gras\",\r\n italic: \"Italique\",\r\n underline: \"Souligné\",\r\n strike: \"Barré\",\r\n code: \"Code\",\r\n superscript: \"Exposant\",\r\n subscript: \"Indice\",\r\n highlight: \"Surligner\",\r\n textColor: \"Couleur texte\",\r\n link: \"Lien\",\r\n addLink: \"Ajouter un lien\",\r\n editLink: \"Modifier le lien\",\r\n removeLink: \"Supprimer le lien\",\r\n linkUrl: \"URL du lien\",\r\n linkText: \"Texte du lien\",\r\n openLink: \"Ouvrir le lien\",\r\n },\r\n slashCommands: {\r\n heading1: {\r\n title: \"Titre 1\",\r\n description: \"Grand titre de section\",\r\n keywords: [\"heading\", \"h1\", \"titre\", \"title\", \"1\", \"header\"],\r\n },\r\n heading2: {\r\n title: \"Titre 2\",\r\n description: \"Titre de sous-section\",\r\n keywords: [\"heading\", \"h2\", \"titre\", \"title\", \"2\", \"header\"],\r\n },\r\n heading3: {\r\n title: \"Titre 3\",\r\n description: \"Petit titre\",\r\n keywords: [\"heading\", \"h3\", \"titre\", \"title\", \"3\", \"header\"],\r\n },\r\n bulletList: {\r\n title: \"Liste à puces\",\r\n description: \"Créer une liste à puces\",\r\n keywords: [\"bullet\", \"list\", \"liste\", \"puces\", \"ul\"],\r\n },\r\n orderedList: {\r\n title: \"Liste numérotée\",\r\n description: \"Créer une liste numérotée\",\r\n keywords: [\"numbered\", \"list\", \"liste\", \"numérotée\", \"ol\", \"ordered\"],\r\n },\r\n blockquote: {\r\n title: \"Citation\",\r\n description: \"Ajouter une citation\",\r\n keywords: [\"quote\", \"blockquote\", \"citation\"],\r\n },\r\n code: {\r\n title: \"Bloc de code\",\r\n description: \"Ajouter un bloc de code\",\r\n keywords: [\"code\", \"codeblock\", \"pre\", \"programmation\"],\r\n },\r\n image: {\r\n title: \"Image\",\r\n description: \"Insérer une image\",\r\n keywords: [\"image\", \"photo\", \"picture\", \"img\"],\r\n },\r\n horizontalRule: {\r\n title: \"Ligne horizontale\",\r\n description: \"Ajouter une ligne de séparation\",\r\n keywords: [\"hr\", \"horizontal\", \"rule\", \"ligne\", \"séparation\"],\r\n },\r\n table: {\r\n title: \"Tableau\",\r\n description: \"Insérer un tableau\",\r\n keywords: [\r\n \"table\",\r\n \"tableau\",\r\n \"grid\",\r\n \"grille\",\r\n \"data\",\r\n \"données\",\r\n \"rows\",\r\n \"colonnes\",\r\n ],\r\n },\r\n },\r\n table: {\r\n addRowBefore: \"Ajouter une ligne avant\",\r\n addRowAfter: \"Ajouter une ligne après\",\r\n deleteRow: \"Supprimer la ligne\",\r\n addColumnBefore: \"Ajouter une colonne avant\",\r\n addColumnAfter: \"Ajouter une colonne après\",\r\n deleteColumn: \"Supprimer la colonne\",\r\n deleteTable: \"Supprimer le tableau\",\r\n toggleHeaderRow: \"Basculer ligne d'en-tête\",\r\n toggleHeaderColumn: \"Basculer colonne d'en-tête\",\r\n mergeCells: \"Fusionner les cellules\",\r\n splitCell: \"Diviser la cellule\",\r\n },\r\n imageUpload: {\r\n selectImage: \"Sélectionner une image\",\r\n loadError: \"Erreur de chargement de l'image\",\r\n uploadingImage: \"Téléchargement de l'image...\",\r\n uploadProgress: \"Progression du téléchargement\",\r\n uploadError: \"Erreur de téléchargement\",\r\n uploadSuccess: \"Téléchargement réussi\",\r\n imageTooLarge: \"Image trop volumineuse\",\r\n invalidFileType: \"Type de fichier invalide\",\r\n dragDropText: \"Glissez et déposez des images ici\",\r\n changeImage: \"Changer l'image\",\r\n deleteImage: \"Supprimer l'image\",\r\n resizeSmall: \"Petit\",\r\n resizeMedium: \"Moyen\",\r\n resizeLarge: \"Grand\",\r\n resizeOriginal: \"Original\",\r\n resizing: \"Redimensionnement...\",\r\n compressing: \"Compression...\",\r\n compressionError: \"Erreur lors de la compression\",\r\n validating: \"Validation du fichier...\",\r\n uploadingToServer: \"Upload vers le serveur...\",\r\n replacingImage: \"Remplacement de l'image...\",\r\n insertingImage: \"Insertion dans l'éditeur...\",\r\n noFileSelected: \"Aucun fichier image sélectionné\",\r\n selectionCancelled: \"Sélection annulée\",\r\n },\r\n editor: {\r\n placeholder: \"Commencez à écrire...\",\r\n character: \"caractère\",\r\n word: \"mot\",\r\n linkPrompt: \"Entrez l'URL du lien\",\r\n linkUrlPrompt: \"Entrez l'URL\",\r\n confirmDelete: \"Êtes-vous sûr de vouloir supprimer ceci ?\",\r\n },\r\n common: {\r\n cancel: \"Annuler\",\r\n confirm: \"Confirmer\",\r\n apply: \"Appliquer\",\r\n delete: \"Supprimer\",\r\n save: \"Sauvegarder\",\r\n close: \"Fermer\",\r\n loading: \"Chargement\",\r\n error: \"Erreur\",\r\n success: \"Succès\",\r\n },\r\n};\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class TiptapI18nService {\r\n private _currentLocale = signal<SupportedLocale>(\"en\");\r\n private _translations = signal<Record<SupportedLocale, TiptapTranslations>>({\r\n en: ENGLISH_TRANSLATIONS,\r\n fr: FRENCH_TRANSLATIONS,\r\n });\r\n\r\n // Signaux publics\r\n readonly currentLocale = this._currentLocale.asReadonly();\r\n readonly translations = computed(\r\n () => this._translations()[this._currentLocale()]\r\n );\r\n\r\n // Méthodes de traduction rapides\r\n readonly t = computed(() => this.translations());\r\n readonly toolbar = computed(() => this.translations().toolbar);\r\n readonly bubbleMenu = computed(() => this.translations().bubbleMenu);\r\n readonly slashCommands = computed(() => this.translations().slashCommands);\r\n readonly table = computed(() => this.translations().table);\r\n readonly imageUpload = computed(() => this.translations().imageUpload);\r\n readonly editor = computed(() => this.translations().editor);\r\n readonly common = computed(() => this.translations().common);\r\n\r\n constructor() {\r\n // Détecter automatiquement la langue du navigateur\r\n this.detectBrowserLanguage();\r\n }\r\n\r\n setLocale(locale: SupportedLocale): void {\r\n this._currentLocale.set(locale);\r\n }\r\n\r\n autoDetectLocale(): void {\r\n this.detectBrowserLanguage();\r\n }\r\n\r\n getSupportedLocales(): SupportedLocale[] {\r\n return Object.keys(this._translations()) as SupportedLocale[];\r\n }\r\n\r\n addTranslations(\r\n locale: SupportedLocale,\r\n translations: Partial<TiptapTranslations>\r\n ): void {\r\n this._translations.update((current) => ({\r\n ...current,\r\n [locale]: {\r\n ...current[locale],\r\n ...translations,\r\n },\r\n }));\r\n }\r\n\r\n private detectBrowserLanguage(): void {\r\n const browserLang = navigator.language.toLowerCase();\r\n if (browserLang.startsWith(\"fr\")) {\r\n this._currentLocale.set(\"fr\");\r\n } else {\r\n this._currentLocale.set(\"en\");\r\n }\r\n }\r\n\r\n // Méthodes utilitaires pour les composants\r\n getToolbarTitle(key: keyof TiptapTranslations[\"toolbar\"]): string {\r\n return this.translations().toolbar[key];\r\n }\r\n\r\n getBubbleMenuTitle(key: keyof TiptapTranslations[\"bubbleMenu\"]): string {\r\n return this.translations().bubbleMenu[key];\r\n }\r\n\r\n getSlashCommand(key: keyof TiptapTranslations[\"slashCommands\"]) {\r\n return this.translations().slashCommands[key];\r\n }\r\n}\r\n","import {\r\n Component,\r\n ElementRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from \"@angular/core\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { ColorPickerService } from \"../services/color-picker.service\";\r\nimport { TiptapButtonComponent } from \"../tiptap-button.component\";\r\nimport { TiptapI18nService } from \"../services/i18n.service\";\r\n\r\n@Component({\r\n selector: \"tiptap-text-color-picker\",\r\n standalone: true,\r\n imports: [TiptapButtonComponent],\r\n template: `\r\n <div class=\"text-color-picker-container\">\r\n <tiptap-button\r\n icon=\"format_color_text\"\r\n [title]=\"t().textColor\"\r\n [color]=\"hasColorApplied() ? currentColor() : 'var(--ate-text)'\"\r\n (onClick)=\"triggerPicker()\"\r\n >\r\n <input\r\n #colorInput\r\n type=\"color\"\r\n [value]=\"currentColor()\"\r\n (mousedown)=\"onColorMouseDown($event)\"\r\n (input)=\"onColorInput($event)\"\r\n (change)=\"onColorPickerClose()\"\r\n (blur)=\"onColorPickerClose()\"\r\n />\r\n </tiptap-button>\r\n\r\n @if (hasColorApplied()) {\r\n <button\r\n class=\"btn-clear-badge\"\r\n type=\"button\"\r\n [title]=\"t().clear\"\r\n (mousedown)=\"onClearBadgeMouseDown($event)\"\r\n (click)=\"onClearBadgeClick($event)\"\r\n >\r\n <span class=\"material-symbols-outlined\">close</span>\r\n </button>\r\n }\r\n </div>\r\n `,\r\n styles: [\r\n `\r\n .text-color-picker-container {\r\n position: relative;\r\n display: inline-flex;\r\n align-items: center;\r\n }\r\n\r\n .text-color-picker-container tiptap-button {\r\n position: relative;\r\n }\r\n\r\n .btn-clear-badge {\r\n position: absolute;\r\n top: -4px;\r\n right: -4px;\r\n width: 14px;\r\n height: 14px;\r\n padding: 0;\r\n border: none;\r\n border-radius: 999px;\r\n background: rgba(15, 23, 42, 0.75);\r\n color: #ffffff;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n z-index: 10;\r\n opacity: 0;\r\n pointer-events: none;\r\n transition: opacity 120ms ease;\r\n }\r\n\r\n .text-color-picker-container:hover .btn-clear-badge {\r\n opacity: 1;\r\n pointer-events: auto;\r\n }\r\n\r\n .btn-clear-badge .material-symbols-outlined {\r\n font-size: 10px;\r\n line-height: 1;\r\n }\r\n\r\n input[type=\"color\"] {\r\n position: absolute;\r\n inset: 0;\r\n opacity: 0;\r\n width: 100%;\r\n height: 100%;\r\n cursor: pointer;\r\n z-index: 5;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapTextColorPickerComponent {\r\n editor = input.required<Editor>();\r\n\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const update = () => this.notifyEditorChange();\r\n\r\n ed.on(\"transaction\", update);\r\n ed.on(\"selectionUpdate\", update);\r\n ed.on(\"focus\", update);\r\n\r\n return () => {\r\n ed.off(\"transaction\", update);\r\n ed.off(\"selectionUpdate\", update);\r\n ed.off(\"focus\", update);\r\n };\r\n });\r\n }\r\n\r\n interactionChange = output<boolean>();\r\n requestUpdate = output<void>();\r\n\r\n private colorInputRef = viewChild<ElementRef<HTMLInputElement>>(\"colorInput\");\r\n\r\n private colorPickerSvc = inject(ColorPickerService);\r\n private i18nService = inject(TiptapI18nService);\r\n\r\n readonly t = this.i18nService.toolbar;\r\n\r\n private previewColor = signal<string | null>(null);\r\n private isPicking = signal(false);\r\n private editorChange = signal(0);\r\n\r\n /**\r\n * Notify Angular that the editor state should be re-read.\r\n */\r\n private notifyEditorChange() {\r\n this.editorChange.update((v) => v + 1);\r\n }\r\n\r\n readonly currentColor = computed(() => {\r\n this.editorChange();\r\n if (this.previewColor()) return this.previewColor()!;\r\n return this.colorPickerSvc.getCurrentColor(this.editor());\r\n });\r\n\r\n readonly hasColorApplied = computed(() => {\r\n this.editorChange();\r\n return this.previewColor()\r\n ? true\r\n : this.colorPickerSvc.hasColorApplied(this.editor());\r\n });\r\n\r\n private _syncEffect = void effect(() => {\r\n const el = this.colorInputRef()?.nativeElement;\r\n if (!el) return;\r\n el.value = this.currentColor();\r\n });\r\n\r\n /**\r\n * Keep the native <input type=\"color\"> in sync with selection changes.\r\n */\r\n syncColorInputValue() {\r\n this.previewColor.set(null);\r\n this.isPicking.set(false);\r\n\r\n // Reason: force recomputation from editor selection when bubble menu re-opens.\r\n this.notifyEditorChange();\r\n }\r\n\r\n /**\r\n * Programmatically click the hidden color input.\r\n */\r\n triggerPicker() {\r\n this.colorInputRef()?.nativeElement.click();\r\n }\r\n\r\n /**\r\n * Preserve selection while interacting with native color input.\r\n */\r\n onColorMouseDown(event: MouseEvent) {\r\n event.stopPropagation();\r\n\r\n this.colorPickerSvc.captureSelection(this.editor());\r\n this.isPicking.set(true);\r\n this.interactionChange.emit(true);\r\n }\r\n\r\n /**\r\n * Called when the native color picker is closed.\r\n */\r\n onColorPickerClose() {\r\n this.previewColor.set(null);\r\n this.isPicking.set(false);\r\n\r\n // Commit the final color to history\r\n const inputEl = this.colorInputRef()?.nativeElement;\r\n if (inputEl) {\r\n this.colorPickerSvc.applyColor(this.editor(), inputEl.value, {\r\n addToHistory: true,\r\n });\r\n }\r\n\r\n this.colorPickerSvc.done();\r\n this.interactionChange.emit(false);\r\n this.requestUpdate.emit();\r\n }\r\n\r\n /**\r\n * Apply selected color.\r\n */\r\n onColorInput(event: Event) {\r\n const inputEl = event.target as HTMLInputElement;\r\n const color = inputEl.value;\r\n\r\n // Update the UI immediately while the user drags in the native picker.\r\n this.previewColor.set(this.colorPickerSvc.normalizeColor(color));\r\n\r\n // Live preview WITHOUT history pollution\r\n this.colorPickerSvc.applyColor(this.editor(), color, {\r\n addToHistory: false,\r\n });\r\n\r\n this.requestUpdate.emit();\r\n }\r\n\r\n /**\r\n * Prevent opening the native picker when clicking the clear badge.\r\n */\r\n onClearBadgeMouseDown(event: MouseEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n\r\n /**\r\n * Clear color via the badge.\r\n */\r\n onClearBadgeClick(event: MouseEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.previewColor.set(null);\r\n this.isPicking.set(false);\r\n this.colorPickerSvc.unsetColor(this.editor());\r\n this.requestUpdate.emit();\r\n }\r\n\r\n /**\r\n * Called when the color picker is done interacting.\r\n */\r\n done() {\r\n this.colorPickerSvc.done();\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n signal,\r\n computed,\r\n inject,\r\n} from \"@angular/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { CellSelection } from \"@tiptap/pm/tables\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapTextColorPickerComponent } from \"./components/tiptap-text-color-picker.component\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\n\r\nimport { BubbleMenuConfig } from \"./models/bubble-menu.model\";\r\n\r\n@Component({\r\n selector: \"tiptap-bubble-menu\",\r\n standalone: true,\r\n imports: [TiptapButtonComponent, TiptapTextColorPickerComponent],\r\n template: `\r\n <div #menuRef class=\"bubble-menu\">\r\n @if (bubbleMenuConfig().bold) {\r\n <tiptap-button\r\n icon=\"format_bold\"\r\n [title]=\"t().bold\"\r\n [active]=\"isActive('bold')\"\r\n (click)=\"onCommand('bold', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().italic) {\r\n <tiptap-button\r\n icon=\"format_italic\"\r\n [title]=\"t().italic\"\r\n [active]=\"isActive('italic')\"\r\n (click)=\"onCommand('italic', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().underline) {\r\n <tiptap-button\r\n icon=\"format_underlined\"\r\n [title]=\"t().underline\"\r\n [active]=\"isActive('underline')\"\r\n (click)=\"onCommand('underline', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().strike) {\r\n <tiptap-button\r\n icon=\"strikethrough_s\"\r\n [title]=\"t().strike\"\r\n [active]=\"isActive('strike')\"\r\n (click)=\"onCommand('strike', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().superscript) {\r\n <tiptap-button\r\n icon=\"superscript\"\r\n [title]=\"t().superscript\"\r\n [active]=\"isActive('superscript')\"\r\n (click)=\"onCommand('superscript', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().subscript) {\r\n <tiptap-button\r\n icon=\"subscript\"\r\n [title]=\"t().subscript\"\r\n [active]=\"isActive('subscript')\"\r\n (click)=\"onCommand('subscript', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().highlight) {\r\n <tiptap-button\r\n icon=\"highlight\"\r\n [title]=\"t().highlight\"\r\n [active]=\"isActive('highlight')\"\r\n (click)=\"onCommand('highlight', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().textColor) {\r\n <tiptap-text-color-picker\r\n #textColorPicker\r\n [editor]=\"editor()\"\r\n (interactionChange)=\"onColorPickerInteractionChange($event)\"\r\n (requestUpdate)=\"updateMenu()\"\r\n />\r\n } @if (bubbleMenuConfig().separator && (bubbleMenuConfig().code ||\r\n bubbleMenuConfig().link)) {\r\n <div class=\"tiptap-separator\"></div>\r\n } @if (bubbleMenuConfig().code) {\r\n <tiptap-button\r\n icon=\"code\"\r\n [title]=\"t().code\"\r\n [active]=\"isActive('code')\"\r\n (click)=\"onCommand('code', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().link) {\r\n <tiptap-button\r\n icon=\"link\"\r\n [title]=\"t().link\"\r\n [active]=\"isActive('link')\"\r\n (click)=\"onCommand('link', $event)\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n})\r\nexport class TiptapBubbleMenuComponent implements OnInit, OnDestroy {\r\n private readonly i18nService = inject(TiptapI18nService);\r\n readonly t = this.i18nService.bubbleMenu;\r\n\r\n editor = input.required<Editor>();\r\n config = input<BubbleMenuConfig>({\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n textColor: false,\r\n link: true,\r\n separator: true,\r\n });\r\n\r\n @ViewChild(\"menuRef\", { static: false }) menuRef!: ElementRef<HTMLDivElement>;\r\n @ViewChild(\"textColorPicker\", { static: false })\r\n private textColorPicker?: TiptapTextColorPickerComponent;\r\n\r\n private tippyInstance: TippyInstance | null = null;\r\n private updateTimeout: any = null;\r\n\r\n private isColorPickerInteracting = false;\r\n\r\n bubbleMenuConfig = computed(() => ({\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n textColor: false,\r\n link: true,\r\n separator: true,\r\n ...this.config(),\r\n }));\r\n\r\n /**\r\n * Keep bubble menu visible while the native color picker steals focus.\r\n */\r\n onColorPickerInteractionChange(isInteracting: boolean) {\r\n this.isColorPickerInteracting = isInteracting;\r\n }\r\n\r\n // Effect comme propriété de classe pour éviter l'erreur d'injection context\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n // Nettoyer les anciens listeners\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n ed.on(\"selectionUpdate\", this.updateMenu);\r\n ed.on(\"transaction\", this.updateMenu);\r\n ed.on(\"focus\", this.updateMenu);\r\n ed.on(\"blur\", this.handleBlur);\r\n\r\n // Ne pas appeler updateMenu() ici pour éviter l'affichage prématuré\r\n // Il sera appelé automatiquement quand l'éditeur sera prêt\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n // Initialiser Tippy de manière synchrone après que le component soit ready\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n // Nettoyer les timeouts\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n // Nettoyer Tippy\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n this.tippyInstance = null;\r\n }\r\n }\r\n\r\n private initTippy() {\r\n // Attendre que l'élément soit disponible\r\n if (!this.menuRef?.nativeElement) {\r\n setTimeout(() => this.initTippy(), 50);\r\n return;\r\n }\r\n\r\n const menuElement = this.menuRef.nativeElement;\r\n\r\n // S'assurer qu'il n'y a pas déjà une instance\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"top-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getSelectionRect(),\r\n // Améliorer le positionnement avec scroll\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getSelectionRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n const { from, to } = ed.state.selection;\r\n if (from === to) return new DOMRect(0, 0, 0, 0);\r\n\r\n // 1. Try native selection for multi-line accuracy\r\n const selection = window.getSelection();\r\n if (selection && selection.rangeCount > 0) {\r\n const range = selection.getRangeAt(0);\r\n const rect = range.getBoundingClientRect();\r\n\r\n // Ensure the rect is valid and belongs to the editor\r\n if (rect.width > 0 && rect.height > 0) {\r\n return rect;\r\n }\r\n }\r\n\r\n // 2. Fallback to Tiptap coordinates for precision (single line / edge cases)\r\n const start = ed.view.coordsAtPos(from);\r\n const end = ed.view.coordsAtPos(to);\r\n\r\n const top = Math.min(start.top, end.top);\r\n const bottom = Math.max(start.bottom, end.bottom);\r\n const left = Math.min(start.left, end.left);\r\n const right = Math.max(start.right, end.right);\r\n\r\n return new DOMRect(left, top, right - left, bottom - top);\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n if (!this.isColorPickerInteracting && this.textColorPicker) {\r\n this.textColorPicker.done();\r\n }\r\n\r\n const { selection } = ed.state;\r\n const { from, to } = selection;\r\n const hasTextSelection =\r\n from !== to && !(selection instanceof CellSelection);\r\n const isImageSelected =\r\n ed.isActive(\"image\") || ed.isActive(\"resizableImage\");\r\n const isTableCellSelected =\r\n ed.isActive(\"tableCell\") || ed.isActive(\"tableHeader\");\r\n const hasCellSelection = selection instanceof CellSelection;\r\n\r\n // Ne montrer le menu texte que si :\r\n // - Il y a une sélection de texte (pas une sélection de cellules multiples)\r\n // - Aucune image n'est sélectionnée (priorité aux images)\r\n // - Ce n'est pas une sélection de cellules multiples (CellSelection)\r\n // - L'éditeur est éditable\r\n // Note: Le texte dans une cellule est autorisé (isTableCellSelected peut être true)\r\n const shouldShow =\r\n hasTextSelection &&\r\n !isImageSelected &&\r\n !hasCellSelection &&\r\n ed.isEditable;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n if (!this.isColorPickerInteracting) {\r\n this.hideTippy();\r\n }\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n if (!this.isColorPickerInteracting && this.textColorPicker) {\r\n this.textColorPicker.done();\r\n this.hideTippy();\r\n }\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Cette méthode peut être étendue pour fermer d'autres menus si nécessaire\r\n // Pour l'instant, elle sert de placeholder pour une future coordination entre menus\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getSelectionRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n\r\n this.textColorPicker?.syncColorInputValue();\r\n }\r\n\r\n hideTippy() {\r\n if (this.tippyInstance) {\r\n this.tippyInstance.hide();\r\n }\r\n }\r\n\r\n isActive(mark: string): boolean {\r\n const ed = this.editor();\r\n return ed?.isActive(mark) || false;\r\n }\r\n\r\n onCommand(command: string, event: MouseEvent) {\r\n event.preventDefault();\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n switch (command) {\r\n case \"bold\":\r\n ed.chain().focus().toggleBold().run();\r\n break;\r\n case \"italic\":\r\n ed.chain().focus().toggleItalic().run();\r\n break;\r\n case \"underline\":\r\n ed.chain().focus().toggleUnderline().run();\r\n break;\r\n case \"strike\":\r\n ed.chain().focus().toggleStrike().run();\r\n break;\r\n case \"code\":\r\n ed.chain().focus().toggleCode().run();\r\n break;\r\n case \"superscript\":\r\n ed.chain().focus().toggleSuperscript().run();\r\n break;\r\n case \"subscript\":\r\n ed.chain().focus().toggleSubscript().run();\r\n break;\r\n case \"highlight\":\r\n ed.chain().focus().toggleHighlight().run();\r\n break;\r\n case \"link\":\r\n const href = window.prompt(this.i18nService.editor().linkPrompt);\r\n if (href) {\r\n ed.chain().focus().toggleLink({ href }).run();\r\n }\r\n break;\r\n }\r\n }\r\n}\r\n","import { Component, input } from \"@angular/core\";\r\n\r\n@Component({\r\n selector: \"tiptap-separator\",\r\n standalone: true,\r\n template: `\r\n <div\r\n class=\"tiptap-separator\"\r\n [class.vertical]=\"orientation() === 'vertical'\"\r\n [class.horizontal]=\"orientation() === 'horizontal'\"\r\n [class.small]=\"size() === 'small'\"\r\n [class.medium]=\"size() === 'medium'\"\r\n [class.large]=\"size() === 'large'\"\r\n ></div>\r\n `,\r\n styles: [\r\n `\r\n .tiptap-separator {\r\n background-color: var(--ate-border, #e2e8f0);\r\n margin: 0;\r\n }\r\n\r\n .tiptap-separator.vertical {\r\n width: 1px;\r\n height: 24px;\r\n margin: 0 8px;\r\n }\r\n\r\n .tiptap-separator.horizontal {\r\n height: 1px;\r\n width: 100%;\r\n margin: 8px 0;\r\n }\r\n\r\n .tiptap-separator.small.vertical {\r\n height: 16px;\r\n margin: 0 4px;\r\n }\r\n\r\n .tiptap-separator.small.horizontal {\r\n margin: 4px 0;\r\n }\r\n\r\n .tiptap-separator.medium.vertical {\r\n height: 24px;\r\n margin: 0 8px;\r\n }\r\n\r\n .tiptap-separator.medium.horizontal {\r\n margin: 8px 0;\r\n }\r\n\r\n .tiptap-separator.large.vertical {\r\n height: 32px;\r\n margin: 0 12px;\r\n }\r\n\r\n .tiptap-separator.large.horizontal {\r\n margin: 12px 0;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapSeparatorComponent {\r\n orientation = input<\"vertical\" | \"horizontal\">(\"vertical\");\r\n size = input<\"small\" | \"medium\" | \"large\">(\"medium\");\r\n}\r\n","import { Injectable, signal, computed, inject } from \"@angular/core\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { Observable, isObservable, firstValueFrom } from \"rxjs\";\r\nimport { TiptapI18nService } from \"./i18n.service\";\r\n\r\nexport interface ImageData {\r\n src: string;\r\n alt?: string;\r\n title?: string;\r\n width?: number;\r\n height?: number;\r\n}\r\n\r\nexport interface ImageUploadResult {\r\n src: string;\r\n name: string;\r\n size: number;\r\n type: string;\r\n width?: number;\r\n height?: number;\r\n originalSize?: number;\r\n}\r\n\r\nexport interface ResizeOptions {\r\n width?: number;\r\n height?: number;\r\n maintainAspectRatio?: boolean;\r\n}\r\n\r\n/**\r\n * Context passed to the image upload handler containing information about the image\r\n */\r\nexport interface ImageUploadContext {\r\n /** Original file being uploaded */\r\n file: File;\r\n /** Width of the processed image */\r\n width: number;\r\n /** Height of the processed image */\r\n height: number;\r\n /** MIME type of the image */\r\n type: string;\r\n /** Base64 data URL of the processed image (after compression/resize) */\r\n base64: string;\r\n}\r\n\r\n/**\r\n * Result expected from a custom image upload handler.\r\n * Must contain at least the `src` property with the image URL.\r\n */\r\nexport interface ImageUploadHandlerResult {\r\n /** URL of the uploaded image (can be a remote URL or any string) */\r\n src: string;\r\n /** Optional custom alt text */\r\n alt?: string;\r\n /** Optional custom title */\r\n title?: string;\r\n}\r\n\r\n/**\r\n * Custom handler function for image uploads.\r\n * Allows users to implement their own image storage logic (e.g., upload to S3, Cloudinary, etc.)\r\n *\r\n * Can return either a Promise or an Observable (Angular-friendly).\r\n *\r\n * @param context - Context containing the image file and metadata\r\n * @returns Promise or Observable resolving to ImageUploadHandlerResult\r\n *\r\n * @example Using Promise (async/await)\r\n * ```typescript\r\n * uploadHandler: ImageUploadHandler = async (ctx) => {\r\n * const formData = new FormData();\r\n * formData.append('image', ctx.file);\r\n * const result = await firstValueFrom(this.http.post<{url: string}>('/api/upload', formData));\r\n * return { src: result.url };\r\n * };\r\n * ```\r\n *\r\n * @example Using Observable (Angular HttpClient)\r\n * ```typescript\r\n * uploadHandler: ImageUploadHandler = (ctx) => {\r\n * const formData = new FormData();\r\n * formData.append('image', ctx.file);\r\n * return this.http.post<{url: string}>('/api/upload', formData).pipe(\r\n * map(result => ({ src: result.url }))\r\n * );\r\n * };\r\n * ```\r\n */\r\nexport type ImageUploadHandler = (\r\n context: ImageUploadContext\r\n) => Promise<ImageUploadHandlerResult> | Observable<ImageUploadHandlerResult>;\r\n\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class ImageService {\r\n // Signals pour l'état des images\r\n selectedImage = signal<ImageData | null>(null);\r\n isImageSelected = computed(() => this.selectedImage() !== null);\r\n // Resizing signals\r\n isResizing = signal(false);\r\n\r\n private i18n = inject(TiptapI18nService);\r\n private readonly t = this.i18n.imageUpload;\r\n\r\n // Signaux pour l'upload\r\n isUploading = signal(false);\r\n uploadProgress = signal(0);\r\n uploadMessage = signal(\"\");\r\n\r\n /**\r\n * Custom upload handler for images.\r\n * When set, this handler will be called instead of the default base64 conversion.\r\n * This allows users to implement their own image storage logic.\r\n *\r\n * @example\r\n * ```typescript\r\n * imageService.uploadHandler = async (context) => {\r\n * const formData = new FormData();\r\n * formData.append('image', context.file);\r\n * const response = await fetch('/api/upload', { method: 'POST', body: formData });\r\n * const data = await response.json();\r\n * return { src: data.url };\r\n * };\r\n * ```\r\n */\r\n uploadHandler: ImageUploadHandler | null = null;\r\n\r\n // Référence à l'éditeur pour les mises à jour\r\n private currentEditor: Editor | null = null;\r\n\r\n // Méthodes pour la gestion des images\r\n selectImage(editor: Editor): void {\r\n if (editor.isActive(\"resizableImage\")) {\r\n const attrs = editor.getAttributes(\"resizableImage\");\r\n this.selectedImage.set({\r\n src: attrs[\"src\"],\r\n alt: attrs[\"alt\"],\r\n title: attrs[\"title\"],\r\n width: attrs[\"width\"],\r\n height: attrs[\"height\"],\r\n });\r\n } else {\r\n this.selectedImage.set(null);\r\n }\r\n }\r\n\r\n clearSelection(): void {\r\n this.selectedImage.set(null);\r\n }\r\n\r\n // Méthodes pour manipuler les images\r\n insertImage(editor: Editor, imageData: ImageData): void {\r\n editor.chain().focus().setResizableImage(imageData).run();\r\n }\r\n\r\n updateImageAttributes(editor: Editor, attributes: Partial<ImageData>): void {\r\n if (editor.isActive(\"resizableImage\")) {\r\n editor\r\n .chain()\r\n .focus()\r\n .updateAttributes(\"resizableImage\", attributes)\r\n .run();\r\n this.updateSelectedImage(attributes);\r\n }\r\n }\r\n\r\n // Nouvelles méthodes pour le redimensionnement\r\n resizeImage(editor: Editor, options: ResizeOptions): void {\r\n if (!editor.isActive(\"resizableImage\")) return;\r\n\r\n const currentAttrs = editor.getAttributes(\"resizableImage\");\r\n let newWidth = options.width;\r\n let newHeight = options.height;\r\n\r\n // Maintenir le ratio d'aspect si demandé\r\n if (\r\n options.maintainAspectRatio !== false &&\r\n currentAttrs[\"width\"] &&\r\n currentAttrs[\"height\"]\r\n ) {\r\n const aspectRatio = currentAttrs[\"width\"] / currentAttrs[\"height\"];\r\n\r\n if (newWidth && !newHeight) {\r\n newHeight = Math.round(newWidth / aspectRatio);\r\n } else if (newHeight && !newWidth) {\r\n newWidth = Math.round(newHeight * aspectRatio);\r\n }\r\n }\r\n\r\n // Appliquer des limites minimales\r\n if (newWidth) newWidth = Math.max(50, newWidth);\r\n if (newHeight) newHeight = Math.max(50, newHeight);\r\n\r\n this.updateImageAttributes(editor, {\r\n width: newWidth,\r\n height: newHeight,\r\n });\r\n }\r\n\r\n // Méthodes pour redimensionner par pourcentage\r\n resizeImageByPercentage(editor: Editor, percentage: number): void {\r\n if (!editor.isActive(\"resizableImage\")) return;\r\n\r\n const currentAttrs = editor.getAttributes(\"resizableImage\");\r\n if (!currentAttrs[\"width\"] || !currentAttrs[\"height\"]) return;\r\n\r\n const newWidth = Math.round(currentAttrs[\"width\"] * (percentage / 100));\r\n const newHeight = Math.round(currentAttrs[\"height\"] * (percentage / 100));\r\n\r\n this.resizeImage(editor, { width: newWidth, height: newHeight });\r\n }\r\n\r\n // Méthodes pour redimensionner à des tailles prédéfinies\r\n resizeImageToSmall(editor: Editor): void {\r\n this.resizeImage(editor, {\r\n width: 300,\r\n height: 200,\r\n maintainAspectRatio: true,\r\n });\r\n }\r\n\r\n resizeImageToMedium(editor: Editor): void {\r\n this.resizeImage(editor, {\r\n width: 500,\r\n height: 350,\r\n maintainAspectRatio: true,\r\n });\r\n }\r\n\r\n resizeImageToLarge(editor: Editor): void {\r\n this.resizeImage(editor, {\r\n width: 800,\r\n height: 600,\r\n maintainAspectRatio: true,\r\n });\r\n }\r\n\r\n resizeImageToOriginal(editor: Editor): void {\r\n if (!editor.isActive(\"resizableImage\")) return;\r\n\r\n const img = new Image();\r\n img.onload = () => {\r\n this.resizeImage(editor, {\r\n width: img.naturalWidth,\r\n height: img.naturalHeight,\r\n });\r\n };\r\n img.src = editor.getAttributes(\"resizableImage\")[\"src\"];\r\n }\r\n\r\n // Méthode pour redimensionner librement (sans maintenir le ratio)\r\n resizeImageFreely(editor: Editor, width: number, height: number): void {\r\n this.resizeImage(editor, {\r\n width,\r\n height,\r\n maintainAspectRatio: false,\r\n });\r\n }\r\n\r\n // Méthode pour obtenir les dimensions actuelles de l'image\r\n getImageDimensions(editor: Editor): { width: number; height: number } | null {\r\n if (!editor.isActive(\"resizableImage\")) return null;\r\n\r\n const attrs = editor.getAttributes(\"resizableImage\");\r\n return {\r\n width: attrs[\"width\"] || 0,\r\n height: attrs[\"height\"] || 0,\r\n };\r\n }\r\n\r\n // Méthode pour obtenir les dimensions naturelles de l'image\r\n getNaturalImageDimensions(\r\n src: string\r\n ): Promise<{ width: number; height: number }> {\r\n return new Promise((resolve, reject) => {\r\n const img = new Image();\r\n img.onload = () => {\r\n resolve({ width: img.naturalWidth, height: img.naturalHeight });\r\n };\r\n img.onerror = () => {\r\n reject(new Error(this.t().loadError));\r\n };\r\n img.src = src;\r\n });\r\n }\r\n\r\n deleteImage(editor: Editor): void {\r\n if (editor.isActive(\"resizableImage\")) {\r\n editor.chain().focus().deleteSelection().run();\r\n this.clearSelection();\r\n }\r\n }\r\n\r\n // Méthodes utilitaires\r\n private updateSelectedImage(attributes: Partial<ImageData>): void {\r\n const current = this.selectedImage();\r\n if (current) {\r\n this.selectedImage.set({ ...current, ...attributes });\r\n }\r\n }\r\n\r\n // Validation des images\r\n validateImage(\r\n file: File,\r\n maxSize: number = 5 * 1024 * 1024\r\n ): { valid: boolean; error?: string } {\r\n if (!file.type.startsWith(\"image/\")) {\r\n return { valid: false, error: this.t().invalidFileType };\r\n }\r\n\r\n if (file.size > maxSize) {\r\n return {\r\n valid: false,\r\n error: `${this.t().imageTooLarge} (max ${maxSize / 1024 / 1024}MB)`,\r\n };\r\n }\r\n\r\n return { valid: true };\r\n }\r\n\r\n // Compression d'image\r\n async compressImage(\r\n file: File,\r\n quality: number = 0.8,\r\n maxWidth: number = 1920,\r\n maxHeight: number = 1080\r\n ): Promise<ImageUploadResult> {\r\n return new Promise((resolve, reject) => {\r\n const canvas = document.createElement(\"canvas\");\r\n const ctx = canvas.getContext(\"2d\");\r\n const img = new Image();\r\n\r\n img.onload = () => {\r\n // Mise à jour du progrès\r\n if (this.isUploading()) {\r\n this.uploadProgress.set(40);\r\n this.uploadMessage.set(this.t().resizing);\r\n this.forceEditorUpdate();\r\n }\r\n\r\n let { width, height } = img;\r\n\r\n // Redimensionner si nécessaire\r\n if (width > maxWidth || height > maxHeight) {\r\n const ratio = Math.min(maxWidth / width, maxHeight / height);\r\n width *= ratio;\r\n height *= ratio;\r\n }\r\n\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n // Dessiner l'image redimensionnée\r\n ctx?.drawImage(img, 0, 0, width, height);\r\n\r\n // Mise à jour du progrès\r\n if (this.isUploading()) {\r\n this.uploadProgress.set(60);\r\n this.uploadMessage.set(this.t().compressing);\r\n this.forceEditorUpdate();\r\n }\r\n\r\n // Convertir en base64 avec compression\r\n canvas.toBlob(\r\n (blob) => {\r\n if (blob) {\r\n const reader = new FileReader();\r\n reader.onload = (e) => {\r\n const base64 = e.target?.result as string;\r\n if (base64) {\r\n const result: ImageUploadResult = {\r\n src: base64,\r\n name: file.name,\r\n size: blob.size,\r\n type: file.type,\r\n width: Math.round(width),\r\n height: Math.round(height),\r\n originalSize: file.size,\r\n };\r\n resolve(result);\r\n } else {\r\n reject(new Error(this.t().compressionError));\r\n }\r\n };\r\n reader.readAsDataURL(blob);\r\n } else {\r\n reject(new Error(this.t().compressionError));\r\n }\r\n },\r\n file.type,\r\n quality\r\n );\r\n };\r\n\r\n img.onerror = () =>\r\n reject(new Error(this.t().loadError));\r\n img.src = URL.createObjectURL(file);\r\n });\r\n }\r\n\r\n // Méthode privée générique pour uploader avec progression\r\n private async uploadImageWithProgress(\r\n editor: Editor,\r\n file: File,\r\n insertionStrategy: (editor: Editor, result: ImageUploadResult) => void,\r\n actionMessage: string,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n }\r\n ): Promise<void> {\r\n try {\r\n // Stocker la référence à l'éditeur\r\n this.currentEditor = editor;\r\n\r\n this.isUploading.set(true);\r\n this.uploadProgress.set(0);\r\n this.uploadMessage.set(this.t().validating);\r\n this.forceEditorUpdate();\r\n\r\n // Validation\r\n const validation = this.validateImage(file);\r\n if (!validation.valid) {\r\n throw new Error(validation.error);\r\n }\r\n\r\n this.uploadProgress.set(20);\r\n this.uploadMessage.set(this.t().compressing);\r\n this.forceEditorUpdate();\r\n\r\n // Petit délai pour permettre à l'utilisateur de voir la progression\r\n await new Promise((resolve) => setTimeout(resolve, 200));\r\n\r\n const result = await this.compressImage(\r\n file,\r\n options?.quality || 0.8,\r\n options?.maxWidth || 1920,\r\n options?.maxHeight || 1080\r\n );\r\n\r\n this.uploadProgress.set(80);\r\n\r\n // Si un handler personnalisé est défini, l'utiliser pour l'upload\r\n if (this.uploadHandler) {\r\n this.uploadMessage.set(this.t().uploadingToServer);\r\n this.forceEditorUpdate();\r\n\r\n try {\r\n const handlerResponse = this.uploadHandler({\r\n file,\r\n width: result.width || 0,\r\n height: result.height || 0,\r\n type: result.type,\r\n base64: result.src,\r\n });\r\n\r\n // Convertir Observable en Promise si nécessaire\r\n const handlerResult = isObservable(handlerResponse)\r\n ? await firstValueFrom(handlerResponse)\r\n : await handlerResponse;\r\n\r\n // Remplacer le src base64 par l'URL retournée par le handler\r\n result.src = handlerResult.src;\r\n\r\n // Appliquer les overrides optionnels du handler\r\n if (handlerResult.alt) {\r\n result.name = handlerResult.alt;\r\n }\r\n } catch (handlerError) {\r\n console.error(this.t().uploadError, handlerError);\r\n throw handlerError;\r\n }\r\n }\r\n\r\n this.uploadMessage.set(actionMessage);\r\n this.forceEditorUpdate();\r\n\r\n // Petit délai pour l'action\r\n await new Promise((resolve) => setTimeout(resolve, 100));\r\n\r\n // Exécuter la stratégie d'insertion\r\n insertionStrategy(editor, result);\r\n\r\n // L'action est terminée, maintenant on peut cacher l'indicateur\r\n this.isUploading.set(false);\r\n this.uploadProgress.set(0);\r\n this.uploadMessage.set(\"\");\r\n this.forceEditorUpdate();\r\n this.currentEditor = null;\r\n } catch (error) {\r\n this.isUploading.set(false);\r\n this.uploadProgress.set(0);\r\n this.uploadMessage.set(\"\");\r\n this.forceEditorUpdate();\r\n this.currentEditor = null;\r\n console.error(this.t().uploadError, error);\r\n throw error;\r\n }\r\n }\r\n\r\n // Méthode unifiée pour uploader et insérer une image\r\n async uploadAndInsertImage(\r\n editor: Editor,\r\n file: File,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n }\r\n ): Promise<void> {\r\n return this.uploadImageWithProgress(\r\n editor,\r\n file,\r\n (editor, result) => {\r\n this.insertImage(editor, {\r\n src: result.src,\r\n alt: result.name,\r\n title: `${result.name} (${result.width}×${result.height})`,\r\n width: result.width,\r\n height: result.height,\r\n });\r\n },\r\n this.t().insertingImage,\r\n options\r\n );\r\n }\r\n\r\n // Méthode pour forcer la mise à jour de l'éditeur\r\n private forceEditorUpdate() {\r\n if (this.currentEditor) {\r\n // Déclencher une transaction vide pour forcer la mise à jour des décorations\r\n const { tr } = this.currentEditor.state;\r\n this.currentEditor.view.dispatch(tr);\r\n }\r\n }\r\n\r\n // Méthode privée générique pour créer un sélecteur de fichier\r\n private async selectFileAndProcess(\r\n editor: Editor,\r\n uploadMethod: (editor: Editor, file: File, options?: any) => Promise<void>,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n accept?: string;\r\n }\r\n ): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n const input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = options?.accept || \"image/*\";\r\n input.style.display = \"none\";\r\n\r\n input.addEventListener(\"change\", async (e) => {\r\n const file = (e.target as HTMLInputElement).files?.[0];\r\n if (file && file.type.startsWith(\"image/\")) {\r\n try {\r\n await uploadMethod(editor, file, options);\r\n resolve();\r\n } catch (error) {\r\n reject(error);\r\n }\r\n } else {\r\n reject(new Error(this.t().noFileSelected));\r\n }\r\n document.body.removeChild(input);\r\n });\r\n\r\n input.addEventListener(\"cancel\", () => {\r\n document.body.removeChild(input);\r\n reject(new Error(this.t().selectionCancelled));\r\n });\r\n\r\n document.body.appendChild(input);\r\n input.click();\r\n });\r\n }\r\n\r\n // Méthode pour créer un sélecteur de fichier et uploader une image\r\n async selectAndUploadImage(\r\n editor: Editor,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n accept?: string;\r\n }\r\n ): Promise<void> {\r\n return this.selectFileAndProcess(\r\n editor,\r\n this.uploadAndInsertImage.bind(this),\r\n options\r\n );\r\n }\r\n\r\n // Méthode pour sélectionner et remplacer une image existante\r\n async selectAndReplaceImage(\r\n editor: Editor,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n accept?: string;\r\n }\r\n ): Promise<void> {\r\n return this.selectFileAndProcess(\r\n editor,\r\n this.uploadAndReplaceImage.bind(this),\r\n options\r\n );\r\n }\r\n\r\n // Méthode pour remplacer une image existante avec indicateur de progression\r\n async uploadAndReplaceImage(\r\n editor: Editor,\r\n file: File,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n }\r\n ): Promise<void> {\r\n // Sauvegarder les attributs de l'image actuelle pour restauration en cas d'échec\r\n const currentImageAttrs = editor.getAttributes(\"resizableImage\");\r\n const backupImage = { ...currentImageAttrs };\r\n\r\n try {\r\n // Supprimer visuellement l'ancienne image immédiatement\r\n editor.chain().focus().deleteSelection().run();\r\n\r\n await this.uploadImageWithProgress(\r\n editor,\r\n file,\r\n (editor, result) => {\r\n this.insertImage(editor, {\r\n src: result.src,\r\n alt: result.name,\r\n title: `${result.name} (${result.width}×${result.height})`,\r\n width: result.width,\r\n height: result.height,\r\n });\r\n },\r\n this.t().replacingImage,\r\n options\r\n );\r\n } catch (error) {\r\n // En cas d'erreur, restaurer l'image originale si elle existait\r\n if (backupImage[\"src\"]) {\r\n this.insertImage(editor, {\r\n src: backupImage[\"src\"] as string,\r\n alt: (backupImage[\"alt\"] as string) || \"\",\r\n title: (backupImage[\"title\"] as string) || \"\",\r\n width: backupImage[\"width\"] as number,\r\n height: backupImage[\"height\"] as number,\r\n });\r\n }\r\n console.error(\"Error during image replacement:\", error);\r\n throw error;\r\n }\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n computed,\r\n inject,\r\n effect,\r\n} from \"@angular/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\nimport { ImageService } from \"./services/image.service\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { ImageBubbleMenuConfig } from \"./models/bubble-menu.model\";\r\n\r\n@Component({\r\n selector: \"tiptap-image-bubble-menu\",\r\n standalone: true,\r\n imports: [TiptapButtonComponent, TiptapSeparatorComponent],\r\n template: `\r\n <div #menuRef class=\"bubble-menu\">\r\n @if (imageBubbleMenuConfig().changeImage) {\r\n <tiptap-button\r\n icon=\"drive_file_rename_outline\"\r\n [title]=\"t().changeImage\"\r\n (click)=\"onCommand('changeImage', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().separator && hasResizeButtons()) {\r\n <tiptap-separator></tiptap-separator>\r\n } @if (imageBubbleMenuConfig().resizeSmall) {\r\n <tiptap-button\r\n icon=\"crop_square\"\r\n iconSize=\"small\"\r\n [title]=\"t().resizeSmall\"\r\n (click)=\"onCommand('resizeSmall', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().resizeMedium) {\r\n <tiptap-button\r\n icon=\"crop_square\"\r\n iconSize=\"medium\"\r\n [title]=\"t().resizeMedium\"\r\n (click)=\"onCommand('resizeMedium', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().resizeLarge) {\r\n <tiptap-button\r\n icon=\"crop_square\"\r\n iconSize=\"large\"\r\n [title]=\"t().resizeLarge\"\r\n (click)=\"onCommand('resizeLarge', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().resizeOriginal) {\r\n <tiptap-button\r\n icon=\"photo_size_select_actual\"\r\n [title]=\"t().resizeOriginal\"\r\n (click)=\"onCommand('resizeOriginal', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().separator &&\r\n imageBubbleMenuConfig().deleteImage) {\r\n <tiptap-separator></tiptap-separator>\r\n } @if (imageBubbleMenuConfig().deleteImage) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n [title]=\"t().deleteImage\"\r\n variant=\"danger\"\r\n (click)=\"onCommand('deleteImage', $event)\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n styles: [],\r\n})\r\nexport class TiptapImageBubbleMenuComponent implements OnInit, OnDestroy {\r\n readonly i18nService = inject(TiptapI18nService);\r\n readonly t = this.i18nService.imageUpload;\r\n\r\n editor = input.required<Editor>();\r\n config = input<ImageBubbleMenuConfig>({\r\n changeImage: true,\r\n resizeSmall: true,\r\n resizeMedium: true,\r\n resizeLarge: true,\r\n resizeOriginal: true,\r\n deleteImage: true,\r\n separator: true,\r\n });\r\n\r\n @ViewChild(\"menuRef\", { static: false }) menuRef!: ElementRef<HTMLDivElement>;\r\n\r\n private tippyInstance: TippyInstance | null = null;\r\n private imageService = inject(ImageService);\r\n private updateTimeout: any = null;\r\n\r\n imageBubbleMenuConfig = computed(() => ({\r\n changeImage: true,\r\n resizeSmall: true,\r\n resizeMedium: true,\r\n resizeLarge: true,\r\n resizeOriginal: true,\r\n deleteImage: true,\r\n separator: true,\r\n ...this.config(),\r\n }));\r\n\r\n hasResizeButtons = computed(() => {\r\n const config = this.imageBubbleMenuConfig();\r\n return (\r\n config.resizeSmall ||\r\n config.resizeMedium ||\r\n config.resizeLarge ||\r\n config.resizeOriginal\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n // Nettoyer les anciens listeners\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n ed.on(\"selectionUpdate\", this.updateMenu);\r\n ed.on(\"transaction\", this.updateMenu);\r\n ed.on(\"focus\", this.updateMenu);\r\n ed.on(\"blur\", this.handleBlur);\r\n\r\n // Ne pas appeler updateMenu() ici pour éviter l'affichage prématuré\r\n // Il sera appelé automatiquement quand l'éditeur sera prêt\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n // Initialiser Tippy de manière synchrone après que le component soit ready\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n // Nettoyer les timeouts\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n // Nettoyer Tippy\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n this.tippyInstance = null;\r\n }\r\n }\r\n\r\n private initTippy() {\r\n // Attendre que l'élément soit disponible\r\n if (!this.menuRef?.nativeElement) {\r\n setTimeout(() => this.initTippy(), 50);\r\n return;\r\n }\r\n\r\n const menuElement = this.menuRef.nativeElement;\r\n\r\n // S'assurer qu'il n'y a pas déjà une instance\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"top-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getImageRect(),\r\n // Améliorer le positionnement avec scroll\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getImageRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n // Trouver l'image sélectionnée dans le DOM\r\n const { from } = ed.state.selection;\r\n\r\n // Fonction pour trouver toutes les images dans l'éditeur\r\n const getAllImages = (): HTMLImageElement[] => {\r\n const editorElement = ed.view.dom;\r\n return Array.from(editorElement.querySelectorAll(\"img\"));\r\n };\r\n\r\n // Fonction pour trouver l'image à la position spécifique\r\n const findImageAtPosition = (): HTMLImageElement | null => {\r\n const allImages = getAllImages();\r\n\r\n for (const img of allImages) {\r\n try {\r\n // Obtenir la position ProseMirror de cette image\r\n const imgPos = ed.view.posAtDOM(img, 0);\r\n // Vérifier si cette image correspond à la position sélectionnée\r\n if (Math.abs(imgPos - from) <= 1) {\r\n return img;\r\n }\r\n } catch (error) {\r\n // Continuer si on ne peut pas obtenir la position de cette image\r\n continue;\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n // Chercher l'image à la position exacte\r\n const imageElement = findImageAtPosition();\r\n\r\n if (imageElement) {\r\n return imageElement.getBoundingClientRect();\r\n }\r\n\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const isImageSelected =\r\n ed.isActive(\"resizableImage\") || ed.isActive(\"image\");\r\n\r\n // Ne montrer le menu image que si :\r\n // - Une image est sélectionnée\r\n // - L'éditeur est éditable\r\n const shouldShow = isImageSelected && ed.isEditable;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n this.hideTippy();\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n this.hideTippy();\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Cette méthode peut être étendue pour fermer d'autres menus si nécessaire\r\n // Pour l'instant, elle sert de placeholder pour une future coordination entre menus\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getImageRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n }\r\n\r\n private hideTippy() {\r\n if (this.tippyInstance) {\r\n this.tippyInstance.hide();\r\n }\r\n }\r\n\r\n onCommand(command: string, event: MouseEvent) {\r\n event.preventDefault();\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n switch (command) {\r\n case \"changeImage\":\r\n this.changeImage();\r\n break;\r\n case \"resizeSmall\":\r\n this.imageService.resizeImageToSmall(ed);\r\n break;\r\n case \"resizeMedium\":\r\n this.imageService.resizeImageToMedium(ed);\r\n break;\r\n case \"resizeLarge\":\r\n this.imageService.resizeImageToLarge(ed);\r\n break;\r\n case \"resizeOriginal\":\r\n this.imageService.resizeImageToOriginal(ed);\r\n break;\r\n case \"deleteImage\":\r\n this.deleteImage();\r\n break;\r\n }\r\n }\r\n\r\n private async changeImage() {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n try {\r\n // Utiliser la méthode spécifique pour remplacer une image existante\r\n await this.imageService.selectAndReplaceImage(ed, {\r\n quality: 0.8,\r\n maxWidth: 1920,\r\n maxHeight: 1080,\r\n accept: \"image/*\",\r\n });\r\n } catch (error) {\r\n console.error(this.i18nService.imageUpload().uploadError, error);\r\n }\r\n }\r\n\r\n private deleteImage() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.chain().focus().deleteSelection().run();\r\n }\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { Editor } from \"@tiptap/core\";\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class EditorCommandsService {\r\n // Méthodes pour vérifier l'état actif\r\n isActive(\r\n editor: Editor,\r\n name: string,\r\n attributes?: Record<string, any>\r\n ): boolean {\r\n return editor.isActive(name, attributes);\r\n }\r\n\r\n // Méthodes pour vérifier si une commande peut être exécutée\r\n canExecute(editor: Editor, command: string): boolean {\r\n if (!editor) return false;\r\n\r\n switch (command) {\r\n case \"toggleBold\":\r\n return editor.can().chain().focus().toggleBold().run();\r\n case \"toggleItalic\":\r\n return editor.can().chain().focus().toggleItalic().run();\r\n case \"toggleStrike\":\r\n return editor.can().chain().focus().toggleStrike().run();\r\n case \"toggleCode\":\r\n return editor.can().chain().focus().toggleCode().run();\r\n case \"toggleUnderline\":\r\n return editor.can().chain().focus().toggleUnderline().run();\r\n case \"toggleSuperscript\":\r\n return editor.can().chain().focus().toggleSuperscript().run();\r\n case \"toggleSubscript\":\r\n return editor.can().chain().focus().toggleSubscript().run();\r\n case \"setTextAlign\":\r\n return editor.can().chain().focus().setTextAlign(\"left\").run();\r\n case \"toggleLink\":\r\n return editor.can().chain().focus().toggleLink({ href: \"\" }).run();\r\n case \"insertHorizontalRule\":\r\n return editor.can().chain().focus().setHorizontalRule().run();\r\n case \"toggleHighlight\":\r\n return editor.can().chain().focus().toggleHighlight().run();\r\n case \"undo\":\r\n return editor.can().chain().focus().undo().run();\r\n case \"redo\":\r\n return editor.can().chain().focus().redo().run();\r\n case \"insertTable\":\r\n return editor.can().chain().focus().insertTable().run();\r\n case \"addColumnBefore\":\r\n return editor.can().chain().focus().addColumnBefore().run();\r\n case \"addColumnAfter\":\r\n return editor.can().chain().focus().addColumnAfter().run();\r\n case \"deleteColumn\":\r\n return editor.can().chain().focus().deleteColumn().run();\r\n case \"addRowBefore\":\r\n return editor.can().chain().focus().addRowBefore().run();\r\n case \"addRowAfter\":\r\n return editor.can().chain().focus().addRowAfter().run();\r\n case \"deleteRow\":\r\n return editor.can().chain().focus().deleteRow().run();\r\n case \"deleteTable\":\r\n return editor.can().chain().focus().deleteTable().run();\r\n case \"mergeCells\":\r\n return editor.can().chain().focus().mergeCells().run();\r\n case \"splitCell\":\r\n return editor.can().chain().focus().splitCell().run();\r\n case \"toggleHeaderColumn\":\r\n return editor.can().chain().focus().toggleHeaderColumn().run();\r\n case \"toggleHeaderRow\":\r\n return editor.can().chain().focus().toggleHeaderRow().run();\r\n case \"toggleHeaderCell\":\r\n return editor.can().chain().focus().toggleHeaderCell().run();\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n // Méthodes pour exécuter les commandes\r\n toggleBold(editor: Editor): void {\r\n editor.chain().focus().toggleBold().run();\r\n }\r\n\r\n toggleItalic(editor: Editor): void {\r\n editor.chain().focus().toggleItalic().run();\r\n }\r\n\r\n toggleStrike(editor: Editor): void {\r\n editor.chain().focus().toggleStrike().run();\r\n }\r\n\r\n toggleCode(editor: Editor): void {\r\n editor.chain().focus().toggleCode().run();\r\n }\r\n\r\n toggleHeading(editor: Editor, level: 1 | 2 | 3): void {\r\n editor.chain().focus().toggleHeading({ level }).run();\r\n }\r\n\r\n toggleBulletList(editor: Editor): void {\r\n editor.chain().focus().toggleBulletList().run();\r\n }\r\n\r\n toggleOrderedList(editor: Editor): void {\r\n editor.chain().focus().toggleOrderedList().run();\r\n }\r\n\r\n toggleBlockquote(editor: Editor): void {\r\n editor.chain().focus().toggleBlockquote().run();\r\n }\r\n\r\n undo(editor: Editor): void {\r\n editor.chain().focus().undo().run();\r\n }\r\n\r\n redo(editor: Editor): void {\r\n editor.chain().focus().redo().run();\r\n }\r\n\r\n // Nouvelles méthodes pour les formatages supplémentaires\r\n toggleUnderline(editor: Editor): void {\r\n editor.chain().focus().toggleUnderline().run();\r\n }\r\n\r\n toggleSuperscript(editor: Editor): void {\r\n editor.chain().focus().toggleSuperscript().run();\r\n }\r\n\r\n toggleSubscript(editor: Editor): void {\r\n editor.chain().focus().toggleSubscript().run();\r\n }\r\n\r\n setTextAlign(\r\n editor: Editor,\r\n alignment: \"left\" | \"center\" | \"right\" | \"justify\"\r\n ): void {\r\n editor.chain().focus().setTextAlign(alignment).run();\r\n }\r\n\r\n toggleLink(editor: Editor, url?: string): void {\r\n if (url) {\r\n editor.chain().focus().toggleLink({ href: url }).run();\r\n } else {\r\n // Si pas d'URL fournie, on demande à l'utilisateur\r\n const href = window.prompt(\"URL du lien:\");\r\n if (href) {\r\n editor.chain().focus().toggleLink({ href }).run();\r\n }\r\n }\r\n }\r\n\r\n insertHorizontalRule(editor: Editor): void {\r\n editor.chain().focus().setHorizontalRule().run();\r\n }\r\n\r\n toggleHighlight(editor: Editor, color?: string): void {\r\n if (color) {\r\n editor.chain().focus().toggleHighlight({ color }).run();\r\n } else {\r\n editor.chain().focus().toggleHighlight().run();\r\n }\r\n }\r\n\r\n // Table commands\r\n insertTable(editor: Editor, rows: number = 3, cols: number = 3): void {\r\n editor.chain().focus().insertTable({ rows, cols }).run();\r\n }\r\n\r\n addColumnBefore(editor: Editor): void {\r\n editor.chain().focus().addColumnBefore().run();\r\n }\r\n\r\n addColumnAfter(editor: Editor): void {\r\n editor.chain().focus().addColumnAfter().run();\r\n }\r\n\r\n deleteColumn(editor: Editor): void {\r\n editor.chain().focus().deleteColumn().run();\r\n }\r\n\r\n addRowBefore(editor: Editor): void {\r\n editor.chain().focus().addRowBefore().run();\r\n }\r\n\r\n addRowAfter(editor: Editor): void {\r\n editor.chain().focus().addRowAfter().run();\r\n }\r\n\r\n deleteRow(editor: Editor): void {\r\n editor.chain().focus().deleteRow().run();\r\n }\r\n\r\n deleteTable(editor: Editor): void {\r\n editor.chain().focus().deleteTable().run();\r\n }\r\n\r\n mergeCells(editor: Editor): void {\r\n editor.chain().focus().mergeCells().run();\r\n }\r\n\r\n splitCell(editor: Editor): void {\r\n editor.chain().focus().splitCell().run();\r\n }\r\n\r\n toggleHeaderColumn(editor: Editor): void {\r\n editor.chain().focus().toggleHeaderColumn().run();\r\n }\r\n\r\n toggleHeaderRow(editor: Editor): void {\r\n editor.chain().focus().toggleHeaderRow().run();\r\n }\r\n\r\n toggleHeaderCell(editor: Editor): void {\r\n editor.chain().focus().toggleHeaderCell().run();\r\n }\r\n\r\n // Méthode pour vider le contenu\r\n clearContent(editor: Editor): void {\r\n editor.commands.setContent(\"\", true);\r\n }\r\n\r\n // Méthodes de base de l'éditeur\r\n focus(editor: Editor): void {\r\n editor.chain().focus().run();\r\n }\r\n\r\n blur(editor: Editor): void {\r\n editor.chain().blur().run();\r\n }\r\n\r\n setContent(editor: Editor, content: string, emitUpdate = true): void {\r\n editor.commands.setContent(content, emitUpdate);\r\n }\r\n\r\n setEditable(editor: Editor, editable: boolean): void {\r\n editor.setEditable(editable);\r\n }\r\n\r\n insertContent(editor: Editor, content: string): void {\r\n editor.chain().focus().insertContent(content).run();\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n inject,\r\n} from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\nimport { TableBubbleMenuConfig } from \"./models/bubble-menu.model\";\r\n\r\n@Component({\r\n selector: \"tiptap-table-bubble-menu\",\r\n standalone: true,\r\n imports: [CommonModule, TiptapButtonComponent, TiptapSeparatorComponent],\r\n template: `\r\n <div #menuElement class=\"bubble-menu\">\r\n <!-- Actions de lignes -->\r\n @if (config().addRowBefore !== false) {\r\n <tiptap-button\r\n icon=\"add_row_above\"\r\n title=\"{{ t().addRowBefore }}\"\r\n (click)=\"addRowBefore()\"\r\n ></tiptap-button>\r\n } @if (config().addRowAfter !== false) {\r\n <tiptap-button\r\n icon=\"add_row_below\"\r\n title=\"{{ t().addRowAfter }}\"\r\n (click)=\"addRowAfter()\"\r\n ></tiptap-button>\r\n } @if (config().deleteRow !== false) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n title=\"{{ t().deleteRow }}\"\r\n variant=\"danger\"\r\n (click)=\"deleteRow()\"\r\n ></tiptap-button>\r\n } @if (config().separator !== false) {\r\n <tiptap-separator></tiptap-separator>\r\n }\r\n\r\n <!-- Actions de colonnes -->\r\n @if (config().addColumnBefore !== false) {\r\n <tiptap-button\r\n icon=\"add_column_left\"\r\n title=\"{{ t().addColumnBefore }}\"\r\n (click)=\"addColumnBefore()\"\r\n ></tiptap-button>\r\n } @if (config().addColumnAfter !== false) {\r\n <tiptap-button\r\n icon=\"add_column_right\"\r\n title=\"{{ t().addColumnAfter }}\"\r\n (click)=\"addColumnAfter()\"\r\n ></tiptap-button>\r\n } @if (config().deleteColumn !== false) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n title=\"{{ t().deleteColumn }}\"\r\n variant=\"danger\"\r\n (click)=\"deleteColumn()\"\r\n ></tiptap-button>\r\n } @if (config().separator !== false) {\r\n <tiptap-separator></tiptap-separator>\r\n }\r\n\r\n <!-- Actions de cellules -->\r\n @if (config().toggleHeaderRow !== false) {\r\n <tiptap-button\r\n icon=\"toolbar\"\r\n title=\"{{ t().toggleHeaderRow }}\"\r\n (click)=\"toggleHeaderRow()\"\r\n ></tiptap-button>\r\n } @if (config().toggleHeaderColumn !== false) {\r\n <tiptap-button\r\n icon=\"dock_to_right\"\r\n title=\"{{ t().toggleHeaderColumn }}\"\r\n (click)=\"toggleHeaderColumn()\"\r\n ></tiptap-button>\r\n } @if (config().separator !== false && config().deleteTable !== false) {\r\n <tiptap-separator></tiptap-separator>\r\n }\r\n\r\n <!-- Actions de table -->\r\n @if (config().deleteTable !== false) {\r\n <tiptap-button\r\n icon=\"delete_forever\"\r\n title=\"{{ t().deleteTable }}\"\r\n variant=\"danger\"\r\n (click)=\"deleteTable()\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n styles: [],\r\n})\r\nexport class TiptapTableBubbleMenuComponent implements OnInit, OnDestroy {\r\n @ViewChild(\"menuElement\", { static: true }) menuElement!: ElementRef;\r\n\r\n // Inputs\r\n editor = input.required<Editor>();\r\n config = input<TableBubbleMenuConfig>({});\r\n\r\n // Services\r\n private i18nService = inject(TiptapI18nService);\r\n private commandsService = inject(EditorCommandsService);\r\n\r\n // Tippy instance\r\n private tippyInstance: TippyInstance | null = null;\r\n private updateTimeout: any = null;\r\n\r\n // Signaux\r\n readonly t = this.i18nService.table;\r\n\r\n constructor() {\r\n // Effet pour mettre à jour le menu quand l'éditeur change\r\n effect(() => {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les anciens listeners\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n editor.on(\"selectionUpdate\", this.updateMenu);\r\n editor.on(\"focus\", this.updateMenu);\r\n editor.on(\"blur\", this.handleBlur);\r\n }\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les événements\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n }\r\n\r\n private initTippy() {\r\n const menuElement = this.menuElement.nativeElement;\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"bottom-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n maxWidth: \"none\",\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getTableRect(),\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getTableRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n // Méthode 1: Utiliser coordsAtPos (méthode native ProseMirror)\r\n const { from } = ed.state.selection;\r\n const coords = ed.view.coordsAtPos(from);\r\n\r\n // Trouver la table qui contient cette position\r\n const editorElement = ed.view.dom;\r\n const tables = Array.from(editorElement.querySelectorAll(\"table\"));\r\n\r\n for (let i = 0; i < tables.length; i++) {\r\n const table = tables[i];\r\n try {\r\n const tableRect = table.getBoundingClientRect();\r\n\r\n // Vérifier si la position ProseMirror est dans cette table\r\n const isInside =\r\n coords.left >= tableRect.left &&\r\n coords.left <= tableRect.right &&\r\n coords.top >= tableRect.top &&\r\n coords.top <= tableRect.bottom;\r\n\r\n if (isInside) {\r\n return tableRect;\r\n }\r\n } catch (error) {\r\n continue;\r\n }\r\n }\r\n\r\n // Fallback : utiliser la méthode DOM si ProseMirror échoue\r\n const selection = window.getSelection();\r\n if (selection && selection.rangeCount > 0) {\r\n const range = selection.getRangeAt(0);\r\n const rect = range.getBoundingClientRect();\r\n\r\n if (rect.width > 0 && rect.height > 0) {\r\n return rect;\r\n }\r\n }\r\n\r\n // Dernier fallback : première table\r\n if (tables.length > 0) {\r\n return tables[0].getBoundingClientRect();\r\n }\r\n\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const isTableSelected =\r\n ed.isActive(\"table\") ||\r\n ed.isActive(\"tableCell\") ||\r\n ed.isActive(\"tableHeader\");\r\n\r\n // Vérifier s'il y a une sélection de cellules (priorité au menu de cellules)\r\n const { from, to } = ed.state.selection;\r\n const hasCellSelection = from !== to;\r\n const isTableCell =\r\n ed.isActive(\"tableCell\") || ed.isActive(\"tableHeader\");\r\n\r\n // Vérifier si la sélection traverse plusieurs cellules\r\n const selectionSize = to - from;\r\n const hasMultiCellSelection = hasCellSelection && selectionSize > 1;\r\n\r\n // Ne montrer le menu de table que si :\r\n // 1. Une table est sélectionnée\r\n // 2. L'éditeur est éditable\r\n // 3. Il n'y a PAS de sélection de cellules (priorité au menu de cellules)\r\n // 4. Il n'y a PAS de sélection multi-cellules\r\n const shouldShow =\r\n isTableSelected &&\r\n ed.isEditable &&\r\n !(hasCellSelection && isTableCell) &&\r\n !hasMultiCellSelection;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n this.hideTippy();\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n this.hideTippy();\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Cette méthode peut être étendue pour fermer d'autres menus si nécessaire\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getTableRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n }\r\n\r\n hideTippy() {\r\n if (!this.tippyInstance) return;\r\n this.tippyInstance.hide();\r\n }\r\n\r\n // Actions de lignes\r\n addRowBefore() {\r\n this.commandsService.addRowBefore(this.editor());\r\n }\r\n\r\n addRowAfter() {\r\n this.commandsService.addRowAfter(this.editor());\r\n }\r\n\r\n deleteRow() {\r\n this.commandsService.deleteRow(this.editor());\r\n }\r\n\r\n // Actions de colonnes\r\n addColumnBefore() {\r\n this.commandsService.addColumnBefore(this.editor());\r\n }\r\n\r\n addColumnAfter() {\r\n this.commandsService.addColumnAfter(this.editor());\r\n }\r\n\r\n deleteColumn() {\r\n this.commandsService.deleteColumn(this.editor());\r\n }\r\n\r\n // Actions de headers\r\n toggleHeaderRow() {\r\n this.commandsService.toggleHeaderRow(this.editor());\r\n }\r\n\r\n toggleHeaderColumn() {\r\n this.commandsService.toggleHeaderColumn(this.editor());\r\n }\r\n\r\n // Actions de table\r\n deleteTable() {\r\n this.commandsService.deleteTable(this.editor());\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n inject,\r\n} from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { CellSelection } from \"@tiptap/pm/tables\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\n\r\nexport interface CellBubbleMenuConfig {\r\n mergeCells?: boolean;\r\n splitCell?: boolean;\r\n}\r\n\r\n@Component({\r\n selector: \"tiptap-cell-bubble-menu\",\r\n standalone: true,\r\n imports: [CommonModule, TiptapButtonComponent],\r\n template: `\r\n <div #menuElement class=\"bubble-menu\">\r\n <!-- Actions spécifiques aux cellules -->\r\n @if (config().mergeCells !== false && !isSingleCellSelected) {\r\n <tiptap-button\r\n icon=\"cell_merge\"\r\n title=\"{{ i18n.table().mergeCells }}\"\r\n (click)=\"mergeCells()\"\r\n ></tiptap-button>\r\n } @if (config().splitCell !== false && isSingleCellSelected) {\r\n <tiptap-button\r\n icon=\"split_scene\"\r\n title=\"{{ i18n.table().splitCell }}\"\r\n (click)=\"splitCell()\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n styles: [],\r\n})\r\nexport class TiptapCellBubbleMenuComponent implements OnInit, OnDestroy {\r\n @ViewChild(\"menuElement\", { static: true }) menuElement!: ElementRef;\r\n\r\n // Inputs\r\n editor = input.required<Editor>();\r\n config = input<CellBubbleMenuConfig>({});\r\n\r\n // Services\r\n private i18nService = inject(TiptapI18nService);\r\n private commandsService = inject(EditorCommandsService);\r\n\r\n // Tippy instance\r\n private tippyInstance: TippyInstance | null = null;\r\n private updateTimeout: any = null;\r\n\r\n // Signaux\r\n readonly i18n = this.i18nService;\r\n isSingleCellSelected: boolean = false;\r\n\r\n constructor() {\r\n // Effet pour mettre à jour le menu quand l'éditeur change\r\n effect(() => {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les anciens listeners\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n editor.on(\"selectionUpdate\", this.updateMenu);\r\n editor.on(\"focus\", this.updateMenu);\r\n editor.on(\"blur\", this.handleBlur);\r\n }\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les événements\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n }\r\n\r\n private initTippy() {\r\n const menuElement = this.menuElement.nativeElement;\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"top-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getCellRect(),\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getCellRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n // Détecter la sélection de cellules\r\n const { from, to } = ed.state.selection;\r\n const hasCellSelection = from !== to;\r\n\r\n if (!hasCellSelection) {\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n // Obtenir les coordonnées de la sélection\r\n const coords = ed.view.coordsAtPos(from);\r\n const endCoords = ed.view.coordsAtPos(to);\r\n\r\n // Créer un rectangle englobant la sélection\r\n const rect = new DOMRect(\r\n Math.min(coords.left, endCoords.left),\r\n Math.min(coords.top, endCoords.top),\r\n Math.abs(endCoords.left - coords.left),\r\n Math.abs(endCoords.top - coords.top)\r\n );\r\n\r\n return rect;\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const { selection } = ed.state;\r\n const { from, to } = selection;\r\n\r\n // Détecter spécifiquement la sélection de CELLULES (pas de texte)\r\n const hasCellSelection = selection instanceof CellSelection;\r\n // Une seule cellule si ancre et tête pointent vers la même cellule\r\n this.isSingleCellSelected =\r\n hasCellSelection &&\r\n (selection as CellSelection).$anchorCell.pos ===\r\n (selection as CellSelection).$headCell.pos;\r\n const hasTextSelection =\r\n !selection.empty && !(selection instanceof CellSelection);\r\n const isTableCell =\r\n ed.isActive(\"tableCell\") || ed.isActive(\"tableHeader\");\r\n\r\n\r\n // Le menu de cellule ne s'affiche QUE pour les sélections de cellules multiples\r\n // (pas pour la sélection de texte dans une cellule)\r\n const shouldShow = hasCellSelection && isTableCell && ed.isEditable;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n this.hideTippy();\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n this.hideTippy();\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Masquer tous les autres menus quand le menu de cellules est actif\r\n this.hideTableMenu();\r\n this.hideTextBubbleMenu();\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Masquer les autres menus avant d'afficher le menu de cellules\r\n this.hideTableMenu();\r\n this.hideTextBubbleMenu();\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getCellRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n }\r\n\r\n private hideTableMenu() {\r\n // Masquer le menu de table quand le menu de cellules est actif\r\n const tableMenu = document.querySelector(\"tiptap-table-bubble-menu\");\r\n if (tableMenu) {\r\n const tippyInstance = (tableMenu as any)._tippy;\r\n if (tippyInstance) {\r\n tippyInstance.hide();\r\n }\r\n }\r\n\r\n // Alternative : masquer via l'élément Angular\r\n const tableMenuComponent = document.querySelector(\r\n \"tiptap-table-bubble-menu\"\r\n ) as any;\r\n if (tableMenuComponent && tableMenuComponent.hideTippy) {\r\n tableMenuComponent.hideTippy();\r\n }\r\n }\r\n\r\n private hideTextBubbleMenu() {\r\n // Masquer le menu de texte (bubble menu général) quand le menu de cellules est actif\r\n const textMenu = document.querySelector(\"tiptap-bubble-menu\");\r\n if (textMenu) {\r\n const tippyInstance = (textMenu as any)._tippy;\r\n if (tippyInstance) {\r\n tippyInstance.hide();\r\n }\r\n }\r\n\r\n // Alternative : masquer via l'élément Angular\r\n const textMenuComponent = document.querySelector(\r\n \"tiptap-bubble-menu\"\r\n ) as any;\r\n if (textMenuComponent && textMenuComponent.hideTippy) {\r\n textMenuComponent.hideTippy();\r\n }\r\n }\r\n\r\n hideTippy() {\r\n if (!this.tippyInstance) return;\r\n this.tippyInstance.hide();\r\n }\r\n\r\n // Actions spécifiques aux cellules\r\n mergeCells() {\r\n this.commandsService.mergeCells(this.editor());\r\n }\r\n\r\n splitCell() {\r\n this.commandsService.splitCell(this.editor());\r\n }\r\n}\r\n","import { Component, input, output, signal, inject } from \"@angular/core\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\nimport { ImageUploadResult, ImageService } from \"./services/image.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { TiptapTextColorPickerComponent } from \"./components/tiptap-text-color-picker.component\";\r\n\r\nexport interface ToolbarConfig {\r\n bold?: boolean;\r\n italic?: boolean;\r\n underline?: boolean;\r\n strike?: boolean;\r\n code?: boolean;\r\n superscript?: boolean;\r\n subscript?: boolean;\r\n highlight?: boolean;\r\n heading1?: boolean;\r\n heading2?: boolean;\r\n heading3?: boolean;\r\n bulletList?: boolean;\r\n orderedList?: boolean;\r\n blockquote?: boolean;\r\n alignLeft?: boolean;\r\n alignCenter?: boolean;\r\n alignRight?: boolean;\r\n alignJustify?: boolean;\r\n link?: boolean;\r\n image?: boolean;\r\n horizontalRule?: boolean;\r\n table?: boolean;\r\n undo?: boolean;\r\n redo?: boolean;\r\n clear?: boolean;\r\n textColor?: boolean;\r\n separator?: boolean;\r\n}\r\n\r\n@Component({\r\n selector: \"tiptap-toolbar\",\r\n standalone: true,\r\n imports: [\r\n TiptapButtonComponent,\r\n TiptapSeparatorComponent,\r\n TiptapTextColorPickerComponent,\r\n ],\r\n template: `\r\n <div class=\"tiptap-toolbar\">\r\n @if (config().bold) {\r\n <tiptap-button\r\n icon=\"format_bold\"\r\n [title]=\"t().bold\"\r\n [active]=\"isActive('bold')\"\r\n [disabled]=\"!canExecute('toggleBold')\"\r\n (onClick)=\"toggleBold()\"\r\n />\r\n } @if (config().italic) {\r\n <tiptap-button\r\n icon=\"format_italic\"\r\n [title]=\"t().italic\"\r\n [active]=\"isActive('italic')\"\r\n [disabled]=\"!canExecute('toggleItalic')\"\r\n (onClick)=\"toggleItalic()\"\r\n />\r\n } @if (config().underline) {\r\n <tiptap-button\r\n icon=\"format_underlined\"\r\n [title]=\"t().underline\"\r\n [active]=\"isActive('underline')\"\r\n [disabled]=\"!canExecute('toggleUnderline')\"\r\n (onClick)=\"toggleUnderline()\"\r\n />\r\n } @if (config().strike) {\r\n <tiptap-button\r\n icon=\"strikethrough_s\"\r\n [title]=\"t().strike\"\r\n [active]=\"isActive('strike')\"\r\n [disabled]=\"!canExecute('toggleStrike')\"\r\n (onClick)=\"toggleStrike()\"\r\n />\r\n } @if (config().code) {\r\n <tiptap-button\r\n icon=\"code\"\r\n [title]=\"t().code\"\r\n [active]=\"isActive('code')\"\r\n [disabled]=\"!canExecute('toggleCode')\"\r\n (onClick)=\"toggleCode()\"\r\n />\r\n } @if (config().superscript) {\r\n <tiptap-button\r\n icon=\"superscript\"\r\n [title]=\"t().superscript\"\r\n [active]=\"isActive('superscript')\"\r\n [disabled]=\"!canExecute('toggleSuperscript')\"\r\n (onClick)=\"toggleSuperscript()\"\r\n />\r\n } @if (config().subscript) {\r\n <tiptap-button\r\n icon=\"subscript\"\r\n [title]=\"t().subscript\"\r\n [active]=\"isActive('subscript')\"\r\n [disabled]=\"!canExecute('toggleSubscript')\"\r\n (onClick)=\"toggleSubscript()\"\r\n />\r\n } @if (config().highlight) {\r\n <tiptap-button\r\n icon=\"highlight\"\r\n [title]=\"t().highlight\"\r\n [active]=\"isActive('highlight')\"\r\n [disabled]=\"!canExecute('toggleHighlight')\"\r\n (onClick)=\"toggleHighlight()\"\r\n />\r\n } @if (config().textColor) {\r\n <tiptap-text-color-picker [editor]=\"editor()\" />\r\n } @if (config().separator && (config().heading1 || config().heading2 ||\r\n config().heading3)) {\r\n <tiptap-separator />\r\n } @if (config().heading1) {\r\n <tiptap-button\r\n icon=\"format_h1\"\r\n [title]=\"t().heading1\"\r\n [active]=\"isActive('heading', { level: 1 })\"\r\n (onClick)=\"toggleHeading(1)\"\r\n />\r\n } @if (config().heading2) {\r\n <tiptap-button\r\n icon=\"format_h2\"\r\n [title]=\"t().heading2\"\r\n [active]=\"isActive('heading', { level: 2 })\"\r\n (onClick)=\"toggleHeading(2)\"\r\n />\r\n } @if (config().heading3) {\r\n <tiptap-button\r\n icon=\"format_h3\"\r\n [title]=\"t().heading3\"\r\n [active]=\"isActive('heading', { level: 3 })\"\r\n (onClick)=\"toggleHeading(3)\"\r\n />\r\n } @if (config().separator && (config().bulletList || config().orderedList\r\n || config().blockquote)) {\r\n <tiptap-separator />\r\n } @if (config().bulletList) {\r\n <tiptap-button\r\n icon=\"format_list_bulleted\"\r\n [title]=\"t().bulletList\"\r\n [active]=\"isActive('bulletList')\"\r\n (onClick)=\"toggleBulletList()\"\r\n />\r\n } @if (config().orderedList) {\r\n <tiptap-button\r\n icon=\"format_list_numbered\"\r\n [title]=\"t().orderedList\"\r\n [active]=\"isActive('orderedList')\"\r\n (onClick)=\"toggleOrderedList()\"\r\n />\r\n } @if (config().blockquote) {\r\n <tiptap-button\r\n icon=\"format_quote\"\r\n [title]=\"t().blockquote\"\r\n [active]=\"isActive('blockquote')\"\r\n (onClick)=\"toggleBlockquote()\"\r\n />\r\n } @if (config().separator && (config().alignLeft || config().alignCenter\r\n || config().alignRight || config().alignJustify)) {\r\n <tiptap-separator />\r\n } @if (config().alignLeft) {\r\n <tiptap-button\r\n icon=\"format_align_left\"\r\n [title]=\"t().alignLeft\"\r\n [active]=\"isActive('textAlign', { textAlign: 'left' })\"\r\n (onClick)=\"setTextAlign('left')\"\r\n />\r\n } @if (config().alignCenter) {\r\n <tiptap-button\r\n icon=\"format_align_center\"\r\n [title]=\"t().alignCenter\"\r\n [active]=\"isActive('textAlign', { textAlign: 'center' })\"\r\n (onClick)=\"setTextAlign('center')\"\r\n />\r\n } @if (config().alignRight) {\r\n <tiptap-button\r\n icon=\"format_align_right\"\r\n [title]=\"t().alignRight\"\r\n [active]=\"isActive('textAlign', { textAlign: 'right' })\"\r\n (onClick)=\"setTextAlign('right')\"\r\n />\r\n } @if (config().alignJustify) {\r\n <tiptap-button\r\n icon=\"format_align_justify\"\r\n [title]=\"t().alignJustify\"\r\n [active]=\"isActive('textAlign', { textAlign: 'justify' })\"\r\n (onClick)=\"setTextAlign('justify')\"\r\n />\r\n } @if (config().separator && (config().link || config().horizontalRule)) {\r\n <tiptap-separator />\r\n } @if (config().link) {\r\n <tiptap-button\r\n icon=\"link\"\r\n [title]=\"t().link\"\r\n [active]=\"isActive('link')\"\r\n (onClick)=\"toggleLink()\"\r\n />\r\n } @if (config().horizontalRule) {\r\n <tiptap-button\r\n icon=\"horizontal_rule\"\r\n [title]=\"t().horizontalRule\"\r\n (onClick)=\"insertHorizontalRule()\"\r\n />\r\n } @if (config().table) {\r\n <tiptap-button\r\n icon=\"table_view\"\r\n [title]=\"t().table\"\r\n (onClick)=\"insertTable()\"\r\n />\r\n } @if (config().separator && config().image) {\r\n <tiptap-separator />\r\n } @if (config().image) {\r\n <tiptap-button\r\n icon=\"image\"\r\n [title]=\"t().image\"\r\n (onClick)=\"insertImage()\"\r\n />\r\n } @if (config().separator && (config().undo || config().redo)) {\r\n <tiptap-separator />\r\n } @if (config().undo) {\r\n <tiptap-button\r\n icon=\"undo\"\r\n [title]=\"t().undo\"\r\n [disabled]=\"!canExecute('undo')\"\r\n (onClick)=\"undo()\"\r\n />\r\n } @if (config().redo) {\r\n <tiptap-button\r\n icon=\"redo\"\r\n [title]=\"t().redo\"\r\n [disabled]=\"!canExecute('redo')\"\r\n (onClick)=\"redo()\"\r\n />\r\n } @if (config().separator && config().clear) {\r\n <tiptap-separator />\r\n } @if (config().clear) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n [title]=\"t().clear\"\r\n (onClick)=\"clearContent()\"\r\n />\r\n }\r\n </div>\r\n `,\r\n styles: [\r\n `\r\n /* Styles de base pour la toolbar */\r\n .tiptap-toolbar {\r\n display: flex;\r\n align-items: center;\r\n gap: 4px;\r\n padding: 4px 8px;\r\n background: var(--ate-toolbar-background);\r\n border-bottom: 1px solid var(--ate-toolbar-border-color);\r\n flex-wrap: wrap;\r\n min-height: 32px;\r\n position: relative;\r\n backdrop-filter: blur(var(--ate-menu-blur, 16px));\r\n }\r\n\r\n /* Groupe de boutons */\r\n .toolbar-group {\r\n display: flex;\r\n align-items: center;\r\n gap: 2px;\r\n padding: 0 4px;\r\n }\r\n\r\n /* Séparateur entre groupes */\r\n .toolbar-separator {\r\n width: 1px;\r\n height: 24px;\r\n background: var(--ate-toolbar-border-color);\r\n margin: 0 4px;\r\n }\r\n\r\n /* Responsive */\r\n @media (max-width: 768px) {\r\n .tiptap-toolbar {\r\n padding: 6px 8px;\r\n gap: 2px;\r\n }\r\n\r\n .toolbar-group {\r\n gap: 1px;\r\n }\r\n }\r\n\r\n /* Animation d'apparition */\r\n @keyframes toolbarSlideIn {\r\n from {\r\n opacity: 0;\r\n transform: translateY(-10px);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translateY(0);\r\n }\r\n }\r\n\r\n .tiptap-toolbar {\r\n animation: toolbarSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapToolbarComponent {\r\n editor = input.required<Editor>();\r\n config = input.required<ToolbarConfig>();\r\n imageUpload = input<any>({});\r\n\r\n // Outputs pour les événements d'image\r\n imageUploaded = output<ImageUploadResult>();\r\n imageError = output<string>();\r\n\r\n private imageService = inject(ImageService);\r\n private i18nService = inject(TiptapI18nService);\r\n\r\n // Computed values pour les traductions\r\n readonly t = this.i18nService.toolbar;\r\n\r\n constructor(private editorCommands: EditorCommandsService) { }\r\n\r\n isActive(name: string, attributes?: Record<string, any>): boolean {\r\n return this.editorCommands.isActive(this.editor(), name, attributes);\r\n }\r\n\r\n canExecute(command: string): boolean {\r\n return this.editorCommands.canExecute(this.editor(), command);\r\n }\r\n\r\n toggleBold() {\r\n this.editorCommands.toggleBold(this.editor());\r\n }\r\n toggleItalic() {\r\n this.editorCommands.toggleItalic(this.editor());\r\n }\r\n toggleStrike() {\r\n this.editorCommands.toggleStrike(this.editor());\r\n }\r\n toggleCode() {\r\n this.editorCommands.toggleCode(this.editor());\r\n }\r\n toggleHeading(level: 1 | 2 | 3) {\r\n this.editorCommands.toggleHeading(this.editor(), level);\r\n }\r\n toggleBulletList() {\r\n this.editorCommands.toggleBulletList(this.editor());\r\n }\r\n toggleOrderedList() {\r\n this.editorCommands.toggleOrderedList(this.editor());\r\n }\r\n toggleBlockquote() {\r\n this.editorCommands.toggleBlockquote(this.editor());\r\n }\r\n undo() {\r\n this.editorCommands.undo(this.editor());\r\n }\r\n redo() {\r\n this.editorCommands.redo(this.editor());\r\n }\r\n\r\n // Nouvelles méthodes pour les formatages supplémentaires\r\n toggleUnderline() {\r\n this.editorCommands.toggleUnderline(this.editor());\r\n }\r\n toggleSuperscript() {\r\n this.editorCommands.toggleSuperscript(this.editor());\r\n }\r\n toggleSubscript() {\r\n this.editorCommands.toggleSubscript(this.editor());\r\n }\r\n setTextAlign(alignment: \"left\" | \"center\" | \"right\" | \"justify\") {\r\n this.editorCommands.setTextAlign(this.editor(), alignment);\r\n }\r\n toggleLink() {\r\n this.editorCommands.toggleLink(this.editor());\r\n }\r\n insertHorizontalRule() {\r\n this.editorCommands.insertHorizontalRule(this.editor());\r\n }\r\n toggleHighlight() {\r\n this.editorCommands.toggleHighlight(this.editor());\r\n }\r\n\r\n // Méthode pour insérer un tableau\r\n insertTable() {\r\n this.editorCommands.insertTable(this.editor());\r\n }\r\n\r\n // Méthode pour insérer une image\r\n async insertImage() {\r\n try {\r\n const config = this.imageUpload() || {};\r\n await this.imageService.selectAndUploadImage(this.editor(), {\r\n quality: config.quality,\r\n maxWidth: config.maxWidth,\r\n maxHeight: config.maxHeight,\r\n accept: config.allowedTypes?.join(',')\r\n });\r\n } catch (error) {\r\n console.error(this.i18nService.imageUpload().uploadError, error);\r\n this.imageError.emit(this.i18nService.imageUpload().uploadError);\r\n }\r\n }\r\n\r\n // Méthode pour vider le contenu\r\n clearContent() {\r\n this.editorCommands.clearContent(this.editor());\r\n }\r\n\r\n // Méthodes pour les événements d'image (conservées pour compatibilité)\r\n onImageSelected(result: ImageUploadResult) {\r\n this.imageUploaded.emit(result);\r\n }\r\n\r\n onImageError(error: string) {\r\n this.imageError.emit(error);\r\n }\r\n}\r\n","import { Editor } from \"@tiptap/core\";\r\nimport { SlashCommandItem } from \"../tiptap-slash-commands.component\";\r\nimport { TiptapI18nService } from \"../services/i18n.service\";\r\nimport { EditorCommandsService } from \"../services/editor-commands.service\";\r\nimport { ImageService } from \"../services/image.service\";\r\n\r\n/**\r\n * Clés des commandes natives dans l'ordre d'affichage\r\n */\r\nexport const SLASH_COMMAND_KEYS = [\r\n \"heading1\",\r\n \"heading2\",\r\n \"heading3\",\r\n \"bulletList\",\r\n \"orderedList\",\r\n \"blockquote\",\r\n \"code\",\r\n \"image\",\r\n \"horizontalRule\",\r\n \"table\",\r\n] as const;\r\n\r\nexport type SlashCommandKey = (typeof SLASH_COMMAND_KEYS)[number];\r\n\r\n/**\r\n * Configuration simplifiée pour activer/désactiver les slash commands natives.\r\n * Permet aussi d'ajouter des commandes personnalisées.\r\n */\r\nexport interface SlashCommandsConfig extends Partial<Record<SlashCommandKey, boolean>> {\r\n /**\r\n * Liste de commandes supplémentaires à ajouter à la fin du menu\r\n */\r\n custom?: SlashCommandItem[];\r\n}\r\n\r\n/**\r\n * Configuration par défaut : toutes les commandes natives sont activées\r\n */\r\nexport const DEFAULT_SLASH_COMMANDS_CONFIG: Record<SlashCommandKey, boolean> = {\r\n heading1: true,\r\n heading2: true,\r\n heading3: true,\r\n bulletList: true,\r\n orderedList: true,\r\n blockquote: true,\r\n code: true,\r\n image: true,\r\n horizontalRule: true,\r\n table: true,\r\n};\r\n\r\n/**\r\n * Factory pour créer les commandes natives avec leurs traductions et leur logique d'exécution.\r\n * Utilise les services de l'éditeur pour garantir une cohérence de comportement.\r\n */\r\nexport function createDefaultSlashCommands(\r\n i18n: TiptapI18nService,\r\n commands: EditorCommandsService,\r\n images: ImageService,\r\n imageOptions?: { quality?: number; maxWidth?: number; maxHeight?: number; allowedTypes?: string[] }\r\n): SlashCommandItem[] {\r\n const t = i18n.slashCommands();\r\n\r\n return [\r\n {\r\n title: t.heading1.title,\r\n description: t.heading1.description,\r\n icon: \"format_h1\",\r\n keywords: t.heading1.keywords,\r\n command: (editor: Editor) => commands.toggleHeading(editor, 1),\r\n },\r\n {\r\n title: t.heading2.title,\r\n description: t.heading2.description,\r\n icon: \"format_h2\",\r\n keywords: t.heading2.keywords,\r\n command: (editor: Editor) => commands.toggleHeading(editor, 2),\r\n },\r\n {\r\n title: t.heading3.title,\r\n description: t.heading3.description,\r\n icon: \"format_h3\",\r\n keywords: t.heading3.keywords,\r\n command: (editor: Editor) => commands.toggleHeading(editor, 3),\r\n },\r\n {\r\n title: t.bulletList.title,\r\n description: t.bulletList.description,\r\n icon: \"format_list_bulleted\",\r\n keywords: t.bulletList.keywords,\r\n command: (editor: Editor) => commands.toggleBulletList(editor),\r\n },\r\n {\r\n title: t.orderedList.title,\r\n description: t.orderedList.description,\r\n icon: \"format_list_numbered\",\r\n keywords: t.orderedList.keywords,\r\n command: (editor: Editor) => commands.toggleOrderedList(editor),\r\n },\r\n {\r\n title: t.blockquote.title,\r\n description: t.blockquote.description,\r\n icon: \"format_quote\",\r\n keywords: t.blockquote.keywords,\r\n command: (editor: Editor) => commands.toggleBlockquote(editor),\r\n },\r\n {\r\n title: t.code.title,\r\n description: t.code.description,\r\n icon: \"code\",\r\n keywords: t.code.keywords,\r\n command: (editor: Editor) => commands.toggleCode(editor),\r\n },\r\n {\r\n title: t.image.title,\r\n description: t.image.description,\r\n icon: \"image\",\r\n keywords: t.image.keywords,\r\n command: (editor: Editor) => images.selectAndUploadImage(editor, {\r\n quality: imageOptions?.quality,\r\n maxWidth: imageOptions?.maxWidth,\r\n maxHeight: imageOptions?.maxHeight,\r\n accept: imageOptions?.allowedTypes?.join(',')\r\n }),\r\n },\r\n {\r\n title: t.horizontalRule.title,\r\n description: t.horizontalRule.description,\r\n icon: \"horizontal_rule\",\r\n keywords: t.horizontalRule.keywords,\r\n command: (editor: Editor) => commands.insertHorizontalRule(editor),\r\n },\r\n {\r\n title: t.table.title,\r\n description: t.table.description,\r\n icon: \"table_view\",\r\n keywords: t.table.keywords,\r\n command: (editor: Editor) => commands.insertTable(editor),\r\n },\r\n ];\r\n}\r\n\r\n/**\r\n * Filtre et assemble les commandes selon la configuration fournie.\r\n */\r\nexport function filterSlashCommands(\r\n config: SlashCommandsConfig,\r\n i18n: TiptapI18nService,\r\n commands: EditorCommandsService,\r\n images: ImageService,\r\n imageOptions?: { quality?: number; maxWidth?: number; maxHeight?: number; allowedTypes?: string[] }\r\n): SlashCommandItem[] {\r\n const allNatives = createDefaultSlashCommands(i18n, commands, images, imageOptions);\r\n const activeConfig = { ...DEFAULT_SLASH_COMMANDS_CONFIG, ...config };\r\n\r\n const filtered = allNatives.filter((_, index) => {\r\n const key = SLASH_COMMAND_KEYS[index];\r\n return key && activeConfig[key] !== false;\r\n });\r\n\r\n if (config.custom && Array.isArray(config.custom)) {\r\n return [...filtered, ...config.custom];\r\n }\r\n\r\n return filtered;\r\n}\r\n","import {\r\n Component,\r\n input,\r\n output,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n computed,\r\n inject,\r\n signal,\r\n} from \"@angular/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { ImageService } from \"./services/image.service\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport {\r\n filterSlashCommands,\r\n createDefaultSlashCommands\r\n} from \"./config/slash-commands.config\";\r\nimport { Plugin, PluginKey } from \"prosemirror-state\";\r\nimport { EditorView } from \"prosemirror-view\";\r\n\r\nexport interface SlashCommandItem {\r\n title: string;\r\n description: string;\r\n icon: string;\r\n keywords: string[];\r\n command: (editor: Editor) => void;\r\n}\r\n\r\nexport interface CustomSlashCommands {\r\n commands?: SlashCommandItem[];\r\n}\r\n\r\n// La définition des commandes par défaut est maintenant centralisée dans src/lib/config/i18n-slash-commands.ts\r\n\r\n@Component({\r\n selector: \"tiptap-slash-commands\",\r\n standalone: true,\r\n template: `\r\n <div #menuRef class=\"slash-commands-menu\">\r\n @for (command of filteredCommands(); track command.title) {\r\n <div\r\n class=\"slash-command-item\"\r\n [class.selected]=\"$index === selectedIndex()\"\r\n (mousedown)=\"executeCommand(command); $event.preventDefault(); $event.stopPropagation()\"\r\n (mouseenter)=\"selectedIndex.set($index)\"\r\n >\r\n <div class=\"slash-command-icon\">\r\n <span class=\"material-symbols-outlined\">{{ command.icon }}</span>\r\n </div>\r\n <div class=\"slash-command-content\">\r\n <div class=\"slash-command-title\">{{ command.title }}</div>\r\n <div class=\"slash-command-description\">{{ command.description }}</div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n `,\r\n styles: [\r\n `\r\n .slash-commands-menu {\r\n background: var(--ate-menu-bg);\r\n backdrop-filter: blur(var(--ate-menu-blur, 16px));\r\n border: 1px solid var(--ate-menu-border);\r\n border-radius: var(--ate-border-radius, 12px);\r\n box-shadow: var(--ate-menu-shadow);\r\n padding: 6px;\r\n max-height: 320px;\r\n overflow-y: auto;\r\n min-width: 280px;\r\n outline: none;\r\n animation: slashMenuFadeIn 0.2s cubic-bezier(0, 0, 0.2, 1);\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--ate-scrollbar-thumb) var(--ate-scrollbar-track);\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar {\r\n width: var(--ate-scrollbar-width);\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar-track {\r\n background: var(--ate-scrollbar-track);\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar-thumb {\r\n background: var(--ate-scrollbar-thumb);\r\n border: 3px solid transparent;\r\n background-clip: content-box;\r\n border-radius: 10px;\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar-thumb:hover {\r\n background: var(--ate-scrollbar-thumb-hover);\r\n background-clip: content-box;\r\n }\r\n\r\n @keyframes slashMenuFadeIn {\r\n from { opacity: 0; transform: translateY(4px); }\r\n to { opacity: 1; transform: translateY(0); }\r\n }\r\n\r\n .slash-command-item {\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\r\n padding: 8px 12px;\r\n border-radius: var(--ate-border-radius, 8px);\r\n cursor: pointer;\r\n transition: all 0.15s ease;\r\n border: var(--ate-border-width, 1px) solid transparent;\r\n outline: none;\r\n margin-bottom: 2px;\r\n }\r\n\r\n .slash-command-item:last-child {\r\n margin-bottom: 0;\r\n }\r\n\r\n .slash-command-item:hover {\r\n background: var(--ate-surface-secondary);\r\n }\r\n\r\n .slash-command-item.selected {\r\n background: var(--ate-primary-light);\r\n border-color: var(--ate-primary-light-alpha);\r\n }\r\n\r\n .slash-command-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n background: var(--ate-surface-tertiary);\r\n border-radius: var(--ate-border-radius, 8px);\r\n color: var(--ate-primary);\r\n flex-shrink: 0;\r\n transition: all 0.15s ease;\r\n }\r\n\r\n .slash-command-item.selected .slash-command-icon {\r\n background: var(--ate-primary);\r\n color: var(--ate-primary-contrast, #ffffff);\r\n }\r\n\r\n .slash-command-icon .material-symbols-outlined {\r\n font-size: 18px;\r\n }\r\n\r\n .slash-command-content {\r\n flex: 1;\r\n min-width: 0;\r\n }\r\n\r\n .slash-command-title {\r\n font-weight: 500;\r\n color: var(--ate-text);\r\n font-size: 14px;\r\n margin-bottom: 1px;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n\r\n .slash-command-description {\r\n color: var(--ate-text-secondary);\r\n font-size: 11px;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapSlashCommandsComponent implements OnInit, OnDestroy {\r\n readonly i18nService = inject(TiptapI18nService);\r\n editor = input.required<Editor>();\r\n config = input<CustomSlashCommands | undefined>(undefined);\r\n\r\n // Output pour l'upload d'image\r\n imageUploadRequested = output<File>();\r\n\r\n @ViewChild(\"menuRef\", { static: false }) menuRef!: ElementRef<HTMLDivElement>;\r\n\r\n private tippyInstance: TippyInstance | null = null;\r\n private imageService = inject(ImageService);\r\n private editorCommands = inject(EditorCommandsService);\r\n\r\n // État local\r\n private isActive = false;\r\n private currentQuery = signal(\"\");\r\n private slashRange: { from: number; to: number } | null = null;\r\n\r\n // Signal pour l'index sélectionné\r\n selectedIndex = signal(0);\r\n\r\n commands = computed(() => {\r\n const config = this.config();\r\n if (config && config.commands) {\r\n return config.commands;\r\n }\r\n\r\n // Fallback vers les commandes natives par défaut\r\n return createDefaultSlashCommands(this.i18nService, this.editorCommands, this.imageService);\r\n });\r\n\r\n filteredCommands = computed(() => {\r\n const query = this.currentQuery().toLowerCase();\r\n const commands = this.commands();\r\n\r\n if (!query) {\r\n return commands;\r\n }\r\n\r\n return commands.filter(\r\n (command) =>\r\n command.title.toLowerCase().includes(query) ||\r\n command.description.toLowerCase().includes(query) ||\r\n command.keywords.some((keyword) =>\r\n keyword.toLowerCase().includes(query)\r\n )\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n // Nettoyer les anciens listeners\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n ed.on(\"selectionUpdate\", this.updateMenu);\r\n ed.on(\"transaction\", this.updateMenu);\r\n ed.on(\"focus\", this.updateMenu);\r\n ed.on(\"blur\", this.handleBlur);\r\n\r\n // Utiliser le système de plugins ProseMirror pour intercepter les touches\r\n this.addKeyboardPlugin(ed);\r\n\r\n // Ne pas appeler updateMenu() ici pour éviter l'affichage prématuré\r\n // Il sera appelé automatiquement quand l'éditeur sera prêt\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n this.tippyInstance = null;\r\n }\r\n }\r\n\r\n private initTippy() {\r\n if (!this.menuRef?.nativeElement) {\r\n setTimeout(() => this.initTippy(), 50);\r\n return;\r\n }\r\n\r\n const menuElement = this.menuRef.nativeElement;\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"bottom-start\",\r\n appendTo: (ref) => {\r\n // Toujours essayer de remonter jusqu'au host de l'éditeur pour hériter des variables CSS\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: true,\r\n getReferenceClientRect: () => this.getSlashRect(),\r\n // Améliorer le positionnement avec scroll\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"top-start\", \"bottom-end\", \"top-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getSlashRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed || !this.slashRange) {\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n try {\r\n // Utiliser les coordonnées ProseMirror pour plus de précision\r\n const coords = ed.view.coordsAtPos(this.slashRange.from);\r\n return new DOMRect(\r\n coords.left,\r\n coords.top,\r\n 0,\r\n coords.bottom - coords.top\r\n );\r\n } catch (error) {\r\n console.warn(\"Error calculating coordinates:\", error);\r\n // Fallback sur window.getSelection\r\n const selection = window.getSelection();\r\n if (!selection || selection.rangeCount === 0) {\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n const range = selection.getRangeAt(0);\r\n return range.getBoundingClientRect();\r\n }\r\n }\r\n\r\n updateMenu = () => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const { from } = ed.state.selection;\r\n\r\n // Vérifier si on a tapé '/' au début d'une ligne ou après un espace\r\n const textBefore = ed.state.doc.textBetween(\r\n Math.max(0, from - 20),\r\n from,\r\n \"\\n\"\r\n );\r\n const slashMatch = textBefore.match(/(?:^|\\s)\\/([^\\/\\s]*)$/);\r\n\r\n if (slashMatch) {\r\n const query = slashMatch[1] || \"\";\r\n const wasActive = this.isActive;\r\n\r\n this.currentQuery.set(query);\r\n this.slashRange = {\r\n from: from - slashMatch[0].length + slashMatch[0].indexOf(\"/\"),\r\n to: from,\r\n };\r\n\r\n // Si le menu vient de devenir actif, réinitialiser l'index\r\n if (!wasActive) {\r\n this.selectedIndex.set(0);\r\n }\r\n\r\n this.isActive = true;\r\n this.showTippy();\r\n } else {\r\n this.isActive = false;\r\n this.hideTippy();\r\n }\r\n };\r\n\r\n handleBlur = () => {\r\n setTimeout(() => this.hideTippy(), 100);\r\n };\r\n\r\n handleKeyDown = (event: KeyboardEvent) => {\r\n // Ne gérer les touches que si le menu est actif\r\n if (!this.isActive || this.filteredCommands().length === 0) {\r\n return;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const nextIndex =\r\n (this.selectedIndex() + 1) % this.filteredCommands().length;\r\n this.selectedIndex.set(nextIndex);\r\n this.scrollToSelected();\r\n break;\r\n\r\n case \"ArrowUp\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const prevIndex =\r\n this.selectedIndex() === 0\r\n ? this.filteredCommands().length - 1\r\n : this.selectedIndex() - 1;\r\n this.selectedIndex.set(prevIndex);\r\n this.scrollToSelected();\r\n break;\r\n\r\n case \"Enter\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const selectedCommand = this.filteredCommands()[this.selectedIndex()];\r\n if (selectedCommand) {\r\n this.executeCommand(selectedCommand);\r\n }\r\n break;\r\n\r\n case \"Escape\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.isActive = false;\r\n this.hideTippy();\r\n // Optionnel : supprimer le \"/\" tapé\r\n const ed = this.editor();\r\n if (ed && this.slashRange) {\r\n const { tr } = ed.state;\r\n tr.delete(this.slashRange.from, this.slashRange.to);\r\n ed.view.dispatch(tr);\r\n }\r\n break;\r\n }\r\n };\r\n\r\n private scrollToSelected() {\r\n // Faire défiler vers l'élément sélectionné\r\n if (this.menuRef?.nativeElement) {\r\n const selectedItem = this.menuRef.nativeElement.querySelector(\r\n \".slash-command-item.selected\"\r\n ) as HTMLElement;\r\n if (selectedItem) {\r\n selectedItem.scrollIntoView({ block: \"nearest\", behavior: \"smooth\" });\r\n }\r\n }\r\n }\r\n\r\n private showTippy() {\r\n if (this.tippyInstance && this.filteredCommands().length > 0) {\r\n this.tippyInstance.show();\r\n }\r\n }\r\n\r\n private hideTippy() {\r\n if (this.tippyInstance) {\r\n this.tippyInstance.hide();\r\n }\r\n }\r\n\r\n executeCommand(command: SlashCommandItem) {\r\n const ed = this.editor();\r\n if (!ed || !this.slashRange) return;\r\n\r\n // Supprimer le texte slash (\"/\")\r\n const { tr } = ed.state;\r\n tr.delete(this.slashRange.from, this.slashRange.to);\r\n ed.view.dispatch(tr);\r\n\r\n // Cacher le menu immédiatement\r\n this.hideTippy();\r\n this.isActive = false;\r\n\r\n // Redonner le focus à l'éditeur et exécuter la commande\r\n // On utilise un micro-délai pour s'assurer que le DOM ProseMirror est stable\r\n // après la suppression du texte \"/\"\r\n setTimeout(() => {\r\n ed.commands.focus();\r\n command.command(ed);\r\n }, 10);\r\n }\r\n\r\n private addKeyboardPlugin(ed: Editor) {\r\n // Ajouter un plugin ProseMirror pour intercepter les événements clavier\r\n const keyboardPlugin = new Plugin({\r\n key: new PluginKey(\"slash-commands-keyboard\"),\r\n props: {\r\n handleKeyDown: (view: EditorView, event: KeyboardEvent) => {\r\n // Ne gérer que si le menu est actif\r\n if (!this.isActive || this.filteredCommands().length === 0) {\r\n return false;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n event.preventDefault();\r\n const nextIndex =\r\n (this.selectedIndex() + 1) % this.filteredCommands().length;\r\n this.selectedIndex.set(nextIndex);\r\n this.scrollToSelected();\r\n return true;\r\n\r\n case \"ArrowUp\":\r\n event.preventDefault();\r\n const prevIndex =\r\n this.selectedIndex() === 0\r\n ? this.filteredCommands().length - 1\r\n : this.selectedIndex() - 1;\r\n this.selectedIndex.set(prevIndex);\r\n this.scrollToSelected();\r\n return true;\r\n\r\n case \"Enter\":\r\n event.preventDefault();\r\n const selectedCommand =\r\n this.filteredCommands()[this.selectedIndex()];\r\n if (selectedCommand) {\r\n this.executeCommand(selectedCommand);\r\n }\r\n return true;\r\n\r\n case \"Escape\":\r\n event.preventDefault();\r\n this.isActive = false;\r\n this.hideTippy();\r\n // Supprimer le \"/\" tapé\r\n if (this.slashRange) {\r\n const { tr } = view.state;\r\n tr.delete(this.slashRange.from, this.slashRange.to);\r\n view.dispatch(tr);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n },\r\n });\r\n\r\n // Ajouter le plugin à l'éditeur\r\n ed.view.updateState(\r\n ed.view.state.reconfigure({\r\n plugins: [keyboardPlugin, ...ed.view.state.plugins],\r\n })\r\n );\r\n }\r\n}\r\n","// Main component\r\nexport { AngularTiptapEditorComponent } from \"./tiptap-editor.component\";\r\n\r\n// Bubble menus\r\nexport { TiptapBubbleMenuComponent } from \"./tiptap-bubble-menu.component\";\r\nexport { TiptapImageBubbleMenuComponent } from \"./tiptap-image-bubble-menu.component\";\r\nexport { TiptapTableBubbleMenuComponent } from \"./tiptap-table-bubble-menu.component\";\r\nexport { TiptapCellBubbleMenuComponent } from \"./tiptap-cell-bubble-menu.component\";\r\n\r\n// Toolbar components\r\nexport { TiptapToolbarComponent } from \"./tiptap-toolbar.component\";\r\nexport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nexport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\n\r\n// Slash commands\r\nexport { TiptapSlashCommandsComponent } from \"./tiptap-slash-commands.component\";\r\n\r\n// Services\r\nexport { TiptapI18nService } from \"./services/i18n.service\";\r\nexport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nexport { ImageService } from \"./services/image.service\";\r\n\r\n// Models and types\r\nexport type {\r\n BubbleMenuConfig,\r\n ImageBubbleMenuConfig,\r\n TableBubbleMenuConfig,\r\n CellBubbleMenuConfig,\r\n} from \"./models/bubble-menu.model\";\r\n\r\n// Image upload types\r\nexport type {\r\n ImageUploadHandler,\r\n ImageUploadContext,\r\n ImageUploadHandlerResult,\r\n ImageUploadResult,\r\n ImageData,\r\n} from \"./services/image.service\";\r\n","import { Directive } from \"@angular/core\";\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\r\n\r\n@Directive({\r\n standalone: true,\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n multi: true,\r\n useExisting: NoopValueAccessorDirective,\r\n },\r\n ],\r\n})\r\nexport class NoopValueAccessorDirective implements ControlValueAccessor {\r\n writeValue(obj: any): void {}\r\n registerOnChange(fn: any): void {}\r\n registerOnTouched(fn: any): void {}\r\n}\r\n","import {\r\n Component,\r\n ElementRef,\r\n input,\r\n output,\r\n OnDestroy,\r\n viewChild,\r\n effect,\r\n signal,\r\n computed,\r\n AfterViewInit,\r\n inject,\r\n DestroyRef,\r\n} from \"@angular/core\";\r\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\r\nimport { Editor, EditorOptions, Extension, Node, Mark } from \"@tiptap/core\";\r\nimport StarterKit from \"@tiptap/starter-kit\";\r\nimport Placeholder from \"@tiptap/extension-placeholder\";\r\nimport CharacterCount from \"@tiptap/extension-character-count\";\r\nimport Underline from \"@tiptap/extension-underline\";\r\nimport Superscript from \"@tiptap/extension-superscript\";\r\nimport Subscript from \"@tiptap/extension-subscript\";\r\nimport TextAlign from \"@tiptap/extension-text-align\";\r\nimport Link from \"@tiptap/extension-link\";\r\nimport Highlight from \"@tiptap/extension-highlight\";\r\nimport TextStyle from \"@tiptap/extension-text-style\";\r\nimport Color from \"@tiptap/extension-color\";\r\nimport OfficePaste from \"@intevation/tiptap-extension-office-paste\";\r\n\r\nimport { ResizableImage } from \"./extensions/resizable-image.extension\";\r\nimport { UploadProgress } from \"./extensions/upload-progress.extension\";\r\nimport { TableExtension } from \"./extensions/table.extension\";\r\nimport { TiptapToolbarComponent } from \"./index\";\r\nimport { TiptapBubbleMenuComponent } from \"./tiptap-bubble-menu.component\";\r\nimport { TiptapImageBubbleMenuComponent } from \"./tiptap-image-bubble-menu.component\";\r\nimport { TiptapTableBubbleMenuComponent } from \"./tiptap-table-bubble-menu.component\";\r\nimport {\r\n CellBubbleMenuConfig,\r\n TiptapCellBubbleMenuComponent,\r\n} from \"./tiptap-cell-bubble-menu.component\";\r\nimport {\r\n TiptapSlashCommandsComponent,\r\n CustomSlashCommands,\r\n} from \"./tiptap-slash-commands.component\";\r\nimport {\r\n ImageService,\r\n ImageUploadHandler,\r\n ImageUploadResult,\r\n} from \"./services/image.service\";\r\nimport { TiptapI18nService, SupportedLocale } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { NoopValueAccessorDirective } from \"./noop-value-accessor.directive\";\r\nimport { NgControl } from \"@angular/forms\";\r\nimport {\r\n filterSlashCommands,\r\n SLASH_COMMAND_KEYS,\r\n SlashCommandsConfig,\r\n DEFAULT_SLASH_COMMANDS_CONFIG,\r\n} from \"./config/slash-commands.config\";\r\n\r\nimport { ToolbarConfig } from \"./tiptap-toolbar.component\";\r\nimport {\r\n BubbleMenuConfig,\r\n ImageBubbleMenuConfig,\r\n TableBubbleMenuConfig,\r\n} from \"./models/bubble-menu.model\";\r\nimport { concat, defer, of, tap } from \"rxjs\";\r\n\r\n// Configuration par défaut de la toolbar\r\nexport const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig = {\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n heading1: true,\r\n heading2: true,\r\n heading3: true,\r\n bulletList: true,\r\n orderedList: true,\r\n blockquote: true,\r\n alignLeft: false,\r\n alignCenter: false,\r\n alignRight: false,\r\n alignJustify: false,\r\n link: true,\r\n image: true,\r\n horizontalRule: true,\r\n table: true,\r\n undo: true,\r\n redo: true,\r\n clear: false, // Désactivé par défaut (opt-in)\r\n textColor: true,\r\n separator: true,\r\n};\r\n\r\n// Configuration par défaut du bubble menu\r\nexport const DEFAULT_BUBBLE_MENU_CONFIG: BubbleMenuConfig = {\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n textColor: true,\r\n link: true,\r\n separator: true,\r\n};\r\n\r\n// Configuration par défaut du bubble menu image\r\nexport const DEFAULT_IMAGE_BUBBLE_MENU_CONFIG: ImageBubbleMenuConfig = {\r\n changeImage: true,\r\n resizeSmall: true,\r\n resizeMedium: true,\r\n resizeLarge: true,\r\n resizeOriginal: true,\r\n deleteImage: true,\r\n separator: true,\r\n};\r\n\r\n// Configuration par défaut du menu de table\r\nexport const DEFAULT_TABLE_MENU_CONFIG: TableBubbleMenuConfig = {\r\n addRowBefore: true,\r\n addRowAfter: true,\r\n deleteRow: true,\r\n addColumnBefore: true,\r\n addColumnAfter: true,\r\n deleteColumn: true,\r\n toggleHeaderRow: true,\r\n toggleHeaderColumn: true,\r\n deleteTable: true,\r\n separator: true,\r\n};\r\n\r\nexport const DEFAULT_CELL_MENU_CONFIG: CellBubbleMenuConfig = {\r\n mergeCells: true,\r\n splitCell: true,\r\n};\r\n\r\n// La configuration des slash commands est gérée dynamiquement via slashCommandsConfigComputed\r\n\r\n@Component({\r\n selector: \"angular-tiptap-editor\",\r\n standalone: true,\r\n hostDirectives: [NoopValueAccessorDirective],\r\n host: {\r\n '[class.fill-container]': 'fillContainer()',\r\n },\r\n imports: [\r\n TiptapToolbarComponent,\r\n TiptapBubbleMenuComponent,\r\n TiptapImageBubbleMenuComponent,\r\n TiptapTableBubbleMenuComponent,\r\n TiptapCellBubbleMenuComponent,\r\n TiptapSlashCommandsComponent,\r\n ],\r\n template: `\r\n <div class=\"tiptap-editor\" [class.fill-container]=\"fillContainer()\">\r\n <!-- Toolbar -->\r\n @if (showToolbar() && editor()) {\r\n <tiptap-toolbar \r\n [editor]=\"editor()!\" \r\n [config]=\"toolbarConfig()\"\r\n [imageUpload]=\"imageUploadConfig()\"\r\n />\r\n }\r\n\r\n <!-- Contenu de l'éditeur -->\r\n <div\r\n #editorElement\r\n class=\"tiptap-content\"\r\n [class.drag-over]=\"isDragOver()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (drop)=\"onDrop($event)\"\r\n (click)=\"onEditorClick($event)\"\r\n ></div>\r\n\r\n <!-- Bubble Menu pour le texte -->\r\n @if (showBubbleMenu() && editor()) {\r\n <tiptap-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"bubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-bubble-menu>\r\n }\r\n\r\n <!-- Bubble Menu pour les images -->\r\n @if (showImageBubbleMenu() && editor()) {\r\n <tiptap-image-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"imageBubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-image-bubble-menu>\r\n }\r\n\r\n <!-- Slash Commands -->\r\n @if (enableSlashCommands() && editor()) {\r\n <tiptap-slash-commands\r\n [editor]=\"editor()!\"\r\n [config]=\"slashCommandsConfigComputed()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n (imageUploadRequested)=\"onSlashCommandImageUpload($event)\"\r\n ></tiptap-slash-commands>\r\n }\r\n\r\n <!-- Table Menu -->\r\n @if (editor()) {\r\n <tiptap-table-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"tableBubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-table-bubble-menu>\r\n }\r\n\r\n <!-- Cell Menu -->\r\n @if (editor()) {\r\n <tiptap-cell-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"cellBubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-cell-bubble-menu>\r\n }\r\n\r\n <!-- Compteur de caractères -->\r\n @if (showCharacterCount()) {\r\n <div class=\"character-count\">\r\n {{ characterCount() }}\r\n {{ i18nService.editor().character\r\n }}{{ characterCount() > 1 ? \"s\" : \"\" }}, {{ wordCount() }}\r\n {{ i18nService.editor().word }}{{ wordCount() > 1 ? \"s\" : \"\" }}\r\n @if (maxCharacters()) { /\r\n {{ maxCharacters() }}\r\n }\r\n </div>\r\n }\r\n </div>\r\n `,\r\n\r\n styles: [\r\n `\r\n /* ========================================\r\n CSS Custom Properties (Variables)\r\n Override these to customize the editor\r\n ======================================== */\r\n :host {\r\n /* ===== BASE TOKENS (customize these for easy theming) ===== */\r\n --ate-primary: #2563eb;\r\n --ate-primary-contrast: #ffffff;\r\n --ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);\r\n --ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);\r\n --ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);\r\n \r\n --ate-surface: #ffffff;\r\n --ate-surface-secondary: #f8f9fa;\r\n --ate-surface-tertiary: #f1f5f9;\r\n \r\n --ate-text: #2d3748;\r\n --ate-text-secondary: #64748b;\r\n --ate-text-muted: #a0aec0;\r\n \r\n --ate-border: #e2e8f0;\r\n \r\n --ate-highlight-bg: #fef08a;\r\n --ate-highlight-color: #854d0e;\r\n \r\n --ate-button-hover: #f1f5f9;\r\n --ate-button-active: #e2e8f0;\r\n\r\n /* ===== MENUS (Slash/Bubble) ===== */\r\n --ate-menu-bg: rgba(255, 255, 255, 0.98);\r\n --ate-menu-border: var(--ate-border);\r\n --ate-menu-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\r\n --ate-menu-blur: 16px;\r\n\r\n --ate-error-color: #c53030;\r\n --ate-error-bg: #fed7d7;\r\n --ate-error-border: #feb2b2;\r\n \r\n /* ===== COMPONENT TOKENS (use base tokens by default) ===== */\r\n /* Border & Container */\r\n --ate-border-color: var(--ate-border);\r\n --ate-border-width: 2px;\r\n --ate-border-radius: 8px;\r\n --ate-focus-color: var(--ate-primary);\r\n --ate-background: var(--ate-surface);\r\n \r\n /* Content */\r\n --ate-text-color: var(--ate-text);\r\n --ate-placeholder-color: var(--ate-text-muted);\r\n --ate-line-height: 1.6;\r\n --ate-content-padding: 16px;\r\n \r\n /* Toolbar */\r\n --ate-toolbar-background: var(--ate-surface-secondary);\r\n --ate-toolbar-border-color: var(--ate-border);\r\n --ate-toolbar-button-color: var(--ate-text-secondary);\r\n --ate-toolbar-button-hover-background: transparent;\r\n --ate-toolbar-button-active-background: var(--ate-primary-light);\r\n --ate-toolbar-button-active-color: var(--ate-primary);\r\n \r\n /* Counter */\r\n --ate-counter-color: var(--ate-text-secondary);\r\n --ate-counter-background: var(--ate-surface-secondary);\r\n --ate-counter-border-color: var(--ate-border);\r\n \r\n /* Drag & Drop */\r\n --ate-drag-background: #f0f8ff;\r\n --ate-drag-border-color: var(--ate-primary);\r\n \r\n /* Blockquote */\r\n --ate-blockquote-border-color: var(--ate-border);\r\n --ate-blockquote-background: var(--ate-surface-secondary);\r\n \r\n /* Code */\r\n --ate-code-background: var(--ate-surface-secondary);\r\n --ate-code-color: var(--ate-text);\r\n --ate-code-block-background: #181825;\r\n --ate-code-block-color: #e2e8f0;\r\n --ate-code-border-color: var(--ate-border);\r\n --ate-code-block-border-color: var(--ate-border);\r\n \r\n /* Images */\r\n --ate-image-border-radius: 8px;\r\n --ate-image-selected-color: var(--ate-primary);\r\n \r\n /* Scrollbars */\r\n --ate-scrollbar-width: 10px;\r\n --ate-scrollbar-thumb: var(--ate-border);\r\n --ate-scrollbar-thumb-hover: var(--ate-text-muted);\r\n --ate-scrollbar-track: transparent;\r\n \r\n /* Tables */\r\n --ate-table-border-color: var(--ate-border);\r\n --ate-table-header-background: var(--ate-surface-secondary);\r\n --ate-table-header-color: var(--ate-text);\r\n --ate-table-cell-background: var(--ate-surface);\r\n --ate-table-cell-selected-background: var(--ate-primary-light);\r\n --ate-table-resize-handle-color: var(--ate-primary);\r\n --ate-table-row-hover-background: var(--ate-primary-lighter);\r\n }\r\n\r\n /* Manual dark mode with class or data attribute */\r\n :host(.dark),\r\n :host([data-theme=\"dark\"]) {\r\n /* ===== DARK BASE TOKENS ===== */\r\n --ate-primary: #3b82f6;\r\n --ate-primary-contrast: #ffffff;\r\n --ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 85%);\r\n --ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 92%);\r\n --ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 80%);\r\n \r\n --ate-surface: #020617;\r\n --ate-surface-secondary: #0f172a;\r\n --ate-surface-tertiary: #1e293b;\r\n \r\n --ate-text: #f8fafc;\r\n --ate-text-secondary: #94a3b8;\r\n --ate-text-muted: #64748b;\r\n \r\n --ate-border: #1e293b;\r\n \r\n --ate-highlight-bg: #854d0e;\r\n --ate-highlight-color: #fef08a;\r\n\r\n --ate-button-hover: #1e293b;\r\n --ate-button-active: #0f172a;\r\n\r\n /* ===== MENUS (Slash/Bubble) ===== */\r\n --ate-menu-bg: rgba(15, 23, 42, 0.95);\r\n --ate-menu-border: rgba(255, 255, 255, 0.1);\r\n --ate-menu-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);\r\n --ate-menu-blur: 16px;\r\n\r\n --ate-error-color: #f87171;\r\n --ate-error-bg: #450a0a;\r\n --ate-error-border: #7f1d1d;\r\n \r\n /* ===== DARK COMPONENT OVERRIDES ===== */\r\n --ate-drag-background: var(--ate-surface-tertiary);\r\n --ate-drag-border-color: var(--ate-primary);\r\n --ate-blockquote-border-color: var(--ate-primary);\r\n --ate-toolbar-button-active-background: var(--ate-primary-light);\r\n --ate-toolbar-button-active-color: var(--ate-primary);\r\n --ate-button-hover: var(--ate-surface-tertiary);\r\n --ate-button-active: var(--ate-surface-secondary);\r\n --ate-scrollbar-thumb: var(--ate-surface-tertiary);\r\n --ate-scrollbar-thumb-hover: var(--ate-text-muted);\r\n }\r\n\r\n /* Host styles pour fillContainer */\r\n :host(.fill-container) {\r\n display: block;\r\n height: 100%;\r\n }\r\n\r\n /* Conteneur principal de l'éditeur */\r\n .tiptap-editor {\r\n border: var(--ate-border-width) solid var(--ate-border-color);\r\n border-radius: var(--ate-border-radius);\r\n background: var(--ate-background);\r\n overflow: hidden;\r\n transition: border-color 0.2s ease;\r\n }\r\n\r\n /* Mode fill container - l'éditeur remplit son parent */\r\n .tiptap-editor.fill-container {\r\n display: flex;\r\n flex-direction: column;\r\n height: 100%;\r\n }\r\n\r\n .tiptap-editor.fill-container .tiptap-content {\r\n flex: 1;\r\n min-height: 0;\r\n overflow-y: auto;\r\n }\r\n\r\n .tiptap-editor:focus-within {\r\n border-color: var(--ate-focus-color);\r\n }\r\n\r\n /* Contenu de l'éditeur */\r\n .tiptap-content {\r\n padding: var(--ate-content-padding);\r\n min-height: var(--editor-min-height, 200px);\r\n height: var(--editor-height, auto);\r\n max-height: var(--editor-max-height, none);\r\n overflow-y: var(--editor-overflow, visible);\r\n outline: none;\r\n position: relative;\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--ate-scrollbar-thumb) var(--ate-scrollbar-track);\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar {\r\n width: var(--ate-scrollbar-width);\r\n height: var(--ate-scrollbar-width);\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar-track {\r\n background: var(--ate-scrollbar-track);\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar-thumb {\r\n background: var(--ate-scrollbar-thumb);\r\n border: 3px solid transparent;\r\n background-clip: content-box;\r\n border-radius: 10px;\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar-thumb:hover {\r\n background: var(--ate-scrollbar-thumb-hover);\r\n background-clip: content-box;\r\n }\r\n\r\n .tiptap-content.drag-over {\r\n background: var(--ate-drag-background);\r\n border: 2px dashed var(--ate-drag-border-color);\r\n }\r\n\r\n /* Compteur de caractères */\r\n .character-count {\r\n padding: 8px var(--ate-content-padding);\r\n font-size: 12px;\r\n color: var(--ate-counter-color);\r\n text-align: right;\r\n border-top: 1px solid var(--ate-counter-border-color);\r\n background: var(--ate-counter-background);\r\n }\r\n\r\n /* Styles ProseMirror avec :host ::ng-deep */\r\n :host ::ng-deep .ProseMirror {\r\n outline: none;\r\n line-height: var(--ate-line-height);\r\n color: var(--ate-text-color);\r\n min-height: 100%;\r\n height: 100%;\r\n /* S'assurer que le contenu s'étend correctement dans un conteneur scrollable */\r\n word-wrap: break-word;\r\n overflow-wrap: break-word;\r\n }\r\n\r\n /* Titres */\r\n :host ::ng-deep .ProseMirror h1 {\r\n font-size: 2em;\r\n font-weight: bold;\r\n margin-top: 0;\r\n margin-bottom: 0.5em;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror h2 {\r\n font-size: 1.5em;\r\n font-weight: bold;\r\n margin-top: 1em;\r\n margin-bottom: 0.5em;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror h3 {\r\n font-size: 1.25em;\r\n font-weight: bold;\r\n margin-top: 1em;\r\n margin-bottom: 0.5em;\r\n }\r\n\r\n /* Paragraphes et listes */\r\n :host ::ng-deep .ProseMirror p {\r\n margin: 0.5em 0;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror ul,\r\n :host ::ng-deep .ProseMirror ol {\r\n padding-left: 2em;\r\n margin: 0.5em 0;\r\n }\r\n\r\n /* Citations */\r\n :host ::ng-deep .ProseMirror blockquote {\r\n border-left: 4px solid var(--ate-blockquote-border-color);\r\n padding-left: 1em;\r\n margin: 1em 0;\r\n font-style: italic;\r\n background: var(--ate-blockquote-background);\r\n padding: 0.5em 1em;\r\n border-radius: 0 4px 4px 0;\r\n }\r\n\r\n /* Code */\r\n :host ::ng-deep .ProseMirror code {\r\n background: var(--ate-code-background);\r\n color: var(--ate-code-color);\r\n border: 1px solid var(--ate-code-border-color);\r\n padding: 0.2em 0.4em;\r\n border-radius: 3px;\r\n font-family: \"Monaco\", \"Consolas\", monospace;\r\n font-size: 0.9em;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror pre {\r\n background: var(--ate-code-block-background);\r\n color: var(--ate-code-block-color);\r\n border: 1px solid var(--ate-code-block-border-color);\r\n padding: 1em;\r\n border-radius: 6px;\r\n overflow-x: auto;\r\n margin: 1em 0;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror pre code {\r\n background: none;\r\n color: inherit;\r\n border: none;\r\n padding: 0;\r\n }\r\n\r\n /* Placeholder */\r\n :host ::ng-deep .ProseMirror p.is-editor-empty:first-child::before {\r\n content: attr(data-placeholder);\r\n color: var(--ate-placeholder-color);\r\n pointer-events: none;\r\n float: left;\r\n height: 0;\r\n }\r\n\r\n /* Mode lecture seule */\r\n :host ::ng-deep .ProseMirror[contenteditable=\"false\"] {\r\n pointer-events: none;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror[contenteditable=\"false\"] img {\r\n cursor: default;\r\n pointer-events: none;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror[contenteditable=\"false\"] img:hover {\r\n transform: none;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\r\n }\r\n\r\n :host\r\n ::ng-deep\r\n .ProseMirror[contenteditable=\"false\"]\r\n img.ProseMirror-selectednode {\r\n outline: none;\r\n }\r\n\r\n /* Styles pour les images */\r\n :host ::ng-deep .ProseMirror img {\r\n position: relative;\r\n display: inline-block;\r\n max-width: 100%;\r\n height: auto;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n border: 2px solid transparent;\r\n border-radius: var(--ate-image-border-radius);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror img:hover {\r\n border-color: var(--ate-border-color);\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror img.ProseMirror-selectednode {\r\n border-color: var(--ate-image-selected-color);\r\n box-shadow: 0 0 0 3px var(--ate-primary-light-alpha);\r\n transition: all 0.2s ease;\r\n }\r\n\r\n /* Images avec classe tiptap-image */\r\n :host ::ng-deep .ProseMirror .tiptap-image {\r\n max-width: 100%;\r\n height: auto;\r\n border-radius: 16px;\r\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);\r\n margin: 0.5em 0;\r\n cursor: pointer;\r\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\r\n display: block;\r\n filter: brightness(1) contrast(1);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror .tiptap-image:hover {\r\n box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);\r\n filter: brightness(1.02) contrast(1.02);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror .tiptap-image.ProseMirror-selectednode {\r\n outline: 2px solid var(--ate-primary);\r\n outline-offset: 2px;\r\n border-radius: 16px;\r\n box-shadow: 0 0 0 4px var(--ate-primary-light-alpha);\r\n }\r\n\r\n /* Conteneurs d'images avec alignement */\r\n :host ::ng-deep .image-container {\r\n margin: 0.5em 0;\r\n text-align: center;\r\n border-radius: 16px;\r\n overflow: hidden;\r\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\r\n }\r\n\r\n :host ::ng-deep .image-container.image-align-left {\r\n text-align: left;\r\n }\r\n\r\n :host ::ng-deep .image-container.image-align-center {\r\n text-align: center;\r\n }\r\n\r\n :host ::ng-deep .image-container.image-align-right {\r\n text-align: right;\r\n }\r\n\r\n :host ::ng-deep .image-container img {\r\n display: inline-block;\r\n max-width: 100%;\r\n height: auto;\r\n border-radius: 16px;\r\n }\r\n\r\n /* Conteneur pour les images redimensionnables */\r\n :host ::ng-deep .resizable-image-container {\r\n position: relative;\r\n display: inline-block;\r\n margin: 0.5em 0;\r\n }\r\n\r\n /* Conteneur des contrôles de redimensionnement */\r\n :host ::ng-deep .resize-controls {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n pointer-events: none;\r\n z-index: 1000;\r\n }\r\n\r\n /* Poignées de redimensionnement */\r\n :host ::ng-deep .resize-handle {\r\n position: absolute;\r\n width: 12px;\r\n height: 12px;\r\n background: var(--ate-primary);\r\n border: 2px solid var(--ate-surface);\r\n border-radius: 50%;\r\n pointer-events: all;\r\n cursor: pointer;\r\n z-index: 1001;\r\n transition: all 0.15s ease;\r\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle:hover {\r\n background: var(--ate-primary);\r\n box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);\r\n }\r\n\r\n :host ::ng-deep .resize-handle:active {\r\n background: var(--ate-primary);\r\n }\r\n\r\n /* Poignées du milieu avec scale séparé */\r\n :host ::ng-deep .resize-handle-n:hover,\r\n :host ::ng-deep .resize-handle-s:hover {\r\n transform: translateX(-50%) scale(1.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-w:hover,\r\n :host ::ng-deep .resize-handle-e:hover {\r\n transform: translateY(-50%) scale(1.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-n:active,\r\n :host ::ng-deep .resize-handle-s:active {\r\n transform: translateX(-50%) scale(0.9);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-w:active,\r\n :host ::ng-deep .resize-handle-e:active {\r\n transform: translateY(-50%) scale(0.9);\r\n }\r\n\r\n /* Poignées des coins avec scale simple */\r\n :host ::ng-deep .resize-handle-nw:hover,\r\n :host ::ng-deep .resize-handle-ne:hover,\r\n :host ::ng-deep .resize-handle-sw:hover,\r\n :host ::ng-deep .resize-handle-se:hover {\r\n transform: scale(1.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-nw:active,\r\n :host ::ng-deep .resize-handle-ne:active,\r\n :host ::ng-deep .resize-handle-sw:active,\r\n :host ::ng-deep .resize-handle-se:active {\r\n transform: scale(0.9);\r\n }\r\n\r\n /* Positions spécifiques pour chaque poignée */\r\n :host ::ng-deep .resize-handle-nw {\r\n top: 0;\r\n left: -6px;\r\n cursor: nw-resize;\r\n }\r\n :host ::ng-deep .resize-handle-n {\r\n top: 0;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n cursor: n-resize;\r\n }\r\n :host ::ng-deep .resize-handle-ne {\r\n top: 0;\r\n right: -6px;\r\n cursor: ne-resize;\r\n }\r\n :host ::ng-deep .resize-handle-w {\r\n top: 50%;\r\n left: -6px;\r\n transform: translateY(-50%);\r\n cursor: w-resize;\r\n }\r\n :host ::ng-deep .resize-handle-e {\r\n top: 50%;\r\n right: -6px;\r\n transform: translateY(-50%);\r\n cursor: e-resize;\r\n }\r\n :host ::ng-deep .resize-handle-sw {\r\n bottom: 0;\r\n left: -6px;\r\n cursor: sw-resize;\r\n }\r\n :host ::ng-deep .resize-handle-s {\r\n bottom: 0;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n cursor: s-resize;\r\n }\r\n :host ::ng-deep .resize-handle-se {\r\n bottom: 0;\r\n right: -6px;\r\n cursor: se-resize;\r\n }\r\n\r\n /* Styles pour le redimensionnement en cours */\r\n :host ::ng-deep body.resizing {\r\n user-select: none;\r\n cursor: crosshair;\r\n }\r\n\r\n :host ::ng-deep body.resizing .ProseMirror {\r\n pointer-events: none;\r\n }\r\n\r\n :host ::ng-deep body.resizing .ProseMirror .tiptap-image {\r\n pointer-events: none;\r\n }\r\n\r\n /* Styles pour les informations de taille d'image */\r\n :host ::ng-deep .image-size-info {\r\n position: absolute;\r\n bottom: -20px;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n background: rgba(0, 0, 0, 0.8);\r\n color: white;\r\n padding: 2px 6px;\r\n border-radius: 3px;\r\n font-size: 11px;\r\n white-space: nowrap;\r\n opacity: 0;\r\n transition: opacity 0.2s ease;\r\n }\r\n\r\n :host ::ng-deep .image-container:hover .image-size-info {\r\n opacity: 1;\r\n }\r\n /* Styles pour les tables */\r\n :host ::ng-deep .ProseMirror table {\r\n border-collapse: separate;\r\n border-spacing: 0;\r\n margin: 0;\r\n table-layout: fixed;\r\n width: 100%;\r\n border-radius: 8px;\r\n overflow: hidden;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table td,\r\n :host ::ng-deep .ProseMirror table th {\r\n border: none;\r\n border-right: 1px solid var(--ate-table-border-color);\r\n border-bottom: 1px solid var(--ate-table-border-color);\r\n box-sizing: border-box;\r\n min-width: 1em;\r\n padding: 8px 12px;\r\n position: relative;\r\n vertical-align: top;\r\n text-align: left;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table td {\r\n background: var(--ate-table-cell-background);\r\n }\r\n\r\n /* Ajouter les bordures externes manquantes pour former la bordure du tableau */\r\n :host ::ng-deep .ProseMirror table td:first-child,\r\n :host ::ng-deep .ProseMirror table th:first-child {\r\n border-left: 1px solid var(--ate-table-border-color);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:first-child td,\r\n :host ::ng-deep .ProseMirror table tr:first-child th {\r\n border-top: 1px solid var(--ate-table-border-color);\r\n }\r\n\r\n /* Coins arrondis */\r\n :host ::ng-deep .ProseMirror table tr:first-child th:first-child {\r\n border-top-left-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:first-child th:last-child {\r\n border-top-right-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:last-child td:first-child {\r\n border-bottom-left-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:last-child td:last-child {\r\n border-bottom-right-radius: 8px;\r\n }\r\n\r\n /* En-têtes de table */\r\n :host ::ng-deep .ProseMirror table th {\r\n background: var(--ate-table-header-background);\r\n font-weight: 600;\r\n color: var(--ate-table-header-color);\r\n }\r\n\r\n /* Cellules sélectionnées */\r\n :host ::ng-deep .ProseMirror table .selectedCell:after {\r\n background: var(--ate-table-cell-selected-background);\r\n content: \"\";\r\n left: 0;\r\n right: 0;\r\n top: 0;\r\n bottom: 0;\r\n pointer-events: none;\r\n position: absolute;\r\n z-index: 2;\r\n }\r\n\r\n /* Poignées de redimensionnement */\r\n :host ::ng-deep .ProseMirror table .column-resize-handle {\r\n position: absolute;\r\n right: -2px;\r\n top: 0;\r\n bottom: 0;\r\n width: 4px;\r\n background-color: var(--ate-table-resize-handle-color);\r\n opacity: 0;\r\n transition: opacity 0.2s ease;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table:hover .column-resize-handle {\r\n opacity: 1;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table .column-resize-handle:hover {\r\n background-color: var(--ate-focus-color);\r\n }\r\n\r\n /* Container avec scroll horizontal */\r\n :host ::ng-deep .ProseMirror .tableWrapper {\r\n overflow-x: auto;\r\n margin: 1em 0;\r\n border-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror .tableWrapper table {\r\n margin: 0;\r\n border-radius: 8px;\r\n min-width: 600px;\r\n overflow: hidden;\r\n }\r\n\r\n /* Paragraphes dans les tables */\r\n :host ::ng-deep .ProseMirror table p {\r\n margin: 0;\r\n }\r\n\r\n /* Styles pour les lignes avec hover */\r\n :host ::ng-deep .ProseMirror table tbody tr:hover td {\r\n background-color: var(--ate-table-row-hover-background);\r\n }\r\n `,\r\n ],\r\n})\r\nexport class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {\r\n content = input<string>(\"\");\r\n placeholder = input<string>(\"\");\r\n editable = input<boolean>(true);\r\n minHeight = input<number>(200);\r\n height = input<number | undefined>(undefined);\r\n maxHeight = input<number | undefined>(undefined);\r\n fillContainer = input<boolean>(false);\r\n showToolbar = input<boolean>(true);\r\n showCharacterCount = input<boolean>(true);\r\n maxCharacters = input<number | undefined>(undefined);\r\n enableOfficePaste = input<boolean>(true);\r\n enableSlashCommands = input<boolean>(true);\r\n slashCommands = input<SlashCommandsConfig>({});\r\n customSlashCommands = input<CustomSlashCommands | undefined>(undefined);\r\n locale = input<SupportedLocale | undefined>(undefined);\r\n autofocus = input<boolean | 'start' | 'end' | 'all' | number>(false);\r\n\r\n tiptapExtensions = input<(Extension | Node | Mark)[]>([]);\r\n tiptapOptions = input<Partial<EditorOptions>>({});\r\n\r\n // Nouveaux inputs pour les bubble menus\r\n showBubbleMenu = input<boolean>(true);\r\n bubbleMenu = input<Partial<BubbleMenuConfig>>(DEFAULT_BUBBLE_MENU_CONFIG);\r\n showImageBubbleMenu = input<boolean>(true);\r\n imageBubbleMenu = input<Partial<ImageBubbleMenuConfig>>(\r\n DEFAULT_IMAGE_BUBBLE_MENU_CONFIG\r\n );\r\n\r\n // Nouveau input pour la configuration de la toolbar\r\n toolbar = input<Partial<ToolbarConfig>>({});\r\n\r\n // Nouveau input pour la configuration de l'upload d'images\r\n imageUpload = input<Partial<any>>({});\r\n\r\n /**\r\n * Custom handler for image uploads.\r\n * When provided, images will be processed through this handler instead of being converted to base64.\r\n * This allows you to upload images to your own server/storage and use the returned URL.\r\n *\r\n * @example\r\n * ```typescript\r\n * myUploadHandler: ImageUploadHandler = async (context) => {\r\n * const formData = new FormData();\r\n * formData.append('image', context.file);\r\n * const response = await fetch('/api/upload', { method: 'POST', body: formData });\r\n * const data = await response.json();\r\n * return { src: data.imageUrl };\r\n * };\r\n *\r\n * // In template:\r\n * // <angular-tiptap-editor [imageUploadHandler]=\"myUploadHandler\" />\r\n * ```\r\n */\r\n imageUploadHandler = input<ImageUploadHandler | undefined>(undefined);\r\n\r\n // Nouveaux outputs\r\n contentChange = output<string>();\r\n editorCreated = output<Editor>();\r\n editorUpdate = output<{ editor: Editor; transaction: any }>();\r\n editorFocus = output<{ editor: Editor; event: FocusEvent }>();\r\n editorBlur = output<{ editor: Editor; event: FocusEvent }>();\r\n\r\n // ViewChild avec signal\r\n editorElement = viewChild.required<ElementRef>(\"editorElement\");\r\n\r\n // Signals privés pour l'état interne\r\n private _editor = signal<Editor | null>(null);\r\n private _characterCount = signal<number>(0);\r\n private _wordCount = signal<number>(0);\r\n private _isDragOver = signal<boolean>(false);\r\n private _editorFullyInitialized = signal<boolean>(false);\r\n\r\n // Accès en lecture seule aux signaux\r\n readonly editor = this._editor.asReadonly();\r\n readonly characterCount = this._characterCount.asReadonly();\r\n readonly wordCount = this._wordCount.asReadonly();\r\n readonly isDragOver = this._isDragOver.asReadonly();\r\n readonly editorFullyInitialized = this._editorFullyInitialized.asReadonly();\r\n\r\n // Computed pour les états de l'éditeur\r\n isEditorReady = computed(() => this.editor() !== null);\r\n\r\n // Computed pour la configuration de la toolbar\r\n toolbarConfig = computed(() =>\r\n Object.keys(this.toolbar()).length === 0\r\n ? DEFAULT_TOOLBAR_CONFIG\r\n : this.toolbar()\r\n );\r\n\r\n // Computed pour la configuration du bubble menu\r\n bubbleMenuConfig = computed(() =>\r\n Object.keys(this.bubbleMenu()).length === 0\r\n ? DEFAULT_BUBBLE_MENU_CONFIG\r\n : { ...DEFAULT_BUBBLE_MENU_CONFIG, ...this.bubbleMenu() }\r\n );\r\n\r\n // Computed pour la configuration du bubble menu image\r\n imageBubbleMenuConfig = computed(() =>\r\n Object.keys(this.imageBubbleMenu()).length === 0\r\n ? DEFAULT_IMAGE_BUBBLE_MENU_CONFIG\r\n : { ...DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ...this.imageBubbleMenu() }\r\n );\r\n\r\n // Computed pour la configuration du bubble menu table\r\n tableBubbleMenuConfig = computed(() => ({\r\n addRowBefore: true,\r\n addRowAfter: true,\r\n deleteRow: true,\r\n addColumnBefore: true,\r\n addColumnAfter: true,\r\n deleteColumn: true,\r\n deleteTable: true,\r\n toggleHeaderRow: true,\r\n toggleHeaderColumn: true,\r\n }));\r\n\r\n // Computed pour la configuration du menu de cellules\r\n cellBubbleMenuConfig = computed(() => ({\r\n mergeCells: true,\r\n splitCell: true,\r\n }));\r\n\r\n // Computed pour la configuration de l'upload d'images\r\n imageUploadConfig = computed(() => ({\r\n maxSize: 5,\r\n maxWidth: 1920,\r\n maxHeight: 1080,\r\n allowedTypes: [\"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\"],\r\n enableDragDrop: true,\r\n showPreview: true,\r\n multiple: false,\r\n compressImages: true,\r\n quality: 0.8,\r\n ...this.imageUpload(),\r\n }));\r\n\r\n // Computed pour la configuration des slash commands\r\n slashCommandsConfigComputed = computed(() => {\r\n const customConfig = this.customSlashCommands();\r\n if (customConfig) {\r\n return customConfig;\r\n }\r\n\r\n // Utilise l'utilitaire filterSlashCommands qui gère maintenant \r\n // les défauts, le filtrage et l'ajout de commandes personnalisées\r\n return {\r\n commands: filterSlashCommands(this.slashCommands(), this.i18nService, this.editorCommandsService, this.imageService, this.imageUploadConfig()),\r\n };\r\n });\r\n\r\n private _destroyRef = inject(DestroyRef);\r\n // NgControl pour gérer les FormControls\r\n private ngControl = inject(NgControl, { self: true, optional: true });\r\n\r\n readonly i18nService = inject(TiptapI18nService);\r\n readonly imageService = inject(ImageService);\r\n readonly editorCommandsService = inject(EditorCommandsService);\r\n\r\n constructor() {\r\n // Effet pour gérer le changement de langue\r\n effect(() => {\r\n const locale = this.locale();\r\n if (locale) {\r\n this.i18nService.setLocale(locale);\r\n }\r\n });\r\n\r\n // Effet pour mettre à jour le contenu de l'éditeur\r\n effect(() => {\r\n const editor = this.editor();\r\n const content = this.content();\r\n const hasFormControl = !!(this.ngControl as any)?.control;\r\n\r\n // Ne pas écraser le contenu si on a un FormControl et que le content est vide\r\n if (editor && content !== undefined && content !== editor.getHTML()) {\r\n if (hasFormControl && !content) {\r\n return;\r\n }\r\n this.setContent(content, false);\r\n }\r\n });\r\n\r\n // Effet pour mettre à jour les propriétés de hauteur\r\n effect(() => {\r\n const minHeight = this.minHeight();\r\n const height = this.height();\r\n const maxHeight = this.maxHeight();\r\n const element = this.editorElement()?.nativeElement;\r\n\r\n // Calculer automatiquement si le scroll est nécessaire\r\n const needsScroll = height !== undefined || maxHeight !== undefined;\r\n\r\n if (element) {\r\n element.style.setProperty(\"--editor-min-height\", `${minHeight}px`);\r\n element.style.setProperty(\r\n \"--editor-height\",\r\n height ? `${height}px` : \"auto\"\r\n );\r\n element.style.setProperty(\r\n \"--editor-max-height\",\r\n maxHeight ? `${maxHeight}px` : \"none\"\r\n );\r\n element.style.setProperty(\r\n \"--editor-overflow\",\r\n needsScroll ? \"auto\" : \"visible\"\r\n );\r\n }\r\n });\r\n\r\n // Effect pour surveiller les changements d'édition\r\n effect(() => {\r\n const currentEditor = this.editor();\r\n const isEditable = this.editable();\r\n\r\n if (currentEditor) {\r\n this.editorCommandsService.setEditable(currentEditor, isEditable);\r\n }\r\n });\r\n\r\n // Effect pour synchroniser le handler d'upload d'images avec le service\r\n effect(() => {\r\n const handler = this.imageUploadHandler();\r\n this.imageService.uploadHandler = handler || null;\r\n });\r\n\r\n // Effect pour la détection du survol des tables\r\n effect(() => {\r\n const currentEditor = this.editor();\r\n if (!currentEditor) return;\r\n\r\n // Table hover detection supprimée car remplacée par le menu bubble\r\n });\r\n }\r\n\r\n ngAfterViewInit() {\r\n // La vue est déjà complètement initialisée dans ngAfterViewInit\r\n this.initEditor();\r\n\r\n // S'abonner aux changements du FormControl\r\n this.setupFormControlSubscription();\r\n }\r\n\r\n ngOnDestroy() {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n currentEditor.destroy();\r\n }\r\n this._editorFullyInitialized.set(false);\r\n }\r\n\r\n private initEditor() {\r\n const extensions: (Extension | Node | Mark)[] = [\r\n StarterKit,\r\n TextStyle,\r\n Color.configure({\r\n types: [\"textStyle\"],\r\n }),\r\n Placeholder.configure({\r\n placeholder:\r\n this.placeholder() || this.i18nService.editor().placeholder,\r\n }),\r\n Underline,\r\n Superscript,\r\n Subscript,\r\n TextAlign.configure({\r\n types: [\"heading\", \"paragraph\"],\r\n }),\r\n Link.configure({\r\n openOnClick: false,\r\n HTMLAttributes: {\r\n class: \"tiptap-link\",\r\n },\r\n }),\r\n Highlight.configure({\r\n multicolor: true,\r\n HTMLAttributes: {\r\n class: \"tiptap-highlight\",\r\n },\r\n }),\r\n ResizableImage.configure({\r\n inline: false,\r\n allowBase64: true,\r\n HTMLAttributes: {\r\n class: \"tiptap-image\",\r\n },\r\n }),\r\n UploadProgress.configure({\r\n isUploading: () => this.imageService.isUploading(),\r\n uploadProgress: () => this.imageService.uploadProgress(),\r\n uploadMessage: () => this.imageService.uploadMessage(),\r\n }),\r\n TableExtension,\r\n ];\r\n\r\n // Ajouter l'extension Office Paste si activée\r\n if (this.enableOfficePaste()) {\r\n extensions.push(\r\n OfficePaste.configure({\r\n // Configuration par défaut pour une meilleure compatibilité\r\n transformPastedHTML: true,\r\n transformPastedText: true,\r\n })\r\n );\r\n }\r\n\r\n if (this.showCharacterCount()) {\r\n extensions.push(\r\n CharacterCount.configure({\r\n limit: this.maxCharacters(),\r\n })\r\n );\r\n }\r\n\r\n // Allow addition of custom extensions, but avoid duplicates by filtering by name\r\n const customExtensions = this.tiptapExtensions();\r\n if (customExtensions.length > 0) {\r\n const existingNames = new Set(\r\n extensions\r\n .map((ext) => (ext as any)?.name as string | undefined)\r\n .filter((name): name is string => !!name)\r\n );\r\n\r\n const filteredCustom = customExtensions.filter((ext) => {\r\n const name = (ext as any)?.name as string | undefined;\r\n return !name || !existingNames.has(name);\r\n });\r\n\r\n extensions.push(...filteredCustom);\r\n }\r\n\r\n // Also allow any tiptap user options\r\n const userOptions = this.tiptapOptions();\r\n\r\n const newEditor = new Editor({\r\n ...userOptions,\r\n element: this.editorElement().nativeElement,\r\n extensions,\r\n content: this.content(),\r\n editable: this.editable(),\r\n autofocus: this.autofocus(),\r\n onUpdate: ({ editor, transaction }) => {\r\n const html = editor.getHTML();\r\n this.contentChange.emit(html);\r\n // Mettre à jour le FormControl si il existe (dans le prochain cycle)\r\n if ((this.ngControl as any)?.control) {\r\n setTimeout(() => {\r\n (this.ngControl as any).control.setValue(html, {\r\n emitEvent: false,\r\n });\r\n }, 0);\r\n }\r\n this.editorUpdate.emit({ editor, transaction });\r\n this.updateCharacterCount(editor);\r\n },\r\n onCreate: ({ editor }) => {\r\n this.editorCreated.emit(editor);\r\n this.updateCharacterCount(editor);\r\n\r\n // Marquer l'éditeur comme complètement initialisé après un court délai\r\n // pour s'assurer que tous les plugins et extensions sont prêts\r\n setTimeout(() => {\r\n this._editorFullyInitialized.set(true);\r\n }, 100);\r\n },\r\n onFocus: ({ editor, event }) => {\r\n this.editorFocus.emit({ editor, event });\r\n },\r\n onBlur: ({ editor, event }) => {\r\n // Marquer le FormControl comme touché si il existe\r\n if ((this.ngControl as any)?.control) {\r\n (this.ngControl as any).control.markAsTouched();\r\n }\r\n this.editorBlur.emit({ editor, event });\r\n },\r\n });\r\n\r\n // Stocker la référence de l'éditeur immédiatement\r\n this._editor.set(newEditor);\r\n }\r\n\r\n private updateCharacterCount(editor: Editor) {\r\n if (this.showCharacterCount() && editor.storage[\"characterCount\"]) {\r\n const storage = editor.storage[\"characterCount\"];\r\n this._characterCount.set(storage.characters());\r\n this._wordCount.set(storage.words());\r\n }\r\n }\r\n\r\n // Gestion de l'upload d'image depuis les slash commands\r\n async onSlashCommandImageUpload(file: File) {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n try {\r\n await this.imageService.uploadAndInsertImage(currentEditor, file);\r\n } catch (error) {\r\n // Gérer l'erreur silencieusement ou afficher une notification\r\n }\r\n }\r\n }\r\n\r\n onDragOver(event: DragEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this._isDragOver.set(true);\r\n }\r\n\r\n onDrop(event: DragEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this._isDragOver.set(false);\r\n\r\n const files = event.dataTransfer?.files;\r\n if (files && files.length > 0) {\r\n const file = files[0];\r\n if (file.type.startsWith(\"image/\")) {\r\n this.insertImageFromFile(file);\r\n }\r\n }\r\n }\r\n\r\n private async insertImageFromFile(file: File) {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n try {\r\n const config = this.imageUploadConfig();\r\n await this.imageService.uploadAndInsertImage(currentEditor, file, {\r\n quality: config.quality,\r\n maxWidth: config.maxWidth,\r\n maxHeight: config.maxHeight\r\n });\r\n } catch (error) {\r\n // Gérer l'erreur silencieusement ou afficher une notification\r\n }\r\n }\r\n }\r\n\r\n // Public methods\r\n getHTML(): string {\r\n return this.editor()?.getHTML() || \"\";\r\n }\r\n\r\n getJSON(): any {\r\n return this.editor()?.getJSON();\r\n }\r\n\r\n getText(): string {\r\n return this.editor()?.getText() || \"\";\r\n }\r\n\r\n setContent(content: string, emitUpdate = true) {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.setContent(editor, content, emitUpdate);\r\n }\r\n }\r\n\r\n focus() {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.focus(editor);\r\n }\r\n }\r\n\r\n blur() {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.blur(editor);\r\n }\r\n }\r\n\r\n clearContent() {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.clearContent(editor);\r\n }\r\n }\r\n\r\n // Méthode publique pour obtenir l'éditeur\r\n getEditor(): Editor | null {\r\n return this.editor();\r\n }\r\n\r\n private setupFormControlSubscription(): void {\r\n const control = (this.ngControl as any)?.control;\r\n if (control) {\r\n const formValue$ = concat(\r\n defer(() => of(control.value)),\r\n control.valueChanges\r\n );\r\n\r\n formValue$\r\n .pipe(\r\n tap((value: any) => {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.setContent(value, false);\r\n }\r\n }),\r\n takeUntilDestroyed(this._destroyRef)\r\n )\r\n .subscribe();\r\n }\r\n }\r\n\r\n // Méthode pour gérer l'état disabled\r\n setDisabledState(isDisabled: boolean): void {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n this.editorCommandsService.setEditable(currentEditor, !isDisabled);\r\n }\r\n }\r\n\r\n onEditorClick(event: MouseEvent) {\r\n const editor = this.editor();\r\n if (!editor) return;\r\n\r\n // Vérifier si on clique sur l'élément conteneur et non sur le contenu\r\n const target = event.target as HTMLElement;\r\n const editorElement = this.editorElement()?.nativeElement;\r\n\r\n if (\r\n target === editorElement ||\r\n target.classList.contains(\"tiptap-content\")\r\n ) {\r\n // On clique dans l'espace vide, positionner le curseur à la fin\r\n setTimeout(() => {\r\n const { doc } = editor.state;\r\n const endPos = doc.content.size;\r\n editor.commands.setTextSelection(endPos);\r\n editor.commands.focus();\r\n }, 0);\r\n }\r\n }\r\n\r\n // Méthodes pour le bouton d'édition de table - Supprimées car remplacées par le menu bubble\r\n}\r\n","/*\r\n * Public API Surface of tiptap-editor\r\n */\r\n\r\n// Main component - only public component\r\nexport * from \"./lib/tiptap-editor.component\";\r\n\r\n// Host directive for FormControl integration\r\nexport * from \"./lib/noop-value-accessor.directive\";\r\n\r\n// Internationalization service\r\nexport * from \"./lib/services/i18n.service\";\r\n\r\n// Editor commands service\r\nexport * from \"./lib/services/editor-commands.service\";\r\n\r\n// Image service\r\nexport * from \"./lib/services/image.service\";\r\n\r\n// Types and interfaces for configuration\r\nexport type { ToolbarConfig } from \"./lib/tiptap-toolbar.component\";\r\nexport type {\r\n BubbleMenuConfig,\r\n ImageBubbleMenuConfig,\r\n TableBubbleMenuConfig,\r\n CellBubbleMenuConfig,\r\n} from \"./lib/models/bubble-menu.model\";\r\nexport type {\r\n CustomSlashCommands,\r\n SlashCommandItem,\r\n} from \"./lib/tiptap-slash-commands.component\";\r\n// Default configurations\r\nexport { DEFAULT_TOOLBAR_CONFIG } from \"./lib/tiptap-editor.component\";\r\nexport { DEFAULT_BUBBLE_MENU_CONFIG } from \"./lib/tiptap-editor.component\";\r\nexport { DEFAULT_IMAGE_BUBBLE_MENU_CONFIG } from \"./lib/tiptap-editor.component\";\r\nexport { DEFAULT_TABLE_MENU_CONFIG } from \"./lib/tiptap-editor.component\";\r\n\r\n// Utility functions to create and filter internationalized slash commands\r\nexport {\r\n createDefaultSlashCommands,\r\n filterSlashCommands,\r\n SLASH_COMMAND_KEYS,\r\n DEFAULT_SLASH_COMMANDS_CONFIG,\r\n} from \"./lib/config/slash-commands.config\";\r\nexport type {\r\n SlashCommandKey,\r\n SlashCommandsConfig,\r\n} from \"./lib/config/slash-commands.config\";\r\n\r\n// Types for height configuration\r\nexport type HeightConfig = {\r\n minHeight?: number;\r\n height?: number;\r\n maxHeight?: number;\r\n};\r\n\r\n// Supported locales type\r\nexport type { SupportedLocale } from \"./lib/services/i18n.service\";\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.EditorCommandsService","Plugin","PluginKey","i1.NoopValueAccessorDirective"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAwB;AAC/D,IAAA,IAAI,EAAE,gBAAgB;IAEtB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,WAAW,EAAE,KAAK;AAClB,YAAA,cAAc,EAAE,EAAE;SACnB;KACF;IAED,MAAM,GAAA;AACJ,Q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AA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAkxBnB,4BAA4B,EAAA,UAAA,EAAA,CAAA;kBA/xBxC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,uBAAuB,cACrB,IAAI,EAAA,cAAA,EACA,CAAC,0BAA0B,CAAC,EACtC,IAAA,EAAA;AACJ,wBAAA,wBAAwB,EAAE,iBAAiB;qBAC5C,EACQ,OAAA,EAAA;wBACP,sBAAsB;wBACtB,yBAAyB;wBACzB,8BAA8B;wBAC9B,8BAA8B;wBAC9B,6BAA6B;wBAC7B,4BAA4B;qBAC7B,EACS,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgFT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,ylbAAA,CAAA,EAAA;;;ACjPH;;AAEG;AAEH;;ACJA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"flogeez-angular-tiptap-editor.mjs","sources":["../../../projects/angular-tiptap-editor/src/lib/extensions/resizable-image.extension.ts","../../../projects/angular-tiptap-editor/src/lib/extensions/upload-progress.extension.ts","../../../projects/angular-tiptap-editor/src/lib/extensions/table.extension.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-button.component.ts","../../../projects/angular-tiptap-editor/src/lib/services/color-picker.service.ts","../../../projects/angular-tiptap-editor/src/lib/services/i18n.service.ts","../../../projects/angular-tiptap-editor/src/lib/components/tiptap-text-color-picker.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-separator.component.ts","../../../projects/angular-tiptap-editor/src/lib/services/image.service.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-image-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/services/editor-commands.service.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-table-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-cell-bubble-menu.component.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-toolbar.component.ts","../../../projects/angular-tiptap-editor/src/lib/config/slash-commands.config.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-slash-commands.component.ts","../../../projects/angular-tiptap-editor/src/lib/index.ts","../../../projects/angular-tiptap-editor/src/lib/noop-value-accessor.directive.ts","../../../projects/angular-tiptap-editor/src/lib/tiptap-editor.component.ts","../../../projects/angular-tiptap-editor/src/public-api.ts","../../../projects/angular-tiptap-editor/src/flogeez-angular-tiptap-editor.ts"],"sourcesContent":["import { Node, mergeAttributes, nodeInputRule } from \"@tiptap/core\";\r\n\r\nexport interface ResizableImageOptions {\r\n inline: boolean;\r\n allowBase64: boolean;\r\n HTMLAttributes: Record<string, any>;\r\n}\r\n\r\ndeclare module \"@tiptap/core\" {\r\n interface Commands<ReturnType> {\r\n resizableImage: {\r\n setResizableImage: (options: {\r\n src: string;\r\n alt?: string;\r\n title?: string;\r\n width?: number;\r\n height?: number;\r\n }) => ReturnType;\r\n updateResizableImage: (options: {\r\n src?: string;\r\n alt?: string;\r\n title?: string;\r\n width?: number;\r\n height?: number;\r\n }) => ReturnType;\r\n };\r\n }\r\n}\r\n\r\nexport const ResizableImage = Node.create<ResizableImageOptions>({\r\n name: \"resizableImage\",\r\n\r\n addOptions() {\r\n return {\r\n inline: false,\r\n allowBase64: false,\r\n HTMLAttributes: {},\r\n };\r\n },\r\n\r\n inline() {\r\n return this.options.inline;\r\n },\r\n\r\n group() {\r\n return this.options.inline ? \"inline\" : \"block\";\r\n },\r\n\r\n draggable: true,\r\n\r\n addAttributes() {\r\n return {\r\n src: {\r\n default: null,\r\n },\r\n alt: {\r\n default: null,\r\n },\r\n title: {\r\n default: null,\r\n },\r\n width: {\r\n default: null,\r\n parseHTML: (element) => {\r\n const width = element.getAttribute(\"width\");\r\n return width ? parseInt(width, 10) : null;\r\n },\r\n renderHTML: (attributes) => {\r\n if (!attributes[\"width\"]) {\r\n return {};\r\n }\r\n return {\r\n width: attributes[\"width\"],\r\n };\r\n },\r\n },\r\n height: {\r\n default: null,\r\n parseHTML: (element) => {\r\n const height = element.getAttribute(\"height\");\r\n return height ? parseInt(height, 10) : null;\r\n },\r\n renderHTML: (attributes) => {\r\n if (!attributes[\"height\"]) {\r\n return {};\r\n }\r\n return {\r\n height: attributes[\"height\"],\r\n };\r\n },\r\n },\r\n };\r\n },\r\n\r\n parseHTML() {\r\n return [\r\n {\r\n tag: \"img[src]\",\r\n },\r\n ];\r\n },\r\n\r\n renderHTML({ HTMLAttributes }) {\r\n return [\r\n \"img\",\r\n mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),\r\n ];\r\n },\r\n\r\n addCommands() {\r\n return {\r\n setResizableImage:\r\n (options) =>\r\n ({ commands }) => {\r\n return commands.insertContent({\r\n type: this.name,\r\n attrs: options,\r\n });\r\n },\r\n updateResizableImage:\r\n (options) =>\r\n ({ commands }) => {\r\n return commands.updateAttributes(this.name, options);\r\n },\r\n };\r\n },\r\n\r\n addInputRules() {\r\n return [\r\n nodeInputRule({\r\n find: /!\\[(.+|:?)]\\((\\S+)(?:(?:\\s+)[\"'](\\S+)[\"'])?\\)/,\r\n type: this.type,\r\n getAttributes: (match) => {\r\n const [, alt, src, title] = match;\r\n return { src, alt, title };\r\n },\r\n }),\r\n ];\r\n },\r\n\r\n addNodeView() {\r\n return ({ node, getPos, editor }) => {\r\n const container = document.createElement(\"div\");\r\n container.className = \"resizable-image-container\";\r\n container.style.position = \"relative\";\r\n container.style.display = \"inline-block\";\r\n\r\n const img = document.createElement(\"img\");\r\n img.src = node.attrs[\"src\"];\r\n img.alt = node.attrs[\"alt\"] || \"\";\r\n img.title = node.attrs[\"title\"] || \"\";\r\n img.className = \"tiptap-image\";\r\n\r\n if (node.attrs[\"width\"]) img.width = node.attrs[\"width\"];\r\n if (node.attrs[\"height\"]) img.height = node.attrs[\"height\"];\r\n\r\n img.parentNode?.insertBefore(container, img);\r\n container.appendChild(img);\r\n\r\n // Ajouter les contrôles de redimensionnement modernes\r\n const resizeControls = document.createElement(\"div\");\r\n resizeControls.className = \"resize-controls\";\r\n resizeControls.style.display = \"none\";\r\n\r\n // Créer les 8 poignées pour un redimensionnement complet\r\n const handles = [\"nw\", \"n\", \"ne\", \"w\", \"e\", \"sw\", \"s\", \"se\"];\r\n handles.forEach((direction) => {\r\n const handle = document.createElement(\"div\");\r\n handle.className = `resize-handle resize-handle-${direction}`;\r\n handle.setAttribute(\"data-direction\", direction);\r\n resizeControls.appendChild(handle);\r\n });\r\n\r\n // Attacher les contrôles au conteneur\r\n container.appendChild(resizeControls);\r\n\r\n // Variables pour le redimensionnement\r\n let isResizing = false;\r\n let startX = 0;\r\n let startY = 0;\r\n let startWidth = 0;\r\n let startHeight = 0;\r\n let aspectRatio = 1;\r\n\r\n // Calculer le ratio d'aspect\r\n img.onload = () => {\r\n aspectRatio = img.naturalWidth / img.naturalHeight;\r\n };\r\n\r\n // Gestion du redimensionnement\r\n const handleMouseDown = (e: MouseEvent, direction: string) => {\r\n e.preventDefault();\r\n e.stopPropagation();\r\n\r\n isResizing = true;\r\n startX = e.clientX;\r\n startY = e.clientY;\r\n\r\n // Utiliser les dimensions actuelles de l'image au lieu des dimensions initiales\r\n startWidth =\r\n parseInt(img.getAttribute(\"width\") || \"0\") ||\r\n node.attrs[\"width\"] ||\r\n img.naturalWidth;\r\n startHeight =\r\n parseInt(img.getAttribute(\"height\") || \"0\") ||\r\n node.attrs[\"height\"] ||\r\n img.naturalHeight;\r\n\r\n // Ajouter la classe de redimensionnement au body\r\n document.body.classList.add(\"resizing\");\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n if (!isResizing) return;\r\n\r\n const deltaX = e.clientX - startX;\r\n const deltaY = e.clientY - startY;\r\n\r\n let newWidth = startWidth;\r\n let newHeight = startHeight;\r\n\r\n // Redimensionnement selon la direction\r\n switch (direction) {\r\n case \"e\":\r\n newWidth = startWidth + deltaX;\r\n newHeight = newWidth / aspectRatio;\r\n break;\r\n case \"w\":\r\n newWidth = startWidth - deltaX;\r\n newHeight = newWidth / aspectRatio;\r\n break;\r\n case \"s\":\r\n newHeight = startHeight + deltaY;\r\n newWidth = newHeight * aspectRatio;\r\n break;\r\n case \"n\":\r\n newHeight = startHeight - deltaY;\r\n newWidth = newHeight * aspectRatio;\r\n break;\r\n case \"se\":\r\n newWidth = startWidth + deltaX;\r\n newHeight = startHeight + deltaY;\r\n break;\r\n case \"sw\":\r\n newWidth = startWidth - deltaX;\r\n newHeight = startHeight + deltaY;\r\n break;\r\n case \"ne\":\r\n newWidth = startWidth + deltaX;\r\n newHeight = startHeight - deltaY;\r\n break;\r\n case \"nw\":\r\n newWidth = startWidth - deltaX;\r\n newHeight = startHeight - deltaY;\r\n break;\r\n }\r\n\r\n // Limites\r\n newWidth = Math.max(50, Math.min(2000, newWidth));\r\n newHeight = Math.max(50, Math.min(2000, newHeight));\r\n\r\n // Mettre à jour directement les attributs de l'image\r\n img.setAttribute(\"width\", Math.round(newWidth).toString());\r\n img.setAttribute(\"height\", Math.round(newHeight).toString());\r\n };\r\n\r\n const handleMouseUp = () => {\r\n isResizing = false;\r\n document.body.classList.remove(\"resizing\");\r\n\r\n // Mettre à jour le nœud Tiptap avec les nouvelles dimensions\r\n if (typeof getPos === \"function\") {\r\n const finalWidth = parseInt(img.getAttribute(\"width\") || \"0\");\r\n const finalHeight = parseInt(img.getAttribute(\"height\") || \"0\");\r\n\r\n if (finalWidth && finalHeight) {\r\n editor.commands.updateAttributes(\"resizableImage\", {\r\n width: finalWidth,\r\n height: finalHeight,\r\n });\r\n }\r\n }\r\n\r\n document.removeEventListener(\"mousemove\", handleMouseMove);\r\n document.removeEventListener(\"mouseup\", handleMouseUp);\r\n };\r\n\r\n document.addEventListener(\"mousemove\", handleMouseMove);\r\n document.addEventListener(\"mouseup\", handleMouseUp);\r\n };\r\n\r\n // Ajouter les événements aux poignées\r\n resizeControls.addEventListener(\"mousedown\", (e) => {\r\n const target = e.target as HTMLElement;\r\n if (target.classList.contains(\"resize-handle\")) {\r\n const direction = target.getAttribute(\"data-direction\");\r\n if (direction) {\r\n handleMouseDown(e, direction);\r\n }\r\n }\r\n });\r\n\r\n // Gestion des événements\r\n img.addEventListener(\"click\", () => {\r\n // Masquer tous les autres contrôles\r\n document.querySelectorAll(\".resize-controls\").forEach((control) => {\r\n (control as HTMLElement).style.display = \"none\";\r\n });\r\n\r\n // Afficher les contrôles de cette image\r\n resizeControls.style.display = \"block\";\r\n img.classList.add(\"selected\");\r\n });\r\n\r\n // Masquer les contrôles quand on clique ailleurs\r\n document.addEventListener(\"click\", (e) => {\r\n const target = e.target as Element;\r\n if (\r\n target &&\r\n !img.contains(target) &&\r\n !resizeControls.contains(target)\r\n ) {\r\n resizeControls.style.display = \"none\";\r\n img.classList.remove(\"selected\");\r\n }\r\n });\r\n\r\n return {\r\n dom: container,\r\n update: (updatedNode) => {\r\n if (updatedNode.type.name !== \"resizableImage\") return false;\r\n\r\n img.src = updatedNode.attrs[\"src\"];\r\n img.alt = updatedNode.attrs[\"alt\"] || \"\";\r\n img.title = updatedNode.attrs[\"title\"] || \"\";\r\n\r\n if (updatedNode.attrs[\"width\"])\r\n img.width = updatedNode.attrs[\"width\"];\r\n if (updatedNode.attrs[\"height\"])\r\n img.height = updatedNode.attrs[\"height\"];\r\n\r\n return true;\r\n },\r\n };\r\n };\r\n },\r\n});\r\n","import { Extension } from \"@tiptap/core\";\r\nimport { Plugin, PluginKey } from \"@tiptap/pm/state\";\r\nimport { Decoration, DecorationSet } from \"@tiptap/pm/view\";\r\n\r\nexport interface UploadProgressOptions {\r\n isUploading: () => boolean;\r\n uploadProgress: () => number;\r\n uploadMessage: () => string;\r\n}\r\n\r\nexport const UploadProgress = Extension.create<UploadProgressOptions>({\r\n name: \"uploadProgress\",\r\n\r\n addOptions() {\r\n return {\r\n isUploading: () => false,\r\n uploadProgress: () => 0,\r\n uploadMessage: () => \"\",\r\n };\r\n },\r\n\r\n addProseMirrorPlugins() {\r\n const options = this.options;\r\n\r\n return [\r\n new Plugin({\r\n key: new PluginKey(\"uploadProgress\"),\r\n state: {\r\n init() {\r\n return {\r\n decorations: DecorationSet.empty,\r\n isUploading: false,\r\n uploadPosition: null as number | null,\r\n };\r\n },\r\n apply: (tr, state) => {\r\n const isUploading = options.isUploading();\r\n\r\n // Si l'upload commence, sauvegarder la position\r\n if (isUploading && !state.isUploading) {\r\n const uploadPosition = tr.selection.from;\r\n const uploadProgress = options.uploadProgress();\r\n const uploadMessage = options.uploadMessage();\r\n\r\n // Créer un élément de progression\r\n const uploadElement = document.createElement(\"div\");\r\n uploadElement.className = \"upload-progress-widget\";\r\n uploadElement.innerHTML = `\r\n <div class=\"upload-skeleton\">\r\n <div class=\"upload-content\">\r\n <div class=\"upload-icon\">\r\n <span class=\"material-symbols-outlined spinning\">image</span>\r\n </div>\r\n <div class=\"upload-info\">\r\n <div class=\"upload-message\">${uploadMessage}</div>\r\n <div class=\"progress-bar\">\r\n <div class=\"progress-fill\" style=\"width: ${uploadProgress}%\"></div>\r\n </div>\r\n <div class=\"progress-text\">${uploadProgress}%</div>\r\n </div>\r\n </div>\r\n </div>\r\n `;\r\n\r\n // Ajouter les styles si pas déjà fait\r\n if (!document.querySelector(\"#upload-progress-styles\")) {\r\n const style = document.createElement(\"style\");\r\n style.id = \"upload-progress-styles\";\r\n style.textContent = `\r\n .upload-progress-widget {\r\n display: block;\r\n margin: 8px 0;\r\n max-width: 400px;\r\n }\r\n .upload-skeleton {\r\n background: var(--ate-surface-secondary);\r\n border: 2px dashed var(--ate-border-color);\r\n border-radius: var(--ate-border-radius);\r\n padding: 16px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n min-height: 120px;\r\n animation: pulse 2s infinite;\r\n }\r\n @keyframes pulse {\r\n 0%, 100% { background-color: var(--ate-surface-secondary); }\r\n 50% { background-color: var(--ate-surface-tertiary); }\r\n }\r\n .upload-content {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n gap: 12px;\r\n text-align: center;\r\n }\r\n .upload-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 48px;\r\n height: 48px;\r\n background: var(--ate-primary-light);\r\n border-radius: 50%;\r\n color: var(--ate-primary);\r\n }\r\n .upload-icon .material-symbols-outlined {\r\n font-size: 24px;\r\n }\r\n .spinning {\r\n animation: spin 1s linear infinite;\r\n }\r\n @keyframes spin {\r\n from { transform: rotate(0deg); }\r\n to { transform: rotate(360deg); }\r\n }\r\n .upload-info {\r\n display: flex;\r\n flex-direction: column;\r\n gap: 8px;\r\n width: 100%;\r\n max-width: 200px;\r\n }\r\n .upload-message {\r\n font-size: 14px;\r\n color: var(--ate-text);\r\n font-weight: 500;\r\n }\r\n .progress-bar {\r\n width: 100%;\r\n height: 6px;\r\n background: var(--ate-border-color);\r\n border-radius: 3px;\r\n overflow: hidden;\r\n }\r\n .progress-fill {\r\n height: 100%;\r\n background: var(--ate-primary);\r\n border-radius: 3px;\r\n transition: width 0.3s ease;\r\n }\r\n .progress-text {\r\n font-size: 12px;\r\n color: var(--ate-text-secondary);\r\n font-weight: 500;\r\n }\r\n `;\r\n document.head.appendChild(style);\r\n }\r\n\r\n // Créer une décoration widget à la position sauvegardée\r\n const decoration = Decoration.widget(\r\n uploadPosition,\r\n uploadElement,\r\n {\r\n side: 1,\r\n key: \"upload-progress\",\r\n }\r\n );\r\n\r\n return {\r\n decorations: DecorationSet.create(tr.doc, [decoration]),\r\n isUploading: true,\r\n uploadPosition,\r\n };\r\n }\r\n\r\n // Si l'upload continue, mettre à jour le contenu\r\n if (\r\n isUploading &&\r\n state.isUploading &&\r\n state.uploadPosition !== null\r\n ) {\r\n const uploadProgress = options.uploadProgress();\r\n const uploadMessage = options.uploadMessage();\r\n\r\n // Mettre à jour le contenu de l'élément existant\r\n const existingElement = document.querySelector(\r\n \".upload-progress-widget\"\r\n );\r\n if (existingElement) {\r\n existingElement.innerHTML = `\r\n <div class=\"upload-skeleton\">\r\n <div class=\"upload-content\">\r\n <div class=\"upload-icon\">\r\n <span class=\"material-symbols-outlined spinning\">image</span>\r\n </div>\r\n <div class=\"upload-info\">\r\n <div class=\"upload-message\">${uploadMessage}</div>\r\n <div class=\"progress-bar\">\r\n <div class=\"progress-fill\" style=\"width: ${uploadProgress}%\"></div>\r\n </div>\r\n <div class=\"progress-text\">${uploadProgress}%</div>\r\n </div>\r\n </div>\r\n </div>\r\n `;\r\n }\r\n\r\n return state; // Garder les décorations existantes\r\n }\r\n\r\n // Si l'upload se termine, supprimer les décorations\r\n if (!isUploading && state.isUploading) {\r\n return {\r\n decorations: DecorationSet.empty,\r\n isUploading: false,\r\n uploadPosition: null,\r\n };\r\n }\r\n\r\n return state;\r\n },\r\n },\r\n props: {\r\n decorations(state) {\r\n const pluginState = this.getState(state);\r\n return pluginState ? pluginState.decorations : DecorationSet.empty;\r\n },\r\n },\r\n }),\r\n ];\r\n },\r\n});\r\n","import { Extension } from \"@tiptap/core\";\r\nimport Table from \"@tiptap/extension-table\";\r\nimport TableRow from \"@tiptap/extension-table-row\";\r\nimport TableCell from \"@tiptap/extension-table-cell\";\r\nimport TableHeader from \"@tiptap/extension-table-header\";\r\n\r\nexport const TableExtension = Extension.create({\r\n name: \"tableExtension\",\r\n\r\n addExtensions() {\r\n return [\r\n Table.configure({\r\n resizable: true,\r\n handleWidth: 5,\r\n cellMinWidth: 100,\r\n }),\r\n TableRow,\r\n TableHeader.configure({\r\n HTMLAttributes: {\r\n class: \"table-header\",\r\n },\r\n }),\r\n TableCell.configure({\r\n HTMLAttributes: {\r\n class: \"table-cell\",\r\n },\r\n }),\r\n ];\r\n },\r\n});\r\n","import { Component, input, output } from \"@angular/core\";\r\n\r\nexport interface TiptapButtonConfig {\r\n icon: string;\r\n title: string;\r\n active?: boolean;\r\n disabled?: boolean;\r\n variant?: \"default\" | \"text\" | \"danger\";\r\n size?: \"small\" | \"medium\" | \"large\";\r\n iconSize?: \"small\" | \"medium\" | \"large\";\r\n}\r\n\r\n@Component({\r\n selector: \"tiptap-button\",\r\n standalone: true,\r\n template: `\r\n <button\r\n class=\"tiptap-button\"\r\n [class.is-active]=\"active()\"\r\n [class.is-disabled]=\"disabled()\"\r\n [class.text-button]=\"variant() === 'text'\"\r\n [class.danger]=\"variant() === 'danger'\"\r\n [class.small]=\"size() === 'small'\"\r\n [class.medium]=\"size() === 'medium'\"\r\n [class.large]=\"size() === 'large'\"\r\n [class.has-custom-color]=\"!!color()\"\r\n [disabled]=\"disabled()\"\r\n [style.color]=\"color()\"\r\n [attr.title]=\"title()\"\r\n (mousedown)=\"onMouseDown($event)\"\r\n (click)=\"onClick.emit($event)\"\r\n type=\"button\"\r\n >\r\n <span\r\n class=\"material-symbols-outlined\"\r\n [class.icon-small]=\"iconSize() === 'small'\"\r\n [class.icon-medium]=\"iconSize() === 'medium'\"\r\n [class.icon-large]=\"iconSize() === 'large'\"\r\n >{{ icon() }}</span\r\n >\r\n <ng-content></ng-content>\r\n </button>\r\n `,\r\n styles: [\r\n `\r\n /* Styles de base pour les boutons Tiptap */\r\n .tiptap-button {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n border: none;\r\n background: transparent;\r\n border-radius: var(--ate-border-radius, 8px);\r\n cursor: pointer;\r\n transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);\r\n color: var(--ate-toolbar-button-color, var(--ate-text-secondary));\r\n position: relative;\r\n overflow: hidden;\r\n }\r\n\r\n .tiptap-button::before {\r\n content: \"\";\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n background: var(--ate-primary);\r\n opacity: 0;\r\n transition: opacity 0.2s ease;\r\n border-radius: var(--ate-border-radius, 8px);\r\n }\r\n\r\n .tiptap-button:hover:not(.has-custom-color) {\r\n color: var(--ate-toolbar-button-active-color, var(--ate-primary));\r\n background: var(--ate-toolbar-button-hover-background, transparent);\r\n transform: translateY(-1px);\r\n }\r\n \r\n /* If has custom color, we still want the hover background but not the color change */\r\n .tiptap-button.has-custom-color:hover {\r\n background: var(--ate-toolbar-button-hover-background, transparent);\r\n transform: translateY(-1px);\r\n }\r\n\r\n .tiptap-button:hover::before {\r\n opacity: 0.1;\r\n }\r\n\r\n .tiptap-button:active {\r\n transform: translateY(0);\r\n }\r\n\r\n .tiptap-button.is-active:not(.has-custom-color) {\r\n color: var(--ate-toolbar-button-active-color, var(--ate-primary));\r\n background: var(--ate-toolbar-button-active-background, var(--ate-primary-light));\r\n }\r\n\r\n /* If has custom color and active, prioritize the custom color */\r\n .tiptap-button.is-active.has-custom-color {\r\n background: var(--ate-toolbar-button-active-background, var(--ate-primary-light));\r\n }\r\n\r\n .tiptap-button:disabled {\r\n opacity: 0.4;\r\n cursor: not-allowed;\r\n pointer-events: none;\r\n }\r\n\r\n /* Icônes Material Symbols */\r\n .tiptap-button .material-symbols-outlined {\r\n font-size: 20px;\r\n position: relative;\r\n z-index: 1;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined.icon-small {\r\n font-size: 16px;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined.icon-medium {\r\n font-size: 20px;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined.icon-large {\r\n font-size: 24px;\r\n }\r\n\r\n /* Boutons avec texte */\r\n .tiptap-button.text-button {\r\n width: auto;\r\n padding: 0 12px;\r\n font-size: 14px;\r\n font-weight: 500;\r\n gap: 8px;\r\n }\r\n\r\n /* Boutons de couleur */\r\n .tiptap-button.color-button {\r\n width: 28px;\r\n height: 28px;\r\n border-radius: 50%;\r\n border: 2px solid transparent;\r\n transition: all 0.2s ease;\r\n }\r\n\r\n .tiptap-button.color-button:hover {\r\n border-color: var(--ate-border);\r\n transform: scale(1.1);\r\n }\r\n\r\n .tiptap-button.color-button.is-active {\r\n border-color: var(--ate-primary);\r\n box-shadow: 0 0 0 2px var(--ate-primary-light);\r\n }\r\n\r\n /* Boutons avec variantes */\r\n .tiptap-button.danger {\r\n color: var(--ate-error-color, #ef4444);\r\n }\r\n\r\n .tiptap-button.danger:hover {\r\n background: var(--ate-error-bg, rgba(239, 68, 68, 0.1));\r\n }\r\n\r\n .tiptap-button.danger::before {\r\n background: var(--ate-error-color, #ef4444);\r\n }\r\n\r\n /* Boutons de taille différente */\r\n .tiptap-button.small {\r\n width: 24px;\r\n height: 24px;\r\n }\r\n\r\n .tiptap-button.medium {\r\n width: 32px;\r\n height: 32px;\r\n }\r\n\r\n .tiptap-button.large {\r\n width: 40px;\r\n height: 40px;\r\n }\r\n\r\n /* Animation de pulsation pour les boutons actifs */\r\n @keyframes pulse {\r\n 0%,\r\n 100% {\r\n box-shadow: 0 0 0 0 var(--ate-primary-light-alpha);\r\n }\r\n 50% {\r\n box-shadow: 0 0 0 4px transparent;\r\n }\r\n }\r\n\r\n .tiptap-button.is-active.pulse {\r\n animation: pulse 2s infinite;\r\n }\r\n\r\n /* Responsive */\r\n @media (max-width: 768px) {\r\n .tiptap-button {\r\n width: 32px;\r\n height: 32px;\r\n }\r\n\r\n .tiptap-button .material-symbols-outlined {\r\n font-size: 18px;\r\n }\r\n\r\n .tiptap-button.text-button {\r\n padding: 0 8px;\r\n font-size: 13px;\r\n }\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapButtonComponent {\r\n // Inputs\r\n icon = input.required<string>();\r\n title = input.required<string>();\r\n active = input(false);\r\n disabled = input(false);\r\n color = input<string>();\r\n variant = input<\"default\" | \"text\" | \"danger\">(\"default\");\r\n size = input<\"small\" | \"medium\" | \"large\">(\"medium\");\r\n iconSize = input<\"small\" | \"medium\" | \"large\">(\"medium\");\r\n\r\n // Outputs\r\n onClick = output<Event>();\r\n\r\n onMouseDown(event: MouseEvent) {\r\n event.preventDefault();\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport type { Editor } from \"@tiptap/core\";\r\n\r\nexport interface ColorPickerSelection {\r\n from: number;\r\n to: number;\r\n}\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class ColorPickerService {\r\n private storedSelection: ColorPickerSelection | null = null;\r\n\r\n /**\r\n * Find the first explicitly applied color within a selection.\r\n */\r\n private findFirstAppliedColor(\r\n editor: Editor,\r\n selection: ColorPickerSelection\r\n ): string | null {\r\n const { from, to } = selection;\r\n let found: string | null = null;\r\n\r\n editor.state.doc.nodesBetween(from, to, (node) => {\r\n if (found) return false;\r\n if (!node.isText) return;\r\n\r\n const textStyleMark = node.marks.find((m) => m.type.name === \"textStyle\");\r\n const color = (textStyleMark?.attrs as any)?.color as string | undefined;\r\n if (color) {\r\n found = this.normalizeColor(color);\r\n return false;\r\n }\r\n\r\n return;\r\n });\r\n\r\n return found;\r\n }\r\n\r\n /**\r\n * Capture current editor selection.\r\n */\r\n captureSelection(editor: Editor) {\r\n const sel = {\r\n from: editor.state.selection.from,\r\n to: editor.state.selection.to,\r\n };\r\n this.storedSelection = sel;\r\n }\r\n\r\n /**\r\n * Get last captured selection for an editor (if any).\r\n */\r\n getStoredSelection(): ColorPickerSelection | null {\r\n return this.storedSelection;\r\n }\r\n\r\n /**\r\n * To be called when color picking is done (picker closes).\r\n */\r\n done() {\r\n this.storedSelection = null;\r\n }\r\n\r\n /**\r\n * Get the current text color for the selection.\r\n * If multiple colors are present, returns the first found.\r\n */\r\n getCurrentColor(editor: Editor, selection?: ColorPickerSelection): string {\r\n const sel =\r\n selection ??\r\n ({\r\n from: editor.state.selection.from,\r\n to: editor.state.selection.to,\r\n } satisfies ColorPickerSelection);\r\n\r\n const found = this.findFirstAppliedColor(editor, sel);\r\n if (found) return found;\r\n\r\n const attrs = (editor.getAttributes(\"textStyle\") as any) || {};\r\n if (attrs.color) return this.normalizeColor(attrs.color);\r\n\r\n // Dynamic fallback: get current computed text color from editor's DOM\r\n try {\r\n if (typeof window !== \"undefined\" && editor.view?.dom) {\r\n const computedColor = window.getComputedStyle(editor.view.dom).color;\r\n return this.normalizeColor(computedColor);\r\n }\r\n } catch (e) {\r\n // Fail silently and use basic fallback\r\n }\r\n\r\n return \"#000000\";\r\n }\r\n\r\n /**\r\n * Check if a color is explicitly applied on the selection.\r\n */\r\n hasColorApplied(editor: Editor, selection?: ColorPickerSelection): boolean {\r\n const sel =\r\n selection ??\r\n ({\r\n from: editor.state.selection.from,\r\n to: editor.state.selection.to,\r\n } satisfies ColorPickerSelection);\r\n const { from, to } = sel;\r\n\r\n if (from === to) {\r\n const attrs = (editor.getAttributes(\"textStyle\") as any) || {};\r\n return !!attrs.color;\r\n }\r\n\r\n const found = this.findFirstAppliedColor(editor, sel);\r\n if (found) return true;\r\n\r\n const attrs = (editor.getAttributes(\"textStyle\") as any) || {};\r\n return !!attrs.color;\r\n }\r\n\r\n /**\r\n * Normalize color values so they can be used by <input type=\"color\">.\r\n */\r\n normalizeColor(color: string): string {\r\n if (color.startsWith(\"#\")) return color;\r\n\r\n const rgbMatch = color\r\n .trim()\r\n .match(\r\n /^rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)(?:\\s*,\\s*([0-9.]+))?\\s*\\)$/i\r\n );\r\n\r\n if (!rgbMatch) return \"#000000\";\r\n\r\n const r = Math.max(0, Math.min(255, parseInt(rgbMatch[1]!, 10)));\r\n const g = Math.max(0, Math.min(255, parseInt(rgbMatch[2]!, 10)));\r\n const b = Math.max(0, Math.min(255, parseInt(rgbMatch[3]!, 10)));\r\n\r\n return (\r\n \"#\" +\r\n [r, g, b]\r\n .map((n) => n.toString(16).padStart(2, \"0\"))\r\n .join(\"\")\r\n .toLowerCase()\r\n );\r\n }\r\n\r\n /**\r\n * Apply a color to the current selection.\r\n */\r\n applyColor(\r\n editor: Editor,\r\n color: string,\r\n options: { addToHistory?: boolean } = {}\r\n ) {\r\n const sel = this.getStoredSelection() ?? editor.state.selection;\r\n const { addToHistory = true } = options;\r\n\r\n let chain = editor.chain().focus();\r\n\r\n if (sel) {\r\n chain = chain.setTextSelection(sel);\r\n }\r\n\r\n (chain as any).setColor(color);\r\n\r\n if (!addToHistory) {\r\n (chain as any).setMeta(\"addToHistory\", false);\r\n }\r\n\r\n chain.run();\r\n }\r\n\r\n /**\r\n * Unset color on the current selection.\r\n */\r\n unsetColor(editor: Editor, options: { addToHistory?: boolean } = {}) {\r\n const sel = this.getStoredSelection() ?? editor.state.selection;\r\n const { addToHistory = true } = options;\r\n\r\n let chain = editor.chain().focus();\r\n\r\n if (sel) {\r\n chain = chain.setTextSelection(sel);\r\n }\r\n\r\n (chain as any).unsetColor();\r\n\r\n if (!addToHistory) {\r\n (chain as any).setMeta(\"addToHistory\", false);\r\n }\r\n\r\n chain.run();\r\n }\r\n}\r\n","import { Injectable, signal, computed } from \"@angular/core\";\r\n\r\nexport type SupportedLocale = \"en\" | \"fr\";\r\n\r\nexport interface TiptapTranslations {\r\n // Toolbar\r\n toolbar: {\r\n bold: string;\r\n italic: string;\r\n underline: string;\r\n strike: string;\r\n code: string;\r\n superscript: string;\r\n subscript: string;\r\n highlight: string;\r\n heading1: string;\r\n heading2: string;\r\n heading3: string;\r\n bulletList: string;\r\n orderedList: string;\r\n blockquote: string;\r\n alignLeft: string;\r\n alignCenter: string;\r\n alignRight: string;\r\n alignJustify: string;\r\n link: string;\r\n image: string;\r\n horizontalRule: string;\r\n table: string;\r\n undo: string;\r\n redo: string;\r\n clear: string;\r\n textColor: string;\r\n };\r\n\r\n // Bubble Menu\r\n bubbleMenu: {\r\n bold: string;\r\n italic: string;\r\n underline: string;\r\n strike: string;\r\n code: string;\r\n superscript: string;\r\n subscript: string;\r\n highlight: string;\r\n textColor: string;\r\n link: string;\r\n addLink: string;\r\n editLink: string;\r\n removeLink: string;\r\n linkUrl: string;\r\n linkText: string;\r\n openLink: string;\r\n };\r\n\r\n // Slash Commands\r\n slashCommands: {\r\n heading1: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n heading2: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n heading3: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n bulletList: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n orderedList: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n blockquote: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n code: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n image: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n horizontalRule: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n table: {\r\n title: string;\r\n description: string;\r\n keywords: string[];\r\n };\r\n };\r\n\r\n // Table Actions\r\n table: {\r\n addRowBefore: string;\r\n addRowAfter: string;\r\n deleteRow: string;\r\n addColumnBefore: string;\r\n addColumnAfter: string;\r\n deleteColumn: string;\r\n deleteTable: string;\r\n toggleHeaderRow: string;\r\n toggleHeaderColumn: string;\r\n mergeCells: string;\r\n splitCell: string;\r\n };\r\n\r\n // Image Upload\r\n imageUpload: {\r\n selectImage: string;\r\n loadError: string;\r\n uploadingImage: string;\r\n uploadProgress: string;\r\n uploadError: string;\r\n uploadSuccess: string;\r\n imageTooLarge: string;\r\n invalidFileType: string;\r\n dragDropText: string;\r\n changeImage: string;\r\n deleteImage: string;\r\n resizeSmall: string;\r\n resizeMedium: string;\r\n resizeLarge: string;\r\n resizeOriginal: string;\r\n resizing: string;\r\n compressing: string;\r\n compressionError: string;\r\n validating: string;\r\n uploadingToServer: string;\r\n replacingImage: string;\r\n insertingImage: string;\r\n noFileSelected: string;\r\n selectionCancelled: string;\r\n };\r\n\r\n // Editor\r\n editor: {\r\n placeholder: string;\r\n character: string;\r\n word: string;\r\n linkPrompt: string;\r\n linkUrlPrompt: string;\r\n confirmDelete: string;\r\n };\r\n\r\n // Common\r\n common: {\r\n cancel: string;\r\n confirm: string;\r\n apply: string;\r\n delete: string;\r\n save: string;\r\n close: string;\r\n loading: string;\r\n error: string;\r\n success: string;\r\n };\r\n}\r\n\r\nconst ENGLISH_TRANSLATIONS: TiptapTranslations = {\r\n toolbar: {\r\n bold: \"Bold\",\r\n italic: \"Italic\",\r\n underline: \"Underline\",\r\n strike: \"Strikethrough\",\r\n code: \"Code\",\r\n superscript: \"Superscript\",\r\n subscript: \"Subscript\",\r\n highlight: \"Highlight\",\r\n heading1: \"Heading 1\",\r\n heading2: \"Heading 2\",\r\n heading3: \"Heading 3\",\r\n bulletList: \"Bullet List\",\r\n orderedList: \"Ordered List\",\r\n blockquote: \"Blockquote\",\r\n alignLeft: \"Align Left\",\r\n alignCenter: \"Align Center\",\r\n alignRight: \"Align Right\",\r\n alignJustify: \"Align Justify\",\r\n link: \"Add Link\",\r\n image: \"Add Image\",\r\n horizontalRule: \"Horizontal Rule\",\r\n table: \"Insert Table\",\r\n undo: \"Undo\",\r\n redo: \"Redo\",\r\n clear: \"Clear\",\r\n textColor: \"Text Color\",\r\n },\r\n bubbleMenu: {\r\n bold: \"Bold\",\r\n italic: \"Italic\",\r\n underline: \"Underline\",\r\n strike: \"Strikethrough\",\r\n code: \"Code\",\r\n superscript: \"Superscript\",\r\n subscript: \"Subscript\",\r\n highlight: \"Highlight\",\r\n textColor: \"Text Color\",\r\n link: \"Link\",\r\n addLink: \"Add Link\",\r\n editLink: \"Edit Link\",\r\n removeLink: \"Remove Link\",\r\n linkUrl: \"Link URL\",\r\n linkText: \"Link Text\",\r\n openLink: \"Open Link\",\r\n },\r\n slashCommands: {\r\n heading1: {\r\n title: \"Heading 1\",\r\n description: \"Large section heading\",\r\n keywords: [\"heading\", \"h1\", \"title\", \"1\", \"header\"],\r\n },\r\n heading2: {\r\n title: \"Heading 2\",\r\n description: \"Medium section heading\",\r\n keywords: [\"heading\", \"h2\", \"title\", \"2\", \"header\"],\r\n },\r\n heading3: {\r\n title: \"Heading 3\",\r\n description: \"Small section heading\",\r\n keywords: [\"heading\", \"h3\", \"title\", \"3\", \"header\"],\r\n },\r\n bulletList: {\r\n title: \"Bullet List\",\r\n description: \"Create a bullet list\",\r\n keywords: [\"bullet\", \"list\", \"ul\", \"unordered\"],\r\n },\r\n orderedList: {\r\n title: \"Ordered List\",\r\n description: \"Create an ordered list\",\r\n keywords: [\"ordered\", \"list\", \"ol\", \"numbered\"],\r\n },\r\n blockquote: {\r\n title: \"Blockquote\",\r\n description: \"Add a blockquote\",\r\n keywords: [\"quote\", \"blockquote\", \"citation\"],\r\n },\r\n code: {\r\n title: \"Code Block\",\r\n description: \"Add a code block\",\r\n keywords: [\"code\", \"codeblock\", \"pre\", \"programming\"],\r\n },\r\n image: {\r\n title: \"Image\",\r\n description: \"Insert an image\",\r\n keywords: [\"image\", \"photo\", \"picture\", \"img\"],\r\n },\r\n horizontalRule: {\r\n title: \"Horizontal Rule\",\r\n description: \"Add a horizontal line\",\r\n keywords: [\"hr\", \"horizontal\", \"rule\", \"line\", \"separator\"],\r\n },\r\n table: {\r\n title: \"Table\",\r\n description: \"Insert a table\",\r\n keywords: [\"table\", \"grid\", \"data\", \"rows\", \"columns\"],\r\n },\r\n },\r\n table: {\r\n addRowBefore: \"Add row before\",\r\n addRowAfter: \"Add row after\",\r\n deleteRow: \"Delete row\",\r\n addColumnBefore: \"Add column before\",\r\n addColumnAfter: \"Add column after\",\r\n deleteColumn: \"Delete column\",\r\n deleteTable: \"Delete table\",\r\n toggleHeaderRow: \"Toggle header row\",\r\n toggleHeaderColumn: \"Toggle header column\",\r\n mergeCells: \"Merge cells\",\r\n splitCell: \"Split cell\",\r\n },\r\n imageUpload: {\r\n selectImage: \"Select Image\",\r\n loadError: \"Error loading image\",\r\n uploadingImage: \"Uploading image...\",\r\n uploadProgress: \"Upload Progress\",\r\n uploadError: \"Upload Error\",\r\n uploadSuccess: \"Upload Success\",\r\n imageTooLarge: \"Image too large\",\r\n invalidFileType: \"Invalid file type\",\r\n dragDropText: \"Drag and drop images here\",\r\n changeImage: \"Change Image\",\r\n deleteImage: \"Delete Image\",\r\n resizeSmall: \"Small\",\r\n resizeMedium: \"Medium\",\r\n resizeLarge: \"Large\",\r\n resizeOriginal: \"Original\",\r\n resizing: \"Resizing...\",\r\n compressing: \"Compressing...\",\r\n compressionError: \"Error during compression\",\r\n validating: \"Validating file...\",\r\n uploadingToServer: \"Uploading to server...\",\r\n replacingImage: \"Replacing image...\",\r\n insertingImage: \"Inserting into editor...\",\r\n noFileSelected: \"No image file selected\",\r\n selectionCancelled: \"Selection cancelled\",\r\n },\r\n editor: {\r\n placeholder: \"Start typing...\",\r\n character: \"character\",\r\n word: \"word\",\r\n linkPrompt: \"Enter link URL\",\r\n linkUrlPrompt: \"Enter URL\",\r\n confirmDelete: \"Are you sure you want to delete this?\",\r\n },\r\n common: {\r\n cancel: \"Cancel\",\r\n confirm: \"Confirm\",\r\n apply: \"Apply\",\r\n delete: \"Delete\",\r\n save: \"Save\",\r\n close: \"Close\",\r\n loading: \"Loading\",\r\n error: \"Error\",\r\n success: \"Success\",\r\n },\r\n};\r\n\r\nconst FRENCH_TRANSLATIONS: TiptapTranslations = {\r\n toolbar: {\r\n bold: \"Gras\",\r\n italic: \"Italique\",\r\n underline: \"Souligné\",\r\n strike: \"Barré\",\r\n code: \"Code\",\r\n superscript: \"Exposant\",\r\n subscript: \"Indice\",\r\n highlight: \"Surligner\",\r\n heading1: \"Titre 1\",\r\n heading2: \"Titre 2\",\r\n heading3: \"Titre 3\",\r\n bulletList: \"Liste à puces\",\r\n orderedList: \"Liste numérotée\",\r\n blockquote: \"Citation\",\r\n alignLeft: \"Aligner à gauche\",\r\n alignCenter: \"Centrer\",\r\n alignRight: \"Aligner à droite\",\r\n alignJustify: \"Justifier\",\r\n link: \"Ajouter un lien\",\r\n image: \"Ajouter une image\",\r\n horizontalRule: \"Ligne horizontale\",\r\n table: \"Insérer un tableau\",\r\n undo: \"Annuler\",\r\n redo: \"Refaire\",\r\n clear: \"Vider\",\r\n textColor: \"Couleur texte\",\r\n },\r\n bubbleMenu: {\r\n bold: \"Gras\",\r\n italic: \"Italique\",\r\n underline: \"Souligné\",\r\n strike: \"Barré\",\r\n code: \"Code\",\r\n superscript: \"Exposant\",\r\n subscript: \"Indice\",\r\n highlight: \"Surligner\",\r\n textColor: \"Couleur texte\",\r\n link: \"Lien\",\r\n addLink: \"Ajouter un lien\",\r\n editLink: \"Modifier le lien\",\r\n removeLink: \"Supprimer le lien\",\r\n linkUrl: \"URL du lien\",\r\n linkText: \"Texte du lien\",\r\n openLink: \"Ouvrir le lien\",\r\n },\r\n slashCommands: {\r\n heading1: {\r\n title: \"Titre 1\",\r\n description: \"Grand titre de section\",\r\n keywords: [\"heading\", \"h1\", \"titre\", \"title\", \"1\", \"header\"],\r\n },\r\n heading2: {\r\n title: \"Titre 2\",\r\n description: \"Titre de sous-section\",\r\n keywords: [\"heading\", \"h2\", \"titre\", \"title\", \"2\", \"header\"],\r\n },\r\n heading3: {\r\n title: \"Titre 3\",\r\n description: \"Petit titre\",\r\n keywords: [\"heading\", \"h3\", \"titre\", \"title\", \"3\", \"header\"],\r\n },\r\n bulletList: {\r\n title: \"Liste à puces\",\r\n description: \"Créer une liste à puces\",\r\n keywords: [\"bullet\", \"list\", \"liste\", \"puces\", \"ul\"],\r\n },\r\n orderedList: {\r\n title: \"Liste numérotée\",\r\n description: \"Créer une liste numérotée\",\r\n keywords: [\"numbered\", \"list\", \"liste\", \"numérotée\", \"ol\", \"ordered\"],\r\n },\r\n blockquote: {\r\n title: \"Citation\",\r\n description: \"Ajouter une citation\",\r\n keywords: [\"quote\", \"blockquote\", \"citation\"],\r\n },\r\n code: {\r\n title: \"Bloc de code\",\r\n description: \"Ajouter un bloc de code\",\r\n keywords: [\"code\", \"codeblock\", \"pre\", \"programmation\"],\r\n },\r\n image: {\r\n title: \"Image\",\r\n description: \"Insérer une image\",\r\n keywords: [\"image\", \"photo\", \"picture\", \"img\"],\r\n },\r\n horizontalRule: {\r\n title: \"Ligne horizontale\",\r\n description: \"Ajouter une ligne de séparation\",\r\n keywords: [\"hr\", \"horizontal\", \"rule\", \"ligne\", \"séparation\"],\r\n },\r\n table: {\r\n title: \"Tableau\",\r\n description: \"Insérer un tableau\",\r\n keywords: [\r\n \"table\",\r\n \"tableau\",\r\n \"grid\",\r\n \"grille\",\r\n \"data\",\r\n \"données\",\r\n \"rows\",\r\n \"colonnes\",\r\n ],\r\n },\r\n },\r\n table: {\r\n addRowBefore: \"Ajouter une ligne avant\",\r\n addRowAfter: \"Ajouter une ligne après\",\r\n deleteRow: \"Supprimer la ligne\",\r\n addColumnBefore: \"Ajouter une colonne avant\",\r\n addColumnAfter: \"Ajouter une colonne après\",\r\n deleteColumn: \"Supprimer la colonne\",\r\n deleteTable: \"Supprimer le tableau\",\r\n toggleHeaderRow: \"Basculer ligne d'en-tête\",\r\n toggleHeaderColumn: \"Basculer colonne d'en-tête\",\r\n mergeCells: \"Fusionner les cellules\",\r\n splitCell: \"Diviser la cellule\",\r\n },\r\n imageUpload: {\r\n selectImage: \"Sélectionner une image\",\r\n loadError: \"Erreur de chargement de l'image\",\r\n uploadingImage: \"Téléchargement de l'image...\",\r\n uploadProgress: \"Progression du téléchargement\",\r\n uploadError: \"Erreur de téléchargement\",\r\n uploadSuccess: \"Téléchargement réussi\",\r\n imageTooLarge: \"Image trop volumineuse\",\r\n invalidFileType: \"Type de fichier invalide\",\r\n dragDropText: \"Glissez et déposez des images ici\",\r\n changeImage: \"Changer l'image\",\r\n deleteImage: \"Supprimer l'image\",\r\n resizeSmall: \"Petit\",\r\n resizeMedium: \"Moyen\",\r\n resizeLarge: \"Grand\",\r\n resizeOriginal: \"Original\",\r\n resizing: \"Redimensionnement...\",\r\n compressing: \"Compression...\",\r\n compressionError: \"Erreur lors de la compression\",\r\n validating: \"Validation du fichier...\",\r\n uploadingToServer: \"Upload vers le serveur...\",\r\n replacingImage: \"Remplacement de l'image...\",\r\n insertingImage: \"Insertion dans l'éditeur...\",\r\n noFileSelected: \"Aucun fichier image sélectionné\",\r\n selectionCancelled: \"Sélection annulée\",\r\n },\r\n editor: {\r\n placeholder: \"Commencez à écrire...\",\r\n character: \"caractère\",\r\n word: \"mot\",\r\n linkPrompt: \"Entrez l'URL du lien\",\r\n linkUrlPrompt: \"Entrez l'URL\",\r\n confirmDelete: \"Êtes-vous sûr de vouloir supprimer ceci ?\",\r\n },\r\n common: {\r\n cancel: \"Annuler\",\r\n confirm: \"Confirmer\",\r\n apply: \"Appliquer\",\r\n delete: \"Supprimer\",\r\n save: \"Sauvegarder\",\r\n close: \"Fermer\",\r\n loading: \"Chargement\",\r\n error: \"Erreur\",\r\n success: \"Succès\",\r\n },\r\n};\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class TiptapI18nService {\r\n private _currentLocale = signal<SupportedLocale>(\"en\");\r\n private _translations = signal<Record<SupportedLocale, TiptapTranslations>>({\r\n en: ENGLISH_TRANSLATIONS,\r\n fr: FRENCH_TRANSLATIONS,\r\n });\r\n\r\n // Signaux publics\r\n readonly currentLocale = this._currentLocale.asReadonly();\r\n readonly translations = computed(\r\n () => this._translations()[this._currentLocale()]\r\n );\r\n\r\n // Méthodes de traduction rapides\r\n readonly t = computed(() => this.translations());\r\n readonly toolbar = computed(() => this.translations().toolbar);\r\n readonly bubbleMenu = computed(() => this.translations().bubbleMenu);\r\n readonly slashCommands = computed(() => this.translations().slashCommands);\r\n readonly table = computed(() => this.translations().table);\r\n readonly imageUpload = computed(() => this.translations().imageUpload);\r\n readonly editor = computed(() => this.translations().editor);\r\n readonly common = computed(() => this.translations().common);\r\n\r\n constructor() {\r\n // Détecter automatiquement la langue du navigateur\r\n this.detectBrowserLanguage();\r\n }\r\n\r\n setLocale(locale: SupportedLocale): void {\r\n this._currentLocale.set(locale);\r\n }\r\n\r\n autoDetectLocale(): void {\r\n this.detectBrowserLanguage();\r\n }\r\n\r\n getSupportedLocales(): SupportedLocale[] {\r\n return Object.keys(this._translations()) as SupportedLocale[];\r\n }\r\n\r\n addTranslations(\r\n locale: SupportedLocale,\r\n translations: Partial<TiptapTranslations>\r\n ): void {\r\n this._translations.update((current) => ({\r\n ...current,\r\n [locale]: {\r\n ...current[locale],\r\n ...translations,\r\n },\r\n }));\r\n }\r\n\r\n private detectBrowserLanguage(): void {\r\n const browserLang = navigator.language.toLowerCase();\r\n if (browserLang.startsWith(\"fr\")) {\r\n this._currentLocale.set(\"fr\");\r\n } else {\r\n this._currentLocale.set(\"en\");\r\n }\r\n }\r\n\r\n // Méthodes utilitaires pour les composants\r\n getToolbarTitle(key: keyof TiptapTranslations[\"toolbar\"]): string {\r\n return this.translations().toolbar[key];\r\n }\r\n\r\n getBubbleMenuTitle(key: keyof TiptapTranslations[\"bubbleMenu\"]): string {\r\n return this.translations().bubbleMenu[key];\r\n }\r\n\r\n getSlashCommand(key: keyof TiptapTranslations[\"slashCommands\"]) {\r\n return this.translations().slashCommands[key];\r\n }\r\n}\r\n","import {\r\n Component,\r\n ElementRef,\r\n computed,\r\n effect,\r\n inject,\r\n input,\r\n output,\r\n signal,\r\n viewChild,\r\n} from \"@angular/core\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { ColorPickerService } from \"../services/color-picker.service\";\r\nimport { TiptapButtonComponent } from \"../tiptap-button.component\";\r\nimport { TiptapI18nService } from \"../services/i18n.service\";\r\n\r\n@Component({\r\n selector: \"tiptap-text-color-picker\",\r\n standalone: true,\r\n imports: [TiptapButtonComponent],\r\n template: `\r\n <div class=\"text-color-picker-container\">\r\n <tiptap-button\r\n icon=\"format_color_text\"\r\n [title]=\"t().textColor\"\r\n [color]=\"hasColorApplied() ? currentColor() : 'var(--ate-text)'\"\r\n (onClick)=\"triggerPicker()\"\r\n >\r\n <input\r\n #colorInput\r\n type=\"color\"\r\n [value]=\"currentColor()\"\r\n (mousedown)=\"onColorMouseDown($event)\"\r\n (input)=\"onColorInput($event)\"\r\n (change)=\"onColorPickerClose()\"\r\n (blur)=\"onColorPickerClose()\"\r\n />\r\n </tiptap-button>\r\n\r\n @if (hasColorApplied()) {\r\n <button\r\n class=\"btn-clear-badge\"\r\n type=\"button\"\r\n [title]=\"t().clear\"\r\n (mousedown)=\"onClearBadgeMouseDown($event)\"\r\n (click)=\"onClearBadgeClick($event)\"\r\n >\r\n <span class=\"material-symbols-outlined\">close</span>\r\n </button>\r\n }\r\n </div>\r\n `,\r\n styles: [\r\n `\r\n .text-color-picker-container {\r\n position: relative;\r\n display: inline-flex;\r\n align-items: center;\r\n }\r\n\r\n .text-color-picker-container tiptap-button {\r\n position: relative;\r\n }\r\n\r\n .btn-clear-badge {\r\n position: absolute;\r\n top: -4px;\r\n right: -4px;\r\n width: 14px;\r\n height: 14px;\r\n padding: 0;\r\n border: none;\r\n border-radius: 999px;\r\n background: rgba(15, 23, 42, 0.75);\r\n color: #ffffff;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n z-index: 10;\r\n opacity: 0;\r\n pointer-events: none;\r\n transition: opacity 120ms ease;\r\n }\r\n\r\n .text-color-picker-container:hover .btn-clear-badge {\r\n opacity: 1;\r\n pointer-events: auto;\r\n }\r\n\r\n .btn-clear-badge .material-symbols-outlined {\r\n font-size: 10px;\r\n line-height: 1;\r\n }\r\n\r\n input[type=\"color\"] {\r\n position: absolute;\r\n inset: 0;\r\n opacity: 0;\r\n width: 100%;\r\n height: 100%;\r\n cursor: pointer;\r\n z-index: 5;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapTextColorPickerComponent {\r\n editor = input.required<Editor>();\r\n\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const update = () => this.notifyEditorChange();\r\n\r\n ed.on(\"transaction\", update);\r\n ed.on(\"selectionUpdate\", update);\r\n ed.on(\"focus\", update);\r\n\r\n return () => {\r\n ed.off(\"transaction\", update);\r\n ed.off(\"selectionUpdate\", update);\r\n ed.off(\"focus\", update);\r\n };\r\n });\r\n }\r\n\r\n interactionChange = output<boolean>();\r\n requestUpdate = output<void>();\r\n\r\n private colorInputRef = viewChild<ElementRef<HTMLInputElement>>(\"colorInput\");\r\n\r\n private colorPickerSvc = inject(ColorPickerService);\r\n private i18nService = inject(TiptapI18nService);\r\n\r\n readonly t = this.i18nService.toolbar;\r\n\r\n private previewColor = signal<string | null>(null);\r\n private isPicking = signal(false);\r\n private editorChange = signal(0);\r\n\r\n /**\r\n * Notify Angular that the editor state should be re-read.\r\n */\r\n private notifyEditorChange() {\r\n this.editorChange.update((v) => v + 1);\r\n }\r\n\r\n readonly currentColor = computed(() => {\r\n this.editorChange();\r\n if (this.previewColor()) return this.previewColor()!;\r\n return this.colorPickerSvc.getCurrentColor(this.editor());\r\n });\r\n\r\n readonly hasColorApplied = computed(() => {\r\n this.editorChange();\r\n return this.previewColor()\r\n ? true\r\n : this.colorPickerSvc.hasColorApplied(this.editor());\r\n });\r\n\r\n private _syncEffect = void effect(() => {\r\n const el = this.colorInputRef()?.nativeElement;\r\n if (!el) return;\r\n el.value = this.currentColor();\r\n });\r\n\r\n /**\r\n * Keep the native <input type=\"color\"> in sync with selection changes.\r\n */\r\n syncColorInputValue() {\r\n this.previewColor.set(null);\r\n this.isPicking.set(false);\r\n\r\n // Reason: force recomputation from editor selection when bubble menu re-opens.\r\n this.notifyEditorChange();\r\n }\r\n\r\n /**\r\n * Programmatically click the hidden color input.\r\n */\r\n triggerPicker() {\r\n this.colorInputRef()?.nativeElement.click();\r\n }\r\n\r\n /**\r\n * Preserve selection while interacting with native color input.\r\n */\r\n onColorMouseDown(event: MouseEvent) {\r\n event.stopPropagation();\r\n\r\n this.colorPickerSvc.captureSelection(this.editor());\r\n this.isPicking.set(true);\r\n this.interactionChange.emit(true);\r\n }\r\n\r\n /**\r\n * Called when the native color picker is closed.\r\n */\r\n onColorPickerClose() {\r\n this.previewColor.set(null);\r\n this.isPicking.set(false);\r\n\r\n // Commit the final color to history\r\n const inputEl = this.colorInputRef()?.nativeElement;\r\n if (inputEl) {\r\n this.colorPickerSvc.applyColor(this.editor(), inputEl.value, {\r\n addToHistory: true,\r\n });\r\n }\r\n\r\n this.colorPickerSvc.done();\r\n this.interactionChange.emit(false);\r\n this.requestUpdate.emit();\r\n }\r\n\r\n /**\r\n * Apply selected color.\r\n */\r\n onColorInput(event: Event) {\r\n const inputEl = event.target as HTMLInputElement;\r\n const color = inputEl.value;\r\n\r\n // Update the UI immediately while the user drags in the native picker.\r\n this.previewColor.set(this.colorPickerSvc.normalizeColor(color));\r\n\r\n // Live preview WITHOUT history pollution\r\n this.colorPickerSvc.applyColor(this.editor(), color, {\r\n addToHistory: false,\r\n });\r\n\r\n this.requestUpdate.emit();\r\n }\r\n\r\n /**\r\n * Prevent opening the native picker when clicking the clear badge.\r\n */\r\n onClearBadgeMouseDown(event: MouseEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n\r\n /**\r\n * Clear color via the badge.\r\n */\r\n onClearBadgeClick(event: MouseEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.previewColor.set(null);\r\n this.isPicking.set(false);\r\n this.colorPickerSvc.unsetColor(this.editor());\r\n this.requestUpdate.emit();\r\n }\r\n\r\n /**\r\n * Called when the color picker is done interacting.\r\n */\r\n done() {\r\n this.colorPickerSvc.done();\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n signal,\r\n computed,\r\n inject,\r\n} from \"@angular/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { CellSelection } from \"@tiptap/pm/tables\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapTextColorPickerComponent } from \"./components/tiptap-text-color-picker.component\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\n\r\nimport { BubbleMenuConfig } from \"./models/bubble-menu.model\";\r\n\r\n@Component({\r\n selector: \"tiptap-bubble-menu\",\r\n standalone: true,\r\n imports: [TiptapButtonComponent, TiptapTextColorPickerComponent],\r\n template: `\r\n <div #menuRef class=\"bubble-menu\">\r\n @if (bubbleMenuConfig().bold) {\r\n <tiptap-button\r\n icon=\"format_bold\"\r\n [title]=\"t().bold\"\r\n [active]=\"isActive('bold')\"\r\n (click)=\"onCommand('bold', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().italic) {\r\n <tiptap-button\r\n icon=\"format_italic\"\r\n [title]=\"t().italic\"\r\n [active]=\"isActive('italic')\"\r\n (click)=\"onCommand('italic', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().underline) {\r\n <tiptap-button\r\n icon=\"format_underlined\"\r\n [title]=\"t().underline\"\r\n [active]=\"isActive('underline')\"\r\n (click)=\"onCommand('underline', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().strike) {\r\n <tiptap-button\r\n icon=\"strikethrough_s\"\r\n [title]=\"t().strike\"\r\n [active]=\"isActive('strike')\"\r\n (click)=\"onCommand('strike', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().superscript) {\r\n <tiptap-button\r\n icon=\"superscript\"\r\n [title]=\"t().superscript\"\r\n [active]=\"isActive('superscript')\"\r\n (click)=\"onCommand('superscript', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().subscript) {\r\n <tiptap-button\r\n icon=\"subscript\"\r\n [title]=\"t().subscript\"\r\n [active]=\"isActive('subscript')\"\r\n (click)=\"onCommand('subscript', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().highlight) {\r\n <tiptap-button\r\n icon=\"highlight\"\r\n [title]=\"t().highlight\"\r\n [active]=\"isActive('highlight')\"\r\n (click)=\"onCommand('highlight', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().textColor) {\r\n <tiptap-text-color-picker\r\n #textColorPicker\r\n [editor]=\"editor()\"\r\n (interactionChange)=\"onColorPickerInteractionChange($event)\"\r\n (requestUpdate)=\"updateMenu()\"\r\n />\r\n } @if (bubbleMenuConfig().separator && (bubbleMenuConfig().code ||\r\n bubbleMenuConfig().link)) {\r\n <div class=\"tiptap-separator\"></div>\r\n } @if (bubbleMenuConfig().code) {\r\n <tiptap-button\r\n icon=\"code\"\r\n [title]=\"t().code\"\r\n [active]=\"isActive('code')\"\r\n (click)=\"onCommand('code', $event)\"\r\n ></tiptap-button>\r\n } @if (bubbleMenuConfig().link) {\r\n <tiptap-button\r\n icon=\"link\"\r\n [title]=\"t().link\"\r\n [active]=\"isActive('link')\"\r\n (click)=\"onCommand('link', $event)\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n})\r\nexport class TiptapBubbleMenuComponent implements OnInit, OnDestroy {\r\n private readonly i18nService = inject(TiptapI18nService);\r\n readonly t = this.i18nService.bubbleMenu;\r\n\r\n editor = input.required<Editor>();\r\n config = input<BubbleMenuConfig>({\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n textColor: false,\r\n link: true,\r\n separator: true,\r\n });\r\n\r\n @ViewChild(\"menuRef\", { static: false }) menuRef!: ElementRef<HTMLDivElement>;\r\n @ViewChild(\"textColorPicker\", { static: false })\r\n private textColorPicker?: TiptapTextColorPickerComponent;\r\n\r\n private tippyInstance: TippyInstance | null = null;\r\n private updateTimeout: any = null;\r\n\r\n private isColorPickerInteracting = false;\r\n\r\n bubbleMenuConfig = computed(() => ({\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n textColor: false,\r\n link: true,\r\n separator: true,\r\n ...this.config(),\r\n }));\r\n\r\n /**\r\n * Keep bubble menu visible while the native color picker steals focus.\r\n */\r\n onColorPickerInteractionChange(isInteracting: boolean) {\r\n this.isColorPickerInteracting = isInteracting;\r\n }\r\n\r\n // Effect comme propriété de classe pour éviter l'erreur d'injection context\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n // Nettoyer les anciens listeners\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n ed.on(\"selectionUpdate\", this.updateMenu);\r\n ed.on(\"transaction\", this.updateMenu);\r\n ed.on(\"focus\", this.updateMenu);\r\n ed.on(\"blur\", this.handleBlur);\r\n\r\n // Ne pas appeler updateMenu() ici pour éviter l'affichage prématuré\r\n // Il sera appelé automatiquement quand l'éditeur sera prêt\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n // Initialiser Tippy de manière synchrone après que le component soit ready\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n // Nettoyer les timeouts\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n // Nettoyer Tippy\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n this.tippyInstance = null;\r\n }\r\n }\r\n\r\n private initTippy() {\r\n // Attendre que l'élément soit disponible\r\n if (!this.menuRef?.nativeElement) {\r\n setTimeout(() => this.initTippy(), 50);\r\n return;\r\n }\r\n\r\n const menuElement = this.menuRef.nativeElement;\r\n\r\n // S'assurer qu'il n'y a pas déjà une instance\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"top-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getSelectionRect(),\r\n // Améliorer le positionnement avec scroll\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getSelectionRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n const { from, to } = ed.state.selection;\r\n if (from === to) return new DOMRect(0, 0, 0, 0);\r\n\r\n // 1. Try native selection for multi-line accuracy\r\n const selection = window.getSelection();\r\n if (selection && selection.rangeCount > 0) {\r\n const range = selection.getRangeAt(0);\r\n const rect = range.getBoundingClientRect();\r\n\r\n // Ensure the rect is valid and belongs to the editor\r\n if (rect.width > 0 && rect.height > 0) {\r\n return rect;\r\n }\r\n }\r\n\r\n // 2. Fallback to Tiptap coordinates for precision (single line / edge cases)\r\n const start = ed.view.coordsAtPos(from);\r\n const end = ed.view.coordsAtPos(to);\r\n\r\n const top = Math.min(start.top, end.top);\r\n const bottom = Math.max(start.bottom, end.bottom);\r\n const left = Math.min(start.left, end.left);\r\n const right = Math.max(start.right, end.right);\r\n\r\n return new DOMRect(left, top, right - left, bottom - top);\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n if (!this.isColorPickerInteracting && this.textColorPicker) {\r\n this.textColorPicker.done();\r\n }\r\n\r\n const { selection } = ed.state;\r\n const { from, to } = selection;\r\n const hasTextSelection =\r\n from !== to && !(selection instanceof CellSelection);\r\n const isImageSelected =\r\n ed.isActive(\"image\") || ed.isActive(\"resizableImage\");\r\n const isTableCellSelected =\r\n ed.isActive(\"tableCell\") || ed.isActive(\"tableHeader\");\r\n const hasCellSelection = selection instanceof CellSelection;\r\n\r\n // Ne montrer le menu texte que si :\r\n // - Il y a une sélection de texte (pas une sélection de cellules multiples)\r\n // - Aucune image n'est sélectionnée (priorité aux images)\r\n // - Ce n'est pas une sélection de cellules multiples (CellSelection)\r\n // - L'éditeur est éditable\r\n // Note: Le texte dans une cellule est autorisé (isTableCellSelected peut être true)\r\n const shouldShow =\r\n hasTextSelection &&\r\n !isImageSelected &&\r\n !hasCellSelection &&\r\n ed.isEditable;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n if (!this.isColorPickerInteracting) {\r\n this.hideTippy();\r\n }\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n if (!this.isColorPickerInteracting && this.textColorPicker) {\r\n this.textColorPicker.done();\r\n this.hideTippy();\r\n }\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Cette méthode peut être étendue pour fermer d'autres menus si nécessaire\r\n // Pour l'instant, elle sert de placeholder pour une future coordination entre menus\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getSelectionRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n\r\n this.textColorPicker?.syncColorInputValue();\r\n }\r\n\r\n hideTippy() {\r\n if (this.tippyInstance) {\r\n this.tippyInstance.hide();\r\n }\r\n }\r\n\r\n isActive(mark: string): boolean {\r\n const ed = this.editor();\r\n return ed?.isActive(mark) || false;\r\n }\r\n\r\n onCommand(command: string, event: MouseEvent) {\r\n event.preventDefault();\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n switch (command) {\r\n case \"bold\":\r\n ed.chain().focus().toggleBold().run();\r\n break;\r\n case \"italic\":\r\n ed.chain().focus().toggleItalic().run();\r\n break;\r\n case \"underline\":\r\n ed.chain().focus().toggleUnderline().run();\r\n break;\r\n case \"strike\":\r\n ed.chain().focus().toggleStrike().run();\r\n break;\r\n case \"code\":\r\n ed.chain().focus().toggleCode().run();\r\n break;\r\n case \"superscript\":\r\n ed.chain().focus().toggleSuperscript().run();\r\n break;\r\n case \"subscript\":\r\n ed.chain().focus().toggleSubscript().run();\r\n break;\r\n case \"highlight\":\r\n ed.chain().focus().toggleHighlight().run();\r\n break;\r\n case \"link\":\r\n const href = window.prompt(this.i18nService.editor().linkPrompt);\r\n if (href) {\r\n ed.chain().focus().toggleLink({ href }).run();\r\n }\r\n break;\r\n }\r\n }\r\n}\r\n","import { Component, input } from \"@angular/core\";\r\n\r\n@Component({\r\n selector: \"tiptap-separator\",\r\n standalone: true,\r\n template: `\r\n <div\r\n class=\"tiptap-separator\"\r\n [class.vertical]=\"orientation() === 'vertical'\"\r\n [class.horizontal]=\"orientation() === 'horizontal'\"\r\n [class.small]=\"size() === 'small'\"\r\n [class.medium]=\"size() === 'medium'\"\r\n [class.large]=\"size() === 'large'\"\r\n ></div>\r\n `,\r\n styles: [\r\n `\r\n .tiptap-separator {\r\n background-color: var(--ate-border, #e2e8f0);\r\n margin: 0;\r\n }\r\n\r\n .tiptap-separator.vertical {\r\n width: 1px;\r\n height: 24px;\r\n margin: 0 8px;\r\n }\r\n\r\n .tiptap-separator.horizontal {\r\n height: 1px;\r\n width: 100%;\r\n margin: 8px 0;\r\n }\r\n\r\n .tiptap-separator.small.vertical {\r\n height: 16px;\r\n margin: 0 4px;\r\n }\r\n\r\n .tiptap-separator.small.horizontal {\r\n margin: 4px 0;\r\n }\r\n\r\n .tiptap-separator.medium.vertical {\r\n height: 24px;\r\n margin: 0 8px;\r\n }\r\n\r\n .tiptap-separator.medium.horizontal {\r\n margin: 8px 0;\r\n }\r\n\r\n .tiptap-separator.large.vertical {\r\n height: 32px;\r\n margin: 0 12px;\r\n }\r\n\r\n .tiptap-separator.large.horizontal {\r\n margin: 12px 0;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapSeparatorComponent {\r\n orientation = input<\"vertical\" | \"horizontal\">(\"vertical\");\r\n size = input<\"small\" | \"medium\" | \"large\">(\"medium\");\r\n}\r\n","import { Injectable, signal, computed, inject } from \"@angular/core\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { Observable, isObservable, firstValueFrom } from \"rxjs\";\r\nimport { TiptapI18nService } from \"./i18n.service\";\r\n\r\nexport interface ImageData {\r\n src: string;\r\n alt?: string;\r\n title?: string;\r\n width?: number;\r\n height?: number;\r\n}\r\n\r\nexport interface ImageUploadResult {\r\n src: string;\r\n name: string;\r\n size: number;\r\n type: string;\r\n width?: number;\r\n height?: number;\r\n originalSize?: number;\r\n}\r\n\r\nexport interface ResizeOptions {\r\n width?: number;\r\n height?: number;\r\n maintainAspectRatio?: boolean;\r\n}\r\n\r\n/**\r\n * Context passed to the image upload handler containing information about the image\r\n */\r\nexport interface ImageUploadContext {\r\n /** Original file being uploaded */\r\n file: File;\r\n /** Width of the processed image */\r\n width: number;\r\n /** Height of the processed image */\r\n height: number;\r\n /** MIME type of the image */\r\n type: string;\r\n /** Base64 data URL of the processed image (after compression/resize) */\r\n base64: string;\r\n}\r\n\r\n/**\r\n * Result expected from a custom image upload handler.\r\n * Must contain at least the `src` property with the image URL.\r\n */\r\nexport interface ImageUploadHandlerResult {\r\n /** URL of the uploaded image (can be a remote URL or any string) */\r\n src: string;\r\n /** Optional custom alt text */\r\n alt?: string;\r\n /** Optional custom title */\r\n title?: string;\r\n}\r\n\r\n/**\r\n * Custom handler function for image uploads.\r\n * Allows users to implement their own image storage logic (e.g., upload to S3, Cloudinary, etc.)\r\n *\r\n * Can return either a Promise or an Observable (Angular-friendly).\r\n *\r\n * @param context - Context containing the image file and metadata\r\n * @returns Promise or Observable resolving to ImageUploadHandlerResult\r\n *\r\n * @example Using Promise (async/await)\r\n * ```typescript\r\n * uploadHandler: ImageUploadHandler = async (ctx) => {\r\n * const formData = new FormData();\r\n * formData.append('image', ctx.file);\r\n * const result = await firstValueFrom(this.http.post<{url: string}>('/api/upload', formData));\r\n * return { src: result.url };\r\n * };\r\n * ```\r\n *\r\n * @example Using Observable (Angular HttpClient)\r\n * ```typescript\r\n * uploadHandler: ImageUploadHandler = (ctx) => {\r\n * const formData = new FormData();\r\n * formData.append('image', ctx.file);\r\n * return this.http.post<{url: string}>('/api/upload', formData).pipe(\r\n * map(result => ({ src: result.url }))\r\n * );\r\n * };\r\n * ```\r\n */\r\nexport type ImageUploadHandler = (\r\n context: ImageUploadContext\r\n) => Promise<ImageUploadHandlerResult> | Observable<ImageUploadHandlerResult>;\r\n\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class ImageService {\r\n // Signals pour l'état des images\r\n selectedImage = signal<ImageData | null>(null);\r\n isImageSelected = computed(() => this.selectedImage() !== null);\r\n // Resizing signals\r\n isResizing = signal(false);\r\n\r\n private i18n = inject(TiptapI18nService);\r\n private readonly t = this.i18n.imageUpload;\r\n\r\n // Signaux pour l'upload\r\n isUploading = signal(false);\r\n uploadProgress = signal(0);\r\n uploadMessage = signal(\"\");\r\n\r\n /**\r\n * Custom upload handler for images.\r\n * When set, this handler will be called instead of the default base64 conversion.\r\n * This allows users to implement their own image storage logic.\r\n *\r\n * @example\r\n * ```typescript\r\n * imageService.uploadHandler = async (context) => {\r\n * const formData = new FormData();\r\n * formData.append('image', context.file);\r\n * const response = await fetch('/api/upload', { method: 'POST', body: formData });\r\n * const data = await response.json();\r\n * return { src: data.url };\r\n * };\r\n * ```\r\n */\r\n uploadHandler: ImageUploadHandler | null = null;\r\n\r\n // Référence à l'éditeur pour les mises à jour\r\n private currentEditor: Editor | null = null;\r\n\r\n // Méthodes pour la gestion des images\r\n selectImage(editor: Editor): void {\r\n if (editor.isActive(\"resizableImage\")) {\r\n const attrs = editor.getAttributes(\"resizableImage\");\r\n this.selectedImage.set({\r\n src: attrs[\"src\"],\r\n alt: attrs[\"alt\"],\r\n title: attrs[\"title\"],\r\n width: attrs[\"width\"],\r\n height: attrs[\"height\"],\r\n });\r\n } else {\r\n this.selectedImage.set(null);\r\n }\r\n }\r\n\r\n clearSelection(): void {\r\n this.selectedImage.set(null);\r\n }\r\n\r\n // Méthodes pour manipuler les images\r\n insertImage(editor: Editor, imageData: ImageData): void {\r\n editor.chain().focus().setResizableImage(imageData).run();\r\n }\r\n\r\n updateImageAttributes(editor: Editor, attributes: Partial<ImageData>): void {\r\n if (editor.isActive(\"resizableImage\")) {\r\n editor\r\n .chain()\r\n .focus()\r\n .updateAttributes(\"resizableImage\", attributes)\r\n .run();\r\n this.updateSelectedImage(attributes);\r\n }\r\n }\r\n\r\n // Nouvelles méthodes pour le redimensionnement\r\n resizeImage(editor: Editor, options: ResizeOptions): void {\r\n if (!editor.isActive(\"resizableImage\")) return;\r\n\r\n const currentAttrs = editor.getAttributes(\"resizableImage\");\r\n let newWidth = options.width;\r\n let newHeight = options.height;\r\n\r\n // Maintenir le ratio d'aspect si demandé\r\n if (\r\n options.maintainAspectRatio !== false &&\r\n currentAttrs[\"width\"] &&\r\n currentAttrs[\"height\"]\r\n ) {\r\n const aspectRatio = currentAttrs[\"width\"] / currentAttrs[\"height\"];\r\n\r\n if (newWidth && !newHeight) {\r\n newHeight = Math.round(newWidth / aspectRatio);\r\n } else if (newHeight && !newWidth) {\r\n newWidth = Math.round(newHeight * aspectRatio);\r\n }\r\n }\r\n\r\n // Appliquer des limites minimales\r\n if (newWidth) newWidth = Math.max(50, newWidth);\r\n if (newHeight) newHeight = Math.max(50, newHeight);\r\n\r\n this.updateImageAttributes(editor, {\r\n width: newWidth,\r\n height: newHeight,\r\n });\r\n }\r\n\r\n // Méthodes pour redimensionner par pourcentage\r\n resizeImageByPercentage(editor: Editor, percentage: number): void {\r\n if (!editor.isActive(\"resizableImage\")) return;\r\n\r\n const currentAttrs = editor.getAttributes(\"resizableImage\");\r\n if (!currentAttrs[\"width\"] || !currentAttrs[\"height\"]) return;\r\n\r\n const newWidth = Math.round(currentAttrs[\"width\"] * (percentage / 100));\r\n const newHeight = Math.round(currentAttrs[\"height\"] * (percentage / 100));\r\n\r\n this.resizeImage(editor, { width: newWidth, height: newHeight });\r\n }\r\n\r\n // Méthodes pour redimensionner à des tailles prédéfinies\r\n resizeImageToSmall(editor: Editor): void {\r\n this.resizeImage(editor, {\r\n width: 300,\r\n height: 200,\r\n maintainAspectRatio: true,\r\n });\r\n }\r\n\r\n resizeImageToMedium(editor: Editor): void {\r\n this.resizeImage(editor, {\r\n width: 500,\r\n height: 350,\r\n maintainAspectRatio: true,\r\n });\r\n }\r\n\r\n resizeImageToLarge(editor: Editor): void {\r\n this.resizeImage(editor, {\r\n width: 800,\r\n height: 600,\r\n maintainAspectRatio: true,\r\n });\r\n }\r\n\r\n resizeImageToOriginal(editor: Editor): void {\r\n if (!editor.isActive(\"resizableImage\")) return;\r\n\r\n const img = new Image();\r\n img.onload = () => {\r\n this.resizeImage(editor, {\r\n width: img.naturalWidth,\r\n height: img.naturalHeight,\r\n });\r\n };\r\n img.src = editor.getAttributes(\"resizableImage\")[\"src\"];\r\n }\r\n\r\n // Méthode pour redimensionner librement (sans maintenir le ratio)\r\n resizeImageFreely(editor: Editor, width: number, height: number): void {\r\n this.resizeImage(editor, {\r\n width,\r\n height,\r\n maintainAspectRatio: false,\r\n });\r\n }\r\n\r\n // Méthode pour obtenir les dimensions actuelles de l'image\r\n getImageDimensions(editor: Editor): { width: number; height: number } | null {\r\n if (!editor.isActive(\"resizableImage\")) return null;\r\n\r\n const attrs = editor.getAttributes(\"resizableImage\");\r\n return {\r\n width: attrs[\"width\"] || 0,\r\n height: attrs[\"height\"] || 0,\r\n };\r\n }\r\n\r\n // Méthode pour obtenir les dimensions naturelles de l'image\r\n getNaturalImageDimensions(\r\n src: string\r\n ): Promise<{ width: number; height: number }> {\r\n return new Promise((resolve, reject) => {\r\n const img = new Image();\r\n img.onload = () => {\r\n resolve({ width: img.naturalWidth, height: img.naturalHeight });\r\n };\r\n img.onerror = () => {\r\n reject(new Error(this.t().loadError));\r\n };\r\n img.src = src;\r\n });\r\n }\r\n\r\n deleteImage(editor: Editor): void {\r\n if (editor.isActive(\"resizableImage\")) {\r\n editor.chain().focus().deleteSelection().run();\r\n this.clearSelection();\r\n }\r\n }\r\n\r\n // Méthodes utilitaires\r\n private updateSelectedImage(attributes: Partial<ImageData>): void {\r\n const current = this.selectedImage();\r\n if (current) {\r\n this.selectedImage.set({ ...current, ...attributes });\r\n }\r\n }\r\n\r\n // Validation des images\r\n validateImage(\r\n file: File,\r\n maxSize: number = 5 * 1024 * 1024\r\n ): { valid: boolean; error?: string } {\r\n if (!file.type.startsWith(\"image/\")) {\r\n return { valid: false, error: this.t().invalidFileType };\r\n }\r\n\r\n if (file.size > maxSize) {\r\n return {\r\n valid: false,\r\n error: `${this.t().imageTooLarge} (max ${maxSize / 1024 / 1024}MB)`,\r\n };\r\n }\r\n\r\n return { valid: true };\r\n }\r\n\r\n // Compression d'image\r\n async compressImage(\r\n file: File,\r\n quality: number = 0.8,\r\n maxWidth: number = 1920,\r\n maxHeight: number = 1080\r\n ): Promise<ImageUploadResult> {\r\n return new Promise((resolve, reject) => {\r\n const canvas = document.createElement(\"canvas\");\r\n const ctx = canvas.getContext(\"2d\");\r\n const img = new Image();\r\n\r\n img.onload = () => {\r\n // Mise à jour du progrès\r\n if (this.isUploading()) {\r\n this.uploadProgress.set(40);\r\n this.uploadMessage.set(this.t().resizing);\r\n this.forceEditorUpdate();\r\n }\r\n\r\n let { width, height } = img;\r\n\r\n // Redimensionner si nécessaire\r\n if (width > maxWidth || height > maxHeight) {\r\n const ratio = Math.min(maxWidth / width, maxHeight / height);\r\n width *= ratio;\r\n height *= ratio;\r\n }\r\n\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n // Dessiner l'image redimensionnée\r\n ctx?.drawImage(img, 0, 0, width, height);\r\n\r\n // Mise à jour du progrès\r\n if (this.isUploading()) {\r\n this.uploadProgress.set(60);\r\n this.uploadMessage.set(this.t().compressing);\r\n this.forceEditorUpdate();\r\n }\r\n\r\n // Convertir en base64 avec compression\r\n canvas.toBlob(\r\n (blob) => {\r\n if (blob) {\r\n const reader = new FileReader();\r\n reader.onload = (e) => {\r\n const base64 = e.target?.result as string;\r\n if (base64) {\r\n const result: ImageUploadResult = {\r\n src: base64,\r\n name: file.name,\r\n size: blob.size,\r\n type: file.type,\r\n width: Math.round(width),\r\n height: Math.round(height),\r\n originalSize: file.size,\r\n };\r\n resolve(result);\r\n } else {\r\n reject(new Error(this.t().compressionError));\r\n }\r\n };\r\n reader.readAsDataURL(blob);\r\n } else {\r\n reject(new Error(this.t().compressionError));\r\n }\r\n },\r\n file.type,\r\n quality\r\n );\r\n };\r\n\r\n img.onerror = () =>\r\n reject(new Error(this.t().loadError));\r\n img.src = URL.createObjectURL(file);\r\n });\r\n }\r\n\r\n // Méthode privée générique pour uploader avec progression\r\n private async uploadImageWithProgress(\r\n editor: Editor,\r\n file: File,\r\n insertionStrategy: (editor: Editor, result: ImageUploadResult) => void,\r\n actionMessage: string,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n }\r\n ): Promise<void> {\r\n try {\r\n // Stocker la référence à l'éditeur\r\n this.currentEditor = editor;\r\n\r\n this.isUploading.set(true);\r\n this.uploadProgress.set(0);\r\n this.uploadMessage.set(this.t().validating);\r\n this.forceEditorUpdate();\r\n\r\n // Validation\r\n const validation = this.validateImage(file);\r\n if (!validation.valid) {\r\n throw new Error(validation.error);\r\n }\r\n\r\n this.uploadProgress.set(20);\r\n this.uploadMessage.set(this.t().compressing);\r\n this.forceEditorUpdate();\r\n\r\n // Petit délai pour permettre à l'utilisateur de voir la progression\r\n await new Promise((resolve) => setTimeout(resolve, 200));\r\n\r\n const result = await this.compressImage(\r\n file,\r\n options?.quality || 0.8,\r\n options?.maxWidth || 1920,\r\n options?.maxHeight || 1080\r\n );\r\n\r\n this.uploadProgress.set(80);\r\n\r\n // Si un handler personnalisé est défini, l'utiliser pour l'upload\r\n if (this.uploadHandler) {\r\n this.uploadMessage.set(this.t().uploadingToServer);\r\n this.forceEditorUpdate();\r\n\r\n try {\r\n const handlerResponse = this.uploadHandler({\r\n file,\r\n width: result.width || 0,\r\n height: result.height || 0,\r\n type: result.type,\r\n base64: result.src,\r\n });\r\n\r\n // Convertir Observable en Promise si nécessaire\r\n const handlerResult = isObservable(handlerResponse)\r\n ? await firstValueFrom(handlerResponse)\r\n : await handlerResponse;\r\n\r\n // Remplacer le src base64 par l'URL retournée par le handler\r\n result.src = handlerResult.src;\r\n\r\n // Appliquer les overrides optionnels du handler\r\n if (handlerResult.alt) {\r\n result.name = handlerResult.alt;\r\n }\r\n } catch (handlerError) {\r\n console.error(this.t().uploadError, handlerError);\r\n throw handlerError;\r\n }\r\n }\r\n\r\n this.uploadMessage.set(actionMessage);\r\n this.forceEditorUpdate();\r\n\r\n // Petit délai pour l'action\r\n await new Promise((resolve) => setTimeout(resolve, 100));\r\n\r\n // Exécuter la stratégie d'insertion\r\n insertionStrategy(editor, result);\r\n\r\n // L'action est terminée, maintenant on peut cacher l'indicateur\r\n this.isUploading.set(false);\r\n this.uploadProgress.set(0);\r\n this.uploadMessage.set(\"\");\r\n this.forceEditorUpdate();\r\n this.currentEditor = null;\r\n } catch (error) {\r\n this.isUploading.set(false);\r\n this.uploadProgress.set(0);\r\n this.uploadMessage.set(\"\");\r\n this.forceEditorUpdate();\r\n this.currentEditor = null;\r\n console.error(this.t().uploadError, error);\r\n throw error;\r\n }\r\n }\r\n\r\n // Méthode unifiée pour uploader et insérer une image\r\n async uploadAndInsertImage(\r\n editor: Editor,\r\n file: File,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n }\r\n ): Promise<void> {\r\n return this.uploadImageWithProgress(\r\n editor,\r\n file,\r\n (editor, result) => {\r\n this.insertImage(editor, {\r\n src: result.src,\r\n alt: result.name,\r\n title: `${result.name} (${result.width}×${result.height})`,\r\n width: result.width,\r\n height: result.height,\r\n });\r\n },\r\n this.t().insertingImage,\r\n options\r\n );\r\n }\r\n\r\n // Méthode pour forcer la mise à jour de l'éditeur\r\n private forceEditorUpdate() {\r\n if (this.currentEditor) {\r\n // Déclencher une transaction vide pour forcer la mise à jour des décorations\r\n const { tr } = this.currentEditor.state;\r\n this.currentEditor.view.dispatch(tr);\r\n }\r\n }\r\n\r\n // Méthode privée générique pour créer un sélecteur de fichier\r\n private async selectFileAndProcess(\r\n editor: Editor,\r\n uploadMethod: (editor: Editor, file: File, options?: any) => Promise<void>,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n accept?: string;\r\n }\r\n ): Promise<void> {\r\n return new Promise((resolve, reject) => {\r\n const input = document.createElement(\"input\");\r\n input.type = \"file\";\r\n input.accept = options?.accept || \"image/*\";\r\n input.style.display = \"none\";\r\n\r\n input.addEventListener(\"change\", async (e) => {\r\n const file = (e.target as HTMLInputElement).files?.[0];\r\n if (file && file.type.startsWith(\"image/\")) {\r\n try {\r\n await uploadMethod(editor, file, options);\r\n resolve();\r\n } catch (error) {\r\n reject(error);\r\n }\r\n } else {\r\n reject(new Error(this.t().noFileSelected));\r\n }\r\n document.body.removeChild(input);\r\n });\r\n\r\n input.addEventListener(\"cancel\", () => {\r\n document.body.removeChild(input);\r\n reject(new Error(this.t().selectionCancelled));\r\n });\r\n\r\n document.body.appendChild(input);\r\n input.click();\r\n });\r\n }\r\n\r\n // Méthode pour créer un sélecteur de fichier et uploader une image\r\n async selectAndUploadImage(\r\n editor: Editor,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n accept?: string;\r\n }\r\n ): Promise<void> {\r\n return this.selectFileAndProcess(\r\n editor,\r\n this.uploadAndInsertImage.bind(this),\r\n options\r\n );\r\n }\r\n\r\n // Méthode pour sélectionner et remplacer une image existante\r\n async selectAndReplaceImage(\r\n editor: Editor,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n accept?: string;\r\n }\r\n ): Promise<void> {\r\n return this.selectFileAndProcess(\r\n editor,\r\n this.uploadAndReplaceImage.bind(this),\r\n options\r\n );\r\n }\r\n\r\n // Méthode pour remplacer une image existante avec indicateur de progression\r\n async uploadAndReplaceImage(\r\n editor: Editor,\r\n file: File,\r\n options?: {\r\n quality?: number;\r\n maxWidth?: number;\r\n maxHeight?: number;\r\n }\r\n ): Promise<void> {\r\n // Sauvegarder les attributs de l'image actuelle pour restauration en cas d'échec\r\n const currentImageAttrs = editor.getAttributes(\"resizableImage\");\r\n const backupImage = { ...currentImageAttrs };\r\n\r\n try {\r\n // Supprimer visuellement l'ancienne image immédiatement\r\n editor.chain().focus().deleteSelection().run();\r\n\r\n await this.uploadImageWithProgress(\r\n editor,\r\n file,\r\n (editor, result) => {\r\n this.insertImage(editor, {\r\n src: result.src,\r\n alt: result.name,\r\n title: `${result.name} (${result.width}×${result.height})`,\r\n width: result.width,\r\n height: result.height,\r\n });\r\n },\r\n this.t().replacingImage,\r\n options\r\n );\r\n } catch (error) {\r\n // En cas d'erreur, restaurer l'image originale si elle existait\r\n if (backupImage[\"src\"]) {\r\n this.insertImage(editor, {\r\n src: backupImage[\"src\"] as string,\r\n alt: (backupImage[\"alt\"] as string) || \"\",\r\n title: (backupImage[\"title\"] as string) || \"\",\r\n width: backupImage[\"width\"] as number,\r\n height: backupImage[\"height\"] as number,\r\n });\r\n }\r\n console.error(\"Error during image replacement:\", error);\r\n throw error;\r\n }\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n computed,\r\n inject,\r\n effect,\r\n} from \"@angular/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\nimport { ImageService } from \"./services/image.service\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { ImageBubbleMenuConfig } from \"./models/bubble-menu.model\";\r\n\r\n@Component({\r\n selector: \"tiptap-image-bubble-menu\",\r\n standalone: true,\r\n imports: [TiptapButtonComponent, TiptapSeparatorComponent],\r\n template: `\r\n <div #menuRef class=\"bubble-menu\">\r\n @if (imageBubbleMenuConfig().changeImage) {\r\n <tiptap-button\r\n icon=\"drive_file_rename_outline\"\r\n [title]=\"t().changeImage\"\r\n (click)=\"onCommand('changeImage', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().separator && hasResizeButtons()) {\r\n <tiptap-separator></tiptap-separator>\r\n } @if (imageBubbleMenuConfig().resizeSmall) {\r\n <tiptap-button\r\n icon=\"crop_square\"\r\n iconSize=\"small\"\r\n [title]=\"t().resizeSmall\"\r\n (click)=\"onCommand('resizeSmall', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().resizeMedium) {\r\n <tiptap-button\r\n icon=\"crop_square\"\r\n iconSize=\"medium\"\r\n [title]=\"t().resizeMedium\"\r\n (click)=\"onCommand('resizeMedium', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().resizeLarge) {\r\n <tiptap-button\r\n icon=\"crop_square\"\r\n iconSize=\"large\"\r\n [title]=\"t().resizeLarge\"\r\n (click)=\"onCommand('resizeLarge', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().resizeOriginal) {\r\n <tiptap-button\r\n icon=\"photo_size_select_actual\"\r\n [title]=\"t().resizeOriginal\"\r\n (click)=\"onCommand('resizeOriginal', $event)\"\r\n ></tiptap-button>\r\n } @if (imageBubbleMenuConfig().separator &&\r\n imageBubbleMenuConfig().deleteImage) {\r\n <tiptap-separator></tiptap-separator>\r\n } @if (imageBubbleMenuConfig().deleteImage) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n [title]=\"t().deleteImage\"\r\n variant=\"danger\"\r\n (click)=\"onCommand('deleteImage', $event)\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n styles: [],\r\n})\r\nexport class TiptapImageBubbleMenuComponent implements OnInit, OnDestroy {\r\n readonly i18nService = inject(TiptapI18nService);\r\n readonly t = this.i18nService.imageUpload;\r\n\r\n editor = input.required<Editor>();\r\n config = input<ImageBubbleMenuConfig>({\r\n changeImage: true,\r\n resizeSmall: true,\r\n resizeMedium: true,\r\n resizeLarge: true,\r\n resizeOriginal: true,\r\n deleteImage: true,\r\n separator: true,\r\n });\r\n\r\n @ViewChild(\"menuRef\", { static: false }) menuRef!: ElementRef<HTMLDivElement>;\r\n\r\n private tippyInstance: TippyInstance | null = null;\r\n private imageService = inject(ImageService);\r\n private updateTimeout: any = null;\r\n\r\n imageBubbleMenuConfig = computed(() => ({\r\n changeImage: true,\r\n resizeSmall: true,\r\n resizeMedium: true,\r\n resizeLarge: true,\r\n resizeOriginal: true,\r\n deleteImage: true,\r\n separator: true,\r\n ...this.config(),\r\n }));\r\n\r\n hasResizeButtons = computed(() => {\r\n const config = this.imageBubbleMenuConfig();\r\n return (\r\n config.resizeSmall ||\r\n config.resizeMedium ||\r\n config.resizeLarge ||\r\n config.resizeOriginal\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n // Nettoyer les anciens listeners\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n ed.on(\"selectionUpdate\", this.updateMenu);\r\n ed.on(\"transaction\", this.updateMenu);\r\n ed.on(\"focus\", this.updateMenu);\r\n ed.on(\"blur\", this.handleBlur);\r\n\r\n // Ne pas appeler updateMenu() ici pour éviter l'affichage prématuré\r\n // Il sera appelé automatiquement quand l'éditeur sera prêt\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n // Initialiser Tippy de manière synchrone après que le component soit ready\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n // Nettoyer les timeouts\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n // Nettoyer Tippy\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n this.tippyInstance = null;\r\n }\r\n }\r\n\r\n private initTippy() {\r\n // Attendre que l'élément soit disponible\r\n if (!this.menuRef?.nativeElement) {\r\n setTimeout(() => this.initTippy(), 50);\r\n return;\r\n }\r\n\r\n const menuElement = this.menuRef.nativeElement;\r\n\r\n // S'assurer qu'il n'y a pas déjà une instance\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"top-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getImageRect(),\r\n // Améliorer le positionnement avec scroll\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getImageRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n // Trouver l'image sélectionnée dans le DOM\r\n const { from } = ed.state.selection;\r\n\r\n // Fonction pour trouver toutes les images dans l'éditeur\r\n const getAllImages = (): HTMLImageElement[] => {\r\n const editorElement = ed.view.dom;\r\n return Array.from(editorElement.querySelectorAll(\"img\"));\r\n };\r\n\r\n // Fonction pour trouver l'image à la position spécifique\r\n const findImageAtPosition = (): HTMLImageElement | null => {\r\n const allImages = getAllImages();\r\n\r\n for (const img of allImages) {\r\n try {\r\n // Obtenir la position ProseMirror de cette image\r\n const imgPos = ed.view.posAtDOM(img, 0);\r\n // Vérifier si cette image correspond à la position sélectionnée\r\n if (Math.abs(imgPos - from) <= 1) {\r\n return img;\r\n }\r\n } catch (error) {\r\n // Continuer si on ne peut pas obtenir la position de cette image\r\n continue;\r\n }\r\n }\r\n\r\n return null;\r\n };\r\n\r\n // Chercher l'image à la position exacte\r\n const imageElement = findImageAtPosition();\r\n\r\n if (imageElement) {\r\n return imageElement.getBoundingClientRect();\r\n }\r\n\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const isImageSelected =\r\n ed.isActive(\"resizableImage\") || ed.isActive(\"image\");\r\n\r\n // Ne montrer le menu image que si :\r\n // - Une image est sélectionnée\r\n // - L'éditeur est éditable\r\n const shouldShow = isImageSelected && ed.isEditable;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n this.hideTippy();\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n this.hideTippy();\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Cette méthode peut être étendue pour fermer d'autres menus si nécessaire\r\n // Pour l'instant, elle sert de placeholder pour une future coordination entre menus\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getImageRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n }\r\n\r\n private hideTippy() {\r\n if (this.tippyInstance) {\r\n this.tippyInstance.hide();\r\n }\r\n }\r\n\r\n onCommand(command: string, event: MouseEvent) {\r\n event.preventDefault();\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n switch (command) {\r\n case \"changeImage\":\r\n this.changeImage();\r\n break;\r\n case \"resizeSmall\":\r\n this.imageService.resizeImageToSmall(ed);\r\n break;\r\n case \"resizeMedium\":\r\n this.imageService.resizeImageToMedium(ed);\r\n break;\r\n case \"resizeLarge\":\r\n this.imageService.resizeImageToLarge(ed);\r\n break;\r\n case \"resizeOriginal\":\r\n this.imageService.resizeImageToOriginal(ed);\r\n break;\r\n case \"deleteImage\":\r\n this.deleteImage();\r\n break;\r\n }\r\n }\r\n\r\n private async changeImage() {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n try {\r\n // Utiliser la méthode spécifique pour remplacer une image existante\r\n await this.imageService.selectAndReplaceImage(ed, {\r\n quality: 0.8,\r\n maxWidth: 1920,\r\n maxHeight: 1080,\r\n accept: \"image/*\",\r\n });\r\n } catch (error) {\r\n console.error(this.i18nService.imageUpload().uploadError, error);\r\n }\r\n }\r\n\r\n private deleteImage() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.chain().focus().deleteSelection().run();\r\n }\r\n }\r\n}\r\n","import { Injectable } from \"@angular/core\";\r\nimport { Editor } from \"@tiptap/core\";\r\n\r\n@Injectable({\r\n providedIn: \"root\",\r\n})\r\nexport class EditorCommandsService {\r\n // Méthodes pour vérifier l'état actif\r\n isActive(\r\n editor: Editor,\r\n name: string,\r\n attributes?: Record<string, any>\r\n ): boolean {\r\n return editor.isActive(name, attributes);\r\n }\r\n\r\n // Méthodes pour vérifier si une commande peut être exécutée\r\n canExecute(editor: Editor, command: string): boolean {\r\n if (!editor) return false;\r\n\r\n switch (command) {\r\n case \"toggleBold\":\r\n return editor.can().chain().focus().toggleBold().run();\r\n case \"toggleItalic\":\r\n return editor.can().chain().focus().toggleItalic().run();\r\n case \"toggleStrike\":\r\n return editor.can().chain().focus().toggleStrike().run();\r\n case \"toggleCode\":\r\n return editor.can().chain().focus().toggleCode().run();\r\n case \"toggleUnderline\":\r\n return editor.can().chain().focus().toggleUnderline().run();\r\n case \"toggleSuperscript\":\r\n return editor.can().chain().focus().toggleSuperscript().run();\r\n case \"toggleSubscript\":\r\n return editor.can().chain().focus().toggleSubscript().run();\r\n case \"setTextAlign\":\r\n return editor.can().chain().focus().setTextAlign(\"left\").run();\r\n case \"toggleLink\":\r\n return editor.can().chain().focus().toggleLink({ href: \"\" }).run();\r\n case \"insertHorizontalRule\":\r\n return editor.can().chain().focus().setHorizontalRule().run();\r\n case \"toggleHighlight\":\r\n return editor.can().chain().focus().toggleHighlight().run();\r\n case \"undo\":\r\n return editor.can().chain().focus().undo().run();\r\n case \"redo\":\r\n return editor.can().chain().focus().redo().run();\r\n case \"insertTable\":\r\n return editor.can().chain().focus().insertTable().run();\r\n case \"addColumnBefore\":\r\n return editor.can().chain().focus().addColumnBefore().run();\r\n case \"addColumnAfter\":\r\n return editor.can().chain().focus().addColumnAfter().run();\r\n case \"deleteColumn\":\r\n return editor.can().chain().focus().deleteColumn().run();\r\n case \"addRowBefore\":\r\n return editor.can().chain().focus().addRowBefore().run();\r\n case \"addRowAfter\":\r\n return editor.can().chain().focus().addRowAfter().run();\r\n case \"deleteRow\":\r\n return editor.can().chain().focus().deleteRow().run();\r\n case \"deleteTable\":\r\n return editor.can().chain().focus().deleteTable().run();\r\n case \"mergeCells\":\r\n return editor.can().chain().focus().mergeCells().run();\r\n case \"splitCell\":\r\n return editor.can().chain().focus().splitCell().run();\r\n case \"toggleHeaderColumn\":\r\n return editor.can().chain().focus().toggleHeaderColumn().run();\r\n case \"toggleHeaderRow\":\r\n return editor.can().chain().focus().toggleHeaderRow().run();\r\n case \"toggleHeaderCell\":\r\n return editor.can().chain().focus().toggleHeaderCell().run();\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n // Méthodes pour exécuter les commandes\r\n toggleBold(editor: Editor): void {\r\n editor.chain().focus().toggleBold().run();\r\n }\r\n\r\n toggleItalic(editor: Editor): void {\r\n editor.chain().focus().toggleItalic().run();\r\n }\r\n\r\n toggleStrike(editor: Editor): void {\r\n editor.chain().focus().toggleStrike().run();\r\n }\r\n\r\n toggleCode(editor: Editor): void {\r\n editor.chain().focus().toggleCode().run();\r\n }\r\n\r\n toggleHeading(editor: Editor, level: 1 | 2 | 3): void {\r\n editor.chain().focus().toggleHeading({ level }).run();\r\n }\r\n\r\n toggleBulletList(editor: Editor): void {\r\n editor.chain().focus().toggleBulletList().run();\r\n }\r\n\r\n toggleOrderedList(editor: Editor): void {\r\n editor.chain().focus().toggleOrderedList().run();\r\n }\r\n\r\n toggleBlockquote(editor: Editor): void {\r\n editor.chain().focus().toggleBlockquote().run();\r\n }\r\n\r\n undo(editor: Editor): void {\r\n editor.chain().focus().undo().run();\r\n }\r\n\r\n redo(editor: Editor): void {\r\n editor.chain().focus().redo().run();\r\n }\r\n\r\n // Nouvelles méthodes pour les formatages supplémentaires\r\n toggleUnderline(editor: Editor): void {\r\n editor.chain().focus().toggleUnderline().run();\r\n }\r\n\r\n toggleSuperscript(editor: Editor): void {\r\n editor.chain().focus().toggleSuperscript().run();\r\n }\r\n\r\n toggleSubscript(editor: Editor): void {\r\n editor.chain().focus().toggleSubscript().run();\r\n }\r\n\r\n setTextAlign(\r\n editor: Editor,\r\n alignment: \"left\" | \"center\" | \"right\" | \"justify\"\r\n ): void {\r\n editor.chain().focus().setTextAlign(alignment).run();\r\n }\r\n\r\n toggleLink(editor: Editor, url?: string): void {\r\n if (url) {\r\n editor.chain().focus().toggleLink({ href: url }).run();\r\n } else {\r\n // Si pas d'URL fournie, on demande à l'utilisateur\r\n const href = window.prompt(\"URL du lien:\");\r\n if (href) {\r\n editor.chain().focus().toggleLink({ href }).run();\r\n }\r\n }\r\n }\r\n\r\n insertHorizontalRule(editor: Editor): void {\r\n editor.chain().focus().setHorizontalRule().run();\r\n }\r\n\r\n toggleHighlight(editor: Editor, color?: string): void {\r\n if (color) {\r\n editor.chain().focus().toggleHighlight({ color }).run();\r\n } else {\r\n editor.chain().focus().toggleHighlight().run();\r\n }\r\n }\r\n\r\n // Table commands\r\n insertTable(editor: Editor, rows: number = 3, cols: number = 3): void {\r\n editor.chain().focus().insertTable({ rows, cols }).run();\r\n }\r\n\r\n addColumnBefore(editor: Editor): void {\r\n editor.chain().focus().addColumnBefore().run();\r\n }\r\n\r\n addColumnAfter(editor: Editor): void {\r\n editor.chain().focus().addColumnAfter().run();\r\n }\r\n\r\n deleteColumn(editor: Editor): void {\r\n editor.chain().focus().deleteColumn().run();\r\n }\r\n\r\n addRowBefore(editor: Editor): void {\r\n editor.chain().focus().addRowBefore().run();\r\n }\r\n\r\n addRowAfter(editor: Editor): void {\r\n editor.chain().focus().addRowAfter().run();\r\n }\r\n\r\n deleteRow(editor: Editor): void {\r\n editor.chain().focus().deleteRow().run();\r\n }\r\n\r\n deleteTable(editor: Editor): void {\r\n editor.chain().focus().deleteTable().run();\r\n }\r\n\r\n mergeCells(editor: Editor): void {\r\n editor.chain().focus().mergeCells().run();\r\n }\r\n\r\n splitCell(editor: Editor): void {\r\n editor.chain().focus().splitCell().run();\r\n }\r\n\r\n toggleHeaderColumn(editor: Editor): void {\r\n editor.chain().focus().toggleHeaderColumn().run();\r\n }\r\n\r\n toggleHeaderRow(editor: Editor): void {\r\n editor.chain().focus().toggleHeaderRow().run();\r\n }\r\n\r\n toggleHeaderCell(editor: Editor): void {\r\n editor.chain().focus().toggleHeaderCell().run();\r\n }\r\n\r\n // Méthode pour vider le contenu\r\n clearContent(editor: Editor): void {\r\n editor.commands.setContent(\"\", true);\r\n }\r\n\r\n // Méthodes de base de l'éditeur\r\n focus(editor: Editor): void {\r\n editor.chain().focus().run();\r\n }\r\n\r\n blur(editor: Editor): void {\r\n editor.chain().blur().run();\r\n }\r\n\r\n setContent(editor: Editor, content: string, emitUpdate = true): void {\r\n editor.commands.setContent(content, emitUpdate);\r\n }\r\n\r\n setEditable(editor: Editor, editable: boolean): void {\r\n editor.setEditable(editable);\r\n }\r\n\r\n insertContent(editor: Editor, content: string): void {\r\n editor.chain().focus().insertContent(content).run();\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n inject,\r\n} from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\nimport { TableBubbleMenuConfig } from \"./models/bubble-menu.model\";\r\n\r\n@Component({\r\n selector: \"tiptap-table-bubble-menu\",\r\n standalone: true,\r\n imports: [CommonModule, TiptapButtonComponent, TiptapSeparatorComponent],\r\n template: `\r\n <div #menuElement class=\"bubble-menu\">\r\n <!-- Actions de lignes -->\r\n @if (config().addRowBefore !== false) {\r\n <tiptap-button\r\n icon=\"add_row_above\"\r\n title=\"{{ t().addRowBefore }}\"\r\n (click)=\"addRowBefore()\"\r\n ></tiptap-button>\r\n } @if (config().addRowAfter !== false) {\r\n <tiptap-button\r\n icon=\"add_row_below\"\r\n title=\"{{ t().addRowAfter }}\"\r\n (click)=\"addRowAfter()\"\r\n ></tiptap-button>\r\n } @if (config().deleteRow !== false) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n title=\"{{ t().deleteRow }}\"\r\n variant=\"danger\"\r\n (click)=\"deleteRow()\"\r\n ></tiptap-button>\r\n } @if (config().separator !== false) {\r\n <tiptap-separator></tiptap-separator>\r\n }\r\n\r\n <!-- Actions de colonnes -->\r\n @if (config().addColumnBefore !== false) {\r\n <tiptap-button\r\n icon=\"add_column_left\"\r\n title=\"{{ t().addColumnBefore }}\"\r\n (click)=\"addColumnBefore()\"\r\n ></tiptap-button>\r\n } @if (config().addColumnAfter !== false) {\r\n <tiptap-button\r\n icon=\"add_column_right\"\r\n title=\"{{ t().addColumnAfter }}\"\r\n (click)=\"addColumnAfter()\"\r\n ></tiptap-button>\r\n } @if (config().deleteColumn !== false) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n title=\"{{ t().deleteColumn }}\"\r\n variant=\"danger\"\r\n (click)=\"deleteColumn()\"\r\n ></tiptap-button>\r\n } @if (config().separator !== false) {\r\n <tiptap-separator></tiptap-separator>\r\n }\r\n\r\n <!-- Actions de cellules -->\r\n @if (config().toggleHeaderRow !== false) {\r\n <tiptap-button\r\n icon=\"toolbar\"\r\n title=\"{{ t().toggleHeaderRow }}\"\r\n (click)=\"toggleHeaderRow()\"\r\n ></tiptap-button>\r\n } @if (config().toggleHeaderColumn !== false) {\r\n <tiptap-button\r\n icon=\"dock_to_right\"\r\n title=\"{{ t().toggleHeaderColumn }}\"\r\n (click)=\"toggleHeaderColumn()\"\r\n ></tiptap-button>\r\n } @if (config().separator !== false && config().deleteTable !== false) {\r\n <tiptap-separator></tiptap-separator>\r\n }\r\n\r\n <!-- Actions de table -->\r\n @if (config().deleteTable !== false) {\r\n <tiptap-button\r\n icon=\"delete_forever\"\r\n title=\"{{ t().deleteTable }}\"\r\n variant=\"danger\"\r\n (click)=\"deleteTable()\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n styles: [],\r\n})\r\nexport class TiptapTableBubbleMenuComponent implements OnInit, OnDestroy {\r\n @ViewChild(\"menuElement\", { static: true }) menuElement!: ElementRef;\r\n\r\n // Inputs\r\n editor = input.required<Editor>();\r\n config = input<TableBubbleMenuConfig>({});\r\n\r\n // Services\r\n private i18nService = inject(TiptapI18nService);\r\n private commandsService = inject(EditorCommandsService);\r\n\r\n // Tippy instance\r\n private tippyInstance: TippyInstance | null = null;\r\n private updateTimeout: any = null;\r\n\r\n // Signaux\r\n readonly t = this.i18nService.table;\r\n\r\n constructor() {\r\n // Effet pour mettre à jour le menu quand l'éditeur change\r\n effect(() => {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les anciens listeners\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n editor.on(\"selectionUpdate\", this.updateMenu);\r\n editor.on(\"focus\", this.updateMenu);\r\n editor.on(\"blur\", this.handleBlur);\r\n }\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les événements\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n }\r\n\r\n private initTippy() {\r\n const menuElement = this.menuElement.nativeElement;\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"bottom-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n maxWidth: \"none\",\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getTableRect(),\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getTableRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n // Méthode 1: Utiliser coordsAtPos (méthode native ProseMirror)\r\n const { from } = ed.state.selection;\r\n const coords = ed.view.coordsAtPos(from);\r\n\r\n // Trouver la table qui contient cette position\r\n const editorElement = ed.view.dom;\r\n const tables = Array.from(editorElement.querySelectorAll(\"table\"));\r\n\r\n for (let i = 0; i < tables.length; i++) {\r\n const table = tables[i];\r\n try {\r\n const tableRect = table.getBoundingClientRect();\r\n\r\n // Vérifier si la position ProseMirror est dans cette table\r\n const isInside =\r\n coords.left >= tableRect.left &&\r\n coords.left <= tableRect.right &&\r\n coords.top >= tableRect.top &&\r\n coords.top <= tableRect.bottom;\r\n\r\n if (isInside) {\r\n return tableRect;\r\n }\r\n } catch (error) {\r\n continue;\r\n }\r\n }\r\n\r\n // Fallback : utiliser la méthode DOM si ProseMirror échoue\r\n const selection = window.getSelection();\r\n if (selection && selection.rangeCount > 0) {\r\n const range = selection.getRangeAt(0);\r\n const rect = range.getBoundingClientRect();\r\n\r\n if (rect.width > 0 && rect.height > 0) {\r\n return rect;\r\n }\r\n }\r\n\r\n // Dernier fallback : première table\r\n if (tables.length > 0) {\r\n return tables[0].getBoundingClientRect();\r\n }\r\n\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const isTableSelected =\r\n ed.isActive(\"table\") ||\r\n ed.isActive(\"tableCell\") ||\r\n ed.isActive(\"tableHeader\");\r\n\r\n // Vérifier s'il y a une sélection de cellules (priorité au menu de cellules)\r\n const { from, to } = ed.state.selection;\r\n const hasCellSelection = from !== to;\r\n const isTableCell =\r\n ed.isActive(\"tableCell\") || ed.isActive(\"tableHeader\");\r\n\r\n // Vérifier si la sélection traverse plusieurs cellules\r\n const selectionSize = to - from;\r\n const hasMultiCellSelection = hasCellSelection && selectionSize > 1;\r\n\r\n // Ne montrer le menu de table que si :\r\n // 1. Une table est sélectionnée\r\n // 2. L'éditeur est éditable\r\n // 3. Il n'y a PAS de sélection de cellules (priorité au menu de cellules)\r\n // 4. Il n'y a PAS de sélection multi-cellules\r\n const shouldShow =\r\n isTableSelected &&\r\n ed.isEditable &&\r\n !(hasCellSelection && isTableCell) &&\r\n !hasMultiCellSelection;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n this.hideTippy();\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n this.hideTippy();\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Cette méthode peut être étendue pour fermer d'autres menus si nécessaire\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getTableRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n }\r\n\r\n hideTippy() {\r\n if (!this.tippyInstance) return;\r\n this.tippyInstance.hide();\r\n }\r\n\r\n // Actions de lignes\r\n addRowBefore() {\r\n this.commandsService.addRowBefore(this.editor());\r\n }\r\n\r\n addRowAfter() {\r\n this.commandsService.addRowAfter(this.editor());\r\n }\r\n\r\n deleteRow() {\r\n this.commandsService.deleteRow(this.editor());\r\n }\r\n\r\n // Actions de colonnes\r\n addColumnBefore() {\r\n this.commandsService.addColumnBefore(this.editor());\r\n }\r\n\r\n addColumnAfter() {\r\n this.commandsService.addColumnAfter(this.editor());\r\n }\r\n\r\n deleteColumn() {\r\n this.commandsService.deleteColumn(this.editor());\r\n }\r\n\r\n // Actions de headers\r\n toggleHeaderRow() {\r\n this.commandsService.toggleHeaderRow(this.editor());\r\n }\r\n\r\n toggleHeaderColumn() {\r\n this.commandsService.toggleHeaderColumn(this.editor());\r\n }\r\n\r\n // Actions de table\r\n deleteTable() {\r\n this.commandsService.deleteTable(this.editor());\r\n }\r\n}\r\n","import {\r\n Component,\r\n input,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n inject,\r\n} from \"@angular/core\";\r\nimport { CommonModule } from \"@angular/common\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { CellSelection } from \"@tiptap/pm/tables\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\n\r\nexport interface CellBubbleMenuConfig {\r\n mergeCells?: boolean;\r\n splitCell?: boolean;\r\n}\r\n\r\n@Component({\r\n selector: \"tiptap-cell-bubble-menu\",\r\n standalone: true,\r\n imports: [CommonModule, TiptapButtonComponent],\r\n template: `\r\n <div #menuElement class=\"bubble-menu\">\r\n <!-- Actions spécifiques aux cellules -->\r\n @if (config().mergeCells !== false && !isSingleCellSelected) {\r\n <tiptap-button\r\n icon=\"cell_merge\"\r\n title=\"{{ i18n.table().mergeCells }}\"\r\n (click)=\"mergeCells()\"\r\n ></tiptap-button>\r\n } @if (config().splitCell !== false && isSingleCellSelected) {\r\n <tiptap-button\r\n icon=\"split_scene\"\r\n title=\"{{ i18n.table().splitCell }}\"\r\n (click)=\"splitCell()\"\r\n ></tiptap-button>\r\n }\r\n </div>\r\n `,\r\n styles: [],\r\n})\r\nexport class TiptapCellBubbleMenuComponent implements OnInit, OnDestroy {\r\n @ViewChild(\"menuElement\", { static: true }) menuElement!: ElementRef;\r\n\r\n // Inputs\r\n editor = input.required<Editor>();\r\n config = input<CellBubbleMenuConfig>({});\r\n\r\n // Services\r\n private i18nService = inject(TiptapI18nService);\r\n private commandsService = inject(EditorCommandsService);\r\n\r\n // Tippy instance\r\n private tippyInstance: TippyInstance | null = null;\r\n private updateTimeout: any = null;\r\n\r\n // Signaux\r\n readonly i18n = this.i18nService;\r\n isSingleCellSelected: boolean = false;\r\n\r\n constructor() {\r\n // Effet pour mettre à jour le menu quand l'éditeur change\r\n effect(() => {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les anciens listeners\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n editor.on(\"selectionUpdate\", this.updateMenu);\r\n editor.on(\"focus\", this.updateMenu);\r\n editor.on(\"blur\", this.handleBlur);\r\n }\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const editor = this.editor();\r\n if (editor) {\r\n // Nettoyer les événements\r\n editor.off(\"selectionUpdate\", this.updateMenu);\r\n editor.off(\"focus\", this.updateMenu);\r\n editor.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n }\r\n\r\n private initTippy() {\r\n const menuElement = this.menuElement.nativeElement;\r\n\r\n // Créer l'instance Tippy\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"top-start\",\r\n appendTo: (ref) => {\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: false,\r\n onShow: (instance) => {\r\n // S'assurer que les autres menus sont fermés\r\n this.hideOtherMenus();\r\n },\r\n getReferenceClientRect: () => this.getCellRect(),\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"bottom-start\", \"top-end\", \"bottom-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getCellRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed) return new DOMRect(0, 0, 0, 0);\r\n\r\n // Détecter la sélection de cellules\r\n const { from, to } = ed.state.selection;\r\n const hasCellSelection = from !== to;\r\n\r\n if (!hasCellSelection) {\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n // Obtenir les coordonnées de la sélection\r\n const coords = ed.view.coordsAtPos(from);\r\n const endCoords = ed.view.coordsAtPos(to);\r\n\r\n // Créer un rectangle englobant la sélection\r\n const rect = new DOMRect(\r\n Math.min(coords.left, endCoords.left),\r\n Math.min(coords.top, endCoords.top),\r\n Math.abs(endCoords.left - coords.left),\r\n Math.abs(endCoords.top - coords.top)\r\n );\r\n\r\n return rect;\r\n }\r\n\r\n updateMenu = () => {\r\n // Debounce pour éviter les appels trop fréquents\r\n if (this.updateTimeout) {\r\n clearTimeout(this.updateTimeout);\r\n }\r\n\r\n this.updateTimeout = setTimeout(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const { selection } = ed.state;\r\n const { from, to } = selection;\r\n\r\n // Détecter spécifiquement la sélection de CELLULES (pas de texte)\r\n const hasCellSelection = selection instanceof CellSelection;\r\n // Une seule cellule si ancre et tête pointent vers la même cellule\r\n this.isSingleCellSelected =\r\n hasCellSelection &&\r\n (selection as CellSelection).$anchorCell.pos ===\r\n (selection as CellSelection).$headCell.pos;\r\n const hasTextSelection =\r\n !selection.empty && !(selection instanceof CellSelection);\r\n const isTableCell =\r\n ed.isActive(\"tableCell\") || ed.isActive(\"tableHeader\");\r\n\r\n\r\n // Le menu de cellule ne s'affiche QUE pour les sélections de cellules multiples\r\n // (pas pour la sélection de texte dans une cellule)\r\n const shouldShow = hasCellSelection && isTableCell && ed.isEditable;\r\n\r\n if (shouldShow) {\r\n this.showTippy();\r\n } else {\r\n this.hideTippy();\r\n }\r\n }, 10);\r\n };\r\n\r\n handleBlur = () => {\r\n // Masquer le menu quand l'éditeur perd le focus\r\n setTimeout(() => {\r\n this.hideTippy();\r\n }, 100);\r\n };\r\n\r\n private hideOtherMenus() {\r\n // Masquer tous les autres menus quand le menu de cellules est actif\r\n this.hideTableMenu();\r\n this.hideTextBubbleMenu();\r\n }\r\n\r\n private showTippy() {\r\n if (!this.tippyInstance) return;\r\n\r\n // Masquer les autres menus avant d'afficher le menu de cellules\r\n this.hideTableMenu();\r\n this.hideTextBubbleMenu();\r\n\r\n // Mettre à jour la position\r\n this.tippyInstance.setProps({\r\n getReferenceClientRect: () => this.getCellRect(),\r\n });\r\n\r\n this.tippyInstance.show();\r\n }\r\n\r\n private hideTableMenu() {\r\n // Masquer le menu de table quand le menu de cellules est actif\r\n const tableMenu = document.querySelector(\"tiptap-table-bubble-menu\");\r\n if (tableMenu) {\r\n const tippyInstance = (tableMenu as any)._tippy;\r\n if (tippyInstance) {\r\n tippyInstance.hide();\r\n }\r\n }\r\n\r\n // Alternative : masquer via l'élément Angular\r\n const tableMenuComponent = document.querySelector(\r\n \"tiptap-table-bubble-menu\"\r\n ) as any;\r\n if (tableMenuComponent && tableMenuComponent.hideTippy) {\r\n tableMenuComponent.hideTippy();\r\n }\r\n }\r\n\r\n private hideTextBubbleMenu() {\r\n // Masquer le menu de texte (bubble menu général) quand le menu de cellules est actif\r\n const textMenu = document.querySelector(\"tiptap-bubble-menu\");\r\n if (textMenu) {\r\n const tippyInstance = (textMenu as any)._tippy;\r\n if (tippyInstance) {\r\n tippyInstance.hide();\r\n }\r\n }\r\n\r\n // Alternative : masquer via l'élément Angular\r\n const textMenuComponent = document.querySelector(\r\n \"tiptap-bubble-menu\"\r\n ) as any;\r\n if (textMenuComponent && textMenuComponent.hideTippy) {\r\n textMenuComponent.hideTippy();\r\n }\r\n }\r\n\r\n hideTippy() {\r\n if (!this.tippyInstance) return;\r\n this.tippyInstance.hide();\r\n }\r\n\r\n // Actions spécifiques aux cellules\r\n mergeCells() {\r\n this.commandsService.mergeCells(this.editor());\r\n }\r\n\r\n splitCell() {\r\n this.commandsService.splitCell(this.editor());\r\n }\r\n}\r\n","import { Component, input, output, signal, inject } from \"@angular/core\";\r\nimport { Editor } from \"@tiptap/core\";\r\nimport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nimport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\nimport { ImageUploadResult, ImageService } from \"./services/image.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { TiptapTextColorPickerComponent } from \"./components/tiptap-text-color-picker.component\";\r\n\r\nexport interface ToolbarConfig {\r\n bold?: boolean;\r\n italic?: boolean;\r\n underline?: boolean;\r\n strike?: boolean;\r\n code?: boolean;\r\n superscript?: boolean;\r\n subscript?: boolean;\r\n highlight?: boolean;\r\n heading1?: boolean;\r\n heading2?: boolean;\r\n heading3?: boolean;\r\n bulletList?: boolean;\r\n orderedList?: boolean;\r\n blockquote?: boolean;\r\n alignLeft?: boolean;\r\n alignCenter?: boolean;\r\n alignRight?: boolean;\r\n alignJustify?: boolean;\r\n link?: boolean;\r\n image?: boolean;\r\n horizontalRule?: boolean;\r\n table?: boolean;\r\n undo?: boolean;\r\n redo?: boolean;\r\n clear?: boolean;\r\n textColor?: boolean;\r\n separator?: boolean;\r\n}\r\n\r\n@Component({\r\n selector: \"tiptap-toolbar\",\r\n standalone: true,\r\n imports: [\r\n TiptapButtonComponent,\r\n TiptapSeparatorComponent,\r\n TiptapTextColorPickerComponent,\r\n ],\r\n template: `\r\n <div class=\"tiptap-toolbar\">\r\n @if (config().bold) {\r\n <tiptap-button\r\n icon=\"format_bold\"\r\n [title]=\"t().bold\"\r\n [active]=\"isActive('bold')\"\r\n [disabled]=\"!canExecute('toggleBold')\"\r\n (onClick)=\"toggleBold()\"\r\n />\r\n } @if (config().italic) {\r\n <tiptap-button\r\n icon=\"format_italic\"\r\n [title]=\"t().italic\"\r\n [active]=\"isActive('italic')\"\r\n [disabled]=\"!canExecute('toggleItalic')\"\r\n (onClick)=\"toggleItalic()\"\r\n />\r\n } @if (config().underline) {\r\n <tiptap-button\r\n icon=\"format_underlined\"\r\n [title]=\"t().underline\"\r\n [active]=\"isActive('underline')\"\r\n [disabled]=\"!canExecute('toggleUnderline')\"\r\n (onClick)=\"toggleUnderline()\"\r\n />\r\n } @if (config().strike) {\r\n <tiptap-button\r\n icon=\"strikethrough_s\"\r\n [title]=\"t().strike\"\r\n [active]=\"isActive('strike')\"\r\n [disabled]=\"!canExecute('toggleStrike')\"\r\n (onClick)=\"toggleStrike()\"\r\n />\r\n } @if (config().code) {\r\n <tiptap-button\r\n icon=\"code\"\r\n [title]=\"t().code\"\r\n [active]=\"isActive('code')\"\r\n [disabled]=\"!canExecute('toggleCode')\"\r\n (onClick)=\"toggleCode()\"\r\n />\r\n } @if (config().superscript) {\r\n <tiptap-button\r\n icon=\"superscript\"\r\n [title]=\"t().superscript\"\r\n [active]=\"isActive('superscript')\"\r\n [disabled]=\"!canExecute('toggleSuperscript')\"\r\n (onClick)=\"toggleSuperscript()\"\r\n />\r\n } @if (config().subscript) {\r\n <tiptap-button\r\n icon=\"subscript\"\r\n [title]=\"t().subscript\"\r\n [active]=\"isActive('subscript')\"\r\n [disabled]=\"!canExecute('toggleSubscript')\"\r\n (onClick)=\"toggleSubscript()\"\r\n />\r\n } @if (config().highlight) {\r\n <tiptap-button\r\n icon=\"highlight\"\r\n [title]=\"t().highlight\"\r\n [active]=\"isActive('highlight')\"\r\n [disabled]=\"!canExecute('toggleHighlight')\"\r\n (onClick)=\"toggleHighlight()\"\r\n />\r\n } @if (config().textColor) {\r\n <tiptap-text-color-picker [editor]=\"editor()\" />\r\n } @if (config().separator && (config().heading1 || config().heading2 ||\r\n config().heading3)) {\r\n <tiptap-separator />\r\n } @if (config().heading1) {\r\n <tiptap-button\r\n icon=\"format_h1\"\r\n [title]=\"t().heading1\"\r\n [active]=\"isActive('heading', { level: 1 })\"\r\n (onClick)=\"toggleHeading(1)\"\r\n />\r\n } @if (config().heading2) {\r\n <tiptap-button\r\n icon=\"format_h2\"\r\n [title]=\"t().heading2\"\r\n [active]=\"isActive('heading', { level: 2 })\"\r\n (onClick)=\"toggleHeading(2)\"\r\n />\r\n } @if (config().heading3) {\r\n <tiptap-button\r\n icon=\"format_h3\"\r\n [title]=\"t().heading3\"\r\n [active]=\"isActive('heading', { level: 3 })\"\r\n (onClick)=\"toggleHeading(3)\"\r\n />\r\n } @if (config().separator && (config().bulletList || config().orderedList\r\n || config().blockquote)) {\r\n <tiptap-separator />\r\n } @if (config().bulletList) {\r\n <tiptap-button\r\n icon=\"format_list_bulleted\"\r\n [title]=\"t().bulletList\"\r\n [active]=\"isActive('bulletList')\"\r\n (onClick)=\"toggleBulletList()\"\r\n />\r\n } @if (config().orderedList) {\r\n <tiptap-button\r\n icon=\"format_list_numbered\"\r\n [title]=\"t().orderedList\"\r\n [active]=\"isActive('orderedList')\"\r\n (onClick)=\"toggleOrderedList()\"\r\n />\r\n } @if (config().blockquote) {\r\n <tiptap-button\r\n icon=\"format_quote\"\r\n [title]=\"t().blockquote\"\r\n [active]=\"isActive('blockquote')\"\r\n (onClick)=\"toggleBlockquote()\"\r\n />\r\n } @if (config().separator && (config().alignLeft || config().alignCenter\r\n || config().alignRight || config().alignJustify)) {\r\n <tiptap-separator />\r\n } @if (config().alignLeft) {\r\n <tiptap-button\r\n icon=\"format_align_left\"\r\n [title]=\"t().alignLeft\"\r\n [active]=\"isActive('textAlign', { textAlign: 'left' })\"\r\n (onClick)=\"setTextAlign('left')\"\r\n />\r\n } @if (config().alignCenter) {\r\n <tiptap-button\r\n icon=\"format_align_center\"\r\n [title]=\"t().alignCenter\"\r\n [active]=\"isActive('textAlign', { textAlign: 'center' })\"\r\n (onClick)=\"setTextAlign('center')\"\r\n />\r\n } @if (config().alignRight) {\r\n <tiptap-button\r\n icon=\"format_align_right\"\r\n [title]=\"t().alignRight\"\r\n [active]=\"isActive('textAlign', { textAlign: 'right' })\"\r\n (onClick)=\"setTextAlign('right')\"\r\n />\r\n } @if (config().alignJustify) {\r\n <tiptap-button\r\n icon=\"format_align_justify\"\r\n [title]=\"t().alignJustify\"\r\n [active]=\"isActive('textAlign', { textAlign: 'justify' })\"\r\n (onClick)=\"setTextAlign('justify')\"\r\n />\r\n } @if (config().separator && (config().link || config().horizontalRule)) {\r\n <tiptap-separator />\r\n } @if (config().link) {\r\n <tiptap-button\r\n icon=\"link\"\r\n [title]=\"t().link\"\r\n [active]=\"isActive('link')\"\r\n (onClick)=\"toggleLink()\"\r\n />\r\n } @if (config().horizontalRule) {\r\n <tiptap-button\r\n icon=\"horizontal_rule\"\r\n [title]=\"t().horizontalRule\"\r\n (onClick)=\"insertHorizontalRule()\"\r\n />\r\n } @if (config().table) {\r\n <tiptap-button\r\n icon=\"table_view\"\r\n [title]=\"t().table\"\r\n (onClick)=\"insertTable()\"\r\n />\r\n } @if (config().separator && config().image) {\r\n <tiptap-separator />\r\n } @if (config().image) {\r\n <tiptap-button\r\n icon=\"image\"\r\n [title]=\"t().image\"\r\n (onClick)=\"insertImage()\"\r\n />\r\n } @if (config().separator && (config().undo || config().redo)) {\r\n <tiptap-separator />\r\n } @if (config().undo) {\r\n <tiptap-button\r\n icon=\"undo\"\r\n [title]=\"t().undo\"\r\n [disabled]=\"!canExecute('undo')\"\r\n (onClick)=\"undo()\"\r\n />\r\n } @if (config().redo) {\r\n <tiptap-button\r\n icon=\"redo\"\r\n [title]=\"t().redo\"\r\n [disabled]=\"!canExecute('redo')\"\r\n (onClick)=\"redo()\"\r\n />\r\n } @if (config().separator && config().clear) {\r\n <tiptap-separator />\r\n } @if (config().clear) {\r\n <tiptap-button\r\n icon=\"delete\"\r\n [title]=\"t().clear\"\r\n (onClick)=\"clearContent()\"\r\n />\r\n }\r\n </div>\r\n `,\r\n styles: [\r\n `\r\n /* Styles de base pour la toolbar */\r\n .tiptap-toolbar {\r\n display: flex;\r\n align-items: center;\r\n gap: 4px;\r\n padding: 4px 8px;\r\n background: var(--ate-toolbar-background);\r\n border-bottom: 1px solid var(--ate-toolbar-border-color);\r\n flex-wrap: wrap;\r\n min-height: 32px;\r\n position: relative;\r\n backdrop-filter: blur(var(--ate-menu-blur, 16px));\r\n }\r\n\r\n /* Groupe de boutons */\r\n .toolbar-group {\r\n display: flex;\r\n align-items: center;\r\n gap: 2px;\r\n padding: 0 4px;\r\n }\r\n\r\n /* Séparateur entre groupes */\r\n .toolbar-separator {\r\n width: 1px;\r\n height: 24px;\r\n background: var(--ate-toolbar-border-color);\r\n margin: 0 4px;\r\n }\r\n\r\n /* Responsive */\r\n @media (max-width: 768px) {\r\n .tiptap-toolbar {\r\n padding: 6px 8px;\r\n gap: 2px;\r\n }\r\n\r\n .toolbar-group {\r\n gap: 1px;\r\n }\r\n }\r\n\r\n /* Animation d'apparition */\r\n @keyframes toolbarSlideIn {\r\n from {\r\n opacity: 0;\r\n transform: translateY(-10px);\r\n }\r\n to {\r\n opacity: 1;\r\n transform: translateY(0);\r\n }\r\n }\r\n\r\n .tiptap-toolbar {\r\n animation: toolbarSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapToolbarComponent {\r\n editor = input.required<Editor>();\r\n config = input.required<ToolbarConfig>();\r\n imageUpload = input<any>({});\r\n\r\n // Outputs pour les événements d'image\r\n imageUploaded = output<ImageUploadResult>();\r\n imageError = output<string>();\r\n\r\n private imageService = inject(ImageService);\r\n private i18nService = inject(TiptapI18nService);\r\n\r\n // Computed values pour les traductions\r\n readonly t = this.i18nService.toolbar;\r\n\r\n constructor(private editorCommands: EditorCommandsService) { }\r\n\r\n isActive(name: string, attributes?: Record<string, any>): boolean {\r\n return this.editorCommands.isActive(this.editor(), name, attributes);\r\n }\r\n\r\n canExecute(command: string): boolean {\r\n return this.editorCommands.canExecute(this.editor(), command);\r\n }\r\n\r\n toggleBold() {\r\n this.editorCommands.toggleBold(this.editor());\r\n }\r\n toggleItalic() {\r\n this.editorCommands.toggleItalic(this.editor());\r\n }\r\n toggleStrike() {\r\n this.editorCommands.toggleStrike(this.editor());\r\n }\r\n toggleCode() {\r\n this.editorCommands.toggleCode(this.editor());\r\n }\r\n toggleHeading(level: 1 | 2 | 3) {\r\n this.editorCommands.toggleHeading(this.editor(), level);\r\n }\r\n toggleBulletList() {\r\n this.editorCommands.toggleBulletList(this.editor());\r\n }\r\n toggleOrderedList() {\r\n this.editorCommands.toggleOrderedList(this.editor());\r\n }\r\n toggleBlockquote() {\r\n this.editorCommands.toggleBlockquote(this.editor());\r\n }\r\n undo() {\r\n this.editorCommands.undo(this.editor());\r\n }\r\n redo() {\r\n this.editorCommands.redo(this.editor());\r\n }\r\n\r\n // Nouvelles méthodes pour les formatages supplémentaires\r\n toggleUnderline() {\r\n this.editorCommands.toggleUnderline(this.editor());\r\n }\r\n toggleSuperscript() {\r\n this.editorCommands.toggleSuperscript(this.editor());\r\n }\r\n toggleSubscript() {\r\n this.editorCommands.toggleSubscript(this.editor());\r\n }\r\n setTextAlign(alignment: \"left\" | \"center\" | \"right\" | \"justify\") {\r\n this.editorCommands.setTextAlign(this.editor(), alignment);\r\n }\r\n toggleLink() {\r\n this.editorCommands.toggleLink(this.editor());\r\n }\r\n insertHorizontalRule() {\r\n this.editorCommands.insertHorizontalRule(this.editor());\r\n }\r\n toggleHighlight() {\r\n this.editorCommands.toggleHighlight(this.editor());\r\n }\r\n\r\n // Méthode pour insérer un tableau\r\n insertTable() {\r\n this.editorCommands.insertTable(this.editor());\r\n }\r\n\r\n // Méthode pour insérer une image\r\n async insertImage() {\r\n try {\r\n const config = this.imageUpload() || {};\r\n await this.imageService.selectAndUploadImage(this.editor(), {\r\n quality: config.quality,\r\n maxWidth: config.maxWidth,\r\n maxHeight: config.maxHeight,\r\n accept: config.allowedTypes?.join(',')\r\n });\r\n } catch (error) {\r\n console.error(this.i18nService.imageUpload().uploadError, error);\r\n this.imageError.emit(this.i18nService.imageUpload().uploadError);\r\n }\r\n }\r\n\r\n // Méthode pour vider le contenu\r\n clearContent() {\r\n this.editorCommands.clearContent(this.editor());\r\n }\r\n\r\n // Méthodes pour les événements d'image (conservées pour compatibilité)\r\n onImageSelected(result: ImageUploadResult) {\r\n this.imageUploaded.emit(result);\r\n }\r\n\r\n onImageError(error: string) {\r\n this.imageError.emit(error);\r\n }\r\n}\r\n","import { Editor } from \"@tiptap/core\";\r\nimport { SlashCommandItem } from \"../tiptap-slash-commands.component\";\r\nimport { TiptapI18nService } from \"../services/i18n.service\";\r\nimport { EditorCommandsService } from \"../services/editor-commands.service\";\r\nimport { ImageService } from \"../services/image.service\";\r\n\r\n/**\r\n * Clés des commandes natives dans l'ordre d'affichage\r\n */\r\nexport const SLASH_COMMAND_KEYS = [\r\n \"heading1\",\r\n \"heading2\",\r\n \"heading3\",\r\n \"bulletList\",\r\n \"orderedList\",\r\n \"blockquote\",\r\n \"code\",\r\n \"image\",\r\n \"horizontalRule\",\r\n \"table\",\r\n] as const;\r\n\r\nexport type SlashCommandKey = (typeof SLASH_COMMAND_KEYS)[number];\r\n\r\n/**\r\n * Configuration simplifiée pour activer/désactiver les slash commands natives.\r\n * Permet aussi d'ajouter des commandes personnalisées.\r\n */\r\nexport interface SlashCommandsConfig extends Partial<Record<SlashCommandKey, boolean>> {\r\n /**\r\n * Liste de commandes supplémentaires à ajouter à la fin du menu\r\n */\r\n custom?: SlashCommandItem[];\r\n}\r\n\r\n/**\r\n * Configuration par défaut : toutes les commandes natives sont activées\r\n */\r\nexport const DEFAULT_SLASH_COMMANDS_CONFIG: Record<SlashCommandKey, boolean> = {\r\n heading1: true,\r\n heading2: true,\r\n heading3: true,\r\n bulletList: true,\r\n orderedList: true,\r\n blockquote: true,\r\n code: true,\r\n image: true,\r\n horizontalRule: true,\r\n table: true,\r\n};\r\n\r\n/**\r\n * Factory pour créer les commandes natives avec leurs traductions et leur logique d'exécution.\r\n * Utilise les services de l'éditeur pour garantir une cohérence de comportement.\r\n */\r\nexport function createDefaultSlashCommands(\r\n i18n: TiptapI18nService,\r\n commands: EditorCommandsService,\r\n images: ImageService,\r\n imageOptions?: { quality?: number; maxWidth?: number; maxHeight?: number; allowedTypes?: string[] }\r\n): SlashCommandItem[] {\r\n const t = i18n.slashCommands();\r\n\r\n return [\r\n {\r\n title: t.heading1.title,\r\n description: t.heading1.description,\r\n icon: \"format_h1\",\r\n keywords: t.heading1.keywords,\r\n command: (editor: Editor) => commands.toggleHeading(editor, 1),\r\n },\r\n {\r\n title: t.heading2.title,\r\n description: t.heading2.description,\r\n icon: \"format_h2\",\r\n keywords: t.heading2.keywords,\r\n command: (editor: Editor) => commands.toggleHeading(editor, 2),\r\n },\r\n {\r\n title: t.heading3.title,\r\n description: t.heading3.description,\r\n icon: \"format_h3\",\r\n keywords: t.heading3.keywords,\r\n command: (editor: Editor) => commands.toggleHeading(editor, 3),\r\n },\r\n {\r\n title: t.bulletList.title,\r\n description: t.bulletList.description,\r\n icon: \"format_list_bulleted\",\r\n keywords: t.bulletList.keywords,\r\n command: (editor: Editor) => commands.toggleBulletList(editor),\r\n },\r\n {\r\n title: t.orderedList.title,\r\n description: t.orderedList.description,\r\n icon: \"format_list_numbered\",\r\n keywords: t.orderedList.keywords,\r\n command: (editor: Editor) => commands.toggleOrderedList(editor),\r\n },\r\n {\r\n title: t.blockquote.title,\r\n description: t.blockquote.description,\r\n icon: \"format_quote\",\r\n keywords: t.blockquote.keywords,\r\n command: (editor: Editor) => commands.toggleBlockquote(editor),\r\n },\r\n {\r\n title: t.code.title,\r\n description: t.code.description,\r\n icon: \"code\",\r\n keywords: t.code.keywords,\r\n command: (editor: Editor) => commands.toggleCode(editor),\r\n },\r\n {\r\n title: t.image.title,\r\n description: t.image.description,\r\n icon: \"image\",\r\n keywords: t.image.keywords,\r\n command: (editor: Editor) => images.selectAndUploadImage(editor, {\r\n quality: imageOptions?.quality,\r\n maxWidth: imageOptions?.maxWidth,\r\n maxHeight: imageOptions?.maxHeight,\r\n accept: imageOptions?.allowedTypes?.join(',')\r\n }),\r\n },\r\n {\r\n title: t.horizontalRule.title,\r\n description: t.horizontalRule.description,\r\n icon: \"horizontal_rule\",\r\n keywords: t.horizontalRule.keywords,\r\n command: (editor: Editor) => commands.insertHorizontalRule(editor),\r\n },\r\n {\r\n title: t.table.title,\r\n description: t.table.description,\r\n icon: \"table_view\",\r\n keywords: t.table.keywords,\r\n command: (editor: Editor) => commands.insertTable(editor),\r\n },\r\n ];\r\n}\r\n\r\n/**\r\n * Filtre et assemble les commandes selon la configuration fournie.\r\n */\r\nexport function filterSlashCommands(\r\n config: SlashCommandsConfig,\r\n i18n: TiptapI18nService,\r\n commands: EditorCommandsService,\r\n images: ImageService,\r\n imageOptions?: { quality?: number; maxWidth?: number; maxHeight?: number; allowedTypes?: string[] }\r\n): SlashCommandItem[] {\r\n const allNatives = createDefaultSlashCommands(i18n, commands, images, imageOptions);\r\n const activeConfig = { ...DEFAULT_SLASH_COMMANDS_CONFIG, ...config };\r\n\r\n const filtered = allNatives.filter((_, index) => {\r\n const key = SLASH_COMMAND_KEYS[index];\r\n return key && activeConfig[key] !== false;\r\n });\r\n\r\n if (config.custom && Array.isArray(config.custom)) {\r\n return [...filtered, ...config.custom];\r\n }\r\n\r\n return filtered;\r\n}\r\n","import {\r\n Component,\r\n input,\r\n output,\r\n ViewChild,\r\n ElementRef,\r\n OnInit,\r\n OnDestroy,\r\n effect,\r\n computed,\r\n inject,\r\n signal,\r\n} from \"@angular/core\";\r\nimport tippy, { Instance as TippyInstance } from \"tippy.js\";\r\nimport type { Editor } from \"@tiptap/core\";\r\nimport { ImageService } from \"./services/image.service\";\r\nimport { TiptapI18nService } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport {\r\n filterSlashCommands,\r\n createDefaultSlashCommands\r\n} from \"./config/slash-commands.config\";\r\nimport { Plugin, PluginKey } from \"prosemirror-state\";\r\nimport { EditorView } from \"prosemirror-view\";\r\n\r\nexport interface SlashCommandItem {\r\n title: string;\r\n description: string;\r\n icon: string;\r\n keywords: string[];\r\n command: (editor: Editor) => void;\r\n}\r\n\r\nexport interface CustomSlashCommands {\r\n commands?: SlashCommandItem[];\r\n}\r\n\r\n// La définition des commandes par défaut est maintenant centralisée dans src/lib/config/i18n-slash-commands.ts\r\n\r\n@Component({\r\n selector: \"tiptap-slash-commands\",\r\n standalone: true,\r\n template: `\r\n <div #menuRef class=\"slash-commands-menu\">\r\n @for (command of filteredCommands(); track command.title) {\r\n <div\r\n class=\"slash-command-item\"\r\n [class.selected]=\"$index === selectedIndex()\"\r\n (mousedown)=\"executeCommand(command); $event.preventDefault(); $event.stopPropagation()\"\r\n (mouseenter)=\"selectedIndex.set($index)\"\r\n >\r\n <div class=\"slash-command-icon\">\r\n <span class=\"material-symbols-outlined\">{{ command.icon }}</span>\r\n </div>\r\n <div class=\"slash-command-content\">\r\n <div class=\"slash-command-title\">{{ command.title }}</div>\r\n <div class=\"slash-command-description\">{{ command.description }}</div>\r\n </div>\r\n </div>\r\n }\r\n </div>\r\n `,\r\n styles: [\r\n `\r\n .slash-commands-menu {\r\n background: var(--ate-menu-bg);\r\n backdrop-filter: blur(var(--ate-menu-blur, 16px));\r\n border: 1px solid var(--ate-menu-border);\r\n border-radius: var(--ate-border-radius, 12px);\r\n box-shadow: var(--ate-menu-shadow);\r\n padding: 6px;\r\n max-height: 320px;\r\n overflow-y: auto;\r\n min-width: 280px;\r\n outline: none;\r\n animation: slashMenuFadeIn 0.2s cubic-bezier(0, 0, 0.2, 1);\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--ate-scrollbar-thumb) var(--ate-scrollbar-track);\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar {\r\n width: var(--ate-scrollbar-width);\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar-track {\r\n background: var(--ate-scrollbar-track);\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar-thumb {\r\n background: var(--ate-scrollbar-thumb);\r\n border: 3px solid transparent;\r\n background-clip: content-box;\r\n border-radius: 10px;\r\n }\r\n\r\n .slash-commands-menu::-webkit-scrollbar-thumb:hover {\r\n background: var(--ate-scrollbar-thumb-hover);\r\n background-clip: content-box;\r\n }\r\n\r\n @keyframes slashMenuFadeIn {\r\n from { opacity: 0; transform: translateY(4px); }\r\n to { opacity: 1; transform: translateY(0); }\r\n }\r\n\r\n .slash-command-item {\r\n display: flex;\r\n align-items: center;\r\n gap: 12px;\r\n padding: 8px 12px;\r\n border-radius: var(--ate-border-radius, 8px);\r\n cursor: pointer;\r\n transition: all 0.15s ease;\r\n border: var(--ate-border-width, 1px) solid transparent;\r\n outline: none;\r\n margin-bottom: 2px;\r\n }\r\n\r\n .slash-command-item:last-child {\r\n margin-bottom: 0;\r\n }\r\n\r\n .slash-command-item:hover {\r\n background: var(--ate-surface-secondary);\r\n }\r\n\r\n .slash-command-item.selected {\r\n background: var(--ate-primary-light);\r\n border-color: var(--ate-primary-light-alpha);\r\n }\r\n\r\n .slash-command-icon {\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n width: 32px;\r\n height: 32px;\r\n background: var(--ate-surface-tertiary);\r\n border-radius: var(--ate-border-radius, 8px);\r\n color: var(--ate-primary);\r\n flex-shrink: 0;\r\n transition: all 0.15s ease;\r\n }\r\n\r\n .slash-command-item.selected .slash-command-icon {\r\n background: var(--ate-primary);\r\n color: var(--ate-primary-contrast, #ffffff);\r\n }\r\n\r\n .slash-command-icon .material-symbols-outlined {\r\n font-size: 18px;\r\n }\r\n\r\n .slash-command-content {\r\n flex: 1;\r\n min-width: 0;\r\n }\r\n\r\n .slash-command-title {\r\n font-weight: 500;\r\n color: var(--ate-text);\r\n font-size: 14px;\r\n margin-bottom: 1px;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n\r\n .slash-command-description {\r\n color: var(--ate-text-secondary);\r\n font-size: 11px;\r\n white-space: nowrap;\r\n overflow: hidden;\r\n text-overflow: ellipsis;\r\n }\r\n `,\r\n ],\r\n})\r\nexport class TiptapSlashCommandsComponent implements OnInit, OnDestroy {\r\n readonly i18nService = inject(TiptapI18nService);\r\n editor = input.required<Editor>();\r\n config = input<CustomSlashCommands | undefined>(undefined);\r\n\r\n // Output pour l'upload d'image\r\n imageUploadRequested = output<File>();\r\n\r\n @ViewChild(\"menuRef\", { static: false }) menuRef!: ElementRef<HTMLDivElement>;\r\n\r\n private tippyInstance: TippyInstance | null = null;\r\n private imageService = inject(ImageService);\r\n private editorCommands = inject(EditorCommandsService);\r\n\r\n // État local\r\n private isActive = false;\r\n private currentQuery = signal(\"\");\r\n private slashRange: { from: number; to: number } | null = null;\r\n\r\n // Signal pour l'index sélectionné\r\n selectedIndex = signal(0);\r\n\r\n commands = computed(() => {\r\n const config = this.config();\r\n if (config && config.commands) {\r\n return config.commands;\r\n }\r\n\r\n // Fallback vers les commandes natives par défaut\r\n return createDefaultSlashCommands(this.i18nService, this.editorCommands, this.imageService);\r\n });\r\n\r\n filteredCommands = computed(() => {\r\n const query = this.currentQuery().toLowerCase();\r\n const commands = this.commands();\r\n\r\n if (!query) {\r\n return commands;\r\n }\r\n\r\n return commands.filter(\r\n (command) =>\r\n command.title.toLowerCase().includes(query) ||\r\n command.description.toLowerCase().includes(query) ||\r\n command.keywords.some((keyword) =>\r\n keyword.toLowerCase().includes(query)\r\n )\r\n );\r\n });\r\n\r\n constructor() {\r\n effect(() => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n // Nettoyer les anciens listeners\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n\r\n // Ajouter les nouveaux listeners\r\n ed.on(\"selectionUpdate\", this.updateMenu);\r\n ed.on(\"transaction\", this.updateMenu);\r\n ed.on(\"focus\", this.updateMenu);\r\n ed.on(\"blur\", this.handleBlur);\r\n\r\n // Utiliser le système de plugins ProseMirror pour intercepter les touches\r\n this.addKeyboardPlugin(ed);\r\n\r\n // Ne pas appeler updateMenu() ici pour éviter l'affichage prématuré\r\n // Il sera appelé automatiquement quand l'éditeur sera prêt\r\n });\r\n }\r\n\r\n ngOnInit() {\r\n this.initTippy();\r\n }\r\n\r\n ngOnDestroy() {\r\n const ed = this.editor();\r\n if (ed) {\r\n ed.off(\"selectionUpdate\", this.updateMenu);\r\n ed.off(\"transaction\", this.updateMenu);\r\n ed.off(\"focus\", this.updateMenu);\r\n ed.off(\"blur\", this.handleBlur);\r\n }\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n this.tippyInstance = null;\r\n }\r\n }\r\n\r\n private initTippy() {\r\n if (!this.menuRef?.nativeElement) {\r\n setTimeout(() => this.initTippy(), 50);\r\n return;\r\n }\r\n\r\n const menuElement = this.menuRef.nativeElement;\r\n\r\n if (this.tippyInstance) {\r\n this.tippyInstance.destroy();\r\n }\r\n\r\n this.tippyInstance = tippy(document.body, {\r\n content: menuElement,\r\n trigger: \"manual\",\r\n placement: \"bottom-start\",\r\n appendTo: (ref) => {\r\n // Toujours essayer de remonter jusqu'au host de l'éditeur pour hériter des variables CSS\r\n const host = this.editor().options.element.closest(\"angular-tiptap-editor\");\r\n return host || document.body;\r\n },\r\n interactive: true,\r\n arrow: false,\r\n offset: [0, 8],\r\n hideOnClick: true,\r\n getReferenceClientRect: () => this.getSlashRect(),\r\n // Améliorer le positionnement avec scroll\r\n popperOptions: {\r\n modifiers: [\r\n {\r\n name: \"preventOverflow\",\r\n options: {\r\n boundary: \"viewport\",\r\n padding: 8,\r\n },\r\n },\r\n {\r\n name: \"flip\",\r\n options: {\r\n fallbackPlacements: [\"top-start\", \"bottom-end\", \"top-end\"],\r\n },\r\n },\r\n ],\r\n },\r\n });\r\n\r\n // Maintenant que Tippy est initialisé, faire un premier check\r\n this.updateMenu();\r\n }\r\n\r\n private getSlashRect(): DOMRect {\r\n const ed = this.editor();\r\n if (!ed || !this.slashRange) {\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n\r\n try {\r\n // Utiliser les coordonnées ProseMirror pour plus de précision\r\n const coords = ed.view.coordsAtPos(this.slashRange.from);\r\n return new DOMRect(\r\n coords.left,\r\n coords.top,\r\n 0,\r\n coords.bottom - coords.top\r\n );\r\n } catch (error) {\r\n console.warn(\"Error calculating coordinates:\", error);\r\n // Fallback sur window.getSelection\r\n const selection = window.getSelection();\r\n if (!selection || selection.rangeCount === 0) {\r\n return new DOMRect(0, 0, 0, 0);\r\n }\r\n const range = selection.getRangeAt(0);\r\n return range.getBoundingClientRect();\r\n }\r\n }\r\n\r\n updateMenu = () => {\r\n const ed = this.editor();\r\n if (!ed) return;\r\n\r\n const { from } = ed.state.selection;\r\n\r\n // Vérifier si on a tapé '/' au début d'une ligne ou après un espace\r\n const textBefore = ed.state.doc.textBetween(\r\n Math.max(0, from - 20),\r\n from,\r\n \"\\n\"\r\n );\r\n const slashMatch = textBefore.match(/(?:^|\\s)\\/([^\\/\\s]*)$/);\r\n\r\n if (slashMatch) {\r\n const query = slashMatch[1] || \"\";\r\n const wasActive = this.isActive;\r\n\r\n this.currentQuery.set(query);\r\n this.slashRange = {\r\n from: from - slashMatch[0].length + slashMatch[0].indexOf(\"/\"),\r\n to: from,\r\n };\r\n\r\n // Si le menu vient de devenir actif, réinitialiser l'index\r\n if (!wasActive) {\r\n this.selectedIndex.set(0);\r\n }\r\n\r\n this.isActive = true;\r\n this.showTippy();\r\n } else {\r\n this.isActive = false;\r\n this.hideTippy();\r\n }\r\n };\r\n\r\n handleBlur = () => {\r\n setTimeout(() => this.hideTippy(), 100);\r\n };\r\n\r\n handleKeyDown = (event: KeyboardEvent) => {\r\n // Ne gérer les touches que si le menu est actif\r\n if (!this.isActive || this.filteredCommands().length === 0) {\r\n return;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const nextIndex =\r\n (this.selectedIndex() + 1) % this.filteredCommands().length;\r\n this.selectedIndex.set(nextIndex);\r\n this.scrollToSelected();\r\n break;\r\n\r\n case \"ArrowUp\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const prevIndex =\r\n this.selectedIndex() === 0\r\n ? this.filteredCommands().length - 1\r\n : this.selectedIndex() - 1;\r\n this.selectedIndex.set(prevIndex);\r\n this.scrollToSelected();\r\n break;\r\n\r\n case \"Enter\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n const selectedCommand = this.filteredCommands()[this.selectedIndex()];\r\n if (selectedCommand) {\r\n this.executeCommand(selectedCommand);\r\n }\r\n break;\r\n\r\n case \"Escape\":\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this.isActive = false;\r\n this.hideTippy();\r\n // Optionnel : supprimer le \"/\" tapé\r\n const ed = this.editor();\r\n if (ed && this.slashRange) {\r\n const { tr } = ed.state;\r\n tr.delete(this.slashRange.from, this.slashRange.to);\r\n ed.view.dispatch(tr);\r\n }\r\n break;\r\n }\r\n };\r\n\r\n private scrollToSelected() {\r\n // Faire défiler vers l'élément sélectionné\r\n if (this.menuRef?.nativeElement) {\r\n const selectedItem = this.menuRef.nativeElement.querySelector(\r\n \".slash-command-item.selected\"\r\n ) as HTMLElement;\r\n if (selectedItem) {\r\n selectedItem.scrollIntoView({ block: \"nearest\", behavior: \"smooth\" });\r\n }\r\n }\r\n }\r\n\r\n private showTippy() {\r\n if (this.tippyInstance && this.filteredCommands().length > 0) {\r\n this.tippyInstance.show();\r\n }\r\n }\r\n\r\n private hideTippy() {\r\n if (this.tippyInstance) {\r\n this.tippyInstance.hide();\r\n }\r\n }\r\n\r\n executeCommand(command: SlashCommandItem) {\r\n const ed = this.editor();\r\n if (!ed || !this.slashRange) return;\r\n\r\n // Supprimer le texte slash (\"/\")\r\n const { tr } = ed.state;\r\n tr.delete(this.slashRange.from, this.slashRange.to);\r\n ed.view.dispatch(tr);\r\n\r\n // Cacher le menu immédiatement\r\n this.hideTippy();\r\n this.isActive = false;\r\n\r\n // Redonner le focus à l'éditeur et exécuter la commande\r\n // On utilise un micro-délai pour s'assurer que le DOM ProseMirror est stable\r\n // après la suppression du texte \"/\"\r\n setTimeout(() => {\r\n ed.commands.focus();\r\n command.command(ed);\r\n }, 10);\r\n }\r\n\r\n private addKeyboardPlugin(ed: Editor) {\r\n // Ajouter un plugin ProseMirror pour intercepter les événements clavier\r\n const keyboardPlugin = new Plugin({\r\n key: new PluginKey(\"slash-commands-keyboard\"),\r\n props: {\r\n handleKeyDown: (view: EditorView, event: KeyboardEvent) => {\r\n // Ne gérer que si le menu est actif\r\n if (!this.isActive || this.filteredCommands().length === 0) {\r\n return false;\r\n }\r\n\r\n switch (event.key) {\r\n case \"ArrowDown\":\r\n event.preventDefault();\r\n const nextIndex =\r\n (this.selectedIndex() + 1) % this.filteredCommands().length;\r\n this.selectedIndex.set(nextIndex);\r\n this.scrollToSelected();\r\n return true;\r\n\r\n case \"ArrowUp\":\r\n event.preventDefault();\r\n const prevIndex =\r\n this.selectedIndex() === 0\r\n ? this.filteredCommands().length - 1\r\n : this.selectedIndex() - 1;\r\n this.selectedIndex.set(prevIndex);\r\n this.scrollToSelected();\r\n return true;\r\n\r\n case \"Enter\":\r\n event.preventDefault();\r\n const selectedCommand =\r\n this.filteredCommands()[this.selectedIndex()];\r\n if (selectedCommand) {\r\n this.executeCommand(selectedCommand);\r\n }\r\n return true;\r\n\r\n case \"Escape\":\r\n event.preventDefault();\r\n this.isActive = false;\r\n this.hideTippy();\r\n // Supprimer le \"/\" tapé\r\n if (this.slashRange) {\r\n const { tr } = view.state;\r\n tr.delete(this.slashRange.from, this.slashRange.to);\r\n view.dispatch(tr);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n },\r\n },\r\n });\r\n\r\n // Ajouter le plugin à l'éditeur\r\n ed.view.updateState(\r\n ed.view.state.reconfigure({\r\n plugins: [keyboardPlugin, ...ed.view.state.plugins],\r\n })\r\n );\r\n }\r\n}\r\n","// Main component\r\nexport { AngularTiptapEditorComponent } from \"./tiptap-editor.component\";\r\n\r\n// Bubble menus\r\nexport { TiptapBubbleMenuComponent } from \"./tiptap-bubble-menu.component\";\r\nexport { TiptapImageBubbleMenuComponent } from \"./tiptap-image-bubble-menu.component\";\r\nexport { TiptapTableBubbleMenuComponent } from \"./tiptap-table-bubble-menu.component\";\r\nexport { TiptapCellBubbleMenuComponent } from \"./tiptap-cell-bubble-menu.component\";\r\n\r\n// Toolbar components\r\nexport { TiptapToolbarComponent } from \"./tiptap-toolbar.component\";\r\nexport { TiptapButtonComponent } from \"./tiptap-button.component\";\r\nexport { TiptapSeparatorComponent } from \"./tiptap-separator.component\";\r\n\r\n// Slash commands\r\nexport { TiptapSlashCommandsComponent } from \"./tiptap-slash-commands.component\";\r\n\r\n// Services\r\nexport { TiptapI18nService } from \"./services/i18n.service\";\r\nexport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nexport { ImageService } from \"./services/image.service\";\r\n\r\n// Models and types\r\nexport type {\r\n BubbleMenuConfig,\r\n ImageBubbleMenuConfig,\r\n TableBubbleMenuConfig,\r\n CellBubbleMenuConfig,\r\n} from \"./models/bubble-menu.model\";\r\n\r\n// Image upload types\r\nexport type {\r\n ImageUploadHandler,\r\n ImageUploadContext,\r\n ImageUploadHandlerResult,\r\n ImageUploadResult,\r\n ImageData,\r\n} from \"./services/image.service\";\r\n","import { Directive } from \"@angular/core\";\r\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from \"@angular/forms\";\r\n\r\n@Directive({\r\n standalone: true,\r\n providers: [\r\n {\r\n provide: NG_VALUE_ACCESSOR,\r\n multi: true,\r\n useExisting: NoopValueAccessorDirective,\r\n },\r\n ],\r\n})\r\nexport class NoopValueAccessorDirective implements ControlValueAccessor {\r\n writeValue(obj: any): void {}\r\n registerOnChange(fn: any): void {}\r\n registerOnTouched(fn: any): void {}\r\n}\r\n","import {\r\n Component,\r\n ElementRef,\r\n input,\r\n output,\r\n OnDestroy,\r\n viewChild,\r\n effect,\r\n signal,\r\n computed,\r\n AfterViewInit,\r\n inject,\r\n DestroyRef,\r\n} from \"@angular/core\";\r\nimport { takeUntilDestroyed } from \"@angular/core/rxjs-interop\";\r\nimport { Editor, EditorOptions, Extension, Node, Mark } from \"@tiptap/core\";\r\nimport StarterKit from \"@tiptap/starter-kit\";\r\nimport Placeholder from \"@tiptap/extension-placeholder\";\r\nimport CharacterCount from \"@tiptap/extension-character-count\";\r\nimport Underline from \"@tiptap/extension-underline\";\r\nimport Superscript from \"@tiptap/extension-superscript\";\r\nimport Subscript from \"@tiptap/extension-subscript\";\r\nimport TextAlign from \"@tiptap/extension-text-align\";\r\nimport Link from \"@tiptap/extension-link\";\r\nimport Highlight from \"@tiptap/extension-highlight\";\r\nimport TextStyle from \"@tiptap/extension-text-style\";\r\nimport Color from \"@tiptap/extension-color\";\r\nimport OfficePaste from \"@intevation/tiptap-extension-office-paste\";\r\n\r\nimport { ResizableImage } from \"./extensions/resizable-image.extension\";\r\nimport { UploadProgress } from \"./extensions/upload-progress.extension\";\r\nimport { TableExtension } from \"./extensions/table.extension\";\r\nimport { TiptapToolbarComponent } from \"./index\";\r\nimport { TiptapBubbleMenuComponent } from \"./tiptap-bubble-menu.component\";\r\nimport { TiptapImageBubbleMenuComponent } from \"./tiptap-image-bubble-menu.component\";\r\nimport { TiptapTableBubbleMenuComponent } from \"./tiptap-table-bubble-menu.component\";\r\nimport {\r\n CellBubbleMenuConfig,\r\n TiptapCellBubbleMenuComponent,\r\n} from \"./tiptap-cell-bubble-menu.component\";\r\nimport {\r\n TiptapSlashCommandsComponent,\r\n CustomSlashCommands,\r\n} from \"./tiptap-slash-commands.component\";\r\nimport {\r\n ImageService,\r\n ImageUploadHandler,\r\n ImageUploadResult,\r\n} from \"./services/image.service\";\r\nimport { TiptapI18nService, SupportedLocale } from \"./services/i18n.service\";\r\nimport { EditorCommandsService } from \"./services/editor-commands.service\";\r\nimport { NoopValueAccessorDirective } from \"./noop-value-accessor.directive\";\r\nimport { NgControl } from \"@angular/forms\";\r\nimport {\r\n filterSlashCommands,\r\n SLASH_COMMAND_KEYS,\r\n SlashCommandsConfig,\r\n DEFAULT_SLASH_COMMANDS_CONFIG,\r\n} from \"./config/slash-commands.config\";\r\n\r\nimport { ToolbarConfig } from \"./tiptap-toolbar.component\";\r\nimport {\r\n BubbleMenuConfig,\r\n ImageBubbleMenuConfig,\r\n TableBubbleMenuConfig,\r\n} from \"./models/bubble-menu.model\";\r\nimport { concat, defer, of, tap } from \"rxjs\";\r\n\r\n// Configuration par défaut de la toolbar\r\nexport const DEFAULT_TOOLBAR_CONFIG: ToolbarConfig = {\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n heading1: true,\r\n heading2: true,\r\n heading3: true,\r\n bulletList: true,\r\n orderedList: true,\r\n blockquote: true,\r\n alignLeft: false,\r\n alignCenter: false,\r\n alignRight: false,\r\n alignJustify: false,\r\n link: true,\r\n image: true,\r\n horizontalRule: true,\r\n table: true,\r\n undo: true,\r\n redo: true,\r\n clear: false, // Désactivé par défaut (opt-in)\r\n textColor: true,\r\n separator: true,\r\n};\r\n\r\n// Configuration par défaut du bubble menu\r\nexport const DEFAULT_BUBBLE_MENU_CONFIG: BubbleMenuConfig = {\r\n bold: true,\r\n italic: true,\r\n underline: true,\r\n strike: true,\r\n code: true,\r\n superscript: false,\r\n subscript: false,\r\n highlight: true,\r\n textColor: true,\r\n link: true,\r\n separator: true,\r\n};\r\n\r\n// Configuration par défaut du bubble menu image\r\nexport const DEFAULT_IMAGE_BUBBLE_MENU_CONFIG: ImageBubbleMenuConfig = {\r\n changeImage: true,\r\n resizeSmall: true,\r\n resizeMedium: true,\r\n resizeLarge: true,\r\n resizeOriginal: true,\r\n deleteImage: true,\r\n separator: true,\r\n};\r\n\r\n// Configuration par défaut du menu de table\r\nexport const DEFAULT_TABLE_MENU_CONFIG: TableBubbleMenuConfig = {\r\n addRowBefore: true,\r\n addRowAfter: true,\r\n deleteRow: true,\r\n addColumnBefore: true,\r\n addColumnAfter: true,\r\n deleteColumn: true,\r\n toggleHeaderRow: true,\r\n toggleHeaderColumn: true,\r\n deleteTable: true,\r\n separator: true,\r\n};\r\n\r\nexport const DEFAULT_CELL_MENU_CONFIG: CellBubbleMenuConfig = {\r\n mergeCells: true,\r\n splitCell: true,\r\n};\r\n\r\n// La configuration des slash commands est gérée dynamiquement via slashCommandsConfigComputed\r\n\r\n@Component({\r\n selector: \"angular-tiptap-editor\",\r\n standalone: true,\r\n hostDirectives: [NoopValueAccessorDirective],\r\n host: {\r\n '[class.fill-container]': 'fillContainer()',\r\n },\r\n imports: [\r\n TiptapToolbarComponent,\r\n TiptapBubbleMenuComponent,\r\n TiptapImageBubbleMenuComponent,\r\n TiptapTableBubbleMenuComponent,\r\n TiptapCellBubbleMenuComponent,\r\n TiptapSlashCommandsComponent,\r\n ],\r\n template: `\r\n <div class=\"tiptap-editor\" [class.fill-container]=\"fillContainer()\">\r\n <!-- Toolbar -->\r\n @if (showToolbar() && editor()) {\r\n <tiptap-toolbar \r\n [editor]=\"editor()!\" \r\n [config]=\"toolbarConfig()\"\r\n [imageUpload]=\"imageUploadConfig()\"\r\n />\r\n }\r\n\r\n <!-- Contenu de l'éditeur -->\r\n <div\r\n #editorElement\r\n class=\"tiptap-content\"\r\n [class.drag-over]=\"isDragOver()\"\r\n (dragover)=\"onDragOver($event)\"\r\n (drop)=\"onDrop($event)\"\r\n (click)=\"onEditorClick($event)\"\r\n ></div>\r\n\r\n <!-- Bubble Menu pour le texte -->\r\n @if (showBubbleMenu() && editor()) {\r\n <tiptap-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"bubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-bubble-menu>\r\n }\r\n\r\n <!-- Bubble Menu pour les images -->\r\n @if (showImageBubbleMenu() && editor()) {\r\n <tiptap-image-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"imageBubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-image-bubble-menu>\r\n }\r\n\r\n <!-- Slash Commands -->\r\n @if (enableSlashCommands() && editor()) {\r\n <tiptap-slash-commands\r\n [editor]=\"editor()!\"\r\n [config]=\"slashCommandsConfigComputed()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n (imageUploadRequested)=\"onSlashCommandImageUpload($event)\"\r\n ></tiptap-slash-commands>\r\n }\r\n\r\n <!-- Table Menu -->\r\n @if (editor()) {\r\n <tiptap-table-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"tableBubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-table-bubble-menu>\r\n }\r\n\r\n <!-- Cell Menu -->\r\n @if (editor()) {\r\n <tiptap-cell-bubble-menu\r\n [editor]=\"editor()!\"\r\n [config]=\"cellBubbleMenuConfig()\"\r\n [style.display]=\"editorFullyInitialized() ? 'block' : 'none'\"\r\n ></tiptap-cell-bubble-menu>\r\n }\r\n\r\n <!-- Compteurs -->\r\n @if (showCharacterCount() || showWordCount()) {\r\n <div class=\"character-count\" [class.limit-reached]=\"maxCharacters() && characterCount() >= maxCharacters()!\">\r\n @if (showCharacterCount()) {\r\n {{ characterCount() }}\r\n {{ i18nService.editor().character }}{{ characterCount() > 1 ? \"s\" : \"\" }}\r\n @if (maxCharacters()) {\r\n / {{ maxCharacters() }}\r\n }\r\n }\r\n \r\n @if (showCharacterCount() && showWordCount()) {\r\n , \r\n }\r\n\r\n @if (showWordCount()) {\r\n {{ wordCount() }}\r\n {{ i18nService.editor().word }}{{ wordCount() > 1 ? \"s\" : \"\" }}\r\n }\r\n </div>\r\n }\r\n </div>\r\n `,\r\n\r\n styles: [\r\n `\r\n /* ========================================\r\n CSS Custom Properties (Variables)\r\n Override these to customize the editor\r\n ======================================== */\r\n :host {\r\n /* ===== BASE TOKENS (customize these for easy theming) ===== */\r\n --ate-primary: #2563eb;\r\n --ate-primary-contrast: #ffffff;\r\n --ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 90%);\r\n --ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 95%);\r\n --ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 85%);\r\n \r\n --ate-surface: #ffffff;\r\n --ate-surface-secondary: #f8f9fa;\r\n --ate-surface-tertiary: #f1f5f9;\r\n \r\n --ate-text: #2d3748;\r\n --ate-text-secondary: #64748b;\r\n --ate-text-muted: #a0aec0;\r\n \r\n --ate-border: #e2e8f0;\r\n \r\n --ate-highlight-bg: #fef08a;\r\n --ate-highlight-color: #854d0e;\r\n \r\n --ate-button-hover: #f1f5f9;\r\n --ate-button-active: #e2e8f0;\r\n\r\n /* ===== MENUS (Slash/Bubble) ===== */\r\n --ate-menu-bg: rgba(255, 255, 255, 0.98);\r\n --ate-menu-border: var(--ate-border);\r\n --ate-menu-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);\r\n --ate-menu-blur: 16px;\r\n\r\n --ate-error-color: #c53030;\r\n --ate-error-bg: #fed7d7;\r\n --ate-error-border: #feb2b2;\r\n \r\n /* ===== COMPONENT TOKENS (use base tokens by default) ===== */\r\n /* Border & Container */\r\n --ate-border-color: var(--ate-border);\r\n --ate-border-width: 2px;\r\n --ate-border-radius: 8px;\r\n --ate-focus-color: var(--ate-primary);\r\n --ate-background: var(--ate-surface);\r\n \r\n /* Content */\r\n --ate-text-color: var(--ate-text);\r\n --ate-placeholder-color: var(--ate-text-muted);\r\n --ate-line-height: 1.6;\r\n --ate-content-padding: 16px;\r\n \r\n /* Toolbar */\r\n --ate-toolbar-background: var(--ate-surface-secondary);\r\n --ate-toolbar-border-color: var(--ate-border);\r\n --ate-toolbar-button-color: var(--ate-text-secondary);\r\n --ate-toolbar-button-hover-background: transparent;\r\n --ate-toolbar-button-active-background: var(--ate-primary-light);\r\n --ate-toolbar-button-active-color: var(--ate-primary);\r\n \r\n /* Counter */\r\n --ate-counter-color: var(--ate-text-secondary);\r\n --ate-counter-background: var(--ate-surface-secondary);\r\n --ate-counter-border-color: var(--ate-border);\r\n \r\n /* Drag & Drop */\r\n --ate-drag-background: #f0f8ff;\r\n --ate-drag-border-color: var(--ate-primary);\r\n \r\n /* Blockquote */\r\n --ate-blockquote-border-color: var(--ate-border);\r\n --ate-blockquote-background: var(--ate-surface-secondary);\r\n \r\n /* Code */\r\n --ate-code-background: var(--ate-surface-secondary);\r\n --ate-code-color: var(--ate-text);\r\n --ate-code-block-background: #181825;\r\n --ate-code-block-color: #e2e8f0;\r\n --ate-code-border-color: var(--ate-border);\r\n --ate-code-block-border-color: var(--ate-border);\r\n \r\n /* Images */\r\n --ate-image-border-radius: 8px;\r\n --ate-image-selected-color: var(--ate-primary);\r\n \r\n /* Scrollbars */\r\n --ate-scrollbar-width: 10px;\r\n --ate-scrollbar-thumb: var(--ate-border);\r\n --ate-scrollbar-thumb-hover: var(--ate-text-muted);\r\n --ate-scrollbar-track: transparent;\r\n \r\n /* Tables */\r\n --ate-table-border-color: var(--ate-border);\r\n --ate-table-header-background: var(--ate-surface-secondary);\r\n --ate-table-header-color: var(--ate-text);\r\n --ate-table-cell-background: var(--ate-surface);\r\n --ate-table-cell-selected-background: var(--ate-primary-light);\r\n --ate-table-resize-handle-color: var(--ate-primary);\r\n --ate-table-row-hover-background: var(--ate-primary-lighter);\r\n }\r\n\r\n /* Manual dark mode with class or data attribute */\r\n :host(.dark),\r\n :host([data-theme=\"dark\"]) {\r\n /* ===== DARK BASE TOKENS ===== */\r\n --ate-primary: #3b82f6;\r\n --ate-primary-contrast: #ffffff;\r\n --ate-primary-light: color-mix(in srgb, var(--ate-primary), transparent 85%);\r\n --ate-primary-lighter: color-mix(in srgb, var(--ate-primary), transparent 92%);\r\n --ate-primary-light-alpha: color-mix(in srgb, var(--ate-primary), transparent 80%);\r\n \r\n --ate-surface: #020617;\r\n --ate-surface-secondary: #0f172a;\r\n --ate-surface-tertiary: #1e293b;\r\n \r\n --ate-text: #f8fafc;\r\n --ate-text-secondary: #94a3b8;\r\n --ate-text-muted: #64748b;\r\n \r\n --ate-border: #1e293b;\r\n \r\n --ate-highlight-bg: #854d0e;\r\n --ate-highlight-color: #fef08a;\r\n\r\n --ate-button-hover: #1e293b;\r\n --ate-button-active: #0f172a;\r\n\r\n /* ===== MENUS (Slash/Bubble) ===== */\r\n --ate-menu-bg: rgba(15, 23, 42, 0.95);\r\n --ate-menu-border: rgba(255, 255, 255, 0.1);\r\n --ate-menu-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);\r\n --ate-menu-blur: 16px;\r\n\r\n --ate-error-color: #f87171;\r\n --ate-error-bg: #450a0a;\r\n --ate-error-border: #7f1d1d;\r\n \r\n /* ===== DARK COMPONENT OVERRIDES ===== */\r\n --ate-drag-background: var(--ate-surface-tertiary);\r\n --ate-drag-border-color: var(--ate-primary);\r\n --ate-blockquote-border-color: var(--ate-primary);\r\n --ate-toolbar-button-active-background: var(--ate-primary-light);\r\n --ate-toolbar-button-active-color: var(--ate-primary);\r\n --ate-button-hover: var(--ate-surface-tertiary);\r\n --ate-button-active: var(--ate-surface-secondary);\r\n --ate-scrollbar-thumb: var(--ate-surface-tertiary);\r\n --ate-scrollbar-thumb-hover: var(--ate-text-muted);\r\n }\r\n\r\n /* Host styles pour fillContainer */\r\n :host(.fill-container) {\r\n display: block;\r\n height: 100%;\r\n }\r\n\r\n /* Conteneur principal de l'éditeur */\r\n .tiptap-editor {\r\n border: var(--ate-border-width) solid var(--ate-border-color);\r\n border-radius: var(--ate-border-radius);\r\n background: var(--ate-background);\r\n overflow: hidden;\r\n transition: border-color 0.2s ease;\r\n }\r\n\r\n /* Mode fill container - l'éditeur remplit son parent */\r\n .tiptap-editor.fill-container {\r\n display: flex;\r\n flex-direction: column;\r\n height: 100%;\r\n }\r\n\r\n .tiptap-editor.fill-container .tiptap-content {\r\n flex: 1;\r\n min-height: 0;\r\n overflow-y: auto;\r\n }\r\n\r\n .tiptap-editor:focus-within {\r\n border-color: var(--ate-focus-color);\r\n }\r\n\r\n /* Contenu de l'éditeur */\r\n .tiptap-content {\r\n padding: var(--ate-content-padding);\r\n min-height: var(--editor-min-height, 200px);\r\n height: var(--editor-height, auto);\r\n max-height: var(--editor-max-height, none);\r\n overflow-y: var(--editor-overflow, visible);\r\n outline: none;\r\n position: relative;\r\n scrollbar-width: thin;\r\n scrollbar-color: var(--ate-scrollbar-thumb) var(--ate-scrollbar-track);\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar {\r\n width: var(--ate-scrollbar-width);\r\n height: var(--ate-scrollbar-width);\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar-track {\r\n background: var(--ate-scrollbar-track);\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar-thumb {\r\n background: var(--ate-scrollbar-thumb);\r\n border: 3px solid transparent;\r\n background-clip: content-box;\r\n border-radius: 10px;\r\n }\r\n\r\n .tiptap-content::-webkit-scrollbar-thumb:hover {\r\n background: var(--ate-scrollbar-thumb-hover);\r\n background-clip: content-box;\r\n }\r\n\r\n .tiptap-content.drag-over {\r\n background: var(--ate-drag-background);\r\n border: 2px dashed var(--ate-drag-border-color);\r\n }\r\n\r\n /* Compteur de caractères */\r\n .character-count {\r\n padding: 8px var(--ate-content-padding);\r\n font-size: 12px;\r\n color: var(--ate-counter-color);\r\n text-align: right;\r\n border-top: 1px solid var(--ate-counter-border-color);\r\n background: var(--ate-counter-background);\r\n transition: color 0.2s ease;\r\n }\r\n\r\n .character-count.limit-reached {\r\n color: var(--ate-error-color, #ef4444);\r\n font-weight: 600;\r\n }\r\n\r\n /* Styles ProseMirror avec :host ::ng-deep */\r\n :host ::ng-deep .ProseMirror {\r\n outline: none;\r\n line-height: var(--ate-line-height);\r\n color: var(--ate-text-color);\r\n min-height: 100%;\r\n height: 100%;\r\n /* S'assurer que le contenu s'étend correctement dans un conteneur scrollable */\r\n word-wrap: break-word;\r\n overflow-wrap: break-word;\r\n }\r\n\r\n /* Titres */\r\n :host ::ng-deep .ProseMirror h1 {\r\n font-size: 2em;\r\n font-weight: bold;\r\n margin-top: 0;\r\n margin-bottom: 0.5em;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror h2 {\r\n font-size: 1.5em;\r\n font-weight: bold;\r\n margin-top: 1em;\r\n margin-bottom: 0.5em;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror h3 {\r\n font-size: 1.25em;\r\n font-weight: bold;\r\n margin-top: 1em;\r\n margin-bottom: 0.5em;\r\n }\r\n\r\n /* Paragraphes et listes */\r\n :host ::ng-deep .ProseMirror p {\r\n margin: 0.5em 0;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror ul,\r\n :host ::ng-deep .ProseMirror ol {\r\n padding-left: 2em;\r\n margin: 0.5em 0;\r\n }\r\n\r\n /* Citations */\r\n :host ::ng-deep .ProseMirror blockquote {\r\n border-left: 4px solid var(--ate-blockquote-border-color);\r\n padding-left: 1em;\r\n margin: 1em 0;\r\n font-style: italic;\r\n background: var(--ate-blockquote-background);\r\n padding: 0.5em 1em;\r\n border-radius: 0 4px 4px 0;\r\n }\r\n\r\n /* Code */\r\n :host ::ng-deep .ProseMirror code {\r\n background: var(--ate-code-background);\r\n color: var(--ate-code-color);\r\n border: 1px solid var(--ate-code-border-color);\r\n padding: 0.2em 0.4em;\r\n border-radius: 3px;\r\n font-family: \"Monaco\", \"Consolas\", monospace;\r\n font-size: 0.9em;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror pre {\r\n background: var(--ate-code-block-background);\r\n color: var(--ate-code-block-color);\r\n border: 1px solid var(--ate-code-block-border-color);\r\n padding: 1em;\r\n border-radius: 6px;\r\n overflow-x: auto;\r\n margin: 1em 0;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror pre code {\r\n background: none;\r\n color: inherit;\r\n border: none;\r\n padding: 0;\r\n }\r\n\r\n /* Placeholder */\r\n :host ::ng-deep .ProseMirror p.is-editor-empty:first-child::before {\r\n content: attr(data-placeholder);\r\n color: var(--ate-placeholder-color);\r\n pointer-events: none;\r\n float: left;\r\n height: 0;\r\n }\r\n\r\n /* Mode lecture seule */\r\n :host ::ng-deep .ProseMirror[contenteditable=\"false\"] {\r\n pointer-events: none;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror[contenteditable=\"false\"] img {\r\n cursor: default;\r\n pointer-events: none;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror[contenteditable=\"false\"] img:hover {\r\n transform: none;\r\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\r\n }\r\n\r\n :host\r\n ::ng-deep\r\n .ProseMirror[contenteditable=\"false\"]\r\n img.ProseMirror-selectednode {\r\n outline: none;\r\n }\r\n\r\n /* Styles pour les images */\r\n :host ::ng-deep .ProseMirror img {\r\n position: relative;\r\n display: inline-block;\r\n max-width: 100%;\r\n height: auto;\r\n cursor: pointer;\r\n transition: all 0.2s ease;\r\n border: 2px solid transparent;\r\n border-radius: var(--ate-image-border-radius);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror img:hover {\r\n border-color: var(--ate-border-color);\r\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror img.ProseMirror-selectednode {\r\n border-color: var(--ate-image-selected-color);\r\n box-shadow: 0 0 0 3px var(--ate-primary-light-alpha);\r\n transition: all 0.2s ease;\r\n }\r\n\r\n /* Images avec classe tiptap-image */\r\n :host ::ng-deep .ProseMirror .tiptap-image {\r\n max-width: 100%;\r\n height: auto;\r\n border-radius: 16px;\r\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);\r\n margin: 0.5em 0;\r\n cursor: pointer;\r\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\r\n display: block;\r\n filter: brightness(1) contrast(1);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror .tiptap-image:hover {\r\n box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);\r\n filter: brightness(1.02) contrast(1.02);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror .tiptap-image.ProseMirror-selectednode {\r\n outline: 2px solid var(--ate-primary);\r\n outline-offset: 2px;\r\n border-radius: 16px;\r\n box-shadow: 0 0 0 4px var(--ate-primary-light-alpha);\r\n }\r\n\r\n /* Conteneurs d'images avec alignement */\r\n :host ::ng-deep .image-container {\r\n margin: 0.5em 0;\r\n text-align: center;\r\n border-radius: 16px;\r\n overflow: hidden;\r\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\r\n }\r\n\r\n :host ::ng-deep .image-container.image-align-left {\r\n text-align: left;\r\n }\r\n\r\n :host ::ng-deep .image-container.image-align-center {\r\n text-align: center;\r\n }\r\n\r\n :host ::ng-deep .image-container.image-align-right {\r\n text-align: right;\r\n }\r\n\r\n :host ::ng-deep .image-container img {\r\n display: inline-block;\r\n max-width: 100%;\r\n height: auto;\r\n border-radius: 16px;\r\n }\r\n\r\n /* Conteneur pour les images redimensionnables */\r\n :host ::ng-deep .resizable-image-container {\r\n position: relative;\r\n display: inline-block;\r\n margin: 0.5em 0;\r\n }\r\n\r\n /* Conteneur des contrôles de redimensionnement */\r\n :host ::ng-deep .resize-controls {\r\n position: absolute;\r\n top: 0;\r\n left: 0;\r\n right: 0;\r\n bottom: 0;\r\n pointer-events: none;\r\n z-index: 1000;\r\n }\r\n\r\n /* Poignées de redimensionnement */\r\n :host ::ng-deep .resize-handle {\r\n position: absolute;\r\n width: 12px;\r\n height: 12px;\r\n background: var(--ate-primary);\r\n border: 2px solid var(--ate-surface);\r\n border-radius: 50%;\r\n pointer-events: all;\r\n cursor: pointer;\r\n z-index: 1001;\r\n transition: all 0.15s ease;\r\n box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle:hover {\r\n background: var(--ate-primary);\r\n box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);\r\n }\r\n\r\n :host ::ng-deep .resize-handle:active {\r\n background: var(--ate-primary);\r\n }\r\n\r\n /* Poignées du milieu avec scale séparé */\r\n :host ::ng-deep .resize-handle-n:hover,\r\n :host ::ng-deep .resize-handle-s:hover {\r\n transform: translateX(-50%) scale(1.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-w:hover,\r\n :host ::ng-deep .resize-handle-e:hover {\r\n transform: translateY(-50%) scale(1.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-n:active,\r\n :host ::ng-deep .resize-handle-s:active {\r\n transform: translateX(-50%) scale(0.9);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-w:active,\r\n :host ::ng-deep .resize-handle-e:active {\r\n transform: translateY(-50%) scale(0.9);\r\n }\r\n\r\n /* Poignées des coins avec scale simple */\r\n :host ::ng-deep .resize-handle-nw:hover,\r\n :host ::ng-deep .resize-handle-ne:hover,\r\n :host ::ng-deep .resize-handle-sw:hover,\r\n :host ::ng-deep .resize-handle-se:hover {\r\n transform: scale(1.2);\r\n }\r\n\r\n :host ::ng-deep .resize-handle-nw:active,\r\n :host ::ng-deep .resize-handle-ne:active,\r\n :host ::ng-deep .resize-handle-sw:active,\r\n :host ::ng-deep .resize-handle-se:active {\r\n transform: scale(0.9);\r\n }\r\n\r\n /* Positions spécifiques pour chaque poignée */\r\n :host ::ng-deep .resize-handle-nw {\r\n top: 0;\r\n left: -6px;\r\n cursor: nw-resize;\r\n }\r\n :host ::ng-deep .resize-handle-n {\r\n top: 0;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n cursor: n-resize;\r\n }\r\n :host ::ng-deep .resize-handle-ne {\r\n top: 0;\r\n right: -6px;\r\n cursor: ne-resize;\r\n }\r\n :host ::ng-deep .resize-handle-w {\r\n top: 50%;\r\n left: -6px;\r\n transform: translateY(-50%);\r\n cursor: w-resize;\r\n }\r\n :host ::ng-deep .resize-handle-e {\r\n top: 50%;\r\n right: -6px;\r\n transform: translateY(-50%);\r\n cursor: e-resize;\r\n }\r\n :host ::ng-deep .resize-handle-sw {\r\n bottom: 0;\r\n left: -6px;\r\n cursor: sw-resize;\r\n }\r\n :host ::ng-deep .resize-handle-s {\r\n bottom: 0;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n cursor: s-resize;\r\n }\r\n :host ::ng-deep .resize-handle-se {\r\n bottom: 0;\r\n right: -6px;\r\n cursor: se-resize;\r\n }\r\n\r\n /* Styles pour le redimensionnement en cours */\r\n :host ::ng-deep body.resizing {\r\n user-select: none;\r\n cursor: crosshair;\r\n }\r\n\r\n :host ::ng-deep body.resizing .ProseMirror {\r\n pointer-events: none;\r\n }\r\n\r\n :host ::ng-deep body.resizing .ProseMirror .tiptap-image {\r\n pointer-events: none;\r\n }\r\n\r\n /* Styles pour les informations de taille d'image */\r\n :host ::ng-deep .image-size-info {\r\n position: absolute;\r\n bottom: -20px;\r\n left: 50%;\r\n transform: translateX(-50%);\r\n background: rgba(0, 0, 0, 0.8);\r\n color: white;\r\n padding: 2px 6px;\r\n border-radius: 3px;\r\n font-size: 11px;\r\n white-space: nowrap;\r\n opacity: 0;\r\n transition: opacity 0.2s ease;\r\n }\r\n\r\n :host ::ng-deep .image-container:hover .image-size-info {\r\n opacity: 1;\r\n }\r\n /* Styles pour les tables */\r\n :host ::ng-deep .ProseMirror table {\r\n border-collapse: separate;\r\n border-spacing: 0;\r\n margin: 0;\r\n table-layout: fixed;\r\n width: 100%;\r\n border-radius: 8px;\r\n overflow: hidden;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table td,\r\n :host ::ng-deep .ProseMirror table th {\r\n border: none;\r\n border-right: 1px solid var(--ate-table-border-color);\r\n border-bottom: 1px solid var(--ate-table-border-color);\r\n box-sizing: border-box;\r\n min-width: 1em;\r\n padding: 8px 12px;\r\n position: relative;\r\n vertical-align: top;\r\n text-align: left;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table td {\r\n background: var(--ate-table-cell-background);\r\n }\r\n\r\n /* Ajouter les bordures externes manquantes pour former la bordure du tableau */\r\n :host ::ng-deep .ProseMirror table td:first-child,\r\n :host ::ng-deep .ProseMirror table th:first-child {\r\n border-left: 1px solid var(--ate-table-border-color);\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:first-child td,\r\n :host ::ng-deep .ProseMirror table tr:first-child th {\r\n border-top: 1px solid var(--ate-table-border-color);\r\n }\r\n\r\n /* Coins arrondis */\r\n :host ::ng-deep .ProseMirror table tr:first-child th:first-child {\r\n border-top-left-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:first-child th:last-child {\r\n border-top-right-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:last-child td:first-child {\r\n border-bottom-left-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table tr:last-child td:last-child {\r\n border-bottom-right-radius: 8px;\r\n }\r\n\r\n /* En-têtes de table */\r\n :host ::ng-deep .ProseMirror table th {\r\n background: var(--ate-table-header-background);\r\n font-weight: 600;\r\n color: var(--ate-table-header-color);\r\n }\r\n\r\n /* Cellules sélectionnées */\r\n :host ::ng-deep .ProseMirror table .selectedCell:after {\r\n background: var(--ate-table-cell-selected-background);\r\n content: \"\";\r\n left: 0;\r\n right: 0;\r\n top: 0;\r\n bottom: 0;\r\n pointer-events: none;\r\n position: absolute;\r\n z-index: 2;\r\n }\r\n\r\n /* Poignées de redimensionnement */\r\n :host ::ng-deep .ProseMirror table .column-resize-handle {\r\n position: absolute;\r\n right: -2px;\r\n top: 0;\r\n bottom: 0;\r\n width: 4px;\r\n background-color: var(--ate-table-resize-handle-color);\r\n opacity: 0;\r\n transition: opacity 0.2s ease;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table:hover .column-resize-handle {\r\n opacity: 1;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror table .column-resize-handle:hover {\r\n background-color: var(--ate-focus-color);\r\n }\r\n\r\n /* Container avec scroll horizontal */\r\n :host ::ng-deep .ProseMirror .tableWrapper {\r\n overflow-x: auto;\r\n margin: 1em 0;\r\n border-radius: 8px;\r\n }\r\n\r\n :host ::ng-deep .ProseMirror .tableWrapper table {\r\n margin: 0;\r\n border-radius: 8px;\r\n min-width: 600px;\r\n overflow: hidden;\r\n }\r\n\r\n /* Paragraphes dans les tables */\r\n :host ::ng-deep .ProseMirror table p {\r\n margin: 0;\r\n }\r\n\r\n /* Styles pour les lignes avec hover */\r\n :host ::ng-deep .ProseMirror table tbody tr:hover td {\r\n background-color: var(--ate-table-row-hover-background);\r\n }\r\n `,\r\n ],\r\n})\r\nexport class AngularTiptapEditorComponent implements AfterViewInit, OnDestroy {\r\n content = input<string>(\"\");\r\n placeholder = input<string>(\"\");\r\n editable = input<boolean>(true);\r\n minHeight = input<number>(200);\r\n height = input<number | undefined>(undefined);\r\n maxHeight = input<number | undefined>(undefined);\r\n fillContainer = input<boolean>(false);\r\n showToolbar = input<boolean>(true);\r\n showCharacterCount = input<boolean>(true);\r\n showWordCount = input<boolean>(true);\r\n maxCharacters = input<number | undefined>(undefined);\r\n enableOfficePaste = input<boolean>(true);\r\n enableSlashCommands = input<boolean>(true);\r\n slashCommands = input<SlashCommandsConfig>({});\r\n customSlashCommands = input<CustomSlashCommands | undefined>(undefined);\r\n locale = input<SupportedLocale | undefined>(undefined);\r\n autofocus = input<boolean | 'start' | 'end' | 'all' | number>(false);\r\n\r\n tiptapExtensions = input<(Extension | Node | Mark)[]>([]);\r\n tiptapOptions = input<Partial<EditorOptions>>({});\r\n\r\n // Nouveaux inputs pour les bubble menus\r\n showBubbleMenu = input<boolean>(true);\r\n bubbleMenu = input<Partial<BubbleMenuConfig>>(DEFAULT_BUBBLE_MENU_CONFIG);\r\n showImageBubbleMenu = input<boolean>(true);\r\n imageBubbleMenu = input<Partial<ImageBubbleMenuConfig>>(\r\n DEFAULT_IMAGE_BUBBLE_MENU_CONFIG\r\n );\r\n\r\n // Nouveau input pour la configuration de la toolbar\r\n toolbar = input<Partial<ToolbarConfig>>({});\r\n\r\n // Nouveau input pour la configuration de l'upload d'images\r\n imageUpload = input<Partial<any>>({});\r\n\r\n /**\r\n * Custom handler for image uploads.\r\n * When provided, images will be processed through this handler instead of being converted to base64.\r\n * This allows you to upload images to your own server/storage and use the returned URL.\r\n *\r\n * @example\r\n * ```typescript\r\n * myUploadHandler: ImageUploadHandler = async (context) => {\r\n * const formData = new FormData();\r\n * formData.append('image', context.file);\r\n * const response = await fetch('/api/upload', { method: 'POST', body: formData });\r\n * const data = await response.json();\r\n * return { src: data.imageUrl };\r\n * };\r\n *\r\n * // In template:\r\n * // <angular-tiptap-editor [imageUploadHandler]=\"myUploadHandler\" />\r\n * ```\r\n */\r\n imageUploadHandler = input<ImageUploadHandler | undefined>(undefined);\r\n\r\n // Nouveaux outputs\r\n contentChange = output<string>();\r\n editorCreated = output<Editor>();\r\n editorUpdate = output<{ editor: Editor; transaction: any }>();\r\n editorFocus = output<{ editor: Editor; event: FocusEvent }>();\r\n editorBlur = output<{ editor: Editor; event: FocusEvent }>();\r\n\r\n // ViewChild avec signal\r\n editorElement = viewChild.required<ElementRef>(\"editorElement\");\r\n\r\n // Signals privés pour l'état interne\r\n private _editor = signal<Editor | null>(null);\r\n private _characterCount = signal<number>(0);\r\n private _wordCount = signal<number>(0);\r\n private _isDragOver = signal<boolean>(false);\r\n private _editorFullyInitialized = signal<boolean>(false);\r\n\r\n // Accès en lecture seule aux signaux\r\n readonly editor = this._editor.asReadonly();\r\n readonly characterCount = this._characterCount.asReadonly();\r\n readonly wordCount = this._wordCount.asReadonly();\r\n readonly isDragOver = this._isDragOver.asReadonly();\r\n readonly editorFullyInitialized = this._editorFullyInitialized.asReadonly();\r\n\r\n // Computed pour les états de l'éditeur\r\n isEditorReady = computed(() => this.editor() !== null);\r\n\r\n // Computed pour la configuration de la toolbar\r\n toolbarConfig = computed(() =>\r\n Object.keys(this.toolbar()).length === 0\r\n ? DEFAULT_TOOLBAR_CONFIG\r\n : this.toolbar()\r\n );\r\n\r\n // Computed pour la configuration du bubble menu\r\n bubbleMenuConfig = computed(() =>\r\n Object.keys(this.bubbleMenu()).length === 0\r\n ? DEFAULT_BUBBLE_MENU_CONFIG\r\n : { ...DEFAULT_BUBBLE_MENU_CONFIG, ...this.bubbleMenu() }\r\n );\r\n\r\n // Computed pour la configuration du bubble menu image\r\n imageBubbleMenuConfig = computed(() =>\r\n Object.keys(this.imageBubbleMenu()).length === 0\r\n ? DEFAULT_IMAGE_BUBBLE_MENU_CONFIG\r\n : { ...DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ...this.imageBubbleMenu() }\r\n );\r\n\r\n // Computed pour la configuration du bubble menu table\r\n tableBubbleMenuConfig = computed(() => ({\r\n addRowBefore: true,\r\n addRowAfter: true,\r\n deleteRow: true,\r\n addColumnBefore: true,\r\n addColumnAfter: true,\r\n deleteColumn: true,\r\n deleteTable: true,\r\n toggleHeaderRow: true,\r\n toggleHeaderColumn: true,\r\n }));\r\n\r\n // Computed pour la configuration du menu de cellules\r\n cellBubbleMenuConfig = computed(() => ({\r\n mergeCells: true,\r\n splitCell: true,\r\n }));\r\n\r\n // Computed pour la configuration de l'upload d'images\r\n imageUploadConfig = computed(() => ({\r\n maxSize: 5,\r\n maxWidth: 1920,\r\n maxHeight: 1080,\r\n allowedTypes: [\"image/jpeg\", \"image/png\", \"image/gif\", \"image/webp\"],\r\n enableDragDrop: true,\r\n showPreview: true,\r\n multiple: false,\r\n compressImages: true,\r\n quality: 0.8,\r\n ...this.imageUpload(),\r\n }));\r\n\r\n // Computed pour la configuration des slash commands\r\n slashCommandsConfigComputed = computed(() => {\r\n const customConfig = this.customSlashCommands();\r\n if (customConfig) {\r\n return customConfig;\r\n }\r\n\r\n // Utilise l'utilitaire filterSlashCommands qui gère maintenant \r\n // les défauts, le filtrage et l'ajout de commandes personnalisées\r\n return {\r\n commands: filterSlashCommands(this.slashCommands(), this.i18nService, this.editorCommandsService, this.imageService, this.imageUploadConfig()),\r\n };\r\n });\r\n\r\n private _destroyRef = inject(DestroyRef);\r\n // NgControl pour gérer les FormControls\r\n private ngControl = inject(NgControl, { self: true, optional: true });\r\n\r\n readonly i18nService = inject(TiptapI18nService);\r\n readonly imageService = inject(ImageService);\r\n readonly editorCommandsService = inject(EditorCommandsService);\r\n\r\n constructor() {\r\n // Effet pour gérer le changement de langue\r\n effect(() => {\r\n const locale = this.locale();\r\n if (locale) {\r\n this.i18nService.setLocale(locale);\r\n }\r\n });\r\n\r\n // Effet pour mettre à jour le contenu de l'éditeur\r\n effect(() => {\r\n const editor = this.editor();\r\n const content = this.content();\r\n const hasFormControl = !!(this.ngControl as any)?.control;\r\n\r\n // Ne pas écraser le contenu si on a un FormControl et que le content est vide\r\n if (editor && content !== undefined && content !== editor.getHTML()) {\r\n if (hasFormControl && !content) {\r\n return;\r\n }\r\n this.setContent(content, false);\r\n }\r\n });\r\n\r\n // Effet pour mettre à jour les propriétés de hauteur\r\n effect(() => {\r\n const minHeight = this.minHeight();\r\n const height = this.height();\r\n const maxHeight = this.maxHeight();\r\n const element = this.editorElement()?.nativeElement;\r\n\r\n // Calculer automatiquement si le scroll est nécessaire\r\n const needsScroll = height !== undefined || maxHeight !== undefined;\r\n\r\n if (element) {\r\n element.style.setProperty(\"--editor-min-height\", `${minHeight}px`);\r\n element.style.setProperty(\r\n \"--editor-height\",\r\n height ? `${height}px` : \"auto\"\r\n );\r\n element.style.setProperty(\r\n \"--editor-max-height\",\r\n maxHeight ? `${maxHeight}px` : \"none\"\r\n );\r\n element.style.setProperty(\r\n \"--editor-overflow\",\r\n needsScroll ? \"auto\" : \"visible\"\r\n );\r\n }\r\n });\r\n\r\n // Effect pour surveiller les changements d'édition\r\n effect(() => {\r\n const currentEditor = this.editor();\r\n const isEditable = this.editable();\r\n\r\n if (currentEditor) {\r\n this.editorCommandsService.setEditable(currentEditor, isEditable);\r\n }\r\n });\r\n\r\n // Effect pour synchroniser le handler d'upload d'images avec le service\r\n effect(() => {\r\n const handler = this.imageUploadHandler();\r\n this.imageService.uploadHandler = handler || null;\r\n });\r\n\r\n // Effect pour la détection du survol des tables\r\n effect(() => {\r\n const currentEditor = this.editor();\r\n if (!currentEditor) return;\r\n\r\n // Table hover detection supprimée car remplacée par le menu bubble\r\n });\r\n\r\n // Effect pour mettre à jour la limite de caractères dynamiquement\r\n effect(() => {\r\n const editor = this.editor();\r\n const limit = this.maxCharacters();\r\n\r\n if (editor && editor.extensionManager) {\r\n const characterCountExtension = editor.extensionManager.extensions.find(\r\n (ext) => ext.name === \"characterCount\"\r\n );\r\n\r\n if (characterCountExtension) {\r\n characterCountExtension.options.limit = limit;\r\n // Force TipTap to recognize the option change if possible\r\n // Some extensions need re-creation, but characterCount plugin \r\n // reads this.options.limit in its filterTransaction.\r\n }\r\n }\r\n });\r\n }\r\n\r\n ngAfterViewInit() {\r\n // La vue est déjà complètement initialisée dans ngAfterViewInit\r\n this.initEditor();\r\n\r\n // S'abonner aux changements du FormControl\r\n this.setupFormControlSubscription();\r\n }\r\n\r\n ngOnDestroy() {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n currentEditor.destroy();\r\n }\r\n this._editorFullyInitialized.set(false);\r\n }\r\n\r\n private initEditor() {\r\n const extensions: (Extension | Node | Mark)[] = [\r\n StarterKit,\r\n TextStyle,\r\n Color.configure({\r\n types: [\"textStyle\"],\r\n }),\r\n Placeholder.configure({\r\n placeholder:\r\n this.placeholder() || this.i18nService.editor().placeholder,\r\n }),\r\n Underline,\r\n Superscript,\r\n Subscript,\r\n TextAlign.configure({\r\n types: [\"heading\", \"paragraph\"],\r\n }),\r\n Link.configure({\r\n openOnClick: false,\r\n HTMLAttributes: {\r\n class: \"tiptap-link\",\r\n },\r\n }),\r\n Highlight.configure({\r\n multicolor: true,\r\n HTMLAttributes: {\r\n class: \"tiptap-highlight\",\r\n },\r\n }),\r\n ResizableImage.configure({\r\n inline: false,\r\n allowBase64: true,\r\n HTMLAttributes: {\r\n class: \"tiptap-image\",\r\n },\r\n }),\r\n UploadProgress.configure({\r\n isUploading: () => this.imageService.isUploading(),\r\n uploadProgress: () => this.imageService.uploadProgress(),\r\n uploadMessage: () => this.imageService.uploadMessage(),\r\n }),\r\n TableExtension,\r\n ];\r\n\r\n // Ajouter l'extension Office Paste si activée\r\n if (this.enableOfficePaste()) {\r\n extensions.push(\r\n OfficePaste.configure({\r\n // Configuration par défaut pour une meilleure compatibilité\r\n transformPastedHTML: true,\r\n transformPastedText: true,\r\n })\r\n );\r\n }\r\n\r\n if (this.showCharacterCount() || this.showWordCount()) {\r\n extensions.push(\r\n CharacterCount.configure({\r\n limit: this.maxCharacters(),\r\n })\r\n );\r\n }\r\n\r\n // Allow addition of custom extensions, but avoid duplicates by filtering by name\r\n const customExtensions = this.tiptapExtensions();\r\n if (customExtensions.length > 0) {\r\n const existingNames = new Set(\r\n extensions\r\n .map((ext) => (ext as any)?.name as string | undefined)\r\n .filter((name): name is string => !!name)\r\n );\r\n\r\n const filteredCustom = customExtensions.filter((ext) => {\r\n const name = (ext as any)?.name as string | undefined;\r\n return !name || !existingNames.has(name);\r\n });\r\n\r\n extensions.push(...filteredCustom);\r\n }\r\n\r\n // Also allow any tiptap user options\r\n const userOptions = this.tiptapOptions();\r\n\r\n const newEditor = new Editor({\r\n ...userOptions,\r\n element: this.editorElement().nativeElement,\r\n extensions,\r\n content: this.content(),\r\n editable: this.editable(),\r\n autofocus: this.autofocus(),\r\n onUpdate: ({ editor, transaction }) => {\r\n const html = editor.getHTML();\r\n this.contentChange.emit(html);\r\n // Mettre à jour le FormControl si il existe (dans le prochain cycle)\r\n if ((this.ngControl as any)?.control) {\r\n setTimeout(() => {\r\n (this.ngControl as any).control.setValue(html, {\r\n emitEvent: false,\r\n });\r\n }, 0);\r\n }\r\n this.editorUpdate.emit({ editor, transaction });\r\n this.updateCharacterCount(editor);\r\n },\r\n onCreate: ({ editor }) => {\r\n this.editorCreated.emit(editor);\r\n this.updateCharacterCount(editor);\r\n\r\n // Marquer l'éditeur comme complètement initialisé après un court délai\r\n // pour s'assurer que tous les plugins et extensions sont prêts\r\n setTimeout(() => {\r\n this._editorFullyInitialized.set(true);\r\n }, 100);\r\n },\r\n onFocus: ({ editor, event }) => {\r\n this.editorFocus.emit({ editor, event });\r\n },\r\n onBlur: ({ editor, event }) => {\r\n // Marquer le FormControl comme touché si il existe\r\n if ((this.ngControl as any)?.control) {\r\n (this.ngControl as any).control.markAsTouched();\r\n }\r\n this.editorBlur.emit({ editor, event });\r\n },\r\n });\r\n\r\n // Stocker la référence de l'éditeur immédiatement\r\n this._editor.set(newEditor);\r\n }\r\n\r\n private updateCharacterCount(editor: Editor) {\r\n if ((this.showCharacterCount() || this.showWordCount()) && editor.storage[\"characterCount\"]) {\r\n const storage = editor.storage[\"characterCount\"];\r\n this._characterCount.set(storage.characters());\r\n this._wordCount.set(storage.words());\r\n }\r\n }\r\n\r\n // Gestion de l'upload d'image depuis les slash commands\r\n async onSlashCommandImageUpload(file: File) {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n try {\r\n await this.imageService.uploadAndInsertImage(currentEditor, file);\r\n } catch (error) {\r\n // Gérer l'erreur silencieusement ou afficher une notification\r\n }\r\n }\r\n }\r\n\r\n onDragOver(event: DragEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this._isDragOver.set(true);\r\n }\r\n\r\n onDrop(event: DragEvent) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n this._isDragOver.set(false);\r\n\r\n const files = event.dataTransfer?.files;\r\n if (files && files.length > 0) {\r\n const file = files[0];\r\n if (file.type.startsWith(\"image/\")) {\r\n this.insertImageFromFile(file);\r\n }\r\n }\r\n }\r\n\r\n private async insertImageFromFile(file: File) {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n try {\r\n const config = this.imageUploadConfig();\r\n await this.imageService.uploadAndInsertImage(currentEditor, file, {\r\n quality: config.quality,\r\n maxWidth: config.maxWidth,\r\n maxHeight: config.maxHeight\r\n });\r\n } catch (error) {\r\n // Gérer l'erreur silencieusement ou afficher une notification\r\n }\r\n }\r\n }\r\n\r\n // Public methods\r\n getHTML(): string {\r\n return this.editor()?.getHTML() || \"\";\r\n }\r\n\r\n getJSON(): any {\r\n return this.editor()?.getJSON();\r\n }\r\n\r\n getText(): string {\r\n return this.editor()?.getText() || \"\";\r\n }\r\n\r\n setContent(content: string, emitUpdate = true) {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.setContent(editor, content, emitUpdate);\r\n }\r\n }\r\n\r\n focus() {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.focus(editor);\r\n }\r\n }\r\n\r\n blur() {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.blur(editor);\r\n }\r\n }\r\n\r\n clearContent() {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.editorCommandsService.clearContent(editor);\r\n }\r\n }\r\n\r\n // Méthode publique pour obtenir l'éditeur\r\n getEditor(): Editor | null {\r\n return this.editor();\r\n }\r\n\r\n private setupFormControlSubscription(): void {\r\n const control = (this.ngControl as any)?.control;\r\n if (control) {\r\n const formValue$ = concat(\r\n defer(() => of(control.value)),\r\n control.valueChanges\r\n );\r\n\r\n formValue$\r\n .pipe(\r\n tap((value: any) => {\r\n const editor = this.editor();\r\n if (editor) {\r\n this.setContent(value, false);\r\n }\r\n }),\r\n takeUntilDestroyed(this._destroyRef)\r\n )\r\n .subscribe();\r\n }\r\n }\r\n\r\n // Méthode pour gérer l'état disabled\r\n setDisabledState(isDisabled: boolean): void {\r\n const currentEditor = this.editor();\r\n if (currentEditor) {\r\n this.editorCommandsService.setEditable(currentEditor, !isDisabled);\r\n }\r\n }\r\n\r\n onEditorClick(event: MouseEvent) {\r\n const editor = this.editor();\r\n if (!editor) return;\r\n\r\n // Vérifier si on clique sur l'élément conteneur et non sur le contenu\r\n const target = event.target as HTMLElement;\r\n const editorElement = this.editorElement()?.nativeElement;\r\n\r\n if (\r\n target === editorElement ||\r\n target.classList.contains(\"tiptap-content\")\r\n ) {\r\n // On clique dans l'espace vide, positionner le curseur à la fin\r\n setTimeout(() => {\r\n const { doc } = editor.state;\r\n const endPos = doc.content.size;\r\n editor.commands.setTextSelection(endPos);\r\n editor.commands.focus();\r\n }, 0);\r\n }\r\n }\r\n\r\n // Méthodes pour le bouton d'édition de table - Supprimées car remplacées par le menu bubble\r\n}\r\n","/*\r\n * Public API Surface of tiptap-editor\r\n */\r\n\r\n// Main component - only public component\r\nexport * from \"./lib/tiptap-editor.component\";\r\n\r\n// Host directive for FormControl integration\r\nexport * from \"./lib/noop-value-accessor.directive\";\r\n\r\n// Internationalization service\r\nexport * from \"./lib/services/i18n.service\";\r\n\r\n// Editor commands service\r\nexport * from \"./lib/services/editor-commands.service\";\r\n\r\n// Image service\r\nexport * from \"./lib/services/image.service\";\r\n\r\n// Types and interfaces for configuration\r\nexport type { ToolbarConfig } from \"./lib/tiptap-toolbar.component\";\r\nexport type {\r\n BubbleMenuConfig,\r\n ImageBubbleMenuConfig,\r\n TableBubbleMenuConfig,\r\n CellBubbleMenuConfig,\r\n} from \"./lib/models/bubble-menu.model\";\r\nexport type {\r\n CustomSlashCommands,\r\n SlashCommandItem,\r\n} from \"./lib/tiptap-slash-commands.component\";\r\n// Default configurations\r\nexport { DEFAULT_TOOLBAR_CONFIG } from \"./lib/tiptap-editor.component\";\r\nexport { DEFAULT_BUBBLE_MENU_CONFIG } from \"./lib/tiptap-editor.component\";\r\nexport { DEFAULT_IMAGE_BUBBLE_MENU_CONFIG } from \"./lib/tiptap-editor.component\";\r\nexport { DEFAULT_TABLE_MENU_CONFIG } from \"./lib/tiptap-editor.component\";\r\n\r\n// Utility functions to create and filter internationalized slash commands\r\nexport {\r\n createDefaultSlashCommands,\r\n filterSlashCommands,\r\n SLASH_COMMAND_KEYS,\r\n DEFAULT_SLASH_COMMANDS_CONFIG,\r\n} from \"./lib/config/slash-commands.config\";\r\nexport type {\r\n SlashCommandKey,\r\n SlashCommandsConfig,\r\n} from \"./lib/config/slash-commands.config\";\r\n\r\n// Types for height configuration\r\nexport type HeightConfig = {\r\n minHeight?: number;\r\n height?: number;\r\n maxHeight?: number;\r\n};\r\n\r\n// Supported locales type\r\nexport type { SupportedLocale } from \"./lib/services/i18n.service\";\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.EditorCommandsService","Plugin","PluginKey","i1.NoopValueAccessorDirective"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BO,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,CAAwB;AAC/D,IAAA,IAAI,EAAE,gBAAgB;IAEtB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,WAAW,EAAE,KAAK;AAClB,YAAA,cAAc,EAAE,EAAE;SACnB;KACF;IAED,MAAM,GAAA;AACJ,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM;KAC3B;IAED,KAAK,GAAA;AACH,QAAA,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,QAAQ,GAAG,OAAO;KAChD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