import Plugins from './controllers/plugins.js' import Playback from './components/playback.js' import defaultConfig from './config.js' import { SLIDES_SELECTOR, HORIZONTAL_SLIDES_SELECTOR, VERTICAL_SLIDES_SELECTOR, POST_MESSAGE_METHOD_BLACKLIST } from './utils/constants.js' import { extend, toArray, distanceBetween, deserialize, transformElement, injectStyleSheet, closestParent, enterFullscreen } from './utils/util.js' import { colorToRgb, colorBrightness } from './utils/color.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 UA = navigator.userAgent; // Configuration defaults, can be overridden at initialization time let config, // Flags if reveal.js is loaded (has dispatched the 'ready' event) ready = 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 = {}, // An instance of the Plugins controller plugins = new 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, //