update packages and add valign

This commit is contained in:
2026-04-05 20:00:27 +02:00
parent b062fb98e3
commit 03fb00e374
640 changed files with 109768 additions and 39311 deletions
+87 -32
View File
@@ -1,42 +1,41 @@
import SlideContent from './controllers/slidecontent.js'
import SlideNumber from './controllers/slidenumber.js'
import JumpToSlide from './controllers/jumptoslide.js'
import Backgrounds from './controllers/backgrounds.js'
import AutoAnimate from './controllers/autoanimate.js'
import ScrollView from './controllers/scrollview.js'
import PrintView from './controllers/printview.js'
import Fragments from './controllers/fragments.js'
import Overview from './controllers/overview.js'
import Keyboard from './controllers/keyboard.js'
import Location from './controllers/location.js'
import Controls from './controllers/controls.js'
import Progress from './controllers/progress.js'
import Pointer from './controllers/pointer.js'
import Plugins from './controllers/plugins.js'
import Overlay from './controllers/overlay.js'
import Touch from './controllers/touch.js'
import Focus from './controllers/focus.js'
import Notes from './controllers/notes.js'
import Playback from './components/playback.js'
import defaultConfig from './config.js'
import * as Util from './utils/util.js'
import * as Device from './utils/device.js'
import SlideContent from './controllers/slidecontent'
import SlideNumber from './controllers/slidenumber'
import JumpToSlide from './controllers/jumptoslide'
import Backgrounds from './controllers/backgrounds'
import AutoAnimate from './controllers/autoanimate'
import ScrollView from './controllers/scrollview'
import PrintView from './controllers/printview'
import Fragments from './controllers/fragments'
import Overview from './controllers/overview'
import Keyboard from './controllers/keyboard'
import Location from './controllers/location'
import Controls from './controllers/controls'
import Progress from './controllers/progress'
import Pointer from './controllers/pointer'
import Plugins from './controllers/plugins'
import Overlay from './controllers/overlay'
import Touch from './controllers/touch'
import Focus from './controllers/focus'
import Notes from './controllers/notes'
import Playback from './components/playback'
import { defaultConfig } from './config.ts'
import * as Util from './utils/util'
import * as Device from './utils/device'
import {
SLIDES_SELECTOR,
HORIZONTAL_SLIDES_SELECTOR,
VERTICAL_SLIDES_SELECTOR,
POST_MESSAGE_METHOD_BLACKLIST
} from './utils/constants.js'
// The reveal.js version
export const VERSION = '5.2.1';
} from './utils/constants'
import { version as VERSION } from '../package.json';
export { VERSION };
/**
* reveal.js
* https://revealjs.com
* MIT licensed
*
* Copyright (C) 2011-2022 Hakim El Hattab, https://hakim.se
* Copyright (C) 2011-2026 Hakim El Hattab, https://hakim.se
*/
export default function( revealElement, options ) {
@@ -394,7 +393,7 @@ export default function( revealElement, options ) {
// Text node
if( node.nodeType === 3 ) {
text += node.textContent;
text += node.textContent.trim();
}
// Element node
else if( node.nodeType === 1 ) {
@@ -403,10 +402,25 @@ export default function( revealElement, options ) {
let isDisplayHidden = window.getComputedStyle( node )['display'] === 'none';
if( isAriaHidden !== 'true' && !isDisplayHidden ) {
// Capture alt text from img and video elements
if( node.tagName === 'IMG' || node.tagName === 'VIDEO' ) {
let altText = node.getAttribute( 'alt' );
if( altText ) {
text += ensurePunctuation( altText );
}
}
Array.from( node.childNodes ).forEach( child => {
text += getStatusText( child );
} );
// Add period after block-level text elements to improve
// screen reader experience
const textElements = ['P', 'DIV', 'UL', 'OL', 'LI', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6', 'BLOCKQUOTE'];
if( textElements.includes( node.tagName ) && text.trim() !== '' ) {
text = ensurePunctuation( text );
}
}
}
@@ -417,6 +431,22 @@ export default function( revealElement, options ) {
}
/**
* Ensures text ends with proper punctuation by adding a period
* if it doesn't already end with punctuation.
*/
function ensurePunctuation( text ) {
const trimmedText = text.trim();
if( trimmedText === '' ) {
return text;
}
return !/[.!?]$/.test(trimmedText) ? trimmedText + '.' : trimmedText;
}
/**
* This is an unfortunate necessity. Some actions – such as
* an input field being focused in an iframe or using the
@@ -1377,6 +1407,7 @@ export default function( revealElement, options ) {
}
if( slideChanged ) {
slideContent.afterSlideChanged();
dispatchSlideChanged( origin );
}
@@ -1470,6 +1501,8 @@ export default function( revealElement, options ) {
// Start or stop embedded content like videos and iframes
if( slideChanged ) {
slideContent.afterSlideChanged();
if( previousSlide ) {
slideContent.stopEmbeddedContent( previousSlide );
slideContent.stopEmbeddedContent( previousSlide.slideBackgroundElement );
@@ -1517,6 +1550,14 @@ export default function( revealElement, options ) {
fragments.sortAll();
}
// Re-apply slide state classes for the current indices.
// This ensures dynamically inserted/removed slides receive
// proper past/present/future classes on sync.
if( typeof indexh !== 'undefined' ) {
indexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, indexh );
indexv = updateSlides( VERTICAL_SLIDES_SELECTOR, indexv );
}
controls.update();
progress.update();
@@ -1541,6 +1582,8 @@ export default function( revealElement, options ) {
overview.layout();
}
dispatchEvent({ type: 'sync' });
}
/**
@@ -1563,6 +1606,13 @@ export default function( revealElement, options ) {
backgrounds.update();
notes.update();
dispatchEvent({
type: 'slidesync',
data: {
slide
}
});
}
/**
@@ -1782,14 +1832,16 @@ export default function( revealElement, options ) {
if( horizontalSlidesLength && typeof indexh !== 'undefined' ) {
const isOverview = overview.isActive();
// The number of steps away from the present slide that will
// be visible
let viewDistance = overview.isActive() ? 10 : config.viewDistance;
let viewDistance = isOverview ? 10 : config.viewDistance;
// Shorten the view distance on devices that typically have
// less resources
if( Device.isMobile ) {
viewDistance = overview.isActive() ? 6 : config.mobileViewDistance;
viewDistance = isOverview ? 6 : config.mobileViewDistance;
}
// All slides need to be visible when exporting to PDF
@@ -1822,7 +1874,7 @@ export default function( revealElement, options ) {
if( verticalSlidesLength ) {
let oy = getPreviousVerticalIndex( horizontalSlide );
let oy = isOverview ? 0 : getPreviousVerticalIndex( horizontalSlide );
for( let y = 0; y < verticalSlidesLength; y++ ) {
let verticalSlide = verticalSlides[y];
@@ -2845,6 +2897,9 @@ export default function( revealElement, options ) {
getComputedSlideSize,
setCurrentScrollPage,
// Allows for manually removing slides prior to reveal.js initialization
removeHiddenSlides,
// Returns the current scale of the presentation content
getScale: () => scale,