@prezly/theme-kit-nextjs 7.0.1 → 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.
Files changed (315) hide show
  1. package/build/adapters/app-helper/server.cjs +29 -0
  2. package/build/adapters/app-helper/server.d.ts +9 -0
  3. package/build/adapters/app-helper/server.mjs +23 -0
  4. package/build/adapters/client.cjs +27 -0
  5. package/build/adapters/client.d.ts +2 -0
  6. package/build/adapters/client.mjs +3 -0
  7. package/build/adapters/intl/server.cjs +108 -0
  8. package/build/adapters/intl/server.d.ts +26 -0
  9. package/build/adapters/intl/server.mjs +100 -0
  10. package/build/adapters/metadata/lib/generateCategoryPageMetadata.cjs +52 -0
  11. package/build/adapters/metadata/lib/generateCategoryPageMetadata.d.ts +12 -0
  12. package/build/adapters/metadata/lib/generateCategoryPageMetadata.mjs +46 -0
  13. package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.cjs +44 -0
  14. package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.d.ts +12 -0
  15. package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.mjs +38 -0
  16. package/build/adapters/metadata/lib/generateMediaPageMetadata.cjs +43 -0
  17. package/build/adapters/metadata/lib/generateMediaPageMetadata.d.ts +12 -0
  18. package/build/adapters/metadata/lib/generateMediaPageMetadata.mjs +37 -0
  19. package/build/adapters/metadata/lib/generateRootMetadata.cjs +51 -0
  20. package/build/adapters/metadata/lib/generateRootMetadata.d.ts +10 -0
  21. package/build/adapters/metadata/lib/generateRootMetadata.mjs +45 -0
  22. package/build/adapters/metadata/lib/generateSearchPageMetadata.cjs +43 -0
  23. package/build/adapters/metadata/lib/generateSearchPageMetadata.d.ts +12 -0
  24. package/build/adapters/metadata/lib/generateSearchPageMetadata.mjs +37 -0
  25. package/build/adapters/metadata/lib/generateStoryPageMetadata.cjs +100 -0
  26. package/build/adapters/metadata/lib/generateStoryPageMetadata.d.ts +14 -0
  27. package/build/adapters/metadata/lib/generateStoryPageMetadata.mjs +94 -0
  28. package/build/adapters/metadata/lib/index.cjs +66 -0
  29. package/build/adapters/metadata/lib/index.d.ts +8 -0
  30. package/build/adapters/metadata/lib/index.mjs +7 -0
  31. package/build/adapters/metadata/lib/types.cjs +1 -0
  32. package/build/adapters/metadata/lib/types.d.ts +30 -0
  33. package/build/adapters/metadata/lib/types.mjs +1 -0
  34. package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.cjs +11 -0
  35. package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.d.ts +7 -0
  36. package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.mjs +5 -0
  37. package/build/adapters/metadata/lib/utils/generatePageMetadata.cjs +75 -0
  38. package/build/adapters/metadata/lib/utils/generatePageMetadata.d.ts +14 -0
  39. package/build/adapters/metadata/lib/utils/generatePageMetadata.mjs +70 -0
  40. package/build/adapters/metadata/lib/utils/index.cjs +26 -0
  41. package/build/adapters/metadata/lib/utils/index.d.ts +3 -0
  42. package/build/adapters/metadata/lib/utils/index.mjs +3 -0
  43. package/build/adapters/metadata/lib/utils/mergePageMetadata.cjs +48 -0
  44. package/build/adapters/metadata/lib/utils/mergePageMetadata.d.ts +2 -0
  45. package/build/adapters/metadata/lib/utils/mergePageMetadata.mjs +43 -0
  46. package/build/adapters/metadata/server.cjs +82 -0
  47. package/build/adapters/metadata/server.d.ts +34 -0
  48. package/build/adapters/metadata/server.mjs +74 -0
  49. package/build/adapters/prezly/cache/configure.cjs +38 -0
  50. package/build/adapters/prezly/cache/configure.d.ts +15 -0
  51. package/build/adapters/prezly/cache/configure.mjs +33 -0
  52. package/build/adapters/prezly/cache/index.cjs +19 -0
  53. package/build/adapters/prezly/cache/index.d.ts +2 -0
  54. package/build/adapters/prezly/cache/index.mjs +2 -0
  55. package/build/adapters/prezly/cache/redis.cjs +60 -0
  56. package/build/adapters/prezly/cache/redis.d.ts +9 -0
  57. package/build/adapters/prezly/cache/redis.mjs +55 -0
  58. package/build/adapters/prezly/server.cjs +55 -0
  59. package/build/adapters/prezly/server.d.ts +48 -0
  60. package/build/adapters/prezly/server.mjs +51 -0
  61. package/build/adapters/routing/client.cjs +10 -0
  62. package/build/adapters/routing/client.d.ts +1 -0
  63. package/build/adapters/routing/client.mjs +3 -0
  64. package/build/adapters/routing/lib/RoutingAdapter.client.cjs +55 -0
  65. package/build/adapters/routing/lib/RoutingAdapter.client.d.ts +39 -0
  66. package/build/adapters/routing/lib/RoutingAdapter.client.mjs +48 -0
  67. package/build/adapters/routing/lib/RoutingAdapter.server.cjs +49 -0
  68. package/build/adapters/routing/lib/RoutingAdapter.server.d.ts +16 -0
  69. package/build/adapters/routing/lib/RoutingAdapter.server.mjs +45 -0
  70. package/build/adapters/routing/server.cjs +29 -0
  71. package/build/adapters/routing/server.d.ts +2 -0
  72. package/build/adapters/routing/server.mjs +5 -0
  73. package/build/adapters/server.cjs +71 -0
  74. package/build/adapters/server.d.ts +6 -0
  75. package/build/adapters/server.mjs +7 -0
  76. package/build/adapters/theme-settings/client.cjs +37 -0
  77. package/build/adapters/theme-settings/client.d.ts +13 -0
  78. package/build/adapters/theme-settings/client.mjs +30 -0
  79. package/build/adapters/theme-settings/server.cjs +34 -0
  80. package/build/adapters/theme-settings/server.d.ts +10 -0
  81. package/build/adapters/theme-settings/server.mjs +28 -0
  82. package/build/index.cjs +49 -0
  83. package/build/index.d.ts +4 -7
  84. package/build/index.mjs +4 -0
  85. package/build/middleware/generate-slugs.d.ts +1 -0
  86. package/build/middleware/index.cjs +10 -0
  87. package/build/middleware/index.d.ts +1 -0
  88. package/build/middleware/index.mjs +2 -0
  89. package/build/middleware/intl-middleware.cjs +134 -0
  90. package/build/middleware/intl-middleware.d.ts +101 -0
  91. package/build/middleware/intl-middleware.mjs +127 -0
  92. package/build/middleware/slugs.cjs +9 -0
  93. package/build/middleware/slugs.d.ts +1 -0
  94. package/build/middleware/slugs.mjs +3 -0
  95. package/build/next-config/index.cjs +63 -0
  96. package/build/next-config/index.d.ts +9 -0
  97. package/build/next-config/index.mjs +57 -0
  98. package/build/playwright/config.cjs +70 -0
  99. package/build/playwright/config.d.ts +7 -1
  100. package/build/playwright/config.mjs +66 -0
  101. package/build/playwright/index.cjs +12 -0
  102. package/build/playwright/index.d.ts +1 -1
  103. package/build/playwright/index.mjs +1 -0
  104. package/build/robots/server.cjs +54 -0
  105. package/build/robots/server.d.ts +12 -0
  106. package/build/robots/server.mjs +48 -0
  107. package/build/sentry/client.cjs +10 -0
  108. package/build/sentry/client.d.ts +1 -2
  109. package/build/sentry/client.mjs +4 -0
  110. package/build/sentry/common.cjs +72 -0
  111. package/build/sentry/common.d.ts +1 -1
  112. package/build/sentry/common.mjs +66 -0
  113. package/build/sentry/index.cjs +19 -0
  114. package/build/sentry/index.d.ts +2 -2
  115. package/build/sentry/index.mjs +2 -0
  116. package/build/sentry/server.cjs +10 -0
  117. package/build/sentry/server.d.ts +1 -2
  118. package/build/sentry/server.mjs +4 -0
  119. package/build/server.cjs +25 -0
  120. package/build/server.d.ts +2 -2
  121. package/build/server.mjs +3 -0
  122. package/package.json +51 -26
  123. package/build/adapter-nextjs/api-handlers/fetchGalleries.d.ts +0 -2
  124. package/build/adapter-nextjs/api-handlers/fetchGalleries.js +0 -29
  125. package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +0 -1
  126. package/build/adapter-nextjs/api-handlers/fetchStories.d.ts +0 -2
  127. package/build/adapter-nextjs/api-handlers/fetchStories.js +0 -34
  128. package/build/adapter-nextjs/api-handlers/fetchStories.js.map +0 -1
  129. package/build/adapter-nextjs/api-handlers/index.d.ts +0 -2
  130. package/build/adapter-nextjs/api-handlers/index.js +0 -8
  131. package/build/adapter-nextjs/api-handlers/index.js.map +0 -1
  132. package/build/adapter-nextjs/getNewsroomServerSideProps.d.ts +0 -16
  133. package/build/adapter-nextjs/getNewsroomServerSideProps.js +0 -18
  134. package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +0 -1
  135. package/build/adapter-nextjs/getNewsroomStaticProps.d.ts +0 -16
  136. package/build/adapter-nextjs/getNewsroomStaticProps.js +0 -18
  137. package/build/adapter-nextjs/getNewsroomStaticProps.js.map +0 -1
  138. package/build/adapter-nextjs/index.d.ts +0 -6
  139. package/build/adapter-nextjs/index.js +0 -23
  140. package/build/adapter-nextjs/index.js.map +0 -1
  141. package/build/adapter-nextjs/page-props/category.d.ts +0 -16
  142. package/build/adapter-nextjs/page-props/category.js +0 -105
  143. package/build/adapter-nextjs/page-props/category.js.map +0 -1
  144. package/build/adapter-nextjs/page-props/gallery.d.ts +0 -14
  145. package/build/adapter-nextjs/page-props/gallery.js +0 -74
  146. package/build/adapter-nextjs/page-props/gallery.js.map +0 -1
  147. package/build/adapter-nextjs/page-props/galleryAlbum.d.ts +0 -9
  148. package/build/adapter-nextjs/page-props/galleryAlbum.js +0 -56
  149. package/build/adapter-nextjs/page-props/galleryAlbum.js.map +0 -1
  150. package/build/adapter-nextjs/page-props/home.d.ts +0 -21
  151. package/build/adapter-nextjs/page-props/home.js +0 -73
  152. package/build/adapter-nextjs/page-props/home.js.map +0 -1
  153. package/build/adapter-nextjs/page-props/index.d.ts +0 -8
  154. package/build/adapter-nextjs/page-props/index.js +0 -42
  155. package/build/adapter-nextjs/page-props/index.js.map +0 -1
  156. package/build/adapter-nextjs/page-props/lib/types.d.ts +0 -3
  157. package/build/adapter-nextjs/page-props/lib/types.js +0 -3
  158. package/build/adapter-nextjs/page-props/lib/types.js.map +0 -1
  159. package/build/adapter-nextjs/page-props/search.d.ts +0 -4
  160. package/build/adapter-nextjs/page-props/search.js +0 -32
  161. package/build/adapter-nextjs/page-props/search.js.map +0 -1
  162. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.d.ts +0 -22
  163. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +0 -139
  164. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +0 -1
  165. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.d.ts +0 -7
  166. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +0 -55
  167. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +0 -1
  168. package/build/adapter-nextjs/page-props/sitemap/index.d.ts +0 -3
  169. package/build/adapter-nextjs/page-props/sitemap/index.js +0 -23
  170. package/build/adapter-nextjs/page-props/sitemap/index.js.map +0 -1
  171. package/build/adapter-nextjs/page-props/sitemap/types.d.ts +0 -9
  172. package/build/adapter-nextjs/page-props/sitemap/types.js +0 -3
  173. package/build/adapter-nextjs/page-props/sitemap/types.js.map +0 -1
  174. package/build/adapter-nextjs/page-props/story.d.ts +0 -13
  175. package/build/adapter-nextjs/page-props/story.js +0 -78
  176. package/build/adapter-nextjs/page-props/story.js.map +0 -1
  177. package/build/adapter-nextjs/page-props/storyPreview.d.ts +0 -4
  178. package/build/adapter-nextjs/page-props/storyPreview.js +0 -28
  179. package/build/adapter-nextjs/page-props/storyPreview.js.map +0 -1
  180. package/build/adapter-nextjs/processRequest.d.ts +0 -12
  181. package/build/adapter-nextjs/processRequest.js +0 -43
  182. package/build/adapter-nextjs/processRequest.js.map +0 -1
  183. package/build/adapter-nextjs/processStaticRequest.d.ts +0 -11
  184. package/build/adapter-nextjs/processStaticRequest.js +0 -28
  185. package/build/adapter-nextjs/processStaticRequest.js.map +0 -1
  186. package/build/components-nextjs/PageSeo/PageSeo.d.ts +0 -16
  187. package/build/components-nextjs/PageSeo/PageSeo.js +0 -87
  188. package/build/components-nextjs/PageSeo/PageSeo.js.map +0 -1
  189. package/build/components-nextjs/PageSeo/index.d.ts +0 -1
  190. package/build/components-nextjs/PageSeo/index.js +0 -6
  191. package/build/components-nextjs/PageSeo/index.js.map +0 -1
  192. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.d.ts +0 -1
  193. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +0 -14
  194. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +0 -1
  195. package/build/components-nextjs/PageSeo/lib/index.d.ts +0 -1
  196. package/build/components-nextjs/PageSeo/lib/index.js +0 -6
  197. package/build/components-nextjs/PageSeo/lib/index.js.map +0 -1
  198. package/build/components-nextjs/StorySeo/StorySeo.d.ts +0 -11
  199. package/build/components-nextjs/StorySeo/StorySeo.js +0 -56
  200. package/build/components-nextjs/StorySeo/StorySeo.js.map +0 -1
  201. package/build/components-nextjs/StorySeo/index.d.ts +0 -1
  202. package/build/components-nextjs/StorySeo/index.js +0 -6
  203. package/build/components-nextjs/StorySeo/index.js.map +0 -1
  204. package/build/components-nextjs/document.d.ts +0 -5
  205. package/build/components-nextjs/document.js +0 -48
  206. package/build/components-nextjs/document.js.map +0 -1
  207. package/build/components-nextjs/index.d.ts +0 -3
  208. package/build/components-nextjs/index.js +0 -10
  209. package/build/components-nextjs/index.js.map +0 -1
  210. package/build/config.d.ts +0 -17
  211. package/build/config.js +0 -78
  212. package/build/config.js.map +0 -1
  213. package/build/data-fetching/client.d.ts +0 -10
  214. package/build/data-fetching/client.js +0 -51
  215. package/build/data-fetching/client.js.map +0 -1
  216. package/build/data-fetching/index.d.ts +0 -1
  217. package/build/data-fetching/index.js +0 -28
  218. package/build/data-fetching/index.js.map +0 -1
  219. package/build/index.js +0 -24
  220. package/build/index.js.map +0 -1
  221. package/build/infinite-loading/index.d.ts +0 -4
  222. package/build/infinite-loading/index.js +0 -25
  223. package/build/infinite-loading/index.js.map +0 -1
  224. package/build/infinite-loading/lib/index.d.ts +0 -1
  225. package/build/infinite-loading/lib/index.js +0 -6
  226. package/build/infinite-loading/lib/index.js.map +0 -1
  227. package/build/infinite-loading/lib/useAsync.d.ts +0 -44
  228. package/build/infinite-loading/lib/useAsync.js +0 -70
  229. package/build/infinite-loading/lib/useAsync.js.map +0 -1
  230. package/build/infinite-loading/lib/useSyncedRef.d.ts +0 -12
  231. package/build/infinite-loading/lib/useSyncedRef.js +0 -24
  232. package/build/infinite-loading/lib/useSyncedRef.js.map +0 -1
  233. package/build/infinite-loading/types.d.ts +0 -9
  234. package/build/infinite-loading/types.js +0 -3
  235. package/build/infinite-loading/types.js.map +0 -1
  236. package/build/infinite-loading/useInfiniteGalleriesLoading.d.ts +0 -13
  237. package/build/infinite-loading/useInfiniteGalleriesLoading.js +0 -46
  238. package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +0 -1
  239. package/build/infinite-loading/useInfiniteLoading.d.ts +0 -16
  240. package/build/infinite-loading/useInfiniteLoading.js +0 -44
  241. package/build/infinite-loading/useInfiniteLoading.js.map +0 -1
  242. package/build/infinite-loading/useInfiniteStoriesLoading.d.ts +0 -13
  243. package/build/infinite-loading/useInfiniteStoriesLoading.js +0 -62
  244. package/build/infinite-loading/useInfiniteStoriesLoading.js.map +0 -1
  245. package/build/intl/index.d.ts +0 -2
  246. package/build/intl/index.js +0 -19
  247. package/build/intl/index.js.map +0 -1
  248. package/build/intl/languages.d.ts +0 -6
  249. package/build/intl/languages.js +0 -19
  250. package/build/intl/languages.js.map +0 -1
  251. package/build/intl/locale.d.ts +0 -5
  252. package/build/intl/locale.js +0 -31
  253. package/build/intl/locale.js.map +0 -1
  254. package/build/newsroom-context/context.d.ts +0 -62
  255. package/build/newsroom-context/context.js +0 -29
  256. package/build/newsroom-context/context.js.map +0 -1
  257. package/build/newsroom-context/hooks/index.d.ts +0 -11
  258. package/build/newsroom-context/hooks/index.js +0 -28
  259. package/build/newsroom-context/hooks/index.js.map +0 -1
  260. package/build/newsroom-context/hooks/useAlgoliaSettings.d.ts +0 -1
  261. package/build/newsroom-context/hooks/useAlgoliaSettings.js +0 -10
  262. package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +0 -1
  263. package/build/newsroom-context/hooks/useCategories.d.ts +0 -1
  264. package/build/newsroom-context/hooks/useCategories.js +0 -10
  265. package/build/newsroom-context/hooks/useCategories.js.map +0 -1
  266. package/build/newsroom-context/hooks/useCompanyInformation.d.ts +0 -1
  267. package/build/newsroom-context/hooks/useCompanyInformation.js +0 -10
  268. package/build/newsroom-context/hooks/useCompanyInformation.js.map +0 -1
  269. package/build/newsroom-context/hooks/useCurrentCategory.d.ts +0 -1
  270. package/build/newsroom-context/hooks/useCurrentCategory.js +0 -10
  271. package/build/newsroom-context/hooks/useCurrentCategory.js.map +0 -1
  272. package/build/newsroom-context/hooks/useCurrentLocale.d.ts +0 -1
  273. package/build/newsroom-context/hooks/useCurrentLocale.js +0 -10
  274. package/build/newsroom-context/hooks/useCurrentLocale.js.map +0 -1
  275. package/build/newsroom-context/hooks/useCurrentStory.d.ts +0 -1
  276. package/build/newsroom-context/hooks/useCurrentStory.js +0 -10
  277. package/build/newsroom-context/hooks/useCurrentStory.js.map +0 -1
  278. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.d.ts +0 -2
  279. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +0 -29
  280. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +0 -1
  281. package/build/newsroom-context/hooks/useGetTranslationUrl.d.ts +0 -6
  282. package/build/newsroom-context/hooks/useGetTranslationUrl.js +0 -65
  283. package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +0 -1
  284. package/build/newsroom-context/hooks/useLanguages.d.ts +0 -1
  285. package/build/newsroom-context/hooks/useLanguages.js +0 -10
  286. package/build/newsroom-context/hooks/useLanguages.js.map +0 -1
  287. package/build/newsroom-context/hooks/useNewsroom.d.ts +0 -1
  288. package/build/newsroom-context/hooks/useNewsroom.js +0 -10
  289. package/build/newsroom-context/hooks/useNewsroom.js.map +0 -1
  290. package/build/newsroom-context/hooks/useNewsroomContext.d.ts +0 -2
  291. package/build/newsroom-context/hooks/useNewsroomContext.js +0 -16
  292. package/build/newsroom-context/hooks/useNewsroomContext.js.map +0 -1
  293. package/build/newsroom-context/index.d.ts +0 -2
  294. package/build/newsroom-context/index.js +0 -22
  295. package/build/newsroom-context/index.js.map +0 -1
  296. package/build/playwright/config.js +0 -67
  297. package/build/playwright/config.js.map +0 -1
  298. package/build/playwright/index.js +0 -6
  299. package/build/playwright/index.js.map +0 -1
  300. package/build/sentry/client.js +0 -9
  301. package/build/sentry/client.js.map +0 -1
  302. package/build/sentry/common.js +0 -66
  303. package/build/sentry/common.js.map +0 -1
  304. package/build/sentry/index.js +0 -8
  305. package/build/sentry/index.js.map +0 -1
  306. package/build/sentry/server.js +0 -9
  307. package/build/sentry/server.js.map +0 -1
  308. package/build/server.js +0 -19
  309. package/build/server.js.map +0 -1
  310. package/build/types.d.ts +0 -14
  311. package/build/types.js +0 -3
  312. package/build/types.js.map +0 -1
  313. package/build/utils.d.ts +0 -6
  314. package/build/utils.js +0 -16
  315. 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,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,OAAO,CAC7C;YACI,QAAQ;YACR,MAAM,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,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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,2D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ext, 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,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,CAAC,CAAC;QAE3E,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA0B,CAAC;QACpD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,OAAO,IA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AAM,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;YAC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AAG,gBAAgB,CAAC;QAEjD,OAAO,IAAA,2CAAoB,EAAC,OAAO,EAAE;YACjC,GAAG,WAAW;YACd,OAAO;YACP,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;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,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
@@ -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
- }