@mce/pdf 0.11.1 → 0.11.3

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.
Files changed (2) hide show
  1. package/dist/index.js +15 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,22 +1,22 @@
1
- import { definePlugin as a } from "mce";
2
- import { Pdf as f } from "modern-pdf";
3
- function u() {
4
- return a((n) => {
1
+ import { definePlugin } from "mce";
2
+ import { Pdf } from "modern-pdf";
3
+ function plugin() {
4
+ return definePlugin((editor) => {
5
5
  const {
6
- to: t,
7
- fonts: e
8
- } = n;
6
+ to,
7
+ fonts
8
+ } = editor;
9
9
  return {
10
10
  name: "mce:pdf",
11
11
  exporters: [
12
12
  {
13
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
14
+ saveAs: true,
15
+ handle: async (options) => {
16
+ const doc = await to("json", options);
17
+ return await new Pdf({
18
+ ...doc,
19
+ fonts
20
20
  }).toBlob();
21
21
  }
22
22
  }
@@ -25,6 +25,6 @@ function u() {
25
25
  });
26
26
  }
27
27
  export {
28
- u as default,
29
- u as plugin
28
+ plugin as default,
29
+ plugin
30
30
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mce/pdf",
3
3
  "type": "module",
4
- "version": "0.11.1",
4
+ "version": "0.11.3",
5
5
  "description": "PDF plugin for mce",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "modern-pdf": "^1.3.2"
50
50
  },
51
51
  "devDependencies": {
52
- "mce": "0.11.1"
52
+ "mce": "0.11.3"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "mce": "^0"