@betteroffice/docx 0.2.0 → 0.2.1
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/dist/core.mjs +1 -1
- package/package.json +1 -1
package/dist/core.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{i as attemptSelectiveSave,h as createDocx,a as parseDocx,f as repackDocx,c as serializeDocumentBody,b as serializeDocx,d as serializeSectionProperties,g as updateMultipleFiles}from'./chunk-AFMVSI4Z.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,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'./chunk-LTVVQMHB.mjs';export{b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,c as pixelsToEmu,h as pixelsToTwips,d as pointsToPixels,j as twipsToEmu,g as twipsToPixels}from'./chunk-CTBUQRYQ.mjs';export{n as canRenderFont,k as getLoadedFonts,g as isFontLoaded,j as isFontsLoading,i as isGoogleFontsEnabled,e as loadFont,o as loadFontFromBuffer,f as loadFonts,l as onFontsLoaded,v as preloadCommonFonts,h as setGoogleFontsEnabled,a as toArrayBuffer}from'./chunk-JHJLG4I6.mjs';import'./chunk-6LQJAKOC.mjs';import'./chunk-HLDJMU3R.mjs';import'./chunk-ACGKK7IB.mjs';import'./chunk-5F6DLQZP.mjs';import {b as b$1}from'./chunk-TTRUPDAB.mjs';var g="0.2.
|
|
1
|
+
export{i as attemptSelectiveSave,h as createDocx,a as parseDocx,f as repackDocx,c as serializeDocumentBody,b as serializeDocx,d as serializeSectionProperties,g as updateMultipleFiles}from'./chunk-AFMVSI4Z.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,i as resolveHighlightColor,q as resolveHighlightToCss,j as resolveShadingColor}from'./chunk-LTVVQMHB.mjs';export{b as emuToPixels,i as emuToTwips,q as formatPx,k as halfPointsToPixels,c as pixelsToEmu,h as pixelsToTwips,d as pointsToPixels,j as twipsToEmu,g as twipsToPixels}from'./chunk-CTBUQRYQ.mjs';export{n as canRenderFont,k as getLoadedFonts,g as isFontLoaded,j as isFontsLoading,i as isGoogleFontsEnabled,e as loadFont,o as loadFontFromBuffer,f as loadFonts,l as onFontsLoaded,v as preloadCommonFonts,h as setGoogleFontsEnabled,a as toArrayBuffer}from'./chunk-JHJLG4I6.mjs';import'./chunk-6LQJAKOC.mjs';import'./chunk-HLDJMU3R.mjs';import'./chunk-ACGKK7IB.mjs';import'./chunk-5F6DLQZP.mjs';import {b as b$1}from'./chunk-TTRUPDAB.mjs';var g="0.2.1";var ct={includeHeaders:true,includeFooters:true,includePageNumbers:true,pageRange:null,scale:1,printBackground:true,margins:"default"};function ft(){return {...ct}}function gt(){typeof window<"u"&&window.print();}var yt="@media print { body { margin: 0; padding: 0; } @page { margin: 0; } }";function xt(e="Document",s){if(typeof window>"u")return null;let t=window.open("","_blank");if(!t)return null;t.opener=null;let i=t.document;i.title=e;let o=i.createElement("style");o.textContent=yt,i.head.appendChild(o);let n=new DOMParser().parseFromString(s,"text/html");for(let l of Array.from(n.body.childNodes))i.body.appendChild(i.importNode(l,true));return t}function ht(e,s){if(!e||!e.trim())return null;let t=e.trim();if(/^\d+$/.test(t)){let o=parseInt(t,10);return o>=1&&o<=s?{start:o,end:o}:null}let i=t.match(/^(\d+)-(\d+)$/);if(i){let o=parseInt(i[1],10),n=parseInt(i[2],10);if(o>=1&&n<=s&&o<=n)return {start:o,end:n}}return null}function bt(e,s){return e?e.start===e.end?`Page ${e.start}`:`Pages ${e.start}-${e.end}`:`All (${s} pages)`}function Tt(){return typeof window<"u"&&typeof window.print=="function"}var a=class{constructor(s){b$1(this,"listeners",new Set);b$1(this,"snapshot");b$1(this,"subscribe",s=>(this.listeners.add(s),()=>{this.listeners.delete(s);}));b$1(this,"getSnapshot",()=>this.snapshot);this.snapshot=s;}setSnapshot(s){this.snapshot=s,this.notify();}notify(){for(let s of this.listeners)s();}};var m={TABLE_INDEX:"data-table-index",ROW_INDEX:"data-row",COLUMN_INDEX:"data-col",TABLE_CELL:"data-table-cell"};function y(e,s){if(!(e instanceof Element))return null;let t=e;for(;t&&t!==s;){if(t.tagName==="TD"||t.tagName==="TH"){let i=t.getAttribute(m.ROW_INDEX),o=t.getAttribute(m.COLUMN_INDEX);if(i!==null&&o!==null){let n=t;for(;n&&n!==s;){if(n.tagName==="TABLE"){let l=n.getAttribute(m.TABLE_INDEX);if(l!==null)return {tableIndex:parseInt(l,10),rowIndex:parseInt(i,10),columnIndex:parseInt(o,10)};break}n=n.parentElement;}}break}t=t.parentElement;}return null}function x(e,s){if(!e.package?.document?.content)return null;let t=0;for(let i of e.package.document.content)if(i.type==="table"){if(t===s)return i;t++;}return null}function h(e,s,t){if(!e.package?.document?.content)return e;let i=0,o=e.package.document.content.map(n=>{if(n.type==="table"){if(i===s)return i++,t;i++;}return n});return {...e,package:{...e.package,document:{...e.package.document,content:o}}}}function b(e,s){if(!e.package?.document?.content)return e;let t=0,i=e.package.document.content.filter(o=>{if(o.type==="table"){let n=t===s;return t++,!n}return true});return {...e,package:{...e.package,document:{...e.package.document,content:i}}}}var u=class extends a{constructor(){super({selectedCell:null});}selectCell(s){this.setSnapshot({selectedCell:s});}clearSelection(){this.setSnapshot({selectedCell:null});}isCellSelected(s,t,i){let{selectedCell:o}=this.getSnapshot();return o?o.tableIndex===s&&o.rowIndex===t&&o.columnIndex===i:false}getSelectedCell(){return this.getSnapshot().selectedCell}};var c=class extends a{constructor(){super({notifications:[]});b$1(this,"notifications",[]);b$1(this,"idCounter",0);b$1(this,"timers",new Set);}showError(t,i){return this.addNotification(t,"error",i)}showWarning(t,i){return this.addNotification(t,"warning",i)}showInfo(t,i){return this.addNotification(t,"info",i)}dismiss(t){this.notifications=this.notifications.map(o=>o.id===t?{...o,dismissed:true}:o),this.emitSnapshot();let i=setTimeout(()=>{this.timers.delete(i),this.notifications=this.notifications.filter(o=>o.id!==t),this.emitSnapshot();},300);this.timers.add(i);}clearAll(){this.notifications=[];for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.emitSnapshot();}destroy(){for(let t of this.timers)clearTimeout(t);this.timers.clear(),this.notifications=[];}addNotification(t,i,o){let n=`error-${++this.idCounter}-${Date.now()}`,l={id:n,message:t,severity:i,details:o,timestamp:Date.now()};if(this.notifications=[...this.notifications,l],this.emitSnapshot(),i!=="error"){let f=setTimeout(()=>{this.timers.delete(f),this.dismiss(n);},5e3);this.timers.add(f);}return n}emitSnapshot(){this.setSnapshot({notifications:this.notifications});}};var Wt=g;export{c as ErrorManager,a as Subscribable,m as TABLE_DATA_ATTRIBUTES,u as TableSelectionManager,Wt as VERSION,b as deleteTableFromDocument,y as findTableFromClick,bt as formatPageRange,ft as getDefaultPrintOptions,x as getTableFromDocument,Tt as isPrintSupported,xt as openPrintWindow,ht as parsePageRange,gt as triggerPrint,h as updateTableInDocument};
|