@brandocms/jupiter 5.0.0-beta.11 → 5.0.0-beta.13

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.
@@ -1,5 +1,12 @@
1
1
  export default class Dataloader {
2
- static replaceInnerHTML(el: any, url: any): Promise<any>;
2
+ /**
3
+ * Replace an element's innerHTML with content fetched from a URL
4
+ *
5
+ * @param {HTMLElement} el - Target element
6
+ * @param {string} url - URL to fetch HTML from
7
+ * @returns {Promise<HTMLElement>} The element with updated content
8
+ */
9
+ static replaceInnerHTML(el: HTMLElement, url: string): Promise<HTMLElement>;
3
10
  constructor(app: any, $el: any, opts?: {});
4
11
  status: string;
5
12
  app: any;
@@ -7,19 +14,28 @@ export default class Dataloader {
7
14
  id: any;
8
15
  $canvasEl: any;
9
16
  opts: any;
10
- debounce(func: any, delay?: number): (...args: any[]) => void;
17
+ debounce(func: any, delay: any): (...args: any[]) => void;
11
18
  updateBaseURL(url: any): void;
12
19
  baseURL: any;
13
20
  setInitialParams(): void;
14
21
  initialize(): void;
15
22
  $paramEls: any;
23
+ _boundOnParam: any;
24
+ _boundOnMore: any;
25
+ _boundOnFilter: (...args: any[]) => void;
16
26
  urlSync: DataloaderUrlSync;
17
27
  $moreBtn: any;
18
28
  $filterInput: any;
19
29
  onFilterInput(e: any): void;
20
30
  onMore(e: any): void;
31
+ getParamKey(el: any): any;
32
+ handleCheckboxParam(el: any): void;
33
+ handleDeselectParam(el: any, multiVals: any): void;
34
+ handleMultiSelectParam(el: any): void;
35
+ handleSingleSelectParam(el: any): void;
21
36
  onParam(e: any): void;
22
37
  fetch(addEntries?: boolean): void;
38
+ _abortController: AbortController;
23
39
  /**
24
40
  * Set [data-loader-loading] on main el
25
41
  */
@@ -34,5 +50,35 @@ export default class Dataloader {
34
50
  * Sets [data-loader-starved] attribute if there is no more to fetch
35
51
  */
36
52
  updateButton(): void;
53
+ /**
54
+ * Remove all event listeners and clean up resources
55
+ */
56
+ destroy(): void;
37
57
  }
58
+ export type DataloaderOptions = {
59
+ /**
60
+ * - Starting page index for pagination
61
+ */
62
+ page: number;
63
+ /**
64
+ * - Initial parameter key/value pairs for API requests
65
+ */
66
+ loaderParam: any;
67
+ /**
68
+ * - Initial search filter string
69
+ */
70
+ filter: string;
71
+ /**
72
+ * - Debounce delay in ms for filter input
73
+ */
74
+ filterDebounce: number;
75
+ /**
76
+ * - URL sync config keyed by loader ID
77
+ */
78
+ urlSync: any | null;
79
+ /**
80
+ * - Callback after fetch completes, receives dataloader instance
81
+ */
82
+ onFetch: Function;
83
+ };
38
84
  import DataloaderUrlSync from './url-sync';
@@ -5,6 +5,7 @@ export default class FeatureTests {
5
5
  touch: () => boolean;
6
6
  };
7
7
  results: {};
8
+ deviceLastTouched: number;
8
9
  runTests(tests: any): void;
9
10
  testFor(feature: any, result: any): void;
10
11
  /**
@@ -17,7 +18,6 @@ export default class FeatureTests {
17
18
  * listen for events as well
18
19
  */
19
20
  testTouchMouseEvents(): void;
20
- deviceLastTouched: number;
21
21
  bindEventTests(): void;
22
22
  testTouch(): boolean;
23
23
  testIE11(): boolean;
@@ -9,6 +9,58 @@ export default class FixedHeader {
9
9
  */
10
10
  constructor(app: any, opts?: FixedHeaderOptions);
11
11
  app: any;
12
+ _rawSections: {
13
+ [k: string]: {
14
+ /**
15
+ * - Whether to unpin header on window resize
16
+ */
17
+ unPinOnResize?: boolean;
18
+ /**
19
+ * - Scrolling element
20
+ */
21
+ canvas?: Window | HTMLElement;
22
+ /**
23
+ * - Selector for elements to check intersection with
24
+ */
25
+ intersects?: string | null;
26
+ /**
27
+ * - Called before header enters
28
+ */
29
+ beforeEnter?: Function;
30
+ /**
31
+ * - Called when header enters
32
+ */
33
+ enter?: Function;
34
+ /**
35
+ * - Delay before enter animation
36
+ */
37
+ enterDelay?: number;
38
+ /**
39
+ * - Scroll tolerance before triggering hide/show
40
+ */
41
+ tolerance?: number;
42
+ /**
43
+ * - Offset from top before triggering hide
44
+ */
45
+ offset?: number | string | Function;
46
+ /**
47
+ * - Offset from top before shrinking header
48
+ */
49
+ offsetSmall?: number | string | Function;
50
+ /**
51
+ * - Offset from top before changing background color
52
+ */
53
+ offsetBg?: number | string | Function;
54
+ /**
55
+ * - Regular background color
56
+ */
57
+ regBgColor?: string | null;
58
+ /**
59
+ * - Alternate background color
60
+ */
61
+ altBgColor?: string | null;
62
+ };
63
+ };
12
64
  mainOpts: any;
13
65
  el: any;
14
66
  opts: any;
@@ -69,6 +121,12 @@ export default class FixedHeader {
69
121
  getElementPhysicalHeight(el: any): number;
70
122
  getScrollY(): any;
71
123
  toleranceExceeded(): boolean;
124
+ /**
125
+ * Reconfigure the header for a new section/page.
126
+ * Call this after a view transition or SPA navigation
127
+ * to re-resolve section options and reset scroll state.
128
+ */
129
+ reconfigure(): void;
72
130
  _getOptionsForSection(section: any, opts: any): any;
73
131
  _bindMobileMenuListeners(): void;
74
132
  _onMobileMenuOpen(): void;
@@ -29,17 +29,40 @@ export default class Lazyload {
29
29
  imageObserver: IntersectionObserver;
30
30
  lazyImages: any;
31
31
  initObserver(observer: any, setAttrs?: boolean): void;
32
- forceLoad($container?: HTMLElement): void;
32
+ /**
33
+ * Force load all lazyload elements within a container, bypassing intersection observers.
34
+ * Used by modules like Looper when dynamically adding content that needs immediate loading.
35
+ * @param {HTMLElement} [$container=document.body] - Container to search for lazyload elements
36
+ * @param {Object} [options]
37
+ * @param {boolean} [options.reveal=true] - Whether to also reveal (set data-ll-loaded) after loading
38
+ */
39
+ forceLoad($container?: HTMLElement, { reveal }?: {
40
+ reveal?: boolean;
41
+ }): void;
33
42
  initializeResizeObserver(): void;
34
43
  sizeObserver: ResizeObserver;
35
44
  flushSizeUpdates(): void;
36
45
  initializeSections(): void;
37
- handleLoadEntries(elements: any): void;
38
- handleRevealEntries(elements: any): void;
46
+ handleLoadEntries(entries: any): void;
47
+ handleRevealEntries(entries: any): void;
39
48
  loadPicture(picture: any): void;
40
- revealPicture(picture: any): void;
41
- lazyloadImages(elements: any): void;
49
+ /**
50
+ * Reveal a picture element by setting `data-ll-loaded` on its img child.
51
+ * @param {HTMLElement} picture - The picture element to reveal
52
+ */
53
+ revealPicture(picture: HTMLElement): void;
54
+ /**
55
+ * Swap source attributes on a picture element for the native lazyload path.
56
+ * Copies data-srcset to srcset on all sources and the img element.
57
+ * @param {HTMLElement} picture - The picture element to swap
58
+ */
59
+ swapPicture(picture: HTMLElement): void;
60
+ lazyloadImages(entries: any): void;
42
61
  swapImage(image: any): void;
62
+ /**
63
+ * Destroy the Lazyload instance, disconnecting all observers and freeing resources.
64
+ */
65
+ destroy(): void;
43
66
  }
44
67
  export type IntersectionObserverConfig = {
45
68
  /**
@@ -60,18 +83,10 @@ export type LazyloadOptions = {
60
83
  * - Configuration for the load intersection observer
61
84
  */
62
85
  loadIntersectionObserverConfig?: IntersectionObserverConfig;
63
- /**
64
- * - Configuration for general intersection observers
65
- */
66
- intersectionObserverConfig?: IntersectionObserverConfig;
67
86
  /**
68
87
  * - Whether to use native lazyloading if available
69
88
  */
70
89
  useNativeLazyloadIfAvailable?: boolean;
71
- /**
72
- * - Lazyload mode
73
- */
74
- mode?: string;
75
90
  /**
76
91
  * - Minimum size for auto sizing
77
92
  */
@@ -84,4 +99,8 @@ export type LazyloadOptions = {
84
99
  * - Whether to register a callback for APPLICATION_REVEALED event
85
100
  */
86
101
  registerCallback?: boolean;
102
+ /**
103
+ * - Container element to scope lazyloading to. Defaults to document.body
104
+ */
105
+ target?: HTMLElement | null;
87
106
  };
@@ -1,5 +1,39 @@
1
1
  /**
2
- * Moonwalk animation system for scroll-based reveal animations
2
+ * Normalize alphaTween config into a consistent object form.
3
+ * Returns a new object (never mutates the original).
4
+ */
5
+ export function normalizeAlphaTween(alphaTween: any, duration: any): any;
6
+ /**
7
+ * Moonwalk animation system for scroll-based reveal animations.
8
+ *
9
+ * ## HTML attributes
10
+ *
11
+ * - `data-moonwalk` / `data-moonwalk="{walkName}"` — marks an element for scroll-triggered animation
12
+ * - `data-moonwalk-section` / `data-moonwalk-section="{walkName}"` — groups elements; unnamed sections
13
+ * animate children individually, named sections stagger-reveal all children at once
14
+ * - `data-moonwalk-children` / `data-moonwalk-children="{walkName}"` — converts direct children
15
+ * into `data-moonwalk` (or `data-moonwalk="{walkName}"`) elements automatically
16
+ * - `data-moonwalk-stage="{walkName}"` — applies a walk transition to the section element itself
17
+ * before its children animate (e.g. fade in a container, then reveal items)
18
+ * - `data-moonwalk-order="{number}"` — overrides the DOM order of children inside a named section;
19
+ * elements with order are sorted first, unordered elements keep their relative position
20
+ * - `data-moonwalk-run="{runName}"` — standalone observer-based callback (not part of walk system)
21
+ * - `data-placeholder` / `data-ll-placeholder` — skip waiting for image load before tweening
22
+ *
23
+ * ## CSS-only mode
24
+ *
25
+ * Set `transition: null` on a walk to use CSS-only animations. Moonwalk will stagger-add the
26
+ * `data-moonwalked` attribute instead of running JS tweens. Style the reveal via CSS:
27
+ * ```css
28
+ * [data-moonwalk="fade"] { opacity: 0; transition: opacity 0.5s; }
29
+ * [data-moonwalk="fade"][data-moonwalked] { opacity: 1; }
30
+ * ```
31
+ *
32
+ * ## alphaTween
33
+ *
34
+ * Can be `true` (defaults: duration from walk, ease `'easeIn'`) or an object:
35
+ * `{ duration?: number, ease?: string, delay?: number }` for fine-grained control
36
+ * over a separate opacity animation layered on top of the main transition.
3
37
  */
4
38
  export default class Moonwalk {
5
39
  /**
@@ -11,7 +45,8 @@ export default class Moonwalk {
11
45
  app: any;
12
46
  opts: any;
13
47
  initialize(container?: HTMLElement): void;
14
- sections: {
48
+ _observers: any[];
49
+ sections: any[] | {
15
50
  id: string;
16
51
  el: any;
17
52
  name: any;
@@ -28,7 +63,7 @@ export default class Moonwalk {
28
63
  };
29
64
  elements: any[];
30
65
  }[];
31
- runs: {
66
+ runs: any[] | {
32
67
  el: Element;
33
68
  threshold: any;
34
69
  initialize: any;
@@ -38,6 +73,7 @@ export default class Moonwalk {
38
73
  repeated: any;
39
74
  rootMargin: any;
40
75
  }[];
76
+ _boundOnReady: any;
41
77
  /**
42
78
  * Add `moonwalk` class to html element to identify ourselves.
43
79
  */
@@ -183,12 +219,29 @@ export default class Moonwalk {
183
219
  * @param {*} duration - The duration of the animation
184
220
  */
185
221
  updateAnimationState(section: any, delay: any, duration: any): void;
222
+ destroy(): void;
186
223
  onReady(): void;
187
224
  /**
188
225
  * Called on `APPLICATION_READY` event, if `config.fireOnReady`.
189
226
  * Otherwise must be triggered manually
190
227
  */
191
228
  ready(): void;
229
+ /**
230
+ * Get the viewport entry direction based on current scroll direction.
231
+ * When entering, elements appear from the opposite side of scroll direction.
232
+ *
233
+ * @param {boolean} isEntry - Whether this is an entry (true) or exit (false)
234
+ * @returns {string|null}
235
+ */
236
+ getScrollDirection(isEntry: boolean): string | null;
237
+ /**
238
+ * Get the exit direction for an element, falling back to position-based
239
+ * detection when scroll direction is unavailable.
240
+ *
241
+ * @param {IntersectionObserverEntry} entry
242
+ * @returns {string|null}
243
+ */
244
+ getExitDirection(entry: IntersectionObserverEntry): string | null;
192
245
  /**
193
246
  * Creates and returns the RUN observer for data-moonwalk-run elements
194
247
  *
@@ -210,6 +263,7 @@ export default class Moonwalk {
210
263
  * @param {*} section
211
264
  * @param {*} target
212
265
  * @param {*} tweenDuration
266
+ * @param {*} tweenInterval
213
267
  * @param {*} tweenTransition
214
268
  * @param {*} tweenOverlap
215
269
  * @param {*} alphaTween
@@ -220,9 +274,10 @@ export default class Moonwalk {
220
274
  *
221
275
  * @param {*} section
222
276
  * @param {*} target
223
- * @param {*} duration
224
- * @param {*} transition
225
- * @param {*} overlap
277
+ * @param {*} tweenDuration
278
+ * @param {*} tweenInterval
279
+ * @param {*} tweenTransition
280
+ * @param {*} tweenOverlap
226
281
  */
227
282
  tweenCSS(section: any, target: any, tweenDuration: any, tweenInterval: any, tweenTransition: any, tweenOverlap: any): void;
228
283
  }
@@ -236,6 +291,20 @@ export type MoonwalkTransition = {
236
291
  */
237
292
  to: any;
238
293
  };
294
+ export type AlphaTweenConfig = {
295
+ /**
296
+ * - Duration of the alpha tween (defaults to walk duration)
297
+ */
298
+ duration?: number;
299
+ /**
300
+ * - Easing function (defaults to 'easeIn')
301
+ */
302
+ ease?: string;
303
+ /**
304
+ * - Additional delay before the alpha tween starts
305
+ */
306
+ delay?: number;
307
+ };
239
308
  export type MoonwalkWalk = {
240
309
  /**
241
310
  * - Delay before the animation starts
@@ -250,18 +319,24 @@ export type MoonwalkWalk = {
250
319
  */
251
320
  duration?: number;
252
321
  /**
253
- * - Whether to add a separate opacity tween
322
+ * - Whether to add a separate opacity tween. Pass `true` for defaults or an AlphaTweenConfig object for control.
254
323
  */
255
- alphaTween?: boolean | any;
324
+ alphaTween?: boolean | AlphaTweenConfig;
256
325
  /**
257
- * - The transition configuration
326
+ * - The transition configuration. Set to `null` for CSS-only mode (uses `data-moonwalked` attribute for CSS transitions).
258
327
  */
259
- transition: MoonwalkTransition;
328
+ transition: MoonwalkTransition | null;
260
329
  /**
261
- * - CSS selector for targeting elements in named sections
330
+ * - CSS selector for targeting elements in named sections (instead of using direct children)
262
331
  */
263
332
  sectionTargets?: string;
264
333
  };
334
+ export type MoonwalkRunMeta = {
335
+ /**
336
+ * - The viewport entry/exit direction ('top', 'bottom', 'left', 'right', or null)
337
+ */
338
+ direction: string | null;
339
+ };
265
340
  export type MoonwalkRun = {
266
341
  /**
267
342
  * - IntersectionObserver threshold
@@ -270,11 +345,11 @@ export type MoonwalkRun = {
270
345
  /**
271
346
  * - Function called when element enters viewport
272
347
  */
273
- callback: Function;
348
+ callback: (el: HTMLElement, repeated: boolean, meta: MoonwalkRunMeta) => void;
274
349
  /**
275
350
  * - Function called when element exits viewport
276
351
  */
277
- onExit?: Function;
352
+ onExit?: (el: HTMLElement, exited: boolean, meta: MoonwalkRunMeta) => void;
278
353
  /**
279
354
  * - Whether the run should repeat
280
355
  */
@@ -286,17 +361,17 @@ export type MoonwalkRun = {
286
361
  /**
287
362
  * - Function called during initialization
288
363
  */
289
- initialize?: Function;
364
+ initialize?: (el: HTMLElement) => void;
290
365
  /**
291
366
  * - Function called when APPLICATION_REVEALED fires, before viewport observers start
292
367
  */
293
- onReady?: Function;
368
+ onReady?: (el: HTMLElement) => void;
294
369
  };
295
370
  export type MoonwalkOptions = {
296
371
  /**
297
- * - Event to trigger animations
372
+ * - Event name to trigger animations. Set to `null` to trigger manually via `ready()`.
298
373
  */
299
- on?: string | Function;
374
+ on?: string | null;
300
375
  /**
301
376
  * - Delay before starting animations
302
377
  */
@@ -346,7 +421,7 @@ export type MoonwalkOptions = {
346
421
  /**
347
422
  * - Walk configurations
348
423
  */
349
- walks: {
424
+ walks?: {
350
425
  [x: string]: MoonwalkWalk;
351
426
  };
352
427
  };