@worktile/theia 2.2.7 → 2.3.0-next.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/bundles/worktile-theia.umd.js +852 -249
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/toolbar/toolbar.component.d.ts +3 -2
- package/components/toolbar-item/toolbar-item.component.d.ts +3 -4
- package/constants/default.d.ts +3 -0
- package/constants/node-types.d.ts +4 -0
- package/custom-types.d.ts +3 -1
- package/editor.component.d.ts +3 -1
- package/editor.module.d.ts +26 -24
- package/esm2015/components/toolbar/toolbar.component.js +6 -4
- package/esm2015/components/toolbar-item/toolbar-item.component.js +4 -4
- package/esm2015/constants/auto-format-rules.js +26 -7
- package/esm2015/constants/default.js +2 -1
- package/esm2015/constants/node-types.js +6 -1
- package/esm2015/custom-types.js +1 -1
- package/esm2015/editor.component.js +12 -6
- package/esm2015/editor.module.js +6 -3
- package/esm2015/interfaces/editor.js +1 -1
- package/esm2015/interfaces/image.js +1 -1
- package/esm2015/interfaces/valid-children-types.js +2 -1
- package/esm2015/plugins/align/align.editor.js +10 -2
- package/esm2015/plugins/align/options.js +3 -2
- package/esm2015/plugins/common/auto-insert-data..js +2 -18
- package/esm2015/plugins/dnd/component/dnd.component.js +260 -0
- package/esm2015/plugins/dnd/utils/get-current-target.js +19 -0
- package/esm2015/plugins/dnd/utils/get-hover-direction.js +13 -0
- package/esm2015/plugins/dnd/utils/is-valid-drag.js +38 -0
- package/esm2015/plugins/dnd/utils/move-drag-node.js +30 -0
- package/esm2015/plugins/dnd/utils/remove-drop-thumb-line.js +10 -0
- package/esm2015/plugins/image/image.component.js +167 -14
- package/esm2015/plugins/image/image.editor.js +4 -1
- package/esm2015/plugins/indent/on-keydown-indent.js +2 -3
- package/esm2015/plugins/list/list.editor.js +2 -2
- package/esm2015/plugins/quick-insert/components/quick-insert.component.js +13 -2
- package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +1 -1
- package/esm2015/services/context.service.js +5 -1
- package/esm2015/utils/dom.js +39 -1
- package/esm2015/utils/is-clean-empty-paragraph.js +4 -4
- package/esm2015/utils/merge-element-options.js +20 -0
- package/fesm2015/worktile-theia.js +786 -201
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +9 -1
- package/interfaces/image.d.ts +7 -1
- package/interfaces/valid-children-types.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/align/align.editor.d.ts +1 -0
- package/plugins/dnd/component/dnd.component.d.ts +42 -0
- package/plugins/dnd/component/dnd.component.scss +61 -0
- package/plugins/dnd/utils/get-current-target.d.ts +2 -0
- package/plugins/dnd/utils/get-hover-direction.d.ts +3 -0
- package/plugins/dnd/utils/is-valid-drag.d.ts +3 -0
- package/plugins/dnd/utils/move-drag-node.d.ts +2 -0
- package/plugins/dnd/utils/remove-drop-thumb-line.d.ts +2 -0
- package/plugins/image/image.component.d.ts +27 -3
- package/plugins/image/image.component.scss +9 -2
- package/plugins/image/image.editor.d.ts +6 -1
- package/plugins/quick-insert/components/quick-insert.component.d.ts +1 -0
- package/plugins/table/components/table.component.scss +1 -0
- package/services/context.service.d.ts +1 -0
- package/styles/editor.scss +4 -0
- package/styles/index.scss +1 -0
- package/styles/typo.scss +44 -0
- package/utils/dom.d.ts +5 -1
- package/utils/merge-element-options.d.ts +2 -0
package/interfaces/editor.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ElementOptionsInfo } from './valid-children-types';
|
|
|
5
5
|
import { Predicate } from '../utils/match';
|
|
6
6
|
import { ToolbarOption } from './toolbar';
|
|
7
7
|
import { FontSizes } from '../constants/node-types';
|
|
8
|
+
import { CustomElement } from '../custom-types';
|
|
8
9
|
export interface TheEditor extends AngularEditor, HistoryEditor {
|
|
9
10
|
renderElement: (element: Element) => ViewType;
|
|
10
11
|
renderLeaf: (text: Text) => ViewType;
|
|
@@ -30,9 +31,11 @@ export declare const TheEditor: {
|
|
|
30
31
|
editable?: boolean;
|
|
31
32
|
}): boolean;
|
|
32
33
|
insertData(editor: AngularEditor, data: DataTransfer): void;
|
|
34
|
+
insertFragmentData(editor: AngularEditor, data: DataTransfer): boolean;
|
|
35
|
+
insertTextData(editor: AngularEditor, data: DataTransfer): boolean;
|
|
33
36
|
onKeydown(editor: AngularEditor, data: KeyboardEvent): void;
|
|
34
37
|
onClick(editor: AngularEditor, data: MouseEvent): void;
|
|
35
|
-
setFragmentData(editor: AngularEditor, data: DataTransfer): void;
|
|
38
|
+
setFragmentData(editor: AngularEditor, data: DataTransfer, originEvent?: "copy" | "drag" | "cut"): void;
|
|
36
39
|
deleteCutData(editor: AngularEditor): void;
|
|
37
40
|
toDOMNode(editor: AngularEditor, node: Node): HTMLElement;
|
|
38
41
|
toDOMPoint(editor: AngularEditor, point: import("slate").BasePoint): import("slate-angular").DOMPoint;
|
|
@@ -72,6 +75,7 @@ export interface TheOptions {
|
|
|
72
75
|
placeholderDecorate?: (editor: Editor) => SlatePlaceholder[];
|
|
73
76
|
inlineToobarVisible?: boolean;
|
|
74
77
|
quickInsertVisible?: boolean;
|
|
78
|
+
dragAndDrop?: boolean;
|
|
75
79
|
scrollContainer?: string;
|
|
76
80
|
maxHeight?: number;
|
|
77
81
|
fontSize?: FontSizes;
|
|
@@ -119,3 +123,7 @@ export interface DomEventDataInfo {
|
|
|
119
123
|
text?: string;
|
|
120
124
|
json?: Node[];
|
|
121
125
|
}
|
|
126
|
+
export interface DragNode {
|
|
127
|
+
node: CustomElement;
|
|
128
|
+
path: Path;
|
|
129
|
+
}
|
package/interfaces/image.d.ts
CHANGED
|
@@ -2,7 +2,8 @@ import { Observable } from 'rxjs';
|
|
|
2
2
|
import { UploadFileEntity, FileUploadingItem } from './upload';
|
|
3
3
|
import { InjectionToken } from '@angular/core';
|
|
4
4
|
import { SafeUrl } from '@angular/platform-browser';
|
|
5
|
-
import { Alignment } from '../constants';
|
|
5
|
+
import { Alignment, LayoutTypes } from '../constants';
|
|
6
|
+
import { ToolbarItem } from './toolbar';
|
|
6
7
|
export interface ImageEntry {
|
|
7
8
|
file?: File;
|
|
8
9
|
name?: string;
|
|
@@ -11,6 +12,11 @@ export interface ImageEntry {
|
|
|
11
12
|
thumbUrl?: SafeUrl | string;
|
|
12
13
|
originUrl?: SafeUrl | string;
|
|
13
14
|
align?: Alignment;
|
|
15
|
+
layout?: LayoutTypes;
|
|
16
|
+
reSized?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface LayoutOption extends ToolbarItem {
|
|
19
|
+
handle?: (e: MouseEvent, key: Alignment | LayoutTypes) => void;
|
|
14
20
|
}
|
|
15
21
|
export interface TheImageUploaderService {
|
|
16
22
|
uploadFileHandle: (files: any) => Observable<UploadFileEntity[]>;
|
|
@@ -3,6 +3,7 @@ export interface ElementOptionsInfo {
|
|
|
3
3
|
type: CustomElementKinds;
|
|
4
4
|
inValidChildrenTypes: CustomElementKinds[];
|
|
5
5
|
isIndivisible?: boolean;
|
|
6
|
+
isSecondaryContainer?: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare const inValidTypes: CustomElementKinds[];
|
|
8
9
|
export declare const DefaultElementOptions: ElementOptionsInfo[];
|
package/package.json
CHANGED
|
@@ -2,5 +2,6 @@ import { Editor } from 'slate';
|
|
|
2
2
|
import { Alignment } from '../../constants/node-types';
|
|
3
3
|
export declare const AlignEditor: {
|
|
4
4
|
isActive(editor: Editor, alignment: Alignment): boolean;
|
|
5
|
+
isDisabled(editor: Editor): boolean;
|
|
5
6
|
setAlign(editor: Editor, alignment: Alignment): void;
|
|
6
7
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, NgZone, OnDestroy, Renderer2 } from '@angular/core';
|
|
2
|
+
import { Editor } from 'slate';
|
|
3
|
+
import { DragNode } from '../../../interfaces';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class TheDndComponent implements AfterViewInit, OnDestroy {
|
|
6
|
+
private renderer;
|
|
7
|
+
private elementRef;
|
|
8
|
+
private ngZone;
|
|
9
|
+
private cdr;
|
|
10
|
+
isDraging: boolean;
|
|
11
|
+
dragNode: DragNode;
|
|
12
|
+
dragSnapshotContent: HTMLElement;
|
|
13
|
+
private destroy$;
|
|
14
|
+
editor: Editor;
|
|
15
|
+
dragChange: EventEmitter<boolean>;
|
|
16
|
+
dragElement: HTMLElement;
|
|
17
|
+
dragElementHeight: number;
|
|
18
|
+
dragElementWidth: number;
|
|
19
|
+
isScrolling: boolean;
|
|
20
|
+
dropThumbLine: HTMLElement;
|
|
21
|
+
editableTop: number;
|
|
22
|
+
content: ElementRef;
|
|
23
|
+
get nativeElement(): HTMLElement;
|
|
24
|
+
get editableElement(): HTMLElement;
|
|
25
|
+
constructor(renderer: Renderer2, elementRef: ElementRef, ngZone: NgZone, cdr: ChangeDetectorRef);
|
|
26
|
+
ngAfterViewInit(): void;
|
|
27
|
+
valueChangeHandle(): void;
|
|
28
|
+
private updateDndContainerPosition;
|
|
29
|
+
getEditableTop(event: MouseEvent): void;
|
|
30
|
+
onDragStart(event: DragEvent): void;
|
|
31
|
+
onDragEnd(event: DragEvent): void;
|
|
32
|
+
onDrop(event: MouseEvent): void;
|
|
33
|
+
onDragover(event: MouseEvent): void;
|
|
34
|
+
setDropThumbLine(event: MouseEvent): void;
|
|
35
|
+
setDragIcon(event: MouseEvent): void;
|
|
36
|
+
setSnapshotStyle(event: MouseEvent): void;
|
|
37
|
+
resetDragSnapshotContent(): void;
|
|
38
|
+
setVisibility(visible?: boolean): void;
|
|
39
|
+
ngOnDestroy(): void;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TheDndComponent, never>;
|
|
41
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TheDndComponent, "[theDnd]", never, { "editor": "editor"; }, { "dragChange": "dragChange"; }, never, never>;
|
|
42
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.the-drag-drop {
|
|
2
|
+
position: absolute;
|
|
3
|
+
cursor: grab;
|
|
4
|
+
.the-drag-drop-icon {
|
|
5
|
+
color: $gray-500;
|
|
6
|
+
width: 24px;
|
|
7
|
+
height: 24px;
|
|
8
|
+
line-height: 24px;
|
|
9
|
+
text-align: center;
|
|
10
|
+
font-size: $font-size-base;
|
|
11
|
+
border-radius: 3px;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
background-color: rgba($primary, 0.15);
|
|
16
|
+
color: $primary;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
.drag-container{
|
|
21
|
+
position: absolute;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
}
|
|
25
|
+
.drag-snapshot-container {
|
|
26
|
+
position: absolute;
|
|
27
|
+
transition: all 0.2 linear;
|
|
28
|
+
background: $white;
|
|
29
|
+
padding: 5px;
|
|
30
|
+
top: 0px;
|
|
31
|
+
left: 0px;
|
|
32
|
+
transform-origin: left top;
|
|
33
|
+
box-shadow: 0px 4px 10px 5px rgba($black, 0.07);
|
|
34
|
+
border-radius: 4px;
|
|
35
|
+
min-height: 0;
|
|
36
|
+
z-index: 1800;
|
|
37
|
+
visibility: hidden;
|
|
38
|
+
pointer-events: none;
|
|
39
|
+
user-select: none;
|
|
40
|
+
ol, ul, blockquote, .slate-element-table .the-table{
|
|
41
|
+
margin: 0;
|
|
42
|
+
}
|
|
43
|
+
.slate-element-paragraph{
|
|
44
|
+
line-height: $line-height-base;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
.drop-thumb-line{
|
|
48
|
+
width: 100%;
|
|
49
|
+
left: 0px;
|
|
50
|
+
right: 0px;
|
|
51
|
+
bottom: -2px;
|
|
52
|
+
height: 2px;
|
|
53
|
+
z-index: -10;
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
user-select: none;
|
|
56
|
+
background: $primary;
|
|
57
|
+
position: absolute;
|
|
58
|
+
}
|
|
59
|
+
.slate-editable-container > *, .slate-element-paragraph, .slate-block{
|
|
60
|
+
position: relative;
|
|
61
|
+
}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import { OnInit, ElementRef, OnDestroy, AfterViewInit, ChangeDetectorRef } from '@angular/core';
|
|
1
|
+
import { OnInit, ElementRef, OnDestroy, AfterViewInit, ChangeDetectorRef, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { BeforeContextChange, SlateElementContext } from 'slate-angular';
|
|
3
3
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
4
|
-
import { ImageEntry, TheImageUploaderService } from '../../interfaces/image';
|
|
4
|
+
import { ImageEntry, TheImageUploaderService, LayoutOption } from '../../interfaces/image';
|
|
5
|
+
import { Alignment, LayoutTypes } from '../../constants/node-types';
|
|
5
6
|
import { Editor } from 'slate';
|
|
7
|
+
import { ThyPopover } from 'ngx-tethys/popover';
|
|
8
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
6
9
|
import { TheContextService } from '../../services/context.service';
|
|
7
10
|
import { TheBaseElementComponent } from '../../interfaces';
|
|
8
11
|
import { ImageElement } from '../../custom-types';
|
|
@@ -13,19 +16,28 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
13
16
|
private imageUploaderService;
|
|
14
17
|
cdr: ChangeDetectorRef;
|
|
15
18
|
private theContextService;
|
|
19
|
+
private thyPopover;
|
|
20
|
+
private overlay;
|
|
21
|
+
private viewContainerRef;
|
|
16
22
|
imageEntry: ImageEntry;
|
|
17
23
|
uploading: boolean;
|
|
18
24
|
percentage: number;
|
|
19
25
|
file: File;
|
|
26
|
+
layoutDefaultWidth: number;
|
|
27
|
+
layoutOptions: LayoutOption[];
|
|
20
28
|
private uploadingSubscription;
|
|
21
29
|
private mouseMoveSubscription;
|
|
22
30
|
private mouseUpSubscription;
|
|
23
31
|
private dragable;
|
|
32
|
+
private layoutToolbarRef;
|
|
33
|
+
get isOpen(): boolean;
|
|
24
34
|
imageContent: ElementRef;
|
|
25
35
|
img: ElementRef;
|
|
26
|
-
|
|
36
|
+
layoutToolbar: TemplateRef<any>;
|
|
37
|
+
constructor(elementRef: ElementRef, sanitizer: DomSanitizer, imageUploaderService: TheImageUploaderService, cdr: ChangeDetectorRef, theContextService: TheContextService, thyPopover: ThyPopover, overlay: Overlay, viewContainerRef: ViewContainerRef);
|
|
27
38
|
beforeContextChange: (value: SlateElementContext<ImageElement>) => void;
|
|
28
39
|
ngOnInit(): void;
|
|
40
|
+
onContextChange(): void;
|
|
29
41
|
ngOnDestroy(): void;
|
|
30
42
|
ngAfterViewInit(): void;
|
|
31
43
|
uploadImage(file: File): Promise<void>;
|
|
@@ -42,6 +54,18 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
42
54
|
endDrag(event: MouseEvent): void;
|
|
43
55
|
cancelUpload(event: any): void;
|
|
44
56
|
preview($event: Event): void;
|
|
57
|
+
isShouldOpen(): boolean;
|
|
58
|
+
isShouldClose(): boolean;
|
|
59
|
+
openLayoutToolbar(): void;
|
|
60
|
+
closeLayoutToolbar(): void;
|
|
61
|
+
layoutActive(key: Alignment | LayoutTypes): boolean;
|
|
62
|
+
setImageNode(e: MouseEvent, partial: {
|
|
63
|
+
layout?: LayoutTypes;
|
|
64
|
+
align?: Alignment;
|
|
65
|
+
}): void;
|
|
66
|
+
setBlockCardLayoutAttr(): void;
|
|
67
|
+
onDelete(event: MouseEvent): void;
|
|
68
|
+
createPositionStrategy(): import("@angular/cdk/overlay").FlexibleConnectedPositionStrategy;
|
|
45
69
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheImageComponent, never>;
|
|
46
70
|
static ɵcmp: i0.ɵɵComponentDeclaration<TheImageComponent, "the-image, [theImage]", never, {}, {}, never, never>;
|
|
47
71
|
}
|
|
@@ -186,9 +186,16 @@
|
|
|
186
186
|
|
|
187
187
|
.image-container:hover .layer {
|
|
188
188
|
display: block;
|
|
189
|
+
|
|
190
|
+
&.readonly {
|
|
191
|
+
cursor: zoom-in;
|
|
192
|
+
}
|
|
189
193
|
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.the-image-toolbar {
|
|
190
197
|
|
|
191
|
-
.
|
|
192
|
-
|
|
198
|
+
.thy-icon-nav .thy-icon-nav-link {
|
|
199
|
+
margin-right: 5px;
|
|
193
200
|
}
|
|
194
201
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
1
|
+
import { Editor, Path } from 'slate';
|
|
2
|
+
import { Alignment, LayoutTypes } from '../../constants';
|
|
2
3
|
export declare const ImageEditor: {
|
|
3
4
|
openUpload(editor: Editor): void;
|
|
4
5
|
insertImages(editor: Editor, imageFiles: FileList | File[]): void;
|
|
5
6
|
verifyImage(editor: Editor, image: File): boolean;
|
|
6
7
|
isImageActive(editor: Editor): boolean;
|
|
8
|
+
setImageNode(editor: Editor, path: Path, partial: {
|
|
9
|
+
layout?: LayoutTypes;
|
|
10
|
+
align?: Alignment;
|
|
11
|
+
}): void;
|
|
7
12
|
};
|
|
@@ -17,6 +17,7 @@ export declare class TheQuickInsertComponent {
|
|
|
17
17
|
handleMousedownNativeElement(event: any): void;
|
|
18
18
|
constructor(renderer: Renderer2, elementRef: ElementRef, cdr: ChangeDetectorRef);
|
|
19
19
|
checkStatus(): void;
|
|
20
|
+
private isRichMediaScope;
|
|
20
21
|
private hasExcludeAttribute;
|
|
21
22
|
private updatePosition;
|
|
22
23
|
mouseEnter(event: MouseEvent): void;
|
package/styles/editor.scss
CHANGED
package/styles/index.scss
CHANGED
|
@@ -19,3 +19,4 @@
|
|
|
19
19
|
@import '../plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss';
|
|
20
20
|
@import '../plugins/font-size/toolbar-item.component.scss';
|
|
21
21
|
@import '../plugins/inline-code/inline-code.component.scss';
|
|
22
|
+
@import '../plugins/dnd/component/dnd.component.scss'
|
package/styles/typo.scss
CHANGED
|
@@ -170,4 +170,48 @@ $font-size-line-height: 1.5;
|
|
|
170
170
|
.remove-link.thy-icon-nav-link:hover {
|
|
171
171
|
color: $danger;
|
|
172
172
|
}
|
|
173
|
+
|
|
174
|
+
// 处理 block-card 图文混排
|
|
175
|
+
.slate-block,
|
|
176
|
+
.slate-block-card {
|
|
177
|
+
clear: both;
|
|
178
|
+
|
|
179
|
+
&.slate-element-paragraph,
|
|
180
|
+
&[class^="slate-element-heading"] {
|
|
181
|
+
clear: none;
|
|
182
|
+
}
|
|
183
|
+
&.slate-element-numbered-list,
|
|
184
|
+
&.slate-element-bulleted-list,
|
|
185
|
+
&.slate-element-block-quote {
|
|
186
|
+
clear: none;
|
|
187
|
+
display: flow-root;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.slate-block-card {
|
|
192
|
+
&[layout^="wrap-"] {
|
|
193
|
+
max-width: 100%;
|
|
194
|
+
clear: inherit;
|
|
195
|
+
}
|
|
196
|
+
&[layout="wrap-left"] {
|
|
197
|
+
float: left;
|
|
198
|
+
|
|
199
|
+
.image-content {
|
|
200
|
+
margin: 0 12px 0 auto;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
&[layout="wrap-right"] {
|
|
204
|
+
float: right;
|
|
205
|
+
|
|
206
|
+
.image-content {
|
|
207
|
+
margin: 0 auto 0 12px;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
// 处理相邻图文混排时的布局
|
|
214
|
+
[layout^="wrap-"] + [layout^="wrap-"] + .slate-block {
|
|
215
|
+
clear: both !important;
|
|
216
|
+
}
|
|
173
217
|
}
|
package/utils/dom.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { Element } from 'slate';
|
|
1
|
+
import { Element, NodeEntry } from 'slate';
|
|
2
2
|
import { DOMElement } from 'slate-angular';
|
|
3
|
+
import { TheEditor } from '../interfaces/editor';
|
|
4
|
+
import { NodeLevel } from '../constants';
|
|
3
5
|
/** Converts CSS pixel values to numbers, eg "123px" to 123. Returns NaN for non pixel values. */
|
|
4
6
|
export declare function coercePixelsFromCssValue(cssValue: string): number;
|
|
5
7
|
export declare function getElementWidth(element: HTMLElement): number;
|
|
@@ -8,3 +10,5 @@ export declare function getColsTotalWidth(cols: HTMLTableColElement[]): number;
|
|
|
8
10
|
export declare function getRowsTotalHeight(rows: HTMLTableRowElement[]): number;
|
|
9
11
|
export declare function useElementStyle(el: HTMLElement, element: Element): void;
|
|
10
12
|
export declare function getElementClassByPrefix(el: DOMElement, prefix: string): any;
|
|
13
|
+
export declare function findRelativeElementByPoint(editor: TheEditor, x: number, y: number, mode?: NodeLevel): DOMElement;
|
|
14
|
+
export declare function findNodeEntryByPoint(editor: TheEditor, x: number, y: number, mode?: NodeLevel): NodeEntry<Element> | null;
|