{"version":3,"sources":["../src/preview.ts"],"names":["withRtl","StoryFn","context","globals","useGlobals","preview","preview_default"],"mappings":"+CAiBMA,IAAAA,CAAAA,CAA6B,CAACC,CAASC,CAAAA,CAAAA,GAAY,CACvD,GAAM,CAACC,CAAO,CAAA,CAAIC,UAAW,EAAA,CAE7B,OAACF,CAAQ,CAAA,aAAA,CAA8B,GAAMC,CAAAA,CAAAA,CAAQ,SAE9CF,CAAQ,EACjB,CAEMI,CAAAA,CAAAA,CAAwC,CAC5C,cAAgB,CAAA,CACd,QAAU,CAAA,KACZ,EACA,UAAY,CAAA,CAACL,CAAO,CACtB,EAEOM,CAAQD,CAAAA","file":"preview.mjs","sourcesContent":["/**\n * A decorator is a way to wrap a story in extra “rendering” functionality. Many addons define decorators\n * in order to augment stories:\n * - with extra rendering\n * - gather details about how a story is rendered\n *\n * When writing stories, decorators are typically used to wrap stories with extra markup or context mocking.\n *\n * https://storybook.js.org/docs/react/writing-stories/decorators\n */\nimport type {\n  Renderer,\n  ProjectAnnotations,\n  DecoratorFunction,\n} from \"storybook/internal/types\";\nimport { useGlobals } from \"storybook/preview-api\";\n\nconst withRtl: DecoratorFunction = (StoryFn, context) => {\n  const [globals] = useGlobals();\n\n  (context.canvasElement as HTMLElement).dir = globals.addonRtl;\n\n  return StoryFn();\n};\n\nconst preview: ProjectAnnotations<Renderer> = {\n  initialGlobals: {\n    addonRtl: \"ltr\",\n  },\n  decorators: [withRtl],\n};\n\nexport default preview;\n"]}