@brandocms/jupiter 3.47.0 → 3.48.1

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.
Files changed (37) hide show
  1. package/package.json +9 -9
  2. package/src/events/index.js +1 -0
  3. package/src/index.js +5 -7
  4. package/src/modules/Application/index.js +114 -77
  5. package/src/modules/Breakpoints/index.js +14 -17
  6. package/src/modules/Cookies/index.js +86 -43
  7. package/src/modules/CoverOverlay/index.js +6 -3
  8. package/src/modules/Dataloader/index.js +173 -7
  9. package/src/modules/Dom/index.js +26 -26
  10. package/src/modules/Dropdown/index.js +14 -14
  11. package/src/modules/EqualHeightElements/index.js +70 -0
  12. package/src/modules/EqualHeightImages/index.js +17 -18
  13. package/src/modules/FeatureTests/index.js +22 -15
  14. package/src/modules/FixedHeader/index.js +79 -75
  15. package/src/modules/Fontloader/index.js +5 -3
  16. package/src/modules/FooterReveal/index.js +1 -1
  17. package/src/modules/HeroSlider/index.js +33 -23
  18. package/src/modules/HeroVideo/index.js +15 -13
  19. package/src/modules/Lazyload/index.js +119 -65
  20. package/src/modules/Lightbox/index.js +40 -43
  21. package/src/modules/Links/index.js +8 -7
  22. package/src/modules/Marquee/index.js +40 -34
  23. package/src/modules/MobileMenu/index.js +112 -65
  24. package/src/modules/Moonwalk/index.js +256 -203
  25. package/src/modules/Parallax/index.js +24 -14
  26. package/src/modules/Popup/index.js +24 -21
  27. package/src/modules/ScrollSpy/index.js +5 -5
  28. package/src/modules/StackedBoxes/index.js +5 -5
  29. package/src/modules/StickyHeader/index.js +73 -70
  30. package/src/modules/Toggler/index.js +2 -2
  31. package/src/modules/Typography/index.js +13 -10
  32. package/src/utils/dispatchElementEvent.js +2 -2
  33. package/src/utils/imageIsLoaded.js +1 -1
  34. package/src/utils/imagesAreLoaded.js +3 -3
  35. package/src/utils/loadScript.js +9 -8
  36. package/src/utils/rafCallback.js +12 -10
  37. package/src/utils/zoom.js +11 -8
@@ -1,5 +1,5 @@
1
- export default function dispatchEvent (el, eventName) {
2
- const event = document.createEvent('CustomEvent');
1
+ export default function dispatchEvent(el, eventName) {
2
+ const event = document.createEvent('CustomEvent')
3
3
  event.initCustomEvent(eventName, false, false, {})
4
4
  el.dispatchEvent(event)
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { IMAGE_LAZYLOADED } from '../events'
2
2
 
3
- export default function imageIsLoaded (img, lazy = false) {
3
+ export default function imageIsLoaded(img, lazy = false) {
4
4
  return new Promise(resolve => {
5
5
  if (lazy) {
6
6
  if (img.hasAttribute('data-ll-loaded')) {
@@ -1,6 +1,6 @@
1
- import imageIsLoaded from './imageIsLoaded';
1
+ import imageIsLoaded from './imageIsLoaded'
2
2
 
3
- export default function imagesAreLoaded (imgs, lazy = false) {
3
+ export default function imagesAreLoaded(imgs, lazy = false) {
4
4
  if (imgs && imgs.nodeType) {
5
5
  imgs = imgs.querySelectorAll('img')
6
6
  }
@@ -8,7 +8,7 @@ export default function imagesAreLoaded (imgs, lazy = false) {
8
8
  const promises = []
9
9
 
10
10
  for (let i = 0; i < imgs.length; i += 1) {
11
- const img = imgs[i];
11
+ const img = imgs[i]
12
12
  promises.push(imageIsLoaded(img, lazy))
13
13
  }
14
14
 
@@ -1,13 +1,14 @@
1
1
  export default (url, completeCallback) => {
2
- const script = document.createElement('script'); let done = false;
3
- const head = document.getElementsByTagName('head')[0];
4
- script.src = url;
2
+ const script = document.createElement('script')
3
+ let done = false
4
+ const head = document.getElementsByTagName('head')[0]
5
+ script.src = url
5
6
 
6
- script.onreadystatechange = function cb () {
7
- if (!done
8
- && (!this.readyState
9
- || this.readyState === 'loaded'
10
- || this.readyState === 'complete')) {
7
+ script.onreadystatechange = function cb() {
8
+ if (
9
+ !done &&
10
+ (!this.readyState || this.readyState === 'loaded' || this.readyState === 'complete')
11
+ ) {
11
12
  done = true
12
13
  completeCallback()
13
14
 
@@ -1,16 +1,18 @@
1
1
  const DEFAULT_FPS = 60
2
2
  const SCOPES = {}
3
3
 
4
- export default (callback, fps = DEFAULT_FPS) => (...passedArgs) => requestAnimationFrame(() => {
5
- const msCurrent = new Date().getTime()
6
- const fpsInterval = 1000 / fps
4
+ export default (callback, fps = DEFAULT_FPS) =>
5
+ (...passedArgs) =>
6
+ requestAnimationFrame(() => {
7
+ const msCurrent = new Date().getTime()
8
+ const fpsInterval = 1000 / fps
7
9
 
8
- SCOPES[callback] = SCOPES[callback] || null
10
+ SCOPES[callback] = SCOPES[callback] || null
9
11
 
10
- const msDelta = SCOPES[callback] ? msCurrent - SCOPES[callback] : null
12
+ const msDelta = SCOPES[callback] ? msCurrent - SCOPES[callback] : null
11
13
 
12
- if (msDelta === null || msDelta > fpsInterval) {
13
- SCOPES[callback] = msCurrent - (msDelta % fpsInterval)
14
- callback(...passedArgs)
15
- }
16
- })
14
+ if (msDelta === null || msDelta > fpsInterval) {
15
+ SCOPES[callback] = msCurrent - (msDelta % fpsInterval)
16
+ callback(...passedArgs)
17
+ }
18
+ })
package/src/utils/zoom.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const _binarySearch = (a, b, maxIter, epsilon, property, unit) => {
2
- const mid = (a + b) / 2;
2
+ const mid = (a + b) / 2
3
3
  if (maxIter <= 0 || b - a < epsilon) {
4
- return mid;
4
+ return mid
5
5
  }
6
6
  const query = `(${property}:${mid}${unit})`
7
7
  if (window.matchMedia(query).matches) {
@@ -18,18 +18,22 @@ const _mediaQueryBinarySearch = (property, unit, a, b, maxIter, epsilon) => {
18
18
 
19
19
  const ratio = _binarySearch(a, b, maxIter, epsilon, property, unit)
20
20
  if (div) {
21
- head.removeChild(style);
22
- document.body.removeChild(div);
21
+ head.removeChild(style)
22
+ document.body.removeChild(div)
23
23
  }
24
24
  return ratio
25
25
  }
26
26
 
27
27
  const calculateFirefox = () => {
28
- return Math.round(_mediaQueryBinarySearch('min--moz-device-pixel-ratio', '', 0, 10, 20, 0.0001) * 10) / 10
28
+ return (
29
+ Math.round(
30
+ _mediaQueryBinarySearch('min--moz-device-pixel-ratio', '', 0, 10, 20, 0.0001) * 10
31
+ ) / 10
32
+ )
29
33
  }
30
34
 
31
35
  const calculateChrome = initial => Math.round(window.devicePixelRatio * 100) - initial
32
- const calculateDefault = () => Math.round(((window.outerWidth) / window.innerWidth) * 10) / 10
36
+ const calculateDefault = () => Math.round((window.outerWidth / window.innerWidth) * 10) / 10
33
37
 
34
38
  const impls = {
35
39
  firefox: calculateFirefox,
@@ -38,7 +42,6 @@ const impls = {
38
42
  }
39
43
 
40
44
  export default {
41
- calculate: (browser, initial) => (
45
+ calculate: (browser, initial) =>
42
46
  impls[browser] ? impls[browser](initial) : impls.default(initial)
43
- )
44
47
  }