@@ -7,14 +7,15 @@ import { applyResponseHeaders, checkSyntax, fetchContentAndMetadata, getResponse
77import styles from './SourceEditorCard.styles.css'
88import { WebComponent } from 'solid-ui'
99import { getStatusSection } from '../../StatusSection'
10- import { SourceContext } from '../../primitives/context'
11- import { sourceContext } from '../../primitives/context'
1210import 'solid-ui/components/button'
1311import { compactable } from '../../compactableFormats'
12+ import { SourceContext } from '../../primitives/context'
13+ import { sourceContext } from '../../primitives/context'
1414
1515@customElement ( 'solid-panes-source-editor-card' )
1616export default class SourceEditorCard extends WebComponent {
1717 static styles = styles
18+
1819 private _editor ?: SourceEditor
1920 private _originalContent ?: string
2021 private _dirtyState = false
@@ -84,7 +85,7 @@ export default class SourceEditorCard extends WebComponent {
8485 }
8586 try {
8687 const { SourceEditor } = await import ( './SourceEditor' )
87- const { content, metadata } = await fetchContentAndMetadata ( sourceContext . context . session . store , new NamedNode ( sourceContext . subject ) , sourceContext . sourcePaneState )
88+ const { content, metadata } = await fetchContentAndMetadata ( sourceContext . context . session . store as any , new NamedNode ( sourceContext . subject ) , sourceContext . sourcePaneState as any )
8889 this . _originalContent = content
8990 this . _editor = new SourceEditor ( )
9091 await this . _editor . initialize ( sourcePaneEditor , content , metadata . contentType , 'dark' , dirty => {
@@ -126,13 +127,13 @@ export default class SourceEditorCard extends WebComponent {
126127 private async saveBack ( ) {
127128 const sourceContext = this . _requireSourceContext ( )
128129
129- const store = sourceContext . context . session . store
130+ const store = sourceContext . context . session . store as any
130131 const subject = new NamedNode ( sourceContext . subject )
131132 const sourcePaneState = sourceContext . sourcePaneState
132133 const fetcher = store . fetcher
133134 const data = this . getEditor ( ) ?. getValue ( ) ?? ''
134135 const { contentType, eTag } = sourceContext . sourcePaneState
135- if ( ! checkSyntax ( store , subject , data , contentType , subject ) ) {
136+ if ( ! checkSyntax ( store , subject as any , data , contentType , subject as any ) ) {
136137 const { showError } = getStatusSection ( )
137138 showError ( 'Syntax error: fix the document before saving.' )
138139 return
@@ -147,7 +148,7 @@ export default class SourceEditorCard extends WebComponent {
147148 try {
148149 const response = await fetcher . webOperation ( 'HEAD' , subject . uri ) // , defaultFetchHeaders())
149150 if ( ! happy ( response , 'HEAD' ) ) return
150- applyResponseHeaders ( sourcePaneState , getResponseHeaders ( store , subject , response ) )
151+ applyResponseHeaders ( sourcePaneState as any , getResponseHeaders ( store , subject as any , response ) )
151152 this . _resetEditorState ( )
152153 } catch ( err ) {
153154 throw err
@@ -164,7 +165,7 @@ export default class SourceEditorCard extends WebComponent {
164165 const { contentType } = sourceContext . sourcePaneState
165166 const compactContentType = contentType ?. split ( ';' ) [ 0 ]
166167 const { showError } = getStatusSection ( )
167- const store = sourceContext . context . session . store
168+ const store = sourceContext . context . session . store as any
168169 const subjectNode = new NamedNode ( sourceContext . subject )
169170
170171 if ( compactContentType && compactable [ compactContentType ] ) {
0 commit comments