@itcase/storybook-config 1.2.79 → 1.2.81

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 (120) hide show
  1. package/dist/{FormSubmitWrapper-_VeLgVir.js → FormSubmitWrapper-Bv5qs18h.js} +10 -3
  2. package/dist/cjs/components/EmailTemplatePreview.js +1 -1
  3. package/dist/cjs/components/FormSubmitWrapper.js +1 -1
  4. package/dist/cjs/decorators/withFormSubmitDecorator.js +1 -2
  5. package/dist/cjs/decorators/withNextDecorator.js +1 -1
  6. package/dist/cjs/decorators/withUiDecorator.js +1 -1
  7. package/dist/cjs/decorators.js +2 -3
  8. package/dist/components/EmailTemplatePreview/index.d.ts +2 -0
  9. package/dist/components/EmailTemplatePreview/index.js +38 -0
  10. package/dist/components/EmailTemplatePreview.js +1 -1
  11. package/dist/components/FormSubmitWrapper/FormSubmitWrapper.d.ts +16 -0
  12. package/dist/components/FormSubmitWrapper/FormSubmitWrapper.js +88 -0
  13. package/dist/components/FormSubmitWrapper/autoSubmitForm.d.ts +2 -0
  14. package/dist/components/FormSubmitWrapper/autoSubmitForm.js +106 -0
  15. package/dist/components/FormSubmitWrapper/index.d.ts +2 -0
  16. package/dist/components/FormSubmitWrapper/index.js +2 -0
  17. package/dist/components/{FormSubmitWrapper-B2tMQZu2.js → FormSubmitWrapper-EwNkaMht.js} +10 -3
  18. package/dist/components/FormSubmitWrapper.js +1 -1
  19. package/dist/config/addons/addonThemes.d.ts +15 -0
  20. package/dist/config/addons/addonThemes.js +14 -15
  21. package/dist/config/addons/addonsNextJs.d.ts +2 -0
  22. package/dist/config/addons/addonsNextJs.js +8 -9
  23. package/dist/config/addons/addonsReactNative.d.ts +2 -0
  24. package/dist/config/addons/addonsReactNative.js +6 -7
  25. package/dist/config/addons/addonsReactNativeWeb.d.ts +2 -0
  26. package/dist/config/addons/addonsReactNativeWeb.js +2 -3
  27. package/dist/config/addons/addonsVite.d.ts +2 -0
  28. package/dist/config/addons/addonsVite.js +8 -9
  29. package/dist/config/addons/addonsWebpack.d.ts +18 -0
  30. package/dist/config/addons/addonsWebpack.js +26 -27
  31. package/dist/config/appearance/appearance.d.ts +1 -0
  32. package/dist/config/appearance/appearance.js +1 -1
  33. package/dist/config/backgrounds/backgrounds.d.ts +23 -0
  34. package/dist/config/backgrounds/backgrounds.js +22 -24
  35. package/dist/config/code/code.d.ts +8 -0
  36. package/dist/config/code/code.js +18 -22
  37. package/dist/config/config/mainConfigNextJsVite.d.ts +10 -0
  38. package/dist/config/config/mainConfigNextJsVite.js +35 -38
  39. package/dist/config/config/mainConfigReactNative.d.ts +9 -0
  40. package/dist/config/config/mainConfigReactNative.js +21 -23
  41. package/dist/config/config/mainConfigReactNativeWeb.d.ts +23 -0
  42. package/dist/config/config/mainConfigReactNativeWeb.js +42 -46
  43. package/dist/config/config/mainConfigVite.d.ts +9 -0
  44. package/dist/config/config/mainConfigVite.js +75 -80
  45. package/dist/config/config/mainConfigWebpack.d.ts +9 -0
  46. package/dist/config/config/mainConfigWebpack.js +39 -64
  47. package/dist/config/framework/frameworkNextJs.d.ts +4 -0
  48. package/dist/config/framework/frameworkNextJs.js +3 -4
  49. package/dist/config/framework/frameworkNextJsVite.d.ts +4 -0
  50. package/dist/config/framework/frameworkNextJsVite.js +3 -4
  51. package/dist/config/framework/frameworkReactNative.d.ts +4 -0
  52. package/dist/config/framework/frameworkReactNative.js +3 -4
  53. package/dist/config/framework/frameworkReactNativeWeb.d.ts +4 -0
  54. package/dist/config/framework/frameworkReactNativeWeb.js +3 -4
  55. package/dist/config/framework/frameworkVite.d.ts +4 -0
  56. package/dist/config/framework/frameworkVite.js +3 -4
  57. package/dist/config/framework/frameworkWebpack.d.ts +11 -0
  58. package/dist/config/framework/frameworkWebpack.js +9 -10
  59. package/dist/config/main/index.d.ts +26 -0
  60. package/dist/config/main/index.js +26 -53
  61. package/dist/config/msw/index.d.ts +2 -0
  62. package/dist/config/msw/index.js +2 -7
  63. package/dist/config/msw/mswHandlers.d.ts +5 -0
  64. package/dist/config/msw/mswHandlers.js +20 -24
  65. package/dist/config/ondevice/ondeviceBackgrounds.d.ts +8 -0
  66. package/dist/config/ondevice/ondeviceBackgrounds.js +8 -9
  67. package/dist/config/preview/index.d.ts +6 -0
  68. package/dist/config/preview/index.js +6 -13
  69. package/dist/config/refs/refs.d.ts +13 -0
  70. package/dist/config/refs/refs.js +12 -13
  71. package/dist/config/sourceLink/sourceLink.d.ts +35 -0
  72. package/dist/config/sourceLink/sourceLink.js +32 -36
  73. package/dist/config/static/staticDirsNextJs.d.ts +5 -0
  74. package/dist/config/static/staticDirsNextJs.js +5 -6
  75. package/dist/config/static/staticDirsReactNative.d.ts +2 -0
  76. package/dist/config/static/staticDirsReactNative.js +2 -3
  77. package/dist/config/static/staticDirsReactNativeWeb.d.ts +2 -0
  78. package/dist/config/static/staticDirsReactNativeWeb.js +2 -3
  79. package/dist/config/static/staticDirsVite.d.ts +5 -0
  80. package/dist/config/static/staticDirsVite.js +2 -3
  81. package/dist/config/static/staticDirsWebpack.d.ts +5 -0
  82. package/dist/config/static/staticDirsWebpack.js +2 -3
  83. package/dist/config/status/status.d.ts +21 -0
  84. package/dist/config/status/status.js +23 -24
  85. package/dist/config/users/authorization.d.ts +22 -0
  86. package/dist/config/users/authorization.js +6 -8
  87. package/dist/config/users/users.d.ts +18 -0
  88. package/dist/config/users/users.js +19 -21
  89. package/dist/config/viewport/viewport.d.ts +264 -0
  90. package/dist/config/viewport/viewport.js +23 -25
  91. package/dist/config/vite/getMediaProxyServerConfig.d.ts +13 -0
  92. package/dist/config/vite/getMediaProxyServerConfig.js +14 -16
  93. package/dist/decorators/index.d.ts +8 -0
  94. package/dist/decorators/index.js +8 -0
  95. package/dist/decorators/withClearStoresDecorator.d.ts +4 -0
  96. package/dist/decorators/withExtraProviders.d.ts +2 -0
  97. package/dist/decorators/withFigmaSourceLink.d.ts +5 -0
  98. package/dist/decorators/withFormSubmitDecorator.d.ts +2 -0
  99. package/dist/decorators/withFormSubmitDecorator.js +1 -2
  100. package/dist/decorators/withLayoutDecorator.d.ts +4 -0
  101. package/dist/decorators/withNextDecorator.d.ts +9 -0
  102. package/dist/decorators/withNextDecorator.js +1 -1
  103. package/dist/decorators/withUiDecorator.d.ts +5 -0
  104. package/dist/decorators/withUiDecorator.js +1 -1
  105. package/dist/decorators.js +2 -3
  106. package/dist/utils/getFigmaSourceLink.d.ts +2 -0
  107. package/dist/utils/getFigmaSourceLink.js +13 -14
  108. package/dist/utils/getStoryInfoBlocks.d.ts +2 -0
  109. package/dist/utils/getStoryInfoBlocks.js +45 -55
  110. package/dist/utils/handleMSWParameters.d.ts +8 -0
  111. package/dist/utils/handleMSWParameters.js +18 -27
  112. package/dist/utils/hasFormParameters.d.ts +2 -0
  113. package/dist/utils/hasFormParameters.js +6 -9
  114. package/dist/utils/index.d.ts +7 -0
  115. package/dist/utils/index.js +9 -17
  116. package/dist/utils/isVitestEnvironment.d.ts +2 -0
  117. package/dist/utils/isVitestEnvironment.js +2 -3
  118. package/dist/utils/storybookServerErrorOnSubmit.d.ts +2 -0
  119. package/dist/utils/storybookServerErrorOnSubmit.js +12 -19
  120. package/package.json +50 -43
@@ -1,66 +1,41 @@
1
- import chalk from 'chalk'
2
-
3
- const STORYBOOK_PUBLIC_PATH = null
1
+ import chalk from 'chalk';
2
+ const STORYBOOK_PUBLIC_PATH = null;
4
3
  const WEBPACK_ALIAS = {
5
- src: `${process.cwd()}/src`,
6
- '@itcase/ui-web': `${process.cwd()}/node_modules/@itcase/ui-web/dist`,
7
- '@itcase/ui-core': `${process.cwd()}/node_modules/@itcase/ui-core/dist`,
8
- }
9
-
4
+ src: `${process.cwd()}/src`,
5
+ '@itcase/ui-core': `${process.cwd()}/node_modules/@itcase/ui-core/dist`,
6
+ '@itcase/ui-web': `${process.cwd()}/node_modules/@itcase/ui-web/dist`,
7
+ };
10
8
  const MAIN_CONFIG_WEBPACK = {
11
- webpackFinal: async (config) => {
12
- console.log(
13
- chalk.green(
14
- 'info =>',
15
- chalk.white(
16
- 'Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one',
17
- ),
18
- ),
19
- )
20
-
21
- if (STORYBOOK_PUBLIC_PATH) {
22
- config.output.publicPath = STORYBOOK_PUBLIC_PATH
23
- }
24
- // @svgr/webpack
25
- const imageRule = config.module?.rules?.find((rule) => {
26
- const test = rule.test
27
- if (!test) {
28
- return false
29
- }
30
- return test.test('.svg')
31
- })
32
-
33
- imageRule.exclude = /\.svg$/
34
-
35
- config.module?.rules?.push({
36
- test: /\.svg$/,
37
- use: ['@svgr/webpack'],
38
- })
39
-
40
- // update webpack alias
41
- console.log(
42
- chalk.green(
43
- 'info =>',
44
- chalk.white('Using default "WEBPACK_ALIAS" from'),
45
- chalk.cyan('src'),
46
- chalk.white('to'),
47
- chalk.cyan(`${process.cwd()}/src`),
48
- chalk.white('change it to use another one'),
49
- ),
50
- )
51
-
52
- config.resolve.alias = {
53
- ...config.resolve.alias,
54
- ...WEBPACK_ALIAS,
55
- }
56
-
57
- return config
58
- },
59
- core: {
60
- disableTelemetry: true,
61
- disableWhatsNewNotifications: true,
62
- },
63
- tags: ['autodocs'],
64
- }
65
-
66
- export { MAIN_CONFIG_WEBPACK }
9
+ webpackFinal: async (config) => {
10
+ console.log(chalk.green('info =>', chalk.white('Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one')));
11
+ if (STORYBOOK_PUBLIC_PATH) {
12
+ config.output.publicPath = STORYBOOK_PUBLIC_PATH;
13
+ }
14
+ // @svgr/webpack
15
+ const imageRule = config.module?.rules?.find((rule) => {
16
+ const test = rule.test;
17
+ if (!test) {
18
+ return false;
19
+ }
20
+ return test.test('.svg');
21
+ });
22
+ imageRule.exclude = /\.svg$/;
23
+ config.module?.rules?.push({
24
+ test: /\.svg$/,
25
+ use: ['@svgr/webpack'],
26
+ });
27
+ // update webpack alias
28
+ console.log(chalk.green('info =>', chalk.white('Using default "WEBPACK_ALIAS" from'), chalk.cyan('src'), chalk.white('to'), chalk.cyan(`${process.cwd()}/src`), chalk.white('change it to use another one')));
29
+ config.resolve.alias = {
30
+ ...config.resolve.alias,
31
+ ...WEBPACK_ALIAS,
32
+ };
33
+ return config;
34
+ },
35
+ core: {
36
+ disableTelemetry: true,
37
+ disableWhatsNewNotifications: true,
38
+ },
39
+ tags: ['autodocs'],
40
+ };
41
+ export { MAIN_CONFIG_WEBPACK };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_NEXTJS: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_NEXTJS };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_NEXTJS = {
2
- framework: '@storybook/nextjs',
3
- }
4
-
5
- export { FRAMEWORK_NEXTJS }
2
+ framework: '@storybook/nextjs',
3
+ };
4
+ export { FRAMEWORK_NEXTJS };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_NEXTJS_VITE: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_NEXTJS_VITE };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_NEXTJS_VITE = {
2
- framework: '@storybook/nextjs-vite',
3
- }
4
-
5
- export { FRAMEWORK_NEXTJS_VITE }
2
+ framework: '@storybook/nextjs-vite',
3
+ };
4
+ export { FRAMEWORK_NEXTJS_VITE };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_REACT_NATIVE: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_REACT_NATIVE = {
2
- framework: '@storybook/react-native',
3
- }
4
-
5
- export { FRAMEWORK_REACT_NATIVE }
2
+ framework: '@storybook/react-native',
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_REACT_NATIVE_WEB: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE_WEB };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_REACT_NATIVE_WEB = {
2
- framework: '@storybook/react-native-web-vite',
3
- }
4
-
5
- export { FRAMEWORK_REACT_NATIVE_WEB }
2
+ framework: '@storybook/react-native-web-vite',
3
+ };
4
+ export { FRAMEWORK_REACT_NATIVE_WEB };
@@ -0,0 +1,4 @@
1
+ declare const FRAMEWORK_VITE: {
2
+ framework: string;
3
+ };
4
+ export { FRAMEWORK_VITE };
@@ -1,5 +1,4 @@
1
1
  const FRAMEWORK_VITE = {
2
- framework: '@storybook/react-vite',
3
- }
4
-
5
- export { FRAMEWORK_VITE }
2
+ framework: '@storybook/react-vite',
3
+ };
4
+ export { FRAMEWORK_VITE };
@@ -0,0 +1,11 @@
1
+ declare const FRAMEWORK_WEBPACK: {
2
+ framework: {
3
+ name: string;
4
+ options: {
5
+ builder: {
6
+ useSWC: boolean;
7
+ };
8
+ };
9
+ };
10
+ };
11
+ export { FRAMEWORK_WEBPACK };
@@ -1,12 +1,11 @@
1
1
  const FRAMEWORK_WEBPACK = {
2
- framework: {
3
- name: '@storybook/react-webpack5',
4
- options: {
5
- builder: {
6
- useSWC: true,
7
- },
2
+ framework: {
3
+ name: '@storybook/react-webpack5',
4
+ options: {
5
+ builder: {
6
+ useSWC: true,
7
+ },
8
+ },
8
9
  },
9
- },
10
- }
11
-
12
- export { FRAMEWORK_WEBPACK }
10
+ };
11
+ export { FRAMEWORK_WEBPACK };
@@ -0,0 +1,26 @@
1
+ import { ADDONS_NEXTJS } from '../addons/addonsNextJs.js';
2
+ import { ADDONS_REACT_NATIVE } from '../addons/addonsReactNative.js';
3
+ import { ADDONS_REACT_NATIVE_WEB } from '../addons/addonsReactNativeWeb.js';
4
+ import { ADDONS_VITE } from '../addons/addonsVite.js';
5
+ import { ADDONS_WEBPACK } from '../addons/addonsWebpack.js';
6
+ import { CODE } from '../code/code.js';
7
+ import { MAIN_CONFIG_NEXTJS_VITE } from '../config/mainConfigNextJsVite.js';
8
+ import { MAIN_CONFIG_REACT_NATIVE } from '../config/mainConfigReactNative.js';
9
+ import { MAIN_CONFIG_REACT_NATIVE_WEB } from '../config/mainConfigReactNativeWeb.js';
10
+ import { MAIN_CONFIG_VITE } from '../config/mainConfigVite.js';
11
+ import { MAIN_CONFIG_WEBPACK } from '../config/mainConfigWebpack.js';
12
+ import { FRAMEWORK_NEXTJS } from '../framework/frameworkNextJs.js';
13
+ import { FRAMEWORK_NEXTJS_VITE } from '../framework/frameworkNextJsVite.js';
14
+ import { FRAMEWORK_REACT_NATIVE } from '../framework/frameworkReactNative.js';
15
+ import { FRAMEWORK_REACT_NATIVE_WEB } from '../framework/frameworkReactNativeWeb.js';
16
+ import { FRAMEWORK_VITE } from '../framework/frameworkVite.js';
17
+ import { FRAMEWORK_WEBPACK } from '../framework/frameworkWebpack.js';
18
+ import { REFS } from '../refs/refs.js';
19
+ import { STATIC_DIRS_NEXTJS } from '../static/staticDirsNextJs.js';
20
+ import { STATIC_DIRS_REACT_NATIVE } from '../static/staticDirsReactNative.js';
21
+ import { STATIC_DIRS_REACT_NATIVE_WEB } from '../static/staticDirsReactNativeWeb.js';
22
+ import { STATIC_DIRS_VITE } from '../static/staticDirsVite.js';
23
+ import { STATIC_DIRS_WEBPACK } from '../static/staticDirsWebpack.js';
24
+ import { STATUS } from '../status/status.js';
25
+ import { AUTHORIZATION } from '../users/authorization.js';
26
+ export { ADDONS_NEXTJS, ADDONS_REACT_NATIVE, ADDONS_REACT_NATIVE_WEB, ADDONS_VITE, ADDONS_WEBPACK, AUTHORIZATION, CODE, FRAMEWORK_NEXTJS, FRAMEWORK_NEXTJS_VITE, FRAMEWORK_REACT_NATIVE, FRAMEWORK_REACT_NATIVE_WEB, FRAMEWORK_VITE, FRAMEWORK_WEBPACK, MAIN_CONFIG_NEXTJS_VITE, MAIN_CONFIG_REACT_NATIVE, MAIN_CONFIG_REACT_NATIVE_WEB, MAIN_CONFIG_VITE, MAIN_CONFIG_WEBPACK, REFS, STATIC_DIRS_NEXTJS, STATIC_DIRS_REACT_NATIVE, STATIC_DIRS_REACT_NATIVE_WEB, STATIC_DIRS_VITE, STATIC_DIRS_WEBPACK, STATUS, };
@@ -1,53 +1,26 @@
1
- import { ADDONS_NEXTJS } from '../addons/addonsNextJs.js'
2
- import { ADDONS_REACT_NATIVE } from '../addons/addonsReactNative.js'
3
- import { ADDONS_REACT_NATIVE_WEB } from '../addons/addonsReactNativeWeb.js'
4
- import { ADDONS_VITE } from '../addons/addonsVite.js'
5
- import { ADDONS_WEBPACK } from '../addons/addonsWebpack.js'
6
- import { CODE } from '../code/code.js'
7
- import { MAIN_CONFIG_NEXTJS_VITE } from '../config/mainConfigNextJsVite.js'
8
- import { MAIN_CONFIG_REACT_NATIVE } from '../config/mainConfigReactNative.js'
9
- import { MAIN_CONFIG_REACT_NATIVE_WEB } from '../config/mainConfigReactNativeWeb.js'
10
- import { MAIN_CONFIG_VITE } from '../config/mainConfigVite.js'
11
- import { MAIN_CONFIG_WEBPACK } from '../config/mainConfigWebpack.js'
12
- import { FRAMEWORK_NEXTJS } from '../framework/frameworkNextJs.js'
13
- import { FRAMEWORK_NEXTJS_VITE } from '../framework/frameworkNextJsVite.js'
14
- import { FRAMEWORK_REACT_NATIVE } from '../framework/frameworkReactNative.js'
15
- import { FRAMEWORK_REACT_NATIVE_WEB } from '../framework/frameworkReactNativeWeb.js'
16
- import { FRAMEWORK_VITE } from '../framework/frameworkVite.js'
17
- import { FRAMEWORK_WEBPACK } from '../framework/frameworkWebpack.js'
18
- import { REFS } from '../refs/refs.js'
19
- import { STATIC_DIRS_NEXTJS } from '../static/staticDirsNextJs.js'
20
- import { STATIC_DIRS_REACT_NATIVE } from '../static/staticDirsReactNative.js'
21
- import { STATIC_DIRS_REACT_NATIVE_WEB } from '../static/staticDirsReactNativeWeb.js'
22
- import { STATIC_DIRS_VITE } from '../static/staticDirsVite.js'
23
- import { STATIC_DIRS_WEBPACK } from '../static/staticDirsWebpack.js'
24
- import { STATUS } from '../status/status.js'
25
- import { AUTHORIZATION } from '../users/authorization.js'
26
-
27
- export {
28
- ADDONS_NEXTJS,
29
- ADDONS_REACT_NATIVE,
30
- ADDONS_REACT_NATIVE_WEB,
31
- ADDONS_VITE,
32
- ADDONS_WEBPACK,
33
- AUTHORIZATION,
34
- CODE,
35
- FRAMEWORK_NEXTJS,
36
- FRAMEWORK_NEXTJS_VITE,
37
- FRAMEWORK_REACT_NATIVE,
38
- FRAMEWORK_REACT_NATIVE_WEB,
39
- FRAMEWORK_VITE,
40
- FRAMEWORK_WEBPACK,
41
- MAIN_CONFIG_NEXTJS_VITE,
42
- MAIN_CONFIG_REACT_NATIVE,
43
- MAIN_CONFIG_REACT_NATIVE_WEB,
44
- MAIN_CONFIG_VITE,
45
- MAIN_CONFIG_WEBPACK,
46
- REFS,
47
- STATIC_DIRS_NEXTJS,
48
- STATIC_DIRS_REACT_NATIVE,
49
- STATIC_DIRS_REACT_NATIVE_WEB,
50
- STATIC_DIRS_VITE,
51
- STATIC_DIRS_WEBPACK,
52
- STATUS,
53
- }
1
+ import { ADDONS_NEXTJS } from '../addons/addonsNextJs.js';
2
+ import { ADDONS_REACT_NATIVE } from '../addons/addonsReactNative.js';
3
+ import { ADDONS_REACT_NATIVE_WEB } from '../addons/addonsReactNativeWeb.js';
4
+ import { ADDONS_VITE } from '../addons/addonsVite.js';
5
+ import { ADDONS_WEBPACK } from '../addons/addonsWebpack.js';
6
+ import { CODE } from '../code/code.js';
7
+ import { MAIN_CONFIG_NEXTJS_VITE } from '../config/mainConfigNextJsVite.js';
8
+ import { MAIN_CONFIG_REACT_NATIVE } from '../config/mainConfigReactNative.js';
9
+ import { MAIN_CONFIG_REACT_NATIVE_WEB } from '../config/mainConfigReactNativeWeb.js';
10
+ import { MAIN_CONFIG_VITE } from '../config/mainConfigVite.js';
11
+ import { MAIN_CONFIG_WEBPACK } from '../config/mainConfigWebpack.js';
12
+ import { FRAMEWORK_NEXTJS } from '../framework/frameworkNextJs.js';
13
+ import { FRAMEWORK_NEXTJS_VITE } from '../framework/frameworkNextJsVite.js';
14
+ import { FRAMEWORK_REACT_NATIVE } from '../framework/frameworkReactNative.js';
15
+ import { FRAMEWORK_REACT_NATIVE_WEB } from '../framework/frameworkReactNativeWeb.js';
16
+ import { FRAMEWORK_VITE } from '../framework/frameworkVite.js';
17
+ import { FRAMEWORK_WEBPACK } from '../framework/frameworkWebpack.js';
18
+ import { REFS } from '../refs/refs.js';
19
+ import { STATIC_DIRS_NEXTJS } from '../static/staticDirsNextJs.js';
20
+ import { STATIC_DIRS_REACT_NATIVE } from '../static/staticDirsReactNative.js';
21
+ import { STATIC_DIRS_REACT_NATIVE_WEB } from '../static/staticDirsReactNativeWeb.js';
22
+ import { STATIC_DIRS_VITE } from '../static/staticDirsVite.js';
23
+ import { STATIC_DIRS_WEBPACK } from '../static/staticDirsWebpack.js';
24
+ import { STATUS } from '../status/status.js';
25
+ import { AUTHORIZATION } from '../users/authorization.js';
26
+ export { ADDONS_NEXTJS, ADDONS_REACT_NATIVE, ADDONS_REACT_NATIVE_WEB, ADDONS_VITE, ADDONS_WEBPACK, AUTHORIZATION, CODE, FRAMEWORK_NEXTJS, FRAMEWORK_NEXTJS_VITE, FRAMEWORK_REACT_NATIVE, FRAMEWORK_REACT_NATIVE_WEB, FRAMEWORK_VITE, FRAMEWORK_WEBPACK, MAIN_CONFIG_NEXTJS_VITE, MAIN_CONFIG_REACT_NATIVE, MAIN_CONFIG_REACT_NATIVE_WEB, MAIN_CONFIG_VITE, MAIN_CONFIG_WEBPACK, REFS, STATIC_DIRS_NEXTJS, STATIC_DIRS_REACT_NATIVE, STATIC_DIRS_REACT_NATIVE_WEB, STATIC_DIRS_VITE, STATIC_DIRS_WEBPACK, STATUS, };
@@ -0,0 +1,2 @@
1
+ import { handleGetRequest, serverErrorDataHandler, serverErrorHandler } from './mswHandlers.js';
2
+ export { handleGetRequest, serverErrorDataHandler, serverErrorHandler };
@@ -1,7 +1,2 @@
1
- import {
2
- handleGetRequest,
3
- serverErrorDataHandler,
4
- serverErrorHandler,
5
- } from './mswHandlers.js'
6
-
7
- export { handleGetRequest, serverErrorDataHandler, serverErrorHandler }
1
+ import { handleGetRequest, serverErrorDataHandler, serverErrorHandler, } from './mswHandlers.js';
2
+ export { handleGetRequest, serverErrorDataHandler, serverErrorHandler };
@@ -0,0 +1,5 @@
1
+ import type { HttpHandler, JsonBodyType } from 'msw';
2
+ declare function serverErrorHandler(errors: JsonBodyType): HttpHandler;
3
+ declare function serverErrorDataHandler(message: JsonBodyType): HttpHandler;
4
+ declare function handleGetRequest(url: string, data: JsonBodyType, status?: number): HttpHandler;
5
+ export { handleGetRequest, serverErrorDataHandler, serverErrorHandler };
@@ -1,27 +1,23 @@
1
- import { http, HttpResponse, passthrough } from 'msw'
2
-
3
- const serverErrorHandler = (errors) => {
4
- return http.all('*', ({ request }) => {
5
- if (request.method === 'GET') {
6
- return passthrough()
7
- }
8
- return HttpResponse.json(errors, { status: 400 })
9
- })
1
+ import { http, HttpResponse, passthrough } from 'msw';
2
+ function serverErrorHandler(errors) {
3
+ return http.all('*', ({ request }) => {
4
+ if (request.method === 'GET') {
5
+ return passthrough();
6
+ }
7
+ return HttpResponse.json(errors, { status: 400 });
8
+ });
10
9
  }
11
-
12
- const serverErrorDataHandler = (message) => {
13
- return http.all('*', ({ request }) => {
14
- if (request.method === 'GET') {
15
- return passthrough()
16
- }
17
- return HttpResponse.json({ non_field_errors: message }, { status: 400 })
18
- })
10
+ function serverErrorDataHandler(message) {
11
+ return http.all('*', ({ request }) => {
12
+ if (request.method === 'GET') {
13
+ return passthrough();
14
+ }
15
+ return HttpResponse.json({ non_field_errors: message }, { status: 400 });
16
+ });
19
17
  }
20
-
21
- const handleGetRequest = (url, data, status) => {
22
- return http.get(url, () => {
23
- return HttpResponse.json(data, { status })
24
- })
18
+ function handleGetRequest(url, data, status) {
19
+ return http.get(url, () => {
20
+ return HttpResponse.json(data, { status });
21
+ });
25
22
  }
26
-
27
- export { handleGetRequest, serverErrorDataHandler, serverErrorHandler }
23
+ export { handleGetRequest, serverErrorDataHandler, serverErrorHandler };
@@ -0,0 +1,8 @@
1
+ declare const ONDEVICE_BACKGROUNDS: {
2
+ default: string;
3
+ values: {
4
+ name: string;
5
+ value: string;
6
+ }[];
7
+ };
8
+ export { ONDEVICE_BACKGROUNDS };
@@ -1,10 +1,9 @@
1
1
  const ONDEVICE_BACKGROUNDS = {
2
- default: 'plain',
3
- values: [
4
- { name: 'plain', value: 'white' },
5
- { name: 'warm', value: 'hotpink' },
6
- { name: 'cool', value: 'deepskyblue' },
7
- ],
8
- }
9
-
10
- export { ONDEVICE_BACKGROUNDS }
2
+ default: 'plain',
3
+ values: [
4
+ { name: 'plain', value: 'white' },
5
+ { name: 'warm', value: 'hotpink' },
6
+ { name: 'cool', value: 'deepskyblue' },
7
+ ],
8
+ };
9
+ export { ONDEVICE_BACKGROUNDS };
@@ -0,0 +1,6 @@
1
+ import { ADDON_THEMES } from '../addons/addonThemes.js';
2
+ import { BACKGROUNDS } from '../backgrounds/backgrounds.js';
3
+ import { ONDEVICE_BACKGROUNDS } from '../ondevice/ondeviceBackgrounds.js';
4
+ import { SOURCE_LINK } from '../sourceLink/sourceLink.js';
5
+ import { VIEWPORTS } from '../viewport/viewport.js';
6
+ export { ADDON_THEMES, BACKGROUNDS, ONDEVICE_BACKGROUNDS, SOURCE_LINK, VIEWPORTS, };
@@ -1,13 +1,6 @@
1
- import { ADDON_THEMES } from '../addons/addonThemes.js'
2
- import { BACKGROUNDS } from '../backgrounds/backgrounds.js'
3
- import { ONDEVICE_BACKGROUNDS } from '../ondevice/ondeviceBackgrounds.js'
4
- import { SOURCE_LINK } from '../sourceLink/sourceLink.js'
5
- import { VIEWPORTS } from '../viewport/viewport.js'
6
-
7
- export {
8
- ADDON_THEMES,
9
- BACKGROUNDS,
10
- ONDEVICE_BACKGROUNDS,
11
- SOURCE_LINK,
12
- VIEWPORTS,
13
- }
1
+ import { ADDON_THEMES } from '../addons/addonThemes.js';
2
+ import { BACKGROUNDS } from '../backgrounds/backgrounds.js';
3
+ import { ONDEVICE_BACKGROUNDS } from '../ondevice/ondeviceBackgrounds.js';
4
+ import { SOURCE_LINK } from '../sourceLink/sourceLink.js';
5
+ import { VIEWPORTS } from '../viewport/viewport.js';
6
+ export { ADDON_THEMES, BACKGROUNDS, ONDEVICE_BACKGROUNDS, SOURCE_LINK, VIEWPORTS, };
@@ -0,0 +1,13 @@
1
+ declare const REFS: {
2
+ 'itcase-storybook': {
3
+ title: string;
4
+ url: string;
5
+ expanded: boolean;
6
+ };
7
+ 'itcase-ui': {
8
+ title: string;
9
+ url: string;
10
+ expanded: boolean;
11
+ };
12
+ };
13
+ export { REFS };
@@ -1,14 +1,13 @@
1
1
  const REFS = {
2
- 'itcase-storybook': {
3
- title: 'Introduction',
4
- url: 'https://itcase.pro/storybook/',
5
- expanded: false,
6
- },
7
- 'itcase-ui': {
8
- title: 'ITCase UI',
9
- url: 'https://itcase.pro/ui/',
10
- expanded: false,
11
- },
12
- }
13
-
14
- export { REFS }
2
+ 'itcase-storybook': {
3
+ title: 'Introduction',
4
+ url: 'https://itcase.pro/storybook/',
5
+ expanded: false,
6
+ },
7
+ 'itcase-ui': {
8
+ title: 'ITCase UI',
9
+ url: 'https://itcase.pro/ui/',
10
+ expanded: false,
11
+ },
12
+ };
13
+ export { REFS };
@@ -0,0 +1,35 @@
1
+ declare const SOURCE_LINK: {
2
+ links: {
3
+ before: {
4
+ href: string;
5
+ icon: string;
6
+ label: string;
7
+ order: number;
8
+ };
9
+ 'component-editor': ({ importPath, rootPath }: {
10
+ importPath: any;
11
+ rootPath: any;
12
+ }) => {
13
+ type: string;
14
+ label: string;
15
+ href: string;
16
+ icon: string;
17
+ };
18
+ 'story-editor': ({ importPath, rootPath }: {
19
+ importPath: any;
20
+ rootPath: any;
21
+ }) => {
22
+ type: string;
23
+ label: string;
24
+ href: string;
25
+ icon: string;
26
+ };
27
+ 'addon-powered-by': {
28
+ label: string;
29
+ href: string;
30
+ icon: string;
31
+ order: number;
32
+ };
33
+ };
34
+ };
35
+ export { SOURCE_LINK };
@@ -1,39 +1,35 @@
1
1
  /* eslint-disable perfectionist/sort-objects */
2
- import { getFileUrl } from 'storybook-addon-source-link'
3
-
2
+ import { getFileUrl } from 'storybook-addon-source-link';
4
3
  const SOURCE_LINK = {
5
- links: {
6
- before: { href: '', icon: '', label: '', order: 0 },
7
- 'component-editor': ({ importPath, rootPath }) => {
8
- if (!rootPath) return undefined
9
-
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)
17
-
18
- return {
19
- type: 'editor',
20
- label: 'VSCode — ' + componentPath,
21
- href: fileUrl.href,
22
- icon: 'VSCodeIcon',
23
- }
4
+ links: {
5
+ before: { href: '', icon: '', label: '', order: 0 },
6
+ 'component-editor': ({ importPath, rootPath }) => {
7
+ if (!rootPath)
8
+ return undefined;
9
+ const storiesFolderIndex = importPath.indexOf('/stories/');
10
+ const componentPath = storiesFolderIndex !== -1
11
+ ? `${importPath.slice(0, storiesFolderIndex)}/index.ts`
12
+ : importPath.replace(/\.stories\.(js|jsx|mjs|ts|tsx)$/, '.$1');
13
+ const fileUrl = getFileUrl(rootPath, componentPath);
14
+ return {
15
+ type: 'editor',
16
+ label: 'VSCode — ' + componentPath,
17
+ href: fileUrl.href,
18
+ icon: 'VSCodeIcon',
19
+ };
20
+ },
21
+ 'story-editor': ({ importPath, rootPath }) => {
22
+ if (!rootPath)
23
+ return undefined;
24
+ const fileUrl = getFileUrl(rootPath, importPath);
25
+ return {
26
+ type: 'editor',
27
+ label: 'Story — ' + importPath.replace(/\.(js|jsx|tsx|tsx)?$/, ''),
28
+ href: fileUrl.href,
29
+ icon: 'StorybookIcon',
30
+ };
31
+ },
32
+ 'addon-powered-by': { label: '', href: '', icon: '', order: 1000 },
24
33
  },
25
- 'story-editor': ({ importPath, rootPath }) => {
26
- if (!rootPath) return undefined
27
- const fileUrl = getFileUrl(rootPath, importPath)
28
- return {
29
- type: 'editor',
30
- label: 'Story — ' + importPath.replace(/\.(js|jsx|tsx|tsx)?$/, ''),
31
- href: fileUrl.href,
32
- icon: 'StorybookIcon',
33
- }
34
- },
35
- 'addon-powered-by': { label: '', href: '', icon: '', order: 1000 },
36
- },
37
- }
38
-
39
- export { SOURCE_LINK }
34
+ };
35
+ export { SOURCE_LINK };
@@ -0,0 +1,5 @@
1
+ declare const STATIC_DIRS_NEXTJS: {
2
+ from: string;
3
+ to: string;
4
+ }[];
5
+ export { STATIC_DIRS_NEXTJS };
@@ -1,7 +1,6 @@
1
1
  const STATIC_DIRS_NEXTJS = [
2
- { from: '../public', to: '/' },
3
- { from: '../src/appearance/', to: 'src/appearance/' },
4
- { from: '../public/img', to: 'img/' },
5
- ]
6
-
7
- export { STATIC_DIRS_NEXTJS }
2
+ { from: '../public', to: '/' },
3
+ { from: '../src/appearance/', to: 'src/appearance/' },
4
+ { from: '../public/img', to: 'img/' },
5
+ ];
6
+ export { STATIC_DIRS_NEXTJS };
@@ -0,0 +1,2 @@
1
+ declare const STATIC_DIRS_REACT_NATIVE: any[];
2
+ export { STATIC_DIRS_REACT_NATIVE };