@prezly/theme-kit-nextjs 1.15.0 → 1.16.0-1
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 +15 -69
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +17 -71
- 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 +9 -63
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +9 -63
- 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 +1 -1
- package/build/adapter-nextjs/page-props/category.js +95 -202
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.d.ts +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +59 -141
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.d.ts +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +41 -139
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
- package/build/adapter-nextjs/page-props/home.d.ts +1 -1
- package/build/adapter-nextjs/page-props/home.js +58 -142
- 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.d.ts +1 -1
- package/build/adapter-nextjs/page-props/lib/types.js +1 -2
- package/build/adapter-nextjs/page-props/search.d.ts +2 -2
- package/build/adapter-nextjs/page-props/search.js +21 -103
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +18 -22
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +10 -45
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +29 -81
- 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.d.ts +1 -1
- package/build/adapter-nextjs/page-props/story.js +58 -166
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +20 -85
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +9 -24
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +3 -18
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +42 -57
- 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 +2 -6
- 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 +28 -36
- 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.d.ts +6 -0
- package/build/components-nextjs/document.js +21 -0
- package/build/components-nextjs/document.js.map +1 -0
- package/build/components-nextjs/index.d.ts +1 -0
- package/build/components-nextjs/index.js +3 -7
- package/build/components-nextjs/index.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.js +171 -363
- 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 +13 -45
- 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 +6 -10
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +11 -29
- 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 +2 -6
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/data-fetching/types.js +1 -2
- package/build/index.d.ts +1 -0
- package/build/index.js +9 -24
- 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 +25 -83
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +21 -97
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.js +36 -99
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/index.js +4 -25
- package/build/intl/index.js.map +1 -1
- package/build/intl/languages.js +47 -93
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.js +21 -27
- 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 -49
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +18 -34
- 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 +17 -26
- 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.d.ts +2 -0
- package/build/sentry/client.js +5 -0
- package/build/sentry/client.js.map +1 -0
- package/build/sentry/common.d.ts +2 -0
- package/build/sentry/common.js +25 -0
- package/build/sentry/common.js.map +1 -0
- package/build/sentry/index.d.ts +2 -0
- package/build/sentry/index.js +3 -0
- package/build/sentry/index.js.map +1 -0
- package/build/sentry/server.d.ts +2 -0
- package/build/sentry/server.js +5 -0
- package/build/sentry/server.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- 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 +15 -32
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +6 -12
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +3 -7
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +2 -6
- 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 +2 -1
- package/src/adapter-nextjs/page-props/category.ts +5 -2
- package/src/adapter-nextjs/page-props/gallery.ts +5 -2
- package/src/adapter-nextjs/page-props/galleryAlbum.ts +5 -2
- package/src/adapter-nextjs/page-props/home.ts +5 -2
- package/src/adapter-nextjs/page-props/lib/types.ts +4 -4
- package/src/adapter-nextjs/page-props/search.ts +10 -3
- package/src/adapter-nextjs/page-props/story.ts +5 -2
- package/src/components-nextjs/document.tsx +38 -0
- package/src/components-nextjs/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/sentry/client.ts +7 -0
- package/src/sentry/common.ts +27 -0
- package/src/sentry/index.ts +2 -0
- package/src/sentry/server.ts +7 -0
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var utils_1 = require("../../utils");
|
|
7
|
-
var useCurrentCategory_1 = require("./useCurrentCategory");
|
|
8
|
-
var useCurrentStory_1 = require("./useCurrentStory");
|
|
1
|
+
import { useRouter } from 'next/router';
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { getCategoryHasTranslation, getCategoryUrl } from '../../utils';
|
|
4
|
+
import { useCurrentCategory } from './useCurrentCategory';
|
|
5
|
+
import { useCurrentStory } from './useCurrentStory';
|
|
9
6
|
// Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
|
|
10
7
|
var StoryVisibility;
|
|
11
8
|
(function (StoryVisibility) {
|
|
@@ -15,7 +12,7 @@ var StoryVisibility;
|
|
|
15
12
|
StoryVisibility["CONFIDENTIAL"] = "confidential";
|
|
16
13
|
})(StoryVisibility || (StoryVisibility = {}));
|
|
17
14
|
function getAllowedTranslationVisibilityValues(story) {
|
|
18
|
-
|
|
15
|
+
const { visibility } = story;
|
|
19
16
|
switch (visibility) {
|
|
20
17
|
case StoryVisibility.EMBARGO:
|
|
21
18
|
return [StoryVisibility.EMBARGO, StoryVisibility.PUBLIC];
|
|
@@ -35,23 +32,20 @@ function getAllowedTranslationVisibilityValues(story) {
|
|
|
35
32
|
*/
|
|
36
33
|
function getTranslationUrl(locale, path, currentCategory, currentStory, noFallback) {
|
|
37
34
|
if (currentCategory) {
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
35
|
+
if (getCategoryHasTranslation(currentCategory, locale)) {
|
|
36
|
+
return getCategoryUrl(currentCategory, locale);
|
|
40
37
|
}
|
|
41
38
|
if (noFallback) {
|
|
42
39
|
return '';
|
|
43
40
|
}
|
|
44
41
|
return '/';
|
|
45
42
|
}
|
|
46
|
-
|
|
43
|
+
const localeCode = locale.toUnderscoreCode();
|
|
47
44
|
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
|
-
});
|
|
45
|
+
const allowedVisibilityValues = getAllowedTranslationVisibilityValues(currentStory);
|
|
46
|
+
const translatedStory = currentStory.translations.find(({ culture, visibility }) => culture.locale === localeCode && allowedVisibilityValues.includes(visibility));
|
|
53
47
|
if (translatedStory) {
|
|
54
|
-
return
|
|
48
|
+
return `/${translatedStory.slug}`;
|
|
55
49
|
}
|
|
56
50
|
if (noFallback) {
|
|
57
51
|
return '';
|
|
@@ -64,13 +58,10 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
|
|
|
64
58
|
* This hook returns a function that is meant to be used in language pickers and alternate locales list for the pages.
|
|
65
59
|
* `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
60
|
*/
|
|
67
|
-
function useGetTranslationUrl() {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return (
|
|
72
|
-
return getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback);
|
|
73
|
-
}, [asPath, currentCategory, currentStory]);
|
|
61
|
+
export function useGetTranslationUrl() {
|
|
62
|
+
const { asPath } = useRouter();
|
|
63
|
+
const currentCategory = useCurrentCategory();
|
|
64
|
+
const currentStory = useCurrentStory();
|
|
65
|
+
return useCallback((locale, noFallback) => getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback), [asPath, currentCategory, currentStory]);
|
|
74
66
|
}
|
|
75
|
-
exports.useGetTranslationUrl = useGetTranslationUrl;
|
|
76
67
|
//# 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,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,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,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
|
-
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useLanguages() {
|
|
6
|
-
var 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
|
-
var useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
-
function useNewsroom() {
|
|
6
|
-
var 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"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var context_1 = require("../context");
|
|
6
|
-
function useNewsroomContext() {
|
|
1
|
+
import { useContext } from 'react';
|
|
2
|
+
import { NewsroomContext } from '../context';
|
|
3
|
+
export function useNewsroomContext() {
|
|
7
4
|
// TS Compiler is having a hard time figuring this type implicitly, so we have to set it explicitly
|
|
8
5
|
// See https://github.com/microsoft/TypeScript/issues/5711#issuecomment-340283439
|
|
9
|
-
|
|
6
|
+
const newsroomContext = useContext(NewsroomContext);
|
|
10
7
|
if (!newsroomContext) {
|
|
11
8
|
throw new Error('No `NewsroomContextProvider` found when calling `useNewsroomContext`');
|
|
12
9
|
}
|
|
13
10
|
return newsroomContext;
|
|
14
11
|
}
|
|
15
|
-
exports.useNewsroomContext = useNewsroomContext;
|
|
16
12
|
//# sourceMappingURL=useNewsroomContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNewsroomContext.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroomContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNewsroomContext.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useNewsroomContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,UAAU,kBAAkB;IAC9B,mGAAmG;IACnG,iFAAiF;IACjF,MAAM,eAAe,GAAoC,UAAU,CAAC,eAAe,CAAC,CAAC;IACrF,IAAI,CAAC,eAAe,EAAE;QAClB,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;KAC3F;IAED,OAAO,eAAe,CAAC;AAC3B,CAAC"}
|
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.NewsroomContextProvider = exports.NewsroomContext = void 0;
|
|
18
|
-
var context_1 = require("./context");
|
|
19
|
-
Object.defineProperty(exports, "NewsroomContext", { enumerable: true, get: function () { return context_1.NewsroomContext; } });
|
|
20
|
-
Object.defineProperty(exports, "NewsroomContextProvider", { enumerable: true, get: function () { return context_1.NewsroomContextProvider; } });
|
|
21
|
-
__exportStar(require("./hooks"), exports);
|
|
1
|
+
export { NewsroomContext, NewsroomContextProvider } from './context';
|
|
2
|
+
export * from './hooks';
|
|
22
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAwB,MAAM,WAAW,CAAC;AAC3F,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/sentry/client.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function getCommonClientOptions(dsn, themeName) {
|
|
2
|
+
return {
|
|
3
|
+
dsn,
|
|
4
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
5
|
+
tracesSampleRate: 0.02,
|
|
6
|
+
// ...
|
|
7
|
+
// Note: if you want to override the automatic release value, do not set a
|
|
8
|
+
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
|
|
9
|
+
// that it will also get attached to your source maps
|
|
10
|
+
ignoreErrors: [
|
|
11
|
+
// This particular error is coming from Microsoft Outlook SafeLink crawler.
|
|
12
|
+
// It doesn't affect the user experience in any way, but produces a lot of unwanted Sentry events.
|
|
13
|
+
// See https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
|
|
14
|
+
'Object Not Found Matching Id',
|
|
15
|
+
// This error is caused by `beacon.min.js` polyfill in Cloudflare Insights. From what we see, it doesn't affect the user experience.
|
|
16
|
+
'Illegal invocation',
|
|
17
|
+
],
|
|
18
|
+
// Attach theme tag to each event
|
|
19
|
+
initialScope: (scope) => {
|
|
20
|
+
scope.setTags({ prezly_theme: themeName });
|
|
21
|
+
return scope;
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sentry/common.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sentry/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/sentry/server.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,UAAU,sBAAsB,CAAC,GAAW,EAAE,SAAiB;IACjE,OAAO,sBAAsB,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;AAClD,CAAC"}
|