@stories-js/core
Version:
Stories web components to build stories
42 lines (36 loc) • 1.21 kB
JavaScript
/*!
* (C) StoriesJS https://storiesjs.org - GPL-2.0 License
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
const index = require('./index-c25eada5.js');
const index$1 = require('./index-ad63dbd0.js');
const toolZoomCss = ":host{display:block}";
const ToolZoom = class {
constructor(hostRef) {
index.registerInstance(this, hostRef);
}
actionHandler(event) {
const command = event.detail.command;
// Update zoom property in the Store's state
if (command === "zoomIn") {
index$1.state.zoom += 0.1;
}
else if (command === "zoomOut") {
index$1.state.zoom -= 0.1;
}
else {
index$1.state.zoom = 1;
}
}
render() {
return [
index.h("stories-tool-button", { command: "zoomIn", icon: "zoomIn", onStoriesAction: this.actionHandler }),
index.h("stories-tool-button", { command: "zoomOut", icon: "zoomOut", onStoriesAction: this.actionHandler }),
index.h("stories-tool-button", { command: "zoomReset", icon: "zoomReset", onStoriesAction: this.actionHandler }),
];
}
};
ToolZoom.style = toolZoomCss;
exports.stories_tool_zoom = ToolZoom;
//# sourceMappingURL=stories-tool-zoom.cjs.entry.js.map