mce 0.15.15 → 0.15.17

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.
@@ -24,6 +24,8 @@ declare const _default: {
24
24
  polygon: string;
25
25
  star: string;
26
26
  image: string;
27
+ video: string;
28
+ lottie: string;
27
29
  pen: string;
28
30
  pencil: string;
29
31
  file: string;
@@ -25,6 +25,8 @@ declare const _default: {
25
25
  polygon: string;
26
26
  star: string;
27
27
  image: string;
28
+ video: string;
29
+ lottie: string;
28
30
  pen: string;
29
31
  pencil: string;
30
32
  file: string;
@@ -0,0 +1,81 @@
1
+ import type { NormalizedTextContent, PropertyAccessor } from 'modern-idoc';
2
+ import { Text } from 'modern-text';
3
+ export interface IndexCharacter {
4
+ paragraphIndex: number;
5
+ fragmentIndex: number;
6
+ charIndex: number;
7
+ color: string;
8
+ left: number;
9
+ top: number;
10
+ width: number;
11
+ height: number;
12
+ content: string;
13
+ isFirst?: boolean;
14
+ isLast?: boolean;
15
+ isLastSelected?: boolean;
16
+ isCrlf?: boolean;
17
+ }
18
+ export declare class TextEditor extends HTMLElement implements PropertyAccessor {
19
+ left: number;
20
+ top: number;
21
+ rotate: number;
22
+ selection: [number, number] | undefined;
23
+ protected _selectionMinMax: {
24
+ min: number;
25
+ max: number;
26
+ };
27
+ protected _chars: IndexCharacter[];
28
+ protected _selectedChars: IndexCharacter[];
29
+ protected _cursorPosition?: {
30
+ left: number;
31
+ top: number;
32
+ width: number;
33
+ height: number;
34
+ color: string;
35
+ };
36
+ protected _showCursor: boolean;
37
+ protected _prevSelection: [number, number] | undefined;
38
+ protected _composition: boolean;
39
+ get composition(): boolean;
40
+ protected static _defined: boolean;
41
+ static register(): void;
42
+ protected _text: Text;
43
+ get text(): Text;
44
+ set text(newText: Text);
45
+ protected _oldText: string;
46
+ protected _container: HTMLDivElement;
47
+ protected _selection: HTMLDivElement;
48
+ protected _textarea: HTMLTextAreaElement;
49
+ protected _cursor: HTMLElement;
50
+ constructor();
51
+ connectedCallback(): void;
52
+ moveToDom(target: HTMLElement): void;
53
+ set(text: Text): void;
54
+ onUpdateProperty(key: string, _newValue: unknown, _oldValue: unknown): void;
55
+ protected _updateChars(): void;
56
+ protected _updateSelectedChars(): void;
57
+ protected _updateCursorPosition(): void;
58
+ getPlaintext(): string;
59
+ protected _getNewContent(content: NormalizedTextContent, newString?: string, oldString?: string): NormalizedTextContent;
60
+ protected _setTextInput(newText: string): void;
61
+ protected _onInput(): void;
62
+ protected _timer?: any;
63
+ protected _onKeydown(e: KeyboardEvent): void;
64
+ protected _findNearest(options: {
65
+ x: number;
66
+ y: number;
67
+ xWeight?: number;
68
+ yWeight?: number;
69
+ }): number;
70
+ protected _updateSelectionByDom(): void;
71
+ protected _updateDomSelection(): void;
72
+ protected _update(): void;
73
+ protected _bindEventListeners(): void;
74
+ pointerDown(e?: MouseEvent | PointerEvent): boolean;
75
+ selectAll(): void;
76
+ attributeChangedCallback(name: string, _oldValue: any, newValue: any): void;
77
+ protected _emit(type: string, detail?: any): boolean;
78
+ protected _renderSelectRange(): void;
79
+ protected _renderCursor(): void;
80
+ reset(): void;
81
+ }
@@ -0,0 +1 @@
1
+ export * from './TextEditor';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.15.15",
4
+ "version": "0.15.17",
5
5
  "description": "The headless canvas editor framework. only the ESM.",
6
6
  "author": "wxm",
7
7
  "license": "MIT",