@embedpdf/plugin-viewport 1.3.16 → 1.4.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.
@@ -0,0 +1 @@
1
+ export * from './viewport';
@@ -0,0 +1,6 @@
1
+ import { ReactNode, HTMLAttributes } from '../../react/adapter.ts';
2
+ type ViewportProps = HTMLAttributes<HTMLDivElement> & {
3
+ children: ReactNode;
4
+ };
5
+ export declare function Viewport({ children, ...props }: ViewportProps): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from './use-viewport';
2
+ export * from './use-viewport-ref';
@@ -0,0 +1 @@
1
+ export declare function useViewportRef(): import('react').RefObject<HTMLDivElement>;
@@ -0,0 +1,12 @@
1
+ import { ScrollActivity, ViewportPlugin } from '../../index.ts';
2
+ export declare const useViewportPlugin: () => {
3
+ plugin: ViewportPlugin | null;
4
+ isLoading: boolean;
5
+ ready: Promise<void>;
6
+ };
7
+ export declare const useViewportCapability: () => {
8
+ provides: Readonly<import('../../index.ts').ViewportCapability> | null;
9
+ isLoading: boolean;
10
+ ready: Promise<void>;
11
+ };
12
+ export declare const useViewportScrollActivity: () => ScrollActivity;
@@ -0,0 +1,3 @@
1
+ export * from './components';
2
+ export * from './hooks';
3
+ export * from '../index.ts';
@@ -0,0 +1,9 @@
1
+ import { HTMLAttributes } from 'svelte/elements';
2
+ import { Snippet } from 'svelte';
3
+ type ViewportProps = HTMLAttributes<HTMLDivElement> & {
4
+ children: Snippet;
5
+ class?: string;
6
+ };
7
+ declare const Viewport: import('svelte', { with: { "resolution-mode": "import" } }).Component<ViewportProps, {}, "">;
8
+ type Viewport = ReturnType<typeof Viewport>;
9
+ export default Viewport;
@@ -0,0 +1 @@
1
+ export { default as Viewport } from './Viewport.svelte';
@@ -0,0 +1,2 @@
1
+ export * from './use-viewport.svelte';
2
+ export * from './use-viewport-ref.svelte';
@@ -0,0 +1,3 @@
1
+ export declare function useViewportRef(): {
2
+ containerRef: HTMLDivElement | null;
3
+ };
@@ -0,0 +1,15 @@
1
+ import { ViewportPlugin } from '../../lib/index.ts';
2
+ export declare const useViewportPlugin: () => {
3
+ plugin: ViewportPlugin | null;
4
+ isLoading: boolean;
5
+ ready: Promise<void>;
6
+ };
7
+ export declare const useViewportCapability: () => {
8
+ provides: Readonly<import('../../lib/index.ts').ViewportCapability> | null;
9
+ isLoading: boolean;
10
+ ready: Promise<void>;
11
+ };
12
+ export declare const useViewportScrollActivity: () => {
13
+ isScrolling: boolean;
14
+ isSmoothScrolling: boolean;
15
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("svelte/internal/disclose-version");const e=require("svelte/internal/client"),t=require("@embedpdf/core/svelte"),r=require("@embedpdf/plugin-viewport");function i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=i(e),l=()=>t.usePlugin(r.ViewportPlugin.id),s=()=>t.useCapability(r.ViewportPlugin.id);function n(){const{plugin:e}=l();let t=o.state(null);return o.user_pre_effect((()=>{if(!e)return;const r=o.get(t);if(!r)return;e.registerBoundingRectProvider((()=>{const e=r.getBoundingClientRect();return{origin:{x:e.left,y:e.top},size:{width:e.width,height:e.height}}}));const i=()=>{null==e||e.setViewportScrollMetrics({scrollTop:r.scrollTop,scrollLeft:r.scrollLeft})};r.addEventListener("scroll",i);const l=new ResizeObserver((()=>{null==e||e.setViewportResizeMetrics({width:r.offsetWidth,height:r.offsetHeight,clientWidth:r.clientWidth,clientHeight:r.clientHeight,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft,scrollWidth:r.scrollWidth,scrollHeight:r.scrollHeight})}));l.observe(r);const s=e.onScrollRequest((({x:e,y:t,behavior:i="auto"})=>{requestAnimationFrame((()=>{r.scrollTo({left:e,top:t,behavior:i})}))}));return()=>{null==e||e.registerBoundingRectProvider(null),r.removeEventListener("scroll",i),l.disconnect(),s()}})),{get containerRef(){return o.get(t)},set containerRef(e){o.set(t,e,!0)}}}var c=o.from_html("<div><!></div>");exports.Viewport=function(e,t){o.push(t,!0);let r=o.rest_props(t,["$$slots","$$events","$$legacy","children","class"]),i=o.state(0),l=n();const p=s();o.user_effect((()=>{p.provides&&o.set(i,p.provides.getViewportGap(),!0)}));var u=c();o.attribute_effect(u,(e=>({...r,class:t.class,[o.STYLE]:e})),[()=>({width:"100%",height:"100%",overflow:"auto",padding:`${o.get(i)}px`})]);var d=o.child(u);o.snippet(d,(()=>t.children)),o.reset(u),o.bind_this(u,(e=>l.containerRef=e),(()=>null==l?void 0:l.containerRef)),o.append(e,u),o.pop()},exports.useViewportCapability=s,exports.useViewportPlugin=l,exports.useViewportRef=n,exports.useViewportScrollActivity=()=>{const e=s(),t=o.proxy({isScrolling:!1,isSmoothScrolling:!1});return o.user_effect((()=>{if(e.provides)return e.provides.onScrollActivity((e=>{t.isScrolling=e.isScrolling,t.isSmoothScrolling=e.isSmoothScrolling}))})),t},Object.keys(r).forEach((e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>r[e]})}));
2
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-viewport.svelte.ts","../../src/svelte/hooks/use-viewport-ref.svelte.ts","../../src/svelte/components/Viewport.svelte"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { ScrollActivity, ViewportPlugin } from '@embedpdf/plugin-viewport';\n\nexport const useViewportPlugin = () => usePlugin<ViewportPlugin>(ViewportPlugin.id);\nexport const useViewportCapability = () => useCapability<ViewportPlugin>(ViewportPlugin.id);\n\nexport const useViewportScrollActivity = () => {\n const capability = useViewportCapability();\n\n const state = $state({\n isScrolling: false,\n isSmoothScrolling: false,\n });\n\n $effect(() => {\n if (!capability.provides) return;\n\n return capability.provides.onScrollActivity((activity: ScrollActivity) => {\n state.isScrolling = activity.isScrolling;\n state.isSmoothScrolling = activity.isSmoothScrolling;\n });\n });\n\n return state;\n};\n","import { type Rect } from '@embedpdf/models';\nimport { useViewportPlugin } from './use-viewport.svelte';\n\nexport function useViewportRef() {\n const { plugin } = useViewportPlugin();\n let containerRef = $state<HTMLDivElement | null>(null);\n\n $effect.pre(() => {\n if (!plugin) return;\n\n const container = containerRef;\n if (!container) return;\n\n /* ---------- live rect provider --------------------------------- */\n const provideRect = (): Rect => {\n const r = container.getBoundingClientRect();\n return {\n origin: { x: r.left, y: r.top },\n size: { width: r.width, height: r.height },\n };\n };\n plugin.registerBoundingRectProvider(provideRect);\n\n // Example: On scroll, call setMetrics\n const onScroll = () => {\n plugin?.setViewportScrollMetrics({\n scrollTop: container.scrollTop,\n scrollLeft: container.scrollLeft,\n });\n };\n container.addEventListener('scroll', onScroll);\n\n // Example: On resize, call setMetrics\n const resizeObserver = new ResizeObserver(() => {\n plugin?.setViewportResizeMetrics({\n width: container.offsetWidth,\n height: container.offsetHeight,\n clientWidth: container.clientWidth,\n clientHeight: container.clientHeight,\n scrollTop: container.scrollTop,\n scrollLeft: container.scrollLeft,\n scrollWidth: container.scrollWidth,\n scrollHeight: container.scrollHeight,\n });\n });\n resizeObserver.observe(container);\n\n const unsubscribeScrollRequest = plugin.onScrollRequest(({ x, y, behavior = 'auto' }) => {\n requestAnimationFrame(() => {\n container.scrollTo({ left: x, top: y, behavior });\n });\n });\n\n // Cleanup\n return () => {\n plugin?.registerBoundingRectProvider(null);\n container.removeEventListener('scroll', onScroll);\n resizeObserver.disconnect();\n unsubscribeScrollRequest();\n };\n });\n\n // Return the ref so your Svelte code can attach it to a div\n return {\n get containerRef() {\n return containerRef;\n },\n set containerRef(el: HTMLDivElement | null) {\n containerRef = el;\n },\n };\n}\n","<script lang=\"ts\">\n import { useViewportCapability, useViewportRef } from '../hooks';\n import type { HTMLAttributes } from 'svelte/elements';\n import type { Snippet } from 'svelte';\n\n type ViewportProps = HTMLAttributes<HTMLDivElement> & {\n children: Snippet;\n class?: string;\n };\n\n let { children, class: propsClass, ...restProps }: ViewportProps = $props();\n\n let viewportGap = $state(0);\n\n let viewportRef = useViewportRef();\n\n const viewportCapability = useViewportCapability();\n\n $effect(() => {\n if (viewportCapability.provides) {\n viewportGap = viewportCapability.provides.getViewportGap();\n }\n });\n</script>\n\n<div\n {...restProps}\n bind:this={viewportRef.containerRef}\n style:width=\"100%\"\n style:height=\"100%\"\n style:overflow=\"auto\"\n style:padding={`${viewportGap}px`}\n class={propsClass}\n>\n {@render children()}\n</div>\n"],"names":["useViewportPlugin","usePlugin","ViewportPlugin","id","useViewportCapability","useCapability","useViewportRef","plugin","containerRef","$","user_pre_effect","container","registerBoundingRectProvider","r","getBoundingClientRect","origin","x","left","y","top","size","width","height","onScroll","setViewportScrollMetrics","scrollTop","scrollLeft","addEventListener","resizeObserver","ResizeObserver","setViewportResizeMetrics","offsetWidth","offsetHeight","clientWidth","clientHeight","scrollWidth","scrollHeight","observe","unsubscribeScrollRequest","onScrollRequest","behavior","requestAnimationFrame","scrollTo","removeEventListener","disconnect","el","$__namespace","set","restProps","rest_props","$$props","viewportGap","viewportRef","viewportCapability","user_effect","provides","getViewportGap","class","STYLE","$0","bind_this","div","$$value","capability","state","isScrolling","isSmoothScrolling","onScrollActivity","activity"],"mappings":"wgBAGaA,EAA0B,IAAAC,YAA0BC,EAAAA,eAAeC,IACnEC,EAA8B,IAAAC,gBAA8BH,EAAAA,eAAeC,ICDxE,SAAAG,IACN,MAAAC,OAAAA,GAAWP,IACf,IAAAQ,UAA6C,aAEjDC,EAAAC,0BACOH,EAAQ,OAEP,MAAAI,QAAYH,OACbG,EAAW,OAUhBJ,EAAOK,mCANC,MAAAC,EAAIF,EAAUG,+BAElBC,QAAUC,EAAGH,EAAEI,KAAMC,EAAGL,EAAEM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D,IAEb4D,WACJC,aAAa,EACbC,mBAAmB,IAYd,OATPzD,EAAA6C,kBACO,GAAAS,EAAWR,SAET,OAAAQ,EAAWR,SAASY,kBAAkBC,IAC3CJ,EAAMC,YAAcG,EAASH,YAC7BD,EAAME,kBAAoBE,EAASF,iBAAA,GACpC,IAGIF,CAAA"}
@@ -0,0 +1,3 @@
1
+ export { Viewport } from './components';
2
+ export * from './hooks';
3
+ export * from '../lib/index.ts';
@@ -0,0 +1,111 @@
1
+ import "svelte/internal/disclose-version";
2
+ import * as $ from "svelte/internal/client";
3
+ import { useCapability, usePlugin } from "@embedpdf/core/svelte";
4
+ import { ViewportPlugin } from "@embedpdf/plugin-viewport";
5
+ export * from "@embedpdf/plugin-viewport";
6
+ const useViewportPlugin = () => usePlugin(ViewportPlugin.id);
7
+ const useViewportCapability = () => useCapability(ViewportPlugin.id);
8
+ const useViewportScrollActivity = () => {
9
+ const capability = useViewportCapability();
10
+ const state = $.proxy({ isScrolling: false, isSmoothScrolling: false });
11
+ $.user_effect(() => {
12
+ if (!capability.provides) return;
13
+ return capability.provides.onScrollActivity((activity) => {
14
+ state.isScrolling = activity.isScrolling;
15
+ state.isSmoothScrolling = activity.isSmoothScrolling;
16
+ });
17
+ });
18
+ return state;
19
+ };
20
+ function useViewportRef() {
21
+ const { plugin } = useViewportPlugin();
22
+ let containerRef = $.state(null);
23
+ $.user_pre_effect(() => {
24
+ if (!plugin) return;
25
+ const container = $.get(containerRef);
26
+ if (!container) return;
27
+ const provideRect = () => {
28
+ const r = container.getBoundingClientRect();
29
+ return {
30
+ origin: { x: r.left, y: r.top },
31
+ size: { width: r.width, height: r.height }
32
+ };
33
+ };
34
+ plugin.registerBoundingRectProvider(provideRect);
35
+ const onScroll = () => {
36
+ plugin == null ? void 0 : plugin.setViewportScrollMetrics({
37
+ scrollTop: container.scrollTop,
38
+ scrollLeft: container.scrollLeft
39
+ });
40
+ };
41
+ container.addEventListener("scroll", onScroll);
42
+ const resizeObserver = new ResizeObserver(() => {
43
+ plugin == null ? void 0 : plugin.setViewportResizeMetrics({
44
+ width: container.offsetWidth,
45
+ height: container.offsetHeight,
46
+ clientWidth: container.clientWidth,
47
+ clientHeight: container.clientHeight,
48
+ scrollTop: container.scrollTop,
49
+ scrollLeft: container.scrollLeft,
50
+ scrollWidth: container.scrollWidth,
51
+ scrollHeight: container.scrollHeight
52
+ });
53
+ });
54
+ resizeObserver.observe(container);
55
+ const unsubscribeScrollRequest = plugin.onScrollRequest(({ x, y, behavior = "auto" }) => {
56
+ requestAnimationFrame(() => {
57
+ container.scrollTo({ left: x, top: y, behavior });
58
+ });
59
+ });
60
+ return () => {
61
+ plugin == null ? void 0 : plugin.registerBoundingRectProvider(null);
62
+ container.removeEventListener("scroll", onScroll);
63
+ resizeObserver.disconnect();
64
+ unsubscribeScrollRequest();
65
+ };
66
+ });
67
+ return {
68
+ get containerRef() {
69
+ return $.get(containerRef);
70
+ },
71
+ set containerRef(el) {
72
+ $.set(containerRef, el, true);
73
+ }
74
+ };
75
+ }
76
+ var root = $.from_html(`<div><!></div>`);
77
+ function Viewport($$anchor, $$props) {
78
+ $.push($$props, true);
79
+ let restProps = $.rest_props($$props, ["$$slots", "$$events", "$$legacy", "children", "class"]);
80
+ let viewportGap = $.state(0);
81
+ let viewportRef = useViewportRef();
82
+ const viewportCapability = useViewportCapability();
83
+ $.user_effect(() => {
84
+ if (viewportCapability.provides) {
85
+ $.set(viewportGap, viewportCapability.provides.getViewportGap(), true);
86
+ }
87
+ });
88
+ var div = root();
89
+ $.attribute_effect(div, ($0) => ({ ...restProps, class: $$props.class, [$.STYLE]: $0 }), [
90
+ () => ({
91
+ width: "100%",
92
+ height: "100%",
93
+ overflow: "auto",
94
+ padding: `${$.get(viewportGap)}px`
95
+ })
96
+ ]);
97
+ var node = $.child(div);
98
+ $.snippet(node, () => $$props.children);
99
+ $.reset(div);
100
+ $.bind_this(div, ($$value) => viewportRef.containerRef = $$value, () => viewportRef == null ? void 0 : viewportRef.containerRef);
101
+ $.append($$anchor, div);
102
+ $.pop();
103
+ }
104
+ export {
105
+ Viewport,
106
+ useViewportCapability,
107
+ useViewportPlugin,
108
+ useViewportRef,
109
+ useViewportScrollActivity
110
+ };
111
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-viewport.svelte.ts","../../src/svelte/hooks/use-viewport-ref.svelte.ts","../../src/svelte/components/Viewport.svelte"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { ScrollActivity, ViewportPlugin } from '@embedpdf/plugin-viewport';\n\nexport const useViewportPlugin = () => usePlugin<ViewportPlugin>(ViewportPlugin.id);\nexport const useViewportCapability = () => useCapability<ViewportPlugin>(ViewportPlugin.id);\n\nexport const useViewportScrollActivity = () => {\n const capability = useViewportCapability();\n\n const state = $state({\n isScrolling: false,\n isSmoothScrolling: false,\n });\n\n $effect(() => {\n if (!capability.provides) return;\n\n return capability.provides.onScrollActivity((activity: ScrollActivity) => {\n state.isScrolling = activity.isScrolling;\n state.isSmoothScrolling = activity.isSmoothScrolling;\n });\n });\n\n return state;\n};\n","import { type Rect } from '@embedpdf/models';\nimport { useViewportPlugin } from './use-viewport.svelte';\n\nexport function useViewportRef() {\n const { plugin } = useViewportPlugin();\n let containerRef = $state<HTMLDivElement | null>(null);\n\n $effect.pre(() => {\n if (!plugin) return;\n\n const container = containerRef;\n if (!container) return;\n\n /* ---------- live rect provider --------------------------------- */\n const provideRect = (): Rect => {\n const r = container.getBoundingClientRect();\n return {\n origin: { x: r.left, y: r.top },\n size: { width: r.width, height: r.height },\n };\n };\n plugin.registerBoundingRectProvider(provideRect);\n\n // Example: On scroll, call setMetrics\n const onScroll = () => {\n plugin?.setViewportScrollMetrics({\n scrollTop: container.scrollTop,\n scrollLeft: container.scrollLeft,\n });\n };\n container.addEventListener('scroll', onScroll);\n\n // Example: On resize, call setMetrics\n const resizeObserver = new ResizeObserver(() => {\n plugin?.setViewportResizeMetrics({\n width: container.offsetWidth,\n height: container.offsetHeight,\n clientWidth: container.clientWidth,\n clientHeight: container.clientHeight,\n scrollTop: container.scrollTop,\n scrollLeft: container.scrollLeft,\n scrollWidth: container.scrollWidth,\n scrollHeight: container.scrollHeight,\n });\n });\n resizeObserver.observe(container);\n\n const unsubscribeScrollRequest = plugin.onScrollRequest(({ x, y, behavior = 'auto' }) => {\n requestAnimationFrame(() => {\n container.scrollTo({ left: x, top: y, behavior });\n });\n });\n\n // Cleanup\n return () => {\n plugin?.registerBoundingRectProvider(null);\n container.removeEventListener('scroll', onScroll);\n resizeObserver.disconnect();\n unsubscribeScrollRequest();\n };\n });\n\n // Return the ref so your Svelte code can attach it to a div\n return {\n get containerRef() {\n return containerRef;\n },\n set containerRef(el: HTMLDivElement | null) {\n containerRef = el;\n },\n };\n}\n","<script lang=\"ts\">\n import { useViewportCapability, useViewportRef } from '../hooks';\n import type { HTMLAttributes } from 'svelte/elements';\n import type { Snippet } from 'svelte';\n\n type ViewportProps = HTMLAttributes<HTMLDivElement> & {\n children: Snippet;\n class?: string;\n };\n\n let { children, class: propsClass, ...restProps }: ViewportProps = $props();\n\n let viewportGap = $state(0);\n\n let viewportRef = useViewportRef();\n\n const viewportCapability = useViewportCapability();\n\n $effect(() => {\n if (viewportCapability.provides) {\n viewportGap = viewportCapability.provides.getViewportGap();\n }\n });\n</script>\n\n<div\n {...restProps}\n bind:this={viewportRef.containerRef}\n style:width=\"100%\"\n style:height=\"100%\"\n style:overflow=\"auto\"\n style:padding={`${viewportGap}px`}\n class={propsClass}\n>\n {@render children()}\n</div>\n"],"names":[],"mappings":";;;;;AAGa,MAAA,oBAA0B,MAAA,UAA0B,eAAe,EAAE;AACrE,MAAA,wBAA8B,MAAA,cAA8B,eAAe,EAAE;AAE7E,MAAA,kCAAkC;AACvC,QAAA,aAAa,sBAAsB;AAEnC,QAAA,kBACJ,aAAa,OACb,mBAAmB,OAAA;AAGrB,IAAA,kBAAc;AACP,QAAA,CA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;AAAA,QACI,aAAa,IAA2B;AAC3B,QAAA,IAAA,cAAA,IAAA,IAAA;AAAA;;AAGrB;;qCCvEA;;MAUwC,YAAS,EAAA,WAAA,SAAA,CAAA,WAAA,YAAA,YAAA,YAAA,OAAA,CAAA;AAE3C,MAAA,sBAAqB,CAAC;AAEtB,MAAA,cAAc,eAAc;AAE1B,QAAA,qBAAqB,sBAAqB;AAEhD,IAAA,YAAc,MAAA;QACR,mBAAmB,UAAU;AAC/B,QAAA,IAAA,aAAc,mBAAmB,SAAS,eAAc,GAAA,IAAA;AAAA,IAC1D;AAAA,GACD;;wCAIG,WAAS,OAAA,QAAA,OAAA,CAAA,EAAA,KAAA,GAAA,GAAA,IAAA;AAAA;;;;wBAKK,WAAW,CAAA;AAAA;;;;;AAJlB,IAAA,UAAA,KAAA,CAAA,YAAA,YAAY,eAAZ,SAAA,MAAA,2CAAY,YAAY;;;AAJrC;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-viewport",
3
- "version": "1.3.16",
3
+ "version": "1.4.1",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",
@@ -26,23 +26,30 @@
26
26
  "types": "./dist/vue/index.d.ts",
27
27
  "import": "./dist/vue/index.js",
28
28
  "require": "./dist/vue/index.cjs"
29
+ },
30
+ "./svelte": {
31
+ "types": "./dist/svelte/index.d.ts",
32
+ "svelte": "./dist/svelte/index.js",
33
+ "import": "./dist/svelte/index.js",
34
+ "require": "./dist/svelte/index.cjs"
29
35
  }
30
36
  },
31
37
  "dependencies": {
32
- "@embedpdf/models": "1.3.16"
38
+ "@embedpdf/models": "1.4.1"
33
39
  },
34
40
  "devDependencies": {
35
41
  "@types/react": "^18.2.0",
36
42
  "typescript": "^5.0.0",
37
- "@embedpdf/core": "1.3.16",
38
- "@embedpdf/build": "1.0.1"
43
+ "@embedpdf/core": "1.4.1",
44
+ "@embedpdf/build": "1.1.0"
39
45
  },
40
46
  "peerDependencies": {
41
47
  "react": ">=16.8.0",
42
48
  "react-dom": ">=16.8.0",
43
49
  "preact": "^10.26.4",
44
50
  "vue": ">=3.2.0",
45
- "@embedpdf/core": "1.3.16"
51
+ "svelte": ">=5 <6",
52
+ "@embedpdf/core": "1.4.1"
46
53
  },
47
54
  "files": [
48
55
  "dist",
@@ -65,7 +72,8 @@
65
72
  "build:react": "vite build --mode react",
66
73
  "build:preact": "vite build --mode preact",
67
74
  "build:vue": "vite build --mode vue",
68
- "build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\"",
75
+ "build:svelte": "vite build --mode svelte",
76
+ "build": "pnpm run clean && concurrently -c auto -n base,react,preact,vue,svelte \"vite build --mode base\" \"vite build --mode react\" \"vite build --mode preact\" \"vite build --mode vue\" \"vite build --mode svelte\"",
69
77
  "clean": "rimraf dist",
70
78
  "lint": "eslint src --color",
71
79
  "lint:fix": "eslint src --color --fix"