@mundogamernetwork/shared-ui 1.1.33 → 1.1.35

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.
@@ -18,7 +18,7 @@ let timer: ReturnType<typeof setInterval> | null = null;
18
18
  const { data: banners, pending } = await useAsyncData(
19
19
  `mg-campaign-banners-${props.platform}-${props.page}-${locale.value}`,
20
20
  () => fetchCampaignBanners(props.platform, props.page, locale.value),
21
- { default: () => [], lazy: true },
21
+ { default: () => [], server: false, lazy: true },
22
22
  );
23
23
 
24
24
  const hasBanners = computed(() => (banners.value?.length ?? 0) > 0);
@@ -40,7 +40,7 @@ const startCarousel = () => {
40
40
 
41
41
  const handleClick = () => {
42
42
  if (!currentBanner.value) return;
43
- clickCampaignBanner(currentBanner.value.id);
43
+ clickCampaignBanner(currentBanner.value.id, props.platform, props.page);
44
44
  window.open(currentBanner.value.link, "_blank");
45
45
  };
46
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mundogamernetwork/shared-ui",
3
- "version": "1.1.33",
3
+ "version": "1.1.35",
4
4
  "description": "Mundo Gamer Network - Shared UI Layer (Nuxt 3)",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",
@@ -818,4 +818,10 @@ function onDownload() {
818
818
  @media print {
819
819
  .no-print { display: none !important; }
820
820
  }
821
+
822
+ // ── Scroll unlock (body has overflow-y: hidden globally in some frontends) ───
823
+ :global(body):has(.pk-page) {
824
+ overflow-y: auto !important;
825
+ max-height: none !important;
826
+ }
821
827
  </style>
@@ -1411,6 +1411,12 @@ useHead(() => ({
1411
1411
  }
1412
1412
  }
1413
1413
 
1414
+ // ── Scroll unlock (body has overflow-y: hidden globally in some frontends) ───
1415
+ :global(body):has(.pk-page) {
1416
+ overflow-y: auto !important;
1417
+ max-height: none !important;
1418
+ }
1419
+
1414
1420
  // ── Trailer modal ─────────────────────────────────────────────────
1415
1421
  .pk-modal {
1416
1422
  position: fixed;
@@ -1,6 +1,5 @@
1
1
  export default defineNuxtPlugin({
2
2
  name: "shared-ui-auth",
3
- enforce: "pre",
4
3
  parallel: true,
5
4
  async setup() {
6
5
  try {
@@ -77,11 +77,9 @@ export default defineNuxtPlugin({
77
77
  });
78
78
 
79
79
  window.Echo.connector.pusher.connection.bind("connected", () => {
80
- console.log("[WebSocket] Connected", new Date().toISOString());
81
80
  });
82
81
 
83
82
  window.Echo.connector.pusher.connection.bind("disconnected", () => {
84
- console.log("[WebSocket] Disconnected", new Date().toISOString());
85
83
  });
86
84
 
87
85
  window.Echo.connector.pusher.connection.bind("error", (error: any) => {
@@ -94,13 +92,11 @@ export default defineNuxtPlugin({
94
92
 
95
93
  window.Echo.connector.pusher.connection.bind("state_change", (states: any) => {
96
94
  const { previous, current } = states;
97
- console.log(`[WebSocket] State changed: ${previous} -> ${current}`);
98
95
 
99
96
  if (current === "disconnected" || current === "failed" || current === "unavailable") {
100
97
  // Stop reconnecting after max attempts to avoid infinite loop
101
98
  // (e.g. when user is not authenticated)
102
99
  if (reconnectAttempts >= MAX_RECONNECT_ATTEMPTS) {
103
- console.log("[WebSocket] Max reconnect attempts reached, stopping.");
104
100
  if (reconnectTimer) {
105
101
  clearTimeout(reconnectTimer);
106
102
  reconnectTimer = null;
@@ -110,7 +106,6 @@ export default defineNuxtPlugin({
110
106
 
111
107
  reconnectAttempts++;
112
108
  const delay = Math.min(1000 * Math.pow(2, reconnectAttempts - 1), 30000);
113
- console.log(`[WebSocket] Reconnecting in ${delay / 1000}s (attempt ${reconnectAttempts}/${MAX_RECONNECT_ATTEMPTS})...`);
114
109
 
115
110
  if (reconnectTimer) clearTimeout(reconnectTimer);
116
111
  reconnectTimer = window.setTimeout(() => {
@@ -34,6 +34,11 @@ export const fetchCampaignBanners = (
34
34
  .then((r) => r.data?.data ?? [])
35
35
  .catch((): CampaignBanner[] => []);
36
36
 
37
- export const clickCampaignBanner = (id: number): void => {
38
- axios.put(`${getNetworkBaseUrl()}/public/campaigns-banners/${id}/click`).catch(() => {});
37
+ export const clickCampaignBanner = (id: number, platform?: string, page?: string): void => {
38
+ axios
39
+ .put(`${getNetworkBaseUrl()}/public/campaigns-banners/${id}/click`, null, {
40
+ params: { ...(platform ? { platform } : {}), ...(page ? { page } : {}) },
41
+ withCredentials: false,
42
+ })
43
+ .catch(() => {});
39
44
  };
@@ -85,6 +85,14 @@ export function getHttpService(): AxiosInstance {
85
85
  config.headers.set("X-Timezone", Intl.DateTimeFormat().resolvedOptions().timeZone);
86
86
  }
87
87
 
88
+ // Live Analytics: send current page route and platform ID so the
89
+ // GeoAnalyticsMiddleware on each service-api can record session activity.
90
+ if (typeof window !== "undefined") {
91
+ config.headers.set("X-Page-Route", window.location.pathname);
92
+ const systemId = import.meta.env.VITE_SYSTEM_ID;
93
+ if (systemId) config.headers.set("X-System-Id", String(systemId));
94
+ }
95
+
88
96
  return config;
89
97
  });
90
98