@prezly/theme-kit-nextjs 1.6.4-3 → 1.7.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/getNewsroomServerSideProps.js +63 -9
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/index.js +14 -2
- package/build/adapter-nextjs/index.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +25 -10
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +58 -43
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/index.js +16 -2
- package/build/components-nextjs/PageSeo/index.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +6 -2
- 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/Sitemap/SitemapBuilder.js +22 -18
- package/build/components-nextjs/Sitemap/SitemapBuilder.js.map +1 -1
- package/build/components-nextjs/Sitemap/createPaths.js +45 -10
- package/build/components-nextjs/Sitemap/createPaths.js.map +1 -1
- package/build/components-nextjs/Sitemap/getInitialProps.js +75 -23
- package/build/components-nextjs/Sitemap/getInitialProps.js.map +1 -1
- package/build/components-nextjs/Sitemap/index.js +20 -4
- package/build/components-nextjs/Sitemap/index.js.map +1 -1
- package/build/components-nextjs/Sitemap/types.js +2 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +34 -26
- 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/index.js +18 -3
- package/build/components-nextjs/index.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.js +297 -132
- 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 +14 -2
- package/build/data-fetching/api/index.js.map +1 -1
- package/build/data-fetching/api/languages.js +85 -43
- package/build/data-fetching/api/languages.js.map +1 -1
- package/build/data-fetching/api/queries.js +45 -13
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/constants.js +5 -2
- package/build/data-fetching/constants.js.map +1 -1
- package/build/data-fetching/getAssetsUrl.js +7 -3
- package/build/data-fetching/getAssetsUrl.js.map +1 -1
- package/build/data-fetching/getLocalizedCategoryData.js +32 -15
- package/build/data-fetching/getLocalizedCategoryData.js.map +1 -1
- package/build/data-fetching/getNewsroomLogoUrl.js +12 -6
- package/build/data-fetching/getNewsroomLogoUrl.js.map +1 -1
- package/build/data-fetching/getPrivacyPortalUrl.js +7 -3
- package/build/data-fetching/getPrivacyPortalUrl.js.map +1 -1
- package/build/data-fetching/getStoryPublicationDate.js +6 -2
- package/build/data-fetching/getStoryPublicationDate.js.map +1 -1
- package/build/data-fetching/getUploadcareGroupUrl.js +7 -3
- package/build/data-fetching/getUploadcareGroupUrl.js.map +1 -1
- package/build/data-fetching/index.js +22 -10
- package/build/data-fetching/index.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +10 -6
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +29 -11
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/index.js +5 -1
- package/build/data-fetching/lib/index.js.map +1 -1
- package/build/data-fetching/types.js +2 -1
- package/build/index.js +19 -7
- package/build/index.js.map +1 -1
- package/build/infinite-loading/apiHandlers/fetchGalleries.js +69 -15
- package/build/infinite-loading/apiHandlers/fetchGalleries.js.map +1 -1
- package/build/infinite-loading/apiHandlers/fetchStories.js +71 -17
- package/build/infinite-loading/apiHandlers/fetchStories.js.map +1 -1
- package/build/infinite-loading/apiHandlers/index.js +7 -2
- package/build/infinite-loading/apiHandlers/index.js.map +1 -1
- package/build/infinite-loading/index.js +21 -5
- package/build/infinite-loading/index.js.map +1 -1
- package/build/infinite-loading/types.js +2 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +83 -25
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +97 -21
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.js +99 -36
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/index.d.ts +1 -2
- package/build/intl/index.js +21 -5
- package/build/intl/index.js.map +1 -1
- package/build/intl/lang.js +11 -4
- package/build/intl/lang.js.map +1 -1
- package/build/intl/locale.js +27 -21
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.d.ts +2 -1
- package/build/intl/localeConfig.js +30 -8
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeList.d.ts +56 -4
- package/build/intl/localeList.js +2 -1
- package/build/intl/localeList.js.map +1 -1
- package/build/intl/localeObject.js +49 -30
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +34 -18
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/index.js +23 -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 +15 -11
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +24 -15
- 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 +17 -2
- package/build/newsroom-context/index.js.map +1 -1
- package/build/types.js +2 -1
- package/package.json +3 -5
- package/src/intl/index.ts +1 -2
- package/src/intl/{localeConfig.ts → localeConfig.js} +3 -3
- package/src/intl/{localeList.ts → localeList.js} +1 -1
- package/src/intl/localeObject.ts +1 -1
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.js"],"names":[],"mappings":";AAAA;;GAEG;AACH,MAAM,CAAC,OAAO,GAAG;IACb,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,IAAI;IACJ,OAAO;IACP,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,OAAO;IACP,OAAO;IACP,OAAO;IACP,OAAO;IACP,IAAI;IACJ,OAAO;IACP,SAAS;IACT,OAAO;IACP,OAAO;IACP,OAAO;CACV,CAAC"}
|
|
@@ -1,23 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.LocaleObject = void 0;
|
|
23
|
+
var localeConfig_1 = __importDefault(require("./localeConfig"));
|
|
2
24
|
/**
|
|
3
25
|
* This class is created to simplify working with locales and transforming between different locale code formats.
|
|
4
26
|
* Prezly API uses underscore-codes, while most frontend application tend to use hyphen-codes or slugs.
|
|
5
27
|
* Note that `fromAnyCode` constructor only accepts locales supported by Prezly backend. See `localeConfig` for reference.
|
|
6
28
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
* Hyphen-separated locale code.
|
|
10
|
-
* Examples: `nl-BE`, `en-US`, `fr`, `fil`
|
|
11
|
-
*/
|
|
12
|
-
localeCode;
|
|
13
|
-
constructor(localeCode) {
|
|
29
|
+
var LocaleObject = /** @class */ (function () {
|
|
30
|
+
function LocaleObject(localeCode) {
|
|
14
31
|
if (localeCode.indexOf('_') !== -1) {
|
|
15
32
|
throw new Error('Invalid locale code provided!');
|
|
16
33
|
}
|
|
17
|
-
|
|
34
|
+
var _a = __read(localeCode.split('-'), 2), language = _a[0], region = _a[1];
|
|
18
35
|
if (region) {
|
|
19
36
|
// Workaround for `zh-Hant` locale, which is the only locale with non-uppercase region part
|
|
20
|
-
|
|
37
|
+
var regionSuffix = region === 'hant' ? 'Hant' : region.toUpperCase();
|
|
21
38
|
this.localeCode = [language, regionSuffix].join('-');
|
|
22
39
|
}
|
|
23
40
|
else {
|
|
@@ -31,54 +48,56 @@ export class LocaleObject {
|
|
|
31
48
|
* - Underscore-codes: `nl_BE`, `en_US`, `fr`, `fil`
|
|
32
49
|
* - Slugs: `nl-be`, `en-us`, `fr`, `fil`
|
|
33
50
|
*/
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
51
|
+
LocaleObject.fromAnyCode = function (localeCode) {
|
|
52
|
+
var lowercaseCode = localeCode.toLowerCase().replace('_', '-');
|
|
53
|
+
var foundCode = localeConfig_1.default.find(function (code) { return code === lowercaseCode; });
|
|
37
54
|
if (!foundCode) {
|
|
38
|
-
throw new Error(
|
|
55
|
+
throw new Error("Unsupported locale code provided: \"".concat(lowercaseCode, "\""));
|
|
39
56
|
}
|
|
40
57
|
return new LocaleObject(foundCode);
|
|
41
|
-
}
|
|
58
|
+
};
|
|
42
59
|
/**
|
|
43
60
|
* @returns Code formatted into hyphen format: `nl-BE`, `en-US`, `fr`, `fil`
|
|
44
61
|
*/
|
|
45
|
-
toHyphenCode() {
|
|
62
|
+
LocaleObject.prototype.toHyphenCode = function () {
|
|
46
63
|
return this.localeCode;
|
|
47
|
-
}
|
|
64
|
+
};
|
|
48
65
|
/**
|
|
49
66
|
* @returns Code formatted into underscore format, as expected by Prezly API: `nl_BE`, `en_US`, `fr`, `fil`
|
|
50
67
|
*/
|
|
51
|
-
toUnderscoreCode() {
|
|
68
|
+
LocaleObject.prototype.toUnderscoreCode = function () {
|
|
52
69
|
return this.localeCode.replace('-', '_');
|
|
53
|
-
}
|
|
70
|
+
};
|
|
54
71
|
/**
|
|
55
72
|
* @returns Code formatted to a URL-friendly lowercase slug format: `nl-be`, `en-us`, `fr`, `fil`
|
|
56
73
|
*/
|
|
57
|
-
toUrlSlug() {
|
|
74
|
+
LocaleObject.prototype.toUrlSlug = function () {
|
|
58
75
|
return this.localeCode.toLowerCase();
|
|
59
|
-
}
|
|
76
|
+
};
|
|
60
77
|
/**
|
|
61
78
|
* @returns Only the language part of the code without culture/region part: `nl`, `en`, `fr`
|
|
62
79
|
*/
|
|
63
|
-
toNeutralLanguageCode() {
|
|
64
|
-
|
|
80
|
+
LocaleObject.prototype.toNeutralLanguageCode = function () {
|
|
81
|
+
var _a = __read(this.localeCode.split('-'), 1), language = _a[0];
|
|
65
82
|
return language;
|
|
66
|
-
}
|
|
83
|
+
};
|
|
67
84
|
/**
|
|
68
85
|
* @returns Only the culture/regtion part without the language part: `be`, `us`, `fr`
|
|
69
86
|
*/
|
|
70
|
-
toRegionCode() {
|
|
71
|
-
|
|
87
|
+
LocaleObject.prototype.toRegionCode = function () {
|
|
88
|
+
var _a = __read(this.localeCode.split('-'), 2), language = _a[0], region = _a[1];
|
|
72
89
|
if (!region) {
|
|
73
90
|
return language.toUpperCase();
|
|
74
91
|
}
|
|
75
92
|
return region.toUpperCase();
|
|
76
|
-
}
|
|
93
|
+
};
|
|
77
94
|
/**
|
|
78
95
|
* Check if two LocaleObject instances are representing the same locale code.
|
|
79
96
|
*/
|
|
80
|
-
isEqual(anotherLocale) {
|
|
97
|
+
LocaleObject.prototype.isEqual = function (anotherLocale) {
|
|
81
98
|
return anotherLocale.toHyphenCode() === this.localeCode;
|
|
82
|
-
}
|
|
83
|
-
|
|
99
|
+
};
|
|
100
|
+
return LocaleObject;
|
|
101
|
+
}());
|
|
102
|
+
exports.LocaleObject = LocaleObject;
|
|
84
103
|
//# sourceMappingURL=localeObject.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"localeObject.js","sourceRoot":"","sources":["../../src/intl/localeObject.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"localeObject.js","sourceRoot":"","sources":["../../src/intl/localeObject.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,gEAA0C;AAE1C;;;;GAIG;AACH;IAOI,sBAAoB,UAAkB;QAClC,IAAI,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;SACpD;QAEK,IAAA,KAAA,OAAqB,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAA,EAAzC,QAAQ,QAAA,EAAE,MAAM,QAAyB,CAAC;QAEjD,IAAI,MAAM,EAAE;YACR,2FAA2F;YAC3F,IAAM,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;IACW,wBAAW,GAAzB,UAA0B,UAAkB;QACxC,IAAM,aAAa,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QACjE,IAAM,SAAS,GAAG,sBAAY,CAAC,IAAI,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,KAAK,aAAa,EAAtB,CAAsB,CAAC,CAAC;QAEtE,IAAI,CAAC,SAAS,EAAE;YACZ,MAAM,IAAI,KAAK,CAAC,8CAAsC,aAAa,OAAG,CAAC,CAAC;SAC3E;QAED,OAAO,IAAI,YAAY,CAAC,SAAS,CAAC,CAAC;IACvC,CAAC;IAED;;OAEG;IACI,mCAAY,GAAnB;QACI,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED;;OAEG;IACI,uCAAgB,GAAvB;QACI,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC;IAED;;OAEG;IACI,gCAAS,GAAhB;QACI,OAAO,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAED;;OAEG;IACI,4CAAqB,GAA5B;QACU,IAAA,KAAA,OAAa,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAA,EAAtC,QAAQ,QAA8B,CAAC;QAE9C,OAAO,QAAQ,CAAC;IACpB,CAAC;IAED;;OAEG;IACI,mCAAY,GAAnB;QACU,IAAA,KAAA,OAAqB,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAA,EAA9C,QAAQ,QAAA,EAAE,MAAM,QAA8B,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,8BAAO,GAAd,UAAe,aAA2B;QACtC,OAAO,aAAa,CAAC,YAAY,EAAE,KAAK,IAAI,CAAC,UAAU,CAAC;IAC5D,CAAC;IACL,mBAAC;AAAD,CAAC,AA3FD,IA2FC;AA3FY,oCAAY"}
|
|
@@ -1,24 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.NewsroomContextProvider = exports.NewsroomContext = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
var react_1 = require("react");
|
|
17
|
+
var intl_1 = require("../intl");
|
|
18
|
+
exports.NewsroomContext = (0, react_1.createContext)(undefined);
|
|
5
19
|
/**
|
|
6
20
|
* This context provides common Newsroom information retrieved by `getNewsroomServerSideProps` helper.
|
|
7
21
|
* Please refer to the `NewsroomContextType` definition for more info on what's exposed from the context.
|
|
8
22
|
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
function NewsroomContextProvider(_a) {
|
|
24
|
+
var categories = _a.categories, contacts = _a.contacts, newsroom = _a.newsroom, currentCategory = _a.currentCategory, currentStory = _a.currentStory, companyInformation = _a.companyInformation, languages = _a.languages, localeCode = _a.localeCode, themePreset = _a.themePreset, algoliaSettings = _a.algoliaSettings, children = _a.children;
|
|
25
|
+
var locale = (0, react_1.useMemo)(function () { return intl_1.LocaleObject.fromAnyCode(localeCode || intl_1.DEFAULT_LOCALE); }, [localeCode]);
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(exports.NewsroomContext.Provider, __assign({ value: {
|
|
27
|
+
categories: categories,
|
|
28
|
+
contacts: contacts,
|
|
29
|
+
newsroom: newsroom,
|
|
30
|
+
currentCategory: currentCategory,
|
|
31
|
+
currentStory: currentStory,
|
|
32
|
+
companyInformation: companyInformation,
|
|
33
|
+
languages: languages,
|
|
34
|
+
locale: locale,
|
|
35
|
+
themePreset: themePreset,
|
|
36
|
+
algoliaSettings: algoliaSettings,
|
|
37
|
+
} }, { children: children }), void 0));
|
|
23
38
|
}
|
|
39
|
+
exports.NewsroomContextProvider = NewsroomContextProvider;
|
|
24
40
|
//# 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":";;;;;;;;;;;;;;;AAUA,+BAA+C;AAG/C,gCAAuD;AAoD1C,QAAA,eAAe,GAAG,IAAA,qBAAa,EAAkC,SAAS,CAAC,CAAC;AAEzF;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,EAYE;QAXtC,UAAU,gBAAA,EACV,QAAQ,cAAA,EACR,QAAQ,cAAA,EACR,eAAe,qBAAA,EACf,YAAY,kBAAA,EACZ,kBAAkB,wBAAA,EAClB,SAAS,eAAA,EACT,UAAU,gBAAA,EACV,WAAW,iBAAA,EACX,eAAe,qBAAA,EACf,QAAQ,cAAA;IAER,IAAM,MAAM,GAAG,IAAA,eAAO,EAClB,cAAM,OAAA,mBAAY,CAAC,WAAW,CAAC,UAAU,IAAI,qBAAc,CAAC,EAAtD,CAAsD,EAC5D,CAAC,UAAU,CAAC,CACf,CAAC;IAEF,OAAO,CACH,uBAAC,uBAAe,CAAC,QAAQ,aACrB,KAAK,EAAE;YACH,UAAU,YAAA;YACV,QAAQ,UAAA;YACR,QAAQ,UAAA;YACR,eAAe,iBAAA;YACf,YAAY,cAAA;YACZ,kBAAkB,oBAAA;YAClB,SAAS,WAAA;YACT,MAAM,QAAA;YACN,WAAW,aAAA;YACX,eAAe,iBAAA;SAClB,gBAEA,QAAQ,YACc,CAC9B,CAAC;AACN,CAAC;AApCD,0DAoCC"}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
__exportStar(require("./useAlgoliaSettings"), exports);
|
|
14
|
+
__exportStar(require("./useCategories"), exports);
|
|
15
|
+
__exportStar(require("./useCompanyInformation"), exports);
|
|
16
|
+
__exportStar(require("./useCurrentCategory"), exports);
|
|
17
|
+
__exportStar(require("./useCurrentLocale"), exports);
|
|
18
|
+
__exportStar(require("./useCurrentStory"), exports);
|
|
19
|
+
__exportStar(require("./useGetLinkLocaleSlug"), exports);
|
|
20
|
+
__exportStar(require("./useGetTranslationUrl"), exports);
|
|
21
|
+
__exportStar(require("./useLanguages"), exports);
|
|
22
|
+
__exportStar(require("./useNewsroom"), exports);
|
|
23
|
+
__exportStar(require("./useNewsroomContext"), exports);
|
|
12
24
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,uDAAqC;AACrC,kDAAgC;AAChC,0DAAwC;AACxC,uDAAqC;AACrC,qDAAmC;AACnC,oDAAkC;AAClC,yDAAuC;AACvC,yDAAuC;AACvC,iDAA+B;AAC/B,gDAA8B;AAC9B,uDAAqC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAlgoliaSettings = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useAlgoliaSettings() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.algoliaSettings;
|
|
5
8
|
}
|
|
9
|
+
exports.useAlgoliaSettings = useAlgoliaSettings;
|
|
6
10
|
//# sourceMappingURL=useAlgoliaSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAlgoliaSettings.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useAlgoliaSettings.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useAlgoliaSettings.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useAlgoliaSettings.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,kBAAkB;IAC9B,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC;AAJD,gDAIC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCategories = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCategories() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.categories;
|
|
5
8
|
}
|
|
9
|
+
exports.useCategories = useCategories;
|
|
6
10
|
//# sourceMappingURL=useCategories.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCategories.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCategories.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useCategories.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCategories.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,aAAa;IACzB,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,UAAU,CAAC;AAC9B,CAAC;AAJD,sCAIC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCompanyInformation = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCompanyInformation() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.companyInformation;
|
|
5
8
|
}
|
|
9
|
+
exports.useCompanyInformation = useCompanyInformation;
|
|
6
10
|
//# sourceMappingURL=useCompanyInformation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCompanyInformation.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCompanyInformation.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useCompanyInformation.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCompanyInformation.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,qBAAqB;IACjC,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,kBAAkB,CAAC;AACtC,CAAC;AAJD,sDAIC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentCategory = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCurrentCategory() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.currentCategory;
|
|
5
8
|
}
|
|
9
|
+
exports.useCurrentCategory = useCurrentCategory;
|
|
6
10
|
//# sourceMappingURL=useCurrentCategory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentCategory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentCategory.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useCurrentCategory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentCategory.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,kBAAkB;IAC9B,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC;AAJD,gDAIC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentLocale = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCurrentLocale() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.locale;
|
|
5
8
|
}
|
|
9
|
+
exports.useCurrentLocale = useCurrentLocale;
|
|
6
10
|
//# sourceMappingURL=useCurrentLocale.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentLocale.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentLocale.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useCurrentLocale.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentLocale.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,gBAAgB;IAC5B,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC;AAJD,4CAIC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentStory = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCurrentStory() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.currentStory;
|
|
5
8
|
}
|
|
9
|
+
exports.useCurrentStory = useCurrentStory;
|
|
6
10
|
//# sourceMappingURL=useCurrentStory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentStory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentStory.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useCurrentStory.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useCurrentStory.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,eAAe;IAC3B,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,YAAY,CAAC;AAChC,CAAC;AAJD,0CAIC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGetLinkLocaleSlug = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var data_fetching_1 = require("../../data-fetching");
|
|
6
|
+
var intl_1 = require("../../intl");
|
|
7
|
+
var useCurrentLocale_1 = require("./useCurrentLocale");
|
|
8
|
+
var useLanguages_1 = require("./useLanguages");
|
|
6
9
|
/**
|
|
7
10
|
* Determines correct locale slug for the link (trying to shorten the locale code if possible).
|
|
8
11
|
* E.g. if newsroom has a single locale for Dutch (`nl_BE`), it will be shortened to `nl`.
|
|
@@ -10,17 +13,18 @@ import { useLanguages } from './useLanguages';
|
|
|
10
13
|
* `false` means that a default locale should be used (no locale in URL required).
|
|
11
14
|
*/
|
|
12
15
|
function getLinkLocaleSlug(languages, locale) {
|
|
13
|
-
|
|
16
|
+
var shortestLocaleCode = (0, data_fetching_1.getShortestLocaleCode)(languages, locale);
|
|
14
17
|
// When navigating to default language, we don't append the locale to the URL.
|
|
15
18
|
if (!shortestLocaleCode) {
|
|
16
19
|
return shortestLocaleCode;
|
|
17
20
|
}
|
|
18
|
-
return LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug();
|
|
21
|
+
return intl_1.LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug();
|
|
19
22
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
function useGetLinkLocaleSlug() {
|
|
24
|
+
var currentLocale = (0, useCurrentLocale_1.useCurrentLocale)();
|
|
25
|
+
var languages = (0, useLanguages_1.useLanguages)();
|
|
23
26
|
// The `locale` parameter is mainly used for Language Dropdown
|
|
24
|
-
return useCallback((locale)
|
|
27
|
+
return (0, react_1.useCallback)(function (locale) { return getLinkLocaleSlug(languages, locale || currentLocale); }, [languages, currentLocale]);
|
|
25
28
|
}
|
|
29
|
+
exports.useGetLinkLocaleSlug = useGetLinkLocaleSlug;
|
|
26
30
|
//# sourceMappingURL=useGetLinkLocaleSlug.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetLinkLocaleSlug.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetLinkLocaleSlug.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"useGetLinkLocaleSlug.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetLinkLocaleSlug.ts"],"names":[],"mappings":";;;AACA,+BAAoC;AAEpC,qDAA4D;AAC5D,mCAA0C;AAE1C,uDAAsD;AACtD,+CAA8C;AAE9C;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,SAAqC,EACrC,MAAoB;IAEpB,IAAM,kBAAkB,GAAG,IAAA,qCAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IACpE,8EAA8E;IAC9E,IAAI,CAAC,kBAAkB,EAAE;QACrB,OAAO,kBAAkB,CAAC;KAC7B;IAED,OAAO,mBAAY,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,SAAS,EAAE,CAAC;AACpE,CAAC;AAED,SAAgB,oBAAoB;IAChC,IAAM,aAAa,GAAG,IAAA,mCAAgB,GAAE,CAAC;IACzC,IAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAC;IAEjC,8DAA8D;IAC9D,OAAO,IAAA,mBAAW,EACd,UAAC,MAAqB,IAAK,OAAA,iBAAiB,CAAC,SAAS,EAAE,MAAM,IAAI,aAAa,CAAC,EAArD,CAAqD,EAChF,CAAC,SAAS,EAAE,aAAa,CAAC,CAC7B,CAAC;AACN,CAAC;AATD,oDASC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGetTranslationUrl = void 0;
|
|
4
|
+
var router_1 = require("next/router");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var data_fetching_1 = require("../../data-fetching");
|
|
7
|
+
var useCurrentCategory_1 = require("./useCurrentCategory");
|
|
8
|
+
var useCurrentStory_1 = require("./useCurrentStory");
|
|
6
9
|
/**
|
|
7
10
|
* Determine correct URL for translated stories/categories with a fallback to homepage.
|
|
8
11
|
* E.g. if a story has a translation, the function will return the localized slug URL.
|
|
@@ -11,19 +14,22 @@ import { useCurrentStory } from './useCurrentStory';
|
|
|
11
14
|
*/
|
|
12
15
|
function getTranslationUrl(locale, path, currentCategory, currentStory, noFallback) {
|
|
13
16
|
if (currentCategory) {
|
|
14
|
-
if (getCategoryHasTranslation(currentCategory, locale)) {
|
|
15
|
-
return getCategoryUrl(currentCategory, locale);
|
|
17
|
+
if ((0, data_fetching_1.getCategoryHasTranslation)(currentCategory, locale)) {
|
|
18
|
+
return (0, data_fetching_1.getCategoryUrl)(currentCategory, locale);
|
|
16
19
|
}
|
|
17
20
|
if (noFallback) {
|
|
18
21
|
return '';
|
|
19
22
|
}
|
|
20
23
|
return '/';
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
var localeCode = locale.toUnderscoreCode();
|
|
23
26
|
if (currentStory && currentStory.culture.locale !== localeCode) {
|
|
24
|
-
|
|
27
|
+
var translatedStory = currentStory.translations.find(function (_a) {
|
|
28
|
+
var culture = _a.culture;
|
|
29
|
+
return culture.locale === localeCode;
|
|
30
|
+
});
|
|
25
31
|
if (translatedStory) {
|
|
26
|
-
return
|
|
32
|
+
return "/".concat(translatedStory.slug);
|
|
27
33
|
}
|
|
28
34
|
if (noFallback) {
|
|
29
35
|
return '';
|
|
@@ -36,10 +42,13 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
|
|
|
36
42
|
* This hook returns a function that is meant to be used in language pickers and alternate locales list for the pages.
|
|
37
43
|
* `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).
|
|
38
44
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return
|
|
45
|
+
function useGetTranslationUrl() {
|
|
46
|
+
var asPath = (0, router_1.useRouter)().asPath;
|
|
47
|
+
var currentCategory = (0, useCurrentCategory_1.useCurrentCategory)();
|
|
48
|
+
var currentStory = (0, useCurrentStory_1.useCurrentStory)();
|
|
49
|
+
return (0, react_1.useCallback)(function (locale, noFallback) {
|
|
50
|
+
return getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback);
|
|
51
|
+
}, [asPath, currentCategory, currentStory]);
|
|
44
52
|
}
|
|
53
|
+
exports.useGetTranslationUrl = useGetTranslationUrl;
|
|
45
54
|
//# sourceMappingURL=useGetTranslationUrl.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":";;;AACA,sCAAwC;AACxC,+BAAoC;AAEpC,qDAAgF;AAGhF,2DAA0D;AAC1D,qDAAoD;AAEpD;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,MAAoB,EACpB,IAAY,EACZ,eAA0B,EAC1B,YAA4B,EAC5B,UAAoB;IAEpB,IAAI,eAAe,EAAE;QACjB,IAAI,IAAA,yCAAyB,EAAC,eAAe,EAAE,MAAM,CAAC,EAAE;YACpD,OAAO,IAAA,8BAAc,EAAC,eAAe,EAAE,MAAM,CAAC,CAAC;SAClD;QAED,IAAI,UAAU,EAAE;YACZ,OAAO,EAAE,CAAC;SACb;QAED,OAAO,GAAG,CAAC;KACd;IAED,IAAM,UAAU,GAAG,MAAM,CAAC,gBAAgB,EAAE,CAAC;IAE7C,IAAI,YAAY,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,KAAK,UAAU,EAAE;QAC5D,IAAM,eAAe,GAAG,YAAY,CAAC,YAAY,CAAC,IAAI,CAClD,UAAC,EAAW;gBAAT,OAAO,aAAA;YAAO,OAAA,OAAO,CAAC,MAAM,KAAK,UAAU;QAA7B,CAA6B,CACjD,CAAC;QACF,IAAI,eAAe,EAAE;YACjB,OAAO,WAAI,eAAe,CAAC,IAAI,CAAE,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,SAAgB,oBAAoB;IACxB,IAAA,MAAM,GAAK,IAAA,kBAAS,GAAE,OAAhB,CAAiB;IAC/B,IAAM,eAAe,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAC7C,IAAM,YAAY,GAAG,IAAA,iCAAe,GAAE,CAAC;IAEvC,OAAO,IAAA,mBAAW,EACd,UAAC,MAAoB,EAAE,UAAoB;QACvC,OAAA,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC;IAA5E,CAA4E,EAChF,CAAC,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,CAC1C,CAAC;AACN,CAAC;AAVD,oDAUC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLanguages = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useLanguages() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.languages;
|
|
5
8
|
}
|
|
9
|
+
exports.useLanguages = useLanguages;
|
|
6
10
|
//# sourceMappingURL=useLanguages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useLanguages.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useLanguages.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useLanguages.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,YAAY;IACxB,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC;AAJD,oCAIC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNewsroom = void 0;
|
|
4
|
+
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useNewsroom() {
|
|
6
|
+
var context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
4
7
|
return context.newsroom;
|
|
5
8
|
}
|
|
9
|
+
exports.useNewsroom = useNewsroom;
|
|
6
10
|
//# sourceMappingURL=useNewsroom.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNewsroom.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroom.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"useNewsroom.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroom.ts"],"names":[],"mappings":";;;AAAA,2DAA0D;AAE1D,SAAgB,WAAW;IACvB,IAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC;AAJD,kCAIC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNewsroomContext = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var context_1 = require("../context");
|
|
6
|
+
function useNewsroomContext() {
|
|
4
7
|
// TS Compiler is having a hard time figuring this type implicitly, so we have to set it explicitly
|
|
5
8
|
// See https://github.com/microsoft/TypeScript/issues/5711#issuecomment-340283439
|
|
6
|
-
|
|
9
|
+
var newsroomContext = (0, react_1.useContext)(context_1.NewsroomContext);
|
|
7
10
|
if (!newsroomContext) {
|
|
8
11
|
throw new Error('No `NewsroomContextProvider` found when calling `useNewsroomContext`');
|
|
9
12
|
}
|
|
10
13
|
return newsroomContext;
|
|
11
14
|
}
|
|
15
|
+
exports.useNewsroomContext = useNewsroomContext;
|
|
12
16
|
//# sourceMappingURL=useNewsroomContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNewsroomContext.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroomContext.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"useNewsroomContext.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroomContext.ts"],"names":[],"mappings":";;;AAAA,+BAAmC;AAGnC,sCAA6C;AAE7C,SAAgB,kBAAkB;IAC9B,mGAAmG;IACnG,iFAAiF;IACjF,IAAM,eAAe,GAAoC,IAAA,kBAAU,EAAC,yBAAe,CAAC,CAAC;IACrF,IAAI,CAAC,eAAe,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KAC3F;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC;AATD,gDASC"}
|