import Playback from './components/playback.js' import defaultConfig from './config.js' import { extend, toArray, distanceBetween, deserialize, transformElement, injectStyleSheet, closestParent, colorToRgb, colorBrightness, enterFullscreen } from './utils/util.js' /** * reveal.js * http://revealjs.com * MIT licensed * * Copyright (C) 2020 Hakim El Hattab, http://hakim.se */ export default function( revealElement, options ) { let Reveal; // The reveal.js version const VERSION = '4.0.0-dev'; const SLIDES_SELECTOR = '.slides section'; const HORIZONTAL_SLIDES_SELECTOR = '.slides>section'; const VERTICAL_SLIDES_SELECTOR = '.slides>section.present>section'; const HOME_SLIDE_SELECTOR = '.slides>section:first-of-type'; const UA = navigator.userAgent; // Methods that may not be invoked via the postMessage API const POST_MESSAGE_METHOD_BLACKLIST = /registerPlugin|registerKeyboardShortcut|addKeyBinding|addEventListener/; // Configuration defaults, can be overridden at initialization time let config, // Flags if reveal.js is loaded (has dispatched the 'ready' event) loaded = false, // Flags if the overview mode is currently active overview = false, // Holds the dimensions of our overview slides, including margins overviewSlideWidth = null, overviewSlideHeight = null, // The horizontal and vertical index of the currently active slide indexh, indexv, // The previous and current slide HTML elements previousSlide, currentSlide, previousBackground, // Remember which directions that the user has navigated towards hasNavigatedHorizontally = false, hasNavigatedVertically = false, // Slides may hold a data-state attribute which we pick up and apply // as a class to the body. This list contains the combined state of // all current slides. state = [], // The current scale of the presentation (see width/height config) scale = 1, // CSS transform that is currently applied to the slides container, // split into two groups slidesTransform = { layout: '', overview: '' }, // Cached references to DOM elements dom = {}, // A list of registered reveal.js plugins plugins = {}, // List of asynchronously loaded reveal.js dependencies asyncDependencies = [], // Features supported by the browser, see #checkCapabilities() features = {}, // Client is a mobile device, see #checkCapabilities() isMobileDevice, // Client is a desktop Chrome, see #checkCapabilities() isChrome, // Throttles mouse wheel navigation lastMouseWheelStep = 0, // Delays updates to the URL due to a Chrome thumbnailer bug writeURLTimeout = 0, // Is the mouse pointer currently hidden from view cursorHidden = false, // Timeout used to determine when the cursor is inactive cursorInactiveTimeout = 0, // Flags if the interaction event listeners are bound eventsAreBound = false, //