Skip to content

Commit 965be2d

Browse files
authored
Merge pull request #24 from zyzo/feat-storybook
feat: storybook, nested targets example
2 parents 927e659 + 2ddc2a6 commit 965be2d

36 files changed

+8182
-46
lines changed

docs/favicon.ico

4.19 KB
Binary file not shown.

docs/iframe.html

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><base target="_parent"><style>:not(.sb-show-main) > .sb-main,
2+
:not(.sb-show-nopreview) > .sb-nopreview,
3+
:not(.sb-show-errordisplay) > .sb-errordisplay {
4+
display: none;
5+
}
6+
7+
.sb-wrapper {
8+
position: fixed;
9+
top: 0;
10+
bottom: 0;
11+
left: 0;
12+
right: 0;
13+
padding: 20px;
14+
font-family: -apple-system, ".SFNSText-Regular", "San Francisco", Roboto, "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
15+
-webkit-font-smoothing: antialiased;
16+
}
17+
18+
.sb-heading {
19+
font-size: 20px;
20+
font-weight: 600;
21+
letter-spacing: 0.2px;
22+
margin: 10px 0;
23+
}
24+
25+
.sb-nopreview {
26+
display: flex;
27+
align-content: center;
28+
justify-content: center;
29+
}
30+
31+
.sb-nopreview_main {
32+
margin: auto;
33+
padding: 30px;
34+
border-radius: 10px;
35+
background: rgba(0,0,0,0.03);
36+
}
37+
38+
.sb-nopreview_heading {
39+
text-align: center;
40+
}
41+
42+
.sb-errordisplay {
43+
background-color: rgb(187, 49, 49);
44+
color: #FFF;
45+
}
46+
47+
.sb-errordisplay_code {
48+
font-size: 14px;
49+
width: 100vw;
50+
overflow: auto;
51+
}</style><script>try {
52+
if (window.parent !== window) {
53+
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
54+
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
55+
}
56+
} catch (e) {
57+
console.warn('unable to connect to parent frame for connecting dev tools');
58+
}</script></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the storybook config.</li><li>Try reloading the page.</li></ul></div></div><div class="sb-errordisplay sb-wrapper"><div id="error-message" class="sb-heading"></div><pre class="sb-errordisplay_code">
59+
<code id="error-stack"></code>
60+
</pre></div><div id="root"></div><script src="runtime~main.85f208740978715ff675.bundle.js"></script><script src="vendors~main.85f208740978715ff675.bundle.js"></script><script src="main.85f208740978715ff675.bundle.js"></script></body></html>

docs/index.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!doctype html><html><head><meta charset="utf-8"><title>Storybook</title><style>html, body {
2+
overflow: hidden;
3+
height: 100%;
4+
width: 100%;
5+
margin: 0;
6+
padding: 0;
7+
}</style><script>try {
8+
if (window.parent !== window) {
9+
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;
10+
window.__VUE_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__VUE_DEVTOOLS_GLOBAL_HOOK__;
11+
}
12+
} catch (e) {
13+
console.warn('unable to connect to parent frame for connecting dev tools');
14+
}</script></head><body><div id="root"></div><script src="./sb_dll/storybook_ui_dll.js"></script><script src="runtime~main.bf7f1bbd18bd2f1ec8df.bundle.js"></script><script src="vendors~main.99ad87f9e3d4577e9b07.bundle.js"></script><script src="main.2dcb9aa617a1e12e1b44.bundle.js"></script></body></html>

docs/main.2dcb9aa617a1e12e1b44.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/main.85f208740978715ff675.bundle.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/main.85f208740978715ff675.bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.85f208740978715ff675.bundle.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.85f208740978715ff675.bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/runtime~main.bf7f1bbd18bd2f1ec8df.bundle.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/sb_dll/storybook_ui-manifest.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

docs/sb_dll/storybook_ui_dll.LICENCE

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/*!
2+
* Programatically add the following
3+
*/
4+
5+
/*! VelocityJS.org (1.5.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
6+
7+
/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
8+
9+
/*! VelocityJS.org (1.5.2). (C) 2014 Julian Shapiro. MIT @license: en.wikipedia.org/wiki/MIT_License */
10+
11+
/*! VelocityJS.org jQuery Shim (1.0.1). (C) 2014 The jQuery Foundation. MIT @license: en.wikipedia.org/wiki/MIT_License. */
12+
13+
/*!
14+
* https://github.com/es-shims/es5-shim
15+
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
16+
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
17+
*/
18+
19+
/*!
20+
* Adapted from jQuery UI core
21+
*
22+
* http://jqueryui.com
23+
*
24+
* Copyright 2014 jQuery Foundation and other contributors
25+
* Released under the MIT license.
26+
* http://jquery.org/license
27+
*
28+
* http://api.jqueryui.com/category/ui-core/
29+
*/
30+
31+
/*!
32+
Copyright (c) 2017 Jed Watson.
33+
Licensed under the MIT License (MIT), see
34+
http://jedwatson.github.io/classnames
35+
*/
36+
37+
/*!
38+
Copyright (c) 2017 Jed Watson.
39+
Licensed under the MIT License (MIT), see
40+
http://jedwatson.github.io/classnames
41+
*/
42+
43+
/*!
44+
* https://github.com/es-shims/es5-shim
45+
* @license es5-shim Copyright 2009-2015 by contributors, MIT License
46+
* see https://github.com/es-shims/es5-shim/blob/master/LICENSE
47+
*/
48+
49+
/*!
50+
* https://github.com/paulmillr/es6-shim
51+
* @license es6-shim Copyright 2013-2016 by Paul Miller (http://paulmillr.com)
52+
* and contributors, MIT License
53+
* es6-shim: v0.35.4
54+
* see https://github.com/paulmillr/es6-shim/blob/0.35.3/LICENSE
55+
* Details and documentation:
56+
* https://github.com/paulmillr/es6-shim/
57+
*/
58+
59+
/** @license React v16.7.0
60+
* react.production.min.js
61+
*
62+
* Copyright (c) Facebook, Inc. and its affiliates.
63+
*
64+
* This source code is licensed under the MIT license found in the
65+
* LICENSE file in the root directory of this source tree.
66+
*/
67+
68+
/** @license React v0.11.3
69+
* scheduler.production.min.js
70+
*
71+
* Copyright (c) Facebook, Inc. and its affiliates.
72+
*
73+
* This source code is licensed under the MIT license found in the
74+
* LICENSE file in the root directory of this source tree.
75+
*/
76+
77+
/*
78+
object-assign
79+
(c) Sindre Sorhus
80+
@license MIT
81+
*/
82+
83+
/*!
84+
* Fuse.js v3.3.0 - Lightweight fuzzy-search (http://fusejs.io)
85+
*
86+
* Copyright (c) 2012-2017 Kirollos Risk (http://kiro.me)
87+
* All Rights Reserved. Apache Software License 2.0
88+
*
89+
* http://www.apache.org/licenses/LICENSE-2.0
90+
*/
91+
92+
/*!
93+
Copyright (c) 2015 Jed Watson.
94+
Based on code that is Copyright 2013-2015, Facebook, Inc.
95+
All rights reserved.
96+
*/
97+
98+
/*!
99+
Copyright (c) 2015 Jed Watson.
100+
Based on code that is Copyright 2013-2015, Facebook, Inc.
101+
All rights reserved.
102+
*/
103+
104+
/** @license React v16.7.0
105+
* react-dom.production.min.js
106+
*
107+
* Copyright (c) Facebook, Inc. and its affiliates.
108+
*
109+
* This source code is licensed under the MIT license found in the
110+
* LICENSE file in the root directory of this source tree.
111+
*/

docs/sb_dll/storybook_ui_dll.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/vendors~main.85f208740978715ff675.bundle.js

Lines changed: 39 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/vendors~main.85f208740978715ff675.bundle.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/vendors~main.99ad87f9e3d4577e9b07.bundle.js

Lines changed: 136 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/.babelrc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
{
2-
"presets": ["es2015", "react"],
3-
"plugins": [
4-
"transform-es2015-function-name",
5-
"transform-es2015-arrow-functions",
6-
"transform-es2015-parameters",
7-
["transform-es2015-destructuring", { "loose": true }],
8-
"transform-es2015-block-scoping",
9-
"transform-object-rest-spread"
10-
],
11-
"env": {
12-
"development": {
13-
"presets": ["react-hmre"]
14-
}
15-
}
2+
"presets": ["@babel/preset-env", "@babel/preset-react"],
3+
"plugins": []
164
}

example/.storybook/addons.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '@storybook/addon-options/register';

example/.storybook/config.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { withOptions } from '@storybook/addon-options';
2+
import { addDecorator, configure } from '@storybook/react';
3+
4+
addDecorator(
5+
withOptions({
6+
name: 'Mouse Backend for react-dnd',
7+
showAddonPanel: false,
8+
})
9+
)
10+
// automatically import all files ending in *.stories.js
11+
const req = require.context('../stories', true, /.stories.js$/);
12+
function loadStories() {
13+
req.keys().forEach(filename => req(filename));
14+
}
15+
16+
configure(loadStories, module);

example/.storybook/webpack.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// you can use this file to add your custom webpack plugins, loaders and anything you like.
2+
// This is just the basic way to add additional webpack configurations.
3+
// For more information refer the docs: https://storybook.js.org/configurations/custom-webpack-config
4+
5+
// IMPORTANT
6+
// When you add this file, we won't add the default configurations which is similar
7+
// to "React Create App". This only has babel loader to load JavaScript.
8+
9+
module.exports = {
10+
plugins: [
11+
// your custom plugins
12+
],
13+
module: {
14+
rules: [
15+
// add your custom rules.
16+
],
17+
},
18+
};

0 commit comments

Comments
 (0)