@embedpdf/plugin-stamp 2.14.4 → 2.15.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.
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-stamp"),r=require("svelte/internal/client"),s=require("@embedpdf/core/svelte");require("svelte/internal/disclose-version");const o=require("@embedpdf/models");function i(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const n=i(r),a=()=>s.useCapability(t.StampPlugin.id);var p=n.from_html("<img/>");const c=e.createPluginPackage(t.StampPluginPackage).build();exports.StampImg=function(e,t){n.push(t,!0);const r=n.rest_props(t,["$$slots","$$events","$$legacy","libraryId","pageIndex","width","dpr"]),s=a();let i=n.state(void 0),c=null;n.user_effect(()=>{if(!s.provides)return;const e=s.provides.renderStamp(t.libraryId,t.pageIndex,t.width,t.dpr??window.devicePixelRatio);return e.wait(e=>{const t=URL.createObjectURL(e);c=t,n.set(i,t,!0)},o.ignore),()=>{c?(URL.revokeObjectURL(c),c=null):e.abort({code:o.PdfErrorCode.Cancelled,message:"canceled stamp render task"})}});const u=()=>{c&&(URL.revokeObjectURL(c),c=null)};var l=n.comment(),d=n.first_child(l),g=e=>{var t=p();n.attribute_effect(t,()=>({src:n.get(i),onload:u,...r,alt:"Stamp preview"})),n.replay_events(t),n.append(e,t)};n.if(d,e=>{n.get(i)&&e(g)}),n.append(e,l),n.pop()},exports.StampPluginPackage=c,exports.useActiveStamp=function(e){const t=a();let r=n.state(null);const s=n.derived(e);return n.user_effect(()=>{if(!t.provides||!n.get(s))return void n.set(r,null);const e=t.provides.forDocument(n.get(s));return n.set(r,e.getActiveStamp(),!0),e.onActiveStampChange(e=>{n.set(r,e,!0)})}),{get activeStamp(){return n.get(r)}}},exports.useStampCapability=a,exports.useStampLibraries=function(){const e=a();let t=n.state(n.proxy([]));return n.user_effect(()=>{if(e.provides)return n.set(t,e.provides.getLibraries(),!0),e.provides.onLibraryChange(e=>{n.set(t,e,!0)});n.set(t,[],!0)}),{get libraries(){return n.get(t)}}},exports.useStampPlugin=()=>s.usePlugin(t.StampPlugin.id),exports.useStampsByCategory=function(e){const t=a();let r=n.state(n.proxy([]));const s=n.derived(e);return n.user_effect(()=>{if(t.provides)return n.set(r,t.provides.getStampsByCategory(n.get(s)),!0),t.provides.onLibraryChange(()=>{n.set(r,t.provides.getStampsByCategory(n.get(s)),!0)});n.set(r,[],!0)}),{get stamps(){return n.get(r)}}},exports.useStampsByLibrary=function(e,t){const r=a();let s=n.state(n.proxy([]));const o=n.derived(e),i=n.derived(()=>null==t?void 0:t());return n.user_effect(()=>{if(!r.provides)return void n.set(s,[],!0);const e=()=>{var e,t;const a=r.provides.getLibraries(),p=[];for(const r of a)if(!n.get(o)||"all"===n.get(o)||r.id===n.get(o))for(const s of r.stamps){if(n.get(i)){const o=(null==(e=r.categories)?void 0:e.includes(n.get(i)))??!1,a=(null==(t=s.categories)?void 0:t.includes(n.get(i)))??!1;if(!o&&!a)continue}p.push({library:r,stamp:s})}n.set(s,p,!0)};return e(),r.provides.onLibraryChange(e)}),{get stamps(){return n.get(s)}}},Object.keys(t).forEach(e=>{"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/plugin-stamp"),r=require("svelte/internal/client"),s=require("@embedpdf/core/svelte");require("svelte/internal/disclose-version");const n=require("@embedpdf/models");function o(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const i=o(r),a=()=>s.useCapability(t.StampPlugin.id);var c=i.from_html("<img/>");const p=e.createPluginPackage(t.StampPluginPackage).build();exports.StampImg=function(e,t){i.push(t,!0);const r=function(e,t,r){const s=t instanceof Set?t:new Set(t);"function"!=typeof s.includes&&(s.includes=Set.prototype.has.bind(s));return i.rest_props(e,s,r)}(t,["$$slots","$$events","$$legacy","libraryId","pageIndex","width","dpr"]),s=a();let o=i.state(void 0),p=null;i.user_effect(()=>{if(!s.provides)return;const e=s.provides.renderStamp(t.libraryId,t.pageIndex,t.width,t.dpr??window.devicePixelRatio);return e.wait(e=>{const t=URL.createObjectURL(e);p=t,i.set(o,t,!0)},n.ignore),()=>{p?(URL.revokeObjectURL(p),p=null):e.abort({code:n.PdfErrorCode.Cancelled,message:"canceled stamp render task"})}});const u=()=>{p&&(URL.revokeObjectURL(p),p=null)};var d=i.comment(),l=i.first_child(d),g=e=>{var t=c();i.attribute_effect(t,()=>({src:i.get(o),onload:u,...r,alt:"Stamp preview"})),i.replay_events(t),i.append(e,t)};i.if(l,e=>{i.get(o)&&e(g)}),i.append(e,d),i.pop()},exports.StampPluginPackage=p,exports.useActiveStamp=function(e){const t=a();let r=i.state(null);const s=i.derived(e);return i.user_effect(()=>{if(!t.provides||!i.get(s))return void i.set(r,null);const e=t.provides.forDocument(i.get(s));return i.set(r,e.getActiveStamp(),!0),e.onActiveStampChange(e=>{i.set(r,e,!0)})}),{get activeStamp(){return i.get(r)}}},exports.useStampCapability=a,exports.useStampLibraries=function(){const e=a();let t=i.state(i.proxy([]));return i.user_effect(()=>{if(e.provides)return i.set(t,e.provides.getLibraries(),!0),e.provides.onLibraryChange(e=>{i.set(t,e,!0)});i.set(t,[],!0)}),{get libraries(){return i.get(t)}}},exports.useStampPlugin=()=>s.usePlugin(t.StampPlugin.id),exports.useStampsByCategory=function(e){const t=a();let r=i.state(i.proxy([]));const s=i.derived(e);return i.user_effect(()=>{if(t.provides)return i.set(r,t.provides.getStampsByCategory(i.get(s)),!0),t.provides.onLibraryChange(()=>{i.set(r,t.provides.getStampsByCategory(i.get(s)),!0)});i.set(r,[],!0)}),{get stamps(){return i.get(r)}}},exports.useStampsByLibrary=function(e,t){const r=a();let s=i.state(i.proxy([]));const n=i.derived(e),o=i.derived(()=>null==t?void 0:t());return i.user_effect(()=>{if(!r.provides)return void i.set(s,[],!0);const e=()=>{var e,t;const a=r.provides.getLibraries(),c=[];for(const r of a)if(!i.get(n)||"all"===i.get(n)||r.id===i.get(n))for(const s of r.stamps){if(i.get(o)){const n=(null==(e=r.categories)?void 0:e.includes(i.get(o)))??!1,a=(null==(t=s.categories)?void 0:t.includes(i.get(o)))??!1;if(!n&&!a)continue}c.push({library:r,stamp:s})}i.set(s,c,!0)};return e(),r.provides.onLibraryChange(e)}),{get stamps(){return i.get(s)}}},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-stamp.svelte.ts","../../src/svelte/index.ts","../../src/svelte/components/StampImg.svelte"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { StampPlugin } from '@embedpdf/plugin-stamp';\nimport type { ResolvedStamp, StampLibrary, ActiveStampInfo } from '@embedpdf/plugin-stamp';\n\nexport const useStampPlugin = () => usePlugin<StampPlugin>(StampPlugin.id);\nexport const useStampCapability = () => useCapability<StampPlugin>(StampPlugin.id);\n\nexport function useStampLibraries() {\n const capability = useStampCapability();\n let libraries = $state<StampLibrary[]>([]);\n\n $effect(() => {\n if (!capability.provides) {\n libraries = [];\n return;\n }\n\n libraries = capability.provides.getLibraries();\n return capability.provides.onLibraryChange((libs) => {\n libraries = libs;\n });\n });\n\n return {\n get libraries() {\n return libraries;\n },\n };\n}\n\nexport function useStampsByCategory(getCategory: () => string) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const category = $derived(getCategory());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n stamps = capability.provides.getStampsByCategory(category);\n return capability.provides.onLibraryChange(() => {\n stamps = capability.provides!.getStampsByCategory(category);\n });\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useStampsByLibrary(\n getLibraryId: () => string | undefined,\n getCategory?: () => string | undefined,\n) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const libraryId = $derived(getLibraryId());\n const category = $derived(getCategory?.());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n const derive = () => {\n const libraries = capability.provides!.getLibraries();\n const results: ResolvedStamp[] = [];\n\n for (const library of libraries) {\n if (libraryId && libraryId !== 'all' && library.id !== libraryId) continue;\n\n for (const stamp of library.stamps) {\n if (category) {\n const libraryMatches = library.categories?.includes(category) ?? false;\n const stampMatches = stamp.categories?.includes(category) ?? false;\n if (!libraryMatches && !stampMatches) continue;\n }\n results.push({ library, stamp });\n }\n }\n\n stamps = results;\n };\n\n derive();\n return capability.provides.onLibraryChange(derive);\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useActiveStamp(getDocumentId: () => string) {\n const capability = useStampCapability();\n let activeStamp = $state<ActiveStampInfo | null>(null);\n const documentId = $derived(getDocumentId());\n\n $effect(() => {\n if (!capability.provides || !documentId) {\n activeStamp = null;\n return;\n }\n\n const scope = capability.provides.forDocument(documentId);\n activeStamp = scope.getActiveStamp();\n return scope.onActiveStampChange((stamp) => {\n activeStamp = stamp;\n });\n });\n\n return {\n get activeStamp() {\n return activeStamp;\n },\n };\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { StampPluginPackage as BaseStampPackage } from '@embedpdf/plugin-stamp';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-stamp';\n\nexport const StampPluginPackage = createPluginPackage(BaseStampPackage).build();\n","<script lang=\"ts\">\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { useStampCapability } from '../hooks';\n import type { HTMLImgAttributes } from 'svelte/elements';\n\n interface Props extends HTMLImgAttributes {\n libraryId: string;\n pageIndex: number;\n width: number;\n dpr?: number;\n }\n\n const { libraryId, pageIndex, width, dpr, ...imgProps }: Props = $props();\n\n const stampCapability = useStampCapability();\n\n let url = $state<string | undefined>(undefined);\n let urlRef: string | null = null;\n\n $effect(() => {\n if (!stampCapability.provides) return;\n\n const task = stampCapability.provides.renderStamp(\n libraryId,\n pageIndex,\n width,\n dpr ?? window.devicePixelRatio,\n );\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 stamp 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 src={url} onload={handleImageLoad} {...imgProps} alt=\"Stamp preview\" />\n{/if}\n"],"names":["useStampCapability","useCapability","StampPlugin","id","StampPluginPackage","createPluginPackage","BaseStampPackage","build","imgProps","$","rest_props","$$props","stampCapability","url","state","urlRef","user_effect","provides","task","renderStamp","libraryId","pageIndex","width","dpr","window","devicePixelRatio","wait","blob","objectUrl","URL","createObjectURL","set","ignore","revokeObjectURL","abort","code","PdfErrorCode","Cancelled","message","handleImageLoad","img","root_1","consequent","getDocumentId","capability","activeStamp","documentId","get","scope","forDocument","getActiveStamp","onActiveStampChange","stamp","libraries","proxy","getLibraries","onLibraryChange","libs","usePlugin","getCategory","stamps","category","getStampsByCategory","getLibraryId","derive","results","library","libraryMatches","_a","categories","includes","stampMatches","_b","push"],"m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AASd,SAC1B,CAGF3C,EAAAsB,IAAA6B,EAASK,GAAA,IAIJ,OADPD,IACOpB,EAAW3B,SAASuC,gBAAgBQ,MAIvC,UAAAJ,gBACKA,EACT,EAEJ"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/svelte/hooks/use-stamp.svelte.ts","../../src/svelte/index.ts","../../src/svelte/components/StampImg.svelte"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { StampPlugin } from '@embedpdf/plugin-stamp';\nimport type { ResolvedStamp, StampLibrary, ActiveStampInfo } from '@embedpdf/plugin-stamp';\n\nexport const useStampPlugin = () => usePlugin<StampPlugin>(StampPlugin.id);\nexport const useStampCapability = () => useCapability<StampPlugin>(StampPlugin.id);\n\nexport function useStampLibraries() {\n const capability = useStampCapability();\n let libraries = $state<StampLibrary[]>([]);\n\n $effect(() => {\n if (!capability.provides) {\n libraries = [];\n return;\n }\n\n libraries = capability.provides.getLibraries();\n return capability.provides.onLibraryChange((libs) => {\n libraries = libs;\n });\n });\n\n return {\n get libraries() {\n return libraries;\n },\n };\n}\n\nexport function useStampsByCategory(getCategory: () => string) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const category = $derived(getCategory());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n stamps = capability.provides.getStampsByCategory(category);\n return capability.provides.onLibraryChange(() => {\n stamps = capability.provides!.getStampsByCategory(category);\n });\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useStampsByLibrary(\n getLibraryId: () => string | undefined,\n getCategory?: () => string | undefined,\n) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const libraryId = $derived(getLibraryId());\n const category = $derived(getCategory?.());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n const derive = () => {\n const libraries = capability.provides!.getLibraries();\n const results: ResolvedStamp[] = [];\n\n for (const library of libraries) {\n if (libraryId && libraryId !== 'all' && library.id !== libraryId) continue;\n\n for (const stamp of library.stamps) {\n if (category) {\n const libraryMatches = library.categories?.includes(category) ?? false;\n const stampMatches = stamp.categories?.includes(category) ?? false;\n if (!libraryMatches && !stampMatches) continue;\n }\n results.push({ library, stamp });\n }\n }\n\n stamps = results;\n };\n\n derive();\n return capability.provides.onLibraryChange(derive);\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useActiveStamp(getDocumentId: () => string) {\n const capability = useStampCapability();\n let activeStamp = $state<ActiveStampInfo | null>(null);\n const documentId = $derived(getDocumentId());\n\n $effect(() => {\n if (!capability.provides || !documentId) {\n activeStamp = null;\n return;\n }\n\n const scope = capability.provides.forDocument(documentId);\n activeStamp = scope.getActiveStamp();\n return scope.onActiveStampChange((stamp) => {\n activeStamp = stamp;\n });\n });\n\n return {\n get activeStamp() {\n return activeStamp;\n },\n };\n}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { StampPluginPackage as BaseStampPackage } from '@embedpdf/plugin-stamp';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-stamp';\n\nexport const StampPluginPackage = createPluginPackage(BaseStampPackage).build();\n","<script lang=\"ts\">\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { useStampCapability } from '../hooks';\n import type { HTMLImgAttributes } from 'svelte/elements';\n\n interface Props extends HTMLImgAttributes {\n libraryId: string;\n pageIndex: number;\n width: number;\n dpr?: number;\n }\n\n const { libraryId, pageIndex, width, dpr, ...imgProps }: Props = $props();\n\n const stampCapability = useStampCapability();\n\n let url = $state<string | undefined>(undefined);\n let urlRef: string | null = null;\n\n $effect(() => {\n if (!stampCapability.provides) return;\n\n const task = stampCapability.provides.renderStamp(\n libraryId,\n pageIndex,\n width,\n dpr ?? window.devicePixelRatio,\n );\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 stamp 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 src={url} onload={handleImageLoad} {...imgProps} alt=\"Stamp preview\" />\n{/if}\n"],"names":["useStampCapability","useCapability","StampPlugin","id","StampPluginPackage","createPluginPackage","BaseStampPackage","build","imgProps","$$rest_props_compat","$$props","stampCapability","url","$","state","urlRef","user_effect","provides","task","renderStamp","libraryId","pageIndex","width","dpr","window","devicePixelRatio","wait","blob","objectUrl","URL","createObjectURL","set","ignore","revokeObjectURL","abort","code","PdfErrorCode","Cancelled","message","handleImageLoad","img","root_1","consequent","getDocumentId","capability","activeStamp","documentId","get","scope","forDocument","getActiveStamp","onActiveStampChange","stamp","libraries","proxy","getLibraries","onLibraryChange","libs","usePlugin","getCategory","stamps","category","getStampsByCategory","getLibraryId","derive","results","library","libraryMatches","_a","categories","includes","stampMatches","_b","push"],"mappings":"qkBAKaA,EAAA,IAA2BC,gBAA2BC,EAAAA,YAAYC,gCCExE,MAAMC,EAAqBC,EAAAA,oBAAoBC,EAAAA,oBAAkBC,0DCKzBC,yJAAQC,CAAAC,EAAA,yEAE/CC,EAAkBX,QAEpBY,EAAMC,EAAAC,WAA2B,GACjCC,EAAwB,KAE5BF,EAAAG,YAAO,KACA,IAAAL,EAAgBM,SAAQ,aAEvBC,EAAOP,EAAgBM,SAASE,YAAWT,EAAAU,UAAAV,EAAAW,UAAAX,EAAAY,MAAAZ,EAAAa,KAIxCC,OAAOC,kBASH,OANbP,EAAKQ,KAAMC,IACH,MAAAC,EAAYC,IAAIC,gBAAgBH,GACtCZ,EAASa,EACTf,EAAAkB,IAAAnB,EAAMgB,GAAS,IACdI,EAAAA,QAEU,KACPjB,GACFc,IAAII,gBAAgBlB,GACpBA,EAAS,MAETG,EAAKgB,MAAK,CACRC,KAAMC,E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ACT,EAEJ,6BAEgB,SACdG,EACAJ,GAEM,MAAAf,EAAa5C,IACf,IAAA4D,EAAS/C,EAAAC,MAAAD,EAAAyC,MAAA,KACP,MAAAlC,YAAqB2C,GACrBF,gBAAoB,MAAAF,OAAA,EAAAA,YAE1B9C,EAAAG,qBACO4B,EAAW3B,2BACd2C,EAAA,IAAA,GAII,MAAAI,eACE,MAAAX,EAAYT,EAAW3B,SAAUsC,eACjCU,eAEKC,KAAWb,YAChBjC,IAA2B,QAA3BP,EAAAkC,IAAa3B,IAAuB8C,EAAQ/D,WAAOiB,GAE5C,IAAA,MAAAgC,KAASc,EAAQN,OAAQ,CAC9B,GAAA/C,EAAAkC,IAAAc,GAAU,OACNM,GAAiB,OAAAC,IAAQC,iBAAR,EAAAD,EAAoBE,SAAAzD,EAAAkC,IAASc,OAAa,EAC3DU,GAAe,OAAAC,IAAMH,iBAAN,EAAAG,EAAkBF,SAAAzD,EAAAkC,IAASc,OAAa,EACxD,IAAAM,IAAmBI,EAAA,QAC1B,CACAN,EAAQQ,KAAA,CAAOP,UAASd,SAC1B,CAGFvC,EAAAkB,IAAA6B,EAASK,GAAA,IAIJ,OADPD,IACOpB,EAAW3B,SAASuC,gBAAgBQ,MAIvC,UAAAJ,gBACKA,EACT,EAEJ"}
@@ -106,7 +106,7 @@ function useActiveStamp(getDocumentId) {
106
106
  var root_1 = $.from_html(`<img/>`);
107
107
  function StampImg($$anchor, $$props) {
108
108
  $.push($$props, true);
109
- const imgProps = $.rest_props($$props, [
109
+ const imgProps = $$rest_props_compat($$props, [
110
110
  "$$slots",
111
111
  "$$events",
112
112
  "$$legacy",
@@ -168,6 +168,11 @@ function StampImg($$anchor, $$props) {
168
168
  $.append($$anchor, fragment);
169
169
  $.pop();
170
170
  }
171
+ function $$rest_props_compat(props, exclude, name) {
172
+ const set = exclude instanceof Set ? exclude : new Set(exclude);
173
+ if (typeof set.includes !== "function") set.includes = Set.prototype.has.bind(set);
174
+ return $.rest_props(props, set, name);
175
+ }
171
176
  const StampPluginPackage = createPluginPackage(StampPluginPackage$1).build();
172
177
  export {
173
178
  StampImg,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-stamp.svelte.ts","../../src/svelte/components/StampImg.svelte","../../src/svelte/index.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { StampPlugin } from '@embedpdf/plugin-stamp';\nimport type { ResolvedStamp, StampLibrary, ActiveStampInfo } from '@embedpdf/plugin-stamp';\n\nexport const useStampPlugin = () => usePlugin<StampPlugin>(StampPlugin.id);\nexport const useStampCapability = () => useCapability<StampPlugin>(StampPlugin.id);\n\nexport function useStampLibraries() {\n const capability = useStampCapability();\n let libraries = $state<StampLibrary[]>([]);\n\n $effect(() => {\n if (!capability.provides) {\n libraries = [];\n return;\n }\n\n libraries = capability.provides.getLibraries();\n return capability.provides.onLibraryChange((libs) => {\n libraries = libs;\n });\n });\n\n return {\n get libraries() {\n return libraries;\n },\n };\n}\n\nexport function useStampsByCategory(getCategory: () => string) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const category = $derived(getCategory());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n stamps = capability.provides.getStampsByCategory(category);\n return capability.provides.onLibraryChange(() => {\n stamps = capability.provides!.getStampsByCategory(category);\n });\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useStampsByLibrary(\n getLibraryId: () => string | undefined,\n getCategory?: () => string | undefined,\n) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const libraryId = $derived(getLibraryId());\n const category = $derived(getCategory?.());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n const derive = () => {\n const libraries = capability.provides!.getLibraries();\n const results: ResolvedStamp[] = [];\n\n for (const library of libraries) {\n if (libraryId && libraryId !== 'all' && library.id !== libraryId) continue;\n\n for (const stamp of library.stamps) {\n if (category) {\n const libraryMatches = library.categories?.includes(category) ?? false;\n const stampMatches = stamp.categories?.includes(category) ?? false;\n if (!libraryMatches && !stampMatches) continue;\n }\n results.push({ library, stamp });\n }\n }\n\n stamps = results;\n };\n\n derive();\n return capability.provides.onLibraryChange(derive);\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useActiveStamp(getDocumentId: () => string) {\n const capability = useStampCapability();\n let activeStamp = $state<ActiveStampInfo | null>(null);\n const documentId = $derived(getDocumentId());\n\n $effect(() => {\n if (!capability.provides || !documentId) {\n activeStamp = null;\n return;\n }\n\n const scope = capability.provides.forDocument(documentId);\n activeStamp = scope.getActiveStamp();\n return scope.onActiveStampChange((stamp) => {\n activeStamp = stamp;\n });\n });\n\n return {\n get activeStamp() {\n return activeStamp;\n },\n };\n}\n","<script lang=\"ts\">\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { useStampCapability } from '../hooks';\n import type { HTMLImgAttributes } from 'svelte/elements';\n\n interface Props extends HTMLImgAttributes {\n libraryId: string;\n pageIndex: number;\n width: number;\n dpr?: number;\n }\n\n const { libraryId, pageIndex, width, dpr, ...imgProps }: Props = $props();\n\n const stampCapability = useStampCapability();\n\n let url = $state<string | undefined>(undefined);\n let urlRef: string | null = null;\n\n $effect(() => {\n if (!stampCapability.provides) return;\n\n const task = stampCapability.provides.renderStamp(\n libraryId,\n pageIndex,\n width,\n dpr ?? window.devicePixelRatio,\n );\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 stamp 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 src={url} onload={handleImageLoad} {...imgProps} alt=\"Stamp preview\" />\n{/if}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { StampPluginPackage as BaseStampPackage } from '@embedpdf/plugin-stamp';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-stamp';\n\nexport const StampPluginPackage = createPluginPackage(BaseStampPackage).build();\n"],"names":["BaseStampPackage"],"mappings":";;;;;;;AAIa,MAAA,iBAAA,MAAuB,UAAuB,YAAY,EAAE;AAC5D,MAAA,qBAAA,MAA2B,cAA2B,YAAY,EAAE;AAEjE,SAAA,oBAAoB;AAC5B,QAAA,aAAa,mBAAA;AACf,MAAA,YAAY,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA,CAAA;AAEhB,IAAA,kBAAc;SACP,WAAW,UAAU;YACxB,WAAA,CAAA,GAAA,IAAA;;IAEF;AAEA,MAAA,IAAA,WAAY,WAAW,SAAS,aAAA,GAAA,IAAA;AACzB,WAAA,WAAW,SAAS,gBAAA,CAAiB,SAAS;AACnD,QAAA,IAAA,WAAY,MAAA,IAAA;AAAA,IACd,CAAC;AAAA,EACH,CAAC;;IAGK,IAAA,YAAY;mBACP,SAAA;AAAA,IACT;AAAA;AAEJ;SAEgB,oBAAoB,aAA2B;AACvD,QAAA,aAAa,mBAAA;AACf,MAAA,SAAS,EAAA,MAAA,EAAA,MAAA,CAAA,CAAA,CAAA;AACP,QAAA,qBAAoB,WAAA;AAE1B,IAAA,kBAAc;SACP,WAAW,UAAU;YACxB,QAAA,CAAA,GAAA,IAAA;;IAEF;AAEA,MAAA,IAAA,QAAS,WAAW,SAAS,0BAAoB,QAAQ,CAAA,GAAA,IAAA;AAClD,WAAA,WAAW,SAAS,sBAAsB;AAC/C,QAAA,IAAA,QAAS,WAAW,SAAU,0BAAoB,QAAQ,CAAA,GAAA,IAAA;AAAA,IAC5D,CAAC;AAAA,EACH,CAAC;;IAGK,IAAA,SAAS;mBACJ,MAAA;AAAA,IACT;AAAA;AAEJ;AAEgB,SAAA,mBACd,cACA,aACA;AACM,QAAA,aAAa,mBA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CAAC;AAAA,EACH,CAAC;;IAGK,IAAA,cAAc;mBACT,WAAA;AAAA,IACT;AAAA;AAEJ;;qCC3HA;;QAY+C,WAAQ,EAAA,WAAA,SAAA;AAAA;;;;;;;;AAE/C,QAAA,kBAAkB,mBAAkB;MAEtC,MAAM,EAAA,MAA2B,MAAS;AAC1C,MAAA,SAAwB;AAE5B,IAAA,YAAO,MAAO;AACP,QAAA,CAAA,gBAAgB,SAAQ;UAEvB,OAAO,gBAAgB,SAAS,YAAW,QAAA,WAAA,QAAA,WAAA,QAAA,OAAA,QAAA,OAIxC,OAAO,gBAAgB;AAGhC,SAAK;AAAA,MAAM,CAAA,SAAS;AACZ,cAAA,YAAY,IAAI,gBAAgB,IAAI;AAC1C,iBAAS;AACT,UAAA,IAAA,KAAM,WAAS,IAAA;AAAA,MACjB;AAAA,MAAG;AAAA;AAEU,WAAA,MAAA;AACP,UAAA,QAAQ;AACV,YAAI,gBAAgB,MAAM;AAC1B,iBAAS;AAAA,MACX,OAAO;AACL,aAAK,MAAK;AAAA,UACR,MAAM,aAAa;AAAA,UACnB,SAAS;AAAA;MAEb;AAAA,IACF;AAAA,EACF,CAAC;AAEK,QAAA,kBAAe,MAAS;AACxB,QAAA,QAAQ;AACV,UAAI,gBAAgB,MAAM;AAC1B,eAAS;AAAA,IACX;AAAA,EACF;;;;;UAIC,MAAG,OAAA;yBAAH,KAAG,OAAA;AAAA,mBAAM,GAAG;AAAA,gBAAU;AAAA,WAAqB;AAAA;;sBAA3C,GAAG;0BAAH,GAAG;AAAA;;gBADD,GAAG,EAAA,UAAA,UAAA;AAAA;;;;AAFA;AC/CD,MAAM,qBAAqB,oBAAoBA,oBAAgB,EAAE,MAAA;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/svelte/hooks/use-stamp.svelte.ts","../../src/svelte/components/StampImg.svelte","../../src/svelte/index.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/svelte';\nimport { StampPlugin } from '@embedpdf/plugin-stamp';\nimport type { ResolvedStamp, StampLibrary, ActiveStampInfo } from '@embedpdf/plugin-stamp';\n\nexport const useStampPlugin = () => usePlugin<StampPlugin>(StampPlugin.id);\nexport const useStampCapability = () => useCapability<StampPlugin>(StampPlugin.id);\n\nexport function useStampLibraries() {\n const capability = useStampCapability();\n let libraries = $state<StampLibrary[]>([]);\n\n $effect(() => {\n if (!capability.provides) {\n libraries = [];\n return;\n }\n\n libraries = capability.provides.getLibraries();\n return capability.provides.onLibraryChange((libs) => {\n libraries = libs;\n });\n });\n\n return {\n get libraries() {\n return libraries;\n },\n };\n}\n\nexport function useStampsByCategory(getCategory: () => string) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const category = $derived(getCategory());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n stamps = capability.provides.getStampsByCategory(category);\n return capability.provides.onLibraryChange(() => {\n stamps = capability.provides!.getStampsByCategory(category);\n });\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useStampsByLibrary(\n getLibraryId: () => string | undefined,\n getCategory?: () => string | undefined,\n) {\n const capability = useStampCapability();\n let stamps = $state<ResolvedStamp[]>([]);\n const libraryId = $derived(getLibraryId());\n const category = $derived(getCategory?.());\n\n $effect(() => {\n if (!capability.provides) {\n stamps = [];\n return;\n }\n\n const derive = () => {\n const libraries = capability.provides!.getLibraries();\n const results: ResolvedStamp[] = [];\n\n for (const library of libraries) {\n if (libraryId && libraryId !== 'all' && library.id !== libraryId) continue;\n\n for (const stamp of library.stamps) {\n if (category) {\n const libraryMatches = library.categories?.includes(category) ?? false;\n const stampMatches = stamp.categories?.includes(category) ?? false;\n if (!libraryMatches && !stampMatches) continue;\n }\n results.push({ library, stamp });\n }\n }\n\n stamps = results;\n };\n\n derive();\n return capability.provides.onLibraryChange(derive);\n });\n\n return {\n get stamps() {\n return stamps;\n },\n };\n}\n\nexport function useActiveStamp(getDocumentId: () => string) {\n const capability = useStampCapability();\n let activeStamp = $state<ActiveStampInfo | null>(null);\n const documentId = $derived(getDocumentId());\n\n $effect(() => {\n if (!capability.provides || !documentId) {\n activeStamp = null;\n return;\n }\n\n const scope = capability.provides.forDocument(documentId);\n activeStamp = scope.getActiveStamp();\n return scope.onActiveStampChange((stamp) => {\n activeStamp = stamp;\n });\n });\n\n return {\n get activeStamp() {\n return activeStamp;\n },\n };\n}\n","<script lang=\"ts\">\n import { ignore, PdfErrorCode } from '@embedpdf/models';\n import { useStampCapability } from '../hooks';\n import type { HTMLImgAttributes } from 'svelte/elements';\n\n interface Props extends HTMLImgAttributes {\n libraryId: string;\n pageIndex: number;\n width: number;\n dpr?: number;\n }\n\n const { libraryId, pageIndex, width, dpr, ...imgProps }: Props = $props();\n\n const stampCapability = useStampCapability();\n\n let url = $state<string | undefined>(undefined);\n let urlRef: string | null = null;\n\n $effect(() => {\n if (!stampCapability.provides) return;\n\n const task = stampCapability.provides.renderStamp(\n libraryId,\n pageIndex,\n width,\n dpr ?? window.devicePixelRatio,\n );\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 stamp 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 src={url} onload={handleImageLoad} {...imgProps} alt=\"Stamp preview\" />\n{/if}\n","import { createPluginPackage } from '@embedpdf/core';\nimport { StampPluginPackage as BaseStampPackage } from '@embedpdf/plugin-stamp';\n\nexport * from './hooks';\nexport * from './components';\nexport * from '@embedpdf/plugin-stamp';\n\nexport const StampPluginPackage = createPluginPackage(BaseStampPackage).build();\n"],"names":["BaseStampPackage"],"mappings":";;;;;;;AAIa,MAAA,iBAAA,MAAuB,UAAuB,YAAY,EAAE;AA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AgB,SAAQ;UAEvB,OAAO,gBAAgB,SAAS,YAAW,QAAA,WAAA,QAAA,WAAA,QAAA,OAAA,QAAA,OAIxC,OAAO,gBAAgB;AAGhC,SAAK;AAAA,MAAM,CAAA,SAAS;AACZ,cAAA,YAAY,IAAI,gBAAgB,IAAI;AAC1C,iBAAS;AACT,UAAA,IAAA,KAAM,WAAS,IAAA;AAAA,MACjB;AAAA,MAAG;AAAA;AAEU,WAAA,MAAA;AACP,UAAA,QAAQ;AACV,YAAI,gBAAgB,MAAM;AAC1B,iBAAS;AAAA,MACX,OAAO;AACL,aAAK,MAAK;AAAA,UACR,MAAM,aAAa;AAAA,UACnB,SAAS;AAAA;MAEb;AAAA,IACF;AAAA,EACF,CAAC;AAEK,QAAA,kBAAe,MAAS;AACxB,QAAA,QAAQ;AACV,UAAI,gBAAgB,MAAM;AAC1B,eAAS;AAAA,IACX;AAAA,EACF;;;;;UAIC,MAAG,OAAA;yBAAH,KAAG,OAAA;AAAA,mBAAM,GAAG;AAAA,gBAAU;AAAA,WAAqB;AAAA;;sBAA3C,GAAG;0BAAH,GAAG;AAAA;;gBADD,GAAG,EAAA,UAAA,UAAA;AAAA;;;;AAFA;;;;;;AC/CD,MAAM,qBAAqB,oBAAoBA,oBAAgB,EAAE,MAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-stamp",
3
- "version": "2.14.4",
3
+ "version": "2.15.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",
@@ -34,15 +34,15 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@embedpdf/models": "2.14.4"
37
+ "@embedpdf/models": "2.15.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/react": "^18.2.0",
41
41
  "typescript": "^5.0.0",
42
42
  "@embedpdf/build": "1.1.0",
43
- "@embedpdf/plugin-annotation": "2.14.4",
44
- "@embedpdf/core": "2.14.4",
45
- "@embedpdf/plugin-i18n": "2.14.4"
43
+ "@embedpdf/core": "2.15.0",
44
+ "@embedpdf/plugin-annotation": "2.15.0",
45
+ "@embedpdf/plugin-i18n": "2.15.0"
46
46
  },
47
47
  "peerDependencies": {
48
48
  "react": ">=16.8.0",
@@ -50,9 +50,9 @@
50
50
  "preact": "^10.26.4",
51
51
  "vue": ">=3.2.0",
52
52
  "svelte": ">=5 <6",
53
- "@embedpdf/plugin-i18n": "2.14.4",
54
- "@embedpdf/core": "2.14.4",
55
- "@embedpdf/plugin-annotation": "2.14.4"
53
+ "@embedpdf/plugin-annotation": "2.15.0",
54
+ "@embedpdf/core": "2.15.0",
55
+ "@embedpdf/plugin-i18n": "2.15.0"
56
56
  },
57
57
  "files": [
58
58
  "dist",