@prezly/theme-kit-nextjs 1.16.0-1 → 1.16.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/adapter-nextjs/api-handlers/fetchGalleries.js +7 -3
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +7 -3
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/index.js +7 -2
- package/build/adapter-nextjs/api-handlers/index.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +7 -3
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +7 -3
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/index.js +22 -6
- package/build/adapter-nextjs/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/category.js +27 -27
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +18 -13
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +19 -13
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
- package/build/adapter-nextjs/page-props/home.js +18 -13
- package/build/adapter-nextjs/page-props/home.js.map +1 -1
- package/build/adapter-nextjs/page-props/index.js +41 -8
- package/build/adapter-nextjs/page-props/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/lib/types.js +2 -1
- package/build/adapter-nextjs/page-props/search.js +15 -10
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +5 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +5 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +11 -7
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/index.js +24 -4
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/types.js +2 -1
- package/build/adapter-nextjs/page-props/story.js +25 -25
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +12 -11
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +9 -5
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +5 -1
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +28 -24
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/index.js +20 -2
- package/build/components-nextjs/PageSeo/index.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +5 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/types.js +2 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +11 -7
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/components-nextjs/StorySeo/index.js +5 -1
- package/build/components-nextjs/StorySeo/index.js.map +1 -1
- package/build/components-nextjs/document.js +35 -8
- package/build/components-nextjs/document.js.map +1 -1
- package/build/components-nextjs/index.js +9 -3
- package/build/components-nextjs/index.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.js +36 -29
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +9 -5
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/index.js +17 -1
- package/build/data-fetching/api/index.js.map +1 -1
- package/build/data-fetching/api/queries.js +13 -5
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/index.js +19 -3
- package/build/data-fetching/index.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +7 -3
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +10 -3
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/index.js +11 -4
- package/build/data-fetching/lib/index.js.map +1 -1
- package/build/data-fetching/lib/isSdkError.js +5 -1
- package/build/data-fetching/lib/isSdkError.js.map +1 -1
- package/build/data-fetching/lib/isUuid.js +5 -1
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/data-fetching/types.js +2 -1
- package/build/index.js +25 -9
- package/build/index.js.map +1 -1
- package/build/infinite-loading/index.js +24 -4
- package/build/infinite-loading/index.js.map +1 -1
- package/build/infinite-loading/types.js +2 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +7 -3
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +13 -9
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.js +11 -7
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/index.js +25 -4
- package/build/intl/index.js.map +1 -1
- package/build/intl/languages.js +35 -22
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.js +17 -11
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeObject.js +10 -3
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +11 -7
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/index.js +27 -11
- package/build/newsroom-context/hooks/index.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +7 -3
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
- package/build/newsroom-context/hooks/useCategories.js +7 -3
- package/build/newsroom-context/hooks/useCategories.js.map +1 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +7 -3
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +7 -3
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +7 -3
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +7 -3
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +14 -10
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +16 -12
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/newsroom-context/hooks/useLanguages.js +7 -3
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroom.js +7 -3
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js +8 -4
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
- package/build/newsroom-context/index.js +21 -2
- package/build/newsroom-context/index.js.map +1 -1
- package/build/sentry/client.js +7 -3
- package/build/sentry/client.js.map +1 -1
- package/build/sentry/common.js +5 -1
- package/build/sentry/common.js.map +1 -1
- package/build/sentry/index.js +7 -2
- package/build/sentry/index.js.map +1 -1
- package/build/sentry/server.js +7 -3
- package/build/sentry/server.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types.js +2 -1
- package/build/utils/boilerplate.js +9 -3
- package/build/utils/boilerplate.js.map +1 -1
- package/build/utils/constants.js +6 -3
- package/build/utils/constants.js.map +1 -1
- package/build/utils/getAssetsUrl.js +7 -3
- package/build/utils/getAssetsUrl.js.map +1 -1
- package/build/utils/getDataRequestLink.js +7 -3
- package/build/utils/getDataRequestLink.js.map +1 -1
- package/build/utils/getLocalizedCategoryData.js +9 -3
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +10 -5
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +5 -1
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +5 -1
- package/build/utils/getStoryPublicationDate.js.map +1 -1
- package/build/utils/getUploadcareGroupUrl.js +7 -3
- package/build/utils/getUploadcareGroupUrl.js.map +1 -1
- package/build/utils/index.js +26 -10
- package/build/utils/index.js.map +1 -1
- package/build/utils/isEmbargoStory.js +5 -1
- package/build/utils/isEmbargoStory.js.map +1 -1
- package/package.json +2 -2
- package/src/adapter-nextjs/page-props/category.ts +4 -8
- package/src/adapter-nextjs/page-props/story.ts +4 -8
- package/src/adapter-nextjs/page-props/storyPreview.ts +2 -4
package/build/types.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasAnyContactInformation = exports.hasAnyAboutInformation = exports.hasAnySocialMedia = void 0;
|
|
4
|
+
function hasAnySocialMedia(companyInformation) {
|
|
2
5
|
return Boolean(companyInformation.facebook ||
|
|
3
6
|
companyInformation.instagram ||
|
|
4
7
|
companyInformation.linkedin ||
|
|
@@ -7,12 +10,15 @@ export function hasAnySocialMedia(companyInformation) {
|
|
|
7
10
|
companyInformation.twitter ||
|
|
8
11
|
companyInformation.youtube);
|
|
9
12
|
}
|
|
10
|
-
|
|
13
|
+
exports.hasAnySocialMedia = hasAnySocialMedia;
|
|
14
|
+
function hasAnyAboutInformation(companyInformation) {
|
|
11
15
|
return Boolean(companyInformation.about ||
|
|
12
16
|
companyInformation.website ||
|
|
13
17
|
hasAnySocialMedia(companyInformation));
|
|
14
18
|
}
|
|
15
|
-
|
|
19
|
+
exports.hasAnyAboutInformation = hasAnyAboutInformation;
|
|
20
|
+
function hasAnyContactInformation(companyInformation) {
|
|
16
21
|
return Boolean(companyInformation.address || companyInformation.phone || companyInformation.email);
|
|
17
22
|
}
|
|
23
|
+
exports.hasAnyContactInformation = hasAnyContactInformation;
|
|
18
24
|
//# sourceMappingURL=boilerplate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"boilerplate.js","sourceRoot":"","sources":["../../src/utils/boilerplate.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"boilerplate.js","sourceRoot":"","sources":["../../src/utils/boilerplate.ts"],"names":[],"mappings":";;;AAEA,SAAgB,iBAAiB,CAAC,kBAA8C;IAC5E,OAAO,OAAO,CACV,kBAAkB,CAAC,QAAQ;QACvB,kBAAkB,CAAC,SAAS;QAC5B,kBAAkB,CAAC,QAAQ;QAC3B,kBAAkB,CAAC,SAAS;QAC5B,kBAAkB,CAAC,MAAM;QACzB,kBAAkB,CAAC,OAAO;QAC1B,kBAAkB,CAAC,OAAO,CACjC,CAAC;AACN,CAAC;AAVD,8CAUC;AAED,SAAgB,sBAAsB,CAAC,kBAA8C;IACjF,OAAO,OAAO,CACV,kBAAkB,CAAC,KAAK;QACpB,kBAAkB,CAAC,OAAO;QAC1B,iBAAiB,CAAC,kBAAkB,CAAC,CAC5C,CAAC;AACN,CAAC;AAND,wDAMC;AAED,SAAgB,wBAAwB,CAAC,kBAA8C;IACnF,OAAO,OAAO,CACV,kBAAkB,CAAC,OAAO,IAAI,kBAAkB,CAAC,KAAK,IAAI,kBAAkB,CAAC,KAAK,CACrF,CAAC;AACN,CAAC;AAJD,4DAIC"}
|
package/build/utils/constants.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_GALLERY_PAGE_SIZE = exports.DEFAULT_PAGE_SIZE = exports.ASSETS_URL = void 0;
|
|
4
|
+
exports.ASSETS_URL = 'https://cdn.uc.assets.prezly.com';
|
|
5
|
+
exports.DEFAULT_PAGE_SIZE = 12;
|
|
6
|
+
exports.DEFAULT_GALLERY_PAGE_SIZE = 6;
|
|
4
7
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG,kCAAkC,CAAC;AAChD,QAAA,iBAAiB,GAAG,EAAE,CAAC;AACvB,QAAA,yBAAyB,GAAG,CAAC,CAAC"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAssetsUrl = void 0;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
2
5
|
/**
|
|
3
6
|
* @param uuid UUID of the assets hosted on Uploadcare
|
|
4
7
|
* @returns Full asset URL that can be used as a source for <img>, <video> and <a> tags.
|
|
5
8
|
*/
|
|
6
|
-
|
|
7
|
-
return `${ASSETS_URL}/${uuid}/`;
|
|
9
|
+
function getAssetsUrl(uuid) {
|
|
10
|
+
return `${constants_1.ASSETS_URL}/${uuid}/`;
|
|
8
11
|
}
|
|
12
|
+
exports.getAssetsUrl = getAssetsUrl;
|
|
9
13
|
//# sourceMappingURL=getAssetsUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAssetsUrl.js","sourceRoot":"","sources":["../../src/utils/getAssetsUrl.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"getAssetsUrl.js","sourceRoot":"","sources":["../../src/utils/getAssetsUrl.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAEzC;;;GAGG;AACH,SAAgB,YAAY,CAAC,IAAY;IACrC,OAAO,GAAG,sBAAU,IAAI,IAAI,GAAG,CAAC;AACpC,CAAC;AAFD,oCAEC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDataRequestLink = void 0;
|
|
4
|
+
const getPrivacyPortalUrl_1 = require("./getPrivacyPortalUrl");
|
|
5
|
+
function getDataRequestLink(newsroom, currentLocale) {
|
|
3
6
|
return (newsroom.custom_data_request_link ||
|
|
4
|
-
getPrivacyPortalUrl(newsroom, currentLocale, {
|
|
7
|
+
(0, getPrivacyPortalUrl_1.getPrivacyPortalUrl)(newsroom, currentLocale, {
|
|
5
8
|
action: 'data-request',
|
|
6
9
|
}));
|
|
7
10
|
}
|
|
11
|
+
exports.getDataRequestLink = getDataRequestLink;
|
|
8
12
|
//# sourceMappingURL=getDataRequestLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDataRequestLink.js","sourceRoot":"","sources":["../../src/utils/getDataRequestLink.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"getDataRequestLink.js","sourceRoot":"","sources":["../../src/utils/getDataRequestLink.ts"],"names":[],"mappings":";;;AAIA,+DAA4D;AAE5D,SAAgB,kBAAkB,CAAC,QAAkB,EAAE,aAA2B;IAC9E,OAAO,CACH,QAAQ,CAAC,wBAAwB;QACjC,IAAA,yCAAmB,EAAC,QAAQ,EAAE,aAAa,EAAE;YACzC,MAAM,EAAE,cAAc;SACzB,CAAC,CACL,CAAC;AACN,CAAC;AAPD,gDAOC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCategoryHasTranslation = exports.getCategoryUrl = exports.getLocalizedCategoryData = void 0;
|
|
1
4
|
function isAlgoliaCategory(category) {
|
|
2
5
|
return 'name' in category && 'slug' in category;
|
|
3
6
|
}
|
|
4
|
-
|
|
7
|
+
function getLocalizedCategoryData(category, locale) {
|
|
5
8
|
if (isAlgoliaCategory(category)) {
|
|
6
9
|
return {
|
|
7
10
|
description: null,
|
|
@@ -18,14 +21,17 @@ export function getLocalizedCategoryData(category, locale) {
|
|
|
18
21
|
const { locale: _, ...localizedData } = i18n[targetLocale];
|
|
19
22
|
return localizedData;
|
|
20
23
|
}
|
|
21
|
-
|
|
24
|
+
exports.getLocalizedCategoryData = getLocalizedCategoryData;
|
|
25
|
+
function getCategoryUrl(category, locale) {
|
|
22
26
|
const { slug } = getLocalizedCategoryData(category, locale);
|
|
23
27
|
return `/category/${slug}`;
|
|
24
28
|
}
|
|
25
|
-
|
|
29
|
+
exports.getCategoryUrl = getCategoryUrl;
|
|
30
|
+
function getCategoryHasTranslation(category, locale) {
|
|
26
31
|
const targetLocaleCode = locale.toUnderscoreCode();
|
|
27
32
|
const { i18n } = category;
|
|
28
33
|
const populatedLocales = Object.keys(i18n).filter((localeCode) => i18n[localeCode].name);
|
|
29
34
|
return Boolean(populatedLocales.find((localeCode) => localeCode === targetLocaleCode));
|
|
30
35
|
}
|
|
36
|
+
exports.getCategoryHasTranslation = getCategoryHasTranslation;
|
|
31
37
|
//# sourceMappingURL=getLocalizedCategoryData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalizedCategoryData.js","sourceRoot":"","sources":["../../src/utils/getLocalizedCategoryData.ts"],"names":[],"mappings":"AAKA,SAAS,iBAAiB,CACtB,QAAuC;IAEvC,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,IAAI,QAAQ,CAAC;AACpD,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"getLocalizedCategoryData.js","sourceRoot":"","sources":["../../src/utils/getLocalizedCategoryData.ts"],"names":[],"mappings":";;;AAKA,SAAS,iBAAiB,CACtB,QAAuC;IAEvC,OAAO,MAAM,IAAI,QAAQ,IAAI,MAAM,IAAI,QAAQ,CAAC;AACpD,CAAC;AAED,SAAgB,wBAAwB,CACpC,QAAuC,EACvC,MAAoB;IAEpB,IAAI,iBAAiB,CAAC,QAAQ,CAAC,EAAE;QAC7B,OAAO;YACH,WAAW,EAAE,IAAI;YACjB,IAAI,EAAE,QAAQ,CAAC,IAAI;YACnB,IAAI,EAAE,QAAQ,CAAC,IAAI;SACtB,CAAC;KACL;IAED,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC1B,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;IACzF,MAAM,YAAY,GACd,gBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,KAAK,gBAAgB,CAAC;QACtE,gBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC,YAAY,CAAC;QACtF,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAExB,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,aAAa,EAAE,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IAE3D,OAAO,aAAa,CAAC;AACzB,CAAC;AAvBD,4DAuBC;AAED,SAAgB,cAAc,CAAC,QAAuC,EAAE,MAAoB;IACxF,MAAM,EAAE,IAAI,EAAE,GAAG,wBAAwB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,aAAa,IAAI,EAAE,CAAC;AAC/B,CAAC;AAHD,wCAGC;AAED,SAAgB,yBAAyB,CAAC,QAAkB,EAAE,MAAoB;IAC9E,MAAM,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IACnD,MAAM,EAAE,IAAI,EAAE,GAAG,QAAQ,CAAC;IAC1B,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC;IACzF,OAAO,OAAO,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,KAAK,gBAAgB,CAAC,CAAC,CAAC;AAC3F,CAAC;AALD,8DAKC"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNewsroomFaviconUrl = exports.getNewsroomLogoUrl = void 0;
|
|
4
|
+
const getAssetsUrl_1 = require("./getAssetsUrl");
|
|
5
|
+
function getNewsroomLogoUrl(newsroom) {
|
|
3
6
|
if (newsroom.newsroom_logo) {
|
|
4
|
-
return getAssetsUrl(newsroom.newsroom_logo.uuid);
|
|
7
|
+
return (0, getAssetsUrl_1.getAssetsUrl)(newsroom.newsroom_logo.uuid);
|
|
5
8
|
}
|
|
6
9
|
return '';
|
|
7
10
|
}
|
|
8
|
-
|
|
11
|
+
exports.getNewsroomLogoUrl = getNewsroomLogoUrl;
|
|
12
|
+
function getNewsroomFaviconUrl(newsroom, previewSize = 400) {
|
|
9
13
|
const image = newsroom.icon || newsroom.square_logo;
|
|
10
14
|
if (image) {
|
|
11
|
-
return `${getAssetsUrl(image.uuid)}-/preview/${previewSize}x${previewSize}/-/quality/best/`;
|
|
15
|
+
return `${(0, getAssetsUrl_1.getAssetsUrl)(image.uuid)}-/preview/${previewSize}x${previewSize}/-/quality/best/`;
|
|
12
16
|
}
|
|
13
17
|
return '';
|
|
14
18
|
}
|
|
19
|
+
exports.getNewsroomFaviconUrl = getNewsroomFaviconUrl;
|
|
15
20
|
//# sourceMappingURL=getNewsroomLogoUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNewsroomLogoUrl.js","sourceRoot":"","sources":["../../src/utils/getNewsroomLogoUrl.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"getNewsroomLogoUrl.js","sourceRoot":"","sources":["../../src/utils/getNewsroomLogoUrl.ts"],"names":[],"mappings":";;;AAEA,iDAA8C;AAE9C,SAAgB,kBAAkB,CAAC,QAAkB;IACjD,IAAI,QAAQ,CAAC,aAAa,EAAE;QACxB,OAAO,IAAA,2BAAY,EAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;KACpD;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAND,gDAMC;AAED,SAAgB,qBAAqB,CAAC,QAAkB,EAAE,WAAW,GAAG,GAAG;IACvE,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC;IACpD,IAAI,KAAK,EAAE;QACP,OAAO,GAAG,IAAA,2BAAY,EAAC,KAAK,CAAC,IAAI,CAAC,aAAa,WAAW,IAAI,WAAW,kBAAkB,CAAC;KAC/F;IAED,OAAO,EAAE,CAAC;AACd,CAAC;AAPD,sDAOC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPrivacyPortalUrl = void 0;
|
|
4
|
+
function getPrivacyPortalUrl(newsroom, locale, options) {
|
|
2
5
|
const { email, action = 'subscribe' } = options || {};
|
|
3
6
|
const url = new URL(`/${locale.toUrlSlug()}/newsroom/${newsroom.uuid}/${action}`, 'https://privacy.prezly.com');
|
|
4
7
|
if (email) {
|
|
@@ -6,4 +9,5 @@ export function getPrivacyPortalUrl(newsroom, locale, options) {
|
|
|
6
9
|
}
|
|
7
10
|
return url.toString();
|
|
8
11
|
}
|
|
12
|
+
exports.getPrivacyPortalUrl = getPrivacyPortalUrl;
|
|
9
13
|
//# sourceMappingURL=getPrivacyPortalUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPrivacyPortalUrl.js","sourceRoot":"","sources":["../../src/utils/getPrivacyPortalUrl.ts"],"names":[],"mappings":"AASA,
|
|
1
|
+
{"version":3,"file":"getPrivacyPortalUrl.js","sourceRoot":"","sources":["../../src/utils/getPrivacyPortalUrl.ts"],"names":[],"mappings":";;;AASA,SAAgB,mBAAmB,CAC/B,QAAkB,EAClB,MAAoB,EACpB,OAAiC;IAEjC,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,OAAO,IAAI,EAAE,CAAC;IAEtD,MAAM,GAAG,GAAG,IAAI,GAAG,CACf,IAAI,MAAM,CAAC,SAAS,EAAE,aAAa,QAAQ,CAAC,IAAI,IAAI,MAAM,EAAE,EAC5D,4BAA4B,CAC/B,CAAC;IACF,IAAI,KAAK,EAAE;QACP,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;KAC3C;IACD,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AAfD,kDAeC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStoryPublicationDate = void 0;
|
|
4
|
+
function getStoryPublicationDate(story) {
|
|
2
5
|
const { published_at } = story;
|
|
3
6
|
if (!published_at) {
|
|
4
7
|
return null;
|
|
@@ -7,4 +10,5 @@ export function getStoryPublicationDate(story) {
|
|
|
7
10
|
? new Date(published_at)
|
|
8
11
|
: new Date(published_at * 1000);
|
|
9
12
|
}
|
|
13
|
+
exports.getStoryPublicationDate = getStoryPublicationDate;
|
|
10
14
|
//# sourceMappingURL=getStoryPublicationDate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStoryPublicationDate.js","sourceRoot":"","sources":["../../src/utils/getStoryPublicationDate.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"getStoryPublicationDate.js","sourceRoot":"","sources":["../../src/utils/getStoryPublicationDate.tsx"],"names":[],"mappings":";;;AAIA,SAAgB,uBAAuB,CAAC,KAA2B;IAC/D,MAAM,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE/B,IAAI,CAAC,YAAY,EAAE;QACf,OAAO,IAAI,CAAC;KACf;IAED,OAAO,OAAO,YAAY,KAAK,QAAQ;QACnC,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC;QACxB,CAAC,CAAC,IAAI,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;AACxC,CAAC;AAVD,0DAUC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getUploadcareGroupUrl = void 0;
|
|
4
|
+
const constants_1 = require("./constants");
|
|
2
5
|
/**
|
|
3
6
|
* This method constructs a URL to download all images in the Gallery as a single archive.
|
|
4
7
|
*
|
|
@@ -6,7 +9,8 @@ import { ASSETS_URL } from './constants';
|
|
|
6
9
|
* @param title Filename for the saved archive. Usually it is the Gallery title.
|
|
7
10
|
* @returns URL to an archive containing all of the images in the Gallery.
|
|
8
11
|
*/
|
|
9
|
-
|
|
10
|
-
return `${ASSETS_URL}/${uuid}/archive/zip/${encodeURI(title)}.zip`;
|
|
12
|
+
function getUploadcareGroupUrl(uuid, title) {
|
|
13
|
+
return `${constants_1.ASSETS_URL}/${uuid}/archive/zip/${encodeURI(title)}.zip`;
|
|
11
14
|
}
|
|
15
|
+
exports.getUploadcareGroupUrl = getUploadcareGroupUrl;
|
|
12
16
|
//# sourceMappingURL=getUploadcareGroupUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUploadcareGroupUrl.js","sourceRoot":"","sources":["../../src/utils/getUploadcareGroupUrl.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"getUploadcareGroupUrl.js","sourceRoot":"","sources":["../../src/utils/getUploadcareGroupUrl.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAEzC;;;;;;GAMG;AACH,SAAgB,qBAAqB,CAAC,IAAY,EAAE,KAAa;IAC7D,OAAO,GAAG,sBAAU,IAAI,IAAI,gBAAgB,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC;AACvE,CAAC;AAFD,sDAEC"}
|
package/build/utils/index.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./boilerplate"), exports);
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./getAssetsUrl"), exports);
|
|
20
|
+
__exportStar(require("./getDataRequestLink"), exports);
|
|
21
|
+
__exportStar(require("./getLocalizedCategoryData"), exports);
|
|
22
|
+
__exportStar(require("./getNewsroomLogoUrl"), exports);
|
|
23
|
+
__exportStar(require("./getPrivacyPortalUrl"), exports);
|
|
24
|
+
__exportStar(require("./getStoryPublicationDate"), exports);
|
|
25
|
+
__exportStar(require("./getUploadcareGroupUrl"), exports);
|
|
26
|
+
__exportStar(require("./isEmbargoStory"), exports);
|
|
11
27
|
//# sourceMappingURL=index.js.map
|
package/build/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,8CAA4B;AAC5B,iDAA+B;AAC/B,uDAAqC;AACrC,6DAA2C;AAC3C,uDAAqC;AACrC,wDAAsC;AACtC,4DAA0C;AAC1C,0DAAwC;AACxC,mDAAiC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEmbargoStory = void 0;
|
|
4
|
+
function isEmbargoStory(story) {
|
|
2
5
|
return story.is_embargo && Boolean(story.published_at);
|
|
3
6
|
}
|
|
7
|
+
exports.isEmbargoStory = isEmbargoStory;
|
|
4
8
|
//# sourceMappingURL=isEmbargoStory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isEmbargoStory.js","sourceRoot":"","sources":["../../src/utils/isEmbargoStory.ts"],"names":[],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"isEmbargoStory.js","sourceRoot":"","sources":["../../src/utils/isEmbargoStory.ts"],"names":[],"mappings":";;;AAOA,SAAgB,cAAc,CAAC,KAAY;IACvC,OAAO,KAAK,CAAC,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;AAC3D,CAAC;AAFD,wCAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/theme-kit-nextjs",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.1",
|
|
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",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@prezly/eslint-config": "4.2.0",
|
|
58
|
-
"@sentry/nextjs": "
|
|
58
|
+
"@sentry/nextjs": "7.7.0",
|
|
59
59
|
"@types/jest": "28.1.6",
|
|
60
60
|
"@types/node": "17.0.14",
|
|
61
61
|
"@types/parse-data-url": "3.0.0",
|
|
@@ -60,14 +60,12 @@ export function getCategoryPageServerSideProps<
|
|
|
60
60
|
localeCode,
|
|
61
61
|
});
|
|
62
62
|
|
|
63
|
+
serverSideProps.newsroomContextProps.currentCategory = category;
|
|
64
|
+
|
|
63
65
|
return processRequest(
|
|
64
66
|
context,
|
|
65
67
|
{
|
|
66
68
|
...serverSideProps,
|
|
67
|
-
newsroomContextProps: {
|
|
68
|
-
...serverSideProps.newsroomContextProps,
|
|
69
|
-
currentCategory: category,
|
|
70
|
-
},
|
|
71
69
|
// TODO: This is temporary until return types from API are figured out
|
|
72
70
|
stories: stories as StoryType[],
|
|
73
71
|
pagination: {
|
|
@@ -112,12 +110,10 @@ export function getCategoryPageStaticProps<
|
|
|
112
110
|
localeCode,
|
|
113
111
|
});
|
|
114
112
|
|
|
113
|
+
staticProps.newsroomContextProps.currentCategory = category;
|
|
114
|
+
|
|
115
115
|
return processStaticRequest(context, {
|
|
116
116
|
...staticProps,
|
|
117
|
-
newsroomContextProps: {
|
|
118
|
-
...staticProps.newsroomContextProps,
|
|
119
|
-
currentCategory: category,
|
|
120
|
-
},
|
|
121
117
|
// TODO: This is temporary until return types from API are figured out
|
|
122
118
|
stories: stories as StoryType[],
|
|
123
119
|
pagination: {
|
|
@@ -40,12 +40,10 @@ export function getStoryPageServerSideProps<CustomProps extends Record<string, a
|
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
serverSideProps.newsroomContextProps.currentStory = story;
|
|
44
|
+
|
|
43
45
|
return processRequest(context, {
|
|
44
46
|
...serverSideProps,
|
|
45
|
-
newsroomContextProps: {
|
|
46
|
-
...serverSideProps.newsroomContextProps,
|
|
47
|
-
currentStory: story,
|
|
48
|
-
},
|
|
49
47
|
...(typeof customProps === 'function'
|
|
50
48
|
? await (customProps as PropsFunction<CustomProps>)(context, serverSideProps)
|
|
51
49
|
: customProps),
|
|
@@ -69,12 +67,10 @@ export function getStoryPageStaticProps<CustomProps extends Record<string, any>>
|
|
|
69
67
|
|
|
70
68
|
const { staticProps } = await getNewsroomStaticProps(context, { story });
|
|
71
69
|
|
|
70
|
+
staticProps.newsroomContextProps.currentStory = story;
|
|
71
|
+
|
|
72
72
|
return processStaticRequest(context, {
|
|
73
73
|
...staticProps,
|
|
74
|
-
newsroomContextProps: {
|
|
75
|
-
...staticProps.newsroomContextProps,
|
|
76
|
-
currentStory: story,
|
|
77
|
-
},
|
|
78
74
|
...(typeof customProps === 'function'
|
|
79
75
|
? await (customProps as PropsFunction<CustomProps, GetStaticPropsContext>)(
|
|
80
76
|
context,
|
|
@@ -21,12 +21,10 @@ export function getStoryPreviewPageServerSideProps<CustomProps extends Record<st
|
|
|
21
21
|
|
|
22
22
|
const { serverSideProps } = await getNewsroomServerSideProps(context, { story });
|
|
23
23
|
|
|
24
|
+
serverSideProps.newsroomContextProps.currentStory = story;
|
|
25
|
+
|
|
24
26
|
return processRequest(context, {
|
|
25
27
|
...serverSideProps,
|
|
26
|
-
newsroomContextProps: {
|
|
27
|
-
...serverSideProps.newsroomContextProps,
|
|
28
|
-
currentStory: story,
|
|
29
|
-
},
|
|
30
28
|
...(typeof customProps === 'function'
|
|
31
29
|
? await (customProps as PropsFunction<CustomProps>)(context, serverSideProps)
|
|
32
30
|
: customProps),
|