@betteroffice/docx 0.4.3 → 0.5.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.
Files changed (124) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +108 -598
  3. package/dist/chunk-25WGDXBF.mjs +1 -0
  4. package/dist/chunk-2CCPNW44.mjs +1 -0
  5. package/dist/chunk-32A4I3T4.mjs +1 -0
  6. package/dist/chunk-4LO3PSLZ.mjs +2 -0
  7. package/dist/chunk-67MGRMP3.mjs +1 -0
  8. package/dist/chunk-6AUR4AA2.mjs +1 -0
  9. package/dist/chunk-6WT6HKAY.mjs +1 -0
  10. package/dist/chunk-77ZWGQZN.mjs +1 -0
  11. package/dist/chunk-7C3Y7LIH.mjs +1 -0
  12. package/dist/chunk-7WIUNGQW.mjs +1 -0
  13. package/dist/chunk-7WWFGMMF.mjs +1 -0
  14. package/dist/chunk-AK2NG7PT.mjs +1 -0
  15. package/dist/chunk-BR5BFOHF.mjs +1 -0
  16. package/dist/chunk-CDNWHQH2.mjs +1 -0
  17. package/dist/chunk-CRTTEHZN.mjs +1 -0
  18. package/dist/chunk-ETDMQ5GE.mjs +1 -0
  19. package/dist/{wasm-KSZTTO3B.mjs → chunk-GBOHQ3CJ.mjs} +1 -1
  20. package/dist/chunk-H7K4SJKK.mjs +1 -0
  21. package/dist/chunk-ICJH7QUY.mjs +1 -0
  22. package/dist/chunk-IHETKRDA.mjs +1 -0
  23. package/dist/chunk-ISBZLVIF.mjs +1 -0
  24. package/dist/chunk-JSYH6HNV.mjs +2 -0
  25. package/dist/chunk-KICHSQFN.mjs +1 -0
  26. package/dist/chunk-KXIGXLFA.mjs +5 -0
  27. package/dist/chunk-KXLTK7AT.mjs +57 -0
  28. package/dist/chunk-L3JRNJ34.mjs +1 -0
  29. package/dist/chunk-LKDHP22R.mjs +1 -0
  30. package/dist/chunk-LPOEM5WH.mjs +1 -0
  31. package/dist/chunk-M44BABH2.mjs +1 -0
  32. package/dist/chunk-MAYPJU23.mjs +1 -0
  33. package/dist/chunk-N5RE2S3U.mjs +2 -0
  34. package/dist/chunk-NLYHFVF5.mjs +1 -0
  35. package/dist/chunk-ONYCW7VV.mjs +4 -0
  36. package/dist/chunk-QGZ2AB3M.mjs +1 -0
  37. package/dist/chunk-QWHU7YIW.mjs +2 -0
  38. package/dist/{chunk-VH7P4734.mjs → chunk-QX2CDKPG.mjs} +1 -1
  39. package/dist/chunk-RGDE6YQB.mjs +1 -0
  40. package/dist/chunk-TE3AU2JK.mjs +1 -0
  41. package/dist/chunk-UDVEZ722.mjs +1 -0
  42. package/dist/chunk-UQSVFDRV.mjs +2 -0
  43. package/dist/chunk-VHOOSS4D.mjs +1 -0
  44. package/dist/chunk-WIDM4EMT.mjs +1 -0
  45. package/dist/chunk-YITJ4QAO.mjs +1 -0
  46. package/dist/collaboration/index.d.mts +111 -11
  47. package/dist/collaboration/index.mjs +1 -1
  48. package/dist/{content-DSb-6a9T.d.mts → content-DVT06V_6.d.mts} +24 -3
  49. package/dist/core.d.mts +9 -9
  50. package/dist/core.mjs +1 -1
  51. package/dist/displayListQueries-6XjS7B5e.d.mts +1473 -0
  52. package/dist/docx/index.d.mts +8 -7
  53. package/dist/docx/index.mjs +1 -2
  54. package/dist/docxWorker.mjs +1 -0
  55. package/dist/editor/index.d.mts +14 -12
  56. package/dist/editor/index.mjs +1 -1
  57. package/dist/{fontLoader-BNSs0E8K.d.mts → fontLoader-CBkmh4ps.d.mts} +1 -1
  58. package/dist/{formatting-gqLFeJ9X.d.mts → formatting-p5MneNuy.d.mts} +32 -1
  59. package/dist/generated/edit/docx_edit_bg.wasm +0 -0
  60. package/dist/generated/layout/docx_layout_bg.wasm +0 -0
  61. package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
  62. package/dist/generated/parse/docx_parse_bg.wasm +0 -0
  63. package/dist/index-C-KKULi5.d.mts +5596 -0
  64. package/dist/layout/index.d.mts +4 -4
  65. package/dist/layout/index.mjs +1 -1
  66. package/dist/layout/pagination/index.d.mts +4 -4
  67. package/dist/layout/render/index.d.mts +37 -53
  68. package/dist/layout/render/index.mjs +3 -1
  69. package/dist/{pagedExport-BmSlEhoP.d.mts → pagedExport-DDgA5O7E.d.mts} +92 -9
  70. package/dist/plugin-api/RenderedDomContext.d.mts +5 -7
  71. package/dist/plugin-api/index.d.mts +3 -3
  72. package/dist/plugin-api/resolveItemPositions.d.mts +3 -3
  73. package/dist/{rezip-Bxiq4Z_R.d.mts → rezip-CfwAYdV4.d.mts} +7 -1
  74. package/dist/styles/index.d.mts +3 -3
  75. package/dist/styles/index.mjs +1 -1
  76. package/dist/{styles-AryxLAhx.d.mts → styles-DZZz2oRy.d.mts} +2 -2
  77. package/dist/types/content.d.mts +2 -2
  78. package/dist/types/document.d.mts +6 -6
  79. package/dist/{types-Cz7S77Ut.d.mts → types-bvPg3KsF.d.mts} +16 -3
  80. package/dist/utils/comments.d.mts +2 -2
  81. package/dist/utils/findReplace.mjs +1 -2
  82. package/dist/utils/index.d.mts +5 -5
  83. package/dist/utils/index.mjs +1 -1
  84. package/dist/utils/listState.d.mts +2 -5
  85. package/dist/utils/stylePreview.d.mts +2 -2
  86. package/dist/utils/stylePreview.mjs +1 -1
  87. package/dist/wasm-edit.d.mts +233 -48
  88. package/dist/wasm-edit.mjs +1 -1
  89. package/dist/wasm-layout.d.mts +7 -1
  90. package/dist/wasm-layout.mjs +1 -1
  91. package/dist/wasm-opc.mjs +1 -1
  92. package/dist/wasm-parse.d.mts +7 -1
  93. package/dist/wasm-parse.mjs +1 -1
  94. package/dist/worker.d.mts +60 -0
  95. package/dist/worker.mjs +1 -0
  96. package/dist/yrs/docxWorker.d.mts +20 -0
  97. package/dist/yrs/docxWorker.mjs +3 -0
  98. package/dist/yrs/index.d.mts +12 -7
  99. package/dist/yrs/index.mjs +1 -1
  100. package/package.json +14 -4
  101. package/dist/chunk-3RPZ44TT.mjs +0 -1
  102. package/dist/chunk-47Q2FMFF.mjs +0 -1
  103. package/dist/chunk-5Z22FORG.mjs +0 -1
  104. package/dist/chunk-7ZV6P6NZ.mjs +0 -57
  105. package/dist/chunk-AXFMDV66.mjs +0 -1
  106. package/dist/chunk-EBYC3CX7.mjs +0 -1
  107. package/dist/chunk-FK7X7557.mjs +0 -1
  108. package/dist/chunk-GKWXOZZH.mjs +0 -1
  109. package/dist/chunk-LIOWZSE7.mjs +0 -1
  110. package/dist/chunk-ML6E23W2.mjs +0 -1
  111. package/dist/chunk-MLEMGJP7.mjs +0 -1
  112. package/dist/chunk-QBMNRD5V.mjs +0 -2
  113. package/dist/chunk-SHVHVJUB.mjs +0 -1
  114. package/dist/compareDocx-URPCPAQT.mjs +0 -1
  115. package/dist/computeLayout-ZTO6TBWX.mjs +0 -1
  116. package/dist/displayListQueries-BVBDVXoP.d.mts +0 -306
  117. package/dist/frameDelta-CLeO7K5z.d.mts +0 -807
  118. package/dist/index-DzZVJC8-.d.mts +0 -2467
  119. package/dist/parseWasm-BESKFFA3.mjs +0 -1
  120. package/dist/rustDisplayList-B7uPoItK.d.mts +0 -315
  121. package/dist/wasm-JPDPN2B2.mjs +0 -1
  122. package/dist/wasm-QI7MWC5D.mjs +0 -1
  123. package/dist/yrs/residentEngineWorker.d.mts +0 -2
  124. package/dist/yrs/residentEngineWorker.mjs +0 -1
@@ -1,11 +1,11 @@
1
1
  export { a as attemptSelectiveSave, p as parseDocx } from '../selectiveSave-r-NMK6aI.mjs';
2
- export { c as createDocx, r as repackDocx, u as updateMultipleFiles } from '../rezip-Bxiq4Z_R.mjs';
2
+ export { R as RepackResult, c as createDocx, r as repackDocx, a as repackDocxWithWarnings, u as updateMultipleFiles } from '../rezip-CfwAYdV4.mjs';
3
3
  import { WrapType } from './wrapTypes.mjs';
4
- import { B as BlockContent, e as Comment, W as Watermark } from '../content-DSb-6a9T.mjs';
4
+ import { B as BlockContent, e as Comment, W as Watermark } from '../content-DVT06V_6.mjs';
5
5
  import { Document } from '../types/document.mjs';
6
6
  import '../docxInput-DTbCa48g.mjs';
7
- import '../formatting-gqLFeJ9X.mjs';
8
- import '../styles-AryxLAhx.mjs';
7
+ import '../formatting-p5MneNuy.mjs';
8
+ import '../styles-DZZz2oRy.mjs';
9
9
 
10
10
  type AnchorWrapType = Exclude<WrapType, 'inline'>;
11
11
  type ImageLayoutTarget = AnchorWrapType | 'squareLeft' | 'squareRight' | 'inline';
@@ -92,13 +92,14 @@ declare function toolbarValueToLayoutTarget(value: string): ImageLayoutTarget |
92
92
 
93
93
  /**
94
94
  * Inject `commentRangeStart`/`commentRangeEnd` for reply comments
95
- * that share their parent comment's text range.
95
+ * that share their parent comment's text range and have none of their own.
96
96
  */
97
97
  declare function injectReplyRangeMarkers(content: BlockContent[], comments: Comment[]): boolean;
98
98
  /**
99
99
  * Inject `commentRangeStart`/`commentRangeEnd` for comments whose
100
- * parent is a tracked-change revision (insertion/deletion). The TC
101
- * content nodes don't carry the comment's range, so we wrap them.
100
+ * parent is a tracked-change revision (insertion/deletion) and that have
101
+ * no range of their own. The TC content nodes don't carry the comment's
102
+ * range, so we wrap them.
102
103
  */
103
104
  declare function injectTCReplyRangeMarkers(content: BlockContent[], comments: Comment[]): boolean;
104
105
 
@@ -1,2 +1 @@
1
- export{h as attemptSelectiveSave,g as createDocx,a as parseDocx,e as repackDocx,f as updateMultipleFiles}from'../chunk-7ZV6P6NZ.mjs';import {a as a$1}from'../chunk-QBMNRD5V.mjs';import'../chunk-VH7P4734.mjs';import'../chunk-EBYC3CX7.mjs';import {a}from'../chunk-UBUTIWXN.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-AXFMDV66.mjs';import'../chunk-GKWXOZZH.mjs';import'../chunk-HGKSOBXK.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-TTRUPDAB.mjs';function q(e,t,r,i,a,f){let p=e.includes("w")||e.includes("e"),l=e.includes("n")||e.includes("s"),g=e.includes("w")?-1:1,n=e.includes("n")?-1:1,s=p?i+t*g:i,d=l?a+r*n:a;if(p&&l&&f){let m=Math.max(s/i,d/a);s=i*m,d=a*m;}let u=m=>Math.max(20,Math.min(2e3,m));return {width:p?u(s):i,height:l?u(d):a}}function W(e,t,r){let i=()=>t.position?.horizontal&&t.position.vertical?t.position:r?.initialPositionEmu?{horizontal:{relativeTo:"column",posOffset:r.initialPositionEmu.horizontalEmu},vertical:{relativeTo:"paragraph",posOffset:r.initialPositionEmu.verticalEmu}}:{horizontal:{relativeTo:"column",posOffset:0},vertical:{relativeTo:"paragraph",posOffset:0}};switch(e){case "inline":return {wrapType:"inline",displayMode:"inline",cssFloat:"none",wrapText:void 0,position:void 0,distTop:void 0,distBottom:void 0,distLeft:void 0,distRight:void 0};case "squareLeft":case "squareRight":{let a=e==="squareLeft"?"left":"right";return {wrapType:t.wrapType==="tight"||t.wrapType==="through"?t.wrapType:"square",displayMode:"float",cssFloat:a,wrapText:a==="left"?"right":"left",position:i()}}case "square":case "tight":case "through":{let a=t.cssFloat==="left"||t.cssFloat==="right"?t.cssFloat:"left";return {wrapType:e,displayMode:"float",cssFloat:a,wrapText:a==="left"?"right":"left",position:i()}}case "topAndBottom":return {wrapType:"topAndBottom",displayMode:"block",cssFloat:"none",wrapText:"bothSides",position:i()};case "behind":case "inFront":return {wrapType:e,displayMode:"float",cssFloat:"none",wrapText:"bothSides",position:i()}}}function _(e,t){return e==="inline"?"inline":e==="behind"?"behind":e==="inFront"?"inFront":e==="square"||e==="tight"||e==="through"?t==="right"?"squareRight":"squareLeft":null}var B=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function z(e,t){return true}function K(e){switch(e){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}function X(e,t){let r=t.filter(p=>p.parentId!=null);if(r.length===0)return false;let i=false,a=new Map;for(let p of r){let l=a.get(p.parentId);l?l.push(p.id):a.set(p.parentId,[p.id]);}function f(p){for(let l of p)if(l.type==="paragraph"){if(!l.content.some(n=>n.type==="commentRangeStart"||n.type==="commentRangeEnd"))continue;let g=[];for(let n of l.content)if(n.type==="commentRangeStart"){g.push(n);let s=a.get(n.id);if(s)for(let d of s)g.push({type:"commentRangeStart",id:d}),i=true;}else if(n.type==="commentRangeEnd"){g.push(n);let s=a.get(n.id);if(s)for(let d of s)g.push({type:"commentRangeEnd",id:d}),i=true;}else g.push(n);l.content=g;}else if(l.type==="table")for(let g of l.rows)for(let n of g.cells)f(n.content);}return f(e),i}function $(e,t){let r=new Set(t.map(n=>n.id)),i=t.filter(n=>n.parentId!=null&&!r.has(n.parentId));if(i.length===0)return false;let a$1=false,f=new Map;for(let n of i){let s=f.get(n.parentId);s?s.push(n.id):f.set(n.parentId,[n.id]);}let p=[];function l(n){if(n.type==="run")return p;let s=n.type==="insertion"||n.type==="deletion"?f.get(n.info.id)??p:p,d;return a(n,u=>{let m;if(u.type==="insertion"||u.type==="deletion"||u.type==="moveFrom"||u.type==="moveTo"?m=u.info.id:u.type==="inlineSdt"&&(n.type==="insertion"||n.type==="deletion"||n.type==="moveFrom"||n.type==="moveTo")&&(m=n.info.id),m===void 0)return;let y=f.get(m);if(y){d??(d=new Set(s));for(let h of y)d.add(h);}}),d?[...d]:s}function g(n){for(let s of n)if(s.type==="paragraph"){if(!s.content.some(y=>l(y).length>0))continue;let u=[],m=s.content;for(let y=0;y<m.length;y++){let h=m[y],L=l(h);if(L.length>0){for(let T of L)u.push({type:"commentRangeStart",id:T}),a$1=true;u.push(h);let I=m[y+1];I&&(h.type==="insertion"||h.type==="deletion")&&(I.type==="insertion"||I.type==="deletion")&&I.type!==h.type&&I.info.author===h.info.author&&I.info.date===h.info.date&&(u.push(I),y++);for(let T of L)u.push({type:"commentRangeEnd",id:T});}else u.push(h);}s.content=u;}else if(s.type==="table")for(let d of s.rows)for(let u of d.cells)g(u.content);}return g(e),a$1}function G(e){let t=e?.package.headers;if(t){for(let r of t.values())if(r.watermark)return r.watermark}}function N(e){let t=e.package.headers;if(!t||t.size===0)return e;let r=false,i=new Map;for(let[a,f]of t)if(f.watermark){let{watermark:p,...l}=f;i.set(a,l),r=true;}else i.set(a,f);return r?{...e,package:{...e.package,headers:i}}:e}function j(e,t){let r=e.package.headers;if(!r||r.size===0)return e;let i=new Map;for(let[a,f]of r)i.set(a,{...f,watermark:{...t}});return {...e,package:{...e.package,headers:i}}}function U(e){let t=e.package.document,r=[];if(t.sections)for(let i of t.sections)i.properties&&r.push(i.properties);return t.finalSectionProperties&&r.push(t.finalSectionProperties),r}function Y(e,t){let r=e.package,i=r.document,a=r.headers,f=U(e),p=new Set;if(a)for(let o of a.values())p.add(o.hdrFtrType);let l=!a||a.size===0,g=f.some(o=>o.titlePg),n=f.some(o=>o.evenAndOddHeaders),s=l,d=g&&!p.has("first"),u=n&&!p.has("even");if(!s&&!d&&!u)return e;let m=r.relationships?new Map(r.relationships):new Map,y=new Map(a??[]),h=new Set;for(let o of m.values())o.target&&h.add(o.target.replace(/^\/?word\//,"").toLowerCase());function L(){let o=1;for(;h.has(`header${o}.xml`);)o++;let c=`header${o}.xml`;return h.add(c.toLowerCase()),c}function I(o){let c=`rIdWmHdr${o[0].toUpperCase()}${o.slice(1)}`,b=1;for(;m.has(c);)c=`rIdWmHdr${o[0].toUpperCase()}${o.slice(1)}${b++}`;return m.set(c,{id:c,type:a$1.header,target:L()}),y.set(c,{type:"header",hdrFtrType:o,content:[],watermark:{...t}}),c}let T={};function S(o){return T[o]??(T[o]=I(o))}function x(o,c){let b=o?.headerReferences?[...o.headerReferences]:[];return b.some(A=>A.type===c)?o??{}:(b.push({type:c,rId:S(c)}),{...o??{},headerReferences:b})}function k(o){let c=o;return s&&(c=x(c,"default")),d&&c?.titlePg&&(c=x(c,"first")),u&&c?.evenAndOddHeaders&&(c=x(c,"even")),c}let M=k(i.finalSectionProperties),v=i.sections?.map(o=>({...o,properties:k(o.properties)??o.properties}));return {...e,package:{...r,relationships:m,headers:y,document:{...i,finalSectionProperties:M,...v?{sections:v}:{}}}}}function V(e,t){if(!t)return N(e);let r=j(e,t);return Y(r,t)}
2
- export{B as IMAGE_LAYOUT_OPTIONS,q as calculateResizedImageDimensions,_ as deriveLayoutChoice,G as getDocumentWatermark,X as injectReplyRangeMarkers,$ as injectTCReplyRangeMarkers,z as isImageLayoutOptionEnabled,W as resolveImageLayoutAttrs,V as setDocumentWatermark,K as toolbarValueToLayoutTarget};
1
+ export{a as injectReplyRangeMarkers,b as injectTCReplyRangeMarkers}from'../chunk-7C3Y7LIH.mjs';export{a as getDocumentWatermark,b as setDocumentWatermark}from'../chunk-JSYH6HNV.mjs';export{b as attemptSelectiveSave,a as parseDocx}from'../chunk-2CCPNW44.mjs';export{g as createDocx,d as repackDocx,e as repackDocxWithWarnings,f as updateMultipleFiles}from'../chunk-KXLTK7AT.mjs';import'../chunk-UQSVFDRV.mjs';import'../chunk-QWHU7YIW.mjs';import'../chunk-MAYPJU23.mjs';import'../chunk-QX2CDKPG.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-QGZ2AB3M.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-YITJ4QAO.mjs';import'../chunk-UBUTIWXN.mjs';import'../chunk-7WIUNGQW.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-HGKSOBXK.mjs';import'../chunk-TTRUPDAB.mjs';function R(e,t,o,n,i,c){let r=e.includes("w")||e.includes("e"),s=e.includes("n")||e.includes("s"),g=e.includes("w")?-1:1,m=e.includes("n")?-1:1,u=r?n+t*g:n,p=s?i+o*m:i;if(r&&s&&c){let a=Math.max(u/n,p/i);u=n*a,p=i*a;}let l=a=>Math.max(20,Math.min(2e3,a));return {width:r?l(u):n,height:s?l(p):i}}function O(e,t,o){let n=()=>t.position?.horizontal&&t.position.vertical?t.position:o?.initialPositionEmu?{horizontal:{relativeTo:"column",posOffset:o.initialPositionEmu.horizontalEmu},vertical:{relativeTo:"paragraph",posOffset:o.initialPositionEmu.verticalEmu}}:{horizontal:{relativeTo:"column",posOffset:0},vertical:{relativeTo:"paragraph",posOffset:0}};switch(e){case "inline":return {wrapType:"inline",displayMode:"inline",cssFloat:"none",wrapText:void 0,position:void 0,distTop:void 0,distBottom:void 0,distLeft:void 0,distRight:void 0};case "squareLeft":case "squareRight":{let i=e==="squareLeft"?"left":"right";return {wrapType:t.wrapType==="tight"||t.wrapType==="through"?t.wrapType:"square",displayMode:"float",cssFloat:i,wrapText:i==="left"?"right":"left",position:{...n(),horizontal:{relativeTo:"margin",align:i}}}}case "square":case "tight":case "through":{let i=t.cssFloat==="left"||t.cssFloat==="right"?t.cssFloat:"left";return {wrapType:e,displayMode:"float",cssFloat:i,wrapText:i==="left"?"right":"left",position:n()}}case "topAndBottom":return {wrapType:"topAndBottom",displayMode:"block",cssFloat:"none",wrapText:"bothSides",position:n()};case "behind":case "inFront":return {wrapType:e,displayMode:"float",cssFloat:"none",wrapText:"bothSides",position:n()}}}function M(e,t){return e==="inline"?"inline":e==="behind"?"behind":e==="inFront"?"inFront":e==="square"||e==="tight"||e==="through"?t==="right"?"squareRight":"squareLeft":null}var v=[{choice:"inline",i18nLabelKey:"inLineWithText",i18nDescKey:"inLineWithText",iconHint:"inline"},{choice:"squareLeft",i18nLabelKey:"squareLeft",i18nDescKey:"squareLeft",iconHint:"squareLeft"},{choice:"squareRight",i18nLabelKey:"squareRight",i18nDescKey:"squareRight",iconHint:"squareRight"},{choice:"behind",i18nLabelKey:"behindText",i18nDescKey:"behindText",iconHint:"behind"},{choice:"inFront",i18nLabelKey:"inFrontOfText",i18nDescKey:"inFrontOfText",iconHint:"inFront"}];function F(e,t){return true}function D(e){switch(e){case "inline":return "inline";case "square":case "tight":case "through":return "squareLeft";case "topAndBottom":return "topAndBottom";case "behind":return "behind";case "inFront":return "inFront";case "wrapRight":return "squareLeft";case "wrapLeft":return "squareRight";default:return}}export{v as IMAGE_LAYOUT_OPTIONS,R as calculateResizedImageDimensions,M as deriveLayoutChoice,F as isImageLayoutOptionEnabled,O as resolveImageLayoutAttrs,D as toolbarValueToLayoutTarget};
@@ -0,0 +1 @@
1
+ import './yrs/docxWorker.mjs';
@@ -1,18 +1,20 @@
1
+ import { Y as YrsSession, a as YrsRenderEnv, L as LayoutMetaV1 } from '../index-C-KKULi5.mjs';
1
2
  import { R as ResidentMeasurementConfig } from '../rustMeasureSource-BkCx1FDx.mjs';
2
- import { L as Layout, a as LayoutOptions } from '../types-Cz7S77Ut.mjs';
3
+ import { L as Layout, a as LayoutOptions } from '../types-bvPg3KsF.mjs';
3
4
  import { MeasuredBlock } from '../layout/pagination/index.mjs';
4
- import { D as DisplayListHeadersFooters } from '../rustDisplayList-B7uPoItK.mjs';
5
+ import { b as DisplayListHeadersFooters } from '../displayListQueries-6XjS7B5e.mjs';
5
6
  import { Document } from '../types/document.mjs';
6
- import { Y as YrsSession, a as YrsRenderEnv } from '../index-DzZVJC8-.mjs';
7
- import { f as SectionProperties, N as NoteKind, g as DocumentBody } from '../content-DSb-6a9T.mjs';
8
- import '../formatting-gqLFeJ9X.mjs';
9
- import '../frameDelta-CLeO7K5z.mjs';
10
- import '../styles-AryxLAhx.mjs';
11
- import '../pagedExport-BmSlEhoP.mjs';
12
- import '../loadWasmAsset-Cr95TImt.mjs';
7
+ import { f as SectionProperties, N as NoteKind, g as DocumentBody } from '../content-DVT06V_6.mjs';
8
+ import '../pagedExport-DDgA5O7E.mjs';
9
+ import '../formatting-p5MneNuy.mjs';
10
+ import '../styles-DZZz2oRy.mjs';
13
11
  import '../plugin-api/index.mjs';
14
- import '../rezip-Bxiq4Z_R.mjs';
12
+ import '../utils/comments.mjs';
15
13
  import '../docx/wrapTypes.mjs';
14
+ import '../utils/findReplace.mjs';
15
+ import '../utils/stylePreview.mjs';
16
+ import '../loadWasmAsset-Cr95TImt.mjs';
17
+ import '../rezip-CfwAYdV4.mjs';
16
18
 
17
19
  interface ResidentRegionLayoutRequest {
18
20
  bodyStory: 'body';
@@ -63,7 +65,7 @@ declare function computeLayout(inputs: ComputeLayoutInputs): LayoutComputation;
63
65
  * measured blocks stay in the worker, so the main-thread display fallback has
64
66
  * to lay the document out on this thread first.
65
67
  */
66
- declare function workerLayoutComputation(layoutJson: string, layoutRevision?: number): LayoutComputation;
68
+ declare function workerLayoutComputation(layoutReply: string | LayoutMetaV1, layoutRevision?: number, headersFooters?: string): LayoutComputation;
67
69
 
68
70
  /**
69
71
  * The last section with inherited references; `finalSectionProperties`
@@ -74,6 +76,6 @@ declare function resolvedFinalSectionProperties(body: DocumentBody | null | unde
74
76
  * Applies an edit to the last section on both views: the resolved entry the
75
77
  * engine lays out and the authored sectPr the serializer saves.
76
78
  */
77
- declare function updateFinalSectionProperties(body: DocumentBody, update: (properties: SectionProperties) => SectionProperties): DocumentBody;
79
+ declare function updateFinalSectionProperties<T extends Pick<DocumentBody, 'sections' | 'finalSectionProperties'>>(body: T, update: (properties: SectionProperties) => SectionProperties): T;
78
80
 
79
81
  export { type ComputeLayoutInputs, type LayoutComputation, buildResidentRegionLayoutRequest, computeLayout, getLayoutKernelInputs, resolvedFinalSectionProperties, updateFinalSectionProperties, workerLayoutComputation };
@@ -1 +1 @@
1
- export{c as buildResidentRegionLayoutRequest,e as computeLayout,d as getLayoutKernelInputs,a as resolvedFinalSectionProperties,b as updateFinalSectionProperties,f as workerLayoutComputation}from'../chunk-MLEMGJP7.mjs';import'../chunk-TTRUPDAB.mjs';
1
+ export{a as buildResidentRegionLayoutRequest,c as computeLayout,b as getLayoutKernelInputs,d as workerLayoutComputation}from'../chunk-7WWFGMMF.mjs';export{e as resolvedFinalSectionProperties,f as updateFinalSectionProperties}from'../chunk-CDNWHQH2.mjs';import'../chunk-TTRUPDAB.mjs';
@@ -1,4 +1,4 @@
1
- import { y as ThemeColorSlot, C as ColorValue, f as Theme, x as ThemeColorScheme } from './formatting-gqLFeJ9X.mjs';
1
+ import { A as ThemeColorSlot, C as ColorValue, f as Theme, z as ThemeColorScheme } from './formatting-p5MneNuy.mjs';
2
2
 
3
3
  /**
4
4
  * Color primitives and math shared across OOXML formats.
@@ -1,11 +1,20 @@
1
1
  /** DrawingML value contracts retained by the DOCX host. */
2
2
  type ThemeColorSlot = 'dk1' | 'lt1' | 'dk2' | 'lt2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6' | 'hlink' | 'folHlink' | 'background1' | 'text1' | 'background2' | 'text2';
3
+ /** Hue and hue offsets use turns; other values use fractions. */
4
+ type ColorTransform = {
5
+ kind: 'tint' | 'shade' | 'hue' | 'hueMod' | 'hueOff' | 'sat' | 'satMod' | 'satOff' | 'lum' | 'lumMod' | 'lumOff' | 'red' | 'redMod' | 'redOff' | 'green' | 'greenMod' | 'greenOff' | 'blue' | 'blueMod' | 'blueOff' | 'alpha' | 'alphaMod' | 'alphaOff';
6
+ value: number;
7
+ } | {
8
+ kind: 'comp' | 'inv' | 'gray' | 'gamma' | 'invGamma';
9
+ };
3
10
  interface ColorValue {
4
11
  rgb?: string;
5
12
  themeColor?: ThemeColorSlot;
6
13
  themeTint?: string;
7
14
  themeShade?: string;
8
15
  auto?: boolean;
16
+ /** Overrides legacy colour modifiers; legacy alpha applies without an alpha step. */
17
+ transforms?: ColorTransform[];
9
18
  }
10
19
  interface ThemeColorScheme {
11
20
  dk1?: string;
@@ -372,6 +381,22 @@ type SpacingExplicit = {
372
381
  before?: boolean;
373
382
  after?: boolean;
374
383
  };
384
+ /** A paragraph `w:cnfStyle` element, with every attribute kept as authored. */
385
+ interface ParagraphCnfStyle {
386
+ val?: string;
387
+ firstRow?: string;
388
+ lastRow?: string;
389
+ firstColumn?: string;
390
+ lastColumn?: string;
391
+ oddVBand?: string;
392
+ evenVBand?: string;
393
+ oddHBand?: string;
394
+ evenHBand?: string;
395
+ firstRowFirstColumn?: string;
396
+ firstRowLastColumn?: string;
397
+ lastRowFirstColumn?: string;
398
+ lastRowLastColumn?: string;
399
+ }
375
400
  /**
376
401
  * Paragraph-level formatting (`w:pPr`) — alignment, indentation, spacing
377
402
  * (before/after, line height), pagination flags (keepNext, keepLines,
@@ -451,6 +476,10 @@ interface ParagraphFormatting {
451
476
  autoSpaceDE?: boolean;
452
477
  /** Space between East Asian text and numbers (w:autoSpaceDN). Absent is the OOXML default (on). */
453
478
  autoSpaceDN?: boolean;
479
+ /** Adjust right indent for East Asian text (w:adjustRightInd). Absent is the default (on). */
480
+ adjustRightInd?: boolean;
481
+ /** Conditional table formatting authored on this paragraph (w:cnfStyle), kept as read. */
482
+ cnfStyle?: ParagraphCnfStyle;
454
483
  /** Numbering properties (w:numPr) */
455
484
  numPr?: {
456
485
  /** Numbering definition ID (w:numId) */
@@ -592,6 +621,8 @@ interface FloatingTableProperties {
592
621
  * Table formatting properties (w:tblPr)
593
622
  */
594
623
  interface TableFormatting {
624
+ caption?: string;
625
+ description?: string;
595
626
  /** Table width */
596
627
  width?: TableMeasurement;
597
628
  /** Table justification */
@@ -711,4 +742,4 @@ interface TableCellFormatting {
711
742
  conditionalFormat?: ConditionalFormatStyle;
712
743
  }
713
744
 
714
- export type { ThemeFontScheme as A, BorderSpec as B, ColorValue as C, ShapeTextBody as D, EmphasisMark as E, FloatingTableProperties as F, LineSpacingRule as L, PresetGeometryPathCommand as P, RunFontHint as R, ShadingProperties as S, TextModernEffects as T, UnderlineStyle as U, ParagraphFormatting as a, TextFormatting as b, TableFormatting as c, TableRowFormatting as d, TableCellFormatting as e, Theme as f, CellMargins as g, ConditionalFormatStyle as h, ParagraphAlignment as i, RunLanguage as j, ShapeFill as k, ShapeOutline as l, ShapeType as m, TabLeader as n, TabStop as o, TabStopAlignment as p, TableBorders as q, TableLook as r, TableMeasurement as s, TableStyleCascade as t, TableStyleRegion as u, TableWidthType as v, TextEffect as w, ThemeColorScheme as x, ThemeColorSlot as y, ThemeFont as z };
745
+ export type { ThemeColorSlot as A, BorderSpec as B, ColorValue as C, ThemeFont as D, EmphasisMark as E, FloatingTableProperties as F, ThemeFontScheme as G, ShapeTextBody as H, LineSpacingRule as L, ParagraphFormatting as P, RunFontHint as R, ShadingProperties as S, TextFormatting as T, UnderlineStyle as U, TextModernEffects as a, PresetGeometryPathCommand as b, TableFormatting as c, TableRowFormatting as d, TableCellFormatting as e, Theme as f, CellMargins as g, ColorTransform as h, ConditionalFormatStyle as i, ParagraphAlignment as j, ParagraphCnfStyle as k, RunLanguage as l, ShapeFill as m, ShapeOutline as n, ShapeType as o, TabLeader as p, TabStop as q, TabStopAlignment as r, TableBorders as s, TableLook as t, TableMeasurement as u, TableStyleCascade as v, TableStyleRegion as w, TableWidthType as x, TextEffect as y, ThemeColorScheme as z };