storybook-addon-playground
Version:
A playground to enable consumers learn how to use the component library or to reproduce bugs
24 lines (21 loc) • 987 B
JavaScript
import React__default from 'react';
import PlaygroundPreview from '../components/PlaygroundPreview/PlaygroundPreview.js';
import '@storybook/manager-api';
import '@codemirror/commands';
import 'prettier';
import 'prettier/parser-html';
import 'prettier/parser-typescript';
import 'prettier/parser-postcss';
import 'lz-string';
import '@storybook/addon-links';
import usePlaygroundPreviewCode from '../hooks/usePlaygroundPreviewCode.js';
import '@uiw/codemirror-theme-github';
import { LiveProvider } from 'react-live';
const withPlayground = (_Story, { parameters }) => {
const code = usePlaygroundPreviewCode();
const playgroundParameters = parameters.playground;
return (React__default.createElement(LiveProvider, { code: code.jsx || "<></>", scope: playgroundParameters.components, enableTypeScript: true },
React__default.createElement(PlaygroundPreview, { css: code.css })));
};
export { withPlayground as default };
//# sourceMappingURL=withPlayground.js.map