@prezly/theme-kit-nextjs 2.0.1-1 → 2.0.1-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/global.d.js +1 -1
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +3 -9
- package/build/adapter-nextjs/api-handlers/fetchStories.js +3 -9
- package/build/adapter-nextjs/api-handlers/index.js +2 -19
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +3 -9
- package/build/adapter-nextjs/getNewsroomStaticProps.js +3 -9
- package/build/adapter-nextjs/index.js +6 -71
- package/build/adapter-nextjs/page-props/category.js +19 -27
- package/build/adapter-nextjs/page-props/gallery.js +13 -20
- package/build/adapter-nextjs/page-props/galleryAlbum.js +13 -21
- package/build/adapter-nextjs/page-props/home.js +13 -20
- package/build/adapter-nextjs/page-props/index.js +8 -138
- package/build/adapter-nextjs/page-props/lib/types.js +1 -1
- package/build/adapter-nextjs/page-props/search.js +10 -17
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +2 -9
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +1 -7
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +7 -13
- package/build/adapter-nextjs/page-props/sitemap/index.js +4 -43
- package/build/adapter-nextjs/page-props/sitemap/types.js +1 -1
- package/build/adapter-nextjs/page-props/story.js +17 -25
- package/build/adapter-nextjs/page-props/storyPreview.js +7 -13
- package/build/adapter-nextjs/processRequest.js +5 -11
- package/build/adapter-nextjs/processStaticRequest.js +1 -7
- package/build/components-nextjs/PageSeo/PageSeo.js +24 -30
- package/build/components-nextjs/PageSeo/index.js +2 -27
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -7
- package/build/components-nextjs/PageSeo/lib/types.js +1 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +6 -12
- package/build/components-nextjs/StorySeo/index.js +1 -12
- package/build/components-nextjs/document.d.ts +4 -2
- package/build/components-nextjs/document.js +13 -19
- package/build/components-nextjs/document.js.map +1 -1
- package/build/components-nextjs/index.js +3 -26
- package/build/data-fetching/api/PrezlyApi.js +30 -37
- package/build/data-fetching/api/getPrezlyApi.js +5 -11
- package/build/data-fetching/api/index.js +1 -16
- package/build/data-fetching/api/queries.js +5 -15
- package/build/data-fetching/index.js +3 -38
- package/build/data-fetching/lib/getAlgoliaSettings.js +3 -9
- package/build/data-fetching/lib/getEnvVariables.js +3 -10
- package/build/data-fetching/lib/index.js +4 -33
- package/build/data-fetching/lib/isSdkError.js +1 -7
- package/build/data-fetching/lib/isUuid.js +1 -7
- package/build/data-fetching/types.js +1 -1
- package/build/index.js +9 -104
- package/build/infinite-loading/index.js +4 -43
- package/build/infinite-loading/types.js +1 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +3 -9
- package/build/infinite-loading/useInfiniteLoading.js +9 -15
- package/build/infinite-loading/useInfiniteStoriesLoading.js +7 -13
- package/build/intl/index.js +4 -49
- package/build/intl/languages.js +23 -39
- package/build/intl/locale.js +10 -20
- package/build/intl/localeConfig.js +5 -14
- package/build/intl/localeList.js +1 -8
- package/build/intl/localeObject.js +4 -11
- package/build/newsroom-context/context.js +5 -13
- package/build/newsroom-context/hooks/index.js +11 -126
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +3 -9
- package/build/newsroom-context/hooks/useCategories.js +3 -9
- package/build/newsroom-context/hooks/useCompanyInformation.js +3 -9
- package/build/newsroom-context/hooks/useCurrentCategory.js +3 -9
- package/build/newsroom-context/hooks/useCurrentLocale.js +3 -9
- package/build/newsroom-context/hooks/useCurrentStory.js +3 -9
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +10 -16
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +20 -26
- package/build/newsroom-context/hooks/useLanguages.js +3 -9
- package/build/newsroom-context/hooks/useNewsroom.js +3 -9
- package/build/newsroom-context/hooks/useNewsroomContext.js +4 -10
- package/build/newsroom-context/index.js +2 -34
- package/build/sentry/client.js +3 -9
- package/build/sentry/common.js +1 -7
- package/build/sentry/index.js +2 -19
- package/build/sentry/server.js +3 -9
- package/build/types.js +1 -1
- package/build/utils/boilerplate.js +3 -11
- package/build/utils/constants.js +3 -12
- package/build/utils/getAssetsUrl.js +3 -9
- package/build/utils/getDataRequestLink.js +3 -9
- package/build/utils/getLocalizedCategoryData.js +3 -11
- package/build/utils/getNewsroomLogoUrl.js +5 -12
- package/build/utils/getPrivacyPortalUrl.js +1 -7
- package/build/utils/getStoryPublicationDate.js +1 -7
- package/build/utils/getUploadcareGroupUrl.js +3 -9
- package/build/utils/index.js +10 -115
- package/build/utils/isEmbargoStory.js +1 -7
- package/package.json +3 -2
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useInfiniteLoading = useInfiniteLoading;
|
|
7
|
-
var _web = require("@react-hookz/web");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
function useInfiniteLoading({
|
|
1
|
+
import { useAsync } from '@react-hookz/web';
|
|
2
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
export function useInfiniteLoading({
|
|
10
4
|
fetchingFn,
|
|
11
5
|
initialData,
|
|
12
6
|
pagination
|
|
13
7
|
}) {
|
|
14
|
-
const [data, setData] =
|
|
15
|
-
const [currentPage, setCurrentPage] =
|
|
8
|
+
const [data, setData] = useState(initialData);
|
|
9
|
+
const [currentPage, setCurrentPage] = useState(pagination.currentPage);
|
|
16
10
|
const {
|
|
17
11
|
itemsTotal,
|
|
18
12
|
pageSize
|
|
@@ -24,22 +18,22 @@ function useInfiniteLoading({
|
|
|
24
18
|
status
|
|
25
19
|
}, {
|
|
26
20
|
execute: loadMoreFn
|
|
27
|
-
}] =
|
|
21
|
+
}] = useAsync(async () => {
|
|
28
22
|
const nextPage = currentPage + 1;
|
|
29
23
|
const newData = await fetchingFn(nextPage, pageSize);
|
|
30
24
|
setCurrentPage(nextPage);
|
|
31
25
|
setData(currentData => [...currentData, ...newData]);
|
|
32
26
|
});
|
|
33
|
-
const loadMore =
|
|
27
|
+
const loadMore = useCallback(() => {
|
|
34
28
|
if (canLoadMore) {
|
|
35
29
|
loadMoreFn();
|
|
36
30
|
}
|
|
37
31
|
}, [canLoadMore, loadMoreFn]);
|
|
38
|
-
const resetData =
|
|
32
|
+
const resetData = useCallback(() => {
|
|
39
33
|
setData(initialData);
|
|
40
34
|
setCurrentPage(pagination.currentPage);
|
|
41
35
|
}, [pagination.currentPage, initialData]);
|
|
42
|
-
|
|
36
|
+
useEffect(() => {
|
|
43
37
|
if (error) {
|
|
44
38
|
// eslint-disable-next-line no-console
|
|
45
39
|
console.error(error);
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useInfiniteStoriesLoading = useInfiniteStoriesLoading;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _index = require("../newsroom-context/index.js");
|
|
9
|
-
var _useInfiniteLoading = require("./useInfiniteLoading.js");
|
|
1
|
+
import { useEffect } from 'react';
|
|
2
|
+
import { useCurrentLocale } from "../newsroom-context/index.js";
|
|
3
|
+
import { useInfiniteLoading } from "./useInfiniteLoading.js";
|
|
10
4
|
async function fetchStories(page, pageSize, category, locale, include) {
|
|
11
5
|
const result = await fetch('/api/fetch-stories', {
|
|
12
6
|
method: 'POST',
|
|
@@ -37,15 +31,15 @@ async function fetchStories(page, pageSize, category, locale, include) {
|
|
|
37
31
|
* The handler for this route is exported from `apiHandlers/fetchStories.ts` file.
|
|
38
32
|
* See https://github.com/prezly/theme-nextjs-bea/blob/d381e9878187ca98815d240d3ffdf10a75993c14/pages/index.tsx#L24 for usage example
|
|
39
33
|
*/
|
|
40
|
-
function useInfiniteStoriesLoading(initialStories, pagination, category, include) {
|
|
41
|
-
const currentLocale =
|
|
34
|
+
export function useInfiniteStoriesLoading(initialStories, pagination, category, include) {
|
|
35
|
+
const currentLocale = useCurrentLocale();
|
|
42
36
|
const {
|
|
43
37
|
canLoadMore,
|
|
44
38
|
data,
|
|
45
39
|
isLoading,
|
|
46
40
|
loadMore,
|
|
47
41
|
resetData
|
|
48
|
-
} =
|
|
42
|
+
} = useInfiniteLoading({
|
|
49
43
|
fetchingFn: async (nextPage, pageSize) => {
|
|
50
44
|
const {
|
|
51
45
|
stories
|
|
@@ -55,7 +49,7 @@ function useInfiniteStoriesLoading(initialStories, pagination, category, include
|
|
|
55
49
|
initialData: initialStories,
|
|
56
50
|
pagination
|
|
57
51
|
});
|
|
58
|
-
|
|
52
|
+
useEffect(() => {
|
|
59
53
|
if (category?.id) {
|
|
60
54
|
resetData();
|
|
61
55
|
}
|
package/build/intl/index.js
CHANGED
|
@@ -1,49 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
var _languages = require("./languages.js");
|
|
7
|
-
Object.keys(_languages).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _languages[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return _languages[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _locale = require("./locale.js");
|
|
18
|
-
Object.keys(_locale).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _locale[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _locale[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _localeConfig = require("./localeConfig.js");
|
|
29
|
-
Object.keys(_localeConfig).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _localeConfig[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _localeConfig[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _localeObject = require("./localeObject.js");
|
|
40
|
-
Object.keys(_localeObject).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _localeObject[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _localeObject[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
1
|
+
export * from "./languages.js";
|
|
2
|
+
export * from "./locale.js";
|
|
3
|
+
export * from "./localeConfig.js";
|
|
4
|
+
export * from "./localeObject.js";
|
package/build/intl/languages.js
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getCompanyInformation = getCompanyInformation;
|
|
7
|
-
exports.getDefaultLanguage = getDefaultLanguage;
|
|
8
|
-
exports.getLanguageByExactLocaleCode = getLanguageByExactLocaleCode;
|
|
9
|
-
exports.getLanguageByNeutralLocaleCode = getLanguageByNeutralLocaleCode;
|
|
10
|
-
exports.getLanguageByShortRegionCode = getLanguageByShortRegionCode;
|
|
11
|
-
exports.getLanguageDisplayName = getLanguageDisplayName;
|
|
12
|
-
exports.getLanguageFromNextLocaleIsoCode = getLanguageFromNextLocaleIsoCode;
|
|
13
|
-
exports.getLanguageFromStory = getLanguageFromStory;
|
|
14
|
-
exports.getNotifications = getNotifications;
|
|
15
|
-
exports.getShortestLocaleCode = getShortestLocaleCode;
|
|
16
|
-
exports.getUsedLanguages = getUsedLanguages;
|
|
17
|
-
var _localeConfig = require("./localeConfig.js");
|
|
18
|
-
var _localeObject = require("./localeObject.js");
|
|
1
|
+
import { DUMMY_DEFAULT_LOCALE } from "./localeConfig.js";
|
|
2
|
+
import { LocaleObject } from "./localeObject.js";
|
|
19
3
|
function isOnlyCulture(culture, languages) {
|
|
20
4
|
const numberOfLanguages = languages.filter(({
|
|
21
5
|
locale: {
|
|
@@ -37,7 +21,7 @@ function isOnlyCulture(culture, languages) {
|
|
|
37
21
|
* - English (Global), English (UK), Spanish (Spain)
|
|
38
22
|
* - -> English (Global), English (UK), Spanish
|
|
39
23
|
*/
|
|
40
|
-
function getLanguageDisplayName(language, languages) {
|
|
24
|
+
export function getLanguageDisplayName(language, languages) {
|
|
41
25
|
const {
|
|
42
26
|
locale
|
|
43
27
|
} = language;
|
|
@@ -53,7 +37,7 @@ function getLanguageDisplayName(language, languages) {
|
|
|
53
37
|
/**
|
|
54
38
|
* @returns Language set as default in the Newsroom Settings.
|
|
55
39
|
*/
|
|
56
|
-
function getDefaultLanguage(languages) {
|
|
40
|
+
export function getDefaultLanguage(languages) {
|
|
57
41
|
return languages.find(({
|
|
58
42
|
is_default
|
|
59
43
|
}) => is_default) || languages[0];
|
|
@@ -62,10 +46,10 @@ function getDefaultLanguage(languages) {
|
|
|
62
46
|
/**
|
|
63
47
|
* @returns Only languages having at least one published story
|
|
64
48
|
*/
|
|
65
|
-
function getUsedLanguages(languages) {
|
|
49
|
+
export function getUsedLanguages(languages) {
|
|
66
50
|
return languages.filter(language => language.public_stories_count > 0);
|
|
67
51
|
}
|
|
68
|
-
function getLanguageByExactLocaleCode(languages, locale) {
|
|
52
|
+
export function getLanguageByExactLocaleCode(languages, locale) {
|
|
69
53
|
const localeCode = locale.toUnderscoreCode();
|
|
70
54
|
return languages.find(({
|
|
71
55
|
code
|
|
@@ -73,7 +57,7 @@ function getLanguageByExactLocaleCode(languages, locale) {
|
|
|
73
57
|
}
|
|
74
58
|
|
|
75
59
|
// See https://github.com/prezly/prezly/blob/master/lib/model/CulturePeer.php#L123
|
|
76
|
-
function getLanguageByNeutralLocaleCode(languages, locale) {
|
|
60
|
+
export function getLanguageByNeutralLocaleCode(languages, locale) {
|
|
77
61
|
const neutralLanguageCode = locale.toNeutralLanguageCode();
|
|
78
62
|
|
|
79
63
|
// Prefer default language
|
|
@@ -87,7 +71,7 @@ function getLanguageByNeutralLocaleCode(languages, locale) {
|
|
|
87
71
|
const usedLanguages = getUsedLanguages(languages);
|
|
88
72
|
const usedLanguage = usedLanguages.find(({
|
|
89
73
|
code
|
|
90
|
-
}) =>
|
|
74
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === neutralLanguageCode);
|
|
91
75
|
if (usedLanguage) {
|
|
92
76
|
return usedLanguage;
|
|
93
77
|
}
|
|
@@ -95,16 +79,16 @@ function getLanguageByNeutralLocaleCode(languages, locale) {
|
|
|
95
79
|
// Search in all languages
|
|
96
80
|
return languages.find(({
|
|
97
81
|
code
|
|
98
|
-
}) =>
|
|
82
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === neutralLanguageCode);
|
|
99
83
|
}
|
|
100
84
|
|
|
101
85
|
// See https://github.com/prezly/prezly/blob/master/lib/model/CulturePeer.php#L159
|
|
102
|
-
function getLanguageByShortRegionCode(languages, locale) {
|
|
86
|
+
export function getLanguageByShortRegionCode(languages, locale) {
|
|
103
87
|
const shortRegionCode = locale.toRegionCode();
|
|
104
88
|
|
|
105
89
|
// Prefer default language
|
|
106
90
|
const defaultLanguage = getDefaultLanguage(languages);
|
|
107
|
-
if (
|
|
91
|
+
if (LocaleObject.fromAnyCode(defaultLanguage.code).toRegionCode() === shortRegionCode) {
|
|
108
92
|
return defaultLanguage;
|
|
109
93
|
}
|
|
110
94
|
|
|
@@ -112,7 +96,7 @@ function getLanguageByShortRegionCode(languages, locale) {
|
|
|
112
96
|
const usedLanguages = getUsedLanguages(languages);
|
|
113
97
|
const usedLanguage = usedLanguages.find(({
|
|
114
98
|
code
|
|
115
|
-
}) =>
|
|
99
|
+
}) => LocaleObject.fromAnyCode(code).toRegionCode() === shortRegionCode);
|
|
116
100
|
if (usedLanguage) {
|
|
117
101
|
return usedLanguage;
|
|
118
102
|
}
|
|
@@ -120,19 +104,19 @@ function getLanguageByShortRegionCode(languages, locale) {
|
|
|
120
104
|
// Search in all languages
|
|
121
105
|
return languages.find(({
|
|
122
106
|
code
|
|
123
|
-
}) =>
|
|
107
|
+
}) => LocaleObject.fromAnyCode(code).toRegionCode() === shortRegionCode);
|
|
124
108
|
}
|
|
125
109
|
|
|
126
110
|
/**
|
|
127
111
|
* Retrieve a culture with fallback to legacy codes support.
|
|
128
112
|
* Pulled from https://github.com/prezly/prezly/blob/de9900d9890a33502780494aa3fb85c9a732b3c3/lib/model/CulturePeer.php#L91-L114
|
|
129
113
|
*/
|
|
130
|
-
function getLanguageFromNextLocaleIsoCode(languages, nextLocaleIsoCode) {
|
|
114
|
+
export function getLanguageFromNextLocaleIsoCode(languages, nextLocaleIsoCode) {
|
|
131
115
|
const defaultLanguage = getDefaultLanguage(languages);
|
|
132
|
-
if (!nextLocaleIsoCode || nextLocaleIsoCode ===
|
|
116
|
+
if (!nextLocaleIsoCode || nextLocaleIsoCode === DUMMY_DEFAULT_LOCALE) {
|
|
133
117
|
return defaultLanguage;
|
|
134
118
|
}
|
|
135
|
-
const locale =
|
|
119
|
+
const locale = LocaleObject.fromAnyCode(nextLocaleIsoCode);
|
|
136
120
|
let targetLanguage;
|
|
137
121
|
if (nextLocaleIsoCode.length >= 2 && nextLocaleIsoCode.length <= 4) {
|
|
138
122
|
// The order of methods here is reversed from `getShortestLocaleCode`, so that the logic "unwraps" the possible variants with no collisions
|
|
@@ -142,7 +126,7 @@ function getLanguageFromNextLocaleIsoCode(languages, nextLocaleIsoCode) {
|
|
|
142
126
|
}
|
|
143
127
|
return targetLanguage;
|
|
144
128
|
}
|
|
145
|
-
function getLanguageFromStory(languages, story) {
|
|
129
|
+
export function getLanguageFromStory(languages, story) {
|
|
146
130
|
const {
|
|
147
131
|
code: storyLocaleCode
|
|
148
132
|
} = story.culture;
|
|
@@ -154,7 +138,7 @@ function getLanguageFromStory(languages, story) {
|
|
|
154
138
|
/**
|
|
155
139
|
* Extracts company information for the selected locale
|
|
156
140
|
*/
|
|
157
|
-
function getCompanyInformation(languages, locale) {
|
|
141
|
+
export function getCompanyInformation(languages, locale) {
|
|
158
142
|
const currentLanguage = getLanguageByExactLocaleCode(languages, locale) || getDefaultLanguage(languages);
|
|
159
143
|
return currentLanguage.company_information;
|
|
160
144
|
}
|
|
@@ -162,7 +146,7 @@ function getCompanyInformation(languages, locale) {
|
|
|
162
146
|
/**
|
|
163
147
|
* Get newsroom notifications for the selected locale
|
|
164
148
|
*/
|
|
165
|
-
function getNotifications(languages, locale) {
|
|
149
|
+
export function getNotifications(languages, locale) {
|
|
166
150
|
const currentLanguage = getLanguageByExactLocaleCode(languages, locale) || getDefaultLanguage(languages);
|
|
167
151
|
return currentLanguage.notifications;
|
|
168
152
|
}
|
|
@@ -175,7 +159,7 @@ function getNotifications(languages, locale) {
|
|
|
175
159
|
*
|
|
176
160
|
* @param locale A LocaleObject constructed from FULL locale code (taken straight from the selected language)
|
|
177
161
|
*/
|
|
178
|
-
function getShortestLocaleCode(languages, locale) {
|
|
162
|
+
export function getShortestLocaleCode(languages, locale) {
|
|
179
163
|
const localeCode = locale.toUnderscoreCode();
|
|
180
164
|
const defaultLanguage = getDefaultLanguage(languages);
|
|
181
165
|
// If it's a default locale, return false (no locale needed in URL)
|
|
@@ -187,7 +171,7 @@ function getShortestLocaleCode(languages, locale) {
|
|
|
187
171
|
const neutralLanguageCode = locale.toNeutralLanguageCode();
|
|
188
172
|
const matchingLanguagesByNeutralCode = languages.filter(({
|
|
189
173
|
code
|
|
190
|
-
}) =>
|
|
174
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === neutralLanguageCode || code === neutralLanguageCode);
|
|
191
175
|
if (matchingLanguagesByNeutralCode.length === 1) {
|
|
192
176
|
return neutralLanguageCode;
|
|
193
177
|
}
|
|
@@ -196,12 +180,12 @@ function getShortestLocaleCode(languages, locale) {
|
|
|
196
180
|
const shortRegionCode = locale.toRegionCode();
|
|
197
181
|
const matchingLanguagesByRegionCode = languages.filter(({
|
|
198
182
|
code
|
|
199
|
-
}) =>
|
|
183
|
+
}) => LocaleObject.fromAnyCode(code).toRegionCode() === shortRegionCode);
|
|
200
184
|
// Prevent collision with neutral language codes
|
|
201
185
|
const lowerCasedShortRegionCode = shortRegionCode.toLowerCase();
|
|
202
186
|
const mathchingNeutralLanguagesByRegionCode = languages.filter(({
|
|
203
187
|
code
|
|
204
|
-
}) =>
|
|
188
|
+
}) => LocaleObject.fromAnyCode(code).toNeutralLanguageCode() === lowerCasedShortRegionCode || code === lowerCasedShortRegionCode);
|
|
205
189
|
if (matchingLanguagesByRegionCode.length === 1 &&
|
|
206
190
|
// If there are 2 or more matching neutral languages, it means that there are no languages that can be shortened to neutral code
|
|
207
191
|
mathchingNeutralLanguagesByRegionCode.length !== 1 &&
|
package/build/intl/locale.js
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
exports.DEFAULT_LOCALE = void 0;
|
|
7
|
-
exports.getLocaleDirection = getLocaleDirection;
|
|
8
|
-
exports.getRedirectToCanonicalLocale = getRedirectToCanonicalLocale;
|
|
9
|
-
exports.getSupportedLocaleIsoCode = getSupportedLocaleIsoCode;
|
|
10
|
-
var _querystring = require("querystring");
|
|
11
|
-
var _localeConfig = require("./localeConfig.js");
|
|
12
|
-
var _localeObject = require("./localeObject.js");
|
|
13
|
-
const DEFAULT_LOCALE = 'en';
|
|
1
|
+
import { stringify } from 'querystring';
|
|
2
|
+
import { DUMMY_DEFAULT_LOCALE } from "./localeConfig.js";
|
|
3
|
+
import { LocaleObject } from "./localeObject.js";
|
|
4
|
+
export const DEFAULT_LOCALE = 'en';
|
|
14
5
|
|
|
15
6
|
/**
|
|
16
7
|
* This a list of locales that Prezly has translations for. Each code represents a language file in the `@prezly/themes-intl-messages` package.
|
|
17
8
|
* See https://github.com/prezly/themes-intl-messages for more info.
|
|
18
9
|
*/
|
|
19
|
-
exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
|
|
20
10
|
const SUPPORTED_LOCALES = ['af', 'ar', 'az', 'be', 'bg', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fi', 'fil', 'fr', 'ga', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kk', 'ko', 'lt', 'lv', 'mt', 'nl', 'no', 'pl', 'pt-BR', 'pt', 'ro', 'ru', 'sk', 'sl', 'sv', 'sw', 'th', 'tr', 'uk', 'ur', 'uz', 'vi', 'zh-CN', 'zh-TW'];
|
|
21
11
|
|
|
22
12
|
/**
|
|
23
13
|
* Use this function to determine which translations file you should load from `@prezly/themes-intl-mesages` package.
|
|
24
14
|
* See https://github.com/prezly/theme-nextjs-bea/blob/main/utils/lang.ts for a usage example.
|
|
25
15
|
*/
|
|
26
|
-
function getSupportedLocaleIsoCode(locale) {
|
|
16
|
+
export function getSupportedLocaleIsoCode(locale) {
|
|
27
17
|
const localeIsoCode = locale.toHyphenCode();
|
|
28
18
|
const isSupportedLocale = localeIsoCode.length >= 2 && SUPPORTED_LOCALES.includes(localeIsoCode);
|
|
29
19
|
if (isSupportedLocale) {
|
|
@@ -48,15 +38,15 @@ function getSupportedLocaleIsoCode(locale) {
|
|
|
48
38
|
console.warn('Unsupported locale provided. Please use `LocaleObject.fromAnyCode` to ensure you are using a correct language code');
|
|
49
39
|
return DEFAULT_LOCALE;
|
|
50
40
|
}
|
|
51
|
-
function getRedirectToCanonicalLocale(shortestLocaleCode, nextLocaleIsoCode, redirectPath, query) {
|
|
41
|
+
export function getRedirectToCanonicalLocale(shortestLocaleCode, nextLocaleIsoCode, redirectPath, query) {
|
|
52
42
|
// No need to redirect if no particular locale was requested by the application
|
|
53
|
-
if (!nextLocaleIsoCode || nextLocaleIsoCode ===
|
|
43
|
+
if (!nextLocaleIsoCode || nextLocaleIsoCode === DUMMY_DEFAULT_LOCALE) {
|
|
54
44
|
return undefined;
|
|
55
45
|
}
|
|
56
|
-
const shortestLocaleSlug = shortestLocaleCode ?
|
|
46
|
+
const shortestLocaleSlug = shortestLocaleCode ? LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug() : shortestLocaleCode;
|
|
57
47
|
if (shortestLocaleSlug !== nextLocaleIsoCode) {
|
|
58
48
|
const prefixedPath = redirectPath && !redirectPath.startsWith('/') ? `/${redirectPath}` : redirectPath;
|
|
59
|
-
const urlQuery = query ? `?${
|
|
49
|
+
const urlQuery = query ? `?${stringify(query)}` : '';
|
|
60
50
|
return {
|
|
61
51
|
destination: shortestLocaleSlug ? `/${shortestLocaleSlug}${prefixedPath}${urlQuery}` : `${prefixedPath}${urlQuery}`,
|
|
62
52
|
permanent: false
|
|
@@ -64,7 +54,7 @@ function getRedirectToCanonicalLocale(shortestLocaleCode, nextLocaleIsoCode, red
|
|
|
64
54
|
}
|
|
65
55
|
return undefined;
|
|
66
56
|
}
|
|
67
|
-
function getLocaleDirection(locale) {
|
|
57
|
+
export function getLocaleDirection(locale) {
|
|
68
58
|
const neutralLanguageCode = locale.toNeutralLanguageCode();
|
|
69
59
|
if (['ar', 'he', 'ur'].includes(neutralLanguageCode)) {
|
|
70
60
|
return 'rtl';
|
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.localeConfig = exports.DUMMY_DEFAULT_LOCALE = void 0;
|
|
7
|
-
var _localeList = require("./localeList.js");
|
|
8
1
|
/**
|
|
9
2
|
* This list is pulled from the main Prezly application. The underscores are replaced with dashes.
|
|
10
3
|
* Together with permutation performed lower in the code,
|
|
11
4
|
* the exported list represents all of the possible locale codes that Next.js theme application might accept.
|
|
12
5
|
*/
|
|
13
|
-
|
|
14
|
-
const lowercaseLocales =
|
|
6
|
+
import { localeList } from "./localeList.js";
|
|
7
|
+
const lowercaseLocales = localeList.map(l => l.toLowerCase());
|
|
15
8
|
|
|
16
9
|
// We use pseudo locale used for localization testing, to reliably determine if we need to fallback to the default newsroom language
|
|
17
|
-
const DUMMY_DEFAULT_LOCALE = 'qps-ploc';
|
|
10
|
+
export const DUMMY_DEFAULT_LOCALE = 'qps-ploc';
|
|
18
11
|
|
|
19
12
|
// Get all permutations for the shorter locale codes supported by Prezly (e.g. short region codes and neutral language codes)
|
|
20
|
-
exports.DUMMY_DEFAULT_LOCALE = DUMMY_DEFAULT_LOCALE;
|
|
21
13
|
const lowercaseLocalPermutations = Array.from(new Set([...lowercaseLocales, ...lowercaseLocales.map(code => code.split('-')[0]), ...lowercaseLocales.map(code => code.split('-')[1]).filter(Boolean)
|
|
22
14
|
// Remove number-only codes from possible permutations (like `419` for `es-419`)
|
|
23
15
|
.filter(code => Number.isNaN(Number(code)))])).sort();
|
|
24
|
-
const localeConfig = {
|
|
16
|
+
export const localeConfig = {
|
|
25
17
|
// These are all the locales you want to support in
|
|
26
18
|
// your application
|
|
27
19
|
locales: [DUMMY_DEFAULT_LOCALE, ...lowercaseLocalPermutations],
|
|
@@ -31,5 +23,4 @@ const localeConfig = {
|
|
|
31
23
|
defaultLocale: DUMMY_DEFAULT_LOCALE,
|
|
32
24
|
// Default locale detection is disabled, since the locales would be determined by Prezly API
|
|
33
25
|
localeDetection: false
|
|
34
|
-
};
|
|
35
|
-
exports.localeConfig = localeConfig;
|
|
26
|
+
};
|
package/build/intl/localeList.js
CHANGED
|
@@ -1,11 +1,4 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.localeList = void 0;
|
|
7
1
|
/**
|
|
8
2
|
* This list is pulled from the main Prezly application. The underscores are replaced with dashes.
|
|
9
3
|
*/
|
|
10
|
-
const localeList = ['af-ZA', 'ar', 'ar-AE', 'ar-BH', 'ar-QA', 'ar-SA', 'az', 'be', 'bg-BG', 'ca', 'cs-CZ', 'da-DK', 'de', 'de-DE', 'de-BE', 'de-AT', 'de-CH', 'el-GR', 'en', 'en-US', 'en-AE', 'en-AU', 'en-BD', 'en-BE', 'en-BH', 'en-CA', 'en-CN', 'en-DE', 'en-DK', 'en-GB', 'en-HK', 'en-ID', 'en-IE', 'en-IL', 'en-IN', 'en-JM', 'en-JP', 'en-KH', 'en-KR', 'en-LK', 'en-MV', 'en-MM', 'en-MY', 'en-NP', 'en-NZ', 'en-PH', 'en-PK', 'en-QA', 'en-SA', 'en-SG', 'en-TH', 'en-TW', 'en-VN', 'en-ZA', 'es', 'es-ES', 'es-MX', 'et-EE', 'es-419', 'fi-FI', 'fil', 'fr', 'fr-BE', 'fr-FR', 'fr-CA', 'fr-LU', 'ga-IE', 'he-IL', 'hi-IN', 'hr-HR', 'hu-HU', 'id-ID', 'it-IT', 'ja-JP', 'kk', 'ko-KR', 'ky', 'lt-LT', 'lv-LV', 'mt-MT', 'ms-MY', 'nb-NO', 'nl', 'nl-BE', 'nl-NL', 'pl-PL', 'pt', 'pt-BR', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK', 'sl-SI', 'sv-SE', 'sw', 'th-TH', 'tr-TR', 'uk-UA', 'ur-PK', 'uz', 'vi-VN', 'zh-Hant', 'zh-HK', 'zh-TW', 'zh-CN'];
|
|
11
|
-
exports.localeList = localeList;
|
|
4
|
+
export const localeList = ['af-ZA', 'ar', 'ar-AE', 'ar-BH', 'ar-QA', 'ar-SA', 'az', 'be', 'bg-BG', 'ca', 'cs-CZ', 'da-DK', 'de', 'de-DE', 'de-BE', 'de-AT', 'de-CH', 'el-GR', 'en', 'en-US', 'en-AE', 'en-AU', 'en-BD', 'en-BE', 'en-BH', 'en-CA', 'en-CN', 'en-DE', 'en-DK', 'en-GB', 'en-HK', 'en-ID', 'en-IE', 'en-IL', 'en-IN', 'en-JM', 'en-JP', 'en-KH', 'en-KR', 'en-LK', 'en-MV', 'en-MM', 'en-MY', 'en-NP', 'en-NZ', 'en-PH', 'en-PK', 'en-QA', 'en-SA', 'en-SG', 'en-TH', 'en-TW', 'en-VN', 'en-ZA', 'es', 'es-ES', 'es-MX', 'et-EE', 'es-419', 'fi-FI', 'fil', 'fr', 'fr-BE', 'fr-FR', 'fr-CA', 'fr-LU', 'ga-IE', 'he-IL', 'hi-IN', 'hr-HR', 'hu-HU', 'id-ID', 'it-IT', 'ja-JP', 'kk', 'ko-KR', 'ky', 'lt-LT', 'lv-LV', 'mt-MT', 'ms-MY', 'nb-NO', 'nl', 'nl-BE', 'nl-NL', 'pl-PL', 'pt', 'pt-BR', 'pt-PT', 'ro-RO', 'ru-RU', 'sk-SK', 'sl-SI', 'sv-SE', 'sw', 'th-TH', 'tr-TR', 'uk-UA', 'ur-PK', 'uz', 'vi-VN', 'zh-Hant', 'zh-HK', 'zh-TW', 'zh-CN'];
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LocaleObject = void 0;
|
|
7
|
-
var _localeConfig = require("./localeConfig.js");
|
|
1
|
+
import { localeConfig } from "./localeConfig.js";
|
|
8
2
|
/**
|
|
9
3
|
* This class is created to simplify working with locales and transforming between different locale code formats.
|
|
10
4
|
* Prezly API uses underscore-codes, while most frontend application tend to use hyphen-codes or slugs.
|
|
11
5
|
* Note that `fromAnyCode` constructor only accepts locales supported by Prezly backend. See `localeConfig` for reference.
|
|
12
6
|
*/
|
|
13
|
-
class LocaleObject {
|
|
7
|
+
export class LocaleObject {
|
|
14
8
|
/**
|
|
15
9
|
* Hyphen-separated locale code.
|
|
16
10
|
* Examples: `nl-BE`, `en-US`, `fr`, `fil`
|
|
@@ -39,7 +33,7 @@ class LocaleObject {
|
|
|
39
33
|
*/
|
|
40
34
|
static fromAnyCode(localeCode) {
|
|
41
35
|
const lowercaseCode = localeCode.toLowerCase().replace('_', '-');
|
|
42
|
-
const foundCode =
|
|
36
|
+
const foundCode = localeConfig.locales.find(code => code === lowercaseCode);
|
|
43
37
|
if (!foundCode) {
|
|
44
38
|
throw new Error(`Unsupported locale code provided: "${lowercaseCode}"`);
|
|
45
39
|
}
|
|
@@ -92,5 +86,4 @@ class LocaleObject {
|
|
|
92
86
|
isEqual(anotherLocale) {
|
|
93
87
|
return anotherLocale.toHyphenCode() === this.localeCode;
|
|
94
88
|
}
|
|
95
|
-
}
|
|
96
|
-
exports.LocaleObject = LocaleObject;
|
|
89
|
+
}
|
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.NewsroomContext = void 0;
|
|
7
|
-
exports.NewsroomContextProvider = NewsroomContextProvider;
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _index = require("../intl/index.js");
|
|
10
|
-
const NewsroomContext = /*#__PURE__*/(0, _react.createContext)(undefined);
|
|
1
|
+
import { createContext, useMemo } from 'react';
|
|
2
|
+
import { DEFAULT_LOCALE, LocaleObject } from "../intl/index.js";
|
|
3
|
+
export const NewsroomContext = /*#__PURE__*/createContext(undefined);
|
|
11
4
|
|
|
12
5
|
/**
|
|
13
6
|
* This context provides common Newsroom information retrieved by `getNewsroomServerSideProps` helper.
|
|
14
7
|
* Please refer to the `NewsroomContextType` definition for more info on what's exposed from the context.
|
|
15
8
|
*/
|
|
16
|
-
|
|
17
|
-
function NewsroomContextProvider({
|
|
9
|
+
export function NewsroomContextProvider({
|
|
18
10
|
categories,
|
|
19
11
|
contacts,
|
|
20
12
|
newsroom,
|
|
@@ -28,7 +20,7 @@ function NewsroomContextProvider({
|
|
|
28
20
|
algoliaSettings,
|
|
29
21
|
children
|
|
30
22
|
}) {
|
|
31
|
-
const locale =
|
|
23
|
+
const locale = useMemo(() => LocaleObject.fromAnyCode(localeCode || DEFAULT_LOCALE), [localeCode]);
|
|
32
24
|
return /*#__PURE__*/React.createElement(NewsroomContext.Provider, {
|
|
33
25
|
value: {
|
|
34
26
|
categories,
|
|
@@ -1,126 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
get: function () {
|
|
13
|
-
return _useAlgoliaSettings[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
17
|
-
var _useCategories = require("./useCategories.js");
|
|
18
|
-
Object.keys(_useCategories).forEach(function (key) {
|
|
19
|
-
if (key === "default" || key === "__esModule") return;
|
|
20
|
-
if (key in exports && exports[key] === _useCategories[key]) return;
|
|
21
|
-
Object.defineProperty(exports, key, {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function () {
|
|
24
|
-
return _useCategories[key];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
var _useCompanyInformation = require("./useCompanyInformation.js");
|
|
29
|
-
Object.keys(_useCompanyInformation).forEach(function (key) {
|
|
30
|
-
if (key === "default" || key === "__esModule") return;
|
|
31
|
-
if (key in exports && exports[key] === _useCompanyInformation[key]) return;
|
|
32
|
-
Object.defineProperty(exports, key, {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
get: function () {
|
|
35
|
-
return _useCompanyInformation[key];
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
var _useCurrentCategory = require("./useCurrentCategory.js");
|
|
40
|
-
Object.keys(_useCurrentCategory).forEach(function (key) {
|
|
41
|
-
if (key === "default" || key === "__esModule") return;
|
|
42
|
-
if (key in exports && exports[key] === _useCurrentCategory[key]) return;
|
|
43
|
-
Object.defineProperty(exports, key, {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
get: function () {
|
|
46
|
-
return _useCurrentCategory[key];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
var _useCurrentLocale = require("./useCurrentLocale.js");
|
|
51
|
-
Object.keys(_useCurrentLocale).forEach(function (key) {
|
|
52
|
-
if (key === "default" || key === "__esModule") return;
|
|
53
|
-
if (key in exports && exports[key] === _useCurrentLocale[key]) return;
|
|
54
|
-
Object.defineProperty(exports, key, {
|
|
55
|
-
enumerable: true,
|
|
56
|
-
get: function () {
|
|
57
|
-
return _useCurrentLocale[key];
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
var _useCurrentStory = require("./useCurrentStory.js");
|
|
62
|
-
Object.keys(_useCurrentStory).forEach(function (key) {
|
|
63
|
-
if (key === "default" || key === "__esModule") return;
|
|
64
|
-
if (key in exports && exports[key] === _useCurrentStory[key]) return;
|
|
65
|
-
Object.defineProperty(exports, key, {
|
|
66
|
-
enumerable: true,
|
|
67
|
-
get: function () {
|
|
68
|
-
return _useCurrentStory[key];
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
var _useGetLinkLocaleSlug = require("./useGetLinkLocaleSlug.js");
|
|
73
|
-
Object.keys(_useGetLinkLocaleSlug).forEach(function (key) {
|
|
74
|
-
if (key === "default" || key === "__esModule") return;
|
|
75
|
-
if (key in exports && exports[key] === _useGetLinkLocaleSlug[key]) return;
|
|
76
|
-
Object.defineProperty(exports, key, {
|
|
77
|
-
enumerable: true,
|
|
78
|
-
get: function () {
|
|
79
|
-
return _useGetLinkLocaleSlug[key];
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
var _useGetTranslationUrl = require("./useGetTranslationUrl.js");
|
|
84
|
-
Object.keys(_useGetTranslationUrl).forEach(function (key) {
|
|
85
|
-
if (key === "default" || key === "__esModule") return;
|
|
86
|
-
if (key in exports && exports[key] === _useGetTranslationUrl[key]) return;
|
|
87
|
-
Object.defineProperty(exports, key, {
|
|
88
|
-
enumerable: true,
|
|
89
|
-
get: function () {
|
|
90
|
-
return _useGetTranslationUrl[key];
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
});
|
|
94
|
-
var _useLanguages = require("./useLanguages.js");
|
|
95
|
-
Object.keys(_useLanguages).forEach(function (key) {
|
|
96
|
-
if (key === "default" || key === "__esModule") return;
|
|
97
|
-
if (key in exports && exports[key] === _useLanguages[key]) return;
|
|
98
|
-
Object.defineProperty(exports, key, {
|
|
99
|
-
enumerable: true,
|
|
100
|
-
get: function () {
|
|
101
|
-
return _useLanguages[key];
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
});
|
|
105
|
-
var _useNewsroom = require("./useNewsroom.js");
|
|
106
|
-
Object.keys(_useNewsroom).forEach(function (key) {
|
|
107
|
-
if (key === "default" || key === "__esModule") return;
|
|
108
|
-
if (key in exports && exports[key] === _useNewsroom[key]) return;
|
|
109
|
-
Object.defineProperty(exports, key, {
|
|
110
|
-
enumerable: true,
|
|
111
|
-
get: function () {
|
|
112
|
-
return _useNewsroom[key];
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
var _useNewsroomContext = require("./useNewsroomContext.js");
|
|
117
|
-
Object.keys(_useNewsroomContext).forEach(function (key) {
|
|
118
|
-
if (key === "default" || key === "__esModule") return;
|
|
119
|
-
if (key in exports && exports[key] === _useNewsroomContext[key]) return;
|
|
120
|
-
Object.defineProperty(exports, key, {
|
|
121
|
-
enumerable: true,
|
|
122
|
-
get: function () {
|
|
123
|
-
return _useNewsroomContext[key];
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
});
|
|
1
|
+
export * from "./useAlgoliaSettings.js";
|
|
2
|
+
export * from "./useCategories.js";
|
|
3
|
+
export * from "./useCompanyInformation.js";
|
|
4
|
+
export * from "./useCurrentCategory.js";
|
|
5
|
+
export * from "./useCurrentLocale.js";
|
|
6
|
+
export * from "./useCurrentStory.js";
|
|
7
|
+
export * from "./useGetLinkLocaleSlug.js";
|
|
8
|
+
export * from "./useGetTranslationUrl.js";
|
|
9
|
+
export * from "./useLanguages.js";
|
|
10
|
+
export * from "./useNewsroom.js";
|
|
11
|
+
export * from "./useNewsroomContext.js";
|