From d7fc5091de49896bceed930de435e35fd770abfd Mon Sep 17 00:00:00 2001 From: Bello Babakolo Date: Tue, 17 Sep 2024 01:21:23 +0100 Subject: [PATCH] feat: add theme and mode to json-editor --- .../organisms/json-editor/json-editor.component.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/packages/modules/ui/src/lib/components/organisms/json-editor/json-editor.component.ts b/packages/modules/ui/src/lib/components/organisms/json-editor/json-editor.component.ts index e2a10e1..1f21fb4 100644 --- a/packages/modules/ui/src/lib/components/organisms/json-editor/json-editor.component.ts +++ b/packages/modules/ui/src/lib/components/organisms/json-editor/json-editor.component.ts @@ -7,6 +7,8 @@ import { OnDestroy, } from '@angular/core'; import ace from 'ace-builds'; +import 'ace-builds/src-noconflict/mode-json'; +import 'ace-builds/src-noconflict/theme-monokai'; @Component({ selector: 'rc-json-editor', @@ -30,7 +32,6 @@ export class JSONEditorComponent implements AfterViewInit, OnDestroy { value: this.value, }); - // Seems we have to import it manually in both cases... this.editor.setTheme('ace/theme/monokai'); this.editor.session.setMode('ace/mode/json'); } @@ -39,11 +40,4 @@ export class JSONEditorComponent implements AfterViewInit, OnDestroy { this.editor.destroy(); this.editor.container.remove(); } - - // editor.session.on('change', function (delta) { - // /* - // delta { start: number, end: number, line: array of changes, action: string } - // */ - // console.log(editor.getValue()); - // }); }