@prezly/theme-kit-nextjs 2.0.1-0 → 2.0.1-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.
- package/build/@types/global.d.js +1 -1
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +9 -3
- package/build/adapter-nextjs/api-handlers/fetchStories.js +9 -3
- package/build/adapter-nextjs/api-handlers/index.js +19 -2
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +9 -3
- package/build/adapter-nextjs/getNewsroomStaticProps.js +9 -3
- package/build/adapter-nextjs/index.js +71 -6
- package/build/adapter-nextjs/page-props/category.js +27 -19
- package/build/adapter-nextjs/page-props/gallery.js +20 -13
- package/build/adapter-nextjs/page-props/galleryAlbum.js +21 -13
- package/build/adapter-nextjs/page-props/home.js +20 -13
- package/build/adapter-nextjs/page-props/index.js +138 -8
- package/build/adapter-nextjs/page-props/lib/types.js +1 -1
- package/build/adapter-nextjs/page-props/search.js +17 -10
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +9 -2
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +7 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +13 -7
- package/build/adapter-nextjs/page-props/sitemap/index.js +43 -4
- package/build/adapter-nextjs/page-props/sitemap/types.js +1 -1
- package/build/adapter-nextjs/page-props/story.js +25 -17
- package/build/adapter-nextjs/page-props/storyPreview.js +13 -7
- package/build/adapter-nextjs/processRequest.js +11 -5
- package/build/adapter-nextjs/processStaticRequest.js +7 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +30 -24
- package/build/components-nextjs/PageSeo/index.js +27 -2
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +7 -1
- package/build/components-nextjs/PageSeo/lib/types.js +1 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +12 -6
- package/build/components-nextjs/StorySeo/index.js +12 -1
- package/build/components-nextjs/document.js +19 -10
- package/build/components-nextjs/index.js +26 -3
- package/build/data-fetching/api/PrezlyApi.js +37 -30
- package/build/data-fetching/api/getPrezlyApi.js +11 -5
- package/build/data-fetching/api/index.js +16 -1
- package/build/data-fetching/api/queries.js +15 -5
- package/build/data-fetching/index.js +38 -3
- package/build/data-fetching/lib/getAlgoliaSettings.js +9 -3
- package/build/data-fetching/lib/getEnvVariables.js +10 -3
- package/build/data-fetching/lib/index.js +33 -4
- package/build/data-fetching/lib/isSdkError.js +7 -1
- package/build/data-fetching/lib/isUuid.js +7 -1
- package/build/data-fetching/types.js +1 -1
- package/build/index.js +104 -9
- package/build/infinite-loading/index.js +43 -4
- package/build/infinite-loading/types.js +1 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +9 -3
- package/build/infinite-loading/useInfiniteLoading.js +15 -9
- package/build/infinite-loading/useInfiniteStoriesLoading.js +13 -7
- package/build/intl/index.js +49 -4
- package/build/intl/languages.js +39 -23
- package/build/intl/locale.js +20 -10
- package/build/intl/localeConfig.js +14 -5
- package/build/intl/localeList.js +8 -1
- package/build/intl/localeObject.js +11 -4
- package/build/newsroom-context/context.js +13 -5
- package/build/newsroom-context/hooks/index.js +126 -11
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +9 -3
- package/build/newsroom-context/hooks/useCategories.js +9 -3
- package/build/newsroom-context/hooks/useCompanyInformation.js +9 -3
- package/build/newsroom-context/hooks/useCurrentCategory.js +9 -3
- package/build/newsroom-context/hooks/useCurrentLocale.js +9 -3
- package/build/newsroom-context/hooks/useCurrentStory.js +9 -3
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +16 -10
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +26 -20
- package/build/newsroom-context/hooks/useLanguages.js +9 -3
- package/build/newsroom-context/hooks/useNewsroom.js +9 -3
- package/build/newsroom-context/hooks/useNewsroomContext.js +10 -4
- package/build/newsroom-context/index.js +34 -2
- package/build/sentry/client.js +9 -3
- package/build/sentry/common.js +7 -1
- package/build/sentry/index.js +19 -2
- package/build/sentry/server.js +9 -3
- package/build/types.js +1 -1
- package/build/utils/boilerplate.js +11 -3
- package/build/utils/constants.js +12 -3
- package/build/utils/getAssetsUrl.js +9 -3
- package/build/utils/getDataRequestLink.js +9 -3
- package/build/utils/getLocalizedCategoryData.js +11 -3
- package/build/utils/getNewsroomLogoUrl.js +12 -5
- package/build/utils/getPrivacyPortalUrl.js +7 -1
- package/build/utils/getStoryPublicationDate.js +7 -1
- package/build/utils/getUploadcareGroupUrl.js +9 -3
- package/build/utils/index.js +115 -10
- package/build/utils/isEmbargoStory.js +7 -1
- package/package.json +2 -3
package/build/utils/index.js
CHANGED
|
@@ -1,10 +1,115 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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,3 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.isEmbargoStory = isEmbargoStory;
|
|
7
|
+
function isEmbargoStory(story) {
|
|
2
8
|
return story.is_embargo && Boolean(story.published_at);
|
|
3
9
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/theme-kit-nextjs",
|
|
3
|
-
"version": "2.0.1-
|
|
3
|
+
"version": "2.0.1-1",
|
|
4
4
|
"description": "Data layer and utility library for developing Prezly themes with NextJS",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"main": "build/index.js",
|
|
7
6
|
"types": "build/index.d.ts",
|
|
8
7
|
"exports": {
|
|
@@ -41,7 +40,7 @@
|
|
|
41
40
|
"build:types": "tsc --project .",
|
|
42
41
|
"build:es": "babel ./src --ignore='**/*.test.ts','**/__mocks__/**' --config-file=./babel.config.json --extensions=.ts,.tsx --source-root=./src --out-dir=./build",
|
|
43
42
|
"watch": "tsc --watch --preserveWatchOutput --project .",
|
|
44
|
-
"test": "
|
|
43
|
+
"test": "jest",
|
|
45
44
|
"typecheck": "tsc --noEmit --incremental --project .",
|
|
46
45
|
"lint": "eslint src",
|
|
47
46
|
"lint:fix": "npm run lint -- --fix",
|