mce 0.16.7 → 0.17.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/dist/components/EditorLayout.vue.d.ts +2 -9
- package/dist/components/Frame.vue.d.ts +6 -2
- package/dist/components/Rulers.vue.d.ts +17 -4
- package/dist/components/Selection.vue.d.ts +97 -79
- package/dist/components/shared/{TransformControls.vue.d.ts → Transform.vue.d.ts} +21 -25
- package/dist/composables/strategy.d.ts +1 -2
- package/dist/editor.d.ts +10 -8
- package/dist/index.css +131 -91
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6474 -6196
- package/dist/locale/en.d.ts +12 -14
- package/dist/locale/zh-Hans.d.ts +12 -14
- package/dist/mixins/0.config/base.d.ts +41 -26
- package/dist/mixins/0.config.d.ts +3 -3
- package/dist/mixins/0.context.d.ts +2 -2
- package/dist/mixins/0.font.d.ts +0 -3
- package/dist/mixins/1.screen.d.ts +11 -2
- package/dist/mixins/snap.d.ts +27 -0
- package/dist/mixins/snapshot.d.ts +0 -3
- package/dist/mixins/tool.d.ts +25 -0
- package/dist/nodes/Doc.d.ts +2 -2
- package/dist/plugin.d.ts +3 -3
- package/dist/plugins/frame.d.ts +13 -1
- package/dist/plugins/image.d.ts +1 -1
- package/dist/plugins/layers.d.ts +2 -2
- package/dist/plugins/madeWith.d.ts +5 -2
- package/dist/plugins/menu.d.ts +3 -0
- package/dist/plugins/node.d.ts +6 -3
- package/dist/plugins/pen.d.ts +1 -1
- package/dist/plugins/ruler.d.ts +6 -9
- package/dist/plugins/scroll.d.ts +6 -3
- package/dist/plugins/selection.d.ts +4 -10
- package/dist/plugins/shape.d.ts +1 -1
- package/dist/plugins/smartGuides.d.ts +0 -7
- package/dist/plugins/state.d.ts +1 -1
- package/dist/plugins/statusbar.d.ts +4 -4
- package/dist/plugins/timeline.d.ts +4 -4
- package/dist/plugins/{drawingTool.d.ts → tool.d.ts} +1 -1
- package/dist/plugins/toolbelt.d.ts +5 -2
- package/dist/plugins/transform.d.ts +36 -4
- package/dist/plugins/typography.d.ts +41 -0
- package/dist/plugins/view.d.ts +16 -10
- package/dist/plugins/zoom.d.ts +10 -7
- package/dist/typed-global.d.ts +4 -1
- package/dist/typed-plugins.d.ts +4 -8
- package/dist/types/helper.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/dnd.d.ts +28 -7
- package/dist/utils/helper.d.ts +2 -0
- package/package.json +6 -6
- package/dist/mixins/4.1.text.d.ts +0 -21
- package/dist/mixins/drawingTool.d.ts +0 -25
- package/dist/plugins/move.d.ts +0 -20
- package/dist/plugins/panels.d.ts +0 -13
- package/dist/plugins/rotate.d.ts +0 -10
- package/dist/plugins/text.d.ts +0 -17
- package/dist/plugins/ui.d.ts +0 -20
- /package/dist/components/{NodeCreator.vue.d.ts → Creator.vue.d.ts} +0 -0
|
@@ -9,10 +9,7 @@ type __VLS_Slots = Slots & {
|
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
11
11
|
editor: typeof Editor;
|
|
12
|
-
resizeStrategy:
|
|
13
|
-
type: import("vue").PropType<import("../composables").ResizeStrategy>;
|
|
14
|
-
default: import("../composables").ResizeStrategy;
|
|
15
|
-
};
|
|
12
|
+
resizeStrategy: import("vue").PropType<import("../composables").ResizeStrategy>;
|
|
16
13
|
activeStrategy: {
|
|
17
14
|
type: import("vue").PropType<import("../composables").ActiveStrategy>;
|
|
18
15
|
default: import("../composables").ActiveStrategy;
|
|
@@ -27,10 +24,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
27
24
|
};
|
|
28
25
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
29
26
|
editor: typeof Editor;
|
|
30
|
-
resizeStrategy:
|
|
31
|
-
type: import("vue").PropType<import("../composables").ResizeStrategy>;
|
|
32
|
-
default: import("../composables").ResizeStrategy;
|
|
33
|
-
};
|
|
27
|
+
resizeStrategy: import("vue").PropType<import("../composables").ResizeStrategy>;
|
|
34
28
|
activeStrategy: {
|
|
35
29
|
type: import("vue").PropType<import("../composables").ActiveStrategy>;
|
|
36
30
|
default: import("../composables").ActiveStrategy;
|
|
@@ -44,7 +38,6 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
44
38
|
default: import("../composables").HoverStrategy;
|
|
45
39
|
};
|
|
46
40
|
}>> & Readonly<{}>, {
|
|
47
|
-
resizeStrategy: import("../composables").ResizeStrategy;
|
|
48
41
|
activeStrategy: import("../composables").ActiveStrategy;
|
|
49
42
|
doubleclickStrategy: import("../composables").DoubleclickStrategy;
|
|
50
43
|
hoverStrategy: import("../composables").HoverStrategy;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { Element2D } from 'modern-canvas';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
outline?: boolean;
|
|
4
|
+
};
|
|
2
5
|
type __VLS_ModelProps = {
|
|
3
6
|
modelValue: Element2D;
|
|
4
7
|
};
|
|
5
|
-
|
|
8
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
10
|
"update:modelValue": (value: Element2D) => any;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
11
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
8
12
|
"onUpdate:modelValue"?: ((value: Element2D) => any) | undefined;
|
|
9
13
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
10
14
|
declare const _default: typeof __VLS_export;
|
|
@@ -1,6 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
type __VLS_ModelProps = {
|
|
2
|
+
'refLines': {
|
|
3
|
+
x: number[];
|
|
4
|
+
y: number[];
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
"update:refLines": (value: {
|
|
9
|
+
x: number[];
|
|
10
|
+
y: number[];
|
|
11
|
+
}) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
|
|
13
|
+
"onUpdate:refLines"?: ((value: {
|
|
14
|
+
x: number[];
|
|
15
|
+
y: number[];
|
|
16
|
+
}) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
18
|
declare const _default: typeof __VLS_export;
|
|
6
19
|
export default _default;
|
|
@@ -13,10 +13,11 @@ type __VLS_Slots = {} & {
|
|
|
13
13
|
transform?: (props: typeof __VLS_25) => any;
|
|
14
14
|
};
|
|
15
15
|
declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
16
|
-
|
|
16
|
+
transform: Readonly<import("vue").ShallowRef<({
|
|
17
17
|
$: import("vue").ComponentInternalInstance;
|
|
18
18
|
$data: {};
|
|
19
19
|
$props: {
|
|
20
|
+
readonly ui?: boolean | undefined;
|
|
20
21
|
readonly tag?: string | any;
|
|
21
22
|
readonly color?: string | undefined;
|
|
22
23
|
readonly movable?: boolean | undefined;
|
|
@@ -25,22 +26,22 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
25
26
|
readonly resizable?: boolean | undefined;
|
|
26
27
|
readonly roundable?: boolean | undefined;
|
|
27
28
|
readonly threshold?: number | undefined;
|
|
28
|
-
readonly resizeStrategy?: "
|
|
29
|
-
readonly
|
|
29
|
+
readonly resizeStrategy?: "free" | "lockAspectRatio" | undefined;
|
|
30
|
+
readonly lockAspectRatioStrategy?: "all" | "diagonal" | undefined;
|
|
31
|
+
readonly handleStyle?: "8-points" | "4-points" | undefined;
|
|
30
32
|
readonly handleShape?: "rect" | "circle" | undefined;
|
|
31
|
-
readonly handles?: ("move" | "resize-
|
|
33
|
+
readonly handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[] | undefined;
|
|
32
34
|
readonly scale?: [number, number] | undefined;
|
|
33
35
|
readonly offset?: [number, number] | undefined;
|
|
34
|
-
readonly hideUi?: boolean | undefined;
|
|
35
36
|
readonly initialSize?: boolean | undefined;
|
|
36
37
|
readonly borderStyle?: "solid" | "dashed" | undefined;
|
|
37
38
|
readonly tip?: string | ((type: "size") => string) | undefined;
|
|
38
|
-
readonly modelValue?: Partial<
|
|
39
|
+
readonly modelValue?: Partial<Mce.TransformValue> | undefined;
|
|
39
40
|
readonly modelModifiers?: Partial<Record<string, true>> | undefined;
|
|
40
|
-
readonly onMove?: ((
|
|
41
|
-
readonly onStart?: ((
|
|
42
|
-
readonly onEnd?: ((
|
|
43
|
-
readonly "onUpdate:modelValue"?: ((value: Partial<
|
|
41
|
+
readonly onMove?: ((context: Mce.TransformContext) => any) | undefined;
|
|
42
|
+
readonly onStart?: ((context: Mce.TransformContext) => any) | undefined;
|
|
43
|
+
readonly onEnd?: ((context: Mce.TransformContext) => any) | undefined;
|
|
44
|
+
readonly "onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
|
|
44
45
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
45
46
|
$attrs: {
|
|
46
47
|
[x: string]: unknown;
|
|
@@ -54,9 +55,10 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
54
55
|
$root: import("vue").ComponentPublicInstance | null;
|
|
55
56
|
$parent: import("vue").ComponentPublicInstance | null;
|
|
56
57
|
$host: Element | null;
|
|
57
|
-
$emit: ((event: "move",
|
|
58
|
+
$emit: ((event: "move", context: Mce.TransformContext) => void) & ((event: "start", context: Mce.TransformContext) => void) & ((event: "end", context: Mce.TransformContext) => void) & ((event: "update:modelValue", value: Partial<Mce.TransformValue> | undefined) => void);
|
|
58
59
|
$el: any;
|
|
59
60
|
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
61
|
+
ui?: boolean;
|
|
60
62
|
tag?: string | any;
|
|
61
63
|
color?: string;
|
|
62
64
|
movable?: boolean;
|
|
@@ -65,43 +67,46 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
65
67
|
resizable?: boolean;
|
|
66
68
|
roundable?: boolean;
|
|
67
69
|
threshold?: number;
|
|
68
|
-
resizeStrategy?: "
|
|
69
|
-
|
|
70
|
+
resizeStrategy?: "free" | "lockAspectRatio";
|
|
71
|
+
lockAspectRatioStrategy?: "all" | "diagonal";
|
|
72
|
+
handleStyle?: "8-points" | "4-points";
|
|
70
73
|
handleShape?: "rect" | "circle";
|
|
71
|
-
handles?: ("move" | "resize-
|
|
74
|
+
handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
72
75
|
scale?: [number, number];
|
|
73
76
|
offset?: [number, number];
|
|
74
|
-
hideUi?: boolean;
|
|
75
77
|
initialSize?: boolean;
|
|
76
78
|
borderStyle?: "solid" | "dashed";
|
|
77
79
|
tip?: string | ((type: "size") => string);
|
|
78
80
|
} & {
|
|
79
|
-
modelValue?: Partial<
|
|
81
|
+
modelValue?: Partial<Mce.TransformValue>;
|
|
80
82
|
modelModifiers?: Partial<Record<string, true>>;
|
|
81
83
|
}> & Readonly<{
|
|
82
|
-
onMove?: ((
|
|
83
|
-
onStart?: ((
|
|
84
|
-
onEnd?: ((
|
|
85
|
-
"onUpdate:modelValue"?: ((value: Partial<
|
|
84
|
+
onMove?: ((context: Mce.TransformContext) => any) | undefined;
|
|
85
|
+
onStart?: ((context: Mce.TransformContext) => any) | undefined;
|
|
86
|
+
onEnd?: ((context: Mce.TransformContext) => any) | undefined;
|
|
87
|
+
"onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
|
|
86
88
|
}>, {
|
|
87
89
|
start: (event?: MouseEvent, index?: number) => boolean;
|
|
88
|
-
activeHandle: import("vue").Ref<("move" | "resize-
|
|
90
|
+
activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined, ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined>;
|
|
89
91
|
transforming: import("vue").Ref<boolean, boolean>;
|
|
90
92
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
91
|
-
move: (
|
|
92
|
-
start: (
|
|
93
|
-
end: (
|
|
94
|
-
"update:modelValue": (value: Partial<
|
|
93
|
+
move: (context: Mce.TransformContext) => any;
|
|
94
|
+
start: (context: Mce.TransformContext) => any;
|
|
95
|
+
end: (context: Mce.TransformContext) => any;
|
|
96
|
+
"update:modelValue": (value: Partial<Mce.TransformValue> | undefined) => any;
|
|
95
97
|
}, string, {
|
|
96
98
|
offset: [number, number];
|
|
97
99
|
scale: [number, number];
|
|
100
|
+
ui: boolean;
|
|
101
|
+
threshold: number;
|
|
98
102
|
movable: boolean;
|
|
99
103
|
rotatable: boolean;
|
|
100
104
|
resizable: boolean;
|
|
101
|
-
threshold: number;
|
|
102
105
|
tag: string | any;
|
|
106
|
+
resizeStrategy: "free" | "lockAspectRatio";
|
|
107
|
+
lockAspectRatioStrategy: "all" | "diagonal";
|
|
103
108
|
handleShape: "rect" | "circle";
|
|
104
|
-
handles: ("move" | "resize-
|
|
109
|
+
handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
105
110
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
106
111
|
beforeCreate?: (() => void) | (() => void)[];
|
|
107
112
|
created?: (() => void) | (() => void)[];
|
|
@@ -125,14 +130,18 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
125
130
|
} & Readonly<{
|
|
126
131
|
offset: [number, number];
|
|
127
132
|
scale: [number, number];
|
|
133
|
+
ui: boolean;
|
|
134
|
+
threshold: number;
|
|
128
135
|
movable: boolean;
|
|
129
136
|
rotatable: boolean;
|
|
130
137
|
resizable: boolean;
|
|
131
|
-
threshold: number;
|
|
132
138
|
tag: string | any;
|
|
139
|
+
resizeStrategy: "free" | "lockAspectRatio";
|
|
140
|
+
lockAspectRatioStrategy: "all" | "diagonal";
|
|
133
141
|
handleShape: "rect" | "circle";
|
|
134
|
-
handles: ("move" | "resize-
|
|
142
|
+
handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
135
143
|
}> & Omit<Readonly<{
|
|
144
|
+
ui?: boolean;
|
|
136
145
|
tag?: string | any;
|
|
137
146
|
color?: string;
|
|
138
147
|
movable?: boolean;
|
|
@@ -141,27 +150,27 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
141
150
|
resizable?: boolean;
|
|
142
151
|
roundable?: boolean;
|
|
143
152
|
threshold?: number;
|
|
144
|
-
resizeStrategy?: "
|
|
145
|
-
|
|
153
|
+
resizeStrategy?: "free" | "lockAspectRatio";
|
|
154
|
+
lockAspectRatioStrategy?: "all" | "diagonal";
|
|
155
|
+
handleStyle?: "8-points" | "4-points";
|
|
146
156
|
handleShape?: "rect" | "circle";
|
|
147
|
-
handles?: ("move" | "resize-
|
|
157
|
+
handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
148
158
|
scale?: [number, number];
|
|
149
159
|
offset?: [number, number];
|
|
150
|
-
hideUi?: boolean;
|
|
151
160
|
initialSize?: boolean;
|
|
152
161
|
borderStyle?: "solid" | "dashed";
|
|
153
162
|
tip?: string | ((type: "size") => string);
|
|
154
163
|
} & {
|
|
155
|
-
modelValue?: Partial<
|
|
164
|
+
modelValue?: Partial<Mce.TransformValue>;
|
|
156
165
|
modelModifiers?: Partial<Record<string, true>>;
|
|
157
166
|
}> & Readonly<{
|
|
158
|
-
onMove?: ((
|
|
159
|
-
onStart?: ((
|
|
160
|
-
onEnd?: ((
|
|
161
|
-
"onUpdate:modelValue"?: ((value: Partial<
|
|
162
|
-
}>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "movable" | "rotatable" | "resizable" | "
|
|
167
|
+
onMove?: ((context: Mce.TransformContext) => any) | undefined;
|
|
168
|
+
onStart?: ((context: Mce.TransformContext) => any) | undefined;
|
|
169
|
+
onEnd?: ((context: Mce.TransformContext) => any) | undefined;
|
|
170
|
+
"onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
|
|
171
|
+
}>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "ui" | "threshold" | "movable" | "rotatable" | "resizable" | "tag" | "resizeStrategy" | "lockAspectRatioStrategy" | "handleShape" | "handles")> & import("vue").ShallowUnwrapRef<{
|
|
163
172
|
start: (event?: MouseEvent, index?: number) => boolean;
|
|
164
|
-
activeHandle: import("vue").Ref<("move" | "resize-
|
|
173
|
+
activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined, ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined>;
|
|
165
174
|
transforming: import("vue").Ref<boolean, boolean>;
|
|
166
175
|
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
167
176
|
$slots: {
|
|
@@ -195,6 +204,7 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
195
204
|
$: import("vue").ComponentInternalInstance;
|
|
196
205
|
$data: {};
|
|
197
206
|
$props: {
|
|
207
|
+
readonly ui?: boolean | undefined;
|
|
198
208
|
readonly tag?: string | any;
|
|
199
209
|
readonly color?: string | undefined;
|
|
200
210
|
readonly movable?: boolean | undefined;
|
|
@@ -203,22 +213,22 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
203
213
|
readonly resizable?: boolean | undefined;
|
|
204
214
|
readonly roundable?: boolean | undefined;
|
|
205
215
|
readonly threshold?: number | undefined;
|
|
206
|
-
readonly resizeStrategy?: "
|
|
207
|
-
readonly
|
|
216
|
+
readonly resizeStrategy?: "free" | "lockAspectRatio" | undefined;
|
|
217
|
+
readonly lockAspectRatioStrategy?: "all" | "diagonal" | undefined;
|
|
218
|
+
readonly handleStyle?: "8-points" | "4-points" | undefined;
|
|
208
219
|
readonly handleShape?: "rect" | "circle" | undefined;
|
|
209
|
-
readonly handles?: ("move" | "resize-
|
|
220
|
+
readonly handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[] | undefined;
|
|
210
221
|
readonly scale?: [number, number] | undefined;
|
|
211
222
|
readonly offset?: [number, number] | undefined;
|
|
212
|
-
readonly hideUi?: boolean | undefined;
|
|
213
223
|
readonly initialSize?: boolean | undefined;
|
|
214
224
|
readonly borderStyle?: "solid" | "dashed" | undefined;
|
|
215
225
|
readonly tip?: string | ((type: "size") => string) | undefined;
|
|
216
|
-
readonly modelValue?: Partial<
|
|
226
|
+
readonly modelValue?: Partial<Mce.TransformValue> | undefined;
|
|
217
227
|
readonly modelModifiers?: Partial<Record<string, true>> | undefined;
|
|
218
|
-
readonly onMove?: ((
|
|
219
|
-
readonly onStart?: ((
|
|
220
|
-
readonly onEnd?: ((
|
|
221
|
-
readonly "onUpdate:modelValue"?: ((value: Partial<
|
|
228
|
+
readonly onMove?: ((context: Mce.TransformContext) => any) | undefined;
|
|
229
|
+
readonly onStart?: ((context: Mce.TransformContext) => any) | undefined;
|
|
230
|
+
readonly onEnd?: ((context: Mce.TransformContext) => any) | undefined;
|
|
231
|
+
readonly "onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
|
|
222
232
|
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps;
|
|
223
233
|
$attrs: {
|
|
224
234
|
[x: string]: unknown;
|
|
@@ -232,9 +242,10 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
232
242
|
$root: import("vue").ComponentPublicInstance | null;
|
|
233
243
|
$parent: import("vue").ComponentPublicInstance | null;
|
|
234
244
|
$host: Element | null;
|
|
235
|
-
$emit: ((event: "move",
|
|
245
|
+
$emit: ((event: "move", context: Mce.TransformContext) => void) & ((event: "start", context: Mce.TransformContext) => void) & ((event: "end", context: Mce.TransformContext) => void) & ((event: "update:modelValue", value: Partial<Mce.TransformValue> | undefined) => void);
|
|
236
246
|
$el: any;
|
|
237
247
|
$options: import("vue").ComponentOptionsBase<Readonly<{
|
|
248
|
+
ui?: boolean;
|
|
238
249
|
tag?: string | any;
|
|
239
250
|
color?: string;
|
|
240
251
|
movable?: boolean;
|
|
@@ -243,43 +254,46 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
243
254
|
resizable?: boolean;
|
|
244
255
|
roundable?: boolean;
|
|
245
256
|
threshold?: number;
|
|
246
|
-
resizeStrategy?: "
|
|
247
|
-
|
|
257
|
+
resizeStrategy?: "free" | "lockAspectRatio";
|
|
258
|
+
lockAspectRatioStrategy?: "all" | "diagonal";
|
|
259
|
+
handleStyle?: "8-points" | "4-points";
|
|
248
260
|
handleShape?: "rect" | "circle";
|
|
249
|
-
handles?: ("move" | "resize-
|
|
261
|
+
handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
250
262
|
scale?: [number, number];
|
|
251
263
|
offset?: [number, number];
|
|
252
|
-
hideUi?: boolean;
|
|
253
264
|
initialSize?: boolean;
|
|
254
265
|
borderStyle?: "solid" | "dashed";
|
|
255
266
|
tip?: string | ((type: "size") => string);
|
|
256
267
|
} & {
|
|
257
|
-
modelValue?: Partial<
|
|
268
|
+
modelValue?: Partial<Mce.TransformValue>;
|
|
258
269
|
modelModifiers?: Partial<Record<string, true>>;
|
|
259
270
|
}> & Readonly<{
|
|
260
|
-
onMove?: ((
|
|
261
|
-
onStart?: ((
|
|
262
|
-
onEnd?: ((
|
|
263
|
-
"onUpdate:modelValue"?: ((value: Partial<
|
|
271
|
+
onMove?: ((context: Mce.TransformContext) => any) | undefined;
|
|
272
|
+
onStart?: ((context: Mce.TransformContext) => any) | undefined;
|
|
273
|
+
onEnd?: ((context: Mce.TransformContext) => any) | undefined;
|
|
274
|
+
"onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
|
|
264
275
|
}>, {
|
|
265
276
|
start: (event?: MouseEvent, index?: number) => boolean;
|
|
266
|
-
activeHandle: import("vue").Ref<("move" | "resize-
|
|
277
|
+
activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined, ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined>;
|
|
267
278
|
transforming: import("vue").Ref<boolean, boolean>;
|
|
268
279
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
269
|
-
move: (
|
|
270
|
-
start: (
|
|
271
|
-
end: (
|
|
272
|
-
"update:modelValue": (value: Partial<
|
|
280
|
+
move: (context: Mce.TransformContext) => any;
|
|
281
|
+
start: (context: Mce.TransformContext) => any;
|
|
282
|
+
end: (context: Mce.TransformContext) => any;
|
|
283
|
+
"update:modelValue": (value: Partial<Mce.TransformValue> | undefined) => any;
|
|
273
284
|
}, string, {
|
|
274
285
|
offset: [number, number];
|
|
275
286
|
scale: [number, number];
|
|
287
|
+
ui: boolean;
|
|
288
|
+
threshold: number;
|
|
276
289
|
movable: boolean;
|
|
277
290
|
rotatable: boolean;
|
|
278
291
|
resizable: boolean;
|
|
279
|
-
threshold: number;
|
|
280
292
|
tag: string | any;
|
|
293
|
+
resizeStrategy: "free" | "lockAspectRatio";
|
|
294
|
+
lockAspectRatioStrategy: "all" | "diagonal";
|
|
281
295
|
handleShape: "rect" | "circle";
|
|
282
|
-
handles: ("move" | "resize-
|
|
296
|
+
handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
283
297
|
}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & {
|
|
284
298
|
beforeCreate?: (() => void) | (() => void)[];
|
|
285
299
|
created?: (() => void) | (() => void)[];
|
|
@@ -303,14 +317,18 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
303
317
|
} & Readonly<{
|
|
304
318
|
offset: [number, number];
|
|
305
319
|
scale: [number, number];
|
|
320
|
+
ui: boolean;
|
|
321
|
+
threshold: number;
|
|
306
322
|
movable: boolean;
|
|
307
323
|
rotatable: boolean;
|
|
308
324
|
resizable: boolean;
|
|
309
|
-
threshold: number;
|
|
310
325
|
tag: string | any;
|
|
326
|
+
resizeStrategy: "free" | "lockAspectRatio";
|
|
327
|
+
lockAspectRatioStrategy: "all" | "diagonal";
|
|
311
328
|
handleShape: "rect" | "circle";
|
|
312
|
-
handles: ("move" | "resize-
|
|
329
|
+
handles: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
313
330
|
}> & Omit<Readonly<{
|
|
331
|
+
ui?: boolean;
|
|
314
332
|
tag?: string | any;
|
|
315
333
|
color?: string;
|
|
316
334
|
movable?: boolean;
|
|
@@ -319,27 +337,27 @@ declare const __VLS_base: import("vue").DefineComponent<{}, {
|
|
|
319
337
|
resizable?: boolean;
|
|
320
338
|
roundable?: boolean;
|
|
321
339
|
threshold?: number;
|
|
322
|
-
resizeStrategy?: "
|
|
323
|
-
|
|
340
|
+
resizeStrategy?: "free" | "lockAspectRatio";
|
|
341
|
+
lockAspectRatioStrategy?: "all" | "diagonal";
|
|
342
|
+
handleStyle?: "8-points" | "4-points";
|
|
324
343
|
handleShape?: "rect" | "circle";
|
|
325
|
-
handles?: ("move" | "resize-
|
|
344
|
+
handles?: ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br")[];
|
|
326
345
|
scale?: [number, number];
|
|
327
346
|
offset?: [number, number];
|
|
328
|
-
hideUi?: boolean;
|
|
329
347
|
initialSize?: boolean;
|
|
330
348
|
borderStyle?: "solid" | "dashed";
|
|
331
349
|
tip?: string | ((type: "size") => string);
|
|
332
350
|
} & {
|
|
333
|
-
modelValue?: Partial<
|
|
351
|
+
modelValue?: Partial<Mce.TransformValue>;
|
|
334
352
|
modelModifiers?: Partial<Record<string, true>>;
|
|
335
353
|
}> & Readonly<{
|
|
336
|
-
onMove?: ((
|
|
337
|
-
onStart?: ((
|
|
338
|
-
onEnd?: ((
|
|
339
|
-
"onUpdate:modelValue"?: ((value: Partial<
|
|
340
|
-
}>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "movable" | "rotatable" | "resizable" | "
|
|
354
|
+
onMove?: ((context: Mce.TransformContext) => any) | undefined;
|
|
355
|
+
onStart?: ((context: Mce.TransformContext) => any) | undefined;
|
|
356
|
+
onEnd?: ((context: Mce.TransformContext) => any) | undefined;
|
|
357
|
+
"onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
|
|
358
|
+
}>, "transforming" | "start" | "activeHandle" | ("offset" | "scale" | "ui" | "threshold" | "movable" | "rotatable" | "resizable" | "tag" | "resizeStrategy" | "lockAspectRatioStrategy" | "handleShape" | "handles")> & import("vue").ShallowUnwrapRef<{
|
|
341
359
|
start: (event?: MouseEvent, index?: number) => boolean;
|
|
342
|
-
activeHandle: import("vue").Ref<("move" | "resize-
|
|
360
|
+
activeHandle: import("vue").Ref<("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined, ("move" | "resize-b" | "resize-r" | "resize-l" | "resize-t" | "resize-tl" | "resize-tr" | "resize-bl" | "resize-br" | "rotate-tl" | "rotate-tr" | "rotate-bl" | "rotate-br" | "round-tl" | "round-tr" | "round-bl" | "round-br") | undefined>;
|
|
343
361
|
transforming: import("vue").Ref<boolean, boolean>;
|
|
344
362
|
}> & {} & import("vue").ComponentCustomProperties & {} & {
|
|
345
363
|
$slots: {
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
export interface TransformValue {
|
|
2
|
-
left: number;
|
|
3
|
-
top: number;
|
|
4
|
-
width: number;
|
|
5
|
-
height: number;
|
|
6
|
-
rotate: number;
|
|
7
|
-
borderRadius: number;
|
|
8
|
-
}
|
|
9
1
|
type Handle = 'move' | 'resize-t' | 'resize-r' | 'resize-b' | 'resize-l' | 'resize-tl' | 'resize-tr' | 'resize-bl' | 'resize-br' | 'rotate-tl' | 'rotate-tr' | 'rotate-bl' | 'rotate-br' | 'round-tl' | 'round-tr' | 'round-bl' | 'round-br';
|
|
10
2
|
type __VLS_Props = {
|
|
3
|
+
ui?: boolean;
|
|
11
4
|
tag?: string | any;
|
|
12
5
|
color?: string;
|
|
13
6
|
movable?: boolean;
|
|
@@ -16,20 +9,20 @@ type __VLS_Props = {
|
|
|
16
9
|
resizable?: boolean;
|
|
17
10
|
roundable?: boolean;
|
|
18
11
|
threshold?: number;
|
|
19
|
-
resizeStrategy?: '
|
|
20
|
-
|
|
12
|
+
resizeStrategy?: 'free' | 'lockAspectRatio';
|
|
13
|
+
lockAspectRatioStrategy?: 'all' | 'diagonal';
|
|
14
|
+
handleStyle?: '8-points' | '4-points';
|
|
21
15
|
handleShape?: 'rect' | 'circle';
|
|
22
16
|
handles?: Handle[];
|
|
23
17
|
scale?: [number, number];
|
|
24
18
|
offset?: [number, number];
|
|
25
|
-
hideUi?: boolean;
|
|
26
19
|
initialSize?: boolean;
|
|
27
20
|
borderStyle?: 'solid' | 'dashed';
|
|
28
21
|
tip?: string | ((type: 'size') => string);
|
|
29
22
|
};
|
|
30
|
-
declare function
|
|
23
|
+
declare function onPointerDown(event?: MouseEvent, index?: number): boolean;
|
|
31
24
|
type __VLS_ModelProps = {
|
|
32
|
-
modelValue?: Partial<TransformValue>;
|
|
25
|
+
modelValue?: Partial<Mce.TransformValue>;
|
|
33
26
|
'modelModifiers'?: Partial<Record<string, true>>;
|
|
34
27
|
};
|
|
35
28
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
@@ -43,9 +36,9 @@ declare var __VLS_8: {
|
|
|
43
36
|
borderRadius: number;
|
|
44
37
|
};
|
|
45
38
|
props: {
|
|
46
|
-
onPointerdown: typeof
|
|
39
|
+
onPointerdown: typeof onPointerDown;
|
|
47
40
|
};
|
|
48
|
-
start: typeof
|
|
41
|
+
start: typeof onPointerDown;
|
|
49
42
|
}, __VLS_15: {
|
|
50
43
|
box: {
|
|
51
44
|
left: number;
|
|
@@ -62,27 +55,30 @@ type __VLS_Slots = {} & {
|
|
|
62
55
|
svg?: (props: typeof __VLS_15) => any;
|
|
63
56
|
};
|
|
64
57
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
65
|
-
start: typeof
|
|
58
|
+
start: typeof onPointerDown;
|
|
66
59
|
activeHandle: import("vue").Ref<Handle | undefined, Handle | undefined>;
|
|
67
60
|
transforming: import("vue").Ref<boolean, boolean>;
|
|
68
61
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
69
|
-
move: (
|
|
70
|
-
start: (
|
|
71
|
-
end: (
|
|
72
|
-
"update:modelValue": (value: Partial<TransformValue> | undefined) => any;
|
|
62
|
+
move: (context: Mce.TransformContext) => any;
|
|
63
|
+
start: (context: Mce.TransformContext) => any;
|
|
64
|
+
end: (context: Mce.TransformContext) => any;
|
|
65
|
+
"update:modelValue": (value: Partial<Mce.TransformValue> | undefined) => any;
|
|
73
66
|
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
74
|
-
onMove?: ((
|
|
75
|
-
onStart?: ((
|
|
76
|
-
onEnd?: ((
|
|
77
|
-
"onUpdate:modelValue"?: ((value: Partial<TransformValue> | undefined) => any) | undefined;
|
|
67
|
+
onMove?: ((context: Mce.TransformContext) => any) | undefined;
|
|
68
|
+
onStart?: ((context: Mce.TransformContext) => any) | undefined;
|
|
69
|
+
onEnd?: ((context: Mce.TransformContext) => any) | undefined;
|
|
70
|
+
"onUpdate:modelValue"?: ((value: Partial<Mce.TransformValue> | undefined) => any) | undefined;
|
|
78
71
|
}>, {
|
|
79
72
|
offset: [number, number];
|
|
80
73
|
scale: [number, number];
|
|
74
|
+
ui: boolean;
|
|
75
|
+
threshold: number;
|
|
81
76
|
movable: boolean;
|
|
82
77
|
rotatable: boolean;
|
|
83
78
|
resizable: boolean;
|
|
84
|
-
threshold: number;
|
|
85
79
|
tag: string | any;
|
|
80
|
+
resizeStrategy: "free" | "lockAspectRatio";
|
|
81
|
+
lockAspectRatioStrategy: "all" | "diagonal";
|
|
86
82
|
handleShape: "rect" | "circle";
|
|
87
83
|
handles: Handle[];
|
|
88
84
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -12,7 +12,7 @@ export interface DoubleclickStrategyContext {
|
|
|
12
12
|
}
|
|
13
13
|
export interface HoverStrategyContext extends ActiveStrategyContext {
|
|
14
14
|
}
|
|
15
|
-
export type ResizeStrategy = (element: Element2D) => 'lockAspectRatio' |
|
|
15
|
+
export type ResizeStrategy = (element: Element2D) => 'lockAspectRatio' | undefined;
|
|
16
16
|
export type ActiveStrategy = (context: ActiveStrategyContext) => {
|
|
17
17
|
element: Element2D | undefined;
|
|
18
18
|
state: Mce.State | undefined;
|
|
@@ -45,7 +45,6 @@ export declare const makeMceStrategyProps: <Defaults extends {
|
|
|
45
45
|
default: unknown extends Defaults["hoverStrategy"] ? HoverStrategy : HoverStrategy | Defaults["hoverStrategy"];
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
|
-
export declare const defaultResizeStrategy: ResizeStrategy;
|
|
49
48
|
export declare const defaultActiveStrategy: ActiveStrategy;
|
|
50
49
|
export declare const defaultDoubleclickStrategy: DoubleclickStrategy;
|
|
51
50
|
export declare const defaultHoverStrategy: HoverStrategy;
|
package/dist/editor.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { EffectScope } from '@vue/reactivity';
|
|
2
|
-
import type { RemovableRef } from '@vueuse/core';
|
|
3
2
|
import type { ObservableEvents } from 'modern-idoc';
|
|
4
|
-
import type { App, ComponentPublicInstance, InjectionKey } from 'vue';
|
|
3
|
+
import type { App, ComponentPublicInstance, InjectionKey, Ref } from 'vue';
|
|
5
4
|
import type { Mixin } from './mixin';
|
|
6
|
-
import type { Plugin, PluginComponent
|
|
5
|
+
import type { Plugin, PluginComponent } from './plugin';
|
|
7
6
|
import { Observable } from 'modern-idoc';
|
|
8
7
|
export interface Options extends Mce.Options {
|
|
9
8
|
debug?: boolean;
|
|
@@ -17,18 +16,20 @@ export interface Events extends Mce.Events, ObservableEvents {
|
|
|
17
16
|
export interface Slots extends Mce.Slots {
|
|
18
17
|
}
|
|
19
18
|
export type EditorComponent = PluginComponent & {
|
|
19
|
+
visible: Ref<boolean>;
|
|
20
20
|
plugin: string;
|
|
21
21
|
indexInPlugin: number;
|
|
22
22
|
};
|
|
23
23
|
export declare class Editor extends Observable<Events> {
|
|
24
24
|
static injectionKey: InjectionKey<Editor>;
|
|
25
|
-
debug:
|
|
26
|
-
config:
|
|
25
|
+
debug: Ref<boolean, boolean>;
|
|
26
|
+
config: Ref<Mce.Config>;
|
|
27
27
|
onEmit?: <K extends keyof Events & string>(event: K, ...args: Events[K]) => void;
|
|
28
|
-
plugins: Record<string, PluginObject>;
|
|
29
28
|
protected _pluginComponentTypes: string[];
|
|
30
|
-
components: import("vue").
|
|
31
|
-
|
|
29
|
+
components: import("vue").ShallowRef<EditorComponent[], EditorComponent[]>;
|
|
30
|
+
sortedComponents: import("vue").ComputedRef<EditorComponent[]>;
|
|
31
|
+
componentRefs: Record<string, (HTMLElement | ComponentPublicInstance | null)[]>;
|
|
32
|
+
setups: (() => void | Promise<void>)[];
|
|
32
33
|
protected _setups: (() => void | Promise<void>)[];
|
|
33
34
|
constructor(options?: Options);
|
|
34
35
|
protected _setupObservable(): void;
|
|
@@ -37,6 +38,7 @@ export declare class Editor extends Observable<Events> {
|
|
|
37
38
|
protected _setupOptions(options: Options): void;
|
|
38
39
|
mixin(mixin: Mixin | Mixin[], options?: Options): void;
|
|
39
40
|
use(plugin: Plugin | Plugin[], options: Options): void;
|
|
41
|
+
registerComponent(name: string, components: PluginComponent[]): void;
|
|
40
42
|
protected _effectScope?: EffectScope;
|
|
41
43
|
setup: () => Promise<void>;
|
|
42
44
|
install: (app: App) => void;
|