UNPKG

2.45 kBJavaScriptView Raw
1"use strict";
2
3function _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
5require("core-js/modules/es.array.iterator.js");
6
7require("core-js/modules/es.object.to-string.js");
8
9require("core-js/modules/es.string.iterator.js");
10
11require("core-js/modules/es.weak-map.js");
12
13require("core-js/modules/web.dom-collections.iterator.js");
14
15require("core-js/modules/es.object.get-own-property-descriptor.js");
16
17require("core-js/modules/es.symbol.js");
18
19require("core-js/modules/es.symbol.description.js");
20
21require("core-js/modules/es.symbol.iterator.js");
22
23require("core-js/modules/es.function.name.js");
24
25var _addons = require("@storybook/addons");
26
27var _constants = _interopRequireWildcard(require("./constants"));
28
29function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
30
31function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
32
33_addons.addons.register(_constants.ADDON_ID, function (api) {
34 var channel = _addons.addons.getChannel();
35
36 channel.on(_constants.default.REQUEST, function (_ref) {
37 var kind = _ref.kind,
38 name = _ref.name;
39 var id = api.storyId(kind, name);
40 api.emit(_constants.default.RECEIVE, id);
41 });
42});
\No newline at end of file