@brandocms/jupiter 3.46.0 → 3.46.3

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@brandocms/jupiter",
3
- "version": "3.46.0",
3
+ "version": "3.46.3",
4
4
  "description": "Frontend helpers.",
5
5
  "author": "Univers/Twined",
6
6
  "license": "UNLICENSED",
@@ -33,18 +33,19 @@
33
33
  "dependencies": {
34
34
  "@egjs/hammerjs": "^2.0.17",
35
35
  "body-scroll-lock": "^4.0.0-beta.0",
36
- "gsap": "3.8.0",
36
+ "gsap": "3.11.0",
37
37
  "lodash.defaultsdeep": "^4.6.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@babel/core": "^7.16.0",
41
- "@babel/preset-env": "^7.16.4",
42
- "babel-jest": "^27.3.1",
43
- "eslint": "8.3.0",
40
+ "@babel/core": "^7.18.13",
41
+ "@babel/preset-env": "^7.18.10",
42
+ "babel-jest": "^29.0.1",
43
+ "eslint": "8.23.0",
44
44
  "eslint-config-airbnb-base": "^15.0.0",
45
- "eslint-plugin-import": "^2.25.3",
45
+ "eslint-plugin-import": "^2.26.0",
46
46
  "eslint-plugin-node": "^11.1.0",
47
- "eslint-plugin-promise": "^5.1.1",
48
- "jest": "^27.3.1"
47
+ "eslint-plugin-promise": "^6.0.1",
48
+ "jest": "^29.0.1",
49
+ "jest-environment-jsdom": "^29.0.1"
49
50
  }
50
51
  }
@@ -187,18 +187,24 @@ export default class Lazyload {
187
187
  const img = picture.querySelector('img')
188
188
 
189
189
  const onload = () => {
190
+ if (!img.getAttribute('data-ll-loaded') && this.app.browser === 'firefox') {
191
+ // set sizes attribute on load again,
192
+ // since firefox sometimes is a bit slow to
193
+ // get the actual image width
194
+ const width = this.getWidth(img)
195
+
196
+ img.setAttribute('sizes', `${width}px`)
197
+ if (img.parentNode) {
198
+ Array.from(Dom.all(img.parentNode, 'source'))
199
+ .forEach(source => source.setAttribute('sizes', `${width}px`))
200
+ }
201
+ }
202
+
190
203
  img.removeAttribute('data-ll-placeholder')
191
204
  img.removeAttribute('data-ll-blurred')
192
205
  img.removeAttribute('data-ll-loading')
193
206
  img.setAttribute('data-ll-loaded', '')
194
-
195
- // set sizes attribute on load again, since firefox sometimes is a bit slow to
196
- // get the actual image width
197
- const width = this.getWidth(img)
198
- img.setAttribute('sizes', `${width}px`)
199
- if (img.parentNode) {
200
- Array.from(Dom.all(img.parentNode, 'source')).forEach(source => source.setAttribute('sizes', `${width}px`))
201
- }
207
+ picture.setAttribute('data-ll-srcset-loaded', '')
202
208
  }
203
209
 
204
210
  img.addEventListener('load', onload, false)
@@ -249,8 +249,8 @@ export default class Moonwalk {
249
249
  }
250
250
 
251
251
  const timeline = gsap.timeline({
252
- // autoRemoveChildren: true
253
- smoothChildTiming: true
252
+ autoRemoveChildren: false,
253
+ smoothChildTiming: false
254
254
  })
255
255
 
256
256
  return {
@@ -318,8 +318,8 @@ export default class Moonwalk {
318
318
  * @param {*} section
319
319
  */
320
320
  setupNamesAndStages (section) {
321
- gsap.set(section.el, { opacity: 1 })
322
-
321
+ section.el.setAttribute('data-moonwalk-section-ready', '')
322
+
323
323
  if (!section.stage.name && !section.name) {
324
324
  return
325
325
  }
@@ -350,7 +350,11 @@ export default class Moonwalk {
350
350
  if (section.stage.name) {
351
351
  // reset the element to its `from` state.
352
352
  const stageTween = walks[section.stage.name]
353
- gsap.set(section.el, stageTween.transition.from)
353
+ if (!stageTween) {
354
+ console.error('==> JUPITER/MOONWALK: MISSING referenced moonwalk stage', section.stage.name)
355
+ } else {
356
+ gsap.set(section.el, stageTween.transition.from)
357
+ }
354
358
  }
355
359
 
356
360
  const observer = this.sectionObserver(section)
@@ -562,9 +566,13 @@ export default class Moonwalk {
562
566
  for (let i = 0; i < entries.length; i += 1) {
563
567
  const entry = entries[i]
564
568
 
565
- if (entry.isIntersecting) {
569
+ if (entry.isIntersecting || entry.intersectionRatio > 0) {
566
570
  section.running = true
567
571
 
572
+ if (entry.target.dataset.moonwalkId) {
573
+ console.debug('-- intersecting', entry.target.dataset.moonwalkId)
574
+ }
575
+
568
576
  const walkName = entry.target.getAttribute('data-moonwalk')
569
577
  const cfg = !walkName.length ? opts.walks.default : opts.walks[walkName]
570
578
 
@@ -670,19 +678,18 @@ export default class Moonwalk {
670
678
  tweenPosition = () => `>${tweenOverlap}`
671
679
  }
672
680
  } else {
673
- tweenPosition = () => '>'
681
+ tweenPosition = () => '+=0'
674
682
  }
675
683
 
676
684
  gsap.set(target, tweenTransition.from)
677
685
 
678
- section.timeline.to(
679
- target, {
680
- ...tweenTransition.to,
681
- duration: tweenDuration
682
- },
683
- tweenPosition()
684
- )
685
- .call(() => { target.setAttribute('data-moonwalked', '') }, null, '<')
686
+ const toTransition = {
687
+ ...tweenTransition.to,
688
+ duration: tweenDuration,
689
+ onComplete: () => target.setAttribute('data-moonwalked', '')
690
+ }
691
+
692
+ section.timeline.to(target, toTransition, tweenPosition())
686
693
 
687
694
  if (alphaTween) {
688
695
  section.timeline.to(target, {
@@ -721,7 +728,7 @@ export default class Moonwalk {
721
728
  tweenPosition = () => `>${tweenOverlap}`
722
729
  }
723
730
  } else {
724
- tweenPosition = () => '>'
731
+ tweenPosition = () => '+=0'
725
732
  }
726
733
 
727
734
  section.timeline.to(
package/CHANGELOG.md DELETED
@@ -1,391 +0,0 @@
1
- #### 3.46.0
2
-
3
- - **BREAKING** Marquee: Drop `paddingLeft` -- add `startProgress`. This sets where in the
4
- timeline we should start. Default is `0.5`
5
- - Application: Add `hardScrollToTop()`
6
- - Zoom: Try to improve zoom handling for chrome
7
-
8
-
9
- #### 3.45.0
10
-
11
- - Marquee: Reveal on `APPLICATION:REVEALED`
12
- - Add Toggler module
13
-
14
-
15
- #### 3.44.0
16
-
17
- - Moonwalk: Add `data-moonwalked` to walked elements. Don't run again on
18
- already walked elements.
19
- - Dom: Add `hasAttribute`
20
-
21
-
22
- #### 3.43.0
23
-
24
- - **BREAKING** Marquee: More consistent `speed`. This means you should probably
25
- verify that the speed you set looks ok with the new config
26
- - Marquee: Add `paddingLeft` and `slowDownOnHover` options
27
- - Application: send `widthChanged` and `heightChanged` booleans
28
- in `APPLICATION:RESIZE` event detail
29
-
30
-
31
- #### 3.42.7
32
-
33
- - Links: Check for zero opacity body element on back/forward nav
34
-
35
-
36
- #### 3.42.6
37
-
38
- - Typography: Better defaults
39
- - MobileMenu: set `this.open` boolean on opening/closing
40
-
41
-
42
- #### 3.42.5
43
-
44
- - Links: Fade out header/footer (if found) in default transition
45
- - Moonwalk: Don't wait for images with `data-placeholder`, render right away
46
- and let Lazyload do the image reveal.
47
-
48
- #### 3.42.4
49
-
50
- - Moonwalk: Fix fallback selector. This could have broken devices with
51
- prefer reduced motion enabled.
52
-
53
- #### 3.42.3
54
-
55
- - Zoom: Change logic for Chrome/Safari
56
-
57
- #### 3.42.2
58
-
59
- - Popup: Listen for ESC to close popup
60
-
61
- #### 3.42.1
62
-
63
- - Moonwalk: Also remove `-children` when resetting
64
- - FixedHeader: Only run `onAltBg` and `onNotAltBg` if `altBgColor` is set
65
- - Application: Set browser zoom as `--ec-zoom` variable. This is used
66
- in EuropaCSS for scaling/zooming vw fontsizes.
67
-
68
- #### 3.42.0
69
-
70
- - FixedHeader: Try to fix scroll jank with content-visibility
71
- - General: Better checking for existing elements before proceeding
72
-
73
- #### 3.41.3
74
-
75
- - CoverOverlay: Check that iframe exists
76
- - Lazyload: Ensure parent node exists before setting sizes
77
- - General: Switch package scope to brandocms
78
-
79
- #### 3.41.2
80
-
81
- - Marquee: Play when in viewport initially. Fixes resize bug.
82
-
83
- #### 3.41.1
84
-
85
- - Marquee: Update marquee dimensions on resize
86
-
87
- #### 3.41.0
88
-
89
- - Marquee: New module
90
-
91
- #### 3.40.1
92
-
93
- - FixedHeader: Check props as preflight
94
- - FixedHeader: Set data-header-transitions after initial preflight
95
-
96
- #### 3.40.0
97
-
98
- - Dropdown: New module
99
- - Scrollspy: New module
100
-
101
- #### 3.39.1
102
-
103
- - FixedHeader: Fix `onOutline` callback
104
- - Lazyload: Also set `sizes` on `source` tags
105
-
106
-
107
- #### 3.39.0
108
-
109
- - Lightbox: Add support for srcset. Add `data-srcset` to your anchor tag with `data-lightbox`
110
- - FixedHeader: Remove unused intersect logic.
111
- - Lazyload: Fix setting `srcset` on `source` tags that have `data-srcset`
112
-
113
-
114
- #### 3.38.0
115
-
116
- - Application: Prevent scrollLock running while already locked, since this would reset scrollbar
117
- width padding compensation
118
- - Application: Add `extraPaddedElements` param to `scrollLock`. If for instance your nav needs
119
- the same padding as the body element when compensating for scrollbar width.
120
- `app.scrollLock(['header[data-nav] nav']);`
121
- - Cookies: Expire cookie law cookie one year in the future.
122
- - Dom: Add `Dom.inViewport(el)` to check if parts of `el` is currently visible
123
- - Dom: Add `Dom.create('div', ['my-class1', 'my-class2'])` convenience function
124
- - Dom: Add `Dom.remove(el)` convenience function for removing `el` from document
125
- - Dom: Add `Dom.append(el)` convenience function for appending `el` to `body`
126
- - Lazyload: Set `data-ll-loaded` on finished lazy loaded images.
127
- - Lazyload: Prevent repeat lazyloading already loaded image
128
- - Lazyload: Prevent repeat lazyloading already loaded image
129
- - Lazyload: Dynamically set `sizes` for images with `[data-sizes="auto"]`
130
- - Moonwalk: Add `container` param to constructor. For instance if we want to run Moonwalk
131
- on a json loaded doc.
132
-
133
-
134
- #### 3.37.0
135
-
136
- - update GSAP, export ScrollTrigger
137
- - Application: add `app.section`
138
- - HeroSlider: add `lazyImages` config. If true, tries to lazyload first image before
139
- setting slider as ready
140
-
141
-
142
- #### 3.36.0
143
-
144
- - Moonwalk: Fix space in class name when css tweening
145
- - Moonwalk: add `clearMoonwalkOnAnchors`. Removes all moonwalks if called from a link with hash/anchor.
146
- I.e if the URL is `/news#latest`, all moonwalks are removed. This can sort out a rendering bug with
147
- IntersectionObserver that sometimes happens.
148
- - Application: add `respectReducedMotion`. Set to false if you don't want to respect the user's
149
- reduced-motion settings. May prevent some rendering bugs in extreme cases, but not recommended.
150
- - General: Don't include polyfills in package, include from application
151
- - General: Only try to call object-fit polyfill on IE11
152
- - General: Set capture/passive for events where applicable.
153
- - Lazyload: Force picturefill after lazyload on IE11
154
-
155
-
156
- #### 3.35.0
157
-
158
- - Dom: `setCSSVar`
159
- - FixedHeader: fix `onOutline` event
160
- - Lightbox: `swipe: true/false` cfg setting. If swipe is true, native zoom won't work, so allow to choose.
161
- - Moonwalk: add `clearNestedSections` -- NOTE: This is enabled by default, since nested sections
162
- usually leads to trouble!
163
- - StickyHeader: add `beforeEnter` event
164
- - StickyHeader: add `unPinOnResize` cfg.
165
-
166
-
167
- #### 3.34.1
168
-
169
- - Cookies: Set `cookielaw` cookie to ROOT
170
-
171
-
172
- #### 3.34.0
173
-
174
- - Lightbox: Add `trigger` to opts.
175
- - Drop node 8 from travis
176
-
177
-
178
- #### 3.33.0
179
-
180
- - Add `APPLICATION_REVEALED` to registerable callbacks.
181
- app.registerCallback(Events.APPLICATION_REVEALED, () => {})
182
-
183
-
184
- #### 3.32.0
185
-
186
- - FixedHeader: Add `onOutline` event that pins header when outline is enabled. Replaces `pinOnOutline`.
187
- - Moonwalk: Change default starting style to be `opacity 0` instead of `visibility: hidden`, since the latter
188
- screws up tabbing. Make sure your css reflects this by setting `[data-moonwalk], [data-moonwalk-section], ...`
189
- to `opacity: 0` instead of `visibility: hidden`. If you update `europacss` this is fixed automatically.
190
-
191
-
192
- #### 3.31.0
193
-
194
- - Fix cookielaw banner not respecting cookie set
195
-
196
-
197
- #### 3.30.0
198
-
199
- - Kill all faders
200
-
201
-
202
- #### 3.29.0
203
-
204
- - HeroVideo: Add `data-src` option for choosing mobile/desktop versions.
205
-
206
-
207
- #### 3.28.0
208
-
209
- - Bug fixes
210
- - Update GSAP to 3.1.1
211
- - Moonwalk: Fix CSS transitions
212
-
213
-
214
- #### 3.27.0
215
-
216
- - Moonwalk: Allow setting named children - `data-moonwalk-children="slide"`
217
- - Moonwalk: Clear out more keys on reduced-motion. Update EuropaCSS too for fixes.
218
- - HeroVideo: Add `data-cover` for cover image.
219
-
220
-
221
- #### 3.26.0
222
-
223
- - Links: Add `triggerEvents` and `scrollDuration` to config.
224
-
225
-
226
- #### 3.25.0
227
-
228
- - Fix Safari back button bug where fader would stay activated.
229
-
230
-
231
- #### 3.24.2
232
-
233
- - Lock GSAP to 3.0.4 due to a timeline regression.
234
-
235
-
236
- #### 3.24.1
237
-
238
- - Remove debug log
239
-
240
-
241
- #### 3.24.0
242
-
243
- - MobileMenu: Fix: Prevent default when binding click event
244
-
245
-
246
- #### 3.23.0
247
-
248
- - MobileMenu: Fix: Pass self to `onResize` event.
249
-
250
-
251
- #### 3.22.0
252
-
253
- - Moonwalk: Fix visual bug
254
- - Moonwalk: Add runs. Runs a function when element comes into view.
255
-
256
-
257
- #### 3.21.0
258
-
259
- - gsap 3!
260
- - FixedHeader: Allow function as `offset` and `offsetBg`
261
-
262
-
263
- #### 3.20.0
264
-
265
- - FixedHeader: Allow element as `offset`
266
- - Move `unPinOnResize` to section config!
267
-
268
-
269
- #### 3.19.0
270
-
271
- - HeroVideo: Don't autoplay when in viewport if pause is pressed
272
- - Links: Ignore `noanim` classed anchors
273
-
274
-
275
- #### 3.18.0
276
-
277
- - Applicaton: Add `Application.pollForElement` and `Application.pollForVariable`
278
- - FixedHeader: Add `onMobileMenuOpen` and `onMobileMenuClose` callbacks
279
- - Dom: Add `Dom.offset` and `Dom.position`
280
-
281
-
282
- #### 3.17.0
283
-
284
- - StickyHeader: Add `opts.pinOnForcedScroll`
285
- - Application: Add `Application.scrollTo`
286
- - HeroVideo: Add pause/play.
287
- `opts.elements.play` and `opts.elements.pause` are strings representing the SVG icons.
288
- They get wrapped in a button with `[data-hero-video-pause].
289
-
290
-
291
- #### 3.16.0
292
-
293
- - Lightbox: track pointer direction in `pointerDirection`
294
- - Lightbox: expose `onClick`, `onPointerLeft` and `onPointerRight` events.
295
- - StickyHeader: add `onClone` event to customize how the auxillary header is created.
296
-
297
- #### 3.15.0
298
-
299
- - HeroSlider: better initialization. Expose `onFadeIn` event
300
- - Export `_defaultsDeep`
301
-
302
-
303
- #### 3.14.0
304
-
305
- - StickyHeader: reveals on `Events.APPLICATION_REVEALED`. Can be set with `opts.on`
306
- - Moonwalk: Force section element to be visible (Set `visibility: hidden`
307
- in pcss for `[data-moonwalk-section]`)
308
- - Application: remove default fader delay.
309
-
310
-
311
- #### 3.13.0
312
-
313
- - Lightbox: Add keyboard navigation
314
-
315
-
316
- #### 3.12.0
317
-
318
- - Lightbox: Use timelines for even more flexibility with captions
319
-
320
-
321
- #### 3.11.0
322
-
323
- - Lightbox: Rewritten to be more flexible. Exposes more events. Preloads more images.
324
-
325
-
326
- #### 3.10.0
327
-
328
- - Moonwalk: Removed `opts.fireOnReady`. Added `opts.on` option instead. Pass the event
329
- we should listen for. The default is `on: Events.APPLICATION_REVEALED`
330
- - Moonwalk: add `opts.initialDelay`. This is an added delay before `ready()` is fired.
331
- - FixedHeader: add `opts.on` option for listening to an event before firing `enter()`
332
- - FixedHeader: added `opts.<section>.beforeEnter`. This gets called during init, so
333
- it's a good place to hide items that should be revealed in `opts.<section>.enter`.
334
-
335
-
336
- #### 3.9.0
337
-
338
- - FixedHeader: Allow locking/unlocking pin/unpin
339
- - StickyHeader: Allow locking/unlocking pin/unpin
340
-
341
-
342
- #### 3.8.0
343
-
344
- - Lightbox: Lock scroll
345
- - Lightbox: Ensure image is loaded before fading in
346
-
347
-
348
- #### 3.7.0
349
-
350
- - Cookielaw: Show after application is revealed. Delay by 0.5 as standard.
351
- - Fontloader: Check that fonts are loaded before calling fadeIn() / revealed event
352
-
353
-
354
- #### 3.6.0
355
-
356
- - Lightbox: More hooks
357
- - Breakpoints: Initialize earlier to ensure breakpoints are available to other modules
358
- - Remove `no-js`/`js` feature test. Handle this at the application
359
- level instead to try and avoid fouc. Newest Brando version does this for us
360
- in the `render_meta`.
361
-
362
-
363
- #### 3.5.0
364
-
365
- - Dom: Add `overlapsVertically` function
366
- - FixedHeader: Add `unPinOnResize` boolean switch
367
- - Export `rafCallback` function
368
-
369
-
370
- #### 3.4.0
371
-
372
- - Add `Dom` class
373
-
374
-
375
- #### 3.3.0
376
-
377
- - Force update Parallax after Git tries to ruin everything
378
-
379
-
380
- #### 3.2.0
381
-
382
- - Popup: Add triggers for opening and closing popups. Add docs in README
383
-
384
-
385
- #### 3.1.0
386
-
387
- - Application: Set dimensions on application init
388
- - Application: Extended debug info (screen size, viewport, features)
389
- - Moonwalk: Clean up Moonwalk code
390
- - Parallax: Fix parallax up a bit. Still mainly for hero usage.
391
- - Parallax: Fix parallax up a bit. Still mainly for hero usage.