mce 0.11.3 → 0.12.0
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 +1 -1
- package/dist/components/Layers.vue.d.ts +3 -0
- package/dist/components/Toolbelt.vue.d.ts +3 -0
- package/dist/components/shared/LayoutItem.vue.d.ts +8 -2
- package/dist/composables/icons.d.ts +5 -1
- package/dist/index.css +107 -6
- package/dist/index.d.ts +2 -0
- package/dist/index.js +714 -321
- package/dist/locale/en.d.ts +0 -1
- package/dist/mixins/0.config/base.d.ts +10 -0
- package/dist/mixins/2.box.d.ts +1 -1
- package/dist/mixins/scroll.d.ts +18 -0
- package/dist/mixins/zoom.d.ts +16 -0
- package/dist/{mixins/2.export → plugins}/json.d.ts +1 -1
- package/dist/plugins/scroll.d.ts +11 -0
- package/dist/plugins/ui.d.ts +1 -0
- package/dist/plugins/zoom.d.ts +1 -9
- package/dist/typed-plugins.d.ts +4 -2
- package/dist/utils/image.d.ts +0 -1
- package/package.json +2 -2
- package/dist/mixins/2.loader/json.d.ts +0 -2
package/dist/locale/en.d.ts
CHANGED
|
@@ -6,6 +6,12 @@ declare global {
|
|
|
6
6
|
type ViewMode = 'frame' | 'edgeless';
|
|
7
7
|
type TypographyStrategy = 'autoHeight' | 'autoWidth' | 'fixedWidthHeight' | 'autoFontSize';
|
|
8
8
|
type HandleShape = 'rect' | 'circle';
|
|
9
|
+
interface ScreenCenterOffset {
|
|
10
|
+
left?: number;
|
|
11
|
+
top?: number;
|
|
12
|
+
right?: number;
|
|
13
|
+
bottom?: number;
|
|
14
|
+
}
|
|
9
15
|
interface Config {
|
|
10
16
|
theme: Theme;
|
|
11
17
|
viewMode: ViewMode;
|
|
@@ -22,6 +28,10 @@ declare global {
|
|
|
22
28
|
typographyStrategy: TypographyStrategy;
|
|
23
29
|
handleShape: HandleShape;
|
|
24
30
|
localDb: boolean;
|
|
31
|
+
screenCenterOffset: ScreenCenterOffset;
|
|
32
|
+
}
|
|
33
|
+
interface Editor {
|
|
34
|
+
getScreenCenterOffset: () => Required<ScreenCenterOffset>;
|
|
25
35
|
}
|
|
26
36
|
}
|
|
27
37
|
}
|
package/dist/mixins/2.box.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ declare global {
|
|
|
12
12
|
getAabbInDrawboard: (node?: Node | Node[]) => AxisAlignedBoundingBox;
|
|
13
13
|
aabbToDrawboardAabb: (aabb: AxisAlignedBoundingBox) => AxisAlignedBoundingBox;
|
|
14
14
|
rootAabb: ComputedRef<AxisAlignedBoundingBox>;
|
|
15
|
-
|
|
15
|
+
selectionAabb: ComputedRef<AxisAlignedBoundingBox>;
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
type ScrollTarget = 'root' | 'selection' | {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
} | Element2D[];
|
|
8
|
+
interface ScrollToOptions {
|
|
9
|
+
duration?: number;
|
|
10
|
+
behavior?: 'smooth' | 'instant';
|
|
11
|
+
}
|
|
12
|
+
interface Editor {
|
|
13
|
+
scrollTo: (target: ScrollTarget, options?: ScrollToOptions) => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
declare const _default: import("..").Mixin;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Mce {
|
|
4
|
+
type ZoomTarget = 'root' | 'selection' | Element2D[] | number;
|
|
5
|
+
interface ZoomToOptions {
|
|
6
|
+
mode?: 'contain' | 'cover';
|
|
7
|
+
duration?: number;
|
|
8
|
+
behavior?: 'smooth' | 'instant';
|
|
9
|
+
}
|
|
10
|
+
interface Editor {
|
|
11
|
+
zoomTo: (target: ZoomTarget, options?: ZoomToOptions) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import("..").Mixin;
|
|
16
|
+
export default _default;
|
package/dist/plugins/ui.d.ts
CHANGED
package/dist/plugins/zoom.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare global {
|
|
|
6
6
|
zoomTo100: () => void;
|
|
7
7
|
zoomToFit: () => void;
|
|
8
8
|
zoomToCover: () => void;
|
|
9
|
-
zoomToSelection: () => void;
|
|
9
|
+
zoomToSelection: (options?: ZoomToOptions) => void;
|
|
10
10
|
}
|
|
11
11
|
interface Hotkeys {
|
|
12
12
|
zoomIn: [event: KeyboardEvent];
|
|
@@ -16,14 +16,6 @@ declare global {
|
|
|
16
16
|
zoomToCover: [event: KeyboardEvent];
|
|
17
17
|
zoomToSelection: [event: KeyboardEvent];
|
|
18
18
|
}
|
|
19
|
-
interface Config {
|
|
20
|
-
zoomToFitOffset: {
|
|
21
|
-
left?: number;
|
|
22
|
-
top?: number;
|
|
23
|
-
right?: number;
|
|
24
|
-
bottom?: number;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
19
|
interface Editor {
|
|
28
20
|
}
|
|
29
21
|
}
|
package/dist/typed-plugins.d.ts
CHANGED
|
@@ -15,16 +15,16 @@ import './mixins/1.timeline'
|
|
|
15
15
|
import './mixins/1.upload'
|
|
16
16
|
import './mixins/2.box'
|
|
17
17
|
import './mixins/2.export'
|
|
18
|
-
import './mixins/2.export/json'
|
|
19
18
|
import './mixins/2.load'
|
|
20
|
-
import './mixins/2.loader/json'
|
|
21
19
|
import './mixins/3.view'
|
|
22
20
|
import './mixins/4.0.text'
|
|
23
21
|
import './mixins/4.1.lock'
|
|
24
22
|
import './mixins/4.2.element'
|
|
25
23
|
import './mixins/4.3.frame'
|
|
26
24
|
import './mixins/4.4.doc'
|
|
25
|
+
import './mixins/scroll'
|
|
27
26
|
import './mixins/snapshot'
|
|
27
|
+
import './mixins/zoom'
|
|
28
28
|
import './plugins/auxiliary'
|
|
29
29
|
import './plugins/clipboard'
|
|
30
30
|
import './plugins/copyAs'
|
|
@@ -37,6 +37,7 @@ import './plugins/history'
|
|
|
37
37
|
import './plugins/html'
|
|
38
38
|
import './plugins/image'
|
|
39
39
|
import './plugins/import'
|
|
40
|
+
import './plugins/json'
|
|
40
41
|
import './plugins/layerOrder'
|
|
41
42
|
import './plugins/layerPosition'
|
|
42
43
|
import './plugins/lock'
|
|
@@ -45,6 +46,7 @@ import './plugins/move'
|
|
|
45
46
|
import './plugins/new'
|
|
46
47
|
import './plugins/open'
|
|
47
48
|
import './plugins/saveAs'
|
|
49
|
+
import './plugins/scroll'
|
|
48
50
|
import './plugins/select'
|
|
49
51
|
import './plugins/text'
|
|
50
52
|
import './plugins/ui'
|
package/dist/utils/image.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mce",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"description": "The headless canvas editor framework. only the ESM.",
|
|
6
6
|
"author": "wxm",
|
|
7
7
|
"license": "MIT",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"diff": "^8.0.2",
|
|
62
62
|
"file-saver": "^2.0.5",
|
|
63
63
|
"lodash-es": "^4.17.21",
|
|
64
|
-
"modern-canvas": "^0.
|
|
64
|
+
"modern-canvas": "^0.13.0",
|
|
65
65
|
"modern-font": "^0.4.4",
|
|
66
66
|
"modern-idoc": "^0.10.5",
|
|
67
67
|
"modern-text": "^1.10.3",
|