UNPKG

@stories-js/core

Version:

Stories web components to build stories

38 lines (34 loc) 1.1 kB
/*! * (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'; const toolZoomCss = ":host{display:block}"; const ToolZoom = class { constructor(hostRef) { registerInstance(this, hostRef); } actionHandler(event) { const command = event.detail.command; // Update zoom property in the Store's state if (command === "zoomIn") { state.zoom += 0.1; } else if (command === "zoomOut") { state.zoom -= 0.1; } else { state.zoom = 1; } } render() { return [ h("stories-tool-button", { command: "zoomIn", icon: "zoomIn", onStoriesAction: this.actionHandler }), h("stories-tool-button", { command: "zoomOut", icon: "zoomOut", onStoriesAction: this.actionHandler }), h("stories-tool-button", { command: "zoomReset", icon: "zoomReset", onStoriesAction: this.actionHandler }), ]; } }; ToolZoom.style = toolZoomCss; export { ToolZoom as stories_tool_zoom }; //# sourceMappingURL=stories-tool-zoom.entry.js.map