slate-angular 20.2.0-next.1 → 20.2.0-next.11
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 +502 -128
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/index.d.ts +15 -5
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ type OriginEvent = 'drag' | 'copy' | 'cut';
|
|
|
102
102
|
*/
|
|
103
103
|
interface AngularEditor extends CustomDOMEditor {
|
|
104
104
|
deleteCutData: () => void;
|
|
105
|
+
selectAll: () => void;
|
|
105
106
|
onKeydown: (event: KeyboardEvent) => void;
|
|
106
107
|
onClick: (event: MouseEvent) => void;
|
|
107
108
|
injector: Injector;
|
|
@@ -332,6 +333,7 @@ interface VirtualViewResult {
|
|
|
332
333
|
type SafeAny = any;
|
|
333
334
|
|
|
334
335
|
declare const JUST_NOW_UPDATED_VIRTUAL_VIEW: WeakMap<AngularEditor, boolean>;
|
|
336
|
+
declare const ELEMENT_KEY_TO_HEIGHTS: WeakMap<AngularEditor, Map<string, number>>;
|
|
335
337
|
declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChecked, DoCheck {
|
|
336
338
|
elementRef: ElementRef;
|
|
337
339
|
renderer2: Renderer2;
|
|
@@ -391,9 +393,9 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
391
393
|
private renderedChildren;
|
|
392
394
|
private virtualVisibleIndexes;
|
|
393
395
|
private measuredHeights;
|
|
394
|
-
private measurePending;
|
|
395
396
|
private refreshVirtualViewAnimId;
|
|
396
397
|
private measureVisibleHeightsAnimId;
|
|
398
|
+
private editorResizeObserver?;
|
|
397
399
|
constructor(elementRef: ElementRef, renderer2: Renderer2, cdr: ChangeDetectorRef, ngZone: NgZone, injector: Injector);
|
|
398
400
|
ngOnInit(): void;
|
|
399
401
|
ngOnChanges(simpleChanges: SimpleChanges): void;
|
|
@@ -413,20 +415,24 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
413
415
|
composePlaceholderDecorate(editor: Editor): SlatePlaceholder[];
|
|
414
416
|
generateDecorations(): slate.BaseRange[];
|
|
415
417
|
private shouldUseVirtual;
|
|
418
|
+
private businessHeight;
|
|
416
419
|
virtualScrollInitialized: boolean;
|
|
417
420
|
virtualTopHeightElement: HTMLElement;
|
|
418
421
|
virtualBottomHeightElement: HTMLElement;
|
|
419
422
|
virtualCenterOutlet: HTMLElement;
|
|
423
|
+
private debugOverlay?;
|
|
420
424
|
initializeVirtualScrolling(): void;
|
|
421
425
|
changeVirtualHeight(topHeight: number, bottomHeight: number): void;
|
|
426
|
+
private debugLog;
|
|
427
|
+
private doVirtualScroll;
|
|
422
428
|
private refreshVirtualView;
|
|
423
429
|
private applyVirtualView;
|
|
424
430
|
private diffVirtualView;
|
|
425
431
|
private getBlockHeight;
|
|
426
432
|
private buildAccumulatedHeight;
|
|
427
|
-
private getBufferBelowHeight;
|
|
428
433
|
private scheduleMeasureVisibleHeights;
|
|
429
434
|
private measureVisibleHeights;
|
|
435
|
+
private remeasureHeightByIndics;
|
|
430
436
|
private addEventListener;
|
|
431
437
|
private toSlateSelection;
|
|
432
438
|
private onDOMBeforeInput;
|
|
@@ -580,7 +586,9 @@ declare class BaseElementComponent<T extends Element$1 = Element$1, K extends An
|
|
|
580
586
|
onContextChange(): void;
|
|
581
587
|
updateChildrenView(): void;
|
|
582
588
|
getChildrenContext(): SlateChildrenContext;
|
|
583
|
-
|
|
589
|
+
stableHeight: null | number;
|
|
590
|
+
isStableHeight(): boolean;
|
|
591
|
+
getRealHeight(): number | Promise<number>;
|
|
584
592
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseElementComponent<any, any>, never>;
|
|
585
593
|
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseElementComponent<any, any>, never, never, {}, {}, never, never, true, never>;
|
|
586
594
|
}
|
|
@@ -640,7 +648,9 @@ declare abstract class BaseElementFlavour<T extends Element$1 = Element$1, K ext
|
|
|
640
648
|
onContextChange(): void;
|
|
641
649
|
updateChildrenView(): void;
|
|
642
650
|
getChildrenContext(): SlateChildrenContext;
|
|
643
|
-
|
|
651
|
+
stableHeight: null | number;
|
|
652
|
+
isStableHeight(): boolean;
|
|
653
|
+
getRealHeight(): number | Promise<number>;
|
|
644
654
|
abstract render(): void;
|
|
645
655
|
abstract rerender(): void;
|
|
646
656
|
}
|
|
@@ -807,5 +817,5 @@ declare const getSelection: (root: Document | ShadowRoot) => Selection | null;
|
|
|
807
817
|
declare const getContentHeight: (element: Element) => number;
|
|
808
818
|
declare const getZeroTextNode: () => DOMText;
|
|
809
819
|
|
|
810
|
-
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DEFAULT_ELEMENT_HEIGHT, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, 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, JUST_NOW_UPDATED_VIRTUAL_VIEW, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SLATE_DEBUG_KEY, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT, VIRTUAL_SCROLL_DEFAULT_BUFFER_COUNT, VoidTextFlavour, blobAsString, buildHTMLText, check, completeTable, createClipboardData, createText, createThrottleRAF, defaultScrollSelectionIntoView, fallbackCopyText, getBlockCardByNativeElement, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getContentHeight, getDataTransferClipboard, getDataTransferClipboardText, getNavigatorClipboard, getPlainText, getSelection, getSlateFragmentAttribute, getZeroTextNode, hasAfterContextChange, hasBeforeContextChange, hasBlockCard, hasBlockCardWithNode, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMText, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isTemplateRef, isValid, normalize, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
820
|
+
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DEFAULT_ELEMENT_HEIGHT, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, 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, JUST_NOW_UPDATED_VIRTUAL_VIEW, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SLATE_DEBUG_KEY, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT, VIRTUAL_SCROLL_DEFAULT_BUFFER_COUNT, VoidTextFlavour, blobAsString, buildHTMLText, check, completeTable, createClipboardData, createText, createThrottleRAF, defaultScrollSelectionIntoView, fallbackCopyText, getBlockCardByNativeElement, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getContentHeight, getDataTransferClipboard, getDataTransferClipboardText, getNavigatorClipboard, getPlainText, getSelection, getSlateFragmentAttribute, getZeroTextNode, hasAfterContextChange, hasBeforeContextChange, hasBlockCard, hasBlockCardWithNode, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMText, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isTemplateRef, isValid, normalize, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
811
821
|
export type { AfterContextChange, BaseEmbeddedView, BeforeContextChange, ClipboardData, ComponentType, OriginEvent, SafeAny, SlateChildrenContext, SlateElementAttributes, SlateElementContext, SlateError, SlateLeafContext, SlatePlaceholder, SlateStringContext, SlateTextContext, SlateViewContext, SlateVirtualScrollConfig, ThrottleRAF, ViewType, VirtualViewResult };
|
package/package.json
CHANGED