1
1
<!--
2
2
This source file is part of the Swift.org open source project
3
3
4
- Copyright (c) 2021-2023 Apple Inc. and the Swift project authors
4
+ Copyright (c) 2021-2024 Apple Inc. and the Swift project authors
5
5
Licensed under Apache License v2.0 with Runtime Library Exception
6
6
7
7
See https://swift.org/LICENSE.txt for license information
12
12
<NavBase
13
13
:breakpoint =" BreakpointName.medium"
14
14
:hasOverlay =" false"
15
- hasSolidBackground
16
15
:hasNoBorder =" hasNoBorder"
17
16
:isDark =" isDark"
18
17
isWideFormat
22
21
>
23
22
<template #pre-title =" { closeNav , isOpen , currentBreakpoint , className } " v-if =" displaySidenav " >
24
23
<div :class =" className" >
25
- <transition name =" sidenav-toggle" >
26
- <div
27
- v-show =" sidenavHiddenOnLarge"
28
- class =" sidenav-toggle-wrapper"
24
+ <div class =" sidenav-toggle-wrapper" >
25
+ <button
26
+ :aria-label =" $t('navigator.open-navigator')"
27
+ :id =" baseNavOpenSidenavButtonId"
28
+ class =" sidenav-toggle"
29
+ :tabindex =" isOpen ? -1 : null"
30
+ @click.prevent =" handleSidenavToggle(closeNav, currentBreakpoint)"
29
31
>
30
- <button
31
- :aria-label =" $t('navigator.open-navigator')"
32
- :id =" baseNavOpenSidenavButtonId"
33
- class =" sidenav-toggle"
34
- :tabindex =" isOpen ? -1 : null"
35
- @click.prevent =" handleSidenavToggle(closeNav, currentBreakpoint)"
36
- >
37
- <span class =" sidenav-icon-wrapper" >
38
- <SidenavIcon class =" icon-inline sidenav-icon" />
39
- </span >
40
- </button >
41
- <span class =" sidenav-toggle__separator" />
42
- </div >
43
- </transition >
32
+ <span class =" sidenav-icon-wrapper" >
33
+ <SidenavIcon class =" icon-inline sidenav-icon" />
34
+ </span >
35
+ </button >
36
+ </div >
44
37
</div >
45
38
</template >
46
39
<template #default >
47
- <slot
48
- name =" title"
49
- v-bind =" { rootLink, linkClass: 'nav-title-link', inactiveClass: 'inactive' }"
50
- >
51
- <router-link
52
- v-if =" rootLink"
53
- :to =" rootLink"
54
- class =" nav-title-link"
55
- >
56
- {{ $t('documentation.title') }}
57
- </router-link >
58
- <span v-else class =" nav-title-link inactive" >{{ $t('documentation.title') }}</span >
59
- </slot >
40
+ <slot name =" title" />
60
41
</template >
61
42
<template #tray =" { closeNav } " >
62
- <Hierarchy
63
- :currentTopicTitle =" title"
64
- :isSymbolDeprecated =" isSymbolDeprecated"
65
- :isSymbolBeta =" isSymbolBeta"
66
- :parentTopicIdentifiers =" hierarchyItems"
67
- :currentTopicTags =" currentTopicTags"
68
- :references =" references"
69
- />
70
43
<NavMenuItems
71
44
class =" nav-menu-settings"
72
- :previousSiblingChildren =" breadcrumbCount"
73
45
>
74
46
<LanguageToggle
75
47
v-if =" interfaceLanguage && (swiftPath || objcPath)"
80
52
/>
81
53
<slot name =" menu-items" />
82
54
</NavMenuItems >
83
- <slot name =" tray-after" v-bind = " { breadcrumbCount } " />
55
+ <slot name =" tray-after" />
84
56
</template >
85
57
<template #after-content >
86
58
<slot name =" after-content" />
@@ -95,7 +67,6 @@ import { BreakpointName } from 'docc-render/utils/breakpoints';
95
67
import SidenavIcon from ' theme/components/Icons/SidenavIcon.vue' ;
96
68
import { SIDEBAR_HIDE_BUTTON_ID } from ' docc-render/constants/sidebar' ;
97
69
import { baseNavOpenSidenavButtonId } from ' docc-render/constants/nav' ;
98
- import Hierarchy from ' ./DocumentationNav/Hierarchy.vue' ;
99
70
import LanguageToggle from ' ./DocumentationNav/LanguageToggle.vue' ;
100
71
101
72
export default {
@@ -104,26 +75,9 @@ export default {
104
75
SidenavIcon,
105
76
NavBase,
106
77
NavMenuItems,
107
- Hierarchy,
108
78
LanguageToggle,
109
79
},
110
80
props: {
111
- title: {
112
- type: String ,
113
- required: false ,
114
- },
115
- parentTopicIdentifiers: {
116
- type: Array ,
117
- required: false ,
118
- },
119
- isSymbolBeta: {
120
- type: Boolean ,
121
- required: false ,
122
- },
123
- isSymbolDeprecated: {
124
- type: Boolean ,
125
- required: false ,
126
- },
127
81
isDark: {
128
82
type: Boolean ,
129
83
default: false ,
@@ -132,14 +86,6 @@ export default {
132
86
type: Boolean ,
133
87
default: false ,
134
88
},
135
- currentTopicTags: {
136
- type: Array ,
137
- required: true ,
138
- },
139
- references: {
140
- type: Object ,
141
- default : () => ({}),
142
- },
143
89
interfaceLanguage: {
144
90
type: String ,
145
91
required: false ,
@@ -152,10 +98,6 @@ export default {
152
98
type: String ,
153
99
required: false ,
154
100
},
155
- sidenavHiddenOnLarge: {
156
- type: Boolean ,
157
- default: false ,
158
- },
159
101
displaySidenav: {
160
102
type: Boolean ,
161
103
default: false ,
@@ -164,38 +106,6 @@ export default {
164
106
computed: {
165
107
baseNavOpenSidenavButtonId : () => baseNavOpenSidenavButtonId,
166
108
BreakpointName : () => BreakpointName,
167
- breadcrumbCount : ({ hierarchyItems }) => hierarchyItems .length + 1 ,
168
- /**
169
- * Returns the first(root) hierarchy item reference
170
- * @return {Object}
171
- */
172
- rootHierarchyReference : ({ parentTopicIdentifiers, references }) => (
173
- references[parentTopicIdentifiers[0 ]] || {}
174
- ),
175
- /**
176
- * Returns whether the root link is a technology page.
177
- * @return {boolean}
178
- */
179
- isRootTechnologyLink : ({ rootHierarchyReference: { kind } }) => kind === ' technologies' ,
180
- /**
181
- * Returns the root url reference object, if is a `technologies` link.
182
- * Otherwise returns a manual route query object.
183
- * @return {Object}
184
- */
185
- rootLink: ({
186
- isRootTechnologyLink, rootHierarchyReference, $route,
187
- }) => (isRootTechnologyLink
188
- ? {
189
- path: rootHierarchyReference .url ,
190
- query: $route .query ,
191
- } : null ),
192
- /**
193
- * Strips out the first link, if is the root Technologies link.
194
- * @return {string[]}
195
- */
196
- hierarchyItems : ({ parentTopicIdentifiers, isRootTechnologyLink }) => (
197
- isRootTechnologyLink ? parentTopicIdentifiers .slice (1 ) : parentTopicIdentifiers
198
- ),
199
109
},
200
110
methods: {
201
111
async handleSidenavToggle (closeNav , currentBreakpoint ) {
@@ -233,24 +143,17 @@ $sidenav-icon-padding-size: 5px;
233
143
margin-left : $nav-space-between-elements ;
234
144
}
235
145
236
- @include nav-in-breakpoint {
237
- // do not apply border if no item are above setting links
238
- & :not ([data-previous-menu-children-count = " 0" ]) {
239
- .nav-menu-setting :first-child {
240
- border-top : 1px solid dark-color (figure-gray-tertiary );
241
- display : flex ;
242
- align-items : center ;
243
- }
244
- }
245
- }
246
-
247
146
.nav-menu-setting {
248
147
display : flex ;
249
148
align-items : center ;
250
149
color : var (--color-nav-current-link );
251
150
margin-left : 0 ;
252
151
min-width : 0 ;
253
152
153
+ .nav-menu-link , .current-language , span {
154
+ font-weight : $font-weight-semibold ;
155
+ }
156
+
254
157
& :first-child:not (:only-child ) {
255
158
margin-right : $nav-space-between-elements ;
256
159
@@ -274,17 +177,8 @@ $sidenav-icon-padding-size: 5px;
274
177
275
178
.documentation-nav {
276
179
:deep () {
277
- // normalize the Title font with menu items
278
180
.nav- title {
279
- @include font-styles (documentation-nav );
280
-
281
- .nav-title-link.inactive {
282
- height : auto ;
283
- color : var (--color-figure-gray-secondary-alt );
284
- @include nav-dark ($nested : true) {
285
- color : dark-color (figure-gray-secondary-alt );
286
- }
287
- }
181
+ @include font-styles (nav-title-large );
288
182
}
289
183
}
290
184
}
@@ -317,6 +211,7 @@ $sidenav-icon-padding-size: 5px;
317
211
color : var (--color-nav-link-color );
318
212
position : relative ;
319
213
margin : 0 (- $sidenav-icon-padding-size );
214
+ border-radius : $nano-border-radius ;
320
215
321
216
@include nav-dark {
322
217
color : var (--color-nav-dark-link-color );
@@ -339,13 +234,6 @@ $sidenav-icon-padding-size: 5px;
339
234
}
340
235
341
236
@include nav-in-breakpoint () {
342
- $space : 14px ;
343
- margin-left : - $space ;
344
- margin-right : - $space ;
345
- padding-left : $space ;
346
- padding-right : $space ;
347
- align-self : stretch ;
348
-
349
237
& __separator {
350
238
display : none ;
351
239
}
0 commit comments