|
| 1 | +/* do not change this file, it is auto generated by storybook. */ |
| 2 | +/// <reference types="@storybook/react-native/metro-env" /> |
| 3 | +import { start, updateView, type View, type Features } from '@storybook/react-native'; |
| 4 | + |
| 5 | +import '@storybook/addon-ondevice-controls/register'; |
| 6 | +import '@storybook/addon-ondevice-actions/register'; |
| 7 | + |
| 8 | +const normalizedStories = [ |
| 9 | + { |
| 10 | + titlePrefix: '', |
| 11 | + directory: '../src', |
| 12 | + files: '**/*.stories.?(ts|tsx)', |
| 13 | + importPathMatcher: /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx)?)$/, |
| 14 | + req: require.context('../../src', true, /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx)?)$/), |
| 15 | + }, |
| 16 | + { |
| 17 | + titlePrefix: '', |
| 18 | + directory: '../../native/Callout/src', |
| 19 | + files: '**/*.stories.?(ts|tsx)', |
| 20 | + importPathMatcher: /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx)?)$/, |
| 21 | + req: require.context( |
| 22 | + '../../../native/Callout/src', |
| 23 | + true, |
| 24 | + /^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx)?)$/, |
| 25 | + ), |
| 26 | + }, |
| 27 | +]; |
| 28 | + |
| 29 | +declare global { |
| 30 | + var view: View; |
| 31 | + var STORIES: typeof normalizedStories; |
| 32 | + var STORYBOOK_WEBSOCKET: { host?: string; port?: number; secured?: boolean } | undefined; |
| 33 | + var FEATURES: Features; |
| 34 | +} |
| 35 | + |
| 36 | +const annotations = [require('./preview'), require('@storybook/react-native/preview')]; |
| 37 | + |
| 38 | +globalThis.STORIES = normalizedStories; |
| 39 | + |
| 40 | +module?.hot?.accept?.(); |
| 41 | + |
| 42 | +const options = {}; |
| 43 | + |
| 44 | +if (!globalThis.view) { |
| 45 | + globalThis.view = start({ |
| 46 | + annotations, |
| 47 | + storyEntries: normalizedStories, |
| 48 | + options, |
| 49 | + }); |
| 50 | +} else { |
| 51 | + updateView(globalThis.view, annotations, normalizedStories, options); |
| 52 | +} |
| 53 | + |
| 54 | +export const view: View = globalThis.view; |
0 commit comments