/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
apps/dashboard/src/components/primitives/variable-plugin/index.ts
49 строк
1 KB
cursor[bot]
chore(root): remove 1 unused file and 4 unused exports (#10798)
23 апр 2026, 13:50
Не верифицирован
23 апр 2026, 13:50
777bbcc
Код
Авторство
О чём код?
import { Decoration, EditorView, ViewPlugin } from '@uiw/react-codemirror'; import { VariablePluginView } from './plugin-view'; import type { PluginState } from './types'; export function createVariableExtension({ viewRef, lastCompletionRef, onSelect, isAllowedVariable, isDigestEventsVariable, getVariableErrorMessage, }: PluginState) { return ViewPlugin.fromClass( class { private view: VariablePluginView; constructor(view: EditorView) { this.view = new VariablePluginView( view, viewRef, lastCompletionRef, isAllowedVariable, onSelect, isDigestEventsVariable, getVariableErrorMessage ); } update(update: any) { this.view.update(update); } get decorations() { return this.view.decorations; } }, { decorations: (v) => v.decorations, provide: (plugin) => EditorView.atomicRanges.of((view) => { return view.plugin(plugin)?.decorations || Decoration.none; }), } ); } export const VARIABLE_PILL_CLASS = 'cm-variable-pill'; export * from './types';