@storybook/ember 7.0.0-beta.9 → 7.0.0-rc.1
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/README.md +8 -5
- package/dist/{types/src/client → client}/preview/config.d.ts +1 -1
- package/dist/client/preview/config.js +6 -0
- package/dist/client/preview/globals.js +5 -0
- package/dist/{types/src/client → client}/preview/index.d.ts +1 -1
- package/dist/client/preview/index.js +14 -0
- package/dist/client/preview/render.js +70 -0
- package/dist/client/preview/types.js +2 -0
- package/dist/index.js +11 -0
- package/dist/{esm/index.js → index.mjs} +1 -3
- package/dist/preset.js +22 -0
- package/dist/preset.mjs +15 -0
- package/dist/server/framework-preset-babel-ember.js +50 -0
- package/dist/server/framework-preset-ember-docs.js +11 -0
- package/dist/types.js +2 -0
- package/dist/types.mjs +1 -0
- package/package.json +13 -13
- package/template/cli/Button.stories.js +2 -0
- package/dist/cjs/client/docs/config.js +0 -18
- package/dist/cjs/client/docs/index.js +0 -12
- package/dist/cjs/client/docs/jsondoc.js +0 -57
- package/dist/cjs/client/preview/config.js +0 -17
- package/dist/cjs/client/preview/docs/config.js +0 -15
- package/dist/cjs/client/preview/docs/index.js +0 -12
- package/dist/cjs/client/preview/docs/jsondoc.js +0 -57
- package/dist/cjs/client/preview/globals.js +0 -9
- package/dist/cjs/client/preview/index.js +0 -26
- package/dist/cjs/client/preview/render.js +0 -78
- package/dist/cjs/client/preview/types.js +0 -5
- package/dist/cjs/index.js +0 -33
- package/dist/cjs/preset.js +0 -20
- package/dist/cjs/server/framework-preset-babel-ember.js +0 -53
- package/dist/cjs/server/framework-preset-ember-docs.js +0 -13
- package/dist/cjs/types.js +0 -5
- package/dist/esm/client/docs/config.js +0 -10
- package/dist/esm/client/docs/index.js +0 -1
- package/dist/esm/client/docs/jsondoc.js +0 -47
- package/dist/esm/client/preview/config.js +0 -4
- package/dist/esm/client/preview/docs/config.js +0 -8
- package/dist/esm/client/preview/docs/index.js +0 -1
- package/dist/esm/client/preview/docs/jsondoc.js +0 -47
- package/dist/esm/client/preview/globals.js +0 -6
- package/dist/esm/client/preview/index.js +0 -17
- package/dist/esm/client/preview/render.js +0 -71
- package/dist/esm/client/preview/types.js +0 -1
- package/dist/esm/preset.js +0 -11
- package/dist/esm/server/framework-preset-babel-ember.js +0 -45
- package/dist/esm/server/framework-preset-ember-docs.js +0 -6
- package/dist/esm/types.js +0 -1
- /package/dist/{types/src/client → client}/preview/globals.d.ts +0 -0
- /package/dist/{types/src/client → client}/preview/render.d.ts +0 -0
- /package/dist/{types/src/client → client}/preview/types.d.ts +0 -0
- /package/dist/{types/src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{types/src/preset.d.ts → preset.d.ts} +0 -0
- /package/dist/{types/src/server → server}/framework-preset-babel-ember.d.ts +0 -0
- /package/dist/{types/src/server → server}/framework-preset-ember-docs.d.ts +0 -0
- /package/dist/{types/src/types.d.ts → types.d.ts} +0 -0
package/README.md
CHANGED
@@ -39,11 +39,14 @@ This example also assume that you already have the package in your `package.json
|
|
39
39
|
In your `.storybook/main.js` you can add the following lines:
|
40
40
|
|
41
41
|
```javascript
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
42
|
+
import namedBlockPolyfill from 'ember-named-blocks-polyfill/lib/named-blocks-polyfill-plugin';
|
43
|
+
|
44
|
+
export default {
|
45
|
+
framework: {
|
46
|
+
name: '@storybook/ember',
|
47
|
+
options: {
|
48
|
+
polyfills: [namedBlockPolyfill],
|
49
|
+
}
|
47
50
|
},
|
48
51
|
[...]
|
49
52
|
};
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.parameters = exports.renderToCanvas = void 0;
|
4
|
+
var render_1 = require("./render");
|
5
|
+
Object.defineProperty(exports, "renderToCanvas", { enumerable: true, get: function () { return render_1.renderToCanvas; } });
|
6
|
+
exports.parameters = { renderer: 'ember' };
|
@@ -3,5 +3,5 @@ import type { EmberRenderer } from './types';
|
|
3
3
|
declare const forceReRender: () => void;
|
4
4
|
export declare const raw: ((...args: any[]) => never) | (() => import("lib/types/dist").BoundStory<EmberRenderer>[] | undefined);
|
5
5
|
export declare const storiesOf: (kind: string, m: any) => import("lib/types/dist").Addon_StoryApi<import("./types").OptionsArgs>;
|
6
|
-
export declare const configure: (
|
6
|
+
export declare const configure: (...args: any[]) => any;
|
7
7
|
export { forceReRender };
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.forceReRender = exports.configure = exports.storiesOf = exports.raw = void 0;
|
4
|
+
const preview_api_1 = require("@storybook/preview-api");
|
5
|
+
require("./globals");
|
6
|
+
const render_1 = require("./render");
|
7
|
+
const { configure: coreConfigure, clientApi, forceReRender } = (0, preview_api_1.start)(render_1.renderToCanvas);
|
8
|
+
exports.forceReRender = forceReRender;
|
9
|
+
exports.raw = clientApi.raw;
|
10
|
+
const RENDERER = 'ember';
|
11
|
+
const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({ renderer: RENDERER });
|
12
|
+
exports.storiesOf = storiesOf;
|
13
|
+
const configure = (...args) => coreConfigure(RENDERER, ...args);
|
14
|
+
exports.configure = configure;
|
@@ -0,0 +1,70 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.renderToCanvas = void 0;
|
7
|
+
const global_1 = require("@storybook/global");
|
8
|
+
const ts_dedent_1 = require("ts-dedent");
|
9
|
+
// @ts-expect-error (Converted from ts-ignore)
|
10
|
+
const component_1 = __importDefault(require("@ember/component")); // eslint-disable-line import/no-unresolved
|
11
|
+
const { document } = global_1.global;
|
12
|
+
const rootEl = document.getElementById('storybook-root');
|
13
|
+
const config = global_1.global.require(`${global_1.global.STORYBOOK_NAME}/config/environment`);
|
14
|
+
const app = global_1.global.require(`${global_1.global.STORYBOOK_NAME}/app`).default.create({
|
15
|
+
autoboot: false,
|
16
|
+
rootElement: rootEl,
|
17
|
+
...config.APP,
|
18
|
+
});
|
19
|
+
let lastPromise = app.boot();
|
20
|
+
let hasRendered = false;
|
21
|
+
let isRendering = false;
|
22
|
+
function render(options, el) {
|
23
|
+
if (isRendering)
|
24
|
+
return;
|
25
|
+
isRendering = true;
|
26
|
+
const { template, context = {}, element } = options;
|
27
|
+
if (hasRendered) {
|
28
|
+
lastPromise = lastPromise.then((instance) => instance.destroy());
|
29
|
+
}
|
30
|
+
lastPromise = lastPromise
|
31
|
+
.then(() => {
|
32
|
+
const appInstancePrivate = app.buildInstance();
|
33
|
+
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
34
|
+
})
|
35
|
+
.then((instance) => {
|
36
|
+
instance.register('component:story-mode', component_1.default.extend({
|
37
|
+
layout: template || options,
|
38
|
+
...context,
|
39
|
+
}));
|
40
|
+
const component = instance.lookup('component:story-mode');
|
41
|
+
if (element) {
|
42
|
+
component.appendTo(element);
|
43
|
+
element.appendTo(el);
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
component.appendTo(el);
|
47
|
+
}
|
48
|
+
hasRendered = true;
|
49
|
+
isRendering = false;
|
50
|
+
return instance;
|
51
|
+
});
|
52
|
+
}
|
53
|
+
function renderToCanvas({ storyFn, kind, name, showMain, showError }, canvasElement) {
|
54
|
+
const element = storyFn();
|
55
|
+
if (!element) {
|
56
|
+
showError({
|
57
|
+
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
58
|
+
description: (0, ts_dedent_1.dedent) `
|
59
|
+
Did you forget to return the Ember element from the story?
|
60
|
+
Use "() => hbs('{{component}}')" or "() => { return {
|
61
|
+
template: hbs\`{{component}}\`
|
62
|
+
} }" when defining the story.
|
63
|
+
`,
|
64
|
+
});
|
65
|
+
return;
|
66
|
+
}
|
67
|
+
showMain();
|
68
|
+
render(element, canvasElement);
|
69
|
+
}
|
70
|
+
exports.renderToCanvas = renderToCanvas;
|
package/dist/index.js
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
/// <reference types="webpack-env" />
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.raw = exports.forceReRender = exports.configure = exports.storiesOf = void 0;
|
5
|
+
var preview_1 = require("./client/preview");
|
6
|
+
Object.defineProperty(exports, "storiesOf", { enumerable: true, get: function () { return preview_1.storiesOf; } });
|
7
|
+
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return preview_1.configure; } });
|
8
|
+
Object.defineProperty(exports, "forceReRender", { enumerable: true, get: function () { return preview_1.forceReRender; } });
|
9
|
+
Object.defineProperty(exports, "raw", { enumerable: true, get: function () { return preview_1.raw; } });
|
10
|
+
// optimization: stop HMR propagation in webpack
|
11
|
+
module?.hot?.decline();
|
package/dist/preset.js
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
exports.core = exports.addons = void 0;
|
7
|
+
const path_1 = __importDefault(require("path"));
|
8
|
+
exports.addons = [
|
9
|
+
require.resolve('./server/framework-preset-babel-ember'),
|
10
|
+
require.resolve('./server/framework-preset-ember-docs'),
|
11
|
+
];
|
12
|
+
const core = async (config, options) => {
|
13
|
+
const framework = await options.presets.apply('framework');
|
14
|
+
return {
|
15
|
+
...config,
|
16
|
+
builder: {
|
17
|
+
name: path_1.default.dirname(require.resolve(path_1.default.join('@storybook/builder-webpack5', 'package.json'))),
|
18
|
+
options: typeof framework === 'string' ? {} : framework.options.builder || {},
|
19
|
+
},
|
20
|
+
};
|
21
|
+
};
|
22
|
+
exports.core = core;
|
package/dist/preset.mjs
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
import path from 'path';
|
2
|
+
export const addons = [
|
3
|
+
require.resolve('./server/framework-preset-babel-ember'),
|
4
|
+
require.resolve('./server/framework-preset-ember-docs'),
|
5
|
+
];
|
6
|
+
export const core = async (config, options) => {
|
7
|
+
const framework = await options.presets.apply('framework');
|
8
|
+
return {
|
9
|
+
...config,
|
10
|
+
builder: {
|
11
|
+
name: path.dirname(require.resolve(path.join('@storybook/builder-webpack5', 'package.json'))),
|
12
|
+
options: typeof framework === 'string' ? {} : framework.options.builder || {},
|
13
|
+
},
|
14
|
+
};
|
15
|
+
};
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.previewAnnotations = exports.babel = void 0;
|
4
|
+
const ember_template_compiler_1 = require("ember-source/dist/ember-template-compiler");
|
5
|
+
const core_common_1 = require("@storybook/core-common");
|
6
|
+
let emberOptions;
|
7
|
+
function precompileWithPlugins(string, options) {
|
8
|
+
const precompileOptions = options;
|
9
|
+
if (emberOptions && emberOptions.polyfills) {
|
10
|
+
precompileOptions.plugins = { ast: emberOptions.polyfills };
|
11
|
+
}
|
12
|
+
return (0, ember_template_compiler_1.precompile)(string, precompileOptions);
|
13
|
+
}
|
14
|
+
function babel(config, options) {
|
15
|
+
if (options && options.presetsList) {
|
16
|
+
options.presetsList.forEach((e, index) => {
|
17
|
+
if (e.preset && e.preset.emberOptions) {
|
18
|
+
emberOptions = e.preset.emberOptions;
|
19
|
+
if (options.presetsList) {
|
20
|
+
// eslint-disable-next-line no-param-reassign
|
21
|
+
delete options.presetsList[index].preset.emberOptions;
|
22
|
+
}
|
23
|
+
}
|
24
|
+
});
|
25
|
+
}
|
26
|
+
const babelConfigPlugins = config.plugins || [];
|
27
|
+
const extraPlugins = [
|
28
|
+
[
|
29
|
+
require.resolve('babel-plugin-htmlbars-inline-precompile'),
|
30
|
+
{
|
31
|
+
precompile: precompileWithPlugins,
|
32
|
+
modules: {
|
33
|
+
'ember-cli-htmlbars': 'hbs',
|
34
|
+
'ember-cli-htmlbars-inline-precompile': 'default',
|
35
|
+
'htmlbars-inline-precompile': 'default',
|
36
|
+
},
|
37
|
+
},
|
38
|
+
],
|
39
|
+
[require.resolve('babel-plugin-ember-modules-api-polyfill')],
|
40
|
+
];
|
41
|
+
return {
|
42
|
+
...config,
|
43
|
+
plugins: [...babelConfigPlugins, ...extraPlugins],
|
44
|
+
};
|
45
|
+
}
|
46
|
+
exports.babel = babel;
|
47
|
+
const previewAnnotations = (entry = []) => {
|
48
|
+
return [...entry, (0, core_common_1.findDistEsm)(__dirname, 'client/preview/config')];
|
49
|
+
};
|
50
|
+
exports.previewAnnotations = previewAnnotations;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.previewAnnotations = void 0;
|
4
|
+
const core_common_1 = require("@storybook/core-common");
|
5
|
+
const docs_tools_1 = require("@storybook/docs-tools");
|
6
|
+
const previewAnnotations = (entry = [], options) => {
|
7
|
+
if (!(0, docs_tools_1.hasDocsOrControls)(options))
|
8
|
+
return entry;
|
9
|
+
return [...entry, (0, core_common_1.findDistEsm)(__dirname, 'client/docs/config')];
|
10
|
+
};
|
11
|
+
exports.previewAnnotations = previewAnnotations;
|
package/dist/types.js
ADDED
package/dist/types.mjs
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/ember",
|
3
|
-
"version": "7.0.0-
|
3
|
+
"version": "7.0.0-rc.1",
|
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": {
|
@@ -16,9 +16,9 @@
|
|
16
16
|
"url": "https://opencollective.com/storybook"
|
17
17
|
},
|
18
18
|
"license": "MIT",
|
19
|
-
"main": "dist/
|
20
|
-
"module": "dist/
|
21
|
-
"types": "dist/
|
19
|
+
"main": "dist/index.js",
|
20
|
+
"module": "dist/index.mjs",
|
21
|
+
"types": "dist/index.d.ts",
|
22
22
|
"files": [
|
23
23
|
"dist/**/*",
|
24
24
|
"template/**/*",
|
@@ -28,16 +28,15 @@
|
|
28
28
|
],
|
29
29
|
"scripts": {
|
30
30
|
"check": "../../../scripts/node_modules/.bin/tsc --noEmit",
|
31
|
-
"prep": "
|
31
|
+
"prep": "../../../scripts/prepare/tsc.ts"
|
32
32
|
},
|
33
33
|
"dependencies": {
|
34
|
-
"@storybook/builder-webpack5": "7.0.0-
|
35
|
-
"@storybook/core-common": "7.0.0-
|
36
|
-
"@storybook/docs-tools": "7.0.0-
|
37
|
-
"@storybook/
|
38
|
-
"@storybook/
|
39
|
-
"
|
40
|
-
"read-pkg-up": "^7.0.1",
|
34
|
+
"@storybook/builder-webpack5": "7.0.0-rc.1",
|
35
|
+
"@storybook/core-common": "7.0.0-rc.1",
|
36
|
+
"@storybook/docs-tools": "7.0.0-rc.1",
|
37
|
+
"@storybook/global": "^5.0.0",
|
38
|
+
"@storybook/preview-api": "7.0.0-rc.1",
|
39
|
+
"@storybook/types": "7.0.0-rc.1",
|
41
40
|
"ts-dedent": "^2.0.0"
|
42
41
|
},
|
43
42
|
"devDependencies": {
|
@@ -59,5 +58,6 @@
|
|
59
58
|
"publishConfig": {
|
60
59
|
"access": "public"
|
61
60
|
},
|
62
|
-
"
|
61
|
+
"bundler": {},
|
62
|
+
"gitHead": "115d69123dc7c4dfab9538d2b273cb0fcc372852"
|
63
63
|
}
|
@@ -12,6 +12,8 @@ export default {
|
|
12
12
|
argTypes: {
|
13
13
|
label: { control: 'text' },
|
14
14
|
},
|
15
|
+
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/7.0/react/writing-docs/docs-page
|
16
|
+
tags: ['autodocs'],
|
15
17
|
};
|
16
18
|
|
17
19
|
// More on writing stories with args: https://storybook.js.org/docs/7.0/ember/writing-stories/args
|
@@ -1,18 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.parameters = exports.argTypesEnhancers = void 0;
|
7
|
-
var _docsTools = require("@storybook/docs-tools");
|
8
|
-
var _jsondoc = require("./jsondoc");
|
9
|
-
const parameters = {
|
10
|
-
docs: {
|
11
|
-
iframeHeight: 80,
|
12
|
-
extractArgTypes: _jsondoc.extractArgTypes,
|
13
|
-
extractComponentDescription: _jsondoc.extractComponentDescription
|
14
|
-
}
|
15
|
-
};
|
16
|
-
exports.parameters = parameters;
|
17
|
-
const argTypesEnhancers = [_docsTools.enhanceArgTypes];
|
18
|
-
exports.argTypesEnhancers = argTypesEnhancers;
|
@@ -1,57 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.setJSONDoc = exports.getJSONDoc = exports.extractComponentDescription = exports.extractArgTypes = void 0;
|
7
|
-
/* eslint-disable no-underscore-dangle */
|
8
|
-
/* global window */
|
9
|
-
|
10
|
-
const setJSONDoc = jsondoc => {
|
11
|
-
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
12
|
-
};
|
13
|
-
exports.setJSONDoc = setJSONDoc;
|
14
|
-
const getJSONDoc = () => {
|
15
|
-
return window.__EMBER_GENERATED_DOC_JSON__;
|
16
|
-
};
|
17
|
-
exports.getJSONDoc = getJSONDoc;
|
18
|
-
const extractArgTypes = componentName => {
|
19
|
-
const json = getJSONDoc();
|
20
|
-
if (!(json && json.included)) {
|
21
|
-
return null;
|
22
|
-
}
|
23
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
24
|
-
if (!componentDoc) {
|
25
|
-
return null;
|
26
|
-
}
|
27
|
-
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
28
|
-
acc[prop.name] = {
|
29
|
-
name: prop.name,
|
30
|
-
defaultValue: prop.defaultValue,
|
31
|
-
description: prop.description,
|
32
|
-
table: {
|
33
|
-
defaultValue: {
|
34
|
-
summary: prop.defaultValue
|
35
|
-
},
|
36
|
-
type: {
|
37
|
-
summary: prop.type,
|
38
|
-
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
39
|
-
}
|
40
|
-
}
|
41
|
-
};
|
42
|
-
return acc;
|
43
|
-
}, {});
|
44
|
-
};
|
45
|
-
exports.extractArgTypes = extractArgTypes;
|
46
|
-
const extractComponentDescription = componentName => {
|
47
|
-
const json = getJSONDoc();
|
48
|
-
if (!(json && json.included)) {
|
49
|
-
return null;
|
50
|
-
}
|
51
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
52
|
-
if (!componentDoc) {
|
53
|
-
return null;
|
54
|
-
}
|
55
|
-
return componentDoc.attributes.description;
|
56
|
-
};
|
57
|
-
exports.extractComponentDescription = extractComponentDescription;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.parameters = void 0;
|
7
|
-
Object.defineProperty(exports, "renderToCanvas", {
|
8
|
-
enumerable: true,
|
9
|
-
get: function () {
|
10
|
-
return _render.renderToCanvas;
|
11
|
-
}
|
12
|
-
});
|
13
|
-
var _render = require("./render");
|
14
|
-
const parameters = {
|
15
|
-
framework: 'ember'
|
16
|
-
};
|
17
|
-
exports.parameters = parameters;
|
@@ -1,15 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.parameters = void 0;
|
7
|
-
var _jsondoc = require("./jsondoc");
|
8
|
-
const parameters = {
|
9
|
-
docs: {
|
10
|
-
iframeHeight: 80,
|
11
|
-
extractArgTypes: _jsondoc.extractArgTypes,
|
12
|
-
extractComponentDescription: _jsondoc.extractComponentDescription
|
13
|
-
}
|
14
|
-
};
|
15
|
-
exports.parameters = parameters;
|
@@ -1,57 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.setJSONDoc = exports.getJSONDoc = exports.extractComponentDescription = exports.extractArgTypes = void 0;
|
7
|
-
/* eslint-disable no-underscore-dangle */
|
8
|
-
/* global window */
|
9
|
-
|
10
|
-
const setJSONDoc = jsondoc => {
|
11
|
-
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
12
|
-
};
|
13
|
-
exports.setJSONDoc = setJSONDoc;
|
14
|
-
const getJSONDoc = () => {
|
15
|
-
return window.__EMBER_GENERATED_DOC_JSON__;
|
16
|
-
};
|
17
|
-
exports.getJSONDoc = getJSONDoc;
|
18
|
-
const extractArgTypes = componentName => {
|
19
|
-
const json = getJSONDoc();
|
20
|
-
if (!(json && json.included)) {
|
21
|
-
return null;
|
22
|
-
}
|
23
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
24
|
-
if (!componentDoc) {
|
25
|
-
return null;
|
26
|
-
}
|
27
|
-
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
28
|
-
acc[prop.name] = {
|
29
|
-
name: prop.name,
|
30
|
-
defaultValue: prop.defaultValue,
|
31
|
-
description: prop.description,
|
32
|
-
table: {
|
33
|
-
defaultValue: {
|
34
|
-
summary: prop.defaultValue
|
35
|
-
},
|
36
|
-
type: {
|
37
|
-
summary: prop.type,
|
38
|
-
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
39
|
-
}
|
40
|
-
}
|
41
|
-
};
|
42
|
-
return acc;
|
43
|
-
}, {});
|
44
|
-
};
|
45
|
-
exports.extractArgTypes = extractArgTypes;
|
46
|
-
const extractComponentDescription = componentName => {
|
47
|
-
const json = getJSONDoc();
|
48
|
-
if (!(json && json.included)) {
|
49
|
-
return null;
|
50
|
-
}
|
51
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
52
|
-
if (!componentDoc) {
|
53
|
-
return null;
|
54
|
-
}
|
55
|
-
return componentDoc.attributes.description;
|
56
|
-
};
|
57
|
-
exports.extractComponentDescription = extractComponentDescription;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _global = _interopRequireDefault(require("global"));
|
4
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
5
|
-
const {
|
6
|
-
window: globalWindow
|
7
|
-
} = _global.default;
|
8
|
-
globalWindow.STORYBOOK_NAME = process.env.STORYBOOK_NAME;
|
9
|
-
globalWindow.STORYBOOK_ENV = 'ember';
|
@@ -1,26 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.storiesOf = exports.raw = exports.forceReRender = exports.configure = void 0;
|
7
|
-
var _previewApi = require("@storybook/preview-api");
|
8
|
-
require("./globals");
|
9
|
-
var _render = require("./render");
|
10
|
-
const {
|
11
|
-
configure: coreConfigure,
|
12
|
-
clientApi,
|
13
|
-
forceReRender
|
14
|
-
} = (0, _previewApi.start)(_render.renderToCanvas);
|
15
|
-
exports.forceReRender = forceReRender;
|
16
|
-
const {
|
17
|
-
raw
|
18
|
-
} = clientApi;
|
19
|
-
exports.raw = raw;
|
20
|
-
const FRAMEWORK = 'ember';
|
21
|
-
const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({
|
22
|
-
framework: FRAMEWORK
|
23
|
-
});
|
24
|
-
exports.storiesOf = storiesOf;
|
25
|
-
const configure = (loadable, m) => coreConfigure(FRAMEWORK, loadable, m);
|
26
|
-
exports.configure = configure;
|
@@ -1,78 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.renderToCanvas = renderToCanvas;
|
7
|
-
var _global = _interopRequireDefault(require("global"));
|
8
|
-
var _tsDedent = require("ts-dedent");
|
9
|
-
var _component = _interopRequireDefault(require("@ember/component"));
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
11
|
-
// @ts-expect-error (Converted from ts-ignore)
|
12
|
-
|
13
|
-
const {
|
14
|
-
window: globalWindow,
|
15
|
-
document
|
16
|
-
} = _global.default;
|
17
|
-
const rootEl = document.getElementById('storybook-root');
|
18
|
-
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
19
|
-
const app = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/app`).default.create(Object.assign({
|
20
|
-
autoboot: false,
|
21
|
-
rootElement: rootEl
|
22
|
-
}, config.APP));
|
23
|
-
let lastPromise = app.boot();
|
24
|
-
let hasRendered = false;
|
25
|
-
let isRendering = false;
|
26
|
-
function render(options, el) {
|
27
|
-
if (isRendering) return;
|
28
|
-
isRendering = true;
|
29
|
-
const {
|
30
|
-
template,
|
31
|
-
context = {},
|
32
|
-
element
|
33
|
-
} = options;
|
34
|
-
if (hasRendered) {
|
35
|
-
lastPromise = lastPromise.then(instance => instance.destroy());
|
36
|
-
}
|
37
|
-
lastPromise = lastPromise.then(() => {
|
38
|
-
const appInstancePrivate = app.buildInstance();
|
39
|
-
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
40
|
-
}).then(instance => {
|
41
|
-
instance.register('component:story-mode', _component.default.extend(Object.assign({
|
42
|
-
layout: template || options
|
43
|
-
}, context)));
|
44
|
-
const component = instance.lookup('component:story-mode');
|
45
|
-
if (element) {
|
46
|
-
component.appendTo(element);
|
47
|
-
element.appendTo(el);
|
48
|
-
} else {
|
49
|
-
component.appendTo(el);
|
50
|
-
}
|
51
|
-
hasRendered = true;
|
52
|
-
isRendering = false;
|
53
|
-
return instance;
|
54
|
-
});
|
55
|
-
}
|
56
|
-
function renderToCanvas({
|
57
|
-
storyFn,
|
58
|
-
kind,
|
59
|
-
name,
|
60
|
-
showMain,
|
61
|
-
showError
|
62
|
-
}, canvasElement) {
|
63
|
-
const element = storyFn();
|
64
|
-
if (!element) {
|
65
|
-
showError({
|
66
|
-
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
67
|
-
description: (0, _tsDedent.dedent)`
|
68
|
-
Did you forget to return the Ember element from the story?
|
69
|
-
Use "() => hbs('{{component}}')" or "() => { return {
|
70
|
-
template: hbs\`{{component}}\`
|
71
|
-
} }" when defining the story.
|
72
|
-
`
|
73
|
-
});
|
74
|
-
return;
|
75
|
-
}
|
76
|
-
showMain();
|
77
|
-
render(element, canvasElement);
|
78
|
-
}
|
package/dist/cjs/index.js
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
Object.defineProperty(exports, "configure", {
|
7
|
-
enumerable: true,
|
8
|
-
get: function () {
|
9
|
-
return _preview.configure;
|
10
|
-
}
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "forceReRender", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function () {
|
15
|
-
return _preview.forceReRender;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
Object.defineProperty(exports, "raw", {
|
19
|
-
enumerable: true,
|
20
|
-
get: function () {
|
21
|
-
return _preview.raw;
|
22
|
-
}
|
23
|
-
});
|
24
|
-
Object.defineProperty(exports, "storiesOf", {
|
25
|
-
enumerable: true,
|
26
|
-
get: function () {
|
27
|
-
return _preview.storiesOf;
|
28
|
-
}
|
29
|
-
});
|
30
|
-
var _preview = require("./client/preview");
|
31
|
-
var _module, _module$hot;
|
32
|
-
// optimization: stop HMR propagation in webpack
|
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
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.core = exports.addons = void 0;
|
7
|
-
var _path = _interopRequireDefault(require("path"));
|
8
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
9
|
-
const addons = [require.resolve('./server/framework-preset-babel-ember'), require.resolve('./server/framework-preset-ember-docs')];
|
10
|
-
exports.addons = addons;
|
11
|
-
const core = async (config, options) => {
|
12
|
-
const framework = await options.presets.apply('framework');
|
13
|
-
return Object.assign({}, config, {
|
14
|
-
builder: {
|
15
|
-
name: _path.default.dirname(require.resolve(_path.default.join('@storybook/builder-webpack5', 'package.json'))),
|
16
|
-
options: typeof framework === 'string' ? {} : framework.options.builder || {}
|
17
|
-
}
|
18
|
-
});
|
19
|
-
};
|
20
|
-
exports.core = core;
|
@@ -1,53 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.babel = babel;
|
7
|
-
exports.previewAnnotations = void 0;
|
8
|
-
var _emberTemplateCompiler = require("ember-source/dist/ember-template-compiler");
|
9
|
-
var _coreCommon = require("@storybook/core-common");
|
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; }
|
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; }
|
12
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
13
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
14
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
15
|
-
var emberOptions;
|
16
|
-
function precompileWithPlugins(string, options) {
|
17
|
-
var precompileOptions = options;
|
18
|
-
if (emberOptions && emberOptions.polyfills) {
|
19
|
-
precompileOptions.plugins = {
|
20
|
-
ast: emberOptions.polyfills
|
21
|
-
};
|
22
|
-
}
|
23
|
-
return (0, _emberTemplateCompiler.precompile)(string, precompileOptions);
|
24
|
-
}
|
25
|
-
function babel(config, options) {
|
26
|
-
if (options && options.presetsList) {
|
27
|
-
options.presetsList.forEach(function (e, index) {
|
28
|
-
if (e.preset && e.preset.emberOptions) {
|
29
|
-
emberOptions = e.preset.emberOptions;
|
30
|
-
if (options.presetsList) {
|
31
|
-
// eslint-disable-next-line no-param-reassign
|
32
|
-
delete options.presetsList[index].preset.emberOptions;
|
33
|
-
}
|
34
|
-
}
|
35
|
-
});
|
36
|
-
}
|
37
|
-
var babelConfigPlugins = config.plugins || [];
|
38
|
-
var extraPlugins = [[require.resolve('babel-plugin-htmlbars-inline-precompile'), {
|
39
|
-
precompile: precompileWithPlugins,
|
40
|
-
modules: {
|
41
|
-
'ember-cli-htmlbars': 'hbs',
|
42
|
-
'ember-cli-htmlbars-inline-precompile': 'default',
|
43
|
-
'htmlbars-inline-precompile': 'default'
|
44
|
-
}
|
45
|
-
}], [require.resolve('babel-plugin-ember-modules-api-polyfill')]];
|
46
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
47
|
-
plugins: [...babelConfigPlugins, ...extraPlugins]
|
48
|
-
});
|
49
|
-
}
|
50
|
-
var previewAnnotations = function (entry = []) {
|
51
|
-
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/preview/config')];
|
52
|
-
};
|
53
|
-
exports.previewAnnotations = previewAnnotations;
|
@@ -1,13 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.previewAnnotations = void 0;
|
7
|
-
var _coreCommon = require("@storybook/core-common");
|
8
|
-
var _docsTools = require("@storybook/docs-tools");
|
9
|
-
var previewAnnotations = function (entry = [], options) {
|
10
|
-
if (!(0, _docsTools.hasDocsOrControls)(options)) return entry;
|
11
|
-
return [...entry, (0, _coreCommon.findDistEsm)(__dirname, 'client/docs/config')];
|
12
|
-
};
|
13
|
-
exports.previewAnnotations = previewAnnotations;
|
package/dist/cjs/types.js
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
import { enhanceArgTypes } from '@storybook/docs-tools';
|
2
|
-
import { extractArgTypes, extractComponentDescription } from './jsondoc';
|
3
|
-
export const parameters = {
|
4
|
-
docs: {
|
5
|
-
iframeHeight: 80,
|
6
|
-
extractArgTypes,
|
7
|
-
extractComponentDescription
|
8
|
-
}
|
9
|
-
};
|
10
|
-
export const argTypesEnhancers = [enhanceArgTypes];
|
@@ -1 +0,0 @@
|
|
1
|
-
export { setJSONDoc } from './jsondoc';
|
@@ -1,47 +0,0 @@
|
|
1
|
-
/* eslint-disable no-underscore-dangle */
|
2
|
-
/* global window */
|
3
|
-
|
4
|
-
export const setJSONDoc = jsondoc => {
|
5
|
-
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
6
|
-
};
|
7
|
-
export const getJSONDoc = () => {
|
8
|
-
return window.__EMBER_GENERATED_DOC_JSON__;
|
9
|
-
};
|
10
|
-
export const extractArgTypes = componentName => {
|
11
|
-
const json = getJSONDoc();
|
12
|
-
if (!(json && json.included)) {
|
13
|
-
return null;
|
14
|
-
}
|
15
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
16
|
-
if (!componentDoc) {
|
17
|
-
return null;
|
18
|
-
}
|
19
|
-
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
20
|
-
acc[prop.name] = {
|
21
|
-
name: prop.name,
|
22
|
-
defaultValue: prop.defaultValue,
|
23
|
-
description: prop.description,
|
24
|
-
table: {
|
25
|
-
defaultValue: {
|
26
|
-
summary: prop.defaultValue
|
27
|
-
},
|
28
|
-
type: {
|
29
|
-
summary: prop.type,
|
30
|
-
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
31
|
-
}
|
32
|
-
}
|
33
|
-
};
|
34
|
-
return acc;
|
35
|
-
}, {});
|
36
|
-
};
|
37
|
-
export const extractComponentDescription = componentName => {
|
38
|
-
const json = getJSONDoc();
|
39
|
-
if (!(json && json.included)) {
|
40
|
-
return null;
|
41
|
-
}
|
42
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
43
|
-
if (!componentDoc) {
|
44
|
-
return null;
|
45
|
-
}
|
46
|
-
return componentDoc.attributes.description;
|
47
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export { setJSONDoc } from './jsondoc';
|
@@ -1,47 +0,0 @@
|
|
1
|
-
/* eslint-disable no-underscore-dangle */
|
2
|
-
/* global window */
|
3
|
-
|
4
|
-
export const setJSONDoc = jsondoc => {
|
5
|
-
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
6
|
-
};
|
7
|
-
export const getJSONDoc = () => {
|
8
|
-
return window.__EMBER_GENERATED_DOC_JSON__;
|
9
|
-
};
|
10
|
-
export const extractArgTypes = componentName => {
|
11
|
-
const json = getJSONDoc();
|
12
|
-
if (!(json && json.included)) {
|
13
|
-
return null;
|
14
|
-
}
|
15
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
16
|
-
if (!componentDoc) {
|
17
|
-
return null;
|
18
|
-
}
|
19
|
-
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
20
|
-
acc[prop.name] = {
|
21
|
-
name: prop.name,
|
22
|
-
defaultValue: prop.defaultValue,
|
23
|
-
description: prop.description,
|
24
|
-
table: {
|
25
|
-
defaultValue: {
|
26
|
-
summary: prop.defaultValue
|
27
|
-
},
|
28
|
-
type: {
|
29
|
-
summary: prop.type,
|
30
|
-
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
31
|
-
}
|
32
|
-
}
|
33
|
-
};
|
34
|
-
return acc;
|
35
|
-
}, {});
|
36
|
-
};
|
37
|
-
export const extractComponentDescription = componentName => {
|
38
|
-
const json = getJSONDoc();
|
39
|
-
if (!(json && json.included)) {
|
40
|
-
return null;
|
41
|
-
}
|
42
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
43
|
-
if (!componentDoc) {
|
44
|
-
return null;
|
45
|
-
}
|
46
|
-
return componentDoc.attributes.description;
|
47
|
-
};
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { start } from '@storybook/preview-api';
|
2
|
-
import './globals';
|
3
|
-
import { renderToCanvas } from './render';
|
4
|
-
const {
|
5
|
-
configure: coreConfigure,
|
6
|
-
clientApi,
|
7
|
-
forceReRender
|
8
|
-
} = start(renderToCanvas);
|
9
|
-
export const {
|
10
|
-
raw
|
11
|
-
} = clientApi;
|
12
|
-
const FRAMEWORK = 'ember';
|
13
|
-
export const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({
|
14
|
-
framework: FRAMEWORK
|
15
|
-
});
|
16
|
-
export const configure = (loadable, m) => coreConfigure(FRAMEWORK, loadable, m);
|
17
|
-
export { forceReRender };
|
@@ -1,71 +0,0 @@
|
|
1
|
-
import global from 'global';
|
2
|
-
import { dedent } from 'ts-dedent';
|
3
|
-
// @ts-expect-error (Converted from ts-ignore)
|
4
|
-
import Component from '@ember/component'; // eslint-disable-line import/no-unresolved
|
5
|
-
|
6
|
-
const {
|
7
|
-
window: globalWindow,
|
8
|
-
document
|
9
|
-
} = global;
|
10
|
-
const rootEl = document.getElementById('storybook-root');
|
11
|
-
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
12
|
-
const app = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/app`).default.create(Object.assign({
|
13
|
-
autoboot: false,
|
14
|
-
rootElement: rootEl
|
15
|
-
}, config.APP));
|
16
|
-
let lastPromise = app.boot();
|
17
|
-
let hasRendered = false;
|
18
|
-
let isRendering = false;
|
19
|
-
function render(options, el) {
|
20
|
-
if (isRendering) return;
|
21
|
-
isRendering = true;
|
22
|
-
const {
|
23
|
-
template,
|
24
|
-
context = {},
|
25
|
-
element
|
26
|
-
} = options;
|
27
|
-
if (hasRendered) {
|
28
|
-
lastPromise = lastPromise.then(instance => instance.destroy());
|
29
|
-
}
|
30
|
-
lastPromise = lastPromise.then(() => {
|
31
|
-
const appInstancePrivate = app.buildInstance();
|
32
|
-
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
33
|
-
}).then(instance => {
|
34
|
-
instance.register('component:story-mode', Component.extend(Object.assign({
|
35
|
-
layout: template || options
|
36
|
-
}, context)));
|
37
|
-
const component = instance.lookup('component:story-mode');
|
38
|
-
if (element) {
|
39
|
-
component.appendTo(element);
|
40
|
-
element.appendTo(el);
|
41
|
-
} else {
|
42
|
-
component.appendTo(el);
|
43
|
-
}
|
44
|
-
hasRendered = true;
|
45
|
-
isRendering = false;
|
46
|
-
return instance;
|
47
|
-
});
|
48
|
-
}
|
49
|
-
export function renderToCanvas({
|
50
|
-
storyFn,
|
51
|
-
kind,
|
52
|
-
name,
|
53
|
-
showMain,
|
54
|
-
showError
|
55
|
-
}, canvasElement) {
|
56
|
-
const element = storyFn();
|
57
|
-
if (!element) {
|
58
|
-
showError({
|
59
|
-
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
60
|
-
description: dedent`
|
61
|
-
Did you forget to return the Ember element from the story?
|
62
|
-
Use "() => hbs('{{component}}')" or "() => { return {
|
63
|
-
template: hbs\`{{component}}\`
|
64
|
-
} }" when defining the story.
|
65
|
-
`
|
66
|
-
});
|
67
|
-
return;
|
68
|
-
}
|
69
|
-
showMain();
|
70
|
-
render(element, canvasElement);
|
71
|
-
}
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
package/dist/esm/preset.js
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
import path from 'path';
|
2
|
-
export const addons = [require.resolve('./server/framework-preset-babel-ember'), require.resolve('./server/framework-preset-ember-docs')];
|
3
|
-
export const core = async (config, options) => {
|
4
|
-
const framework = await options.presets.apply('framework');
|
5
|
-
return Object.assign({}, config, {
|
6
|
-
builder: {
|
7
|
-
name: path.dirname(require.resolve(path.join('@storybook/builder-webpack5', 'package.json'))),
|
8
|
-
options: typeof framework === 'string' ? {} : framework.options.builder || {}
|
9
|
-
}
|
10
|
-
});
|
11
|
-
};
|
@@ -1,45 +0,0 @@
|
|
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
|
-
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; }
|
3
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
5
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
6
|
-
import { precompile } from 'ember-source/dist/ember-template-compiler';
|
7
|
-
import { findDistEsm } from '@storybook/core-common';
|
8
|
-
var emberOptions;
|
9
|
-
function precompileWithPlugins(string, options) {
|
10
|
-
var precompileOptions = options;
|
11
|
-
if (emberOptions && emberOptions.polyfills) {
|
12
|
-
precompileOptions.plugins = {
|
13
|
-
ast: emberOptions.polyfills
|
14
|
-
};
|
15
|
-
}
|
16
|
-
return precompile(string, precompileOptions);
|
17
|
-
}
|
18
|
-
export function babel(config, options) {
|
19
|
-
if (options && options.presetsList) {
|
20
|
-
options.presetsList.forEach(function (e, index) {
|
21
|
-
if (e.preset && e.preset.emberOptions) {
|
22
|
-
emberOptions = e.preset.emberOptions;
|
23
|
-
if (options.presetsList) {
|
24
|
-
// eslint-disable-next-line no-param-reassign
|
25
|
-
delete options.presetsList[index].preset.emberOptions;
|
26
|
-
}
|
27
|
-
}
|
28
|
-
});
|
29
|
-
}
|
30
|
-
var babelConfigPlugins = config.plugins || [];
|
31
|
-
var extraPlugins = [[require.resolve('babel-plugin-htmlbars-inline-precompile'), {
|
32
|
-
precompile: precompileWithPlugins,
|
33
|
-
modules: {
|
34
|
-
'ember-cli-htmlbars': 'hbs',
|
35
|
-
'ember-cli-htmlbars-inline-precompile': 'default',
|
36
|
-
'htmlbars-inline-precompile': 'default'
|
37
|
-
}
|
38
|
-
}], [require.resolve('babel-plugin-ember-modules-api-polyfill')]];
|
39
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
40
|
-
plugins: [...babelConfigPlugins, ...extraPlugins]
|
41
|
-
});
|
42
|
-
}
|
43
|
-
export var previewAnnotations = function (entry = []) {
|
44
|
-
return [...entry, findDistEsm(__dirname, 'client/preview/config')];
|
45
|
-
};
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { findDistEsm } from '@storybook/core-common';
|
2
|
-
import { hasDocsOrControls } from '@storybook/docs-tools';
|
3
|
-
export var previewAnnotations = function (entry = [], options) {
|
4
|
-
if (!hasDocsOrControls(options)) return entry;
|
5
|
-
return [...entry, findDistEsm(__dirname, 'client/docs/config')];
|
6
|
-
};
|
package/dist/esm/types.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|