Skip to content

Commit d445939

Browse files
committed
style: formatting html with prettier
1 parent 610f478 commit d445939

File tree

4 files changed

+79
-58
lines changed

4 files changed

+79
-58
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"editor.rulers": [100],
33
"html.format.wrapLineLength": 100,
4-
"html.format.wrapAttributes": "preserve-aligned",
4+
"[html]": {
5+
"editor.defaultFormatter": "esbenp.prettier-vscode"
6+
},
57
"[javascript]": {
68
"editor.defaultFormatter": "esbenp.prettier-vscode"
79
},
Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
1-
<diff-editor #editor [style.height.px]="200"
2-
[(ngModel)]="value"
3-
(originalValueChange)="log($event)"
4-
(modifiedValueChange)="log($event)"
5-
[orientation]="orientation" [revertControls]="revertControls"
6-
[highlightChanges]="highlightChanges" [gutter]="gutter"
7-
[disabled]="disabled" />
1+
<diff-editor
2+
#editor
3+
[style.height.px]="200"
4+
[(ngModel)]="value"
5+
(originalValueChange)="log($event)"
6+
(modifiedValueChange)="log($event)"
7+
[orientation]="orientation"
8+
[revertControls]="revertControls"
9+
[highlightChanges]="highlightChanges"
10+
[gutter]="gutter"
11+
[disabled]="disabled"
12+
/>
813

9-
<button (click)="doc='123'">change original value</button>
10-
<button (click)="doc2='13\n456'">change modified value</button>
11-
<button (click)="orientation==='a-b'?orientation='b-a':orientation='a-b'">orientation</button>
12-
<button (click)="revertControls==='a-to-b'?revertControls='b-to-a':revertControls='a-to-b'">revertControls</button>
13-
<button (click)="highlightChanges=!highlightChanges">highlightChanges</button>
14-
<button (click)="gutter=!gutter">gutter</button>
15-
<button (click)="disabled=!disabled">disabled</button>
14+
<button (click)="doc = '123'">change original value</button>
15+
<button (click)="doc2 = '13\n456'">change modified value</button>
16+
<button (click)="orientation === 'a-b' ? (orientation = 'b-a') : (orientation = 'a-b')">
17+
orientation
18+
</button>
19+
<button
20+
(click)="revertControls === 'a-to-b' ? (revertControls = 'b-to-a') : (revertControls = 'a-to-b')"
21+
>
22+
revertControls
23+
</button>
24+
<button (click)="highlightChanges = !highlightChanges">highlightChanges</button>
25+
<button (click)="gutter = !gutter">gutter</button>
26+
<button (click)="disabled = !disabled">disabled</button>
1627

1728
<code-editor [value]="doc2" [extensions]="unifiedExts" />

projects/dev-app/src/app/home/home.component.html

Lines changed: 43 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,43 +8,47 @@ <h4>Code Editor Config</h4>
88

99
<div>
1010
<h4>
11-
<button mat-button (click)="showOutput=!showOutput">Toggle output</button>
11+
<button mat-button (click)="showOutput = !showOutput">Toggle output</button>
1212
</h4>
1313
<div class="editor-wrap">
14-
<code-editor #editor
15-
[style.height]="'500px'"
16-
[(ngModel)]="code"
17-
(ngModelChange)="log($event)"
18-
[theme]="options.theme"
19-
[setup]="options.setup"
20-
[disabled]="options.disabled"
21-
[readonly]="options.readonly"
22-
[placeholder]="options.placeholder"
23-
[indentWithTab]="options.indentWithTab"
24-
[indentUnit]="options.indentUnit"
25-
[lineWrapping]="options.lineWrapping"
26-
[highlightWhitespace]="options.highlightWhitespace"
27-
[language]="options.language"
28-
[languages]="languages" />
14+
<code-editor
15+
#editor
16+
[style.height]="'500px'"
17+
[(ngModel)]="code"
18+
(ngModelChange)="log($event)"
19+
[theme]="options.theme"
20+
[setup]="options.setup"
21+
[disabled]="options.disabled"
22+
[readonly]="options.readonly"
23+
[placeholder]="options.placeholder"
24+
[indentWithTab]="options.indentWithTab"
25+
[indentUnit]="options.indentUnit"
26+
[lineWrapping]="options.lineWrapping"
27+
[highlightWhitespace]="options.highlightWhitespace"
28+
[language]="options.language"
29+
[languages]="languages"
30+
/>
2931

3032
@if (showOutput) {
31-
<textarea [style.height]="'500px'" [(ngModel)]="code"></textarea>
33+
<textarea [style.height]="'500px'" [(ngModel)]="code"></textarea>
3234
}
3335
</div>
3436

3537
<h4>Unified diff-editor</h4>
36-
<code-editor #editor
37-
[style.height]="'500px'"
38-
[value]="modifiedCode"
39-
[theme]="options.theme"
40-
[setup]="options.setup"
41-
[readonly]="options.readonly"
42-
[placeholder]="options.placeholder"
43-
[indentWithTab]="options.indentWithTab"
44-
[indentUnit]="options.indentUnit"
45-
[lineWrapping]="options.lineWrapping"
46-
[highlightWhitespace]="options.highlightWhitespace"
47-
[extensions]="unifiedExts" />
38+
<code-editor
39+
#editor
40+
[style.height]="'500px'"
41+
[value]="modifiedCode"
42+
[theme]="options.theme"
43+
[setup]="options.setup"
44+
[readonly]="options.readonly"
45+
[placeholder]="options.placeholder"
46+
[indentWithTab]="options.indentWithTab"
47+
[indentUnit]="options.indentUnit"
48+
[lineWrapping]="options.lineWrapping"
49+
[highlightWhitespace]="options.highlightWhitespace"
50+
[extensions]="unifiedExts"
51+
/>
4852
</div>
4953
</section>
5054

@@ -58,13 +62,15 @@ <h4>Diff Editor Config</h4>
5862

5963
<div>
6064
<h4>Split diff-editor</h4>
61-
<diff-editor #editor
62-
[style.height]="'100vh'"
63-
[originalValue]="originalCode"
64-
[modifiedValue]="modifiedCode"
65-
[orientation]="options2.orientation"
66-
[revertControls]="options2.revertControls"
67-
[highlightChanges]="options2.highlightChanges"
68-
[gutter]="options2.gutter" />
65+
<diff-editor
66+
#editor
67+
[style.height]="'100vh'"
68+
[originalValue]="originalCode"
69+
[modifiedValue]="modifiedCode"
70+
[orientation]="options2.orientation"
71+
[revertControls]="options2.revertControls"
72+
[highlightChanges]="options2.highlightChanges"
73+
[gutter]="options2.gutter"
74+
/>
6975
</div>
7076
</section>

projects/dev-app/src/app/layout/layout.component.html

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
<span class="spacer"></span>
44
<a mat-icon-button href="https://github.com/acrodata/code-editor" target="_blank">
55
<svg focusable="false" viewBox="0 0 51.8 50.4" xmlns="http://www.w3.org/2000/svg">
6-
<path d="M25.9,0.2C11.8,0.2,0.3,11.7,0.3,25.8c0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