welcome-ui 7.1.0 → 7.1.1

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.
@@ -6,3 +6,4 @@ export * from './throttle';
6
6
  export * from './use-copy-text';
7
7
  export * from './use-fork-ref';
8
8
  export * from './use-isomorphic-layout-effect';
9
+ export * from './use-viewport';
package/dist/utils.mjs CHANGED
@@ -6,8 +6,9 @@ import { o as N } from "./overflow-ellipsis-DGV5Kgt-.mjs";
6
6
  import { t as P } from "./throttle-BDBzFeFj.mjs";
7
7
  import { useState as d, useCallback as m } from "react";
8
8
  import { g as y } from "./_commonjsHelpers-CXJ7dpIk.mjs";
9
- import { s as _, u as j } from "./use-fork-ref-CUZErtAC.mjs";
9
+ import { s as B, u as _ } from "./use-fork-ref-CUZErtAC.mjs";
10
10
  import { u as G } from "./use-isomorphic-layout-effect-Izr-e2pi.mjs";
11
+ import { u as O } from "./use-viewport-m3glsbna.mjs";
11
12
  var g = function() {
12
13
  var e = document.getSelection();
13
14
  if (!e.rangeCount)
@@ -25,8 +26,8 @@ var g = function() {
25
26
  break;
26
27
  }
27
28
  return e.removeAllRanges(), function() {
28
- e.type === "Caret" && e.removeAllRanges(), e.rangeCount || r.forEach(function(s) {
29
- e.addRange(s);
29
+ e.type === "Caret" && e.removeAllRanges(), e.rangeCount || r.forEach(function(c) {
30
+ e.addRange(c);
30
31
  }), t && t.focus();
31
32
  };
32
33
  }, v = g, f = {
@@ -39,10 +40,10 @@ function C(e) {
39
40
  return e.replace(/#{\s*key\s*}/g, t);
40
41
  }
41
42
  function x(e, t) {
42
- var r, o, s, n, c, a, i = !1;
43
+ var r, o, c, n, s, a, i = !1;
43
44
  t || (t = {}), r = t.debug || !1;
44
45
  try {
45
- s = v(), n = document.createRange(), c = document.getSelection(), a = document.createElement("span"), a.textContent = e, a.ariaHidden = "true", a.style.all = "unset", a.style.position = "fixed", a.style.top = 0, a.style.clip = "rect(0, 0, 0, 0)", a.style.whiteSpace = "pre", a.style.webkitUserSelect = "text", a.style.MozUserSelect = "text", a.style.msUserSelect = "text", a.style.userSelect = "text", a.addEventListener("copy", function(l) {
46
+ c = v(), n = document.createRange(), s = document.getSelection(), a = document.createElement("span"), a.textContent = e, a.ariaHidden = "true", a.style.all = "unset", a.style.position = "fixed", a.style.top = 0, a.style.clip = "rect(0, 0, 0, 0)", a.style.whiteSpace = "pre", a.style.webkitUserSelect = "text", a.style.MozUserSelect = "text", a.style.msUserSelect = "text", a.style.userSelect = "text", a.addEventListener("copy", function(l) {
46
47
  if (l.stopPropagation(), t.format)
47
48
  if (l.preventDefault(), typeof l.clipboardData > "u") {
48
49
  r && console.warn("unable to use e.clipboardData"), r && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
@@ -51,7 +52,7 @@ function x(e, t) {
51
52
  } else
52
53
  l.clipboardData.clearData(), l.clipboardData.setData(t.format, e);
53
54
  t.onCopy && (l.preventDefault(), t.onCopy(l.clipboardData));
54
- }), document.body.appendChild(a), n.selectNodeContents(a), c.addRange(n);
55
+ }), document.body.appendChild(a), n.selectNodeContents(a), s.addRange(n);
55
56
  var p = document.execCommand("copy");
56
57
  if (!p)
57
58
  throw new Error("copy command was unsuccessful");
@@ -64,19 +65,19 @@ function x(e, t) {
64
65
  r && console.error("unable to copy using clipboardData: ", u), r && console.error("falling back to prompt"), o = C("message" in t ? t.message : b), window.prompt(o, e);
65
66
  }
66
67
  } finally {
67
- c && (typeof c.removeRange == "function" ? c.removeRange(n) : c.removeAllRanges()), a && document.body.removeChild(a), s();
68
+ s && (typeof s.removeRange == "function" ? s.removeRange(n) : s.removeAllRanges()), a && document.body.removeChild(a), c();
68
69
  }
69
70
  return i;
70
71
  }
71
72
  var w = x;
72
73
  const D = /* @__PURE__ */ y(w);
73
- function R(e, t) {
74
+ function S(e, t) {
74
75
  const [r, o] = d();
75
76
  return [m(() => {
76
77
  let n;
77
78
  typeof e == "number" || typeof e == "string" ? n = e.toString() : e.current instanceof HTMLInputElement ? n = e.current.value : e.current instanceof HTMLElement && (n = e.current.textContent);
78
- const c = D(n);
79
- o(c), t && setTimeout(o, t);
79
+ const s = D(n);
80
+ o(s), t && setTimeout(o, t);
80
81
  }, [e, t]), r];
81
82
  }
82
83
  export {
@@ -85,9 +86,10 @@ export {
85
86
  k as formatBytes,
86
87
  A as hexToRGBA,
87
88
  N as overflowEllipsis,
88
- _ as setRef,
89
+ B as setRef,
89
90
  P as throttle,
90
- R as useCopyText,
91
- j as useForkRef,
92
- G as useIsomorphicLayoutEffect
91
+ S as useCopyText,
92
+ _ as useForkRef,
93
+ G as useIsomorphicLayoutEffect,
94
+ O as useViewportSize
93
95
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "welcome-ui",
3
- "version": "7.1.0",
3
+ "version": "7.1.1",
4
4
  "description": "Customizable design system with react • styled-components • styled-system and ariakit.",
5
5
  "files": [
6
6
  "dist"