@prezly/theme-kit-nextjs 4.3.5-alpha.0 → 4.5.0
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 +13 -7
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/api-handlers/fetchGalleries.js +2 -2
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/api-handlers/fetchStories.js +2 -2
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -0
- package/build/adapter-nextjs/api-handlers/index.d.ts +2 -0
- package/build/adapter-nextjs/api-handlers/index.js +8 -0
- package/build/adapter-nextjs/api-handlers/index.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/getNewsroomServerSideProps.d.ts +2 -2
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/getNewsroomServerSideProps.js +2 -2
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/getNewsroomStaticProps.d.ts +2 -2
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/getNewsroomStaticProps.js +2 -2
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -0
- package/build/adapter-nextjs/index.d.ts +6 -0
- package/build/{cjs/server.js → adapter-nextjs/index.js} +7 -8
- package/build/adapter-nextjs/index.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/category.js +10 -10
- package/build/adapter-nextjs/page-props/category.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/gallery.js +8 -8
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/galleryAlbum.js +10 -10
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/home.js +8 -8
- package/build/adapter-nextjs/page-props/home.js.map +1 -0
- package/build/{types/adapter-nextjs → adapter-nextjs}/page-props/index.d.ts +8 -8
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/index.js +24 -24
- package/build/adapter-nextjs/page-props/index.js.map +1 -0
- package/build/adapter-nextjs/page-props/lib/types.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/search.js +8 -8
- package/build/adapter-nextjs/page-props/search.js.map +1 -0
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -0
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/getServerSideProps.js +6 -6
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -0
- package/build/adapter-nextjs/page-props/sitemap/index.d.ts +4 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/index.js +7 -7
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -0
- package/build/adapter-nextjs/page-props/sitemap/types.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/story.js +14 -14
- package/build/adapter-nextjs/page-props/story.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/storyPreview.js +6 -6
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -0
- package/build/{cjs/adapter-nextjs → adapter-nextjs}/processRequest.js +2 -2
- package/build/adapter-nextjs/processRequest.js.map +1 -0
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -0
- package/build/{cjs/components-nextjs → components-nextjs}/PageSeo/PageSeo.js +12 -13
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -0
- package/build/components-nextjs/PageSeo/index.d.ts +1 -0
- package/build/{cjs/components-nextjs → components-nextjs}/PageSeo/index.js +2 -2
- package/build/components-nextjs/PageSeo/index.js.map +1 -0
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -0
- package/build/components-nextjs/PageSeo/lib/index.d.ts +1 -0
- package/build/{cjs/components-nextjs → components-nextjs}/PageSeo/lib/index.js +2 -2
- package/build/components-nextjs/PageSeo/lib/index.js.map +1 -0
- package/build/{cjs/components-nextjs → components-nextjs}/StorySeo/StorySeo.js +0 -1
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -0
- package/build/components-nextjs/StorySeo/index.d.ts +1 -0
- package/build/{cjs/components-nextjs → components-nextjs}/StorySeo/index.js +2 -2
- package/build/components-nextjs/StorySeo/index.js.map +1 -0
- package/build/{cjs/components-nextjs → components-nextjs}/document.js +0 -1
- package/build/components-nextjs/document.js.map +1 -0
- package/build/components-nextjs/index.d.ts +3 -0
- package/build/components-nextjs/index.js +10 -0
- package/build/components-nextjs/index.js.map +1 -0
- package/build/{cjs/data-fetching → data-fetching}/NextPrezlyApi.js +2 -2
- package/build/data-fetching/NextPrezlyApi.js.map +1 -0
- package/build/{cjs/data-fetching → data-fetching}/getNextPrezlyApi.d.ts +1 -1
- package/build/{cjs/data-fetching → data-fetching}/getNextPrezlyApi.js +2 -2
- package/build/data-fetching/getNextPrezlyApi.js.map +1 -0
- package/build/data-fetching/index.d.ts +1 -0
- package/build/{cjs/data-fetching → data-fetching}/index.js +2 -2
- package/build/data-fetching/index.js.map +1 -0
- package/build/index.d.ts +8 -0
- package/build/{cjs/adapter-nextjs/index.js → index.js} +8 -6
- package/build/index.js.map +1 -0
- package/build/{cjs/infinite-loading → infinite-loading}/index.d.ts +4 -4
- package/build/{cjs/infinite-loading → infinite-loading}/index.js +7 -7
- package/build/infinite-loading/index.js.map +1 -0
- package/build/{esm → infinite-loading}/types.js.map +1 -1
- package/build/{cjs/infinite-loading → infinite-loading}/useInfiniteGalleriesLoading.js +2 -2
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -0
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -0
- package/build/{cjs/infinite-loading → infinite-loading}/useInfiniteStoriesLoading.js +4 -4
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -0
- package/build/intl/index.d.ts +2 -0
- package/build/{cjs/intl → intl}/index.js +2 -2
- package/build/intl/index.js.map +1 -0
- package/build/{cjs/intl → intl}/languages.js +2 -2
- package/build/intl/languages.js.map +1 -0
- package/build/intl/locale.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/context.js +0 -1
- package/build/newsroom-context/context.js.map +1 -0
- package/build/newsroom-context/hooks/index.d.ts +11 -0
- package/build/{cjs → newsroom-context/hooks}/index.js +11 -8
- package/build/newsroom-context/hooks/index.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useAlgoliaSettings.js +2 -2
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCategories.js +2 -2
- package/build/newsroom-context/hooks/useCategories.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCompanyInformation.js +2 -2
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCurrentCategory.js +2 -2
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCurrentLocale.js +2 -2
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCurrentStory.js +2 -2
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useGetLinkLocaleSlug.js +4 -4
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useGetTranslationUrl.js +4 -4
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useLanguages.js +2 -2
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useNewsroom.js +2 -2
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -0
- package/build/{cjs/newsroom-context → newsroom-context}/hooks/useNewsroomContext.js +2 -2
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -0
- package/build/newsroom-context/index.d.ts +2 -0
- package/build/{cjs/newsroom-context → newsroom-context}/index.js +4 -4
- package/build/newsroom-context/index.js.map +1 -0
- package/build/{cjs/sentry → sentry}/client.js +2 -2
- package/build/sentry/client.js.map +1 -0
- package/build/{esm/sentry → sentry}/common.js.map +1 -1
- package/build/sentry/index.d.ts +2 -0
- package/build/{cjs/sentry → sentry}/index.js +4 -4
- package/build/sentry/index.js.map +1 -0
- package/build/{cjs/sentry → sentry}/server.js +2 -2
- package/build/sentry/server.js.map +1 -0
- package/build/{cjs/types.d.ts → types.d.ts} +1 -1
- package/build/types.js.map +1 -0
- package/package.json +10 -42
- package/build/cjs/adapter-nextjs/api-handlers/fetchGalleries.js.map +0 -1
- package/build/cjs/adapter-nextjs/api-handlers/fetchStories.js.map +0 -1
- package/build/cjs/adapter-nextjs/api-handlers/index.d.ts +0 -2
- package/build/cjs/adapter-nextjs/api-handlers/index.js +0 -8
- package/build/cjs/adapter-nextjs/api-handlers/index.js.map +0 -1
- package/build/cjs/adapter-nextjs/getNewsroomServerSideProps.js.map +0 -1
- package/build/cjs/adapter-nextjs/getNewsroomStaticProps.js.map +0 -1
- package/build/cjs/adapter-nextjs/index.d.ts +0 -6
- package/build/cjs/adapter-nextjs/index.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/category.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/gallery.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/galleryAlbum.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/home.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/index.d.ts +0 -8
- package/build/cjs/adapter-nextjs/page-props/index.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/lib/types.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/search.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/sitemap/createPaths.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/sitemap/index.d.ts +0 -4
- package/build/cjs/adapter-nextjs/page-props/sitemap/index.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/sitemap/types.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/story.js.map +0 -1
- package/build/cjs/adapter-nextjs/page-props/storyPreview.js.map +0 -1
- package/build/cjs/adapter-nextjs/processRequest.js.map +0 -1
- package/build/cjs/adapter-nextjs/processStaticRequest.js.map +0 -1
- package/build/cjs/client.d.ts +0 -7
- package/build/cjs/client.js +0 -24
- package/build/cjs/client.js.map +0 -1
- package/build/cjs/components-nextjs/PageSeo/PageSeo.js.map +0 -1
- package/build/cjs/components-nextjs/PageSeo/index.d.ts +0 -1
- package/build/cjs/components-nextjs/PageSeo/index.js.map +0 -1
- package/build/cjs/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +0 -1
- package/build/cjs/components-nextjs/PageSeo/lib/index.d.ts +0 -1
- package/build/cjs/components-nextjs/PageSeo/lib/index.js.map +0 -1
- package/build/cjs/components-nextjs/StorySeo/StorySeo.js.map +0 -1
- package/build/cjs/components-nextjs/StorySeo/index.d.ts +0 -1
- package/build/cjs/components-nextjs/StorySeo/index.js.map +0 -1
- package/build/cjs/components-nextjs/document.js.map +0 -1
- package/build/cjs/components-nextjs/index.d.ts +0 -3
- package/build/cjs/components-nextjs/index.js +0 -10
- package/build/cjs/components-nextjs/index.js.map +0 -1
- package/build/cjs/data-fetching/NextPrezlyApi.js.map +0 -1
- package/build/cjs/data-fetching/getNextPrezlyApi.js.map +0 -1
- package/build/cjs/data-fetching/index.d.ts +0 -1
- package/build/cjs/data-fetching/index.js.map +0 -1
- package/build/cjs/i18nConfig.cjs +0 -21
- package/build/cjs/i18nConfig.cjs.map +0 -1
- package/build/cjs/i18nConfig.d.cts +0 -3
- package/build/cjs/index.d.ts +0 -8
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/infinite-loading/index.js.map +0 -1
- package/build/cjs/infinite-loading/types.js.map +0 -1
- package/build/cjs/infinite-loading/useInfiniteGalleriesLoading.js.map +0 -1
- package/build/cjs/infinite-loading/useInfiniteLoading.js.map +0 -1
- package/build/cjs/infinite-loading/useInfiniteStoriesLoading.js.map +0 -1
- package/build/cjs/intl/index.d.ts +0 -2
- package/build/cjs/intl/index.js.map +0 -1
- package/build/cjs/intl/languages.js.map +0 -1
- package/build/cjs/intl/locale.js.map +0 -1
- package/build/cjs/newsroom-context/context.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/index.d.ts +0 -11
- package/build/cjs/newsroom-context/hooks/index.js +0 -28
- package/build/cjs/newsroom-context/hooks/index.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useAlgoliaSettings.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useCategories.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useCompanyInformation.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useCurrentCategory.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useCurrentLocale.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useCurrentStory.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useGetTranslationUrl.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useLanguages.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useNewsroom.js.map +0 -1
- package/build/cjs/newsroom-context/hooks/useNewsroomContext.js.map +0 -1
- package/build/cjs/newsroom-context/index.d.ts +0 -2
- package/build/cjs/newsroom-context/index.js.map +0 -1
- package/build/cjs/sentry/client.js.map +0 -1
- package/build/cjs/sentry/common.js.map +0 -1
- package/build/cjs/sentry/index.d.ts +0 -2
- package/build/cjs/sentry/index.js.map +0 -1
- package/build/cjs/sentry/server.js.map +0 -1
- package/build/cjs/server.d.ts +0 -7
- package/build/cjs/server.js.map +0 -1
- package/build/cjs/types.js.map +0 -1
- package/build/esm/adapter-nextjs/api-handlers/fetchGalleries.js +0 -19
- package/build/esm/adapter-nextjs/api-handlers/fetchGalleries.js.map +0 -1
- package/build/esm/adapter-nextjs/api-handlers/fetchStories.js +0 -29
- package/build/esm/adapter-nextjs/api-handlers/fetchStories.js.map +0 -1
- package/build/esm/adapter-nextjs/api-handlers/index.js +0 -3
- package/build/esm/adapter-nextjs/api-handlers/index.js.map +0 -1
- package/build/esm/adapter-nextjs/getNewsroomServerSideProps.js +0 -15
- package/build/esm/adapter-nextjs/getNewsroomServerSideProps.js.map +0 -1
- package/build/esm/adapter-nextjs/getNewsroomStaticProps.js +0 -15
- package/build/esm/adapter-nextjs/getNewsroomStaticProps.js.map +0 -1
- package/build/esm/adapter-nextjs/index.js +0 -7
- package/build/esm/adapter-nextjs/index.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/category.js +0 -97
- package/build/esm/adapter-nextjs/page-props/category.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/gallery.js +0 -66
- package/build/esm/adapter-nextjs/page-props/gallery.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/galleryAlbum.js +0 -49
- package/build/esm/adapter-nextjs/page-props/galleryAlbum.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/home.js +0 -70
- package/build/esm/adapter-nextjs/page-props/home.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/index.js +0 -9
- package/build/esm/adapter-nextjs/page-props/index.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/lib/types.js +0 -2
- package/build/esm/adapter-nextjs/page-props/lib/types.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/search.js +0 -27
- package/build/esm/adapter-nextjs/page-props/search.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +0 -47
- package/build/esm/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/sitemap/createPaths.js +0 -15
- package/build/esm/adapter-nextjs/page-props/sitemap/createPaths.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/sitemap/getServerSideProps.js +0 -32
- package/build/esm/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/sitemap/index.js +0 -5
- package/build/esm/adapter-nextjs/page-props/sitemap/index.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/sitemap/types.js +0 -2
- package/build/esm/adapter-nextjs/page-props/sitemap/types.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/story.js +0 -63
- package/build/esm/adapter-nextjs/page-props/story.js.map +0 -1
- package/build/esm/adapter-nextjs/page-props/storyPreview.js +0 -22
- package/build/esm/adapter-nextjs/page-props/storyPreview.js.map +0 -1
- package/build/esm/adapter-nextjs/processRequest.js +0 -33
- package/build/esm/adapter-nextjs/processRequest.js.map +0 -1
- package/build/esm/adapter-nextjs/processStaticRequest.js +0 -22
- package/build/esm/adapter-nextjs/processStaticRequest.js.map +0 -1
- package/build/esm/client.js +0 -8
- package/build/esm/client.js.map +0 -1
- package/build/esm/components-nextjs/PageSeo/PageSeo.js +0 -78
- package/build/esm/components-nextjs/PageSeo/PageSeo.js.map +0 -1
- package/build/esm/components-nextjs/PageSeo/index.js +0 -2
- package/build/esm/components-nextjs/PageSeo/index.js.map +0 -1
- package/build/esm/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +0 -7
- package/build/esm/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +0 -1
- package/build/esm/components-nextjs/PageSeo/lib/index.js +0 -2
- package/build/esm/components-nextjs/PageSeo/lib/index.js.map +0 -1
- package/build/esm/components-nextjs/StorySeo/StorySeo.js +0 -53
- package/build/esm/components-nextjs/StorySeo/StorySeo.js.map +0 -1
- package/build/esm/components-nextjs/StorySeo/index.js +0 -2
- package/build/esm/components-nextjs/StorySeo/index.js.map +0 -1
- package/build/esm/components-nextjs/document.js +0 -22
- package/build/esm/components-nextjs/document.js.map +0 -1
- package/build/esm/components-nextjs/index.js +0 -4
- package/build/esm/components-nextjs/index.js.map +0 -1
- package/build/esm/data-fetching/NextPrezlyApi.js +0 -36
- package/build/esm/data-fetching/NextPrezlyApi.js.map +0 -1
- package/build/esm/data-fetching/getNextPrezlyApi.js +0 -17
- package/build/esm/data-fetching/getNextPrezlyApi.js.map +0 -1
- package/build/esm/data-fetching/index.js +0 -2
- package/build/esm/data-fetching/index.js.map +0 -1
- package/build/esm/i18nConfig.cjs +0 -20
- package/build/esm/i18nConfig.cjs.map +0 -1
- package/build/esm/index.js +0 -9
- package/build/esm/index.js.map +0 -1
- package/build/esm/infinite-loading/index.js +0 -5
- package/build/esm/infinite-loading/index.js.map +0 -1
- package/build/esm/infinite-loading/types.js +0 -2
- package/build/esm/infinite-loading/types.js.map +0 -1
- package/build/esm/infinite-loading/useInfiniteGalleriesLoading.js +0 -41
- package/build/esm/infinite-loading/useInfiniteGalleriesLoading.js.map +0 -1
- package/build/esm/infinite-loading/useInfiniteLoading.js +0 -40
- package/build/esm/infinite-loading/useInfiniteLoading.js.map +0 -1
- package/build/esm/infinite-loading/useInfiniteStoriesLoading.js +0 -58
- package/build/esm/infinite-loading/useInfiniteStoriesLoading.js.map +0 -1
- package/build/esm/intl/index.js +0 -3
- package/build/esm/intl/index.js.map +0 -1
- package/build/esm/intl/languages.js +0 -26
- package/build/esm/intl/languages.js.map +0 -1
- package/build/esm/intl/locale.js +0 -25
- package/build/esm/intl/locale.js.map +0 -1
- package/build/esm/newsroom-context/context.js +0 -26
- package/build/esm/newsroom-context/context.js.map +0 -1
- package/build/esm/newsroom-context/hooks/index.js +0 -12
- package/build/esm/newsroom-context/hooks/index.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useAlgoliaSettings.js +0 -6
- package/build/esm/newsroom-context/hooks/useAlgoliaSettings.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useCategories.js +0 -6
- package/build/esm/newsroom-context/hooks/useCategories.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useCompanyInformation.js +0 -6
- package/build/esm/newsroom-context/hooks/useCompanyInformation.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useCurrentCategory.js +0 -6
- package/build/esm/newsroom-context/hooks/useCurrentCategory.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useCurrentLocale.js +0 -6
- package/build/esm/newsroom-context/hooks/useCurrentLocale.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useCurrentStory.js +0 -6
- package/build/esm/newsroom-context/hooks/useCurrentStory.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useGetLinkLocaleSlug.js +0 -25
- package/build/esm/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useGetTranslationUrl.js +0 -71
- package/build/esm/newsroom-context/hooks/useGetTranslationUrl.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useLanguages.js +0 -6
- package/build/esm/newsroom-context/hooks/useLanguages.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useNewsroom.js +0 -6
- package/build/esm/newsroom-context/hooks/useNewsroom.js.map +0 -1
- package/build/esm/newsroom-context/hooks/useNewsroomContext.js +0 -12
- package/build/esm/newsroom-context/hooks/useNewsroomContext.js.map +0 -1
- package/build/esm/newsroom-context/index.js +0 -3
- package/build/esm/newsroom-context/index.js.map +0 -1
- package/build/esm/sentry/client.js +0 -5
- package/build/esm/sentry/client.js.map +0 -1
- package/build/esm/sentry/common.js +0 -62
- package/build/esm/sentry/index.js +0 -3
- package/build/esm/sentry/index.js.map +0 -1
- package/build/esm/sentry/server.js +0 -5
- package/build/esm/sentry/server.js.map +0 -1
- package/build/esm/server.js +0 -8
- package/build/esm/server.js.map +0 -1
- package/build/esm/types.js +0 -2
- package/build/tsconfig.cjs.tsbuildinfo +0 -1
- package/build/tsconfig.esm.tsbuildinfo +0 -1
- package/build/types/adapter-nextjs/api-handlers/fetchGalleries.d.ts +0 -2
- package/build/types/adapter-nextjs/api-handlers/fetchStories.d.ts +0 -2
- package/build/types/adapter-nextjs/api-handlers/index.d.ts +0 -2
- package/build/types/adapter-nextjs/getNewsroomServerSideProps.d.ts +0 -15
- package/build/types/adapter-nextjs/getNewsroomStaticProps.d.ts +0 -15
- package/build/types/adapter-nextjs/index.d.ts +0 -6
- package/build/types/adapter-nextjs/page-props/category.d.ts +0 -16
- package/build/types/adapter-nextjs/page-props/gallery.d.ts +0 -14
- package/build/types/adapter-nextjs/page-props/galleryAlbum.d.ts +0 -9
- package/build/types/adapter-nextjs/page-props/home.d.ts +0 -22
- package/build/types/adapter-nextjs/page-props/lib/types.d.ts +0 -3
- package/build/types/adapter-nextjs/page-props/search.d.ts +0 -4
- package/build/types/adapter-nextjs/page-props/sitemap/SitemapBuilder.d.ts +0 -11
- package/build/types/adapter-nextjs/page-props/sitemap/createPaths.d.ts +0 -2
- package/build/types/adapter-nextjs/page-props/sitemap/getServerSideProps.d.ts +0 -7
- package/build/types/adapter-nextjs/page-props/sitemap/index.d.ts +0 -4
- package/build/types/adapter-nextjs/page-props/sitemap/types.d.ts +0 -5
- package/build/types/adapter-nextjs/page-props/story.d.ts +0 -14
- package/build/types/adapter-nextjs/page-props/storyPreview.d.ts +0 -3
- package/build/types/adapter-nextjs/processRequest.d.ts +0 -12
- package/build/types/adapter-nextjs/processStaticRequest.d.ts +0 -11
- package/build/types/client.d.ts +0 -7
- package/build/types/components-nextjs/PageSeo/PageSeo.d.ts +0 -12
- package/build/types/components-nextjs/PageSeo/index.d.ts +0 -1
- package/build/types/components-nextjs/PageSeo/lib/getAbsoluteUrl.d.ts +0 -1
- package/build/types/components-nextjs/PageSeo/lib/index.d.ts +0 -1
- package/build/types/components-nextjs/StorySeo/StorySeo.d.ts +0 -12
- package/build/types/components-nextjs/StorySeo/index.d.ts +0 -1
- package/build/types/components-nextjs/document.d.ts +0 -6
- package/build/types/components-nextjs/index.d.ts +0 -3
- package/build/types/data-fetching/NextPrezlyApi.d.ts +0 -8
- package/build/types/data-fetching/getNextPrezlyApi.d.ts +0 -4
- package/build/types/data-fetching/index.d.ts +0 -1
- package/build/types/i18nConfig.d.cts +0 -3
- package/build/types/index.d.ts +0 -8
- package/build/types/infinite-loading/index.d.ts +0 -4
- package/build/types/infinite-loading/types.d.ts +0 -9
- package/build/types/infinite-loading/useInfiniteGalleriesLoading.d.ts +0 -13
- package/build/types/infinite-loading/useInfiniteLoading.d.ts +0 -16
- package/build/types/infinite-loading/useInfiniteStoriesLoading.d.ts +0 -13
- package/build/types/intl/index.d.ts +0 -2
- package/build/types/intl/languages.d.ts +0 -6
- package/build/types/intl/locale.d.ts +0 -5
- package/build/types/newsroom-context/context.d.ts +0 -62
- package/build/types/newsroom-context/hooks/index.d.ts +0 -11
- package/build/types/newsroom-context/hooks/useAlgoliaSettings.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useCategories.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useCompanyInformation.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useCurrentCategory.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useCurrentLocale.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useCurrentStory.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useGetLinkLocaleSlug.d.ts +0 -2
- package/build/types/newsroom-context/hooks/useGetTranslationUrl.d.ts +0 -6
- package/build/types/newsroom-context/hooks/useLanguages.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useNewsroom.d.ts +0 -1
- package/build/types/newsroom-context/hooks/useNewsroomContext.d.ts +0 -2
- package/build/types/newsroom-context/index.d.ts +0 -2
- package/build/types/sentry/client.d.ts +0 -2
- package/build/types/sentry/common.d.ts +0 -2
- package/build/types/sentry/index.d.ts +0 -2
- package/build/types/sentry/server.d.ts +0 -2
- package/build/types/server.d.ts +0 -7
- package/build/types/types.d.ts +0 -14
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/api-handlers/fetchGalleries.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/api-handlers/fetchStories.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/category.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/gallery.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/galleryAlbum.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/home.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/lib/types.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/lib/types.js +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/search.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/SitemapBuilder.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/SitemapBuilder.js +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/createPaths.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/createPaths.js +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/getServerSideProps.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/types.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/types.js +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/story.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/storyPreview.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/processRequest.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/processStaticRequest.d.ts +0 -0
- /package/build/{cjs/adapter-nextjs → adapter-nextjs}/processStaticRequest.js +0 -0
- /package/build/{cjs/components-nextjs → components-nextjs}/PageSeo/PageSeo.d.ts +0 -0
- /package/build/{cjs/components-nextjs → components-nextjs}/PageSeo/lib/getAbsoluteUrl.d.ts +0 -0
- /package/build/{cjs/components-nextjs → components-nextjs}/PageSeo/lib/getAbsoluteUrl.js +0 -0
- /package/build/{cjs/components-nextjs → components-nextjs}/StorySeo/StorySeo.d.ts +0 -0
- /package/build/{cjs/components-nextjs → components-nextjs}/document.d.ts +0 -0
- /package/build/{cjs/data-fetching → data-fetching}/NextPrezlyApi.d.ts +0 -0
- /package/build/{cjs/infinite-loading → infinite-loading}/types.d.ts +0 -0
- /package/build/{cjs/infinite-loading → infinite-loading}/types.js +0 -0
- /package/build/{cjs/infinite-loading → infinite-loading}/useInfiniteGalleriesLoading.d.ts +0 -0
- /package/build/{cjs/infinite-loading → infinite-loading}/useInfiniteLoading.d.ts +0 -0
- /package/build/{cjs/infinite-loading → infinite-loading}/useInfiniteLoading.js +0 -0
- /package/build/{cjs/infinite-loading → infinite-loading}/useInfiniteStoriesLoading.d.ts +0 -0
- /package/build/{cjs/intl → intl}/languages.d.ts +0 -0
- /package/build/{cjs/intl → intl}/locale.d.ts +0 -0
- /package/build/{cjs/intl → intl}/locale.js +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/context.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useAlgoliaSettings.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCategories.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCompanyInformation.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCurrentCategory.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCurrentLocale.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useCurrentStory.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useGetLinkLocaleSlug.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useGetTranslationUrl.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useLanguages.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useNewsroom.d.ts +0 -0
- /package/build/{cjs/newsroom-context → newsroom-context}/hooks/useNewsroomContext.d.ts +0 -0
- /package/build/{cjs/sentry → sentry}/client.d.ts +0 -0
- /package/build/{cjs/sentry → sentry}/common.d.ts +0 -0
- /package/build/{cjs/sentry → sentry}/common.js +0 -0
- /package/build/{cjs/sentry → sentry}/server.d.ts +0 -0
- /package/build/{cjs/types.js → types.js} +0 -0
package/build/{cjs/adapter-nextjs → adapter-nextjs}/page-props/sitemap/getServerSideProps.js
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSitemapServerSideProps = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const data_fetching_1 = require("../../../data-fetching");
|
|
5
|
+
const createPaths_1 = require("./createPaths");
|
|
6
|
+
const SitemapBuilder_1 = require("./SitemapBuilder");
|
|
7
7
|
function getSitemapServerSideProps(options = {}) {
|
|
8
8
|
return async function getServerSideProps(ctx) {
|
|
9
9
|
const { res, req } = ctx;
|
|
@@ -14,13 +14,13 @@ function getSitemapServerSideProps(options = {}) {
|
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
const baseUrl = req.headers.host || '/';
|
|
17
|
-
const api = (0,
|
|
17
|
+
const api = (0, data_fetching_1.getNextPrezlyApi)(req);
|
|
18
18
|
const stories = await api.getAllStories({
|
|
19
19
|
pinning: options.pinning ?? false,
|
|
20
20
|
});
|
|
21
21
|
const categories = await api.getCategories();
|
|
22
|
-
const paths = (0,
|
|
23
|
-
const sitemapBuilder = new
|
|
22
|
+
const paths = (0, createPaths_1.createPaths)(stories, categories);
|
|
23
|
+
const sitemapBuilder = new SitemapBuilder_1.SitemapBuilder(baseUrl);
|
|
24
24
|
sitemapBuilder.addUrl('/');
|
|
25
25
|
paths.forEach((path) => sitemapBuilder.addUrl(path));
|
|
26
26
|
options.additionalPaths?.forEach((path) => sitemapBuilder.addUrl(path));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getServerSideProps.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts"],"names":[],"mappings":";;;AAEA,0DAA0D;AAE1D,+CAA4C;AAC5C,qDAAkD;AAElD,SAAgB,yBAAyB,CACrC,UAA6D,EAAE;IAE/D,OAAO,KAAK,UAAU,kBAAkB,CAAC,GAAoB;QACzD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;QAEzB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE;YACd,cAAc;YACd,OAAO;gBACH,KAAK,EAAE,EAAE;aACZ,CAAC;SACL;QAED,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;QAExC,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,GAAG,CAAC,CAAC;QAClC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC;YACpC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;SACpC,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAE7C,MAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC/C,MAAM,cAAc,GAAG,IAAI,+BAAc,CAAC,OAAO,CAAC,CAAC;QAEnD,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAErD,OAAO,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAExE,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QAC1C,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;QACtC,GAAG,CAAC,GAAG,EAAE,CAAC;QAEV,OAAO;YACH,KAAK,EAAE,EAAE;SACZ,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AArCD,8DAqCC"}
|
|
@@ -15,11 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.createPaths = exports.SitemapBuilder = exports.getSitemapServerSideProps = void 0;
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "getSitemapServerSideProps", { enumerable: true, get: function () { return
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "SitemapBuilder", { enumerable: true, get: function () { return
|
|
22
|
-
var
|
|
23
|
-
Object.defineProperty(exports, "createPaths", { enumerable: true, get: function () { return
|
|
24
|
-
__exportStar(require("./types
|
|
18
|
+
var getServerSideProps_1 = require("./getServerSideProps");
|
|
19
|
+
Object.defineProperty(exports, "getSitemapServerSideProps", { enumerable: true, get: function () { return getServerSideProps_1.getSitemapServerSideProps; } });
|
|
20
|
+
var SitemapBuilder_1 = require("./SitemapBuilder");
|
|
21
|
+
Object.defineProperty(exports, "SitemapBuilder", { enumerable: true, get: function () { return SitemapBuilder_1.SitemapBuilder; } });
|
|
22
|
+
var createPaths_1 = require("./createPaths");
|
|
23
|
+
Object.defineProperty(exports, "createPaths", { enumerable: true, get: function () { return createPaths_1.createPaths; } });
|
|
24
|
+
__exportStar(require("./types"), exports);
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAAiE;AAAxD,+HAAA,yBAAyB,OAAA;AAElC,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStoryPageStaticPaths = exports.getStoryPageStaticProps = exports.getStoryPageServerSideProps = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
4
|
+
const data_fetching_1 = require("../../data-fetching");
|
|
5
|
+
const intl_1 = require("../../intl");
|
|
6
|
+
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
7
|
+
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
8
|
+
const processRequest_1 = require("../processRequest");
|
|
9
|
+
const processStaticRequest_1 = require("../processStaticRequest");
|
|
10
10
|
function getStoryPageServerSideProps(customProps) {
|
|
11
11
|
return async function getServerSideProps(context) {
|
|
12
|
-
const api = (0,
|
|
12
|
+
const api = (0, data_fetching_1.getNextPrezlyApi)(context.req);
|
|
13
13
|
const { slug } = context.params;
|
|
14
14
|
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
15
15
|
if (!story) {
|
|
16
16
|
return { notFound: true };
|
|
17
17
|
}
|
|
18
|
-
const { serverSideProps } = await (0,
|
|
18
|
+
const { serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context, { story });
|
|
19
19
|
const { locale } = context;
|
|
20
|
-
if (locale && locale !==
|
|
20
|
+
if (locale && locale !== intl_1.DUMMY_DEFAULT_LOCALE) {
|
|
21
21
|
return {
|
|
22
22
|
redirect: {
|
|
23
23
|
destination: `/${slug}`,
|
|
@@ -26,7 +26,7 @@ function getStoryPageServerSideProps(customProps) {
|
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
28
|
serverSideProps.newsroomContextProps.currentStory = story;
|
|
29
|
-
return (0,
|
|
29
|
+
return (0, processRequest_1.processRequest)(context, {
|
|
30
30
|
...serverSideProps,
|
|
31
31
|
...(typeof customProps === 'function'
|
|
32
32
|
? await customProps(context, serverSideProps)
|
|
@@ -37,15 +37,15 @@ function getStoryPageServerSideProps(customProps) {
|
|
|
37
37
|
exports.getStoryPageServerSideProps = getStoryPageServerSideProps;
|
|
38
38
|
function getStoryPageStaticProps(customProps) {
|
|
39
39
|
return async function getStaticProps(context) {
|
|
40
|
-
const api = (0,
|
|
40
|
+
const api = (0, data_fetching_1.getNextPrezlyApi)();
|
|
41
41
|
const { slug } = context.params;
|
|
42
42
|
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
43
43
|
if (!story) {
|
|
44
44
|
return { notFound: true };
|
|
45
45
|
}
|
|
46
|
-
const { staticProps } = await (0,
|
|
46
|
+
const { staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context, { story });
|
|
47
47
|
staticProps.newsroomContextProps.currentStory = story;
|
|
48
|
-
return (0,
|
|
48
|
+
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
49
49
|
...staticProps,
|
|
50
50
|
...(typeof customProps === 'function'
|
|
51
51
|
? await customProps(context, staticProps)
|
|
@@ -55,7 +55,7 @@ function getStoryPageStaticProps(customProps) {
|
|
|
55
55
|
}
|
|
56
56
|
exports.getStoryPageStaticProps = getStoryPageStaticProps;
|
|
57
57
|
async function getStoryPageStaticPaths(options = {}) {
|
|
58
|
-
const api = (0,
|
|
58
|
+
const api = (0, data_fetching_1.getNextPrezlyApi)();
|
|
59
59
|
const stories = await api.getAllStories({
|
|
60
60
|
pinning: options.pinning ?? false,
|
|
61
61
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/story.ts"],"names":[],"mappings":";;;AAOA,uDAAuD;AACvD,qCAAkD;AAClD,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAI/D,SAAgB,2BAA2B,CACvC,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAE1C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA2B,CAAC;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7B;QAED,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAC3B,IAAI,MAAM,IAAI,MAAM,KAAK,2BAAoB,EAAE;YAC3C,OAAO;gBACH,QAAQ,EAAE;oBACN,WAAW,EAAE,IAAI,IAAI,EAAE;oBACvB,SAAS,EAAE,IAAI;iBAClB;aACJ,CAAC;SACL;QAED,eAAe,CAAC,oBAAoB,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1D,OAAO,IAAA,+BAAc,EAAC,OAAO,EAAE;YAC3B,GAAG,e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,CAAC;IAEH,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAEhE,OAAO;QACH,KAAK;QACL,QAAQ,EAAE,UAAU;KACvB,CAAC;AACN,CAAC;AAZD,0DAYC"}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStoryPreviewPageServerSideProps = void 0;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
4
|
+
const data_fetching_1 = require("../../data-fetching");
|
|
5
|
+
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
6
|
+
const processRequest_1 = require("../processRequest");
|
|
7
7
|
function getStoryPreviewPageServerSideProps(customProps) {
|
|
8
8
|
return async function getServerSideProps(context) {
|
|
9
|
-
const api = (0,
|
|
9
|
+
const api = (0, data_fetching_1.getNextPrezlyApi)(context.req);
|
|
10
10
|
const { uuid } = context.params;
|
|
11
11
|
const story = await api.getStory(uuid);
|
|
12
12
|
if (!story) {
|
|
13
13
|
return { notFound: true };
|
|
14
14
|
}
|
|
15
|
-
const { serverSideProps } = await (0,
|
|
15
|
+
const { serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context, { story });
|
|
16
16
|
serverSideProps.newsroomContextProps.currentStory = story;
|
|
17
|
-
return (0,
|
|
17
|
+
return (0, processRequest_1.processRequest)(context, {
|
|
18
18
|
...serverSideProps,
|
|
19
19
|
...(typeof customProps === 'function'
|
|
20
20
|
? await customProps(context, serverSideProps)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":";;;AAEA,uDAAuD;AACvD,8EAA2E;AAC3E,sDAAmD;AAInD,SAAgB,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA0B,CAAC;QACpD,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7B;QAED,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjF,eAAe,CAAC,oBAAoB,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1D,OAAO,IAAA,+BAAc,EAAC,OAAO,EAAE;YAC3B,GAAG,eAAe;YAClB,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAA0C,CAAC,OAAO,EAAE,eAAe,CAAC;gBAC7E,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAxBD,gFAwBC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processRequest = void 0;
|
|
4
4
|
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const
|
|
5
|
+
const intl_1 = require("../intl");
|
|
6
6
|
/**
|
|
7
7
|
* This function combines the props returned from `getNewsroomServerSideProps` and your optional custom props for the page.
|
|
8
8
|
* It also handles locale redirects, if `canonicalUrl` parameter is provided.
|
|
@@ -24,7 +24,7 @@ function processRequest(context, props, canonicalUrl) {
|
|
|
24
24
|
const { languages, localeCode } = pageProps.newsroomContextProps;
|
|
25
25
|
const currentLocale = theme_kit_core_1.LocaleObject.fromAnyCode(localeCode);
|
|
26
26
|
const shortestLocaleCode = (0, theme_kit_core_1.getShortestLocaleCode)(languages, currentLocale);
|
|
27
|
-
const redirect = (0,
|
|
27
|
+
const redirect = (0, intl_1.getRedirectToCanonicalLocale)(shortestLocaleCode, nextLocale, canonicalUrl, query);
|
|
28
28
|
if (redirect) {
|
|
29
29
|
return { redirect };
|
|
30
30
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":";;;AAAA,2DAA6E;AAG7E,kCAAuD;AAGvD;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC1B,OAAkC,EAClC,KAA8C,EAC9C,YAAqB;IAErB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAE9C,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,2GAA2G;IAC3G,uCAAuC;IACvC,IAAI,CAAC,cAAc,IAAI,UAAU,EAAE;QAC/B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC7B;IAED,IAAI,YAAY,EAAE;QACd,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC,oBAAoB,CAAC;QACjE,MAAM,aAAa,GAAG,6BAAY,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC3D,MAAM,kBAAkB,GAAG,IAAA,sCAAqB,EAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAE3E,MAAM,QAAQ,GAAG,IAAA,mCAA4B,EACzC,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,KAAK,CACR,CAAC;QACF,IAAI,QAAQ,EAAE;YACV,OAAO,EAAE,QAAQ,EAAE,CAAC;SACvB;KACJ;IAED,OAAO;QACH,KAAK,EAAE,SAA8B;KACxC,CAAC;AACN,CAAC;AAlCD,wCAkCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"processStaticRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processStaticRequest.ts"],"names":[],"mappings":";;;AAIA;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAChC,OAA8B,EAC9B,KAA8C,EAC9C,iBAA0B;IAE1B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,2GAA2G;IAC3G,uCAAuC;IACvC,IAAI,CAAC,cAAc,IAAI,UAAU,EAAE;QAC/B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC7B;IAED,OAAO;QACH,KAAK,EAAE,SAA8B;QACrC,UAAU,EAAE,iBAAiB;KAChC,CAAC;AACN,CAAC;AAnBD,oDAmBC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
'use client';
|
|
3
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
3
|
exports.PageSeo = void 0;
|
|
5
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -7,21 +6,21 @@ const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
|
7
6
|
const router_1 = require("next/router");
|
|
8
7
|
const next_seo_1 = require("next-seo");
|
|
9
8
|
const react_1 = require("react");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
9
|
+
const newsroom_context_1 = require("../../newsroom-context");
|
|
10
|
+
const lib_1 = require("./lib");
|
|
12
11
|
/**
|
|
13
12
|
* This component provides base page attributes for every Newsroom page.
|
|
14
13
|
* It depends on information from NewsroomContext, so the component should be placed inside the `NewsroomContextProvider`.
|
|
15
14
|
* You can pass additional props expected by NextSeo component to override any info that is provided by the NewsroomContext.
|
|
16
15
|
*/
|
|
17
16
|
function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter, ...nextSeoProps }) {
|
|
18
|
-
const companyInformation = (0,
|
|
19
|
-
const site = (0,
|
|
20
|
-
const currentLocale = (0,
|
|
21
|
-
const languages = (0,
|
|
22
|
-
const getTranslationUrl = (0,
|
|
23
|
-
const getLinkLocaleSlug = (0,
|
|
24
|
-
const currentStory = (0,
|
|
17
|
+
const companyInformation = (0, newsroom_context_1.useCompanyInformation)();
|
|
18
|
+
const site = (0, newsroom_context_1.useNewsroom)();
|
|
19
|
+
const currentLocale = (0, newsroom_context_1.useCurrentLocale)();
|
|
20
|
+
const languages = (0, newsroom_context_1.useLanguages)();
|
|
21
|
+
const getTranslationUrl = (0, newsroom_context_1.useGetTranslationUrl)();
|
|
22
|
+
const getLinkLocaleSlug = (0, newsroom_context_1.useGetLinkLocaleSlug)();
|
|
23
|
+
const currentStory = (0, newsroom_context_1.useCurrentStory)();
|
|
25
24
|
const { asPath } = (0, router_1.useRouter)();
|
|
26
25
|
const pageTitle = companyInformation.seo_settings.meta_title ||
|
|
27
26
|
companyInformation.seo_settings.default_meta_title ||
|
|
@@ -31,7 +30,7 @@ function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter,
|
|
|
31
30
|
companyInformation.seo_settings.default_meta_description ||
|
|
32
31
|
description ||
|
|
33
32
|
companyInformation.about_plaintext;
|
|
34
|
-
const canonicalUrl = canonical || (0,
|
|
33
|
+
const canonicalUrl = canonical || (0, lib_1.getAbsoluteUrl)(asPath, site.url, getLinkLocaleSlug(currentLocale));
|
|
35
34
|
const siteName = companyInformation.name;
|
|
36
35
|
const logoUrl = imageUrl || (0, theme_kit_core_1.getNewsroomLogoUrl)(site);
|
|
37
36
|
const alternateLanguageLinks = (0, react_1.useMemo)(() => {
|
|
@@ -44,7 +43,7 @@ function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter,
|
|
|
44
43
|
if (!translationUrl) {
|
|
45
44
|
return undefined;
|
|
46
45
|
}
|
|
47
|
-
return (0,
|
|
46
|
+
return (0, lib_1.getAbsoluteUrl)(translationUrl, site.url, currentStory && translationUrl !== '/' ? false : getLinkLocaleSlug(locale));
|
|
48
47
|
});
|
|
49
48
|
}, [currentStory, getLinkLocaleSlug, getTranslationUrl, languages, site.url]);
|
|
50
49
|
return ((0, jsx_runtime_1.jsx)(next_seo_1.NextSeo, { title: pageTitle, description: pageDescription, canonical: canonicalUrl, noindex: nextSeoProps.noindex ?? !site.is_indexable, nofollow: nextSeoProps.nofollow ?? !site.is_indexable, openGraph: {
|
|
@@ -74,7 +73,7 @@ function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter,
|
|
|
74
73
|
{
|
|
75
74
|
rel: 'alternate',
|
|
76
75
|
type: 'application/rss+xml',
|
|
77
|
-
href: (0,
|
|
76
|
+
href: (0, lib_1.getAbsoluteUrl)('/feed', site.url),
|
|
78
77
|
},
|
|
79
78
|
], languageAlternates: alternateLanguageLinks, ...nextSeoProps }));
|
|
80
79
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PageSeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/PageSeo.tsx"],"names":[],"mappings":";;;;AAAA,2DAIgC;AAEhC,wCAAwC;AACxC,uCAAmC;AAEnC,iCAAgC;AAEhC,6DAQgC;AAEhC,+BAAuC;AAMvC;;;;GAIG;AACH,SAAgB,OAAO,CAAC,EACpB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,GAAG,YAAY,EACX;IACJ,MAAM,kBAAkB,GAAG,IAAA,wCAAqB,GAAE,CAAC;IACnD,MAAM,IAAI,GAAG,IAAA,8BAAW,GAAE,CAAC;IAC3B,MAAM,aAAa,GAAG,IAAA,mCAAgB,GAAE,CAAC;IACzC,MAAM,SAAS,GAAG,IAAA,+BAAY,GAAE,CAAC;IACjC,MAAM,iBAAiB,GAAG,IAAA,uCAAoB,GAAE,CAAC;IACjD,MAAM,iBAAiB,GAAG,IAAA,uCAAoB,GAAE,CAAC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C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { PageSeo } from './PageSeo';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PageSeo = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "PageSeo", { enumerable: true, get: function () { return
|
|
4
|
+
var PageSeo_1 = require("./PageSeo");
|
|
5
|
+
Object.defineProperty(exports, "PageSeo", { enumerable: true, get: function () { return PageSeo_1.PageSeo; } });
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAbsoluteUrl.js","sourceRoot":"","sources":["../../../../src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts"],"names":[],"mappings":";;;AAAA,0EAA0E;AAC1E,SAAgB,cAAc,CAAC,IAAY,EAAE,MAAc,EAAE,UAA2B;IACpF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IACnF,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAEhB,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AALD,wCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getAbsoluteUrl } from './getAbsoluteUrl';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getAbsoluteUrl = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "getAbsoluteUrl", { enumerable: true, get: function () { return
|
|
4
|
+
var getAbsoluteUrl_1 = require("./getAbsoluteUrl");
|
|
5
|
+
Object.defineProperty(exports, "getAbsoluteUrl", { enumerable: true, get: function () { return getAbsoluteUrl_1.getAbsoluteUrl; } });
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components-nextjs/PageSeo/lib/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StorySeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/StorySeo/StorySeo.tsx"],"names":[],"mappings":";;;;AACA,qCAAoC;AACpC,uCAAkD;AAOlD;;;GAGG;AACH,SAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,OAAO,EAAS;IAC9C,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAE/F,MAAM,UAAU,GAAG,MAAM,EAAE,YAAY,IAAI,MAAM,EAAE,KAAK,IAAI,SAAS,CAAC;IACtE,MAAM,QAAQ,GACV,KAAK,CAAC,YAAY,CAAC,UAAU,IAAI,KAAK,CAAC,YAAY,CAAC,kBAAkB,IAAI,KAAK,CAAC;IACpF,MAAM,cAAc,GAChB,KAAK,CAAC,YAAY,CAAC,gBAAgB;QACnC,KAAK,CAAC,YAAY,CAAC,wBAAwB;QAC3C,QAAQ;QACR,OAAO,CAAC;IACZ,MAAM,SAAS,GAAG,KAAK,CAAC,YAAY,CAAC,aAAa,IAAI,MAAM,CAAC,GAAG,CAAC;IACjE,MAAM,SAAS,GAAG,QAAQ,CAAC,YAAY,IAAI,KAAK,CAAC,UAAU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MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,EAC1D,aAAa,EAAE,YAAY,IAAI,EAAE,EACjC,YAAY,EAAE,UAAU,EACxB,UAAU,EAAE,CAAC,UAAU,CAAC,EACxB,aAAa,EAAE,QAAQ,CAAC,YAAY,EACpC,aAAa,EAAE,QAAQ,CAAC,aAAa,EACrC,WAAW,EAAE,cAAc,GAC7B,IACH,CACN,CAAC;AACN,CAAC;AAzED,4BAyEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StorySeo } from './StorySeo';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StorySeo = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "StorySeo", { enumerable: true, get: function () { return
|
|
4
|
+
var StorySeo_1 = require("./StorySeo");
|
|
5
|
+
Object.defineProperty(exports, "StorySeo", { enumerable: true, get: function () { return StorySeo_1.StorySeo; } });
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components-nextjs/StorySeo/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/components-nextjs/document.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAA0F;AAC1F,0DAAuE;AAIvE,MAAa,mBAAoB,SAAQ,kBAAQ;IAC7C,aAAa;QACT,MAAM,EACF,oBAAoB;QACpB,gDAAgD;UACnD,GAAG,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,KAAK,CAAC,SAAsB,CAAC;QAE1D,oFAAoF;QACpF,kEAAkE;QAClE,MAAM,EAAE,UAAU,EAAE,GAAG,oBAAoB,IAAI,EAAE,UAAU,EAAE,+BAAc,EAAE,CAAC;QAE9E,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,MAAM;QACF,MAAM,MAAM,GAAG,6BAAY,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC9D,6DAA6D;QAC7D,MAAM,SAAS,GAAG,IAAA,mCAAkB,EAAC,MAAM,CAAC,CAAC;QAE7C,OAAO,CACH,wBAAC,eAAI,IAAC,IAAI,EAAE,MAAM,CAAC,YAAY,EAAE,EAAE,GAAG,EAAE,SAAS,aAC7C,uBAAC,eAAI,cACD,iCAAM,IAAI,EAAC,WAAW,EAAC,OAAO,EAAE,MAAM,CAAC,YAAY,EAAE,GAAI,GACtD,EACP,6CACI,uBAAC,eAAI,KAAG,EACR,uBAAC,qBAAU,KAAG,IACX,IACJ,CACV,CAAC;IACN,CAAC;CACJ;AA/BD,kDA+BC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PrezlyThemeDocument = exports.StorySeo = exports.PageSeo = void 0;
|
|
4
|
+
var PageSeo_1 = require("./PageSeo");
|
|
5
|
+
Object.defineProperty(exports, "PageSeo", { enumerable: true, get: function () { return PageSeo_1.PageSeo; } });
|
|
6
|
+
var StorySeo_1 = require("./StorySeo");
|
|
7
|
+
Object.defineProperty(exports, "StorySeo", { enumerable: true, get: function () { return StorySeo_1.StorySeo; } });
|
|
8
|
+
var document_1 = require("./document");
|
|
9
|
+
Object.defineProperty(exports, "PrezlyThemeDocument", { enumerable: true, get: function () { return document_1.PrezlyThemeDocument; } });
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/components-nextjs/index.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA;AACjB,uCAAiD;AAAxC,+GAAA,mBAAmB,OAAA"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NextPrezlyApi = void 0;
|
|
4
4
|
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const
|
|
5
|
+
const intl_1 = require("../intl");
|
|
6
6
|
class NextPrezlyApi extends theme_kit_core_1.PrezlyApi {
|
|
7
7
|
async getNewsroomServerSideProps(request, nextLocaleIsoCode, story) {
|
|
8
8
|
const [newsroom, languages, categories, themePreset] = await Promise.all([
|
|
@@ -13,7 +13,7 @@ class NextPrezlyApi extends theme_kit_core_1.PrezlyApi {
|
|
|
13
13
|
]);
|
|
14
14
|
const currentLanguage = story
|
|
15
15
|
? (0, theme_kit_core_1.getLanguageFromStory)(languages, story)
|
|
16
|
-
: (0,
|
|
16
|
+
: (0, intl_1.getLanguageFromNextLocaleIsoCode)(languages, nextLocaleIsoCode);
|
|
17
17
|
const defaultLanguage = (0, theme_kit_core_1.getDefaultLanguage)(languages);
|
|
18
18
|
const { code: localeCode } = currentLanguage || defaultLanguage;
|
|
19
19
|
const locale = theme_kit_core_1.LocaleObject.fromAnyCode(localeCode);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NextPrezlyApi.js","sourceRoot":"","sources":["../../src/data-fetching/NextPrezlyApi.ts"],"names":[],"mappings":";;;AACA,2DAQgC;AAGhC,kCAA2D;AAG3D,MAAa,aAAc,SAAQ,0BAAS;IACxC,KAAK,CAAC,0BAA0B,CAC5B,OAAyB,EACzB,iBAA0B,EAC1B,KAAa;QAEb,MAAM,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACrE,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,aAAa,EAAE;YACpB,IAAI,CAAC,cAAc,EAAE;SACxB,CAAC,CAAC;QAEH,MAAM,eAAe,GAAG,KAAK;YACzB,CAAC,CAAC,IAAA,qCAAoB,EAAC,SAAS,EAAE,KAAK,CAAC;YACxC,CAAC,CAAC,IAAA,uCAAgC,EAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;QACrE,MAAM,eAAe,GAAG,IAAA,mCAAkB,EAAC,SAAS,CAAC,CAAC;QAEtD,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,eAAe,IAAI,eAAe,CAAC;QAChE,MAAM,MAAM,GAAG,6BAAY,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAEpD,6FAA6F;QAC7F,MAAM,kBAAkB,GAAG,IAAA,sCAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAEpE,MAAM,aAAa,GAAG,IAAA,iCAAgB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAC1D,MAAM,eAAe,GAAG,IAAA,mCAAkB,EAAC,OAAO,CAAC,CAAC;QAEpD,OAAO;YACH,oBAAoB,EAAE;gBAClB,QAAQ;gBACR,kBAAkB;gBAClB,UAAU;gBACV,SAAS;gBACT,UAAU;gBACV,aAAa;gBACb,WAAW;gBACX,eAAe;aAClB;YACD,cAAc,EAAE,OAAO,CAAC,eAAe,CAAC;SAC3C,CAAC;IACN,CAAC;CACJ;AAzCD,sCAyCC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNextPrezlyApi = void 0;
|
|
4
4
|
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const
|
|
5
|
+
const NextPrezlyApi_1 = require("./NextPrezlyApi");
|
|
6
6
|
function getNextPrezlyApi(req) {
|
|
7
7
|
if (typeof window !== 'undefined') {
|
|
8
8
|
throw new Error('"getNextPrezlyApi" should only be used on back-end side.');
|
|
@@ -15,7 +15,7 @@ function getNextPrezlyApi(req) {
|
|
|
15
15
|
if (!PREZLY_NEWSROOM_UUID) {
|
|
16
16
|
throw new Error('"PREZLY_NEWSROOM_UUID" is not set in env variables.');
|
|
17
17
|
}
|
|
18
|
-
return new
|
|
18
|
+
return new NextPrezlyApi_1.NextPrezlyApi(PREZLY_ACCESS_TOKEN, PREZLY_NEWSROOM_UUID, PREZLY_THEME_UUID);
|
|
19
19
|
}
|
|
20
20
|
exports.getNextPrezlyApi = getNextPrezlyApi;
|
|
21
21
|
//# sourceMappingURL=getNextPrezlyApi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNextPrezlyApi.js","sourceRoot":"","sources":["../../src/data-fetching/getNextPrezlyApi.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAGzD,mDAAgD;AAEhD,SAAgB,gBAAgB,CAAC,GAAqB;IAClD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;KAC/E;IAED,mFAAmF;IACnF,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,GAAG,IAAA,gCAAe,EAAC,GAAG,CAAC,CAAC;IAE9F,IAAI,CAAC,mBAAmB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;KACzE;IAED,IAAI,CAAC,oBAAoB,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KAC1E;IAED,OAAO,IAAI,6BAAa,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;AAC3F,CAAC;AAjBD,4CAiBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getNextPrezlyApi } from './getNextPrezlyApi';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNextPrezlyApi = void 0;
|
|
4
|
-
var
|
|
5
|
-
Object.defineProperty(exports, "getNextPrezlyApi", { enumerable: true, get: function () { return
|
|
4
|
+
var getNextPrezlyApi_1 = require("./getNextPrezlyApi");
|
|
5
|
+
Object.defineProperty(exports, "getNextPrezlyApi", { enumerable: true, get: function () { return getNextPrezlyApi_1.getNextPrezlyApi; } });
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/data-fetching/index.ts"],"names":[],"mappings":";;;AAAA,uDAAsD;AAA7C,oHAAA,gBAAgB,OAAA"}
|
package/build/index.d.ts
ADDED
|
@@ -14,10 +14,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./
|
|
20
|
-
__exportStar(require("./
|
|
21
|
-
__exportStar(require("./
|
|
22
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./adapter-nextjs"), exports);
|
|
18
|
+
__exportStar(require("./components-nextjs"), exports);
|
|
19
|
+
__exportStar(require("./data-fetching"), exports);
|
|
20
|
+
__exportStar(require("./infinite-loading"), exports);
|
|
21
|
+
__exportStar(require("./intl"), exports);
|
|
22
|
+
__exportStar(require("./newsroom-context"), exports);
|
|
23
|
+
__exportStar(require("./sentry"), exports);
|
|
24
|
+
__exportStar(require("./types"), exports);
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,qDAAmC;AACnC,yCAAuB;AACvB,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useInfiniteLoading } from './useInfiniteLoading
|
|
2
|
-
export { useInfiniteStoriesLoading } from './useInfiniteStoriesLoading
|
|
3
|
-
export { useInfiniteGalleriesLoading } from './useInfiniteGalleriesLoading
|
|
4
|
-
export * from './types
|
|
1
|
+
export { useInfiniteLoading } from './useInfiniteLoading';
|
|
2
|
+
export { useInfiniteStoriesLoading } from './useInfiniteStoriesLoading';
|
|
3
|
+
export { useInfiniteGalleriesLoading } from './useInfiniteGalleriesLoading';
|
|
4
|
+
export * from './types';
|
|
@@ -15,11 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.useInfiniteGalleriesLoading = exports.useInfiniteStoriesLoading = exports.useInfiniteLoading = void 0;
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "useInfiniteLoading", { enumerable: true, get: function () { return
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "useInfiniteStoriesLoading", { enumerable: true, get: function () { return
|
|
22
|
-
var
|
|
23
|
-
Object.defineProperty(exports, "useInfiniteGalleriesLoading", { enumerable: true, get: function () { return
|
|
24
|
-
__exportStar(require("./types
|
|
18
|
+
var useInfiniteLoading_1 = require("./useInfiniteLoading");
|
|
19
|
+
Object.defineProperty(exports, "useInfiniteLoading", { enumerable: true, get: function () { return useInfiniteLoading_1.useInfiniteLoading; } });
|
|
20
|
+
var useInfiniteStoriesLoading_1 = require("./useInfiniteStoriesLoading");
|
|
21
|
+
Object.defineProperty(exports, "useInfiniteStoriesLoading", { enumerable: true, get: function () { return useInfiniteStoriesLoading_1.useInfiniteStoriesLoading; } });
|
|
22
|
+
var useInfiniteGalleriesLoading_1 = require("./useInfiniteGalleriesLoading");
|
|
23
|
+
Object.defineProperty(exports, "useInfiniteGalleriesLoading", { enumerable: true, get: function () { return useInfiniteGalleriesLoading_1.useInfiniteGalleriesLoading; } });
|
|
24
|
+
__exportStar(require("./types"), exports);
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/infinite-loading/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA;AAC3B,yEAAwE;AAA/D,sIAAA,yBAAyB,OAAA;AAClC,6EAA4E;AAAnE,0IAAA,2BAA2B,OAAA;AACpC,0CAAwB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/infinite-loading/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useInfiniteGalleriesLoading = void 0;
|
|
4
|
-
const
|
|
4
|
+
const useInfiniteLoading_1 = require("./useInfiniteLoading");
|
|
5
5
|
async function fetchGalleries(page, pageSize) {
|
|
6
6
|
const result = await fetch('/api/fetch-galleries', {
|
|
7
7
|
method: 'POST',
|
|
@@ -26,7 +26,7 @@ async function fetchGalleries(page, pageSize) {
|
|
|
26
26
|
* See https://github.com/prezly/theme-nextjs-bea/blob/d381e9878187ca98815d240d3ffdf10a75993c14/pages/media/index.tsx#L23 for usage example
|
|
27
27
|
*/
|
|
28
28
|
function useInfiniteGalleriesLoading(initialGalleries, pagination) {
|
|
29
|
-
const { canLoadMore, data, isLoading, loadMore } = (0,
|
|
29
|
+
const { canLoadMore, data, isLoading, loadMore } = (0, useInfiniteLoading_1.useInfiniteLoading)({
|
|
30
30
|
fetchingFn: async (nextPage, pageSize) => {
|
|
31
31
|
const { galleries } = await fetchGalleries(nextPage, pageSize);
|
|
32
32
|
return galleries;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInfiniteGalleriesLoading.js","sourceRoot":"","sources":["../../src/infinite-loading/useInfiniteGalleriesLoading.ts"],"names":[],"mappings":";;;AAGA,6DAA0D;AAE1D,KAAK,UAAU,cAAc,CACzB,IAAY,EACZ,QAAgB;IAEhB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,sBAAsB,EAAE;QAC/C,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACL,gEAAgE;YAChE,cAAc,EAAE,kBAAkB;SACrC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACjB,IAAI;YACJ,QAAQ;SACX,CAAC;KACL,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;QACZ,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;KAC5B;IAED,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,SAAgB,2BAA2B,CACvC,gBAAmC,EACnC,UAA2B;IAE3B,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,IAAA,uCAAkB,EAAkB;QACnF,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;YACrC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC/D,OAAO,SAAS,CAAC;QACrB,CAAC;QACD,WAAW,EAAE,gBAAgB;QAC7B,UAAU;KACb,CAAC,CAAC;IAEH,OAAO;QACH,WAAW;QACX,SAA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AC;IAEH,MAAM,QAAQ,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC9B,IAAI,WAAW,EAAE;YACb,UAAU,EAAE,CAAC;SAChB;IACL,CAAC,EAAE,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;IAE9B,MAAM,SAAS,GAAG,IAAA,mBAAW,EAAC,GAAG,EAAE;QAC/B,OAAO,CAAC,WAAW,CAAC,CAAC;QACrB,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC3C,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;IAE1C,IAAA,iBAAS,EAAC,GAAG,EAAE;QACX,IAAI,KAAK,EAAE;YACP,sCAAsC;YACtC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;IACL,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;IAEZ,OAAO;QACH,WAAW;QACX,WAAW;QACX,IAAI;QACJ,SAAS,EAAE,MAAM,KAAK,SAAS;QAC/B,QAAQ;QACR,SAAS;KACZ,CAAC;AACN,CAAC;AA9CD,gDA8CC"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useInfiniteStoriesLoading = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const newsroom_context_1 = require("../newsroom-context");
|
|
6
|
+
const useInfiniteLoading_1 = require("./useInfiniteLoading");
|
|
7
7
|
async function fetchStories(page, pageSize, withHighlightedStory, category, locale, include, pinning, filterQuery) {
|
|
8
8
|
const result = await fetch('/api/fetch-stories', {
|
|
9
9
|
method: 'POST',
|
|
@@ -36,9 +36,9 @@ async function fetchStories(page, pageSize, withHighlightedStory, category, loca
|
|
|
36
36
|
* See https://github.com/prezly/theme-nextjs-bea/blob/d381e9878187ca98815d240d3ffdf10a75993c14/pages/index.tsx#L24 for usage example
|
|
37
37
|
*/
|
|
38
38
|
function useInfiniteStoriesLoading(initialStories, pagination, category, include, pinning, filterQuery) {
|
|
39
|
-
const currentLocale = (0,
|
|
39
|
+
const currentLocale = (0, newsroom_context_1.useCurrentLocale)();
|
|
40
40
|
const { withHighlightedStory = false } = pagination;
|
|
41
|
-
const { canLoadMore, data, isLoading, loadMore, resetData } = (0,
|
|
41
|
+
const { canLoadMore, data, isLoading, loadMore, resetData } = (0, useInfiniteLoading_1.useInfiniteLoading)({
|
|
42
42
|
fetchingFn: async (nextPage, pageSize) => {
|
|
43
43
|
const { stories } = await fetchStories(nextPage, pageSize, withHighlightedStory, category, currentLocale, include, pinning, filterQuery);
|
|
44
44
|
return stories;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useInfiniteStoriesLoading.js","sourceRoot":"","sources":["../../src/infinite-loading/useInfiniteStoriesLoading.ts"],"names":[],"mappings":";;;AAEA,iCAAkC;AAElC,0DAAuD;AAGvD,6DAA0D;AAE1D,KAAK,UAAU,YAAY,CACvB,IAAY,EACZ,QAAgB,EAChB,oBAA6B,EAC7B,QAAmB,EACnB,MAAqB,EACrB,OAAqC,EACrC,OAAiB,EACjB,WAAoB;IAEpB,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,oBAAoB,EAAE;QAC7C,MAAM,EAAE,MAAM;QACd,OAAO,EAAE;YACL,gEAAgE;YAChE,cAAc,EAAE,kBAAkB;SACrC;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACjB,IAAI;YACJ,QAAQ;YACR,oBAAoB;YACpB,QAAQ;YACR,OAAO;YACP,OAAO;YACP,GAAG,CAAC,MAAM,IAAI;gBACV,UAAU,EAAE,MAAM,CAAC,gBAAgB,EAAE;aACxC,CAAC;YACF,WAAW;SACd,CAAC;KACL,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE;QACZ,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,MAAM,CAAC,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