Skip to content

Commit 21fb521

Browse files
committed
Merge branch 'source' into landing--interactive-editor-on-landing
2 parents 806c78e + 234587f commit 21fb521

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/components/interactive-code-block/codemirror-theme.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export const syntaxTheme = HighlightStyle.define([
8989
},
9090
{ tag: [t.function(t.variableName), t.labelName], class: "cm-variable" },
9191
{ tag: [t.color, t.constant(t.name), t.standard(t.name)], class: "cm-atom" },
92-
{ tag: [t.definition(t.name), t.separator], class: "cm-def" },
92+
{ tag: [t.definition(t.name)], class: "cm-def" },
9393
{
9494
tag: [
9595
t.typeName,
@@ -112,6 +112,7 @@ export const syntaxTheme = HighlightStyle.define([
112112
t.regexp,
113113
t.link,
114114
t.special(t.string),
115+
t.separator,
115116
],
116117
class: "cm-punctuation",
117118
},

src/components/interactive-code-block/syntax-highlighting.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
--cm-hints-active-foreground: #ffffff;
5858
}
5959

60-
/* CodeMirror 6 Editor Base Styles */
6160
.cm-editor {
6261
font-family: inherit;
6362
font-size: inherit;

src/components/interactive-code-block/variable-editor.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { EditorView } from "@codemirror/view"
33
import { EditorState } from "@codemirror/state"
44
import { json } from "@codemirror/lang-json"
55
import { history } from "@codemirror/commands"
6-
import { syntaxHighlighting, defaultHighlightStyle } from "@codemirror/language"
6+
import { codeMirrorThemeExtension } from "./codemirror-theme"
77

88
interface VariableEditorProps {
99
value: string
@@ -43,13 +43,12 @@ export class VariableEditor extends Component<VariableEditorProps> {
4343
componentDidMount() {
4444
if (!this.domNode) return
4545

46-
// Create editor state for JSON (variables are JSON)
4746
const state = EditorState.create({
4847
doc: this.props.value || "",
4948
extensions: [
5049
history(),
5150
json(),
52-
syntaxHighlighting(defaultHighlightStyle),
51+
codeMirrorThemeExtension,
5352
EditorView.updateListener.of(update => {
5453
if (update.docChanged && !this.ignoreChangeEvent) {
5554
this.cachedValue = update.state.doc.toString()

0 commit comments

Comments
 (0)