storybook-i18n 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/preview.d.ts CHANGED
@@ -1,5 +1,12 @@
1
- import { ProjectAnnotations, Renderer } from '@storybook/types';
1
+ import * as _storybook_types from '@storybook/types';
2
+ import { Renderer } from '@storybook/types';
2
3
 
3
- declare const preview: ProjectAnnotations<Renderer>;
4
+ declare const preview: {
5
+ decorators: ((story: _storybook_types.PartialStoryFn<Renderer, _storybook_types.Args>, context: _storybook_types.StoryContext<Renderer, _storybook_types.Args>) => unknown)[];
6
+ globals: {
7
+ locale: string;
8
+ locales: {};
9
+ };
10
+ };
4
11
 
5
12
  export { preview as default };
package/dist/preview.js CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  var previewApi = require('@storybook/preview-api');
4
4
 
5
- var e=(r,o)=>{let[c,n]=previewApi.useGlobals();return previewApi.useEffect(()=>{let{parameters:{locale:t}}=o;t&&n({locale:t});},[]),r(o)};var l={decorators:[e],globals:{locale:"",locales:{}}},f=l;
5
+ var e=(r,o)=>{let[i,n]=previewApi.useGlobals();return previewApi.useEffect(()=>{let{parameters:{locale:t}}=o;t&&n({locale:t});},[]),r(o)};var l={decorators:[e],globals:{locale:"",locales:{}}},m=l;
6
6
 
7
- module.exports = f;
7
+ module.exports = m;
8
8
  //# sourceMappingURL=out.js.map
9
9
  //# sourceMappingURL=preview.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/withLocale.ts","../src/preview.ts"],"names":["useEffect","useGlobals","withLocale","story","context","_","updateGlobals","locale","preview","preview_default"],"mappings":"AAAA,OAAQ,aAAAA,EAAW,cAAAC,MAAiB,yBAO7B,IAAMC,EAAa,CACtBC,EACAC,IACC,CACD,GAAM,CAACC,EAAGC,CAAa,EAAIL,EAAW,EAEtC,OAAAD,EAAU,IAAM,CACZ,GAAM,CACF,WAAY,CAAC,OAAAO,CAAM,CACvB,EAAIH,EAEAG,GACAD,EAAc,CAAC,OAAAC,CAAM,CAAC,CAE9B,EAAG,CAAC,CAAC,EAEEJ,EAAMC,CAAO,CACxB,ECrBA,IAAMI,EAAwC,CAC1C,WAAY,CAACN,CAAU,EACvB,QAAS,CACL,OAAQ,GACR,QAAS,CAAC,CACd,CACJ,EAEOO,EAAQD","sourcesContent":["import {useEffect, useGlobals} from '@storybook/preview-api';\nimport {\n PartialStoryFn as StoryFunction,\n Renderer,\n StoryContext,\n} from '@storybook/types';\n\nexport const withLocale = (\n story: StoryFunction<Renderer>,\n context: StoryContext\n) => {\n const [_, updateGlobals] = useGlobals();\n\n useEffect(() => {\n const {\n parameters: {locale},\n } = context;\n\n if (locale) {\n updateGlobals({locale});\n }\n }, []);\n\n return story(context);\n};\n","import type {Renderer, ProjectAnnotations} from '@storybook/types';\nimport {withLocale} from './withLocale';\n\nconst preview: ProjectAnnotations<Renderer> = {\n decorators: [withLocale],\n globals: {\n locale: '',\n locales: {},\n },\n};\n\nexport default preview;\n"]}
1
+ {"version":3,"sources":["../src/withLocale.ts","../src/preview.ts"],"names":["useEffect","useGlobals","withLocale","story","context","_","updateGlobals","locale","preview","preview_default"],"mappings":"AAAA,OAAQ,aAAAA,EAAW,cAAAC,MAAiB,yBAO7B,IAAMC,EAAa,CACtBC,EACAC,IACC,CACD,GAAM,CAACC,EAAGC,CAAa,EAAIL,EAAW,EAEtC,OAAAD,EAAU,IAAM,CACZ,GAAM,CACF,WAAY,CAAC,OAAAO,CAAM,CACvB,EAAIH,EAEAG,GACAD,EAAc,CAAC,OAAAC,CAAM,CAAC,CAE9B,EAAG,CAAC,CAAC,EAEEJ,EAAMC,CAAO,CACxB,ECrBA,IAAMI,EAAU,CACZ,WAAY,CAACN,CAAU,EACvB,QAAS,CACL,OAAQ,GACR,QAAS,CAAC,CACd,CACJ,EAEOO,EAAQD","sourcesContent":["import {useEffect, useGlobals} from '@storybook/preview-api';\nimport {\n PartialStoryFn as StoryFunction,\n Renderer,\n StoryContext,\n} from '@storybook/types';\n\nexport const withLocale = (\n story: StoryFunction<Renderer>,\n context: StoryContext\n) => {\n const [_, updateGlobals] = useGlobals();\n\n useEffect(() => {\n const {\n parameters: {locale},\n } = context;\n\n if (locale) {\n updateGlobals({locale});\n }\n }, []);\n\n return story(context);\n};\n","import type {Renderer, ProjectAnnotations} from '@storybook/types';\nimport {withLocale} from './withLocale';\n\nconst preview = {\n decorators: [withLocale],\n globals: {\n locale: '',\n locales: {},\n },\n} satisfies ProjectAnnotations<Renderer>;\n\nexport default preview;\n"]}
package/dist/preview.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { useGlobals, useEffect } from '@storybook/preview-api';
2
2
 
3
- var e=(r,o)=>{let[c,n]=useGlobals();return useEffect(()=>{let{parameters:{locale:t}}=o;t&&n({locale:t});},[]),r(o)};var l={decorators:[e],globals:{locale:"",locales:{}}},f=l;
3
+ var e=(r,o)=>{let[i,n]=useGlobals();return useEffect(()=>{let{parameters:{locale:t}}=o;t&&n({locale:t});},[]),r(o)};var l={decorators:[e],globals:{locale:"",locales:{}}},m=l;
4
4
 
5
- export { f as default };
5
+ export { m as default };
6
6
  //# sourceMappingURL=out.js.map
7
7
  //# sourceMappingURL=preview.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/withLocale.ts","../src/preview.ts"],"names":["useEffect","useGlobals","withLocale","story","context","_","updateGlobals","locale","preview","preview_default"],"mappings":"AAAA,OAAQ,aAAAA,EAAW,cAAAC,MAAiB,yBAO7B,IAAMC,EAAa,CACtBC,EACAC,IACC,CACD,GAAM,CAACC,EAAGC,CAAa,EAAIL,EAAW,EAEtC,OAAAD,EAAU,IAAM,CACZ,GAAM,CACF,WAAY,CAAC,OAAAO,CAAM,CACvB,EAAIH,EAEAG,GACAD,EAAc,CAAC,OAAAC,CAAM,CAAC,CAE9B,EAAG,CAAC,CAAC,EAEEJ,EAAMC,CAAO,CACxB,ECrBA,IAAMI,EAAwC,CAC1C,WAAY,CAACN,CAAU,EACvB,QAAS,CACL,OAAQ,GACR,QAAS,CAAC,CACd,CACJ,EAEOO,EAAQD","sourcesContent":["import {useEffect, useGlobals} from '@storybook/preview-api';\nimport {\n PartialStoryFn as StoryFunction,\n Renderer,\n StoryContext,\n} from '@storybook/types';\n\nexport const withLocale = (\n story: StoryFunction<Renderer>,\n context: StoryContext\n) => {\n const [_, updateGlobals] = useGlobals();\n\n useEffect(() => {\n const {\n parameters: {locale},\n } = context;\n\n if (locale) {\n updateGlobals({locale});\n }\n }, []);\n\n return story(context);\n};\n","import type {Renderer, ProjectAnnotations} from '@storybook/types';\nimport {withLocale} from './withLocale';\n\nconst preview: ProjectAnnotations<Renderer> = {\n decorators: [withLocale],\n globals: {\n locale: '',\n locales: {},\n },\n};\n\nexport default preview;\n"]}
1
+ {"version":3,"sources":["../src/withLocale.ts","../src/preview.ts"],"names":["useEffect","useGlobals","withLocale","story","context","_","updateGlobals","locale","preview","preview_default"],"mappings":"AAAA,OAAQ,aAAAA,EAAW,cAAAC,MAAiB,yBAO7B,IAAMC,EAAa,CACtBC,EACAC,IACC,CACD,GAAM,CAACC,EAAGC,CAAa,EAAIL,EAAW,EAEtC,OAAAD,EAAU,IAAM,CACZ,GAAM,CACF,WAAY,CAAC,OAAAO,CAAM,CACvB,EAAIH,EAEAG,GACAD,EAAc,CAAC,OAAAC,CAAM,CAAC,CAE9B,EAAG,CAAC,CAAC,EAEEJ,EAAMC,CAAO,CACxB,ECrBA,IAAMI,EAAU,CACZ,WAAY,CAACN,CAAU,EACvB,QAAS,CACL,OAAQ,GACR,QAAS,CAAC,CACd,CACJ,EAEOO,EAAQD","sourcesContent":["import {useEffect, useGlobals} from '@storybook/preview-api';\nimport {\n PartialStoryFn as StoryFunction,\n Renderer,\n StoryContext,\n} from '@storybook/types';\n\nexport const withLocale = (\n story: StoryFunction<Renderer>,\n context: StoryContext\n) => {\n const [_, updateGlobals] = useGlobals();\n\n useEffect(() => {\n const {\n parameters: {locale},\n } = context;\n\n if (locale) {\n updateGlobals({locale});\n }\n }, []);\n\n return story(context);\n};\n","import type {Renderer, ProjectAnnotations} from '@storybook/types';\nimport {withLocale} from './withLocale';\n\nconst preview = {\n decorators: [withLocale],\n globals: {\n locale: '',\n locales: {},\n },\n} satisfies ProjectAnnotations<Renderer>;\n\nexport default preview;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "storybook-i18n",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "description": "Tool to set the locale in Storybook for i18n",
5
5
  "keywords": [
6
6
  "storybook-addons",