scoobie 14.3.2 → 14.3.4
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
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"version": "14.3.
|
|
7
|
+
"version": "14.3.4",
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"@capsizecss/core": "^3.0.0",
|
|
10
10
|
"@mdx-js/loader": "^1.6.22",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"fs-extra": "^11.0.0",
|
|
19
19
|
"jsonc-parser": "^3.0.0",
|
|
20
20
|
"polished": "^4.1.3",
|
|
21
|
-
"prism-react-renderer": "
|
|
21
|
+
"prism-react-renderer": "2.0.4",
|
|
22
22
|
"react-keyed-flatten-children": "^1.3.0",
|
|
23
23
|
"refractor": "^3.4.0",
|
|
24
24
|
"remark-slug": "^6.1.0",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"react-helmet-async": "1.3.0",
|
|
42
42
|
"react-router-dom": "6.9.0",
|
|
43
43
|
"semantic-release": "21.0.0",
|
|
44
|
-
"sku": "11.
|
|
44
|
+
"sku": "11.12.0",
|
|
45
45
|
"webpack": "5.76.3"
|
|
46
46
|
},
|
|
47
47
|
"files": [
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Box, Stack } from 'braid-design-system';
|
|
2
|
-
import type Highlight from 'prism-react-renderer';
|
|
2
|
+
import type { Highlight } from 'prism-react-renderer';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
5
|
import type { Size } from '../../private/size';
|
|
6
6
|
|
|
7
7
|
import { code } from '../../../styles/code.css';
|
|
8
8
|
|
|
9
|
+
type Highlight = Parameters<Parameters<typeof Highlight>[0]['children']>[0];
|
|
10
|
+
|
|
9
11
|
type Token = Parameters<Highlight['getTokenProps']>[0]['token'];
|
|
10
12
|
|
|
11
13
|
interface Props {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Box, Stack, Text, TextLinkButton } from 'braid-design-system';
|
|
2
2
|
import { parse } from 'jsonc-parser';
|
|
3
|
-
import Highlight from 'prism-react-renderer';
|
|
3
|
+
import { Highlight } from 'prism-react-renderer';
|
|
4
4
|
import React, { useState } from 'react';
|
|
5
5
|
|
|
6
|
-
import { Prism,
|
|
6
|
+
import { Prism, themes } from '../private/Prism';
|
|
7
7
|
import { ScrollableInline } from '../private/ScrollableInline';
|
|
8
8
|
import {
|
|
9
9
|
DEFAULT_SIZE,
|
|
@@ -117,10 +117,10 @@ export const CodeBlock = ({
|
|
|
117
117
|
|
|
118
118
|
<Box borderRadius="large" className={styles.codeContainer}>
|
|
119
119
|
<Highlight
|
|
120
|
-
|
|
120
|
+
prism={Prism}
|
|
121
121
|
code={child.code}
|
|
122
122
|
language={child.language}
|
|
123
|
-
theme={
|
|
123
|
+
theme={themes.github}
|
|
124
124
|
>
|
|
125
125
|
{({ getTokenProps, tokens }) => (
|
|
126
126
|
<Box display="flex">
|
package/src/private/Prism.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Prism } from 'prism-react-renderer';
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import csharpLang from 'refractor/lang/csharp';
|
|
4
4
|
// @ts-ignore
|
|
@@ -11,9 +11,9 @@ httpLang(Prism);
|
|
|
11
11
|
splunkSplLang(Prism);
|
|
12
12
|
|
|
13
13
|
export { Prism } from 'prism-react-renderer';
|
|
14
|
-
export {
|
|
14
|
+
export { themes } from 'prism-react-renderer';
|
|
15
15
|
|
|
16
|
-
const DEFAULT_LANGUAGE = 'text'
|
|
16
|
+
const DEFAULT_LANGUAGE = 'text';
|
|
17
17
|
|
|
18
18
|
const DISPLAY_LANGUAGE_REPLACEMENTS: Record<string, string> = {
|
|
19
19
|
'splunk-spl': 'Splunk SPL',
|
|
@@ -64,7 +64,7 @@ export const prismLanguage = (language?: string) => {
|
|
|
64
64
|
const lower = (language ?? DEFAULT_LANGUAGE).toLocaleLowerCase();
|
|
65
65
|
|
|
66
66
|
// This type is pointless. We extend it and there is a fallback anyway.
|
|
67
|
-
return
|
|
67
|
+
return PRISM_LANGUAGE_REPLACEMENTS[lower] ?? lower;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
export const displayLanguage = (language?: string) => {
|