@docx-editor.dev/pro 2.36.0 → 2.37.0-canary.20261111032756.sha-9eef508

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 (35) hide show
  1. package/dist/{chunk-VYJGXASU.js → chunk-5TE6YSQE.js} +1 -1
  2. package/dist/{chunk-VMSFNR4O.cjs → chunk-5Y4KHQEW.cjs} +1 -1
  3. package/dist/chunk-C4V5RPWH.js +6 -0
  4. package/dist/chunk-FGHLEGR4.cjs +11 -0
  5. package/dist/chunk-LMK6OKPO.cjs +6 -0
  6. package/dist/chunk-MKVBW62Q.js +11 -0
  7. package/dist/{chunk-QWEU3QRC.js → chunk-N5V5YV5J.js} +1 -1
  8. package/dist/{chunk-JKQRYHCO.cjs → chunk-S6TCOWSV.cjs} +1 -1
  9. package/dist/{chunk-K7IGLB5D.js → chunk-UAHMKMNT.js} +1 -1
  10. package/dist/{chunk-OF673SN2.cjs → chunk-Z5KG3XAQ.cjs} +1 -1
  11. package/dist/collaboration/hocuspocus.cjs +1 -1
  12. package/dist/collaboration/hocuspocus.js +1 -1
  13. package/dist/collaboration/index.cjs +2 -2
  14. package/dist/collaboration/index.js +1 -1
  15. package/dist/collaboration/webrtc.cjs +1 -1
  16. package/dist/collaboration/webrtc.js +1 -1
  17. package/dist/{document-session-FTMVM6IL.js → document-session-FLMCL4LS.js} +1 -1
  18. package/dist/{document-session-GB52JVCQ.cjs → document-session-PH3GPYVG.cjs} +1 -1
  19. package/dist/drawing/index.cjs +1 -1
  20. package/dist/drawing/index.js +1 -1
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/react/index.cjs +2 -2
  24. package/dist/react/index.d.cts +3 -1
  25. package/dist/react/index.d.ts +3 -1
  26. package/dist/react/index.js +2 -2
  27. package/dist/vue/index.cjs +2 -2
  28. package/dist/vue/index.d.cts +3 -1
  29. package/dist/vue/index.d.ts +3 -1
  30. package/dist/vue/index.js +2 -2
  31. package/package.json +4 -4
  32. package/dist/chunk-5INMVI3O.js +0 -11
  33. package/dist/chunk-GSBQ5AHL.cjs +0 -6
  34. package/dist/chunk-J42DN4K5.cjs +0 -11
  35. package/dist/chunk-NTBGYQX4.js +0 -6
@@ -1,6 +0,0 @@
1
- /*!
2
- Copyright (c) 2026 Eigenpal, Inc. All rights reserved.
3
- Licensed under the EigenPal Pro Evaluation License 1.0. See LICENSE.md in this package.
4
- Production use requires a commercial agreement: licensing@eigenpal.com
5
- */
6
- import {hostWindowOf,isElementNode,isHTMLElementNode}from'@docx-editor.dev/core/editor';import {reviewCodeOfSkip,reviewCodeOfRefusal,diagnosticCodeOfRefusal}from'@docx-editor.dev/core';import {safeParticipantColor}from'@docx-editor.dev/core/collaboration';var X=Object.freeze({scale:96/72,top:0,left:null,side:"right",compactCardLeft:null,compact:false}),g=16,N=300,h=12;function C(e){return e?.getAttribute("data-review-side")==="left"?"left":"right"}var _=".docx-paginated-surface:not(.docx-editor__loading-surface)";function y(e){return e?.querySelector(_)??null}function ee(e,t,n){return e&&t>0&&t<n}function P(e,t){let n=e.offsetParent,o=y(n),i=o&&n?o.getBoundingClientRect():null,d=i&&n?n.getBoundingClientRect():null,l=C(n);if(!i||!d||!n)return {scale:t,top:0,left:null,side:l,compactCardLeft:null};let r=n.scrollLeft-d.left-n.clientLeft,p=i.top-d.top-n.clientTop+n.scrollTop;if(l==="left"){let a=i.left+r-g-e.offsetWidth;return {scale:t,top:p,left:a,side:l,compactCardLeft:n.scrollLeft+h-a}}let f=i.right+r+g;return {scale:t,top:p,left:f,side:l,compactCardLeft:n.scrollLeft+n.clientWidth-f-N-h}}function te(e,t){return e.scale===t.scale&&e.top===t.top&&e.left===t.left&&e.side===t.side&&e.compactCardLeft===t.compactCardLeft}function ne(e,t,n,o={}){let i=e.offsetParent,d=hostWindowOf(e),l=null,r=null,p=()=>{o.beforeMeasure?.(i),n(P(e,t.getRenderScale()));},f=()=>{if(l=y(i),r?.disconnect(),r=null,!i||typeof d.ResizeObserver!="function")return;let c=new Set([i]);for(let u of Array.from(i.children))u!==e&&isHTMLElementNode(u)&&c.add(u);C(i)==="left"&&c.add(e);for(let u=l;u&&u!==i;u=u.parentElement)c.add(u);r=new d.ResizeObserver(a);for(let u of c)r.observe(u);};function a(){y(i)!==l&&f(),p();}f(),p();let s=[()=>r?.disconnect()];if(i&&typeof d.MutationObserver=="function"){let c=new d.MutationObserver(u=>{u.some(m=>m.type==="childList"||m.attributeName==="data-review-side")&&f(),p();});c.observe(i,{childList:true,attributes:true,attributeFilter:["style","data-review-side"]}),s.push(()=>c.disconnect());}if(o.trackScroll&&i){let c=0,u=()=>{c===0&&(c=d.requestAnimationFrame(()=>{c=0,a();}));};i.addEventListener("scroll",u,{passive:true}),s.push(()=>{c!==0&&d.cancelAnimationFrame(c),i.removeEventListener("scroll",u);});}return ()=>{for(let c of s)c();}}function oe(e){let t=e.offsetParent;return t?hostWindowOf(e).getComputedStyle(e).position!=="absolute"?"the column element is not absolutely positioned. Give it position: absolute.":y(t)?null:"the column element's offset parent does not contain the editor's pages. Render it directly inside DocxEditor.Viewport, with no positioned element in between.":"the column element has no offset parent. Render it inside DocxEditor.Viewport, and hide it with visibility: hidden rather than display: none while metrics.left is null."}var E=new Set;function re(e){!D()||E.has(e)||(E.add(e),console.warn(`[docx-editor] useReviewRailMetrics: ${e}`));}function D(){let e;try{e=import.meta.env?.DEV;}catch{e=void 0;}return typeof e=="boolean"?e:typeof process<"u"&&false}var S=600,le=Object.freeze({top:Number.POSITIVE_INFINITY,bottom:Number.NEGATIVE_INFINITY});function se(e,t,n){let o=hostWindowOf(t),i=()=>({top:t.scrollTop-S,bottom:t.scrollTop+t.clientHeight+S}),d=null,l=null,r=0,p=()=>{r=0;let c=l??i();l=null,!(d&&d.top===c.top&&d.bottom===c.bottom)&&(d=c,n(c));},f=0,a=()=>{l=i(),r===0&&(r=o.requestAnimationFrame(p)),e.setAttribute("data-scrolling",""),o.clearTimeout(f),f=o.setTimeout(()=>e.removeAttribute("data-scrolling"),150);};p(),t.addEventListener("scroll",a,{passive:true});let s=new o.ResizeObserver(a);return s.observe(t),()=>{r!==0&&o.cancelAnimationFrame(r),o.clearTimeout(f),t.removeEventListener("scroll",a),s.disconnect();}}function de(e,t,n={}){let i=(Array.isArray(t)?t:[t]).flatMap(r=>r.kind==="revision"?[r.key]:[]),{author:d,date:l}=n;return !e||i.length===0||l!==void 0&&(!(l instanceof Date)||Number.isNaN(l.getTime()))?false:e.exec({type:"setReviewChangesAuthor",keys:i,...d===void 0?{}:{author:d},...l===void 0?{}:{date:`${l.toISOString().slice(0,19)}Z`}}).ok}function W(e,t){let n=new Map,o=new Set,{gap:i,scale:d}=t,l=(a,s)=>(t.heightOf(a.key,s)+i)/d,r=(a,s)=>a.anchorY!==null&&Math.abs(s-a.anchorY)*d>t.collapseAfterPx&&!a.isActive&&t.collapsible(a),p=e.findIndex(a=>a.isActive&&a.anchorY!==null),f=Number.NEGATIVE_INFINITY;for(let a=Math.max(p,0);a<e.length;a+=1){let s=e[a],c=s.anchorY===null?Number.isFinite(f)?f:0:Math.max(s.anchorY,f);n.set(s.key,c);let u=r(s,c);u&&o.add(s.key),f=c+l(s,u);}for(let a=p-1;a>=0;a-=1){let s=e[a],c=n.get(e[a+1].key),u=v=>{let b=c-l(s,v);return s.anchorY===null?b:Math.min(s.anchorY,b)},m=r(s,u(true));m&&o.add(s.key),n.set(s.key,u(m));}return {positions:n,collapsed:o}}function fe(e,t,n){return W(e.map(o=>({key:o.key,anchorY:o.anchorY,isActive:"isActive"in o&&o.isActive===true})),{gap:n.gap,scale:n.scale,collapseAfterPx:Number.POSITIVE_INFINITY,heightOf:o=>t.get(o)??n.defaultHeight,collapsible:()=>false}).positions}function q(e){return e.detail!==void 0&&reviewCodeOfSkip(e)!==reviewCodeOfSkip({reason:e.reason})?e.detail:e.reason}function K(e,t,n,o){if(n.ok)return null;let d=((e==="accept"||e==="reject")&&typeof n.reason=="string"?reviewCodeOfRefusal(n.reason):null)??diagnosticCodeOfRefusal(n.reason,n.code),l=n.reason==="collaboration-session-destroyed";return {action:e,key:t,code:d,sequence:o,final:l}}function U(e,t=e.snapshot?.()){return JSON.stringify(t?.hiddenReviewAuthors??[])}function z(e,t,n=false){if(n)return "review.refusedSessionEnded";switch(e){case "edit.refresh-in-progress":return "review.refusedRefresh";case "edit.read-only":return "review.refusedViewing";case "edit.protected-content":return "review.refusedProtected";case "edit.collaboration-not-ready":return "review.refusedCollaboration";case "review.retained-structure":return "review.refusedRetainedStructure";case "review.incomplete-group":return "review.refusedIncompleteGroup";case "review.revision-unsupported":return "review.refusedUnsupported";case "review.stale-revision":return "review.refusedStale";case "review.locked-content":return "review.refusedLockedContent";case "review.bound-content":return "review.refusedBoundContent";default:return t}}function ve(e,t){return t(z(e.code,V(e.action),e.final))}function V(e){return e==="reply"?"review.replyRefused":e==="comment"?"review.commentRefused":"review.actionRefused"}function I(e){let t=e.snapshot();return [e.getDocumentHandle().revision,e.getEditingMode(),t.editable,t.collaborationStatus,U(e,t)].join(":")}var T=new WeakMap;function Re(e){let t=T.get(e);if(t)return t;let n=null,o=0,i=new Set,d=null,l=null,r=()=>{for(let s of [...i])s();},p=()=>{let s=n!==null&&i.size>0;if(s&&!d){let c=e.on("change",f),u=e.on("selectionChange",f),m=e.on("error",f);d=()=>{c(),u(),m();};}else !s&&d&&(d(),d=null);};function f(){n&&n.at!==I(e)&&(n=null,p(),r());}let a={get:()=>n?.refusal??null,record(s,c,u){let m=K(s,c,u,o+1);m&&(o=m.sequence);let v=m!==null||n!==null;n=m?{refusal:m,at:I(e)}:null,p(),v&&r();},subscribe(s){return i.add(s),l??=e.on("reviewChangesResolved",({action:c,skipped:u})=>{let m=u.find(v=>v.reason!=="unknown-revision");a.record(c,m?m.pairKey??m.key:null,m?{ok:false,code:"unsupported",reason:`${q(m)}: the change stays pending`}:{ok:true,changed:true});}),p(),queueMicrotask(f),()=>{i.delete(s),i.size===0&&(l?.(),l=null),p();}}};return T.set(e,a),a}function be(e,t,n){let o=e.closest(".docx-editor__scroll-container")??e.offsetParent;if(!o)return ()=>{};let i=d=>{if(d.defaultPrevented||d.button!==0||!t.snapshot().selectionCollapsed)return;let l=d.target;if(!isElementNode(l)||e.contains(l))return;let r=l.closest(".docx-paginated-surface");if(!r||!o.contains(r))return;let p=r.closest(".docx-editor__scroll-container");if(p&&p!==o)return;let f=t.getReviewItems({placement:false}).find(a=>a.isActive);f?.kind==="comment"&&!f.resolved&&n(f.key);};return o.addEventListener("click",i),()=>o.removeEventListener("click",i)}var R=8;function M(e){let t=/^var\(--doc-review-author-(\d{1,2})\)$/.exec(e);return t?Number(t[1])%R:null}function j(e,t,n,o){let i=new Map(e.map(r=>[r.author,r])),d=new Map,l=new Map;for(let r of t){if(l.has(r.actorId))continue;let p=safeParticipantColor(o?.(r.name));if(p!==void 0){l.set(r.actorId,{color:p,slot:M(p)});continue}let f=safeParticipantColor(r.color);if(f!==void 0){l.set(r.actorId,{color:f,slot:null});continue}let a=i.get(r.name),s=safeParticipantColor(n?.(r.name));if(s!==void 0){l.set(r.actorId,{color:s,slot:M(s)??(a?a.slot%R:null)});continue}if(a!==void 0){let u=a.slot%R;l.set(r.actorId,{color:safeParticipantColor(a.color)??`var(--doc-review-author-${u})`,slot:u});continue}let c=d.get(r.name);c===void 0&&(c=e.length+d.size,d.set(r.name,c)),l.set(r.actorId,{color:`var(--doc-review-author-${c%R})`,slot:c%R});}return l}function Ee(e,t,n,o){return j(e,[t],n,o).get(t.actorId)}function xe(e){let t=e.trim().split(/\s+/,2),n="";for(let o of t){let i=[...o][0];i!==void 0&&(n+=i.toUpperCase());}return n}function Ce(e){return [...e].sort((t,n)=>{if(t.isLocal!==n.isLocal)return t.isLocal?-1:1;let o=t.name.localeCompare(n.name);return o!==0?o:t.actorId<n.actorId?-1:t.actorId>n.actorId?1:0})}function Se(e,t,n){for(let o of e)if(o.author===t)return o.style?.avatarUrl;return n?.(t)?.avatarUrl}var O=new Map;function Ie(e){let t=e==="en"?"":e,n=O.get(t);if(!n){let o={month:"short",day:"numeric",hour:"numeric",minute:"2-digit"};try{n=new Intl.DateTimeFormat(t||void 0,o);}catch{n=new Intl.DateTimeFormat(void 0,o);}O.set(t,n);}return n}var $='a[href], button, input, select, textarea, [contenteditable]:not([contenteditable="false"]), .docx-review__reply-box';function B(e){return isElementNode(e)&&e.closest($)!==null}function Oe(e){return B(e)||isElementNode(e)&&e.closest("[data-review-selectable]")!==null}var ke=Object.freeze({connecting:"collaboration.status.connecting",offline:"collaboration.status.offline",offlinePaused:"collaboration.status.offlinePaused",syncing:"collaboration.status.syncing",waiting:"collaboration.status.waiting",stalled:"collaboration.status.stalled",editRefused:"collaboration.status.editRefused",outOfSync:"collaboration.status.outOfSync",upgradeRequired:"collaboration.status.upgradeRequired",newRoomRequired:"collaboration.status.newRoomRequired"}),J=new Set(["concurrent-seed","blob-digest-mismatch","blob-store-full","too-many-nodes","too-many-parts","too-many-relationships","too-many-children","too-many-attributes","tree-too-deep"]),Z=new Set(["collaboration-format-mismatch","protocol-version-mismatch","schema-version-mismatch"]);function Ne(e){switch(e.status){case "inactive":case "destroyed":return null;case "initializing":return "connecting";case "error":return e.reasonCode!==void 0&&Z.has(e.reasonCode)?"upgradeRequired":e.reasonCode!==void 0&&J.has(e.reasonCode)?"newRoomRequired":e.recovering?"syncing":"outOfSync";case "disconnected":return e.offlineEditing?"offline":"offlinePaused";case "ready":return e.waiting?e.stalled?"stalled":"waiting":e.refusedRecently?"editRefused":null}}export{ke as A,Ne as B,X as a,N as b,ee as c,te as d,ne as e,oe as f,re as g,S as h,le as i,se as j,de as k,W as l,fe as m,z as n,ve as o,V as p,Re as q,be as r,Ie as s,B as t,Oe as u,j as v,Ee as w,xe as x,Ce as y,Se as z};