@prezly/theme-kit-nextjs 1.6.4-0 → 1.6.4-3

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 (127) hide show
  1. package/build/adapter-nextjs/getNewsroomServerSideProps.js +9 -63
  2. package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
  3. package/build/adapter-nextjs/index.js +2 -14
  4. package/build/adapter-nextjs/index.js.map +1 -1
  5. package/build/adapter-nextjs/processRequest.js +10 -25
  6. package/build/adapter-nextjs/processRequest.js.map +1 -1
  7. package/build/components-nextjs/PageSeo/PageSeo.js +43 -58
  8. package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
  9. package/build/components-nextjs/PageSeo/index.js +2 -16
  10. package/build/components-nextjs/PageSeo/index.js.map +1 -1
  11. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +2 -6
  12. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
  13. package/build/components-nextjs/PageSeo/lib/types.js +1 -2
  14. package/build/components-nextjs/Sitemap/SitemapBuilder.js +18 -22
  15. package/build/components-nextjs/Sitemap/SitemapBuilder.js.map +1 -1
  16. package/build/components-nextjs/Sitemap/createPaths.js +10 -45
  17. package/build/components-nextjs/Sitemap/createPaths.js.map +1 -1
  18. package/build/components-nextjs/Sitemap/getInitialProps.js +23 -75
  19. package/build/components-nextjs/Sitemap/getInitialProps.js.map +1 -1
  20. package/build/components-nextjs/Sitemap/index.js +4 -20
  21. package/build/components-nextjs/Sitemap/index.js.map +1 -1
  22. package/build/components-nextjs/Sitemap/types.js +1 -2
  23. package/build/components-nextjs/StorySeo/StorySeo.js +26 -34
  24. package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
  25. package/build/components-nextjs/StorySeo/index.js +1 -5
  26. package/build/components-nextjs/StorySeo/index.js.map +1 -1
  27. package/build/components-nextjs/index.js +3 -18
  28. package/build/components-nextjs/index.js.map +1 -1
  29. package/build/data-fetching/api/PrezlyApi.js +132 -297
  30. package/build/data-fetching/api/PrezlyApi.js.map +1 -1
  31. package/build/data-fetching/api/getPrezlyApi.js +5 -9
  32. package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
  33. package/build/data-fetching/api/index.js +2 -14
  34. package/build/data-fetching/api/index.js.map +1 -1
  35. package/build/data-fetching/api/languages.js +43 -85
  36. package/build/data-fetching/api/languages.js.map +1 -1
  37. package/build/data-fetching/api/queries.js +13 -45
  38. package/build/data-fetching/api/queries.js.map +1 -1
  39. package/build/data-fetching/constants.js +2 -5
  40. package/build/data-fetching/constants.js.map +1 -1
  41. package/build/data-fetching/getAssetsUrl.js +3 -7
  42. package/build/data-fetching/getAssetsUrl.js.map +1 -1
  43. package/build/data-fetching/getLocalizedCategoryData.js +15 -32
  44. package/build/data-fetching/getLocalizedCategoryData.js.map +1 -1
  45. package/build/data-fetching/getNewsroomLogoUrl.js +6 -12
  46. package/build/data-fetching/getNewsroomLogoUrl.js.map +1 -1
  47. package/build/data-fetching/getPrivacyPortalUrl.js +3 -7
  48. package/build/data-fetching/getPrivacyPortalUrl.js.map +1 -1
  49. package/build/data-fetching/getStoryPublicationDate.js +2 -6
  50. package/build/data-fetching/getStoryPublicationDate.js.map +1 -1
  51. package/build/data-fetching/getUploadcareGroupUrl.js +3 -7
  52. package/build/data-fetching/getUploadcareGroupUrl.js.map +1 -1
  53. package/build/data-fetching/index.js +10 -22
  54. package/build/data-fetching/index.js.map +1 -1
  55. package/build/data-fetching/lib/getAlgoliaSettings.js +6 -10
  56. package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
  57. package/build/data-fetching/lib/getEnvVariables.js +11 -29
  58. package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
  59. package/build/data-fetching/lib/index.js +1 -5
  60. package/build/data-fetching/lib/index.js.map +1 -1
  61. package/build/data-fetching/types.js +1 -2
  62. package/build/index.js +7 -19
  63. package/build/index.js.map +1 -1
  64. package/build/infinite-loading/apiHandlers/fetchGalleries.js +15 -69
  65. package/build/infinite-loading/apiHandlers/fetchGalleries.js.map +1 -1
  66. package/build/infinite-loading/apiHandlers/fetchStories.js +17 -71
  67. package/build/infinite-loading/apiHandlers/fetchStories.js.map +1 -1
  68. package/build/infinite-loading/apiHandlers/index.js +2 -7
  69. package/build/infinite-loading/apiHandlers/index.js.map +1 -1
  70. package/build/infinite-loading/index.js +5 -21
  71. package/build/infinite-loading/index.js.map +1 -1
  72. package/build/infinite-loading/types.js +1 -2
  73. package/build/infinite-loading/useInfiniteGalleriesLoading.js +25 -83
  74. package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
  75. package/build/infinite-loading/useInfiniteLoading.js +21 -97
  76. package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
  77. package/build/infinite-loading/useInfiniteStoriesLoading.js +36 -99
  78. package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
  79. package/build/intl/index.d.ts +2 -1
  80. package/build/intl/index.js +5 -21
  81. package/build/intl/index.js.map +1 -1
  82. package/build/intl/lang.js +4 -11
  83. package/build/intl/lang.js.map +1 -1
  84. package/build/intl/locale.js +21 -27
  85. package/build/intl/locale.js.map +1 -1
  86. package/build/intl/localeConfig.d.ts +1 -2
  87. package/build/intl/localeConfig.js +8 -30
  88. package/build/intl/localeConfig.js.map +1 -1
  89. package/build/intl/localeList.d.ts +4 -56
  90. package/build/intl/localeList.js +1 -2
  91. package/build/intl/localeList.js.map +1 -1
  92. package/build/intl/localeObject.js +30 -49
  93. package/build/intl/localeObject.js.map +1 -1
  94. package/build/newsroom-context/context.js +18 -34
  95. package/build/newsroom-context/context.js.map +1 -1
  96. package/build/newsroom-context/hooks/index.js +11 -23
  97. package/build/newsroom-context/hooks/index.js.map +1 -1
  98. package/build/newsroom-context/hooks/useAlgoliaSettings.js +3 -7
  99. package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
  100. package/build/newsroom-context/hooks/useCategories.js +3 -7
  101. package/build/newsroom-context/hooks/useCategories.js.map +1 -1
  102. package/build/newsroom-context/hooks/useCompanyInformation.js +3 -7
  103. package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
  104. package/build/newsroom-context/hooks/useCurrentCategory.js +3 -7
  105. package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
  106. package/build/newsroom-context/hooks/useCurrentLocale.js +3 -7
  107. package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
  108. package/build/newsroom-context/hooks/useCurrentStory.js +3 -7
  109. package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
  110. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +11 -15
  111. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
  112. package/build/newsroom-context/hooks/useGetTranslationUrl.js +15 -24
  113. package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
  114. package/build/newsroom-context/hooks/useLanguages.js +3 -7
  115. package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
  116. package/build/newsroom-context/hooks/useNewsroom.js +3 -7
  117. package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
  118. package/build/newsroom-context/hooks/useNewsroomContext.js +4 -8
  119. package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
  120. package/build/newsroom-context/index.js +2 -17
  121. package/build/newsroom-context/index.js.map +1 -1
  122. package/build/types.js +1 -2
  123. package/package.json +4 -2
  124. package/src/intl/index.ts +2 -1
  125. package/src/intl/{localeConfig.js → localeConfig.ts} +3 -3
  126. package/src/intl/{localeList.js → localeList.ts} +1 -1
  127. package/src/intl/localeObject.ts +1 -1
@@ -1,18 +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
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
- }) : (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- o[k2] = m[k];
8
- }));
9
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
- };
12
- Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.NewsroomContextProvider = exports.NewsroomContext = void 0;
14
- var context_1 = require("./context");
15
- Object.defineProperty(exports, "NewsroomContext", { enumerable: true, get: function () { return context_1.NewsroomContext; } });
16
- Object.defineProperty(exports, "NewsroomContextProvider", { enumerable: true, get: function () { return context_1.NewsroomContextProvider; } });
17
- __exportStar(require("./hooks"), exports);
1
+ export { NewsroomContext, NewsroomContextProvider } from './context';
2
+ export * from './hooks';
18
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"}
package/build/types.js CHANGED
@@ -1,3 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
3
2
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/theme-kit-nextjs",
3
- "version": "1.6.4-0",
3
+ "version": "1.6.4-3",
4
4
  "description": "Data layer and utility library for developing Prezly themes with NextJS",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -8,6 +8,7 @@
8
8
  "build",
9
9
  "src"
10
10
  ],
11
+ "type": "module",
11
12
  "engines": {
12
13
  "node": ">= 14.x",
13
14
  "npm": ">= 7.x"
@@ -68,5 +69,6 @@
68
69
  },
69
70
  "publishConfig": {
70
71
  "access": "public"
71
- }
72
+ },
73
+ "prettier": "@prezly/eslint-config/prettier"
72
74
  }
package/src/intl/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './lang';
2
2
  export * from './locale';
3
- export { default as localeConfig } from './localeConfig';
3
+ export { localeConfig } from './localeConfig';
4
+ export { localeList } from './localeList';
4
5
  export * from './localeObject';
@@ -3,9 +3,9 @@
3
3
  * Together with permutation performed lower in the code,
4
4
  * the exported list represents all of the possible locale codes that Next.js theme application might accept.
5
5
  */
6
- const supportedLocales = require('./localeList');
6
+ import { localeList } from './localeList';
7
7
 
8
- const lowercaseLocales = supportedLocales.map((l) => l.toLowerCase());
8
+ const lowercaseLocales = localeList.map((l) => l.toLowerCase());
9
9
 
10
10
  // Get all permutations for the shorter locale codes supported by Prezly (e.g. short region codes and neutral language codes)
11
11
  const lowercaseLocalPermutations = Array.from(
@@ -16,4 +16,4 @@ const lowercaseLocalPermutations = Array.from(
16
16
  ]),
17
17
  ).sort();
18
18
 
19
- module.exports = lowercaseLocalPermutations;
19
+ export const localeConfig = lowercaseLocalPermutations;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This list is pulled from the main Prezly application. The underscores are replaced with dashes.
3
3
  */
4
- module.exports = [
4
+ export const localeList = [
5
5
  'af-ZA',
6
6
  'ar',
7
7
  'ar-AE',
@@ -1,4 +1,4 @@
1
- import localeConfig from './localeConfig';
1
+ import { localeConfig } from './localeConfig';
2
2
 
3
3
  /**
4
4
  * This class is created to simplify working with locales and transforming between different locale code formats.