@embedpdf/plugin-tiling 1.4.0 → 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.
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +11 -10
- package/dist/svelte/index.js.map +1 -1
- package/package.json +10 -10
package/dist/svelte/index.cjs
CHANGED
|
@@ -1,2 +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/plugin-tiling"),r=require("@embedpdf/core/svelte"),i=require("@embedpdf/models"),n=require("svelte");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("svelte/internal/disclose-version");const e=require("svelte/internal/client"),t=require("@embedpdf/plugin-tiling"),r=require("@embedpdf/core/svelte"),i=require("@embedpdf/models"),n=require("svelte");function l(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 s=l(e),o=()=>r.useCapability(t.TilingPlugin.id);var c=s.from_html('<img alt=""/>');function a(e,t){s.push(t,!0);const r=o();let l=s.state(""),a=null;const d=s.derived((()=>t.tile.id)),g=s.derived((()=>t.tile.srcScale)),p=s.derived((()=>t.tile.screenRect)),u=s.derived((()=>t.scale/s.get(g)));s.user_effect((()=>{var e;s.get(d);const o=t.pageIndex;if(a)return;if(!r)return;const c=n.untrack((()=>{return e=t.tile,{...e,pageRect:{origin:{x:e.pageRect.origin.x,y:e.pageRect.origin.y},size:{width:e.pageRect.size.width,height:e.pageRect.size.height}},screenRect:{origin:{x:e.screenRect.origin.x,y:e.screenRect.origin.y},size:{width:e.screenRect.size.width,height:e.screenRect.size.height}}};var e})),g=null==(e=r.provides)?void 0:e.renderTile({pageIndex:o,tile:c,dpr:t.dpr});return null==g||g.wait((e=>{const t=URL.createObjectURL(e);a=t,s.set(l,t,!0)}),i.ignore),()=>{a?(URL.revokeObjectURL(a),a=null):null==g||g.abort({code:i.PdfErrorCode.Cancelled,message:"canceled render task"})}}));const f=()=>{a&&(URL.revokeObjectURL(a),a=null)};var v=s.comment(),h=s.first_child(v),b=e=>{var t=c();let r;s.template_effect((e=>{s.set_attribute(t,"src",s.get(l)),r=s.set_style(t,"",r,e)}),[()=>({position:"absolute",left:s.get(p).origin.x*s.get(u)+"px",top:s.get(p).origin.y*s.get(u)+"px",width:s.get(p).size.width*s.get(u)+"px",height:s.get(p).size.height*s.get(u)+"px",display:"block"})]),s.event("load",t,f),s.replay_events(t),s.append(e,t)};s.if(h,(e=>{s.get(l)&&e(b)})),s.append(e,v),s.pop()}var d=s.from_html("<div></div>");exports.TileImg=a,exports.TilingLayer=function(e,t){s.push(t,!0);let i=s.rest_props(t,["$$slots","$$events","$$legacy","pageIndex","scale","class"]);const n=o();let l=s.state(s.proxy([]));const c=r.useCoreState();s.user_effect((()=>{if(n.provides)return n.provides.onTileRendering((e=>{s.set(l,e[t.pageIndex]??[],!0)}))}));var g=d();s.attribute_effect(g,(()=>({class:t.class,...i}))),s.each(g,21,(()=>s.get(l)),(e=>{var t,r;return`${null==(r=null==(t=c.coreState)?void 0:t.document)?void 0:r.id}-${e.id}`}),((e,r)=>{a(e,{get pageIndex(){return t.pageIndex},get tile(){return s.get(r)},dpr:window.devicePixelRatio,get scale(){return t.scale}})})),s.reset(g),s.append(e,g),s.pop()},exports.useTilingCapability=o,exports.useTilingPlugin=()=>r.usePlugin(t.TilingPlugin.id),Object.keys(t).forEach((e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})}));
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-tiling.ts","../../src/svelte/components/TileImg.svelte","../../src/svelte/components/TilingLayer.svelte"],"sourcesContent":["import { TilingPlugin } from '@embedpdf/plugin-tiling';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useTilingPlugin = () => usePlugin<TilingPlugin>(TilingPlugin.id);\nexport const useTilingCapability = () => useCapability<TilingPlugin>(TilingPlugin.id);\n","<script lang=\"ts\">\n import type { Tile } from '@embedpdf/plugin-tiling';\n import { useTilingCapability } from '../hooks';\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { untrack } from 'svelte';\n\n interface TileImgProps {\n pageIndex: number;\n tile: Tile;\n dpr: number;\n scale: number;\n }\n\n let { pageIndex, tile, dpr, scale }: TileImgProps = $props();\n const
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-tiling.ts","../../src/svelte/components/TileImg.svelte","../../src/svelte/components/TilingLayer.svelte"],"sourcesContent":["import { TilingPlugin } from '@embedpdf/plugin-tiling';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useTilingPlugin = () => usePlugin<TilingPlugin>(TilingPlugin.id);\nexport const useTilingCapability = () => useCapability<TilingPlugin>(TilingPlugin.id);\n","<script lang=\"ts\">\n import type { Tile } from '@embedpdf/plugin-tiling';\n import { useTilingCapability } from '../hooks';\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { untrack } from 'svelte';\n\n interface TileImgProps {\n pageIndex: number;\n tile: Tile;\n dpr: number;\n scale: number;\n }\n\n let { pageIndex, tile, dpr, scale }: TileImgProps = $props();\n const tilingCapability = useTilingCapability();\n let url = $state<string>('');\n // urlRef is NOT reactive - similar to React's useRef\n let urlRef: string | null = null;\n\n // Capture these values once per tile change\n const tileId = $derived(tile.id);\n const tileSrcScale = $derived(tile.srcScale);\n const tileScreenRect = $derived(tile.screenRect);\n const relativeScale = $derived(scale / tileSrcScale);\n\n const createPlainTile = (t: Tile): Tile => ({\n ...t,\n pageRect: {\n origin: { x: t.pageRect.origin.x, y: t.pageRect.origin.y },\n size: { width: t.pageRect.size.width, height: t.pageRect.size.height },\n },\n screenRect: {\n origin: { x: t.screenRect.origin.x, y: t.screenRect.origin.y },\n size: { width: t.screenRect.size.width, height: t.screenRect.size.height },\n },\n });\n\n /* kick off render exactly once per tile */\n $effect(() => {\n // Track only tileId and pageIndex as dependencies (like React's [pageIndex, tile.id])\n const _tileId = tileId;\n const _pageIndex = pageIndex;\n\n // Check if we already have a URL for this tile (already rendered)\n if (urlRef) return;\n\n if (!tilingCapability) return;\n\n // Clone to avoid reactive proxies that Web Workers cannot clone\n const plainTile = untrack(() => createPlainTile(tile));\n const task = tilingCapability.provides?.renderTile({\n pageIndex: _pageIndex,\n tile: plainTile,\n dpr,\n });\n task?.wait((blob) => {\n const objectUrl = URL.createObjectURL(blob);\n urlRef = objectUrl;\n url = objectUrl;\n }, ignore);\n\n return () => {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n } else {\n task?.abort({\n code: PdfErrorCode.Cancelled,\n message: 'canceled render task',\n });\n }\n };\n });\n\n const handleImageLoad = () => {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n }\n };\n</script>\n\n{#if url}\n <img\n src={url}\n alt=\"\"\n onload={handleImageLoad}\n style:position=\"absolute\"\n style:left={`${tileScreenRect.origin.x * relativeScale}px`}\n style:top={`${tileScreenRect.origin.y * relativeScale}px`}\n style:width={`${tileScreenRect.size.width * relativeScale}px`}\n style:height={`${tileScreenRect.size.height * relativeScale}px`}\n style:display=\"block\"\n />\n{/if}\n","<script lang=\"ts\">\n import type { Tile } from '@embedpdf/plugin-tiling';\n import { useCoreState } from '@embedpdf/core/svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n import TileImg from './TileImg.svelte';\n import { useTilingCapability } from '../hooks';\n\n type TilingLayoutProps = HTMLAttributes<HTMLDivElement> & {\n pageIndex: number;\n scale: number;\n class?: string;\n };\n\n let { pageIndex, scale, class: propsClass, ...restProps }: TilingLayoutProps = $props();\n\n const tilingCapability = useTilingCapability();\n let tiles = $state<Tile[]>([]);\n\n const core = useCoreState();\n\n $effect(() => {\n if (!tilingCapability.provides) return;\n return tilingCapability.provides.onTileRendering((tilesMap) => {\n tiles = tilesMap[pageIndex] ?? [];\n });\n });\n</script>\n\n<div class={propsClass} {...restProps}>\n {#each tiles as tile (`${core.coreState?.document?.id}-${tile.id}`)}\n <TileImg {pageIndex} {tile} dpr={window.devicePixelRatio} {scale} />\n {/each}\n</div>\n"],"names":["useTilingCapability","useCapability","TilingPlugin","id","tilingCapability","url","urlRef","tileId","tileSrcScale","srcScale","tileScreenRect","screenRect","relativeScale","$","user_effect","_pageIndex","$$props","pageIndex","plainTile","untrack","createPlainTile","t","tile","pageRect","origin","x","y","size","width","height","task","_a","provides","renderTile","dpr","wait","blob","objectUrl","URL","createObjectURL","$__namespace","set","ignore","revokeObjectURL","abort","code","PdfErrorCode","Cancelled","message","handleImageLoad","left","get","top","consequent","restProps","rest_props","tiles","state","proxy","core","useCoreState","onTileRendering","tilesMap","each","div","_b","coreState","document","window","devicePixelRatio","usePlugin"],"mappings":"wjBAIaA,EAAsB,IAAMC,gBAA4BC,EAAAA,aAAaC,oECU1E,MAAAC,EAAmBJ,IACrB,IAAAK,UAAqB,IAErBC,EAAwB,KAGtB,MAAAC,wBAAuBJ,KACvBK,wBAA6BC,WAC7BC,wBAA+BC,aAC/BC,+BAAiCJ,KAevCK,EAAAC,aAAc,iBAEIP,SACVQ,EAAUC,EAAAC,aAGZX,EAAM,WAELF,EAAgB,aAGfc,EAAYC,EAAAA,SAAO,KAAOC,OAxBTC,EAwBwBL,EAAAM,KAxBjB,IAC3BD,EACHE,SAAQ,CACNC,QAAUC,EAAGJ,EAAEE,SAASC,OAAOC,EAAGC,EAAGL,EAAEE,SAASC,OAAOE,GACvDC,MAAQC,MAAOP,EAAEE,SAASI,KAAKC,MAAOC,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C,IAChDtB,EAAAC,IAAAe,EAAQM,EAAQ9C,EAAAC,YAAA,IAAA,EAAA,GACjB,2DAIuBqC,MACnBd,EAAAuB,KAAAC,EAAA,IAAA,IAAAnD,EAAAsC,IAAAK,KAASlC,YAAS,MAAA,GAAA,OAAA2C,EAAA,OAAAlC,EAAA4B,EAAKO,gBAAW,EAAAnC,EAAAoC,mBAAUhE,MAAMmB,EAAKnB,IAAE,OAAhDmB,0EACmBY,IAAAkC,OAAOC,kFAJ5C,wDFvB+B,IAAMC,YAAwBpE,EAAAA,aAAaC"}
|
package/dist/svelte/index.js
CHANGED
|
@@ -10,7 +10,7 @@ const useTilingCapability = () => useCapability(TilingPlugin.id);
|
|
|
10
10
|
var root_1 = $.from_html(`<img alt=""/>`);
|
|
11
11
|
function TileImg($$anchor, $$props) {
|
|
12
12
|
$.push($$props, true);
|
|
13
|
-
const
|
|
13
|
+
const tilingCapability = useTilingCapability();
|
|
14
14
|
let url = $.state("");
|
|
15
15
|
let urlRef = null;
|
|
16
16
|
const tileId = $.derived(() => $$props.tile.id);
|
|
@@ -32,13 +32,14 @@ function TileImg($$anchor, $$props) {
|
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
$.user_effect(() => {
|
|
35
|
+
var _a;
|
|
35
36
|
$.get(tileId);
|
|
36
37
|
const _pageIndex = $$props.pageIndex;
|
|
37
38
|
if (urlRef) return;
|
|
38
|
-
if (
|
|
39
|
+
if (!tilingCapability) return;
|
|
39
40
|
const plainTile = untrack(() => createPlainTile($$props.tile));
|
|
40
|
-
const task =
|
|
41
|
-
task.wait(
|
|
41
|
+
const task = (_a = tilingCapability.provides) == null ? void 0 : _a.renderTile({ pageIndex: _pageIndex, tile: plainTile, dpr: $$props.dpr });
|
|
42
|
+
task == null ? void 0 : task.wait(
|
|
42
43
|
(blob) => {
|
|
43
44
|
const objectUrl = URL.createObjectURL(blob);
|
|
44
45
|
urlRef = objectUrl;
|
|
@@ -51,7 +52,7 @@ function TileImg($$anchor, $$props) {
|
|
|
51
52
|
URL.revokeObjectURL(urlRef);
|
|
52
53
|
urlRef = null;
|
|
53
54
|
} else {
|
|
54
|
-
task.abort({
|
|
55
|
+
task == null ? void 0 : task.abort({
|
|
55
56
|
code: PdfErrorCode.Cancelled,
|
|
56
57
|
message: "canceled render task"
|
|
57
58
|
});
|
|
@@ -108,12 +109,12 @@ function TilingLayer($$anchor, $$props) {
|
|
|
108
109
|
"scale",
|
|
109
110
|
"class"
|
|
110
111
|
]);
|
|
111
|
-
const
|
|
112
|
+
const tilingCapability = useTilingCapability();
|
|
112
113
|
let tiles = $.state($.proxy([]));
|
|
113
|
-
|
|
114
|
+
const core = useCoreState();
|
|
114
115
|
$.user_effect(() => {
|
|
115
|
-
if (
|
|
116
|
-
return
|
|
116
|
+
if (!tilingCapability.provides) return;
|
|
117
|
+
return tilingCapability.provides.onTileRendering((tilesMap) => {
|
|
117
118
|
$.set(tiles, tilesMap[$$props.pageIndex] ?? [], true);
|
|
118
119
|
});
|
|
119
120
|
});
|
|
@@ -121,7 +122,7 @@ function TilingLayer($$anchor, $$props) {
|
|
|
121
122
|
$.attribute_effect(div, () => ({ class: $$props.class, ...restProps }));
|
|
122
123
|
$.each(div, 21, () => $.get(tiles), (tile) => {
|
|
123
124
|
var _a, _b;
|
|
124
|
-
return `${(_b = (_a =
|
|
125
|
+
return `${(_b = (_a = core.coreState) == null ? void 0 : _a.document) == null ? void 0 : _b.id}-${tile.id}`;
|
|
125
126
|
}, ($$anchor2, tile) => {
|
|
126
127
|
TileImg($$anchor2, {
|
|
127
128
|
get pageIndex() {
|
package/dist/svelte/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-tiling.ts","../../src/svelte/components/TileImg.svelte","../../src/svelte/components/TilingLayer.svelte"],"sourcesContent":["import { TilingPlugin } from '@embedpdf/plugin-tiling';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useTilingPlugin = () => usePlugin<TilingPlugin>(TilingPlugin.id);\nexport const useTilingCapability = () => useCapability<TilingPlugin>(TilingPlugin.id);\n","<script lang=\"ts\">\n import type { Tile } from '@embedpdf/plugin-tiling';\n import { useTilingCapability } from '../hooks';\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { untrack } from 'svelte';\n\n interface TileImgProps {\n pageIndex: number;\n tile: Tile;\n dpr: number;\n scale: number;\n }\n\n let { pageIndex, tile, dpr, scale }: TileImgProps = $props();\n const
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-tiling.ts","../../src/svelte/components/TileImg.svelte","../../src/svelte/components/TilingLayer.svelte"],"sourcesContent":["import { TilingPlugin } from '@embedpdf/plugin-tiling';\nimport { useCapability, usePlugin } from '@embedpdf/core/svelte';\n\nexport const useTilingPlugin = () => usePlugin<TilingPlugin>(TilingPlugin.id);\nexport const useTilingCapability = () => useCapability<TilingPlugin>(TilingPlugin.id);\n","<script lang=\"ts\">\n import type { Tile } from '@embedpdf/plugin-tiling';\n import { useTilingCapability } from '../hooks';\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { untrack } from 'svelte';\n\n interface TileImgProps {\n pageIndex: number;\n tile: Tile;\n dpr: number;\n scale: number;\n }\n\n let { pageIndex, tile, dpr, scale }: TileImgProps = $props();\n const tilingCapability = useTilingCapability();\n let url = $state<string>('');\n // urlRef is NOT reactive - similar to React's useRef\n let urlRef: string | null = null;\n\n // Capture these values once per tile change\n const tileId = $derived(tile.id);\n const tileSrcScale = $derived(tile.srcScale);\n const tileScreenRect = $derived(tile.screenRect);\n const relativeScale = $derived(scale / tileSrcScale);\n\n const createPlainTile = (t: Tile): Tile => ({\n ...t,\n pageRect: {\n origin: { x: t.pageRect.origin.x, y: t.pageRect.origin.y },\n size: { width: t.pageRect.size.width, height: t.pageRect.size.height },\n },\n screenRect: {\n origin: { x: t.screenRect.origin.x, y: t.screenRect.origin.y },\n size: { width: t.screenRect.size.width, height: t.screenRect.size.height },\n },\n });\n\n /* kick off render exactly once per tile */\n $effect(() => {\n // Track only tileId and pageIndex as dependencies (like React's [pageIndex, tile.id])\n const _tileId = tileId;\n const _pageIndex = pageIndex;\n\n // Check if we already have a URL for this tile (already rendered)\n if (urlRef) return;\n\n if (!tilingCapability) return;\n\n // Clone to avoid reactive proxies that Web Workers cannot clone\n const plainTile = untrack(() => createPlainTile(tile));\n const task = tilingCapability.provides?.renderTile({\n pageIndex: _pageIndex,\n tile: plainTile,\n dpr,\n });\n task?.wait((blob) => {\n const objectUrl = URL.createObjectURL(blob);\n urlRef = objectUrl;\n url = objectUrl;\n }, ignore);\n\n return () => {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n } else {\n task?.abort({\n code: PdfErrorCode.Cancelled,\n message: 'canceled render task',\n });\n }\n };\n });\n\n const handleImageLoad = () => {\n if (urlRef) {\n URL.revokeObjectURL(urlRef);\n urlRef = null;\n }\n };\n</script>\n\n{#if url}\n <img\n src={url}\n alt=\"\"\n onload={handleImageLoad}\n style:position=\"absolute\"\n style:left={`${tileScreenRect.origin.x * relativeScale}px`}\n style:top={`${tileScreenRect.origin.y * relativeScale}px`}\n style:width={`${tileScreenRect.size.width * relativeScale}px`}\n style:height={`${tileScreenRect.size.height * relativeScale}px`}\n style:display=\"block\"\n />\n{/if}\n","<script lang=\"ts\">\n import type { Tile } from '@embedpdf/plugin-tiling';\n import { useCoreState } from '@embedpdf/core/svelte';\n import type { HTMLAttributes } from 'svelte/elements';\n import TileImg from './TileImg.svelte';\n import { useTilingCapability } from '../hooks';\n\n type TilingLayoutProps = HTMLAttributes<HTMLDivElement> & {\n pageIndex: number;\n scale: number;\n class?: string;\n };\n\n let { pageIndex, scale, class: propsClass, ...restProps }: TilingLayoutProps = $props();\n\n const tilingCapability = useTilingCapability();\n let tiles = $state<Tile[]>([]);\n\n const core = useCoreState();\n\n $effect(() => {\n if (!tilingCapability.provides) return;\n return tilingCapability.provides.onTileRendering((tilesMap) => {\n tiles = tilesMap[pageIndex] ?? [];\n });\n });\n</script>\n\n<div class={propsClass} {...restProps}>\n {#each tiles as tile (`${core.coreState?.document?.id}-${tile.id}`)}\n <TileImg {pageIndex} {tile} dpr={window.devicePixelRatio} {scale} />\n {/each}\n</div>\n"],"names":[],"mappings":";;;;;;;AAGO,MAAM,kBAAkB,MAAM,UAAwB,aAAa,EAAE;AACrE,MAAM,sBAAsB,MAAM,cAA4B,aAAa,EAAE;;oCCJpF;;AAcQ,QAAA,mBAAmB,oBAAmB;AACxC,MAAA,cAAqB,EAAE;AAEvB,MAAA,SAAwB;AAGtB,QAAA,sCAAuB,EAAE;AACzB,QAAA,4CAA6B,QAAQ;AACrC,QAAA,8CAA+B,UAAU;AACzC,QAAA,sDAAiC,YAAY,CAAA;AAE7C,QAAA,mBAAmB,OAAO;AAAA,OAC3B;AAAA,IACH,UAAQ;AAAA,MACN,UAAU,GAAG,EAAE,SAAS,OAAO,GAAG,GAAG,EAAE,SAAS,OAAO,EAAC;AAAA,MACxD,QAAQ,OAAO,EAAE,SAAS,KAAK,OAAO,QAAQ,EAAE,SAAS,KAAK,OAAM;AAAA;IAEtE,YAAU;AAAA,MACR,UAAU,GAAG,EAAE,WAAW,OAAO,GAAG,GAAG,EAAE,WAAW,OAAO,EAAC;AAAA,MAC5D,MAAI;AAAA,QAAI,OAAO,EAAE,WAAW,KAAK;AAAA,QAAO,QAAQ,EAAE,WAAW,KAAK;AAAA;;;AAKtE,IAAA,YAAc,MAAA;;UAEI,MAAM;UAChB,aAAU,QAAA;QAGZ,OAAM;SAEL,iBAAgB;UAGf,YAAY,QAAO,MAAO,gBAAe,QAAA,IAAA,CAAA;AACzC,UAAA,QAAO,sBAAiB,aAAjB,mBAA2B,WAAU,EAChD,WAAW,YACX,MAAM,WACN,KAAG,QAAA,IAAA;AAEL,iCAAM;AAAA,MAAM,CAAA,SAAS;AACb,cAAA,YAAY,IAAI,gBAAgB,IAAI;AAC1C,iBAAS;AACT,UAAA,IAA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BAA0B,EAAE,IAAI,KAAK,EAAE;AAAA,iBAAhD,SAAI;;;;;;;;MACe,KAAA,OAAO;AAAA;;;;;;;;AAJ5C;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-tiling",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -35,16 +35,16 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@embedpdf/models": "1.4.
|
|
38
|
+
"@embedpdf/models": "1.4.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/react": "^18.2.0",
|
|
42
42
|
"typescript": "^5.0.0",
|
|
43
|
-
"@embedpdf/core": "1.4.
|
|
43
|
+
"@embedpdf/core": "1.4.1",
|
|
44
44
|
"@embedpdf/build": "1.1.0",
|
|
45
|
-
"@embedpdf/plugin-
|
|
46
|
-
"@embedpdf/plugin-viewport": "1.4.
|
|
47
|
-
"@embedpdf/plugin-
|
|
45
|
+
"@embedpdf/plugin-scroll": "1.4.1",
|
|
46
|
+
"@embedpdf/plugin-viewport": "1.4.1",
|
|
47
|
+
"@embedpdf/plugin-render": "1.4.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": ">=16.8.0",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"preact": "^10.26.4",
|
|
53
53
|
"vue": ">=3.2.0",
|
|
54
54
|
"svelte": ">=5 <6",
|
|
55
|
-
"@embedpdf/
|
|
56
|
-
"@embedpdf/plugin-scroll": "1.4.
|
|
57
|
-
"@embedpdf/plugin-viewport": "1.4.
|
|
58
|
-
"@embedpdf/
|
|
55
|
+
"@embedpdf/plugin-render": "1.4.1",
|
|
56
|
+
"@embedpdf/plugin-scroll": "1.4.1",
|
|
57
|
+
"@embedpdf/plugin-viewport": "1.4.1",
|
|
58
|
+
"@embedpdf/core": "1.4.1"
|
|
59
59
|
},
|
|
60
60
|
"files": [
|
|
61
61
|
"dist",
|