@s8fy/pptx-viewer-svelte 2.1.1 → 3.1.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 +14 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +0 -2
- package/dist/index.d.ts +0 -2
- package/dist/index.js +5 -5
- package/package.json +9 -7
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @s8fy/pptx-viewer-svelte
|
|
2
2
|
|
|
3
|
-
Svelte
|
|
3
|
+
**High-fidelity PowerPoint viewing in Svelte, powered by the shared PPTX viewer engine.**
|
|
4
|
+
|
|
5
|
+
Svelte actions and imperative helpers for `@s8fy/pptx-viewer`, with font-driven text layout, vector graphics, charts, and supported DrawingML effects. Use the `pptx` action or `mountViewer` helper to manage the shared viewer controller.
|
|
4
6
|
|
|
5
7
|
## Install
|
|
6
8
|
|
|
@@ -31,7 +33,7 @@ Peer dependency: Svelte **5**. The package declares Node.js **22.12+**. It expor
|
|
|
31
33
|
<div use:pptx={options}></div>
|
|
32
34
|
```
|
|
33
35
|
|
|
34
|
-
The `pptx
|
|
36
|
+
The `pptx` action reuses the controller for source changes and recreates it when configuration changes. The package also exports `mountViewer()` for component authors that prefer an imperative wrapper. Module import is SSR-safe, while invoking an action or helper requires a browser DOM node.
|
|
35
37
|
|
|
36
38
|
## Action parameters and lifecycle
|
|
37
39
|
|
|
@@ -55,9 +57,17 @@ export function mount(host: HTMLElement) {
|
|
|
55
57
|
}
|
|
56
58
|
```
|
|
57
59
|
|
|
58
|
-
`mountViewer` returns `{ viewer, update(options?), destroy() }`. `viewer` always reads the current controller; `update` returns that controller and replaces the complete options set rather than merging a patch. Call `destroy()` on disposal when using this helper directly.
|
|
60
|
+
`mountViewer` returns `{ viewer, update(options?), destroy() }`. `viewer` always reads the current controller; `update` returns that controller and replaces the complete options set rather than merging a patch. Call `destroy()` on disposal when using this helper directly.
|
|
61
|
+
|
|
62
|
+
Await imperative loads/exports and handle rejections. PDF/PPTX export requires an original file source. In SvelteKit, run imperative mounting in `onMount`; actions already run on the client. Shared rendering capabilities, defaults, font/asset settings, and methods are in the [viewer README](https://www.npmjs.com/package/@s8fy/pptx-viewer).
|
|
63
|
+
|
|
64
|
+
## Upgrading to 3.0
|
|
65
|
+
|
|
66
|
+
- The `usePptx` alias is removed: import `pptx` and change `use:usePptx={options}` to `use:pptx={options}`.
|
|
67
|
+
- The `createPptx` alias is removed: call `mountViewer(host, options)` instead.
|
|
68
|
+
- Controllers from `onReady` or `mounted.viewer` no longer have `fullscreen()`. Use `await viewer.enterFullscreen()` in a user interaction handler and handle its `Promise<void>` rejection; `onError` only notifies and does not consume the rejection.
|
|
59
69
|
|
|
60
|
-
|
|
70
|
+
The retained `pptx` action and `mountViewer` signatures are unchanged. Rendering, parsing, PDF export, and lifecycle behavior follow the shared Viewer `3.0.0` contract.
|
|
61
71
|
|
|
62
72
|
## License
|
|
63
73
|
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@s8fy/pptx-viewer");function mountViewer(
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@s8fy/pptx-viewer"),t=require("@s8fy/pptx-viewer/internal");function mountViewer(n,r={}){let i=new t.ViewerBinding(n,e.createPptxViewer,r),notify=e=>{t.ViewerBinding.notify(e,i.viewer)};return notify(r.onReady),{get viewer(){return i.viewer},update(e={}){let t=i.viewer;return i.update(e),t!==i.viewer&¬ify(e.onReady),i.viewer},destroy(){i.destroy()}}}function pptx(e,t={}){let n=mountViewer(e,t);return{update(e={}){n.update(e)},destroy(){n.destroy()}}}exports.mountViewer=mountViewer,exports.pptx=pptx;
|
package/dist/index.d.cts
CHANGED
|
@@ -12,6 +12,4 @@ export declare function pptx(node: HTMLElement, params?: PptxActionParams): {
|
|
|
12
12
|
update(next?: PptxActionParams): void;
|
|
13
13
|
destroy(): void;
|
|
14
14
|
};
|
|
15
|
-
export declare const usePptx: typeof pptx;
|
|
16
|
-
export declare const createPptx: typeof mountViewer;
|
|
17
15
|
export type { Viewer, ViewerOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,4 @@ export declare function pptx(node: HTMLElement, params?: PptxActionParams): {
|
|
|
12
12
|
update(next?: PptxActionParams): void;
|
|
13
13
|
destroy(): void;
|
|
14
14
|
};
|
|
15
|
-
export declare const usePptx: typeof pptx;
|
|
16
|
-
export declare const createPptx: typeof mountViewer;
|
|
17
15
|
export type { Viewer, ViewerOptions };
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createPptxViewer as e } from "@s8fy/pptx-viewer";
|
|
2
|
+
import { ViewerBinding as t } from "@s8fy/pptx-viewer/internal";
|
|
2
3
|
//#endregion
|
|
3
4
|
//#region src/index.ts
|
|
4
5
|
function mountViewer(n, r = {}) {
|
|
5
|
-
let i = new
|
|
6
|
-
|
|
6
|
+
let i = new t(n, e, r), notify = (e) => {
|
|
7
|
+
t.notify(e, i.viewer);
|
|
7
8
|
};
|
|
8
9
|
return notify(r.onReady), {
|
|
9
10
|
get viewer() {
|
|
@@ -29,6 +30,5 @@ function pptx(e, t = {}) {
|
|
|
29
30
|
}
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
|
-
var n = pptx, r = mountViewer;
|
|
33
33
|
//#endregion
|
|
34
|
-
export {
|
|
34
|
+
export { mountViewer, pptx };
|
package/package.json
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@s8fy/pptx-viewer-svelte",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "High-fidelity PPTX viewer actions and helpers for Svelte, powered by @s8fy/pptx-viewer",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"high fidelity",
|
|
7
|
+
"high-fidelity",
|
|
6
8
|
"powerpoint",
|
|
7
9
|
"pptx",
|
|
8
10
|
"presentation",
|
|
@@ -12,13 +14,13 @@
|
|
|
12
14
|
],
|
|
13
15
|
"homepage": "https://structurify.io/en/products/pptx-viewer",
|
|
14
16
|
"bugs": {
|
|
15
|
-
"url": "https://github.com/hustcer/
|
|
17
|
+
"url": "https://github.com/hustcer/xdoc-feedback/issues"
|
|
16
18
|
},
|
|
17
19
|
"license": "PolyForm-Noncommercial-1.0.0",
|
|
18
20
|
"author": "hustcer@outlook.com",
|
|
19
21
|
"repository": {
|
|
20
22
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/hustcer/
|
|
23
|
+
"url": "git+https://github.com/hustcer/xdoc-feedback.git",
|
|
22
24
|
"directory": "packages/pptx-viewer-svelte"
|
|
23
25
|
},
|
|
24
26
|
"files": [
|
|
@@ -50,14 +52,14 @@
|
|
|
50
52
|
"registry": "https://registry.npmjs.org"
|
|
51
53
|
},
|
|
52
54
|
"dependencies": {
|
|
53
|
-
"@s8fy/pptx-viewer": "
|
|
55
|
+
"@s8fy/pptx-viewer": "3.1.0"
|
|
54
56
|
},
|
|
55
57
|
"devDependencies": {
|
|
56
58
|
"@typescript/typescript6": "^6.0.2",
|
|
57
59
|
"svelte": "^5.55.5",
|
|
58
60
|
"typescript": "~7.0.2",
|
|
59
|
-
"vite": "^8.3.
|
|
60
|
-
"vite-plugin-dts": "^5.1.
|
|
61
|
+
"vite": "^8.3.2",
|
|
62
|
+
"vite-plugin-dts": "^5.1.2",
|
|
61
63
|
"vitest": "^4.1.11"
|
|
62
64
|
},
|
|
63
65
|
"peerDependencies": {
|