diff --git a/examples/example.mdx b/examples/example.mdx index 3a93950..ba5fb61 100644 --- a/examples/example.mdx +++ b/examples/example.mdx @@ -109,6 +109,10 @@ function Code({ children, language, inline = false }) { --- +{require('raw-loader!./assets/codeExample.txt')} + +--- + --- diff --git a/patches/@mdx-deck+gatsby-plugin+4.1.1.patch b/patches/@mdx-deck+gatsby-plugin+4.1.1.patch deleted file mode 100644 index 71f1a1d..0000000 --- a/patches/@mdx-deck+gatsby-plugin+4.1.1.patch +++ /dev/null @@ -1,45 +0,0 @@ -diff --git a/node_modules/@mdx-deck/gatsby-plugin/.eslintrc b/node_modules/@mdx-deck/gatsby-plugin/.eslintrc -new file mode 100644 -index 0000000..e69de29 -diff --git a/node_modules/@mdx-deck/gatsby-plugin/src/keyboard.js b/node_modules/@mdx-deck/gatsby-plugin/src/keyboard.js -index 4c65c76..2b92f82 100644 ---- a/node_modules/@mdx-deck/gatsby-plugin/src/keyboard.js -+++ b/node_modules/@mdx-deck/gatsby-plugin/src/keyboard.js -@@ -16,18 +16,24 @@ const keys = { - pageDown: 34, - } - -+const inputElements = ['input', 'select', 'textarea', 'a', 'button'] -+ - export const useKeyboard = () => { - const context = useDeck() - - React.useEffect(() => { - const handleKeyDown = e => { -- if (e.metaKey) return -- if (e.ctrlKey) return -+ const { metaKey, ctrlKey, shiftKey, altKey } = e -+ if (metaKey || ctrlKey) return -+ -+ // ignore custom keyboard shortcuts when elements are focused -+ const el = document.activeElement.tagName.toLowerCase() -+ if (inputElements.includes(el)) return - -- if (e.altKey) { -+ if (altKey) { - switch (e.keyCode) { - case keys.p: -- if (e.shiftKey) { -+ if (shiftKey) { - context.toggleMode(modes.print) - } else { - context.toggleMode(modes.presenter) -@@ -42,7 +48,7 @@ export const useKeyboard = () => { - default: - break - } -- } else if (e.shiftKey) { -+ } else if (shiftKey) { - switch (e.keyCode) { - case keys.space: - e.preventDefault()