@storybook/addons
Advanced tools
Comparing version 4.0.0-alpha.10 to 4.0.0-alpha.11
@@ -12,2 +12,6 @@ 'use strict'; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); | ||
@@ -34,2 +38,4 @@ | ||
var _components = require('@storybook/components'); | ||
var _storybookChannelMock = require('./storybook-channel-mock'); | ||
@@ -41,4 +47,3 @@ | ||
// Resolves to window in browser and to global in node | ||
exports.mockChannel = _storybookChannelMock2.default; | ||
exports.mockChannel = _storybookChannelMock2.default; // Resolves to window in browser and to global in node | ||
@@ -103,3 +108,14 @@ var AddonStore = exports.AddonStore = function () { | ||
value: function addPanel(name, panel) { | ||
this.panels[name] = panel; | ||
// supporting legacy addons, which have not migrated to the active-prop | ||
var original = panel.render; | ||
if (original && original.toString() && !original.toString().match(/active/)) { | ||
this.panels[name] = (0, _extends3.default)({}, panel, { | ||
render: function render(_ref) { | ||
var active = _ref.active; | ||
return (0, _components.TabWrapper)({ active: active, render: original }); | ||
} | ||
}); | ||
} else { | ||
this.panels[name] = panel; | ||
} | ||
} | ||
@@ -106,0 +122,0 @@ }, { |
{ | ||
"name": "@storybook/addons", | ||
"version": "4.0.0-alpha.10", | ||
"version": "4.0.0-alpha.11", | ||
"description": "Storybook addons store", | ||
@@ -23,3 +23,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@storybook/channels": "4.0.0-alpha.10", | ||
"@storybook/channels": "4.0.0-alpha.11", | ||
"@storybook/components": "4.0.0-alpha.11", | ||
"global": "^4.3.2", | ||
@@ -26,0 +27,0 @@ "util-deprecate": "^1.0.2" |
// Resolves to window in browser and to global in node | ||
import global from 'global'; | ||
import { TabWrapper } from '@storybook/components'; | ||
@@ -55,3 +56,12 @@ export mockChannel from './storybook-channel-mock'; | ||
addPanel(name, panel) { | ||
this.panels[name] = panel; | ||
// supporting legacy addons, which have not migrated to the active-prop | ||
const original = panel.render; | ||
if (original && original.toString() && !original.toString().match(/active/)) { | ||
this.panels[name] = { | ||
...panel, | ||
render: ({ active }) => TabWrapper({ active, render: original }), | ||
}; | ||
} else { | ||
this.panels[name] = panel; | ||
} | ||
} | ||
@@ -58,0 +68,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18424
428
4
+ Added@babel/code-frame@7.24.7(transitive)
+ Added@babel/generator@7.25.6(transitive)
+ Added@babel/helper-module-imports@7.24.7(transitive)
+ Added@babel/helper-string-parser@7.24.8(transitive)
+ Added@babel/helper-validator-identifier@7.24.7(transitive)
+ Added@babel/highlight@7.24.7(transitive)
+ Added@babel/parser@7.25.6(transitive)
+ Added@babel/runtime@7.25.6(transitive)
+ Added@babel/template@7.25.0(transitive)
+ Added@babel/traverse@7.25.6(transitive)
+ Added@babel/types@7.25.6(transitive)
+ Added@emotion/babel-utils@0.6.10(transitive)
+ Added@emotion/hash@0.6.6(transitive)
+ Added@emotion/is-prop-valid@0.6.8(transitive)
+ Added@emotion/memoize@0.6.6(transitive)
+ Added@emotion/serialize@0.9.1(transitive)
+ Added@emotion/stylis@0.7.1(transitive)
+ Added@emotion/unitless@0.6.7(transitive)
+ Added@emotion/utils@0.8.2(transitive)
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Added@storybook/channels@4.0.0-alpha.11(transitive)
+ Added@storybook/components@4.0.0-alpha.11(transitive)
+ Added@types/parse-json@4.0.2(transitive)
+ Addedabbrev@1.1.1(transitive)
+ Addedansi-styles@3.2.1(transitive)
+ Addedbabel-plugin-emotion@9.2.11(transitive)
+ Addedbabel-plugin-macros@2.8.0(transitive)
+ Addedbabel-plugin-syntax-jsx@6.18.0(transitive)
+ Addedbabel-runtime@6.26.0(transitive)
+ Addedcallsites@3.1.0(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedconvert-source-map@1.9.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addedcosmiconfig@6.0.0(transitive)
+ Addedcreate-emotion@9.2.12(transitive)
+ Addedcreate-emotion-styled@9.2.8(transitive)
+ Addedcsstype@2.6.21(transitive)
+ Addeddebug@4.3.7(transitive)
+ Addedemotion@9.2.12(transitive)
+ Addedemotion-theming@9.2.9(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedfind-root@1.1.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedglobals@11.12.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhoist-non-react-statics@2.5.5(transitive)
+ Addedimport-fresh@3.3.0(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-dom@1.1.0(transitive)
+ Addedis-object@1.0.2(transitive)
+ Addedis-window@1.0.2(transitive)
+ Addedjs-tokens@4.0.0(transitive)
+ Addedjsesc@2.5.2(transitive)
+ Addedjson-parse-even-better-errors@2.3.1(transitive)
+ Addedlines-and-columns@1.2.4(transitive)
+ Addedlodash.pick@4.4.0(transitive)
+ Addedlodash.throttle@4.1.1(transitive)
+ Addedloose-envify@1.4.0(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addedms@2.1.3(transitive)
+ Addednopt@1.0.10(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedparent-module@1.0.1(transitive)
+ Addedparse-json@5.2.0(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@4.0.0(transitive)
+ Addedpicocolors@1.1.0(transitive)
+ Addedprop-types@15.8.1(transitive)
+ Addedreact@16.14.018.3.1(transitive)
+ Addedreact-dom@16.14.018.3.1(transitive)
+ Addedreact-emotion@9.2.12(transitive)
+ Addedreact-inspector@2.3.1(transitive)
+ Addedreact-is@16.13.1(transitive)
+ Addedreact-lifecycles-compat@3.0.4(transitive)
+ Addedreact-split-pane@0.1.92(transitive)
+ Addedreact-style-proptype@3.2.2(transitive)
+ Addedreact-textarea-autosize@6.1.0(transitive)
+ Addedregenerator-runtime@0.11.10.14.1(transitive)
+ Addedrender-fragment@0.1.1(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedresolve-from@4.0.0(transitive)
+ Addedscheduler@0.19.10.23.2(transitive)
+ Addedsource-map@0.5.70.7.4(transitive)
+ Addedstylis@3.5.4(transitive)
+ Addedstylis-rule-sheet@0.0.10(transitive)
+ Addedsupports-color@5.5.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedto-fast-properties@2.0.0(transitive)
+ Addedtouch@2.0.2(transitive)
+ Addedyaml@1.10.2(transitive)
- Removed@storybook/channels@4.0.0-alpha.10(transitive)