@prezly/theme-kit-nextjs 1.18.2 → 2.0.0-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/build/adapter-nextjs/api-handlers/fetchGalleries.js +3 -7
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +3 -7
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/index.js +2 -7
- package/build/adapter-nextjs/api-handlers/index.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +3 -7
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +3 -7
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/index.js +6 -22
- package/build/adapter-nextjs/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/category.d.ts +2 -2
- package/build/adapter-nextjs/page-props/category.js +19 -25
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +13 -18
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +13 -19
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
- package/build/adapter-nextjs/page-props/home.d.ts +2 -2
- package/build/adapter-nextjs/page-props/home.js +13 -18
- package/build/adapter-nextjs/page-props/home.js.map +1 -1
- package/build/adapter-nextjs/page-props/index.js +8 -41
- package/build/adapter-nextjs/page-props/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/lib/types.js +1 -2
- package/build/adapter-nextjs/page-props/search.js +10 -15
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +1 -5
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +1 -5
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +7 -11
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/index.js +4 -24
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/types.js +1 -2
- package/build/adapter-nextjs/page-props/story.js +17 -23
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +7 -11
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +5 -9
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +1 -5
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +25 -29
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/index.js +2 -20
- package/build/components-nextjs/PageSeo/index.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -5
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/types.js +1 -2
- package/build/components-nextjs/StorySeo/StorySeo.js +7 -11
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/components-nextjs/StorySeo/index.js +1 -5
- package/build/components-nextjs/StorySeo/index.js.map +1 -1
- package/build/components-nextjs/document.js +8 -35
- package/build/components-nextjs/document.js.map +1 -1
- package/build/components-nextjs/index.js +3 -9
- package/build/components-nextjs/index.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.d.ts +4 -5
- package/build/data-fetching/api/PrezlyApi.js +39 -44
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +5 -9
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/index.js +1 -17
- package/build/data-fetching/api/index.js.map +1 -1
- package/build/data-fetching/api/queries.js +5 -13
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/index.js +3 -19
- package/build/data-fetching/index.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +3 -7
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +3 -10
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/index.js +4 -11
- package/build/data-fetching/lib/index.js.map +1 -1
- package/build/data-fetching/lib/isSdkError.js +1 -5
- package/build/data-fetching/lib/isSdkError.js.map +1 -1
- package/build/data-fetching/lib/isUuid.js +1 -5
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/data-fetching/types.js +1 -2
- package/build/index.js +9 -25
- package/build/index.js.map +1 -1
- package/build/infinite-loading/index.js +4 -24
- package/build/infinite-loading/index.js.map +1 -1
- package/build/infinite-loading/types.js +1 -2
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +3 -7
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +9 -13
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.d.ts +2 -2
- package/build/infinite-loading/useInfiniteStoriesLoading.js +7 -11
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/index.d.ts +1 -1
- package/build/intl/index.js +4 -25
- package/build/intl/index.js.map +1 -1
- package/build/intl/languages.d.ts +1 -1
- package/build/intl/languages.js +23 -37
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.js +11 -17
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.d.ts +1 -2
- package/build/intl/localeConfig.js +3 -4
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeList.d.ts +4 -2
- package/build/intl/localeList.js +1 -2
- package/build/intl/localeList.js.map +1 -1
- package/build/intl/localeObject.js +3 -10
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +7 -11
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/index.js +11 -27
- package/build/newsroom-context/hooks/index.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +3 -7
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
- package/build/newsroom-context/hooks/useCategories.js +3 -7
- package/build/newsroom-context/hooks/useCategories.js.map +1 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +3 -7
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +3 -7
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +3 -7
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +3 -7
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +10 -14
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +24 -31
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/newsroom-context/hooks/useLanguages.js +3 -7
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroom.js +3 -7
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js +4 -8
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
- package/build/newsroom-context/index.js +2 -21
- package/build/newsroom-context/index.js.map +1 -1
- package/build/sentry/client.js +3 -7
- package/build/sentry/client.js.map +1 -1
- package/build/sentry/common.js +1 -5
- package/build/sentry/common.js.map +1 -1
- package/build/sentry/index.js +2 -7
- package/build/sentry/index.js.map +1 -1
- package/build/sentry/server.js +3 -7
- package/build/sentry/server.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types.d.ts +2 -2
- package/build/types.js +1 -2
- package/build/utils/boilerplate.js +3 -9
- package/build/utils/boilerplate.js.map +1 -1
- package/build/utils/constants.js +3 -6
- package/build/utils/constants.js.map +1 -1
- package/build/utils/getAssetsUrl.js +3 -7
- package/build/utils/getAssetsUrl.js.map +1 -1
- package/build/utils/getDataRequestLink.js +3 -7
- package/build/utils/getDataRequestLink.js.map +1 -1
- package/build/utils/getLocalizedCategoryData.js +3 -9
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +5 -10
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +1 -5
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +1 -5
- package/build/utils/getStoryPublicationDate.js.map +1 -1
- package/build/utils/getUploadcareGroupUrl.js +3 -7
- package/build/utils/getUploadcareGroupUrl.js.map +1 -1
- package/build/utils/index.js +10 -26
- package/build/utils/index.js.map +1 -1
- package/build/utils/isEmbargoStory.js +1 -5
- package/build/utils/isEmbargoStory.js.map +1 -1
- package/package.json +17 -17
- package/src/@types/global.d.ts +0 -7
- package/src/__mocks__/languages.ts +0 -417
- package/src/__mocks__/story.ts +0 -351
- package/src/adapter-nextjs/api-handlers/fetchGalleries.ts +0 -24
- package/src/adapter-nextjs/api-handlers/fetchStories.ts +0 -26
- package/src/adapter-nextjs/api-handlers/index.ts +0 -2
- package/src/adapter-nextjs/getNewsroomServerSideProps.ts +0 -29
- package/src/adapter-nextjs/getNewsroomStaticProps.ts +0 -29
- package/src/adapter-nextjs/index.ts +0 -6
- package/src/adapter-nextjs/page-props/category.ts +0 -157
- package/src/adapter-nextjs/page-props/gallery.ts +0 -114
- package/src/adapter-nextjs/page-props/galleryAlbum.ts +0 -89
- package/src/adapter-nextjs/page-props/home.ts +0 -113
- package/src/adapter-nextjs/page-props/index.ts +0 -26
- package/src/adapter-nextjs/page-props/lib/types.ts +0 -8
- package/src/adapter-nextjs/page-props/search.ts +0 -53
- package/src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts +0 -56
- package/src/adapter-nextjs/page-props/sitemap/createPaths.ts +0 -21
- package/src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts +0 -43
- package/src/adapter-nextjs/page-props/sitemap/index.ts +0 -5
- package/src/adapter-nextjs/page-props/sitemap/types.ts +0 -5
- package/src/adapter-nextjs/page-props/story.ts +0 -94
- package/src/adapter-nextjs/page-props/storyPreview.ts +0 -33
- package/src/adapter-nextjs/processRequest.ts +0 -49
- package/src/adapter-nextjs/processStaticRequest.ts +0 -32
- package/src/components-nextjs/PageSeo/PageSeo.tsx +0 -131
- package/src/components-nextjs/PageSeo/index.ts +0 -2
- package/src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts +0 -7
- package/src/components-nextjs/PageSeo/lib/types.ts +0 -4
- package/src/components-nextjs/StorySeo/StorySeo.tsx +0 -80
- package/src/components-nextjs/StorySeo/index.ts +0 -1
- package/src/components-nextjs/document.tsx +0 -38
- package/src/components-nextjs/index.ts +0 -3
- package/src/data-fetching/api/PrezlyApi.ts +0 -302
- package/src/data-fetching/api/getPrezlyApi.ts +0 -24
- package/src/data-fetching/api/index.ts +0 -1
- package/src/data-fetching/api/queries.ts +0 -51
- package/src/data-fetching/index.ts +0 -3
- package/src/data-fetching/lib/getAlgoliaSettings.ts +0 -29
- package/src/data-fetching/lib/getEnvVariables.ts +0 -46
- package/src/data-fetching/lib/index.ts +0 -4
- package/src/data-fetching/lib/isSdkError.ts +0 -5
- package/src/data-fetching/lib/isUuid.ts +0 -5
- package/src/data-fetching/types.ts +0 -14
- package/src/index.ts +0 -9
- package/src/infinite-loading/index.ts +0 -4
- package/src/infinite-loading/types.ts +0 -5
- package/src/infinite-loading/useInfiniteGalleriesLoading.ts +0 -53
- package/src/infinite-loading/useInfiniteLoading.ts +0 -66
- package/src/infinite-loading/useInfiniteStoriesLoading.ts +0 -81
- package/src/intl/index.ts +0 -4
- package/src/intl/languages.test.ts +0 -232
- package/src/intl/languages.ts +0 -233
- package/src/intl/locale.test.ts +0 -94
- package/src/intl/locale.ts +0 -140
- package/src/intl/localeConfig.js +0 -23
- package/src/intl/localeList.js +0 -110
- package/src/intl/localeObject.test.ts +0 -81
- package/src/intl/localeObject.ts +0 -99
- package/src/newsroom-context/context.tsx +0 -115
- package/src/newsroom-context/hooks/index.ts +0 -11
- package/src/newsroom-context/hooks/useAlgoliaSettings.ts +0 -7
- package/src/newsroom-context/hooks/useCategories.ts +0 -7
- package/src/newsroom-context/hooks/useCompanyInformation.ts +0 -7
- package/src/newsroom-context/hooks/useCurrentCategory.ts +0 -7
- package/src/newsroom-context/hooks/useCurrentLocale.ts +0 -7
- package/src/newsroom-context/hooks/useCurrentStory.ts +0 -7
- package/src/newsroom-context/hooks/useGetLinkLocaleSlug.ts +0 -37
- package/src/newsroom-context/hooks/useGetTranslationUrl.ts +0 -96
- package/src/newsroom-context/hooks/useLanguages.ts +0 -7
- package/src/newsroom-context/hooks/useNewsroom.ts +0 -7
- package/src/newsroom-context/hooks/useNewsroomContext.ts +0 -15
- package/src/newsroom-context/index.ts +0 -2
- package/src/sentry/client.ts +0 -7
- package/src/sentry/common.ts +0 -27
- package/src/sentry/index.ts +0 -2
- package/src/sentry/server.ts +0 -7
- package/src/types.ts +0 -51
- package/src/utils/boilerplate.ts +0 -27
- package/src/utils/constants.ts +0 -3
- package/src/utils/getAssetsUrl.test.ts +0 -9
- package/src/utils/getAssetsUrl.ts +0 -9
- package/src/utils/getDataRequestLink.ts +0 -14
- package/src/utils/getLocalizedCategoryData.ts +0 -47
- package/src/utils/getNewsroomLogoUrl.ts +0 -22
- package/src/utils/getPrivacyPortalUrl.ts +0 -25
- package/src/utils/getStoryPublicationDate.tsx +0 -15
- package/src/utils/getUploadcareGroupUrl.ts +0 -13
- package/src/utils/index.ts +0 -10
- package/src/utils/isEmbargoStory.ts +0 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/index.ts"],"names":[],"mappings":"
|
|
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,YAAY,CAAC;AACpB,OAAO,EACH,6BAA6B,EAC7B,yBAAyB,GAE5B,MAAM,WAAW,CAAC;AACnB,OAAO,EACH,kCAAkC,EAClC,8BAA8B,EAC9B,8BAA8B,GAEjC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAsB,MAAM,QAAQ,CAAC;AAChG,OAAO,EAAE,4BAA4B,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAClF,cAAc,WAAW,CAAC;AAC1B,OAAO,EACH,2BAA2B,EAC3B,uBAAuB,EACvB,uBAAuB,GAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,kCAAkC,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const processRequest_1 = require("../processRequest");
|
|
7
|
-
const processStaticRequest_1 = require("../processStaticRequest");
|
|
8
|
-
function getSearchPageServerSideProps(customProps) {
|
|
1
|
+
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps';
|
|
2
|
+
import { getNewsroomStaticProps } from '../getNewsroomStaticProps';
|
|
3
|
+
import { processRequest } from '../processRequest';
|
|
4
|
+
import { processStaticRequest } from '../processStaticRequest';
|
|
5
|
+
export function getSearchPageServerSideProps(customProps) {
|
|
9
6
|
return async function getServerSideProps(context) {
|
|
10
|
-
const { serverSideProps } = await
|
|
11
|
-
return
|
|
7
|
+
const { serverSideProps } = await getNewsroomServerSideProps(context);
|
|
8
|
+
return processRequest(context, {
|
|
12
9
|
...serverSideProps,
|
|
13
10
|
...(typeof customProps === 'function'
|
|
14
11
|
? await customProps(context, serverSideProps)
|
|
@@ -16,11 +13,10 @@ function getSearchPageServerSideProps(customProps) {
|
|
|
16
13
|
}, '/search');
|
|
17
14
|
};
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
function getSearchPageStaticProps(customProps) {
|
|
16
|
+
export function getSearchPageStaticProps(customProps) {
|
|
21
17
|
return async function getStaticProps(context) {
|
|
22
|
-
const { staticProps } = await
|
|
23
|
-
return
|
|
18
|
+
const { staticProps } = await getNewsroomStaticProps(context);
|
|
19
|
+
return processStaticRequest(context, {
|
|
24
20
|
...staticProps,
|
|
25
21
|
...(typeof customProps === 'function'
|
|
26
22
|
? await customProps(context, staticProps)
|
|
@@ -28,5 +24,4 @@ function getSearchPageStaticProps(customProps) {
|
|
|
28
24
|
});
|
|
29
25
|
};
|
|
30
26
|
}
|
|
31
|
-
exports.getSearchPageStaticProps = getSearchPageStaticProps;
|
|
32
27
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/search.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAI/D,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,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SitemapBuilder = void 0;
|
|
4
|
-
class SitemapBuilder {
|
|
1
|
+
export class SitemapBuilder {
|
|
5
2
|
baseUrl;
|
|
6
3
|
urls = [];
|
|
7
4
|
constructor(baseUrl) {
|
|
@@ -47,5 +44,4 @@ class SitemapBuilder {
|
|
|
47
44
|
].join('\n');
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
|
-
exports.SitemapBuilder = SitemapBuilder;
|
|
51
47
|
//# sourceMappingURL=SitemapBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SitemapBuilder.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts"],"names":[],"mappings":"
|
|
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,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createPaths = void 0;
|
|
4
|
-
function createPaths(stories, categories) {
|
|
1
|
+
export function createPaths(stories, categories) {
|
|
5
2
|
const storiesUrls = stories.map(({ slug }) => `/${slug}`);
|
|
6
3
|
const categoriesUrls = categories
|
|
7
4
|
.map((category) => {
|
|
@@ -15,5 +12,4 @@ function createPaths(stories, categories) {
|
|
|
15
12
|
.flat();
|
|
16
13
|
return [...storiesUrls, ...categoriesUrls];
|
|
17
14
|
}
|
|
18
|
-
exports.createPaths = createPaths;
|
|
19
15
|
//# sourceMappingURL=createPaths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPaths.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/createPaths.ts"],"names":[],"mappings":"
|
|
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,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const createPaths_1 = require("./createPaths");
|
|
6
|
-
const SitemapBuilder_1 = require("./SitemapBuilder");
|
|
7
|
-
function getSitemapServerSideProps(additionalPaths) {
|
|
1
|
+
import { getPrezlyApi } from '../../../data-fetching';
|
|
2
|
+
import { createPaths } from './createPaths';
|
|
3
|
+
import { SitemapBuilder } from './SitemapBuilder';
|
|
4
|
+
export function getSitemapServerSideProps(additionalPaths) {
|
|
8
5
|
return async function getServerSideProps(ctx) {
|
|
9
6
|
const { res, req } = ctx;
|
|
10
7
|
if (!req || !res) {
|
|
@@ -14,11 +11,11 @@ function getSitemapServerSideProps(additionalPaths) {
|
|
|
14
11
|
};
|
|
15
12
|
}
|
|
16
13
|
const baseUrl = req.headers.host || '/';
|
|
17
|
-
const api =
|
|
14
|
+
const api = getPrezlyApi(req);
|
|
18
15
|
const stories = await api.getAllStories();
|
|
19
16
|
const categories = await api.getCategories();
|
|
20
|
-
const paths =
|
|
21
|
-
const sitemapBuilder = new
|
|
17
|
+
const paths = createPaths(stories, categories);
|
|
18
|
+
const sitemapBuilder = new SitemapBuilder(baseUrl);
|
|
22
19
|
sitemapBuilder.addUrl('/');
|
|
23
20
|
paths.forEach((path) => sitemapBuilder.addUrl(path));
|
|
24
21
|
if (additionalPaths) {
|
|
@@ -32,5 +29,4 @@ function getSitemapServerSideProps(additionalPaths) {
|
|
|
32
29
|
};
|
|
33
30
|
};
|
|
34
31
|
}
|
|
35
|
-
exports.getSitemapServerSideProps = getSitemapServerSideProps;
|
|
36
32
|
//# sourceMappingURL=getServerSideProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getServerSideProps.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getServerSideProps.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,MAAM,UAAU,yBAAyB,CAAC,eAA0B;IAChE,OAAO,KAAK,UAAU,kBAAkB,CAAC,GAAoB;QACzD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;QAEzB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE;YACd,cAAc;YACd,OAAO;gBACH,KAAK,EAAE,EAAE;aACZ,CAAC;SACL;QAED,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;QAExC,MAAM,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAE7C,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC/C,MAAM,cAAc,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;QAEnD,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAErD,IAAI,eAAe,EAAE;YACjB,eAAe,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SAClE;QAED,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QAC1C,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;QACtC,GAAG,CAAC,GAAG,EAAE,CAAC;QAEV,OAAO;YACH,KAAK,EAAE,EAAE;SACZ,CAAC;IACN,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -1,25 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.createPaths = exports.SitemapBuilder = exports.getSitemapServerSideProps = void 0;
|
|
18
|
-
var getServerSideProps_1 = require("./getServerSideProps");
|
|
19
|
-
Object.defineProperty(exports, "getSitemapServerSideProps", { enumerable: true, get: function () { return getServerSideProps_1.getSitemapServerSideProps; } });
|
|
20
|
-
var SitemapBuilder_1 = require("./SitemapBuilder");
|
|
21
|
-
Object.defineProperty(exports, "SitemapBuilder", { enumerable: true, get: function () { return SitemapBuilder_1.SitemapBuilder; } });
|
|
22
|
-
var createPaths_1 = require("./createPaths");
|
|
23
|
-
Object.defineProperty(exports, "createPaths", { enumerable: true, get: function () { return createPaths_1.createPaths; } });
|
|
24
|
-
__exportStar(require("./types"), exports);
|
|
1
|
+
export { getSitemapServerSideProps } from './getServerSideProps';
|
|
2
|
+
export { SitemapBuilder } from './SitemapBuilder';
|
|
3
|
+
export { createPaths } from './createPaths';
|
|
4
|
+
export * from './types';
|
|
25
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,cAAc,SAAS,CAAC"}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const processRequest_1 = require("../processRequest");
|
|
9
|
-
const processStaticRequest_1 = require("../processStaticRequest");
|
|
10
|
-
function getStoryPageServerSideProps(customProps) {
|
|
1
|
+
import { getPrezlyApi } from '../../data-fetching';
|
|
2
|
+
import { DUMMY_DEFAULT_LOCALE } from '../../intl';
|
|
3
|
+
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps';
|
|
4
|
+
import { getNewsroomStaticProps } from '../getNewsroomStaticProps';
|
|
5
|
+
import { processRequest } from '../processRequest';
|
|
6
|
+
import { processStaticRequest } from '../processStaticRequest';
|
|
7
|
+
export function getStoryPageServerSideProps(customProps) {
|
|
11
8
|
return async function getServerSideProps(context) {
|
|
12
|
-
const api =
|
|
9
|
+
const api = getPrezlyApi(context.req);
|
|
13
10
|
const { slug } = context.params;
|
|
14
11
|
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
15
12
|
if (!story) {
|
|
16
13
|
return { notFound: true };
|
|
17
14
|
}
|
|
18
|
-
const { serverSideProps } = await
|
|
15
|
+
const { serverSideProps } = await getNewsroomServerSideProps(context, { story });
|
|
19
16
|
const { locale } = context;
|
|
20
|
-
if (locale && locale !==
|
|
17
|
+
if (locale && locale !== DUMMY_DEFAULT_LOCALE) {
|
|
21
18
|
return {
|
|
22
19
|
redirect: {
|
|
23
20
|
destination: `/${slug}`,
|
|
@@ -26,7 +23,7 @@ function getStoryPageServerSideProps(customProps) {
|
|
|
26
23
|
};
|
|
27
24
|
}
|
|
28
25
|
serverSideProps.newsroomContextProps.currentStory = story;
|
|
29
|
-
return
|
|
26
|
+
return processRequest(context, {
|
|
30
27
|
...serverSideProps,
|
|
31
28
|
...(typeof customProps === 'function'
|
|
32
29
|
? await customProps(context, serverSideProps)
|
|
@@ -34,18 +31,17 @@ function getStoryPageServerSideProps(customProps) {
|
|
|
34
31
|
});
|
|
35
32
|
};
|
|
36
33
|
}
|
|
37
|
-
|
|
38
|
-
function getStoryPageStaticProps(customProps) {
|
|
34
|
+
export function getStoryPageStaticProps(customProps) {
|
|
39
35
|
return async function getStaticProps(context) {
|
|
40
|
-
const api =
|
|
36
|
+
const api = getPrezlyApi();
|
|
41
37
|
const { slug } = context.params;
|
|
42
38
|
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
43
39
|
if (!story) {
|
|
44
40
|
return { notFound: true };
|
|
45
41
|
}
|
|
46
|
-
const { staticProps } = await
|
|
42
|
+
const { staticProps } = await getNewsroomStaticProps(context, { story });
|
|
47
43
|
staticProps.newsroomContextProps.currentStory = story;
|
|
48
|
-
return
|
|
44
|
+
return processStaticRequest(context, {
|
|
49
45
|
...staticProps,
|
|
50
46
|
...(typeof customProps === 'function'
|
|
51
47
|
? await customProps(context, staticProps)
|
|
@@ -53,9 +49,8 @@ function getStoryPageStaticProps(customProps) {
|
|
|
53
49
|
});
|
|
54
50
|
};
|
|
55
51
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const api = (0, data_fetching_1.getPrezlyApi)();
|
|
52
|
+
export async function getStoryPageStaticPaths() {
|
|
53
|
+
const api = getPrezlyApi();
|
|
59
54
|
const stories = await api.getAllStories();
|
|
60
55
|
const paths = stories.map(({ slug }) => ({ params: { slug } }));
|
|
61
56
|
return {
|
|
@@ -63,5 +58,4 @@ async function getStoryPageStaticPaths() {
|
|
|
63
58
|
fallback: 'blocking',
|
|
64
59
|
};
|
|
65
60
|
}
|
|
66
|
-
exports.getStoryPageStaticPaths = getStoryPageStaticPaths;
|
|
67
61
|
//# sourceMappingURL=story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/story.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/story.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAA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6
|
-
const processRequest_1 = require("../processRequest");
|
|
7
|
-
function getStoryPreviewPageServerSideProps(customProps) {
|
|
1
|
+
import { getPrezlyApi } from '../../data-fetching';
|
|
2
|
+
import { getNewsroomServerSideProps } from '../getNewsroomServerSideProps';
|
|
3
|
+
import { processRequest } from '../processRequest';
|
|
4
|
+
export function getStoryPreviewPageServerSideProps(customProps) {
|
|
8
5
|
return async function getServerSideProps(context) {
|
|
9
|
-
const api =
|
|
6
|
+
const api = getPrezlyApi(context.req);
|
|
10
7
|
const { uuid } = context.params;
|
|
11
8
|
const story = await api.getStory(uuid);
|
|
12
9
|
if (!story) {
|
|
13
10
|
return { notFound: true };
|
|
14
11
|
}
|
|
15
|
-
const { serverSideProps } = await
|
|
12
|
+
const { serverSideProps } = await getNewsroomServerSideProps(context, { story });
|
|
16
13
|
serverSideProps.newsroomContextProps.currentStory = story;
|
|
17
|
-
return
|
|
14
|
+
return processRequest(context, {
|
|
18
15
|
...serverSideProps,
|
|
19
16
|
...(typeof customProps === 'function'
|
|
20
17
|
? await customProps(context, serverSideProps)
|
|
@@ -22,5 +19,4 @@ function getStoryPreviewPageServerSideProps(customProps) {
|
|
|
22
19
|
});
|
|
23
20
|
};
|
|
24
21
|
}
|
|
25
|
-
exports.getStoryPreviewPageServerSideProps = getStoryPreviewPageServerSideProps;
|
|
26
22
|
//# sourceMappingURL=storyPreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAInD,MAAM,UAAU,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,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,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processRequest = void 0;
|
|
4
|
-
const intl_1 = require("../intl");
|
|
1
|
+
import { getRedirectToCanonicalLocale, getShortestLocaleCode, LocaleObject } from '../intl';
|
|
5
2
|
/**
|
|
6
3
|
* This function combines the props returned from `getNewsroomServerSideProps` and your optional custom props for the page.
|
|
7
4
|
* It also handles locale redirects, if `canonicalUrl` parameter is provided.
|
|
@@ -11,7 +8,7 @@ const intl_1 = require("../intl");
|
|
|
11
8
|
* @param props Object containing the return of `getNewsroomServerSideProps` and your optional custom props.
|
|
12
9
|
* @param canonicalUrl Optional: a canonical URL for the current page without locale part. If provided, locale redirects will be handled by the function.
|
|
13
10
|
*/
|
|
14
|
-
function processRequest(context, props, canonicalUrl) {
|
|
11
|
+
export function processRequest(context, props, canonicalUrl) {
|
|
15
12
|
const { locale: nextLocale, query } = context;
|
|
16
13
|
const { localeResolved, ...pageProps } = props;
|
|
17
14
|
// If no locale was provided by Next, it most likely means that the theme is not supporting multi-language.
|
|
@@ -21,9 +18,9 @@ function processRequest(context, props, canonicalUrl) {
|
|
|
21
18
|
}
|
|
22
19
|
if (canonicalUrl) {
|
|
23
20
|
const { languages, localeCode } = pageProps.newsroomContextProps;
|
|
24
|
-
const currentLocale =
|
|
25
|
-
const shortestLocaleCode =
|
|
26
|
-
const redirect =
|
|
21
|
+
const currentLocale = LocaleObject.fromAnyCode(localeCode);
|
|
22
|
+
const shortestLocaleCode = getShortestLocaleCode(languages, currentLocale);
|
|
23
|
+
const redirect = getRedirectToCanonicalLocale(shortestLocaleCode, nextLocale, canonicalUrl, query);
|
|
27
24
|
if (redirect) {
|
|
28
25
|
return { redirect };
|
|
29
26
|
}
|
|
@@ -32,5 +29,4 @@ function processRequest(context, props, canonicalUrl) {
|
|
|
32
29
|
props: pageProps,
|
|
33
30
|
};
|
|
34
31
|
}
|
|
35
|
-
exports.processRequest = processRequest;
|
|
36
32
|
//# sourceMappingURL=processRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAG5F;;;;;;;;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"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processStaticRequest = void 0;
|
|
4
1
|
/**
|
|
5
2
|
* This function combines the props returned from `getNewsroomStaticProps` and your optional custom props for the page.
|
|
6
3
|
* See README for usage examples.
|
|
@@ -9,7 +6,7 @@ exports.processStaticRequest = void 0;
|
|
|
9
6
|
* @param props Object containing the return of `getNewsroomServerSideProps` and your optional custom props.
|
|
10
7
|
* @param revalidateTimeout Optional: timeout in seconds to use with Next ISR.
|
|
11
8
|
*/
|
|
12
|
-
function processStaticRequest(context, props, revalidateTimeout) {
|
|
9
|
+
export function processStaticRequest(context, props, revalidateTimeout) {
|
|
13
10
|
const { locale: nextLocale } = context;
|
|
14
11
|
const { localeResolved, ...pageProps } = props;
|
|
15
12
|
// If no locale was provided by Next, it most likely means that the theme is not supporting multi-language.
|
|
@@ -22,5 +19,4 @@ function processStaticRequest(context, props, revalidateTimeout) {
|
|
|
22
19
|
revalidate: revalidateTimeout,
|
|
23
20
|
};
|
|
24
21
|
}
|
|
25
|
-
exports.processStaticRequest = processStaticRequest;
|
|
26
22
|
//# sourceMappingURL=processStaticRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processStaticRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processStaticRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"processStaticRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processStaticRequest.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAChC,OAA8B,EAC9B,KAA8C,EAC9C,iBAA0B;IAE1B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,2GAA2G;IAC3G,uCAAuC;IACvC,IAAI,CAAC,cAAc,IAAI,UAAU,EAAE;QAC/B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC7B;IAED,OAAO;QACH,KAAK,EAAE,SAA8B;QACrC,UAAU,EAAE,iBAAiB;KAChC,CAAC;AACN,CAAC"}
|
|
@@ -1,48 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const newsroom_context_1 = require("../../newsroom-context");
|
|
10
|
-
const utils_1 = require("../../utils");
|
|
11
|
-
const getAbsoluteUrl_1 = require("./lib/getAbsoluteUrl");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { NextSeo } from 'next-seo';
|
|
3
|
+
import { useRouter } from 'next/router';
|
|
4
|
+
import { useMemo } from 'react';
|
|
5
|
+
import { getUsedLanguages, LocaleObject } from '../../intl';
|
|
6
|
+
import { useCompanyInformation, useCurrentLocale, useCurrentStory, useGetLinkLocaleSlug, useGetTranslationUrl, useLanguages, useNewsroom, } from '../../newsroom-context';
|
|
7
|
+
import { getNewsroomLogoUrl } from '../../utils';
|
|
8
|
+
import { getAbsoluteUrl } from './lib/getAbsoluteUrl';
|
|
12
9
|
/**
|
|
13
10
|
* This component provides base page attributes for every Newsroom page.
|
|
14
11
|
* It depends on information from NewsroomContext, so the component should be placed inside the `NewsroomContextProvider`.
|
|
15
12
|
* You can pass additional props expected by NextSeo component to override any info that is provided by the NewsroomContext.
|
|
16
13
|
*/
|
|
17
|
-
function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter, ...nextSeoProps }) {
|
|
18
|
-
const companyInformation =
|
|
19
|
-
const newsroom =
|
|
20
|
-
const currentLocale =
|
|
21
|
-
const languages =
|
|
22
|
-
const getTranslationUrl =
|
|
23
|
-
const getLinkLocaleSlug =
|
|
24
|
-
const currentStory =
|
|
25
|
-
const { asPath } =
|
|
14
|
+
export function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter, ...nextSeoProps }) {
|
|
15
|
+
const companyInformation = useCompanyInformation();
|
|
16
|
+
const newsroom = useNewsroom();
|
|
17
|
+
const currentLocale = useCurrentLocale();
|
|
18
|
+
const languages = useLanguages();
|
|
19
|
+
const getTranslationUrl = useGetTranslationUrl();
|
|
20
|
+
const getLinkLocaleSlug = useGetLinkLocaleSlug();
|
|
21
|
+
const currentStory = useCurrentStory();
|
|
22
|
+
const { asPath } = useRouter();
|
|
26
23
|
const pageTitle = title || companyInformation.name;
|
|
27
24
|
const pageDescription = description || companyInformation.about_plaintext;
|
|
28
|
-
const canonicalUrl = canonical ||
|
|
25
|
+
const canonicalUrl = canonical || getAbsoluteUrl(asPath, newsroom.url, getLinkLocaleSlug(currentLocale));
|
|
29
26
|
const siteName = companyInformation.name;
|
|
30
|
-
const logoUrl = imageUrl ||
|
|
31
|
-
const alternateLanguageLinks =
|
|
27
|
+
const logoUrl = imageUrl || getNewsroomLogoUrl(newsroom);
|
|
28
|
+
const alternateLanguageLinks = useMemo(() => {
|
|
32
29
|
if (!languages.length) {
|
|
33
30
|
return [];
|
|
34
31
|
}
|
|
35
|
-
const alternateLanguages =
|
|
32
|
+
const alternateLanguages = getUsedLanguages(languages).filter((language) => language.code !== currentLocale.toUnderscoreCode());
|
|
36
33
|
return alternateLanguages
|
|
37
34
|
.map((language) => {
|
|
38
|
-
const locale =
|
|
35
|
+
const locale = LocaleObject.fromAnyCode(language.code);
|
|
39
36
|
const translationLink = getTranslationUrl(locale, true);
|
|
40
37
|
if (!translationLink) {
|
|
41
38
|
return undefined;
|
|
42
39
|
}
|
|
43
40
|
return {
|
|
44
41
|
hrefLang: locale.toHyphenCode(),
|
|
45
|
-
href:
|
|
42
|
+
href: getAbsoluteUrl(translationLink, newsroom.url, currentStory && translationLink !== '/' ? false : getLinkLocaleSlug(locale)),
|
|
46
43
|
};
|
|
47
44
|
})
|
|
48
45
|
.filter(Boolean);
|
|
@@ -54,7 +51,7 @@ function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter,
|
|
|
54
51
|
newsroom.url,
|
|
55
52
|
currentStory,
|
|
56
53
|
]);
|
|
57
|
-
return ((
|
|
54
|
+
return (_jsx(NextSeo, { title: pageTitle, description: pageDescription, canonical: canonicalUrl, noindex: nextSeoProps.noindex ?? !newsroom.is_indexable, nofollow: nextSeoProps.nofollow ?? !newsroom.is_indexable, openGraph: {
|
|
58
55
|
url: canonicalUrl,
|
|
59
56
|
title: pageTitle,
|
|
60
57
|
description: pageDescription,
|
|
@@ -75,9 +72,8 @@ function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter,
|
|
|
75
72
|
{
|
|
76
73
|
rel: 'alternate',
|
|
77
74
|
type: 'application/rss+xml',
|
|
78
|
-
href:
|
|
75
|
+
href: getAbsoluteUrl('/feed', newsroom.url),
|
|
79
76
|
},
|
|
80
77
|
], languageAlternates: alternateLanguageLinks, ...nextSeoProps }));
|
|
81
78
|
}
|
|
82
|
-
exports.PageSeo = PageSeo;
|
|
83
79
|
//# sourceMappingURL=PageSeo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/PageSeo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageSeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/PageSeo.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EACH,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,YAAY,EACZ,WAAW,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAOtD;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,EACpB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,GAAG,YAAY,EACX;IACJ,MAAM,kBAAkB,GAAG,qBAAqB,EAAE,CAAC;IACnD,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IACjC,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IACjD,MAAM,iBAAiB,GAAG,oBAAoB,EAAE,CAAC;IACjD,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAC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" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.PageSeo = void 0;
|
|
18
|
-
var PageSeo_1 = require("./PageSeo");
|
|
19
|
-
Object.defineProperty(exports, "PageSeo", { enumerable: true, get: function () { return PageSeo_1.PageSeo; } });
|
|
20
|
-
__exportStar(require("./lib/types"), exports);
|
|
1
|
+
export { PageSeo } from './PageSeo';
|
|
2
|
+
export * from './lib/types';
|
|
21
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,aAAa,CAAC"}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAbsoluteUrl = void 0;
|
|
4
1
|
// Returns absolute URL based on the path and without any query parameters
|
|
5
|
-
function getAbsoluteUrl(path, origin, localeCode) {
|
|
2
|
+
export function getAbsoluteUrl(path, origin, localeCode) {
|
|
6
3
|
const url = new URL(`${localeCode ? `/${localeCode}` : ''}${path || '/'}`, origin);
|
|
7
4
|
url.search = '';
|
|
8
5
|
return url.toString();
|
|
9
6
|
}
|
|
10
|
-
exports.getAbsoluteUrl = getAbsoluteUrl;
|
|
11
7
|
//# sourceMappingURL=getAbsoluteUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAbsoluteUrl.js","sourceRoot":"","sources":["../../../../src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getAbsoluteUrl.js","sourceRoot":"","sources":["../../../../src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,UAAU,cAAc,CAAC,IAAY,EAAE,MAAc,EAAE,UAA2B;IACpF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IACnF,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAEhB,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC"}
|