@prezly/theme-kit-nextjs 1.18.2 → 2.0.0-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/@types/global.d.js +1 -0
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +27 -23
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +37 -25
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/index.js +2 -8
- package/build/adapter-nextjs/api-handlers/index.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +16 -15
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +15 -15
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/index.js +6 -23
- 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 +118 -100
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +87 -68
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +64 -53
- 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 +83 -69
- package/build/adapter-nextjs/page-props/home.js.map +1 -1
- package/build/adapter-nextjs/page-props/index.js +8 -42
- package/build/adapter-nextjs/page-props/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/lib/types.js +1 -3
- package/build/adapter-nextjs/page-props/search.js +25 -31
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +29 -50
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +13 -19
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +33 -35
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/index.js +4 -25
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/types.js +1 -3
- package/build/adapter-nextjs/page-props/story.js +77 -64
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +27 -26
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +34 -25
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +19 -16
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +84 -78
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/index.js +2 -21
- package/build/components-nextjs/PageSeo/index.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +5 -10
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/types.js +1 -3
- package/build/components-nextjs/StorySeo/StorySeo.js +69 -47
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/components-nextjs/StorySeo/index.js +1 -6
- package/build/components-nextjs/StorySeo/index.js.map +1 -1
- package/build/components-nextjs/document.js +31 -48
- package/build/components-nextjs/document.js.map +1 -1
- package/build/components-nextjs/index.js +3 -10
- 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 +207 -192
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +21 -21
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/index.js +1 -18
- package/build/data-fetching/api/index.js.map +1 -1
- package/build/data-fetching/api/queries.js +76 -47
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/index.js +3 -20
- package/build/data-fetching/index.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +22 -22
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +35 -38
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/index.js +4 -12
- package/build/data-fetching/lib/index.js.map +1 -1
- package/build/data-fetching/lib/isSdkError.js +3 -8
- package/build/data-fetching/lib/isSdkError.js.map +1 -1
- package/build/data-fetching/lib/isUuid.js +3 -8
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/data-fetching/types.js +1 -3
- package/build/index.js +9 -26
- package/build/index.js.map +1 -1
- package/build/infinite-loading/index.js +4 -25
- package/build/infinite-loading/index.js.map +1 -1
- package/build/infinite-loading/types.js +1 -3
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +42 -37
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +50 -43
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.d.ts +2 -2
- package/build/infinite-loading/useInfiniteStoriesLoading.js +56 -50
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/index.d.ts +1 -1
- package/build/intl/index.js +4 -26
- package/build/intl/index.js.map +1 -1
- package/build/intl/languages.d.ts +1 -1
- package/build/intl/languages.js +146 -122
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.js +52 -107
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.d.ts +1 -2
- package/build/intl/localeConfig.js +7 -14
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeList.d.ts +4 -2
- package/build/intl/localeList.js +1 -109
- package/build/intl/localeList.js.map +1 -1
- package/build/intl/localeObject.js +80 -82
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +35 -25
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/index.js +11 -28
- package/build/newsroom-context/hooks/index.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +5 -10
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
- package/build/newsroom-context/hooks/useCategories.js +5 -10
- package/build/newsroom-context/hooks/useCategories.js.map +1 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +5 -10
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +5 -10
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +5 -10
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +5 -10
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +17 -21
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +52 -55
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/newsroom-context/hooks/useLanguages.js +5 -10
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroom.js +5 -10
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js +11 -16
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
- package/build/newsroom-context/index.js +2 -22
- package/build/newsroom-context/index.js.map +1 -1
- package/build/sentry/client.js +4 -9
- package/build/sentry/client.js.map +1 -1
- package/build/sentry/common.js +26 -29
- package/build/sentry/common.js.map +1 -1
- package/build/sentry/index.js +2 -8
- package/build/sentry/index.js.map +1 -1
- package/build/sentry/server.js +4 -9
- package/build/sentry/server.js.map +1 -1
- package/build/types.d.ts +2 -2
- package/build/types.js +1 -3
- package/build/utils/boilerplate.js +7 -22
- package/build/utils/boilerplate.js.map +1 -1
- package/build/utils/constants.js +3 -7
- package/build/utils/constants.js.map +1 -1
- package/build/utils/getAssetsUrl.js +4 -9
- package/build/utils/getAssetsUrl.js.map +1 -1
- package/build/utils/getDataRequestLink.js +6 -12
- package/build/utils/getDataRequestLink.js.map +1 -1
- package/build/utils/getLocalizedCategoryData.js +33 -33
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +15 -21
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +11 -13
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +9 -14
- package/build/utils/getStoryPublicationDate.js.map +1 -1
- package/build/utils/getUploadcareGroupUrl.js +5 -10
- package/build/utils/getUploadcareGroupUrl.js.map +1 -1
- package/build/utils/index.js +10 -27
- package/build/utils/index.js.map +1 -1
- package/build/utils/isEmbargoStory.js +3 -8
- package/build/utils/isEmbargoStory.js.map +1 -1
- package/package.json +26 -18
- package/build/tsconfig.tsbuildinfo +0 -1
- 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,71 +1,90 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
import { DEFAULT_GALLERY_PAGE_SIZE } from "../../utils/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 getGalleryPageServerSideProps(customProps, options) {
|
|
7
|
+
const {
|
|
8
|
+
pageSize = DEFAULT_GALLERY_PAGE_SIZE
|
|
9
|
+
} = options || {};
|
|
10
|
+
return async function getServerSideProps(context) {
|
|
11
|
+
const {
|
|
12
|
+
api,
|
|
13
|
+
serverSideProps
|
|
14
|
+
} = await getNewsroomServerSideProps(context);
|
|
15
|
+
const {
|
|
16
|
+
query
|
|
17
|
+
} = context;
|
|
18
|
+
const page = query.page && typeof query.page === 'string' ? Number(query.page) : undefined;
|
|
19
|
+
const {
|
|
20
|
+
galleries,
|
|
21
|
+
pagination
|
|
22
|
+
} = await api.getGalleries({
|
|
23
|
+
page,
|
|
24
|
+
pageSize
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// If there's only one gallery, redirect to it immediately
|
|
28
|
+
if (galleries.length === 1) {
|
|
29
|
+
const {
|
|
30
|
+
uuid
|
|
31
|
+
} = galleries[0];
|
|
32
|
+
return {
|
|
33
|
+
redirect: {
|
|
34
|
+
destination: `/media/album/${uuid}`,
|
|
35
|
+
permanent: false
|
|
25
36
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return processRequest(context, {
|
|
40
|
+
...serverSideProps,
|
|
41
|
+
galleries,
|
|
42
|
+
pagination: {
|
|
43
|
+
itemsTotal: pagination.matched_records_number,
|
|
44
|
+
currentPage: page ?? 1,
|
|
45
|
+
pageSize
|
|
46
|
+
},
|
|
47
|
+
...(typeof customProps === 'function' ? await customProps(context, serverSideProps) : customProps)
|
|
48
|
+
}, '/media');
|
|
49
|
+
};
|
|
39
50
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
51
|
+
export function getGalleryPageStaticProps(customProps, options) {
|
|
52
|
+
const {
|
|
53
|
+
pageSize = DEFAULT_GALLERY_PAGE_SIZE
|
|
54
|
+
} = options || {};
|
|
55
|
+
return async function getStaticProps(context) {
|
|
56
|
+
const {
|
|
57
|
+
api,
|
|
58
|
+
staticProps
|
|
59
|
+
} = await getNewsroomStaticProps(context);
|
|
60
|
+
const {
|
|
61
|
+
galleries,
|
|
62
|
+
pagination
|
|
63
|
+
} = await api.getGalleries({
|
|
64
|
+
pageSize
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
// If there's only one gallery, redirect to it immediately
|
|
68
|
+
if (galleries.length === 1) {
|
|
69
|
+
const {
|
|
70
|
+
uuid
|
|
71
|
+
} = galleries[0];
|
|
72
|
+
return {
|
|
73
|
+
redirect: {
|
|
74
|
+
destination: `/media/album/${uuid}`,
|
|
75
|
+
permanent: false
|
|
55
76
|
}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
exports.getGalleryPageStaticProps = getGalleryPageStaticProps;
|
|
71
|
-
//# sourceMappingURL=gallery.js.map
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
return processStaticRequest(context, {
|
|
80
|
+
...staticProps,
|
|
81
|
+
galleries,
|
|
82
|
+
pagination: {
|
|
83
|
+
itemsTotal: pagination.matched_records_number,
|
|
84
|
+
currentPage: 1,
|
|
85
|
+
pageSize
|
|
86
|
+
},
|
|
87
|
+
...(typeof customProps === 'function' ? await customProps(context, staticProps) : customProps)
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/gallery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/gallery.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,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;AAa/D,MAAM,UAAU,6BAA6B,CACzC,WAAqD,EACrD,OAAiB;IAEjB,MAAM,EA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lyApi } 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 {
|
|
9
|
+
api,
|
|
10
|
+
serverSideProps
|
|
11
|
+
} = await getNewsroomServerSideProps(context);
|
|
12
|
+
const {
|
|
13
|
+
uuid
|
|
14
|
+
} = context.params;
|
|
15
|
+
const gallery = await api.getGallery(uuid);
|
|
16
|
+
if (!gallery || !gallery.images_number) {
|
|
17
|
+
return {
|
|
18
|
+
notFound: true
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return processRequest(context, {
|
|
22
|
+
...serverSideProps,
|
|
23
|
+
gallery,
|
|
24
|
+
...(typeof customProps === 'function' ? await customProps(context, serverSideProps) : customProps)
|
|
25
|
+
}, `/media/album/${uuid}`);
|
|
26
|
+
};
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
export function getGalleryAlbumPageStaticProps(customProps) {
|
|
29
|
+
return async function getStaticProps(context) {
|
|
30
|
+
const {
|
|
31
|
+
api,
|
|
32
|
+
staticProps
|
|
33
|
+
} = await getNewsroomStaticProps(context);
|
|
34
|
+
const {
|
|
35
|
+
uuid
|
|
36
|
+
} = context.params;
|
|
37
|
+
const gallery = await api.getGallery(uuid);
|
|
38
|
+
if (!gallery || !gallery.images_number) {
|
|
39
|
+
return {
|
|
40
|
+
notFound: true
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
return processStaticRequest(context, {
|
|
44
|
+
...staticProps,
|
|
45
|
+
gallery,
|
|
46
|
+
...(typeof customProps === 'function' ? await customProps(context, staticProps) : customProps)
|
|
47
|
+
});
|
|
48
|
+
};
|
|
43
49
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
export async function getGalleryAlbumPageStaticPaths() {
|
|
51
|
+
const api = getPrezlyApi();
|
|
52
|
+
const {
|
|
53
|
+
galleries
|
|
54
|
+
} = await api.getGalleries({});
|
|
55
|
+
const paths = galleries.map(({
|
|
56
|
+
uuid
|
|
57
|
+
}) => ({
|
|
58
|
+
params: {
|
|
59
|
+
uuid
|
|
60
|
+
}
|
|
61
|
+
}));
|
|
62
|
+
return {
|
|
63
|
+
paths,
|
|
64
|
+
fallback: 'blocking'
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"galleryAlbum.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/galleryAlbum.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"galleryAlbum.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/galleryAlbum.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,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;AAQ/D,MAAM,UAAU,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,U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,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,8BAA8B;IAChD,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC;IAC3B,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAEjD,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAElE,OAAO;QACH,KAAK;QACL,QAAQ,EAAE,UAAU;KACvB,CAAC;AACN,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Story } from '@prezly/sdk';
|
|
2
2
|
import type { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPropsContext, GetStaticPropsResult } from 'next';
|
|
3
3
|
import type { PaginationProps } from '../../infinite-loading/types';
|
|
4
4
|
import type { PropsFunction } from './lib/types';
|
|
@@ -7,7 +7,7 @@ export interface HomePageProps<StoryType extends Story = Story> {
|
|
|
7
7
|
pagination: PaginationProps;
|
|
8
8
|
}
|
|
9
9
|
interface Options {
|
|
10
|
-
extraStoryFields?: (keyof
|
|
10
|
+
extraStoryFields?: (keyof Story.ExtraFields)[];
|
|
11
11
|
pageSize?: number;
|
|
12
12
|
}
|
|
13
13
|
export declare function getHomepageServerSideProps<CustomProps extends Record<string, any>, StoryType extends Story = Story>(customProps: CustomProps | PropsFunction<CustomProps>, options?: Options): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<HomePageProps<StoryType> & CustomProps>>;
|
|
@@ -1,70 +1,84 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
1
|
+
import { DEFAULT_PAGE_SIZE } from "../../utils/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 getHomepageServerSideProps(customProps, options) {
|
|
7
|
+
const {
|
|
8
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
9
|
+
extraStoryFields
|
|
10
|
+
} = options || {};
|
|
11
|
+
return async function getServerSideProps(context) {
|
|
12
|
+
const {
|
|
13
|
+
api,
|
|
14
|
+
serverSideProps
|
|
15
|
+
} = await getNewsroomServerSideProps(context, {
|
|
16
|
+
loadHomepageContacts: true
|
|
17
|
+
});
|
|
18
|
+
const {
|
|
19
|
+
query
|
|
20
|
+
} = context;
|
|
21
|
+
const page = query.page && typeof query.page === 'string' ? Number(query.page) : undefined;
|
|
22
|
+
const {
|
|
23
|
+
localeCode
|
|
24
|
+
} = serverSideProps.newsroomContextProps;
|
|
25
|
+
const storiesPaginated = await api.getStories({
|
|
26
|
+
page,
|
|
27
|
+
pageSize,
|
|
28
|
+
include: extraStoryFields,
|
|
29
|
+
localeCode
|
|
30
|
+
});
|
|
31
|
+
const {
|
|
32
|
+
stories,
|
|
33
|
+
storiesTotal
|
|
34
|
+
} = storiesPaginated;
|
|
35
|
+
return processRequest(context, {
|
|
36
|
+
...serverSideProps,
|
|
37
|
+
// TODO: This is temporary until return types from API are figured out
|
|
38
|
+
stories: stories,
|
|
39
|
+
pagination: {
|
|
40
|
+
itemsTotal: storiesTotal,
|
|
41
|
+
currentPage: page ?? 1,
|
|
42
|
+
pageSize
|
|
43
|
+
},
|
|
44
|
+
...(typeof customProps === 'function' ? await customProps(context, serverSideProps) : customProps)
|
|
45
|
+
}, '/');
|
|
46
|
+
};
|
|
39
47
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
48
|
+
export function getHomepageStaticProps(customProps, options) {
|
|
49
|
+
const {
|
|
50
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
51
|
+
extraStoryFields
|
|
52
|
+
} = options || {};
|
|
53
|
+
return async function getStaticProps(context) {
|
|
54
|
+
const {
|
|
55
|
+
api,
|
|
56
|
+
staticProps
|
|
57
|
+
} = await getNewsroomStaticProps(context, {
|
|
58
|
+
loadHomepageContacts: true
|
|
59
|
+
});
|
|
60
|
+
const {
|
|
61
|
+
localeCode
|
|
62
|
+
} = staticProps.newsroomContextProps;
|
|
63
|
+
const storiesPaginated = await api.getStories({
|
|
64
|
+
pageSize,
|
|
65
|
+
include: extraStoryFields,
|
|
66
|
+
localeCode
|
|
67
|
+
});
|
|
68
|
+
const {
|
|
69
|
+
stories,
|
|
70
|
+
storiesTotal
|
|
71
|
+
} = storiesPaginated;
|
|
72
|
+
return processStaticRequest(context, {
|
|
73
|
+
...staticProps,
|
|
74
|
+
// TODO: This is temporary until return types from API are figured out
|
|
75
|
+
stories: stories,
|
|
76
|
+
pagination: {
|
|
77
|
+
itemsTotal: storiesTotal,
|
|
78
|
+
currentPage: 1,
|
|
79
|
+
pageSize
|
|
80
|
+
},
|
|
81
|
+
...(typeof customProps === 'function' ? await customProps(context, staticProps) : customProps)
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"home.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/home.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"home.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/home.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,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;AAc/D,MAAM,UAAU,0BAA0B,CAGxC,WAAqD,EAAE,OAAiB;IACtE,MAAM,EAAE,QAAQ,GAAG,iBAAiB,EAAE,gBAAgB,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAEzE,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,MAAM,0BAA0B,CAAC,OAAO,EAAE;YACvE,oBAAoB,EAAE,IAAI;SAC7B,CAAC,CAAC;QAEH,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC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AAE,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,42 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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.getStoryPreviewPageServerSideProps = exports.getStoryPageStaticProps = exports.getStoryPageStaticPaths = exports.getStoryPageServerSideProps = exports.getSearchPageStaticProps = exports.getSearchPageServerSideProps = exports.getHomepageStaticProps = exports.getHomepageServerSideProps = exports.getGalleryAlbumPageStaticProps = exports.getGalleryAlbumPageStaticPaths = exports.getGalleryAlbumPageServerSideProps = exports.getGalleryPageStaticProps = exports.getGalleryPageServerSideProps = exports.getCategoryPageStaticProps = exports.getCategoryPageStaticPaths = exports.getCategoryPageServerSideProps = void 0;
|
|
18
|
-
var category_1 = require("./category");
|
|
19
|
-
Object.defineProperty(exports, "getCategoryPageServerSideProps", { enumerable: true, get: function () { return category_1.getCategoryPageServerSideProps; } });
|
|
20
|
-
Object.defineProperty(exports, "getCategoryPageStaticPaths", { enumerable: true, get: function () { return category_1.getCategoryPageStaticPaths; } });
|
|
21
|
-
Object.defineProperty(exports, "getCategoryPageStaticProps", { enumerable: true, get: function () { return category_1.getCategoryPageStaticProps; } });
|
|
22
|
-
var gallery_1 = require("./gallery");
|
|
23
|
-
Object.defineProperty(exports, "getGalleryPageServerSideProps", { enumerable: true, get: function () { return gallery_1.getGalleryPageServerSideProps; } });
|
|
24
|
-
Object.defineProperty(exports, "getGalleryPageStaticProps", { enumerable: true, get: function () { return gallery_1.getGalleryPageStaticProps; } });
|
|
25
|
-
var galleryAlbum_1 = require("./galleryAlbum");
|
|
26
|
-
Object.defineProperty(exports, "getGalleryAlbumPageServerSideProps", { enumerable: true, get: function () { return galleryAlbum_1.getGalleryAlbumPageServerSideProps; } });
|
|
27
|
-
Object.defineProperty(exports, "getGalleryAlbumPageStaticPaths", { enumerable: true, get: function () { return galleryAlbum_1.getGalleryAlbumPageStaticPaths; } });
|
|
28
|
-
Object.defineProperty(exports, "getGalleryAlbumPageStaticProps", { enumerable: true, get: function () { return galleryAlbum_1.getGalleryAlbumPageStaticProps; } });
|
|
29
|
-
var home_1 = require("./home");
|
|
30
|
-
Object.defineProperty(exports, "getHomepageServerSideProps", { enumerable: true, get: function () { return home_1.getHomepageServerSideProps; } });
|
|
31
|
-
Object.defineProperty(exports, "getHomepageStaticProps", { enumerable: true, get: function () { return home_1.getHomepageStaticProps; } });
|
|
32
|
-
var search_1 = require("./search");
|
|
33
|
-
Object.defineProperty(exports, "getSearchPageServerSideProps", { enumerable: true, get: function () { return search_1.getSearchPageServerSideProps; } });
|
|
34
|
-
Object.defineProperty(exports, "getSearchPageStaticProps", { enumerable: true, get: function () { return search_1.getSearchPageStaticProps; } });
|
|
35
|
-
__exportStar(require("./sitemap"), exports);
|
|
36
|
-
var story_1 = require("./story");
|
|
37
|
-
Object.defineProperty(exports, "getStoryPageServerSideProps", { enumerable: true, get: function () { return story_1.getStoryPageServerSideProps; } });
|
|
38
|
-
Object.defineProperty(exports, "getStoryPageStaticPaths", { enumerable: true, get: function () { return story_1.getStoryPageStaticPaths; } });
|
|
39
|
-
Object.defineProperty(exports, "getStoryPageStaticProps", { enumerable: true, get: function () { return story_1.getStoryPageStaticProps; } });
|
|
40
|
-
var storyPreview_1 = require("./storyPreview");
|
|
41
|
-
Object.defineProperty(exports, "getStoryPreviewPageServerSideProps", { enumerable: true, get: function () { return storyPreview_1.getStoryPreviewPageServerSideProps; } });
|
|
42
|
-
//# sourceMappingURL=index.js.map
|
|
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";
|
|
@@ -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,32 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
: customProps),
|
|
16
|
-
}, '/search');
|
|
17
|
-
};
|
|
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 {
|
|
8
|
+
serverSideProps
|
|
9
|
+
} = await getNewsroomServerSideProps(context);
|
|
10
|
+
return processRequest(context, {
|
|
11
|
+
...serverSideProps,
|
|
12
|
+
...(typeof customProps === 'function' ? await customProps(context, serverSideProps) : customProps)
|
|
13
|
+
}, '/search');
|
|
14
|
+
};
|
|
18
15
|
}
|
|
19
|
-
|
|
20
|
-
function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
exports.getSearchPageStaticProps = getSearchPageStaticProps;
|
|
32
|
-
//# sourceMappingURL=search.js.map
|
|
16
|
+
export function getSearchPageStaticProps(customProps) {
|
|
17
|
+
return async function getStaticProps(context) {
|
|
18
|
+
const {
|
|
19
|
+
staticProps
|
|
20
|
+
} = await getNewsroomStaticProps(context);
|
|
21
|
+
return processStaticRequest(context, {
|
|
22
|
+
...staticProps,
|
|
23
|
+
...(typeof customProps === 'function' ? await customProps(context, staticProps) : customProps)
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}
|