Skip to content

Commit

Permalink
Merge branch 'main' into tonai-addons
Browse files Browse the repository at this point in the history
  • Loading branch information
KermanX authored Oct 28, 2024
2 parents cf23e69 + 3be1191 commit ba1ff99
Showing 37 changed files with 1,352 additions and 1,250 deletions.
7 changes: 5 additions & 2 deletions docs/.vitepress/addons.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ThemeInfo } from './themes'

export type AddonInfo = Omit<ThemeInfo, 'previews' | 'tags'>
export type AddonInfo = Omit<ThemeInfo, 'previews'>

export const official: AddonInfo[] = [
{
@@ -19,6 +19,7 @@ export const community: AddonInfo[] = [
id: 'slidev-addon-tldraw',
name: 'tldraw for Slidev',
description: 'Embed tldraw diagrams directly in Slidev, with in-slide editing support',
tags: ['Integration', 'Diagram'],
author: {
name: 'Albert Brand',
link: 'https://github.com/AlbertBrand',
@@ -99,6 +100,7 @@ export const community: AddonInfo[] = [
id: 'slidev-addon-rabbit',
name: 'slidev-addon-rabbit',
description: 'Presentation time management for Slidev inspired by Rabbit',
tags: ['Tool', 'Navigation'],
author: {
name: 'kaakaa',
link: 'https://github.com/kaakaa',
@@ -110,7 +112,8 @@ export const community: AddonInfo[] = [
id: '',
link: 'https://github.com/slidevjs/slidev/edit/main/docs/.vitepress/addons.ts',
name: 'Yours?',
description: 'Submit your addon to be list here!',
description: 'Click here to submit your addon :)',
tags: [],
author: {
name: '',
},
12 changes: 12 additions & 0 deletions docs/.vitepress/showcases.ts
Original file line number Diff line number Diff line change
@@ -226,6 +226,18 @@ export const showcases: ShowCaseInfo[] = [
cover: 'https://i.imgur.com/2eBJofY.png',
datetime: '2024-04-10',
},
{
title: 'Hacker Numerology',
author: {
name: 'HD Moore',
link: 'https://hdm.io',
},
at: 'LASCON 2024',
slidesLink: 'https://hdm.io/decks/2024-LASCON-Numerology/',
sourceLink: 'https://github.com/hdm/decks-2024-lascon-numerology.git',
cover: 'https://raw.githubusercontent.com/hdm/decks-2024-lascon-numerology/refs/heads/main/screenshot.png',
datetime: '2024-10-25',
},
// Add yours here!
{
title: 'Yours?',
31 changes: 19 additions & 12 deletions docs/.vitepress/theme/components/AddonInfo.vue
Original file line number Diff line number Diff line change
@@ -7,44 +7,51 @@ defineProps<{
</script>

<template>
<div>
<a :href="addon.link || addon.repo" class="font-bold !text-$vp-c-text-1 !decoration-none">
{{ addon.name }}
</a>
<a :href="addon.link || addon.repo" class="block !decoration-none !text-unset !cursor-unset !hover:bg-gray-400/10 p-2 rounded-lg transition-all">
<div class="flex flex-wrap">
<a :href="addon.link || addon.repo" class="font-bold text-lg !text-$vp-c-text-1 !decoration-none">
{{ addon.name }}
</a>
<div class="flex-grow" />
<div class="mb-1 select-none op-80">
<span v-for="tag in addon.tags" :key="tag" class="text-xs mx-.5 px-1.5 py-.5 rounded-lg bg-gray-400/40">
{{ tag }}
</span>
</div>
</div>
<div
class="text-current text-xs opacity-75 whitespace-nowrap overflow-hidden text-ellipsis"
class="text-current text-xs opacity-90"
:title="addon.description"
>
{{ addon.description }}
</div>
<div class=" flex">
<div class="mt-2 flex">
<a
v-if="addon.author.link"
:href="addon.author.link"
class="text-current text-sm opacity-50"
class="text-current text-sm opacity-60 hover:opacity-100"
target="_blank"
>{{ addon.author.name }}</a>
<div v-else class="text-current text-sm opacity-50">
<div v-else class="text-current text-sm opacity-60 hover:opacity-100">
{{ addon.author.name }}
</div>
<div class="flex-auto" />
<a
v-if="addon.id"
:href="`https://npmjs.com/package/${addon.id}`"
class="ml-2 text-current opacity-20 text-sm"
hover="opacity-100 text-[#cb3837]"
class="ml-2 text-current opacity-40 text-sm hover:opacity-100"
target="_blank"
>
<simple-icons-npm />
</a>
<a
v-if="addon.repo"
:href="addon.repo"
class="ml-2 text-current opacity-20 text-sm hover:opacity-100"
class="ml-2 text-current opacity-40 text-sm hover:opacity-100"
target="_blank"
>
<simple-icons-github />
</a>
</div>
</div>
</a>
</template>
4 changes: 2 additions & 2 deletions docs/.vitepress/theme/components/LandingPage.vue
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@
Presentation Slides for Developers
</h2>
<div flex="~ gap-3 justify-center" p4 mt-5>
<a href="/guide/" class="bg-$vp-c-brand-3 text-white! no-underline! px5 py3 text-xl font-bold rounded-xl hover:bg-$vp-c-brand-1">Get Started</a>
<a href="/guide/why" class="bg-$vp-c-gray-1 text-white! no-underline! px5 py3 text-xl font-bold rounded-2xl hover:bg-$vp-c-brand-1">Why</a>
<a href="/guide/" class="bg-$vp-c-brand-3 text-white! no-underline! px5 py3 text-xl font-bold rounded-xl hover:bg-$vp-c-brand-1 h-max">Get Started</a>
<a href="/guide/why" class="bg-$vp-c-gray-1 text-white! no-underline! px5 py3 text-xl font-bold rounded-2xl hover:bg-$vp-c-brand-1 h-max">Why</a>
</div>
</div>
<div flex>
9 changes: 4 additions & 5 deletions docs/.vitepress/theme/components/ThemeInfo.vue
Original file line number Diff line number Diff line change
@@ -48,26 +48,25 @@ if (props.theme.previews.length > 1 && isClient) {
<a
v-if="theme.author.link"
:href="theme.author.link"
class="text-current text-sm opacity-50"
class="text-current text-sm opacity-60 hover:opacity-100"
target="_blank"
>{{ theme.author.name }}</a>
<div v-else class="text-current text-sm opacity-50">
<div v-else class="text-current text-sm opacity-60 hover:opacity-100">
{{ theme.author.name }}
</div>
<div class="flex-auto" />
<a
v-if="theme.id"
:href="`https://npmjs.com/package/${theme.id}`"
class="ml-2 text-current opacity-20 text-sm"
hover="opacity-100 text-[#cb3837]"
class="ml-2 text-current opacity-40 text-sm hover:opacity-100"
target="_blank"
>
<simple-icons-npm />
</a>
<a
v-if="theme.repo"
:href="theme.repo"
class="ml-2 text-current opacity-20 text-sm hover:opacity-100"
class="ml-2 text-current opacity-40 text-sm hover:opacity-100"
target="_blank"
>
<simple-icons-github />
2 changes: 1 addition & 1 deletion docs/.vitepress/themes.ts
Original file line number Diff line number Diff line change
@@ -516,7 +516,7 @@ export const community: ThemeInfo[] = [
id: '',
link: 'https://github.com/slidevjs/docs/edit/main/.vitepress/themes.ts',
name: 'Yours?',
description: 'Submit your theme to be list here!',
description: 'Click here to submit your theme :)',
author: {
name: '',
},
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "docs",
"type": "module",
"version": "0.50.0-beta.3",
"version": "0.50.0-beta.5",
"private": true,
"packageManager": "pnpm@9.11.0",
"packageManager": "pnpm@9.12.2",
"scripts": {
"dev": "vitepress",
"build": "vitepress build",
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"type": "module",
"version": "0.50.0-beta.3",
"version": "0.50.0-beta.5",
"private": true,
"packageManager": "pnpm@9.11.0",
"packageManager": "pnpm@9.12.2",
"engines": {
"node": ">=18.0.0"
},
2 changes: 1 addition & 1 deletion packages/client/builtin/KaTexBlockWrapper.vue
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ Learn more: https://sli.dev/guide/syntax.html#latex-line-highlighting

<script setup lang="ts">
import type { PropType } from 'vue'
import { parseRangeString } from '@slidev/parser'
import { parseRangeString } from '@slidev/parser/utils'
import { computed, onMounted, onUnmounted, ref, watchEffect } from 'vue'
import { CLASS_VCLICK_HIDDEN, CLASS_VCLICK_TARGET, CLICKS_MAX } from '../constants'
import { useSlideContext } from '../context'
2 changes: 1 addition & 1 deletion packages/client/internals/PrintContainer.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { parseRangeString } from '@slidev/parser/core'
import { parseRangeString } from '@slidev/parser/utils'
import { provideLocal } from '@vueuse/core'
import { computed } from 'vue'
import { useNav } from '../composables/useNav'
13 changes: 6 additions & 7 deletions packages/client/internals/SlideContainer.vue
Original file line number Diff line number Diff line change
@@ -85,13 +85,12 @@ onMounted(() => {
<slot name="controls" />
</div>
<!-- Image preview -->
<template v-else>
<img
:src="snapshot"
class="w-full object-cover"
:style="containerStyle"
>
</template>
<img
v-else
:src="snapshot"
class="w-full object-cover"
:style="containerStyle"
>
</template>

<style scoped lang="postcss">
2 changes: 1 addition & 1 deletion packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@slidev/client",
"type": "module",
"version": "0.50.0-beta.3",
"version": "0.50.0-beta.5",
"description": "Presentation slides for developers",
"author": "antfu <anthonyfu117@hotmail.com>",
"license": "MIT",
6 changes: 4 additions & 2 deletions packages/client/pages/play.vue
Original file line number Diff line number Diff line change
@@ -38,7 +38,8 @@ if (__SLIDEV_FEATURE_WAKE_LOCK__)
useWakeLock()
if (import.meta.hot) {
useStyleTag(computed(() => `
useStyleTag(computed(() => showEditor.value
? `
vite-error-overlay {
--width: calc(100vw - ${isEditorVertical.value ? 0 : editorWidth.value}px);
--height: calc(100vh - ${isEditorVertical.value ? editorHeight.value : 0}px);
@@ -49,7 +50,8 @@ if (import.meta.hot) {
height: calc(var(--height) / var(--slidev-slide-scale));
transform-origin: top left;
transform: scale(var(--slidev-slide-scale));
}`,
}`
: '',
))
}
11 changes: 5 additions & 6 deletions packages/client/setup/monaco.ts
Original file line number Diff line number Diff line change
@@ -51,14 +51,13 @@ class ContextViewService2 extends ContextViewService {
}
}

const setup = createSingletonPromise(async () => {
// Initialize services first, otherwise we can't override them.
StandaloneServices.initialize({
contextViewService: new SyncDescriptor(ContextViewService2, [], true),
})
// Initialize services first, otherwise we can't override them.
StandaloneServices.initialize({
contextViewService: new SyncDescriptor(ContextViewService2, [], true),
})

const setup = createSingletonPromise(async () => {
const defaults = monaco.languages.typescript.typescriptDefaults

defaults.setCompilerOptions({
...defaults.getCompilerOptions(),
strict: true,
2 changes: 1 addition & 1 deletion packages/create-app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-slidev",
"type": "module",
"version": "0.50.0-beta.3",
"version": "0.50.0-beta.5",
"description": "Create starter template for Slidev",
"author": "antfu <anthonyfu117@hotmail.com>",
"license": "MIT",
4 changes: 2 additions & 2 deletions packages/create-app/template/package.json
Original file line number Diff line number Diff line change
@@ -8,9 +8,9 @@
"export": "slidev export"
},
"dependencies": {
"@slidev/cli": "^0.50.0-beta.3",
"@slidev/cli": "^0.50.0-beta.5",
"@slidev/theme-default": "latest",
"@slidev/theme-seriph": "latest",
"vue": "^3.5.10"
"vue": "^3.5.12"
}
}
2 changes: 1 addition & 1 deletion packages/create-theme/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "create-slidev-theme",
"type": "module",
"version": "0.50.0-beta.3",
"version": "0.50.0-beta.5",
"description": "Create starter theme template for Slidev",
"author": "antfu <anthonyfu117@hotmail.com>",
"license": "MIT",
4 changes: 2 additions & 2 deletions packages/create-theme/template/package.json
Original file line number Diff line number Diff line change
@@ -14,10 +14,10 @@
"screenshot": "slidev export example.md --format png"
},
"dependencies": {
"@slidev/types": "^0.50.0-beta.3"
"@slidev/types": "^0.50.0-beta.5"
},
"devDependencies": {
"@slidev/cli": "^0.50.0-beta.3"
"@slidev/cli": "^0.50.0-beta.5"
},
"//": "Learn more: https://sli.dev/guide/write-theme.html",
"slidev": {
8 changes: 6 additions & 2 deletions packages/parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@slidev/parser",
"version": "0.50.0-beta.3",
"version": "0.50.0-beta.5",
"description": "Markdown parser for Slidev",
"author": "antfu <anthonyfu117@hotmail.com>",
"license": "MIT",
@@ -23,6 +23,10 @@
"./fs": {
"types": "./dist/fs.d.mts",
"import": "./dist/fs.mjs"
},
"./utils": {
"types": "./dist/utils.d.mts",
"import": "./dist/utils.mjs"
}
},
"main": "dist/index.mjs",
@@ -36,7 +40,7 @@
"node": ">=18.0.0"
},
"scripts": {
"build": "rimraf dist && tsup src/index.ts src/core.ts src/fs.ts",
"build": "rimraf dist && tsup src/index.ts src/core.ts src/fs.ts src/utils.ts",
"dev": "nr build --watch",
"prepublishOnly": "npm run build"
},
7 changes: 2 additions & 5 deletions packages/slidev/node/commands/export.ts
Original file line number Diff line number Diff line change
@@ -79,7 +79,6 @@ export interface ExportNotesOptions {
output?: string
timeout?: number
wait?: number
waitUntil?: 'networkidle' | 'load' | 'domcontentloaded'
}

function createSlidevProgress(indeterminate = false) {
@@ -124,7 +123,6 @@ export async function exportNotes({
output = 'notes',
timeout = 30000,
wait = 0,
waitUntil,
}: ExportNotesOptions): Promise<string> {
const { chromium } = await importPlaywright()
const browser = await chromium.launch()
@@ -138,9 +136,8 @@ export async function exportNotes({
if (!output.endsWith('.pdf'))
output = `${output}.pdf`

await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil, timeout })
if (waitUntil)
await page.waitForLoadState(waitUntil)
await page.goto(`http://localhost:${port}${base}presenter/print`, { waitUntil: 'networkidle', timeout })
await page.waitForLoadState('networkidle')
await page.emulateMedia({ media: 'screen' })

if (wait)
Loading

0 comments on commit ba1ff99

Please sign in to comment.