@hufe921/canvas-editor 0.9.132 → 0.9.133

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.
@@ -2,5 +2,5 @@ import { DeepRequired } from '../../interface/Common';
2
2
  import { IModeRule } from '../../interface/Editor';
3
3
  export declare const EDITOR_COMPONENT = "editor-component";
4
4
  export declare const EDITOR_PREFIX = "ce";
5
- export declare const EDITOR_CLIPBOARD: string;
5
+ export declare const EDITOR_CLIPBOARD = "ce-clipboard";
6
6
  export declare const defaultModeRuleOption: Readonly<DeepRequired<IModeRule>>;
@@ -1,5 +1,5 @@
1
1
  export declare enum AreaMode {
2
- EDIT = "edit",
3
- READONLY = "readonly",
2
+ EDIT = "edit",// 编辑模式(文档可编辑、辅助元素均存在)
3
+ READONLY = "readonly",// 只读模式(文档不可编辑)
4
4
  FORM = "form"
5
5
  }
@@ -17,7 +17,7 @@ export declare enum ControlComponent {
17
17
  RADIO = "radio"
18
18
  }
19
19
  export declare enum ControlIndentation {
20
- ROW_START = "rowStart",
20
+ ROW_START = "rowStart",// 从行起始位置缩进
21
21
  VALUE_START = "valueStart"
22
22
  }
23
23
  export declare enum ControlState {
@@ -13,12 +13,12 @@ export declare enum EditorContext {
13
13
  TABLE = "table"
14
14
  }
15
15
  export declare enum EditorMode {
16
- EDIT = "edit",
17
- CLEAN = "clean",
18
- READONLY = "readonly",
19
- FORM = "form",
20
- PRINT = "print",
21
- DESIGN = "design",
16
+ EDIT = "edit",// 编辑模式(文档可编辑、辅助元素均存在)
17
+ CLEAN = "clean",// 清洁模式(隐藏辅助元素)
18
+ READONLY = "readonly",// 只读模式(文档不可编辑)
19
+ FORM = "form",// 表单模式(仅控件内可编辑)
20
+ PRINT = "print",// 打印模式(文档不可编辑、隐藏辅助元素、选区、未书写控件及边框)
21
+ DESIGN = "design",// 设计模式(不可删除、只读等配置不控制)
22
22
  GRAFFITI = "graffiti"
23
23
  }
24
24
  export declare enum EditorZone {
@@ -3,9 +3,9 @@ export declare enum ListType {
3
3
  OL = "ol"
4
4
  }
5
5
  export declare enum UlStyle {
6
- DISC = "disc",
7
- CIRCLE = "circle",
8
- SQUARE = "square",
6
+ DISC = "disc",// 实心圆点
7
+ CIRCLE = "circle",// 空心圆点
8
+ SQUARE = "square",// 实心方块
9
9
  CHECKBOX = "checkbox"
10
10
  }
11
11
  export declare enum OlStyle {
@@ -12,6 +12,6 @@ export declare enum TdBorder {
12
12
  LEFT = "left"
13
13
  }
14
14
  export declare enum TdSlash {
15
- FORWARD = "forward",
15
+ FORWARD = "forward",// 正斜线 /
16
16
  BACK = "back"
17
17
  }
@@ -22,7 +22,7 @@ interface IZipElementListOption {
22
22
  }
23
23
  export declare function zipElementList(payload: IElement[], options?: IZipElementListOption): IElement[];
24
24
  export declare function convertTextAlignToRowFlex(node: HTMLElement): RowFlex;
25
- export declare function convertRowFlexToTextAlign(rowFlex: RowFlex): RowFlex.LEFT | RowFlex.CENTER | RowFlex.RIGHT | RowFlex.JUSTIFY | "justify";
25
+ export declare function convertRowFlexToTextAlign(rowFlex: RowFlex): "justify" | RowFlex.LEFT | RowFlex.CENTER | RowFlex.RIGHT | RowFlex.JUSTIFY;
26
26
  export declare function convertRowFlexToJustifyContent(rowFlex: RowFlex): "center" | "flex-start" | "flex-end" | "space-between";
27
27
  export declare function isTextLikeElement(element: IElement): boolean;
28
28
  export declare function isTextElement(element: IElement): boolean;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@hufe921/canvas-editor",
3
3
  "author": "Hufe",
4
4
  "license": "MIT",
5
- "version": "0.9.132",
5
+ "version": "0.9.133",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",
@@ -16,8 +16,8 @@
16
16
  "package.json"
17
17
  ],
18
18
  "typings": "./dist/src/editor/index.d.ts",
19
- "main": "./dist/canvas-editor.umd.js",
20
- "module": "./dist/canvas-editor.es.js",
19
+ "main": "./dist/canvas-editor.umd.cjs",
20
+ "module": "./dist/canvas-editor.js",
21
21
  "homepage": "https://github.com/Hufe921/canvas-editor",
22
22
  "repository": {
23
23
  "type": "git",
@@ -29,42 +29,51 @@
29
29
  "wysiwyg",
30
30
  "emr"
31
31
  ],
32
- "engines": {
33
- "node": ">=16.9.1"
34
- },
35
32
  "type": "module",
36
33
  "scripts": {
37
34
  "dev": "vite",
38
- "lib": "npm run lint && tsc && vite build --mode lib",
39
- "build": "npm run lint && tsc && vite build --mode app",
35
+ "lib": "eslint . && tsc && vitest run && vite build --mode lib",
36
+ "build": "eslint . && tsc && vitest run && vite build --mode app",
40
37
  "serve": "vite preview",
41
- "lint": "eslint .",
38
+ "lint": "eslint . && tsc --noEmit && vitest run",
42
39
  "cypress:open": "cypress open",
43
40
  "cypress:run": "cypress run",
41
+ "test:unit": "vitest run",
42
+ "test:unit:watch": "vitest",
43
+ "test:coverage": "vitest run --coverage",
44
44
  "type:check": "tsc --noEmit",
45
45
  "docs:dev": "vitepress dev docs",
46
46
  "docs:build": "vitepress build docs",
47
47
  "docs:preview": "vitepress preview docs",
48
- "release": "node scripts/release.js"
48
+ "pre-release": "node scripts/pre-release.js"
49
49
  },
50
50
  "devDependencies": {
51
- "@rollup/plugin-typescript": "^10.0.1",
52
- "@types/node": "16.18.96",
53
- "@types/prismjs": "^1.26.0",
54
- "@typescript-eslint/eslint-plugin": "5.62.0",
55
- "@typescript-eslint/parser": "5.62.0",
56
- "cypress": "13.6.0",
51
+ "@eslint/js": "^10.0.1",
52
+ "@rollup/plugin-typescript": "^12.3.0",
53
+ "@types/jsdom": "^28.0.1",
54
+ "@types/node": "^24.0.0",
55
+ "@types/prismjs": "^1.26.6",
56
+ "@typescript-eslint/eslint-plugin": "^8.59.1",
57
+ "@typescript-eslint/parser": "^8.59.1",
58
+ "@vitest/coverage-v8": "^4.1.5",
59
+ "cypress": "^15.14.2",
57
60
  "cypress-file-upload": "^5.0.8",
58
- "eslint": "7.32.0",
59
- "simple-git-hooks": "^2.8.1",
60
- "typescript": "4.9.5",
61
- "vite": "^2.4.2",
62
- "vite-plugin-css-injected-by-js": "^2.1.1",
63
- "vitepress": "1.0.0-beta.6",
64
- "vue": "^3.2.45"
61
+ "eslint": "^10.3.0",
62
+ "globals": "^17.6.0",
63
+ "jsdom": "^29.1.1",
64
+ "simple-git-hooks": "^2.13.1",
65
+ "tslib": "^2.8.1",
66
+ "typescript": "^6.0.3",
67
+ "typescript-eslint": "^8.59.1",
68
+ "vite": "^8.0.10",
69
+ "vite-plugin-css-injected-by-js": "^5.0.1",
70
+ "vitepress": "^1.6.4",
71
+ "vitest": "^4.1.5",
72
+ "vitest-canvas-mock": "^1.1.4",
73
+ "vue": "^3.5.33"
65
74
  },
66
75
  "simple-git-hooks": {
67
76
  "pre-commit": "npm run lint && npm run type:check",
68
77
  "commit-msg": "node scripts/verifyCommit.js"
69
78
  }
70
- }
79
+ }