slate-angular 16.1.0-next.4 → 16.1.0-next.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "slate-angular",
3
- "version": "16.1.0-next.4",
3
+ "version": "16.1.0-next.6",
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/view/base.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit, ViewContainerRef } from '@angular/core';
2
2
  import { AngularEditor } from '../plugins/angular-editor';
3
3
  import { SlateViewContext, SlateElementContext, SlateTextContext, SlateLeafContext } from './context';
4
- import { Descendant, Element, Path, Range, Text } from 'slate';
4
+ import { Descendant, Element, Range, Text } from 'slate';
5
5
  import { SlateChildrenContext } from './context';
6
6
  import { ListRender } from './render/list-render';
7
7
  import { LeavesRender } from './render/leaves-render';
@@ -19,6 +19,7 @@ export interface BaseEmbeddedView<T, K extends AngularEditor = AngularEditor> {
19
19
  export declare abstract class BaseComponent<T = SlateTextContext | SlateLeafContext | SlateElementContext, K extends AngularEditor = AngularEditor> {
20
20
  elementRef: ElementRef;
21
21
  cdr: ChangeDetectorRef;
22
+ initialized: boolean;
22
23
  protected _context: T;
23
24
  set context(value: T);
24
25
  get context(): T;
@@ -34,7 +35,6 @@ export declare abstract class BaseComponent<T = SlateTextContext | SlateLeafCont
34
35
  * base class for custom leaf component
35
36
  */
36
37
  export declare class BaseLeafComponent extends BaseComponent<SlateLeafContext> implements OnInit {
37
- initialized: boolean;
38
38
  placeholderElement: HTMLSpanElement;
39
39
  isSlateLeaf: boolean;
40
40
  get text(): Text;
@@ -53,11 +53,9 @@ export declare class BaseLeafComponent extends BaseComponent<SlateLeafContext> i
53
53
  */
54
54
  export declare class BaseElementComponent<T extends Element = Element, K extends AngularEditor = AngularEditor> extends BaseComponent<SlateElementContext<T>, K> implements OnInit, OnDestroy {
55
55
  viewContainerRef: ViewContainerRef;
56
- initialized: boolean;
57
56
  childrenContext: SlateChildrenContext;
58
57
  get element(): T;
59
58
  get selection(): Range;
60
- get path(): Path;
61
59
  get decorations(): Range[];
62
60
  get children(): Descendant[];
63
61
  get isCollapsed(): boolean;
@@ -77,7 +75,6 @@ export declare class BaseElementComponent<T extends Element = Element, K extends
77
75
  * base class for custom text component
78
76
  */
79
77
  export declare class BaseTextComponent<T extends Text = Text> extends BaseComponent<SlateTextContext<T>> implements OnInit, OnDestroy {
80
- initialized: boolean;
81
78
  viewContainerRef: ViewContainerRef;
82
79
  get text(): T;
83
80
  leavesRender: LeavesRender;
package/view/context.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { NodeEntry, Range, Element, Ancestor, Text, Path } from 'slate';
1
+ import { NodeEntry, Range, Element, Ancestor, Text } from 'slate';
2
2
  import { SlateStringTemplate } from '../components/string/template.component';
3
3
  import { AngularEditor } from '../plugins/angular-editor';
4
4
  import { ComponentType, ViewType } from '../types/view';
@@ -26,7 +26,6 @@ export interface SlateChildrenContext {
26
26
  export interface SlateElementContext<T extends Element = Element> {
27
27
  element: T;
28
28
  selection: Range | null;
29
- path: Path;
30
29
  decorations: Range[];
31
30
  attributes: SlateElementAttributes;
32
31
  decorate: (entry: NodeEntry) => Range[];
@@ -15,8 +15,8 @@ export declare class ListRender {
15
15
  private differ;
16
16
  initialized: boolean;
17
17
  constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletElement: () => HTMLElement);
18
- initialize(children: Descendant[], parent: Ancestor, parentPath: Path, childrenContext: SlateChildrenContext): void;
19
- update(children: Descendant[], parent: Ancestor, parentPath: Path, childrenContext: SlateChildrenContext): void;
18
+ initialize(children: Descendant[], parent: Ancestor, childrenContext: SlateChildrenContext): void;
19
+ update(children: Descendant[], parent: Ancestor, childrenContext: SlateChildrenContext): void;
20
20
  }
21
21
  export declare function getContext(index: number, item: Descendant, parentPath: Path, childrenContext: SlateChildrenContext, viewContext: SlateViewContext): SlateElementContext | SlateTextContext;
22
22
  export declare function getCommonContext(index: number, item: Descendant, parentPath: Path, viewContext: SlateViewContext, childrenContext: SlateChildrenContext): {
@@ -3,7 +3,7 @@ import { ComponentRef, EmbeddedViewRef, ViewContainerRef } from '@angular/core';
3
3
  import { ViewType } from '../../types/view';
4
4
  import { SlateElementContext, SlateLeafContext, SlateTextContext, SlateViewContext } from '../context';
5
5
  import { SlateBlockCard } from '../../components/block-card/block-card.component';
6
- export declare function createEmbeddedViewOrComponent(viewType: ViewType, context: any, viewContext: SlateViewContext, viewContainerRef: ViewContainerRef): ComponentRef<any> | EmbeddedViewRef<any>;
6
+ export declare function createEmbeddedViewOrComponent(viewType: ViewType, context: any, viewContext: SlateViewContext, viewContainerRef: ViewContainerRef): EmbeddedViewRef<any> | ComponentRef<any>;
7
7
  export declare function renderView(view: EmbeddedViewRef<any> | ComponentRef<any>): void;
8
8
  export declare function updateContext(view: EmbeddedViewRef<any> | ComponentRef<any>, newContext: SlateElementContext | SlateTextContext | SlateLeafContext, viewContext: SlateViewContext): void;
9
9
  export declare function mount(views: (EmbeddedViewRef<any> | ComponentRef<any>)[], blockCards: (ComponentRef<SlateBlockCard> | null)[] | null, outletElement: HTMLElement): void;