@storybook/react-native 8.5.3 → 8.5.4-alpha.0
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 +7 -3
- package/dist/index.js +27 -5
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _storybook_core_types from '@storybook/core/types';
|
|
2
|
-
import { StoryIndex, PreparedStory, NormalizedStoriesSpecifier, StorybookConfig as StorybookConfig$1 } from '@storybook/core/types';
|
|
2
|
+
import { StoryIndex, PreparedStory, NormalizedStoriesSpecifier, Addon_StorySortParameterV7, StorybookConfig as StorybookConfig$1 } from '@storybook/core/types';
|
|
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';
|
|
@@ -67,13 +67,17 @@ interface ReactNativeOptions {
|
|
|
67
67
|
*/
|
|
68
68
|
playFn?: boolean;
|
|
69
69
|
}
|
|
70
|
-
declare function prepareStories({ storyEntries, options, }: {
|
|
70
|
+
declare function prepareStories({ storyEntries, options, storySort, }: {
|
|
71
71
|
storyEntries: Array<NormalizedStoriesSpecifier & {
|
|
72
72
|
req: any;
|
|
73
73
|
}>;
|
|
74
74
|
options?: ReactNativeOptions;
|
|
75
|
+
storySort?: Addon_StorySortParameterV7;
|
|
75
76
|
}): {
|
|
76
|
-
index:
|
|
77
|
+
index: {
|
|
78
|
+
v: number;
|
|
79
|
+
entries: Record<string, _storybook_core_types.IndexEntry>;
|
|
80
|
+
};
|
|
77
81
|
importMap: Record<string, any>;
|
|
78
82
|
};
|
|
79
83
|
declare const getProjectAnnotations: (view: View, annotations: any[]) => () => Promise<_storybook_core_types.NormalizedProjectAnnotations<ReactRenderer>>;
|
package/dist/index.js
CHANGED
|
@@ -1070,10 +1070,11 @@ if (import_react_native4.Platform.OS === "web" && typeof globalThis.setImmediate
|
|
|
1070
1070
|
}
|
|
1071
1071
|
function prepareStories({
|
|
1072
1072
|
storyEntries,
|
|
1073
|
-
options
|
|
1073
|
+
options,
|
|
1074
|
+
storySort
|
|
1074
1075
|
}) {
|
|
1075
1076
|
let index = {
|
|
1076
|
-
v:
|
|
1077
|
+
v: 5,
|
|
1077
1078
|
entries: {}
|
|
1078
1079
|
};
|
|
1079
1080
|
let importMap = {};
|
|
@@ -1148,7 +1149,17 @@ function prepareStories({
|
|
|
1148
1149
|
}
|
|
1149
1150
|
});
|
|
1150
1151
|
});
|
|
1151
|
-
|
|
1152
|
+
const sortableStories = Object.values(index.entries);
|
|
1153
|
+
(0, import_preview_api2.sortStoriesV7)(
|
|
1154
|
+
sortableStories,
|
|
1155
|
+
storySort,
|
|
1156
|
+
Object.values(index.entries).map((entry) => entry.importPath)
|
|
1157
|
+
);
|
|
1158
|
+
const sorted = sortableStories.reduce((acc, item) => {
|
|
1159
|
+
acc[item.id] = item;
|
|
1160
|
+
return acc;
|
|
1161
|
+
}, {});
|
|
1162
|
+
return { index: { v: 5, entries: sorted }, importMap };
|
|
1152
1163
|
}
|
|
1153
1164
|
var getProjectAnnotations = (view, annotations) => async () => (0, import_preview_api2.composeConfigs)([
|
|
1154
1165
|
{
|
|
@@ -1172,7 +1183,12 @@ function start({
|
|
|
1172
1183
|
storyEntries,
|
|
1173
1184
|
options
|
|
1174
1185
|
}) {
|
|
1175
|
-
const
|
|
1186
|
+
const composedAnnotations = (0, import_preview_api2.composeConfigs)(annotations);
|
|
1187
|
+
const { index, importMap } = prepareStories({
|
|
1188
|
+
storyEntries,
|
|
1189
|
+
options,
|
|
1190
|
+
storySort: composedAnnotations.parameters?.options?.storySort
|
|
1191
|
+
});
|
|
1176
1192
|
const channel = (0, import_channels2.createBrowserChannel)({ page: "preview" });
|
|
1177
1193
|
import_manager_api2.addons.setChannel(channel);
|
|
1178
1194
|
import_preview_api2.addons.setChannel(channel);
|
|
@@ -1243,7 +1259,13 @@ function start({
|
|
|
1243
1259
|
return view;
|
|
1244
1260
|
}
|
|
1245
1261
|
function updateView(viewInstance, annotations, normalizedStories, options) {
|
|
1246
|
-
const
|
|
1262
|
+
const composedAnnotations = (0, import_preview_api2.composeConfigs)(annotations);
|
|
1263
|
+
const storySort = composedAnnotations.parameters?.options?.storySort;
|
|
1264
|
+
const { importMap, index } = prepareStories({
|
|
1265
|
+
storyEntries: normalizedStories,
|
|
1266
|
+
options,
|
|
1267
|
+
storySort
|
|
1268
|
+
});
|
|
1247
1269
|
viewInstance._preview.onStoriesChanged({
|
|
1248
1270
|
importFn: async (importPath) => importMap[importPath]
|
|
1249
1271
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "8.5.
|
|
3
|
+
"version": "8.5.4-alpha.0",
|
|
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.13",
|
|
50
50
|
"@storybook/global": "^5.0.0",
|
|
51
51
|
"@storybook/react": "^8.5.1",
|
|
52
|
-
"@storybook/react-native-theming": "^8.5.
|
|
53
|
-
"@storybook/react-native-ui": "^8.5.
|
|
52
|
+
"@storybook/react-native-theming": "^8.5.4-alpha.0",
|
|
53
|
+
"@storybook/react-native-ui": "^8.5.4-alpha.0",
|
|
54
54
|
"commander": "^8.2.0",
|
|
55
55
|
"dedent": "^1.5.1",
|
|
56
56
|
"deepmerge": "^4.3.0",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"access": "public"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "2c48f3c49c1cd24eacc30506d395adac6f817315"
|
|
92
92
|
}
|