@mce/gaoding 0.11.1 → 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 +18 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
|
-
import { definePlugin
|
|
2
|
-
function
|
|
3
|
-
return
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { definePlugin } from "mce";
|
|
2
|
+
function plugin() {
|
|
3
|
+
return definePlugin((_editor) => {
|
|
4
|
+
return {
|
|
5
|
+
name: "gaoding"
|
|
6
|
+
};
|
|
7
|
+
});
|
|
6
8
|
}
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
9
|
+
function parseClipboard(dom) {
|
|
10
|
+
const data = dom.querySelector('span[data-app="editor-next"]');
|
|
11
|
+
if (data) {
|
|
10
12
|
return decodeURIComponent(
|
|
11
|
-
new TextDecoder("utf-8", { fatal:
|
|
13
|
+
new TextDecoder("utf-8", { fatal: false }).decode(
|
|
12
14
|
new Uint8Array(
|
|
13
15
|
atob(
|
|
14
|
-
|
|
15
|
-
).split("").map((
|
|
16
|
+
data.getAttribute("data-clipboard")?.replace(/\s+/g, "") ?? ""
|
|
17
|
+
).split("").map((c) => c.charCodeAt(0))
|
|
16
18
|
)
|
|
17
19
|
)
|
|
18
20
|
);
|
|
21
|
+
}
|
|
22
|
+
return void 0;
|
|
19
23
|
}
|
|
20
24
|
export {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
plugin as default,
|
|
26
|
+
parseClipboard,
|
|
27
|
+
plugin
|
|
24
28
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mce/gaoding",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.2",
|
|
5
5
|
"description": "Plugin for mce",
|
|
6
6
|
"author": "wxm",
|
|
7
7
|
"license": "MIT",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"mce": "0.11.
|
|
48
|
+
"mce": "0.11.2"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"mce": "^0"
|