UNPKG

@stories-js/core

Version:

Stories web components to build stories

5 lines 2.83 kB
var __awaiter=this&&this.__awaiter||function(t,n,r,e){function o(t){return t instanceof r?t:new r((function(n){n(t)}))}return new(r||(r=Promise))((function(r,i){function a(t){try{s(e.next(t))}catch(n){i(n)}}function u(t){try{s(e["throw"](t))}catch(n){i(n)}}function s(t){t.done?r(t.value):o(t.value).then(a,u)}s((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var r={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},e,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(t){return function(n){return s([t,n])}}function s(a){if(e)throw new TypeError("Generator is already executing.");while(r)try{if(e=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:r.label++;return{value:a[1],done:false};case 5:r.label++;o=a[1];a=[0];continue;case 7:a=r.ops.pop();r.trys.pop();continue;default:if(!(i=r.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){r=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){r.label=a[1];break}if(a[0]===6&&r.label<i[1]){r.label=i[1];i=a;break}if(i&&r.label<i[2]){r.label=i[2];r.ops.push(a);break}if(i[2])r.ops.pop();r.trys.pop();continue}a=n.call(t,r)}catch(u){a=[6,u];o=0}finally{e=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}}; /*! * (C) StoriesJS https://storiesjs.org - GPL-2.0 License */import{r as registerInstance,h}from"./index-49238f69.js";import{s as state}from"./index-f706f0f6.js";var addonsCss="";var Addons=function(){function t(t){registerInstance(this,t)}t.prototype.registerAddon=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){n=state.addons;if(n[t.id]){throw new Error("Please remove duplicate addon ".concat(t.id))}n[t.id]=t;return[2]}))}))};t.prototype.unregisterAddon=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){n=state.addons;if(!n[t.id]){throw new Error("Cannot unregister addon ".concat(t.id))}delete n[t.id];return[2]}))}))};t.prototype.findAddon=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(r){n=state.addons;if(!n[t]){throw new Error("Cannot find addon by id ".concat(t))}return[2,n[t]]}))}))};t.prototype.storyContextChanged=function(t,n){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){Object.values(state.addons).forEach((function(r){r.storyContextChanged(t,n)}));return[2]}))}))};t.prototype.render=function(){return h("slot",null)};return t}();Addons.style=addonsCss;export{Addons as stories_addons}; //# sourceMappingURL=stories-addons.entry.js.map