@stories-js/core
Version:
Stories web components to build stories
5 lines • 1.12 kB
JavaScript
/*!
* (C) StoriesJS https://storiesjs.org - GPL-2.0 License
*/
import{r as t,i as s,h as o}from"./p-dea5a230.js";import{a as e}from"./p-8734f9a2.js";import{s as n}from"./p-1e8c2016.js";const r=":host{height:100%;width:100%;background-color:coral}";const i=class{constructor(o){t(this,o);this.storyChange=s(this,"storyChange",7);this.storyContextChange=s(this,"storyContextChange",7);this.modules=[];this.store=n}createContext(t){const s={args:Object.assign({},t.args),argTypes:Object.assign({},t.argTypes),parameters:Object.assign({},t.parameters),initialArgs:Object.assign({},t.args)};return s}onHash(){const t=e.getStoryIdFromURL();const s=n.story=t?n.stories[t]:undefined;console.log("onHash",t,s);e.selectStory(t);this.storyChange.emit(s);console.log("storyChange emit",s);const o=s?this.createContext(s):undefined;n.context=o;this.storyContextChange.emit(o);console.log("storyContextChange emit",s)}componentDidLoad(){console.log("componentDidLoad",this.modules);e.setStories(this.modules);this.onHash()}render(){return o("slot",null)}};i.style=r;export{i as stories_app};
//# sourceMappingURL=p-63fc22db.entry.js.map