@storybook/react-native 8.3.0-alpha.0 → 8.3.0-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 CHANGED
@@ -1,10 +1,10 @@
1
1
  import * as _storybook_core_types from '@storybook/core/types';
2
2
  import { StoryIndex, PreparedStory, NormalizedStoriesSpecifier, StorybookConfig as StorybookConfig$1 } from '@storybook/core/types';
3
+ import { ReactRenderer } from '@storybook/react';
3
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
5
  import { Channel } from '@storybook/core/channels';
5
6
  import { StoryContext } from '@storybook/csf';
6
7
  import { PreviewWithSelection } from '@storybook/core/preview-api';
7
- import { ReactRenderer } from '@storybook/react';
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
@@ -40,10 +40,11 @@ module.exports = __toCommonJS(src_exports);
40
40
  var import_react_native_theming3 = require("@storybook/react-native-theming");
41
41
 
42
42
  // src/Start.tsx
43
- var import_csf2 = require("@storybook/csf");
44
- var import_preview_api2 = require("@storybook/core/preview-api");
45
43
  var import_manager_api2 = require("@storybook/core/manager-api");
44
+ var import_preview_api2 = require("@storybook/core/preview-api");
45
+ var import_csf2 = require("@storybook/csf");
46
46
  var import_channels2 = require("@storybook/core/channels");
47
+ var import_react_native4 = require("react-native");
47
48
 
48
49
  // src/View.tsx
49
50
  var import_bottom_sheet = require("@gorhom/bottom-sheet");
@@ -945,7 +946,6 @@ var View3 = class {
945
946
  this._storage = storage;
946
947
  const initialStory = this._getInitialStory(params);
947
948
  if (enableWebsockets) {
948
- console.log("websockets enabled");
949
949
  const channel = this._getServerChannel(params);
950
950
  import_manager_api.addons.setChannel(channel);
951
951
  import_preview_api.addons.setChannel(channel);
@@ -1037,7 +1037,7 @@ var View3 = class {
1037
1037
  );
1038
1038
  }
1039
1039
  if (onDeviceUI) {
1040
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_theming2.ThemeProvider, { theme: appliedTheme, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_safe_area_context.SafeAreaProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_gesture_handler.GestureHandlerRootView, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_bottom_sheet.BottomSheetModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_ui.Layout, { storyHash, story, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {}) }) }) }) }) });
1040
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_theming2.ThemeProvider, { theme: appliedTheme, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_safe_area_context.SafeAreaProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_gesture_handler.GestureHandlerRootView, { style: { flex: 1 }, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_bottom_sheet.BottomSheetModalProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_ui.LayoutProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_ui.Layout, { storyHash, story, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {}) }) }) }) }) }) });
1041
1041
  } else {
1042
1042
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(StoryView_default, {});
1043
1043
  }
@@ -1047,6 +1047,14 @@ var View3 = class {
1047
1047
 
1048
1048
  // src/Start.tsx
1049
1049
  var import_jsx_runtime4 = require("react/jsx-runtime");
1050
+ if (!URLSearchParams.get) {
1051
+ const { setupURLPolyfill } = require("react-native-url-polyfill");
1052
+ setupURLPolyfill();
1053
+ }
1054
+ if (import_react_native4.Platform.OS === "web" && typeof globalThis.setImmediate === "undefined") {
1055
+ globalThis.setImmediate = () => {
1056
+ };
1057
+ }
1050
1058
  function prepareStories({
1051
1059
  storyEntries,
1052
1060
  options
package/dist/preview.d.ts CHANGED
@@ -1,8 +1,5 @@
1
- import * as _storybook_csf from '@storybook/csf';
2
1
  import { Preview } from '@storybook/react';
3
- import { Renderer, StoryContextForEnhancers } from '@storybook/core/types';
4
2
 
5
- declare const enhanceArgTypes: <TRenderer extends Renderer>(context: StoryContextForEnhancers<TRenderer, _storybook_csf.Args>) => _storybook_csf.StrictArgTypes<_storybook_csf.Args>;
6
3
  declare const preview: Preview;
7
4
 
8
- export { preview as default, enhanceArgTypes };
5
+ export { preview as default };
package/dist/preview.js CHANGED
@@ -19,25 +19,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // src/preview.ts
20
20
  var preview_exports = {};
21
21
  __export(preview_exports, {
22
- default: () => preview_default,
23
- enhanceArgTypes: () => enhanceArgTypes
22
+ default: () => preview_default
24
23
  });
25
24
  module.exports = __toCommonJS(preview_exports);
26
- var import_entry_preview_docs = require("@storybook/react/dist/entry-preview-docs");
27
- var import_preview_api = require("@storybook/core/preview-api");
28
- var enhanceArgTypes = (context) => {
29
- const {
30
- component,
31
- argTypes: userArgTypes,
32
- parameters: { docs = {} }
33
- } = context;
34
- const { extractArgTypes } = docs;
35
- const extractedArgTypes = extractArgTypes && component ? extractArgTypes(component) : {};
36
- const withExtractedTypes = extractedArgTypes ? (0, import_preview_api.combineParameters)(extractedArgTypes, userArgTypes) : userArgTypes;
37
- return withExtractedTypes;
38
- };
25
+ var import_entry_preview_docs = require("@storybook/react/dist/entry-preview-docs.mjs");
39
26
  var preview = {
40
- argTypesEnhancers: [enhanceArgTypes],
27
+ argTypesEnhancers: import_entry_preview_docs.argTypesEnhancers,
41
28
  parameters: {
42
29
  docs: {
43
30
  extractArgTypes: import_entry_preview_docs.parameters.docs.extractArgTypes
@@ -45,7 +32,3 @@ var preview = {
45
32
  }
46
33
  };
47
34
  var preview_default = preview;
48
- // Annotate the CommonJS export names for ESM import in node:
49
- 0 && (module.exports = {
50
- enhanceArgTypes
51
- });
@@ -1,10 +1,8 @@
1
1
  const path = require('path');
2
- const fs = require('fs');
2
+
3
3
  const { generate } = require('../scripts/generate');
4
4
  const { WebSocketServer } = require('ws');
5
5
 
6
- let alreadyReplaced = false;
7
-
8
6
  module.exports = (config, { configPath, enabled, websockets }) => {
9
7
  if (!enabled) {
10
8
  return config;
@@ -59,20 +57,6 @@ module.exports = (config, { configPath, enabled, websockets }) => {
59
57
  };
60
58
  }
61
59
 
62
- // workaround for unsupported regex
63
- if (defaultResolveResult?.filePath?.includes?.('@storybook/core/dist/docs-tools/index')) {
64
- if (!alreadyReplaced) {
65
- const filepath = path.resolve(defaultResolveResult?.filePath);
66
-
67
- const input = fs.readFileSync(filepath, 'utf-8');
68
-
69
- const output = input.replace(/new RegExp\(([^)]+).*, "u"\)/g, 'new RegExp("")');
70
-
71
- fs.writeFileSync(filepath, output);
72
- alreadyReplaced = true;
73
- }
74
- }
75
-
76
60
  return defaultResolveResult;
77
61
  },
78
62
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react-native",
3
- "version": "8.3.0-alpha.0",
3
+ "version": "8.3.0-alpha.2",
4
4
  "description": "A better way to develop React Native Components for your app",
5
5
  "keywords": [
6
6
  "react",
@@ -39,12 +39,12 @@
39
39
  "test:ci": "jest"
40
40
  },
41
41
  "dependencies": {
42
- "@storybook/core": "^8.3.0",
42
+ "@storybook/core": "^8.3.1",
43
43
  "@storybook/csf": "^0.1.1",
44
44
  "@storybook/global": "^5.0.0",
45
- "@storybook/react": "^8.3.0",
46
- "@storybook/react-native-theming": "^8.3.0-alpha.0",
47
- "@storybook/react-native-ui": "^8.3.0-alpha.0",
45
+ "@storybook/react": "^8.3.1",
46
+ "@storybook/react-native-theming": "^8.3.0-alpha.2",
47
+ "@storybook/react-native-ui": "^8.3.0-alpha.2",
48
48
  "chokidar": "^3.5.1",
49
49
  "commander": "^8.2.0",
50
50
  "dedent": "^1.5.1",
@@ -52,6 +52,7 @@
52
52
  "glob": "^7.1.7",
53
53
  "prettier": "^2.4.1",
54
54
  "react-native-swipe-gestures": "^1.0.5",
55
+ "react-native-url-polyfill": "^2.0.0",
55
56
  "type-fest": "~2.19",
56
57
  "util": "^0.12.4",
57
58
  "ws": "^8.18.0"
@@ -79,5 +80,5 @@
79
80
  "publishConfig": {
80
81
  "access": "public"
81
82
  },
82
- "gitHead": "b2629231f25c031146cdb880136d876852031e7b"
83
+ "gitHead": "afcce3fd6cfd6625afaddb06527c377449300d6d"
83
84
  }