@embedpdf/plugin-attachment 1.0.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.
- package/LICENSE +21 -0
- package/dist/index.cjs +74 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/preact/index.cjs +38 -0
- package/dist/preact/index.cjs.map +1 -0
- package/dist/preact/index.d.cts +15 -0
- package/dist/preact/index.d.ts +15 -0
- package/dist/preact/index.js +10 -0
- package/dist/preact/index.js.map +1 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 CloudPDF
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
ATTACHMENT_PLUGIN_ID: () => ATTACHMENT_PLUGIN_ID,
|
|
24
|
+
AttachmentPlugin: () => AttachmentPlugin,
|
|
25
|
+
AttachmentPluginPackage: () => AttachmentPluginPackage,
|
|
26
|
+
manifest: () => manifest
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
|
|
30
|
+
// src/lib/attachment-plugin.ts
|
|
31
|
+
var import_core = require("@embedpdf/core");
|
|
32
|
+
var AttachmentPlugin = class extends import_core.BasePlugin {
|
|
33
|
+
constructor(id, registry, engine) {
|
|
34
|
+
super(id, registry);
|
|
35
|
+
this.engine = engine;
|
|
36
|
+
}
|
|
37
|
+
async initialize(_) {
|
|
38
|
+
}
|
|
39
|
+
buildCapability() {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
AttachmentPlugin.id = "attachment";
|
|
44
|
+
|
|
45
|
+
// src/lib/manifest.ts
|
|
46
|
+
var ATTACHMENT_PLUGIN_ID = "attachment";
|
|
47
|
+
var manifest = {
|
|
48
|
+
id: ATTACHMENT_PLUGIN_ID,
|
|
49
|
+
name: "Attachment Plugin",
|
|
50
|
+
version: "1.0.0",
|
|
51
|
+
provides: ["attachment"],
|
|
52
|
+
requires: [],
|
|
53
|
+
optional: [],
|
|
54
|
+
defaultConfig: {
|
|
55
|
+
enabled: true
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
// src/lib/index.ts
|
|
60
|
+
var AttachmentPluginPackage = {
|
|
61
|
+
manifest,
|
|
62
|
+
create: (registry, engine) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry, engine),
|
|
63
|
+
reducer: () => {
|
|
64
|
+
},
|
|
65
|
+
initialState: {}
|
|
66
|
+
};
|
|
67
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
68
|
+
0 && (module.exports = {
|
|
69
|
+
ATTACHMENT_PLUGIN_ID,
|
|
70
|
+
AttachmentPlugin,
|
|
71
|
+
AttachmentPluginPackage,
|
|
72
|
+
manifest
|
|
73
|
+
});
|
|
74
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/lib/attachment-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["export * from './lib';\n","import { BasePlugin, PluginRegistry } from '@embedpdf/core';\nimport { PdfEngine } from '@embedpdf/models';\n\nimport { AttachmentCapability, AttachmentPluginConfig } from './types';\n\nexport class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {\n static readonly id = 'attachment' as const;\n\n private engine: PdfEngine;\n\n constructor(id: string, registry: PluginRegistry, engine: PdfEngine) {\n super(id, registry);\n\n this.engine = engine;\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, engine) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry, engine),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './attachment-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAA2C;AAKpC,IAAM,mBAAN,cAA+B,uBAAyD;AAAA,EAK7F,YAAY,IAAY,UAA0B,QAAmB;AACnE,UAAM,IAAI,QAAQ;AAElB,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,MAAM,WAAW,GAA0C;AAAA,EAAC;AAAA,EAElD,kBAAwC;AAChD,WAAO,CAAC;AAAA,EACV;AACF;AAhBa,iBACK,KAAK;;;ACHhB,IAAM,uBAAuB;AAE7B,IAAM,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,EACX;AACF;;;ACTO,IAAM,0BAAmF;AAAA,EAC9F;AAAA,EACA,QAAQ,CAAC,UAAU,WAAW,IAAI,iBAAiB,sBAAsB,UAAU,MAAM;AAAA,EACzF,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,cAAc,CAAC;AACjB;","names":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BasePluginConfig, BasePlugin, PluginRegistry, PluginManifest, PluginPackage } from '@embedpdf/core';
|
|
2
|
+
import { PdfEngine } from '@embedpdf/models';
|
|
3
|
+
|
|
4
|
+
interface AttachmentPluginConfig extends BasePluginConfig {
|
|
5
|
+
}
|
|
6
|
+
interface AttachmentCapability {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {
|
|
10
|
+
static readonly id: "attachment";
|
|
11
|
+
private engine;
|
|
12
|
+
constructor(id: string, registry: PluginRegistry, engine: PdfEngine);
|
|
13
|
+
initialize(_: AttachmentPluginConfig): Promise<void>;
|
|
14
|
+
protected buildCapability(): AttachmentCapability;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare const ATTACHMENT_PLUGIN_ID = "attachment";
|
|
18
|
+
declare const manifest: PluginManifest<AttachmentPluginConfig>;
|
|
19
|
+
|
|
20
|
+
declare const AttachmentPluginPackage: PluginPackage<AttachmentPlugin, AttachmentPluginConfig>;
|
|
21
|
+
|
|
22
|
+
export { ATTACHMENT_PLUGIN_ID, type AttachmentCapability, AttachmentPlugin, type AttachmentPluginConfig, AttachmentPluginPackage, manifest };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BasePluginConfig, BasePlugin, PluginRegistry, PluginManifest, PluginPackage } from '@embedpdf/core';
|
|
2
|
+
import { PdfEngine } from '@embedpdf/models';
|
|
3
|
+
|
|
4
|
+
interface AttachmentPluginConfig extends BasePluginConfig {
|
|
5
|
+
}
|
|
6
|
+
interface AttachmentCapability {
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
declare class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {
|
|
10
|
+
static readonly id: "attachment";
|
|
11
|
+
private engine;
|
|
12
|
+
constructor(id: string, registry: PluginRegistry, engine: PdfEngine);
|
|
13
|
+
initialize(_: AttachmentPluginConfig): Promise<void>;
|
|
14
|
+
protected buildCapability(): AttachmentCapability;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare const ATTACHMENT_PLUGIN_ID = "attachment";
|
|
18
|
+
declare const manifest: PluginManifest<AttachmentPluginConfig>;
|
|
19
|
+
|
|
20
|
+
declare const AttachmentPluginPackage: PluginPackage<AttachmentPlugin, AttachmentPluginConfig>;
|
|
21
|
+
|
|
22
|
+
export { ATTACHMENT_PLUGIN_ID, type AttachmentCapability, AttachmentPlugin, type AttachmentPluginConfig, AttachmentPluginPackage, manifest };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// src/lib/attachment-plugin.ts
|
|
2
|
+
import { BasePlugin } from "@embedpdf/core";
|
|
3
|
+
var AttachmentPlugin = class extends BasePlugin {
|
|
4
|
+
constructor(id, registry, engine) {
|
|
5
|
+
super(id, registry);
|
|
6
|
+
this.engine = engine;
|
|
7
|
+
}
|
|
8
|
+
async initialize(_) {
|
|
9
|
+
}
|
|
10
|
+
buildCapability() {
|
|
11
|
+
return {};
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
AttachmentPlugin.id = "attachment";
|
|
15
|
+
|
|
16
|
+
// src/lib/manifest.ts
|
|
17
|
+
var ATTACHMENT_PLUGIN_ID = "attachment";
|
|
18
|
+
var manifest = {
|
|
19
|
+
id: ATTACHMENT_PLUGIN_ID,
|
|
20
|
+
name: "Attachment Plugin",
|
|
21
|
+
version: "1.0.0",
|
|
22
|
+
provides: ["attachment"],
|
|
23
|
+
requires: [],
|
|
24
|
+
optional: [],
|
|
25
|
+
defaultConfig: {
|
|
26
|
+
enabled: true
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
// src/lib/index.ts
|
|
31
|
+
var AttachmentPluginPackage = {
|
|
32
|
+
manifest,
|
|
33
|
+
create: (registry, engine) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry, engine),
|
|
34
|
+
reducer: () => {
|
|
35
|
+
},
|
|
36
|
+
initialState: {}
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
ATTACHMENT_PLUGIN_ID,
|
|
40
|
+
AttachmentPlugin,
|
|
41
|
+
AttachmentPluginPackage,
|
|
42
|
+
manifest
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/attachment-plugin.ts","../src/lib/manifest.ts","../src/lib/index.ts"],"sourcesContent":["import { BasePlugin, PluginRegistry } from '@embedpdf/core';\nimport { PdfEngine } from '@embedpdf/models';\n\nimport { AttachmentCapability, AttachmentPluginConfig } from './types';\n\nexport class AttachmentPlugin extends BasePlugin<AttachmentPluginConfig, AttachmentCapability> {\n static readonly id = 'attachment' as const;\n\n private engine: PdfEngine;\n\n constructor(id: string, registry: PluginRegistry, engine: PdfEngine) {\n super(id, registry);\n\n this.engine = engine;\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, engine) => new AttachmentPlugin(ATTACHMENT_PLUGIN_ID, registry, engine),\n reducer: () => {},\n initialState: {},\n};\n\nexport * from './attachment-plugin';\nexport * from './types';\nexport * from './manifest';\n"],"mappings":";AAAA,SAAS,kBAAkC;AAKpC,IAAM,mBAAN,cAA+B,WAAyD;AAAA,EAK7F,YAAY,IAAY,UAA0B,QAAmB;AACnE,UAAM,IAAI,QAAQ;AAElB,SAAK,SAAS;AAAA,EAChB;AAAA,EAEA,MAAM,WAAW,GAA0C;AAAA,EAAC;AAAA,EAElD,kBAAwC;AAChD,WAAO,CAAC;AAAA,EACV;AACF;AAhBa,iBACK,KAAK;;;ACHhB,IAAM,uBAAuB;AAE7B,IAAM,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,EACX;AACF;;;ACTO,IAAM,0BAAmF;AAAA,EAC9F;AAAA,EACA,QAAQ,CAAC,UAAU,WAAW,IAAI,iBAAiB,sBAAsB,UAAU,MAAM;AAAA,EACzF,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,cAAc,CAAC;AACjB;","names":[]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/preact/index.ts
|
|
21
|
+
var preact_exports = {};
|
|
22
|
+
__export(preact_exports, {
|
|
23
|
+
useAttachment: () => useAttachment,
|
|
24
|
+
useAttachmentCapability: () => useAttachmentCapability
|
|
25
|
+
});
|
|
26
|
+
module.exports = __toCommonJS(preact_exports);
|
|
27
|
+
|
|
28
|
+
// src/preact/hooks/use-attachment.ts
|
|
29
|
+
var import_preact = require("@embedpdf/core/preact");
|
|
30
|
+
var import_plugin_attachment = require("@embedpdf/plugin-attachment");
|
|
31
|
+
var useAttachment = () => (0, import_preact.usePlugin)(import_plugin_attachment.AttachmentPlugin.id);
|
|
32
|
+
var useAttachmentCapability = () => (0, import_preact.useCapability)(import_plugin_attachment.AttachmentPlugin.id);
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
useAttachment,
|
|
36
|
+
useAttachmentCapability
|
|
37
|
+
});
|
|
38
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/preact/index.ts","../../src/preact/hooks/use-attachment.ts"],"sourcesContent":["export * from './hooks';\n","import { useCapability, usePlugin } from '@embedpdf/core/preact';\nimport { AttachmentPlugin } from '@embedpdf/plugin-attachment';\n\nexport const useAttachment = () => usePlugin<AttachmentPlugin>(AttachmentPlugin.id);\nexport const useAttachmentCapability = () => useCapability<AttachmentPlugin>(AttachmentPlugin.id);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAAyC;AACzC,+BAAiC;AAE1B,IAAM,gBAAgB,UAAM,yBAA4B,0CAAiB,EAAE;AAC3E,IAAM,0BAA0B,UAAM,6BAAgC,0CAAiB,EAAE;","names":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _embedpdf_plugin_attachment from '@embedpdf/plugin-attachment';
|
|
2
|
+
import { AttachmentPlugin } from '@embedpdf/plugin-attachment';
|
|
3
|
+
|
|
4
|
+
declare const useAttachment: () => {
|
|
5
|
+
plugin: AttachmentPlugin | null;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
ready: Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
declare const useAttachmentCapability: () => {
|
|
10
|
+
provides: Readonly<_embedpdf_plugin_attachment.AttachmentCapability> | null;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
ready: Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { useAttachment, useAttachmentCapability };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _embedpdf_plugin_attachment from '@embedpdf/plugin-attachment';
|
|
2
|
+
import { AttachmentPlugin } from '@embedpdf/plugin-attachment';
|
|
3
|
+
|
|
4
|
+
declare const useAttachment: () => {
|
|
5
|
+
plugin: AttachmentPlugin | null;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
ready: Promise<void>;
|
|
8
|
+
};
|
|
9
|
+
declare const useAttachmentCapability: () => {
|
|
10
|
+
provides: Readonly<_embedpdf_plugin_attachment.AttachmentCapability> | null;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
ready: Promise<void>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { useAttachment, useAttachmentCapability };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/preact/hooks/use-attachment.ts
|
|
2
|
+
import { useCapability, usePlugin } from "@embedpdf/core/preact";
|
|
3
|
+
import { AttachmentPlugin } from "@embedpdf/plugin-attachment";
|
|
4
|
+
var useAttachment = () => usePlugin(AttachmentPlugin.id);
|
|
5
|
+
var useAttachmentCapability = () => useCapability(AttachmentPlugin.id);
|
|
6
|
+
export {
|
|
7
|
+
useAttachment,
|
|
8
|
+
useAttachmentCapability
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/preact/hooks/use-attachment.ts"],"sourcesContent":["import { useCapability, usePlugin } from '@embedpdf/core/preact';\nimport { AttachmentPlugin } from '@embedpdf/plugin-attachment';\n\nexport const useAttachment = () => usePlugin<AttachmentPlugin>(AttachmentPlugin.id);\nexport const useAttachmentCapability = () => useCapability<AttachmentPlugin>(AttachmentPlugin.id);\n"],"mappings":";AAAA,SAAS,eAAe,iBAAiB;AACzC,SAAS,wBAAwB;AAE1B,IAAM,gBAAgB,MAAM,UAA4B,iBAAiB,EAAE;AAC3E,IAAM,0BAA0B,MAAM,cAAgC,iBAAiB,EAAE;","names":[]}
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@embedpdf/plugin-attachment",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./dist/index.cjs"
|
|
13
|
+
},
|
|
14
|
+
"./preact": {
|
|
15
|
+
"types": "./dist/preact/index.d.ts",
|
|
16
|
+
"import": "./dist/preact/index.js",
|
|
17
|
+
"require": "./dist/preact/index.cjs"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/react": "^18.2.0",
|
|
23
|
+
"tsup": "^8.0.0",
|
|
24
|
+
"typescript": "^5.0.0",
|
|
25
|
+
"@embedpdf/core": "1.0.0",
|
|
26
|
+
"@embedpdf/models": "1.0.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": ">=16.8.0",
|
|
30
|
+
"react-dom": ">=16.8.0",
|
|
31
|
+
"preact": "^10.26.4",
|
|
32
|
+
"@embedpdf/core": "1.0.0"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
37
|
+
],
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "https://github.com/embedpdf/embed-pdf-viewer",
|
|
41
|
+
"directory": "packages/plugin-attachment"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://www.embedpdf.com/docs",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/embedpdf/embed-pdf-viewer/issues"
|
|
46
|
+
},
|
|
47
|
+
"publishConfig": {
|
|
48
|
+
"access": "public"
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "PROJECT_CWD=$(pwd) pnpm -w p:build",
|
|
52
|
+
"build:watch": "PROJECT_CWD=$(pwd) pnpm -w p:build:watch",
|
|
53
|
+
"clean": "PROJECT_CWD=$(pwd) pnpm -w p:clean",
|
|
54
|
+
"lint": "PROJECT_CWD=$(pwd) pnpm -w p:lint",
|
|
55
|
+
"lint:fix": "PROJECT_CWD=$(pwd) pnpm -w p:lint:fix",
|
|
56
|
+
"typecheck": "PROJECT_CWD=$(pwd) pnpm -w p:typecheck"
|
|
57
|
+
}
|
|
58
|
+
}
|