@prezly/theme-kit-nextjs 4.1.1-alpha.0 → 4.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -0
- package/build/cjs/adapter-nextjs/api-handlers/fetchStories.js.map +1 -0
- package/build/cjs/adapter-nextjs/api-handlers/index.js.map +1 -0
- package/build/cjs/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -0
- package/build/cjs/adapter-nextjs/getNewsroomStaticProps.js.map +1 -0
- package/build/cjs/adapter-nextjs/index.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/category.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/gallery.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/galleryAlbum.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/home.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/index.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/lib/types.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/search.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/sitemap/index.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/sitemap/types.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/story.js.map +1 -0
- package/build/cjs/adapter-nextjs/page-props/storyPreview.js.map +1 -0
- package/build/cjs/adapter-nextjs/processRequest.js.map +1 -0
- package/build/cjs/adapter-nextjs/processStaticRequest.js.map +1 -0
- package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/PageSeo.js +0 -1
- package/build/cjs/components-nextjs/PageSeo/PageSeo.js.map +1 -0
- package/build/cjs/components-nextjs/PageSeo/index.js.map +1 -0
- package/build/cjs/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -0
- package/build/cjs/components-nextjs/PageSeo/lib/index.js.map +1 -0
- package/build/cjs/components-nextjs/StorySeo/StorySeo.js.map +1 -0
- package/build/cjs/components-nextjs/StorySeo/index.js.map +1 -0
- package/build/cjs/components-nextjs/document.js.map +1 -0
- package/build/cjs/components-nextjs/index.js.map +1 -0
- package/build/cjs/data-fetching/NextPrezlyApi.js.map +1 -0
- package/build/cjs/data-fetching/getNextPrezlyApi.js.map +1 -0
- package/build/cjs/data-fetching/index.js.map +1 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/infinite-loading/index.js.map +1 -0
- package/build/cjs/infinite-loading/types.js.map +1 -0
- package/build/cjs/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -0
- package/build/cjs/infinite-loading/useInfiniteLoading.js.map +1 -0
- package/build/cjs/infinite-loading/useInfiniteStoriesLoading.js.map +1 -0
- package/build/cjs/intl/index.js.map +1 -0
- package/build/cjs/intl/languages.js.map +1 -0
- package/build/cjs/intl/locale.js.map +1 -0
- package/build/{newsroom-context → cjs/newsroom-context}/context.js +0 -1
- package/build/cjs/newsroom-context/context.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/index.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useCategories.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useCompanyInformation.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useCurrentCategory.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useCurrentLocale.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useCurrentStory.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useLanguages.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useNewsroom.js.map +1 -0
- package/build/cjs/newsroom-context/hooks/useNewsroomContext.js.map +1 -0
- package/build/cjs/newsroom-context/index.js.map +1 -0
- package/build/cjs/sentry/client.js.map +1 -0
- package/build/cjs/sentry/common.js.map +1 -0
- package/build/cjs/sentry/index.js.map +1 -0
- package/build/cjs/sentry/server.js.map +1 -0
- package/build/{infinite-loading → cjs}/types.js.map +1 -1
- package/build/esm/adapter-nextjs/api-handlers/fetchGalleries.js +19 -0
- package/build/esm/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -0
- package/build/esm/adapter-nextjs/api-handlers/fetchStories.js +29 -0
- package/build/esm/adapter-nextjs/api-handlers/fetchStories.js.map +1 -0
- package/build/esm/adapter-nextjs/api-handlers/index.js +3 -0
- package/build/esm/adapter-nextjs/api-handlers/index.js.map +1 -0
- package/build/esm/adapter-nextjs/getNewsroomServerSideProps.js +15 -0
- package/build/esm/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -0
- package/build/esm/adapter-nextjs/getNewsroomStaticProps.js +15 -0
- package/build/esm/adapter-nextjs/getNewsroomStaticProps.js.map +1 -0
- package/build/esm/adapter-nextjs/index.js +7 -0
- package/build/esm/adapter-nextjs/index.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/category.js +97 -0
- package/build/esm/adapter-nextjs/page-props/category.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/gallery.js +66 -0
- package/build/esm/adapter-nextjs/page-props/gallery.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/galleryAlbum.js +49 -0
- package/build/esm/adapter-nextjs/page-props/galleryAlbum.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/home.js +70 -0
- package/build/esm/adapter-nextjs/page-props/home.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/index.js +9 -0
- package/build/esm/adapter-nextjs/page-props/index.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/lib/types.js +2 -0
- package/build/esm/adapter-nextjs/page-props/lib/types.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/search.js +27 -0
- package/build/esm/adapter-nextjs/page-props/search.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +47 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/createPaths.js +15 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/getServerSideProps.js +32 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/index.js +5 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/index.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/types.js +2 -0
- package/build/esm/adapter-nextjs/page-props/sitemap/types.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/story.js +63 -0
- package/build/esm/adapter-nextjs/page-props/story.js.map +1 -0
- package/build/esm/adapter-nextjs/page-props/storyPreview.js +22 -0
- package/build/esm/adapter-nextjs/page-props/storyPreview.js.map +1 -0
- package/build/esm/adapter-nextjs/processRequest.js +33 -0
- package/build/esm/adapter-nextjs/processRequest.js.map +1 -0
- package/build/esm/adapter-nextjs/processStaticRequest.js +22 -0
- package/build/esm/adapter-nextjs/processStaticRequest.js.map +1 -0
- package/build/esm/components-nextjs/PageSeo/PageSeo.js +77 -0
- package/build/esm/components-nextjs/PageSeo/PageSeo.js.map +1 -0
- package/build/esm/components-nextjs/PageSeo/index.js +2 -0
- package/build/esm/components-nextjs/PageSeo/index.js.map +1 -0
- package/build/esm/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +7 -0
- package/build/esm/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -0
- package/build/esm/components-nextjs/PageSeo/lib/index.js +2 -0
- package/build/esm/components-nextjs/PageSeo/lib/index.js.map +1 -0
- package/build/esm/components-nextjs/StorySeo/StorySeo.js +52 -0
- package/build/esm/components-nextjs/StorySeo/StorySeo.js.map +1 -0
- package/build/esm/components-nextjs/StorySeo/index.js +2 -0
- package/build/esm/components-nextjs/StorySeo/index.js.map +1 -0
- package/build/esm/components-nextjs/document.js +21 -0
- package/build/esm/components-nextjs/document.js.map +1 -0
- package/build/esm/components-nextjs/index.js +4 -0
- package/build/esm/components-nextjs/index.js.map +1 -0
- package/build/esm/data-fetching/NextPrezlyApi.js +36 -0
- package/build/esm/data-fetching/NextPrezlyApi.js.map +1 -0
- package/build/esm/data-fetching/getNextPrezlyApi.js +17 -0
- package/build/esm/data-fetching/getNextPrezlyApi.js.map +1 -0
- package/build/esm/data-fetching/index.js +2 -0
- package/build/esm/data-fetching/index.js.map +1 -0
- package/build/esm/index.js +9 -0
- package/build/esm/index.js.map +1 -0
- package/build/esm/infinite-loading/index.js +5 -0
- package/build/esm/infinite-loading/index.js.map +1 -0
- package/build/esm/infinite-loading/types.js +2 -0
- package/build/esm/infinite-loading/types.js.map +1 -0
- package/build/esm/infinite-loading/useInfiniteGalleriesLoading.js +41 -0
- package/build/esm/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -0
- package/build/esm/infinite-loading/useInfiniteLoading.js +40 -0
- package/build/esm/infinite-loading/useInfiniteLoading.js.map +1 -0
- package/build/esm/infinite-loading/useInfiniteStoriesLoading.js +58 -0
- package/build/esm/infinite-loading/useInfiniteStoriesLoading.js.map +1 -0
- package/build/esm/intl/index.js +3 -0
- package/build/esm/intl/index.js.map +1 -0
- package/build/esm/intl/languages.js +26 -0
- package/build/esm/intl/languages.js.map +1 -0
- package/build/esm/intl/locale.js +25 -0
- package/build/esm/intl/locale.js.map +1 -0
- package/build/esm/newsroom-context/context.js +25 -0
- package/build/esm/newsroom-context/context.js.map +1 -0
- package/build/esm/newsroom-context/hooks/index.js +12 -0
- package/build/esm/newsroom-context/hooks/index.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useAlgoliaSettings.js +6 -0
- package/build/esm/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useCategories.js +6 -0
- package/build/esm/newsroom-context/hooks/useCategories.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useCompanyInformation.js +6 -0
- package/build/esm/newsroom-context/hooks/useCompanyInformation.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useCurrentCategory.js +6 -0
- package/build/esm/newsroom-context/hooks/useCurrentCategory.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useCurrentLocale.js +6 -0
- package/build/esm/newsroom-context/hooks/useCurrentLocale.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useCurrentStory.js +6 -0
- package/build/esm/newsroom-context/hooks/useCurrentStory.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useGetLinkLocaleSlug.js +25 -0
- package/build/esm/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useGetTranslationUrl.js +71 -0
- package/build/esm/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useLanguages.js +6 -0
- package/build/esm/newsroom-context/hooks/useLanguages.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useNewsroom.js +6 -0
- package/build/esm/newsroom-context/hooks/useNewsroom.js.map +1 -0
- package/build/esm/newsroom-context/hooks/useNewsroomContext.js +12 -0
- package/build/esm/newsroom-context/hooks/useNewsroomContext.js.map +1 -0
- package/build/esm/newsroom-context/index.js +3 -0
- package/build/esm/newsroom-context/index.js.map +1 -0
- package/build/esm/sentry/client.js +5 -0
- package/build/esm/sentry/client.js.map +1 -0
- package/build/esm/sentry/common.js +62 -0
- package/build/{sentry → esm/sentry}/common.js.map +1 -1
- package/build/esm/sentry/index.js +3 -0
- package/build/esm/sentry/index.js.map +1 -0
- package/build/esm/sentry/server.js +5 -0
- package/build/esm/sentry/server.js.map +1 -0
- package/build/esm/types.js +2 -0
- package/build/esm/types.js.map +1 -0
- package/build/tsconfig.cjs.tsbuildinfo +1 -0
- package/build/tsconfig.esm.tsbuildinfo +1 -0
- package/build/types/adapter-nextjs/api-handlers/fetchGalleries.d.ts +2 -0
- package/build/types/adapter-nextjs/api-handlers/fetchStories.d.ts +2 -0
- package/build/types/adapter-nextjs/api-handlers/index.d.ts +2 -0
- package/build/types/adapter-nextjs/getNewsroomServerSideProps.d.ts +15 -0
- package/build/types/adapter-nextjs/getNewsroomStaticProps.d.ts +15 -0
- package/build/types/adapter-nextjs/index.d.ts +6 -0
- package/build/types/adapter-nextjs/page-props/category.d.ts +16 -0
- package/build/types/adapter-nextjs/page-props/gallery.d.ts +14 -0
- package/build/types/adapter-nextjs/page-props/galleryAlbum.d.ts +9 -0
- package/build/types/adapter-nextjs/page-props/home.d.ts +22 -0
- package/build/types/adapter-nextjs/page-props/index.d.ts +8 -0
- package/build/types/adapter-nextjs/page-props/lib/types.d.ts +3 -0
- package/build/types/adapter-nextjs/page-props/search.d.ts +4 -0
- package/build/types/adapter-nextjs/page-props/sitemap/SitemapBuilder.d.ts +11 -0
- package/build/types/adapter-nextjs/page-props/sitemap/createPaths.d.ts +2 -0
- package/build/types/adapter-nextjs/page-props/sitemap/getServerSideProps.d.ts +7 -0
- package/build/types/adapter-nextjs/page-props/sitemap/index.d.ts +4 -0
- package/build/types/adapter-nextjs/page-props/sitemap/types.d.ts +5 -0
- package/build/types/adapter-nextjs/page-props/story.d.ts +14 -0
- package/build/types/adapter-nextjs/page-props/storyPreview.d.ts +3 -0
- package/build/types/adapter-nextjs/processRequest.d.ts +12 -0
- package/build/types/adapter-nextjs/processStaticRequest.d.ts +11 -0
- package/build/types/components-nextjs/PageSeo/PageSeo.d.ts +12 -0
- package/build/types/components-nextjs/PageSeo/index.d.ts +1 -0
- package/build/types/components-nextjs/PageSeo/lib/getAbsoluteUrl.d.ts +1 -0
- package/build/types/components-nextjs/PageSeo/lib/index.d.ts +1 -0
- package/build/types/components-nextjs/StorySeo/StorySeo.d.ts +12 -0
- package/build/types/components-nextjs/StorySeo/index.d.ts +1 -0
- package/build/types/components-nextjs/document.d.ts +6 -0
- package/build/types/components-nextjs/index.d.ts +3 -0
- package/build/types/data-fetching/NextPrezlyApi.d.ts +8 -0
- package/build/types/data-fetching/getNextPrezlyApi.d.ts +4 -0
- package/build/types/data-fetching/index.d.ts +1 -0
- package/build/types/index.d.ts +8 -0
- package/build/types/infinite-loading/index.d.ts +4 -0
- package/build/types/infinite-loading/types.d.ts +9 -0
- package/build/types/infinite-loading/useInfiniteGalleriesLoading.d.ts +13 -0
- package/build/types/infinite-loading/useInfiniteLoading.d.ts +16 -0
- package/build/types/infinite-loading/useInfiniteStoriesLoading.d.ts +13 -0
- package/build/types/intl/index.d.ts +2 -0
- package/build/types/intl/languages.d.ts +6 -0
- package/build/types/intl/locale.d.ts +5 -0
- package/build/types/newsroom-context/context.d.ts +62 -0
- package/build/types/newsroom-context/hooks/index.d.ts +11 -0
- package/build/types/newsroom-context/hooks/useAlgoliaSettings.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useCategories.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useCompanyInformation.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useCurrentCategory.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useCurrentLocale.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useCurrentStory.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useGetLinkLocaleSlug.d.ts +2 -0
- package/build/types/newsroom-context/hooks/useGetTranslationUrl.d.ts +6 -0
- package/build/types/newsroom-context/hooks/useLanguages.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useNewsroom.d.ts +1 -0
- package/build/types/newsroom-context/hooks/useNewsroomContext.d.ts +2 -0
- package/build/types/newsroom-context/index.d.ts +2 -0
- package/build/types/sentry/client.d.ts +2 -0
- package/build/types/sentry/common.d.ts +2 -0
- package/build/types/sentry/index.d.ts +2 -0
- package/build/types/sentry/server.d.ts +2 -0
- package/build/types/types.d.ts +14 -0
- package/package.json +14 -7
- package/src/components-nextjs/PageSeo/PageSeo.tsx +0 -2
- package/src/newsroom-context/context.tsx +0 -2
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +0 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +0 -1
- package/build/adapter-nextjs/api-handlers/index.js.map +0 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +0 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +0 -1
- package/build/adapter-nextjs/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/category.js.map +0 -1
- package/build/adapter-nextjs/page-props/gallery.js.map +0 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +0 -1
- package/build/adapter-nextjs/page-props/home.js.map +0 -1
- package/build/adapter-nextjs/page-props/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/lib/types.js.map +0 -1
- package/build/adapter-nextjs/page-props/search.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/types.js.map +0 -1
- package/build/adapter-nextjs/page-props/story.js.map +0 -1
- package/build/adapter-nextjs/page-props/storyPreview.js.map +0 -1
- package/build/adapter-nextjs/processRequest.js.map +0 -1
- package/build/adapter-nextjs/processStaticRequest.js.map +0 -1
- package/build/components-nextjs/PageSeo/PageSeo.js.map +0 -1
- package/build/components-nextjs/PageSeo/index.js.map +0 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +0 -1
- package/build/components-nextjs/PageSeo/lib/index.js.map +0 -1
- package/build/components-nextjs/StorySeo/StorySeo.js.map +0 -1
- package/build/components-nextjs/StorySeo/index.js.map +0 -1
- package/build/components-nextjs/document.js.map +0 -1
- package/build/components-nextjs/index.js.map +0 -1
- package/build/data-fetching/NextPrezlyApi.js.map +0 -1
- package/build/data-fetching/getNextPrezlyApi.js.map +0 -1
- package/build/data-fetching/index.js.map +0 -1
- package/build/index.js.map +0 -1
- package/build/infinite-loading/index.js.map +0 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +0 -1
- package/build/infinite-loading/useInfiniteLoading.js.map +0 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +0 -1
- package/build/intl/index.js.map +0 -1
- package/build/intl/languages.js.map +0 -1
- package/build/intl/locale.js.map +0 -1
- package/build/newsroom-context/context.js.map +0 -1
- package/build/newsroom-context/hooks/index.js.map +0 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +0 -1
- package/build/newsroom-context/hooks/useCategories.js.map +0 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentStory.js.map +0 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +0 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +0 -1
- package/build/newsroom-context/hooks/useLanguages.js.map +0 -1
- package/build/newsroom-context/hooks/useNewsroom.js.map +0 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +0 -1
- package/build/newsroom-context/index.js.map +0 -1
- package/build/sentry/client.js.map +0 -1
- package/build/sentry/index.js.map +0 -1
- package/build/sentry/server.js.map +0 -1
- package/build/types.js.map +0 -1
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/api-handlers/fetchGalleries.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/api-handlers/fetchGalleries.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/api-handlers/fetchStories.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/api-handlers/fetchStories.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/api-handlers/index.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/api-handlers/index.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/getNewsroomServerSideProps.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/getNewsroomServerSideProps.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/getNewsroomStaticProps.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/getNewsroomStaticProps.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/index.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/index.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/category.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/category.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/gallery.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/gallery.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/galleryAlbum.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/galleryAlbum.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/home.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/home.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/index.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/index.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/lib/types.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/lib/types.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/search.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/search.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/SitemapBuilder.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/SitemapBuilder.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/createPaths.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/createPaths.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/getServerSideProps.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/getServerSideProps.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/index.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/index.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/types.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/sitemap/types.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/story.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/story.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/storyPreview.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/page-props/storyPreview.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/processRequest.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/processRequest.js +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/processStaticRequest.d.ts +0 -0
- /package/build/{adapter-nextjs → cjs/adapter-nextjs}/processStaticRequest.js +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/PageSeo.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/index.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/index.js +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/lib/getAbsoluteUrl.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/lib/getAbsoluteUrl.js +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/lib/index.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/PageSeo/lib/index.js +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/StorySeo/StorySeo.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/StorySeo/StorySeo.js +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/StorySeo/index.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/StorySeo/index.js +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/document.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/document.js +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/index.d.ts +0 -0
- /package/build/{components-nextjs → cjs/components-nextjs}/index.js +0 -0
- /package/build/{data-fetching → cjs/data-fetching}/NextPrezlyApi.d.ts +0 -0
- /package/build/{data-fetching → cjs/data-fetching}/NextPrezlyApi.js +0 -0
- /package/build/{data-fetching → cjs/data-fetching}/getNextPrezlyApi.d.ts +0 -0
- /package/build/{data-fetching → cjs/data-fetching}/getNextPrezlyApi.js +0 -0
- /package/build/{data-fetching → cjs/data-fetching}/index.d.ts +0 -0
- /package/build/{data-fetching → cjs/data-fetching}/index.js +0 -0
- /package/build/{index.d.ts → cjs/index.d.ts} +0 -0
- /package/build/{index.js → cjs/index.js} +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/index.d.ts +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/index.js +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/types.d.ts +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/types.js +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/useInfiniteGalleriesLoading.d.ts +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/useInfiniteGalleriesLoading.js +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/useInfiniteLoading.d.ts +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/useInfiniteLoading.js +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/useInfiniteStoriesLoading.d.ts +0 -0
- /package/build/{infinite-loading → cjs/infinite-loading}/useInfiniteStoriesLoading.js +0 -0
- /package/build/{intl → cjs/intl}/index.d.ts +0 -0
- /package/build/{intl → cjs/intl}/index.js +0 -0
- /package/build/{intl → cjs/intl}/languages.d.ts +0 -0
- /package/build/{intl → cjs/intl}/languages.js +0 -0
- /package/build/{intl → cjs/intl}/locale.d.ts +0 -0
- /package/build/{intl → cjs/intl}/locale.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/context.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/index.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/index.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useAlgoliaSettings.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useAlgoliaSettings.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCategories.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCategories.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCompanyInformation.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCompanyInformation.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCurrentCategory.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCurrentCategory.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCurrentLocale.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCurrentLocale.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCurrentStory.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useCurrentStory.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useGetLinkLocaleSlug.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useGetLinkLocaleSlug.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useGetTranslationUrl.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useGetTranslationUrl.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useLanguages.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useLanguages.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useNewsroom.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useNewsroom.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useNewsroomContext.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/hooks/useNewsroomContext.js +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/index.d.ts +0 -0
- /package/build/{newsroom-context → cjs/newsroom-context}/index.js +0 -0
- /package/build/{sentry → cjs/sentry}/client.d.ts +0 -0
- /package/build/{sentry → cjs/sentry}/client.js +0 -0
- /package/build/{sentry → cjs/sentry}/common.d.ts +0 -0
- /package/build/{sentry → cjs/sentry}/common.js +0 -0
- /package/build/{sentry → cjs/sentry}/index.d.ts +0 -0
- /package/build/{sentry → cjs/sentry}/index.js +0 -0
- /package/build/{sentry → cjs/sentry}/server.d.ts +0 -0
- /package/build/{sentry → cjs/sentry}/server.js +0 -0
- /package/build/{types.d.ts → cjs/types.d.ts} +0 -0
- /package/build/{types.js → cjs/types.js} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { getShortestLocaleCode, LocaleObject } from '@prezly/theme-kit-core';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { useCurrentLocale } from './useCurrentLocale';
|
|
4
|
+
import { useLanguages } from './useLanguages';
|
|
5
|
+
/**
|
|
6
|
+
* Determines correct locale slug for the link (trying to shorten the locale code if possible).
|
|
7
|
+
* E.g. if newsroom has a single locale for Dutch (`nl_BE`), it will be shortened to `nl`.
|
|
8
|
+
* If there are more than one locale with the same language part, a full locale code will be used instead.
|
|
9
|
+
* `false` means that a default locale should be used (no locale in URL required).
|
|
10
|
+
*/
|
|
11
|
+
function getLinkLocaleSlug(languages, locale) {
|
|
12
|
+
const shortestLocaleCode = getShortestLocaleCode(languages, locale);
|
|
13
|
+
// When navigating to default language, we don't append the locale to the URL.
|
|
14
|
+
if (!shortestLocaleCode) {
|
|
15
|
+
return shortestLocaleCode;
|
|
16
|
+
}
|
|
17
|
+
return LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug();
|
|
18
|
+
}
|
|
19
|
+
export function useGetLinkLocaleSlug() {
|
|
20
|
+
const currentLocale = useCurrentLocale();
|
|
21
|
+
const languages = useLanguages();
|
|
22
|
+
// The `locale` parameter is mainly used for Language Dropdown
|
|
23
|
+
return useCallback((locale) => getLinkLocaleSlug(languages, locale || currentLocale), [languages, currentLocale]);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=useGetLinkLocaleSlug.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetLinkLocaleSlug.js","sourceRoot":"","sources":["../../../../src/newsroom-context/hooks/useGetLinkLocaleSlug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,SAAqC,EACrC,MAAoB;IAEpB,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpE,8EAA8E;IAC9E,IAAI,CAAC,kBAAkB,EAAE;QACrB,OAAO,kBAAkB,CAAC;KAC7B;IAED,OAAO,YAAY,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,SAAS,EAAE,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,oBAAoB;IAChC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IAEjC,8DAA8D;IAC9D,OAAO,WAAW,CACd,CAAC,MAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,IAAI,aAAa,CAAC,EAChF,CAAC,SAAS,EAAE,aAAa,CAAC,CAC7B,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Story } from '@prezly/sdk';
|
|
2
|
+
import { getCategoryHasTranslation, getCategoryUrl } from '@prezly/theme-kit-core';
|
|
3
|
+
import { useRouter } from 'next/router';
|
|
4
|
+
import { useCallback } from 'react';
|
|
5
|
+
import { useCurrentCategory } from './useCurrentCategory';
|
|
6
|
+
import { useCurrentStory } from './useCurrentStory';
|
|
7
|
+
// Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
|
|
8
|
+
// It looks like a hack, but the name of enum must be the same as in SDK
|
|
9
|
+
var Visibility;
|
|
10
|
+
(function (Visibility) {
|
|
11
|
+
Visibility["PUBLIC"] = "public";
|
|
12
|
+
Visibility["EMBARGO"] = "embargo";
|
|
13
|
+
Visibility["PRIVATE"] = "private";
|
|
14
|
+
Visibility["CONFIDENTIAL"] = "confidential";
|
|
15
|
+
})(Visibility || (Visibility = {}));
|
|
16
|
+
function getAllowedTranslationVisibilityValues(story) {
|
|
17
|
+
const { visibility } = story;
|
|
18
|
+
switch (visibility) {
|
|
19
|
+
case Visibility.EMBARGO:
|
|
20
|
+
return [Visibility.EMBARGO, Visibility.PUBLIC];
|
|
21
|
+
case Visibility.PRIVATE:
|
|
22
|
+
return [Visibility.PRIVATE, Visibility.PUBLIC];
|
|
23
|
+
case Visibility.CONFIDENTIAL:
|
|
24
|
+
return [Visibility.CONFIDENTIAL, Visibility.PRIVATE, Visibility.PUBLIC];
|
|
25
|
+
default:
|
|
26
|
+
return [Visibility.PUBLIC];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Determine correct URL for translated stories/categories with a fallback to homepage.
|
|
31
|
+
* E.g. if a story has a translation, the function will return the localized slug URL.
|
|
32
|
+
* If there is no translation for the story, it will return the index page URL (`/`),
|
|
33
|
+
* or empty string, if `noFallback` is set to `true` (this is useful for alternate locale links).
|
|
34
|
+
*/
|
|
35
|
+
function getTranslationUrl(locale, path, currentCategory, currentStory, noFallback) {
|
|
36
|
+
if (currentCategory) {
|
|
37
|
+
if (getCategoryHasTranslation(currentCategory, locale)) {
|
|
38
|
+
return getCategoryUrl(currentCategory, locale);
|
|
39
|
+
}
|
|
40
|
+
if (noFallback) {
|
|
41
|
+
return '';
|
|
42
|
+
}
|
|
43
|
+
return '/';
|
|
44
|
+
}
|
|
45
|
+
const localeCode = locale.toUnderscoreCode();
|
|
46
|
+
if (currentStory && currentStory.culture.locale !== localeCode) {
|
|
47
|
+
const allowedVisibilityValues = getAllowedTranslationVisibilityValues(currentStory);
|
|
48
|
+
const translatedStory = currentStory.translations.find(({ culture, lifecycle_status, visibility }) => culture.locale === localeCode &&
|
|
49
|
+
Story.isPublished(lifecycle_status) &&
|
|
50
|
+
allowedVisibilityValues.includes(visibility));
|
|
51
|
+
if (translatedStory) {
|
|
52
|
+
return `/${translatedStory.slug}`;
|
|
53
|
+
}
|
|
54
|
+
if (noFallback) {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
return '/';
|
|
58
|
+
}
|
|
59
|
+
return path;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* This hook returns a function that is meant to be used in language pickers and alternate locales list for the pages.
|
|
63
|
+
* `noFallback` parameter is useful for alternate language links in the `head` section of the document (so that there are no unwanted links to the homepage).
|
|
64
|
+
*/
|
|
65
|
+
export function useGetTranslationUrl() {
|
|
66
|
+
const { asPath } = useRouter();
|
|
67
|
+
const currentCategory = useCurrentCategory();
|
|
68
|
+
const currentStory = useCurrentStory();
|
|
69
|
+
return useCallback((locale, noFallback) => getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback), [asPath, currentCategory, currentStory]);
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=useGetTranslationUrl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../../../../src/newsroom-context/hooks/useLanguages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,YAAY;IACxB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNewsroom.js","sourceRoot":"","sources":["../../../../src/newsroom-context/hooks/useNewsroom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,WAAW;IACvB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { NewsroomContext } from '../context';
|
|
3
|
+
export function useNewsroomContext() {
|
|
4
|
+
// TS Compiler is having a hard time figuring this type implicitly, so we have to set it explicitly
|
|
5
|
+
// See https://github.com/microsoft/TypeScript/issues/5711#issuecomment-340283439
|
|
6
|
+
const newsroomContext = useContext(NewsroomContext);
|
|
7
|
+
if (!newsroomContext) {
|
|
8
|
+
throw new Error('No `NewsroomContextProvider` found when calling `useNewsroomContext`');
|
|
9
|
+
}
|
|
10
|
+
return newsroomContext;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=useNewsroomContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNewsroomContext.js","sourceRoot":"","sources":["../../../../src/newsroom-context/hooks/useNewsroomContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,UAAU,kBAAkB;IAC9B,mGAAmG;IACnG,iFAAiF;IACjF,MAAM,eAAe,GAAoC,UAAU,CAAC,eAAe,CAAC,CAAC;IACrF,IAAI,CAAC,eAAe,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KAC3F;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/newsroom-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAA6B,MAAM,WAAW,CAAC;AAChG,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/sentry/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,UAAU,sBAAsB,CAClC,GAAW,EACX,SAAwB;IAExB,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const IGNORED_EVENT_CULPRITS = [
|
|
2
|
+
// This usually means that something happened outside of application code.
|
|
3
|
+
// All instances of errors with this origin that I found usually were caused by referring to variables that couldn't ever exist in our code.
|
|
4
|
+
// Likely misbehaving browser extensions or people playing around in DevTools trying to break the app.
|
|
5
|
+
'<anonymous>',
|
|
6
|
+
'?(<anonymous>)',
|
|
7
|
+
'global code',
|
|
8
|
+
];
|
|
9
|
+
function shouldStackFrameBeIgnored(frame) {
|
|
10
|
+
const { abs_path, function: frameFunction } = frame;
|
|
11
|
+
if (abs_path &&
|
|
12
|
+
IGNORED_EVENT_CULPRITS.some((ignoredCulprit) => abs_path.includes(ignoredCulprit))) {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
if (frameFunction &&
|
|
16
|
+
IGNORED_EVENT_CULPRITS.some((ignoredCulprit) => frameFunction.includes(ignoredCulprit))) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
function shouldExceptionBeIgnored(exception) {
|
|
22
|
+
const { stacktrace } = exception;
|
|
23
|
+
// Ignore global code errors that are not related to the application code.
|
|
24
|
+
// See comments in `IGNORED_EVENT_CULPRITS` const for context on each entry
|
|
25
|
+
if (stacktrace && stacktrace.frames?.some(shouldStackFrameBeIgnored)) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
export function getCommonClientOptions(dsn, themeName) {
|
|
31
|
+
return {
|
|
32
|
+
dsn,
|
|
33
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
34
|
+
tracesSampleRate: 0.02,
|
|
35
|
+
// ...
|
|
36
|
+
// Note: if you want to override the automatic release value, do not set a
|
|
37
|
+
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
|
|
38
|
+
// that it will also get attached to your source maps
|
|
39
|
+
ignoreErrors: [
|
|
40
|
+
// This particular error is coming from Microsoft Outlook SafeLink crawler.
|
|
41
|
+
// It doesn't affect the user experience in any way, but produces a lot of unwanted Sentry events.
|
|
42
|
+
// See https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
|
|
43
|
+
'Object Not Found Matching Id',
|
|
44
|
+
// This error is caused by `beacon.min.js` polyfill in Cloudflare Insights. From what we see, it doesn't affect the user experience.
|
|
45
|
+
'Illegal invocation',
|
|
46
|
+
],
|
|
47
|
+
beforeSend: (event) => {
|
|
48
|
+
if (event.exception?.values?.every(shouldExceptionBeIgnored)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return event;
|
|
52
|
+
},
|
|
53
|
+
// Attach theme tag to each event
|
|
54
|
+
initialScope: (scope) => {
|
|
55
|
+
if (themeName) {
|
|
56
|
+
scope.setTags({ prezly_theme: themeName });
|
|
57
|
+
}
|
|
58
|
+
return scope;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/sentry/common.ts"],"names":[],"mappings":"AAEA,MAAM,sBAAsB,GAAG;IAC3B,0EAA0E;IAC1E,4IAA4I;IAC5I,sGAAsG;IACtG,aAAa;IACb,gBAAgB;IAChB,aAAa;CAChB,CAAC;AAEF,SAAS,yBAAyB,CAAC,KAAiB;IAChD,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAEpD,IACI,QAAQ;QACR,sBAAsB,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,EACpF;QACE,OAAO,IAAI,CAAC;KACf;IAED,IACI,aAAa;QACb,sBAAsB,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,EACzF;QACE,OAAO,IAAI,CAAC;KACf;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,SAAS,wBAAwB,CAAC,SAAoB;IAClD,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC;IAEjC,0EAA0E;IAC1E,2EAA2E;IAC3E,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,yBAAyB,CAAC,EAAE;QAClE,OAAO,IAAI,CAAC;KACf;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,sBAAsB,CAClC,GAAW,EACX,SAAwB;IAExB,OAAO;QACH,GAAG;QACH,4EAA4E;QAC5E,gBAAgB,EAAE,IAAI;QACtB,MAAM;QACN,0EAA0E;QAC1E,2EAA2E;QAC3E,qDAAqD;QAErD,YAAY,EAAE;YACV,2EAA2E;YAC3E,kGAAkG;YAClG,yGAAyG;YACzG,8BAA8B;YAC9B,oIAAoI;YACpI,oBAAoB;SACvB;QAED,UAAU,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,IAAI,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,CAAC,wBAAwB,CAAC,EAAE;gBAC1D,OAAO,IAAI,CAAC;aACf;YAED,OAAO,KAAK,CAAC;QACjB,CAAC;QAED,iCAAiC;QACjC,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE;YACpB,IAAI,SAAS,EAAE;gBACX,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;aAC9C;YACD,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/sentry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../../src/sentry/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,UAAU,sBAAsB,CAClC,GAAW,EACX,SAAwB;IAExB,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":""}
|