Skip to content

Commit

Permalink
refactor: update code-editor to 0.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nzbin committed May 27, 2024
1 parent 2c2fd41 commit 1ad5c60
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
},
"private": true,
"dependencies": {
"@acrodata/code-editor": "^0.1.0",
"@acrodata/code-editor": "^0.2.0",
"@angular/animations": "^17.3.6",
"@angular/cdk": "^17.3.6",
"@angular/common": "^17.3.6",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section>
<code-editor dir="ltr"
<code-editor [style.height.%]="100"
[theme]="theme"
[extensions]="extensions"
[(ngModel)]="configStr"
Expand Down
3 changes: 1 addition & 2 deletions projects/dev-app/src/app/playground/playground.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { FormGroup, FormsModule } from '@angular/forms';
import { json, jsonParseLinter } from '@codemirror/lang-json';
import { lintGutter, linter } from '@codemirror/lint';
import { basicSetup } from 'codemirror';
import { SettingsService } from '../settings.service';

@Component({
Expand Down Expand Up @@ -57,7 +56,7 @@ export class PlaygroundComponent implements OnInit {

theme: Theme = 'light';

extensions = [basicSetup, json(), linter(jsonParseLinter()), lintGutter()];
extensions = [json(), linter(jsonParseLinter()), lintGutter()];

constructor(
private destroyRef: DestroyRef,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<mtx-split [direction]="isMobile?'vertical':'horizontal'">
<mtx-split-pane [size]="60">
<code-editor [extensions]="extensions" [(ngModel)]="configStr" (blur)="onConfigChange()" />
<code-editor [style.height.%]="100"
[extensions]="extensions" [(ngModel)]="configStr" (blur)="onConfigChange()" />
</mtx-split-pane>
<mtx-split-pane class="preview" [size]="40">
<mtx-split [direction]="isMobile?'horizontal':'vertical'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { FormsModule } from '@angular/forms';
import { json, jsonParseLinter } from '@codemirror/lang-json';
import { lintGutter, linter } from '@codemirror/lint';
import { MtxSplitModule } from '@ng-matero/extensions/split';
import { basicSetup } from 'codemirror';

@Component({
selector: 'app-playground',
Expand Down Expand Up @@ -67,7 +66,7 @@ export class PlaygroundComponent implements OnInit {

private readonly destroy = inject(DestroyRef);

extensions = [basicSetup, json(), linter(jsonParseLinter()), lintGutter()];
extensions = [json(), linter(jsonParseLinter()), lintGutter()];

constructor(
private breakpointObserver: BreakpointObserver,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
resolved "https://registry.yarnpkg.com/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz#bd9154aec9983f77b3a034ecaa015c2e4201f6cf"
integrity sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==

"@acrodata/code-editor@^0.1.0":
version "0.1.0"
resolved "https://registry.yarnpkg.com/@acrodata/code-editor/-/code-editor-0.1.0.tgz#769b439906f390b12940f1b3548d6de6ea5b2681"
integrity sha512-T+mvZZhEtvehVZl+1ONFdGRCxbMvDhXFnfozdv84ExfYBygOxE5d3HcY6b7bSSb1077My0d9XmPqP/obXS9sIw==
"@acrodata/code-editor@^0.2.0":
version "0.2.0"
resolved "https://registry.yarnpkg.com/@acrodata/code-editor/-/code-editor-0.2.0.tgz#85d5ee949787d5057fb64567438fdfa77d79eb57"
integrity sha512-kbOc1AG7Nmf6gADuX4FSORriSME3jmZbmL7vuXFTRuN1ZX1NrzhHa2oAYU+4UWi/zFsRnB9esR2+7m3Nmgu2Kg==
dependencies:
"@codemirror/theme-one-dark" "^6.0.0"
codemirror "^6.0.0"
Expand Down

0 comments on commit 1ad5c60

Please sign in to comment.