slate-angular 20.2.21 → 20.2.23

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/index.d.ts CHANGED
@@ -419,6 +419,7 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
419
419
  initializeVirtualScroll(): void;
420
420
  getChangedIndics(previousValue: Descendant[]): any[];
421
421
  setVirtualSpaceHeight(topHeight: number, bottomHeight?: number): void;
422
+ setTopHeightDebugInfo(accumulatedHeight: number, accumulatedEndIndex: number): void;
422
423
  getActualVirtualTopHeight(): number;
423
424
  appendPreRenderingToViewport(visibleStates: boolean[]): {
424
425
  preRenderingCount: number;
@@ -442,7 +443,7 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
442
443
  ngDoCheck(): void;
443
444
  forceRender(): void;
444
445
  render(): void;
445
- updateListRenderAndRemeasureHeights(): void;
446
+ updateListRenderAndRemeasureHeights(origin: 'render' | 'forceRender'): void;
446
447
  updateContext(): boolean;
447
448
  initializeContext(): void;
448
449
  initializeViewContext(): void;
@@ -762,6 +763,7 @@ declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
762
763
  declare const VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT = 32;
763
764
  declare const SLATE_DEBUG_KEY = "__SLATE_DEBUG__";
764
765
  declare const SLATE_DEBUG_KEY_SCROLL_TOP = "__SLATE_DEBUG_SCROLL_TOP__";
766
+ declare const SLATE_DEBUG_KEY_UPDATE = "__SLATE_DEBUG_UPDATE__";
765
767
 
766
768
  declare const shallowCompare: (obj1: {}, obj2: {}) => boolean;
767
769
  /**
@@ -844,6 +846,7 @@ declare const VIRTUAL_BOTTOM_HEIGHT_CLASS_NAME = "virtual-bottom-height";
844
846
  declare const VIRTUAL_CENTER_OUTLET_CLASS_NAME = "virtual-center-outlet";
845
847
  declare const isDebug: boolean;
846
848
  declare const isDebugScrollTop: boolean;
849
+ declare const isDebugUpdate: boolean;
847
850
  declare const ELEMENT_KEY_TO_HEIGHTS: WeakMap<AngularEditor, Map<string, number>>;
848
851
  declare const EDITOR_TO_BUSINESS_TOP: WeakMap<AngularEditor, number>;
849
852
  declare const EDITOR_TO_VIRTUAL_SCROLL_CONFIG: WeakMap<AngularEditor, SlateVirtualScrollConfig>;
@@ -856,7 +859,7 @@ declare const cacheHeightByElement: (editor: AngularEditor, element: Element$1,
856
859
  declare const setMinHeightByElement: (editor: AngularEditor, element: Element$1, rootElementMarginBottom: any) => void;
857
860
  declare const clearMinHeightByElement: (editor: AngularEditor, element: Element$1) => boolean;
858
861
  declare const calcHeightByElement: (editor: AngularEditor, element: Element$1) => number;
859
- declare const measureHeightByIndics: (editor: AngularEditor, indics: number[], force?: boolean) => boolean;
862
+ declare const measureHeightByIndics: (editor: AngularEditor, indics: number[], source: "need-remove-from-top" | "need-add-from-top" | "data-changed") => boolean;
860
863
  declare const getBusinessTop: (editor: AngularEditor) => number;
861
864
  declare const getViewportHeight: (editor: AngularEditor) => number;
862
865
  declare const getScrollContainer: (editor: AngularEditor) => HTMLElement;
@@ -871,5 +874,5 @@ declare const scrollToElement: (editor: AngularEditor, element: Element$1, scrol
871
874
 
872
875
  declare const roundTo: (value: number, precision?: number) => number;
873
876
 
874
- 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 };
877
+ 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, 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, isDebugUpdate, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isSelectionInsideVoid, isTemplateRef, isValid, isValidNumber, measureHeightByIndics, normalize, roundTo, scrollToElement, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setMinHeightByElement, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
875
878
  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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slate-angular",
3
- "version": "20.2.21",
3
+ "version": "20.2.23",
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",
package/styles/index.scss CHANGED
@@ -4,6 +4,9 @@
4
4
  outline: none;
5
5
  padding: 0 32px;
6
6
  white-space: break-spaces;
7
+ .virtual-top-height {
8
+ overflow: hidden;
9
+ }
7
10
  & [contenteditable='true'] {
8
11
  outline: none;
9
12
  }