@prezly/theme-kit-nextjs 1.16.0-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 +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 +25 -19
- 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 +23 -17
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +11 -7
- 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 +1 -1
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSearchPageStaticProps = exports.getSearchPageServerSideProps = void 0;
|
|
4
|
+
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
5
|
+
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
6
|
+
const processRequest_1 = require("../processRequest");
|
|
7
|
+
const processStaticRequest_1 = require("../processStaticRequest");
|
|
8
|
+
function getSearchPageServerSideProps(customProps) {
|
|
6
9
|
return async function getServerSideProps(context) {
|
|
7
|
-
const { serverSideProps } = await getNewsroomServerSideProps(context);
|
|
8
|
-
return processRequest(context, {
|
|
10
|
+
const { serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context);
|
|
11
|
+
return (0, processRequest_1.processRequest)(context, {
|
|
9
12
|
...serverSideProps,
|
|
10
13
|
...(typeof customProps === 'function'
|
|
11
14
|
? await customProps(context, serverSideProps)
|
|
@@ -13,10 +16,11 @@ export function getSearchPageServerSideProps(customProps) {
|
|
|
13
16
|
}, '/search');
|
|
14
17
|
};
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
exports.getSearchPageServerSideProps = getSearchPageServerSideProps;
|
|
20
|
+
function getSearchPageStaticProps(customProps) {
|
|
17
21
|
return async function getStaticProps(context) {
|
|
18
|
-
const { staticProps } = await getNewsroomStaticProps(context);
|
|
19
|
-
return processStaticRequest(context, {
|
|
22
|
+
const { staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context);
|
|
23
|
+
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
20
24
|
...staticProps,
|
|
21
25
|
...(typeof customProps === 'function'
|
|
22
26
|
? await customProps(context, staticProps)
|
|
@@ -24,4 +28,5 @@ export function getSearchPageStaticProps(customProps) {
|
|
|
24
28
|
});
|
|
25
29
|
};
|
|
26
30
|
}
|
|
31
|
+
exports.getSearchPageStaticProps = getSearchPageStaticProps;
|
|
27
32
|
//# sourceMappingURL=search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/search.ts"],"names":[],"mappings":"AAMA,
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/search.ts"],"names":[],"mappings":";;;AAMA,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAI/D,SAAgB,4BAA4B,CACxC,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,CAAC,CAAC;QAEtE,OAAO,IAAA,+BAAc,EACjB,OAAO,EACP;YACI,GAAG,eAAe;YAClB,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAA0C,CAAC,OAAO,EAAE,eAAe,CAAC;gBAC7E,CAAC,CAAC,WAAW,CAAC;SACrB,EACD,SAAS,CACZ,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAnBD,oEAmBC;AAED,SAAgB,wBAAwB,CACpC,WAA4E;IAE5E,OAAO,KAAK,UAAU,cAAc,CAChC,OAAkC;QAElC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,+CAAsB,EAAC,OAAO,CAAC,CAAC;QAE9D,OAAO,IAAA,2CAAoB,EAAC,OAAO,EAAE;YACjC,GAAG,WAAW;YACd,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAlBD,4DAkBC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SitemapBuilder = void 0;
|
|
4
|
+
class SitemapBuilder {
|
|
2
5
|
baseUrl;
|
|
3
6
|
urls = [];
|
|
4
7
|
constructor(baseUrl) {
|
|
@@ -44,4 +47,5 @@ export class SitemapBuilder {
|
|
|
44
47
|
].join('\n');
|
|
45
48
|
}
|
|
46
49
|
}
|
|
50
|
+
exports.SitemapBuilder = SitemapBuilder;
|
|
47
51
|
//# sourceMappingURL=SitemapBuilder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SitemapBuilder.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"SitemapBuilder.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts"],"names":[],"mappings":";;;AAEA,MAAa,cAAc;IACf,OAAO,CAAS;IAEhB,IAAI,GAAiB,EAAE,CAAC;IAEhC,YAAY,OAAe;QACvB,IAAI,CAAC,OA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4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPaths = void 0;
|
|
4
|
+
function createPaths(stories, categories) {
|
|
2
5
|
const storiesUrls = stories.map(({ slug }) => `/${slug}`);
|
|
3
6
|
const categoriesUrls = categories
|
|
4
7
|
.map((category) => {
|
|
@@ -12,4 +15,5 @@ export function createPaths(stories, categories) {
|
|
|
12
15
|
.flat();
|
|
13
16
|
return [...storiesUrls, ...categoriesUrls];
|
|
14
17
|
}
|
|
18
|
+
exports.createPaths = createPaths;
|
|
15
19
|
//# sourceMappingURL=createPaths.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createPaths.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/createPaths.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"createPaths.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/createPaths.ts"],"names":[],"mappings":";;;AAEA,SAAgB,WAAW,CAAC,OAAgB,EAAE,UAAsB;IAChE,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAC1D,MAAM,cAAc,GAAG,UAAU;SAC5B,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE;QACd,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAClD,MAAM,QAAQ,GAAG,YAAY;aACxB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;aAC7B,MAAM,CAAC,OAAO,CAAC;aACf,MAAM,CACH,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC,EACvE,EAAE,CACL,CAAC;QAEN,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;IAEZ,OAAO,CAAC,GAAG,WAAW,EAAE,GAAG,cAAc,CAAC,CAAC;AAC/C,CAAC;AAlBD,kCAkBC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSitemapServerSideProps = void 0;
|
|
4
|
+
const data_fetching_1 = require("../../../data-fetching");
|
|
5
|
+
const createPaths_1 = require("./createPaths");
|
|
6
|
+
const SitemapBuilder_1 = require("./SitemapBuilder");
|
|
7
|
+
function getSitemapServerSideProps(additionalPaths) {
|
|
5
8
|
return async function getServerSideProps(ctx) {
|
|
6
9
|
const { res, req } = ctx;
|
|
7
10
|
if (!req || !res) {
|
|
@@ -11,11 +14,11 @@ export function getSitemapServerSideProps(additionalPaths) {
|
|
|
11
14
|
};
|
|
12
15
|
}
|
|
13
16
|
const baseUrl = req.headers.host || '/';
|
|
14
|
-
const api = getPrezlyApi(req);
|
|
17
|
+
const api = (0, data_fetching_1.getPrezlyApi)(req);
|
|
15
18
|
const stories = await api.getAllStories();
|
|
16
19
|
const categories = await api.getCategories();
|
|
17
|
-
const paths = createPaths(stories, categories);
|
|
18
|
-
const sitemapBuilder = new SitemapBuilder(baseUrl);
|
|
20
|
+
const paths = (0, createPaths_1.createPaths)(stories, categories);
|
|
21
|
+
const sitemapBuilder = new SitemapBuilder_1.SitemapBuilder(baseUrl);
|
|
19
22
|
sitemapBuilder.addUrl('/');
|
|
20
23
|
paths.forEach((path) => sitemapBuilder.addUrl(path));
|
|
21
24
|
if (additionalPaths) {
|
|
@@ -29,4 +32,5 @@ export function getSitemapServerSideProps(additionalPaths) {
|
|
|
29
32
|
};
|
|
30
33
|
};
|
|
31
34
|
}
|
|
35
|
+
exports.getSitemapServerSideProps = getSitemapServerSideProps;
|
|
32
36
|
//# sourceMappingURL=getServerSideProps.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getServerSideProps.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"getServerSideProps.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts"],"names":[],"mappings":";;;AAEA,0DAAsD;AAEtD,+CAA4C;AAC5C,qDAAkD;AAElD,SAAgB,yBAAyB,CAAC,eAA0B;IAChE,OAAO,KAAK,UAAU,kBAAkB,CAAC,GAAoB;QACzD,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC;QAEzB,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE;YACd,cAAc;YACd,OAAO;gBACH,KAAK,EAAE,EAAE;aACZ,CAAC;SACL;QAED,MAAM,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;QAExC,MAAM,GAAG,GAAG,IAAA,4BAAY,EAAC,GAAG,CAAC,CAAC;QAC9B,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAC1C,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;QAE7C,MAAM,KAAK,GAAG,IAAA,yBAAW,EAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC/C,MAAM,cAAc,GAAG,IAAI,+BAAc,CAAC,OAAO,CAAC,CAAC;QAEnD,cAAc,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC3B,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QAErD,IAAI,eAAe,EAAE;YACjB,eAAe,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;SAClE;QAED,GAAG,CAAC,SAAS,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QAC1C,GAAG,CAAC,KAAK,CAAC,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;QACtC,GAAG,CAAC,GAAG,EAAE,CAAC;QAEV,OAAO;YACH,KAAK,EAAE,EAAE;SACZ,CAAC;IACN,CAAC,CAAC;AACN,CAAC;AAnCD,8DAmCC"}
|
|
@@ -1,5 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
+
exports.createPaths = exports.SitemapBuilder = exports.getSitemapServerSideProps = void 0;
|
|
18
|
+
var getServerSideProps_1 = require("./getServerSideProps");
|
|
19
|
+
Object.defineProperty(exports, "getSitemapServerSideProps", { enumerable: true, get: function () { return getServerSideProps_1.getSitemapServerSideProps; } });
|
|
20
|
+
var SitemapBuilder_1 = require("./SitemapBuilder");
|
|
21
|
+
Object.defineProperty(exports, "SitemapBuilder", { enumerable: true, get: function () { return SitemapBuilder_1.SitemapBuilder; } });
|
|
22
|
+
var createPaths_1 = require("./createPaths");
|
|
23
|
+
Object.defineProperty(exports, "createPaths", { enumerable: true, get: function () { return createPaths_1.createPaths; } });
|
|
24
|
+
__exportStar(require("./types"), exports);
|
|
5
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/adapter-nextjs/page-props/sitemap/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2DAAiE;AAAxD,+HAAA,yBAAyB,OAAA;AAElC,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,6CAA4C;AAAnC,0GAAA,WAAW,OAAA;AACpB,0CAAwB"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStoryPageStaticPaths = exports.getStoryPageStaticProps = exports.getStoryPageServerSideProps = void 0;
|
|
4
|
+
const data_fetching_1 = require("../../data-fetching");
|
|
5
|
+
const intl_1 = require("../../intl");
|
|
6
|
+
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
7
|
+
const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
|
|
8
|
+
const processRequest_1 = require("../processRequest");
|
|
9
|
+
const processStaticRequest_1 = require("../processStaticRequest");
|
|
10
|
+
function getStoryPageServerSideProps(customProps) {
|
|
8
11
|
return async function getServerSideProps(context) {
|
|
9
|
-
const api = getPrezlyApi(context.req);
|
|
12
|
+
const api = (0, data_fetching_1.getPrezlyApi)(context.req);
|
|
10
13
|
const { slug } = context.params;
|
|
11
14
|
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
12
15
|
if (!story) {
|
|
13
16
|
return { notFound: true };
|
|
14
17
|
}
|
|
15
|
-
const { serverSideProps } = await getNewsroomServerSideProps(context, { story });
|
|
18
|
+
const { serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context, { story });
|
|
16
19
|
const { locale } = context;
|
|
17
|
-
if (locale && locale !== DUMMY_DEFAULT_LOCALE) {
|
|
20
|
+
if (locale && locale !== intl_1.DUMMY_DEFAULT_LOCALE) {
|
|
18
21
|
return {
|
|
19
22
|
redirect: {
|
|
20
23
|
destination: `/${slug}`,
|
|
@@ -22,7 +25,7 @@ export function getStoryPageServerSideProps(customProps) {
|
|
|
22
25
|
},
|
|
23
26
|
};
|
|
24
27
|
}
|
|
25
|
-
return processRequest(context, {
|
|
28
|
+
return (0, processRequest_1.processRequest)(context, {
|
|
26
29
|
...serverSideProps,
|
|
27
30
|
newsroomContextProps: {
|
|
28
31
|
...serverSideProps.newsroomContextProps,
|
|
@@ -34,16 +37,17 @@ export function getStoryPageServerSideProps(customProps) {
|
|
|
34
37
|
});
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
|
-
|
|
40
|
+
exports.getStoryPageServerSideProps = getStoryPageServerSideProps;
|
|
41
|
+
function getStoryPageStaticProps(customProps) {
|
|
38
42
|
return async function getStaticProps(context) {
|
|
39
|
-
const api = getPrezlyApi();
|
|
43
|
+
const api = (0, data_fetching_1.getPrezlyApi)();
|
|
40
44
|
const { slug } = context.params;
|
|
41
45
|
const story = slug ? await api.getStoryBySlug(slug) : null;
|
|
42
46
|
if (!story) {
|
|
43
47
|
return { notFound: true };
|
|
44
48
|
}
|
|
45
|
-
const { staticProps } = await getNewsroomStaticProps(context, { story });
|
|
46
|
-
return processStaticRequest(context, {
|
|
49
|
+
const { staticProps } = await (0, getNewsroomStaticProps_1.getNewsroomStaticProps)(context, { story });
|
|
50
|
+
return (0, processStaticRequest_1.processStaticRequest)(context, {
|
|
47
51
|
...staticProps,
|
|
48
52
|
newsroomContextProps: {
|
|
49
53
|
...staticProps.newsroomContextProps,
|
|
@@ -55,8 +59,9 @@ export function getStoryPageStaticProps(customProps) {
|
|
|
55
59
|
});
|
|
56
60
|
};
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
exports.getStoryPageStaticProps = getStoryPageStaticProps;
|
|
63
|
+
async function getStoryPageStaticPaths() {
|
|
64
|
+
const api = (0, data_fetching_1.getPrezlyApi)();
|
|
60
65
|
const stories = await api.getAllStories();
|
|
61
66
|
const paths = stories.map(({ slug }) => ({ params: { slug } }));
|
|
62
67
|
return {
|
|
@@ -64,4 +69,5 @@ export async function getStoryPageStaticPaths() {
|
|
|
64
69
|
fallback: 'blocking',
|
|
65
70
|
};
|
|
66
71
|
}
|
|
72
|
+
exports.getStoryPageStaticPaths = getStoryPageStaticPaths;
|
|
67
73
|
//# sourceMappingURL=story.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/story.ts"],"names":[],"mappings":"AAOA,
|
|
1
|
+
{"version":3,"file":"story.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/story.ts"],"names":[],"mappings":";;;AAOA,uDAAmD;AACnD,qCAAkD;AAClD,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAI/D,SAAgB,2BAA2B,CACvC,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,IAAA,4BAAY,EAAC,OAAO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AI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7B;QAED,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,IAAA,+CAAsB,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEzE,OAAO,IAAA,2CAAoB,EAAC,OAAO,EAAE;YACjC,GAAG,WAAW;YACd,oBAAoB,EAAE;gBAClB,GAAG,WAAW,CAAC,oBAAoB;gBACnC,YAAY,EAAE,KAAK;aACtB;YACD,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AA9BD,0DA8BC;AAEM,KAAK,UAAU,uBAAuB;IACzC,MAAM,GAAG,GAAG,IAAA,4BAAY,GAAE,CAAC;IAC3B,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,aAAa,EAAE,CAAC;IAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAEhE,OAAO;QACH,KAAK;QACL,QAAQ,EAAE,UAAU;KACvB,CAAC;AACN,CAAC;AAVD,0DAUC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getStoryPreviewPageServerSideProps = void 0;
|
|
4
|
+
const data_fetching_1 = require("../../data-fetching");
|
|
5
|
+
const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
|
|
6
|
+
const processRequest_1 = require("../processRequest");
|
|
7
|
+
function getStoryPreviewPageServerSideProps(customProps) {
|
|
5
8
|
return async function getServerSideProps(context) {
|
|
6
|
-
const api = getPrezlyApi(context.req);
|
|
9
|
+
const api = (0, data_fetching_1.getPrezlyApi)(context.req);
|
|
7
10
|
const { uuid } = context.params;
|
|
8
11
|
const story = await api.getStory(uuid);
|
|
9
12
|
if (!story) {
|
|
10
13
|
return { notFound: true };
|
|
11
14
|
}
|
|
12
|
-
const { serverSideProps } = await getNewsroomServerSideProps(context, { story });
|
|
13
|
-
return processRequest(context, {
|
|
15
|
+
const { serverSideProps } = await (0, getNewsroomServerSideProps_1.getNewsroomServerSideProps)(context, { story });
|
|
16
|
+
return (0, processRequest_1.processRequest)(context, {
|
|
14
17
|
...serverSideProps,
|
|
15
18
|
newsroomContextProps: {
|
|
16
19
|
...serverSideProps.newsroomContextProps,
|
|
@@ -22,4 +25,5 @@ export function getStoryPreviewPageServerSideProps(customProps) {
|
|
|
22
25
|
});
|
|
23
26
|
};
|
|
24
27
|
}
|
|
28
|
+
exports.getStoryPreviewPageServerSideProps = getStoryPreviewPageServerSideProps;
|
|
25
29
|
//# sourceMappingURL=storyPreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":";;;AAEA,uDAAmD;AACnD,8EAA2E;AAC3E,sDAAmD;AAInD,SAAgB,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,IAAA,4BAAY,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA0B,CAAC;QACpD,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7B;QAED,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjF,OAAO,IAAA,+BAAc,EAAC,OAAO,EAAE;YAC3B,GAAG,eAAe;YAClB,oBAAoB,EAAE;gBAClB,GAAG,eAAe,CAAC,oBAAoB;gBACvC,YAAY,EAAE,KAAK;aACtB;YACD,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAA0C,CAAC,OAAO,EAAE,eAAe,CAAC;gBAC7E,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AA1BD,gFA0BC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processRequest = void 0;
|
|
4
|
+
const intl_1 = require("../intl");
|
|
2
5
|
/**
|
|
3
6
|
* This function combines the props returned from `getNewsroomServerSideProps` and your optional custom props for the page.
|
|
4
7
|
* It also handles locale redirects, if `canonicalUrl` parameter is provided.
|
|
@@ -8,7 +11,7 @@ import { getRedirectToCanonicalLocale, getShortestLocaleCode, LocaleObject } fro
|
|
|
8
11
|
* @param props Object containing the return of `getNewsroomServerSideProps` and your optional custom props.
|
|
9
12
|
* @param canonicalUrl Optional: a canonical URL for the current page without locale part. If provided, locale redirects will be handled by the function.
|
|
10
13
|
*/
|
|
11
|
-
|
|
14
|
+
function processRequest(context, props, canonicalUrl) {
|
|
12
15
|
const { locale: nextLocale, query } = context;
|
|
13
16
|
const { localeResolved, ...pageProps } = props;
|
|
14
17
|
// If no locale was provided by Next, it most likely means that the theme is not supporting multi-language.
|
|
@@ -18,9 +21,9 @@ export function processRequest(context, props, canonicalUrl) {
|
|
|
18
21
|
}
|
|
19
22
|
if (canonicalUrl) {
|
|
20
23
|
const { languages, localeCode } = pageProps.newsroomContextProps;
|
|
21
|
-
const currentLocale = LocaleObject.fromAnyCode(localeCode);
|
|
22
|
-
const shortestLocaleCode = getShortestLocaleCode(languages, currentLocale);
|
|
23
|
-
const redirect = getRedirectToCanonicalLocale(shortestLocaleCode, nextLocale, canonicalUrl, query);
|
|
24
|
+
const currentLocale = intl_1.LocaleObject.fromAnyCode(localeCode);
|
|
25
|
+
const shortestLocaleCode = (0, intl_1.getShortestLocaleCode)(languages, currentLocale);
|
|
26
|
+
const redirect = (0, intl_1.getRedirectToCanonicalLocale)(shortestLocaleCode, nextLocale, canonicalUrl, query);
|
|
24
27
|
if (redirect) {
|
|
25
28
|
return { redirect };
|
|
26
29
|
}
|
|
@@ -29,4 +32,5 @@ export function processRequest(context, props, canonicalUrl) {
|
|
|
29
32
|
props: pageProps,
|
|
30
33
|
};
|
|
31
34
|
}
|
|
35
|
+
exports.processRequest = processRequest;
|
|
32
36
|
//# sourceMappingURL=processRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":";;;AAEA,kCAA4F;AAG5F;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC1B,OAAkC,EAClC,KAA8C,EAC9C,YAAqB;IAErB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAE9C,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,2GAA2G;IAC3G,uCAAuC;IACvC,IAAI,CAAC,cAAc,IAAI,UAAU,EAAE;QAC/B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC7B;IAED,IAAI,YAAY,EAAE;QACd,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC,oBAAoB,CAAC;QACjE,MAAM,aAAa,GAAG,mBAAY,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC3D,MAAM,kBAAkB,GAAG,IAAA,4BAAqB,EAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAE3E,MAAM,QAAQ,GAAG,IAAA,mCAA4B,EACzC,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,KAAK,CACR,CAAC;QACF,IAAI,QAAQ,EAAE;YACV,OAAO,EAAE,QAAQ,EAAE,CAAC;SACvB;KACJ;IAED,OAAO;QACH,KAAK,EAAE,SAA8B;KACxC,CAAC;AACN,CAAC;AAlCD,wCAkCC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.processStaticRequest = void 0;
|
|
1
4
|
/**
|
|
2
5
|
* This function combines the props returned from `getNewsroomStaticProps` and your optional custom props for the page.
|
|
3
6
|
* See README for usage examples.
|
|
@@ -6,7 +9,7 @@
|
|
|
6
9
|
* @param props Object containing the return of `getNewsroomServerSideProps` and your optional custom props.
|
|
7
10
|
* @param revalidateTimeout Optional: timeout in seconds to use with Next ISR.
|
|
8
11
|
*/
|
|
9
|
-
|
|
12
|
+
function processStaticRequest(context, props, revalidateTimeout) {
|
|
10
13
|
const { locale: nextLocale } = context;
|
|
11
14
|
const { localeResolved, ...pageProps } = props;
|
|
12
15
|
// If no locale was provided by Next, it most likely means that the theme is not supporting multi-language.
|
|
@@ -19,4 +22,5 @@ export function processStaticRequest(context, props, revalidateTimeout) {
|
|
|
19
22
|
revalidate: revalidateTimeout,
|
|
20
23
|
};
|
|
21
24
|
}
|
|
25
|
+
exports.processStaticRequest = processStaticRequest;
|
|
22
26
|
//# sourceMappingURL=processStaticRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processStaticRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processStaticRequest.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AACH,
|
|
1
|
+
{"version":3,"file":"processStaticRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processStaticRequest.ts"],"names":[],"mappings":";;;AAIA;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAChC,OAA8B,EAC9B,KAA8C,EAC9C,iBAA0B;IAE1B,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,2GAA2G;IAC3G,uCAAuC;IACvC,IAAI,CAAC,cAAc,IAAI,UAAU,EAAE;QAC/B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC7B;IAED,OAAO;QACH,KAAK,EAAE,SAA8B;QACrC,UAAU,EAAE,iBAAiB;KAChC,CAAC;AACN,CAAC;AAnBD,oDAmBC"}
|
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageSeo = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const next_seo_1 = require("next-seo");
|
|
6
|
+
const router_1 = require("next/router");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const intl_1 = require("../../intl");
|
|
9
|
+
const newsroom_context_1 = require("../../newsroom-context");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const getAbsoluteUrl_1 = require("./lib/getAbsoluteUrl");
|
|
9
12
|
/**
|
|
10
13
|
* This component provides base page attributes for every Newsroom page.
|
|
11
14
|
* It depends on information from NewsroomContext, so the component should be placed inside the `NewsroomContextProvider`.
|
|
12
15
|
* You can pass additional props expected by NextSeo component to override any info that is provided by the NewsroomContext.
|
|
13
16
|
*/
|
|
14
|
-
|
|
15
|
-
const companyInformation = useCompanyInformation();
|
|
16
|
-
const newsroom = useNewsroom();
|
|
17
|
-
const currentLocale = useCurrentLocale();
|
|
18
|
-
const languages = useLanguages();
|
|
19
|
-
const getTranslationUrl = useGetTranslationUrl();
|
|
20
|
-
const getLinkLocaleSlug = useGetLinkLocaleSlug();
|
|
21
|
-
const currentStory = useCurrentStory();
|
|
22
|
-
const { asPath } = useRouter();
|
|
17
|
+
function PageSeo({ title, description, imageUrl, canonical, openGraph, twitter, ...nextSeoProps }) {
|
|
18
|
+
const companyInformation = (0, newsroom_context_1.useCompanyInformation)();
|
|
19
|
+
const newsroom = (0, newsroom_context_1.useNewsroom)();
|
|
20
|
+
const currentLocale = (0, newsroom_context_1.useCurrentLocale)();
|
|
21
|
+
const languages = (0, newsroom_context_1.useLanguages)();
|
|
22
|
+
const getTranslationUrl = (0, newsroom_context_1.useGetTranslationUrl)();
|
|
23
|
+
const getLinkLocaleSlug = (0, newsroom_context_1.useGetLinkLocaleSlug)();
|
|
24
|
+
const currentStory = (0, newsroom_context_1.useCurrentStory)();
|
|
25
|
+
const { asPath } = (0, router_1.useRouter)();
|
|
23
26
|
const pageTitle = title || companyInformation.name;
|
|
24
27
|
const pageDescription = description || companyInformation.about_plaintext;
|
|
25
|
-
const canonicalUrl = canonical || getAbsoluteUrl(asPath, newsroom.url, getLinkLocaleSlug(currentLocale));
|
|
28
|
+
const canonicalUrl = canonical || (0, getAbsoluteUrl_1.getAbsoluteUrl)(asPath, newsroom.url, getLinkLocaleSlug(currentLocale));
|
|
26
29
|
const siteName = companyInformation.name;
|
|
27
|
-
const logoUrl = imageUrl || getNewsroomLogoUrl(newsroom);
|
|
28
|
-
const alternateLanguageLinks = useMemo(() => {
|
|
30
|
+
const logoUrl = imageUrl || (0, utils_1.getNewsroomLogoUrl)(newsroom);
|
|
31
|
+
const alternateLanguageLinks = (0, react_1.useMemo)(() => {
|
|
29
32
|
if (!languages.length) {
|
|
30
33
|
return [];
|
|
31
34
|
}
|
|
32
|
-
const alternateLanguages = getUsedLanguages(languages).filter((language) => language.code !== currentLocale.toUnderscoreCode());
|
|
35
|
+
const alternateLanguages = (0, intl_1.getUsedLanguages)(languages).filter((language) => language.code !== currentLocale.toUnderscoreCode());
|
|
33
36
|
return alternateLanguages
|
|
34
37
|
.map((language) => {
|
|
35
|
-
const locale = LocaleObject.fromAnyCode(language.code);
|
|
38
|
+
const locale = intl_1.LocaleObject.fromAnyCode(language.code);
|
|
36
39
|
const translationLink = getTranslationUrl(locale, true);
|
|
37
40
|
if (!translationLink) {
|
|
38
41
|
return undefined;
|
|
39
42
|
}
|
|
40
43
|
return {
|
|
41
44
|
hrefLang: locale.toHyphenCode(),
|
|
42
|
-
href: getAbsoluteUrl(translationLink, newsroom.url, currentStory && translationLink !== '/' ? false : getLinkLocaleSlug(locale)),
|
|
45
|
+
href: (0, getAbsoluteUrl_1.getAbsoluteUrl)(translationLink, newsroom.url, currentStory && translationLink !== '/' ? false : getLinkLocaleSlug(locale)),
|
|
43
46
|
};
|
|
44
47
|
})
|
|
45
48
|
.filter(Boolean);
|
|
@@ -51,7 +54,7 @@ export function PageSeo({ title, description, imageUrl, canonical, openGraph, tw
|
|
|
51
54
|
newsroom.url,
|
|
52
55
|
currentStory,
|
|
53
56
|
]);
|
|
54
|
-
return (
|
|
57
|
+
return ((0, jsx_runtime_1.jsx)(next_seo_1.NextSeo, { title: pageTitle, description: pageDescription, canonical: canonicalUrl, noindex: newsroom.is_indexable, nofollow: newsroom.is_indexable, openGraph: {
|
|
55
58
|
url: canonicalUrl,
|
|
56
59
|
title: pageTitle,
|
|
57
60
|
description: pageDescription,
|
|
@@ -70,4 +73,5 @@ export function PageSeo({ title, description, imageUrl, canonical, openGraph, tw
|
|
|
70
73
|
...twitter,
|
|
71
74
|
}, additionalMetaTags: [{ name: 'twitter:image', content: logoUrl }], languageAlternates: alternateLanguageLinks, ...nextSeoProps }));
|
|
72
75
|
}
|
|
76
|
+
exports.PageSeo = PageSeo;
|
|
73
77
|
//# sourceMappingURL=PageSeo.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageSeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/PageSeo.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PageSeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/PageSeo.tsx"],"names":[],"mappings":";;;;AAAA,uCAAmC;AAEnC,wCAAwC;AACxC,iCAAgC;AAEhC,qCAA4D;AAC5D,6DAQgC;AAChC,uCAAiD;AAEjD,yDAAsD;AAOtD;;;;GAIG;AACH,SAAgB,OAAO,CAAC,EACpB,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,EACT,OAAO,EACP,GAAG,YAAY,EACX;IACJ,MAAM,kBAAkB,GAAG,IAAA,wCAAqB,GAAE,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAA,8BAAW,GAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,IAAA,mCAAgB,GAAE,CAAC;IACzC,MAAM,SAAS,GAAG,IAAA,+BAAY,GAAE,CAAC;IACjC,MAAM,iBAAiB,GAAG,IAAA,uCAAoB,GAAE,CAAC;IACjD,MAAM,iBAAiB,GAAG,IAAA,uCAAoB,GAAE,CAAC;IACjD,MAAM,YAAY,GAAG,IAAA,kCAAe,GAAE,CAAC;IACvC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IAE/B,MAAM,SAAS,GAAG,KAAK,IAAI,kBAAkB,CAAC,IAAI,CAAC;IACnD,MAAM,eAAe,GAAG,WAAW,IAAI,kBAAkB,CAAC,eAAe,CA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QACZ,YAAY;KACf,CAAC,CAAC;IAEH,OAAO,CACH,uBAAC,kBAAO,IACJ,KAAK,EAAE,SAAS,EAChB,WAAW,EAAE,eAAe,EAC5B,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,QAAQ,CAAC,YAAY,EAC9B,QAAQ,EAAE,QAAQ,CAAC,YAAY,EAC/B,SAAS,EAAE;YACP,GAAG,EAAE,YAAY;YACjB,KAAK,EAAE,SAAS;YAChB,WAAW,EAAE,eAAe;YAC5B,MAAM,EAAE,aAAa,CAAC,gBAAgB,EAAE;YACxC,MAAM,EAAE;gBACJ;oBACI,GAAG,EAAE,OAAO;oBACZ,GAAG,EAAE,SAAS;iBACjB;aACJ;YACD,SAAS,EAAE,QAAQ;YACnB,GAAG,SAAS;SACf,EACD,OAAO,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,SAAS;YACnB,GAAG,OAAO;SACb,EACD,kBAAkB,EAAE,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,EACjE,kBAAkB,EAAE,sBAAsB,KACtC,YAAY,GAClB,CACL,CAAC;AACN,CAAC;AA9FD,0BA8FC"}
|
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
+
exports.PageSeo = void 0;
|
|
18
|
+
var PageSeo_1 = require("./PageSeo");
|
|
19
|
+
Object.defineProperty(exports, "PageSeo", { enumerable: true, get: function () { return PageSeo_1.PageSeo; } });
|
|
20
|
+
__exportStar(require("./lib/types"), exports);
|
|
3
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components-nextjs/PageSeo/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAAoC;AAA3B,kGAAA,OAAO,OAAA;AAChB,8CAA4B"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAbsoluteUrl = void 0;
|
|
1
4
|
// Returns absolute URL based on the path and without any query parameters
|
|
2
|
-
|
|
5
|
+
function getAbsoluteUrl(path, origin, localeCode) {
|
|
3
6
|
const url = new URL(`${localeCode ? `/${localeCode}` : ''}${path || '/'}`, origin);
|
|
4
7
|
url.search = '';
|
|
5
8
|
return url.toString();
|
|
6
9
|
}
|
|
10
|
+
exports.getAbsoluteUrl = getAbsoluteUrl;
|
|
7
11
|
//# sourceMappingURL=getAbsoluteUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAbsoluteUrl.js","sourceRoot":"","sources":["../../../../src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,
|
|
1
|
+
{"version":3,"file":"getAbsoluteUrl.js","sourceRoot":"","sources":["../../../../src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts"],"names":[],"mappings":";;;AAAA,0EAA0E;AAC1E,SAAgB,cAAc,CAAC,IAAY,EAAE,MAAc,EAAE,UAA2B;IACpF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,IAAI,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC;IACnF,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC;IAEhB,OAAO,GAAG,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AALD,wCAKC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StorySeo = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const sdk_1 = require("@prezly/sdk");
|
|
6
|
+
const next_seo_1 = require("next-seo");
|
|
4
7
|
/**
|
|
5
8
|
* This components provides additional page attributes for the Story page.
|
|
6
9
|
* It works in conjunction with `PageSeo` component, overidding some of its attributes.
|
|
7
10
|
*/
|
|
8
|
-
|
|
11
|
+
function StorySeo({ story }) {
|
|
9
12
|
const { title, subtitle, published_at, updated_at, author, oembed, newsroom, summary } = story;
|
|
10
13
|
const authorName = author?.display_name || author?.email || 'Unknown';
|
|
11
14
|
const description = subtitle || summary;
|
|
12
|
-
const indexable = newsroom.is_indexable && story.visibility === StoryVisibility.PUBLIC;
|
|
13
|
-
return (
|
|
15
|
+
const indexable = newsroom.is_indexable && story.visibility === sdk_1.StoryVisibility.PUBLIC;
|
|
16
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(next_seo_1.NextSeo, { title: title, description: description, canonical: oembed.url, noindex: !indexable, nofollow: !indexable, openGraph: {
|
|
14
17
|
title,
|
|
15
18
|
description,
|
|
16
19
|
url: oembed.url,
|
|
@@ -36,6 +39,7 @@ export function StorySeo({ story }) {
|
|
|
36
39
|
{ name: 'twitter:card', content: 'summary_large_image' },
|
|
37
40
|
{ name: 'twitter:image', content: oembed.thumbnail_url },
|
|
38
41
|
]
|
|
39
|
-
: undefined }),
|
|
42
|
+
: undefined }), (0, jsx_runtime_1.jsx)(next_seo_1.ArticleJsonLd, { url: oembed.url, title: title, images: oembed.thumbnail_url ? [oembed.thumbnail_url] : [], datePublished: published_at || '', dateModified: updated_at, authorName: [authorName], publisherName: newsroom.display_name, publisherLogo: newsroom.thumbnail_url, description: description })] }));
|
|
40
43
|
}
|
|
44
|
+
exports.StorySeo = StorySeo;
|
|
41
45
|
//# sourceMappingURL=StorySeo.js.map
|