@silurus/ooxml 0.2.0 → 0.3.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 +2 -0
- package/dist/autoResize-U2-IRmNE.js +48 -0
- package/dist/autoResize-ggn4hzd8.cjs +1 -0
- package/dist/docx-CBTSExoH.cjs +1 -0
- package/dist/docx-DPRNEbrA.js +763 -0
- package/dist/docx.cjs +1 -1
- package/dist/docx.mjs +3 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/paint-C7gG2pjf.cjs +1 -0
- package/dist/paint-CIAXt08M.js +98 -0
- package/dist/pptx-BTI_RpCN.js +1392 -0
- package/dist/pptx-D-l5vpjt.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +3 -2
- package/dist/types/docx.d.ts +93 -1
- package/dist/types/index.d.ts +101 -1
- package/dist/types/pptx.d.ts +27 -0
- package/dist/types/xlsx.d.ts +25 -0
- package/dist/xlsx-BbZiHoyu.cjs +4 -0
- package/dist/{xlsx-7RZtVIqa.js → xlsx-DqnFMSVb.js} +227 -226
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +3 -2
- package/package.json +1 -1
- package/dist/chunk-BwIEoMh7.cjs +0 -1
- package/dist/chunk-DmhlhrBa.js +0 -11
- package/dist/docx-BigKt3jU.cjs +0 -1
- package/dist/docx-Dl67DX0B.js +0 -721
- package/dist/pptx-9gGaUMeA.js +0 -1475
- package/dist/pptx-E7x-tlbY.cjs +0 -1
- package/dist/xlsx-BJpXJcKz.cjs +0 -4
package/README.md
CHANGED
|
@@ -24,6 +24,8 @@ pnpm add @silurus/ooxml
|
|
|
24
24
|
|
|
25
25
|
> **Bundler note**: this package embeds `.wasm` files. With Vite add [`vite-plugin-wasm`](https://github.com/Menci/vite-plugin-wasm); with webpack use [`experiments.asyncWebAssembly`](https://webpack.js.org/configuration/experiments/).
|
|
26
26
|
|
|
27
|
+
> **Bundle size note**: npm's *Unpacked Size* figure sums ES (`.mjs`) and CJS (`.cjs`) outputs for all three formats. The size that actually lands in your app is much smaller — import only the format you need (e.g. `@silurus/ooxml/pptx`) and your bundler picks a single module format, so tree-shaking drops the other two formats entirely.
|
|
28
|
+
|
|
27
29
|
---
|
|
28
30
|
|
|
29
31
|
## Quick Start
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.defineProperty, t = (t, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in t) e(r, i, {
|
|
5
|
+
get: t[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || e(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region packages/core/src/autoResize.ts
|
|
12
|
+
function n(e, t, n = {}) {
|
|
13
|
+
let r = n.pauseWhenHidden ?? !0, i = null, a = 0, o = 0, s = null, c = !1, l = !1, u = () => {
|
|
14
|
+
if (!l && !(r && typeof document < "u" && document.hidden)) {
|
|
15
|
+
if (s) {
|
|
16
|
+
c = !0;
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
i === null && (i = requestAnimationFrame(d));
|
|
20
|
+
}
|
|
21
|
+
}, d = async () => {
|
|
22
|
+
if (i = null, l) return;
|
|
23
|
+
let t = a, n = o;
|
|
24
|
+
try {
|
|
25
|
+
let r = e(t, n);
|
|
26
|
+
s = r instanceof Promise ? r : Promise.resolve(), await s;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
console.error("[autoResize] render failed:", e);
|
|
29
|
+
} finally {
|
|
30
|
+
s = null, c && !l && (c = !1, u());
|
|
31
|
+
}
|
|
32
|
+
}, f = new ResizeObserver((e) => {
|
|
33
|
+
for (let t of e) {
|
|
34
|
+
let e = t.contentRect;
|
|
35
|
+
a = e.width, o = e.height;
|
|
36
|
+
}
|
|
37
|
+
u();
|
|
38
|
+
});
|
|
39
|
+
f.observe(t);
|
|
40
|
+
let p = () => {
|
|
41
|
+
typeof document < "u" && !document.hidden && u();
|
|
42
|
+
};
|
|
43
|
+
return r && typeof document < "u" && document.addEventListener("visibilitychange", p), () => {
|
|
44
|
+
l = !0, f.disconnect(), i !== null && (cancelAnimationFrame(i), i = null), r && typeof document < "u" && document.removeEventListener("visibilitychange", p);
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
export { t as n, n as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};function n(e,t,n={}){let r=n.pauseWhenHidden??!0,i=null,a=0,o=0,s=null,c=!1,l=!1,u=()=>{if(!l&&!(r&&typeof document<`u`&&document.hidden)){if(s){c=!0;return}i===null&&(i=requestAnimationFrame(d))}},d=async()=>{if(i=null,l)return;let t=a,n=o;try{let r=e(t,n);s=r instanceof Promise?r:Promise.resolve(),await s}catch(e){console.error(`[autoResize] render failed:`,e)}finally{s=null,c&&!l&&(c=!1,u())}},f=new ResizeObserver(e=>{for(let t of e){let e=t.contentRect;a=e.width,o=e.height}u()});f.observe(t);let p=()=>{typeof document<`u`&&!document.hidden&&u()};return r&&typeof document<`u`&&document.addEventListener(`visibilitychange`,p),()=>{l=!0,f.disconnect(),i!==null&&(cancelAnimationFrame(i),i=null),r&&typeof document<`u`&&document.removeEventListener(`visibilitychange`,p)}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|