Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit dac59ee

Browse files
fix: decks pwa screenshot size
1 parent 51a0d49 commit dac59ee

File tree

8 files changed

+20
-11
lines changed

8 files changed

+20
-11
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@
2626
- cli: v2.2.1 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/cli/CHANGELOG.md))
2727
- cloud: v2.2.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/cloud/CHANGELOG.md))
2828
- deck-utils: v3.4.1 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/utils/deck/CHANGELOG.md))
29-
- kit: v3.0.0 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/kit/CHANGELOG.md))
29+
- kit: v3.0.1 ([CHANGELOG](https://github.com/deckgo/deckdeckgo/blob/master/kit/CHANGELOG.md))
3030
- starter kit: v8.0.0 ([CHANGELOG](https://github.com/deckgo/starter-kit/blob/master/CHANGELOG.md))
31-
- studio kit: v8.0.0 ([CHANGELOG](https://github.com/deckgo/studio-kit/blob/master/CHANGELOG.md))
31+
- studio kit: v8.0.1 ([CHANGELOG](https://github.com/deckgo/studio-kit/blob/master/CHANGELOG.md))
3232

3333
<a name="4.4.0"></a>
3434

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ If you like the project, you can become a sponsor at [Open Collective](https://o
142142
| **Gatsby plugin highlight code** | | [![version](https://img.shields.io/npm/v/gatsby-remark-highlight-code/latest.svg?color=success)](https://www.npmjs.com/package/gatsby-remark-highlight-code) | [`Repo`](https://github.com/deckgo/gatsby-remark-highlight-code/) | [`CHANGELOG`](https://github.com/deckgo/gatsby-remark-highlight-code/blob/master/CHANGELOG.md) |
143143
| **Infrastructure** | | | [`README`](infra/README.md) | |
144144
| **Starter kit** | | ![version](https://img.shields.io/static/v1.svg?label=version&message=v8.0.0&color=success) | [`Repo`](http://github.com/deckgo/starter-kit/) | [`CHANGELOG`](https://github.com/deckgo/starter-kit/blob/master/CHANGELOG.md) |
145-
| **Studio kit** | | ![version](https://img.shields.io/static/v1.svg?label=version&message=v8.0.0&color=success) | [`Repo`](http://github.com/deckgo/studio-kit/) | [`CHANGELOG`](https://github.com/deckgo/studio-kit/blob/master/CHANGELOG.md) |
145+
| **Studio kit** | | ![version](https://img.shields.io/static/v1.svg?label=version&message=v8.0.1&color=success) | [`Repo`](http://github.com/deckgo/studio-kit/) | [`CHANGELOG`](https://github.com/deckgo/studio-kit/blob/master/CHANGELOG.md) |
146146
| **Template kit** | | ![version](https://img.shields.io/static/v1.svg?label=version&message=v1.0.0&color=success) | [`Repo`](http://github.com/deckgo/template-kit/) | [`CHANGELOG`](https://github.com/deckgo/template-kit/blob/master/CHANGELOG.md) |
147147
| **WAI Lambda** | | | [`Repo`](https://github.com/deckgo/wai-lambda) | |
148148
| **Webpack plugins** | [`deckdeckgo-webpack-plugins`](https://www.npmjs.com/package/deckdeckgo-webpack-plugins) | [![version](https://img.shields.io/npm/v/deckdeckgo-webpack-plugins/latest.svg?color=success)](https://www.npmjs.com/package/deckdeckgo-webpack-plugins) | [`README`](webpack/README.md) | [`CHANGELOG`](webpack/CHANGELOG.md) |

utils/kit/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 3.0.1 (2021-04-03)
2+
3+
### Fix
4+
5+
- full deck size whe a screenshot is taken
6+
17
# 3.0.0 (2021-03-28)
28

39
### Breaking

utils/kit/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

utils/kit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@deckdeckgo/kit",
3-
"version": "3.0.0",
3+
"version": "3.0.1",
44
"author": "David Dal Busco",
55
"description": "Functions, utils and styles for the DeckDeckGo presentations created with the kits",
66
"license": "MIT",

utils/kit/src/loading/loading.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import {initEmbedded} from '../embed/embedded';
22
import { initSize } from "../size/size";
3+
import { isScreenshot } from "../utils/utils.deck";
34

45
export const postLoading = async () => {
56
const app = document.querySelector('ion-app');
@@ -18,10 +19,7 @@ async function initSreenshot() {
1819
return;
1920
}
2021

21-
const url = new URL(window.location.href);
22-
const screenshot = url && url.searchParams ? url.searchParams.has('screenshot') : false;
23-
24-
if (screenshot) {
22+
if (isScreenshot()) {
2523
const menu: HTMLElement | null = document.querySelector('#fullscreen-menu');
2624

2725
if (menu) {

utils/kit/src/size/size.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {isPapyrus} from '../utils/utils.deck';
1+
import { isPapyrus, isScreenshot } from "../utils/utils.deck";
22
import { isFullscreen } from "@deckdeckgo/utils";
33

44
interface Size {
@@ -49,7 +49,7 @@ const initMainSize = async () => {
4949
return;
5050
}
5151

52-
if (EMBEDDED || isPapyrus(deck) || isFullscreen()) {
52+
if (EMBEDDED || isPapyrus(deck) || isFullscreen() || isScreenshot()) {
5353
defaultSize(main);
5454
} else {
5555
aspectRatioSize({content, main});

utils/kit/src/utils/utils.deck.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,8 @@ export function isVertical(deck: HTMLDeckgoDeckElement): boolean {
99
const mobile = isMobile();
1010
return (deck.direction === 'vertical' && !mobile) || (deck.directionMobile === 'vertical' && mobile);
1111
}
12+
13+
export function isScreenshot(): boolean {
14+
const url: URL | undefined = new URL(window?.location?.href);
15+
return url && url.searchParams ? url.searchParams.has('screenshot') : false;
16+
}

0 commit comments

Comments
 (0)