@editora/plugins 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CodePlugin.native-Cqi46sxh.js → CodePlugin.native-Bwf25lLX.js} +6 -6
- package/dist/{CodePlugin.native-CmnEFfJi.mjs → CodePlugin.native-Cpp4u3Jl.mjs} +23 -21
- package/dist/a11y-checker.cjs.js +16 -16
- package/dist/a11y-checker.esm.js +79 -75
- package/dist/anchor.cjs.js +9 -9
- package/dist/anchor.esm.js +61 -60
- package/dist/anchoredPopover-Bg-ey7Yo.js +1 -0
- package/dist/anchoredPopover-D_JbjvdA.mjs +111 -0
- package/dist/approval-workflow.cjs.js +5 -5
- package/dist/approval-workflow.esm.js +105 -104
- package/dist/background-color.cjs.js +1 -1
- package/dist/background-color.esm.js +1 -1
- package/dist/blocks-library.cjs.js +6 -6
- package/dist/blocks-library.esm.js +226 -202
- package/dist/capitalization.cjs.js +1 -1
- package/dist/capitalization.esm.js +9 -4
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +154 -116
- package/dist/citations.cjs.js +43 -18
- package/dist/citations.esm.js +465 -446
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +21 -20
- package/dist/code-sample.cjs.js +85 -66
- package/dist/code-sample.esm.js +301 -190
- package/dist/code.cjs.js +1 -1
- package/dist/code.esm.js +1 -1
- package/dist/collaboration.cjs.js +68 -0
- package/dist/collaboration.esm.js +7428 -0
- package/dist/comments.cjs.js +11 -11
- package/dist/comments.esm.js +284 -237
- package/dist/conditional-content.cjs.js +67 -60
- package/dist/conditional-content.esm.js +270 -220
- package/dist/data-binding.cjs.js +3 -3
- package/dist/data-binding.esm.js +28 -27
- package/dist/dialogHelpers-5d5BuOCW.mjs +39 -0
- package/dist/dialogHelpers-zU6zpMIA.js +12 -0
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +1 -1
- package/dist/{documentManager-3nPkITwx.js → documentManager-BDz6tovy.js} +1 -1
- package/dist/{documentManager-CRumGpCT.mjs → documentManager-yjRBab4v.mjs} +1 -1
- package/dist/embed-iframe.cjs.js +37 -17
- package/dist/embed-iframe.esm.js +188 -143
- package/dist/emojis.cjs.js +13 -10
- package/dist/emojis.esm.js +288 -76
- package/dist/enterprise.cjs.js +1 -1
- package/dist/enterprise.esm.js +9 -7
- package/dist/escapeHtml-D2Zh82pD.js +1 -0
- package/dist/escapeHtml-DyksyvcZ.mjs +6 -0
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +48 -41
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +67 -60
- package/dist/format-painter.cjs.js +1 -1
- package/dist/format-painter.esm.js +2 -1
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +40 -36
- package/dist/historyHelpers-BEKwNOtA.mjs +14 -0
- package/dist/historyHelpers-Cu8Pk7m1.js +1 -0
- package/dist/index-Bm1eqYHh.mjs +194 -0
- package/dist/index-CoflqYuK.js +30 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +17 -15
- package/dist/link.cjs.js +17 -13
- package/dist/link.esm.js +138 -69
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +66 -33
- package/dist/math.cjs.js +22 -22
- package/dist/math.esm.js +221 -126
- package/dist/media-manager.cjs.js +12 -12
- package/dist/media-manager.esm.js +55 -50
- package/dist/mentions.cjs.js +2 -2
- package/dist/mentions.esm.js +17 -12
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +43 -42
- package/dist/plugins.css +1 -1
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +30 -27
- package/dist/slash-commands.cjs.js +13 -7
- package/dist/slash-commands.esm.js +90 -79
- package/dist/smart-paste.cjs.js +5 -5
- package/dist/smart-paste.esm.js +85 -81
- package/dist/special-characters.cjs.js +6 -3
- package/dist/special-characters.esm.js +72 -25
- package/dist/spell-check.cjs.js +8 -8
- package/dist/spell-check.esm.js +10189 -295
- package/dist/table.cjs.js +166 -13
- package/dist/table.esm.js +543 -266
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +290 -264
- package/dist/text-color.cjs.js +1 -1
- package/dist/text-color.esm.js +1 -1
- package/dist/translation-workflow.cjs.js +4 -4
- package/dist/translation-workflow.esm.js +33 -31
- package/dist/version-diff.cjs.js +6 -6
- package/dist/version-diff.esm.js +40 -40
- package/package.json +11 -5
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/index-CJ90EVWy.mjs +0 -145
- package/dist/index-DTkvH8gX.js +0 -1
package/dist/comments.cjs.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const N=require("./historyHelpers-Cu8Pk7m1.js"),y=new WeakMap;let x=null,R=!1,H=0;const T="User";function S(e){return H+=1,`${e}-${Date.now()}-${H}`}function h(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 q(e){const t=e?.editorElement||e?.contentElement||null;if(!(t instanceof HTMLElement))return;const r=t.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(t.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?t:null);r&&(x=r)}function k(e,t){return t.contains(e.commonAncestorContainer)}function z(){if(typeof window<"u"){const o=window.__editoraCommandEditorRoot;if(o instanceof HTMLElement){const n=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(n)return x=n,window.__editoraCommandEditorRoot=null,n}}const e=document.activeElement,t=e?h(e):null;if(t)return t;const r=window.getSelection();if(r&&r.rangeCount>0){const o=h(r.getRangeAt(0).commonAncestorContainer);if(o)return o}return x}function D(e){const t=y.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 y.set(e,r),r}function u(){const e=z();return e?(x=e,D(e)):null}function V(e){const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return null;const r=t.getRangeAt(0);return k(r,e)?r.cloneRange():null}function $(e){return e.root.querySelector(".rte-content")||e.root.querySelector("[contenteditable]")}function C(e,t){return t.anchorId?e.root.querySelector(`[id="${t.anchorId}"]`):null}function O(e){const t=[];return e.comments.forEach(r=>{if(r.anchorId){const o=C(e,r);if(!o)return;r.resolved=o.classList.contains("rte-comment-anchor-resolved")}t.push(r)}),t}function A(e,t){const r=$(e),o=r?r.innerHTML:"",n=t();return r&&r.innerHTML!==o&&(N.recordDomHistory(r,o),r.dispatchEvent(new Event("input",{bubbles:!0}))),n}function I(e,t){const r=C(e,t);r&&r.classList.toggle("rte-comment-anchor-resolved",t.resolved)}function E(e,t,r){const o=e.comments.get(t);if(!o)return;const n=C(e,o);n&&n.classList.toggle("highlighted",r)}function P(e){const t=e.parentNode;if(t){for(;e.firstChild;)t.insertBefore(e.firstChild,e);e.remove()}}function w(e,t){if(e.panelVisible=t,t){Y(),_(e),e.root.setAttribute("data-rte-comments-open","true"),e.panelElement&&(e.panelElement.classList.add("is-open"),e.panelElement.setAttribute("aria-hidden","false")),j(e);return}e.root.removeAttribute("data-rte-comments-open"),F(e),e.panelElement&&(e.panelElement.remove(),e.panelElement=null)}function _(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 j(e){e.selectionChangeListener||(e.selectionChangeListener=()=>{const t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return;const r=t.getRangeAt(0);k(r,e.root)&&(e.savedSelection=r.cloneRange(),x=e.root)},document.addEventListener("selectionchange",e.selectionChangeListener))}function F(e){e.selectionChangeListener&&(document.removeEventListener("selectionchange",e.selectionChangeListener),e.selectionChangeListener=null)}function Z(e){return O(e).sort((t,r)=>r.createdAt.localeCompare(t.createdAt))}function B(e){return new Date(e).toLocaleString()}function K(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
|
-
<strong class="rte-comment-author"
|
|
5
|
-
<time class="rte-comment-date">${
|
|
4
|
+
<strong class="rte-comment-author"></strong>
|
|
5
|
+
<time class="rte-comment-date">${B(t.createdAt)}</time>
|
|
6
6
|
</div>
|
|
7
7
|
<button class="rte-comment-expand" type="button" aria-label="Toggle details">
|
|
8
8
|
${r?"▾":"▸"}
|
|
9
9
|
</button>
|
|
10
10
|
</header>
|
|
11
11
|
<div class="rte-comment-text"></div>
|
|
12
|
-
${
|
|
12
|
+
${t.selectedText?'<blockquote class="rte-comment-selection"></blockquote>':""}
|
|
13
13
|
<section class="rte-comment-expanded${r?" show":""}"></section>
|
|
14
|
-
`;const
|
|
14
|
+
`;const n=o.querySelector(".rte-comment-author");n&&(n.textContent=t.author);const c=o.querySelector(".rte-comment-text");c&&(c.textContent=t.text);const f=o.querySelector(".rte-comment-selection");f&&(f.textContent=t.selectedText),o.querySelector(".rte-comment-expand")?.addEventListener("click",()=>{e.expandedComments.has(t.id)?e.expandedComments.delete(t.id):e.expandedComments.add(t.id),d(e)});const l=o.querySelector(".rte-comment-expanded");if(l&&r){if(t.replies.length>0){const a=document.createElement("div");a.className="rte-comment-replies",t.replies.forEach(i=>{const m=document.createElement("div");m.className="rte-comment-reply",m.innerHTML=`
|
|
15
15
|
<div class="rte-comment-reply-header">
|
|
16
|
-
<strong
|
|
17
|
-
<time>${
|
|
16
|
+
<strong class="rte-comment-reply-author"></strong>
|
|
17
|
+
<time>${B(i.createdAt)}</time>
|
|
18
18
|
</div>
|
|
19
19
|
<div class="rte-comment-reply-text"></div>
|
|
20
|
-
`;const
|
|
20
|
+
`;const v=m.querySelector(".rte-comment-reply-author");v&&(v.textContent=i.author);const g=m.querySelector(".rte-comment-reply-text");g&&(g.textContent=i.text),a.appendChild(m)}),l.appendChild(a)}if(!t.resolved){const a=document.createElement("div");a.className="rte-comment-reply-composer",a.innerHTML=`
|
|
21
21
|
<textarea class="rte-comment-reply-textarea" rows="2" placeholder="Reply..."></textarea>
|
|
22
22
|
<button type="button" class="rte-comment-btn primary">Reply</button>
|
|
23
|
-
`;const
|
|
23
|
+
`;const i=a.querySelector(".rte-comment-reply-textarea"),m=a.querySelector(".rte-comment-btn.primary");if(i&&m){i.value=e.replyTexts[t.id]||"";const v=()=>{const g=!!i.value.trim();m.disabled=!g};v(),i.addEventListener("input",()=>{e.replyTexts[t.id]=i.value,v()}),m.addEventListener("click",()=>{const g=i.value.trim();g&&(Q(t.id,T,g),e.replyTexts[t.id]="",d(e))})}l.appendChild(a)}const s=document.createElement("div");if(s.className="rte-comment-actions",t.anchorId){const a=document.createElement("button");a.type="button",a.className="rte-comment-btn ghost",a.textContent="Jump to text",a.onclick=()=>{const i=C(e,t);i&&(i.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),E(e,t.id,!0),window.setTimeout(()=>E(e,t.id,!1),1200))},s.appendChild(a)}if(t.resolved){const a=document.createElement("button");a.type="button",a.className="rte-comment-btn ghost",a.textContent="Reopen",a.onclick=()=>G(t.id),s.appendChild(a)}else{const a=document.createElement("button");a.type="button",a.className="rte-comment-btn success",a.textContent="Resolve",a.onclick=()=>X(t.id,T),s.appendChild(a)}const b=document.createElement("button");b.type="button",b.className="rte-comment-btn danger",b.textContent="Delete",b.onclick=()=>J(t.id),s.appendChild(b),l.appendChild(s)}return o.addEventListener("mouseenter",()=>E(e,t.id,!0)),o.addEventListener("mouseleave",()=>E(e,t.id,!1)),o}function d(e){const t=e||u();if(!t?.panelElement)return;const r=Z(t);t.panelElement.innerHTML=`
|
|
24
24
|
<div class="rte-comments-header">
|
|
25
25
|
<div>
|
|
26
26
|
<h3>Comments (${r.length})</h3>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
${r.length===0?'<div class="rte-comments-empty">No comments yet.</div>':'<div class="rte-comments-list"></div>'}
|
|
38
|
-
`,
|
|
38
|
+
`,t.panelElement.querySelector(".rte-comments-close")?.addEventListener("click",()=>{w(t,!1)});const n=t.panelElement.querySelector(".new-comment-textarea"),c=t.panelElement.querySelector(".add-comment-btn");if(n&&c){n.value=t.newCommentText;const p=()=>{const l=!!n.value.trim();c.disabled=!l};p(),n.addEventListener("input",()=>{t.newCommentText=n.value,p()}),n.addEventListener("keydown",l=>{(l.ctrlKey||l.metaKey)&&l.key==="Enter"&&(l.preventDefault(),c.click())}),c.addEventListener("click",()=>{const l=n.value.trim();if(!l)return;const s=!!t.savedSelection;W(T,l,!s),t.newCommentText="",d(t)})}const f=t.panelElement.querySelector(".rte-comments-list");f&&r.forEach(p=>{f.appendChild(K(t,p))})}const L=new WeakMap;function U(e){L.has(e)||L.set(e,window.setTimeout(()=>{L.delete(e),e.panelVisible&&d(e)},120))}function M(){R||(R=!0,document.addEventListener("focusin",e=>{const t=h(e.target);t&&(x=t)}),document.addEventListener("click",e=>{const r=(e.target instanceof Element?e.target:null)?.closest(".rte-comment-anchor");if(!r)return;const o=h(r),n=o?y.get(o):null,c=r.getAttribute("data-comment-id");!n||!c||!n.comments.has(c)||(e.preventDefault(),e.stopPropagation(),x=n.root,n.expandedComments.add(c),w(n,!0),d(n))}),document.addEventListener("input",e=>{const t=e.target instanceof Element?e.target:null;if(!t||t.closest(".rte-comments-panel"))return;const r=h(t),o=r?y.get(r):null;o?.panelVisible&&U(o)}),document.addEventListener("selectionchange",()=>{const e=window.getSelection();if(!e||e.rangeCount===0)return;const t=e.getRangeAt(0),r=h(t.commonAncestorContainer);if(!r)return;x=r;const o=y.get(r);!o||e.isCollapsed||k(t,r)&&(o.savedSelection=t.cloneRange())}),document.addEventListener("keydown",e=>{if(e.key!=="Escape")return;const t=u();!t||!t.panelVisible||(e.preventDefault(),e.stopPropagation(),w(t,!1))},!0))}function W(e,t,r=!1){const o=u();if(!o)return"";const n=t.trim();if(!n)return"";if(r){const i=S("comment");return o.comments.set(i,{id:i,anchorId:"",selectedText:"",author:e,text:n,createdAt:new Date().toISOString(),resolved:!1,replies:[]}),d(o),i}const c=o.savedSelection||V(o.root);if(!c||!k(c,o.root))return"";const f=c.toString().trim();if(!f)return"";const p=S("comment"),l=S("comment-anchor"),s=document.createElement("span");return s.id=l,s.className="rte-comment-anchor",s.setAttribute("data-comment-id",p),s.setAttribute("title","Commented text"),A(o,()=>{try{const i=c.cloneRange(),m=i.extractContents();return m.textContent?.trim()?(s.appendChild(m),i.insertNode(s),!0):!1}catch{return!1}})?(o.comments.set(p,{id:p,anchorId:l,selectedText:f,author:e,text:n,createdAt:new Date().toISOString(),resolved:!1,replies:[]}),o.savedSelection=null,window.getSelection()?.removeAllRanges(),d(o),p):""}function X(e,t){const r=u();if(!r)return;const o=r.comments.get(e);o&&(o.resolved=!0,o.resolvedBy=t,o.resolvedAt=new Date().toISOString(),A(r,()=>I(r,o)),d(r))}function G(e){const t=u();if(!t)return;const r=t.comments.get(e);r&&(r.resolved=!1,r.resolvedBy=void 0,r.resolvedAt=void 0,A(t,()=>I(t,r)),d(t))}function J(e){const t=u();if(!t)return;const r=t.comments.get(e);if(r){if(r.anchorId){const o=C(t,r);o&&A(t,()=>P(o))}else t.comments.delete(e),t.expandedComments.delete(e),delete t.replyTexts[e];d(t)}}function Q(e,t,r){const o=u();if(!o)return;const n=o.comments.get(e);if(!n)return;const c=r.trim();c&&(n.replies.push({id:S("reply"),author:t,text:c,createdAt:new Date().toISOString()}),d(o))}function Y(){if(document.getElementById("rte-comments-panel-styles"))return;const e=document.createElement("style");e.id="rte-comments-panel-styles",e.textContent=`
|
|
39
39
|
.rte-comments-panel {
|
|
40
40
|
--rte-comments-panel-width: min(360px, 42vw);
|
|
41
41
|
position: absolute;
|
|
@@ -351,4 +351,4 @@
|
|
|
351
351
|
margin-right: 0;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
`,document.head.appendChild(
|
|
354
|
+
`,document.head.appendChild(e)}const ee=()=>({name:"comments",toolbar:[{label:"Add Comment",command:"addComment",type:"button",icon:'<svg fill="#000000" width="24px" height="24px" viewBox="0 0 32 32" id="icon" xmlns="http://www.w3.org/2000/svg"><title>add-comment</title><path d="M17.74,30,16,29l4-7h6a2,2,0,0,0,2-2V8a2,2,0,0,0-2-2H6A2,2,0,0,0,4,8V20a2,2,0,0,0,2,2h9v2H6a4,4,0,0,1-4-4V8A4,4,0,0,1,6,4H26a4,4,0,0,1,4,4V20a4,4,0,0,1-4,4H21.16Z"></path><polygon points="17 9 15 9 15 13 11 13 11 15 15 15 15 19 17 19 17 15 21 15 21 13 17 13 17 9"></polygon><rect fill="none" width="32" height="32"></rect></svg>'},{label:"Show / Hide Comments",command:"toggleComments",type:"button",icon:'<svg width="24px" height="24px" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M16 1H4V11H8L10 13L12 11H16V1Z" fill="#000000"></path><path d="M2 5V13H7.17157L8.70711 14.5355L7.29289 15.9497L6.34315 15H0V5H2Z" fill="#000000"></path></svg>'}],commands:{addComment:(e,t)=>{q(t),M();const r=u();return r?(r.savedSelection=V(r.root),r.savedSelection&&window.getSelection()?.removeAllRanges(),w(r,!0),d(r),r.panelElement?.querySelector(".new-comment-textarea")?.focus({preventScroll:!0}),!0):!1},toggleComments:(e,t)=>{q(t),M();const r=u();return r?(w(r,!r.panelVisible),r.panelVisible&&d(r),!0):!1}},keymap:{}});exports.CommentsPlugin=ee;
|