@mx-cartographer/experiences 7.4.6-alpha.mm0 → 7.4.6-alpha.mm2

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.
@@ -24,7 +24,7 @@ import { f as I } from "../NumberFormatting-DjTD0t3W.mjs";
24
24
  import { D as c1 } from "../Drawer-BEtCk82g.mjs";
25
25
  import { A as x, W as s1 } from "../WidgetContainer-DR_iRKNU.mjs";
26
26
  import { C as a1 } from "../ConnectionsDrawer-vSEOHrUC.mjs";
27
- import { u as r1 } from "../useWidgetLoadTimer-C4tYP28Y.mjs";
27
+ import { u as r1 } from "../useWidgetLoadTimer-CY26D0n1.mjs";
28
28
  import { u as Y } from "../useScreenSize-B6JyS_Lj.mjs";
29
29
  import { L as w } from "../Loader-DUaFpDGv.mjs";
30
30
  import L1 from "@mui/material/ListItem";
@@ -53,7 +53,7 @@ import { G as mo, C as _o, D as fo, W as yo, e as So, b as bo, i as wo, v as xo,
53
53
  import { u as Qo } from "../useAccountDisplayName-BUtYhbqe.mjs";
54
54
  import { u as Xo } from "../useInsightsEnabled-v_GGt72p.mjs";
55
55
  import { u as Ko } from "../useScreenSize-B6JyS_Lj.mjs";
56
- import { u as Zo } from "../useWidgetLoadTimer-C4tYP28Y.mjs";
56
+ import { u as Zo } from "../useWidgetLoadTimer-CY26D0n1.mjs";
57
57
  import { makeAutoObservable as f, runInAction as p, reaction as _t, autorun as ft } from "mobx";
58
58
  import { a as yt } from "../AccountStore-kxFbaz-K.mjs";
59
59
  import St from "posthog-js";
@@ -16,7 +16,7 @@ import H from "@mui/material/Tooltip";
16
16
  import R from "@mui/material/useMediaQuery";
17
17
  import { k as j, l as Q } from "../ConnectDrawer-g2IXvoSS.mjs";
18
18
  import { u as z } from "../useScreenSize-B6JyS_Lj.mjs";
19
- import { u as E } from "../useWidgetLoadTimer-C4tYP28Y.mjs";
19
+ import { u as E } from "../useWidgetLoadTimer-CY26D0n1.mjs";
20
20
  const N = _(() => {
21
21
  const e = D(), {
22
22
  appDataStore: { banner: r, loadBanner: i, user: u }
@@ -0,0 +1,23 @@
1
+ import { useRef as r, useEffect as c } from "react";
2
+ import { u as l } from "./hooks-DtrRa6Lb.mjs";
3
+ const d = ({ widgetName: n, isLoaded: o = !0 }) => {
4
+ const { onEvent: u } = l(), e = r(null), a = r(!1), s = r(!1);
5
+ if (console.log("useWidgetLoadTimer called for", n), e.current === null) {
6
+ e.current = Date.now();
7
+ const t = performance.getEntriesByType("navigation")[0];
8
+ s.current = t?.type === "navigate" || t?.type === "reload";
9
+ }
10
+ c(() => {
11
+ if (o && !a.current && e.current !== null) {
12
+ const t = Date.now() - e.current;
13
+ u("WidgetLoad", {
14
+ widgetName: n,
15
+ loadTimeMs: t,
16
+ loadType: s.current ? "initial" : "secondary"
17
+ }), a.current = !0, e.current = null;
18
+ }
19
+ }, [o, n]);
20
+ };
21
+ export {
22
+ d as u
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mx-cartographer/experiences",
3
- "version": "7.4.6-alpha.mm0",
3
+ "version": "7.4.6-alpha.mm2",
4
4
  "description": "Library containing experience widgets",
5
5
  "author": "MX",
6
6
  "license": "MIT",
@@ -1,28 +0,0 @@
1
- import { useRef as r, useEffect as s } from "react";
2
- import { u } from "./hooks-DtrRa6Lb.mjs";
3
- const y = ({ widgetName: t, isLoaded: a = !0 }) => {
4
- const { onEvent: c } = u(), e = r(null), l = r(!1), o = r(null);
5
- console.log("useWidgetLoadTimer:", t), s(() => {
6
- if (e.current === null) {
7
- e.current = Date.now();
8
- const n = performance.getEntriesByType("navigation")[0];
9
- console.log("Navigation Entry:", n), o.current = n?.type === "navigate" || n?.type === "reload";
10
- }
11
- }, []), s(() => {
12
- if (a && !l.current && e.current !== null) {
13
- const n = Date.now() - e.current;
14
- console.log("WidgetLoad", {
15
- widgetName: t,
16
- loadTimeMs: n,
17
- loadType: o.current ? "initial" : "secondary"
18
- }), c("WidgetLoad", {
19
- widgetName: t,
20
- loadTimeMs: n,
21
- loadType: o.current ? "initial" : "secondary"
22
- }), l.current = !0, e.current = null;
23
- }
24
- }, [a, t, c]);
25
- };
26
- export {
27
- y as u
28
- };