Socket
Socket
Sign inDemoInstall

@storybook/svelte

Package Overview
Dependencies
Maintainers
11
Versions
1815
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@storybook/svelte - npm Package Compare versions

Comparing version 0.0.0-pr-28882-sha-e607100a to 0.0.0-pr-28920-sha-f4db6c03

8

dist/createSvelte5Props.svelte.js
/**
* Turns an object into reactive props in Svelte 5.
* Needs to be in a separate .svelte.js file to ensure Svelte
* compiles it.
* As proposed in https://github.com/sveltejs/svelte/issues/9827#issuecomment-1845589616
* Turns an object into reactive props in Svelte 5. Needs to be in a separate .svelte.js file to
* ensure Svelte compiles it. As proposed in
* https://github.com/sveltejs/svelte/issues/9827#issuecomment-1845589616
*
* @template TProps

@@ -7,0 +7,0 @@ * @param {TProps} data - The data to create Svelte 5 props from.

@@ -43,8 +43,12 @@ import { Args, ComponentAnnotations, AnnotatedStoryFn, ArgsStoryFn, ArgsFromMeta, StoryAnnotations, StrictArgs, DecoratorFunction, LoaderFunction, StoryContext as StoryContext$1, ProjectAnnotations, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, StoryAnnotationsOrFn, Store_CSFExports, StoriesWithPartialProps, ComposedStoryFn } from 'storybook/internal/types';

};
/** Function that sets the globalConfig of your storybook. The global config is the preview module of your .storybook folder.
/**
* Function that sets the globalConfig of your storybook. The global config is the preview module of
* your .storybook folder.
*
* It should be run a single time, so that your global config (e.g. decorators) is applied to your stories when using `composeStories` or `composeStory`.
* It should be run a single time, so that your global config (e.g. decorators) is applied to your
* stories when using `composeStories` or `composeStory`.
*
* Example:
*```jsx
*
* ```jsx
* // setup.js (for jest)

@@ -55,18 +59,18 @@ * import { setProjectAnnotations } from '@storybook/svelte';

* setProjectAnnotations(projectAnnotations);
*```
* ```
*
* @param projectAnnotations - e.g. (import projectAnnotations from '../.storybook/preview')
* @param projectAnnotations - E.g. (import projectAnnotations from '../.storybook/preview')
*/
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations | NamedOrDefaultProjectAnnotations[]): NormalizedProjectAnnotations<SvelteRenderer>;
declare function setProjectAnnotations(projectAnnotations: NamedOrDefaultProjectAnnotations<any> | NamedOrDefaultProjectAnnotations<any>[]): NormalizedProjectAnnotations<SvelteRenderer>;
declare const INTERNAL_DEFAULT_PROJECT_ANNOTATIONS: ProjectAnnotations<SvelteRenderer>;
/**
* Function that will receive a story along with meta (e.g. a default export from a .stories file)
* and optionally projectAnnotations e.g. (import * from '../.storybook/preview)
* and will return a composed component that has all args/parameters/decorators/etc combined and applied to it.
* and optionally projectAnnotations e.g. (import * from '../.storybook/preview) and will return a
* composed component that has all args/parameters/decorators/etc combined and applied to it.
*
*
* It's very useful for reusing a story in scenarios outside of Storybook like unit testing.
*
* Example:
*```jsx
*
* ```jsx
* import { render } from '@testing-library/svelte';

@@ -82,8 +86,9 @@ * import { composeStory } from '@storybook/svelte';

* });
*```
* ```
*
* @param story
* @param componentAnnotations - e.g. (import Meta from './Button.stories')
* @param [projectAnnotations] - e.g. (import * as projectAnnotations from '../.storybook/preview') this can be applied automatically if you use `setProjectAnnotations` in your setup files.
* @param [exportsName] - in case your story does not contain a name and you want it to have a name.
* @param componentAnnotations - E.g. (import Meta from './Button.stories')
* @param [projectAnnotations] - E.g. (import * as projectAnnotations from '../.storybook/preview')
* this can be applied automatically if you use `setProjectAnnotations` in your setup files.
* @param [exportsName] - In case your story does not contain a name and you want it to have a name.
*/

@@ -93,10 +98,11 @@ declare function composeStory<TArgs extends Args = Args>(story: StoryAnnotationsOrFn<SvelteRenderer, TArgs>, componentAnnotations: Meta<TArgs | any>, projectAnnotations?: ProjectAnnotations<SvelteRenderer>, exportsName?: string): ComposedStory<TArgs>;

* Function that will receive a stories import (e.g. `import * as stories from './Button.stories'`)
* and optionally projectAnnotations (e.g. `import * from '../.storybook/preview`)
* and will return an object containing all the stories passed, but now as a composed component that has all args/parameters/decorators/etc combined and applied to it.
* and optionally projectAnnotations (e.g. `import * from '../.storybook/preview`) and will return
* an object containing all the stories passed, but now as a composed component that has all
* args/parameters/decorators/etc combined and applied to it.
*
*
* It's very useful for reusing stories in scenarios outside of Storybook like unit testing.
*
* Example:
*```jsx
*
* ```jsx
* import { render } from '@testing-library/svelte';

@@ -112,6 +118,7 @@ * import { composeStories } from '@storybook/svelte';

* });
*```
* ```
*
* @param csfExports - e.g. (import * as stories from './Button.stories')
* @param [projectAnnotations] - e.g. (import * as projectAnnotations from '../.storybook/preview') this can be applied automatically if you use `setProjectAnnotations` in your setup files.
* @param csfExports - E.g. (import * as stories from './Button.stories')
* @param [projectAnnotations] - E.g. (import * as projectAnnotations from '../.storybook/preview')
* this can be applied automatically if you use `setProjectAnnotations` in your setup files.
*/

@@ -118,0 +125,0 @@ declare function composeStories<TModule extends Store_CSFExports<SvelteRenderer, any>>(csfExports: TModule, projectAnnotations?: ProjectAnnotations<SvelteRenderer>): Omit<MapToComposed<StoriesWithPartialProps<SvelteRenderer<PreviewRender<any, any, any>>, TModule>>, keyof Store_CSFExports>;

{
"name": "@storybook/svelte",
"version": "0.0.0-pr-28882-sha-e607100a",
"version": "0.0.0-pr-28920-sha-f4db6c03",
"description": "Storybook Svelte renderer",

@@ -60,7 +60,7 @@ "keywords": [

"dependencies": {
"@storybook/components": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/components": "^0.0.0-pr-28920-sha-f4db6c03",
"@storybook/global": "^5.0.0",
"@storybook/manager-api": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/preview-api": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/theming": "^0.0.0-pr-28882-sha-e607100a",
"@storybook/manager-api": "^0.0.0-pr-28920-sha-f4db6c03",
"@storybook/preview-api": "^0.0.0-pr-28920-sha-f4db6c03",
"@storybook/theming": "^0.0.0-pr-28920-sha-f4db6c03",
"sveltedoc-parser": "^4.2.1",

@@ -81,3 +81,3 @@ "ts-dedent": "^2.0.0",

"peerDependencies": {
"storybook": "^0.0.0-pr-28882-sha-e607100a",
"storybook": "^0.0.0-pr-28920-sha-f4db6c03",
"svelte": "^4.0.0 || ^5.0.0-next.65"

@@ -84,0 +84,0 @@ },

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc