@mce/svg 0.11.0 → 0.11.2

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 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: o,
7
- fonts: t
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 o("json", e);
18
- return a({ ...r, fonts: t });
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/dist/plugin.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  declare global {
2
2
  namespace Mce {
3
3
  interface Exporters {
4
- svg: string;
4
+ svg: Promise<string>;
5
5
  }
6
6
  }
7
7
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mce/svg",
3
3
  "type": "module",
4
- "version": "0.11.0",
4
+ "version": "0.11.2",
5
5
  "description": "SVG plugin for mce",
6
6
  "author": "wxm",
7
7
  "license": "MIT",
@@ -46,10 +46,10 @@
46
46
  "dist"
47
47
  ],
48
48
  "dependencies": {
49
- "modern-idoc-svg": "^0.1.0"
49
+ "modern-idoc-svg": "^0.2.0"
50
50
  },
51
51
  "devDependencies": {
52
- "mce": "0.11.0"
52
+ "mce": "0.11.2"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "mce": "^0"