@prezly/theme-kit-nextjs 7.1.0 → 8.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/adapters/app-helper/server.cjs +29 -0
- package/build/adapters/app-helper/server.d.ts +9 -0
- package/build/adapters/app-helper/server.mjs +23 -0
- package/build/adapters/client.cjs +27 -0
- package/build/adapters/client.d.ts +2 -0
- package/build/adapters/client.mjs +3 -0
- package/build/adapters/intl/server.cjs +108 -0
- package/build/adapters/intl/server.d.ts +26 -0
- package/build/adapters/intl/server.mjs +100 -0
- package/build/adapters/metadata/lib/generateCategoryPageMetadata.cjs +52 -0
- package/build/adapters/metadata/lib/generateCategoryPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateCategoryPageMetadata.mjs +46 -0
- package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.cjs +44 -0
- package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.mjs +38 -0
- package/build/adapters/metadata/lib/generateMediaPageMetadata.cjs +43 -0
- package/build/adapters/metadata/lib/generateMediaPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateMediaPageMetadata.mjs +37 -0
- package/build/adapters/metadata/lib/generateRootMetadata.cjs +51 -0
- package/build/adapters/metadata/lib/generateRootMetadata.d.ts +10 -0
- package/build/adapters/metadata/lib/generateRootMetadata.mjs +45 -0
- package/build/adapters/metadata/lib/generateSearchPageMetadata.cjs +43 -0
- package/build/adapters/metadata/lib/generateSearchPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateSearchPageMetadata.mjs +37 -0
- package/build/adapters/metadata/lib/generateStoryPageMetadata.cjs +100 -0
- package/build/adapters/metadata/lib/generateStoryPageMetadata.d.ts +14 -0
- package/build/adapters/metadata/lib/generateStoryPageMetadata.mjs +94 -0
- package/build/adapters/metadata/lib/index.cjs +66 -0
- package/build/adapters/metadata/lib/index.d.ts +8 -0
- package/build/adapters/metadata/lib/index.mjs +7 -0
- package/build/adapters/metadata/lib/types.cjs +1 -0
- package/build/adapters/metadata/lib/types.d.ts +30 -0
- package/build/adapters/metadata/lib/types.mjs +1 -0
- package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.cjs +11 -0
- package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.d.ts +7 -0
- package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.mjs +5 -0
- package/build/adapters/metadata/lib/utils/generatePageMetadata.cjs +75 -0
- package/build/adapters/metadata/lib/utils/generatePageMetadata.d.ts +14 -0
- package/build/adapters/metadata/lib/utils/generatePageMetadata.mjs +70 -0
- package/build/adapters/metadata/lib/utils/index.cjs +26 -0
- package/build/adapters/metadata/lib/utils/index.d.ts +3 -0
- package/build/adapters/metadata/lib/utils/index.mjs +3 -0
- package/build/adapters/metadata/lib/utils/mergePageMetadata.cjs +48 -0
- package/build/adapters/metadata/lib/utils/mergePageMetadata.d.ts +2 -0
- package/build/adapters/metadata/lib/utils/mergePageMetadata.mjs +43 -0
- package/build/adapters/metadata/server.cjs +82 -0
- package/build/adapters/metadata/server.d.ts +34 -0
- package/build/adapters/metadata/server.mjs +74 -0
- package/build/adapters/prezly/cache/configure.cjs +38 -0
- package/build/adapters/prezly/cache/configure.d.ts +15 -0
- package/build/adapters/prezly/cache/configure.mjs +33 -0
- package/build/adapters/prezly/cache/index.cjs +19 -0
- package/build/adapters/prezly/cache/index.d.ts +2 -0
- package/build/adapters/prezly/cache/index.mjs +2 -0
- package/build/adapters/prezly/cache/redis.cjs +60 -0
- package/build/adapters/prezly/cache/redis.d.ts +9 -0
- package/build/adapters/prezly/cache/redis.mjs +55 -0
- package/build/adapters/prezly/server.cjs +55 -0
- package/build/adapters/prezly/server.d.ts +48 -0
- package/build/adapters/prezly/server.mjs +51 -0
- package/build/adapters/routing/client.cjs +10 -0
- package/build/adapters/routing/client.d.ts +1 -0
- package/build/adapters/routing/client.mjs +3 -0
- package/build/adapters/routing/lib/RoutingAdapter.client.cjs +55 -0
- package/build/adapters/routing/lib/RoutingAdapter.client.d.ts +39 -0
- package/build/adapters/routing/lib/RoutingAdapter.client.mjs +48 -0
- package/build/adapters/routing/lib/RoutingAdapter.server.cjs +49 -0
- package/build/adapters/routing/lib/RoutingAdapter.server.d.ts +16 -0
- package/build/adapters/routing/lib/RoutingAdapter.server.mjs +45 -0
- package/build/adapters/routing/server.cjs +29 -0
- package/build/adapters/routing/server.d.ts +2 -0
- package/build/adapters/routing/server.mjs +5 -0
- package/build/adapters/server.cjs +71 -0
- package/build/adapters/server.d.ts +6 -0
- package/build/adapters/server.mjs +7 -0
- package/build/adapters/theme-settings/client.cjs +37 -0
- package/build/adapters/theme-settings/client.d.ts +13 -0
- package/build/adapters/theme-settings/client.mjs +30 -0
- package/build/adapters/theme-settings/server.cjs +34 -0
- package/build/adapters/theme-settings/server.d.ts +10 -0
- package/build/adapters/theme-settings/server.mjs +28 -0
- package/build/index.cjs +49 -0
- package/build/index.d.ts +4 -7
- package/build/index.mjs +4 -0
- package/build/middleware/generate-slugs.d.ts +1 -0
- package/build/middleware/index.cjs +10 -0
- package/build/middleware/index.d.ts +1 -0
- package/build/middleware/index.mjs +2 -0
- package/build/middleware/intl-middleware.cjs +134 -0
- package/build/middleware/intl-middleware.d.ts +101 -0
- package/build/middleware/intl-middleware.mjs +127 -0
- package/build/middleware/slugs.cjs +9 -0
- package/build/middleware/slugs.d.ts +1 -0
- package/build/middleware/slugs.mjs +3 -0
- package/build/next-config/index.cjs +63 -0
- package/build/next-config/index.d.ts +9 -0
- package/build/next-config/index.mjs +57 -0
- package/build/playwright/config.cjs +70 -0
- package/build/playwright/config.d.ts +7 -1
- package/build/playwright/config.mjs +66 -0
- package/build/playwright/index.cjs +12 -0
- package/build/playwright/index.d.ts +1 -1
- package/build/playwright/index.mjs +1 -0
- package/build/robots/server.cjs +54 -0
- package/build/robots/server.d.ts +12 -0
- package/build/robots/server.mjs +48 -0
- package/build/sentry/client.cjs +10 -0
- package/build/sentry/client.d.ts +1 -2
- package/build/sentry/client.mjs +4 -0
- package/build/sentry/common.cjs +72 -0
- package/build/sentry/common.d.ts +1 -1
- package/build/sentry/common.mjs +66 -0
- package/build/sentry/index.cjs +19 -0
- package/build/sentry/index.d.ts +2 -2
- package/build/sentry/index.mjs +2 -0
- package/build/sentry/server.cjs +10 -0
- package/build/sentry/server.d.ts +1 -2
- package/build/sentry/server.mjs +4 -0
- package/build/server.cjs +25 -0
- package/build/server.d.ts +2 -2
- package/build/server.mjs +3 -0
- package/package.json +51 -26
- package/build/adapter-nextjs/api-handlers/fetchGalleries.d.ts +0 -2
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +0 -29
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +0 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.d.ts +0 -2
- package/build/adapter-nextjs/api-handlers/fetchStories.js +0 -34
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +0 -1
- package/build/adapter-nextjs/api-handlers/index.d.ts +0 -2
- package/build/adapter-nextjs/api-handlers/index.js +0 -8
- package/build/adapter-nextjs/api-handlers/index.js.map +0 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.d.ts +0 -16
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +0 -18
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +0 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.d.ts +0 -16
- package/build/adapter-nextjs/getNewsroomStaticProps.js +0 -18
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +0 -1
- package/build/adapter-nextjs/index.d.ts +0 -6
- package/build/adapter-nextjs/index.js +0 -23
- package/build/adapter-nextjs/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/category.d.ts +0 -16
- package/build/adapter-nextjs/page-props/category.js +0 -105
- package/build/adapter-nextjs/page-props/category.js.map +0 -1
- package/build/adapter-nextjs/page-props/gallery.d.ts +0 -14
- package/build/adapter-nextjs/page-props/gallery.js +0 -74
- package/build/adapter-nextjs/page-props/gallery.js.map +0 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.d.ts +0 -9
- package/build/adapter-nextjs/page-props/galleryAlbum.js +0 -56
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +0 -1
- package/build/adapter-nextjs/page-props/home.d.ts +0 -21
- package/build/adapter-nextjs/page-props/home.js +0 -73
- package/build/adapter-nextjs/page-props/home.js.map +0 -1
- package/build/adapter-nextjs/page-props/index.d.ts +0 -8
- package/build/adapter-nextjs/page-props/index.js +0 -42
- package/build/adapter-nextjs/page-props/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/lib/types.d.ts +0 -3
- package/build/adapter-nextjs/page-props/lib/types.js +0 -3
- package/build/adapter-nextjs/page-props/lib/types.js.map +0 -1
- package/build/adapter-nextjs/page-props/search.d.ts +0 -4
- package/build/adapter-nextjs/page-props/search.js +0 -32
- package/build/adapter-nextjs/page-props/search.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.d.ts +0 -22
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +0 -139
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.d.ts +0 -7
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +0 -55
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/index.d.ts +0 -3
- package/build/adapter-nextjs/page-props/sitemap/index.js +0 -23
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/types.d.ts +0 -9
- package/build/adapter-nextjs/page-props/sitemap/types.js +0 -3
- package/build/adapter-nextjs/page-props/sitemap/types.js.map +0 -1
- package/build/adapter-nextjs/page-props/story.d.ts +0 -13
- package/build/adapter-nextjs/page-props/story.js +0 -78
- package/build/adapter-nextjs/page-props/story.js.map +0 -1
- package/build/adapter-nextjs/page-props/storyPreview.d.ts +0 -4
- package/build/adapter-nextjs/page-props/storyPreview.js +0 -28
- package/build/adapter-nextjs/page-props/storyPreview.js.map +0 -1
- package/build/adapter-nextjs/processRequest.d.ts +0 -12
- package/build/adapter-nextjs/processRequest.js +0 -43
- package/build/adapter-nextjs/processRequest.js.map +0 -1
- package/build/adapter-nextjs/processStaticRequest.d.ts +0 -11
- package/build/adapter-nextjs/processStaticRequest.js +0 -28
- package/build/adapter-nextjs/processStaticRequest.js.map +0 -1
- package/build/components-nextjs/PageSeo/PageSeo.d.ts +0 -16
- package/build/components-nextjs/PageSeo/PageSeo.js +0 -87
- package/build/components-nextjs/PageSeo/PageSeo.js.map +0 -1
- package/build/components-nextjs/PageSeo/index.d.ts +0 -1
- package/build/components-nextjs/PageSeo/index.js +0 -6
- package/build/components-nextjs/PageSeo/index.js.map +0 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.d.ts +0 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +0 -14
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +0 -1
- package/build/components-nextjs/PageSeo/lib/index.d.ts +0 -1
- package/build/components-nextjs/PageSeo/lib/index.js +0 -6
- package/build/components-nextjs/PageSeo/lib/index.js.map +0 -1
- package/build/components-nextjs/StorySeo/StorySeo.d.ts +0 -11
- package/build/components-nextjs/StorySeo/StorySeo.js +0 -56
- package/build/components-nextjs/StorySeo/StorySeo.js.map +0 -1
- package/build/components-nextjs/StorySeo/index.d.ts +0 -1
- package/build/components-nextjs/StorySeo/index.js +0 -6
- package/build/components-nextjs/StorySeo/index.js.map +0 -1
- package/build/components-nextjs/document.d.ts +0 -5
- package/build/components-nextjs/document.js +0 -48
- package/build/components-nextjs/document.js.map +0 -1
- package/build/components-nextjs/index.d.ts +0 -3
- package/build/components-nextjs/index.js +0 -10
- package/build/components-nextjs/index.js.map +0 -1
- package/build/config.d.ts +0 -17
- package/build/config.js +0 -78
- package/build/config.js.map +0 -1
- package/build/data-fetching/client.d.ts +0 -10
- package/build/data-fetching/client.js +0 -51
- package/build/data-fetching/client.js.map +0 -1
- package/build/data-fetching/index.d.ts +0 -1
- package/build/data-fetching/index.js +0 -28
- package/build/data-fetching/index.js.map +0 -1
- package/build/index.js +0 -24
- package/build/index.js.map +0 -1
- package/build/infinite-loading/index.d.ts +0 -4
- package/build/infinite-loading/index.js +0 -25
- package/build/infinite-loading/index.js.map +0 -1
- package/build/infinite-loading/lib/index.d.ts +0 -1
- package/build/infinite-loading/lib/index.js +0 -6
- package/build/infinite-loading/lib/index.js.map +0 -1
- package/build/infinite-loading/lib/useAsync.d.ts +0 -44
- package/build/infinite-loading/lib/useAsync.js +0 -70
- package/build/infinite-loading/lib/useAsync.js.map +0 -1
- package/build/infinite-loading/lib/useSyncedRef.d.ts +0 -12
- package/build/infinite-loading/lib/useSyncedRef.js +0 -24
- package/build/infinite-loading/lib/useSyncedRef.js.map +0 -1
- package/build/infinite-loading/types.d.ts +0 -9
- package/build/infinite-loading/types.js +0 -3
- package/build/infinite-loading/types.js.map +0 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.d.ts +0 -13
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +0 -46
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +0 -1
- package/build/infinite-loading/useInfiniteLoading.d.ts +0 -16
- package/build/infinite-loading/useInfiniteLoading.js +0 -44
- package/build/infinite-loading/useInfiniteLoading.js.map +0 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.d.ts +0 -13
- package/build/infinite-loading/useInfiniteStoriesLoading.js +0 -62
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +0 -1
- package/build/intl/index.d.ts +0 -2
- package/build/intl/index.js +0 -19
- package/build/intl/index.js.map +0 -1
- package/build/intl/languages.d.ts +0 -6
- package/build/intl/languages.js +0 -19
- package/build/intl/languages.js.map +0 -1
- package/build/intl/locale.d.ts +0 -5
- package/build/intl/locale.js +0 -31
- package/build/intl/locale.js.map +0 -1
- package/build/newsroom-context/context.d.ts +0 -62
- package/build/newsroom-context/context.js +0 -29
- package/build/newsroom-context/context.js.map +0 -1
- package/build/newsroom-context/hooks/index.d.ts +0 -11
- package/build/newsroom-context/hooks/index.js +0 -28
- package/build/newsroom-context/hooks/index.js.map +0 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.d.ts +0 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +0 -10
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +0 -1
- package/build/newsroom-context/hooks/useCategories.d.ts +0 -1
- package/build/newsroom-context/hooks/useCategories.js +0 -10
- package/build/newsroom-context/hooks/useCategories.js.map +0 -1
- package/build/newsroom-context/hooks/useCompanyInformation.d.ts +0 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +0 -10
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentCategory.d.ts +0 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +0 -10
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentLocale.d.ts +0 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +0 -10
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentStory.d.ts +0 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +0 -10
- package/build/newsroom-context/hooks/useCurrentStory.js.map +0 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.d.ts +0 -2
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +0 -29
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +0 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.d.ts +0 -6
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +0 -65
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +0 -1
- package/build/newsroom-context/hooks/useLanguages.d.ts +0 -1
- package/build/newsroom-context/hooks/useLanguages.js +0 -10
- package/build/newsroom-context/hooks/useLanguages.js.map +0 -1
- package/build/newsroom-context/hooks/useNewsroom.d.ts +0 -1
- package/build/newsroom-context/hooks/useNewsroom.js +0 -10
- package/build/newsroom-context/hooks/useNewsroom.js.map +0 -1
- package/build/newsroom-context/hooks/useNewsroomContext.d.ts +0 -2
- package/build/newsroom-context/hooks/useNewsroomContext.js +0 -16
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +0 -1
- package/build/newsroom-context/index.d.ts +0 -2
- package/build/newsroom-context/index.js +0 -22
- package/build/newsroom-context/index.js.map +0 -1
- package/build/playwright/config.js +0 -67
- package/build/playwright/config.js.map +0 -1
- package/build/playwright/index.js +0 -6
- package/build/playwright/index.js.map +0 -1
- package/build/sentry/client.js +0 -9
- package/build/sentry/client.js.map +0 -1
- package/build/sentry/common.js +0 -66
- package/build/sentry/common.js.map +0 -1
- package/build/sentry/index.js +0 -8
- package/build/sentry/index.js.map +0 -1
- package/build/sentry/server.js +0 -9
- package/build/sentry/server.js.map +0 -1
- package/build/server.js +0 -19
- package/build/server.js.map +0 -1
- package/build/types.d.ts +0 -14
- package/build/types.js +0 -3
- package/build/types.js.map +0 -1
- package/build/utils.d.ts +0 -6
- package/build/utils.js +0 -16
- package/build/utils.js.map +0 -1
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getCategoryPageStaticPaths = exports.getCategoryPageStaticProps = exports.getCategoryPageServerSideProps = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const data_fetching_1 = require("../../data-fetching");
|
|
6
|
-
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
7
|
-
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
8
|
-
const processRequest_1 = require("../processRequest");
|
|
9
|
-
const processStaticRequest_1 = require("../processStaticRequest");
|
|
10
|
-
function getCategoryPageServerSideProps(customProps, options = {}) {
|
|
11
|
-
const { pageSize = theme_kit_core_1.DEFAULT_PAGE_SIZE, extraStoryFields } = options;
|
|
12
|
-
return async function getServerSideProps(context) {
|
|
13
|
-
const { api, serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context);
|
|
14
|
-
const { slug } = context.params;
|
|
15
|
-
const category = await api.category(slug);
|
|
16
|
-
if (!category) {
|
|
17
|
-
return {
|
|
18
|
-
notFound: true,
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
const { query } = context;
|
|
22
|
-
const page = query.page && typeof query.page === 'string' ? Number(query.page) : 1;
|
|
23
|
-
const { localeCode } = serverSideProps.newsroomContextProps;
|
|
24
|
-
const { stories, pagination } = await api.stories({
|
|
25
|
-
category,
|
|
26
|
-
offset: (page - 1) * pageSize,
|
|
27
|
-
limit: pageSize,
|
|
28
|
-
locale: localeCode ? { code: localeCode } : undefined,
|
|
29
|
-
}, {
|
|
30
|
-
include: extraStoryFields,
|
|
31
|
-
});
|
|
32
|
-
serverSideProps.newsroomContextProps.currentCategory = category;
|
|
33
|
-
return (0, processRequest_1.processRequest)(context, {
|
|
34
|
-
...serverSideProps,
|
|
35
|
-
stories,
|
|
36
|
-
pagination: {
|
|
37
|
-
itemsTotal: pagination.matched_records_number,
|
|
38
|
-
currentPage: page,
|
|
39
|
-
pageSize,
|
|
40
|
-
},
|
|
41
|
-
...(typeof customProps === 'function'
|
|
42
|
-
? await customProps(context, serverSideProps)
|
|
43
|
-
: customProps),
|
|
44
|
-
}, `/category/${slug}`);
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
exports.getCategoryPageServerSideProps = getCategoryPageServerSideProps;
|
|
48
|
-
function getCategoryPageStaticProps(customProps, options = {}) {
|
|
49
|
-
const { pageSize = theme_kit_core_1.DEFAULT_PAGE_SIZE, extraStoryFields = [] } = options;
|
|
50
|
-
return async function getStaticProps(context) {
|
|
51
|
-
const { api, staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context);
|
|
52
|
-
const { slug } = context.params;
|
|
53
|
-
const category = await api.category(slug);
|
|
54
|
-
if (!category) {
|
|
55
|
-
return {
|
|
56
|
-
notFound: true,
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
const { localeCode } = staticProps.newsroomContextProps;
|
|
60
|
-
const { stories, pagination } = await api.stories({
|
|
61
|
-
category,
|
|
62
|
-
limit: pageSize,
|
|
63
|
-
locale: localeCode ? { code: localeCode } : undefined,
|
|
64
|
-
}, {
|
|
65
|
-
include: extraStoryFields,
|
|
66
|
-
});
|
|
67
|
-
staticProps.newsroomContextProps.currentCategory = category;
|
|
68
|
-
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
69
|
-
...staticProps,
|
|
70
|
-
stories,
|
|
71
|
-
pagination: {
|
|
72
|
-
itemsTotal: pagination.matched_records_number,
|
|
73
|
-
currentPage: 1,
|
|
74
|
-
pageSize,
|
|
75
|
-
},
|
|
76
|
-
...(typeof customProps === 'function'
|
|
77
|
-
? await customProps(context, staticProps)
|
|
78
|
-
: customProps),
|
|
79
|
-
});
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
exports.getCategoryPageStaticProps = getCategoryPageStaticProps;
|
|
83
|
-
async function getCategoryPageStaticPaths() {
|
|
84
|
-
const api = data_fetching_1.NextContentDelivery.initClient();
|
|
85
|
-
const [categories, defaultLanguage] = await Promise.all([
|
|
86
|
-
api.categories(),
|
|
87
|
-
api.defaultLanguage(),
|
|
88
|
-
]);
|
|
89
|
-
const locale = theme_kit_core_1.LocaleObject.fromAnyCode(defaultLanguage.code);
|
|
90
|
-
const paths = categories
|
|
91
|
-
.map((category) => {
|
|
92
|
-
const { slug } = (0, theme_kit_core_1.getLocalizedCategoryData)(category, locale);
|
|
93
|
-
if (!slug) {
|
|
94
|
-
return undefined;
|
|
95
|
-
}
|
|
96
|
-
return { params: { slug } };
|
|
97
|
-
})
|
|
98
|
-
.filter(Boolean);
|
|
99
|
-
return {
|
|
100
|
-
paths,
|
|
101
|
-
fallback: 'blocking',
|
|
102
|
-
};
|
|
103
|
-
}
|
|
104
|
-
exports.getCategoryPageStaticPaths = getCategoryPageStaticPaths;
|
|
105
|
-
//# sourceMappingURL=category.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"category.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/category.ts"],"names":[],"mappings":";;;AACA,2DAAmG;AASnG,uDAA0D;AAE1D,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAc/D,SAAgB,8BAA8B,CAG5C,WAAqD,EAAE,UAA4B,EAAE;IACnF,MAAM,EAAE,QAAQ,GAAG,kCAAiB,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC;IAEnE,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,CAAC,CAAC;QAE3E,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA0B,CAAC;QACpD,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAE1C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,OAAO;gBACH,QAAQ,EAAE,IAAI;aACjB,CAAC;QACN,CAAC;QAED,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;QAC1B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEnF,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC,oBAAoB,CAAC;QAE5D,MAAM,EAAE,O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A,yCAAwB,EAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,EAAE,CAAC;YACR,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;IAChC,CAAC,CAAC;SACD,MAAM,CAA+B,OAAc,CAAC,CAAC;IAE1D,OAAO;QACH,KAAK;QACL,QAAQ,EAAE,UAAU;KACvB,CAAC;AACN,CAAC;AAvBD,gEAuBC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { NewsroomGallery } from '@prezly/sdk';
|
|
2
|
-
import type { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPropsContext, GetStaticPropsResult } from 'next';
|
|
3
|
-
import type { PaginationProps } from '../../infinite-loading/types';
|
|
4
|
-
import type { PropsFunction } from './lib/types';
|
|
5
|
-
export interface GalleryPageProps {
|
|
6
|
-
galleries: NewsroomGallery[];
|
|
7
|
-
pagination: PaginationProps;
|
|
8
|
-
}
|
|
9
|
-
interface Options {
|
|
10
|
-
pageSize?: number;
|
|
11
|
-
}
|
|
12
|
-
export declare function getGalleryPageServerSideProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps>, options?: Options): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<GalleryPageProps & CustomProps>>;
|
|
13
|
-
export declare function getGalleryPageStaticProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>, options?: Options): (context: GetStaticPropsContext) => Promise<GetStaticPropsResult<GalleryPageProps & CustomProps>>;
|
|
14
|
-
export {};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGalleryPageStaticProps = exports.getGalleryPageServerSideProps = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
6
|
-
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
7
|
-
const processRequest_1 = require("../processRequest");
|
|
8
|
-
const processStaticRequest_1 = require("../processStaticRequest");
|
|
9
|
-
function getGalleryPageServerSideProps(customProps, options) {
|
|
10
|
-
const { pageSize = theme_kit_core_1.DEFAULT_GALLERY_PAGE_SIZE } = options || {};
|
|
11
|
-
return async function getServerSideProps(context) {
|
|
12
|
-
const { api, serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context);
|
|
13
|
-
const { query } = context;
|
|
14
|
-
const page = query.page && typeof query.page === 'string' ? Number(query.page) : 1;
|
|
15
|
-
const { galleries, pagination } = await api.galleries({
|
|
16
|
-
offset: (page - 1) * pageSize,
|
|
17
|
-
limit: pageSize,
|
|
18
|
-
});
|
|
19
|
-
// If there's only one gallery, redirect to it immediately
|
|
20
|
-
if (galleries.length === 1) {
|
|
21
|
-
const { uuid } = galleries[0];
|
|
22
|
-
return {
|
|
23
|
-
redirect: {
|
|
24
|
-
destination: `/media/album/${uuid}`,
|
|
25
|
-
permanent: false,
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
return (0, processRequest_1.processRequest)(context, {
|
|
30
|
-
...serverSideProps,
|
|
31
|
-
galleries,
|
|
32
|
-
pagination: {
|
|
33
|
-
itemsTotal: pagination.matched_records_number,
|
|
34
|
-
currentPage: page,
|
|
35
|
-
pageSize,
|
|
36
|
-
},
|
|
37
|
-
...(typeof customProps === 'function'
|
|
38
|
-
? await customProps(context, serverSideProps)
|
|
39
|
-
: customProps),
|
|
40
|
-
}, '/media');
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
exports.getGalleryPageServerSideProps = getGalleryPageServerSideProps;
|
|
44
|
-
function getGalleryPageStaticProps(customProps, options) {
|
|
45
|
-
const { pageSize = theme_kit_core_1.DEFAULT_GALLERY_PAGE_SIZE } = options || {};
|
|
46
|
-
return async function getStaticProps(context) {
|
|
47
|
-
const { api, staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context);
|
|
48
|
-
const { galleries, pagination } = await api.galleries({ limit: pageSize });
|
|
49
|
-
// If there's only one gallery, redirect to it immediately
|
|
50
|
-
if (galleries.length === 1) {
|
|
51
|
-
const { uuid } = galleries[0];
|
|
52
|
-
return {
|
|
53
|
-
redirect: {
|
|
54
|
-
destination: `/media/album/${uuid}`,
|
|
55
|
-
permanent: false,
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
60
|
-
...staticProps,
|
|
61
|
-
galleries,
|
|
62
|
-
pagination: {
|
|
63
|
-
itemsTotal: pagination.matched_records_number,
|
|
64
|
-
currentPage: 1,
|
|
65
|
-
pageSize,
|
|
66
|
-
},
|
|
67
|
-
...(typeof customProps === 'function'
|
|
68
|
-
? await customProps(context, staticProps)
|
|
69
|
-
: customProps),
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
exports.getGalleryPageStaticProps = getGalleryPageStaticProps;
|
|
74
|
-
//# sourceMappingURL=gallery.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gallery.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/gallery.ts"],"names":[],"mappings":";;;AACA,2DAAmE;AASnE,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAa/D,SAAgB,6BAA6B,CACzC,WAAqD,EACrD,OAAiB;IAEjB,MAAM,EAAE,QAAQ,GAAG,0CAAyB,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAE/D,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,CAAC,CAAC;QAC3E,MAAM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E,WAAW,EAAE,GAAG,MAAM,IAAA,+CAAsB,EAAC,OAAO,CAAC,CAAC;QAEnE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAE3E,0DAA0D;QAC1D,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAE9B,OAAO;gBACH,QAAQ,EAAE;oBACN,WAAW,EAAE,gBAAgB,IAAI,EAAE;oBACnC,SAAS,EAAE,KAAK;iBACnB;aACJ,CAAC;QACN,CAAC;QAED,OAAO,IAAA,2CAAoB,EAAC,OAAO,EAAE;YACjC,GAAG,WAAW;YACd,SAAS;YACT,UAAU,EAAE;gBACR,UAAU,EAAE,UAAU,CAAC,sBAAsB;gBAC7C,WAAW,EAAE,CAAC;gBACd,QAAQ;aACX;YACD,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAzCD,8DAyCC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { NewsroomGallery } from '@prezly/sdk';
|
|
2
|
-
import type { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult } from 'next';
|
|
3
|
-
import type { PropsFunction } from './lib/types';
|
|
4
|
-
export interface GalleryAlbumPageProps {
|
|
5
|
-
gallery: NewsroomGallery;
|
|
6
|
-
}
|
|
7
|
-
export declare function getGalleryAlbumPageServerSideProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps>): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<GalleryAlbumPageProps & CustomProps>>;
|
|
8
|
-
export declare function getGalleryAlbumPageStaticProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>): (context: GetStaticPropsContext) => Promise<GetStaticPropsResult<GalleryAlbumPageProps & CustomProps>>;
|
|
9
|
-
export declare function getGalleryAlbumPageStaticPaths(): Promise<GetStaticPathsResult>;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getGalleryAlbumPageStaticPaths = exports.getGalleryAlbumPageStaticProps = exports.getGalleryAlbumPageServerSideProps = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const data_fetching_1 = require("../../data-fetching");
|
|
6
|
-
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
7
|
-
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
8
|
-
const processRequest_1 = require("../processRequest");
|
|
9
|
-
const processStaticRequest_1 = require("../processStaticRequest");
|
|
10
|
-
function getGalleryAlbumPageServerSideProps(customProps) {
|
|
11
|
-
return async function getServerSideProps(context) {
|
|
12
|
-
const { api, serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context);
|
|
13
|
-
const { uuid } = context.params;
|
|
14
|
-
const gallery = await api.gallery(uuid);
|
|
15
|
-
if (!gallery || (0, theme_kit_core_1.isGalleryEmpty)(gallery)) {
|
|
16
|
-
return { notFound: true };
|
|
17
|
-
}
|
|
18
|
-
return (0, processRequest_1.processRequest)(context, {
|
|
19
|
-
...serverSideProps,
|
|
20
|
-
gallery,
|
|
21
|
-
...(typeof customProps === 'function'
|
|
22
|
-
? await customProps(context, serverSideProps)
|
|
23
|
-
: customProps),
|
|
24
|
-
}, `/media/album/${uuid}`);
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
exports.getGalleryAlbumPageServerSideProps = getGalleryAlbumPageServerSideProps;
|
|
28
|
-
function getGalleryAlbumPageStaticProps(customProps) {
|
|
29
|
-
return async function getStaticProps(context) {
|
|
30
|
-
const { api, staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context);
|
|
31
|
-
const { uuid } = context.params;
|
|
32
|
-
const gallery = await api.gallery(uuid);
|
|
33
|
-
if (!gallery || (0, theme_kit_core_1.isGalleryEmpty)(gallery)) {
|
|
34
|
-
return { notFound: true };
|
|
35
|
-
}
|
|
36
|
-
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
37
|
-
...staticProps,
|
|
38
|
-
gallery,
|
|
39
|
-
...(typeof customProps === 'function'
|
|
40
|
-
? await customProps(context, staticProps)
|
|
41
|
-
: customProps),
|
|
42
|
-
});
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
exports.getGalleryAlbumPageStaticProps = getGalleryAlbumPageStaticProps;
|
|
46
|
-
async function getGalleryAlbumPageStaticPaths() {
|
|
47
|
-
const api = data_fetching_1.NextContentDelivery.initClient();
|
|
48
|
-
const { galleries } = await api.galleries();
|
|
49
|
-
const paths = galleries.map(({ uuid }) => ({ params: { uuid } }));
|
|
50
|
-
return {
|
|
51
|
-
paths,
|
|
52
|
-
fallback: 'blocking',
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
exports.getGalleryAlbumPageStaticPaths = getGalleryAlbumPageStaticPaths;
|
|
56
|
-
//# sourceMappingURL=galleryAlbum.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"galleryAlbum.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/galleryAlbum.ts"],"names":[],"mappings":";;;AACA,2DAAwD;AASxD,uDAA0D;AAC1D,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAQ/D,SAAgB,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,GAAG,EA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ACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AA1BD,wEA0BC;AAEM,KAAK,UAAU,8BAA8B;IAChD,MAAM,GAAG,GAAG,mCAAmB,CAAC,UAAU,EAAE,CAAC;IAC7C,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,GAAG,CAAC,SAAS,EAAE,CAAC;IAE5C,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;AAVD,wEAUC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Story } from '@prezly/sdk';
|
|
2
|
-
import type { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPropsContext, GetStaticPropsResult } from 'next';
|
|
3
|
-
import type { PaginationProps } from '../../infinite-loading/types';
|
|
4
|
-
import type { PropsFunction } from './lib/types';
|
|
5
|
-
export interface HomePageProps<Include extends keyof Story.ExtraFields = never> {
|
|
6
|
-
stories: (Story & Pick<Story.ExtraFields, Include>)[];
|
|
7
|
-
pagination: PaginationProps;
|
|
8
|
-
}
|
|
9
|
-
interface Options<Include extends keyof Story.ExtraFields> {
|
|
10
|
-
extraStoryFields?: Include[];
|
|
11
|
-
/**
|
|
12
|
-
* When set to `true`, the initial `stories` array will include one extra story to place as highlighted story.
|
|
13
|
-
* This will offset each subsequent page by 1 story to account for that.
|
|
14
|
-
*/
|
|
15
|
-
withHighlightedStory?: boolean;
|
|
16
|
-
pageSize?: number;
|
|
17
|
-
filterQuery?: Object;
|
|
18
|
-
}
|
|
19
|
-
export declare function getHomepageServerSideProps<CustomProps extends Record<string, any>, Include extends keyof Story.ExtraFields = never>(customProps: CustomProps | PropsFunction<CustomProps>, options?: Options<Include>): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<HomePageProps<Include> & CustomProps>>;
|
|
20
|
-
export declare function getHomepageStaticProps<CustomProps extends Record<string, any>, Include extends keyof Story.ExtraFields = never>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>, options?: Options<Include>): (context: GetStaticPropsContext) => Promise<GetStaticPropsResult<HomePageProps<Include> & CustomProps>>;
|
|
21
|
-
export {};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getHomepageStaticProps = exports.getHomepageServerSideProps = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
6
|
-
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
7
|
-
const processRequest_1 = require("../processRequest");
|
|
8
|
-
const processStaticRequest_1 = require("../processStaticRequest");
|
|
9
|
-
function getHomepageServerSideProps(customProps, options) {
|
|
10
|
-
const { pageSize = theme_kit_core_1.DEFAULT_PAGE_SIZE, extraStoryFields, withHighlightedStory = false, filterQuery, } = options || {};
|
|
11
|
-
return async function getServerSideProps(context) {
|
|
12
|
-
const { api, serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context, {
|
|
13
|
-
loadHomepageContacts: true,
|
|
14
|
-
});
|
|
15
|
-
const { query } = context;
|
|
16
|
-
const page = query.page && typeof query.page === 'string' ? Number(query.page) : 1;
|
|
17
|
-
const { localeCode } = serverSideProps.newsroomContextProps;
|
|
18
|
-
const storiesPaginated = await api.stories({
|
|
19
|
-
offset: (page - 1) * pageSize,
|
|
20
|
-
limit: pageSize,
|
|
21
|
-
locale: localeCode,
|
|
22
|
-
highlighted: withHighlightedStory ? 1 : 0,
|
|
23
|
-
query: filterQuery,
|
|
24
|
-
}, {
|
|
25
|
-
include: extraStoryFields,
|
|
26
|
-
});
|
|
27
|
-
const { stories, pagination } = storiesPaginated;
|
|
28
|
-
return (0, processRequest_1.processRequest)(context, {
|
|
29
|
-
...serverSideProps,
|
|
30
|
-
stories,
|
|
31
|
-
pagination: {
|
|
32
|
-
itemsTotal: pagination.matched_records_number,
|
|
33
|
-
currentPage: page ?? 1,
|
|
34
|
-
pageSize,
|
|
35
|
-
withHighlightedStory,
|
|
36
|
-
},
|
|
37
|
-
...(typeof customProps === 'function'
|
|
38
|
-
? await customProps(context, serverSideProps)
|
|
39
|
-
: customProps),
|
|
40
|
-
}, '/');
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
exports.getHomepageServerSideProps = getHomepageServerSideProps;
|
|
44
|
-
function getHomepageStaticProps(customProps, options = {}) {
|
|
45
|
-
const { pageSize = theme_kit_core_1.DEFAULT_PAGE_SIZE, extraStoryFields = [] } = options;
|
|
46
|
-
return async function getStaticProps(context) {
|
|
47
|
-
const { api, staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context, {
|
|
48
|
-
loadHomepageContacts: true,
|
|
49
|
-
});
|
|
50
|
-
const { localeCode } = staticProps.newsroomContextProps;
|
|
51
|
-
const storiesPaginated = await api.stories({
|
|
52
|
-
limit: pageSize,
|
|
53
|
-
locale: localeCode,
|
|
54
|
-
}, {
|
|
55
|
-
include: extraStoryFields,
|
|
56
|
-
});
|
|
57
|
-
const { stories, pagination } = storiesPaginated;
|
|
58
|
-
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
59
|
-
...staticProps,
|
|
60
|
-
stories,
|
|
61
|
-
pagination: {
|
|
62
|
-
itemsTotal: pagination.matched_records_number,
|
|
63
|
-
currentPage: 1,
|
|
64
|
-
pageSize,
|
|
65
|
-
},
|
|
66
|
-
...(typeof customProps === 'function'
|
|
67
|
-
? await customProps(context, staticProps)
|
|
68
|
-
: customProps),
|
|
69
|
-
});
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
exports.getHomepageStaticProps = getHomepageStaticProps;
|
|
73
|
-
//# sourceMappingURL=home.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"home.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/home.ts"],"names":[],"mappings":";;;AACA,2DAA2D;AAS3D,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAoB/D,SAAgB,0BAA0B,CAGxC,WAAqD,EAAE,OAA0B;IAC/E,MAAM,EACF,QAAQ,GAAG,kCAAiB,EAC5B,gBAAgB,EAChB,oBAAoB,GAAG,KAAK,EAC5B,WAAW,GACd,GAAG,OAAO,IAAI,EAAE,CAAC;IAElB,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,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,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEnF,MAAM,EAAE,UAAU,EAAE,GAAG,eAAe,CAAC,oBAAoB,CAAC;QAE5D,MAAM,gBAAgB,GAAG,MAAM,GAAG,CAAC,OAAO,CACtC;YACI,MAAM,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ;YAC7B,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,UAAU;YAClB,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,KAAK,EAAE,WAAW;SACrB,EACD;YACI,OAAO,EAAE,gBAAgB;SAC5B,CACJ,CAAC;QACF,MAAM,EAA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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;AA7CD,wDA6CC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { getCategoryPageServerSideProps, getCategoryPageStaticPaths, getCategoryPageStaticProps, type CategoryPageProps, } from './category';
|
|
2
|
-
export { getGalleryPageServerSideProps, getGalleryPageStaticProps, type GalleryPageProps, } from './gallery';
|
|
3
|
-
export { getGalleryAlbumPageServerSideProps, getGalleryAlbumPageStaticPaths, getGalleryAlbumPageStaticProps, type GalleryAlbumPageProps, } from './galleryAlbum';
|
|
4
|
-
export { getHomepageServerSideProps, getHomepageStaticProps, type HomePageProps } from './home';
|
|
5
|
-
export { getSearchPageServerSideProps, getSearchPageStaticProps } from './search';
|
|
6
|
-
export * from './sitemap';
|
|
7
|
-
export { getStoryPageServerSideProps, getStoryPageStaticPaths, getStoryPageStaticProps, } from './story';
|
|
8
|
-
export { getStoryPreviewPageServerSideProps } from './storyPreview';
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
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.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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAKoB;AAJhB,0HAAA,8BAA8B,OAAA;AAC9B,sHAAA,0BAA0B,OAAA;AAC1B,sHAAA,0BAA0B,OAAA;AAG9B,qCAImB;AAHf,wHAAA,6BAA6B,OAAA;AAC7B,oHAAA,yBAAyB,OAAA;AAG7B,+CAKwB;AAJpB,kIAAA,kCAAkC,OAAA;AAClC,8HAAA,8BAA8B,OAAA;AAC9B,8HAAA,8BAA8B,OAAA;AAGlC,+BAAgG;AAAvF,kHAAA,0BAA0B,OAAA;AAAE,8GAAA,sBAAsB,OAAA;AAC3D,mCAAkF;AAAzE,sHAAA,4BAA4B,OAAA;AAAE,kHAAA,wBAAwB,OAAA;AAC/D,4CAA0B;AAC1B,iCAIiB;AAHb,oHAAA,2BAA2B,OAAA;AAC3B,gHAAA,uBAAuB,OAAA;AACvB,gHAAA,uBAAuB,OAAA;AAE3B,+CAAoE;AAA3D,kIAAA,kCAAkC,OAAA"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { GetServerSidePropsContext, GetStaticPropsContext } from 'next';
|
|
2
|
-
import type { PageProps } from '../../../types';
|
|
3
|
-
export type PropsFunction<CustomProps, Context extends GetServerSidePropsContext | GetStaticPropsContext = GetServerSidePropsContext> = (context: Context, props: PageProps) => CustomProps | Promise<CustomProps>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/lib/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPropsContext } from 'next';
|
|
2
|
-
import type { PropsFunction } from './lib/types';
|
|
3
|
-
export declare function getSearchPageServerSideProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps>): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<CustomProps>>;
|
|
4
|
-
export declare function getSearchPageStaticProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<CustomProps>>;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSearchPageStaticProps = exports.getSearchPageServerSideProps = void 0;
|
|
4
|
-
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
5
|
-
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
6
|
-
const processRequest_1 = require("../processRequest");
|
|
7
|
-
const processStaticRequest_1 = require("../processStaticRequest");
|
|
8
|
-
function getSearchPageServerSideProps(customProps) {
|
|
9
|
-
return async function getServerSideProps(context) {
|
|
10
|
-
const { serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context);
|
|
11
|
-
return (0, processRequest_1.processRequest)(context, {
|
|
12
|
-
...serverSideProps,
|
|
13
|
-
...(typeof customProps === 'function'
|
|
14
|
-
? await customProps(context, serverSideProps)
|
|
15
|
-
: customProps),
|
|
16
|
-
}, '/search');
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
exports.getSearchPageServerSideProps = getSearchPageServerSideProps;
|
|
20
|
-
function getSearchPageStaticProps(customProps) {
|
|
21
|
-
return async function getStaticProps(context) {
|
|
22
|
-
const { staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context);
|
|
23
|
-
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
24
|
-
...staticProps,
|
|
25
|
-
...(typeof customProps === 'function'
|
|
26
|
-
? await customProps(context, staticProps)
|
|
27
|
-
: customProps),
|
|
28
|
-
});
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
exports.getSearchPageStaticProps = getSearchPageStaticProps;
|
|
32
|
-
//# sourceMappingURL=search.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/search.ts"],"names":[],"mappings":";;;AAMA,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAI/D,SAAgB,4BAA4B,CACxC,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,CAAC,CAAC;QAEtE,OAAO,IAAA,+BAAc,EACjB,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;AAnBD,oEAmBC;AAED,SAAgB,wBAAwB,CACpC,WAA4E;IAE5E,OAAO,KAAK,UAAU,cAAc,CAChC,OAAkC;QAElC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,+CAAsB,EAAC,OAAO,CAAC,CAAC;QAE9D,OAAO,IAAA,2CAAoB,EAAC,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;AAlBD,4DAkBC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Category } from '@prezly/sdk';
|
|
2
|
-
import type { NewsroomLanguageSettings, Story } from '@prezly/sdk';
|
|
3
|
-
import type { SitemapUrl } from './types';
|
|
4
|
-
export declare class SitemapBuilder {
|
|
5
|
-
private baseUrl;
|
|
6
|
-
private basePath;
|
|
7
|
-
private usedLanguages;
|
|
8
|
-
private urls;
|
|
9
|
-
constructor(baseUrl: string, basePath: string | undefined, languages: NewsroomLanguageSettings[]);
|
|
10
|
-
private buildUrl;
|
|
11
|
-
/**
|
|
12
|
-
* Add a non-dynamic URL to the sitemap (e.g. `/` or `/media`)
|
|
13
|
-
* The URL will be added once for each used locale on the site, with proper locale code part.
|
|
14
|
-
*/
|
|
15
|
-
addPageUrl(url: string): void;
|
|
16
|
-
addStoryUrl(story: Story): void;
|
|
17
|
-
addCategoryUrl(category: Category): void;
|
|
18
|
-
private static guessFrequency;
|
|
19
|
-
private static guessPriority;
|
|
20
|
-
static serializeLocation(url: SitemapUrl): string;
|
|
21
|
-
serialize(): string;
|
|
22
|
-
}
|