@prezly/theme-kit-nextjs 2.0.1-1 → 2.1.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 (259) hide show
  1. package/README.md +15 -15
  2. package/build/adapter-nextjs/api-handlers/fetchGalleries.js +21 -31
  3. package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
  4. package/build/adapter-nextjs/api-handlers/fetchStories.js +23 -41
  5. package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
  6. package/build/adapter-nextjs/api-handlers/index.js +7 -18
  7. package/build/adapter-nextjs/api-handlers/index.js.map +1 -1
  8. package/build/adapter-nextjs/getNewsroomServerSideProps.js +13 -20
  9. package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
  10. package/build/adapter-nextjs/getNewsroomStaticProps.js +13 -19
  11. package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
  12. package/build/adapter-nextjs/index.js +21 -69
  13. package/build/adapter-nextjs/index.js.map +1 -1
  14. package/build/adapter-nextjs/page-props/category.js +96 -122
  15. package/build/adapter-nextjs/page-props/category.js.map +1 -1
  16. package/build/adapter-nextjs/page-props/gallery.js +65 -91
  17. package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
  18. package/build/adapter-nextjs/page-props/galleryAlbum.js +49 -68
  19. package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
  20. package/build/adapter-nextjs/page-props/home.js +66 -87
  21. package/build/adapter-nextjs/page-props/home.js.map +1 -1
  22. package/build/adapter-nextjs/page-props/index.js +40 -136
  23. package/build/adapter-nextjs/page-props/index.js.map +1 -1
  24. package/build/adapter-nextjs/page-props/lib/types.js +3 -1
  25. package/build/adapter-nextjs/page-props/search.js +28 -29
  26. package/build/adapter-nextjs/page-props/search.js.map +1 -1
  27. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +46 -32
  28. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
  29. package/build/adapter-nextjs/page-props/sitemap/createPaths.js +17 -17
  30. package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
  31. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +33 -37
  32. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
  33. package/build/adapter-nextjs/page-props/sitemap/index.js +23 -41
  34. package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -1
  35. package/build/adapter-nextjs/page-props/sitemap/types.js +3 -1
  36. package/build/adapter-nextjs/page-props/story.js +60 -81
  37. package/build/adapter-nextjs/page-props/story.js.map +1 -1
  38. package/build/adapter-nextjs/page-props/storyPreview.js +24 -31
  39. package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
  40. package/build/adapter-nextjs/processRequest.js +23 -38
  41. package/build/adapter-nextjs/processRequest.js.map +1 -1
  42. package/build/adapter-nextjs/processStaticRequest.js +14 -23
  43. package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
  44. package/build/components-nextjs/PageSeo/PageSeo.js +77 -89
  45. package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
  46. package/build/components-nextjs/PageSeo/index.js +19 -25
  47. package/build/components-nextjs/PageSeo/index.js.map +1 -1
  48. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +8 -9
  49. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
  50. package/build/components-nextjs/PageSeo/lib/types.js +3 -1
  51. package/build/components-nextjs/StorySeo/StorySeo.js +46 -74
  52. package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
  53. package/build/components-nextjs/StorySeo/index.js +5 -11
  54. package/build/components-nextjs/StorySeo/index.js.map +1 -1
  55. package/build/components-nextjs/document.js +44 -36
  56. package/build/components-nextjs/document.js.map +1 -1
  57. package/build/components-nextjs/index.js +9 -25
  58. package/build/components-nextjs/index.js.map +1 -1
  59. package/build/data-fetching/api/PrezlyApi.js +187 -210
  60. package/build/data-fetching/api/PrezlyApi.js.map +1 -1
  61. package/build/data-fetching/api/getPrezlyApi.js +19 -25
  62. package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
  63. package/build/data-fetching/api/index.js +16 -14
  64. package/build/data-fetching/api/index.js.map +1 -1
  65. package/build/data-fetching/api/queries.js +41 -80
  66. package/build/data-fetching/api/queries.js.map +1 -1
  67. package/build/data-fetching/index.js +18 -36
  68. package/build/data-fetching/index.js.map +1 -1
  69. package/build/data-fetching/lib/getAlgoliaSettings.js +20 -26
  70. package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
  71. package/build/data-fetching/lib/getEnvVariables.js +36 -40
  72. package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
  73. package/build/data-fetching/lib/index.js +11 -32
  74. package/build/data-fetching/lib/index.js.map +1 -1
  75. package/build/data-fetching/lib/isSdkError.js +6 -7
  76. package/build/data-fetching/lib/isSdkError.js.map +1 -1
  77. package/build/data-fetching/lib/isUuid.js +6 -7
  78. package/build/data-fetching/lib/isUuid.js.map +1 -1
  79. package/build/data-fetching/types.js +3 -1
  80. package/build/index.js +25 -103
  81. package/build/index.js.map +1 -1
  82. package/build/infinite-loading/index.js +23 -41
  83. package/build/infinite-loading/index.js.map +1 -1
  84. package/build/infinite-loading/types.js +3 -1
  85. package/build/infinite-loading/useInfiniteGalleriesLoading.js +35 -46
  86. package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
  87. package/build/infinite-loading/useInfiniteLoading.js +41 -54
  88. package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
  89. package/build/infinite-loading/useInfiniteStoriesLoading.js +48 -60
  90. package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
  91. package/build/intl/index.d.ts +1 -1
  92. package/build/intl/index.js +24 -47
  93. package/build/intl/index.js.map +1 -1
  94. package/build/intl/languages.js +110 -150
  95. package/build/intl/languages.js.map +1 -1
  96. package/build/intl/locale.d.ts +1 -0
  97. package/build/intl/locale.js +104 -58
  98. package/build/intl/locale.js.map +1 -1
  99. package/build/intl/localeConfig.d.ts +2 -3
  100. package/build/intl/localeConfig.js +13 -28
  101. package/build/intl/localeConfig.js.map +1 -1
  102. package/build/intl/localeList.d.ts +2 -4
  103. package/build/intl/localeList.js +108 -7
  104. package/build/intl/localeList.js.map +1 -1
  105. package/build/intl/localeObject.js +78 -83
  106. package/build/intl/localeObject.js.map +1 -1
  107. package/build/newsroom-context/context.js +24 -42
  108. package/build/newsroom-context/context.js.map +1 -1
  109. package/build/newsroom-context/hooks/index.js +27 -125
  110. package/build/newsroom-context/hooks/index.js.map +1 -1
  111. package/build/newsroom-context/hooks/useAlgoliaSettings.js +8 -9
  112. package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
  113. package/build/newsroom-context/hooks/useCategories.js +8 -9
  114. package/build/newsroom-context/hooks/useCategories.js.map +1 -1
  115. package/build/newsroom-context/hooks/useCompanyInformation.js +8 -9
  116. package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
  117. package/build/newsroom-context/hooks/useCurrentCategory.js +8 -9
  118. package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
  119. package/build/newsroom-context/hooks/useCurrentLocale.js +8 -9
  120. package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
  121. package/build/newsroom-context/hooks/useCurrentStory.js +8 -9
  122. package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
  123. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +19 -21
  124. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
  125. package/build/newsroom-context/hooks/useGetTranslationUrl.js +54 -56
  126. package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
  127. package/build/newsroom-context/hooks/useLanguages.js +8 -9
  128. package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
  129. package/build/newsroom-context/hooks/useNewsroom.js +8 -9
  130. package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
  131. package/build/newsroom-context/hooks/useNewsroomContext.js +14 -15
  132. package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
  133. package/build/newsroom-context/index.d.ts +1 -2
  134. package/build/newsroom-context/index.js +20 -32
  135. package/build/newsroom-context/index.js.map +1 -1
  136. package/build/sentry/client.js +7 -8
  137. package/build/sentry/client.js.map +1 -1
  138. package/build/sentry/common.js +27 -30
  139. package/build/sentry/common.js.map +1 -1
  140. package/build/sentry/index.js +7 -18
  141. package/build/sentry/index.js.map +1 -1
  142. package/build/sentry/server.js +7 -8
  143. package/build/sentry/server.js.map +1 -1
  144. package/build/tsconfig.tsbuildinfo +1 -0
  145. package/build/types.js +3 -1
  146. package/build/utils/boilerplate.js +18 -11
  147. package/build/utils/boilerplate.js.map +1 -1
  148. package/build/utils/constants.js +6 -11
  149. package/build/utils/constants.js.map +1 -1
  150. package/build/utils/getAssetsUrl.js +7 -8
  151. package/build/utils/getAssetsUrl.js.map +1 -1
  152. package/build/utils/getDataRequestLink.js +10 -10
  153. package/build/utils/getDataRequestLink.js.map +1 -1
  154. package/build/utils/getLocalizedCategoryData.js +29 -37
  155. package/build/utils/getLocalizedCategoryData.js.map +1 -1
  156. package/build/utils/getNewsroomLogoUrl.js +18 -19
  157. package/build/utils/getNewsroomLogoUrl.js.map +1 -1
  158. package/build/utils/getPrivacyPortalUrl.js +11 -15
  159. package/build/utils/getPrivacyPortalUrl.js.map +1 -1
  160. package/build/utils/getStoryPublicationDate.js +12 -13
  161. package/build/utils/getStoryPublicationDate.js.map +1 -1
  162. package/build/utils/getUploadcareGroupUrl.js +8 -9
  163. package/build/utils/getUploadcareGroupUrl.js.map +1 -1
  164. package/build/utils/index.js +26 -114
  165. package/build/utils/index.js.map +1 -1
  166. package/build/utils/isEmbargoStory.js +6 -7
  167. package/build/utils/isEmbargoStory.js.map +1 -1
  168. package/package.json +12 -26
  169. package/src/@types/global.d.ts +7 -0
  170. package/src/__mocks__/languages.ts +416 -0
  171. package/src/__mocks__/story.ts +359 -0
  172. package/src/adapter-nextjs/api-handlers/fetchGalleries.ts +24 -0
  173. package/src/adapter-nextjs/api-handlers/fetchStories.ts +26 -0
  174. package/src/adapter-nextjs/api-handlers/index.ts +2 -0
  175. package/src/adapter-nextjs/getNewsroomServerSideProps.ts +29 -0
  176. package/src/adapter-nextjs/getNewsroomStaticProps.ts +29 -0
  177. package/src/adapter-nextjs/index.ts +6 -0
  178. package/src/adapter-nextjs/page-props/category.ts +157 -0
  179. package/src/adapter-nextjs/page-props/gallery.ts +114 -0
  180. package/src/adapter-nextjs/page-props/galleryAlbum.ts +89 -0
  181. package/src/adapter-nextjs/page-props/home.ts +113 -0
  182. package/src/adapter-nextjs/page-props/index.ts +26 -0
  183. package/src/adapter-nextjs/page-props/lib/types.ts +8 -0
  184. package/src/adapter-nextjs/page-props/search.ts +53 -0
  185. package/src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts +56 -0
  186. package/src/adapter-nextjs/page-props/sitemap/createPaths.ts +21 -0
  187. package/src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts +43 -0
  188. package/src/adapter-nextjs/page-props/sitemap/index.ts +5 -0
  189. package/src/adapter-nextjs/page-props/sitemap/types.ts +5 -0
  190. package/src/adapter-nextjs/page-props/story.ts +94 -0
  191. package/src/adapter-nextjs/page-props/storyPreview.ts +33 -0
  192. package/src/adapter-nextjs/processRequest.ts +49 -0
  193. package/src/adapter-nextjs/processStaticRequest.ts +32 -0
  194. package/src/components-nextjs/PageSeo/PageSeo.tsx +131 -0
  195. package/src/components-nextjs/PageSeo/index.ts +2 -0
  196. package/src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts +7 -0
  197. package/src/components-nextjs/PageSeo/lib/types.ts +4 -0
  198. package/src/components-nextjs/StorySeo/StorySeo.tsx +80 -0
  199. package/src/components-nextjs/StorySeo/index.ts +1 -0
  200. package/src/components-nextjs/document.tsx +38 -0
  201. package/src/components-nextjs/index.ts +3 -0
  202. package/src/data-fetching/api/PrezlyApi.ts +304 -0
  203. package/src/data-fetching/api/getPrezlyApi.ts +24 -0
  204. package/src/data-fetching/api/index.ts +1 -0
  205. package/src/data-fetching/api/queries.ts +51 -0
  206. package/src/data-fetching/index.ts +3 -0
  207. package/src/data-fetching/lib/getAlgoliaSettings.ts +29 -0
  208. package/src/data-fetching/lib/getEnvVariables.ts +46 -0
  209. package/src/data-fetching/lib/index.ts +4 -0
  210. package/src/data-fetching/lib/isSdkError.ts +5 -0
  211. package/src/data-fetching/lib/isUuid.ts +5 -0
  212. package/src/data-fetching/types.ts +14 -0
  213. package/src/index.ts +9 -0
  214. package/src/infinite-loading/index.ts +4 -0
  215. package/src/infinite-loading/types.ts +5 -0
  216. package/src/infinite-loading/useInfiniteGalleriesLoading.ts +53 -0
  217. package/src/infinite-loading/useInfiniteLoading.ts +66 -0
  218. package/src/infinite-loading/useInfiniteStoriesLoading.ts +81 -0
  219. package/src/intl/index.ts +4 -0
  220. package/src/intl/languages.test.ts +232 -0
  221. package/src/intl/languages.ts +233 -0
  222. package/src/intl/locale.test.ts +95 -0
  223. package/src/intl/locale.ts +140 -0
  224. package/src/intl/localeConfig.js +23 -0
  225. package/src/intl/localeList.js +110 -0
  226. package/src/intl/localeObject.test.ts +81 -0
  227. package/src/intl/localeObject.ts +99 -0
  228. package/src/newsroom-context/context.tsx +115 -0
  229. package/src/newsroom-context/hooks/index.ts +11 -0
  230. package/src/newsroom-context/hooks/useAlgoliaSettings.ts +7 -0
  231. package/src/newsroom-context/hooks/useCategories.ts +7 -0
  232. package/src/newsroom-context/hooks/useCompanyInformation.ts +7 -0
  233. package/src/newsroom-context/hooks/useCurrentCategory.ts +7 -0
  234. package/src/newsroom-context/hooks/useCurrentLocale.ts +7 -0
  235. package/src/newsroom-context/hooks/useCurrentStory.ts +7 -0
  236. package/src/newsroom-context/hooks/useGetLinkLocaleSlug.ts +37 -0
  237. package/src/newsroom-context/hooks/useGetTranslationUrl.ts +97 -0
  238. package/src/newsroom-context/hooks/useLanguages.ts +7 -0
  239. package/src/newsroom-context/hooks/useNewsroom.ts +7 -0
  240. package/src/newsroom-context/hooks/useNewsroomContext.ts +15 -0
  241. package/src/newsroom-context/index.ts +2 -0
  242. package/src/sentry/client.ts +7 -0
  243. package/src/sentry/common.ts +27 -0
  244. package/src/sentry/index.ts +2 -0
  245. package/src/sentry/server.ts +7 -0
  246. package/src/types.ts +51 -0
  247. package/src/utils/boilerplate.ts +27 -0
  248. package/src/utils/constants.ts +3 -0
  249. package/src/utils/getAssetsUrl.test.ts +9 -0
  250. package/src/utils/getAssetsUrl.ts +9 -0
  251. package/src/utils/getDataRequestLink.ts +14 -0
  252. package/src/utils/getLocalizedCategoryData.ts +47 -0
  253. package/src/utils/getNewsroomLogoUrl.ts +22 -0
  254. package/src/utils/getPrivacyPortalUrl.ts +25 -0
  255. package/src/utils/getStoryPublicationDate.tsx +15 -0
  256. package/src/utils/getUploadcareGroupUrl.ts +13 -0
  257. package/src/utils/index.ts +10 -0
  258. package/src/utils/isEmbargoStory.ts +10 -0
  259. package/build/@types/global.d.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"getNewsroomLogoUrl.js","sourceRoot":"","sources":["../../src/utils/getNewsroomLogoUrl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,UAAU,kBAAkB,CAAC,QAAkB;IACjD,IAAI,QAAQ,CAAC,aAAa,EAAE;QACxB,MAAM,KAAK,GAAG,eAAe,CAAC,8BAA8B,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACrF,OAAO,KAAK,CAAC,MAAM,CAAC;KACvB;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,QAAkB,EAAE,WAAW,GAAG,GAAG;IACvE,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC;IAE1D,IAAI,WAAW,EAAE;QACb,MAAM,KAAK,GAAG,eAAe,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC;QAC1E,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC;KACzD;IAED,OAAO,EAAE,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"getNewsroomLogoUrl.js","sourceRoot":"","sources":["../../src/utils/getNewsroomLogoUrl.ts"],"names":[],"mappings":";;;AACA,mDAAqD;AAErD,SAAgB,kBAAkB,CAAC,QAAkB;IACjD,IAAI,QAAQ,CAAC,aAAa,EAAE;QACxB,MAAM,KAAK,GAAG,4BAAe,CAAC,8BAA8B,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QACrF,OAAO,KAAK,CAAC,MAAM,CAAC;KACvB;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAPD,gDAOC;AAED,SAAgB,qBAAqB,CAAC,QAAkB,EAAE,WAAW,GAAG,GAAG;IACvE,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC;IAE1D,IAAI,WAAW,EAAE;QACb,MAAM,KAAK,GAAG,4BAAe,CAAC,8BAA8B,CAAC,WAAW,CAAC,CAAC;QAC1E,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,MAAM,CAAC;KACzD;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AATD,sDASC"}
@@ -1,17 +1,13 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getPrivacyPortalUrl = getPrivacyPortalUrl;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getPrivacyPortalUrl = void 0;
7
4
  function getPrivacyPortalUrl(newsroom, locale, options) {
8
- const {
9
- email,
10
- action = 'subscribe'
11
- } = options || {};
12
- const url = new URL(`/${locale.toUrlSlug()}/newsroom/${newsroom.uuid}/${action}`, 'https://privacy.prezly.com');
13
- if (email) {
14
- url.searchParams.append('email', email);
15
- }
16
- return url.toString();
17
- }
5
+ const { email, action = 'subscribe' } = options || {};
6
+ const url = new URL(`/${locale.toUrlSlug()}/newsroom/${newsroom.uuid}/${action}`, 'https://privacy.prezly.com');
7
+ if (email) {
8
+ url.searchParams.append('email', email);
9
+ }
10
+ return url.toString();
11
+ }
12
+ exports.getPrivacyPortalUrl = getPrivacyPortalUrl;
13
+ //# sourceMappingURL=getPrivacyPortalUrl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPrivacyPortalUrl.js","sourceRoot":"","sources":["../../src/utils/getPrivacyPortalUrl.ts"],"names":[],"mappings":"AASA,MAAM,UAAU,mBAAmB,CAC/B,QAAkB,EAClB,MAAoB,EACpB,OAAiC;IAEjC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAEtD,MAAM,GAAG,GAAG,IAAI,GAAG,CACf,IAAI,MAAM,CAAC,SAAS,EAAE,aAAa,QAAQ,CAAC,IAAI,IAAI,MAAM,EAAE,EAC5D,4BAA4B,CAC/B,CAAC;IACF,IAAI,KAAK,EAAE;QACP,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAC3C;IACD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC"}
1
+ {"version":3,"file":"getPrivacyPortalUrl.js","sourceRoot":"","sources":["../../src/utils/getPrivacyPortalUrl.ts"],"names":[],"mappings":";;;AASA,SAAgB,mBAAmB,CAC/B,QAAkB,EAClB,MAAoB,EACpB,OAAiC;IAEjC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAEtD,MAAM,GAAG,GAAG,IAAI,GAAG,CACf,IAAI,MAAM,CAAC,SAAS,EAAE,aAAa,QAAQ,CAAC,IAAI,IAAI,MAAM,EAAE,EAC5D,4BAA4B,CAC/B,CAAC;IACF,IAAI,KAAK,EAAE;QACP,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAC3C;IACD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AAfD,kDAeC"}
@@ -1,15 +1,14 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getStoryPublicationDate = getStoryPublicationDate;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getStoryPublicationDate = void 0;
7
4
  function getStoryPublicationDate(story) {
8
- const {
9
- published_at
10
- } = story;
11
- if (!published_at) {
12
- return null;
13
- }
14
- return typeof published_at === 'string' ? new Date(published_at) : new Date(published_at * 1000);
15
- }
5
+ const { published_at } = story;
6
+ if (!published_at) {
7
+ return null;
8
+ }
9
+ return typeof published_at === 'string'
10
+ ? new Date(published_at)
11
+ : new Date(published_at * 1000);
12
+ }
13
+ exports.getStoryPublicationDate = getStoryPublicationDate;
14
+ //# sourceMappingURL=getStoryPublicationDate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getStoryPublicationDate.js","sourceRoot":"","sources":["../../src/utils/getStoryPublicationDate.tsx"],"names":[],"mappings":"AAIA,MAAM,UAAU,uBAAuB,CAAC,KAA2B;IAC/D,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/B,IAAI,CAAC,YAAY,EAAE;QACf,OAAO,IAAI,CAAC;KACf;IAED,OAAO,OAAO,YAAY,KAAK,QAAQ;QACnC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC;QACxB,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AACxC,CAAC"}
1
+ {"version":3,"file":"getStoryPublicationDate.js","sourceRoot":"","sources":["../../src/utils/getStoryPublicationDate.tsx"],"names":[],"mappings":";;;AAIA,SAAgB,uBAAuB,CAAC,KAA2B;IAC/D,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/B,IAAI,CAAC,YAAY,EAAE;QACf,OAAO,IAAI,CAAC;KACf;IAED,OAAO,OAAO,YAAY,KAAK,QAAQ;QACnC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC;QACxB,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AACxC,CAAC;AAVD,0DAUC"}
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getUploadcareGroupUrl = getUploadcareGroupUrl;
7
- var _constants = require("./constants.js");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getUploadcareGroupUrl = void 0;
4
+ const constants_1 = require("./constants");
8
5
  /**
9
6
  * This method constructs a URL to download all images in the Gallery as a single archive.
10
7
  *
@@ -13,6 +10,8 @@ var _constants = require("./constants.js");
13
10
  * @returns URL to an archive containing all of the images in the Gallery.
14
11
  */
15
12
  function getUploadcareGroupUrl(uuid, title) {
16
- // UploadCare doesn't like slashes in filenames even in encoded form.
17
- return `${_constants.ASSETS_URL}/${uuid}/archive/zip/${encodeURIComponent(title.replace(/\//g, '_'))}.zip`;
18
- }
13
+ // UploadCare doesn't like slashes in filenames even in encoded form.
14
+ return `${constants_1.ASSETS_URL}/${uuid}/archive/zip/${encodeURIComponent(title.replace(/\//g, '_'))}.zip`;
15
+ }
16
+ exports.getUploadcareGroupUrl = getUploadcareGroupUrl;
17
+ //# sourceMappingURL=getUploadcareGroupUrl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getUploadcareGroupUrl.js","sourceRoot":"","sources":["../../src/utils/getUploadcareGroupUrl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY,EAAE,KAAa;IAC7D,qEAAqE;IACrE,OAAO,GAAG,UAAU,IAAI,IAAI,gBAAgB,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;AACpG,CAAC"}
1
+ {"version":3,"file":"getUploadcareGroupUrl.js","sourceRoot":"","sources":["../../src/utils/getUploadcareGroupUrl.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAEzC;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,IAAY,EAAE,KAAa;IAC7D,qEAAqE;IACrE,OAAO,GAAG,sBAAU,IAAI,IAAI,gBAAgB,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;AACpG,CAAC;AAHD,sDAGC"}
@@ -1,115 +1,27 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _boilerplate = require("./boilerplate.js");
7
- Object.keys(_boilerplate).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _boilerplate[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _boilerplate[key];
14
- }
15
- });
16
- });
17
- var _constants = require("./constants.js");
18
- Object.keys(_constants).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _constants[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _constants[key];
25
- }
26
- });
27
- });
28
- var _getAssetsUrl = require("./getAssetsUrl.js");
29
- Object.keys(_getAssetsUrl).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _getAssetsUrl[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _getAssetsUrl[key];
36
- }
37
- });
38
- });
39
- var _getDataRequestLink = require("./getDataRequestLink.js");
40
- Object.keys(_getDataRequestLink).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _getDataRequestLink[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _getDataRequestLink[key];
47
- }
48
- });
49
- });
50
- var _getLocalizedCategoryData = require("./getLocalizedCategoryData.js");
51
- Object.keys(_getLocalizedCategoryData).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _getLocalizedCategoryData[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _getLocalizedCategoryData[key];
58
- }
59
- });
60
- });
61
- var _getNewsroomLogoUrl = require("./getNewsroomLogoUrl.js");
62
- Object.keys(_getNewsroomLogoUrl).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _getNewsroomLogoUrl[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _getNewsroomLogoUrl[key];
69
- }
70
- });
71
- });
72
- var _getPrivacyPortalUrl = require("./getPrivacyPortalUrl.js");
73
- Object.keys(_getPrivacyPortalUrl).forEach(function (key) {
74
- if (key === "default" || key === "__esModule") return;
75
- if (key in exports && exports[key] === _getPrivacyPortalUrl[key]) return;
76
- Object.defineProperty(exports, key, {
77
- enumerable: true,
78
- get: function () {
79
- return _getPrivacyPortalUrl[key];
80
- }
81
- });
82
- });
83
- var _getStoryPublicationDate = require("./getStoryPublicationDate.js");
84
- Object.keys(_getStoryPublicationDate).forEach(function (key) {
85
- if (key === "default" || key === "__esModule") return;
86
- if (key in exports && exports[key] === _getStoryPublicationDate[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function () {
90
- return _getStoryPublicationDate[key];
91
- }
92
- });
93
- });
94
- var _getUploadcareGroupUrl = require("./getUploadcareGroupUrl.js");
95
- Object.keys(_getUploadcareGroupUrl).forEach(function (key) {
96
- if (key === "default" || key === "__esModule") return;
97
- if (key in exports && exports[key] === _getUploadcareGroupUrl[key]) return;
98
- Object.defineProperty(exports, key, {
99
- enumerable: true,
100
- get: function () {
101
- return _getUploadcareGroupUrl[key];
102
- }
103
- });
104
- });
105
- var _isEmbargoStory = require("./isEmbargoStory.js");
106
- Object.keys(_isEmbargoStory).forEach(function (key) {
107
- if (key === "default" || key === "__esModule") return;
108
- if (key in exports && exports[key] === _isEmbargoStory[key]) return;
109
- Object.defineProperty(exports, key, {
110
- enumerable: true,
111
- get: function () {
112
- return _isEmbargoStory[key];
113
- }
114
- });
115
- });
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
+ __exportStar(require("./boilerplate"), exports);
18
+ __exportStar(require("./constants"), exports);
19
+ __exportStar(require("./getAssetsUrl"), exports);
20
+ __exportStar(require("./getDataRequestLink"), exports);
21
+ __exportStar(require("./getLocalizedCategoryData"), exports);
22
+ __exportStar(require("./getNewsroomLogoUrl"), exports);
23
+ __exportStar(require("./getPrivacyPortalUrl"), exports);
24
+ __exportStar(require("./getStoryPublicationDate"), exports);
25
+ __exportStar(require("./getUploadcareGroupUrl"), exports);
26
+ __exportStar(require("./isEmbargoStory"), exports);
27
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,uDAAqC;AACrC,6DAA2C;AAC3C,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,0DAAwC;AACxC,mDAAiC"}
@@ -1,9 +1,8 @@
1
1
  "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isEmbargoStory = isEmbargoStory;
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEmbargoStory = void 0;
7
4
  function isEmbargoStory(story) {
8
- return story.is_embargo && Boolean(story.published_at);
9
- }
5
+ return story.is_embargo && Boolean(story.published_at);
6
+ }
7
+ exports.isEmbargoStory = isEmbargoStory;
8
+ //# sourceMappingURL=isEmbargoStory.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"isEmbargoStory.js","sourceRoot":"","sources":["../../src/utils/isEmbargoStory.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,cAAc,CAAC,KAAY;IACvC,OAAO,KAAK,CAAC,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAC3D,CAAC"}
1
+ {"version":3,"file":"isEmbargoStory.js","sourceRoot":"","sources":["../../src/utils/isEmbargoStory.ts"],"names":[],"mappings":";;;AAOA,SAAgB,cAAc,CAAC,KAAY;IACvC,OAAO,KAAK,CAAC,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAC3D,CAAC;AAFD,wCAEC"}
package/package.json CHANGED
@@ -1,18 +1,12 @@
1
1
  {
2
2
  "name": "@prezly/theme-kit-nextjs",
3
- "version": "2.0.1-1",
3
+ "version": "2.1.0",
4
4
  "description": "Data layer and utility library for developing Prezly themes with NextJS",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
7
- "exports": {
8
- ".": {
9
- "types": "./build/index.d.ts",
10
- "import": "./build/index.js"
11
- },
12
- "./localeConfig": "./build/intl/localeConfig.js"
13
- },
14
7
  "files": [
15
- "build"
8
+ "build",
9
+ "src"
16
10
  ],
17
11
  "engines": {
18
12
  "node": ">= 16.x",
@@ -35,10 +29,7 @@
35
29
  "homepage": "https://github.com/prezly/theme-kit-nextjs#readme",
36
30
  "scripts": {
37
31
  "clean": "rimraf build/ node_modules/",
38
- "prebuild": "rimraf build/",
39
- "build": "npm run build:types && npm run build:es",
40
- "build:types": "tsc --project .",
41
- "build:es": "babel ./src --ignore='**/*.test.ts','**/__mocks__/**' --config-file=./babel.config.json --extensions=.ts,.tsx --source-root=./src --out-dir=./build",
32
+ "build": "tsc --project .",
42
33
  "watch": "tsc --watch --preserveWatchOutput --project .",
43
34
  "test": "jest",
44
35
  "typecheck": "tsc --noEmit --incremental --project .",
@@ -57,32 +48,27 @@
57
48
  "react-dom": "^17.x || ^18.x"
58
49
  },
59
50
  "dependencies": {
60
- "@prezly/sdk": "^10.0.0",
51
+ "@prezly/sdk": "^11.9.0",
61
52
  "@prezly/uploadcare": "^2.3.4",
62
53
  "@react-hookz/web": "^16.0.0",
63
54
  "next-seo": "^5.4.0",
64
55
  "parse-data-url": "^4.0.1"
65
56
  },
66
57
  "devDependencies": {
67
- "@babel/cli": "7.19.3",
68
- "@babel/preset-env": "7.20.2",
69
- "@babel/preset-react": "7.18.6",
70
- "@babel/preset-typescript": "7.18.6",
71
- "@prezly/eslint-config": "4.2.0",
72
- "@sentry/nextjs": "7.20.0",
73
- "@types/jest": "29.2.3",
58
+ "@prezly/eslint-config": "4.3.2",
59
+ "@sentry/nextjs": "7.24.2",
60
+ "@types/jest": "29.2.4",
74
61
  "@types/node": "17.0.14",
75
62
  "@types/parse-data-url": "3.0.0",
76
- "@types/react": "18.0.25",
63
+ "@types/react": "18.0.26",
77
64
  "@types/react-dom": "18.0.9",
78
- "babel-plugin-add-import-extension": "1.6.0",
79
- "eslint": "8.28.0",
65
+ "eslint": "8.29.0",
80
66
  "jest": "29.3.1",
81
67
  "np": "7.6.2",
82
- "prettier": "2.7.1",
68
+ "prettier": "2.8.1",
83
69
  "rimraf": "3.0.2",
84
70
  "ts-jest": "29.0.3",
85
- "typescript": "4.9.3"
71
+ "typescript": "4.9.4"
86
72
  },
87
73
  "publishConfig": {
88
74
  "access": "public"
@@ -0,0 +1,7 @@
1
+ import type { PrezlyEnv } from '../data-fetching';
2
+
3
+ declare global {
4
+ export namespace NodeJS {
5
+ export interface ProcessEnv extends PrezlyEnv {}
6
+ }
7
+ }