@storybook/react-native 8.6.1 → 9.0.0-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 +6 -6
- package/dist/index.js +15 -9
- package/dist/metro/withStorybook.d.ts +2 -2
- package/dist/metro/withStorybook.js +3 -3
- package/package.json +6 -7
- package/scripts/common.js +1 -1
- package/scripts/generate.js +1 -1
- package/scripts/handle-args.js +1 -1
- package/template/cli/storybook.requires.ts +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { StoryIndex, PreparedStory, NormalizedStoriesSpecifier, Addon_StorySortParameterV7, StorybookConfig as StorybookConfig$1 } from '
|
|
1
|
+
import * as storybook_internal_types from 'storybook/internal/types';
|
|
2
|
+
import { StoryIndex, PreparedStory, NormalizedStoriesSpecifier, Addon_StorySortParameterV7, StorybookConfig as StorybookConfig$1 } from 'storybook/internal/types';
|
|
3
3
|
import { ReactRenderer } from '@storybook/react';
|
|
4
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
-
import { Channel } from '
|
|
6
|
-
import { PreviewWithSelection } from '
|
|
5
|
+
import { Channel } from 'storybook/internal/channels';
|
|
6
|
+
import { PreviewWithSelection } from 'storybook/internal/preview-api';
|
|
7
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';
|
|
@@ -77,11 +77,11 @@ declare function prepareStories({ storyEntries, options, storySort, }: {
|
|
|
77
77
|
}): {
|
|
78
78
|
index: {
|
|
79
79
|
v: number;
|
|
80
|
-
entries: Record<string,
|
|
80
|
+
entries: Record<string, storybook_internal_types.IndexEntry>;
|
|
81
81
|
};
|
|
82
82
|
importMap: Record<string, any>;
|
|
83
83
|
};
|
|
84
|
-
declare const getProjectAnnotations: (view: View, annotations: any[]) => () => Promise<
|
|
84
|
+
declare const getProjectAnnotations: (view: View, annotations: any[]) => () => Promise<storybook_internal_types.NormalizedProjectAnnotations<ReactRenderer>>;
|
|
85
85
|
declare function start({ annotations, storyEntries, options, }: {
|
|
86
86
|
storyEntries: Array<NormalizedStoriesSpecifier & {
|
|
87
87
|
req: any;
|
package/dist/index.js
CHANGED
|
@@ -41,17 +41,17 @@ var import_react_native_theming3 = require("@storybook/react-native-theming");
|
|
|
41
41
|
|
|
42
42
|
// src/Start.tsx
|
|
43
43
|
var import_react_native4 = require("react-native");
|
|
44
|
-
var import_manager_api2 = require("
|
|
45
|
-
var import_preview_api2 = require("
|
|
44
|
+
var import_manager_api2 = require("storybook/internal/manager-api");
|
|
45
|
+
var import_preview_api2 = require("storybook/internal/preview-api");
|
|
46
46
|
var import_csf2 = require("@storybook/csf");
|
|
47
|
-
var import_channels2 = require("
|
|
47
|
+
var import_channels2 = require("storybook/internal/channels");
|
|
48
48
|
|
|
49
49
|
// src/View.tsx
|
|
50
50
|
var import_bottom_sheet = require("@gorhom/bottom-sheet");
|
|
51
|
-
var import_channels = require("
|
|
52
|
-
var import_core_events = __toESM(require("
|
|
53
|
-
var import_manager_api = require("
|
|
54
|
-
var import_preview_api = require("
|
|
51
|
+
var import_channels = require("storybook/internal/channels");
|
|
52
|
+
var import_core_events = __toESM(require("storybook/internal/core-events"));
|
|
53
|
+
var import_manager_api = require("storybook/internal/manager-api");
|
|
54
|
+
var import_preview_api = require("storybook/internal/preview-api");
|
|
55
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");
|
|
@@ -1248,7 +1248,13 @@ function start({
|
|
|
1248
1248
|
import_preview_api2.addons.setChannel(channel);
|
|
1249
1249
|
const previewView = {
|
|
1250
1250
|
prepareForStory: () => {
|
|
1251
|
-
return
|
|
1251
|
+
return {
|
|
1252
|
+
component: () => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, {}),
|
|
1253
|
+
canvasElement: null,
|
|
1254
|
+
mount: () => Promise.resolve({}),
|
|
1255
|
+
storyResult: null,
|
|
1256
|
+
T: null
|
|
1257
|
+
};
|
|
1252
1258
|
},
|
|
1253
1259
|
prepareForDocs: () => {
|
|
1254
1260
|
},
|
|
@@ -1269,7 +1275,6 @@ function start({
|
|
|
1269
1275
|
},
|
|
1270
1276
|
showStoryDuringRender: () => {
|
|
1271
1277
|
}
|
|
1272
|
-
// TODO what happened to this type?
|
|
1273
1278
|
};
|
|
1274
1279
|
const selectionStore = {
|
|
1275
1280
|
selection: null,
|
|
@@ -1277,6 +1282,7 @@ function start({
|
|
|
1277
1282
|
setQueryParams: () => {
|
|
1278
1283
|
},
|
|
1279
1284
|
setSelection: (selection) => {
|
|
1285
|
+
console.log("setSelection", selection);
|
|
1280
1286
|
preview.selectionStore.selection = selection;
|
|
1281
1287
|
}
|
|
1282
1288
|
};
|
|
@@ -18,7 +18,7 @@ interface WebsocketsOptions {
|
|
|
18
18
|
*/
|
|
19
19
|
interface WithStorybookOptions {
|
|
20
20
|
/**
|
|
21
|
-
* The path to the Storybook config folder. Defaults to './.
|
|
21
|
+
* The path to the Storybook config folder. Defaults to './.rnstorybook'.
|
|
22
22
|
*/
|
|
23
23
|
configPath?: string;
|
|
24
24
|
/**
|
|
@@ -56,7 +56,7 @@ interface WithStorybookOptions {
|
|
|
56
56
|
*
|
|
57
57
|
* module.exports = withStorybook(config, {
|
|
58
58
|
* enabled: true,
|
|
59
|
-
* configPath: path.resolve(projectRoot, './.
|
|
59
|
+
* configPath: path.resolve(projectRoot, './.rnstorybook'),
|
|
60
60
|
* websockets: { port: 7007, host: 'localhost' },
|
|
61
61
|
* useJs: false,
|
|
62
62
|
* onDisabledRemoveStorybook: true,
|
|
@@ -27,7 +27,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
// scripts/common.js
|
|
28
28
|
var require_common = __commonJS({
|
|
29
29
|
"scripts/common.js"(exports2, module2) {
|
|
30
|
-
var { globToRegexp, serverRequire } = require("
|
|
30
|
+
var { globToRegexp, serverRequire } = require("storybook/internal/common");
|
|
31
31
|
var path2 = require("path");
|
|
32
32
|
var fs = require("fs");
|
|
33
33
|
var cwd = process.cwd();
|
|
@@ -128,7 +128,7 @@ var require_generate = __commonJS({
|
|
|
128
128
|
resolveAddonFile,
|
|
129
129
|
getAddonName
|
|
130
130
|
} = require_common();
|
|
131
|
-
var { normalizeStories, globToRegexp } = require("
|
|
131
|
+
var { normalizeStories, globToRegexp } = require("storybook/internal/common");
|
|
132
132
|
var fs = require("fs");
|
|
133
133
|
var prettier = require("prettier");
|
|
134
134
|
var path2 = require("path");
|
|
@@ -301,7 +301,7 @@ function withStorybook(config, options = {
|
|
|
301
301
|
});
|
|
302
302
|
}
|
|
303
303
|
(0, import_generate.generate)({
|
|
304
|
-
configPath: configPath ?? path.resolve(process.cwd(), "./.
|
|
304
|
+
configPath: configPath ?? path.resolve(process.cwd(), "./.rnstorybook"),
|
|
305
305
|
useJs
|
|
306
306
|
});
|
|
307
307
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/react-native",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-alpha.0",
|
|
4
4
|
"description": "A better way to develop React Native Components for your app",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -45,19 +45,18 @@
|
|
|
45
45
|
"test:update": "jest --updateSnapshot"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@storybook/core": "^8.6.6",
|
|
49
48
|
"@storybook/csf": "^0.1.13",
|
|
50
49
|
"@storybook/global": "^5.0.0",
|
|
51
|
-
"@storybook/react": "
|
|
52
|
-
"@storybook/react-native-theming": "^
|
|
53
|
-
"@storybook/react-native-ui": "^
|
|
50
|
+
"@storybook/react": "9.0.0-alpha.3",
|
|
51
|
+
"@storybook/react-native-theming": "^9.0.0-alpha.0",
|
|
52
|
+
"@storybook/react-native-ui": "^9.0.0-alpha.0",
|
|
54
53
|
"commander": "^8.2.0",
|
|
55
54
|
"dedent": "^1.5.1",
|
|
56
55
|
"deepmerge": "^4.3.0",
|
|
57
56
|
"prettier": "^2.4.1",
|
|
58
57
|
"react-native-url-polyfill": "^2.0.0",
|
|
59
58
|
"setimmediate": "^1.0.5",
|
|
60
|
-
"storybook": "
|
|
59
|
+
"storybook": "9.0.0-alpha.3",
|
|
61
60
|
"type-fest": "~2.19",
|
|
62
61
|
"util": "^0.12.4",
|
|
63
62
|
"ws": "^8.18.0"
|
|
@@ -88,5 +87,5 @@
|
|
|
88
87
|
"publishConfig": {
|
|
89
88
|
"access": "public"
|
|
90
89
|
},
|
|
91
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "6ca21ab6b467c73887d17a383fdd464da37865d6"
|
|
92
91
|
}
|
package/scripts/common.js
CHANGED
package/scripts/generate.js
CHANGED
|
@@ -6,7 +6,7 @@ const {
|
|
|
6
6
|
resolveAddonFile,
|
|
7
7
|
getAddonName,
|
|
8
8
|
} = require('./common');
|
|
9
|
-
const { normalizeStories, globToRegexp } = require('
|
|
9
|
+
const { normalizeStories, globToRegexp } = require('storybook/internal/common');
|
|
10
10
|
const fs = require('fs');
|
|
11
11
|
const prettier = require('prettier');
|
|
12
12
|
const path = require('path');
|
package/scripts/handle-args.js
CHANGED
|
@@ -6,7 +6,7 @@ function getArguments() {
|
|
|
6
6
|
.option(
|
|
7
7
|
'-c, --config-path <path>',
|
|
8
8
|
'The path to your config folder relative to your project-dir',
|
|
9
|
-
'./.
|
|
9
|
+
'./.rnstorybook'
|
|
10
10
|
)
|
|
11
11
|
.option('-js, --use-js', 'Use a js file for storybook.requires')
|
|
12
12
|
.option('-a, --absolute', 'Use absolute paths for story imports');
|
|
@@ -8,7 +8,7 @@ import '@storybook/addon-ondevice-actions/register';
|
|
|
8
8
|
const normalizedStories = [
|
|
9
9
|
{
|
|
10
10
|
titlePrefix: '',
|
|
11
|
-
directory: './.
|
|
11
|
+
directory: './.rnstorybook/stories',
|
|
12
12
|
files: '**/*.stories.?(ts|tsx|js|jsx)',
|
|
13
13
|
importPathMatcher:
|
|
14
14
|
/^\.(?:(?:^|\/|(?:(?:(?!(?:^|\/)\.).)*?)\/)(?!\.)(?=.)[^/]*?\.stories\.(?:ts|tsx|js|jsx)?)$/,
|
|
@@ -29,7 +29,7 @@ declare global {
|
|
|
29
29
|
const annotations = [
|
|
30
30
|
require('./preview'),
|
|
31
31
|
require('@storybook/react-native/dist/preview'),
|
|
32
|
-
require('@storybook/addon-actions/preview'),
|
|
32
|
+
require('@storybook/addon-ondevice-actions/preview'),
|
|
33
33
|
];
|
|
34
34
|
|
|
35
35
|
global.STORIES = normalizedStories;
|