slate-angular 17.0.0-next.0 → 17.1.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/components/children/children-outlet.component.d.ts +9 -0
- package/components/children/children.component.d.ts +1 -6
- package/components/editable/editable.component.d.ts +15 -5
- package/components/leaf/token.d.ts +4 -0
- package/components/leaves/leaves.component.d.ts +1 -14
- package/components/string/default-string.component.d.ts +1 -1
- package/components/string/string.component.d.ts +8 -0
- package/components/text/token.d.ts +5 -0
- package/components/text/void-text.component.d.ts +0 -1
- package/esm2022/components/block-card/block-card.component.mjs +6 -6
- package/esm2022/components/children/children-outlet.component.mjs +22 -0
- package/esm2022/components/children/children.component.mjs +7 -35
- package/esm2022/components/editable/editable.component.mjs +143 -50
- package/esm2022/components/element/default-element.component.mjs +5 -5
- package/esm2022/components/element/element.component.mjs +5 -5
- package/esm2022/components/leaf/default-leaf.component.mjs +3 -3
- package/esm2022/components/leaf/token.mjs +3 -0
- package/esm2022/components/leaves/leaves.component.mjs +7 -52
- package/esm2022/components/string/default-string.component.mjs +5 -5
- package/esm2022/components/string/string.component.mjs +20 -10
- package/esm2022/components/string/template.component.mjs +3 -3
- package/esm2022/components/text/default-text.component.mjs +5 -5
- package/esm2022/components/text/token.mjs +4 -0
- package/esm2022/components/text/void-text.component.mjs +5 -9
- package/esm2022/custom-event/BeforeInputEventPlugin.mjs +1 -1
- package/esm2022/custom-event/FallbackCompositionState.mjs +1 -1
- package/esm2022/module.mjs +11 -26
- package/esm2022/plugins/angular-editor.mjs +65 -20
- package/esm2022/plugins/with-angular.mjs +5 -4
- package/esm2022/public-api.mjs +3 -2
- package/esm2022/utils/constants.mjs +2 -0
- package/esm2022/utils/dom.mjs +1 -1
- package/esm2022/utils/hotkeys.mjs +1 -1
- package/esm2022/utils/index.mjs +2 -1
- package/esm2022/utils/lines.mjs +1 -1
- package/esm2022/utils/range-list.mjs +1 -1
- package/esm2022/utils/restore-dom.mjs +1 -1
- package/esm2022/utils/throttle.mjs +18 -0
- package/esm2022/view/base.mjs +82 -28
- package/esm2022/view/container-item.mjs +5 -5
- package/esm2022/view/container.mjs +6 -86
- package/esm2022/view/context-change.mjs +13 -0
- package/esm2022/view/context.mjs +1 -1
- package/esm2022/view/render/leaves-render.mjs +107 -0
- package/esm2022/view/render/list-render.mjs +292 -0
- package/esm2022/view/render/utils.mjs +115 -0
- package/fesm2022/slate-angular.mjs +1189 -816
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/module.d.ts +7 -8
- package/package.json +7 -7
- package/plugins/angular-editor.d.ts +17 -6
- package/public-api.d.ts +2 -1
- package/utils/constants.d.ts +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/throttle.d.ts +2 -0
- package/view/base.d.ts +17 -4
- package/view/container.d.ts +3 -7
- package/view/{before-context-change.d.ts → context-change.d.ts} +4 -0
- package/view/context.d.ts +7 -2
- package/view/render/leaves-render.d.ts +21 -0
- package/view/render/list-render.d.ts +35 -0
- package/view/render/utils.d.ts +11 -0
- package/components/descendant/descendant.component.d.ts +0 -35
- package/components/leaf/leaf.component.d.ts +0 -16
- package/esm2022/components/descendant/descendant.component.mjs +0 -186
- package/esm2022/components/leaf/leaf.component.mjs +0 -38
- package/esm2022/view/before-context-change.mjs +0 -7
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
|
|
2
|
-
import { ViewContainerItem } from '../../view/container-item';
|
|
3
|
-
import { SlateDefaultLeaf } from './default-leaf.component';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export class SlateLeaf extends ViewContainerItem {
|
|
6
|
-
ngOnInit() {
|
|
7
|
-
this.createView();
|
|
8
|
-
}
|
|
9
|
-
getContext() {
|
|
10
|
-
return this.context;
|
|
11
|
-
}
|
|
12
|
-
getViewType() {
|
|
13
|
-
return (this.viewContext.renderLeaf && this.viewContext.renderLeaf(this.context.leaf)) || SlateDefaultLeaf;
|
|
14
|
-
}
|
|
15
|
-
memoizedContext(prev, next) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
ngOnChanges(simpleChanges) {
|
|
19
|
-
if (!this.initialized) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
this.updateView();
|
|
23
|
-
}
|
|
24
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SlateLeaf, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
25
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.1", type: SlateLeaf, isStandalone: true, selector: "slate-leaf", inputs: { context: "context" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
26
|
-
}
|
|
27
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: SlateLeaf, decorators: [{
|
|
28
|
-
type: Component,
|
|
29
|
-
args: [{
|
|
30
|
-
selector: 'slate-leaf',
|
|
31
|
-
template: '',
|
|
32
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
33
|
-
standalone: true
|
|
34
|
-
}]
|
|
35
|
-
}], propDecorators: { context: [{
|
|
36
|
-
type: Input
|
|
37
|
-
}] } });
|
|
38
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGVhZi5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zcmMvY29tcG9uZW50cy9sZWFmL2xlYWYuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFvQyxNQUFNLGVBQWUsQ0FBQztBQUM1RyxPQUFPL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ogVmlld1R5cGUge1xuICAgICAgICByZXR1cm4gKHRoaXMudmlld0NvbnRleHQucmVuZGVyTGVhZiAmJiB0aGlzLnZpZXdDb250ZXh0LnJlbmRlckxlYWYodGhpcy5jb250ZXh0LmxlYWYpKSB8fCBTbGF0ZURlZmF1bHRMZWFmO1xuICAgIH1cblxuICAgIG1lbW9pemVkQ29udGV4dChwcmV2OiBTbGF0ZUxlYWZDb250ZXh0LCBuZXh0OiBTbGF0ZUxlYWZDb250ZXh0KTogYm9vbGVhbiB7XG4gICAgICAgIHJldHVybiBmYWxzZTtcbiAgICB9XG5cbiAgICBuZ09uQ2hhbmdlcyhzaW1wbGVDaGFuZ2VzOiBTaW1wbGVDaGFuZ2VzKSB7XG4gICAgICAgIGlmICghdGhpcy5pbml0aWFsaXplZCkge1xuICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICB9XG4gICAgICAgIHRoaXMudXBkYXRlVmlldygpO1xuICAgIH1cbn1cbiJdfQ==
|
|
@@ -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==
|