@mce/pdf 0.17.9 → 0.17.12
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.js +29 -33
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,37 +1,33 @@
|
|
|
1
1
|
import { definePlugin } from "mce";
|
|
2
2
|
import { Pdf } from "modern-pdf";
|
|
3
|
+
//#region src/plugin.ts
|
|
3
4
|
function plugin() {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return await pdf.toBlob();
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
};
|
|
32
|
-
});
|
|
5
|
+
return definePlugin((editor) => {
|
|
6
|
+
const { to, fonts } = editor;
|
|
7
|
+
return {
|
|
8
|
+
name: "mce:pdf",
|
|
9
|
+
exporters: [{
|
|
10
|
+
name: "pdf",
|
|
11
|
+
saveAs: true,
|
|
12
|
+
handle: async (options) => {
|
|
13
|
+
const { pdf: pdfOptions, ...jsonOptions } = options;
|
|
14
|
+
const doc = await to("json", jsonOptions);
|
|
15
|
+
doc.children?.reverse();
|
|
16
|
+
return await new Pdf({
|
|
17
|
+
...doc,
|
|
18
|
+
fonts,
|
|
19
|
+
meta: {
|
|
20
|
+
...doc.meta,
|
|
21
|
+
...pdfOptions
|
|
22
|
+
}
|
|
23
|
+
}).toBlob();
|
|
24
|
+
}
|
|
25
|
+
}]
|
|
26
|
+
};
|
|
27
|
+
});
|
|
33
28
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/index.ts
|
|
31
|
+
var src_default = plugin;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { src_default as default, plugin };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mce/pdf",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.12",
|
|
5
5
|
"description": "PDF plugin for mce",
|
|
6
6
|
"author": "wxm",
|
|
7
7
|
"license": "MIT",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"modern-pdf": "^1.4.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"mce": "0.17.
|
|
52
|
+
"mce": "0.17.12"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"mce": "^0"
|