slate-angular 18.0.0 → 18.0.1
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/esm2022/components/block-card/block-card.component.mjs +3 -3
- package/esm2022/components/children/children-outlet.component.mjs +3 -3
- package/esm2022/components/children/children.component.mjs +3 -3
- package/esm2022/components/editable/editable.component.mjs +3 -3
- package/esm2022/components/element/default-element.component.mjs +3 -3
- package/esm2022/components/element/element.component.mjs +5 -5
- package/esm2022/components/leaf/default-leaf.component.mjs +3 -3
- package/esm2022/components/leaves/leaves.component.mjs +3 -3
- package/esm2022/components/string/default-string.component.mjs +6 -11
- package/esm2022/components/string/string.component.mjs +10 -10
- package/esm2022/components/string/template.component.mjs +3 -3
- package/esm2022/components/text/default-text.component.mjs +3 -3
- package/esm2022/components/text/void-text.component.mjs +3 -3
- package/esm2022/module.mjs +4 -4
- package/esm2022/view/base.mjs +23 -23
- package/esm2022/view/container-item.mjs +10 -10
- package/esm2022/view/container.mjs +3 -3
- package/fesm2022/slate-angular.mjs +237 -242
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/package.json +1 -1
- 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 +6 -8
- package/view/container-item.d.ts +1 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Editor, Range, Element, Transforms, 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, Component, ChangeDetectionStrategy, ViewChild, Directive, Input, InjectionToken, ComponentRef, IterableDiffers,
|
|
4
|
+
import { TemplateRef, Component, ChangeDetectionStrategy, ViewChild, Directive, Input, InjectionToken, ComponentRef, IterableDiffers, inject, ElementRef, ChangeDetectorRef, 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';
|
|
@@ -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: "18.2.0", ngImport: i0, type: SlateStringTemplate, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1871
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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: "18.2.0", 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: [{
|
|
@@ -1927,20 +1927,20 @@ class ViewContainer {
|
|
|
1927
1927
|
this.elementRef = elementRef;
|
|
1928
1928
|
this.differs = differs;
|
|
1929
1929
|
}
|
|
1930
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1931
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
1930
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ViewContainer, deps: [{ token: i0.ElementRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1931
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: ViewContainer, inputs: { viewContext: "viewContext" }, ngImport: i0 }); }
|
|
1932
1932
|
}
|
|
1933
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1933
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ViewContainer, decorators: [{
|
|
1934
1934
|
type: Directive
|
|
1935
1935
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.IterableDiffers }], propDecorators: { viewContext: [{
|
|
1936
1936
|
type: Input
|
|
1937
1937
|
}] } });
|
|
1938
1938
|
|
|
1939
1939
|
class SlateChildren extends ViewContainer {
|
|
1940
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1941
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
1940
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateChildren, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1941
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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 }); }
|
|
1942
1942
|
}
|
|
1943
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1943
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateChildren, decorators: [{
|
|
1944
1944
|
type: Component,
|
|
1945
1945
|
args: [{
|
|
1946
1946
|
selector: 'slate-children',
|
|
@@ -1961,6 +1961,26 @@ const SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN = new InjectionToken('slate-default-
|
|
|
1961
1961
|
const SLATE_DEFAULT_TEXT_COMPONENT_TOKEN = new InjectionToken('slate-default-text-token');
|
|
1962
1962
|
const SLATE_DEFAULT_VOID_TEXT_COMPONENT_TOKEN = new InjectionToken('slate-default-void-text-token');
|
|
1963
1963
|
|
|
1964
|
+
class SlateChildrenOutlet {
|
|
1965
|
+
constructor(elementRef) {
|
|
1966
|
+
this.elementRef = elementRef;
|
|
1967
|
+
}
|
|
1968
|
+
getNativeElement() {
|
|
1969
|
+
return this.elementRef.nativeElement;
|
|
1970
|
+
}
|
|
1971
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateChildrenOutlet, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1972
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: SlateChildrenOutlet, isStandalone: true, selector: "slate-children-outlet", ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1973
|
+
}
|
|
1974
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateChildrenOutlet, decorators: [{
|
|
1975
|
+
type: Component,
|
|
1976
|
+
args: [{
|
|
1977
|
+
selector: 'slate-children-outlet',
|
|
1978
|
+
template: ``,
|
|
1979
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1980
|
+
standalone: true
|
|
1981
|
+
}]
|
|
1982
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }] });
|
|
1983
|
+
|
|
1964
1984
|
function hasBeforeContextChange(value) {
|
|
1965
1985
|
if (value.beforeContextChange) {
|
|
1966
1986
|
return true;
|
|
@@ -1974,37 +1994,6 @@ function hasAfterContextChange(value) {
|
|
|
1974
1994
|
return false;
|
|
1975
1995
|
}
|
|
1976
1996
|
|
|
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
1997
|
function createEmbeddedViewOrComponent(viewType, context, viewContext, viewContainerRef) {
|
|
2009
1998
|
if (isTemplateRef(viewType)) {
|
|
2010
1999
|
const embeddedViewContext = {
|
|
@@ -2113,6 +2102,141 @@ function mountOnItemChange(index, item, views, blockCards, outletParent, firstRo
|
|
|
2113
2102
|
}
|
|
2114
2103
|
}
|
|
2115
2104
|
|
|
2105
|
+
class LeavesRender {
|
|
2106
|
+
constructor(viewContext, viewContainerRef, getOutletParent, getOutletElement) {
|
|
2107
|
+
this.viewContext = viewContext;
|
|
2108
|
+
this.viewContainerRef = viewContainerRef;
|
|
2109
|
+
this.getOutletParent = getOutletParent;
|
|
2110
|
+
this.getOutletElement = getOutletElement;
|
|
2111
|
+
this.views = [];
|
|
2112
|
+
this.contexts = [];
|
|
2113
|
+
this.viewTypes = [];
|
|
2114
|
+
}
|
|
2115
|
+
initialize(context) {
|
|
2116
|
+
const { leaves, contexts } = this.getLeaves(context);
|
|
2117
|
+
this.leaves = leaves;
|
|
2118
|
+
this.contexts = contexts;
|
|
2119
|
+
this.leaves.forEach((leaf, index) => {
|
|
2120
|
+
const context = getContext$1(index, this.contexts);
|
|
2121
|
+
const viewType = getViewType$1(context, this.viewContext);
|
|
2122
|
+
const view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2123
|
+
this.views.push(view);
|
|
2124
|
+
this.contexts.push(context);
|
|
2125
|
+
this.viewTypes.push(viewType);
|
|
2126
|
+
});
|
|
2127
|
+
mount(this.views, null, this.getOutletParent(), this.getOutletElement());
|
|
2128
|
+
const newDiffers = this.viewContainerRef.injector.get(IterableDiffers);
|
|
2129
|
+
this.differ = newDiffers.find(this.leaves).create(trackBy$1(this.viewContext));
|
|
2130
|
+
this.differ.diff(this.leaves);
|
|
2131
|
+
}
|
|
2132
|
+
update(context) {
|
|
2133
|
+
const { leaves, contexts } = this.getLeaves(context);
|
|
2134
|
+
const outletParent = this.getOutletParent();
|
|
2135
|
+
const diffResult = this.differ.diff(leaves);
|
|
2136
|
+
if (diffResult) {
|
|
2137
|
+
let firstRootNode = getRootNodes(this.views[0])[0];
|
|
2138
|
+
const newContexts = [];
|
|
2139
|
+
const newViewTypes = [];
|
|
2140
|
+
const newViews = [];
|
|
2141
|
+
diffResult.forEachItem(record => {
|
|
2142
|
+
let context = getContext$1(record.currentIndex, contexts);
|
|
2143
|
+
const viewType = getViewType$1(context, this.viewContext);
|
|
2144
|
+
newViewTypes.push(viewType);
|
|
2145
|
+
let view;
|
|
2146
|
+
if (record.previousIndex === null) {
|
|
2147
|
+
view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2148
|
+
newContexts.push(context);
|
|
2149
|
+
newViews.push(view);
|
|
2150
|
+
mountOnItemChange(record.currentIndex, record.item, newViews, null, outletParent, firstRootNode, this.viewContext);
|
|
2151
|
+
}
|
|
2152
|
+
else {
|
|
2153
|
+
const previousView = this.views[record.previousIndex];
|
|
2154
|
+
const previousViewType = this.viewTypes[record.previousIndex];
|
|
2155
|
+
if (previousViewType !== viewType) {
|
|
2156
|
+
view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2157
|
+
const firstRootNode = getRootNodes(previousView, null)[0];
|
|
2158
|
+
const newRootNodes = getRootNodes(view, null);
|
|
2159
|
+
firstRootNode.replaceWith(...newRootNodes);
|
|
2160
|
+
previousView.destroy();
|
|
2161
|
+
}
|
|
2162
|
+
else {
|
|
2163
|
+
view = previousView;
|
|
2164
|
+
updateContext(previousView, context, this.viewContext);
|
|
2165
|
+
}
|
|
2166
|
+
newContexts.push(context);
|
|
2167
|
+
newViews.push(view);
|
|
2168
|
+
}
|
|
2169
|
+
});
|
|
2170
|
+
diffResult.forEachRemovedItem(record => {
|
|
2171
|
+
const view = this.views[record.previousIndex];
|
|
2172
|
+
view.destroy();
|
|
2173
|
+
});
|
|
2174
|
+
diffResult.forEachMovedItem(record => {
|
|
2175
|
+
mountOnItemChange(record.currentIndex, record.item, newViews, null, outletParent, firstRootNode, this.viewContext);
|
|
2176
|
+
});
|
|
2177
|
+
this.viewTypes = newViewTypes;
|
|
2178
|
+
this.views = newViews;
|
|
2179
|
+
this.contexts = newContexts;
|
|
2180
|
+
this.leaves = leaves;
|
|
2181
|
+
}
|
|
2182
|
+
}
|
|
2183
|
+
getLeaves(context) {
|
|
2184
|
+
const leaves = Text$1.decorations(context.text, context.decorations);
|
|
2185
|
+
const contexts = leaves.map((leaf, index) => {
|
|
2186
|
+
return {
|
|
2187
|
+
leaf,
|
|
2188
|
+
text: context.text,
|
|
2189
|
+
parent: context.parent,
|
|
2190
|
+
index,
|
|
2191
|
+
isLast: context.isLast && index === leaves.length - 1
|
|
2192
|
+
};
|
|
2193
|
+
});
|
|
2194
|
+
return { leaves, contexts };
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2197
|
+
function getContext$1(index, leafContexts) {
|
|
2198
|
+
return leafContexts[index];
|
|
2199
|
+
}
|
|
2200
|
+
function getViewType$1(leafContext, viewContext) {
|
|
2201
|
+
return (viewContext.renderLeaf && viewContext.renderLeaf(leafContext.leaf)) || viewContext.defaultLeaf;
|
|
2202
|
+
}
|
|
2203
|
+
function trackBy$1(viewContext) {
|
|
2204
|
+
return (index, node) => {
|
|
2205
|
+
return index;
|
|
2206
|
+
};
|
|
2207
|
+
}
|
|
2208
|
+
|
|
2209
|
+
class SlateBlockCard {
|
|
2210
|
+
get nativeElement() {
|
|
2211
|
+
return this.elementRef.nativeElement;
|
|
2212
|
+
}
|
|
2213
|
+
get centerContainerElement() {
|
|
2214
|
+
return this.centerContianer.nativeElement;
|
|
2215
|
+
}
|
|
2216
|
+
constructor(elementRef) {
|
|
2217
|
+
this.elementRef = elementRef;
|
|
2218
|
+
}
|
|
2219
|
+
ngOnInit() {
|
|
2220
|
+
this.nativeElement.classList.add(`slate-block-card`);
|
|
2221
|
+
}
|
|
2222
|
+
append() {
|
|
2223
|
+
this.centerRootNodes.forEach(rootNode => !this.centerContainerElement.contains(rootNode) && this.centerContainerElement.appendChild(rootNode));
|
|
2224
|
+
}
|
|
2225
|
+
initializeCenter(rootNodes) {
|
|
2226
|
+
this.centerRootNodes = rootNodes;
|
|
2227
|
+
this.append();
|
|
2228
|
+
}
|
|
2229
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateBlockCard, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2230
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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" }); }
|
|
2231
|
+
}
|
|
2232
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateBlockCard, decorators: [{
|
|
2233
|
+
type: Component,
|
|
2234
|
+
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" }]
|
|
2235
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { centerContianer: [{
|
|
2236
|
+
type: ViewChild,
|
|
2237
|
+
args: ['centerContianer', { static: true }]
|
|
2238
|
+
}] } });
|
|
2239
|
+
|
|
2116
2240
|
class ListRender {
|
|
2117
2241
|
constructor(viewContext, viewContainerRef, getOutletParent, getOutletElement) {
|
|
2118
2242
|
this.viewContext = viewContext;
|
|
@@ -2134,8 +2258,8 @@ class ListRender {
|
|
|
2134
2258
|
children.forEach((descendant, index) => {
|
|
2135
2259
|
NODE_TO_INDEX.set(descendant, index);
|
|
2136
2260
|
NODE_TO_PARENT.set(descendant, parent);
|
|
2137
|
-
const context = getContext
|
|
2138
|
-
const viewType = getViewType
|
|
2261
|
+
const context = getContext(index, descendant, parentPath, childrenContext, this.viewContext);
|
|
2262
|
+
const viewType = getViewType(descendant, parent, this.viewContext);
|
|
2139
2263
|
const view = createEmbeddedViewOrComponent(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2140
2264
|
const blockCard = createBlockCard(descendant, view, this.viewContainerRef, this.viewContext);
|
|
2141
2265
|
this.views.push(view);
|
|
@@ -2145,7 +2269,7 @@ class ListRender {
|
|
|
2145
2269
|
});
|
|
2146
2270
|
mount(this.views, this.blockCards, this.getOutletParent(), this.getOutletElement());
|
|
2147
2271
|
const newDiffers = this.viewContainerRef.injector.get(IterableDiffers);
|
|
2148
|
-
this.differ = newDiffers.find(children).create(trackBy
|
|
2272
|
+
this.differ = newDiffers.find(children).create(trackBy(this.viewContext));
|
|
2149
2273
|
this.differ.diff(children);
|
|
2150
2274
|
if (parent === this.viewContext.editor) {
|
|
2151
2275
|
executeAfterViewInit(this.viewContext.editor);
|
|
@@ -2171,8 +2295,8 @@ class ListRender {
|
|
|
2171
2295
|
diffResult.forEachItem(record => {
|
|
2172
2296
|
NODE_TO_INDEX.set(record.item, record.currentIndex);
|
|
2173
2297
|
NODE_TO_PARENT.set(record.item, parent);
|
|
2174
|
-
let context = getContext
|
|
2175
|
-
const viewType = getViewType
|
|
2298
|
+
let context = getContext(record.currentIndex, record.item, parentPath, childrenContext, this.viewContext);
|
|
2299
|
+
const viewType = getViewType(record.item, parent, this.viewContext);
|
|
2176
2300
|
newViewTypes.push(viewType);
|
|
2177
2301
|
let view;
|
|
2178
2302
|
let blockCard;
|
|
@@ -2242,7 +2366,7 @@ class ListRender {
|
|
|
2242
2366
|
this.children.forEach((child, index) => {
|
|
2243
2367
|
NODE_TO_INDEX.set(child, index);
|
|
2244
2368
|
NODE_TO_PARENT.set(child, parent);
|
|
2245
|
-
let context = getContext
|
|
2369
|
+
let context = getContext(index, child, parentPath, childrenContext, this.viewContext);
|
|
2246
2370
|
const previousContext = this.contexts[index];
|
|
2247
2371
|
if (memoizedContext(this.viewContext, child, previousContext, context)) {
|
|
2248
2372
|
context = previousContext;
|
|
@@ -2272,7 +2396,7 @@ class ListRender {
|
|
|
2272
2396
|
this.differ = null;
|
|
2273
2397
|
}
|
|
2274
2398
|
}
|
|
2275
|
-
function getContext
|
|
2399
|
+
function getContext(index, item, parentPath, childrenContext, viewContext) {
|
|
2276
2400
|
if (Element.isElement(item)) {
|
|
2277
2401
|
const computedContext = getCommonContext(index, item, parentPath, viewContext, childrenContext);
|
|
2278
2402
|
const key = AngularEditor.findKey(viewContext.editor, item);
|
|
@@ -2340,7 +2464,7 @@ function getCommonContext(index, item, parentPath, viewContext, childrenContext)
|
|
|
2340
2464
|
return { selection: null, decorations: [] };
|
|
2341
2465
|
}
|
|
2342
2466
|
}
|
|
2343
|
-
function getViewType
|
|
2467
|
+
function getViewType(item, parent, viewContext) {
|
|
2344
2468
|
if (Element.isElement(item)) {
|
|
2345
2469
|
return (viewContext.renderElement && viewContext.renderElement(item)) || viewContext.defaultElement;
|
|
2346
2470
|
}
|
|
@@ -2364,7 +2488,7 @@ function createBlockCard(item, view, viewContainerRef, viewContext) {
|
|
|
2364
2488
|
return null;
|
|
2365
2489
|
}
|
|
2366
2490
|
}
|
|
2367
|
-
function trackBy
|
|
2491
|
+
function trackBy(viewContext) {
|
|
2368
2492
|
return (index, node) => {
|
|
2369
2493
|
return viewContext.trackBy(node) || AngularEditor.findKey(viewContext.editor, node);
|
|
2370
2494
|
};
|
|
@@ -2407,134 +2531,15 @@ function executeAfterViewInit(editor) {
|
|
|
2407
2531
|
clearAfterViewInitQueue(editor);
|
|
2408
2532
|
}
|
|
2409
2533
|
|
|
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
2534
|
/**
|
|
2535
2535
|
* base class for custom element component or text component
|
|
2536
2536
|
*/
|
|
2537
2537
|
class BaseComponent {
|
|
2538
|
+
constructor() {
|
|
2539
|
+
this.initialized = false;
|
|
2540
|
+
this.elementRef = inject(ElementRef);
|
|
2541
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
2542
|
+
}
|
|
2538
2543
|
set context(value) {
|
|
2539
2544
|
if (hasBeforeContextChange(this)) {
|
|
2540
2545
|
this.beforeContextChange(value);
|
|
@@ -2557,17 +2562,12 @@ class BaseComponent {
|
|
|
2557
2562
|
get nativeElement() {
|
|
2558
2563
|
return this.elementRef.nativeElement;
|
|
2559
2564
|
}
|
|
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 }); }
|
|
2565
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2566
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: BaseComponent, inputs: { context: "context", viewContext: "viewContext" }, ngImport: i0 }); }
|
|
2567
2567
|
}
|
|
2568
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseComponent, decorators: [{
|
|
2569
2569
|
type: Directive
|
|
2570
|
-
}],
|
|
2570
|
+
}], propDecorators: { context: [{
|
|
2571
2571
|
type: Input
|
|
2572
2572
|
}], viewContext: [{
|
|
2573
2573
|
type: Input
|
|
@@ -2629,10 +2629,10 @@ class BaseLeafComponent extends BaseComponent {
|
|
|
2629
2629
|
this.nativeElement.classList.remove('leaf-with-placeholder');
|
|
2630
2630
|
}
|
|
2631
2631
|
}
|
|
2632
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2633
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2632
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseLeafComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2633
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: BaseLeafComponent, host: { properties: { "attr.data-slate-leaf": "this.isSlateLeaf" } }, usesInheritance: true, ngImport: i0 }); }
|
|
2634
2634
|
}
|
|
2635
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2635
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseLeafComponent, decorators: [{
|
|
2636
2636
|
type: Directive
|
|
2637
2637
|
}], propDecorators: { isSlateLeaf: [{
|
|
2638
2638
|
type: HostBinding,
|
|
@@ -2735,10 +2735,10 @@ class BaseElementComponent extends BaseComponent {
|
|
|
2735
2735
|
readonly: this._context.readonly
|
|
2736
2736
|
};
|
|
2737
2737
|
}
|
|
2738
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2739
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2738
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2739
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: BaseElementComponent, viewQueries: [{ propertyName: "childrenOutletInstance", first: true, predicate: SlateChildrenOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); }
|
|
2740
2740
|
}
|
|
2741
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2741
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseElementComponent, decorators: [{
|
|
2742
2742
|
type: Directive
|
|
2743
2743
|
}], propDecorators: { childrenOutletInstance: [{
|
|
2744
2744
|
type: ViewChild,
|
|
@@ -2786,10 +2786,10 @@ class BaseTextComponent extends BaseComponent {
|
|
|
2786
2786
|
}
|
|
2787
2787
|
this.leavesRender.update(this.context);
|
|
2788
2788
|
}
|
|
2789
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2790
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2789
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseTextComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2790
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: BaseTextComponent, viewQueries: [{ propertyName: "childrenOutletInstance", first: true, predicate: SlateChildrenOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); }
|
|
2791
2791
|
}
|
|
2792
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: BaseTextComponent, decorators: [{
|
|
2793
2793
|
type: Directive
|
|
2794
2794
|
}], propDecorators: { childrenOutletInstance: [{
|
|
2795
2795
|
type: ViewChild,
|
|
@@ -2801,10 +2801,10 @@ class SlateLeaves extends ViewContainer {
|
|
|
2801
2801
|
super(...arguments);
|
|
2802
2802
|
this.initialized = false;
|
|
2803
2803
|
}
|
|
2804
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2805
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2804
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateLeaves, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2805
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: SlateLeaves, isStandalone: true, selector: "slate-leaves", inputs: { context: "context" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2806
2806
|
}
|
|
2807
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2807
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateLeaves, decorators: [{
|
|
2808
2808
|
type: Component,
|
|
2809
2809
|
args: [{
|
|
2810
2810
|
selector: 'slate-leaves',
|
|
@@ -2826,10 +2826,10 @@ class SlateVoidText extends BaseTextComponent {
|
|
|
2826
2826
|
return;
|
|
2827
2827
|
}
|
|
2828
2828
|
}
|
|
2829
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2830
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
2829
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateVoidText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2830
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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
2831
|
}
|
|
2832
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateVoidText, decorators: [{
|
|
2833
2833
|
type: Component,
|
|
2834
2834
|
args: [{
|
|
2835
2835
|
selector: 'span[slateVoidText]',
|
|
@@ -2846,10 +2846,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2846
2846
|
}] });
|
|
2847
2847
|
|
|
2848
2848
|
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: "
|
|
2849
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultText, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2850
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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
2851
|
}
|
|
2852
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2852
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultText, decorators: [{
|
|
2853
2853
|
type: Component,
|
|
2854
2854
|
args: [{
|
|
2855
2855
|
selector: 'span[slateDefaultText]',
|
|
@@ -2864,10 +2864,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2864
2864
|
}] });
|
|
2865
2865
|
|
|
2866
2866
|
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: "
|
|
2867
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultElement, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
2868
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: SlateDefaultElement, isStandalone: true, selector: "div[slateDefaultElement]", usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2869
2869
|
}
|
|
2870
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2870
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultElement, decorators: [{
|
|
2871
2871
|
type: Component,
|
|
2872
2872
|
args: [{
|
|
2873
2873
|
selector: 'div[slateDefaultElement]',
|
|
@@ -2884,6 +2884,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
2884
2884
|
* If the dynamically created component uses onpush mode, then it must call markForCheck when setting the context
|
|
2885
2885
|
*/
|
|
2886
2886
|
class ViewContainerItem {
|
|
2887
|
+
constructor() {
|
|
2888
|
+
this.initialized = false;
|
|
2889
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
2890
|
+
}
|
|
2887
2891
|
get rootNodes() {
|
|
2888
2892
|
return this.getRootNodes();
|
|
2889
2893
|
}
|
|
@@ -2896,10 +2900,6 @@ class ViewContainerItem {
|
|
|
2896
2900
|
}
|
|
2897
2901
|
return [];
|
|
2898
2902
|
}
|
|
2899
|
-
constructor(viewContainerRef) {
|
|
2900
|
-
this.viewContainerRef = viewContainerRef;
|
|
2901
|
-
this.initialized = false;
|
|
2902
|
-
}
|
|
2903
2903
|
destroyView() {
|
|
2904
2904
|
if (this.embeddedViewRef) {
|
|
2905
2905
|
this.embeddedViewRef.destroy();
|
|
@@ -2974,21 +2974,16 @@ class ViewContainerItem {
|
|
|
2974
2974
|
this.blockCardComponentRef.instance.append();
|
|
2975
2975
|
}
|
|
2976
2976
|
}
|
|
2977
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
2978
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "
|
|
2977
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ViewContainerItem, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
2978
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0", type: ViewContainerItem, inputs: { viewContext: "viewContext" }, ngImport: i0 }); }
|
|
2979
2979
|
}
|
|
2980
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2980
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: ViewContainerItem, decorators: [{
|
|
2981
2981
|
type: Directive
|
|
2982
|
-
}],
|
|
2982
|
+
}], propDecorators: { viewContext: [{
|
|
2983
2983
|
type: Input
|
|
2984
2984
|
}] } });
|
|
2985
2985
|
|
|
2986
2986
|
class SlateDefaultString extends BaseComponent {
|
|
2987
|
-
constructor(elementRef, cdr) {
|
|
2988
|
-
super(elementRef, cdr);
|
|
2989
|
-
this.elementRef = elementRef;
|
|
2990
|
-
this.cdr = cdr;
|
|
2991
|
-
}
|
|
2992
2987
|
beforeContextChange(value) {
|
|
2993
2988
|
if (this.context) {
|
|
2994
2989
|
if (this.context.type === 'lineBreakEmptyString') {
|
|
@@ -3047,10 +3042,10 @@ class SlateDefaultString extends BaseComponent {
|
|
|
3047
3042
|
ngOnInit() {
|
|
3048
3043
|
this.nativeElement.setAttribute('editable-text', '');
|
|
3049
3044
|
}
|
|
3050
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3051
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
3045
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultString, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3046
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: SlateDefaultString, isStandalone: true, selector: "span[slateDefaultString]", usesInheritance: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3052
3047
|
}
|
|
3053
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3048
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultString, decorators: [{
|
|
3054
3049
|
type: Component,
|
|
3055
3050
|
args: [{
|
|
3056
3051
|
selector: 'span[slateDefaultString]',
|
|
@@ -3058,13 +3053,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
3058
3053
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3059
3054
|
standalone: true
|
|
3060
3055
|
}]
|
|
3061
|
-
}]
|
|
3056
|
+
}] });
|
|
3062
3057
|
|
|
3063
3058
|
class SlateString extends ViewContainerItem {
|
|
3064
|
-
constructor(
|
|
3065
|
-
super(
|
|
3066
|
-
this.elementRef =
|
|
3067
|
-
this.viewContainerRef =
|
|
3059
|
+
constructor() {
|
|
3060
|
+
super(...arguments);
|
|
3061
|
+
this.elementRef = inject(ElementRef);
|
|
3062
|
+
this.viewContainerRef = inject(ViewContainerRef);
|
|
3068
3063
|
}
|
|
3069
3064
|
ngOnInit() {
|
|
3070
3065
|
this.createView();
|
|
@@ -3136,10 +3131,10 @@ class SlateString extends ViewContainerItem {
|
|
|
3136
3131
|
memoizedContext(prev, next) {
|
|
3137
3132
|
return false;
|
|
3138
3133
|
}
|
|
3139
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3140
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
3134
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateString, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3135
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: SlateString, isStandalone: true, selector: "span[slateString]", inputs: { context: "context" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3141
3136
|
}
|
|
3142
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3137
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateString, decorators: [{
|
|
3143
3138
|
type: Component,
|
|
3144
3139
|
args: [{
|
|
3145
3140
|
selector: 'span[slateString]',
|
|
@@ -3147,7 +3142,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
3147
3142
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3148
3143
|
standalone: true
|
|
3149
3144
|
}]
|
|
3150
|
-
}],
|
|
3145
|
+
}], propDecorators: { context: [{
|
|
3151
3146
|
type: Input
|
|
3152
3147
|
}] } });
|
|
3153
3148
|
/**
|
|
@@ -3172,10 +3167,10 @@ class SlateDefaultLeaf extends BaseLeafComponent {
|
|
|
3172
3167
|
// Because the placeholder span is not in the current component, it is destroyed along with the current component
|
|
3173
3168
|
this.destroyPlaceholder();
|
|
3174
3169
|
}
|
|
3175
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
3176
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
3170
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultLeaf, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
3171
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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
3172
|
}
|
|
3178
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
3173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateDefaultLeaf, decorators: [{
|
|
3179
3174
|
type: Component,
|
|
3180
3175
|
args: [{
|
|
3181
3176
|
selector: 'span[slateDefaultLeaf]',
|
|
@@ -4218,8 +4213,8 @@ class SlateEditable {
|
|
|
4218
4213
|
this.destroy$.complete();
|
|
4219
4214
|
EDITOR_TO_ON_CHANGE.delete(this.editor);
|
|
4220
4215
|
}
|
|
4221
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4222
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "
|
|
4216
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", 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 }); }
|
|
4217
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", 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
4218
|
{
|
|
4224
4219
|
provide: NG_VALUE_ACCESSOR,
|
|
4225
4220
|
useExisting: forwardRef(() => SlateEditable),
|
|
@@ -4243,7 +4238,7 @@ class SlateEditable {
|
|
|
4243
4238
|
}
|
|
4244
4239
|
], 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
4240
|
}
|
|
4246
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4241
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateEditable, decorators: [{
|
|
4247
4242
|
type: Component,
|
|
4248
4243
|
args: [{ selector: 'slate-editable', host: {
|
|
4249
4244
|
class: 'slate-editable-container',
|
|
@@ -4431,10 +4426,10 @@ const preventInsertFromComposition = (event, editor) => {
|
|
|
4431
4426
|
};
|
|
4432
4427
|
|
|
4433
4428
|
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: "
|
|
4429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateElement, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
4430
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: SlateElement, isStandalone: true, selector: "[slateElement]", usesInheritance: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4436
4431
|
}
|
|
4437
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateElement, decorators: [{
|
|
4438
4433
|
type: Component,
|
|
4439
4434
|
args: [{
|
|
4440
4435
|
selector: '[slateElement]',
|
|
@@ -4446,8 +4441,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.4", ngImpor
|
|
|
4446
4441
|
}] });
|
|
4447
4442
|
|
|
4448
4443
|
class SlateModule {
|
|
4449
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
4450
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
4444
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
4445
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: SlateModule, imports: [CommonModule,
|
|
4451
4446
|
SlateEditable,
|
|
4452
4447
|
SlateDefaultElement,
|
|
4453
4448
|
SlateElement,
|
|
@@ -4461,14 +4456,14 @@ class SlateModule {
|
|
|
4461
4456
|
SlateDefaultLeaf,
|
|
4462
4457
|
SlateDefaultString,
|
|
4463
4458
|
SlateChildrenOutlet], exports: [SlateEditable, SlateChildren, SlateChildrenOutlet, SlateElement, SlateLeaves, SlateString, SlateDefaultString] }); }
|
|
4464
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
4459
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateModule, providers: [
|
|
4465
4460
|
{
|
|
4466
4461
|
provide: SLATE_DEFAULT_ELEMENT_COMPONENT_TOKEN,
|
|
4467
4462
|
useValue: SlateDefaultElement
|
|
4468
4463
|
}
|
|
4469
4464
|
], imports: [CommonModule] }); }
|
|
4470
4465
|
}
|
|
4471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
4466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: SlateModule, decorators: [{
|
|
4472
4467
|
type: NgModule,
|
|
4473
4468
|
args: [{
|
|
4474
4469
|
imports: [
|