Skip to content

Commit 9f35bf5

Browse files
committed
fix editor dup and style
1 parent e8a45e9 commit 9f35bf5

5 files changed

Lines changed: 30 additions & 20 deletions

File tree

src/components/source-editor-card/SourceEditor.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ export class SourceEditor {
3434
doc: initialDoc,
3535
extensions: [
3636
theme === 'dark' ? vscodeDark : vscodeLight,
37+
EditorView.theme({
38+
'&': {
39+
minHeight: '6lh'
40+
}
41+
}),
3742
this._languageCompartment.of(languageExtension),
3843
this._editableCompartment.of(EditorView.editable.of(true)),
3944
syntaxHighlighting(defaultHighlightStyle, { fallback: true }),

src/components/source-editor-card/SourceEditorCard.styles.css

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
display: flex;
88
flex-direction: column;
99
width: 100%;
10-
padding: 20px;
11-
align-items: flex-start;
12-
gap: 20px;
13-
border-radius: 10px;
14-
background: var(--solid-ui-color-white, #FFFFFF);
15-
box-shadow: 0 0 6px 0 rgba(0, 0, 0, 0.25);
10+
align-items: stretch;
11+
}
12+
13+
.sourcePaneEditor {
14+
box-sizing: border-box;
15+
align-self: stretch;
16+
min-width: 0;
17+
width: 100%;
1618
}
1719

1820
.sourcePaneCardLoading {

src/components/source-editor-card/SourceEditorCard.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { WebComponent } from 'solid-ui'
99
import { getStatusSection } from '../../StatusSection'
1010
import 'solid-ui/components/button'
1111
import { compactable } from '../../compactableFormats'
12-
import { SourceContext } from '../../primitives/context'
13-
import { sourceContext } from '../../primitives/context'
12+
import { sourceContext, SourceContext } from '../../primitives/context'
1413

1514
@customElement('solid-panes-source-editor-card')
1615
export default class SourceEditorCard extends WebComponent {
@@ -103,13 +102,6 @@ export default class SourceEditorCard extends WebComponent {
103102
await this._initializeEditor()
104103
}
105104

106-
protected updated (changedProperties: Map<string, any>) {
107-
super.updated(changedProperties)
108-
if (!this._editor && this.sourceContext && this._editorMount) {
109-
void this._initializeEditor()
110-
}
111-
}
112-
113105
disconnectedCallback() {
114106
super.disconnectedCallback()
115107
if (this._editor) {

src/components/source-provider/SourceProvider.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const defaultSourcePaneState: SourcePaneState = {
2222

2323
@customElement('source-pane-source-provider')
2424
export default class SourceProvider extends WebComponent {
25+
2526
@property({ attribute: false })
2627
accessor context: DataBrowserContext | undefined = undefined
2728

src/sourcePane.css

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
.sourcePane {
2-
display: flex;
3-
flex-direction: column;
4-
align-items: center;
5-
gap: 23px;
6-
padding-bottom: 29px;
2+
display: block;
3+
width: 100%;
74
border-radius: 5px;
85
border: 1px solid var(--color-border, var(--gray-200, #E5E7EB));
96
}
@@ -29,6 +26,19 @@
2926
width: 100%;
3027
}
3128

29+
/* This code is here because currently the shadow DOM isn't
30+
working just yet because I need to implement the header as a web component first
31+
once I do that I can move this to the host css of the source-provider */
32+
source-pane-source-provider {
33+
display: flex;
34+
flex-direction: column;
35+
width: 100%;
36+
align-self: stretch;
37+
box-sizing: border-box;
38+
padding: 20px 20px 29px;
39+
gap: 23px;
40+
}
41+
3242
.sourcePaneCompactButton {
3343
box-sizing: border-box;
3444
display: inline-flex;

0 commit comments

Comments
 (0)