@prezly/theme-kit-nextjs 1.18.1 → 2.0.0-0
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 +3 -7
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +3 -7
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/index.js +2 -7
- package/build/adapter-nextjs/api-handlers/index.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +3 -7
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +3 -7
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/index.js +6 -22
- package/build/adapter-nextjs/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/category.d.ts +2 -2
- package/build/adapter-nextjs/page-props/category.js +19 -25
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +13 -18
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +13 -19
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
- package/build/adapter-nextjs/page-props/home.d.ts +2 -2
- package/build/adapter-nextjs/page-props/home.js +13 -18
- package/build/adapter-nextjs/page-props/home.js.map +1 -1
- package/build/adapter-nextjs/page-props/index.js +8 -41
- package/build/adapter-nextjs/page-props/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/lib/types.js +1 -2
- package/build/adapter-nextjs/page-props/search.js +10 -15
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +1 -5
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +1 -5
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +7 -11
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/index.js +4 -24
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/types.js +1 -2
- package/build/adapter-nextjs/page-props/story.js +17 -23
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +7 -11
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +5 -9
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +1 -5
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +25 -29
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/index.js +2 -20
- package/build/components-nextjs/PageSeo/index.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -5
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/types.js +1 -2
- package/build/components-nextjs/StorySeo/StorySeo.js +8 -12
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/components-nextjs/StorySeo/index.js +1 -5
- package/build/components-nextjs/StorySeo/index.js.map +1 -1
- package/build/components-nextjs/document.js +8 -35
- package/build/components-nextjs/document.js.map +1 -1
- package/build/components-nextjs/index.js +3 -9
- package/build/components-nextjs/index.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.d.ts +4 -5
- package/build/data-fetching/api/PrezlyApi.js +39 -44
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +5 -9
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/index.js +1 -17
- package/build/data-fetching/api/index.js.map +1 -1
- package/build/data-fetching/api/queries.js +5 -13
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/index.js +3 -19
- package/build/data-fetching/index.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +3 -7
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +3 -10
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/index.js +4 -11
- package/build/data-fetching/lib/index.js.map +1 -1
- package/build/data-fetching/lib/isSdkError.js +1 -5
- package/build/data-fetching/lib/isSdkError.js.map +1 -1
- package/build/data-fetching/lib/isUuid.js +1 -5
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/data-fetching/types.js +1 -2
- package/build/index.js +9 -25
- package/build/index.js.map +1 -1
- package/build/infinite-loading/index.js +4 -24
- package/build/infinite-loading/index.js.map +1 -1
- package/build/infinite-loading/types.js +1 -2
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +3 -7
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +9 -13
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.d.ts +2 -2
- package/build/infinite-loading/useInfiniteStoriesLoading.js +7 -11
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/index.d.ts +1 -1
- package/build/intl/index.js +4 -25
- package/build/intl/index.js.map +1 -1
- package/build/intl/languages.d.ts +1 -1
- package/build/intl/languages.js +23 -37
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.js +11 -17
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.d.ts +1 -2
- package/build/intl/localeConfig.js +3 -4
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeList.d.ts +4 -2
- package/build/intl/localeList.js +1 -2
- package/build/intl/localeList.js.map +1 -1
- package/build/intl/localeObject.js +3 -10
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +7 -11
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/index.js +11 -27
- package/build/newsroom-context/hooks/index.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +3 -7
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
- package/build/newsroom-context/hooks/useCategories.js +3 -7
- package/build/newsroom-context/hooks/useCategories.js.map +1 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +3 -7
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +3 -7
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +3 -7
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +3 -7
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +10 -14
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +24 -31
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/newsroom-context/hooks/useLanguages.js +3 -7
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroom.js +3 -7
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js +4 -8
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
- package/build/newsroom-context/index.js +2 -21
- package/build/newsroom-context/index.js.map +1 -1
- package/build/sentry/client.js +3 -7
- package/build/sentry/client.js.map +1 -1
- package/build/sentry/common.js +1 -5
- package/build/sentry/common.js.map +1 -1
- package/build/sentry/index.js +2 -7
- package/build/sentry/index.js.map +1 -1
- package/build/sentry/server.js +3 -7
- package/build/sentry/server.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/types.d.ts +2 -2
- package/build/types.js +1 -2
- package/build/utils/boilerplate.js +3 -9
- package/build/utils/boilerplate.js.map +1 -1
- package/build/utils/constants.js +3 -6
- package/build/utils/constants.js.map +1 -1
- package/build/utils/getAssetsUrl.js +3 -7
- package/build/utils/getAssetsUrl.js.map +1 -1
- package/build/utils/getDataRequestLink.js +3 -7
- package/build/utils/getDataRequestLink.js.map +1 -1
- package/build/utils/getLocalizedCategoryData.js +3 -9
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +5 -10
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +1 -5
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +1 -5
- package/build/utils/getStoryPublicationDate.js.map +1 -1
- package/build/utils/getUploadcareGroupUrl.js +3 -7
- package/build/utils/getUploadcareGroupUrl.js.map +1 -1
- package/build/utils/index.js +10 -26
- package/build/utils/index.js.map +1 -1
- package/build/utils/isEmbargoStory.js +1 -5
- package/build/utils/isEmbargoStory.js.map +1 -1
- package/package.json +17 -17
- package/src/@types/global.d.ts +0 -7
- package/src/__mocks__/languages.ts +0 -417
- package/src/__mocks__/story.ts +0 -351
- package/src/adapter-nextjs/api-handlers/fetchGalleries.ts +0 -24
- package/src/adapter-nextjs/api-handlers/fetchStories.ts +0 -26
- package/src/adapter-nextjs/api-handlers/index.ts +0 -2
- package/src/adapter-nextjs/getNewsroomServerSideProps.ts +0 -29
- package/src/adapter-nextjs/getNewsroomStaticProps.ts +0 -29
- package/src/adapter-nextjs/index.ts +0 -6
- package/src/adapter-nextjs/page-props/category.ts +0 -157
- package/src/adapter-nextjs/page-props/gallery.ts +0 -114
- package/src/adapter-nextjs/page-props/galleryAlbum.ts +0 -89
- package/src/adapter-nextjs/page-props/home.ts +0 -113
- package/src/adapter-nextjs/page-props/index.ts +0 -26
- package/src/adapter-nextjs/page-props/lib/types.ts +0 -8
- package/src/adapter-nextjs/page-props/search.ts +0 -53
- package/src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts +0 -56
- package/src/adapter-nextjs/page-props/sitemap/createPaths.ts +0 -21
- package/src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts +0 -43
- package/src/adapter-nextjs/page-props/sitemap/index.ts +0 -5
- package/src/adapter-nextjs/page-props/sitemap/types.ts +0 -5
- package/src/adapter-nextjs/page-props/story.ts +0 -94
- package/src/adapter-nextjs/page-props/storyPreview.ts +0 -33
- package/src/adapter-nextjs/processRequest.ts +0 -49
- package/src/adapter-nextjs/processStaticRequest.ts +0 -32
- package/src/components-nextjs/PageSeo/PageSeo.tsx +0 -131
- package/src/components-nextjs/PageSeo/index.ts +0 -2
- package/src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts +0 -7
- package/src/components-nextjs/PageSeo/lib/types.ts +0 -4
- package/src/components-nextjs/StorySeo/StorySeo.tsx +0 -80
- package/src/components-nextjs/StorySeo/index.ts +0 -1
- package/src/components-nextjs/document.tsx +0 -38
- package/src/components-nextjs/index.ts +0 -3
- package/src/data-fetching/api/PrezlyApi.ts +0 -302
- package/src/data-fetching/api/getPrezlyApi.ts +0 -24
- package/src/data-fetching/api/index.ts +0 -1
- package/src/data-fetching/api/queries.ts +0 -51
- package/src/data-fetching/index.ts +0 -3
- package/src/data-fetching/lib/getAlgoliaSettings.ts +0 -29
- package/src/data-fetching/lib/getEnvVariables.ts +0 -46
- package/src/data-fetching/lib/index.ts +0 -4
- package/src/data-fetching/lib/isSdkError.ts +0 -5
- package/src/data-fetching/lib/isUuid.ts +0 -5
- package/src/data-fetching/types.ts +0 -14
- package/src/index.ts +0 -9
- package/src/infinite-loading/index.ts +0 -4
- package/src/infinite-loading/types.ts +0 -5
- package/src/infinite-loading/useInfiniteGalleriesLoading.ts +0 -53
- package/src/infinite-loading/useInfiniteLoading.ts +0 -66
- package/src/infinite-loading/useInfiniteStoriesLoading.ts +0 -81
- package/src/intl/index.ts +0 -4
- package/src/intl/languages.test.ts +0 -232
- package/src/intl/languages.ts +0 -233
- package/src/intl/locale.test.ts +0 -94
- package/src/intl/locale.ts +0 -140
- package/src/intl/localeConfig.js +0 -23
- package/src/intl/localeList.js +0 -110
- package/src/intl/localeObject.test.ts +0 -81
- package/src/intl/localeObject.ts +0 -99
- package/src/newsroom-context/context.tsx +0 -115
- package/src/newsroom-context/hooks/index.ts +0 -11
- package/src/newsroom-context/hooks/useAlgoliaSettings.ts +0 -7
- package/src/newsroom-context/hooks/useCategories.ts +0 -7
- package/src/newsroom-context/hooks/useCompanyInformation.ts +0 -7
- package/src/newsroom-context/hooks/useCurrentCategory.ts +0 -7
- package/src/newsroom-context/hooks/useCurrentLocale.ts +0 -7
- package/src/newsroom-context/hooks/useCurrentStory.ts +0 -7
- package/src/newsroom-context/hooks/useGetLinkLocaleSlug.ts +0 -37
- package/src/newsroom-context/hooks/useGetTranslationUrl.ts +0 -96
- package/src/newsroom-context/hooks/useLanguages.ts +0 -7
- package/src/newsroom-context/hooks/useNewsroom.ts +0 -7
- package/src/newsroom-context/hooks/useNewsroomContext.ts +0 -15
- package/src/newsroom-context/index.ts +0 -2
- package/src/sentry/client.ts +0 -7
- package/src/sentry/common.ts +0 -27
- package/src/sentry/index.ts +0 -2
- package/src/sentry/server.ts +0 -7
- package/src/types.ts +0 -51
- package/src/utils/boilerplate.ts +0 -27
- package/src/utils/constants.ts +0 -3
- package/src/utils/getAssetsUrl.test.ts +0 -9
- package/src/utils/getAssetsUrl.ts +0 -9
- package/src/utils/getDataRequestLink.ts +0 -14
- package/src/utils/getLocalizedCategoryData.ts +0 -47
- package/src/utils/getNewsroomLogoUrl.ts +0 -22
- package/src/utils/getPrivacyPortalUrl.ts +0 -25
- package/src/utils/getStoryPublicationDate.tsx +0 -15
- package/src/utils/getUploadcareGroupUrl.ts +0 -13
- package/src/utils/index.ts +0 -10
- package/src/utils/isEmbargoStory.ts +0 -10
package/build/intl/locale.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const querystring_1 = require("querystring");
|
|
5
|
-
const localeObject_1 = require("./localeObject");
|
|
6
|
-
exports.DEFAULT_LOCALE = 'en';
|
|
1
|
+
import { stringify } from 'querystring';
|
|
2
|
+
import { LocaleObject } from './localeObject';
|
|
3
|
+
export const DEFAULT_LOCALE = 'en';
|
|
7
4
|
// We use pseudo locale used for localization testing, to reliably determine if we need to fallback to the default newsroom language
|
|
8
|
-
|
|
5
|
+
export const DUMMY_DEFAULT_LOCALE = 'qps-ploc';
|
|
9
6
|
/**
|
|
10
7
|
* This a list of locales that Prezly has translations for. Each code represents a language file in the `@prezly/themes-intl-messages` package.
|
|
11
8
|
* See https://github.com/prezly/themes-intl-messages for more info.
|
|
@@ -63,7 +60,7 @@ const SUPPORTED_LOCALES = [
|
|
|
63
60
|
* Use this function to determine which translations file you should load from `@prezly/themes-intl-mesages` package.
|
|
64
61
|
* See https://github.com/prezly/theme-nextjs-bea/blob/main/utils/lang.ts for a usage example.
|
|
65
62
|
*/
|
|
66
|
-
function getSupportedLocaleIsoCode(locale) {
|
|
63
|
+
export function getSupportedLocaleIsoCode(locale) {
|
|
67
64
|
const localeIsoCode = locale.toHyphenCode();
|
|
68
65
|
const isSupportedLocale = localeIsoCode.length >= 2 && SUPPORTED_LOCALES.includes(localeIsoCode);
|
|
69
66
|
if (isSupportedLocale) {
|
|
@@ -84,20 +81,19 @@ function getSupportedLocaleIsoCode(locale) {
|
|
|
84
81
|
// This code should never be reached, because locale code check is happening in `LocaleObject.fromAnyCode`
|
|
85
82
|
// eslint-disable-next-line no-console
|
|
86
83
|
console.warn('Unsupported locale provided. Please use `LocaleObject.fromAnyCode` to ensure you are using a correct language code');
|
|
87
|
-
return
|
|
84
|
+
return DEFAULT_LOCALE;
|
|
88
85
|
}
|
|
89
|
-
|
|
90
|
-
function getRedirectToCanonicalLocale(shortestLocaleCode, nextLocaleIsoCode, redirectPath, query) {
|
|
86
|
+
export function getRedirectToCanonicalLocale(shortestLocaleCode, nextLocaleIsoCode, redirectPath, query) {
|
|
91
87
|
// No need to redirect if no particular locale was requested by the application
|
|
92
|
-
if (!nextLocaleIsoCode || nextLocaleIsoCode ===
|
|
88
|
+
if (!nextLocaleIsoCode || nextLocaleIsoCode === DUMMY_DEFAULT_LOCALE) {
|
|
93
89
|
return undefined;
|
|
94
90
|
}
|
|
95
91
|
const shortestLocaleSlug = shortestLocaleCode
|
|
96
|
-
?
|
|
92
|
+
? LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug()
|
|
97
93
|
: shortestLocaleCode;
|
|
98
94
|
if (shortestLocaleSlug !== nextLocaleIsoCode) {
|
|
99
95
|
const prefixedPath = redirectPath && !redirectPath.startsWith('/') ? `/${redirectPath}` : redirectPath;
|
|
100
|
-
const urlQuery = query ? `?${
|
|
96
|
+
const urlQuery = query ? `?${stringify(query)}` : '';
|
|
101
97
|
return {
|
|
102
98
|
destination: shortestLocaleSlug
|
|
103
99
|
? `/${shortestLocaleSlug}${prefixedPath}${urlQuery}`
|
|
@@ -107,13 +103,11 @@ function getRedirectToCanonicalLocale(shortestLocaleCode, nextLocaleIsoCode, red
|
|
|
107
103
|
}
|
|
108
104
|
return undefined;
|
|
109
105
|
}
|
|
110
|
-
|
|
111
|
-
function getLocaleDirection(locale) {
|
|
106
|
+
export function getLocaleDirection(locale) {
|
|
112
107
|
const neutralLanguageCode = locale.toNeutralLanguageCode();
|
|
113
108
|
if (['ar', 'he', 'ur'].includes(neutralLanguageCode)) {
|
|
114
109
|
return 'rtl';
|
|
115
110
|
}
|
|
116
111
|
return 'ltr';
|
|
117
112
|
}
|
|
118
|
-
exports.getLocaleDirection = getLocaleDirection;
|
|
119
113
|
//# sourceMappingURL=locale.js.map
|
package/build/intl/locale.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/intl/locale.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/intl/locale.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
declare const lowercaseLocalPermutations: string[];
|
|
1
|
+
export declare const localeConfig: string[];
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* This list is pulled from the main Prezly application. The underscores are replaced with dashes.
|
|
4
3
|
* Together with permutation performed lower in the code,
|
|
5
4
|
* the exported list represents all of the possible locale codes that Next.js theme application might accept.
|
|
6
5
|
*/
|
|
7
|
-
|
|
8
|
-
const lowercaseLocales =
|
|
6
|
+
import { localeList } from './localeList';
|
|
7
|
+
const lowercaseLocales = localeList.map((l) => l.toLowerCase());
|
|
9
8
|
// Get all permutations for the shorter locale codes supported by Prezly (e.g. short region codes and neutral language codes)
|
|
10
9
|
const lowercaseLocalPermutations = Array.from(new Set([
|
|
11
10
|
...lowercaseLocales,
|
|
@@ -16,5 +15,5 @@ const lowercaseLocalPermutations = Array.from(new Set([
|
|
|
16
15
|
// Remove number-only codes from possible permutations (like `419` for `es-419`)
|
|
17
16
|
.filter((code) => Number.isNaN(Number(code))),
|
|
18
17
|
])).sort();
|
|
19
|
-
|
|
18
|
+
export const localeConfig = lowercaseLocalPermutations;
|
|
20
19
|
//# sourceMappingURL=localeConfig.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeConfig.js","sourceRoot":"","sources":["../../src/intl/localeConfig.
|
|
1
|
+
{"version":3,"file":"localeConfig.js","sourceRoot":"","sources":["../../src/intl/localeConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,gBAAgB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AAEhE,6HAA6H;AAC7H,MAAM,0BAA0B,GAAG,KAAK,CAAC,IAAI,CACzC,IAAI,GAAG,CAAC;IACJ,GAAG,gBAAgB;IACnB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACrD,GAAG,gBAAgB;SACd,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACjC,MAAM,CAAC,OAAO,CAAC;QAChB,gFAAgF;SAC/E,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;CACpD,CAAC,CACL,CAAC,IAAI,EAAE,CAAC;AAET,MAAM,CAAC,MAAM,YAAY,GAAG,0BAA0B,CAAC"}
|
package/build/intl/localeList.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeList.js","sourceRoot":"","sources":["../../src/intl/localeList.
|
|
1
|
+
{"version":3,"file":"localeList.js","sourceRoot":"","sources":["../../src/intl/localeList.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACtB,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,QAAQ;IACR,OAAO;IACP,KAAK;IACL,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;CACV,CAAC"}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.LocaleObject = void 0;
|
|
7
|
-
const localeConfig_1 = __importDefault(require("./localeConfig"));
|
|
1
|
+
import { localeConfig } from './localeConfig';
|
|
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.find((code) => code === lowercaseCode);
|
|
43
37
|
if (!foundCode) {
|
|
44
38
|
throw new Error(`Unsupported locale code provided: "${lowercaseCode}"`);
|
|
45
39
|
}
|
|
@@ -87,5 +81,4 @@ class LocaleObject {
|
|
|
87
81
|
return anotherLocale.toHyphenCode() === this.localeCode;
|
|
88
82
|
}
|
|
89
83
|
}
|
|
90
|
-
exports.LocaleObject = LocaleObject;
|
|
91
84
|
//# sourceMappingURL=localeObject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeObject.js","sourceRoot":"","sources":["../../src/intl/localeObject.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"localeObject.js","sourceRoot":"","sources":["../../src/intl/localeObject.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,MAAM,OAAO,YAAY;IACrB;;;OAGG;IACK,UAAU,CAAS;IAE3B,YAAoB,UAAkB;QAClC,IAAI,CAAC,iCAAiC,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;YACrD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;SACpD;QAED,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEjD,IAAI,MAAM,EAAE;YACR,2FAA2F;YAC3F,MAAM,YAAY,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YAEvE,IAAI,CAAC,UAAU,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACxD;aAAM;YACH,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;SAC9B;IACL,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,WAAW,CAAC,UAAkB;QACxC,MAAM,aAAa,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACjE,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,aAAa,CAAC,CAAC;QAEtE,IAAI,CAAC,SAAS,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,sCAAsC,aAAa,GAAG,CAAC,CAAC;SAC3E;QAED,OAAO,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,YAAY;QACf,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,gBAAgB;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,SAAS;QACZ,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,qBAAqB;QACxB,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAE9C,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,YAAY;QACf,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAEtD,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC;SACjC;QAED,OAAO,MAAM,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;IAED;;OAEG;IACI,OAAO,CAAC,aAA2B;QACtC,OAAO,aAAa,CAAC,YAAY,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC;IAC5D,CAAC;CACJ"}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const intl_1 = require("../intl");
|
|
7
|
-
exports.NewsroomContext = (0, react_1.createContext)(undefined);
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useMemo } from 'react';
|
|
3
|
+
import { DEFAULT_LOCALE, LocaleObject } from '../intl';
|
|
4
|
+
export const NewsroomContext = createContext(undefined);
|
|
8
5
|
/**
|
|
9
6
|
* This context provides common Newsroom information retrieved by `getNewsroomServerSideProps` helper.
|
|
10
7
|
* Please refer to the `NewsroomContextType` definition for more info on what's exposed from the context.
|
|
11
8
|
*/
|
|
12
|
-
function NewsroomContextProvider({ categories, contacts, newsroom, currentCategory, currentStory, companyInformation, languages, localeCode, notifications, themePreset, algoliaSettings, children, }) {
|
|
13
|
-
const locale =
|
|
14
|
-
return ((
|
|
9
|
+
export function NewsroomContextProvider({ categories, contacts, newsroom, currentCategory, currentStory, companyInformation, languages, localeCode, notifications, themePreset, algoliaSettings, children, }) {
|
|
10
|
+
const locale = useMemo(() => LocaleObject.fromAnyCode(localeCode || DEFAULT_LOCALE), [localeCode]);
|
|
11
|
+
return (_jsx(NewsroomContext.Provider, { value: {
|
|
15
12
|
categories,
|
|
16
13
|
contacts,
|
|
17
14
|
newsroom,
|
|
@@ -25,5 +22,4 @@ function NewsroomContextProvider({ categories, contacts, newsroom, currentCatego
|
|
|
25
22
|
algoliaSettings,
|
|
26
23
|
}, children: children }));
|
|
27
24
|
}
|
|
28
|
-
exports.NewsroomContextProvider = NewsroomContextProvider;
|
|
29
25
|
//# sourceMappingURL=context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/newsroom-context/context.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/newsroom-context/context.tsx"],"names":[],"mappings":";AAWA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAwDvD,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAkC,SAAS,CAAC,CAAC;AAEzF;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,EACpC,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,eAAe,EACf,QAAQ,GAC8B;IACtC,MAAM,MAAM,GAAG,OAAO,CAClB,GAAG,EAAE,CAAC,YAAY,CAAC,WAAW,CAAC,UAAU,IAAI,cAAc,CAAC,EAC5D,CAAC,UAAU,CAAC,CACf,CAAC;IAEF,OAAO,CACH,KAAC,eAAe,CAAC,QAAQ,IACrB,KAAK,EAAE;YACH,UAAU;YACV,QAAQ;YACR,QAAQ;YACR,eAAe;YACf,YAAY;YACZ,kBAAkB;YAClB,SAAS;YACT,MAAM;YACN,aAAa;YACb,WAAW;YACX,eAAe;SAClB,YAEA,QAAQ,GACc,CAC9B,CAAC;AACN,CAAC"}
|
|
@@ -1,28 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./useAlgoliaSettings"), exports);
|
|
18
|
-
__exportStar(require("./useCategories"), exports);
|
|
19
|
-
__exportStar(require("./useCompanyInformation"), exports);
|
|
20
|
-
__exportStar(require("./useCurrentCategory"), exports);
|
|
21
|
-
__exportStar(require("./useCurrentLocale"), exports);
|
|
22
|
-
__exportStar(require("./useCurrentStory"), exports);
|
|
23
|
-
__exportStar(require("./useGetLinkLocaleSlug"), exports);
|
|
24
|
-
__exportStar(require("./useGetTranslationUrl"), exports);
|
|
25
|
-
__exportStar(require("./useLanguages"), exports);
|
|
26
|
-
__exportStar(require("./useNewsroom"), exports);
|
|
27
|
-
__exportStar(require("./useNewsroomContext"), exports);
|
|
1
|
+
export * from './useAlgoliaSettings';
|
|
2
|
+
export * from './useCategories';
|
|
3
|
+
export * from './useCompanyInformation';
|
|
4
|
+
export * from './useCurrentCategory';
|
|
5
|
+
export * from './useCurrentLocale';
|
|
6
|
+
export * from './useCurrentStory';
|
|
7
|
+
export * from './useGetLinkLocaleSlug';
|
|
8
|
+
export * from './useGetTranslationUrl';
|
|
9
|
+
export * from './useLanguages';
|
|
10
|
+
export * from './useNewsroom';
|
|
11
|
+
export * from './useNewsroomContext';
|
|
28
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useAlgoliaSettings() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useAlgoliaSettings() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.algoliaSettings;
|
|
8
5
|
}
|
|
9
|
-
exports.useAlgoliaSettings = useAlgoliaSettings;
|
|
10
6
|
//# sourceMappingURL=useAlgoliaSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAlgoliaSettings.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useAlgoliaSettings.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAlgoliaSettings.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useAlgoliaSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,kBAAkB;IAC9B,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useCategories() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useCategories() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.categories;
|
|
8
5
|
}
|
|
9
|
-
exports.useCategories = useCategories;
|
|
10
6
|
//# sourceMappingURL=useCategories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCategories.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCategories.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCategories.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCategories.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,aAAa;IACzB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,UAAU,CAAC;AAC9B,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useCompanyInformation() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useCompanyInformation() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.companyInformation;
|
|
8
5
|
}
|
|
9
|
-
exports.useCompanyInformation = useCompanyInformation;
|
|
10
6
|
//# sourceMappingURL=useCompanyInformation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompanyInformation.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCompanyInformation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCompanyInformation.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCompanyInformation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,qBAAqB;IACjC,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,kBAAkB,CAAC;AACtC,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useCurrentCategory() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useCurrentCategory() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.currentCategory;
|
|
8
5
|
}
|
|
9
|
-
exports.useCurrentCategory = useCurrentCategory;
|
|
10
6
|
//# sourceMappingURL=useCurrentCategory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentCategory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentCategory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrentCategory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentCategory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,kBAAkB;IAC9B,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useCurrentLocale() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useCurrentLocale() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.locale;
|
|
8
5
|
}
|
|
9
|
-
exports.useCurrentLocale = useCurrentLocale;
|
|
10
6
|
//# sourceMappingURL=useCurrentLocale.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentLocale.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentLocale.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrentLocale.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentLocale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,gBAAgB;IAC5B,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useCurrentStory() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useCurrentStory() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.currentStory;
|
|
8
5
|
}
|
|
9
|
-
exports.useCurrentStory = useCurrentStory;
|
|
10
6
|
//# sourceMappingURL=useCurrentStory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentStory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentStory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useCurrentStory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentStory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,eAAe;IAC3B,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,YAAY,CAAC;AAChC,CAAC"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const intl_1 = require("../../intl");
|
|
6
|
-
const useCurrentLocale_1 = require("./useCurrentLocale");
|
|
7
|
-
const useLanguages_1 = require("./useLanguages");
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
import { getShortestLocaleCode, LocaleObject } from '../../intl';
|
|
3
|
+
import { useCurrentLocale } from './useCurrentLocale';
|
|
4
|
+
import { useLanguages } from './useLanguages';
|
|
8
5
|
/**
|
|
9
6
|
* Determines correct locale slug for the link (trying to shorten the locale code if possible).
|
|
10
7
|
* E.g. if newsroom has a single locale for Dutch (`nl_BE`), it will be shortened to `nl`.
|
|
@@ -12,18 +9,17 @@ const useLanguages_1 = require("./useLanguages");
|
|
|
12
9
|
* `false` means that a default locale should be used (no locale in URL required).
|
|
13
10
|
*/
|
|
14
11
|
function getLinkLocaleSlug(languages, locale) {
|
|
15
|
-
const shortestLocaleCode =
|
|
12
|
+
const shortestLocaleCode = getShortestLocaleCode(languages, locale);
|
|
16
13
|
// When navigating to default language, we don't append the locale to the URL.
|
|
17
14
|
if (!shortestLocaleCode) {
|
|
18
15
|
return shortestLocaleCode;
|
|
19
16
|
}
|
|
20
|
-
return
|
|
17
|
+
return LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug();
|
|
21
18
|
}
|
|
22
|
-
function useGetLinkLocaleSlug() {
|
|
23
|
-
const currentLocale =
|
|
24
|
-
const languages =
|
|
19
|
+
export function useGetLinkLocaleSlug() {
|
|
20
|
+
const currentLocale = useCurrentLocale();
|
|
21
|
+
const languages = useLanguages();
|
|
25
22
|
// The `locale` parameter is mainly used for Language Dropdown
|
|
26
|
-
return
|
|
23
|
+
return useCallback((locale) => getLinkLocaleSlug(languages, locale || currentLocale), [languages, currentLocale]);
|
|
27
24
|
}
|
|
28
|
-
exports.useGetLinkLocaleSlug = useGetLinkLocaleSlug;
|
|
29
25
|
//# sourceMappingURL=useGetLinkLocaleSlug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetLinkLocaleSlug.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetLinkLocaleSlug.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGetLinkLocaleSlug.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetLinkLocaleSlug.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,SAAqC,EACrC,MAAoB;IAEpB,MAAM,kBAAkB,GAAG,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpE,8EAA8E;IAC9E,IAAI,CAAC,kBAAkB,EAAE;QACrB,OAAO,kBAAkB,CAAC;KAC7B;IAED,OAAO,YAAY,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,SAAS,EAAE,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,oBAAoB;IAChC,MAAM,aAAa,GAAG,gBAAgB,EAAE,CAAC;IACzC,MAAM,SAAS,GAAG,YAAY,EAAE,CAAC;IAEjC,8DAA8D;IAC9D,OAAO,WAAW,CACd,CAAC,MAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,IAAI,aAAa,CAAC,EAChF,CAAC,SAAS,EAAE,aAAa,CAAC,CAC7B,CAAC;AACN,CAAC"}
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const useCurrentCategory_1 = require("./useCurrentCategory");
|
|
8
|
-
const useCurrentStory_1 = require("./useCurrentStory");
|
|
9
|
-
// Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
|
|
10
|
-
var StoryVisibility;
|
|
11
|
-
(function (StoryVisibility) {
|
|
12
|
-
StoryVisibility["PUBLIC"] = "public";
|
|
13
|
-
StoryVisibility["EMBARGO"] = "embargo";
|
|
14
|
-
StoryVisibility["PRIVATE"] = "private";
|
|
15
|
-
StoryVisibility["CONFIDENTIAL"] = "confidential";
|
|
16
|
-
})(StoryVisibility || (StoryVisibility = {}));
|
|
1
|
+
import { Story } from '@prezly/sdk';
|
|
2
|
+
import { useRouter } from 'next/router';
|
|
3
|
+
import { useCallback } from 'react';
|
|
4
|
+
import { getCategoryHasTranslation, getCategoryUrl } from '../../utils';
|
|
5
|
+
import { useCurrentCategory } from './useCurrentCategory';
|
|
6
|
+
import { useCurrentStory } from './useCurrentStory';
|
|
17
7
|
function getAllowedTranslationVisibilityValues(story) {
|
|
18
8
|
const { visibility } = story;
|
|
19
9
|
switch (visibility) {
|
|
20
|
-
case
|
|
21
|
-
return [
|
|
22
|
-
case
|
|
23
|
-
return [
|
|
24
|
-
case
|
|
25
|
-
return [
|
|
10
|
+
case Story.Visibility.EMBARGO:
|
|
11
|
+
return [Story.Visibility.EMBARGO, Story.Visibility.PUBLIC];
|
|
12
|
+
case Story.Visibility.PRIVATE:
|
|
13
|
+
return [Story.Visibility.PRIVATE, Story.Visibility.PUBLIC];
|
|
14
|
+
case Story.Visibility.CONFIDENTIAL:
|
|
15
|
+
return [
|
|
16
|
+
Story.Visibility.CONFIDENTIAL,
|
|
17
|
+
Story.Visibility.PRIVATE,
|
|
18
|
+
Story.Visibility.PUBLIC,
|
|
19
|
+
];
|
|
26
20
|
default:
|
|
27
|
-
return [
|
|
21
|
+
return [Story.Visibility.PUBLIC];
|
|
28
22
|
}
|
|
29
23
|
}
|
|
30
24
|
/**
|
|
@@ -35,8 +29,8 @@ function getAllowedTranslationVisibilityValues(story) {
|
|
|
35
29
|
*/
|
|
36
30
|
function getTranslationUrl(locale, path, currentCategory, currentStory, noFallback) {
|
|
37
31
|
if (currentCategory) {
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
32
|
+
if (getCategoryHasTranslation(currentCategory, locale)) {
|
|
33
|
+
return getCategoryUrl(currentCategory, locale);
|
|
40
34
|
}
|
|
41
35
|
if (noFallback) {
|
|
42
36
|
return '';
|
|
@@ -61,11 +55,10 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
|
|
|
61
55
|
* This hook returns a function that is meant to be used in language pickers and alternate locales list for the pages.
|
|
62
56
|
* `noFallback` parameter is useful for alternate language links in the `head` section of the document (so that there are no unwanted links to the homepage).
|
|
63
57
|
*/
|
|
64
|
-
function useGetTranslationUrl() {
|
|
65
|
-
const { asPath } =
|
|
66
|
-
const currentCategory =
|
|
67
|
-
const currentStory =
|
|
68
|
-
return
|
|
58
|
+
export function useGetTranslationUrl() {
|
|
59
|
+
const { asPath } = useRouter();
|
|
60
|
+
const currentCategory = useCurrentCategory();
|
|
61
|
+
const currentStory = useCurrentStory();
|
|
62
|
+
return useCallback((locale, noFallback) => getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback), [asPath, currentCategory, currentStory]);
|
|
69
63
|
}
|
|
70
|
-
exports.useGetTranslationUrl = useGetTranslationUrl;
|
|
71
64
|
//# sourceMappingURL=useGetTranslationUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAGpC,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,SAAS,qCAAqC,CAAC,KAAoB;IAC/D,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,QAAQ,UAAU,EAAE;QAChB,KAAK,KAAK,CAAC,UAAU,CAAC,OAAO;YACzB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/D,KAAK,KAAK,CAAC,UAAU,CAAC,OAAO;YACzB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC/D,KAAK,KAAK,CAAC,UAAU,CAAC,YAAY;YAC9B,OAAO;gBACH,KAAK,CAAC,UAAU,CAAC,YAAY;gBAC7B,KAAK,CAAC,UAAU,CAAC,OAAO;gBACxB,KAAK,CAAC,UAAU,CAAC,MAAM;aAC1B,CAAC;QACN;YACI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;KACxC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,MAAoB,EACpB,IAAY,EACZ,eAA0B,EAC1B,YAA4B,EAC5B,UAAoB;IAEpB,IAAI,eAAe,EAAE;QACjB,IAAI,yBAAyB,CAAC,eAAe,EAAE,MAAM,CAAC,EAAE;YACpD,OAAO,cAAc,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;SAClD;QAED,IAAI,UAAU,EAAE;YACZ,OAAO,EAAE,CAAC;SACb;QAED,OAAO,GAAG,CAAC;KACd;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAE7C,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE;QAC5D,MAAM,uBAAuB,GAAG,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAEpF,MAAM,eAAe,GAAG,YAAY,CAAC,YAAY,CAAC,IAAI,CAClD,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,CACxB,OAAO,CAAC,MAAM,KAAK,UAAU,IAAI,uBAAuB,CAAC,QAAQ,CAAC,UAAU,CAAC,CACpF,CAAC;QACF,IAAI,eAAe,EAAE;YACjB,OAAO,IAAI,eAAe,CAAC,IAAI,EAAE,CAAC;SACrC;QAED,IAAI,UAAU,EAAE;YACZ,OAAO,EAAE,CAAC;SACb;QAED,OAAO,GAAG,CAAC;KACd;IAED,OAAO,IAAI,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,eAAe,GAAG,kBAAkB,EAAE,CAAC;IAC7C,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IAEvC,OAAO,WAAW,CACd,CAAC,MAAoB,EAAE,UAAoB,EAAE,EAAE,CAC3C,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC,EAChF,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAC1C,CAAC;AACN,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useLanguages() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useLanguages() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.languages;
|
|
8
5
|
}
|
|
9
|
-
exports.useLanguages = useLanguages;
|
|
10
6
|
//# sourceMappingURL=useLanguages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useLanguages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useLanguages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,YAAY;IACxB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useNewsroom() {
|
|
6
|
-
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
1
|
+
import { useNewsroomContext } from './useNewsroomContext';
|
|
2
|
+
export function useNewsroom() {
|
|
3
|
+
const context = useNewsroomContext();
|
|
7
4
|
return context.newsroom;
|
|
8
5
|
}
|
|
9
|
-
exports.useNewsroom = useNewsroom;
|
|
10
6
|
//# sourceMappingURL=useNewsroom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNewsroom.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroom.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNewsroom.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,UAAU,WAAW;IACvB,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC"}
|