@itcase/storybook-config 1.1.88 → 1.1.89

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 (29) hide show
  1. package/package.json +10 -10
  2. package/dist/utils/getFigmaSourceLink.js +0 -16
  3. package/dist/utils/getStoryInfoBlocks.js +0 -57
  4. package/dist/utils/handleMSWParameters.js +0 -24
  5. package/dist/utils/hasFormParameters.js +0 -11
  6. package/dist/utils/index.js +0 -11
  7. /package/dist/config/{addonThemes.js → addons/addonThemes.js} +0 -0
  8. /package/dist/config/{addonsNextJs.js → addons/addonsNextJs.js} +0 -0
  9. /package/dist/config/{addonsVite.js → addons/addonsVite.js} +0 -0
  10. /package/dist/config/{addonsWebpack.js → addons/addonsWebpack.js} +0 -0
  11. /package/dist/config/{appearance.js → appearance/appearance.js} +0 -0
  12. /package/dist/config/{backgrounds.js → backgrounds/backgrounds.js} +0 -0
  13. /package/dist/config/{mainConfigVite.js → config/mainConfigVite.js} +0 -0
  14. /package/dist/config/{mainConfigWebpack.js → config/mainConfigWebpack.js} +0 -0
  15. /package/dist/config/{frameworkNextJs.js → framework/frameworkNextJs.js} +0 -0
  16. /package/dist/config/{frameworkVite.js → framework/frameworkVite.js} +0 -0
  17. /package/dist/config/{frameworkWebpack.js → framework/frameworkWebpack.js} +0 -0
  18. /package/dist/config/{index.js → main/index.js} +0 -0
  19. /package/dist/config/{mswHandlers.js → msw/mswHandlers.js} +0 -0
  20. /package/dist/config/{preview.js → preview/index.js} +0 -0
  21. /package/dist/config/{refs.js → refs/refs.js} +0 -0
  22. /package/dist/config/{sourceLink.js → sourceLink/sourceLink.js} +0 -0
  23. /package/dist/config/{staticDirsNextJs.js → static/staticDirsNextJs.js} +0 -0
  24. /package/dist/config/{staticDirsVite.js → static/staticDirsVite.js} +0 -0
  25. /package/dist/config/{staticDirsWebpack.js → static/staticDirsWebpack.js} +0 -0
  26. /package/dist/config/{status.js → status/status.js} +0 -0
  27. /package/dist/config/{authorization.js → users/authorization.js} +0 -0
  28. /package/dist/config/{users.js → users/users.js} +0 -0
  29. /package/dist/config/{viewport.js → viewport/viewport.js} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/storybook-config",
3
- "version": "1.1.88",
3
+ "version": "1.1.89",
4
4
  "author": "ITCase",
5
5
  "description": "Storybook configuration package",
6
6
  "engines": {
@@ -29,22 +29,22 @@
29
29
  "import": "./dist/components/*.js",
30
30
  "require": "./dist/cjs/components/*.js"
31
31
  },
32
- "./config/*": {
33
- "import": "./dist/config/*.js",
34
- "require": "./dist/config/*.js"
35
- },
36
- "./config": {
37
- "import": "./dist/config/index.js",
38
- "require": "./dist/config/index.js"
32
+ "./config/main": {
33
+ "import": "./dist/config/main/index.js",
34
+ "require": "./dist/config/main/index.js"
39
35
  },
40
36
  "./config/preview": {
41
- "import": "./dist/config/preview/preview.js",
42
- "require": "./dist/config/preview/preview.js"
37
+ "import": "./dist/config/preview/index.js",
38
+ "require": "./dist/config/preview/index.js"
43
39
  },
44
40
  "./css/*.css": {
45
41
  "import": "./dist/css/*.css",
46
42
  "require": "./dist/css/*.css"
47
43
  },
44
+ "./config/*": {
45
+ "import": "./dist/config/*.js",
46
+ "require": "./dist/config/*.js"
47
+ },
48
48
  "./decorators/*": {
49
49
  "import": "./dist/decorators/*.js",
50
50
  "require": "./dist/cjs/decorators/*.js"
@@ -1,16 +0,0 @@
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
14
- }
15
-
16
- export { getFigmaSourceLink }
@@ -1,57 +0,0 @@
1
- import camelCase from 'lodash/camelCase'
2
-
3
- import { axiosInstanceITCase } from '@itcase/common'
4
-
5
- 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
55
- }
56
-
57
- export { getStoryInfoBlocks }
@@ -1,24 +0,0 @@
1
- import { serverErrorHandler } from '../config/msw/mswHandlers'
2
-
3
- function handleMSWParameters(parameters, args) {
4
- let mswHandlersParams = {}
5
-
6
- if (parameters.serverError) {
7
- mswHandlersParams = {
8
- msw: {
9
- handlers: [serverErrorHandler(parameters.formUrl, args.errors)],
10
- },
11
- }
12
- }
13
- // else if (parameters.error500) {
14
- // mswHandlersParams = {
15
- // msw: {
16
- // handlers: [error500Handler(parameters.formUrl)],
17
- // },
18
- // }
19
- // }
20
-
21
- return mswHandlersParams
22
- }
23
-
24
- export { handleMSWParameters }
@@ -1,11 +0,0 @@
1
- function hasFormParameters(parameters) {
2
- return Boolean(
3
- parameters.require ||
4
- parameters.validation ||
5
- parameters.error ||
6
- parameters.serverError ||
7
- parameters.serverErrorData,
8
- )
9
- }
10
-
11
- export { hasFormParameters }
@@ -1,11 +0,0 @@
1
- import { getFigmaSourceLink } from './getFigmaSourceLink'
2
- import { getStoryInfoBlocks } from './getStoryInfoBlocks'
3
- import { handleMSWParameters } from './handleMSWParameters'
4
- import { hasFormParameters } from './hasFormParameters'
5
-
6
- export {
7
- hasFormParameters,
8
- handleMSWParameters,
9
- getStoryInfoBlocks,
10
- getFigmaSourceLink,
11
- }
File without changes
File without changes
File without changes
File without changes
File without changes