@prezly/theme-kit-nextjs 2.0.1-1 → 2.0.1-2

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 (87) hide show
  1. package/build/@types/global.d.js +1 -1
  2. package/build/adapter-nextjs/api-handlers/fetchGalleries.js +3 -9
  3. package/build/adapter-nextjs/api-handlers/fetchStories.js +3 -9
  4. package/build/adapter-nextjs/api-handlers/index.js +2 -19
  5. package/build/adapter-nextjs/getNewsroomServerSideProps.js +3 -9
  6. package/build/adapter-nextjs/getNewsroomStaticProps.js +3 -9
  7. package/build/adapter-nextjs/index.js +6 -71
  8. package/build/adapter-nextjs/page-props/category.js +19 -27
  9. package/build/adapter-nextjs/page-props/gallery.js +13 -20
  10. package/build/adapter-nextjs/page-props/galleryAlbum.js +13 -21
  11. package/build/adapter-nextjs/page-props/home.js +13 -20
  12. package/build/adapter-nextjs/page-props/index.js +8 -138
  13. package/build/adapter-nextjs/page-props/lib/types.js +1 -1
  14. package/build/adapter-nextjs/page-props/search.js +10 -17
  15. package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +2 -9
  16. package/build/adapter-nextjs/page-props/sitemap/createPaths.js +1 -7
  17. package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +7 -13
  18. package/build/adapter-nextjs/page-props/sitemap/index.js +4 -43
  19. package/build/adapter-nextjs/page-props/sitemap/types.js +1 -1
  20. package/build/adapter-nextjs/page-props/story.js +17 -25
  21. package/build/adapter-nextjs/page-props/storyPreview.js +7 -13
  22. package/build/adapter-nextjs/processRequest.js +5 -11
  23. package/build/adapter-nextjs/processStaticRequest.js +1 -7
  24. package/build/components-nextjs/PageSeo/PageSeo.js +24 -30
  25. package/build/components-nextjs/PageSeo/index.js +2 -27
  26. package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -7
  27. package/build/components-nextjs/PageSeo/lib/types.js +1 -1
  28. package/build/components-nextjs/StorySeo/StorySeo.js +6 -12
  29. package/build/components-nextjs/StorySeo/index.js +1 -12
  30. package/build/components-nextjs/document.d.ts +4 -2
  31. package/build/components-nextjs/document.js +13 -19
  32. package/build/components-nextjs/document.js.map +1 -1
  33. package/build/components-nextjs/index.js +3 -26
  34. package/build/data-fetching/api/PrezlyApi.js +30 -37
  35. package/build/data-fetching/api/getPrezlyApi.js +5 -11
  36. package/build/data-fetching/api/index.js +1 -16
  37. package/build/data-fetching/api/queries.js +5 -15
  38. package/build/data-fetching/index.js +3 -38
  39. package/build/data-fetching/lib/getAlgoliaSettings.js +3 -9
  40. package/build/data-fetching/lib/getEnvVariables.js +3 -10
  41. package/build/data-fetching/lib/index.js +4 -33
  42. package/build/data-fetching/lib/isSdkError.js +1 -7
  43. package/build/data-fetching/lib/isUuid.js +1 -7
  44. package/build/data-fetching/types.js +1 -1
  45. package/build/index.js +9 -104
  46. package/build/infinite-loading/index.js +4 -43
  47. package/build/infinite-loading/types.js +1 -1
  48. package/build/infinite-loading/useInfiniteGalleriesLoading.js +3 -9
  49. package/build/infinite-loading/useInfiniteLoading.js +9 -15
  50. package/build/infinite-loading/useInfiniteStoriesLoading.js +7 -13
  51. package/build/intl/index.js +4 -49
  52. package/build/intl/languages.js +23 -39
  53. package/build/intl/locale.js +10 -20
  54. package/build/intl/localeConfig.js +5 -14
  55. package/build/intl/localeList.js +1 -8
  56. package/build/intl/localeObject.js +4 -11
  57. package/build/newsroom-context/context.js +5 -13
  58. package/build/newsroom-context/hooks/index.js +11 -126
  59. package/build/newsroom-context/hooks/useAlgoliaSettings.js +3 -9
  60. package/build/newsroom-context/hooks/useCategories.js +3 -9
  61. package/build/newsroom-context/hooks/useCompanyInformation.js +3 -9
  62. package/build/newsroom-context/hooks/useCurrentCategory.js +3 -9
  63. package/build/newsroom-context/hooks/useCurrentLocale.js +3 -9
  64. package/build/newsroom-context/hooks/useCurrentStory.js +3 -9
  65. package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +10 -16
  66. package/build/newsroom-context/hooks/useGetTranslationUrl.js +20 -26
  67. package/build/newsroom-context/hooks/useLanguages.js +3 -9
  68. package/build/newsroom-context/hooks/useNewsroom.js +3 -9
  69. package/build/newsroom-context/hooks/useNewsroomContext.js +4 -10
  70. package/build/newsroom-context/index.js +2 -34
  71. package/build/sentry/client.js +3 -9
  72. package/build/sentry/common.js +1 -7
  73. package/build/sentry/index.js +2 -19
  74. package/build/sentry/server.js +3 -9
  75. package/build/types.js +1 -1
  76. package/build/utils/boilerplate.js +3 -11
  77. package/build/utils/constants.js +3 -12
  78. package/build/utils/getAssetsUrl.js +3 -9
  79. package/build/utils/getDataRequestLink.js +3 -9
  80. package/build/utils/getLocalizedCategoryData.js +3 -11
  81. package/build/utils/getNewsroomLogoUrl.js +5 -12
  82. package/build/utils/getPrivacyPortalUrl.js +1 -7
  83. package/build/utils/getStoryPublicationDate.js +1 -7
  84. package/build/utils/getUploadcareGroupUrl.js +3 -9
  85. package/build/utils/index.js +10 -115
  86. package/build/utils/isEmbargoStory.js +1 -7
  87. package/package.json +3 -2
@@ -1,115 +1,10 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _boilerplate = require("./boilerplate.js");
7
- Object.keys(_boilerplate).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _boilerplate[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _boilerplate[key];
14
- }
15
- });
16
- });
17
- var _constants = require("./constants.js");
18
- Object.keys(_constants).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _constants[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _constants[key];
25
- }
26
- });
27
- });
28
- var _getAssetsUrl = require("./getAssetsUrl.js");
29
- Object.keys(_getAssetsUrl).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _getAssetsUrl[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _getAssetsUrl[key];
36
- }
37
- });
38
- });
39
- var _getDataRequestLink = require("./getDataRequestLink.js");
40
- Object.keys(_getDataRequestLink).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _getDataRequestLink[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function () {
46
- return _getDataRequestLink[key];
47
- }
48
- });
49
- });
50
- var _getLocalizedCategoryData = require("./getLocalizedCategoryData.js");
51
- Object.keys(_getLocalizedCategoryData).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _getLocalizedCategoryData[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function () {
57
- return _getLocalizedCategoryData[key];
58
- }
59
- });
60
- });
61
- var _getNewsroomLogoUrl = require("./getNewsroomLogoUrl.js");
62
- Object.keys(_getNewsroomLogoUrl).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _getNewsroomLogoUrl[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function () {
68
- return _getNewsroomLogoUrl[key];
69
- }
70
- });
71
- });
72
- var _getPrivacyPortalUrl = require("./getPrivacyPortalUrl.js");
73
- Object.keys(_getPrivacyPortalUrl).forEach(function (key) {
74
- if (key === "default" || key === "__esModule") return;
75
- if (key in exports && exports[key] === _getPrivacyPortalUrl[key]) return;
76
- Object.defineProperty(exports, key, {
77
- enumerable: true,
78
- get: function () {
79
- return _getPrivacyPortalUrl[key];
80
- }
81
- });
82
- });
83
- var _getStoryPublicationDate = require("./getStoryPublicationDate.js");
84
- Object.keys(_getStoryPublicationDate).forEach(function (key) {
85
- if (key === "default" || key === "__esModule") return;
86
- if (key in exports && exports[key] === _getStoryPublicationDate[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function () {
90
- return _getStoryPublicationDate[key];
91
- }
92
- });
93
- });
94
- var _getUploadcareGroupUrl = require("./getUploadcareGroupUrl.js");
95
- Object.keys(_getUploadcareGroupUrl).forEach(function (key) {
96
- if (key === "default" || key === "__esModule") return;
97
- if (key in exports && exports[key] === _getUploadcareGroupUrl[key]) return;
98
- Object.defineProperty(exports, key, {
99
- enumerable: true,
100
- get: function () {
101
- return _getUploadcareGroupUrl[key];
102
- }
103
- });
104
- });
105
- var _isEmbargoStory = require("./isEmbargoStory.js");
106
- Object.keys(_isEmbargoStory).forEach(function (key) {
107
- if (key === "default" || key === "__esModule") return;
108
- if (key in exports && exports[key] === _isEmbargoStory[key]) return;
109
- Object.defineProperty(exports, key, {
110
- enumerable: true,
111
- get: function () {
112
- return _isEmbargoStory[key];
113
- }
114
- });
115
- });
1
+ export * from "./boilerplate.js";
2
+ export * from "./constants.js";
3
+ export * from "./getAssetsUrl.js";
4
+ export * from "./getDataRequestLink.js";
5
+ export * from "./getLocalizedCategoryData.js";
6
+ export * from "./getNewsroomLogoUrl.js";
7
+ export * from "./getPrivacyPortalUrl.js";
8
+ export * from "./getStoryPublicationDate.js";
9
+ export * from "./getUploadcareGroupUrl.js";
10
+ export * from "./isEmbargoStory.js";
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.isEmbargoStory = isEmbargoStory;
7
- function isEmbargoStory(story) {
1
+ export function isEmbargoStory(story) {
8
2
  return story.is_embargo && Boolean(story.published_at);
9
3
  }
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@prezly/theme-kit-nextjs",
3
- "version": "2.0.1-1",
3
+ "version": "2.0.1-2",
4
4
  "description": "Data layer and utility library for developing Prezly themes with NextJS",
5
+ "type": "module",
5
6
  "main": "build/index.js",
6
7
  "types": "build/index.d.ts",
7
8
  "exports": {
@@ -40,7 +41,7 @@
40
41
  "build:types": "tsc --project .",
41
42
  "build:es": "babel ./src --ignore='**/*.test.ts','**/__mocks__/**' --config-file=./babel.config.json --extensions=.ts,.tsx --source-root=./src --out-dir=./build",
42
43
  "watch": "tsc --watch --preserveWatchOutput --project .",
43
- "test": "jest",
44
+ "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
44
45
  "typecheck": "tsc --noEmit --incremental --project .",
45
46
  "lint": "eslint src",
46
47
  "lint:fix": "npm run lint -- --fix",