slate-angular 21.0.0-next.2 → 21.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1128,7 +1128,8 @@ const buildHeightsAndAccumulatedHeights = (editor, visibleStates) => {
|
|
|
1128
1128
|
accumulatedHeights[0] = 0;
|
|
1129
1129
|
for (let i = 0; i < children.length; i++) {
|
|
1130
1130
|
const isVisible = visibleStates[i];
|
|
1131
|
-
|
|
1131
|
+
const isFloating = editor.isFloating(children[i]);
|
|
1132
|
+
let height = isVisible && !isFloating ? getCachedHeightByElement(editor, children[i]) : 0;
|
|
1132
1133
|
if (height === null) {
|
|
1133
1134
|
try {
|
|
1134
1135
|
height = editor.getRoughHeight(children[i]);
|
|
@@ -1873,6 +1874,7 @@ const withAngular = (editor, clipboardFormatKey = 'x-slate-fragment') => {
|
|
|
1873
1874
|
e.getRoughHeight = (element, defaultHeight) => {
|
|
1874
1875
|
return defaultHeight === undefined ? VIRTUAL_SCROLL_DEFAULT_BLOCK_HEIGHT : defaultHeight;
|
|
1875
1876
|
};
|
|
1877
|
+
e.isFloating = element => false;
|
|
1876
1878
|
return e;
|
|
1877
1879
|
};
|
|
1878
1880
|
|
|
@@ -3212,6 +3214,13 @@ class ListRender {
|
|
|
3212
3214
|
rootNodes.forEach(rootNode => {
|
|
3213
3215
|
rootNode.setAttribute('debug-index', index.toString());
|
|
3214
3216
|
rootNode.setAttribute('debug-height', height?.toString());
|
|
3217
|
+
const isFloating = this.viewContext.editor.isFloating(children[i]);
|
|
3218
|
+
if (isFloating) {
|
|
3219
|
+
rootNode.setAttribute('debug-floating', 'true');
|
|
3220
|
+
}
|
|
3221
|
+
else {
|
|
3222
|
+
rootNode.removeAttribute('debug-floating');
|
|
3223
|
+
}
|
|
3215
3224
|
});
|
|
3216
3225
|
}
|
|
3217
3226
|
}
|
|
@@ -3837,6 +3846,18 @@ class SlateEditable {
|
|
|
3837
3846
|
inViewportChildren.push(...children);
|
|
3838
3847
|
inViewportIndics.push(...Array.from({ length: elementLength }, (_, i) => i));
|
|
3839
3848
|
}
|
|
3849
|
+
else {
|
|
3850
|
+
const lastIndex = inViewportIndics[inViewportIndics.length - 1];
|
|
3851
|
+
for (let i = lastIndex + 1; i < elementLength; i++) {
|
|
3852
|
+
if (this.editor.isFloating(children[i])) {
|
|
3853
|
+
inViewportChildren.push(children[i]);
|
|
3854
|
+
inViewportIndics.push(i);
|
|
3855
|
+
}
|
|
3856
|
+
else {
|
|
3857
|
+
break;
|
|
3858
|
+
}
|
|
3859
|
+
}
|
|
3860
|
+
}
|
|
3840
3861
|
const inViewportStartIndex = inViewportIndics[0];
|
|
3841
3862
|
const inViewportEndIndex = inViewportIndics[inViewportIndics.length - 1];
|
|
3842
3863
|
const top = accumulatedHeights[inViewportStartIndex];
|
|
@@ -5002,6 +5023,7 @@ class SlateEditable {
|
|
|
5002
5023
|
manualListener();
|
|
5003
5024
|
});
|
|
5004
5025
|
this.destroy$.complete();
|
|
5026
|
+
this.indicsOfNeedRemeasured$.complete();
|
|
5005
5027
|
EDITOR_TO_ON_CHANGE.delete(this.editor);
|
|
5006
5028
|
}
|
|
5007
5029
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: SlateEditable, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|