@betteroffice/docx 0.3.0 → 0.4.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 +64 -0
- package/dist/chunk-24Z6ZVFZ.mjs +1 -0
- package/dist/chunk-2QHGQA3V.mjs +1 -0
- package/dist/{chunk-ACGKK7IB.mjs → chunk-3CYO46ML.mjs} +1 -1
- package/dist/chunk-6CHGYCFU.mjs +1 -0
- package/dist/chunk-AOWJ4WDE.mjs +1 -0
- package/dist/chunk-DLXIZBB6.mjs +1 -0
- package/dist/chunk-F2VBW6RB.mjs +1 -0
- package/dist/chunk-HPZFJGGM.mjs +0 -0
- package/dist/chunk-L2ML3DDI.mjs +1 -0
- package/dist/chunk-LIGZ75FP.mjs +1 -0
- package/dist/chunk-LT2GCWZ3.mjs +0 -0
- package/dist/chunk-ND3FBCB3.mjs +16 -0
- package/dist/{chunk-NT2OYIJ4.mjs → chunk-NMDQHUQB.mjs} +1 -1
- package/dist/chunk-NVN26RHH.mjs +1 -0
- package/dist/{chunk-H5YYCN42.mjs → chunk-OK5UFGX3.mjs} +1 -1
- package/dist/{chunk-VQXNED2P.mjs → chunk-RZQ3OXZY.mjs} +1 -1
- package/dist/{chunk-QE4ZDRKV.mjs → chunk-YLFKV2NT.mjs} +1 -1
- package/dist/collaboration/index.d.mts +5 -4
- package/dist/compareDocx-IHFPGIGV.mjs +1 -0
- package/dist/computeLayout-4MNWHE2T.mjs +1 -0
- package/dist/core.d.mts +4 -4
- package/dist/core.mjs +1 -1
- package/dist/{displayListQueries-BYFrBkw5.d.mts → displayListQueries-H5YnU_hX.d.mts} +23 -5
- package/dist/docx/index.mjs +1 -1
- package/dist/editor/index.d.mts +15 -7
- package/dist/editor/index.mjs +1 -1
- package/dist/{fontLoader-CkXcPB1C.d.mts → fontLoader-BNSs0E8K.d.mts} +54 -1
- package/dist/{frameDelta-CVt5FAXT.d.mts → frameDelta-ByU7HBuB.d.mts} +21 -1
- package/dist/generated/edit/docx_edit_bg.wasm +0 -0
- package/dist/generated/layout/docx_layout_bg.wasm +0 -0
- package/dist/generated/opc/ooxml_opc_bg.wasm +0 -0
- package/dist/generated/parse/docx_parse_bg.wasm +0 -0
- package/dist/{index-BbZwdkPz.d.mts → index-CHy6_Yuo.d.mts} +470 -14
- package/dist/layout/index.d.mts +2 -2
- package/dist/layout/index.mjs +1 -1
- package/dist/layout/pagination/index.d.mts +2 -2
- package/dist/layout/render/index.d.mts +118 -31
- package/dist/layout/render/index.mjs +1 -1
- package/dist/loadWasmAsset-Cr95TImt.d.mts +25 -0
- package/dist/{pagedExport-D3E4jZ-B.d.mts → pagedExport---0Dlmzo.d.mts} +1 -1
- package/dist/parseWasm-NLAG22EU.mjs +1 -0
- package/dist/plugin-api/RenderedDomContext.d.mts +6 -4
- package/dist/plugin-api/RenderedDomContext.mjs +1 -1
- package/dist/{rustDisplayList-CwOoUn3t.d.mts → rustDisplayList-LcRZHCSL.d.mts} +12 -4
- package/dist/{rustMeasureSource-CyBMcy1x.d.mts → rustMeasureSource-BkCx1FDx.d.mts} +2 -0
- package/dist/types/document.d.mts +3 -0
- package/dist/{types-B4jD0rrc.d.mts → types-D6Pra38E.d.mts} +12 -3
- package/dist/utils/index.d.mts +14 -2
- package/dist/utils/index.mjs +1 -1
- package/dist/wasm-GSI2XMOH.mjs +1 -0
- package/dist/{wasm-G62X4WRW.mjs → wasm-K6DRABAA.mjs} +1 -1
- package/dist/wasm-NF6B3AH7.mjs +1 -0
- package/dist/wasm-edit.d.mts +177 -18
- package/dist/wasm-edit.mjs +1 -1
- package/dist/wasm-layout.d.mts +1 -1
- package/dist/wasm-layout.mjs +1 -1
- package/dist/wasm-opc.d.mts +1 -1
- package/dist/wasm-opc.mjs +1 -1
- package/dist/wasm-parse.d.mts +1 -1
- package/dist/wasm-parse.mjs +1 -1
- package/dist/yrs/index.d.mts +4 -3
- package/dist/yrs/index.mjs +1 -1
- package/dist/yrs/residentEngineWorker.mjs +1 -1
- package/package.json +2 -2
- package/dist/chunk-5B4VMUXM.mjs +0 -16
- package/dist/chunk-5F6DLQZP.mjs +0 -1
- package/dist/chunk-5JEQC76K.mjs +0 -1
- package/dist/chunk-7GJG6LLU.mjs +0 -1
- package/dist/chunk-FE6FWGBJ.mjs +0 -1
- package/dist/chunk-HLDJMU3R.mjs +0 -1
- package/dist/chunk-J7LNO6SM.mjs +0 -1
- package/dist/chunk-PGMXWI5X.mjs +0 -1
- package/dist/chunk-Z4HZIPBS.mjs +0 -1
- package/dist/compareDocx-XXTZV4CG.mjs +0 -1
- package/dist/computeLayout-LWLAJWYA.mjs +0 -1
- package/dist/loadWasmAsset-CMvnVkfA.d.mts +0 -3
- package/dist/wasm-US6R7SWN.mjs +0 -1
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { PIXELS_PER_INCH, TWIPS_PER_INCH, clamp, eighthsToPixels, emuToPixels, emuToTwips, formatPx, halfPointsToPixels, halfPointsToPoints, pixelsToEmu, pixelsToTwips, pointsToHalfPoints, pointsToPixels, roundPixels, twipsToEmu, twipsToPixels } from './units.mjs';
|
|
2
|
-
|
|
2
|
+
import { F as FontLoadScope } from '../fontLoader-BNSs0E8K.mjs';
|
|
3
|
+
export { C as BufferFaceInput, D as FONT_MAPPING, E as FontDefinition, T as ThemeMatrixCell, b as blendColors, c as canRenderFont, a as colorsEqual, G as createFontLoadScope, d as createRgbColor, e as createThemeColor, f as darkenColor, g as ensureHexPrefix, H as extractFontsFromDocument, h as generateThemeTintShadeMatrix, i as getContrastingColor, I as getGoogleFontEquivalent, j as getLoadedFonts, k as getThemeTintShadeHex, l as isBlack, m as isFontLoaded, o as isGoogleFontsEnabled, n as isLoading, p as isWhite, q as lightenColor, J as loadDocumentFonts, r as loadFont, K as loadFontDefinitions, s as loadFontFromBuffer, L as loadFontFromUrl, M as loadFontWithMapping, t as loadFonts, N as loadFontsWithMapping, O as onFontError, u as onFontsLoaded, v as parseColorString, w as preloadCommonFonts, P as registerDocumentFaces, x as resolveColor, Q as resolveColorToHex, y as resolveHighlightColor, z as resolveHighlightToCss, A as resolveShadingColor, B as setGoogleFontsEnabled } from '../fontLoader-BNSs0E8K.mjs';
|
|
3
4
|
export { D as DocxInput, t as toArrayBuffer } from '../docxInput-DTbCa48g.mjs';
|
|
4
5
|
import { F as FontTable } from '../styles-AryxLAhx.mjs';
|
|
5
6
|
import { Document } from '../types/document.mjs';
|
|
@@ -109,6 +110,17 @@ declare function extractEmbeddedFontFaces(document: Document): Promise<EmbeddedF
|
|
|
109
110
|
* @public
|
|
110
111
|
*/
|
|
111
112
|
declare function loadEmbeddedFonts(fontTable: FontTable | undefined, rawFonts: ReadonlyMap<string, ArrayBuffer>, fontTableRelsXml: string | null | undefined): Promise<Set<string>>;
|
|
113
|
+
/**
|
|
114
|
+
* {@link loadEmbeddedFonts}, resolving to the CSS family each embedded family
|
|
115
|
+
* was registered under: its own name, or an alias when another live document
|
|
116
|
+
* registered different faces under that name (see {@link registerDocumentFaces}).
|
|
117
|
+
* With a scope, the faces are held until its next document or its disposal,
|
|
118
|
+
* and a call that a later document load into the scope overtook resolves to
|
|
119
|
+
* an empty map.
|
|
120
|
+
*
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
declare function loadEmbeddedFontFamilies(fontTable: FontTable | undefined, rawFonts: ReadonlyMap<string, ArrayBuffer>, fontTableRelsXml: string | null | undefined, scope?: FontLoadScope): Promise<Map<string, string>>;
|
|
112
124
|
|
|
113
125
|
/**
|
|
114
126
|
* Discover the fonts a document actually references and that the browser can
|
|
@@ -488,4 +500,4 @@ declare function createComment(allocator: CommentIdAllocator, text: string, auth
|
|
|
488
500
|
*/
|
|
489
501
|
declare function sanitizeHref(href: string | null | undefined): string | undefined;
|
|
490
502
|
|
|
491
|
-
export { type CellAnchor, type ColorMode, type CommentIdAllocator, DEFAULT_PARAGRAPH_FLASH_COLOR, DEFAULT_PARAGRAPH_FLASH_DURATION_MS, type EmbeddedFontFace, type HeadingInfo, PARAGRAPH_FLASH_CLASS_NAME, PENDING_COMMENT_ID, type ParagraphHighlightOptions, type ReadDocxFileResult, type RenderableFontOptions, type ScrollToParaIdOptions, type SplitLayoutResult, type SplitTarget, type WordSelectionResult, buildAnchorMaps, collectHeadings, computeSplitDialogDefaults, computeSplitLayout, createComment, createCommentIdAllocator, createDoubleClickWordSelector, createTripleClickParagraphSelector, deobfuscateFont, excludeFontsByName, expandSelectionToWordBoundaries, extractEmbeddedFontFaces, findParagraphFragmentsByParaId, findWordAt, findWordBoundaries, flashParagraphElements, flashParagraphFragmentsByParaId, getEmbeddedFontFaces, getEmbeddedFontFamilies, getRenderableDocumentFonts, getWordAt, handleClickForMultiClick, isValidFontKey, loadEmbeddedFonts, prefersColorSchemeDark, readDocxFileFromInput, redistributeColumnWidths, resolveIsDark, sanitizeHref, selectParagraphAtCursor, selectRenderableFonts, selectWordAtCursor, selectWordInTextNode, subscribeSystemDark, sumColumnWidths };
|
|
503
|
+
export { type CellAnchor, type ColorMode, type CommentIdAllocator, DEFAULT_PARAGRAPH_FLASH_COLOR, DEFAULT_PARAGRAPH_FLASH_DURATION_MS, type EmbeddedFontFace, FontLoadScope, type HeadingInfo, PARAGRAPH_FLASH_CLASS_NAME, PENDING_COMMENT_ID, type ParagraphHighlightOptions, type ReadDocxFileResult, type RenderableFontOptions, type ScrollToParaIdOptions, type SplitLayoutResult, type SplitTarget, type WordSelectionResult, buildAnchorMaps, collectHeadings, computeSplitDialogDefaults, computeSplitLayout, createComment, createCommentIdAllocator, createDoubleClickWordSelector, createTripleClickParagraphSelector, deobfuscateFont, excludeFontsByName, expandSelectionToWordBoundaries, extractEmbeddedFontFaces, findParagraphFragmentsByParaId, findWordAt, findWordBoundaries, flashParagraphElements, flashParagraphFragmentsByParaId, getEmbeddedFontFaces, getEmbeddedFontFamilies, getRenderableDocumentFonts, getWordAt, handleClickForMultiClick, isValidFontKey, loadEmbeddedFontFamilies, loadEmbeddedFonts, prefersColorSchemeDark, readDocxFileFromInput, redistributeColumnWidths, resolveIsDark, sanitizeHref, selectParagraphAtCursor, selectRenderableFonts, selectWordAtCursor, selectWordInTextNode, subscribeSystemDark, sumColumnWidths };
|
package/dist/utils/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d as MIN_CARD_GAP,c as SIDEBAR_DOCUMENT_SHIFT,b as SIDEBAR_PAGE_GAP,a as SIDEBAR_WIDTH}from'../chunk-YUOKI2HB.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,b as resolveColorToHex,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'../chunk-LTVVQMHB.mjs';export{a as PIXELS_PER_INCH,e as TWIPS_PER_INCH,p as clamp,n as eighthsToPixels,b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,l as halfPointsToPoints,c as pixelsToEmu,h as pixelsToTwips,m as pointsToHalfPoints,d as pointsToPixels,o as roundPixels,j as twipsToEmu,g as twipsToPixels}from'../chunk-CTBUQRYQ.mjs';import {n,d}from'../chunk-5B4VMUXM.mjs';export{r as FONT_MAPPING,n as canRenderFont,c as deobfuscateFont,A as extractEmbeddedFontFaces,w as extractFontsFromDocument,z as getEmbeddedFontFaces,y as getEmbeddedFontFamilies,s as getGoogleFontEquivalent,k as getLoadedFonts,g as isFontLoaded,i as isGoogleFontsEnabled,j as isLoading,b as isValidFontKey,x as loadDocumentFonts,B as loadEmbeddedFonts,e as loadFont,q as loadFontDefinitions,o as loadFontFromBuffer,p as loadFontFromUrl,t as loadFontWithMapping,f as loadFonts,u as loadFontsWithMapping,m as onFontError,l as onFontsLoaded,v as preloadCommonFonts,h as setGoogleFontsEnabled,a as toArrayBuffer}from'../chunk-5B4VMUXM.mjs';import'../chunk-QE4ZDRKV.mjs';import'../chunk-HLDJMU3R.mjs';import'../chunk-ACGKK7IB.mjs';import'../chunk-5F6DLQZP.mjs';import'../chunk-TTRUPDAB.mjs';function H(e){let t=new Set,o=e.package;if(o.theme&&nt(o.theme,t),o.styles&&rt(o.styles,t),o.document)for(let n of o.document.content)T(n,t);if(o.headers)for(let n of o.headers.values())O(n,t);if(o.footers)for(let n of o.footers.values())O(n,t);if(o.footnotes)for(let n of o.footnotes)ut(n,t);if(o.endnotes)for(let n of o.endnotes)mt(n,t);return Array.from(t).sort()}function nt(e,t){let o=e.fontScheme;o&&(o.majorFont&&_(o.majorFont,t),o.minorFont&&_(o.minorFont,t));}function _(e,t){if(e.latin&&t.add(e.latin),e.ea&&t.add(e.ea),e.cs&&t.add(e.cs),e.fonts)for(let o of Object.values(e.fonts))o&&t.add(o);}function rt(e,t){e.docDefaults&&(e.docDefaults.rPr&&h(e.docDefaults.rPr,t),e.docDefaults.pPr?.runProperties&&h(e.docDefaults.pPr.runProperties,t));for(let o of e.styles)o.rPr&&h(o.rPr,t),o.pPr?.runProperties&&h(o.pPr.runProperties,t);}function h(e,t){let o=e.fontFamily;o&&(o.ascii&&t.add(o.ascii),o.hAnsi&&t.add(o.hAnsi),o.eastAsia&&t.add(o.eastAsia),o.cs&&t.add(o.cs));}function at(e,t){e.runProperties&&h(e.runProperties,t);}function T(e,t){e.type==="paragraph"?st(e,t):e.type==="table"&&ct(e,t);}function st(e,t){e.formatting&&at(e.formatting,t);for(let o of e.content)it(o,t);}function it(e,t){if(e.type==="run")b(e,t);else if(e.type==="hyperlink")lt(e,t);else if(e.type==="simpleField"||e.type==="complexField"){if("content"in e)for(let o of e.content)o.type==="run"&&b(o,t);if("fieldResult"in e)for(let o of e.fieldResult)b(o,t);}}function b(e,t){e.formatting&&h(e.formatting,t);}function lt(e,t){for(let o of e.children)o.type==="run"&&b(o,t);}function ct(e,t){for(let o of e.rows)ft(o,t);}function ft(e,t){for(let o of e.cells)dt(o,t);}function dt(e,t){for(let o of e.content)T(o,t);}function O(e,t){for(let o of e.content)T(o,t);}function ut(e,t){for(let o of e.content)T(o,t);}function mt(e,t){for(let o of e.content)T(o,t);}var pt=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui"]);function N(e,t={}){let o=t.canRender??n,n$1=new Set;for(let i of t.exclude??[])n$1.add(i.trim().toLowerCase());let r=new Set;for(let i of t.embeddedFamilies??[])r.add(i.trim().toLowerCase());let s=[],a=new Set;for(let i of e){let c=i.trim(),f=c.toLowerCase();!c||pt.has(f)||n$1.has(f)||a.has(f)||!r.has(f)&&!o(c)||(a.add(f),s.push({name:c,fontFamily:d(c).cssFallback,category:"other"}));}return s}function gt(e,t={}){return N(H(e),t)}function ht(e,t){if(!e||e.length===0)return [];let o=new Set;for(let s of t)o.add(s.trim().toLowerCase());let n=new Set,r=[];for(let s of e){let a=s.name.trim().toLowerCase();o.has(a)||n.has(a)||(n.add(a),r.push(s));}return r}function xt(e){let t=[];return e.descendants((o,n)=>{if(o.type.name==="paragraph"){let r=o.attrs.outlineLevel,s=o.attrs.styleId,a=r;if(a==null&&s){let i=s.match(/^[Hh]eading(\d)$/);i&&(a=parseInt(i[1],10)-1);}if(a!=null&&a>=0&&a<=8){let i="";o.forEach(c=>{c.isText&&(i+=c.text||"");}),i.trim()&&t.push({text:i.trim(),level:a,pmPos:n});}}}),t}var L="rgba(255, 235, 59, 0.55)",Ft=1200,y="docx-paragraph-flash",S=new WeakMap;function Tt(e){let t=globalThis;return typeof t.CSS?.escape=="function"?t.CSS.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function bt(e){return e?.color?.trim()||L}function yt(e){let t=e?.durationMs;return t==null||!Number.isFinite(t)||t<0?1200:t}function k(e,t){if(!t||!t.trim())return [];let o=Tt(t);return Array.from(e.querySelectorAll(`.layout-paragraph[data-para-id="${o}"]`))}function W(e,t){let o=0,n=bt(t),r=yt(t);for(let s of e){o++;let a=S.get(s);a!==void 0&&clearTimeout(a),s.classList.remove(y),s.offsetWidth,s.style.setProperty("--docx-paragraph-flash-color",n),s.style.setProperty("--docx-paragraph-flash-duration",`${r}ms`),s.classList.add(y);let i=setTimeout(()=>{s.classList.remove(y),s.style.removeProperty("--docx-paragraph-flash-color"),s.style.removeProperty("--docx-paragraph-flash-duration"),S.delete(s);},r);S.set(s,i);}return o}function Ct(e,t,o){let n=k(e,t);return W(n,o)>0}function B(e,t,o){let n=0;for(let r=t;r<t+o&&r<e.length;r++)n+=e[r];return n}function At(e,t,o,n){let r=B(e,t,o),s=Math.floor(r/Math.max(n,1)),a=r-s*n,i=Array.from({length:n},(c,f)=>s+(f<a?1:0));return [...e.slice(0,t),...i,...e.slice(t+o)]}function St(e,t,o,n,r,s){let a=o-t.rowspan,i=n-t.colspan,c=r+a,f=t.row+t.rowspan,F=t.col+t.colspan,p=[];for(let l of e){if(l===t)continue;let g=l.row+l.rowspan,C=l.col+l.colspan,I=l.row<f&&g>t.row,v=l.col<F&&C>t.col;p.push({data:l.data,row:l.row>=f?l.row+a:l.row,col:l.col>=F?l.col+i:l.col,rowspan:l.rowspan+(a>0&&I&&!v?a:0),colspan:l.colspan+(i>0&&v&&!I?i:0)});}for(let l=0;l<o;l++)for(let g=0;g<n;g++){let C=l===0&&g===0;p.push({data:s(C,l,g),row:t.row+l,col:t.col+g,rowspan:1,colspan:1});}return {anchors:p,deltaRows:a,deltaCols:i,newRowCount:c}}function wt(e){let t=new Map,o=new Map;for(let n of e){t.set(`${n.row}-${n.col}`,n);for(let r=n.row;r<n.row+n.rowspan;r++)for(let s=n.col;s<n.col+n.colspan;s++)o.set(`${r}-${s}`,n);}return {byStart:t,byCoveredSlot:o}}function Et(e,t){let o=e>1||t>1;return {minRows:e,minCols:t,initialRows:e,initialCols:o?t:t+1}}var Pt=/[\p{L}\p{N}\p{M}_''\-]/u,Rt=/\s/;function w(e){return !e||e.length===0?false:Pt.test(e)}function E(e){return !e||e.length===0?false:Rt.test(e)}function m(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(E(o)){let n=t,r=t;for(;n>0&&E(e[n-1]);)n--;for(;r<e.length&&E(e[r]);)r++;return [n,r]}if(w(o)){let n=t,r=t;for(;n>0&&w(e[n-1]);)n--;for(;r<e.length&&w(e[r]);)r++;return [n,r]}return [t,t+1]}function Dt(e,t){let[o,n]=m(e,t);return e.slice(o,n)}function It(e,t){let[o,n]=m(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function D(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[s,a]=m(n,r);if(a>s)return t.setStart(o,s),t.setEnd(o,a),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=G(n);if(r.length>0){let s=t.startOffset,a=null,i=s;if(s<n.childNodes.length){let c=n.childNodes[s];if(c.nodeType===Node.TEXT_NODE)a=c,i=0;else if(c instanceof Element){let f=G(c);f.length>0&&(a=f[0],i=0);}}if(!a&&r.length>0&&(a=r[0],i=0),a){let c=a.textContent||"",[f,F]=m(c,i);if(F>f){let p=document.createRange();return p.setStart(a,f),p.setEnd(a,F),e.removeAllRanges(),e.addRange(p),true}}}}return false}function vt(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,s]=m(n,t);if(s>r){let a=document.createRange();return a.setStart(e,r),a.setEnd(e,s),o.removeAllRanges(),o.addRange(a),true}return false}function Mt(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return D();let o=t.startContainer,n=t.endContainer,r=t.startOffset,s=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let a=o.textContent||"",[i]=m(a,t.startOffset);r=i;}if(n.nodeType===Node.TEXT_NODE){let a=n.textContent||"",i=Math.max(0,t.endOffset-1),[,c]=m(a,i);s=c;}try{return t.setStart(o,r),t.setEnd(n,s),e.removeAllRanges(),e.addRange(t),!0}catch(a){return console.warn("Could not expand selection to word boundaries:",a),false}}function X(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=_t(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function _t(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function G(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var P=0,x=null,R=null,Ot=500;function U(){P=0,R=null,x&&(clearTimeout(x),x=null);}function K(e){return e.target!==R&&U(),P++,R=e.target,x&&clearTimeout(x),x=setTimeout(U,Ot),Math.min(P,3)}function Ht(){return e=>{e.ctrlKey||e.metaKey||e.altKey||D();}}function Nt(){return e=>{if(K(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;X();}}}async function Lt(e){let t=e.target;if(!t||!t.files)return null;let o=t.files[0];return t.value="",o?{buffer:await o.arrayBuffer(),name:o.name.replace(/\.docx$/i,"")}:null}var $="(prefers-color-scheme: dark)";function z(){return typeof window<"u"&&typeof window.matchMedia=="function"}function kt(){return z()?window.matchMedia($).matches:false}function Wt(e,t){return e==="dark"||e==="system"&&t}function Bt(e){if(!z())return ()=>{};let t=window.matchMedia($);e(t.matches);let o=n=>e(n.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)}var Gt=-1;function Ut(){let e=1;return {next:()=>e++,seedAbove(t){t>=e&&(e=t+1);}}}function Xt(e,t,o,n){return {id:e.next(),author:o,date:new Date().toISOString(),content:[{type:"paragraph",formatting:{},content:[{type:"run",formatting:{},content:[{type:"text",text:t}]}]}],...n!==void 0&&{parentId:n}}}var Kt=/^[a-z][a-z0-9+.-]*:/i,$t=/^(https?|mailto|tel|ftp):/i;function zt(e){if(!e)return;let t=e.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(t)return Kt.test(t)?$t.test(t)?e:void 0:e}export{L as DEFAULT_PARAGRAPH_FLASH_COLOR,Ft as DEFAULT_PARAGRAPH_FLASH_DURATION_MS,y as PARAGRAPH_FLASH_CLASS_NAME,Gt as PENDING_COMMENT_ID,wt as buildAnchorMaps,xt as collectHeadings,Et as computeSplitDialogDefaults,St as computeSplitLayout,Xt as createComment,Ut as createCommentIdAllocator,Ht as createDoubleClickWordSelector,Nt as createTripleClickParagraphSelector,ht as excludeFontsByName,Mt as expandSelectionToWordBoundaries,k as findParagraphFragmentsByParaId,It as findWordAt,m as findWordBoundaries,W as flashParagraphElements,Ct as flashParagraphFragmentsByParaId,gt as getRenderableDocumentFonts,Dt as getWordAt,K as handleClickForMultiClick,kt as prefersColorSchemeDark,Lt as readDocxFileFromInput,At as redistributeColumnWidths,Wt as resolveIsDark,zt as sanitizeHref,X as selectParagraphAtCursor,N as selectRenderableFonts,D as selectWordAtCursor,vt as selectWordInTextNode,Bt as subscribeSystemDark,B as sumColumnWidths};
|
|
1
|
+
export{d as MIN_CARD_GAP,c as SIDEBAR_DOCUMENT_SHIFT,b as SIDEBAR_PAGE_GAP,a as SIDEBAR_WIDTH}from'../chunk-YUOKI2HB.mjs';export{f as blendColors,r as colorsEqual,o as createRgbColor,n as createThemeColor,d as darkenColor,p as ensureHexPrefix,h as generateThemeTintShadeMatrix,c as getContrastingColor,g as getThemeTintShadeHex,k as isBlack,l as isWhite,e as lightenColor,m as parseColorString,a as resolveColor,b as resolveColorToHex,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'../chunk-LTVVQMHB.mjs';export{a as PIXELS_PER_INCH,e as TWIPS_PER_INCH,p as clamp,n as eighthsToPixels,b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,l as halfPointsToPoints,c as pixelsToEmu,h as pixelsToTwips,m as pointsToHalfPoints,d as pointsToPixels,o as roundPixels,j as twipsToEmu,g as twipsToPixels}from'../chunk-CTBUQRYQ.mjs';import {n,d}from'../chunk-ND3FBCB3.mjs';export{s as FONT_MAPPING,n as canRenderFont,z as createFontLoadScope,c as deobfuscateFont,C as extractEmbeddedFontFaces,x as extractFontsFromDocument,B as getEmbeddedFontFaces,A as getEmbeddedFontFamilies,t as getGoogleFontEquivalent,k as getLoadedFonts,g as isFontLoaded,i as isGoogleFontsEnabled,j as isLoading,b as isValidFontKey,y as loadDocumentFonts,E as loadEmbeddedFontFamilies,D as loadEmbeddedFonts,e as loadFont,r as loadFontDefinitions,o as loadFontFromBuffer,q as loadFontFromUrl,u as loadFontWithMapping,f as loadFonts,v as loadFontsWithMapping,m as onFontError,l as onFontsLoaded,w as preloadCommonFonts,p as registerDocumentFaces,h as setGoogleFontsEnabled,a as toArrayBuffer}from'../chunk-ND3FBCB3.mjs';import'../chunk-YLFKV2NT.mjs';import'../chunk-LT2GCWZ3.mjs';import'../chunk-HPZFJGGM.mjs';import'../chunk-2QHGQA3V.mjs';import'../chunk-3CYO46ML.mjs';import'../chunk-6CHGYCFU.mjs';import'../chunk-DLXIZBB6.mjs';import'../chunk-TTRUPDAB.mjs';function H(e){let t=new Set,o=e.package;if(o.theme&&st(o.theme,t),o.styles&&it(o.styles,t),o.document)for(let n of o.document.content)T(n,t);if(o.headers)for(let n of o.headers.values())O(n,t);if(o.footers)for(let n of o.footers.values())O(n,t);if(o.footnotes)for(let n of o.footnotes)gt(n,t);if(o.endnotes)for(let n of o.endnotes)ht(n,t);return Array.from(t).sort()}function st(e,t){let o=e.fontScheme;o&&(o.majorFont&&_(o.majorFont,t),o.minorFont&&_(o.minorFont,t));}function _(e,t){if(e.latin&&t.add(e.latin),e.ea&&t.add(e.ea),e.cs&&t.add(e.cs),e.fonts)for(let o of Object.values(e.fonts))o&&t.add(o);}function it(e,t){e.docDefaults&&(e.docDefaults.rPr&&h(e.docDefaults.rPr,t),e.docDefaults.pPr?.runProperties&&h(e.docDefaults.pPr.runProperties,t));for(let o of e.styles)o.rPr&&h(o.rPr,t),o.pPr?.runProperties&&h(o.pPr.runProperties,t);}function h(e,t){let o=e.fontFamily;o&&(o.ascii&&t.add(o.ascii),o.hAnsi&&t.add(o.hAnsi),o.eastAsia&&t.add(o.eastAsia),o.cs&&t.add(o.cs));}function lt(e,t){e.runProperties&&h(e.runProperties,t);}function T(e,t){e.type==="paragraph"?ct(e,t):e.type==="table"&&ut(e,t);}function ct(e,t){e.formatting&<(e.formatting,t);for(let o of e.content)ft(o,t);}function ft(e,t){if(e.type==="run")b(e,t);else if(e.type==="hyperlink")dt(e,t);else if(e.type==="simpleField"||e.type==="complexField"){if("content"in e)for(let o of e.content)o.type==="run"&&b(o,t);if("fieldResult"in e)for(let o of e.fieldResult)b(o,t);}}function b(e,t){e.formatting&&h(e.formatting,t);}function dt(e,t){for(let o of e.children)o.type==="run"&&b(o,t);}function ut(e,t){for(let o of e.rows)mt(o,t);}function mt(e,t){for(let o of e.cells)pt(o,t);}function pt(e,t){for(let o of e.content)T(o,t);}function O(e,t){for(let o of e.content)T(o,t);}function gt(e,t){for(let o of e.content)T(o,t);}function ht(e,t){for(let o of e.content)T(o,t);}var xt=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui"]);function L(e,t={}){let o=t.canRender??n,n$1=new Set;for(let i of t.exclude??[])n$1.add(i.trim().toLowerCase());let r=new Set;for(let i of t.embeddedFamilies??[])r.add(i.trim().toLowerCase());let s=[],a=new Set;for(let i of e){let c=i.trim(),f=c.toLowerCase();!c||xt.has(f)||n$1.has(f)||a.has(f)||!r.has(f)&&!o(c)||(a.add(f),s.push({name:c,fontFamily:d(c).cssFallback,category:"other"}));}return s}function Ft(e,t={}){return L(H(e),t)}function Tt(e,t){if(!e||e.length===0)return [];let o=new Set;for(let s of t)o.add(s.trim().toLowerCase());let n=new Set,r=[];for(let s of e){let a=s.name.trim().toLowerCase();o.has(a)||n.has(a)||(n.add(a),r.push(s));}return r}function bt(e){let t=[];return e.descendants((o,n)=>{if(o.type.name==="paragraph"){let r=o.attrs.outlineLevel,s=o.attrs.styleId,a=r;if(a==null&&s){let i=s.match(/^[Hh]eading(\d)$/);i&&(a=parseInt(i[1],10)-1);}if(a!=null&&a>=0&&a<=8){let i="";o.forEach(c=>{c.isText&&(i+=c.text||"");}),i.trim()&&t.push({text:i.trim(),level:a,pmPos:n});}}}),t}var N="rgba(255, 235, 59, 0.55)",yt=1200,y="docx-paragraph-flash",S=new WeakMap;function Ct(e){let t=globalThis;return typeof t.CSS?.escape=="function"?t.CSS.escape(e):e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function At(e){return e?.color?.trim()||N}function St(e){let t=e?.durationMs;return t==null||!Number.isFinite(t)||t<0?1200:t}function k(e,t){if(!t||!t.trim())return [];let o=Ct(t);return Array.from(e.querySelectorAll(`.layout-paragraph[data-para-id="${o}"]`))}function W(e,t){let o=0,n=At(t),r=St(t);for(let s of e){o++;let a=S.get(s);a!==void 0&&clearTimeout(a),s.classList.remove(y),s.offsetWidth,s.style.setProperty("--docx-paragraph-flash-color",n),s.style.setProperty("--docx-paragraph-flash-duration",`${r}ms`),s.classList.add(y);let i=setTimeout(()=>{s.classList.remove(y),s.style.removeProperty("--docx-paragraph-flash-color"),s.style.removeProperty("--docx-paragraph-flash-duration"),S.delete(s);},r);S.set(s,i);}return o}function Et(e,t,o){let n=k(e,t);return W(n,o)>0}function B(e,t,o){let n=0;for(let r=t;r<t+o&&r<e.length;r++)n+=e[r];return n}function wt(e,t,o,n){let r=B(e,t,o),s=Math.floor(r/Math.max(n,1)),a=r-s*n,i=Array.from({length:n},(c,f)=>s+(f<a?1:0));return [...e.slice(0,t),...i,...e.slice(t+o)]}function Pt(e,t,o,n,r,s){let a=o-t.rowspan,i=n-t.colspan,c=r+a,f=t.row+t.rowspan,F=t.col+t.colspan,p=[];for(let l of e){if(l===t)continue;let g=l.row+l.rowspan,C=l.col+l.colspan,I=l.row<f&&g>t.row,v=l.col<F&&C>t.col;p.push({data:l.data,row:l.row>=f?l.row+a:l.row,col:l.col>=F?l.col+i:l.col,rowspan:l.rowspan+(a>0&&I&&!v?a:0),colspan:l.colspan+(i>0&&v&&!I?i:0)});}for(let l=0;l<o;l++)for(let g=0;g<n;g++){let C=l===0&&g===0;p.push({data:s(C,l,g),row:t.row+l,col:t.col+g,rowspan:1,colspan:1});}return {anchors:p,deltaRows:a,deltaCols:i,newRowCount:c}}function Rt(e){let t=new Map,o=new Map;for(let n of e){t.set(`${n.row}-${n.col}`,n);for(let r=n.row;r<n.row+n.rowspan;r++)for(let s=n.col;s<n.col+n.colspan;s++)o.set(`${r}-${s}`,n);}return {byStart:t,byCoveredSlot:o}}function Dt(e,t){let o=e>1||t>1;return {minRows:e,minCols:t,initialRows:e,initialCols:o?t:t+1}}var It=/[\p{L}\p{N}\p{M}_''\-]/u,vt=/\s/;function E(e){return !e||e.length===0?false:It.test(e)}function w(e){return !e||e.length===0?false:vt.test(e)}function m(e,t){if(!e||e.length===0)return [0,0];t=Math.max(0,Math.min(t,e.length-1));let o=e[t];if(w(o)){let n=t,r=t;for(;n>0&&w(e[n-1]);)n--;for(;r<e.length&&w(e[r]);)r++;return [n,r]}if(E(o)){let n=t,r=t;for(;n>0&&E(e[n-1]);)n--;for(;r<e.length&&E(e[r]);)r++;return [n,r]}return [t,t+1]}function Mt(e,t){let[o,n]=m(e,t);return e.slice(o,n)}function _t(e,t){let[o,n]=m(e,t);return {word:e.slice(o,n),startIndex:o,endIndex:n}}function D(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0),o=t.startContainer;if(o.nodeType===Node.TEXT_NODE){let n=o.textContent||"",r=t.startOffset,[s,a]=m(n,r);if(a>s)return t.setStart(o,s),t.setEnd(o,a),e.removeAllRanges(),e.addRange(t),true}if(o.nodeType===Node.ELEMENT_NODE){let n=o,r=G(n);if(r.length>0){let s=t.startOffset,a=null,i=s;if(s<n.childNodes.length){let c=n.childNodes[s];if(c.nodeType===Node.TEXT_NODE)a=c,i=0;else if(c instanceof Element){let f=G(c);f.length>0&&(a=f[0],i=0);}}if(!a&&r.length>0&&(a=r[0],i=0),a){let c=a.textContent||"",[f,F]=m(c,i);if(F>f){let p=document.createRange();return p.setStart(a,f),p.setEnd(a,F),e.removeAllRanges(),e.addRange(p),true}}}}return false}function Ot(e,t){let o=window.getSelection();if(!o)return false;let n=e.textContent||"",[r,s]=m(n,t);if(s>r){let a=document.createRange();return a.setStart(e,r),a.setEnd(e,s),o.removeAllRanges(),o.addRange(a),true}return false}function Ht(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let t=e.getRangeAt(0);if(t.collapsed)return D();let o=t.startContainer,n=t.endContainer,r=t.startOffset,s=t.endOffset;if(o.nodeType===Node.TEXT_NODE){let a=o.textContent||"",[i]=m(a,t.startOffset);r=i;}if(n.nodeType===Node.TEXT_NODE){let a=n.textContent||"",i=Math.max(0,t.endOffset-1),[,c]=m(a,i);s=c;}try{return t.setStart(o,r),t.setEnd(n,s),e.removeAllRanges(),e.addRange(t),!0}catch(a){return console.warn("Could not expand selection to word boundaries:",a),false}}function X(){let e=window.getSelection();if(!e||e.rangeCount===0)return false;let o=e.getRangeAt(0).commonAncestorContainer,n=Lt(o);if(n){let r=document.createRange();return r.selectNodeContents(n),e.removeAllRanges(),e.addRange(r),true}return false}function Lt(e){if(!e)return null;let t=e;for(;t;){if(t instanceof Element&&t.hasAttribute("data-paragraph-index"))return t;t=t.parentNode;}return null}function G(e){let t=[],o=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,null),n;for(;n=o.nextNode();)n.nodeType===Node.TEXT_NODE&&t.push(n);return t}var P=0,x=null,R=null,Nt=500;function U(){P=0,R=null,x&&(clearTimeout(x),x=null);}function K(e){return e.target!==R&&U(),P++,R=e.target,x&&clearTimeout(x),x=setTimeout(U,Nt),Math.min(P,3)}function kt(){return e=>{e.ctrlKey||e.metaKey||e.altKey||D();}}function Wt(){return e=>{if(K(e)===3){if(e.ctrlKey||e.metaKey||e.altKey)return;X();}}}async function Bt(e){let t=e.target;if(!t||!t.files)return null;let o=t.files[0];return t.value="",o?{buffer:await o.arrayBuffer(),name:o.name.replace(/\.docx$/i,"")}:null}var $="(prefers-color-scheme: dark)";function z(){return typeof window<"u"&&typeof window.matchMedia=="function"}function Gt(){return z()?window.matchMedia($).matches:false}function Ut(e,t){return e==="dark"||e==="system"&&t}function Xt(e){if(!z())return ()=>{};let t=window.matchMedia($);e(t.matches);let o=n=>e(n.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)}var Kt=-1;function $t(){let e=1;return {next:()=>e++,seedAbove(t){t>=e&&(e=t+1);}}}function zt(e,t,o,n){return {id:e.next(),author:o,date:new Date().toISOString(),content:[{type:"paragraph",formatting:{},content:[{type:"run",formatting:{},content:[{type:"text",text:t}]}]}],...n!==void 0&&{parentId:n}}}var jt=/^[a-z][a-z0-9+.-]*:/i,qt=/^(https?|mailto|tel|ftp):/i;function Qt(e){if(!e)return;let t=e.replace(/[\t\n\r]/g,"").replace(/^[\x00-\x20]+/,"");if(t)return jt.test(t)?qt.test(t)?e:void 0:e}export{N as DEFAULT_PARAGRAPH_FLASH_COLOR,yt as DEFAULT_PARAGRAPH_FLASH_DURATION_MS,y as PARAGRAPH_FLASH_CLASS_NAME,Kt as PENDING_COMMENT_ID,Rt as buildAnchorMaps,bt as collectHeadings,Dt as computeSplitDialogDefaults,Pt as computeSplitLayout,zt as createComment,$t as createCommentIdAllocator,kt as createDoubleClickWordSelector,Wt as createTripleClickParagraphSelector,Tt as excludeFontsByName,Ht as expandSelectionToWordBoundaries,k as findParagraphFragmentsByParaId,_t as findWordAt,m as findWordBoundaries,W as flashParagraphElements,Et as flashParagraphFragmentsByParaId,Ft as getRenderableDocumentFonts,Mt as getWordAt,K as handleClickForMultiClick,Gt as prefersColorSchemeDark,Bt as readDocxFileFromInput,wt as redistributeColumnWidths,Ut as resolveIsDark,Qt as sanitizeHref,X as selectParagraphAtCursor,L as selectRenderableFonts,D as selectWordAtCursor,Ot as selectWordInTextNode,Xt as subscribeSystemDark,B as sumColumnWidths};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-HPZFJGGM.mjs';export{a as preloadOpcWasm,c as rezipContainer,b as unzipContainer}from'./chunk-2QHGQA3V.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{p as buildDisplayListJson,t as clearMeasureFonts,g as closeDisplayList,d as hasDisplayListSession,i as hasDisplayListUpdate,e as hasRangeRectsRegion,j as hitTestRegionsByHandle,b as hitTestRegionsJson,q as layoutDocumentJson,u as measureParagraphJson,f as openDisplayList,v as outlineGlyphJson,a as preloadLayoutWasm,m as rangeRectsByHandle,c as rangeRectsJson,o as rangeRectsRegionByHandle,n as rangeRectsRegionJson,r as registerMeasureFont,s as registerSubstituteMeasureFont,h as updateDisplayList,l as verticalMoveByHandle,k as verticalMoveJson}from'./chunk-
|
|
1
|
+
export{p as buildDisplayListJson,t as clearMeasureFonts,g as closeDisplayList,d as hasDisplayListSession,i as hasDisplayListUpdate,e as hasRangeRectsRegion,j as hitTestRegionsByHandle,b as hitTestRegionsJson,q as layoutDocumentJson,u as measureParagraphJson,f as openDisplayList,v as outlineGlyphJson,a as preloadLayoutWasm,m as rangeRectsByHandle,c as rangeRectsJson,o as rangeRectsRegionByHandle,n as rangeRectsRegionJson,r as registerMeasureFont,s as registerSubstituteMeasureFont,h as updateDisplayList,l as verticalMoveByHandle,k as verticalMoveJson}from'./chunk-OK5UFGX3.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import'./chunk-EUUIJVM6.mjs';export{c as createEditSession,e as exportDocxMarkdownJson,d as exportDocxStructuredJson,h as findDocxContentControlsJson,g as listDocxContentControlsJson,a as preloadEditWasm,f as renderDocxMarkdownJson,i as renderDocxMarkdownWithPagesJson,b as setEditWasmHeapLimit}from'./chunk-L2ML3DDI.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
|
package/dist/wasm-edit.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { W as WasmAsyncInput } from './loadWasmAsset-
|
|
1
|
+
import { W as WasmAsyncInput } from './loadWasmAsset-Cr95TImt.mjs';
|
|
2
2
|
|
|
3
3
|
/* tslint:disable */
|
|
4
4
|
/* eslint-disable */
|
|
@@ -44,23 +44,27 @@ declare class EditSession {
|
|
|
44
44
|
*/
|
|
45
45
|
add_undo_boundary(): void;
|
|
46
46
|
/**
|
|
47
|
-
* Deletes
|
|
48
|
-
* the resulting binary `FrameDelta`.
|
|
49
|
-
* `"forward"`; a surrogate pair is removed
|
|
50
|
-
*
|
|
47
|
+
* Deletes up to `count` characters at this session's collapsed selection,
|
|
48
|
+
* lays out once, and returns the resulting binary `FrameDelta`.
|
|
49
|
+
* `direction` is `"backward"` or `"forward"`; a surrogate pair is removed
|
|
50
|
+
* whole. At a paragraph boundary a deletion merges with the neighbouring
|
|
51
|
+
* paragraph instead. Deleting stops early at the document start or end,
|
|
52
|
+
* before a second paragraph merge, or at a paragraph the resident state
|
|
53
|
+
* cannot absorb; [`EditSession::resident_deleted_units`] reports how many
|
|
54
|
+
* were removed.
|
|
51
55
|
*
|
|
52
|
-
* Errors on an unknown `direction`,
|
|
53
|
-
* non-negative safe integer, under the
|
|
54
|
-
* conditions as [`EditSession::apply_input`],
|
|
55
|
-
* character to delete in that direction
|
|
56
|
+
* Errors on an unknown `direction`, a zero `count`, when
|
|
57
|
+
* `expected_frame_epoch` is not a non-negative safe integer, under the
|
|
58
|
+
* same selection and readiness conditions as [`EditSession::apply_input`],
|
|
59
|
+
* and when there is no character to delete in that direction.
|
|
56
60
|
*/
|
|
57
|
-
apply_delete(direction: string, expected_frame_epoch: number): Uint8Array;
|
|
61
|
+
apply_delete(direction: string, expected_frame_epoch: number, count: number): Uint8Array;
|
|
58
62
|
/**
|
|
59
63
|
* Instrumented twin of [`EditSession::apply_delete`]: identical arguments,
|
|
60
64
|
* result and error contract, but it also records stage timings for
|
|
61
65
|
* [`EditSession::apply_input_profile_json`].
|
|
62
66
|
*/
|
|
63
|
-
apply_delete_profiled(direction: string, expected_frame_epoch: number): Uint8Array;
|
|
67
|
+
apply_delete_profiled(direction: string, expected_frame_epoch: number, count: number): Uint8Array;
|
|
64
68
|
/**
|
|
65
69
|
* Applies an edit batch all-or-nothing:
|
|
66
70
|
* `{"ok":true,"baseVersion","version","applied","source","changedStories",
|
|
@@ -156,11 +160,22 @@ declare class EditSession {
|
|
|
156
160
|
* Starts a new opening of the document; see [`EditingDoc::begin_opening`].
|
|
157
161
|
*/
|
|
158
162
|
begin_opening(generation?: string | null): void;
|
|
163
|
+
/**
|
|
164
|
+
* Begins `layout_document_with_regions_retained_json` as a pass measured a
|
|
165
|
+
* step at a time; see `EngineSession::begin_region_layout`. Returns the
|
|
166
|
+
* progress JSON, with `layoutJson` once the pass is complete.
|
|
167
|
+
*/
|
|
168
|
+
begin_region_layout(input: string): string;
|
|
169
|
+
/**
|
|
170
|
+
* Until the matching `end_shared_reads`, committed reads share story projections of each document state.
|
|
171
|
+
*/
|
|
172
|
+
begin_shared_reads(): void;
|
|
159
173
|
/**
|
|
160
174
|
* Display-only input JSON in, one binary `FrameDelta` v1 out (exposed as
|
|
161
175
|
* a transferable `Uint8Array`). `expected_frame_epoch` is the epoch of the
|
|
162
176
|
* frame the caller currently holds; pass `0` for the first frame. A
|
|
163
|
-
* mismatch makes the engine emit a full frame instead of a delta
|
|
177
|
+
* mismatch makes the engine emit a full frame instead of a delta, and the
|
|
178
|
+
* returned frame's epoch is always greater than `expected_frame_epoch`. Errors
|
|
164
179
|
* unless the epoch is a non-negative safe integer, and on build failure.
|
|
165
180
|
*/
|
|
166
181
|
build_display_list_frame(input: string, expected_frame_epoch: number): Uint8Array;
|
|
@@ -169,6 +184,12 @@ declare class EditSession {
|
|
|
169
184
|
* against the same resident font store this session measures with.
|
|
170
185
|
*/
|
|
171
186
|
build_display_list_json(input: string): string;
|
|
187
|
+
/**
|
|
188
|
+
* Build the listed pages that are still unbuilt and return a FrameDelta
|
|
189
|
+
* v1 carrying them; `expected_frame_epoch` works as for
|
|
190
|
+
* [`Self::build_display_list_frame`].
|
|
191
|
+
*/
|
|
192
|
+
build_display_pages_frame(pages: Uint32Array, expected_frame_epoch: number): Uint8Array;
|
|
172
193
|
/**
|
|
173
194
|
* Whether [`EditSession::redo`] would reapply something.
|
|
174
195
|
*/
|
|
@@ -343,6 +364,10 @@ declare class EditSession {
|
|
|
343
364
|
* with [`EditSession::resolve_encoded_selection`].
|
|
344
365
|
*/
|
|
345
366
|
encoded_selection(): string;
|
|
367
|
+
/**
|
|
368
|
+
* Ends a shared-read scope, dropping shared story projections when the last scope ends.
|
|
369
|
+
*/
|
|
370
|
+
end_shared_reads(): void;
|
|
346
371
|
/**
|
|
347
372
|
* [`EditSession::export_structured_json`] rendered as Markdown from the same read:
|
|
348
373
|
* `{"ok":true,"version","content":{"markdown","anchors","diagnostics","truncated"}}`.
|
|
@@ -353,7 +378,7 @@ declare class EditSession {
|
|
|
353
378
|
* snapshot. `fonts` holds the font files back to back, `font_lengths` their byte lengths;
|
|
354
379
|
* `request` is a region layout request whose font chains name fonts by their index. The
|
|
355
380
|
* reply is `{"ok":true,"content"}` or `{"ok":false,"failure"}`; a rejected font or an
|
|
356
|
-
* unusable request throws. The
|
|
381
|
+
* unusable request throws. The session's measurement fonts are left untouched.
|
|
357
382
|
*/
|
|
358
383
|
export_snapshot_with_private_fonts_json(fonts: Uint8Array, font_lengths: Uint32Array, request: string, options: string): string;
|
|
359
384
|
/**
|
|
@@ -425,6 +450,10 @@ declare class EditSession {
|
|
|
425
450
|
* Returns `{"ok":true,"version"}` or a refusal.
|
|
426
451
|
*/
|
|
427
452
|
format_text_target_json(target_json: string, delta_json: string): string;
|
|
453
|
+
/**
|
|
454
|
+
* Whether the document has a story with this id.
|
|
455
|
+
*/
|
|
456
|
+
has_story(story: string): boolean;
|
|
428
457
|
/**
|
|
429
458
|
* The headings of `story` in document order, classified as the structured export
|
|
430
459
|
* classifies them: `[{"paraId","heading":{"outlineLevel","source"}}]`.
|
|
@@ -495,6 +524,16 @@ declare class EditSession {
|
|
|
495
524
|
* with no host-side layout mutation. Retains the pass for resident edits.
|
|
496
525
|
*/
|
|
497
526
|
layout_document_with_regions_json(input: string): string;
|
|
527
|
+
/**
|
|
528
|
+
* The retained region layout of the first `pages` pages only; see
|
|
529
|
+
* `EngineSession::layout_document_with_regions_prefix_retained_json`.
|
|
530
|
+
*/
|
|
531
|
+
layout_document_with_regions_prefix_retained_json(input: string, pages: number): string;
|
|
532
|
+
/**
|
|
533
|
+
* [`Self::layout_document_with_regions_retained_json`] without the reply,
|
|
534
|
+
* for a caller that reads only the retained state.
|
|
535
|
+
*/
|
|
536
|
+
layout_document_with_regions_retained(input: string): void;
|
|
498
537
|
/**
|
|
499
538
|
* Same full region pass as [`Self::layout_document_with_regions_json`],
|
|
500
539
|
* but the reply carries only `{ layout, headersFooters?, notesConverged }`
|
|
@@ -550,6 +589,11 @@ declare class EditSession {
|
|
|
550
589
|
* [`EditingDoc::begin_opening`].
|
|
551
590
|
*/
|
|
552
591
|
load_json(stories_json: string): string;
|
|
592
|
+
/**
|
|
593
|
+
* Lays this replica's `data:` image sources out as the `media:{n}` tokens
|
|
594
|
+
* another replica seeded them from.
|
|
595
|
+
*/
|
|
596
|
+
load_media_sources(json: string): void;
|
|
553
597
|
/**
|
|
554
598
|
* `{"start","end"}` — the paragraph's span in story-global UTF-16 units.
|
|
555
599
|
* `end` is the index of its own pilcrow, so `end - start` is the
|
|
@@ -571,6 +615,26 @@ declare class EditSession {
|
|
|
571
615
|
* the engine's message for input it cannot measure.
|
|
572
616
|
*/
|
|
573
617
|
measure_paragraph_json(input: string): string;
|
|
618
|
+
/**
|
|
619
|
+
* The bytes a `media:{n}` image source displays, as the part's
|
|
620
|
+
* [`EditSession::media_type`]; `undefined` for any other source or a
|
|
621
|
+
* part that cannot be read.
|
|
622
|
+
*/
|
|
623
|
+
media_bytes(token: string): Uint8Array | undefined;
|
|
624
|
+
/**
|
|
625
|
+
* The `data:` URL a `media:{n}` image source stands for.
|
|
626
|
+
*/
|
|
627
|
+
media_data_url(token: string): string | undefined;
|
|
628
|
+
/**
|
|
629
|
+
* The digests mapping the `data:` URLs this replica seeded to
|
|
630
|
+
* `media:{n}` tokens, for [`EditSession::load_media_sources`]; empty
|
|
631
|
+
* when it seeded none.
|
|
632
|
+
*/
|
|
633
|
+
media_sources_json(): string;
|
|
634
|
+
/**
|
|
635
|
+
* The media type of [`EditSession::media_bytes`].
|
|
636
|
+
*/
|
|
637
|
+
media_type(token: string): string | undefined;
|
|
574
638
|
/**
|
|
575
639
|
* Merges the rectangle the [`TableRange`] `range_json` covers into its
|
|
576
640
|
* top-left cell, whose story survives; the other cells' stories are
|
|
@@ -600,15 +664,29 @@ declare class EditSession {
|
|
|
600
664
|
* Seeding starts a new opening, with `generation` or a fresh one, so its
|
|
601
665
|
* session anchors are its own; see [`EditingDoc::begin_opening`].
|
|
602
666
|
*
|
|
603
|
-
* Returns `{"envelope","referencedFonts":[string, …]}
|
|
667
|
+
* Returns `{"envelope","referencedFonts":[string, …],"unusedScriptFonts":[string, …]}`:
|
|
668
|
+
* `unusedScriptFonts` are the referenced fonts a seeded package names only
|
|
669
|
+
* for East Asian or complex-script text it does not contain. The envelope is
|
|
604
670
|
* the parsed package with the parts the host does not need stripped —
|
|
605
671
|
* body content, header/footer and note content, numbering, media and
|
|
606
672
|
* charts are emptied, section entries keep only their properties — so
|
|
607
673
|
* styles, theme, settings, fonts and relationships still cross while the
|
|
608
674
|
* bulk of the document stays in Rust. Errors on bytes that are not a
|
|
609
675
|
* readable DOCX.
|
|
676
|
+
* `digest`, when given, must be the SHA-256 of `bytes` in lowercase hex,
|
|
677
|
+
* as a host that hashed them off this thread already knows it.
|
|
678
|
+
*/
|
|
679
|
+
open_docx(bytes: Uint8Array, seed_stories: boolean, generation?: string | null, digest?: string | null): string;
|
|
680
|
+
/**
|
|
681
|
+
* Opens `bytes` for display only, seeded from the body's first `blocks`
|
|
682
|
+
* blocks (see `seed::seed_docx_preview`): the reply is the host metadata
|
|
683
|
+
* of that parse, as [`EditSession::open_docx`] replies, with the
|
|
684
|
+
* `unusedScriptFonts` of its cut. The session keeps no source package, so
|
|
685
|
+
* it cannot save.
|
|
686
|
+
* Opens nothing and replies with nothing for a document the preview
|
|
687
|
+
* refuses, which opens with [`EditSession::open_docx`] instead.
|
|
610
688
|
*/
|
|
611
|
-
|
|
689
|
+
open_docx_preview(bytes: Uint8Array, blocks: number): string | undefined;
|
|
612
690
|
/**
|
|
613
691
|
* One glyph outline from this session's resident font store:
|
|
614
692
|
* `{"upem":n,"cmds":[{"t":"M"|"L"|"Q"|"C"|"Z", …}]}` — commands in font
|
|
@@ -701,9 +779,14 @@ declare class EditSession {
|
|
|
701
779
|
* Replaces `[start, end)` with `text` in one transaction. The inserted
|
|
702
780
|
* text adopts the first replaced unit's formatting; in suggesting mode
|
|
703
781
|
* the deletion and the insertion share one revision id. Receipt:
|
|
704
|
-
* `{"revisionId": string|null}`.
|
|
782
|
+
* `{"revisionId": string|null, "range": {"story", "start": {"paraId", "offset"}, "end": {"paraId", "offset"}}}`.
|
|
705
783
|
*/
|
|
706
784
|
replace_range(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, text: string, author_name?: string | null, author_date?: string | null): string;
|
|
785
|
+
/**
|
|
786
|
+
* Makes the next display frame a full one whatever epoch its caller
|
|
787
|
+
* passes, for a host that switches to this engine from another.
|
|
788
|
+
*/
|
|
789
|
+
reset_frame_base(): void;
|
|
707
790
|
/**
|
|
708
791
|
* `{"frameEpoch", "caretRect": {…}|null}` for the session's own collapsed
|
|
709
792
|
* body selection. `caretRect` is null whenever there is no selection, the
|
|
@@ -711,6 +794,10 @@ declare class EditSession {
|
|
|
711
794
|
* geometry for it. `frameEpoch` identifies the frame the rect belongs to.
|
|
712
795
|
*/
|
|
713
796
|
resident_caret_snapshot_json(): string;
|
|
797
|
+
/**
|
|
798
|
+
* Characters the last [`EditSession::apply_delete`] removed.
|
|
799
|
+
*/
|
|
800
|
+
resident_deleted_units(): number;
|
|
714
801
|
/**
|
|
715
802
|
* Where a comment's sticky anchors currently sit:
|
|
716
803
|
* `[{"story","start","end"}, …]`, one entry per anchored range, in
|
|
@@ -740,6 +827,15 @@ declare class EditSession {
|
|
|
740
827
|
* or the position no longer resolves in `story`.
|
|
741
828
|
*/
|
|
742
829
|
resolve_sticky_position(story: string, position: Uint8Array): string;
|
|
830
|
+
/**
|
|
831
|
+
* Measures up to `blocks` more body blocks of the begun pass; see
|
|
832
|
+
* `EngineSession::resume_region_layout`.
|
|
833
|
+
*/
|
|
834
|
+
resume_region_layout(blocks: number): string;
|
|
835
|
+
/**
|
|
836
|
+
* The retained region layout's `headersFooters` JSON, when it has any.
|
|
837
|
+
*/
|
|
838
|
+
retained_headers_footers_json(): string | undefined;
|
|
743
839
|
/**
|
|
744
840
|
* Retained `{ measured, options }` for the main-thread display-list
|
|
745
841
|
* fallback after a retained-only region layout.
|
|
@@ -750,6 +846,10 @@ declare class EditSession {
|
|
|
750
846
|
* [`EditSession::open_docx`] with seeding always on.
|
|
751
847
|
*/
|
|
752
848
|
seed_from_docx(bytes: Uint8Array, generation?: string | null): string;
|
|
849
|
+
/**
|
|
850
|
+
* Unions seeded opaque sequence names into document state.
|
|
851
|
+
*/
|
|
852
|
+
seed_opaque_sequences(names_json: string): void;
|
|
753
853
|
/**
|
|
754
854
|
* Selects a story, closing capture unless manual grouping is selected.
|
|
755
855
|
*/
|
|
@@ -847,6 +947,16 @@ declare class EditSession {
|
|
|
847
947
|
* position holds no embed.
|
|
848
948
|
*/
|
|
849
949
|
set_content_control_value_at(story: string, para_id: string, offset: number, value_json: string): void;
|
|
950
|
+
/**
|
|
951
|
+
* Keep every previously built page while windowed builds are on.
|
|
952
|
+
*/
|
|
953
|
+
set_display_retain_built_pages(retain: boolean): void;
|
|
954
|
+
/**
|
|
955
|
+
* Limit full display builds to pages `start..end` plus the pages already
|
|
956
|
+
* built; the others stay unbuilt placeholders carrying their geometry
|
|
957
|
+
* until [`Self::build_display_pages_frame`] builds them.
|
|
958
|
+
*/
|
|
959
|
+
set_display_window(start: number, end: number): void;
|
|
850
960
|
/**
|
|
851
961
|
* Sets or clears the hyperlink attribute over `[start, end)`.
|
|
852
962
|
* `hyperlink_json` is `{"href", "tooltip"?, "rId"?}` or `null` to unlink.
|
|
@@ -871,6 +981,12 @@ declare class EditSession {
|
|
|
871
981
|
* Errors when that position holds no image.
|
|
872
982
|
*/
|
|
873
983
|
set_image_geometry_at(story: string, para_id: string, offset: number, geometry_json: string): void;
|
|
984
|
+
/**
|
|
985
|
+
* Whether [`EditSession::open_docx`] seeds images as `media:{n}` tokens,
|
|
986
|
+
* which only a replica opened from the same package resolves, instead of
|
|
987
|
+
* `data:` URLs. Off by default.
|
|
988
|
+
*/
|
|
989
|
+
set_media_tokens(enabled: boolean): void;
|
|
874
990
|
/**
|
|
875
991
|
* Sets one paragraph property to any JSON value on `para_id`'s pilcrow,
|
|
876
992
|
* searching every story. Unlike
|
|
@@ -896,6 +1012,11 @@ declare class EditSession {
|
|
|
896
1012
|
* identity such as `paraId`.
|
|
897
1013
|
*/
|
|
898
1014
|
set_paragraph_attrs(story: string, start_para: string, start_offset: number, end_para: string, end_offset: number, attrs_json: string, author_name?: string | null, author_date?: string | null): void;
|
|
1015
|
+
/**
|
|
1016
|
+
* Marks whether the session's document is part of a package, as a
|
|
1017
|
+
* replica of a preview is: its layouts render NUMPAGES empty.
|
|
1018
|
+
*/
|
|
1019
|
+
set_partial_document(partial: boolean): void;
|
|
899
1020
|
/**
|
|
900
1021
|
* Stores this peer's anchor and head as sticky positions, replacing any
|
|
901
1022
|
* previous selection. Both endpoints must lie in `story`. The positions
|
|
@@ -923,6 +1044,16 @@ declare class EditSession {
|
|
|
923
1044
|
* a second call replaces the first, and a throwing callback is ignored.
|
|
924
1045
|
*/
|
|
925
1046
|
set_update_observer(callback: Function): void;
|
|
1047
|
+
/**
|
|
1048
|
+
* Limit incremental rebuilds to the display window and caret pages. Off by default.
|
|
1049
|
+
*/
|
|
1050
|
+
set_windowed_incremental_builds(enabled: boolean): void;
|
|
1051
|
+
/**
|
|
1052
|
+
* Resolves tracked changes by revision id outside undo history:
|
|
1053
|
+
* `{"accept":[string, …],"reject":[string, …]}` -> `{"revisionIds":[string, …]}`, the ids
|
|
1054
|
+
* resolved. An id that matches nothing is skipped. See [`EditingDoc::settle_revisions`].
|
|
1055
|
+
*/
|
|
1056
|
+
settle_revisions_json(request: string): string;
|
|
926
1057
|
/**
|
|
927
1058
|
* Splits the cell `at_json` ([`CellLoc`]) covers into a `rows` x
|
|
928
1059
|
* `columns` grid; the original story stays in the top-left slot and every
|
|
@@ -948,6 +1079,11 @@ declare class EditSession {
|
|
|
948
1079
|
* callback. Idempotent while observation is running.
|
|
949
1080
|
*/
|
|
950
1081
|
start_update_event_observation(): void;
|
|
1082
|
+
/**
|
|
1083
|
+
* `{"revision","stories":[…]}`: the current story revision and the sorted
|
|
1084
|
+
* ids of the stories created, edited, or deleted after revision `since`.
|
|
1085
|
+
*/
|
|
1086
|
+
stories_changed_since(since: number): string;
|
|
951
1087
|
/**
|
|
952
1088
|
* The story's `canonical-stream-v1` FNV-1a checksum (see
|
|
953
1089
|
* [`crate::canonical`]) as a DECIMAL STRING, because a u64 exceeds the
|
|
@@ -971,6 +1107,17 @@ declare class EditSession {
|
|
|
971
1107
|
* array of strings or `null` in document order. Errors on an unknown story.
|
|
972
1108
|
*/
|
|
973
1109
|
story_paragraph_ids(story: string): string;
|
|
1110
|
+
/**
|
|
1111
|
+
* `story_segments` split after each pilcrow into units, as one hex digest
|
|
1112
|
+
* per unit: `["digest", …]`. Equal digests mean equal segments.
|
|
1113
|
+
*/
|
|
1114
|
+
story_segment_unit_digests(story: string): string;
|
|
1115
|
+
/**
|
|
1116
|
+
* The segments of the listed units (indices into
|
|
1117
|
+
* `story_segment_unit_digests`), each as `story_segments` gives them:
|
|
1118
|
+
* `[[segment, …], …]`. Errors on an index past the last unit.
|
|
1119
|
+
*/
|
|
1120
|
+
story_segment_units(story: string, units: Uint32Array): string;
|
|
974
1121
|
/**
|
|
975
1122
|
* The story as an ordered run of formatted segments — the same view
|
|
976
1123
|
* lowering reads:
|
|
@@ -985,6 +1132,12 @@ declare class EditSession {
|
|
|
985
1132
|
* tracked-change stamps. Errors on an unknown story.
|
|
986
1133
|
*/
|
|
987
1134
|
story_segments(story: string): string;
|
|
1135
|
+
/**
|
|
1136
|
+
* The `payload` of the story's `table_index`-th table embed, as
|
|
1137
|
+
* `story_segments` gives it, or `None` when the story has no such
|
|
1138
|
+
* table. Errors on an unknown story.
|
|
1139
|
+
*/
|
|
1140
|
+
table_payload(story: string, table_index: number): string | undefined;
|
|
988
1141
|
/**
|
|
989
1142
|
* Applies one run mark over `[start, end)`. `mark_json`:
|
|
990
1143
|
* `{"type":"bold"|"italic"|"underline"|"strike"|"superscript"|"subscript"} |
|
|
@@ -1035,7 +1188,8 @@ declare class EditSession {
|
|
|
1035
1188
|
* `{"themeColors":{slot: hex},"defaultTabStopTwips":number|null,
|
|
1036
1189
|
* "pageContentHeight":number|null,"numericIds":{yrsId: number},
|
|
1037
1190
|
* "tocStyleIds":[styleId],"showHiddenText":bool,
|
|
1038
|
-
* "defaultParagraphStyleId":string
|
|
1191
|
+
* "defaultParagraphStyleId":string,
|
|
1192
|
+
* "revisionPreview":{revisionId: "accepted"|"rejected"}}`, all
|
|
1039
1193
|
* optional. Errors when the story does not end in a pilcrow, holds a
|
|
1040
1194
|
* malformed table, references itself through a cell story, or contains an
|
|
1041
1195
|
* embed lowering does not support.
|
|
@@ -1057,6 +1211,11 @@ declare class EditSession {
|
|
|
1057
1211
|
|
|
1058
1212
|
/** Load + instantiate the editing-core wasm (browser path). Idempotent. */
|
|
1059
1213
|
declare function preloadEditWasm(input?: WasmAsyncInput): Promise<void>;
|
|
1214
|
+
/**
|
|
1215
|
+
* Caps the bytes the editing core in this thread may allocate at once; an
|
|
1216
|
+
* allocation past the cap fails as if the memory were full. Undefined removes it.
|
|
1217
|
+
*/
|
|
1218
|
+
declare function setEditWasmHeapLimit(bytes: number | undefined): void;
|
|
1060
1219
|
/**
|
|
1061
1220
|
* Constructs a raw wasm `EditSession` replica after ensuring the module is
|
|
1062
1221
|
* initialized. The `src/yrs/` facade wraps this in the typed `YrsSession`
|
|
@@ -1076,4 +1235,4 @@ declare function findDocxContentControlsJson(bytes: Uint8Array, query: string, o
|
|
|
1076
1235
|
/** Markdown rendering of a paged export's JSON, with optional page markers. */
|
|
1077
1236
|
declare function renderDocxMarkdownWithPagesJson(content: string, options: string): string;
|
|
1078
1237
|
|
|
1079
|
-
export { EditSession, createEditSession, exportDocxMarkdownJson, exportDocxStructuredJson, findDocxContentControlsJson, listDocxContentControlsJson, preloadEditWasm, renderDocxMarkdownJson, renderDocxMarkdownWithPagesJson };
|
|
1238
|
+
export { EditSession, createEditSession, exportDocxMarkdownJson, exportDocxStructuredJson, findDocxContentControlsJson, listDocxContentControlsJson, preloadEditWasm, renderDocxMarkdownJson, renderDocxMarkdownWithPagesJson, setEditWasmHeapLimit };
|
package/dist/wasm-edit.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{c as createEditSession,e as exportDocxMarkdownJson,d as exportDocxStructuredJson,h as findDocxContentControlsJson,g as listDocxContentControlsJson,a as preloadEditWasm,f as renderDocxMarkdownJson,i as renderDocxMarkdownWithPagesJson,b as setEditWasmHeapLimit}from'./chunk-L2ML3DDI.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
|
package/dist/wasm-layout.d.mts
CHANGED
package/dist/wasm-layout.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{p as buildDisplayListJson,t as clearMeasureFonts,g as closeDisplayList,d as hasDisplayListSession,i as hasDisplayListUpdate,e as hasRangeRectsRegion,j as hitTestRegionsByHandle,b as hitTestRegionsJson,q as layoutDocumentJson,u as measureParagraphJson,f as openDisplayList,v as outlineGlyphJson,a as preloadLayoutWasm,m as rangeRectsByHandle,c as rangeRectsJson,o as rangeRectsRegionByHandle,n as rangeRectsRegionJson,r as registerMeasureFont,s as registerSubstituteMeasureFont,h as updateDisplayList,l as verticalMoveByHandle,k as verticalMoveJson}from'./chunk-
|
|
1
|
+
export{p as buildDisplayListJson,t as clearMeasureFonts,g as closeDisplayList,d as hasDisplayListSession,i as hasDisplayListUpdate,e as hasRangeRectsRegion,j as hitTestRegionsByHandle,b as hitTestRegionsJson,q as layoutDocumentJson,u as measureParagraphJson,f as openDisplayList,v as outlineGlyphJson,a as preloadLayoutWasm,m as rangeRectsByHandle,c as rangeRectsJson,o as rangeRectsRegionByHandle,n as rangeRectsRegionJson,r as registerMeasureFont,s as registerSubstituteMeasureFont,h as updateDisplayList,l as verticalMoveByHandle,k as verticalMoveJson}from'./chunk-OK5UFGX3.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
|
package/dist/wasm-opc.d.mts
CHANGED
package/dist/wasm-opc.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as preloadOpcWasm,c as rezipContainer,b as unzipContainer}from'./chunk-
|
|
1
|
+
export{a as preloadOpcWasm,c as rezipContainer,b as unzipContainer}from'./chunk-2QHGQA3V.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
|
package/dist/wasm-parse.d.mts
CHANGED
package/dist/wasm-parse.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{h as decodeTiffImage,b as parseDocxS9Wire,c as parseRelationshipsXmlWire,a as preloadParseWasm,d as serializeDocxS10Wire,e as serializeDocxS11Wire,f as serializeDocxS12Wire,g as writeDocxS13Wire}from'./chunk-
|
|
1
|
+
export{h as decodeTiffImage,b as parseDocxS9Wire,c as parseRelationshipsXmlWire,a as preloadParseWasm,d as serializeDocxS10Wire,e as serializeDocxS11Wire,f as serializeDocxS12Wire,g as writeDocxS13Wire}from'./chunk-3CYO46ML.mjs';import'./chunk-6CHGYCFU.mjs';import'./chunk-TTRUPDAB.mjs';
|
package/dist/yrs/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import '../formatting-gqLFeJ9X.mjs';
|
|
2
2
|
import '../types/document.mjs';
|
|
3
|
-
export { w as CreateYrsSessionOptions, D as
|
|
4
|
-
export { o as DocxAnchor, p as DocxAnchorScope,
|
|
3
|
+
export { w as CreateYrsSessionOptions, D as DocxOccurrence, x as DocxParagraphAnchor, y as DocxParagraphAnchorResult, z as DocxParagraphIdAssignment, A as DocxParagraphIdDiagnostic, B as DocxParagraphIdOrigin, E as DocxParagraphIdRefusal, F as DocxParagraphIdentity, G as DocxParagraphIdentityReceipt, H as DocxParagraphIdentitySnapshot, I as DocxParagraphOrigin, J as DocxParagraphRef, K as DocxParagraphSavePlan, L as DocxPersistedParagraphAnchor, M as DocxProposalFailure, N as DocxProposalInput, O as DocxProposalRecord, P as DocxProposalRequest, Q as DocxProposalResult, R as DocxProposalSnapshot, S as DocxProposalState, T as DocxProposalStateRequest, U as DocxProposalWithdrawRequest, V as DocxSavedDocument, W as DocxSavedParagraph, X as DocxSessionParagraphAnchor, Z as DocxSessionSave, _ as DocxSourceParagraphAnchor, $ as DocxSourceStory, a0 as ResidentCaretPaintStyle, a1 as ResidentEngineOffscreenPage, a2 as ResidentEngineWorkerApplyResult, a3 as ResidentEngineWorkerClient, a4 as ResidentEngineWorkerFrame, a5 as ResidentEngineWorkerOpened, a6 as ResidentWorkerFailureError, a7 as ResidentWorkerOutOfMemoryError, a8 as YrsAuthor, a9 as YrsCellBorder, aa as YrsCellBorders, ab as YrsCellLoc, ac as YrsChangeTarget, ad as YrsCommentInfo, ae as YrsCommentReceipt, af as YrsContentControlValue, ag as YrsDocxHost, ah as YrsEngineApplyProfile, ai as YrsHyperlinkAttrs, aj as YrsImageGeometry, ak as YrsInlineFormatDelta, al as YrsInputParagraphSeed, am as YrsInputParagraphSpan, an as YrsInputPositionMap, u as YrsLoc, ao as YrsMediaSource, ap as YrsNumberingProperties, aq as YrsOpeningOptions, ar as YrsParaOffset, as as YrsParagraph, at as YrsParagraphAttrs, au as YrsParagraphLength, av as YrsParagraphReceipt, aw as YrsParagraphSeed, ax as YrsParagraphSpan, ay as YrsParagraphTabStop, az as YrsRawOp, aA as YrsRegionLayoutProgress, a as YrsRenderEnv, aB as YrsReplaceReceipt, aC as YrsResidentCaretRect, aD as YrsResidentCaretSnapshot, aE as YrsResidentFontRegistration, aF as YrsResidentWorkerSnapshot, aG as YrsResidentWorkerSyncOptions, aH as YrsResolveReceipt, aI as YrsResolvedCommentAnchor, v as YrsRevisionInfo, aJ as YrsRevisionReceipt, aK as YrsRunMark, j as YrsSelection, aL as YrsSelectionContext, aM as YrsSelectionText, Y as YrsSession, aN as YrsSplitReceipt, aO as YrsStickyPosition, aP as YrsStoryRange, aQ as YrsStorySeed, aR as YrsStorySegment, aS as YrsTableLoc, aT as YrsTableRange, aU as YrsTableReceipt, aV as YrsTargetEditResult, aW as YrsTextColor, aX as YrsTextMatch, aY as YrsTextSearchOptions, aZ as YrsTriState, a_ as YrsUndoCaptureMode, a$ as YrsWatermark, b0 as canUseResidentEngineWorker, b1 as captureSessionSave, b2 as compareYrsLocs, b3 as createYrsInputPositionMap, b4 as createYrsSession, b5 as decodeDocxHostJson, b6 as displayPositionToYrsLoc, b7 as documentToYrs, b8 as preloadDocxEngine, b9 as preloadResidentEngineWorker, ba as prepareDocxBytes, bb as preparedDocxDigest, bc as proposalRevisionPreview, bd as residentCaretDeviceRect, be as residentCaretSnapshotForFrame, bf as retainPreloadedResidentEngineWorker, bg as sameYrsSelection, bh as saveYrsDocx, bi as takePreloadedResidentEngineWorker, bj as writeSessionSave, bk as yrsLocToDisplayPosition, bl as yrsToDocument } from '../index-CHy6_Yuo.mjs';
|
|
4
|
+
export { o as DocxAnchor, p as DocxAnchorScope, ac as DocxAtomKind, q as DocxCachedResult, r as DocxCommentMetadata, s as DocxContentControl, t as DocxContentControlDiagnostic, l as DocxContentControlQuery, k as DocxContentControlReadFailure, u as DocxContentControlSelector, v as DocxContentControlValue, m as DocxContentControlsOptions, w as DocxContentControlsResult, n as DocxContentControlsSnapshot, x as DocxControlMetadata, a1 as DocxEditFailure, a2 as DocxEditFailureCode, ad as DocxEditFailureReason, ae as DocxEditGuard, af as DocxEditHistory, ag as DocxEditOperation, ah as DocxEditPreview, ai as DocxEditReceipt, ab as DocxEditRefusal, a7 as DocxEditRequest, a9 as DocxEditResult, aj as DocxEditSource, ak as DocxEditStep, a0 as DocxEditSuggestion, al as DocxEditTarget, y as DocxExportBlock, z as DocxExportCell, A as DocxExportDiagnostic, B as DocxExportDiagnosticCode, D as DocxExportFailure, C as DocxExportFailureCode, E as DocxExportInline, a as DocxExportOptions, F as DocxExportPage, G as DocxExportRefusal, H as DocxExportResult, I as DocxExportStory, J as DocxExportTable, a5 as DocxFindTextRequest, a6 as DocxFindTextResult, K as DocxFormattingMark, L as DocxFragmentGeometry, M as DocxHeadingInfo, N as DocxHeadlessFont, e as DocxHeadlessLayoutOptions, O as DocxInlineRevision, i as DocxLayoutMap, P as DocxLayoutProvenance, Q as DocxListInfo, b as DocxMarkdownContent, h as DocxMarkdownOptions, R as DocxPageDiagnostic, d as DocxPageExportOptions, S as DocxPageFragment, T as DocxPageMapContent, j as DocxPageMarkdownOptions, f as DocxPagedStructuredContent, U as DocxParagraphData, V as DocxParagraphHeading, am as DocxParagraphInput, an as DocxParagraphTarget, ao as DocxParagraphText, a3 as DocxReadParagraphsRequest, a4 as DocxReadParagraphsResult, ap as DocxResolvedControl, W as DocxRevisionView, aq as DocxSearchScope, ar as DocxSetContentControlTextStep, g as DocxSnapshotLayoutMap, X as DocxSnapshotLayoutProvenance, Y as DocxStoryKind, Z as DocxStoryOccurrence, _ as DocxStorySelection, c as DocxStructuredContent, as as DocxTextAtom, at as DocxTextMatch, au as DocxTextPosition, av as DocxTextRange, aa as DocxTextTarget, aw as DocxTextView, $ as DocxUnlocatedReason, a8 as DocxValidationResult, ax as EditSuccess, ay as OperationFailure, az as OperationRefusal, aA as ValidationSuccess } from '../pagedExport---0Dlmzo.mjs';
|
|
5
|
+
export { b as WASM32_MEMORY_LIMIT_BYTES, c as WasmHeapStats, a as WasmModuleMemory, w as wasmModuleMemories } from '../loadWasmAsset-Cr95TImt.mjs';
|
|
5
6
|
import '../content-BzoC6bSz.mjs';
|
|
6
7
|
import '../docx/wrapTypes.mjs';
|
|
7
8
|
import '../styles-AryxLAhx.mjs';
|
|
8
|
-
import '../frameDelta-
|
|
9
|
+
import '../frameDelta-ByU7HBuB.mjs';
|
|
9
10
|
import '../rezip-Bxiq4Z_R.mjs';
|