diff --git a/packages/components/src/AspectRatioSlide.js b/packages/components/src/AspectRatioSlide.js index 2a7c71d..a5378e3 100644 --- a/packages/components/src/AspectRatioSlide.js +++ b/packages/components/src/AspectRatioSlide.js @@ -1,4 +1,4 @@ -import React, { useContext } from 'react' +import React from 'react' import styled from '@emotion/styled' import FluidFontSize from './FluidFontSize' import useTheme from './useTheme' diff --git a/packages/components/src/Embed.js b/packages/components/src/Embed.js index 3b8bb57..7fdb63e 100644 --- a/packages/components/src/Embed.js +++ b/packages/components/src/Embed.js @@ -21,41 +21,65 @@ import { jsx } from '@emotion/core' import Provider from './Provider' import Slide from './Slide' import GoogleFonts from './GoogleFonts' -import Ratio from './Ratio' import splitSlides from './splitSlides' +// fix for regression in gatsby-theme +import merge from 'lodash.merge' +import defaultTheme from '@mdx-deck/themes/base' + const Placeholder = ({ index }) => (
not found: slide {index}
) +// fix for regression in gatsby-theme +const mergeThemes = themes => + themes.reduce( + (acc, theme) => + typeof theme === 'function' ? theme(acc) : merge(acc, theme), + {} + ) + const wrapper = props => { - const { slides, theme, themes, ratio, zoom } = splitSlides(props) + const { slides, theme: baseTheme, themes, ratio, zoom } = splitSlides(props) + // fix for regression in gatsby-theme + const theme = mergeThemes([ + defaultTheme, + baseTheme, + ...themes, + { + aspectRatio: ratio, + Slide: { + maxWidth: '100%', + height: 'auto', + }, + }, + ]) const Content = slides[props.slide - 1] || Placeholder return ( - + - - - - - + + + ) } -export const Embed = ({ src: Deck, slide = 1, ratio = 9 / 16, zoom = 1 }) => ( - +export const Embed = ({ + src: Deck, + slide = 1, + ratio = 16 / 9, + zoom = 1, + ...props +}) => ( + ) export default Embed diff --git a/packages/components/src/MDXDeck.js b/packages/components/src/MDXDeck.js index 89827b2..8f97207 100644 --- a/packages/components/src/MDXDeck.js +++ b/packages/components/src/MDXDeck.js @@ -1,7 +1,6 @@ -import React, { useContext, useReducer, useMemo } from 'react' +import React, { useContext, useReducer } from 'react' import PropTypes from 'prop-types' import { Router, globalHistory, navigate } from '@reach/router' -import { Global } from '@emotion/core' import { Swipeable } from 'react-swipeable' import merge from 'lodash.merge' import defaultTheme from '@mdx-deck/themes/base' @@ -97,7 +96,6 @@ export const MDXDeck = props => { return Grid default: return BaseWrapper - break } } diff --git a/packages/components/src/Notes.js b/packages/components/src/Notes.js index c278d4c..d5a83f9 100644 --- a/packages/components/src/Notes.js +++ b/packages/components/src/Notes.js @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react' +import { useEffect } from 'react' import { useDeck } from './context' export const Notes = props => { diff --git a/packages/components/src/Presenter.js b/packages/components/src/Presenter.js index eca4fb9..aa7a860 100644 --- a/packages/components/src/Presenter.js +++ b/packages/components/src/Presenter.js @@ -7,7 +7,6 @@ import Clock from './Clock' export const Presenter = props => { const { slides, metadata, index } = props - const Current = slides[index] const Next = slides[index + 1] const { notes } = metadata[index] || {} diff --git a/packages/components/src/Steps.js b/packages/components/src/Steps.js index 75c9012..1228e39 100644 --- a/packages/components/src/Steps.js +++ b/packages/components/src/Steps.js @@ -1,5 +1,3 @@ -import React from 'react' -import { useDeck } from './context' import useSteps from './useSteps' export const Steps = props => { diff --git a/packages/gatsby-theme/README.md b/packages/gatsby-theme/README.md index 3e72368..b92c747 100644 --- a/packages/gatsby-theme/README.md +++ b/packages/gatsby-theme/README.md @@ -11,7 +11,7 @@ _Note:_ This theme **requires MDX v1** and will not work with previous versions ```js // gatsby-config.js module.exports = { - __experimentalThemes: ['@mdx-deck/gatsby-theme'], + plugins: ['@mdx-deck/gatsby-theme'], } ``` @@ -50,7 +50,7 @@ The following options can be passed to the gatsby theme. ```js // gatsby-config.js module.exports = { - __experimentalThemes: [ + plugins: [ { resolve: '@mdx-deck/gatsby-theme', options: { diff --git a/packages/gatsby-theme/src/decks/hello.mdx b/packages/gatsby-theme/src/decks/hello.mdx index da408af..ea1c4a2 100644 --- a/packages/gatsby-theme/src/decks/hello.mdx +++ b/packages/gatsby-theme/src/decks/hello.mdx @@ -22,7 +22,7 @@ This is the MDX Deck Gatsby theme ```js // gatsby-config.js module.exports = { - __experimentalThemes: [ + plugins: [ '@mdx-deck/gatsby-theme', ] } diff --git a/packages/gatsby-theme/src/layouts/footer.js b/packages/gatsby-theme/src/layouts/footer.js deleted file mode 100644 index d060da7..0000000 --- a/packages/gatsby-theme/src/layouts/footer.js +++ /dev/null @@ -1 +0,0 @@ -export default () => false diff --git a/packages/gatsby-theme/src/layouts/header.js b/packages/gatsby-theme/src/layouts/header.js deleted file mode 100644 index d060da7..0000000 --- a/packages/gatsby-theme/src/layouts/header.js +++ /dev/null @@ -1 +0,0 @@ -export default () => false diff --git a/packages/gatsby-theme/src/layouts/index.js b/packages/gatsby-theme/src/layouts/index.js index bc3a8ac..ba2fc62 100644 --- a/packages/gatsby-theme/src/layouts/index.js +++ b/packages/gatsby-theme/src/layouts/index.js @@ -2,8 +2,6 @@ import React from 'react' import { navigate } from 'gatsby' import { Embed } from '@mdx-deck/components' import Root from './root' -import Header from './header' -import Footer from './footer' const Thumb = props => (
( export default props => ( -
    ( ))}
-