mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 18:41:14 +00:00
feat(editor): Add sections to autocomplete dropdown (#8720)
Co-authored-by: Giulio Andreini <andreini@netseven.it>
This commit is contained in:
@@ -63,28 +63,32 @@ const coloringStateField = StateField.define<DecorationSet>({
|
||||
return Decoration.none;
|
||||
},
|
||||
update(colorings, transaction) {
|
||||
colorings = colorings.map(transaction.changes); // recalculate positions for new doc
|
||||
try {
|
||||
colorings = colorings.map(transaction.changes); // recalculate positions for new doc
|
||||
|
||||
for (const txEffect of transaction.effects) {
|
||||
if (txEffect.is(coloringStateEffects.removeColorEffect)) {
|
||||
colorings = colorings.update({
|
||||
filter: (from, to) => txEffect.value.from !== from && txEffect.value.to !== to,
|
||||
});
|
||||
}
|
||||
|
||||
if (txEffect.is(coloringStateEffects.addColorEffect)) {
|
||||
colorings = colorings.update({
|
||||
filter: (from, to) => txEffect.value.from !== from && txEffect.value.to !== to,
|
||||
});
|
||||
|
||||
const decoration = resolvableStateToDecoration[txEffect.value.state ?? 'pending'];
|
||||
|
||||
if (txEffect.value.from === 0 && txEffect.value.to === 0) continue;
|
||||
|
||||
colorings = colorings.update({
|
||||
add: [decoration.range(txEffect.value.from, txEffect.value.to)],
|
||||
});
|
||||
for (const txEffect of transaction.effects) {
|
||||
if (txEffect.is(coloringStateEffects.removeColorEffect)) {
|
||||
colorings = colorings.update({
|
||||
filter: (from, to) => txEffect.value.from !== from && txEffect.value.to !== to,
|
||||
});
|
||||
}
|
||||
|
||||
if (txEffect.is(coloringStateEffects.addColorEffect)) {
|
||||
colorings = colorings.update({
|
||||
filter: (from, to) => txEffect.value.from !== from && txEffect.value.to !== to,
|
||||
});
|
||||
|
||||
const decoration = resolvableStateToDecoration[txEffect.value.state ?? 'pending'];
|
||||
|
||||
if (txEffect.value.from === 0 && txEffect.value.to === 0) continue;
|
||||
|
||||
colorings = colorings.update({
|
||||
add: [decoration.range(txEffect.value.from, txEffect.value.to)],
|
||||
});
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
window?.Sentry?.captureException(error);
|
||||
}
|
||||
|
||||
return colorings;
|
||||
|
||||
Reference in New Issue
Block a user