@textbus/platform-browser 3.0.3 → 3.1.0
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/LICENSE +674 -674
- package/README.md +123 -123
- package/bundles/_utils/env.d.ts +5 -5
- package/bundles/_utils/uikit.d.ts +26 -26
- package/bundles/collaborate/collaborate-cursor.d.ts +45 -45
- package/bundles/core/_api.d.ts +6 -6
- package/bundles/core/dom-renderer.d.ts +53 -53
- package/bundles/core/injection-tokens.d.ts +18 -18
- package/bundles/core/magic-input.d.ts +81 -81
- package/bundles/core/native-input.d.ts +59 -59
- package/bundles/core/selection-bridge.d.ts +68 -68
- package/bundles/core/types.d.ts +74 -68
- package/bundles/dom-support/_api.d.ts +2 -2
- package/bundles/dom-support/output-translator.d.ts +16 -16
- package/bundles/dom-support/parser.d.ts +56 -56
- package/bundles/index.esm.js +2768 -2766
- package/bundles/index.js +2768 -2766
- package/bundles/public-api.d.ts +7 -7
- package/bundles/viewer.d.ts +86 -91
- package/package.json +3 -3
@@ -1,81 +1,81 @@
|
|
1
|
-
import { Observable } from '@tanbo/stream';
|
2
|
-
import { Injector } from '@tanbo/di';
|
3
|
-
import { Commander, Controller, Keyboard, Scheduler, Selection } from '@textbus/core';
|
4
|
-
import { Parser } from '../dom-support/parser';
|
5
|
-
import { Caret, CaretPosition, CompositionState, Input, Scroller } from './types';
|
6
|
-
interface CaretStyle {
|
7
|
-
height: string;
|
8
|
-
lineHeight: string;
|
9
|
-
fontSize: string;
|
10
|
-
}
|
11
|
-
declare class ExperimentalCaret implements Caret {
|
12
|
-
private scheduler;
|
13
|
-
private editorMask;
|
14
|
-
onPositionChange: Observable<CaretPosition | null>;
|
15
|
-
onStyleChange: Observable<CaretStyle>;
|
16
|
-
elementRef: HTMLElement;
|
17
|
-
compositionState: CompositionState | null;
|
18
|
-
get rect(): DOMRect;
|
19
|
-
compositionElement: HTMLElement;
|
20
|
-
private timer;
|
21
|
-
private caret;
|
22
|
-
private oldPosition;
|
23
|
-
private set display(value);
|
24
|
-
private get display();
|
25
|
-
private _display;
|
26
|
-
private flashing;
|
27
|
-
private subs;
|
28
|
-
private subscription;
|
29
|
-
private positionChangeEvent;
|
30
|
-
private styleChangeEvent;
|
31
|
-
private oldRange;
|
32
|
-
private isFixed;
|
33
|
-
constructor(scheduler: Scheduler, editorMask: HTMLElement);
|
34
|
-
refresh(isFixedCaret?: boolean): void;
|
35
|
-
show(range: Range, restart: boolean): void;
|
36
|
-
hide(): void;
|
37
|
-
destroy(): void;
|
38
|
-
correctScrollTop(scroller: Scroller): void;
|
39
|
-
private updateCursorPosition;
|
40
|
-
}
|
41
|
-
/**
|
42
|
-
* Textbus PC 端输入实现
|
43
|
-
*/
|
44
|
-
export declare class MagicInput extends Input {
|
45
|
-
private parser;
|
46
|
-
private keyboard;
|
47
|
-
private commander;
|
48
|
-
private selection;
|
49
|
-
private controller;
|
50
|
-
private scheduler;
|
51
|
-
private injector;
|
52
|
-
composition: boolean;
|
53
|
-
compositionState: CompositionState | null;
|
54
|
-
onReady: Promise<void>;
|
55
|
-
caret: ExperimentalCaret;
|
56
|
-
set disabled(b: boolean);
|
57
|
-
get disabled(): boolean;
|
58
|
-
private isSafari;
|
59
|
-
private isFirefox;
|
60
|
-
private isMac;
|
61
|
-
private isWindows;
|
62
|
-
private _disabled;
|
63
|
-
private container;
|
64
|
-
private subscription;
|
65
|
-
private doc;
|
66
|
-
private textarea;
|
67
|
-
private isFocus;
|
68
|
-
private nativeFocus;
|
69
|
-
private isSougouPinYin;
|
70
|
-
constructor(parser: Parser, keyboard: Keyboard, commander: Commander, selection: Selection, controller: Controller, scheduler: Scheduler, injector: Injector);
|
71
|
-
focus(range: Range, restart: boolean): void;
|
72
|
-
blur(): void;
|
73
|
-
destroy(): void;
|
74
|
-
private init;
|
75
|
-
private handleDefaultActions;
|
76
|
-
private handlePaste;
|
77
|
-
private handleShortcut;
|
78
|
-
private handleInput;
|
79
|
-
private createEditableFrame;
|
80
|
-
}
|
81
|
-
export {};
|
1
|
+
import { Observable } from '@tanbo/stream';
|
2
|
+
import { Injector } from '@tanbo/di';
|
3
|
+
import { Commander, Controller, Keyboard, Scheduler, Selection } from '@textbus/core';
|
4
|
+
import { Parser } from '../dom-support/parser';
|
5
|
+
import { Caret, CaretPosition, CompositionState, Input, Scroller } from './types';
|
6
|
+
interface CaretStyle {
|
7
|
+
height: string;
|
8
|
+
lineHeight: string;
|
9
|
+
fontSize: string;
|
10
|
+
}
|
11
|
+
declare class ExperimentalCaret implements Caret {
|
12
|
+
private scheduler;
|
13
|
+
private editorMask;
|
14
|
+
onPositionChange: Observable<CaretPosition | null>;
|
15
|
+
onStyleChange: Observable<CaretStyle>;
|
16
|
+
elementRef: HTMLElement;
|
17
|
+
compositionState: CompositionState | null;
|
18
|
+
get rect(): DOMRect;
|
19
|
+
compositionElement: HTMLElement;
|
20
|
+
private timer;
|
21
|
+
private caret;
|
22
|
+
private oldPosition;
|
23
|
+
private set display(value);
|
24
|
+
private get display();
|
25
|
+
private _display;
|
26
|
+
private flashing;
|
27
|
+
private subs;
|
28
|
+
private subscription;
|
29
|
+
private positionChangeEvent;
|
30
|
+
private styleChangeEvent;
|
31
|
+
private oldRange;
|
32
|
+
private isFixed;
|
33
|
+
constructor(scheduler: Scheduler, editorMask: HTMLElement);
|
34
|
+
refresh(isFixedCaret?: boolean): void;
|
35
|
+
show(range: Range, restart: boolean): void;
|
36
|
+
hide(): void;
|
37
|
+
destroy(): void;
|
38
|
+
correctScrollTop(scroller: Scroller): void;
|
39
|
+
private updateCursorPosition;
|
40
|
+
}
|
41
|
+
/**
|
42
|
+
* Textbus PC 端输入实现
|
43
|
+
*/
|
44
|
+
export declare class MagicInput extends Input {
|
45
|
+
private parser;
|
46
|
+
private keyboard;
|
47
|
+
private commander;
|
48
|
+
private selection;
|
49
|
+
private controller;
|
50
|
+
private scheduler;
|
51
|
+
private injector;
|
52
|
+
composition: boolean;
|
53
|
+
compositionState: CompositionState | null;
|
54
|
+
onReady: Promise<void>;
|
55
|
+
caret: ExperimentalCaret;
|
56
|
+
set disabled(b: boolean);
|
57
|
+
get disabled(): boolean;
|
58
|
+
private isSafari;
|
59
|
+
private isFirefox;
|
60
|
+
private isMac;
|
61
|
+
private isWindows;
|
62
|
+
private _disabled;
|
63
|
+
private container;
|
64
|
+
private subscription;
|
65
|
+
private doc;
|
66
|
+
private textarea;
|
67
|
+
private isFocus;
|
68
|
+
private nativeFocus;
|
69
|
+
private isSougouPinYin;
|
70
|
+
constructor(parser: Parser, keyboard: Keyboard, commander: Commander, selection: Selection, controller: Controller, scheduler: Scheduler, injector: Injector);
|
71
|
+
focus(range: Range, restart: boolean): void;
|
72
|
+
blur(): void;
|
73
|
+
destroy(): void;
|
74
|
+
private init;
|
75
|
+
private handleDefaultActions;
|
76
|
+
private handlePaste;
|
77
|
+
private handleShortcut;
|
78
|
+
private handleInput;
|
79
|
+
private createEditableFrame;
|
80
|
+
}
|
81
|
+
export {};
|
@@ -1,59 +1,59 @@
|
|
1
|
-
import { Injector } from '@tanbo/di';
|
2
|
-
import { Observable } from '@tanbo/stream';
|
3
|
-
import { Commander, Controller, Keyboard, Renderer, Scheduler, Selection } from '@textbus/core';
|
4
|
-
import { Caret, CaretPosition, CompositionState, Input, Scroller } from './types';
|
5
|
-
import { Parser } from '../dom-support/parser';
|
6
|
-
declare class NativeCaret implements Caret {
|
7
|
-
private scheduler;
|
8
|
-
onPositionChange: Observable<CaretPosition | null>;
|
9
|
-
set nativeRange(range: Range | null);
|
10
|
-
get nativeRange(): Range | null;
|
11
|
-
get rect(): DOMRect | {
|
12
|
-
left: number;
|
13
|
-
top: number;
|
14
|
-
width: number;
|
15
|
-
height: number;
|
16
|
-
};
|
17
|
-
private oldPosition;
|
18
|
-
private _nativeRange;
|
19
|
-
private subs;
|
20
|
-
private positionChangeEvent;
|
21
|
-
constructor(scheduler: Scheduler);
|
22
|
-
refresh(): void;
|
23
|
-
correctScrollTop(scroller: Scroller): void;
|
24
|
-
destroy(): void;
|
25
|
-
}
|
26
|
-
export declare class NativeInput extends Input {
|
27
|
-
private injector;
|
28
|
-
private parser;
|
29
|
-
private scheduler;
|
30
|
-
private selection;
|
31
|
-
private keyboard;
|
32
|
-
private renderer;
|
33
|
-
private commander;
|
34
|
-
private controller;
|
35
|
-
caret: NativeCaret;
|
36
|
-
composition: boolean;
|
37
|
-
compositionState: CompositionState | null;
|
38
|
-
onReady: Promise<void>;
|
39
|
-
set disabled(b: boolean);
|
40
|
-
get disabled(): boolean;
|
41
|
-
private _disabled;
|
42
|
-
private documentView;
|
43
|
-
private nativeSelection;
|
44
|
-
private subscription;
|
45
|
-
private nativeRange;
|
46
|
-
private isSafari;
|
47
|
-
private isMac;
|
48
|
-
private isMobileBrowser;
|
49
|
-
private isSougouPinYin;
|
50
|
-
constructor(injector: Injector, parser: Parser, scheduler: Scheduler, selection: Selection, keyboard: Keyboard, renderer: Renderer, commander: Commander, controller: Controller);
|
51
|
-
focus(nativeRange: Range): void;
|
52
|
-
blur(): void;
|
53
|
-
destroy(): void;
|
54
|
-
private handleDefaultActions;
|
55
|
-
private handlePaste;
|
56
|
-
private handleShortcut;
|
57
|
-
private handleInput;
|
58
|
-
}
|
59
|
-
export {};
|
1
|
+
import { Injector } from '@tanbo/di';
|
2
|
+
import { Observable } from '@tanbo/stream';
|
3
|
+
import { Commander, Controller, Keyboard, Renderer, Scheduler, Selection } from '@textbus/core';
|
4
|
+
import { Caret, CaretPosition, CompositionState, Input, Scroller } from './types';
|
5
|
+
import { Parser } from '../dom-support/parser';
|
6
|
+
declare class NativeCaret implements Caret {
|
7
|
+
private scheduler;
|
8
|
+
onPositionChange: Observable<CaretPosition | null>;
|
9
|
+
set nativeRange(range: Range | null);
|
10
|
+
get nativeRange(): Range | null;
|
11
|
+
get rect(): DOMRect | {
|
12
|
+
left: number;
|
13
|
+
top: number;
|
14
|
+
width: number;
|
15
|
+
height: number;
|
16
|
+
};
|
17
|
+
private oldPosition;
|
18
|
+
private _nativeRange;
|
19
|
+
private subs;
|
20
|
+
private positionChangeEvent;
|
21
|
+
constructor(scheduler: Scheduler);
|
22
|
+
refresh(): void;
|
23
|
+
correctScrollTop(scroller: Scroller): void;
|
24
|
+
destroy(): void;
|
25
|
+
}
|
26
|
+
export declare class NativeInput extends Input {
|
27
|
+
private injector;
|
28
|
+
private parser;
|
29
|
+
private scheduler;
|
30
|
+
private selection;
|
31
|
+
private keyboard;
|
32
|
+
private renderer;
|
33
|
+
private commander;
|
34
|
+
private controller;
|
35
|
+
caret: NativeCaret;
|
36
|
+
composition: boolean;
|
37
|
+
compositionState: CompositionState | null;
|
38
|
+
onReady: Promise<void>;
|
39
|
+
set disabled(b: boolean);
|
40
|
+
get disabled(): boolean;
|
41
|
+
private _disabled;
|
42
|
+
private documentView;
|
43
|
+
private nativeSelection;
|
44
|
+
private subscription;
|
45
|
+
private nativeRange;
|
46
|
+
private isSafari;
|
47
|
+
private isMac;
|
48
|
+
private isMobileBrowser;
|
49
|
+
private isSougouPinYin;
|
50
|
+
constructor(injector: Injector, parser: Parser, scheduler: Scheduler, selection: Selection, keyboard: Keyboard, renderer: Renderer, commander: Commander, controller: Controller);
|
51
|
+
focus(nativeRange: Range): void;
|
52
|
+
blur(): void;
|
53
|
+
destroy(): void;
|
54
|
+
private handleDefaultActions;
|
55
|
+
private handlePaste;
|
56
|
+
private handleShortcut;
|
57
|
+
private handleInput;
|
58
|
+
}
|
59
|
+
export {};
|
@@ -1,68 +1,68 @@
|
|
1
|
-
import { Observable } from '@tanbo/stream';
|
2
|
-
import { Injector } from '@tanbo/di';
|
3
|
-
import { NativeSelectionBridge, NativeSelectionConnector, Renderer, SelectionPosition, AbstractSelection, RootComponentRef, Controller, Selection } from '@textbus/core';
|
4
|
-
import { Rect } from '../_utils/uikit';
|
5
|
-
import { Input, ViewOptions } from './types';
|
6
|
-
/**
|
7
|
-
* Textbus PC 端选区桥接实现
|
8
|
-
*/
|
9
|
-
export declare class SelectionBridge implements NativeSelectionBridge {
|
10
|
-
private config;
|
11
|
-
private injector;
|
12
|
-
private controller;
|
13
|
-
private selection;
|
14
|
-
private rootComponentRef;
|
15
|
-
private input;
|
16
|
-
private renderer;
|
17
|
-
onSelectionChange: Observable<Range | null>;
|
18
|
-
nativeSelection: globalThis.Selection;
|
19
|
-
private selectionMaskElement;
|
20
|
-
private selectionChangeEvent;
|
21
|
-
private subs;
|
22
|
-
private sub;
|
23
|
-
private connector;
|
24
|
-
private ignoreSelectionChange;
|
25
|
-
private changeFromUser;
|
26
|
-
private docContainer;
|
27
|
-
private maskContainer;
|
28
|
-
private cacheCaretPositionTimer;
|
29
|
-
private oldCaretPosition;
|
30
|
-
constructor(config: ViewOptions, injector: Injector, controller: Controller, selection: Selection, rootComponentRef: RootComponentRef, input: Input, renderer: Renderer);
|
31
|
-
connect(connector: NativeSelectionConnector): void;
|
32
|
-
disConnect(): void;
|
33
|
-
getRect(location: SelectionPosition): Rect | null;
|
34
|
-
restore(abstractSelection: AbstractSelection | null, formLocal: boolean): void;
|
35
|
-
destroy(): void;
|
36
|
-
getPositionByRange(abstractSelection: AbstractSelection): {
|
37
|
-
focus: {
|
38
|
-
node: Node;
|
39
|
-
offset: number;
|
40
|
-
} | null;
|
41
|
-
anchor: {
|
42
|
-
node: Node;
|
43
|
-
offset: number;
|
44
|
-
} | null;
|
45
|
-
};
|
46
|
-
getPreviousLinePositionByCurrent(position: SelectionPosition): SelectionPosition | null;
|
47
|
-
getNextLinePositionByCurrent(position: SelectionPosition): SelectionPosition | null;
|
48
|
-
private getLinePosition;
|
49
|
-
/**
|
50
|
-
* 获取选区向上移动一行的位置。
|
51
|
-
* @param currentPosition
|
52
|
-
* @param startLeft 参考位置。
|
53
|
-
*/
|
54
|
-
private getPreviousLinePositionByOffset;
|
55
|
-
/**
|
56
|
-
* 获取选区向下移动一行的位置。
|
57
|
-
* @param currentPosition
|
58
|
-
* @param startLeft 参考位置。
|
59
|
-
*/
|
60
|
-
private getNextLinePositionByOffset;
|
61
|
-
private unListen;
|
62
|
-
private listen;
|
63
|
-
private syncSelection;
|
64
|
-
private findSelectedNodeAndOffset;
|
65
|
-
private getCorrectedPosition;
|
66
|
-
private findFocusNode;
|
67
|
-
private findFocusNodeByParent;
|
68
|
-
}
|
1
|
+
import { Observable } from '@tanbo/stream';
|
2
|
+
import { Injector } from '@tanbo/di';
|
3
|
+
import { NativeSelectionBridge, NativeSelectionConnector, Renderer, SelectionPosition, AbstractSelection, RootComponentRef, Controller, Selection } from '@textbus/core';
|
4
|
+
import { Rect } from '../_utils/uikit';
|
5
|
+
import { Input, ViewOptions } from './types';
|
6
|
+
/**
|
7
|
+
* Textbus PC 端选区桥接实现
|
8
|
+
*/
|
9
|
+
export declare class SelectionBridge implements NativeSelectionBridge {
|
10
|
+
private config;
|
11
|
+
private injector;
|
12
|
+
private controller;
|
13
|
+
private selection;
|
14
|
+
private rootComponentRef;
|
15
|
+
private input;
|
16
|
+
private renderer;
|
17
|
+
onSelectionChange: Observable<Range | null>;
|
18
|
+
nativeSelection: globalThis.Selection;
|
19
|
+
private selectionMaskElement;
|
20
|
+
private selectionChangeEvent;
|
21
|
+
private subs;
|
22
|
+
private sub;
|
23
|
+
private connector;
|
24
|
+
private ignoreSelectionChange;
|
25
|
+
private changeFromUser;
|
26
|
+
private docContainer;
|
27
|
+
private maskContainer;
|
28
|
+
private cacheCaretPositionTimer;
|
29
|
+
private oldCaretPosition;
|
30
|
+
constructor(config: ViewOptions, injector: Injector, controller: Controller, selection: Selection, rootComponentRef: RootComponentRef, input: Input, renderer: Renderer);
|
31
|
+
connect(connector: NativeSelectionConnector): void;
|
32
|
+
disConnect(): void;
|
33
|
+
getRect(location: SelectionPosition): Rect | null;
|
34
|
+
restore(abstractSelection: AbstractSelection | null, formLocal: boolean): void;
|
35
|
+
destroy(): void;
|
36
|
+
getPositionByRange(abstractSelection: AbstractSelection): {
|
37
|
+
focus: {
|
38
|
+
node: Node;
|
39
|
+
offset: number;
|
40
|
+
} | null;
|
41
|
+
anchor: {
|
42
|
+
node: Node;
|
43
|
+
offset: number;
|
44
|
+
} | null;
|
45
|
+
};
|
46
|
+
getPreviousLinePositionByCurrent(position: SelectionPosition): SelectionPosition | null;
|
47
|
+
getNextLinePositionByCurrent(position: SelectionPosition): SelectionPosition | null;
|
48
|
+
private getLinePosition;
|
49
|
+
/**
|
50
|
+
* 获取选区向上移动一行的位置。
|
51
|
+
* @param currentPosition
|
52
|
+
* @param startLeft 参考位置。
|
53
|
+
*/
|
54
|
+
private getPreviousLinePositionByOffset;
|
55
|
+
/**
|
56
|
+
* 获取选区向下移动一行的位置。
|
57
|
+
* @param currentPosition
|
58
|
+
* @param startLeft 参考位置。
|
59
|
+
*/
|
60
|
+
private getNextLinePositionByOffset;
|
61
|
+
private unListen;
|
62
|
+
private listen;
|
63
|
+
private syncSelection;
|
64
|
+
private findSelectedNodeAndOffset;
|
65
|
+
private getCorrectedPosition;
|
66
|
+
private findFocusNode;
|
67
|
+
private findFocusNodeByParent;
|
68
|
+
}
|
package/bundles/core/types.d.ts
CHANGED
@@ -1,68 +1,74 @@
|
|
1
|
-
import { ComponentLiteral, Module, Slot, TextbusConfig } from '@textbus/core';
|
2
|
-
import { Observable } from '@tanbo/stream';
|
3
|
-
import { FormatLoader, ComponentLoader, AttributeLoader } from '../dom-support/parser';
|
4
|
-
import { Rect } from '../_utils/uikit';
|
5
|
-
export interface ViewModule extends Module {
|
6
|
-
componentLoaders?: ComponentLoader[];
|
7
|
-
formatLoaders?: FormatLoader<any>[];
|
8
|
-
attributeLoaders?: AttributeLoader<any>[];
|
9
|
-
}
|
10
|
-
/**
|
11
|
-
* Textbus PC 端配置接口
|
12
|
-
*/
|
13
|
-
export interface ViewOptions extends TextbusConfig {
|
14
|
-
imports?: ViewModule[];
|
15
|
-
/** 自动获取焦点 */
|
16
|
-
autoFocus?: boolean;
|
17
|
-
/** 编辑区最小高度 */
|
18
|
-
minHeight?: string;
|
19
|
-
/** 组件加载器 */
|
20
|
-
componentLoaders?: ComponentLoader[];
|
21
|
-
/** 格式加载器 */
|
22
|
-
formatLoaders?: FormatLoader<any>[];
|
23
|
-
/** 属性加载器 */
|
24
|
-
attributeLoaders?: AttributeLoader<any>[];
|
25
|
-
/** 默认内容 */
|
26
|
-
content?: string | ComponentLiteral;
|
27
|
-
/** 文档默认样式表 */
|
28
|
-
styleSheets?: string[];
|
29
|
-
/** 配置文档编辑状态下用到的样式 */
|
30
|
-
editingStyleSheets?: string[];
|
31
|
-
/** 使用 contentEditable 作为编辑器控制可编辑范围 */
|
32
|
-
useContentEditable?: boolean;
|
33
|
-
}
|
34
|
-
export interface CaretLimit {
|
35
|
-
top: number;
|
36
|
-
bottom: number;
|
37
|
-
}
|
38
|
-
export interface Scroller {
|
39
|
-
onScroll: Observable<any>;
|
40
|
-
getLimit(): CaretLimit;
|
41
|
-
setOffset(offsetScrollTop: number): void;
|
42
|
-
}
|
43
|
-
export interface CaretPosition {
|
44
|
-
left: number;
|
45
|
-
top: number;
|
46
|
-
height: number;
|
47
|
-
}
|
48
|
-
export interface Caret {
|
49
|
-
onPositionChange: Observable<CaretPosition | null>;
|
50
|
-
readonly rect: Rect;
|
51
|
-
refresh(isFixedCaret: boolean): void;
|
52
|
-
correctScrollTop(scroller: Scroller): void;
|
53
|
-
}
|
54
|
-
export interface CompositionState {
|
55
|
-
slot: Slot;
|
56
|
-
index: number;
|
57
|
-
data: string;
|
58
|
-
}
|
59
|
-
export declare abstract class Input {
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
abstract
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
abstract
|
68
|
-
|
1
|
+
import { ComponentLiteral, Module, Slot, TextbusConfig } from '@textbus/core';
|
2
|
+
import { Observable } from '@tanbo/stream';
|
3
|
+
import { FormatLoader, ComponentLoader, AttributeLoader } from '../dom-support/parser';
|
4
|
+
import { Rect } from '../_utils/uikit';
|
5
|
+
export interface ViewModule extends Module {
|
6
|
+
componentLoaders?: ComponentLoader[];
|
7
|
+
formatLoaders?: FormatLoader<any>[];
|
8
|
+
attributeLoaders?: AttributeLoader<any>[];
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* Textbus PC 端配置接口
|
12
|
+
*/
|
13
|
+
export interface ViewOptions extends TextbusConfig {
|
14
|
+
imports?: ViewModule[];
|
15
|
+
/** 自动获取焦点 */
|
16
|
+
autoFocus?: boolean;
|
17
|
+
/** 编辑区最小高度 */
|
18
|
+
minHeight?: string;
|
19
|
+
/** 组件加载器 */
|
20
|
+
componentLoaders?: ComponentLoader[];
|
21
|
+
/** 格式加载器 */
|
22
|
+
formatLoaders?: FormatLoader<any>[];
|
23
|
+
/** 属性加载器 */
|
24
|
+
attributeLoaders?: AttributeLoader<any>[];
|
25
|
+
/** 默认内容 */
|
26
|
+
content?: string | ComponentLiteral;
|
27
|
+
/** 文档默认样式表 */
|
28
|
+
styleSheets?: string[];
|
29
|
+
/** 配置文档编辑状态下用到的样式 */
|
30
|
+
editingStyleSheets?: string[];
|
31
|
+
/** 使用 contentEditable 作为编辑器控制可编辑范围 */
|
32
|
+
useContentEditable?: boolean;
|
33
|
+
}
|
34
|
+
export interface CaretLimit {
|
35
|
+
top: number;
|
36
|
+
bottom: number;
|
37
|
+
}
|
38
|
+
export interface Scroller {
|
39
|
+
onScroll: Observable<any>;
|
40
|
+
getLimit(): CaretLimit;
|
41
|
+
setOffset(offsetScrollTop: number): void;
|
42
|
+
}
|
43
|
+
export interface CaretPosition {
|
44
|
+
left: number;
|
45
|
+
top: number;
|
46
|
+
height: number;
|
47
|
+
}
|
48
|
+
export interface Caret {
|
49
|
+
onPositionChange: Observable<CaretPosition | null>;
|
50
|
+
readonly rect: Rect;
|
51
|
+
refresh(isFixedCaret: boolean): void;
|
52
|
+
correctScrollTop(scroller: Scroller): void;
|
53
|
+
}
|
54
|
+
export interface CompositionState {
|
55
|
+
slot: Slot;
|
56
|
+
index: number;
|
57
|
+
data: string;
|
58
|
+
}
|
59
|
+
export declare abstract class Input {
|
60
|
+
/**
|
61
|
+
* @experimental
|
62
|
+
*/
|
63
|
+
abstract composition: boolean;
|
64
|
+
/**
|
65
|
+
* @experimental
|
66
|
+
*/
|
67
|
+
abstract compositionState: CompositionState | null;
|
68
|
+
abstract onReady: Promise<void>;
|
69
|
+
abstract caret: Caret;
|
70
|
+
abstract disabled: boolean;
|
71
|
+
abstract focus(nativeRange: Range, reFlash: boolean): void;
|
72
|
+
abstract blur(): void;
|
73
|
+
abstract destroy(): void;
|
74
|
+
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './output-translator';
|
2
|
-
export * from './parser';
|
1
|
+
export * from './output-translator';
|
2
|
+
export * from './parser';
|
@@ -1,16 +1,16 @@
|
|
1
|
-
import { VElement } from '@textbus/core';
|
2
|
-
/**
|
3
|
-
* HTML 输出转换器
|
4
|
-
*/
|
5
|
-
export declare class OutputTranslator {
|
6
|
-
static singleTags: string[];
|
7
|
-
static simpleXSSFilter: {
|
8
|
-
text(text: string): string;
|
9
|
-
attrName(text: string): string;
|
10
|
-
attrValue(text: string): string;
|
11
|
-
};
|
12
|
-
private singleTagTest;
|
13
|
-
transform(vDom: VElement): string;
|
14
|
-
private vDomToHTMLString;
|
15
|
-
private replaceEmpty;
|
16
|
-
}
|
1
|
+
import { VElement } from '@textbus/core';
|
2
|
+
/**
|
3
|
+
* HTML 输出转换器
|
4
|
+
*/
|
5
|
+
export declare class OutputTranslator {
|
6
|
+
static singleTags: string[];
|
7
|
+
static simpleXSSFilter: {
|
8
|
+
text(text: string): string;
|
9
|
+
attrName(text: string): string;
|
10
|
+
attrValue(text: string): string;
|
11
|
+
};
|
12
|
+
private singleTagTest;
|
13
|
+
transform(vDom: VElement): string;
|
14
|
+
private vDomToHTMLString;
|
15
|
+
private replaceEmpty;
|
16
|
+
}
|