diff --git a/packages/libro-codemirror/src/editor.ts b/packages/libro-codemirror/src/editor.ts index c52bbc4e..1c3c6076 100644 --- a/packages/libro-codemirror/src/editor.ts +++ b/packages/libro-codemirror/src/editor.ts @@ -140,7 +140,7 @@ export class CodeMirrorEditor implements IEditor { */ constructor(options: IOptions) { this._editorConfig = new EditorConfiguration(options); - const host = (this.host = options.host); + const host = (this.host = options['host']); host.classList.add(EDITOR_CLASS); host.classList.add('jp-Editor'); @@ -148,7 +148,7 @@ export class CodeMirrorEditor implements IEditor { host.addEventListener('blur', this, true); host.addEventListener('scroll', this, true); - this._uuid = options.uuid || v4(); + this._uuid = options['uuid'] || v4(); // State and effects for handling the selection marks this._addMark = StateEffect.define(); @@ -187,19 +187,19 @@ export class CodeMirrorEditor implements IEditor { }); // Handle selection style. - const style = options.selectionStyle || {}; + const style = options['selectionStyle'] || {}; this._selectionStyle = { ...defaultSelectionStyle, ...(style as IEditorSelectionStyle), }; - const model = (this._model = options.model); + const model = (this._model = options['model']); const config = options.config || {}; const fullConfig = (this._config = { ...codeMirrorDefaultConfig, ...config, - mimetype: options.model.mimeType, + mimetype: options['model'].mimeType, }); // this._initializeEditorBinding(); @@ -207,13 +207,16 @@ export class CodeMirrorEditor implements IEditor { // Extension for handling DOM events const domEventHandlers = EditorView.domEventHandlers({ keydown: (event: KeyboardEvent) => { - const index = findFirstArrayIndex(this._keydownHandlers, (handler) => { - if (handler(this, event) === true) { - event.preventDefault(); - return true; - } - return false; - }); + const index = findFirstArrayIndex( + this._keydownHandlers, + (handler: KeydownHandler) => { + if (handler(this, event) === true) { + event.preventDefault(); + return true; + } + return false; + }, + ); if (index === -1) { return this.onKeydown(event); } @@ -391,7 +394,7 @@ export class CodeMirrorEditor implements IEditor { // Don't bother setting the option if it is already the same. if (this._config[option] !== value) { this._config[option] = value; - this._editorConfig.reconfigureExtension(this._editor, option, value); + this._editorConfig.reconfigureExtension(this._editor, option as string, value); } if (option === 'readOnly') { @@ -544,7 +547,10 @@ export class CodeMirrorEditor implements IEditor { addKeydownHandler(handler: KeydownHandler): Disposable { this._keydownHandlers.push(handler); return Disposable.create(() => { - removeAllWhereFromArray(this._keydownHandlers, (val) => val === handler); + removeAllWhereFromArray( + this._keydownHandlers, + (val: KeydownHandler) => val === handler, + ); }); } diff --git a/packages/libro-core/src/components/dnd-component/default-dnd-content.tsx b/packages/libro-core/src/components/dnd-component/default-dnd-content.tsx index 31b653c7..d70d0d03 100644 --- a/packages/libro-core/src/components/dnd-component/default-dnd-content.tsx +++ b/packages/libro-core/src/components/dnd-component/default-dnd-content.tsx @@ -7,9 +7,9 @@ import { getEmptyImage } from 'react-dnd-html5-backend'; import { CellService } from '../../cell/index.js'; import { CellCollapsible } from '../../collapse-service.js'; +import { MultiSelectionWhenShiftClick } from '../../configuration/libro-configuration.js'; import { isCellView, DragAreaKey } from '../../libro-protocol.js'; import type { CellView, DndContentProps } from '../../libro-protocol.js'; -import { MultiSelectionWhenShiftClick } from '../../configuration/libro-configuration.js'; import type { LibroView } from '../../libro-view.js'; import { HolderOutlined, PlusOutlined } from '../../material-from-designer.js'; import { hasErrorOutput } from '../../output/index.js'; diff --git a/packages/libro-lab/src/layout/index.tsx b/packages/libro-lab/src/layout/index.tsx index 55a8b0a3..cac0b311 100644 --- a/packages/libro-lab/src/layout/index.tsx +++ b/packages/libro-lab/src/layout/index.tsx @@ -27,6 +27,7 @@ export const LibroLabLayoutComponent = forwardRef( @@ -34,6 +35,7 @@ export const LibroLabLayoutComponent = forwardRef( @@ -43,6 +45,7 @@ export const LibroLabLayoutComponent = forwardRef( >