diff --git a/src/app/components/ndb-ide-theme/ndb-ide-theme.component.ts b/src/app/components/ndb-ide-theme/ndb-ide-theme.component.ts index 174257a..af43efd 100644 --- a/src/app/components/ndb-ide-theme/ndb-ide-theme.component.ts +++ b/src/app/components/ndb-ide-theme/ndb-ide-theme.component.ts @@ -27,7 +27,7 @@ interface ThemeItem { export class NDBIdeThemeComponent { readonly themes: ThemeItem[] = [ - {isSelected: true, value: IDETheme.vanilla, name: 'Vanilla'}, + {isSelected: true, value: IDETheme.legacy, name: 'Legacy'}, {isSelected: false, value: IDETheme.vscode, name: 'VS Code · Modern'}, {isSelected: false, value: IDETheme.intellij, name: 'IntelliJ · Dracula'}, ]; diff --git a/src/app/components/spans/type-span/type-span.component.ts b/src/app/components/spans/type-span/type-span.component.ts index 072e6d8..61d2e33 100644 --- a/src/app/components/spans/type-span/type-span.component.ts +++ b/src/app/components/spans/type-span/type-span.component.ts @@ -25,7 +25,7 @@ export class TypeSpanComponent { isEmpty: boolean = false; protected readonly syntax$: Observable; - protected readonly vanilla: number = CodeSyntax.vanilla + 1; + protected readonly vanilla: number = CodeSyntax.pseudocode + 1; protected readonly redscript: number = CodeSyntax.redscript + 1; protected readonly cpp: number = CodeSyntax.cppRED4ext + 1; diff --git a/src/app/pages/settings/settings.component.ts b/src/app/pages/settings/settings.component.ts index 5672a76..c8ae072 100644 --- a/src/app/pages/settings/settings.component.ts +++ b/src/app/pages/settings/settings.component.ts @@ -31,14 +31,14 @@ interface AItem { export class SettingsComponent implements OnInit { readonly clipboardOptions: AItem[] = [ - {value: CodeSyntax.redscript, name: 'Red · Scripts', disabled: true}, + {value: CodeSyntax.redscript, name: 'Redscript', disabled: true}, {value: CodeSyntax.lua, name: 'Lua · CET', disabled: false}, {value: CodeSyntax.cppRedLib, name: 'C++ · RedLib', disabled: false}, ]; readonly codeOptions: AItem[] = [ - {value: CodeSyntax.vanilla, name: 'Vanilla', disabled: false}, - {value: CodeSyntax.redscript, name: 'Red · Scripts', disabled: false}, + {value: CodeSyntax.pseudocode, name: 'Pseudocode · Legacy', disabled: false}, + {value: CodeSyntax.redscript, name: 'Redscript', disabled: false}, {value: CodeSyntax.cppRED4ext, name: 'C++ · RED4ext / RedLib', disabled: false} ]; @@ -49,7 +49,7 @@ export class SettingsComponent implements OnInit { readonly highlightEmptyObject: FormControl = new FormControl(true); readonly showEmptyAccordion: FormControl = new FormControl(false); readonly mergeObject: FormControl = new FormControl(false); - readonly clipboardSyntax: FormControl = new FormControl(CodeSyntax.redscript); + readonly clipboardSyntax: FormControl = new FormControl(CodeSyntax.lua); readonly codeSyntax: FormControl = new FormControl(CodeSyntax.redscript); constructor(private readonly settingsService: SettingsService, diff --git a/src/app/pipes/ndb-format-code.pipe.ts b/src/app/pipes/ndb-format-code.pipe.ts index 67cd22a..b4cd9d2 100644 --- a/src/app/pipes/ndb-format-code.pipe.ts +++ b/src/app/pipes/ndb-format-code.pipe.ts @@ -12,7 +12,7 @@ export class NDBFormatCodePipe implements PipeTransform { transform(type: RedTypeAst, syntax: CodeSyntax): string { syntax = syntax - 1; switch (syntax) { - case CodeSyntax.vanilla: + case CodeSyntax.pseudocode: if (type.flag === RedTemplateDef.ref) { return 'handle'; } else if (type.flag === RedTemplateDef.wref) { diff --git a/src/shared/services/ide-theme.service.ts b/src/shared/services/ide-theme.service.ts index c0f9458..455ba33 100644 --- a/src/shared/services/ide-theme.service.ts +++ b/src/shared/services/ide-theme.service.ts @@ -5,7 +5,7 @@ import {takeUntilDestroyed} from "@angular/core/rxjs-interop"; import {LazyLoaderService} from "./lazy-loader.service"; export enum IDETheme { - vanilla, + legacy, vscode, intellij } @@ -20,10 +20,10 @@ export interface IDEThemeChanged { }) export class IDEThemeService { private theme: BehaviorSubject = new BehaviorSubject({ - old: IDETheme.vanilla, - current: IDETheme.vanilla, + old: IDETheme.vscode, + current: IDETheme.vscode, }); - private currentTheme: IDETheme = IDETheme.vanilla; + private currentTheme: IDETheme = IDETheme.vscode; private isDarkLoaded: boolean = false; constructor(private readonly themeService: ThemeService, @@ -32,7 +32,7 @@ export class IDEThemeService { let ideTheme: IDETheme; if (!localIdeTheme) { - ideTheme = IDETheme.vanilla; + ideTheme = IDETheme.vscode; } else { ideTheme = +localIdeTheme; } diff --git a/src/shared/services/settings.service.spec.ts b/src/shared/services/settings.service.spec.ts index 4439eaf..ef4ba0a 100644 --- a/src/shared/services/settings.service.spec.ts +++ b/src/shared/services/settings.service.spec.ts @@ -33,11 +33,11 @@ describe('SettingsService', () => { showDocumentation: true, highlightEmptyObject: true, showEmptyAccordion: false, - mergeObject: false, + mergeObject: true, tabsWidth: 320, isBarPinned: true, clipboardSyntax: CodeSyntax.lua, - codeSyntax: CodeSyntax.vanilla + codeSyntax: CodeSyntax.redscript }); }); @@ -51,11 +51,11 @@ describe('SettingsService', () => { 'show-documentation': false, 'highlight-empty-object': true, 'show-empty-accordion': true, - 'merge-object': true, + 'merge-object': false, 'tabs-width': 400, 'is-bar-pinned': false, 'clipboard-syntax': CodeSyntax.lua, - 'code-syntax': CodeSyntax.redscript + 'code-syntax': CodeSyntax.pseudocode }); // WHEN @@ -72,11 +72,11 @@ describe('SettingsService', () => { showDocumentation: false, highlightEmptyObject: true, showEmptyAccordion: true, - mergeObject: true, + mergeObject: false, tabsWidth: 400, isBarPinned: false, clipboardSyntax: CodeSyntax.lua, - codeSyntax: CodeSyntax.redscript + codeSyntax: CodeSyntax.pseudocode }); }); @@ -89,11 +89,11 @@ describe('SettingsService', () => { 'show-documentation': true, 'highlight-empty-object': false, 'show-empty-accordion': false, - 'merge-object': false, + 'merge-object': true, 'tabs-width': 500, 'is-bar-pinned': true, 'clipboard-syntax': CodeSyntax.cppRedLib, - 'code-syntax': CodeSyntax.redscript + 'code-syntax': CodeSyntax.pseudocode }); // WHEN @@ -137,11 +137,11 @@ describe('SettingsService', () => { showDocumentation: true, highlightEmptyObject: false, showEmptyAccordion: false, - mergeObject: false, + mergeObject: true, tabsWidth: 500, isBarPinned: true, clipboardSyntax: CodeSyntax.cppRedLib, - codeSyntax: CodeSyntax.redscript + codeSyntax: CodeSyntax.pseudocode }); }); @@ -153,10 +153,11 @@ describe('SettingsService', () => { {name: 'showDocumentation', key: 'show-documentation', change: false, expect: 'false'}, {name: 'highlightEmptyObject', key: 'highlight-empty-object', change: false, expect: 'false'}, {name: 'showEmptyAccordion', key: 'show-empty-accordion', change: true, expect: 'true'}, + {name: 'mergeObject', key: 'merge-object', change: false, expect: 'false'}, {name: 'tabsWidth', key: 'tabs-width', change: 400, expect: '400'}, {name: 'isBarPinned', key: 'is-bar-pinned', change: false, expect: 'false'}, {name: 'clipboard', key: 'clipboard-syntax', change: CodeSyntax.lua, expect: CodeSyntax.lua.toString()}, - {name: 'code', key: 'code-syntax', change: CodeSyntax.vanilla, expect: CodeSyntax.vanilla.toString()}, + {name: 'code', key: 'code-syntax', change: CodeSyntax.pseudocode, expect: CodeSyntax.pseudocode.toString()}, ]; beforeAll(() => { diff --git a/src/shared/services/settings.service.ts b/src/shared/services/settings.service.ts index aa64837..edcc74c 100644 --- a/src/shared/services/settings.service.ts +++ b/src/shared/services/settings.service.ts @@ -17,7 +17,7 @@ export interface Settings { } export enum CodeSyntax { - vanilla, + pseudocode, redscript, lua, cppRED4ext, @@ -36,11 +36,11 @@ export class SettingsService { private readonly showDocumentationSubject: BehaviorSubject = new BehaviorSubject(true); private readonly highlightEmptyObjectSubject: BehaviorSubject = new BehaviorSubject(true); private readonly showEmptyAccordionSubject: BehaviorSubject = new BehaviorSubject(false); - private readonly mergeObjectSubject: BehaviorSubject = new BehaviorSubject(false); + private readonly mergeObjectSubject: BehaviorSubject = new BehaviorSubject(true); private readonly tabsWidthSubject: BehaviorSubject = new BehaviorSubject(320); private readonly isBarPinnedSubject: BehaviorSubject = new BehaviorSubject(true); private readonly clipboardSubject: BehaviorSubject = new BehaviorSubject(CodeSyntax.lua); - private readonly codeSubject: BehaviorSubject = new BehaviorSubject(CodeSyntax.vanilla); + private readonly codeSubject: BehaviorSubject = new BehaviorSubject(CodeSyntax.redscript); /** * Whether this application is used for the first time on this device? @@ -112,11 +112,11 @@ export class SettingsService { const showDocumentation: boolean = (localStorage.getItem('show-documentation') ?? 'true') === 'true'; const highlightEmptyObject: boolean = (localStorage.getItem('highlight-empty-object') ?? 'true') === 'true'; const showEmptyAccordion: boolean = (localStorage.getItem('show-empty-accordion') ?? 'false') === 'true'; - const mergeObject: boolean = (localStorage.getItem('merge-object') ?? 'false') === 'true'; + const mergeObject: boolean = (localStorage.getItem('merge-object') ?? 'true') === 'true'; const tabsWidth: number = +(localStorage.getItem('tabs-width') ?? '320'); const isBarPinned: boolean = (localStorage.getItem('is-bar-pinned') ?? 'true') === 'true'; const clipboard: string = localStorage.getItem('clipboard-syntax') ?? CodeSyntax.lua.toString(); - const code: string = localStorage.getItem('code-syntax') ?? CodeSyntax.vanilla.toString(); + const code: string = localStorage.getItem('code-syntax') ?? CodeSyntax.redscript.toString(); this.ignoreDuplicateSubject.next(ignoreDuplicate); this.scriptOnlySubject.next(scriptOnly); diff --git a/src/styles/ide/_vanilla.scss b/src/styles/ide/_legacy.scss similarity index 94% rename from src/styles/ide/_vanilla.scss rename to src/styles/ide/_legacy.scss index 3cc0e38..cc10177 100644 --- a/src/styles/ide/_vanilla.scss +++ b/src/styles/ide/_legacy.scss @@ -1,10 +1,10 @@ @use 'sass:color'; -@mixin ide-vanilla-theme($is-light: true) { +@mixin ide-legacy-theme($is-light: true) { @if $is-light { @import url('https://fonts.googleapis.com/css2?family=Fira+Code&display=swap'); - .ide-vanilla-theme { + .ide-legacy-theme { --ndb-ide-typography-family: #{'Fira Code', monospace}; --ndb-ide-typography-size: 1rem; @@ -25,7 +25,7 @@ --ndb-ide-primitive-type: var(--ndb-ide-language); } } @else { - .ide-vanilla-theme { + .ide-legacy-theme { &.dark-theme { --ndb-ide-background: #2B2B2B; --ndb-ide-toolbar: #161B22; diff --git a/src/styles/rd-dark-ide-theme.scss b/src/styles/rd-dark-ide-theme.scss index 47c29b5..582c1c3 100644 --- a/src/styles/rd-dark-ide-theme.scss +++ b/src/styles/rd-dark-ide-theme.scss @@ -1,7 +1,7 @@ -@use './ide/vanilla' as *; +@use './ide/legacy' as *; @use './ide/vscode' as *; @use './ide/intellij' as *; -@include ide-vanilla-theme($is-light: false); +@include ide-legacy-theme($is-light: false); @include ide-vscode-theme($is-light: false); @include ide-intellij-theme($is-light: false); diff --git a/src/styles/rd-light-ide-theme.scss b/src/styles/rd-light-ide-theme.scss index 354c64d..9208e63 100644 --- a/src/styles/rd-light-ide-theme.scss +++ b/src/styles/rd-light-ide-theme.scss @@ -1,5 +1,5 @@ @use './ide/mixins' as *; -@use './ide/vanilla' as *; +@use './ide/legacy' as *; @use './ide/vscode' as *; @use './ide/intellij' as *; @@ -7,6 +7,6 @@ @include rd-ide-background(); @include rd-ide-theme(); -@include ide-vanilla-theme($is-light: true); +@include ide-legacy-theme($is-light: true); @include ide-vscode-theme($is-light: true); @include ide-intellij-theme($is-light: true);