Skip to content

Commit

Permalink
Fix monaco-editor/react (#2692)
Browse files Browse the repository at this point in the history
* Fix `monaco-editor/react`

* chore(dependencies): updated changesets for modified dependencies

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
TuvalSimha and github-actions[bot] authored Feb 21, 2024
1 parent 9f34cdd commit dd6c72e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
18 changes: 9 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@graphql-inspector/core": "../packages/core/dist",
"@monaco-editor/react": "^4.6.0",
"@monaco-editor/react": "4.6.0",
"@theguild/components": "^6.0.1",
"next": "^13.5.4",
"react": "^18.2.0",
Expand Down
9 changes: 4 additions & 5 deletions website/src/components/diff/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ReactElement, useCallback, useEffect, useState } from 'react';
import { buildSchema } from 'graphql';
import FlipMove from 'react-flip-move';
import { Change, diff } from '@graphql-inspector/core';
import { DiffEditor, OnMount } from '@monaco-editor/react';
import { DiffEditor, DiffOnMount } from '@monaco-editor/react';
import ChangeComponent from './change';

const OLD_SCHEMA = /* GraphQL */ `
Expand Down Expand Up @@ -49,8 +49,8 @@ export const Diff = (): ReactElement => {
run();
}, [code]);

const onMount: OnMount = useCallback(value => {
const editor = value.getModifiedEditor();
const onDiffOnMount: DiffOnMount = useCallback(diffEditor => {
const editor = diffEditor.getModifiedEditor();
editor.onKeyUp(() => {
setCode(editor.getValue());
});
Expand All @@ -65,11 +65,10 @@ export const Diff = (): ReactElement => {
theme="vs-dark"
original={OLD_SCHEMA}
modified={code}
onMount={onMount}
onMount={onDiffOnMount}
options={{
codeLens: false,
lineNumbers: 'off',
minimap: false,
originalEditable: false,
}}
/>
Expand Down

0 comments on commit dd6c72e

Please sign in to comment.