@editora/plugins 1.0.19 → 1.0.21

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 (45) hide show
  1. package/dist/{CodePlugin.native-Bwf25lLX.js → CodePlugin.native-CKJo7IFG.js} +8 -8
  2. package/dist/{CodePlugin.native-Cpp4u3Jl.mjs → CodePlugin.native-D8gGxB8i.mjs} +59 -60
  3. package/dist/a11y-checker.cjs.js +1 -1
  4. package/dist/a11y-checker.esm.js +18 -18
  5. package/dist/anchor.cjs.js +6 -6
  6. package/dist/anchor.esm.js +57 -57
  7. package/dist/blockquote.cjs.js +1 -1
  8. package/dist/blockquote.esm.js +31 -31
  9. package/dist/capitalization.cjs.js +1 -1
  10. package/dist/capitalization.esm.js +25 -25
  11. package/dist/checklist.cjs.js +1 -1
  12. package/dist/checklist.esm.js +30 -30
  13. package/dist/code.cjs.js +1 -1
  14. package/dist/code.esm.js +1 -1
  15. package/dist/collaboration.cjs.js +8 -8
  16. package/dist/collaboration.esm.js +1279 -1169
  17. package/dist/comments.cjs.js +1 -1
  18. package/dist/comments.esm.js +1 -1
  19. package/dist/direction.cjs.js +1 -1
  20. package/dist/direction.esm.js +26 -26
  21. package/dist/document-manager.cjs.js +1 -1
  22. package/dist/document-manager.esm.js +1 -1
  23. package/dist/{documentManager-yjRBab4v.mjs → documentManager-BL98a7YZ.mjs} +402 -404
  24. package/dist/{documentManager-BDz6tovy.js → documentManager-r8t7yZEd.js} +9 -9
  25. package/dist/enterprise.cjs.js +1 -1
  26. package/dist/enterprise.esm.js +1 -1
  27. package/dist/font-family.cjs.js +1 -1
  28. package/dist/font-family.esm.js +26 -26
  29. package/dist/{index-Bm1eqYHh.mjs → index-B-VitI3v.mjs} +23 -22
  30. package/dist/{index-CoflqYuK.js → index-D5xugkYA.js} +2 -2
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/index.esm.js +2 -2
  33. package/dist/preview.cjs.js +3 -3
  34. package/dist/preview.esm.js +48 -51
  35. package/dist/purify.es-B6PsRpEV.js +3 -0
  36. package/dist/purify.es-DmCsrgBd.mjs +1480 -0
  37. package/dist/sanitizeHtml-CDoBlNTk.js +1 -0
  38. package/dist/sanitizeHtml-CtLy8um-.mjs +16 -0
  39. package/dist/spell-check.cjs.js +2 -2
  40. package/dist/spell-check.esm.js +19 -19
  41. package/dist/table.cjs.js +14 -14
  42. package/dist/table.esm.js +158 -150
  43. package/dist/template.cjs.js +20 -21
  44. package/dist/template.esm.js +176 -724
  45. package/package.json +6 -4
@@ -351,4 +351,4 @@
351
351
  margin-right: 0;
352
352
  }
353
353
  }
354
- `,document.head.appendChild(e)}const ee=()=>({name:"comments",toolbar:[{label:"Add Comment",command:"addComment",type:"button",icon:'<svg fill="#000000" width="24px" height="24px" viewBox="0 0 32 32" id="icon" xmlns="http://www.w3.org/2000/svg"><title>add-comment</title><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><polygon points="17 9 15 9 15 13 11 13 11 15 15 15 15 19 17 19 17 15 21 15 21 13 17 13 17 9"></polygon><rect fill="none" width="32" height="32"></rect></svg>'},{label:"Show / Hide Comments",command:"toggleComments",type:"button",icon:'<svg width="24px" height="24px" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 1H4V11H8L10 13L12 11H16V1Z" fill="#000000"></path><path d="M2 5V13H7.17157L8.70711 14.5355L7.29289 15.9497L6.34315 15H0V5H2Z" fill="#000000"></path></svg>'}],commands:{addComment:(e,t)=>{q(t),M();const r=u();return r?(r.savedSelection=V(r.root),r.savedSelection&&window.getSelection()?.removeAllRanges(),w(r,!0),d(r),r.panelElement?.querySelector(".new-comment-textarea")?.focus({preventScroll:!0}),!0):!1},toggleComments:(e,t)=>{q(t),M();const r=u();return r?(w(r,!r.panelVisible),r.panelVisible&&d(r),!0):!1}},keymap:{}});exports.CommentsPlugin=ee;
354
+ `,document.head.appendChild(e)}const ee=()=>({name:"comments",toolbar:[{label:"Add Comment",command:"addComment",type:"button",icon:'<svg fill="#000000" width="24px" height="24px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>add-comment</title><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><polygon points="17 9 15 9 15 13 11 13 11 15 15 15 15 19 17 19 17 15 21 15 21 13 17 13 17 9"></polygon><rect fill="none" width="32" height="32"></rect></svg>'},{label:"Show / Hide Comments",command:"toggleComments",type:"button",icon:'<svg width="24px" height="24px" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 1H4V11H8L10 13L12 11H16V1Z" fill="#000000"></path><path d="M2 5V13H7.17157L8.70711 14.5355L7.29289 15.9497L6.34315 15H0V5H2Z" fill="#000000"></path></svg>'}],commands:{addComment:(e,t)=>{q(t),M();const r=u();return r?(r.savedSelection=V(r.root),r.savedSelection&&window.getSelection()?.removeAllRanges(),w(r,!0),d(r),r.panelElement?.querySelector(".new-comment-textarea")?.focus({preventScroll:!0}),!0):!1},toggleComments:(e,t)=>{q(t),M();const r=u();return r?(w(r,!r.panelVisible),r.panelVisible&&d(r),!0):!1}},keymap:{}});exports.CommentsPlugin=ee;
@@ -727,7 +727,7 @@ const te = () => ({
727
727
  // - any other icon reusing the same auto-generated class name would
728
728
  // collide with it. Inlined the one declaration it held (fill="none")
729
729
  // directly on the rect instead, so there's nothing to leak.
730
- icon: '<svg fill="#000000" width="24px" height="24px" viewBox="0 0 32 32" id="icon" xmlns="http://www.w3.org/2000/svg"><title>add-comment</title><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><polygon points="17 9 15 9 15 13 11 13 11 15 15 15 15 19 17 19 17 15 21 15 21 13 17 13 17 9"></polygon><rect fill="none" width="32" height="32"></rect></svg>'
730
+ icon: '<svg fill="#000000" width="24px" height="24px" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><title>add-comment</title><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><polygon points="17 9 15 9 15 13 11 13 11 15 15 15 15 19 17 19 17 15 21 15 21 13 17 13 17 9"></polygon><rect fill="none" width="32" height="32"></rect></svg>'
731
731
  },
732
732
  {
733
733
  label: "Show / Hide Comments",
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l='.rte-content, .editora-content, [contenteditable="true"]',g="[data-editora-editor], .rte-editor, .editora-editor, editora-editor",T=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE","TABLE","FIGURE","UL","OL"]),d=e=>T.has(e.tagName)&&e.getAttribute("contenteditable")!=="true",m=e=>e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null,C=e=>{const n=e?.contentElement;if(n instanceof HTMLElement)return n;const t=e?.editorElement;if(t instanceof HTMLElement){const o=t.querySelector(l);if(o instanceof HTMLElement)return o;if(t.getAttribute("contenteditable")==="true")return t}const r=window.__editoraCommandEditorRoot;if(r instanceof HTMLElement){const o=r.querySelector(l);if(o instanceof HTMLElement)return o;if(r.getAttribute("contenteditable")==="true")return r}const i=window.getSelection();if(i&&i.rangeCount>0){const o=m(i.getRangeAt(0).startContainer),c=o?.closest(l);if(c instanceof HTMLElement)return c;const f=o?.closest(g)?.querySelector(l);if(f instanceof HTMLElement)return f}const a=document.activeElement,s=a instanceof HTMLElement?a.closest(l):null;return s instanceof HTMLElement?s:document.querySelector(l)},L=e=>{const n=window.getSelection();if(!n||n.rangeCount===0)return null;const t=n.getRangeAt(0);return!e.contains(t.startContainer)||!e.contains(t.endContainer)?null:t},R=(e,n)=>{let t=m(n);for(;t&&t!==e&&e.contains(t);){if(d(t))return t;t=t.parentElement}return d(e)?e:null},u=(e,n)=>{const t=R(e,n);if(!t||t===e)return null;const r=t.closest("li");return r instanceof HTMLElement&&e.contains(r)?r:t},h=(e,n)=>{if(typeof e.intersectsNode=="function")try{return e.intersectsNode(n)}catch{return!1}const t=document.createRange();return t.selectNode(n),e.compareBoundaryPoints(Range.END_TO_START,t)<0&&e.compareBoundaryPoints(Range.START_TO_END,t)>0},w=(e,n)=>{const t=[],r=new Set,i=o=>{!o||r.has(o)||o===n||!n.contains(o)||d(o)&&(r.add(o),t.push(o))};if(e.collapsed)return i(u(n,e.startContainer)),t;i(u(n,e.startContainer)),i(u(n,e.endContainer));const a=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o;return!d(c)||c.closest("li")&&c.tagName!=="LI"?NodeFilter.FILTER_SKIP:h(e,c)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=a.nextNode();for(;s;)i(s),s=a.nextNode();return t.length===0&&i(u(n,e.commonAncestorContainer)),t.filter(o=>!t.some(c=>c!==o&&o.contains(c)))},p=(e,n,t)=>{if(n!==t){if(typeof window.execEditorCommand=="function"){window.execEditorCommand("recordDomTransaction",e,n,t);return}if(typeof window.executeEditorCommand=="function")try{window.executeEditorCommand("recordDomTransaction",{editor:e,beforeHTML:n,afterHTML:t})}catch{}}},E=(e,n)=>{const t=C(n);if(!t)return!1;const r=L(t);if(!r)return!1;const i=w(r,t);if(i.length===0)return!1;const a=t.innerHTML;i.forEach(o=>{o.setAttribute("dir",e)});const s=t.innerHTML;return a===s?!1:(p(t,a,s),t.dispatchEvent(new window.Event("input",{bubbles:!0})),!0)},S=()=>({name:"direction",toolbar:[{label:"Left to Right",command:"setDirectionLTR",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21 18H3M21 18L18 21M21 18L18 15M13 3V12M13 3H7M13 3C13.4596 3 13.9148 3.0776 14.3394 3.22836C14.764 3.37913 15.1499 3.6001 15.4749 3.87868C15.7999 4.15726 16.0577 4.48797 16.2336 4.85195C16.4095 5.21593 16.5 5.60603 16.5 6C16.5 6.39397 16.4095 6.78407 16.2336 7.14805C16.0577 7.51203 15.7999 7.84274 15.4749 8.12132C15.1499 8.3999 14.764 8.62087 14.3394 8.77164C13.9148 8.9224 13.4596 9 13 9V3ZM9 3V12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',shortcut:"Mod-Shift-l"},{label:"Right to Left",command:"setDirectionRTL",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M3 18H21M3 18L6 21M3 18L6 15M11 12V3H17M15 3V12M10.5 3C10.0404 3 9.58525 3.0776 9.16061 3.22836C8.73597 3.37913 8.35013 3.6001 8.02513 3.87868C7.70012 4.15726 7.44231 4.48797 7.26642 4.85195C7.09053 5.21593 7 5.60603 7 6C7 6.39397 7.09053 6.78407 7.26642 7.14805C7.44231 7.51203 7.70012 7.84274 8.02513 8.12132C8.35013 8.3999 8.73597 8.62087 9.16061 8.77164C9.58525 8.9224 10.0404 9 10.5 9L10.5 3Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',shortcut:"Mod-Shift-r"}],commands:{setDirectionLTR:(e,n)=>{try{return E("ltr",n)}catch(t){return console.error("Failed to set LTR direction:",t),!1}},setDirectionRTL:(e,n)=>{try{return E("rtl",n)}catch(t){return console.error("Failed to set RTL direction:",t),!1}}},keymap:{"Mod-Shift-l":"setDirectionLTR","Mod-Shift-r":"setDirectionRTL"}});exports.DirectionPlugin=S;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a='.rte-content, .editora-content, [contenteditable="true"]',T="[data-editora-editor], .rte-editor, .editora-editor, editora-editor",g=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE","TABLE","FIGURE","UL","OL"]),d=e=>g.has(e.tagName)&&e.getAttribute("contenteditable")!=="true",m=e=>e?e.nodeType===Node.ELEMENT_NODE?e:e.parentElement:null,L=e=>{const n=e?.contentElement;if(n instanceof HTMLElement)return n;const t=e?.editorElement;if(t instanceof HTMLElement){const o=t.querySelector(a);if(o instanceof HTMLElement)return o;if(t.getAttribute("contenteditable")==="true")return t}const r=window.__editoraCommandEditorRoot;if(r instanceof HTMLElement){const o=r.querySelector(a);if(o instanceof HTMLElement)return o;if(r.getAttribute("contenteditable")==="true")return r}const i=window.getSelection();if(i&&i.rangeCount>0){const o=m(i.getRangeAt(0).startContainer),c=o?.closest(a);if(c instanceof HTMLElement)return c;const f=o?.closest(T)?.querySelector(a);if(f instanceof HTMLElement)return f}const l=document.activeElement,s=l instanceof HTMLElement?l.closest(a):null;return s instanceof HTMLElement?s:document.querySelector(a)},C=e=>{const n=window.getSelection();if(!n||n.rangeCount===0)return null;const t=n.getRangeAt(0);return!e.contains(t.startContainer)||!e.contains(t.endContainer)?null:t},h=(e,n)=>{let t=m(n);for(;t&&t!==e&&e.contains(t);){if(d(t))return t;t=t.parentElement}return d(e)?e:null},u=(e,n)=>{const t=h(e,n);if(!t||t===e)return null;const r=t.closest("li");return r instanceof HTMLElement&&e.contains(r)?r:t},w=(e,n)=>{if(typeof e.intersectsNode=="function")try{return e.intersectsNode(n)}catch{return!1}const t=document.createRange();return t.selectNode(n),e.compareBoundaryPoints(Range.END_TO_START,t)<0&&e.compareBoundaryPoints(Range.START_TO_END,t)>0},R=(e,n)=>{const t=[],r=new Set,i=o=>{!o||r.has(o)||o===n||!n.contains(o)||d(o)&&(r.add(o),t.push(o))};if(e.collapsed)return i(u(n,e.startContainer)),t;i(u(n,e.startContainer)),i(u(n,e.endContainer));const l=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const c=o;return!d(c)||c.closest("li")&&c.tagName!=="LI"?NodeFilter.FILTER_SKIP:w(e,c)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let s=l.nextNode();for(;s;)i(s),s=l.nextNode();return t.length===0&&i(u(n,e.commonAncestorContainer)),t.filter(o=>!t.some(c=>c!==o&&o.contains(c)))},M=(e,n,t)=>{if(n!==t){if(typeof window.execEditorCommand=="function"){window.execEditorCommand("recordDomTransaction",e,n,t);return}if(typeof window.executeEditorCommand=="function")try{window.executeEditorCommand("recordDomTransaction",{editor:e,beforeHTML:n,afterHTML:t})}catch{}}},E=(e,n)=>{const t=L(n);if(!t)return!1;const r=C(t);if(!r)return!1;const i=R(r,t);if(i.length===0)return!1;const l=t.innerHTML;i.forEach(o=>{o.setAttribute("dir",e)});const s=t.innerHTML;return l===s?!1:(M(t,l,s),t.dispatchEvent(new window.Event("input",{bubbles:!0})),!0)},p=()=>({name:"direction",toolbar:[{label:"Left to Right",command:"setDirectionLTR",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <path d="M21 18H3M21 18L18 21M21 18L18 15M13 3V12M13 3H7M13 3C13.4596 3 13.9148 3.0776 14.3394 3.22836C14.764 3.37913 15.1499 3.6001 15.4749 3.87868C15.7999 4.15726 16.0577 4.48797 16.2336 4.85195C16.4095 5.21593 16.5 5.60603 16.5 6C16.5 6.39397 16.4095 6.78407 16.2336 7.14805C16.0577 7.51203 15.7999 7.84274 15.4749 8.12132C15.1499 8.3999 14.764 8.62087 14.3394 8.77164C13.9148 8.9224 13.4596 9 13 9V3ZM9 3V12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',shortcut:"Mod-Shift-l"},{label:"Right to Left",command:"setDirectionRTL",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <path d="M3 18H21M3 18L6 21M3 18L6 15M11 12V3H17M15 3V12M10.5 3C10.0404 3 9.58525 3.0776 9.16061 3.22836C8.73597 3.37913 8.35013 3.6001 8.02513 3.87868C7.70012 4.15726 7.44231 4.48797 7.26642 4.85195C7.09053 5.21593 7 5.60603 7 6C7 6.39397 7.09053 6.78407 7.26642 7.14805C7.44231 7.51203 7.70012 7.84274 8.02513 8.12132C8.35013 8.3999 8.73597 8.62087 9.16061 8.77164C9.58525 8.9224 10.0404 9 10.5 9L10.5 3Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',shortcut:"Mod-Shift-r"}],commands:{setDirectionLTR:(e,n)=>{try{return E("ltr",n)}catch(t){return console.error("Failed to set LTR direction:",t),!1}},setDirectionRTL:(e,n)=>{try{return E("rtl",n)}catch(t){return console.error("Failed to set RTL direction:",t),!1}}},keymap:{"Mod-Shift-l":"setDirectionLTR","Mod-Shift-r":"setDirectionRTL"}});exports.DirectionPlugin=p;
@@ -1,4 +1,4 @@
1
- const l = '.rte-content, .editora-content, [contenteditable="true"]', T = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", C = /* @__PURE__ */ new Set([
1
+ const a = '.rte-content, .editora-content, [contenteditable="true"]', T = "[data-editora-editor], .rte-editor, .editora-editor, editora-editor", g = /* @__PURE__ */ new Set([
2
2
  "P",
3
3
  "DIV",
4
4
  "H1",
@@ -14,36 +14,36 @@ const l = '.rte-content, .editora-content, [contenteditable="true"]', T = "[data
14
14
  "FIGURE",
15
15
  "UL",
16
16
  "OL"
17
- ]), d = (e) => C.has(e.tagName) && e.getAttribute("contenteditable") !== "true", m = (e) => e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null, g = (e) => {
17
+ ]), d = (e) => g.has(e.tagName) && e.getAttribute("contenteditable") !== "true", m = (e) => e ? e.nodeType === Node.ELEMENT_NODE ? e : e.parentElement : null, L = (e) => {
18
18
  const n = e?.contentElement;
19
19
  if (n instanceof HTMLElement) return n;
20
20
  const t = e?.editorElement;
21
21
  if (t instanceof HTMLElement) {
22
- const o = t.querySelector(l);
22
+ const o = t.querySelector(a);
23
23
  if (o instanceof HTMLElement) return o;
24
24
  if (t.getAttribute("contenteditable") === "true") return t;
25
25
  }
26
26
  const r = window.__editoraCommandEditorRoot;
27
27
  if (r instanceof HTMLElement) {
28
- const o = r.querySelector(l);
28
+ const o = r.querySelector(a);
29
29
  if (o instanceof HTMLElement) return o;
30
30
  if (r.getAttribute("contenteditable") === "true") return r;
31
31
  }
32
32
  const i = window.getSelection();
33
33
  if (i && i.rangeCount > 0) {
34
- const o = m(i.getRangeAt(0).startContainer), c = o?.closest(l);
34
+ const o = m(i.getRangeAt(0).startContainer), c = o?.closest(a);
35
35
  if (c instanceof HTMLElement) return c;
36
- const f = o?.closest(T)?.querySelector(l);
36
+ const f = o?.closest(T)?.querySelector(a);
37
37
  if (f instanceof HTMLElement) return f;
38
38
  }
39
- const a = document.activeElement, s = a instanceof HTMLElement ? a.closest(l) : null;
40
- return s instanceof HTMLElement ? s : document.querySelector(l);
41
- }, L = (e) => {
39
+ const l = document.activeElement, s = l instanceof HTMLElement ? l.closest(a) : null;
40
+ return s instanceof HTMLElement ? s : document.querySelector(a);
41
+ }, C = (e) => {
42
42
  const n = window.getSelection();
43
43
  if (!n || n.rangeCount === 0) return null;
44
44
  const t = n.getRangeAt(0);
45
45
  return !e.contains(t.startContainer) || !e.contains(t.endContainer) ? null : t;
46
- }, R = (e, n) => {
46
+ }, h = (e, n) => {
47
47
  let t = m(n);
48
48
  for (; t && t !== e && e.contains(t); ) {
49
49
  if (d(t)) return t;
@@ -51,11 +51,11 @@ const l = '.rte-content, .editora-content, [contenteditable="true"]', T = "[data
51
51
  }
52
52
  return d(e) ? e : null;
53
53
  }, u = (e, n) => {
54
- const t = R(e, n);
54
+ const t = h(e, n);
55
55
  if (!t || t === e) return null;
56
56
  const r = t.closest("li");
57
57
  return r instanceof HTMLElement && e.contains(r) ? r : t;
58
- }, h = (e, n) => {
58
+ }, w = (e, n) => {
59
59
  if (typeof e.intersectsNode == "function")
60
60
  try {
61
61
  return e.intersectsNode(n);
@@ -64,26 +64,26 @@ const l = '.rte-content, .editora-content, [contenteditable="true"]', T = "[data
64
64
  }
65
65
  const t = document.createRange();
66
66
  return t.selectNode(n), e.compareBoundaryPoints(Range.END_TO_START, t) < 0 && e.compareBoundaryPoints(Range.START_TO_END, t) > 0;
67
- }, w = (e, n) => {
67
+ }, R = (e, n) => {
68
68
  const t = [], r = /* @__PURE__ */ new Set(), i = (o) => {
69
69
  !o || r.has(o) || o === n || !n.contains(o) || d(o) && (r.add(o), t.push(o));
70
70
  };
71
71
  if (e.collapsed)
72
72
  return i(u(n, e.startContainer)), t;
73
73
  i(u(n, e.startContainer)), i(u(n, e.endContainer));
74
- const a = document.createTreeWalker(
74
+ const l = document.createTreeWalker(
75
75
  n,
76
76
  NodeFilter.SHOW_ELEMENT,
77
77
  {
78
78
  acceptNode: (o) => {
79
79
  const c = o;
80
- return !d(c) || c.closest("li") && c.tagName !== "LI" ? NodeFilter.FILTER_SKIP : h(e, c) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
80
+ return !d(c) || c.closest("li") && c.tagName !== "LI" ? NodeFilter.FILTER_SKIP : w(e, c) ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
81
81
  }
82
82
  }
83
83
  );
84
- let s = a.nextNode();
84
+ let s = l.nextNode();
85
85
  for (; s; )
86
- i(s), s = a.nextNode();
86
+ i(s), s = l.nextNode();
87
87
  return t.length === 0 && i(u(n, e.commonAncestorContainer)), t.filter((o) => !t.some((c) => c !== o && o.contains(c)));
88
88
  }, p = (e, n, t) => {
89
89
  if (n !== t) {
@@ -98,31 +98,31 @@ const l = '.rte-content, .editora-content, [contenteditable="true"]', T = "[data
98
98
  }
99
99
  }
100
100
  }, E = (e, n) => {
101
- const t = g(n);
101
+ const t = L(n);
102
102
  if (!t) return !1;
103
- const r = L(t);
103
+ const r = C(t);
104
104
  if (!r) return !1;
105
- const i = w(r, t);
105
+ const i = R(r, t);
106
106
  if (i.length === 0) return !1;
107
- const a = t.innerHTML;
107
+ const l = t.innerHTML;
108
108
  i.forEach((o) => {
109
109
  o.setAttribute("dir", e);
110
110
  });
111
111
  const s = t.innerHTML;
112
- return a === s ? !1 : (p(t, a, s), t.dispatchEvent(new window.Event("input", { bubbles: !0 })), !0);
113
- }, M = () => ({
112
+ return l === s ? !1 : (p(t, l, s), t.dispatchEvent(new window.Event("input", { bubbles: !0 })), !0);
113
+ }, k = () => ({
114
114
  name: "direction",
115
115
  toolbar: [
116
116
  {
117
117
  label: "Left to Right",
118
118
  command: "setDirectionLTR",
119
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M21 18H3M21 18L18 21M21 18L18 15M13 3V12M13 3H7M13 3C13.4596 3 13.9148 3.0776 14.3394 3.22836C14.764 3.37913 15.1499 3.6001 15.4749 3.87868C15.7999 4.15726 16.0577 4.48797 16.2336 4.85195C16.4095 5.21593 16.5 5.60603 16.5 6C16.5 6.39397 16.4095 6.78407 16.2336 7.14805C16.0577 7.51203 15.7999 7.84274 15.4749 8.12132C15.1499 8.3999 14.764 8.62087 14.3394 8.77164C13.9148 8.9224 13.4596 9 13 9V3ZM9 3V12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
119
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <path d="M21 18H3M21 18L18 21M21 18L18 15M13 3V12M13 3H7M13 3C13.4596 3 13.9148 3.0776 14.3394 3.22836C14.764 3.37913 15.1499 3.6001 15.4749 3.87868C15.7999 4.15726 16.0577 4.48797 16.2336 4.85195C16.4095 5.21593 16.5 5.60603 16.5 6C16.5 6.39397 16.4095 6.78407 16.2336 7.14805C16.0577 7.51203 15.7999 7.84274 15.4749 8.12132C15.1499 8.3999 14.764 8.62087 14.3394 8.77164C13.9148 8.9224 13.4596 9 13 9V3ZM9 3V12" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
120
120
  shortcut: "Mod-Shift-l"
121
121
  },
122
122
  {
123
123
  label: "Right to Left",
124
124
  command: "setDirectionRTL",
125
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M3 18H21M3 18L6 21M3 18L6 15M11 12V3H17M15 3V12M10.5 3C10.0404 3 9.58525 3.0776 9.16061 3.22836C8.73597 3.37913 8.35013 3.6001 8.02513 3.87868C7.70012 4.15726 7.44231 4.48797 7.26642 4.85195C7.09053 5.21593 7 5.60603 7 6C7 6.39397 7.09053 6.78407 7.26642 7.14805C7.44231 7.51203 7.70012 7.84274 8.02513 8.12132C8.35013 8.3999 8.73597 8.62087 9.16061 8.77164C9.58525 8.9224 10.0404 9 10.5 9L10.5 3Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
125
+ icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><g stroke-width="0"></g><g stroke-linecap="round" stroke-linejoin="round"></g><g> <path d="M3 18H21M3 18L6 21M3 18L6 15M11 12V3H17M15 3V12M10.5 3C10.0404 3 9.58525 3.0776 9.16061 3.22836C8.73597 3.37913 8.35013 3.6001 8.02513 3.87868C7.70012 4.15726 7.44231 4.48797 7.26642 4.85195C7.09053 5.21593 7 5.60603 7 6C7 6.39397 7.09053 6.78407 7.26642 7.14805C7.44231 7.51203 7.70012 7.84274 8.02513 8.12132C8.35013 8.3999 8.73597 8.62087 9.16061 8.77164C9.58525 8.9224 10.0404 9 10.5 9L10.5 3Z" stroke="#000000" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> </g></svg>',
126
126
  shortcut: "Mod-Shift-r"
127
127
  }
128
128
  ],
@@ -148,5 +148,5 @@ const l = '.rte-content, .editora-content, [contenteditable="true"]', T = "[data
148
148
  }
149
149
  });
150
150
  export {
151
- M as DirectionPlugin
151
+ k as DirectionPlugin
152
152
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-CoflqYuK.js");exports.DocumentManagerPlugin=e.DocumentManagerPlugin;exports.getDocumentManagerConfig=e.getDocumentManagerConfig;exports.setDocumentManagerConfig=e.setDocumentManagerConfig;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-D5xugkYA.js");exports.DocumentManagerPlugin=e.DocumentManagerPlugin;exports.getDocumentManagerConfig=e.getDocumentManagerConfig;exports.setDocumentManagerConfig=e.setDocumentManagerConfig;
@@ -1,4 +1,4 @@
1
- import { D as n, g, s as o } from "./index-Bm1eqYHh.mjs";
1
+ import { D as n, g, s as o } from "./index-B-VitI3v.mjs";
2
2
  export {
3
3
  n as DocumentManagerPlugin,
4
4
  g as getDocumentManagerConfig,