mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-03 14:26:50 +00:00
* feat: formula language * feat: formula coloring and ux improvements * fix: suggestions generation * fix: handle undefined editor * fix: handle formula errors * fix: update imports * fix: minor corrections * fix: test corrections * fix: increase timeout * fix: clear existing formulas before pasting * fix: ux improve * fix: ux improve * fix: coloring issue * fix: remove styles * fix: handle wrapping * fix: bug fixes * fix: strict suggestion handling * fix: update indent strategy * fix: handle formula in nested state and unbalanced parens * fix: formula fix * chore: sync dependencies
24 lines
786 B
TypeScript
24 lines
786 B
TypeScript
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker&inline'
|
|
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker&inline'
|
|
|
|
export default defineNuxtPlugin(() => {
|
|
/**
|
|
* Adding monaco editor to Vite
|
|
*
|
|
* @ts-expect-error */
|
|
self.MonacoEnvironment = window.MonacoEnvironment = {
|
|
async getWorker(_: any, label: string) {
|
|
switch (label) {
|
|
case 'json': {
|
|
const workerBlob = new Blob([JsonWorker], { type: 'text/javascript' })
|
|
return await initWorker(URL.createObjectURL(workerBlob))
|
|
}
|
|
default: {
|
|
const workerBlob = new Blob([EditorWorker], { type: 'text/javascript' })
|
|
return await initWorker(URL.createObjectURL(workerBlob))
|
|
}
|
|
}
|
|
},
|
|
}
|
|
})
|