slate-angular 20.2.20 → 20.2.22
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 +122 -64
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/index.d.ts +14 -4
- package/package.json +1 -1
- package/styles/index.scss +3 -1
package/index.d.ts
CHANGED
|
@@ -315,6 +315,7 @@ declare class ListRender {
|
|
|
315
315
|
private differ;
|
|
316
316
|
initialized: boolean;
|
|
317
317
|
private preRenderingHTMLElement;
|
|
318
|
+
private virtualTopHeightElement;
|
|
318
319
|
constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletParent: () => HTMLElement, getOutletElement: () => HTMLElement | null);
|
|
319
320
|
initialize(children: Descendant[], parent: Ancestor, childrenContext: SlateChildrenContext, preRenderingCount?: number, childrenIndics?: number[]): void;
|
|
320
321
|
update(children: Descendant[], parent: Ancestor, childrenContext: SlateChildrenContext, preRenderingCount?: number, childrenIndics?: number[]): void;
|
|
@@ -336,6 +337,10 @@ interface VirtualViewResult {
|
|
|
336
337
|
|
|
337
338
|
type SafeAny = any;
|
|
338
339
|
|
|
340
|
+
declare class RemeasureConfig {
|
|
341
|
+
indics: number[];
|
|
342
|
+
tryUpdateViewport: boolean;
|
|
343
|
+
}
|
|
339
344
|
declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChecked, DoCheck {
|
|
340
345
|
elementRef: ElementRef;
|
|
341
346
|
renderer2: Renderer2;
|
|
@@ -398,7 +403,7 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
398
403
|
private tryUpdateVirtualViewportAnimId;
|
|
399
404
|
private editorResizeObserver?;
|
|
400
405
|
private editorScrollContainerResizeObserver?;
|
|
401
|
-
|
|
406
|
+
indicsOfNeedRemeasured$: Subject<RemeasureConfig>;
|
|
402
407
|
virtualScrollInitialized: boolean;
|
|
403
408
|
virtualTopHeightElement: HTMLElement;
|
|
404
409
|
virtualBottomHeightElement: HTMLElement;
|
|
@@ -414,12 +419,17 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
|
|
|
414
419
|
initializeVirtualScroll(): void;
|
|
415
420
|
getChangedIndics(previousValue: Descendant[]): any[];
|
|
416
421
|
setVirtualSpaceHeight(topHeight: number, bottomHeight?: number): void;
|
|
422
|
+
setTopHeightDebugInfo(accumulatedHeight: number, accumulatedEndIndex: number): void;
|
|
417
423
|
getActualVirtualTopHeight(): number;
|
|
418
|
-
|
|
424
|
+
appendPreRenderingToViewport(visibleStates: boolean[]): {
|
|
419
425
|
preRenderingCount: number;
|
|
420
426
|
childrenWithPreRendering: slate.BaseElement[];
|
|
421
427
|
childrenWithPreRenderingIndics: number[];
|
|
422
428
|
};
|
|
429
|
+
calculateIndicsStartAndEndBySelection(): {
|
|
430
|
+
minStartIndex: number;
|
|
431
|
+
minEndIndex: number;
|
|
432
|
+
};
|
|
423
433
|
private tryUpdateVirtualViewport;
|
|
424
434
|
private calculateVirtualViewport;
|
|
425
435
|
private applyVirtualView;
|
|
@@ -856,11 +866,11 @@ declare const buildHeightsAndAccumulatedHeights: (editor: AngularEditor, visible
|
|
|
856
866
|
heights: any[];
|
|
857
867
|
accumulatedHeights: any[];
|
|
858
868
|
};
|
|
859
|
-
declare const
|
|
869
|
+
declare const calculateAccumulatedTopHeight: (editor: AngularEditor, startIndex: number, visibleStates: boolean[]) => number;
|
|
860
870
|
declare const calcBusinessTop: (editor: AngularEditor) => number;
|
|
861
871
|
declare const scrollToElement: (editor: AngularEditor, element: Element$1, scrollTo: (scrollTop: number) => void) => void;
|
|
862
872
|
|
|
863
873
|
declare const roundTo: (value: number, precision?: number) => number;
|
|
864
874
|
|
|
865
|
-
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, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, SlateString, 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,
|
|
875
|
+
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, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, SlateString, 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, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isSelectionInsideVoid, isTemplateRef, isValid, isValidNumber, measureHeightByIndics, normalize, roundTo, scrollToElement, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setMinHeightByElement, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
866
876
|
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
package/styles/index.scss
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
@use '../components/block-card/block-card.component.scss';
|
|
2
2
|
.slate-editable-container {
|
|
3
3
|
display: block;
|
|
4
|
-
position: relative;
|
|
5
4
|
outline: none;
|
|
6
5
|
padding: 0 32px;
|
|
7
6
|
white-space: break-spaces;
|
|
7
|
+
.virtual-top-height {
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
8
10
|
& [contenteditable='true'] {
|
|
9
11
|
outline: none;
|
|
10
12
|
}
|