slate-angular 18.0.0 → 19.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/components/editable/editable.component.d.ts +1 -1
- package/components/string/default-string.component.d.ts +3 -6
- package/components/string/string.component.d.ts +3 -4
- package/fesm2022/slate-angular.mjs +290 -305
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/package.json +1 -3
- package/plugins/angular-editor.d.ts +10 -10
- package/plugins/with-angular.d.ts +2 -1
- package/utils/clipboard/clipboard.d.ts +1 -1
- package/utils/clipboard/data-transfer.d.ts +4 -4
- package/utils/dom.d.ts +2 -2
- package/view/base.d.ts +10 -12
- package/view/container-item.d.ts +2 -3
- package/view/container.d.ts +1 -1
- package/esm2022/components/block-card/block-card.component.mjs +0 -33
- package/esm2022/components/children/children-outlet.component.mjs +0 -22
- package/esm2022/components/children/children.component.mjs +0 -23
- package/esm2022/components/editable/editable.component.mjs +0 -1266
- package/esm2022/components/element/default-element.component.mjs +0 -19
- package/esm2022/components/element/default-element.component.token.mjs +0 -3
- package/esm2022/components/element/element.component.mjs +0 -19
- package/esm2022/components/leaf/default-leaf.component.mjs +0 -30
- package/esm2022/components/leaf/token.mjs +0 -3
- package/esm2022/components/leaves/leaves.component.mjs +0 -25
- package/esm2022/components/string/default-string.component.mjs +0 -80
- package/esm2022/components/string/string.component.mjs +0 -108
- package/esm2022/components/string/template.component.mjs +0 -20
- package/esm2022/components/text/default-text.component.mjs +0 -22
- package/esm2022/components/text/token.mjs +0 -4
- package/esm2022/components/text/void-text.component.mjs +0 -32
- package/esm2022/custom-event/BeforeInputEventPlugin.mjs +0 -251
- package/esm2022/custom-event/DOMTopLevelEventTypes.mjs +0 -13
- package/esm2022/custom-event/FallbackCompositionState.mjs +0 -62
- package/esm2022/custom-event/before-input-polyfill.mjs +0 -13
- package/esm2022/module.mjs +0 -69
- package/esm2022/plugins/angular-editor.mjs +0 -610
- package/esm2022/plugins/with-angular.mjs +0 -217
- package/esm2022/public-api.mjs +0 -20
- package/esm2022/slate-angular.mjs +0 -5
- package/esm2022/types/clipboard.mjs +0 -2
- package/esm2022/types/error.mjs +0 -12
- package/esm2022/types/feature.mjs +0 -2
- package/esm2022/types/index.mjs +0 -5
- package/esm2022/types/view.mjs +0 -2
- package/esm2022/utils/block-card.mjs +0 -25
- package/esm2022/utils/clipboard/clipboard.mjs +0 -78
- package/esm2022/utils/clipboard/common.mjs +0 -42
- package/esm2022/utils/clipboard/data-transfer.mjs +0 -44
- package/esm2022/utils/clipboard/index.mjs +0 -5
- package/esm2022/utils/clipboard/navigator-clipboard.mjs +0 -59
- package/esm2022/utils/constants.mjs +0 -2
- package/esm2022/utils/dom.mjs +0 -165
- package/esm2022/utils/environment.mjs +0 -34
- package/esm2022/utils/global-normalize.mjs +0 -11
- package/esm2022/utils/hotkeys.mjs +0 -99
- package/esm2022/utils/index.mjs +0 -12
- package/esm2022/utils/key.mjs +0 -14
- package/esm2022/utils/lines.mjs +0 -46
- package/esm2022/utils/range-list.mjs +0 -29
- package/esm2022/utils/restore-dom.mjs +0 -33
- package/esm2022/utils/throttle.mjs +0 -18
- package/esm2022/utils/view.mjs +0 -8
- package/esm2022/utils/weak-maps.mjs +0 -40
- package/esm2022/view/base.mjs +0 -273
- package/esm2022/view/container-item.mjs +0 -108
- package/esm2022/view/container.mjs +0 -22
- package/esm2022/view/context-change.mjs +0 -13
- package/esm2022/view/context.mjs +0 -2
- package/esm2022/view/render/leaves-render.mjs +0 -107
- package/esm2022/view/render/list-render.mjs +0 -302
- package/esm2022/view/render/utils.mjs +0 -110
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Editor,
|
|
1
|
+
import { Editor, Transforms, Element, Range, Text as Text$1, Path, Node } from 'slate';
|
|
2
2
|
import { isKeyHotkey } from 'is-hotkey';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { TemplateRef,
|
|
4
|
+
import { TemplateRef, ViewChild, ChangeDetectionStrategy, Component, InjectionToken, ComponentRef, IterableDiffers, inject, ElementRef, ChangeDetectorRef, Input, Directive, HostBinding, ViewContainerRef, forwardRef, Inject, NgModule } from '@angular/core';
|
|
5
5
|
import { direction } from 'direction';
|
|
6
6
|
import scrollIntoView from 'scroll-into-view-if-needed';
|
|
7
7
|
import { Subject } from 'rxjs';
|
|
8
8
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
9
9
|
import { HistoryEditor } from 'slate-history';
|
|
10
|
-
import {
|
|
10
|
+
import { CommonModule } from '@angular/common';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Two weak maps that allow us rebuild a path given a node. They are populated
|
|
@@ -1867,10 +1867,10 @@ var SlateErrorCode;
|
|
|
1867
1867
|
})(SlateErrorCode || (SlateErrorCode = {}));
|
|
1868
1868
|
|
|
1869
1869
|
class SlateStringTemplate {
|
|
1870
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1871
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1870
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateStringTemplate, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1871
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateStringTemplate, isStandalone: true, selector: "slate-string-template", viewQueries: [{ propertyName: "compatibleStringTemplate", first: true, predicate: ["compatibleStringTemplate"], descendants: true, read: TemplateRef, static: true }, { propertyName: "voidStringTemplate", first: true, predicate: ["voidStringTemplate"], descendants: true, read: TemplateRef, static: true }, { propertyName: "emptyTextTemplate", first: true, predicate: ["emptyTextTemplate"], descendants: true, read: TemplateRef, static: true }], ngImport: i0, template: "<ng-template #compatibleStringTemplate let-context=\"context\" let-viewContext=\"viewContext\">\n <!-- Compatible with Chinese input in Chrome with \\n -->\n <span editable-text data-slate-string=\"true\"\n >{{ context.text }}<span data-slate-zero-width>{{ '\\uFEFF' }}</span></span\n >\n</ng-template>\n<ng-template #voidStringTemplate let-context=\"context\" let-viewContext=\"viewContext\">\n <span editable-text data-slate-zero-width=\"z\" attr.data-slate-length=\"{{ context.elementStringLength }}\">{{ '\\uFEFF' }}</span>\n</ng-template>\n<ng-template #emptyTextTemplate let-context=\"context\" let-viewContext=\"viewContext\">\n <span editable-text data-slate-zero-width=\"z\" data-slate-length=\"0\">{{ '\\uFEFF' }}</span>\n</ng-template>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1872
1872
|
}
|
|
1873
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1873
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateStringTemplate, decorators: [{
|
|
1874
1874
|
type: Component,
|
|
1875
1875
|
args: [{ selector: 'slate-string-template', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, template: "<ng-template #compatibleStringTemplate let-context=\"context\" let-viewContext=\"viewContext\">\n <!-- Compatible with Chinese input in Chrome with \\n -->\n <span editable-text data-slate-string=\"true\"\n >{{ context.text }}<span data-slate-zero-width>{{ '\\uFEFF' }}</span></span\n >\n</ng-template>\n<ng-template #voidStringTemplate let-context=\"context\" let-viewContext=\"viewContext\">\n <span editable-text data-slate-zero-width=\"z\" attr.data-slate-length=\"{{ context.elementStringLength }}\">{{ '\\uFEFF' }}</span>\n</ng-template>\n<ng-template #emptyTextTemplate let-context=\"context\" let-viewContext=\"viewContext\">\n <span editable-text data-slate-zero-width=\"z\" data-slate-length=\"0\">{{ '\\uFEFF' }}</span>\n</ng-template>\n" }]
|
|
1876
1876
|
}], propDecorators: { compatibleStringTemplate: [{
|
|
@@ -1916,50 +1916,30 @@ function restoreDom(editor, execute) {
|
|
|
1916
1916
|
}, 0);
|
|
1917
1917
|
}
|
|
1918
1918
|
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
constructor(elementRef, differs) {
|
|
1919
|
+
const SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN = new InjectionToken('slate-default-element-token');
|
|
1920
|
+
|
|
1921
|
+
const SLATE_DEFAULT_TEXT_COMPONENT_TOKEN = new InjectionToken('slate-default-text-token');
|
|
1922
|
+
const SLATE_DEFAULT_VOID_TEXT_COMPONENT_TOKEN = new InjectionToken('slate-default-void-text-token');
|
|
1923
|
+
|
|
1924
|
+
class SlateChildrenOutlet {
|
|
1925
|
+
constructor(elementRef) {
|
|
1927
1926
|
this.elementRef = elementRef;
|
|
1928
|
-
this.differs = differs;
|
|
1929
1927
|
}
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
}
|
|
1933
|
-
i0.ɵɵ
|
|
1934
|
-
|
|
1935
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.IterableDiffers }], propDecorators: { viewContext: [{
|
|
1936
|
-
type: Input
|
|
1937
|
-
}] } });
|
|
1938
|
-
|
|
1939
|
-
class SlateChildren extends ViewContainer {
|
|
1940
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateChildren, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1941
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: SlateChildren, isStandalone: true, selector: "slate-children", inputs: { children: "children", context: "context", viewContext: "viewContext" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1928
|
+
getNativeElement() {
|
|
1929
|
+
return this.elementRef.nativeElement;
|
|
1930
|
+
}
|
|
1931
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateChildrenOutlet, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1932
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateChildrenOutlet, isStandalone: true, selector: "slate-children-outlet", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1942
1933
|
}
|
|
1943
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1934
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateChildrenOutlet, decorators: [{
|
|
1944
1935
|
type: Component,
|
|
1945
1936
|
args: [{
|
|
1946
|
-
selector: 'slate-children',
|
|
1937
|
+
selector: 'slate-children-outlet',
|
|
1947
1938
|
template: ``,
|
|
1948
1939
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1949
1940
|
standalone: true
|
|
1950
1941
|
}]
|
|
1951
|
-
}],
|
|
1952
|
-
type: Input
|
|
1953
|
-
}], context: [{
|
|
1954
|
-
type: Input
|
|
1955
|
-
}], viewContext: [{
|
|
1956
|
-
type: Input
|
|
1957
|
-
}] } });
|
|
1958
|
-
|
|
1959
|
-
const SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN = new InjectionToken('slate-default-element-token');
|
|
1960
|
-
|
|
1961
|
-
const SLATE_DEFAULT_TEXT_COMPONENT_TOKEN = new InjectionToken('slate-default-text-token');
|
|
1962
|
-
const SLATE_DEFAULT_VOID_TEXT_COMPONENT_TOKEN = new InjectionToken('slate-default-void-text-token');
|
|
1942
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
1963
1943
|
|
|
1964
1944
|
function hasBeforeContextChange(value) {
|
|
1965
1945
|
if (value.beforeContextChange) {
|
|
@@ -1974,37 +1954,6 @@ function hasAfterContextChange(value) {
|
|
|
1974
1954
|
return false;
|
|
1975
1955
|
}
|
|
1976
1956
|
|
|
1977
|
-
class SlateBlockCard {
|
|
1978
|
-
get nativeElement() {
|
|
1979
|
-
return this.elementRef.nativeElement;
|
|
1980
|
-
}
|
|
1981
|
-
get centerContainerElement() {
|
|
1982
|
-
return this.centerContianer.nativeElement;
|
|
1983
|
-
}
|
|
1984
|
-
constructor(elementRef) {
|
|
1985
|
-
this.elementRef = elementRef;
|
|
1986
|
-
}
|
|
1987
|
-
ngOnInit() {
|
|
1988
|
-
this.nativeElement.classList.add(`slate-block-card`);
|
|
1989
|
-
}
|
|
1990
|
-
append() {
|
|
1991
|
-
this.centerRootNodes.forEach(rootNode => !this.centerContainerElement.contains(rootNode) && this.centerContainerElement.appendChild(rootNode));
|
|
1992
|
-
}
|
|
1993
|
-
initializeCenter(rootNodes) {
|
|
1994
|
-
this.centerRootNodes = rootNodes;
|
|
1995
|
-
this.append();
|
|
1996
|
-
}
|
|
1997
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateBlockCard, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1998
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: SlateBlockCard, isStandalone: true, selector: "slate-block-card, [slateBlockCard]", viewQueries: [{ propertyName: "centerContianer", first: true, predicate: ["centerContianer"], descendants: true, static: true }], ngImport: i0, template: "<span card-target=\"card-left\" class=\"card-left\">{{ '\\uFEFF' }}</span>\n<div card-target=\"card-center\" #centerContianer></div>\n<span card-target=\"card-right\" class=\"card-right\">{{ '\\uFEFF' }}</span>\n" }); }
|
|
1999
|
-
}
|
|
2000
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateBlockCard, decorators: [{
|
|
2001
|
-
type: Component,
|
|
2002
|
-
args: [{ selector: 'slate-block-card, [slateBlockCard]', standalone: true, template: "<span card-target=\"card-left\" class=\"card-left\">{{ '\\uFEFF' }}</span>\n<div card-target=\"card-center\" #centerContianer></div>\n<span card-target=\"card-right\" class=\"card-right\">{{ '\\uFEFF' }}</span>\n" }]
|
|
2003
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { centerContianer: [{
|
|
2004
|
-
type: ViewChild,
|
|
2005
|
-
args: ['centerContianer', { static: true }]
|
|
2006
|
-
}] } });
|
|
2007
|
-
|
|
2008
1957
|
function createEmbeddedViewOrComponent(viewType, context, viewContext, viewContainerRef) {
|
|
2009
1958
|
if (isTemplateRef(viewType)) {
|
|
2010
1959
|
const embeddedViewContext = {
|
|
@@ -2113,6 +2062,141 @@ function mountOnItemChange(index, item, views, blockCards, outletParent, firstRo
|
|
|
2113
2062
|
}
|
|
2114
2063
|
}
|
|
2115
2064
|
|
|
2065
|
+
class LeavesRender {
|
|
2066
|
+
constructor(viewContext, viewContainerRef, getOutletParent, getOutletElement) {
|
|
2067
|
+
this.viewContext = viewContext;
|
|
2068
|
+
this.viewContainerRef = viewContainerRef;
|
|
2069
|
+
this.getOutletParent = getOutletParent;
|
|
2070
|
+
this.getOutletElement = getOutletElement;
|
|
2071
|
+
this.views = [];
|
|
2072
|
+
this.contexts = [];
|
|
2073
|
+
this.viewTypes = [];
|
|
2074
|
+
}
|
|
2075
|
+
initialize(context) {
|
|
2076
|
+
const { leaves, contexts } = this.getLeaves(context);
|
|
2077
|
+
this.leaves = leaves;
|
|
2078
|
+
this.contexts = contexts;
|
|
2079
|
+
this.leaves.forEach((leaf, index) => {
|
|
2080
|
+
const context = getContext$1(index, this.contexts);
|
|
2081
|
+
const viewType = getViewType$1(context, this.viewContext);
|
|
2082
|
+
const view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2083
|
+
this.views.push(view);
|
|
2084
|
+
this.contexts.push(context);
|
|
2085
|
+
this.viewTypes.push(viewType);
|
|
2086
|
+
});
|
|
2087
|
+
mount(this.views, null, this.getOutletParent(), this.getOutletElement());
|
|
2088
|
+
const newDiffers = this.viewContainerRef.injector.get(IterableDiffers);
|
|
2089
|
+
this.differ = newDiffers.find(this.leaves).create(trackBy$1(this.viewContext));
|
|
2090
|
+
this.differ.diff(this.leaves);
|
|
2091
|
+
}
|
|
2092
|
+
update(context) {
|
|
2093
|
+
const { leaves, contexts } = this.getLeaves(context);
|
|
2094
|
+
const outletParent = this.getOutletParent();
|
|
2095
|
+
const diffResult = this.differ.diff(leaves);
|
|
2096
|
+
if (diffResult) {
|
|
2097
|
+
let firstRootNode = getRootNodes(this.views[0])[0];
|
|
2098
|
+
const newContexts = [];
|
|
2099
|
+
const newViewTypes = [];
|
|
2100
|
+
const newViews = [];
|
|
2101
|
+
diffResult.forEachItem(record => {
|
|
2102
|
+
let context = getContext$1(record.currentIndex, contexts);
|
|
2103
|
+
const viewType = getViewType$1(context, this.viewContext);
|
|
2104
|
+
newViewTypes.push(viewType);
|
|
2105
|
+
let view;
|
|
2106
|
+
if (record.previousIndex === null) {
|
|
2107
|
+
view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2108
|
+
newContexts.push(context);
|
|
2109
|
+
newViews.push(view);
|
|
2110
|
+
mountOnItemChange(record.currentIndex, record.item, newViews, null, outletParent, firstRootNode, this.viewContext);
|
|
2111
|
+
}
|
|
2112
|
+
else {
|
|
2113
|
+
const previousView = this.views[record.previousIndex];
|
|
2114
|
+
const previousViewType = this.viewTypes[record.previousIndex];
|
|
2115
|
+
if (previousViewType !== viewType) {
|
|
2116
|
+
view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2117
|
+
const firstRootNode = getRootNodes(previousView, null)[0];
|
|
2118
|
+
const newRootNodes = getRootNodes(view, null);
|
|
2119
|
+
firstRootNode.replaceWith(...newRootNodes);
|
|
2120
|
+
previousView.destroy();
|
|
2121
|
+
}
|
|
2122
|
+
else {
|
|
2123
|
+
view = previousView;
|
|
2124
|
+
updateContext(previousView, context, this.viewContext);
|
|
2125
|
+
}
|
|
2126
|
+
newContexts.push(context);
|
|
2127
|
+
newViews.push(view);
|
|
2128
|
+
}
|
|
2129
|
+
});
|
|
2130
|
+
diffResult.forEachRemovedItem(record => {
|
|
2131
|
+
const view = this.views[record.previousIndex];
|
|
2132
|
+
view.destroy();
|
|
2133
|
+
});
|
|
2134
|
+
diffResult.forEachMovedItem(record => {
|
|
2135
|
+
mountOnItemChange(record.currentIndex, record.item, newViews, null, outletParent, firstRootNode, this.viewContext);
|
|
2136
|
+
});
|
|
2137
|
+
this.viewTypes = newViewTypes;
|
|
2138
|
+
this.views = newViews;
|
|
2139
|
+
this.contexts = newContexts;
|
|
2140
|
+
this.leaves = leaves;
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
getLeaves(context) {
|
|
2144
|
+
const leaves = Text$1.decorations(context.text, context.decorations);
|
|
2145
|
+
const contexts = leaves.map((leaf, index) => {
|
|
2146
|
+
return {
|
|
2147
|
+
leaf,
|
|
2148
|
+
text: context.text,
|
|
2149
|
+
parent: context.parent,
|
|
2150
|
+
index,
|
|
2151
|
+
isLast: context.isLast && index === leaves.length - 1
|
|
2152
|
+
};
|
|
2153
|
+
});
|
|
2154
|
+
return { leaves, contexts };
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
function getContext$1(index, leafContexts) {
|
|
2158
|
+
return leafContexts[index];
|
|
2159
|
+
}
|
|
2160
|
+
function getViewType$1(leafContext, viewContext) {
|
|
2161
|
+
return (viewContext.renderLeaf && viewContext.renderLeaf(leafContext.leaf)) || viewContext.defaultLeaf;
|
|
2162
|
+
}
|
|
2163
|
+
function trackBy$1(viewContext) {
|
|
2164
|
+
return (index, node) => {
|
|
2165
|
+
return index;
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2168
|
+
|
|
2169
|
+
class SlateBlockCard {
|
|
2170
|
+
get nativeElement() {
|
|
2171
|
+
return this.elementRef.nativeElement;
|
|
2172
|
+
}
|
|
2173
|
+
get centerContainerElement() {
|
|
2174
|
+
return this.centerContianer.nativeElement;
|
|
2175
|
+
}
|
|
2176
|
+
constructor(elementRef) {
|
|
2177
|
+
this.elementRef = elementRef;
|
|
2178
|
+
}
|
|
2179
|
+
ngOnInit() {
|
|
2180
|
+
this.nativeElement.classList.add(`slate-block-card`);
|
|
2181
|
+
}
|
|
2182
|
+
append() {
|
|
2183
|
+
this.centerRootNodes.forEach(rootNode => !this.centerContainerElement.contains(rootNode) && this.centerContainerElement.appendChild(rootNode));
|
|
2184
|
+
}
|
|
2185
|
+
initializeCenter(rootNodes) {
|
|
2186
|
+
this.centerRootNodes = rootNodes;
|
|
2187
|
+
this.append();
|
|
2188
|
+
}
|
|
2189
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateBlockCard, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2190
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateBlockCard, isStandalone: true, selector: "slate-block-card, [slateBlockCard]", viewQueries: [{ propertyName: "centerContianer", first: true, predicate: ["centerContianer"], descendants: true, static: true }], ngImport: i0, template: "<span card-target=\"card-left\" class=\"card-left\">{{ '\\uFEFF' }}</span>\n<div card-target=\"card-center\" #centerContianer></div>\n<span card-target=\"card-right\" class=\"card-right\">{{ '\\uFEFF' }}</span>\n" }); }
|
|
2191
|
+
}
|
|
2192
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateBlockCard, decorators: [{
|
|
2193
|
+
type: Component,
|
|
2194
|
+
args: [{ selector: 'slate-block-card, [slateBlockCard]', standalone: true, template: "<span card-target=\"card-left\" class=\"card-left\">{{ '\\uFEFF' }}</span>\n<div card-target=\"card-center\" #centerContianer></div>\n<span card-target=\"card-right\" class=\"card-right\">{{ '\\uFEFF' }}</span>\n" }]
|
|
2195
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { centerContianer: [{
|
|
2196
|
+
type: ViewChild,
|
|
2197
|
+
args: ['centerContianer', { static: true }]
|
|
2198
|
+
}] } });
|
|
2199
|
+
|
|
2116
2200
|
class ListRender {
|
|
2117
2201
|
constructor(viewContext, viewContainerRef, getOutletParent, getOutletElement) {
|
|
2118
2202
|
this.viewContext = viewContext;
|
|
@@ -2134,8 +2218,8 @@ class ListRender {
|
|
|
2134
2218
|
children.forEach((descendant, index) => {
|
|
2135
2219
|
NODE_TO_INDEX.set(descendant, index);
|
|
2136
2220
|
NODE_TO_PARENT.set(descendant, parent);
|
|
2137
|
-
const context = getContext
|
|
2138
|
-
const viewType = getViewType
|
|
2221
|
+
const context = getContext(index, descendant, parentPath, childrenContext, this.viewContext);
|
|
2222
|
+
const viewType = getViewType(descendant, parent, this.viewContext);
|
|
2139
2223
|
const view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2140
2224
|
const blockCard = createBlockCard(descendant, view, this.viewContainerRef, this.viewContext);
|
|
2141
2225
|
this.views.push(view);
|
|
@@ -2145,7 +2229,7 @@ class ListRender {
|
|
|
2145
2229
|
});
|
|
2146
2230
|
mount(this.views, this.blockCards, this.getOutletParent(), this.getOutletElement());
|
|
2147
2231
|
const newDiffers = this.viewContainerRef.injector.get(IterableDiffers);
|
|
2148
|
-
this.differ = newDiffers.find(children).create(trackBy
|
|
2232
|
+
this.differ = newDiffers.find(children).create(trackBy(this.viewContext));
|
|
2149
2233
|
this.differ.diff(children);
|
|
2150
2234
|
if (parent === this.viewContext.editor) {
|
|
2151
2235
|
executeAfterViewInit(this.viewContext.editor);
|
|
@@ -2171,8 +2255,8 @@ class ListRender {
|
|
|
2171
2255
|
diffResult.forEachItem(record => {
|
|
2172
2256
|
NODE_TO_INDEX.set(record.item, record.currentIndex);
|
|
2173
2257
|
NODE_TO_PARENT.set(record.item, parent);
|
|
2174
|
-
let context = getContext
|
|
2175
|
-
const viewType = getViewType
|
|
2258
|
+
let context = getContext(record.currentIndex, record.item, parentPath, childrenContext, this.viewContext);
|
|
2259
|
+
const viewType = getViewType(record.item, parent, this.viewContext);
|
|
2176
2260
|
newViewTypes.push(viewType);
|
|
2177
2261
|
let view;
|
|
2178
2262
|
let blockCard;
|
|
@@ -2242,7 +2326,7 @@ class ListRender {
|
|
|
2242
2326
|
this.children.forEach((child, index) => {
|
|
2243
2327
|
NODE_TO_INDEX.set(child, index);
|
|
2244
2328
|
NODE_TO_PARENT.set(child, parent);
|
|
2245
|
-
let context = getContext
|
|
2329
|
+
let context = getContext(index, child, parentPath, childrenContext, this.viewContext);
|
|
2246
2330
|
const previousContext = this.contexts[index];
|
|
2247
2331
|
if (memoizedContext(this.viewContext, child, previousContext, context)) {
|
|
2248
2332
|
context = previousContext;
|
|
@@ -2272,7 +2356,7 @@ class ListRender {
|
|
|
2272
2356
|
this.differ = null;
|
|
2273
2357
|
}
|
|
2274
2358
|
}
|
|
2275
|
-
function getContext
|
|
2359
|
+
function getContext(index, item, parentPath, childrenContext, viewContext) {
|
|
2276
2360
|
if (Element.isElement(item)) {
|
|
2277
2361
|
const computedContext = getCommonContext(index, item, parentPath, viewContext, childrenContext);
|
|
2278
2362
|
const key = AngularEditor.findKey(viewContext.editor, item);
|
|
@@ -2340,7 +2424,7 @@ function getCommonContext(index, item, parentPath, viewContext, childrenContext)
|
|
|
2340
2424
|
return { selection: null, decorations: [] };
|
|
2341
2425
|
}
|
|
2342
2426
|
}
|
|
2343
|
-
function getViewType
|
|
2427
|
+
function getViewType(item, parent, viewContext) {
|
|
2344
2428
|
if (Element.isElement(item)) {
|
|
2345
2429
|
return (viewContext.renderElement && viewContext.renderElement(item)) || viewContext.defaultElement;
|
|
2346
2430
|
}
|
|
@@ -2364,7 +2448,7 @@ function createBlockCard(item, view, viewContainerRef, viewContext) {
|
|
|
2364
2448
|
return null;
|
|
2365
2449
|
}
|
|
2366
2450
|
}
|
|
2367
|
-
function trackBy
|
|
2451
|
+
function trackBy(viewContext) {
|
|
2368
2452
|
return (index, node) => {
|
|
2369
2453
|
return viewContext.trackBy(node) || AngularEditor.findKey(viewContext.editor, node);
|
|
2370
2454
|
};
|
|
@@ -2407,134 +2491,15 @@ function executeAfterViewInit(editor) {
|
|
|
2407
2491
|
clearAfterViewInitQueue(editor);
|
|
2408
2492
|
}
|
|
2409
2493
|
|
|
2410
|
-
class LeavesRender {
|
|
2411
|
-
constructor(viewContext, viewContainerRef, getOutletParent, getOutletElement) {
|
|
2412
|
-
this.viewContext = viewContext;
|
|
2413
|
-
this.viewContainerRef = viewContainerRef;
|
|
2414
|
-
this.getOutletParent = getOutletParent;
|
|
2415
|
-
this.getOutletElement = getOutletElement;
|
|
2416
|
-
this.views = [];
|
|
2417
|
-
this.contexts = [];
|
|
2418
|
-
this.viewTypes = [];
|
|
2419
|
-
}
|
|
2420
|
-
initialize(context) {
|
|
2421
|
-
const { leaves, contexts } = this.getLeaves(context);
|
|
2422
|
-
this.leaves = leaves;
|
|
2423
|
-
this.contexts = contexts;
|
|
2424
|
-
this.leaves.forEach((leaf, index) => {
|
|
2425
|
-
const context = getContext(index, this.contexts);
|
|
2426
|
-
const viewType = getViewType(context, this.viewContext);
|
|
2427
|
-
const view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2428
|
-
this.views.push(view);
|
|
2429
|
-
this.contexts.push(context);
|
|
2430
|
-
this.viewTypes.push(viewType);
|
|
2431
|
-
});
|
|
2432
|
-
mount(this.views, null, this.getOutletParent(), this.getOutletElement());
|
|
2433
|
-
const newDiffers = this.viewContainerRef.injector.get(IterableDiffers);
|
|
2434
|
-
this.differ = newDiffers.find(this.leaves).create(trackBy(this.viewContext));
|
|
2435
|
-
this.differ.diff(this.leaves);
|
|
2436
|
-
}
|
|
2437
|
-
update(context) {
|
|
2438
|
-
const { leaves, contexts } = this.getLeaves(context);
|
|
2439
|
-
const outletParent = this.getOutletParent();
|
|
2440
|
-
const diffResult = this.differ.diff(leaves);
|
|
2441
|
-
if (diffResult) {
|
|
2442
|
-
let firstRootNode = getRootNodes(this.views[0])[0];
|
|
2443
|
-
const newContexts = [];
|
|
2444
|
-
const newViewTypes = [];
|
|
2445
|
-
const newViews = [];
|
|
2446
|
-
diffResult.forEachItem(record => {
|
|
2447
|
-
let context = getContext(record.currentIndex, contexts);
|
|
2448
|
-
const viewType = getViewType(context, this.viewContext);
|
|
2449
|
-
newViewTypes.push(viewType);
|
|
2450
|
-
let view;
|
|
2451
|
-
if (record.previousIndex === null) {
|
|
2452
|
-
view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2453
|
-
newContexts.push(context);
|
|
2454
|
-
newViews.push(view);
|
|
2455
|
-
mountOnItemChange(record.currentIndex, record.item, newViews, null, outletParent, firstRootNode, this.viewContext);
|
|
2456
|
-
}
|
|
2457
|
-
else {
|
|
2458
|
-
const previousView = this.views[record.previousIndex];
|
|
2459
|
-
const previousViewType = this.viewTypes[record.previousIndex];
|
|
2460
|
-
if (previousViewType !== viewType) {
|
|
2461
|
-
view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2462
|
-
const firstRootNode = getRootNodes(previousView, null)[0];
|
|
2463
|
-
const newRootNodes = getRootNodes(view, null);
|
|
2464
|
-
firstRootNode.replaceWith(...newRootNodes);
|
|
2465
|
-
previousView.destroy();
|
|
2466
|
-
}
|
|
2467
|
-
else {
|
|
2468
|
-
view = previousView;
|
|
2469
|
-
updateContext(previousView, context, this.viewContext);
|
|
2470
|
-
}
|
|
2471
|
-
newContexts.push(context);
|
|
2472
|
-
newViews.push(view);
|
|
2473
|
-
}
|
|
2474
|
-
});
|
|
2475
|
-
diffResult.forEachRemovedItem(record => {
|
|
2476
|
-
const view = this.views[record.previousIndex];
|
|
2477
|
-
view.destroy();
|
|
2478
|
-
});
|
|
2479
|
-
diffResult.forEachMovedItem(record => {
|
|
2480
|
-
mountOnItemChange(record.currentIndex, record.item, newViews, null, outletParent, firstRootNode, this.viewContext);
|
|
2481
|
-
});
|
|
2482
|
-
this.viewTypes = newViewTypes;
|
|
2483
|
-
this.views = newViews;
|
|
2484
|
-
this.contexts = newContexts;
|
|
2485
|
-
this.leaves = leaves;
|
|
2486
|
-
}
|
|
2487
|
-
}
|
|
2488
|
-
getLeaves(context) {
|
|
2489
|
-
const leaves = Text$1.decorations(context.text, context.decorations);
|
|
2490
|
-
const contexts = leaves.map((leaf, index) => {
|
|
2491
|
-
return {
|
|
2492
|
-
leaf,
|
|
2493
|
-
text: context.text,
|
|
2494
|
-
parent: context.parent,
|
|
2495
|
-
index,
|
|
2496
|
-
isLast: context.isLast && index === leaves.length - 1
|
|
2497
|
-
};
|
|
2498
|
-
});
|
|
2499
|
-
return { leaves, contexts };
|
|
2500
|
-
}
|
|
2501
|
-
}
|
|
2502
|
-
function getContext(index, leafContexts) {
|
|
2503
|
-
return leafContexts[index];
|
|
2504
|
-
}
|
|
2505
|
-
function getViewType(leafContext, viewContext) {
|
|
2506
|
-
return (viewContext.renderLeaf && viewContext.renderLeaf(leafContext.leaf)) || viewContext.defaultLeaf;
|
|
2507
|
-
}
|
|
2508
|
-
function trackBy(viewContext) {
|
|
2509
|
-
return (index, node) => {
|
|
2510
|
-
return index;
|
|
2511
|
-
};
|
|
2512
|
-
}
|
|
2513
|
-
|
|
2514
|
-
class SlateChildrenOutlet {
|
|
2515
|
-
constructor(elementRef) {
|
|
2516
|
-
this.elementRef = elementRef;
|
|
2517
|
-
}
|
|
2518
|
-
getNativeElement() {
|
|
2519
|
-
return this.elementRef.nativeElement;
|
|
2520
|
-
}
|
|
2521
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateChildrenOutlet, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2522
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: SlateChildrenOutlet, isStandalone: true, selector: "slate-children-outlet", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2523
|
-
}
|
|
2524
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateChildrenOutlet, decorators: [{
|
|
2525
|
-
type: Component,
|
|
2526
|
-
args: [{
|
|
2527
|
-
selector: 'slate-children-outlet',
|
|
2528
|
-
template: ``,
|
|
2529
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2530
|
-
standalone: true
|
|
2531
|
-
}]
|
|
2532
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
2533
|
-
|
|
2534
2494
|
/**
|
|
2535
2495
|
* base class for custom element component or text component
|
|
2536
2496
|
*/
|
|
2537
2497
|
class BaseComponent {
|
|
2498
|
+
constructor() {
|
|
2499
|
+
this.initialized = false;
|
|
2500
|
+
this.elementRef = inject(ElementRef);
|
|
2501
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
2502
|
+
}
|
|
2538
2503
|
set context(value) {
|
|
2539
2504
|
if (hasBeforeContextChange(this)) {
|
|
2540
2505
|
this.beforeContextChange(value);
|
|
@@ -2557,17 +2522,12 @@ class BaseComponent {
|
|
|
2557
2522
|
get nativeElement() {
|
|
2558
2523
|
return this.elementRef.nativeElement;
|
|
2559
2524
|
}
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
this.cdr = cdr;
|
|
2563
|
-
this.initialized = false;
|
|
2564
|
-
}
|
|
2565
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: BaseComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2566
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.4", type: BaseComponent, inputs: { context: "context", viewContext: "viewContext" }, ngImport: i0 }); }
|
|
2525
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2526
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: BaseComponent, isStandalone: true, inputs: { context: "context", viewContext: "viewContext" }, ngImport: i0 }); }
|
|
2567
2527
|
}
|
|
2568
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseComponent, decorators: [{
|
|
2569
2529
|
type: Directive
|
|
2570
|
-
}],
|
|
2530
|
+
}], propDecorators: { context: [{
|
|
2571
2531
|
type: Input
|
|
2572
2532
|
}], viewContext: [{
|
|
2573
2533
|
type: Input
|
|
@@ -2629,10 +2589,10 @@ class BaseLeafComponent extends BaseComponent {
|
|
|
2629
2589
|
this.nativeElement.classList.remove('leaf-with-placeholder');
|
|
2630
2590
|
}
|
|
2631
2591
|
}
|
|
2632
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2633
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2592
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseLeafComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2593
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: BaseLeafComponent, isStandalone: true, host: { properties: { "attr.data-slate-leaf": "this.isSlateLeaf" } }, usesInheritance: true, ngImport: i0 }); }
|
|
2634
2594
|
}
|
|
2635
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2595
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseLeafComponent, decorators: [{
|
|
2636
2596
|
type: Directive
|
|
2637
2597
|
}], propDecorators: { isSlateLeaf: [{
|
|
2638
2598
|
type: HostBinding,
|
|
@@ -2735,10 +2695,10 @@ class BaseElementComponent extends BaseComponent {
|
|
|
2735
2695
|
readonly: this._context.readonly
|
|
2736
2696
|
};
|
|
2737
2697
|
}
|
|
2738
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2739
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2698
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2699
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: BaseElementComponent, isStandalone: true, viewQueries: [{ propertyName: "childrenOutletInstance", first: true, predicate: SlateChildrenOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); }
|
|
2740
2700
|
}
|
|
2741
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2701
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseElementComponent, decorators: [{
|
|
2742
2702
|
type: Directive
|
|
2743
2703
|
}], propDecorators: { childrenOutletInstance: [{
|
|
2744
2704
|
type: ViewChild,
|
|
@@ -2786,37 +2746,16 @@ class BaseTextComponent extends BaseComponent {
|
|
|
2786
2746
|
}
|
|
2787
2747
|
this.leavesRender.update(this.context);
|
|
2788
2748
|
}
|
|
2789
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2790
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2749
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2750
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: BaseTextComponent, isStandalone: true, viewQueries: [{ propertyName: "childrenOutletInstance", first: true, predicate: SlateChildrenOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); }
|
|
2791
2751
|
}
|
|
2792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: BaseTextComponent, decorators: [{
|
|
2793
2753
|
type: Directive
|
|
2794
2754
|
}], propDecorators: { childrenOutletInstance: [{
|
|
2795
2755
|
type: ViewChild,
|
|
2796
2756
|
args: [SlateChildrenOutlet, { static: true }]
|
|
2797
2757
|
}] } });
|
|
2798
2758
|
|
|
2799
|
-
class SlateLeaves extends ViewContainer {
|
|
2800
|
-
constructor() {
|
|
2801
|
-
super(...arguments);
|
|
2802
|
-
this.initialized = false;
|
|
2803
|
-
}
|
|
2804
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateLeaves, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2805
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.4", type: SlateLeaves, isStandalone: true, selector: "slate-leaves", inputs: { context: "context" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2806
|
-
}
|
|
2807
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImport: i0, type: SlateLeaves, decorators: [{
|
|
2808
|
-
type: Component,
|
|
2809
|
-
args: [{
|
|
2810
|
-
selector: 'slate-leaves',
|
|
2811
|
-
template: ``,
|
|
2812
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2813
|
-
standalone: true,
|
|
2814
|
-
imports: [NgFor]
|
|
2815
|
-
}]
|
|
2816
|
-
}], propDecorators: { context: [{
|
|
2817
|
-
type: Input
|
|
2818
|
-
}] } });
|
|
2819
|
-
|
|
2820
2759
|
class SlateVoidText extends BaseTextComponent {
|
|
2821
2760
|
ngOnInit() {
|
|
2822
2761
|
super.ngOnInit();
|
|
@@ -2826,10 +2765,10 @@ class SlateVoidText extends BaseTextComponent {
|
|
|
2826
2765
|
return;
|
|
2827
2766
|
}
|
|
2828
2767
|
}
|
|
2829
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2830
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2768
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateVoidText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2769
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateVoidText, isStandalone: true, selector: "span[slateVoidText]", host: { attributes: { "data-slate-spacer": "true", "data-slate-node": "text" }, classAttribute: "slate-spacer" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2831
2770
|
}
|
|
2832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2771
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateVoidText, decorators: [{
|
|
2833
2772
|
type: Component,
|
|
2834
2773
|
args: [{
|
|
2835
2774
|
selector: 'span[slateVoidText]',
|
|
@@ -2839,17 +2778,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2839
2778
|
'data-slate-spacer': 'true',
|
|
2840
2779
|
class: 'slate-spacer',
|
|
2841
2780
|
'data-slate-node': 'text'
|
|
2842
|
-
}
|
|
2843
|
-
standalone: true,
|
|
2844
|
-
imports: [SlateLeaves]
|
|
2781
|
+
}
|
|
2845
2782
|
}]
|
|
2846
2783
|
}] });
|
|
2847
2784
|
|
|
2848
2785
|
class SlateDefaultText extends BaseTextComponent {
|
|
2849
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2850
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2786
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2787
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateDefaultText, isStandalone: true, selector: "span[slateDefaultText]", host: { attributes: { "data-slate-node": "text" } }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2851
2788
|
}
|
|
2852
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2789
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultText, decorators: [{
|
|
2853
2790
|
type: Component,
|
|
2854
2791
|
args: [{
|
|
2855
2792
|
selector: 'span[slateDefaultText]',
|
|
@@ -2857,24 +2794,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2857
2794
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
2858
2795
|
host: {
|
|
2859
2796
|
'data-slate-node': 'text'
|
|
2860
|
-
}
|
|
2861
|
-
standalone: true,
|
|
2862
|
-
imports: [SlateLeaves]
|
|
2797
|
+
}
|
|
2863
2798
|
}]
|
|
2864
2799
|
}] });
|
|
2865
2800
|
|
|
2866
2801
|
class SlateDefaultElement extends BaseElementComponent {
|
|
2867
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2868
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2802
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultElement, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2803
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateDefaultElement, isStandalone: true, selector: "div[slateDefaultElement]", usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2869
2804
|
}
|
|
2870
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2805
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultElement, decorators: [{
|
|
2871
2806
|
type: Component,
|
|
2872
2807
|
args: [{
|
|
2873
2808
|
selector: 'div[slateDefaultElement]',
|
|
2874
2809
|
template: ``,
|
|
2875
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
2876
|
-
standalone: true,
|
|
2877
|
-
imports: [SlateChildren]
|
|
2810
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
2878
2811
|
}]
|
|
2879
2812
|
}] });
|
|
2880
2813
|
|
|
@@ -2884,6 +2817,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2884
2817
|
* If the dynamically created component uses onpush mode, then it must call markForCheck when setting the context
|
|
2885
2818
|
*/
|
|
2886
2819
|
class ViewContainerItem {
|
|
2820
|
+
constructor() {
|
|
2821
|
+
this.initialized = false;
|
|
2822
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
2823
|
+
}
|
|
2887
2824
|
get rootNodes() {
|
|
2888
2825
|
return this.getRootNodes();
|
|
2889
2826
|
}
|
|
@@ -2896,10 +2833,6 @@ class ViewContainerItem {
|
|
|
2896
2833
|
}
|
|
2897
2834
|
return [];
|
|
2898
2835
|
}
|
|
2899
|
-
constructor(viewContainerRef) {
|
|
2900
|
-
this.viewContainerRef = viewContainerRef;
|
|
2901
|
-
this.initialized = false;
|
|
2902
|
-
}
|
|
2903
2836
|
destroyView() {
|
|
2904
2837
|
if (this.embeddedViewRef) {
|
|
2905
2838
|
this.embeddedViewRef.destroy();
|
|
@@ -2974,21 +2907,16 @@ class ViewContainerItem {
|
|
|
2974
2907
|
this.blockCardComponentRef.instance.append();
|
|
2975
2908
|
}
|
|
2976
2909
|
}
|
|
2977
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2978
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2910
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ViewContainerItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2911
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: ViewContainerItem, isStandalone: true, inputs: { viewContext: "viewContext" }, ngImport: i0 }); }
|
|
2979
2912
|
}
|
|
2980
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2913
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ViewContainerItem, decorators: [{
|
|
2981
2914
|
type: Directive
|
|
2982
|
-
}],
|
|
2915
|
+
}], propDecorators: { viewContext: [{
|
|
2983
2916
|
type: Input
|
|
2984
2917
|
}] } });
|
|
2985
2918
|
|
|
2986
2919
|
class SlateDefaultString extends BaseComponent {
|
|
2987
|
-
constructor(elementRef, cdr) {
|
|
2988
|
-
super(elementRef, cdr);
|
|
2989
|
-
this.elementRef = elementRef;
|
|
2990
|
-
this.cdr = cdr;
|
|
2991
|
-
}
|
|
2992
2920
|
beforeContextChange(value) {
|
|
2993
2921
|
if (this.context) {
|
|
2994
2922
|
if (this.context.type === 'lineBreakEmptyString') {
|
|
@@ -3047,10 +2975,10 @@ class SlateDefaultString extends BaseComponent {
|
|
|
3047
2975
|
ngOnInit() {
|
|
3048
2976
|
this.nativeElement.setAttribute('editable-text', '');
|
|
3049
2977
|
}
|
|
3050
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3051
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2978
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultString, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2979
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateDefaultString, isStandalone: true, selector: "span[slateDefaultString]", usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3052
2980
|
}
|
|
3053
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2981
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultString, decorators: [{
|
|
3054
2982
|
type: Component,
|
|
3055
2983
|
args: [{
|
|
3056
2984
|
selector: 'span[slateDefaultString]',
|
|
@@ -3058,13 +2986,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
3058
2986
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3059
2987
|
standalone: true
|
|
3060
2988
|
}]
|
|
3061
|
-
}]
|
|
2989
|
+
}] });
|
|
3062
2990
|
|
|
3063
2991
|
class SlateString extends ViewContainerItem {
|
|
3064
|
-
constructor(
|
|
3065
|
-
super(
|
|
3066
|
-
this.elementRef =
|
|
3067
|
-
this.viewContainerRef =
|
|
2992
|
+
constructor() {
|
|
2993
|
+
super(...arguments);
|
|
2994
|
+
this.elementRef = inject(ElementRef);
|
|
2995
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
3068
2996
|
}
|
|
3069
2997
|
ngOnInit() {
|
|
3070
2998
|
this.createView();
|
|
@@ -3136,10 +3064,10 @@ class SlateString extends ViewContainerItem {
|
|
|
3136
3064
|
memoizedContext(prev, next) {
|
|
3137
3065
|
return false;
|
|
3138
3066
|
}
|
|
3139
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3140
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
3067
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateString, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3068
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateString, isStandalone: true, selector: "span[slateString]", inputs: { context: "context" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3141
3069
|
}
|
|
3142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3070
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateString, decorators: [{
|
|
3143
3071
|
type: Component,
|
|
3144
3072
|
args: [{
|
|
3145
3073
|
selector: 'span[slateString]',
|
|
@@ -3147,7 +3075,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
3147
3075
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3148
3076
|
standalone: true
|
|
3149
3077
|
}]
|
|
3150
|
-
}],
|
|
3078
|
+
}], propDecorators: { context: [{
|
|
3151
3079
|
type: Input
|
|
3152
3080
|
}] } });
|
|
3153
3081
|
/**
|
|
@@ -3172,10 +3100,10 @@ class SlateDefaultLeaf extends BaseLeafComponent {
|
|
|
3172
3100
|
// Because the placeholder span is not in the current component, it is destroyed along with the current component
|
|
3173
3101
|
this.destroyPlaceholder();
|
|
3174
3102
|
}
|
|
3175
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3176
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
3103
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultLeaf, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3104
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateDefaultLeaf, isStandalone: true, selector: "span[slateDefaultLeaf]", host: { attributes: { "data-slate-leaf": "true" } }, usesInheritance: true, ngImport: i0, template: `<span slateString [context]="context" [viewContext]="viewContext"><span></span></span>`, isInline: true, dependencies: [{ kind: "component", type: SlateString, selector: "span[slateString]", inputs: ["context"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3177
3105
|
}
|
|
3178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateDefaultLeaf, decorators: [{
|
|
3179
3107
|
type: Component,
|
|
3180
3108
|
args: [{
|
|
3181
3109
|
selector: 'span[slateDefaultLeaf]',
|
|
@@ -3184,7 +3112,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
3184
3112
|
host: {
|
|
3185
3113
|
'data-slate-leaf': 'true'
|
|
3186
3114
|
},
|
|
3187
|
-
standalone: true,
|
|
3188
3115
|
imports: [SlateString]
|
|
3189
3116
|
}]
|
|
3190
3117
|
}] });
|
|
@@ -4218,8 +4145,8 @@ class SlateEditable {
|
|
|
4218
4145
|
this.destroy$.complete();
|
|
4219
4146
|
EDITOR_TO_ON_CHANGE.delete(this.editor);
|
|
4220
4147
|
}
|
|
4221
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4222
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
4148
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateEditable, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.Injector }, { token: SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN }, { token: SLATE_DEFAULT_TEXT_COMPONENT_TOKEN }, { token: SLATE_DEFAULT_VOID_TEXT_COMPONENT_TOKEN }, { token: SLATE_DEFAULT_LEAF_COMPONENT_TOKEN }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4149
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateEditable, isStandalone: true, selector: "slate-editable", inputs: { editor: "editor", renderElement: "renderElement", renderLeaf: "renderLeaf", renderText: "renderText", decorate: "decorate", placeholderDecorate: "placeholderDecorate", scrollSelectionIntoView: "scrollSelectionIntoView", isStrictDecorate: "isStrictDecorate", trackBy: "trackBy", readonly: "readonly", placeholder: "placeholder", beforeInput: "beforeInput", blur: "blur", click: "click", compositionEnd: "compositionEnd", compositionUpdate: "compositionUpdate", compositionStart: "compositionStart", copy: "copy", cut: "cut", dragOver: "dragOver", dragStart: "dragStart", dragEnd: "dragEnd", drop: "drop", focus: "focus", keydown: "keydown", paste: "paste", spellCheck: "spellCheck", autoCorrect: "autoCorrect", autoCapitalize: "autoCapitalize" }, host: { properties: { "attr.contenteditable": "readonly ? undefined : true", "attr.role": "readonly ? undefined : 'textbox'", "attr.spellCheck": "!hasBeforeInputSupport ? false : spellCheck", "attr.autoCorrect": "!hasBeforeInputSupport ? 'false' : autoCorrect", "attr.autoCapitalize": "!hasBeforeInputSupport ? 'false' : autoCapitalize", "attr.data-slate-editor": "this.dataSlateEditor", "attr.data-slate-node": "this.dataSlateNode", "attr.data-gramm": "this.dataGramm" }, classAttribute: "slate-editable-container" }, providers: [
|
|
4223
4150
|
{
|
|
4224
4151
|
provide: NG_VALUE_ACCESSOR,
|
|
4225
4152
|
useExisting: forwardRef(() => SlateEditable),
|
|
@@ -4243,7 +4170,7 @@ class SlateEditable {
|
|
|
4243
4170
|
}
|
|
4244
4171
|
], viewQueries: [{ propertyName: "templateComponent", first: true, predicate: ["templateComponent"], descendants: true, static: true }, { propertyName: "templateElementRef", first: true, predicate: ["templateComponent"], descendants: true, read: ElementRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<slate-string-template #templateComponent></slate-string-template>\n", dependencies: [{ kind: "component", type: SlateStringTemplate, selector: "slate-string-template" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4245
4172
|
}
|
|
4246
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateEditable, decorators: [{
|
|
4247
4174
|
type: Component,
|
|
4248
4175
|
args: [{ selector: 'slate-editable', host: {
|
|
4249
4176
|
class: 'slate-editable-container',
|
|
@@ -4274,7 +4201,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
4274
4201
|
provide: SLATE_DEFAULT_LEAF_COMPONENT_TOKEN,
|
|
4275
4202
|
useValue: SlateDefaultLeaf
|
|
4276
4203
|
}
|
|
4277
|
-
],
|
|
4204
|
+
], imports: [SlateStringTemplate], template: "<slate-string-template #templateComponent></slate-string-template>\n" }]
|
|
4278
4205
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i0.Injector }, { type: undefined, decorators: [{
|
|
4279
4206
|
type: Inject,
|
|
4280
4207
|
args: [SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN]
|
|
@@ -4431,23 +4358,81 @@ const preventInsertFromComposition = (event, editor) => {
|
|
|
4431
4358
|
};
|
|
4432
4359
|
|
|
4433
4360
|
class SlateElement extends BaseElementComponent {
|
|
4434
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4435
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
4361
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateElement, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4362
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateElement, isStandalone: true, selector: "[slateElement]", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4436
4363
|
}
|
|
4437
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateElement, decorators: [{
|
|
4438
4365
|
type: Component,
|
|
4439
4366
|
args: [{
|
|
4440
4367
|
selector: '[slateElement]',
|
|
4441
4368
|
template: '<ng-content></ng-content>',
|
|
4442
|
-
changeDetection: ChangeDetectionStrategy.OnPush
|
|
4443
|
-
standalone: true,
|
|
4444
|
-
imports: [SlateChildren]
|
|
4369
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
4445
4370
|
}]
|
|
4446
4371
|
}] });
|
|
4447
4372
|
|
|
4373
|
+
/**
|
|
4374
|
+
* @deprecated
|
|
4375
|
+
* the special container for angular template
|
|
4376
|
+
* Add the rootNodes of each child component to the parentElement
|
|
4377
|
+
* Remove useless DOM elements, eg: comment...
|
|
4378
|
+
*/
|
|
4379
|
+
class ViewContainer {
|
|
4380
|
+
constructor(elementRef, differs) {
|
|
4381
|
+
this.elementRef = elementRef;
|
|
4382
|
+
this.differs = differs;
|
|
4383
|
+
}
|
|
4384
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ViewContainer, deps: [{ token: i0.ElementRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
4385
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: ViewContainer, isStandalone: true, inputs: { viewContext: "viewContext" }, ngImport: i0 }); }
|
|
4386
|
+
}
|
|
4387
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: ViewContainer, decorators: [{
|
|
4388
|
+
type: Directive
|
|
4389
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.IterableDiffers }], propDecorators: { viewContext: [{
|
|
4390
|
+
type: Input
|
|
4391
|
+
}] } });
|
|
4392
|
+
|
|
4393
|
+
class SlateChildren extends ViewContainer {
|
|
4394
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateChildren, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4395
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateChildren, isStandalone: true, selector: "slate-children", inputs: { children: "children", context: "context", viewContext: "viewContext" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4396
|
+
}
|
|
4397
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateChildren, decorators: [{
|
|
4398
|
+
type: Component,
|
|
4399
|
+
args: [{
|
|
4400
|
+
selector: 'slate-children',
|
|
4401
|
+
template: ``,
|
|
4402
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4403
|
+
standalone: true
|
|
4404
|
+
}]
|
|
4405
|
+
}], propDecorators: { children: [{
|
|
4406
|
+
type: Input
|
|
4407
|
+
}], context: [{
|
|
4408
|
+
type: Input
|
|
4409
|
+
}], viewContext: [{
|
|
4410
|
+
type: Input
|
|
4411
|
+
}] } });
|
|
4412
|
+
|
|
4413
|
+
class SlateLeaves extends ViewContainer {
|
|
4414
|
+
constructor() {
|
|
4415
|
+
super(...arguments);
|
|
4416
|
+
this.initialized = false;
|
|
4417
|
+
}
|
|
4418
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateLeaves, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4419
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: SlateLeaves, isStandalone: true, selector: "slate-leaves", inputs: { context: "context" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4420
|
+
}
|
|
4421
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateLeaves, decorators: [{
|
|
4422
|
+
type: Component,
|
|
4423
|
+
args: [{
|
|
4424
|
+
selector: 'slate-leaves',
|
|
4425
|
+
template: ``,
|
|
4426
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4427
|
+
imports: []
|
|
4428
|
+
}]
|
|
4429
|
+
}], propDecorators: { context: [{
|
|
4430
|
+
type: Input
|
|
4431
|
+
}] } });
|
|
4432
|
+
|
|
4448
4433
|
class SlateModule {
|
|
4449
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4450
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
4434
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4435
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: SlateModule, imports: [CommonModule,
|
|
4451
4436
|
SlateEditable,
|
|
4452
4437
|
SlateDefaultElement,
|
|
4453
4438
|
SlateElement,
|
|
@@ -4461,14 +4446,14 @@ class SlateModule {
|
|
|
4461
4446
|
SlateDefaultLeaf,
|
|
4462
4447
|
SlateDefaultString,
|
|
4463
4448
|
SlateChildrenOutlet], exports: [SlateEditable, SlateChildren, SlateChildrenOutlet, SlateElement, SlateLeaves, SlateString, SlateDefaultString] }); }
|
|
4464
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
4449
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateModule, providers: [
|
|
4465
4450
|
{
|
|
4466
4451
|
provide: SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN,
|
|
4467
4452
|
useValue: SlateDefaultElement
|
|
4468
4453
|
}
|
|
4469
4454
|
], imports: [CommonModule] }); }
|
|
4470
4455
|
}
|
|
4471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4456
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SlateModule, decorators: [{
|
|
4472
4457
|
type: NgModule,
|
|
4473
4458
|
args: [{
|
|
4474
4459
|
imports: [
|