@hagicode/hagilight 0.1.2-dev.7.1.c02207e → 0.1.2-dev.9.1.eccbdf8

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.
@@ -127,11 +127,23 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
127
127
  color: var(--sl-color-text, #1f2937);
128
128
  }
129
129
 
130
- .hagilight-promoto__image {
131
- display: block;
130
+ .hagilight-promoto__media {
131
+ display: inline-flex;
132
+ align-items: center;
133
+ justify-content: center;
132
134
  width: clamp(4.5rem, 8vw, 6.25rem);
135
+ min-width: clamp(4.5rem, 8vw, 6.25rem);
133
136
  aspect-ratio: 1;
137
+ overflow: hidden;
138
+ border: 1px solid color-mix(in srgb, var(--sl-color-accent-high, #1d4ed8) 18%, var(--sl-color-gray-5, #cbd5e1));
134
139
  border-radius: 0.8rem;
140
+ background: color-mix(in srgb, var(--sl-color-bg-sidebar, #f8fafc) 82%, transparent);
141
+ }
142
+
143
+ .hagilight-promoto__image {
144
+ display: block;
145
+ width: 100%;
146
+ height: 100%;
135
147
  object-fit: cover;
136
148
  }
137
149
 
@@ -216,83 +228,112 @@ const { fallback, locale = Astro.currentLocale ?? 'en' } = Astro.props;
216
228
 
217
229
  @media (max-width: 960px) {
218
230
  .hagilight-promoto__slide {
219
- grid-template-columns: minmax(0, 1fr) auto;
231
+ grid-template-columns: 1fr;
220
232
  gap: 0.75rem;
233
+ padding-inline-end: 3.7rem;
234
+ }
235
+
236
+ .hagilight-promoto__slide[data-has-image='true'] {
237
+ grid-template-columns: 1fr;
221
238
  }
222
239
 
223
240
  .hagilight-promoto__copy {
224
241
  grid-template-columns: 1fr;
225
242
  gap: 0.45rem;
226
243
  }
244
+
245
+ .hagilight-promoto__media {
246
+ width: min(100%, 8rem);
247
+ min-width: 0;
248
+ }
249
+
250
+ .hagilight-promoto__cta {
251
+ justify-self: start;
252
+ white-space: normal;
253
+ }
254
+
255
+ .hagilight-promoto__controls {
256
+ justify-content: flex-start;
257
+ padding-top: 0;
258
+ }
227
259
  }
228
260
 
229
261
  @media (max-width: 720px) {
230
262
  .hagilight-promoto__shell {
231
263
  bottom: calc(env(safe-area-inset-bottom) + 0.5rem);
232
- width: min(calc(100vw - 1rem), 28rem);
264
+ width: min(calc(100vw - 1rem), 24rem);
233
265
  border-radius: 1rem;
234
266
  }
235
267
 
236
268
  .hagilight-promoto__slide {
237
- grid-template-columns: minmax(0, 1fr) auto;
238
- gap: 0.5rem;
239
- padding: 0.65rem 3.25rem 0.65rem 0.75rem;
269
+ grid-template-columns: 1fr;
270
+ gap: 0.7rem;
271
+ padding: 0.85rem 4.8rem 0.85rem 0.85rem;
272
+ }
273
+
274
+ .hagilight-promoto__slide[data-has-image='true'] {
275
+ grid-template-columns: minmax(0, 1fr) 4.5rem;
276
+ align-items: start;
240
277
  }
241
278
 
242
279
  .hagilight-promoto__copy {
243
280
  grid-column: 1;
244
- grid-row: 1 / 3;
281
+ grid-row: 1;
282
+ gap: 0.45rem;
245
283
  }
246
284
 
247
285
  .hagilight-promoto__title {
248
- font-size: var(--sl-text-xs);
286
+ font-size: 0.92rem;
249
287
  }
250
288
 
251
289
  .hagilight-promoto__description {
252
- font-size: var(--sl-text-xs);
290
+ font-size: 0.84rem;
253
291
  font-weight: 500;
292
+ line-height: 1.3;
254
293
  }
255
294
 
256
- .hagilight-promoto__image {
295
+ .hagilight-promoto__media {
296
+ width: 4.5rem;
297
+ min-width: 4.5rem;
298
+ align-self: start;
257
299
  grid-column: 2;
258
300
  grid-row: 1;
259
- width: 3rem;
260
301
  }
261
302
 
262
303
  .hagilight-promoto__cta {
263
- grid-column: 2;
264
- grid-row: 2;
265
- min-width: 4rem;
266
- min-height: 1.9rem;
267
- padding-inline: 0.5rem;
268
- font-size: var(--sl-text-xs);
269
- overflow-wrap: anywhere;
304
+ grid-column: 1 / -1;
305
+ justify-self: stretch;
306
+ min-width: 0;
307
+ min-height: 2.35rem;
308
+ width: 100%;
309
+ font-size: 0.82rem;
310
+ white-space: normal;
270
311
  }
271
312
 
272
- .hagilight-promoto__slide[data-has-image='false'] {
273
- grid-template-rows: auto;
313
+ .hagilight-promoto__control {
314
+ min-width: 2.2rem;
315
+ min-height: 2.2rem;
274
316
  }
275
317
 
276
- .hagilight-promoto__slide[data-has-image='false'] .hagilight-promoto__copy,
277
- .hagilight-promoto__slide[data-has-image='false'] .hagilight-promoto__cta {
278
- grid-row: 1;
318
+ .hagilight-promoto__count {
319
+ min-width: 2.75rem;
320
+ font-size: 0.75rem;
279
321
  }
280
322
 
281
- .hagilight-promoto__slide[data-has-image='false'] .hagilight-promoto__cta {
282
- min-width: 4.5rem;
323
+ .hagilight-promoto__dismiss {
324
+ inset-block-start: 0.55rem;
325
+ inset-inline-end: 0.55rem;
326
+ width: auto;
327
+ min-width: 2rem;
328
+ height: 2rem;
329
+ gap: 0.25rem;
330
+ padding-inline: 0.55rem;
283
331
  }
284
332
 
285
333
  .hagilight-promoto__controls {
286
- justify-content: flex-start;
287
334
  flex-wrap: wrap;
288
335
  gap: 0.35rem;
289
- padding: 0 0.75rem 0.6rem;
290
- }
291
-
292
- .hagilight-promoto__control {
293
- min-width: 2rem;
294
- min-height: 2rem;
295
- padding-inline: 0.5rem;
336
+ padding: 0 0.85rem 0.9rem;
296
337
  }
297
338
  }
298
339
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hagicode/hagilight",
3
- "version": "0.1.2-dev.7.1.c02207e",
3
+ "version": "0.1.2-dev.9.1.eccbdf8",
4
4
  "type": "module",
5
5
  "description": "Shared Astro components for HagiCode sites",
6
6
  "repository": {
package/promoto-banner.ts CHANGED
@@ -239,6 +239,8 @@ export function definePromotoBannerElement(): void {
239
239
  slide.append(copy);
240
240
 
241
241
  if (card.image) {
242
+ const media = document.createElement('span');
243
+ media.className = 'hagilight-promoto__media';
242
244
  const image = document.createElement('img');
243
245
  image.className = 'hagilight-promoto__image';
244
246
  image.src = card.image.src;
@@ -247,7 +249,8 @@ export function definePromotoBannerElement(): void {
247
249
  image.decoding = 'async';
248
250
  if (card.image.width) image.width = card.image.width;
249
251
  if (card.image.height) image.height = card.image.height;
250
- slide.append(image);
252
+ media.append(image);
253
+ slide.append(media);
251
254
  }
252
255
  slide.append(link);
253
256
  fragment.append(slide);
@@ -222,5 +222,37 @@
222
222
  "ru-RU": "Соберите способности агента."
223
223
  },
224
224
  "url": "https://trait.hagicode.com/"
225
+ },
226
+ {
227
+ "id": "openspec-docs",
228
+ "name": {
229
+ "zh-CN": "OpenSpec 文档",
230
+ "zh-Hant": "OpenSpec 文件",
231
+ "en-US": "OpenSpec Docs",
232
+ "ja-JP": "OpenSpec ドキュメント",
233
+ "ko-KR": "OpenSpec 문서",
234
+ "de-DE": "OpenSpec-Dokumentation",
235
+ "fr-FR": "Documentation OpenSpec",
236
+ "es-ES": "Documentación de OpenSpec",
237
+ "pt-BR": "Documentação do OpenSpec",
238
+ "ru-RU": "Документация OpenSpec"
239
+ },
240
+ "url": "https://openspec.hagicode.com/"
241
+ },
242
+ {
243
+ "id": "omniroute-docs",
244
+ "name": {
245
+ "zh-CN": "OmniRoute 文档",
246
+ "zh-Hant": "OmniRoute 文件",
247
+ "en-US": "OmniRoute Docs",
248
+ "ja-JP": "OmniRoute ドキュメント",
249
+ "ko-KR": "OmniRoute 문서",
250
+ "de-DE": "OmniRoute-Dokumentation",
251
+ "fr-FR": "Documentation OmniRoute",
252
+ "es-ES": "Documentación de OmniRoute",
253
+ "pt-BR": "Documentação do OmniRoute",
254
+ "ru-RU": "Документация OmniRoute"
255
+ },
256
+ "url": "https://omniroute.hagicode.com/"
225
257
  }
226
258
  ]
package/site-links.ts CHANGED
@@ -16,7 +16,7 @@ export type SiteLinkKey =
16
16
  | 'issueFeedback'
17
17
  | 'contactEmail'
18
18
  | 'qqGroup'
19
- | 'steam'
19
+ | 'microsoftStore'
20
20
  | 'icpFiling'
21
21
  | 'publicSecurityFiling';
22
22
 
@@ -153,10 +153,11 @@ const translations = {
153
153
  'fr-FR': 'Groupe QQ 610394020', 'es-ES': 'Grupo QQ 610394020',
154
154
  'pt-BR': 'Grupo QQ 610394020', 'ru-RU': 'Группа QQ 610394020',
155
155
  },
156
- steam: {
157
- 'zh-CN': 'Steam', 'zh-Hant': 'Steam', 'en-US': 'Steam', 'ja-JP': 'Steam',
158
- 'ko-KR': 'Steam', 'de-DE': 'Steam', 'fr-FR': 'Steam', 'es-ES': 'Steam',
159
- 'pt-BR': 'Steam', 'ru-RU': 'Steam',
156
+ microsoftStore: {
157
+ 'zh-CN': 'Microsoft Store', 'zh-Hant': 'Microsoft Store', 'en-US': 'Microsoft Store',
158
+ 'ja-JP': 'Microsoft Store', 'ko-KR': 'Microsoft Store', 'de-DE': 'Microsoft Store',
159
+ 'fr-FR': 'Microsoft Store', 'es-ES': 'Microsoft Store', 'pt-BR': 'Microsoft Store',
160
+ 'ru-RU': 'Microsoft Store',
160
161
  },
161
162
  icpFiling: '闽ICP备2026004153号-1',
162
163
  publicSecurityFiling: '闽公网安备35011102351148号',
@@ -178,7 +179,11 @@ const defaultLinks: Record<SiteLinkKey, LinkDefinition> = {
178
179
  issueFeedback: { label: translations.issueFeedback, href: 'https://github.com/HagiCode-org/site/issues', external: true },
179
180
  contactEmail: { label: translations.contactEmail, href: 'mailto:support@hagicode.com' },
180
181
  qqGroup: { label: translations.qqGroup, href: 'https://qm.qq.com/q/Fwb0o094kw', external: true },
181
- steam: { label: translations.steam, href: 'https://store.steampowered.com/app/4625540/Hagicode/', external: true },
182
+ microsoftStore: {
183
+ label: translations.microsoftStore,
184
+ href: 'https://apps.microsoft.com/detail/9N3PM0N3SVDW',
185
+ external: true,
186
+ },
182
187
  icpFiling: {
183
188
  label: translations.icpFiling,
184
189
  href: 'https://beian.miit.gov.cn/',
@@ -209,8 +214,8 @@ const defaultLinks: Record<SiteLinkKey, LinkDefinition> = {
209
214
 
210
215
  const groups: Record<LinkGroup, readonly SiteLinkKey[]> = {
211
216
  header: ['home', 'blog', 'support'],
212
- quick: ['downloadClient', 'about', 'dockerCompose', 'productDocs', 'blogPosts', 'rss'],
213
- community: ['github', 'discord', 'issueFeedback', 'contactEmail', 'qqGroup', 'costCalculator', 'steam'],
217
+ quick: ['downloadClient', 'microsoftStore', 'about', 'dockerCompose', 'productDocs', 'blogPosts', 'rss'],
218
+ community: ['github', 'discord', 'issueFeedback', 'contactEmail', 'qqGroup', 'costCalculator'],
214
219
  filings: ['icpFiling', 'publicSecurityFiling'],
215
220
  };
216
221