mce 0.1.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/LICENSE +21 -0
- package/README.md +126 -0
- package/dist/components/Auxiliary.vue.d.ts +3 -0
- package/dist/components/Bottombar.vue.d.ts +13 -0
- package/dist/components/ContextMenu.vue.d.ts +25 -0
- package/dist/components/Drawboard.vue.d.ts +58 -0
- package/dist/components/Drawing.vue.d.ts +3 -0
- package/dist/components/Floatbar.vue.d.ts +54 -0
- package/dist/components/Frame.vue.d.ts +11 -0
- package/dist/components/Frames.vue.d.ts +3 -0
- package/dist/components/GoBackSelectedArea.vue.d.ts +3 -0
- package/dist/components/Hover.vue.d.ts +3 -0
- package/dist/components/Rulers.vue.d.ts +8 -0
- package/dist/components/Scrollbars.vue.d.ts +12 -0
- package/dist/components/Selector.vue.d.ts +197 -0
- package/dist/components/Starter.vue.d.ts +3 -0
- package/dist/components/Statusbar.vue.d.ts +3 -0
- package/dist/components/TextEditor.vue.d.ts +6 -0
- package/dist/components/shared/Dialog.vue.d.ts +58 -0
- package/dist/components/shared/Menu.vue.d.ts +71 -0
- package/dist/components/shared/Overlay.vue.d.ts +64 -0
- package/dist/components/shared/Ruler.vue.d.ts +17 -0
- package/dist/components/shared/Scrollbar.vue.d.ts +21 -0
- package/dist/components/shared/Tooltip.vue.d.ts +71 -0
- package/dist/components/shared/Transformable.vue.d.ts +79 -0
- package/dist/composables/editor.d.ts +3 -0
- package/dist/composables/index.d.ts +4 -0
- package/dist/composables/menu.d.ts +7 -0
- package/dist/composables/overlay.d.ts +60 -0
- package/dist/composables/strategy.d.ts +40 -0
- package/dist/editor.d.ts +29 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +5815 -0
- package/dist/indexeddb/IndexeddbProvider.d.ts +31 -0
- package/dist/indexeddb/index.d.ts +1 -0
- package/dist/indexeddb/indexeddb.d.ts +23 -0
- package/dist/models/Doc.d.ts +57 -0
- package/dist/models/Model.d.ts +32 -0
- package/dist/models/Workspace.d.ts +17 -0
- package/dist/models/index.d.ts +3 -0
- package/dist/plugins/0.command.d.ts +27 -0
- package/dist/plugins/0.config/base.d.ts +30 -0
- package/dist/plugins/0.config.d.ts +16 -0
- package/dist/plugins/0.context.d.ts +32 -0
- package/dist/plugins/0.element.d.ts +14 -0
- package/dist/plugins/0.font.d.ts +18 -0
- package/dist/plugins/0.i18n.d.ts +13 -0
- package/dist/plugins/1.frame.d.ts +24 -0
- package/dist/plugins/1.hotkey.d.ts +39 -0
- package/dist/plugins/1.upload.d.ts +13 -0
- package/dist/plugins/2.box.d.ts +20 -0
- package/dist/plugins/2.exporter/0.json.d.ts +10 -0
- package/dist/plugins/2.exporter/image.d.ts +11 -0
- package/dist/plugins/2.exporter/pdf.d.ts +9 -0
- package/dist/plugins/2.exporter/pptx.d.ts +9 -0
- package/dist/plugins/2.exporter/video.d.ts +10 -0
- package/dist/plugins/2.exporter.d.ts +27 -0
- package/dist/plugins/2.loader/0.url.d.ts +2 -0
- package/dist/plugins/2.loader/image.d.ts +2 -0
- package/dist/plugins/2.loader/json.d.ts +2 -0
- package/dist/plugins/2.loader/pptx.d.ts +2 -0
- package/dist/plugins/2.loader/txt.d.ts +2 -0
- package/dist/plugins/2.loader.d.ts +23 -0
- package/dist/plugins/3.view.d.ts +12 -0
- package/dist/plugins/4.0.text.d.ts +11 -0
- package/dist/plugins/4.1.lock.d.ts +20 -0
- package/dist/plugins/4.2.element.d.ts +45 -0
- package/dist/plugins/4.3.frame.d.ts +21 -0
- package/dist/plugins/4.4.doc.d.ts +23 -0
- package/dist/plugins/align.d.ts +16 -0
- package/dist/plugins/arrange.d.ts +19 -0
- package/dist/plugins/auxiliary.d.ts +14 -0
- package/dist/plugins/clipboard.d.ts +22 -0
- package/dist/plugins/flip.d.ts +10 -0
- package/dist/plugins/frame.d.ts +14 -0
- package/dist/plugins/group.d.ts +14 -0
- package/dist/plugins/history.d.ts +21 -0
- package/dist/plugins/import.d.ts +15 -0
- package/dist/plugins/insert/image.d.ts +13 -0
- package/dist/plugins/insert/text.d.ts +14 -0
- package/dist/plugins/menu.d.ts +12 -0
- package/dist/plugins/move.d.ts +20 -0
- package/dist/plugins/new.d.ts +12 -0
- package/dist/plugins/open.d.ts +12 -0
- package/dist/plugins/preference.d.ts +16 -0
- package/dist/plugins/saveAs.d.ts +15 -0
- package/dist/plugins/select.d.ts +20 -0
- package/dist/plugins/snapshot.d.ts +17 -0
- package/dist/plugins/theme.d.ts +8 -0
- package/dist/plugins/ui.d.ts +16 -0
- package/dist/plugins/visibility.d.ts +14 -0
- package/dist/plugins/zoom.d.ts +32 -0
- package/dist/preset-plugins.d.ts +1 -0
- package/dist/sw.d.ts +1 -0
- package/dist/typed-global.d.ts +26 -0
- package/dist/typed-plugins.d.ts +58 -0
- package/dist/types/box.d.ts +9 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/utils/BSTree/BSTree.d.ts +18 -0
- package/dist/utils/BSTree/BSTreeKV.d.ts +210 -0
- package/dist/utils/BSTree/LinkedList.d.ts +179 -0
- package/dist/utils/BSTree/Queue.d.ts +81 -0
- package/dist/utils/BSTree/index.d.ts +1 -0
- package/dist/utils/BSTree/utils.d.ts +47 -0
- package/dist/utils/box.d.ts +7 -0
- package/dist/utils/constants.d.ts +4 -0
- package/dist/utils/create.d.ts +3 -0
- package/dist/utils/helper.d.ts +1 -0
- package/dist/utils/image.d.ts +26 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/propsFactory.d.ts +57 -0
- package/dist/utils/random.d.ts +3 -0
- package/package.json +147 -0
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { PropType } from 'vue';
|
|
2
|
+
type __VLS_Slots = {
|
|
3
|
+
title?: (props: {
|
|
4
|
+
item: MenuItem;
|
|
5
|
+
}) => any;
|
|
6
|
+
activator?: (props: any) => any;
|
|
7
|
+
};
|
|
8
|
+
export interface MenuItem {
|
|
9
|
+
key: string;
|
|
10
|
+
handle?: (event: MouseEvent) => void;
|
|
11
|
+
type?: 'divider';
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
children?: MenuItem[];
|
|
14
|
+
}
|
|
15
|
+
declare function updateLocation(): void;
|
|
16
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
items: PropType<MenuItem[]>;
|
|
18
|
+
openOnHover: BooleanConstructor;
|
|
19
|
+
persistent: BooleanConstructor;
|
|
20
|
+
location: PropType<import("@floating-ui/vue").Side | import("@floating-ui/vue").AlignedPlacement>;
|
|
21
|
+
offset: NumberConstructor;
|
|
22
|
+
target: PropType<{
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
} | import("@floating-ui/vue").ReferenceElement>;
|
|
26
|
+
attach: {
|
|
27
|
+
type: PropType<string | boolean | Element | null | undefined>;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: PropType<boolean>;
|
|
32
|
+
};
|
|
33
|
+
}>, {
|
|
34
|
+
isActive: import("vue").ModelRef<boolean | undefined, string, boolean | undefined, boolean | undefined>;
|
|
35
|
+
updateLocation: typeof updateLocation;
|
|
36
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
37
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
38
|
+
"click:item": (item: MenuItem, event: MouseEvent) => any;
|
|
39
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
40
|
+
items: PropType<MenuItem[]>;
|
|
41
|
+
openOnHover: BooleanConstructor;
|
|
42
|
+
persistent: BooleanConstructor;
|
|
43
|
+
location: PropType<import("@floating-ui/vue").Side | import("@floating-ui/vue").AlignedPlacement>;
|
|
44
|
+
offset: NumberConstructor;
|
|
45
|
+
target: PropType<{
|
|
46
|
+
x: number;
|
|
47
|
+
y: number;
|
|
48
|
+
} | import("@floating-ui/vue").ReferenceElement>;
|
|
49
|
+
attach: {
|
|
50
|
+
type: PropType<string | boolean | Element | null | undefined>;
|
|
51
|
+
default: undefined;
|
|
52
|
+
};
|
|
53
|
+
modelValue: {
|
|
54
|
+
type: PropType<boolean>;
|
|
55
|
+
};
|
|
56
|
+
}>> & Readonly<{
|
|
57
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
58
|
+
"onClick:item"?: ((item: MenuItem, event: MouseEvent) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
attach: string | boolean | Element | null | undefined;
|
|
61
|
+
openOnHover: boolean;
|
|
62
|
+
persistent: boolean;
|
|
63
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
65
|
+
declare const _default: typeof __VLS_export;
|
|
66
|
+
export default _default;
|
|
67
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
declare var __VLS_1: {
|
|
2
|
+
props: {
|
|
3
|
+
ref: (el: any) => any;
|
|
4
|
+
};
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
}, __VLS_8: {};
|
|
7
|
+
type __VLS_Slots = {} & {
|
|
8
|
+
activator?: (props: typeof __VLS_1) => any;
|
|
9
|
+
} & {
|
|
10
|
+
default?: (props: typeof __VLS_8) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
location: import("vue").PropType<import("@floating-ui/vue").Side | import("@floating-ui/vue").AlignedPlacement>;
|
|
14
|
+
offset: NumberConstructor;
|
|
15
|
+
target: import("vue").PropType<{
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
} | import("@floating-ui/vue").ReferenceElement>;
|
|
19
|
+
attach: {
|
|
20
|
+
type: import("vue").PropType<string | boolean | Element | null | undefined>;
|
|
21
|
+
default: undefined;
|
|
22
|
+
};
|
|
23
|
+
modelValue: {
|
|
24
|
+
type: BooleanConstructor;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
}>, {
|
|
28
|
+
activatorEl: import("vue").Ref<any, any>;
|
|
29
|
+
target: import("vue").ComputedRef<any>;
|
|
30
|
+
contentEl: Readonly<import("vue").ShallowRef<HTMLDivElement | null>>;
|
|
31
|
+
updateLocation: () => void;
|
|
32
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"click:outside": (event: MouseEvent) => any;
|
|
34
|
+
"update:modelValue": (val: boolean) => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
location: import("vue").PropType<import("@floating-ui/vue").Side | import("@floating-ui/vue").AlignedPlacement>;
|
|
37
|
+
offset: NumberConstructor;
|
|
38
|
+
target: import("vue").PropType<{
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
} | import("@floating-ui/vue").ReferenceElement>;
|
|
42
|
+
attach: {
|
|
43
|
+
type: import("vue").PropType<string | boolean | Element | null | undefined>;
|
|
44
|
+
default: undefined;
|
|
45
|
+
};
|
|
46
|
+
modelValue: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
}>> & Readonly<{
|
|
51
|
+
"onClick:outside"?: ((event: MouseEvent) => any) | undefined;
|
|
52
|
+
"onUpdate:modelValue"?: ((val: boolean) => any) | undefined;
|
|
53
|
+
}>, {
|
|
54
|
+
attach: string | boolean | Element | null | undefined;
|
|
55
|
+
modelValue: boolean;
|
|
56
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
57
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
58
|
+
declare const _default: typeof __VLS_export;
|
|
59
|
+
export default _default;
|
|
60
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
61
|
+
new (): {
|
|
62
|
+
$slots: S;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AxisAlignedBoundingBox } from '../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
size?: number;
|
|
4
|
+
vertical?: boolean;
|
|
5
|
+
zoom?: number;
|
|
6
|
+
offset?: number;
|
|
7
|
+
aabb?: AxisAlignedBoundingBox;
|
|
8
|
+
pixelRatio?: number;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
11
|
+
size: number;
|
|
12
|
+
pixelRatio: number;
|
|
13
|
+
zoom: number;
|
|
14
|
+
offset: number;
|
|
15
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
zoom: number;
|
|
3
|
+
length: number;
|
|
4
|
+
vertical?: boolean;
|
|
5
|
+
infinite?: boolean;
|
|
6
|
+
size: number;
|
|
7
|
+
offset: number;
|
|
8
|
+
};
|
|
9
|
+
type __VLS_ModelProps = {
|
|
10
|
+
modelValue: number;
|
|
11
|
+
};
|
|
12
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
14
|
+
scroll: (offset: number) => any;
|
|
15
|
+
"update:modelValue": (value: number) => any;
|
|
16
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
17
|
+
onScroll?: ((offset: number) => any) | undefined;
|
|
18
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
declare function updateLocation(): void;
|
|
2
|
+
declare var __VLS_8: {
|
|
3
|
+
props: {
|
|
4
|
+
ref: (el: any) => any;
|
|
5
|
+
};
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
}, __VLS_10: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
activator?: (props: typeof __VLS_8) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: typeof __VLS_10) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
14
|
+
location: {
|
|
15
|
+
type: import("vue").PropType<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
|
|
16
|
+
default: NonNullable<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
|
|
17
|
+
};
|
|
18
|
+
offset: {
|
|
19
|
+
type: import("vue").PropType<number>;
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
target: import("vue").PropType<{
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
} | import("@floating-ui/vue").ReferenceElement>;
|
|
26
|
+
attach: {
|
|
27
|
+
type: import("vue").PropType<string | boolean | Element | null | undefined>;
|
|
28
|
+
default: undefined;
|
|
29
|
+
};
|
|
30
|
+
modelValue: {
|
|
31
|
+
type: import("vue").PropType<boolean>;
|
|
32
|
+
};
|
|
33
|
+
}>, {
|
|
34
|
+
updateLocation: typeof updateLocation;
|
|
35
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
37
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
location: {
|
|
39
|
+
type: import("vue").PropType<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
|
|
40
|
+
default: NonNullable<import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start">;
|
|
41
|
+
};
|
|
42
|
+
offset: {
|
|
43
|
+
type: import("vue").PropType<number>;
|
|
44
|
+
default: number;
|
|
45
|
+
};
|
|
46
|
+
target: import("vue").PropType<{
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
} | import("@floating-ui/vue").ReferenceElement>;
|
|
50
|
+
attach: {
|
|
51
|
+
type: import("vue").PropType<string | boolean | Element | null | undefined>;
|
|
52
|
+
default: undefined;
|
|
53
|
+
};
|
|
54
|
+
modelValue: {
|
|
55
|
+
type: import("vue").PropType<boolean>;
|
|
56
|
+
};
|
|
57
|
+
}>> & Readonly<{
|
|
58
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
location: import("@floating-ui/vue").Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start";
|
|
61
|
+
attach: string | boolean | Element | null | undefined;
|
|
62
|
+
offset: number;
|
|
63
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
65
|
+
declare const _default: typeof __VLS_export;
|
|
66
|
+
export default _default;
|
|
67
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
68
|
+
new (): {
|
|
69
|
+
$slots: S;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { OrientedBoundingBox } from '../../types';
|
|
2
|
+
type Handle = 'move' | 'rotate-top-left' | 'rotate-top-right' | 'rotate-bottom-left' | 'rotate-bottom-right' | 'resize-top' | 'resize-right' | 'resize-bottom' | 'resize-left' | 'resize-top-left' | 'resize-top-right' | 'resize-bottom-left' | 'resize-bottom-right';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
tag?: string | any;
|
|
5
|
+
modelValue?: Partial<OrientedBoundingBox>;
|
|
6
|
+
moveable?: boolean;
|
|
7
|
+
rotatable?: boolean;
|
|
8
|
+
resizable?: boolean;
|
|
9
|
+
threshold?: number;
|
|
10
|
+
resizeStrategy?: 'free' | 'aspectRatio' | 'diagonalAspectRatio';
|
|
11
|
+
handleStrategy?: 'default' | 'point';
|
|
12
|
+
handleShape?: 'rect' | 'circle';
|
|
13
|
+
color?: string;
|
|
14
|
+
handleColor?: string;
|
|
15
|
+
visibility?: 'visible' | 'none' | 'auto';
|
|
16
|
+
handles?: Handle[];
|
|
17
|
+
initialSize?: boolean;
|
|
18
|
+
borderStyle?: 'solid' | 'dashed';
|
|
19
|
+
getTipText?: (type: 'rotate' | 'resize') => string;
|
|
20
|
+
};
|
|
21
|
+
declare function start(event?: MouseEvent, index?: number): boolean;
|
|
22
|
+
declare var __VLS_7: {
|
|
23
|
+
value: Partial<OrientedBoundingBox> | undefined;
|
|
24
|
+
moveProps: {
|
|
25
|
+
onPointerdown: typeof start;
|
|
26
|
+
style: {
|
|
27
|
+
cursor: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
start: typeof start;
|
|
31
|
+
}, __VLS_9: {
|
|
32
|
+
box: {
|
|
33
|
+
left: number;
|
|
34
|
+
top: number;
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
rotate: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type __VLS_Slots = {} & {
|
|
41
|
+
default?: (props: typeof __VLS_7) => any;
|
|
42
|
+
} & {
|
|
43
|
+
svg?: (props: typeof __VLS_9) => any;
|
|
44
|
+
};
|
|
45
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
46
|
+
start: typeof start;
|
|
47
|
+
activeHandle: import("vue").Ref<Handle | undefined, Handle | undefined>;
|
|
48
|
+
transforming: import("vue").Ref<boolean, boolean>;
|
|
49
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
50
|
+
move: (args_0: OrientedBoundingBox, args_1: OrientedBoundingBox) => any;
|
|
51
|
+
end: (args_0: OrientedBoundingBox) => any;
|
|
52
|
+
start: (args_0: OrientedBoundingBox) => any;
|
|
53
|
+
"update:modelValue": (args_0: OrientedBoundingBox) => any;
|
|
54
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
55
|
+
onMove?: ((args_0: OrientedBoundingBox, args_1: OrientedBoundingBox) => any) | undefined;
|
|
56
|
+
onEnd?: ((args_0: OrientedBoundingBox) => any) | undefined;
|
|
57
|
+
onStart?: ((args_0: OrientedBoundingBox) => any) | undefined;
|
|
58
|
+
"onUpdate:modelValue"?: ((args_0: OrientedBoundingBox) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
color: string;
|
|
61
|
+
visibility: "visible" | "none" | "auto";
|
|
62
|
+
resizeStrategy: "free" | "aspectRatio" | "diagonalAspectRatio";
|
|
63
|
+
tag: string | any;
|
|
64
|
+
moveable: boolean;
|
|
65
|
+
rotatable: boolean;
|
|
66
|
+
resizable: boolean;
|
|
67
|
+
threshold: number;
|
|
68
|
+
handleStrategy: "default" | "point";
|
|
69
|
+
handleColor: string;
|
|
70
|
+
handles: Handle[];
|
|
71
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
72
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
73
|
+
declare const _default: typeof __VLS_export;
|
|
74
|
+
export default _default;
|
|
75
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
76
|
+
new (): {
|
|
77
|
+
$slots: S;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { ReferenceElement, Side } from '@floating-ui/vue';
|
|
2
|
+
import type { ComputedRef, InjectionKey, PropType } from 'vue';
|
|
3
|
+
export interface OverlayOptions {
|
|
4
|
+
attach?: ComputedRef<string | boolean | Element | null | undefined>;
|
|
5
|
+
}
|
|
6
|
+
export interface MceOverlayItem {
|
|
7
|
+
index: ComputedRef<number>;
|
|
8
|
+
attach?: OverlayOptions['attach'];
|
|
9
|
+
}
|
|
10
|
+
export interface MceOverlayProvide {
|
|
11
|
+
register: (id: number) => MceOverlayItem;
|
|
12
|
+
unregister: (id: number) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const MceOverlaySymbol: InjectionKey<MceOverlayProvide>;
|
|
15
|
+
export declare const makeMceOverlayProps: <Defaults extends {
|
|
16
|
+
location?: unknown;
|
|
17
|
+
offset?: unknown;
|
|
18
|
+
target?: unknown;
|
|
19
|
+
attach?: unknown;
|
|
20
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
21
|
+
location: unknown extends Defaults["location"] ? PropType<Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start"> : {
|
|
22
|
+
type: PropType<unknown extends Defaults["location"] ? Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start" : Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start" | Defaults["location"]>;
|
|
23
|
+
default: unknown extends Defaults["location"] ? Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start" : NonNullable<Side | "left-end" | "left-start" | "right-end" | "right-start" | "top-end" | "top-start" | "bottom-end" | "bottom-start"> | Defaults["location"];
|
|
24
|
+
};
|
|
25
|
+
offset: unknown extends Defaults["offset"] ? NumberConstructor : {
|
|
26
|
+
type: PropType<unknown extends Defaults["offset"] ? number : number | Defaults["offset"]>;
|
|
27
|
+
default: unknown extends Defaults["offset"] ? number : number | Defaults["offset"];
|
|
28
|
+
};
|
|
29
|
+
target: unknown extends Defaults["target"] ? PropType<{
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
} | ReferenceElement> : {
|
|
33
|
+
type: PropType<unknown extends Defaults["target"] ? {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
} | ReferenceElement : {
|
|
37
|
+
x: number;
|
|
38
|
+
y: number;
|
|
39
|
+
} | ReferenceElement | Defaults["target"]>;
|
|
40
|
+
default: unknown extends Defaults["target"] ? {
|
|
41
|
+
x: number;
|
|
42
|
+
y: number;
|
|
43
|
+
} | ReferenceElement : Defaults["target"] | NonNullable<{
|
|
44
|
+
x: number;
|
|
45
|
+
y: number;
|
|
46
|
+
} | ReferenceElement>;
|
|
47
|
+
};
|
|
48
|
+
attach: unknown extends Defaults["attach"] ? {
|
|
49
|
+
type: PropType<string | boolean | Element | null | undefined>;
|
|
50
|
+
default: undefined;
|
|
51
|
+
} : Omit<{
|
|
52
|
+
type: PropType<string | boolean | Element | null | undefined>;
|
|
53
|
+
default: undefined;
|
|
54
|
+
}, "type" | "default"> & {
|
|
55
|
+
type: PropType<unknown extends Defaults["attach"] ? string | boolean | Element | null | undefined : string | boolean | Element | Defaults["attach"] | null | undefined>;
|
|
56
|
+
default: unknown extends Defaults["attach"] ? string | boolean | Element | null | undefined : Defaults["attach"] | NonNullable<string | boolean | Element | null | undefined>;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
export declare function provideOverlay(options?: OverlayOptions): MceOverlayProvide;
|
|
60
|
+
export declare function useOverlay(): MceOverlayItem;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Element2D, PointerInputEvent } from 'modern-canvas';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
export interface ActiveStrategyContext {
|
|
4
|
+
element: Element2D | undefined;
|
|
5
|
+
oldElement: Element2D | undefined;
|
|
6
|
+
event: PointerInputEvent;
|
|
7
|
+
isExcluded: (element: Element2D) => boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface HoverStrategyContext extends ActiveStrategyContext {
|
|
10
|
+
}
|
|
11
|
+
export type ResizeStrategy = (element: Element2D) => 'free' | 'aspectRatio' | 'diagonalAspectRatio';
|
|
12
|
+
export type ActiveStrategy = (context: ActiveStrategyContext) => {
|
|
13
|
+
element: Element2D | undefined;
|
|
14
|
+
state: Mce.State | undefined;
|
|
15
|
+
} | Element2D | undefined;
|
|
16
|
+
export type HoverStrategy = (context: HoverStrategyContext) => {
|
|
17
|
+
element: Element2D | undefined;
|
|
18
|
+
cursor: string | undefined;
|
|
19
|
+
} | Element2D | undefined;
|
|
20
|
+
export declare const makeMceStrategyProps: <Defaults extends {
|
|
21
|
+
resizeStrategy?: unknown;
|
|
22
|
+
activeStrategy?: unknown;
|
|
23
|
+
hoverStrategy?: unknown;
|
|
24
|
+
} = {}>(defaults?: Defaults | undefined) => {
|
|
25
|
+
resizeStrategy: unknown extends Defaults["resizeStrategy"] ? PropType<ResizeStrategy> : {
|
|
26
|
+
type: PropType<unknown extends Defaults["resizeStrategy"] ? ResizeStrategy : ResizeStrategy | Defaults["resizeStrategy"]>;
|
|
27
|
+
default: unknown extends Defaults["resizeStrategy"] ? ResizeStrategy : ResizeStrategy | Defaults["resizeStrategy"];
|
|
28
|
+
};
|
|
29
|
+
activeStrategy: unknown extends Defaults["activeStrategy"] ? PropType<ActiveStrategy> : {
|
|
30
|
+
type: PropType<unknown extends Defaults["activeStrategy"] ? ActiveStrategy : ActiveStrategy | Defaults["activeStrategy"]>;
|
|
31
|
+
default: unknown extends Defaults["activeStrategy"] ? ActiveStrategy : ActiveStrategy | Defaults["activeStrategy"];
|
|
32
|
+
};
|
|
33
|
+
hoverStrategy: unknown extends Defaults["hoverStrategy"] ? PropType<HoverStrategy> : {
|
|
34
|
+
type: PropType<unknown extends Defaults["hoverStrategy"] ? HoverStrategy : HoverStrategy | Defaults["hoverStrategy"]>;
|
|
35
|
+
default: unknown extends Defaults["hoverStrategy"] ? HoverStrategy : HoverStrategy | Defaults["hoverStrategy"];
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export declare const defaultResizeStrategy: ResizeStrategy;
|
|
39
|
+
export declare const defaultActiveStrategy: ActiveStrategy;
|
|
40
|
+
export declare const defaultHoverStrategy: HoverStrategy;
|
package/dist/editor.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RemovableRef } from '@vueuse/core';
|
|
2
|
+
import type { ObservableEvents } from 'modern-idoc';
|
|
3
|
+
import type { App, InjectionKey } from 'vue';
|
|
4
|
+
import { Observable } from 'modern-idoc';
|
|
5
|
+
export interface Options extends Mce.Options {
|
|
6
|
+
debug?: boolean;
|
|
7
|
+
plugins?: Plugin[];
|
|
8
|
+
configCacheInLocal?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface Editor extends Mce.Editor {
|
|
11
|
+
}
|
|
12
|
+
export interface Events extends Mce.Events, ObservableEvents {
|
|
13
|
+
}
|
|
14
|
+
export declare class Editor extends Observable<Events> {
|
|
15
|
+
static injectionKey: InjectionKey<Editor>;
|
|
16
|
+
debug: import("vue").Ref<boolean, boolean>;
|
|
17
|
+
config: RemovableRef<Mce.Config>;
|
|
18
|
+
onEmit?: <K extends keyof Events & string>(event: K, ...args: Events[K]) => void;
|
|
19
|
+
constructor(options?: Options);
|
|
20
|
+
protected _setupObservable(): void;
|
|
21
|
+
log: (...args: any[]) => void;
|
|
22
|
+
emit: <K extends keyof Events & string>(event: K, ...args: Events[K]) => this;
|
|
23
|
+
protected _setupOptions(options: Options): void;
|
|
24
|
+
protected _setupPlugins(plugins: Plugin[], options: Options): void;
|
|
25
|
+
install: (app: App) => void;
|
|
26
|
+
}
|
|
27
|
+
export declare function createEditor(options?: Options): Editor;
|
|
28
|
+
export type Plugin = (editor: Editor, options: Options) => ((editor: Editor, options: Options) => void) | Plugin[] | Record<string, any> | undefined | void;
|
|
29
|
+
export declare function definePlugin(cb: Plugin): Plugin;
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.mce-auxiliary{position:absolute;overflow:hidden;inset:0}.mce-auxiliary__alignment{position:absolute;background-color:#ff4aff;height:1px;width:1px}.mce-auxiliary__area{position:absolute;display:flex;align-items:center;justify-content:center;background-color:#f424fd33}.mce-auxiliary__area:before{content:"";background:#1690ff;height:1px;width:100%}.mce-auxiliary__area:after{position:absolute;content:"";height:5px;width:100%;border-left:1px solid #1690ff;border-right:1px solid #1690ff}.mce-auxiliary__area--vertical:before{height:100%;width:1px}.mce-auxiliary__area--vertical:after{height:100%;width:5px;border-left:none;border-right:none;border-top:1px solid #1690ff;border-bottom:1px solid #1690ff}.mce-bottombar{position:absolute}.mce-overlay>*{pointer-events:auto}.mce-menu{-webkit-user-select:none;user-select:none}.mce-list{display:flex;flex-direction:column;background-color:rgba(var(--mce-theme-on-surface),1);color:rgba(var(--mce-theme-surface),1);box-shadow:var(--mce-shadow);padding:4px;border-radius:4px;gap:2px}.mce-list__divider{border-bottom:1px solid rgba(var(--mce-theme-surface),.12)}.mce-list-item{display:flex;width:100%;padding:4px 8px;border-radius:4px;cursor:pointer;align-items:center;gap:12px}.mce-list-item--opened,.mce-list-item:hover{background-color:rgba(var(--mce-theme-primary),1);color:rgba(var(--mce-theme-on-primary),1)}.mce-list-item--disabled{pointer-events:none;-webkit-user-select:none;user-select:none;opacity:.4}.mce-list-item__title{flex:1;display:flex;align-items:center;font-size:12px;white-space:nowrap}.mce-list-item__append{width:12px;height:12px}.mce-list-item__append>svg{display:block;width:100%;height:100%}.mce-context-menu__title{flex:1}.mce-context-menu__kbd{margin-left:24px;opacity:.3}.mce-drawing{pointer-events:auto!important;position:fixed}.mce-drawing__content{margin:4px;border:1px solid rgba(0,0,0,.168627451);border-radius:4px;width:fit-content;height:22px;padding:0 4px;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background-color:rgba(var(--mce-theme-surface),1)}.mce-frame{position:absolute;border:1px solid rgba(0,0,0,.168627451)}.mce-frame__name{position:absolute;top:0;left:0;transform:translateY(-100%) translateY(-4px);transform-origin:left bottom;font-size:12px;line-height:1.5;white-space:nowrap;pointer-events:auto;-webkit-user-select:none;user-select:none}.mce-frame__name>div{position:relative;min-width:28px;box-sizing:content-box;color:rgba(var(--mce-theme-on-surface),.8)}.mce-frame__name>input{position:absolute;left:0;top:0;outline:none;width:100%;height:100%;border:1px solid rgba(0,0,0,.168627451);border-radius:4px;cursor:default}.mce-back-selected-aera{pointer-events:auto!important;position:absolute;left:50%;bottom:24px;padding:4px 8px;display:flex;align-items:center;gap:4px;color:rgba(var(--mce-theme-surface),1);background-color:rgba(var(--mce-theme-on-background),.3);transform:translate(-50%);border-radius:8px;font-size:14px;cursor:pointer}.mce-hover{position:absolute;border-style:solid;border-width:2px;color:rgba(var(--mce-theme-primary),1)}.mce-tooltip{background:rgb(var(--mce-theme-surface-variant));color:rgb(var(--mce-theme-on-surface-variant));border-radius:4px;font-size:.875rem;line-height:1.6;display:inline-block;padding:5px 16px;text-transform:initial;width:auto;opacity:1;transition-property:opacity,transform;overflow-wrap:break-word}.mce-ruler{position:absolute;left:0;top:0}.mce-ruler__canvas{display:block;pointer-events:auto;cursor:pointer;background-color:rgba(var(--mce-theme-surface),1);color:rgba(var(--mce-theme-on-background),.3)}.mce-ruler-refline{position:absolute;border-style:dashed;border-width:0;border-color:rgba(var(--mce-theme-primary),1);pointer-events:auto!important}.mce-ruler-refline--vertical{border-top-width:1px;cursor:ns-resize}.mce-ruler-refline--horizontal{border-left-width:1px;cursor:ew-resize}.mce-ruler-refline--temp{border-color:rgba(var(--mce-theme-primary),.3)}.mce-scrollbar{position:absolute;display:flex;pointer-events:auto!important}.mce-scrollbar--vertical{right:0;flex-direction:column}.mce-scrollbar--horizontal{bottom:0}.mce-scrollbar__track{flex:1}.mce-scrollbar__thumb{position:absolute;border-radius:calc(infinity * 1px);background-color:rgba(var(--mce-theme-on-background),.3)}.mce-scrollbar__thumb--active,.mce-scrollbar__thumb:hover{background-color:rgba(var(--mce-theme-on-background),.4)}.mce-transformable{left:0;top:0}.mce-transformable__svg{position:absolute;left:0;top:0;width:100%;height:100%;overflow:visible;pointer-events:none}.mce-transformable__box{stroke:currentColor;stroke-width:1px}.mce-transformable__handle{stroke:currentColor;stroke-width:1px;pointer-events:none}.mce-transformable__handle-box{stroke-width:1px;fill:transparent;stroke:transparent}.mce-parent-element-box{position:absolute;pointer-events:none;border-width:1px;border-style:dashed;color:rgba(var(--mce-theme-primary),1);opacity:.5}.mce-select-range-box{position:absolute;border-width:1px;border-style:solid;color:rgba(var(--mce-theme-primary),1);background-color:rgba(var(--mce-theme-primary),.1)}.mce-current-box{position:absolute;color:rgba(var(--mce-theme-primary),1)}.mce-selected-element-box{position:absolute;border-width:1px;border-style:solid;color:rgba(var(--mce-theme-primary),1)}.mce-starter{pointer-events:auto;position:absolute;width:100%;height:100%;background-color:rgba(var(--mce-theme-surface),1);display:flex;align-items:center;justify-content:center}.mce-starter__container{display:flex;margin:auto;flex-direction:column;gap:8px}.mce-starter__btn{display:flex;align-items:center;gap:4px;padding:4px 8px;border-radius:4px;cursor:pointer}.mce-starter__btn:hover{background-color:rgba(var(--mce-theme-background),1)}.mce-starter__kbd{margin-left:4px;display:flex;gap:4px}.mce-starter__kbd kbd{display:flex;align-items:center;justify-content:center;border-radius:4px;width:1.2em;height:1.2em;border:1px solid rgba(var(--mce-theme-on-surface),1)}.mce-statusbar[data-v-93456dcb]{-webkit-user-select:none;user-select:none;position:relative;display:flex;align-items:center;gap:4px;font-size:12px;line-height:1;width:100%;height:24px;padding:0 8px;background-color:rgba(var(--mce-theme-surface),1);color:rgba(var(--mce-theme-on-surface),1);font-weight:700}.mce-statusbar__item[data-v-93456dcb]{display:flex;align-items:center;gap:4px}.mce-statusbar__item>svg[data-v-93456dcb]{width:1em;height:1em}.mce-statusbar__divider[data-v-93456dcb]{width:0;height:60%;border-right:1px solid rgba(var(--mce-theme-on-surface),.2);margin:0 8px}.mce-statusbar__kbd[data-v-93456dcb]{outline:1px solid rgba(var(--mce-theme-on-surface),.4);border-radius:4px;display:flex;align-items:center;justify-content:center;font-size:12px;padding:0 2px;font-family:system-ui,-apple-system,sans-serif}.mce-text-editor{position:absolute;width:0;height:0;left:0;top:0;overflow:visible}.mce-text-editor__wrapper{position:absolute}.mce-text-editor__editor{pointer-events:auto!important;cursor:move}.mce-drawboard{--mce-theme-primary: 97, 101, 253;--mce-theme-on-primary: 247, 247, 248;--mce-theme-surface: 255, 255, 255;--mce-theme-on-surface: 56, 56, 56;--mce-theme-surface-variant: 35, 37, 41;--mce-theme-on-surface-variant: 255, 255, 255;--mce-theme-background: 240, 242, 245;--mce-theme-on-background: 56, 56, 56;--mce-shadow: 0 8px 32px 2px rgba(0, 0, 0, .08), 0 0 1px rgba(0, 0, 0, .2)}.mce-drawboard{position:relative;width:100%;height:100%;display:flex;flex-direction:column;background-color:rgba(var(--mce-theme-surface),1);color:rgba(var(--mce-theme-on-surface),1);overflow:hidden;-webkit-user-select:none;user-select:none}.mce-drawboard *{box-sizing:border-box}.mce-drawboard__overlay-container{position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none}.mce-drawboard__main{position:relative;width:100%;flex:1;overflow:hidden}.mce-drawboard__main>*{pointer-events:none}.mce-drawboard__canvas{position:absolute;left:0;top:0;width:100%;height:100%;display:block}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './typed-global.d.ts';
|
|
2
|
+
import './typed-plugins.d.ts';
|
|
3
|
+
export { default as Drawboard } from './components/Drawboard.vue';
|
|
4
|
+
export { default as Transformable } from './components/shared/Transformable.vue';
|
|
5
|
+
export * from './composables';
|
|
6
|
+
export * from './editor';
|
|
7
|
+
export * from './models';
|
|
8
|
+
export * from './sw';
|
|
9
|
+
export * from './types';
|
|
10
|
+
export * from './utils';
|
|
11
|
+
export type { Camera2D, Element2D, Engine } from 'modern-canvas';
|
|
12
|
+
export type { Element, NormalizedElement } from 'modern-idoc';
|