@storybook/react-native 7.6.10-alpha.0 → 7.6.10-alpha.1
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/V6.d.ts +1 -1
- package/dist/V6.js +32 -15
- package/dist/{View-0aedc31a.d.ts → View-3a0f8584.d.ts} +7 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +32 -15
- package/package.json +4 -4
- package/readme.md +5 -0
- package/scripts/mocks/exclude-config-files/exclude-components/FakeComponent.tsx +1 -1
- package/scripts/mocks/file-extensions/main.ts +1 -3
- package/template/cli/index.ts +13 -0
- package/template/cli/preview.tsx +14 -0
- package/template/cli/stories/Button/{Button.stories.js → Button.stories.tsx} +4 -4
- package/template/cli/stories/Button/{Button.js → Button.tsx} +6 -2
- package/template/cli/storybook.requires.ts +34 -0
- package/template/cli/index.js +0 -7
- package/template/cli/preview.js +0 -8
- package/template/cli/storybook.requires.js +0 -54
package/dist/V6.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { P as Params } from './View-
|
|
2
|
+
import { P as Params } from './View-3a0f8584.js';
|
|
3
3
|
import { ClientApi } from '@storybook/preview-api';
|
|
4
4
|
import { L as LoaderFunction, A as Addon_StoryApi } from './index.d-cff8c6fa.js';
|
|
5
5
|
import { ReactNode } from 'react';
|
package/dist/V6.js
CHANGED
|
@@ -80,14 +80,21 @@ var import_preview_api3 = require("@storybook/preview-api");
|
|
|
80
80
|
var import_preview_web = require("@storybook/preview-web");
|
|
81
81
|
|
|
82
82
|
// src/View.tsx
|
|
83
|
-
var import_async_storage = __toESM(require("@react-native-async-storage/async-storage"));
|
|
84
83
|
var import_csf = require("@storybook/csf");
|
|
85
|
-
var import_preview_api2 = require("@storybook/preview-api");
|
|
86
84
|
var import_manager_api2 = require("@storybook/manager-api");
|
|
85
|
+
var import_preview_api2 = require("@storybook/preview-api");
|
|
87
86
|
var import_react_native_theming12 = require("@storybook/react-native-theming");
|
|
88
87
|
var import_react16 = require("react");
|
|
89
88
|
var import_react_native_safe_area_context3 = require("react-native-safe-area-context");
|
|
90
89
|
|
|
90
|
+
// src/components/OnDeviceUI/OnDeviceUI.tsx
|
|
91
|
+
var import_react_native_theming10 = require("@storybook/react-native-theming");
|
|
92
|
+
var import_react15 = __toESM(require("react"));
|
|
93
|
+
var import_react_native14 = require("react-native");
|
|
94
|
+
|
|
95
|
+
// src/constants.ts
|
|
96
|
+
var ANIMATION_DURATION_TRANSITION = 400;
|
|
97
|
+
|
|
91
98
|
// src/hooks.tsx
|
|
92
99
|
var import_react2 = __toESM(require("react"));
|
|
93
100
|
|
|
@@ -841,14 +848,6 @@ function useSelectedAddon(initialValue) {
|
|
|
841
848
|
return result;
|
|
842
849
|
}
|
|
843
850
|
|
|
844
|
-
// src/components/OnDeviceUI/OnDeviceUI.tsx
|
|
845
|
-
var import_react_native_theming10 = require("@storybook/react-native-theming");
|
|
846
|
-
var import_react15 = __toESM(require("react"));
|
|
847
|
-
var import_react_native14 = require("react-native");
|
|
848
|
-
|
|
849
|
-
// src/constants.ts
|
|
850
|
-
var ANIMATION_DURATION_TRANSITION = 400;
|
|
851
|
-
|
|
852
851
|
// src/components/StoryListView/StoryListView.tsx
|
|
853
852
|
var import_core_events = __toESM(require("@storybook/core-events"));
|
|
854
853
|
var import_react_native_theming = require("@storybook/react-native-theming");
|
|
@@ -1952,6 +1951,7 @@ var OnDeviceUI_default = import_react15.default.memo(OnDeviceUI);
|
|
|
1952
1951
|
// src/View.tsx
|
|
1953
1952
|
var import_channels = require("@storybook/channels");
|
|
1954
1953
|
var import_core_events2 = __toESM(require("@storybook/core-events"));
|
|
1954
|
+
var import_dedent = __toESM(require("dedent"));
|
|
1955
1955
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
1956
1956
|
var import_react_native16 = require("react-native");
|
|
1957
1957
|
|
|
@@ -2012,6 +2012,7 @@ var View10 = class {
|
|
|
2012
2012
|
_preview;
|
|
2013
2013
|
_asyncStorageStoryId;
|
|
2014
2014
|
_webUrl;
|
|
2015
|
+
_storage;
|
|
2015
2016
|
_channel;
|
|
2016
2017
|
constructor(preview, channel) {
|
|
2017
2018
|
this._preview = preview;
|
|
@@ -2034,8 +2035,8 @@ var View10 = class {
|
|
|
2034
2035
|
if (shouldPersistSelection) {
|
|
2035
2036
|
try {
|
|
2036
2037
|
let value = this._asyncStorageStoryId;
|
|
2037
|
-
if (!value) {
|
|
2038
|
-
value = await
|
|
2038
|
+
if (!value && this._storage != null) {
|
|
2039
|
+
value = await this._storage.getItem(STORAGE_KEY);
|
|
2039
2040
|
this._asyncStorageStoryId = value;
|
|
2040
2041
|
}
|
|
2041
2042
|
const exists = value && Object.keys(this._storyIndex.entries).includes(value);
|
|
@@ -2062,7 +2063,13 @@ var View10 = class {
|
|
|
2062
2063
|
});
|
|
2063
2064
|
};
|
|
2064
2065
|
getStorybookUI = (params = {}) => {
|
|
2065
|
-
const {
|
|
2066
|
+
const {
|
|
2067
|
+
shouldPersistSelection = true,
|
|
2068
|
+
onDeviceUI = true,
|
|
2069
|
+
enableWebsockets = false,
|
|
2070
|
+
storage
|
|
2071
|
+
} = params;
|
|
2072
|
+
this._storage = storage;
|
|
2066
2073
|
const initialStory = this._getInitialStory(params);
|
|
2067
2074
|
if (enableWebsockets) {
|
|
2068
2075
|
console.log("websockets enabled");
|
|
@@ -2103,8 +2110,18 @@ var View10 = class {
|
|
|
2103
2110
|
(0, import_react16.useEffect)(() => {
|
|
2104
2111
|
self._setStory = (newStory) => {
|
|
2105
2112
|
setContext(newStory);
|
|
2106
|
-
if (shouldPersistSelection) {
|
|
2107
|
-
|
|
2113
|
+
if (shouldPersistSelection && !storage) {
|
|
2114
|
+
console.warn(import_dedent.default`Please set storage in getStorybookUI like this:
|
|
2115
|
+
const StorybookUIRoot = view.getStorybookUI({
|
|
2116
|
+
storage: {
|
|
2117
|
+
getItem: AsyncStorage.getItem,
|
|
2118
|
+
setItem: AsyncStorage.setItem,
|
|
2119
|
+
},
|
|
2120
|
+
});
|
|
2121
|
+
`);
|
|
2122
|
+
}
|
|
2123
|
+
if (shouldPersistSelection && !!this._storage) {
|
|
2124
|
+
this._storage.setItem(STORAGE_KEY, newStory.id).catch((e) => {
|
|
2108
2125
|
console.warn("storybook-log: error writing to async storage", e);
|
|
2109
2126
|
});
|
|
2110
2127
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { StoryContext } from '@storybook/csf';
|
|
3
3
|
import { PreviewWithSelection } from '@storybook/preview-web';
|
|
4
|
+
import { ReactRenderer } from '@storybook/react';
|
|
4
5
|
import { Theme } from '@storybook/react-native-theming';
|
|
5
6
|
import { S as StoryIndex } from './index.d-cff8c6fa.js';
|
|
6
|
-
import { ReactRenderer } from '@storybook/react';
|
|
7
7
|
import { Channel } from '@storybook/channels';
|
|
8
8
|
|
|
9
|
+
interface Storage {
|
|
10
|
+
getItem: (key: string) => Promise<string | null>;
|
|
11
|
+
setItem: (key: string, value: string) => Promise<void>;
|
|
12
|
+
}
|
|
9
13
|
type StoryKind = string;
|
|
10
14
|
type StoryName = string;
|
|
11
15
|
type InitialSelection = `${StoryKind}--${StoryName}` | {
|
|
@@ -36,6 +40,7 @@ type Params = {
|
|
|
36
40
|
shouldDisableKeyboardAvoidingView?: boolean;
|
|
37
41
|
keyboardAvoidingViewVerticalOffset?: number;
|
|
38
42
|
theme: DeepPartial<Theme>;
|
|
43
|
+
storage?: Storage;
|
|
39
44
|
};
|
|
40
45
|
declare class View {
|
|
41
46
|
_storyIndex: StoryIndex;
|
|
@@ -45,6 +50,7 @@ declare class View {
|
|
|
45
50
|
_preview: PreviewWithSelection<ReactRenderer>;
|
|
46
51
|
_asyncStorageStoryId: string;
|
|
47
52
|
_webUrl: string;
|
|
53
|
+
_storage: Storage;
|
|
48
54
|
_channel: Channel;
|
|
49
55
|
constructor(preview: PreviewWithSelection<ReactRenderer>, channel: Channel);
|
|
50
56
|
_getInitialStory: ({ initialSelection, shouldPersistSelection, }?: Partial<Params>) => Promise<{
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Theme, darkTheme, theme } from '@storybook/react-native-theming';
|
|
2
|
-
import { V as View } from './View-
|
|
2
|
+
import { V as View } from './View-3a0f8584.js';
|
|
3
3
|
import { N as NormalizedStoriesSpecifier } from './index.d-cff8c6fa.js';
|
|
4
4
|
import 'react/jsx-runtime';
|
|
5
5
|
import '@storybook/csf';
|
package/dist/index.js
CHANGED
|
@@ -73,14 +73,21 @@ var import_preview_web = require("@storybook/preview-api/dist/preview-web");
|
|
|
73
73
|
var import_channels2 = require("@storybook/channels");
|
|
74
74
|
|
|
75
75
|
// src/View.tsx
|
|
76
|
-
var import_async_storage = __toESM(require("@react-native-async-storage/async-storage"));
|
|
77
76
|
var import_csf = require("@storybook/csf");
|
|
78
|
-
var import_preview_api2 = require("@storybook/preview-api");
|
|
79
77
|
var import_manager_api2 = require("@storybook/manager-api");
|
|
78
|
+
var import_preview_api2 = require("@storybook/preview-api");
|
|
80
79
|
var import_react_native_theming12 = require("@storybook/react-native-theming");
|
|
81
80
|
var import_react16 = require("react");
|
|
82
81
|
var import_react_native_safe_area_context3 = require("react-native-safe-area-context");
|
|
83
82
|
|
|
83
|
+
// src/components/OnDeviceUI/OnDeviceUI.tsx
|
|
84
|
+
var import_react_native_theming10 = require("@storybook/react-native-theming");
|
|
85
|
+
var import_react15 = __toESM(require("react"));
|
|
86
|
+
var import_react_native14 = require("react-native");
|
|
87
|
+
|
|
88
|
+
// src/constants.ts
|
|
89
|
+
var ANIMATION_DURATION_TRANSITION = 400;
|
|
90
|
+
|
|
84
91
|
// src/hooks.tsx
|
|
85
92
|
var import_react2 = __toESM(require("react"));
|
|
86
93
|
|
|
@@ -834,14 +841,6 @@ function useSelectedAddon(initialValue) {
|
|
|
834
841
|
return result;
|
|
835
842
|
}
|
|
836
843
|
|
|
837
|
-
// src/components/OnDeviceUI/OnDeviceUI.tsx
|
|
838
|
-
var import_react_native_theming10 = require("@storybook/react-native-theming");
|
|
839
|
-
var import_react15 = __toESM(require("react"));
|
|
840
|
-
var import_react_native14 = require("react-native");
|
|
841
|
-
|
|
842
|
-
// src/constants.ts
|
|
843
|
-
var ANIMATION_DURATION_TRANSITION = 400;
|
|
844
|
-
|
|
845
844
|
// src/components/StoryListView/StoryListView.tsx
|
|
846
845
|
var import_core_events = __toESM(require("@storybook/core-events"));
|
|
847
846
|
var import_react_native_theming = require("@storybook/react-native-theming");
|
|
@@ -1945,6 +1944,7 @@ var OnDeviceUI_default = import_react15.default.memo(OnDeviceUI);
|
|
|
1945
1944
|
// src/View.tsx
|
|
1946
1945
|
var import_channels = require("@storybook/channels");
|
|
1947
1946
|
var import_core_events2 = __toESM(require("@storybook/core-events"));
|
|
1947
|
+
var import_dedent = __toESM(require("dedent"));
|
|
1948
1948
|
var import_deepmerge = __toESM(require("deepmerge"));
|
|
1949
1949
|
var import_react_native16 = require("react-native");
|
|
1950
1950
|
|
|
@@ -2005,6 +2005,7 @@ var View10 = class {
|
|
|
2005
2005
|
_preview;
|
|
2006
2006
|
_asyncStorageStoryId;
|
|
2007
2007
|
_webUrl;
|
|
2008
|
+
_storage;
|
|
2008
2009
|
_channel;
|
|
2009
2010
|
constructor(preview, channel) {
|
|
2010
2011
|
this._preview = preview;
|
|
@@ -2027,8 +2028,8 @@ var View10 = class {
|
|
|
2027
2028
|
if (shouldPersistSelection) {
|
|
2028
2029
|
try {
|
|
2029
2030
|
let value = this._asyncStorageStoryId;
|
|
2030
|
-
if (!value) {
|
|
2031
|
-
value = await
|
|
2031
|
+
if (!value && this._storage != null) {
|
|
2032
|
+
value = await this._storage.getItem(STORAGE_KEY);
|
|
2032
2033
|
this._asyncStorageStoryId = value;
|
|
2033
2034
|
}
|
|
2034
2035
|
const exists = value && Object.keys(this._storyIndex.entries).includes(value);
|
|
@@ -2055,7 +2056,13 @@ var View10 = class {
|
|
|
2055
2056
|
});
|
|
2056
2057
|
};
|
|
2057
2058
|
getStorybookUI = (params = {}) => {
|
|
2058
|
-
const {
|
|
2059
|
+
const {
|
|
2060
|
+
shouldPersistSelection = true,
|
|
2061
|
+
onDeviceUI = true,
|
|
2062
|
+
enableWebsockets = false,
|
|
2063
|
+
storage
|
|
2064
|
+
} = params;
|
|
2065
|
+
this._storage = storage;
|
|
2059
2066
|
const initialStory = this._getInitialStory(params);
|
|
2060
2067
|
if (enableWebsockets) {
|
|
2061
2068
|
console.log("websockets enabled");
|
|
@@ -2096,8 +2103,18 @@ var View10 = class {
|
|
|
2096
2103
|
(0, import_react16.useEffect)(() => {
|
|
2097
2104
|
self._setStory = (newStory) => {
|
|
2098
2105
|
setContext(newStory);
|
|
2099
|
-
if (shouldPersistSelection) {
|
|
2100
|
-
|
|
2106
|
+
if (shouldPersistSelection && !storage) {
|
|
2107
|
+
console.warn(import_dedent.default`Please set storage in getStorybookUI like this:
|
|
2108
|
+
const StorybookUIRoot = view.getStorybookUI({
|
|
2109
|
+
storage: {
|
|
2110
|
+
getItem: AsyncStorage.getItem,
|
|
2111
|
+
setItem: AsyncStorage.setItem,
|
|
2112
|
+
},
|
|
2113
|
+
});
|
|
2114
|
+
`);
|
|
2115
|
+
}
|
|
2116
|
+
if (shouldPersistSelection && !!this._storage) {
|
|
2117
|
+
this._storage.setItem(STORAGE_KEY, newStory.id).catch((e) => {
|
|
2101
2118
|
console.warn("storybook-log: error writing to async storage", e);
|
|
2102
2119
|
});
|
|
2103
2120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "7.6.10-alpha.
|
|
3
|
+
"version": "7.6.10-alpha.1",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -64,9 +64,10 @@
|
|
|
64
64
|
"@storybook/preview-api": "^7.6.10",
|
|
65
65
|
"@storybook/preview-web": "^7.6.10",
|
|
66
66
|
"@storybook/react": "^7.6.10",
|
|
67
|
-
"@storybook/react-native-theming": "^7.6.10-alpha.
|
|
67
|
+
"@storybook/react-native-theming": "^7.6.10-alpha.1",
|
|
68
68
|
"chokidar": "^3.5.1",
|
|
69
69
|
"commander": "^8.2.0",
|
|
70
|
+
"dedent": "^1.5.1",
|
|
70
71
|
"deepmerge": "^4.3.0",
|
|
71
72
|
"glob": "^7.1.7",
|
|
72
73
|
"prettier": "^2.4.1",
|
|
@@ -87,7 +88,6 @@
|
|
|
87
88
|
"typescript": "^5.3.3"
|
|
88
89
|
},
|
|
89
90
|
"peerDependencies": {
|
|
90
|
-
"@react-native-async-storage/async-storage": ">=1",
|
|
91
91
|
"react": "*",
|
|
92
92
|
"react-native": ">=0.57.0",
|
|
93
93
|
"react-native-safe-area-context": "*"
|
|
@@ -98,5 +98,5 @@
|
|
|
98
98
|
"publishConfig": {
|
|
99
99
|
"access": "public"
|
|
100
100
|
},
|
|
101
|
-
"gitHead": "
|
|
101
|
+
"gitHead": "8b2e96767cc361ae5382c5ba0ba9d6ea6112634f"
|
|
102
102
|
}
|
package/readme.md
CHANGED
|
@@ -256,6 +256,11 @@ You can pass these parameters to getStorybookUI call in your storybook entry poi
|
|
|
256
256
|
-- Disable KeyboardAvoidingView wrapping Storybook's view
|
|
257
257
|
keyboardAvoidingViewVerticalOffset: Number (0)
|
|
258
258
|
-- With shouldDisableKeyboardAvoidingView=true, this will set the keyboardverticaloffset (https://facebook.github.io/react-native/docs/keyboardavoidingview#keyboardverticaloffset) value for KeyboardAvoidingView wrapping Storybook's view
|
|
259
|
+
storage: Object (undefined)
|
|
260
|
+
-- {getItem: (key: string) => Promise<string | null>;setItem: (key: string, value: string) => Promise<void>;}
|
|
261
|
+
-- Custom storage to be used instead of AsyncStorage
|
|
262
|
+
shouldPersistSelection: Boolean (true)
|
|
263
|
+
-- Stores last selected story in your devices storage.
|
|
259
264
|
}
|
|
260
265
|
```
|
|
261
266
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const FakeComponentExcluded = () => null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
2
|
+
import { view } from './storybook.requires';
|
|
3
|
+
|
|
4
|
+
import './storybook.requires';
|
|
5
|
+
|
|
6
|
+
const StorybookUIRoot = view.getStorybookUI({
|
|
7
|
+
storage: {
|
|
8
|
+
getItem: AsyncStorage.getItem,
|
|
9
|
+
setItem: AsyncStorage.setItem,
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default StorybookUIRoot;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { View } from 'react-native';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import { MyButton } from './Button';
|
|
4
4
|
|
|
5
|
-
const MyButtonMeta = {
|
|
5
|
+
const MyButtonMeta: Meta<typeof MyButton> = {
|
|
6
6
|
title: 'MyButton',
|
|
7
7
|
component: MyButton,
|
|
8
8
|
argTypes: {
|
|
@@ -22,9 +22,9 @@ const MyButtonMeta = {
|
|
|
22
22
|
|
|
23
23
|
export default MyButtonMeta;
|
|
24
24
|
|
|
25
|
-
export const Basic = {};
|
|
25
|
+
export const Basic: StoryObj<typeof MyButton> = {};
|
|
26
26
|
|
|
27
|
-
export const AnotherExample = {
|
|
27
|
+
export const AnotherExample: StoryObj<typeof MyButton> = {
|
|
28
28
|
args: {
|
|
29
29
|
text: 'Another example',
|
|
30
30
|
},
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { TouchableOpacity, Text, StyleSheet } from 'react-native';
|
|
3
2
|
|
|
4
|
-
export
|
|
3
|
+
export type MyButtonProps = {
|
|
4
|
+
onPress: () => void;
|
|
5
|
+
text: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const MyButton = ({ onPress, text }: MyButtonProps) => {
|
|
5
9
|
return (
|
|
6
10
|
<TouchableOpacity style={styles.container} onPress={onPress} activeOpacity={0.8}>
|
|
7
11
|
<Text style={styles.text}>{text}</Text>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* do not change this file, it is auto generated by storybook. */
|
|
2
|
+
|
|
3
|
+
import { start } 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: './stories',
|
|
12
|
+
files: '**/*.stories.?(ts|tsx|js|jsx)',
|
|
13
|
+
importPathMatcher:
|
|
14
|
+
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
req: require.context(
|
|
17
|
+
'./stories',
|
|
18
|
+
true,
|
|
19
|
+
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/
|
|
20
|
+
),
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
global.STORIES = normalizedStories;
|
|
26
|
+
|
|
27
|
+
export const view = start({
|
|
28
|
+
annotations: [
|
|
29
|
+
require('./preview'),
|
|
30
|
+
require('@storybook/react-native/dist/preview'),
|
|
31
|
+
require('@storybook/addon-actions/preview'),
|
|
32
|
+
],
|
|
33
|
+
storyEntries: normalizedStories,
|
|
34
|
+
});
|
package/template/cli/index.js
DELETED
package/template/cli/preview.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/* do not change this file, it is auto generated by storybook. */
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
configure,
|
|
5
|
-
addDecorator,
|
|
6
|
-
addParameters,
|
|
7
|
-
addArgsEnhancer,
|
|
8
|
-
clearDecorators,
|
|
9
|
-
} from '@storybook/react-native';
|
|
10
|
-
|
|
11
|
-
global.STORIES = [
|
|
12
|
-
{
|
|
13
|
-
titlePrefix: '',
|
|
14
|
-
directory: './.storybook/stories',
|
|
15
|
-
files: '**/*.stories.?(ts|tsx|js|jsx)',
|
|
16
|
-
importPathMatcher:
|
|
17
|
-
'^\\.[\\\\/](?:\\.storybook\\/stories(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(?:ts|tsx|js|jsx)?)$',
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
import '@storybook/addon-ondevice-controls/register';
|
|
22
|
-
import '@storybook/addon-ondevice-actions/register';
|
|
23
|
-
|
|
24
|
-
import { argsEnhancers } from '@storybook/addon-actions/dist/modern/preset/addArgs';
|
|
25
|
-
|
|
26
|
-
import { decorators, parameters } from './preview';
|
|
27
|
-
|
|
28
|
-
if (decorators) {
|
|
29
|
-
if (__DEV__) {
|
|
30
|
-
// stops the warning from showing on every HMR
|
|
31
|
-
require('react-native').LogBox.ignoreLogs([
|
|
32
|
-
'`clearDecorators` is deprecated and will be removed in Storybook 7.0',
|
|
33
|
-
]);
|
|
34
|
-
}
|
|
35
|
-
// workaround for global decorators getting infinitely applied on HMR, see https://github.com/storybookjs/react-native/issues/185
|
|
36
|
-
clearDecorators();
|
|
37
|
-
decorators.forEach((decorator) => addDecorator(decorator));
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (parameters) {
|
|
41
|
-
addParameters(parameters);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
try {
|
|
45
|
-
argsEnhancers.forEach((enhancer) => addArgsEnhancer(enhancer));
|
|
46
|
-
} catch {}
|
|
47
|
-
|
|
48
|
-
const getStories = () => {
|
|
49
|
-
return {
|
|
50
|
-
'./.storybook/stories/Button/Button.stories.js': require('./stories/Button/Button.stories.js'),
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
configure(getStories, module, false);
|