vkedit 3.2.7 → 4.0.1
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/CHANGELOG.md +51 -0
- package/LICENSE +21 -21
- package/README.en.md +38 -36
- package/README.md +41 -28
- package/THIRD_PARTY_LICENSES.md +64 -0
- package/dist/commands/add-element-command.d.ts +0 -2
- package/dist/commands/change-layer-order-command.d.ts +2 -0
- package/dist/commands/index.d.ts +2 -0
- package/dist/commands/reorder-elements-command.d.ts +20 -0
- package/dist/commands/update-canvas-property-command.d.ts +23 -0
- package/dist/components/BaseElementPropertyPanel.vue.d.ts +28 -1
- package/dist/components/TextProperty.vue.d.ts +2 -0
- package/dist/components/ui/VkButton.vue.d.ts +2 -2
- package/dist/components/ui/VkColorPicker.vue.d.ts +26 -0
- package/dist/components/ui/VkTextarea.vue.d.ts +20 -0
- package/dist/components/ui/index.d.ts +2 -1
- package/dist/core/ContentLayer.vue.d.ts +0 -2
- package/dist/core/Editor.vue.d.ts +1 -0
- package/dist/{plugins/rect/Tool.vue.d.ts → core/GraphicToolRenderer.vue.d.ts} +6 -1
- package/dist/core/HelpGuide.vue.d.ts +3 -1
- package/dist/{plugins/table/CellsBorder.vue.d.ts → core/TransformOverlay.vue.d.ts} +2 -2
- package/dist/core/editor-host.d.ts +4 -11
- package/dist/favicon.svg +21 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-canvas-property-command.d.ts +5 -0
- package/dist/hooks/use-content-layer.d.ts +6 -6
- package/dist/hooks/use-host-state.d.ts +1 -0
- package/dist/hooks/use-ruler-layer.d.ts +24 -0
- package/dist/hooks/use-selection-layer.d.ts +2 -3
- package/dist/hooks/use-stage-event.d.ts +1 -0
- package/dist/hooks/use-transform-overlay.d.ts +108 -0
- package/dist/index-Dpse_csX.js +25656 -0
- package/dist/{index.es-B1gCGYT7.js → index.es-LscL1n3Y.js} +1 -1
- package/dist/plugins/barcode/Shape.vue.d.ts +1 -1
- package/dist/plugins/barcode/index.d.ts +0 -1
- package/dist/plugins/export/export.d.ts +1 -2
- package/dist/plugins/graphic-registry/graphic-registry.d.ts +43 -0
- package/dist/plugins/graphic-registry/index.d.ts +1 -0
- package/dist/plugins/import/import.d.ts +1 -2
- package/dist/plugins/index.d.ts +2 -6
- package/dist/plugins/{table/ContextMenu.vue.d.ts → layer-manager/LayerPanel.vue.d.ts} +5 -4
- package/dist/plugins/layer-manager/index.d.ts +2 -0
- package/dist/plugins/layer-manager/layer-manager.d.ts +16 -0
- package/dist/plugins/line/Shape.vue.d.ts +3 -1
- package/dist/plugins/line/index.d.ts +0 -1
- package/dist/plugins/qrcode/Shape.vue.d.ts +1 -1
- package/dist/plugins/qrcode/index.d.ts +0 -1
- package/dist/plugins/rect/Shape.vue.d.ts +1 -1
- package/dist/plugins/rect/index.d.ts +0 -1
- package/dist/plugins/selection.d.ts +0 -1
- package/dist/plugins/text/Shape.vue.d.ts +1 -1
- package/dist/plugins/text/index.d.ts +0 -1
- package/dist/types/base-graphic-element.d.ts +10 -3
- package/dist/types/base.d.ts +6 -18
- package/dist/types/event-data.d.ts +38 -0
- package/dist/types/event-map.d.ts +14 -7
- package/dist/types/graphic-plugin.d.ts +53 -0
- package/dist/types/index.d.ts +1 -3
- package/dist/utils/color.d.ts +40 -0
- package/dist/utils/css-var.d.ts +14 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/readability.d.ts +22 -0
- package/dist/utils/theme.d.ts +2 -0
- package/dist/utils/transform-geometry.d.ts +62 -0
- package/dist/utils/transform-overlay.d.ts +62 -0
- package/dist/vkedit.css +1 -1
- package/dist/vkedit.es.js +84 -97
- package/package.json +21 -21
- package/dist/components/ui/VkIcon.vue.d.ts +0 -8
- package/dist/favicon.ico +0 -0
- package/dist/index-Aa1HXlw6.js +0 -72887
- package/dist/plugins/barcode/Tool.vue.d.ts +0 -6
- package/dist/plugins/barcode/barcode.d.ts +0 -76
- package/dist/plugins/chart/PropertyPanel.vue.d.ts +0 -9
- package/dist/plugins/chart/Shape.vue.d.ts +0 -23
- package/dist/plugins/chart/Tool.vue.d.ts +0 -6
- package/dist/plugins/chart/chart.d.ts +0 -38
- package/dist/plugins/chart/index.d.ts +0 -4
- package/dist/plugins/element-manager.d.ts +0 -24
- package/dist/plugins/graphic-manager/graphic-manager.d.ts +0 -31
- package/dist/plugins/graphic-manager/index.d.ts +0 -1
- package/dist/plugins/graphic-tool-manager.d.ts +0 -16
- package/dist/plugins/line/Tool.vue.d.ts +0 -7
- package/dist/plugins/line/line.d.ts +0 -61
- package/dist/plugins/property-panel-manager/index.d.ts +0 -1
- package/dist/plugins/property-panel-manager/property-panel-manager.d.ts +0 -32
- package/dist/plugins/qrcode/Tool.vue.d.ts +0 -6
- package/dist/plugins/qrcode/qrcode.d.ts +0 -75
- package/dist/plugins/rect/rect.d.ts +0 -69
- package/dist/plugins/table/PropertyPanel.vue.d.ts +0 -9
- package/dist/plugins/table/Shape.vue.d.ts +0 -26
- package/dist/plugins/table/Tool.vue.d.ts +0 -7
- package/dist/plugins/table/cell.d.ts +0 -61
- package/dist/plugins/table/index.d.ts +0 -6
- package/dist/plugins/table/table.d.ts +0 -92
- package/dist/plugins/text/Tool.vue.d.ts +0 -6
- package/dist/plugins/text/text.d.ts +0 -76
- package/dist/types/base-graphic-type.d.ts +0 -9
- package/dist/types/element-type-map.d.ts +0 -12
- package/dist/types/plugin-map.d.ts +0 -12
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
2
|
+
helpGuideRef: HTMLDivElement;
|
|
3
|
+
}, HTMLDivElement>;
|
|
2
4
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EditorHost } from '.';
|
|
2
2
|
type __VLS_Props = {
|
|
3
|
-
|
|
3
|
+
host: EditorHost;
|
|
4
4
|
};
|
|
5
5
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
6
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { IEditorPlugin, IEditorState, EventMap
|
|
1
|
+
import { IEditorPlugin, IEditorState, EventMap } from '../types';
|
|
2
2
|
import { ICommand } from '../commands/i-command';
|
|
3
|
-
import { RectPlugin } from '../plugins';
|
|
4
3
|
export declare class EditorHost {
|
|
5
4
|
private plugins;
|
|
6
5
|
private events;
|
|
@@ -21,26 +20,20 @@ export declare class EditorHost {
|
|
|
21
20
|
isPanning: boolean;
|
|
22
21
|
offsetX: number;
|
|
23
22
|
offsetY: number;
|
|
23
|
+
autoFitPending: boolean;
|
|
24
24
|
};
|
|
25
25
|
emit<K extends keyof EventMap>(event: K, payload: Parameters<EventMap[K]>[0]): void;
|
|
26
26
|
on<K extends keyof EventMap>(event: K, handler: EventMap[K]): void;
|
|
27
27
|
off<K extends keyof EventMap>(event: K, handler: EventMap[K]): void;
|
|
28
|
-
installPlugin<
|
|
29
|
-
installPlugin(name: string, pluginClass: IEditorPlugin | (new (...args: any[]) => IEditorPlugin)): EditorHost;
|
|
30
|
-
uninstallPlugin<K extends keyof PluginMap>(pluginName: K): EditorHost;
|
|
28
|
+
installPlugin<T extends IEditorPlugin = IEditorPlugin>(name: string, pluginClass: new (...args: any[]) => T): EditorHost;
|
|
31
29
|
uninstallPlugin(pluginName: string): EditorHost;
|
|
32
|
-
getPlugin<K extends keyof PluginMap>(pluginName: K): PluginMap[K];
|
|
33
30
|
getPlugin<T extends IEditorPlugin = IEditorPlugin>(pluginName: string): T;
|
|
34
31
|
executeCommand(command: ICommand): void;
|
|
35
32
|
undo(): void;
|
|
36
33
|
redo(): void;
|
|
34
|
+
private _emitHistoryChanged;
|
|
37
35
|
get status(): IEditorState;
|
|
38
36
|
setStatus(newStatus: Partial<IEditorState>): void;
|
|
39
37
|
toJSON(): string;
|
|
40
38
|
loadJSON(jsonStr: string): void;
|
|
41
39
|
}
|
|
42
|
-
declare module '../types' {
|
|
43
|
-
interface PluginMap {
|
|
44
|
-
ttt: RectPlugin;
|
|
45
|
-
}
|
|
46
|
-
}
|
package/dist/favicon.svg
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 80 80" width="80" height="80" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">vkedit</title>
|
|
3
|
+
<desc id="desc">vkedit 网站图标,由渐变 V 形与画布折角组成</desc>
|
|
4
|
+
<defs>
|
|
5
|
+
<linearGradient id="vkedit-mark" x1="0" y1="0" x2="1" y2="1">
|
|
6
|
+
<stop offset="0" stop-color="#2DD4BF"/>
|
|
7
|
+
<stop offset="0.48" stop-color="#14B8A6"/>
|
|
8
|
+
<stop offset="1" stop-color="#0D9488"/>
|
|
9
|
+
</linearGradient>
|
|
10
|
+
<linearGradient id="vkedit-fold" x1="0" y1="0" x2="1" y2="1">
|
|
11
|
+
<stop offset="0" stop-color="#99F6E4"/>
|
|
12
|
+
<stop offset="1" stop-color="#5EEAD4"/>
|
|
13
|
+
</linearGradient>
|
|
14
|
+
</defs>
|
|
15
|
+
<rect x="4" y="4" width="72" height="72" rx="18" fill="#111726" stroke="#2B3854"/>
|
|
16
|
+
<g transform="translate(3 8)">
|
|
17
|
+
<path d="M42 45L55 41.5V27.5L59 31.5C60.3 32.8 61 34.5 61 36.4V48C61 52.4 57.4 56 53 56H39.5C36.9 56 34.6 54.5 33.5 52.3L42 45Z" fill="url(#vkedit-fold)"/>
|
|
18
|
+
<path d="M14 18C11.7 14.3 13.2 9.6 17.2 7.5C21.1 5.5 25.6 6.7 27.9 10.3L36 23.2L44.1 10.3C46.4 6.7 50.9 5.5 54.8 7.5C58.8 9.6 60.3 14.3 58 18L42.8 42.4C39.6 47.6 32.4 47.6 29.2 42.4L14 18Z" fill="url(#vkedit-mark)"/>
|
|
19
|
+
<path d="M18.4 10.7C21.1 9.3 24.2 10.1 25.8 12.7L35.7 28.5" fill="none" stroke="#FFFFFF" stroke-width="1.3" stroke-linecap="round" opacity="0.18"/>
|
|
20
|
+
</g>
|
|
21
|
+
</svg>
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,8 +2,10 @@ export * from './use-bg-layer';
|
|
|
2
2
|
export * from './use-content-layer';
|
|
3
3
|
export * from './use-host-state';
|
|
4
4
|
export * from './use-property-command';
|
|
5
|
+
export * from './use-canvas-property-command';
|
|
5
6
|
export * from './use-ruler-layer';
|
|
6
7
|
export * from './use-selection-layer';
|
|
7
8
|
export * from './use-stage-event';
|
|
8
9
|
export * from './use-stage';
|
|
9
10
|
export * from './use-zoom';
|
|
11
|
+
export * from './use-transform-overlay';
|
|
@@ -2,7 +2,6 @@ import { IGraphicElement } from '../types';
|
|
|
2
2
|
import { EditorHost } from '../core';
|
|
3
3
|
export declare function useContentLayer(host: EditorHost): {
|
|
4
4
|
contentLayerRef: import('vue').Ref<any, any>;
|
|
5
|
-
transformerRef: import('vue').Ref<any, any>;
|
|
6
5
|
contentLayerConfig: import('vue').ComputedRef<{}>;
|
|
7
6
|
contentGroupConfig: import('vue').ComputedRef<{
|
|
8
7
|
x: number;
|
|
@@ -23,7 +22,9 @@ export declare function useContentLayer(host: EditorHost): {
|
|
|
23
22
|
visible: boolean;
|
|
24
23
|
locked: boolean;
|
|
25
24
|
draggable: boolean;
|
|
26
|
-
|
|
25
|
+
resizable: boolean;
|
|
26
|
+
zIndex: number;
|
|
27
|
+
displayName?: string | null | undefined;
|
|
27
28
|
resizeAnchors?: string[] | null | undefined;
|
|
28
29
|
getBoundingBox: () => import('../types').BoundingBox;
|
|
29
30
|
clone: () => IGraphicElement;
|
|
@@ -47,7 +48,9 @@ export declare function useContentLayer(host: EditorHost): {
|
|
|
47
48
|
visible: boolean;
|
|
48
49
|
locked: boolean;
|
|
49
50
|
draggable: boolean;
|
|
50
|
-
|
|
51
|
+
resizable: boolean;
|
|
52
|
+
zIndex: number;
|
|
53
|
+
displayName?: string | null | undefined;
|
|
51
54
|
resizeAnchors?: string[] | null | undefined;
|
|
52
55
|
getBoundingBox: () => import('../types').BoundingBox;
|
|
53
56
|
clone: () => IGraphicElement;
|
|
@@ -63,8 +66,5 @@ export declare function useContentLayer(host: EditorHost): {
|
|
|
63
66
|
handleDragStart: (event: any, element: any) => void;
|
|
64
67
|
handleDragMove: (event: any, element: any) => void;
|
|
65
68
|
handleDragEnd: (event: any, element: any) => void;
|
|
66
|
-
handleElementTransform: (event: any, element: IGraphicElement) => void;
|
|
67
|
-
handleElementTransformEnd: (event: any, element: any) => void;
|
|
68
|
-
updateTransformerNodes: (selection: IGraphicElement[]) => void;
|
|
69
69
|
updateCanvas: () => void;
|
|
70
70
|
};
|
|
@@ -24,6 +24,30 @@ export declare function useRulerLayer(host: EditorHost): {
|
|
|
24
24
|
strokeWidth: number;
|
|
25
25
|
listening: boolean;
|
|
26
26
|
}>;
|
|
27
|
+
cornerConfig: import('vue').ComputedRef<{
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
fill: string;
|
|
33
|
+
strokeEnabled: boolean;
|
|
34
|
+
listening: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
cornerEdgeConfigs: import('vue').ComputedRef<{
|
|
37
|
+
right: {
|
|
38
|
+
points: number[];
|
|
39
|
+
stroke: string;
|
|
40
|
+
strokeWidth: number;
|
|
41
|
+
listening: boolean;
|
|
42
|
+
};
|
|
43
|
+
bottom: {
|
|
44
|
+
points: number[];
|
|
45
|
+
stroke: string;
|
|
46
|
+
strokeWidth: number;
|
|
47
|
+
listening: boolean;
|
|
48
|
+
};
|
|
49
|
+
}>;
|
|
27
50
|
upRulerShapeRef: import('vue').Ref<any, any>;
|
|
28
51
|
leftRulerShapeRef: import('vue').Ref<any, any>;
|
|
52
|
+
RULER_SIZE: number;
|
|
29
53
|
};
|
|
@@ -18,8 +18,8 @@ export declare function useSelectionLayer(host: EditorHost): {
|
|
|
18
18
|
}>;
|
|
19
19
|
handleMouseDown: (event: any) => void;
|
|
20
20
|
handleMouseMove: (event: any) => void;
|
|
21
|
-
handleMouseUp: (
|
|
22
|
-
|
|
21
|
+
handleMouseUp: () => void;
|
|
22
|
+
handleMouseLeave: () => void;
|
|
23
23
|
rectConfig: import('vue').ComputedRef<{
|
|
24
24
|
x: number;
|
|
25
25
|
y: number;
|
|
@@ -28,7 +28,6 @@ export declare function useSelectionLayer(host: EditorHost): {
|
|
|
28
28
|
fill: string;
|
|
29
29
|
stroke: string;
|
|
30
30
|
strokeWidth: number;
|
|
31
|
-
dash: number[];
|
|
32
31
|
listening: boolean;
|
|
33
32
|
}>;
|
|
34
33
|
selectionLayerConfig: import('vue').Ref<{}, {}>;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { EditorHost } from '../core';
|
|
2
|
+
import { IGraphicElement } from '../types';
|
|
3
|
+
export interface OverlayAnchorView {
|
|
4
|
+
id: string;
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
size: number;
|
|
8
|
+
}
|
|
9
|
+
export interface OverlayViewModel {
|
|
10
|
+
visible: boolean;
|
|
11
|
+
mode: 'single' | 'multi';
|
|
12
|
+
border: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
width: number;
|
|
16
|
+
height: number;
|
|
17
|
+
rotation: number;
|
|
18
|
+
stroke: string;
|
|
19
|
+
strokeWidth: number;
|
|
20
|
+
} | null;
|
|
21
|
+
anchors: OverlayAnchorView[];
|
|
22
|
+
rotateHandle: {
|
|
23
|
+
x: number;
|
|
24
|
+
y: number;
|
|
25
|
+
radius: number;
|
|
26
|
+
} | null;
|
|
27
|
+
rotateStem: {
|
|
28
|
+
points: number[];
|
|
29
|
+
stroke: string;
|
|
30
|
+
strokeWidth: number;
|
|
31
|
+
} | null;
|
|
32
|
+
}
|
|
33
|
+
export declare function useTransformOverlay(host: EditorHost): {
|
|
34
|
+
overlay: import('vue').ComputedRef<OverlayViewModel>;
|
|
35
|
+
refreshOverlay: () => void;
|
|
36
|
+
selectedElements: import('vue').Ref<{
|
|
37
|
+
id: string;
|
|
38
|
+
type: string;
|
|
39
|
+
x: number;
|
|
40
|
+
y: number;
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
rotation: number;
|
|
44
|
+
scaleX: number;
|
|
45
|
+
scaleY: number;
|
|
46
|
+
visible: boolean;
|
|
47
|
+
locked: boolean;
|
|
48
|
+
draggable: boolean;
|
|
49
|
+
resizable: boolean;
|
|
50
|
+
zIndex: number;
|
|
51
|
+
displayName?: string | null | undefined;
|
|
52
|
+
resizeAnchors?: string[] | null | undefined;
|
|
53
|
+
getBoundingBox: () => import('../types').BoundingBox;
|
|
54
|
+
clone: () => IGraphicElement;
|
|
55
|
+
serialize: () => any;
|
|
56
|
+
deserialize: (data: any) => void;
|
|
57
|
+
updateProperty: (host: EditorHost, property: string, oldValue: any, newValue: any) => void;
|
|
58
|
+
getTransformAttr?: ((event: any) => {
|
|
59
|
+
oldAttrs: any;
|
|
60
|
+
newAttrs: any;
|
|
61
|
+
}) | undefined;
|
|
62
|
+
}[], IGraphicElement[] | {
|
|
63
|
+
id: string;
|
|
64
|
+
type: string;
|
|
65
|
+
x: number;
|
|
66
|
+
y: number;
|
|
67
|
+
width: number;
|
|
68
|
+
height: number;
|
|
69
|
+
rotation: number;
|
|
70
|
+
scaleX: number;
|
|
71
|
+
scaleY: number;
|
|
72
|
+
visible: boolean;
|
|
73
|
+
locked: boolean;
|
|
74
|
+
draggable: boolean;
|
|
75
|
+
resizable: boolean;
|
|
76
|
+
zIndex: number;
|
|
77
|
+
displayName?: string | null | undefined;
|
|
78
|
+
resizeAnchors?: string[] | null | undefined;
|
|
79
|
+
getBoundingBox: () => import('../types').BoundingBox;
|
|
80
|
+
clone: () => IGraphicElement;
|
|
81
|
+
serialize: () => any;
|
|
82
|
+
deserialize: (data: any) => void;
|
|
83
|
+
updateProperty: (host: EditorHost, property: string, oldValue: any, newValue: any) => void;
|
|
84
|
+
getTransformAttr?: ((event: any) => {
|
|
85
|
+
oldAttrs: any;
|
|
86
|
+
newAttrs: any;
|
|
87
|
+
}) | undefined;
|
|
88
|
+
}[]>;
|
|
89
|
+
getElementNode: (id: string) => any;
|
|
90
|
+
cursor: import('vue').Ref<string, string>;
|
|
91
|
+
onOverlayPointerDown: (e: any) => void;
|
|
92
|
+
onOverlayPointerMove: () => void;
|
|
93
|
+
onOverlayPointerUp: () => void;
|
|
94
|
+
onStagePointerMove: (e: any) => void;
|
|
95
|
+
angleLabel: import('vue').Ref<{
|
|
96
|
+
x: number;
|
|
97
|
+
y: number;
|
|
98
|
+
text: string;
|
|
99
|
+
} | null, {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
text: string;
|
|
103
|
+
} | {
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
text: string;
|
|
107
|
+
} | null>;
|
|
108
|
+
};
|