lightnet 4.5.2 → 4.6.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +13 -13
  3. package/src/components/CategoriesSection.astro +68 -72
  4. package/src/components/HeroSection.astro +23 -29
  5. package/src/components/HighlightSection.astro +22 -28
  6. package/src/components/MediaGallerySection.astro +52 -58
  7. package/src/components/MediaList.astro +56 -58
  8. package/src/components/Section.astro +19 -21
  9. package/src/components/VideoPlayer.astro +55 -57
  10. package/src/layouts/MarkdownPage.astro +2 -1
  11. package/src/layouts/Page.astro +4 -8
  12. package/src/layouts/components/footer/Footer.astro +33 -36
  13. package/src/layouts/components/footer/LanguageSelectionMenu.astro +9 -9
  14. package/src/layouts/components/header/LanguageSelectionMenu.astro +10 -12
  15. package/src/layouts/components/header/PageNavigation.astro +26 -30
  16. package/src/layouts/components/header/PageTitle.astro +15 -20
  17. package/src/layouts/components/meta/Favicon.astro +3 -5
  18. package/src/layouts/components/meta/ViewTransition.astro +0 -1
  19. package/src/pages/404Route.astro +2 -1
  20. package/src/pages/details-page/DetailsPageRoute.astro +3 -5
  21. package/src/pages/details-page/components/AudioPanel.astro +6 -8
  22. package/src/pages/details-page/components/AudioPlayer.astro +28 -30
  23. package/src/pages/details-page/components/ContentSection.astro +37 -41
  24. package/src/pages/details-page/components/DescriptionSection.astro +9 -11
  25. package/src/pages/details-page/components/MainDetailsSection.astro +1 -3
  26. package/src/pages/details-page/components/MediaCollectionsSection.astro +3 -5
  27. package/src/pages/details-page/components/VideoDetailsSection.astro +1 -3
  28. package/src/pages/details-page/components/main-details/Authors.astro +5 -7
  29. package/src/pages/details-page/components/main-details/EditButton.astro +3 -2
  30. package/src/pages/details-page/components/main-details/OpenButton.astro +3 -5
  31. package/src/pages/details-page/components/main-details/ShareButton.astro +3 -2
  32. package/src/pages/details-page/components/more-details/Categories.astro +18 -20
  33. package/src/pages/details-page/components/more-details/Languages.astro +10 -12
  34. package/src/utils/verify-schema.ts +2 -2
@@ -13,14 +13,12 @@ const { description, language } = item.data
13
13
  const { direction, code: lang } = resolveLanguage(language)
14
14
  ---
15
15
 
16
- {
17
- description && (
18
- <div
19
- dir={direction}
20
- class="prose prose-gray mx-auto mt-8 max-w-screen-md px-4 md:mt-12 md:px-8"
21
- set:html={await markdownToHtml(description)}
22
- lang={lang}
23
- id="description"
24
- />
25
- )
26
- }
16
+ {description && (
17
+ <div
18
+ dir={direction}
19
+ class="prose prose-gray mx-auto mt-8 max-w-screen-md px-4 md:mt-12 md:px-8"
20
+ set:html={await markdownToHtml(description)}
21
+ lang={lang}
22
+ id="description"
23
+ />
24
+ )}
@@ -13,9 +13,7 @@ export type Props = {
13
13
  const { mediaId, imageSize } = Astro.props
14
14
  ---
15
15
 
16
- <div
17
- class="mx-auto mt-10 flex max-w-screen-md flex-col items-center gap-8 px-4 sm:mt-20 sm:flex-row sm:items-start sm:gap-14 md:px-8"
18
- >
16
+ <div class="mx-auto mt-10 flex max-w-screen-md flex-col items-center gap-8 px-4 sm:mt-20 sm:flex-row sm:items-start sm:gap-14 md:px-8">
19
17
  <CoverImage size={imageSize} mediaId={mediaId} />
20
18
  <div class="flex w-full grow flex-col items-center sm:items-start">
21
19
  <Title className="text-center sm:text-start" mediaId={mediaId} />
@@ -11,8 +11,6 @@ const { mediaId } = Astro.props
11
11
  const collections = await getCollectionsForMediaItem(mediaId)
12
12
  ---
13
13
 
14
- {
15
- collections.map((id) => (
16
- <MediaCollection collectionId={id} disableItem={mediaId} />
17
- ))
18
- }
14
+ {collections.map((id) => (
15
+ <MediaCollection collectionId={id} disableItem={mediaId} />
16
+ ))}
@@ -22,9 +22,7 @@ const item = await getMediaItem(mediaId)
22
22
  image={item.data.image}
23
23
  />
24
24
  </div>
25
- <div
26
- class="mx-auto mt-6 flex max-w-screen-md flex-col items-start px-4 md:mt-10 md:px-8"
27
- >
25
+ <div class="mx-auto mt-6 flex max-w-screen-md flex-col items-start px-4 md:mt-10 md:px-8">
28
26
  <Title mediaId={mediaId} />
29
27
  <Authors mediaId={mediaId} />
30
28
  <div class="mt-4 flex gap-6">
@@ -10,10 +10,8 @@ const item = await getMediaItem(Astro.props.mediaId)
10
10
  const authors = item.data.authors?.join(", ")
11
11
  ---
12
12
 
13
- {
14
- authors && (
15
- <div class="text-xl sm:text-2xl" class:list={Astro.props.className}>
16
- {authors}
17
- </div>
18
- )
19
- }
13
+ {authors && (
14
+ <div class="text-xl sm:text-2xl" class:list={Astro.props.className}>
15
+ {authors}
16
+ </div>
17
+ )}
@@ -13,9 +13,10 @@ const { mediaId } = Astro.props
13
13
  id="edit-btn"
14
14
  data-media-id={mediaId}
15
15
  href="#"
16
- ><SquarePenIcon />
17
- {Astro.locals.i18n.t("ln.details.edit")}</a
18
16
  >
17
+ <SquarePenIcon />
18
+ {Astro.locals.i18n.t("ln.details.edit")}
19
+ </a>
19
20
  <script>
20
21
  const initEditButton = () => {
21
22
  const adminPath = localStorage.getItem("ln.adminPaths")
@@ -38,10 +38,8 @@ const getOpenActionLabel = () => {
38
38
  hreflang={item.data.language}
39
39
  class:list={[className]}
40
40
  >
41
- {
42
- content.isExternal && (
43
- <ExternalLinkIcon className="shrink-0 rtl:scale-x-[-1]" />
44
- )
45
- }
41
+ {content.isExternal && (
42
+ <ExternalLinkIcon className="shrink-0 rtl:scale-x-[-1]" />
43
+ )}
46
44
  {content.isDownload ? t("ln.details.download") : getOpenActionLabel()}
47
45
  </a>
@@ -14,9 +14,10 @@ const { t } = Astro.locals.i18n
14
14
  class="flex cursor-pointer items-center gap-2 font-bold text-gray-700 underline"
15
15
  class:list={[Astro.props.className]}
16
16
  id="share-btn"
17
- ><ForwardIcon className="rtl:scale-x-[-1]" />
18
- {t("ln.details.share")}</button
19
17
  >
18
+ <ForwardIcon className="rtl:scale-x-[-1]" />
19
+ {t("ln.details.share")}
20
+ </button>
20
21
  <Toast id="share-success" variant="success">
21
22
  {t("ln.share.url-copied-to-clipboard")}
22
23
  </Toast>
@@ -17,23 +17,21 @@ const categories = await Promise.all(
17
17
  )
18
18
  ---
19
19
 
20
- {
21
- !!categories?.length && (
22
- <div>
23
- <Label>{t("ln.categories")}</Label>
24
- <ul class="flex flex-wrap gap-2">
25
- {categories.map(async (category) => (
26
- <li class="flex rounded-lg bg-gray-200 px-4 py-1 text-gray-500 hover:bg-gray-300">
27
- <a
28
- href={searchPagePath(currentLocale, {
29
- category: category.id,
30
- })}
31
- >
32
- {category.labelText}
33
- </a>
34
- </li>
35
- ))}
36
- </ul>
37
- </div>
38
- )
39
- }
20
+ {!!categories?.length && (
21
+ <div>
22
+ <Label>{t("ln.categories")}</Label>
23
+ <ul class="flex flex-wrap gap-2">
24
+ {categories.map(async (category) => (
25
+ <li class="flex rounded-lg bg-gray-200 px-4 py-1 text-gray-500 hover:bg-gray-300">
26
+ <a
27
+ href={searchPagePath(currentLocale, {
28
+ category: category.id,
29
+ })}
30
+ >
31
+ {category.labelText}
32
+ </a>
33
+ </li>
34
+ ))}
35
+ </ul>
36
+ </div>
37
+ )}
@@ -32,17 +32,15 @@ const translationLanguages = await Promise.all(
32
32
  <Label>{translations.length ? t("ln.languages") : t("ln.language")}</Label>
33
33
  <ul class="flex flex-wrap gap-2">
34
34
  <li class="py-1 pe-2 text-gray-800">{currentLanguage.labelText}</li>
35
- {
36
- translationLanguages.map((translation) => (
37
- <li class="flex rounded-lg border border-gray-200 px-4 py-1 text-gray-600 hover:bg-gray-200">
38
- <a
39
- href={detailsPagePath(currentLocale, translation)}
40
- hreflang={translation.language}
41
- >
42
- {translation.labelText}
43
- </a>
44
- </li>
45
- ))
46
- }
35
+ {translationLanguages.map((translation) => (
36
+ <li class="flex rounded-lg border border-gray-200 px-4 py-1 text-gray-600 hover:bg-gray-200">
37
+ <a
38
+ href={detailsPagePath(currentLocale, translation)}
39
+ hreflang={translation.language}
40
+ >
41
+ {translation.labelText}
42
+ </a>
43
+ </li>
44
+ ))}
47
45
  </ul>
48
46
  </div>
@@ -1,7 +1,7 @@
1
1
  import { AstroError } from "astro/errors"
2
2
  import { z } from "astro/zod"
3
3
 
4
- export async function verifySchemaAsync<T extends z.Schema>(
4
+ export async function verifySchemaAsync<T extends z.ZodType>(
5
5
  schema: T,
6
6
  toVerify: unknown,
7
7
  errorMessage: string | ((id: string | undefined) => string),
@@ -15,7 +15,7 @@ export async function verifySchemaAsync<T extends z.Schema>(
15
15
  throwParseError(toVerify, errorMessage, hint, parsed)
16
16
  }
17
17
 
18
- export function verifySchema<T extends z.Schema>(
18
+ export function verifySchema<T extends z.ZodType>(
19
19
  schema: T,
20
20
  toVerify: unknown,
21
21
  errorMessage: string | ((id: string | undefined) => string),