@storybook/react-native 6.5.0-rc.1 → 6.5.0-rc.2
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/index.d.ts +1 -1
- package/dist/preview/View.d.ts +4 -4
- package/dist/preview/components/OnDeviceUI/OnDeviceUI.js +53 -37
- package/dist/preview/components/OnDeviceUI/absolute-positioned-keyboard-aware-view.d.ts +1 -1
- package/dist/preview/components/OnDeviceUI/animation.d.ts +34 -11
- package/dist/preview/components/OnDeviceUI/animation.js +49 -18
- package/dist/preview/components/OnDeviceUI/navigation/Navigation.d.ts +3 -1
- package/dist/preview/components/OnDeviceUI/navigation/Navigation.js +2 -2
- package/dist/preview/components/StoryListView/StoryListView.js +12 -28
- package/dist/types/types-6.0.d.ts +10 -10
- package/dist/types/types.d.ts +3 -3
- package/package.json +5 -6
- package/scripts/__snapshots__/loader.test.js.snap +35 -35
package/dist/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { ReactNode } from 'react';
|
|
|
6
6
|
import type { ReactNativeFramework } from './types/types-6.0';
|
|
7
7
|
declare const configure: (loadable: import("@storybook/core-client").Loadable, m: NodeModule) => void;
|
|
8
8
|
export { configure };
|
|
9
|
-
|
|
9
|
+
type C = ClientApi<ReactNativeFramework>;
|
|
10
10
|
export declare const setAddon: C['setAddon'];
|
|
11
11
|
export declare const addDecorator: C['addDecorator'];
|
|
12
12
|
export declare const addParameters: C['addParameters'];
|
package/dist/preview/View.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { StoryContext } from '@storybook/csf';
|
|
|
4
4
|
import { theme } from './components/Shared/theme';
|
|
5
5
|
import type { ReactNativeFramework } from '../types/types-6.0';
|
|
6
6
|
import { PreviewWeb } from '@storybook/preview-web';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
type StoryKind = string;
|
|
8
|
+
type StoryName = string;
|
|
9
|
+
type InitialSelection = `${StoryKind}--${StoryName}` | {
|
|
10
10
|
/**
|
|
11
11
|
* Kind is the default export name or the storiesOf("name") name
|
|
12
12
|
*/
|
|
@@ -16,7 +16,7 @@ declare type InitialSelection = `${StoryKind}--${StoryName}` | {
|
|
|
16
16
|
*/
|
|
17
17
|
name: StoryName;
|
|
18
18
|
};
|
|
19
|
-
export
|
|
19
|
+
export type Params = {
|
|
20
20
|
onDeviceUI?: boolean;
|
|
21
21
|
enableWebsockets?: boolean;
|
|
22
22
|
query?: string;
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import styled from '@emotion/native';
|
|
2
|
+
import { useTheme } from 'emotion-theming';
|
|
2
3
|
import React, { useState, useRef } from 'react';
|
|
3
|
-
import { Animated, Dimensions, Keyboard, KeyboardAvoidingView, Platform,
|
|
4
|
+
import { Animated, Dimensions, Easing, Keyboard, KeyboardAvoidingView, Platform, TouchableOpacity, StatusBar, StyleSheet, View, } from 'react-native';
|
|
4
5
|
import { useStoryContextParam } from '../../../hooks';
|
|
5
6
|
import StoryListView from '../StoryListView';
|
|
6
7
|
import StoryView from '../StoryView';
|
|
7
8
|
import AbsolutePositionedKeyboardAwareView from './absolute-positioned-keyboard-aware-view';
|
|
8
9
|
import Addons from './addons/Addons';
|
|
9
|
-
import { getAddonPanelPosition, getNavigatorPanelPosition,
|
|
10
|
+
import { getAddonPanelPosition, getNavigatorPanelPosition, getPreviewShadowStyle, getPreviewStyle, } from './animation';
|
|
10
11
|
import Navigation from './navigation';
|
|
11
12
|
import { PREVIEW, ADDONS } from './navigation/constants';
|
|
12
13
|
import Panel from './Panel';
|
|
13
14
|
import { useWindowDimensions } from 'react-native';
|
|
14
15
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
15
|
-
const ANIMATION_DURATION =
|
|
16
|
+
const ANIMATION_DURATION = 400;
|
|
16
17
|
const IS_IOS = Platform.OS === 'ios';
|
|
17
18
|
// @ts-ignore: Property 'Expo' does not exist on type 'Global'
|
|
18
19
|
const getExpoRoot = () => global.Expo || global.__expo || global.__exponent;
|
|
@@ -20,28 +21,22 @@ export const IS_EXPO = getExpoRoot() !== undefined;
|
|
|
20
21
|
const IS_ANDROID = Platform.OS === 'android';
|
|
21
22
|
const BREAKPOINT = 1024;
|
|
22
23
|
const flex = { flex: 1 };
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
const absolutePosition = {
|
|
33
|
-
position: 'absolute',
|
|
34
|
-
top: 0,
|
|
35
|
-
bottom: 0,
|
|
36
|
-
left: 0,
|
|
37
|
-
right: 0,
|
|
38
|
-
};
|
|
24
|
+
/**
|
|
25
|
+
* Story preview container.
|
|
26
|
+
*/
|
|
27
|
+
function Preview({ animatedValue, style, children }) {
|
|
28
|
+
const theme = useTheme();
|
|
29
|
+
const containerStyle = Object.assign({ backgroundColor: theme.backgroundColor }, getPreviewShadowStyle(animatedValue));
|
|
30
|
+
return (React.createElement(Animated.View, { style: [flex, containerStyle] },
|
|
31
|
+
React.createElement(View, { style: [flex, style] }, children)));
|
|
32
|
+
}
|
|
39
33
|
const styles = StyleSheet.create({
|
|
40
34
|
expoAndroidContainer: { paddingTop: StatusBar.currentHeight },
|
|
41
35
|
});
|
|
36
|
+
const Container = styled.View(({ theme }) => (Object.assign({ flex: 1, backgroundColor: theme.backgroundColor }, (IS_ANDROID && IS_EXPO ? styles.expoAndroidContainer : undefined))));
|
|
42
37
|
const OnDeviceUI = ({ storyIndex, isUIHidden, shouldDisableKeyboardAvoidingView, keyboardAvoidingViewVerticalOffset, tabOpen: initialTabOpen, }) => {
|
|
43
38
|
const [tabOpen, setTabOpen] = useState(initialTabOpen || PREVIEW);
|
|
44
|
-
const
|
|
39
|
+
const lastTabOpen = React.useRef(tabOpen);
|
|
45
40
|
const [previewDimensions, setPreviewDimensions] = useState(() => ({
|
|
46
41
|
width: Dimensions.get('window').width,
|
|
47
42
|
height: Dimensions.get('window').height,
|
|
@@ -49,19 +44,20 @@ const OnDeviceUI = ({ storyIndex, isUIHidden, shouldDisableKeyboardAvoidingView,
|
|
|
49
44
|
const animatedValue = useRef(new Animated.Value(tabOpen));
|
|
50
45
|
const wide = useWindowDimensions().width >= BREAKPOINT;
|
|
51
46
|
const insets = useSafeAreaInsets();
|
|
47
|
+
const theme = useTheme();
|
|
52
48
|
const [isUIVisible, setIsUIVisible] = useState(isUIHidden !== undefined ? !isUIHidden : true);
|
|
53
49
|
const handleToggleTab = React.useCallback((newTabOpen) => {
|
|
54
50
|
if (newTabOpen === tabOpen) {
|
|
55
51
|
return;
|
|
56
52
|
}
|
|
53
|
+
lastTabOpen.current = tabOpen;
|
|
57
54
|
Animated.timing(animatedValue.current, {
|
|
58
55
|
toValue: newTabOpen,
|
|
59
56
|
duration: ANIMATION_DURATION,
|
|
57
|
+
easing: Easing.inOut(Easing.cubic),
|
|
60
58
|
useNativeDriver: true,
|
|
61
59
|
}).start();
|
|
62
60
|
setTabOpen(newTabOpen);
|
|
63
|
-
const isSwipingBetweenNavigatorAndAddons = tabOpen + newTabOpen === PREVIEW;
|
|
64
|
-
setSlideBetweenAnimation(isSwipingBetweenNavigatorAndAddons);
|
|
65
61
|
// close the keyboard opened from a TextInput from story list or knobs
|
|
66
62
|
if (newTabOpen === PREVIEW) {
|
|
67
63
|
Keyboard.dismiss();
|
|
@@ -70,35 +66,55 @@ const OnDeviceUI = ({ storyIndex, isUIHidden, shouldDisableKeyboardAvoidingView,
|
|
|
70
66
|
const noSafeArea = useStoryContextParam('noSafeArea', false);
|
|
71
67
|
const previewWrapperStyles = [
|
|
72
68
|
flex,
|
|
73
|
-
|
|
69
|
+
getPreviewStyle({
|
|
74
70
|
animatedValue: animatedValue.current,
|
|
75
71
|
previewDimensions,
|
|
76
|
-
slideBetweenAnimation,
|
|
77
72
|
wide,
|
|
78
|
-
noSafeArea,
|
|
79
73
|
insets,
|
|
74
|
+
tabOpen,
|
|
75
|
+
lastTabOpen: lastTabOpen.current,
|
|
80
76
|
}),
|
|
81
77
|
];
|
|
82
|
-
|
|
83
|
-
const
|
|
84
|
-
const
|
|
78
|
+
// The initial value is just a guess until the layout calculation has been done.
|
|
79
|
+
const [navBarHeight, setNavBarHeight] = React.useState(insets.bottom + 40);
|
|
80
|
+
const measureNavigation = React.useCallback(({ nativeEvent }) => {
|
|
81
|
+
const inset = insets.bottom;
|
|
82
|
+
setNavBarHeight(isUIVisible ? nativeEvent.layout.height - inset : 0);
|
|
83
|
+
}, [isUIVisible, insets]);
|
|
84
|
+
// There are 4 cases for the additional UI margin:
|
|
85
|
+
// 1. Storybook UI is visible, and `noSafeArea` is false: Include top and
|
|
86
|
+
// bottom safe area insets, and also include the navigation bar height.
|
|
87
|
+
//
|
|
88
|
+
// 2. Storybook UI is not visible, and `noSafeArea` is false: Include top
|
|
89
|
+
// and bottom safe area insets.
|
|
90
|
+
//
|
|
91
|
+
// 3. Storybook UI is visible, and `noSafeArea` is true: Include only the
|
|
92
|
+
// bottom safe area inset and the navigation bar height.
|
|
93
|
+
//
|
|
94
|
+
// 4. Storybook UI is not visible, and `noSafeArea` is true: No margin.
|
|
95
|
+
const safeAreaMargins = {
|
|
96
|
+
paddingBottom: isUIVisible ? insets.bottom + navBarHeight : noSafeArea ? 0 : insets.bottom,
|
|
97
|
+
paddingTop: !noSafeArea ? insets.top : 0,
|
|
98
|
+
};
|
|
85
99
|
return (React.createElement(React.Fragment, null,
|
|
86
|
-
React.createElement(
|
|
100
|
+
React.createElement(Container, null,
|
|
87
101
|
React.createElement(KeyboardAvoidingView, { enabled: !shouldDisableKeyboardAvoidingView || tabOpen !== PREVIEW, behavior: IS_IOS ? 'padding' : null, keyboardVerticalOffset: keyboardAvoidingViewVerticalOffset, style: flex },
|
|
88
102
|
React.createElement(AbsolutePositionedKeyboardAwareView, { onLayout: setPreviewDimensions, previewDimensions: previewDimensions },
|
|
89
103
|
React.createElement(Animated.View, { style: previewWrapperStyles },
|
|
90
|
-
React.createElement(
|
|
91
|
-
React.createElement(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
104
|
+
React.createElement(Preview, { style: safeAreaMargins, animatedValue: animatedValue.current },
|
|
105
|
+
React.createElement(StoryView, null)),
|
|
106
|
+
tabOpen !== PREVIEW ? (React.createElement(TouchableOpacity, { style: StyleSheet.absoluteFillObject, onPress: () => handleToggleTab(PREVIEW) })) : null),
|
|
107
|
+
React.createElement(Panel, { style: [
|
|
108
|
+
getNavigatorPanelPosition(animatedValue.current, previewDimensions.width, wide),
|
|
109
|
+
safeAreaMargins,
|
|
110
|
+
{ backgroundColor: theme.storyListBackgroundColor },
|
|
111
|
+
] },
|
|
96
112
|
React.createElement(StoryListView, { storyIndex: storyIndex })),
|
|
97
113
|
React.createElement(Panel, { style: [
|
|
98
114
|
getAddonPanelPosition(animatedValue.current, previewDimensions.width, wide),
|
|
99
|
-
|
|
115
|
+
safeAreaMargins,
|
|
100
116
|
] },
|
|
101
117
|
React.createElement(Addons, { active: tabOpen === ADDONS })))),
|
|
102
|
-
React.createElement(Navigation, { tabOpen: tabOpen, onChangeTab: handleToggleTab, isUIVisible: isUIVisible, setIsUIVisible: setIsUIVisible }))));
|
|
118
|
+
React.createElement(Navigation, { onLayout: measureNavigation, tabOpen: tabOpen, onChangeTab: handleToggleTab, isUIVisible: isUIVisible, setIsUIVisible: setIsUIVisible }))));
|
|
103
119
|
};
|
|
104
120
|
export default React.memo(OnDeviceUI);
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Animated } from 'react-native';
|
|
2
|
-
import { EdgeInsets } from 'react-native-safe-area-context';
|
|
1
|
+
import { Animated, Insets } from 'react-native';
|
|
3
2
|
import { PreviewDimens } from './absolute-positioned-keyboard-aware-view';
|
|
4
3
|
export declare const getNavigatorPanelPosition: (animatedValue: Animated.Value, previewWidth: number, wide: boolean) => {
|
|
5
4
|
transform: {
|
|
@@ -13,26 +12,50 @@ export declare const getAddonPanelPosition: (animatedValue: Animated.Value, prev
|
|
|
13
12
|
}[];
|
|
14
13
|
width: number;
|
|
15
14
|
}[];
|
|
16
|
-
|
|
15
|
+
type PreviewPositionArgs = {
|
|
17
16
|
animatedValue: Animated.Value;
|
|
18
17
|
previewDimensions: PreviewDimens;
|
|
19
|
-
slideBetweenAnimation: boolean;
|
|
20
18
|
wide: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
insets: Insets;
|
|
20
|
+
tabOpen: number;
|
|
21
|
+
lastTabOpen: number;
|
|
23
22
|
};
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Build the animated style for the preview container view.
|
|
25
|
+
*
|
|
26
|
+
* When the navigator or addons panel is focused, the preview container is
|
|
27
|
+
* scaled down and translated to the left (or right) of the panel.
|
|
28
|
+
*/
|
|
29
|
+
export declare const getPreviewStyle: ({ animatedValue, previewDimensions: { width: previewWidth, height: previewHeight }, wide, insets, tabOpen, lastTabOpen, }: PreviewPositionArgs) => {
|
|
25
30
|
transform: ({
|
|
26
31
|
translateX: Animated.AnimatedInterpolation<string | number>;
|
|
27
32
|
translateY?: undefined;
|
|
33
|
+
scale?: undefined;
|
|
28
34
|
} | {
|
|
29
35
|
translateY: Animated.AnimatedInterpolation<string | number>;
|
|
30
36
|
translateX?: undefined;
|
|
37
|
+
scale?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
scale: Animated.AnimatedInterpolation<string | number>;
|
|
40
|
+
translateX?: undefined;
|
|
41
|
+
translateY?: undefined;
|
|
31
42
|
})[];
|
|
32
43
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
44
|
+
/**
|
|
45
|
+
* Build the animated shadow style for the preview.
|
|
46
|
+
*
|
|
47
|
+
* When the navigator or addons panel are visible the scaled preview will have
|
|
48
|
+
* a shadow, and when going to the preview tab the shadow will be invisible.
|
|
49
|
+
*/
|
|
50
|
+
export declare const getPreviewShadowStyle: (animatedValue: Animated.Value) => {
|
|
51
|
+
elevation: number;
|
|
52
|
+
shadowColor: string;
|
|
53
|
+
shadowOpacity: Animated.AnimatedInterpolation<string | number>;
|
|
54
|
+
shadowRadius: number;
|
|
55
|
+
shadowOffset: {
|
|
56
|
+
width: number;
|
|
57
|
+
height: number;
|
|
58
|
+
};
|
|
59
|
+
overflow: "visible";
|
|
37
60
|
};
|
|
38
61
|
export {};
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { I18nManager } from 'react-native';
|
|
2
2
|
import { NAVIGATOR, PREVIEW, ADDONS } from './navigation/constants';
|
|
3
|
+
// Factor that will flip the animation orientation in RTL locales.
|
|
3
4
|
const RTL_SCALE = I18nManager.isRTL ? -1 : 1;
|
|
5
|
+
// Percentage to scale the preview area by when opening a panel.
|
|
4
6
|
const PREVIEW_SCALE = 0.3;
|
|
5
|
-
|
|
7
|
+
// Percentage to scale the preview area by when opening a panel, on wide screens.
|
|
8
|
+
const PREVIEW_SCALE_WIDE = 0.7;
|
|
9
|
+
// Percentage to shrink the visible preview by, without affecting the panel size.
|
|
10
|
+
const PREVIEW_SCALE_SHRINK = 0.9;
|
|
6
11
|
const SCALE_OFFSET = 0.025;
|
|
7
|
-
const TRANSLATE_X_OFFSET = 6;
|
|
8
12
|
const TRANSLATE_Y_OFFSET = 12;
|
|
9
13
|
const panelWidth = (width, wide) => {
|
|
10
|
-
const scale = wide ?
|
|
14
|
+
const scale = wide ? PREVIEW_SCALE_WIDE : PREVIEW_SCALE;
|
|
11
15
|
return width * (1 - scale - SCALE_OFFSET);
|
|
12
16
|
};
|
|
13
17
|
export const getNavigatorPanelPosition = (animatedValue, previewWidth, wide) => {
|
|
@@ -32,7 +36,10 @@ export const getAddonPanelPosition = (animatedValue, previewWidth, wide) => {
|
|
|
32
36
|
{
|
|
33
37
|
translateX: animatedValue.interpolate({
|
|
34
38
|
inputRange: [PREVIEW, ADDONS],
|
|
35
|
-
outputRange: [
|
|
39
|
+
outputRange: [
|
|
40
|
+
previewWidth * RTL_SCALE,
|
|
41
|
+
(previewWidth - panelWidth(previewWidth, wide)) * RTL_SCALE,
|
|
42
|
+
],
|
|
36
43
|
}),
|
|
37
44
|
},
|
|
38
45
|
],
|
|
@@ -40,11 +47,25 @@ export const getAddonPanelPosition = (animatedValue, previewWidth, wide) => {
|
|
|
40
47
|
},
|
|
41
48
|
];
|
|
42
49
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Build the animated style for the preview container view.
|
|
52
|
+
*
|
|
53
|
+
* When the navigator or addons panel is focused, the preview container is
|
|
54
|
+
* scaled down and translated to the left (or right) of the panel.
|
|
55
|
+
*/
|
|
56
|
+
export const getPreviewStyle = ({ animatedValue, previewDimensions: { width: previewWidth, height: previewHeight }, wide, insets, tabOpen, lastTabOpen, }) => {
|
|
57
|
+
const scale = (wide ? PREVIEW_SCALE_WIDE : PREVIEW_SCALE) * PREVIEW_SCALE_SHRINK;
|
|
58
|
+
const scaledPreviewWidth = previewWidth * scale;
|
|
59
|
+
const scaledPreviewHeight = previewHeight * scale;
|
|
60
|
+
// Horizontally center the scaled preview in the available space beside the panel.
|
|
61
|
+
const nonPanelWidth = previewWidth - panelWidth(previewWidth, wide);
|
|
62
|
+
const translateXOffset = (nonPanelWidth - scaledPreviewWidth) / 2;
|
|
63
|
+
const translateX = (previewWidth / 2 - (previewWidth * scale) / 2 - translateXOffset) * RTL_SCALE;
|
|
64
|
+
// Translate the preview to the top edge of the screen, move it down by the
|
|
65
|
+
// safe area inset, then by the preview Y offset.
|
|
66
|
+
const translateY = -(previewHeight / 2 - scaledPreviewHeight / 2) + insets.top + TRANSLATE_Y_OFFSET;
|
|
67
|
+
// Is navigation moving from one panel to another, skipping preview?
|
|
68
|
+
const skipPreview = lastTabOpen !== PREVIEW && tabOpen !== PREVIEW;
|
|
48
69
|
return {
|
|
49
70
|
transform: [
|
|
50
71
|
{
|
|
@@ -56,22 +77,32 @@ export const getPreviewPosition = ({ animatedValue, previewDimensions: { width:
|
|
|
56
77
|
{
|
|
57
78
|
translateY: animatedValue.interpolate({
|
|
58
79
|
inputRange: [NAVIGATOR, PREVIEW, ADDONS],
|
|
59
|
-
outputRange: [translateY,
|
|
80
|
+
outputRange: [translateY, skipPreview ? translateY : 0, translateY],
|
|
60
81
|
}),
|
|
61
82
|
},
|
|
62
|
-
],
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export const getPreviewScale = (animatedValue, slideBetweenAnimation, wide) => {
|
|
66
|
-
const scale = wide ? PREVIEW_WIDE_SCREEN : PREVIEW_SCALE;
|
|
67
|
-
return {
|
|
68
|
-
transform: [
|
|
69
83
|
{
|
|
70
84
|
scale: animatedValue.interpolate({
|
|
71
85
|
inputRange: [NAVIGATOR, PREVIEW, ADDONS],
|
|
72
|
-
outputRange: [scale,
|
|
86
|
+
outputRange: [scale, skipPreview ? scale : 1, scale],
|
|
73
87
|
}),
|
|
74
88
|
},
|
|
75
89
|
],
|
|
76
90
|
};
|
|
77
91
|
};
|
|
92
|
+
/**
|
|
93
|
+
* Build the animated shadow style for the preview.
|
|
94
|
+
*
|
|
95
|
+
* When the navigator or addons panel are visible the scaled preview will have
|
|
96
|
+
* a shadow, and when going to the preview tab the shadow will be invisible.
|
|
97
|
+
*/
|
|
98
|
+
export const getPreviewShadowStyle = (animatedValue) => ({
|
|
99
|
+
elevation: 8,
|
|
100
|
+
shadowColor: '#000',
|
|
101
|
+
shadowOpacity: animatedValue.interpolate({
|
|
102
|
+
inputRange: [NAVIGATOR, PREVIEW, ADDONS],
|
|
103
|
+
outputRange: [0.25, 0, 0.25],
|
|
104
|
+
}),
|
|
105
|
+
shadowRadius: 8,
|
|
106
|
+
shadowOffset: { width: 0, height: 0 },
|
|
107
|
+
overflow: 'visible',
|
|
108
|
+
});
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React, { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { ViewProps } from 'react-native';
|
|
2
3
|
interface Props {
|
|
3
4
|
tabOpen: number;
|
|
4
5
|
onChangeTab: (index: number) => void;
|
|
5
6
|
isUIVisible: boolean;
|
|
6
7
|
setIsUIVisible: Dispatch<SetStateAction<boolean>>;
|
|
8
|
+
onLayout: ViewProps['onLayout'];
|
|
7
9
|
}
|
|
8
|
-
declare const _default: React.MemoExoticComponent<({ tabOpen, onChangeTab, isUIVisible, setIsUIVisible }: Props) => JSX.Element>;
|
|
10
|
+
declare const _default: React.MemoExoticComponent<({ tabOpen, onChangeTab, isUIVisible, setIsUIVisible, onLayout }: Props) => JSX.Element>;
|
|
9
11
|
export default _default;
|
|
@@ -14,7 +14,7 @@ const navStyle = {
|
|
|
14
14
|
right: 0,
|
|
15
15
|
bottom: 0,
|
|
16
16
|
};
|
|
17
|
-
const Navigation = ({ tabOpen, onChangeTab, isUIVisible, setIsUIVisible }) => {
|
|
17
|
+
const Navigation = ({ tabOpen, onChangeTab, isUIVisible, setIsUIVisible, onLayout }) => {
|
|
18
18
|
const insets = useSafeAreaInsets();
|
|
19
19
|
const handleToggleUI = () => {
|
|
20
20
|
setIsUIVisible((oldIsUIVisible) => !oldIsUIVisible);
|
|
@@ -29,7 +29,7 @@ const Navigation = ({ tabOpen, onChangeTab, isUIVisible, setIsUIVisible }) => {
|
|
|
29
29
|
onChangeTab(tabOpen - 1);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
|
-
return (React.createElement(View, { style: navStyle },
|
|
32
|
+
return (React.createElement(View, { style: navStyle, onLayout: onLayout },
|
|
33
33
|
isUIVisible && (React.createElement(GestureRecognizer, { onSwipeLeft: handleSwipeLeft, onSwipeRight: handleSwipeRight, config: SWIPE_CONFIG },
|
|
34
34
|
React.createElement(Bar, { index: tabOpen, onPress: onChangeTab, style: { paddingBottom: insets.bottom } }))),
|
|
35
35
|
React.createElement(VisibilityButton, { onPress: handleToggleUI, style: { marginBottom: insets.bottom } })));
|
|
@@ -2,11 +2,10 @@ import styled from '@emotion/native';
|
|
|
2
2
|
import { addons } from '@storybook/addons';
|
|
3
3
|
import Events from '@storybook/core-events';
|
|
4
4
|
import React, { useMemo, useState } from 'react';
|
|
5
|
-
import { SectionList, StyleSheet
|
|
6
|
-
import {
|
|
5
|
+
import { SectionList, StyleSheet } from 'react-native';
|
|
6
|
+
import { useIsStorySectionSelected, useIsStorySelected } from '../../../hooks';
|
|
7
7
|
import { GridIcon, SearchIcon, StoryIcon } from '../Shared/icons';
|
|
8
8
|
import { Header, Name } from '../Shared/text';
|
|
9
|
-
import { useIsStorySelected, useIsStorySectionSelected } from '../../../hooks';
|
|
10
9
|
const SearchInput = styled.TextInput(Object.assign({ fontSize: 16, padding: 0, paddingHorizontal: 36 }, StyleSheet.absoluteFillObject), ({ theme }) => ({
|
|
11
10
|
color: theme.buttonActiveTextColor,
|
|
12
11
|
}));
|
|
@@ -26,7 +25,7 @@ const SearchContainer = styled.View({
|
|
|
26
25
|
const SearchBar = (props) => {
|
|
27
26
|
return (React.createElement(SearchContainer, null,
|
|
28
27
|
React.createElement(SearchIcon, null),
|
|
29
|
-
React.createElement(SearchInput, Object.assign({}, props, { autoCapitalize:
|
|
28
|
+
React.createElement(SearchInput, Object.assign({}, props, { autoCapitalize: "none", autoComplete: "off", autoCorrect: false, spellCheck: false, clearButtonMode: "while-editing", disableFullscreenUI: true, placeholderTextColor: "#666", returnKeyType: "search" }))));
|
|
30
29
|
};
|
|
31
30
|
const HeaderContainer = styled.TouchableOpacity({
|
|
32
31
|
marginTop: 8,
|
|
@@ -40,17 +39,12 @@ const HeaderContainer = styled.TouchableOpacity({
|
|
|
40
39
|
}, ({ selected, theme }) => ({
|
|
41
40
|
backgroundColor: selected ? theme.sectionActiveColor : undefined,
|
|
42
41
|
}));
|
|
43
|
-
const StoryListContainer = styled.View(({ theme }) => (
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// },
|
|
50
|
-
// shadowOpacity: 0.2,
|
|
51
|
-
// shadowRadius: 1.41,
|
|
52
|
-
// elevation: 2,
|
|
53
|
-
borderRightWidth: StyleSheet.hairlineWidth, borderRightColor: theme.borderColor, backgroundColor: theme.storyListBackgroundColor })));
|
|
42
|
+
const StoryListContainer = styled.View(({ theme }) => ({
|
|
43
|
+
flex: 1,
|
|
44
|
+
borderRightWidth: StyleSheet.hairlineWidth,
|
|
45
|
+
borderRightColor: theme.borderColor,
|
|
46
|
+
backgroundColor: theme.storyListBackgroundColor,
|
|
47
|
+
}));
|
|
54
48
|
const SectionHeader = React.memo(({ title, onPress }) => {
|
|
55
49
|
const selected = useIsStorySectionSelected(title);
|
|
56
50
|
return (React.createElement(HeaderContainer, { key: title, selected: selected, onPress: onPress, activeOpacity: 0.8 },
|
|
@@ -67,7 +61,7 @@ const ItemTouchable = styled.TouchableOpacity({
|
|
|
67
61
|
var _a;
|
|
68
62
|
return {
|
|
69
63
|
backgroundColor: selected
|
|
70
|
-
? (
|
|
64
|
+
? (_a = theme === null || theme === void 0 ? void 0 : theme.listItemActiveColor) !== null && _a !== void 0 ? _a : '#1ea7fd'
|
|
71
65
|
: sectionSelected
|
|
72
66
|
? theme === null || theme === void 0 ? void 0 : theme.sectionActiveColor
|
|
73
67
|
: undefined,
|
|
@@ -100,12 +94,10 @@ const styles = StyleSheet.create({
|
|
|
100
94
|
sectionList: { flex: 1 },
|
|
101
95
|
sectionListContentContainer: { paddingBottom: 6 },
|
|
102
96
|
});
|
|
103
|
-
const tabBarHeight = 40;
|
|
104
97
|
function keyExtractor(item, index) {
|
|
105
98
|
return item.id + index;
|
|
106
99
|
}
|
|
107
100
|
const StoryListView = ({ storyIndex }) => {
|
|
108
|
-
const insets = useSafeAreaInsets();
|
|
109
101
|
const originalData = useMemo(() => getStories(storyIndex), [storyIndex]);
|
|
110
102
|
const [data, setData] = useState(originalData);
|
|
111
103
|
const handleChangeSearchText = (text) => {
|
|
@@ -131,20 +123,12 @@ const StoryListView = ({ storyIndex }) => {
|
|
|
131
123
|
const channel = addons.getChannel();
|
|
132
124
|
channel.emit(Events.SET_CURRENT_STORY, { storyId });
|
|
133
125
|
};
|
|
134
|
-
const safeStyle = React.useMemo(() => {
|
|
135
|
-
return { flex: 1, marginTop: insets.top, paddingBottom: insets.bottom + tabBarHeight };
|
|
136
|
-
}, [insets]);
|
|
137
126
|
const renderItem = React.useCallback(({ item, index, section }) => {
|
|
138
127
|
return (React.createElement(ListItem, { storyId: item.id, title: item.name, kind: item.title, isLastItem: index === section.data.length - 1, onPress: () => changeStory(item.id) }));
|
|
139
128
|
}, []);
|
|
140
129
|
const renderSectionHeader = React.useCallback(({ section: { title, data } }) => (React.createElement(SectionHeader, { title: title, onPress: () => changeStory(data[0].id) })), []);
|
|
141
130
|
return (React.createElement(StoryListContainer, null,
|
|
142
|
-
React.createElement(
|
|
143
|
-
|
|
144
|
-
React.createElement(SectionList
|
|
145
|
-
// contentInset={{ bottom: insets.bottom, top: 0 }}
|
|
146
|
-
, {
|
|
147
|
-
// contentInset={{ bottom: insets.bottom, top: 0 }}
|
|
148
|
-
style: styles.sectionList, contentContainerStyle: styles.sectionListContentContainer, testID: "Storybook.ListView", renderItem: renderItem, renderSectionHeader: renderSectionHeader, keyExtractor: keyExtractor, sections: data, stickySectionHeadersEnabled: false }))));
|
|
131
|
+
React.createElement(SearchBar, { testID: "Storybook.ListView.SearchBar", onChangeText: handleChangeSearchText, placeholder: "Find by name" }),
|
|
132
|
+
React.createElement(SectionList, { style: styles.sectionList, contentContainerStyle: styles.sectionListContentContainer, testID: "Storybook.ListView", renderItem: renderItem, renderSectionHeader: renderSectionHeader, keyExtractor: keyExtractor, sections: data, stickySectionHeadersEnabled: false })));
|
|
149
133
|
};
|
|
150
134
|
export default React.memo(StoryListView);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ComponentProps, ComponentType, JSXElementConstructor, ReactElement } from 'react';
|
|
2
2
|
import type { Args, ComponentAnnotations, StoryAnnotations, AnnotatedStoryFn } from '@storybook/csf';
|
|
3
|
-
export
|
|
3
|
+
export type StoryFnReactReturnType = ReactElement<unknown>;
|
|
4
4
|
export type { Args, ArgTypes, Parameters, StoryContext } from '@storybook/addons';
|
|
5
|
-
export
|
|
5
|
+
export type ReactNativeFramework = {
|
|
6
6
|
component: ComponentType<any>;
|
|
7
7
|
storyResult: StoryFnReactReturnType;
|
|
8
8
|
};
|
|
@@ -13,7 +13,7 @@ export declare type ReactNativeFramework = {
|
|
|
13
13
|
* export default { ... } as ComponentMeta<typeof Button>;
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Meta<ComponentProps<T>>;
|
|
17
17
|
/**
|
|
18
18
|
* For the common case where a (CSFv2) story is a simple component that receives args as props:
|
|
19
19
|
*
|
|
@@ -21,7 +21,7 @@ export declare type ComponentMeta<T extends keyof JSX.IntrinsicElements | JSXEle
|
|
|
21
21
|
* const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
export
|
|
24
|
+
export type ComponentStoryFn<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryFn<ComponentProps<T>>;
|
|
25
25
|
/**
|
|
26
26
|
* For the common case where a (CSFv3) story is a simple component that receives args as props:
|
|
27
27
|
*
|
|
@@ -31,7 +31,7 @@ export declare type ComponentStoryFn<T extends keyof JSX.IntrinsicElements | JSX
|
|
|
31
31
|
* }
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
|
-
export
|
|
34
|
+
export type ComponentStoryObj<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = StoryObj<ComponentProps<T>>;
|
|
35
35
|
/**
|
|
36
36
|
* For the common case where a (CSFv2) story is a simple component that receives args as props:
|
|
37
37
|
*
|
|
@@ -42,25 +42,25 @@ export declare type ComponentStoryObj<T extends keyof JSX.IntrinsicElements | JS
|
|
|
42
42
|
* NOTE: this is an alias for `ComponentStoryFn`.
|
|
43
43
|
* In Storybook v7, `ComponentStory` will alias `ComponentStoryObj`
|
|
44
44
|
*/
|
|
45
|
-
export
|
|
45
|
+
export type ComponentStory<T extends keyof JSX.IntrinsicElements | JSXElementConstructor<any>> = Story<ComponentProps<T>>;
|
|
46
46
|
/**
|
|
47
47
|
* Metadata to configure the stories for a component.
|
|
48
48
|
*
|
|
49
49
|
* @see [Default export](https://storybook.js.org/docs/formats/component-story-format/#default-export)
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
51
|
+
export type Meta<TArgs = Args> = ComponentAnnotations<ReactNativeFramework, TArgs>;
|
|
52
52
|
/**
|
|
53
53
|
* Story function that represents a CSFv2 component example.
|
|
54
54
|
*
|
|
55
55
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
56
56
|
*/
|
|
57
|
-
export
|
|
57
|
+
export type StoryFn<TArgs = Args> = AnnotatedStoryFn<ReactNativeFramework, TArgs>;
|
|
58
58
|
/**
|
|
59
59
|
* Story function that represents a CSFv3 component example.
|
|
60
60
|
*
|
|
61
61
|
* @see [Named Story exports](https://storybook.js.org/docs/formats/component-story-format/#named-story-exports)
|
|
62
62
|
*/
|
|
63
|
-
export
|
|
63
|
+
export type StoryObj<TArgs = Args> = StoryAnnotations<ReactNativeFramework, TArgs>;
|
|
64
64
|
/**
|
|
65
65
|
* Story function that represents a CSFv2 component example.
|
|
66
66
|
*
|
|
@@ -69,4 +69,4 @@ export declare type StoryObj<TArgs = Args> = StoryAnnotations<ReactNativeFramewo
|
|
|
69
69
|
* NOTE that in Storybook 7.0, this type will be renamed to `StoryFn` and replaced by the current `StoryObj` type.
|
|
70
70
|
*
|
|
71
71
|
*/
|
|
72
|
-
export
|
|
72
|
+
export type Story<TArgs = Args> = StoryFn<TArgs>;
|
package/dist/types/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export interface RequireContext {
|
|
|
8
8
|
(id: string): any;
|
|
9
9
|
resolve(id: string): string;
|
|
10
10
|
}
|
|
11
|
-
export
|
|
12
|
-
export
|
|
11
|
+
export type LoaderFunction = () => void | any[];
|
|
12
|
+
export type Loadable = RequireContext | RequireContext[] | LoaderFunction;
|
|
13
13
|
export type { RenderContext, RenderContextWithoutStoryContext };
|
|
14
|
-
export
|
|
14
|
+
export type RenderStoryFunction = (context: RenderContext) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "6.5.0-rc.
|
|
3
|
+
"version": "6.5.0-rc.2",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -69,10 +69,9 @@
|
|
|
69
69
|
"util": "^0.12.4"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
|
-
"@types/react": "
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"jest": "^26.6.3",
|
|
72
|
+
"@types/react": "~18.0.27",
|
|
73
|
+
"babel-jest": "^29.4.3",
|
|
74
|
+
"jest": "^29.4.3",
|
|
76
75
|
"react-test-renderer": "18.2.0"
|
|
77
76
|
},
|
|
78
77
|
"peerDependencies": {
|
|
@@ -87,5 +86,5 @@
|
|
|
87
86
|
"publishConfig": {
|
|
88
87
|
"access": "public"
|
|
89
88
|
},
|
|
90
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "f94bf2102a2e59b583d23a89f22e29afe67ef8e4"
|
|
91
90
|
}
|
|
@@ -6,14 +6,14 @@ exports[`loader writeRequires when there are different file extensions writes th
|
|
|
6
6
|
|
|
7
7
|
import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
|
|
8
8
|
|
|
9
|
-
global.STORIES = [{
|
|
9
|
+
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/file-extensions","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/file-extensions\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
|
|
10
10
|
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
11
|
+
import "@storybook/addon-ondevice-notes/register";
|
|
12
|
+
import "@storybook/addon-ondevice-controls/register";
|
|
13
|
+
import "@storybook/addon-ondevice-backgrounds/register";
|
|
14
|
+
import "@storybook/addon-ondevice-actions/register";
|
|
15
15
|
|
|
16
|
-
import { argsEnhancers } from
|
|
16
|
+
import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
import { decorators, parameters } from './preview';
|
|
@@ -42,7 +42,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
|
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
const getStories=() => {
|
|
45
|
-
return {
|
|
45
|
+
return {"./scripts/mocks/file-extensions/FakeStory.stories.tsx": require("./FakeStory.stories.tsx")};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
configure(getStories, module, false)
|
|
@@ -55,14 +55,14 @@ exports[`loader writeRequires when there is a configuration object writes the st
|
|
|
55
55
|
|
|
56
56
|
import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
|
|
57
57
|
|
|
58
|
-
global.STORIES = [{
|
|
58
|
+
global.STORIES = [{"titlePrefix":"ComponentsPrefix","files":"**/*.stories.tsx","directory":"./scripts/mocks/configuration-objects/components","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/configuration-objects\\\\/components(?:\\\\/(?!\\\\.)(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/|\\\\/|$)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$"}]
|
|
59
59
|
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import
|
|
60
|
+
import "@storybook/addon-ondevice-notes/register";
|
|
61
|
+
import "@storybook/addon-ondevice-controls/register";
|
|
62
|
+
import "@storybook/addon-ondevice-backgrounds/register";
|
|
63
|
+
import "@storybook/addon-ondevice-actions/register";
|
|
64
64
|
|
|
65
|
-
import { argsEnhancers } from
|
|
65
|
+
import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
|
|
66
66
|
|
|
67
67
|
|
|
68
68
|
import { decorators, parameters } from './preview';
|
|
@@ -91,7 +91,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
|
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
const getStories=() => {
|
|
94
|
-
return {
|
|
94
|
+
return {"./scripts/mocks/configuration-objects/components/FakeStory.stories.tsx": require("./components/FakeStory.stories.tsx")};
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
configure(getStories, module, false)
|
|
@@ -104,14 +104,14 @@ exports[`loader writeRequires when there is a story glob and exclude paths globs
|
|
|
104
104
|
|
|
105
105
|
import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
|
|
106
106
|
|
|
107
|
-
global.STORIES = [{
|
|
107
|
+
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/exclude-config-files","files":"**/*.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/exclude-config-files(?:\\\\/(?!\\\\.)(?:(?:(?!(?:^|\\\\/)\\\\.).)*?)\\\\/|\\\\/|$)(?!\\\\.)(?=.)[^/]*?\\\\.stories\\\\.tsx)$"}]
|
|
108
108
|
|
|
109
|
-
import
|
|
110
|
-
import
|
|
111
|
-
import
|
|
112
|
-
import
|
|
109
|
+
import "@storybook/addon-ondevice-notes/register";
|
|
110
|
+
import "@storybook/addon-ondevice-controls/register";
|
|
111
|
+
import "@storybook/addon-ondevice-backgrounds/register";
|
|
112
|
+
import "@storybook/addon-ondevice-actions/register";
|
|
113
113
|
|
|
114
|
-
import { argsEnhancers } from
|
|
114
|
+
import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
|
|
115
115
|
|
|
116
116
|
|
|
117
117
|
import { decorators, parameters } from './preview';
|
|
@@ -140,7 +140,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
const getStories=() => {
|
|
143
|
-
return {
|
|
143
|
+
return {"./scripts/mocks/exclude-config-files/include-components/FakeStory.stories.tsx": require("./include-components/FakeStory.stories.tsx")};
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
configure(getStories, module, false)
|
|
@@ -153,14 +153,14 @@ exports[`loader writeRequires when there is a story glob writes the story import
|
|
|
153
153
|
|
|
154
154
|
import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
|
|
155
155
|
|
|
156
|
-
global.STORIES = [{
|
|
156
|
+
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/all-config-files","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/all-config-files\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
|
|
157
157
|
|
|
158
|
-
import
|
|
159
|
-
import
|
|
160
|
-
import
|
|
161
|
-
import
|
|
158
|
+
import "@storybook/addon-ondevice-notes/register";
|
|
159
|
+
import "@storybook/addon-ondevice-controls/register";
|
|
160
|
+
import "@storybook/addon-ondevice-backgrounds/register";
|
|
161
|
+
import "@storybook/addon-ondevice-actions/register";
|
|
162
162
|
|
|
163
|
-
import { argsEnhancers } from
|
|
163
|
+
import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
|
|
164
164
|
|
|
165
165
|
|
|
166
166
|
import { decorators, parameters } from './preview';
|
|
@@ -189,7 +189,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
|
|
|
189
189
|
|
|
190
190
|
|
|
191
191
|
const getStories=() => {
|
|
192
|
-
return {
|
|
192
|
+
return {"./scripts/mocks/all-config-files/FakeStory.stories.tsx": require("./FakeStory.stories.tsx")};
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
configure(getStories, module, false)
|
|
@@ -202,14 +202,14 @@ exports[`loader writeRequires when there is no preview does not add preview rela
|
|
|
202
202
|
|
|
203
203
|
import { configure, addDecorator, addParameters, addArgsEnhancer, clearDecorators } from '@storybook/react-native';
|
|
204
204
|
|
|
205
|
-
global.STORIES = [{
|
|
205
|
+
global.STORIES = [{"titlePrefix":"","directory":"./scripts/mocks/no-preview","files":"FakeStory.stories.tsx","importPathMatcher":"^\\\\.[\\\\\\\\/](?:scripts\\\\/mocks\\\\/no-preview\\\\/FakeStory\\\\.stories\\\\.tsx)$"}]
|
|
206
206
|
|
|
207
|
-
import
|
|
208
|
-
import
|
|
209
|
-
import
|
|
210
|
-
import
|
|
207
|
+
import "@storybook/addon-ondevice-notes/register";
|
|
208
|
+
import "@storybook/addon-ondevice-controls/register";
|
|
209
|
+
import "@storybook/addon-ondevice-backgrounds/register";
|
|
210
|
+
import "@storybook/addon-ondevice-actions/register";
|
|
211
211
|
|
|
212
|
-
import { argsEnhancers } from
|
|
212
|
+
import { argsEnhancers } from "@storybook/addon-actions/dist/modern/preset/addArgs"
|
|
213
213
|
|
|
214
214
|
|
|
215
215
|
|
|
@@ -220,7 +220,7 @@ import \\"@storybook/addon-ondevice-actions/register\\";
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
const getStories=() => {
|
|
223
|
-
return {
|
|
223
|
+
return {"./scripts/mocks/no-preview/FakeStory.stories.tsx": require("./FakeStory.stories.tsx")};
|
|
224
224
|
}
|
|
225
225
|
|
|
226
226
|
configure(getStories, module, false)
|