slate-angular 20.2.22 → 21.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/index.d.ts CHANGED
@@ -203,28 +203,6 @@ declare const AngularEditor: {
203
203
 
204
204
  declare const withAngular: <T extends Editor>(editor: T, clipboardFormatKey?: string) => T & AngularEditor;
205
205
 
206
- declare abstract class BaseFlavour<T = SlateTextContext | SlateLeafContext | SlateElementContext, K extends AngularEditor = AngularEditor> {
207
- static isFlavour: boolean;
208
- initialized: boolean;
209
- protected _context: T;
210
- viewContainerRef: ViewContainerRef;
211
- set context(value: T);
212
- get context(): T;
213
- viewContext: SlateViewContext<K>;
214
- get editor(): K;
215
- nativeElement: HTMLElement;
216
- abstract onContextChange(): any;
217
- abstract onInit(): any;
218
- abstract onDestroy(): any;
219
- abstract render(): any;
220
- abstract rerender(): any;
221
- }
222
-
223
- interface ComponentType<T> {
224
- new (...args: any[]): T;
225
- }
226
- type ViewType = TemplateRef<any> | ComponentType<any> | BaseFlavour;
227
-
228
206
  interface SlateViewContext<T extends AngularEditor = AngularEditor> {
229
207
  editor: T;
230
208
  trackBy: (element: Element$1) => any;
@@ -276,10 +254,47 @@ interface SlateStringContext {
276
254
  type: 'string' | 'lineBreakEmptyString';
277
255
  }
278
256
 
257
+ declare abstract class BaseFlavour<T = SlateTextContext | SlateLeafContext | SlateElementContext, K extends AngularEditor = AngularEditor> {
258
+ static isFlavour: boolean;
259
+ initialized: boolean;
260
+ protected _context: T;
261
+ viewContainerRef: ViewContainerRef;
262
+ set context(value: T);
263
+ get context(): T;
264
+ viewContext: SlateViewContext<K>;
265
+ get editor(): K;
266
+ nativeElement: HTMLElement;
267
+ abstract onContextChange(): any;
268
+ abstract onInit(): any;
269
+ abstract onDestroy(): any;
270
+ abstract render(): any;
271
+ abstract rerender(): any;
272
+ }
273
+
274
+ interface ComponentType<T> {
275
+ new (...args: any[]): T;
276
+ }
277
+ type ViewType = TemplateRef<any> | ComponentType<any> | BaseFlavour;
278
+
279
279
  interface SlatePlaceholder extends BaseRange {
280
280
  placeholder: string;
281
281
  }
282
282
 
283
+ interface SlateVirtualScrollConfig {
284
+ enabled?: boolean;
285
+ scrollContainer?: HTMLElement;
286
+ scrollTop: number;
287
+ }
288
+ interface VirtualViewResult {
289
+ inViewportChildren: Element$1[];
290
+ inViewportIndics: number[];
291
+ top: number;
292
+ bottom: number;
293
+ heights: number[];
294
+ }
295
+
296
+ type SafeAny = any;
297
+
283
298
  declare const SLATE_BLOCK_CARD_CLASS_NAME = "slate-block-card";
284
299
  declare class SlateBlockCard {
285
300
  centerRootNodes: HTMLElement[];
@@ -322,31 +337,11 @@ declare class ListRender {
322
337
  destroy(): void;
323
338
  }
324
339
 
325
- interface SlateVirtualScrollConfig {
326
- enabled?: boolean;
327
- scrollContainer?: HTMLElement;
328
- scrollTop: number;
329
- }
330
- interface VirtualViewResult {
331
- inViewportChildren: Element$1[];
332
- inViewportIndics: number[];
333
- top: number;
334
- bottom: number;
335
- heights: number[];
336
- }
337
-
338
- type SafeAny = any;
339
-
340
340
  declare class RemeasureConfig {
341
341
  indics: number[];
342
342
  tryUpdateViewport: boolean;
343
343
  }
344
344
  declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewChecked, DoCheck {
345
- elementRef: ElementRef;
346
- renderer2: Renderer2;
347
- cdr: ChangeDetectorRef;
348
- private ngZone;
349
- private injector;
350
345
  viewContext: SlateViewContext;
351
346
  context: SlateChildrenContext;
352
347
  private destroy$;
@@ -408,7 +403,12 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
408
403
  virtualTopHeightElement: HTMLElement;
409
404
  virtualBottomHeightElement: HTMLElement;
410
405
  virtualCenterOutlet: HTMLElement;
411
- constructor(elementRef: ElementRef, renderer2: Renderer2, cdr: ChangeDetectorRef, ngZone: NgZone, injector: Injector);
406
+ elementRef: ElementRef<any>;
407
+ renderer2: Renderer2;
408
+ cdr: ChangeDetectorRef;
409
+ ngZone: NgZone;
410
+ injector: Injector;
411
+ constructor();
412
412
  ngOnInit(): void;
413
413
  ngOnChanges(simpleChanges: SimpleChanges): void;
414
414
  registerOnChange(fn: any): void;
@@ -443,7 +443,7 @@ declare class SlateEditable implements OnInit, OnChanges, OnDestroy, AfterViewCh
443
443
  ngDoCheck(): void;
444
444
  forceRender(): void;
445
445
  render(): void;
446
- updateListRenderAndRemeasureHeights(): void;
446
+ updateListRenderAndRemeasureHeights(origin: 'render' | 'forceRender'): void;
447
447
  updateContext(): boolean;
448
448
  initializeContext(): void;
449
449
  initializeViewContext(): void;
@@ -475,9 +475,8 @@ declare const defaultScrollSelectionIntoView: (editor: AngularEditor, domRange:
475
475
  declare const isSelectionInsideVoid: (editor: AngularEditor) => boolean;
476
476
 
477
477
  declare class SlateChildrenOutlet {
478
- private elementRef;
479
- constructor(elementRef: ElementRef<HTMLElement>);
480
- getNativeElement(): HTMLElement;
478
+ elementRef: ElementRef<any>;
479
+ getNativeElement(): any;
481
480
  static ɵfac: i0.ɵɵFactoryDeclaration<SlateChildrenOutlet, never>;
482
481
  static ɵcmp: i0.ɵɵComponentDeclaration<SlateChildrenOutlet, "slate-children-outlet", never, {}, {}, never, never, true, never>;
483
482
  }
@@ -527,7 +526,6 @@ declare const createText: (text: string) => {
527
526
  declare class SlateString {
528
527
  context: SlateLeafContext;
529
528
  viewContext: SlateViewContext;
530
- ngOnInit(): void;
531
529
  static ɵfac: i0.ɵɵFactoryDeclaration<SlateString, never>;
532
530
  static ɵcmp: i0.ɵɵComponentDeclaration<SlateString, "span[slateString]", never, { "context": { "alias": "context"; "required": false; }; "viewContext": { "alias": "viewContext"; "required": false; }; }, {}, never, never, true, never>;
533
531
  }
@@ -602,7 +600,7 @@ declare class BaseElementComponent<T extends Element$1 = Element$1, K extends An
602
600
  get isCollapsedAndNonReadonly(): boolean;
603
601
  get readonly(): boolean;
604
602
  getOutletParent: () => any;
605
- getOutletElement: () => HTMLElement;
603
+ getOutletElement: () => any;
606
604
  listRender: ListRender;
607
605
  ngOnInit(): void;
608
606
  afterViewInit(): void;
@@ -624,7 +622,7 @@ declare class BaseTextComponent<T extends Text = Text> extends BaseComponent<Sla
624
622
  leavesRender: LeavesRender;
625
623
  childrenOutletInstance?: SlateChildrenOutlet;
626
624
  getOutletParent: () => any;
627
- getOutletElement: () => HTMLElement;
625
+ getOutletElement: () => any;
628
626
  ngOnInit(): void;
629
627
  updateWeakMap(): void;
630
628
  ngOnDestroy(): void;
@@ -763,6 +761,7 @@ declare const HAS_BEFORE_INPUT_SUPPORT: boolean;
763
761
  declare const VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT = 32;
764
762
  declare const SLATE_DEBUG_KEY = "__SLATE_DEBUG__";
765
763
  declare const SLATE_DEBUG_KEY_SCROLL_TOP = "__SLATE_DEBUG_SCROLL_TOP__";
764
+ declare const SLATE_DEBUG_KEY_UPDATE = "__SLATE_DEBUG_UPDATE__";
766
765
 
767
766
  declare const shallowCompare: (obj1: {}, obj2: {}) => boolean;
768
767
  /**
@@ -845,6 +844,7 @@ declare const VIRTUAL_BOTTOM_HEIGHT_CLASS_NAME = "virtual-bottom-height";
845
844
  declare const VIRTUAL_CENTER_OUTLET_CLASS_NAME = "virtual-center-outlet";
846
845
  declare const isDebug: boolean;
847
846
  declare const isDebugScrollTop: boolean;
847
+ declare const isDebugUpdate: boolean;
848
848
  declare const ELEMENT_KEY_TO_HEIGHTS: WeakMap<AngularEditor, Map<string, number>>;
849
849
  declare const EDITOR_TO_BUSINESS_TOP: WeakMap<AngularEditor, number>;
850
850
  declare const EDITOR_TO_VIRTUAL_SCROLL_CONFIG: WeakMap<AngularEditor, SlateVirtualScrollConfig>;
@@ -857,7 +857,7 @@ declare const cacheHeightByElement: (editor: AngularEditor, element: Element$1,
857
857
  declare const setMinHeightByElement: (editor: AngularEditor, element: Element$1, rootElementMarginBottom: any) => void;
858
858
  declare const clearMinHeightByElement: (editor: AngularEditor, element: Element$1) => boolean;
859
859
  declare const calcHeightByElement: (editor: AngularEditor, element: Element$1) => number;
860
- declare const measureHeightByIndics: (editor: AngularEditor, indics: number[], force?: boolean) => boolean;
860
+ declare const measureHeightByIndics: (editor: AngularEditor, indics: number[], source: "need-remove-from-top" | "need-add-from-top" | "data-changed") => boolean;
861
861
  declare const getBusinessTop: (editor: AngularEditor) => number;
862
862
  declare const getViewportHeight: (editor: AngularEditor) => number;
863
863
  declare const getScrollContainer: (editor: AngularEditor) => HTMLElement;
@@ -872,5 +872,5 @@ declare const scrollToElement: (editor: AngularEditor, element: Element$1, scrol
872
872
 
873
873
  declare const roundTo: (value: number, precision?: number) => number;
874
874
 
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 };
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, 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 };
876
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slate-angular",
3
- "version": "20.2.22",
3
+ "version": "21.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",