Renamed code widget; moved modal to common folder
This commit is contained in:
parent
de2bb27b6d
commit
96eaa64b2a
@ -3,7 +3,7 @@ import { Component } from '@angular/core';
|
||||
import { InfoBarComponent } from './editor/info-bar/info-bar.component';
|
||||
import { TabsComponent } from './editor/tabs/tabs.component';
|
||||
import { EditorsComponent } from './editor/editors.component';
|
||||
import { FilesModalComponent } from "./editor/modals/files-modal.component";
|
||||
import { FilesModalComponent } from "./common/components/modals/files-modal.component";
|
||||
|
||||
|
||||
|
||||
|
@ -5,10 +5,10 @@ import { Subject, takeUntil } from 'rxjs';
|
||||
|
||||
import * as bootstrap from "bootstrap";
|
||||
|
||||
import { FilesModalService } from "../../common/services/editor/modals/files-modal.service";
|
||||
import { TabsService } from '../../common/services/editor/tabs/tabs.service';
|
||||
import { FilesModalService } from "../../services/editor/modals/files-modal.service";
|
||||
import { TabsService } from '../../services/editor/tabs/tabs.service';
|
||||
|
||||
import { ServiceMessage } from '../../common/types/service-message.type';
|
||||
import { ServiceMessage } from '../../types/service-message.type';
|
||||
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ReplaySubject, Observable } from 'rxjs';
|
||||
|
||||
import { NewtonEditorComponent } from "../../../editor/newton-editor/newton-editor.component";
|
||||
import { CodeViewComponent } from "../../../editor/code-view/view.component";
|
||||
|
||||
import { ServiceMessage } from '../../types/service-message.type';
|
||||
import { EditorSettings } from "../../configs/editor.config";
|
||||
@ -16,7 +16,7 @@ import { NewtonFile } from '../../types/file.type';
|
||||
export class EditorsService {
|
||||
private messageSubject: ReplaySubject<ServiceMessage> = new ReplaySubject<ServiceMessage>(1);
|
||||
|
||||
editors: Map<string, NewtonEditorComponent>;
|
||||
editors: Map<string, CodeViewComponent>;
|
||||
editorSettings: typeof EditorSettings;
|
||||
|
||||
activeEditor!: string;
|
||||
@ -24,19 +24,19 @@ export class EditorsService {
|
||||
|
||||
constructor() {
|
||||
this.editorSettings = EditorSettings;
|
||||
this.editors = new Map<string, NewtonEditorComponent>();
|
||||
this.editors = new Map<string, CodeViewComponent>();
|
||||
}
|
||||
|
||||
|
||||
public getEditorsAsArray(): NewtonEditorComponent[] {
|
||||
public getEditorsAsArray(): CodeViewComponent[] {
|
||||
return [...this.editors.values()];
|
||||
}
|
||||
|
||||
public get(uuid: string): NewtonEditorComponent {
|
||||
public get(uuid: string): CodeViewComponent {
|
||||
return this.editors.get(uuid);
|
||||
}
|
||||
|
||||
public set(uuid: string, component: NewtonEditorComponent) {
|
||||
public set(uuid: string, component: CodeViewComponent) {
|
||||
this.editors.set(uuid, component);
|
||||
|
||||
if (Object.keys(this.editors).length < 1) return;
|
||||
|
@ -15,7 +15,7 @@ import { ServiceMessage } from '../../common/types/service-message.type';
|
||||
|
||||
|
||||
@Directive()
|
||||
export class NewtonEditorBase {
|
||||
export class CodeViewBase {
|
||||
public uuid: string = uuid.v4();
|
||||
@Input() public isDefault: boolean = false;
|
||||
public leftSiblingUUID!: string;
|
@ -11,7 +11,7 @@ import "ace-builds/src-noconflict/ext-language_tools";
|
||||
//import "ace-builds/src-noconflict/theme-penguins_in_space";
|
||||
import "ace-builds/src-noconflict/theme-gruvbox";
|
||||
|
||||
import { NewtonEditorBase } from './newton-editor.base';
|
||||
import { CodeViewBase } from './view.base';
|
||||
|
||||
import { NewtonFile } from '../../common/types/file.type';
|
||||
import { ServiceMessage } from '../../common/types/service-message.type';
|
||||
@ -19,17 +19,17 @@ import { ServiceMessage } from '../../common/types/service-message.type';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'newton-editor',
|
||||
selector: 'code-view',
|
||||
standalone: true,
|
||||
imports: [
|
||||
],
|
||||
templateUrl: './newton-editor.component.html',
|
||||
styleUrl: './newton-editor.component.css',
|
||||
templateUrl: './view.component.html',
|
||||
styleUrl: './view.component.css',
|
||||
host: {
|
||||
'class': 'col'
|
||||
}
|
||||
})
|
||||
export class NewtonEditorComponent extends NewtonEditorBase {
|
||||
export class CodeViewComponent extends CodeViewBase {
|
||||
|
||||
|
||||
constructor() {
|
@ -1,9 +1,9 @@
|
||||
<div class="col">
|
||||
|
||||
<div class="row dropzone" #dropzone dropzone (fileDropped)="onFileDropped($event)">
|
||||
<newton-editor [isDefault]="true"></newton-editor>
|
||||
<code-view [isDefault]="true"></code-view>
|
||||
<hr class="col vr-pane-handle" pane-handle />
|
||||
<newton-editor></newton-editor>
|
||||
<code-view></code-view>
|
||||
</div>
|
||||
|
||||
<div>
|
@ -5,7 +5,7 @@ import { EditorsService } from '../common/services/editor/editors.service';
|
||||
import { TabsService } from '../common/services/editor/tabs/tabs.service';
|
||||
import { FilesService } from '../common/services/editor/files.service';
|
||||
|
||||
import { NewtonEditorComponent } from "./newton-editor/newton-editor.component";
|
||||
import { CodeViewComponent } from "./code-view/view.component";
|
||||
|
||||
import { DndDirective } from '../common/directives/dnd.directive';
|
||||
import { PaneHandleDirective } from '../common/directives/pane-handle.directive';
|
||||
@ -20,7 +20,7 @@ import { ServiceMessage } from '../common/types/service-message.type';
|
||||
imports: [
|
||||
DndDirective,
|
||||
PaneHandleDirective,
|
||||
NewtonEditorComponent
|
||||
CodeViewComponent
|
||||
],
|
||||
templateUrl: './editors.component.html',
|
||||
styleUrl: './editors.component.css',
|
||||
|
Loading…
Reference in New Issue
Block a user