@prezly/theme-kit-nextjs 1.16.0-0 → 1.16.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 (112) hide show
  1. package/build/adapter-nextjs/api-handlers/fetchGalleries.js +16 -66
  2. package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
  3. package/build/adapter-nextjs/api-handlers/fetchStories.js +18 -68
  4. package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
  5. package/build/adapter-nextjs/getNewsroomServerSideProps.js +9 -59
  6. package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
  7. package/build/adapter-nextjs/getNewsroomStaticProps.js +9 -59
  8. package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
  9. package/build/adapter-nextjs/page-props/category.js +94 -195
  10. package/build/adapter-nextjs/page-props/category.js.map +1 -1
  11. package/build/adapter-nextjs/page-props/gallery.js +58 -135
  12. package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
  13. package/build/adapter-nextjs/page-props/galleryAlbum.js +40 -132
  14. package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
  15. package/build/adapter-nextjs/page-props/home.js +56 -135
  16. package/build/adapter-nextjs/page-props/home.js.map +1 -1
  17. package/build/adapter-nextjs/page-props/search.js +19 -96
  18. package/build/adapter-nextjs/page-props/search.js.map +1 -1
  19. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +18 -18
  20. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
  21. package/build/adapter-nextjs/page-props/sitemap/createPaths.js +9 -40
  22. package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
  23. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +28 -76
  24. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
  25. package/build/adapter-nextjs/page-props/story.js +57 -159
  26. package/build/adapter-nextjs/page-props/story.js.map +1 -1
  27. package/build/adapter-nextjs/page-props/storyPreview.js +20 -81
  28. package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
  29. package/build/adapter-nextjs/processRequest.js +8 -19
  30. package/build/adapter-nextjs/processRequest.js.map +1 -1
  31. package/build/adapter-nextjs/processStaticRequest.js +2 -13
  32. package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
  33. package/build/components-nextjs/PageSeo/PageSeo.js +41 -52
  34. package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
  35. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -1
  36. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
  37. package/build/components-nextjs/StorySeo/StorySeo.js +27 -31
  38. package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
  39. package/build/components-nextjs/document.js +16 -45
  40. package/build/components-nextjs/document.js.map +1 -1
  41. package/build/data-fetching/api/PrezlyApi.js +170 -355
  42. package/build/data-fetching/api/PrezlyApi.js.map +1 -1
  43. package/build/data-fetching/api/getPrezlyApi.js +3 -3
  44. package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
  45. package/build/data-fetching/api/queries.js +8 -32
  46. package/build/data-fetching/api/queries.js.map +1 -1
  47. package/build/data-fetching/lib/getAlgoliaSettings.js +5 -5
  48. package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
  49. package/build/data-fetching/lib/getEnvVariables.js +10 -21
  50. package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
  51. package/build/data-fetching/lib/isUuid.js +1 -1
  52. package/build/data-fetching/lib/isUuid.js.map +1 -1
  53. package/build/infinite-loading/useInfiniteGalleriesLoading.js +25 -79
  54. package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
  55. package/build/infinite-loading/useInfiniteLoading.js +22 -94
  56. package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
  57. package/build/infinite-loading/useInfiniteStoriesLoading.js +36 -95
  58. package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
  59. package/build/intl/languages.js +35 -68
  60. package/build/intl/languages.js.map +1 -1
  61. package/build/intl/locale.js +13 -13
  62. package/build/intl/locale.js.map +1 -1
  63. package/build/intl/localeConfig.js +11 -32
  64. package/build/intl/localeConfig.js.map +1 -1
  65. package/build/intl/localeObject.js +30 -42
  66. package/build/intl/localeObject.js.map +1 -1
  67. package/build/newsroom-context/context.js +17 -29
  68. package/build/newsroom-context/context.js.map +1 -1
  69. package/build/newsroom-context/hooks/useAlgoliaSettings.js +2 -2
  70. package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
  71. package/build/newsroom-context/hooks/useCategories.js +2 -2
  72. package/build/newsroom-context/hooks/useCategories.js.map +1 -1
  73. package/build/newsroom-context/hooks/useCompanyInformation.js +2 -2
  74. package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
  75. package/build/newsroom-context/hooks/useCurrentCategory.js +2 -2
  76. package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
  77. package/build/newsroom-context/hooks/useCurrentLocale.js +2 -2
  78. package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
  79. package/build/newsroom-context/hooks/useCurrentStory.js +2 -2
  80. package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
  81. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +8 -8
  82. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
  83. package/build/newsroom-context/hooks/useGetTranslationUrl.js +14 -19
  84. package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
  85. package/build/newsroom-context/hooks/useLanguages.js +2 -2
  86. package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
  87. package/build/newsroom-context/hooks/useNewsroom.js +2 -2
  88. package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
  89. package/build/newsroom-context/hooks/useNewsroomContext.js +3 -3
  90. package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
  91. package/build/sentry/client.js +1 -1
  92. package/build/sentry/client.js.map +1 -1
  93. package/build/sentry/common.js +2 -2
  94. package/build/sentry/common.js.map +1 -1
  95. package/build/sentry/server.js +1 -1
  96. package/build/sentry/server.js.map +1 -1
  97. package/build/tsconfig.tsbuildinfo +1 -1
  98. package/build/utils/getAssetsUrl.js +2 -2
  99. package/build/utils/getAssetsUrl.js.map +1 -1
  100. package/build/utils/getDataRequestLink.js +1 -1
  101. package/build/utils/getDataRequestLink.js.map +1 -1
  102. package/build/utils/getLocalizedCategoryData.js +12 -23
  103. package/build/utils/getLocalizedCategoryData.js.map +1 -1
  104. package/build/utils/getNewsroomLogoUrl.js +4 -5
  105. package/build/utils/getNewsroomLogoUrl.js.map +1 -1
  106. package/build/utils/getPrivacyPortalUrl.js +2 -2
  107. package/build/utils/getPrivacyPortalUrl.js.map +1 -1
  108. package/build/utils/getStoryPublicationDate.js +1 -1
  109. package/build/utils/getStoryPublicationDate.js.map +1 -1
  110. package/build/utils/getUploadcareGroupUrl.js +2 -2
  111. package/build/utils/getUploadcareGroupUrl.js.map +1 -1
  112. package/package.json +2 -2
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCategories = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
4
+ const useNewsroomContext_1 = require("./useNewsroomContext");
5
5
  function useCategories() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
6
+ const context = (0, useNewsroomContext_1.useNewsroomContext)();
7
7
  return context.categories;
8
8
  }
9
9
  exports.useCategories = useCategories;
@@ -1 +1 @@
1
- {"version":3,"file":"useCategories.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCategories.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,aAAa;IACzB,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,UAAU,CAAC;AAC9B,CAAC;AAJD,sCAIC"}
1
+ {"version":3,"file":"useCategories.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCategories.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,SAAgB,aAAa;IACzB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,UAAU,CAAC;AAC9B,CAAC;AAJD,sCAIC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCompanyInformation = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
4
+ const useNewsroomContext_1 = require("./useNewsroomContext");
5
5
  function useCompanyInformation() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
6
+ const context = (0, useNewsroomContext_1.useNewsroomContext)();
7
7
  return context.companyInformation;
8
8
  }
9
9
  exports.useCompanyInformation = useCompanyInformation;
@@ -1 +1 @@
1
- {"version":3,"file":"useCompanyInformation.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCompanyInformation.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,qBAAqB;IACjC,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,kBAAkB,CAAC;AACtC,CAAC;AAJD,sDAIC"}
1
+ {"version":3,"file":"useCompanyInformation.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCompanyInformation.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,SAAgB,qBAAqB;IACjC,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,kBAAkB,CAAC;AACtC,CAAC;AAJD,sDAIC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCurrentCategory = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
4
+ const useNewsroomContext_1 = require("./useNewsroomContext");
5
5
  function useCurrentCategory() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
6
+ const context = (0, useNewsroomContext_1.useNewsroomContext)();
7
7
  return context.currentCategory;
8
8
  }
9
9
  exports.useCurrentCategory = useCurrentCategory;
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentCategory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentCategory.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,kBAAkB;IAC9B,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC;AAJD,gDAIC"}
1
+ {"version":3,"file":"useCurrentCategory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentCategory.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,SAAgB,kBAAkB;IAC9B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC;AAJD,gDAIC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCurrentLocale = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
4
+ const useNewsroomContext_1 = require("./useNewsroomContext");
5
5
  function useCurrentLocale() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
6
+ const context = (0, useNewsroomContext_1.useNewsroomContext)();
7
7
  return context.locale;
8
8
  }
9
9
  exports.useCurrentLocale = useCurrentLocale;
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentLocale.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentLocale.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,gBAAgB;IAC5B,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC;AAJD,4CAIC"}
1
+ {"version":3,"file":"useCurrentLocale.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentLocale.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,SAAgB,gBAAgB;IAC5B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC;AAJD,4CAIC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useCurrentStory = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
4
+ const useNewsroomContext_1 = require("./useNewsroomContext");
5
5
  function useCurrentStory() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
6
+ const context = (0, useNewsroomContext_1.useNewsroomContext)();
7
7
  return context.currentStory;
8
8
  }
9
9
  exports.useCurrentStory = useCurrentStory;
@@ -1 +1 @@
1
- {"version":3,"file":"useCurrentStory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentStory.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,eAAe;IAC3B,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,YAAY,CAAC;AAChC,CAAC;AAJD,0CAIC"}
1
+ {"version":3,"file":"useCurrentStory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentStory.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,SAAgB,eAAe;IAC3B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,YAAY,CAAC;AAChC,CAAC;AAJD,0CAIC"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGetLinkLocaleSlug = void 0;
4
- var react_1 = require("react");
5
- var intl_1 = require("../../intl");
6
- var useCurrentLocale_1 = require("./useCurrentLocale");
7
- var useLanguages_1 = require("./useLanguages");
4
+ const react_1 = require("react");
5
+ const intl_1 = require("../../intl");
6
+ const useCurrentLocale_1 = require("./useCurrentLocale");
7
+ const useLanguages_1 = require("./useLanguages");
8
8
  /**
9
9
  * Determines correct locale slug for the link (trying to shorten the locale code if possible).
10
10
  * E.g. if newsroom has a single locale for Dutch (`nl_BE`), it will be shortened to `nl`.
@@ -12,7 +12,7 @@ var useLanguages_1 = require("./useLanguages");
12
12
  * `false` means that a default locale should be used (no locale in URL required).
13
13
  */
14
14
  function getLinkLocaleSlug(languages, locale) {
15
- var shortestLocaleCode = (0, intl_1.getShortestLocaleCode)(languages, locale);
15
+ const shortestLocaleCode = (0, intl_1.getShortestLocaleCode)(languages, locale);
16
16
  // When navigating to default language, we don't append the locale to the URL.
17
17
  if (!shortestLocaleCode) {
18
18
  return shortestLocaleCode;
@@ -20,10 +20,10 @@ function getLinkLocaleSlug(languages, locale) {
20
20
  return intl_1.LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug();
21
21
  }
22
22
  function useGetLinkLocaleSlug() {
23
- var currentLocale = (0, useCurrentLocale_1.useCurrentLocale)();
24
- var languages = (0, useLanguages_1.useLanguages)();
23
+ const currentLocale = (0, useCurrentLocale_1.useCurrentLocale)();
24
+ const languages = (0, useLanguages_1.useLanguages)();
25
25
  // The `locale` parameter is mainly used for Language Dropdown
26
- return (0, react_1.useCallback)(function (locale) { return getLinkLocaleSlug(languages, locale || currentLocale); }, [languages, currentLocale]);
26
+ return (0, react_1.useCallback)((locale) => getLinkLocaleSlug(languages, locale || currentLocale), [languages, currentLocale]);
27
27
  }
28
28
  exports.useGetLinkLocaleSlug = useGetLinkLocaleSlug;
29
29
  //# sourceMappingURL=useGetLinkLocaleSlug.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useGetLinkLocaleSlug.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetLinkLocaleSlug.ts"],"names":[],"mappings":";;;AACA,+BAAoC;AAEpC,mCAAiE;AAEjE,uDAAsD;AACtD,+CAA8C;AAE9C;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,SAAqC,EACrC,MAAoB;IAEpB,IAAM,kBAAkB,GAAG,IAAA,4BAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpE,8EAA8E;IAC9E,IAAI,CAAC,kBAAkB,EAAE;QACrB,OAAO,kBAAkB,CAAC;KAC7B;IAED,OAAO,mBAAY,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,SAAS,EAAE,CAAC;AACpE,CAAC;AAED,SAAgB,oBAAoB;IAChC,IAAM,aAAa,GAAG,IAAA,mCAAgB,GAAE,CAAC;IACzC,IAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAC;IAEjC,8DAA8D;IAC9D,OAAO,IAAA,mBAAW,EACd,UAAC,MAAqB,IAAK,OAAA,iBAAiB,CAAC,SAAS,EAAE,MAAM,IAAI,aAAa,CAAC,EAArD,CAAqD,EAChF,CAAC,SAAS,EAAE,aAAa,CAAC,CAC7B,CAAC;AACN,CAAC;AATD,oDASC"}
1
+ {"version":3,"file":"useGetLinkLocaleSlug.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetLinkLocaleSlug.ts"],"names":[],"mappings":";;;AACA,iCAAoC;AAEpC,qCAAiE;AAEjE,yDAAsD;AACtD,iDAA8C;AAE9C;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,SAAqC,EACrC,MAAoB;IAEpB,MAAM,kBAAkB,GAAG,IAAA,4BAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpE,8EAA8E;IAC9E,IAAI,CAAC,kBAAkB,EAAE;QACrB,OAAO,kBAAkB,CAAC;KAC7B;IAED,OAAO,mBAAY,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,SAAS,EAAE,CAAC;AACpE,CAAC;AAED,SAAgB,oBAAoB;IAChC,MAAM,aAAa,GAAG,IAAA,mCAAgB,GAAE,CAAC;IACzC,MAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAC;IAEjC,8DAA8D;IAC9D,OAAO,IAAA,mBAAW,EACd,CAAC,MAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,IAAI,aAAa,CAAC,EAChF,CAAC,SAAS,EAAE,aAAa,CAAC,CAC7B,CAAC;AACN,CAAC;AATD,oDASC"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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");
4
+ const router_1 = require("next/router");
5
+ const react_1 = require("react");
6
+ const utils_1 = require("../../utils");
7
+ const useCurrentCategory_1 = require("./useCurrentCategory");
8
+ const useCurrentStory_1 = require("./useCurrentStory");
9
9
  // Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
10
10
  var StoryVisibility;
11
11
  (function (StoryVisibility) {
@@ -15,7 +15,7 @@ var StoryVisibility;
15
15
  StoryVisibility["CONFIDENTIAL"] = "confidential";
16
16
  })(StoryVisibility || (StoryVisibility = {}));
17
17
  function getAllowedTranslationVisibilityValues(story) {
18
- var visibility = story.visibility;
18
+ const { visibility } = story;
19
19
  switch (visibility) {
20
20
  case StoryVisibility.EMBARGO:
21
21
  return [StoryVisibility.EMBARGO, StoryVisibility.PUBLIC];
@@ -43,15 +43,12 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
43
43
  }
44
44
  return '/';
45
45
  }
46
- var localeCode = locale.toUnderscoreCode();
46
+ const localeCode = locale.toUnderscoreCode();
47
47
  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
- });
48
+ const allowedVisibilityValues = getAllowedTranslationVisibilityValues(currentStory);
49
+ const translatedStory = currentStory.translations.find(({ culture, visibility }) => culture.locale === localeCode && allowedVisibilityValues.includes(visibility));
53
50
  if (translatedStory) {
54
- return "/".concat(translatedStory.slug);
51
+ return `/${translatedStory.slug}`;
55
52
  }
56
53
  if (noFallback) {
57
54
  return '';
@@ -65,12 +62,10 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
65
62
  * `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
63
  */
67
64
  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]);
65
+ const { asPath } = (0, router_1.useRouter)();
66
+ const currentCategory = (0, useCurrentCategory_1.useCurrentCategory)();
67
+ const currentStory = (0, useCurrentStory_1.useCurrentStory)();
68
+ return (0, react_1.useCallback)((locale, noFallback) => getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback), [asPath, currentCategory, currentStory]);
74
69
  }
75
70
  exports.useGetTranslationUrl = useGetTranslationUrl;
76
71
  //# 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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ClB,OAAA,OAAO,CAAC,MAAM,KAAK,UAAU,IAAI,yBAAuB,CAAC,QAAQ,CAAC,UAAU,CAAC;QAA7E,CAA6E,CACpF,CAAC;QACF,IAAI,eAAe,EAAE;YACjB,OAAO,WAAI,eAAe,CAAC,IAAI,CAAE,CAAC;SACrC;QAED,IAAI,UAAU,EAAE;YACZ,OAAO,EAAE,CAAC;SACb;QAED,OAAO,GAAG,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB;IACxB,IAAA,MAAM,GAAK,IAAA,kBAAS,GAAE,OAAhB,CAAiB;IAC/B,IAAM,eAAe,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAC7C,IAAM,YAAY,GAAG,IAAA,iCAAe,GAAE,CAAC;IAEvC,OAAO,IAAA,mBAAW,EACd,UAAC,MAAoB,EAAE,UAAoB;QACvC,OAAA,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC;IAA5E,CAA4E,EAChF,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAC1C,CAAC;AACN,CAAC;AAVD,oDAUC"}
1
+ {"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":";;;AACA,wCAAwC;AACxC,iCAAoC;AAGpC,uCAAwE;AAExE,6DAA0D;AAC1D,uDAAoD;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;IAC/D,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,QAAQ,UAAU,EAAE;QAChB,KAAK,eAAe,CAAC,OAAO;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;QAED,OAAO,GAAG,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAgB,oBAAoB;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC/B,MAAM,eAAe,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAC7C,MAAM,YAAY,GAAG,IAAA,iCAAe,GAAE,CAAC;IAEvC,OAAO,IAAA,mBAAW,EACd,CAAC,MAAoB,EAAE,UAAoB,EAAE,EAAE,CAC3C,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC,EAChF,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAC1C,CAAC;AACN,CAAC;AAVD,oDAUC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useLanguages = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
4
+ const useNewsroomContext_1 = require("./useNewsroomContext");
5
5
  function useLanguages() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
6
+ const context = (0, useNewsroomContext_1.useNewsroomContext)();
7
7
  return context.languages;
8
8
  }
9
9
  exports.useLanguages = useLanguages;
@@ -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,6DAA0D;AAE1D,SAAgB,YAAY;IACxB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC;AAJD,oCAIC"}
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useNewsroom = void 0;
4
- var useNewsroomContext_1 = require("./useNewsroomContext");
4
+ const useNewsroomContext_1 = require("./useNewsroomContext");
5
5
  function useNewsroom() {
6
- var context = (0, useNewsroomContext_1.useNewsroomContext)();
6
+ const context = (0, useNewsroomContext_1.useNewsroomContext)();
7
7
  return context.newsroom;
8
8
  }
9
9
  exports.useNewsroom = useNewsroom;
@@ -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,6DAA0D;AAE1D,SAAgB,WAAW;IACvB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC;AAJD,kCAIC"}
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useNewsroomContext = void 0;
4
- var react_1 = require("react");
5
- var context_1 = require("../context");
4
+ const react_1 = require("react");
5
+ const context_1 = require("../context");
6
6
  function useNewsroomContext() {
7
7
  // TS Compiler is having a hard time figuring this type implicitly, so we have to set it explicitly
8
8
  // See https://github.com/microsoft/TypeScript/issues/5711#issuecomment-340283439
9
- var newsroomContext = (0, react_1.useContext)(context_1.NewsroomContext);
9
+ const newsroomContext = (0, react_1.useContext)(context_1.NewsroomContext);
10
10
  if (!newsroomContext) {
11
11
  throw new Error('No `NewsroomContextProvider` found when calling `useNewsroomContext`');
12
12
  }
@@ -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,iCAAmC;AAGnC,wCAA6C;AAE7C,SAAgB,kBAAkB;IAC9B,mGAAmG;IACnG,iFAAiF;IACjF,MAAM,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,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSentryClientOptions = void 0;
4
- var common_1 = require("./common");
4
+ const common_1 = require("./common");
5
5
  function getSentryClientOptions(dsn, themeName) {
6
6
  return (0, common_1.getCommonClientOptions)(dsn, themeName);
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/sentry/client.ts"],"names":[],"mappings":";;;AAEA,mCAAkD;AAElD,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,IAAA,+BAAsB,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC;AAFD,wDAEC"}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/sentry/client.ts"],"names":[],"mappings":";;;AAEA,qCAAkD;AAElD,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,IAAA,+BAAsB,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC;AAFD,wDAEC"}
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCommonClientOptions = void 0;
4
4
  function getCommonClientOptions(dsn, themeName) {
5
5
  return {
6
- dsn: dsn,
6
+ dsn,
7
7
  // Adjust this value in production, or use tracesSampler for greater control
8
8
  tracesSampleRate: 0.02,
9
9
  // ...
@@ -19,7 +19,7 @@ function getCommonClientOptions(dsn, themeName) {
19
19
  'Illegal invocation',
20
20
  ],
21
21
  // Attach theme tag to each event
22
- initialScope: function (scope) {
22
+ initialScope: (scope) => {
23
23
  scope.setTags({ prezly_theme: themeName });
24
24
  return scope;
25
25
  },
@@ -1 +1 @@
1
- {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sentry/common.ts"],"names":[],"mappings":";;;AAEA,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO;QACH,GAAG,KAAA;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,UAAC,KAAK;YAChB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;YAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC;AAxBD,wDAwBC"}
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sentry/common.ts"],"names":[],"mappings":";;;AAEA,SAAgB,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;AAxBD,wDAwBC"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSentryServerOptions = void 0;
4
- var common_1 = require("./common");
4
+ const common_1 = require("./common");
5
5
  function getSentryServerOptions(dsn, themeName) {
6
6
  return (0, common_1.getCommonClientOptions)(dsn, themeName);
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/sentry/server.ts"],"names":[],"mappings":";;;AAEA,mCAAkD;AAElD,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,IAAA,+BAAsB,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC;AAFD,wDAEC"}
1
+ {"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/sentry/server.ts"],"names":[],"mappings":";;;AAEA,qCAAkD;AAElD,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,IAAA,+BAAsB,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC;AAFD,wDAEC"}