We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f01679e commit 41d709dCopy full SHA for 41d709d
src/JsonPathQueryField.tsx
@@ -1,6 +1,6 @@
1
import React from 'react';
2
3
-import { QueryField } from '@grafana/ui';
+import { QueryField, SlatePrism, BracesPlugin } from '@grafana/ui';
4
5
interface Props {
6
query: string;
@@ -12,9 +12,18 @@ interface Props {
12
* JsonPathQueryField is an editor for JSON Path.
13
*/
14
export const JsonPathQueryField: React.FC<Props> = ({ query, onBlur, onChange }) => {
15
+ const plugins = [
16
+ BracesPlugin(),
17
+ SlatePrism({
18
+ onlyIn: (node: any) => node.type === 'code_block',
19
+ getSyntax: (node: any) => 'js',
20
+ }),
21
+ ];
22
+
23
return (
24
<div style={{ marginRight: '4px', width: '100%' }}>
25
<QueryField
26
+ additionalPlugins={plugins}
27
query={query}
28
onBlur={onBlur}
29
onChange={onChange}
0 commit comments