@prezly/theme-kit-nextjs 3.3.2-alpha.0 → 4.0.0-alpha.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 (217) hide show
  1. package/README.md +5 -4
  2. package/build/adapter-nextjs/api-handlers/fetchGalleries.js +1 -1
  3. package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
  4. package/build/adapter-nextjs/api-handlers/fetchStories.js +1 -1
  5. package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
  6. package/build/adapter-nextjs/getNewsroomServerSideProps.d.ts +1 -1
  7. package/build/adapter-nextjs/getNewsroomServerSideProps.js +1 -1
  8. package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
  9. package/build/adapter-nextjs/getNewsroomStaticProps.d.ts +1 -1
  10. package/build/adapter-nextjs/getNewsroomStaticProps.js +1 -1
  11. package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
  12. package/build/adapter-nextjs/page-props/category.js +6 -7
  13. package/build/adapter-nextjs/page-props/category.js.map +1 -1
  14. package/build/adapter-nextjs/page-props/gallery.js +3 -3
  15. package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
  16. package/build/adapter-nextjs/page-props/galleryAlbum.js +1 -1
  17. package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
  18. package/build/adapter-nextjs/page-props/home.js +3 -3
  19. package/build/adapter-nextjs/page-props/home.js.map +1 -1
  20. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +1 -1
  21. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
  22. package/build/adapter-nextjs/page-props/story.js +3 -3
  23. package/build/adapter-nextjs/page-props/story.js.map +1 -1
  24. package/build/adapter-nextjs/page-props/storyPreview.js +1 -1
  25. package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
  26. package/build/adapter-nextjs/processRequest.js +3 -2
  27. package/build/adapter-nextjs/processRequest.js.map +1 -1
  28. package/build/components-nextjs/PageSeo/PageSeo.js +13 -20
  29. package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
  30. package/build/components-nextjs/PageSeo/index.d.ts +0 -1
  31. package/build/components-nextjs/PageSeo/index.js +0 -15
  32. package/build/components-nextjs/PageSeo/index.js.map +1 -1
  33. package/build/components-nextjs/PageSeo/lib/index.d.ts +1 -0
  34. package/build/components-nextjs/PageSeo/lib/index.js +6 -0
  35. package/build/components-nextjs/PageSeo/lib/index.js.map +1 -0
  36. package/build/components-nextjs/document.js +4 -4
  37. package/build/components-nextjs/document.js.map +1 -1
  38. package/build/data-fetching/NextPrezlyApi.d.ts +8 -0
  39. package/build/data-fetching/NextPrezlyApi.js +40 -0
  40. package/build/data-fetching/NextPrezlyApi.js.map +1 -0
  41. package/build/data-fetching/getNextPrezlyApi.d.ts +4 -0
  42. package/build/data-fetching/getNextPrezlyApi.js +21 -0
  43. package/build/data-fetching/getNextPrezlyApi.js.map +1 -0
  44. package/build/data-fetching/index.d.ts +1 -3
  45. package/build/data-fetching/index.js +3 -17
  46. package/build/data-fetching/index.js.map +1 -1
  47. package/build/index.d.ts +0 -2
  48. package/build/index.js +0 -2
  49. package/build/index.js.map +1 -1
  50. package/build/infinite-loading/useInfiniteLoading.js +1 -1
  51. package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
  52. package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
  53. package/build/intl/index.d.ts +0 -2
  54. package/build/intl/index.js +0 -7
  55. package/build/intl/index.js.map +1 -1
  56. package/build/intl/languages.d.ts +1 -44
  57. package/build/intl/languages.js +8 -151
  58. package/build/intl/languages.js.map +1 -1
  59. package/build/intl/locale.d.ts +0 -8
  60. package/build/intl/locale.js +3 -93
  61. package/build/intl/locale.js.map +1 -1
  62. package/build/newsroom-context/context.d.ts +2 -2
  63. package/build/newsroom-context/context.js +2 -2
  64. package/build/newsroom-context/context.js.map +1 -1
  65. package/build/newsroom-context/hooks/useAlgoliaSettings.d.ts +1 -1
  66. package/build/newsroom-context/hooks/useCurrentLocale.d.ts +1 -1
  67. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.d.ts +1 -1
  68. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +3 -3
  69. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
  70. package/build/newsroom-context/hooks/useGetTranslationUrl.d.ts +1 -1
  71. package/build/newsroom-context/hooks/useGetTranslationUrl.js +3 -3
  72. package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
  73. package/build/types.d.ts +0 -29
  74. package/package.json +15 -13
  75. package/src/adapter-nextjs/api-handlers/fetchGalleries.ts +2 -2
  76. package/src/adapter-nextjs/api-handlers/fetchStories.ts +2 -2
  77. package/src/adapter-nextjs/getNewsroomServerSideProps.ts +2 -2
  78. package/src/adapter-nextjs/getNewsroomStaticProps.ts +2 -2
  79. package/src/adapter-nextjs/page-props/category.ts +3 -4
  80. package/src/adapter-nextjs/page-props/gallery.ts +1 -1
  81. package/src/adapter-nextjs/page-props/galleryAlbum.ts +2 -2
  82. package/src/adapter-nextjs/page-props/home.ts +1 -1
  83. package/src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts +2 -2
  84. package/src/adapter-nextjs/page-props/story.ts +4 -4
  85. package/src/adapter-nextjs/page-props/storyPreview.ts +2 -2
  86. package/src/adapter-nextjs/processRequest.ts +2 -1
  87. package/src/components-nextjs/PageSeo/PageSeo.tsx +7 -5
  88. package/src/components-nextjs/PageSeo/index.ts +0 -1
  89. package/src/components-nextjs/PageSeo/lib/index.ts +1 -0
  90. package/src/components-nextjs/document.tsx +1 -1
  91. package/src/data-fetching/NextPrezlyApi.ts +57 -0
  92. package/src/data-fetching/{api/getPrezlyApi.ts → getNextPrezlyApi.ts} +5 -6
  93. package/src/data-fetching/index.ts +1 -3
  94. package/src/index.ts +0 -2
  95. package/src/infinite-loading/useInfiniteStoriesLoading.ts +1 -1
  96. package/src/intl/index.ts +0 -3
  97. package/src/intl/languages.test.ts +1 -196
  98. package/src/intl/languages.ts +8 -201
  99. package/src/intl/locale.test.ts +1 -55
  100. package/src/intl/locale.ts +1 -106
  101. package/src/newsroom-context/context.tsx +2 -3
  102. package/src/newsroom-context/hooks/useGetLinkLocaleSlug.ts +1 -2
  103. package/src/newsroom-context/hooks/useGetTranslationUrl.ts +2 -3
  104. package/src/types.ts +0 -35
  105. package/build/components-nextjs/PageSeo/lib/types.d.ts +0 -4
  106. package/build/components-nextjs/PageSeo/lib/types.js +0 -3
  107. package/build/components-nextjs/PageSeo/lib/types.js.map +0 -1
  108. package/build/data-fetching/api/PrezlyApi.d.ts +0 -57
  109. package/build/data-fetching/api/PrezlyApi.js +0 -200
  110. package/build/data-fetching/api/PrezlyApi.js.map +0 -1
  111. package/build/data-fetching/api/getPrezlyApi.d.ts +0 -4
  112. package/build/data-fetching/api/getPrezlyApi.js +0 -21
  113. package/build/data-fetching/api/getPrezlyApi.js.map +0 -1
  114. package/build/data-fetching/api/index.d.ts +0 -1
  115. package/build/data-fetching/api/index.js +0 -18
  116. package/build/data-fetching/api/index.js.map +0 -1
  117. package/build/data-fetching/api/lib.d.ts +0 -11
  118. package/build/data-fetching/api/lib.js +0 -20
  119. package/build/data-fetching/api/lib.js.map +0 -1
  120. package/build/data-fetching/api/queries.d.ts +0 -46
  121. package/build/data-fetching/api/queries.js +0 -56
  122. package/build/data-fetching/api/queries.js.map +0 -1
  123. package/build/data-fetching/lib/getAlgoliaSettings.d.ts +0 -4
  124. package/build/data-fetching/lib/getAlgoliaSettings.js +0 -22
  125. package/build/data-fetching/lib/getAlgoliaSettings.js.map +0 -1
  126. package/build/data-fetching/lib/getEnvVariables.d.ts +0 -4
  127. package/build/data-fetching/lib/getEnvVariables.js +0 -44
  128. package/build/data-fetching/lib/getEnvVariables.js.map +0 -1
  129. package/build/data-fetching/lib/index.d.ts +0 -4
  130. package/build/data-fetching/lib/index.js +0 -12
  131. package/build/data-fetching/lib/index.js.map +0 -1
  132. package/build/data-fetching/lib/isSdkError.d.ts +0 -2
  133. package/build/data-fetching/lib/isSdkError.js +0 -8
  134. package/build/data-fetching/lib/isSdkError.js.map +0 -1
  135. package/build/data-fetching/lib/isUuid.d.ts +0 -1
  136. package/build/data-fetching/lib/isUuid.js +0 -9
  137. package/build/data-fetching/lib/isUuid.js.map +0 -1
  138. package/build/data-fetching/types.d.ts +0 -13
  139. package/build/data-fetching/types.js +0 -3
  140. package/build/data-fetching/types.js.map +0 -1
  141. package/build/intl/localeConfig.d.ts +0 -2
  142. package/build/intl/localeConfig.js +0 -20
  143. package/build/intl/localeConfig.js.map +0 -1
  144. package/build/intl/localeList.d.ts +0 -2
  145. package/build/intl/localeList.js +0 -112
  146. package/build/intl/localeList.js.map +0 -1
  147. package/build/intl/localeObject.d.ts +0 -45
  148. package/build/intl/localeObject.js +0 -91
  149. package/build/intl/localeObject.js.map +0 -1
  150. package/build/utils/boilerplate.d.ts +0 -4
  151. package/build/utils/boilerplate.js +0 -27
  152. package/build/utils/boilerplate.js.map +0 -1
  153. package/build/utils/constants.d.ts +0 -3
  154. package/build/utils/constants.js +0 -7
  155. package/build/utils/constants.js.map +0 -1
  156. package/build/utils/getAssetsUrl.d.ts +0 -5
  157. package/build/utils/getAssetsUrl.js +0 -13
  158. package/build/utils/getAssetsUrl.js.map +0 -1
  159. package/build/utils/getDataRequestLink.d.ts +0 -3
  160. package/build/utils/getDataRequestLink.js +0 -12
  161. package/build/utils/getDataRequestLink.js.map +0 -1
  162. package/build/utils/getLocalizedCategoryData.d.ts +0 -10
  163. package/build/utils/getLocalizedCategoryData.js +0 -37
  164. package/build/utils/getLocalizedCategoryData.js.map +0 -1
  165. package/build/utils/getNewsroomLogoUrl.d.ts +0 -3
  166. package/build/utils/getNewsroomLogoUrl.js +0 -22
  167. package/build/utils/getNewsroomLogoUrl.js.map +0 -1
  168. package/build/utils/getPrivacyPortalUrl.d.ts +0 -8
  169. package/build/utils/getPrivacyPortalUrl.js +0 -13
  170. package/build/utils/getPrivacyPortalUrl.js.map +0 -1
  171. package/build/utils/getStoryPublicationDate.d.ts +0 -3
  172. package/build/utils/getStoryPublicationDate.js +0 -14
  173. package/build/utils/getStoryPublicationDate.js.map +0 -1
  174. package/build/utils/getUploadcareGroupUrl.d.ts +0 -8
  175. package/build/utils/getUploadcareGroupUrl.js +0 -17
  176. package/build/utils/getUploadcareGroupUrl.js.map +0 -1
  177. package/build/utils/index.d.ts +0 -10
  178. package/build/utils/index.js +0 -27
  179. package/build/utils/index.js.map +0 -1
  180. package/build/utils/isEmbargoStory.d.ts +0 -6
  181. package/build/utils/isEmbargoStory.js +0 -8
  182. package/build/utils/isEmbargoStory.js.map +0 -1
  183. package/src/@types/global.d.ts +0 -7
  184. package/src/__mocks__/story.ts +0 -359
  185. package/src/components-nextjs/PageSeo/lib/types.ts +0 -4
  186. package/src/data-fetching/api/PrezlyApi.ts +0 -312
  187. package/src/data-fetching/api/index.ts +0 -1
  188. package/src/data-fetching/api/lib.ts +0 -24
  189. package/src/data-fetching/api/queries.ts +0 -59
  190. package/src/data-fetching/lib/getAlgoliaSettings.ts +0 -29
  191. package/src/data-fetching/lib/getEnvVariables.ts +0 -46
  192. package/src/data-fetching/lib/index.ts +0 -4
  193. package/src/data-fetching/lib/isSdkError.ts +0 -5
  194. package/src/data-fetching/lib/isUuid.ts +0 -5
  195. package/src/data-fetching/types.ts +0 -14
  196. package/src/intl/getFallbackLocale.ts +0 -29
  197. package/src/intl/localeConfig.js +0 -23
  198. package/src/intl/localeList.js +0 -110
  199. package/src/intl/localeObject.test.ts +0 -81
  200. package/src/intl/localeObject.ts +0 -107
  201. package/src/seo/getAlternateLanguageLinks.test.ts +0 -166
  202. package/src/seo/getAlternateLanguageLinks.ts +0 -115
  203. package/src/seo/index.ts +0 -1
  204. package/src/seo/utils/bindLanguagesWithLocales.ts +0 -31
  205. package/src/seo/utils/createAlternateLanguageLink.ts +0 -17
  206. package/src/utils/boilerplate.ts +0 -30
  207. package/src/utils/constants.ts +0 -3
  208. package/src/utils/getAssetsUrl.test.ts +0 -9
  209. package/src/utils/getAssetsUrl.ts +0 -9
  210. package/src/utils/getDataRequestLink.ts +0 -14
  211. package/src/utils/getLocalizedCategoryData.ts +0 -47
  212. package/src/utils/getNewsroomLogoUrl.ts +0 -22
  213. package/src/utils/getPrivacyPortalUrl.ts +0 -25
  214. package/src/utils/getStoryPublicationDate.tsx +0 -15
  215. package/src/utils/getUploadcareGroupUrl.ts +0 -13
  216. package/src/utils/index.ts +0 -10
  217. package/src/utils/isEmbargoStory.ts +0 -10
@@ -1,13 +0,0 @@
1
- export interface AlgoliaSettings {
2
- ALGOLIA_API_KEY: string;
3
- ALGOLIA_APP_ID: string;
4
- ALGOLIA_INDEX: string;
5
- }
6
- export interface PrezlyNewsroomEnv {
7
- PREZLY_ACCESS_TOKEN: string;
8
- PREZLY_NEWSROOM_UUID: string;
9
- PREZLY_THEME_UUID?: string;
10
- PREZLY_MODE?: 'preview';
11
- }
12
- export interface PrezlyEnv extends PrezlyNewsroomEnv, AlgoliaSettings {
13
- }
@@ -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/data-fetching/types.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export = lowercaseLocalPermutations;
2
- declare const lowercaseLocalPermutations: string[];
@@ -1,20 +0,0 @@
1
- "use strict";
2
- /**
3
- * This list is pulled from the main Prezly application. The underscores are replaced with dashes.
4
- * Together with permutation performed lower in the code,
5
- * the exported list represents all of the possible locale codes that Next.js theme application might accept.
6
- */
7
- const supportedLocales = require('./localeList');
8
- const lowercaseLocales = supportedLocales.map((l) => l.toLowerCase());
9
- // Get all permutations for the shorter locale codes supported by Prezly (e.g. short region codes and neutral language codes)
10
- const lowercaseLocalPermutations = Array.from(new Set([
11
- ...lowercaseLocales,
12
- ...lowercaseLocales.map((code) => code.split('-')[0]),
13
- ...lowercaseLocales
14
- .map((code) => code.split('-')[1])
15
- .filter(Boolean)
16
- // Remove number-only codes from possible permutations (like `419` for `es-419`)
17
- .filter((code) => Number.isNaN(Number(code))),
18
- ])).sort();
19
- module.exports = lowercaseLocalPermutations;
20
- //# sourceMappingURL=localeConfig.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localeConfig.js","sourceRoot":"","sources":["../../src/intl/localeConfig.js"],"names":[],"mappings":";AAAA;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;AAEjD,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEtE,6HAA6H;AAC7H,MAAM,0BAA0B,GAAG,KAAK,CAAC,IAAI,CACzC,IAAI,GAAG,CAAC;IACJ,GAAG,gBAAgB;IACnB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,GAAG,gBAAgB;SACd,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACjC,MAAM,CAAC,OAAO,CAAC;QAChB,gFAAgF;SAC/E,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;CACpD,CAAC,CACL,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,CAAC,OAAO,GAAG,0BAA0B,CAAC"}
@@ -1,2 +0,0 @@
1
- declare const _exports: string[];
2
- export = _exports;
@@ -1,112 +0,0 @@
1
- "use strict";
2
- /**
3
- * This list is pulled from the main Prezly application. The underscores are replaced with dashes.
4
- */
5
- module.exports = [
6
- 'af-ZA',
7
- 'ar',
8
- 'ar-AE',
9
- 'ar-BH',
10
- 'ar-QA',
11
- 'ar-SA',
12
- 'az',
13
- 'be',
14
- 'bg-BG',
15
- 'ca',
16
- 'cs-CZ',
17
- 'da-DK',
18
- 'de',
19
- 'de-DE',
20
- 'de-BE',
21
- 'de-AT',
22
- 'de-CH',
23
- 'el-GR',
24
- 'en',
25
- 'en-US',
26
- 'en-AE',
27
- 'en-AU',
28
- 'en-BD',
29
- 'en-BE',
30
- 'en-BH',
31
- 'en-CA',
32
- 'en-CN',
33
- 'en-DE',
34
- 'en-DK',
35
- 'en-GB',
36
- 'en-HK',
37
- 'en-ID',
38
- 'en-IE',
39
- 'en-IL',
40
- 'en-IN',
41
- 'en-JM',
42
- 'en-JP',
43
- 'en-KH',
44
- 'en-KR',
45
- 'en-LK',
46
- 'en-MV',
47
- 'en-MM',
48
- 'en-MY',
49
- 'en-NP',
50
- 'en-NZ',
51
- 'en-PH',
52
- 'en-PK',
53
- 'en-QA',
54
- 'en-SA',
55
- 'en-SG',
56
- 'en-TH',
57
- 'en-TW',
58
- 'en-VN',
59
- 'en-ZA',
60
- 'es',
61
- 'es-ES',
62
- 'es-MX',
63
- 'et-EE',
64
- 'es-419',
65
- 'fi-FI',
66
- 'fil',
67
- 'fr',
68
- 'fr-BE',
69
- 'fr-FR',
70
- 'fr-CA',
71
- 'fr-LU',
72
- 'ga-IE',
73
- 'he-IL',
74
- 'hi-IN',
75
- 'hr-HR',
76
- 'hu-HU',
77
- 'id-ID',
78
- 'it-IT',
79
- 'ja-JP',
80
- 'kk',
81
- 'ko-KR',
82
- 'ky',
83
- 'lt-LT',
84
- 'lv-LV',
85
- 'mt-MT',
86
- 'ms-MY',
87
- 'nb-NO',
88
- 'nl',
89
- 'nl-BE',
90
- 'nl-NL',
91
- 'pl-PL',
92
- 'pt',
93
- 'pt-BR',
94
- 'pt-PT',
95
- 'ro-RO',
96
- 'ru-RU',
97
- 'sk-SK',
98
- 'sl-SI',
99
- 'sv-SE',
100
- 'sw',
101
- 'th-TH',
102
- 'tr-TR',
103
- 'uk-UA',
104
- 'ur-PK',
105
- 'uz',
106
- 'vi-VN',
107
- 'zh-Hant',
108
- 'zh-HK',
109
- 'zh-TW',
110
- 'zh-CN',
111
- ];
112
- //# sourceMappingURL=localeList.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localeList.js","sourceRoot":"","sources":["../../src/intl/localeList.js"],"names":[],"mappings":";AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,GAAG;IACb,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,KAAK;IACL,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;CACV,CAAC"}
@@ -1,45 +0,0 @@
1
- /**
2
- * This class is created to simplify working with locales and transforming between different locale code formats.
3
- * Prezly API uses underscore-codes, while most frontend application tend to use hyphen-codes or slugs.
4
- * Note that `fromAnyCode` constructor only accepts locales supported by Prezly backend. See `localeConfig` for reference.
5
- */
6
- export declare class LocaleObject {
7
- /**
8
- * Hyphen-separated locale code.
9
- * Examples: `nl-BE`, `en-US`, `fr`, `fil`
10
- */
11
- private localeCode;
12
- private constructor();
13
- /**
14
- * @param localeCode Locale code in any of the formats below.
15
- * Examples:
16
- * - Hyphen-codes: `nl-BE`, `en-US`, `fr`, `fil`
17
- * - Underscore-codes: `nl_BE`, `en_US`, `fr`, `fil`
18
- * - Slugs: `nl-be`, `en-us`, `fr`, `fil`
19
- */
20
- static fromAnyCode(localeCode: string): LocaleObject;
21
- /**
22
- * @returns Code formatted into hyphen format: `nl-BE`, `en-US`, `fr`, `fil`
23
- */
24
- toHyphenCode(): string;
25
- /**
26
- * @returns Code formatted into underscore format, as expected by Prezly API: `nl_BE`, `en_US`, `fr`, `fil`
27
- */
28
- toUnderscoreCode(): string;
29
- /**
30
- * @returns Code formatted to a URL-friendly lowercase slug format: `nl-be`, `en-us`, `fr`, `fil`
31
- */
32
- toUrlSlug(): string;
33
- /**
34
- * @returns Only the language part of the code without culture/region part: `nl`, `en`, `fr`
35
- */
36
- toNeutralLanguageCode(): string;
37
- /**
38
- * @returns Only the culture/regtion part without the language part: `be`, `us`, `fr`
39
- */
40
- toRegionCode(): string;
41
- /**
42
- * Check if two LocaleObject instances are representing the same locale code.
43
- */
44
- isEqual(anotherLocale: LocaleObject): boolean;
45
- }
@@ -1,91 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LocaleObject = void 0;
7
- const localeConfig_1 = __importDefault(require("./localeConfig"));
8
- /**
9
- * This class is created to simplify working with locales and transforming between different locale code formats.
10
- * Prezly API uses underscore-codes, while most frontend application tend to use hyphen-codes or slugs.
11
- * Note that `fromAnyCode` constructor only accepts locales supported by Prezly backend. See `localeConfig` for reference.
12
- */
13
- class LocaleObject {
14
- /**
15
- * Hyphen-separated locale code.
16
- * Examples: `nl-BE`, `en-US`, `fr`, `fil`
17
- */
18
- localeCode;
19
- constructor(localeCode) {
20
- if (!/^([a-z]{2,3})(-[a-z\d]{1,4})?$/i.test(localeCode)) {
21
- throw new Error('Invalid locale code provided!');
22
- }
23
- const [language, region] = localeCode.split('-');
24
- if (region) {
25
- // Workaround for `zh-Hant` locale, which is the only locale with non-uppercase region part
26
- const regionSuffix = region === 'hant' ? 'Hant' : region.toUpperCase();
27
- this.localeCode = [language, regionSuffix].join('-');
28
- }
29
- else {
30
- this.localeCode = language;
31
- }
32
- }
33
- /**
34
- * @param localeCode Locale code in any of the formats below.
35
- * Examples:
36
- * - Hyphen-codes: `nl-BE`, `en-US`, `fr`, `fil`
37
- * - Underscore-codes: `nl_BE`, `en_US`, `fr`, `fil`
38
- * - Slugs: `nl-be`, `en-us`, `fr`, `fil`
39
- */
40
- static fromAnyCode(localeCode) {
41
- const lowercaseCode = localeCode.toLowerCase().replace('_', '-');
42
- const foundCode = localeConfig_1.default.find((code) => code === lowercaseCode);
43
- if (!foundCode) {
44
- throw new Error(`Unsupported locale code provided: "${lowercaseCode}"`);
45
- }
46
- return new LocaleObject(foundCode);
47
- }
48
- /**
49
- * @returns Code formatted into hyphen format: `nl-BE`, `en-US`, `fr`, `fil`
50
- */
51
- toHyphenCode() {
52
- return this.localeCode;
53
- }
54
- /**
55
- * @returns Code formatted into underscore format, as expected by Prezly API: `nl_BE`, `en_US`, `fr`, `fil`
56
- */
57
- toUnderscoreCode() {
58
- return this.localeCode.replace('-', '_');
59
- }
60
- /**
61
- * @returns Code formatted to a URL-friendly lowercase slug format: `nl-be`, `en-us`, `fr`, `fil`
62
- */
63
- toUrlSlug() {
64
- return this.localeCode.toLowerCase();
65
- }
66
- /**
67
- * @returns Only the language part of the code without culture/region part: `nl`, `en`, `fr`
68
- */
69
- toNeutralLanguageCode() {
70
- const [language] = this.localeCode.split('-');
71
- return language;
72
- }
73
- /**
74
- * @returns Only the culture/regtion part without the language part: `be`, `us`, `fr`
75
- */
76
- toRegionCode() {
77
- const [language, region] = this.localeCode.split('-');
78
- if (!region) {
79
- return language.toUpperCase();
80
- }
81
- return region.toUpperCase();
82
- }
83
- /**
84
- * Check if two LocaleObject instances are representing the same locale code.
85
- */
86
- isEqual(anotherLocale) {
87
- return anotherLocale.toHyphenCode() === this.localeCode;
88
- }
89
- }
90
- exports.LocaleObject = LocaleObject;
91
- //# sourceMappingURL=localeObject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"localeObject.js","sourceRoot":"","sources":["../../src/intl/localeObject.ts"],"names":[],"mappings":";;;;;;AAAA,kEAA0C;AAE1C;;;;GAIG;AACH,MAAa,YAAY;IACrB;;;OAGG;IACK,UAAU,CAAS;IAE3B,YAAoB,UAAkB;QAClC,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACrD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;SACpD;QAED,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjD,IAAI,MAAM,EAAE;YACR,2FAA2F;YAC3F,MAAM,YAAY,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YAEvE,IAAI,CAAC,UAAU,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACxD;aAAM;YACH,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;SAC9B;IACL,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,WAAW,CAAC,UAAkB;QACxC,MAAM,aAAa,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACjE,MAAM,SAAS,GAAG,sBAAY,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;QAEtE,IAAI,CAAC,SAAS,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,sCAAsC,aAAa,GAAG,CAAC,CAAC;SAC3E;QAED,OAAO,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,YAAY;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,gBAAgB;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,SAAS;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,qBAAqB;QACxB,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9C,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,YAAY;QACf,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEtD,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;SACjC;QAED,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,aAA2B;QACtC,OAAO,aAAa,CAAC,YAAY,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC;IAC5D,CAAC;CACJ;AA3FD,oCA2FC"}
@@ -1,4 +0,0 @@
1
- import type { NewsroomCompanyInformation } from '@prezly/sdk';
2
- export declare function hasAnySocialMedia(companyInformation: NewsroomCompanyInformation): boolean;
3
- export declare function hasAnyAboutInformation(companyInformation: NewsroomCompanyInformation): boolean;
4
- export declare function hasAnyContactInformation(companyInformation: NewsroomCompanyInformation): boolean;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.hasAnyContactInformation = exports.hasAnyAboutInformation = exports.hasAnySocialMedia = void 0;
4
- function hasAnySocialMedia(companyInformation) {
5
- return Boolean(companyInformation.facebook ||
6
- companyInformation.instagram ||
7
- companyInformation.linkedin ||
8
- companyInformation.pinterest ||
9
- companyInformation.tiktok ||
10
- companyInformation.twitter ||
11
- companyInformation.youtube);
12
- }
13
- exports.hasAnySocialMedia = hasAnySocialMedia;
14
- function hasAnyAboutInformation(companyInformation) {
15
- return Boolean(companyInformation.about ||
16
- companyInformation.website ||
17
- hasAnySocialMedia(companyInformation));
18
- }
19
- exports.hasAnyAboutInformation = hasAnyAboutInformation;
20
- function hasAnyContactInformation(companyInformation) {
21
- return Boolean(companyInformation.address ||
22
- companyInformation.phone ||
23
- companyInformation.email ||
24
- companyInformation.website);
25
- }
26
- exports.hasAnyContactInformation = hasAnyContactInformation;
27
- //# sourceMappingURL=boilerplate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"boilerplate.js","sourceRoot":"","sources":["../../src/utils/boilerplate.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,kBAA8C;IAC5E,OAAO,OAAO,CACV,kBAAkB,CAAC,QAAQ;QACvB,kBAAkB,CAAC,SAAS;QAC5B,kBAAkB,CAAC,QAAQ;QAC3B,kBAAkB,CAAC,SAAS;QAC5B,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,OAAO;QAC1B,kBAAkB,CAAC,OAAO,CACjC,CAAC;AACN,CAAC;AAVD,8CAUC;AAED,SAAgB,sBAAsB,CAAC,kBAA8C;IACjF,OAAO,OAAO,CACV,kBAAkB,CAAC,KAAK;QACpB,kBAAkB,CAAC,OAAO;QAC1B,iBAAiB,CAAC,kBAAkB,CAAC,CAC5C,CAAC;AACN,CAAC;AAND,wDAMC;AAED,SAAgB,wBAAwB,CAAC,kBAA8C;IACnF,OAAO,OAAO,CACV,kBAAkB,CAAC,OAAO;QACtB,kBAAkB,CAAC,KAAK;QACxB,kBAAkB,CAAC,KAAK;QACxB,kBAAkB,CAAC,OAAO,CACjC,CAAC;AACN,CAAC;AAPD,4DAOC"}
@@ -1,3 +0,0 @@
1
- export declare const ASSETS_URL = "https://cdn.uc.assets.prezly.com";
2
- export declare const DEFAULT_PAGE_SIZE = 12;
3
- export declare const DEFAULT_GALLERY_PAGE_SIZE = 6;
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEFAULT_GALLERY_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = exports.ASSETS_URL = void 0;
4
- exports.ASSETS_URL = 'https://cdn.uc.assets.prezly.com';
5
- exports.DEFAULT_PAGE_SIZE = 12;
6
- exports.DEFAULT_GALLERY_PAGE_SIZE = 6;
7
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,kCAAkC,CAAC;AAChD,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,yBAAyB,GAAG,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * @param uuid UUID of the assets hosted on Uploadcare
3
- * @returns Full asset URL that can be used as a source for <img>, <video> and <a> tags.
4
- */
5
- export declare function getAssetsUrl(uuid: string): string;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAssetsUrl = void 0;
4
- const constants_1 = require("./constants");
5
- /**
6
- * @param uuid UUID of the assets hosted on Uploadcare
7
- * @returns Full asset URL that can be used as a source for <img>, <video> and <a> tags.
8
- */
9
- function getAssetsUrl(uuid) {
10
- return `${constants_1.ASSETS_URL}/${uuid}/`;
11
- }
12
- exports.getAssetsUrl = getAssetsUrl;
13
- //# sourceMappingURL=getAssetsUrl.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getAssetsUrl.js","sourceRoot":"","sources":["../../src/utils/getAssetsUrl.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAEzC;;;GAGG;AACH,SAAgB,YAAY,CAAC,IAAY;IACrC,OAAO,GAAG,sBAAU,IAAI,IAAI,GAAG,CAAC;AACpC,CAAC;AAFD,oCAEC"}
@@ -1,3 +0,0 @@
1
- import type { Newsroom } from '@prezly/sdk';
2
- import type { LocaleObject } from '../intl';
3
- export declare function getDataRequestLink(newsroom: Newsroom, currentLocale: LocaleObject): string;
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDataRequestLink = void 0;
4
- const getPrivacyPortalUrl_1 = require("./getPrivacyPortalUrl");
5
- function getDataRequestLink(newsroom, currentLocale) {
6
- return (newsroom.custom_data_request_link ||
7
- (0, getPrivacyPortalUrl_1.getPrivacyPortalUrl)(newsroom, currentLocale, {
8
- action: 'data-request',
9
- }));
10
- }
11
- exports.getDataRequestLink = getDataRequestLink;
12
- //# sourceMappingURL=getDataRequestLink.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getDataRequestLink.js","sourceRoot":"","sources":["../../src/utils/getDataRequestLink.ts"],"names":[],"mappings":";;;AAIA,+DAA4D;AAE5D,SAAgB,kBAAkB,CAAC,QAAkB,EAAE,aAA2B;IAC9E,OAAO,CACH,QAAQ,CAAC,wBAAwB;QACjC,IAAA,yCAAmB,EAAC,QAAQ,EAAE,aAAa,EAAE;YACzC,MAAM,EAAE,cAAc;SACzB,CAAC,CACL,CAAC;AACN,CAAC;AAPD,gDAOC"}
@@ -1,10 +0,0 @@
1
- import type { Category } from '@prezly/sdk';
2
- import type { LocaleObject } from '../intl';
3
- import type { AlgoliaCategoryRef } from '../types';
4
- export declare function getLocalizedCategoryData(category: Category | AlgoliaCategoryRef, locale: LocaleObject): {
5
- description: string | null;
6
- name: string;
7
- slug: string | null;
8
- };
9
- export declare function getCategoryUrl(category: Category | AlgoliaCategoryRef, locale: LocaleObject): string;
10
- export declare function getCategoryHasTranslation(category: Category, locale: LocaleObject): boolean;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCategoryHasTranslation = exports.getCategoryUrl = exports.getLocalizedCategoryData = void 0;
4
- function isAlgoliaCategory(category) {
5
- return 'name' in category && 'slug' in category;
6
- }
7
- function getLocalizedCategoryData(category, locale) {
8
- if (isAlgoliaCategory(category)) {
9
- return {
10
- description: null,
11
- name: category.name,
12
- slug: category.slug,
13
- };
14
- }
15
- const targetLocaleCode = locale.toUnderscoreCode();
16
- const { i18n } = category;
17
- const populatedLocales = Object.keys(i18n).filter((localeCode) => i18n[localeCode].name);
18
- const targetLocale = populatedLocales.find((localeCode) => localeCode === targetLocaleCode) ||
19
- populatedLocales.find((localeCode) => i18n[localeCode].name === category.display_name) ||
20
- populatedLocales[0];
21
- const { locale: _, ...localizedData } = i18n[targetLocale];
22
- return localizedData;
23
- }
24
- exports.getLocalizedCategoryData = getLocalizedCategoryData;
25
- function getCategoryUrl(category, locale) {
26
- const { slug } = getLocalizedCategoryData(category, locale);
27
- return `/category/${slug}`;
28
- }
29
- exports.getCategoryUrl = getCategoryUrl;
30
- function getCategoryHasTranslation(category, locale) {
31
- const targetLocaleCode = locale.toUnderscoreCode();
32
- const { i18n } = category;
33
- const populatedLocales = Object.keys(i18n).filter((localeCode) => i18n[localeCode].name);
34
- return Boolean(populatedLocales.find((localeCode) => localeCode === targetLocaleCode));
35
- }
36
- exports.getCategoryHasTranslation = getCategoryHasTranslation;
37
- //# sourceMappingURL=getLocalizedCategoryData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getLocalizedCategoryData.js","sourceRoot":"","sources":["../../src/utils/getLocalizedCategoryData.ts"],"names":[],"mappings":";;;AAKA,SAAS,iBAAiB,CACtB,QAAuC;IAEvC,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,IAAI,QAAQ,CAAC;AACpD,CAAC;AAED,SAAgB,wBAAwB,CACpC,QAAuC,EACvC,MAAoB;IAEpB,IAAI,iBAAiB,CAAC,QAAQ,CAAC,EAAE;QAC7B,OAAO;YACH,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;SACtB,CAAC;KACL;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC1B,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;IACzF,MAAM,YAAY,GACd,gBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,KAAK,gBAAgB,CAAC;QACtE,gBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,YAAY,CAAC;QACtF,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAExB,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,aAAa,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IAE3D,OAAO,aAAa,CAAC;AACzB,CAAC;AAvBD,4DAuBC;AAED,SAAgB,cAAc,CAAC,QAAuC,EAAE,MAAoB;IACxF,MAAM,EAAE,IAAI,EAAE,GAAG,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,aAAa,IAAI,EAAE,CAAC;AAC/B,CAAC;AAHD,wCAGC;AAED,SAAgB,yBAAyB,CAAC,QAAkB,EAAE,MAAoB;IAC9E,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC1B,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;IACzF,OAAO,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,KAAK,gBAAgB,CAAC,CAAC,CAAC;AAC3F,CAAC;AALD,8DAKC"}
@@ -1,3 +0,0 @@
1
- import type { Newsroom } from '@prezly/sdk';
2
- export declare function getNewsroomLogoUrl(newsroom: Newsroom): string;
3
- export declare function getNewsroomFaviconUrl(newsroom: Newsroom, previewSize?: number): string;
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getNewsroomFaviconUrl = exports.getNewsroomLogoUrl = void 0;
4
- const uploadcare_1 = require("@prezly/uploadcare");
5
- function getNewsroomLogoUrl(newsroom) {
6
- if (newsroom.newsroom_logo) {
7
- const image = uploadcare_1.UploadcareImage.createFromPrezlyStoragePayload(newsroom.newsroom_logo);
8
- return image.cdnUrl;
9
- }
10
- return '';
11
- }
12
- exports.getNewsroomLogoUrl = getNewsroomLogoUrl;
13
- function getNewsroomFaviconUrl(newsroom, previewSize = 400) {
14
- const imageObject = newsroom.icon || newsroom.square_logo;
15
- if (imageObject) {
16
- const image = uploadcare_1.UploadcareImage.createFromPrezlyStoragePayload(imageObject);
17
- return image.preview(previewSize, previewSize).cdnUrl;
18
- }
19
- return '';
20
- }
21
- exports.getNewsroomFaviconUrl = getNewsroomFaviconUrl;
22
- //# sourceMappingURL=getNewsroomLogoUrl.js.map
@@ -1 +0,0 @@
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,8 +0,0 @@
1
- import type { Newsroom } from '@prezly/sdk';
2
- import type { LocaleObject } from '../intl';
3
- type PrivacyPortalUrlOptions = {
4
- email?: string;
5
- action?: 'data-request' | 'subscribe' | 'unsubscribe';
6
- };
7
- export declare function getPrivacyPortalUrl(newsroom: Newsroom, locale: LocaleObject, options?: PrivacyPortalUrlOptions): string;
8
- export {};
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPrivacyPortalUrl = void 0;
4
- function getPrivacyPortalUrl(newsroom, locale, options) {
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 +0,0 @@
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,3 +0,0 @@
1
- import type { Story } from '@prezly/sdk';
2
- import type { AlgoliaStory } from '../types';
3
- export declare function getStoryPublicationDate(story: Story | AlgoliaStory): Date | null;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getStoryPublicationDate = void 0;
4
- function getStoryPublicationDate(story) {
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 +0,0 @@
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,8 +0,0 @@
1
- /**
2
- * This method constructs a URL to download all images in the Gallery as a single archive.
3
- *
4
- * @param uuid Gallery UUID
5
- * @param title Filename for the saved archive. Usually it is the Gallery title.
6
- * @returns URL to an archive containing all of the images in the Gallery.
7
- */
8
- export declare function getUploadcareGroupUrl(uuid: string, title: string): string;
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUploadcareGroupUrl = void 0;
4
- const constants_1 = require("./constants");
5
- /**
6
- * This method constructs a URL to download all images in the Gallery as a single archive.
7
- *
8
- * @param uuid Gallery UUID
9
- * @param title Filename for the saved archive. Usually it is the Gallery title.
10
- * @returns URL to an archive containing all of the images in the Gallery.
11
- */
12
- function getUploadcareGroupUrl(uuid, title) {
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 +0,0 @@
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,10 +0,0 @@
1
- export * from './boilerplate';
2
- export * from './constants';
3
- export * from './getAssetsUrl';
4
- export * from './getDataRequestLink';
5
- export * from './getLocalizedCategoryData';
6
- export * from './getNewsroomLogoUrl';
7
- export * from './getPrivacyPortalUrl';
8
- export * from './getStoryPublicationDate';
9
- export * from './getUploadcareGroupUrl';
10
- export * from './isEmbargoStory';
@@ -1,27 +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
- __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 +0,0 @@
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"}