Skip to content

Commit

Permalink
chore: update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Sep 27, 2024
1 parent 458c1f9 commit c0b6eb7
Show file tree
Hide file tree
Showing 191 changed files with 2,114 additions and 2,011 deletions.
6 changes: 4 additions & 2 deletions cypress/e2e/examples/basic.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ context('Basic', () => {

cy.get('body')
.type('{DownArrow}')
.url().should('eq', `${BASE}/6`)
.url()
.should('eq', `${BASE}/6`)

cy.rightArrow()

Expand All @@ -75,7 +76,8 @@ context('Basic', () => {

cy.get('body')
.type('{RightArrow}{RightArrow}{RightArrow}{RightArrow}{RightArrow}{RightArrow}')
.url().should('eq', `${BASE}/7`)
.url()
.should('eq', `${BASE}/7`)

cy.get('body')
.type('{LeftArrow}')
Expand Down
6 changes: 4 additions & 2 deletions cypress/e2e/examples/smoke.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ context('Smoke test', () => {
while (1) {
let oldUrl, newUrl
cy.get('body')
.url().then(url => (oldUrl = url))
.url()
.then(url => (oldUrl = url))
.type(`{RightArrow}`)
.wait(1000)
.url().then(url => (newUrl = url))
.url()
.then(url => (newUrl = url))
if (oldUrl === newUrl)
break
}
Expand Down
2 changes: 1 addition & 1 deletion demo/composable-vue/components/Connections.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed, ref, watch } from 'vue'
import { autoResetRef } from '@vueuse/core'
import { computed, ref, watch } from 'vue'
const a = ref(2)
const b = ref(4)
Expand Down
6 changes: 3 additions & 3 deletions demo/composable-vue/slides.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,8 @@ title.value = 'Hello World'
### Binding an Existing Ref

```ts {monaco}
import { computed, ref } from 'vue'
import { useTitle } from '@vueuse/core'
import { computed, ref } from 'vue'

const name = ref('Hello')
const title = computed(() => {
Expand Down Expand Up @@ -495,8 +495,8 @@ Take a look at `useTitle`'s implementation
<v-clicks>

```ts {monaco}
import { ref, watch } from 'vue'
import type { MaybeRef } from '@vueuse/core'
import { ref, watch } from 'vue'

export function useTitle(
newTitle: MaybeRef<string | null | undefined>,
Expand Down Expand Up @@ -1069,8 +1069,8 @@ layout: center
Composition API support for Vue 2.<br><carbon-logo-github class="inline-block"/> [vuejs/composition-api](https://github.com/vuejs/composition-api)

```ts
import Vue from 'vue'
import VueCompositionAPI from '@vue/composition-api'
import Vue from 'vue'

Vue.use(VueCompositionAPI)
```
Expand Down
9 changes: 5 additions & 4 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { fileURLToPath } from 'node:url'
import type { DefaultTheme } from 'vitepress'
import { defineConfig } from 'vitepress'
import { fileURLToPath } from 'node:url'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { defineConfig } from 'vitepress'
import { version } from '../package.json'
import { getSidebarObject } from './sidebar-gen'
import { Advanced, BuiltIn, Guides, Resources } from './pages'
import Customizations from './customizations'
import { Advanced, BuiltIn, Guides, Resources } from './pages'
import { getSidebarObject } from './sidebar-gen'

const slidebars: DefaultTheme.SidebarItem[] = [
{
Expand Down Expand Up @@ -132,6 +132,7 @@ export default defineConfig({
'/custom/': slidebars,
'/builtin/': slidebars,
'/resources/': slidebars,
// eslint-disable-next-line antfu/no-top-level-await
...await getSidebarObject(),
'/features/': [],
'/': slidebars,
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/sidebar-gen.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fileURLToPath } from 'node:url'
import type { DefaultTheme } from 'vitepress'
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import fg from 'fast-glob'
import type { DefaultTheme } from 'vitepress'
import graymatter from 'gray-matter'

const root = fileURLToPath(new URL('../../', import.meta.url))
Expand Down
16 changes: 8 additions & 8 deletions docs/.vitepress/theme/components/Demo.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<script setup lang="ts">
import { onMounted, ref, watch } from 'vue'
import TypeIt from 'typeit'
import Markdown from 'markdown-it'
import type { SlidevMarkdown } from '@slidev/types'
import Center from '@slidev/client/layouts/center.vue'
import Default from '@slidev/client/layouts/default.vue'
import { parseSync } from '@slidev/parser'
import Cover from '@slidev/theme-default/layouts/cover.vue'
import Default from '@slidev/client/layouts/default.vue'
import Center from '@slidev/client/layouts/center.vue'
import Markdown from 'markdown-it'
import TypeIt from 'typeit'
import { onMounted, ref, watch } from 'vue'
import DemoEditor from './DemoEditor.vue'
import DemoSlide from './DemoSlide.vue'
import SlideContainer from './SlideContainer.vue'
import '@slidev/client/styles/layouts-base.css'
import '@slidev/theme-default/styles/layouts.css'
import DemoEditor from './DemoEditor.vue'
import DemoSlide from './DemoSlide.vue'
const page = ref(0)
const paused = ref(false)
const completed = ref(false)
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/FeatureTag.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { computed } from 'vue'
import { useData, withBase } from 'vitepress'
import { computed } from 'vue'
const props = defineProps<{
tag: string
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/components/FeaturesAnimationInner.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { computed, ref } from 'vue'
import { withBase } from 'vitepress'
import type { Feature } from '../../../features/index.data'
import { withBase } from 'vitepress'
import { computed, ref } from 'vue'
import { data as features } from '../../../features/index.data'
const rows = 6
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/FeaturesOverview.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { withBase } from 'vitepress'
import type { Feature } from '../../../features/index.data'
import { withBase } from 'vitepress'
defineProps<{
features: Feature[]
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/Layout.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import DefaultTheme from 'vitepress/theme'
import { Dropdown } from 'floating-vue'
import { useRoute } from 'vitepress'
import VPMenuLink from 'vitepress/dist/client/theme-default/components/VPMenuLink.vue'
import DefaultTheme from 'vitepress/theme'
import FeatureTag from './FeatureTag.vue'
const { Layout } = DefaultTheme
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/components/LinkInline.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { withBase } from 'vitepress'
import { Tooltip } from 'floating-vue'
import { withBase } from 'vitepress'
import { computed } from 'vue'
import { resolveLink } from '../../utils'
Expand Down
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/components/ThemeInfo.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import { ref } from 'vue'
import { isClient, useIntervalFn } from '@vueuse/core'
import type { ThemeInfo } from '../../themes'
import { isClient, useIntervalFn } from '@vueuse/core'
import { ref } from 'vue'
const props = defineProps<{
theme: ThemeInfo
Expand Down
2 changes: 1 addition & 1 deletion docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Theme from 'vitepress/theme'
import type { EnhanceAppContext } from 'vitepress'
import TwoSlash from '@shikijs/vitepress-twoslash/client'
import Theme from 'vitepress/theme'
import Layout from './components/Layout.vue'

import '@shikijs/vitepress-twoslash/style.css'
Expand Down
42 changes: 17 additions & 25 deletions docs/custom/config-context-menu.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,32 @@
# Configure Context Menu

<Environment type="client" />

Customize the context menu items in Slidev.

Create `./setup/context-menu.ts` with the following content:

<!-- eslint-disable import/first -->

```ts twoslash
import { useNav } from '@slidev/client'
/_ eslint-disable import/first _/
// ---cut---
import { defineContextMenuSetup } from '@slidev/types'
import { useNav } from '@slidev/client'
import { computed } from 'vue'
// ---cut-start---
// @ts-expect-error missing types
// ---cut-end---
import Icon3DCursor from '~icons/carbon/3d-cursor'

export default defineContextMenuSetup((items) => {
const { isPresenter } = useNav()
return computed(() => [
...items.value,
{
small: false,
icon: Icon3DCursor, // if `small` is `true`, only the icon is shown
label: 'Custom Menu Item', // or a Vue component
action() {
alert('Custom Menu Item Clicked!')
},
disabled: isPresenter.value,
},
])
const { isPresenter } = useNav()
return computed(() => [
...items.value,
{
small: false,
icon: Icon3DCursor, // if `small` is `true`, only the icon is shown
label: 'Custom Menu Item', // or a Vue component
action() {
alert('Custom Menu Item Clicked!')
},
disabled: isPresenter.value,
},
])
})

```
This will append a new menu item to the context menu.
To disable context menu globally, set `contextMenu` to `false` in the frontmatter. `contextMenu` can also be set to `dev` or `build` to only enable the context menu in development or build mode.
```
2 changes: 1 addition & 1 deletion docs/custom/config-vite.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ See the [type declarations](https://github.com/slidevjs/slidev/blob/main/package
It is not allowed to re-add plugins that has been used internally be Slidev. For example, instead of

```ts twoslash
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "0.49.29",
"private": true,
"packageManager": "pnpm@9.9.0",
"packageManager": "pnpm@9.11.0",
"scripts": {
"dev": "vitepress",
"build": "vitepress build",
Expand Down
6 changes: 3 additions & 3 deletions docs/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from 'vite'
import Icons from 'unplugin-icons/vite'
import UnoCSS from 'unocss/vite'
import IconsResolver from 'unplugin-icons/resolver'
import Icons from 'unplugin-icons/vite'
import Components from 'unplugin-vue-components/vite'
import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
import UnoCSS from 'unocss/vite'

export default defineConfig({
optimizeDeps: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"version": "0.49.29",
"private": true,
"packageManager": "pnpm@9.9.0",
"packageManager": "pnpm@9.11.0",
"engines": {
"node": ">=18.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/client/builtin/Arrow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Simple Arrow
-->

<script setup lang="ts">
import { ref } from 'vue'
import { onClickOutside } from '@vueuse/core'
import { ref } from 'vue'
import { makeId } from '../logic/utils'
defineProps<{
Expand Down
6 changes: 3 additions & 3 deletions packages/client/builtin/CodeBlockWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ Learn more: https://sli.dev/guide/syntax.html#line-highlighting
-->

<script setup lang="ts">
import type { PropType } from 'vue'
import { useClipboard } from '@vueuse/core'
import { computed, onMounted, onUnmounted, ref, watchEffect } from 'vue'
import type { PropType } from 'vue'
import { configs } from '../env'
import { makeId, updateCodeHighlightRange } from '../logic/utils'
import { CLASS_VCLICK_HIDDEN, CLICKS_MAX } from '../constants'
import { useSlideContext } from '../context'
import { configs } from '../env'
import { makeId, updateCodeHighlightRange } from '../logic/utils'
const props = defineProps({
ranges: {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/builtin/KaTexBlockWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ Learn more: https://sli.dev/guide/syntax.html#latex-line-highlighting
-->

<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref, watchEffect } from 'vue'
import type { PropType } from 'vue'
import { parseRangeString } from '@slidev/parser'
import { computed, onMounted, onUnmounted, ref, watchEffect } from 'vue'
import { CLASS_VCLICK_HIDDEN, CLASS_VCLICK_TARGET, CLICKS_MAX } from '../constants'
import { makeId } from '../logic/utils'
import { useSlideContext } from '../context'
import { makeId } from '../logic/utils'
const props = defineProps({
ranges: {
Expand Down
2 changes: 1 addition & 1 deletion packages/client/builtin/Mermaid.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ pie

<script setup lang="ts">
import { getCurrentInstance, ref, watch, watchEffect } from 'vue'
import { renderMermaid } from '../modules/mermaid'
import ShadowRoot from '../internals/ShadowRoot.vue'
import { isDark } from '../logic/dark'
import { renderMermaid } from '../modules/mermaid'
const props = defineProps<{
codeLz: string
Expand Down
10 changes: 5 additions & 5 deletions packages/client/builtin/Monaco.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ Learn more: https://sli.dev/guide/syntax.html#monaco-editor
-->

<script setup lang="ts">
import type { RawAtValue } from '@slidev/types'
import type * as monaco from 'monaco-editor'
import { debounce } from '@antfu/utils'
import { whenever } from '@vueuse/core'
import lz from 'lz-string'
import type * as monaco from 'monaco-editor'
import { computed, defineAsyncComponent, nextTick, onMounted, ref } from 'vue'
import type { RawAtValue } from '@slidev/types'
import { whenever } from '@vueuse/core'
import { makeId } from '../logic/utils'
import { useSlideContext } from '../context'
import { useNav } from '../composables/useNav'
import { useSlideContext } from '../context'
import { makeId } from '../logic/utils'
const props = withDefaults(defineProps<{
codeLz: string
Expand Down
4 changes: 2 additions & 2 deletions packages/client/builtin/RenderWhen.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script setup lang="ts">
import type { RenderContext } from '@slidev/types'
import { computed, ref } from 'vue'
import { useElementVisibility } from '@vueuse/core'
import { useSlideContext } from '../context'
import { computed, ref } from 'vue'
import { useNav } from '../composables/useNav'
import { useSlideContext } from '../context'
type Context = 'main' | 'visible' | 'print' | RenderContext
Expand Down
Loading

0 comments on commit c0b6eb7

Please sign in to comment.