Skip to content

Commit c0a00ac

Browse files
committed
Merge remote-tracking branch 'upstream/main'
* upstream/main: chore: release main (bootstrap-vue-next#2690) docs(BProgress): Parity pass (bootstrap-vue-next#2689) fix(BTableSimple): fixed and nobordercollapse to work fixes bootstrap-vue-next#2685 docs: fix incorrect references and missed script sections (bootstrap-vue-next#2686) docs: implement on this page expand/collapse with useScrollspy (bootstrap-vue-next#2679) chore: release main (bootstrap-vue-next#2683) feat(BTable): implement 'fixed' and 'noBorderCollapse' props (bootstrap-vue-next#2681) chore: release main (bootstrap-vue-next#2678) Update package.json fix(BFormSelect): prevent options with label from being treated as groups (bootstrap-vue-next#2666) fix: patch regression issue in bootstrap-vue-next#2665 (bootstrap-vue-next#2670) Update release-main.yaml chore: release main (bootstrap-vue-next#2660) chore: update depencies fix(BTabs): corrent classes on ssr (bootstrap-vue-next#2664) Changes to public composables (bootstrap-vue-next#2425) docs(BTable): parity pass (bootstrap-vue-next#2669)
2 parents 062cbfb + dc85d94 commit c0a00ac

File tree

104 files changed

+7029
-4085
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+7029
-4085
lines changed

.github/workflows/release-main.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@ jobs:
2020

2121
steps:
2222
- name: Use Release Please
23-
uses: google-github-actions/release-please-action@v4
23+
uses: googleapis/release-please-action@v4
2424
id: release
25-
with:
26-
command: manifest
27-
monorepo-tags: true
2825

2926
# The logic below handles the npm publication:
3027

.release-please-manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/bootstrap-vue-next": "0.28.6",
3-
"packages/nuxt": "0.28.6"
2+
"packages/bootstrap-vue-next": "0.29.3",
3+
"packages/nuxt": "0.29.3"
44
}

.vscode/launch.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,19 @@
2828
],
2929
"type": "node"
3030
},
31+
{
32+
"name": "Launch app unit test",
33+
"request": "launch",
34+
"runtimeArgs": [
35+
"test:unit",
36+
"--filter",
37+
"bootstrap-vue-next"
38+
],
39+
"runtimeExecutable": "pnpm",
40+
"skipFiles": [
41+
"<node_internals>/**"
42+
],
43+
"type": "node"
44+
},
3145
]
3246
}

apps/docs/.vitepress/theme/Layout.vue

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<BNavbar v-b-color-mode="'dark'" variant="primary" sticky="top" toggleable="lg" :container="true">
44
<BToastOrchestrator />
55
<BModalOrchestrator />
6+
<BPopoverOrchestrator />
67
<div class="d-flex gap-2 align-items-center">
78
<BNavbarToggle v-b-toggle.sidebar-menu />
89
<BNavbarBrand :to="withBase('/')" class="p-0 me-0 me-lg-2">
@@ -137,7 +138,7 @@
137138
header-class="pb-0 d-flex offcanvas-hidden-width"
138139
body-class="py-2"
139140
>
140-
<PageContents />
141+
<PageContents :contents="contents" :active-id="activeId" />
141142
</BOffcanvas>
142143
</ClientOnly>
143144
</aside>
@@ -163,6 +164,7 @@ import {
163164
BNavItem,
164165
BNavItemDropdown,
165166
BOffcanvas,
167+
BPopoverOrchestrator,
166168
BRow,
167169
BToastOrchestrator,
168170
useColorMode,
@@ -191,6 +193,7 @@ import {VPNavBarSearch} from 'vitepress/theme'
191193
import {appInfoKey} from './keys'
192194
import {useMediaQuery} from '@vueuse/core'
193195
import PageContents from '../../src/components/PageContents.vue'
196+
import {type ContentsItem, type HeaderItem} from '../../src/types'
194197
195198
// https://vitepress.dev/reference/runtime-api#usedata
196199
const {page} = useData()
@@ -199,9 +202,11 @@ const route = useRoute()
199202
const content = useTemplateRef<ComponentPublicInstance<HTMLElement>>('_content')
200203
const target = useTemplateRef<ComponentPublicInstance<HTMLElement>>('_target')
201204
202-
useScrollspy(content, target, {
203-
contentQuery: ':scope > div > [id], #component-reference',
205+
const {current: activeId, list: items} = useScrollspy(content, target, {
206+
contentQuery: ':scope > div > [id], #component-reference, .component-reference h3',
204207
targetQuery: ':scope [href]',
208+
rootMargin: '0px 0px -25%',
209+
manual: true,
205210
})
206211
207212
const globalData = inject(appInfoKey, {
@@ -293,6 +298,49 @@ const set = (newValue: keyof typeof map) => {
293298
colorMode.value = newValue
294299
}
295300
301+
const headers = computed(() =>
302+
items.value.map((item) => {
303+
const rawTag = item.el?.tagName?.toUpperCase() ?? ''
304+
const isHeading = /^H[1-6]$/.test(rawTag)
305+
const tag = isHeading ? rawTag : 'DIV'
306+
const level = tag.startsWith('H') ? parseInt(tag.replace('H', '')) : 3
307+
return {
308+
...item,
309+
tag,
310+
level,
311+
} as HeaderItem
312+
})
313+
)
314+
315+
const contents = computed(() => {
316+
const root: ContentsItem[] = []
317+
const stack: ContentsItem[] = []
318+
319+
headers.value.forEach((header) => {
320+
const item = {...header, children: [] as ContentsItem[]} as ContentsItem
321+
322+
while (stack.length && stack[stack.length - 1].level >= item.level) {
323+
stack.pop()
324+
}
325+
326+
if (stack.length === 0) {
327+
root.push(item)
328+
} else {
329+
stack[stack.length - 1].children.push(item)
330+
}
331+
332+
stack.push(item)
333+
})
334+
335+
if (root.length !== 1) {
336+
// Something isn't right if we have no root items or more than one root item
337+
// eslint-disable-next-line no-console
338+
console.warn('Unexpected header structure:', headers, 'Root items:', root)
339+
}
340+
341+
return root.length > 0 ? root[0] : undefined
342+
})
343+
296344
watch(
297345
() => route.path,
298346
() => {

apps/docs/package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
"@iconify-json/logos": "^1.2.4",
1919
"@rushstack/eslint-patch": "^1.11.0",
2020
"@toycode/markdown-it-class": "^1.2.4",
21-
"@tsconfig/node22": "^22.0.0",
22-
"@types/node": "^22.13.10",
21+
"@tsconfig/node22": "^22.0.1",
22+
"@types/node": "^22.15.3",
2323
"@vue/eslint-config-prettier": "^10.2.0",
2424
"@vue/eslint-config-typescript": "^14.5.0",
2525
"@vue/tsconfig": "^0.7.0",
2626
"@vueuse/core": "^13.0.0",
27-
"bootstrap": "^5.3.3",
27+
"bootstrap": "^5.3.5",
2828
"bootstrap-vue-next": "workspace:^",
2929
"cross-env": "^7.0.3",
30-
"eslint": "^9.22.0",
30+
"eslint": "^9.25.1",
3131
"eslint-define-config": "^2.1.0",
32-
"eslint-plugin-vue": "^10.0.0",
32+
"eslint-plugin-vue": "^10.0.1",
3333
"prettier": "^3.5.3",
34-
"typescript": "^5.8.2",
34+
"typescript": "^5.8.3",
3535
"unplugin-icons": "^22.1.0",
36-
"unplugin-vue-components": "^28.4.1",
36+
"unplugin-vue-components": "^28.5.0",
3737
"vitepress": "1.6.3",
3838
"vue": "^3.5.13"
3939
},

apps/docs/src/components/ComponentReference.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
<BContainer v-for="component in sortData" :key="component.component" fluid class="p-0">
1111
<BRow>
1212
<BCol>
13-
<code class="display-6">{{ `<` + component.component + `>` }}</code>
13+
<h3 :id="kebabCase(component.component)">
14+
<code class="display-6">{{ `<` + component.component + `>` }}</code>
15+
</h3>
1416
</BCol>
1517
<BCol v-if="globalData && component.sourcePath !== null" cols="4" class="text-md-right">
1618
<ViewSourceButton

apps/docs/src/components/PageContents.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
<template>
22
<BNav vertical small class="otp-nav">
3-
<PageContentsItem v-for="header in headers" :key="header.slug" :item="header" />
4-
<BNavItem v-if="isComponentPage" href="#component-reference" link-class="otp-link"
5-
>Component Reference</BNavItem
6-
>
3+
<PageContentsItem
4+
v-for="item in contents?.children"
5+
:key="item.id!"
6+
:item="item"
7+
:active-id="activeId"
8+
/>
79
</BNav>
810
</template>
911

1012
<script setup lang="ts">
11-
import {computed} from 'vue'
12-
import {useData} from 'vitepress'
13+
import type {ContentsItem} from 'src/types'
1314
14-
const data = useData()
15-
const headers = computed(() => data.page.value.headers)
16-
const isComponentPage = computed(() => data.page.value.relativePath.includes('/components/'))
15+
defineProps<{contents?: ContentsItem; activeId: string | null}>()
1716
</script>
1817

1918
<style lang="scss">
Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,33 @@
11
<template>
2-
<BNavItem :href="item.link" link-class="otp-link">
3-
<template #default>{{ item.title }}</template>
2+
<BNavItem :href="buildLink(item)" link-class="otp-link" :active="item.id === activeId">
3+
<template #default>{{ props.item.text }}</template>
44
<template #after>
5-
<BNav v-if="item.children?.length > 0" vertical small class="otp-nav">
6-
<PageContentsItem v-for="child in item.children" :key="child.slug" :item="child" />
5+
<BNav v-show="isVisible" vertical small class="otp-nav">
6+
<PageContentsItem
7+
v-for="child in item.children"
8+
:key="child.id!"
9+
:item="child"
10+
:active-id="activeId"
11+
/>
712
</BNav>
813
</template>
914
</BNavItem>
1015
</template>
1116

1217
<script setup lang="ts">
13-
import {type Header} from 'vitepress'
18+
import type {ContentsItem} from 'src/types'
19+
import {computed} from 'vue'
1420
15-
defineProps<{
16-
item: Header
21+
const props = defineProps<{
22+
item: ContentsItem
23+
activeId: string | null
1724
}>()
25+
26+
const buildLink = (item: ContentsItem): string => `#${item.id}`
27+
28+
const childrenVisible = (item: ContentsItem): boolean =>
29+
!!item.children?.length &&
30+
item.children.some((child) => child.id === props.activeId || childrenVisible(child))
31+
32+
const isVisible = computed(() => props.item.id === props.activeId || childrenVisible(props.item))
1833
</script>

apps/docs/src/components/TableOfContentsNav.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ const componentsList: {name: string}[] = [
140140
{name: 'Table'},
141141
{name: 'Tabs'},
142142
{name: 'Toast'},
143+
{name: 'Tooltip'},
143144
]
144145
145146
const composablesList: {name: string}[] = [
@@ -148,6 +149,7 @@ const composablesList: {name: string}[] = [
148149
{name: 'useModal'},
149150
{name: 'useModalController'},
150151
{name: 'useToastController'},
152+
{name: 'useToggle'},
151153
{name: 'usePopoverController'},
152154
]
153155

0 commit comments

Comments
 (0)