modern-text 1.9.0 → 1.9.1

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.
@@ -1,4 +1,4 @@
1
- import { ReactiveObject, PropertyDeclaration, NormalizedTextContent } from 'modern-idoc';
1
+ import { PropertyAccessor, NormalizedTextContent } from 'modern-idoc';
2
2
  import { T as Text } from '../shared/modern-text.WbWB6f3d.cjs';
3
3
  import 'modern-font';
4
4
  import 'modern-path2d';
@@ -18,61 +18,67 @@ interface IndexCharacter {
18
18
  isLastSelected?: boolean;
19
19
  isCrlf?: boolean;
20
20
  }
21
- declare class TextEditor extends HTMLElement implements ReactiveObject {
21
+ declare class TextEditor extends HTMLElement implements PropertyAccessor {
22
+ left: number;
23
+ top: number;
22
24
  selection: number[];
23
- selectionMinMax: {
25
+ protected _selectionMinMax: {
24
26
  min: number;
25
27
  max: number;
26
28
  };
27
- chars: IndexCharacter[];
28
- selectedChars: IndexCharacter[];
29
- cursorPosition?: {
29
+ protected _chars: IndexCharacter[];
30
+ protected _selectedChars: IndexCharacter[];
31
+ protected _cursorPosition?: {
30
32
  left: number;
31
33
  top: number;
32
34
  width: number;
33
35
  height: number;
34
36
  color: string;
35
37
  };
36
- showCursor: boolean;
37
- prevSelection: number[];
38
- composition: boolean;
38
+ protected _showCursor: boolean;
39
+ protected _prevSelection: number[];
40
+ protected _composition: boolean;
41
+ get composition(): boolean;
42
+ protected static _defined: boolean;
39
43
  static register(): void;
40
44
  protected _text: Text;
41
45
  get text(): Text;
42
- set text(value: Text);
46
+ set text(newText: Text);
43
47
  protected _oldText: string;
44
- $container: HTMLDivElement;
45
- $selection: HTMLDivElement;
46
- $textarea: HTMLTextAreaElement;
47
- $cursor: HTMLElement;
48
- onUpdateProperty(key: string, _newValue: unknown, _oldValue: unknown, _declaration: PropertyDeclaration): void;
49
- updateChars(): void;
50
- updateSelectedChars(): void;
51
- updateCursorPosition(): void;
48
+ protected _container: HTMLDivElement;
49
+ protected _selection: HTMLDivElement;
50
+ protected _textarea: HTMLTextAreaElement;
51
+ protected _cursor: HTMLElement;
52
52
  constructor();
53
+ connectedCallback(): void;
54
+ set(text: Text): void;
55
+ onUpdateProperty(key: string, _newValue: unknown, _oldValue: unknown): void;
56
+ protected _updateChars(): void;
57
+ protected _updateSelectedChars(): void;
58
+ protected _updateCursorPosition(): void;
53
59
  getPlaintext(): string;
54
- getNewContent(content: NormalizedTextContent, newString?: string, oldString?: string): NormalizedTextContent;
55
- setTextInput(newText: string): void;
56
- onInput(): void;
60
+ protected _getNewContent(content: NormalizedTextContent, newString?: string, oldString?: string): NormalizedTextContent;
61
+ protected _setTextInput(newText: string): void;
62
+ protected _onInput(): void;
57
63
  protected _timer?: any;
58
- onKeydown(e: KeyboardEvent): void;
59
- onFocus(): void;
60
- onBlur(): void;
61
- findNearest(options: {
64
+ protected _onKeydown(e: KeyboardEvent): void;
65
+ protected _onFocus(): void;
66
+ protected _onBlur(): void;
67
+ protected _findNearest(options: {
62
68
  x: number;
63
69
  y: number;
64
70
  xWeight?: number;
65
71
  yWeight?: number;
66
72
  }): number;
67
- updateSelectionByDom(): void;
68
- updateDomSelection(): void;
73
+ protected _updateSelectionByDom(): void;
74
+ protected _updateDomSelection(): void;
69
75
  protected _update(): void;
70
- bindEventListeners(): void;
71
- start(e: MouseEvent): boolean;
76
+ protected _bindEventListeners(): void;
77
+ pointerdown(e?: MouseEvent): boolean;
72
78
  attributeChangedCallback(name: string, _oldValue: any, newValue: any): void;
73
- emit(type: string, detail?: any): boolean;
74
- renderSelectRange(): void;
75
- renderCursor(): void;
79
+ protected _emit(type: string, detail?: any): boolean;
80
+ protected _renderSelectRange(): void;
81
+ protected _renderCursor(): void;
76
82
  }
77
83
 
78
84
  export { TextEditor };
@@ -1,4 +1,4 @@
1
- import { ReactiveObject, PropertyDeclaration, NormalizedTextContent } from 'modern-idoc';
1
+ import { PropertyAccessor, NormalizedTextContent } from 'modern-idoc';
2
2
  import { T as Text } from '../shared/modern-text.WbWB6f3d.mjs';
3
3
  import 'modern-font';
4
4
  import 'modern-path2d';
@@ -18,61 +18,67 @@ interface IndexCharacter {
18
18
  isLastSelected?: boolean;
19
19
  isCrlf?: boolean;
20
20
  }
21
- declare class TextEditor extends HTMLElement implements ReactiveObject {
21
+ declare class TextEditor extends HTMLElement implements PropertyAccessor {
22
+ left: number;
23
+ top: number;
22
24
  selection: number[];
23
- selectionMinMax: {
25
+ protected _selectionMinMax: {
24
26
  min: number;
25
27
  max: number;
26
28
  };
27
- chars: IndexCharacter[];
28
- selectedChars: IndexCharacter[];
29
- cursorPosition?: {
29
+ protected _chars: IndexCharacter[];
30
+ protected _selectedChars: IndexCharacter[];
31
+ protected _cursorPosition?: {
30
32
  left: number;
31
33
  top: number;
32
34
  width: number;
33
35
  height: number;
34
36
  color: string;
35
37
  };
36
- showCursor: boolean;
37
- prevSelection: number[];
38
- composition: boolean;
38
+ protected _showCursor: boolean;
39
+ protected _prevSelection: number[];
40
+ protected _composition: boolean;
41
+ get composition(): boolean;
42
+ protected static _defined: boolean;
39
43
  static register(): void;
40
44
  protected _text: Text;
41
45
  get text(): Text;
42
- set text(value: Text);
46
+ set text(newText: Text);
43
47
  protected _oldText: string;
44
- $container: HTMLDivElement;
45
- $selection: HTMLDivElement;
46
- $textarea: HTMLTextAreaElement;
47
- $cursor: HTMLElement;
48
- onUpdateProperty(key: string, _newValue: unknown, _oldValue: unknown, _declaration: PropertyDeclaration): void;
49
- updateChars(): void;
50
- updateSelectedChars(): void;
51
- updateCursorPosition(): void;
48
+ protected _container: HTMLDivElement;
49
+ protected _selection: HTMLDivElement;
50
+ protected _textarea: HTMLTextAreaElement;
51
+ protected _cursor: HTMLElement;
52
52
  constructor();
53
+ connectedCallback(): void;
54
+ set(text: Text): void;
55
+ onUpdateProperty(key: string, _newValue: unknown, _oldValue: unknown): void;
56
+ protected _updateChars(): void;
57
+ protected _updateSelectedChars(): void;
58
+ protected _updateCursorPosition(): void;
53
59
  getPlaintext(): string;
54
- getNewContent(content: NormalizedTextContent, newString?: string, oldString?: string): NormalizedTextContent;
55
- setTextInput(newText: string): void;
56
- onInput(): void;
60
+ protected _getNewContent(content: NormalizedTextContent, newString?: string, oldString?: string): NormalizedTextContent;
61
+ protected _setTextInput(newText: string): void;
62
+ protected _onInput(): void;
57
63
  protected _timer?: any;
58
- onKeydown(e: KeyboardEvent): void;
59
- onFocus(): void;
60
- onBlur(): void;
61
- findNearest(options: {
64
+ protected _onKeydown(e: KeyboardEvent): void;
65
+ protected _onFocus(): void;
66
+ protected _onBlur(): void;
67
+ protected _findNearest(options: {
62
68
  x: number;
63
69
  y: number;
64
70
  xWeight?: number;
65
71
  yWeight?: number;
66
72
  }): number;
67
- updateSelectionByDom(): void;
68
- updateDomSelection(): void;
73
+ protected _updateSelectionByDom(): void;
74
+ protected _updateDomSelection(): void;
69
75
  protected _update(): void;
70
- bindEventListeners(): void;
71
- start(e: MouseEvent): boolean;
76
+ protected _bindEventListeners(): void;
77
+ pointerdown(e?: MouseEvent): boolean;
72
78
  attributeChangedCallback(name: string, _oldValue: any, newValue: any): void;
73
- emit(type: string, detail?: any): boolean;
74
- renderSelectRange(): void;
75
- renderCursor(): void;
79
+ protected _emit(type: string, detail?: any): boolean;
80
+ protected _renderSelectRange(): void;
81
+ protected _renderCursor(): void;
76
82
  }
77
83
 
78
84
  export { TextEditor };
@@ -1,4 +1,4 @@
1
- import { ReactiveObject, PropertyDeclaration, NormalizedTextContent } from 'modern-idoc';
1
+ import { PropertyAccessor, NormalizedTextContent } from 'modern-idoc';
2
2
  import { T as Text } from '../shared/modern-text.WbWB6f3d.js';
3
3
  import 'modern-font';
4
4
  import 'modern-path2d';
@@ -18,61 +18,67 @@ interface IndexCharacter {
18
18
  isLastSelected?: boolean;
19
19
  isCrlf?: boolean;
20
20
  }
21
- declare class TextEditor extends HTMLElement implements ReactiveObject {
21
+ declare class TextEditor extends HTMLElement implements PropertyAccessor {
22
+ left: number;
23
+ top: number;
22
24
  selection: number[];
23
- selectionMinMax: {
25
+ protected _selectionMinMax: {
24
26
  min: number;
25
27
  max: number;
26
28
  };
27
- chars: IndexCharacter[];
28
- selectedChars: IndexCharacter[];
29
- cursorPosition?: {
29
+ protected _chars: IndexCharacter[];
30
+ protected _selectedChars: IndexCharacter[];
31
+ protected _cursorPosition?: {
30
32
  left: number;
31
33
  top: number;
32
34
  width: number;
33
35
  height: number;
34
36
  color: string;
35
37
  };
36
- showCursor: boolean;
37
- prevSelection: number[];
38
- composition: boolean;
38
+ protected _showCursor: boolean;
39
+ protected _prevSelection: number[];
40
+ protected _composition: boolean;
41
+ get composition(): boolean;
42
+ protected static _defined: boolean;
39
43
  static register(): void;
40
44
  protected _text: Text;
41
45
  get text(): Text;
42
- set text(value: Text);
46
+ set text(newText: Text);
43
47
  protected _oldText: string;
44
- $container: HTMLDivElement;
45
- $selection: HTMLDivElement;
46
- $textarea: HTMLTextAreaElement;
47
- $cursor: HTMLElement;
48
- onUpdateProperty(key: string, _newValue: unknown, _oldValue: unknown, _declaration: PropertyDeclaration): void;
49
- updateChars(): void;
50
- updateSelectedChars(): void;
51
- updateCursorPosition(): void;
48
+ protected _container: HTMLDivElement;
49
+ protected _selection: HTMLDivElement;
50
+ protected _textarea: HTMLTextAreaElement;
51
+ protected _cursor: HTMLElement;
52
52
  constructor();
53
+ connectedCallback(): void;
54
+ set(text: Text): void;
55
+ onUpdateProperty(key: string, _newValue: unknown, _oldValue: unknown): void;
56
+ protected _updateChars(): void;
57
+ protected _updateSelectedChars(): void;
58
+ protected _updateCursorPosition(): void;
53
59
  getPlaintext(): string;
54
- getNewContent(content: NormalizedTextContent, newString?: string, oldString?: string): NormalizedTextContent;
55
- setTextInput(newText: string): void;
56
- onInput(): void;
60
+ protected _getNewContent(content: NormalizedTextContent, newString?: string, oldString?: string): NormalizedTextContent;
61
+ protected _setTextInput(newText: string): void;
62
+ protected _onInput(): void;
57
63
  protected _timer?: any;
58
- onKeydown(e: KeyboardEvent): void;
59
- onFocus(): void;
60
- onBlur(): void;
61
- findNearest(options: {
64
+ protected _onKeydown(e: KeyboardEvent): void;
65
+ protected _onFocus(): void;
66
+ protected _onBlur(): void;
67
+ protected _findNearest(options: {
62
68
  x: number;
63
69
  y: number;
64
70
  xWeight?: number;
65
71
  yWeight?: number;
66
72
  }): number;
67
- updateSelectionByDom(): void;
68
- updateDomSelection(): void;
73
+ protected _updateSelectionByDom(): void;
74
+ protected _updateDomSelection(): void;
69
75
  protected _update(): void;
70
- bindEventListeners(): void;
71
- start(e: MouseEvent): boolean;
76
+ protected _bindEventListeners(): void;
77
+ pointerdown(e?: MouseEvent): boolean;
72
78
  attributeChangedCallback(name: string, _oldValue: any, newValue: any): void;
73
- emit(type: string, detail?: any): boolean;
74
- renderSelectRange(): void;
75
- renderCursor(): void;
79
+ protected _emit(type: string, detail?: any): boolean;
80
+ protected _renderSelectRange(): void;
81
+ protected _renderCursor(): void;
76
82
  }
77
83
 
78
84
  export { TextEditor };