@storybook/ember 7.0.0-alpha.50 → 7.0.0-alpha.51
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/client/docs/config.js +0 -3
- package/dist/cjs/client/docs/index.js +0 -1
- package/dist/cjs/client/docs/jsondoc.js +1 -17
- package/dist/cjs/client/preview/config.js +0 -2
- package/dist/cjs/client/preview/docs/config.js +0 -2
- package/dist/cjs/client/preview/docs/index.js +0 -1
- package/dist/cjs/client/preview/docs/jsondoc.js +1 -17
- package/dist/cjs/client/preview/globals.js +0 -2
- package/dist/cjs/client/preview/index.js +0 -8
- package/dist/cjs/client/preview/render.js +1 -16
- package/dist/cjs/index.js +0 -3
- package/dist/cjs/preset.js +0 -5
- package/dist/cjs/server/framework-preset-babel-ember.js +0 -14
- package/dist/cjs/server/framework-preset-ember-docs.js +0 -4
- package/dist/esm/client/docs/jsondoc.js +1 -9
- package/dist/esm/client/preview/docs/jsondoc.js +1 -9
- package/dist/esm/client/preview/render.js +0 -11
- package/dist/esm/index.js +3 -1
- package/dist/esm/server/framework-preset-babel-ember.js +0 -9
- package/dist/types/src/client/preview/types.d.ts +1 -1
- package/dist/types/src/types.d.ts +5 -5
- package/package.json +9 -9
- package/template/cli/{1-Button.stories.js → Button.stories.js} +3 -4
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.parameters = exports.argTypesEnhancers = void 0;
|
7
|
-
|
8
7
|
var _docsTools = require("@storybook/docs-tools");
|
9
|
-
|
10
8
|
var _jsondoc = require("./jsondoc");
|
11
|
-
|
12
9
|
const parameters = {
|
13
10
|
docs: {
|
14
11
|
iframeHeight: 80,
|
@@ -4,35 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.setJSONDoc = exports.getJSONDoc = exports.extractComponentDescription = exports.extractArgTypes = void 0;
|
7
|
-
|
8
7
|
/* eslint-disable no-underscore-dangle */
|
9
|
-
|
10
8
|
/* global window */
|
9
|
+
|
11
10
|
const setJSONDoc = jsondoc => {
|
12
11
|
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
13
12
|
};
|
14
|
-
|
15
13
|
exports.setJSONDoc = setJSONDoc;
|
16
|
-
|
17
14
|
const getJSONDoc = () => {
|
18
15
|
return window.__EMBER_GENERATED_DOC_JSON__;
|
19
16
|
};
|
20
|
-
|
21
17
|
exports.getJSONDoc = getJSONDoc;
|
22
|
-
|
23
18
|
const extractArgTypes = componentName => {
|
24
19
|
const json = getJSONDoc();
|
25
|
-
|
26
20
|
if (!(json && json.included)) {
|
27
21
|
return null;
|
28
22
|
}
|
29
|
-
|
30
23
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
31
|
-
|
32
24
|
if (!componentDoc) {
|
33
25
|
return null;
|
34
26
|
}
|
35
|
-
|
36
27
|
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
37
28
|
acc[prop.name] = {
|
38
29
|
name: prop.name,
|
@@ -51,23 +42,16 @@ const extractArgTypes = componentName => {
|
|
51
42
|
return acc;
|
52
43
|
}, {});
|
53
44
|
};
|
54
|
-
|
55
45
|
exports.extractArgTypes = extractArgTypes;
|
56
|
-
|
57
46
|
const extractComponentDescription = componentName => {
|
58
47
|
const json = getJSONDoc();
|
59
|
-
|
60
48
|
if (!(json && json.included)) {
|
61
49
|
return null;
|
62
50
|
}
|
63
|
-
|
64
51
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
65
|
-
|
66
52
|
if (!componentDoc) {
|
67
53
|
return null;
|
68
54
|
}
|
69
|
-
|
70
55
|
return componentDoc.attributes.description;
|
71
56
|
};
|
72
|
-
|
73
57
|
exports.extractComponentDescription = extractComponentDescription;
|
@@ -4,35 +4,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.setJSONDoc = exports.getJSONDoc = exports.extractComponentDescription = exports.extractArgTypes = void 0;
|
7
|
-
|
8
7
|
/* eslint-disable no-underscore-dangle */
|
9
|
-
|
10
8
|
/* global window */
|
9
|
+
|
11
10
|
const setJSONDoc = jsondoc => {
|
12
11
|
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
13
12
|
};
|
14
|
-
|
15
13
|
exports.setJSONDoc = setJSONDoc;
|
16
|
-
|
17
14
|
const getJSONDoc = () => {
|
18
15
|
return window.__EMBER_GENERATED_DOC_JSON__;
|
19
16
|
};
|
20
|
-
|
21
17
|
exports.getJSONDoc = getJSONDoc;
|
22
|
-
|
23
18
|
const extractArgTypes = componentName => {
|
24
19
|
const json = getJSONDoc();
|
25
|
-
|
26
20
|
if (!(json && json.included)) {
|
27
21
|
return null;
|
28
22
|
}
|
29
|
-
|
30
23
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
31
|
-
|
32
24
|
if (!componentDoc) {
|
33
25
|
return null;
|
34
26
|
}
|
35
|
-
|
36
27
|
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
37
28
|
acc[prop.name] = {
|
38
29
|
name: prop.name,
|
@@ -51,23 +42,16 @@ const extractArgTypes = componentName => {
|
|
51
42
|
return acc;
|
52
43
|
}, {});
|
53
44
|
};
|
54
|
-
|
55
45
|
exports.extractArgTypes = extractArgTypes;
|
56
|
-
|
57
46
|
const extractComponentDescription = componentName => {
|
58
47
|
const json = getJSONDoc();
|
59
|
-
|
60
48
|
if (!(json && json.included)) {
|
61
49
|
return null;
|
62
50
|
}
|
63
|
-
|
64
51
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
65
|
-
|
66
52
|
if (!componentDoc) {
|
67
53
|
return null;
|
68
54
|
}
|
69
|
-
|
70
55
|
return componentDoc.attributes.description;
|
71
56
|
};
|
72
|
-
|
73
57
|
exports.extractComponentDescription = extractComponentDescription;
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.storiesOf = exports.raw = exports.forceReRender = exports.configure = void 0;
|
7
|
-
|
8
7
|
var _coreClient = require("@storybook/core-client");
|
9
|
-
|
10
8
|
require("./globals");
|
11
|
-
|
12
9
|
var _render = require("./render");
|
13
|
-
|
14
10
|
const {
|
15
11
|
configure: coreConfigure,
|
16
12
|
clientApi,
|
@@ -22,13 +18,9 @@ const {
|
|
22
18
|
} = clientApi;
|
23
19
|
exports.raw = raw;
|
24
20
|
const FRAMEWORK = 'ember';
|
25
|
-
|
26
21
|
const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({
|
27
22
|
framework: FRAMEWORK
|
28
23
|
});
|
29
|
-
|
30
24
|
exports.storiesOf = storiesOf;
|
31
|
-
|
32
25
|
const configure = (loadable, m) => coreConfigure(FRAMEWORK, loadable, m);
|
33
|
-
|
34
26
|
exports.configure = configure;
|
@@ -4,33 +4,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderToCanvas = renderToCanvas;
|
7
|
-
|
8
7
|
var _global = _interopRequireDefault(require("global"));
|
9
|
-
|
10
8
|
var _tsDedent = require("ts-dedent");
|
11
|
-
|
12
9
|
var _component = _interopRequireDefault(require("@ember/component"));
|
13
|
-
|
14
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
15
|
-
|
16
11
|
// @ts-expect-error (Converted from ts-ignore)
|
12
|
+
|
17
13
|
const {
|
18
14
|
window: globalWindow,
|
19
15
|
document
|
20
16
|
} = _global.default;
|
21
17
|
const rootEl = document.getElementById('storybook-root');
|
22
|
-
|
23
18
|
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
24
|
-
|
25
19
|
const app = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/app`).default.create(Object.assign({
|
26
20
|
autoboot: false,
|
27
21
|
rootElement: rootEl
|
28
22
|
}, config.APP));
|
29
|
-
|
30
23
|
let lastPromise = app.boot();
|
31
24
|
let hasRendered = false;
|
32
25
|
let isRendering = false;
|
33
|
-
|
34
26
|
function render(options, el) {
|
35
27
|
if (isRendering) return;
|
36
28
|
isRendering = true;
|
@@ -39,11 +31,9 @@ function render(options, el) {
|
|
39
31
|
context = {},
|
40
32
|
element
|
41
33
|
} = options;
|
42
|
-
|
43
34
|
if (hasRendered) {
|
44
35
|
lastPromise = lastPromise.then(instance => instance.destroy());
|
45
36
|
}
|
46
|
-
|
47
37
|
lastPromise = lastPromise.then(() => {
|
48
38
|
const appInstancePrivate = app.buildInstance();
|
49
39
|
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
@@ -52,20 +42,17 @@ function render(options, el) {
|
|
52
42
|
layout: template || options
|
53
43
|
}, context)));
|
54
44
|
const component = instance.lookup('component:story-mode');
|
55
|
-
|
56
45
|
if (element) {
|
57
46
|
component.appendTo(element);
|
58
47
|
element.appendTo(el);
|
59
48
|
} else {
|
60
49
|
component.appendTo(el);
|
61
50
|
}
|
62
|
-
|
63
51
|
hasRendered = true;
|
64
52
|
isRendering = false;
|
65
53
|
return instance;
|
66
54
|
});
|
67
55
|
}
|
68
|
-
|
69
56
|
function renderToCanvas({
|
70
57
|
storyFn,
|
71
58
|
kind,
|
@@ -74,7 +61,6 @@ function renderToCanvas({
|
|
74
61
|
showError
|
75
62
|
}, canvasElement) {
|
76
63
|
const element = storyFn();
|
77
|
-
|
78
64
|
if (!element) {
|
79
65
|
showError({
|
80
66
|
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
@@ -87,7 +73,6 @@ function renderToCanvas({
|
|
87
73
|
});
|
88
74
|
return;
|
89
75
|
}
|
90
|
-
|
91
76
|
showMain();
|
92
77
|
render(element, canvasElement);
|
93
78
|
}
|
package/dist/cjs/index.js
CHANGED
@@ -27,10 +27,7 @@ Object.defineProperty(exports, "storiesOf", {
|
|
27
27
|
return _preview.storiesOf;
|
28
28
|
}
|
29
29
|
});
|
30
|
-
|
31
30
|
var _preview = require("./client/preview");
|
32
|
-
|
33
31
|
var _module, _module$hot;
|
34
|
-
|
35
32
|
// optimization: stop HMR propagation in webpack
|
36
33
|
(_module = module) === null || _module === void 0 ? void 0 : (_module$hot = _module.hot) === null || _module$hot === void 0 ? void 0 : _module$hot.decline();
|
package/dist/cjs/preset.js
CHANGED
@@ -4,14 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.core = exports.addons = void 0;
|
7
|
-
|
8
7
|
var _path = _interopRequireDefault(require("path"));
|
9
|
-
|
10
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
-
|
12
9
|
const addons = [require.resolve('./server/framework-preset-babel-ember'), require.resolve('./server/framework-preset-ember-docs')];
|
13
10
|
exports.addons = addons;
|
14
|
-
|
15
11
|
const core = async (config, options) => {
|
16
12
|
const framework = await options.presets.apply('framework');
|
17
13
|
return Object.assign({}, config, {
|
@@ -21,5 +17,4 @@ const core = async (config, options) => {
|
|
21
17
|
}
|
22
18
|
});
|
23
19
|
};
|
24
|
-
|
25
20
|
exports.core = core;
|
@@ -5,37 +5,26 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.babel = babel;
|
7
7
|
exports.previewAnnotations = void 0;
|
8
|
-
|
9
8
|
var _emberTemplateCompiler = require("ember-source/dist/ember-template-compiler");
|
10
|
-
|
11
9
|
var _coreCommon = require("@storybook/core-common");
|
12
|
-
|
13
10
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
14
|
-
|
15
11
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
16
|
-
|
17
12
|
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; }
|
18
|
-
|
19
13
|
var emberOptions;
|
20
|
-
|
21
14
|
function precompileWithPlugins(string, options) {
|
22
15
|
var precompileOptions = options;
|
23
|
-
|
24
16
|
if (emberOptions && emberOptions.polyfills) {
|
25
17
|
precompileOptions.plugins = {
|
26
18
|
ast: emberOptions.polyfills
|
27
19
|
};
|
28
20
|
}
|
29
|
-
|
30
21
|
return (0, _emberTemplateCompiler.precompile)(string, precompileOptions);
|
31
22
|
}
|
32
|
-
|
33
23
|
function babel(config, options) {
|
34
24
|
if (options && options.presetsList) {
|
35
25
|
options.presetsList.forEach(function (e, index) {
|
36
26
|
if (e.preset && e.preset.emberOptions) {
|
37
27
|
emberOptions = e.preset.emberOptions;
|
38
|
-
|
39
28
|
if (options.presetsList) {
|
40
29
|
// eslint-disable-next-line no-param-reassign
|
41
30
|
delete options.presetsList[index].preset.emberOptions;
|
@@ -43,7 +32,6 @@ function babel(config, options) {
|
|
43
32
|
}
|
44
33
|
});
|
45
34
|
}
|
46
|
-
|
47
35
|
var babelConfigPlugins = config.plugins || [];
|
48
36
|
var extraPlugins = [[require.resolve('babel-plugin-htmlbars-inline-precompile'), {
|
49
37
|
precompile: precompileWithPlugins,
|
@@ -57,9 +45,7 @@ function babel(config, options) {
|
|
57
45
|
plugins: [...babelConfigPlugins, ...extraPlugins]
|
58
46
|
});
|
59
47
|
}
|
60
|
-
|
61
48
|
var previewAnnotations = function (entry = []) {
|
62
49
|
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/preview/config')];
|
63
50
|
};
|
64
|
-
|
65
51
|
exports.previewAnnotations = previewAnnotations;
|
@@ -4,14 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.previewAnnotations = void 0;
|
7
|
-
|
8
7
|
var _coreCommon = require("@storybook/core-common");
|
9
|
-
|
10
8
|
var _docsTools = require("@storybook/docs-tools");
|
11
|
-
|
12
9
|
var previewAnnotations = function (entry = [], options) {
|
13
10
|
if (!(0, _docsTools.hasDocsOrControls)(options)) return entry;
|
14
11
|
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/docs/config')];
|
15
12
|
};
|
16
|
-
|
17
13
|
exports.previewAnnotations = previewAnnotations;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
2
|
-
|
3
2
|
/* global window */
|
3
|
+
|
4
4
|
export const setJSONDoc = jsondoc => {
|
5
5
|
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
6
6
|
};
|
@@ -9,17 +9,13 @@ export const getJSONDoc = () => {
|
|
9
9
|
};
|
10
10
|
export const extractArgTypes = componentName => {
|
11
11
|
const json = getJSONDoc();
|
12
|
-
|
13
12
|
if (!(json && json.included)) {
|
14
13
|
return null;
|
15
14
|
}
|
16
|
-
|
17
15
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
18
|
-
|
19
16
|
if (!componentDoc) {
|
20
17
|
return null;
|
21
18
|
}
|
22
|
-
|
23
19
|
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
24
20
|
acc[prop.name] = {
|
25
21
|
name: prop.name,
|
@@ -40,16 +36,12 @@ export const extractArgTypes = componentName => {
|
|
40
36
|
};
|
41
37
|
export const extractComponentDescription = componentName => {
|
42
38
|
const json = getJSONDoc();
|
43
|
-
|
44
39
|
if (!(json && json.included)) {
|
45
40
|
return null;
|
46
41
|
}
|
47
|
-
|
48
42
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
49
|
-
|
50
43
|
if (!componentDoc) {
|
51
44
|
return null;
|
52
45
|
}
|
53
|
-
|
54
46
|
return componentDoc.attributes.description;
|
55
47
|
};
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/* eslint-disable no-underscore-dangle */
|
2
|
-
|
3
2
|
/* global window */
|
3
|
+
|
4
4
|
export const setJSONDoc = jsondoc => {
|
5
5
|
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
6
6
|
};
|
@@ -9,17 +9,13 @@ export const getJSONDoc = () => {
|
|
9
9
|
};
|
10
10
|
export const extractArgTypes = componentName => {
|
11
11
|
const json = getJSONDoc();
|
12
|
-
|
13
12
|
if (!(json && json.included)) {
|
14
13
|
return null;
|
15
14
|
}
|
16
|
-
|
17
15
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
18
|
-
|
19
16
|
if (!componentDoc) {
|
20
17
|
return null;
|
21
18
|
}
|
22
|
-
|
23
19
|
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
24
20
|
acc[prop.name] = {
|
25
21
|
name: prop.name,
|
@@ -40,16 +36,12 @@ export const extractArgTypes = componentName => {
|
|
40
36
|
};
|
41
37
|
export const extractComponentDescription = componentName => {
|
42
38
|
const json = getJSONDoc();
|
43
|
-
|
44
39
|
if (!(json && json.included)) {
|
45
40
|
return null;
|
46
41
|
}
|
47
|
-
|
48
42
|
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
49
|
-
|
50
43
|
if (!componentDoc) {
|
51
44
|
return null;
|
52
45
|
}
|
53
|
-
|
54
46
|
return componentDoc.attributes.description;
|
55
47
|
};
|
@@ -8,18 +8,14 @@ const {
|
|
8
8
|
document
|
9
9
|
} = global;
|
10
10
|
const rootEl = document.getElementById('storybook-root');
|
11
|
-
|
12
11
|
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
13
|
-
|
14
12
|
const app = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/app`).default.create(Object.assign({
|
15
13
|
autoboot: false,
|
16
14
|
rootElement: rootEl
|
17
15
|
}, config.APP));
|
18
|
-
|
19
16
|
let lastPromise = app.boot();
|
20
17
|
let hasRendered = false;
|
21
18
|
let isRendering = false;
|
22
|
-
|
23
19
|
function render(options, el) {
|
24
20
|
if (isRendering) return;
|
25
21
|
isRendering = true;
|
@@ -28,11 +24,9 @@ function render(options, el) {
|
|
28
24
|
context = {},
|
29
25
|
element
|
30
26
|
} = options;
|
31
|
-
|
32
27
|
if (hasRendered) {
|
33
28
|
lastPromise = lastPromise.then(instance => instance.destroy());
|
34
29
|
}
|
35
|
-
|
36
30
|
lastPromise = lastPromise.then(() => {
|
37
31
|
const appInstancePrivate = app.buildInstance();
|
38
32
|
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
@@ -41,20 +35,17 @@ function render(options, el) {
|
|
41
35
|
layout: template || options
|
42
36
|
}, context)));
|
43
37
|
const component = instance.lookup('component:story-mode');
|
44
|
-
|
45
38
|
if (element) {
|
46
39
|
component.appendTo(element);
|
47
40
|
element.appendTo(el);
|
48
41
|
} else {
|
49
42
|
component.appendTo(el);
|
50
43
|
}
|
51
|
-
|
52
44
|
hasRendered = true;
|
53
45
|
isRendering = false;
|
54
46
|
return instance;
|
55
47
|
});
|
56
48
|
}
|
57
|
-
|
58
49
|
export function renderToCanvas({
|
59
50
|
storyFn,
|
60
51
|
kind,
|
@@ -63,7 +54,6 @@ export function renderToCanvas({
|
|
63
54
|
showError
|
64
55
|
}, canvasElement) {
|
65
56
|
const element = storyFn();
|
66
|
-
|
67
57
|
if (!element) {
|
68
58
|
showError({
|
69
59
|
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
@@ -76,7 +66,6 @@ export function renderToCanvas({
|
|
76
66
|
});
|
77
67
|
return;
|
78
68
|
}
|
79
|
-
|
80
69
|
showMain();
|
81
70
|
render(element, canvasElement);
|
82
71
|
}
|
package/dist/esm/index.js
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
/// <reference types="webpack-env" />
|
2
|
-
export { storiesOf, configure, forceReRender, raw } from './client/preview'; // optimization: stop HMR propagation in webpack
|
3
2
|
|
3
|
+
export { storiesOf, configure, forceReRender, raw } from './client/preview';
|
4
|
+
|
5
|
+
// optimization: stop HMR propagation in webpack
|
4
6
|
module?.hot?.decline();
|
@@ -1,31 +1,23 @@
|
|
1
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
2
|
-
|
3
2
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
4
|
-
|
5
3
|
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; }
|
6
|
-
|
7
4
|
import { precompile } from 'ember-source/dist/ember-template-compiler';
|
8
5
|
import { findDistEsm } from '@storybook/core-common';
|
9
6
|
var emberOptions;
|
10
|
-
|
11
7
|
function precompileWithPlugins(string, options) {
|
12
8
|
var precompileOptions = options;
|
13
|
-
|
14
9
|
if (emberOptions && emberOptions.polyfills) {
|
15
10
|
precompileOptions.plugins = {
|
16
11
|
ast: emberOptions.polyfills
|
17
12
|
};
|
18
13
|
}
|
19
|
-
|
20
14
|
return precompile(string, precompileOptions);
|
21
15
|
}
|
22
|
-
|
23
16
|
export function babel(config, options) {
|
24
17
|
if (options && options.presetsList) {
|
25
18
|
options.presetsList.forEach(function (e, index) {
|
26
19
|
if (e.preset && e.preset.emberOptions) {
|
27
20
|
emberOptions = e.preset.emberOptions;
|
28
|
-
|
29
21
|
if (options.presetsList) {
|
30
22
|
// eslint-disable-next-line no-param-reassign
|
31
23
|
delete options.presetsList[index].preset.emberOptions;
|
@@ -33,7 +25,6 @@ export function babel(config, options) {
|
|
33
25
|
}
|
34
26
|
});
|
35
27
|
}
|
36
|
-
|
37
28
|
var babelConfigPlugins = config.plugins || [];
|
38
29
|
var extraPlugins = [[require.resolve('babel-plugin-htmlbars-inline-precompile'), {
|
39
30
|
precompile: precompileWithPlugins,
|
@@ -12,7 +12,7 @@ export interface OptionsArgs {
|
|
12
12
|
/**
|
13
13
|
* @deprecated Use `EmberRenderer` instead.
|
14
14
|
*/
|
15
|
-
export
|
15
|
+
export type EmberFramework = EmberRenderer;
|
16
16
|
export interface EmberRenderer extends WebRenderer {
|
17
17
|
component: any;
|
18
18
|
storyResult: OptionsArgs;
|
@@ -1,11 +1,11 @@
|
|
1
1
|
import type { StorybookConfig as StorybookConfigBase, TypescriptOptions as TypescriptOptionsReact } from '@storybook/core-webpack';
|
2
2
|
import type { StorybookConfigWebpack, BuilderOptions, TypescriptOptions as TypescriptOptionsBuilder } from '@storybook/builder-webpack5';
|
3
|
-
|
4
|
-
|
5
|
-
export
|
3
|
+
type FrameworkName = '@storybook/ember-webpack5';
|
4
|
+
type BuilderName = '@storybook/builder-webpack5';
|
5
|
+
export type FrameworkOptions = {
|
6
6
|
builder?: BuilderOptions;
|
7
7
|
};
|
8
|
-
|
8
|
+
type StorybookConfigFramework = {
|
9
9
|
framework: FrameworkName | {
|
10
10
|
name: FrameworkName;
|
11
11
|
options: FrameworkOptions;
|
@@ -21,5 +21,5 @@ declare type StorybookConfigFramework = {
|
|
21
21
|
/**
|
22
22
|
* The interface for Storybook configuration in `main.ts` files.
|
23
23
|
*/
|
24
|
-
export
|
24
|
+
export type StorybookConfig = Omit<StorybookConfigBase, keyof StorybookConfigWebpack | keyof StorybookConfigFramework> & StorybookConfigWebpack & StorybookConfigFramework;
|
25
25
|
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/ember",
|
3
|
-
"version": "7.0.0-alpha.
|
3
|
+
"version": "7.0.0-alpha.51",
|
4
4
|
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
5
5
|
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/ember",
|
6
6
|
"bugs": {
|
@@ -31,12 +31,12 @@
|
|
31
31
|
"prep": "node ../../../scripts/prepare.js"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@storybook/builder-webpack5": "7.0.0-alpha.
|
35
|
-
"@storybook/core-client": "7.0.0-alpha.
|
36
|
-
"@storybook/core-common": "7.0.0-alpha.
|
37
|
-
"@storybook/docs-tools": "7.0.0-alpha.
|
38
|
-
"@storybook/store": "7.0.0-alpha.
|
39
|
-
"@storybook/types": "7.0.0-alpha.
|
34
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.51",
|
35
|
+
"@storybook/core-client": "7.0.0-alpha.51",
|
36
|
+
"@storybook/core-common": "7.0.0-alpha.51",
|
37
|
+
"@storybook/docs-tools": "7.0.0-alpha.51",
|
38
|
+
"@storybook/store": "7.0.0-alpha.51",
|
39
|
+
"@storybook/types": "7.0.0-alpha.51",
|
40
40
|
"global": "^4.4.0",
|
41
41
|
"react": "16.14.0",
|
42
42
|
"react-dom": "16.14.0",
|
@@ -45,7 +45,7 @@
|
|
45
45
|
},
|
46
46
|
"devDependencies": {
|
47
47
|
"ember-source": "~3.28.1",
|
48
|
-
"typescript": "
|
48
|
+
"typescript": "^4.9.3"
|
49
49
|
},
|
50
50
|
"peerDependencies": {
|
51
51
|
"@babel/core": "*",
|
@@ -60,5 +60,5 @@
|
|
60
60
|
"publishConfig": {
|
61
61
|
"access": "public"
|
62
62
|
},
|
63
|
-
"gitHead": "
|
63
|
+
"gitHead": "4fec76c3f5135854d9834ebc1cf2f1f325696ded"
|
64
64
|
}
|
@@ -2,20 +2,19 @@ import { hbs } from 'ember-cli-htmlbars';
|
|
2
2
|
import { action } from '@storybook/addon-actions';
|
3
3
|
import { linkTo } from '@storybook/addon-links';
|
4
4
|
|
5
|
-
// More on
|
5
|
+
// More on how to set up stories at: https://storybook.js.org/docs/7.0/ember/writing-stories/introduction
|
6
6
|
export default {
|
7
|
-
title: 'Button',
|
7
|
+
title: 'Example/Button',
|
8
8
|
render: (args) => ({
|
9
9
|
template: hbs`<button {{action onClick}}>{{label}}</button>`,
|
10
10
|
context: args,
|
11
11
|
}),
|
12
|
-
// More on argTypes: https://storybook.js.org/docs/ember/api/argtypes
|
13
12
|
argTypes: {
|
14
13
|
label: { control: 'text' },
|
15
14
|
},
|
16
15
|
};
|
17
16
|
|
18
|
-
// More on
|
17
|
+
// More on writing stories with args: https://storybook.js.org/docs/7.0/ember/writing-stories/args
|
19
18
|
export const Text = {
|
20
19
|
args: {
|
21
20
|
label: 'Button',
|