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