Socket
Socket
Sign inDemoInstall

@storybook/core-events

Package Overview
Dependencies
Maintainers
5
Versions
1774
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/core-events

Event names used in storybook core


Version published
Weekly downloads
12M
decreased by-2.72%
Maintainers
5
Created
Weekly downloads
 

Package description

What is @storybook/core-events?

@storybook/core-events is a package that provides a set of core events for Storybook, a tool for developing UI components in isolation. These events facilitate communication between different parts of Storybook, such as the manager and the preview, enabling features like story selection, control updates, and more.

What are @storybook/core-events's main functionalities?

Story Selection

This feature allows you to programmatically select a story in Storybook. The code sample demonstrates how to emit a story selection event using the SELECT_STORY event type.

const { SELECT_STORY } = require('@storybook/core-events');

// Example of emitting a story selection event
const channel = addons.getChannel();
channel.emit(SELECT_STORY, { kind: 'Button', story: 'Primary' });

Control Updates

This feature allows you to update the controls (args) of a story. The code sample shows how to emit an event to update the arguments of a specific story using the UPDATE_STORY_ARGS event type.

const { UPDATE_STORY_ARGS } = require('@storybook/core-events');

// Example of emitting a control update event
const channel = addons.getChannel();
channel.emit(UPDATE_STORY_ARGS, { storyId: 'button--primary', updatedArgs: { label: 'Click Me' } });

Story Rendering

This feature allows you to listen for when a story has been rendered. The code sample demonstrates how to listen for the STORY_RENDERED event and log a message when a story is rendered.

const { STORY_RENDERED } = require('@storybook/core-events');

// Example of listening for a story rendered event
const channel = addons.getChannel();
channel.on(STORY_RENDERED, (storyId) => {
  console.log(`Story ${storyId} has been rendered`);
});

Other packages similar to @storybook/core-events

Changelog

Source

7.0.0-alpha.57 (December 3, 2022)

Bug Fixes
  • Vite: Reinstate (deprecated) StorybookViteConfig #20057
  • Docs: using targeted styles, not components to style MDX #19958
  • Docs: Return to filtering toolbars in docs mode, but don't filter menu #19959
  • Angular: Don't set argType.defaultValue in angular/compodoc #19935
  • NextJS: Support next/image component in v12/13 properly #20028
  • Svelte: Use JSDocs in JS CLI templates and put manual enum arg type back as it is not inferred #20042
Maintenance
  • CLI: Add a new version-update check telemetry event #20074
  • CLI: Add upgrade telemetry details #20064
  • Core: added .entries property to error thrown when duplicate stories are present #20038
Build
  • Improve framework version specific story handling #20027
  • Fix repro templates script #20063
  • Build: replace image placeholder url in example stories for nextjs #20069
  • Build: improve inDevelopment mode for yarn task #20067
  • Build: revamp interactions e2e test #20060
Dependency Upgrades
  • Build: Update jest pretty-format to 29 #20047

Keywords

FAQs

Package last updated on 03 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc