@richscripts/richtexteditor 2.14.1 → 2.15.0

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.
Files changed (237) hide show
  1. package/README.md +173 -10
  2. package/angular/build-manifest.json +23 -0
  3. package/angular/index.d.ts +71 -76
  4. package/angular/index.mjs +2 -0
  5. package/angular/package.json +4 -0
  6. package/headless/index.d.ts +3 -1
  7. package/headless/index.js +72 -16
  8. package/index.d.ts +33 -54
  9. package/integrations/initialization-scope.js +27 -0
  10. package/integrations/native-mount.js +30 -0
  11. package/integrations/shared.d.ts +23 -1
  12. package/integrations/shared.js +58 -22
  13. package/package.json +25 -3
  14. package/react/index.js +118 -37
  15. package/react/index.mjs +29 -0
  16. package/richtexteditor/all_plugins.js +7001 -1078
  17. package/richtexteditor/all_plugins.min.js +62 -59
  18. package/richtexteditor/lang/emoji/LICENSE-CLDR.txt +41 -0
  19. package/richtexteditor/lang/emoji/rte-emoji-de.js +3 -0
  20. package/richtexteditor/lang/emoji/rte-emoji-es.js +3 -0
  21. package/richtexteditor/lang/emoji/rte-emoji-fr.js +3 -0
  22. package/richtexteditor/lang/emoji/rte-emoji-it.js +3 -0
  23. package/richtexteditor/lang/emoji/rte-emoji-ja.js +3 -0
  24. package/richtexteditor/lang/emoji/rte-emoji-ko.js +3 -0
  25. package/richtexteditor/lang/emoji/rte-emoji-nl.js +3 -0
  26. package/richtexteditor/lang/emoji/rte-emoji-pt-pt.js +3 -0
  27. package/richtexteditor/lang/emoji/rte-emoji-pt.js +3 -0
  28. package/richtexteditor/lang/emoji/rte-emoji-ru.js +3 -0
  29. package/richtexteditor/lang/emoji/rte-emoji-zh-Hans.js +3 -0
  30. package/richtexteditor/lang/emoji/rte-emoji-zh-Hant.js +3 -0
  31. package/richtexteditor/lang/rte-lang-af.js +1 -0
  32. package/richtexteditor/lang/rte-lang-ar.js +1 -0
  33. package/richtexteditor/lang/rte-lang-bg.js +1 -0
  34. package/richtexteditor/lang/rte-lang-bn.js +1 -0
  35. package/richtexteditor/lang/rte-lang-bs.js +1 -0
  36. package/richtexteditor/lang/rte-lang-ca.js +1 -0
  37. package/richtexteditor/lang/rte-lang-cs.js +1 -0
  38. package/richtexteditor/lang/rte-lang-cy.js +1 -0
  39. package/richtexteditor/lang/rte-lang-da.js +1 -0
  40. package/richtexteditor/lang/rte-lang-de.js +1017 -2
  41. package/richtexteditor/lang/rte-lang-el.js +1 -0
  42. package/richtexteditor/lang/rte-lang-en.js +1 -0
  43. package/richtexteditor/lang/rte-lang-es.js +1023 -2
  44. package/richtexteditor/lang/rte-lang-et.js +1 -0
  45. package/richtexteditor/lang/rte-lang-fa.js +1 -0
  46. package/richtexteditor/lang/rte-lang-fi.js +1 -0
  47. package/richtexteditor/lang/rte-lang-fil.js +1 -0
  48. package/richtexteditor/lang/rte-lang-fj.js +1 -0
  49. package/richtexteditor/lang/rte-lang-fr.js +1023 -2
  50. package/richtexteditor/lang/rte-lang-ga.js +1 -0
  51. package/richtexteditor/lang/rte-lang-gu.js +1 -0
  52. package/richtexteditor/lang/rte-lang-he.js +1 -0
  53. package/richtexteditor/lang/rte-lang-hi.js +1 -0
  54. package/richtexteditor/lang/rte-lang-hr.js +1 -0
  55. package/richtexteditor/lang/rte-lang-ht.js +1 -0
  56. package/richtexteditor/lang/rte-lang-hu.js +1 -0
  57. package/richtexteditor/lang/rte-lang-id.js +1 -0
  58. package/richtexteditor/lang/rte-lang-is.js +1 -0
  59. package/richtexteditor/lang/rte-lang-it.js +1023 -2
  60. package/richtexteditor/lang/rte-lang-ja.js +1023 -2
  61. package/richtexteditor/lang/rte-lang-kn.js +1 -0
  62. package/richtexteditor/lang/rte-lang-ko.js +1023 -2
  63. package/richtexteditor/lang/rte-lang-lt.js +1 -0
  64. package/richtexteditor/lang/rte-lang-lv.js +1 -0
  65. package/richtexteditor/lang/rte-lang-mg.js +1 -0
  66. package/richtexteditor/lang/rte-lang-mi.js +1 -0
  67. package/richtexteditor/lang/rte-lang-ml.js +1 -0
  68. package/richtexteditor/lang/rte-lang-mr.js +1 -0
  69. package/richtexteditor/lang/rte-lang-ms.js +1 -0
  70. package/richtexteditor/lang/rte-lang-mt.js +1 -0
  71. package/richtexteditor/lang/rte-lang-mww.js +1 -0
  72. package/richtexteditor/lang/rte-lang-nb.js +1 -0
  73. package/richtexteditor/lang/rte-lang-nl.js +1023 -2
  74. package/richtexteditor/lang/rte-lang-otq.js +1 -0
  75. package/richtexteditor/lang/rte-lang-pa.js +1 -0
  76. package/richtexteditor/lang/rte-lang-pl.js +1 -0
  77. package/richtexteditor/lang/rte-lang-pt-pt.js +1023 -2
  78. package/richtexteditor/lang/rte-lang-pt.js +1023 -2
  79. package/richtexteditor/lang/rte-lang-ro.js +1 -0
  80. package/richtexteditor/lang/rte-lang-ru.js +1023 -2
  81. package/richtexteditor/lang/rte-lang-sk.js +1 -0
  82. package/richtexteditor/lang/rte-lang-sl.js +1 -0
  83. package/richtexteditor/lang/rte-lang-sm.js +1 -0
  84. package/richtexteditor/lang/rte-lang-sr-Cyrl.js +1 -0
  85. package/richtexteditor/lang/rte-lang-sr-Latn.js +1 -0
  86. package/richtexteditor/lang/rte-lang-sv.js +1 -0
  87. package/richtexteditor/lang/rte-lang-sw.js +1 -0
  88. package/richtexteditor/lang/rte-lang-ta.js +1 -0
  89. package/richtexteditor/lang/rte-lang-te.js +1 -0
  90. package/richtexteditor/lang/rte-lang-th.js +1 -0
  91. package/richtexteditor/lang/rte-lang-tlh-Latn.js +1 -0
  92. package/richtexteditor/lang/rte-lang-tlh-Piqd.js +1 -0
  93. package/richtexteditor/lang/rte-lang-to.js +1 -0
  94. package/richtexteditor/lang/rte-lang-tr.js +1 -0
  95. package/richtexteditor/lang/rte-lang-ty.js +1 -0
  96. package/richtexteditor/lang/rte-lang-uk.js +1 -0
  97. package/richtexteditor/lang/rte-lang-ur.js +1 -0
  98. package/richtexteditor/lang/rte-lang-vi.js +1 -0
  99. package/richtexteditor/lang/rte-lang-yua.js +1 -0
  100. package/richtexteditor/lang/rte-lang-zh-Hans.js +1017 -2
  101. package/richtexteditor/lang/rte-lang-zh-Hant.js +1017 -2
  102. package/richtexteditor/plugins/a11yenhance.js +2 -1
  103. package/richtexteditor/plugins/a11yenhance.min.js +1 -1
  104. package/richtexteditor/plugins/accessibilitychecker.js +252 -60
  105. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
  106. package/richtexteditor/plugins/aitoolkit.js +966 -303
  107. package/richtexteditor/plugins/aitoolkit.min.js +7 -7
  108. package/richtexteditor/plugins/all_plugins.js +7001 -1078
  109. package/richtexteditor/plugins/all_plugins.min.js +62 -59
  110. package/richtexteditor/plugins/autocorrect.js +66 -31
  111. package/richtexteditor/plugins/autocorrect.min.js +1 -1
  112. package/richtexteditor/plugins/autoembed.js +17 -0
  113. package/richtexteditor/plugins/autoembed.min.js +1 -1
  114. package/richtexteditor/plugins/blocktypes.js +18 -9
  115. package/richtexteditor/plugins/blocktypes.min.js +1 -1
  116. package/richtexteditor/plugins/bookmarkcard.js +12 -5
  117. package/richtexteditor/plugins/bookmarkcard.min.js +2 -2
  118. package/richtexteditor/plugins/changecase.js +72 -19
  119. package/richtexteditor/plugins/changecase.min.js +1 -1
  120. package/richtexteditor/plugins/charlimit.js +62 -2
  121. package/richtexteditor/plugins/charlimit.min.js +2 -2
  122. package/richtexteditor/plugins/comments.js +458 -59
  123. package/richtexteditor/plugins/comments.min.js +4 -3
  124. package/richtexteditor/plugins/contentminimap.js +25 -6
  125. package/richtexteditor/plugins/contentminimap.min.js +1 -1
  126. package/richtexteditor/plugins/crossreference.js +1 -1
  127. package/richtexteditor/plugins/crossreference.min.js +1 -1
  128. package/richtexteditor/plugins/dialoga11y.js +26 -4
  129. package/richtexteditor/plugins/dialoga11y.min.js +1 -1
  130. package/richtexteditor/plugins/dictation.js +1 -1
  131. package/richtexteditor/plugins/documentimport.js +220 -51
  132. package/richtexteditor/plugins/documentimport.min.js +4 -4
  133. package/richtexteditor/plugins/documentoutline.js +47 -8
  134. package/richtexteditor/plugins/documentoutline.min.js +1 -1
  135. package/richtexteditor/plugins/docxexport.js +204 -32
  136. package/richtexteditor/plugins/docxexport.min.js +2 -2
  137. package/richtexteditor/plugins/draghandle.js +267 -3
  138. package/richtexteditor/plugins/draghandle.min.js +1 -1
  139. package/richtexteditor/plugins/emailtoolkit.js +28 -14
  140. package/richtexteditor/plugins/emailtoolkit.min.js +1 -1
  141. package/richtexteditor/plugins/emojiautocomplete.js +110 -56
  142. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
  143. package/richtexteditor/plugins/footnotes.js +65 -11
  144. package/richtexteditor/plugins/footnotes.min.js +1 -1
  145. package/richtexteditor/plugins/formatpainter.js +10 -0
  146. package/richtexteditor/plugins/formatpainter.min.js +1 -1
  147. package/richtexteditor/plugins/formattingmarks.js +6 -6
  148. package/richtexteditor/plugins/formattingmarks.min.js +1 -1
  149. package/richtexteditor/plugins/gapcursor.js +60 -0
  150. package/richtexteditor/plugins/gapcursor.min.js +1 -1
  151. package/richtexteditor/plugins/ghostcomplete.js +1 -1
  152. package/richtexteditor/plugins/html2pdf.js +1 -1
  153. package/richtexteditor/plugins/html2pdf.min.js +1 -1
  154. package/richtexteditor/plugins/imageeditor.js +12 -6
  155. package/richtexteditor/plugins/imageeditor.min.js +1 -1
  156. package/richtexteditor/plugins/importstyles.js +1 -1
  157. package/richtexteditor/plugins/inlinecode.js +25 -0
  158. package/richtexteditor/plugins/inlinecode.min.js +1 -1
  159. package/richtexteditor/plugins/insertcode.js +21 -3
  160. package/richtexteditor/plugins/insertcode.min.js +4 -4
  161. package/richtexteditor/plugins/insertemoji.js +112 -15
  162. package/richtexteditor/plugins/insertemoji.min.js +1 -1
  163. package/richtexteditor/plugins/insertgallery.js +42 -36
  164. package/richtexteditor/plugins/insertgallery.min.js +1 -1
  165. package/richtexteditor/plugins/inserttemplate.js +33 -17
  166. package/richtexteditor/plugins/inserttemplate.min.js +1 -1
  167. package/richtexteditor/plugins/keyboarda11y.js +66 -3
  168. package/richtexteditor/plugins/keyboarda11y.min.js +1 -1
  169. package/richtexteditor/plugins/layouttable.js +20 -0
  170. package/richtexteditor/plugins/layouttable.min.js +1 -1
  171. package/richtexteditor/plugins/linkchecker.js +29 -9
  172. package/richtexteditor/plugins/linkchecker.min.js +1 -1
  173. package/richtexteditor/plugins/localdraft.js +51 -7
  174. package/richtexteditor/plugins/localdraft.min.js +1 -1
  175. package/richtexteditor/plugins/markdownexport.js +159 -0
  176. package/richtexteditor/plugins/markdownexport.min.js +2 -2
  177. package/richtexteditor/plugins/mathdialog.js +11 -5
  178. package/richtexteditor/plugins/mathdialog.min.js +1 -1
  179. package/richtexteditor/plugins/mentionplugin.js +88 -25
  180. package/richtexteditor/plugins/mentionplugin.min.js +1 -1
  181. package/richtexteditor/plugins/mermaiddiagram.js +9 -3
  182. package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
  183. package/richtexteditor/plugins/multilevellist.js +4 -0
  184. package/richtexteditor/plugins/multilevellist.min.js +1 -1
  185. package/richtexteditor/plugins/pdfexport.js +235 -35
  186. package/richtexteditor/plugins/pdfexport.min.js +12 -12
  187. package/richtexteditor/plugins/permanentpen.js +3 -3
  188. package/richtexteditor/plugins/permanentpen.min.js +1 -1
  189. package/richtexteditor/plugins/readabilitystats.js +25 -11
  190. package/richtexteditor/plugins/readabilitystats.min.js +1 -1
  191. package/richtexteditor/plugins/readaloud.js +29 -15
  192. package/richtexteditor/plugins/readaloud.min.js +1 -1
  193. package/richtexteditor/plugins/restrictedediting.js +166 -0
  194. package/richtexteditor/plugins/restrictedediting.min.js +2 -2
  195. package/richtexteditor/plugins/revisionhistory.js +169 -37
  196. package/richtexteditor/plugins/revisionhistory.min.js +3 -3
  197. package/richtexteditor/plugins/rubyannotation.js +19 -9
  198. package/richtexteditor/plugins/rubyannotation.min.js +1 -1
  199. package/richtexteditor/plugins/sanitizer.js +62 -3
  200. package/richtexteditor/plugins/sanitizer.min.js +1 -1
  201. package/richtexteditor/plugins/slashcommand.js +30 -16
  202. package/richtexteditor/plugins/slashcommand.min.js +2 -2
  203. package/richtexteditor/plugins/smartchips.js +36 -22
  204. package/richtexteditor/plugins/smartchips.min.js +2 -2
  205. package/richtexteditor/plugins/spellcheck.js +17 -8
  206. package/richtexteditor/plugins/spellcheck.min.js +2 -2
  207. package/richtexteditor/plugins/stateinspector.js +19 -9
  208. package/richtexteditor/plugins/stateinspector.min.js +2 -2
  209. package/richtexteditor/plugins/structured-content-bridge.js +56 -24
  210. package/richtexteditor/plugins/structured-content-bridge.min.js +7 -7
  211. package/richtexteditor/plugins/tableofcontents.js +5 -2
  212. package/richtexteditor/plugins/tableofcontents.min.js +1 -1
  213. package/richtexteditor/plugins/tabletools.js +388 -3
  214. package/richtexteditor/plugins/tabletools.min.js +1 -1
  215. package/richtexteditor/plugins/textdirection.js +18 -5
  216. package/richtexteditor/plugins/textdirection.min.js +1 -1
  217. package/richtexteditor/plugins/textpartlanguage.js +161 -32
  218. package/richtexteditor/plugins/textpartlanguage.min.js +1 -1
  219. package/richtexteditor/plugins/todolist.js +90 -6
  220. package/richtexteditor/plugins/todolist.min.js +1 -1
  221. package/richtexteditor/plugins/trackedchanges.js +1812 -25
  222. package/richtexteditor/plugins/trackedchanges.min.js +5 -3
  223. package/richtexteditor/plugins/wordexport.js +2 -2
  224. package/richtexteditor/plugins/yjscollab.js +9 -4
  225. package/richtexteditor/plugins/yjscollab.min.js +1 -1
  226. package/richtexteditor/plugins/zz_richtextbox_dialog_style.js +22 -13
  227. package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -1
  228. package/richtexteditor/rte-config.js +130 -50
  229. package/richtexteditor/rte-headless.js +19 -4
  230. package/richtexteditor/rte-webcomponent.js +89 -16
  231. package/richtexteditor/rte.js +132 -52
  232. package/scripts/build-angular.mjs +97 -0
  233. package/svelte/index.d.ts +2 -1
  234. package/svelte/index.js +80 -9
  235. package/vue/index.js +130 -34
  236. package/angular/component.ts +0 -297
  237. package/angular/index.ts +0 -24
@@ -11,6 +11,6 @@ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin
11
11
  dateFormat YYYY-MM-DD
12
12
  section Phase 1
13
13
  Spec :a1, 2026-01-01, 20d
14
- Build :after a1, 30d`];var RTE_MermaidSeq=0;function RTE_Plugin_MermaidDiagram(){var s=this,f,n;s.PluginName="MermaidDiagram",s.InitConfig=function(e){f=e},s.InitEditor=function(e){n=e,n.renderDiagrams=function(){return s.RenderAll()},n.attachEvent("exec_command_insertdiagram",function(r){r.returnValue=!0,s.OpenDiagramDialog()});try{var t=n.getEditable();t&&t.addEventListener("dblclick",function(r){var a=x(r.target,t);a&&(r.preventDefault(),s.OpenDiagramDialog(a))}),t&&t.addEventListener("click",function(r){for(var a=r.target;a&&a!==t;){if(a.nodeType===1&&a.getAttribute&&a.getAttribute("data-rte-mermaid-remove")==="1"){var i=x(a,t);i&&(r.preventDefault(),r.stopPropagation(),S(i));return}a=a.parentNode}},!0),t&&t.addEventListener("keydown",function(r){if(!(r.key!=="Delete"&&r.key!=="Backspace")){var a=E();a&&(r.preventDefault(),S(a))}},!0)}catch{}};function u(e,t,r,a){var i=e.ownerDocument.createElement(t);return r&&(i.style.cssText=r),a&&(i.className=a),e.appendChild(i),i}function T(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function C(e){return String(e).replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function M(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function x(e,t){for(;e&&e!==t;){if(e.nodeType===1&&e.classList&&e.classList.contains("rte-mermaid"))return e;e=e.parentNode}return null}function E(){try{var e=n.getSelection();return!e||e.rangeCount===0?null:x(e.getRangeAt(0).startContainer,n.getEditable())}catch{return null}}function S(e){if(!(!e||!e.parentNode)){e.parentNode.removeChild(e);try{typeof n.fireChange=="function"&&n.fireChange()}catch{}try{n.focus()}catch{}}}function R(e){if(!(!e||e.getElementById("rte-mermaid-styles"))){var t=".rte-mermaid{position:relative;display:block;margin:12px 0;padding:12px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;text-align:center;overflow:auto;}.rte-mermaid-remove{position:absolute;top:7px;right:7px;width:24px;height:24px;border:1px solid rgba(15,23,42,.14);border-radius:999px;background:rgba(255,255,255,.96);color:#334155;font:700 13px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;box-shadow:0 4px 12px rgba(15,23,42,.12);opacity:0;cursor:pointer;transition:opacity 120ms,border-color 120ms,color 120ms;}.rte-mermaid:hover .rte-mermaid-remove,.rte-mermaid-remove:focus{opacity:1;}.rte-mermaid-remove:hover{border-color:rgba(220,38,38,.38);color:#b91c1c;}.rte-mermaid svg{max-width:100%;height:auto;}.rte-mermaid .rte-mermaid-src{display:block;text-align:left;white-space:pre;overflow:auto;font:12px ui-monospace,Consolas,monospace;color:#334155;background:#f8fafc;border-radius:6px;padding:10px;margin:0;}.rte-mermaid .rte-mermaid-err{color:#b91c1c;font:12px ui-monospace,monospace;text-align:left;}",r=e.createElement("style");r.id="rte-mermaid-styles",r.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(r),n&&typeof n.ensureStyleSheetLive=="function"&&n.ensureStyleSheetLive(e,r,"rte-mermaid-styles",r.textContent)}}function L(e){try{return e.mermaid||e.parent&&e.parent.mermaid||null}catch{return null}}function B(e,t,r){return new Promise(function(a,i){try{var d=e.render(t,r);d&&typeof d.then=="function"?d.then(function(l){a(l&&l.svg?l.svg:l)},i):typeof d=="string"?a(d):i(new Error("Unsupported Mermaid API"))}catch(l){i(l)}})}function v(e,t){var r=e.ownerDocument,a=r.defaultView||window;function i(o){e.innerHTML="";var c=r.createElement("pre");if(c.className="rte-mermaid-src",c.textContent=t,e.appendChild(c),o){var g=r.createElement("div");g.className="rte-mermaid-err",g.textContent=o,e.appendChild(g)}}if(typeof f.diagramResolver=="function")return Promise.resolve().then(function(){return f.diagramResolver(t)}).then(function(o){if(o&&o.svg)e.innerHTML=o.svg;else if(o&&o.imageUrl){e.innerHTML="";var c=r.createElement("img");c.src=o.imageUrl,c.alt="diagram",c.style.maxWidth="100%",e.appendChild(c)}else i("")}).catch(function(o){i(o&&o.message?o.message:"resolver error")});var d=L(a);if(d&&typeof d.render=="function"){var l="rtemmd"+ ++RTE_MermaidSeq;return B(d,l,t).then(function(o){e.innerHTML=o}).catch(function(o){i(o&&o.message?o.message:"render error")})}return i(""),Promise.resolve()}s.RenderAll=function(){var e=n.getEditable();if(!e)return 0;R(n.getDocument());for(var t=e.querySelectorAll(".rte-mermaid[data-diagram]"),r=0;r<t.length;r++){var a=t[r],i=a.querySelector(".rte-mermaid-render");i||(i=a.ownerDocument.createElement("div"),i.className="rte-mermaid-render",a.appendChild(i)),v(i,C(a.getAttribute("data-diagram")||""))}return t.length};function N(e,t){var r=T(e);return'<div class="rte-mermaid" data-rte-diagram="1" data-diagram="'+r+'" contenteditable="false"'+(t?' id="'+t+'"':"")+'><button type="button" class="rte-mermaid-remove" data-rte-mermaid-remove="1" aria-label="Remove diagram" title="Remove diagram">x</button><div class="rte-mermaid-render"><pre class="rte-mermaid-src">'+M(e)+"</pre></div></div>"}s.OpenDiagramDialog=function(e){e||(e=E());var t=e?C(e.getAttribute("data-diagram")||""):"",r=n.createDialog(n.getLangText&&n.getLangText("insertdiagramtitle")||"Insert / edit diagram","rte-dialog-diagram"),a=typeof r.close=="function"?function(){r.close()}:function(){n.closeCurrentPopup()},i=r.ownerDocument.defaultView||window,d=u(r,"div","padding:14px;min-width:480px;font:13px -apple-system,Segoe UI,sans-serif");u(d,"div","font-weight:600;margin-bottom:4px").innerText=n.getLangText&&n.getLangText("insertdiagramlabel")||"Mermaid";var l=u(d,"textarea","width:100%;box-sizing:border-box;min-height:120px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:12px ui-monospace,Consolas,monospace;resize:vertical");l.value=t,l.placeholder=`graph TD
14
+ Build :after a1, 30d`];var RTE_MermaidSeq=0;function RTE_Plugin_MermaidDiagram(){var s=this,f,n;s.PluginName="MermaidDiagram";function v(e,t,r){var a=f&&f["text_"+e]||t;return r===void 0?a:a.split("{0}").join(String(r))}s.InitConfig=function(e){f=e},s.InitEditor=function(e){n=e,n.renderDiagrams=function(){return s.RenderAll()},n.attachEvent("exec_command_insertdiagram",function(r){r.returnValue=!0,s.OpenDiagramDialog()});try{var t=n.getEditable();t&&t.addEventListener("dblclick",function(r){var a=b(r.target,t);a&&(r.preventDefault(),s.OpenDiagramDialog(a))}),t&&t.addEventListener("click",function(r){for(var a=r.target;a&&a!==t;){if(a.nodeType===1&&a.getAttribute&&a.getAttribute("data-rte-mermaid-remove")==="1"){var i=b(a,t);i&&(r.preventDefault(),r.stopPropagation(),R(i));return}a=a.parentNode}},!0),t&&t.addEventListener("keydown",function(r){if(!(r.key!=="Delete"&&r.key!=="Backspace")){var a=S();a&&(r.preventDefault(),R(a))}},!0)}catch{}};function u(e,t,r,a){var i=e.ownerDocument.createElement(t);return r&&(i.style.cssText=r),a&&(i.className=a),e.appendChild(i),i}function C(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function E(e){return String(e).replace(/&quot;/g,'"').replace(/&gt;/g,">").replace(/&lt;/g,"<").replace(/&amp;/g,"&")}function B(e){return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function b(e,t){for(;e&&e!==t;){if(e.nodeType===1&&e.classList&&e.classList.contains("rte-mermaid"))return e;e=e.parentNode}return null}function S(){try{var e=n.getSelection();return!e||e.rangeCount===0?null:b(e.getRangeAt(0).startContainer,n.getEditable())}catch{return null}}function R(e){if(!(!e||!e.parentNode)){e.parentNode.removeChild(e);try{typeof n.fireChange=="function"&&n.fireChange()}catch{}try{n.focus()}catch{}}}function L(e){if(!(!e||e.getElementById("rte-mermaid-styles"))){var t=".rte-mermaid{position:relative;display:block;margin:12px 0;padding:12px;border:1px solid #e2e8f0;border-radius:10px;background:#fff;text-align:center;overflow:auto;}.rte-mermaid-remove{position:absolute;top:7px;right:7px;width:24px;height:24px;border:1px solid rgba(15,23,42,.14);border-radius:999px;background:rgba(255,255,255,.96);color:#334155;font:700 13px/1 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;box-shadow:0 4px 12px rgba(15,23,42,.12);opacity:0;cursor:pointer;transition:opacity 120ms,border-color 120ms,color 120ms;}.rte-mermaid:hover .rte-mermaid-remove,.rte-mermaid-remove:focus{opacity:1;}.rte-mermaid-remove:hover{border-color:rgba(220,38,38,.38);color:#b91c1c;}.rte-mermaid svg{max-width:100%;height:auto;}.rte-mermaid .rte-mermaid-src{display:block;text-align:left;white-space:pre;overflow:auto;font:12px ui-monospace,Consolas,monospace;color:#334155;background:#f8fafc;border-radius:6px;padding:10px;margin:0;}.rte-mermaid .rte-mermaid-err{color:#b91c1c;font:12px ui-monospace,monospace;text-align:left;}",r=e.createElement("style");r.id="rte-mermaid-styles",r.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(r),n&&typeof n.ensureStyleSheetLive=="function"&&n.ensureStyleSheetLive(e,r,"rte-mermaid-styles",r.textContent)}}function k(e){try{return e.mermaid||e.parent&&e.parent.mermaid||null}catch{return null}}function _(e,t,r){return new Promise(function(a,i){try{var d=e.render(t,r);d&&typeof d.then=="function"?d.then(function(l){a(l&&l.svg?l.svg:l)},i):typeof d=="string"?a(d):i(new Error("Unsupported Mermaid API"))}catch(l){i(l)}})}function x(e,t){var r=e.ownerDocument,a=r.defaultView||window;function i(o){e.innerHTML="";var c=r.createElement("pre");if(c.className="rte-mermaid-src",c.textContent=t,e.appendChild(c),o){var g=r.createElement("div");g.className="rte-mermaid-err",g.textContent=o,e.appendChild(g)}}if(typeof f.diagramResolver=="function")return Promise.resolve().then(function(){return f.diagramResolver(t)}).then(function(o){if(o&&o.svg)e.innerHTML=o.svg;else if(o&&o.imageUrl){e.innerHTML="";var c=r.createElement("img");c.src=o.imageUrl,c.alt="diagram",c.style.maxWidth="100%",e.appendChild(c)}else i("")}).catch(function(o){i(o&&o.message?o.message:"resolver error")});var d=k(a);if(d&&typeof d.render=="function"){var l="rtemmd"+ ++RTE_MermaidSeq;return _(d,l,t).then(function(o){e.innerHTML=o}).catch(function(o){i(o&&o.message?o.message:"render error")})}return i(""),Promise.resolve()}s.RenderAll=function(){var e=n.getEditable();if(!e)return 0;L(n.getDocument());for(var t=e.querySelectorAll(".rte-mermaid[data-diagram]"),r=0;r<t.length;r++){var a=t[r],i=a.querySelector(".rte-mermaid-render");i||(i=a.ownerDocument.createElement("div"),i.className="rte-mermaid-render",a.appendChild(i)),x(i,E(a.getAttribute("data-diagram")||""))}return t.length};function N(e,t){var r=C(e);return'<div class="rte-mermaid" data-rte-diagram="1" data-diagram="'+r+'" contenteditable="false"'+(t?' id="'+t+'"':"")+'><button type="button" class="rte-mermaid-remove" data-rte-mermaid-remove="1" aria-label="Remove diagram" title="Remove diagram">x</button><div class="rte-mermaid-render"><pre class="rte-mermaid-src">'+B(e)+"</pre></div></div>"}s.OpenDiagramDialog=function(e){e||(e=S());var t=e?E(e.getAttribute("data-diagram")||""):"",r=n.createDialog(n.getLangText&&n.getLangText("insertdiagramtitle")||"Insert / edit diagram","rte-dialog-diagram"),a=typeof r.close=="function"?function(){r.close()}:function(){n.closeCurrentPopup()},i=r.ownerDocument.defaultView||window,d=u(r,"div","padding:14px;min-width:480px;font:13px -apple-system,Segoe UI,sans-serif");u(d,"div","font-weight:600;margin-bottom:4px").innerText=n.getLangText&&n.getLangText("insertdiagramlabel")||"Mermaid";var l=u(d,"textarea","width:100%;box-sizing:border-box;min-height:120px;padding:8px 10px;border:1px solid #cbd5e1;border-radius:8px;font:12px ui-monospace,Consolas,monospace;resize:vertical");l.value=t,l.placeholder=`graph TD
15
15
  A --> B`;var o=u(d,"div","display:flex;flex-wrap:wrap;gap:6px;margin:8px 0");(f.diagramSamples||[]).forEach(function(p){var m=u(o,"button","font:11px ui-monospace,monospace;padding:3px 8px;border:1px solid #e2e8f0;border-radius:6px;background:#f8fafc;cursor:pointer");m.type="button",m.textContent=(p.split(`
16
- `)[0]||"sample").slice(0,22),m.title=p,m.onclick=function(){l.value=p,h(),l.focus()}}),u(d,"div","font-weight:600;margin:10px 0 4px").innerText=n.getLangText&&n.getLangText("insertdiagrampreview")||"Preview";var c=u(d,"div","min-height:80px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;overflow:auto;text-align:center"),g=u(d,"div","font-size:11px;color:#94a3b8;margin-top:4px");typeof f.diagramResolver!="function"&&!L(i)&&(g.innerText="No Mermaid renderer detected on the page \u2014 the diagram is stored as source and will render wherever Mermaid (or config.diagramResolver) is available.");var b=null;function h(){var p=l.value.trim();if(!p){c.textContent="";return}b&&clearTimeout(b),b=setTimeout(function(){var m=c.ownerDocument.createElement("div");m.className="rte-mermaid-render",c.innerHTML="",c.appendChild(m),v(m,p)},250)}l.oninput=h,setTimeout(function(){l.focus(),h()},0);var k=u(d,"div","display:flex;justify-content:flex-end;gap:8px;margin-top:14px"),y=u(k,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");y.type="button",y.textContent="Cancel",y.onclick=a;var w=u(k,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");w.type="button",w.textContent=e?"Update":"Insert",w.onclick=function(){var p=l.value.trim();if(!p){a();return}if(R(n.getDocument()),e){e.setAttribute("data-diagram",T(p));var m=e.querySelector(".rte-mermaid-render");m||(m=e.ownerDocument.createElement("div"),m.className="rte-mermaid-render",e.appendChild(m)),v(m,p),a(),n.focus();return}var A="rtemmd-pending-"+ ++RTE_MermaidSeq;n.insertHTML(N(p,A)),a();try{var _=n.getDocument(),D=_.getElementById(A);if(D){D.removeAttribute("id");var m=D.querySelector(".rte-mermaid-render");v(m,p)}}catch{}n.focus()}}}
16
+ `)[0]||"sample").slice(0,22),m.title=p,m.onclick=function(){l.value=p,y(),l.focus()}}),u(d,"div","font-weight:600;margin:10px 0 4px").innerText=n.getLangText&&n.getLangText("insertdiagrampreview")||"Preview";var c=u(d,"div","min-height:80px;padding:10px 12px;border:1px solid #e2e8f0;border-radius:8px;background:#fff;overflow:auto;text-align:center"),g=u(d,"div","font-size:11px;color:#94a3b8;margin-top:4px");typeof f.diagramResolver!="function"&&!k(i)&&(g.innerText=v("dg_norenderer","No Mermaid renderer detected on the page \u2014 the diagram is stored as source and will render wherever Mermaid (or config.diagramResolver) is available."));var h=null;function y(){var p=l.value.trim();if(!p){c.textContent="";return}h&&clearTimeout(h),h=setTimeout(function(){var m=c.ownerDocument.createElement("div");m.className="rte-mermaid-render",c.innerHTML="",c.appendChild(m),x(m,p)},250)}l.oninput=y,setTimeout(function(){l.focus(),y()},0);var A=u(d,"div","display:flex;justify-content:flex-end;gap:8px;margin-top:14px"),w=u(A,"button","padding:6px 14px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;cursor:pointer");w.type="button",w.textContent=v("cancel","Cancel"),w.onclick=a;var D=u(A,"button","padding:6px 14px;border:1px solid #1d67ba;border-radius:8px;background:#1d67ba;color:#fff;cursor:pointer");D.type="button",D.textContent=e?v("update","Update"):v("insert","Insert"),D.onclick=function(){var p=l.value.trim();if(!p){a();return}if(L(n.getDocument()),e){e.setAttribute("data-diagram",C(p));var m=e.querySelector(".rte-mermaid-render");m||(m=e.ownerDocument.createElement("div"),m.className="rte-mermaid-render",e.appendChild(m)),x(m,p),a(),n.focus();return}var M="rtemmd-pending-"+ ++RTE_MermaidSeq;n.insertHTML(N(p,M)),a();try{var P=n.getDocument(),T=P.getElementById(M);if(T){T.removeAttribute("id");var m=T.querySelector(".rte-mermaid-render");x(m,p)}}catch{}n.focus()}}}
@@ -88,11 +88,15 @@ function RTE_Plugin_MultiLevelList() {
88
88
  function applyToSelection(on) {
89
89
  var ol = nearestRootList();
90
90
  if (!ol) return false;
91
+ // Direct API calls need explicit undo boundaries; change notifications
92
+ // alone race the delayed bookmark snapshot in WebKit.
93
+ if (editor.commitBookmark) editor.commitBookmark();
91
94
  if (on) ol.classList.add(config.legalListClass);
92
95
  else ol.classList.remove(config.legalListClass);
93
96
  // Let the host know the document changed so undo/save stay honest.
94
97
  try { if (typeof editor.updateDesign === "function") editor.updateDesign(); } catch (e) {}
95
98
  try { editor.fireEvent && editor.fireEvent("change"); } catch (e) {}
99
+ if (editor.recordUndo) editor.recordUndo();
96
100
  return on;
97
101
  }
98
102
 
@@ -1 +1 @@
1
- window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_multilevellist=RTE_Plugin_MultiLevelList,typeof RTE_DefaultConfig.legalListClass>"u"&&(RTE_DefaultConfig.legalListClass="rte-legal-list"),typeof RTE_DefaultConfig.legalListSeparator>"u"&&(RTE_DefaultConfig.legalListSeparator="."),typeof RTE_DefaultConfig.legalListSuffix>"u"&&(RTE_DefaultConfig.legalListSuffix=".");function RTE_Plugin_MultiLevelList(){var s=this,a,l,u=null;s.PluginName="MultiLevelList",s.InitConfig=function(e){a=e},s.InitEditor=function(e){l=e,r();try{l.attachEvent("ready",r)}catch{}try{l.attachEvent("aftersethtml",r)}catch{}setTimeout(r,0),l.setLegalNumbering=function(i){return g(!!i)},l.toggleLegalNumbering=function(){return g(!f(o()))},l.isLegalNumbering=function(){return f(o())},l.getLegalListCss=function(){return c()}};function r(){var e=p();e&&e!==u?(d(e),u=e):e&&d(e)}function p(){try{return l.getDocument()}catch{return null}}function L(){try{return l.getEditable()}catch{return null}}function o(){try{var e=l.getSelection();if(!e||e.rangeCount===0)return null;var i=L(),t=e.getRangeAt(0).startContainer;t&&t.nodeType===3&&(t=t.parentNode);for(var n=null;t&&t!==i;)t.nodeName==="OL"&&(n=t),t=t.parentNode;return n}catch{return null}}function f(e){return!!(e&&e.classList&&e.classList.contains(a.legalListClass))}function g(e){var i=o();if(!i)return!1;e?i.classList.add(a.legalListClass):i.classList.remove(a.legalListClass);try{typeof l.updateDesign=="function"&&l.updateDesign()}catch{}try{l.fireEvent&&l.fireEvent("change")}catch{}return e}function c(){var e=a.legalListClass,i=String(a.legalListSeparator||".").replace(/"/g,'\\"'),t=String(a.legalListSuffix==null?".":a.legalListSuffix).replace(/"/g,'\\"');return"ol."+e+",ol."+e+" ol{counter-reset:rte-legal;list-style:none;}ol."+e+">li,ol."+e+" ol>li{counter-increment:rte-legal;position:relative;}ol."+e+">li::marker,ol."+e+' ol>li::marker{content:"";}ol.'+e+">li::before,ol."+e+' ol>li::before{content:counters(rte-legal,"'+i+'")"'+t+'";position:absolute;left:-3.2em;width:3em;text-align:right;font-variant-numeric:tabular-nums;}ol.'+e+"{padding-left:3.6em;}ol."+e+" ol{padding-left:3.2em;margin-top:.25em;}"}function d(e){if(e){var i=e.getElementById("rte-legal-list-styles"),t=c();if(i){if(i.getAttribute("data-css")===t)return;i.parentNode&&i.parentNode.removeChild(i)}var n=e.createElement("style");n.id="rte-legal-list-styles",n.setAttribute("data-css",t),n.appendChild(e.createTextNode(t)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(n),l&&typeof l.ensureStyleSheetLive=="function"&&l.ensureStyleSheetLive(e,n,"rte-legal-list-styles",n.textContent)}}}
1
+ window.RTE_DefaultConfig||(window.RTE_DefaultConfig={}),RTE_DefaultConfig.plugin_multilevellist=RTE_Plugin_MultiLevelList,typeof RTE_DefaultConfig.legalListClass>"u"&&(RTE_DefaultConfig.legalListClass="rte-legal-list"),typeof RTE_DefaultConfig.legalListSeparator>"u"&&(RTE_DefaultConfig.legalListSeparator="."),typeof RTE_DefaultConfig.legalListSuffix>"u"&&(RTE_DefaultConfig.legalListSuffix=".");function RTE_Plugin_MultiLevelList(){var o=this,a,t,u=null;o.PluginName="MultiLevelList",o.InitConfig=function(e){a=e},o.InitEditor=function(e){t=e,r();try{t.attachEvent("ready",r)}catch{}try{t.attachEvent("aftersethtml",r)}catch{}setTimeout(r,0),t.setLegalNumbering=function(i){return g(!!i)},t.toggleLegalNumbering=function(){return g(!f(s()))},t.isLegalNumbering=function(){return f(s())},t.getLegalListCss=function(){return c()}};function r(){var e=m();e&&e!==u?(d(e),u=e):e&&d(e)}function m(){try{return t.getDocument()}catch{return null}}function p(){try{return t.getEditable()}catch{return null}}function s(){try{var e=t.getSelection();if(!e||e.rangeCount===0)return null;var i=p(),l=e.getRangeAt(0).startContainer;l&&l.nodeType===3&&(l=l.parentNode);for(var n=null;l&&l!==i;)l.nodeName==="OL"&&(n=l),l=l.parentNode;return n}catch{return null}}function f(e){return!!(e&&e.classList&&e.classList.contains(a.legalListClass))}function g(e){var i=s();if(!i)return!1;t.commitBookmark&&t.commitBookmark(),e?i.classList.add(a.legalListClass):i.classList.remove(a.legalListClass);try{typeof t.updateDesign=="function"&&t.updateDesign()}catch{}try{t.fireEvent&&t.fireEvent("change")}catch{}return t.recordUndo&&t.recordUndo(),e}function c(){var e=a.legalListClass,i=String(a.legalListSeparator||".").replace(/"/g,'\\"'),l=String(a.legalListSuffix==null?".":a.legalListSuffix).replace(/"/g,'\\"');return"ol."+e+",ol."+e+" ol{counter-reset:rte-legal;list-style:none;}ol."+e+">li,ol."+e+" ol>li{counter-increment:rte-legal;position:relative;}ol."+e+">li::marker,ol."+e+' ol>li::marker{content:"";}ol.'+e+">li::before,ol."+e+' ol>li::before{content:counters(rte-legal,"'+i+'")"'+l+'";position:absolute;left:-3.2em;width:3em;text-align:right;font-variant-numeric:tabular-nums;}ol.'+e+"{padding-left:3.6em;}ol."+e+" ol{padding-left:3.2em;margin-top:.25em;}"}function d(e){if(e){var i=e.getElementById("rte-legal-list-styles"),l=c();if(i){if(i.getAttribute("data-css")===l)return;i.parentNode&&i.parentNode.removeChild(i)}var n=e.createElement("style");n.id="rte-legal-list-styles",n.setAttribute("data-css",l),n.appendChild(e.createTextNode(l)),(e.head||e.getElementsByTagName("head")[0]||e.documentElement).appendChild(n),t&&typeof t.ensureStyleSheetLive=="function"&&t.ensureStyleSheetLive(e,n,"rte-legal-list-styles",n.textContent)}}}