slate-angular 16.1.0-next.6 → 16.1.0-next.8
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/components/children/children-outlet.component.d.ts +9 -0
- package/components/editable/editable.component.d.ts +1 -1
- package/components/string/default-string.component.d.ts +1 -1
- package/esm2022/components/children/children-outlet.component.mjs +22 -0
- package/esm2022/components/children/children.component.mjs +2 -4
- package/esm2022/components/editable/editable.component.mjs +6 -6
- package/esm2022/components/leaf/token.mjs +1 -1
- package/esm2022/components/string/default-string.component.mjs +1 -1
- package/esm2022/components/string/string.component.mjs +1 -1
- package/esm2022/components/text/token.mjs +1 -1
- package/esm2022/module.mjs +7 -16
- package/esm2022/plugins/angular-editor.mjs +3 -3
- package/esm2022/plugins/with-angular.mjs +4 -4
- package/esm2022/public-api.mjs +3 -2
- package/esm2022/utils/throttle.mjs +1 -1
- package/esm2022/view/base.mjs +33 -11
- package/esm2022/view/container.mjs +1 -1
- package/esm2022/view/context-change.mjs +13 -0
- package/esm2022/view/render/leaves-render.mjs +8 -6
- package/esm2022/view/render/list-render.mjs +9 -7
- package/esm2022/view/render/utils.mjs +20 -7
- package/fesm2022/slate-angular.mjs +106 -53
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/module.d.ts +2 -1
- package/package.json +5 -5
- package/plugins/angular-editor.d.ts +1 -1
- package/public-api.d.ts +2 -1
- package/view/base.d.ts +7 -2
- package/view/{before-context-change.d.ts → context-change.d.ts} +4 -0
- package/view/render/leaves-render.d.ts +2 -1
- package/view/render/list-render.d.ts +2 -1
- package/view/render/utils.d.ts +2 -2
- package/esm2022/view/before-context-change.mjs +0 -7
package/module.d.ts
CHANGED
|
@@ -12,8 +12,9 @@ import * as i10 from "./components/block-card/block-card.component";
|
|
|
12
12
|
import * as i11 from "./components/leaves/leaves.component";
|
|
13
13
|
import * as i12 from "./components/leaf/default-leaf.component";
|
|
14
14
|
import * as i13 from "./components/string/default-string.component";
|
|
15
|
+
import * as i14 from "./components/children/children-outlet.component";
|
|
15
16
|
export declare class SlateModule {
|
|
16
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<SlateModule, never>;
|
|
17
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<SlateModule, never, [typeof i1.CommonModule, typeof i2.SlateEditable, typeof i3.SlateDefaultElement, typeof i4.SlateElement, typeof i5.SlateVoidText, typeof i6.SlateDefaultText, typeof i7.SlateString, typeof i8.SlateStringTemplate, typeof i9.SlateChildren, typeof i10.SlateBlockCard, typeof i11.SlateLeaves, typeof i12.SlateDefaultLeaf, typeof i13.SlateDefaultString], [typeof i2.SlateEditable, typeof i9.SlateChildren, typeof i4.SlateElement, typeof i11.SlateLeaves, typeof i7.SlateString, typeof i13.SlateDefaultString]>;
|
|
18
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<SlateModule, never, [typeof i1.CommonModule, typeof i2.SlateEditable, typeof i3.SlateDefaultElement, typeof i4.SlateElement, typeof i5.SlateVoidText, typeof i6.SlateDefaultText, typeof i7.SlateString, typeof i8.SlateStringTemplate, typeof i9.SlateChildren, typeof i10.SlateBlockCard, typeof i11.SlateLeaves, typeof i12.SlateDefaultLeaf, typeof i13.SlateDefaultString, typeof i14.SlateChildrenOutlet], [typeof i2.SlateEditable, typeof i9.SlateChildren, typeof i14.SlateChildrenOutlet, typeof i4.SlateElement, typeof i11.SlateLeaves, typeof i7.SlateString, typeof i13.SlateDefaultString]>;
|
|
18
19
|
static ɵinj: i0.ɵɵInjectorDeclaration<SlateModule>;
|
|
19
20
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "slate-angular",
|
|
3
|
-
"version": "16.1.0-next.
|
|
3
|
+
"version": "16.1.0-next.8",
|
|
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",
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
"scroll-into-view-if-needed": "^2.2.20"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"slate": "^0.
|
|
18
|
-
"slate-history": "^0.
|
|
17
|
+
"slate": "^0.101.5",
|
|
18
|
+
"slate-history": "^0.100.0",
|
|
19
19
|
"direction": "^2.0.1",
|
|
20
20
|
"is-hotkey": "^0.2.0",
|
|
21
|
-
"scroll-into-view-if-needed": "^
|
|
22
|
-
"tslib": "^2.
|
|
21
|
+
"scroll-into-view-if-needed": "^3.1.0",
|
|
22
|
+
"tslib": "^2.6.2"
|
|
23
23
|
},
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
@@ -132,7 +132,7 @@ export declare const AngularEditor: {
|
|
|
132
132
|
getCardCursorNode(editor: AngularEditor, blockCardNode: Node, options: {
|
|
133
133
|
direction: 'left' | 'right' | 'center';
|
|
134
134
|
}): ChildNode;
|
|
135
|
-
toSlateCardEntry(editor: AngularEditor, node: DOMNode): NodeEntry
|
|
135
|
+
toSlateCardEntry(editor: AngularEditor, node: DOMNode): NodeEntry;
|
|
136
136
|
/**
|
|
137
137
|
* move native selection to card-left or card-right
|
|
138
138
|
* @param editor
|
package/public-api.d.ts
CHANGED
|
@@ -5,11 +5,12 @@ export * from './components/element/element.component';
|
|
|
5
5
|
export * from './components/string/string.component';
|
|
6
6
|
export * from './components/string/default-string.component';
|
|
7
7
|
export * from './components/children/children.component';
|
|
8
|
+
export * from './components/children/children-outlet.component';
|
|
8
9
|
export * from './components/leaves/leaves.component';
|
|
9
10
|
export * from './module';
|
|
10
11
|
export * from './types/error';
|
|
11
12
|
export * from './view/base';
|
|
12
13
|
export * from './view/context';
|
|
13
|
-
export * from './view/
|
|
14
|
+
export * from './view/context-change';
|
|
14
15
|
export * from './utils';
|
|
15
16
|
export * from './types';
|
package/view/base.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ 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';
|
|
8
|
+
import { SlateChildrenOutlet } from '../components/children/children-outlet.component';
|
|
8
9
|
import * as i0 from "@angular/core";
|
|
9
10
|
/**
|
|
10
11
|
* base class for template
|
|
@@ -54,6 +55,7 @@ export declare class BaseLeafComponent extends BaseComponent<SlateLeafContext> i
|
|
|
54
55
|
export declare class BaseElementComponent<T extends Element = Element, K extends AngularEditor = AngularEditor> extends BaseComponent<SlateElementContext<T>, K> implements OnInit, OnDestroy {
|
|
55
56
|
viewContainerRef: ViewContainerRef;
|
|
56
57
|
childrenContext: SlateChildrenContext;
|
|
58
|
+
childrenOutletInstance?: SlateChildrenOutlet;
|
|
57
59
|
get element(): T;
|
|
58
60
|
get selection(): Range;
|
|
59
61
|
get decorations(): Range[];
|
|
@@ -61,7 +63,8 @@ export declare class BaseElementComponent<T extends Element = Element, K extends
|
|
|
61
63
|
get isCollapsed(): boolean;
|
|
62
64
|
get isCollapsedAndNonReadonly(): boolean;
|
|
63
65
|
get readonly(): boolean;
|
|
64
|
-
|
|
66
|
+
getOutletParent: () => any;
|
|
67
|
+
getOutletElement: () => HTMLElement;
|
|
65
68
|
listRender: ListRender;
|
|
66
69
|
ngOnInit(): void;
|
|
67
70
|
updateWeakMap(): void;
|
|
@@ -78,7 +81,9 @@ export declare class BaseTextComponent<T extends Text = Text> extends BaseCompon
|
|
|
78
81
|
viewContainerRef: ViewContainerRef;
|
|
79
82
|
get text(): T;
|
|
80
83
|
leavesRender: LeavesRender;
|
|
81
|
-
|
|
84
|
+
childrenOutletInstance?: SlateChildrenOutlet;
|
|
85
|
+
getOutletParent: () => any;
|
|
86
|
+
getOutletElement: () => HTMLElement;
|
|
82
87
|
ngOnInit(): void;
|
|
83
88
|
updateWeakMap(): void;
|
|
84
89
|
ngOnDestroy(): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export interface BeforeContextChange<T> {
|
|
2
2
|
beforeContextChange: (value: T) => void;
|
|
3
3
|
}
|
|
4
|
+
export interface AfterContextChange {
|
|
5
|
+
afterContextChange: () => void;
|
|
6
|
+
}
|
|
4
7
|
export declare function hasBeforeContextChange<T>(value: any): value is BeforeContextChange<T>;
|
|
8
|
+
export declare function hasAfterContextChange<T>(value: any): value is AfterContextChange;
|
|
@@ -4,13 +4,14 @@ import { SlateLeafContext, SlateTextContext, SlateViewContext } from '../context
|
|
|
4
4
|
export declare class LeavesRender {
|
|
5
5
|
private viewContext;
|
|
6
6
|
private viewContainerRef;
|
|
7
|
+
private getOutletParent;
|
|
7
8
|
private getOutletElement;
|
|
8
9
|
private leaves;
|
|
9
10
|
private views;
|
|
10
11
|
private contexts;
|
|
11
12
|
private viewTypes;
|
|
12
13
|
private differ;
|
|
13
|
-
constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletElement: () => HTMLElement);
|
|
14
|
+
constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletParent: () => HTMLElement, getOutletElement: () => HTMLElement);
|
|
14
15
|
initialize(context: SlateTextContext): void;
|
|
15
16
|
update(context: SlateTextContext): void;
|
|
16
17
|
private getLeaves;
|
|
@@ -6,6 +6,7 @@ import { SlateBlockCard } from '../../components/block-card/block-card.component
|
|
|
6
6
|
export declare class ListRender {
|
|
7
7
|
private viewContext;
|
|
8
8
|
private viewContainerRef;
|
|
9
|
+
private getOutletParent;
|
|
9
10
|
private getOutletElement;
|
|
10
11
|
private children;
|
|
11
12
|
private views;
|
|
@@ -14,7 +15,7 @@ export declare class ListRender {
|
|
|
14
15
|
private viewTypes;
|
|
15
16
|
private differ;
|
|
16
17
|
initialized: boolean;
|
|
17
|
-
constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletElement: () => HTMLElement);
|
|
18
|
+
constructor(viewContext: SlateViewContext, viewContainerRef: ViewContainerRef, getOutletParent: () => HTMLElement, getOutletElement: () => HTMLElement | null);
|
|
18
19
|
initialize(children: Descendant[], parent: Ancestor, childrenContext: SlateChildrenContext): void;
|
|
19
20
|
update(children: Descendant[], parent: Ancestor, childrenContext: SlateChildrenContext): void;
|
|
20
21
|
}
|
package/view/render/utils.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ import { SlateBlockCard } from '../../components/block-card/block-card.component
|
|
|
6
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
|
-
export declare function mount(views: (EmbeddedViewRef<any> | ComponentRef<any>)[], blockCards: (ComponentRef<SlateBlockCard> | null)[] | null, outletElement: HTMLElement): void;
|
|
9
|
+
export declare function mount(views: (EmbeddedViewRef<any> | ComponentRef<any>)[], blockCards: (ComponentRef<SlateBlockCard> | null)[] | null, outletParent: HTMLElement, outletElement: HTMLElement | null): void;
|
|
10
10
|
export declare function getRootNodes(ref: EmbeddedViewRef<any> | ComponentRef<any>, blockCard?: ComponentRef<SlateBlockCard>): HTMLElement[];
|
|
11
|
-
export declare function mountOnItemChange(index: number, item: Descendant, views: (EmbeddedViewRef<any> | ComponentRef<any>)[], blockCards: (ComponentRef<SlateBlockCard> | null)[] | null,
|
|
11
|
+
export declare function mountOnItemChange(index: number, item: Descendant, views: (EmbeddedViewRef<any> | ComponentRef<any>)[], blockCards: (ComponentRef<SlateBlockCard> | null)[] | null, outletParent: HTMLElement, firstRootNode: HTMLElement | null, viewContext: SlateViewContext): void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export function hasBeforeContextChange(value) {
|
|
2
|
-
if (value.beforeContextChange) {
|
|
3
|
-
return true;
|
|
4
|
-
}
|
|
5
|
-
return false;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmVmb3JlLWNvbnRleHQtY2hhbmdlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vcGFja2FnZXMvc3JjL3ZpZXcvYmVmb3JlLWNvbnRleHQtY2hhbmdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUlBLE1BQU0sVUFBVSxzQkFBc0IsQ0FBSSxLQUFLO0lBQzNDLElBQUksS0FBSyxDQUFDLG1CQUFtQixFQUFFO1FBQzNCLE9BQU8sSUFBSSxDQUFDO0tBQ2Y7SUFDRCxPQUFPLEtBQUssQ0FBQztBQUNqQixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGludGVyZmFjZSBCZWZvcmVDb250ZXh0Q2hhbmdlPFQ+IHtcbiAgICBiZWZvcmVDb250ZXh0Q2hhbmdlOiAodmFsdWU6IFQpID0+IHZvaWQ7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiBoYXNCZWZvcmVDb250ZXh0Q2hhbmdlPFQ+KHZhbHVlKTogdmFsdWUgaXMgQmVmb3JlQ29udGV4dENoYW5nZTxUPiB7XG4gICAgaWYgKHZhbHVlLmJlZm9yZUNvbnRleHRDaGFuZ2UpIHtcbiAgICAgICAgcmV0dXJuIHRydWU7XG4gICAgfVxuICAgIHJldHVybiBmYWxzZTtcbn1cbiJdfQ==
|