Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump react-syntax-highlighter to 13.2.1 #11838

Merged
Merged
2 changes: 1 addition & 1 deletion addons/storysource/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"prettier": "^2.0.5",
"prop-types": "^15.7.2",
"react": "^16.9.17",
"react-syntax-highlighter": "^12.2.1",
"react-syntax-highlighter": "^13.5.0",
"regenerator-runtime": "^0.13.3"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion lib/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"react-color": "^2.17.0",
"react-dom": "^16.8.3",
"react-popper-tooltip": "^2.11.0",
"react-syntax-highlighter": "^12.2.1",
"react-syntax-highlighter": "^13.5.0",
"react-textarea-autosize": "^8.1.1",
"ts-dedent": "^1.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion lib/components/src/blocks/Source.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const StyledSyntaxHighlighter = styled(SyntaxHighlighter)<{}>(({ theme }) => ({
borderRadius: theme.appBorderRadius,
boxShadow:
theme.base === 'light' ? 'rgba(0, 0, 0, 0.10) 0 1px 3px 0' : 'rgba(0, 0, 0, 0.20) 0 2px 5px 0',
'pre.hljs': {
'pre.prismjs': {
padding: 20,
background: 'inherit',
},
Expand Down
3 changes: 3 additions & 0 deletions lib/components/src/syntaxhighlighter/syntaxhighlighter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ export const SyntaxHighlighter: FunctionComponent<Props> = ({
padded = false,
format = true,
className = null,
showLineNumbers = false,
...rest
}) => {
const [copied, setCopied] = useState(false);
Expand All @@ -144,6 +145,8 @@ export const SyntaxHighlighter: FunctionComponent<Props> = ({
<ReactSyntaxHighlighter
padded={padded || bordered}
language={language}
showLineNumbers={showLineNumbers}
showInlineLineNumbers={showLineNumbers}
useInlineStyles={false}
PreTag={Pre}
CodeTag={Code}
Expand Down
4 changes: 2 additions & 2 deletions lib/components/src/typography/DocumentFormatting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export const Pre = styled.pre<{}>(withReset, withMargin, ({ theme }) => ({
borderRadius: 3,
margin: '1rem 0',

'&:not(.hljs)': {
'&:not(.prismjs)': {
background: 'transparent',
border: 'none',
borderRadius: 0,
padding: 0,
margin: 0,
},
'& pre, &.hljs': {
'& pre, &.prismjs': {
padding: 15,
margin: 0,
whiteSpace: 'pre-wrap',
Expand Down
6 changes: 3 additions & 3 deletions lib/components/src/typography/DocumentWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,22 @@ export const DocumentWrapper = styled.div<{}>(({ theme }) => ({
fontSize: `${theme.typography.size.s2}px`,
color: theme.color.dark,
},
'pre:not(.hljs)': {
'pre:not(.prismjs)': {
background: 'transparent',
border: 'none',
borderRadius: 0,
padding: 0,
margin: 0,
},
'pre pre, pre.hljs': {
'pre pre, pre.prismjs': {
padding: 15,
margin: 0,
whiteSpace: 'pre-wrap',
color: 'inherit',
fontSize: '13px',
lineHeight: '19px',
},
'pre pre code, pre.hljs code': {
'pre pre code, pre.prismjs code': {
color: 'inherit',
fontSize: 'inherit',
},
Expand Down
9 changes: 5 additions & 4 deletions lib/theming/src/modules/syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,16 +113,15 @@ export const create = ({ colors, mono }: { colors: ColorsHash; mono: string }) =
fontFamily: mono,
WebkitFontSmoothing: 'antialiased',

'&.tag': colorsObjs.red3,

'&.comment': { ...colorsObjs.green1, fontStyle: 'italic' },
'&.prolog': { ...colorsObjs.green1, fontStyle: 'italic' },
'&.doctype': { ...colorsObjs.green1, fontStyle: 'italic' },
'&.cdata': { ...colorsObjs.green1, fontStyle: 'italic' },

'&.string': colorsObjs.red1,

'&.punctuation': colorsObjs.gray1,
'&.operator': colorsObjs.gray1,

'&.url': colorsObjs.cyan1,
'&.symbol': colorsObjs.cyan1,
'&.number': colorsObjs.cyan1,
Expand All @@ -135,6 +134,9 @@ export const create = ({ colors, mono }: { colors: ColorsHash; mono: string }) =
'&.keyword': colorsObjs.blue1,
'&.attr-value': colorsObjs.blue1,

'&.punctuation': colorsObjs.gray1,
'&.operator': colorsObjs.gray1,

'&.function': colorsObjs.gray1,
'&.deleted': colorsObjs.red2,

Expand All @@ -151,7 +153,6 @@ export const create = ({ colors, mono }: { colors: ColorsHash; mono: string }) =

'&.class-name': colorsObjs.cyan2,

'&.tag': colorsObjs.red3,
'&.selector': colorsObjs.red3,

'&.attr-name': colorsObjs.red4,
Expand Down
72 changes: 30 additions & 42 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -16116,16 +16116,16 @@ hex-color-regex@^1.1.0:
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
integrity sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ==

highlight.js@^10.1.1, highlight.js@~10.1.0:
version "10.1.2"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.1.2.tgz#c20db951ba1c22c055010648dfffd7b2a968e00c"
integrity sha512-Q39v/Mn5mfBlMff9r+zzA+gWxRsCRKwEMvYTiisLr/XUiFI/4puWt0Ojdko3R3JCNWGdOWaA5g/Yxqa23kC5AA==

highlight.js@^9.6.0:
version "9.18.1"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.18.1.tgz#ed21aa001fe6252bb10a3d76d47573c6539fe13c"
integrity sha512-OrVKYz70LHsnCgmbXctv/bfuvntIKDz177h0Co37DQ5jamGZLVmoCVMtjMtNZY3X9DrCcKfklHPNeA0uPZhSJg==

highlight.js@~9.15.0, highlight.js@~9.15.1:
version "9.15.10"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2"
integrity sha512-RoV7OkQm0T3os3Dd2VHLNMoaoDVx77Wygln3n9l5YV172XonWG6rgQD3XnF/BuFFZw9A0TJgmMSO8FEWQgvcXw==

hmac-drbg@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
Expand Down Expand Up @@ -21168,13 +21168,13 @@ lowercase-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==

lowlight@1.12.1:
version "1.12.1"
resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.12.1.tgz#014acf8dd73a370e02ff1cc61debcde3bb1681eb"
integrity sha512-OqaVxMGIESnawn+TU/QMV5BJLbUghUfjDWPAtFqDYDmDtr4FnB+op8xM+pR7nKlauHNUHXGt0VgWatFB8voS5w==
lowlight@^1.14.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/lowlight/-/lowlight-1.14.0.tgz#83ebc143fec0f9e6c0d3deffe01be129ce56b108"
integrity sha512-N2E7zTM7r1CwbzwspPxJvmjAbxljCPThTFawEX2Z7+P3NGrrvY54u8kyU16IY4qWfoVIxY8SYCS8jTkuG7TqYA==
dependencies:
fault "^1.0.2"
highlight.js "~9.15.0"
fault "^1.0.0"
highlight.js "~10.1.0"

lru-cache@^4.0.0, lru-cache@^4.0.1, lru-cache@^4.1.2, lru-cache@^4.1.5:
version "4.1.5"
Expand Down Expand Up @@ -23660,18 +23660,6 @@ parse-diff@^0.7.0:
resolved "https://registry.yarnpkg.com/parse-diff/-/parse-diff-0.7.0.tgz#f11128d3aa02381b46ebc8320b470c2c327e67dc"
integrity sha512-88ar4IU2Fx+KgiyvVul0Y+YprMArTgLscO0nEKaEvWvhzRSSYefdf1M9PUmpx1pu5crUoVl2QNDMqjxfCeKptQ==

parse-entities@^1.1.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.2.tgz#c31bf0f653b6661354f8973559cb86dd1d5edf50"
integrity sha512-NzfpbxW/NPrzZ/yYSoQxyqUZMZXIdCfE0OIN4ESsnptHJECoUk3FZktxNuzQf4tjt5UEopnxpYJbvYuxIFDdsg==
dependencies:
character-entities "^1.0.0"
character-entities-legacy "^1.0.0"
character-reference-invalid "^1.0.0"
is-alphanumerical "^1.0.0"
is-decimal "^1.0.0"
is-hexadecimal "^1.0.0"

parse-entities@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8"
Expand Down Expand Up @@ -25202,17 +25190,17 @@ printf@^0.5.1:
resolved "https://registry.yarnpkg.com/printf/-/printf-0.5.3.tgz#8b7eec278d886833312238b2bf42b2b6f250880a"
integrity sha512-t3lYN6vPU5PZXDiEZZqoyXvN8wCsBfi8gPoxTKo2e5hhV673t/KUh+mfO8P8lCOCDC/BWcOGIxKyebxc5FuqLA==

[email protected], prismjs@^1.8.4:
[email protected]:
version "1.20.0"
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.20.0.tgz#9b685fc480a3514ee7198eac6a3bf5024319ff03"
integrity sha512-AEDjSrVNkynnw6A+B1DsFkd6AVdTnp+/WoUixFRULlCLZVRZlVQMVWio/16jv7G1FscUxQxOQhWwApgbnxr6kQ==
optionalDependencies:
clipboard "^2.0.0"

prismjs@~1.17.0:
version "1.17.1"
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.17.1.tgz#e669fcbd4cdd873c35102881c33b14d0d68519be"
integrity sha512-PrEDJAFdUGbOP6xK/UsfkC5ghJsPJviKgnQOoxaDbBjwc8op68Quupwt1DeAFoG8GImPhiKXAvvsH7wDSLsu1Q==
prismjs@^1.21.0, prismjs@~1.21.0:
version "1.21.0"
resolved "https://registry.yarnpkg.com/prismjs/-/prismjs-1.21.0.tgz#36c086ec36b45319ec4218ee164c110f9fc015a3"
integrity sha512-uGdSIu1nk3kej2iZsLyDoJ7e9bnPzIgY0naW/HdknGj61zScaprVEVGHrPoXqI+M9sP0NDnTK2jpkvmldpuqDw==
optionalDependencies:
clipboard "^2.0.0"

Expand Down Expand Up @@ -26479,16 +26467,16 @@ react-sizeme@^2.5.2, react-sizeme@^2.6.7:
shallowequal "^1.1.0"
throttle-debounce "^2.1.0"

react-syntax-highlighter@^12.2.1:
version "12.2.1"
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-12.2.1.tgz#14d78352da1c1c3f93c6698b70ec7c706b83493e"
integrity sha512-CTsp0ZWijwKRYFg9xhkWD4DSpQqE4vb2NKVMdPAkomnILSmsNBHE0n5GuI5zB+PU3ySVvXvdt9jo+ViD9XibCA==
react-syntax-highlighter@^13.5.0:
version "13.5.0"
resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-13.5.0.tgz#c0f3fd826a52b2a6ce5786d4ce60c3e0665b65c0"
integrity sha512-2nKo8spFxe9shcjbdUiqxkrf/IMDqKUZLx7JVIxEJ17P+fYFGL4CRsZZC66UPeQ2o/f29eKu31CrkKGCK1RHuA==
dependencies:
"@babel/runtime" "^7.3.1"
highlight.js "~9.15.1"
lowlight "1.12.1"
prismjs "^1.8.4"
refractor "^2.4.1"
highlight.js "^10.1.1"
lowlight "^1.14.0"
prismjs "^1.21.0"
refractor "^3.1.0"

react-test-renderer@^16.0.0-0, react-test-renderer@^16.8.3:
version "16.13.1"
Expand Down Expand Up @@ -26897,14 +26885,14 @@ reflect.ownkeys@^0.2.0:
resolved "https://registry.yarnpkg.com/reflect.ownkeys/-/reflect.ownkeys-0.2.0.tgz#749aceec7f3fdf8b63f927a04809e90c5c0b3460"
integrity sha1-dJrO7H8/34tj+SegSAnpDFwLNGA=

refractor@^2.4.1:
version "2.10.1"
resolved "https://registry.yarnpkg.com/refractor/-/refractor-2.10.1.tgz#166c32f114ed16fd96190ad21d5193d3afc7d34e"
integrity sha512-Xh9o7hQiQlDbxo5/XkOX6H+x/q8rmlmZKr97Ie1Q8ZM32IRRd3B/UxuA/yXDW79DBSXGWxm2yRTbcTVmAciJRw==
refractor@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/refractor/-/refractor-3.1.0.tgz#b05a43c8a1b4fccb30001ffcbd5cd781f7f06f78"
integrity sha512-bN8GvY6hpeXfC4SzWmYNQGLLF2ZakRDNBkgCL0vvl5hnpMrnyURk8Mv61v6pzn4/RBHzSWLp44SzMmVHqMGNww==
dependencies:
hastscript "^5.0.0"
parse-entities "^1.1.2"
prismjs "~1.17.0"
parse-entities "^2.0.0"
prismjs "~1.21.0"

regenerate-unicode-properties@^8.2.0:
version "8.2.0"
Expand Down