@hufe921/canvas-editor 0.9.61 → 0.9.62
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 +24 -0
- package/dist/canvas-editor.es.js +380 -99
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +37 -37
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/draw/frame/Background.d.ts +4 -0
- package/dist/src/editor/core/draw/particle/TextParticle.d.ts +1 -0
- package/dist/src/editor/dataset/constant/Background.d.ts +2 -0
- package/dist/src/editor/dataset/constant/ContextMenu.d.ts +3 -0
- package/dist/src/editor/dataset/enum/Background.d.ts +10 -0
- package/dist/src/editor/dataset/enum/table/Table.d.ts +4 -1
- package/dist/src/editor/index.d.ts +2 -1
- package/dist/src/editor/interface/Background.d.ts +7 -0
- package/dist/src/editor/interface/Editor.d.ts +3 -1
- package/package.json +1 -1
|
@@ -2,6 +2,10 @@ import { Draw } from '../Draw';
|
|
|
2
2
|
export declare class Background {
|
|
3
3
|
private draw;
|
|
4
4
|
private options;
|
|
5
|
+
private imageCache;
|
|
5
6
|
constructor(draw: Draw);
|
|
7
|
+
private _renderBackgroundColor;
|
|
8
|
+
private _drawImage;
|
|
9
|
+
private _renderBackgroundImage;
|
|
6
10
|
render(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
7
11
|
}
|
|
@@ -30,7 +30,10 @@ export declare const INTERNAL_CONTEXT_MENU_KEY: {
|
|
|
30
30
|
BORDER_EMPTY: string;
|
|
31
31
|
BORDER_EXTERNAL: string;
|
|
32
32
|
BORDER_TD: string;
|
|
33
|
+
BORDER_TD_TOP: string;
|
|
34
|
+
BORDER_TD_RIGHT: string;
|
|
33
35
|
BORDER_TD_BOTTOM: string;
|
|
36
|
+
BORDER_TD_LEFT: string;
|
|
34
37
|
BORDER_TD_FORWARD: string;
|
|
35
38
|
BORDER_TD_BACK: string;
|
|
36
39
|
VERTICAL_ALIGN: string;
|
|
@@ -31,6 +31,7 @@ import { LETTER_CLASS } from './dataset/constant/Common';
|
|
|
31
31
|
import { INTERNAL_CONTEXT_MENU_KEY } from './dataset/constant/ContextMenu';
|
|
32
32
|
import { IRange } from './interface/Range';
|
|
33
33
|
import { splitText } from './utils';
|
|
34
|
+
import { BackgroundRepeat, BackgroundSize } from './dataset/enum/Background';
|
|
34
35
|
export default class Editor {
|
|
35
36
|
command: Command;
|
|
36
37
|
listener: Listener;
|
|
@@ -43,5 +44,5 @@ export default class Editor {
|
|
|
43
44
|
}
|
|
44
45
|
export { splitText };
|
|
45
46
|
export { EDITOR_COMPONENT, LETTER_CLASS, INTERNAL_CONTEXT_MENU_KEY };
|
|
46
|
-
export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, TdBorder, TdSlash, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle, WordBreak, ControlIndentation };
|
|
47
|
+
export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, TdBorder, TdSlash, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle, WordBreak, ControlIndentation, BackgroundRepeat, BackgroundSize };
|
|
47
48
|
export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRange, IRangeStyle };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IElement } from '..';
|
|
2
2
|
import { EditorMode, PageMode, PaperDirection, WordBreak } from '../dataset/enum/Editor';
|
|
3
|
+
import { IBackgroundOption } from './Background';
|
|
3
4
|
import { ICheckboxOption } from './Checkbox';
|
|
4
5
|
import { IPadding } from './Common';
|
|
5
6
|
import { IControlOption } from './Control';
|
|
@@ -22,6 +23,7 @@ export interface IEditorData {
|
|
|
22
23
|
export interface IEditorOption {
|
|
23
24
|
mode?: EditorMode;
|
|
24
25
|
defaultType?: string;
|
|
26
|
+
defaultColor?: string;
|
|
25
27
|
defaultFont?: string;
|
|
26
28
|
defaultSize?: number;
|
|
27
29
|
minSize?: number;
|
|
@@ -33,7 +35,6 @@ export interface IEditorOption {
|
|
|
33
35
|
height?: number;
|
|
34
36
|
scale?: number;
|
|
35
37
|
pageGap?: number;
|
|
36
|
-
backgroundColor?: string;
|
|
37
38
|
underlineColor?: string;
|
|
38
39
|
strikeoutColor?: string;
|
|
39
40
|
rangeColor?: string;
|
|
@@ -74,6 +75,7 @@ export interface IEditorOption {
|
|
|
74
75
|
group?: IGroup;
|
|
75
76
|
pageBreak?: IPageBreak;
|
|
76
77
|
zone?: IZoneOption;
|
|
78
|
+
background?: IBackgroundOption;
|
|
77
79
|
}
|
|
78
80
|
export interface IEditorResult {
|
|
79
81
|
version: string;
|