@itcase/storybook-config 1.2.71 → 1.2.72
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/README.md +9 -0
- package/dist/cjs/decorators/withFigmaSourceLink.js +58 -2
- package/dist/cjs/decorators/withFormSubmitDecorator.js +1108 -1
- package/dist/cjs/decorators/withNextDecorator.js +6 -11
- package/dist/cjs/decorators/withUiDecorator.js +4 -9
- package/dist/cjs/decorators.js +3 -6
- package/dist/components/EmailTemplatePreview.js +2 -2
- package/dist/components/{FormSubmitWrapper-YokGjDrh.js → FormSubmitWrapper-CytvWwKi.js} +4 -4
- package/dist/components/FormSubmitWrapper.js +2 -2
- package/dist/components/{_rollupPluginBabelHelpers-DQ-fuxJg.js → _rollupPluginBabelHelpers-OwKVS06F.js} +1 -1
- package/dist/components/isArray-CPoGkdXv.js +43 -0
- package/dist/config/sourceLink/sourceLink.js +8 -16
- package/dist/decorators/withClearStoresDecorator.js +2 -2
- package/dist/decorators/withExtraProviders.js +2 -2
- package/dist/decorators/withFigmaSourceLink.js +61 -5
- package/dist/decorators/withFormSubmitDecorator.js +1114 -7
- package/dist/decorators/withLayoutDecorator.js +9 -9
- package/dist/decorators/withNextDecorator.js +8 -13
- package/dist/decorators/withUiDecorator.js +5 -10
- package/dist/decorators.js +5 -8
- package/dist/isArray-DJguRq_2.js +47 -0
- package/package.json +21 -15
- package/dist/Notification-Cqx2_tCE.js +0 -7945
- package/dist/components/Notification-qLYjGbKN.js +0 -7923
|
@@ -2,13 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var _rollupPluginBabelHelpers = require('../../_rollupPluginBabelHelpers-D8XyM9rZ.js');
|
|
4
4
|
var React = require('react');
|
|
5
|
-
var Notification = require('
|
|
6
|
-
require('@itcase/
|
|
7
|
-
require('lodash/camelCase');
|
|
8
|
-
require('lodash/castArray');
|
|
9
|
-
require('lodash/upperFirst');
|
|
10
|
-
require('lodash/maxBy');
|
|
11
|
-
require('react-dom');
|
|
5
|
+
var Notification = require('@itcase/ui-web/components/Notification');
|
|
6
|
+
var context = require('@itcase/ui-core/context');
|
|
12
7
|
|
|
13
8
|
var _excluded = ["storesData"];
|
|
14
9
|
function withNextDecoratorFactory(_ref) {
|
|
@@ -17,11 +12,11 @@ function withNextDecoratorFactory(_ref) {
|
|
|
17
12
|
var decorator = function decorator(Story, _ref2) {
|
|
18
13
|
var args = _ref2.args,
|
|
19
14
|
parameters = _ref2.parameters,
|
|
20
|
-
context = _ref2.context;
|
|
15
|
+
context$1 = _ref2.context;
|
|
21
16
|
var _prepareStoryArgument = prepareStoryArguments({
|
|
22
17
|
args: args,
|
|
23
18
|
parameters: parameters,
|
|
24
|
-
context: context
|
|
19
|
+
context: context$1
|
|
25
20
|
}),
|
|
26
21
|
appArgs = _prepareStoryArgument.appArgs,
|
|
27
22
|
appContext = _prepareStoryArgument.appContext,
|
|
@@ -32,9 +27,9 @@ function withNextDecoratorFactory(_ref) {
|
|
|
32
27
|
pageProps: appArgs
|
|
33
28
|
});
|
|
34
29
|
}
|
|
35
|
-
return /*#__PURE__*/React.createElement(RootStoreProvider, appArgs.rootStoreInitialData, /*#__PURE__*/React.createElement(
|
|
30
|
+
return /*#__PURE__*/React.createElement(RootStoreProvider, appArgs.rootStoreInitialData, /*#__PURE__*/React.createElement(context.UIProvider, null, /*#__PURE__*/React.createElement(context.NotificationsProvider, {
|
|
36
31
|
initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
|
|
37
|
-
}, /*#__PURE__*/React.createElement(Notification.
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Notification.NotificationWrapper, {
|
|
38
33
|
className: "notification_global notification_global_right_top"
|
|
39
34
|
}), /*#__PURE__*/React.createElement(Story, appContext))));
|
|
40
35
|
};
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
|
-
var Notification = require('
|
|
5
|
-
require('@itcase/
|
|
6
|
-
require('lodash/camelCase');
|
|
7
|
-
require('lodash/castArray');
|
|
8
|
-
require('lodash/upperFirst');
|
|
9
|
-
require('lodash/maxBy');
|
|
10
|
-
require('react-dom');
|
|
4
|
+
var Notification = require('@itcase/ui-web/components/Notification');
|
|
5
|
+
var context = require('@itcase/ui-core/context');
|
|
11
6
|
|
|
12
7
|
function withUiDecorator(Story, _ref) {
|
|
13
8
|
var args = _ref.args,
|
|
14
9
|
parameters = _ref.parameters;
|
|
15
|
-
return /*#__PURE__*/React.createElement(
|
|
10
|
+
return /*#__PURE__*/React.createElement(context.UIProvider, null, /*#__PURE__*/React.createElement(context.NotificationsProvider, {
|
|
16
11
|
initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
|
|
17
|
-
}, /*#__PURE__*/React.createElement(Notification.
|
|
12
|
+
}, /*#__PURE__*/React.createElement(Notification.NotificationWrapper, null), /*#__PURE__*/React.createElement(Story, null)));
|
|
18
13
|
}
|
|
19
14
|
|
|
20
15
|
exports.withUiDecorator = withUiDecorator;
|
package/dist/cjs/decorators.js
CHANGED
|
@@ -9,15 +9,12 @@ var withNextDecorator = require('./decorators/withNextDecorator.js');
|
|
|
9
9
|
var withUiDecorator = require('./decorators/withUiDecorator.js');
|
|
10
10
|
require('react');
|
|
11
11
|
require('../_rollupPluginBabelHelpers-D8XyM9rZ.js');
|
|
12
|
-
require('
|
|
12
|
+
require('../isArray-DJguRq_2.js');
|
|
13
13
|
require('../FormSubmitWrapper-DXUEGLuS.js');
|
|
14
|
-
require('lodash/camelCase');
|
|
15
14
|
require('@itcase/common');
|
|
16
15
|
require('msw');
|
|
17
|
-
require('
|
|
18
|
-
require('
|
|
19
|
-
require('lodash/maxBy');
|
|
20
|
-
require('react-dom');
|
|
16
|
+
require('@itcase/ui-web/components/Notification');
|
|
17
|
+
require('@itcase/ui-core/context');
|
|
21
18
|
|
|
22
19
|
|
|
23
20
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
2
|
|
|
3
3
|
var BACKEND_URL = process.env.EMAIL_URL;
|
|
4
4
|
if (process.env.NODE_ENV === 'production' && process.env.REST_BASE_URL) {
|
|
@@ -31,7 +31,7 @@ function EmailTemplatePreview(props) {
|
|
|
31
31
|
if (!BACKEND_URL) {
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
|
-
return /*#__PURE__*/
|
|
34
|
+
return /*#__PURE__*/React.createElement("iframe", {
|
|
35
35
|
id: "emailPreview",
|
|
36
36
|
width: "100%",
|
|
37
37
|
height: "100%",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { a as _asyncToGenerator, b as _regenerator, c as _objectSpread2 } from './_rollupPluginBabelHelpers-OwKVS06F.js';
|
|
2
|
+
import React, { useRef, useEffect } from 'react';
|
|
3
3
|
|
|
4
4
|
var SUBMIT_TIMEOUT_MS = 5000;
|
|
5
5
|
var SUBMIT_POLL_MS = 50;
|
|
@@ -158,7 +158,7 @@ function wrapRender(component, render, formRef) {
|
|
|
158
158
|
return function renderWithRef(storyArgs) {
|
|
159
159
|
var args = _objectSpread2({}, storyArgs !== null && storyArgs !== void 0 ? storyArgs : {});
|
|
160
160
|
delete args.ref;
|
|
161
|
-
return /*#__PURE__*/
|
|
161
|
+
return /*#__PURE__*/React.createElement(component, _objectSpread2({
|
|
162
162
|
ref: formRef
|
|
163
163
|
}, args));
|
|
164
164
|
};
|
|
@@ -178,7 +178,7 @@ function withFormRef(children, formRef, bindings) {
|
|
|
178
178
|
ref: formRef
|
|
179
179
|
}) : value;
|
|
180
180
|
};
|
|
181
|
-
return /*#__PURE__*/
|
|
181
|
+
return /*#__PURE__*/React.cloneElement(children, {
|
|
182
182
|
component: storyComponent,
|
|
183
183
|
args: addRef((_ref3 = args !== null && args !== void 0 ? args : context === null || context === void 0 ? void 0 : context.args) !== null && _ref3 !== void 0 ? _ref3 : children === null || children === void 0 || (_children$props3 = children.props) === null || _children$props3 === void 0 ? void 0 : _children$props3.args),
|
|
184
184
|
render: boundRender,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { F as FormSubmitWrapper } from './FormSubmitWrapper-
|
|
2
|
-
import './_rollupPluginBabelHelpers-
|
|
1
|
+
export { F as FormSubmitWrapper } from './FormSubmitWrapper-CytvWwKi.js';
|
|
2
|
+
import './_rollupPluginBabelHelpers-OwKVS06F.js';
|
|
3
3
|
import 'react';
|
|
@@ -195,4 +195,4 @@ function _toPropertyKey(t) {
|
|
|
195
195
|
return "symbol" == typeof i ? i : i + "";
|
|
196
196
|
}
|
|
197
197
|
|
|
198
|
-
export {
|
|
198
|
+
export { _objectWithoutProperties as _, _asyncToGenerator as a, _regenerator as b, _objectSpread2 as c };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
+
|
|
3
|
+
function getDefaultExportFromCjs (x) {
|
|
4
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Checks if `value` is classified as an `Array` object.
|
|
9
|
+
*
|
|
10
|
+
* @static
|
|
11
|
+
* @memberOf _
|
|
12
|
+
* @since 0.1.0
|
|
13
|
+
* @category Lang
|
|
14
|
+
* @param {*} value The value to check.
|
|
15
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
16
|
+
* @example
|
|
17
|
+
*
|
|
18
|
+
* _.isArray([1, 2, 3]);
|
|
19
|
+
* // => true
|
|
20
|
+
*
|
|
21
|
+
* _.isArray(document.body.children);
|
|
22
|
+
* // => false
|
|
23
|
+
*
|
|
24
|
+
* _.isArray('abc');
|
|
25
|
+
* // => false
|
|
26
|
+
*
|
|
27
|
+
* _.isArray(_.noop);
|
|
28
|
+
* // => false
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
var isArray_1;
|
|
32
|
+
var hasRequiredIsArray;
|
|
33
|
+
|
|
34
|
+
function requireIsArray () {
|
|
35
|
+
if (hasRequiredIsArray) return isArray_1;
|
|
36
|
+
hasRequiredIsArray = 1;
|
|
37
|
+
var isArray = Array.isArray;
|
|
38
|
+
|
|
39
|
+
isArray_1 = isArray;
|
|
40
|
+
return isArray_1;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { commonjsGlobal as c, getDefaultExportFromCjs as g, requireIsArray as r };
|
|
@@ -7,26 +7,18 @@ const SOURCE_LINK = {
|
|
|
7
7
|
'component-editor': ({ importPath, rootPath }) => {
|
|
8
8
|
if (!rootPath) return undefined
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const storiesFolderIndex = importPath.indexOf('/stories/')
|
|
11
|
+
const componentPath =
|
|
12
|
+
storiesFolderIndex !== -1
|
|
13
|
+
? `${importPath.slice(0, storiesFolderIndex)}/index.ts`
|
|
14
|
+
: importPath.replace(/\.stories\.(js|jsx|mjs|ts|tsx)$/, '.$1')
|
|
15
|
+
|
|
16
|
+
const fileUrl = getFileUrl(rootPath, componentPath)
|
|
14
17
|
|
|
15
|
-
if (componentFileUrl.pathname.includes('/stories')) {
|
|
16
|
-
const resultPath =
|
|
17
|
-
componentFileUrl.pathname.slice(
|
|
18
|
-
0,
|
|
19
|
-
componentFileUrl.pathname.indexOf('/stories'),
|
|
20
|
-
) + '/index.ts'
|
|
21
|
-
const resultLabelBase =
|
|
22
|
-
labelPath.slice(0, labelPath.indexOf('/stories')) + '/index.ts'
|
|
23
|
-
labelPath = resultLabelBase
|
|
24
|
-
componentFileUrl = resultPath
|
|
25
|
-
}
|
|
26
18
|
return {
|
|
27
19
|
type: 'editor',
|
|
28
20
|
label: 'VSCode — ' + componentPath,
|
|
29
|
-
href:
|
|
21
|
+
href: fileUrl.href,
|
|
30
22
|
icon: 'VSCodeIcon',
|
|
31
23
|
}
|
|
32
24
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
|
|
3
3
|
function withClearStoresDecorator(_ref) {
|
|
4
4
|
var clearStoreData = _ref.clearStoreData;
|
|
@@ -6,7 +6,7 @@ function withClearStoresDecorator(_ref) {
|
|
|
6
6
|
useMemo(function () {
|
|
7
7
|
clearStoreData();
|
|
8
8
|
}, [Story]);
|
|
9
|
-
return /*#__PURE__*/
|
|
9
|
+
return /*#__PURE__*/React.createElement(Story, null);
|
|
10
10
|
};
|
|
11
11
|
return Decorator;
|
|
12
12
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
|
|
3
3
|
function withExtraProviders() {
|
|
4
4
|
var providers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -9,7 +9,7 @@ function withExtraProviders() {
|
|
|
9
9
|
var item = providers[i];
|
|
10
10
|
var Component = item.provider;
|
|
11
11
|
var props = item.props || {};
|
|
12
|
-
currentStory = /*#__PURE__*/
|
|
12
|
+
currentStory = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Component, props, currentStory));
|
|
13
13
|
}
|
|
14
14
|
return currentStory;
|
|
15
15
|
};
|
|
@@ -1,6 +1,62 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { c as _objectSpread2 } from '../components/_rollupPluginBabelHelpers-OwKVS06F.js';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { r as requireIsArray, g as getDefaultExportFromCjs } from '../components/isArray-CPoGkdXv.js';
|
|
4
|
+
|
|
5
|
+
var castArray_1;
|
|
6
|
+
var hasRequiredCastArray;
|
|
7
|
+
|
|
8
|
+
function requireCastArray () {
|
|
9
|
+
if (hasRequiredCastArray) return castArray_1;
|
|
10
|
+
hasRequiredCastArray = 1;
|
|
11
|
+
var isArray = requireIsArray();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Casts `value` as an array if it's not one.
|
|
15
|
+
*
|
|
16
|
+
* @static
|
|
17
|
+
* @memberOf _
|
|
18
|
+
* @since 4.4.0
|
|
19
|
+
* @category Lang
|
|
20
|
+
* @param {*} value The value to inspect.
|
|
21
|
+
* @returns {Array} Returns the cast array.
|
|
22
|
+
* @example
|
|
23
|
+
*
|
|
24
|
+
* _.castArray(1);
|
|
25
|
+
* // => [1]
|
|
26
|
+
*
|
|
27
|
+
* _.castArray({ 'a': 1 });
|
|
28
|
+
* // => [{ 'a': 1 }]
|
|
29
|
+
*
|
|
30
|
+
* _.castArray('abc');
|
|
31
|
+
* // => ['abc']
|
|
32
|
+
*
|
|
33
|
+
* _.castArray(null);
|
|
34
|
+
* // => [null]
|
|
35
|
+
*
|
|
36
|
+
* _.castArray(undefined);
|
|
37
|
+
* // => [undefined]
|
|
38
|
+
*
|
|
39
|
+
* _.castArray();
|
|
40
|
+
* // => []
|
|
41
|
+
*
|
|
42
|
+
* var array = [1, 2, 3];
|
|
43
|
+
* console.log(_.castArray(array) === array);
|
|
44
|
+
* // => true
|
|
45
|
+
*/
|
|
46
|
+
function castArray() {
|
|
47
|
+
if (!arguments.length) {
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
var value = arguments[0];
|
|
51
|
+
return isArray(value) ? value : [value];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
castArray_1 = castArray;
|
|
55
|
+
return castArray_1;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
var castArrayExports = requireCastArray();
|
|
59
|
+
var castArray = /*@__PURE__*/getDefaultExportFromCjs(castArrayExports);
|
|
4
60
|
|
|
5
61
|
function withFigmaSourceLink() {
|
|
6
62
|
var decorator = function decorator(Story, _ref) {
|
|
@@ -8,7 +64,7 @@ function withFigmaSourceLink() {
|
|
|
8
64
|
context = _ref.context;
|
|
9
65
|
var sourceLink = parameters.sourceLink || {};
|
|
10
66
|
if (parameters.design) {
|
|
11
|
-
var designList =
|
|
67
|
+
var designList = castArray(parameters.design);
|
|
12
68
|
if (!sourceLink.links) {
|
|
13
69
|
sourceLink.links = {};
|
|
14
70
|
}
|
|
@@ -26,7 +82,7 @@ function withFigmaSourceLink() {
|
|
|
26
82
|
sourceLink: sourceLink
|
|
27
83
|
})
|
|
28
84
|
});
|
|
29
|
-
return /*#__PURE__*/
|
|
85
|
+
return /*#__PURE__*/React.createElement(Story, updatedContext);
|
|
30
86
|
};
|
|
31
87
|
return decorator;
|
|
32
88
|
}
|