@ulu/frontend-vue 0.5.11 → 0.5.12

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 +1 @@
1
- {"version":3,"file":"useWindowResize.d.ts","sourceRoot":"","sources":["../../lib/composables/useWindowResize.js"],"names":[],"mappings":"AAiDA;;;;;;;;;;;;;GAaG;AACH,mCATa;IACR,QAAQ,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,aAAa,EAAE,CAAC,QAAQ,UAAU,aAAa,CAAC;IAChD,WAAW,EAAE,CAAC,QAAQ,UAAU,aAAa,CAAA;CAC9C,CAeH"}
1
+ {"version":3,"file":"useWindowResize.d.ts","sourceRoot":"","sources":["../../lib/composables/useWindowResize.js"],"names":[],"mappings":"AAkDA;;;;;;;;;;;;;GAaG;AACH,mCATa;IACR,QAAQ,EAAE,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACrC,aAAa,EAAE,CAAC,QAAQ,UAAU,aAAa,CAAC;IAChD,WAAW,EAAE,CAAC,QAAQ,UAAU,aAAa,CAAA;CAC9C,CAeH"}
@@ -1,23 +1,24 @@
1
- import { ref as u } from "vue";
2
- import { debounce as f } from "@ulu/utils/performance.js";
3
- const t = u(!1), n = {
1
+ import { ref as f } from "vue";
2
+ import { debounce as u } from "@ulu/utils/performance.js";
3
+ import { isBrowser as c } from "@ulu/utils/browser/dom.js";
4
+ const t = f(!1), n = {
4
5
  start: [],
5
6
  end: []
6
7
  };
7
8
  function r() {
8
9
  window.removeEventListener("resize", r), t.value = !0, n.start.forEach((e) => e());
9
10
  }
10
- function c() {
11
+ function a() {
11
12
  t.value = !1, n.end.forEach((e) => e()), window.addEventListener("resize", r);
12
13
  }
13
- window.addEventListener("resize", r), window.addEventListener("resize", f(c, 300));
14
+ c() && (window.addEventListener("resize", r), window.addEventListener("resize", u(a, 300)));
14
15
  function s(e, i) {
15
16
  return e.push(i), () => {
16
17
  const o = e.findIndex((d) => d === i);
17
18
  o > -1 && e.splice(o);
18
19
  };
19
20
  }
20
- function z() {
21
+ function m() {
21
22
  return {
22
23
  resizing: t,
23
24
  onResizeStart(e) {
@@ -29,5 +30,5 @@ function z() {
29
30
  };
30
31
  }
31
32
  export {
32
- z as useWindowResize
33
+ m as useWindowResize
33
34
  };
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { ref } from "vue";
7
7
  import { debounce } from "@ulu/utils/performance.js";
8
+ import { isBrowser } from "@ulu/utils/browser/dom.js";
8
9
  const resizing = ref(false);
9
10
  const callbacks = {
10
11
  start: [],
@@ -26,7 +27,7 @@ function onEnd() {
26
27
  }
27
28
 
28
29
  // Only allow in browser contexts
29
- if (!import.meta.env.SSR) {
30
+ if (isBrowser()) {
30
31
  window.addEventListener("resize", onStart);
31
32
  window.addEventListener("resize", debounce(onEnd, 300));
32
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ulu/frontend-vue",
3
- "version": "0.5.11",
3
+ "version": "0.5.12",
4
4
  "description": "A modular, tree-shakeable Vue 3 component library for the Ulu Frontend theming system, plus general utilities for Vue development",
5
5
  "type": "module",
6
6
  "files": [
@@ -65,7 +65,7 @@
65
65
  "@fortawesome/vue-fontawesome": "^3.0.8",
66
66
  "@headlessui/vue": "^1.7.23",
67
67
  "@portabletext/vue": "^1.0.14",
68
- "@ulu/frontend": "^0.4.6",
68
+ "@ulu/frontend": "^0.4.9",
69
69
  "@ulu/utils": "^0.0.34",
70
70
  "@unhead/vue": "^2.0.11",
71
71
  "fuse.js": "^6.6.2",