@hufe921/canvas-editor 0.9.134 → 0.9.135

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.
@@ -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;
@@ -212,6 +214,7 @@ export declare class Draw {
212
214
  getImageObserver(): ImageObserver;
213
215
  getI18n(): I18n;
214
216
  getGraffiti(): Graffiti;
217
+ getAccessibility(): Accessibility;
215
218
  getRowCount(): number;
216
219
  getDataURL(payload?: IGetImageOption): Promise<string[]>;
217
220
  getPainterStyle(): IElementStyle | null;
@@ -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(): any[];
24
+ getSearchNavigateIndexList(): number[];
24
25
  getSearchMatchList(): ISearchResult[];
25
26
  getSearchNavigateInfo(): null | INavigateInfo;
26
27
  getMatchList(payload: string, originalElementList: IElement[]): ISearchResult[];
@@ -0,0 +1,2 @@
1
+ import { IAccessibilityOption } from '../../interface/Accessibility';
2
+ export declare const defaultAccessibilityOption: Readonly<Required<IAccessibilityOption>>;
@@ -0,0 +1,3 @@
1
+ export interface IAccessibilityOption {
2
+ disabled?: boolean;
3
+ }
@@ -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;
@@ -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;
@@ -0,0 +1,4 @@
1
+ export interface IAccessibilityLang {
2
+ selected: string;
3
+ input: string;
4
+ }
@@ -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
@@ -2,7 +2,7 @@
2
2
  "name": "@hufe921/canvas-editor",
3
3
  "author": "Hufe",
4
4
  "license": "MIT",
5
- "version": "0.9.134",
5
+ "version": "0.9.135",
6
6
  "description": "A Canvas/SVG-based rich text editor",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",