@ulu/frontend 0.2.0-beta.2 → 0.2.0-beta.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/dist/ulu-frontend.es.js +421 -418
- package/dist/ulu-frontend.umd.js +14 -14
- package/lib/js/ui/breakpoints.js +12 -4
- package/package.json +1 -1
package/lib/js/ui/breakpoints.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// Pass breakpoints from CSS to stylesheet, use this to attach behaviors on breakpoints
|
|
6
6
|
import { removeArrayElement } from "@ulu/utils/array.js";
|
|
7
|
+
import { isBrowser } from "@ulu/utils/browser/dom.js";
|
|
7
8
|
import { getCoreEventName } from "../core/events.js";
|
|
8
9
|
import { wrapSettingString } from "../core/settings.js";
|
|
9
10
|
import { getCustomProperty } from "../utils/css.js";
|
|
@@ -11,10 +12,9 @@ import { log, logError } from "../utils/class-logger.js";
|
|
|
11
12
|
|
|
12
13
|
const getDefaultCustomProperty = prefix => getCustomProperty(prefix, "breakpoint");
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
});
|
|
15
|
+
if (isBrowser()) {
|
|
16
|
+
initResizeHandler();
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* @class
|
|
@@ -281,4 +281,12 @@ class Breakpoint {
|
|
|
281
281
|
msg.unshift(`Breakpoint (${ this.name }):`);
|
|
282
282
|
this._manager.log.apply(this._manager, msg);
|
|
283
283
|
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// Resize Handler to update breakpoints for all instances (Called after resize finished)
|
|
287
|
+
// - Only setup in browser environment
|
|
288
|
+
function initResizeHandler() {
|
|
289
|
+
window.addEventListener(getCoreEventName("pageResized"), () => {
|
|
290
|
+
BreakpointManager.instances.forEach(i => i.update());
|
|
291
|
+
});
|
|
284
292
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ulu/frontend",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.3",
|
|
4
4
|
"description": "A framework-agnostic frontend toolkit providing a modular, tree-shakable library of accessible components and utilities. Designed for seamless integration, it features a highly configurable SCSS system for any environment and vanilla JavaScript modules optimized for traditional websites and content management systems.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|