vkedit 4.0.0 → 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/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 vkedit contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 庞万国
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -151,6 +151,15 @@ import 'vkedit/dist/vkedit.css'
151
151
 
152
152
  ---
153
153
 
154
+ ## 社区
155
+
156
+ - [贡献指南](CONTRIBUTING.md)
157
+ - [行为准则](CODE_OF_CONDUCT.md)
158
+ - [安全政策](SECURITY.md)
159
+ - [第三方许可证声明](THIRD_PARTY_LICENSES.md)
160
+
161
+ ---
162
+
154
163
  ## 联系方式
155
164
 
156
165
  - **QQ**: 16871824
@@ -0,0 +1,64 @@
1
+ # 第三方许可证声明
2
+
3
+ vkedit 使用了以下开源依赖。本文件依据各许可证要求列出其版权与许可信息。
4
+
5
+ ## 运行时依赖(随 npm 包分发)
6
+
7
+ 以下依赖会在安装 vkedit 时被引入,许可证均与 vkedit 的 MIT 许可证兼容。
8
+
9
+ | 依赖 | 版本 | 许可证 | 来源 |
10
+ | --- | --- | --- | --- |
11
+ | @vueuse/core | ^14.0.0 | MIT | https://github.com/vueuse/vueuse |
12
+ | jsbarcode | ^3.11.5 | MIT | https://github.com/lindell/JsBarcode |
13
+ | jspdf | ^3.0.3 | MIT | https://github.com/parallax/jsPDF |
14
+ | lodash | ^4.17.21 | MIT | https://github.com/lodash/lodash |
15
+ | qrcode | ^1.5.1 | MIT | https://github.com/soldair/node-qrcode |
16
+ | uuid | ^13.0.0 | MIT | https://github.com/uuidjs/uuid |
17
+
18
+ ### Peer Dependencies(由宿主项目提供)
19
+
20
+ | 依赖 | 版本 | 许可证 | 来源 |
21
+ | --- | --- | --- | --- |
22
+ | konva | ^10.0.2 | MIT | https://github.com/konvajs/konva |
23
+ | vue | ^3.5.18 | MIT | https://github.com/vuejs/core |
24
+ | vue-konva | ^3.2.6 | MIT | https://github.com/konvajs/vue-konva |
25
+
26
+ ## 开发依赖(不随 npm 包分发)
27
+
28
+ 以下依赖仅用于开发与构建,不影响下游合规义务。其中 `@iconify-json/ph` 的图标 SVG 数据在构建时由 `unplugin-icons` 内联至 `dist/`,但因其同为 MIT 许可,不产生额外合规义务。
29
+
30
+ | 依赖 | 许可证 |
31
+ | --- | --- |
32
+ | @iconify-json/ph | MIT |
33
+ | @tsconfig/node22 | MIT |
34
+ | @types/lodash | MIT |
35
+ | @types/node | MIT |
36
+ | @types/qrcode | MIT |
37
+ | @vitejs/plugin-vue | MIT |
38
+ | @vue/eslint-config-prettier | MIT |
39
+ | @vue/eslint-config-typescript | MIT |
40
+ | @vue/tsconfig | MIT |
41
+ | eslint | MIT |
42
+ | eslint-plugin-vue | MIT |
43
+ | jiti | MIT |
44
+ | npm-run-all2 | MIT |
45
+ | prettier | MIT |
46
+ | primevue | MIT |
47
+ | sass-embedded | MIT |
48
+ | typescript | Apache-2.0 |
49
+ | unplugin-icons | MIT |
50
+ | vite | MIT |
51
+ | vite-plugin-css-injected-by-js | MIT |
52
+ | vite-plugin-dts | MIT |
53
+ | vite-plugin-vue-devtools | MIT |
54
+ | vue-tsc | MIT |
55
+
56
+ ## 许可证全文
57
+
58
+ - MIT: https://opensource.org/license/mit/
59
+
60
+ > 注:`typescript` 为 Apache-2.0 许可,但属开发依赖,不随 npm 包分发,无需附带许可证全文。
61
+
62
+ ---
63
+
64
+ 本声明基于发布时已知的依赖信息。如发现遗漏或错误,请通过 [GitHub Issues](https://github.com/pwg-code/vkedit/issues) 报告。
@@ -1,7 +1,6 @@
1
1
  import { BaseCommand } from './base-command';
2
2
  import { IGraphicElement } from '../types';
3
3
  import { EditorHost } from '../core';
4
- import { ICommand } from './i-command';
5
4
  export declare class AddElementCommand extends BaseCommand {
6
5
  private element;
7
6
  name: string;
@@ -9,5 +8,4 @@ export declare class AddElementCommand extends BaseCommand {
9
8
  constructor(host: EditorHost, element: IGraphicElement);
10
9
  execute(): void;
11
10
  undo(): void;
12
- canMergeWith(command: ICommand): boolean;
13
11
  }
@@ -9,6 +9,7 @@ export declare class ChangeLayerOrderCommand extends BaseCommand {
9
9
  constructor(host: EditorHost, elementId: string, direction: 'up' | 'down' | 'top' | 'bottom');
10
10
  execute(): void;
11
11
  undo(): void;
12
+ private emitOrderChanged;
12
13
  private saveCurrentOrder;
13
14
  private changeLayerOrder;
14
15
  private restorePreviousOrder;
@@ -4,6 +4,7 @@ export * from './add-element-command';
4
4
  export * from './remove-element-command';
5
5
  export * from './transform-element-command';
6
6
  export * from './update-property-command';
7
+ export * from './update-canvas-property-command';
7
8
  export * from './clear-selection-command';
8
9
  export * from './batch-command';
9
10
  export * from './change-layer-order-command';
@@ -14,6 +14,7 @@ export declare class ReorderElementsCommand extends BaseCommand {
14
14
  constructor(host: EditorHost, newOrder: string[], description?: string);
15
15
  execute(): void;
16
16
  undo(): void;
17
+ private emitOrderChanged;
17
18
  private saveCurrentOrder;
18
19
  private applyOrder;
19
20
  }
@@ -0,0 +1,23 @@
1
+ import { BaseCommand } from './base-command';
2
+ import { IEditorState } from '../types';
3
+ import { EditorHost } from '../core';
4
+ import { ICommand } from './i-command';
5
+ export type CanvasPropertyPath = 'dpm' | 'width' | 'height';
6
+ export interface CanvasPropertySnapshot {
7
+ dpm: number;
8
+ width: number;
9
+ height: number;
10
+ wmm: number;
11
+ hmm: number;
12
+ }
13
+ export declare class UpdateCanvasPropertyCommand extends BaseCommand {
14
+ name: string;
15
+ private propertyPath;
16
+ private oldState;
17
+ private newStatus;
18
+ constructor(host: EditorHost, propertyPath: CanvasPropertyPath, oldState: CanvasPropertySnapshot, newStatus: Partial<IEditorState>);
19
+ execute(): void;
20
+ undo(): void;
21
+ canMergeWith(command: ICommand): boolean;
22
+ mergeWith(command: ICommand): ICommand;
23
+ }
@@ -20,6 +20,7 @@ export declare class EditorHost {
20
20
  isPanning: boolean;
21
21
  offsetX: number;
22
22
  offsetY: number;
23
+ autoFitPending: boolean;
23
24
  };
24
25
  emit<K extends keyof EventMap>(event: K, payload: Parameters<EventMap[K]>[0]): void;
25
26
  on<K extends keyof EventMap>(event: K, handler: EventMap[K]): void;
@@ -30,6 +31,7 @@ export declare class EditorHost {
30
31
  executeCommand(command: ICommand): void;
31
32
  undo(): void;
32
33
  redo(): void;
34
+ private _emitHistoryChanged;
33
35
  get status(): IEditorState;
34
36
  setStatus(newStatus: Partial<IEditorState>): void;
35
37
  toJSON(): string;
package/dist/favicon.svg CHANGED
@@ -1,8 +1,21 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="vkedit">
3
- <title>vkedit</title>
4
- <desc>Teal rounded square with a fused white VK monogram. V's right arm and K's vertical stem share the same axis (x=30 to 36), so the lower half of the K stem is absorbed into V. The K diagonals branch from that shared stem to the upper-right and lower-right corners of the mark.</desc>
5
- <rect width="64" height="64" rx="14" fill="#0d9488"/>
6
- <path d="M 8 14 L 20 14 L 32 40 L 44 14 L 56 14 L 36 52 L 28 52 Z" fill="#ffffff"/>
7
- <path d="M 30 14 L 36 14 L 36 28 L 50 14 L 56 14 L 40 32 L 56 50 L 50 50 L 36 36 L 36 50 L 30 50 Z" fill="#ffffff"/>
8
- </svg>
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>
@@ -2,6 +2,7 @@ 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';
@@ -0,0 +1,5 @@
1
+ import { CanvasPropertyPath } from '../commands';
2
+ import { EditorHost } from '../core';
3
+ export declare function useCanvasPropertyCommand(host: EditorHost): {
4
+ updateCanvasProperty: (propertyPath: CanvasPropertyPath, newValue: number) => void;
5
+ };