@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
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_PAGE_SIZE, getLocalizedCategoryData, LocaleObject } from '@prezly/theme-kit-core';
|
|
2
|
-
import { getNextPrezlyApi } from '../../data-fetching/index.js';
|
|
3
|
-
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps.js';
|
|
4
|
-
import { getNewsroomStaticProps } from '../getNewsroomStaticProps.js';
|
|
5
|
-
import { processRequest } from '../processRequest.js';
|
|
6
|
-
import { processStaticRequest } from '../processStaticRequest.js';
|
|
7
|
-
export function getCategoryPageServerSideProps(customProps, options) {
|
|
8
|
-
const { pageSize = DEFAULT_PAGE_SIZE, extraStoryFields } = options || {};
|
|
9
|
-
return async function getServerSideProps(context) {
|
|
10
|
-
const { api, serverSideProps } = await getNewsroomServerSideProps(context);
|
|
11
|
-
const { slug } = context.params;
|
|
12
|
-
const category = await api.getCategoryBySlug(slug);
|
|
13
|
-
if (!category) {
|
|
14
|
-
return {
|
|
15
|
-
notFound: true,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
const { query } = context;
|
|
19
|
-
const page = query.page && typeof query.page === 'string' ? Number(query.page) : undefined;
|
|
20
|
-
const { localeCode } = serverSideProps.newsroomContextProps;
|
|
21
|
-
const { stories, storiesTotal } = await api.getStoriesFromCategory(category, {
|
|
22
|
-
page,
|
|
23
|
-
pageSize,
|
|
24
|
-
include: extraStoryFields,
|
|
25
|
-
localeCode,
|
|
26
|
-
});
|
|
27
|
-
serverSideProps.newsroomContextProps.currentCategory = category;
|
|
28
|
-
return processRequest(context, {
|
|
29
|
-
...serverSideProps,
|
|
30
|
-
// TODO: This is temporary until return types from API are figured out
|
|
31
|
-
stories: stories,
|
|
32
|
-
pagination: {
|
|
33
|
-
itemsTotal: storiesTotal,
|
|
34
|
-
currentPage: page ?? 1,
|
|
35
|
-
pageSize,
|
|
36
|
-
},
|
|
37
|
-
...(typeof customProps === 'function'
|
|
38
|
-
? await customProps(context, serverSideProps)
|
|
39
|
-
: customProps),
|
|
40
|
-
}, `/category/${slug}`);
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
export function getCategoryPageStaticProps(customProps, options) {
|
|
44
|
-
const { pageSize = DEFAULT_PAGE_SIZE, extraStoryFields } = options || {};
|
|
45
|
-
return async function getStaticProps(context) {
|
|
46
|
-
const { api, staticProps } = await getNewsroomStaticProps(context);
|
|
47
|
-
const { slug } = context.params;
|
|
48
|
-
const category = await api.getCategoryBySlug(slug);
|
|
49
|
-
if (!category) {
|
|
50
|
-
return {
|
|
51
|
-
notFound: true,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
const { localeCode } = staticProps.newsroomContextProps;
|
|
55
|
-
const { stories, storiesTotal } = await api.getStoriesFromCategory(category, {
|
|
56
|
-
pageSize,
|
|
57
|
-
include: extraStoryFields,
|
|
58
|
-
localeCode,
|
|
59
|
-
});
|
|
60
|
-
staticProps.newsroomContextProps.currentCategory = category;
|
|
61
|
-
return processStaticRequest(context, {
|
|
62
|
-
...staticProps,
|
|
63
|
-
// TODO: This is temporary until return types from API are figured out
|
|
64
|
-
stories: stories,
|
|
65
|
-
pagination: {
|
|
66
|
-
itemsTotal: storiesTotal,
|
|
67
|
-
currentPage: 1,
|
|
68
|
-
pageSize,
|
|
69
|
-
},
|
|
70
|
-
...(typeof customProps === 'function'
|
|
71
|
-
? await customProps(context, staticProps)
|
|
72
|
-
: customProps),
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export async function getCategoryPageStaticPaths() {
|
|
77
|
-
const api = getNextPrezlyApi();
|
|
78
|
-
const [categories, defaultLanguage] = await Promise.all([
|
|
79
|
-
api.getCategories(),
|
|
80
|
-
api.getNewsroomDefaultLanguage(),
|
|
81
|
-
]);
|
|
82
|
-
const locale = LocaleObject.fromAnyCode(defaultLanguage.code);
|
|
83
|
-
const paths = categories
|
|
84
|
-
.map((category) => {
|
|
85
|
-
const { slug } = getLocalizedCategoryData(category, locale);
|
|
86
|
-
if (!slug) {
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
89
|
-
return { params: { slug } };
|
|
90
|
-
})
|
|
91
|
-
.filter(Boolean);
|
|
92
|
-
return {
|
|
93
|
-
paths,
|
|
94
|
-
fallback: 'blocking',
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
//# sourceMappingURL=category.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/category.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AASnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAclE,MAAM,UAAU,8BAA8B,CAG5C,WAAqD,EAAE,OAAiB;IACtE,MAAM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,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,0BAA0B;IAC5C,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IAC/B,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpD,GAAG,CAAC,aAAa,EAAE;QACnB,GAAG,CAAC,0BAA0B,EAAE;KACnC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IAE9D,MAAM,KAAK,GAAG,UAAU;SACnB,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACd,MAAM,EAAE,IAAI,EAAE,GAAG,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,EAAE;YACP,OAAO,SAAS,CAAC;SACpB;QAED,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;IAChC,CAAC,CAAC;SACD,MAAM,CAA+B,OAAc,CAAC,CAAC;IAE1D,OAAO;QACH,KAAK;QACL,QAAQ,EAAE,UAAU;KACvB,CAAC;AACN,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_GALLERY_PAGE_SIZE } from '@prezly/theme-kit-core';
|
|
2
|
-
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps.js';
|
|
3
|
-
import { getNewsroomStaticProps } from '../getNewsroomStaticProps.js';
|
|
4
|
-
import { processRequest } from '../processRequest.js';
|
|
5
|
-
import { processStaticRequest } from '../processStaticRequest.js';
|
|
6
|
-
export function getGalleryPageServerSideProps(customProps, options) {
|
|
7
|
-
const { pageSize = DEFAULT_GALLERY_PAGE_SIZE } = options || {};
|
|
8
|
-
return async function getServerSideProps(context) {
|
|
9
|
-
const { api, serverSideProps } = await getNewsroomServerSideProps(context);
|
|
10
|
-
const { query } = context;
|
|
11
|
-
const page = query.page && typeof query.page === 'string' ? Number(query.page) : undefined;
|
|
12
|
-
const { galleries, pagination } = await api.getGalleries({ page, pageSize });
|
|
13
|
-
// If there's only one gallery, redirect to it immediately
|
|
14
|
-
if (galleries.length === 1) {
|
|
15
|
-
const { uuid } = galleries[0];
|
|
16
|
-
return {
|
|
17
|
-
redirect: {
|
|
18
|
-
destination: `/media/album/${uuid}`,
|
|
19
|
-
permanent: false,
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
return processRequest(context, {
|
|
24
|
-
...serverSideProps,
|
|
25
|
-
galleries,
|
|
26
|
-
pagination: {
|
|
27
|
-
itemsTotal: pagination.matched_records_number,
|
|
28
|
-
currentPage: page ?? 1,
|
|
29
|
-
pageSize,
|
|
30
|
-
},
|
|
31
|
-
...(typeof customProps === 'function'
|
|
32
|
-
? await customProps(context, serverSideProps)
|
|
33
|
-
: customProps),
|
|
34
|
-
}, '/media');
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
export function getGalleryPageStaticProps(customProps, options) {
|
|
38
|
-
const { pageSize = DEFAULT_GALLERY_PAGE_SIZE } = options || {};
|
|
39
|
-
return async function getStaticProps(context) {
|
|
40
|
-
const { api, staticProps } = await getNewsroomStaticProps(context);
|
|
41
|
-
const { galleries, pagination } = await api.getGalleries({ pageSize });
|
|
42
|
-
// If there's only one gallery, redirect to it immediately
|
|
43
|
-
if (galleries.length === 1) {
|
|
44
|
-
const { uuid } = galleries[0];
|
|
45
|
-
return {
|
|
46
|
-
redirect: {
|
|
47
|
-
destination: `/media/album/${uuid}`,
|
|
48
|
-
permanent: false,
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
return processStaticRequest(context, {
|
|
53
|
-
...staticProps,
|
|
54
|
-
galleries,
|
|
55
|
-
pagination: {
|
|
56
|
-
itemsTotal: pagination.matched_records_number,
|
|
57
|
-
currentPage: 1,
|
|
58
|
-
pageSize,
|
|
59
|
-
},
|
|
60
|
-
...(typeof customProps === 'function'
|
|
61
|
-
? await customProps(context, staticProps)
|
|
62
|
-
: customProps),
|
|
63
|
-
});
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=gallery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/gallery.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AASnE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAalE,MAAM,UAAU,6BAA6B,CACzC,WAAqD,EACrD,OAAiB;IAEjB,MAAM,EAAE,QAAQ,GAAG,yBAAyB,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE/D,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,MAAM,0BAA0B,CAAC,OAAO,CAAC,CAAC;QAC3E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAE1B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3F,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE7E,0DAA0D;QAC1D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE;YACxB,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,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EAAE,UAAU,CAAC,sBAAsB;gBAC7C,WAAW,EAAE,CAAC;gBACd,QAAQ;aACX;YACD,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { getNextPrezlyApi } from '../../data-fetching/index.js';
|
|
2
|
-
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps.js';
|
|
3
|
-
import { getNewsroomStaticProps } from '../getNewsroomStaticProps.js';
|
|
4
|
-
import { processRequest } from '../processRequest.js';
|
|
5
|
-
import { processStaticRequest } from '../processStaticRequest.js';
|
|
6
|
-
export function getGalleryAlbumPageServerSideProps(customProps) {
|
|
7
|
-
return async function getServerSideProps(context) {
|
|
8
|
-
const { api, serverSideProps } = await getNewsroomServerSideProps(context);
|
|
9
|
-
const { uuid } = context.params;
|
|
10
|
-
const gallery = await api.getGallery(uuid);
|
|
11
|
-
if (!gallery || !gallery.images_number) {
|
|
12
|
-
return { notFound: true };
|
|
13
|
-
}
|
|
14
|
-
return processRequest(context, {
|
|
15
|
-
...serverSideProps,
|
|
16
|
-
gallery,
|
|
17
|
-
...(typeof customProps === 'function'
|
|
18
|
-
? await customProps(context, serverSideProps)
|
|
19
|
-
: customProps),
|
|
20
|
-
}, `/media/album/${uuid}`);
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export function getGalleryAlbumPageStaticProps(customProps) {
|
|
24
|
-
return async function getStaticProps(context) {
|
|
25
|
-
const { api, staticProps } = await getNewsroomStaticProps(context);
|
|
26
|
-
const { uuid } = context.params;
|
|
27
|
-
const gallery = await api.getGallery(uuid);
|
|
28
|
-
if (!gallery || !gallery.images_number) {
|
|
29
|
-
return { notFound: true };
|
|
30
|
-
}
|
|
31
|
-
return processStaticRequest(context, {
|
|
32
|
-
...staticProps,
|
|
33
|
-
gallery,
|
|
34
|
-
...(typeof customProps === 'function'
|
|
35
|
-
? await customProps(context, staticProps)
|
|
36
|
-
: customProps),
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
export async function getGalleryAlbumPageStaticPaths() {
|
|
41
|
-
const api = getNextPrezlyApi();
|
|
42
|
-
const { galleries } = await api.getGalleries({});
|
|
43
|
-
const paths = galleries.map(({ uuid }) => ({ params: { uuid } }));
|
|
44
|
-
return {
|
|
45
|
-
paths,
|
|
46
|
-
fallback: 'blocking',
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=galleryAlbum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"galleryAlbum.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/galleryAlbum.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAQlE,MAAM,UAAU,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,MAAM,0BAA0B,CAAC,OAAO,CAAC,CAAC;QAE3E,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA0B,CAAC;QACpD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QAE3C,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE;YACpC,OAAO,EAAE,QAAQ,EAAE,IAAI,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,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAElE,OAAO;QACH,KAAK;QACL,QAAQ,EAAE,UAAU;KACvB,CAAC;AACN,CAAC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { DEFAULT_PAGE_SIZE } from '@prezly/theme-kit-core';
|
|
2
|
-
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps.js';
|
|
3
|
-
import { getNewsroomStaticProps } from '../getNewsroomStaticProps.js';
|
|
4
|
-
import { processRequest } from '../processRequest.js';
|
|
5
|
-
import { processStaticRequest } from '../processStaticRequest.js';
|
|
6
|
-
export function getHomepageServerSideProps(customProps, options) {
|
|
7
|
-
const { pageSize = DEFAULT_PAGE_SIZE, extraStoryFields, pinning = false, withHighlightedStory = false, filterQuery, } = options || {};
|
|
8
|
-
return async function getServerSideProps(context) {
|
|
9
|
-
const { api, serverSideProps } = await getNewsroomServerSideProps(context, {
|
|
10
|
-
loadHomepageContacts: true,
|
|
11
|
-
});
|
|
12
|
-
const { query } = context;
|
|
13
|
-
const page = query.page && typeof query.page === 'string' ? Number(query.page) : undefined;
|
|
14
|
-
const { localeCode } = serverSideProps.newsroomContextProps;
|
|
15
|
-
const storiesPaginated = await api.getStories({
|
|
16
|
-
page,
|
|
17
|
-
pageSize,
|
|
18
|
-
pinning,
|
|
19
|
-
include: extraStoryFields,
|
|
20
|
-
localeCode,
|
|
21
|
-
withHighlightedStory,
|
|
22
|
-
filterQuery,
|
|
23
|
-
});
|
|
24
|
-
const { stories, storiesTotal } = storiesPaginated;
|
|
25
|
-
return processRequest(context, {
|
|
26
|
-
...serverSideProps,
|
|
27
|
-
// TODO: This is temporary until return types from API are figured out
|
|
28
|
-
stories: stories,
|
|
29
|
-
pagination: {
|
|
30
|
-
itemsTotal: storiesTotal,
|
|
31
|
-
currentPage: page ?? 1,
|
|
32
|
-
pageSize,
|
|
33
|
-
withHighlightedStory,
|
|
34
|
-
},
|
|
35
|
-
...(typeof customProps === 'function'
|
|
36
|
-
? await customProps(context, serverSideProps)
|
|
37
|
-
: customProps),
|
|
38
|
-
}, '/');
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
export function getHomepageStaticProps(customProps, options) {
|
|
42
|
-
const { pageSize = DEFAULT_PAGE_SIZE, extraStoryFields, pinning = false } = options || {};
|
|
43
|
-
return async function getStaticProps(context) {
|
|
44
|
-
const { api, staticProps } = await getNewsroomStaticProps(context, {
|
|
45
|
-
loadHomepageContacts: true,
|
|
46
|
-
});
|
|
47
|
-
const { localeCode } = staticProps.newsroomContextProps;
|
|
48
|
-
const storiesPaginated = await api.getStories({
|
|
49
|
-
pageSize,
|
|
50
|
-
pinning,
|
|
51
|
-
include: extraStoryFields,
|
|
52
|
-
localeCode,
|
|
53
|
-
});
|
|
54
|
-
const { stories, storiesTotal } = storiesPaginated;
|
|
55
|
-
return processStaticRequest(context, {
|
|
56
|
-
...staticProps,
|
|
57
|
-
// TODO: This is temporary until return types from API are figured out
|
|
58
|
-
stories: stories,
|
|
59
|
-
pagination: {
|
|
60
|
-
itemsTotal: storiesTotal,
|
|
61
|
-
currentPage: 1,
|
|
62
|
-
pageSize,
|
|
63
|
-
},
|
|
64
|
-
...(typeof customProps === 'function'
|
|
65
|
-
? await customProps(context, staticProps)
|
|
66
|
-
: customProps),
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=home.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"home.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/home.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAS3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,o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eAAe,CAAC;gBAC7E,CAAC,CAAC,WAAW,CAAC;SACrB,EACD,GAAG,CACN,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,sBAAsB,CAGpC,WAA4E,EAAE,OAAiB;IAC7F,MAAM,EAAE,QAAQ,GAAG,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,GAAG,KAAK,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE1F,OAAO,KAAK,UAAU,cAAc,CAChC,OAA8B;QAE9B,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,MAAM,sBAAsB,CAAC,OAAO,EAAE;YAC/D,oBAAoB,EAAE,IAAI;SAC7B,CAAC,CAAC;QAEH,MAAM,EAAE,UAAU,EAAE,GAAG,WAAW,CAAC,oBAAoB,CAAC;QAExD,MAAM,gBAAgB,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC;YAC1C,QAAQ;YACR,OAAO;YACP,OAAO,EAAE,gBAAgB;YACzB,UAAU;SACb,CAAC,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,gBAAgB,CAAC;QAEnD,OAAO,oBAAoB,CAAC,OAAO,EAAE;YACjC,GAAG,WAAW;YACd,sEAAsE;YACtE,OAAO,EAAE,OAAsB;YAC/B,UAAU,EAAE;gBACR,UAAU,EAAE,YAAY;gBACxB,WAAW,EAAE,CAAC;gBACd,QAAQ;aACX;YACD,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { getCategoryPageServerSideProps, getCategoryPageStaticPaths, getCategoryPageStaticProps, } from './category.js';
|
|
2
|
-
export { getGalleryPageServerSideProps, getGalleryPageStaticProps, } from './gallery.js';
|
|
3
|
-
export { getGalleryAlbumPageServerSideProps, getGalleryAlbumPageStaticPaths, getGalleryAlbumPageStaticProps, } from './galleryAlbum.js';
|
|
4
|
-
export { getHomepageServerSideProps, getHomepageStaticProps } from './home.js';
|
|
5
|
-
export { getSearchPageServerSideProps, getSearchPageStaticProps } from './search.js';
|
|
6
|
-
export * from './sitemap/index.js';
|
|
7
|
-
export { getStoryPageServerSideProps, getStoryPageStaticPaths, getStoryPageStaticProps, } from './story.js';
|
|
8
|
-
export { getStoryPreviewPageServerSideProps } from './storyPreview.js';
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,GAE7B,MAAM,eAAe,CAAC;AACvB,OAAO,EACH,6BAA6B,EAC7B,yBAAyB,GAE5B,MAAM,cAAc,CAAC;AACtB,OAAO,EACH,kCAAkC,EAClC,8BAA8B,EAC9B,8BAA8B,GAEjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAsB,MAAM,WAAW,CAAC;AACnG,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACrF,cAAc,oBAAoB,CAAC;AACnC,OAAO,EACH,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,GAC1B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kCAAkC,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/adapter-nextjs/page-props/lib/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps.js';
|
|
2
|
-
import { getNewsroomStaticProps } from '../getNewsroomStaticProps.js';
|
|
3
|
-
import { processRequest } from '../processRequest.js';
|
|
4
|
-
import { processStaticRequest } from '../processStaticRequest.js';
|
|
5
|
-
export function getSearchPageServerSideProps(customProps) {
|
|
6
|
-
return async function getServerSideProps(context) {
|
|
7
|
-
const { serverSideProps } = await getNewsroomServerSideProps(context);
|
|
8
|
-
return processRequest(context, {
|
|
9
|
-
...serverSideProps,
|
|
10
|
-
...(typeof customProps === 'function'
|
|
11
|
-
? await customProps(context, serverSideProps)
|
|
12
|
-
: customProps),
|
|
13
|
-
}, '/search');
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export function getSearchPageStaticProps(customProps) {
|
|
17
|
-
return async function getStaticProps(context) {
|
|
18
|
-
const { staticProps } = await getNewsroomStaticProps(context);
|
|
19
|
-
return processStaticRequest(context, {
|
|
20
|
-
...staticProps,
|
|
21
|
-
...(typeof customProps === 'function'
|
|
22
|
-
? await customProps(context, staticProps)
|
|
23
|
-
: customProps),
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/search.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,MAAM,UAAU,4BAA4B,CACxC,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,0BAA0B,CAAC,OAAO,CAAC,CAAC;QAEtE,OAAO,cAAc,CACjB,OAAO,EACP;YACI,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,EACD,SAAS,CACZ,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAED,MAAM,UAAU,wBAAwB,CACpC,WAA4E;IAE5E,OAAO,KAAK,UAAU,cAAc,CAChC,OAAkC;QAElC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,sBAAsB,CAAC,OAAO,CAAC,CAAC;QAE9D,OAAO,oBAAoB,CAAC,OAAO,EAAE;YACjC,GAAG,WAAW;YACd,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export class SitemapBuilder {
|
|
2
|
-
baseUrl;
|
|
3
|
-
urls = [];
|
|
4
|
-
constructor(baseUrl) {
|
|
5
|
-
this.baseUrl = baseUrl;
|
|
6
|
-
}
|
|
7
|
-
addUrl(location) {
|
|
8
|
-
this.urls.push({
|
|
9
|
-
location: this.baseUrl + location,
|
|
10
|
-
changeFrequency: SitemapBuilder.guessFrequency(location),
|
|
11
|
-
priority: SitemapBuilder.guessPriority(location),
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
static guessFrequency(location) {
|
|
15
|
-
if (location === '/')
|
|
16
|
-
return 'daily';
|
|
17
|
-
return 'weekly';
|
|
18
|
-
}
|
|
19
|
-
static guessPriority(location) {
|
|
20
|
-
if (location === '/')
|
|
21
|
-
return '0.9';
|
|
22
|
-
if (location.startsWith('/category/')) {
|
|
23
|
-
return '0.8';
|
|
24
|
-
}
|
|
25
|
-
return '0.7';
|
|
26
|
-
}
|
|
27
|
-
static serializeLocation(url) {
|
|
28
|
-
return [
|
|
29
|
-
'<url>',
|
|
30
|
-
url.location && `\t<loc>${url.location}</loc>`,
|
|
31
|
-
url.changeFrequency && `\t<changefreq>${url.changeFrequency}</changefreq>`,
|
|
32
|
-
url.priority && `\t<priority>${url.priority}</priority>`,
|
|
33
|
-
'</url>',
|
|
34
|
-
]
|
|
35
|
-
.filter(Boolean)
|
|
36
|
-
.join('\n');
|
|
37
|
-
}
|
|
38
|
-
serialize() {
|
|
39
|
-
return [
|
|
40
|
-
'<?xml version="1.0" encoding="UTF-8" ?>',
|
|
41
|
-
'<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">',
|
|
42
|
-
this.urls.map(SitemapBuilder.serializeLocation).join('\n'),
|
|
43
|
-
'</urlset>',
|
|
44
|
-
].join('\n');
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=SitemapBuilder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SitemapBuilder.js","sourceRoot":"","sources":["../../../../../src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAc;IACf,OAAO,CAAS;IAEhB,IAAI,GAAiB,EAAE,CAAC;IAEhC,YAAY,OAAe;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAEM,MAAM,CAAC,QAAgB;QAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;YACX,QAAQ,EAAE,IAAI,CAAC,OAAO,GAAG,QAAQ;YACjC,eAAe,EAAE,cAAc,CAAC,cAAc,CAAC,QAAQ,CAAC;YACxD,QAAQ,EAAE,cAAc,CAAC,aAAa,CAAC,QAAQ,CAAC;SACnD,CAAC,CAAC;IACP,CAAC;IAEO,MAAM,CAAC,cAAc,CAAC,QAAgB;QAC1C,IAAI,QAAQ,KAAK,GAAG;YAAE,OAAO,OAAO,CAAC;QAErC,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEO,MAAM,CAAC,aAAa,CAAC,QAAgB;QACzC,IAAI,QAAQ,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC;QAEnC,IAAI,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;YACnC,OAAO,KAAK,CAAC;SAChB;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,MAAM,CAAC,iBAAiB,CAAC,GAAe;QACpC,OAAO;YACH,OAAO;YACP,GAAG,CAAC,QAAQ,IAAI,UAAU,GAAG,CAAC,QAAQ,QAAQ;YAC9C,GAAG,CAAC,eAAe,IAAI,iBAAiB,GAAG,CAAC,eAAe,eAAe;YAC1E,GAAG,CAAC,QAAQ,IAAI,eAAe,GAAG,CAAC,QAAQ,aAAa;YACxD,QAAQ;SACX;aACI,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,IAAI,CAAC,CAAC;IACpB,CAAC;IAED,SAAS;QACL,OAAO;YACH,yCAAyC;YACzC,wLAAwL;YACxL,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC1D,WAAW;SACd,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;CACJ"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export function createPaths(stories, categories) {
|
|
2
|
-
const storiesUrls = stories.map(({ slug }) => `/${slug}`);
|
|
3
|
-
const categoriesUrls = categories
|
|
4
|
-
.map((category) => {
|
|
5
|
-
const translations = Object.values(category.i18n);
|
|
6
|
-
const allSlugs = translations
|
|
7
|
-
.map(({ slug }) => slug || '')
|
|
8
|
-
.filter(Boolean)
|
|
9
|
-
.reduce((slugs, slug) => (slugs.includes(slug) ? [...slugs] : [...slugs, slug]), []);
|
|
10
|
-
return allSlugs.map((slug) => `/category/${slug}`);
|
|
11
|
-
})
|
|
12
|
-
.flat();
|
|
13
|
-
return [...storiesUrls, ...categoriesUrls];
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=createPaths.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createPaths.js","sourceRoot":"","sources":["../../../../../src/adapter-nextjs/page-props/sitemap/createPaths.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,WAAW,CAAC,OAAgB,EAAE,UAAsB;IAChE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,cAAc,GAAG,UAAU;SAC5B,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACd,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,YAAY;aACxB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;aAC7B,MAAM,CAAC,OAAO,CAAC;aACf,MAAM,CACH,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,EACvE,EAAE,CACL,CAAC;QAEN,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;IAEZ,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,cAAc,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { getNextPrezlyApi } from '../../../data-fetching/index.js';
|
|
2
|
-
import { createPaths } from './createPaths.js';
|
|
3
|
-
import { SitemapBuilder } from './SitemapBuilder.js';
|
|
4
|
-
export function getSitemapServerSideProps(options = {}) {
|
|
5
|
-
return async function getServerSideProps(ctx) {
|
|
6
|
-
const { res, req } = ctx;
|
|
7
|
-
if (!req || !res) {
|
|
8
|
-
// client side
|
|
9
|
-
return {
|
|
10
|
-
props: {},
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
const baseUrl = req.headers.host || '/';
|
|
14
|
-
const api = getNextPrezlyApi(req);
|
|
15
|
-
const stories = await api.getAllStories({
|
|
16
|
-
pinning: options.pinning ?? false,
|
|
17
|
-
});
|
|
18
|
-
const categories = await api.getCategories();
|
|
19
|
-
const paths = createPaths(stories, categories);
|
|
20
|
-
const sitemapBuilder = new SitemapBuilder(baseUrl);
|
|
21
|
-
sitemapBuilder.addUrl('/');
|
|
22
|
-
paths.forEach((path) => sitemapBuilder.addUrl(path));
|
|
23
|
-
options.additionalPaths?.forEach((path) => sitemapBuilder.addUrl(path));
|
|
24
|
-
res.setHeader('Content-Type', 'text/xml');
|
|
25
|
-
res.write(sitemapBuilder.serialize());
|
|
26
|
-
res.end();
|
|
27
|
-
return {
|
|
28
|
-
props: {},
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=getServerSideProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getServerSideProps.js","sourceRoot":"","sources":["../../../../../src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAErD,MAAM,UAAU,yBAAyB,CACrC,UAA6D,EAAE;IAE/D,OAAO,KAAK,UAAU,kBAAkB,CAAC,GAAoB;QACz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":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/adapter-nextjs/page-props/sitemap/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { getNextPrezlyApi } from '../../data-fetching/index.js';
|
|
2
|
-
import { DUMMY_DEFAULT_LOCALE } from '../../intl/index.js';
|
|
3
|
-
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps.js';
|
|
4
|
-
import { getNewsroomStaticProps } from '../getNewsroomStaticProps.js';
|
|
5
|
-
import { processRequest } from '../processRequest.js';
|
|
6
|
-
import { processStaticRequest } from '../processStaticRequest.js';
|
|
7
|
-
export function getStoryPageServerSideProps(customProps) {
|
|
8
|
-
return async function getServerSideProps(context) {
|
|
9
|
-
const api = getNextPrezlyApi(context.req);
|
|
10
|
-
const { slug } = context.params;
|
|
11
|
-
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
12
|
-
if (!story) {
|
|
13
|
-
return { notFound: true };
|
|
14
|
-
}
|
|
15
|
-
const { serverSideProps } = await getNewsroomServerSideProps(context, { story });
|
|
16
|
-
const { locale } = context;
|
|
17
|
-
if (locale && locale !== DUMMY_DEFAULT_LOCALE) {
|
|
18
|
-
return {
|
|
19
|
-
redirect: {
|
|
20
|
-
destination: `/${slug}`,
|
|
21
|
-
permanent: true,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
serverSideProps.newsroomContextProps.currentStory = story;
|
|
26
|
-
return processRequest(context, {
|
|
27
|
-
...serverSideProps,
|
|
28
|
-
...(typeof customProps === 'function'
|
|
29
|
-
? await customProps(context, serverSideProps)
|
|
30
|
-
: customProps),
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
export function getStoryPageStaticProps(customProps) {
|
|
35
|
-
return async function getStaticProps(context) {
|
|
36
|
-
const api = getNextPrezlyApi();
|
|
37
|
-
const { slug } = context.params;
|
|
38
|
-
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
39
|
-
if (!story) {
|
|
40
|
-
return { notFound: true };
|
|
41
|
-
}
|
|
42
|
-
const { staticProps } = await getNewsroomStaticProps(context, { story });
|
|
43
|
-
staticProps.newsroomContextProps.currentStory = story;
|
|
44
|
-
return processStaticRequest(context, {
|
|
45
|
-
...staticProps,
|
|
46
|
-
...(typeof customProps === 'function'
|
|
47
|
-
? await customProps(context, staticProps)
|
|
48
|
-
: customProps),
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
export async function getStoryPageStaticPaths(options = {}) {
|
|
53
|
-
const api = getNextPrezlyApi();
|
|
54
|
-
const stories = await api.getAllStories({
|
|
55
|
-
pinning: options.pinning ?? false,
|
|
56
|
-
});
|
|
57
|
-
const paths = stories.map(({ slug }) => ({ params: { slug } }));
|
|
58
|
-
return {
|
|
59
|
-
paths,
|
|
60
|
-
fallback: 'blocking',
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=story.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/story.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,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AAI,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,WAAW,EAAE,GAAG,MAAM,sBAAsB,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzE,WAAW,CAAC,oBAAoB,CAAC,YAAY,GAAG,KAAK,CAAC;QAEtD,OAAO,oBAAoB,CAAC,OAAO,EAAE;YACjC,GAAG,WAAW;YACd,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,UAAiC,EAAE;IAC7E,MAAM,GAAG,GAAG,gBAAgB,EAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC;QACpC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;KACpC,CAAC,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"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { getNextPrezlyApi } from '../../data-fetching/index.js';
|
|
2
|
-
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps.js';
|
|
3
|
-
import { processRequest } from '../processRequest.js';
|
|
4
|
-
export function getStoryPreviewPageServerSideProps(customProps) {
|
|
5
|
-
return async function getServerSideProps(context) {
|
|
6
|
-
const api = getNextPrezlyApi(context.req);
|
|
7
|
-
const { uuid } = context.params;
|
|
8
|
-
const story = await api.getStory(uuid);
|
|
9
|
-
if (!story) {
|
|
10
|
-
return { notFound: true };
|
|
11
|
-
}
|
|
12
|
-
const { serverSideProps } = await getNewsroomServerSideProps(context, { story });
|
|
13
|
-
serverSideProps.newsroomContextProps.currentStory = story;
|
|
14
|
-
return processRequest(context, {
|
|
15
|
-
...serverSideProps,
|
|
16
|
-
...(typeof customProps === 'function'
|
|
17
|
-
? await customProps(context, serverSideProps)
|
|
18
|
-
: customProps),
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=storyPreview.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAItD,MAAM,UAAU,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,gBAAgB,CAAC,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,0BAA0B,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjF,eAAe,CAAC,oBAAoB,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1D,OAAO,cAAc,CAAC,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"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getShortestLocaleCode, LocaleObject } from '@prezly/theme-kit-core';
|
|
2
|
-
import { getRedirectToCanonicalLocale } from '../intl/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* This function combines the props returned from `getNewsroomServerSideProps` and your optional custom props for the page.
|
|
5
|
-
* It also handles locale redirects, if `canonicalUrl` parameter is provided.
|
|
6
|
-
* See README for usage examples.
|
|
7
|
-
*
|
|
8
|
-
* @param context Next.js context passed to the `getServerSideProps` method of the page
|
|
9
|
-
* @param props Object containing the return of `getNewsroomServerSideProps` and your optional custom props.
|
|
10
|
-
* @param canonicalUrl Optional: a canonical URL for the current page without locale part. If provided, locale redirects will be handled by the function.
|
|
11
|
-
*/
|
|
12
|
-
export function processRequest(context, props, canonicalUrl) {
|
|
13
|
-
const { locale: nextLocale, query } = context;
|
|
14
|
-
const { localeResolved, ...pageProps } = props;
|
|
15
|
-
// If no locale was provided by Next, it most likely means that the theme is not supporting multi-language.
|
|
16
|
-
// In that case we won't show 404 page.
|
|
17
|
-
if (!localeResolved && nextLocale) {
|
|
18
|
-
return { notFound: true };
|
|
19
|
-
}
|
|
20
|
-
if (canonicalUrl) {
|
|
21
|
-
const { languages, localeCode } = pageProps.newsroomContextProps;
|
|
22
|
-
const currentLocale = LocaleObject.fromAnyCode(localeCode);
|
|
23
|
-
const shortestLocaleCode = getShortestLocaleCode(languages, currentLocale);
|
|
24
|
-
const redirect = getRedirectToCanonicalLocale(shortestLocaleCode, nextLocale, canonicalUrl, query);
|
|
25
|
-
if (redirect) {
|
|
26
|
-
return { redirect };
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return {
|
|
30
|
-
props: pageProps,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=processRequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAG7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AAGhE;;;;;;;;GAQG;AACH,MAAM,UAAU,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,YAAY,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC3D,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAE3E,MAAM,QAAQ,GAAG,4BAA4B,CACzC,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"}
|