@storybook/addon-backgrounds 6.5.0-alpha.9 → 6.5.0-beta.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/cjs/constants.js +1 -1
- package/dist/cjs/containers/BackgroundSelector.js +9 -7
- package/dist/cjs/containers/GridSelector.js +8 -6
- package/dist/cjs/decorators/withBackground.js +2 -2
- package/dist/cjs/helpers/index.js +3 -1
- package/dist/cjs/manager.js +53 -0
- package/dist/cjs/{preset/addParameter.js → preview.js} +8 -1
- package/dist/cjs/types/index.js +5 -1
- package/dist/esm/containers/BackgroundSelector.js +4 -3
- package/dist/esm/containers/GridSelector.js +3 -2
- package/dist/esm/decorators/withBackground.js +1 -1
- package/dist/esm/helpers/index.js +1 -0
- package/dist/esm/{register.js → manager.js} +1 -1
- package/dist/esm/{preset/addParameter.js → preview.js} +3 -0
- package/dist/esm/types/index.js +1 -0
- package/dist/modern/{register.js → manager.js} +0 -0
- package/dist/modern/{preset/addParameter.js → preview.js} +3 -0
- package/dist/modern/types/index.js +1 -0
- package/dist/ts3.4/components/ColorIcon.d.ts +1 -2
- package/dist/ts3.4/{register.d.ts → manager.d.ts} +0 -0
- package/dist/{ts3.9/preset/addDecorator.d.ts → ts3.4/preview.d.ts} +14 -1
- package/dist/ts3.9/components/ColorIcon.d.ts +1 -2
- package/dist/ts3.9/decorators/withBackground.d.ts +1 -1
- package/dist/ts3.9/decorators/withGrid.d.ts +1 -1
- package/dist/ts3.9/{register.d.ts → manager.d.ts} +0 -0
- package/dist/{ts3.4/preset/addDecorator.d.ts → ts3.9/preview.d.ts} +14 -1
- package/manager.js +1 -0
- package/package.json +11 -11
- package/preview.js +1 -0
- package/register.js +6 -1
- package/dist/cjs/decorators/index.js +0 -35
- package/dist/cjs/preset/addDecorator.js +0 -11
- package/dist/cjs/register.js +0 -53
- package/dist/cjs/typings.d.js +0 -1
- package/dist/esm/decorators/index.js +0 -2
- package/dist/esm/preset/addDecorator.js +0 -2
- package/dist/esm/typings.d.js +0 -0
- package/dist/modern/decorators/index.js +0 -2
- package/dist/modern/preset/addDecorator.js +0 -2
- package/dist/modern/typings.d.js +0 -0
- package/dist/ts3.4/decorators/index.d.ts +0 -2
- package/dist/ts3.4/preset/addParameter.d.ts +0 -13
- package/dist/ts3.9/decorators/index.d.ts +0 -2
- package/dist/ts3.9/preset/addParameter.d.ts +0 -13
- package/preset.js +0 -16
package/dist/cjs/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.PARAM_KEY = exports.GRID_PARAM_KEY = exports.EVENTS = exports.ADDON_ID = void 0;
|
|
7
7
|
var ADDON_ID = 'storybook/background';
|
|
8
8
|
exports.ADDON_ID = ADDON_ID;
|
|
9
9
|
var PARAM_KEY = 'backgrounds';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
require("core-js/modules/es.symbol.js");
|
|
6
6
|
|
|
@@ -14,6 +14,8 @@ require("core-js/modules/es.array.from.js");
|
|
|
14
14
|
|
|
15
15
|
require("core-js/modules/es.array.slice.js");
|
|
16
16
|
|
|
17
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
18
|
+
|
|
17
19
|
require("core-js/modules/es.weak-map.js");
|
|
18
20
|
|
|
19
21
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
@@ -29,10 +31,10 @@ require("core-js/modules/es.function.name.js");
|
|
|
29
31
|
|
|
30
32
|
require("core-js/modules/es.array.concat.js");
|
|
31
33
|
|
|
32
|
-
require("core-js/modules/es.object.to-string.js");
|
|
33
|
-
|
|
34
34
|
require("core-js/modules/es.array.iterator.js");
|
|
35
35
|
|
|
36
|
+
require("core-js/modules/es.object.to-string.js");
|
|
37
|
+
|
|
36
38
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
37
39
|
|
|
38
40
|
require("core-js/modules/es.object.assign.js");
|
|
@@ -55,9 +57,9 @@ var _helpers = require("../helpers");
|
|
|
55
57
|
|
|
56
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
57
59
|
|
|
58
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
60
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
59
61
|
|
|
60
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
62
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
61
63
|
|
|
62
64
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
63
65
|
|
|
@@ -65,7 +67,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
65
67
|
|
|
66
68
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
67
69
|
|
|
68
|
-
function _iterableToArrayLimit(arr, i) {
|
|
70
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
69
71
|
|
|
70
72
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
71
73
|
|
|
@@ -75,7 +77,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
75
77
|
|
|
76
78
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
77
79
|
|
|
78
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
80
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
79
81
|
|
|
80
82
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
81
83
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
4
|
|
|
5
5
|
require("core-js/modules/es.symbol.js");
|
|
6
6
|
|
|
@@ -10,10 +10,10 @@ require("core-js/modules/es.object.to-string.js");
|
|
|
10
10
|
|
|
11
11
|
require("core-js/modules/es.symbol.iterator.js");
|
|
12
12
|
|
|
13
|
-
require("core-js/modules/es.string.iterator.js");
|
|
14
|
-
|
|
15
13
|
require("core-js/modules/es.array.iterator.js");
|
|
16
14
|
|
|
15
|
+
require("core-js/modules/es.string.iterator.js");
|
|
16
|
+
|
|
17
17
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
18
18
|
|
|
19
19
|
require("core-js/modules/es.array.slice.js");
|
|
@@ -22,6 +22,8 @@ require("core-js/modules/es.function.name.js");
|
|
|
22
22
|
|
|
23
23
|
require("core-js/modules/es.array.from.js");
|
|
24
24
|
|
|
25
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
26
|
+
|
|
25
27
|
require("core-js/modules/es.weak-map.js");
|
|
26
28
|
|
|
27
29
|
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
@@ -41,9 +43,9 @@ var _components = require("@storybook/components");
|
|
|
41
43
|
|
|
42
44
|
var _constants = require("../constants");
|
|
43
45
|
|
|
44
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var
|
|
46
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
45
47
|
|
|
46
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
48
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
47
49
|
|
|
48
50
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
49
51
|
|
|
@@ -55,7 +57,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
55
57
|
|
|
56
58
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
57
59
|
|
|
58
|
-
function _iterableToArrayLimit(arr, i) {
|
|
60
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
59
61
|
|
|
60
62
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
61
63
|
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.withBackground = void 0;
|
|
7
7
|
|
|
8
|
-
require("core-js/modules/es.object.to-string.js");
|
|
9
|
-
|
|
10
8
|
require("core-js/modules/es.array.iterator.js");
|
|
11
9
|
|
|
10
|
+
require("core-js/modules/es.object.to-string.js");
|
|
11
|
+
|
|
12
12
|
require("core-js/modules/web.dom-collections.iterator.js");
|
|
13
13
|
|
|
14
14
|
require("core-js/modules/es.array.concat.js");
|
|
@@ -7,10 +7,12 @@ require("core-js/modules/es.object.freeze.js");
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.isReduceMotionEnabled = exports.getBackgroundColorByName = exports.clearStyles = exports.addGridStyle = exports.addBackgroundStyle = void 0;
|
|
11
11
|
|
|
12
12
|
require("core-js/modules/es.array.find.js");
|
|
13
13
|
|
|
14
|
+
require("core-js/modules/es.object.to-string.js");
|
|
15
|
+
|
|
14
16
|
require("core-js/modules/es.function.name.js");
|
|
15
17
|
|
|
16
18
|
require("core-js/modules/es.array.join.js");
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.array.iterator.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.object.to-string.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.string.iterator.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/es.weak-map.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/web.dom-collections.iterator.js");
|
|
14
|
+
|
|
15
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
+
|
|
17
|
+
require("core-js/modules/es.symbol.js");
|
|
18
|
+
|
|
19
|
+
require("core-js/modules/es.symbol.description.js");
|
|
20
|
+
|
|
21
|
+
require("core-js/modules/es.symbol.iterator.js");
|
|
22
|
+
|
|
23
|
+
require("core-js/modules/es.regexp.exec.js");
|
|
24
|
+
|
|
25
|
+
require("core-js/modules/es.string.match.js");
|
|
26
|
+
|
|
27
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
28
|
+
|
|
29
|
+
var _addons = require("@storybook/addons");
|
|
30
|
+
|
|
31
|
+
var _constants = require("./constants");
|
|
32
|
+
|
|
33
|
+
var _BackgroundSelector = require("./containers/BackgroundSelector");
|
|
34
|
+
|
|
35
|
+
var _GridSelector = require("./containers/GridSelector");
|
|
36
|
+
|
|
37
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
38
|
+
|
|
39
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
40
|
+
|
|
41
|
+
_addons.addons.register(_constants.ADDON_ID, function () {
|
|
42
|
+
_addons.addons.add(_constants.ADDON_ID, {
|
|
43
|
+
title: 'Backgrounds',
|
|
44
|
+
type: _addons.types.TOOL,
|
|
45
|
+
match: function match(_ref) {
|
|
46
|
+
var viewMode = _ref.viewMode;
|
|
47
|
+
return !!(viewMode && viewMode.match(/^(story|docs)$/));
|
|
48
|
+
},
|
|
49
|
+
render: function render() {
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_BackgroundSelector.BackgroundSelector, null), /*#__PURE__*/_react.default.createElement(_GridSelector.GridSelector, null));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.parameters = void 0;
|
|
6
|
+
exports.parameters = exports.decorators = void 0;
|
|
7
|
+
|
|
8
|
+
var _withBackground = require("./decorators/withBackground");
|
|
9
|
+
|
|
10
|
+
var _withGrid = require("./decorators/withGrid");
|
|
11
|
+
|
|
12
|
+
var decorators = [_withGrid.withGrid, _withBackground.withBackground];
|
|
13
|
+
exports.decorators = decorators;
|
|
7
14
|
var parameters = {
|
|
8
15
|
backgrounds: {
|
|
9
16
|
grid: {
|
package/dist/cjs/types/index.js
CHANGED
|
@@ -4,7 +4,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
4
4
|
|
|
5
5
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
6
|
|
|
7
|
-
function _iterableToArrayLimit(arr, i) {
|
|
7
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
8
8
|
|
|
9
9
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
10
10
|
|
|
@@ -14,7 +14,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
14
14
|
|
|
15
15
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
16
|
|
|
17
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator
|
|
17
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
18
|
|
|
19
19
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
20
20
|
|
|
@@ -23,8 +23,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
23
23
|
import "core-js/modules/es.array.map.js";
|
|
24
24
|
import "core-js/modules/es.function.name.js";
|
|
25
25
|
import "core-js/modules/es.array.concat.js";
|
|
26
|
-
import "core-js/modules/es.object.to-string.js";
|
|
27
26
|
import "core-js/modules/es.array.iterator.js";
|
|
27
|
+
import "core-js/modules/es.object.to-string.js";
|
|
28
28
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
29
29
|
import "core-js/modules/es.object.assign.js";
|
|
30
30
|
import "core-js/modules/es.symbol.js";
|
|
@@ -33,6 +33,7 @@ import "core-js/modules/es.symbol.iterator.js";
|
|
|
33
33
|
import "core-js/modules/es.string.iterator.js";
|
|
34
34
|
import "core-js/modules/es.array.from.js";
|
|
35
35
|
import "core-js/modules/es.array.slice.js";
|
|
36
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
36
37
|
import React, { Fragment, useCallback, useMemo, memo } from 'react';
|
|
37
38
|
import memoize from 'memoizerific';
|
|
38
39
|
import { useParameter, useGlobals } from '@storybook/api';
|
|
@@ -5,12 +5,13 @@ import "core-js/modules/es.symbol.js";
|
|
|
5
5
|
import "core-js/modules/es.symbol.description.js";
|
|
6
6
|
import "core-js/modules/es.object.to-string.js";
|
|
7
7
|
import "core-js/modules/es.symbol.iterator.js";
|
|
8
|
-
import "core-js/modules/es.string.iterator.js";
|
|
9
8
|
import "core-js/modules/es.array.iterator.js";
|
|
9
|
+
import "core-js/modules/es.string.iterator.js";
|
|
10
10
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
11
11
|
import "core-js/modules/es.array.slice.js";
|
|
12
12
|
import "core-js/modules/es.function.name.js";
|
|
13
13
|
import "core-js/modules/es.array.from.js";
|
|
14
|
+
import "core-js/modules/es.regexp.exec.js";
|
|
14
15
|
|
|
15
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
17
|
|
|
@@ -20,7 +21,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
20
21
|
|
|
21
22
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
22
23
|
|
|
23
|
-
function _iterableToArrayLimit(arr, i) {
|
|
24
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
24
25
|
|
|
25
26
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
27
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "core-js/modules/es.object.to-string.js";
|
|
2
1
|
import "core-js/modules/es.array.iterator.js";
|
|
2
|
+
import "core-js/modules/es.object.to-string.js";
|
|
3
3
|
import "core-js/modules/web.dom-collections.iterator.js";
|
|
4
4
|
import "core-js/modules/es.array.concat.js";
|
|
5
5
|
import { useMemo, useEffect } from '@storybook/addons';
|
|
@@ -6,6 +6,7 @@ var _templateObject;
|
|
|
6
6
|
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
7
7
|
|
|
8
8
|
import "core-js/modules/es.array.find.js";
|
|
9
|
+
import "core-js/modules/es.object.to-string.js";
|
|
9
10
|
import "core-js/modules/es.function.name.js";
|
|
10
11
|
import "core-js/modules/es.array.join.js";
|
|
11
12
|
import "core-js/modules/es.array.map.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "core-js/modules/es.string.match.js";
|
|
2
1
|
import "core-js/modules/es.regexp.exec.js";
|
|
2
|
+
import "core-js/modules/es.string.match.js";
|
|
3
3
|
import React, { Fragment } from 'react';
|
|
4
4
|
import { addons, types } from '@storybook/addons';
|
|
5
5
|
import { ADDON_ID } from './constants';
|
package/dist/esm/types/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ColorIcon: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
1
|
+
export declare const ColorIcon: import("@storybook/theming").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
3
2
|
background: string;
|
|
4
3
|
}, import("@storybook/theming").Theme>;
|
|
File without changes
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
export declare const decorators: ((StoryFn: import("@storybook/csf").PartialStoryFn<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>, context: import("@storybook/csf").StoryContext<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>) => unknown)[];
|
|
1
|
+
export declare const decorators: ((StoryFn: import("@storybook/csf").PartialStoryFn<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>, context: import("@storybook/csf").StoryContext<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>) => unknown)[];
|
|
2
|
+
export declare const parameters: {
|
|
3
|
+
backgrounds: {
|
|
4
|
+
grid: {
|
|
5
|
+
cellSize: number;
|
|
6
|
+
opacity: number;
|
|
7
|
+
cellAmount: number;
|
|
8
|
+
};
|
|
9
|
+
values: {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const ColorIcon: import("@emotion/styled-base").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
1
|
+
export declare const ColorIcon: import("@storybook/theming").StyledComponent<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {
|
|
3
2
|
background: string;
|
|
4
3
|
}, import("@storybook/theming").Theme>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';
|
|
1
|
+
import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';
|
|
2
2
|
export declare const withBackground: (StoryFn: StoryFunction<AnyFramework>, context: StoryContext<AnyFramework>) => unknown;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';
|
|
1
|
+
import type { AnyFramework, PartialStoryFn as StoryFunction, StoryContext } from '@storybook/csf';
|
|
2
2
|
export declare const withGrid: (StoryFn: StoryFunction<AnyFramework>, context: StoryContext<AnyFramework>) => unknown;
|
|
File without changes
|
|
@@ -1 +1,14 @@
|
|
|
1
|
-
export declare const decorators: ((StoryFn: import("@storybook/csf").PartialStoryFn<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>, context: import("@storybook/csf").StoryContext<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>) => unknown)[];
|
|
1
|
+
export declare const decorators: ((StoryFn: import("@storybook/csf").PartialStoryFn<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>, context: import("@storybook/csf").StoryContext<import("@storybook/csf").AnyFramework, import("@storybook/csf").Args>) => unknown)[];
|
|
2
|
+
export declare const parameters: {
|
|
3
|
+
backgrounds: {
|
|
4
|
+
grid: {
|
|
5
|
+
cellSize: number;
|
|
6
|
+
opacity: number;
|
|
7
|
+
cellAmount: number;
|
|
8
|
+
};
|
|
9
|
+
values: {
|
|
10
|
+
name: string;
|
|
11
|
+
value: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
};
|
package/manager.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './dist/esm/manager';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/addon-backgrounds",
|
|
3
|
-
"version": "6.5.0-
|
|
3
|
+
"version": "6.5.0-beta.2",
|
|
4
4
|
"description": "Switch backgrounds to view components in different settings",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"addon",
|
|
@@ -45,13 +45,13 @@
|
|
|
45
45
|
"prepare": "node ../../scripts/prepare.js"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@storybook/addons": "6.5.0-
|
|
49
|
-
"@storybook/api": "6.5.0-
|
|
50
|
-
"@storybook/client-logger": "6.5.0-
|
|
51
|
-
"@storybook/components": "6.5.0-
|
|
52
|
-
"@storybook/core-events": "6.5.0-
|
|
53
|
-
"@storybook/csf": "0.0.2--canary.
|
|
54
|
-
"@storybook/theming": "6.5.0-
|
|
48
|
+
"@storybook/addons": "6.5.0-beta.2",
|
|
49
|
+
"@storybook/api": "6.5.0-beta.2",
|
|
50
|
+
"@storybook/client-logger": "6.5.0-beta.2",
|
|
51
|
+
"@storybook/components": "6.5.0-beta.2",
|
|
52
|
+
"@storybook/core-events": "6.5.0-beta.2",
|
|
53
|
+
"@storybook/csf": "0.0.2--canary.4566f4d.1",
|
|
54
|
+
"@storybook/theming": "6.5.0-beta.2",
|
|
55
55
|
"core-js": "^3.8.2",
|
|
56
56
|
"global": "^4.4.0",
|
|
57
57
|
"memoizerific": "^1.11.3",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"@types/webpack-env": "^1.16.0"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
|
-
"react": "^16.8.0 || ^17.0.0",
|
|
67
|
-
"react-dom": "^16.8.0 || ^17.0.0"
|
|
66
|
+
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
|
67
|
+
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependenciesMeta": {
|
|
70
70
|
"react": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "b42ccab2b3f9d4f1f8f862242a5e4af0d3306061",
|
|
81
81
|
"sbmodern": "dist/modern/index.js",
|
|
82
82
|
"storybook": {
|
|
83
83
|
"displayName": "Backgrounds",
|
package/preview.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/esm/preview';
|
package/register.js
CHANGED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
require("core-js/modules/web.dom-collections.for-each.js");
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.object.keys.js");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
var _withBackground = require("./withBackground");
|
|
12
|
-
|
|
13
|
-
Object.keys(_withBackground).forEach(function (key) {
|
|
14
|
-
if (key === "default" || key === "__esModule") return;
|
|
15
|
-
if (key in exports && exports[key] === _withBackground[key]) return;
|
|
16
|
-
Object.defineProperty(exports, key, {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function get() {
|
|
19
|
-
return _withBackground[key];
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
var _withGrid = require("./withGrid");
|
|
25
|
-
|
|
26
|
-
Object.keys(_withGrid).forEach(function (key) {
|
|
27
|
-
if (key === "default" || key === "__esModule") return;
|
|
28
|
-
if (key in exports && exports[key] === _withGrid[key]) return;
|
|
29
|
-
Object.defineProperty(exports, key, {
|
|
30
|
-
enumerable: true,
|
|
31
|
-
get: function get() {
|
|
32
|
-
return _withGrid[key];
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.decorators = void 0;
|
|
7
|
-
|
|
8
|
-
var _decorators = require("../decorators");
|
|
9
|
-
|
|
10
|
-
var decorators = [_decorators.withGrid, _decorators.withBackground];
|
|
11
|
-
exports.decorators = decorators;
|
package/dist/cjs/register.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
require("core-js/modules/es.weak-map.js");
|
|
6
|
-
|
|
7
|
-
require("core-js/modules/es.object.to-string.js");
|
|
8
|
-
|
|
9
|
-
require("core-js/modules/es.string.iterator.js");
|
|
10
|
-
|
|
11
|
-
require("core-js/modules/es.array.iterator.js");
|
|
12
|
-
|
|
13
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
14
|
-
|
|
15
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
16
|
-
|
|
17
|
-
require("core-js/modules/es.symbol.js");
|
|
18
|
-
|
|
19
|
-
require("core-js/modules/es.symbol.description.js");
|
|
20
|
-
|
|
21
|
-
require("core-js/modules/es.symbol.iterator.js");
|
|
22
|
-
|
|
23
|
-
require("core-js/modules/es.string.match.js");
|
|
24
|
-
|
|
25
|
-
require("core-js/modules/es.regexp.exec.js");
|
|
26
|
-
|
|
27
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
28
|
-
|
|
29
|
-
var _addons = require("@storybook/addons");
|
|
30
|
-
|
|
31
|
-
var _constants = require("./constants");
|
|
32
|
-
|
|
33
|
-
var _BackgroundSelector = require("./containers/BackgroundSelector");
|
|
34
|
-
|
|
35
|
-
var _GridSelector = require("./containers/GridSelector");
|
|
36
|
-
|
|
37
|
-
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
|
38
|
-
|
|
39
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
40
|
-
|
|
41
|
-
_addons.addons.register(_constants.ADDON_ID, function () {
|
|
42
|
-
_addons.addons.add(_constants.ADDON_ID, {
|
|
43
|
-
title: 'Backgrounds',
|
|
44
|
-
type: _addons.types.TOOL,
|
|
45
|
-
match: function match(_ref) {
|
|
46
|
-
var viewMode = _ref.viewMode;
|
|
47
|
-
return !!(viewMode && viewMode.match(/^(story|docs)$/));
|
|
48
|
-
},
|
|
49
|
-
render: function render() {
|
|
50
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_BackgroundSelector.BackgroundSelector, null), /*#__PURE__*/_react.default.createElement(_GridSelector.GridSelector, null));
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
package/dist/cjs/typings.d.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";
|
package/dist/esm/typings.d.js
DELETED
|
File without changes
|
package/dist/modern/typings.d.js
DELETED
|
File without changes
|
package/preset.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
function config(entry = []) {
|
|
2
|
-
return [
|
|
3
|
-
...entry,
|
|
4
|
-
require.resolve('./dist/esm/preset/addDecorator'),
|
|
5
|
-
require.resolve('./dist/esm/preset/addParameter'),
|
|
6
|
-
];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
function managerEntries(entry = [], options) {
|
|
10
|
-
return [...entry, require.resolve('./dist/esm/register')];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
managerEntries,
|
|
15
|
-
config,
|
|
16
|
-
};
|