@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.
- package/README.md +173 -10
- package/angular/build-manifest.json +23 -0
- package/angular/index.d.ts +71 -76
- package/angular/index.mjs +2 -0
- package/angular/package.json +4 -0
- package/headless/index.d.ts +3 -1
- package/headless/index.js +72 -16
- package/index.d.ts +33 -54
- package/integrations/initialization-scope.js +27 -0
- package/integrations/native-mount.js +30 -0
- package/integrations/shared.d.ts +23 -1
- package/integrations/shared.js +58 -22
- package/package.json +25 -3
- package/react/index.js +118 -37
- package/react/index.mjs +29 -0
- package/richtexteditor/all_plugins.js +7001 -1078
- package/richtexteditor/all_plugins.min.js +62 -59
- package/richtexteditor/lang/emoji/LICENSE-CLDR.txt +41 -0
- package/richtexteditor/lang/emoji/rte-emoji-de.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-es.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-fr.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-it.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ja.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ko.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-nl.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ru.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hans.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hant.js +3 -0
- package/richtexteditor/lang/rte-lang-af.js +1 -0
- package/richtexteditor/lang/rte-lang-ar.js +1 -0
- package/richtexteditor/lang/rte-lang-bg.js +1 -0
- package/richtexteditor/lang/rte-lang-bn.js +1 -0
- package/richtexteditor/lang/rte-lang-bs.js +1 -0
- package/richtexteditor/lang/rte-lang-ca.js +1 -0
- package/richtexteditor/lang/rte-lang-cs.js +1 -0
- package/richtexteditor/lang/rte-lang-cy.js +1 -0
- package/richtexteditor/lang/rte-lang-da.js +1 -0
- package/richtexteditor/lang/rte-lang-de.js +1017 -2
- package/richtexteditor/lang/rte-lang-el.js +1 -0
- package/richtexteditor/lang/rte-lang-en.js +1 -0
- package/richtexteditor/lang/rte-lang-es.js +1023 -2
- package/richtexteditor/lang/rte-lang-et.js +1 -0
- package/richtexteditor/lang/rte-lang-fa.js +1 -0
- package/richtexteditor/lang/rte-lang-fi.js +1 -0
- package/richtexteditor/lang/rte-lang-fil.js +1 -0
- package/richtexteditor/lang/rte-lang-fj.js +1 -0
- package/richtexteditor/lang/rte-lang-fr.js +1023 -2
- package/richtexteditor/lang/rte-lang-ga.js +1 -0
- package/richtexteditor/lang/rte-lang-gu.js +1 -0
- package/richtexteditor/lang/rte-lang-he.js +1 -0
- package/richtexteditor/lang/rte-lang-hi.js +1 -0
- package/richtexteditor/lang/rte-lang-hr.js +1 -0
- package/richtexteditor/lang/rte-lang-ht.js +1 -0
- package/richtexteditor/lang/rte-lang-hu.js +1 -0
- package/richtexteditor/lang/rte-lang-id.js +1 -0
- package/richtexteditor/lang/rte-lang-is.js +1 -0
- package/richtexteditor/lang/rte-lang-it.js +1023 -2
- package/richtexteditor/lang/rte-lang-ja.js +1023 -2
- package/richtexteditor/lang/rte-lang-kn.js +1 -0
- package/richtexteditor/lang/rte-lang-ko.js +1023 -2
- package/richtexteditor/lang/rte-lang-lt.js +1 -0
- package/richtexteditor/lang/rte-lang-lv.js +1 -0
- package/richtexteditor/lang/rte-lang-mg.js +1 -0
- package/richtexteditor/lang/rte-lang-mi.js +1 -0
- package/richtexteditor/lang/rte-lang-ml.js +1 -0
- package/richtexteditor/lang/rte-lang-mr.js +1 -0
- package/richtexteditor/lang/rte-lang-ms.js +1 -0
- package/richtexteditor/lang/rte-lang-mt.js +1 -0
- package/richtexteditor/lang/rte-lang-mww.js +1 -0
- package/richtexteditor/lang/rte-lang-nb.js +1 -0
- package/richtexteditor/lang/rte-lang-nl.js +1023 -2
- package/richtexteditor/lang/rte-lang-otq.js +1 -0
- package/richtexteditor/lang/rte-lang-pa.js +1 -0
- package/richtexteditor/lang/rte-lang-pl.js +1 -0
- package/richtexteditor/lang/rte-lang-pt-pt.js +1023 -2
- package/richtexteditor/lang/rte-lang-pt.js +1023 -2
- package/richtexteditor/lang/rte-lang-ro.js +1 -0
- package/richtexteditor/lang/rte-lang-ru.js +1023 -2
- package/richtexteditor/lang/rte-lang-sk.js +1 -0
- package/richtexteditor/lang/rte-lang-sl.js +1 -0
- package/richtexteditor/lang/rte-lang-sm.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Cyrl.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-sv.js +1 -0
- package/richtexteditor/lang/rte-lang-sw.js +1 -0
- package/richtexteditor/lang/rte-lang-ta.js +1 -0
- package/richtexteditor/lang/rte-lang-te.js +1 -0
- package/richtexteditor/lang/rte-lang-th.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Piqd.js +1 -0
- package/richtexteditor/lang/rte-lang-to.js +1 -0
- package/richtexteditor/lang/rte-lang-tr.js +1 -0
- package/richtexteditor/lang/rte-lang-ty.js +1 -0
- package/richtexteditor/lang/rte-lang-uk.js +1 -0
- package/richtexteditor/lang/rte-lang-ur.js +1 -0
- package/richtexteditor/lang/rte-lang-vi.js +1 -0
- package/richtexteditor/lang/rte-lang-yua.js +1 -0
- package/richtexteditor/lang/rte-lang-zh-Hans.js +1017 -2
- package/richtexteditor/lang/rte-lang-zh-Hant.js +1017 -2
- package/richtexteditor/plugins/a11yenhance.js +2 -1
- package/richtexteditor/plugins/a11yenhance.min.js +1 -1
- package/richtexteditor/plugins/accessibilitychecker.js +252 -60
- package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
- package/richtexteditor/plugins/aitoolkit.js +966 -303
- package/richtexteditor/plugins/aitoolkit.min.js +7 -7
- package/richtexteditor/plugins/all_plugins.js +7001 -1078
- package/richtexteditor/plugins/all_plugins.min.js +62 -59
- package/richtexteditor/plugins/autocorrect.js +66 -31
- package/richtexteditor/plugins/autocorrect.min.js +1 -1
- package/richtexteditor/plugins/autoembed.js +17 -0
- package/richtexteditor/plugins/autoembed.min.js +1 -1
- package/richtexteditor/plugins/blocktypes.js +18 -9
- package/richtexteditor/plugins/blocktypes.min.js +1 -1
- package/richtexteditor/plugins/bookmarkcard.js +12 -5
- package/richtexteditor/plugins/bookmarkcard.min.js +2 -2
- package/richtexteditor/plugins/changecase.js +72 -19
- package/richtexteditor/plugins/changecase.min.js +1 -1
- package/richtexteditor/plugins/charlimit.js +62 -2
- package/richtexteditor/plugins/charlimit.min.js +2 -2
- package/richtexteditor/plugins/comments.js +458 -59
- package/richtexteditor/plugins/comments.min.js +4 -3
- package/richtexteditor/plugins/contentminimap.js +25 -6
- package/richtexteditor/plugins/contentminimap.min.js +1 -1
- package/richtexteditor/plugins/crossreference.js +1 -1
- package/richtexteditor/plugins/crossreference.min.js +1 -1
- package/richtexteditor/plugins/dialoga11y.js +26 -4
- package/richtexteditor/plugins/dialoga11y.min.js +1 -1
- package/richtexteditor/plugins/dictation.js +1 -1
- package/richtexteditor/plugins/documentimport.js +220 -51
- package/richtexteditor/plugins/documentimport.min.js +4 -4
- package/richtexteditor/plugins/documentoutline.js +47 -8
- package/richtexteditor/plugins/documentoutline.min.js +1 -1
- package/richtexteditor/plugins/docxexport.js +204 -32
- package/richtexteditor/plugins/docxexport.min.js +2 -2
- package/richtexteditor/plugins/draghandle.js +267 -3
- package/richtexteditor/plugins/draghandle.min.js +1 -1
- package/richtexteditor/plugins/emailtoolkit.js +28 -14
- package/richtexteditor/plugins/emailtoolkit.min.js +1 -1
- package/richtexteditor/plugins/emojiautocomplete.js +110 -56
- package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
- package/richtexteditor/plugins/footnotes.js +65 -11
- package/richtexteditor/plugins/footnotes.min.js +1 -1
- package/richtexteditor/plugins/formatpainter.js +10 -0
- package/richtexteditor/plugins/formatpainter.min.js +1 -1
- package/richtexteditor/plugins/formattingmarks.js +6 -6
- package/richtexteditor/plugins/formattingmarks.min.js +1 -1
- package/richtexteditor/plugins/gapcursor.js +60 -0
- package/richtexteditor/plugins/gapcursor.min.js +1 -1
- package/richtexteditor/plugins/ghostcomplete.js +1 -1
- package/richtexteditor/plugins/html2pdf.js +1 -1
- package/richtexteditor/plugins/html2pdf.min.js +1 -1
- package/richtexteditor/plugins/imageeditor.js +12 -6
- package/richtexteditor/plugins/imageeditor.min.js +1 -1
- package/richtexteditor/plugins/importstyles.js +1 -1
- package/richtexteditor/plugins/inlinecode.js +25 -0
- package/richtexteditor/plugins/inlinecode.min.js +1 -1
- package/richtexteditor/plugins/insertcode.js +21 -3
- package/richtexteditor/plugins/insertcode.min.js +4 -4
- package/richtexteditor/plugins/insertemoji.js +112 -15
- package/richtexteditor/plugins/insertemoji.min.js +1 -1
- package/richtexteditor/plugins/insertgallery.js +42 -36
- package/richtexteditor/plugins/insertgallery.min.js +1 -1
- package/richtexteditor/plugins/inserttemplate.js +33 -17
- package/richtexteditor/plugins/inserttemplate.min.js +1 -1
- package/richtexteditor/plugins/keyboarda11y.js +66 -3
- package/richtexteditor/plugins/keyboarda11y.min.js +1 -1
- package/richtexteditor/plugins/layouttable.js +20 -0
- package/richtexteditor/plugins/layouttable.min.js +1 -1
- package/richtexteditor/plugins/linkchecker.js +29 -9
- package/richtexteditor/plugins/linkchecker.min.js +1 -1
- package/richtexteditor/plugins/localdraft.js +51 -7
- package/richtexteditor/plugins/localdraft.min.js +1 -1
- package/richtexteditor/plugins/markdownexport.js +159 -0
- package/richtexteditor/plugins/markdownexport.min.js +2 -2
- package/richtexteditor/plugins/mathdialog.js +11 -5
- package/richtexteditor/plugins/mathdialog.min.js +1 -1
- package/richtexteditor/plugins/mentionplugin.js +88 -25
- package/richtexteditor/plugins/mentionplugin.min.js +1 -1
- package/richtexteditor/plugins/mermaiddiagram.js +9 -3
- package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
- package/richtexteditor/plugins/multilevellist.js +4 -0
- package/richtexteditor/plugins/multilevellist.min.js +1 -1
- package/richtexteditor/plugins/pdfexport.js +235 -35
- package/richtexteditor/plugins/pdfexport.min.js +12 -12
- package/richtexteditor/plugins/permanentpen.js +3 -3
- package/richtexteditor/plugins/permanentpen.min.js +1 -1
- package/richtexteditor/plugins/readabilitystats.js +25 -11
- package/richtexteditor/plugins/readabilitystats.min.js +1 -1
- package/richtexteditor/plugins/readaloud.js +29 -15
- package/richtexteditor/plugins/readaloud.min.js +1 -1
- package/richtexteditor/plugins/restrictedediting.js +166 -0
- package/richtexteditor/plugins/restrictedediting.min.js +2 -2
- package/richtexteditor/plugins/revisionhistory.js +169 -37
- package/richtexteditor/plugins/revisionhistory.min.js +3 -3
- package/richtexteditor/plugins/rubyannotation.js +19 -9
- package/richtexteditor/plugins/rubyannotation.min.js +1 -1
- package/richtexteditor/plugins/sanitizer.js +62 -3
- package/richtexteditor/plugins/sanitizer.min.js +1 -1
- package/richtexteditor/plugins/slashcommand.js +30 -16
- package/richtexteditor/plugins/slashcommand.min.js +2 -2
- package/richtexteditor/plugins/smartchips.js +36 -22
- package/richtexteditor/plugins/smartchips.min.js +2 -2
- package/richtexteditor/plugins/spellcheck.js +17 -8
- package/richtexteditor/plugins/spellcheck.min.js +2 -2
- package/richtexteditor/plugins/stateinspector.js +19 -9
- package/richtexteditor/plugins/stateinspector.min.js +2 -2
- package/richtexteditor/plugins/structured-content-bridge.js +56 -24
- package/richtexteditor/plugins/structured-content-bridge.min.js +7 -7
- package/richtexteditor/plugins/tableofcontents.js +5 -2
- package/richtexteditor/plugins/tableofcontents.min.js +1 -1
- package/richtexteditor/plugins/tabletools.js +388 -3
- package/richtexteditor/plugins/tabletools.min.js +1 -1
- package/richtexteditor/plugins/textdirection.js +18 -5
- package/richtexteditor/plugins/textdirection.min.js +1 -1
- package/richtexteditor/plugins/textpartlanguage.js +161 -32
- package/richtexteditor/plugins/textpartlanguage.min.js +1 -1
- package/richtexteditor/plugins/todolist.js +90 -6
- package/richtexteditor/plugins/todolist.min.js +1 -1
- package/richtexteditor/plugins/trackedchanges.js +1812 -25
- package/richtexteditor/plugins/trackedchanges.min.js +5 -3
- package/richtexteditor/plugins/wordexport.js +2 -2
- package/richtexteditor/plugins/yjscollab.js +9 -4
- package/richtexteditor/plugins/yjscollab.min.js +1 -1
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.js +22 -13
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -1
- package/richtexteditor/rte-config.js +130 -50
- package/richtexteditor/rte-headless.js +19 -4
- package/richtexteditor/rte-webcomponent.js +89 -16
- package/richtexteditor/rte.js +132 -52
- package/scripts/build-angular.mjs +97 -0
- package/svelte/index.d.ts +2 -1
- package/svelte/index.js +80 -9
- package/vue/index.js +130 -34
- package/angular/component.ts +0 -297
- 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=
|
|
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,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function E(e){return String(e).replace(/"/g,'"').replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&")}function B(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}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,
|
|
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
|
|
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)}}}
|