@prezly/theme-kit-nextjs 2.0.1-1 → 2.0.1-2
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 -1
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +3 -9
- package/build/adapter-nextjs/api-handlers/fetchStories.js +3 -9
- package/build/adapter-nextjs/api-handlers/index.js +2 -19
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +3 -9
- package/build/adapter-nextjs/getNewsroomStaticProps.js +3 -9
- package/build/adapter-nextjs/index.js +6 -71
- package/build/adapter-nextjs/page-props/category.js +19 -27
- package/build/adapter-nextjs/page-props/gallery.js +13 -20
- package/build/adapter-nextjs/page-props/galleryAlbum.js +13 -21
- package/build/adapter-nextjs/page-props/home.js +13 -20
- package/build/adapter-nextjs/page-props/index.js +8 -138
- package/build/adapter-nextjs/page-props/lib/types.js +1 -1
- package/build/adapter-nextjs/page-props/search.js +10 -17
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +2 -9
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +1 -7
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +7 -13
- package/build/adapter-nextjs/page-props/sitemap/index.js +4 -43
- package/build/adapter-nextjs/page-props/sitemap/types.js +1 -1
- package/build/adapter-nextjs/page-props/story.js +17 -25
- package/build/adapter-nextjs/page-props/storyPreview.js +7 -13
- package/build/adapter-nextjs/processRequest.js +5 -11
- package/build/adapter-nextjs/processStaticRequest.js +1 -7
- package/build/components-nextjs/PageSeo/PageSeo.js +24 -30
- package/build/components-nextjs/PageSeo/index.js +2 -27
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -7
- package/build/components-nextjs/PageSeo/lib/types.js +1 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +6 -12
- package/build/components-nextjs/StorySeo/index.js +1 -12
- package/build/components-nextjs/document.d.ts +4 -2
- package/build/components-nextjs/document.js +13 -19
- package/build/components-nextjs/document.js.map +1 -1
- package/build/components-nextjs/index.js +3 -26
- package/build/data-fetching/api/PrezlyApi.js +30 -37
- package/build/data-fetching/api/getPrezlyApi.js +5 -11
- package/build/data-fetching/api/index.js +1 -16
- package/build/data-fetching/api/queries.js +5 -15
- package/build/data-fetching/index.js +3 -38
- package/build/data-fetching/lib/getAlgoliaSettings.js +3 -9
- package/build/data-fetching/lib/getEnvVariables.js +3 -10
- package/build/data-fetching/lib/index.js +4 -33
- package/build/data-fetching/lib/isSdkError.js +1 -7
- package/build/data-fetching/lib/isUuid.js +1 -7
- package/build/data-fetching/types.js +1 -1
- package/build/index.js +9 -104
- package/build/infinite-loading/index.js +4 -43
- package/build/infinite-loading/types.js +1 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +3 -9
- package/build/infinite-loading/useInfiniteLoading.js +9 -15
- package/build/infinite-loading/useInfiniteStoriesLoading.js +7 -13
- package/build/intl/index.js +4 -49
- package/build/intl/languages.js +23 -39
- package/build/intl/locale.js +10 -20
- package/build/intl/localeConfig.js +5 -14
- package/build/intl/localeList.js +1 -8
- package/build/intl/localeObject.js +4 -11
- package/build/newsroom-context/context.js +5 -13
- package/build/newsroom-context/hooks/index.js +11 -126
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +3 -9
- package/build/newsroom-context/hooks/useCategories.js +3 -9
- package/build/newsroom-context/hooks/useCompanyInformation.js +3 -9
- package/build/newsroom-context/hooks/useCurrentCategory.js +3 -9
- package/build/newsroom-context/hooks/useCurrentLocale.js +3 -9
- package/build/newsroom-context/hooks/useCurrentStory.js +3 -9
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +10 -16
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +20 -26
- package/build/newsroom-context/hooks/useLanguages.js +3 -9
- package/build/newsroom-context/hooks/useNewsroom.js +3 -9
- package/build/newsroom-context/hooks/useNewsroomContext.js +4 -10
- package/build/newsroom-context/index.js +2 -34
- package/build/sentry/client.js +3 -9
- package/build/sentry/common.js +1 -7
- package/build/sentry/index.js +2 -19
- package/build/sentry/server.js +3 -9
- package/build/types.js +1 -1
- package/build/utils/boilerplate.js +3 -11
- package/build/utils/constants.js +3 -12
- package/build/utils/getAssetsUrl.js +3 -9
- package/build/utils/getDataRequestLink.js +3 -9
- package/build/utils/getLocalizedCategoryData.js +3 -11
- package/build/utils/getNewsroomLogoUrl.js +5 -12
- package/build/utils/getPrivacyPortalUrl.js +1 -7
- package/build/utils/getStoryPublicationDate.js +1 -7
- package/build/utils/getUploadcareGroupUrl.js +3 -9
- package/build/utils/index.js +10 -115
- package/build/utils/isEmbargoStory.js +1 -7
- package/package.json +3 -2
package/build/@types/global.d.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.fetchGalleries = fetchGalleries;
|
|
7
|
-
var _index = require("../../data-fetching/index.js");
|
|
8
|
-
async function fetchGalleries(req, res) {
|
|
1
|
+
import { getPrezlyApi } from "../../data-fetching/index.js";
|
|
2
|
+
export async function fetchGalleries(req, res) {
|
|
9
3
|
if (req.method !== 'POST') {
|
|
10
4
|
res.status(405);
|
|
11
5
|
return;
|
|
@@ -15,7 +9,7 @@ async function fetchGalleries(req, res) {
|
|
|
15
9
|
pageSize
|
|
16
10
|
} = req.body;
|
|
17
11
|
try {
|
|
18
|
-
const api =
|
|
12
|
+
const api = getPrezlyApi(req);
|
|
19
13
|
const {
|
|
20
14
|
galleries
|
|
21
15
|
} = await api.getGalleries({
|
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.fetchStories = fetchStories;
|
|
7
|
-
var _index = require("../../data-fetching/index.js");
|
|
8
|
-
async function fetchStories(req, res) {
|
|
1
|
+
import { getPrezlyApi } from "../../data-fetching/index.js";
|
|
2
|
+
export async function fetchStories(req, res) {
|
|
9
3
|
if (req.method !== 'POST') {
|
|
10
4
|
res.status(405);
|
|
11
5
|
return;
|
|
@@ -18,7 +12,7 @@ async function fetchStories(req, res) {
|
|
|
18
12
|
localeCode
|
|
19
13
|
} = req.body;
|
|
20
14
|
try {
|
|
21
|
-
const api =
|
|
15
|
+
const api = getPrezlyApi(req);
|
|
22
16
|
const {
|
|
23
17
|
stories
|
|
24
18
|
} = await (category ? api.getStoriesFromCategory(category, {
|
|
@@ -1,19 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "fetchGalleries", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _fetchGalleries.fetchGalleries;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "fetchStories", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _fetchStories.fetchStories;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _fetchGalleries = require("./fetchGalleries.js");
|
|
19
|
-
var _fetchStories = require("./fetchStories.js");
|
|
1
|
+
export { fetchGalleries } from "./fetchGalleries.js";
|
|
2
|
+
export { fetchStories } from "./fetchStories.js";
|
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getNewsroomServerSideProps = getNewsroomServerSideProps;
|
|
7
|
-
var _index = require("../data-fetching/index.js");
|
|
1
|
+
import { getPrezlyApi } from "../data-fetching/index.js";
|
|
8
2
|
/**
|
|
9
3
|
* Use this function in your `getServerSideProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
10
4
|
* See README for usage examples.
|
|
11
5
|
*/
|
|
12
|
-
async function getNewsroomServerSideProps(context, options = {}) {
|
|
6
|
+
export async function getNewsroomServerSideProps(context, options = {}) {
|
|
13
7
|
const {
|
|
14
8
|
req: request,
|
|
15
9
|
locale
|
|
16
10
|
} = context;
|
|
17
|
-
const api =
|
|
11
|
+
const api = getPrezlyApi(request);
|
|
18
12
|
const serverSideProps = await api.getNewsroomServerSideProps(request, locale, options.story);
|
|
19
13
|
if (options.loadHomepageContacts) {
|
|
20
14
|
serverSideProps.newsroomContextProps.contacts = await api.getNewsroomContacts();
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getNewsroomStaticProps = getNewsroomStaticProps;
|
|
7
|
-
var _index = require("../data-fetching/index.js");
|
|
1
|
+
import { getPrezlyApi } from "../data-fetching/index.js";
|
|
8
2
|
/**
|
|
9
3
|
* Use this function in your `getNewsroomStaticProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
10
4
|
* See README for usage examples.
|
|
11
5
|
*/
|
|
12
|
-
async function getNewsroomStaticProps(context, options = {}) {
|
|
6
|
+
export async function getNewsroomStaticProps(context, options = {}) {
|
|
13
7
|
const {
|
|
14
8
|
locale
|
|
15
9
|
} = context;
|
|
16
|
-
const api =
|
|
10
|
+
const api = getPrezlyApi();
|
|
17
11
|
const staticProps = await api.getNewsroomServerSideProps(undefined, locale, options.story);
|
|
18
12
|
if (options.loadHomepageContacts) {
|
|
19
13
|
staticProps.newsroomContextProps.contacts = await api.getNewsroomContacts();
|
|
@@ -1,71 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.keys(_index).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _index[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _index[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _getNewsroomServerSideProps = require("./getNewsroomServerSideProps.js");
|
|
18
|
-
Object.keys(_getNewsroomServerSideProps).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _getNewsroomServerSideProps[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _getNewsroomServerSideProps[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _getNewsroomStaticProps = require("./getNewsroomStaticProps.js");
|
|
29
|
-
Object.keys(_getNewsroomStaticProps).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _getNewsroomStaticProps[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _getNewsroomStaticProps[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _index2 = require("./page-props/index.js");
|
|
40
|
-
Object.keys(_index2).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _index2[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _index2[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _processRequest = require("./processRequest.js");
|
|
51
|
-
Object.keys(_processRequest).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _processRequest[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _processRequest[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _processStaticRequest = require("./processStaticRequest.js");
|
|
62
|
-
Object.keys(_processStaticRequest).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _processStaticRequest[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _processStaticRequest[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
1
|
+
export * from "./api-handlers/index.js";
|
|
2
|
+
export * from "./getNewsroomServerSideProps.js";
|
|
3
|
+
export * from "./getNewsroomStaticProps.js";
|
|
4
|
+
export * from "./page-props/index.js";
|
|
5
|
+
export * from "./processRequest.js";
|
|
6
|
+
export * from "./processStaticRequest.js";
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var _index = require("../../data-fetching/index.js");
|
|
10
|
-
var _index2 = require("../../intl/index.js");
|
|
11
|
-
var _index3 = require("../../utils/index.js");
|
|
12
|
-
var _getNewsroomServerSideProps = require("../getNewsroomServerSideProps.js");
|
|
13
|
-
var _getNewsroomStaticProps = require("../getNewsroomStaticProps.js");
|
|
14
|
-
var _processRequest = require("../processRequest.js");
|
|
15
|
-
var _processStaticRequest = require("../processStaticRequest.js");
|
|
16
|
-
function getCategoryPageServerSideProps(customProps, options) {
|
|
1
|
+
import { getPrezlyApi } from "../../data-fetching/index.js";
|
|
2
|
+
import { LocaleObject } from "../../intl/index.js";
|
|
3
|
+
import { DEFAULT_PAGE_SIZE, getLocalizedCategoryData } from "../../utils/index.js";
|
|
4
|
+
import { getNewsroomServerSideProps } from "../getNewsroomServerSideProps.js";
|
|
5
|
+
import { getNewsroomStaticProps } from "../getNewsroomStaticProps.js";
|
|
6
|
+
import { processRequest } from "../processRequest.js";
|
|
7
|
+
import { processStaticRequest } from "../processStaticRequest.js";
|
|
8
|
+
export function getCategoryPageServerSideProps(customProps, options) {
|
|
17
9
|
const {
|
|
18
|
-
pageSize =
|
|
10
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
19
11
|
extraStoryFields
|
|
20
12
|
} = options || {};
|
|
21
13
|
return async function getServerSideProps(context) {
|
|
22
14
|
const {
|
|
23
15
|
api,
|
|
24
16
|
serverSideProps
|
|
25
|
-
} = await
|
|
17
|
+
} = await getNewsroomServerSideProps(context);
|
|
26
18
|
const {
|
|
27
19
|
slug
|
|
28
20
|
} = context.params;
|
|
@@ -49,7 +41,7 @@ function getCategoryPageServerSideProps(customProps, options) {
|
|
|
49
41
|
localeCode
|
|
50
42
|
});
|
|
51
43
|
serverSideProps.newsroomContextProps.currentCategory = category;
|
|
52
|
-
return
|
|
44
|
+
return processRequest(context, {
|
|
53
45
|
...serverSideProps,
|
|
54
46
|
// TODO: This is temporary until return types from API are figured out
|
|
55
47
|
stories: stories,
|
|
@@ -62,16 +54,16 @@ function getCategoryPageServerSideProps(customProps, options) {
|
|
|
62
54
|
}, `/category/${slug}`);
|
|
63
55
|
};
|
|
64
56
|
}
|
|
65
|
-
function getCategoryPageStaticProps(customProps, options) {
|
|
57
|
+
export function getCategoryPageStaticProps(customProps, options) {
|
|
66
58
|
const {
|
|
67
|
-
pageSize =
|
|
59
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
68
60
|
extraStoryFields
|
|
69
61
|
} = options || {};
|
|
70
62
|
return async function getStaticProps(context) {
|
|
71
63
|
const {
|
|
72
64
|
api,
|
|
73
65
|
staticProps
|
|
74
|
-
} = await
|
|
66
|
+
} = await getNewsroomStaticProps(context);
|
|
75
67
|
const {
|
|
76
68
|
slug
|
|
77
69
|
} = context.params;
|
|
@@ -93,7 +85,7 @@ function getCategoryPageStaticProps(customProps, options) {
|
|
|
93
85
|
localeCode
|
|
94
86
|
});
|
|
95
87
|
staticProps.newsroomContextProps.currentCategory = category;
|
|
96
|
-
return
|
|
88
|
+
return processStaticRequest(context, {
|
|
97
89
|
...staticProps,
|
|
98
90
|
// TODO: This is temporary until return types from API are figured out
|
|
99
91
|
stories: stories,
|
|
@@ -106,14 +98,14 @@ function getCategoryPageStaticProps(customProps, options) {
|
|
|
106
98
|
});
|
|
107
99
|
};
|
|
108
100
|
}
|
|
109
|
-
async function getCategoryPageStaticPaths() {
|
|
110
|
-
const api =
|
|
101
|
+
export async function getCategoryPageStaticPaths() {
|
|
102
|
+
const api = getPrezlyApi();
|
|
111
103
|
const [categories, defaultLanguage] = await Promise.all([api.getCategories(), api.getNewsroomDefaultLanguage()]);
|
|
112
|
-
const locale =
|
|
104
|
+
const locale = LocaleObject.fromAnyCode(defaultLanguage.code);
|
|
113
105
|
const paths = categories.map(category => {
|
|
114
106
|
const {
|
|
115
107
|
slug
|
|
116
|
-
} =
|
|
108
|
+
} = getLocalizedCategoryData(category, locale);
|
|
117
109
|
if (!slug) {
|
|
118
110
|
return undefined;
|
|
119
111
|
}
|
|
@@ -1,24 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
exports.getGalleryPageStaticProps = getGalleryPageStaticProps;
|
|
8
|
-
var _index = require("../../utils/index.js");
|
|
9
|
-
var _getNewsroomServerSideProps = require("../getNewsroomServerSideProps.js");
|
|
10
|
-
var _getNewsroomStaticProps = require("../getNewsroomStaticProps.js");
|
|
11
|
-
var _processRequest = require("../processRequest.js");
|
|
12
|
-
var _processStaticRequest = require("../processStaticRequest.js");
|
|
13
|
-
function getGalleryPageServerSideProps(customProps, options) {
|
|
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) {
|
|
14
7
|
const {
|
|
15
|
-
pageSize =
|
|
8
|
+
pageSize = DEFAULT_GALLERY_PAGE_SIZE
|
|
16
9
|
} = options || {};
|
|
17
10
|
return async function getServerSideProps(context) {
|
|
18
11
|
const {
|
|
19
12
|
api,
|
|
20
13
|
serverSideProps
|
|
21
|
-
} = await
|
|
14
|
+
} = await getNewsroomServerSideProps(context);
|
|
22
15
|
const {
|
|
23
16
|
query
|
|
24
17
|
} = context;
|
|
@@ -43,7 +36,7 @@ function getGalleryPageServerSideProps(customProps, options) {
|
|
|
43
36
|
}
|
|
44
37
|
};
|
|
45
38
|
}
|
|
46
|
-
return
|
|
39
|
+
return processRequest(context, {
|
|
47
40
|
...serverSideProps,
|
|
48
41
|
galleries,
|
|
49
42
|
pagination: {
|
|
@@ -55,15 +48,15 @@ function getGalleryPageServerSideProps(customProps, options) {
|
|
|
55
48
|
}, '/media');
|
|
56
49
|
};
|
|
57
50
|
}
|
|
58
|
-
function getGalleryPageStaticProps(customProps, options) {
|
|
51
|
+
export function getGalleryPageStaticProps(customProps, options) {
|
|
59
52
|
const {
|
|
60
|
-
pageSize =
|
|
53
|
+
pageSize = DEFAULT_GALLERY_PAGE_SIZE
|
|
61
54
|
} = options || {};
|
|
62
55
|
return async function getStaticProps(context) {
|
|
63
56
|
const {
|
|
64
57
|
api,
|
|
65
58
|
staticProps
|
|
66
|
-
} = await
|
|
59
|
+
} = await getNewsroomStaticProps(context);
|
|
67
60
|
const {
|
|
68
61
|
galleries,
|
|
69
62
|
pagination
|
|
@@ -83,7 +76,7 @@ function getGalleryPageStaticProps(customProps, options) {
|
|
|
83
76
|
}
|
|
84
77
|
};
|
|
85
78
|
}
|
|
86
|
-
return
|
|
79
|
+
return processStaticRequest(context, {
|
|
87
80
|
...staticProps,
|
|
88
81
|
galleries,
|
|
89
82
|
pagination: {
|
|
@@ -1,22 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
exports.getGalleryAlbumPageStaticPaths = getGalleryAlbumPageStaticPaths;
|
|
8
|
-
exports.getGalleryAlbumPageStaticProps = getGalleryAlbumPageStaticProps;
|
|
9
|
-
var _index = require("../../data-fetching/index.js");
|
|
10
|
-
var _getNewsroomServerSideProps = require("../getNewsroomServerSideProps.js");
|
|
11
|
-
var _getNewsroomStaticProps = require("../getNewsroomStaticProps.js");
|
|
12
|
-
var _processRequest = require("../processRequest.js");
|
|
13
|
-
var _processStaticRequest = require("../processStaticRequest.js");
|
|
14
|
-
function getGalleryAlbumPageServerSideProps(customProps) {
|
|
1
|
+
import { getPrezlyApi } 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) {
|
|
15
7
|
return async function getServerSideProps(context) {
|
|
16
8
|
const {
|
|
17
9
|
api,
|
|
18
10
|
serverSideProps
|
|
19
|
-
} = await
|
|
11
|
+
} = await getNewsroomServerSideProps(context);
|
|
20
12
|
const {
|
|
21
13
|
uuid
|
|
22
14
|
} = context.params;
|
|
@@ -26,19 +18,19 @@ function getGalleryAlbumPageServerSideProps(customProps) {
|
|
|
26
18
|
notFound: true
|
|
27
19
|
};
|
|
28
20
|
}
|
|
29
|
-
return
|
|
21
|
+
return processRequest(context, {
|
|
30
22
|
...serverSideProps,
|
|
31
23
|
gallery,
|
|
32
24
|
...(typeof customProps === 'function' ? await customProps(context, serverSideProps) : customProps)
|
|
33
25
|
}, `/media/album/${uuid}`);
|
|
34
26
|
};
|
|
35
27
|
}
|
|
36
|
-
function getGalleryAlbumPageStaticProps(customProps) {
|
|
28
|
+
export function getGalleryAlbumPageStaticProps(customProps) {
|
|
37
29
|
return async function getStaticProps(context) {
|
|
38
30
|
const {
|
|
39
31
|
api,
|
|
40
32
|
staticProps
|
|
41
|
-
} = await
|
|
33
|
+
} = await getNewsroomStaticProps(context);
|
|
42
34
|
const {
|
|
43
35
|
uuid
|
|
44
36
|
} = context.params;
|
|
@@ -48,15 +40,15 @@ function getGalleryAlbumPageStaticProps(customProps) {
|
|
|
48
40
|
notFound: true
|
|
49
41
|
};
|
|
50
42
|
}
|
|
51
|
-
return
|
|
43
|
+
return processStaticRequest(context, {
|
|
52
44
|
...staticProps,
|
|
53
45
|
gallery,
|
|
54
46
|
...(typeof customProps === 'function' ? await customProps(context, staticProps) : customProps)
|
|
55
47
|
});
|
|
56
48
|
};
|
|
57
49
|
}
|
|
58
|
-
async function getGalleryAlbumPageStaticPaths() {
|
|
59
|
-
const api =
|
|
50
|
+
export async function getGalleryAlbumPageStaticPaths() {
|
|
51
|
+
const api = getPrezlyApi();
|
|
60
52
|
const {
|
|
61
53
|
galleries
|
|
62
54
|
} = await api.getGalleries({});
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
exports.getHomepageStaticProps = getHomepageStaticProps;
|
|
8
|
-
var _index = require("../../utils/index.js");
|
|
9
|
-
var _getNewsroomServerSideProps = require("../getNewsroomServerSideProps.js");
|
|
10
|
-
var _getNewsroomStaticProps = require("../getNewsroomStaticProps.js");
|
|
11
|
-
var _processRequest = require("../processRequest.js");
|
|
12
|
-
var _processStaticRequest = require("../processStaticRequest.js");
|
|
13
|
-
function getHomepageServerSideProps(customProps, options) {
|
|
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) {
|
|
14
7
|
const {
|
|
15
|
-
pageSize =
|
|
8
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
16
9
|
extraStoryFields
|
|
17
10
|
} = options || {};
|
|
18
11
|
return async function getServerSideProps(context) {
|
|
19
12
|
const {
|
|
20
13
|
api,
|
|
21
14
|
serverSideProps
|
|
22
|
-
} = await
|
|
15
|
+
} = await getNewsroomServerSideProps(context, {
|
|
23
16
|
loadHomepageContacts: true
|
|
24
17
|
});
|
|
25
18
|
const {
|
|
@@ -39,7 +32,7 @@ function getHomepageServerSideProps(customProps, options) {
|
|
|
39
32
|
stories,
|
|
40
33
|
storiesTotal
|
|
41
34
|
} = storiesPaginated;
|
|
42
|
-
return
|
|
35
|
+
return processRequest(context, {
|
|
43
36
|
...serverSideProps,
|
|
44
37
|
// TODO: This is temporary until return types from API are figured out
|
|
45
38
|
stories: stories,
|
|
@@ -52,16 +45,16 @@ function getHomepageServerSideProps(customProps, options) {
|
|
|
52
45
|
}, '/');
|
|
53
46
|
};
|
|
54
47
|
}
|
|
55
|
-
function getHomepageStaticProps(customProps, options) {
|
|
48
|
+
export function getHomepageStaticProps(customProps, options) {
|
|
56
49
|
const {
|
|
57
|
-
pageSize =
|
|
50
|
+
pageSize = DEFAULT_PAGE_SIZE,
|
|
58
51
|
extraStoryFields
|
|
59
52
|
} = options || {};
|
|
60
53
|
return async function getStaticProps(context) {
|
|
61
54
|
const {
|
|
62
55
|
api,
|
|
63
56
|
staticProps
|
|
64
|
-
} = await
|
|
57
|
+
} = await getNewsroomStaticProps(context, {
|
|
65
58
|
loadHomepageContacts: true
|
|
66
59
|
});
|
|
67
60
|
const {
|
|
@@ -76,7 +69,7 @@ function getHomepageStaticProps(customProps, options) {
|
|
|
76
69
|
stories,
|
|
77
70
|
storiesTotal
|
|
78
71
|
} = storiesPaginated;
|
|
79
|
-
return
|
|
72
|
+
return processStaticRequest(context, {
|
|
80
73
|
...staticProps,
|
|
81
74
|
// TODO: This is temporary until return types from API are figured out
|
|
82
75
|
stories: stories,
|
|
@@ -1,138 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
getCategoryPageStaticProps: true,
|
|
10
|
-
getGalleryPageServerSideProps: true,
|
|
11
|
-
getGalleryPageStaticProps: true,
|
|
12
|
-
getGalleryAlbumPageServerSideProps: true,
|
|
13
|
-
getGalleryAlbumPageStaticPaths: true,
|
|
14
|
-
getGalleryAlbumPageStaticProps: true,
|
|
15
|
-
getHomepageServerSideProps: true,
|
|
16
|
-
getHomepageStaticProps: true,
|
|
17
|
-
getSearchPageServerSideProps: true,
|
|
18
|
-
getSearchPageStaticProps: true,
|
|
19
|
-
getStoryPageServerSideProps: true,
|
|
20
|
-
getStoryPageStaticPaths: true,
|
|
21
|
-
getStoryPageStaticProps: true,
|
|
22
|
-
getStoryPreviewPageServerSideProps: true
|
|
23
|
-
};
|
|
24
|
-
Object.defineProperty(exports, "getCategoryPageServerSideProps", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function () {
|
|
27
|
-
return _category.getCategoryPageServerSideProps;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
Object.defineProperty(exports, "getCategoryPageStaticPaths", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return _category.getCategoryPageStaticPaths;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "getCategoryPageStaticProps", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function () {
|
|
39
|
-
return _category.getCategoryPageStaticProps;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
Object.defineProperty(exports, "getGalleryAlbumPageServerSideProps", {
|
|
43
|
-
enumerable: true,
|
|
44
|
-
get: function () {
|
|
45
|
-
return _galleryAlbum.getGalleryAlbumPageServerSideProps;
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
Object.defineProperty(exports, "getGalleryAlbumPageStaticPaths", {
|
|
49
|
-
enumerable: true,
|
|
50
|
-
get: function () {
|
|
51
|
-
return _galleryAlbum.getGalleryAlbumPageStaticPaths;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
Object.defineProperty(exports, "getGalleryAlbumPageStaticProps", {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _galleryAlbum.getGalleryAlbumPageStaticProps;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Object.defineProperty(exports, "getGalleryPageServerSideProps", {
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function () {
|
|
63
|
-
return _gallery.getGalleryPageServerSideProps;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
Object.defineProperty(exports, "getGalleryPageStaticProps", {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return _gallery.getGalleryPageStaticProps;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, "getHomepageServerSideProps", {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return _home.getHomepageServerSideProps;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, "getHomepageStaticProps", {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return _home.getHomepageStaticProps;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, "getSearchPageServerSideProps", {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return _search.getSearchPageServerSideProps;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, "getSearchPageStaticProps", {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return _search.getSearchPageStaticProps;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(exports, "getStoryPageServerSideProps", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
get: function () {
|
|
99
|
-
return _story.getStoryPageServerSideProps;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
Object.defineProperty(exports, "getStoryPageStaticPaths", {
|
|
103
|
-
enumerable: true,
|
|
104
|
-
get: function () {
|
|
105
|
-
return _story.getStoryPageStaticPaths;
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(exports, "getStoryPageStaticProps", {
|
|
109
|
-
enumerable: true,
|
|
110
|
-
get: function () {
|
|
111
|
-
return _story.getStoryPageStaticProps;
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
Object.defineProperty(exports, "getStoryPreviewPageServerSideProps", {
|
|
115
|
-
enumerable: true,
|
|
116
|
-
get: function () {
|
|
117
|
-
return _storyPreview.getStoryPreviewPageServerSideProps;
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
var _category = require("./category.js");
|
|
121
|
-
var _gallery = require("./gallery.js");
|
|
122
|
-
var _galleryAlbum = require("./galleryAlbum.js");
|
|
123
|
-
var _home = require("./home.js");
|
|
124
|
-
var _search = require("./search.js");
|
|
125
|
-
var _index = require("./sitemap/index.js");
|
|
126
|
-
Object.keys(_index).forEach(function (key) {
|
|
127
|
-
if (key === "default" || key === "__esModule") return;
|
|
128
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
129
|
-
if (key in exports && exports[key] === _index[key]) return;
|
|
130
|
-
Object.defineProperty(exports, key, {
|
|
131
|
-
enumerable: true,
|
|
132
|
-
get: function () {
|
|
133
|
-
return _index[key];
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
var _story = require("./story.js");
|
|
138
|
-
var _storyPreview = require("./storyPreview.js");
|
|
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
|
-
|
|
1
|
+
export {};
|