Skip to content

Commit

Permalink
fix(docz): use playground from docz-components
Browse files Browse the repository at this point in the history
  • Loading branch information
rakannimer committed Aug 31, 2019
1 parent f35f3ca commit 52874c4
Show file tree
Hide file tree
Showing 3 changed files with 149 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/docz/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"@mdx-js/react": "^1.0.27",
"array-sort": "^1.0.0",
"capitalize": "^2.0.0",
"docz-components": "^2.0.0-rc.9",
"docz-core": "2.0.0-rc.6",
"fast-deep-equal": "^2.0.1",
"gatsby": "^2.13.27",
Expand Down
40 changes: 40 additions & 0 deletions core/docz/src/components/Playground.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import * as React from 'react'
import { ComponentType, SFC } from 'react'
import { Playground as DoczPlayground } from 'docz-components'
import { useConfig } from '../hooks/useConfig'

export interface PlaygroundProps {
className?: string
style?: any
wrapper?: ComponentType<any>
children: any
__scope: Record<string, any>
__position: number
__code: string
}

export const Playground: SFC<PlaygroundProps> = ({
className,
style,
wrapper: Wrapper,
__scope,
__position,
__code,
}) => {
const {
themeConfig: { showPlaygroundEditor, showLiveError },
} = useConfig()

return (
<DoczPlayground
className={className}
style={style}
wrapper={Wrapper}
scope={__scope}
position={__position}
code={__code}
showPlaygroundEditor={showPlaygroundEditor}
showLiveError={showLiveError}
/>
)
}
108 changes: 108 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1455,6 +1455,16 @@
"@emotion/utils" "0.11.2"
"@emotion/weak-memoize" "0.2.3"

"@emotion/cache@^10.0.15":
version "10.0.15"
resolved "https://registry.npmjs.org/@emotion/cache/-/cache-10.0.15.tgz#b81767b48015aae2689c60373992145c67b8de02"
integrity sha512-8VthgeKhlGeTXSW1JN7I14AnAaiFPbOrqNqg3dPoGCZ3bnMjkrmRU0zrx0BtBw9esBaPaQgDB9y0tVgAGT2Mrg==
dependencies:
"@emotion/sheet" "0.9.3"
"@emotion/stylis" "0.8.4"
"@emotion/utils" "0.11.2"
"@emotion/weak-memoize" "0.2.3"

"@emotion/core@^10.0.14":
version "10.0.14"
resolved "https://registry.npmjs.org/@emotion/core/-/core-10.0.14.tgz#cac5c334b278d5b7688cfff39e460a5b50abb71c"
Expand All @@ -1467,6 +1477,18 @@
"@emotion/sheet" "0.9.3"
"@emotion/utils" "0.11.2"

"@emotion/core@^10.0.16":
version "10.0.16"
resolved "https://registry.npmjs.org/@emotion/core/-/core-10.0.16.tgz#e43630b65c84e31e81f34db3286eab584b08cfaa"
integrity sha512-whbiiA7FfPreBY4BqWky2qRfAZvq+4dKQ1WNJuiYQwPCNmb0pEYDgNheSbZoNKtGTtfPaM28hBbZAKWD5EZXmQ==
dependencies:
"@babel/runtime" "^7.4.3"
"@emotion/cache" "^10.0.15"
"@emotion/css" "^10.0.14"
"@emotion/serialize" "^0.11.9"
"@emotion/sheet" "0.9.3"
"@emotion/utils" "0.11.2"

"@emotion/css@^10.0.14":
version "10.0.14"
resolved "https://registry.npmjs.org/@emotion/css/-/css-10.0.14.tgz#95dacabdd0e22845d1a1b0b5968d9afa34011139"
Expand Down Expand Up @@ -1548,6 +1570,17 @@
"@emotion/utils" "0.11.2"
csstype "^2.5.7"

"@emotion/serialize@^0.11.9":
version "0.11.9"
resolved "https://registry.npmjs.org/@emotion/serialize/-/serialize-0.11.9.tgz#123e0f51d2dee9693fae1057bd7fc27b021d6868"
integrity sha512-/Cn4V81z3ZyFiDQRw8nhGFaHkxHtmCSSBUit4vgTuLA1BqxfJUYiqSq97tq/vV8z9LfIoqs6a9v6QrUFWZpK7A==
dependencies:
"@emotion/hash" "0.7.2"
"@emotion/memoize" "0.7.2"
"@emotion/unitless" "0.7.4"
"@emotion/utils" "0.11.2"
csstype "^2.5.7"

"@emotion/sheet@0.9.3":
version "0.9.3"
resolved "https://registry.npmjs.org/@emotion/sheet/-/sheet-0.9.3.tgz#689f135ecf87d3c650ed0c4f5ddcbe579883564a"
Expand Down Expand Up @@ -3559,6 +3592,11 @@
resolved "https://registry.npmjs.org/@mdx-js/react/-/react-1.0.27.tgz#7461e39f8880eceff8f48b0240e6cdc0f01cc8db"
integrity sha512-sCv3ItE5L6rdpnZR0s69C8KFgz4pmhGsH4de0ZiO+fiCC/L6asuKLubf9QZk3oG3vjebym/V593CE15vRXvvwQ==

"@mdx-js/react@^1.4.0":
version "1.4.0"
resolved "https://registry.npmjs.org/@mdx-js/react/-/react-1.4.0.tgz#b389684b4b5fbfb6770a6cc0d620fca82b8a8549"
integrity sha512-UHPG74qvLM8wO+evIKzNQqSw3PzgPei4oEFPuFGee15rK0cYNDKL+utzQLM1Ngv2gmjU/WN9BYrpJxyFh8xOCg==

"@mikaelkristiansson/domready@^1.0.9":
version "1.0.9"
resolved "https://registry.npmjs.org/@mikaelkristiansson/domready/-/domready-1.0.9.tgz#b2b85d8ac7bb2797e577050b61aeaf1b26fbd906"
Expand Down Expand Up @@ -3766,6 +3804,11 @@
resolved "https://registry.npmjs.org/@stefanprobst/lokijs/-/lokijs-1.5.6-b.tgz#6a36a86dbe132e702e6b15ffd3ce4139aebfe942"
integrity sha512-MNodHp46og+Sdde/LCxTLrxcD5Dimu21R/Fer2raXMG1XtHSV2+vZnkIV87OPAxuf2NiDj1W5hN7Q2MYUfQQ8w==

"@styled-system/css@^5.0.16":
version "5.0.23"
resolved "https://registry.npmjs.org/@styled-system/css/-/css-5.0.23.tgz#35ad4f34fe0fec9b011a5468ac0821f12f5e4b1a"
integrity sha512-yC3S0Iox8OTPAyrP1t5yY9nURUICcUdhVYOkwffftuxa5+txxI4qkT2e9JNCc2aaem+DG8mlXTdnYefjqge5wg==

"@styled-system/css@^5.0.5":
version "5.0.5"
resolved "https://registry.npmjs.org/@styled-system/css/-/css-5.0.5.tgz#b393528dda0d81a5cb5a2bbd69e8295eaea45124"
Expand Down Expand Up @@ -4084,6 +4127,30 @@
resolved "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e"
integrity sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==

"@types/styled-system@*":
version "5.1.1"
resolved "https://registry.npmjs.org/@types/styled-system/-/styled-system-5.1.1.tgz#22eff9e4b2f89cd2222c15053f8c11be5ec9c357"
integrity sha512-RAF9Erif51vbD1ZbIiGN4ZrgxpSr44iMXrPjQK5+tI7PWLDugKepTWj7T/LqG5VfaYYIrEmOCzIpulhv+/D/XQ==
dependencies:
csstype "^2.6.4"

"@types/styled-system__css@*":
version "5.0.4"
resolved "https://registry.npmjs.org/@types/styled-system__css/-/styled-system__css-5.0.4.tgz#df83b015cf377ab39ecf33ea31339c05eeb9230a"
integrity sha512-SHHoNh9cCRTG9hcmCD2ua0NeYUrLmLXoMJ7g0U/e0FjrzcwNQtM5wjjEJVCVZymU632xA1PdPEykrtoSHTIecA==
dependencies:
csstype "^2.6.6"

"@types/theme-ui@^0.2.2":
version "0.2.2"
resolved "https://registry.npmjs.org/@types/theme-ui/-/theme-ui-0.2.2.tgz#06c8e51bf231ce643f7ce859d6309d104e18a4d9"
integrity sha512-c6kGvo8GeLGw92nbH3jGCzJHmJQ838fwo4Pst7WoYkUwOar2fIDCW70DRdW+mFXrvA1l1jPUY0bwYwwjXFjhZA==
dependencies:
"@types/react" "*"
"@types/styled-system" "*"
"@types/styled-system__css" "*"
csstype "^2.6.6"

"@types/tmp@^0.0.32":
version "0.0.32"
resolved "https://registry.npmjs.org/@types/tmp/-/tmp-0.0.32.tgz#0d3cb31022f8427ea58c008af32b80da126ca4e3"
Expand Down Expand Up @@ -7891,6 +7958,11 @@ csstype@^2.5.7:
resolved "https://registry.npmjs.org/csstype/-/csstype-2.6.5.tgz#1cd1dff742ebf4d7c991470ae71e12bb6751e034"
integrity sha512-JsTaiksRsel5n7XwqPAfB0l3TFKdpjW/kgAELf9vrb5adGA7UCPLajKK5s3nFrcFm3Rkyp/Qkgl73ENc1UY3cA==

csstype@^2.6.4, csstype@^2.6.6:
version "2.6.6"
resolved "https://registry.npmjs.org/csstype/-/csstype-2.6.6.tgz#c34f8226a94bbb10c32cc0d714afdf942291fc41"
integrity sha512-RpFbQGUE74iyPgvr46U9t1xoQBM8T4BL8SxrN66Le2xYAPSaDJJKeztV3awugusb3g3G9iL8StmkBBXhcbbXhg==

currently-unhandled@^0.4.1:
version "0.4.1"
resolved "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea"
Expand Down Expand Up @@ -14406,6 +14478,11 @@ lockfile@^1.0.4:
dependencies:
signal-exit "^3.0.2"

lodash-es@^4.17.15:
version "4.17.15"
resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.15.tgz#21bd96839354412f23d7a10340e5eac6ee455d78"
integrity sha512-rlrc3yU3+JNOpZ9zj5pQtxnx2THmvRykwL4Xlxoa8I9lHBlVbbyPhgyPMioxVZ4NqyxaVVtaJnzsyOidQIhyyQ==

lodash._reinterpolate@^3.0.0, lodash._reinterpolate@~3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz#0ccf2d89166af03b3663c796538b75ac6e114d9d"
Expand Down Expand Up @@ -17931,6 +18008,13 @@ re-resizable@^5.0.1:
dependencies:
fast-memoize "^2.5.1"

re-resizable@^6.0.0:
version "6.0.0"
resolved "https://registry.npmjs.org/re-resizable/-/re-resizable-6.0.0.tgz#84258f098b0dde214a39ca6d9ca9959aeefbc26d"
integrity sha512-RTrnhbGgYyZ4hTc6db4JeMnRfmloEPWtuYaXZEa2PRaEC4mreWNFnZtMVsHil3z3iX+WchD+da8BLlTJBcstMA==
dependencies:
fast-memoize "^2.5.1"

react-ace@^7.0.2:
version "7.0.2"
resolved "https://registry.npmjs.org/react-ace/-/react-ace-7.0.2.tgz#bbb6ec12b97c9928a0696484bf4820f8b94f8114"
Expand Down Expand Up @@ -18101,6 +18185,20 @@ react-live@^2.1.2:
react-simple-code-editor "^0.9.0"
unescape "^0.2.0"

react-live@^2.2.0:
version "2.2.0"
resolved "https://registry.npmjs.org/react-live/-/react-live-2.2.0.tgz#538dfb34c614dcdda98845716372129adf59fdef"
integrity sha512-Ebbqz2hJGdC0OisXk1XbJ5gb3M3xn7ZdaheisVVFCbivM901Pixy12k1tqBTLoMYjlY2wGAGwgDBTE63Lqaweg==
dependencies:
buble "0.19.6"
core-js "^2.4.1"
create-react-context "0.2.2"
dom-iterator "^1.0.0"
prism-react-renderer "^0.1.0"
prop-types "^15.5.8"
react-simple-code-editor "^0.9.0"
unescape "^0.2.0"

react-native-web@^0.11.5:
version "0.11.5"
resolved "https://registry.npmjs.org/react-native-web/-/react-native-web-0.11.5.tgz#adf2eff902fdb32e86be7877294d9a6bb0ad3815"
Expand Down Expand Up @@ -20761,6 +20859,16 @@ theme-ui@^0.2.14:
deepmerge "^3.2.0"
react "^16.8.0"

theme-ui@^0.2.38:
version "0.2.38"
resolved "https://registry.npmjs.org/theme-ui/-/theme-ui-0.2.38.tgz#7d294b6bf8b5bae27e36cccb41c0eca60309f0c9"
integrity sha512-nPjZlDyRISPu1EYlYHOUT5IKFd22cSEg3i2Kr9EH/mbtD3ezTAqAdE7SKzjUe9tFyagJ9y0UbY/tUI+SENu8wQ==
dependencies:
"@emotion/is-prop-valid" "^0.8.1"
"@styled-system/css" "^5.0.16"
deepmerge "^4.0.0"
react "^16.8.0"

thenify-all@^1.0.0:
version "1.6.0"
resolved "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
Expand Down

0 comments on commit 52874c4

Please sign in to comment.