From 6dc267b65d9c16a5ea1e452066eaf9a4f8ef3ce0 Mon Sep 17 00:00:00 2001 From: Yohann Paris Date: Thu, 29 Feb 2024 10:21:40 -0600 Subject: [PATCH 1/6] First pass --- packages/client/hmi-client/src/ace-config.ts | 53 +++++++++++++++++++ .../ops/model-edit/tera-model-edit.vue | 19 ++++--- 2 files changed, 65 insertions(+), 7 deletions(-) create mode 100644 packages/client/hmi-client/src/ace-config.ts diff --git a/packages/client/hmi-client/src/ace-config.ts b/packages/client/hmi-client/src/ace-config.ts new file mode 100644 index 0000000000..b46cc36c69 --- /dev/null +++ b/packages/client/hmi-client/src/ace-config.ts @@ -0,0 +1,53 @@ +import ace from 'ace-builds'; + +import modeJsonUrl from 'ace-builds/src-noconflict/mode-json?url'; + +import modeJavascriptUrl from 'ace-builds/src-noconflict/mode-javascript?url'; + +import modeHtmlUrl from 'ace-builds/src-noconflict/mode-html?url'; + +import modeYamlUrl from 'ace-builds/src-noconflict/mode-yaml?url'; + +import themeGithubUrl from 'ace-builds/src-noconflict/theme-github?url'; + +import themeChromeUrl from 'ace-builds/src-noconflict/theme-chrome?url'; + +import themeMonokaiUrl from 'ace-builds/src-noconflict/theme-monokai?url'; + +import workerBaseUrl from 'ace-builds/src-noconflict/worker-base?url'; + +import workerJsonUrl from 'ace-builds/src-noconflict/worker-json?url'; + +import workerJavascriptUrl from 'ace-builds/src-noconflict/worker-javascript?url'; + +import workerHtmlUrl from 'ace-builds/src-noconflict/worker-html?url'; + +import workerYamlUrl from 'ace-builds/src-noconflict/worker-yaml?url'; + +import snippetsHtmlUrl from 'ace-builds/src-noconflict/snippets/html?url'; + +import snippetsJsUrl from 'ace-builds/src-noconflict/snippets/javascript?url'; + +import snippetsYamlUrl from 'ace-builds/src-noconflict/snippets/yaml?url'; + +import snippetsJsonUrl from 'ace-builds/src-noconflict/snippets/json?url'; + +import 'ace-builds/src-noconflict/ext-language_tools'; + +ace.config.setModuleUrl('ace/mode/json', modeJsonUrl); +ace.config.setModuleUrl('ace/mode/javascript', modeJavascriptUrl); +ace.config.setModuleUrl('ace/mode/html', modeHtmlUrl); +ace.config.setModuleUrl('ace/mode/yaml', modeYamlUrl); +ace.config.setModuleUrl('ace/theme/github', themeGithubUrl); +ace.config.setModuleUrl('ace/theme/chrome', themeChromeUrl); +ace.config.setModuleUrl('ace/theme/monokai', themeMonokaiUrl); +ace.config.setModuleUrl('ace/mode/base', workerBaseUrl); +ace.config.setModuleUrl('ace/mode/json_worker', workerJsonUrl); +ace.config.setModuleUrl('ace/mode/javascript_worker', workerJavascriptUrl); +ace.config.setModuleUrl('ace/mode/html_worker', workerHtmlUrl); +ace.config.setModuleUrl('ace/mode/yaml_worker', workerYamlUrl); +ace.config.setModuleUrl('ace/snippets/html', snippetsHtmlUrl); +ace.config.setModuleUrl('ace/snippets/javascript', snippetsJsUrl); +ace.config.setModuleUrl('ace/snippets/javascript', snippetsYamlUrl); +ace.config.setModuleUrl('ace/snippets/json', snippetsJsonUrl); +ace.require('ace/ext/language_tools'); diff --git a/packages/client/hmi-client/src/workflow/ops/model-edit/tera-model-edit.vue b/packages/client/hmi-client/src/workflow/ops/model-edit/tera-model-edit.vue index 20fc4d9a97..22827e1baf 100644 --- a/packages/client/hmi-client/src/workflow/ops/model-edit/tera-model-edit.vue +++ b/packages/client/hmi-client/src/workflow/ops/model-edit/tera-model-edit.vue @@ -85,7 +85,7 @@