@hufe921/canvas-editor 0.9.132 → 0.9.134
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 +52 -0
- package/README.md +166 -53
- package/dist/assets/catalog-Cno2frQt.js.map +1 -0
- package/dist/assets/group-Bz5rW3In.js.map +1 -0
- package/dist/assets/value-CEZhhW6y.js.map +1 -0
- package/dist/assets/wordCount-C2BnvS6l.js.map +1 -0
- package/dist/canvas-editor.js +17397 -0
- package/dist/canvas-editor.js.map +1 -0
- package/dist/canvas-editor.umd.cjs +76 -0
- package/dist/canvas-editor.umd.cjs.map +1 -0
- package/dist/src/editor/core/draw/particle/date/DatePicker.d.ts +25 -0
- package/dist/src/editor/core/position/Position.d.ts +5 -0
- package/dist/src/editor/dataset/constant/Editor.d.ts +1 -1
- package/dist/src/editor/dataset/enum/Area.d.ts +2 -2
- package/dist/src/editor/dataset/enum/Control.d.ts +1 -1
- package/dist/src/editor/dataset/enum/DatePicker.d.ts +5 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +6 -6
- package/dist/src/editor/dataset/enum/List.d.ts +3 -3
- package/dist/src/editor/dataset/enum/table/Table.d.ts +1 -1
- package/dist/src/editor/interface/Editor.d.ts +1 -0
- package/dist/src/editor/interface/Position.d.ts +1 -0
- package/dist/src/editor/utils/element.d.ts +1 -1
- package/package.json +34 -25
- package/dist/canvas-editor.es.js +0 -25353
- package/dist/canvas-editor.es.js.map +0 -1
- package/dist/canvas-editor.umd.js +0 -102
- package/dist/canvas-editor.umd.js.map +0 -1
|
@@ -16,6 +16,20 @@ export interface IDatePickerLang {
|
|
|
16
16
|
};
|
|
17
17
|
year: string;
|
|
18
18
|
month: string;
|
|
19
|
+
months: {
|
|
20
|
+
jan: string;
|
|
21
|
+
feb: string;
|
|
22
|
+
mar: string;
|
|
23
|
+
apr: string;
|
|
24
|
+
may: string;
|
|
25
|
+
jun: string;
|
|
26
|
+
jul: string;
|
|
27
|
+
aug: string;
|
|
28
|
+
sep: string;
|
|
29
|
+
oct: string;
|
|
30
|
+
nov: string;
|
|
31
|
+
dec: string;
|
|
32
|
+
};
|
|
19
33
|
hour: string;
|
|
20
34
|
minute: string;
|
|
21
35
|
second: string;
|
|
@@ -37,15 +51,24 @@ export declare class DatePicker {
|
|
|
37
51
|
private isDatePicker;
|
|
38
52
|
private pickDate;
|
|
39
53
|
private lang;
|
|
54
|
+
private datePickerType;
|
|
55
|
+
private viewMode;
|
|
56
|
+
private yearPageStart;
|
|
40
57
|
constructor(draw: Draw, options?: IDatePickerOption);
|
|
41
58
|
private _createDom;
|
|
42
59
|
private _bindEvent;
|
|
43
60
|
private _setPosition;
|
|
44
61
|
isInvalidDate(value: Date): boolean;
|
|
45
62
|
private _setValue;
|
|
63
|
+
private _getDatePickerType;
|
|
46
64
|
private _getLang;
|
|
47
65
|
private _setLangChange;
|
|
48
66
|
private _update;
|
|
67
|
+
private _updateTitleVisibility;
|
|
68
|
+
private _updateDateView;
|
|
69
|
+
private _updateYearView;
|
|
70
|
+
private _updateMonthView;
|
|
71
|
+
private _switchView;
|
|
49
72
|
private _toggleDateTimePicker;
|
|
50
73
|
private _setDatePick;
|
|
51
74
|
private _setTimePick;
|
|
@@ -53,6 +76,8 @@ export declare class DatePicker {
|
|
|
53
76
|
private _nextMonth;
|
|
54
77
|
private _preYear;
|
|
55
78
|
private _nextYear;
|
|
79
|
+
private _preYearPage;
|
|
80
|
+
private _nextYearPage;
|
|
56
81
|
private _now;
|
|
57
82
|
private _toggleVisible;
|
|
58
83
|
private _submit;
|
|
@@ -20,6 +20,11 @@ export declare class Position {
|
|
|
20
20
|
getSelectionPositionList(): IElementPosition[] | null;
|
|
21
21
|
setPositionList(payload: IElementPosition[]): void;
|
|
22
22
|
setFloatPositionList(payload: IFloatPosition[]): void;
|
|
23
|
+
getFloatPositionByElement(element: IElement): IFloatPosition | null;
|
|
24
|
+
getFloatPositionCoordinate(floatPosition: IFloatPosition): {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
};
|
|
23
28
|
computePageRowPosition(payload: IComputePageRowPositionPayload): IComputePageRowPositionResult;
|
|
24
29
|
computePositionList(): void;
|
|
25
30
|
computeRowPosition(payload: IComputeRowPositionPayload): IElementPosition[];
|
|
@@ -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
|
|
5
|
+
export declare const EDITOR_CLIPBOARD = "ce-clipboard";
|
|
6
6
|
export declare const defaultModeRuleOption: Readonly<DeepRequired<IModeRule>>;
|
|
@@ -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 {
|
|
@@ -132,6 +132,7 @@ export interface IPrintModeRule {
|
|
|
132
132
|
imagePreviewerDisabled?: boolean;
|
|
133
133
|
backgroundDisabled?: boolean;
|
|
134
134
|
filterEmptyControl?: boolean;
|
|
135
|
+
filterHideElementRow?: boolean;
|
|
135
136
|
}
|
|
136
137
|
export interface IReadonlyModeRule {
|
|
137
138
|
imagePreviewerDisabled?: boolean;
|
|
@@ -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
|
|
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,8 +2,8 @@
|
|
|
2
2
|
"name": "@hufe921/canvas-editor",
|
|
3
3
|
"author": "Hufe",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "0.9.
|
|
6
|
-
"description": "rich text editor
|
|
5
|
+
"version": "0.9.134",
|
|
6
|
+
"description": "A Canvas/SVG-based rich text editor",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"registry": "https://registry.npmjs.org/",
|
|
9
9
|
"access": "public"
|
|
@@ -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.
|
|
20
|
-
"module": "./dist/canvas-editor.
|
|
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": "
|
|
39
|
-
"build": "
|
|
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
|
-
"@
|
|
52
|
-
"@
|
|
53
|
-
"@types/
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"
|
|
51
|
+
"@eslint/js": "^10.0.1",
|
|
52
|
+
"@rollup/plugin-typescript": "^12.3.0",
|
|
53
|
+
"@types/jsdom": "^28.0.3",
|
|
54
|
+
"@types/node": "^24.12.4",
|
|
55
|
+
"@types/prismjs": "^1.26.6",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^8.59.3",
|
|
57
|
+
"@typescript-eslint/parser": "^8.59.3",
|
|
58
|
+
"@vitest/coverage-v8": "^4.1.6",
|
|
59
|
+
"cypress": "^15.15.0",
|
|
57
60
|
"cypress-file-upload": "^5.0.8",
|
|
58
|
-
"eslint": "
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
61
|
+
"eslint": "^10.4.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.3",
|
|
68
|
+
"vite": "^8.0.13",
|
|
69
|
+
"vite-plugin-css-injected-by-js": "^5.0.1",
|
|
70
|
+
"vitepress": "^1.6.4",
|
|
71
|
+
"vitest": "^4.1.6",
|
|
72
|
+
"vitest-canvas-mock": "^1.1.4",
|
|
73
|
+
"vue": "^3.5.34"
|
|
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
|
+
}
|