@itcase/storybook-config 1.0.62 → 1.1.0
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/components/EmailTemplatePreview.js +1 -1
- package/dist/cjs/components/FormSubmitWrapper.js +3 -1
- package/dist/components/EmailTemplatePreview.js +1 -1
- package/dist/components/FormSubmitWrapper.js +3 -1
- package/dist/config/addonThemes.js +2 -1
- package/dist/config/addonsNextJs.js +1 -1
- package/dist/config/addonsReact.js +1 -2
- package/dist/config/addonsReactVite.js +1 -1
- package/dist/config/index.js +7 -3
- package/dist/config/mainConfig.js +20 -10
- package/dist/config/mainConfigVite.js +1 -1
- package/dist/config/refs.js +4 -4
- package/dist/config/sourceLink.js +7 -5
- package/dist/config/staticDirsNextJs.js +1 -0
- package/dist/config/staticDirsReact.js +1 -0
- package/dist/config/staticDirsReactVite.js +1 -0
- package/dist/config/status.js +3 -3
- package/dist/config/users.js +15 -3
- package/dist/config/viewports.js +4 -1
- package/dist/utils/getFigmaSourceLink.js +1 -1
- package/package.json +25 -25
|
@@ -34,9 +34,9 @@ function EmailTemplatePreview(props) {
|
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
36
|
return /*#__PURE__*/React.createElement("iframe", {
|
|
37
|
+
id: "emailPreview",
|
|
37
38
|
width: "100%",
|
|
38
39
|
height: "100%",
|
|
39
|
-
id: "emailPreview",
|
|
40
40
|
src: "" + BACKEND_URL + props.url,
|
|
41
41
|
style: style
|
|
42
42
|
});
|
|
@@ -4,8 +4,10 @@ var React = require('react');
|
|
|
4
4
|
|
|
5
5
|
function FormSubmitWrapper(props) {
|
|
6
6
|
var formRef = React.useRef();
|
|
7
|
+
var _props$submit = props.submit,
|
|
8
|
+
submit = _props$submit === void 0 ? true : _props$submit;
|
|
7
9
|
React.useEffect(function () {
|
|
8
|
-
if (formRef != null && formRef.current) {
|
|
10
|
+
if (formRef != null && formRef.current && submit) {
|
|
9
11
|
formRef.current.submit();
|
|
10
12
|
}
|
|
11
13
|
}, [formRef]);
|
|
@@ -32,9 +32,9 @@ function EmailTemplatePreview(props) {
|
|
|
32
32
|
return null;
|
|
33
33
|
}
|
|
34
34
|
return /*#__PURE__*/React.createElement("iframe", {
|
|
35
|
+
id: "emailPreview",
|
|
35
36
|
width: "100%",
|
|
36
37
|
height: "100%",
|
|
37
|
-
id: "emailPreview",
|
|
38
38
|
src: "" + BACKEND_URL + props.url,
|
|
39
39
|
style: style
|
|
40
40
|
});
|
|
@@ -2,8 +2,10 @@ import React, { useRef, useEffect } from 'react';
|
|
|
2
2
|
|
|
3
3
|
function FormSubmitWrapper(props) {
|
|
4
4
|
var formRef = useRef();
|
|
5
|
+
var _props$submit = props.submit,
|
|
6
|
+
submit = _props$submit === void 0 ? true : _props$submit;
|
|
5
7
|
useEffect(function () {
|
|
6
|
-
if (formRef != null && formRef.current) {
|
|
8
|
+
if (formRef != null && formRef.current && submit) {
|
|
7
9
|
formRef.current.submit();
|
|
8
10
|
}
|
|
9
11
|
}, [formRef]);
|
|
@@ -5,7 +5,7 @@ const ADDONS_NEXTJS = [
|
|
|
5
5
|
'@itcase/storybook-addon-auth',
|
|
6
6
|
'@storybook/addon-themes',
|
|
7
7
|
'@storybook/addon-designs',
|
|
8
|
-
'storybook-addon-source-link',
|
|
8
|
+
// 'storybook-addon-source-link',
|
|
9
9
|
'@etchteam/storybook-addon-status',
|
|
10
10
|
{
|
|
11
11
|
name: '@newhighsco/storybook-addon-transpile-modules',
|
|
@@ -4,7 +4,7 @@ const ADDONS_REACT = [
|
|
|
4
4
|
'@storybook/addon-themes',
|
|
5
5
|
'@storybook/addon-interactions',
|
|
6
6
|
'@storybook/addon-designs',
|
|
7
|
-
'storybook-addon-source-link',
|
|
7
|
+
// 'storybook-addon-source-link',
|
|
8
8
|
'@storybook/addon-themes',
|
|
9
9
|
'@etchteam/storybook-addon-status',
|
|
10
10
|
{
|
|
@@ -21,7 +21,6 @@ const ADDONS_REACT = [
|
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
loader: 'postcss-loader',
|
|
24
|
-
options: { implementation: require.resolve('postcss') },
|
|
25
24
|
},
|
|
26
25
|
],
|
|
27
26
|
},
|
package/dist/config/index.js
CHANGED
|
@@ -10,12 +10,16 @@ import { FRAMEWORK_REACT_VITE } from './frameworkReactVite.js'
|
|
|
10
10
|
import { MAIN_CONFIG } from './mainConfig.js'
|
|
11
11
|
import { MAIN_CONFIG_VITE } from './mainConfigVite.js'
|
|
12
12
|
import { REFS } from './refs.js'
|
|
13
|
-
import { SOURCELINK } from './sourceLink.js'
|
|
13
|
+
// import { SOURCELINK } from './sourceLink.js'
|
|
14
14
|
import { STATIC_DIRS_NEXTJS } from './staticDirsNextJs.js'
|
|
15
15
|
import { STATIC_DIRS_REACT } from './staticDirsReact.js'
|
|
16
16
|
import { STATIC_DIRS_REACT_VITE } from './staticDirsReactVite.js'
|
|
17
17
|
import { STATUS } from './status.js'
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
STORYSORT,
|
|
20
|
+
STORYSORT_DOCUMENTATION,
|
|
21
|
+
STORYSORT_ICONS,
|
|
22
|
+
} from './storySort.js'
|
|
19
23
|
import { VIEWPORTS } from './viewports.js'
|
|
20
24
|
|
|
21
25
|
export {
|
|
@@ -30,7 +34,7 @@ export {
|
|
|
30
34
|
FRAMEWORK_REACT,
|
|
31
35
|
FRAMEWORK_REACT_VITE,
|
|
32
36
|
ADDONS_REACT,
|
|
33
|
-
SOURCELINK,
|
|
37
|
+
// SOURCELINK,
|
|
34
38
|
ADDONS_REACT_VITE,
|
|
35
39
|
BACKGROUNDS,
|
|
36
40
|
MAIN_CONFIG,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { logger } from 'storybook/internal/node-logger'
|
|
2
|
+
|
|
3
|
+
const STORYBOOK_PUBLIC_PATH = null
|
|
4
|
+
|
|
1
5
|
const MAIN_CONFIG = {
|
|
2
|
-
core: {
|
|
3
|
-
disableTelemetry: true,
|
|
4
|
-
disableWhatsNewNotifications: true,
|
|
5
|
-
},
|
|
6
|
-
features: {
|
|
7
|
-
backgroundsStoryGlobals: true,
|
|
8
|
-
viewportStoryGlobals: true,
|
|
9
|
-
},
|
|
10
|
-
layout: 'fullscreen',
|
|
11
|
-
tags: ['autodocs'],
|
|
12
6
|
webpackFinal: async (config) => {
|
|
7
|
+
logger.info(
|
|
8
|
+
'=> Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one',
|
|
9
|
+
)
|
|
10
|
+
if (STORYBOOK_PUBLIC_PATH) {
|
|
11
|
+
config.output.publicPath = STORYBOOK_PUBLIC_PATH
|
|
12
|
+
}
|
|
13
13
|
const imageRule = config.module?.rules?.find((rule) => {
|
|
14
14
|
const test = rule.test
|
|
15
15
|
if (!test) {
|
|
@@ -26,6 +26,16 @@ const MAIN_CONFIG = {
|
|
|
26
26
|
})
|
|
27
27
|
return config
|
|
28
28
|
},
|
|
29
|
+
layout: 'fullscreen',
|
|
30
|
+
core: {
|
|
31
|
+
disableTelemetry: true,
|
|
32
|
+
disableWhatsNewNotifications: true,
|
|
33
|
+
},
|
|
34
|
+
features: {
|
|
35
|
+
backgroundsStoryGlobals: true,
|
|
36
|
+
viewportStoryGlobals: true,
|
|
37
|
+
},
|
|
38
|
+
tags: ['autodocs'],
|
|
29
39
|
}
|
|
30
40
|
|
|
31
41
|
export { MAIN_CONFIG }
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const MAIN_CONFIG_VITE = {
|
|
2
|
+
layout: 'fullscreen',
|
|
2
3
|
core: {
|
|
3
4
|
disableTelemetry: true,
|
|
4
5
|
},
|
|
@@ -6,7 +7,6 @@ const MAIN_CONFIG_VITE = {
|
|
|
6
7
|
backgroundsStoryGlobals: true,
|
|
7
8
|
viewportStoryGlobals: true,
|
|
8
9
|
},
|
|
9
|
-
layout: 'fullscreen',
|
|
10
10
|
tags: ['autodocs'],
|
|
11
11
|
}
|
|
12
12
|
|
package/dist/config/refs.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const REFS = {
|
|
2
2
|
'itcase-storybook': {
|
|
3
|
-
expanded: false,
|
|
4
|
-
title: 'Introduction',
|
|
5
3
|
url: 'https://itcase.pro/storybook/',
|
|
4
|
+
title: 'Introduction',
|
|
5
|
+
expanded: false,
|
|
6
6
|
},
|
|
7
7
|
'itcase-ui': {
|
|
8
|
-
expanded: false,
|
|
9
|
-
title: 'ITCase UI',
|
|
10
8
|
url: 'https://itcase.pro/ui/',
|
|
9
|
+
title: 'ITCase UI',
|
|
10
|
+
expanded: false,
|
|
11
11
|
},
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
+
/* eslint-disable perfectionist/sort-objects */
|
|
1
2
|
import { getFileUrl } from 'storybook-addon-source-link'
|
|
2
3
|
|
|
3
4
|
const SOURCELINK = {
|
|
4
5
|
links: {
|
|
5
|
-
before: {
|
|
6
|
+
before: { href: '', icon: '', label: '', order: 0 },
|
|
6
7
|
'component-vscode': ({ importPath, rootPath }) => {
|
|
7
8
|
if (!rootPath) return undefined
|
|
8
9
|
const componentPath = importPath.replace(/\.stories\.(js|tsx)?$/, '.js')
|
|
9
|
-
const labelPath =
|
|
10
|
+
const labelPath =
|
|
11
|
+
'Source — ' + importPath.replace(/\.stories\.(js|tsx)?$/, '')
|
|
10
12
|
const componentFileUrl = getFileUrl(rootPath, componentPath)
|
|
11
13
|
const href = `vscode://${componentFileUrl.href}`
|
|
12
|
-
return {
|
|
14
|
+
return { href: href, icon: 'VSCodeIcon', label: labelPath }
|
|
13
15
|
},
|
|
14
16
|
'story-vscode': ({ importPath, rootPath }) => {
|
|
15
17
|
if (!rootPath) return undefined
|
|
16
18
|
const fileUrl = getFileUrl(rootPath, importPath)
|
|
17
19
|
const labelPath = 'Story — ' + importPath.replace(/\.(js|tsx)?$/, '')
|
|
18
20
|
const href = `vscode://${fileUrl.href}`
|
|
19
|
-
return {
|
|
21
|
+
return { href: href, icon: 'StorybookIcon', label: labelPath }
|
|
20
22
|
},
|
|
21
|
-
'addon-powered-by': {
|
|
23
|
+
'addon-powered-by': { href: '', icon: '', label: '', order: 1000 },
|
|
22
24
|
},
|
|
23
25
|
}
|
|
24
26
|
|
package/dist/config/status.js
CHANGED
|
@@ -2,18 +2,18 @@ const STATUS = {
|
|
|
2
2
|
statuses: {
|
|
3
3
|
emailDevelopServer: {
|
|
4
4
|
color: '#ffffff',
|
|
5
|
-
background: 'red',
|
|
6
5
|
description: 'Story use template from local django-server',
|
|
6
|
+
background: 'red',
|
|
7
7
|
},
|
|
8
8
|
emailRemoteServer: {
|
|
9
9
|
color: '#ffffff',
|
|
10
|
-
background: 'green',
|
|
11
10
|
description: 'Story use template from remote server',
|
|
11
|
+
background: 'green',
|
|
12
12
|
},
|
|
13
13
|
emailServerUrlNotSet: {
|
|
14
14
|
color: '#ffffff',
|
|
15
|
-
background: 'red',
|
|
16
15
|
description: 'Please set EMAIL_URL in .env.local',
|
|
16
|
+
background: 'red',
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
type: !process.env.EMAIL_URL
|
package/dist/config/users.js
CHANGED
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { DEFAULT_USERS } from '@itcase/storybook-addon-auth/defaults'
|
|
2
2
|
|
|
3
3
|
const USERS = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
+
},
|
|
7
19
|
...DEFAULT_USERS,
|
|
8
20
|
}
|
|
9
21
|
|
package/dist/config/viewports.js
CHANGED
|
@@ -3,9 +3,9 @@ function getFigmaSourceLink(getMeta) {
|
|
|
3
3
|
const links = meta.design.reduce((result, item) => {
|
|
4
4
|
result[`figma${item.name}`] = () => {
|
|
5
5
|
return {
|
|
6
|
+
label: `Figma${item.name} — + ${meta.title}`,
|
|
6
7
|
href: item.url,
|
|
7
8
|
icon: 'FigmaIcon',
|
|
8
|
-
label: `Figma${item.name} — + ${meta.title}`,
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
return result
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/storybook-config",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"author": "ITCase",
|
|
5
5
|
"description": "Code style linter configuration presets",
|
|
6
6
|
"engines": {
|
|
@@ -60,25 +60,25 @@
|
|
|
60
60
|
"@etchteam/storybook-addon-status": "^5.0.0",
|
|
61
61
|
"@itcase/config": "^1.0.26",
|
|
62
62
|
"@itcase/storybook-addon-auth": "^1.0.5",
|
|
63
|
-
"@newhighsco/storybook-addon-transpile-modules": "^2.0.
|
|
64
|
-
"@storybook/addon-actions": "^8.6.
|
|
65
|
-
"@storybook/addon-controls": "^8.6.
|
|
63
|
+
"@newhighsco/storybook-addon-transpile-modules": "^2.0.59",
|
|
64
|
+
"@storybook/addon-actions": "^8.6.12",
|
|
65
|
+
"@storybook/addon-controls": "^8.6.12",
|
|
66
66
|
"@storybook/addon-designs": "^8.2.1",
|
|
67
|
-
"@storybook/addon-essentials": "^8.6.
|
|
68
|
-
"@storybook/addon-interactions": "^8.6.
|
|
69
|
-
"@storybook/addon-links": "^8.6.
|
|
67
|
+
"@storybook/addon-essentials": "^8.6.12",
|
|
68
|
+
"@storybook/addon-interactions": "^8.6.12",
|
|
69
|
+
"@storybook/addon-links": "^8.6.12",
|
|
70
70
|
"@storybook/addon-styling-webpack": "^1.0.1",
|
|
71
|
-
"@storybook/addon-themes": "^8.6.
|
|
72
|
-
"@storybook/addon-viewport": "^8.6.
|
|
71
|
+
"@storybook/addon-themes": "^8.6.12",
|
|
72
|
+
"@storybook/addon-viewport": "^8.6.12",
|
|
73
73
|
"@storybook/addon-webpack5-compiler-swc": "^3.0.0",
|
|
74
|
-
"@storybook/blocks": "^8.6.
|
|
75
|
-
"@storybook/manager-api": "^8.6.
|
|
76
|
-
"@storybook/nextjs": "^8.6.
|
|
77
|
-
"@storybook/preview-api": "^8.6.
|
|
78
|
-
"@storybook/react": "^8.6.
|
|
79
|
-
"@storybook/react-vite": "^8.6.
|
|
80
|
-
"@storybook/react-webpack5": "^8.6.
|
|
81
|
-
"@storybook/theming": "^8.6.
|
|
74
|
+
"@storybook/blocks": "^8.6.12",
|
|
75
|
+
"@storybook/manager-api": "^8.6.12",
|
|
76
|
+
"@storybook/nextjs": "^8.6.12",
|
|
77
|
+
"@storybook/preview-api": "^8.6.12",
|
|
78
|
+
"@storybook/react": "^8.6.12",
|
|
79
|
+
"@storybook/react-vite": "^8.6.12",
|
|
80
|
+
"@storybook/react-webpack5": "^8.6.12",
|
|
81
|
+
"@storybook/theming": "^8.6.12",
|
|
82
82
|
"http-proxy-middleware": "^3.0.3",
|
|
83
83
|
"msw": "^2.7.3",
|
|
84
84
|
"msw-storybook-addon": "^2.0.4",
|
|
@@ -89,9 +89,9 @@
|
|
|
89
89
|
"devDependencies": {
|
|
90
90
|
"@commitlint/cli": "^19.8.0",
|
|
91
91
|
"@commitlint/config-conventional": "^19.8.0",
|
|
92
|
-
"@itcase/common": "^1.2.
|
|
93
|
-
"@itcase/lint": "^1.
|
|
94
|
-
"@itcase/ui": "^1.
|
|
92
|
+
"@itcase/common": "^1.2.21",
|
|
93
|
+
"@itcase/lint": "^1.1.2",
|
|
94
|
+
"@itcase/ui": "^1.4.2",
|
|
95
95
|
"@rollup/plugin-babel": "^6.0.4",
|
|
96
96
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
97
97
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
@@ -101,19 +101,19 @@
|
|
|
101
101
|
"@types/react": "^18",
|
|
102
102
|
"@types/react-dom": "^18",
|
|
103
103
|
"conventional-changelog-conventionalcommits": "^8.0.0",
|
|
104
|
-
"eslint": "9.
|
|
104
|
+
"eslint": "9.24.0",
|
|
105
105
|
"glob": "^11.0.1",
|
|
106
106
|
"husky": "^9.1.7",
|
|
107
107
|
"lint-staged": "^15.5.0",
|
|
108
108
|
"prettier": "^3.5.3",
|
|
109
109
|
"react": "^18",
|
|
110
110
|
"react-dom": "^18",
|
|
111
|
-
"rollup": "^4.
|
|
111
|
+
"rollup": "^4.39.0",
|
|
112
112
|
"rollup-plugin-copy": "^3.5.0",
|
|
113
113
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
114
114
|
"semantic-release": "^24.2.3",
|
|
115
|
-
"storybook": "^8.6.
|
|
116
|
-
"stylelint": "^16.
|
|
117
|
-
"typescript": "^5.8.
|
|
115
|
+
"storybook": "^8.6.12",
|
|
116
|
+
"stylelint": "^16.18.0",
|
|
117
|
+
"typescript": "^5.8.3"
|
|
118
118
|
}
|
|
119
119
|
}
|