@editora/plugins 1.0.4 → 1.0.6

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 (48) hide show
  1. package/dist/a11y-checker.cjs.js +1 -1
  2. package/dist/anchor.cjs.js +3 -3
  3. package/dist/background-color.cjs.js +2 -2
  4. package/dist/blockquote.cjs.js +1 -1
  5. package/dist/bold.cjs.js +1 -1
  6. package/dist/capitalization.cjs.js +1 -1
  7. package/dist/checklist.cjs.js +1 -1
  8. package/dist/clear-formatting.cjs.js +1 -1
  9. package/dist/code-sample.cjs.js +7 -7
  10. package/dist/code-sample.esm.js +51 -51
  11. package/dist/code.cjs.js +39 -31
  12. package/dist/code.esm.js +570 -440
  13. package/dist/comments.cjs.js +1 -1
  14. package/dist/direction.cjs.js +1 -1
  15. package/dist/document-manager.cjs.js +1 -1
  16. package/dist/embed-iframe.cjs.js +1 -1
  17. package/dist/emojis.cjs.js +1 -1
  18. package/dist/font-family.cjs.js +1 -1
  19. package/dist/font-size.cjs.js +1 -1
  20. package/dist/footnote.cjs.js +2 -2
  21. package/dist/fullscreen.cjs.js +1 -1
  22. package/dist/heading.cjs.js +1 -1
  23. package/dist/history.cjs.js +1 -1
  24. package/dist/history.esm.js +8 -8
  25. package/dist/indent.cjs.js +1 -1
  26. package/dist/index.cjs.js +1 -1
  27. package/dist/italic.cjs.js +1 -1
  28. package/dist/line-height.cjs.js +1 -1
  29. package/dist/link.cjs.js +3 -3
  30. package/dist/list.cjs.js +1 -1
  31. package/dist/lite.cjs.js +1 -1
  32. package/dist/math.cjs.js +2 -2
  33. package/dist/media-manager.cjs.js +4 -4
  34. package/dist/merge-tag.cjs.js +3 -3
  35. package/dist/merge-tag.esm.js +1 -1
  36. package/dist/page-break.cjs.js +2 -2
  37. package/dist/preview.cjs.js +3 -3
  38. package/dist/print.cjs.js +1 -1
  39. package/dist/shared-config.cjs.js +1 -1
  40. package/dist/special-characters.cjs.js +3 -3
  41. package/dist/spell-check.cjs.js +1 -1
  42. package/dist/strikethrough.cjs.js +1 -1
  43. package/dist/table.cjs.js +3 -3
  44. package/dist/template.cjs.js +5 -5
  45. package/dist/text-alignment.cjs.js +1 -1
  46. package/dist/text-color.cjs.js +1 -1
  47. package/dist/underline.cjs.js +1 -1
  48. package/package.json +91 -47
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=new WeakMap;let x=null,S=!1,k=0;const E="User";function h(e){return k+=1,`${e}-${Date.now()}-${k}`}function v(e){if(!e)return null;const t=e instanceof Element?e:e.parentElement;return t?t.closest("[data-editora-editor]")||t.closest(".rte-editor")||t.closest(".editora-editor"):null}function w(e,t){return t.contains(e.commonAncestorContainer)}function I(){if(typeof window<"u"){const o=window.__editoraCommandEditorRoot;if(o instanceof HTMLElement){const a=o.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(o.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?o:null);if(a)return x=a,window.__editoraCommandEditorRoot=null,a}}const e=document.activeElement,t=e?v(e):null;if(t)return t;const r=window.getSelection();if(r&&r.rangeCount>0){const o=v(r.getRangeAt(0).commonAncestorContainer);if(o)return o}return x}function B(e){const t=C.get(e);if(t)return t;const r={root:e,comments:new Map,panelVisible:!1,panelElement:null,expandedComments:new Set,replyTexts:{},savedSelection:null,newCommentText:"",selectionChangeListener:null};return C.set(e,r),r}function f(){const e=I();return e?(x=e,B(e)):null}function T(e){const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return null;const r=t.getRangeAt(0);return w(r,e)?r.cloneRange():null}function R(e,t){if(!t.anchorId)return;const r=e.root.querySelector(`#${t.anchorId}`);r&&r.classList.toggle("rte-comment-anchor-resolved",t.resolved)}function b(e,t,r){const o=e.comments.get(t);if(!o||!o.anchorId)return;const a=e.root.querySelector(`#${o.anchorId}`);a&&a.classList.toggle("highlighted",r)}function $(e,t,r){t.onclick=o=>{o.preventDefault(),o.stopPropagation(),x=e.root,e.expandedComments.add(r),y(e,!0),m(e)}}function q(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);e.remove()}}function y(e,t){F(),H(e),e.panelVisible=t,e.root.setAttribute("data-rte-comments-open",t?"true":"false"),e.panelElement&&(e.panelElement.classList.toggle("is-open",t),e.panelElement.setAttribute("aria-hidden",t?"false":"true")),t?N(e):z(e)}function H(e){if(e.panelElement)return;const t=document.createElement("aside");t.className="rte-comments-panel",t.setAttribute("role","complementary"),t.setAttribute("aria-label","Comments"),t.setAttribute("aria-hidden","true"),window.getComputedStyle(e.root).position==="static"&&(e.root.style.position="relative"),e.root.appendChild(t),e.panelElement=t}function N(e){e.selectionChangeListener||(e.selectionChangeListener=()=>{const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return;const r=t.getRangeAt(0);w(r,e.root)&&(e.savedSelection=r.cloneRange(),x=e.root)},document.addEventListener("selectionchange",e.selectionChangeListener))}function z(e){e.selectionChangeListener&&(document.removeEventListener("selectionchange",e.selectionChangeListener),e.selectionChangeListener=null)}function V(e){return Array.from(e.comments.values()).sort((t,r)=>r.createdAt.localeCompare(t.createdAt))}function A(e){return new Date(e).toLocaleString()}function M(e,t){const r=e.expandedComments.has(t.id),o=document.createElement("article");o.className=`rte-comment-item${t.resolved?" resolved":""}`,o.innerHTML=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=new WeakMap;let x=null,S=!1,k=0;const E="User";function h(e){return k+=1,`${e}-${Date.now()}-${k}`}function v(e){if(!e)return null;const t=e instanceof Element?e:e.parentElement;return t?t.closest("[data-editora-editor]")||t.closest(".rte-editor")||t.closest(".editora-editor"):null}function w(e,t){return t.contains(e.commonAncestorContainer)}function I(){if(typeof window<"u"){const o=window.__editoraCommandEditorRoot;if(o instanceof HTMLElement){const a=o.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(o.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?o:null);if(a)return x=a,window.__editoraCommandEditorRoot=null,a}}const e=document.activeElement,t=e?v(e):null;if(t)return t;const r=window.getSelection();if(r&&r.rangeCount>0){const o=v(r.getRangeAt(0).commonAncestorContainer);if(o)return o}return x}function B(e){const t=C.get(e);if(t)return t;const r={root:e,comments:new Map,panelVisible:!1,panelElement:null,expandedComments:new Set,replyTexts:{},savedSelection:null,newCommentText:"",selectionChangeListener:null};return C.set(e,r),r}function f(){const e=I();return e?(x=e,B(e)):null}function T(e){const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return null;const r=t.getRangeAt(0);return w(r,e)?r.cloneRange():null}function R(e,t){if(!t.anchorId)return;const r=e.root.querySelector(`#${t.anchorId}`);r&&r.classList.toggle("rte-comment-anchor-resolved",t.resolved)}function b(e,t,r){const o=e.comments.get(t);if(!o||!o.anchorId)return;const a=e.root.querySelector(`#${o.anchorId}`);a&&a.classList.toggle("highlighted",r)}function $(e,t,r){t.onclick=o=>{o.preventDefault(),o.stopPropagation(),x=e.root,e.expandedComments.add(r),y(e,!0),m(e)}}function q(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);e.remove()}}function y(e,t){F(),H(e),e.panelVisible=t,e.root.setAttribute("data-rte-comments-open",t?"true":"false"),e.panelElement&&(e.panelElement.classList.toggle("is-open",t),e.panelElement.setAttribute("aria-hidden",t?"false":"true")),t?N(e):z(e)}function H(e){if(e.panelElement)return;const t=document.createElement("aside");t.className="rte-comments-panel",t.setAttribute("role","complementary"),t.setAttribute("aria-label","Comments"),t.setAttribute("aria-hidden","true"),window.getComputedStyle(e.root).position==="static"&&(e.root.style.position="relative"),e.root.appendChild(t),e.panelElement=t}function N(e){e.selectionChangeListener||(e.selectionChangeListener=()=>{const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return;const r=t.getRangeAt(0);w(r,e.root)&&(e.savedSelection=r.cloneRange(),x=e.root)},document.addEventListener("selectionchange",e.selectionChangeListener))}function z(e){e.selectionChangeListener&&(document.removeEventListener("selectionchange",e.selectionChangeListener),e.selectionChangeListener=null)}function V(e){return Array.from(e.comments.values()).sort((t,r)=>r.createdAt.localeCompare(t.createdAt))}function A(e){return new Date(e).toLocaleString()}function M(e,t){const r=e.expandedComments.has(t.id),o=document.createElement("article");o.className=`rte-comment-item${t.resolved?" resolved":""}`,o.innerHTML=`
2
2
  <header class="rte-comment-header">
3
3
  <div class="rte-comment-meta">
4
4
  <strong class="rte-comment-author">${t.author}</strong>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"]),l=e=>f.has(e.tagName)&&e.getAttribute("contenteditable")!=="true",h=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const r=t;if(r.getAttribute("contenteditable")==="true")return r}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},u=e=>{let n=e;for(;n&&n!==document.body;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(l(t))return t;if(t.getAttribute("contenteditable")==="true")break}n=n.parentNode}return null},C=(e,n)=>{const t=[],r=new Set,i=o=>{!o||r.has(o)||n.contains(o)&&l(o)&&(r.add(o),t.push(o))};if(e.collapsed)return i(u(e.startContainer)),t;const s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const d=o;if(!l(d))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const a=document.createRange();return a.selectNodeContents(d),e.compareBoundaryPoints(Range.END_TO_START,a)>0&&e.compareBoundaryPoints(Range.START_TO_END,a)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let c=s.nextNode();for(;c;)i(c),c=s.nextNode();return t.length===0&&i(u(e.commonAncestorContainer)),t},T=(e,n)=>{if(n===e.innerHTML)return;const t=window.execEditorCommand||window.executeEditorCommand;if(typeof t=="function")try{t("recordDomTransaction",e,n,e.innerHTML)}catch{}},g=e=>{const n=h();if(!n)return!1;const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const r=t.getRangeAt(0);if(!n.contains(r.commonAncestorContainer))return!1;const i=C(r,n);if(i.length===0)return!1;const s=n.innerHTML;return i.forEach(c=>{e==="rtl"?c.setAttribute("dir","rtl"):c.removeAttribute("dir")}),T(n,s),n.dispatchEvent(new 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 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:()=>{try{return g(null)}catch(e){return console.error("Failed to set LTR direction:",e),!1}},setDirectionRTL:()=>{try{return g("rtl")}catch(e){return console.error("Failed to set RTL direction:",e),!1}}},keymap:{"Mod-Shift-l":"setDirectionLTR","Mod-Shift-r":"setDirectionRTL"}});exports.DirectionPlugin=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"]),a=e=>f.has(e.tagName)&&e.getAttribute("contenteditable")!=="true",h=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const r=t;if(r.getAttribute("contenteditable")==="true")return r}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},u=e=>{let n=e;for(;n&&n!==document.body;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(a(t))return t;if(t.getAttribute("contenteditable")==="true")break}n=n.parentNode}return null},C=(e,n)=>{const t=[],r=new Set,i=o=>{!o||r.has(o)||n.contains(o)&&a(o)&&(r.add(o),t.push(o))};if(e.collapsed)return i(u(e.startContainer)),t;const s=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const d=o;if(!a(d))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(d)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const l=document.createRange();return l.selectNodeContents(d),e.compareBoundaryPoints(Range.END_TO_START,l)>0&&e.compareBoundaryPoints(Range.START_TO_END,l)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let c=s.nextNode();for(;c;)i(c),c=s.nextNode();return t.length===0&&i(u(e.commonAncestorContainer)),t},T=(e,n)=>{if(n===e.innerHTML)return;const t=window.execEditorCommand||window.executeEditorCommand;if(typeof t=="function")try{t("recordDomTransaction",e,n,e.innerHTML)}catch{}},g=e=>{const n=h();if(!n)return!1;const t=window.getSelection();if(!t||t.rangeCount===0)return!1;const r=t.getRangeAt(0);if(!n.contains(r.commonAncestorContainer))return!1;const i=C(r,n);if(i.length===0)return!1;const s=n.innerHTML;return i.forEach(c=>{e==="rtl"?c.setAttribute("dir","rtl"):c.removeAttribute("dir")}),T(n,s),n.dispatchEvent(new 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 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:()=>{try{return g(null)}catch(e){return console.error("Failed to set LTR direction:",e),!1}},setDirectionRTL:()=>{try{return g("rtl")}catch(e){return console.error("Failed to set RTL direction:",e),!1}}},keymap:{"Mod-Shift-l":"setDirectionLTR","Mod-Shift-r":"setDirectionRTL"}});exports.DirectionPlugin=p;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-D3pJyAsj.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-D3pJyAsj.js");exports.DocumentManagerPlugin=e.DocumentManagerPlugin;exports.getDocumentManagerConfig=e.getDocumentManagerConfig;exports.setDocumentManagerConfig=e.setDocumentManagerConfig;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=[{label:"Inline Value",value:"inline"},{label:"Responsive - 21x9",value:"21x9"},{label:"Responsive - 16x9",value:"16x9"},{label:"Responsive - 4x3",value:"4x3"},{label:"Responsive - 1x1",value:"1x1"}],m='[data-theme="dark"], .dark, .editora-theme-dark',u=new WeakMap,l=e=>(u.has(e)||u.set(e,{dialogElement:null,activeTab:"general",formData:{src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0}}),u.get(e));function v(e){return e?.matches(m)||e?.closest(m)||document.activeElement?.closest(m)?!0:document.body.matches(m)||document.documentElement.matches(m)}const x=()=>({name:"embedIframe",toolbar:[{label:"Embed Content",command:"openEmbedIframeDialog",icon:'<svg width="24" height="24" focusable="false"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-Shift-e",type:"button"}],commands:{openEmbedIframeDialog:e=>(y(e),!0)},keymap:{"Mod-Shift-e":"openEmbedIframeDialog"}});function y(e){if(!e){const o=document.activeElement;o&&o.closest("[data-editora-editor]")&&(e=o.closest("[data-editora-editor]"))}if(e||(e=document.querySelector("[data-editora-editor]")),!e){console.warn("Editor element not found");return}const t=l(e);t.formData={src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0},t.activeTab="general";const a=document.createElement("div");a.className="rte-dialog-overlay rte-embed-iframe-overlay",v(e)&&a.classList.add("rte-theme-dark"),a.onclick=()=>f(e);const r=document.createElement("div");r.className="rte-dialog-content embed-iframe-dialog",r.onclick=o=>o.stopPropagation(),r.innerHTML=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=[{label:"Inline Value",value:"inline"},{label:"Responsive - 21x9",value:"21x9"},{label:"Responsive - 16x9",value:"16x9"},{label:"Responsive - 4x3",value:"4x3"},{label:"Responsive - 1x1",value:"1x1"}],m='[data-theme="dark"], .dark, .editora-theme-dark',u=new WeakMap,l=e=>(u.has(e)||u.set(e,{dialogElement:null,activeTab:"general",formData:{src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0}}),u.get(e));function v(e){return e?.matches(m)||e?.closest(m)||document.activeElement?.closest(m)?!0:document.body.matches(m)||document.documentElement.matches(m)}const x=()=>({name:"embedIframe",toolbar:[{label:"Embed Content",command:"openEmbedIframeDialog",icon:'<svg width="24" height="24" focusable="false"><path d="M19 6V5H5v14h2A13 13 0 0 1 19 6Zm0 1.4c-.8.8-1.6 2.4-2.2 4.6H19V7.4Zm0 5.6h-2.4c-.4 1.8-.6 3.8-.6 6h3v-6Zm-4 6c0-2.2.2-4.2.6-6H13c-.7 1.8-1.1 3.8-1.1 6h3Zm-4 0c0-2.2.4-4.2 1-6H9.6A12 12 0 0 0 8 19h3ZM4 3h16c.6 0 1 .4 1 1v16c0 .6-.4 1-1 1H4a1 1 0 0 1-1-1V4c0-.6.4-1 1-1Zm11.8 9c.4-1.9 1-3.4 1.8-4.5a9.2 9.2 0 0 0-4 4.5h2.2Zm-3.4 0a12 12 0 0 1 2.8-4 12 12 0 0 0-5 4h2.2Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-Shift-e",type:"button"}],commands:{openEmbedIframeDialog:e=>(y(e),!0)},keymap:{"Mod-Shift-e":"openEmbedIframeDialog"}});function y(e){if(!e){const o=document.activeElement;o&&o.closest("[data-editora-editor]")&&(e=o.closest("[data-editora-editor]"))}if(e||(e=document.querySelector("[data-editora-editor]")),!e){console.warn("Editor element not found");return}const t=l(e);t.formData={src:"",selectedSize:"inline",width:"100%",height:"400px",constrainProportions:!0,name:"",title:"",longDescription:"",descriptionUrl:"",showBorder:!0,enableScrollbar:!0},t.activeTab="general";const a=document.createElement("div");a.className="rte-dialog-overlay rte-embed-iframe-overlay",v(e)&&a.classList.add("rte-theme-dark"),a.onclick=()=>f(e);const r=document.createElement("div");r.className="rte-dialog-content embed-iframe-dialog",r.onclick=o=>o.stopPropagation(),r.innerHTML=`
2
2
  <div class="rte-dialog-header">
3
3
  <h3>Embed Iframe</h3>
4
4
  <button class="rte-dialog-close">×</button>
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d={all:{name:"All",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪","🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊","🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂","⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️","📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌","🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]},symbols:{name:"Symbols",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","⬆️","⬇️","⬅️","➡️","🔄","🔁","🔀","🔔","🔕","⏰","⌛","⏳"]},people:{name:"People",emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪"]},"animals-nature":{name:"Animals & Nature",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊"]},"food-drink":{name:"Food & Drink",emojis:["🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂"]},activity:{name:"Activity",emojis:["⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🥈","🥉"]},"travel-places":{name:"Travel & Places",emojis:["🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️"]},objects:{name:"Objects",emojis:["📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌"]},flags:{name:"Flags",emojis:["🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]}},p={"💙":"blue heart","💚":"green heart","💛":"yellow heart","🖤":"black heart","🤍":"white heart","🤎":"brown heart","☑️":"check box with check","🔴":"red circle","🟢":"green circle","🟡":"yellow circle","🔵":"blue circle","⬆️":"up arrow","⬇️":"down arrow","⬅️":"left arrow","➡️":"right arrow","🔄":"counterclockwise arrows","🔁":"repeat button","🔀":"shuffle tracks","🔔":"bell","🔕":"muted bell","⏰":"alarm clock","⏳":"hourglass not done","⌛":"hourglass done","♠️":"spade suit","♥️":"heart suit","♦️":"diamond suit","♣️":"club suit","🚫":"prohibited","⭕":"hollow red circle","❎":"cross mark button","😐":"neutral face","😑":"expressionless face","😬":"grimacing face","🙄":"face with rolling eyes","😏":"smirking face","😌":"relieved face","🤩":"star struck","😜":"winking face with tongue","😝":"squinting face with tongue","🤪":"zany face","😢":"crying face","😥":"sad but relieved face","😓":"downcast face with sweat","😱":"face screaming in fear","😨":"fearful face","🤗":"hugging face","🤭":"face with hand over mouth","🤫":"shushing face","🤥":"lying face","👌":"ok hand","✌️":"victory hand","🤞":"crossed fingers","🙌":"raising hands","💪":"flexed biceps","🐔":"chicken","🐧":"penguin","🐦":"bird","🐤":"baby chick","🦆":"duck","🦅":"eagle","🐺":"wolf","🦄":"unicorn","🐝":"honeybee","🐞":"lady beetle","🦋":"butterfly","🐢":"turtle","🐍":"snake","🦖":"t-rex","🌿":"herb","🍀":"four leaf clover","🍁":"maple leaf","🍂":"fallen leaf","🌊":"water wave","❄️":"snowflake","☁️":"cloud","⛈️":"cloud with lightning and rain","🌪️":"tornado","🍐":"pear","🍊":"tangerine","🍋":"lemon","🍑":"peach","🥝":"kiwi fruit","🥑":"avocado","🍆":"eggplant","🌽":"ear of corn","🥕":"carrot","🥔":"potato","🍞":"bread","🥐":"croissant","🥖":"baguette bread","🧀":"cheese wedge","🍖":"meat on bone","🍗":"poultry leg","🥩":"cut of meat","🍦":"soft ice cream","🍨":"ice cream","🍫":"chocolate bar","🍬":"candy","🥛":"glass of milk","🧃":"beverage box","🍹":"tropical drink","🥂":"clinking glasses","🏓":"ping pong","🥊":"boxing glove","🥋":"martial arts uniform","⛳":"flag in hole","🏹":"bow and arrow","🎿":"skis","⛷️":"skier","🏂":"snowboarder","🎤":"microphone","🎬":"clapper board","🎨":"artist palette","🧩":"puzzle piece","🪀":"yo-yo","🚇":"metro","🚉":"station","🚊":"tram","🚝":"monorail","🛻":"pickup truck","🚐":"minibus","🗺️":"world map","🧭":"compass","⛰️":"mountain","🏔️":"snow capped mountain","🌋":"volcano","🏜️":"desert","🏕️":"camping","🏙️":"cityscape","🌆":"city at dusk","🌃":"night with stars","📦":"package","📫":"closed mailbox with raised flag","📬":"open mailbox with raised flag","📭":"open mailbox with lowered flag","🧾":"receipt","💳":"credit card","💰":"money bag","🪙":"coin","🔋":"battery","🔌":"electric plug","🧯":"fire extinguisher","🪜":"ladder","🪞":"mirror","🧹":"broom","🧸":"teddy bear"};let c=null,n="all",l="",s=null;const j='[data-theme="dark"], .dark, .editora-theme-dark',h=()=>({name:"emojis",toolbar:[{label:"Insert Emoji",command:"openEmojiDialog",icon:'<svg width="24" height="24" focusable="false"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-Shift-j",type:"button"}],commands:{openEmojiDialog:(o,t)=>{const e=t?.contentElement||u();return e?(v(e),!0):!1},insertEmoji:(o,t)=>{if(!o)return!1;const e=t?.contentElement||u();if(!e)return!1;try{return f(o,e),!0}catch{return!1}}},keymap:{"Mod-Shift-j":"openEmojiDialog"}});function v(o){n="all",l="";const t=window.getSelection();s=null,t&&t.rangeCount>0&&o.contains(t.anchorNode)&&(s=t.getRangeAt(0).cloneRange());const e=document.createElement("div");e.className="emojis-overlay",y(o)&&e.classList.add("rte-ui-theme-dark"),e.onclick=g;const r=document.createElement("div");r.className="emojis-dialog",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.onclick=a=>a.stopPropagation();const i=Object.keys(d);r.innerHTML=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d={all:{name:"All",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪","🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊","🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂","⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️","📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌","🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]},symbols:{name:"Symbols",emojis:["❤️","💔","💙","💚","💛","🖤","🤍","🤎","✔️","❌","☑️","❗","❓","⚠️","💯","➕","➖","✖️","➗","♻️","⚡","🔥","✨","⭐","⭕","🚫","⬆️","⬇️","⬅️","➡️","🔄","🔁","🔀","🔔","🔕","⏰","⌛","⏳"]},people:{name:"People",emojis:["😀","😃","😄","😁","😆","😅","😂","🤣","😊","😇","🙂","🙃","😉","😍","😘","😎","🤓","😐","😑","😬","🙄","😏","😌","🤩","🥳","🤔","😴","😭","😢","😡","🤯","👍","👎","👌","✌️","🤞","🙏","👏","🙌","💪"]},"animals-nature":{name:"Animals & Nature",emojis:["🐶","🐱","🐭","🐹","🐰","🦊","🐻","🐼","🐨","🐯","🦁","🐮","🐷","🐸","🐵","🐔","🐧","🐦","🦆","🦅","🦄","🐝","🦋","🌲","🌳","🌴","🌵","🌸","🌼","🌻","☀️","🌙","⭐","🌈","🌧️","❄️","🌊"]},"food-drink":{name:"Food & Drink",emojis:["🍎","🍌","🍉","🍇","🍓","🍒","🍍","🥭","🍐","🍊","🍋","🍑","🥝","🥑","🍔","🍟","🍕","🌭","🥪","🌮","🌯","🍣","🍜","🍰","🧁","🍩","🍪","🍫","☕","🍵","🥤","🍺","🍷","🍸","🍹","🥂"]},activity:{name:"Activity",emojis:["⚽","🏀","🏈","⚾","🎾","🏐","🏉","🎮","🎯","🎳","🎲","♟️","🏃","🚴","🏊","🏋️","🧘","🎸","🎹","🥁","🎺","🎤","🏆","🥇","🥈","🥉"]},"travel-places":{name:"Travel & Places",emojis:["🚗","🚕","🚌","🚎","🚓","🚑","🚒","✈️","🚀","🚁","🚤","🛳️","🚢","🏠","🏢","🏬","🏫","🏥","🏰","🗼","🗽","⛩️","🕌","🌍","🌎","🌏","🏖️","🏝️"]},objects:{name:"Objects",emojis:["📱","💻","🖥️","⌨️","🖱️","📷","📸","🎥","📹","📚","📖","📝","📄","📂","🔒","🔑","🗝️","💡","🔦","🕯️","🧰","🛠️","🔧","⚙️","📦","💳","💰","🔋","🔌"]},flags:{name:"Flags",emojis:["🇮🇳","🇺🇸","🇬🇧","🇨🇦","🇦🇺","🇩🇪","🇫🇷","🇪🇸","🇮🇹","🇯🇵","🇰🇷","🇨🇳","🇧🇷","🇲🇽","🇷🇺","🇿🇦","🇳🇿"]}},p={"💙":"blue heart","💚":"green heart","💛":"yellow heart","🖤":"black heart","🤍":"white heart","🤎":"brown heart","☑️":"check box with check","🔴":"red circle","🟢":"green circle","🟡":"yellow circle","🔵":"blue circle","⬆️":"up arrow","⬇️":"down arrow","⬅️":"left arrow","➡️":"right arrow","🔄":"counterclockwise arrows","🔁":"repeat button","🔀":"shuffle tracks","🔔":"bell","🔕":"muted bell","⏰":"alarm clock","⏳":"hourglass not done","⌛":"hourglass done","♠️":"spade suit","♥️":"heart suit","♦️":"diamond suit","♣️":"club suit","🚫":"prohibited","⭕":"hollow red circle","❎":"cross mark button","😐":"neutral face","😑":"expressionless face","😬":"grimacing face","🙄":"face with rolling eyes","😏":"smirking face","😌":"relieved face","🤩":"star struck","😜":"winking face with tongue","😝":"squinting face with tongue","🤪":"zany face","😢":"crying face","😥":"sad but relieved face","😓":"downcast face with sweat","😱":"face screaming in fear","😨":"fearful face","🤗":"hugging face","🤭":"face with hand over mouth","🤫":"shushing face","🤥":"lying face","👌":"ok hand","✌️":"victory hand","🤞":"crossed fingers","🙌":"raising hands","💪":"flexed biceps","🐔":"chicken","🐧":"penguin","🐦":"bird","🐤":"baby chick","🦆":"duck","🦅":"eagle","🐺":"wolf","🦄":"unicorn","🐝":"honeybee","🐞":"lady beetle","🦋":"butterfly","🐢":"turtle","🐍":"snake","🦖":"t-rex","🌿":"herb","🍀":"four leaf clover","🍁":"maple leaf","🍂":"fallen leaf","🌊":"water wave","❄️":"snowflake","☁️":"cloud","⛈️":"cloud with lightning and rain","🌪️":"tornado","🍐":"pear","🍊":"tangerine","🍋":"lemon","🍑":"peach","🥝":"kiwi fruit","🥑":"avocado","🍆":"eggplant","🌽":"ear of corn","🥕":"carrot","🥔":"potato","🍞":"bread","🥐":"croissant","🥖":"baguette bread","🧀":"cheese wedge","🍖":"meat on bone","🍗":"poultry leg","🥩":"cut of meat","🍦":"soft ice cream","🍨":"ice cream","🍫":"chocolate bar","🍬":"candy","🥛":"glass of milk","🧃":"beverage box","🍹":"tropical drink","🥂":"clinking glasses","🏓":"ping pong","🥊":"boxing glove","🥋":"martial arts uniform","⛳":"flag in hole","🏹":"bow and arrow","🎿":"skis","⛷️":"skier","🏂":"snowboarder","🎤":"microphone","🎬":"clapper board","🎨":"artist palette","🧩":"puzzle piece","🪀":"yo-yo","🚇":"metro","🚉":"station","🚊":"tram","🚝":"monorail","🛻":"pickup truck","🚐":"minibus","🗺️":"world map","🧭":"compass","⛰️":"mountain","🏔️":"snow capped mountain","🌋":"volcano","🏜️":"desert","🏕️":"camping","🏙️":"cityscape","🌆":"city at dusk","🌃":"night with stars","📦":"package","📫":"closed mailbox with raised flag","📬":"open mailbox with raised flag","📭":"open mailbox with lowered flag","🧾":"receipt","💳":"credit card","💰":"money bag","🪙":"coin","🔋":"battery","🔌":"electric plug","🧯":"fire extinguisher","🪜":"ladder","🪞":"mirror","🧹":"broom","🧸":"teddy bear"};let c=null,n="all",l="",s=null;const j='[data-theme="dark"], .dark, .editora-theme-dark',h=()=>({name:"emojis",toolbar:[{label:"Insert Emoji",command:"openEmojiDialog",icon:'<svg width="24" height="24" focusable="false"><path d="M9 11c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm6 0c.6 0 1-.4 1-1s-.4-1-1-1a1 1 0 0 0-1 1c0 .6.4 1 1 1Zm-3 5.5c2.1 0 4-1.5 4.4-3.5H7.6c.5 2 2.3 3.5 4.4 3.5ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm0 14.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-Shift-j",type:"button"}],commands:{openEmojiDialog:(o,t)=>{const e=t?.contentElement||u();return e?(v(e),!0):!1},insertEmoji:(o,t)=>{if(!o)return!1;const e=t?.contentElement||u();if(!e)return!1;try{return f(o,e),!0}catch{return!1}}},keymap:{"Mod-Shift-j":"openEmojiDialog"}});function v(o){n="all",l="";const t=window.getSelection();s=null,t&&t.rangeCount>0&&o.contains(t.anchorNode)&&(s=t.getRangeAt(0).cloneRange());const e=document.createElement("div");e.className="emojis-overlay",y(o)&&e.classList.add("rte-ui-theme-dark"),e.onclick=g;const r=document.createElement("div");r.className="emojis-dialog",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.onclick=a=>a.stopPropagation();const i=Object.keys(d);r.innerHTML=`
2
2
  <div class="rte-dialog-header emojis-header">
3
3
  <h3>Insert Emojis</h3>
4
4
  <button class="rte-dialog-close emojis-close">×</button>
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=()=>({name:"fontFamily",marks:{fontFamily:{attrs:{family:{default:null}},parseDOM:[{tag:'span[style*="font-family"]',getAttrs:e=>{const t=e.style.fontFamily;return t?{family:t}:!1}},{tag:"font[face]",getAttrs:e=>{const t=e.getAttribute("face");return t?{family:t}:!1}}],toDOM:e=>["span",{style:`font-family: ${e.attrs?.family}`},0]}},toolbar:[{label:"Font Family",command:"setFontFamily",type:"inline-menu",options:[{label:"Arial",value:"Arial, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Impact",value:"Impact, sans-serif"}],icon:'<svg fill="#000000" width="24px" height="24px" viewBox="0 0 24 24" 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="M15 4h7v2h-7zm1 4h6v2h-6zm2 4h4v2h-4zM9.307 4l-6 16h2.137l1.875-5h6.363l1.875 5h2.137l-6-16H9.307zm-1.239 9L10.5 6.515 12.932 13H8.068z"></path></g></svg>'}],commands:{setFontFamily:e=>{if(!e)return!1;try{return b(e),!0}catch(n){return console.error("Failed to set font family:",n),!1}}},keymap:{"Mod-Shift-f":"setFontFamily"}}),p="p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre";function h(e){return!!e.cloneContents().querySelector(p)}function g(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')}function f(e){e&&e.dispatchEvent(new Event("input",{bubbles:!0}))}function S(e,n){const t=document.createElement("span");for(const a of Array.from(e.attributes))a.name==="face"||a.name==="style"||t.setAttribute(a.name,a.value);const o=e.getAttribute("style");for(o&&t.setAttribute("style",o),t.style.fontFamily=n,t.classList.add("rte-font-family");e.firstChild;)t.appendChild(e.firstChild);e.parentNode?.replaceChild(t,e)}function A(e){e.querySelectorAll("span").forEach(t=>{t.childElementCount>0||(t.textContent||"").trim().length>0||t.remove()})}function C(e,n,t){if(h(e))return!1;const o=document.createElement("span");o.style.fontFamily=t,o.className="rte-font-family";try{e.surroundContents(o)}catch{const l=e.extractContents();o.appendChild(l),e.insertNode(o)}const a=document.createRange();return a.selectNodeContents(o),n.removeAllRanges(),n.addRange(a),!0}function b(e){const n=window.getSelection();if(!n||n.rangeCount===0)return;const t=n.getRangeAt(0),o=t.cloneRange(),a=g(t.commonAncestorContainer);if(t.collapsed)return;const l=t.commonAncestorContainer,i=F(l);if(i&&v(t,i)){i.style.fontFamily=e,i.classList.add("rte-font-family");const r=document.createRange();r.selectNodeContents(i),n.removeAllRanges(),n.addRange(r),f(a);return}if(!a)return;const m=new Set(Array.from(a.querySelectorAll("font[face]"))),u=new Set(Array.from(a.querySelectorAll("span[style*='font-family']")));a.focus({preventScroll:!0});try{document.execCommand("styleWithCSS",!1,"true")}catch{}const d=e.split(",").map(r=>r.trim().replace(/^['"]|['"]$/g,"")).filter(Boolean)[0]||"Arial";let s=document.execCommand("fontName",!1,d),c=!1;Array.from(a.querySelectorAll("font[face]")).forEach(r=>{m.has(r)||(S(r,e),c=!0)}),Array.from(a.querySelectorAll("span[style*='font-family']")).forEach(r=>{u.has(r)||(r.style.fontFamily=e,r.classList.add("rte-font-family"),c=!0)}),s||(s=C(o,n,e)),(s||c)&&(A(a),f(a))}function F(e){let n=e;for(;n;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(t.tagName==="SPAN"&&t.style.fontFamily)return t}n=n.parentNode}return null}function v(e,n){const t=e.startContainer,o=e.endContainer,a=n.contains(t)||t.nodeType===Node.TEXT_NODE&&t.parentElement===n,l=n.contains(o)||o.nodeType===Node.TEXT_NODE&&o.parentElement===n;return a&&l}exports.FontFamilyPlugin=y;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const y=()=>({name:"fontFamily",marks:{fontFamily:{attrs:{family:{default:null}},parseDOM:[{tag:'span[style*="font-family"]',getAttrs:e=>{const t=e.style.fontFamily;return t?{family:t}:!1}},{tag:"font[face]",getAttrs:e=>{const t=e.getAttribute("face");return t?{family:t}:!1}}],toDOM:e=>["span",{style:`font-family: ${e.attrs?.family}`},0]}},toolbar:[{label:"Font Family",command:"setFontFamily",type:"inline-menu",options:[{label:"Arial",value:"Arial, sans-serif"},{label:"Times New Roman",value:"Times New Roman, serif"},{label:"Courier New",value:"Courier New, monospace"},{label:"Georgia",value:"Georgia, serif"},{label:"Verdana",value:"Verdana, sans-serif"},{label:"Helvetica",value:"Helvetica, Arial, sans-serif"},{label:"Trebuchet MS",value:"Trebuchet MS, sans-serif"},{label:"Impact",value:"Impact, sans-serif"}],icon:'<svg fill="#000000" width="24px" height="24px" viewBox="0 0 24 24" 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="M15 4h7v2h-7zm1 4h6v2h-6zm2 4h4v2h-4zM9.307 4l-6 16h2.137l1.875-5h6.363l1.875 5h2.137l-6-16H9.307zm-1.239 9L10.5 6.515 12.932 13H8.068z"></path></g></svg>'}],commands:{setFontFamily:e=>{if(!e)return!1;try{return b(e),!0}catch(n){return console.error("Failed to set font family:",n),!1}}},keymap:{"Mod-Shift-f":"setFontFamily"}}),p="p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre";function h(e){return!!e.cloneContents().querySelector(p)}function g(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')}function f(e){e&&e.dispatchEvent(new Event("input",{bubbles:!0}))}function S(e,n){const t=document.createElement("span");for(const a of Array.from(e.attributes))a.name==="face"||a.name==="style"||t.setAttribute(a.name,a.value);const o=e.getAttribute("style");for(o&&t.setAttribute("style",o),t.style.fontFamily=n,t.classList.add("rte-font-family");e.firstChild;)t.appendChild(e.firstChild);e.parentNode?.replaceChild(t,e)}function A(e){e.querySelectorAll("span").forEach(t=>{t.childElementCount>0||(t.textContent||"").trim().length>0||t.remove()})}function C(e,n,t){if(h(e))return!1;const o=document.createElement("span");o.style.fontFamily=t,o.className="rte-font-family";try{e.surroundContents(o)}catch{const l=e.extractContents();o.appendChild(l),e.insertNode(o)}const a=document.createRange();return a.selectNodeContents(o),n.removeAllRanges(),n.addRange(a),!0}function b(e){const n=window.getSelection();if(!n||n.rangeCount===0)return;const t=n.getRangeAt(0),o=t.cloneRange(),a=g(t.commonAncestorContainer);if(t.collapsed)return;const l=t.commonAncestorContainer,i=F(l);if(i&&v(t,i)){i.style.fontFamily=e,i.classList.add("rte-font-family");const r=document.createRange();r.selectNodeContents(i),n.removeAllRanges(),n.addRange(r),f(a);return}if(!a)return;const u=new Set(Array.from(a.querySelectorAll("font[face]"))),m=new Set(Array.from(a.querySelectorAll("span[style*='font-family']")));a.focus({preventScroll:!0});try{document.execCommand("styleWithCSS",!1,"true")}catch{}const d=e.split(",").map(r=>r.trim().replace(/^['"]|['"]$/g,"")).filter(Boolean)[0]||"Arial";let s=document.execCommand("fontName",!1,d),c=!1;Array.from(a.querySelectorAll("font[face]")).forEach(r=>{u.has(r)||(S(r,e),c=!0)}),Array.from(a.querySelectorAll("span[style*='font-family']")).forEach(r=>{m.has(r)||(r.style.fontFamily=e,r.classList.add("rte-font-family"),c=!0)}),s||(s=C(o,n,e)),(s||c)&&(A(a),f(a))}function F(e){let n=e;for(;n;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(t.tagName==="SPAN"&&t.style.fontFamily)return t}n=n.parentNode}return null}function v(e,n){const t=e.startContainer,o=e.endContainer,a=n.contains(t)||t.nodeType===Node.TEXT_NODE&&t.parentElement===n,l=n.contains(o)||o.nodeType===Node.TEXT_NODE&&o.parentElement===n;return a&&l}exports.FontFamilyPlugin=y;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=()=>({name:"fontSize",marks:{fontSize:{attrs:{size:{default:null}},parseDOM:[{tag:'span[style*="font-size"]',getAttrs:e=>{const t=e.style.fontSize;return t?{size:t}:!1}},{tag:"font[size]",getAttrs:e=>{const t=e.getAttribute("size");return t?{size:t}:!1}}],toDOM:e=>["span",{style:`font-size: ${e.attrs?.size}`},0]}},toolbar:[{label:"Font Size",command:"fontSize",type:"group",items:[{label:"Decrease Font Size",command:"decreaseFontSize",icon:"−",type:"button"},{label:"Font Size",command:"setFontSize",type:"input",placeholder:"14"},{label:"Increase Font Size",command:"increaseFontSize",icon:"+",type:"button"}]}],commands:{decreaseFontSize:()=>{try{return g(-2),y(),!0}catch(e){return console.error("Failed to decrease font size:",e),!1}},increaseFontSize:()=>{try{return g(2),y(),!0}catch(e){return console.error("Failed to increase font size:",e),!1}},setFontSize:e=>{if(!e)return!1;try{const t=e.trim().match(/^(\d+(?:\.\d+)?)(px|em|rem)?$/i);if(!t)return!1;const n=parseFloat(t[1]),i=t[2]?.toLowerCase()||"px";return i==="px"&&(n<8||n>72)||(i==="em"||i==="rem")&&(n<.5||n>5)?!1:(C(n,i),!0)}catch(o){return console.error("Failed to set font size:",o),!1}}},keymap:{}}),A="p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre",z={"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32,"xxx-large":48,smaller:13,larger:18};function p(e){const o=e.trim().toLowerCase(),t=o.match(/^(\d+(?:\.\d+)?)(px|em|rem)$/i);if(t)return{value:parseFloat(t[1]),unit:t[2].toLowerCase()};const n=z[o];return n?{value:n,unit:"px"}:null}function N(e){return e.trim().toLowerCase()in z}function x(e){return!!e.cloneContents().querySelector(A)}function w(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')}function m(e){e&&e.dispatchEvent(new Event("input",{bubbles:!0}))}function E(e,o){const t=document.createElement("span");for(const i of Array.from(e.attributes))i.name==="size"||i.name==="style"||t.setAttribute(i.name,i.value);const n=e.getAttribute("style");for(n&&t.setAttribute("style",n),t.style.fontSize=o;e.firstChild;)t.appendChild(e.firstChild);e.parentNode?.replaceChild(t,e)}function T(e,o,t,n){const i=Array.from(e.querySelectorAll("font[size], [style*='font-size']")),r=s=>{if(!n||!s.isConnected)return!1;try{if(typeof n.intersectsNode=="function")return n.intersectsNode(s)}catch{}const a=document.createRange();return a.selectNodeContents(s),n.compareBoundaryPoints(Range.END_TO_START,a)>0&&n.compareBoundaryPoints(Range.START_TO_END,a)<0};let c=!1;return i.forEach(s=>{const a=!o.has(s),u=s.tagName==="FONT",l=N(s.style.fontSize||""),f=r(s);if(!(!a&&!f)&&!(!a&&!u&&!l)){if(c=!0,s.tagName==="FONT"){E(s,t);return}s.style.fontSize=t}}),c}function S(e){e.querySelectorAll("span").forEach(t=>{t.childElementCount>0||(t.textContent||"").trim().length>0||t.remove()})}function R(e,o,t){if(x(e))return!1;const n=document.createElement("span");n.style.fontSize=t;try{e.surroundContents(n)}catch{const r=e.extractContents();n.appendChild(r),e.insertNode(n)}const i=document.createRange();return i.selectNodeContents(n),o.removeAllRanges(),o.addRange(i),!0}function g(e){const o=window.getSelection();if(!o||o.rangeCount===0)return;const{value:t,unit:n}=h();let i=e;(n==="em"||n==="rem")&&(i=e*.125);let r;n==="px"?r=e<0?Math.max(8,t+e):Math.min(72,t+e):r=e<0?Math.max(.5,t+i):Math.min(5,t+i),C(r,n)}function h(){const e=window.getSelection();if(!e||e.rangeCount===0)return{value:14,unit:"px"};const t=e.getRangeAt(0).startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if(n){const i=n.style?.fontSize;if(i){const a=p(i);if(a)return a}const c=window.getComputedStyle(n).fontSize,s=p(c);if(s)return s}return{value:14,unit:"px"}}function C(e,o="px"){const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),i=n.cloneRange(),r=w(n.commonAncestorContainer);if(n.collapsed)return;const c=`${e}${o}`,s=n.commonAncestorContainer,a=v(s);if(a&&O(n,a)){a.style.fontSize=c,m(r);const d=document.createRange();d.selectNodeContents(a),t.removeAllRanges(),t.addRange(d);return}if(!r)return;const u=new Set(Array.from(r.querySelectorAll("font[size], [style*='font-size']")));r.focus({preventScroll:!0});try{document.execCommand("styleWithCSS",!1,"true")}catch{}let l=document.execCommand("fontSize",!1,"7");const f=t.rangeCount>0?t.getRangeAt(0).cloneRange():i,F=T(r,u,c,f);if(l&&F){S(r),m(r);return}l=R(i,t,c),l&&(S(r),m(r))}function v(e){let o=e;for(;o&&o!==document.body;){if(o.nodeType===Node.ELEMENT_NODE){const t=o;if(t.tagName==="SPAN"&&t.style.fontSize)return t}o=o.parentNode}return null}function O(e,o){const t=e.startContainer,n=e.endContainer;return o.contains(t)&&o.contains(n)}function y(){setTimeout(()=>{const{value:e,unit:o}=h(),t=window.getSelection();if(!t||t.rangeCount===0)return;let n=null,r=t.getRangeAt(0).startContainer;for(;r;){if(r instanceof HTMLElement&&(r.classList.contains("rte-editor")||r.classList.contains("editora-editor")||r.hasAttribute("data-editora-editor"))){n=r;break}r=r.parentNode}if(!n)return;const c=n.querySelector(".rte-toolbar-wrapper, .editora-toolbar-container")||n,s=Array.from(c.querySelectorAll('input[data-command="setFontSize"], input.editora-toolbar-input.font-size, input.rte-toolbar-input.font-size, input[title="Font Size"]'));if(s.length===0)return;const u=`${e%1===0?e.toString():e.toFixed(2).replace(/\.?0+$/,"")}${o}`;s.forEach(l=>{l.value=u})},10)}exports.FontSizePlugin=b;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const b=()=>({name:"fontSize",marks:{fontSize:{attrs:{size:{default:null}},parseDOM:[{tag:'span[style*="font-size"]',getAttrs:e=>{const t=e.style.fontSize;return t?{size:t}:!1}},{tag:"font[size]",getAttrs:e=>{const t=e.getAttribute("size");return t?{size:t}:!1}}],toDOM:e=>["span",{style:`font-size: ${e.attrs?.size}`},0]}},toolbar:[{label:"Font Size",command:"fontSize",type:"group",items:[{label:"Decrease Font Size",command:"decreaseFontSize",icon:"−",type:"button"},{label:"Font Size",command:"setFontSize",type:"input",placeholder:"14"},{label:"Increase Font Size",command:"increaseFontSize",icon:"+",type:"button"}]}],commands:{decreaseFontSize:()=>{try{return g(-2),y(),!0}catch(e){return console.error("Failed to decrease font size:",e),!1}},increaseFontSize:()=>{try{return g(2),y(),!0}catch(e){return console.error("Failed to increase font size:",e),!1}},setFontSize:e=>{if(!e)return!1;try{const t=e.trim().match(/^(\d+(?:\.\d+)?)(px|em|rem)?$/i);if(!t)return!1;const n=parseFloat(t[1]),i=t[2]?.toLowerCase()||"px";return i==="px"&&(n<8||n>72)||(i==="em"||i==="rem")&&(n<.5||n>5)?!1:(C(n,i),!0)}catch(o){return console.error("Failed to set font size:",o),!1}}},keymap:{}}),A="p,div,li,ul,ol,table,thead,tbody,tfoot,tr,td,th,h1,h2,h3,h4,h5,h6,blockquote,pre",z={"xx-small":9,"x-small":10,small:13,medium:16,large:18,"x-large":24,"xx-large":32,"xxx-large":48,smaller:13,larger:18};function p(e){const o=e.trim().toLowerCase(),t=o.match(/^(\d+(?:\.\d+)?)(px|em|rem)$/i);if(t)return{value:parseFloat(t[1]),unit:t[2].toLowerCase()};const n=z[o];return n?{value:n,unit:"px"}:null}function N(e){return e.trim().toLowerCase()in z}function x(e){return!!e.cloneContents().querySelector(A)}function w(e){return(e.nodeType===Node.ELEMENT_NODE?e:e.parentElement)?.closest('[contenteditable="true"]')||document.querySelector('[contenteditable="true"]')}function m(e){e&&e.dispatchEvent(new Event("input",{bubbles:!0}))}function E(e,o){const t=document.createElement("span");for(const i of Array.from(e.attributes))i.name==="size"||i.name==="style"||t.setAttribute(i.name,i.value);const n=e.getAttribute("style");for(n&&t.setAttribute("style",n),t.style.fontSize=o;e.firstChild;)t.appendChild(e.firstChild);e.parentNode?.replaceChild(t,e)}function T(e,o,t,n){const i=Array.from(e.querySelectorAll("font[size], [style*='font-size']")),r=s=>{if(!n||!s.isConnected)return!1;try{if(typeof n.intersectsNode=="function")return n.intersectsNode(s)}catch{}const a=document.createRange();return a.selectNodeContents(s),n.compareBoundaryPoints(Range.END_TO_START,a)>0&&n.compareBoundaryPoints(Range.START_TO_END,a)<0};let c=!1;return i.forEach(s=>{const a=!o.has(s),u=s.tagName==="FONT",l=N(s.style.fontSize||""),f=r(s);if(!(!a&&!f)&&!(!a&&!u&&!l)){if(c=!0,s.tagName==="FONT"){E(s,t);return}s.style.fontSize=t}}),c}function S(e){e.querySelectorAll("span").forEach(t=>{t.childElementCount>0||(t.textContent||"").trim().length>0||t.remove()})}function R(e,o,t){if(x(e))return!1;const n=document.createElement("span");n.style.fontSize=t;try{e.surroundContents(n)}catch{const r=e.extractContents();n.appendChild(r),e.insertNode(n)}const i=document.createRange();return i.selectNodeContents(n),o.removeAllRanges(),o.addRange(i),!0}function g(e){const o=window.getSelection();if(!o||o.rangeCount===0)return;const{value:t,unit:n}=h();let i=e;(n==="em"||n==="rem")&&(i=e*.125);let r;n==="px"?r=e<0?Math.max(8,t+e):Math.min(72,t+e):r=e<0?Math.max(.5,t+i):Math.min(5,t+i),C(r,n)}function h(){const e=window.getSelection();if(!e||e.rangeCount===0)return{value:14,unit:"px"};const t=e.getRangeAt(0).startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t;if(n){const i=n.style?.fontSize;if(i){const a=p(i);if(a)return a}const c=window.getComputedStyle(n).fontSize,s=p(c);if(s)return s}return{value:14,unit:"px"}}function C(e,o="px"){const t=window.getSelection();if(!t||t.rangeCount===0)return;const n=t.getRangeAt(0),i=n.cloneRange(),r=w(n.commonAncestorContainer);if(n.collapsed)return;const c=`${e}${o}`,s=n.commonAncestorContainer,a=v(s);if(a&&O(n,a)){a.style.fontSize=c,m(r);const d=document.createRange();d.selectNodeContents(a),t.removeAllRanges(),t.addRange(d);return}if(!r)return;const u=new Set(Array.from(r.querySelectorAll("font[size], [style*='font-size']")));r.focus({preventScroll:!0});try{document.execCommand("styleWithCSS",!1,"true")}catch{}let l=document.execCommand("fontSize",!1,"7");const f=t.rangeCount>0?t.getRangeAt(0).cloneRange():i,F=T(r,u,c,f);if(l&&F){S(r),m(r);return}l=R(i,t,c),l&&(S(r),m(r))}function v(e){let o=e;for(;o&&o!==document.body;){if(o.nodeType===Node.ELEMENT_NODE){const t=o;if(t.tagName==="SPAN"&&t.style.fontSize)return t}o=o.parentNode}return null}function O(e,o){const t=e.startContainer,n=e.endContainer;return o.contains(t)&&o.contains(n)}function y(){setTimeout(()=>{const{value:e,unit:o}=h(),t=window.getSelection();if(!t||t.rangeCount===0)return;let n=null,r=t.getRangeAt(0).startContainer;for(;r;){if(r instanceof HTMLElement&&(r.classList.contains("rte-editor")||r.classList.contains("editora-editor")||r.hasAttribute("data-editora-editor"))){n=r;break}r=r.parentNode}if(!n)return;const c=n.querySelector(".rte-toolbar-wrapper, .editora-toolbar-container")||n,s=Array.from(c.querySelectorAll('input[data-command="setFontSize"], input.editora-toolbar-input.font-size, input.rte-toolbar-input.font-size, input[title="Font Size"]'));if(s.length===0)return;const u=`${e%1===0?e.toString():e.toFixed(2).replace(/\.?0+$/,"")}${o}`;s.forEach(l=>{l.value=u})},10)}exports.FontSizePlugin=b;
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=".rte-content, .editora-content",C='.rte-footnotes[data-type="footnotes"]',m=".rte-footnote-ref[data-footnote-id]",g='li.rte-footnote-item[data-type="footnote"]',x="__editoraCommandEditorRoot";let y=!1,S=!1,A=0;function M(){if(y||typeof document>"u")return;y=!0;const t=document.createElement("style");t.id="editora-footnote-plugin-styles",t.textContent=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=".rte-content, .editora-content",C='.rte-footnotes[data-type="footnotes"]',m=".rte-footnote-ref[data-footnote-id]",g='li.rte-footnote-item[data-type="footnote"]',x="__editoraCommandEditorRoot";let y=!1,S=!1,A=0;function D(){if(y||typeof document>"u")return;y=!0;const t=document.createElement("style");t.id="editora-footnote-plugin-styles",t.textContent=`
2
2
  .rte-footnote-ref {
3
3
  display: inline-block;
4
4
  font-size: 0.72em;
@@ -82,4 +82,4 @@
82
82
  :is([data-theme="dark"], .dark, .editora-theme-dark) .rte-footnote-backref {
83
83
  color: #8ab4ff;
84
84
  }
85
- `,document.head.appendChild(t)}function v(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function _(t){if(!t)return null;const e=t.querySelector('[contenteditable="true"]');return e instanceof HTMLElement?e:null}function q(){if(typeof window>"u")return null;const t=window[x];if(!(t instanceof HTMLElement))return null;window[x]=null;const e=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null);if(e){const o=_(e);if(o)return o;if(e.getAttribute("contenteditable")==="true")return e}if(t.getAttribute("contenteditable")==="true")return t;const n=t.closest('[contenteditable="true"]');return n instanceof HTMLElement?n:null}function $(t){const e=t.closest('[contenteditable="true"]');if(!e)return null;let n=e,o=n.parentElement;for(;o;)o.getAttribute("contenteditable")==="true"&&(n=o),o=o.parentElement;return n}function u(t){const e=v(t);if(!e)return null;const n=e.closest(R);return n||$(e)}function B(){const t=window.getSelection();return!t||t.rangeCount===0?null:u(t.getRangeAt(0).startContainer)}function H(){const t=q();if(t&&document.contains(t))return t;const e=B();if(e)return e;const n=document.activeElement,o=n?u(n):null;if(o)return o;const r=document.querySelector(R);return r||document.querySelector('[contenteditable="true"]')}function P(){const t=document.createElement("section");t.className="rte-footnotes",t.setAttribute("data-type","footnotes"),t.setAttribute("contenteditable","false");const e=document.createElement("ol");return t.appendChild(e),t}function b(t,e){let n=t.querySelector(C);return!n&&e&&(n=P(),t.appendChild(n)),n?(n.querySelector("ol")||n.appendChild(document.createElement("ol")),n):null}function O(t){let e=t.querySelector("ol");return e||(e=document.createElement("ol"),t.appendChild(e)),e}function z(t){const e=document.createElement("sup");return e.className="rte-footnote-ref",e.setAttribute("data-footnote-id",t),e.setAttribute("data-number","0"),e.setAttribute("contenteditable","false"),e.setAttribute("tabindex","0"),e.setAttribute("role","doc-noteref"),e.id=`ref-${t}`,e.textContent="0",e}function F(t,e){const n=document.createElement("li");n.id=t,n.className="rte-footnote-item",n.setAttribute("data-type","footnote"),n.setAttribute("data-number","0"),n.setAttribute("contenteditable","false");const o=document.createElement("div");o.className="rte-footnote-content",o.setAttribute("contenteditable","true"),o.textContent=e;const r=document.createElement("a");return r.className="rte-footnote-backref",r.href=`#ref-${t}`,r.setAttribute("aria-label","Back to reference"),r.setAttribute("contenteditable","false"),r.textContent="↩",n.appendChild(o),n.appendChild(r),n}function j(t){let e="";do A+=1,e=`fn-${Date.now().toString(36)}-${A.toString(36)}`;while(t.querySelector(`#${CSS.escape(e)}`));return e}function k(t){t.classList.remove("rte-footnote-highlighted"),t.classList.add("rte-footnote-highlighted"),window.setTimeout(()=>{t.classList.remove("rte-footnote-highlighted")},1e3)}function L(t){t&&t.dispatchEvent(new Event("input",{bubbles:!0}))}function I(t,e){if(!t||e===t.innerHTML)return;const n=window.execEditorCommand||window.executeEditorCommand;if(typeof n=="function")try{n("recordDomTransaction",t,e,t.innerHTML)}catch{}}function X(t,e){return Array.from(t.querySelectorAll(m)).find(o=>o.getAttribute("data-footnote-id")===e)||null}function V(t){const e=window.getSelection();if(!e)throw new Error("Selection unavailable");let n=null;if(e.rangeCount>0){const r=e.getRangeAt(0);t.contains(r.commonAncestorContainer)&&(n=r.cloneRange())}if(!n){n=document.createRange();const r=b(t,!1);r?(n.setStartBefore(r),n.collapse(!0)):(n.selectNodeContents(t),n.collapse(!1))}if(v(n.commonAncestorContainer)?.closest(C)){const r=b(t,!0);r&&(n.setStartBefore(r),n.collapse(!0))}return e.removeAllRanges(),e.addRange(n),n}function w(t){const e=t.parentNode;if(!e)return;const n=Array.from(e.childNodes).indexOf(t);if(n<0)return;const o=window.getSelection();if(!o)return;const r=document.createRange();r.setStart(e,n),r.setEnd(e,n+1),o.removeAllRanges(),o.addRange(r),t.focus({preventScroll:!0})}function T(t,e){const n=window.getSelection();if(!n)return;const o=Math.max(0,Math.min(e,t.childNodes.length)),r=document.createRange();r.setStart(t,o),r.collapse(!0),n.removeAllRanges(),n.addRange(r)}function K(t){if(t.collapsed||t.startContainer!==t.endContainer||t.endOffset!==t.startOffset+1||!(t.startContainer instanceof Element||t.startContainer instanceof DocumentFragment))return null;const e=t.startContainer.childNodes[t.startOffset];return!(e instanceof HTMLElement)||!e.matches(m)?null:e}function p(t,e,n){const{startContainer:o,startOffset:r}=t;if(o.nodeType===Node.ELEMENT_NODE){const i=o;if(n==="previous"){if(r>0)return i.childNodes[r-1]||null}else if(r<i.childNodes.length)return i.childNodes[r]||null}if(o.nodeType===Node.TEXT_NODE&&(n==="previous"&&r<o.data.length||n==="next"&&r>0))return null;let c=o;for(;c&&c!==e;){const i=n==="previous"?c.previousSibling:c.nextSibling;if(i)return i;c=c.parentNode}return null}function Y(t,e,n){if(!t.collapsed)return null;const o=i=>i instanceof HTMLElement&&i.matches(m)?i:null,{startContainer:r,startOffset:c}=t;if(r.nodeType===Node.ELEMENT_NODE){const i=r;return n==="Backspace"&&c>0?o(i.childNodes[c-1]||null):n==="Delete"?o(i.childNodes[c]||null):null}if(r.nodeType===Node.TEXT_NODE){const i=r;if(n==="Backspace"&&c===0){const a=o(i.previousSibling);return a||o(p(t,e,"previous"))}if(n==="Delete"&&c===i.data.length){const a=o(i.nextSibling);return a||o(p(t,e,"next"))}}return o(n==="Backspace"?p(t,e,"previous"):p(t,e,"next"))}function D(t){const e=Array.from(t.querySelectorAll(m)).filter(a=>!a.closest(C)),n=b(t,e.length>0);if(!n)return;const o=O(n),r=Array.from(o.querySelectorAll(g)),c=new Map;r.forEach(a=>c.set(a.id,a));const i=[];e.forEach((a,f)=>{const l=a.getAttribute("data-footnote-id");if(!l)return;const s=f+1;a.setAttribute("data-number",String(s)),a.id=`ref-${l}`,a.textContent=String(s);let d=c.get(l);d||(d=F(l,`Footnote ${s}`)),d.setAttribute("data-number",String(s));const h=d.querySelector(".rte-footnote-content");h&&!(h.textContent||"").trim()&&(h.textContent=`Footnote ${s}`);const E=d.querySelector(".rte-footnote-backref");E&&(E.href=`#ref-${l}`,E.setAttribute("aria-label",`Back to reference ${s}`)),i.push(d)}),o.innerHTML="",i.forEach(a=>o.appendChild(a)),i.length===0&&n.remove()}function N(t,e){const n=u(t),o=t.parentNode;if(!n||!o)return!1;const r=n.innerHTML,c=Array.from(o.childNodes).indexOf(t);if(c<0)return!1;const i=t.getAttribute("data-footnote-id")||"";return t.remove(),i&&n.querySelector(`${g}#${CSS.escape(i)}`)?.remove(),T(o,c),D(n),I(n,r),L(n),!0}function G(){S||typeof document>"u"||(S=!0,document.addEventListener("click",t=>{const e=t.target;if(!e)return;const n=e.closest(m);if(n){const f=u(n);if(!f||!f.contains(n))return;t.preventDefault(),t.stopPropagation(),w(n),n.classList.add("rte-footnote-selected"),window.setTimeout(()=>n.classList.remove("rte-footnote-selected"),1200);const l=n.getAttribute("data-footnote-id");if(!l)return;const s=f.querySelector(`${g}#${CSS.escape(l)}`);if(!s)return;s.scrollIntoView({behavior:"smooth",block:"center"}),k(s);return}const o=e.closest(".rte-footnote-backref");if(!o)return;const r=o.closest(g);if(!r)return;const c=u(r);if(!c||!c.contains(r))return;t.preventDefault(),t.stopPropagation();const i=r.id;if(!i)return;const a=X(c,i);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),k(a),w(a))}),document.addEventListener("keydown",t=>{if(t.key!=="Backspace"&&t.key!=="Delete")return;const e=window.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0),o=u(n.commonAncestorContainer);if(!o||!o.contains(n.commonAncestorContainer))return;const r=K(n);if(r){t.preventDefault(),t.stopPropagation(),N(r,t.key);return}const c=Y(n,o,t.key);c&&(t.preventDefault(),t.stopPropagation(),N(c,t.key))}))}const J=(t="")=>{const e=H();if(!e)return!1;const n=e.innerHTML,o=window.getSelection();if(!o)return!1;let r;try{r=V(e)}catch{return!1}r.collapsed||(r.collapse(!1),o.removeAllRanges(),o.addRange(r));const c=j(e),i=z(c);try{r.insertNode(i)}catch{return!1}const a=document.createRange();a.setStartAfter(i),a.collapse(!0),o.removeAllRanges(),o.addRange(a);const f=b(e,!0);if(!f)return!1;const l=O(f),s=t.trim()||"Footnote";return l.appendChild(F(c,s)),D(e),I(e,n),L(e),!0},Q=()=>(M(),G(),{name:"footnote",toolbar:[{label:"Footnote",command:"insertFootnote",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><rect x="3" y="4" width="14" height="2" rx="1"></rect><rect x="3" y="8" width="18" height="2" rx="1"></rect><rect x="3" y="12" width="16" height="2" rx="1"></rect><rect x="3" y="16" width="10" height="1.5" rx="0.75"></rect><text x="19" y="11" font-size="9" font-weight="600" fill="currentColor" font-family="system-ui, sans-serif">1</text></svg>'}],commands:{insertFootnote:()=>J()},keymap:{}});exports.FootnotePlugin=Q;
85
+ `,document.head.appendChild(t)}function R(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function _(t){if(!t)return null;const e=t.querySelector('[contenteditable="true"]');return e instanceof HTMLElement?e:null}function q(){if(typeof window>"u")return null;const t=window[x];if(!(t instanceof HTMLElement))return null;window[x]=null;const e=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null);if(e){const o=_(e);if(o)return o;if(e.getAttribute("contenteditable")==="true")return e}if(t.getAttribute("contenteditable")==="true")return t;const n=t.closest('[contenteditable="true"]');return n instanceof HTMLElement?n:null}function $(t){const e=t.closest('[contenteditable="true"]');if(!e)return null;let n=e,o=n.parentElement;for(;o;)o.getAttribute("contenteditable")==="true"&&(n=o),o=o.parentElement;return n}function u(t){const e=R(t);if(!e)return null;const n=e.closest(v);return n||$(e)}function B(){const t=window.getSelection();return!t||t.rangeCount===0?null:u(t.getRangeAt(0).startContainer)}function H(){const t=q();if(t&&document.contains(t))return t;const e=B();if(e)return e;const n=document.activeElement,o=n?u(n):null;if(o)return o;const r=document.querySelector(v);return r||document.querySelector('[contenteditable="true"]')}function P(){const t=document.createElement("section");t.className="rte-footnotes",t.setAttribute("data-type","footnotes"),t.setAttribute("contenteditable","false");const e=document.createElement("ol");return t.appendChild(e),t}function b(t,e){let n=t.querySelector(C);return!n&&e&&(n=P(),t.appendChild(n)),n?(n.querySelector("ol")||n.appendChild(document.createElement("ol")),n):null}function O(t){let e=t.querySelector("ol");return e||(e=document.createElement("ol"),t.appendChild(e)),e}function z(t){const e=document.createElement("sup");return e.className="rte-footnote-ref",e.setAttribute("data-footnote-id",t),e.setAttribute("data-number","0"),e.setAttribute("contenteditable","false"),e.setAttribute("tabindex","0"),e.setAttribute("role","doc-noteref"),e.id=`ref-${t}`,e.textContent="0",e}function F(t,e){const n=document.createElement("li");n.id=t,n.className="rte-footnote-item",n.setAttribute("data-type","footnote"),n.setAttribute("data-number","0"),n.setAttribute("contenteditable","false");const o=document.createElement("div");o.className="rte-footnote-content",o.setAttribute("contenteditable","true"),o.textContent=e;const r=document.createElement("a");return r.className="rte-footnote-backref",r.href=`#ref-${t}`,r.setAttribute("aria-label","Back to reference"),r.setAttribute("contenteditable","false"),r.textContent="↩",n.appendChild(o),n.appendChild(r),n}function j(t){let e="";do A+=1,e=`fn-${Date.now().toString(36)}-${A.toString(36)}`;while(t.querySelector(`#${CSS.escape(e)}`));return e}function k(t){t.classList.remove("rte-footnote-highlighted"),t.classList.add("rte-footnote-highlighted"),window.setTimeout(()=>{t.classList.remove("rte-footnote-highlighted")},1e3)}function L(t){t&&t.dispatchEvent(new Event("input",{bubbles:!0}))}function I(t,e){if(!t||e===t.innerHTML)return;const n=window.execEditorCommand||window.executeEditorCommand;if(typeof n=="function")try{n("recordDomTransaction",t,e,t.innerHTML)}catch{}}function X(t,e){return Array.from(t.querySelectorAll(m)).find(o=>o.getAttribute("data-footnote-id")===e)||null}function V(t){const e=window.getSelection();if(!e)throw new Error("Selection unavailable");let n=null;if(e.rangeCount>0){const r=e.getRangeAt(0);t.contains(r.commonAncestorContainer)&&(n=r.cloneRange())}if(!n){n=document.createRange();const r=b(t,!1);r?(n.setStartBefore(r),n.collapse(!0)):(n.selectNodeContents(t),n.collapse(!1))}if(R(n.commonAncestorContainer)?.closest(C)){const r=b(t,!0);r&&(n.setStartBefore(r),n.collapse(!0))}return e.removeAllRanges(),e.addRange(n),n}function w(t){const e=t.parentNode;if(!e)return;const n=Array.from(e.childNodes).indexOf(t);if(n<0)return;const o=window.getSelection();if(!o)return;const r=document.createRange();r.setStart(e,n),r.setEnd(e,n+1),o.removeAllRanges(),o.addRange(r),t.focus({preventScroll:!0})}function T(t,e){const n=window.getSelection();if(!n)return;const o=Math.max(0,Math.min(e,t.childNodes.length)),r=document.createRange();r.setStart(t,o),r.collapse(!0),n.removeAllRanges(),n.addRange(r)}function K(t){if(t.collapsed||t.startContainer!==t.endContainer||t.endOffset!==t.startOffset+1||!(t.startContainer instanceof Element||t.startContainer instanceof DocumentFragment))return null;const e=t.startContainer.childNodes[t.startOffset];return!(e instanceof HTMLElement)||!e.matches(m)?null:e}function p(t,e,n){const{startContainer:o,startOffset:r}=t;if(o.nodeType===Node.ELEMENT_NODE){const i=o;if(n==="previous"){if(r>0)return i.childNodes[r-1]||null}else if(r<i.childNodes.length)return i.childNodes[r]||null}if(o.nodeType===Node.TEXT_NODE&&(n==="previous"&&r<o.data.length||n==="next"&&r>0))return null;let c=o;for(;c&&c!==e;){const i=n==="previous"?c.previousSibling:c.nextSibling;if(i)return i;c=c.parentNode}return null}function Y(t,e,n){if(!t.collapsed)return null;const o=i=>i instanceof HTMLElement&&i.matches(m)?i:null,{startContainer:r,startOffset:c}=t;if(r.nodeType===Node.ELEMENT_NODE){const i=r;return n==="Backspace"&&c>0?o(i.childNodes[c-1]||null):n==="Delete"?o(i.childNodes[c]||null):null}if(r.nodeType===Node.TEXT_NODE){const i=r;if(n==="Backspace"&&c===0){const a=o(i.previousSibling);return a||o(p(t,e,"previous"))}if(n==="Delete"&&c===i.data.length){const a=o(i.nextSibling);return a||o(p(t,e,"next"))}}return o(n==="Backspace"?p(t,e,"previous"):p(t,e,"next"))}function M(t){const e=Array.from(t.querySelectorAll(m)).filter(a=>!a.closest(C)),n=b(t,e.length>0);if(!n)return;const o=O(n),r=Array.from(o.querySelectorAll(g)),c=new Map;r.forEach(a=>c.set(a.id,a));const i=[];e.forEach((a,f)=>{const l=a.getAttribute("data-footnote-id");if(!l)return;const s=f+1;a.setAttribute("data-number",String(s)),a.id=`ref-${l}`,a.textContent=String(s);let d=c.get(l);d||(d=F(l,`Footnote ${s}`)),d.setAttribute("data-number",String(s));const h=d.querySelector(".rte-footnote-content");h&&!(h.textContent||"").trim()&&(h.textContent=`Footnote ${s}`);const E=d.querySelector(".rte-footnote-backref");E&&(E.href=`#ref-${l}`,E.setAttribute("aria-label",`Back to reference ${s}`)),i.push(d)}),o.innerHTML="",i.forEach(a=>o.appendChild(a)),i.length===0&&n.remove()}function N(t,e){const n=u(t),o=t.parentNode;if(!n||!o)return!1;const r=n.innerHTML,c=Array.from(o.childNodes).indexOf(t);if(c<0)return!1;const i=t.getAttribute("data-footnote-id")||"";return t.remove(),i&&n.querySelector(`${g}#${CSS.escape(i)}`)?.remove(),T(o,c),M(n),I(n,r),L(n),!0}function G(){S||typeof document>"u"||(S=!0,document.addEventListener("click",t=>{const e=t.target;if(!e)return;const n=e.closest(m);if(n){const f=u(n);if(!f||!f.contains(n))return;t.preventDefault(),t.stopPropagation(),w(n),n.classList.add("rte-footnote-selected"),window.setTimeout(()=>n.classList.remove("rte-footnote-selected"),1200);const l=n.getAttribute("data-footnote-id");if(!l)return;const s=f.querySelector(`${g}#${CSS.escape(l)}`);if(!s)return;s.scrollIntoView({behavior:"smooth",block:"center"}),k(s);return}const o=e.closest(".rte-footnote-backref");if(!o)return;const r=o.closest(g);if(!r)return;const c=u(r);if(!c||!c.contains(r))return;t.preventDefault(),t.stopPropagation();const i=r.id;if(!i)return;const a=X(c,i);a&&(a.scrollIntoView({behavior:"smooth",block:"center"}),k(a),w(a))}),document.addEventListener("keydown",t=>{if(t.key!=="Backspace"&&t.key!=="Delete")return;const e=window.getSelection();if(!e||e.rangeCount===0)return;const n=e.getRangeAt(0),o=u(n.commonAncestorContainer);if(!o||!o.contains(n.commonAncestorContainer))return;const r=K(n);if(r){t.preventDefault(),t.stopPropagation(),N(r,t.key);return}const c=Y(n,o,t.key);c&&(t.preventDefault(),t.stopPropagation(),N(c,t.key))}))}const J=(t="")=>{const e=H();if(!e)return!1;const n=e.innerHTML,o=window.getSelection();if(!o)return!1;let r;try{r=V(e)}catch{return!1}r.collapsed||(r.collapse(!1),o.removeAllRanges(),o.addRange(r));const c=j(e),i=z(c);try{r.insertNode(i)}catch{return!1}const a=document.createRange();a.setStartAfter(i),a.collapse(!0),o.removeAllRanges(),o.addRange(a);const f=b(e,!0);if(!f)return!1;const l=O(f),s=t.trim()||"Footnote";return l.appendChild(F(c,s)),M(e),I(e,n),L(e),!0},Q=()=>(D(),G(),{name:"footnote",toolbar:[{label:"Footnote",command:"insertFootnote",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><rect x="3" y="4" width="14" height="2" rx="1"></rect><rect x="3" y="8" width="18" height="2" rx="1"></rect><rect x="3" y="12" width="16" height="2" rx="1"></rect><rect x="3" y="16" width="10" height="1.5" rx="0.75"></rect><text x="19" y="11" font-size="9" font-weight="600" fill="currentColor" font-family="system-ui, sans-serif">1</text></svg>'}],commands:{insertFootnote:()=>J()},keymap:{}});exports.FootnotePlugin=Q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=new WeakMap,a="rte-fullscreen-active",t=e=>(o.has(e)||o.set(e,{isFullscreen:!1,fullscreenButton:null}),o.get(e)),y=(e,s)=>{if(e.classList.add(a),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.width="100%",e.style.height="100%",e.style.maxWidth="100%",e.style.maxHeight="100%",e.style.borderRadius="0",e.style.zIndex="9999",e.style.margin="0",e.style.padding="0",e.style.boxShadow="none",e.style.display="flex",e.style.flexDirection="column",e.style.background="white",document.body.style.overflow="hidden",document.body.classList.add("fullscreen-active"),s.fullscreenButton){s.fullscreenButton.setAttribute("data-active","true"),s.fullscreenButton.style.backgroundColor="var(--rte-color-primary, #007bff)",s.fullscreenButton.style.color="white";const l=s.fullscreenButton.querySelector("svg");l&&(l.style.fill="white",l.style.stroke="white")}},c=(e,s)=>{if(e.classList.remove(a),e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.bottom="",e.style.width="",e.style.height="",e.style.maxWidth="",e.style.maxHeight="",e.style.borderRadius="",e.style.zIndex="",e.style.margin="",e.style.padding="",e.style.boxShadow="",e.style.display="",e.style.flexDirection="",e.style.background="",document.body.style.overflow="",document.body.classList.remove("fullscreen-active"),s.fullscreenButton){s.fullscreenButton.setAttribute("data-active","false"),s.fullscreenButton.style.backgroundColor="",s.fullscreenButton.style.color="";const l=s.fullscreenButton.querySelector("svg");l&&(l.style.fill="",l.style.stroke="")}},f=e=>{try{if(!e){const l=document.activeElement;l&&l.closest("[data-editora-editor]")&&(e=l.closest("[data-editora-editor]"))}if(e||(e=document.querySelector("[data-editora-editor]")),!e)return console.warn("Editor element not found"),!1;const s=t(e);return s.fullscreenButton||(s.fullscreenButton=e.querySelector('[data-command="toggleFullscreen"]')),s.isFullscreen=!s.isFullscreen,s.isFullscreen?y(e,s):c(e,s),!0}catch(s){return console.error("Fullscreen toggle failed:",s),!1}},i=e=>{if(!e){document.querySelectorAll("[data-editora-editor]").forEach(l=>{const u=l,n=t(u);n.isFullscreen&&(n.isFullscreen=!1,c(u,n))});return}const s=t(e);s.isFullscreen&&(s.isFullscreen=!1,c(e,s))},d=e=>t(e).isFullscreen,r=()=>{const e=s=>{s.key==="Escape"&&i()};return typeof window<"u"&&window.addEventListener("keydown",e),()=>{typeof window<"u"&&window.removeEventListener("keydown",e)}};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r());const g=()=>({name:"fullscreen",toolbar:[{label:"Fullscreen",command:"toggleFullscreen",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>'}],commands:{toggleFullscreen:f},keymap:{Escape:()=>{const e=document.querySelectorAll("[data-editora-editor]");for(const s of e)if(d(s))return i(s),!0;return!1}}});exports.FullscreenPlugin=g;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=new WeakMap,a="rte-fullscreen-active",t=e=>(o.has(e)||o.set(e,{isFullscreen:!1,fullscreenButton:null}),o.get(e)),f=(e,s)=>{if(e.classList.add(a),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.right="0",e.style.bottom="0",e.style.width="100%",e.style.height="100%",e.style.maxWidth="100%",e.style.maxHeight="100%",e.style.borderRadius="0",e.style.zIndex="9999",e.style.margin="0",e.style.padding="0",e.style.boxShadow="none",e.style.display="flex",e.style.flexDirection="column",e.style.background="white",document.body.style.overflow="hidden",document.body.classList.add("fullscreen-active"),s.fullscreenButton){s.fullscreenButton.setAttribute("data-active","true"),s.fullscreenButton.style.backgroundColor="var(--rte-color-primary, #007bff)",s.fullscreenButton.style.color="white";const l=s.fullscreenButton.querySelector("svg");l&&(l.style.fill="white",l.style.stroke="white")}},c=(e,s)=>{if(e.classList.remove(a),e.style.position="",e.style.top="",e.style.left="",e.style.right="",e.style.bottom="",e.style.width="",e.style.height="",e.style.maxWidth="",e.style.maxHeight="",e.style.borderRadius="",e.style.zIndex="",e.style.margin="",e.style.padding="",e.style.boxShadow="",e.style.display="",e.style.flexDirection="",e.style.background="",document.body.style.overflow="",document.body.classList.remove("fullscreen-active"),s.fullscreenButton){s.fullscreenButton.setAttribute("data-active","false"),s.fullscreenButton.style.backgroundColor="",s.fullscreenButton.style.color="";const l=s.fullscreenButton.querySelector("svg");l&&(l.style.fill="",l.style.stroke="")}},y=e=>{try{if(!e){const l=document.activeElement;l&&l.closest("[data-editora-editor]")&&(e=l.closest("[data-editora-editor]"))}if(e||(e=document.querySelector("[data-editora-editor]")),!e)return console.warn("Editor element not found"),!1;const s=t(e);return s.fullscreenButton||(s.fullscreenButton=e.querySelector('[data-command="toggleFullscreen"]')),s.isFullscreen=!s.isFullscreen,s.isFullscreen?f(e,s):c(e,s),!0}catch(s){return console.error("Fullscreen toggle failed:",s),!1}},i=e=>{if(!e){document.querySelectorAll("[data-editora-editor]").forEach(l=>{const u=l,n=t(u);n.isFullscreen&&(n.isFullscreen=!1,c(u,n))});return}const s=t(e);s.isFullscreen&&(s.isFullscreen=!1,c(e,s))},d=e=>t(e).isFullscreen,r=()=>{const e=s=>{s.key==="Escape"&&i()};return typeof window<"u"&&window.addEventListener("keydown",e),()=>{typeof window<"u"&&window.removeEventListener("keydown",e)}};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",r):r());const g=()=>({name:"fullscreen",toolbar:[{label:"Fullscreen",command:"toggleFullscreen",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8 3H5a2 2 0 0 0-2 2v3m18 0V5a2 2 0 0 0-2-2h-3m0 18h3a2 2 0 0 0 2-2v-3M3 16v3a2 2 0 0 0 2 2h3"></path></svg>'}],commands:{toggleFullscreen:y},keymap:{Escape:()=>{const e=document.querySelectorAll("[data-editora-editor]");for(const s of e)if(d(s))return i(s),!0;return!1}}});exports.FullscreenPlugin=g;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=()=>{const e=a=>{try{return document.execCommand("formatBlock",!1,a),!0}catch(l){return console.error(`Failed to set block type to ${a}:`,l),!1}};return{name:"heading",toolbar:[{label:"Heading",command:"setBlockType",type:"dropdown",options:[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"},{value:"h5",label:"Heading 5"},{value:"h6",label:"Heading 6"}],icon:'<svg width="24" height="24" focusable="false"><path d="M16.1 8.6 14.2 4l-1.4.5 2.8 7.4c.1.4.5.6.9.6h.1c.4-.1.6-.5.6-.9l1.8-4.8-1.4-.5-1.5 2.3ZM4 11.5h6V10H4v1.5ZM18.5 3v1L17 7l.9.9L20.7 3h-2.2ZM5.5 12h1v7h1v-7h1v-.5h-3V12Zm4 0h1v7h1v-7h1v-.5h-3V12Zm10 1.5a2 2 0 0 0-2-2h-1v7.5h1v-2.7h1a2 2 0 0 0 2-2v-.8Zm-2 1.3h-1v-2.3h1a.8.8 0 1 1 0 1.6v.7Z" fill-rule="evenodd"></path></svg>'}],commands:{setBlockType:a=>a?e(a):!1,setHeading1:()=>e("h1"),setHeading2:()=>e("h2"),setHeading3:()=>e("h3"),setParagraph:()=>e("p")},keymap:{"Mod-Alt-1":"setHeading1","Mod-Alt-2":"setHeading2","Mod-Alt-3":"setHeading3","Mod-Alt-0":"setParagraph"}}};exports.HeadingPlugin=t;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=()=>{const e=a=>{try{return document.execCommand("formatBlock",!1,a),!0}catch(l){return console.error(`Failed to set block type to ${a}:`,l),!1}};return{name:"heading",toolbar:[{label:"Heading",command:"setBlockType",type:"dropdown",options:[{value:"p",label:"Paragraph"},{value:"h1",label:"Heading 1"},{value:"h2",label:"Heading 2"},{value:"h3",label:"Heading 3"},{value:"h4",label:"Heading 4"},{value:"h5",label:"Heading 5"},{value:"h6",label:"Heading 6"}],icon:'<svg width="24" height="24" focusable="false"><path d="M16.1 8.6 14.2 4l-1.4.5 2.8 7.4c.1.4.5.6.9.6h.1c.4-.1.6-.5.6-.9l1.8-4.8-1.4-.5-1.5 2.3ZM4 11.5h6V10H4v1.5ZM18.5 3v1L17 7l.9.9L20.7 3h-2.2ZM5.5 12h1v7h1v-7h1v-.5h-3V12Zm4 0h1v7h1v-7h1v-.5h-3V12Zm10 1.5a2 2 0 0 0-2-2h-1v7.5h1v-2.7h1a2 2 0 0 0 2-2v-.8Zm-2 1.3h-1v-2.3h1a.8.8 0 1 1 0 1.6v.7Z" fill-rule="evenodd"></path></svg>'}],commands:{setBlockType:a=>a?e(a):!1,setHeading1:()=>e("h1"),setHeading2:()=>e("h2"),setHeading3:()=>e("h3"),setParagraph:()=>e("p")},keymap:{"Mod-Alt-1":"setHeading1","Mod-Alt-2":"setHeading2","Mod-Alt-3":"setHeading3","Mod-Alt-0":"setParagraph"}}};exports.HeadingPlugin=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=".rte-content, .editora-content",y=100,T="__editoraCommandEditorRoot",d=new Map,E={};let h=!1,c=null;function I(t){if(!t)return null;const e=t.querySelector('[contenteditable="true"]');return e instanceof HTMLElement?e:null}function z(){if(typeof window>"u")return null;const t=window[T];if(!(t instanceof HTMLElement))return null;window[T]=null;const e=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null);if(e){const o=I(e);if(o)return o;if(e.getAttribute("contenteditable")==="true")return e}if(t.getAttribute("contenteditable")==="true")return t;const n=t.closest('[contenteditable="true"]');return n instanceof HTMLElement?n:null}function F(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function a(t){const e=F(t);if(!e)return null;const n=e.closest(v);if(n)return n;const o=e.closest('[contenteditable="true"]');if(!o)return null;let r=o,i=r.parentElement;for(;i;)i.getAttribute("contenteditable")==="true"&&(r=i),i=i.parentElement;return r}function l(){const t=z();if(t&&document.contains(t))return t;const e=window.getSelection();if(e&&e.rangeCount>0){const i=a(e.getRangeAt(0).startContainer);if(i)return i}const n=document.activeElement;if(n){const i=a(n);if(i)return i}if(c?.isConnected)return c;const o=Array.from(d.keys()).find(i=>i.isConnected);if(o)return o;const r=document.querySelector(v);return r||document.querySelector('[contenteditable="true"]')}function A(){for(const t of d.keys())t.isConnected||(d.delete(t),c===t&&(c=null))}function C(t){A();let e=d.get(t);return e||(e={undoStack:[],redoStack:[]},d.set(t,e)),e}function s(t){t&&t.dispatchEvent(new Event("input",{bubbles:!0}))}function M(t){return t?t.innerHTML:""}function m(t,e){if(!t)return;const n=C(t);n.undoStack.push(e),n.redoStack.length=0,n.undoStack.length>y&&n.undoStack.splice(0,n.undoStack.length-y),c=t}function L(t,e="undo"){if(A(),t?.isConnected)return t;const n=l();if(n?.isConnected)return n;if(c?.isConnected)return c;const o=r=>e==="undo"?r.undoStack.length>0:r.redoStack.length>0;for(const[r,i]of d.entries())if(r.isConnected&&o(i))return r;return null}function w(t){const e={};for(const r of t.getAttributeNames()){const i=t.getAttribute(r);i!==null&&(e[r]=i)}const n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement,o=t instanceof HTMLInputElement;return{attributes:e,innerHTML:t.innerHTML,value:n?t.value:null,checked:o?t.checked:null}}function H(t,e){const n=new Set(t.getAttributeNames());Object.keys(e.attributes).forEach(o=>n.delete(o)),n.forEach(o=>t.removeAttribute(o)),Object.entries(e.attributes).forEach(([o,r])=>{t.setAttribute(o,r)}),t.innerHTML!==e.innerHTML&&(t.innerHTML=e.innerHTML),e.value!==null&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&(t.value=e.value),e.checked!==null&&t instanceof HTMLInputElement&&(t.checked=e.checked)}function u(t,e){if(E[t]=e,typeof window>"u")return;const n=window.registerEditorCommand;typeof n=="function"?n(t,e):(window.registerEditorCommand=(o,r)=>{E[o]=r},window.registerEditorCommand(t,e))}const S=(t,...e)=>{const n=E[t];return n?n(...e):!1};function p(){h||typeof window>"u"||(h=!0,window.execEditorCommand||(window.execEditorCommand=S),window.executeEditorCommand||(window.executeEditorCommand=S),u("undo",k),u("redo",D),u("setAttribute",O),u("setText",N),u("autoFixA11y",R),u("recordDomTransaction",_),u("undoDom",b),u("redoDom",g))}function x(t,e){const n=e||l(),o=M(n);n?.focus({preventScroll:!0});let r=!1;try{r=!!document.execCommand(t,!1)}catch{r=!1}const i=M(n),f=o!==i;return f&&s(n),{executed:r,changed:f}}const k=()=>{const t=l();return x("undo",t).changed?!0:b(t)},D=()=>{const t=l();return x("redo",t).changed?!0:g(t)},O=(t,e,n)=>{if(!(t instanceof HTMLElement))return;const o=a(t),r=t.hasAttribute(e),i=t.getAttribute(e);t.setAttribute(e,n),m(o,{undo:()=>{t.isConnected&&(r&&i!==null?t.setAttribute(e,i):t.removeAttribute(e))},redo:()=>{t.isConnected&&t.setAttribute(e,n)}}),s(o)},N=(t,e)=>{if(!(t instanceof HTMLElement))return;const n=a(t),o=t.textContent??"";t.textContent=e,m(n,{undo:()=>{t.isConnected&&(t.textContent=o)},redo:()=>{t.isConnected&&(t.textContent=e)}}),s(n)},R=t=>{const e=t?.element;if(!(e instanceof HTMLElement))return;const n=a(e),o=window.a11yRuleRegistry?.find(f=>f.id===t.rule);if(!o||typeof o.fix!="function")return;const r=w(e);o.fix(t);const i=w(e);m(n,{undo:()=>{e.isConnected&&H(e,r)},redo:()=>{e.isConnected&&H(e,i)}}),s(n)},_=(t,e,n)=>{if(!(t instanceof HTMLElement))return!1;const o=typeof n=="string"?n:t.innerHTML;return e===o?!1:(m(t,{undo:()=>{t.isConnected&&(t.innerHTML=e)},redo:()=>{t.isConnected&&(t.innerHTML=o)}}),!0)},b=t=>{const e=L(t,"undo");if(!e)return!1;const n=C(e),o=n.undoStack.pop();return o?(o.undo(),n.redoStack.push(o),c=e,s(e),!0):!1},g=t=>{const e=L(t,"redo");if(!e)return!1;const n=C(e),o=n.redoStack.pop();return o?(o.redo(),n.undoStack.push(o),c=e,s(e),!0):!1};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p,{once:!0}):p());const Z=()=>(p(),{name:"history",toolbar:[{label:"Undo",command:"undo",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-z"},{label:"Redo",command:"redo",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-y"}],commands:{undo:k,redo:D,setAttribute:O,setText:N,autoFixA11y:R,recordDomTransaction:_,undoDom:b,redoDom:g},keymap:{"Mod-z":"undo","Mod-Z":"undo","Mod-y":"redo","Mod-Y":"redo","Mod-Shift-z":"redo","Mod-Shift-Z":"redo"}});exports.HistoryPlugin=Z;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const v=".rte-content, .editora-content",y=100,M="__editoraCommandEditorRoot",d=new Map,E={};let T=!1,c=null;function I(t){if(!t)return null;const e=t.querySelector('[contenteditable="true"]');return e instanceof HTMLElement?e:null}function z(){if(typeof window>"u")return null;const t=window[M];if(!(t instanceof HTMLElement))return null;window[M]=null;const e=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null);if(e){const o=I(e);if(o)return o;if(e.getAttribute("contenteditable")==="true")return e}if(t.getAttribute("contenteditable")==="true")return t;const n=t.closest('[contenteditable="true"]');return n instanceof HTMLElement?n:null}function F(t){return t?t.nodeType===Node.ELEMENT_NODE?t:t.parentElement:null}function a(t){const e=F(t);if(!e)return null;const n=e.closest(v);if(n)return n;const o=e.closest('[contenteditable="true"]');if(!o)return null;let r=o,i=r.parentElement;for(;i;)i.getAttribute("contenteditable")==="true"&&(r=i),i=i.parentElement;return r}function l(){const t=z();if(t&&document.contains(t))return t;const e=window.getSelection();if(e&&e.rangeCount>0){const i=a(e.getRangeAt(0).startContainer);if(i)return i}const n=document.activeElement;if(n){const i=a(n);if(i)return i}if(c?.isConnected)return c;const o=Array.from(d.keys()).find(i=>i.isConnected);if(o)return o;const r=document.querySelector(v);return r||document.querySelector('[contenteditable="true"]')}function A(){for(const t of d.keys())t.isConnected||(d.delete(t),c===t&&(c=null))}function C(t){A();let e=d.get(t);return e||(e={undoStack:[],redoStack:[]},d.set(t,e)),e}function s(t){t&&t.dispatchEvent(new Event("input",{bubbles:!0}))}function h(t){return t?t.innerHTML:""}function m(t,e){if(!t)return;const n=C(t);n.undoStack.push(e),n.redoStack.length=0,n.undoStack.length>y&&n.undoStack.splice(0,n.undoStack.length-y),c=t}function L(t,e="undo"){if(A(),t?.isConnected)return t;const n=l();if(n?.isConnected)return n;if(c?.isConnected)return c;const o=r=>e==="undo"?r.undoStack.length>0:r.redoStack.length>0;for(const[r,i]of d.entries())if(r.isConnected&&o(i))return r;return null}function w(t){const e={};for(const r of t.getAttributeNames()){const i=t.getAttribute(r);i!==null&&(e[r]=i)}const n=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement,o=t instanceof HTMLInputElement;return{attributes:e,innerHTML:t.innerHTML,value:n?t.value:null,checked:o?t.checked:null}}function H(t,e){const n=new Set(t.getAttributeNames());Object.keys(e.attributes).forEach(o=>n.delete(o)),n.forEach(o=>t.removeAttribute(o)),Object.entries(e.attributes).forEach(([o,r])=>{t.setAttribute(o,r)}),t.innerHTML!==e.innerHTML&&(t.innerHTML=e.innerHTML),e.value!==null&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&(t.value=e.value),e.checked!==null&&t instanceof HTMLInputElement&&(t.checked=e.checked)}function u(t,e){if(E[t]=e,typeof window>"u")return;const n=window.registerEditorCommand;typeof n=="function"?n(t,e):(window.registerEditorCommand=(o,r)=>{E[o]=r},window.registerEditorCommand(t,e))}const S=(t,...e)=>{const n=E[t];return n?n(...e):!1};function p(){T||typeof window>"u"||(T=!0,window.execEditorCommand||(window.execEditorCommand=S),window.executeEditorCommand||(window.executeEditorCommand=S),u("undo",k),u("redo",D),u("setAttribute",O),u("setText",_),u("autoFixA11y",N),u("recordDomTransaction",R),u("undoDom",b),u("redoDom",g))}function x(t,e){const n=e||l(),o=h(n);n?.focus({preventScroll:!0});let r=!1;try{r=!!document.execCommand(t,!1)}catch{r=!1}const i=h(n),f=o!==i;return f&&s(n),{executed:r,changed:f}}const k=()=>{const t=l();return x("undo",t).changed?!0:b(t??void 0)},D=()=>{const t=l();return x("redo",t).changed?!0:g(t??void 0)},O=(t,e,n)=>{if(!(t instanceof HTMLElement))return;const o=a(t),r=t.hasAttribute(e),i=t.getAttribute(e);t.setAttribute(e,n),m(o,{undo:()=>{t.isConnected&&(r&&i!==null?t.setAttribute(e,i):t.removeAttribute(e))},redo:()=>{t.isConnected&&t.setAttribute(e,n)}}),s(o)},_=(t,e)=>{if(!(t instanceof HTMLElement))return;const n=a(t),o=t.textContent??"";t.textContent=e,m(n,{undo:()=>{t.isConnected&&(t.textContent=o)},redo:()=>{t.isConnected&&(t.textContent=e)}}),s(n)},N=t=>{const e=t?.element;if(!(e instanceof HTMLElement))return;const n=a(e),o=window.a11yRuleRegistry?.find(f=>f.id===t.rule);if(!o||typeof o.fix!="function")return;const r=w(e);o.fix(t);const i=w(e);m(n,{undo:()=>{e.isConnected&&H(e,r)},redo:()=>{e.isConnected&&H(e,i)}}),s(n)},R=(t,e,n)=>{if(!(t instanceof HTMLElement))return!1;const o=typeof n=="string"?n:t.innerHTML;return e===o?!1:(m(t,{undo:()=>{t.isConnected&&(t.innerHTML=e)},redo:()=>{t.isConnected&&(t.innerHTML=o)}}),!0)},b=t=>{const e=L(t,"undo");if(!e)return!1;const n=C(e),o=n.undoStack.pop();return o?(o.undo(),n.redoStack.push(o),c=e,s(e),!0):!1},g=t=>{const e=L(t,"redo");if(!e)return!1;const n=C(e),o=n.redoStack.pop();return o?(o.redo(),n.undoStack.push(o),c=e,s(e),!0):!1};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",p,{once:!0}):p());const Z=()=>(p(),{name:"history",toolbar:[{label:"Undo",command:"undo",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M6.4 8H12c3.7 0 6.2 2 6.8 5.1.6 2.7-.4 5.6-2.3 6.8a1 1 0 0 1-1-1.8c1.1-.6 1.8-2.7 1.4-4.6-.5-2.1-2.1-3.5-4.9-3.5H6.4l3.3 3.3a1 1 0 1 1-1.4 1.4l-5-5a1 1 0 0 1 0-1.4l5-5a1 1 0 0 1 1.4 1.4L6.4 8Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-z"},{label:"Redo",command:"redo",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M17.6 10H12c-2.8 0-4.4 1.4-4.9 3.5-.4 2 .3 4 1.4 4.6a1 1 0 1 1-1 1.8c-2-1.2-2.9-4.1-2.3-6.8.6-3 3-5.1 6.8-5.1h5.6l-3.3-3.3a1 1 0 1 1 1.4-1.4l5 5a1 1 0 0 1 0 1.4l-5 5a1 1 0 0 1-1.4-1.4l3.3-3.3Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-y"}],commands:{undo:k,redo:D,setAttribute:O,setText:_,autoFixA11y:N,recordDomTransaction:R,undoDom:b,redoDom:g},keymap:{"Mod-z":"undo","Mod-Z":"undo","Mod-y":"redo","Mod-Y":"redo","Mod-Shift-z":"redo","Mod-Shift-Z":"redo"}});exports.HistoryPlugin=Z;
@@ -57,12 +57,12 @@ function l() {
57
57
  const r = document.querySelector(S);
58
58
  return r || document.querySelector('[contenteditable="true"]');
59
59
  }
60
- function A() {
60
+ function v() {
61
61
  for (const t of d.keys())
62
62
  t.isConnected || (d.delete(t), c === t && (c = null));
63
63
  }
64
64
  function C(t) {
65
- A();
65
+ v();
66
66
  let e = d.get(t);
67
67
  return e || (e = { undoStack: [], redoStack: [] }, d.set(t, e)), e;
68
68
  }
@@ -77,8 +77,8 @@ function m(t, e) {
77
77
  const n = C(t);
78
78
  n.undoStack.push(e), n.redoStack.length = 0, n.undoStack.length > 100 && n.undoStack.splice(0, n.undoStack.length - 100), c = t;
79
79
  }
80
- function v(t, e = "undo") {
81
- if (A(), t?.isConnected)
80
+ function A(t, e = "undo") {
81
+ if (v(), t?.isConnected)
82
82
  return t;
83
83
  const n = l();
84
84
  if (n?.isConnected)
@@ -139,10 +139,10 @@ function L(t, e) {
139
139
  }
140
140
  const x = () => {
141
141
  const t = l();
142
- return L("undo", t).changed ? !0 : M(t);
142
+ return L("undo", t).changed ? !0 : M(t ?? void 0);
143
143
  }, k = () => {
144
144
  const t = l();
145
- return L("redo", t).changed ? !0 : b(t);
145
+ return L("redo", t).changed ? !0 : b(t ?? void 0);
146
146
  }, O = (t, e, n) => {
147
147
  if (!(t instanceof HTMLElement)) return;
148
148
  const o = a(t), r = t.hasAttribute(e), i = t.getAttribute(e);
@@ -193,12 +193,12 @@ const x = () => {
193
193
  }
194
194
  }), !0);
195
195
  }, M = (t) => {
196
- const e = v(t, "undo");
196
+ const e = A(t, "undo");
197
197
  if (!e) return !1;
198
198
  const n = C(e), o = n.undoStack.pop();
199
199
  return o ? (o.undo(), n.redoStack.push(o), c = e, s(e), !0) : !1;
200
200
  }, b = (t) => {
201
- const e = v(t, "redo");
201
+ const e = A(t, "redo");
202
202
  if (!e) return !1;
203
203
  const n = C(e), o = n.redoStack.pop();
204
204
  return o ? (o.redo(), n.undoStack.push(o), c = e, s(e), !0) : !1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=40,s=e=>["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"].includes(e.tagName)&&e.getAttribute("contenteditable")!=="true",E=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const o=t;if(o.getAttribute("contenteditable")==="true")return o}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},l=e=>{let n=e;if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t}for(;n;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t;if(t.getAttribute("contenteditable")==="true")break}n=n.parentNode}return null},p=(e,n)=>{const t=[],o=new Set,c=r=>{!r||o.has(r)||n.contains(r)&&s(r)&&(o.add(r),t.push(r))};if(e.collapsed)return c(l(e.startContainer)),t;const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r;if(!s(a))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(a)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const u=document.createRange();return u.selectNodeContents(a),e.compareBoundaryPoints(Range.END_TO_START,u)>0&&e.compareBoundaryPoints(Range.START_TO_END,u)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let d=i.nextNode();for(;d;)c(d),d=i.nextNode();return t.length===0&&c(l(e.commonAncestorContainer)),t},h=e=>{const n=window.getComputedStyle(e),t=n.paddingLeft;if(t.endsWith("px"))return parseFloat(t);if(t.endsWith("em")){const o=parseFloat(n.fontSize);return parseFloat(t)*o}return 0},T=(e,n)=>{if(n===e.innerHTML)return;const t=window.execEditorCommand||window.executeEditorCommand;if(typeof t=="function")try{t("recordDomTransaction",e,n,e.innerHTML)}catch{}},b=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const r=h(i)+m;i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},w=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const d=h(i),r=Math.max(0,d-m);i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},f=(e,n)=>{typeof window<"u"&&window.registerEditorCommand?.(e,n)},g=()=>{f("increaseIndent",b),f("decreaseIndent",w)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g());const v=()=>({name:"indent",toolbar:[{label:"Increase Indent",command:"increaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM3 8l4 4-4 4V8z"/></svg>',shortcut:"Mod-]"},{label:"Decrease Indent",command:"decreaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM7 8v8l-4-4 4-4z"/></svg>',shortcut:"Mod-["}],commands:{increaseIndent:b,decreaseIndent:w},keymap:{"Mod-]":"increaseIndent","Mod-[":"decreaseIndent",Tab:"increaseIndent","Shift-Tab":"decreaseIndent"}});exports.IndentPlugin=v;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const m=40,s=e=>["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"].includes(e.tagName)&&e.getAttribute("contenteditable")!=="true",E=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let t=e.getRangeAt(0).startContainer;for(;t&&t!==document.body;){if(t.nodeType===Node.ELEMENT_NODE){const o=t;if(o.getAttribute("contenteditable")==="true")return o}t=t.parentNode}}const n=document.activeElement;if(n){if(n.getAttribute("contenteditable")==="true")return n;const t=n.closest('[contenteditable="true"]');if(t)return t}return document.querySelector('[contenteditable="true"]')},l=e=>{let n=e;if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t}for(;n;){if(n.nodeType===Node.ELEMENT_NODE){const t=n;if(s(t))return t;if(t.getAttribute("contenteditable")==="true")break}n=n.parentNode}return null},p=(e,n)=>{const t=[],o=new Set,c=r=>{!r||o.has(r)||n.contains(r)&&s(r)&&(o.add(r),t.push(r))};if(e.collapsed)return c(l(e.startContainer)),t;const i=document.createTreeWalker(n,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r;if(!s(a))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(a)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const u=document.createRange();return u.selectNodeContents(a),e.compareBoundaryPoints(Range.END_TO_START,u)>0&&e.compareBoundaryPoints(Range.START_TO_END,u)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let d=i.nextNode();for(;d;)c(d),d=i.nextNode();return t.length===0&&c(l(e.commonAncestorContainer)),t},h=e=>{const n=window.getComputedStyle(e),t=n.paddingLeft;if(t.endsWith("px"))return parseFloat(t);if(t.endsWith("em")){const o=parseFloat(n.fontSize);return parseFloat(t)*o}return 0},T=(e,n)=>{if(n===e.innerHTML)return;const t=window.execEditorCommand||window.executeEditorCommand;if(typeof t=="function")try{t("recordDomTransaction",e,n,e.innerHTML)}catch{}},b=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const r=h(i)+m;i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},v=()=>{const e=E();if(!e)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const t=n.getRangeAt(0);if(!e.contains(t.commonAncestorContainer))return!1;const o=p(t,e);if(o.length===0)return!1;const c=e.innerHTML;return o.forEach(i=>{const d=h(i),r=Math.max(0,d-m);i.style.paddingLeft=`${r}px`}),T(e,c),e.dispatchEvent(new Event("input",{bubbles:!0})),!0},f=(e,n)=>{typeof window<"u"&&window.registerEditorCommand?.(e,n)},g=()=>{f("increaseIndent",b),f("decreaseIndent",v)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",g):g());const w=()=>({name:"indent",toolbar:[{label:"Increase Indent",command:"increaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM3 8l4 4-4 4V8z"/></svg>',shortcut:"Mod-]"},{label:"Decrease Indent",command:"decreaseIndent",type:"button",icon:'<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor"><path d="M3 4h18v2H3V4zm0 14h18v2H3v-2zm8-7h10v2H11v-2zm0 4h10v2H11v-2zM7 8v8l-4-4 4-4z"/></svg>',shortcut:"Mod-["}],commands:{increaseIndent:b,decreaseIndent:v},keymap:{"Mod-]":"increaseIndent","Mod-[":"decreaseIndent",Tab:"increaseIndent","Shift-Tab":"decreaseIndent"}});exports.IndentPlugin=w;
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./heading.cjs.js"),l=require("./bold.cjs.js"),t=require("./italic.cjs.js"),u=require("./underline.cjs.js"),g=require("./strikethrough.cjs.js"),o=require("./list.cjs.js"),a=require("./checklist.cjs.js"),c=require("./history.cjs.js"),P=require("./link.cjs.js"),s=require("./blockquote.cjs.js"),q=require("./clear-formatting.cjs.js"),m=require("./code.cjs.js"),d=require("./table.cjs.js"),C=require("./font-size.cjs.js"),h=require("./font-family.cjs.js"),p=require("./text-alignment.cjs.js"),M=require("./text-color.cjs.js"),k=require("./background-color.cjs.js"),f=require("./line-height.cjs.js"),b=require("./indent.cjs.js"),A=require("./direction.cjs.js"),F=require("./capitalization.cjs.js"),S=require("./math.cjs.js"),T=require("./special-characters.cjs.js"),y=require("./emojis.cjs.js"),B=require("./embed-iframe.cjs.js"),H=require("./anchor.cjs.js"),i=require("./media-manager.cjs.js"),n=require("./index-D3pJyAsj.js"),D=require("./preview.cjs.js"),I=require("./fullscreen.cjs.js"),x=require("./print.cjs.js"),z=require("./page-break.cjs.js"),G=require("./footnote.cjs.js"),L=require("./code-sample.cjs.js"),j=require("./merge-tag.cjs.js"),v=require("./template.cjs.js"),E=require("./comments.cjs.js"),U=require("./spell-check.cjs.js"),w=require("./a11y-checker.cjs.js"),e=require("./shared-config.cjs.js");exports.HeadingPlugin=r.HeadingPlugin;exports.BoldPlugin=l.BoldPlugin;exports.ItalicPlugin=t.ItalicPlugin;exports.UnderlinePlugin=u.UnderlinePlugin;exports.StrikethroughPlugin=g.StrikethroughPlugin;exports.ListPlugin=o.ListPlugin;exports.ChecklistPlugin=a.ChecklistPlugin;exports.HistoryPlugin=c.HistoryPlugin;exports.LinkPlugin=P.LinkPlugin;exports.BlockquotePlugin=s.BlockquotePlugin;exports.ClearFormattingPlugin=q.ClearFormattingPlugin;exports.CodePlugin=m.CodePlugin;exports.TablePlugin=d.TablePlugin;exports.FontSizePlugin=C.FontSizePlugin;exports.FontFamilyPlugin=h.FontFamilyPlugin;exports.TextAlignmentPlugin=p.TextAlignmentPlugin;exports.TextColorPlugin=M.TextColorPlugin;exports.BackgroundColorPlugin=k.BackgroundColorPlugin;exports.LineHeightPlugin=f.LineHeightPlugin;exports.IndentPlugin=b.IndentPlugin;exports.DirectionPlugin=A.DirectionPlugin;exports.CapitalizationPlugin=F.CapitalizationPlugin;exports.MathPlugin=S.MathPlugin;exports.SpecialCharactersPlugin=T.SpecialCharactersPlugin;exports.EmojisPlugin=y.EmojisPlugin;exports.EmbedIframePlugin=B.EmbedIframePlugin;exports.AnchorPlugin=H.AnchorPlugin;exports.MediaManagerPlugin=i.MediaManagerPlugin;exports.getMediaManagerConfig=i.getMediaManagerConfig;exports.setMediaManagerConfig=i.setMediaManagerConfig;exports.DocumentManagerPlugin=n.DocumentManagerPlugin;exports.getDocumentManagerConfig=n.getDocumentManagerConfig;exports.setDocumentManagerConfig=n.setDocumentManagerConfig;exports.PreviewPlugin=D.PreviewPlugin;exports.FullscreenPlugin=I.FullscreenPlugin;exports.PrintPlugin=x.PrintPlugin;exports.PageBreakPlugin=z.PageBreakPlugin;exports.FootnotePlugin=G.FootnotePlugin;exports.CodeSamplePlugin=L.CodeSamplePlugin;exports.MergeTagPlugin=j.MergeTagPlugin;exports.TemplatePlugin=v.TemplatePlugin;exports.CommentsPlugin=E.CommentsPlugin;exports.SpellCheckPlugin=U.SpellCheckPlugin;exports.A11yCheckerPlugin=w.A11yCheckerPlugin;exports.buildApiUrl=e.buildApiUrl;exports.getGlobalApiConfig=e.getGlobalApiConfig;exports.getGlobalApiHeaders=e.getGlobalApiHeaders;exports.setGlobalApiConfig=e.setGlobalApiConfig;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./heading.cjs.js"),l=require("./bold.cjs.js"),t=require("./italic.cjs.js"),u=require("./underline.cjs.js"),g=require("./strikethrough.cjs.js"),o=require("./list.cjs.js"),a=require("./checklist.cjs.js"),c=require("./history.cjs.js"),P=require("./link.cjs.js"),s=require("./blockquote.cjs.js"),q=require("./clear-formatting.cjs.js"),d=require("./code.cjs.js"),m=require("./table.cjs.js"),C=require("./font-size.cjs.js"),h=require("./font-family.cjs.js"),p=require("./text-alignment.cjs.js"),M=require("./text-color.cjs.js"),k=require("./background-color.cjs.js"),f=require("./line-height.cjs.js"),b=require("./indent.cjs.js"),A=require("./direction.cjs.js"),F=require("./capitalization.cjs.js"),S=require("./math.cjs.js"),T=require("./special-characters.cjs.js"),y=require("./emojis.cjs.js"),B=require("./embed-iframe.cjs.js"),H=require("./anchor.cjs.js"),i=require("./media-manager.cjs.js"),n=require("./index-D3pJyAsj.js"),D=require("./preview.cjs.js"),I=require("./fullscreen.cjs.js"),x=require("./print.cjs.js"),z=require("./page-break.cjs.js"),G=require("./footnote.cjs.js"),L=require("./code-sample.cjs.js"),v=require("./merge-tag.cjs.js"),j=require("./template.cjs.js"),E=require("./comments.cjs.js"),U=require("./spell-check.cjs.js"),w=require("./a11y-checker.cjs.js"),e=require("./shared-config.cjs.js");exports.HeadingPlugin=r.HeadingPlugin;exports.BoldPlugin=l.BoldPlugin;exports.ItalicPlugin=t.ItalicPlugin;exports.UnderlinePlugin=u.UnderlinePlugin;exports.StrikethroughPlugin=g.StrikethroughPlugin;exports.ListPlugin=o.ListPlugin;exports.ChecklistPlugin=a.ChecklistPlugin;exports.HistoryPlugin=c.HistoryPlugin;exports.LinkPlugin=P.LinkPlugin;exports.BlockquotePlugin=s.BlockquotePlugin;exports.ClearFormattingPlugin=q.ClearFormattingPlugin;exports.CodePlugin=d.CodePlugin;exports.TablePlugin=m.TablePlugin;exports.FontSizePlugin=C.FontSizePlugin;exports.FontFamilyPlugin=h.FontFamilyPlugin;exports.TextAlignmentPlugin=p.TextAlignmentPlugin;exports.TextColorPlugin=M.TextColorPlugin;exports.BackgroundColorPlugin=k.BackgroundColorPlugin;exports.LineHeightPlugin=f.LineHeightPlugin;exports.IndentPlugin=b.IndentPlugin;exports.DirectionPlugin=A.DirectionPlugin;exports.CapitalizationPlugin=F.CapitalizationPlugin;exports.MathPlugin=S.MathPlugin;exports.SpecialCharactersPlugin=T.SpecialCharactersPlugin;exports.EmojisPlugin=y.EmojisPlugin;exports.EmbedIframePlugin=B.EmbedIframePlugin;exports.AnchorPlugin=H.AnchorPlugin;exports.MediaManagerPlugin=i.MediaManagerPlugin;exports.getMediaManagerConfig=i.getMediaManagerConfig;exports.setMediaManagerConfig=i.setMediaManagerConfig;exports.DocumentManagerPlugin=n.DocumentManagerPlugin;exports.getDocumentManagerConfig=n.getDocumentManagerConfig;exports.setDocumentManagerConfig=n.setDocumentManagerConfig;exports.PreviewPlugin=D.PreviewPlugin;exports.FullscreenPlugin=I.FullscreenPlugin;exports.PrintPlugin=x.PrintPlugin;exports.PageBreakPlugin=z.PageBreakPlugin;exports.FootnotePlugin=G.FootnotePlugin;exports.CodeSamplePlugin=L.CodeSamplePlugin;exports.MergeTagPlugin=v.MergeTagPlugin;exports.TemplatePlugin=j.TemplatePlugin;exports.CommentsPlugin=E.CommentsPlugin;exports.SpellCheckPlugin=U.SpellCheckPlugin;exports.A11yCheckerPlugin=w.A11yCheckerPlugin;exports.buildApiUrl=e.buildApiUrl;exports.getGlobalApiConfig=e.getGlobalApiConfig;exports.getGlobalApiHeaders=e.getGlobalApiHeaders;exports.setGlobalApiConfig=e.setGlobalApiConfig;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=()=>(document.execCommand("italic",!1),!0),l=(i,o)=>{typeof window<"u"&&window.registerEditorCommand?.(i,o)},t=()=>{l("toggleItalic",e)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t());const a=()=>({name:"italic",marks:{italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}},toolbar:[{label:"Italic",command:"toggleItalic",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-i"}],commands:{toggleItalic:e},keymap:{"Mod-i":"toggleItalic","Mod-I":"toggleItalic"}});exports.ItalicPlugin=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=()=>(document.execCommand("italic",!1),!0),o=(i,l)=>{typeof window<"u"&&window.registerEditorCommand?.(i,l)},t=()=>{o("toggleItalic",e)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t());const a=()=>({name:"italic",marks:{italic:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]}},toolbar:[{label:"Italic",command:"toggleItalic",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M16.7 4.7l-.1.9h-.3c-.6 0-1 0-1.4.3-.3.3-.4.6-.5 1.1l-2.1 9.8v.6c0 .5.4.8 1.4.8h.2l-.2.8H8l.2-.8h.2c1.1 0 1.8-.5 2-1.5l2-9.8.1-.5c0-.6-.4-.8-1.4-.8h-.3l.2-.9h5.8Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-i"}],commands:{toggleItalic:e},keymap:{"Mod-i":"toggleItalic","Mod-I":"toggleItalic"}});exports.ItalicPlugin=a;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=[{label:"1.0",value:"1.0"},{label:"1.15",value:"1.15"},{label:"1.5",value:"1.5"},{label:"2.0",value:"2.0"},{label:"2.5",value:"2.5"},{label:"3.0",value:"3.0"}],m=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"]),d=e=>m.has(e.tagName)&&e.getAttribute("contenteditable")!=="true",E=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let n=e.getRangeAt(0).startContainer;for(;n&&n!==document.body;){if(n.nodeType===Node.ELEMENT_NODE){const o=n;if(o.getAttribute("contenteditable")==="true")return o}n=n.parentNode}}const t=document.activeElement;if(t){if(t.getAttribute("contenteditable")==="true")return t;const n=t.closest('[contenteditable="true"]');if(n)return n}return document.querySelector('[contenteditable="true"]')},u=e=>{let t=e;for(;t;){if(t.nodeType===Node.ELEMENT_NODE){const n=t;if(d(n))return n;if(n.getAttribute("contenteditable")==="true")break}t=t.parentNode}return null},H=(e,t)=>{const n=[],o=new Set,r=i=>{!i||o.has(i)||t.contains(i)&&d(i)&&(o.add(i),n.push(i))};if(e.collapsed)return r(u(e.startContainer)),n;const s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i;if(!d(c))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(c)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const l=document.createRange();return l.selectNodeContents(c),e.compareBoundaryPoints(Range.END_TO_START,l)>0&&e.compareBoundaryPoints(Range.START_TO_END,l)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let a=s.nextNode();for(;a;)r(a),a=s.nextNode();return n.length===0&&r(u(e.commonAncestorContainer)),n},b=e=>{e.dispatchEvent(new Event("input",{bubbles:!0}))},L=(e,t)=>{if(t===e.innerHTML)return;const n=window.execEditorCommand||window.executeEditorCommand;if(typeof n=="function")try{n("recordDomTransaction",e,t,e.innerHTML)}catch{}},h=e=>{if(!e)return!1;try{const t=E();if(!t)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const o=n.getRangeAt(0);if(!t.contains(o.commonAncestorContainer))return!1;const r=H(o,t);if(r.length===0)return!1;const s=t.innerHTML;return r.forEach(a=>{a.style.lineHeight=e}),L(t,s),b(t),!0}catch(t){return console.error("Failed to set line height:",t),!1}},T=(e,t)=>{typeof window<"u"&&window.registerEditorCommand?.(e,t)},f=()=>{T("setLineHeight",h)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f());const p=()=>({name:"lineHeight",marks:{lineHeight:{attrs:{height:{default:null}},parseDOM:[{tag:'span[style*="line-height"]',getAttrs:e=>{const n=e.style.lineHeight;return n?{height:n}:!1}}],toDOM:e=>["span",{style:`line-height: ${e.attrs?.height}`},0]}},toolbar:[{label:"Line Height",command:"setLineHeight",type:"inline-menu",options:g,icon:'<svg width="24" height="24" focusable="false"><path d="M21 5a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zM7 3.6l3.7 3.7a1 1 0 0 1-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 0 1 1.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 0 1 1.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 0 1-1.3 0h-.1a1 1 0 0 1 0-1.3v-.1L7 3.6z"></path></svg>'}],commands:{setLineHeight:h}});exports.LineHeightPlugin=p;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const g=[{label:"1.0",value:"1.0"},{label:"1.15",value:"1.15"},{label:"1.5",value:"1.5"},{label:"2.0",value:"2.0"},{label:"2.5",value:"2.5"},{label:"3.0",value:"3.0"}],m=new Set(["P","DIV","H1","H2","H3","H4","H5","H6","LI","BLOCKQUOTE","PRE"]),u=e=>m.has(e.tagName)&&e.getAttribute("contenteditable")!=="true",E=()=>{const e=window.getSelection();if(e&&e.rangeCount>0){let n=e.getRangeAt(0).startContainer;for(;n&&n!==document.body;){if(n.nodeType===Node.ELEMENT_NODE){const o=n;if(o.getAttribute("contenteditable")==="true")return o}n=n.parentNode}}const t=document.activeElement;if(t){if(t.getAttribute("contenteditable")==="true")return t;const n=t.closest('[contenteditable="true"]');if(n)return n}return document.querySelector('[contenteditable="true"]')},d=e=>{let t=e;for(;t;){if(t.nodeType===Node.ELEMENT_NODE){const n=t;if(u(n))return n;if(n.getAttribute("contenteditable")==="true")break}t=t.parentNode}return null},H=(e,t)=>{const n=[],o=new Set,r=i=>{!i||o.has(i)||t.contains(i)&&u(i)&&(o.add(i),n.push(i))};if(e.collapsed)return r(d(e.startContainer)),n;const s=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:i=>{const c=i;if(!u(c))return NodeFilter.FILTER_SKIP;if(typeof e.intersectsNode=="function")return e.intersectsNode(c)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP;const l=document.createRange();return l.selectNodeContents(c),e.compareBoundaryPoints(Range.END_TO_START,l)>0&&e.compareBoundaryPoints(Range.START_TO_END,l)<0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});let a=s.nextNode();for(;a;)r(a),a=s.nextNode();return n.length===0&&r(d(e.commonAncestorContainer)),n},b=e=>{e.dispatchEvent(new Event("input",{bubbles:!0}))},L=(e,t)=>{if(t===e.innerHTML)return;const n=window.execEditorCommand||window.executeEditorCommand;if(typeof n=="function")try{n("recordDomTransaction",e,t,e.innerHTML)}catch{}},h=e=>{if(!e)return!1;try{const t=E();if(!t)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const o=n.getRangeAt(0);if(!t.contains(o.commonAncestorContainer))return!1;const r=H(o,t);if(r.length===0)return!1;const s=t.innerHTML;return r.forEach(a=>{a.style.lineHeight=e}),L(t,s),b(t),!0}catch(t){return console.error("Failed to set line height:",t),!1}},T=(e,t)=>{typeof window<"u"&&window.registerEditorCommand?.(e,t)},f=()=>{T("setLineHeight",h)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",f):f());const p=()=>({name:"lineHeight",marks:{lineHeight:{attrs:{height:{default:null}},parseDOM:[{tag:'span[style*="line-height"]',getAttrs:e=>{const n=e.style.lineHeight;return n?{height:n}:!1}}],toDOM:e=>["span",{style:`line-height: ${e.attrs?.height}`},0]}},toolbar:[{label:"Line Height",command:"setLineHeight",type:"inline-menu",options:g,icon:'<svg width="24" height="24" focusable="false"><path d="M21 5a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zm0 4a1 1 0 0 1 .1 2H13a1 1 0 0 1-.1-2H21zM7 3.6l3.7 3.7a1 1 0 0 1-1.3 1.5h-.1L8 7.3v9.2l1.3-1.3a1 1 0 0 1 1.3 0h.1c.4.4.4 1 0 1.3v.1L7 20.4l-3.7-3.7a1 1 0 0 1 1.3-1.5h.1L6 16.7V7.4L4.7 8.7a1 1 0 0 1-1.3 0h-.1a1 1 0 0 1 0-1.3v-.1L7 3.6z"></path></svg>'}],commands:{setLineHeight:h}});exports.LineHeightPlugin=p;
package/dist/link.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let a=null,p=!1,l=null;const c='[data-theme="dark"], .dark, .editora-theme-dark',L=e=>{if(!e)return null;let t=e;for(;t;){if(t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="true"||t.hasAttribute("data-editora-content"))return t;t=t.parentElement}return null},w=e=>{if(e){const n=e.startContainer;if((n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest(c))return!0}return document.activeElement?.closest(c)?!0:document.body.matches(c)||document.documentElement.matches(c)},C=()=>{if(document.getElementById("rte-link-dialog-theme-styles"))return;const e=document.createElement("style");e.id="rte-link-dialog-theme-styles",e.textContent=`
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});let a=null,u=!1,l=null;const c='[data-theme="dark"], .dark, .editora-theme-dark',L=e=>{if(!e)return null;let t=e;for(;t;){if(t.hasAttribute("contenteditable")&&t.getAttribute("contenteditable")==="true"||t.hasAttribute("data-editora-content"))return t;t=t.parentElement}return null},w=e=>{if(e){const n=e.startContainer;if((n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest(c))return!0}return document.activeElement?.closest(c)?!0:document.body.matches(c)||document.documentElement.matches(c)},C=()=>{if(document.getElementById("rte-link-dialog-theme-styles"))return;const e=document.createElement("style");e.id="rte-link-dialog-theme-styles",e.textContent=`
2
2
  .link-dialog-overlay.rte-theme-dark .link-dialog {
3
3
  background: #1f2937 !important;
4
4
  border: 1px solid #4b5563 !important;
@@ -61,7 +61,7 @@
61
61
  .link-dialog-overlay.rte-theme-dark .btn-submit:hover {
62
62
  background: #2563eb !important;
63
63
  }
64
- `,document.head.appendChild(e)},T=e=>{if(!a){console.warn("No selection range stored");return}const t=a.startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t,o=L(n);if(o){if(p&&l){l.href=e.url,l.textContent=e.text,l.target=e.target,e.target==="_blank"?l.setAttribute("rel","noopener noreferrer"):l.removeAttribute("rel"),e.title?l.title=e.title:l.removeAttribute("title");const r=document.createRange();r.selectNodeContents(l);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(r))}else{const r=document.createElement("a");r.href=e.url,r.textContent=e.text,r.target=e.target,e.target==="_blank"&&r.setAttribute("rel","noopener noreferrer"),e.title&&(r.title=e.title),a.deleteContents(),a.insertNode(r),a.setStartAfter(r),a.setEndAfter(r);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(a))}o.focus(),a=null,p=!1,l=null}},b=(e,t)=>{C();const n=document.createElement("div");n.className="link-dialog-overlay",t&&n.classList.add("rte-theme-dark"),n.style.cssText=`
64
+ `,document.head.appendChild(e)},T=e=>{if(!a){console.warn("No selection range stored");return}const t=a.startContainer,n=t.nodeType===Node.TEXT_NODE?t.parentElement:t,o=L(n);if(o){if(u&&l){l.href=e.url,l.textContent=e.text,l.target=e.target,e.target==="_blank"?l.setAttribute("rel","noopener noreferrer"):l.removeAttribute("rel"),e.title?l.title=e.title:l.removeAttribute("title");const r=document.createRange();r.selectNodeContents(l);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(r))}else{const r=document.createElement("a");r.href=e.url,r.textContent=e.text,r.target=e.target,e.target==="_blank"&&r.setAttribute("rel","noopener noreferrer"),e.title&&(r.title=e.title),a.deleteContents(),a.insertNode(r),a.setStartAfter(r),a.setEndAfter(r);const i=window.getSelection();i&&(i.removeAllRanges(),i.addRange(a))}o.focus(),a=null,u=!1,l=null}},b=(e,t)=>{C();const n=document.createElement("div");n.className="link-dialog-overlay",t&&n.classList.add("rte-theme-dark"),n.style.cssText=`
65
65
  position: fixed;
66
66
  top: 0;
67
67
  left: 0;
@@ -135,4 +135,4 @@
135
135
  </button>
136
136
  </div>
137
137
  </form>
138
- `,n.appendChild(o),document.body.appendChild(n);const r=o.querySelector("#link-form"),i=o.querySelector("#link-text"),d=o.querySelector("#link-url"),x=o.querySelector("#link-title"),y=o.querySelector("#link-target"),v=o.querySelector(".link-dialog-close"),E=o.querySelector(".btn-cancel"),s=()=>{document.body.removeChild(n)};v.addEventListener("click",s),E.addEventListener("click",s),n.addEventListener("click",u=>{u.target===n&&s()}),r.addEventListener("submit",u=>{u.preventDefault();const m=d.value.trim();m&&(T({text:i.value.trim()||m,url:m,target:y.checked?"_blank":"_self",title:x.value.trim()||void 0}),s())}),setTimeout(()=>i.focus(),100)},f=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return!1;const t=e.getRangeAt(0).cloneRange();a=t;const n=w(t),o=e.toString()||"",r=t.startContainer,d=(r.nodeType===Node.TEXT_NODE?r.parentElement:r)?.closest("a");return d?(p=!0,l=d,b({text:d.textContent||"",url:d.href,target:d.target||"_self",title:d.title||"",isEditing:!0},n)):(p=!1,l=null,b({text:o,url:"",target:"_self",isEditing:!1},n)),!0},h=()=>(document.execCommand("unlink",!1),!0),g=(e,t)=>{typeof window<"u"&&window.registerEditorCommand?.(e,t)},k=()=>{g("openLinkDialog",f),g("removeLink",h),g("createLink",e=>{e&&document.execCommand("createLink",!1,e)})};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k());const A=()=>({name:"link",marks:{link:{attrs:{href:{},title:{default:null},target:{default:null}},parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),title:e.getAttribute("title"),target:e.getAttribute("target")})}],toDOM:e=>["a",{href:e.attrs.href,title:e.attrs.title,target:e.attrs.target,rel:e.attrs.target==="_blank"?"noopener noreferrer":null},0]}},toolbar:[{label:"Link",command:"openLinkDialog",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-k"}],commands:{openLinkDialog:f,removeLink:h},keymap:{"Mod-k":"openLinkDialog"}});exports.LinkPlugin=A;
138
+ `,n.appendChild(o),document.body.appendChild(n);const r=o.querySelector("#link-form"),i=o.querySelector("#link-text"),d=o.querySelector("#link-url"),x=o.querySelector("#link-title"),y=o.querySelector("#link-target"),v=o.querySelector(".link-dialog-close"),E=o.querySelector(".btn-cancel"),s=()=>{document.body.removeChild(n)};v.addEventListener("click",s),E.addEventListener("click",s),n.addEventListener("click",p=>{p.target===n&&s()}),r.addEventListener("submit",p=>{p.preventDefault();const m=d.value.trim();m&&(T({text:i.value.trim()||m,url:m,target:y.checked?"_blank":"_self",title:x.value.trim()||void 0}),s())}),setTimeout(()=>i.focus(),100)},f=()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return!1;const t=e.getRangeAt(0).cloneRange();a=t;const n=w(t),o=e.toString()||"",r=t.startContainer,d=(r.nodeType===Node.TEXT_NODE?r.parentElement:r)?.closest("a");return d?(u=!0,l=d,b({text:d.textContent||"",url:d.href,target:d.target||"_self",title:d.title||"",isEditing:!0},n)):(u=!1,l=null,b({text:o,url:"",target:"_self",isEditing:!1},n)),!0},h=()=>(document.execCommand("unlink",!1),!0),g=(e,t)=>{typeof window<"u"&&window.registerEditorCommand?.(e,t)},k=()=>{g("openLinkDialog",f),g("removeLink",h),g("createLink",e=>{e&&document.execCommand("createLink",!1,e)})};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",k):k());const A=()=>({name:"link",marks:{link:{attrs:{href:{},title:{default:null},target:{default:null}},parseDOM:[{tag:"a[href]",getAttrs:e=>({href:e.getAttribute("href"),title:e.getAttribute("title"),target:e.getAttribute("target")})}],toDOM:e=>["a",{href:e.attrs.href,title:e.attrs.title,target:e.attrs.target,rel:e.attrs.target==="_blank"?"noopener noreferrer":null},0]}},toolbar:[{label:"Link",command:"openLinkDialog",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M6.2 12.3a1 1 0 0 1 1.4 1.4l-2 2a2 2 0 1 0 2.6 2.8l4.8-4.8a1 1 0 0 0 0-1.4 1 1 0 1 1 1.4-1.3 2.9 2.9 0 0 1 0 4L9.6 20a3.9 3.9 0 0 1-5.5-5.5l2-2Zm11.6-.6a1 1 0 0 1-1.4-1.4l2-2a2 2 0 1 0-2.6-2.8L11 10.3a1 1 0 0 0 0 1.4A1 1 0 1 1 9.6 13a2.9 2.9 0 0 1 0-4L14.4 4a3.9 3.9 0 0 1 5.5 5.5l-2 2Z" fill-rule="nonzero"></path></svg>',shortcut:"Mod-k"}],commands:{openLinkDialog:f,removeLink:h},keymap:{"Mod-k":"openLinkDialog"}});exports.LinkPlugin=A;
package/dist/list.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=()=>m("insertUnorderedList"),u=()=>m("insertOrderedList");function g(){const o=window.getSelection();if(o&&o.rangeCount>0){const n=o.getRangeAt(0).startContainer,e=(n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest('[contenteditable="true"], .rte-content, .editora-content');if(e)return e}const t=document.activeElement;return t?t.getAttribute("contenteditable")==="true"?t:t.closest('[contenteditable="true"], .rte-content, .editora-content'):null}function f(o){o.querySelectorAll('ul:not([data-type="checklist"]), ol').forEach(n=>{Array.from(n.childNodes).forEach(e=>{if(e.nodeType===Node.TEXT_NODE){const l=(e.textContent||"").trim();if(!l){n.removeChild(e);return}const s=document.createElement("li");s.textContent=l,n.replaceChild(s,e);return}if(!(e instanceof HTMLElement)){n.removeChild(e);return}if(e.tagName==="LI")return;const i=document.createElement("li");for(;e.firstChild;)i.appendChild(e.firstChild);n.replaceChild(i,e)})})}function m(o){const t=g();if(!t)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0);if(!t.contains(r.commonAncestorContainer))return!1;t.focus({preventScroll:!0});const e=document.execCommand(o,!1);return f(t),t.dispatchEvent(new Event("input",{bubbles:!0})),e!==!1}const c=(o,t)=>{typeof window<"u"&&window.registerEditorCommand?.(o,t)},a=()=>{c("toggleBulletList",d),c("toggleOrderedList",u)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a());const h=()=>({name:"list",nodes:{bulletList:{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]},orderedList:{content:"listItem+",group:"block",parseDOM:[{tag:"ol"}],toDOM:()=>["ol",0]},listItem:{content:"paragraph",parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}},toolbar:[{label:"Bullet List",command:"toggleBulletList",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-8"},{label:"Numbered List",command:"toggleOrderedList",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0 0-.2l-.7.3a.5.5 0 0 1-.7-.3.5.5 0 0 1 .3-.6l.7-.4c.5-.2 1.1 0 1.4.4.3.5.3 1.1-.1 1.5l-1.2.7Zm0 3.7v.5c0 .3.2.5.5.5h1c.3 0 .5.2.5.5s-.2.5-.5.5h-1a1.5 1.5 0 0 1-1.5-1.5v-.5c0-.3.1-.6.3-.8l1.3-1.4c.3-.4.1-.9-.2-1-.1 0-.2 0-.3.2l-.4.5a.5.5 0 0 1-.7.1.5.5 0 0 1-.1-.7l.4-.5c.5-.5 1.2-.6 1.8-.4.6.3 1 .9 1 1.6 0 .4-.2.8-.5 1.1l-1.3 1.4-.3.4Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-7"}],commands:{toggleBulletList:d,toggleOrderedList:u},keymap:{"Mod-Shift-8":"toggleBulletList","Mod-Shift-7":"toggleOrderedList"}});exports.ListPlugin=h;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=()=>m("insertUnorderedList"),u=()=>m("insertOrderedList");function g(){const o=window.getSelection();if(o&&o.rangeCount>0){const n=o.getRangeAt(0).startContainer,e=(n.nodeType===Node.ELEMENT_NODE?n:n.parentElement)?.closest('[contenteditable="true"], .rte-content, .editora-content');if(e)return e}const t=document.activeElement;return t?t.getAttribute("contenteditable")==="true"?t:t.closest('[contenteditable="true"], .rte-content, .editora-content'):null}function f(o){o.querySelectorAll('ul:not([data-type="checklist"]), ol').forEach(n=>{Array.from(n.childNodes).forEach(e=>{if(e.nodeType===Node.TEXT_NODE){const l=(e.textContent||"").trim();if(!l){n.removeChild(e);return}const s=document.createElement("li");s.textContent=l,n.replaceChild(s,e);return}if(!(e instanceof HTMLElement)){n.removeChild(e);return}if(e.tagName==="LI")return;const i=document.createElement("li");for(;e.firstChild;)i.appendChild(e.firstChild);n.replaceChild(i,e)})})}function m(o){const t=g();if(!t)return!1;const n=window.getSelection();if(!n||n.rangeCount===0)return!1;const r=n.getRangeAt(0);if(!t.contains(r.commonAncestorContainer))return!1;t.focus({preventScroll:!0});const e=document.execCommand(o,!1);return f(t),t.dispatchEvent(new Event("input",{bubbles:!0})),e!==!1}const c=(o,t)=>{typeof window<"u"&&window.registerEditorCommand?.(o,t)},a=()=>{c("toggleBulletList",d),c("toggleOrderedList",u)};typeof window<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a());const h=()=>({name:"list",nodes:{bulletList:{content:"listItem+",group:"block",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]},orderedList:{content:"listItem+",group:"block",parseDOM:[{tag:"ol"}],toDOM:()=>["ol",0]},listItem:{content:"paragraph",parseDOM:[{tag:"li"}],toDOM:()=>["li",0]}},toolbar:[{label:"Bullet List",command:"toggleBulletList",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2ZM4.5 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Zm0 6c0 .4.1.8.4 1 .3.4.7.5 1.1.5.4 0 .8-.1 1-.4.4-.3.5-.7.5-1.1 0-.4-.1-.8-.4-1-.3-.4-.7-.5-1.1-.5-.4 0-.8.1-1 .4-.4.3-.5.7-.5 1.1Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-8"},{label:"Numbered List",command:"toggleOrderedList",type:"button",icon:'<svg width="24" height="24" focusable="false"><path d="M10 17h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 0 1 0-2Zm0-6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 1 1 0-2ZM6 4v3.5c0 .3-.2.5-.5.5a.5.5 0 0 1-.5-.5V5h-.5a.5.5 0 0 1 0-1H6Zm-1 8.8l.2.2h1.3c.3 0 .5.2.5.5s-.2.5-.5.5H4.9a1 1 0 0 1-.9-1V13c0-.4.3-.8.6-1l1.2-.4.2-.3a.2.2 0 0 0 0-.2l-.7.3a.5.5 0 0 1-.7-.3.5.5 0 0 1 .3-.6l.7-.4c.5-.2 1.1 0 1.4.4.3.5.3 1.1-.1 1.5l-1.2.7Zm0 3.7v.5c0 .3.2.5.5.5h1c.3 0 .5.2.5.5s-.2.5-.5.5h-1a1.5 1.5 0 0 1-1.5-1.5v-.5c0-.3.1-.6.3-.8l1.3-1.4c.3-.4.1-.9-.2-1-.1 0-.2 0-.3.2l-.4.5a.5.5 0 0 1-.7.1.5.5 0 0 1-.1-.7l.4-.5c.5-.5 1.2-.6 1.8-.4.6.3 1 .9 1 1.6 0 .4-.2.8-.5 1.1l-1.3 1.4-.3.4Z" fill-rule="evenodd"></path></svg>',shortcut:"Mod-Shift-7"}],commands:{toggleBulletList:d,toggleOrderedList:u},keymap:{"Mod-Shift-8":"toggleBulletList","Mod-Shift-7":"toggleOrderedList"}});exports.ListPlugin=h;
package/dist/lite.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./heading.cjs.js"),e=require("./bold.cjs.js"),l=require("./italic.cjs.js"),r=require("./underline.cjs.js"),t=require("./strikethrough.cjs.js"),o=require("./list.cjs.js"),u=require("./checklist.cjs.js"),g=require("./history.cjs.js"),P=require("./link.cjs.js"),c=require("./blockquote.cjs.js"),a=require("./clear-formatting.cjs.js"),s=require("./table.cjs.js"),q=require("./font-size.cjs.js"),d=require("./font-family.cjs.js"),h=require("./text-alignment.cjs.js"),k=require("./text-color.cjs.js"),C=require("./background-color.cjs.js"),b=require("./line-height.cjs.js"),p=require("./indent.cjs.js"),F=require("./direction.cjs.js"),A=require("./capitalization.cjs.js"),f=require("./anchor.cjs.js"),m=require("./page-break.cjs.js"),B=require("./footnote.cjs.js"),H=require("./fullscreen.cjs.js"),y=require("./preview.cjs.js"),S=require("./print.cjs.js"),i=require("./shared-config.cjs.js");exports.HeadingPlugin=n.HeadingPlugin;exports.BoldPlugin=e.BoldPlugin;exports.ItalicPlugin=l.ItalicPlugin;exports.UnderlinePlugin=r.UnderlinePlugin;exports.StrikethroughPlugin=t.StrikethroughPlugin;exports.ListPlugin=o.ListPlugin;exports.ChecklistPlugin=u.ChecklistPlugin;exports.HistoryPlugin=g.HistoryPlugin;exports.LinkPlugin=P.LinkPlugin;exports.BlockquotePlugin=c.BlockquotePlugin;exports.ClearFormattingPlugin=a.ClearFormattingPlugin;exports.TablePlugin=s.TablePlugin;exports.FontSizePlugin=q.FontSizePlugin;exports.FontFamilyPlugin=d.FontFamilyPlugin;exports.TextAlignmentPlugin=h.TextAlignmentPlugin;exports.TextColorPlugin=k.TextColorPlugin;exports.BackgroundColorPlugin=C.BackgroundColorPlugin;exports.LineHeightPlugin=b.LineHeightPlugin;exports.IndentPlugin=p.IndentPlugin;exports.DirectionPlugin=F.DirectionPlugin;exports.CapitalizationPlugin=A.CapitalizationPlugin;exports.AnchorPlugin=f.AnchorPlugin;exports.PageBreakPlugin=m.PageBreakPlugin;exports.FootnotePlugin=B.FootnotePlugin;exports.FullscreenPlugin=H.FullscreenPlugin;exports.PreviewPlugin=y.PreviewPlugin;exports.PrintPlugin=S.PrintPlugin;exports.buildApiUrl=i.buildApiUrl;exports.getGlobalApiConfig=i.getGlobalApiConfig;exports.getGlobalApiHeaders=i.getGlobalApiHeaders;exports.setGlobalApiConfig=i.setGlobalApiConfig;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./heading.cjs.js"),n=require("./bold.cjs.js"),l=require("./italic.cjs.js"),r=require("./underline.cjs.js"),t=require("./strikethrough.cjs.js"),u=require("./list.cjs.js"),o=require("./checklist.cjs.js"),g=require("./history.cjs.js"),P=require("./link.cjs.js"),c=require("./blockquote.cjs.js"),s=require("./clear-formatting.cjs.js"),a=require("./table.cjs.js"),q=require("./font-size.cjs.js"),d=require("./font-family.cjs.js"),h=require("./text-alignment.cjs.js"),k=require("./text-color.cjs.js"),C=require("./background-color.cjs.js"),b=require("./line-height.cjs.js"),p=require("./indent.cjs.js"),F=require("./direction.cjs.js"),A=require("./capitalization.cjs.js"),f=require("./anchor.cjs.js"),m=require("./page-break.cjs.js"),B=require("./footnote.cjs.js"),H=require("./fullscreen.cjs.js"),y=require("./preview.cjs.js"),S=require("./print.cjs.js"),i=require("./shared-config.cjs.js");exports.HeadingPlugin=e.HeadingPlugin;exports.BoldPlugin=n.BoldPlugin;exports.ItalicPlugin=l.ItalicPlugin;exports.UnderlinePlugin=r.UnderlinePlugin;exports.StrikethroughPlugin=t.StrikethroughPlugin;exports.ListPlugin=u.ListPlugin;exports.ChecklistPlugin=o.ChecklistPlugin;exports.HistoryPlugin=g.HistoryPlugin;exports.LinkPlugin=P.LinkPlugin;exports.BlockquotePlugin=c.BlockquotePlugin;exports.ClearFormattingPlugin=s.ClearFormattingPlugin;exports.TablePlugin=a.TablePlugin;exports.FontSizePlugin=q.FontSizePlugin;exports.FontFamilyPlugin=d.FontFamilyPlugin;exports.TextAlignmentPlugin=h.TextAlignmentPlugin;exports.TextColorPlugin=k.TextColorPlugin;exports.BackgroundColorPlugin=C.BackgroundColorPlugin;exports.LineHeightPlugin=b.LineHeightPlugin;exports.IndentPlugin=p.IndentPlugin;exports.DirectionPlugin=F.DirectionPlugin;exports.CapitalizationPlugin=A.CapitalizationPlugin;exports.AnchorPlugin=f.AnchorPlugin;exports.PageBreakPlugin=m.PageBreakPlugin;exports.FootnotePlugin=B.FootnotePlugin;exports.FullscreenPlugin=H.FullscreenPlugin;exports.PreviewPlugin=y.PreviewPlugin;exports.PrintPlugin=S.PrintPlugin;exports.buildApiUrl=i.buildApiUrl;exports.getGlobalApiConfig=i.getGlobalApiConfig;exports.getGlobalApiHeaders=i.getGlobalApiHeaders;exports.setGlobalApiConfig=i.setGlobalApiConfig;