@prezly/theme-kit-nextjs 1.16.0-0 → 1.16.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 +16 -66
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +18 -68
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +9 -59
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +9 -59
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/category.js +94 -195
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +58 -135
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +40 -132
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
- package/build/adapter-nextjs/page-props/home.js +56 -135
- package/build/adapter-nextjs/page-props/home.js.map +1 -1
- package/build/adapter-nextjs/page-props/search.js +19 -96
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +18 -18
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +9 -40
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +28 -76
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/story.js +57 -159
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +20 -81
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +8 -19
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +2 -13
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +41 -52
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +27 -31
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/components-nextjs/document.js +16 -45
- package/build/components-nextjs/document.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.js +170 -355
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +3 -3
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/queries.js +8 -32
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +5 -5
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +10 -21
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/isUuid.js +1 -1
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +25 -79
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +22 -94
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.js +36 -95
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/languages.js +35 -68
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.js +13 -13
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.js +11 -32
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeObject.js +30 -42
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +17 -29
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +2 -2
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
- package/build/newsroom-context/hooks/useCategories.js +2 -2
- package/build/newsroom-context/hooks/useCategories.js.map +1 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +2 -2
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +2 -2
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +2 -2
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +2 -2
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +8 -8
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +14 -19
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/newsroom-context/hooks/useLanguages.js +2 -2
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroom.js +2 -2
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js +3 -3
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
- package/build/sentry/client.js +1 -1
- package/build/sentry/client.js.map +1 -1
- package/build/sentry/common.js +2 -2
- package/build/sentry/common.js.map +1 -1
- package/build/sentry/server.js +1 -1
- package/build/sentry/server.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/utils/getAssetsUrl.js +2 -2
- package/build/utils/getAssetsUrl.js.map +1 -1
- package/build/utils/getDataRequestLink.js +1 -1
- package/build/utils/getDataRequestLink.js.map +1 -1
- package/build/utils/getLocalizedCategoryData.js +12 -23
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +4 -5
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +2 -2
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +1 -1
- package/build/utils/getStoryPublicationDate.js.map +1 -1
- package/build/utils/getUploadcareGroupUrl.js +2 -2
- package/build/utils/getUploadcareGroupUrl.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCategories = void 0;
|
|
4
|
-
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
5
|
function useCategories() {
|
|
6
|
-
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
7
|
return context.categories;
|
|
8
8
|
}
|
|
9
9
|
exports.useCategories = useCategories;
|
|
@@ -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,6DAA0D;AAE1D,SAAgB,aAAa;IACzB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,UAAU,CAAC;AAC9B,CAAC;AAJD,sCAIC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCompanyInformation = void 0;
|
|
4
|
-
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
5
|
function useCompanyInformation() {
|
|
6
|
-
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
7
|
return context.companyInformation;
|
|
8
8
|
}
|
|
9
9
|
exports.useCompanyInformation = useCompanyInformation;
|
|
@@ -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,6DAA0D;AAE1D,SAAgB,qBAAqB;IACjC,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,kBAAkB,CAAC;AACtC,CAAC;AAJD,sDAIC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCurrentCategory = void 0;
|
|
4
|
-
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
5
|
function useCurrentCategory() {
|
|
6
|
-
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
7
|
return context.currentCategory;
|
|
8
8
|
}
|
|
9
9
|
exports.useCurrentCategory = useCurrentCategory;
|
|
@@ -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,6DAA0D;AAE1D,SAAgB,kBAAkB;IAC9B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC;AAJD,gDAIC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCurrentLocale = void 0;
|
|
4
|
-
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
5
|
function useCurrentLocale() {
|
|
6
|
-
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
7
|
return context.locale;
|
|
8
8
|
}
|
|
9
9
|
exports.useCurrentLocale = useCurrentLocale;
|
|
@@ -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,6DAA0D;AAE1D,SAAgB,gBAAgB;IAC5B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC;AAJD,4CAIC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useCurrentStory = void 0;
|
|
4
|
-
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
5
|
function useCurrentStory() {
|
|
6
|
-
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
7
|
return context.currentStory;
|
|
8
8
|
}
|
|
9
9
|
exports.useCurrentStory = useCurrentStory;
|
|
@@ -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,6DAA0D;AAE1D,SAAgB,eAAe;IAC3B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,YAAY,CAAC;AAChC,CAAC;AAJD,0CAIC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useGetLinkLocaleSlug = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const intl_1 = require("../../intl");
|
|
6
|
+
const useCurrentLocale_1 = require("./useCurrentLocale");
|
|
7
|
+
const useLanguages_1 = require("./useLanguages");
|
|
8
8
|
/**
|
|
9
9
|
* Determines correct locale slug for the link (trying to shorten the locale code if possible).
|
|
10
10
|
* E.g. if newsroom has a single locale for Dutch (`nl_BE`), it will be shortened to `nl`.
|
|
@@ -12,7 +12,7 @@ var useLanguages_1 = require("./useLanguages");
|
|
|
12
12
|
* `false` means that a default locale should be used (no locale in URL required).
|
|
13
13
|
*/
|
|
14
14
|
function getLinkLocaleSlug(languages, locale) {
|
|
15
|
-
|
|
15
|
+
const shortestLocaleCode = (0, intl_1.getShortestLocaleCode)(languages, locale);
|
|
16
16
|
// When navigating to default language, we don't append the locale to the URL.
|
|
17
17
|
if (!shortestLocaleCode) {
|
|
18
18
|
return shortestLocaleCode;
|
|
@@ -20,10 +20,10 @@ function getLinkLocaleSlug(languages, locale) {
|
|
|
20
20
|
return intl_1.LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug();
|
|
21
21
|
}
|
|
22
22
|
function useGetLinkLocaleSlug() {
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
const currentLocale = (0, useCurrentLocale_1.useCurrentLocale)();
|
|
24
|
+
const languages = (0, useLanguages_1.useLanguages)();
|
|
25
25
|
// The `locale` parameter is mainly used for Language Dropdown
|
|
26
|
-
return (0, react_1.useCallback)(
|
|
26
|
+
return (0, react_1.useCallback)((locale) => getLinkLocaleSlug(languages, locale || currentLocale), [languages, currentLocale]);
|
|
27
27
|
}
|
|
28
28
|
exports.useGetLinkLocaleSlug = useGetLinkLocaleSlug;
|
|
29
29
|
//# 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,iCAAoC;AAEpC,qCAAiE;AAEjE,yDAAsD;AACtD,iDAA8C;AAE9C;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,SAAqC,EACrC,MAAoB;IAEpB,MAAM,kBAAkB,GAAG,IAAA,4BAAqB,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,MAAM,aAAa,GAAG,IAAA,mCAAgB,GAAE,CAAC;IACzC,MAAM,SAAS,GAAG,IAAA,2BAAY,GAAE,CAAC;IAEjC,8DAA8D;IAC9D,OAAO,IAAA,mBAAW,EACd,CAAC,MAAqB,EAAE,EAAE,CAAC,iBAAiB,CAAC,SAAS,EAAE,MAAM,IAAI,aAAa,CAAC,EAChF,CAAC,SAAS,EAAE,aAAa,CAAC,CAC7B,CAAC;AACN,CAAC;AATD,oDASC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useGetTranslationUrl = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const router_1 = require("next/router");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
const useCurrentCategory_1 = require("./useCurrentCategory");
|
|
8
|
+
const useCurrentStory_1 = require("./useCurrentStory");
|
|
9
9
|
// Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
|
|
10
10
|
var StoryVisibility;
|
|
11
11
|
(function (StoryVisibility) {
|
|
@@ -15,7 +15,7 @@ var StoryVisibility;
|
|
|
15
15
|
StoryVisibility["CONFIDENTIAL"] = "confidential";
|
|
16
16
|
})(StoryVisibility || (StoryVisibility = {}));
|
|
17
17
|
function getAllowedTranslationVisibilityValues(story) {
|
|
18
|
-
|
|
18
|
+
const { visibility } = story;
|
|
19
19
|
switch (visibility) {
|
|
20
20
|
case StoryVisibility.EMBARGO:
|
|
21
21
|
return [StoryVisibility.EMBARGO, StoryVisibility.PUBLIC];
|
|
@@ -43,15 +43,12 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
|
|
|
43
43
|
}
|
|
44
44
|
return '/';
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
const localeCode = locale.toUnderscoreCode();
|
|
47
47
|
if (currentStory && currentStory.culture.locale !== localeCode) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var culture = _a.culture, visibility = _a.visibility;
|
|
51
|
-
return culture.locale === localeCode && allowedVisibilityValues_1.includes(visibility);
|
|
52
|
-
});
|
|
48
|
+
const allowedVisibilityValues = getAllowedTranslationVisibilityValues(currentStory);
|
|
49
|
+
const translatedStory = currentStory.translations.find(({ culture, visibility }) => culture.locale === localeCode && allowedVisibilityValues.includes(visibility));
|
|
53
50
|
if (translatedStory) {
|
|
54
|
-
return
|
|
51
|
+
return `/${translatedStory.slug}`;
|
|
55
52
|
}
|
|
56
53
|
if (noFallback) {
|
|
57
54
|
return '';
|
|
@@ -65,12 +62,10 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
|
|
|
65
62
|
* `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).
|
|
66
63
|
*/
|
|
67
64
|
function useGetTranslationUrl() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return (0, react_1.useCallback)(
|
|
72
|
-
return getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback);
|
|
73
|
-
}, [asPath, currentCategory, currentStory]);
|
|
65
|
+
const { asPath } = (0, router_1.useRouter)();
|
|
66
|
+
const currentCategory = (0, useCurrentCategory_1.useCurrentCategory)();
|
|
67
|
+
const currentStory = (0, useCurrentStory_1.useCurrentStory)();
|
|
68
|
+
return (0, react_1.useCallback)((locale, noFallback) => getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback), [asPath, currentCategory, currentStory]);
|
|
74
69
|
}
|
|
75
70
|
exports.useGetTranslationUrl = useGetTranslationUrl;
|
|
76
71
|
//# 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,wCAAwC;AACxC,iCAAoC;AAGpC,uCAAwE;AAExE,6DAA0D;AAC1D,uDAAoD;AAEpD,wFAAwF;AACxF,IAAK,eAKJ;AALD,WAAK,eAAe;IAChB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,sCAAmB,CAAA;IACnB,gDAA6B,CAAA;AACjC,CAAC,EALI,eAAe,KAAf,eAAe,QAKnB;AAED,SAAS,qCAAqC,CAAC,KAAoB;IAC/D,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,QAAQ,UAAU,EAAE;QAChB,KAAK,eAAe,CAAC,OAAO;YACxB,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7D,KAAK,eAAe,CAAC,OAAO;YACxB,OAAO,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC7D,KAAK,eAAe,CAAC,YAAY;YAC7B,OAAO,CAAC,eAAe,CAAC,YAAY,EAAE,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,MAAM,CAAC,CAAC;QAC3F;YACI,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;KACvC;AACL,CAAC;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CACtB,MAAoB,EACpB,IAAY,EACZ,eAA0B,EAC1B,YAA4B,EAC5B,UAAoB;IAEpB,IAAI,eAAe,EAAE;QACjB,IAAI,IAAA,iCAAyB,EAAC,eAAe,EAAE,MAAM,CAAC,EAAE;YACpD,OAAO,IAAA,sBAAc,EAAC,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,SAAgB,oBAAoB;IAChC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAA,kBAAS,GAAE,CAAC;IAC/B,MAAM,eAAe,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAC7C,MAAM,YAAY,GAAG,IAAA,iCAAe,GAAE,CAAC;IAEvC,OAAO,IAAA,mBAAW,EACd,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;AAVD,oDAUC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useLanguages = void 0;
|
|
4
|
-
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
5
|
function useLanguages() {
|
|
6
|
-
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
7
|
return context.languages;
|
|
8
8
|
}
|
|
9
9
|
exports.useLanguages = useLanguages;
|
|
@@ -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,6DAA0D;AAE1D,SAAgB,YAAY;IACxB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC;AAJD,oCAIC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useNewsroom = void 0;
|
|
4
|
-
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
5
|
function useNewsroom() {
|
|
6
|
-
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
7
|
return context.newsroom;
|
|
8
8
|
}
|
|
9
9
|
exports.useNewsroom = useNewsroom;
|
|
@@ -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,6DAA0D;AAE1D,SAAgB,WAAW;IACvB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC;AAJD,kCAIC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useNewsroomContext = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
6
|
function useNewsroomContext() {
|
|
7
7
|
// TS Compiler is having a hard time figuring this type implicitly, so we have to set it explicitly
|
|
8
8
|
// See https://github.com/microsoft/TypeScript/issues/5711#issuecomment-340283439
|
|
9
|
-
|
|
9
|
+
const newsroomContext = (0, react_1.useContext)(context_1.NewsroomContext);
|
|
10
10
|
if (!newsroomContext) {
|
|
11
11
|
throw new Error('No `NewsroomContextProvider` found when calling `useNewsroomContext`');
|
|
12
12
|
}
|
|
@@ -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,iCAAmC;AAGnC,wCAA6C;AAE7C,SAAgB,kBAAkB;IAC9B,mGAAmG;IACnG,iFAAiF;IACjF,MAAM,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"}
|
package/build/sentry/client.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSentryClientOptions = void 0;
|
|
4
|
-
|
|
4
|
+
const common_1 = require("./common");
|
|
5
5
|
function getSentryClientOptions(dsn, themeName) {
|
|
6
6
|
return (0, common_1.getCommonClientOptions)(dsn, themeName);
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/sentry/client.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/sentry/client.ts"],"names":[],"mappings":";;;AAEA,qCAAkD;AAElD,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,IAAA,+BAAsB,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC;AAFD,wDAEC"}
|
package/build/sentry/common.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getCommonClientOptions = void 0;
|
|
4
4
|
function getCommonClientOptions(dsn, themeName) {
|
|
5
5
|
return {
|
|
6
|
-
dsn
|
|
6
|
+
dsn,
|
|
7
7
|
// Adjust this value in production, or use tracesSampler for greater control
|
|
8
8
|
tracesSampleRate: 0.02,
|
|
9
9
|
// ...
|
|
@@ -19,7 +19,7 @@ function getCommonClientOptions(dsn, themeName) {
|
|
|
19
19
|
'Illegal invocation',
|
|
20
20
|
],
|
|
21
21
|
// Attach theme tag to each event
|
|
22
|
-
initialScope:
|
|
22
|
+
initialScope: (scope) => {
|
|
23
23
|
scope.setTags({ prezly_theme: themeName });
|
|
24
24
|
return scope;
|
|
25
25
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sentry/common.ts"],"names":[],"mappings":";;;AAEA,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO;QACH,GAAG
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sentry/common.ts"],"names":[],"mappings":";;;AAEA,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO;QACH,GAAG;QACH,4EAA4E;QAC5E,gBAAgB,EAAE,IAAI;QACtB,MAAM;QACN,0EAA0E;QAC1E,2EAA2E;QAC3E,qDAAqD;QAErD,YAAY,EAAE;YACV,2EAA2E;YAC3E,kGAAkG;YAClG,yGAAyG;YACzG,8BAA8B;YAC9B,oIAAoI;YACpI,oBAAoB;SACvB;QACD,iCAAiC;QACjC,YAAY,EAAE,CAAC,KAAK,EAAE,EAAE;YACpB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC,CAAC;YAC3C,OAAO,KAAK,CAAC;QACjB,CAAC;KACJ,CAAC;AACN,CAAC;AAxBD,wDAwBC"}
|
package/build/sentry/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSentryServerOptions = void 0;
|
|
4
|
-
|
|
4
|
+
const common_1 = require("./common");
|
|
5
5
|
function getSentryServerOptions(dsn, themeName) {
|
|
6
6
|
return (0, common_1.getCommonClientOptions)(dsn, themeName);
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/sentry/server.ts"],"names":[],"mappings":";;;AAEA,
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/sentry/server.ts"],"names":[],"mappings":";;;AAEA,qCAAkD;AAElD,SAAgB,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,IAAA,+BAAsB,EAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC;AAFD,wDAEC"}
|