@stories-js/core
Version:
Stories web components to build stories
5 lines • 848 B
JavaScript
/*!
* (C) StoriesJS https://storiesjs.org - GPL-2.0 License
*/
import{r as t,h as r,c as s}from"./p-dea5a230.js";function e(){try{return document.implementation.createHTMLDocument("").body.style.zoom!==undefined}catch(t){return false}}function n(t){return{zoom:t.toPrecision(2)}}function o(t,r){return{height:(t+50).toFixed(),transformOrigin:"top left",transform:`scale(${r})`}}const a=":host{display:block}";const i=e();const c=class{constructor(r){t(this,r);this.height=0;this.zoom=1}watchStateHandler(t){this.height=t.getBoundingClientRect().height}render(){const t=i?n(this.zoom):o(this.height,this.zoom);return r(s,{style:t},r("div",{ref:t=>this.div=t,class:"innerZoomElementWrapper"},r("slot",null)))}static get watchers(){return{div:["watchStateHandler"]}}};c.style=a;export{c as stories_zoom};
//# sourceMappingURL=p-7ed89d1a.entry.js.map