@prezly/theme-kit-nextjs 1.15.1 → 1.16.0-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.
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +16 -66
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +18 -68
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +9 -59
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +9 -59
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/category.d.ts +1 -1
- package/build/adapter-nextjs/page-props/category.js +94 -195
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.d.ts +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +58 -135
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.d.ts +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +40 -132
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
- package/build/adapter-nextjs/page-props/home.d.ts +1 -1
- package/build/adapter-nextjs/page-props/home.js +56 -135
- package/build/adapter-nextjs/page-props/home.js.map +1 -1
- package/build/adapter-nextjs/page-props/search.d.ts +2 -2
- package/build/adapter-nextjs/page-props/search.js +19 -96
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +18 -18
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +9 -40
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +28 -76
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/story.d.ts +1 -1
- package/build/adapter-nextjs/page-props/story.js +57 -159
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +20 -81
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +8 -19
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +2 -13
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +41 -52
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +27 -31
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/components-nextjs/document.d.ts +6 -0
- package/build/components-nextjs/document.js +48 -0
- package/build/components-nextjs/document.js.map +1 -0
- package/build/components-nextjs/index.d.ts +1 -0
- package/build/components-nextjs/index.js +3 -1
- package/build/components-nextjs/index.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.js +170 -355
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +3 -3
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/queries.js +8 -32
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +5 -5
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +10 -21
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/isUuid.js +1 -1
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +25 -79
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +22 -94
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.js +36 -95
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/languages.js +35 -68
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.js +13 -13
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.js +11 -32
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeObject.js +30 -42
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +17 -29
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +2 -2
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
- package/build/newsroom-context/hooks/useCategories.js +2 -2
- package/build/newsroom-context/hooks/useCategories.js.map +1 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +2 -2
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +2 -2
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +2 -2
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +2 -2
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +8 -8
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +14 -19
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/newsroom-context/hooks/useLanguages.js +2 -2
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroom.js +2 -2
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js +3 -3
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
- package/build/sentry/client.d.ts +2 -0
- package/build/sentry/client.js +9 -0
- package/build/sentry/client.js.map +1 -0
- package/build/sentry/common.d.ts +2 -0
- package/build/sentry/common.js +29 -0
- package/build/sentry/common.js.map +1 -0
- package/build/sentry/index.d.ts +2 -0
- package/build/sentry/index.js +8 -0
- package/build/sentry/index.js.map +1 -0
- package/build/sentry/server.d.ts +2 -0
- package/build/sentry/server.js +9 -0
- package/build/sentry/server.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/utils/getAssetsUrl.js +2 -2
- package/build/utils/getAssetsUrl.js.map +1 -1
- package/build/utils/getDataRequestLink.js +1 -1
- package/build/utils/getDataRequestLink.js.map +1 -1
- package/build/utils/getLocalizedCategoryData.js +12 -23
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +4 -5
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +2 -2
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +1 -1
- package/build/utils/getStoryPublicationDate.js.map +1 -1
- package/build/utils/getUploadcareGroupUrl.js +2 -2
- package/build/utils/getUploadcareGroupUrl.js.map +1 -1
- package/package.json +2 -1
- package/src/adapter-nextjs/page-props/category.ts +1 -1
- package/src/adapter-nextjs/page-props/gallery.ts +1 -1
- package/src/adapter-nextjs/page-props/galleryAlbum.ts +1 -1
- package/src/adapter-nextjs/page-props/home.ts +1 -1
- package/src/adapter-nextjs/page-props/search.ts +1 -1
- package/src/adapter-nextjs/page-props/story.ts +1 -1
- package/src/components-nextjs/document.tsx +38 -0
- package/src/components-nextjs/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/sentry/client.ts +7 -0
- package/src/sentry/common.ts +27 -0
- package/src/sentry/index.ts +2 -0
- package/src/sentry/server.ts +7 -0
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.getCategoryHasTranslation = exports.getCategoryUrl = exports.getLocalizedCategoryData = void 0;
|
|
15
4
|
function isAlgoliaCategory(category) {
|
|
@@ -23,26 +12,26 @@ function getLocalizedCategoryData(category, locale) {
|
|
|
23
12
|
slug: category.slug,
|
|
24
13
|
};
|
|
25
14
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
populatedLocales.find(
|
|
15
|
+
const targetLocaleCode = locale.toUnderscoreCode();
|
|
16
|
+
const { i18n } = category;
|
|
17
|
+
const populatedLocales = Object.keys(i18n).filter((localeCode) => i18n[localeCode].name);
|
|
18
|
+
const targetLocale = populatedLocales.find((localeCode) => localeCode === targetLocaleCode) ||
|
|
19
|
+
populatedLocales.find((localeCode) => i18n[localeCode].name === category.display_name) ||
|
|
31
20
|
populatedLocales[0];
|
|
32
|
-
|
|
21
|
+
const { locale: _, ...localizedData } = i18n[targetLocale];
|
|
33
22
|
return localizedData;
|
|
34
23
|
}
|
|
35
24
|
exports.getLocalizedCategoryData = getLocalizedCategoryData;
|
|
36
25
|
function getCategoryUrl(category, locale) {
|
|
37
|
-
|
|
38
|
-
return
|
|
26
|
+
const { slug } = getLocalizedCategoryData(category, locale);
|
|
27
|
+
return `/category/${slug}`;
|
|
39
28
|
}
|
|
40
29
|
exports.getCategoryUrl = getCategoryUrl;
|
|
41
30
|
function getCategoryHasTranslation(category, locale) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return Boolean(populatedLocales.find(
|
|
31
|
+
const targetLocaleCode = locale.toUnderscoreCode();
|
|
32
|
+
const { i18n } = category;
|
|
33
|
+
const populatedLocales = Object.keys(i18n).filter((localeCode) => i18n[localeCode].name);
|
|
34
|
+
return Boolean(populatedLocales.find((localeCode) => localeCode === targetLocaleCode));
|
|
46
35
|
}
|
|
47
36
|
exports.getCategoryHasTranslation = getCategoryHasTranslation;
|
|
48
37
|
//# sourceMappingURL=getLocalizedCategoryData.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLocalizedCategoryData.js","sourceRoot":"","sources":["../../src/utils/getLocalizedCategoryData.ts"],"names":[],"mappings":"
|
|
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,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNewsroomFaviconUrl = exports.getNewsroomLogoUrl = void 0;
|
|
4
|
-
|
|
4
|
+
const getAssetsUrl_1 = require("./getAssetsUrl");
|
|
5
5
|
function getNewsroomLogoUrl(newsroom) {
|
|
6
6
|
if (newsroom.newsroom_logo) {
|
|
7
7
|
return (0, getAssetsUrl_1.getAssetsUrl)(newsroom.newsroom_logo.uuid);
|
|
@@ -9,11 +9,10 @@ function getNewsroomLogoUrl(newsroom) {
|
|
|
9
9
|
return '';
|
|
10
10
|
}
|
|
11
11
|
exports.getNewsroomLogoUrl = getNewsroomLogoUrl;
|
|
12
|
-
function getNewsroomFaviconUrl(newsroom, previewSize) {
|
|
13
|
-
|
|
14
|
-
var image = newsroom.icon || newsroom.square_logo;
|
|
12
|
+
function getNewsroomFaviconUrl(newsroom, previewSize = 400) {
|
|
13
|
+
const image = newsroom.icon || newsroom.square_logo;
|
|
15
14
|
if (image) {
|
|
16
|
-
return
|
|
15
|
+
return `${(0, getAssetsUrl_1.getAssetsUrl)(image.uuid)}-/preview/${previewSize}x${previewSize}/-/quality/best/`;
|
|
17
16
|
}
|
|
18
17
|
return '';
|
|
19
18
|
}
|
|
@@ -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"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getPrivacyPortalUrl = void 0;
|
|
4
4
|
function getPrivacyPortalUrl(newsroom, locale, options) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const { email, action = 'subscribe' } = options || {};
|
|
6
|
+
const url = new URL(`/${locale.toUrlSlug()}/newsroom/${newsroom.uuid}/${action}`, 'https://privacy.prezly.com');
|
|
7
7
|
if (email) {
|
|
8
8
|
url.searchParams.append('email', email);
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPrivacyPortalUrl.js","sourceRoot":"","sources":["../../src/utils/getPrivacyPortalUrl.ts"],"names":[],"mappings":";;;AASA,SAAgB,mBAAmB,CAC/B,QAAkB,EAClB,MAAoB,EACpB,OAAiC;
|
|
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"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getStoryPublicationDate = void 0;
|
|
4
4
|
function getStoryPublicationDate(story) {
|
|
5
|
-
|
|
5
|
+
const { published_at } = story;
|
|
6
6
|
if (!published_at) {
|
|
7
7
|
return null;
|
|
8
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getStoryPublicationDate.js","sourceRoot":"","sources":["../../src/utils/getStoryPublicationDate.tsx"],"names":[],"mappings":";;;AAIA,SAAgB,uBAAuB,CAAC,KAA2B;
|
|
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,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getUploadcareGroupUrl = void 0;
|
|
4
|
-
|
|
4
|
+
const constants_1 = require("./constants");
|
|
5
5
|
/**
|
|
6
6
|
* This method constructs a URL to download all images in the Gallery as a single archive.
|
|
7
7
|
*
|
|
@@ -10,7 +10,7 @@ var constants_1 = require("./constants");
|
|
|
10
10
|
* @returns URL to an archive containing all of the images in the Gallery.
|
|
11
11
|
*/
|
|
12
12
|
function getUploadcareGroupUrl(uuid, title) {
|
|
13
|
-
return
|
|
13
|
+
return `${constants_1.ASSETS_URL}/${uuid}/archive/zip/${encodeURI(title)}.zip`;
|
|
14
14
|
}
|
|
15
15
|
exports.getUploadcareGroupUrl = getUploadcareGroupUrl;
|
|
16
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/theme-kit-nextjs",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0-2",
|
|
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,6 +55,7 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@prezly/eslint-config": "4.2.0",
|
|
58
|
+
"@sentry/nextjs": "^7.7.0",
|
|
58
59
|
"@types/jest": "28.1.6",
|
|
59
60
|
"@types/node": "17.0.14",
|
|
60
61
|
"@types/parse-data-url": "3.0.0",
|
|
@@ -87,7 +87,7 @@ export function getCategoryPageServerSideProps<
|
|
|
87
87
|
export function getCategoryPageStaticProps<
|
|
88
88
|
CustomProps extends Record<string, any>,
|
|
89
89
|
StoryType extends Story = Story,
|
|
90
|
-
>(customProps: CustomProps | PropsFunction<CustomProps>, options?: Options) {
|
|
90
|
+
>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>, options?: Options) {
|
|
91
91
|
const { pageSize = DEFAULT_PAGE_SIZE, extraStoryFields } = options || {};
|
|
92
92
|
|
|
93
93
|
return async function getStaticProps(
|
|
@@ -71,7 +71,7 @@ export function getGalleryPageServerSideProps<CustomProps extends Record<string,
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
export function getGalleryPageStaticProps<CustomProps extends Record<string, any>>(
|
|
74
|
-
customProps: CustomProps | PropsFunction<CustomProps>,
|
|
74
|
+
customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>,
|
|
75
75
|
options?: Options,
|
|
76
76
|
) {
|
|
77
77
|
const { pageSize = DEFAULT_GALLERY_PAGE_SIZE } = options || {};
|
|
@@ -49,7 +49,7 @@ export function getGalleryAlbumPageServerSideProps<CustomProps extends Record<st
|
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export function getGalleryAlbumPageStaticProps<CustomProps extends Record<string, any>>(
|
|
52
|
-
customProps: CustomProps | PropsFunction<CustomProps>,
|
|
52
|
+
customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>,
|
|
53
53
|
) {
|
|
54
54
|
return async function getStaticProps(
|
|
55
55
|
context: GetStaticPropsContext,
|
|
@@ -74,7 +74,7 @@ export function getHomepageServerSideProps<
|
|
|
74
74
|
export function getHomepageStaticProps<
|
|
75
75
|
CustomProps extends Record<string, any>,
|
|
76
76
|
StoryType extends Story = Story,
|
|
77
|
-
>(customProps: CustomProps | PropsFunction<CustomProps>, options?: Options) {
|
|
77
|
+
>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>, options?: Options) {
|
|
78
78
|
const { pageSize = DEFAULT_PAGE_SIZE, extraStoryFields } = options || {};
|
|
79
79
|
|
|
80
80
|
return async function getStaticProps(
|
|
@@ -33,7 +33,7 @@ export function getSearchPageServerSideProps<CustomProps extends Record<string,
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
export function getSearchPageStaticProps<CustomProps extends Record<string, any>>(
|
|
36
|
-
customProps: CustomProps | PropsFunction<CustomProps>,
|
|
36
|
+
customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>,
|
|
37
37
|
) {
|
|
38
38
|
return async function getStaticProps(
|
|
39
39
|
context: GetServerSidePropsContext,
|
|
@@ -54,7 +54,7 @@ export function getStoryPageServerSideProps<CustomProps extends Record<string, a
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export function getStoryPageStaticProps<CustomProps extends Record<string, any>>(
|
|
57
|
-
customProps: CustomProps | PropsFunction<CustomProps>,
|
|
57
|
+
customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>,
|
|
58
58
|
) {
|
|
59
59
|
return async function getStaticProps(
|
|
60
60
|
context: GetStaticPropsContext,
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import Document, { Head, Html, Main, NextScript } from 'next/document';
|
|
2
|
+
|
|
3
|
+
import { DEFAULT_LOCALE, getLocaleDirection, LocaleObject } from '../intl';
|
|
4
|
+
import type { PageProps } from '../types';
|
|
5
|
+
|
|
6
|
+
export class PrezlyThemeDocument extends Document {
|
|
7
|
+
getLocaleCode() {
|
|
8
|
+
const {
|
|
9
|
+
newsroomContextProps,
|
|
10
|
+
// eslint-disable-next-line no-underscore-dangle
|
|
11
|
+
} = this.props.__NEXT_DATA__.props.pageProps as PageProps;
|
|
12
|
+
|
|
13
|
+
// In some cases (like server errors) the newsroom context props will not be loaded.
|
|
14
|
+
// We need to fall back to default locale to keep the app working.
|
|
15
|
+
const { localeCode } = newsroomContextProps ?? { localeCode: DEFAULT_LOCALE };
|
|
16
|
+
|
|
17
|
+
return localeCode;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
render() {
|
|
21
|
+
const locale = LocaleObject.fromAnyCode(this.getLocaleCode());
|
|
22
|
+
// TODO: The direction can be pulled from the Language object
|
|
23
|
+
const direction = getLocaleDirection(locale);
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<Html lang={locale.toHyphenCode()} dir={direction}>
|
|
27
|
+
<Head>
|
|
28
|
+
<meta name="og:locale" content={locale.toHyphenCode()} />
|
|
29
|
+
{/* TODO: Add alternate locales */}
|
|
30
|
+
</Head>
|
|
31
|
+
<body>
|
|
32
|
+
<Main />
|
|
33
|
+
<NextScript />
|
|
34
|
+
</body>
|
|
35
|
+
</Html>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { init } from '@sentry/nextjs';
|
|
2
|
+
|
|
3
|
+
export function getCommonClientOptions(dsn: string, themeName: string): Parameters<typeof init>[0] {
|
|
4
|
+
return {
|
|
5
|
+
dsn,
|
|
6
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
7
|
+
tracesSampleRate: 0.02,
|
|
8
|
+
// ...
|
|
9
|
+
// Note: if you want to override the automatic release value, do not set a
|
|
10
|
+
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
|
|
11
|
+
// that it will also get attached to your source maps
|
|
12
|
+
|
|
13
|
+
ignoreErrors: [
|
|
14
|
+
// This particular error is coming from Microsoft Outlook SafeLink crawler.
|
|
15
|
+
// It doesn't affect the user experience in any way, but produces a lot of unwanted Sentry events.
|
|
16
|
+
// See https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
|
|
17
|
+
'Object Not Found Matching Id',
|
|
18
|
+
// This error is caused by `beacon.min.js` polyfill in Cloudflare Insights. From what we see, it doesn't affect the user experience.
|
|
19
|
+
'Illegal invocation',
|
|
20
|
+
],
|
|
21
|
+
// Attach theme tag to each event
|
|
22
|
+
initialScope: (scope) => {
|
|
23
|
+
scope.setTags({ prezly_theme: themeName });
|
|
24
|
+
return scope;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|