@prezly/theme-kit-nextjs 1.15.0 → 1.16.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/build/adapter-nextjs/api-handlers/fetchGalleries.js +15 -69
  2. package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
  3. package/build/adapter-nextjs/api-handlers/fetchStories.js +17 -71
  4. package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
  5. package/build/adapter-nextjs/api-handlers/index.js +2 -7
  6. package/build/adapter-nextjs/api-handlers/index.js.map +1 -1
  7. package/build/adapter-nextjs/getNewsroomServerSideProps.js +9 -63
  8. package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
  9. package/build/adapter-nextjs/getNewsroomStaticProps.js +9 -63
  10. package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
  11. package/build/adapter-nextjs/index.js +6 -22
  12. package/build/adapter-nextjs/index.js.map +1 -1
  13. package/build/adapter-nextjs/page-props/category.d.ts +1 -1
  14. package/build/adapter-nextjs/page-props/category.js +95 -202
  15. package/build/adapter-nextjs/page-props/category.js.map +1 -1
  16. package/build/adapter-nextjs/page-props/gallery.d.ts +1 -1
  17. package/build/adapter-nextjs/page-props/gallery.js +59 -141
  18. package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
  19. package/build/adapter-nextjs/page-props/galleryAlbum.d.ts +1 -1
  20. package/build/adapter-nextjs/page-props/galleryAlbum.js +41 -139
  21. package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
  22. package/build/adapter-nextjs/page-props/home.d.ts +1 -1
  23. package/build/adapter-nextjs/page-props/home.js +58 -142
  24. package/build/adapter-nextjs/page-props/home.js.map +1 -1
  25. package/build/adapter-nextjs/page-props/index.js +8 -41
  26. package/build/adapter-nextjs/page-props/index.js.map +1 -1
  27. package/build/adapter-nextjs/page-props/lib/types.d.ts +1 -1
  28. package/build/adapter-nextjs/page-props/lib/types.js +1 -2
  29. package/build/adapter-nextjs/page-props/search.d.ts +2 -2
  30. package/build/adapter-nextjs/page-props/search.js +21 -103
  31. package/build/adapter-nextjs/page-props/search.js.map +1 -1
  32. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +18 -22
  33. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
  34. package/build/adapter-nextjs/page-props/sitemap/createPaths.js +10 -45
  35. package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
  36. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +29 -81
  37. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
  38. package/build/adapter-nextjs/page-props/sitemap/index.js +4 -24
  39. package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -1
  40. package/build/adapter-nextjs/page-props/sitemap/types.js +1 -2
  41. package/build/adapter-nextjs/page-props/story.d.ts +1 -1
  42. package/build/adapter-nextjs/page-props/story.js +58 -166
  43. package/build/adapter-nextjs/page-props/story.js.map +1 -1
  44. package/build/adapter-nextjs/page-props/storyPreview.js +20 -85
  45. package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
  46. package/build/adapter-nextjs/processRequest.js +9 -24
  47. package/build/adapter-nextjs/processRequest.js.map +1 -1
  48. package/build/adapter-nextjs/processStaticRequest.js +3 -18
  49. package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
  50. package/build/components-nextjs/PageSeo/PageSeo.js +42 -57
  51. package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
  52. package/build/components-nextjs/PageSeo/index.js +2 -20
  53. package/build/components-nextjs/PageSeo/index.js.map +1 -1
  54. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +2 -6
  55. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
  56. package/build/components-nextjs/PageSeo/lib/types.js +1 -2
  57. package/build/components-nextjs/StorySeo/StorySeo.js +28 -36
  58. package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
  59. package/build/components-nextjs/StorySeo/index.js +1 -5
  60. package/build/components-nextjs/StorySeo/index.js.map +1 -1
  61. package/build/components-nextjs/document.d.ts +6 -0
  62. package/build/components-nextjs/document.js +21 -0
  63. package/build/components-nextjs/document.js.map +1 -0
  64. package/build/components-nextjs/index.d.ts +1 -0
  65. package/build/components-nextjs/index.js +3 -7
  66. package/build/components-nextjs/index.js.map +1 -1
  67. package/build/data-fetching/api/PrezlyApi.js +171 -363
  68. package/build/data-fetching/api/PrezlyApi.js.map +1 -1
  69. package/build/data-fetching/api/getPrezlyApi.js +5 -9
  70. package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
  71. package/build/data-fetching/api/index.js +1 -17
  72. package/build/data-fetching/api/index.js.map +1 -1
  73. package/build/data-fetching/api/queries.js +13 -45
  74. package/build/data-fetching/api/queries.js.map +1 -1
  75. package/build/data-fetching/index.js +3 -19
  76. package/build/data-fetching/index.js.map +1 -1
  77. package/build/data-fetching/lib/getAlgoliaSettings.js +6 -10
  78. package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
  79. package/build/data-fetching/lib/getEnvVariables.js +11 -29
  80. package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
  81. package/build/data-fetching/lib/index.js +4 -11
  82. package/build/data-fetching/lib/index.js.map +1 -1
  83. package/build/data-fetching/lib/isSdkError.js +1 -5
  84. package/build/data-fetching/lib/isSdkError.js.map +1 -1
  85. package/build/data-fetching/lib/isUuid.js +2 -6
  86. package/build/data-fetching/lib/isUuid.js.map +1 -1
  87. package/build/data-fetching/types.js +1 -2
  88. package/build/index.d.ts +1 -0
  89. package/build/index.js +9 -24
  90. package/build/index.js.map +1 -1
  91. package/build/infinite-loading/index.js +4 -24
  92. package/build/infinite-loading/index.js.map +1 -1
  93. package/build/infinite-loading/types.js +1 -2
  94. package/build/infinite-loading/useInfiniteGalleriesLoading.js +25 -83
  95. package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
  96. package/build/infinite-loading/useInfiniteLoading.js +21 -97
  97. package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
  98. package/build/infinite-loading/useInfiniteStoriesLoading.js +36 -99
  99. package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
  100. package/build/intl/index.js +4 -25
  101. package/build/intl/index.js.map +1 -1
  102. package/build/intl/languages.js +47 -93
  103. package/build/intl/languages.js.map +1 -1
  104. package/build/intl/locale.js +21 -27
  105. package/build/intl/locale.js.map +1 -1
  106. package/build/intl/localeConfig.js +11 -32
  107. package/build/intl/localeConfig.js.map +1 -1
  108. package/build/intl/localeObject.js +30 -49
  109. package/build/intl/localeObject.js.map +1 -1
  110. package/build/newsroom-context/context.js +18 -34
  111. package/build/newsroom-context/context.js.map +1 -1
  112. package/build/newsroom-context/hooks/index.js +11 -27
  113. package/build/newsroom-context/hooks/index.js.map +1 -1
  114. package/build/newsroom-context/hooks/useAlgoliaSettings.js +3 -7
  115. package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
  116. package/build/newsroom-context/hooks/useCategories.js +3 -7
  117. package/build/newsroom-context/hooks/useCategories.js.map +1 -1
  118. package/build/newsroom-context/hooks/useCompanyInformation.js +3 -7
  119. package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
  120. package/build/newsroom-context/hooks/useCurrentCategory.js +3 -7
  121. package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
  122. package/build/newsroom-context/hooks/useCurrentLocale.js +3 -7
  123. package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
  124. package/build/newsroom-context/hooks/useCurrentStory.js +3 -7
  125. package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
  126. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +10 -14
  127. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
  128. package/build/newsroom-context/hooks/useGetTranslationUrl.js +17 -26
  129. package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
  130. package/build/newsroom-context/hooks/useLanguages.js +3 -7
  131. package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
  132. package/build/newsroom-context/hooks/useNewsroom.js +3 -7
  133. package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
  134. package/build/newsroom-context/hooks/useNewsroomContext.js +4 -8
  135. package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
  136. package/build/newsroom-context/index.js +2 -21
  137. package/build/newsroom-context/index.js.map +1 -1
  138. package/build/sentry/client.d.ts +2 -0
  139. package/build/sentry/client.js +5 -0
  140. package/build/sentry/client.js.map +1 -0
  141. package/build/sentry/common.d.ts +2 -0
  142. package/build/sentry/common.js +25 -0
  143. package/build/sentry/common.js.map +1 -0
  144. package/build/sentry/index.d.ts +2 -0
  145. package/build/sentry/index.js +3 -0
  146. package/build/sentry/index.js.map +1 -0
  147. package/build/sentry/server.d.ts +2 -0
  148. package/build/sentry/server.js +5 -0
  149. package/build/sentry/server.js.map +1 -0
  150. package/build/tsconfig.tsbuildinfo +1 -1
  151. package/build/types.js +1 -2
  152. package/build/utils/boilerplate.js +3 -9
  153. package/build/utils/boilerplate.js.map +1 -1
  154. package/build/utils/constants.js +3 -6
  155. package/build/utils/constants.js.map +1 -1
  156. package/build/utils/getAssetsUrl.js +3 -7
  157. package/build/utils/getAssetsUrl.js.map +1 -1
  158. package/build/utils/getDataRequestLink.js +3 -7
  159. package/build/utils/getDataRequestLink.js.map +1 -1
  160. package/build/utils/getLocalizedCategoryData.js +15 -32
  161. package/build/utils/getLocalizedCategoryData.js.map +1 -1
  162. package/build/utils/getNewsroomLogoUrl.js +6 -12
  163. package/build/utils/getNewsroomLogoUrl.js.map +1 -1
  164. package/build/utils/getPrivacyPortalUrl.js +3 -7
  165. package/build/utils/getPrivacyPortalUrl.js.map +1 -1
  166. package/build/utils/getStoryPublicationDate.js +2 -6
  167. package/build/utils/getStoryPublicationDate.js.map +1 -1
  168. package/build/utils/getUploadcareGroupUrl.js +3 -7
  169. package/build/utils/getUploadcareGroupUrl.js.map +1 -1
  170. package/build/utils/index.js +10 -26
  171. package/build/utils/index.js.map +1 -1
  172. package/build/utils/isEmbargoStory.js +1 -5
  173. package/build/utils/isEmbargoStory.js.map +1 -1
  174. package/package.json +2 -1
  175. package/src/adapter-nextjs/page-props/category.ts +5 -2
  176. package/src/adapter-nextjs/page-props/gallery.ts +5 -2
  177. package/src/adapter-nextjs/page-props/galleryAlbum.ts +5 -2
  178. package/src/adapter-nextjs/page-props/home.ts +5 -2
  179. package/src/adapter-nextjs/page-props/lib/types.ts +4 -4
  180. package/src/adapter-nextjs/page-props/search.ts +10 -3
  181. package/src/adapter-nextjs/page-props/story.ts +5 -2
  182. package/src/components-nextjs/document.tsx +38 -0
  183. package/src/components-nextjs/index.ts +1 -0
  184. package/src/index.ts +1 -0
  185. package/src/sentry/client.ts +7 -0
  186. package/src/sentry/common.ts +27 -0
  187. package/src/sentry/index.ts +2 -0
  188. package/src/sentry/server.ts +7 -0
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useGetTranslationUrl = void 0;
4
- var router_1 = require("next/router");
5
- var react_1 = require("react");
6
- var utils_1 = require("../../utils");
7
- var useCurrentCategory_1 = require("./useCurrentCategory");
8
- var useCurrentStory_1 = require("./useCurrentStory");
1
+ import { useRouter } from 'next/router';
2
+ import { useCallback } from 'react';
3
+ import { getCategoryHasTranslation, getCategoryUrl } from '../../utils';
4
+ import { useCurrentCategory } from './useCurrentCategory';
5
+ import { useCurrentStory } from './useCurrentStory';
9
6
  // Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
10
7
  var StoryVisibility;
11
8
  (function (StoryVisibility) {
@@ -15,7 +12,7 @@ var StoryVisibility;
15
12
  StoryVisibility["CONFIDENTIAL"] = "confidential";
16
13
  })(StoryVisibility || (StoryVisibility = {}));
17
14
  function getAllowedTranslationVisibilityValues(story) {
18
- var visibility = story.visibility;
15
+ const { visibility } = story;
19
16
  switch (visibility) {
20
17
  case StoryVisibility.EMBARGO:
21
18
  return [StoryVisibility.EMBARGO, StoryVisibility.PUBLIC];
@@ -35,23 +32,20 @@ function getAllowedTranslationVisibilityValues(story) {
35
32
  */
36
33
  function getTranslationUrl(locale, path, currentCategory, currentStory, noFallback) {
37
34
  if (currentCategory) {
38
- if ((0, utils_1.getCategoryHasTranslation)(currentCategory, locale)) {
39
- return (0, utils_1.getCategoryUrl)(currentCategory, locale);
35
+ if (getCategoryHasTranslation(currentCategory, locale)) {
36
+ return getCategoryUrl(currentCategory, locale);
40
37
  }
41
38
  if (noFallback) {
42
39
  return '';
43
40
  }
44
41
  return '/';
45
42
  }
46
- var localeCode = locale.toUnderscoreCode();
43
+ const localeCode = locale.toUnderscoreCode();
47
44
  if (currentStory && currentStory.culture.locale !== localeCode) {
48
- var allowedVisibilityValues_1 = getAllowedTranslationVisibilityValues(currentStory);
49
- var translatedStory = currentStory.translations.find(function (_a) {
50
- var culture = _a.culture, visibility = _a.visibility;
51
- return culture.locale === localeCode && allowedVisibilityValues_1.includes(visibility);
52
- });
45
+ const allowedVisibilityValues = getAllowedTranslationVisibilityValues(currentStory);
46
+ const translatedStory = currentStory.translations.find(({ culture, visibility }) => culture.locale === localeCode && allowedVisibilityValues.includes(visibility));
53
47
  if (translatedStory) {
54
- return "/".concat(translatedStory.slug);
48
+ return `/${translatedStory.slug}`;
55
49
  }
56
50
  if (noFallback) {
57
51
  return '';
@@ -64,13 +58,10 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
64
58
  * This hook returns a function that is meant to be used in language pickers and alternate locales list for the pages.
65
59
  * `noFallback` parameter is useful for alternate language links in the `head` section of the document (so that there are no unwanted links to the homepage).
66
60
  */
67
- function useGetTranslationUrl() {
68
- var asPath = (0, router_1.useRouter)().asPath;
69
- var currentCategory = (0, useCurrentCategory_1.useCurrentCategory)();
70
- var currentStory = (0, useCurrentStory_1.useCurrentStory)();
71
- return (0, react_1.useCallback)(function (locale, noFallback) {
72
- return getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback);
73
- }, [asPath, currentCategory, currentStory]);
61
+ export function useGetTranslationUrl() {
62
+ const { asPath } = useRouter();
63
+ const currentCategory = useCurrentCategory();
64
+ const currentStory = useCurrentStory();
65
+ return useCallback((locale, noFallback) => getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback), [asPath, currentCategory, currentStory]);
74
66
  }
75
- exports.useGetTranslationUrl = useGetTranslationUrl;
76
67
  //# sourceMappingURL=useGetTranslationUrl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":";;;AACA,sCAAwC;AACxC,+BAAoC;AAGpC,qCAAwE;AAExE,2DAA0D;AAC1D,qDAAoD;AAEpD,wFAAwF;AACxF,IAAK,eAKJ;AALD,WAAK,eAAe;IAChB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,gDAA6B,CAAA;AACjC,CAAC,EALI,eAAe,KAAf,eAAe,QAKnB;AAED,SAAS,qCAAqC,CAAC,KAAoB;IACvD,IAAA,UAAU,GAAK,KAAK,WAAV,CAAW;IAE7B,QAAQ,UAAU,EAAE;QAChB,KAAK,eAAe,CAAC,OAAO;YACxB,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7D,KAAK,eAAe,CAAC,OAAO;YACxB,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7D,KAAK,eAAe,CAAC,YAAY;YAC7B,OAAO,CAAC,eAAe,CAAC,YAAY,EAAE,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC3F;YACI,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;KACvC;AACL,CAAC;AAED;;;;;GAKG;A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AAC,CAC1C,CAAC;AACN,CAAC"}
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useLanguages = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
5
- function useLanguages() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
1
+ import { useNewsroomContext } from './useNewsroomContext';
2
+ export function useLanguages() {
3
+ const context = useNewsroomContext();
7
4
  return context.languages;
8
5
  }
9
- exports.useLanguages = useLanguages;
10
6
  //# sourceMappingURL=useLanguages.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useLanguages.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,YAAY;IACxB,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC;AAJD,oCAIC"}
1
+ {"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useLanguages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,YAAY;IACxB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC"}
@@ -1,10 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useNewsroom = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
5
- function useNewsroom() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
1
+ import { useNewsroomContext } from './useNewsroomContext';
2
+ export function useNewsroom() {
3
+ const context = useNewsroomContext();
7
4
  return context.newsroom;
8
5
  }
9
- exports.useNewsroom = useNewsroom;
10
6
  //# sourceMappingURL=useNewsroom.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNewsroom.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroom.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,WAAW;IACvB,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC;AAJD,kCAIC"}
1
+ {"version":3,"file":"useNewsroom.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,WAAW;IACvB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC"}
@@ -1,16 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useNewsroomContext = void 0;
4
- var react_1 = require("react");
5
- var context_1 = require("../context");
6
- function useNewsroomContext() {
1
+ import { useContext } from 'react';
2
+ import { NewsroomContext } from '../context';
3
+ export function useNewsroomContext() {
7
4
  // TS Compiler is having a hard time figuring this type implicitly, so we have to set it explicitly
8
5
  // See https://github.com/microsoft/TypeScript/issues/5711#issuecomment-340283439
9
- var newsroomContext = (0, react_1.useContext)(context_1.NewsroomContext);
6
+ const newsroomContext = useContext(NewsroomContext);
10
7
  if (!newsroomContext) {
11
8
  throw new Error('No `NewsroomContextProvider` found when calling `useNewsroomContext`');
12
9
  }
13
10
  return newsroomContext;
14
11
  }
15
- exports.useNewsroomContext = useNewsroomContext;
16
12
  //# sourceMappingURL=useNewsroomContext.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useNewsroomContext.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroomContext.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AAGnC,sCAA6C;AAE7C,SAAgB,kBAAkB;IAC9B,mGAAmG;IACnG,iFAAiF;IACjF,IAAM,eAAe,GAAoC,IAAA,kBAAU,EAAC,yBAAe,CAAC,CAAC;IACrF,IAAI,CAAC,eAAe,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KAC3F;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AATD,gDASC"}
1
+ {"version":3,"file":"useNewsroomContext.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroomContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,UAAU,kBAAkB;IAC9B,mGAAmG;IACnG,iFAAiF;IACjF,MAAM,eAAe,GAAoC,UAAU,CAAC,eAAe,CAAC,CAAC;IACrF,IAAI,CAAC,eAAe,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KAC3F;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC"}
@@ -1,22 +1,3 @@
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.NewsroomContextProvider = exports.NewsroomContext = void 0;
18
- var context_1 = require("./context");
19
- Object.defineProperty(exports, "NewsroomContext", { enumerable: true, get: function () { return context_1.NewsroomContext; } });
20
- Object.defineProperty(exports, "NewsroomContextProvider", { enumerable: true, get: function () { return context_1.NewsroomContextProvider; } });
21
- __exportStar(require("./hooks"), exports);
1
+ export { NewsroomContext, NewsroomContextProvider } from './context';
2
+ export * from './hooks';
22
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA2F;AAAlF,0GAAA,eAAe,OAAA;AAAE,kHAAA,uBAAuB,OAAA;AACjD,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAwB,MAAM,WAAW,CAAC;AAC3F,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { init } from '@sentry/nextjs';
2
+ export declare function getSentryClientOptions(dsn: string, themeName: string): Parameters<typeof init>[0];
@@ -0,0 +1,5 @@
1
+ import { getCommonClientOptions } from './common';
2
+ export function getSentryClientOptions(dsn, themeName) {
3
+ return getCommonClientOptions(dsn, themeName);
4
+ }
5
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/sentry/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { init } from '@sentry/nextjs';
2
+ export declare function getCommonClientOptions(dsn: string, themeName: string): Parameters<typeof init>[0];
@@ -0,0 +1,25 @@
1
+ export function getCommonClientOptions(dsn, themeName) {
2
+ return {
3
+ dsn,
4
+ // Adjust this value in production, or use tracesSampler for greater control
5
+ tracesSampleRate: 0.02,
6
+ // ...
7
+ // Note: if you want to override the automatic release value, do not set a
8
+ // `release` value here - use the environment variable `SENTRY_RELEASE`, so
9
+ // that it will also get attached to your source maps
10
+ ignoreErrors: [
11
+ // This particular error is coming from Microsoft Outlook SafeLink crawler.
12
+ // It doesn't affect the user experience in any way, but produces a lot of unwanted Sentry events.
13
+ // See https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
14
+ 'Object Not Found Matching Id',
15
+ // This error is caused by `beacon.min.js` polyfill in Cloudflare Insights. From what we see, it doesn't affect the user experience.
16
+ 'Illegal invocation',
17
+ ],
18
+ // Attach theme tag to each event
19
+ initialScope: (scope) => {
20
+ scope.setTags({ prezly_theme: themeName });
21
+ return scope;
22
+ },
23
+ };
24
+ }
25
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sentry/common.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO;QACH,GAAG;QACH,4EAA4E;QAC5E,gBAAgB,EAAE,IAAI;QACtB,MAAM;QACN,0EAA0E;QAC1E,2EAA2E;QAC3E,qDAAqD;QAErD,YAAY,EAAE;YACV,2EAA2E;YAC3E,kGAAkG;YAClG,yGAAyG;YACzG,8BAA8B;YAC9B,oIAAoI;YACpI,oBAAoB;SACvB;QACD,iCAAiC;QACjC,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;YAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getSentryClientOptions } from './client';
2
+ export { getSentryServerOptions } from './server';
@@ -0,0 +1,3 @@
1
+ export { getSentryClientOptions } from './client';
2
+ export { getSentryServerOptions } from './server';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sentry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { init } from '@sentry/nextjs';
2
+ export declare function getSentryServerOptions(dsn: string, themeName: string): Parameters<typeof init>[0];
@@ -0,0 +1,5 @@
1
+ import { getCommonClientOptions } from './common';
2
+ export function getSentryServerOptions(dsn, themeName) {
3
+ return getCommonClientOptions(dsn, themeName);
4
+ }
5
+ //# sourceMappingURL=server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/sentry/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}