slate-angular 21.1.0 → 22.0.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/fesm2022/slate-angular.mjs +98 -77
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/package.json +3 -2
- package/types/slate-angular.d.ts +89 -75
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slate-angular",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "22.0.0-next.0",
|
|
4
4
|
"description": "Angular view layer for Slate",
|
|
5
5
|
"author": "pubuzhixing <pubuzhixing@gmail.com>",
|
|
6
6
|
"homepage": "https://github.com/worktile/slate-angular#readme",
|
|
@@ -41,5 +41,6 @@
|
|
|
41
41
|
},
|
|
42
42
|
"module": "fesm2022/slate-angular.mjs",
|
|
43
43
|
"typings": "types/slate-angular.d.ts",
|
|
44
|
-
"sideEffects": false
|
|
44
|
+
"sideEffects": false,
|
|
45
|
+
"type": "module"
|
|
45
46
|
}
|
package/types/slate-angular.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ declare enum SlateErrorCode {
|
|
|
20
20
|
interface SlateError {
|
|
21
21
|
code?: SlateErrorCode | number;
|
|
22
22
|
name?: string;
|
|
23
|
-
nativeError?: Error;
|
|
23
|
+
nativeError?: Error | unknown;
|
|
24
24
|
data?: Descendant[];
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -46,7 +46,7 @@ declare const CustomDOMEditor: {
|
|
|
46
46
|
isBlockCardRightCursor(editor: Editor): boolean;
|
|
47
47
|
getCardCursorNode(editor: AngularEditor, blockCardNode: Node, options: {
|
|
48
48
|
direction: "left" | "right" | "center";
|
|
49
|
-
}): ChildNode;
|
|
49
|
+
}): ChildNode | null;
|
|
50
50
|
toSlateCardEntry(editor: AngularEditor, node: DOMNode): NodeEntry;
|
|
51
51
|
androidPendingDiffs: (editor: Editor) => slate_dom.TextDiff[] | undefined;
|
|
52
52
|
androidScheduleFlush: (editor: Editor) => void;
|
|
@@ -150,7 +150,7 @@ declare const AngularEditor: {
|
|
|
150
150
|
moveBlockCardCursor(editor: AngularEditor, path: Path, options: {
|
|
151
151
|
direction: "left" | "right";
|
|
152
152
|
}): void;
|
|
153
|
-
focus: (editor:
|
|
153
|
+
focus: (editor: AngularEditor, options?: {
|
|
154
154
|
retries: number;
|
|
155
155
|
}) => void;
|
|
156
156
|
isEnabledVirtualScroll(editor: AngularEditor): boolean;
|
|
@@ -161,7 +161,7 @@ declare const AngularEditor: {
|
|
|
161
161
|
isBlockCardRightCursor(editor: Editor): boolean;
|
|
162
162
|
getCardCursorNode(editor: AngularEditor, blockCardNode: Node, options: {
|
|
163
163
|
direction: "left" | "right" | "center";
|
|
164
|
-
}): ChildNode;
|
|
164
|
+
}): ChildNode | null;
|
|
165
165
|
toSlateCardEntry(editor: AngularEditor, node: globalThis.Node): slate.NodeEntry;
|
|
166
166
|
androidPendingDiffs: (editor: Editor) => slate_dom.TextDiff[] | undefined;
|
|
167
167
|
androidScheduleFlush: (editor: Editor) => void;
|
|
@@ -207,14 +207,14 @@ declare const withAngular: <T extends Editor>(editor: T, clipboardFormatKey?: st
|
|
|
207
207
|
interface SlateViewContext<T extends AngularEditor = AngularEditor> {
|
|
208
208
|
editor: T;
|
|
209
209
|
trackBy: (element: Element$1) => any;
|
|
210
|
-
renderElement?: (element: Element$1) => ViewType;
|
|
211
|
-
renderLeaf?: (text: Text) => ViewType;
|
|
212
|
-
renderText?: (text: Text) => ViewType;
|
|
210
|
+
renderElement?: (element: Element$1) => ViewType | null;
|
|
211
|
+
renderLeaf?: (text: Text) => ViewType | null;
|
|
212
|
+
renderText?: (text: Text) => ViewType | null;
|
|
213
213
|
isStrictDecorate: boolean;
|
|
214
214
|
}
|
|
215
215
|
interface SlateChildrenContext {
|
|
216
216
|
parent: Ancestor;
|
|
217
|
-
selection: Range$1;
|
|
217
|
+
selection: Range$1 | null;
|
|
218
218
|
decorations: Range$1[];
|
|
219
219
|
decorate: (entry: NodeEntry) => Range$1[];
|
|
220
220
|
readonly: boolean;
|
|
@@ -265,11 +265,11 @@ declare abstract class BaseFlavour<T = SlateTextContext | SlateLeafContext | Sla
|
|
|
265
265
|
viewContext: SlateViewContext<K>;
|
|
266
266
|
get editor(): K;
|
|
267
267
|
nativeElement: HTMLElement;
|
|
268
|
-
abstract onContextChange():
|
|
269
|
-
abstract onInit():
|
|
270
|
-
abstract onDestroy():
|
|
271
|
-
abstract render():
|
|
272
|
-
abstract rerender():
|
|
268
|
+
abstract onContextChange(): void;
|
|
269
|
+
abstract onInit(): void;
|
|
270
|
+
abstract onDestroy(): void;
|
|
271
|
+
abstract render(): void;
|
|
272
|
+
abstract rerender(): void;
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
interface ComponentType<T> {
|
|
@@ -280,10 +280,13 @@ type ViewType = TemplateRef<any> | ComponentType<any> | BaseFlavour;
|
|
|
280
280
|
interface SlatePlaceholder extends BaseRange {
|
|
281
281
|
placeholder: string;
|
|
282
282
|
}
|
|
283
|
+
type TextWithPlaceholder = Text & {
|
|
284
|
+
placeholder?: string;
|
|
285
|
+
};
|
|
283
286
|
|
|
284
287
|
interface SlateVirtualScrollConfig {
|
|
285
288
|
enabled?: boolean;
|
|
286
|
-
scrollContainer?: HTMLElement;
|
|
289
|
+
scrollContainer?: HTMLElement | null;
|
|
287
290
|
scrollTop: number;
|
|
288
291
|
}
|
|
289
292
|
interface VirtualViewResult {
|
|
@@ -292,6 +295,7 @@ interface VirtualViewResult {
|
|
|
292
295
|
top: number;
|
|
293
296
|
bottom: number;
|
|
294
297
|
heights: number[];
|
|
298
|
+
accumulatedHeights?: number[];
|
|
295
299
|
}
|
|
296
300
|
|
|
297
301
|
type SafeAny = any;
|
|
@@ -307,7 +311,7 @@ declare class SlateBlockCard {
|
|
|
307
311
|
initializeCenter(rootNodes: HTMLElement[]): void;
|
|
308
312
|
onDestroy(): void;
|
|
309
313
|
}
|
|
310
|
-
declare const getBlockCardByNativeElement: (nativeElement: HTMLElement) => HTMLElement;
|
|
314
|
+
declare const getBlockCardByNativeElement: (nativeElement: HTMLElement) => HTMLElement | null;
|
|
311
315
|
|
|
312
316
|
declare class FlavourRef {
|
|
313
317
|
instance: BaseFlavour;
|
|
@@ -355,32 +359,32 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
355
359
|
private onTouchedCallback;
|
|
356
360
|
private onChangeCallback;
|
|
357
361
|
editor: AngularEditor;
|
|
358
|
-
renderElement
|
|
359
|
-
renderLeaf
|
|
360
|
-
renderText
|
|
362
|
+
renderElement?: (element: Element$1) => ViewType | null;
|
|
363
|
+
renderLeaf?: (text: Text) => ViewType | null;
|
|
364
|
+
renderText?: (text: Text) => ViewType | null;
|
|
361
365
|
decorate: (entry: NodeEntry) => Range$1[];
|
|
362
|
-
placeholderDecorate
|
|
366
|
+
placeholderDecorate?: (editor: Editor) => SlatePlaceholder[];
|
|
363
367
|
scrollSelectionIntoView: (editor: AngularEditor, domRange: DOMRange) => void;
|
|
364
368
|
isStrictDecorate: boolean;
|
|
365
369
|
trackBy: (node: Element$1) => any;
|
|
366
370
|
readonly: boolean;
|
|
367
|
-
placeholder
|
|
371
|
+
placeholder?: string;
|
|
368
372
|
set virtualScroll(config: SlateVirtualScrollConfig);
|
|
369
|
-
beforeInput
|
|
370
|
-
blur
|
|
371
|
-
click
|
|
372
|
-
compositionEnd
|
|
373
|
-
compositionUpdate
|
|
374
|
-
compositionStart
|
|
375
|
-
copy
|
|
376
|
-
cut
|
|
377
|
-
dragOver
|
|
378
|
-
dragStart
|
|
379
|
-
dragEnd
|
|
380
|
-
drop
|
|
381
|
-
focus
|
|
382
|
-
keydown
|
|
383
|
-
paste
|
|
373
|
+
beforeInput?: (event: Event) => void;
|
|
374
|
+
blur?: (event: Event) => void;
|
|
375
|
+
click?: (event: MouseEvent) => void;
|
|
376
|
+
compositionEnd?: (event: CompositionEvent) => void;
|
|
377
|
+
compositionUpdate?: (event: CompositionEvent) => void;
|
|
378
|
+
compositionStart?: (event: CompositionEvent) => void;
|
|
379
|
+
copy?: (event: ClipboardEvent) => void;
|
|
380
|
+
cut?: (event: ClipboardEvent) => void;
|
|
381
|
+
dragOver?: (event: DragEvent) => void;
|
|
382
|
+
dragStart?: (event: DragEvent) => void;
|
|
383
|
+
dragEnd?: (event: DragEvent) => void;
|
|
384
|
+
drop?: (event: DragEvent) => void;
|
|
385
|
+
focus?: (event: Event) => void;
|
|
386
|
+
keydown?: (event: KeyboardEvent) => void;
|
|
387
|
+
paste?: (event: ClipboardEvent) => void;
|
|
384
388
|
spellCheck: boolean;
|
|
385
389
|
autoCorrect: boolean;
|
|
386
390
|
autoCapitalize: boolean;
|
|
@@ -390,7 +394,7 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
390
394
|
get hasBeforeInputSupport(): boolean;
|
|
391
395
|
viewContainerRef: ViewContainerRef;
|
|
392
396
|
getOutletParent: () => any;
|
|
393
|
-
getOutletElement: () => HTMLElement;
|
|
397
|
+
getOutletElement: () => HTMLElement | null;
|
|
394
398
|
listRender: ListRender;
|
|
395
399
|
private virtualScrollConfig;
|
|
396
400
|
private inViewportChildren;
|
|
@@ -418,7 +422,7 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
418
422
|
initialize(): void;
|
|
419
423
|
private isEnabledVirtualScroll;
|
|
420
424
|
initializeVirtualScroll(): void;
|
|
421
|
-
getChangedIndics(previousValue: Descendant[]):
|
|
425
|
+
getChangedIndics(previousValue: Descendant[]): number[];
|
|
422
426
|
setVirtualSpaceHeight(topHeight: number, bottomHeight?: number): void;
|
|
423
427
|
setTopHeightDebugInfo(accumulatedHeight: number, accumulatedEndIndex: number): void;
|
|
424
428
|
getActualVirtualTopHeight(): number;
|
|
@@ -430,13 +434,13 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
430
434
|
calculateIndicsStartAndEndBySelection(): {
|
|
431
435
|
minStartIndex: number;
|
|
432
436
|
minEndIndex: number;
|
|
433
|
-
};
|
|
437
|
+
} | undefined;
|
|
434
438
|
private tryUpdateVirtualViewport;
|
|
435
439
|
private calculateVirtualViewport;
|
|
436
440
|
private applyVirtualView;
|
|
437
441
|
private diffVirtualViewport;
|
|
438
442
|
private addEventListener;
|
|
439
|
-
calculateVirtualScrollSelection(selection: Selection$1): slate.
|
|
443
|
+
calculateVirtualScrollSelection(selection: Selection$1): slate.BaseSelection;
|
|
440
444
|
private isSelectionInvisible;
|
|
441
445
|
toNativeSelection(autoScroll?: boolean): void;
|
|
442
446
|
onChange(): void;
|
|
@@ -492,7 +496,7 @@ declare class LeavesRender {
|
|
|
492
496
|
private contexts;
|
|
493
497
|
private viewTypes;
|
|
494
498
|
private differ;
|
|
495
|
-
constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletParent: () => HTMLElement, getOutletElement: () => HTMLElement);
|
|
499
|
+
constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletParent: () => HTMLElement, getOutletElement: () => HTMLElement | null);
|
|
496
500
|
initialize(context: SlateTextContext): void;
|
|
497
501
|
update(context: SlateTextContext): void;
|
|
498
502
|
private getLeaves;
|
|
@@ -508,8 +512,8 @@ declare abstract class BaseTextFlavour<T extends Text = Text> extends BaseFlavou
|
|
|
508
512
|
updateWeakMap(): void;
|
|
509
513
|
onDestroy(): void;
|
|
510
514
|
onContextChange(): void;
|
|
511
|
-
abstract render():
|
|
512
|
-
abstract rerender():
|
|
515
|
+
abstract render(): void;
|
|
516
|
+
abstract rerender(): void;
|
|
513
517
|
}
|
|
514
518
|
|
|
515
519
|
declare class DefaultTextFlavour extends BaseTextFlavour {
|
|
@@ -575,7 +579,7 @@ declare abstract class BaseComponent<T = SlateTextContext | SlateLeafContext | S
|
|
|
575
579
|
get nativeElement(): HTMLElement;
|
|
576
580
|
elementRef: ElementRef<any>;
|
|
577
581
|
cdr: ChangeDetectorRef;
|
|
578
|
-
abstract onContextChange():
|
|
582
|
+
abstract onContextChange(): void;
|
|
579
583
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseComponent<any, any>, never>;
|
|
580
584
|
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseComponent<any, any>, never, never, { "context": { "alias": "context"; "required": false; }; "viewContext": { "alias": "viewContext"; "required": false; }; }, {}, never, never, true, never>;
|
|
581
585
|
}
|
|
@@ -587,11 +591,11 @@ declare class BaseElementComponent<T extends Element$1 = Element$1, K extends An
|
|
|
587
591
|
childrenContext: SlateChildrenContext;
|
|
588
592
|
childrenOutletInstance?: SlateChildrenOutlet;
|
|
589
593
|
get element(): T;
|
|
590
|
-
get selection(): Range$1;
|
|
594
|
+
get selection(): Range$1 | null;
|
|
591
595
|
get decorations(): Range$1[];
|
|
592
596
|
get children(): Descendant[];
|
|
593
|
-
get isCollapsed(): boolean;
|
|
594
|
-
get isCollapsedAndNonReadonly(): boolean;
|
|
597
|
+
get isCollapsed(): boolean | null;
|
|
598
|
+
get isCollapsedAndNonReadonly(): boolean | null;
|
|
595
599
|
get readonly(): boolean;
|
|
596
600
|
getOutletParent: () => any;
|
|
597
601
|
getOutletElement: () => any;
|
|
@@ -628,7 +632,7 @@ declare class BaseTextComponent<T extends Text = Text> extends BaseComponent<Sla
|
|
|
628
632
|
* base class for custom leaf component
|
|
629
633
|
*/
|
|
630
634
|
declare class BaseLeafComponent extends BaseComponent<SlateLeafContext> implements OnInit {
|
|
631
|
-
placeholderElement: HTMLSpanElement;
|
|
635
|
+
placeholderElement: HTMLSpanElement | null;
|
|
632
636
|
stringRender: SlateStringRender | null;
|
|
633
637
|
isSlateLeaf: boolean;
|
|
634
638
|
get text(): Text;
|
|
@@ -648,11 +652,11 @@ declare const DEFAULT_ELEMENT_HEIGHT = 24;
|
|
|
648
652
|
declare abstract class BaseElementFlavour<T extends Element$1 = Element$1, K extends AngularEditor = AngularEditor> extends BaseFlavour<SlateElementContext<T>, K> {
|
|
649
653
|
childrenContext: SlateChildrenContext;
|
|
650
654
|
get element(): T;
|
|
651
|
-
get selection(): Range$1;
|
|
655
|
+
get selection(): Range$1 | null;
|
|
652
656
|
get decorations(): Range$1[];
|
|
653
657
|
get children(): Descendant[];
|
|
654
|
-
get isCollapsed(): boolean;
|
|
655
|
-
get isCollapsedAndNonReadonly(): boolean;
|
|
658
|
+
get isCollapsed(): boolean | null;
|
|
659
|
+
get isCollapsedAndNonReadonly(): boolean | null;
|
|
656
660
|
get readonly(): boolean;
|
|
657
661
|
getOutletParent: () => HTMLElement;
|
|
658
662
|
getOutletElement: () => HTMLElement | null;
|
|
@@ -670,7 +674,7 @@ declare abstract class BaseElementFlavour<T extends Element$1 = Element$1, K ext
|
|
|
670
674
|
}
|
|
671
675
|
|
|
672
676
|
declare abstract class BaseLeafFlavour extends BaseFlavour<SlateLeafContext> {
|
|
673
|
-
placeholderElement: HTMLSpanElement;
|
|
677
|
+
placeholderElement: HTMLSpanElement | null;
|
|
674
678
|
get text(): Text;
|
|
675
679
|
get leaf(): Text;
|
|
676
680
|
onInit(): void;
|
|
@@ -680,8 +684,8 @@ declare abstract class BaseLeafFlavour extends BaseFlavour<SlateLeafContext> {
|
|
|
680
684
|
updatePlaceholder(): void;
|
|
681
685
|
destroyPlaceholder(): void;
|
|
682
686
|
onDestroy(): void;
|
|
683
|
-
abstract render():
|
|
684
|
-
abstract rerender():
|
|
687
|
+
abstract render(): void;
|
|
688
|
+
abstract rerender(): void;
|
|
685
689
|
}
|
|
686
690
|
|
|
687
691
|
interface BeforeContextChange<T> {
|
|
@@ -690,8 +694,18 @@ interface BeforeContextChange<T> {
|
|
|
690
694
|
interface AfterContextChange {
|
|
691
695
|
afterContextChange: () => void;
|
|
692
696
|
}
|
|
697
|
+
type BeforeDomMoveOrigin = 'move' | 'virtual-scroll';
|
|
698
|
+
interface BeforeDomMove {
|
|
699
|
+
beforeDomMove: (origin: BeforeDomMoveOrigin) => void;
|
|
700
|
+
}
|
|
701
|
+
interface BeforeDomMoveRef {
|
|
702
|
+
instance: {
|
|
703
|
+
beforeDomMove: (origin: BeforeDomMoveOrigin) => void;
|
|
704
|
+
};
|
|
705
|
+
}
|
|
693
706
|
declare function hasBeforeContextChange<T>(value: any): value is BeforeContextChange<T>;
|
|
694
707
|
declare function hasAfterContextChange<T>(value: any): value is AfterContextChange;
|
|
708
|
+
declare function hasBeforeDomMove(value: any): value is BeforeDomMoveRef;
|
|
695
709
|
|
|
696
710
|
/**
|
|
697
711
|
* Symbols.
|
|
@@ -701,7 +715,7 @@ declare const PLACEHOLDER_SYMBOL: string;
|
|
|
701
715
|
* Weak map for associating the html element with the component.
|
|
702
716
|
*/
|
|
703
717
|
declare const ELEMENT_TO_COMPONENT: WeakMap<Node, BaseElementComponent | BaseFlavour>;
|
|
704
|
-
declare const EDITOR_TO_VIRTUAL_SCROLL_SELECTION: WeakMap<slate.BaseEditor, slate.
|
|
718
|
+
declare const EDITOR_TO_VIRTUAL_SCROLL_SELECTION: WeakMap<slate.BaseEditor, slate.BaseSelection>;
|
|
705
719
|
declare const EDITOR_TO_AFTER_VIEW_INIT_QUEUE: WeakMap<Editor, (() => void)[]>;
|
|
706
720
|
|
|
707
721
|
/**
|
|
@@ -757,7 +771,7 @@ declare const SLATE_DEBUG_KEY = "__SLATE_DEBUG__";
|
|
|
757
771
|
declare const SLATE_DEBUG_KEY_SCROLL_TOP = "__SLATE_DEBUG_SCROLL_TOP__";
|
|
758
772
|
declare const SLATE_DEBUG_KEY_UPDATE = "__SLATE_DEBUG_UPDATE__";
|
|
759
773
|
|
|
760
|
-
declare const shallowCompare: (obj1:
|
|
774
|
+
declare const shallowCompare: (obj1: Record<string, any>, obj2: Record<string, any>) => boolean;
|
|
761
775
|
/**
|
|
762
776
|
* Check if a list of decorator ranges are equal to another.
|
|
763
777
|
*
|
|
@@ -769,15 +783,15 @@ declare const isDecoratorRangeListEqual: (list: Range$1[], another: Range$1[]) =
|
|
|
769
783
|
|
|
770
784
|
declare const FAKE_LEFT_BLOCK_CARD_OFFSET = -1;
|
|
771
785
|
declare const FAKE_RIGHT_BLOCK_CARD_OFFSET = -2;
|
|
772
|
-
declare function hasBlockCardWithNode(node: DOMNode): boolean;
|
|
773
|
-
declare function hasBlockCard(selection: DOMSelection): boolean;
|
|
786
|
+
declare function hasBlockCardWithNode(node: DOMNode | null): boolean;
|
|
787
|
+
declare function hasBlockCard(selection: DOMSelection | null): boolean;
|
|
774
788
|
declare function getCardTargetAttribute(node: DOMNode): any;
|
|
775
|
-
declare function isCardLeft(node: DOMNode):
|
|
776
|
-
declare function isCardLeftByTargetAttr(targetAttr: any):
|
|
777
|
-
declare function isCardRightByTargetAttr(targetAttr: any):
|
|
778
|
-
declare function isCardCenterByTargetAttr(targetAttr: any):
|
|
789
|
+
declare function isCardLeft(node: DOMNode): any;
|
|
790
|
+
declare function isCardLeftByTargetAttr(targetAttr: any): any;
|
|
791
|
+
declare function isCardRightByTargetAttr(targetAttr: any): any;
|
|
792
|
+
declare function isCardCenterByTargetAttr(targetAttr: any): any;
|
|
779
793
|
|
|
780
|
-
declare const isValid: (value: Descendant) =>
|
|
794
|
+
declare const isValid: (value: Descendant) => boolean;
|
|
781
795
|
declare const check: (document: Element$1[]) => boolean;
|
|
782
796
|
declare function normalize(document: Element$1[]): slate.BaseElement[];
|
|
783
797
|
|
|
@@ -785,9 +799,9 @@ declare const createThrottleRAF: () => (fn: () => void) => void;
|
|
|
785
799
|
type ThrottleRAF = (fn: () => void) => void;
|
|
786
800
|
|
|
787
801
|
declare const buildHTMLText: (wrapper: HTMLElement, attach: HTMLElement, data: Element$1[]) => string;
|
|
788
|
-
declare const getClipboardFromHTMLText: (html: string) => ClipboardData;
|
|
802
|
+
declare const getClipboardFromHTMLText: (html: string) => ClipboardData | null;
|
|
789
803
|
declare const createClipboardData: (html: string, elements: Element$1[], text: string, files: File[]) => ClipboardData;
|
|
790
|
-
declare const getClipboardData: (dataTransfer?: DataTransfer) => Promise<ClipboardData>;
|
|
804
|
+
declare const getClipboardData: (dataTransfer?: DataTransfer) => Promise<ClipboardData | null>;
|
|
791
805
|
/**
|
|
792
806
|
* @param wrapper get wrapper.innerHTML string which will be written in clipboard
|
|
793
807
|
* @param attach attach must be child element of wrapper which will be attached json data
|
|
@@ -798,16 +812,16 @@ declare const fallbackCopyText: (text: string) => Promise<void>;
|
|
|
798
812
|
|
|
799
813
|
declare const setDataTransferClipboard: (dataTransfer: Pick<DataTransfer, "getData" | "setData"> | null, htmlText: string) => void;
|
|
800
814
|
declare const setDataTransferClipboardText: (data: Pick<DataTransfer, "getData" | "setData"> | null, text: string) => void;
|
|
801
|
-
declare const getDataTransferClipboard: (data: Pick<DataTransfer, "getData" | "setData"> | null) => ClipboardData;
|
|
802
|
-
declare const getDataTransferClipboardText: (data: Pick<DataTransfer, "getData" | "setData"> | null) => ClipboardData;
|
|
815
|
+
declare const getDataTransferClipboard: (data: Pick<DataTransfer, "getData" | "setData"> | null) => ClipboardData | null;
|
|
816
|
+
declare const getDataTransferClipboardText: (data: Pick<DataTransfer, "getData" | "setData"> | null) => ClipboardData | null;
|
|
803
817
|
|
|
804
818
|
declare const setNavigatorClipboard: (htmlText: string, data: Element$1[], text?: string) => Promise<void>;
|
|
805
|
-
declare const getNavigatorClipboard: () => Promise<ClipboardData>;
|
|
819
|
+
declare const getNavigatorClipboard: () => Promise<ClipboardData | null>;
|
|
806
820
|
|
|
807
821
|
declare const isClipboardReadSupported: () => boolean;
|
|
808
822
|
declare const isClipboardWriteSupported: () => boolean;
|
|
809
823
|
declare const isClipboardWriteTextSupported: () => boolean;
|
|
810
|
-
declare const isClipboardFile: (item: ClipboardItem) => string;
|
|
824
|
+
declare const isClipboardFile: (item: ClipboardItem) => string | undefined;
|
|
811
825
|
declare const isInvalidTable: (nodes?: Element[]) => boolean;
|
|
812
826
|
declare const stripHtml: (html: string) => string;
|
|
813
827
|
declare const blobAsString: (blob: Blob) => Promise<string>;
|
|
@@ -830,7 +844,7 @@ declare const getPlainText: (domNode: DOMNode) => string;
|
|
|
830
844
|
* Get the dom selection from Shadow Root if possible, otherwise from the document
|
|
831
845
|
*/
|
|
832
846
|
declare const getSelection: (root: Document | ShadowRoot) => Selection | null;
|
|
833
|
-
declare const getContentHeight: (element: Element) => number;
|
|
847
|
+
declare const getContentHeight: (element: globalThis.Element | null) => number;
|
|
834
848
|
declare const getZeroTextNode: () => DOMText;
|
|
835
849
|
|
|
836
850
|
declare const VIRTUAL_TOP_HEIGHT_CLASS_NAME = "virtual-top-height";
|
|
@@ -848,14 +862,14 @@ declare const EDITOR_TO_IS_FROM_SCROLL_TO: WeakMap<AngularEditor, boolean>;
|
|
|
848
862
|
declare const isValidNumber: (value: any) => boolean;
|
|
849
863
|
declare const debugLog: (type: "log" | "warn", ...args: any[]) => void;
|
|
850
864
|
declare const cacheHeightByElement: (editor: AngularEditor, element: Element$1, height: number) => void;
|
|
851
|
-
declare const setMinHeightByElement: (editor: AngularEditor, element: Element$1, rootElementMarginBottom:
|
|
852
|
-
declare const clearMinHeightByElement: (editor: AngularEditor, element: Element$1) => boolean;
|
|
853
|
-
declare const calcHeightByElement: (editor: AngularEditor, element: Element$1) => number;
|
|
865
|
+
declare const setMinHeightByElement: (editor: AngularEditor, element: Element$1, rootElementMarginBottom: number) => void;
|
|
866
|
+
declare const clearMinHeightByElement: (editor: AngularEditor, element: Element$1) => boolean | undefined;
|
|
867
|
+
declare const calcHeightByElement: (editor: AngularEditor, element: Element$1) => number | undefined;
|
|
854
868
|
declare const measureHeightByIndics: (editor: AngularEditor, indics: number[], source: "need-remove-from-top" | "need-add-from-top" | "data-changed") => boolean;
|
|
855
869
|
declare const getBusinessTop: (editor: AngularEditor) => number;
|
|
856
870
|
declare const getViewportHeight: (editor: AngularEditor) => number;
|
|
857
871
|
declare const getScrollContainer: (editor: AngularEditor) => HTMLElement;
|
|
858
|
-
declare const getCachedHeightByElement: (editor: AngularEditor, element: Element$1) => number;
|
|
872
|
+
declare const getCachedHeightByElement: (editor: AngularEditor, element: Element$1) => number | null;
|
|
859
873
|
declare const buildHeightsAndAccumulatedHeights: (editor: AngularEditor, visibleStates: boolean[]) => {
|
|
860
874
|
heights: any[];
|
|
861
875
|
accumulatedHeights: any[];
|
|
@@ -866,5 +880,5 @@ declare const scrollToElement: (editor: AngularEditor, element: Element$1, scrol
|
|
|
866
880
|
|
|
867
881
|
declare const roundTo: (value: number, precision?: number) => number;
|
|
868
882
|
|
|
869
|
-
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DEFAULT_ELEMENT_HEIGHT, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, EDITOR_TO_BUSINESS_TOP, EDITOR_TO_IS_FROM_SCROLL_TO, EDITOR_TO_ROOT_NODE_WIDTH, EDITOR_TO_VIEWPORT_HEIGHT, EDITOR_TO_VIRTUAL_SCROLL_CONFIG, EDITOR_TO_VIRTUAL_SCROLL_SELECTION, ELEMENT_KEY_TO_HEIGHTS, ELEMENT_TO_COMPONENT, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, FlavourRef, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_IOS, IS_QQBROWSER, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SLATE_DEBUG_KEY, SLATE_DEBUG_KEY_SCROLL_TOP, SLATE_DEBUG_KEY_UPDATE, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, VIRTUAL_BOTTOM_HEIGHT_CLASS_NAME, VIRTUAL_CENTER_OUTLET_CLASS_NAME, VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT, VIRTUAL_TOP_HEIGHT_CLASS_NAME, VoidTextFlavour, blobAsString, buildHTMLText, buildHeightsAndAccumulatedHeights, cacheHeightByElement, calcBusinessTop, calcHeightByElement, calculateAccumulatedTopHeight, check, clearMinHeightByElement, completeTable, createClipboardData, createText, createThrottleRAF, debugLog, defaultScrollSelectionIntoView, fallbackCopyText, getBlockCardByNativeElement, getBusinessTop, getCachedHeightByElement, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getContentHeight, getDataTransferClipboard, getDataTransferClipboardText, getNavigatorClipboard, getPlainText, getScrollContainer, getSelection, getSlateFragmentAttribute, getViewportHeight, getZeroTextNode, hasAfterContextChange, hasBeforeContextChange, hasBlockCard, hasBlockCardWithNode, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMText, isDebug, isDebugScrollTop, isDebugUpdate, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isSelectionInsideVoid, isTemplateRef, isValid, isValidNumber, measureHeightByIndics, normalize, roundTo, scrollToElement, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setMinHeightByElement, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
870
|
-
export type { AfterContextChange, BaseEmbeddedView, BeforeContextChange, ClipboardData, ComponentType, OriginEvent, SafeAny, SlateChildrenContext, SlateElementAttributes, SlateElementContext, SlateError, SlateLeafContext, SlatePlaceholder, SlateStringContext, SlateTextContext, SlateViewContext, SlateVirtualScrollConfig, ThrottleRAF, ViewType, VirtualViewResult };
|
|
883
|
+
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DEFAULT_ELEMENT_HEIGHT, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, EDITOR_TO_BUSINESS_TOP, EDITOR_TO_IS_FROM_SCROLL_TO, EDITOR_TO_ROOT_NODE_WIDTH, EDITOR_TO_VIEWPORT_HEIGHT, EDITOR_TO_VIRTUAL_SCROLL_CONFIG, EDITOR_TO_VIRTUAL_SCROLL_SELECTION, ELEMENT_KEY_TO_HEIGHTS, ELEMENT_TO_COMPONENT, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, FlavourRef, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_IOS, IS_QQBROWSER, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SLATE_DEBUG_KEY, SLATE_DEBUG_KEY_SCROLL_TOP, SLATE_DEBUG_KEY_UPDATE, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, VIRTUAL_BOTTOM_HEIGHT_CLASS_NAME, VIRTUAL_CENTER_OUTLET_CLASS_NAME, VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT, VIRTUAL_TOP_HEIGHT_CLASS_NAME, VoidTextFlavour, blobAsString, buildHTMLText, buildHeightsAndAccumulatedHeights, cacheHeightByElement, calcBusinessTop, calcHeightByElement, calculateAccumulatedTopHeight, check, clearMinHeightByElement, completeTable, createClipboardData, createText, createThrottleRAF, debugLog, defaultScrollSelectionIntoView, fallbackCopyText, getBlockCardByNativeElement, getBusinessTop, getCachedHeightByElement, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getContentHeight, getDataTransferClipboard, getDataTransferClipboardText, getNavigatorClipboard, getPlainText, getScrollContainer, getSelection, getSlateFragmentAttribute, getViewportHeight, getZeroTextNode, hasAfterContextChange, hasBeforeContextChange, hasBeforeDomMove, hasBlockCard, hasBlockCardWithNode, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMText, isDebug, isDebugScrollTop, isDebugUpdate, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isSelectionInsideVoid, isTemplateRef, isValid, isValidNumber, measureHeightByIndics, normalize, roundTo, scrollToElement, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setMinHeightByElement, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
884
|
+
export type { AfterContextChange, BaseEmbeddedView, BeforeContextChange, BeforeDomMove, BeforeDomMoveOrigin, BeforeDomMoveRef, ClipboardData, ComponentType, OriginEvent, SafeAny, SlateChildrenContext, SlateElementAttributes, SlateElementContext, SlateError, SlateLeafContext, SlatePlaceholder, SlateStringContext, SlateTextContext, SlateViewContext, SlateVirtualScrollConfig, TextWithPlaceholder, ThrottleRAF, ViewType, VirtualViewResult };
|