@brandocms/jupiter 3.55.0 → 4.0.0-beta.2
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/README.md +509 -54
- package/package.json +30 -18
- package/src/index.js +15 -10
- package/src/modules/Application/index.js +236 -158
- package/src/modules/Breakpoints/index.js +116 -36
- package/src/modules/Cookies/index.js +95 -64
- package/src/modules/CoverOverlay/index.js +21 -14
- package/src/modules/Dataloader/index.js +71 -24
- package/src/modules/Dataloader/url-sync.js +238 -0
- package/src/modules/Dom/index.js +24 -0
- package/src/modules/DoubleHeader/index.js +571 -0
- package/src/modules/Dropdown/index.js +108 -73
- package/src/modules/EqualHeightElements/index.js +8 -8
- package/src/modules/EqualHeightImages/index.js +15 -7
- package/src/modules/FixedHeader/index.js +116 -30
- package/src/modules/FooterReveal/index.js +5 -5
- package/src/modules/HeroSlider/index.js +231 -106
- package/src/modules/HeroVideo/index.js +72 -44
- package/src/modules/Lazyload/index.js +128 -80
- package/src/modules/Lightbox/index.js +101 -80
- package/src/modules/Links/index.js +77 -51
- package/src/modules/Looper/index.js +1737 -0
- package/src/modules/Marquee/index.js +106 -37
- package/src/modules/MobileMenu/index.js +105 -130
- package/src/modules/Moonwalk/index.js +479 -153
- package/src/modules/Parallax/index.js +280 -57
- package/src/modules/Popover/index.js +187 -17
- package/src/modules/Popup/index.js +172 -53
- package/src/modules/ScrollSpy/index.js +21 -0
- package/src/modules/StackedBoxes/index.js +8 -6
- package/src/modules/StickyHeader/index.js +394 -164
- package/src/modules/Toggler/index.js +207 -11
- package/src/modules/Typography/index.js +33 -20
- package/src/utils/motion-helpers.js +330 -0
- package/types/README.md +159 -0
- package/types/events/index.d.ts +20 -0
- package/types/index.d.ts +6 -0
- package/types/modules/Application/index.d.ts +168 -0
- package/types/modules/Breakpoints/index.d.ts +40 -0
- package/types/modules/Cookies/index.d.ts +81 -0
- package/types/modules/CoverOverlay/index.d.ts +6 -0
- package/types/modules/Dataloader/index.d.ts +38 -0
- package/types/modules/Dataloader/url-sync.d.ts +36 -0
- package/types/modules/Dom/index.d.ts +47 -0
- package/types/modules/DoubleHeader/index.d.ts +63 -0
- package/types/modules/Dropdown/index.d.ts +15 -0
- package/types/modules/EqualHeightElements/index.d.ts +8 -0
- package/types/modules/EqualHeightImages/index.d.ts +11 -0
- package/types/modules/FeatureTests/index.d.ts +27 -0
- package/types/modules/FixedHeader/index.d.ts +219 -0
- package/types/modules/Fontloader/index.d.ts +5 -0
- package/types/modules/FooterReveal/index.d.ts +5 -0
- package/types/modules/HeroSlider/index.d.ts +28 -0
- package/types/modules/HeroVideo/index.d.ts +83 -0
- package/types/modules/Lazyload/index.d.ts +80 -0
- package/types/modules/Lightbox/index.d.ts +123 -0
- package/types/modules/Links/index.d.ts +55 -0
- package/types/modules/Looper/index.d.ts +127 -0
- package/types/modules/Marquee/index.d.ts +23 -0
- package/types/modules/MobileMenu/index.d.ts +63 -0
- package/types/modules/Moonwalk/index.d.ts +322 -0
- package/types/modules/Parallax/index.d.ts +71 -0
- package/types/modules/Popover/index.d.ts +29 -0
- package/types/modules/Popup/index.d.ts +76 -0
- package/types/modules/ScrollSpy/index.d.ts +29 -0
- package/types/modules/StackedBoxes/index.d.ts +9 -0
- package/types/modules/StickyHeader/index.d.ts +220 -0
- package/types/modules/Toggler/index.d.ts +48 -0
- package/types/modules/Typography/index.d.ts +77 -0
- package/types/utils/dispatchElementEvent.d.ts +1 -0
- package/types/utils/imageIsLoaded.d.ts +1 -0
- package/types/utils/imagesAreLoaded.d.ts +1 -0
- package/types/utils/loadScript.d.ts +2 -0
- package/types/utils/prefersReducedMotion.d.ts +4 -0
- package/types/utils/rafCallback.d.ts +2 -0
- package/types/utils/zoom.d.ts +4 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ScrollSpy component for highlighting active sections during scrolling
|
|
3
|
+
*/
|
|
4
|
+
export default class ScrollSpy {
|
|
5
|
+
/**
|
|
6
|
+
* Create a new ScrollSpy instance
|
|
7
|
+
* @param {Object} app - Application instance
|
|
8
|
+
* @param {ScrollSpyOptions} [opts={}] - ScrollSpy options
|
|
9
|
+
*/
|
|
10
|
+
constructor(app: any, opts?: ScrollSpyOptions);
|
|
11
|
+
app: any;
|
|
12
|
+
opts: any;
|
|
13
|
+
/**
|
|
14
|
+
* Initialize ScrollSpy
|
|
15
|
+
*/
|
|
16
|
+
initialize(): void;
|
|
17
|
+
triggers: any;
|
|
18
|
+
/**
|
|
19
|
+
* Handle intersection with viewport
|
|
20
|
+
* @param {IntersectionObserverEntry} entry - Intersection observer entry
|
|
21
|
+
*/
|
|
22
|
+
intersectionHandler(entry: IntersectionObserverEntry): void;
|
|
23
|
+
}
|
|
24
|
+
export type ScrollSpyOptions = {
|
|
25
|
+
/**
|
|
26
|
+
* - Called when a target intersects with the viewport
|
|
27
|
+
*/
|
|
28
|
+
onIntersect?: Function;
|
|
29
|
+
};
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* StickyHeader component for sticky navigation headers with scroll behaviors.
|
|
3
|
+
* Uses position: sticky instead of position: fixed, keeping the header in document flow.
|
|
4
|
+
*/
|
|
5
|
+
export default class StickyHeader {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new StickyHeader instance
|
|
8
|
+
* @param {Object} app - Application instance
|
|
9
|
+
* @param {StickyHeaderOptions} [opts={}] - StickyHeader options
|
|
10
|
+
*/
|
|
11
|
+
constructor(app: any, opts?: StickyHeaderOptions);
|
|
12
|
+
app: any;
|
|
13
|
+
mainOpts: any;
|
|
14
|
+
el: any;
|
|
15
|
+
opts: any;
|
|
16
|
+
lis: any;
|
|
17
|
+
preventPin: boolean;
|
|
18
|
+
preventUnpin: boolean;
|
|
19
|
+
_firstLoad: boolean;
|
|
20
|
+
_pinned: boolean;
|
|
21
|
+
_top: boolean;
|
|
22
|
+
_bottom: boolean;
|
|
23
|
+
_small: boolean;
|
|
24
|
+
_altBg: boolean;
|
|
25
|
+
_isResizing: boolean;
|
|
26
|
+
_hiding: boolean;
|
|
27
|
+
lastKnownScrollY: number;
|
|
28
|
+
lastKnownScrollHeight: number;
|
|
29
|
+
currentScrollHeight: number;
|
|
30
|
+
currentScrollY: number;
|
|
31
|
+
mobileMenuOpen: boolean;
|
|
32
|
+
timer: any;
|
|
33
|
+
resetResizeTimer: any;
|
|
34
|
+
intersectingElements: any;
|
|
35
|
+
initialize(): void;
|
|
36
|
+
pageIsScrolledOnReady: boolean;
|
|
37
|
+
preflight(): void;
|
|
38
|
+
lock(): void;
|
|
39
|
+
unlock(): void;
|
|
40
|
+
isScrolled(): boolean;
|
|
41
|
+
unpinIfScrolled(): void;
|
|
42
|
+
enter(): void;
|
|
43
|
+
setResizeTimer(): void;
|
|
44
|
+
update(): void;
|
|
45
|
+
checkSize(force: any): void;
|
|
46
|
+
checkBg(force: any): void;
|
|
47
|
+
checkTop(force: any): void;
|
|
48
|
+
checkBot(force: any): void;
|
|
49
|
+
checkPin(force: any, toleranceExceeded: any): void;
|
|
50
|
+
redraw(): void;
|
|
51
|
+
notTop(): void;
|
|
52
|
+
top(): void;
|
|
53
|
+
notBottom(): void;
|
|
54
|
+
bottom(): void;
|
|
55
|
+
unpin(): void;
|
|
56
|
+
pin(): void;
|
|
57
|
+
notSmall(): void;
|
|
58
|
+
small(): void;
|
|
59
|
+
notAltBg(): void;
|
|
60
|
+
altBg(): void;
|
|
61
|
+
shouldUnpin(toleranceExceeded: any): any;
|
|
62
|
+
shouldPin(toleranceExceeded: any): any;
|
|
63
|
+
isOutOfBounds(): boolean;
|
|
64
|
+
getScrollerPhysicalHeight(): number;
|
|
65
|
+
getScrollerHeight(): number;
|
|
66
|
+
getDocumentHeight(): number;
|
|
67
|
+
getViewportHeight(): number;
|
|
68
|
+
getElementHeight(el: any): number;
|
|
69
|
+
getElementPhysicalHeight(el: any): number;
|
|
70
|
+
getScrollY(): any;
|
|
71
|
+
toleranceExceeded(): boolean;
|
|
72
|
+
_getOptionsForSection(section: any, opts: any): any;
|
|
73
|
+
_bindMobileMenuListeners(): void;
|
|
74
|
+
_onMobileMenuOpen(): void;
|
|
75
|
+
_onMobileMenuClose(): void;
|
|
76
|
+
}
|
|
77
|
+
export type StickyHeaderEvents = {
|
|
78
|
+
/**
|
|
79
|
+
* - Called when header is pinned
|
|
80
|
+
*/
|
|
81
|
+
onPin?: Function;
|
|
82
|
+
/**
|
|
83
|
+
* - Called when header is unpinned
|
|
84
|
+
*/
|
|
85
|
+
onUnpin?: Function;
|
|
86
|
+
/**
|
|
87
|
+
* - Called when alternate background is applied
|
|
88
|
+
*/
|
|
89
|
+
onAltBg?: Function;
|
|
90
|
+
/**
|
|
91
|
+
* - Called when regular background is applied
|
|
92
|
+
*/
|
|
93
|
+
onNotAltBg?: Function;
|
|
94
|
+
/**
|
|
95
|
+
* - Called when header becomes small
|
|
96
|
+
*/
|
|
97
|
+
onSmall?: Function;
|
|
98
|
+
/**
|
|
99
|
+
* - Called when header becomes normal size
|
|
100
|
+
*/
|
|
101
|
+
onNotSmall?: Function;
|
|
102
|
+
/**
|
|
103
|
+
* - Called when page is at the top
|
|
104
|
+
*/
|
|
105
|
+
onTop?: Function;
|
|
106
|
+
/**
|
|
107
|
+
* - Called when page is not at the top
|
|
108
|
+
*/
|
|
109
|
+
onNotTop?: Function;
|
|
110
|
+
/**
|
|
111
|
+
* - Called when page is at the bottom
|
|
112
|
+
*/
|
|
113
|
+
onBottom?: Function;
|
|
114
|
+
/**
|
|
115
|
+
* - Called when page is not at the bottom
|
|
116
|
+
*/
|
|
117
|
+
onNotBottom?: Function;
|
|
118
|
+
/**
|
|
119
|
+
* - Called when mobile menu opens
|
|
120
|
+
*/
|
|
121
|
+
onMobileMenuOpen?: Function;
|
|
122
|
+
/**
|
|
123
|
+
* - Called when mobile menu closes
|
|
124
|
+
*/
|
|
125
|
+
onMobileMenuClose?: Function;
|
|
126
|
+
/**
|
|
127
|
+
* - Called when header intersects with an element
|
|
128
|
+
*/
|
|
129
|
+
onIntersect?: Function;
|
|
130
|
+
/**
|
|
131
|
+
* - Called when user tabs (outline mode)
|
|
132
|
+
*/
|
|
133
|
+
onOutline?: Function;
|
|
134
|
+
};
|
|
135
|
+
export type StickyHeaderSectionOptions = {
|
|
136
|
+
/**
|
|
137
|
+
* - Whether to unpin header on window resize
|
|
138
|
+
*/
|
|
139
|
+
unPinOnResize?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* - Scrolling element
|
|
142
|
+
*/
|
|
143
|
+
canvas?: Window | HTMLElement;
|
|
144
|
+
/**
|
|
145
|
+
* - Selector for elements to check intersection with
|
|
146
|
+
*/
|
|
147
|
+
intersects?: string | null;
|
|
148
|
+
/**
|
|
149
|
+
* - Called before header enters
|
|
150
|
+
*/
|
|
151
|
+
beforeEnter?: Function;
|
|
152
|
+
/**
|
|
153
|
+
* - Called when header enters
|
|
154
|
+
*/
|
|
155
|
+
enter?: Function;
|
|
156
|
+
/**
|
|
157
|
+
* - Delay before enter animation
|
|
158
|
+
*/
|
|
159
|
+
enterDelay?: number;
|
|
160
|
+
/**
|
|
161
|
+
* - Scroll tolerance before triggering hide/show
|
|
162
|
+
*/
|
|
163
|
+
tolerance?: number;
|
|
164
|
+
/**
|
|
165
|
+
* - Offset from top before triggering hide
|
|
166
|
+
*/
|
|
167
|
+
offset?: number | string | Function;
|
|
168
|
+
/**
|
|
169
|
+
* - Offset from top before shrinking header
|
|
170
|
+
*/
|
|
171
|
+
offsetSmall?: number | string | Function;
|
|
172
|
+
/**
|
|
173
|
+
* - Offset from top before changing background color
|
|
174
|
+
*/
|
|
175
|
+
offsetBg?: number | string | Function;
|
|
176
|
+
/**
|
|
177
|
+
* - Regular background color
|
|
178
|
+
*/
|
|
179
|
+
regBgColor?: string | null;
|
|
180
|
+
/**
|
|
181
|
+
* - Alternate background color
|
|
182
|
+
*/
|
|
183
|
+
altBgColor?: string | null;
|
|
184
|
+
};
|
|
185
|
+
export type StickyHeaderOptions = {
|
|
186
|
+
/**
|
|
187
|
+
* - Header element or selector
|
|
188
|
+
*/
|
|
189
|
+
el?: string | HTMLElement;
|
|
190
|
+
/**
|
|
191
|
+
* - Event to initialize on
|
|
192
|
+
*/
|
|
193
|
+
on?: string;
|
|
194
|
+
/**
|
|
195
|
+
* - Whether to unpin on forced scroll start
|
|
196
|
+
*/
|
|
197
|
+
unpinOnForcedScrollStart?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* - Whether to pin on forced scroll end
|
|
200
|
+
*/
|
|
201
|
+
pinOnForcedScrollEnd?: boolean;
|
|
202
|
+
/**
|
|
203
|
+
* - Whether to ignore forced scroll events
|
|
204
|
+
*/
|
|
205
|
+
ignoreForcedScroll?: boolean;
|
|
206
|
+
/**
|
|
207
|
+
* - Whether to use requestAnimationFrame for scrolling
|
|
208
|
+
*/
|
|
209
|
+
rafScroll?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* - Default options for all sections
|
|
212
|
+
*/
|
|
213
|
+
default?: StickyHeaderSectionOptions;
|
|
214
|
+
/**
|
|
215
|
+
* - Section-specific options
|
|
216
|
+
*/
|
|
217
|
+
sections?: {
|
|
218
|
+
[x: string]: StickyHeaderSectionOptions;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toggler component for show/hide functionality
|
|
3
|
+
* Uses [data-toggle-trigger] for the toggle button and [data-toggle-content] for toggleable content
|
|
4
|
+
* Can be grouped using [data-toggle-group] to create accordion-like behavior
|
|
5
|
+
*/
|
|
6
|
+
export default class Toggler {
|
|
7
|
+
/**
|
|
8
|
+
* Create a new Toggler instance
|
|
9
|
+
* @param {Object} app - Application instance
|
|
10
|
+
* @param {HTMLElement} el - Container element with [data-toggle] attribute
|
|
11
|
+
* @param {Object} options - Configuration options
|
|
12
|
+
* @param {Function} options.onOpen - Callback when toggle opens
|
|
13
|
+
* @param {Function} options.onClose - Callback when toggle closes
|
|
14
|
+
*/
|
|
15
|
+
constructor(app: any, el: HTMLElement, options?: {
|
|
16
|
+
onOpen: Function;
|
|
17
|
+
onClose: Function;
|
|
18
|
+
});
|
|
19
|
+
open: boolean;
|
|
20
|
+
app: any;
|
|
21
|
+
el: HTMLElement;
|
|
22
|
+
onOpen: Function;
|
|
23
|
+
onClose: Function;
|
|
24
|
+
onBeforeOpen: any;
|
|
25
|
+
onBeforeClose: any;
|
|
26
|
+
trigger: any;
|
|
27
|
+
triggerTarget: any;
|
|
28
|
+
group: string;
|
|
29
|
+
content: any;
|
|
30
|
+
triggerIcon: any;
|
|
31
|
+
/**
|
|
32
|
+
* Get the index of this toggle within its group (1-based)
|
|
33
|
+
* @returns {number} The 1-based index of this toggle in its group
|
|
34
|
+
*/
|
|
35
|
+
getGroupIndex(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Handle click on trigger element
|
|
38
|
+
*/
|
|
39
|
+
onClick(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Close all other togglers in the same group
|
|
42
|
+
*/
|
|
43
|
+
closeOthersInGroup(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Toggle open/closed state
|
|
46
|
+
*/
|
|
47
|
+
toggleState(): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {Object} TypographySettings
|
|
3
|
+
* @property {number} [minWords=4] - Minimum number of words required to apply fixes
|
|
4
|
+
* @property {string} [selector='[data-typo]'] - Selector for elements to process
|
|
5
|
+
* @property {string} [ignoreClass='no-typo-fix'] - Class to exclude elements from processing
|
|
6
|
+
* @property {boolean} [ignoreExistingSpaceChars=false] - Whether to ignore elements with existing non-breaking spaces
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Typography class for enhancing text presentation, including orphan prevention
|
|
10
|
+
*/
|
|
11
|
+
export default class Typography {
|
|
12
|
+
/**
|
|
13
|
+
* Create a new Typography instance
|
|
14
|
+
* @param {HTMLElement|undefined} parent - Parent element to search for typography elements, or undefined for document
|
|
15
|
+
* @param {TypographySettings} settings - Typography settings
|
|
16
|
+
*/
|
|
17
|
+
constructor(parent: HTMLElement | undefined, settings?: TypographySettings);
|
|
18
|
+
settings: {
|
|
19
|
+
/**
|
|
20
|
+
* - Minimum number of words required to apply fixes
|
|
21
|
+
*/
|
|
22
|
+
minWords: number;
|
|
23
|
+
/**
|
|
24
|
+
* - Selector for elements to process
|
|
25
|
+
*/
|
|
26
|
+
selector: string;
|
|
27
|
+
/**
|
|
28
|
+
* - Class to exclude elements from processing
|
|
29
|
+
*/
|
|
30
|
+
ignoreClass: string;
|
|
31
|
+
/**
|
|
32
|
+
* - Whether to ignore elements with existing non-breaking spaces
|
|
33
|
+
*/
|
|
34
|
+
ignoreExistingSpaceChars: boolean;
|
|
35
|
+
};
|
|
36
|
+
elems: any[];
|
|
37
|
+
/**
|
|
38
|
+
* Apply formatting to the loaded elements
|
|
39
|
+
* @return void
|
|
40
|
+
*/
|
|
41
|
+
apply(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Apply the orphans filter to the passed text and return it
|
|
44
|
+
* @param {string} textItems
|
|
45
|
+
*/
|
|
46
|
+
preventOrphans(textItems: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Reset any formatting
|
|
49
|
+
* @return void
|
|
50
|
+
*/
|
|
51
|
+
reset(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Run checks to see if the passed element should be skipped
|
|
54
|
+
*
|
|
55
|
+
* @param {HTMLElement} elem
|
|
56
|
+
* @returns boolean
|
|
57
|
+
*/
|
|
58
|
+
shouldElementBeIgnored(elem: HTMLElement): boolean;
|
|
59
|
+
}
|
|
60
|
+
export type TypographySettings = {
|
|
61
|
+
/**
|
|
62
|
+
* - Minimum number of words required to apply fixes
|
|
63
|
+
*/
|
|
64
|
+
minWords?: number;
|
|
65
|
+
/**
|
|
66
|
+
* - Selector for elements to process
|
|
67
|
+
*/
|
|
68
|
+
selector?: string;
|
|
69
|
+
/**
|
|
70
|
+
* - Class to exclude elements from processing
|
|
71
|
+
*/
|
|
72
|
+
ignoreClass?: string;
|
|
73
|
+
/**
|
|
74
|
+
* - Whether to ignore elements with existing non-breaking spaces
|
|
75
|
+
*/
|
|
76
|
+
ignoreExistingSpaceChars?: boolean;
|
|
77
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function dispatchEvent(el: any, eventName: any): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function imageIsLoaded(img: any, lazy?: boolean): Promise<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function imagesAreLoaded(imgs: any, lazy?: boolean): Promise<any[]>;
|