@metricshift/react 1.0.1 → 1.0.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/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import $e, { useState as $, useRef as ze, useEffect as Me, createContext as br, useContext as gr } from "react";
1
+ import $e, { useState as $, useRef as Ae, useEffect as Me, createContext as br, useContext as gr } from "react";
2
2
  var ve = { exports: {} }, J = {};
3
3
  /**
4
4
  * @license React
@@ -15,15 +15,15 @@ function xr() {
15
15
  We = 1;
16
16
  var d = $e, k = Symbol.for("react.element"), O = Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, p = d.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, o = { key: !0, ref: !0, __self: !0, __source: !0 };
17
17
  function F(E, b, T) {
18
- var y, R = {}, v = null, z = null;
19
- T !== void 0 && (v = "" + T), b.key !== void 0 && (v = "" + b.key), b.ref !== void 0 && (z = b.ref);
18
+ var y, R = {}, v = null, A = null;
19
+ T !== void 0 && (v = "" + T), b.key !== void 0 && (v = "" + b.key), b.ref !== void 0 && (A = b.ref);
20
20
  for (y in b) f.call(b, y) && !o.hasOwnProperty(y) && (R[y] = b[y]);
21
21
  if (E && E.defaultProps) for (y in b = E.defaultProps, b) R[y] === void 0 && (R[y] = b[y]);
22
- return { $$typeof: k, type: E, key: v, ref: z, props: R, _owner: p.current };
22
+ return { $$typeof: k, type: E, key: v, ref: A, props: R, _owner: p.current };
23
23
  }
24
24
  return J.Fragment = O, J.jsx = F, J.jsxs = F, J;
25
25
  }
26
- var K = {};
26
+ var H = {};
27
27
  /**
28
28
  * @license React
29
29
  * react-jsx-runtime.development.js
@@ -36,7 +36,7 @@ var K = {};
36
36
  var Ye;
37
37
  function yr() {
38
38
  return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
39
- var d = $e, k = Symbol.for("react.element"), O = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), F = Symbol.for("react.provider"), E = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), z = Symbol.for("react.offscreen"), D = Symbol.iterator, C = "@@iterator";
39
+ var d = $e, k = Symbol.for("react.element"), O = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), p = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), F = Symbol.for("react.provider"), E = Symbol.for("react.context"), b = Symbol.for("react.forward_ref"), T = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), R = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), D = Symbol.iterator, C = "@@iterator";
40
40
  function B(e) {
41
41
  if (e === null || typeof e != "object")
42
42
  return null;
@@ -61,10 +61,10 @@ function yr() {
61
61
  c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
62
62
  }
63
63
  }
64
- var i = !1, j = !1, H = !1, re = !1, te = !1, G;
64
+ var i = !1, j = !1, K = !1, re = !1, te = !1, G;
65
65
  G = Symbol.for("react.module.reference");
66
66
  function ne(e) {
67
- return !!(typeof e == "string" || typeof e == "function" || e === f || e === o || te || e === p || e === T || e === y || re || e === z || i || j || H || typeof e == "object" && e !== null && (e.$$typeof === v || e.$$typeof === R || e.$$typeof === F || e.$$typeof === E || e.$$typeof === b || // This needs to include all possible module reference object
67
+ return !!(typeof e == "string" || typeof e == "function" || e === f || e === o || te || e === p || e === T || e === y || re || e === A || i || j || K || typeof e == "object" && e !== null && (e.$$typeof === v || e.$$typeof === R || e.$$typeof === F || e.$$typeof === E || e.$$typeof === b || // This needs to include all possible module reference object
68
68
  // types supported by any Flight configuration anywhere since
69
69
  // we don't know which Flight build this will end up being used
70
70
  // with.
@@ -125,7 +125,7 @@ function yr() {
125
125
  }
126
126
  return null;
127
127
  }
128
- var A = Object.assign, g = 0, M, W, be, ge, xe, ye, he;
128
+ var z = Object.assign, g = 0, M, W, be, ge, xe, ye, he;
129
129
  function me() {
130
130
  }
131
131
  me.__reactDisabledLog = !0;
@@ -161,25 +161,25 @@ function yr() {
161
161
  writable: !0
162
162
  };
163
163
  Object.defineProperties(console, {
164
- log: A({}, e, {
164
+ log: z({}, e, {
165
165
  value: M
166
166
  }),
167
- info: A({}, e, {
167
+ info: z({}, e, {
168
168
  value: W
169
169
  }),
170
- warn: A({}, e, {
170
+ warn: z({}, e, {
171
171
  value: be
172
172
  }),
173
- error: A({}, e, {
173
+ error: z({}, e, {
174
174
  value: ge
175
175
  }),
176
- group: A({}, e, {
176
+ group: z({}, e, {
177
177
  value: xe
178
178
  }),
179
- groupCollapsed: A({}, e, {
179
+ groupCollapsed: z({}, e, {
180
180
  value: ye
181
181
  }),
182
- groupEnd: A({}, e, {
182
+ groupEnd: z({}, e, {
183
183
  value: he
184
184
  })
185
185
  });
@@ -340,11 +340,11 @@ function yr() {
340
340
  }
341
341
  }
342
342
  }
343
- var Ke = Array.isArray;
343
+ var He = Array.isArray;
344
344
  function le(e) {
345
- return Ke(e);
345
+ return He(e);
346
346
  }
347
- function He(e) {
347
+ function Ke(e) {
348
348
  {
349
349
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
350
350
  return t;
@@ -362,7 +362,7 @@ function yr() {
362
362
  }
363
363
  function ke(e) {
364
364
  if (Ge(e))
365
- return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), _e(e);
365
+ return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ke(e)), _e(e);
366
366
  }
367
367
  var je = P.ReactCurrentOwner, Xe = {
368
368
  key: !0,
@@ -569,7 +569,7 @@ Check the top-level render call using <` + t + ">.");
569
569
  }
570
570
  }
571
571
  var De = {};
572
- function Ae(e, r, t, a, u, c) {
572
+ function ze(e, r, t, a, u, c) {
573
573
  {
574
574
  var l = ne(e);
575
575
  if (!l) {
@@ -614,14 +614,14 @@ React keys must be passed directly to JSX without using spread:
614
614
  }
615
615
  }
616
616
  function ur(e, r, t) {
617
- return Ae(e, r, t, !0);
617
+ return ze(e, r, t, !0);
618
618
  }
619
619
  function cr(e, r, t) {
620
- return Ae(e, r, t, !1);
620
+ return ze(e, r, t, !1);
621
621
  }
622
622
  var fr = cr, dr = ur;
623
- K.Fragment = f, K.jsx = fr, K.jsxs = dr;
624
- }()), K;
623
+ H.Fragment = f, H.jsx = fr, H.jsxs = dr;
624
+ }()), H;
625
625
  }
626
626
  process.env.NODE_ENV === "production" ? ve.exports = xr() : ve.exports = yr();
627
627
  var n = ve.exports;
@@ -636,7 +636,7 @@ const hr = ({
636
636
  feedbackType: "general",
637
637
  userEmail: "",
638
638
  userName: ""
639
- }), [o, F] = $(!1), [E, b] = $("idle"), [T, y] = $(""), [R, v] = $(!1), z = ze(null), D = ze(null);
639
+ }), [o, F] = $(!1), [E, b] = $("idle"), [T, y] = $(""), [R, v] = $(!1), A = Ae(null), D = Ae(null);
640
640
  Me(() => (d ? (v(!0), document.body.style.overflow = "hidden", setTimeout(() => {
641
641
  var i;
642
642
  (i = D.current) == null || i.focus();
@@ -719,7 +719,7 @@ const hr = ({
719
719
  children: /* @__PURE__ */ n.jsxs(
720
720
  "div",
721
721
  {
722
- ref: z,
722
+ ref: A,
723
723
  style: L,
724
724
  onClick: (i) => i.stopPropagation(),
725
725
  children: [
@@ -1051,7 +1051,7 @@ async function mr(d, k, O) {
1051
1051
  const f = {
1052
1052
  "Content-Type": "application/json"
1053
1053
  };
1054
- O && (f["X-API-Key"] = O);
1054
+ O && (f.Authorization = `Bearer ${O}`);
1055
1055
  try {
1056
1056
  const p = await fetch(`${d}/api/feedback`, {
1057
1057
  method: "POST",
@@ -1081,13 +1081,13 @@ const Rr = ({
1081
1081
  customStyles: y,
1082
1082
  customClassName: R = "",
1083
1083
  disabled: v = !1,
1084
- autoOpen: z = !1,
1084
+ autoOpen: A = !1,
1085
1085
  onOpen: D,
1086
1086
  onClose: C,
1087
1087
  onSuccess: B,
1088
1088
  onError: P
1089
1089
  }) => {
1090
- const [h, L] = $(z), [i, j] = $(!1), H = () => {
1090
+ const [h, L] = $(A), [i, j] = $(!1), K = () => {
1091
1091
  v || (L(!0), D == null || D());
1092
1092
  }, re = () => {
1093
1093
  L(!1), C == null || C();
@@ -1155,7 +1155,7 @@ const Rr = ({
1155
1155
  transform: i && !v ? "translateY(-2px)" : "translateY(0)",
1156
1156
  outline: "none",
1157
1157
  ...y
1158
- }, A = {
1158
+ }, z = {
1159
1159
  fontSize: V.iconSize,
1160
1160
  lineHeight: 1,
1161
1161
  display: "flex",
@@ -1165,7 +1165,7 @@ const Rr = ({
1165
1165
  /* @__PURE__ */ n.jsxs(
1166
1166
  "button",
1167
1167
  {
1168
- onClick: H,
1168
+ onClick: K,
1169
1169
  onMouseEnter: () => !v && j(!0),
1170
1170
  onMouseLeave: () => !v && j(!1),
1171
1171
  disabled: v,
@@ -1177,10 +1177,10 @@ const Rr = ({
1177
1177
  role: "button",
1178
1178
  tabIndex: v ? -1 : 0,
1179
1179
  onKeyDown: (g) => {
1180
- !v && (g.key === "Enter" || g.key === " ") && (g.preventDefault(), H());
1180
+ !v && (g.key === "Enter" || g.key === " ") && (g.preventDefault(), K());
1181
1181
  },
1182
1182
  children: [
1183
- p && /* @__PURE__ */ n.jsx("span", { style: A, "aria-hidden": "true", children: "💬" }),
1183
+ p && /* @__PURE__ */ n.jsx("span", { style: z, "aria-hidden": "true", children: "💬" }),
1184
1184
  /* @__PURE__ */ n.jsx("span", { children: f })
1185
1185
  ]
1186
1186
  }