@docx-editor.dev/core 2.15.1 → 2.16.0
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 +9 -15
- package/dist/automation.cjs +1 -1
- package/dist/automation.d.ts +11 -9
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.ts +12 -16
- package/dist/binding.js +1 -1
- package/dist/{chunk-Q4AB7E4O.cjs → chunk-4MIFIUEV.cjs} +1 -1
- package/dist/chunk-66DTF4TD.cjs +2 -0
- package/dist/chunk-67U2OZS7.cjs +2 -0
- package/dist/chunk-6EGMDUL7.js +21 -0
- package/dist/chunk-ABXCIZVW.js +2 -0
- package/dist/chunk-AEIAYDCG.js +1 -0
- package/dist/{chunk-YL4Q5LZP.cjs → chunk-BPSGGVP5.cjs} +1 -1
- package/dist/chunk-CMV2MTDE.js +5 -0
- package/dist/chunk-DYPT6YDY.js +1 -0
- package/dist/chunk-EWV5JMJY.cjs +21 -0
- package/dist/chunk-FAD7DH6Q.cjs +1 -0
- package/dist/chunk-GHNTGVKG.cjs +11 -0
- package/dist/chunk-GQVKCK33.js +2 -0
- package/dist/chunk-I4ENGOOZ.js +1 -0
- package/dist/chunk-IZHDCQUC.js +20 -0
- package/dist/chunk-KEXMDQ2Z.js +1 -0
- package/dist/chunk-KQEUFAAG.cjs +20 -0
- package/dist/chunk-QVJO5FUR.js +11 -0
- package/dist/chunk-SIUUTE5M.js +2 -0
- package/dist/chunk-TDHR2QLH.cjs +1 -0
- package/dist/{chunk-PXKZUTHX.cjs → chunk-WGHVIB6B.cjs} +2 -2
- package/dist/chunk-XKQTITOJ.cjs +5 -0
- package/dist/{chunk-KXPVOPR5.js → chunk-YKDRBDI2.js} +1 -1
- package/dist/chunk-YRTRPSSA.cjs +1 -0
- package/dist/collaboration/replication.cjs +1 -1
- package/dist/collaboration/replication.d.ts +4 -4
- package/dist/collaboration/replication.js +1 -1
- package/dist/collaboration.d.ts +4 -4
- package/dist/contracts/editor.d.ts +9 -7
- package/dist/contracts/interaction.d.ts +73 -10
- package/dist/contracts/modules.d.ts +8 -8
- package/dist/{custom-node-writes-C9ArIlJh.d.ts → custom-node-writes-4WOL8JB_.d.ts} +2 -2
- package/dist/{editor-sRxrFJd8.d.ts → editor-PDx0fqSo.d.ts} +26 -125
- package/dist/editor-scope-DZJT4ukT.d.ts +53 -0
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +1 -1
- package/dist/editor.d.ts +32 -26
- package/dist/editor.js +1 -1
- package/dist/export.cjs +2 -2
- package/dist/export.d.ts +24 -12
- package/dist/export.js +2 -2
- package/dist/{font-resolver-BYEHQGTw.d.ts → font-resolver-CdqOugwZ.d.ts} +2 -2
- package/dist/{headless-document-view-DELC4E5v.d.ts → headless-document-view-C9ONlGtf.d.ts} +2 -2
- package/dist/{hf-references-DTrHkktY.d.ts → hf-references-BZVHctVD.d.ts} +1 -1
- package/dist/{index-C3Gvq4jN.d.ts → index-BVb4a6O3.d.ts} +74 -28
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +20 -18
- package/dist/index.js +1 -1
- package/dist/{layout-shaping-DoGR5cf8.d.ts → layout-shaping-D_U5z-Qh.d.ts} +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.ts +270 -459
- package/dist/layout.js +1 -1
- package/dist/{note-properties-DSe8igrz.d.ts → note-properties-BosjbkGC.d.ts} +1 -1
- package/dist/{omml-equation-BpRmfDAf.d.ts → omml-equation-oLlbPpVy.d.ts} +1 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.ts +6 -6
- package/dist/output.js +1 -1
- package/dist/{protocol-DZzKxH5r.d.ts → protocol-CUsqt13U.d.ts} +28 -6
- package/dist/{review-items-DYRx187i.d.ts → review-items-kC-YI70C.d.ts} +1 -1
- package/dist/{review-reads-LbGUdNzn.d.ts → review-reads-DdvADsmp.d.ts} +8 -7
- package/dist/{revision-projection-DHRJH48u.d.ts → revision-projection-CN_DiOl_.d.ts} +1 -1
- package/dist/{semantic-cell-selection-BXVWCBYm.d.ts → semantic-cell-selection-BMrXDniV.d.ts} +4 -4
- package/dist/{semantic-interaction-DZsDmPg5.d.ts → semantic-interaction-NGeYzYCN.d.ts} +1 -1
- package/dist/{semantic-paint-f7SqN4oW.d.ts → semantic-paint-CM8F-8pH.d.ts} +2 -2
- package/dist/{semantic-records-EIdwId-a.d.ts → semantic-records-BreR44Ki.d.ts} +1231 -947
- package/dist/store.cjs +1 -1
- package/dist/store.d.ts +80 -20
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-egdarvH_.d.ts → tree-op-types-C5rZzoAz.d.ts} +131 -53
- package/dist/{tree-package-fragment-DjkH4ESI.d.ts → tree-package-fragment-DDQHk8sv.d.ts} +3 -3
- package/dist/{tree-session-contract-CGOOgPjW.d.ts → tree-session-contract-dKgbKH9A.d.ts} +18 -8
- package/dist/{tree-store-DKJB0IcA.d.ts → tree-store-DU192chS.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-24APKZAN.cjs +0 -11
- package/dist/chunk-2YH4MSHX.cjs +0 -2
- package/dist/chunk-5Y7AADI6.js +0 -1
- package/dist/chunk-AREFLNUP.js +0 -11
- package/dist/chunk-AS7YZNQE.cjs +0 -2
- package/dist/chunk-AVGCKH6A.cjs +0 -20
- package/dist/chunk-CDYVDQRI.cjs +0 -5
- package/dist/chunk-HOEWFH5U.cjs +0 -1
- package/dist/chunk-KFELX7CN.js +0 -2
- package/dist/chunk-LGFKIF4M.cjs +0 -1
- package/dist/chunk-M52QXFKI.js +0 -1
- package/dist/chunk-MNUKSXRO.js +0 -1
- package/dist/chunk-PBOIGBDO.js +0 -2
- package/dist/chunk-PMHGONET.cjs +0 -1
- package/dist/chunk-QJYH6AYD.js +0 -1
- package/dist/chunk-QRC37MWG.cjs +0 -20
- package/dist/chunk-RJSB6RJ7.js +0 -20
- package/dist/chunk-SB54HLFJ.js +0 -20
- package/dist/chunk-XCESLTJL.js +0 -2
- package/dist/chunk-Z4527AXR.js +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use strict';var chunkYRTRPSSA_cjs=require('./chunk-YRTRPSSA.cjs'),chunkFGBADUSK_cjs=require('./chunk-FGBADUSK.cjs'),chunkWGHVIB6B_cjs=require('./chunk-WGHVIB6B.cjs'),chunk4MIFIUEV_cjs=require('./chunk-4MIFIUEV.cjs'),chunk67U2OZS7_cjs=require('./chunk-67U2OZS7.cjs'),chunkBPSGGVP5_cjs=require('./chunk-BPSGGVP5.cjs'),chunkGHNTGVKG_cjs=require('./chunk-GHNTGVKG.cjs'),prosemirrorModel=require('prosemirror-model'),prosemirrorState=require('prosemirror-state'),prosemirrorView=require('prosemirror-view'),prosemirrorKeymap=require('prosemirror-keymap'),prosemirrorCommands=require('prosemirror-commands');function z(t){return t.attributes?.val}function $(t){let e=z(t);return e===void 0||!(e==="0"||e==="false"||e==="off")}var yo=/^[0-9A-Fa-f]{6}$/,xe=/^\d{1,6}$/,ho=/^-?\d{1,6}$/;function $e(t){return t===void 0||t==="auto"?null:yo.test(t)?`#${t}`:null}var xo={single:"solid",words:"solid",thick:"solid",double:"double",dotted:"dotted",dottedHeavy:"dotted",dash:"dashed",dashedHeavy:"dashed",dashLong:"dashed",dashLongHeavy:"dashed",dotDash:"dashed",dashDotHeavy:"dashed",dotDotDash:"dashed",dashDotDotHeavy:"dashed",wave:"wavy",wavyHeavy:"wavy",wavyDouble:"wavy"},ko={black:"#000000",blue:"#0000ff",cyan:"#00ffff",darkBlue:"#000080",darkCyan:"#008080",darkGray:"#808080",darkGreen:"#008000",darkMagenta:"#800080",darkRed:"#800000",darkYellow:"#808000",green:"#00ff00",lightGray:"#c0c0c0",magenta:"#ff00ff",red:"#ff0000",yellow:"#ffff00",white:"#ffffff"};function Oo(t){return !t||!/^[\w \-.+]{1,64}$/.test(t)?null:`"${t}"`}function W(t,e=false){return t===void 0||!(e?ho:xe).test(t)?null:`${Number(t)/20}pt`}function Pn(t){let e=[],n=[],o=null,a=null;for(let s of t)switch(s.localName){case "b":e.push(`font-weight:${$(s)?"bold":"normal"}`);break;case "i":e.push(`font-style:${$(s)?"italic":"normal"}`);break;case "u":{let r=z(s)??"single";if(r==="none"||!$(s))break;n.push("underline"),o=xo[r]??"solid",a=$e(s.attributes?.color);break}case "strike":$(s)&&n.push("line-through");break;case "dstrike":$(s)&&n.push("line-through");break;case "caps":$(s)&&e.push("text-transform:uppercase");break;case "smallCaps":$(s)&&e.push("font-variant:small-caps");break;case "vertAlign":{let r=z(s);r==="superscript"?e.push("vertical-align:super","font-size:0.75em"):r==="subscript"&&e.push("vertical-align:sub","font-size:0.75em");break}case "color":{let r=$e(z(s));r&&e.push(`color:${r}`);break}case "highlight":{let r=ko[z(s)??""];r&&e.push(`background-color:${r}`);break}case "sz":{let r=z(s);r!==void 0&&xe.test(r)&&e.push(`font-size:${Number(r)/2}pt`);break}case "rFonts":{let r=Oo(s.attributes?.ascii??s.attributes?.hAnsi);r&&e.push(`font-family:${r}`);break}case "spacing":{let r=W(z(s),true);r&&e.push(`letter-spacing:${r}`);break}}return n.length>0&&(e.push(`text-decoration-line:${[...new Set(n)].join(" ")}`),o&&e.push(`text-decoration-style:${o}`),a&&e.push(`text-decoration-color:${a}`)),e.join(";")}var Po={left:"left",start:"left",right:"right",end:"right",center:"center",both:"justify",distribute:"justify"};function Sn(t){let e=[];for(let n of t)switch(n.localName){case "jc":{let o=Po[z(n)??""];o&&e.push(`text-align:${o}`);break}case "ind":{let o=W(n.attributes?.left??n.attributes?.start,true),a=W(n.attributes?.right??n.attributes?.end,true),s=W(n.attributes?.firstLine),r=W(n.attributes?.hanging);o&&e.push(`margin-left:${o}`),a&&e.push(`margin-right:${a}`),s?e.push(`text-indent:${s}`):r&&e.push(`text-indent:-${r}`);break}case "spacing":{let o=W(n.attributes?.before),a=W(n.attributes?.after);o&&e.push(`margin-top:${o}`),a&&e.push(`margin-bottom:${a}`);let s=n.attributes?.line,r=n.attributes?.lineRule;s!==void 0&&xe.test(s)&&r!=="exact"&&r!=="atLeast"?e.push(`line-height:${(Number(s)/240).toFixed(3)}`):s!==void 0&&xe.test(s)&&e.push(`line-height:${Number(s)/20}pt`);break}case "shd":{let o=$e(n.attributes?.fill);o&&e.push(`background-color:${o}`);break}case "pageBreakBefore":$(n)&&e.push("break-before:page");break;}return e.join(";")}var I=new prosemirrorModel.Schema({nodes:{doc:{content:"paragraph+"},paragraph:{content:"inline*",group:"block",attrs:{nodeId:{default:null},props:{default:[]}},toDOM:t=>{let e=Sn(t.attrs.props??[]);return ["p",{"data-node-id":String(t.attrs.nodeId??""),...e?{style:e}:{}},0]},parseDOM:[{tag:"p",getAttrs:t=>typeof t=="string"?null:{nodeId:t.getAttribute("data-node-id")||null,props:[]}}]},text:{group:"inline"},tab:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"tab",class:"docx-tab"},"\u2192"],parseDOM:[{tag:'span[data-token="tab"]'}]},hardBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["br"],parseDOM:[{tag:"br"}]},pageBreak:{inline:true,group:"inline",atom:true,selectable:false,toDOM:()=>["span",{"data-token":"page-break",class:"docx-page-break"}],parseDOM:[{tag:'span[data-token="page-break"]'}]},unknownInline:{inline:true,group:"inline",atom:true,selectable:false,draggable:false,attrs:{nodeId:{default:null},label:{default:""}},toDOM:t=>["span",{"data-token":"unknown","data-node-id":String(t.attrs.nodeId??""),contenteditable:"false",class:"docx-unknown-inline",title:String(t.attrs.label||"Content this editor cannot edit yet. It is preserved.")}],parseDOM:[{tag:'span[data-token="unknown"]',getAttrs:t=>typeof t=="string"?false:{nodeId:t.getAttribute("data-node-id")||null,label:""}}]}},marks:{runProps:{attrs:{props:{default:[]}},excludes:"runProps",toDOM:t=>{let e=t.attrs.props??[],n=Pn(e);return ["span",{"data-run-props":bo(e),...n?{style:n}:{}},0]},parseDOM:[{tag:"span[data-run-props]",getAttrs:t=>{if(typeof t=="string")return false;let e=Ro(t.getAttribute("data-run-props"));return e?{props:e}:false}}]}}});function bo(t){return JSON.stringify(Array.isArray(t)?t:[])}function Ro(t){if(!t)return null;try{let e=JSON.parse(t);if(!Array.isArray(e))return null;let n=[];for(let o of e){if(typeof o!="object"||o===null)return null;let a=o;if(typeof a.localName!="string"||a.attributes!==void 0&&(typeof a.attributes!="object"||a.attributes===null))return null;n.push(a.attributes===void 0?{localName:a.localName}:{localName:a.localName,attributes:a.attributes});}return n}catch{return null}}function ze(t){for(let e of t.marks)if(e.type.name==="runProps")return e.attrs.props??[];return []}function ke(t,e){return JSON.stringify(Oe(t))===JSON.stringify(Oe(e))}function Oe(t){return [...t].map(e=>({localName:e.localName,attributes:Object.fromEntries(Object.entries(e.attributes??{}).sort(([n],[o])=>n<o?-1:1))})).sort((e,n)=>e.localName<n.localName?-1:1)}function We(t){if(!t||t.kind==="textValue")return [];let e=[];for(let n of t.children){if(n.kind==="textValue"||n.localName==="rPrChange"||n.localName==="pPrChange")continue;let o={};for(let a of n.attributes)o[a.localName]=a.value;e.push(Object.keys(o).length>0?{localName:n.localName,attributes:o}:{localName:n.localName});}return e}function bn(t){return t.kind==="textValue"?"":`${{drawing:"Picture",pict:"Picture",object:"Embedded object",fldSimple:"Field",hyperlink:"Hyperlink",sdt:"Content control",tbl:"Table"}[t.localName]??t.localName} \u2014 preserved, not editable yet`}function A(t){if(t.kind==="textValue")return [];let e=[],n=s=>{if(s.kind!=="run")return;let r=s.children.find(c=>c.kind==="runProperties"),d=We(r);for(let c of s.children)if(c.kind!=="runProperties"){if(c.kind==="tab"){e.push({kind:"tab"});continue}if(c.kind==="hardBreak"){e.push(chunkGHNTGVKG_cjs.Ud(c)?{kind:"pageBreak"}:{kind:"hardBreak"});continue}if(c.kind==="text"){let p="";for(let g of c.children)g.kind==="textValue"&&(p+=g.value);p.length>0&&e.push({kind:"text",text:p,props:d});continue}e.push({kind:"unknown",nodeId:c.id,label:bn(c),modelLength:c.kind==="drawing"||chunkGHNTGVKG_cjs.hb(c)||chunkGHNTGVKG_cjs.Sa(c)?1:0});}},o=s=>{if(s.kind==="run"){n(s);return}e.push({kind:"unknown",nodeId:s.id,label:bn(s),modelLength:0});},a=(s,r)=>{for(let d of s)if(!(d.kind==="textValue"||d.kind==="paragraphProperties")&&!(r>=chunkGHNTGVKG_cjs.la)){if(chunkGHNTGVKG_cjs.na(d)&&!chunkGHNTGVKG_cjs.ka(d.kind)&&r<chunkGHNTGVKG_cjs.la){a(d.children.filter(c=>!chunkGHNTGVKG_cjs.Pf(d,c)),chunkGHNTGVKG_cjs.ma(d,r));continue}if(chunkGHNTGVKG_cjs.Cd(d)){let c=chunkGHNTGVKG_cjs.Ed(d);c&&a(c,chunkGHNTGVKG_cjs.ma(d,r));continue}o(d);}};return a(t.children,0),e}function ee(t){let e=[],n=o=>{if(o.kind!=="textValue"){if(o.kind==="body"){for(let a of o.children)a.kind==="paragraph"&&e.push(a);return}for(let a of o.children)n(a);}};return n(t.root),e}var Rn=chunkGHNTGVKG_cjs.fg(16),vn=new WeakMap;function vo(t,e){let n=vn.get(t);if(!n){let o=[];chunkGHNTGVKG_cjs.Ad([t],o,0),n=Object.freeze(o),vn.set(t,n);}for(let o of n)e.push(o);}function F(t){let e=Rn.get(t);if(e)return e;let n=[];for(let o of chunkGHNTGVKG_cjs.wd(t))if(o.root.kind!=="textValue")for(let a of o.root.children)vo(a,n);return Rn.set(t,n),n}function J(t){let e=ee(t).map(n=>{let o=n.kind==="textValue"?void 0:n.children.find(s=>s.kind==="paragraphProperties"),a=A(n).map(s=>{switch(s.kind){case "text":return I.text(s.text,s.props.length>0?[I.marks.runProps.create({props:s.props})]:[]);case "tab":return I.node("tab");case "hardBreak":return I.node("hardBreak");case "pageBreak":return I.node("pageBreak");default:return I.node("unknownInline",{nodeId:s.nodeId,label:s.label})}});return I.node("paragraph",{nodeId:n.id,props:We(o)},a)});return I.node("doc",null,e.length>0?e:[I.node("paragraph")])}function To(t,e){let n=[];return t.forEach(o=>{if(o.isText&&o.text){n.push({kind:"text",text:o.text,props:ze(o)});return}o.type.name==="tab"?n.push({kind:"tab"}):o.type.name==="hardBreak"?n.push({kind:"hardBreak"}):o.type.name==="pageBreak"?n.push({kind:"pageBreak"}):o.type.name==="unknownInline"&&n.push({kind:"unknown",nodeId:String(o.attrs.nodeId??""),label:String(o.attrs.label??""),modelLength:e.has(String(o.attrs.nodeId??""))?1:0});}),n}function D(t){let e="";for(let n of t)n.kind==="text"?e+=n.text:n.kind==="tab"?e+=" ":n.kind==="hardBreak"?e+=`
|
|
2
|
+
`:n.kind==="pageBreak"?e+=chunkGHNTGVKG_cjs.Sd:n.modelLength===1&&(e+=chunkGHNTGVKG_cjs.Xd);return e}function L(t){let e=[],n=0;for(let o of t)o.kind==="text"?n+=o.text.length:o.kind==="tab"||o.kind==="hardBreak"||o.kind==="pageBreak"?n+=1:(e.push(`${o.nodeId}@${n}`),n+=o.modelLength);return e}function No(t,e){if(t===e)return null;let n=0,o=Math.min(t.length,e.length);for(;n<o&&t[n]===e[n];)n+=1;let a=t.length,s=e.length;for(;a>n&&s>n&&t[a-1]===e[s-1];)a-=1,s-=1;return {start:n,endBefore:a,endAfter:s}}function Tn(t){let e=[];for(let n of t)if(n.kind==="text")for(let o=0;o<n.text.length;o+=1)e.push(n.props);else n.kind==="tab"||n.kind==="hardBreak"||n.kind==="pageBreak"?e.push(e[e.length-1]??[]):n.kind==="unknown"&&n.modelLength===1&&e.push([]);return e}function Io(t,e,n,o,a){let s=[],r=D(e),d=D(n),c=No(r,d),p=[],g=0,k=false;for(let h of e){if(h.kind!=="unknown"){g+=h.kind==="text"?h.text.length:1;continue}let u=g;h.modelLength===1&&c&&(c.start<g+1&&c.endBefore>g&&(k=true),c.endBefore<=g&&(u+=c.endAfter-c.endBefore)),p.push(`${h.nodeId}@${u}`),g+=h.modelLength;}if(k||JSON.stringify(p)!==JSON.stringify(L(n)))return {ok:false,reason:"unknown-content-moved",detail:t};if(ke(o,a)||s.push({op:"setParagraphProperties",paragraphId:t,properties:Oe(a)}),c&&(c.endBefore>c.start&&s.push({op:"deleteText",paragraphId:t,start:c.start,end:c.endBefore}),c.endAfter>c.start)){let h=d.slice(c.start,c.endAfter),u=c.start,y="",O=()=>{y.length!==0&&(s.push({op:"insertText",paragraphId:t,offset:u,text:y}),u+=y.length,y="");};for(let R of h)R===" "?(O(),s.push({op:"insertTab",paragraphId:t,offset:u}),u+=1):R===`
|
|
3
|
+
`?(O(),s.push({op:"insertHardBreak",paragraphId:t,offset:u}),u+=1):R===chunkGHNTGVKG_cjs.Sd?(O(),s.push({op:"insertPageBreak",paragraphId:t,offset:u}),u+=1):y+=R;O();}if(!c){let h=Tn(e),u=Tn(n),y=0;for(;y<u.length;){if(ke(h[y]??[],u[y])){y+=1;continue}let O=y,R=u[y];for(;y<u.length&&ke(u[y],R)&&!ke(h[y]??[],u[y]);)y+=1;s.push({op:"setRunProperties",paragraphId:t,start:O,end:y,properties:Oe(R)});}}return {ok:true,ops:s}}function Je(t,e){let n=ee(t),o=new Set;for(let d of n)for(let c of A(d))c.kind==="unknown"&&c.modelLength===1&&o.add(c.nodeId);let a=d=>To(d,o),s=[];if(e.forEach(d=>{d.type.name==="paragraph"&&s.push(d);}),s.length!==e.childCount)return {ok:false,reason:"unsupported-node"};let r=s.length-n.length;if(r===0){let d=[];for(let[c,p]of s.entries()){let g=n[c];if(p.attrs.nodeId!==g.id)return {ok:false,reason:"paragraph-reordered",detail:String(p.attrs.nodeId)};let k=Io(g.id,A(g),a(p),We(g.kind==="textValue"?void 0:g.children.find(h=>h.kind==="paragraphProperties")),p.attrs.props??[]);if(!k.ok)return k;d.push(...k.ops);}return {ok:true,ops:d}}return r===1?Eo(n,s,a):r===-1?Mo(n,s,a):{ok:false,reason:"paragraph-count-unexplained",detail:String(r)}}function Eo(t,e,n){for(let o=0;o<t.length;o+=1){let a=t[o],s=e[o],r=e[o+1];if(!s||!r||s.attrs.nodeId!==a.id)continue;let d=r.attrs.nodeId;if(d!==null&&d!==a.id)continue;let c=n(s),p=n(r),g=A(a),k=D(c);if(k+D(p)===D(g)&&JSON.stringify(L([...c,...p]))===JSON.stringify(L(g))&&Nn(t,e,o,n)&&In(t,e,o+1,o+2,n))return {ok:true,ops:[{op:"splitParagraph",paragraphId:a.id,offset:k.length}]}}return {ok:false,reason:"split-not-clean"}}function Mo(t,e,n){for(let o=0;o+1<t.length;o+=1){let a=t[o],s=t[o+1],r=e[o];if(!r||r.attrs.nodeId!==a.id)continue;let d=[...A(a),...A(s)],c=n(r);if(D(c)===D(d)&&JSON.stringify(L(c))===JSON.stringify(L(d))&&Nn(t,e,o,n)&&In(t,e,o+2,o+1,n))return {ok:true,ops:[{op:"joinParagraphs",firstId:a.id,secondId:s.id}]}}return {ok:false,reason:"join-not-clean"}}function Nn(t,e,n,o){for(let a=0;a<n;a+=1){let s=e[a],r=t[a];if(!s||s.attrs.nodeId!==r.id||D(o(s))!==D(A(r))||JSON.stringify(L(o(s)))!==JSON.stringify(L(A(r))))return false}return true}function In(t,e,n,o,a){for(let s=0;n+s<t.length;s+=1){let r=t[n+s],d=e[o+s];if(!d||d.attrs.nodeId!==r.id||D(a(d))!==D(A(r))||JSON.stringify(L(a(d)))!==JSON.stringify(L(A(r))))return false}return true}function Co(t,e){return chunkGHNTGVKG_cjs.Ga(t,e)!==null}function Ye(t,e,n){if(!n||n.created.length>0||n.deleted.length>0||n.splitJoin.length>0)return J(e);let o=new Map;t.forEach(c=>{let p=c.attrs.nodeId;typeof p=="string"&&o.set(p,c);});let a=new Set(n.dirty),s=ee(e);if(s.length!==t.childCount)return J(e);let r=J(e),d=[];for(let[c,p]of s.entries()){let g=o.get(p.id);d.push(g&&!a.has(p.id)?g:r.child(c));}return I.node("doc",null,d)}function Mn(t){return F(t).map(e=>chunkGHNTGVKG_cjs.Nh(t,e.id)??"").join(`
|
|
4
|
+
`)}var Do=64,En=new WeakMap;function Ue(t,e=0){if(e>Do)return false;let n=En.get(t);if(n!==void 0)return n;let o=false;for(let a of t.children)if(a.kind!=="textValue"&&(a.kind==="commentRangeStart"||a.kind==="commentReference"||Ue(a,e+1))){o=true;break}return En.set(t,o),o}function wo(t,e){let n=t.kind==="revision"?t.ranges[0]??null:t.range;if(!n)return null;let o=e.get(n.start.paragraphId);return o===void 0?null:o}function Cn(t,e,n){for(let a of e)if(a.ranges.length===0)return false;let o=new Set;for(let a of t)a.kind!=="revision"||a.ranges.length>0||wn(a,n)||o.add(chunk67U2OZS7_cjs.za(a));for(let a of e)if(o.has(chunk67U2OZS7_cjs.za(a)))return false;return true}function Dn(t,e,n,o){let a=e.get(n);if(a===void 0)return [...t];let s=[],r=null;for(let d of t){if(d.kind==="revision"&&wn(d,n)){r===null&&(r=s.length);continue}if(r===null){let c=wo(d,e);c!==null&&c>a&&(r=s.length);}s.push(d);}if(r===null&&(r=s.length),o.length>0){let d=o.length<2?[...o]:[...o].sort((c,p)=>chunk67U2OZS7_cjs.Ca(c,e)-chunk67U2OZS7_cjs.Ca(p,e));s.splice(r,0,...d);}return chunk67U2OZS7_cjs.Ma(s)}function wn(t,e){return t.ranges.length>0&&t.ranges.every(n=>n.start.paragraphId===e&&n.end.paragraphId===e)}function Ao(t,e){return t.range?t.range.start.paragraphId===e||t.range.end.paragraphId===e:false}function Fo(t,e){return t.revisionKind==="structural"&&t.ranges.some(n=>n.start.paragraphId===e||n.end.paragraphId===e)}function Lo(t,e){return t.ranges.length===0||!t.ranges.some(o=>o.start.paragraphId===e||o.end.paragraphId===e)?false:!t.ranges.every(o=>o.start.paragraphId===e&&o.end.paragraphId===e)}function An(t,e,n,o,a,s,r){if(t.fromRevision!==e.bodyRevision||r!==e.packageRevision+1||t.story!==void 0&&t.story.kind!=="body"||t.impact!=="text-local"||t.dirty.length!==1||t.created.length>0||t.deleted.length>0||t.splitJoin.length>0||e.commentsPart!==a||e.commentsExtendedPart!==s)return null;let d=t.dirty[0],c=chunkGHNTGVKG_cjs.Ga(o,d);if(!c||c.kind!=="paragraph")return null;for(let p of n){if(p.kind==="comment"){if(Ao(p,d))return null;continue}if(p.kind==="custom"){if(p.range?.start.paragraphId===d)return null;continue}if(Fo(p,d)||Lo(p,d))return null}return d}var Bn=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,Bo=["ascii","hAnsi","cs","eastAsia"],_o=["asciiTheme","hAnsiTheme","cstheme","eastAsiaTheme"],jo=128,Ho=/[\u0000-\u001F\u007F-\u009F]/;function w(t){return t.kind!=="textValue"}function Y(t,e){return t.attributes.find(n=>n.localName===e)?.value}function _n(t,e){let n=new Map;for(let a of t)for(let s of a.children)if(w(s))for(let[r,d]of $n(s,e))n.has(r)||n.set(r,d);let o=[...n.values()];return o.sort((a,s)=>a<s?-1:a>s?1:0),o}var Ge=new WeakMap,jn=16,Hn=32;function $n(t,e,n=0){let o=e?.major??null,a=e?.minor??null,s=e?.majorEastAsia??null,r=e?.minorEastAsia??null,d=Ge.get(t);if(d&&d.major===o&&d.minor===a&&d.majorEastAsia===s&&d.minorEastAsia===r)return d.byFold;if(t.children.length>=jn&&n<Hn&&t.localName!=="rFonts"){let k=new Map;for(let h of t.children)if(w(h))for(let[u,y]of $n(h,e,n+1))k.has(u)||k.set(u,y);return Ge.set(t,{major:o,minor:a,majorEastAsia:s,minorEastAsia:r,byFold:k}),k}let c=new Map,p=k=>{if(!k||!Bn.test(k))return;let h=k.toLowerCase();c.has(h)||c.set(h,k);},g=[t];for(;g.length>0;){let k=g.pop();if(w(k)){if(k.localName==="rFonts"){for(let h of Bo)p(Y(k,h));if(e)for(let h of _o)p(chunkWGHVIB6B_cjs.b(Y(k,h),e));}for(let h=k.children.length-1;h>=0;h-=1)g.push(k.children[h]);}}return Ge.set(t,{major:o,minor:a,majorEastAsia:s,minorEastAsia:r,byFold:c}),c}function zn(t){let e=new Map;for(let o of t)for(let a of o.children)if(w(a))for(let[s,r]of Wn(a))e.has(s)||e.set(s,r);let n=[...e.values()];return n.sort((o,a)=>o<a?-1:o>a?1:0),n}var Fn=new WeakMap,$o=new Map;function Wn(t,e=0){let n=Fn.get(t);if(n)return n;let o=r=>{let d=r.size===0?$o:r;return Fn.set(t,d),d},a=new Map;if(t.children.length>=jn&&e<Hn&&t.localName!=="sym"){for(let r of t.children)if(w(r))for(let[d,c]of Wn(r,e+1))a.has(d)||a.set(d,c);return o(a)}let s=[t];for(;s.length>0;){let r=s.pop();if(w(r)){if(r.localName==="sym"&&r.namespaceUri===chunkGHNTGVKG_cjs.da){let d=r.attributes.find(p=>p.localName==="font"&&(p.namespaceUri===chunkGHNTGVKG_cjs.da||p.namespaceUri===""))?.value,c=chunkYRTRPSSA_cjs.b(d);c!==null&&!a.has(c.toLowerCase())&&a.set(c.toLowerCase(),c);}for(let d=r.children.length-1;d>=0;d-=1)s.push(r.children[d]);}}return o(a)}function Jn(t){let e=[...t];for(;e.length>0;){let n=e.pop();if(w(n)){if(n.localName==="t"&&n.namespaceUri===chunkGHNTGVKG_cjs.da){for(let o of n.children)if(!w(o)&&o.value.length>0)return true;continue}for(let o of n.children)e.push(o);}}return false}var zo=new Set(["paragraph","character","table","numbering"]),Wo=/^[0-9A-Fa-f]{6}$/,Jo=16,Ln=new Map([["normal",0],["title",1],["subtitle",2],["heading 1",11],["heading 2",12],["heading 3",13],["heading 4",14],["heading 5",15],["heading 6",16],["heading 7",17],["heading 8",18],["heading 9",19]]);function Yn(t){return t.children}function Ke(t,e){for(let n of Yn(t))if(w(n)&&n.localName===e)return n}function Yo(t){return Ln.get(t.name.toLowerCase())??Ln.get(t.styleId.toLowerCase())??Number.MAX_SAFE_INTEGER}function Xe(t){return t===void 0||t.length===0||t.length>jo||Ho.test(t)?null:t}function Un(t,e){if(!t)return [];let n=new Map;for(let s of t.children){if(!w(s)||s.localName!=="style")continue;let r=Xe(Y(s,"styleId"));r!==null&&!n.has(r)&&n.set(r,s);}let o=s=>{let r=false,d=false,c=null,p=false,g=false,k=new Set,h=s;for(let O=0;O<Jo&&h!==null&&!k.has(h);O+=1){k.add(h);let R=n.get(h);if(!R)break;let b=Ke(R,"rPr");for(let T of b?Yn(b):[]){if(!w(T))continue;let v=Y(T,"val"),E=v!=="0"&&v!=="false"&&v!=="off";T.localName==="b"&&!p?(r=E,p=true):T.localName==="i"&&!g?(d=E,g=true):T.localName==="color"&&c===null&&v&&Wo.test(v)&&(c=v);}let S=Ke(R,"basedOn");h=S?Xe(Y(S,"val")):null;}let u=e?.(s),y=u?.fontFamily??null;return {fontFamily:y!==null&&Bn.test(y)?y:null,fontSizePt:u?.fontSizeHalfPoints!=null&&u.fontSizeHalfPoints>0?u.fontSizeHalfPoints/2:null,bold:r,italic:d,color:c}},a=[];for(let[s,r]of n){let d=Y(r,"type");if(d===void 0||!zo.has(d))continue;let c=Ke(r,"name"),p=Xe(c?Y(c,"val"):void 0);a.push({styleId:s,name:p??s,type:d,preview:o(s)});}return a.map((s,r)=>({entry:s,index:r,rank:Yo(s)})).sort((s,r)=>s.rank-r.rank||s.index-r.index).map(s=>s.entry)}var Uo=128,Go=/[\u0000-\u001F\u007F-\u009F]/,Ko=/[\u0000-\u001F\u007F-\u009F]/g,Xo=200;function Qe(t){return t.kind!=="textValue"}function Gn(t,e){for(let n of t.children)if(Qe(n)&&n.localName===e)return n}function Ve(t,e){return t.attributes.find(n=>n.localName===e)?.value}function Vo(t){let e=new Map;if(!t)return e;for(let n of t.children){if(!Qe(n)||n.localName!=="style"||Ve(n,"type")!=="paragraph")continue;let o=Ve(n,"styleId");if(o===void 0||o.length===0||o.length>Uo||Go.test(o))continue;let a=chunkFGBADUSK_cjs.a(n);a!==null&&e.set(o,a);}return e}function Ze(t){let e=Gn(t,"pPr"),n=e?Gn(e,"pStyle"):void 0;return n?Ve(n,"val"):void 0}function Kn(t,e){let n=Vo(e);if(n.size===0)return [];let o=[];for(let a of ee(t)){if(!Qe(a))continue;let s=Ze(a);if(s===void 0)continue;let r=n.get(s);if(r===void 0)continue;let c=(chunkGHNTGVKG_cjs.Nh(t,a.id)??"").replace(Ko," ").trim().slice(0,Xo);c.length!==0&&o.push({text:c,level:r,blockId:a.id});}return o}function Qo(t,e,n){let o=new Map,a=n(t);for(let s of a){let r=o.get(s.hostParagraphId);r?r.push(s):o.set(s.hostParagraphId,[s]);}return o}function Zo(t,e,n){let o=[];for(let a of chunkGHNTGVKG_cjs.zd(t.root)){let s=e.get(a.id);if(s)for(let r of s)o.push(r);}return o}function Xn(t,e,n=chunkGHNTGVKG_cjs.wg){let o=[],a=new Map;for(let s of t){if(o.push(s),s.scope?.kind==="note")continue;let r=a.get(s.part);r||(r=Qo(s.part,e,n),a.set(s.part,r));for(let d of Zo(s,r)){let c=s.scope;o.push({part:s.part,root:d.root,scope:{kind:"frame",id:d.root.id,drawingNodeId:d.drawingNodeId,hostParagraphId:d.hostParagraphId,...c?.kind==="headerFooter"?{owner:c}:{}}});}}return o}var Pe=48,qo=/[\u0000-\u001F\u007F-\u009F]/g;function er(t){let e=[],n=chunkGHNTGVKG_cjs.Me(t),o=new Map;for(let a of n.segments)chunkGHNTGVKG_cjs.de(a.node)&&o.set(a.node.id,a.formatRunIds??[]);return chunkGHNTGVKG_cjs.Jd(t.children,0,a=>{if(a.kind==="run"){e.push({id:a.id,start:n.spanOf(a)?.start??0});return}if(chunkGHNTGVKG_cjs.de(a))for(let s of o.get(a.id)??[]){let r=n.spanOf(s);r&&e.push({id:s,start:r.start});}},{descendRevisions:true}),e}function tr(t){let e=chunkGHNTGVKG_cjs.yd(t);return e?[{part:t,root:e}]:[]}function nr(t,e){let n=[];for(let o of ["header","footer"])for(let a of t){let s=o==="header"?a.headers:a.footers;for(let[r,d]of s){if(!chunkGHNTGVKG_cjs.Kd(a,r)||e.has(d.part))continue;e.add(d.part);let c=chunkGHNTGVKG_cjs.wd(d.part).find(p=>p.kind===o);c&&n.push({part:d.part,root:c.root,scope:{kind:"headerFooter",rId:d.rId}});}}return n}function Vn(t,e,n){if(!t)return [];let o=[];for(let a of chunkGHNTGVKG_cjs.sd(t.root)){let s=chunkGHNTGVKG_cjs.gd(a);!chunkGHNTGVKG_cjs.id(a)||s===null||!n.has(s)||o.push({part:t,root:a,scope:{kind:"note",id:chunkGHNTGVKG_cjs.Yc(e,s)}});}return o}function or(t,e){let n=tr(t);if(e){let o=new Set;for(let a of nr(e.headerFooterBySection,o))n.push(a);for(let a of Vn(e.footnotes,"footnote",e.referencedNoteIds.footnote))n.push(a);for(let a of Vn(e.endnotes,"endnote",e.referencedNoteIds.endnote))n.push(a);}return Xn(n)}function Qn(t,e){if(t.length===0)return {index:0,offset:e};for(let n=t.length-1;n>=0;n-=1){let o=t[n].start;if(e>=o)return {index:n,offset:e-o}}return {index:0,offset:e}}function rr(t,e,n){let o=t.findIndex(a=>a.id===e);return o<0?null:{index:o,offset:n}}function qe(t,e){return t.replace(qo," ").slice(0,e)}function Zn(t,e,n={},o){let a={matches:[],truncated:false};if(!chunk67U2OZS7_cjs.Ra(e))return a;let s=n.limit!==void 0&&Number.isInteger(n.limit)&&n.limit>0?Math.min(n.limit,2e3):2e3,r={...n.matchCase===void 0?{}:{matchCase:n.matchCase},...n.wholeWord===void 0?{}:{wholeWord:n.wholeWord}},d=[],c=n.stories==="body"?void 0:o;for(let p of or(t,c)){let g=0;for(let k of chunkGHNTGVKG_cjs.zd(p.root)){if(k.kind!=="paragraph")continue;let h=g;g+=1;let u=chunkGHNTGVKG_cjs.Nh(p.part,k.id)??"",y=chunk4MIFIUEV_cjs.d(k,u);if(y.text.length===0)continue;let O=s-d.length,R=y.findOccurrences(e,Math.max(O,1),r);if(O===0&&R.matches.length>0)return {matches:d,truncated:true};let b=null;for(let S of R.matches){let T=S.start+S.length;b??=er(k);let v=y.resultRunAddressAt(S.start),E=v?rr(b,v.runId,v.offset)??Qn(b,S.rawStart):Qn(b,S.rawStart);d.push({blockId:k.id,start:S.rawStart,length:S.rawEnd-S.rawStart,paragraphIndex:h,runIndex:E.index,runOffset:E.offset,...p.scope?{scope:p.scope}:{},text:qe(y.text.slice(S.start,T),256),contextBefore:qe(y.text.slice(Math.max(0,S.start-Pe),S.start),Pe),contextAfter:qe(y.text.slice(T,T+Pe),Pe)});}if(R.truncated)return {matches:d,truncated:true}}}return {matches:d,truncated:false}}var ar=["lt1","dk1","lt2","dk2","accent1","accent2","accent3","accent4","accent5","accent6"];function te(t){return chunkWGHVIB6B_cjs.a(t)}function qn(t){let e=chunkGHNTGVKG_cjs.ab(t),n=[];for(let o of ar){let a=e.get(o);if(!a)return [];n.push({slot:o,hex:a});}return n}var eo=new WeakMap;function tt(t){let e=eo.get(t);if(e!==void 0)return e;let n=chunkGHNTGVKG_cjs.Eb(t),o=n===null||!chunkGHNTGVKG_cjs.Db(n)?null:n;return eo.set(t,o),o}var et=class{#e;#t;constructor(e,n){this.#e=e,this.#t=n;}get size(){return this.#e.size}get(e){if(this.#e.has(e))return this.#t.find(n=>e.startsWith(`${n.name}#`))}has(e){return this.get(e)!==void 0}*entries(){for(let e of this.#e.keys()){let n=this.get(e);n&&(yield [e,n]);}}keys(){return this.#e.keys()}*values(){for(let[,e]of this.entries())yield e;}[Symbol.iterator](){return this.entries()}forEach(e,n){for(let[o,a]of this.entries())e.call(n,a,o,this);}};function to(t,e){return Object.freeze({...t,partByNode:new et(t.ordinalByNode,e)})}function no(t){let e=new Map,n=new Map,o=new Map,a=new Set,s=new Map,r=new Map,d=0;for(let c of t)for(let p of F(c)){o.set(p.id,d),s.set(p.id,c),d+=1;let g=tt(p);if(g===null)continue;e.set(p.id,g);let k=g.toUpperCase(),h=r.get(k);h?(h.push(p.id),a.add(k)):(r.set(k,[p.id]),n.set(k,p.id));}return Object.freeze({paraIdByNode:e,nodeByParaId:n,ordinalByNode:o,ambiguousParaIds:a,partByNode:s,claimantsByParaId:r})}function oo(t,e){let n=t.indexOf("#");if(n<=0)return null;let o=t.slice(0,n),a=e.body.name===o?e.body:void 0;a??=e.openStories.find(d=>d.name===o);let s=a?void 0:e.otherStories.find(d=>d.name===o);if(a??=s?e.normalize(s):void 0,!a)return null;let r=chunkGHNTGVKG_cjs.Ga(a,t);return r?.kind==="paragraph"?tt(r):null}var ro={committed:false,rejected:false,opCount:0};function U(t,e){return e===void 0?{committed:false,rejected:true,opCount:t}:{committed:false,rejected:true,opCount:t,reason:e}}function ao(t,e,n={}){let o=e.filter(p=>p.ops.length>0),a=o.reduce((p,g)=>p+g.ops.length,0);if(a===0)return ro;if(o.some(p=>p.ops.some(chunkGHNTGVKG_cjs.qf))||o.some(p=>p.ops.some(chunkGHNTGVKG_cjs.Yf)))return U(a,"invalidArgs");let[s,...r]=o,d=[];for(let p of r){let g=t.partFor(p.scope);if(!g)return U(a,"unknown-part");d.push({partName:g.name,ops:p.ops});}let c=t.transact(s.scope,p=>{for(let g of s.ops)p.apply(g);for(let g of d)for(let k of g.ops)p.applyTo(g.partName,k);},n);return c.ok?{committed:true,rejected:false,opCount:a}:U(a,c.reason)}function so(t,e,n,o,a,s){if(e.length===0)return ro;let r=e.filter(p=>chunkGHNTGVKG_cjs.qf(p)||chunkGHNTGVKG_cjs.Yf(p)).length;if(r>0){if(r!==e.length||e.length!==1)return U(e.length,"invalidArgs");let p=chunkGHNTGVKG_cjs.Mb(s.actorId,()=>t.applyLifecycleOp(e[0]));return p.ok?{committed:true,rejected:false,opCount:1}:U(1,p.detail??p.reason)}let d=s.recordsHistory===false&&s.actorId&&s.operationId?t.partFor(a)?.name:void 0,c=t.transact(a,p=>{n!==void 0&&p.selectionBefore(n),o!==void 0&&p.selectionAfter(o);for(let g of e)p.apply(g);d&&p.applyPackage(g=>chunkBPSGGVP5_cjs.a(g,d,e));},s);return c.ok?{committed:true,rejected:false,opCount:e.length}:U(e.length,c.reason)}var sr=Object.freeze([]);function ir(t,e={}){let n=chunkGHNTGVKG_cjs.cc(t);if(!n.ok)return {ok:false,reason:n.reason,...n.detail?{detail:n.detail}:{}};let o=n.package,a=o.parts.get(o.mainDocumentPart);if(!a)return {ok:false,reason:"no-main-document-tree",detail:o.mainDocumentPart};let s=chunkGHNTGVKG_cjs.Kb(a),r=new chunk67U2OZS7_cjs.G(o,s),d=null,c=null,p=null,g=null,k=null;r.subscribe(i=>{g=i,k=r.currentPackage();});let h=()=>r.bodyStore(),u=()=>r.currentPackage(),y=Object.freeze({kind:"body"}),O=(i,l)=>{let f=l?.find(x=>x.type==="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings");if(!f)return;let m=chunkGHNTGVKG_cjs.E(f);return m.mode==="Internal"&&m.target.ok?i.parts.get(m.target.partName):void 0},R=(i,l,f)=>{if(i.mainRelationships!==f||i.settingsPart!==O(l,f))return false;for(let m of i.resolution)for(let x of [m.headers,m.footers])for(let P of x.values())if(l.parts.get(P.partName)!==P.part)return false;return true},b=()=>{let i=u(),l=i.relationships.get(i.mainDocumentPart);if(d&&g&&k===i&&R(d,i,l)&&d.packageRevision===g.fromRevision&&r.packageRevision===g.toRevision&&g.story?.kind==="body"&&g.impact==="text-local"&&g.created.length===0&&g.deleted.length===0&&g.splitJoin.length===0&&(d={...d,packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:O(i,l)}),!d||d.packageRevision!==r.packageRevision||d.pkg!==i){let f=chunkGHNTGVKG_cjs.Nd(i);d={packageRevision:r.packageRevision,pkg:i,mainRelationships:l,settingsPart:O(i,l),resolution:f,parts:chunkGHNTGVKG_cjs.Md(f)};}return d},S="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",T="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",v=null,E=()=>{let i=u(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(x=>x.type===S),f;if(l){let x=chunkGHNTGVKG_cjs.E(l);x.mode==="Internal"&&x.target.ok&&(f=i.parts.get(x.target.partName));}f??=i.parts.get("/word/styles.xml");let m=f?.root??null;return m!==v&&(v=m,ue=null,V=null),v},G=null,B=null,ne=()=>{let i=u();if(G===i)return B;G=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(m=>m.type===T),f;if(l){let m=chunkGHNTGVKG_cjs.E(l);m.mode==="Internal"&&m.target.ok&&(f=i.parts.get(m.target.partName));}return f??=i.parts.get("/word/numbering.xml"),B=f?.root??null,B},Se="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",nt=null,be=null,ot=()=>{let i=u();if(nt===i)return be;nt=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(m=>m.type===Se),f;if(l){let m=chunkGHNTGVKG_cjs.E(l);m.mode==="Internal"&&m.target.ok&&(f=i.parts.get(m.target.partName));}return f??=i.parts.get("/word/settings.xml"),be=f?.root??null,be},lo="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",co="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",rt=(i,l)=>{let f=u(),m=(f.relationships.get("/")??[]).find(P=>P.type===i),x;if(m){let P=chunkGHNTGVKG_cjs.E(m);P.mode==="Internal"&&P.target.ok&&(x=f.parts.get(P.target.partName));}return x??f.parts.get(l)},at=null,Re=chunkGHNTGVKG_cjs.ug,uo=()=>{let i=u();if(at===i)return Re;at=i;let l=rt(lo,"/docProps/core.xml"),f=rt(co,"/docProps/app.xml");return Re=chunkGHNTGVKG_cjs.vg(l?.root??null,f?.root??null),Re},po="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",st=null,de=null,K=()=>{let i=u();if(st===i)return de;st=i;let l=(i.relationships.get(i.mainDocumentPart)??[]).find(x=>x.type===po),f;if(l){let x=chunkGHNTGVKG_cjs.E(l);x.mode==="Internal"&&x.target.ok&&(f=i.parts.get(x.target.partName));}f??=i.parts.get("/word/theme/theme1.xml");let m=f?.root??null;return m!==de&&(de=m,Te=null,ve=null,ue=null,V=null),de},fo="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",ce=null,mo=()=>{if(ce)return ce;let i=u(),l=(i.relationships.get(i.mainDocumentPart)??[]).find(m=>m.type===fo),f;if(l){let m=chunkGHNTGVKG_cjs.E(l);m.mode==="Internal"&&m.target.ok&&(f=i.parts.get(m.target.partName));}return f??=i.parts.get("/word/fontTable.xml"),ce=Object.freeze(chunkGHNTGVKG_cjs.Rd(i,f)),ce},oe=null,X=null,re=null,ae=null,ue=null,ve=null,Te=null,it=()=>{let i=[h().part.root],l=new Set;for(let f of _())l.has(f)||(l.add(f),i.push(f.root));return i},Ne=()=>{let i=it(),l=E();return l&&i.splice(1,0,l),i},V=null,pe=null,se=null,ie=null,Q=null,lt=new WeakMap,fe=null,dt=i=>{let l=lt.get(i);if(l)return l;let f=chunkGHNTGVKG_cjs.Kb(i);return lt.set(i,f),f},ct=()=>{let i=r.packageRevision,l=r.openStoryToken();if(!Q||Q.revision!==i||Q.openStories!==l){let f=r.openStoryParts(),m=new Set(f.map(M=>M.name)),x=_().filter(M=>!m.has(M.name)).map(dt),P=[h().part,...f,...x],N=Q,C=N!==null&&g!==null&&N.openStories===l&&N.revision===g.fromRevision&&i===g.toRevision&&g.impact==="text-local"&&g.created.length===0&&g.deleted.length===0&&g.splitJoin.length===0&&N.parts.length===P.length&&N.parts.every((M,Z)=>M.name===P[Z]?.name);Q={revision:i,openStories:l,parts:P,index:C&&N?to(N.index,P):no(P)};}return Q.index},ut=()=>{let i=h().part.name,l=new Map;for(let f of [h().part,..._()])for(let[m,x]of chunk67U2OZS7_cjs.Z(u(),f.name,i))l.set(m,x);return l},go=()=>[h().part,..._()],_=()=>{let i=[],l=new Set;for(let m of b().parts)for(let x of [m.headers,m.footers])for(let P of x.values())l.has(P)||(l.add(P),i.push(P));let f=u();for(let m of ["footnote","endnote"]){let x=chunkGHNTGVKG_cjs.If(f,m);!x||l.has(x)||(l.add(x),i.push(x));}return i};return {ok:true,session:{editable:F(h().part).length>0,paragraphIds:()=>F(h().part).map(i=>i.id),paragraphIdsIn(i=y){let l=r.partFor(i);return l?F(l).map(f=>f.id):[]},part:()=>h().part,partFor:i=>r.partFor(i),currentPackage:u,collaborationPort:i=>chunkBPSGGVP5_cjs.b(r,{documentId:i}),applyTreeOps(i,l,f,m=y,x={}){return so(r,i,l,f,m,x)},applyTreeOpsAtomic(i,l={}){return ao(r,i,l)},projectDoc:()=>J(h().part),reconcile:i=>Ye(i,h().part,g),lastCommitWasStructural:()=>g!==null&&(g.created.length>0||g.deleted.length>0||g.splitJoin.length>0||g.impact==="global"),applyPmDoc(i){let l=h(),f=Je(l.part,i);if(!f.ok)return {committed:false,rejected:true,opCount:0,reason:f.reason};if(f.ops.length===0)return {committed:false,rejected:false,opCount:0};let m=r.transact(y,x=>{for(let P of f.ops)x.apply(P);});return m.ok?{committed:true,rejected:false,opCount:f.ops.length}:{committed:false,rejected:true,opCount:f.ops.length,reason:m.reason}},storyParts:go,bodyText:()=>Mn(h().part),storyText(i){let l=r.partFor(i);return l?F(l).map(f=>chunkGHNTGVKG_cjs.Nh(l,f.id)??"").join(`
|
|
5
|
+
`):null},revision:()=>h().revision,revisionFor:i=>r.revisionFor(i),packageRevision:()=>r.packageRevision,canUndo:()=>r.canUndo,canRedo:()=>r.canRedo,undo:()=>{let i=r.selectionForUndo();return r.undo()===null?null:i},redo:()=>{let i=r.selectionForRedo();return r.redo()===null?null:i},beginComposition:(i=y)=>{r.beginComposition(i);},endComposition:()=>r.endComposition(),subscribe(i){return r.subscribe(i)},save(){return chunkGHNTGVKG_cjs.dc(u())},headerFooterParts:()=>{let i=b().parts;return i[i.length-1]??chunkGHNTGVKG_cjs.Pd(u())},headerFooterPartsBySection:()=>b().parts,headerFooterResolutionBySection:()=>b().resolution,documentFonts(){return oe&&oe.revision===r.packageRevision||(oe={revision:r.packageRevision,fonts:_n(Ne(),te(K()))}),oe.fonts},symbolFontFamilies(){return re&&re.revision===r.packageRevision||(re={revision:r.packageRevision,fonts:zn(Ne())}),re.fonts},renderedFontFamilies(){let i=E();return X&&X.revision===r.packageRevision&&X.styles===i||(X={revision:r.packageRevision,styles:i,families:chunkYRTRPSSA_cjs.e(it(),i,te(K()))}),X.families},rendersText(){return ae&&ae.revision===r.packageRevision||(ae={revision:r.packageRevision,rendersText:Jn(Ne())}),ae.rendersText},documentStyles(){let i=E(),l=K();V??=chunkYRTRPSSA_cjs.c(i,te(l));let f=V;return ue??=Un(i,m=>f(m)),ue},stylesRoot:()=>E(),documentThemeFonts(){let i=K();return Te??=te(i),Te},numberingRoot:()=>ne(),settingsRoot:()=>ot(),documentProperties:()=>uo(),trackingSettings:()=>chunkGHNTGVKG_cjs.rg(ot()),documentThemeColors(){let i=K();return ve??=qn(i),ve},effectiveRunDefaults(i,l){let f=E(),m=K();V??=chunkYRTRPSSA_cjs.c(f,te(m));let x=h();if(!pe||pe.revision!==x.revision){let P=new Map;for(let N of F(x.part))N.kind!=="textValue"&&P.set(N.id,Ze(N)??null);pe={revision:x.revision,byId:P};}return V(pe.byId.get(i)??null,l)},documentOutline(){let i=h();return se&&se.revision===i.revision||(se={revision:i.revision,outline:Kn(i.part,E())}),se.outline},findText(i,l){let f=h(),m=r.packageRevision,x=`${l?.matchCase===true?"c":""}${l?.wholeWord===true?"w":""}${l?.limit??""}:${l?.stories??"all"}\0${i}`;if(ie&&ie.revision===m&&ie.key===x)return ie.result;let P=u(),N={footnote:new Set,endnote:new Set};for(let M of chunkGHNTGVKG_cjs.Jf(f.part))N[M.noteKind].add(M.noteId);let C=Zn(f.part,i,l??{},{headerFooterBySection:b().resolution,footnotes:chunkGHNTGVKG_cjs.If(P,"footnote")??null,endnotes:chunkGHNTGVKG_cjs.If(P,"endnote")??null,referencedNoteIds:N});return ie={revision:m,key:x,result:C},C},embeddedFonts:mo,paragraphAnchors:ct,paraIdOf:i=>oo(i,{body:h().part,openStories:r.openStoryParts(),otherStories:_(),normalize:dt}),nodeIdOf:i=>ct().nodeByParaId.get(i.toUpperCase())??null,relationshipTarget:(i,l=y)=>{let f=u(),m=r.partFor(l);return m?chunkGHNTGVKG_cjs.of(f,m.name,i):null},bookmarks:()=>{let i=r.packageRevision;if(!fe||fe.revision!==i){let l=new Map(chunkGHNTGVKG_cjs.Se(h().part));for(let f of _())for(let[m,x]of chunkGHNTGVKG_cjs.Se(f))l.has(m)||l.set(m,x);fe={revision:i,index:l};}return fe.index},ensureHyperlinkRelationship(i,l=y){let f=r.partFor(l);return f?chunkGHNTGVKG_cjs.Ba(r,()=>{let m=u(),x=chunkGHNTGVKG_cjs.nf(m,i,f.name);return x?(x.pkg!==m&&r.replacePackageShell(x.pkg),x.relationshipId):null},m=>m!==null):null},reviewItems(){let i=e.reviewModel;if(!i)return sr;let l=h(),f=`${r.packageRevision}:${l.revision}`;if(c&&c.revisionKey===f)return c.items;let m=u(),x=m.parts.get(chunk67U2OZS7_cjs.P(m,l.part.name)),P=m.parts.get(chunk67U2OZS7_cjs.Q(m,l.part.name)),N=_(),C=c&&g?An(g,c,c.items,l.part,x,P,r.packageRevision):null,M,Z;if(C&&c){let pt=i.revisionItemsOfParagraph(l.part,C);Cn(c.items,pt,C)?(M=Dn(c.items,c.paragraphOrder,C,pt),Z=c.paragraphOrder):(Z=chunk67U2OZS7_cjs.wa(l.part),M=i.collectReviewItems({storyPart:l.part,furnitureParts:N,commentsPart:x,commentsExtendedPart:P,customNodePayloads:ut()}));}else Z=chunk67U2OZS7_cjs.wa(l.part),M=i.collectReviewItems({storyPart:l.part,furnitureParts:N,commentsPart:x,commentsExtendedPart:P,customNodePayloads:ut()});return c={revisionKey:f,bodyRevision:l.revision,packageRevision:r.packageRevision,items:M,paragraphOrder:Z,commentsPart:x,commentsExtendedPart:P},c.items},hasReviewContent(){let i=r.packageRevision;if(!p||p.revision!==i){let l=[h().part,..._()];p={revision:i,present:l.some(f=>chunkGHNTGVKG_cjs.jh(f).length>0||Ue(f.root))};}return p.present},replyToComment(i,l,f,m,x,P=y,N){let C=chunk67U2OZS7_cjs.R(r,{anchor:{paragraphId:l.paragraphId,start:l.start,end:l.end,...l.endParagraphId===void 0?{}:{endParagraphId:l.endParagraphId}},author:m,text:f,...x===void 0?{}:{date:x},...i===null?{}:{replyToCommentId:i},...N===void 0?{}:{actorId:N}},P);return C.ok?C.commentId:null},setCommentResolved(i,l){return chunk67U2OZS7_cjs.S(r,i,l).ok},deleteComment(i,l=y,f){return this.deleteComments([{commentId:i}],l,f)},deleteComments(i,l=y,f){return chunk67U2OZS7_cjs.T(r,i,l,f)},insertCustomNode(i,l=y){return chunk67U2OZS7_cjs.$(r,i,l)},removeCustomNode(i,l=y){return chunk67U2OZS7_cjs.aa(r,i,l)},sweepCustomNodePayloads(i){return chunkGHNTGVKG_cjs.Ba(r,()=>{let l=h(),f=chunk67U2OZS7_cjs.Y(r.currentPackage(),l.part.name,i);return f.ok?f.removed.length===0?{ok:true,removed:[]}:(r.replacePackageShell(f.pkg),{ok:true,removed:f.removed}):{ok:false,reason:f.reason}},l=>l.ok&&l.removed.length>0)},ensureListDefinition(i){return chunkGHNTGVKG_cjs.Ba(r,()=>{let l=chunkGHNTGVKG_cjs.kf(u(),i);return l?(r.replacePackageShell(l.pkg),G=null,B=null,l.numId):null},l=>l!==null)},ensureNumberingLevel(i,l,f){return chunkGHNTGVKG_cjs.Ba(r,()=>{let m=u(),x=chunkGHNTGVKG_cjs.lf(m,i,l,f);return x?x!==m?(r.replacePackageShell(x),G=null,B=null,{ok:true,changed:true}):{ok:true,changed:false}:{ok:false,changed:false}},m=>m.changed).ok},insertImage(i,l){return r.insertImage(i,l)},replaceImage(i,l,f,m,x,P){return r.replaceImage(i,l,f,m,x,P)},deleteImage(i,l){return r.deleteImage(i,l)},deleteImageTracked(i,l,f){return r.deleteImageTracked(i,l,f)},applyImageProperties(i,l){return r.applyImageProperties(i,l)},applyFragmentPaste(i,l){return r.applyFragmentPaste(i,l)}}}}var lr=chunkGHNTGVKG_cjs.b.projection;function kr(t,e,n){let o=t.filter(a=>a.localName!==e);return o.length!==t.length?o:[...o,n?{localName:e,attributes:n}:{localName:e}]}function Or(t,e,n={}){let o=null,a=false,s=()=>n.onChange?.(r()),r=()=>({revision:e.revision(),canUndo:e.canUndo(),canRedo:e.canRedo(),lastRejection:o}),d=u=>{a=true;let y=p.state.tr.replaceWith(0,p.state.doc.content.size,u.content);y.setMeta("addToHistory",false),p.dispatch(y),a=false;},c=u=>()=>(u()&&(d(e.projectDoc()),s()),true),p=new prosemirrorView.EditorView(t,{state:prosemirrorState.EditorState.create({doc:e.projectDoc(),plugins:[prosemirrorKeymap.keymap({...prosemirrorCommands.baseKeymap,Home:prosemirrorCommands.selectTextblockStart,End:prosemirrorCommands.selectTextblockEnd,"Mod-z":c(()=>e.undo()!==null),"Mod-y":c(()=>e.redo()!==null),"Shift-Mod-z":c(()=>e.redo()!==null),"Mod-b":(u,y)=>h(u,y,"b"),"Mod-i":(u,y)=>h(u,y,"i"),"Mod-u":(u,y)=>h(u,y,"u",{val:"single"})})]}),editable:()=>e.editable,handleDOMEvents:{keydown:u=>(g(u),false),beforeinput:(u,y)=>{let O=y;if(u.composing)return false;g(u);let R=O.inputType;if(R==="insertText"&&O.data!=null){O.preventDefault();let{from:b,to:S}=u.state.selection;return u.dispatch(u.state.tr.insertText(O.data,b,S)),true}if(R==="deleteContentBackward"){O.preventDefault();let{from:b,empty:S}=u.state.selection;return S?b>0?u.dispatch(u.state.tr.delete(b-1,b)):prosemirrorCommands.joinBackward(u.state,u.dispatch):prosemirrorCommands.deleteSelection(u.state,u.dispatch),true}if(R==="deleteContentForward"){O.preventDefault();let{from:b,to:S,empty:T}=u.state.selection;return T?S<u.state.doc.content.size?u.dispatch(u.state.tr.delete(b,b+1)):prosemirrorCommands.joinForward(u.state,u.dispatch):prosemirrorCommands.deleteSelection(u.state,u.dispatch),true}return R==="insertParagraph"?(O.preventDefault(),prosemirrorCommands.splitBlock(u.state,u.dispatch),true):false},compositionstart:()=>(e.beginComposition(),false),compositionend:()=>(e.endComposition(),s(),false)},dispatchTransaction(u){let y=p.state.apply(u);if(a||!u.docChanged){p.updateState(y);return}let O=e.applyPmDoc(y.doc);if(O.rejected){o=String(O.reason??"rejected"),p.updateState(y),d(e.projectDoc()),s();return}o=null,p.updateState(O.committed&&e.lastCommitWasStructural()?k(y):y),s();}});function g(u){if(u.composing||a)return;let y=u.dom.ownerDocument.getSelection(),O=y?.anchorNode,R=y?.focusNode;if(!(!y||!O||!R)&&!(!u.dom.contains(O)||!u.dom.contains(R)))try{let b=u.posAtDOM(O,y.anchorOffset),S=u.posAtDOM(R,y.focusOffset),T=u.state.selection;if(T.anchor===b&&T.head===S)return;let v=prosemirrorState.TextSelection.create(u.state.doc,b,S);u.dispatch(u.state.tr.setSelection(v).setMeta("addToHistory",!1));}catch{}}function k(u){let y=e.paragraphIds(),O=u.tr,R=false,b=0;return u.doc.forEach((S,T)=>{let v=y[b];b+=1,!(S.type.name!=="paragraph"||v===void 0)&&S.attrs.nodeId!==v&&(O=O.setNodeMarkup(T,void 0,{...S.attrs,nodeId:v}),R=true);}),R?u.apply(O.setMeta("addToHistory",false)):u}function h(u,y,O,R){let b=I.marks.runProps;if(!y)return true;let{from:S,to:T,empty:v}=u.selection;if(v)return true;let G=u.doc.resolve(S).marks().find(Se=>Se.type===b)?.attrs.props??[],B=kr(G,O,R),ne=u.tr;return ne.removeMark(S,T,b),B.length>0&&ne.addMark(S,T,b.create({props:B})),y(ne),true}return {view:p,state:r,undo:()=>c(()=>e.undo()!==null)(),redo:()=>c(()=>e.redo()!==null)(),toggleRunProperty(u,y){h(p.state,p.dispatch.bind(p),u,y);},destroy:()=>p.destroy()}}exports.a=I;exports.b=ze;exports.c=ee;exports.d=F;exports.e=J;exports.f=Je;exports.g=Co;exports.h=Ye;exports.i=Ze;exports.j=ir;exports.k=lr;exports.l=Or;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {fg,Ga,La,ec,dc,za,ya,Nh,da,Aa,Kb,Eb,Db,ea}from'./chunk-QVJO5FUR.js';var W=new Set(["document","hdr","ftr","footnotes","endnotes"]),$=24,U=512,E=fg($);function z(o){let a=o.root;return a.namespaceUri===da&&W.has(a.localName)}function Y(o){let a=[],r=e=>{if(e.kind!=="textValue"){e.namespaceUri===da&&e.localName==="p"&&a.push(e);for(let i of e.children)r(i);}};return r(o.root),a}function V(o){let a=Kb(o);let r=[],e=new Set;for(let i of Y(a)){let n=Eb(i);if(!n||!Db(n))continue;let t=n.toUpperCase();if(e.has(t))continue;e.add(t);let s=Nh(a,i.id);s!==null&&r.push(Object.freeze({paragraphId:t,nodeId:i.id,text:s}));}return Object.freeze(r)}function G(o){let a=E.get(o.root);if(a)return a;let r=Kb(o);let e=new Map,i=new Set,n=t=>{if(t.kind!=="textValue"){if(t.namespaceUri===da&&t.localName==="p"){let s=Eb(t);if(s&&Db(s)){let p=s.toUpperCase();i.has(p)||(i.add(p),t.kind==="paragraph"&&e.set(p,t.id));}}for(let s of t.children)n(s);}};return n(r.root),E.set(o.root,e),e}function w(o,a){if(o.length!==a.length)return false;for(let r=0;r<o.length;r+=1)if(o[r].root!==a[r])return false;return true}function B(o){let a=new Map,r=null,e=(n,t,s)=>{for(a.delete(n),a.set(n,{partName:t.name,root:t.root,nodeId:s});a.size>U;){let p=a.keys().next();if(p.done)break;a.delete(p.value);}},i=(n,t)=>{let s=a.get(n);if(!s)return null;let p=t.find(c=>c.name===s.partName);if(!p)return null;if(p.root===s.root)return {part:p,nodeId:s.nodeId};let l=Ga(p,s.nodeId);if(!l||l.kind!=="paragraph")return null;let d=Eb(l);return !d||d.toUpperCase()!==n?null:(e(n,p,s.nodeId),{part:p,nodeId:s.nodeId})};return n=>{let t=o(),s=i(n,t);if(s)return s;if(r&&r.ids.has(n)&&w(t,r.roots))return null;for(let p of t){let l=G(p).get(n);if(l!==void 0)return e(n,p,l),{part:p,nodeId:l}}return (!r||!w(t,r.roots))&&(r={roots:t.map(p=>p.root),ids:new Set}),r.ids.size<U&&r.ids.add(n),null}}function H(o,a){return Aa(o,a)}var Z=Object.freeze({kind:"body"}),q=1e6;function b(o,a){if(a<=0||a>=o.length)return false;let r=o.charCodeAt(a-1),e=o.charCodeAt(a);return r>=55296&&r<=56319&&e>=56320&&e<=57343}function F(o,a,r){if(a===r)return [];let e=0,i=Math.min(a.length,r.length);for(;e<i&&a.charCodeAt(e)===r.charCodeAt(e);)e+=1;for(;e>0&&(b(a,e)||b(r,e));)e-=1;let n=0;for(;n<a.length-e&&n<r.length-e&&a.charCodeAt(a.length-n-1)===r.charCodeAt(r.length-n-1);)n+=1;for(;n>0&&(b(a,a.length-n)||b(r,r.length-n));)n-=1;let t=a.length-e-n,s=r.slice(e,r.length-n),p=[];return t>0&&p.push({op:"deleteText",paragraphId:o,start:e,end:e+t}),s.length>0&&p.push({op:"insertText",paragraphId:o,offset:e,text:s}),Object.freeze(p)}function Q(o){let a=e=>!!e&&e.kind!=="textValue"&&e.namespaceUri===da&&e.localName==="t"&&e.attributes.every(i=>i.namespaceUri===ea&&i.localName==="space")&&e.children.every(i=>i.kind==="textValue"),r=[];for(let e of o){let i=r.at(-1);if(!a(i)||!a(e)){r.push(e);continue}let n=i.children.map(t=>t.kind==="textValue"?t.value:"").join("")+e.children.map(t=>t.kind==="textValue"?t.value:"").join("");r[r.length-1]={...i,attributes:/^\s|\s$/.test(n)?[{kind:"xmlSpace",namespaceUri:ea,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:i.children[0]?.id??`${i.id}/text`,kind:"textValue",value:n}]};}return r}function L(o){if(o.kind==="textValue")return o;let a=false,r=o.children.map(e=>{let i=L(e);return i!==e&&(a=true),i});if(o.namespaceUri===da&&o.localName==="r"){let e=Q(r);(e.length!==r.length||e.some((i,n)=>i!==r[n]))&&(r=[...e],a=true);}return a?{...o,children:r}:o}function K(o,a,r){let e=o.parts.get(a);if(!e)return o;let i=false,n=new Set;for(let t of r)(t.op==="insertText"||t.op==="deleteText")&&!t.revision&&n.add(t.paragraphId);for(let t of n){let s=Ga(e,t);if(!s||s.kind==="textValue")continue;let p=L(s);if(p===s)continue;let l=La(e,t,p,{deferValidation:true});l.ok&&(e=l.part,i=true);}return i?ec(o,e):o}function ee(o,a){let r=a.documentId.trim();if(r.length===0||r.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let e=()=>V(o.bodyStore().part),i,t=B(()=>{let l=o.bodyStore().part,d=o.currentPackage();if(i?.pkg===d&&i.body===l)return i.parts;let c=[l];for(let g of d.parts.values())g===l||!z(g)||c.push(g);return i={pkg:d,body:l,parts:Object.freeze(c)},i.parts}),s=(l,d)=>{if(l.length===0)return {ok:true,changed:false};let c=e(),g=new Set,h=[];for(let u of l){if(typeof u.text!="string"||u.text.length>q)return {ok:false,reason:"collaboration-text-limit"};if(typeof u.paragraphId!="string"||u.paragraphId.length===0||u.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let m=u.paragraphId.toUpperCase();if(g.has(m))return {ok:false,reason:"duplicate-paragraph-id"};g.add(m);let N=c.filter(X=>X.paragraphId===m);if(N.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let T=N[0];h.push(...F(T.nodeId,T.text,u.text));}if(h.length===0)return {ok:true,changed:false};let y=o.transact(Z,u=>{for(let m of h)u.apply(m);u.applyPackage(m=>K(m,m.mainDocumentPart,h));},{origin:d.origin,actorId:d.actorId,operationId:d.operationId,recordsHistory:false});return y.ok?{ok:true,changed:y.change!==null}:{ok:false,reason:y.detail??y.reason}};return Object.freeze({documentId:r,paragraphs:e,paragraphByNodeId(l){return e().find(d=>d.nodeId===l)??null},paragraphByStableId(l){let d=l.toUpperCase(),c=t(d);if(!c)return null;let g=Nh(c.part,c.nodeId);return g===null?null:Object.freeze({paragraphId:d,nodeId:c.nodeId,text:g})},applyParagraphText(l,d,c){return s([{paragraphId:l,text:d}],c)},applyParagraphTexts:s,applyRemotePackage(l,d){let c=o.publishRemotePackage(l,d);return c.ok?{ok:true,changed:c.change!==null}:{ok:false,reason:c.detail??c.reason}},revision:()=>o.packageRevision,subscribe:l=>o.subscribe(l),observePrimitiveJournal:l=>H(o,l),hasPendingJournals:()=>ya(o),flushPendingJournals:()=>{za(o);},save:()=>dc(o.currentPackage()),binaryPart(l){let d=o.currentPackage();return d.partBytes.get(l)??d.partBytes.get(l.startsWith("/")?l.slice(1):`/${l}`)??null}})}export{K as a,ee as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict';var chunkWGHVIB6B_cjs=require('./chunk-WGHVIB6B.cjs'),chunkGHNTGVKG_cjs=require('./chunk-GHNTGVKG.cjs');var j=/^[\p{L}\p{N}\p{M} \-.+_]{1,64}$/u,$=128,K=/[\u0000-\u001F\u007F-\u009F]/,q=16,J=2,Q=3276;function B(e){return e.kind!=="textValue"}function A(e,n){for(let t of e.children)if(B(t)&&t.localName===n)return t}function p(e,n){return e.attributes.find(t=>t.localName===n)?.value}function D(e){return e===void 0||e.length===0||e.length>$||K.test(e)?null:e}function v(e,n){let t=chunkWGHVIB6B_cjs.b(p(e,"asciiTheme"),n)??chunkWGHVIB6B_cjs.b(p(e,"hAnsiTheme"),n);if(t!==null)return t;let l=p(e,"ascii")??p(e,"hAnsi");return l===void 0?null:j.test(l)?l:null}function C(e,n){let t=chunkWGHVIB6B_cjs.b(p(e,"eastAsiaTheme"),n);if(t!==null)return t;let l=p(e,"eastAsia");return l===void 0?null:j.test(l)?l:null}function G(e){return e!==void 0&&j.test(e)?e:null}function xe(e){return G(e)}function U(e,n){if(!e)return {fontFamily:null,fontSizeHalfPoints:null};let t=A(e,"rFonts"),l=A(e,"sz"),a=l?p(l,"val"):void 0,r=a!==void 0&&/^\d{1,4}$/.test(a)?Number(a):null;return {fontFamily:t?v(t,n):null,fontSizeHalfPoints:r!==null&&r>=J&&r<=Q?r:null}}function he(e,n){let t=new Map,l={fontFamily:null,fontSizeHalfPoints:null};if(e){let o=A(e,"docDefaults"),u=o?A(o,"rPrDefault"):void 0;l=U(u?A(u,"rPr"):void 0,n);for(let d of e.children){if(!B(d)||d.localName!=="style")continue;let i=D(p(d,"styleId"));if(i===null||t.has(i))continue;let f=A(d,"basedOn");t.set(i,{basedOn:D(f?p(f,"val"):void 0),own:U(A(d,"rPr"),n)});}}let a=new Map,r=o=>{let u=o??"",d=a.get(u);if(d)return d;let i=null,f=null,m=new Set,h=o;for(let s=0;h!==null&&s<q&&!m.has(h);s+=1){m.add(h);let c=t.get(h);if(!c)break;i??=c.own.fontFamily,f??=c.own.fontSizeHalfPoints,h=c.basedOn;}let S={fontFamily:i??l.fontFamily,fontSizeHalfPoints:f??l.fontSizeHalfPoints};return a.set(u,S),S};return (o,u)=>{let d=r(o),i=u?.find(m=>m.localName==="rFonts"),f=i?chunkWGHVIB6B_cjs.b(i.attributes?.asciiTheme,n)??chunkWGHVIB6B_cjs.b(i.attributes?.hAnsiTheme,n):null;return f===null?d:{...d,fontFamily:f}}}var ee=16,ne=16,te=32,le=4096;function x(e){return e.kind!=="textValue"}function g(e,n){for(let t of e.children)if(x(t)&&t.localName===n)return t}function M(e,n){return e.attributes.find(t=>t.localName===n)?.value}function ae(e){return e==="1"||e==="true"||e==="on"}function _(){return {families:new Map,styleIds:new Set,anyText:false,bareParagraph:false,bareRun:false,bareTable:false}}function H(e,n){for(let[t,l]of n.families)e.families.has(t)||e.families.set(t,l);for(let t of n.styleIds)e.styleIds.add(t);e.anyText||=n.anyText,e.bareParagraph||=n.bareParagraph,e.bareRun||=n.bareRun,e.bareTable||=n.bareTable;}function O(e,n){if(n===null)return;let t=n.toLowerCase();e.has(t)||e.set(t,n);}var oe=new Set(["tab","noBreakHyphen","softHyphen","footnoteRef","endnoteRef","footnoteReference","endnoteReference"]),re=128;function ie(e){for(let n of e.attributes)if(n.localName==="font"&&!(n.namespaceUri!==chunkGHNTGVKG_cjs.da&&n.namespaceUri!==""))return n.value.length>0&&n.value.length<=re;return false}function V(e,n){if(n?.has(e.id))return true;for(let t of e.children)if(!(!x(t)||t.namespaceUri!==chunkGHNTGVKG_cjs.da)){if(oe.has(t.localName))return true;if(t.localName==="sym"){if(!ie(t))return true;continue}if(!(t.localName!=="t"&&t.localName!=="delText")){for(let l of t.children)if(!x(l)&&l.value.length>0)return true}}return false}function se(e){for(let n of e.children)if(!(!x(n)||n.namespaceUri!==chunkGHNTGVKG_cjs.da)&&!(n.localName!=="t"&&n.localName!=="delText")){for(let t of n.children)if(!x(t))for(let l of t.value){let a=l.codePointAt(0);if(a>=4352&&a<=4607||a>=11904&&a<=40959||a>=43360&&a<=43391||a>=44032&&a<=55295||a>=63744&&a<=64255||a>=65072&&a<=65103||a>=65280&&a<=65519||a>=131072&&a<=262143)return true}}return false}function W(e,n){let t=[e];for(;t.length>0;){let l=t.pop();if(x(l)){if(n?.has(l.id))return true;if(l.localName==="r"&&l.namespaceUri===chunkGHNTGVKG_cjs.da){if(V(l,n))return true;continue}for(let a of l.children)t.push(a);}}return false}function ue(e,n,t,l){if(!V(e,l))return;n.anyText=true;let a=g(e,"rPr"),r=a?g(a,"rFonts"):void 0;r&&(O(n.families,v(r,t)),se(e)&&O(n.families,C(r,t)));let o=a?g(a,"rStyle"):void 0,u=D(o?M(o,"val"):void 0);u!==null?n.styleIds.add(u):n.bareRun=true;}function fe(e,n,t){if(!t)return;n.anyText=true;let l=e.localName==="tbl",a=g(e,l?"tblPr":"pPr"),r=a?g(a,l?"tblStyle":"pStyle"):void 0,o=D(r?M(r,"val"):void 0);o!==null?n.styleIds.add(o):l?n.bareTable=true:n.bareParagraph=true;}function L(e){return (e.localName==="p"||e.localName==="tbl")&&e.namespaceUri===chunkGHNTGVKG_cjs.da}function z(e,n,t,l,a){e.namespaceUri===chunkGHNTGVKG_cjs.da&&(a?.has(e.id)&&e.localName==="fldSimple"&&(n.anyText=true,n.bareRun=true),e.localName==="r"?ue(e,n,t,a):L(e)&&fe(e,n,l));}var X=new WeakMap;function Z(e,n,t){let l=X.get(e);if(l&&l.major===n.major&&l.minor===n.minor&&l.majorEastAsia===n.majorEastAsia&&l.minorEastAsia===n.minorEastAsia)return l.summary;let a=_();if(e.children.length>=ne&&t<te){for(let r of e.children)x(r)&&H(a,Z(r,n,t+1));z(e,a,n,a.anyText);}else {let r=[e];for(;r.length>0;){let o=r.pop();if(!x(o))continue;let u=L(o)&&W(o);z(o,a,n,u);for(let d=o.children.length-1;d>=0;d-=1)r.push(o.children[d]);}}return X.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,summary:a}),a}var de={docDefaultFamilies:[],defaultParagraph:null,defaultCharacter:null,defaultTable:null,chainFamilies:()=>[]},Y=new WeakMap;function k(e,n){let t=g(e,"rPr"),l=t?g(t,"rFonts"):void 0;return l?v(l,n):null}function w(e,n){let t=g(e,"rPr"),l=t?g(t,"rFonts"):void 0;return l?C(l,n):null}function ce(e,n){let t=new Map,l=null,a=null,r=null,o=null,u=null,d=g(e,"docDefaults"),i=d?g(d,"rPrDefault"):void 0;i&&(l=k(i,n),a=w(i,n));let f=0;for(let s of e.children){if(!x(s)||s.localName!=="style")continue;if(f>=le)break;f+=1;let c=D(M(s,"styleId"));if(c===null)continue;let y=g(s,"basedOn"),F=[];for(let b of s.children){if(!x(b)||b.localName!=="tblStylePr")continue;let I=k(b,n);I!==null&&F.push(I);let E=w(b,n);E!==null&&F.push(E);}t.set(c,{basedOn:D(y?M(y,"val"):void 0),family:k(s,n),eastAsiaFamily:w(s,n),conditionalFamilies:F});let T=ae(M(s,"default")),P=M(s,"type");P==="paragraph"?T?r=c:r===c&&(r=null):P==="character"?T?o=c:o===c&&(o=null):P==="table"&&(T?u=c:u===c&&(u=null));}let m=new Map,h=s=>{if(s===null)return [];let c=m.get(s);if(c)return c;let y=[],F=null,T=null,P=new Set,b=s;for(let I=0;b!==null&&I<ee&&!P.has(b);I+=1){P.add(b);let E=t.get(b);if(!E)break;F??=E.family,T??=E.eastAsiaFamily,y.push(...E.conditionalFamilies),b=E.basedOn;}return F!==null&&y.unshift(F),T!==null&&y.unshift(T),m.set(s,y),y};return {docDefaultFamilies:[l,a].filter(s=>s!==null),defaultParagraph:r,defaultCharacter:o,defaultTable:u,chainFamilies:h}}function me(e,n){if(!e)return de;let t=Y.get(e);if(t&&t.major===n.major&&t.minor===n.minor&&t.majorEastAsia===n.majorEastAsia&&t.minorEastAsia===n.minorEastAsia)return t.index;let l=ce(e,n);return Y.set(e,{major:n.major,minor:n.minor,majorEastAsia:n.majorEastAsia,minorEastAsia:n.minorEastAsia,index:l}),l}function ye(e,n,t,l){let a=_(),r=new Map;for(let i of e){let f=_();for(let m of i.children){if(!x(m))continue;if(!l||l.size===0){H(f,Z(m,t,0));continue}let h=_(),S=[m];for(;S.length>0;){let s=S.pop();if(!x(s))continue;let c=L(s)&&W(s,l);z(s,h,t,c,l);for(let y=s.children.length-1;y>=0;y-=1)S.push(s.children[y]);}H(f,h);}H(a,f);for(let m of f.families.values())O(r,m);}let o=me(n,t),u=new Map;for(let i of a.styleIds)for(let f of o.chainFamilies(i))O(u,f);if(a.bareParagraph)for(let i of o.chainFamilies(o.defaultParagraph))O(u,i);if(a.bareRun)for(let i of o.chainFamilies(o.defaultCharacter))O(u,i);if(a.bareTable)for(let i of o.chainFamilies(o.defaultTable))O(u,i);if(a.anyText)for(let i of o.docDefaultFamilies)O(u,i);for(let i of r.keys())u.delete(i);let d=[...u.values()].sort((i,f)=>i<f?-1:i>f?1:0);return Object.freeze({direct:Object.freeze([...r.values()]),inherited:Object.freeze(d)})}function Oe(e,n,t){let l=ye(e,n,t),a=[...l.direct,...l.inherited];return a.sort((r,o)=>r<o?-1:r>o?1:0),a}exports.a=G;exports.b=xe;exports.c=he;exports.d=ye;exports.e=Oe;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';var
|
|
1
|
+
'use strict';var chunkBPSGGVP5_cjs=require('../chunk-BPSGGVP5.cjs');require('../chunk-GHNTGVKG.cjs');Object.defineProperty(exports,"createCollaborationDocumentPort",{enumerable:true,get:function(){return chunkBPSGGVP5_cjs.b}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as TreeModelChange } from '../tree-store-
|
|
2
|
-
import { c as OoxmlElement, b as OoxmlPackage } from '../tree-op-types-
|
|
3
|
-
import { T as TreePackageStore } from '../tree-package-fragment-
|
|
1
|
+
import { T as TreeModelChange } from '../tree-store-DU192chS.js';
|
|
2
|
+
import { c as OoxmlElement, b as OoxmlPackage } from '../tree-op-types-C5rZzoAz.js';
|
|
3
|
+
import { T as TreePackageStore } from '../tree-package-fragment-DDQHk8sv.js';
|
|
4
4
|
import '../contracts/types.js';
|
|
5
|
-
import '../hf-references-
|
|
5
|
+
import '../hf-references-BZVHctVD.js';
|
|
6
6
|
|
|
7
7
|
/** Attribute name as the journal addresses it. Prefix is authored fidelity, not identity. @public */
|
|
8
8
|
interface CanonicalAttributeName {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as createCollaborationDocumentPort}from'../chunk-
|
|
1
|
+
export{b as createCollaborationDocumentPort}from'../chunk-YKDRBDI2.js';import'../chunk-QVJO5FUR.js';
|
package/dist/collaboration.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { S as StoryScope } from './tree-package-fragment-
|
|
2
|
-
import { T as TreeDocOp } from './tree-op-types-
|
|
1
|
+
import { S as StoryScope } from './tree-package-fragment-DDQHk8sv.js';
|
|
2
|
+
import { T as TreeDocOp } from './tree-op-types-C5rZzoAz.js';
|
|
3
3
|
import { CollaborationDocumentPort } from './collaboration/replication.js';
|
|
4
4
|
import { C as CollaborationStatus, a as CollaborationStatusSnapshot, b as CollaborationFailureCode } from './failure-BnGjoXf0.js';
|
|
5
5
|
export { c as CollaborationFailure, d as createCollaborationStatusTracker, i as isCollaborationFailureCode } from './failure-BnGjoXf0.js';
|
|
6
|
-
import './hf-references-
|
|
7
|
-
import './tree-store-
|
|
6
|
+
import './hf-references-BZVHctVD.js';
|
|
7
|
+
import './tree-store-DU192chS.js';
|
|
8
8
|
import './contracts/types.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { ContentControlSummary, DocEdits, DocQueries, DocQueryResults, ParagraphSummary } from './document.js';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
2
|
+
export { E as EditorScope, V as ViewScope } from '../editor-scope-DZJT4ukT.js';
|
|
3
|
+
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, a as ReviewItem, e as ReviewPosition, f as ReviewRange, b as ReviewRevisionItem, g as ReviewRevisionKind } from '../review-items-kC-YI70C.js';
|
|
4
|
+
export { InteractionAffinity, InteractionOutcome, InteractionOutcomeCode, SemanticIdentity, SemanticTarget } from './interaction.js';
|
|
5
|
+
export { S as SemanticPosition, a as SemanticSelection } from '../semantic-interaction-NGeYzYCN.js';
|
|
6
|
+
export { z as DrawingHorizontalReferenceFrame, D as DrawingKind, w as DrawingLocks, v as DrawingPositionInput, A as DrawingVerticalReferenceFrame, x as ImageResourceState, u as ImageWrapTarget, P as PreservedImageMime, t as RenderableImageMime, R as RevisionAddress, y as SupportedImageMime, V as ValidatedImageBytesHandle, B as VectorImageMime } from '../tree-op-types-C5rZzoAz.js';
|
|
6
7
|
export { Block, ColorValue, ContainerRef, ContentControl, ContentControlFilter, ContentControlType, DocAnchor, DocAnchorRange, DocComment, DocLocation, DocRange, DocTarget, DocumentBody, DocxDocument, DocxDocumentJSON, ExecErrorCode, ExecResult, Extent, FontDefinition, HeaderFooterSet, IndentFormatting, InsertableContentControlType, NumberingRef, PageMargins, Paragraph, ParagraphDisagreements, ParagraphFlags, ParagraphFormatCommand, ParagraphTabStop, Point, Rect, Revision, RevisionType, Run, RunFormatting, Section, SectionProperties, SelectionPin, StyleDefinition, StyleDefinitions, Table, TableCell, TableRow, Theme, ThemeColorScheme, Unsubscribe, Watermark } from './types.js';
|
|
7
8
|
import '../failure-BnGjoXf0.js';
|
|
8
|
-
|
|
9
|
-
import '../
|
|
10
|
-
import '../
|
|
9
|
+
export { A as AuthoredNoteNumbering, C as CanResult, u as DocumentChange, w as DocumentEditingMode, x as DocumentHandle, D as DocumentSource, n as Editor, e as EditorCommand, y as EditorCommandShape, z as EditorCommands, B as EditorError, G as EditorEvents, E as EditorFontError, H as EditorFontErrorCode, J as EditorFormatPainterCommands, K as EditorHeaderFooterCommands, L as EditorNoteCommands, M as EditorPosition, N as EditorQueries, O as EditorQuery, P as EditorQueryResults, Q as EditorSelection, d as EditorSnapshot, c as FontConfiguration, b as FontFaceRequest, F as FontSource, a as FontSourceSubstitution, R as FormatPainterLevel, U as FormatPainterMode, o as FormatPainterSurfaceState, V as FurnitureVariant, W as HeaderFooterSlotArgs, X as HeaderFooterState, Y as HyperlinkInfo, I as ImageContext, f as ImageCropPercent, _ as NoteKind, $ as NotePropertiesSide, a0 as NotePropertiesState, a1 as PageSetup, a2 as ResolvedNoteNumbering, a3 as ReviewActivationOptions, a4 as ReviewCommentPlacement, a5 as ReviewCustomPlacement, a6 as ReviewItemPlacement, a7 as ReviewItemPlacementBase, a8 as ReviewItemQuery, a9 as ReviewRevisionPlacement, S as SelectedImageState, p as TableBorderEdgeTarget, q as TableBorderSpec, r as TableBorderStyle, aa as TableBorderTarget, ab as TableCellVerticalAlignment, ac as TableColumnDividerResizeTarget, ad as TableColumnOccurrenceTarget, t as TableContext, ae as TableRightEdgeResizeTarget, af as TableRowOccurrenceTarget, ag as TextMatch, T as TrackedChangeFilterMode, h as TrackedChangePredicate, ah as ZoomFitTarget, Z as ZoomMode } from '../editor-PDx0fqSo.js';
|
|
10
|
+
import '../semantic-records-BreR44Ki.js';
|
|
11
|
+
import '../revision-projection-CN_DiOl_.js';
|
|
12
|
+
import '../omml-equation-oLlbPpVy.js';
|
|
@@ -1,10 +1,73 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { V as ViewScope } from '../editor-scope-DZJT4ukT.js';
|
|
2
|
+
export { E as EditorScope } from '../editor-scope-DZJT4ukT.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* `@docx-editor.dev/core/contracts/interaction` — semantic addressing and interaction outcomes.
|
|
6
|
+
*
|
|
7
|
+
* Semantic identities and targets: the vocabulary a caller uses to say WHICH text it means,
|
|
8
|
+
* independent of layout, DOM or any editing engine's positions. Plus the outcome type an
|
|
9
|
+
* interaction attempt answers with. That is the whole module.
|
|
10
|
+
*
|
|
11
|
+
* It used to be 599 lines. An "interaction frame" lived here — a revision-tagged projection
|
|
12
|
+
* of display, page geometry, caret and selection overlays, focus, composition and
|
|
13
|
+
* accessibility, plus a typed pointer-intent dispatch protocol and a render IR of glyph
|
|
14
|
+
* runs — and every one of those declarations was consumed by exactly nothing. They
|
|
15
|
+
* described an architecture the engine does not use: the paginated surface owns pointer
|
|
16
|
+
* interaction internally and paints through `Editor.attach`, so no frame was ever published
|
|
17
|
+
* and no intent ever dispatched.
|
|
18
|
+
* THREE of them (`CaretGeometry`, `HitTestOptions`, `ShapedCluster`) also collided by name
|
|
19
|
+
* with the REAL, differently-shaped types in `layout/`, so the published contract carried a
|
|
20
|
+
* second definition of a live concept and `import { ShapedCluster }` meant different things
|
|
21
|
+
* depending on which module you reached for.
|
|
22
|
+
* `InteractionFrameId` and a frame-tagged `SemanticSelection` outlived that cut. Both were
|
|
23
|
+
* the same mistake: the id was a placeholder nothing ever minted (`focus` returned a literal
|
|
24
|
+
* `{ value: 0 }`), and the selection could not be CONSTRUCTED without one, which made it a
|
|
25
|
+
* fourth name-collision with the real `SemanticSelection` in `layout/` that a caller could
|
|
26
|
+
* never actually satisfy.
|
|
27
|
+
*
|
|
28
|
+
* CONTRACT ONLY — declarations, not an implementation.
|
|
29
|
+
*
|
|
30
|
+
* @packageDocumentation
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
/** Bidi/grapheme affinity for a text caret or hit target. */
|
|
35
|
+
type InteractionAffinity = 'upstream' | 'downstream';
|
|
36
|
+
/**
|
|
37
|
+
* Model-derived stable identity within a scope. Positions resolve through this
|
|
38
|
+
* index, not accumulated display-item lengths or editing-engine coordinates.
|
|
39
|
+
*/
|
|
40
|
+
interface SemanticIdentity {
|
|
41
|
+
readonly storyId: string;
|
|
42
|
+
readonly blockId: string;
|
|
43
|
+
}
|
|
44
|
+
/** A PM-free semantic caret, range endpoint, or atomic selection target. */
|
|
45
|
+
type SemanticTarget = {
|
|
46
|
+
readonly kind: 'text';
|
|
47
|
+
readonly scope: ViewScope;
|
|
48
|
+
readonly identity: SemanticIdentity;
|
|
49
|
+
readonly graphemeOffset: number;
|
|
50
|
+
readonly affinity: InteractionAffinity;
|
|
51
|
+
} | {
|
|
52
|
+
readonly kind: 'atomic';
|
|
53
|
+
readonly scope: ViewScope;
|
|
54
|
+
readonly objectId: string;
|
|
55
|
+
};
|
|
56
|
+
/** Typed rejection for pending, read-only, invalid, or unsupported interaction. */
|
|
57
|
+
type InteractionOutcomeCode = 'pendingLayout' | 'pendingSelection' | 'readOnly' | 'invalidTarget' | 'unsupported';
|
|
58
|
+
/**
|
|
59
|
+
* The result of one interaction attempt.
|
|
60
|
+
*
|
|
61
|
+
* A rejection carries the ENGINE's own `reason`, which is what lets a caller surface why an
|
|
62
|
+
* interaction was refused instead of guessing.
|
|
63
|
+
*/
|
|
64
|
+
type InteractionOutcome<T> = {
|
|
65
|
+
readonly ok: true;
|
|
66
|
+
readonly value: T;
|
|
67
|
+
} | {
|
|
68
|
+
readonly ok: false;
|
|
69
|
+
readonly code: InteractionOutcomeCode;
|
|
70
|
+
readonly reason: string;
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export { type InteractionAffinity, type InteractionOutcome, type InteractionOutcomeCode, type SemanticIdentity, type SemanticTarget, ViewScope };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { O as OoxmlPart } from '../tree-op-types-
|
|
2
|
-
export { R as RevisionAddress } from '../tree-op-types-
|
|
3
|
-
import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-items-
|
|
4
|
-
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-items-
|
|
1
|
+
import { O as OoxmlPart } from '../tree-op-types-C5rZzoAz.js';
|
|
2
|
+
export { R as RevisionAddress } from '../tree-op-types-C5rZzoAz.js';
|
|
3
|
+
import { R as ReviewModelInput, a as ReviewItem, b as ReviewRevisionItem } from '../review-items-kC-YI70C.js';
|
|
4
|
+
export { C as CommentRecord, c as ReviewCommentItem, d as ReviewCustomItem, e as ReviewPosition, f as ReviewRange, g as ReviewRevisionKind } from '../review-items-kC-YI70C.js';
|
|
5
5
|
import { CollaborationModuleContribution } from '../collaboration.js';
|
|
6
|
-
import { R as RevisionDisplayMode } from '../revision-projection-
|
|
6
|
+
import { R as RevisionDisplayMode } from '../revision-projection-CN_DiOl_.js';
|
|
7
7
|
import './types.js';
|
|
8
|
-
import '../tree-package-fragment-
|
|
9
|
-
import '../hf-references-
|
|
10
|
-
import '../tree-store-
|
|
8
|
+
import '../tree-package-fragment-DDQHk8sv.js';
|
|
9
|
+
import '../hf-references-BZVHctVD.js';
|
|
10
|
+
import '../tree-store-DU192chS.js';
|
|
11
11
|
import '../collaboration/replication.js';
|
|
12
12
|
import '../failure-BnGjoXf0.js';
|
|
13
13
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as OoxmlPackage, O as OoxmlPart, a as OoxmlNode, p as TreeOpRejection } from './tree-op-types-
|
|
2
|
-
import { T as TreeModelChange, a as TreeDocumentStore } from './tree-store-
|
|
1
|
+
import { b as OoxmlPackage, O as OoxmlPart, a as OoxmlNode, p as TreeOpRejection } from './tree-op-types-C5rZzoAz.js';
|
|
2
|
+
import { T as TreeModelChange, a as TreeDocumentStore } from './tree-store-DU192chS.js';
|
|
3
3
|
|
|
4
4
|
/** Which of a family's four faces an embedded font relationship supplies. */
|
|
5
5
|
type FontStyleKey = 'regular' | 'bold' | 'italic' | 'boldItalic';
|
|
@@ -1,79 +1,12 @@
|
|
|
1
1
|
import { DocEdits, DocQueries, DocQueryResults, ContentControlSummary } from './contracts/document.js';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { V as ViewScope, E as EditorScope } from './editor-scope-DZJT4ukT.js';
|
|
3
|
+
import { g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem } from './review-items-kC-YI70C.js';
|
|
4
|
+
import { InteractionOutcome } from './contracts/interaction.js';
|
|
5
|
+
import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-NGeYzYCN.js';
|
|
6
|
+
import { S as SourceCrop, D as DrawingKind, u as ImageWrapTarget, v as DrawingPositionInput, w as DrawingLocks, x as ImageResourceState, y as SupportedImageMime } from './tree-op-types-C5rZzoAz.js';
|
|
5
7
|
import { ColorValue, ExecErrorCode, ParagraphFormatCommand, Watermark, DocAnchor, ExecResult, ContentControlFilter, DocRange, RunFormatting, Revision, Rect, SelectionPin, Unsubscribe } from './contracts/types.js';
|
|
6
8
|
import { C as CollaborationStatus } from './failure-BnGjoXf0.js';
|
|
7
9
|
|
|
8
|
-
/**
|
|
9
|
-
* `@docx-editor.dev/core/contracts/interaction` — semantic addressing and interaction outcomes.
|
|
10
|
-
*
|
|
11
|
-
* Semantic identities and targets: the vocabulary a caller uses to say WHICH text it means,
|
|
12
|
-
* independent of layout, DOM or any editing engine's positions. Plus the outcome type an
|
|
13
|
-
* interaction attempt answers with. That is the whole module.
|
|
14
|
-
*
|
|
15
|
-
* It used to be 599 lines. An "interaction frame" lived here — a revision-tagged projection
|
|
16
|
-
* of display, page geometry, caret and selection overlays, focus, composition and
|
|
17
|
-
* accessibility, plus a typed pointer-intent dispatch protocol and a render IR of glyph
|
|
18
|
-
* runs — and every one of those declarations was consumed by exactly nothing. They
|
|
19
|
-
* described an architecture the engine does not use: the paginated surface owns pointer
|
|
20
|
-
* interaction internally and paints through `Editor.attach`, so no frame was ever published
|
|
21
|
-
* and no intent ever dispatched.
|
|
22
|
-
* THREE of them (`CaretGeometry`, `HitTestOptions`, `ShapedCluster`) also collided by name
|
|
23
|
-
* with the REAL, differently-shaped types in `layout/`, so the published contract carried a
|
|
24
|
-
* second definition of a live concept and `import { ShapedCluster }` meant different things
|
|
25
|
-
* depending on which module you reached for.
|
|
26
|
-
* `InteractionFrameId` and a frame-tagged `SemanticSelection` outlived that cut. Both were
|
|
27
|
-
* the same mistake: the id was a placeholder nothing ever minted (`focus` returned a literal
|
|
28
|
-
* `{ value: 0 }`), and the selection could not be CONSTRUCTED without one, which made it a
|
|
29
|
-
* fourth name-collision with the real `SemanticSelection` in `layout/` that a caller could
|
|
30
|
-
* never actually satisfy.
|
|
31
|
-
*
|
|
32
|
-
* CONTRACT ONLY — declarations, not an implementation.
|
|
33
|
-
*
|
|
34
|
-
* @packageDocumentation
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/** Bidi/grapheme affinity for a text caret or hit target. */
|
|
39
|
-
type InteractionAffinity = 'upstream' | 'downstream';
|
|
40
|
-
/**
|
|
41
|
-
* Model-derived stable identity within a scope. Positions resolve through this
|
|
42
|
-
* index, not accumulated display-item lengths or editing-engine coordinates.
|
|
43
|
-
*/
|
|
44
|
-
interface SemanticIdentity {
|
|
45
|
-
readonly storyId: string;
|
|
46
|
-
readonly blockId: string;
|
|
47
|
-
}
|
|
48
|
-
/** A PM-free semantic caret, range endpoint, or atomic selection target. */
|
|
49
|
-
type SemanticTarget = {
|
|
50
|
-
readonly kind: 'text';
|
|
51
|
-
readonly scope: ViewScope;
|
|
52
|
-
readonly identity: SemanticIdentity;
|
|
53
|
-
readonly graphemeOffset: number;
|
|
54
|
-
readonly affinity: InteractionAffinity;
|
|
55
|
-
} | {
|
|
56
|
-
readonly kind: 'atomic';
|
|
57
|
-
readonly scope: ViewScope;
|
|
58
|
-
readonly objectId: string;
|
|
59
|
-
};
|
|
60
|
-
/** Typed rejection for pending, read-only, invalid, or unsupported interaction. */
|
|
61
|
-
type InteractionOutcomeCode = 'pendingLayout' | 'pendingSelection' | 'readOnly' | 'invalidTarget' | 'unsupported';
|
|
62
|
-
/**
|
|
63
|
-
* The result of one interaction attempt.
|
|
64
|
-
*
|
|
65
|
-
* A rejection carries the ENGINE's own `reason`, which is what lets a caller surface why an
|
|
66
|
-
* interaction was refused instead of guessing.
|
|
67
|
-
*/
|
|
68
|
-
type InteractionOutcome<T> = {
|
|
69
|
-
readonly ok: true;
|
|
70
|
-
readonly value: T;
|
|
71
|
-
} | {
|
|
72
|
-
readonly ok: false;
|
|
73
|
-
readonly code: InteractionOutcomeCode;
|
|
74
|
-
readonly reason: string;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
10
|
/**
|
|
78
11
|
* Header/footer and footnote/endnote public contract types for the Editor facade.
|
|
79
12
|
*
|
|
@@ -593,46 +526,6 @@ interface DocumentChange {
|
|
|
593
526
|
readonly deleted?: readonly string[];
|
|
594
527
|
readonly dirty?: readonly string[];
|
|
595
528
|
}
|
|
596
|
-
/**
|
|
597
|
-
* The editor is N+1 editing views: one body plus one per header/footer
|
|
598
|
-
* relationship, plus footnotes, text boxes, and other addressable regions.
|
|
599
|
-
* Commands must say which one they target, or they silently hit the wrong
|
|
600
|
-
* surface when a header is focused.
|
|
601
|
-
*
|
|
602
|
-
* Intentionally open-ended: this set is expected to grow (notes, frames, and
|
|
603
|
-
* whatever regions later prove addressable), so treat it as non-exhaustive
|
|
604
|
-
* rather than a closed enum.
|
|
605
|
-
*/
|
|
606
|
-
type EditorScope = {
|
|
607
|
-
kind: 'body';
|
|
608
|
-
} | {
|
|
609
|
-
kind: 'headerFooter';
|
|
610
|
-
rId: string;
|
|
611
|
-
}
|
|
612
|
-
/**
|
|
613
|
-
* A footnote/endnote region.
|
|
614
|
-
*
|
|
615
|
-
* `id` encodes kind + signed note id as `footnote:<id>` or `endnote:<id>`
|
|
616
|
-
* (e.g. `footnote:2`). Use `formatNoteScopeId` / `parseNoteScopeId` from the
|
|
617
|
-
* store package. Do not invent a parallel `{ noteKind, noteId }` scope arm.
|
|
618
|
-
*/
|
|
619
|
-
| {
|
|
620
|
-
kind: 'note';
|
|
621
|
-
id: string;
|
|
622
|
-
}
|
|
623
|
-
/** A text box or floating frame with its own content, addressed by id. */
|
|
624
|
-
| {
|
|
625
|
-
kind: 'frame';
|
|
626
|
-
id: string;
|
|
627
|
-
}
|
|
628
|
-
/** Read-only aggregate across every view. Valid for queries, not for writes. */
|
|
629
|
-
| {
|
|
630
|
-
kind: 'all';
|
|
631
|
-
};
|
|
632
|
-
/** A concrete editing view — every scope except the read-only `all` aggregate. */
|
|
633
|
-
type ViewScope = Exclude<EditorScope, {
|
|
634
|
-
kind: 'all';
|
|
635
|
-
}>;
|
|
636
529
|
/**
|
|
637
530
|
* What a fit mode fits the page to.
|
|
638
531
|
*
|
|
@@ -729,7 +622,11 @@ interface Editor {
|
|
|
729
622
|
* `save`, `exec` and `selectMatch` complete a scheduled open before they run.
|
|
730
623
|
*/
|
|
731
624
|
load(document: DocumentSource): void;
|
|
732
|
-
/**
|
|
625
|
+
/**
|
|
626
|
+
* Serialize the current document, finalizing pending text form values first.
|
|
627
|
+
* Invalid input rejects with `EditorError.code === 'invalidArgs'` and remains editable.
|
|
628
|
+
* Validation does not open a dialog. Other write refusals also reject the save.
|
|
629
|
+
*/
|
|
733
630
|
save(): Promise<ArrayBuffer>;
|
|
734
631
|
/** An opaque handle to the current document (identity + revision). Replaces the former
|
|
735
632
|
* structured `getDocument()`; the canonical state is the engine `PackageModel`, not a tree. */
|
|
@@ -835,10 +732,11 @@ interface Editor {
|
|
|
835
732
|
readonly underline?: boolean;
|
|
836
733
|
} | null;
|
|
837
734
|
/**
|
|
838
|
-
* Find across body, headers, footers, footnotes,
|
|
735
|
+
* Find across body, headers, footers, footnotes, endnotes, and selectable text boxes.
|
|
839
736
|
*
|
|
840
|
-
* The search narrows to the body
|
|
841
|
-
* viewing mode and surfaces without header, footer, or note entry methods.
|
|
737
|
+
* The search narrows to the body and its selectable text boxes when other stories cannot open.
|
|
738
|
+
* This includes viewing mode and surfaces without header, footer, or note entry methods.
|
|
739
|
+
* Text boxes in footnotes and endnotes remain excluded until their drawings are selectable.
|
|
842
740
|
*/
|
|
843
741
|
findMatches(query: string, options?: {
|
|
844
742
|
readonly matchCase?: boolean;
|
|
@@ -1618,6 +1516,8 @@ interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFoote
|
|
|
1618
1516
|
};
|
|
1619
1517
|
/** Insert a generated, hyperlink-enabled TOC for heading levels 1–3 at the selection. */
|
|
1620
1518
|
insertToc: Record<never, never>;
|
|
1519
|
+
/** Open options for the selected or context-clicked legacy text form. */
|
|
1520
|
+
editTextFormField: Record<never, never>;
|
|
1621
1521
|
refreshToc: {
|
|
1622
1522
|
tocId?: string;
|
|
1623
1523
|
mode?: 'entire' | 'pageNumbers';
|
|
@@ -1758,6 +1658,7 @@ interface EditorQueryResults extends DocQueryResults {
|
|
|
1758
1658
|
*
|
|
1759
1659
|
* A match can span runs when formatting changes mid-word; the run address is where it
|
|
1760
1660
|
* STARTS. `scope` identifies a non-body story so navigation opens the correct surface.
|
|
1661
|
+
* A frame scope selects its anchoring drawing and never places a caret inside its story.
|
|
1761
1662
|
* A match inside a field result reports the field atom's model range. Its `length` is one,
|
|
1762
1663
|
* while `text` carries the visible match and can be longer. Select with `start` and `length`.
|
|
1763
1664
|
* Never derive the selected length from `text.length`.
|
|
@@ -1954,15 +1855,15 @@ interface EditorSnapshot {
|
|
|
1954
1855
|
*/
|
|
1955
1856
|
readonly lastRejection?: string | null;
|
|
1956
1857
|
/**
|
|
1957
|
-
* Document font families that are NOT AVAILABLE: declared by the document, but with no
|
|
1958
|
-
*
|
|
1959
|
-
*
|
|
1960
|
-
* compatibility notice from this the way Word does.
|
|
1858
|
+
* Document font families that are NOT AVAILABLE: declared by the document, but with no byte
|
|
1859
|
+
* source admitted, no redirect to an admitted face, nothing embedded, and nothing the platform
|
|
1860
|
+
* could resolve. Chrome shows a compatibility notice from this the way Word does.
|
|
1961
1861
|
*
|
|
1962
|
-
* A family the app
|
|
1963
|
-
*
|
|
1964
|
-
*
|
|
1965
|
-
*
|
|
1862
|
+
* A family the app answers with a metric-compatible stand-in — Word's Times New Roman
|
|
1863
|
+
* with Liberation Serif — is AVAILABLE and stays out: the outlines differ, the advance
|
|
1864
|
+
* widths do not, so wrap and pagination land where Word puts them. The face a `w:sym`
|
|
1865
|
+
* names (MS Gothic for a checkbox, Wingdings for a bullet) stays out too, because it
|
|
1866
|
+
* paints one code point rather than text, and has no metric twin an app could supply.
|
|
1966
1867
|
*
|
|
1967
1868
|
* Optional and additive like `canUndo`: absent means the implementation has not derived
|
|
1968
1869
|
* it; empty means every family resolved (or no document is loaded).
|
|
@@ -1999,4 +1900,4 @@ interface EditorEvents {
|
|
|
1999
1900
|
error: (error: EditorError) => void;
|
|
2000
1901
|
}
|
|
2001
1902
|
|
|
2002
|
-
export { type
|
|
1903
|
+
export { type NotePropertiesSide as $, type AuthoredNoteNumbering as A, type EditorError as B, type CanResult as C, type DocumentSource as D, EditorFontError as E, type FontSource as F, type EditorEvents as G, type EditorFontErrorCode as H, type ImageContext as I, type EditorFormatPainterCommands as J, type EditorHeaderFooterCommands as K, type EditorNoteCommands as L, type EditorPosition as M, type EditorQueries as N, type EditorQuery as O, type EditorQueryResults as P, type EditorSelection as Q, type FormatPainterLevel as R, type SelectedImageState as S, type TrackedChangeFilterMode as T, type FormatPainterMode as U, type FurnitureVariant as V, type HeaderFooterSlotArgs as W, type HeaderFooterState as X, type HyperlinkInfo as Y, type ZoomMode as Z, type NoteKind as _, type FontSourceSubstitution as a, type NotePropertiesState as a0, type PageSetup as a1, type ResolvedNoteNumbering as a2, type ReviewActivationOptions as a3, type ReviewCommentPlacement as a4, type ReviewCustomPlacement as a5, type ReviewItemPlacement as a6, type ReviewItemPlacementBase as a7, type ReviewItemQuery as a8, type ReviewRevisionPlacement as a9, type TableBorderTarget as aa, type TableCellVerticalAlignment as ab, type TableColumnDividerResizeTarget as ac, type TableColumnOccurrenceTarget as ad, type TableRightEdgeResizeTarget as ae, type TableRowOccurrenceTarget as af, type TextMatch as ag, type ZoomFitTarget as ah, type FontFaceRequest as b, type FontConfiguration as c, type EditorSnapshot as d, type EditorCommand as e, type ImageCropPercent as f, type ImageCropPermille as g, type TrackedChangePredicate as h, cropPercentFromCropPermille as i, cropPercentFromPermille as j, cropPercentFromSourceCrop as k, cropPermilleFromCropPercent as l, cropPermilleFromPercent as m, type Editor as n, type FormatPainterSurfaceState as o, type TableBorderEdgeTarget as p, type TableBorderSpec as q, type TableBorderStyle as r, sourceCropFromCropPercent as s, type TableContext as t, type DocumentChange as u, validateImageCropPercent as v, type DocumentEditingMode as w, type DocumentHandle as x, type EditorCommandShape as y, type EditorCommands as z };
|