Issue 660: CodeSnippet Reuseable component (#803)
* Initial CodeSnippet setup in Storybook * Add support for line numbers * Pseudo-code some basic tests and leverage useTheme hook The test suite cannot currently be run, as the react-syntax-highlighter appears to be using ESM, which are not supported by Jest out-of-the-box. This should only require a simple Babel loader to remedy, but I want to make sure first that I have not misconfigured something, as configuring Babel is likely a notable scope increase for this relatively small issue. * Fix ESM Jest issue and update tests It would be ideal to have snapshot tests to cover the lightmode vs darkmode rendering. I started experimenting with directly testing the styling, and it quickly became very sloppy. * Provide more examples in stories * Add showLineNumbers to PropType validation
This commit is contained in:
@@ -10907,6 +10907,11 @@ highlight.js@~9.13.0:
|
||||
resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-9.13.1.tgz#054586d53a6863311168488a0f58d6c505ce641e"
|
||||
integrity sha512-Sc28JNQNDzaH6PORtRLMvif9RSn1mYuOoX3omVjnb0+HbpPygU2ALBI0R/wsiqCb4/fcp07Gdo8g+fhtFrQl6A==
|
||||
|
||||
highlight.js@~9.15.0, highlight.js@~9.15.1:
|
||||
version "9.15.10"
|
||||
resolved "https://registry.npmjs.org/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2"
|
||||
integrity sha512-RoV7OkQm0T3os3Dd2VHLNMoaoDVx77Wygln3n9l5YV172XonWG6rgQD3XnF/BuFFZw9A0TJgmMSO8FEWQgvcXw==
|
||||
|
||||
history@^4.9.0:
|
||||
version "4.10.1"
|
||||
resolved "https://registry.npmjs.org/history/-/history-4.10.1.tgz#33371a65e3a83b267434e2b3f3b1b4c58aad4cf3"
|
||||
@@ -14141,6 +14146,14 @@ lowercase-keys@^1.0.0:
|
||||
resolved "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz#6f9e30b47084d971a7c820ff15a6c5167b74c26f"
|
||||
integrity sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==
|
||||
|
||||
lowlight@1.12.1:
|
||||
version "1.12.1"
|
||||
resolved "https://registry.npmjs.org/lowlight/-/lowlight-1.12.1.tgz#014acf8dd73a370e02ff1cc61debcde3bb1681eb"
|
||||
integrity sha512-OqaVxMGIESnawn+TU/QMV5BJLbUghUfjDWPAtFqDYDmDtr4FnB+op8xM+pR7nKlauHNUHXGt0VgWatFB8voS5w==
|
||||
dependencies:
|
||||
fault "^1.0.2"
|
||||
highlight.js "~9.15.0"
|
||||
|
||||
lowlight@~1.11.0:
|
||||
version "1.11.0"
|
||||
resolved "https://registry.npmjs.org/lowlight/-/lowlight-1.11.0.tgz#1304d83005126d4e8b1dc0f07981e9b689ec2efc"
|
||||
@@ -17923,6 +17936,17 @@ react-syntax-highlighter@^11.0.2:
|
||||
prismjs "^1.8.4"
|
||||
refractor "^2.4.1"
|
||||
|
||||
react-syntax-highlighter@^12.2.1:
|
||||
version "12.2.1"
|
||||
resolved "https://registry.npmjs.org/react-syntax-highlighter/-/react-syntax-highlighter-12.2.1.tgz#14d78352da1c1c3f93c6698b70ec7c706b83493e"
|
||||
integrity sha512-CTsp0ZWijwKRYFg9xhkWD4DSpQqE4vb2NKVMdPAkomnILSmsNBHE0n5GuI5zB+PU3ySVvXvdt9jo+ViD9XibCA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.3.1"
|
||||
highlight.js "~9.15.1"
|
||||
lowlight "1.12.1"
|
||||
prismjs "^1.8.4"
|
||||
refractor "^2.4.1"
|
||||
|
||||
react-textarea-autosize@^7.1.0:
|
||||
version "7.1.2"
|
||||
resolved "https://registry.npmjs.org/react-textarea-autosize/-/react-textarea-autosize-7.1.2.tgz#70fdb333ef86bcca72717e25e623e90c336e2cda"
|
||||
|
||||
Reference in New Issue
Block a user