@hufe921/canvas-editor 0.9.47 → 0.9.48

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.
@@ -83,6 +83,8 @@ export declare class Draw {
83
83
  private scrollObserver;
84
84
  private selectionObserver;
85
85
  private imageObserver;
86
+ private LETTER_REG;
87
+ private WORD_LIKE_REG;
86
88
  private rowList;
87
89
  private pageRowList;
88
90
  private painterStyle;
@@ -92,6 +94,7 @@ export declare class Draw {
92
94
  private lazyRenderIntersectionObserver;
93
95
  private printModeData;
94
96
  constructor(rootContainer: HTMLElement, options: DeepRequired<IEditorOption>, data: IEditorData, listener: Listener, eventBus: EventBus<EventBusMap>, override: Override);
97
+ getLetterReg(): RegExp;
95
98
  getMode(): EditorMode;
96
99
  setMode(payload: EditorMode): void;
97
100
  isReadonly(): boolean;
@@ -6,6 +6,7 @@ export interface IMeasureWordResult {
6
6
  endElement: IElement;
7
7
  }
8
8
  export declare class TextParticle {
9
+ private draw;
9
10
  private ctx;
10
11
  private curX;
11
12
  private curY;
@@ -6,3 +6,15 @@ export declare const NBSP = " ";
6
6
  export declare const NON_BREAKING_SPACE = "&nbsp;";
7
7
  export declare const PUNCTUATION_LIST: string[];
8
8
  export declare const maxHeightRadioMapping: Record<MaxHeightRatio, number>;
9
+ export declare const LETTER_CLASS: {
10
+ ENGLISH: string;
11
+ SPANISH: string;
12
+ FRENCH: string;
13
+ GERMAN: string;
14
+ RUSSIAN: string;
15
+ PORTUGUESE: string;
16
+ ITALIAN: string;
17
+ DUTCH: string;
18
+ SWEDISH: string;
19
+ GREEK: string;
20
+ };
@@ -1,8 +1,6 @@
1
1
  export declare const NUMBER_REG: RegExp;
2
- export declare const LETTER_REG: RegExp;
3
2
  export declare const NUMBER_LIKE_REG: RegExp;
4
3
  export declare const CHINESE_REG: RegExp;
5
- export declare const WORD_LIKE_REG: RegExp;
6
4
  export declare const SURROGATE_PAIR_REG: RegExp;
7
5
  export declare const EMOJI_REG: RegExp;
8
6
  export declare const UNICODE_SYMBOL_REG: RegExp;
@@ -27,6 +27,7 @@ import { EventBus } from './core/event/eventbus/EventBus';
27
27
  import { EventBusMap } from './interface/EventBus';
28
28
  import { IRangeStyle } from './interface/Listener';
29
29
  import { Override } from './core/override/Override';
30
+ import { LETTER_CLASS } from './dataset/constant/Common';
30
31
  export default class Editor {
31
32
  command: Command;
32
33
  listener: Listener;
@@ -37,5 +38,5 @@ export default class Editor {
37
38
  use: UsePlugin;
38
39
  constructor(container: HTMLDivElement, data: IEditorData | IElement[], options?: IEditorOption);
39
40
  }
40
- export { Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, EDITOR_COMPONENT, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, TdBorder, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle, WordBreak };
41
+ export { EDITOR_COMPONENT, LETTER_CLASS, Editor, RowFlex, VerticalAlign, EditorZone, EditorMode, ElementType, ControlType, EditorComponent, PageMode, ImageDisplay, Command, KeyMap, BlockType, PaperDirection, TableBorder, TdBorder, MaxHeightRatio, NumberType, TitleLevel, ListType, ListStyle, WordBreak };
41
42
  export type { IElement, IEditorData, IEditorOption, IEditorResult, IContextMenuContext, IRegisterContextMenu, IWatermark, INavigateInfo, IBlock, ILang, ICatalog, ICatalogItem, IRangeStyle };
@@ -23,6 +23,8 @@ export interface IControlBasic {
23
23
  conceptId?: string;
24
24
  prefix?: string;
25
25
  postfix?: string;
26
+ minWidth?: number;
27
+ underline?: boolean;
26
28
  }
27
29
  export declare type IControl = IControlBasic & Partial<IControlSelect> & Partial<IControlCheckbox>;
28
30
  export interface IControlOption {
@@ -56,6 +56,7 @@ export interface IEditorOption {
56
56
  historyMaxRecordCount?: number;
57
57
  printPixelRatio?: number;
58
58
  maskMargin?: IMargin;
59
+ letterClass?: string[];
59
60
  wordBreak?: WordBreak;
60
61
  header?: IHeader;
61
62
  footer?: IFooter;
@@ -102,6 +102,7 @@ export interface IElementPosition {
102
102
  rowNo: number;
103
103
  ascent: number;
104
104
  lineHeight: number;
105
+ left: number;
105
106
  metrics: IElementMetrics;
106
107
  isFirstLetter: boolean;
107
108
  isLastLetter: boolean;
@@ -3,6 +3,7 @@ import { IElement, IElementMetrics } from './Element';
3
3
  export declare type IRowElement = IElement & {
4
4
  metrics: IElementMetrics;
5
5
  style: string;
6
+ left?: number;
6
7
  };
7
8
  export interface IRow {
8
9
  width: number;
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.47",
5
+ "version": "0.9.48",
6
6
  "description": "rich text editor by canvas/svg",
7
7
  "publishConfig": {
8
8
  "registry": "https://registry.npmjs.org/",