@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.
- package/dist/index.js +14 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { definePlugin
|
|
2
|
-
import { docToSvgString
|
|
3
|
-
function
|
|
4
|
-
return
|
|
1
|
+
import { definePlugin } from "mce";
|
|
2
|
+
import { docToSvgString } from "modern-idoc-svg";
|
|
3
|
+
function plugin() {
|
|
4
|
+
return definePlugin((editor) => {
|
|
5
5
|
const {
|
|
6
|
-
to
|
|
7
|
-
fonts
|
|
8
|
-
} =
|
|
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:
|
|
15
|
-
saveAs: (
|
|
16
|
-
handle: async (
|
|
17
|
-
const
|
|
18
|
-
return await
|
|
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
|
-
|
|
27
|
-
|
|
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.
|
|
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.
|
|
52
|
+
"mce": "0.11.3"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"mce": "^0"
|