@prezly/theme-kit-nextjs 1.6.4-3 → 1.7.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 (127) hide show
  1. package/build/adapter-nextjs/getNewsroomServerSideProps.js +63 -9
  2. package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
  3. package/build/adapter-nextjs/index.js +14 -2
  4. package/build/adapter-nextjs/index.js.map +1 -1
  5. package/build/adapter-nextjs/processRequest.js +25 -10
  6. package/build/adapter-nextjs/processRequest.js.map +1 -1
  7. package/build/components-nextjs/PageSeo/PageSeo.js +58 -43
  8. package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
  9. package/build/components-nextjs/PageSeo/index.js +16 -2
  10. package/build/components-nextjs/PageSeo/index.js.map +1 -1
  11. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +6 -2
  12. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
  13. package/build/components-nextjs/PageSeo/lib/types.js +2 -1
  14. package/build/components-nextjs/Sitemap/SitemapBuilder.js +22 -18
  15. package/build/components-nextjs/Sitemap/SitemapBuilder.js.map +1 -1
  16. package/build/components-nextjs/Sitemap/createPaths.js +45 -10
  17. package/build/components-nextjs/Sitemap/createPaths.js.map +1 -1
  18. package/build/components-nextjs/Sitemap/getInitialProps.js +75 -23
  19. package/build/components-nextjs/Sitemap/getInitialProps.js.map +1 -1
  20. package/build/components-nextjs/Sitemap/index.js +20 -4
  21. package/build/components-nextjs/Sitemap/index.js.map +1 -1
  22. package/build/components-nextjs/Sitemap/types.js +2 -1
  23. package/build/components-nextjs/StorySeo/StorySeo.js +34 -26
  24. package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
  25. package/build/components-nextjs/StorySeo/index.js +5 -1
  26. package/build/components-nextjs/StorySeo/index.js.map +1 -1
  27. package/build/components-nextjs/index.js +18 -3
  28. package/build/components-nextjs/index.js.map +1 -1
  29. package/build/data-fetching/api/PrezlyApi.js +297 -132
  30. package/build/data-fetching/api/PrezlyApi.js.map +1 -1
  31. package/build/data-fetching/api/getPrezlyApi.js +9 -5
  32. package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
  33. package/build/data-fetching/api/index.js +14 -2
  34. package/build/data-fetching/api/index.js.map +1 -1
  35. package/build/data-fetching/api/languages.js +85 -43
  36. package/build/data-fetching/api/languages.js.map +1 -1
  37. package/build/data-fetching/api/queries.js +45 -13
  38. package/build/data-fetching/api/queries.js.map +1 -1
  39. package/build/data-fetching/constants.js +5 -2
  40. package/build/data-fetching/constants.js.map +1 -1
  41. package/build/data-fetching/getAssetsUrl.js +7 -3
  42. package/build/data-fetching/getAssetsUrl.js.map +1 -1
  43. package/build/data-fetching/getLocalizedCategoryData.js +32 -15
  44. package/build/data-fetching/getLocalizedCategoryData.js.map +1 -1
  45. package/build/data-fetching/getNewsroomLogoUrl.js +12 -6
  46. package/build/data-fetching/getNewsroomLogoUrl.js.map +1 -1
  47. package/build/data-fetching/getPrivacyPortalUrl.js +7 -3
  48. package/build/data-fetching/getPrivacyPortalUrl.js.map +1 -1
  49. package/build/data-fetching/getStoryPublicationDate.js +6 -2
  50. package/build/data-fetching/getStoryPublicationDate.js.map +1 -1
  51. package/build/data-fetching/getUploadcareGroupUrl.js +7 -3
  52. package/build/data-fetching/getUploadcareGroupUrl.js.map +1 -1
  53. package/build/data-fetching/index.js +22 -10
  54. package/build/data-fetching/index.js.map +1 -1
  55. package/build/data-fetching/lib/getAlgoliaSettings.js +10 -6
  56. package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
  57. package/build/data-fetching/lib/getEnvVariables.js +29 -11
  58. package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
  59. package/build/data-fetching/lib/index.js +5 -1
  60. package/build/data-fetching/lib/index.js.map +1 -1
  61. package/build/data-fetching/types.js +2 -1
  62. package/build/index.js +19 -7
  63. package/build/index.js.map +1 -1
  64. package/build/infinite-loading/apiHandlers/fetchGalleries.js +69 -15
  65. package/build/infinite-loading/apiHandlers/fetchGalleries.js.map +1 -1
  66. package/build/infinite-loading/apiHandlers/fetchStories.js +71 -17
  67. package/build/infinite-loading/apiHandlers/fetchStories.js.map +1 -1
  68. package/build/infinite-loading/apiHandlers/index.js +7 -2
  69. package/build/infinite-loading/apiHandlers/index.js.map +1 -1
  70. package/build/infinite-loading/index.js +21 -5
  71. package/build/infinite-loading/index.js.map +1 -1
  72. package/build/infinite-loading/types.js +2 -1
  73. package/build/infinite-loading/useInfiniteGalleriesLoading.js +83 -25
  74. package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
  75. package/build/infinite-loading/useInfiniteLoading.js +97 -21
  76. package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
  77. package/build/infinite-loading/useInfiniteStoriesLoading.js +99 -36
  78. package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
  79. package/build/intl/index.d.ts +1 -2
  80. package/build/intl/index.js +21 -5
  81. package/build/intl/index.js.map +1 -1
  82. package/build/intl/lang.js +11 -4
  83. package/build/intl/lang.js.map +1 -1
  84. package/build/intl/locale.js +27 -21
  85. package/build/intl/locale.js.map +1 -1
  86. package/build/intl/localeConfig.d.ts +2 -1
  87. package/build/intl/localeConfig.js +30 -8
  88. package/build/intl/localeConfig.js.map +1 -1
  89. package/build/intl/localeList.d.ts +56 -4
  90. package/build/intl/localeList.js +2 -1
  91. package/build/intl/localeList.js.map +1 -1
  92. package/build/intl/localeObject.js +49 -30
  93. package/build/intl/localeObject.js.map +1 -1
  94. package/build/newsroom-context/context.js +34 -18
  95. package/build/newsroom-context/context.js.map +1 -1
  96. package/build/newsroom-context/hooks/index.js +23 -11
  97. package/build/newsroom-context/hooks/index.js.map +1 -1
  98. package/build/newsroom-context/hooks/useAlgoliaSettings.js +7 -3
  99. package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
  100. package/build/newsroom-context/hooks/useCategories.js +7 -3
  101. package/build/newsroom-context/hooks/useCategories.js.map +1 -1
  102. package/build/newsroom-context/hooks/useCompanyInformation.js +7 -3
  103. package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
  104. package/build/newsroom-context/hooks/useCurrentCategory.js +7 -3
  105. package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
  106. package/build/newsroom-context/hooks/useCurrentLocale.js +7 -3
  107. package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
  108. package/build/newsroom-context/hooks/useCurrentStory.js +7 -3
  109. package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
  110. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +15 -11
  111. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
  112. package/build/newsroom-context/hooks/useGetTranslationUrl.js +24 -15
  113. package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
  114. package/build/newsroom-context/hooks/useLanguages.js +7 -3
  115. package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
  116. package/build/newsroom-context/hooks/useNewsroom.js +7 -3
  117. package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
  118. package/build/newsroom-context/hooks/useNewsroomContext.js +8 -4
  119. package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
  120. package/build/newsroom-context/index.js +17 -2
  121. package/build/newsroom-context/index.js.map +1 -1
  122. package/build/types.js +2 -1
  123. package/package.json +3 -5
  124. package/src/intl/index.ts +1 -2
  125. package/src/intl/{localeConfig.ts → localeConfig.js} +3 -3
  126. package/src/intl/{localeList.ts → localeList.js} +1 -1
  127. package/src/intl/localeObject.ts +1 -1
@@ -1,3 +1,18 @@
1
- export { NewsroomContext, NewsroomContextProvider } from './context';
2
- export * from './hooks';
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);
3
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
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"}
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"}
package/build/types.js CHANGED
@@ -1,2 +1,3 @@
1
- export {};
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
2
3
  //# 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-3",
3
+ "version": "1.7.0",
4
4
  "description": "Data layer and utility library for developing Prezly themes with NextJS",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -8,7 +8,6 @@
8
8
  "build",
9
9
  "src"
10
10
  ],
11
- "type": "module",
12
11
  "engines": {
13
12
  "node": ">= 14.x",
14
13
  "npm": ">= 7.x"
@@ -53,7 +52,7 @@
53
52
  "@react-hookz/web": "^13.2.1",
54
53
  "next-seo": "^5.4.0",
55
54
  "parse-data-url": "^4.0.1",
56
- "string-strip-html": "^9.1.9"
55
+ "string-strip-html": "^8.3.0"
57
56
  },
58
57
  "devDependencies": {
59
58
  "@prezly/eslint-config": "^4.0.0",
@@ -69,6 +68,5 @@
69
68
  },
70
69
  "publishConfig": {
71
70
  "access": "public"
72
- },
73
- "prettier": "@prezly/eslint-config/prettier"
71
+ }
74
72
  }
package/src/intl/index.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './lang';
2
2
  export * from './locale';
3
- export { localeConfig } from './localeConfig';
4
- export { localeList } from './localeList';
3
+ export { default as localeConfig } from './localeConfig';
5
4
  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
- import { localeList } from './localeList';
6
+ const supportedLocales = require('./localeList');
7
7
 
8
- const lowercaseLocales = localeList.map((l) => l.toLowerCase());
8
+ const lowercaseLocales = supportedLocales.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
- export const localeConfig = lowercaseLocalPermutations;
19
+ module.exports = 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
- export const localeList = [
4
+ module.exports = [
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.