@storybook/core-common 6.4.0-beta.9 → 6.4.0-rc.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +26 -0
- package/dist/cjs/presets.js +41 -9
- package/dist/cjs/templates/base-preview-body.html +268 -1
- package/dist/cjs/templates/base-preview-head.html +10 -5
- package/dist/cjs/templates/index.ejs +14 -18
- package/dist/cjs/utils/check-addon-order.js +54 -0
- package/dist/cjs/utils/envs.js +1 -1
- package/dist/cjs/utils/findDistEsm.js +22 -0
- package/dist/cjs/utils/glob-to-regexp.js +5 -5
- package/dist/cjs/utils/normalize-stories.js +27 -15
- package/dist/cjs/utils/paths.js +11 -1
- package/dist/cjs/utils/to-importFn.js +20 -6
- package/dist/cjs/utils/to-require-context.js +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/presets.js +41 -10
- package/dist/esm/templates/base-preview-body.html +268 -1
- package/dist/esm/templates/base-preview-head.html +10 -5
- package/dist/esm/templates/index.ejs +14 -18
- package/dist/esm/utils/check-addon-order.js +45 -0
- package/dist/esm/utils/envs.js +1 -1
- package/dist/esm/utils/findDistEsm.js +8 -0
- package/dist/esm/utils/glob-to-regexp.js +3 -3
- package/dist/esm/utils/normalize-stories.js +20 -12
- package/dist/esm/utils/paths.js +10 -1
- package/dist/esm/utils/to-importFn.js +17 -6
- package/dist/esm/utils/to-require-context.js +2 -2
- package/dist/modern/index.js +2 -0
- package/dist/modern/presets.js +41 -10
- package/dist/modern/templates/base-preview-body.html +268 -1
- package/dist/modern/templates/base-preview-head.html +10 -5
- package/dist/modern/templates/index.ejs +14 -18
- package/dist/modern/utils/check-addon-order.js +45 -0
- package/dist/modern/utils/envs.js +1 -1
- package/dist/modern/utils/findDistEsm.js +8 -0
- package/dist/modern/utils/glob-to-regexp.js +3 -3
- package/dist/modern/utils/normalize-stories.js +20 -12
- package/dist/modern/utils/paths.js +10 -1
- package/dist/modern/utils/to-importFn.js +17 -6
- package/dist/modern/utils/to-require-context.js +2 -2
- package/dist/ts3.4/index.d.ts +2 -0
- package/dist/ts3.4/types.d.ts +72 -5
- package/dist/ts3.4/utils/check-addon-order.d.ts +16 -0
- package/dist/ts3.4/utils/findDistEsm.d.ts +1 -0
- package/dist/ts3.4/utils/glob-to-regexp.d.ts +1 -1
- package/dist/ts3.4/utils/normalize-stories.d.ts +3 -0
- package/dist/ts3.4/utils/paths.d.ts +4 -0
- package/dist/ts3.4/utils/to-importFn.d.ts +1 -0
- package/dist/ts3.9/index.d.ts +2 -0
- package/dist/ts3.9/types.d.ts +72 -5
- package/dist/ts3.9/utils/check-addon-order.d.ts +16 -0
- package/dist/ts3.9/utils/es6Transpiler.d.ts +1 -1
- package/dist/ts3.9/utils/findDistEsm.d.ts +1 -0
- package/dist/ts3.9/utils/glob-to-regexp.d.ts +1 -1
- package/dist/ts3.9/utils/normalize-stories.d.ts +3 -0
- package/dist/ts3.9/utils/paths.d.ts +4 -0
- package/dist/ts3.9/utils/to-importFn.d.ts +1 -0
- package/package.json +6 -5
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.normalizeStories = exports.normalizeStoriesEntry = void 0;
|
|
6
|
+
exports.normalizeStories = exports.normalizeStoriesEntry = exports.getDirectoryFromWorkingDir = void 0;
|
|
7
7
|
|
|
8
8
|
var _fs = _interopRequireDefault(require("fs"));
|
|
9
9
|
|
|
@@ -13,10 +13,12 @@ var _utilDeprecate = _interopRequireDefault(require("util-deprecate"));
|
|
|
13
13
|
|
|
14
14
|
var _tsDedent = _interopRequireDefault(require("ts-dedent"));
|
|
15
15
|
|
|
16
|
-
var
|
|
16
|
+
var _picomatch = require("picomatch");
|
|
17
17
|
|
|
18
18
|
var _slash = _interopRequireDefault(require("slash"));
|
|
19
19
|
|
|
20
|
+
var _paths = require("./paths");
|
|
21
|
+
|
|
20
22
|
var _globToRegexp = require("./glob-to-regexp");
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -54,6 +56,22 @@ var isDirectory = function (configDir, entry) {
|
|
|
54
56
|
}
|
|
55
57
|
};
|
|
56
58
|
|
|
59
|
+
var getDirectoryFromWorkingDir = function ({
|
|
60
|
+
configDir: configDir,
|
|
61
|
+
workingDir: workingDir,
|
|
62
|
+
directory: directory
|
|
63
|
+
}) {
|
|
64
|
+
var directoryFromConfig = _path.default.resolve(configDir, directory);
|
|
65
|
+
|
|
66
|
+
var directoryFromWorking = _path.default.relative(workingDir, directoryFromConfig); // relative('/foo', '/foo/src') => 'src'
|
|
67
|
+
// but we want `./src` to match importPaths
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
return (0, _paths.normalizeStoryPath)(directoryFromWorking);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
exports.getDirectoryFromWorkingDir = getDirectoryFromWorkingDir;
|
|
74
|
+
|
|
57
75
|
var normalizeStoriesEntry = function (entry, {
|
|
58
76
|
configDir: configDir,
|
|
59
77
|
workingDir: workingDir
|
|
@@ -77,7 +95,7 @@ var normalizeStoriesEntry = function (entry, {
|
|
|
77
95
|
}
|
|
78
96
|
} else {
|
|
79
97
|
var fixedEntry = detectBadGlob(entry);
|
|
80
|
-
var globResult = (0,
|
|
98
|
+
var globResult = (0, _picomatch.scan)(fixedEntry);
|
|
81
99
|
|
|
82
100
|
var _directory = globResult.isGlob ? globResult.prefix + globResult.base : _path.default.dirname(fixedEntry);
|
|
83
101
|
|
|
@@ -105,19 +123,13 @@ var normalizeStoriesEntry = function (entry, {
|
|
|
105
123
|
|
|
106
124
|
var _specifierWithoutMatc = specifierWithoutMatcher,
|
|
107
125
|
directoryRelativeToConfig = _specifierWithoutMatc.directory;
|
|
126
|
+
var directory = (0, _slash.default)(getDirectoryFromWorkingDir({
|
|
127
|
+
configDir: configDir,
|
|
128
|
+
workingDir: workingDir,
|
|
129
|
+
directory: directoryRelativeToConfig
|
|
130
|
+
})).replace(/\/$/, ''); // Now make the importFn matcher.
|
|
108
131
|
|
|
109
|
-
var
|
|
110
|
-
|
|
111
|
-
var directory = (0, _slash.default)(_path.default.relative(workingDir, absoluteDirectory)); // relative('/foo', '/foo/src') => 'src'
|
|
112
|
-
// but we want `./src` to match importPaths
|
|
113
|
-
|
|
114
|
-
if (!directory.startsWith('.')) {
|
|
115
|
-
directory = `./${directory}`;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
directory = directory.replace(/\/$/, ''); // Now make the importFn matcher.
|
|
119
|
-
|
|
120
|
-
var importPathMatcher = (0, _globToRegexp.globToRegex)(`${directory}/${files}`);
|
|
132
|
+
var importPathMatcher = (0, _globToRegexp.globToRegexp)(`${directory}/${files}`);
|
|
121
133
|
return _objectSpread(_objectSpread({}, specifierWithoutMatcher), {}, {
|
|
122
134
|
directory: directory,
|
|
123
135
|
importPathMatcher: importPathMatcher
|
package/dist/cjs/utils/paths.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.normalizeStoryPath = normalizeStoryPath;
|
|
6
7
|
exports.nodePathsToArray = exports.nodeModulesPaths = exports.getProjectRoot = void 0;
|
|
7
8
|
|
|
8
9
|
var _path = _interopRequireDefault(require("path"));
|
|
@@ -48,4 +49,13 @@ var nodePathsToArray = function (nodePath) {
|
|
|
48
49
|
});
|
|
49
50
|
};
|
|
50
51
|
|
|
51
|
-
exports.nodePathsToArray = nodePathsToArray;
|
|
52
|
+
exports.nodePathsToArray = nodePathsToArray;
|
|
53
|
+
var relativePattern = /^\.{1,2}[/\\]/;
|
|
54
|
+
/**
|
|
55
|
+
* Ensures that a path starts with `./` or `../`
|
|
56
|
+
*/
|
|
57
|
+
|
|
58
|
+
function normalizeStoryPath(filename) {
|
|
59
|
+
if (relativePattern.test(filename)) return filename;
|
|
60
|
+
return `.${_path.default.sep}${filename}`;
|
|
61
|
+
}
|
|
@@ -3,22 +3,35 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.webpackIncludeRegexp = webpackIncludeRegexp;
|
|
6
7
|
exports.toImportFnPart = toImportFnPart;
|
|
7
8
|
exports.toImportFn = toImportFn;
|
|
8
9
|
|
|
9
10
|
var _tsDedent = _interopRequireDefault(require("ts-dedent"));
|
|
10
11
|
|
|
12
|
+
var _globToRegexp = require("./glob-to-regexp");
|
|
13
|
+
|
|
11
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
15
|
|
|
13
|
-
function
|
|
16
|
+
function webpackIncludeRegexp(specifier) {
|
|
14
17
|
var directory = specifier.directory,
|
|
15
|
-
|
|
18
|
+
files = specifier.files; // It appears webpack passes *something* similar to the absolute path to the file
|
|
16
19
|
// on disk (prefixed with something unknown) to the matcher.
|
|
17
|
-
// We don't want to include the absolute path in our bundle, so we will just pull
|
|
18
|
-
//
|
|
20
|
+
// We don't want to include the absolute path in our bundle, so we will just pull any leading
|
|
21
|
+
// `./` or `../` off our directory and match on that.
|
|
19
22
|
// It's imperfect as it could match extra things in extremely unusual cases, but it'll do for now.
|
|
23
|
+
// NOTE: directory is "slashed" so will contain only `/` (no `\`), even on windows
|
|
20
24
|
|
|
21
|
-
var
|
|
25
|
+
var directoryWithoutLeadingDots = directory.replace(/^(\.+\/)+/, '/');
|
|
26
|
+
var webpackIncludeGlob = ['.', '..'].includes(directory) ? files : `${directoryWithoutLeadingDots}/${files}`;
|
|
27
|
+
var webpackIncludeRegexpWithCaret = (0, _globToRegexp.globToRegexp)(webpackIncludeGlob); // picomatch is creating an exact match, but we are only matching the end of the filename
|
|
28
|
+
|
|
29
|
+
return new RegExp(webpackIncludeRegexpWithCaret.source.replace(/^\^/, ''));
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function toImportFnPart(specifier) {
|
|
33
|
+
var directory = specifier.directory,
|
|
34
|
+
importPathMatcher = specifier.importPathMatcher;
|
|
22
35
|
return (0, _tsDedent.default)`
|
|
23
36
|
async (path) => {
|
|
24
37
|
if (!${importPathMatcher}.exec(path)) {
|
|
@@ -27,7 +40,8 @@ function toImportFnPart(specifier) {
|
|
|
27
40
|
|
|
28
41
|
const pathRemainder = path.substring(${directory.length + 1});
|
|
29
42
|
return import(
|
|
30
|
-
/*
|
|
43
|
+
/* webpackChunkName: "[request]" */
|
|
44
|
+
/* webpackInclude: ${webpackIncludeRegexp(specifier)} */
|
|
31
45
|
'${directory}/' + pathRemainder
|
|
32
46
|
);
|
|
33
47
|
}
|
|
@@ -12,7 +12,7 @@ var toRequireContext = function (specifier) {
|
|
|
12
12
|
files = specifier.files; // The importPathMatcher is a `./`-prefixed matcher that includes the directory
|
|
13
13
|
// For `require.context()` we want the same thing, relative to directory
|
|
14
14
|
|
|
15
|
-
var match = (0, _globToRegexp.
|
|
15
|
+
var match = (0, _globToRegexp.globToRegexp)(`./${files}`);
|
|
16
16
|
return {
|
|
17
17
|
path: directory,
|
|
18
18
|
recursive: !!files.match(/^\*{1,2}\//),
|
package/dist/esm/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './presets';
|
|
2
2
|
export * from './utils/babel';
|
|
3
3
|
export * from './utils/check-webpack-version';
|
|
4
|
+
export * from './utils/check-addon-order';
|
|
4
5
|
export * from './utils/envs';
|
|
5
6
|
export * from './utils/es6Transpiler';
|
|
6
7
|
export * from './utils/handlebars';
|
|
@@ -24,4 +25,5 @@ export * from './utils/to-require-context';
|
|
|
24
25
|
export * from './utils/normalize-stories';
|
|
25
26
|
export * from './utils/to-importFn';
|
|
26
27
|
export * from './utils/readTemplate';
|
|
28
|
+
export * from './utils/findDistEsm';
|
|
27
29
|
export * from './types';
|
package/dist/esm/presets.js
CHANGED
|
@@ -11,10 +11,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
11
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
12
|
|
|
13
13
|
import dedent from 'ts-dedent';
|
|
14
|
-
import { join } from 'path';
|
|
14
|
+
import { join, resolve } from 'path';
|
|
15
15
|
import { logger } from '@storybook/node-logger';
|
|
16
16
|
import resolveFrom from 'resolve-from';
|
|
17
17
|
import { loadCustomPresets } from './utils/load-custom-presets';
|
|
18
|
+
import { serverRequire } from './utils/interpret-require';
|
|
18
19
|
|
|
19
20
|
var isObject = function (val) {
|
|
20
21
|
return val != null && typeof val === 'object' && Array.isArray(val) === false;
|
|
@@ -31,13 +32,15 @@ export function filterPresetsConfig(presetsConfig) {
|
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
function resolvePresetFunction(input, presetOptions, storybookOptions) {
|
|
35
|
+
function resolvePresetFunction(input, presetOptions, framework, storybookOptions) {
|
|
36
|
+
var prepend = [framework].filter(Boolean);
|
|
37
|
+
|
|
35
38
|
if (isFunction(input)) {
|
|
36
|
-
return input(_objectSpread(_objectSpread({}, storybookOptions), presetOptions));
|
|
39
|
+
return [...prepend, ...input(_objectSpread(_objectSpread({}, storybookOptions), presetOptions))];
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
if (Array.isArray(input)) {
|
|
40
|
-
return input;
|
|
43
|
+
return [...prepend, ...input];
|
|
41
44
|
}
|
|
42
45
|
|
|
43
46
|
return [];
|
|
@@ -178,11 +181,12 @@ export function loadPreset(input, level, storybookOptions) {
|
|
|
178
181
|
var _contents = contents,
|
|
179
182
|
addonsInput = _contents.addons,
|
|
180
183
|
presetsInput = _contents.presets,
|
|
181
|
-
|
|
184
|
+
framework = _contents.framework,
|
|
185
|
+
rest = _objectWithoutProperties(_contents, ["addons", "presets", "framework"]);
|
|
182
186
|
|
|
183
|
-
var _subPresets = resolvePresetFunction(presetsInput, presetOptions, storybookOptions);
|
|
187
|
+
var _subPresets = resolvePresetFunction(presetsInput, presetOptions, framework, storybookOptions);
|
|
184
188
|
|
|
185
|
-
var subAddons = resolvePresetFunction(addonsInput, presetOptions, storybookOptions);
|
|
189
|
+
var subAddons = resolvePresetFunction(addonsInput, presetOptions, framework, storybookOptions);
|
|
186
190
|
return [...loadPresets([..._subPresets], level + 1, storybookOptions), ...loadPresets([...subAddons.map(map(storybookOptions))].filter(Boolean), level + 1, storybookOptions), {
|
|
187
191
|
name: name,
|
|
188
192
|
preset: rest,
|
|
@@ -217,8 +221,8 @@ function loadPresets(presets, level, storybookOptions) {
|
|
|
217
221
|
}
|
|
218
222
|
|
|
219
223
|
function applyPresets(presets, extension, config, args, storybookOptions) {
|
|
220
|
-
var presetResult = new Promise(function (
|
|
221
|
-
return
|
|
224
|
+
var presetResult = new Promise(function (res) {
|
|
225
|
+
return res(config);
|
|
222
226
|
});
|
|
223
227
|
|
|
224
228
|
if (!presets.length) {
|
|
@@ -275,6 +279,32 @@ export function getPresets(presets, storybookOptions) {
|
|
|
275
279
|
}
|
|
276
280
|
};
|
|
277
281
|
}
|
|
282
|
+
/**
|
|
283
|
+
* Get the `framework` provided in main.js and also do error checking up front
|
|
284
|
+
*/
|
|
285
|
+
|
|
286
|
+
var getFrameworkPackage = function (configDir) {
|
|
287
|
+
var main = serverRequire(resolve(configDir, 'main'));
|
|
288
|
+
if (!main) return null;
|
|
289
|
+
var frameworkPackage = main.framework,
|
|
290
|
+
_main$features = main.features,
|
|
291
|
+
features = _main$features === void 0 ? {} : _main$features;
|
|
292
|
+
|
|
293
|
+
if (features.breakingChangesV7 && !frameworkPackage) {
|
|
294
|
+
throw new Error(dedent`
|
|
295
|
+
Expected 'framework' in your main.js, didn't find one.
|
|
296
|
+
|
|
297
|
+
You can fix this automatically by running:
|
|
298
|
+
|
|
299
|
+
npx sb@next automigrate
|
|
300
|
+
|
|
301
|
+
More info: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#mainjs-framework-field
|
|
302
|
+
`);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
return frameworkPackage;
|
|
306
|
+
};
|
|
307
|
+
|
|
278
308
|
export function loadAllPresets(options) {
|
|
279
309
|
var _options$corePresets = options.corePresets,
|
|
280
310
|
corePresets = _options$corePresets === void 0 ? [] : _options$corePresets,
|
|
@@ -284,7 +314,8 @@ export function loadAllPresets(options) {
|
|
|
284
314
|
overridePresets = _options$overridePres === void 0 ? [] : _options$overridePres,
|
|
285
315
|
restOptions = _objectWithoutProperties(options, ["corePresets", "frameworkPresets", "overridePresets"]);
|
|
286
316
|
|
|
287
|
-
var
|
|
317
|
+
var frameworkPackage = getFrameworkPackage(options.configDir);
|
|
318
|
+
var presetsConfig = [...corePresets, ...(frameworkPackage ? [] : frameworkPresets), ...loadCustomPresets(options), ...overridePresets]; // Remove `@storybook/preset-typescript` and add a warning if in use.
|
|
288
319
|
|
|
289
320
|
var filteredPresetConfig = filterPresetsConfig(presetsConfig);
|
|
290
321
|
|
|
@@ -1,3 +1,268 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
@-webkit-keyframes rotate360 {
|
|
3
|
+
from {
|
|
4
|
+
transform: rotate(0deg);
|
|
5
|
+
}
|
|
6
|
+
to {
|
|
7
|
+
transform: rotate(360deg);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
@keyframes rotate360 {
|
|
11
|
+
from {
|
|
12
|
+
transform: rotate(0deg);
|
|
13
|
+
}
|
|
14
|
+
to {
|
|
15
|
+
transform: rotate(360deg);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
@-webkit-keyframes glow {
|
|
19
|
+
0%,
|
|
20
|
+
100% {
|
|
21
|
+
opacity: 1;
|
|
22
|
+
}
|
|
23
|
+
50% {
|
|
24
|
+
opacity: 0.4;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
@keyframes glow {
|
|
28
|
+
0%,
|
|
29
|
+
100% {
|
|
30
|
+
opacity: 1;
|
|
31
|
+
}
|
|
32
|
+
50% {
|
|
33
|
+
opacity: 0.4;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.isLoading {
|
|
37
|
+
cursor: progress;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.loader {
|
|
41
|
+
-webkit-animation: rotate360 0.7s linear infinite;
|
|
42
|
+
animation: rotate360 0.7s linear infinite;
|
|
43
|
+
border-color: rgba(97, 97, 97, 0.29);
|
|
44
|
+
border-radius: 50%;
|
|
45
|
+
border-style: solid;
|
|
46
|
+
border-top-color: #646464;
|
|
47
|
+
border-width: 2px;
|
|
48
|
+
display: inline-block;
|
|
49
|
+
height: 32px;
|
|
50
|
+
left: 50%;
|
|
51
|
+
margin-left: -16px;
|
|
52
|
+
margin-top: -16px;
|
|
53
|
+
mix-blend-mode: difference;
|
|
54
|
+
overflow: hidden;
|
|
55
|
+
position: absolute;
|
|
56
|
+
top: 50%;
|
|
57
|
+
transition: all 200ms ease-out;
|
|
58
|
+
vertical-align: top;
|
|
59
|
+
width: 32px;
|
|
60
|
+
z-index: 4;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.previewBlock {
|
|
64
|
+
background: #fff;
|
|
65
|
+
border: 1px solid rgba(0, 0, 0, 0.1);
|
|
66
|
+
border-radius: 4px;
|
|
67
|
+
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 3px 0;
|
|
68
|
+
margin: 25px auto 40px;
|
|
69
|
+
max-width: 600px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.previewBlock_header {
|
|
73
|
+
align-items: center;
|
|
74
|
+
box-shadow: rgba(0, 0, 0, 0.1) 0 -1px 0 0 inset;
|
|
75
|
+
display: flex;
|
|
76
|
+
gap: 14px;
|
|
77
|
+
height: 40px;
|
|
78
|
+
padding: 0 12px;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.previewBlock_icon {
|
|
82
|
+
-webkit-animation: glow 1.5s ease-in-out infinite;
|
|
83
|
+
animation: glow 1.5s ease-in-out infinite;
|
|
84
|
+
background: #e6e6e6;
|
|
85
|
+
height: 14px;
|
|
86
|
+
width: 14px;
|
|
87
|
+
}
|
|
88
|
+
.previewBlock_icon:last-child {
|
|
89
|
+
margin-left: auto;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.previewBlock_body {
|
|
93
|
+
-webkit-animation: glow 1.5s ease-in-out infinite;
|
|
94
|
+
animation: glow 1.5s ease-in-out infinite;
|
|
95
|
+
height: 182px;
|
|
96
|
+
position: relative;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.argstableBlock {
|
|
100
|
+
border-collapse: collapse;
|
|
101
|
+
border-spacing: 0;
|
|
102
|
+
font-size: 13px;
|
|
103
|
+
line-height: 20px;
|
|
104
|
+
margin: 25px auto 40px;
|
|
105
|
+
max-width: 600px;
|
|
106
|
+
text-align: left;
|
|
107
|
+
width: 100%;
|
|
108
|
+
}
|
|
109
|
+
.argstableBlock th:first-of-type,
|
|
110
|
+
.argstableBlock td:first-of-type {
|
|
111
|
+
padding-left: 20px;
|
|
112
|
+
}
|
|
113
|
+
.argstableBlock th:nth-of-type(2),
|
|
114
|
+
.argstableBlock td:nth-of-type(2) {
|
|
115
|
+
width: 35%;
|
|
116
|
+
}
|
|
117
|
+
.argstableBlock th:nth-of-type(3),
|
|
118
|
+
.argstableBlock td:nth-of-type(3) {
|
|
119
|
+
width: 15%;
|
|
120
|
+
}
|
|
121
|
+
.argstableBlock th:laste-of-type,
|
|
122
|
+
.argstableBlock td:laste-of-type {
|
|
123
|
+
width: 25%;
|
|
124
|
+
padding-right: 20px;
|
|
125
|
+
}
|
|
126
|
+
.argstableBlock th span,
|
|
127
|
+
.argstableBlock td span {
|
|
128
|
+
-webkit-animation: glow 1.5s ease-in-out infinite;
|
|
129
|
+
animation: glow 1.5s ease-in-out infinite;
|
|
130
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
131
|
+
border-radius: 0;
|
|
132
|
+
box-shadow: none;
|
|
133
|
+
color: transparent;
|
|
134
|
+
}
|
|
135
|
+
.argstableBlock th {
|
|
136
|
+
padding: 10px 15px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.argstableBlock-body {
|
|
140
|
+
border-radius: 4px;
|
|
141
|
+
box-shadow: rgba(0, 0, 0, 0.1) 0 1px 3px 1px, rgba(0, 0, 0, 0.065) 0 0 0 1px;
|
|
142
|
+
}
|
|
143
|
+
.argstableBlock-body tr {
|
|
144
|
+
background: transparent;
|
|
145
|
+
overflow: hidden;
|
|
146
|
+
}
|
|
147
|
+
.argstableBlock-body tr:not(:first-child) {
|
|
148
|
+
border-top: 1px solid #e6e6e6;
|
|
149
|
+
}
|
|
150
|
+
.argstableBlock-body tr:first-child td:first-child {
|
|
151
|
+
border-top-left-radius: 4px;
|
|
152
|
+
}
|
|
153
|
+
.argstableBlock-body tr:first-child td:last-child {
|
|
154
|
+
border-top-right-radius: 4px;
|
|
155
|
+
}
|
|
156
|
+
.argstableBlock-body tr:last-child td:first-child {
|
|
157
|
+
border-bottom-left-radius: 4px;
|
|
158
|
+
}
|
|
159
|
+
.argstableBlock-body tr:last-child td:last-child {
|
|
160
|
+
border-bottom-right-radius: 4px;
|
|
161
|
+
}
|
|
162
|
+
.argstableBlock-body td {
|
|
163
|
+
background: #fff;
|
|
164
|
+
padding-bottom: 10px;
|
|
165
|
+
padding-top: 10px;
|
|
166
|
+
vertical-align: top;
|
|
167
|
+
}
|
|
168
|
+
.argstableBlock-body td:not(:first-of-type) {
|
|
169
|
+
padding-left: 15px;
|
|
170
|
+
padding-right: 15px;
|
|
171
|
+
}
|
|
172
|
+
.argstableBlock-body button {
|
|
173
|
+
-webkit-animation: glow 1.5s ease-in-out infinite;
|
|
174
|
+
animation: glow 1.5s ease-in-out infinite;
|
|
175
|
+
background-color: rgba(0, 0, 0, 0.1);
|
|
176
|
+
border: 0;
|
|
177
|
+
border-radius: 0;
|
|
178
|
+
box-shadow: none;
|
|
179
|
+
color: transparent;
|
|
180
|
+
display: inline;
|
|
181
|
+
font-size: 12px;
|
|
182
|
+
line-height: 1;
|
|
183
|
+
padding: 10px 16px;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.argstableBlock-summary {
|
|
187
|
+
margin-top: 4px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.argstableBlock-code {
|
|
191
|
+
margin-right: 4px;
|
|
192
|
+
margin-bottom: 4px;
|
|
193
|
+
padding: 2px 5px;
|
|
194
|
+
}
|
|
195
|
+
</style>
|
|
196
|
+
|
|
197
|
+
<div class="sb-preparing-story sb-wrapper">
|
|
198
|
+
<div class="loader"></div>
|
|
199
|
+
</div>
|
|
200
|
+
|
|
201
|
+
<div class="sb-preparing-docs sb-wrapper">
|
|
202
|
+
<div class="previewBlock">
|
|
203
|
+
<div class="previewBlock_header">
|
|
204
|
+
<div class="previewBlock_icon"></div>
|
|
205
|
+
<div class="previewBlock_icon"></div>
|
|
206
|
+
<div class="previewBlock_icon"></div>
|
|
207
|
+
<div class="previewBlock_icon"></div>
|
|
208
|
+
</div>
|
|
209
|
+
<div class="previewBlock_body">
|
|
210
|
+
<div class="loader"></div>
|
|
211
|
+
</div>
|
|
212
|
+
</div>
|
|
213
|
+
<table aria-hidden="true" class="argstableBlock">
|
|
214
|
+
<thead class="argstableBlock-head">
|
|
215
|
+
<tr>
|
|
216
|
+
<th><span>Name</span></th>
|
|
217
|
+
<th><span>Description</span></th>
|
|
218
|
+
<th><span>Default</span></th>
|
|
219
|
+
<th><span>Control </span></th>
|
|
220
|
+
</tr>
|
|
221
|
+
</thead>
|
|
222
|
+
<tbody class="argstableBlock-body">
|
|
223
|
+
<tr>
|
|
224
|
+
<td><span>propertyName</span><span title="Required">*</span></td>
|
|
225
|
+
<td>
|
|
226
|
+
<div><span>This is a short description</span></div>
|
|
227
|
+
<div class="argstableBlock-summary">
|
|
228
|
+
<div><span class="argstableBlock-code">summary</span></div>
|
|
229
|
+
</div>
|
|
230
|
+
</td>
|
|
231
|
+
<td>
|
|
232
|
+
<div><span class="argstableBlock-code">defaultValue</span></div>
|
|
233
|
+
</td>
|
|
234
|
+
<td><button>Set string</button></td>
|
|
235
|
+
</tr>
|
|
236
|
+
<tr>
|
|
237
|
+
<td><span>propertyName</span><span>*</span></td>
|
|
238
|
+
<td>
|
|
239
|
+
<div><span>This is a short description</span></div>
|
|
240
|
+
<div class="argstableBlock-summary">
|
|
241
|
+
<div><span class="argstableBlock-code">summary</span></div>
|
|
242
|
+
</div>
|
|
243
|
+
</td>
|
|
244
|
+
<td>
|
|
245
|
+
<div><span class="argstableBlock-code">defaultValue</span></div>
|
|
246
|
+
</td>
|
|
247
|
+
<td><button>Set string</button></td>
|
|
248
|
+
</tr>
|
|
249
|
+
<tr>
|
|
250
|
+
<td><span>propertyName</span><span>*</span></td>
|
|
251
|
+
<td>
|
|
252
|
+
<div><span>This is a short description</span></div>
|
|
253
|
+
<div class="argstableBlock-summary">
|
|
254
|
+
<div><span class="argstableBlock-code">summary</span></div>
|
|
255
|
+
</div>
|
|
256
|
+
</td>
|
|
257
|
+
<td>
|
|
258
|
+
<div><span class="argstableBlock-code">defaultValue</span></div>
|
|
259
|
+
</td>
|
|
260
|
+
<td><button>Set string</button></td>
|
|
261
|
+
</tr>
|
|
262
|
+
</tbody>
|
|
263
|
+
</table>
|
|
264
|
+
</div>
|
|
265
|
+
|
|
1
266
|
<div class="sb-nopreview sb-wrapper">
|
|
2
267
|
<div class="sb-nopreview_main">
|
|
3
268
|
<h1 class="sb-nopreview_heading sb-heading">No Preview</h1>
|
|
@@ -6,7 +271,9 @@
|
|
|
6
271
|
<li>Please check the Storybook config.</li>
|
|
7
272
|
<li>Try reloading the page.</li>
|
|
8
273
|
</ul>
|
|
9
|
-
<p>
|
|
274
|
+
<p>
|
|
275
|
+
If the problem persists, check the browser console, or the terminal you've run Storybook from.
|
|
276
|
+
</p>
|
|
10
277
|
</div>
|
|
11
278
|
</div>
|
|
12
279
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
<base target="_parent"
|
|
1
|
+
<base target="_parent" />
|
|
2
2
|
|
|
3
3
|
<style>
|
|
4
|
-
:not(.sb-show-main) >
|
|
4
|
+
:not(.sb-show-main) > #root,
|
|
5
|
+
:not(.sb-show-main) > #docs-root,
|
|
6
|
+
:not(.sb-show-preparing-story) > .sb-preparing-story,
|
|
7
|
+
:not(.sb-show-preparing-docs) > .sb-preparing-docs,
|
|
5
8
|
:not(.sb-show-nopreview) > .sb-nopreview,
|
|
6
9
|
:not(.sb-show-errordisplay) > .sb-errordisplay {
|
|
7
10
|
display: none;
|
|
@@ -50,7 +53,8 @@
|
|
|
50
53
|
left: 0;
|
|
51
54
|
right: 0;
|
|
52
55
|
padding: 20px;
|
|
53
|
-
font-family:
|
|
56
|
+
font-family: 'Nunito Sans', -apple-system, '.SFNSText-Regular', 'San Francisco',
|
|
57
|
+
BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Helvetica, Arial, sans-serif;
|
|
54
58
|
-webkit-font-smoothing: antialiased;
|
|
55
59
|
overflow: auto;
|
|
56
60
|
}
|
|
@@ -73,7 +77,7 @@
|
|
|
73
77
|
margin: auto;
|
|
74
78
|
padding: 30px;
|
|
75
79
|
border-radius: 10px;
|
|
76
|
-
background: rgba(0,0,0,0.03);
|
|
80
|
+
background: rgba(0, 0, 0, 0.03);
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
.sb-nopreview_heading {
|
|
@@ -91,7 +95,8 @@
|
|
|
91
95
|
padding: 10px;
|
|
92
96
|
background: #000;
|
|
93
97
|
color: #eee;
|
|
94
|
-
font-family:
|
|
98
|
+
font-family: 'Operator Mono', 'Fira Code Retina', 'Fira Code', 'FiraCode-Retina', 'Andale Mono',
|
|
99
|
+
'Lucida Console', Consolas, Monaco, monospace;
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
.sb-errordisplay pre {
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|
|
5
|
-
<title><%= options.title || 'Storybook'%></title>
|
|
5
|
+
<title><%= htmlWebpackPlugin.options.title || 'Storybook'%></title>
|
|
6
6
|
|
|
7
|
-
<% if (files.favicon) { %>
|
|
8
|
-
<link rel="shortcut icon" href="<%= files.favicon%>" />
|
|
7
|
+
<% if (htmlWebpackPlugin.files.favicon) { %>
|
|
8
|
+
<link rel="shortcut icon" href="<%= htmlWebpackPlugin.files.favicon%>" />
|
|
9
9
|
<% } %>
|
|
10
10
|
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
12
12
|
|
|
13
13
|
<% if (typeof headHtmlSnippet !== 'undefined') { %> <%= headHtmlSnippet %> <% } %> <%
|
|
14
|
-
files.css.forEach(file => { %>
|
|
14
|
+
htmlWebpackPlugin.files.css.forEach(file => { %>
|
|
15
15
|
<link href="<%= file %>" rel="stylesheet" />
|
|
16
16
|
<% }); %>
|
|
17
17
|
|
|
@@ -23,25 +23,21 @@
|
|
|
23
23
|
</style>
|
|
24
24
|
</head>
|
|
25
25
|
<body>
|
|
26
|
-
<% if (typeof bodyHtmlSnippet !== 'undefined') { %>
|
|
27
|
-
<%= bodyHtmlSnippet %>
|
|
28
|
-
<% } %>
|
|
26
|
+
<% if (typeof bodyHtmlSnippet !== 'undefined') { %> <%= bodyHtmlSnippet %> <% } %>
|
|
29
27
|
|
|
30
28
|
<div id="root"></div>
|
|
31
29
|
<div id="docs-root"></div>
|
|
32
30
|
|
|
33
31
|
<% if (typeof globals !== 'undefined' && Object.keys(globals).length) { %>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<% } %>
|
|
42
|
-
|
|
43
|
-
<% files.js.forEach(file => { %>
|
|
44
|
-
<script src="<%= file %>"></script>
|
|
32
|
+
<script>
|
|
33
|
+
<% for (var varName in globals) { %>
|
|
34
|
+
<% if (globals[varName] != undefined) { %>
|
|
35
|
+
window['<%=varName%>'] = <%= JSON.stringify(globals[varName]) %>;
|
|
36
|
+
<% } %>
|
|
37
|
+
<% } %>
|
|
38
|
+
</script>
|
|
39
|
+
<% } %> <% htmlWebpackPlugin.files.js.forEach(file => { %>
|
|
40
|
+
<script src="<%= file %>"></script>
|
|
45
41
|
<% }); %>
|
|
46
42
|
</body>
|
|
47
43
|
</html>
|