Skip to content

Commit 61786d5

Browse files
authored
[revealjs] pin to commit hash version to get fix on slide scaling for JS lib (#2437)
Current version use `zoom` attributes which messes up JS lib like plotly. This new version using `scale()` transform only. Fixes #2430
1 parent 546c90b commit 61786d5

23 files changed

+260
-183
lines changed

configuration

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ export POPPER_JS=2.11.4
2626
export CLIPBOARD_JS=2.0.10
2727
export TIPPY_JS=6.3.7
2828
export PDF_JS=2.8.335
29-
export REVEAL_JS=4.2.0
29+
# Using commit to fix https://github.com/quarto-dev/quarto-cli/issues/2430 - revert to using a release tag when included
30+
export REVEAL_JS=e281b3234e7991283ce4dcca705dd9a6a9ebe5d2
3031
export REVEAL_JS_MENU=2.1.0
3132
export REVEAL_JS_CHALKBOARD=a88c134e2cf3c7780448db003e7329c3cbd8cfb4
3233
export REVEAL_JS_PDFEXPORT=2.0.1

package/src/common/update-html-dependencies.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ export async function updateHtmlDepedencies(config: Configuration) {
273273
join(revealJs, "plugin"),
274274
);
275275
},
276-
false,
276+
true,
277277
false,
278278
);
279279

@@ -664,7 +664,8 @@ async function updatePandocHighlighting(config: Configuration) {
664664
"pandoc",
665665
"highlight-styles",
666666
);
667-
const pandoc = Deno.env.get("QUARTO_PANDOC") || join(config.directoryInfo.bin, "tools", "pandoc");
667+
const pandoc = Deno.env.get("QUARTO_PANDOC") ||
668+
join(config.directoryInfo.bin, "tools", "pandoc");
668669

669670
// List the styles
670671
const result = await runCmd(pandoc, ["--list-highlight-styles"]);

src/resources/formats/revealjs/reveal/css/layout.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
box-sizing: border-box;
1717
}
1818

19-
// Text that auto-fits it's container
19+
// Text that auto-fits its container
2020
.reveal .r-fit-text {
2121
display: inline-block; // https://github.com/rikschennink/fitty#performance
2222
white-space: nowrap;

src/resources/formats/revealjs/reveal/css/reveal.scss

+25-19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "sass:math";
2+
13
/**
24
* reveal.js
35
* http://revealjs.com
@@ -31,6 +33,16 @@ html.reveal-full-page {
3133
color: #000;
3234
}
3335

36+
// Force the presentation to cover the full viewport when we
37+
// enter fullscreen mode. Fixes sizing issues in Safari.
38+
.reveal-viewport:fullscreen {
39+
top: 0 !important;
40+
left: 0 !important;
41+
width: 100% !important;
42+
height: 100% !important;
43+
transform: none !important;
44+
}
45+
3446

3547
/*********************************************
3648
* VIEW FRAGMENTS
@@ -247,11 +259,11 @@ $controlsArrowAngleActive: 36deg;
247259

248260
@mixin controlsArrowTransform( $angle ) {
249261
&:before {
250-
transform: translateX(($controlArrowSize - $controlArrowLength)/2) translateY(($controlArrowSize - $controlArrowThickness)/2) rotate( $angle );
262+
transform: translateX(($controlArrowSize - $controlArrowLength)*0.5) translateY(($controlArrowSize - $controlArrowThickness)*0.5) rotate( $angle );
251263
}
252264

253265
&:after {
254-
transform: translateX(($controlArrowSize - $controlArrowLength)/2) translateY(($controlArrowSize - $controlArrowThickness)/2) rotate( -$angle );
266+
transform: translateX(($controlArrowSize - $controlArrowLength)*0.5) translateY(($controlArrowSize - $controlArrowThickness)*0.5) rotate( -$angle );
255267
}
256268
}
257269

@@ -300,11 +312,11 @@ $controlsArrowAngleActive: 36deg;
300312
left: 0;
301313
width: $controlArrowLength;
302314
height: $controlArrowThickness;
303-
border-radius: $controlArrowThickness/2;
315+
border-radius: $controlArrowThickness*0.5;
304316
background-color: currentColor;
305317

306318
transition: all 0.15s ease, background-color 0.8s ease;
307-
transform-origin: floor(($controlArrowThickness/2)*10)/10 50%;
319+
transform-origin: math.div(floor(($controlArrowThickness*0.5)*10), 10) 50%;
308320
will-change: transform;
309321
}
310322

@@ -326,7 +338,7 @@ $controlsArrowAngleActive: 36deg;
326338

327339
.navigate-left {
328340
right: $controlArrowSize + $controlArrowSpacing*2;
329-
bottom: $controlArrowSpacing + $controlArrowSize/2;
341+
bottom: $controlArrowSpacing + $controlArrowSize*0.5;
330342
transform: translateX( -10px );
331343

332344
&.highlight {
@@ -336,7 +348,7 @@ $controlsArrowAngleActive: 36deg;
336348

337349
.navigate-right {
338350
right: 0;
339-
bottom: $controlArrowSpacing + $controlArrowSize/2;
351+
bottom: $controlArrowSpacing + $controlArrowSize*0.5;
340352
transform: translateX( 10px );
341353

342354
.controls-arrow {
@@ -349,7 +361,7 @@ $controlsArrowAngleActive: 36deg;
349361
}
350362

351363
.navigate-up {
352-
right: $controlArrowSpacing + $controlArrowSize/2;
364+
right: $controlArrowSpacing + $controlArrowSize*0.5;
353365
bottom: $controlArrowSpacing*2 + $controlArrowSize;
354366
transform: translateY( -10px );
355367

@@ -359,7 +371,7 @@ $controlsArrowAngleActive: 36deg;
359371
}
360372

361373
.navigate-down {
362-
right: $controlArrowSpacing + $controlArrowSize/2;
374+
right: $controlArrowSpacing + $controlArrowSize*0.5;
363375
bottom: -$controlArrowSpacing;
364376
padding-bottom: $controlArrowSpacing;
365377
transform: translateY( 10px );
@@ -515,25 +527,25 @@ $controlsArrowAngleActive: 36deg;
515527
.navigate-left {
516528
top: 50%;
517529
left: $spacing;
518-
margin-top: -$controlArrowSize/2;
530+
margin-top: -$controlArrowSize*0.5;
519531
}
520532

521533
.navigate-right {
522534
top: 50%;
523535
right: $spacing;
524-
margin-top: -$controlArrowSize/2;
536+
margin-top: -$controlArrowSize*0.5;
525537
}
526538

527539
.navigate-up {
528540
top: $spacing;
529541
left: 50%;
530-
margin-left: -$controlArrowSize/2;
542+
margin-left: -$controlArrowSize*0.5;
531543
}
532544

533545
.navigate-down {
534546
bottom: $spacing - $controlArrowSpacing + 0.3em;
535547
left: 50%;
536-
margin-left: -$controlArrowSize/2;
548+
margin-left: -$controlArrowSize*0.5;
537549
}
538550
}
539551

@@ -769,9 +781,6 @@ $controlsArrowAngleActive: 36deg;
769781
*********************************************/
770782

771783
@each $stylename in slide, linear {
772-
.reveal.#{$stylename} section {
773-
backface-visibility: hidden;
774-
}
775784
@include transition-horizontal-past(#{$stylename}) {
776785
transform: translate(-150%, 0);
777786
}
@@ -1167,7 +1176,6 @@ $controlsArrowAngleActive: 36deg;
11671176
.reveal[data-background-transition=slide]>.backgrounds .slide-background:not([data-background-transition]),
11681177
.reveal>.backgrounds .slide-background[data-background-transition=slide] {
11691178
opacity: 1;
1170-
backface-visibility: hidden;
11711179
}
11721180
.reveal[data-background-transition=slide]>.backgrounds .slide-background.past:not([data-background-transition]),
11731181
.reveal>.backgrounds .slide-background.past[data-background-transition=slide] {
@@ -1701,7 +1709,7 @@ $notesWidthPercent: 25%;
17011709
.reveal .speaker-notes {
17021710
display: none;
17031711
position: absolute;
1704-
width: $notesWidthPercent / (1-$notesWidthPercent/100) * 1%;
1712+
width: math.div($notesWidthPercent, (1 - math.div($notesWidthPercent,100))) * 1%;
17051713
height: 100%;
17061714
top: 0;
17071715
left: 100%;
@@ -1764,7 +1772,6 @@ $notesWidthPercent: 25%;
17641772
top: 100%;
17651773
left: 0;
17661774
width: 100%;
1767-
height: (30/0.7)*1%;
17681775
height: 30vh;
17691776
border: 0;
17701777
}
@@ -1778,7 +1785,6 @@ $notesWidthPercent: 25%;
17781785

17791786
.reveal.show-notes .speaker-notes {
17801787
top: 100%;
1781-
height: (40/0.6)*1%;
17821788
height: 40vh;
17831789
}
17841790

src/resources/formats/revealjs/reveal/dist/reveal.css

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/dist/reveal.esm.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/dist/reveal.esm.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/dist/reveal.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/dist/reveal.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/plugin/highlight/plugin.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const Plugin = {
106106

107107
var scrollState = { currentBlock: block };
108108

109-
// If there is at least one highlight step, generate
109+
// If there is more than one highlight step, generate
110110
// fragments
111111
var highlightSteps = Plugin.deserializeHighlightSteps( block.getAttribute( 'data-line-numbers' ) );
112112
if( highlightSteps.length > 1 ) {
@@ -142,7 +142,7 @@ const Plugin = {
142142

143143
} );
144144

145-
block.removeAttribute( 'data-fragment-index' )
145+
block.removeAttribute( 'data-fragment-index' );
146146
block.setAttribute( 'data-line-numbers', Plugin.serializeHighlightSteps( [ highlightSteps[0] ] ) );
147147

148148
}

src/resources/formats/revealjs/reveal/plugin/markdown/markdown.esm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/plugin/markdown/markdown.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/plugin/markdown/plugin.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* of external markdown documents.
55
*/
66

7-
import marked from 'marked'
7+
import { marked } from 'marked';
88

99
const DEFAULT_SLIDE_SEPARATOR = '\r?\n---\r?\n',
1010
DEFAULT_NOTES_SEPARATOR = 'notes?:',

src/resources/formats/revealjs/reveal/plugin/math/math.esm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/plugin/math/math.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/plugin/math/mathjax3.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const MathJax3 = () => {
5656
let revealOptions = deck.getConfig().mathjax3 || {};
5757
let options = {...defaultOptions, ...revealOptions};
5858
options.tex = {...defaultOptions.tex, ...revealOptions.tex}
59-
options.options = {...options.options, ...defaultOptions.options}
59+
options.options = {...defaultOptions.options, ...revealOptions.options}
6060
options.startup = {...defaultOptions.startup, ...revealOptions.startup}
6161

6262
let url = options.mathjax || 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';

src/resources/formats/revealjs/reveal/plugin/notes/notes.esm.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/formats/revealjs/reveal/plugin/notes/notes.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)