@metricshift/react 1.0.2 → 1.0.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/index.esm.js +36 -36
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -13,13 +13,13 @@ var We;
|
|
|
13
13
|
function xr() {
|
|
14
14
|
if (We) return J;
|
|
15
15
|
We = 1;
|
|
16
|
-
var d = $e,
|
|
16
|
+
var d = $e, _ = 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
18
|
var y, R = {}, v = null, A = null;
|
|
19
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:
|
|
22
|
+
return { $$typeof: _, 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
|
}
|
|
@@ -36,7 +36,7 @@ var H = {};
|
|
|
36
36
|
var Ye;
|
|
37
37
|
function yr() {
|
|
38
38
|
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
39
|
-
var d = $e,
|
|
39
|
+
var d = $e, _ = 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;
|
|
@@ -232,29 +232,29 @@ function yr() {
|
|
|
232
232
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
233
233
|
try {
|
|
234
234
|
Reflect.construct(l, []);
|
|
235
|
-
} catch (
|
|
236
|
-
a =
|
|
235
|
+
} catch (k) {
|
|
236
|
+
a = k;
|
|
237
237
|
}
|
|
238
238
|
Reflect.construct(e, [], l);
|
|
239
239
|
} else {
|
|
240
240
|
try {
|
|
241
241
|
l.call();
|
|
242
|
-
} catch (
|
|
243
|
-
a =
|
|
242
|
+
} catch (k) {
|
|
243
|
+
a = k;
|
|
244
244
|
}
|
|
245
245
|
e.call(l.prototype);
|
|
246
246
|
}
|
|
247
247
|
} else {
|
|
248
248
|
try {
|
|
249
249
|
throw Error();
|
|
250
|
-
} catch (
|
|
251
|
-
a =
|
|
250
|
+
} catch (k) {
|
|
251
|
+
a = k;
|
|
252
252
|
}
|
|
253
253
|
e();
|
|
254
254
|
}
|
|
255
|
-
} catch (
|
|
256
|
-
if (
|
|
257
|
-
for (var s =
|
|
255
|
+
} catch (k) {
|
|
256
|
+
if (k && a && typeof k.stack == "string") {
|
|
257
|
+
for (var s = k.stack.split(`
|
|
258
258
|
`), S = a.stack.split(`
|
|
259
259
|
`), x = s.length - 1, m = S.length - 1; x >= 1 && m >= 0 && s[x] !== S[m]; )
|
|
260
260
|
m--;
|
|
@@ -352,17 +352,17 @@ function yr() {
|
|
|
352
352
|
}
|
|
353
353
|
function Ge(e) {
|
|
354
354
|
try {
|
|
355
|
-
return
|
|
355
|
+
return ke(e), !1;
|
|
356
356
|
} catch {
|
|
357
357
|
return !0;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function ke(e) {
|
|
361
361
|
return "" + e;
|
|
362
362
|
}
|
|
363
|
-
function
|
|
363
|
+
function _e(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.", Ke(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)), ke(e);
|
|
366
366
|
}
|
|
367
367
|
var je = P.ReactCurrentOwner, Xe = {
|
|
368
368
|
key: !0,
|
|
@@ -414,7 +414,7 @@ function yr() {
|
|
|
414
414
|
var nr = function(e, r, t, a, u, c, l) {
|
|
415
415
|
var s = {
|
|
416
416
|
// This tag allows us to uniquely identify this as a React Element
|
|
417
|
-
$$typeof:
|
|
417
|
+
$$typeof: _,
|
|
418
418
|
// Built-in properties that belong on the element
|
|
419
419
|
type: e,
|
|
420
420
|
key: r,
|
|
@@ -443,7 +443,7 @@ function yr() {
|
|
|
443
443
|
function ar(e, r, t, a, u) {
|
|
444
444
|
{
|
|
445
445
|
var c, l = {}, s = null, S = null;
|
|
446
|
-
t !== void 0 && (
|
|
446
|
+
t !== void 0 && (_e(t), s = "" + t), Ze(r) && (_e(r.key), s = "" + r.key), Qe(r) && (S = r.ref, er(r, u));
|
|
447
447
|
for (c in r)
|
|
448
448
|
q.call(r, c) && !Xe.hasOwnProperty(c) && (l[c] = r[c]);
|
|
449
449
|
if (e && e.defaultProps) {
|
|
@@ -469,7 +469,7 @@ function yr() {
|
|
|
469
469
|
var ce;
|
|
470
470
|
ce = !1;
|
|
471
471
|
function fe(e) {
|
|
472
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
472
|
+
return typeof e == "object" && e !== null && e.$$typeof === _;
|
|
473
473
|
}
|
|
474
474
|
function Pe() {
|
|
475
475
|
{
|
|
@@ -578,7 +578,7 @@ Check the top-level render call using <` + t + ">.");
|
|
|
578
578
|
var S = or();
|
|
579
579
|
S ? s += S : s += Pe();
|
|
580
580
|
var x;
|
|
581
|
-
e === null ? x = "null" : le(e) ? x = "array" : e !== void 0 && e.$$typeof ===
|
|
581
|
+
e === null ? x = "null" : le(e) ? x = "array" : e !== void 0 && e.$$typeof === _ ? (x = "<" + (I(e.type) || "Unknown") + " />", s = " Did you accidentally export a JSX literal instead of a component?") : x = typeof e, h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", x, s);
|
|
582
582
|
}
|
|
583
583
|
var m = ar(e, r, t, u, c);
|
|
584
584
|
if (m == null)
|
|
@@ -597,11 +597,11 @@ Check the top-level render call using <` + t + ">.");
|
|
|
597
597
|
Ie(w, e);
|
|
598
598
|
}
|
|
599
599
|
if (q.call(r, "key")) {
|
|
600
|
-
var Y = I(e),
|
|
600
|
+
var Y = I(e), k = Object.keys(r).filter(function(vr) {
|
|
601
601
|
return vr !== "key";
|
|
602
|
-
}), de =
|
|
602
|
+
}), de = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
603
603
|
if (!De[Y + de]) {
|
|
604
|
-
var pr =
|
|
604
|
+
var pr = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
|
|
605
605
|
h(`A props object containing a "key" prop is being spread into JSX:
|
|
606
606
|
let props = %s;
|
|
607
607
|
<%s {...props} />
|
|
@@ -627,7 +627,7 @@ process.env.NODE_ENV === "production" ? ve.exports = xr() : ve.exports = yr();
|
|
|
627
627
|
var n = ve.exports;
|
|
628
628
|
const hr = ({
|
|
629
629
|
isOpen: d,
|
|
630
|
-
onClose:
|
|
630
|
+
onClose: _,
|
|
631
631
|
onSubmit: O
|
|
632
632
|
}) => {
|
|
633
633
|
const [f, p] = $({
|
|
@@ -652,7 +652,7 @@ const hr = ({
|
|
|
652
652
|
}, [d, o]);
|
|
653
653
|
const C = () => {
|
|
654
654
|
v(!1), setTimeout(() => {
|
|
655
|
-
|
|
655
|
+
_(), setTimeout(() => {
|
|
656
656
|
p({
|
|
657
657
|
text: "",
|
|
658
658
|
rating: void 0,
|
|
@@ -1047,7 +1047,7 @@ const hr = ({
|
|
|
1047
1047
|
}
|
|
1048
1048
|
);
|
|
1049
1049
|
};
|
|
1050
|
-
async function mr(d,
|
|
1050
|
+
async function mr(d, _, O) {
|
|
1051
1051
|
const f = {
|
|
1052
1052
|
"Content-Type": "application/json"
|
|
1053
1053
|
};
|
|
@@ -1056,7 +1056,7 @@ async function mr(d, k, O) {
|
|
|
1056
1056
|
const p = await fetch(`${d}/api/feedback`, {
|
|
1057
1057
|
method: "POST",
|
|
1058
1058
|
headers: f,
|
|
1059
|
-
body: JSON.stringify(
|
|
1059
|
+
body: JSON.stringify(_)
|
|
1060
1060
|
});
|
|
1061
1061
|
if (!p.ok) {
|
|
1062
1062
|
const o = await p.json().catch(() => ({}));
|
|
@@ -1069,8 +1069,8 @@ async function mr(d, k, O) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
const Rr = ({
|
|
1071
1071
|
projectId: d,
|
|
1072
|
-
apiKey:
|
|
1073
|
-
apiUrl: O = "
|
|
1072
|
+
apiKey: _,
|
|
1073
|
+
apiUrl: O = "https://metricshift-sdk-be-production.up.railway.app",
|
|
1074
1074
|
buttonText: f = "Feedback",
|
|
1075
1075
|
showIcon: p = !0,
|
|
1076
1076
|
position: o = "bottom-right",
|
|
@@ -1103,7 +1103,7 @@ const Rr = ({
|
|
|
1103
1103
|
user_email: g.userEmail,
|
|
1104
1104
|
user_name: g.userName,
|
|
1105
1105
|
feedback_type: g.feedbackType
|
|
1106
|
-
}, W = await mr(O, M,
|
|
1106
|
+
}, W = await mr(O, M, _);
|
|
1107
1107
|
B && (W != null && W.id) && B(W.id);
|
|
1108
1108
|
} catch (M) {
|
|
1109
1109
|
throw P && M instanceof Error && P(M), M;
|
|
@@ -1199,12 +1199,12 @@ const Rr = ({
|
|
|
1199
1199
|
if (!d)
|
|
1200
1200
|
throw new Error("useMetricShift must be used within MetricShiftProvider");
|
|
1201
1201
|
return d;
|
|
1202
|
-
},
|
|
1202
|
+
}, kr = ({
|
|
1203
1203
|
config: d,
|
|
1204
|
-
children:
|
|
1205
|
-
}) => /* @__PURE__ */ n.jsx(Be.Provider, { value: d, children:
|
|
1204
|
+
children: _
|
|
1205
|
+
}) => /* @__PURE__ */ n.jsx(Be.Provider, { value: d, children: _ });
|
|
1206
1206
|
let pe = null;
|
|
1207
|
-
const
|
|
1207
|
+
const _r = {
|
|
1208
1208
|
/**
|
|
1209
1209
|
* Initialize the MetricShift SDK
|
|
1210
1210
|
* @param config - SDK configuration
|
|
@@ -1226,8 +1226,8 @@ const kr = {
|
|
|
1226
1226
|
export {
|
|
1227
1227
|
Rr as FeedbackButton,
|
|
1228
1228
|
hr as FeedbackModal,
|
|
1229
|
-
|
|
1230
|
-
|
|
1229
|
+
_r as MetricShift,
|
|
1230
|
+
kr as MetricShiftProvider,
|
|
1231
1231
|
mr as submitFeedback,
|
|
1232
1232
|
Sr as useMetricShift
|
|
1233
1233
|
};
|