@hufe921/canvas-editor 0.9.134 → 0.9.136
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 +38 -0
- package/dist/assets/{catalog-Cno2frQt.js.map → catalog-B-cbxN0s.js.map} +1 -1
- package/dist/assets/{group-Bz5rW3In.js.map → group-BZtj1M7o.js.map} +1 -1
- package/dist/assets/{value-CEZhhW6y.js.map → value-By4_Dx3W.js.map} +1 -1
- package/dist/assets/{wordCount-C2BnvS6l.js.map → wordCount-Osi0e4qK.js.map} +1 -1
- package/dist/canvas-editor.js +1717 -1533
- package/dist/canvas-editor.js.map +1 -1
- package/dist/canvas-editor.umd.cjs +32 -32
- package/dist/canvas-editor.umd.cjs.map +1 -1
- package/dist/src/editor/core/accessibility/Accessibility.d.ts +14 -0
- package/dist/src/editor/core/draw/Draw.d.ts +5 -1
- package/dist/src/editor/core/draw/frame/Footer.d.ts +4 -3
- package/dist/src/editor/core/draw/frame/Header.d.ts +4 -3
- package/dist/src/editor/core/draw/interactive/Search.d.ts +2 -1
- package/dist/src/editor/core/position/Position.d.ts +5 -0
- package/dist/src/editor/core/zone/Zone.d.ts +1 -1
- package/dist/src/editor/dataset/constant/Accessibility.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Element.d.ts +1 -0
- package/dist/src/editor/interface/Accessibility.d.ts +3 -0
- package/dist/src/editor/interface/Draw.d.ts +0 -1
- package/dist/src/editor/interface/Editor.d.ts +2 -0
- package/dist/src/editor/interface/Element.d.ts +3 -0
- package/dist/src/editor/interface/EventBus.d.ts +2 -1
- package/dist/src/editor/interface/Footer.d.ts +1 -0
- package/dist/src/editor/interface/Header.d.ts +1 -0
- package/dist/src/editor/interface/Listener.d.ts +2 -0
- package/dist/src/editor/interface/Position.d.ts +10 -0
- package/dist/src/editor/interface/i18n/Accessibility.d.ts +4 -0
- package/dist/src/editor/interface/i18n/I18n.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Draw } from '../draw/Draw';
|
|
2
|
+
export declare class Accessibility {
|
|
3
|
+
private draw;
|
|
4
|
+
private i18n;
|
|
5
|
+
private disabled;
|
|
6
|
+
private assertiveDom;
|
|
7
|
+
private rangeChangeHandler;
|
|
8
|
+
constructor(draw: Draw);
|
|
9
|
+
private handleRangeChange;
|
|
10
|
+
selection(): void;
|
|
11
|
+
input(data: string): void;
|
|
12
|
+
assertive(message: string): void;
|
|
13
|
+
destroy(): void;
|
|
14
|
+
}
|
|
@@ -42,6 +42,7 @@ import { Area } from './interactive/Area';
|
|
|
42
42
|
import { Badge } from './frame/Badge';
|
|
43
43
|
import { Graffiti } from './graffiti/Graffiti';
|
|
44
44
|
import { Magnifier } from './interactive/Magnifier';
|
|
45
|
+
import { Accessibility } from '../accessibility/Accessibility';
|
|
45
46
|
export declare class Draw {
|
|
46
47
|
private container;
|
|
47
48
|
private pageContainer;
|
|
@@ -107,6 +108,7 @@ export declare class Draw {
|
|
|
107
108
|
private selectionObserver;
|
|
108
109
|
private imageObserver;
|
|
109
110
|
private graffiti;
|
|
111
|
+
private accessibility;
|
|
110
112
|
private LETTER_REG;
|
|
111
113
|
private WORD_LIKE_REG;
|
|
112
114
|
private rowList;
|
|
@@ -117,6 +119,7 @@ export declare class Draw {
|
|
|
117
119
|
private intersectionPageNo;
|
|
118
120
|
private lazyRenderIntersectionObserver;
|
|
119
121
|
private printModeData;
|
|
122
|
+
private controlMinWidthPlaceholderElementListSet;
|
|
120
123
|
constructor(rootContainer: HTMLElement, options: DeepRequired<IEditorOption>, data: IEditorData, listener: Listener, eventBus: EventBus<EventBusMap>, override: Override);
|
|
121
124
|
setPrintData(): void;
|
|
122
125
|
clearPrintData(): void;
|
|
@@ -133,7 +136,7 @@ export declare class Draw {
|
|
|
133
136
|
getWidth(): number;
|
|
134
137
|
getHeight(): number;
|
|
135
138
|
getMainHeight(): number;
|
|
136
|
-
getMainOuterHeight(): number;
|
|
139
|
+
getMainOuterHeight(pageNo?: number): number;
|
|
137
140
|
getCanvasWidth(pageNo?: number): number;
|
|
138
141
|
getCanvasHeight(pageNo?: number): number;
|
|
139
142
|
getInnerWidth(): number;
|
|
@@ -212,6 +215,7 @@ export declare class Draw {
|
|
|
212
215
|
getImageObserver(): ImageObserver;
|
|
213
216
|
getI18n(): I18n;
|
|
214
217
|
getGraffiti(): Graffiti;
|
|
218
|
+
getAccessibility(): Accessibility;
|
|
215
219
|
getRowCount(): number;
|
|
216
220
|
getDataURL(payload?: IGetImageOption): Promise<string[]>;
|
|
217
221
|
getPainterStyle(): IElementStyle | null;
|
|
@@ -18,10 +18,11 @@ export declare class Footer {
|
|
|
18
18
|
recovery(): void;
|
|
19
19
|
private _computeRowList;
|
|
20
20
|
private _computePositionList;
|
|
21
|
-
getFooterBottom(): number;
|
|
21
|
+
getFooterBottom(pageNo?: number): number;
|
|
22
22
|
getMaxHeight(): number;
|
|
23
|
-
getHeight(): number;
|
|
23
|
+
getHeight(pageNo?: number): number;
|
|
24
24
|
getRowHeight(): number;
|
|
25
|
-
getExtraHeight(): number;
|
|
25
|
+
getExtraHeight(pageNo?: number): number;
|
|
26
|
+
isDisabled(pageNo?: number): boolean;
|
|
26
27
|
render(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
27
28
|
}
|
|
@@ -18,10 +18,11 @@ export declare class Header {
|
|
|
18
18
|
recovery(): void;
|
|
19
19
|
private _computeRowList;
|
|
20
20
|
private _computePositionList;
|
|
21
|
-
getHeaderTop(): number;
|
|
21
|
+
getHeaderTop(pageNo?: number): number;
|
|
22
22
|
getMaxHeight(): number;
|
|
23
|
-
getHeight(): number;
|
|
23
|
+
getHeight(pageNo?: number): number;
|
|
24
24
|
getRowHeight(): number;
|
|
25
|
-
getExtraHeight(): number;
|
|
25
|
+
getExtraHeight(pageNo?: number): number;
|
|
26
|
+
isDisabled(pageNo?: number): boolean;
|
|
26
27
|
render(ctx: CanvasRenderingContext2D, pageNo: number): void;
|
|
27
28
|
}
|
|
@@ -17,10 +17,11 @@ export declare class Search {
|
|
|
17
17
|
constructor(draw: Draw);
|
|
18
18
|
getSearchKeyword(): string | null;
|
|
19
19
|
setSearchKeyword(payload: string | null, options?: ISearchOption): void;
|
|
20
|
+
private getSearchMatchGroupStartIndex;
|
|
20
21
|
searchNavigatePre(): number | null;
|
|
21
22
|
searchNavigateNext(): number | null;
|
|
22
23
|
searchNavigateScrollIntoView(position: IElementPosition): void;
|
|
23
|
-
getSearchNavigateIndexList():
|
|
24
|
+
getSearchNavigateIndexList(): number[];
|
|
24
25
|
getSearchMatchList(): ISearchResult[];
|
|
25
26
|
getSearchNavigateInfo(): null | INavigateInfo;
|
|
26
27
|
getMatchList(payload: string, originalElementList: IElement[]): ISearchResult[];
|
|
@@ -13,6 +13,11 @@ export declare class Position {
|
|
|
13
13
|
constructor(draw: Draw);
|
|
14
14
|
getFloatPositionList(): IFloatPosition[];
|
|
15
15
|
getTablePositionList(sourceElementList: IElement[]): IElementPosition[];
|
|
16
|
+
getTableTdByContext(sourceElementList: IElement[], context: IPositionContext): import("../../interface/table/Td").ITd | null;
|
|
17
|
+
buildTablePositionContext(context: IPositionContext, element: IElement, trIndex: number, tdIndex: number): IPositionContext;
|
|
18
|
+
getTableElementByContext(sourceElementList: IElement[], context: IPositionContext): IElement | null;
|
|
19
|
+
getTableElementPositionByContext(sourceElementList: IElement[], sourcePositionList: IElementPosition[], context: IPositionContext): IElementPosition | null;
|
|
20
|
+
private _getTablePathByContext;
|
|
16
21
|
getPositionList(): IElementPosition[];
|
|
17
22
|
getMainPositionList(): IElementPosition[];
|
|
18
23
|
getOriginalPositionList(): IElementPosition[];
|
|
@@ -15,7 +15,7 @@ export declare class Zone {
|
|
|
15
15
|
isFooterActive(): boolean;
|
|
16
16
|
getZone(): EditorZone;
|
|
17
17
|
setZone(payload: EditorZone): void;
|
|
18
|
-
getZoneByY(y: number): EditorZone;
|
|
18
|
+
getZoneByY(y: number, pageNo?: number): EditorZone;
|
|
19
19
|
drawZoneIndicator(): void;
|
|
20
20
|
private _clearZoneIndicator;
|
|
21
21
|
}
|
|
@@ -4,6 +4,7 @@ import { ITd } from '../../interface/table/Td';
|
|
|
4
4
|
import { IControlStyle } from '../../interface/Control';
|
|
5
5
|
export declare const EDITOR_ELEMENT_STYLE_ATTR: Array<keyof IElement>;
|
|
6
6
|
export declare const EDITOR_ROW_ATTR: Array<keyof IElement>;
|
|
7
|
+
export declare const EDITOR_ELEMENT_PARAGRAPH_STYLE_ATTR: Array<keyof IElement>;
|
|
7
8
|
export declare const EDITOR_ELEMENT_COPY_ATTR: Array<keyof IElement>;
|
|
8
9
|
export declare const EDITOR_ELEMENT_ZIP_ATTR: Array<keyof IElement>;
|
|
9
10
|
export declare const TABLE_TD_ZIP_ATTR: Array<keyof ITd>;
|
|
@@ -28,6 +28,7 @@ import { IRange } from './Range';
|
|
|
28
28
|
import { IGraffitiData, IGraffitiOption } from './Graffiti';
|
|
29
29
|
import { IWhiteSpaceOption } from './WhiteSpace';
|
|
30
30
|
import { IMagnifierOption } from './Magnifier';
|
|
31
|
+
import { IAccessibilityOption } from './Accessibility';
|
|
31
32
|
export interface IEditorData {
|
|
32
33
|
header?: IElement[];
|
|
33
34
|
main: IElement[];
|
|
@@ -106,6 +107,7 @@ export interface IEditorOption {
|
|
|
106
107
|
imgCaption?: IImgCaptionOption;
|
|
107
108
|
list?: IListOption;
|
|
108
109
|
magnifier?: IMagnifierOption;
|
|
110
|
+
accessibility?: IAccessibilityOption;
|
|
109
111
|
}
|
|
110
112
|
export interface IEditorResult {
|
|
111
113
|
version: string;
|
|
@@ -35,6 +35,8 @@ export interface IElementStyle {
|
|
|
35
35
|
strikeout?: boolean;
|
|
36
36
|
rowFlex?: RowFlex;
|
|
37
37
|
rowMargin?: number;
|
|
38
|
+
level?: TitleLevel;
|
|
39
|
+
title?: ITitle;
|
|
38
40
|
letterSpacing?: number;
|
|
39
41
|
textDecoration?: ITextDecoration;
|
|
40
42
|
}
|
|
@@ -94,6 +96,7 @@ export interface IControlElement {
|
|
|
94
96
|
control?: IControl;
|
|
95
97
|
controlId?: string;
|
|
96
98
|
controlComponent?: ControlComponent;
|
|
99
|
+
isControlMinWidthPlaceholder?: boolean;
|
|
97
100
|
}
|
|
98
101
|
export interface ICheckboxElement {
|
|
99
102
|
checkbox?: ICheckbox;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IContentChange, IControlChange, IControlContentChange, IImageDblclick, IImageMousedown, IImageSizeChange, IInputEventChange, IIntersectionPageNoChange, ILabelMousedown, IMouseEventChange, IPageModeChange, IPageScaleChange, IPageSizeChange, IPositionContextChange, IRangeStyleChange, ISaved, IVisiblePageNoListChange, IZoneChange } from './Listener';
|
|
1
|
+
import { IContentChange, IControlChange, IControlContentChange, IImageDblclick, IImageMousedown, IImageSizeChange, IInputEventChange, IIntersectionPageNoChange, ILabelMousedown, IMouseEventChange, IPageModeChange, IPageScaleChange, IPageSizeChange, IPositionContextChange, IRangeChange, IRangeStyleChange, ISaved, IVisiblePageNoListChange, IZoneChange } from './Listener';
|
|
2
2
|
export interface EventBusMap {
|
|
3
3
|
rangeStyleChange: IRangeStyleChange;
|
|
4
4
|
visiblePageNoListChange: IVisiblePageNoListChange;
|
|
@@ -23,4 +23,5 @@ export interface EventBusMap {
|
|
|
23
23
|
imageMousedown: IImageMousedown;
|
|
24
24
|
imageDblclick: IImageDblclick;
|
|
25
25
|
labelMousedown: ILabelMousedown;
|
|
26
|
+
rangeChange: IRangeChange;
|
|
26
27
|
}
|
|
@@ -7,6 +7,7 @@ import { IControlChangeResult, IControlContentChangeResult } from './Control';
|
|
|
7
7
|
import { IEditorResult } from './Editor';
|
|
8
8
|
import { IElement } from './Element';
|
|
9
9
|
import { IPositionContext } from './Position';
|
|
10
|
+
import { IRange } from './Range';
|
|
10
11
|
import { ITextDecoration } from './Text';
|
|
11
12
|
export interface IRangeStyle {
|
|
12
13
|
type: ElementType | null;
|
|
@@ -64,3 +65,4 @@ export type ILabelMousedown = (payload: {
|
|
|
64
65
|
evt: MouseEvent;
|
|
65
66
|
element: IElement;
|
|
66
67
|
}) => void;
|
|
68
|
+
export type IRangeChange = (payload: IRange) => void;
|
|
@@ -21,6 +21,7 @@ export interface ICurrentPosition {
|
|
|
21
21
|
tdId?: string;
|
|
22
22
|
trId?: string;
|
|
23
23
|
tableId?: string;
|
|
24
|
+
tablePath?: ITablePositionContext[];
|
|
24
25
|
zone?: EditorZone;
|
|
25
26
|
hitLineStartIndex?: number;
|
|
26
27
|
}
|
|
@@ -51,6 +52,15 @@ export interface IPositionContext {
|
|
|
51
52
|
tdId?: string;
|
|
52
53
|
trId?: string;
|
|
53
54
|
tableId?: string;
|
|
55
|
+
tablePath?: ITablePositionContext[];
|
|
56
|
+
}
|
|
57
|
+
export interface ITablePositionContext {
|
|
58
|
+
index: number;
|
|
59
|
+
trIndex: number;
|
|
60
|
+
tdIndex: number;
|
|
61
|
+
tdId?: string;
|
|
62
|
+
trId?: string;
|
|
63
|
+
tableId?: string;
|
|
54
64
|
}
|
|
55
65
|
export interface IComputeRowPositionPayload {
|
|
56
66
|
row: IRow;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { IDatePickerLang } from '../../core/draw/particle/date/DatePicker';
|
|
2
2
|
import { IContextmenuLang } from '../contextmenu/ContextMenu';
|
|
3
|
+
import { IAccessibilityLang } from './Accessibility';
|
|
3
4
|
export interface ILang {
|
|
4
5
|
contextmenu: IContextmenuLang;
|
|
5
6
|
datePicker: IDatePickerLang;
|
|
7
|
+
accessibility: IAccessibilityLang;
|
|
6
8
|
}
|
package/package.json
CHANGED