@mundogamernetwork/shared-ui 1.1.35 → 1.1.37
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/assets/kit/kit-base.css +661 -0
- package/assets/kit/kit-theme.css +57 -8
- package/components/ui/MgAppInstallBanner.vue +1 -14
- package/components/ui/MgCampaignBannerCarousel.vue +6 -23
- package/nuxt.config.ts +6 -1
- package/package.json +1 -1
- package/pages/presskit/[slug].vue +214 -1389
- package/plugins/auth.client.ts +1 -1
- package/plugins/echo.client.ts +5 -0
- package/services/campaignBannersService.ts +2 -7
- package/services/httpService.ts +12 -11
- package/stores/appInstallBanner.ts +7 -23
|
@@ -1,23 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
// Optional props — allow the consuming layout to pass config directly
|
|
3
|
-
// instead of relying on the store guessing the right runtimeConfig key.
|
|
4
|
-
const props = withDefaults(defineProps<{
|
|
5
|
-
apiBaseUrl?: string;
|
|
6
|
-
platformId?: number | string;
|
|
7
|
-
}>(), {
|
|
8
|
-
apiBaseUrl: undefined,
|
|
9
|
-
platformId: undefined,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
2
|
const colorMode = useColorMode();
|
|
13
3
|
const store = useAppInstallBannerStore();
|
|
14
4
|
const locale = useNuxtApp().$i18n.locale;
|
|
15
5
|
|
|
16
6
|
onMounted(async () => {
|
|
17
|
-
await store.fetchBanner(
|
|
18
|
-
props.apiBaseUrl,
|
|
19
|
-
props.platformId !== undefined ? Number(props.platformId) : undefined,
|
|
20
|
-
);
|
|
7
|
+
await store.fetchBanner();
|
|
21
8
|
});
|
|
22
9
|
|
|
23
10
|
const banner = computed(() => store.banner);
|
|
@@ -15,10 +15,10 @@ const isMobile = ref(false);
|
|
|
15
15
|
const currentIndex = ref(0);
|
|
16
16
|
let timer: ReturnType<typeof setInterval> | null = null;
|
|
17
17
|
|
|
18
|
-
const { data: banners
|
|
18
|
+
const { data: banners } = await useAsyncData(
|
|
19
19
|
`mg-campaign-banners-${props.platform}-${props.page}-${locale.value}`,
|
|
20
20
|
() => fetchCampaignBanners(props.platform, props.page, locale.value),
|
|
21
|
-
{ default: () => [],
|
|
21
|
+
{ default: () => [], lazy: true, server: false },
|
|
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);
|
|
44
44
|
window.open(currentBanner.value.link, "_blank");
|
|
45
45
|
};
|
|
46
46
|
|
|
@@ -67,9 +67,7 @@ onUnmounted(() => {
|
|
|
67
67
|
</script>
|
|
68
68
|
|
|
69
69
|
<template>
|
|
70
|
-
<div v-if="
|
|
71
|
-
|
|
72
|
-
<div v-else-if="hasBanners" class="mg-campaign-banner-carousel mb-4">
|
|
70
|
+
<div v-if="hasBanners" class="mg-campaign-banner-carousel mb-4">
|
|
73
71
|
<div
|
|
74
72
|
class="mg-campaign-banner-slide"
|
|
75
73
|
role="button"
|
|
@@ -98,18 +96,6 @@ onUnmounted(() => {
|
|
|
98
96
|
</template>
|
|
99
97
|
|
|
100
98
|
<style lang="scss" scoped>
|
|
101
|
-
@keyframes mg-skeleton-loading {
|
|
102
|
-
0% { background-color: rgba(255, 255, 255, 0.06); }
|
|
103
|
-
100% { background-color: rgba(221, 221, 221, 0.18); }
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.mg-campaign-banner-skeleton {
|
|
107
|
-
width: 100%;
|
|
108
|
-
aspect-ratio: 4 / 1;
|
|
109
|
-
min-height: 120px;
|
|
110
|
-
animation: mg-skeleton-loading 0.8s linear infinite alternate;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
99
|
.mg-campaign-banner-carousel {
|
|
114
100
|
position: relative;
|
|
115
101
|
width: 100%;
|
|
@@ -132,13 +118,11 @@ onUnmounted(() => {
|
|
|
132
118
|
.mg-campaign-banner-indicators {
|
|
133
119
|
position: absolute;
|
|
134
120
|
bottom: 8px;
|
|
135
|
-
left:
|
|
136
|
-
|
|
121
|
+
left: 50%;
|
|
122
|
+
transform: translateX(-50%);
|
|
137
123
|
display: flex;
|
|
138
|
-
justify-content: center;
|
|
139
124
|
gap: 6px;
|
|
140
125
|
align-items: center;
|
|
141
|
-
pointer-events: none;
|
|
142
126
|
|
|
143
127
|
button {
|
|
144
128
|
width: 8px;
|
|
@@ -147,7 +131,6 @@ onUnmounted(() => {
|
|
|
147
131
|
border: 0;
|
|
148
132
|
background: rgba(255, 255, 255, 0.5);
|
|
149
133
|
cursor: pointer;
|
|
150
|
-
pointer-events: all;
|
|
151
134
|
transition: background 0.2s;
|
|
152
135
|
|
|
153
136
|
&.active {
|
package/nuxt.config.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
export default defineNuxtConfig({
|
|
2
|
-
css: [
|
|
2
|
+
css: [
|
|
3
|
+
"@mundogamernetwork/shared-ui/assets/kit/kit-base.css",
|
|
4
|
+
"@mundogamernetwork/shared-ui/assets/kit/kit-theme.css",
|
|
5
|
+
],
|
|
3
6
|
runtimeConfig: {
|
|
4
7
|
public: {
|
|
5
8
|
mgSharedUi: {
|
|
6
9
|
platform: "", // e.g. MGC, MGTV, MGN
|
|
7
10
|
systemId: "", // VITE_SYSTEM_ID for notification filtering
|
|
8
11
|
apiBaseURL: "", // VITE_API_BASE_URL
|
|
12
|
+
pressKitApiUrl: "", // VITE_PRESS_KIT_API_URL — override per-service; falls back to apiBaseURL
|
|
13
|
+
agencyBaseUrl: "", // VITE_BASE_URL_AGENCY — used for "create your press kit" CTA link
|
|
9
14
|
accountsBaseUrl: "", // VITE_BASE_ACCOUNTS_URL
|
|
10
15
|
networkBaseUrl: "", // VITE_BASE_URL_NETWORK (institutional APIs)
|
|
11
16
|
features: {
|