diff --git a/addons/storysource/package.json b/addons/storysource/package.json index 724b1f941940..666db2834dfd 100644 --- a/addons/storysource/package.json +++ b/addons/storysource/package.json @@ -31,7 +31,7 @@ "loader-utils": "^1.1.0", "prettier": "^1.14.3", "prop-types": "^15.6.2", - "react-syntax-highlighter": "^9.0.1" + "react-syntax-highlighter": "^10.0.0" }, "peerDependencies": { "react": "*" diff --git a/addons/storysource/src/StoryPanel.js b/addons/storysource/src/StoryPanel.js index 12fe92532833..ce6365740fb8 100644 --- a/addons/storysource/src/StoryPanel.js +++ b/addons/storysource/src/StoryPanel.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { RoutedLink, monoFonts } from '@storybook/components'; -import jsx from 'react-syntax-highlighter/languages/prism/jsx'; -import { darcula } from 'react-syntax-highlighter/styles/prism'; -import SyntaxHighlighter, { registerLanguage } from 'react-syntax-highlighter/prism-light'; -import { createElement } from 'react-syntax-highlighter'; +import jsx from 'react-syntax-highlighter/dist/esm/languages/prism/jsx'; +import { darcula } from 'react-syntax-highlighter/dist/esm/styles/prism'; +import SyntaxHighlighter from 'react-syntax-highlighter/dist/esm/prism-light'; +import createElement from 'react-syntax-highlighter/dist/esm/create-element'; import { EVENT_ID } from './events'; // TODO: take from theme @@ -29,7 +29,7 @@ const highlighterTheme = { }, }; -registerLanguage('jsx', jsx); +SyntaxHighlighter.registerLanguage('jsx', jsx); const styles = { story: { diff --git a/yarn.lock b/yarn.lock index 824cd62b79bd..da3e0705f2f7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -18402,10 +18402,10 @@ react-style-proptype@^3.0.0: dependencies: prop-types "^15.5.4" -react-syntax-highlighter@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-9.0.1.tgz#cad91692e1976f68290f24762ac3451b1fec3d26" - integrity sha512-rL5wJ0V23arSBahsRs0yhDxEFoA1dRjJ7hK6xKvIi6hd3fUXx950AhjYBQbR05CwYsAIQDWGMhH4Oh/v9XK67g== +react-syntax-highlighter@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-10.0.0.tgz#0908ae3d8436ff54a1322073105141d79f37edb4" + integrity sha512-S6oNKt+m8ZcdDM61YmU7Iv5C5vepyZEDjCKvJIJZk7g4+9X4zlMIHuXbbPijXar1jroIy3bWK08UYrqQ1pP+EQ== dependencies: babel-runtime "^6.18.0" highlight.js "~9.12.0"