@editora/plugins 1.0.8 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/dist/_commonjsHelpers-6763f629.js +1 -0
- package/dist/_commonjsHelpers-c5d32002.mjs +30 -0
- package/dist/a11y-checker.cjs.js +12 -12
- package/dist/a11y-checker.esm.js +98 -80
- package/dist/anchor.cjs.js +12 -12
- package/dist/anchor.esm.js +128 -115
- package/dist/anchoredPopover-33f1358d.mjs +109 -0
- package/dist/anchoredPopover-8151d535.js +1 -0
- package/dist/approval-workflow.cjs.js +447 -0
- package/dist/approval-workflow.esm.js +1111 -0
- package/dist/background-color.cjs.js +2 -2
- package/dist/background-color.esm.js +68 -55
- package/dist/blockquote.esm.js +2 -1
- package/dist/blocks-library.cjs.js +442 -0
- package/dist/blocks-library.esm.js +1384 -0
- package/dist/capitalization.esm.js +2 -1
- package/dist/checklist.cjs.js +1 -1
- package/dist/checklist.esm.js +82 -58
- package/dist/citations.cjs.js +548 -0
- package/dist/citations.esm.js +1530 -0
- package/dist/clear-formatting.cjs.js +1 -1
- package/dist/clear-formatting.esm.js +33 -27
- package/dist/code-sample.cjs.js +14 -14
- package/dist/code-sample.esm.js +93 -82
- package/dist/code.cjs.js +32 -32
- package/dist/code.esm.js +653 -594
- package/dist/comments.cjs.js +6 -6
- package/dist/comments.esm.js +158 -116
- package/dist/conditional-content.cjs.js +626 -0
- package/dist/conditional-content.esm.js +1421 -0
- package/dist/content-rules.cjs.js +408 -0
- package/dist/content-rules.esm.js +1147 -0
- package/dist/data-binding.cjs.js +321 -0
- package/dist/data-binding.esm.js +953 -0
- package/dist/direction.esm.js +18 -9
- package/dist/doc-schema.cjs.js +398 -0
- package/dist/doc-schema.esm.js +1378 -0
- package/dist/document-manager.cjs.js +1 -1
- package/dist/document-manager.esm.js +5 -4
- package/dist/documentManager-25b6203c.mjs +9122 -0
- package/dist/documentManager-b69e7054.js +17 -0
- package/dist/{editorContainerHelpers-C7kdWnS0.mjs → editorContainerHelpers-69585c07.mjs} +2 -1
- package/dist/embed-iframe.cjs.js +4 -4
- package/dist/embed-iframe.esm.js +81 -73
- package/dist/emojis.cjs.js +8 -8
- package/dist/emojis.esm.js +77 -65
- package/dist/enterprise.cjs.js +1 -0
- package/dist/enterprise.esm.js +58 -0
- package/dist/font-family.cjs.js +1 -1
- package/dist/font-family.esm.js +47 -39
- package/dist/font-size.cjs.js +1 -1
- package/dist/font-size.esm.js +53 -37
- package/dist/footnote.cjs.js +2 -2
- package/dist/footnote.esm.js +117 -76
- package/dist/history.cjs.js +1 -1
- package/dist/history.esm.js +92 -70
- package/dist/html2canvas.esm-09133e29.js +22 -0
- package/dist/{html2canvas.esm-BWVIUcAF.mjs → html2canvas.esm-1a1724a1.mjs} +225 -141
- package/dist/indent.cjs.js +1 -1
- package/dist/indent.esm.js +24 -12
- package/dist/index-656d224b.js +231 -0
- package/dist/index-6a8c48bb.js +1 -0
- package/dist/index-d027b7e2.mjs +16859 -0
- package/dist/{index-BFsKNTTj.mjs → index-f04538f2.mjs} +71 -70
- package/dist/index.cjs.js +1 -1
- package/dist/index.es-730f2d98.mjs +5775 -0
- package/dist/index.es-dd40173b.js +18 -0
- package/dist/index.esm.js +124 -93
- package/dist/italic.cjs.js +1 -1
- package/dist/italic.esm.js +9 -8
- package/dist/jspdf.es.min-90db2c97.js +243 -0
- package/dist/{jspdf.es.min-DQCoX5yh.mjs → jspdf.es.min-c36a4fd8.mjs} +4682 -3658
- package/dist/line-height.cjs.js +1 -1
- package/dist/line-height.esm.js +24 -11
- package/dist/link.cjs.js +5 -5
- package/dist/link.esm.js +30 -24
- package/dist/list.cjs.js +1 -1
- package/dist/list.esm.js +25 -20
- package/dist/lite.cjs.js +1 -1
- package/dist/lite.esm.js +61 -59
- package/dist/math.cjs.js +21 -21
- package/dist/math.esm.js +146 -139
- package/dist/media-manager.cjs.js +38 -38
- package/dist/media-manager.esm.js +325 -308
- package/dist/mentions.cjs.js +105 -0
- package/dist/mentions.esm.js +774 -0
- package/dist/merge-tag.cjs.js +2 -2
- package/dist/merge-tag.esm.js +216 -177
- package/dist/page-break.cjs.js +2 -2
- package/dist/page-break.esm.js +67 -51
- package/dist/pii-redaction.cjs.js +436 -0
- package/dist/pii-redaction.esm.js +1447 -0
- package/dist/preview.cjs.js +3 -3
- package/dist/preview.esm.js +37 -32
- package/dist/print.cjs.js +4 -4
- package/dist/print.esm.js +20 -17
- package/dist/{purify.es-DHhaBdbu.mjs → purify.es-35a15df8.mjs} +19 -9
- package/dist/{purify.es-T2a3nLiC.js → purify.es-a8d731c6.js} +1 -1
- package/dist/slash-commands.cjs.js +90 -0
- package/dist/slash-commands.esm.js +788 -0
- package/dist/smart-paste.cjs.js +398 -0
- package/dist/smart-paste.esm.js +1444 -0
- package/dist/special-characters.cjs.js +7 -7
- package/dist/special-characters.esm.js +69 -61
- package/dist/spell-check.cjs.js +5 -5
- package/dist/spell-check.esm.js +123 -97
- package/dist/strikethrough.cjs.js +1 -1
- package/dist/strikethrough.esm.js +19 -14
- package/dist/style.css +1 -0
- package/dist/table.cjs.js +4 -4
- package/dist/table.esm.js +225 -191
- package/dist/template.cjs.js +11 -11
- package/dist/template.esm.js +153 -124
- package/dist/text-alignment.cjs.js +1 -1
- package/dist/text-alignment.esm.js +27 -21
- package/dist/text-color.cjs.js +3 -3
- package/dist/text-color.esm.js +87 -70
- package/dist/track-changes.cjs.js +77 -0
- package/dist/track-changes.esm.js +817 -0
- package/dist/translation-workflow.cjs.js +626 -0
- package/dist/translation-workflow.esm.js +1794 -0
- package/dist/version-diff.cjs.js +362 -0
- package/dist/version-diff.esm.js +797 -0
- package/index.d.ts +798 -0
- package/package.json +114 -9
- package/dist/_commonjsHelpers-BH3jXuIh.js +0 -1
- package/dist/_commonjsHelpers-ByX85dGu.mjs +0 -33
- package/dist/anchoredPopover-BzqGPOAE.js +0 -1
- package/dist/anchoredPopover-Dts0IrgU.mjs +0 -106
- package/dist/documentManager-CTqRftU8.mjs +0 -8369
- package/dist/documentManager-Jf0RbSks.js +0 -17
- package/dist/html2canvas.esm-B5qzocYs.js +0 -5
- package/dist/index-CvJk4DKa.js +0 -221
- package/dist/index-D3CycEFU.mjs +0 -16543
- package/dist/index-tqLTHcO6.js +0 -1
- package/dist/index.es-CE_A4QSm.js +0 -5
- package/dist/index.es-DQ78mYYo.mjs +0 -6665
- package/dist/jspdf.es.min-BoS80556.js +0 -77
- package/dist/plugins.css +0 -1
- /package/dist/{editorContainerHelpers-CFbfiOJI.js → editorContainerHelpers-36b8ddf3.js} +0 -0
package/dist/comments.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=new WeakMap;let
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=new WeakMap;let g=null,S=!1,k=0;const E="User";function v(t){return k+=1,`${t}-${Date.now()}-${k}`}function y(t){if(!t)return null;const e=t instanceof Element?t:t.parentElement;return e?e.closest("[data-editora-editor]")||e.closest(".rte-editor")||e.closest(".editora-editor"):null}function A(t){const e=(t==null?void 0:t.editorElement)||(t==null?void 0:t.contentElement)||null;if(!(e instanceof HTMLElement))return;const r=e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")||(e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor")?e:null);r&&(g=r)}function w(t,e){return e.contains(t.commonAncestorContainer)}function H(){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 g=a,window.__editoraCommandEditorRoot=null,a}}const t=document.activeElement,e=t?y(t):null;if(e)return e;const r=window.getSelection();if(r&&r.rangeCount>0){const o=y(r.getRangeAt(0).commonAncestorContainer);if(o)return o}return g}function $(t){const e=C.get(t);if(e)return e;const r={root:t,comments:new Map,panelVisible:!1,panelElement:null,expandedComments:new Set,replyTexts:{},savedSelection:null,newCommentText:"",selectionChangeListener:null};return C.set(t,r),r}function f(){const t=H();return t?(g=t,$(t)):null}function R(t){const e=window.getSelection();if(!e||e.rangeCount===0||e.isCollapsed)return null;const r=e.getRangeAt(0);return w(r,t)?r.cloneRange():null}function I(t,e){if(!e.anchorId)return;const r=t.root.querySelector(`#${e.anchorId}`);r&&r.classList.toggle("rte-comment-anchor-resolved",e.resolved)}function h(t,e,r){const o=t.comments.get(e);if(!o||!o.anchorId)return;const a=t.root.querySelector(`#${o.anchorId}`);a&&a.classList.toggle("highlighted",r)}function q(t,e,r){e.onclick=o=>{o.preventDefault(),o.stopPropagation(),g=t.root,t.expandedComments.add(r),b(t,!0),m(t)}}function N(t){const e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);t.remove()}}function b(t,e){if(t.panelVisible=e,e){Z(),z(t),t.root.setAttribute("data-rte-comments-open","true"),t.panelElement&&(t.panelElement.classList.add("is-open"),t.panelElement.setAttribute("aria-hidden","false")),V(t);return}t.root.removeAttribute("data-rte-comments-open"),M(t),t.panelElement&&(t.panelElement.remove(),t.panelElement=null)}function z(t){if(t.panelElement)return;const e=document.createElement("aside");e.className="rte-comments-panel",e.setAttribute("role","complementary"),e.setAttribute("aria-label","Comments"),e.setAttribute("aria-hidden","true"),window.getComputedStyle(t.root).position==="static"&&(t.root.style.position="relative"),t.root.appendChild(e),t.panelElement=e}function V(t){t.selectionChangeListener||(t.selectionChangeListener=()=>{const e=window.getSelection();if(!e||e.rangeCount===0||e.isCollapsed)return;const r=e.getRangeAt(0);w(r,t.root)&&(t.savedSelection=r.cloneRange(),g=t.root)},document.addEventListener("selectionchange",t.selectionChangeListener))}function M(t){t.selectionChangeListener&&(document.removeEventListener("selectionchange",t.selectionChangeListener),t.selectionChangeListener=null)}function B(t){return Array.from(t.comments.values()).sort((e,r)=>r.createdAt.localeCompare(e.createdAt))}function L(t){return new Date(t).toLocaleString()}function D(t,e){const r=t.expandedComments.has(e.id),o=document.createElement("article");o.className=`rte-comment-item${e.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">${e.author}</strong>
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
<div class="rte-comment-text"></div>
|
|
12
12
|
${e.selectedText?`<blockquote class="rte-comment-selection">${e.selectedText}</blockquote>`:""}
|
|
13
13
|
<section class="rte-comment-expanded${r?" show":""}"></section>
|
|
14
|
-
`;const a=o.querySelector(".rte-comment-text");a&&(a.textContent=e.text)
|
|
14
|
+
`;const a=o.querySelector(".rte-comment-text");a&&(a.textContent=e.text);const i=o.querySelector(".rte-comment-expand");i==null||i.addEventListener("click",()=>{t.expandedComments.has(e.id)?t.expandedComments.delete(e.id):t.expandedComments.add(e.id),m(t)});const u=o.querySelector(".rte-comment-expanded");if(u&&r){if(e.replies.length>0){const n=document.createElement("div");n.className="rte-comment-replies",e.replies.forEach(s=>{const p=document.createElement("div");p.className="rte-comment-reply",p.innerHTML=`
|
|
15
15
|
<div class="rte-comment-reply-header">
|
|
16
16
|
<strong>${s.author}</strong>
|
|
17
17
|
<time>${L(s.createdAt)}</time>
|
|
18
18
|
</div>
|
|
19
19
|
<div class="rte-comment-reply-text"></div>
|
|
20
|
-
`;const
|
|
20
|
+
`;const d=p.querySelector(".rte-comment-reply-text");d&&(d.textContent=s.text),n.appendChild(p)}),u.appendChild(n)}if(!e.resolved){const n=document.createElement("div");n.className="rte-comment-reply-composer",n.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 s=n.querySelector(".rte-comment-reply-textarea"),
|
|
23
|
+
`;const s=n.querySelector(".rte-comment-reply-textarea"),p=n.querySelector(".rte-comment-btn.primary");if(s&&p){s.value=t.replyTexts[e.id]||"";const d=()=>{const x=!!s.value.trim();p.disabled=!x};d(),s.addEventListener("input",()=>{t.replyTexts[e.id]=s.value,d()}),p.addEventListener("click",()=>{const x=s.value.trim();x&&(F(e.id,E,x),t.replyTexts[e.id]="",m(t))})}u.appendChild(n)}const l=document.createElement("div");if(l.className="rte-comment-actions",e.anchorId){const n=document.createElement("button");n.type="button",n.className="rte-comment-btn ghost",n.textContent="Jump to text",n.onclick=()=>{const s=t.root.querySelector(`#${e.anchorId}`);s&&(s.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),h(t,e.id,!0),window.setTimeout(()=>h(t,e.id,!1),1200))},l.appendChild(n)}if(e.resolved){const n=document.createElement("button");n.type="button",n.className="rte-comment-btn ghost",n.textContent="Reopen",n.onclick=()=>_(e.id),l.appendChild(n)}else{const n=document.createElement("button");n.type="button",n.className="rte-comment-btn success",n.textContent="Resolve",n.onclick=()=>P(e.id,E),l.appendChild(n)}const c=document.createElement("button");c.type="button",c.className="rte-comment-btn danger",c.textContent="Delete",c.onclick=()=>j(e.id),l.appendChild(c),u.appendChild(l)}return o.addEventListener("mouseenter",()=>h(t,e.id,!0)),o.addEventListener("mouseleave",()=>h(t,e.id,!1)),o}function m(t){const e=t||f();if(!(e!=null&&e.panelElement))return;const r=B(e);e.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
|
+
`;const o=e.panelElement.querySelector(".rte-comments-close");o==null||o.addEventListener("click",()=>{b(e,!1)});const a=e.panelElement.querySelector(".new-comment-textarea"),i=e.panelElement.querySelector(".add-comment-btn");if(a&&i){a.value=e.newCommentText;const l=()=>{const c=!!a.value.trim();i.disabled=!c};l(),a.addEventListener("input",()=>{e.newCommentText=a.value,l()}),a.addEventListener("keydown",c=>{(c.ctrlKey||c.metaKey)&&c.key==="Enter"&&(c.preventDefault(),i.click())}),i.addEventListener("click",()=>{const c=a.value.trim();if(!c)return;const n=!!e.savedSelection;O(E,c,!n),e.newCommentText="",m(e)})}const u=e.panelElement.querySelector(".rte-comments-list");u&&r.forEach(l=>{u.appendChild(D(e,l))})}function T(){S||(S=!0,document.addEventListener("focusin",t=>{const e=y(t.target);e&&(g=e)}),document.addEventListener("selectionchange",()=>{const t=window.getSelection();if(!t||t.rangeCount===0)return;const e=t.getRangeAt(0),r=y(e.commonAncestorContainer);if(!r)return;g=r;const o=C.get(r);!o||t.isCollapsed||w(e,r)&&(o.savedSelection=e.cloneRange())}),document.addEventListener("keydown",t=>{if(t.key!=="Escape")return;const e=f();!e||!e.panelVisible||(t.preventDefault(),t.stopPropagation(),b(e,!1))},!0))}function O(t,e,r=!1){var p;const o=f();if(!o)return"";const a=e.trim();if(!a)return"";if(r){const d=v("comment");return o.comments.set(d,{id:d,anchorId:"",selectedText:"",author:t,text:a,createdAt:new Date().toISOString(),resolved:!1,replies:[]}),m(o),d}const i=o.savedSelection||R(o.root);if(!i||!w(i,o.root))return"";const u=i.toString().trim();if(!u)return"";const l=v("comment"),c=v("comment-anchor"),n=document.createElement("span");n.id=c,n.className="rte-comment-anchor",n.setAttribute("data-comment-id",l),n.setAttribute("title","Commented text");try{const d=i.cloneRange(),x=d.extractContents();if(!((p=x.textContent)!=null&&p.trim()))return"";n.appendChild(x),d.insertNode(n)}catch{return""}q(o,n,l),o.comments.set(l,{id:l,anchorId:c,selectedText:u,author:t,text:a,createdAt:new Date().toISOString(),resolved:!1,replies:[]}),o.savedSelection=null;const s=window.getSelection();return s==null||s.removeAllRanges(),m(o),l}function P(t,e){const r=f();if(!r)return;const o=r.comments.get(t);o&&(o.resolved=!0,o.resolvedBy=e,o.resolvedAt=new Date().toISOString(),I(r,o),m(r))}function _(t){const e=f();if(!e)return;const r=e.comments.get(t);r&&(r.resolved=!1,r.resolvedBy=void 0,r.resolvedAt=void 0,I(e,r),m(e))}function j(t){const e=f();if(!e)return;const r=e.comments.get(t);if(r){if(r.anchorId){const o=e.root.querySelector(`#${r.anchorId}`);o&&N(o)}e.comments.delete(t),e.expandedComments.delete(t),delete e.replyTexts[t],m(e)}}function F(t,e,r){const o=f();if(!o)return;const a=o.comments.get(t);if(!a)return;const i=r.trim();i&&(a.replies.push({id:v("reply"),author:e,text:i,createdAt:new Date().toISOString()}),m(o))}function Z(){if(document.getElementById("rte-comments-panel-styles"))return;const t=document.createElement("style");t.id="rte-comments-panel-styles",t.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(t)}const K=()=>({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"><defs><style>.cls-1{fill:none;}</style></defs><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 class="cls-1" 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:(t,e)=>{A(e),T();const r=
|
|
354
|
+
`,document.head.appendChild(t)}const K=()=>({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"><defs><style>.cls-1{fill:none;}</style></defs><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 class="cls-1" 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:(t,e)=>{var a;A(e),T();const r=f();if(!r)return!1;if(r.savedSelection=R(r.root),r.savedSelection){const i=window.getSelection();i==null||i.removeAllRanges()}b(r,!0),m(r);const o=(a=r.panelElement)==null?void 0:a.querySelector(".new-comment-textarea");return o==null||o.focus({preventScroll:!0}),!0},toggleComments:(t,e)=>{A(e),T();const r=f();return r?(b(r,!r.panelVisible),r.panelVisible&&m(r),!0):!1}},keymap:{}});exports.CommentsPlugin=K;
|
package/dist/comments.esm.js
CHANGED
|
@@ -5,20 +5,22 @@ function v(t) {
|
|
|
5
5
|
return k += 1, `${t}-${Date.now()}-${k}`;
|
|
6
6
|
}
|
|
7
7
|
function y(t) {
|
|
8
|
-
if (!t)
|
|
8
|
+
if (!t)
|
|
9
|
+
return null;
|
|
9
10
|
const e = t instanceof Element ? t : t.parentElement;
|
|
10
11
|
return e ? e.closest("[data-editora-editor]") || e.closest(".rte-editor") || e.closest(".editora-editor") : null;
|
|
11
12
|
}
|
|
12
13
|
function A(t) {
|
|
13
|
-
const e = t
|
|
14
|
-
if (!(e instanceof HTMLElement))
|
|
14
|
+
const e = (t == null ? void 0 : t.editorElement) || (t == null ? void 0 : t.contentElement) || null;
|
|
15
|
+
if (!(e instanceof HTMLElement))
|
|
16
|
+
return;
|
|
15
17
|
const r = e.closest("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") || (e.matches("[data-editora-editor], .rte-editor, .editora-editor, editora-editor") ? e : null);
|
|
16
18
|
r && (x = r);
|
|
17
19
|
}
|
|
18
20
|
function w(t, e) {
|
|
19
21
|
return e.contains(t.commonAncestorContainer);
|
|
20
22
|
}
|
|
21
|
-
function
|
|
23
|
+
function H() {
|
|
22
24
|
if (typeof window < "u") {
|
|
23
25
|
const o = window.__editoraCommandEditorRoot;
|
|
24
26
|
if (o instanceof HTMLElement) {
|
|
@@ -28,19 +30,22 @@ function B() {
|
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
const t = document.activeElement, e = t ? y(t) : null;
|
|
31
|
-
if (e)
|
|
33
|
+
if (e)
|
|
34
|
+
return e;
|
|
32
35
|
const r = window.getSelection();
|
|
33
36
|
if (r && r.rangeCount > 0) {
|
|
34
37
|
const o = y(
|
|
35
38
|
r.getRangeAt(0).commonAncestorContainer
|
|
36
39
|
);
|
|
37
|
-
if (o)
|
|
40
|
+
if (o)
|
|
41
|
+
return o;
|
|
38
42
|
}
|
|
39
43
|
return x;
|
|
40
44
|
}
|
|
41
|
-
function
|
|
45
|
+
function $(t) {
|
|
42
46
|
const e = C.get(t);
|
|
43
|
-
if (e)
|
|
47
|
+
if (e)
|
|
48
|
+
return e;
|
|
44
49
|
const r = {
|
|
45
50
|
root: t,
|
|
46
51
|
comments: /* @__PURE__ */ new Map(),
|
|
@@ -54,33 +59,36 @@ function H(t) {
|
|
|
54
59
|
};
|
|
55
60
|
return C.set(t, r), r;
|
|
56
61
|
}
|
|
57
|
-
function
|
|
58
|
-
const t =
|
|
59
|
-
return t ? (x = t,
|
|
62
|
+
function f() {
|
|
63
|
+
const t = H();
|
|
64
|
+
return t ? (x = t, $(t)) : null;
|
|
60
65
|
}
|
|
61
66
|
function R(t) {
|
|
62
67
|
const e = window.getSelection();
|
|
63
|
-
if (!e || e.rangeCount === 0 || e.isCollapsed)
|
|
68
|
+
if (!e || e.rangeCount === 0 || e.isCollapsed)
|
|
69
|
+
return null;
|
|
64
70
|
const r = e.getRangeAt(0);
|
|
65
71
|
return w(r, t) ? r.cloneRange() : null;
|
|
66
72
|
}
|
|
67
73
|
function I(t, e) {
|
|
68
|
-
if (!e.anchorId)
|
|
74
|
+
if (!e.anchorId)
|
|
75
|
+
return;
|
|
69
76
|
const r = t.root.querySelector(`#${e.anchorId}`);
|
|
70
77
|
r && r.classList.toggle("rte-comment-anchor-resolved", e.resolved);
|
|
71
78
|
}
|
|
72
79
|
function h(t, e, r) {
|
|
73
80
|
const o = t.comments.get(e);
|
|
74
|
-
if (!o || !o.anchorId)
|
|
81
|
+
if (!o || !o.anchorId)
|
|
82
|
+
return;
|
|
75
83
|
const a = t.root.querySelector(`#${o.anchorId}`);
|
|
76
84
|
a && a.classList.toggle("highlighted", r);
|
|
77
85
|
}
|
|
78
|
-
function
|
|
86
|
+
function q(t, e, r) {
|
|
79
87
|
e.onclick = (o) => {
|
|
80
|
-
o.preventDefault(), o.stopPropagation(), x = t.root, t.expandedComments.add(r),
|
|
88
|
+
o.preventDefault(), o.stopPropagation(), x = t.root, t.expandedComments.add(r), b(t, !0), m(t);
|
|
81
89
|
};
|
|
82
90
|
}
|
|
83
|
-
function
|
|
91
|
+
function N(t) {
|
|
84
92
|
const e = t.parentNode;
|
|
85
93
|
if (e) {
|
|
86
94
|
for (; t.firstChild; )
|
|
@@ -88,27 +96,29 @@ function q(t) {
|
|
|
88
96
|
t.remove();
|
|
89
97
|
}
|
|
90
98
|
}
|
|
91
|
-
function
|
|
99
|
+
function b(t, e) {
|
|
92
100
|
if (t.panelVisible = e, e) {
|
|
93
|
-
Z(),
|
|
101
|
+
Z(), z(t), t.root.setAttribute("data-rte-comments-open", "true"), t.panelElement && (t.panelElement.classList.add("is-open"), t.panelElement.setAttribute("aria-hidden", "false")), V(t);
|
|
94
102
|
return;
|
|
95
103
|
}
|
|
96
|
-
t.root.removeAttribute("data-rte-comments-open"),
|
|
104
|
+
t.root.removeAttribute("data-rte-comments-open"), B(t), t.panelElement && (t.panelElement.remove(), t.panelElement = null);
|
|
97
105
|
}
|
|
98
|
-
function
|
|
99
|
-
if (t.panelElement)
|
|
106
|
+
function z(t) {
|
|
107
|
+
if (t.panelElement)
|
|
108
|
+
return;
|
|
100
109
|
const e = document.createElement("aside");
|
|
101
110
|
e.className = "rte-comments-panel", e.setAttribute("role", "complementary"), e.setAttribute("aria-label", "Comments"), e.setAttribute("aria-hidden", "true"), window.getComputedStyle(t.root).position === "static" && (t.root.style.position = "relative"), t.root.appendChild(e), t.panelElement = e;
|
|
102
111
|
}
|
|
103
|
-
function
|
|
112
|
+
function V(t) {
|
|
104
113
|
t.selectionChangeListener || (t.selectionChangeListener = () => {
|
|
105
114
|
const e = window.getSelection();
|
|
106
|
-
if (!e || e.rangeCount === 0 || e.isCollapsed)
|
|
115
|
+
if (!e || e.rangeCount === 0 || e.isCollapsed)
|
|
116
|
+
return;
|
|
107
117
|
const r = e.getRangeAt(0);
|
|
108
118
|
w(r, t.root) && (t.savedSelection = r.cloneRange(), x = t.root);
|
|
109
119
|
}, document.addEventListener("selectionchange", t.selectionChangeListener));
|
|
110
120
|
}
|
|
111
|
-
function
|
|
121
|
+
function B(t) {
|
|
112
122
|
t.selectionChangeListener && (document.removeEventListener("selectionchange", t.selectionChangeListener), t.selectionChangeListener = null);
|
|
113
123
|
}
|
|
114
124
|
function M(t) {
|
|
@@ -136,25 +146,27 @@ function D(t, e) {
|
|
|
136
146
|
<section class="rte-comment-expanded${r ? " show" : ""}"></section>
|
|
137
147
|
`;
|
|
138
148
|
const a = o.querySelector(".rte-comment-text");
|
|
139
|
-
a && (a.textContent = e.text)
|
|
149
|
+
a && (a.textContent = e.text);
|
|
150
|
+
const i = o.querySelector(".rte-comment-expand");
|
|
151
|
+
i == null || i.addEventListener("click", () => {
|
|
140
152
|
t.expandedComments.has(e.id) ? t.expandedComments.delete(e.id) : t.expandedComments.add(e.id), m(t);
|
|
141
153
|
});
|
|
142
|
-
const
|
|
143
|
-
if (
|
|
154
|
+
const u = o.querySelector(".rte-comment-expanded");
|
|
155
|
+
if (u && r) {
|
|
144
156
|
if (e.replies.length > 0) {
|
|
145
157
|
const n = document.createElement("div");
|
|
146
158
|
n.className = "rte-comment-replies", e.replies.forEach((s) => {
|
|
147
|
-
const
|
|
148
|
-
|
|
159
|
+
const p = document.createElement("div");
|
|
160
|
+
p.className = "rte-comment-reply", p.innerHTML = `
|
|
149
161
|
<div class="rte-comment-reply-header">
|
|
150
162
|
<strong>${s.author}</strong>
|
|
151
163
|
<time>${L(s.createdAt)}</time>
|
|
152
164
|
</div>
|
|
153
165
|
<div class="rte-comment-reply-text"></div>
|
|
154
166
|
`;
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
}),
|
|
167
|
+
const d = p.querySelector(".rte-comment-reply-text");
|
|
168
|
+
d && (d.textContent = s.text), n.appendChild(p);
|
|
169
|
+
}), u.appendChild(n);
|
|
158
170
|
}
|
|
159
171
|
if (!e.resolved) {
|
|
160
172
|
const n = document.createElement("div");
|
|
@@ -164,47 +176,48 @@ function D(t, e) {
|
|
|
164
176
|
`;
|
|
165
177
|
const s = n.querySelector(
|
|
166
178
|
".rte-comment-reply-textarea"
|
|
167
|
-
),
|
|
179
|
+
), p = n.querySelector(
|
|
168
180
|
".rte-comment-btn.primary"
|
|
169
181
|
);
|
|
170
|
-
if (s &&
|
|
182
|
+
if (s && p) {
|
|
171
183
|
s.value = t.replyTexts[e.id] || "";
|
|
172
|
-
const
|
|
173
|
-
const
|
|
174
|
-
|
|
184
|
+
const d = () => {
|
|
185
|
+
const g = !!s.value.trim();
|
|
186
|
+
p.disabled = !g;
|
|
175
187
|
};
|
|
176
|
-
|
|
177
|
-
t.replyTexts[e.id] = s.value,
|
|
178
|
-
}),
|
|
179
|
-
const
|
|
180
|
-
|
|
188
|
+
d(), s.addEventListener("input", () => {
|
|
189
|
+
t.replyTexts[e.id] = s.value, d();
|
|
190
|
+
}), p.addEventListener("click", () => {
|
|
191
|
+
const g = s.value.trim();
|
|
192
|
+
g && (F(e.id, E, g), t.replyTexts[e.id] = "", m(t));
|
|
181
193
|
});
|
|
182
194
|
}
|
|
183
|
-
|
|
195
|
+
u.appendChild(n);
|
|
184
196
|
}
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
197
|
+
const l = document.createElement("div");
|
|
198
|
+
if (l.className = "rte-comment-actions", e.anchorId) {
|
|
187
199
|
const n = document.createElement("button");
|
|
188
200
|
n.type = "button", n.className = "rte-comment-btn ghost", n.textContent = "Jump to text", n.onclick = () => {
|
|
189
201
|
const s = t.root.querySelector(`#${e.anchorId}`);
|
|
190
202
|
s && (s.scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" }), h(t, e.id, !0), window.setTimeout(() => h(t, e.id, !1), 1200));
|
|
191
|
-
},
|
|
203
|
+
}, l.appendChild(n);
|
|
192
204
|
}
|
|
193
205
|
if (e.resolved) {
|
|
194
206
|
const n = document.createElement("button");
|
|
195
|
-
n.type = "button", n.className = "rte-comment-btn ghost", n.textContent = "Reopen", n.onclick = () => _(e.id),
|
|
207
|
+
n.type = "button", n.className = "rte-comment-btn ghost", n.textContent = "Reopen", n.onclick = () => _(e.id), l.appendChild(n);
|
|
196
208
|
} else {
|
|
197
209
|
const n = document.createElement("button");
|
|
198
|
-
n.type = "button", n.className = "rte-comment-btn success", n.textContent = "Resolve", n.onclick = () => P(e.id, E),
|
|
210
|
+
n.type = "button", n.className = "rte-comment-btn success", n.textContent = "Resolve", n.onclick = () => P(e.id, E), l.appendChild(n);
|
|
199
211
|
}
|
|
200
|
-
const
|
|
201
|
-
|
|
212
|
+
const c = document.createElement("button");
|
|
213
|
+
c.type = "button", c.className = "rte-comment-btn danger", c.textContent = "Delete", c.onclick = () => j(e.id), l.appendChild(c), u.appendChild(l);
|
|
202
214
|
}
|
|
203
215
|
return o.addEventListener("mouseenter", () => h(t, e.id, !0)), o.addEventListener("mouseleave", () => h(t, e.id, !1)), o;
|
|
204
216
|
}
|
|
205
217
|
function m(t) {
|
|
206
|
-
const e = t ||
|
|
207
|
-
if (!e
|
|
218
|
+
const e = t || f();
|
|
219
|
+
if (!(e != null && e.panelElement))
|
|
220
|
+
return;
|
|
208
221
|
const r = M(e);
|
|
209
222
|
e.panelElement.innerHTML = `
|
|
210
223
|
<div class="rte-comments-header">
|
|
@@ -221,34 +234,37 @@ function m(t) {
|
|
|
221
234
|
</div>
|
|
222
235
|
</div>
|
|
223
236
|
${r.length === 0 ? '<div class="rte-comments-empty">No comments yet.</div>' : '<div class="rte-comments-list"></div>'}
|
|
224
|
-
|
|
225
|
-
|
|
237
|
+
`;
|
|
238
|
+
const o = e.panelElement.querySelector(".rte-comments-close");
|
|
239
|
+
o == null || o.addEventListener("click", () => {
|
|
240
|
+
b(e, !1);
|
|
226
241
|
});
|
|
227
242
|
const a = e.panelElement.querySelector(
|
|
228
243
|
".new-comment-textarea"
|
|
229
|
-
),
|
|
244
|
+
), i = e.panelElement.querySelector(
|
|
230
245
|
".add-comment-btn"
|
|
231
246
|
);
|
|
232
|
-
if (a &&
|
|
247
|
+
if (a && i) {
|
|
233
248
|
a.value = e.newCommentText;
|
|
234
|
-
const
|
|
235
|
-
const
|
|
236
|
-
|
|
249
|
+
const l = () => {
|
|
250
|
+
const c = !!a.value.trim();
|
|
251
|
+
i.disabled = !c;
|
|
237
252
|
};
|
|
238
|
-
|
|
239
|
-
e.newCommentText = a.value,
|
|
240
|
-
}), a.addEventListener("keydown", (
|
|
241
|
-
(
|
|
242
|
-
}),
|
|
243
|
-
const
|
|
244
|
-
if (!
|
|
253
|
+
l(), a.addEventListener("input", () => {
|
|
254
|
+
e.newCommentText = a.value, l();
|
|
255
|
+
}), a.addEventListener("keydown", (c) => {
|
|
256
|
+
(c.ctrlKey || c.metaKey) && c.key === "Enter" && (c.preventDefault(), i.click());
|
|
257
|
+
}), i.addEventListener("click", () => {
|
|
258
|
+
const c = a.value.trim();
|
|
259
|
+
if (!c)
|
|
260
|
+
return;
|
|
245
261
|
const n = !!e.savedSelection;
|
|
246
|
-
O(E,
|
|
262
|
+
O(E, c, !n), e.newCommentText = "", m(e);
|
|
247
263
|
});
|
|
248
264
|
}
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
|
|
265
|
+
const u = e.panelElement.querySelector(".rte-comments-list");
|
|
266
|
+
u && r.forEach((l) => {
|
|
267
|
+
u.appendChild(D(e, l));
|
|
252
268
|
});
|
|
253
269
|
}
|
|
254
270
|
function T() {
|
|
@@ -257,31 +273,37 @@ function T() {
|
|
|
257
273
|
e && (x = e);
|
|
258
274
|
}), document.addEventListener("selectionchange", () => {
|
|
259
275
|
const t = window.getSelection();
|
|
260
|
-
if (!t || t.rangeCount === 0)
|
|
276
|
+
if (!t || t.rangeCount === 0)
|
|
277
|
+
return;
|
|
261
278
|
const e = t.getRangeAt(0), r = y(e.commonAncestorContainer);
|
|
262
|
-
if (!r)
|
|
279
|
+
if (!r)
|
|
280
|
+
return;
|
|
263
281
|
x = r;
|
|
264
282
|
const o = C.get(r);
|
|
265
283
|
!o || t.isCollapsed || w(e, r) && (o.savedSelection = e.cloneRange());
|
|
266
284
|
}), document.addEventListener(
|
|
267
285
|
"keydown",
|
|
268
286
|
(t) => {
|
|
269
|
-
if (t.key !== "Escape")
|
|
270
|
-
|
|
271
|
-
|
|
287
|
+
if (t.key !== "Escape")
|
|
288
|
+
return;
|
|
289
|
+
const e = f();
|
|
290
|
+
!e || !e.panelVisible || (t.preventDefault(), t.stopPropagation(), b(e, !1));
|
|
272
291
|
},
|
|
273
292
|
!0
|
|
274
293
|
));
|
|
275
294
|
}
|
|
276
295
|
function O(t, e, r = !1) {
|
|
277
|
-
|
|
278
|
-
|
|
296
|
+
var p;
|
|
297
|
+
const o = f();
|
|
298
|
+
if (!o)
|
|
299
|
+
return "";
|
|
279
300
|
const a = e.trim();
|
|
280
|
-
if (!a)
|
|
301
|
+
if (!a)
|
|
302
|
+
return "";
|
|
281
303
|
if (r) {
|
|
282
|
-
const
|
|
283
|
-
return o.comments.set(
|
|
284
|
-
id:
|
|
304
|
+
const d = v("comment");
|
|
305
|
+
return o.comments.set(d, {
|
|
306
|
+
id: d,
|
|
285
307
|
anchorId: "",
|
|
286
308
|
selectedText: "",
|
|
287
309
|
author: t,
|
|
@@ -289,71 +311,82 @@ function O(t, e, r = !1) {
|
|
|
289
311
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
290
312
|
resolved: !1,
|
|
291
313
|
replies: []
|
|
292
|
-
}), m(o),
|
|
314
|
+
}), m(o), d;
|
|
293
315
|
}
|
|
294
|
-
const
|
|
295
|
-
if (!
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
316
|
+
const i = o.savedSelection || R(o.root);
|
|
317
|
+
if (!i || !w(i, o.root))
|
|
318
|
+
return "";
|
|
319
|
+
const u = i.toString().trim();
|
|
320
|
+
if (!u)
|
|
321
|
+
return "";
|
|
322
|
+
const l = v("comment"), c = v("comment-anchor"), n = document.createElement("span");
|
|
323
|
+
n.id = c, n.className = "rte-comment-anchor", n.setAttribute("data-comment-id", l), n.setAttribute("title", "Commented text");
|
|
300
324
|
try {
|
|
301
|
-
const
|
|
302
|
-
if (!
|
|
303
|
-
|
|
325
|
+
const d = i.cloneRange(), g = d.extractContents();
|
|
326
|
+
if (!((p = g.textContent) != null && p.trim()))
|
|
327
|
+
return "";
|
|
328
|
+
n.appendChild(g), d.insertNode(n);
|
|
304
329
|
} catch {
|
|
305
330
|
return "";
|
|
306
331
|
}
|
|
307
|
-
|
|
308
|
-
id:
|
|
309
|
-
anchorId:
|
|
310
|
-
selectedText:
|
|
332
|
+
q(o, n, l), o.comments.set(l, {
|
|
333
|
+
id: l,
|
|
334
|
+
anchorId: c,
|
|
335
|
+
selectedText: u,
|
|
311
336
|
author: t,
|
|
312
337
|
text: a,
|
|
313
338
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
314
339
|
resolved: !1,
|
|
315
340
|
replies: []
|
|
316
|
-
}), o.savedSelection = null
|
|
341
|
+
}), o.savedSelection = null;
|
|
342
|
+
const s = window.getSelection();
|
|
343
|
+
return s == null || s.removeAllRanges(), m(o), l;
|
|
317
344
|
}
|
|
318
345
|
function P(t, e) {
|
|
319
|
-
const r =
|
|
320
|
-
if (!r)
|
|
346
|
+
const r = f();
|
|
347
|
+
if (!r)
|
|
348
|
+
return;
|
|
321
349
|
const o = r.comments.get(t);
|
|
322
350
|
o && (o.resolved = !0, o.resolvedBy = e, o.resolvedAt = (/* @__PURE__ */ new Date()).toISOString(), I(r, o), m(r));
|
|
323
351
|
}
|
|
324
352
|
function _(t) {
|
|
325
|
-
const e =
|
|
326
|
-
if (!e)
|
|
353
|
+
const e = f();
|
|
354
|
+
if (!e)
|
|
355
|
+
return;
|
|
327
356
|
const r = e.comments.get(t);
|
|
328
357
|
r && (r.resolved = !1, r.resolvedBy = void 0, r.resolvedAt = void 0, I(e, r), m(e));
|
|
329
358
|
}
|
|
330
359
|
function j(t) {
|
|
331
|
-
const e =
|
|
332
|
-
if (!e)
|
|
360
|
+
const e = f();
|
|
361
|
+
if (!e)
|
|
362
|
+
return;
|
|
333
363
|
const r = e.comments.get(t);
|
|
334
364
|
if (r) {
|
|
335
365
|
if (r.anchorId) {
|
|
336
366
|
const o = e.root.querySelector(`#${r.anchorId}`);
|
|
337
|
-
o &&
|
|
367
|
+
o && N(o);
|
|
338
368
|
}
|
|
339
369
|
e.comments.delete(t), e.expandedComments.delete(t), delete e.replyTexts[t], m(e);
|
|
340
370
|
}
|
|
341
371
|
}
|
|
342
372
|
function F(t, e, r) {
|
|
343
|
-
const o =
|
|
344
|
-
if (!o)
|
|
373
|
+
const o = f();
|
|
374
|
+
if (!o)
|
|
375
|
+
return;
|
|
345
376
|
const a = o.comments.get(t);
|
|
346
|
-
if (!a)
|
|
347
|
-
|
|
348
|
-
|
|
377
|
+
if (!a)
|
|
378
|
+
return;
|
|
379
|
+
const i = r.trim();
|
|
380
|
+
i && (a.replies.push({
|
|
349
381
|
id: v("reply"),
|
|
350
382
|
author: e,
|
|
351
|
-
text:
|
|
383
|
+
text: i,
|
|
352
384
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
353
385
|
}), m(o));
|
|
354
386
|
}
|
|
355
387
|
function Z() {
|
|
356
|
-
if (document.getElementById("rte-comments-panel-styles"))
|
|
388
|
+
if (document.getElementById("rte-comments-panel-styles"))
|
|
389
|
+
return;
|
|
357
390
|
const t = document.createElement("style");
|
|
358
391
|
t.id = "rte-comments-panel-styles", t.textContent = `
|
|
359
392
|
.rte-comments-panel {
|
|
@@ -691,16 +724,25 @@ const K = () => ({
|
|
|
691
724
|
],
|
|
692
725
|
commands: {
|
|
693
726
|
addComment: (t, e) => {
|
|
727
|
+
var a;
|
|
694
728
|
A(e), T();
|
|
695
|
-
const r =
|
|
696
|
-
|
|
729
|
+
const r = f();
|
|
730
|
+
if (!r)
|
|
731
|
+
return !1;
|
|
732
|
+
if (r.savedSelection = R(r.root), r.savedSelection) {
|
|
733
|
+
const i = window.getSelection();
|
|
734
|
+
i == null || i.removeAllRanges();
|
|
735
|
+
}
|
|
736
|
+
b(r, !0), m(r);
|
|
737
|
+
const o = (a = r.panelElement) == null ? void 0 : a.querySelector(
|
|
697
738
|
".new-comment-textarea"
|
|
698
|
-
)
|
|
739
|
+
);
|
|
740
|
+
return o == null || o.focus({ preventScroll: !0 }), !0;
|
|
699
741
|
},
|
|
700
742
|
toggleComments: (t, e) => {
|
|
701
743
|
A(e), T();
|
|
702
|
-
const r =
|
|
703
|
-
return r ? (
|
|
744
|
+
const r = f();
|
|
745
|
+
return r ? (b(r, !r.panelVisible), r.panelVisible && m(r), !0) : !1;
|
|
704
746
|
}
|
|
705
747
|
},
|
|
706
748
|
keymap: {}
|