@storybook/react 6.4.0-beta.7 → 6.4.0-rc.1

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.
@@ -74,9 +74,9 @@ function _asyncToGenerator(fn) { return function () { var self = this, args = ar
74
74
 
75
75
  var FRAMEWORK_OPTIONS = _global.default.FRAMEWORK_OPTIONS;
76
76
 
77
- var render = function render(args, _ref) {
78
- var id = _ref.id,
79
- Component = _ref.component;
77
+ var render = function render(args, context) {
78
+ var id = context.id,
79
+ Component = context.component;
80
80
 
81
81
  if (!Component) {
82
82
  throw new Error("Unable to render story ".concat(id, " as the component annotation is missing from the default export"));
@@ -88,7 +88,7 @@ var render = function render(args, _ref) {
88
88
  exports.render = render;
89
89
 
90
90
  var renderElement = /*#__PURE__*/function () {
91
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(node, el) {
91
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(node, el) {
92
92
  return regeneratorRuntime.wrap(function _callee$(_context) {
93
93
  while (1) {
94
94
  switch (_context.prev = _context.next) {
@@ -108,7 +108,7 @@ var renderElement = /*#__PURE__*/function () {
108
108
  }));
109
109
 
110
110
  return function renderElement(_x, _x2) {
111
- return _ref2.apply(this, arguments);
111
+ return _ref.apply(this, arguments);
112
112
  };
113
113
  }();
114
114
 
@@ -176,13 +176,13 @@ function renderToDOM(_x3, _x4) {
176
176
  }
177
177
 
178
178
  function _renderToDOM() {
179
- _renderToDOM = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref3, domElement) {
179
+ _renderToDOM = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2, domElement) {
180
180
  var storyContext, unboundStoryFn, showMain, showException, forceRemount, Story, content, element;
181
181
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
182
182
  while (1) {
183
183
  switch (_context2.prev = _context2.next) {
184
184
  case 0:
185
- storyContext = _ref3.storyContext, unboundStoryFn = _ref3.unboundStoryFn, showMain = _ref3.showMain, showException = _ref3.showException, forceRemount = _ref3.forceRemount;
185
+ storyContext = _ref2.storyContext, unboundStoryFn = _ref2.unboundStoryFn, showMain = _ref2.showMain, showException = _ref2.showException, forceRemount = _ref2.forceRemount;
186
186
  Story = unboundStoryFn;
187
187
  content = /*#__PURE__*/_react.default.createElement(ErrorBoundary, {
188
188
  showMain: showMain,
@@ -12,6 +12,6 @@ var _default = {
12
12
  cwd: __dirname
13
13
  }).packageJson,
14
14
  framework: 'react',
15
- frameworkPresets: [require.resolve('./framework-preset-react'), require.resolve('./framework-preset-cra'), require.resolve('./framework-preset-react-docgen')]
15
+ frameworkPresets: [require.resolve('./preset')]
16
16
  };
17
17
  exports.default = _default;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.addons = exports.config = void 0;
7
+
8
+ var _coreCommon = require("@storybook/core-common");
9
+
10
+ var config = function (entries = []) {
11
+ return [...entries, (0, _coreCommon.findDistEsm)(__dirname, 'client/preview/config')];
12
+ };
13
+
14
+ exports.config = config;
15
+ var addons = [require.resolve('./framework-preset-react'), require.resolve('./framework-preset-cra'), require.resolve('./framework-preset-react-docgen')];
16
+ exports.addons = addons;
@@ -41,9 +41,9 @@ import global from 'global';
41
41
  import React, { Component as ReactComponent, StrictMode, Fragment } from 'react';
42
42
  import ReactDOM from 'react-dom';
43
43
  var FRAMEWORK_OPTIONS = global.FRAMEWORK_OPTIONS;
44
- export var render = function render(args, _ref) {
45
- var id = _ref.id,
46
- Component = _ref.component;
44
+ export var render = function render(args, context) {
45
+ var id = context.id,
46
+ Component = context.component;
47
47
 
48
48
  if (!Component) {
49
49
  throw new Error("Unable to render story ".concat(id, " as the component annotation is missing from the default export"));
@@ -53,7 +53,7 @@ export var render = function render(args, _ref) {
53
53
  };
54
54
 
55
55
  var renderElement = /*#__PURE__*/function () {
56
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(node, el) {
56
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(node, el) {
57
57
  return regeneratorRuntime.wrap(function _callee$(_context) {
58
58
  while (1) {
59
59
  switch (_context.prev = _context.next) {
@@ -73,7 +73,7 @@ var renderElement = /*#__PURE__*/function () {
73
73
  }));
74
74
 
75
75
  return function renderElement(_x, _x2) {
76
- return _ref2.apply(this, arguments);
76
+ return _ref.apply(this, arguments);
77
77
  };
78
78
  }();
79
79
 
@@ -140,13 +140,13 @@ export function renderToDOM(_x3, _x4) {
140
140
  }
141
141
 
142
142
  function _renderToDOM() {
143
- _renderToDOM = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref3, domElement) {
143
+ _renderToDOM = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(_ref2, domElement) {
144
144
  var storyContext, unboundStoryFn, showMain, showException, forceRemount, Story, content, element;
145
145
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
146
146
  while (1) {
147
147
  switch (_context2.prev = _context2.next) {
148
148
  case 0:
149
- storyContext = _ref3.storyContext, unboundStoryFn = _ref3.unboundStoryFn, showMain = _ref3.showMain, showException = _ref3.showException, forceRemount = _ref3.forceRemount;
149
+ storyContext = _ref2.storyContext, unboundStoryFn = _ref2.unboundStoryFn, showMain = _ref2.showMain, showException = _ref2.showException, forceRemount = _ref2.forceRemount;
150
150
  Story = unboundStoryFn;
151
151
  content = /*#__PURE__*/React.createElement(ErrorBoundary, {
152
152
  showMain: showMain,
@@ -4,5 +4,5 @@ export default {
4
4
  cwd: __dirname
5
5
  }).packageJson,
6
6
  framework: 'react',
7
- frameworkPresets: [require.resolve('./framework-preset-react'), require.resolve('./framework-preset-cra'), require.resolve('./framework-preset-react-docgen')]
7
+ frameworkPresets: [require.resolve('./preset')]
8
8
  };
@@ -0,0 +1,5 @@
1
+ import { findDistEsm } from '@storybook/core-common';
2
+ export var config = function (entries = []) {
3
+ return [...entries, findDistEsm(__dirname, 'client/preview/config')];
4
+ };
5
+ export var addons = [require.resolve('./framework-preset-react'), require.resolve('./framework-preset-cra'), require.resolve('./framework-preset-react-docgen')];
@@ -4,10 +4,12 @@ import ReactDOM from 'react-dom';
4
4
  const {
5
5
  FRAMEWORK_OPTIONS
6
6
  } = global;
7
- export const render = (args, {
8
- id,
9
- component: Component
10
- }) => {
7
+ export const render = (args, context) => {
8
+ const {
9
+ id,
10
+ component: Component
11
+ } = context;
12
+
11
13
  if (!Component) {
12
14
  throw new Error(`Unable to render story ${id} as the component annotation is missing from the default export`);
13
15
  }
@@ -4,5 +4,5 @@ export default {
4
4
  cwd: __dirname
5
5
  }).packageJson,
6
6
  framework: 'react',
7
- frameworkPresets: [require.resolve('./framework-preset-react'), require.resolve('./framework-preset-cra'), require.resolve('./framework-preset-react-docgen')]
7
+ frameworkPresets: [require.resolve('./preset')]
8
8
  };
@@ -0,0 +1,5 @@
1
+ import { findDistEsm } from '@storybook/core-common';
2
+ export var config = function (entries = []) {
3
+ return [...entries, findDistEsm(__dirname, 'client/preview/config')];
4
+ };
5
+ export var addons = [require.resolve('./framework-preset-react'), require.resolve('./framework-preset-cra'), require.resolve('./framework-preset-react-docgen')];
@@ -0,0 +1,3 @@
1
+ import { StorybookConfig } from '@storybook/core-common';
2
+ export declare const config: StorybookConfig['config'];
3
+ export declare const addons: StorybookConfig['addons'];
@@ -0,0 +1,3 @@
1
+ import { StorybookConfig } from '@storybook/core-common';
2
+ export declare const config: StorybookConfig['config'];
3
+ export declare const addons: StorybookConfig['addons'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react",
3
- "version": "6.4.0-beta.7",
3
+ "version": "6.4.0-rc.1",
4
4
  "description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
5
5
  "keywords": [
6
6
  "storybook"
@@ -49,14 +49,14 @@
49
49
  "@babel/preset-flow": "^7.12.1",
50
50
  "@babel/preset-react": "^7.12.10",
51
51
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
52
- "@storybook/addons": "6.4.0-beta.7",
53
- "@storybook/core": "6.4.0-beta.7",
54
- "@storybook/core-common": "6.4.0-beta.7",
55
- "@storybook/csf": "0.0.2--canary.6aca495.0",
56
- "@storybook/node-logger": "6.4.0-beta.7",
52
+ "@storybook/addons": "6.4.0-rc.1",
53
+ "@storybook/core": "6.4.0-rc.1",
54
+ "@storybook/core-common": "6.4.0-rc.1",
55
+ "@storybook/csf": "0.0.2--canary.87bc651.0",
56
+ "@storybook/node-logger": "6.4.0-rc.1",
57
57
  "@storybook/react-docgen-typescript-plugin": "1.0.2-canary.253f8c1.0",
58
58
  "@storybook/semver": "^7.3.2",
59
- "@storybook/store": "6.4.0-beta.7",
59
+ "@storybook/store": "6.4.0-rc.1",
60
60
  "@types/webpack-env": "^1.16.0",
61
61
  "babel-plugin-add-react-displayname": "^0.0.5",
62
62
  "babel-plugin-named-asset-import": "^0.3.1",
@@ -73,7 +73,7 @@
73
73
  "webpack": "4"
74
74
  },
75
75
  "devDependencies": {
76
- "@storybook/client-api": "6.4.0-beta.7",
76
+ "@storybook/client-api": "6.4.0-rc.1",
77
77
  "@types/node": "^14.14.20",
78
78
  "@types/prompts": "^2.0.9"
79
79
  },
@@ -96,6 +96,6 @@
96
96
  "publishConfig": {
97
97
  "access": "public"
98
98
  },
99
- "gitHead": "5c16acd21a956f16a7b24900a9bf38b674646217",
99
+ "gitHead": "0d79fcc7dd9f8d949c2644aefb54e77a3f932db4",
100
100
  "sbmodern": "dist/modern/client/index.js"
101
101
  }
package/preset.js CHANGED
@@ -1,7 +1 @@
1
- function config(entry = []) {
2
- return [...entry, require.resolve('./dist/esm/client/preview/config')];
3
- }
4
-
5
- module.exports = {
6
- config,
7
- };
1
+ module.exports = require('./dist/cjs/server/preset');
package/types-7-0.d.ts ADDED
@@ -0,0 +1 @@
1
+ export * from './dist/ts3.9/client/preview/types-7-0.d';