-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with editing bodies in the requestor request view (#366)
* Fix issue with editing bodies in the requestor request view * Update package json versions for a canary release * Update !canary.mdx --------- Co-authored-by: Jacco Flenter <flenter@users.noreply.github.com>
- Loading branch information
Showing
7 changed files
with
85 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
studio/src/components/CodeMirrorEditor/CodeMirrorTextEditor.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import "./CodeMirrorEditorCssOverrides.css"; | ||
|
||
import { duotoneDark } from "@uiw/codemirror-theme-duotone"; | ||
import CodeMirror, { basicSetup, EditorView } from "@uiw/react-codemirror"; | ||
import { useMemo } from "react"; | ||
import { createOnSubmitKeymap, escapeKeymap } from "./keymaps"; | ||
import { customTheme, duotonePlaintextOverride } from "./themes"; | ||
|
||
type CodeMirrorEditorProps = { | ||
height?: string; | ||
minHeight?: string; | ||
maxHeight?: string; | ||
theme?: string; | ||
readOnly?: boolean; | ||
value?: string; | ||
onChange: (value?: string) => void; | ||
onSubmit?: () => void; | ||
}; | ||
|
||
export function CodeMirrorTextEditor(props: CodeMirrorEditorProps) { | ||
const { | ||
height, | ||
value, | ||
onChange, | ||
readOnly, | ||
minHeight = "200px", | ||
maxHeight, | ||
onSubmit, | ||
} = props; | ||
|
||
const extensions = useMemo( | ||
() => [ | ||
createOnSubmitKeymap(onSubmit, false), | ||
basicSetup({ | ||
searchKeymap: false, | ||
}), | ||
EditorView.lineWrapping, | ||
escapeKeymap, | ||
], | ||
[onSubmit], | ||
); | ||
|
||
return ( | ||
<CodeMirror | ||
value={value} | ||
height={height} | ||
maxHeight={maxHeight} | ||
minHeight={minHeight} | ||
extensions={extensions} | ||
onChange={onChange} | ||
theme={[duotoneDark, duotonePlaintextOverride, customTheme]} | ||
readOnly={readOnly} | ||
basicSetup={false} | ||
/> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
export { CodeMirrorSqlEditor } from "./CodeMirrorSqlEditor"; | ||
export { CodeMirrorTypescriptEditor } from "./CodeMirrorTypescriptEditor"; | ||
export { CodeMirrorJsonEditor } from "./CodeMirrorJsonEditor"; | ||
export { CodeMirrorTextEditor } from "./CodeMirrorTextEditor"; | ||
export { CodeMirrorInput } from "./CodeMirrorInput"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
--- | ||
date: 2024-10-18 | ||
date: 2024-10-19 | ||
version: canary | ||
draft: true | ||
--- | ||
|
||
### Features | ||
* Improved code analysis. Through the new @fiberplane/source-analysis package a more flexbile and thorough source code implementation is included | ||
|
||
### Bug fixes |