slate-angular 20.1.0 → 20.2.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/fesm2022/slate-angular.mjs +189 -16
- package/fesm2022/slate-angular.mjs.map +1 -1
- package/index.d.ts +31 -3
- package/package.json +1 -1
- package/styles/index.scss +14 -1
|
@@ -470,6 +470,8 @@ const HAS_BEFORE_INPUT_SUPPORT = !IS_CHROME_LEGACY &&
|
|
|
470
470
|
globalThis.InputEvent &&
|
|
471
471
|
// @ts-ignore The `getTargetRanges` property isn't recognized.
|
|
472
472
|
typeof globalThis.InputEvent.prototype.getTargetRanges === 'function';
|
|
473
|
+
const VIRTUAL_SCROLL_DEFAULT_BUFFER_COUNT = 3;
|
|
474
|
+
const VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT = 40;
|
|
473
475
|
|
|
474
476
|
/**
|
|
475
477
|
* Hotkey mappings for each platform.
|
|
@@ -1683,6 +1685,7 @@ class BaseFlavour {
|
|
|
1683
1685
|
}
|
|
1684
1686
|
}
|
|
1685
1687
|
|
|
1688
|
+
const DEFAULT_ELEMENT_HEIGHT = 24;
|
|
1686
1689
|
class BaseElementFlavour extends BaseFlavour {
|
|
1687
1690
|
constructor() {
|
|
1688
1691
|
super(...arguments);
|
|
@@ -1777,6 +1780,9 @@ class BaseElementFlavour extends BaseFlavour {
|
|
|
1777
1780
|
readonly: this._context.readonly
|
|
1778
1781
|
};
|
|
1779
1782
|
}
|
|
1783
|
+
getRealHeight() {
|
|
1784
|
+
return Promise.resolve(this.nativeElement.offsetHeight);
|
|
1785
|
+
}
|
|
1780
1786
|
}
|
|
1781
1787
|
|
|
1782
1788
|
class DefaultElementFlavour extends BaseElementFlavour {
|
|
@@ -2262,11 +2268,13 @@ class ListRender {
|
|
|
2262
2268
|
initialize(children, parent, childrenContext) {
|
|
2263
2269
|
this.initialized = true;
|
|
2264
2270
|
this.children = children;
|
|
2271
|
+
const isRoot = parent === this.viewContext.editor;
|
|
2272
|
+
const firstIndex = isRoot ? this.viewContext.editor.children.indexOf(children[0]) : 0;
|
|
2265
2273
|
const parentPath = AngularEditor.findPath(this.viewContext.editor, parent);
|
|
2266
|
-
children.forEach((descendant,
|
|
2267
|
-
NODE_TO_INDEX.set(descendant,
|
|
2274
|
+
children.forEach((descendant, _index) => {
|
|
2275
|
+
NODE_TO_INDEX.set(descendant, firstIndex + _index);
|
|
2268
2276
|
NODE_TO_PARENT.set(descendant, parent);
|
|
2269
|
-
const context = getContext(
|
|
2277
|
+
const context = getContext(firstIndex + _index, descendant, parentPath, childrenContext, this.viewContext);
|
|
2270
2278
|
const viewType = getViewType(descendant, parent, this.viewContext);
|
|
2271
2279
|
const view = createEmbeddedViewOrComponentOrFlavour(viewType, context, this.viewContext, this.viewContainerRef);
|
|
2272
2280
|
const blockCard = createBlockCard(descendant, view, this.viewContext);
|
|
@@ -2294,6 +2302,8 @@ class ListRender {
|
|
|
2294
2302
|
const outletParent = this.getOutletParent();
|
|
2295
2303
|
const diffResult = this.differ.diff(children);
|
|
2296
2304
|
const parentPath = AngularEditor.findPath(this.viewContext.editor, parent);
|
|
2305
|
+
const isRoot = parent === this.viewContext.editor;
|
|
2306
|
+
const firstIndex = isRoot ? this.viewContext.editor.children.indexOf(children[0]) : 0;
|
|
2297
2307
|
if (diffResult) {
|
|
2298
2308
|
let firstRootNode = getRootNodes(this.views[0], this.blockCards[0])[0];
|
|
2299
2309
|
const newContexts = [];
|
|
@@ -2301,9 +2311,10 @@ class ListRender {
|
|
|
2301
2311
|
const newViews = [];
|
|
2302
2312
|
const newBlockCards = [];
|
|
2303
2313
|
diffResult.forEachItem(record => {
|
|
2304
|
-
|
|
2314
|
+
const currentIndex = firstIndex + record.currentIndex;
|
|
2315
|
+
NODE_TO_INDEX.set(record.item, currentIndex);
|
|
2305
2316
|
NODE_TO_PARENT.set(record.item, parent);
|
|
2306
|
-
let context = getContext(
|
|
2317
|
+
let context = getContext(currentIndex, record.item, parentPath, childrenContext, this.viewContext);
|
|
2307
2318
|
const viewType = getViewType(record.item, parent, this.viewContext);
|
|
2308
2319
|
newViewTypes.push(viewType);
|
|
2309
2320
|
let view;
|
|
@@ -2371,16 +2382,16 @@ class ListRender {
|
|
|
2371
2382
|
}
|
|
2372
2383
|
else {
|
|
2373
2384
|
const newContexts = [];
|
|
2374
|
-
this.children.forEach((child,
|
|
2375
|
-
NODE_TO_INDEX.set(child,
|
|
2385
|
+
this.children.forEach((child, _index) => {
|
|
2386
|
+
NODE_TO_INDEX.set(child, firstIndex + _index);
|
|
2376
2387
|
NODE_TO_PARENT.set(child, parent);
|
|
2377
|
-
let context = getContext(
|
|
2378
|
-
const previousContext = this.contexts[
|
|
2388
|
+
let context = getContext(firstIndex + _index, child, parentPath, childrenContext, this.viewContext);
|
|
2389
|
+
const previousContext = this.contexts[_index];
|
|
2379
2390
|
if (memoizedContext(this.viewContext, child, previousContext, context)) {
|
|
2380
2391
|
context = previousContext;
|
|
2381
2392
|
}
|
|
2382
2393
|
else {
|
|
2383
|
-
updateContext(this.views[
|
|
2394
|
+
updateContext(this.views[_index], context, this.viewContext);
|
|
2384
2395
|
}
|
|
2385
2396
|
newContexts.push(context);
|
|
2386
2397
|
});
|
|
@@ -2541,6 +2552,17 @@ function executeAfterViewInit(editor) {
|
|
|
2541
2552
|
// not correctly clipboardData on beforeinput
|
|
2542
2553
|
const forceOnDOMPaste = IS_SAFARI;
|
|
2543
2554
|
class SlateEditable {
|
|
2555
|
+
set virtualScroll(config) {
|
|
2556
|
+
this.virtualConfig = config;
|
|
2557
|
+
this.refreshVirtualViewAnimId && cancelAnimationFrame(this.refreshVirtualViewAnimId);
|
|
2558
|
+
this.refreshVirtualViewAnimId = requestAnimationFrame(() => {
|
|
2559
|
+
this.refreshVirtualView();
|
|
2560
|
+
if (this.listRender.initialized) {
|
|
2561
|
+
this.listRender.update(this.renderedChildren, this.editor, this.context);
|
|
2562
|
+
}
|
|
2563
|
+
this.scheduleMeasureVisibleHeights();
|
|
2564
|
+
});
|
|
2565
|
+
}
|
|
2544
2566
|
get hasBeforeInputSupport() {
|
|
2545
2567
|
return HAS_BEFORE_INPUT_SUPPORT;
|
|
2546
2568
|
}
|
|
@@ -2563,6 +2585,8 @@ class SlateEditable {
|
|
|
2563
2585
|
this.isStrictDecorate = true;
|
|
2564
2586
|
this.trackBy = () => null;
|
|
2565
2587
|
this.readonly = false;
|
|
2588
|
+
this.virtualTopPadding = 0;
|
|
2589
|
+
this.virtualBottomPadding = 0;
|
|
2566
2590
|
//#endregion
|
|
2567
2591
|
//#region DOM attr
|
|
2568
2592
|
this.spellCheck = false;
|
|
@@ -2576,6 +2600,15 @@ class SlateEditable {
|
|
|
2576
2600
|
this.getOutletParent = () => {
|
|
2577
2601
|
return this.elementRef.nativeElement;
|
|
2578
2602
|
};
|
|
2603
|
+
this.virtualConfig = {
|
|
2604
|
+
enabled: false,
|
|
2605
|
+
scrollTop: 0,
|
|
2606
|
+
viewportHeight: 0
|
|
2607
|
+
};
|
|
2608
|
+
this.renderedChildren = [];
|
|
2609
|
+
this.virtualVisibleIndexes = new Set();
|
|
2610
|
+
this.measuredHeights = new Map();
|
|
2611
|
+
this.measurePending = false;
|
|
2579
2612
|
}
|
|
2580
2613
|
ngOnInit() {
|
|
2581
2614
|
this.editor.injector = this.injector;
|
|
@@ -2630,12 +2663,15 @@ class SlateEditable {
|
|
|
2630
2663
|
if (value && value.length) {
|
|
2631
2664
|
this.editor.children = value;
|
|
2632
2665
|
this.initializeContext();
|
|
2666
|
+
this.refreshVirtualView();
|
|
2667
|
+
const childrenForRender = this.renderedChildren;
|
|
2633
2668
|
if (!this.listRender.initialized) {
|
|
2634
|
-
this.listRender.initialize(
|
|
2669
|
+
this.listRender.initialize(childrenForRender, this.editor, this.context);
|
|
2635
2670
|
}
|
|
2636
2671
|
else {
|
|
2637
|
-
this.listRender.update(
|
|
2672
|
+
this.listRender.update(childrenForRender, this.editor, this.context);
|
|
2638
2673
|
}
|
|
2674
|
+
this.scheduleMeasureVisibleHeights();
|
|
2639
2675
|
this.cdr.markForCheck();
|
|
2640
2676
|
}
|
|
2641
2677
|
}
|
|
@@ -2756,7 +2792,9 @@ class SlateEditable {
|
|
|
2756
2792
|
ngDoCheck() { }
|
|
2757
2793
|
forceRender() {
|
|
2758
2794
|
this.updateContext();
|
|
2759
|
-
this.
|
|
2795
|
+
this.refreshVirtualView();
|
|
2796
|
+
this.listRender.update(this.renderedChildren, this.editor, this.context);
|
|
2797
|
+
this.scheduleMeasureVisibleHeights();
|
|
2760
2798
|
// repair collaborative editing when Chinese input is interrupted by other users' cursors
|
|
2761
2799
|
// when the DOMElement where the selection is located is removed
|
|
2762
2800
|
// the compositionupdate and compositionend events will no longer be fired
|
|
@@ -2795,7 +2833,9 @@ class SlateEditable {
|
|
|
2795
2833
|
render() {
|
|
2796
2834
|
const changed = this.updateContext();
|
|
2797
2835
|
if (changed) {
|
|
2798
|
-
this.
|
|
2836
|
+
this.refreshVirtualView();
|
|
2837
|
+
this.listRender.update(this.renderedChildren, this.editor, this.context);
|
|
2838
|
+
this.scheduleMeasureVisibleHeights();
|
|
2799
2839
|
}
|
|
2800
2840
|
}
|
|
2801
2841
|
updateContext() {
|
|
@@ -2858,6 +2898,128 @@ class SlateEditable {
|
|
|
2858
2898
|
decorations.push(...placeholderDecorations);
|
|
2859
2899
|
return decorations;
|
|
2860
2900
|
}
|
|
2901
|
+
shouldUseVirtual() {
|
|
2902
|
+
return !!(this.virtualConfig && this.virtualConfig.enabled);
|
|
2903
|
+
}
|
|
2904
|
+
refreshVirtualView() {
|
|
2905
|
+
const children = (this.editor.children || []);
|
|
2906
|
+
if (!children.length || !this.shouldUseVirtual()) {
|
|
2907
|
+
this.renderedChildren = children;
|
|
2908
|
+
this.virtualTopPadding = 0;
|
|
2909
|
+
this.virtualBottomPadding = 0;
|
|
2910
|
+
this.virtualVisibleIndexes.clear();
|
|
2911
|
+
return;
|
|
2912
|
+
}
|
|
2913
|
+
const scrollTop = this.virtualConfig.scrollTop ?? 0;
|
|
2914
|
+
const viewportHeight = this.virtualConfig.viewportHeight ?? 0;
|
|
2915
|
+
if (!viewportHeight) {
|
|
2916
|
+
// 已经启用虚拟滚动,但可视区域高度还未获取到,先置空不渲染
|
|
2917
|
+
this.renderedChildren = [];
|
|
2918
|
+
this.virtualTopPadding = 0;
|
|
2919
|
+
this.virtualBottomPadding = 0;
|
|
2920
|
+
this.virtualVisibleIndexes.clear();
|
|
2921
|
+
return;
|
|
2922
|
+
}
|
|
2923
|
+
const bufferCount = this.virtualConfig.bufferCount ?? VIRTUAL_SCROLL_DEFAULT_BUFFER_COUNT;
|
|
2924
|
+
const heights = children.map((_, idx) => this.getBlockHeight(idx));
|
|
2925
|
+
const accumulatedHeights = this.buildAccumulatedHeight(heights);
|
|
2926
|
+
const total = accumulatedHeights[accumulatedHeights.length - 1] || 0;
|
|
2927
|
+
let visibleStart = 0;
|
|
2928
|
+
// 按真实或估算高度往后累加,找到滚动起点所在块
|
|
2929
|
+
while (visibleStart < heights.length && accumulatedHeights[visibleStart + 1] <= scrollTop) {
|
|
2930
|
+
visibleStart++;
|
|
2931
|
+
}
|
|
2932
|
+
// 向上预留 bufferCount 块
|
|
2933
|
+
const startIndex = Math.max(0, visibleStart - bufferCount);
|
|
2934
|
+
const top = accumulatedHeights[startIndex];
|
|
2935
|
+
const bufferBelowHeight = this.getBufferBelowHeight(viewportHeight, visibleStart, bufferCount);
|
|
2936
|
+
const targetHeight = accumulatedHeights[visibleStart] - top + viewportHeight + bufferBelowHeight;
|
|
2937
|
+
const visible = [];
|
|
2938
|
+
const visibleIndexes = [];
|
|
2939
|
+
let accumulated = 0;
|
|
2940
|
+
let cursor = startIndex;
|
|
2941
|
+
// 循环累计高度超出目标高度(可视高度 + 上下 buffer)
|
|
2942
|
+
while (cursor < children.length && accumulated < targetHeight) {
|
|
2943
|
+
visible.push(children[cursor]);
|
|
2944
|
+
visibleIndexes.push(cursor);
|
|
2945
|
+
accumulated += this.getBlockHeight(cursor);
|
|
2946
|
+
cursor++;
|
|
2947
|
+
}
|
|
2948
|
+
const bottom = Math.max(total - top - accumulated, 0); // 下占位高度
|
|
2949
|
+
this.renderedChildren = visible.length ? visible : children;
|
|
2950
|
+
// padding 占位
|
|
2951
|
+
this.virtualTopPadding = this.renderedChildren === visible ? Math.round(top) : 0;
|
|
2952
|
+
this.virtualBottomPadding = this.renderedChildren === visible ? Math.round(bottom) : 0;
|
|
2953
|
+
this.virtualVisibleIndexes = new Set(visibleIndexes);
|
|
2954
|
+
}
|
|
2955
|
+
getBlockHeight(index) {
|
|
2956
|
+
const node = this.editor.children[index];
|
|
2957
|
+
if (!node) {
|
|
2958
|
+
return VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT;
|
|
2959
|
+
}
|
|
2960
|
+
const key = AngularEditor.findKey(this.editor, node);
|
|
2961
|
+
return this.measuredHeights.get(key.id) ?? VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT;
|
|
2962
|
+
}
|
|
2963
|
+
buildAccumulatedHeight(heights) {
|
|
2964
|
+
const accumulatedHeights = new Array(heights.length + 1).fill(0);
|
|
2965
|
+
for (let i = 0; i < heights.length; i++) {
|
|
2966
|
+
// 存储前 i 个的累计高度
|
|
2967
|
+
accumulatedHeights[i + 1] = accumulatedHeights[i] + heights[i];
|
|
2968
|
+
}
|
|
2969
|
+
return accumulatedHeights;
|
|
2970
|
+
}
|
|
2971
|
+
getBufferBelowHeight(viewportHeight, visibleStart, bufferCount) {
|
|
2972
|
+
let blockHeight = 0;
|
|
2973
|
+
let start = visibleStart;
|
|
2974
|
+
// 循环累计高度超出视图高度代表找到向下缓冲区的起始位置
|
|
2975
|
+
while (blockHeight < viewportHeight) {
|
|
2976
|
+
blockHeight += this.getBlockHeight(start);
|
|
2977
|
+
start++;
|
|
2978
|
+
}
|
|
2979
|
+
let bufferHeight = 0;
|
|
2980
|
+
for (let i = start; i < start + bufferCount; i++) {
|
|
2981
|
+
bufferHeight += this.getBlockHeight(i);
|
|
2982
|
+
}
|
|
2983
|
+
return bufferHeight;
|
|
2984
|
+
}
|
|
2985
|
+
scheduleMeasureVisibleHeights() {
|
|
2986
|
+
if (!this.shouldUseVirtual()) {
|
|
2987
|
+
return;
|
|
2988
|
+
}
|
|
2989
|
+
if (this.measurePending) {
|
|
2990
|
+
return;
|
|
2991
|
+
}
|
|
2992
|
+
this.measurePending = true;
|
|
2993
|
+
this.measureVisibleHeightsAnimId && cancelAnimationFrame(this.measureVisibleHeightsAnimId);
|
|
2994
|
+
this.measureVisibleHeightsAnimId = requestAnimationFrame(() => {
|
|
2995
|
+
this.measureVisibleHeights();
|
|
2996
|
+
this.measurePending = false;
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
measureVisibleHeights() {
|
|
3000
|
+
const children = (this.editor.children || []);
|
|
3001
|
+
this.virtualVisibleIndexes.forEach(index => {
|
|
3002
|
+
const node = children[index];
|
|
3003
|
+
if (!node) {
|
|
3004
|
+
return;
|
|
3005
|
+
}
|
|
3006
|
+
const key = AngularEditor.findKey(this.editor, node);
|
|
3007
|
+
// 跳过已测过的块
|
|
3008
|
+
if (this.measuredHeights.has(key.id)) {
|
|
3009
|
+
return;
|
|
3010
|
+
}
|
|
3011
|
+
const view = ELEMENT_TO_COMPONENT.get(node);
|
|
3012
|
+
if (!view) {
|
|
3013
|
+
return;
|
|
3014
|
+
}
|
|
3015
|
+
view.getRealHeight()?.then(height => {
|
|
3016
|
+
const actualHeight = height +
|
|
3017
|
+
parseFloat(getComputedStyle(view.nativeElement).marginTop) +
|
|
3018
|
+
parseFloat(getComputedStyle(view.nativeElement).marginBottom);
|
|
3019
|
+
this.measuredHeights.set(key.id, actualHeight);
|
|
3020
|
+
});
|
|
3021
|
+
});
|
|
3022
|
+
}
|
|
2861
3023
|
//#region event proxy
|
|
2862
3024
|
addEventListener(eventName, listener, target = this.elementRef.nativeElement) {
|
|
2863
3025
|
this.manualListeners.push(this.renderer2.listen(target, eventName, (event) => {
|
|
@@ -3557,7 +3719,7 @@ class SlateEditable {
|
|
|
3557
3719
|
EDITOR_TO_ON_CHANGE.delete(this.editor);
|
|
3558
3720
|
}
|
|
3559
3721
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: SlateEditable, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3560
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", 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: [
|
|
3722
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.12", 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", virtualScroll: "virtualScroll", 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", "style.--virtual-top-padding.px": "this.virtualTopPadding", "style.--virtual-bottom-padding.px": "this.virtualBottomPadding", "attr.data-slate-editor": "this.dataSlateEditor", "attr.data-slate-node": "this.dataSlateNode", "attr.data-gramm": "this.dataGramm" }, classAttribute: "slate-editable-container" }, providers: [
|
|
3561
3723
|
{
|
|
3562
3724
|
provide: NG_VALUE_ACCESSOR,
|
|
3563
3725
|
useExisting: forwardRef(() => SlateEditable),
|
|
@@ -3610,6 +3772,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
3610
3772
|
type: Input
|
|
3611
3773
|
}], placeholder: [{
|
|
3612
3774
|
type: Input
|
|
3775
|
+
}], virtualScroll: [{
|
|
3776
|
+
type: Input
|
|
3777
|
+
}], virtualTopPadding: [{
|
|
3778
|
+
type: HostBinding,
|
|
3779
|
+
args: ['style.--virtual-top-padding.px']
|
|
3780
|
+
}], virtualBottomPadding: [{
|
|
3781
|
+
type: HostBinding,
|
|
3782
|
+
args: ['style.--virtual-bottom-padding.px']
|
|
3613
3783
|
}], beforeInput: [{
|
|
3614
3784
|
type: Input
|
|
3615
3785
|
}], blur: [{
|
|
@@ -3887,6 +4057,9 @@ class BaseElementComponent extends BaseComponent {
|
|
|
3887
4057
|
readonly: this._context.readonly
|
|
3888
4058
|
};
|
|
3889
4059
|
}
|
|
4060
|
+
getRealHeight() {
|
|
4061
|
+
return Promise.resolve(this.nativeElement.offsetHeight);
|
|
4062
|
+
}
|
|
3890
4063
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: BaseElementComponent, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3891
4064
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: BaseElementComponent, isStandalone: true, viewQueries: [{ propertyName: "childrenOutletInstance", first: true, predicate: SlateChildrenOutlet, descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); }
|
|
3892
4065
|
}
|
|
@@ -4041,5 +4214,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
4041
4214
|
* Generated bundle index. Do not edit.
|
|
4042
4215
|
*/
|
|
4043
4216
|
|
|
4044
|
-
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, ELEMENT_TO_COMPONENT, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, FlavourRef, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_IOS, IS_QQBROWSER, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, VoidTextFlavour, blobAsString, buildHTMLText, check, completeTable, createClipboardData, createText, createThrottleRAF, defaultScrollSelectionIntoView, fallbackCopyText, getBlockCardByNativeElement, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getContentHeight, getDataTransferClipboard, getDataTransferClipboardText, getNavigatorClipboard, getPlainText, getSelection, getSlateFragmentAttribute, getZeroTextNode, hasAfterContextChange, hasBeforeContextChange, hasBlockCard, hasBlockCardWithNode, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMText, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isTemplateRef, isValid, normalize, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
4217
|
+
export { AngularEditor, BaseComponent, BaseElementComponent, BaseElementFlavour, BaseFlavour, BaseLeafComponent, BaseLeafFlavour, BaseTextComponent, BaseTextFlavour, BlockCardRef, DEFAULT_ELEMENT_HEIGHT, DefaultTextFlavour, EDITOR_TO_AFTER_VIEW_INIT_QUEUE, ELEMENT_TO_COMPONENT, FAKE_LEFT_BLOCK_CARD_OFFSET, FAKE_RIGHT_BLOCK_CARD_OFFSET, FlavourRef, HAS_BEFORE_INPUT_SUPPORT, IS_ANDROID, IS_APPLE, IS_CHROME, IS_CHROME_LEGACY, IS_EDGE_LEGACY, IS_FIREFOX, IS_FIREFOX_LEGACY, IS_IOS, IS_QQBROWSER, IS_SAFARI, IS_UC_MOBILE, IS_WECHATBROWSER, PLACEHOLDER_SYMBOL, SLATE_BLOCK_CARD_CLASS_NAME, SlateBlockCard, SlateChildrenOutlet, SlateEditable, SlateErrorCode, SlateFragmentAttributeKey, SlateModule, VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT, VIRTUAL_SCROLL_DEFAULT_BUFFER_COUNT, VoidTextFlavour, blobAsString, buildHTMLText, check, completeTable, createClipboardData, createText, createThrottleRAF, defaultScrollSelectionIntoView, fallbackCopyText, getBlockCardByNativeElement, getCardTargetAttribute, getClipboardData, getClipboardFromHTMLText, getContentHeight, getDataTransferClipboard, getDataTransferClipboardText, getNavigatorClipboard, getPlainText, getSelection, getSlateFragmentAttribute, getZeroTextNode, hasAfterContextChange, hasBeforeContextChange, hasBlockCard, hasBlockCardWithNode, hotkeys, isCardCenterByTargetAttr, isCardLeft, isCardLeftByTargetAttr, isCardRightByTargetAttr, isClipboardFile, isClipboardReadSupported, isClipboardWriteSupported, isClipboardWriteTextSupported, isComponentType, isDOMText, isDecoratorRangeListEqual, isFlavourType, isInvalidTable, isTemplateRef, isValid, normalize, setClipboardData, setDataTransferClipboard, setDataTransferClipboardText, setNavigatorClipboard, shallowCompare, stripHtml, withAngular };
|
|
4045
4218
|
//# sourceMappingURL=slate-angular.mjs.map
|