@itcase/storybook-config 1.2.79 → 1.2.80

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.
Files changed (116) hide show
  1. package/dist/cjs/components/EmailTemplatePreview.js +1 -1
  2. package/dist/cjs/decorators/withFormSubmitDecorator.js +0 -1
  3. package/dist/cjs/decorators/withNextDecorator.js +1 -1
  4. package/dist/cjs/decorators/withUiDecorator.js +1 -1
  5. package/dist/cjs/decorators.js +1 -2
  6. package/dist/components/EmailTemplatePreview/index.d.ts +2 -0
  7. package/dist/components/EmailTemplatePreview/index.js +38 -0
  8. package/dist/components/EmailTemplatePreview.js +1 -1
  9. package/dist/components/FormSubmitWrapper/FormSubmitWrapper.d.ts +14 -0
  10. package/dist/components/FormSubmitWrapper/FormSubmitWrapper.js +84 -0
  11. package/dist/components/FormSubmitWrapper/autoSubmitForm.d.ts +2 -0
  12. package/dist/components/FormSubmitWrapper/autoSubmitForm.js +106 -0
  13. package/dist/components/FormSubmitWrapper/index.d.ts +2 -0
  14. package/dist/components/FormSubmitWrapper/index.js +2 -0
  15. package/dist/config/addons/addonThemes.d.ts +15 -0
  16. package/dist/config/addons/addonThemes.js +14 -15
  17. package/dist/config/addons/addonsNextJs.d.ts +2 -0
  18. package/dist/config/addons/addonsNextJs.js +8 -9
  19. package/dist/config/addons/addonsReactNative.d.ts +2 -0
  20. package/dist/config/addons/addonsReactNative.js +6 -7
  21. package/dist/config/addons/addonsReactNativeWeb.d.ts +2 -0
  22. package/dist/config/addons/addonsReactNativeWeb.js +2 -3
  23. package/dist/config/addons/addonsVite.d.ts +2 -0
  24. package/dist/config/addons/addonsVite.js +8 -9
  25. package/dist/config/addons/addonsWebpack.d.ts +18 -0
  26. package/dist/config/addons/addonsWebpack.js +26 -27
  27. package/dist/config/appearance/appearance.d.ts +1 -0
  28. package/dist/config/appearance/appearance.js +1 -1
  29. package/dist/config/backgrounds/backgrounds.d.ts +23 -0
  30. package/dist/config/backgrounds/backgrounds.js +22 -24
  31. package/dist/config/code/code.d.ts +8 -0
  32. package/dist/config/code/code.js +18 -22
  33. package/dist/config/config/mainConfigNextJsVite.d.ts +10 -0
  34. package/dist/config/config/mainConfigNextJsVite.js +35 -38
  35. package/dist/config/config/mainConfigReactNative.d.ts +9 -0
  36. package/dist/config/config/mainConfigReactNative.js +21 -23
  37. package/dist/config/config/mainConfigReactNativeWeb.d.ts +23 -0
  38. package/dist/config/config/mainConfigReactNativeWeb.js +42 -46
  39. package/dist/config/config/mainConfigVite.d.ts +9 -0
  40. package/dist/config/config/mainConfigVite.js +75 -80
  41. package/dist/config/config/mainConfigWebpack.d.ts +9 -0
  42. package/dist/config/config/mainConfigWebpack.js +39 -64
  43. package/dist/config/framework/frameworkNextJs.d.ts +4 -0
  44. package/dist/config/framework/frameworkNextJs.js +3 -4
  45. package/dist/config/framework/frameworkNextJsVite.d.ts +4 -0
  46. package/dist/config/framework/frameworkNextJsVite.js +3 -4
  47. package/dist/config/framework/frameworkReactNative.d.ts +4 -0
  48. package/dist/config/framework/frameworkReactNative.js +3 -4
  49. package/dist/config/framework/frameworkReactNativeWeb.d.ts +4 -0
  50. package/dist/config/framework/frameworkReactNativeWeb.js +3 -4
  51. package/dist/config/framework/frameworkVite.d.ts +4 -0
  52. package/dist/config/framework/frameworkVite.js +3 -4
  53. package/dist/config/framework/frameworkWebpack.d.ts +11 -0
  54. package/dist/config/framework/frameworkWebpack.js +9 -10
  55. package/dist/config/main/index.d.ts +26 -0
  56. package/dist/config/main/index.js +26 -53
  57. package/dist/config/msw/index.d.ts +2 -0
  58. package/dist/config/msw/index.js +2 -7
  59. package/dist/config/msw/mswHandlers.d.ts +5 -0
  60. package/dist/config/msw/mswHandlers.js +20 -24
  61. package/dist/config/ondevice/ondeviceBackgrounds.d.ts +8 -0
  62. package/dist/config/ondevice/ondeviceBackgrounds.js +8 -9
  63. package/dist/config/preview/index.d.ts +6 -0
  64. package/dist/config/preview/index.js +6 -13
  65. package/dist/config/refs/refs.d.ts +13 -0
  66. package/dist/config/refs/refs.js +12 -13
  67. package/dist/config/sourceLink/sourceLink.d.ts +35 -0
  68. package/dist/config/sourceLink/sourceLink.js +32 -36
  69. package/dist/config/static/staticDirsNextJs.d.ts +5 -0
  70. package/dist/config/static/staticDirsNextJs.js +5 -6
  71. package/dist/config/static/staticDirsReactNative.d.ts +2 -0
  72. package/dist/config/static/staticDirsReactNative.js +2 -3
  73. package/dist/config/static/staticDirsReactNativeWeb.d.ts +2 -0
  74. package/dist/config/static/staticDirsReactNativeWeb.js +2 -3
  75. package/dist/config/static/staticDirsVite.d.ts +5 -0
  76. package/dist/config/static/staticDirsVite.js +2 -3
  77. package/dist/config/static/staticDirsWebpack.d.ts +5 -0
  78. package/dist/config/static/staticDirsWebpack.js +2 -3
  79. package/dist/config/status/status.d.ts +21 -0
  80. package/dist/config/status/status.js +23 -24
  81. package/dist/config/users/authorization.d.ts +22 -0
  82. package/dist/config/users/authorization.js +6 -8
  83. package/dist/config/users/users.d.ts +18 -0
  84. package/dist/config/users/users.js +19 -21
  85. package/dist/config/viewport/viewport.d.ts +264 -0
  86. package/dist/config/viewport/viewport.js +23 -25
  87. package/dist/config/vite/getMediaProxyServerConfig.d.ts +13 -0
  88. package/dist/config/vite/getMediaProxyServerConfig.js +14 -16
  89. package/dist/decorators/index.d.ts +8 -0
  90. package/dist/decorators/index.js +8 -0
  91. package/dist/decorators/withClearStoresDecorator.d.ts +4 -0
  92. package/dist/decorators/withExtraProviders.d.ts +2 -0
  93. package/dist/decorators/withFigmaSourceLink.d.ts +5 -0
  94. package/dist/decorators/withFormSubmitDecorator.d.ts +2 -0
  95. package/dist/decorators/withFormSubmitDecorator.js +0 -1
  96. package/dist/decorators/withLayoutDecorator.d.ts +4 -0
  97. package/dist/decorators/withNextDecorator.d.ts +9 -0
  98. package/dist/decorators/withNextDecorator.js +1 -1
  99. package/dist/decorators/withUiDecorator.d.ts +5 -0
  100. package/dist/decorators/withUiDecorator.js +1 -1
  101. package/dist/decorators.js +1 -2
  102. package/dist/utils/getFigmaSourceLink.d.ts +2 -0
  103. package/dist/utils/getFigmaSourceLink.js +13 -14
  104. package/dist/utils/getStoryInfoBlocks.d.ts +2 -0
  105. package/dist/utils/getStoryInfoBlocks.js +45 -55
  106. package/dist/utils/handleMSWParameters.d.ts +8 -0
  107. package/dist/utils/handleMSWParameters.js +18 -27
  108. package/dist/utils/hasFormParameters.d.ts +2 -0
  109. package/dist/utils/hasFormParameters.js +6 -9
  110. package/dist/utils/index.d.ts +7 -0
  111. package/dist/utils/index.js +9 -17
  112. package/dist/utils/isVitestEnvironment.d.ts +2 -0
  113. package/dist/utils/isVitestEnvironment.js +2 -3
  114. package/dist/utils/storybookServerErrorOnSubmit.d.ts +2 -0
  115. package/dist/utils/storybookServerErrorOnSubmit.js +12 -19
  116. package/package.json +50 -43
@@ -0,0 +1,18 @@
1
+ declare const USERS: {
2
+ admin: {
3
+ name: string;
4
+ color: string;
5
+ token: string;
6
+ };
7
+ manager: {
8
+ name: string;
9
+ color: string;
10
+ token: string;
11
+ };
12
+ user: {
13
+ name: string;
14
+ color: string;
15
+ token: string;
16
+ };
17
+ };
18
+ export { USERS };
@@ -1,22 +1,20 @@
1
- import { DEFAULT_USERS } from '@itcase/storybook-addon-auth/defaults'
2
-
1
+ import { DEFAULT_USERS } from '@itcase/storybook-addon-auth/defaults';
3
2
  const USERS = {
4
- admin: {
5
- name: 'Admin',
6
- color: '#1EA5FC',
7
- token: process.env.ADMIN_AUTH_TOKEN,
8
- },
9
- manager: {
10
- name: 'Manager',
11
- color: '#D80E4F',
12
- token: process.env.MANAGER_AUTH_TOKEN,
13
- },
14
- user: {
15
- name: 'User',
16
- color: '#777777',
17
- token: process.env.USER_AUTH_TOKEN,
18
- },
19
- ...DEFAULT_USERS,
20
- }
21
-
22
- export { USERS }
3
+ admin: {
4
+ name: 'Admin',
5
+ color: '#1EA5FC',
6
+ token: process.env.ADMIN_AUTH_TOKEN,
7
+ },
8
+ manager: {
9
+ name: 'Manager',
10
+ color: '#D80E4F',
11
+ token: process.env.MANAGER_AUTH_TOKEN,
12
+ },
13
+ user: {
14
+ name: 'User',
15
+ color: '#777777',
16
+ token: process.env.USER_AUTH_TOKEN,
17
+ },
18
+ ...DEFAULT_USERS,
19
+ };
20
+ export { USERS };
@@ -0,0 +1,264 @@
1
+ declare const VIEWPORTS: {
2
+ desktop: {
3
+ name: string;
4
+ styles: {
5
+ width: string;
6
+ height: string;
7
+ };
8
+ };
9
+ mobile: {
10
+ name: string;
11
+ styles: {
12
+ width: string;
13
+ height: string;
14
+ };
15
+ };
16
+ tablet: {
17
+ name: string;
18
+ styles: {
19
+ width: string;
20
+ height: string;
21
+ };
22
+ };
23
+ mobile1: {
24
+ readonly name: "Small mobile";
25
+ readonly styles: {
26
+ readonly height: "568px";
27
+ readonly width: "320px";
28
+ };
29
+ readonly type: "mobile";
30
+ };
31
+ mobile2: {
32
+ readonly name: "Large mobile";
33
+ readonly styles: {
34
+ readonly height: "896px";
35
+ readonly width: "414px";
36
+ };
37
+ readonly type: "mobile";
38
+ };
39
+ iphone5: {
40
+ readonly name: "iPhone 5";
41
+ readonly styles: {
42
+ readonly height: "568px";
43
+ readonly width: "320px";
44
+ };
45
+ readonly type: "mobile";
46
+ };
47
+ iphone6: {
48
+ readonly name: "iPhone 6";
49
+ readonly styles: {
50
+ readonly height: "667px";
51
+ readonly width: "375px";
52
+ };
53
+ readonly type: "mobile";
54
+ };
55
+ iphone6p: {
56
+ readonly name: "iPhone 6 Plus";
57
+ readonly styles: {
58
+ readonly height: "736px";
59
+ readonly width: "414px";
60
+ };
61
+ readonly type: "mobile";
62
+ };
63
+ iphone8p: {
64
+ readonly name: "iPhone 8 Plus";
65
+ readonly styles: {
66
+ readonly height: "736px";
67
+ readonly width: "414px";
68
+ };
69
+ readonly type: "mobile";
70
+ };
71
+ iphonex: {
72
+ readonly name: "iPhone X";
73
+ readonly styles: {
74
+ readonly height: "812px";
75
+ readonly width: "375px";
76
+ };
77
+ readonly type: "mobile";
78
+ };
79
+ iphonexr: {
80
+ readonly name: "iPhone XR";
81
+ readonly styles: {
82
+ readonly height: "896px";
83
+ readonly width: "414px";
84
+ };
85
+ readonly type: "mobile";
86
+ };
87
+ iphonexsmax: {
88
+ readonly name: "iPhone XS Max";
89
+ readonly styles: {
90
+ readonly height: "896px";
91
+ readonly width: "414px";
92
+ };
93
+ readonly type: "mobile";
94
+ };
95
+ iphonese2: {
96
+ readonly name: "iPhone SE (2nd generation)";
97
+ readonly styles: {
98
+ readonly height: "667px";
99
+ readonly width: "375px";
100
+ };
101
+ readonly type: "mobile";
102
+ };
103
+ iphone12mini: {
104
+ readonly name: "iPhone 12 mini";
105
+ readonly styles: {
106
+ readonly height: "812px";
107
+ readonly width: "375px";
108
+ };
109
+ readonly type: "mobile";
110
+ };
111
+ iphone12: {
112
+ readonly name: "iPhone 12";
113
+ readonly styles: {
114
+ readonly height: "844px";
115
+ readonly width: "390px";
116
+ };
117
+ readonly type: "mobile";
118
+ };
119
+ iphone12promax: {
120
+ readonly name: "iPhone 12 Pro Max";
121
+ readonly styles: {
122
+ readonly height: "926px";
123
+ readonly width: "428px";
124
+ };
125
+ readonly type: "mobile";
126
+ };
127
+ iphoneSE3: {
128
+ readonly name: "iPhone SE 3rd generation";
129
+ readonly styles: {
130
+ readonly height: "667px";
131
+ readonly width: "375px";
132
+ };
133
+ readonly type: "mobile";
134
+ };
135
+ iphone13: {
136
+ readonly name: "iPhone 13";
137
+ readonly styles: {
138
+ readonly height: "844px";
139
+ readonly width: "390px";
140
+ };
141
+ readonly type: "mobile";
142
+ };
143
+ iphone13pro: {
144
+ readonly name: "iPhone 13 Pro";
145
+ readonly styles: {
146
+ readonly height: "844px";
147
+ readonly width: "390px";
148
+ };
149
+ readonly type: "mobile";
150
+ };
151
+ iphone13promax: {
152
+ readonly name: "iPhone 13 Pro Max";
153
+ readonly styles: {
154
+ readonly height: "926px";
155
+ readonly width: "428px";
156
+ };
157
+ readonly type: "mobile";
158
+ };
159
+ iphone14: {
160
+ readonly name: "iPhone 14";
161
+ readonly styles: {
162
+ readonly height: "844px";
163
+ readonly width: "390px";
164
+ };
165
+ readonly type: "mobile";
166
+ };
167
+ iphone14pro: {
168
+ readonly name: "iPhone 14 Pro";
169
+ readonly styles: {
170
+ readonly height: "852px";
171
+ readonly width: "393px";
172
+ };
173
+ readonly type: "mobile";
174
+ };
175
+ iphone14promax: {
176
+ readonly name: "iPhone 14 Pro Max";
177
+ readonly styles: {
178
+ readonly height: "932px";
179
+ readonly width: "430px";
180
+ };
181
+ readonly type: "mobile";
182
+ };
183
+ ipad: {
184
+ readonly name: "iPad";
185
+ readonly styles: {
186
+ readonly height: "1024px";
187
+ readonly width: "768px";
188
+ };
189
+ readonly type: "tablet";
190
+ };
191
+ ipad10p: {
192
+ readonly name: "iPad Pro 10.5-in";
193
+ readonly styles: {
194
+ readonly height: "1112px";
195
+ readonly width: "834px";
196
+ };
197
+ readonly type: "tablet";
198
+ };
199
+ ipad11p: {
200
+ readonly name: "iPad Pro 11-in";
201
+ readonly styles: {
202
+ readonly height: "1194px";
203
+ readonly width: "834px";
204
+ };
205
+ readonly type: "tablet";
206
+ };
207
+ ipad12p: {
208
+ readonly name: "iPad Pro 12.9-in";
209
+ readonly styles: {
210
+ readonly height: "1366px";
211
+ readonly width: "1024px";
212
+ };
213
+ readonly type: "tablet";
214
+ };
215
+ galaxys5: {
216
+ readonly name: "Galaxy S5";
217
+ readonly styles: {
218
+ readonly height: "640px";
219
+ readonly width: "360px";
220
+ };
221
+ readonly type: "mobile";
222
+ };
223
+ galaxys9: {
224
+ readonly name: "Galaxy S9";
225
+ readonly styles: {
226
+ readonly height: "740px";
227
+ readonly width: "360px";
228
+ };
229
+ readonly type: "mobile";
230
+ };
231
+ nexus5x: {
232
+ readonly name: "Nexus 5X";
233
+ readonly styles: {
234
+ readonly height: "660px";
235
+ readonly width: "412px";
236
+ };
237
+ readonly type: "mobile";
238
+ };
239
+ nexus6p: {
240
+ readonly name: "Nexus 6P";
241
+ readonly styles: {
242
+ readonly height: "732px";
243
+ readonly width: "412px";
244
+ };
245
+ readonly type: "mobile";
246
+ };
247
+ pixel: {
248
+ readonly name: "Pixel";
249
+ readonly styles: {
250
+ readonly height: "960px";
251
+ readonly width: "540px";
252
+ };
253
+ readonly type: "mobile";
254
+ };
255
+ pixelxl: {
256
+ readonly name: "Pixel XL";
257
+ readonly styles: {
258
+ readonly height: "1280px";
259
+ readonly width: "720px";
260
+ };
261
+ readonly type: "mobile";
262
+ };
263
+ };
264
+ export { VIEWPORTS };
@@ -1,29 +1,27 @@
1
- import { INITIAL_VIEWPORTS, MINIMAL_VIEWPORTS } from 'storybook/viewport'
2
-
1
+ import { INITIAL_VIEWPORTS, MINIMAL_VIEWPORTS } from 'storybook/viewport';
3
2
  const VIEWPORTS = {
4
- ...INITIAL_VIEWPORTS,
5
- ...MINIMAL_VIEWPORTS,
6
- desktop: {
7
- name: 'Desktop',
8
- styles: {
9
- width: '1440px',
10
- height: '100%',
3
+ ...INITIAL_VIEWPORTS,
4
+ ...MINIMAL_VIEWPORTS,
5
+ desktop: {
6
+ name: 'Desktop',
7
+ styles: {
8
+ width: '1440px',
9
+ height: '100%',
10
+ },
11
11
  },
12
- },
13
- mobile: {
14
- name: 'Mobile',
15
- styles: {
16
- width: '375px',
17
- height: '667px',
12
+ mobile: {
13
+ name: 'Mobile',
14
+ styles: {
15
+ width: '375px',
16
+ height: '667px',
17
+ },
18
18
  },
19
- },
20
- tablet: {
21
- name: 'Tablet',
22
- styles: {
23
- width: '768px',
24
- height: '1024px',
19
+ tablet: {
20
+ name: 'Tablet',
21
+ styles: {
22
+ width: '768px',
23
+ height: '1024px',
24
+ },
25
25
  },
26
- },
27
- }
28
-
29
- export { VIEWPORTS }
26
+ };
27
+ export { VIEWPORTS };
@@ -0,0 +1,13 @@
1
+ declare function getMediaProxyServerConfig(): {
2
+ server?: undefined;
3
+ } | {
4
+ server: {
5
+ proxy: {
6
+ '/media': {
7
+ changeOrigin: boolean;
8
+ target: string;
9
+ };
10
+ };
11
+ };
12
+ };
13
+ export { getMediaProxyServerConfig };
@@ -1,19 +1,17 @@
1
1
  function getMediaProxyServerConfig() {
2
- const restBaseUrl = process.env.REST_BASE_URL?.replace(/\/$/, '')
3
- if (!restBaseUrl) {
4
- return {}
5
- }
6
-
7
- return {
8
- server: {
9
- proxy: {
10
- '/media': {
11
- changeOrigin: true,
12
- target: restBaseUrl,
2
+ const restBaseUrl = process.env.REST_BASE_URL?.replace(/\/$/, '');
3
+ if (!restBaseUrl) {
4
+ return {};
5
+ }
6
+ return {
7
+ server: {
8
+ proxy: {
9
+ '/media': {
10
+ changeOrigin: true,
11
+ target: restBaseUrl,
12
+ },
13
+ },
13
14
  },
14
- },
15
- },
16
- }
15
+ };
17
16
  }
18
-
19
- export { getMediaProxyServerConfig }
17
+ export { getMediaProxyServerConfig };
@@ -0,0 +1,8 @@
1
+ import { withClearStoresDecorator } from './withClearStoresDecorator';
2
+ import { withExtraProviders } from './withExtraProviders';
3
+ import { withFigmaSourceLink } from './withFigmaSourceLink';
4
+ import { withFormSubmitDecorator } from './withFormSubmitDecorator';
5
+ import { withLayoutDecorator } from './withLayoutDecorator';
6
+ import { withNextDecoratorFactory } from './withNextDecorator';
7
+ import { withUiDecorator } from './withUiDecorator';
8
+ export { withClearStoresDecorator, withExtraProviders, withFigmaSourceLink, withFormSubmitDecorator, withLayoutDecorator, withNextDecoratorFactory, withUiDecorator, };
@@ -0,0 +1,8 @@
1
+ import { withClearStoresDecorator } from './withClearStoresDecorator';
2
+ import { withExtraProviders } from './withExtraProviders';
3
+ import { withFigmaSourceLink } from './withFigmaSourceLink';
4
+ import { withFormSubmitDecorator } from './withFormSubmitDecorator';
5
+ import { withLayoutDecorator } from './withLayoutDecorator';
6
+ import { withNextDecoratorFactory } from './withNextDecorator';
7
+ import { withUiDecorator } from './withUiDecorator';
8
+ export { withClearStoresDecorator, withExtraProviders, withFigmaSourceLink, withFormSubmitDecorator, withLayoutDecorator, withNextDecoratorFactory, withUiDecorator, };
@@ -0,0 +1,4 @@
1
+ declare function withClearStoresDecorator({ clearStoreData }: {
2
+ clearStoreData: any;
3
+ }): (Story: any) => import("react/jsx-runtime").JSX.Element;
4
+ export { withClearStoresDecorator };
@@ -0,0 +1,2 @@
1
+ declare function withExtraProviders(providers?: any[]): (StoryFn: any, context: any) => any;
2
+ export { withExtraProviders };
@@ -0,0 +1,5 @@
1
+ declare function withFigmaSourceLink(): (Story: any, { parameters, context }: {
2
+ parameters: any;
3
+ context: any;
4
+ }) => import("react/jsx-runtime").JSX.Element;
5
+ export { withFigmaSourceLink };
@@ -0,0 +1,2 @@
1
+ declare function withFormSubmitDecorator(): (Story: any, storyContext: any) => import("react/jsx-runtime").JSX.Element;
2
+ export { withFormSubmitDecorator };
@@ -3,7 +3,6 @@ import { F as FormSubmitWrapper } from '../components/FormSubmitWrapper-B2tMQZu2
3
3
  import { c as commonjsGlobal, r as requireIsArray } from '../components/isArray-CPoGkdXv.js';
4
4
  import '@itcase/common';
5
5
  import 'msw';
6
- import 'final-form';
7
6
  import { jsx } from 'react/jsx-runtime';
8
7
 
9
8
  /** Detect free variable `global` from Node.js. */
@@ -0,0 +1,4 @@
1
+ declare function withLayoutDecorator(): (Story: any, { parameters }: {
2
+ parameters: any;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export { withLayoutDecorator };
@@ -0,0 +1,9 @@
1
+ declare function withNextDecoratorFactory({ App, RootStoreProvider }: {
2
+ App: any;
3
+ RootStoreProvider: any;
4
+ }): (Story: any, { args, parameters, context }: {
5
+ args: any;
6
+ parameters: any;
7
+ context: any;
8
+ }) => import("react/jsx-runtime").JSX.Element;
9
+ export { withNextDecoratorFactory };
@@ -1,6 +1,6 @@
1
1
  import 'react';
2
- import { NotificationWrapper } from '@itcase/ui-web/components/Notification';
3
2
  import { UIProvider, NotificationsProvider } from '@itcase/ui-core/context';
3
+ import { NotificationWrapper } from '@itcase/ui-web/components/Notification';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
 
6
6
  function withNextDecoratorFactory({
@@ -0,0 +1,5 @@
1
+ declare function withUiDecorator(Story: any, { args, parameters }: {
2
+ args: any;
3
+ parameters: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export { withUiDecorator };
@@ -1,6 +1,6 @@
1
1
  import 'react';
2
- import { NotificationWrapper } from '@itcase/ui-web/components/Notification';
3
2
  import { UIProvider, NotificationsProvider } from '@itcase/ui-core/context';
3
+ import { NotificationWrapper } from '@itcase/ui-web/components/Notification';
4
4
  import { jsx, jsxs } from 'react/jsx-runtime';
5
5
 
6
6
  function withUiDecorator(Story, {
@@ -11,6 +11,5 @@ import './components/isArray-CPoGkdXv.js';
11
11
  import './components/FormSubmitWrapper-B2tMQZu2.js';
12
12
  import '@itcase/common';
13
13
  import 'msw';
14
- import 'final-form';
15
- import '@itcase/ui-web/components/Notification';
16
14
  import '@itcase/ui-core/context';
15
+ import '@itcase/ui-web/components/Notification';
@@ -0,0 +1,2 @@
1
+ declare function getFigmaSourceLink(getMeta: any): any;
2
+ export { getFigmaSourceLink };
@@ -1,16 +1,15 @@
1
1
  function getFigmaSourceLink(getMeta) {
2
- const meta = getMeta()
3
- const links = meta.design.reduce((result, item) => {
4
- result[`figma${item.name}`] = () => {
5
- return {
6
- label: `Figma${item.name} — + ${meta.title}`,
7
- href: item.url,
8
- icon: 'FigmaIcon',
9
- }
10
- }
11
- return result
12
- }, {})
13
- return links
2
+ const meta = getMeta();
3
+ const links = meta.design.reduce((result, item) => {
4
+ result[`figma${item.name}`] = () => {
5
+ return {
6
+ label: `Figma${item.name} — + ${meta.title}`,
7
+ href: item.url,
8
+ icon: 'FigmaIcon',
9
+ };
10
+ };
11
+ return result;
12
+ }, {});
13
+ return links;
14
14
  }
15
-
16
- export { getFigmaSourceLink }
15
+ export { getFigmaSourceLink };
@@ -0,0 +1,2 @@
1
+ declare function getStoryInfoBlocks(infoBlockSlugsList?: any[]): Promise<any>;
2
+ export { getStoryInfoBlocks };
@@ -1,57 +1,47 @@
1
- import camelCase from 'lodash/camelCase'
2
-
3
- import { axiosInstanceITCase } from '@itcase/common'
4
-
1
+ import camelCase from 'lodash/camelCase';
2
+ import { axiosInstanceITCase } from '@itcase/common';
5
3
  async function getStoryInfoBlocks(infoBlockSlugsList = []) {
6
- const slugsList = []
7
- const regExpsList = []
8
-
9
- infoBlockSlugsList.forEach((slug) => {
10
- if (slug instanceof RegExp) {
11
- regExpsList.push(slug)
12
- } else {
13
- slugsList.push(slug)
14
- }
15
- })
16
-
17
- const slugsQuery = slugsList.join(',')
18
- const response = await axiosInstanceITCase.get(
19
- `/rest/infoblocks/?active=true&slugs=${slugsQuery}`,
20
- )
21
- const infoBlocksList = response.data.results || []
22
- const infoBlocks = infoBlocksList.reduce((resultData, infoBlockItem) => {
23
- const targetSlugRegExp = regExpsList.find((slugRegExp) => {
24
- return slugRegExp.test(infoBlockItem.slug)
25
- })
26
-
27
- if (targetSlugRegExp) {
28
- const key = camelCase(infoBlockItem.slug)
29
- if (resultData[key]) {
30
- resultData[key].push(infoBlockItem)
31
- } else {
32
- resultData[key] = [infoBlockItem]
33
- }
34
- return resultData
35
- }
36
-
37
- const targetSlug = slugsList.find((slug) => {
38
- return slug === infoBlockItem.slug
39
- })
40
-
41
- if (targetSlug) {
42
- const key = camelCase(targetSlug)
43
- resultData[key] = infoBlockItem
44
- return resultData
45
- }
46
-
47
- // If no specific infoBlocks are assigned to this page,
48
- // then we use the "slug" as a key for the infoBlocks dictionary.
49
- const infoBlockKey = camelCase(infoBlockItem.slug)
50
- resultData[infoBlockKey] = infoBlockItem
51
- return resultData
52
- }, {})
53
-
54
- return infoBlocks
4
+ const slugsList = [];
5
+ const regExpsList = [];
6
+ infoBlockSlugsList.forEach((slug) => {
7
+ if (slug instanceof RegExp) {
8
+ regExpsList.push(slug);
9
+ }
10
+ else {
11
+ slugsList.push(slug);
12
+ }
13
+ });
14
+ const slugsQuery = slugsList.join(',');
15
+ const response = await axiosInstanceITCase.get(`/rest/infoblocks/?active=true&slugs=${slugsQuery}`);
16
+ const infoBlocksList = response.data.results || [];
17
+ const infoBlocks = infoBlocksList.reduce((resultData, infoBlockItem) => {
18
+ const targetSlugRegExp = regExpsList.find((slugRegExp) => {
19
+ return slugRegExp.test(infoBlockItem.slug);
20
+ });
21
+ if (targetSlugRegExp) {
22
+ const key = camelCase(infoBlockItem.slug);
23
+ if (resultData[key]) {
24
+ resultData[key].push(infoBlockItem);
25
+ }
26
+ else {
27
+ resultData[key] = [infoBlockItem];
28
+ }
29
+ return resultData;
30
+ }
31
+ const targetSlug = slugsList.find((slug) => {
32
+ return slug === infoBlockItem.slug;
33
+ });
34
+ if (targetSlug) {
35
+ const key = camelCase(targetSlug);
36
+ resultData[key] = infoBlockItem;
37
+ return resultData;
38
+ }
39
+ // If no specific infoBlocks are assigned to this page,
40
+ // then we use the "slug" as a key for the infoBlocks dictionary.
41
+ const infoBlockKey = camelCase(infoBlockItem.slug);
42
+ resultData[infoBlockKey] = infoBlockItem;
43
+ return resultData;
44
+ }, {});
45
+ return infoBlocks;
55
46
  }
56
-
57
- export { getStoryInfoBlocks }
47
+ export { getStoryInfoBlocks };