reveal.js-appearance 1.1.2 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "reveal.js-appearance",
3
- "version": "1.1.2",
4
- "description": "A plugin for Reveal.js that sequentially adds appearance effects to elements like in Powerpoint",
3
+ "version": "1.2.0",
4
+ "main": "plugin/appearance/appearance.js",
5
+ "module": "plugin/appearance/appearance.esm.js",
6
+ "description": "An animation plugin for Reveal.js that animates elements sequentially like in Powerpoint. Perfect for online portfolios or other presentations with images.",
5
7
  "keywords": "reveal, reveal.js, reveal-plugin, plugin, text effects, powerpoint",
6
8
  "homepage": "https://github.com/Martinomagnifico/reveal.js-appearance",
7
9
  "repository": {
@@ -9,7 +11,7 @@
9
11
  "url": "https://github.com/Martinomagnifico/reveal.js-appearance.git"
10
12
  },
11
13
  "author": "Martijn De Jongh",
12
- "license": "MIT, Copyright (C) 2022 Martijn De Jongh",
14
+ "license": "MIT, Copyright (C) 2023 Martijn De Jongh",
13
15
  "peerDependencies": {
14
16
  "reveal.js": "^4.2"
15
17
  }
@@ -1,3 +1,19 @@
1
+ /*
2
+ ****************************************************************
3
+ * @author: Martijn De Jongh (Martino), martijn.de.jongh@gmail.com
4
+ * https://github.com/Martinomagnifico
5
+ *
6
+ * Appearance.js for Reveal.js
7
+ * Version 1.2.0
8
+ *
9
+ * @license
10
+ * MIT licensed
11
+ *
12
+ * Thanks to:
13
+ * - Hakim El Hattab, Reveal.js
14
+ * - Daniel Eden, Animate.css
15
+ *****************************************************************
16
+ */
1
17
  /* Animate.css overrides */
2
18
  section:not(.stack):not([data-appearance-can-start]) .animate__animated, section:not(.stack):not([data-appearance-can-start]) .animated {
3
19
  opacity: 0;
@@ -11,7 +27,7 @@ section:not(.stack):not([data-appearance-can-start]) .animate__animated, section
11
27
  opacity: 1;
12
28
  }
13
29
 
14
- .fragment:not(.visible) .animate__animated, .fragment:not(.visible) .animated {
30
+ .fragment:not(.visible) .animate__animated, .fragment:not(.visible) .animated, .fragment:not(.visible).animate__animated, .fragment:not(.visible).animated {
15
31
  opacity: 0;
16
32
  -webkit-animation: none;
17
33
  animation: none;
@@ -4,7 +4,7 @@
4
4
  * https://github.com/Martinomagnifico
5
5
  *
6
6
  * Appearance.js for Reveal.js
7
- * Version 1.1.2
7
+ * Version 1.2.0
8
8
  *
9
9
  * @license
10
10
  * MIT licensed
@@ -15,84 +15,26 @@
15
15
  ******************************************************************/
16
16
 
17
17
 
18
- function _slicedToArray(arr, i) {
19
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
20
- }
21
18
 
22
- function _arrayWithHoles(arr) {
23
- if (Array.isArray(arr)) return arr;
24
- }
25
-
26
- function _iterableToArrayLimit(arr, i) {
27
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
28
-
29
- if (_i == null) return;
30
- var _arr = [];
31
- var _n = true;
32
- var _d = false;
33
-
34
- var _s, _e;
35
-
36
- try {
37
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
38
- _arr.push(_s.value);
39
-
40
- if (i && _arr.length === i) break;
41
- }
42
- } catch (err) {
43
- _d = true;
44
- _e = err;
45
- } finally {
46
- try {
47
- if (!_n && _i["return"] != null) _i["return"]();
48
- } finally {
49
- if (_d) throw _e;
50
- }
51
- }
52
-
53
- return _arr;
54
- }
55
-
56
- function _unsupportedIterableToArray(o, minLen) {
57
- if (!o) return;
58
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
59
- var n = Object.prototype.toString.call(o).slice(8, -1);
60
- if (n === "Object" && o.constructor) n = o.constructor.name;
61
- if (n === "Map" || n === "Set") return Array.from(o);
62
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
63
- }
64
-
65
- function _arrayLikeToArray(arr, len) {
66
- if (len == null || len > arr.length) len = arr.length;
67
-
68
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
69
-
70
- return arr2;
71
- }
72
-
73
- function _nonIterableRest() {
74
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
75
- }
76
-
77
- var Plugin = function Plugin() {
19
+ const Plugin = () => {
78
20
  // Scope support polyfill
79
21
  try {
80
22
  document.querySelector(":scope *");
81
23
  } catch (t) {
82
24
  !function (t) {
83
- var e = /:scope(?![\w-])/gi,
25
+ let e = /:scope(?![\w-])/gi,
84
26
  r = u(t.querySelector);
85
27
 
86
28
  t.querySelector = function (t) {
87
29
  return r.apply(this, arguments);
88
30
  };
89
31
 
90
- var c = u(t.querySelectorAll);
32
+ let c = u(t.querySelectorAll);
91
33
 
92
34
  if (t.querySelectorAll = function (t) {
93
35
  return c.apply(this, arguments);
94
36
  }, t.matches) {
95
- var n = u(t.matches);
37
+ let n = u(t.matches);
96
38
 
97
39
  t.matches = function (t) {
98
40
  return n.apply(this, arguments);
@@ -100,7 +42,7 @@ var Plugin = function Plugin() {
100
42
  }
101
43
 
102
44
  if (t.closest) {
103
- var o = u(t.closest);
45
+ let o = u(t.closest);
104
46
 
105
47
  t.closest = function (t) {
106
48
  return o.apply(this, arguments);
@@ -110,13 +52,10 @@ var Plugin = function Plugin() {
110
52
  function u(t) {
111
53
  return function (r) {
112
54
  if (r && e.test(r)) {
113
- var _c = "q" + Math.floor(9e6 * Math.random()) + 1e6;
114
-
115
- arguments[0] = r.replace(e, "[" + _c + "]"), this.setAttribute(_c, "");
116
-
117
- var _n = t.apply(this, arguments);
118
-
119
- return this.removeAttribute(_c), _n;
55
+ let c = "q" + Math.floor(9e6 * Math.random()) + 1e6;
56
+ arguments[0] = r.replace(e, "[" + c + "]"), this.setAttribute(c, "");
57
+ let n = t.apply(this, arguments);
58
+ return this.removeAttribute(c), n;
120
59
  }
121
60
 
122
61
  return t.apply(this, arguments);
@@ -125,14 +64,14 @@ var Plugin = function Plugin() {
125
64
  }(Element.prototype);
126
65
  }
127
66
 
128
- var loadStyle = function loadStyle(url, type, callback) {
129
- var head = document.querySelector('head');
130
- var style;
67
+ const loadStyle = function (url, type, callback) {
68
+ let head = document.querySelector('head');
69
+ let style;
131
70
  style = document.createElement('link');
132
71
  style.rel = 'stylesheet';
133
72
  style.href = url;
134
73
 
135
- var finish = function finish() {
74
+ let finish = function () {
136
75
  if (typeof callback === 'function') {
137
76
  callback.call();
138
77
  callback = null;
@@ -150,34 +89,199 @@ var Plugin = function Plugin() {
150
89
  head.appendChild(style);
151
90
  };
152
91
 
153
- var selectionArray = function selectionArray(container, selectors) {
154
- var selections = container.querySelectorAll(selectors);
155
- var selectionarray = Array.prototype.slice.call(selections);
92
+ const isJSON = str => {
93
+ try {
94
+ return JSON.parse(str) && !!str;
95
+ } catch (e) {
96
+ return false;
97
+ }
98
+ };
99
+
100
+ const selectionArray = function (container, selectors) {
101
+ let selections = container.querySelectorAll(selectors);
102
+ let selectionarray = Array.prototype.slice.call(selections);
156
103
  return selectionarray;
157
104
  };
158
105
 
159
- var appear = function appear(deck, options) {
160
- var baseclass = 'animate__animated';
161
- var appearanceSelector = options.compatibility ? ".".concat(options.compatibilitybaseclass) : ".".concat(baseclass);
162
- var fragmentSelector = ".fragment";
163
- var sections = deck.getRevealElement().querySelectorAll(".slides section");
164
- var fragments = deck.getRevealElement().querySelectorAll(fragmentSelector);
165
- var animatecss = '[class^="animate__"],[class*=" animate__"]';
106
+ const isStack = function (section) {
107
+ let isStack = false;
166
108
 
167
- var debugLog = function debugLog(text) {
109
+ for (let i = 0; i < section.childNodes.length; i++) {
110
+ if (section.childNodes[i].tagName == "SECTION") {
111
+ isStack = true;
112
+ break;
113
+ }
114
+ }
115
+
116
+ return isStack;
117
+ };
118
+
119
+ function copyDataAttributes(source, target, not) {
120
+ [...source.attributes].filter(attr => attr.nodeName.indexOf('data') > -1).forEach(attr => {
121
+ if (not && attr.nodeName !== not || !not) {
122
+ target.setAttribute(attr.nodeName, attr.nodeValue);
123
+ }
124
+ });
125
+ }
126
+
127
+ const appear = function (deck, options) {
128
+ let baseclass = 'animate__animated';
129
+ let viewport = deck.getRevealElement().tagName == "BODY" ? document : deck.getRevealElement();
130
+ let appearanceSelector = options.compatibility ? `.${options.compatibilitybaseclass}` : `.${baseclass}`;
131
+ let fragmentSelector = ".fragment";
132
+ let speedClasses = ['slower', 'slow', 'fast', 'faster'];
133
+ speedClasses.push(...speedClasses.map(speed => `animate__${speed}`));
134
+ document.querySelector('[name=generator]');
135
+ const sections = selectionArray(viewport, "section");
136
+ const regularSections = sections.filter(section => !isStack(section) && section.dataset.visibility != "hidden");
137
+ const fragments = deck.getRevealElement().querySelectorAll(fragmentSelector);
138
+ let animatecss = '[class^="animate__"],[class*=" animate__"]';
139
+
140
+ const debugLog = function (text) {
168
141
  if (options.debug) console.log(text);
169
142
  };
170
143
 
171
- var findAppearancesIn = function findAppearancesIn(container, includeClass, excludeClass) {
144
+ const assignAutoClass = (section, str, kind) => {
145
+ let index = [...section.parentElement.children].filter(s => s.tagName == "SECTION").indexOf(section) + 1;
146
+ let warning = kind == 'global' ? `JSON Parse error, please try to correct the global "autoelements" option.` : `JSON Parse error, please try to correct the "data-autoappear" attribute on section ${index}`;
147
+ if (typeof str === "string") str = str.replace(/[“”]/g, '"').replace(/[‘’]/g, "'");
148
+ let strJSON = isJSON(str) ? str : typeof str === "object" ? JSON.stringify(str, null, 2) : str.trim().replace(/'/g, '"').charAt(0) === "{" ? str.trim().replace(/'/g, '"') : `{${str.trim().replace(/'/g, '"')}}`;
149
+
150
+ if (!isJSON(strJSON)) {
151
+ console.log(warning);
152
+ } else {
153
+ let elementsToAnimate = JSON.parse(strJSON);
154
+
155
+ for (const [element, assignables] of Object.entries(elementsToAnimate)) {
156
+ let elementsInSection = section.querySelectorAll(element);
157
+ elementsInSection.forEach(elementInSection => {
158
+ if (!elementInSection.classList.contains(baseclass) || elementInSection.dataset["autoappear"]) {
159
+ elementInSection.dataset["autoappear"] = true;
160
+ let newClasses = [],
161
+ newDelay = null,
162
+ speedClass = false;
163
+
164
+ if (Array.isArray(assignables)) {
165
+ newClasses = assignables[0].split(/[ ,]+/);
166
+ newDelay = assignables[1];
167
+ } else if (typeof assignables == "string") {
168
+ newClasses = assignables.split(/[ ,]+/);
169
+ }
170
+
171
+ speedClasses.forEach(speed => {
172
+ if (elementInSection.classList.contains(speed)) {
173
+ speedClass = speed;
174
+ }
175
+ });
176
+ let classesToRemove = [];
177
+ elementInSection.classList.forEach(currentClass => {
178
+ if (String(currentClass).includes("animate__")) {
179
+ classesToRemove.push(currentClass);
180
+ }
181
+ });
182
+ classesToRemove.forEach(currentClass => {
183
+ elementInSection.classList.remove(currentClass);
184
+ });
185
+ newClasses.forEach(newClass => {
186
+ if (speedClasses.includes(newClass)) {
187
+ // There is a speed class from JSON to be assigned
188
+ if (speedClass) {
189
+ speedClass = newClass;
190
+ }
191
+ }
192
+ });
193
+ newClasses.forEach(newClass => {
194
+ elementInSection.classList.add(newClass);
195
+ });
196
+
197
+ if (speedClass) {
198
+ elementInSection.classList.add(speedClass);
199
+ }
200
+
201
+ if (newDelay) {
202
+ elementInSection.dataset.delay = newDelay;
203
+ }
204
+
205
+ elementInSection.classList.add(baseclass);
206
+ }
207
+ });
208
+ }
209
+ }
210
+ };
211
+
212
+ const findAppearancesIn = function (container, includeClass, excludeClass) {
172
213
  if (!isStack(container)) {
173
- var appearances = selectionArray(container, ":scope ".concat(includeClass));
174
- var excludes = selectionArray(container, ":scope ".concat(excludeClass, " ").concat(includeClass));
175
- var delay = 0;
214
+ let appearances = selectionArray(container, `:scope ${includeClass}`);
215
+ appearances.forEach(appearance => {
216
+ let convertListItem = appearance => {
217
+ let from = appearance,
218
+ to = appearance.parentNode;
219
+ if (!to) return;
220
+
221
+ for (let sibling of to.children) {
222
+ if (sibling !== appearance) {
223
+ if (sibling.dataset.appearParent) return;
224
+ }
225
+ }
226
+
227
+ to.classList = from.classList;
228
+ copyDataAttributes(from, to, "data-appear-parent");
229
+ to.innerHTML = from.innerHTML;
230
+ }; // Conversion of list items with Appearance classes to the parent, needs manual attribute
231
+ // Relates to Quarto wrapping list content in a span.
232
+
233
+
234
+ if (appearance.hasAttribute("data-appear-parent")) {
235
+ convertListItem(appearance);
236
+ } // Automatic conversion of list items which directly contain spans.
237
+ // Relates to Quarto wrapping list content in a span.
238
+
239
+
240
+ if (options.appearparents) {
241
+ if (appearance.parentNode && appearance.parentNode.tagName) {
242
+ if (appearance.tagName == "SPAN" && appearance.parentNode.tagName == "LI") {
243
+ let spanLength = String(appearance.outerHTML).length;
244
+ let liContentLength = String(appearance.parentNode.innerHTML).length;
245
+
246
+ if (spanLength == liContentLength) {
247
+ convertListItem(appearance);
248
+ }
249
+ }
250
+ }
251
+ }
252
+ });
253
+ appearances = selectionArray(container, `:scope ${includeClass}`);
254
+ let excludes = selectionArray(container, `:scope ${excludeClass} ${includeClass}`);
255
+ let delay = 0;
176
256
  appearances.filter(function (appearance, index) {
177
257
  if (!(excludes.indexOf(appearance) > -1)) {
178
258
  if (index == 0 && appearance.dataset.delay || index != 0) {
179
- var elementDelay = appearance.dataset.delay ? parseInt(appearance.dataset.delay) : options.delay;
180
- delay = delay + elementDelay;
259
+ let elementDelay = options.delay;
260
+
261
+ if (appearance.dataset && appearance.dataset.delay) {
262
+ elementDelay = parseInt(appearance.dataset.delay);
263
+ }
264
+
265
+ delay = delay + elementDelay; // Allow fragments to be Appearance items
266
+
267
+ if (appearance.classList.contains("fragment")) {
268
+ delay = 0;
269
+
270
+ if (appearance.querySelectorAll(`.${baseclass}`)) {
271
+ let firstNestedAppearance = appearance.querySelectorAll(`.${baseclass}`)[0];
272
+
273
+ if (firstNestedAppearance) {
274
+ let elementDelay = options.delay;
275
+
276
+ if (firstNestedAppearance.dataset && firstNestedAppearance.dataset.delay) {
277
+ elementDelay = parseInt(firstNestedAppearance.dataset.delay);
278
+ }
279
+
280
+ firstNestedAppearance.dataset.delay = elementDelay;
281
+ }
282
+ }
283
+ }
284
+
181
285
  appearance.style.setProperty('animation-delay', delay + "ms");
182
286
  }
183
287
  }
@@ -185,49 +289,35 @@ var Plugin = function Plugin() {
185
289
  }
186
290
  };
187
291
 
188
- var autoAdd = function autoAdd() {
189
- if (options.autoelements) {
190
- var _loop = function _loop() {
191
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
192
- autoelement = _Object$entries$_i[0],
193
- autoanimation = _Object$entries$_i[1];
194
-
195
- if (options.autoappear) {
196
- debugLog("All \"".concat(autoelement, "\"\" elements will animate with ").concat(autoanimation));
197
- }
292
+ const autoAdd = function () {
293
+ regularSections.forEach(section => {
294
+ if (section.hasAttribute("data-autoappear")) {
295
+ let sectDataAppear = section.dataset.autoappear;
198
296
 
199
- var autosection = options.autoappear ? "" : "[data-autoappear] ";
200
- var autoAppearances = deck.getRevealElement().querySelectorAll(".slides ".concat(autosection).concat(autoelement));
201
-
202
- if (autoAppearances.length > 0) {
203
- autoAppearances.forEach(function (autoAppearance) {
204
- if (!autoAppearance.classList.contains(baseclass)) {
205
- autoAppearance.classList.add(baseclass);
206
- autoAppearance.classList.add(autoanimation);
297
+ if (sectDataAppear == "auto" || sectDataAppear == "" || sectDataAppear.length < 1 || sectDataAppear == "true") {
298
+ // This section should get the global autoappear classes on its objects
299
+ if (options.autoelements) {
300
+ if (!options.autoelements) {
301
+ return console.log(`Please add some elements in the option "autoelements"`);
207
302
  }
208
- });
209
- }
210
- };
211
303
 
212
- for (var _i = 0, _Object$entries = Object.entries(options.autoelements); _i < _Object$entries.length; _i++) {
213
- _loop();
214
- }
215
- } else if (options.autoappear) {
216
- console.log("Please set an \"autoelements\" object.");
217
- }
218
- };
304
+ assignAutoClass(section, options.autoelements, 'global');
305
+ }
306
+ } else if (sectDataAppear.length > 0) {
307
+ // This section should get the local data-autoappear classes on its objects
308
+ assignAutoClass(section, sectDataAppear, 'local'); //section.removeAttribute("data-autoappear");
309
+ }
310
+ } else {
311
+ if (options.autoappear) {
312
+ if (!options.autoelements) {
313
+ return console.log(`Please add some elements in the option "autoelements"`);
314
+ } // This section should get the global autoappear classes on its objects
219
315
 
220
- var isStack = function isStack(section) {
221
- var isStack = false;
222
316
 
223
- for (var i = 0; i < section.childNodes.length; i++) {
224
- if (section.childNodes[i].tagName == "SECTION") {
225
- isStack = true;
226
- break;
317
+ assignAutoClass(section, options.autoelements, 'global');
318
+ }
227
319
  }
228
- }
229
-
230
- return isStack;
320
+ });
231
321
  };
232
322
 
233
323
  if (options.compatibility) {
@@ -235,32 +325,32 @@ var Plugin = function Plugin() {
235
325
  baseclass = options.compatibilitybaseclass;
236
326
  }
237
327
 
238
- var allappearances = deck.getRevealElement().querySelectorAll(animatecss);
239
- allappearances.forEach(function (appearance) {
328
+ let allappearances = deck.getRevealElement().querySelectorAll(animatecss);
329
+ allappearances.forEach(appearance => {
240
330
  if (!appearance.classList.contains(baseclass)) {
241
331
  appearance.classList.add(baseclass);
242
332
  }
243
333
  });
244
334
  autoAdd();
245
- sections.forEach(function (section) {
335
+ sections.forEach(section => {
246
336
  findAppearancesIn(section, appearanceSelector, fragmentSelector);
247
337
  });
248
- fragments.forEach(function (fragment) {
338
+ fragments.forEach(fragment => {
249
339
  findAppearancesIn(fragment, appearanceSelector, fragmentSelector);
250
340
  });
251
341
 
252
- var fromTo = function fromTo(event) {
253
- var slides = {};
342
+ const fromTo = function (event) {
343
+ let slides = {};
254
344
  slides.from = event.fromSlide ? event.fromSlide : event.previousSlide ? event.previousSlide : null;
255
345
  slides.to = event.toSlide ? event.toSlide : event.currentSlide ? event.currentSlide : null;
256
346
  return slides;
257
347
  };
258
348
 
259
- var showHideSlide = function showHideSlide(event) {
349
+ const showHideSlide = function (event) {
260
350
  var _slides$to;
261
351
 
262
- var etype = event.type;
263
- var slides = fromTo(event);
352
+ let etype = event.type;
353
+ let slides = fromTo(event);
264
354
  debugLog(etype);
265
355
 
266
356
  if (((_slides$to = slides.to) === null || _slides$to === void 0 ? void 0 : _slides$to.dataset.appearevent) == "auto") {
@@ -276,7 +366,7 @@ var Plugin = function Plugin() {
276
366
  }
277
367
 
278
368
  if (slides.to) {
279
- var appearevent = slides.to.dataset.appearevent ? slides.to.dataset.appearevent : options.appearevent;
369
+ let appearevent = slides.to.dataset.appearevent ? slides.to.dataset.appearevent : options.appearevent;
280
370
 
281
371
  if (etype == appearevent || etype == "slidetransitionend" && appearevent == "autoanimate") {
282
372
  slides.to.dataset.appearanceCanStart = true;
@@ -284,21 +374,27 @@ var Plugin = function Plugin() {
284
374
 
285
375
  if (etype == "slidetransitionend") {
286
376
  if (options.hideagain) {
287
- var _slides$from;
377
+ if (slides.from) {
378
+ if (slides.from.dataset.appearanceCanStart) {
379
+ delete slides.from.dataset.appearanceCanStart;
380
+ }
288
381
 
289
- (_slides$from = slides.from) === null || _slides$from === void 0 ? true : delete _slides$from.dataset.appearanceCanStart;
290
- var fromFragments = slides.from.querySelectorAll(".fragment.visible");
291
- fromFragments.forEach(function (fragment) {
292
- fragment.classList.remove('visible');
293
- });
382
+ let fromFragments = slides.from.querySelectorAll(`.fragment.visible`);
383
+
384
+ if (fromFragments) {
385
+ fromFragments.forEach(fragment => {
386
+ fragment.classList.remove('visible');
387
+ });
388
+ }
389
+ }
294
390
  }
295
391
  }
296
392
 
297
393
  if (event.type == 'slidechanged' && document.body.dataset.exitoverview) {
298
394
  if (options.hideagain) {
299
- var _slides$from2;
395
+ var _slides$from;
300
396
 
301
- (_slides$from2 = slides.from) === null || _slides$from2 === void 0 ? true : delete _slides$from2.dataset.appearanceCanStart;
397
+ (_slides$from = slides.from) === null || _slides$from === void 0 ? true : delete _slides$from.dataset.appearanceCanStart;
302
398
  }
303
399
 
304
400
  slides.to.dataset.appearanceCanStart = true;
@@ -310,9 +406,9 @@ var Plugin = function Plugin() {
310
406
 
311
407
  if (event.currentSlide) {
312
408
  if (options.hideagain) {
313
- var _slides$from3;
409
+ var _slides$from2;
314
410
 
315
- (_slides$from3 = slides.from) === null || _slides$from3 === void 0 ? true : delete _slides$from3.dataset.appearanceCanStart;
411
+ (_slides$from2 = slides.from) === null || _slides$from2 === void 0 ? true : delete _slides$from2.dataset.appearanceCanStart;
316
412
  }
317
413
 
318
414
  slides.to.dataset.appearanceCanStart = true;
@@ -321,17 +417,15 @@ var Plugin = function Plugin() {
321
417
  }
322
418
  };
323
419
 
324
- var eventnames = ['ready', 'slidechanged', 'slidetransitionend', 'autoanimate', 'overviewhidden'];
325
- eventnames.forEach(function (eventname) {
326
- return deck.on(eventname, function (event) {
327
- showHideSlide(event);
328
- });
329
- });
420
+ const eventnames = ['ready', 'slidechanged', 'slidetransitionend', 'autoanimate', 'overviewhidden'];
421
+ eventnames.forEach(eventname => deck.on(eventname, event => {
422
+ showHideSlide(event);
423
+ }));
330
424
  };
331
425
 
332
- var init = function init(deck) {
333
- var es5Filename = "appearance.js";
334
- var defaultOptions = {
426
+ const init = function (deck) {
427
+ let es5Filename = "appearance.js";
428
+ let defaultOptions = {
335
429
  baseclass: 'animate__animated',
336
430
  hideagain: true,
337
431
  delay: 300,
@@ -339,29 +433,30 @@ var Plugin = function Plugin() {
339
433
  appearevent: 'slidetransitionend',
340
434
  autoappear: false,
341
435
  autoelements: false,
436
+ appearparents: false,
342
437
  csspath: '',
343
438
  animatecsspath: {
344
439
  link: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css',
345
- compat: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.0.0/animate.compat.css'
440
+ compat: 'https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.compat.css'
346
441
  },
347
442
  compatibility: false,
348
443
  compatibilitybaseclass: 'animated'
349
444
  };
350
445
 
351
- var defaults = function defaults(options, defaultOptions) {
352
- for (var i in defaultOptions) {
446
+ const defaults = function (options, defaultOptions) {
447
+ for (let i in defaultOptions) {
353
448
  if (!options.hasOwnProperty(i)) {
354
449
  options[i] = defaultOptions[i];
355
450
  }
356
451
  }
357
452
  };
358
453
 
359
- var options = deck.getConfig().appearance || {};
454
+ let options = deck.getConfig().appearance || {};
360
455
  defaults(options, defaultOptions);
361
456
 
362
457
  function pluginPath() {
363
- var path;
364
- var pluginScript = document.querySelector("script[src$=\"".concat(es5Filename, "\"]"));
458
+ let path;
459
+ let pluginScript = document.querySelector(`script[src$="${es5Filename}"]`);
365
460
 
366
461
  if (pluginScript) {
367
462
  path = pluginScript.getAttribute("src").slice(0, -1 * es5Filename.length);
@@ -372,14 +467,14 @@ var Plugin = function Plugin() {
372
467
  return path;
373
468
  }
374
469
 
375
- var AppearanceStylePath = options.csspath.appearance ? options.csspath.appearance : "".concat(pluginPath(), "appearance.css") || 'plugin/appearance/appearance.css';
376
- var AnimateCSSPath = !options.compatibility ? options.animatecsspath.link : options.animatecsspath.compat;
470
+ let AppearanceStylePath = options.csspath.appearance ? options.csspath.appearance : `${pluginPath()}appearance.css` || 'plugin/appearance/appearance.css';
471
+ let AnimateCSSPath = !options.compatibility ? options.animatecsspath.link : options.animatecsspath.compat;
377
472
 
378
473
  if (options.debug) {
379
- console.log("Plugin path = ".concat(pluginPath()));
380
- console.log("Compatibility mode: ".concat(options.compatibility));
381
- console.log("Appearance CSS path = ".concat(AppearanceStylePath));
382
- console.log("AnimateCSS CSS path = ".concat(AnimateCSSPath));
474
+ console.log(`Plugin path = ${pluginPath()}`);
475
+ console.log(`Compatibility mode: ${options.compatibility}`);
476
+ console.log(`Appearance CSS path = ${AppearanceStylePath}`);
477
+ console.log(`AnimateCSS CSS path = ${AnimateCSSPath}`);
383
478
  }
384
479
 
385
480
  loadStyle(AnimateCSSPath, 'stylesheet', function () {