@storybook/ember 6.5.7-alpha.0 → 7.0.0-alpha.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/dist/cjs/client/preview/index.js +2 -2
- package/dist/cjs/{client/index.js → index.js} +5 -4
- package/dist/cjs/preset.js +76 -0
- package/dist/esm/client/docs/config.js +4 -4
- package/dist/esm/client/docs/jsondoc.js +10 -22
- package/dist/esm/client/preview/config.js +1 -1
- package/dist/esm/client/preview/docs/config.js +3 -3
- package/dist/esm/client/preview/docs/jsondoc.js +10 -22
- package/dist/esm/client/preview/globals.js +3 -1
- package/dist/esm/client/preview/index.js +19 -23
- package/dist/esm/client/preview/render.js +36 -40
- package/dist/esm/index.js +3 -0
- package/dist/esm/preset.js +6 -0
- package/dist/{ts3.9 → types}/src/client/preview/config.d.ts +0 -0
- package/dist/{ts3.9 → types}/src/client/preview/globals.d.ts +0 -0
- package/dist/{ts3.9 → types}/src/client/preview/index.d.ts +2 -2
- package/dist/{ts3.9 → types}/src/client/preview/render.d.ts +0 -0
- package/dist/{ts3.9 → types}/src/client/preview/types.d.ts +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/preset.d.ts +11 -0
- package/dist/{ts3.9 → types}/src/server/framework-preset-babel-ember.d.ts +0 -0
- package/dist/{ts3.9 → types}/src/server/framework-preset-ember-docs.d.ts +0 -0
- package/package.json +13 -25
- package/preset.js +1 -1
- package/standalone.js +2 -3
- package/bin/build.js +0 -4
- package/bin/index.js +0 -3
- package/dist/cjs/server/build.js +0 -9
- package/dist/cjs/server/index.js +0 -9
- package/dist/cjs/server/options.js +0 -17
- package/dist/cjs/server/preset.js +0 -8
- package/dist/esm/client/index.js +0 -5
- package/dist/esm/server/build.js +0 -3
- package/dist/esm/server/index.js +0 -3
- package/dist/esm/server/options.js +0 -8
- package/dist/esm/server/preset.js +0 -1
- package/dist/modern/client/docs/config.js +0 -10
- package/dist/modern/client/docs/index.js +0 -1
- package/dist/modern/client/docs/jsondoc.js +0 -57
- package/dist/modern/client/index.js +0 -5
- package/dist/modern/client/preview/config.js +0 -4
- package/dist/modern/client/preview/docs/config.js +0 -8
- package/dist/modern/client/preview/docs/index.js +0 -1
- package/dist/modern/client/preview/docs/jsondoc.js +0 -57
- package/dist/modern/client/preview/globals.js +0 -6
- package/dist/modern/client/preview/index.js +0 -22
- package/dist/modern/client/preview/render.js +0 -79
- package/dist/modern/client/preview/types.js +0 -0
- package/dist/modern/server/build.js +0 -3
- package/dist/modern/server/framework-preset-babel-ember.js +0 -49
- package/dist/modern/server/framework-preset-ember-docs.js +0 -6
- package/dist/modern/server/index.js +0 -3
- package/dist/modern/server/options.js +0 -8
- package/dist/modern/server/preset.js +0 -1
- package/dist/ts3.4/src/client/index.d.ts +0 -1
- package/dist/ts3.4/src/client/preview/config.d.ts +0 -4
- package/dist/ts3.4/src/client/preview/globals.d.ts +0 -1
- package/dist/ts3.4/src/client/preview/index.d.ts +0 -9
- package/dist/ts3.4/src/client/preview/render.d.ts +0 -3
- package/dist/ts3.4/src/client/preview/types.d.ts +0 -14
- package/dist/ts3.4/src/server/build.d.ts +0 -1
- package/dist/ts3.4/src/server/framework-preset-babel-ember.d.ts +0 -4
- package/dist/ts3.4/src/server/framework-preset-ember-docs.d.ts +0 -2
- package/dist/ts3.4/src/server/index.d.ts +0 -1
- package/dist/ts3.4/src/server/options.d.ts +0 -3
- package/dist/ts3.4/src/server/preset.d.ts +0 -2
- package/dist/ts3.9/src/client/index.d.ts +0 -1
- package/dist/ts3.9/src/server/build.d.ts +0 -1
- package/dist/ts3.9/src/server/index.d.ts +0 -1
- package/dist/ts3.9/src/server/options.d.ts +0 -3
- package/dist/ts3.9/src/server/preset.d.ts +0 -2
@@ -5,13 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.storiesOf = exports.setAddon = exports.raw = exports.getStorybook = exports.forceReRender = exports.configure = exports.clearDecorators = exports.addParameters = exports.addDecorator = void 0;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _coreClient = require("@storybook/core-client");
|
9
9
|
|
10
10
|
require("./globals");
|
11
11
|
|
12
12
|
var _render = require("./render");
|
13
13
|
|
14
|
-
var _start = (0,
|
14
|
+
var _start = (0, _coreClient.start)(_render.renderToDOM),
|
15
15
|
coreConfigure = _start.configure,
|
16
16
|
clientApi = _start.clientApi,
|
17
17
|
forceReRender = _start.forceReRender;
|
@@ -52,8 +52,9 @@ Object.defineProperty(exports, "storiesOf", {
|
|
52
52
|
}
|
53
53
|
});
|
54
54
|
|
55
|
-
var _preview = require("./preview");
|
55
|
+
var _preview = require("./client/preview");
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
var _module, _module$hot;
|
58
|
+
|
59
|
+
// optimization: stop HMR propagation in webpack
|
60
|
+
(_module = module) === null || _module === void 0 ? void 0 : (_module$hot = _module.hot) === null || _module$hot === void 0 ? void 0 : _module$hot.decline();
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
|
+
|
5
|
+
require("core-js/modules/es.symbol.js");
|
6
|
+
|
7
|
+
require("core-js/modules/es.symbol.description.js");
|
8
|
+
|
9
|
+
require("core-js/modules/es.symbol.iterator.js");
|
10
|
+
|
11
|
+
require("core-js/modules/es.array.iterator.js");
|
12
|
+
|
13
|
+
require("core-js/modules/es.string.iterator.js");
|
14
|
+
|
15
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
16
|
+
|
17
|
+
require("core-js/modules/es.symbol.async-iterator.js");
|
18
|
+
|
19
|
+
require("core-js/modules/es.symbol.to-string-tag.js");
|
20
|
+
|
21
|
+
require("core-js/modules/es.json.to-string-tag.js");
|
22
|
+
|
23
|
+
require("core-js/modules/es.math.to-string-tag.js");
|
24
|
+
|
25
|
+
require("core-js/modules/es.object.get-prototype-of.js");
|
26
|
+
|
27
|
+
require("core-js/modules/web.dom-collections.for-each.js");
|
28
|
+
|
29
|
+
require("core-js/modules/es.function.name.js");
|
30
|
+
|
31
|
+
require("core-js/modules/es.array.slice.js");
|
32
|
+
|
33
|
+
Object.defineProperty(exports, "__esModule", {
|
34
|
+
value: true
|
35
|
+
});
|
36
|
+
exports.core = exports.addons = void 0;
|
37
|
+
|
38
|
+
require("core-js/modules/es.object.assign.js");
|
39
|
+
|
40
|
+
require("core-js/modules/es.object.to-string.js");
|
41
|
+
|
42
|
+
require("core-js/modules/es.promise.js");
|
43
|
+
|
44
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
45
|
+
|
46
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
47
|
+
|
48
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
49
|
+
|
50
|
+
var addons = [require.resolve('./server/framework-preset-babel-ember'), require.resolve('./server/framework-preset-ember-docs')];
|
51
|
+
exports.addons = addons;
|
52
|
+
|
53
|
+
var core = /*#__PURE__*/function () {
|
54
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(config) {
|
55
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
56
|
+
while (1) {
|
57
|
+
switch (_context.prev = _context.next) {
|
58
|
+
case 0:
|
59
|
+
return _context.abrupt("return", Object.assign({}, config, {
|
60
|
+
builder: require.resolve('@storybook/builder-webpack5')
|
61
|
+
}));
|
62
|
+
|
63
|
+
case 1:
|
64
|
+
case "end":
|
65
|
+
return _context.stop();
|
66
|
+
}
|
67
|
+
}
|
68
|
+
}, _callee);
|
69
|
+
}));
|
70
|
+
|
71
|
+
return function core(_x) {
|
72
|
+
return _ref.apply(this, arguments);
|
73
|
+
};
|
74
|
+
}();
|
75
|
+
|
76
|
+
exports.core = core;
|
@@ -1,10 +1,10 @@
|
|
1
1
|
import { enhanceArgTypes } from '@storybook/docs-tools';
|
2
2
|
import { extractArgTypes, extractComponentDescription } from './jsondoc';
|
3
|
-
export
|
3
|
+
export const parameters = {
|
4
4
|
docs: {
|
5
5
|
iframeHeight: 80,
|
6
|
-
extractArgTypes
|
7
|
-
extractComponentDescription
|
6
|
+
extractArgTypes,
|
7
|
+
extractComponentDescription
|
8
8
|
}
|
9
9
|
};
|
10
|
-
export
|
10
|
+
export const argTypesEnhancers = [enhanceArgTypes];
|
@@ -1,34 +1,26 @@
|
|
1
|
-
import "core-js/modules/es.array.find.js";
|
2
|
-
import "core-js/modules/es.object.to-string.js";
|
3
|
-
import "core-js/modules/es.function.name.js";
|
4
|
-
import "core-js/modules/es.symbol.js";
|
5
|
-
import "core-js/modules/es.symbol.description.js";
|
6
|
-
|
7
1
|
/* eslint-disable no-underscore-dangle */
|
8
2
|
|
9
3
|
/* global window */
|
10
|
-
export
|
4
|
+
export const setJSONDoc = jsondoc => {
|
11
5
|
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
12
6
|
};
|
13
|
-
export
|
7
|
+
export const getJSONDoc = () => {
|
14
8
|
return window.__EMBER_GENERATED_DOC_JSON__;
|
15
9
|
};
|
16
|
-
export
|
17
|
-
|
10
|
+
export const extractArgTypes = componentName => {
|
11
|
+
const json = getJSONDoc();
|
18
12
|
|
19
13
|
if (!(json && json.included)) {
|
20
14
|
return null;
|
21
15
|
}
|
22
16
|
|
23
|
-
|
24
|
-
return doc.attributes.name === componentName;
|
25
|
-
});
|
17
|
+
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
26
18
|
|
27
19
|
if (!componentDoc) {
|
28
20
|
return null;
|
29
21
|
}
|
30
22
|
|
31
|
-
return componentDoc.attributes.arguments.reduce(
|
23
|
+
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
32
24
|
acc[prop.name] = {
|
33
25
|
name: prop.name,
|
34
26
|
defaultValue: prop.defaultValue,
|
@@ -39,25 +31,21 @@ export var extractArgTypes = function extractArgTypes(componentName) {
|
|
39
31
|
},
|
40
32
|
type: {
|
41
33
|
summary: prop.type,
|
42
|
-
required: prop.tags.length ? prop.tags.some(
|
43
|
-
return tag.name === 'required';
|
44
|
-
}) : false
|
34
|
+
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
45
35
|
}
|
46
36
|
}
|
47
37
|
};
|
48
38
|
return acc;
|
49
39
|
}, {});
|
50
40
|
};
|
51
|
-
export
|
52
|
-
|
41
|
+
export const extractComponentDescription = componentName => {
|
42
|
+
const json = getJSONDoc();
|
53
43
|
|
54
44
|
if (!(json && json.included)) {
|
55
45
|
return null;
|
56
46
|
}
|
57
47
|
|
58
|
-
|
59
|
-
return doc.attributes.name === componentName;
|
60
|
-
});
|
48
|
+
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
61
49
|
|
62
50
|
if (!componentDoc) {
|
63
51
|
return null;
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { extractArgTypes, extractComponentDescription } from './jsondoc';
|
2
|
-
export
|
2
|
+
export const parameters = {
|
3
3
|
docs: {
|
4
4
|
iframeHeight: 80,
|
5
|
-
extractArgTypes
|
6
|
-
extractComponentDescription
|
5
|
+
extractArgTypes,
|
6
|
+
extractComponentDescription
|
7
7
|
}
|
8
8
|
};
|
@@ -1,34 +1,26 @@
|
|
1
|
-
import "core-js/modules/es.array.find.js";
|
2
|
-
import "core-js/modules/es.object.to-string.js";
|
3
|
-
import "core-js/modules/es.function.name.js";
|
4
|
-
import "core-js/modules/es.symbol.js";
|
5
|
-
import "core-js/modules/es.symbol.description.js";
|
6
|
-
|
7
1
|
/* eslint-disable no-underscore-dangle */
|
8
2
|
|
9
3
|
/* global window */
|
10
|
-
export
|
4
|
+
export const setJSONDoc = jsondoc => {
|
11
5
|
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
12
6
|
};
|
13
|
-
export
|
7
|
+
export const getJSONDoc = () => {
|
14
8
|
return window.__EMBER_GENERATED_DOC_JSON__;
|
15
9
|
};
|
16
|
-
export
|
17
|
-
|
10
|
+
export const extractArgTypes = componentName => {
|
11
|
+
const json = getJSONDoc();
|
18
12
|
|
19
13
|
if (!(json && json.included)) {
|
20
14
|
return null;
|
21
15
|
}
|
22
16
|
|
23
|
-
|
24
|
-
return doc.attributes.name === componentName;
|
25
|
-
});
|
17
|
+
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
26
18
|
|
27
19
|
if (!componentDoc) {
|
28
20
|
return null;
|
29
21
|
}
|
30
22
|
|
31
|
-
return componentDoc.attributes.arguments.reduce(
|
23
|
+
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
32
24
|
acc[prop.name] = {
|
33
25
|
name: prop.name,
|
34
26
|
defaultValue: prop.defaultValue,
|
@@ -39,25 +31,21 @@ export var extractArgTypes = function extractArgTypes(componentName) {
|
|
39
31
|
},
|
40
32
|
type: {
|
41
33
|
summary: prop.type,
|
42
|
-
required: prop.tags.length ? prop.tags.some(
|
43
|
-
return tag.name === 'required';
|
44
|
-
}) : false
|
34
|
+
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
45
35
|
}
|
46
36
|
}
|
47
37
|
};
|
48
38
|
return acc;
|
49
39
|
}, {});
|
50
40
|
};
|
51
|
-
export
|
52
|
-
|
41
|
+
export const extractComponentDescription = componentName => {
|
42
|
+
const json = getJSONDoc();
|
53
43
|
|
54
44
|
if (!(json && json.included)) {
|
55
45
|
return null;
|
56
46
|
}
|
57
47
|
|
58
|
-
|
59
|
-
return doc.attributes.name === componentName;
|
60
|
-
});
|
48
|
+
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
61
49
|
|
62
50
|
if (!componentDoc) {
|
63
51
|
return null;
|
@@ -1,26 +1,22 @@
|
|
1
|
-
import { start } from '@storybook/core';
|
1
|
+
import { start } from '@storybook/core-client';
|
2
2
|
import './globals';
|
3
3
|
import { renderToDOM } from './render';
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
export
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
};
|
23
|
-
export var configure = function configure(loadable, m) {
|
24
|
-
return coreConfigure(framework, loadable, m);
|
25
|
-
};
|
4
|
+
const {
|
5
|
+
configure: coreConfigure,
|
6
|
+
clientApi,
|
7
|
+
forceReRender
|
8
|
+
} = start(renderToDOM);
|
9
|
+
export const {
|
10
|
+
setAddon,
|
11
|
+
addDecorator,
|
12
|
+
addParameters,
|
13
|
+
clearDecorators,
|
14
|
+
getStorybook,
|
15
|
+
raw
|
16
|
+
} = clientApi;
|
17
|
+
const framework = 'ember';
|
18
|
+
export const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({
|
19
|
+
framework
|
20
|
+
});
|
21
|
+
export const configure = (loadable, m) => coreConfigure(framework, loadable, m);
|
26
22
|
export { forceReRender };
|
@@ -1,53 +1,43 @@
|
|
1
|
-
var _templateObject;
|
2
|
-
|
3
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
4
|
-
|
5
|
-
import "core-js/modules/es.object.assign.js";
|
6
|
-
import "core-js/modules/es.function.name.js";
|
7
|
-
import "core-js/modules/es.array.concat.js";
|
8
|
-
import "core-js/modules/es.array.slice.js";
|
9
|
-
import "core-js/modules/es.object.freeze.js";
|
10
1
|
import global from 'global';
|
11
2
|
import dedent from 'ts-dedent';
|
12
|
-
|
13
|
-
|
14
|
-
|
3
|
+
const {
|
4
|
+
window: globalWindow,
|
5
|
+
document
|
6
|
+
} = global;
|
7
|
+
const rootEl = document.getElementById('root');
|
15
8
|
|
16
|
-
|
9
|
+
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
17
10
|
|
18
|
-
|
11
|
+
const app = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/app`).default.create(Object.assign({
|
19
12
|
autoboot: false,
|
20
13
|
rootElement: rootEl
|
21
14
|
}, config.APP));
|
22
15
|
|
23
|
-
|
24
|
-
|
25
|
-
|
16
|
+
let lastPromise = app.boot();
|
17
|
+
let hasRendered = false;
|
18
|
+
let isRendering = false;
|
26
19
|
|
27
20
|
function render(options, el) {
|
28
21
|
if (isRendering) return;
|
29
22
|
isRendering = true;
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
23
|
+
const {
|
24
|
+
template,
|
25
|
+
context = {},
|
26
|
+
element
|
27
|
+
} = options;
|
34
28
|
|
35
29
|
if (hasRendered) {
|
36
|
-
lastPromise = lastPromise.then(
|
37
|
-
return instance.destroy();
|
38
|
-
});
|
30
|
+
lastPromise = lastPromise.then(instance => instance.destroy());
|
39
31
|
}
|
40
32
|
|
41
|
-
lastPromise = lastPromise.then(
|
42
|
-
|
43
|
-
return appInstancePrivate.boot().then(
|
44
|
-
|
45
|
-
});
|
46
|
-
}).then(function (instance) {
|
33
|
+
lastPromise = lastPromise.then(() => {
|
34
|
+
const appInstancePrivate = app.buildInstance();
|
35
|
+
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
36
|
+
}).then(instance => {
|
47
37
|
instance.register('component:story-mode', Ember.Component.extend(Object.assign({
|
48
38
|
layout: template || options
|
49
39
|
}, context)));
|
50
|
-
|
40
|
+
const component = instance.lookup('component:story-mode');
|
51
41
|
|
52
42
|
if (element) {
|
53
43
|
component.appendTo(element);
|
@@ -62,18 +52,24 @@ function render(options, el) {
|
|
62
52
|
});
|
63
53
|
}
|
64
54
|
|
65
|
-
export function renderToDOM(
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
55
|
+
export function renderToDOM({
|
56
|
+
storyFn,
|
57
|
+
kind,
|
58
|
+
name,
|
59
|
+
showMain,
|
60
|
+
showError
|
61
|
+
}, domElement) {
|
62
|
+
const element = storyFn();
|
72
63
|
|
73
64
|
if (!element) {
|
74
65
|
showError({
|
75
|
-
title:
|
76
|
-
description: dedent
|
66
|
+
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
67
|
+
description: 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
|
+
`
|
77
73
|
});
|
78
74
|
return;
|
79
75
|
}
|
@@ -0,0 +1,6 @@
|
|
1
|
+
export const addons = [require.resolve('./server/framework-preset-babel-ember'), require.resolve('./server/framework-preset-ember-docs')];
|
2
|
+
export const core = async config => {
|
3
|
+
return Object.assign({}, config, {
|
4
|
+
builder: require.resolve('@storybook/builder-webpack5')
|
5
|
+
});
|
6
|
+
};
|
File without changes
|
File without changes
|
@@ -3,7 +3,7 @@ declare const forceReRender: (() => never) | (() => void);
|
|
3
3
|
export declare const setAddon: ((addon: any) => void) | (() => never), addDecorator: (() => never) | ((decorator: import("@storybook/csf").DecoratorFunction<import("./types").EmberFramework, import("@storybook/csf").Args>) => void), addParameters: (({ globals, globalTypes, ...parameters }: import("@storybook/csf").Parameters & {
|
4
4
|
globals?: import("@storybook/csf").Globals;
|
5
5
|
globalTypes?: import("@storybook/csf").GlobalTypes;
|
6
|
-
}) => void) | (() => never), clearDecorators: (() => void) | (() => never), getStorybook: (() => never) | (() => import("
|
7
|
-
export declare const storiesOf: (kind: string, m: any) => import("
|
6
|
+
}) => void) | (() => never), clearDecorators: (() => void) | (() => never), getStorybook: (() => never) | (() => import("lib/client-api/dist/types/ClientApi").GetStorybookKind<import("./types").EmberFramework>[]), raw: (() => never) | (() => import("lib/store/dist/types").BoundStory<import("./types").EmberFramework>[]);
|
7
|
+
export declare const storiesOf: (kind: string, m: any) => import("lib/addons/dist/types").StoryApi<import("./types").OptionsArgs>;
|
8
8
|
export declare const configure: (loadable: any, m: any) => void;
|
9
9
|
export { forceReRender };
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
export { storiesOf, setAddon, addDecorator, addParameters, configure, getStorybook, forceReRender, raw, } from './client/preview';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import type { StorybookConfig } from '@storybook/core-common';
|
2
|
+
export declare const addons: StorybookConfig['addons'];
|
3
|
+
export declare const core: (config: StorybookConfig['core']) => Promise<{
|
4
|
+
builder: string;
|
5
|
+
disableWebpackDefaults?: boolean;
|
6
|
+
channelOptions?: Partial<import("telejson").Options>;
|
7
|
+
disableProjectJson?: boolean;
|
8
|
+
disableTelemetry?: boolean;
|
9
|
+
enableCrashReports?: boolean;
|
10
|
+
crossOriginIsolated?: boolean;
|
11
|
+
}>;
|
File without changes
|
File without changes
|
package/package.json
CHANGED
@@ -1,38 +1,25 @@
|
|
1
1
|
{
|
2
2
|
"name": "@storybook/ember",
|
3
|
-
"version": "
|
3
|
+
"version": "7.0.0-alpha.1",
|
4
4
|
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
5
|
-
"homepage": "https://github.com/storybookjs/storybook/tree/main/
|
5
|
+
"homepage": "https://github.com/storybookjs/storybook/tree/main/frameworks/ember",
|
6
6
|
"bugs": {
|
7
7
|
"url": "https://github.com/storybookjs/storybook/issues"
|
8
8
|
},
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
11
11
|
"url": "https://github.com/storybookjs/storybook.git",
|
12
|
-
"directory": "
|
12
|
+
"directory": "frameworks/ember"
|
13
13
|
},
|
14
14
|
"funding": {
|
15
15
|
"type": "opencollective",
|
16
16
|
"url": "https://opencollective.com/storybook"
|
17
17
|
},
|
18
18
|
"license": "MIT",
|
19
|
-
"main": "dist/cjs/
|
20
|
-
"module": "dist/esm/
|
21
|
-
"types": "dist/
|
22
|
-
"typesVersions": {
|
23
|
-
"<3.8": {
|
24
|
-
"dist/ts3.9/*": [
|
25
|
-
"dist/ts3.4/*"
|
26
|
-
]
|
27
|
-
}
|
28
|
-
},
|
29
|
-
"bin": {
|
30
|
-
"build-storybook": "./bin/build.js",
|
31
|
-
"start-storybook": "./bin/index.js",
|
32
|
-
"storybook-server": "./bin/index.js"
|
33
|
-
},
|
19
|
+
"main": "dist/cjs/index.js",
|
20
|
+
"module": "dist/esm/index.js",
|
21
|
+
"types": "dist/types/index.d.ts",
|
34
22
|
"files": [
|
35
|
-
"bin/**/*",
|
36
23
|
"dist/**/*",
|
37
24
|
"README.md",
|
38
25
|
"*.js",
|
@@ -42,10 +29,12 @@
|
|
42
29
|
"prepare": "node ../../scripts/prepare.js"
|
43
30
|
},
|
44
31
|
"dependencies": {
|
45
|
-
"@storybook/
|
46
|
-
"@storybook/core-
|
47
|
-
"@storybook/
|
48
|
-
"@storybook/
|
32
|
+
"@storybook/builder-webpack5": "7.0.0-alpha.1",
|
33
|
+
"@storybook/core-client": "7.0.0-alpha.1",
|
34
|
+
"@storybook/core-common": "7.0.0-alpha.1",
|
35
|
+
"@storybook/core-server": "7.0.0-alpha.1",
|
36
|
+
"@storybook/docs-tools": "7.0.0-alpha.1",
|
37
|
+
"@storybook/store": "7.0.0-alpha.1",
|
49
38
|
"core-js": "^3.8.2",
|
50
39
|
"global": "^4.4.0",
|
51
40
|
"react": "16.14.0",
|
@@ -66,6 +55,5 @@
|
|
66
55
|
"publishConfig": {
|
67
56
|
"access": "public"
|
68
57
|
},
|
69
|
-
"gitHead": "
|
70
|
-
"sbmodern": "dist/modern/client/index.js"
|
58
|
+
"gitHead": "b90b85210f66da59656c2ef58b0910b156256bea"
|
71
59
|
}
|
package/preset.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
module.exports = require('./dist/cjs/
|
1
|
+
module.exports = require('./dist/cjs/preset');
|
package/standalone.js
CHANGED
@@ -1,8 +1,7 @@
|
|
1
|
-
const build = require('@storybook/core/standalone');
|
2
|
-
const frameworkOptions = require('./dist/cjs/server/options').default;
|
1
|
+
const build = require('@storybook/core-server/standalone');
|
3
2
|
|
4
3
|
async function buildStandalone(options) {
|
5
|
-
return build(options
|
4
|
+
return build(options);
|
6
5
|
}
|
7
6
|
|
8
7
|
module.exports = buildStandalone;
|
package/bin/build.js
DELETED
package/bin/index.js
DELETED
package/dist/cjs/server/build.js
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _server = require("@storybook/core/server");
|
4
|
-
|
5
|
-
var _options = _interopRequireDefault(require("./options"));
|
6
|
-
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
-
|
9
|
-
(0, _server.buildStatic)(_options.default);
|
package/dist/cjs/server/index.js
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
var _server = require("@storybook/core/server");
|
4
|
-
|
5
|
-
var _options = _interopRequireDefault(require("./options"));
|
6
|
-
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
8
|
-
|
9
|
-
(0, _server.buildDev)(_options.default);
|
@@ -1,17 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
4
|
-
value: true
|
5
|
-
});
|
6
|
-
exports.default = void 0;
|
7
|
-
|
8
|
-
var _readPkgUp = require("read-pkg-up");
|
9
|
-
|
10
|
-
var _default = {
|
11
|
-
packageJson: (0, _readPkgUp.sync)({
|
12
|
-
cwd: __dirname
|
13
|
-
}).packageJson,
|
14
|
-
framework: 'ember',
|
15
|
-
frameworkPresets: [require.resolve('./preset')]
|
16
|
-
};
|
17
|
-
exports.default = _default;
|
package/dist/esm/client/index.js
DELETED
package/dist/esm/server/build.js
DELETED
package/dist/esm/server/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export var addons = [require.resolve('./framework-preset-babel-ember'), require.resolve('./framework-preset-ember-docs')];
|
@@ -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,57 +0,0 @@
|
|
1
|
-
import "core-js/modules/es.array.reduce.js";
|
2
|
-
|
3
|
-
/* eslint-disable no-underscore-dangle */
|
4
|
-
|
5
|
-
/* global window */
|
6
|
-
export const setJSONDoc = jsondoc => {
|
7
|
-
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
8
|
-
};
|
9
|
-
export const getJSONDoc = () => {
|
10
|
-
return window.__EMBER_GENERATED_DOC_JSON__;
|
11
|
-
};
|
12
|
-
export const extractArgTypes = componentName => {
|
13
|
-
const json = getJSONDoc();
|
14
|
-
|
15
|
-
if (!(json && json.included)) {
|
16
|
-
return null;
|
17
|
-
}
|
18
|
-
|
19
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
20
|
-
|
21
|
-
if (!componentDoc) {
|
22
|
-
return null;
|
23
|
-
}
|
24
|
-
|
25
|
-
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
26
|
-
acc[prop.name] = {
|
27
|
-
name: prop.name,
|
28
|
-
defaultValue: prop.defaultValue,
|
29
|
-
description: prop.description,
|
30
|
-
table: {
|
31
|
-
defaultValue: {
|
32
|
-
summary: prop.defaultValue
|
33
|
-
},
|
34
|
-
type: {
|
35
|
-
summary: prop.type,
|
36
|
-
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
37
|
-
}
|
38
|
-
}
|
39
|
-
};
|
40
|
-
return acc;
|
41
|
-
}, {});
|
42
|
-
};
|
43
|
-
export const extractComponentDescription = componentName => {
|
44
|
-
const json = getJSONDoc();
|
45
|
-
|
46
|
-
if (!(json && json.included)) {
|
47
|
-
return null;
|
48
|
-
}
|
49
|
-
|
50
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
51
|
-
|
52
|
-
if (!componentDoc) {
|
53
|
-
return null;
|
54
|
-
}
|
55
|
-
|
56
|
-
return componentDoc.attributes.description;
|
57
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export { setJSONDoc } from './jsondoc';
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import "core-js/modules/es.array.reduce.js";
|
2
|
-
|
3
|
-
/* eslint-disable no-underscore-dangle */
|
4
|
-
|
5
|
-
/* global window */
|
6
|
-
export const setJSONDoc = jsondoc => {
|
7
|
-
window.__EMBER_GENERATED_DOC_JSON__ = jsondoc;
|
8
|
-
};
|
9
|
-
export const getJSONDoc = () => {
|
10
|
-
return window.__EMBER_GENERATED_DOC_JSON__;
|
11
|
-
};
|
12
|
-
export const extractArgTypes = componentName => {
|
13
|
-
const json = getJSONDoc();
|
14
|
-
|
15
|
-
if (!(json && json.included)) {
|
16
|
-
return null;
|
17
|
-
}
|
18
|
-
|
19
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
20
|
-
|
21
|
-
if (!componentDoc) {
|
22
|
-
return null;
|
23
|
-
}
|
24
|
-
|
25
|
-
return componentDoc.attributes.arguments.reduce((acc, prop) => {
|
26
|
-
acc[prop.name] = {
|
27
|
-
name: prop.name,
|
28
|
-
defaultValue: prop.defaultValue,
|
29
|
-
description: prop.description,
|
30
|
-
table: {
|
31
|
-
defaultValue: {
|
32
|
-
summary: prop.defaultValue
|
33
|
-
},
|
34
|
-
type: {
|
35
|
-
summary: prop.type,
|
36
|
-
required: prop.tags.length ? prop.tags.some(tag => tag.name === 'required') : false
|
37
|
-
}
|
38
|
-
}
|
39
|
-
};
|
40
|
-
return acc;
|
41
|
-
}, {});
|
42
|
-
};
|
43
|
-
export const extractComponentDescription = componentName => {
|
44
|
-
const json = getJSONDoc();
|
45
|
-
|
46
|
-
if (!(json && json.included)) {
|
47
|
-
return null;
|
48
|
-
}
|
49
|
-
|
50
|
-
const componentDoc = json.included.find(doc => doc.attributes.name === componentName);
|
51
|
-
|
52
|
-
if (!componentDoc) {
|
53
|
-
return null;
|
54
|
-
}
|
55
|
-
|
56
|
-
return componentDoc.attributes.description;
|
57
|
-
};
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import { start } from '@storybook/core';
|
2
|
-
import './globals';
|
3
|
-
import { renderToDOM } from './render';
|
4
|
-
const {
|
5
|
-
configure: coreConfigure,
|
6
|
-
clientApi,
|
7
|
-
forceReRender
|
8
|
-
} = start(renderToDOM);
|
9
|
-
export const {
|
10
|
-
setAddon,
|
11
|
-
addDecorator,
|
12
|
-
addParameters,
|
13
|
-
clearDecorators,
|
14
|
-
getStorybook,
|
15
|
-
raw
|
16
|
-
} = clientApi;
|
17
|
-
const framework = 'ember';
|
18
|
-
export const storiesOf = (kind, m) => clientApi.storiesOf(kind, m).addParameters({
|
19
|
-
framework
|
20
|
-
});
|
21
|
-
export const configure = (loadable, m) => coreConfigure(framework, loadable, m);
|
22
|
-
export { forceReRender };
|
@@ -1,79 +0,0 @@
|
|
1
|
-
import global from 'global';
|
2
|
-
import dedent from 'ts-dedent';
|
3
|
-
const {
|
4
|
-
window: globalWindow,
|
5
|
-
document
|
6
|
-
} = global;
|
7
|
-
const rootEl = document.getElementById('root');
|
8
|
-
|
9
|
-
const config = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/config/environment`);
|
10
|
-
|
11
|
-
const app = globalWindow.require(`${globalWindow.STORYBOOK_NAME}/app`).default.create(Object.assign({
|
12
|
-
autoboot: false,
|
13
|
-
rootElement: rootEl
|
14
|
-
}, config.APP));
|
15
|
-
|
16
|
-
let lastPromise = app.boot();
|
17
|
-
let hasRendered = false;
|
18
|
-
let isRendering = false;
|
19
|
-
|
20
|
-
function render(options, el) {
|
21
|
-
if (isRendering) return;
|
22
|
-
isRendering = true;
|
23
|
-
const {
|
24
|
-
template,
|
25
|
-
context = {},
|
26
|
-
element
|
27
|
-
} = options;
|
28
|
-
|
29
|
-
if (hasRendered) {
|
30
|
-
lastPromise = lastPromise.then(instance => instance.destroy());
|
31
|
-
}
|
32
|
-
|
33
|
-
lastPromise = lastPromise.then(() => {
|
34
|
-
const appInstancePrivate = app.buildInstance();
|
35
|
-
return appInstancePrivate.boot().then(() => appInstancePrivate);
|
36
|
-
}).then(instance => {
|
37
|
-
instance.register('component:story-mode', Ember.Component.extend(Object.assign({
|
38
|
-
layout: template || options
|
39
|
-
}, context)));
|
40
|
-
const component = instance.lookup('component:story-mode');
|
41
|
-
|
42
|
-
if (element) {
|
43
|
-
component.appendTo(element);
|
44
|
-
element.appendTo(el);
|
45
|
-
} else {
|
46
|
-
component.appendTo(el);
|
47
|
-
}
|
48
|
-
|
49
|
-
hasRendered = true;
|
50
|
-
isRendering = false;
|
51
|
-
return instance;
|
52
|
-
});
|
53
|
-
}
|
54
|
-
|
55
|
-
export function renderToDOM({
|
56
|
-
storyFn,
|
57
|
-
kind,
|
58
|
-
name,
|
59
|
-
showMain,
|
60
|
-
showError
|
61
|
-
}, domElement) {
|
62
|
-
const element = storyFn();
|
63
|
-
|
64
|
-
if (!element) {
|
65
|
-
showError({
|
66
|
-
title: `Expecting a Ember element from the story: "${name}" of "${kind}".`,
|
67
|
-
description: 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
|
-
|
77
|
-
showMain();
|
78
|
-
render(element, domElement);
|
79
|
-
}
|
File without changes
|
@@ -1,49 +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
|
-
|
3
|
-
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
|
-
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
|
-
import { precompile } from 'ember-source/dist/ember-template-compiler';
|
8
|
-
import { findDistEsm } from '@storybook/core-common';
|
9
|
-
var emberOptions;
|
10
|
-
|
11
|
-
function precompileWithPlugins(string, options) {
|
12
|
-
var precompileOptions = options;
|
13
|
-
|
14
|
-
if (emberOptions && emberOptions.polyfills) {
|
15
|
-
precompileOptions.plugins = {
|
16
|
-
ast: emberOptions.polyfills
|
17
|
-
};
|
18
|
-
}
|
19
|
-
|
20
|
-
return precompile(string, precompileOptions);
|
21
|
-
}
|
22
|
-
|
23
|
-
export function babel(config, options) {
|
24
|
-
if (options && options.presetsList) {
|
25
|
-
options.presetsList.forEach(function (e, index) {
|
26
|
-
if (e.preset && e.preset.emberOptions) {
|
27
|
-
emberOptions = e.preset.emberOptions; // eslint-disable-next-line no-param-reassign
|
28
|
-
|
29
|
-
delete options.presetsList[index].preset.emberOptions;
|
30
|
-
}
|
31
|
-
});
|
32
|
-
}
|
33
|
-
|
34
|
-
var babelConfigPlugins = config.plugins || [];
|
35
|
-
var extraPlugins = [[require.resolve('babel-plugin-htmlbars-inline-precompile'), {
|
36
|
-
precompile: precompileWithPlugins,
|
37
|
-
modules: {
|
38
|
-
'ember-cli-htmlbars': 'hbs',
|
39
|
-
'ember-cli-htmlbars-inline-precompile': 'default',
|
40
|
-
'htmlbars-inline-precompile': 'default'
|
41
|
-
}
|
42
|
-
}], [require.resolve('babel-plugin-ember-modules-api-polyfill')]];
|
43
|
-
return _objectSpread(_objectSpread({}, config), {}, {
|
44
|
-
plugins: [].concat(babelConfigPlugins, extraPlugins)
|
45
|
-
});
|
46
|
-
}
|
47
|
-
export var previewAnnotations = function (entry = []) {
|
48
|
-
return [...entry, findDistEsm(__dirname, 'client/preview/config')];
|
49
|
-
};
|
@@ -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
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export var addons = [require.resolve('./framework-preset-babel-ember'), require.resolve('./framework-preset-ember-docs')];
|
@@ -1 +0,0 @@
|
|
1
|
-
export { storiesOf, setAddon, addDecorator, addParameters, configure, getStorybook, forceReRender, raw, } from './preview';
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import './globals';
|
2
|
-
declare const forceReRender: (() => never) | (() => void);
|
3
|
-
export declare const setAddon: ((addon: any) => void) | (() => never), addDecorator: (() => never) | ((decorator: import("@storybook/csf").DecoratorFunction<import("./types").EmberFramework, import("@storybook/csf").Args>) => void), addParameters: (({ globals, globalTypes, ...parameters }: import("@storybook/csf").Parameters & {
|
4
|
-
globals?: import("@storybook/csf").Globals;
|
5
|
-
globalTypes?: import("@storybook/csf").GlobalTypes;
|
6
|
-
}) => void) | (() => never), clearDecorators: (() => void) | (() => never), getStorybook: (() => never) | (() => import("@storybook/client-api/dist/ts3.9/ClientApi").GetStorybookKind<import("./types").EmberFramework>[]), raw: (() => never) | (() => import("@storybook/store").BoundStory<import("./types").EmberFramework>[]);
|
7
|
-
export declare const storiesOf: (kind: string, m: any) => import("@storybook/addons").StoryApi<import("./types").OptionsArgs>;
|
8
|
-
export declare const configure: (loadable: any, m: any) => void;
|
9
|
-
export { forceReRender };
|
@@ -1,14 +0,0 @@
|
|
1
|
-
export { RenderContext } from '@storybook/core';
|
2
|
-
export interface ShowErrorArgs {
|
3
|
-
title: string;
|
4
|
-
description: string;
|
5
|
-
}
|
6
|
-
export interface OptionsArgs {
|
7
|
-
template: any;
|
8
|
-
context: any;
|
9
|
-
element: any;
|
10
|
-
}
|
11
|
-
export declare type EmberFramework = {
|
12
|
-
component: any;
|
13
|
-
storyResult: OptionsArgs;
|
14
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { TransformOptions } from '@babel/core';
|
2
|
-
import { StorybookConfig, Options } from '@storybook/core-common';
|
3
|
-
export declare function babel(config: TransformOptions, options: Options): TransformOptions;
|
4
|
-
export declare const previewAnnotations: StorybookConfig['previewAnnotations'];
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export { storiesOf, setAddon, addDecorator, addParameters, configure, getStorybook, forceReRender, raw, } from './preview';
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|