From b877c85eed1b526ccfdf4334a025ce7be92d57fe Mon Sep 17 00:00:00 2001 From: alex-ketch Date: Tue, 8 Feb 2022 16:10:39 -0500 Subject: [PATCH] fix(Web): Fix consumption of library from other projects --- web/src/editors/article/schema.ts | 2 ++ web/src/events/kernels.ts | 2 ++ web/src/index.ts | 3 +++ 3 files changed, 7 insertions(+) diff --git a/web/src/editors/article/schema.ts b/web/src/editors/article/schema.ts index ab6b73c005..52fd3f3c6b 100644 --- a/web/src/editors/article/schema.ts +++ b/web/src/editors/article/schema.ts @@ -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] }, @@ -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] }, diff --git a/web/src/events/kernels.ts b/web/src/events/kernels.ts index d094bbcab0..c451af71ad 100644 --- a/web/src/events/kernels.ts +++ b/web/src/events/kernels.ts @@ -35,6 +35,8 @@ export const onDiscoverExecutableLanguages = ( } ) + window.stencilaWebClient = window.stencilaWebClient ?? {} + window.stencilaWebClient.executableLanguages = executableLanguages window.dispatchEvent(event) diff --git a/web/src/index.ts b/web/src/index.ts index 5117419a2f..6f9e7c3557 100644 --- a/web/src/index.ts +++ b/web/src/index.ts @@ -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,