@embedpdf/plugin-attachment 1.0.20 → 1.0.21

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/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=class extends e.BasePlugin{constructor(e,t){super(e,t)}async initialize(e){}buildCapability(){return{}}};t.id="attachment";let a=t;const n="attachment",i={id:n,name:"Attachment Plugin",version:"1.0.0",provides:["attachment"],requires:[],optional:[],defaultConfig:{enabled:!0}},r={manifest:i,create:e=>new a(n,e),reducer:()=>{},initialState:{}};exports.ATTACHMENT_PLUGIN_ID=n,exports.AttachmentPlugin=a,exports.AttachmentPluginPackage=r,exports.manifest=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@embedpdf/core"),e=require("@embedpdf/models"),n=class extends t.BasePlugin{constructor(t,e){super(t,e)}async initialize(t){}buildCapability(){return{getAttachments:this.getAttachments.bind(this),downloadAttachment:this.downloadAttachment.bind(this)}}downloadAttachment(t){const n=this.coreState.core.document;return n?this.engine.readAttachmentContent(n,t):e.PdfTaskHelper.reject({code:e.PdfErrorCode.NotFound,message:"Document not found"})}getAttachments(){const t=this.coreState.core.document;return t?this.engine.getAttachments(t):e.PdfTaskHelper.reject({code:e.PdfErrorCode.NotFound,message:"Document not found"})}};n.id="attachment";let o=n;const a="attachment",r={id:a,name:"Attachment Plugin",version:"1.0.0",provides:["attachment"],requires:[],optional:[],defaultConfig:{enabled:!0}},s={manifest:r,create:t=>new o(a,t),reducer:()=>{},initialState:{}};exports.ATTACHMENT_PLUGIN_ID=a,exports.AttachmentPlugin=o,exports.AttachmentPluginPackage=s,exports.manifest=r;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/lib/attachment-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, PluginRegistry } from '@embedpdf/core';\n\nimport { AttachmentCapability, AttachmentPluginConfig } from './types';\n\nexport class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {\n static readonly id = 'attachment' as const;\n\n constructor(id: string, registry: PluginRegistry) {\n super(id, registry);\n }\n\n async initialize(_: AttachmentPluginConfig): Promise<void> {}\n\n protected buildCapability(): AttachmentCapability {\n return {};\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { AttachmentPluginConfig } from './types';\n\nexport const ATTACHMENT_PLUGIN_ID = 'attachment';\n\nexport const manifest: PluginManifest<AttachmentPluginConfig> = {\n id: ATTACHMENT_PLUGIN_ID,\n name: 'Attachment Plugin',\n version: '1.0.0',\n provides: ['attachment'],\n requires: [],\n optional: [],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { PluginPackage } from '@embedpdf/core';\n\nimport { AttachmentPlugin } from './attachment-plugin';\nimport { manifest, ATTACHMENT_PLUGIN_ID } from './manifest';\nimport { AttachmentPluginConfig } from './types';\n\nexport const AttachmentPluginPackage: PluginPackage<AttachmentPlugin, AttachmentPluginConfig> = {\n manifest,\n create: (registry) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './attachment-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":["_AttachmentPlugin","BasePlugin","constructor","id","registry","super","initialize","_","buildCapability","AttachmentPlugin","ATTACHMENT_PLUGIN_ID","manifest","name","version","provides","requires","optional","defaultConfig","enabled","AttachmentPluginPackage","create","reducer","initialState"],"mappings":"kHAIaA,EAAN,cAA+BC,EAAAA,WAGpC,WAAAC,CAAYC,EAAYC,GACtBC,MAAMF,EAAIC,EAAQ,CAGpB,gBAAME,CAAWC,GAA0C,CAEjD,eAAAC,GACR,MAAO,CAAC,CAAA,GATVR,EAAgBG,GAAK,aADhB,IAAMM,EAANT,ECDA,MAAMU,EAAuB,aAEvBC,EAAmD,CAC9DR,GAAIO,EACJE,KAAM,oBACNC,QAAS,QACTC,SAAU,CAAC,cACXC,SAAU,GACVC,SAAU,GACVC,cAAe,CACbC,SAAS,ICPAC,EAAmF,CAC9FR,WACAS,OAAShB,GAAa,IAAIK,EAAiBC,EAAsBN,GACjEiB,QAAS,OACTC,aAAc,CAAA"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/lib/attachment-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, createEmitter, PluginRegistry } from '@embedpdf/core';\n\nimport { AttachmentCapability, AttachmentPluginConfig } from './types';\nimport {\n PdfAttachmentObject,\n PdfErrorCode,\n PdfErrorReason,\n PdfTaskHelper,\n Task,\n} from '@embedpdf/models';\n\nexport class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {\n static readonly id = 'attachment' as const;\n\n constructor(id: string, registry: PluginRegistry) {\n super(id, registry);\n }\n\n async initialize(_: AttachmentPluginConfig): Promise<void> {}\n\n protected buildCapability(): AttachmentCapability {\n return {\n getAttachments: this.getAttachments.bind(this),\n downloadAttachment: this.downloadAttachment.bind(this),\n };\n }\n\n private downloadAttachment(attachment: PdfAttachmentObject): Task<ArrayBuffer, PdfErrorReason> {\n const doc = this.coreState.core.document;\n\n if (!doc) {\n return PdfTaskHelper.reject({ code: PdfErrorCode.NotFound, message: 'Document not found' });\n }\n\n return this.engine.readAttachmentContent(doc, attachment);\n }\n\n private getAttachments(): Task<PdfAttachmentObject[], PdfErrorReason> {\n const doc = this.coreState.core.document;\n\n if (!doc) {\n return PdfTaskHelper.reject({ code: PdfErrorCode.NotFound, message: 'Document not found' });\n }\n\n return this.engine.getAttachments(doc);\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { AttachmentPluginConfig } from './types';\n\nexport const ATTACHMENT_PLUGIN_ID = 'attachment';\n\nexport const manifest: PluginManifest<AttachmentPluginConfig> = {\n id: ATTACHMENT_PLUGIN_ID,\n name: 'Attachment Plugin',\n version: '1.0.0',\n provides: ['attachment'],\n requires: [],\n optional: [],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { PluginPackage } from '@embedpdf/core';\n\nimport { AttachmentPlugin } from './attachment-plugin';\nimport { manifest, ATTACHMENT_PLUGIN_ID } from './manifest';\nimport { AttachmentPluginConfig } from './types';\n\nexport const AttachmentPluginPackage: PluginPackage<AttachmentPlugin, AttachmentPluginConfig> = {\n manifest,\n create: (registry) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './attachment-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":["_AttachmentPlugin","BasePlugin","constructor","id","registry","super","initialize","_","buildCapability","getAttachments","this","bind","downloadAttachment","attachment","doc","coreState","core","document","engine","readAttachmentContent","PdfTaskHelper","reject","code","PdfErrorCode","NotFound","message","AttachmentPlugin","ATTACHMENT_PLUGIN_ID","manifest","name","version","provides","requires","optional","defaultConfig","enabled","AttachmentPluginPackage","create","reducer","initialState"],"mappings":"gJAWaA,EAAN,cAA+BC,EAAAA,WAGpC,WAAAC,CAAYC,EAAYC,GACtBC,MAAMF,EAAIC,EAAQ,CAGpB,gBAAME,CAAWC,GAA0C,CAEjD,eAAAC,GACD,MAAA,CACLC,eAAgBC,KAAKD,eAAeE,KAAKD,MACzCE,mBAAoBF,KAAKE,mBAAmBD,KAAKD,MACnD,CAGM,kBAAAE,CAAmBC,GACnB,MAAAC,EAAMJ,KAAKK,UAAUC,KAAKC,SAEhC,OAAKH,EAIEJ,KAAKQ,OAAOC,sBAAsBL,EAAKD,GAHrCO,EAAAA,cAAcC,OAAO,CAAEC,KAAMC,eAAaC,SAAUC,QAAS,sBAGd,CAGlD,cAAAhB,GACA,MAAAK,EAAMJ,KAAKK,UAAUC,KAAKC,SAEhC,OAAKH,EAIEJ,KAAKQ,OAAOT,eAAeK,GAHzBM,EAAAA,cAAcC,OAAO,CAAEC,KAAMC,eAAaC,SAAUC,QAAS,sBAGjC,GAhCvCzB,EAAgBG,GAAK,aADhB,IAAMuB,EAAN1B,ECRA,MAAM2B,EAAuB,aAEvBC,EAAmD,CAC9DzB,GAAIwB,EACJE,KAAM,oBACNC,QAAS,QACTC,SAAU,CAAC,cACXC,SAAU,GACVC,SAAU,GACVC,cAAe,CACbC,SAAS,ICPAC,EAAmF,CAC9FR,WACAS,OAASjC,GAAa,IAAIsB,EAAiBC,EAAsBvB,GACjEkC,QAAS,OACTC,aAAc,CAAA"}
package/dist/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { BasePlugin } from "@embedpdf/core";
2
+ import { PdfTaskHelper, PdfErrorCode } from "@embedpdf/models";
2
3
  const _AttachmentPlugin = class _AttachmentPlugin extends BasePlugin {
3
4
  constructor(id, registry) {
4
5
  super(id, registry);
@@ -6,7 +7,24 @@ const _AttachmentPlugin = class _AttachmentPlugin extends BasePlugin {
6
7
  async initialize(_) {
7
8
  }
8
9
  buildCapability() {
9
- return {};
10
+ return {
11
+ getAttachments: this.getAttachments.bind(this),
12
+ downloadAttachment: this.downloadAttachment.bind(this)
13
+ };
14
+ }
15
+ downloadAttachment(attachment) {
16
+ const doc = this.coreState.core.document;
17
+ if (!doc) {
18
+ return PdfTaskHelper.reject({ code: PdfErrorCode.NotFound, message: "Document not found" });
19
+ }
20
+ return this.engine.readAttachmentContent(doc, attachment);
21
+ }
22
+ getAttachments() {
23
+ const doc = this.coreState.core.document;
24
+ if (!doc) {
25
+ return PdfTaskHelper.reject({ code: PdfErrorCode.NotFound, message: "Document not found" });
26
+ }
27
+ return this.engine.getAttachments(doc);
10
28
  }
11
29
  };
12
30
  _AttachmentPlugin.id = "attachment";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/lib/attachment-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, PluginRegistry } from '@embedpdf/core';\n\nimport { AttachmentCapability, AttachmentPluginConfig } from './types';\n\nexport class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {\n static readonly id = 'attachment' as const;\n\n constructor(id: string, registry: PluginRegistry) {\n super(id, registry);\n }\n\n async initialize(_: AttachmentPluginConfig): Promise<void> {}\n\n protected buildCapability(): AttachmentCapability {\n return {};\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { AttachmentPluginConfig } from './types';\n\nexport const ATTACHMENT_PLUGIN_ID = 'attachment';\n\nexport const manifest: PluginManifest<AttachmentPluginConfig> = {\n id: ATTACHMENT_PLUGIN_ID,\n name: 'Attachment Plugin',\n version: '1.0.0',\n provides: ['attachment'],\n requires: [],\n optional: [],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { PluginPackage } from '@embedpdf/core';\n\nimport { AttachmentPlugin } from './attachment-plugin';\nimport { manifest, ATTACHMENT_PLUGIN_ID } from './manifest';\nimport { AttachmentPluginConfig } from './types';\n\nexport const AttachmentPluginPackage: PluginPackage<AttachmentPlugin, AttachmentPluginConfig> = {\n manifest,\n create: (registry) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './attachment-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":[],"mappings":";AAIO,MAAM,oBAAN,MAAM,0BAAyB,WAAyD;AAAA,EAG7F,YAAY,IAAY,UAA0B;AAChD,UAAM,IAAI,QAAQ;AAAA,EAAA;AAAA,EAGpB,MAAM,WAAW,GAA0C;AAAA,EAAA;AAAA,EAEjD,kBAAwC;AAChD,WAAO,CAAC;AAAA,EAAA;AAEZ;AAXE,kBAAgB,KAAK;AADhB,IAAM,mBAAN;ACDA,MAAM,uBAAuB;AAE7B,MAAM,WAAmD;AAAA,EAC9D,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,YAAY;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,IACb,SAAS;AAAA,EAAA;AAEb;ACTO,MAAM,0BAAmF;AAAA,EAC9F;AAAA,EACA,QAAQ,CAAC,aAAa,IAAI,iBAAiB,sBAAsB,QAAQ;AAAA,EACzE,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,cAAc,CAAA;AAChB;"}
1
+ {"version":3,"file":"index.js","sources":["../src/lib/attachment-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, createEmitter, PluginRegistry } from '@embedpdf/core';\n\nimport { AttachmentCapability, AttachmentPluginConfig } from './types';\nimport {\n PdfAttachmentObject,\n PdfErrorCode,\n PdfErrorReason,\n PdfTaskHelper,\n Task,\n} from '@embedpdf/models';\n\nexport class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {\n static readonly id = 'attachment' as const;\n\n constructor(id: string, registry: PluginRegistry) {\n super(id, registry);\n }\n\n async initialize(_: AttachmentPluginConfig): Promise<void> {}\n\n protected buildCapability(): AttachmentCapability {\n return {\n getAttachments: this.getAttachments.bind(this),\n downloadAttachment: this.downloadAttachment.bind(this),\n };\n }\n\n private downloadAttachment(attachment: PdfAttachmentObject): Task<ArrayBuffer, PdfErrorReason> {\n const doc = this.coreState.core.document;\n\n if (!doc) {\n return PdfTaskHelper.reject({ code: PdfErrorCode.NotFound, message: 'Document not found' });\n }\n\n return this.engine.readAttachmentContent(doc, attachment);\n }\n\n private getAttachments(): Task<PdfAttachmentObject[], PdfErrorReason> {\n const doc = this.coreState.core.document;\n\n if (!doc) {\n return PdfTaskHelper.reject({ code: PdfErrorCode.NotFound, message: 'Document not found' });\n }\n\n return this.engine.getAttachments(doc);\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { AttachmentPluginConfig } from './types';\n\nexport const ATTACHMENT_PLUGIN_ID = 'attachment';\n\nexport const manifest: PluginManifest<AttachmentPluginConfig> = {\n id: ATTACHMENT_PLUGIN_ID,\n name: 'Attachment Plugin',\n version: '1.0.0',\n provides: ['attachment'],\n requires: [],\n optional: [],\n defaultConfig: {\n enabled: true,\n },\n};\n","import { PluginPackage } from '@embedpdf/core';\n\nimport { AttachmentPlugin } from './attachment-plugin';\nimport { manifest, ATTACHMENT_PLUGIN_ID } from './manifest';\nimport { AttachmentPluginConfig } from './types';\n\nexport const AttachmentPluginPackage: PluginPackage<AttachmentPlugin, AttachmentPluginConfig> = {\n manifest,\n create: (registry) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './attachment-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":[],"mappings":";;AAWO,MAAM,oBAAN,MAAM,0BAAyB,WAAyD;AAAA,EAG7F,YAAY,IAAY,UAA0B;AAChD,UAAM,IAAI,QAAQ;AAAA,EAAA;AAAA,EAGpB,MAAM,WAAW,GAA0C;AAAA,EAAA;AAAA,EAEjD,kBAAwC;AACzC,WAAA;AAAA,MACL,gBAAgB,KAAK,eAAe,KAAK,IAAI;AAAA,MAC7C,oBAAoB,KAAK,mBAAmB,KAAK,IAAI;AAAA,IACvD;AAAA,EAAA;AAAA,EAGM,mBAAmB,YAAoE;AACvF,UAAA,MAAM,KAAK,UAAU,KAAK;AAEhC,QAAI,CAAC,KAAK;AACD,aAAA,cAAc,OAAO,EAAE,MAAM,aAAa,UAAU,SAAS,sBAAsB;AAAA,IAAA;AAG5F,WAAO,KAAK,OAAO,sBAAsB,KAAK,UAAU;AAAA,EAAA;AAAA,EAGlD,iBAA8D;AAC9D,UAAA,MAAM,KAAK,UAAU,KAAK;AAEhC,QAAI,CAAC,KAAK;AACD,aAAA,cAAc,OAAO,EAAE,MAAM,aAAa,UAAU,SAAS,sBAAsB;AAAA,IAAA;AAGrF,WAAA,KAAK,OAAO,eAAe,GAAG;AAAA,EAAA;AAEzC;AAlCE,kBAAgB,KAAK;AADhB,IAAM,mBAAN;ACRA,MAAM,uBAAuB;AAE7B,MAAM,WAAmD;AAAA,EAC9D,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,YAAY;AAAA,EACvB,UAAU,CAAC;AAAA,EACX,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,IACb,SAAS;AAAA,EAAA;AAEb;ACTO,MAAM,0BAAmF;AAAA,EAC9F;AAAA,EACA,QAAQ,CAAC,aAAa,IAAI,iBAAiB,sBAAsB,QAAQ;AAAA,EACzE,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,cAAc,CAAA;AAChB;"}
@@ -5,4 +5,6 @@ export declare class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig,
5
5
  constructor(id: string, registry: PluginRegistry);
6
6
  initialize(_: AttachmentPluginConfig): Promise<void>;
7
7
  protected buildCapability(): AttachmentCapability;
8
+ private downloadAttachment;
9
+ private getAttachments;
8
10
  }
@@ -1,5 +1,8 @@
1
1
  import { BasePluginConfig } from '@embedpdf/core';
2
+ import { PdfAttachmentObject, PdfErrorReason, Task } from '@embedpdf/models';
2
3
  export interface AttachmentPluginConfig extends BasePluginConfig {
3
4
  }
4
5
  export interface AttachmentCapability {
6
+ getAttachments: () => Task<PdfAttachmentObject[], PdfErrorReason>;
7
+ downloadAttachment: (attachment: PdfAttachmentObject) => Task<ArrayBuffer, PdfErrorReason>;
5
8
  }
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/preact"),t=require("@embedpdf/plugin-attachment");exports.useAttachmentCapability=()=>e.useCapability(t.AttachmentPlugin.id),exports.useAttachmentPlugin=()=>e.usePlugin(t.AttachmentPlugin.id);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/preact"),t=require("@embedpdf/plugin-attachment");exports.useAttachmentCapability=()=>e.useCapability(t.AttachmentPlugin.id),exports.useAttachmentPlugin=()=>e.usePlugin(t.AttachmentPlugin.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,5 +1,6 @@
1
1
  import { usePlugin, useCapability } from "@embedpdf/core/preact";
2
2
  import { AttachmentPlugin } from "@embedpdf/plugin-attachment";
3
+ export * from "@embedpdf/plugin-attachment";
3
4
  const useAttachmentPlugin = () => usePlugin(AttachmentPlugin.id);
4
5
  const useAttachmentCapability = () => useCapability(AttachmentPlugin.id);
5
6
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-attachment.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { AttachmentPlugin } from '@embedpdf/plugin-attachment';\n\nexport const useAttachmentPlugin = () => usePlugin<AttachmentPlugin>(AttachmentPlugin.id);\nexport const useAttachmentCapability = () => useCapability<AttachmentPlugin>(AttachmentPlugin.id);\n"],"names":[],"mappings":";;AAGO,MAAM,sBAAsB,MAAM,UAA4B,iBAAiB,EAAE;AACjF,MAAM,0BAA0B,MAAM,cAAgC,iBAAiB,EAAE;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-attachment.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { AttachmentPlugin } from '@embedpdf/plugin-attachment';\n\nexport const useAttachmentPlugin = () => usePlugin<AttachmentPlugin>(AttachmentPlugin.id);\nexport const useAttachmentCapability = () => useCapability<AttachmentPlugin>(AttachmentPlugin.id);\n"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,MAAM,UAA4B,iBAAiB,EAAE;AACjF,MAAM,0BAA0B,MAAM,cAAgC,iBAAiB,EAAE;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/react"),t=require("@embedpdf/plugin-attachment");exports.useAttachmentCapability=()=>e.useCapability(t.AttachmentPlugin.id),exports.useAttachmentPlugin=()=>e.usePlugin(t.AttachmentPlugin.id);
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core/react"),t=require("@embedpdf/plugin-attachment");exports.useAttachmentCapability=()=>e.useCapability(t.AttachmentPlugin.id),exports.useAttachmentPlugin=()=>e.usePlugin(t.AttachmentPlugin.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,5 +1,6 @@
1
1
  import { usePlugin, useCapability } from "@embedpdf/core/react";
2
2
  import { AttachmentPlugin } from "@embedpdf/plugin-attachment";
3
+ export * from "@embedpdf/plugin-attachment";
3
4
  const useAttachmentPlugin = () => usePlugin(AttachmentPlugin.id);
4
5
  const useAttachmentCapability = () => useCapability(AttachmentPlugin.id);
5
6
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-attachment.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { AttachmentPlugin } from '@embedpdf/plugin-attachment';\n\nexport const useAttachmentPlugin = () => usePlugin<AttachmentPlugin>(AttachmentPlugin.id);\nexport const useAttachmentCapability = () => useCapability<AttachmentPlugin>(AttachmentPlugin.id);\n"],"names":[],"mappings":";;AAGO,MAAM,sBAAsB,MAAM,UAA4B,iBAAiB,EAAE;AACjF,MAAM,0BAA0B,MAAM,cAAgC,iBAAiB,EAAE;"}
1
+ {"version":3,"file":"index.js","sources":["../../src/shared/hooks/use-attachment.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/@framework';\nimport { AttachmentPlugin } from '@embedpdf/plugin-attachment';\n\nexport const useAttachmentPlugin = () => usePlugin<AttachmentPlugin>(AttachmentPlugin.id);\nexport const useAttachmentCapability = () => useCapability<AttachmentPlugin>(AttachmentPlugin.id);\n"],"names":[],"mappings":";;;AAGO,MAAM,sBAAsB,MAAM,UAA4B,iBAAiB,EAAE;AACjF,MAAM,0BAA0B,MAAM,cAAgC,iBAAiB,EAAE;"}
@@ -1 +1,2 @@
1
1
  export * from './hooks';
2
+ export * from '../lib/index.ts';
@@ -1 +1,2 @@
1
1
  export * from './hooks';
2
+ export * from '../lib/index.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-attachment",
3
- "version": "1.0.20",
3
+ "version": "1.0.21",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",
@@ -15,22 +15,27 @@
15
15
  "types": "./dist/preact/index.d.ts",
16
16
  "import": "./dist/preact/index.js",
17
17
  "require": "./dist/preact/index.cjs"
18
+ },
19
+ "./react": {
20
+ "types": "./dist/react/index.d.ts",
21
+ "import": "./dist/react/index.js",
22
+ "require": "./dist/react/index.cjs"
18
23
  }
19
24
  },
20
25
  "dependencies": {
21
- "@embedpdf/models": "1.0.20"
26
+ "@embedpdf/models": "1.0.21"
22
27
  },
23
28
  "devDependencies": {
24
29
  "@types/react": "^18.2.0",
25
30
  "typescript": "^5.0.0",
26
31
  "@embedpdf/build": "1.0.0",
27
- "@embedpdf/core": "1.0.20"
32
+ "@embedpdf/core": "1.0.21"
28
33
  },
29
34
  "peerDependencies": {
30
35
  "react": ">=16.8.0",
31
36
  "react-dom": ">=16.8.0",
32
37
  "preact": "^10.26.4",
33
- "@embedpdf/core": "1.0.20"
38
+ "@embedpdf/core": "1.0.21"
34
39
  },
35
40
  "files": [
36
41
  "dist",