@mce/pdf 0.11.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.
@@ -0,0 +1,3 @@
1
+ import { plugin } from './plugin';
2
+ export * from './plugin';
3
+ export default plugin;
package/dist/index.js ADDED
@@ -0,0 +1,30 @@
1
+ import { definePlugin as a } from "mce";
2
+ import { Pdf as f } from "modern-pdf";
3
+ function u() {
4
+ return a((n) => {
5
+ const {
6
+ to: t,
7
+ fonts: e
8
+ } = n;
9
+ return {
10
+ name: "mce:pdf",
11
+ exporters: [
12
+ {
13
+ name: "pdf",
14
+ saveAs: !0,
15
+ handle: async (o) => {
16
+ const r = await t("json", o);
17
+ return await new f({
18
+ ...r,
19
+ fonts: e
20
+ }).toBlob();
21
+ }
22
+ }
23
+ ]
24
+ };
25
+ });
26
+ }
27
+ export {
28
+ u as default,
29
+ u as plugin
30
+ };
@@ -0,0 +1,8 @@
1
+ declare global {
2
+ namespace Mce {
3
+ interface Exporters {
4
+ pdf: Blob;
5
+ }
6
+ }
7
+ }
8
+ export declare function plugin(): import("mce").Plugin;
package/package.json ADDED
@@ -0,0 +1,63 @@
1
+ {
2
+ "name": "@mce/pdf",
3
+ "type": "module",
4
+ "version": "0.11.0",
5
+ "description": "PDF plugin for mce",
6
+ "author": "wxm",
7
+ "license": "MIT",
8
+ "homepage": "https://github.com/qq15725/mce",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/qq15725/mce.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/qq15725/mce/issues"
15
+ },
16
+ "keywords": [
17
+ "mce",
18
+ "pdf",
19
+ "plugin"
20
+ ],
21
+ "sideEffects": true,
22
+ "exports": {
23
+ ".": {
24
+ "types": "./dist/index.d.ts",
25
+ "import": "./dist/index.js",
26
+ "require": "./dist/index.js"
27
+ },
28
+ "./*.mjs": "./*.js",
29
+ "./*": "./*"
30
+ },
31
+ "main": "./dist/index.js",
32
+ "module": "./dist/index.js",
33
+ "browser": "./dist/index.js",
34
+ "typings": "dist/index.d.ts",
35
+ "types": "dist/index.d.ts",
36
+ "typesVersions": {
37
+ "*": {
38
+ "*": [
39
+ "*",
40
+ "dist/*",
41
+ "dist/*.d.ts"
42
+ ]
43
+ }
44
+ },
45
+ "files": [
46
+ "dist"
47
+ ],
48
+ "dependencies": {
49
+ "modern-pdf": "^1.3.2"
50
+ },
51
+ "devDependencies": {
52
+ "mce": "0.11.0"
53
+ },
54
+ "peerDependencies": {
55
+ "mce": "^0"
56
+ },
57
+ "scripts": {
58
+ "build:code": "vite build",
59
+ "build:tsc": "NODE_ENV=production tsc --emitDeclarationOnly --project tsconfig.json",
60
+ "build": "pnpm build:code && pnpm build:tsc",
61
+ "lint": "eslint src"
62
+ }
63
+ }