@embedpdf/plugin-export 2.0.0-next.1 → 2.0.0-next.2
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 +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
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=require("@embedpdf/models"),o=class extends e.BasePlugin{constructor(t,o,s){super(t,o),this.downloadRequest$=e.createEmitter(),this.config=s}buildCapability(){return{saveAsCopy:()=>this.saveAsCopy(),download:()=>this.download(),forDocument:e=>this.createExportScope(e)}}createExportScope(e){return{saveAsCopy:()=>this.saveAsCopy(e),download:()=>this.download(e)}}download(e){const t=e??this.getActiveDocumentId();this.downloadRequest$.emit({documentId:t})}saveAsCopy(e){const o=e??this.getActiveDocumentId(),s=this.coreState.core.documents[o];return(null==s?void 0:s.document)?this.engine.saveAsCopy(s.document):t.PdfTaskHelper.reject({code:t.PdfErrorCode.DocNotOpen,message:`Document ${o} not found`})}saveAsCopyAndGetBufferAndName(e){const o=new t.Task,s=this.coreState.core.documents[e];return(null==s?void 0:s.document)?(this.saveAsCopy(e).wait(e=>{o.resolve({buffer:e,name:s.name??this.config.defaultFileName})},e=>o.fail(e)),o):t.PdfTaskHelper.reject({code:t.PdfErrorCode.DocNotOpen,message:`Document ${e} not found`})}onRequest(e){return this.downloadRequest$.on(e)}async initialize(e){this.logger.info("ExportPlugin","Initialize","Export plugin initialized")}async destroy(){this.downloadRequest$.clear(),await super.destroy()}};o.id="export";let s=o;const n="export",r={id:n,name:"Export Plugin",version:"1.0.0",provides:["export"],requires:[],optional:[],defaultConfig:{
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@embedpdf/core"),t=require("@embedpdf/models"),o=class extends e.BasePlugin{constructor(t,o,s){super(t,o),this.downloadRequest$=e.createEmitter(),this.config=s}buildCapability(){return{saveAsCopy:()=>this.saveAsCopy(),download:()=>this.download(),forDocument:e=>this.createExportScope(e)}}createExportScope(e){return{saveAsCopy:()=>this.saveAsCopy(e),download:()=>this.download(e)}}download(e){const t=e??this.getActiveDocumentId();this.downloadRequest$.emit({documentId:t})}saveAsCopy(e){const o=e??this.getActiveDocumentId(),s=this.coreState.core.documents[o];return(null==s?void 0:s.document)?this.engine.saveAsCopy(s.document):t.PdfTaskHelper.reject({code:t.PdfErrorCode.DocNotOpen,message:`Document ${o} not found`})}saveAsCopyAndGetBufferAndName(e){const o=new t.Task,s=this.coreState.core.documents[e];return(null==s?void 0:s.document)?(this.saveAsCopy(e).wait(e=>{o.resolve({buffer:e,name:s.name??this.config.defaultFileName})},e=>o.fail(e)),o):t.PdfTaskHelper.reject({code:t.PdfErrorCode.DocNotOpen,message:`Document ${e} not found`})}onRequest(e){return this.downloadRequest$.on(e)}async initialize(e){this.logger.info("ExportPlugin","Initialize","Export plugin initialized")}async destroy(){this.downloadRequest$.clear(),await super.destroy()}};o.id="export";let s=o;const n="export",r={id:n,name:"Export Plugin",version:"1.0.0",provides:["export"],requires:[],optional:[],defaultConfig:{defaultFileName:"document.pdf"}},i={manifest:r,create:(e,t)=>new s(n,e,t),reducer:()=>{},initialState:{}};exports.EXPORT_PLUGIN_ID=n,exports.ExportPlugin=s,exports.ExportPluginPackage=i,exports.manifest=r;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/lib/export-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, createEmitter, Listener, PluginRegistry } from '@embedpdf/core';\nimport { PdfErrorCode, PdfErrorReason, PdfTaskHelper, Task } from '@embedpdf/models';\n\nimport {\n BufferAndName,\n ExportCapability,\n ExportPluginConfig,\n ExportScope,\n DownloadRequestEvent,\n} from './types';\n\nexport class ExportPlugin extends BasePlugin<ExportPluginConfig, ExportCapability> {\n static readonly id = 'export' as const;\n\n private readonly downloadRequest$ = createEmitter<DownloadRequestEvent>();\n private readonly config: ExportPluginConfig;\n\n constructor(id: string, registry: PluginRegistry, config: ExportPluginConfig) {\n super(id, registry);\n this.config = config;\n }\n\n // ─────────────────────────────────────────────────────────\n // Capability\n // ─────────────────────────────────────────────────────────\n\n protected buildCapability(): ExportCapability {\n return {\n // Active document operations\n saveAsCopy: () => this.saveAsCopy(),\n download: () => this.download(),\n\n // Document-scoped operations\n forDocument: (documentId: string) => this.createExportScope(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Document Scoping\n // ─────────────────────────────────────────────────────────\n\n private createExportScope(documentId: string): ExportScope {\n return {\n saveAsCopy: () => this.saveAsCopy(documentId),\n download: () => this.download(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Core Operations\n // ─────────────────────────────────────────────────────────\n\n private download(documentId?: string): void {\n const id = documentId ?? this.getActiveDocumentId();\n this.downloadRequest$.emit({ documentId: id });\n }\n\n private saveAsCopy(documentId?: string): Task<ArrayBuffer, PdfErrorReason> {\n const id = documentId ?? this.getActiveDocumentId();\n const coreDoc = this.coreState.core.documents[id];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${id} not found`,\n });\n }\n\n return this.engine.saveAsCopy(coreDoc.document);\n }\n\n public saveAsCopyAndGetBufferAndName(documentId: string): Task<BufferAndName, PdfErrorReason> {\n const task = new Task<BufferAndName, PdfErrorReason>();\n const coreDoc = this.coreState.core.documents[documentId];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${documentId} not found`,\n });\n }\n\n this.saveAsCopy(documentId).wait(\n (result) => {\n task.resolve({\n buffer: result,\n name: coreDoc.name ?? this.config.defaultFileName,\n });\n },\n (error) => task.fail(error),\n );\n\n return task;\n }\n\n // ─────────────────────────────────────────────────────────\n // Event Listeners\n // ─────────────────────────────────────────────────────────\n\n public onRequest(listener: Listener<DownloadRequestEvent>) {\n return this.downloadRequest$.on(listener);\n }\n\n // ─────────────────────────────────────────────────────────\n // Lifecycle\n // ─────────────────────────────────────────────────────────\n\n async initialize(_: ExportPluginConfig): Promise<void> {\n this.logger.info('ExportPlugin', 'Initialize', 'Export plugin initialized');\n }\n\n async destroy(): Promise<void> {\n this.downloadRequest$.clear();\n await super.destroy();\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { ExportPluginConfig } from './types';\n\nexport const EXPORT_PLUGIN_ID = 'export';\n\nexport const manifest: PluginManifest<ExportPluginConfig> = {\n id: EXPORT_PLUGIN_ID,\n name: 'Export Plugin',\n version: '1.0.0',\n provides: ['export'],\n requires: [],\n optional: [],\n defaultConfig: {\n
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/lib/export-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, createEmitter, Listener, PluginRegistry } from '@embedpdf/core';\nimport { PdfErrorCode, PdfErrorReason, PdfTaskHelper, Task } from '@embedpdf/models';\n\nimport {\n BufferAndName,\n ExportCapability,\n ExportPluginConfig,\n ExportScope,\n DownloadRequestEvent,\n} from './types';\n\nexport class ExportPlugin extends BasePlugin<ExportPluginConfig, ExportCapability> {\n static readonly id = 'export' as const;\n\n private readonly downloadRequest$ = createEmitter<DownloadRequestEvent>();\n private readonly config: ExportPluginConfig;\n\n constructor(id: string, registry: PluginRegistry, config: ExportPluginConfig) {\n super(id, registry);\n this.config = config;\n }\n\n // ─────────────────────────────────────────────────────────\n // Capability\n // ─────────────────────────────────────────────────────────\n\n protected buildCapability(): ExportCapability {\n return {\n // Active document operations\n saveAsCopy: () => this.saveAsCopy(),\n download: () => this.download(),\n\n // Document-scoped operations\n forDocument: (documentId: string) => this.createExportScope(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Document Scoping\n // ─────────────────────────────────────────────────────────\n\n private createExportScope(documentId: string): ExportScope {\n return {\n saveAsCopy: () => this.saveAsCopy(documentId),\n download: () => this.download(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Core Operations\n // ─────────────────────────────────────────────────────────\n\n private download(documentId?: string): void {\n const id = documentId ?? this.getActiveDocumentId();\n this.downloadRequest$.emit({ documentId: id });\n }\n\n private saveAsCopy(documentId?: string): Task<ArrayBuffer, PdfErrorReason> {\n const id = documentId ?? this.getActiveDocumentId();\n const coreDoc = this.coreState.core.documents[id];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${id} not found`,\n });\n }\n\n return this.engine.saveAsCopy(coreDoc.document);\n }\n\n public saveAsCopyAndGetBufferAndName(documentId: string): Task<BufferAndName, PdfErrorReason> {\n const task = new Task<BufferAndName, PdfErrorReason>();\n const coreDoc = this.coreState.core.documents[documentId];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${documentId} not found`,\n });\n }\n\n this.saveAsCopy(documentId).wait(\n (result) => {\n task.resolve({\n buffer: result,\n name: coreDoc.name ?? this.config.defaultFileName,\n });\n },\n (error) => task.fail(error),\n );\n\n return task;\n }\n\n // ─────────────────────────────────────────────────────────\n // Event Listeners\n // ─────────────────────────────────────────────────────────\n\n public onRequest(listener: Listener<DownloadRequestEvent>) {\n return this.downloadRequest$.on(listener);\n }\n\n // ─────────────────────────────────────────────────────────\n // Lifecycle\n // ─────────────────────────────────────────────────────────\n\n async initialize(_: ExportPluginConfig): Promise<void> {\n this.logger.info('ExportPlugin', 'Initialize', 'Export plugin initialized');\n }\n\n async destroy(): Promise<void> {\n this.downloadRequest$.clear();\n await super.destroy();\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { ExportPluginConfig } from './types';\n\nexport const EXPORT_PLUGIN_ID = 'export';\n\nexport const manifest: PluginManifest<ExportPluginConfig> = {\n id: EXPORT_PLUGIN_ID,\n name: 'Export Plugin',\n version: '1.0.0',\n provides: ['export'],\n requires: [],\n optional: [],\n defaultConfig: {\n defaultFileName: 'document.pdf',\n },\n};\n","import { PluginPackage } from '@embedpdf/core';\n\nimport { ExportPlugin } from './export-plugin';\nimport { manifest, EXPORT_PLUGIN_ID } from './manifest';\nimport { ExportPluginConfig } from './types';\n\nexport const ExportPluginPackage: PluginPackage<ExportPlugin, ExportPluginConfig> = {\n manifest,\n create: (registry, config) => new ExportPlugin(EXPORT_PLUGIN_ID, registry, config),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './export-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":["_ExportPlugin","BasePlugin","constructor","id","registry","config","super","this","downloadRequest$","createEmitter","buildCapability","saveAsCopy","download","forDocument","documentId","createExportScope","getActiveDocumentId","emit","coreDoc","coreState","core","documents","document","engine","PdfTaskHelper","reject","code","PdfErrorCode","DocNotOpen","message","saveAsCopyAndGetBufferAndName","task","Task","wait","result","resolve","buffer","name","defaultFileName","error","fail","onRequest","listener","on","initialize","_","logger","info","destroy","clear","ExportPlugin","EXPORT_PLUGIN_ID","manifest","version","provides","requires","optional","defaultConfig","ExportPluginPackage","create","reducer","initialState"],"mappings":"gJAWaA,EAAN,cAA2BC,EAAAA,WAMhC,WAAAC,CAAYC,EAAYC,EAA0BC,GAChDC,MAAMH,EAAIC,GAJZG,KAAiBC,iBAAmBC,kBAKlCF,KAAKF,OAASA,CAChB,CAMU,eAAAK,GACR,MAAO,CAELC,WAAY,IAAMJ,KAAKI,aACvBC,SAAU,IAAML,KAAKK,WAGrBC,YAAcC,GAAuBP,KAAKQ,kBAAkBD,GAEhE,CAMQ,iBAAAC,CAAkBD,GACxB,MAAO,CACLH,WAAY,IAAMJ,KAAKI,WAAWG,GAClCF,SAAU,IAAML,KAAKK,SAASE,GAElC,CAMQ,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package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/lib/export-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, createEmitter, Listener, PluginRegistry } from '@embedpdf/core';\nimport { PdfErrorCode, PdfErrorReason, PdfTaskHelper, Task } from '@embedpdf/models';\n\nimport {\n BufferAndName,\n ExportCapability,\n ExportPluginConfig,\n ExportScope,\n DownloadRequestEvent,\n} from './types';\n\nexport class ExportPlugin extends BasePlugin<ExportPluginConfig, ExportCapability> {\n static readonly id = 'export' as const;\n\n private readonly downloadRequest$ = createEmitter<DownloadRequestEvent>();\n private readonly config: ExportPluginConfig;\n\n constructor(id: string, registry: PluginRegistry, config: ExportPluginConfig) {\n super(id, registry);\n this.config = config;\n }\n\n // ─────────────────────────────────────────────────────────\n // Capability\n // ─────────────────────────────────────────────────────────\n\n protected buildCapability(): ExportCapability {\n return {\n // Active document operations\n saveAsCopy: () => this.saveAsCopy(),\n download: () => this.download(),\n\n // Document-scoped operations\n forDocument: (documentId: string) => this.createExportScope(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Document Scoping\n // ─────────────────────────────────────────────────────────\n\n private createExportScope(documentId: string): ExportScope {\n return {\n saveAsCopy: () => this.saveAsCopy(documentId),\n download: () => this.download(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Core Operations\n // ─────────────────────────────────────────────────────────\n\n private download(documentId?: string): void {\n const id = documentId ?? this.getActiveDocumentId();\n this.downloadRequest$.emit({ documentId: id });\n }\n\n private saveAsCopy(documentId?: string): Task<ArrayBuffer, PdfErrorReason> {\n const id = documentId ?? this.getActiveDocumentId();\n const coreDoc = this.coreState.core.documents[id];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${id} not found`,\n });\n }\n\n return this.engine.saveAsCopy(coreDoc.document);\n }\n\n public saveAsCopyAndGetBufferAndName(documentId: string): Task<BufferAndName, PdfErrorReason> {\n const task = new Task<BufferAndName, PdfErrorReason>();\n const coreDoc = this.coreState.core.documents[documentId];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${documentId} not found`,\n });\n }\n\n this.saveAsCopy(documentId).wait(\n (result) => {\n task.resolve({\n buffer: result,\n name: coreDoc.name ?? this.config.defaultFileName,\n });\n },\n (error) => task.fail(error),\n );\n\n return task;\n }\n\n // ─────────────────────────────────────────────────────────\n // Event Listeners\n // ─────────────────────────────────────────────────────────\n\n public onRequest(listener: Listener<DownloadRequestEvent>) {\n return this.downloadRequest$.on(listener);\n }\n\n // ─────────────────────────────────────────────────────────\n // Lifecycle\n // ─────────────────────────────────────────────────────────\n\n async initialize(_: ExportPluginConfig): Promise<void> {\n this.logger.info('ExportPlugin', 'Initialize', 'Export plugin initialized');\n }\n\n async destroy(): Promise<void> {\n this.downloadRequest$.clear();\n await super.destroy();\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { ExportPluginConfig } from './types';\n\nexport const EXPORT_PLUGIN_ID = 'export';\n\nexport const manifest: PluginManifest<ExportPluginConfig> = {\n id: EXPORT_PLUGIN_ID,\n name: 'Export Plugin',\n version: '1.0.0',\n provides: ['export'],\n requires: [],\n optional: [],\n defaultConfig: {\n
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/lib/export-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, createEmitter, Listener, PluginRegistry } from '@embedpdf/core';\nimport { PdfErrorCode, PdfErrorReason, PdfTaskHelper, Task } from '@embedpdf/models';\n\nimport {\n BufferAndName,\n ExportCapability,\n ExportPluginConfig,\n ExportScope,\n DownloadRequestEvent,\n} from './types';\n\nexport class ExportPlugin extends BasePlugin<ExportPluginConfig, ExportCapability> {\n static readonly id = 'export' as const;\n\n private readonly downloadRequest$ = createEmitter<DownloadRequestEvent>();\n private readonly config: ExportPluginConfig;\n\n constructor(id: string, registry: PluginRegistry, config: ExportPluginConfig) {\n super(id, registry);\n this.config = config;\n }\n\n // ─────────────────────────────────────────────────────────\n // Capability\n // ─────────────────────────────────────────────────────────\n\n protected buildCapability(): ExportCapability {\n return {\n // Active document operations\n saveAsCopy: () => this.saveAsCopy(),\n download: () => this.download(),\n\n // Document-scoped operations\n forDocument: (documentId: string) => this.createExportScope(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Document Scoping\n // ─────────────────────────────────────────────────────────\n\n private createExportScope(documentId: string): ExportScope {\n return {\n saveAsCopy: () => this.saveAsCopy(documentId),\n download: () => this.download(documentId),\n };\n }\n\n // ─────────────────────────────────────────────────────────\n // Core Operations\n // ─────────────────────────────────────────────────────────\n\n private download(documentId?: string): void {\n const id = documentId ?? this.getActiveDocumentId();\n this.downloadRequest$.emit({ documentId: id });\n }\n\n private saveAsCopy(documentId?: string): Task<ArrayBuffer, PdfErrorReason> {\n const id = documentId ?? this.getActiveDocumentId();\n const coreDoc = this.coreState.core.documents[id];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${id} not found`,\n });\n }\n\n return this.engine.saveAsCopy(coreDoc.document);\n }\n\n public saveAsCopyAndGetBufferAndName(documentId: string): Task<BufferAndName, PdfErrorReason> {\n const task = new Task<BufferAndName, PdfErrorReason>();\n const coreDoc = this.coreState.core.documents[documentId];\n\n if (!coreDoc?.document) {\n return PdfTaskHelper.reject({\n code: PdfErrorCode.DocNotOpen,\n message: `Document ${documentId} not found`,\n });\n }\n\n this.saveAsCopy(documentId).wait(\n (result) => {\n task.resolve({\n buffer: result,\n name: coreDoc.name ?? this.config.defaultFileName,\n });\n },\n (error) => task.fail(error),\n );\n\n return task;\n }\n\n // ─────────────────────────────────────────────────────────\n // Event Listeners\n // ─────────────────────────────────────────────────────────\n\n public onRequest(listener: Listener<DownloadRequestEvent>) {\n return this.downloadRequest$.on(listener);\n }\n\n // ─────────────────────────────────────────────────────────\n // Lifecycle\n // ─────────────────────────────────────────────────────────\n\n async initialize(_: ExportPluginConfig): Promise<void> {\n this.logger.info('ExportPlugin', 'Initialize', 'Export plugin initialized');\n }\n\n async destroy(): Promise<void> {\n this.downloadRequest$.clear();\n await super.destroy();\n }\n}\n","import { PluginManifest } from '@embedpdf/core';\nimport { ExportPluginConfig } from './types';\n\nexport const EXPORT_PLUGIN_ID = 'export';\n\nexport const manifest: PluginManifest<ExportPluginConfig> = {\n id: EXPORT_PLUGIN_ID,\n name: 'Export Plugin',\n version: '1.0.0',\n provides: ['export'],\n requires: [],\n optional: [],\n defaultConfig: {\n defaultFileName: 'document.pdf',\n },\n};\n","import { PluginPackage } from '@embedpdf/core';\n\nimport { ExportPlugin } from './export-plugin';\nimport { manifest, EXPORT_PLUGIN_ID } from './manifest';\nimport { ExportPluginConfig } from './types';\n\nexport const ExportPluginPackage: PluginPackage<ExportPlugin, ExportPluginConfig> = {\n manifest,\n create: (registry, config) => new ExportPlugin(EXPORT_PLUGIN_ID, registry, config),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './export-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"names":[],"mappings":";;AAWO,MAAM,gBAAN,MAAM,sBAAqB,WAAiD;AAAA,EAMjF,YAAY,IAAY,UAA0B,QAA4B;AAC5E,UAAM,IAAI,QAAQ;AAJpB,SAAiB,mBAAmB,cAAA;AAKlC,SAAK,SAAS;AAAA,EAChB;AAAA;AAAA;AAAA;AAAA,EAMU,kBAAoC;AAC5C,WAAO;AAAA;AAAA,MAEL,YAAY,MAAM,KAAK,WAAA;AAAA,MACvB,UAAU,MAAM,KAAK,SAAA;AAAA;AAAA,MAGrB,aAAa,CAAC,eAAuB,KAAK,kBAAkB,UAAU;AAAA,IAAA;AAAA,EAE1E;AAAA;AAAA;AAAA;AAAA,EAMQ,kBAAkB,YAAiC;AACzD,WAAO;AAAA,MACL,YAAY,M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C5E;AAAA,EAEA,MAAM,UAAyB;AAC7B,SAAK,iBAAiB,MAAA;AACtB,UAAM,MAAM,QAAA;AAAA,EACd;AACF;AAvGE,cAAgB,KAAK;AADhB,IAAM,eAAN;ACRA,MAAM,mBAAmB;AAEzB,MAAM,WAA+C;AAAA,EAC1D,IAAI;AAAA,EACJ,MAAM;AAAA,EACN,SAAS;AAAA,EACT,UAAU,CAAC,QAAQ;AAAA,EACnB,UAAU,CAAA;AAAA,EACV,UAAU,CAAA;AAAA,EACV,eAAe;AAAA,IACb,iBAAiB;AAAA,EAAA;AAErB;ACTO,MAAM,sBAAuE;AAAA,EAClF;AAAA,EACA,QAAQ,CAAC,UAAU,WAAW,IAAI,aAAa,kBAAkB,UAAU,MAAM;AAAA,EACjF,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,cAAc,CAAA;AAChB;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-export",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@embedpdf/models": "2.0.0-next.
|
|
37
|
+
"@embedpdf/models": "2.0.0-next.2"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/react": "^18.2.0",
|
|
41
41
|
"typescript": "^5.0.0",
|
|
42
|
-
"@embedpdf/
|
|
43
|
-
"@embedpdf/
|
|
42
|
+
"@embedpdf/build": "1.1.0",
|
|
43
|
+
"@embedpdf/core": "2.0.0-next.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16.8.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"preact": "^10.26.4",
|
|
49
49
|
"vue": ">=3.2.0",
|
|
50
50
|
"svelte": ">=5 <6",
|
|
51
|
-
"@embedpdf/core": "2.0.0-next.
|
|
51
|
+
"@embedpdf/core": "2.0.0-next.2"
|
|
52
52
|
},
|
|
53
53
|
"files": [
|
|
54
54
|
"dist",
|