@storybook/react-native 8.5.2-alpha.1 → 8.5.2-alpha.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/index.js +21 -13
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { StoryIndex, PreparedStory, NormalizedStoriesSpecifier, StorybookConfig
|
|
|
3
3
|
import { ReactRenderer } from '@storybook/react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
5
|
import { Channel } from '@storybook/core/channels';
|
|
6
|
-
import { StoryContext } from '@storybook/csf';
|
|
7
6
|
import { PreviewWithSelection } from '@storybook/core/preview-api';
|
|
7
|
+
import { StoryContext } from '@storybook/csf';
|
|
8
8
|
import { Theme } from '@storybook/react-native-theming';
|
|
9
9
|
export { Theme, darkTheme, theme } from '@storybook/react-native-theming';
|
|
10
10
|
|
package/dist/index.js
CHANGED
|
@@ -50,9 +50,9 @@ var import_channels2 = require("@storybook/core/channels");
|
|
|
50
50
|
var import_bottom_sheet = require("@gorhom/bottom-sheet");
|
|
51
51
|
var import_channels = require("@storybook/core/channels");
|
|
52
52
|
var import_core_events = __toESM(require("@storybook/core/core-events"));
|
|
53
|
-
var import_csf = require("@storybook/csf");
|
|
54
53
|
var import_manager_api = require("@storybook/core/manager-api");
|
|
55
54
|
var import_preview_api = require("@storybook/core/preview-api");
|
|
55
|
+
var import_csf = require("@storybook/csf");
|
|
56
56
|
var import_react_native_theming2 = require("@storybook/react-native-theming");
|
|
57
57
|
var import_react_native_ui = require("@storybook/react-native-ui");
|
|
58
58
|
var import_dedent = __toESM(require("dedent"));
|
|
@@ -63,8 +63,8 @@ var import_react_native_gesture_handler = require("react-native-gesture-handler"
|
|
|
63
63
|
var import_react_native_safe_area_context = require("react-native-safe-area-context");
|
|
64
64
|
|
|
65
65
|
// src/components/StoryView/StoryView.tsx
|
|
66
|
-
var import_react3 = __toESM(require("react"));
|
|
67
66
|
var import_react_native_theming = require("@storybook/react-native-theming");
|
|
67
|
+
var import_react3 = __toESM(require("react"));
|
|
68
68
|
var import_react_native2 = require("react-native");
|
|
69
69
|
|
|
70
70
|
// ../../node_modules/jotai/esm/vanilla.mjs
|
|
@@ -786,32 +786,40 @@ function dismissOnStartResponder() {
|
|
|
786
786
|
var Text2 = import_react_native_theming.styled.Text(({ theme: theme3 }) => ({
|
|
787
787
|
color: theme3?.color?.defaultText
|
|
788
788
|
}));
|
|
789
|
+
var errorContainerStyle = {
|
|
790
|
+
flex: 1,
|
|
791
|
+
padding: 16,
|
|
792
|
+
alignItems: "center",
|
|
793
|
+
justifyContent: "center"
|
|
794
|
+
};
|
|
789
795
|
var StoryView = () => {
|
|
790
796
|
const context = useStoryContext();
|
|
791
797
|
const id = context?.id;
|
|
792
798
|
const theme3 = (0, import_react_native_theming.useTheme)();
|
|
799
|
+
const containerStyle = (0, import_react3.useMemo)(() => {
|
|
800
|
+
return {
|
|
801
|
+
flex: 1,
|
|
802
|
+
backgroundColor: theme3.background?.content,
|
|
803
|
+
overflow: "hidden"
|
|
804
|
+
};
|
|
805
|
+
}, [theme3.background?.content]);
|
|
806
|
+
const onError = (0, import_react3.useCallback)(() => {
|
|
807
|
+
console.log(`Error rendering story for ${context?.title} ${context?.name}`);
|
|
808
|
+
}, [context?.title, context?.name]);
|
|
793
809
|
if (context && context.unboundStoryFn) {
|
|
794
810
|
const { unboundStoryFn: StoryComponent } = context;
|
|
795
811
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
796
812
|
import_react_native2.View,
|
|
797
813
|
{
|
|
798
|
-
style:
|
|
814
|
+
style: containerStyle,
|
|
799
815
|
testID: id,
|
|
800
816
|
onStartShouldSetResponder: dismissOnStartResponder,
|
|
801
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
802
|
-
ErrorBoundary,
|
|
803
|
-
{
|
|
804
|
-
onError: () => {
|
|
805
|
-
console.log(`Error rendering story for ${context.title} ${context.name}`);
|
|
806
|
-
},
|
|
807
|
-
children: StoryComponent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StoryComponent, { ...context })
|
|
808
|
-
}
|
|
809
|
-
)
|
|
817
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ErrorBoundary, { onError, children: StoryComponent && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(StoryComponent, { ...context }) })
|
|
810
818
|
},
|
|
811
819
|
id
|
|
812
820
|
);
|
|
813
821
|
}
|
|
814
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.View, { style:
|
|
822
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native2.View, { style: errorContainerStyle, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text2, { children: "Please open the sidebar and select a story to preview." }) });
|
|
815
823
|
};
|
|
816
824
|
var StoryView_default = import_react3.default.memo(StoryView);
|
|
817
825
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "8.5.2-alpha.
|
|
3
|
+
"version": "8.5.2-alpha.2",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
"@storybook/csf": "^0.1.1",
|
|
50
50
|
"@storybook/global": "^5.0.0",
|
|
51
51
|
"@storybook/react": "^8.4.2",
|
|
52
|
-
"@storybook/react-native-theming": "^8.5.2-alpha.
|
|
53
|
-
"@storybook/react-native-ui": "^8.5.2-alpha.
|
|
52
|
+
"@storybook/react-native-theming": "^8.5.2-alpha.2",
|
|
53
|
+
"@storybook/react-native-ui": "^8.5.2-alpha.2",
|
|
54
54
|
"chokidar": "^3.5.1",
|
|
55
55
|
"commander": "^8.2.0",
|
|
56
56
|
"dedent": "^1.5.1",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"publishConfig": {
|
|
92
92
|
"access": "public"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "051e4d60e1274baab7bd81afd8414d55a5c41f4b"
|
|
95
95
|
}
|