@mundogamernetwork/shared-ui 1.18.2 → 1.19.1

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/README.md CHANGED
@@ -203,21 +203,21 @@ Também pode ser usado direto: `<MgWhatsNewModal :suppress="meuModalAberto" :blo
203
203
 
204
204
  O plugin `presence.client` avisa a API, a cada ~2 minutos e só com a aba visível, que o usuário logado está ativo na plataforma. O network-admin usa isso para mostrar "Online" e "Última atividade" na lista de usuários e para os fluxos de reativação.
205
205
 
206
- **Desligado por padrão.** Ligue por front, só depois que a API desse front estiver rodando a versão do api-main que guarda o heartbeat no Redis (antes disso cada ping vira uma escrita no Postgres):
206
+ **Desligado por padrão.** Ligue por front quando a API desse front já rodar a versão do api-main que guarda o heartbeat no Redis (antes disso cada ping vira uma escrita no Postgres). O plugin usa o `VITE_SYSTEM_ID` do front como plataforma.
207
207
 
208
208
  ```ts
209
209
  // nuxt.config.ts do app
210
210
  runtimeConfig: {
211
211
  public: {
212
212
  mgSharedUi: {
213
- systemId: '1', // id da plataforma em mg_network_systems (VITE_SYSTEM_ID)
213
+ systemId: '1', // opcional se VITE_SYSTEM_ID já estiver definido
214
214
  presence: { enabled: true, intervalSeconds: 120 } // nunca abaixo de 60
215
215
  }
216
216
  }
217
217
  }
218
218
  ```
219
219
 
220
- ou por ambiente, sem mexer no código: `NUXT_PUBLIC_MG_SHARED_UI_PRESENCE_ENABLED=true`.
220
+ Ou, sem mexer no código (vale em runtime): `NUXT_PUBLIC_MG_SHARED_UI_PRESENCE_ENABLED=true`.
221
221
 
222
222
  - Chama `POST /public/user-status/heartbeat` com `{ platform_id }`. Sem `systemId` numérico, o plugin não faz nada.
223
223
  - Acompanha o login pelo store `auth-store`, então funciona também nos apps que têm cópia própria do store (academy, agency) com o mesmo id.
@@ -144,7 +144,7 @@
144
144
  </div>
145
145
  <p v-if="bundle.description" class="bundle-desc">{{ bundle.description }}</p>
146
146
  <div class="bundle-items">
147
- <span v-for="item in bundle.rate_cards?.data || bundle.rate_cards || []" :key="item.id" class="bundle-item-tag">
147
+ <span v-for="item in getBundleRateCards(bundle)" :key="item.id" class="bundle-item-tag">
148
148
  {{ item.content_format?.name || item.label }}<template v-if="item.platform?.name"> · {{ item.platform.name }}</template>
149
149
  </span>
150
150
  </div>
@@ -297,7 +297,12 @@ onMounted(() => {
297
297
  });
298
298
 
299
299
  function qtyFor(id: number): number {
300
- return form.value.quantities[id] || 1;
300
+ return (form.value.quantities as Record<number, number>)[id] || 1;
301
+ }
302
+
303
+ function getBundleRateCards(bundle: any): any[] {
304
+ const cards = bundle?.rate_cards;
305
+ return Array.isArray(cards) ? cards : Array.isArray(cards?.data) ? cards.data : [];
301
306
  }
302
307
  function setQty(id: number, value: number) {
303
308
  form.value.quantities = { ...form.value.quantities, [id]: Math.max(1, value || 1) };
@@ -195,7 +195,7 @@ const detailRoute = computed(() =>
195
195
  <svg xmlns="http://www.w3.org/2000/svg" width="12" height="13" viewBox="0 0 16 17" fill="none">
196
196
  <path d="M13.3333 4.1112L12.8666 3.64453L11.9333 4.57786L10.9333 3.64453L8.33329 4.1112L2.66663 9.77786L7.19996 14.3112L12.8666 8.64453L13.3333 6.04453L12.4 5.1112L13.3333 4.1112ZM12.6 6.24453L12.2666 8.3112L7.19996 13.3779L3.59996 9.77786L8.66663 4.7112L10.7333 4.3112L11.4666 5.04453L11 5.5112L10.5333 5.04453L9.99996 5.57786L11.4 6.97786L11.8666 6.5112L11.4 6.04453L11.8666 5.57786L12.6 6.24453Z" fill="#D297FF"/>
197
197
  </svg>
198
- {{ typeof card.type === "string" ? card.type : card.type.name }}
198
+ {{ typeof card.type === "string" ? card.type : String((card.type as any)?.name ?? "") }}
199
199
  </span>
200
200
  </div>
201
201
  </div>
@@ -33,4 +33,7 @@ const whatsNewBlocked: string[] = whatsNewConfig.blockedRoutes ?? [];
33
33
  :allowed-routes="whatsNewAllowed"
34
34
  :blocked-routes="whatsNewBlocked"
35
35
  />
36
+ <!-- The "Novidades" history (drawer + reopened announcement) lives here too: the fronts build their own headers out of
37
+ MgHeaderAvatarToggle + MgHeaderUIUser, so the host cannot ride on a layer header. It renders nothing until opened. -->
38
+ <MgWhatsNewHistory v-if="whatsNewEnabled" />
36
39
  </template>
@@ -1,5 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { storeToRefs } from "pinia";
3
+ import { formatBadge } from "../../utils/whatsNew";
3
4
 
4
5
  /**
5
6
  * The account-menu toggle icon in the header top bar (not the dropdown
@@ -26,6 +27,13 @@ const { user, signedIn } = storeToRefs(authStore);
26
27
  // defensively instead of destructuring: a host whose store doesn't expose
27
28
  // it treats the state as already known, skipping the skeleton rather than
28
29
  // getting stuck showing it forever.
30
+ // "Novidades" history: the unread number rides on the avatar, wherever the host draws this toggle. Shown only when the
31
+ // drawer host is mounted (MgBanners does it) and the user is signed in; the number comes from the history store.
32
+ const whatsNewStore = useWhatsNewStore();
33
+ const whatsNewBadge = computed(() =>
34
+ signedIn.value && whatsNewStore.hostMounted ? formatBadge(whatsNewStore.unread) : "",
35
+ );
36
+
29
37
  const initialized = computed(() => {
30
38
  const raw = (authStore as unknown as { initialized?: boolean }).initialized;
31
39
  return raw === undefined ? true : raw;
@@ -49,6 +57,7 @@ const initialized = computed(() => {
49
57
  alt=""
50
58
  @error="(e: Event) => { const t = e.target as HTMLImageElement; if (t) { t.onerror = null; t.src = '/imgs/default-avatar.png' } }"
51
59
  />
60
+ <span v-if="whatsNewBadge" class="mg-wn-avatar-badge" aria-hidden="true">{{ whatsNewBadge }}</span>
52
61
  <template #fallback>
53
62
  <div
54
63
  class="mg-avatar-skeleton"
@@ -81,6 +90,23 @@ const initialized = computed(() => {
81
90
  }
82
91
  }
83
92
 
93
+ // Positioned against the host's avatar wrapper (every host's menu item is position:relative).
94
+ .mg-wn-avatar-badge {
95
+ position: absolute;
96
+ top: -4px;
97
+ inset-inline-end: -4px;
98
+ min-width: 16px;
99
+ height: 16px;
100
+ padding: 0 4px;
101
+ font-size: 0.625rem;
102
+ font-weight: 700;
103
+ line-height: 16px;
104
+ text-align: center;
105
+ color: var(--mg-wn-on-accent);
106
+ background: var(--mg-wn-accent);
107
+ pointer-events: none;
108
+ }
109
+
84
110
  .mg-avatar-img {
85
111
  display: block;
86
112
  // Host apps wrap this in a fixed-size clickable link/button and expect
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from "vue";
3
3
  import { storeToRefs } from "pinia";
4
+ import { formatBadge } from "../../utils/whatsNew";
4
5
 
5
6
  const authStore = useAuthStore();
6
7
  const indexStore = useIndexStore();
@@ -9,6 +10,12 @@ const notificationsStore = useNotificationsStore();
9
10
  const { user, signedIn } = storeToRefs(authStore);
10
11
  const { notificationCount } = storeToRefs(notificationsStore);
11
12
 
13
+ // "Novidades" history: the unread number rides on the profile avatar (the drawer opens from the user menu).
14
+ const whatsNewStore = useWhatsNewStore();
15
+ const whatsNewCfg: any = useRuntimeConfig().public.mgSharedUi?.whatsNew ?? {};
16
+ const whatsNewHistory = whatsNewCfg.enabled !== false && whatsNewCfg.history !== false;
17
+ const whatsNewBadge = computed(() => (whatsNewHistory && signedIn.value ? formatBadge(whatsNewStore.unread) : ""));
18
+
12
19
  const runtimeConfig = useRuntimeConfig();
13
20
  const features = runtimeConfig.public.mgSharedUi?.features ?? {};
14
21
 
@@ -117,6 +124,7 @@ onMounted(() => {
117
124
  class="rounded-circle"
118
125
  @error="(e: Event) => { const t = e.target as HTMLImageElement; if (t) { t.onerror = null; t.src = '/imgs/default-avatar.png' } }"
119
126
  />
127
+ <span v-if="whatsNewBadge" class="badge" aria-hidden="true">{{ whatsNewBadge }}</span>
120
128
  </a>
121
129
  </li>
122
130
 
@@ -26,6 +26,11 @@ const runtimeConfig = useRuntimeConfig();
26
26
  const accountsBaseUrl = runtimeConfig.public.mgSharedUi?.accountsBaseUrl || runtimeConfig.public.accountsBaseUrl;
27
27
  const supportUrl = `${accountsBaseUrl}/account/support/new`;
28
28
  const features = runtimeConfig.public.mgSharedUi?.features ?? {};
29
+ // "Novidades" history entry (drawer mounted by MgHeaderComponent). On unless the front switches it off.
30
+ const whatsNewConfig: any = runtimeConfig.public.mgSharedUi?.whatsNew ?? {};
31
+ const whatsNewHistory = whatsNewConfig.enabled !== false && whatsNewConfig.history !== false;
32
+ // The entry only shows when the drawer host is mounted (MgHeaderComponent does it); a custom header without it hides the entry.
33
+ const whatsNewStore = useWhatsNewStore();
29
34
  const pricingUrl = runtimeConfig.public.mgSharedUi?.pricingUrl || "";
30
35
  const { locale } = useI18n();
31
36
 
@@ -214,6 +219,10 @@ const handleToggleOnline = () => {
214
219
  </a>
215
220
  </div>
216
221
 
222
+ <div v-if="whatsNewHistory && whatsNewStore.hostMounted" class="row info-row">
223
+ <MgWhatsNewMenuItem @opened="emit('toggleVisible')" />
224
+ </div>
225
+
217
226
  <div class="row info-row">
218
227
  <a :href="accountsBaseUrl" target="_blank" class="btn btn-primary-outline mt-3">
219
228
  {{ $t("account_menu.buttons.manage_account") }}
@@ -35,7 +35,7 @@ const props = defineProps({
35
35
  });
36
36
 
37
37
  const registerUrl = computed(() =>
38
- buildRegisterUrl(accountsBaseUrl, undefined, systemId),
38
+ buildRegisterUrl(String(accountsBaseUrl), undefined, String(systemId)),
39
39
  );
40
40
 
41
41
  function close() {
@@ -0,0 +1,468 @@
1
+ <script setup lang="ts">
2
+ /**
3
+ * Side drawer with the history of announcements ("Novidades"). Reads the store directly; the host
4
+ * (<MgWhatsNewHistory />) decides what happens when a row is opened. Colours come only from the
5
+ * --mg-wn-* tokens, layout is logical (RTL aware), and the focus is trapped while it is open.
6
+ */
7
+ import { computed, nextTick, onBeforeUnmount, onMounted, ref } from "vue";
8
+ import { formatBadge, isRtl, parseRich, richToPlain, toApiLang, type WnHistoryItem } from "../../utils/whatsNew";
9
+ import { wnText, type WnTextKey } from "../../utils/whatsNewText";
10
+
11
+ const props = defineProps<{ locale: string }>();
12
+ const emit = defineEmits<{
13
+ (e: "close"): void;
14
+ (e: "open", item: WnHistoryItem): void;
15
+ (e: "more"): void;
16
+ (e: "retry"): void;
17
+ }>();
18
+
19
+ const store = useWhatsNewStore();
20
+ const uid = Math.random().toString(36).slice(2, 8);
21
+ const titleId = `mg-wn-drawer-title-${uid}`;
22
+
23
+ const panel = ref<HTMLElement | null>(null);
24
+ const titleEl = ref<HTMLElement | null>(null);
25
+ let returnFocusTo: HTMLElement | null = null;
26
+ let previousOverflow = "";
27
+
28
+ const t = (key: WnTextKey) => wnText(props.locale, key);
29
+ const dir = computed(() => (isRtl(props.locale) ? "rtl" : "ltr"));
30
+ const badge = computed(() => formatBadge(store.unread));
31
+ const hasMore = computed(() => !!store.historyMeta && store.historyMeta.page < store.historyMeta.last_page);
32
+ const loading = computed(() => store.historyStatus === "loading");
33
+
34
+ const dateFormat = computed(() => {
35
+ try {
36
+ return new Intl.DateTimeFormat(toApiLang(props.locale), { dateStyle: "medium" });
37
+ } catch {
38
+ return null;
39
+ }
40
+ });
41
+
42
+ function dateOf(iso: string | null): string {
43
+ if (!iso || !dateFormat.value) return "";
44
+ const d = new Date(iso);
45
+ return Number.isNaN(d.getTime()) ? "" : dateFormat.value.format(d);
46
+ }
47
+
48
+ function kindLabel(item: WnHistoryItem) {
49
+ return t(`kind_${item.kind}` as WnTextKey);
50
+ }
51
+
52
+ function rowLabel(item: WnHistoryItem) {
53
+ return [item.is_new ? t("history_new") : "", item.title, kindLabel(item), dateOf(item.published_at)]
54
+ .filter(Boolean)
55
+ .join(", ");
56
+ }
57
+
58
+ /** The list shows plain text: `**bold**` and `[text](url)` in the summary are flattened. */
59
+ function summaryOf(item: WnHistoryItem): string {
60
+ return richToPlain(parseRich(item.summary, false));
61
+ }
62
+
63
+ function onBackdrop(event: MouseEvent) {
64
+ if (event.target === event.currentTarget) emit("close");
65
+ }
66
+
67
+ // ── focus management ──────────────────────────────────────────────────────
68
+ const FOCUSABLE = 'a[href], button:not([disabled]), [tabindex]:not([tabindex="-1"])';
69
+
70
+ function focusables(): HTMLElement[] {
71
+ if (!panel.value) return [];
72
+ return Array.from(panel.value.querySelectorAll<HTMLElement>(FOCUSABLE)).filter((el) => el.getClientRects().length > 0);
73
+ }
74
+
75
+ function onKeydown(event: KeyboardEvent) {
76
+ // A reopened announcement sits on top with its own handler: leave Esc and Tab to it.
77
+ if (store.viewing) return;
78
+ if (event.key === "Escape") {
79
+ event.stopPropagation();
80
+ emit("close");
81
+ return;
82
+ }
83
+ if (event.key !== "Tab") return;
84
+ const items = focusables();
85
+ if (!items.length) {
86
+ event.preventDefault();
87
+ titleEl.value?.focus();
88
+ return;
89
+ }
90
+ const first = items[0];
91
+ const last = items[items.length - 1];
92
+ const active = document.activeElement as HTMLElement | null;
93
+ const inside = !!active && !!panel.value?.contains(active);
94
+ if (event.shiftKey && (active === first || active === titleEl.value || !inside)) {
95
+ event.preventDefault();
96
+ last.focus();
97
+ } else if (!event.shiftKey && (active === last || !inside)) {
98
+ event.preventDefault();
99
+ first.focus();
100
+ }
101
+ }
102
+
103
+ onMounted(async () => {
104
+ returnFocusTo = document.activeElement instanceof HTMLElement ? document.activeElement : null;
105
+ previousOverflow = document.documentElement.style.overflow;
106
+ document.documentElement.style.overflow = "hidden";
107
+ document.addEventListener("keydown", onKeydown, true);
108
+ await nextTick();
109
+ titleEl.value?.focus({ preventScroll: true });
110
+ });
111
+
112
+ onBeforeUnmount(() => {
113
+ document.removeEventListener("keydown", onKeydown, true);
114
+ document.documentElement.style.overflow = previousOverflow;
115
+ if (returnFocusTo && document.contains(returnFocusTo)) returnFocusTo.focus({ preventScroll: true });
116
+ });
117
+ </script>
118
+
119
+ <template>
120
+ <div class="mg-wn-drawer-overlay" data-mg-wn :dir="dir" @mousedown="onBackdrop">
121
+ <aside ref="panel" class="mg-wn-drawer" role="dialog" aria-modal="true" :aria-labelledby="titleId" :aria-busy="loading">
122
+ <header class="mg-wn-drawer__head">
123
+ <div class="mg-wn-drawer__head-text">
124
+ <h2 :id="titleId" ref="titleEl" class="mg-wn-drawer__title" tabindex="-1">
125
+ {{ t("history_title") }}
126
+ <span v-if="badge" class="mg-wn-drawer__count" :aria-label="`${store.unread} ${t('history_unread')}`">{{ badge }}</span>
127
+ </h2>
128
+ <p class="mg-wn-drawer__sub">{{ t("history_subtitle") }}</p>
129
+ </div>
130
+ <button type="button" class="mg-wn-drawer__x" :aria-label="t('close')" @click="emit('close')">
131
+ <span aria-hidden="true">✕</span>
132
+ </button>
133
+ </header>
134
+
135
+ <p v-if="store.openError" class="mg-wn-drawer__alert" role="alert">{{ t("history_open_error") }}</p>
136
+
137
+ <div class="mg-wn-drawer__body">
138
+ <p v-if="loading" class="mg-wn-drawer__state" role="status">{{ t("history_loading") }}</p>
139
+
140
+ <div v-else-if="store.historyStatus === 'error' && !store.history.length" class="mg-wn-drawer__state" role="alert">
141
+ <p>{{ t("history_error") }}</p>
142
+ <button type="button" class="mg-wn-drawer__btn" @click="emit('retry')">{{ t("history_retry") }}</button>
143
+ </div>
144
+
145
+ <p v-else-if="!store.history.length" class="mg-wn-drawer__state">{{ t("history_empty") }}</p>
146
+
147
+ <ul v-else class="mg-wn-drawer__list">
148
+ <li v-for="item in store.history" :key="item.id">
149
+ <button
150
+ type="button"
151
+ class="mg-wn-row"
152
+ :class="{ 'mg-wn-row--new': item.is_new }"
153
+ :aria-label="rowLabel(item)"
154
+ :aria-busy="store.openingId === item.id"
155
+ :disabled="store.openingId !== null"
156
+ @click="emit('open', item)"
157
+ >
158
+ <img v-if="item.thumb_url" :src="item.thumb_url" alt="" class="mg-wn-row__thumb" loading="lazy" width="72" height="72" />
159
+ <span class="mg-wn-row__text">
160
+ <span class="mg-wn-row__meta">
161
+ <span class="mg-wn-row__kind" :class="`mg-wn-row__kind--${item.kind}`">{{ kindLabel(item) }}</span>
162
+ <span v-if="dateOf(item.published_at)" class="mg-wn-row__date">{{ dateOf(item.published_at) }}</span>
163
+ <span v-if="item.is_new" class="mg-wn-row__new">{{ t("history_new") }}</span>
164
+ </span>
165
+ <span class="mg-wn-row__title">{{ item.title }}</span>
166
+ <span v-if="summaryOf(item)" class="mg-wn-row__summary">{{ summaryOf(item) }}</span>
167
+ </span>
168
+ </button>
169
+ </li>
170
+ </ul>
171
+
172
+ <div v-if="store.history.length && (hasMore || store.historyStatus === 'loadingMore' || store.historyStatus === 'error')" class="mg-wn-drawer__more">
173
+ <p v-if="store.historyStatus === 'loadingMore'" role="status">{{ t("history_loading") }}</p>
174
+ <template v-else-if="store.historyStatus === 'error'">
175
+ <p role="alert">{{ t("history_error") }}</p>
176
+ <button type="button" class="mg-wn-drawer__btn" @click="emit('more')">{{ t("history_retry") }}</button>
177
+ </template>
178
+ <button v-else type="button" class="mg-wn-drawer__btn" @click="emit('more')">{{ t("history_more") }}</button>
179
+ </div>
180
+ </div>
181
+ </aside>
182
+ </div>
183
+ </template>
184
+
185
+ <style lang="scss" scoped>
186
+ .mg-wn-drawer-overlay {
187
+ position: fixed;
188
+ inset: 0;
189
+ z-index: 10040; // under the announcement dialog (10050), which opens on top of the drawer
190
+ display: flex;
191
+ justify-content: flex-end; // inline-end: right in LTR, left in RTL
192
+ background: var(--mg-wn-overlay);
193
+ font-family: inherit;
194
+ }
195
+
196
+ .mg-wn-drawer {
197
+ display: flex;
198
+ flex-direction: column;
199
+ width: min(420px, 100vw);
200
+ height: 100%;
201
+ color: var(--mg-wn-text);
202
+ background: var(--mg-wn-surface);
203
+ border-inline-start: 1px solid var(--mg-wn-border);
204
+ box-shadow: 0 0 40px var(--mg-wn-shadow);
205
+ animation: mg-wn-drawer-in 0.2s ease-out;
206
+
207
+ &:focus-visible,
208
+ & :focus-visible {
209
+ outline: 2px solid var(--mg-wn-accent);
210
+ outline-offset: 2px;
211
+ }
212
+
213
+ &__head {
214
+ display: flex;
215
+ align-items: flex-start;
216
+ justify-content: space-between;
217
+ gap: 12px;
218
+ padding: 16px 18px 12px;
219
+ border-bottom: 1px solid var(--mg-wn-border);
220
+ }
221
+
222
+ &__head-text {
223
+ min-width: 0;
224
+ }
225
+
226
+ &__title {
227
+ display: flex;
228
+ align-items: center;
229
+ gap: 8px;
230
+ margin: 0;
231
+ font-size: 1.25rem;
232
+ line-height: 1.25;
233
+ font-weight: 700;
234
+
235
+ &:focus {
236
+ outline: none;
237
+ }
238
+ }
239
+
240
+ &__count {
241
+ min-width: 20px;
242
+ height: 20px;
243
+ padding: 0 6px;
244
+ display: inline-flex;
245
+ align-items: center;
246
+ justify-content: center;
247
+ font-size: 0.6875rem;
248
+ font-weight: 700;
249
+ color: var(--mg-wn-on-accent);
250
+ background: var(--mg-wn-accent);
251
+ }
252
+
253
+ &__sub {
254
+ margin: 4px 0 0;
255
+ font-size: 0.8125rem;
256
+ color: var(--mg-wn-text-muted);
257
+ }
258
+
259
+ &__x {
260
+ flex: none;
261
+ display: grid;
262
+ place-items: center;
263
+ width: 32px;
264
+ height: 32px;
265
+ padding: 0;
266
+ font-size: 0.875rem;
267
+ color: var(--mg-wn-text-muted);
268
+ background: transparent;
269
+ border: 1px solid var(--mg-wn-border);
270
+ border-radius: 0;
271
+ cursor: pointer;
272
+
273
+ &:hover {
274
+ color: var(--mg-wn-text);
275
+ background: var(--mg-wn-surface-2);
276
+ }
277
+ }
278
+
279
+ &__alert {
280
+ margin: 0;
281
+ padding: 10px 18px;
282
+ font-size: 0.8125rem;
283
+ color: var(--mg-wn-warning);
284
+ background: var(--mg-wn-surface-2);
285
+ border-bottom: 1px solid var(--mg-wn-border);
286
+ }
287
+
288
+ &__body {
289
+ flex: 1;
290
+ overflow-y: auto;
291
+ overscroll-behavior: contain;
292
+ }
293
+
294
+ &__state {
295
+ margin: 0;
296
+ padding: 32px 18px;
297
+ text-align: center;
298
+ font-size: 0.9rem;
299
+ color: var(--mg-wn-text-muted);
300
+
301
+ p {
302
+ margin: 0 0 12px;
303
+ }
304
+ }
305
+
306
+ &__list {
307
+ list-style: none;
308
+ margin: 0;
309
+ padding: 0;
310
+ }
311
+
312
+ &__more {
313
+ padding: 14px 18px 20px;
314
+ text-align: center;
315
+ font-size: 0.8125rem;
316
+ color: var(--mg-wn-text-muted);
317
+
318
+ p {
319
+ margin: 0 0 10px;
320
+ }
321
+ }
322
+
323
+ &__btn {
324
+ padding: 8px 16px;
325
+ font: inherit;
326
+ font-size: 0.8125rem;
327
+ font-weight: 600;
328
+ color: var(--mg-wn-accent);
329
+ background: transparent;
330
+ border: 1px solid var(--mg-wn-accent);
331
+ border-radius: 0;
332
+ cursor: pointer;
333
+
334
+ &:hover {
335
+ color: var(--mg-wn-on-accent);
336
+ background: var(--mg-wn-accent);
337
+ }
338
+ }
339
+ }
340
+
341
+ .mg-wn-row {
342
+ display: flex;
343
+ align-items: flex-start;
344
+ gap: 12px;
345
+ width: 100%;
346
+ padding: 14px 18px;
347
+ font: inherit;
348
+ text-align: start;
349
+ color: var(--mg-wn-text);
350
+ background: transparent;
351
+ border: 0;
352
+ border-bottom: 1px solid var(--mg-wn-border);
353
+ cursor: pointer;
354
+
355
+ &:hover:not(:disabled) {
356
+ background: var(--mg-wn-surface-2);
357
+ }
358
+
359
+ &:disabled {
360
+ cursor: progress;
361
+ opacity: 0.7;
362
+ }
363
+
364
+ &--new {
365
+ border-inline-start: 3px solid var(--mg-wn-accent);
366
+ padding-inline-start: 15px;
367
+ }
368
+
369
+ &__thumb {
370
+ flex: none;
371
+ width: 72px;
372
+ height: 72px;
373
+ object-fit: cover;
374
+ background: var(--mg-wn-media-bg);
375
+ }
376
+
377
+ &__text {
378
+ display: flex;
379
+ flex-direction: column;
380
+ gap: 4px;
381
+ min-width: 0;
382
+ }
383
+
384
+ &__meta {
385
+ display: flex;
386
+ flex-wrap: wrap;
387
+ align-items: center;
388
+ gap: 8px;
389
+ font-size: 0.6875rem;
390
+ }
391
+
392
+ &__kind {
393
+ font-weight: 700;
394
+ letter-spacing: 0.08em;
395
+ text-transform: uppercase;
396
+ color: var(--mg-wn-neutral);
397
+
398
+ &--release {
399
+ color: var(--mg-wn-accent);
400
+ }
401
+
402
+ &--launch {
403
+ color: var(--mg-wn-success);
404
+ }
405
+
406
+ &--maintenance {
407
+ color: var(--mg-wn-warning);
408
+ }
409
+ }
410
+
411
+ &__date {
412
+ color: var(--mg-wn-text-muted);
413
+ }
414
+
415
+ &__new {
416
+ padding: 1px 6px;
417
+ font-weight: 700;
418
+ color: var(--mg-wn-on-accent);
419
+ background: var(--mg-wn-accent);
420
+ }
421
+
422
+ &__title {
423
+ font-size: 0.95rem;
424
+ font-weight: 600;
425
+ line-height: 1.3;
426
+ overflow-wrap: anywhere;
427
+ }
428
+
429
+ &__summary {
430
+ display: -webkit-box;
431
+ -webkit-line-clamp: 2;
432
+ line-clamp: 2;
433
+ -webkit-box-orient: vertical;
434
+ overflow: hidden;
435
+ font-size: 0.8125rem;
436
+ line-height: 1.4;
437
+ color: var(--mg-wn-text-muted);
438
+ }
439
+ }
440
+
441
+ [dir="rtl"] .mg-wn-drawer {
442
+ animation-name: mg-wn-drawer-in-rtl;
443
+ }
444
+
445
+ @keyframes mg-wn-drawer-in {
446
+ from {
447
+ transform: translateX(100%);
448
+ }
449
+ to {
450
+ transform: translateX(0);
451
+ }
452
+ }
453
+
454
+ @keyframes mg-wn-drawer-in-rtl {
455
+ from {
456
+ transform: translateX(-100%);
457
+ }
458
+ to {
459
+ transform: translateX(0);
460
+ }
461
+ }
462
+
463
+ @media (prefers-reduced-motion: reduce) {
464
+ .mg-wn-drawer {
465
+ animation: none;
466
+ }
467
+ }
468
+ </style>