@itcase/storybook-config 1.0.15 → 1.0.16

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.
@@ -3,6 +3,8 @@ const ADDONS_NEXTJS = [
3
3
  '@storybook/addon-essentials',
4
4
  '@storybook/addon-interactions',
5
5
  '@itcase/storybook-addon-auth',
6
+ '@storybook/addon-designs',
7
+ 'storybook-addon-source-link'
6
8
  ]
7
9
 
8
10
  export { ADDONS_NEXTJS }
@@ -3,6 +3,8 @@ const ADDONS_REACT = [
3
3
  '@storybook/addon-essentials',
4
4
  '@storybook/addon-themes',
5
5
  '@storybook/addon-interactions',
6
+ '@storybook/addon-designs',
7
+ 'storybook-addon-source-link',
6
8
  {
7
9
  name: '@storybook/addon-styling-webpack',
8
10
  options: {
@@ -2,6 +2,8 @@ const ADDONS_REACT_VITE = [
2
2
  '@storybook/addon-links',
3
3
  '@storybook/addon-essentials',
4
4
  '@storybook/addon-interactions',
5
+ '@storybook/addon-designs',
6
+ 'storybook-addon-source-link'
5
7
  ]
6
8
 
7
9
  export { ADDONS_REACT_VITE }
package/config/index.js CHANGED
@@ -9,6 +9,7 @@ import { FRAMEWORK_REACT_VITE } from './frameworkReactVite'
9
9
  import { MAIN_CONFIG } from './mainConfig'
10
10
  import { MAIN_CONFIG_VITE } from './mainConfigVite'
11
11
  import { REFS } from './refs'
12
+ import { SOURCELINK } from './sourceLink'
12
13
  import { STATIC_DIRS_NEXTJS } from './staticDirsNextJs'
13
14
  import { STATIC_DIRS_REACT } from './staticDirsReact'
14
15
  import { STATIC_DIRS_REACT_VITE } from './staticDirsReactVite'
@@ -25,6 +26,7 @@ export {
25
26
  FRAMEWORK_REACT,
26
27
  FRAMEWORK_REACT_VITE,
27
28
  ADDONS_REACT,
29
+ SOURCELINK,
28
30
  ADDONS_REACT_VITE,
29
31
  BACKGROUNDS,
30
32
  MAIN_CONFIG,
@@ -0,0 +1,25 @@
1
+ import { getFileUrl } from 'storybook-addon-source-link'
2
+
3
+ const SOURCELINK = {
4
+ links: {
5
+ before: { label: '', href: '', order: 0, icon: '' },
6
+ 'component-vscode': ({ importPath, rootPath }) => {
7
+ if (!rootPath) return undefined
8
+ const componentPath = importPath.replace(/\.stories\.(js|tsx)?$/, '.js')
9
+ const labelPath = 'Source — ' + importPath.replace(/\.stories\.(js|tsx)?$/, '')
10
+ const componentFileUrl = getFileUrl(rootPath, componentPath)
11
+ const href = `vscode://${componentFileUrl.href}`
12
+ return { label: labelPath, href, icon: 'VSCodeIcon' }
13
+ },
14
+ 'story-vscode': ({ importPath, rootPath }) => {
15
+ if (!rootPath) return undefined
16
+ const fileUrl = getFileUrl(rootPath, importPath)
17
+ const labelPath = 'Story — ' + importPath.replace(/\.(js|tsx)?$/, '')
18
+ const href = `vscode://${fileUrl.href}`
19
+ return { label: labelPath, href, icon: 'StorybookIcon' }
20
+ },
21
+ 'addon-powered-by': { label: '', href: '', order: 1000, icon: '' },
22
+ },
23
+ }
24
+
25
+ export { SOURCELINK }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/storybook-config",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "author": "ITCase",
5
5
  "description": "Code style linter configuration presets",
6
6
  "engines": {
@@ -34,6 +34,8 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@itcase/config": "^1.0.6",
37
+ "@storybook/addon-designs": "^8.1.0",
38
+ "storybook-addon-source-link": "^0.2.1",
37
39
  "@itcase/storybook-addon-auth": "^1.0.4",
38
40
  "@storybook/addon-actions": "^8.5.3",
39
41
  "@storybook/addon-controls": "^8.5.3",