@woosmap/ui 4.209.0 → 4.211.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@woosmap/ui",
3
- "version": "4.209.0",
3
+ "version": "4.211.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/WebGeoServices/ui.git"
@@ -5,6 +5,10 @@ import js from 'react-syntax-highlighter/dist/cjs/languages/hljs/javascript';
5
5
  import shell from 'react-syntax-highlighter/dist/cjs/languages/hljs/powershell';
6
6
  import json from 'react-syntax-highlighter/dist/cjs/languages/hljs/json';
7
7
  import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github';
8
+ // import dark from 'react-syntax-highlighter/dist/cjs/styles/hljs/nnfx-dark';
9
+ import dark from 'react-syntax-highlighter/dist/cjs/styles/hljs/night-owl';
10
+ // import dark from 'react-syntax-highlighter/dist/cjs/styles/hljs/gml';
11
+ // import dark from 'react-syntax-highlighter/dist/cjs/styles/hljs/dracula';
8
12
 
9
13
  SyntaxHighlighter.registerLanguage('javascript', js);
10
14
  SyntaxHighlighter.registerLanguage('bash', shell);
@@ -17,9 +21,9 @@ export default class CodeSnippet extends Component {
17
21
  }
18
22
 
19
23
  render() {
20
- const { codeString, language, className } = this.props;
24
+ const { codeString, language, className, isDark } = this.props;
21
25
  return (
22
- <SyntaxHighlighter className={className} language={language} style={github}>
26
+ <SyntaxHighlighter className={className} language={language} style={isDark ? dark : github}>
23
27
  {codeString}
24
28
  </SyntaxHighlighter>
25
29
  );
@@ -29,9 +33,11 @@ export default class CodeSnippet extends Component {
29
33
  CodeSnippet.defaultProps = {
30
34
  codeString: '',
31
35
  className: '',
36
+ isDark: false,
32
37
  };
33
38
  CodeSnippet.propTypes = {
34
39
  codeString: PropTypes.string,
35
40
  className: PropTypes.string,
41
+ isDark: PropTypes.bool,
36
42
  language: PropTypes.string.isRequired,
37
43
  };
@@ -420,19 +420,26 @@ export default class AutocompleteAddressDemo extends Component {
420
420
  disabled={!selectedLocality}
421
421
  >
422
422
  <div className="showcase-result-wrapper nopad">
423
- <div className="showcase-result-request">
424
- <h4>{tr('Request')}</h4>
425
- <CodeSnippet language="bash" codeString={this.renderCurlCode()} />
426
- </div>
427
- {!error && selectedLocality && (
428
- <div className="showcase-result-response">
429
- <h4>{tr(' Response')}</h4>
423
+ <div className="showcase-result-bg">
424
+ <div className="showcase-result-request">
425
+ <h4>{tr('Request')}</h4>
430
426
  <CodeSnippet
431
- language="json"
432
- codeString={JSON.stringify(selectedLocality, null, 2)}
427
+ language="bash"
428
+ isDark
429
+ codeString={this.renderCurlCode()}
433
430
  />
434
431
  </div>
435
- )}
432
+ {!error && selectedLocality && (
433
+ <div className="showcase-result-response">
434
+ <h4>{tr(' Response')}</h4>
435
+ <CodeSnippet
436
+ isDark
437
+ language="json"
438
+ codeString={JSON.stringify(selectedLocality, null, 2)}
439
+ />
440
+ </div>
441
+ )}
442
+ </div>
436
443
  </div>
437
444
  </div>
438
445
  ) : null}