diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js index 2e2fdc5..44e47a5 100644 --- a/docs/docusaurus.config.js +++ b/docs/docusaurus.config.js @@ -70,8 +70,8 @@ const config = { title: "JSON P3", logo: { alt: "JSON P3", - src: "img/p3_v2_dark.svg", - srcDark: "img/p3_v2_light.svg", + src: "img/p3_v2_dark_path.svg", + srcDark: "img/p3_v2_light_path.svg", }, items: [ { diff --git a/docs/src/components/JSONPathPlayground/index.js b/docs/src/components/JSONPathPlayground/index.js index c75f23f..d6a12d1 100644 --- a/docs/src/components/JSONPathPlayground/index.js +++ b/docs/src/components/JSONPathPlayground/index.js @@ -24,14 +24,16 @@ const commonEditorOptions = { padding: { bottom: 10, top: 10 }, }; -function QueryEditor({ defaultQuery, theme, onChange }) { +function QueryEditor({ defaultQuery, theme, beforeMount, onMount, onChange }) { return ( ); @@ -64,14 +66,13 @@ function JSONEditor({ onChange, theme }) { ); } -function ResultsEditor({ result, theme, beforeMount }) { +function ResultsEditor({ result, theme }) { return ( { + monaco.editor.defineTheme("Cobalt", themeData); + }) + .then((_) => monaco.editor.setTheme("Cobalt")); + } + /** * Synchronize colorMode with editor theme. */ useEffect(() => { if (colorMode && monacoRef.current !== null) { monacoRef.current.editor.setTheme( - colorMode === "light" ? "light" : "vs-dark", + colorMode === "light" ? "Cobalt" : "vs-dark", ); } }, [colorMode]); @@ -185,14 +194,21 @@ export default function Playground() {

JSONPath Playground


- + @@ -218,6 +234,7 @@ export default function Playground() { alignItems: "center", fontSize: "14px", textAlign: "center", + marginTop: "3px", }} >

diff --git a/docs/src/components/JSONPathPlayground/styles.module.css b/docs/src/components/JSONPathPlayground/styles.module.css index 435c658..e7ce7e9 100644 --- a/docs/src/components/JSONPathPlayground/styles.module.css +++ b/docs/src/components/JSONPathPlayground/styles.module.css @@ -12,5 +12,4 @@ .headingRule { margin-top: 1em; - margin-bottom: 2em; } \ No newline at end of file diff --git a/docs/static/img/p3_v2_dark_path.svg b/docs/static/img/p3_v2_dark_path.svg new file mode 100644 index 0000000..e74db40 --- /dev/null +++ b/docs/static/img/p3_v2_dark_path.svg @@ -0,0 +1,57 @@ + + + + + + + + + + + + diff --git a/docs/static/img/p3_v2_light_path.svg b/docs/static/img/p3_v2_light_path.svg new file mode 100644 index 0000000..e9ca2fb --- /dev/null +++ b/docs/static/img/p3_v2_light_path.svg @@ -0,0 +1,58 @@ + + + + + + + + + + + +