cob-cli 2.12.0 → 2.13.1
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/README.publish.md +10 -0
- package/customizations/backend.js +1 -0
- package/customizations/backend.vuepress.js +35 -0
- package/customizations/frontend.js +1 -0
- package/lib/task_lists/rsyncFilter.txt +3 -2
- package/lib/task_lists/test_otherFilesContiousReload.js +1 -1
- package/package.json +5 -1
- package/templates/backend/vuepress/integrationm/actions/getVuePressDoc.groovy +74 -0
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarConfig.groovy +42 -0
- package/templates/backend/vuepress/integrationm/actions/getVuePressSidebarRootElements.groovy +17 -0
- package/templates/backend/vuepress/others/vuepress/definition_contents_v234.json +619 -0
- package/templates/backend/vuepress/others/vuepress/nginx/README.md +28 -0
- package/templates/backend/vuepress/others/vuepress/package-lock.json +29656 -0
- package/templates/backend/vuepress/others/vuepress/package.json +24 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/DescriptVideo.vue +22 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/Graph.vue +124 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/ReadingTime.vue +26 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/References.vue +228 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/components/RestrictedContent.vue +77 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.js +101 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/config.json +31 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/enhanceApp.js +14 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/nav/getNavTranslated.js +52 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/plugins/References.js +96 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/Logo-Cult-of-Bits-400x400-1.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/favicon-cob.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/public/logo.png +0 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/index.styl +39 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/styles/palette.styl +17 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/LICENSE +21 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/README.md +11 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/AlgoliaSearchBox.vue +172 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownLink.vue +252 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/DropdownTransition.vue +33 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Home.vue +134 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLink.vue +98 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/NavLinks.vue +165 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Navbar.vue +140 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Page.vue +31 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue +119 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageNav.vue +163 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/Sidebar.vue +64 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue +40 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue +144 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue +140 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLinks.vue +114 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/Badge.vue +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeBlock.vue +41 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/global-components/CodeGroup.vue +120 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/index.js +59 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/404.vue +30 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/layouts/Layout.vue +151 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/noopModule.js +1 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/package.json +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/arrow.styl +22 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/code.styl +137 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/config.styl +1 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/custom-blocks.styl +44 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/index.styl +202 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/mobile.styl +37 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/toc.styl +3 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/styles/wrapper.styl +10 -0
- package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/util/index.js +244 -0
- package/templates/dashboards/dash/definition_dashboard_v59.json +1 -0
- package/templates/dashboards/dash/dist/dashboard.html +8 -3
- package/templates/dashboards/dash/dist/js/{app.a65a4c2c.js → app.8423eff3.js} +2 -2
- package/templates/dashboards/dash/dist/js/app.8423eff3.js.map +1 -0
- package/templates/dashboards/dash/dist/js/app.f9c19b80.js +188 -0
- package/templates/dashboards/dash/dist/js/app.f9c19b80.js.map +1 -0
- package/templates/dashboards/dash/src/App.vue +32 -212
- package/templates/dashboards/dash/src/Dashboard.vue +31 -11
- package/templates/dashboards/dash/src/collector.js +35 -3694
- package/templates/dashboards/dash/src/components/Menu.vue +15 -4
- package/templates/dashboards/dash/src/components/Title.vue +10 -2
- package/templates/dashboards/dash/src/components/Totals.vue +19 -9
- package/templates/dashboards/dash/src/components/{TotalsBadge.vue → TotalsValue.vue} +12 -12
- package/templates/dashboards/dash/src/dashboard.html +6 -1
- package/templates/dashboards/dash/src/test_collector.js +3732 -0
- package/templates/dashboards/dash/dist/js/app.a65a4c2c.js.map +0 -1
package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/PageEdit.vue
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<footer v-if="editLink || lastUpdated" class="page-edit">
|
|
3
|
+
<div
|
|
4
|
+
v-if="editLink && loggedIn"
|
|
5
|
+
class="edit-link"
|
|
6
|
+
>
|
|
7
|
+
<a
|
|
8
|
+
:href="editLink"
|
|
9
|
+
target="_blank"
|
|
10
|
+
rel="noopener noreferrer"
|
|
11
|
+
>
|
|
12
|
+
{{ editLinkText }}
|
|
13
|
+
<OutboundLink />
|
|
14
|
+
</a>
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
<div
|
|
18
|
+
v-if="lastUpdated"
|
|
19
|
+
class="last-updated"
|
|
20
|
+
>
|
|
21
|
+
<span class="prefix">{{ lastUpdatedText }}:</span>
|
|
22
|
+
<span class="time">{{ lastUpdated }}</span>
|
|
23
|
+
</div>
|
|
24
|
+
</footer>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
import isNil from 'lodash/isNil'
|
|
29
|
+
import { umLoggedin } from '@cob/rest-api-wrapper';
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'PageEdit',
|
|
33
|
+
|
|
34
|
+
data: () => ({
|
|
35
|
+
userInfo : {},
|
|
36
|
+
loggedIn : false
|
|
37
|
+
}),
|
|
38
|
+
created() {
|
|
39
|
+
umLoggedin().then( userInfo => {this.userInfo = userInfo, this.loggedIn=userInfo.username != 'anonymous' }).catch( () => this.loggedIn == false)
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
lastUpdated () {
|
|
43
|
+
return this.$page.lastUpdated
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
lastUpdatedText () {
|
|
47
|
+
if (typeof this.$themeLocaleConfig.lastUpdated === 'string') {
|
|
48
|
+
return this.$themeLocaleConfig.lastUpdated
|
|
49
|
+
}
|
|
50
|
+
if (typeof this.$site.themeConfig.lastUpdated === 'string') {
|
|
51
|
+
return this.$site.themeConfig.lastUpdated
|
|
52
|
+
}
|
|
53
|
+
return 'Last Updated'
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
editLink () {
|
|
57
|
+
const showEditLink = isNil(this.$page.frontmatter.editLink)
|
|
58
|
+
? this.$site.themeConfig.editLinks
|
|
59
|
+
: this.$page.frontmatter.editLink
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
if (showEditLink && this.$page.frontmatter.id) {
|
|
63
|
+
return "/recordm/#/instance/" + this.$page.frontmatter.id
|
|
64
|
+
}
|
|
65
|
+
return null
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
editLinkText () {
|
|
69
|
+
return (
|
|
70
|
+
this.$themeLocaleConfig.editLinkText
|
|
71
|
+
|| this.$site.themeConfig.editLinkText
|
|
72
|
+
|| `Source`
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
</script>
|
|
78
|
+
|
|
79
|
+
<style lang="stylus">
|
|
80
|
+
@require '../styles/wrapper.styl'
|
|
81
|
+
|
|
82
|
+
.page-edit
|
|
83
|
+
@extend $wrapper
|
|
84
|
+
padding-top 1rem
|
|
85
|
+
padding-bottom 1rem
|
|
86
|
+
overflow auto
|
|
87
|
+
|
|
88
|
+
.edit-link
|
|
89
|
+
display inline-block
|
|
90
|
+
a
|
|
91
|
+
color lighten($textColor, 75%)
|
|
92
|
+
margin-right 0.25rem
|
|
93
|
+
.icon.outbound
|
|
94
|
+
color lighten($textColor, 75%)
|
|
95
|
+
&:hover
|
|
96
|
+
.icon.outbound
|
|
97
|
+
color lighten($textColor, 15%)
|
|
98
|
+
color lighten($textColor, 15%)
|
|
99
|
+
|
|
100
|
+
.last-updated
|
|
101
|
+
float right
|
|
102
|
+
font-size 0.9em
|
|
103
|
+
.prefix
|
|
104
|
+
font-weight 500
|
|
105
|
+
color lighten($textColor, 25%)
|
|
106
|
+
.time
|
|
107
|
+
font-weight 400
|
|
108
|
+
color #767676
|
|
109
|
+
|
|
110
|
+
@media (max-width: $MQMobile)
|
|
111
|
+
.page-edit
|
|
112
|
+
.edit-link
|
|
113
|
+
margin-bottom 0.5rem
|
|
114
|
+
.last-updated
|
|
115
|
+
font-size 0.8em
|
|
116
|
+
float none
|
|
117
|
+
text-align left
|
|
118
|
+
|
|
119
|
+
</style>
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="prev || next"
|
|
4
|
+
class="page-nav"
|
|
5
|
+
>
|
|
6
|
+
<p class="inner">
|
|
7
|
+
<span
|
|
8
|
+
v-if="prev"
|
|
9
|
+
class="prev"
|
|
10
|
+
>
|
|
11
|
+
←
|
|
12
|
+
<a
|
|
13
|
+
v-if="prev.type === 'external'"
|
|
14
|
+
class="prev"
|
|
15
|
+
:href="prev.path"
|
|
16
|
+
target="_blank"
|
|
17
|
+
rel="noopener noreferrer"
|
|
18
|
+
>
|
|
19
|
+
{{ prev.title || prev.path }}
|
|
20
|
+
|
|
21
|
+
<OutboundLink />
|
|
22
|
+
</a>
|
|
23
|
+
|
|
24
|
+
<RouterLink
|
|
25
|
+
v-else
|
|
26
|
+
class="prev"
|
|
27
|
+
:to="prev.path"
|
|
28
|
+
>
|
|
29
|
+
{{ prev.title || prev.path }}
|
|
30
|
+
</RouterLink>
|
|
31
|
+
</span>
|
|
32
|
+
|
|
33
|
+
<span
|
|
34
|
+
v-if="next"
|
|
35
|
+
class="next"
|
|
36
|
+
>
|
|
37
|
+
<a
|
|
38
|
+
v-if="next.type === 'external'"
|
|
39
|
+
:href="next.path"
|
|
40
|
+
target="_blank"
|
|
41
|
+
rel="noopener noreferrer"
|
|
42
|
+
>
|
|
43
|
+
{{ next.title || next.path }}
|
|
44
|
+
|
|
45
|
+
<OutboundLink />
|
|
46
|
+
</a>
|
|
47
|
+
|
|
48
|
+
<RouterLink
|
|
49
|
+
v-else
|
|
50
|
+
:to="next.path"
|
|
51
|
+
>
|
|
52
|
+
{{ next.title || next.path }}
|
|
53
|
+
</RouterLink>
|
|
54
|
+
→
|
|
55
|
+
</span>
|
|
56
|
+
</p>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script>
|
|
61
|
+
import { resolvePage } from '../util'
|
|
62
|
+
import isString from 'lodash/isString'
|
|
63
|
+
import isNil from 'lodash/isNil'
|
|
64
|
+
|
|
65
|
+
export default {
|
|
66
|
+
name: 'PageNav',
|
|
67
|
+
|
|
68
|
+
props: ['sidebarItems'],
|
|
69
|
+
|
|
70
|
+
computed: {
|
|
71
|
+
prev () {
|
|
72
|
+
return resolvePageLink(LINK_TYPES.PREV, this)
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
next () {
|
|
76
|
+
return resolvePageLink(LINK_TYPES.NEXT, this)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function resolvePrev (page, items) {
|
|
82
|
+
return find(page, items, -1)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function resolveNext (page, items) {
|
|
86
|
+
return find(page, items, 1)
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const LINK_TYPES = {
|
|
90
|
+
NEXT: {
|
|
91
|
+
resolveLink: resolveNext,
|
|
92
|
+
getThemeLinkConfig: ({ nextLinks }) => nextLinks,
|
|
93
|
+
getPageLinkConfig: ({ frontmatter }) => frontmatter.next
|
|
94
|
+
},
|
|
95
|
+
PREV: {
|
|
96
|
+
resolveLink: resolvePrev,
|
|
97
|
+
getThemeLinkConfig: ({ prevLinks }) => prevLinks,
|
|
98
|
+
getPageLinkConfig: ({ frontmatter }) => frontmatter.prev
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function resolvePageLink (
|
|
103
|
+
linkType,
|
|
104
|
+
{ $themeConfig, $page, $route, $site, sidebarItems }
|
|
105
|
+
) {
|
|
106
|
+
const { resolveLink, getThemeLinkConfig, getPageLinkConfig } = linkType
|
|
107
|
+
|
|
108
|
+
// Get link config from theme
|
|
109
|
+
const themeLinkConfig = getThemeLinkConfig($themeConfig)
|
|
110
|
+
|
|
111
|
+
// Get link config from current page
|
|
112
|
+
const pageLinkConfig = getPageLinkConfig($page)
|
|
113
|
+
|
|
114
|
+
// Page link config will overwrite global theme link config if defined
|
|
115
|
+
const link = isNil(pageLinkConfig) ? themeLinkConfig : pageLinkConfig
|
|
116
|
+
|
|
117
|
+
if (link === false) {
|
|
118
|
+
return
|
|
119
|
+
} else if (isString(link)) {
|
|
120
|
+
return resolvePage($site.pages, link, $route.path)
|
|
121
|
+
} else {
|
|
122
|
+
return resolveLink($page, sidebarItems)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function find (page, items, offset) {
|
|
127
|
+
const res = []
|
|
128
|
+
flatten(items, res)
|
|
129
|
+
for (let i = 0; i < res.length; i++) {
|
|
130
|
+
const cur = res[i]
|
|
131
|
+
if (cur.type === 'page' && cur.path === decodeURIComponent(page.path)) {
|
|
132
|
+
return res[i + offset]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function flatten (items, res) {
|
|
138
|
+
for (let i = 0, l = items.length; i < l; i++) {
|
|
139
|
+
if (items[i].type === 'group') {
|
|
140
|
+
flatten(items[i].children || [], res)
|
|
141
|
+
} else {
|
|
142
|
+
res.push(items[i])
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
</script>
|
|
147
|
+
|
|
148
|
+
<style lang="stylus">
|
|
149
|
+
@require '../styles/wrapper.styl'
|
|
150
|
+
|
|
151
|
+
.page-nav
|
|
152
|
+
@extend $wrapper
|
|
153
|
+
padding-top 1rem
|
|
154
|
+
padding-bottom 0
|
|
155
|
+
.inner
|
|
156
|
+
min-height 2rem
|
|
157
|
+
margin-top 0
|
|
158
|
+
border-top 1px solid $borderColor
|
|
159
|
+
padding-top 1rem
|
|
160
|
+
overflow auto // clear float
|
|
161
|
+
.next
|
|
162
|
+
float right
|
|
163
|
+
</style>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<aside class="sidebar">
|
|
3
|
+
<NavLinks />
|
|
4
|
+
|
|
5
|
+
<slot name="top" />
|
|
6
|
+
|
|
7
|
+
<SidebarLinks
|
|
8
|
+
:depth="0"
|
|
9
|
+
:items="items"
|
|
10
|
+
/>
|
|
11
|
+
<slot name="bottom" />
|
|
12
|
+
</aside>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import SidebarLinks from '@theme/components/SidebarLinks.vue'
|
|
17
|
+
import NavLinks from '@theme/components/NavLinks.vue'
|
|
18
|
+
|
|
19
|
+
export default {
|
|
20
|
+
name: 'Sidebar',
|
|
21
|
+
|
|
22
|
+
components: { SidebarLinks, NavLinks },
|
|
23
|
+
|
|
24
|
+
props: ['items']
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style lang="stylus">
|
|
29
|
+
.sidebar
|
|
30
|
+
ul
|
|
31
|
+
padding 0
|
|
32
|
+
margin 0
|
|
33
|
+
list-style-type none
|
|
34
|
+
a
|
|
35
|
+
display inline-block
|
|
36
|
+
.nav-links
|
|
37
|
+
display none
|
|
38
|
+
border-bottom 1px solid $borderColor
|
|
39
|
+
padding 0.5rem 0 0.75rem 0
|
|
40
|
+
a
|
|
41
|
+
font-weight 600
|
|
42
|
+
.nav-item, .repo-link
|
|
43
|
+
display block
|
|
44
|
+
line-height 1.25rem
|
|
45
|
+
font-size 1.1em
|
|
46
|
+
padding 0.5rem 0 0.5rem 1.5rem
|
|
47
|
+
& > .sidebar-links
|
|
48
|
+
padding 1.5rem 0
|
|
49
|
+
& > li > a.sidebar-link
|
|
50
|
+
font-size 1.1em
|
|
51
|
+
line-height 1.7
|
|
52
|
+
font-weight bold
|
|
53
|
+
& > li:not(:first-child)
|
|
54
|
+
margin-top .75rem
|
|
55
|
+
|
|
56
|
+
@media (max-width: $MQMobile)
|
|
57
|
+
.sidebar
|
|
58
|
+
.nav-links
|
|
59
|
+
display block
|
|
60
|
+
.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after
|
|
61
|
+
top calc(1rem - 2px)
|
|
62
|
+
& > .sidebar-links
|
|
63
|
+
padding 1rem 0
|
|
64
|
+
</style>
|
package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarButton.vue
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="sidebar-button"
|
|
4
|
+
@click="$emit('toggle-sidebar')"
|
|
5
|
+
>
|
|
6
|
+
<svg
|
|
7
|
+
class="icon"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
aria-hidden="true"
|
|
10
|
+
role="img"
|
|
11
|
+
viewBox="0 0 448 512"
|
|
12
|
+
>
|
|
13
|
+
<path
|
|
14
|
+
fill="currentColor"
|
|
15
|
+
d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"
|
|
16
|
+
class=""
|
|
17
|
+
/>
|
|
18
|
+
</svg>
|
|
19
|
+
</div>
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
<style lang="stylus">
|
|
23
|
+
.sidebar-button
|
|
24
|
+
cursor pointer
|
|
25
|
+
display none
|
|
26
|
+
width 1.25rem
|
|
27
|
+
height 1.25rem
|
|
28
|
+
position absolute
|
|
29
|
+
padding 0.6rem
|
|
30
|
+
top 0.6rem
|
|
31
|
+
left 1rem
|
|
32
|
+
.icon
|
|
33
|
+
display block
|
|
34
|
+
width 1.25rem
|
|
35
|
+
height 1.25rem
|
|
36
|
+
|
|
37
|
+
@media (max-width: $MQMobile)
|
|
38
|
+
.sidebar-button
|
|
39
|
+
display block
|
|
40
|
+
</style>
|
package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarGroup.vue
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
class="sidebar-group"
|
|
4
|
+
:class="[
|
|
5
|
+
{
|
|
6
|
+
collapsable,
|
|
7
|
+
'is-sub-group': depth !== 0
|
|
8
|
+
},
|
|
9
|
+
`depth-${depth}`
|
|
10
|
+
]"
|
|
11
|
+
>
|
|
12
|
+
<RouterLink
|
|
13
|
+
v-if="item.path"
|
|
14
|
+
class="sidebar-heading clickable"
|
|
15
|
+
:class="{
|
|
16
|
+
open,
|
|
17
|
+
'active': isActive($route, item.path)
|
|
18
|
+
}"
|
|
19
|
+
:to="item.path"
|
|
20
|
+
@click.native="$emit('toggle')"
|
|
21
|
+
>
|
|
22
|
+
<span>{{ item.title }}</span>
|
|
23
|
+
<span
|
|
24
|
+
v-if="collapsable"
|
|
25
|
+
class="arrow"
|
|
26
|
+
:class="open ? 'down' : 'right'"
|
|
27
|
+
/>
|
|
28
|
+
</RouterLink>
|
|
29
|
+
|
|
30
|
+
<p
|
|
31
|
+
v-else
|
|
32
|
+
class="sidebar-heading"
|
|
33
|
+
:class="{ open }"
|
|
34
|
+
@click="$emit('toggle')"
|
|
35
|
+
>
|
|
36
|
+
<span>{{ item.title }}</span>
|
|
37
|
+
<span
|
|
38
|
+
v-if="collapsable"
|
|
39
|
+
class="arrow"
|
|
40
|
+
:class="open ? 'down' : 'right'"
|
|
41
|
+
/>
|
|
42
|
+
</p>
|
|
43
|
+
|
|
44
|
+
<DropdownTransition>
|
|
45
|
+
<SidebarLinks
|
|
46
|
+
v-if="open || !collapsable"
|
|
47
|
+
class="sidebar-group-items"
|
|
48
|
+
:items="item.children"
|
|
49
|
+
:sidebar-depth="item.sidebarDepth"
|
|
50
|
+
:initial-open-group-index="item.initialOpenGroupIndex"
|
|
51
|
+
:depth="depth + 1"
|
|
52
|
+
/>
|
|
53
|
+
</DropdownTransition>
|
|
54
|
+
</section>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script>
|
|
58
|
+
import { isActive } from '../util'
|
|
59
|
+
import DropdownTransition from '@theme/components/DropdownTransition.vue'
|
|
60
|
+
|
|
61
|
+
export default {
|
|
62
|
+
name: 'SidebarGroup',
|
|
63
|
+
|
|
64
|
+
components: {
|
|
65
|
+
DropdownTransition
|
|
66
|
+
},
|
|
67
|
+
|
|
68
|
+
props: [
|
|
69
|
+
'item',
|
|
70
|
+
'open',
|
|
71
|
+
'collapsable',
|
|
72
|
+
'depth'
|
|
73
|
+
],
|
|
74
|
+
|
|
75
|
+
// ref: https://vuejs.org/v2/guide/components-edge-cases.html#Circular-References-Between-Components
|
|
76
|
+
beforeCreate () {
|
|
77
|
+
this.$options.components.SidebarLinks = require('@theme/components/SidebarLinks.vue').default
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
methods: { isActive }
|
|
81
|
+
}
|
|
82
|
+
</script>
|
|
83
|
+
|
|
84
|
+
<style lang="stylus">
|
|
85
|
+
.sidebar-group
|
|
86
|
+
.sidebar-group
|
|
87
|
+
padding-left 0.5em
|
|
88
|
+
&:not(.collapsable)
|
|
89
|
+
.sidebar-heading:not(.clickable)
|
|
90
|
+
cursor auto
|
|
91
|
+
color inherit
|
|
92
|
+
// refine styles of nested sidebar groups
|
|
93
|
+
&.is-sub-group
|
|
94
|
+
padding-left 0
|
|
95
|
+
& > .sidebar-heading
|
|
96
|
+
font-size 0.95em
|
|
97
|
+
line-height 1.4
|
|
98
|
+
font-weight normal
|
|
99
|
+
padding-left 2rem
|
|
100
|
+
font-size 1em
|
|
101
|
+
font-weight 400
|
|
102
|
+
&.active
|
|
103
|
+
font-weight 600
|
|
104
|
+
color $accentColor
|
|
105
|
+
border-left-color $accentColor
|
|
106
|
+
&:not(.clickable)
|
|
107
|
+
opacity 0.5
|
|
108
|
+
& > .sidebar-group-items
|
|
109
|
+
padding-left 1rem
|
|
110
|
+
& > li > .sidebar-link
|
|
111
|
+
font-size 0.95em
|
|
112
|
+
border-left none
|
|
113
|
+
&.depth-2
|
|
114
|
+
& > .sidebar-heading
|
|
115
|
+
border-left none
|
|
116
|
+
|
|
117
|
+
.sidebar-heading
|
|
118
|
+
color $textColor
|
|
119
|
+
transition color .15s ease
|
|
120
|
+
cursor pointer
|
|
121
|
+
font-size 1.1em
|
|
122
|
+
font-weight bold
|
|
123
|
+
// text-transform uppercase
|
|
124
|
+
padding 0.35rem 1.5rem 0.35rem 1.25rem
|
|
125
|
+
width 100%
|
|
126
|
+
box-sizing border-box
|
|
127
|
+
margin 0
|
|
128
|
+
border-left 0.25rem solid transparent
|
|
129
|
+
&.open, &:hover
|
|
130
|
+
color inherit
|
|
131
|
+
.arrow
|
|
132
|
+
display none
|
|
133
|
+
&.clickable
|
|
134
|
+
&.active
|
|
135
|
+
color $accentColor
|
|
136
|
+
border-left-color $accentColor
|
|
137
|
+
&:hover
|
|
138
|
+
color $accentColor
|
|
139
|
+
|
|
140
|
+
.sidebar-group-items
|
|
141
|
+
transition height .1s ease-out
|
|
142
|
+
font-size 0.95em
|
|
143
|
+
overflow hidden
|
|
144
|
+
</style>
|
package/templates/backend/vuepress/others/vuepress/src/.vuepress/theme/components/SidebarLink.vue
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { isActive, hashRE, groupHeaders } from '../util'
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
functional: true,
|
|
6
|
+
|
|
7
|
+
props: ['item', 'sidebarDepth','hide'],
|
|
8
|
+
|
|
9
|
+
render (h,
|
|
10
|
+
{
|
|
11
|
+
parent: {
|
|
12
|
+
$page,
|
|
13
|
+
$site,
|
|
14
|
+
$route,
|
|
15
|
+
$themeConfig,
|
|
16
|
+
$themeLocaleConfig
|
|
17
|
+
},
|
|
18
|
+
props: {
|
|
19
|
+
item,
|
|
20
|
+
sidebarDepth,
|
|
21
|
+
hide
|
|
22
|
+
}
|
|
23
|
+
}) {
|
|
24
|
+
// use custom active class matching logic
|
|
25
|
+
// due to edge case of paths ending with / + hash
|
|
26
|
+
const selfActive = isActive($route, item.path)
|
|
27
|
+
// for sidebar: auto pages, a hash link should be active if one of its child
|
|
28
|
+
// matches
|
|
29
|
+
const active = item.type === 'auto'
|
|
30
|
+
? selfActive || item.children.some(c => isActive($route, item.basePath + '#' + c.slug))
|
|
31
|
+
: selfActive
|
|
32
|
+
|
|
33
|
+
const link = item.type === 'external'
|
|
34
|
+
? renderExternal(h, item.path, item.title || item.path)
|
|
35
|
+
: renderLink(h, item.path, item.title || item.path, active, hide)
|
|
36
|
+
|
|
37
|
+
const maxDepth = [
|
|
38
|
+
$page.frontmatter.sidebarDepth,
|
|
39
|
+
sidebarDepth,
|
|
40
|
+
$themeLocaleConfig.sidebarDepth,
|
|
41
|
+
$themeConfig.sidebarDepth,
|
|
42
|
+
1
|
|
43
|
+
].find(depth => depth !== undefined)
|
|
44
|
+
|
|
45
|
+
const displayAllHeaders = $themeLocaleConfig.displayAllHeaders
|
|
46
|
+
|| $themeConfig.displayAllHeaders
|
|
47
|
+
|
|
48
|
+
if (item.type === 'auto') {
|
|
49
|
+
return [link, renderChildren(h, item.children, item.basePath, $route, maxDepth, hide)]
|
|
50
|
+
} else if ((active || displayAllHeaders) && item.headers && !hashRE.test(item.path)) {
|
|
51
|
+
const children = groupHeaders(item.headers)
|
|
52
|
+
return [link, renderChildren(h, children, item.path, $route, maxDepth, hide)]
|
|
53
|
+
} else {
|
|
54
|
+
return link
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function renderLink (h, to, text, active, hide, level) {
|
|
60
|
+
const component = {
|
|
61
|
+
props: {
|
|
62
|
+
to,
|
|
63
|
+
activeClass: '',
|
|
64
|
+
exactActiveClass: ''
|
|
65
|
+
},
|
|
66
|
+
class: {
|
|
67
|
+
active,
|
|
68
|
+
'sidebar-link': true,
|
|
69
|
+
'hide': hide
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (level > 2) {
|
|
74
|
+
component.style = {
|
|
75
|
+
'padding-left': level + 'rem'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return h('RouterLink', component, text)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function renderChildren (h, children, path, route, maxDepth, hide, depth = 1) {
|
|
83
|
+
if (!children || depth > maxDepth) return null
|
|
84
|
+
return h('ul', { class: 'sidebar-sub-headers' }, children.map(c => {
|
|
85
|
+
const active = isActive(route, path + '#' + c.slug)
|
|
86
|
+
|
|
87
|
+
return h('li', { class: 'sidebar-sub-header' }, [
|
|
88
|
+
renderLink(h, path + '#' + c.slug, c.title, active, hide, c.level - 1),
|
|
89
|
+
renderChildren(h, c.children, path, route, maxDepth, hide, depth + 1)
|
|
90
|
+
])
|
|
91
|
+
}))
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function renderExternal (h, to, text) {
|
|
95
|
+
return h('a', {
|
|
96
|
+
attrs: {
|
|
97
|
+
href: to,
|
|
98
|
+
target: '_blank',
|
|
99
|
+
rel: 'noopener noreferrer'
|
|
100
|
+
},
|
|
101
|
+
class: {
|
|
102
|
+
'sidebar-link': true
|
|
103
|
+
}
|
|
104
|
+
}, [text, h('OutboundLink')])
|
|
105
|
+
}
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<style lang="stylus">
|
|
109
|
+
.sidebar .sidebar-sub-headers
|
|
110
|
+
padding-left 1rem
|
|
111
|
+
font-size 0.95em
|
|
112
|
+
|
|
113
|
+
a.sidebar-link.hide
|
|
114
|
+
display: none
|
|
115
|
+
|
|
116
|
+
a.sidebar-link
|
|
117
|
+
font-size 1em
|
|
118
|
+
font-weight 400
|
|
119
|
+
display inline-block
|
|
120
|
+
color $textColor
|
|
121
|
+
border-left 0.25rem solid transparent
|
|
122
|
+
padding 0.35rem 1rem 0.35rem 1.25rem
|
|
123
|
+
line-height 1.4
|
|
124
|
+
width: 100%
|
|
125
|
+
box-sizing: border-box
|
|
126
|
+
&:hover
|
|
127
|
+
color $accentColor
|
|
128
|
+
&.active
|
|
129
|
+
font-weight 600
|
|
130
|
+
color $accentColor
|
|
131
|
+
border-left-color $accentColor
|
|
132
|
+
.sidebar-group &
|
|
133
|
+
padding-left 2rem
|
|
134
|
+
.sidebar-sub-headers &
|
|
135
|
+
padding-top 0.25rem
|
|
136
|
+
padding-bottom 0.25rem
|
|
137
|
+
border-left none
|
|
138
|
+
&.active
|
|
139
|
+
font-weight 500
|
|
140
|
+
</style>
|