Skip to content

Commit

Permalink
feat(up): truncate util; NuxtLink in AppFooter textLinks; upgrade to …
Browse files Browse the repository at this point in the history
…Pinceau ^0.9.12
  • Loading branch information
Tahul committed Dec 26, 2022
1 parent d682fcf commit e01844b
Show file tree
Hide file tree
Showing 7 changed files with 105 additions and 123 deletions.
5 changes: 2 additions & 3 deletions app/integrations/docsearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default defineNuxtPlugin(() => {
* Initialize the DocSearch instance.
* @param userOptions
*/
const initialize = async (userOptions: DocSearchOptions) => {
const initialize = async (userOptions: any & DocSearchOptions) => {
const el = document.createElement('div')
el.id = '#docsearch-container'
el.style.width = '0'
Expand Down Expand Up @@ -118,7 +118,6 @@ export default defineNuxtPlugin(() => {
}
}
},
// @ts-expect-error - We don't actually use `hitComponent` but react on its calls.
hitComponent: userOptions.hitComponent
? userOptions.hitComponent
: ({ hit, children }) => {
Expand Down Expand Up @@ -155,7 +154,7 @@ export default defineNuxtPlugin(() => {
// Skip already used keys
.filter(([key]) => !['applicationId', 'apiKey', 'indexName', 'transformItems', 'navigator', 'hitComponent', 'facetFilters', 'langAttribute', 'lang'].includes(key))
// Recompose options
.reduce((acc, [key, value]) => {
.reduce((acc: any, [key, value]) => {
acc[key] = value
return acc
}, {})
Expand Down
5 changes: 2 additions & 3 deletions components/app/AppFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ const nbSocialIcons = computed(() => (socialIcons.value ? socialIconsCount.value

<!-- Center -->
<div class="center">
<!-- TODO: inner app links with NuxtLink -->
<a
<NuxtLink
v-for="link in textLinks"
:key="link.href"
class="text-link"
Expand All @@ -30,7 +29,7 @@ const nbSocialIcons = computed(() => (socialIcons.value ? socialIconsCount.value
:target="link.target || '_self'"
>
{{ link.text }}
</a>
</NuxtLink>
</div>

<div class="right">
Expand Down
7 changes: 2 additions & 5 deletions components/app/AppHeaderNavigation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const filtered = computed(() => docus.value.header?.exclude || [])
const tree = computed(() => {
return (navigation.value || []).filter((item: any) => {
if (filtered.value.includes(item._path)) { return false }
if (filtered.value.includes(item._path as never)) { return false }
return true
})
})
Expand Down Expand Up @@ -51,10 +51,7 @@ css({
justifyContent: 'center',
flex: '1',
maxWidth: '100%',
// TODO: truncate
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
truncate: true,
'& > * + *': {
marginLeft: '{space.2}'
Expand Down
15 changes: 3 additions & 12 deletions components/docs/DocsPrevNext.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ css({
fontWeight: '{fontWeight.medium}',
textAlign: 'right',
color: '{color.gray.500}',
// TODO: truncate
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
truncate: true
}
},
'&.next': {
Expand All @@ -102,10 +99,7 @@ css({
lineHeight: '{text.xs.lineHeight}',
fontWeight: '{fontWeight.medium}',
color: '{color.gray.500}',
// TODO: truncate
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
truncate: true
}
},
'.title-wrapper': {
Expand All @@ -122,10 +116,7 @@ css({
flex: '1 1 0%',
fontWeight: '{fontWeight.medium}',
lineHeight: '{lead.5}',
// TODO: truncate
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
truncate: true
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions components/docs/DocsTocLinks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ defineProps({
const emit = defineEmits(['move'])
const route = useRoute()
const router = useRouter()
const { activeHeadings, updateHeadings } = useScrollspy()
Expand Down Expand Up @@ -63,10 +62,7 @@ css({
fontSize: '{text.sm.fontSize}',
lineHeight: '{text.sm.lineHeight}',
color: '{color.gray.500}',
// TODO: truncate
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
truncate: true,
'@lg': {
paddingRight: '{space.3}'
},
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
},
"dependencies": {
"@nuxt-themes/elements": "^0.3.3",
"@nuxt-themes/tokens": "^1.4.2",
"@nuxt-themes/tokens": "^1.4.3",
"@nuxt-themes/typography": "^0.2.2",
"@nuxt/content": "^2.3.0",
"@nuxthq/studio": "^0.4.1",
"@vueuse/nuxt": "^9.8.2"
"@nuxthq/studio": "^0.4.2",
"@vueuse/nuxt": "^9.9.0"
},
"devDependencies": {
"@algolia/client-search": "^4.14.3",
Expand Down
Loading

0 comments on commit e01844b

Please sign in to comment.