mce 0.16.2 → 0.16.4
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/components/ForegroundCropper.vue.d.ts +1 -0
- package/dist/components/MemoryManager.vue.d.ts +3 -0
- package/dist/components/Rulers.vue.d.ts +4 -1
- package/dist/components/Selection.vue.d.ts +55 -55
- package/dist/components/shared/Cropper.vue.d.ts +2 -0
- package/dist/components/shared/Ruler.vue.d.ts +14 -2
- package/dist/composables/strategy.d.ts +1 -1
- package/dist/crdt/YDoc.d.ts +22 -13
- package/dist/index.css +11 -2
- package/dist/index.js +634 -408
- package/dist/locale/en.d.ts +2 -0
- package/dist/locale/zh-Hans.d.ts +2 -0
- package/dist/mixins/0.config.d.ts +6 -1
- package/dist/mixins/0.context.d.ts +2 -1
- package/dist/nodes/Doc.d.ts +4 -1
- package/dist/plugins/memory.d.ts +2 -0
- package/dist/plugins/ruler.d.ts +13 -1
- package/dist/plugins/selection.d.ts +14 -8
- package/dist/plugins/smartGuides.d.ts +2 -7
- package/dist/plugins/transform.d.ts +15 -2
- package/dist/plugins/ui.d.ts +0 -3
- package/dist/typed-plugins.d.ts +1 -0
- package/package.json +6 -6
- package/dist/crdt/YModel.d.ts +0 -30
package/dist/locale/en.d.ts
CHANGED
|
@@ -80,7 +80,9 @@ declare const _default: {
|
|
|
80
80
|
'panels:timeline': string;
|
|
81
81
|
'panels:statusbar': string;
|
|
82
82
|
'panels:nodeCreator': string;
|
|
83
|
+
'panels:memoryManager': string;
|
|
83
84
|
nodeCreator: string;
|
|
85
|
+
memoryManager: string;
|
|
84
86
|
toolbelt: string;
|
|
85
87
|
msaa: string;
|
|
86
88
|
pixelate: string;
|
package/dist/locale/zh-Hans.d.ts
CHANGED
|
@@ -80,7 +80,9 @@ declare const _default: {
|
|
|
80
80
|
'panels:statusbar': string;
|
|
81
81
|
'panels:timeline': string;
|
|
82
82
|
'panels:nodeCreator': string;
|
|
83
|
+
'panels:memoryManager': string;
|
|
83
84
|
nodeCreator: string;
|
|
85
|
+
memoryManager: string;
|
|
84
86
|
toolbelt: string;
|
|
85
87
|
msaa: string;
|
|
86
88
|
pixelate: string;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { WritableComputedRef } from 'vue';
|
|
2
2
|
declare global {
|
|
3
3
|
namespace Mce {
|
|
4
|
+
interface ConfigDeclaration<T = any> {
|
|
5
|
+
default?: T | (() => T);
|
|
6
|
+
getter?: (val: any) => any;
|
|
7
|
+
setter?: (val: any) => any;
|
|
8
|
+
}
|
|
4
9
|
interface Editor {
|
|
5
10
|
getConfigValue: (path: keyof Config | string, defaultValue?: any) => any;
|
|
6
11
|
setConfigValue: (path: keyof Config | string, value: any) => void;
|
|
7
12
|
getConfig: <T = any>(path: string) => WritableComputedRef<T>;
|
|
8
|
-
registerConfig: <T>(path: keyof Config | string,
|
|
13
|
+
registerConfig: <T>(path: keyof Config | string, declaration?: ConfigDeclaration<T>) => WritableComputedRef<T>;
|
|
9
14
|
importConfig: () => Promise<void>;
|
|
10
15
|
exportConfig: () => Blob;
|
|
11
16
|
saveAsConfig: (filename?: string) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Cursor, Vector2, Vector2Like } from 'modern-canvas';
|
|
1
|
+
import type { Assets, Cursor, Vector2, Vector2Like } from 'modern-canvas';
|
|
2
2
|
import type { IndexCharacter as _IndexCharacter } from 'modern-text/web-components';
|
|
3
3
|
import type { Ref } from 'vue';
|
|
4
4
|
import { Aabb2D, Camera2D, DrawboardEffect, Element2D, Engine, Node, Timeline } from 'modern-canvas';
|
|
@@ -23,6 +23,7 @@ declare global {
|
|
|
23
23
|
type EditorNodeType = 'Doc' | 'Frame' | 'Slice' | 'Element';
|
|
24
24
|
interface Editor {
|
|
25
25
|
fonts: Fonts;
|
|
26
|
+
assets: Assets;
|
|
26
27
|
renderEngine: Ref<Engine>;
|
|
27
28
|
timeline: Ref<Timeline>;
|
|
28
29
|
camera: Ref<Camera2D>;
|
package/dist/nodes/Doc.d.ts
CHANGED
|
@@ -21,6 +21,9 @@ export declare class Doc extends Node {
|
|
|
21
21
|
transact: <T>(fn: () => T, should?: boolean) => T;
|
|
22
22
|
undo: () => void;
|
|
23
23
|
redo: () => void;
|
|
24
|
+
stopCapturing: () => void;
|
|
25
|
+
clearHistory: () => void;
|
|
24
26
|
set: (source: Document) => this;
|
|
25
|
-
load()
|
|
27
|
+
load: () => Promise<void>;
|
|
28
|
+
destroy: () => void;
|
|
26
29
|
}
|
package/dist/plugins/ruler.d.ts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
namespace Mce {
|
|
3
|
+
interface RulerConfig {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
adsorbed?: boolean;
|
|
6
|
+
lineColor?: string;
|
|
7
|
+
locked?: boolean;
|
|
8
|
+
}
|
|
3
9
|
interface Config {
|
|
4
|
-
ruler:
|
|
10
|
+
ruler: RulerConfig;
|
|
11
|
+
}
|
|
12
|
+
interface Options {
|
|
13
|
+
ruler?: boolean & RulerConfig;
|
|
14
|
+
}
|
|
15
|
+
interface Commands {
|
|
16
|
+
clearRulerLines: () => void;
|
|
5
17
|
}
|
|
6
18
|
}
|
|
7
19
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Aabb2D,
|
|
1
|
+
import type { Aabb2D, Node } from 'modern-canvas';
|
|
2
2
|
declare global {
|
|
3
3
|
namespace Mce {
|
|
4
4
|
type SelectTarget = 'none' | 'all' | 'inverse' | 'children' | 'parent' | 'previousSibling' | 'nextSibling' | Node[];
|
|
@@ -35,19 +35,25 @@ declare global {
|
|
|
35
35
|
interface Slots {
|
|
36
36
|
'selection'?: () => void;
|
|
37
37
|
'selection.transform'?: () => void;
|
|
38
|
+
'selection.foreground-cropper'?: (props: {
|
|
39
|
+
scale: number;
|
|
40
|
+
setScale: (scale: number) => void;
|
|
41
|
+
setAspectRatio: (aspectRatio: 0 | [number, number]) => void;
|
|
42
|
+
ok: () => void;
|
|
43
|
+
cancel: () => void;
|
|
44
|
+
}) => void;
|
|
38
45
|
}
|
|
39
|
-
|
|
40
|
-
type TransformHandleCorner = 'tl' | 'tr' | 'bl' | 'br';
|
|
41
|
-
type TransformHandle = 'move' | `resize-${TransformHandleDirection | TransformHandleCorner}` | `rotate-${TransformHandleCorner}` | `round-${TransformHandleCorner}`;
|
|
42
|
-
interface SelectionTransformContext {
|
|
46
|
+
interface BaseSelectionTransformContext {
|
|
43
47
|
startEvent: MouseEvent | PointerEvent;
|
|
44
48
|
handle: TransformHandle;
|
|
45
|
-
|
|
49
|
+
}
|
|
50
|
+
interface SelectionTransformContext extends BaseSelectionTransformContext {
|
|
51
|
+
value: TransformValue;
|
|
46
52
|
}
|
|
47
53
|
interface Events {
|
|
48
|
-
selectionTransformStart: [context:
|
|
54
|
+
selectionTransformStart: [context: BaseSelectionTransformContext];
|
|
49
55
|
selectionTransform: [context: SelectionTransformContext];
|
|
50
|
-
selectionTransformEnd: [context:
|
|
56
|
+
selectionTransformEnd: [context: BaseSelectionTransformContext];
|
|
51
57
|
}
|
|
52
58
|
}
|
|
53
59
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
import type { ComputedRef } from 'vue';
|
|
2
1
|
declare global {
|
|
3
2
|
namespace Mce {
|
|
4
|
-
interface
|
|
5
|
-
|
|
6
|
-
getSnapPoints: (resizing?: boolean) => {
|
|
7
|
-
x: number[];
|
|
8
|
-
y: number[];
|
|
9
|
-
};
|
|
3
|
+
interface Commands {
|
|
4
|
+
snap: (axis: 'x' | 'y', position: number) => number;
|
|
10
5
|
}
|
|
11
6
|
}
|
|
12
7
|
}
|
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
namespace Mce {
|
|
3
|
-
|
|
3
|
+
interface TransformValue {
|
|
4
|
+
left: number;
|
|
5
|
+
top: number;
|
|
6
|
+
width: number;
|
|
7
|
+
height: number;
|
|
8
|
+
rotate: number;
|
|
9
|
+
borderRadius: number;
|
|
10
|
+
}
|
|
11
|
+
type TransformHandleDirection = 't' | 'l' | 'r' | 'b';
|
|
12
|
+
type TransformHandleCorner = 'tl' | 'tr' | 'bl' | 'br';
|
|
13
|
+
type TransformHandle = 'move' | `resize-${TransformHandleDirection | TransformHandleCorner}` | `rotate-${TransformHandleCorner}` | `round-${TransformHandleCorner}`;
|
|
14
|
+
type FlipType = 'horizontal' | 'vertical';
|
|
4
15
|
interface Commands {
|
|
5
16
|
enter: () => void;
|
|
6
|
-
|
|
17
|
+
getTransformValue: () => TransformValue;
|
|
18
|
+
transform: (handle: Mce.TransformHandle, value: Partial<TransformValue>) => void;
|
|
19
|
+
flip: (type: Mce.FlipType) => void;
|
|
7
20
|
flipHorizontal: () => void;
|
|
8
21
|
flipVertical: () => void;
|
|
9
22
|
}
|
package/dist/plugins/ui.d.ts
CHANGED
|
@@ -13,9 +13,6 @@ declare global {
|
|
|
13
13
|
}
|
|
14
14
|
interface Events {
|
|
15
15
|
pointerMove: [event: PointerEvent];
|
|
16
|
-
selectionTransformStart: [context: SelectionTransformContext];
|
|
17
|
-
selectionTransform: [context: SelectionTransformContext];
|
|
18
|
-
selectionTransformEnd: [context: SelectionTransformContext];
|
|
19
16
|
}
|
|
20
17
|
}
|
|
21
18
|
}
|
package/dist/typed-plugins.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.4",
|
|
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",
|
|
@@ -56,14 +56,14 @@
|
|
|
56
56
|
],
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@floating-ui/vue": "^1.1.10",
|
|
59
|
-
"@vueuse/components": "^14.
|
|
60
|
-
"@vueuse/core": "^14.
|
|
59
|
+
"@vueuse/components": "^14.2.0",
|
|
60
|
+
"@vueuse/core": "^14.2.0",
|
|
61
61
|
"diff": "^8.0.3",
|
|
62
62
|
"file-saver": "^2.0.5",
|
|
63
63
|
"lodash-es": "^4.17.23",
|
|
64
|
-
"modern-canvas": "^0.
|
|
64
|
+
"modern-canvas": "^0.15.3",
|
|
65
65
|
"modern-font": "^0.4.4",
|
|
66
|
-
"modern-idoc": "^0.10.
|
|
66
|
+
"modern-idoc": "^0.10.21",
|
|
67
67
|
"modern-text": "^1.10.15",
|
|
68
68
|
"yjs": "^13.6.29"
|
|
69
69
|
},
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"devDependencies": {
|
|
92
92
|
"@types/file-saver": "^2.0.7",
|
|
93
93
|
"@types/lodash-es": "^4.17.12",
|
|
94
|
-
"@vitejs/plugin-vue": "^6.0.
|
|
94
|
+
"@vitejs/plugin-vue": "^6.0.4",
|
|
95
95
|
"jiti": "^2.6.1",
|
|
96
96
|
"modern-gif": "^2.0.4",
|
|
97
97
|
"sass-embedded": "^1.97.3",
|
package/dist/crdt/YModel.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { ObservableEvents } from 'modern-idoc';
|
|
2
|
-
import type { Transaction } from 'yjs';
|
|
3
|
-
import { Observable } from 'modern-idoc';
|
|
4
|
-
import * as Y from 'yjs';
|
|
5
|
-
import { IndexeddbProvider } from '../indexeddb';
|
|
6
|
-
export interface YModelEvents extends ObservableEvents {
|
|
7
|
-
history: [arg0: Y.UndoManager];
|
|
8
|
-
update: [arg0: Uint8Array, arg1: any, arg2: Y.Doc, arg3: Transaction];
|
|
9
|
-
}
|
|
10
|
-
export interface YModel {
|
|
11
|
-
on: <K extends keyof YModelEvents & string>(event: K, listener: (...args: YModelEvents[K]) => void) => this;
|
|
12
|
-
once: <K extends keyof YModelEvents & string>(event: K, listener: (...args: YModelEvents[K]) => void) => this;
|
|
13
|
-
off: <K extends keyof YModelEvents & string>(event: K, listener: (...args: YModelEvents[K]) => void) => this;
|
|
14
|
-
emit: <K extends keyof YModelEvents & string>(event: K, ...args: YModelEvents[K]) => this;
|
|
15
|
-
}
|
|
16
|
-
export declare class YModel extends Observable {
|
|
17
|
-
id: string;
|
|
18
|
-
_transacting: boolean | undefined;
|
|
19
|
-
_yDoc: Y.Doc;
|
|
20
|
-
_yProps: Y.Map<unknown>;
|
|
21
|
-
indexeddb?: IndexeddbProvider;
|
|
22
|
-
undoManager: Y.UndoManager;
|
|
23
|
-
protected _ready: boolean;
|
|
24
|
-
constructor(id?: string);
|
|
25
|
-
protected _setupUndoManager(typeScope?: any[]): void;
|
|
26
|
-
loadIndexeddb(): Promise<void>;
|
|
27
|
-
transact<T>(fn: () => T, should?: boolean): T;
|
|
28
|
-
load(initFn?: () => void | Promise<void>): Promise<this>;
|
|
29
|
-
reset(): this;
|
|
30
|
-
}
|