@mce/svg 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 +14 -14
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
- import { definePlugin as s } from "mce";
2
- import { docToSvgString as a } from "modern-idoc-svg";
3
- function c() {
4
- return s((n) => {
1
+ import { definePlugin } from "mce";
2
+ import { docToSvgString } from "modern-idoc-svg";
3
+ function plugin() {
4
+ return definePlugin((editor) => {
5
5
  const {
6
- to: t,
7
- fonts: o
8
- } = n;
6
+ to,
7
+ fonts
8
+ } = editor;
9
9
  return {
10
10
  name: "mce:svg",
11
11
  exporters: [
12
12
  {
13
13
  name: "svg",
14
- copyAs: !0,
15
- saveAs: (e) => new Blob([e], { type: "image/svg+xml" }),
16
- handle: async (e) => {
17
- const r = await t("json", e);
18
- return await a({ ...r, fonts: o });
14
+ copyAs: true,
15
+ saveAs: (exported) => new Blob([exported], { type: "image/svg+xml" }),
16
+ handle: async (options) => {
17
+ const doc = await to("json", options);
18
+ return await docToSvgString({ ...doc, fonts });
19
19
  }
20
20
  }
21
21
  ]
@@ -23,6 +23,6 @@ function c() {
23
23
  });
24
24
  }
25
25
  export {
26
- c as default,
27
- c as plugin
26
+ plugin as default,
27
+ plugin
28
28
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mce/svg",
3
3
  "type": "module",
4
- "version": "0.11.1",
4
+ "version": "0.11.3",
5
5
  "description": "SVG plugin for mce",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -49,7 +49,7 @@
49
49
  "modern-idoc-svg": "^0.2.0"
50
50
  },
51
51
  "devDependencies": {
52
- "mce": "0.11.1"
52
+ "mce": "0.11.3"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "mce": "^0"