mce 0.17.0 → 0.17.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/README.md +37 -22
- package/dist/composables/layer.d.ts +2 -2
- package/dist/composables/layout.d.ts +4 -4
- package/dist/crdt/YDoc.d.ts +1 -2
- package/dist/index.css +378 -378
- package/dist/index.js +770 -854
- package/dist/locale/en.d.ts +2 -2
- package/dist/locale/zh-Hans.d.ts +2 -2
- package/dist/nodes/Doc.d.ts +3 -3
- package/dist/plugins/doc.d.ts +17 -3
- package/dist/plugins/edit.d.ts +3 -0
- package/dist/typed-plugins.d.ts +4 -9
- package/dist/utils/index.d.ts +0 -1
- package/package.json +2 -7
- package/dist/mixins/3.view.d.ts +0 -9
- package/dist/plugins/copyAs.d.ts +0 -11
- package/dist/plugins/gif.d.ts +0 -12
- package/dist/plugins/new.d.ts +0 -12
- package/dist/plugins/open.d.ts +0 -12
- package/dist/utils/random.d.ts +0 -3
- /package/dist/mixins/{2.export.d.ts → exporter.d.ts} +0 -0
- /package/dist/mixins/{1.hotkey.d.ts → hotkey.d.ts} +0 -0
- /package/dist/mixins/{2.load.d.ts → loader.d.ts} +0 -0
- /package/dist/mixins/{snap.d.ts → snapper.d.ts} +0 -0
package/dist/locale/en.d.ts
CHANGED
package/dist/locale/zh-Hans.d.ts
CHANGED
package/dist/nodes/Doc.d.ts
CHANGED
|
@@ -14,16 +14,16 @@ export interface Doc {
|
|
|
14
14
|
emit: <K extends keyof DocEvents & string>(event: K, ...args: DocEvents[K]) => this;
|
|
15
15
|
}
|
|
16
16
|
export declare class Doc extends Node {
|
|
17
|
-
protected readonly _local: boolean;
|
|
18
17
|
_yDoc: YDoc;
|
|
19
18
|
protected _source: any;
|
|
20
|
-
constructor(source?: Mce.DocumentSource
|
|
19
|
+
constructor(source?: Mce.DocumentSource);
|
|
21
20
|
transact: <T>(fn: () => T, should?: boolean) => T;
|
|
22
21
|
undo: () => void;
|
|
23
22
|
redo: () => void;
|
|
24
23
|
stopCapturing: () => void;
|
|
25
24
|
clearHistory: () => void;
|
|
26
25
|
set: (source: Document) => this;
|
|
27
|
-
|
|
26
|
+
loadIndexeddb: () => Promise<void>;
|
|
27
|
+
init: () => this;
|
|
28
28
|
destroy: () => void;
|
|
29
29
|
}
|
package/dist/plugins/doc.d.ts
CHANGED
|
@@ -12,15 +12,29 @@ declare global {
|
|
|
12
12
|
inEditorIs: 'Doc';
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
type DocumentSource = InternalDocument | Element[] | string;
|
|
15
|
+
type DocumentSource = Doc | InternalDocument | Element[] | string;
|
|
16
|
+
interface Editor {
|
|
17
|
+
getDoc: () => JsonData;
|
|
18
|
+
setDoc: (doc: DocumentSource) => Doc;
|
|
19
|
+
loadDoc: (source: any) => Promise<Doc>;
|
|
20
|
+
clearDoc: () => void;
|
|
21
|
+
newDoc: () => void;
|
|
22
|
+
openDoc: () => Promise<void>;
|
|
23
|
+
}
|
|
16
24
|
interface Commands {
|
|
17
25
|
getDoc: () => JsonData;
|
|
18
|
-
setDoc: (doc: DocumentSource) =>
|
|
26
|
+
setDoc: (doc: DocumentSource) => Doc;
|
|
19
27
|
loadDoc: (source: any) => Promise<Doc>;
|
|
20
28
|
clearDoc: () => void;
|
|
29
|
+
newDoc: () => void;
|
|
30
|
+
openDoc: () => Promise<void>;
|
|
31
|
+
}
|
|
32
|
+
interface Hotkeys {
|
|
33
|
+
newDoc: [event: KeyboardEvent];
|
|
34
|
+
openDoc: [event: KeyboardEvent];
|
|
21
35
|
}
|
|
22
36
|
interface Events {
|
|
23
|
-
setDoc: [
|
|
37
|
+
setDoc: [doc: Doc, oldDoc: Doc];
|
|
24
38
|
docLoading: [source: any];
|
|
25
39
|
docLoaded: [source: any, root: Doc | Error];
|
|
26
40
|
clearDoc: [];
|
package/dist/plugins/edit.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ declare global {
|
|
|
3
3
|
namespace Mce {
|
|
4
4
|
type CopySource = string | Blob | Blob[] | Record<string, any>[];
|
|
5
5
|
type PasteSource = DataTransfer | ClipboardItem[];
|
|
6
|
+
interface CopyAsOptions extends ExportOptions {
|
|
7
|
+
}
|
|
6
8
|
interface Commands {
|
|
7
9
|
cancel: () => void;
|
|
8
10
|
delete: () => void;
|
|
9
11
|
copy: (source?: CopySource) => Promise<void>;
|
|
12
|
+
copyAs: (type: keyof Exporters, options?: CopyAsOptions) => Promise<void>;
|
|
10
13
|
cut: () => Promise<void>;
|
|
11
14
|
paste: (source?: PasteSource) => Promise<void>;
|
|
12
15
|
duplicate: () => void;
|
package/dist/typed-plugins.d.ts
CHANGED
|
@@ -9,29 +9,26 @@ import './mixins/0.context'
|
|
|
9
9
|
import './mixins/0.font'
|
|
10
10
|
import './mixins/0.locale'
|
|
11
11
|
import './mixins/1.frame'
|
|
12
|
-
import './mixins/1.hotkey'
|
|
13
12
|
import './mixins/1.screen'
|
|
14
13
|
import './mixins/1.timeline'
|
|
15
14
|
import './mixins/1.upload'
|
|
16
15
|
import './mixins/2.box'
|
|
17
|
-
import './mixins/2.export'
|
|
18
|
-
import './mixins/2.load'
|
|
19
|
-
import './mixins/3.view'
|
|
20
16
|
import './mixins/4.0.node'
|
|
21
17
|
import './mixins/4.2.frame'
|
|
22
18
|
import './mixins/4.3.element'
|
|
19
|
+
import './mixins/exporter'
|
|
20
|
+
import './mixins/hotkey'
|
|
23
21
|
import './mixins/http'
|
|
24
|
-
import './mixins/
|
|
22
|
+
import './mixins/loader'
|
|
23
|
+
import './mixins/snapper'
|
|
25
24
|
import './mixins/snapshot'
|
|
26
25
|
import './mixins/tool'
|
|
27
26
|
import './plugins/arrange'
|
|
28
27
|
import './plugins/autoNest'
|
|
29
|
-
import './plugins/copyAs'
|
|
30
28
|
import './plugins/doc'
|
|
31
29
|
import './plugins/edit'
|
|
32
30
|
import './plugins/formatPaint'
|
|
33
31
|
import './plugins/frame'
|
|
34
|
-
import './plugins/gif'
|
|
35
32
|
import './plugins/history'
|
|
36
33
|
import './plugins/hover'
|
|
37
34
|
import './plugins/html'
|
|
@@ -42,9 +39,7 @@ import './plugins/layers'
|
|
|
42
39
|
import './plugins/madeWith'
|
|
43
40
|
import './plugins/memory'
|
|
44
41
|
import './plugins/menu'
|
|
45
|
-
import './plugins/new'
|
|
46
42
|
import './plugins/node'
|
|
47
|
-
import './plugins/open'
|
|
48
43
|
import './plugins/pen'
|
|
49
44
|
import './plugins/ruler'
|
|
50
45
|
import './plugins/saveAs'
|
package/dist/utils/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.17.
|
|
4
|
+
"version": "0.17.2",
|
|
5
5
|
"description": "A headless infinite canvas editor framework built on WebGL rendering, supports exporting to image, video, and PPT. Only the ESM.",
|
|
6
6
|
"author": "wxm",
|
|
7
7
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"diff": "^8.0.3",
|
|
62
62
|
"file-saver": "^2.0.5",
|
|
63
63
|
"lodash-es": "^4.17.23",
|
|
64
|
-
"modern-canvas": "^0.15.
|
|
64
|
+
"modern-canvas": "^0.15.6",
|
|
65
65
|
"modern-font": "^0.4.4",
|
|
66
66
|
"modern-idoc": "^0.10.21",
|
|
67
67
|
"modern-text": "^1.10.15",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"lottie-web": "^5",
|
|
72
|
-
"modern-gif": "^2",
|
|
73
72
|
"typescript": ">=4.7",
|
|
74
73
|
"vue": "^3.5.0",
|
|
75
74
|
"yoga-layout": "^3"
|
|
@@ -78,9 +77,6 @@
|
|
|
78
77
|
"lottie-web": {
|
|
79
78
|
"optional": true
|
|
80
79
|
},
|
|
81
|
-
"modern-gif": {
|
|
82
|
-
"optional": true
|
|
83
|
-
},
|
|
84
80
|
"typescript": {
|
|
85
81
|
"optional": true
|
|
86
82
|
},
|
|
@@ -93,7 +89,6 @@
|
|
|
93
89
|
"@types/lodash-es": "^4.17.12",
|
|
94
90
|
"@vitejs/plugin-vue": "^6.0.4",
|
|
95
91
|
"jiti": "^2.6.1",
|
|
96
|
-
"modern-gif": "^2.0.4",
|
|
97
92
|
"sass-embedded": "^1.97.3",
|
|
98
93
|
"typedoc": "^0.28.17",
|
|
99
94
|
"typedoc-plugin-markdown": "^4.10.0"
|
package/dist/mixins/3.view.d.ts
DELETED
package/dist/plugins/copyAs.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
namespace Mce {
|
|
3
|
-
interface CopyAsOptions extends ExportOptions {
|
|
4
|
-
}
|
|
5
|
-
interface Commands {
|
|
6
|
-
copyAs: (type: keyof Exporters, options?: CopyAsOptions) => Promise<void>;
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
declare const _default: import("..").Plugin;
|
|
11
|
-
export default _default;
|
package/dist/plugins/gif.d.ts
DELETED
package/dist/plugins/new.d.ts
DELETED
package/dist/plugins/open.d.ts
DELETED
package/dist/utils/random.d.ts
DELETED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|