@slidev/client 0.36.6 → 0.36.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/env.ts CHANGED
@@ -7,7 +7,9 @@ import _configs from '/@slidev/configs'
7
7
  export const configs = _configs as SlidevConfig
8
8
  export const slideAspect = configs.aspectRatio ?? (16 / 9)
9
9
  export const slideWidth = configs.canvasWidth ?? 980
10
- export const slideHeight = Math.round(slideWidth / slideAspect)
10
+ // To honor the aspect ratio more as possible, we need to approximate the height to the next integer.
11
+ // Doing this, we will prevent on print, to create an additional empty white page after each page.
12
+ export const slideHeight = Math.ceil(slideWidth / slideAspect)
11
13
 
12
14
  export const themeVars = computed(() => {
13
15
  return objectMap(configs.themeConfig || {}, (k, v) => [`--slidev-theme-${k}`, v])
@@ -1,15 +1,11 @@
1
1
  <script setup lang="ts">
2
2
  import type { Slots } from 'vue'
3
3
  import { h, watchEffect } from 'vue'
4
- import _configs from '/@slidev/configs'
5
4
  import { windowSize } from '../state'
6
5
  import { isPrintMode } from '../logic/nav'
7
- import { themeVars } from '../env'
6
+ import { slideHeight, slideWidth, themeVars } from '../env'
8
7
  import PrintContainer from './PrintContainer.vue'
9
8
 
10
- const width = _configs.canvasWidth
11
- const height = Math.round(width / _configs.aspectRatio) + 1
12
-
13
9
  function vStyle<Props>(props: Props, { slots }: { slots: Slots }) {
14
10
  if (slots.default)
15
11
  return h('style', slots.default())
@@ -25,7 +21,7 @@ watchEffect(() => {
25
21
 
26
22
  <template>
27
23
  <vStyle>
28
- @page { size: {{ width }}px {{ height }}px; margin: 0px; }
24
+ @page { size: {{ slideWidth }}px {{ slideHeight }}px; margin: 0px; }
29
25
  </vStyle>
30
26
  <div id="page-root" class="grid grid-cols-[1fr_max-content]" :style="themeVars">
31
27
  <PrintContainer
@@ -46,9 +46,6 @@ provide(injectionSlideScale, scale)
46
46
  }
47
47
 
48
48
  .slide-container {
49
- @apply relative;
50
- position: relative;
51
- overflow: hidden;
52
- page-break-before: always;
49
+ @apply relative overflow-hidden break-after-page;
53
50
  }
54
51
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slidev/client",
3
- "version": "0.36.6",
3
+ "version": "0.36.7",
4
4
  "description": "Presentation slides for developers",
5
5
  "author": "antfu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",
@@ -16,11 +16,11 @@
16
16
  },
17
17
  "dependencies": {
18
18
  "@antfu/utils": "^0.5.2",
19
- "@slidev/parser": "0.36.6",
20
- "@slidev/types": "0.36.6",
19
+ "@slidev/parser": "0.36.7",
20
+ "@slidev/types": "0.36.7",
21
21
  "@unocss/reset": "^0.45.29",
22
22
  "@vueuse/core": "^9.3.0",
23
- "@vueuse/head": "^0.9.7",
23
+ "@vueuse/head": "^0.9.8",
24
24
  "@vueuse/math": "^9.3.0",
25
25
  "@vueuse/motion": "^2.0.0-beta.23",
26
26
  "codemirror": "^5.65.5",
@@ -38,12 +38,12 @@
38
38
  "resolve": "^1.22.1",
39
39
  "unocss": "^0.45.29",
40
40
  "vite-plugin-windicss": "^1.8.8",
41
- "vue": "^3.2.40",
41
+ "vue": "^3.2.41",
42
42
  "vue-router": "^4.1.5",
43
43
  "vue-starport": "^0.3.0",
44
44
  "windicss": "^3.5.6"
45
45
  },
46
46
  "devDependencies": {
47
- "vite": "^3.1.6"
47
+ "vite": "^3.1.8"
48
48
  }
49
49
  }