Skip to content

Commit

Permalink
fix: ci fix
Browse files Browse the repository at this point in the history
  • Loading branch information
BroKun committed Nov 30, 2023
1 parent ffd3fdb commit 0bce9b4
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 15 deletions.
34 changes: 20 additions & 14 deletions packages/libro-codemirror/src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ 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');
host.addEventListener('focus', this, true);
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<ICollabSelectionText>();
Expand Down Expand Up @@ -187,33 +187,36 @@ 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();

// 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);
}
Expand Down Expand Up @@ -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') {
Expand Down Expand Up @@ -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,
);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
4 changes: 4 additions & 0 deletions packages/libro-lab/src/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export const LibroLabLayoutComponent = forwardRef(
<SplitPanel id="libro-lab-content-layout">
<SplitPanel.Pane
id="libro-lab-content-layout-left"
className="libro-lab-content-layout-left"
defaultSize={300}
minResize={160}
>
<Slot name={LibroLabContentSlots.left} />
</SplitPanel.Pane>
<SplitPanel.Pane
id="libro-lab-content-layout-main-container"
className="libro-lab-content-layout-main-container"
flex={1}
minResize={200}
>
Expand All @@ -43,6 +45,7 @@ export const LibroLabLayoutComponent = forwardRef(
>
<SplitPanel.Pane
id="libro-lab-content-layout-main"
className="libro-lab-content-layout-main"
flex={2}
flexGrow={1}
minResize={200}
Expand All @@ -51,6 +54,7 @@ export const LibroLabLayoutComponent = forwardRef(
</SplitPanel.Pane>
<SplitPanel.Pane
id="libro-lab-content-layout-bottom"
className="libro-lab-content-layout-bottom"
flex={1}
defaultSize={200}
>
Expand Down

0 comments on commit 0bce9b4

Please sign in to comment.