Skip to content

Commit

Permalink
fix(Web): Fix consumption of library from other projects
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ketch committed Feb 16, 2022
1 parent c580741 commit b877c85
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web/src/editors/article/schema.ts
Expand Up @@ -358,6 +358,7 @@ function tableCell(): NodeSpec {
parseDOM: [
{ tag: 'td', getAttrs: (dom) => tableCellAttrsGet(dom as HTMLElement) },
],
// @ts-expect-error
toDOM(node) {
return ['td', tableCellAttrsSet(node), 0]
},
Expand All @@ -382,6 +383,7 @@ function tableHeader(): NodeSpec {
parseDOM: [
{ tag: 'th', getAttrs: (dom) => tableCellAttrsGet(dom as HTMLElement) },
],
// @ts-expect-error
toDOM(node) {
return ['th', tableCellAttrsSet(node), 0]
},
Expand Down
2 changes: 2 additions & 0 deletions web/src/events/kernels.ts
Expand Up @@ -35,6 +35,8 @@ export const onDiscoverExecutableLanguages = (
}
)

window.stencilaWebClient = window.stencilaWebClient ?? {}

window.stencilaWebClient.executableLanguages = executableLanguages

window.dispatchEvent(event)
Expand Down
3 changes: 3 additions & 0 deletions web/src/index.ts
Expand Up @@ -6,6 +6,9 @@ import { languages } from './kernels'
import * as sessions from './sessions'
import { ProjectId, SnapshotId } from './types'

export type { Document, Session } from '@stencila/stencila'
export { create } from './documents'

export const main = (
clientId: ClientId,
projectId: ProjectId,
Expand Down

0 comments on commit b877c85

Please sign in to comment.