@lvce-editor/editor-worker 19.77.7 → 19.77.8
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/dist/diff-sdk.js +17 -2
- package/dist/editorWorkerMain.js +17 -2
- package/package.json +1 -1
package/dist/diff-sdk.js
CHANGED
|
@@ -19687,8 +19687,23 @@ const getDiagnosticVirtualDom = diagnostic => {
|
|
|
19687
19687
|
}];
|
|
19688
19688
|
};
|
|
19689
19689
|
|
|
19690
|
+
const sortDiagnosticsBySeverity = diagnostics => {
|
|
19691
|
+
return diagnostics.toSorted((left, right) => {
|
|
19692
|
+
if (left.type === right.type) {
|
|
19693
|
+
return 0;
|
|
19694
|
+
}
|
|
19695
|
+
if (left.type === 'warning') {
|
|
19696
|
+
return -1;
|
|
19697
|
+
}
|
|
19698
|
+
if (right.type === 'warning') {
|
|
19699
|
+
return 1;
|
|
19700
|
+
}
|
|
19701
|
+
return 0;
|
|
19702
|
+
});
|
|
19703
|
+
};
|
|
19704
|
+
|
|
19690
19705
|
const getDiagnosticsVirtualDom = diagnostics => {
|
|
19691
|
-
const dom = diagnostics.flatMap(getDiagnosticVirtualDom);
|
|
19706
|
+
const dom = sortDiagnosticsBySeverity(diagnostics).flatMap(getDiagnosticVirtualDom);
|
|
19692
19707
|
return dom;
|
|
19693
19708
|
};
|
|
19694
19709
|
|
|
@@ -19983,7 +19998,7 @@ const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
|
|
|
19983
19998
|
childCount: scrollBarDiagnostics.length,
|
|
19984
19999
|
className: 'ScrollBarDiagnostics',
|
|
19985
20000
|
type: Div
|
|
19986
|
-
}, ...scrollBarDiagnostics.map(({
|
|
20001
|
+
}, ...scrollBarDiagnostics.toSorted((left, right) => left.top - right.top || (left.type === 'warning' && right.type !== 'warning' ? -1 : right.type === 'warning' && left.type !== 'warning' ? 1 : 0)).map(({
|
|
19987
20002
|
height,
|
|
19988
20003
|
top,
|
|
19989
20004
|
type
|
package/dist/editorWorkerMain.js
CHANGED
|
@@ -20103,8 +20103,23 @@ const getDiagnosticVirtualDom = diagnostic => {
|
|
|
20103
20103
|
}];
|
|
20104
20104
|
};
|
|
20105
20105
|
|
|
20106
|
+
const sortDiagnosticsBySeverity = diagnostics => {
|
|
20107
|
+
return diagnostics.toSorted((left, right) => {
|
|
20108
|
+
if (left.type === right.type) {
|
|
20109
|
+
return 0;
|
|
20110
|
+
}
|
|
20111
|
+
if (left.type === 'warning') {
|
|
20112
|
+
return -1;
|
|
20113
|
+
}
|
|
20114
|
+
if (right.type === 'warning') {
|
|
20115
|
+
return 1;
|
|
20116
|
+
}
|
|
20117
|
+
return 0;
|
|
20118
|
+
});
|
|
20119
|
+
};
|
|
20120
|
+
|
|
20106
20121
|
const getDiagnosticsVirtualDom = diagnostics => {
|
|
20107
|
-
const dom = diagnostics.flatMap(getDiagnosticVirtualDom);
|
|
20122
|
+
const dom = sortDiagnosticsBySeverity(diagnostics).flatMap(getDiagnosticVirtualDom);
|
|
20108
20123
|
return dom;
|
|
20109
20124
|
};
|
|
20110
20125
|
|
|
@@ -20399,7 +20414,7 @@ const getEditorScrollBarDiagnosticsVirtualDom = scrollBarDiagnostics => {
|
|
|
20399
20414
|
childCount: scrollBarDiagnostics.length,
|
|
20400
20415
|
className: 'ScrollBarDiagnostics',
|
|
20401
20416
|
type: Div
|
|
20402
|
-
}, ...scrollBarDiagnostics.map(({
|
|
20417
|
+
}, ...scrollBarDiagnostics.toSorted((left, right) => left.top - right.top || (left.type === 'warning' && right.type !== 'warning' ? -1 : right.type === 'warning' && left.type !== 'warning' ? 1 : 0)).map(({
|
|
20403
20418
|
height,
|
|
20404
20419
|
top,
|
|
20405
20420
|
type
|