@itcase/storybook-config 1.1.56 → 1.1.57
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/config/sourceLink.js +15 -8
- package/package.json +1 -1
|
@@ -6,21 +6,28 @@ const SOURCE_LINK = {
|
|
|
6
6
|
before: { href: '', icon: '', label: '', order: 0 },
|
|
7
7
|
'component-vscode': ({ importPath, rootPath }) => {
|
|
8
8
|
if (!rootPath) return undefined
|
|
9
|
-
const componentPath = importPath.replace(/\.stories\.(js|tsx)?$/, '.js')
|
|
10
9
|
const labelPath =
|
|
11
10
|
'Source — ' + importPath.replace(/\.stories\.(js|tsx)?$/, '')
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
const href = `vscode://${
|
|
12
|
+
getFileUrl(rootPath, importPath.replace(/\.stories\.(js|tsx)?$/, '.js'))
|
|
13
|
+
.href
|
|
14
|
+
}`
|
|
15
|
+
const icon = 'VSCodeIcon'
|
|
16
|
+
return { label: labelPath, href: href, icon: icon }
|
|
15
17
|
},
|
|
16
18
|
'story-vscode': ({ importPath, rootPath }) => {
|
|
17
19
|
if (!rootPath) return undefined
|
|
18
|
-
|
|
20
|
+
|
|
19
21
|
const labelPath = 'Story — ' + importPath.replace(/\.(js|tsx)?$/, '')
|
|
20
|
-
const href = `vscode://${
|
|
21
|
-
|
|
22
|
+
const href = `vscode://${getFileUrl(rootPath, importPath).href}`
|
|
23
|
+
const icon = 'StorybookIcon'
|
|
24
|
+
return {
|
|
25
|
+
label: labelPath,
|
|
26
|
+
href: href,
|
|
27
|
+
icon: icon,
|
|
28
|
+
}
|
|
22
29
|
},
|
|
23
|
-
'addon-powered-by': {
|
|
30
|
+
'addon-powered-by': { label: '', href: '', icon: '', order: 1000 },
|
|
24
31
|
},
|
|
25
32
|
}
|
|
26
33
|
|