@storybook/addon-docs 6.3.0 → 6.3.4

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.
@@ -7,5 +7,19 @@ exports.DocsContext = void 0;
7
7
 
8
8
  var _react = require("react");
9
9
 
10
- var DocsContext = /*#__PURE__*/(0, _react.createContext)({});
10
+ var _global = require("global");
11
+
12
+ // We add DocsContext to window. The reason is that in case DocsContext.ts is
13
+ // imported multiple times (maybe once directly, and another time from a minified bundle)
14
+ // we will have multiple DocsContext definitions - leading to lost context in
15
+ // the React component tree.
16
+ // This was specifically a problem with the Vite builder.
17
+
18
+ /* eslint-disable no-underscore-dangle */
19
+ if (_global.window.__DOCS_CONTEXT__ === undefined) {
20
+ _global.window.__DOCS_CONTEXT__ = /*#__PURE__*/(0, _react.createContext)({});
21
+ _global.window.__DOCS_CONTEXT__.displayName = 'DocsContext';
22
+ }
23
+
24
+ var DocsContext = _global.window.__DOCS_CONTEXT__;
11
25
  exports.DocsContext = DocsContext;
@@ -179,7 +179,7 @@ var displaySignature = function displaySignature(item) {
179
179
  var extractTypeFromValue = function extractTypeFromValue(defaultValue) {
180
180
  var valueType = _typeof(defaultValue);
181
181
 
182
- return defaultValue || valueType === 'boolean' || valueType === 'string' ? valueType : null;
182
+ return defaultValue || valueType === 'number' || valueType === 'boolean' || valueType === 'string' ? valueType : null;
183
183
  };
184
184
 
185
185
  var extractEnumValues = function extractEnumValues(compodocType) {
@@ -57,7 +57,7 @@ var createArgTypes = function createArgTypes(docgen) {
57
57
  description: item.description,
58
58
  type: {
59
59
  required: hasKeyword('required', item.keywords),
60
- summary: (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text
60
+ name: (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text
61
61
  },
62
62
  table: {
63
63
  type: {
@@ -1,2 +1,16 @@
1
1
  import { createContext } from 'react';
2
- export var DocsContext = /*#__PURE__*/createContext({});
2
+ import { window as globalWindow } from 'global';
3
+
4
+ // We add DocsContext to window. The reason is that in case DocsContext.ts is
5
+ // imported multiple times (maybe once directly, and another time from a minified bundle)
6
+ // we will have multiple DocsContext definitions - leading to lost context in
7
+ // the React component tree.
8
+ // This was specifically a problem with the Vite builder.
9
+
10
+ /* eslint-disable no-underscore-dangle */
11
+ if (globalWindow.__DOCS_CONTEXT__ === undefined) {
12
+ globalWindow.__DOCS_CONTEXT__ = /*#__PURE__*/createContext({});
13
+ globalWindow.__DOCS_CONTEXT__.displayName = 'DocsContext';
14
+ }
15
+
16
+ export var DocsContext = globalWindow.__DOCS_CONTEXT__;
@@ -142,7 +142,7 @@ var displaySignature = function displaySignature(item) {
142
142
  var extractTypeFromValue = function extractTypeFromValue(defaultValue) {
143
143
  var valueType = _typeof(defaultValue);
144
144
 
145
- return defaultValue || valueType === 'boolean' || valueType === 'string' ? valueType : null;
145
+ return defaultValue || valueType === 'number' || valueType === 'boolean' || valueType === 'string' ? valueType : null;
146
146
  };
147
147
 
148
148
  var extractEnumValues = function extractEnumValues(compodocType) {
@@ -39,7 +39,7 @@ export var createArgTypes = function createArgTypes(docgen) {
39
39
  description: item.description,
40
40
  type: {
41
41
  required: hasKeyword('required', item.keywords),
42
- summary: (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text
42
+ name: (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text
43
43
  },
44
44
  table: {
45
45
  type: {
@@ -1,2 +1,16 @@
1
1
  import { createContext } from 'react';
2
- export const DocsContext = /*#__PURE__*/createContext({});
2
+ import { window as globalWindow } from 'global';
3
+
4
+ // We add DocsContext to window. The reason is that in case DocsContext.ts is
5
+ // imported multiple times (maybe once directly, and another time from a minified bundle)
6
+ // we will have multiple DocsContext definitions - leading to lost context in
7
+ // the React component tree.
8
+ // This was specifically a problem with the Vite builder.
9
+
10
+ /* eslint-disable no-underscore-dangle */
11
+ if (globalWindow.__DOCS_CONTEXT__ === undefined) {
12
+ globalWindow.__DOCS_CONTEXT__ = /*#__PURE__*/createContext({});
13
+ globalWindow.__DOCS_CONTEXT__.displayName = 'DocsContext';
14
+ }
15
+
16
+ export const DocsContext = globalWindow.__DOCS_CONTEXT__;
@@ -103,7 +103,7 @@ const displaySignature = item => {
103
103
 
104
104
  const extractTypeFromValue = defaultValue => {
105
105
  const valueType = typeof defaultValue;
106
- return defaultValue || valueType === 'boolean' || valueType === 'string' ? valueType : null;
106
+ return defaultValue || valueType === 'number' || valueType === 'boolean' || valueType === 'string' ? valueType : null;
107
107
  };
108
108
 
109
109
  const extractEnumValues = compodocType => {
@@ -29,7 +29,7 @@ export const createArgTypes = docgen => {
29
29
  description: item.description,
30
30
  type: {
31
31
  required: hasKeyword('required', item.keywords),
32
- summary: (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text
32
+ name: (_item$type = item.type) === null || _item$type === void 0 ? void 0 : _item$type.text
33
33
  },
34
34
  table: {
35
35
  type: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-docs",
3
- "version": "6.3.0",
3
+ "version": "6.3.4",
4
4
  "description": "Document component usage and properties in Markdown",
5
5
  "keywords": [
6
6
  "addon",
@@ -10,7 +10,7 @@
10
10
  "essentials",
11
11
  "organize"
12
12
  ],
13
- "homepage": "https://github.com/storybookjs/storybook/tree/master/addons/docs",
13
+ "homepage": "https://github.com/storybookjs/storybook/tree/main/addons/docs",
14
14
  "bugs": {
15
15
  "url": "https://github.com/storybookjs/storybook/issues"
16
16
  },
@@ -63,20 +63,20 @@
63
63
  "@mdx-js/loader": "^1.6.22",
64
64
  "@mdx-js/mdx": "^1.6.22",
65
65
  "@mdx-js/react": "^1.6.22",
66
- "@storybook/addons": "6.3.0",
67
- "@storybook/api": "6.3.0",
68
- "@storybook/builder-webpack4": "6.3.0",
69
- "@storybook/client-api": "6.3.0",
70
- "@storybook/client-logger": "6.3.0",
71
- "@storybook/components": "6.3.0",
72
- "@storybook/core": "6.3.0",
73
- "@storybook/core-events": "6.3.0",
66
+ "@storybook/addons": "6.3.4",
67
+ "@storybook/api": "6.3.4",
68
+ "@storybook/builder-webpack4": "6.3.4",
69
+ "@storybook/client-api": "6.3.4",
70
+ "@storybook/client-logger": "6.3.4",
71
+ "@storybook/components": "6.3.4",
72
+ "@storybook/core": "6.3.4",
73
+ "@storybook/core-events": "6.3.4",
74
74
  "@storybook/csf": "0.0.1",
75
- "@storybook/csf-tools": "6.3.0",
76
- "@storybook/node-logger": "6.3.0",
77
- "@storybook/postinstall": "6.3.0",
78
- "@storybook/source-loader": "6.3.0",
79
- "@storybook/theming": "6.3.0",
75
+ "@storybook/csf-tools": "6.3.4",
76
+ "@storybook/node-logger": "6.3.4",
77
+ "@storybook/postinstall": "6.3.4",
78
+ "@storybook/source-loader": "6.3.4",
79
+ "@storybook/theming": "6.3.4",
80
80
  "acorn": "^7.4.1",
81
81
  "acorn-jsx": "^5.3.1",
82
82
  "acorn-walk": "^7.2.0",
@@ -104,10 +104,10 @@
104
104
  "@babel/core": "^7.12.10",
105
105
  "@emotion/core": "^10.1.1",
106
106
  "@emotion/styled": "^10.0.27",
107
- "@storybook/angular": "6.3.0",
108
- "@storybook/react": "6.3.0",
109
- "@storybook/vue": "6.3.0",
110
- "@storybook/web-components": "6.3.0",
107
+ "@storybook/angular": "6.3.4",
108
+ "@storybook/react": "6.3.4",
109
+ "@storybook/vue": "6.3.4",
110
+ "@storybook/web-components": "6.3.4",
111
111
  "@types/cross-spawn": "^6.0.2",
112
112
  "@types/doctrine": "^0.0.3",
113
113
  "@types/enzyme": "^3.10.8",
@@ -137,10 +137,10 @@
137
137
  "zone.js": "^0.11.3"
138
138
  },
139
139
  "peerDependencies": {
140
- "@storybook/angular": "6.3.0",
141
- "@storybook/vue": "6.3.0",
142
- "@storybook/vue3": "6.3.0",
143
- "@storybook/web-components": "6.3.0",
140
+ "@storybook/angular": "6.3.4",
141
+ "@storybook/vue": "6.3.4",
142
+ "@storybook/vue3": "6.3.4",
143
+ "@storybook/web-components": "6.3.4",
144
144
  "lit": "^2.0.0-rc.1",
145
145
  "lit-html": "^1.4.1 || ^2.0.0-rc.3",
146
146
  "react": "^16.8.0 || ^17.0.0",
@@ -191,7 +191,7 @@
191
191
  "publishConfig": {
192
192
  "access": "public"
193
193
  },
194
- "gitHead": "9a381339dee8faf13933265cf2600577ca2c20e8",
194
+ "gitHead": "b6fd5c62b15188baca1c1b9b8f71df6098a510ef",
195
195
  "sbmodern": "dist/modern/index.js",
196
196
  "storybook": {
197
197
  "displayName": "Docs",