@prezly/theme-kit-nextjs 2.0.1-2 → 2.1.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/README.md +15 -15
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +23 -27
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +25 -37
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/index.js +8 -2
- package/build/adapter-nextjs/api-handlers/index.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +15 -16
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +15 -15
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/index.js +23 -6
- package/build/adapter-nextjs/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/category.js +100 -118
- package/build/adapter-nextjs/page-props/category.js.map +1 -1
- package/build/adapter-nextjs/page-props/gallery.js +68 -87
- package/build/adapter-nextjs/page-props/gallery.js.map +1 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.js +53 -64
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +1 -1
- package/build/adapter-nextjs/page-props/home.js +69 -83
- package/build/adapter-nextjs/page-props/home.js.map +1 -1
- package/build/adapter-nextjs/page-props/index.js +42 -8
- package/build/adapter-nextjs/page-props/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/lib/types.js +3 -1
- package/build/adapter-nextjs/page-props/search.js +31 -25
- package/build/adapter-nextjs/page-props/search.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +50 -29
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js +19 -13
- package/build/adapter-nextjs/page-props/sitemap/createPaths.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +35 -33
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/index.js +25 -4
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +1 -1
- package/build/adapter-nextjs/page-props/sitemap/types.js +3 -1
- package/build/adapter-nextjs/page-props/story.js +64 -77
- package/build/adapter-nextjs/page-props/story.js.map +1 -1
- package/build/adapter-nextjs/page-props/storyPreview.js +26 -27
- package/build/adapter-nextjs/page-props/storyPreview.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +25 -34
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +16 -19
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/PageSeo/PageSeo.js +78 -84
- package/build/components-nextjs/PageSeo/PageSeo.js.map +1 -1
- package/build/components-nextjs/PageSeo/index.js +21 -2
- package/build/components-nextjs/PageSeo/index.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +10 -5
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +1 -1
- package/build/components-nextjs/PageSeo/lib/types.js +3 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +47 -69
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/components-nextjs/StorySeo/index.js +6 -1
- package/build/components-nextjs/StorySeo/index.js.map +1 -1
- package/build/components-nextjs/document.d.ts +2 -4
- package/build/components-nextjs/document.js +48 -34
- package/build/components-nextjs/document.js.map +1 -1
- package/build/components-nextjs/index.js +10 -3
- package/build/components-nextjs/index.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.js +191 -207
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +21 -21
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/index.js +18 -1
- package/build/data-fetching/api/index.js.map +1 -1
- package/build/data-fetching/api/queries.js +47 -76
- package/build/data-fetching/api/queries.js.map +1 -1
- package/build/data-fetching/index.js +20 -3
- package/build/data-fetching/index.js.map +1 -1
- package/build/data-fetching/lib/getAlgoliaSettings.js +22 -22
- package/build/data-fetching/lib/getAlgoliaSettings.js.map +1 -1
- package/build/data-fetching/lib/getEnvVariables.js +38 -35
- package/build/data-fetching/lib/getEnvVariables.js.map +1 -1
- package/build/data-fetching/lib/index.js +12 -4
- package/build/data-fetching/lib/index.js.map +1 -1
- package/build/data-fetching/lib/isSdkError.js +8 -3
- package/build/data-fetching/lib/isSdkError.js.map +1 -1
- package/build/data-fetching/lib/isUuid.js +8 -3
- package/build/data-fetching/lib/isUuid.js.map +1 -1
- package/build/data-fetching/types.js +3 -1
- package/build/index.js +26 -9
- package/build/index.js.map +1 -1
- package/build/infinite-loading/index.js +25 -4
- package/build/infinite-loading/index.js.map +1 -1
- package/build/infinite-loading/types.js +3 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +37 -42
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteLoading.js +43 -50
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.js +50 -56
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +1 -1
- package/build/intl/index.d.ts +1 -1
- package/build/intl/index.js +26 -4
- package/build/intl/index.js.map +1 -1
- package/build/intl/languages.js +122 -146
- package/build/intl/languages.js.map +1 -1
- package/build/intl/locale.d.ts +1 -0
- package/build/intl/locale.js +108 -52
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.d.ts +2 -3
- package/build/intl/localeConfig.js +14 -20
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeList.d.ts +2 -4
- package/build/intl/localeList.js +109 -1
- package/build/intl/localeList.js.map +1 -1
- package/build/intl/localeObject.js +82 -80
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.js +25 -35
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/index.js +28 -11
- package/build/newsroom-context/hooks/index.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +10 -5
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +1 -1
- package/build/newsroom-context/hooks/useCategories.js +10 -5
- package/build/newsroom-context/hooks/useCategories.js.map +1 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +10 -5
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +10 -5
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +10 -5
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +1 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +10 -5
- package/build/newsroom-context/hooks/useCurrentStory.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +21 -17
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +56 -52
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/newsroom-context/hooks/useLanguages.js +10 -5
- package/build/newsroom-context/hooks/useLanguages.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroom.js +10 -5
- package/build/newsroom-context/hooks/useNewsroom.js.map +1 -1
- package/build/newsroom-context/hooks/useNewsroomContext.js +16 -11
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +1 -1
- package/build/newsroom-context/index.d.ts +1 -2
- package/build/newsroom-context/index.js +22 -2
- package/build/newsroom-context/index.js.map +1 -1
- package/build/sentry/client.js +9 -4
- package/build/sentry/client.js.map +1 -1
- package/build/sentry/common.js +29 -26
- package/build/sentry/common.js.map +1 -1
- package/build/sentry/index.js +8 -2
- package/build/sentry/index.js.map +1 -1
- package/build/sentry/server.js +9 -4
- package/build/sentry/server.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -0
- package/build/types.js +3 -1
- package/build/utils/boilerplate.js +22 -7
- package/build/utils/boilerplate.js.map +1 -1
- package/build/utils/constants.js +7 -3
- package/build/utils/constants.js.map +1 -1
- package/build/utils/getAssetsUrl.js +9 -4
- package/build/utils/getAssetsUrl.js.map +1 -1
- package/build/utils/getDataRequestLink.js +12 -6
- package/build/utils/getDataRequestLink.js.map +1 -1
- package/build/utils/getLocalizedCategoryData.js +33 -33
- package/build/utils/getLocalizedCategoryData.js.map +1 -1
- package/build/utils/getNewsroomLogoUrl.js +21 -15
- package/build/utils/getNewsroomLogoUrl.js.map +1 -1
- package/build/utils/getPrivacyPortalUrl.js +13 -11
- package/build/utils/getPrivacyPortalUrl.js.map +1 -1
- package/build/utils/getStoryPublicationDate.js +14 -9
- package/build/utils/getStoryPublicationDate.js.map +1 -1
- package/build/utils/getUploadcareGroupUrl.js +10 -5
- package/build/utils/getUploadcareGroupUrl.js.map +1 -1
- package/build/utils/index.js +27 -10
- package/build/utils/index.js.map +1 -1
- package/build/utils/isEmbargoStory.js +8 -3
- package/build/utils/isEmbargoStory.js.map +1 -1
- package/package.json +13 -28
- package/src/@types/global.d.ts +7 -0
- package/src/__mocks__/languages.ts +416 -0
- package/src/__mocks__/story.ts +359 -0
- package/src/adapter-nextjs/api-handlers/fetchGalleries.ts +24 -0
- package/src/adapter-nextjs/api-handlers/fetchStories.ts +26 -0
- package/src/adapter-nextjs/api-handlers/index.ts +2 -0
- package/src/adapter-nextjs/getNewsroomServerSideProps.ts +29 -0
- package/src/adapter-nextjs/getNewsroomStaticProps.ts +29 -0
- package/src/adapter-nextjs/index.ts +6 -0
- package/src/adapter-nextjs/page-props/category.ts +157 -0
- package/src/adapter-nextjs/page-props/gallery.ts +114 -0
- package/src/adapter-nextjs/page-props/galleryAlbum.ts +89 -0
- package/src/adapter-nextjs/page-props/home.ts +113 -0
- package/src/adapter-nextjs/page-props/index.ts +26 -0
- package/src/adapter-nextjs/page-props/lib/types.ts +8 -0
- package/src/adapter-nextjs/page-props/search.ts +53 -0
- package/src/adapter-nextjs/page-props/sitemap/SitemapBuilder.ts +56 -0
- package/src/adapter-nextjs/page-props/sitemap/createPaths.ts +21 -0
- package/src/adapter-nextjs/page-props/sitemap/getServerSideProps.ts +43 -0
- package/src/adapter-nextjs/page-props/sitemap/index.ts +5 -0
- package/src/adapter-nextjs/page-props/sitemap/types.ts +5 -0
- package/src/adapter-nextjs/page-props/story.ts +94 -0
- package/src/adapter-nextjs/page-props/storyPreview.ts +33 -0
- package/src/adapter-nextjs/processRequest.ts +49 -0
- package/src/adapter-nextjs/processStaticRequest.ts +32 -0
- package/src/components-nextjs/PageSeo/PageSeo.tsx +131 -0
- package/src/components-nextjs/PageSeo/index.ts +2 -0
- package/src/components-nextjs/PageSeo/lib/getAbsoluteUrl.ts +7 -0
- package/src/components-nextjs/PageSeo/lib/types.ts +4 -0
- package/src/components-nextjs/StorySeo/StorySeo.tsx +80 -0
- package/src/components-nextjs/StorySeo/index.ts +1 -0
- package/src/components-nextjs/document.tsx +38 -0
- package/src/components-nextjs/index.ts +3 -0
- package/src/data-fetching/api/PrezlyApi.ts +304 -0
- package/src/data-fetching/api/getPrezlyApi.ts +24 -0
- package/src/data-fetching/api/index.ts +1 -0
- package/src/data-fetching/api/queries.ts +51 -0
- package/src/data-fetching/index.ts +3 -0
- package/src/data-fetching/lib/getAlgoliaSettings.ts +29 -0
- package/src/data-fetching/lib/getEnvVariables.ts +46 -0
- package/src/data-fetching/lib/index.ts +4 -0
- package/src/data-fetching/lib/isSdkError.ts +5 -0
- package/src/data-fetching/lib/isUuid.ts +5 -0
- package/src/data-fetching/types.ts +14 -0
- package/src/index.ts +9 -0
- package/src/infinite-loading/index.ts +4 -0
- package/src/infinite-loading/types.ts +5 -0
- package/src/infinite-loading/useInfiniteGalleriesLoading.ts +53 -0
- package/src/infinite-loading/useInfiniteLoading.ts +66 -0
- package/src/infinite-loading/useInfiniteStoriesLoading.ts +81 -0
- package/src/intl/index.ts +4 -0
- package/src/intl/languages.test.ts +232 -0
- package/src/intl/languages.ts +233 -0
- package/src/intl/locale.test.ts +95 -0
- package/src/intl/locale.ts +140 -0
- package/src/intl/localeConfig.js +23 -0
- package/src/intl/localeList.js +110 -0
- package/src/intl/localeObject.test.ts +81 -0
- package/src/intl/localeObject.ts +99 -0
- package/src/newsroom-context/context.tsx +115 -0
- package/src/newsroom-context/hooks/index.ts +11 -0
- package/src/newsroom-context/hooks/useAlgoliaSettings.ts +7 -0
- package/src/newsroom-context/hooks/useCategories.ts +7 -0
- package/src/newsroom-context/hooks/useCompanyInformation.ts +7 -0
- package/src/newsroom-context/hooks/useCurrentCategory.ts +7 -0
- package/src/newsroom-context/hooks/useCurrentLocale.ts +7 -0
- package/src/newsroom-context/hooks/useCurrentStory.ts +7 -0
- package/src/newsroom-context/hooks/useGetLinkLocaleSlug.ts +37 -0
- package/src/newsroom-context/hooks/useGetTranslationUrl.ts +97 -0
- package/src/newsroom-context/hooks/useLanguages.ts +7 -0
- package/src/newsroom-context/hooks/useNewsroom.ts +7 -0
- package/src/newsroom-context/hooks/useNewsroomContext.ts +15 -0
- package/src/newsroom-context/index.ts +2 -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
- package/src/types.ts +51 -0
- package/src/utils/boilerplate.ts +27 -0
- package/src/utils/constants.ts +3 -0
- package/src/utils/getAssetsUrl.test.ts +9 -0
- package/src/utils/getAssetsUrl.ts +9 -0
- package/src/utils/getDataRequestLink.ts +14 -0
- package/src/utils/getLocalizedCategoryData.ts +47 -0
- package/src/utils/getNewsroomLogoUrl.ts +22 -0
- package/src/utils/getPrivacyPortalUrl.ts +25 -0
- package/src/utils/getStoryPublicationDate.tsx +15 -0
- package/src/utils/getUploadcareGroupUrl.ts +13 -0
- package/src/utils/index.ts +10 -0
- package/src/utils/isEmbargoStory.ts +10 -0
- package/build/@types/global.d.js +0 -1
|
@@ -1,11 +1,28 @@
|
|
|
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
|
+
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
|
+
__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);
|
|
28
|
+
//# 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,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAlgoliaSettings = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useAlgoliaSettings() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.algoliaSettings;
|
|
8
|
+
}
|
|
9
|
+
exports.useAlgoliaSettings = useAlgoliaSettings;
|
|
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,6DAA0D;AAE1D,SAAgB,kBAAkB;IAC9B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC;AAJD,gDAIC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCategories = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCategories() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.categories;
|
|
8
|
+
}
|
|
9
|
+
exports.useCategories = useCategories;
|
|
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,6DAA0D;AAE1D,SAAgB,aAAa;IACzB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,UAAU,CAAC;AAC9B,CAAC;AAJD,sCAIC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCompanyInformation = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCompanyInformation() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.companyInformation;
|
|
8
|
+
}
|
|
9
|
+
exports.useCompanyInformation = useCompanyInformation;
|
|
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,6DAA0D;AAE1D,SAAgB,qBAAqB;IACjC,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,kBAAkB,CAAC;AACtC,CAAC;AAJD,sDAIC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentCategory = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCurrentCategory() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.currentCategory;
|
|
8
|
+
}
|
|
9
|
+
exports.useCurrentCategory = useCurrentCategory;
|
|
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,6DAA0D;AAE1D,SAAgB,kBAAkB;IAC9B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,eAAe,CAAC;AACnC,CAAC;AAJD,gDAIC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentLocale = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCurrentLocale() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.locale;
|
|
8
|
+
}
|
|
9
|
+
exports.useCurrentLocale = useCurrentLocale;
|
|
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,6DAA0D;AAE1D,SAAgB,gBAAgB;IAC5B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,MAAM,CAAC;AAC1B,CAAC;AAJD,4CAIC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useCurrentStory = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useCurrentStory() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.currentStory;
|
|
8
|
+
}
|
|
9
|
+
exports.useCurrentStory = useCurrentStory;
|
|
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,6DAA0D;AAE1D,SAAgB,eAAe;IAC3B,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,YAAY,CAAC;AAChC,CAAC;AAJD,0CAIC"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGetLinkLocaleSlug = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const intl_1 = require("../../intl");
|
|
6
|
+
const useCurrentLocale_1 = require("./useCurrentLocale");
|
|
7
|
+
const useLanguages_1 = require("./useLanguages");
|
|
5
8
|
/**
|
|
6
9
|
* Determines correct locale slug for the link (trying to shorten the locale code if possible).
|
|
7
10
|
* E.g. if newsroom has a single locale for Dutch (`nl_BE`), it will be shortened to `nl`.
|
|
@@ -9,17 +12,18 @@ import { useLanguages } from "./useLanguages.js";
|
|
|
9
12
|
* `false` means that a default locale should be used (no locale in URL required).
|
|
10
13
|
*/
|
|
11
14
|
function getLinkLocaleSlug(languages, locale) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const shortestLocaleCode = (0, intl_1.getShortestLocaleCode)(languages, locale);
|
|
16
|
+
// When navigating to default language, we don't append the locale to the URL.
|
|
17
|
+
if (!shortestLocaleCode) {
|
|
18
|
+
return shortestLocaleCode;
|
|
19
|
+
}
|
|
20
|
+
return intl_1.LocaleObject.fromAnyCode(shortestLocaleCode).toUrlSlug();
|
|
18
21
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
function useGetLinkLocaleSlug() {
|
|
23
|
+
const currentLocale = (0, useCurrentLocale_1.useCurrentLocale)();
|
|
24
|
+
const languages = (0, useLanguages_1.useLanguages)();
|
|
25
|
+
// The `locale` parameter is mainly used for Language Dropdown
|
|
26
|
+
return (0, react_1.useCallback)((locale) => getLinkLocaleSlug(languages, locale || currentLocale), [languages, currentLocale]);
|
|
27
|
+
}
|
|
28
|
+
exports.useGetLinkLocaleSlug = useGetLinkLocaleSlug;
|
|
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,25 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useGetTranslationUrl = void 0;
|
|
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
|
+
// Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
|
|
10
|
+
// It looks like a hack, but the name of enum must be the same as in SDK
|
|
11
|
+
var Visibility;
|
|
12
|
+
(function (Visibility) {
|
|
13
|
+
Visibility["PUBLIC"] = "public";
|
|
14
|
+
Visibility["EMBARGO"] = "embargo";
|
|
15
|
+
Visibility["PRIVATE"] = "private";
|
|
16
|
+
Visibility["CONFIDENTIAL"] = "confidential";
|
|
17
|
+
})(Visibility || (Visibility = {}));
|
|
7
18
|
function getAllowedTranslationVisibilityValues(story) {
|
|
8
|
-
|
|
9
|
-
visibility
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return [Story.Visibility.PUBLIC];
|
|
20
|
-
}
|
|
19
|
+
const { visibility } = story;
|
|
20
|
+
switch (visibility) {
|
|
21
|
+
case Visibility.EMBARGO:
|
|
22
|
+
return [Visibility.EMBARGO, Visibility.PUBLIC];
|
|
23
|
+
case Visibility.PRIVATE:
|
|
24
|
+
return [Visibility.PRIVATE, Visibility.PUBLIC];
|
|
25
|
+
case Visibility.CONFIDENTIAL:
|
|
26
|
+
return [Visibility.CONFIDENTIAL, Visibility.PRIVATE, Visibility.PUBLIC];
|
|
27
|
+
default:
|
|
28
|
+
return [Visibility.PUBLIC];
|
|
29
|
+
}
|
|
21
30
|
}
|
|
22
|
-
|
|
23
31
|
/**
|
|
24
32
|
* Determine correct URL for translated stories/categories with a fallback to homepage.
|
|
25
33
|
* E.g. if a story has a translation, the function will return the localized slug URL.
|
|
@@ -27,42 +35,38 @@ function getAllowedTranslationVisibilityValues(story) {
|
|
|
27
35
|
* or empty string, if `noFallback` is set to `true` (this is useful for alternate locale links).
|
|
28
36
|
*/
|
|
29
37
|
function getTranslationUrl(locale, path, currentCategory, currentStory, noFallback) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
if (currentCategory) {
|
|
39
|
+
if ((0, utils_1.getCategoryHasTranslation)(currentCategory, locale)) {
|
|
40
|
+
return (0, utils_1.getCategoryUrl)(currentCategory, locale);
|
|
41
|
+
}
|
|
42
|
+
if (noFallback) {
|
|
43
|
+
return '';
|
|
44
|
+
}
|
|
45
|
+
return '/';
|
|
36
46
|
}
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
const localeCode = locale.toUnderscoreCode();
|
|
48
|
+
if (currentStory && currentStory.culture.locale !== localeCode) {
|
|
49
|
+
const allowedVisibilityValues = getAllowedTranslationVisibilityValues(currentStory);
|
|
50
|
+
const translatedStory = currentStory.translations.find(({ culture, visibility }) => culture.locale === localeCode && allowedVisibilityValues.includes(visibility));
|
|
51
|
+
if (translatedStory) {
|
|
52
|
+
return `/${translatedStory.slug}`;
|
|
53
|
+
}
|
|
54
|
+
if (noFallback) {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
return '/';
|
|
48
58
|
}
|
|
49
|
-
|
|
50
|
-
return '';
|
|
51
|
-
}
|
|
52
|
-
return '/';
|
|
53
|
-
}
|
|
54
|
-
return path;
|
|
59
|
+
return path;
|
|
55
60
|
}
|
|
56
|
-
|
|
57
61
|
/**
|
|
58
62
|
* This hook returns a function that is meant to be used in language pickers and alternate locales list for the pages.
|
|
59
63
|
* `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).
|
|
60
64
|
*/
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
function useGetTranslationUrl() {
|
|
66
|
+
const { asPath } = (0, router_1.useRouter)();
|
|
67
|
+
const currentCategory = (0, useCurrentCategory_1.useCurrentCategory)();
|
|
68
|
+
const currentStory = (0, useCurrentStory_1.useCurrentStory)();
|
|
69
|
+
return (0, react_1.useCallback)((locale, noFallback) => getTranslationUrl(locale, asPath, currentCategory, currentStory, noFallback), [asPath, currentCategory, currentStory]);
|
|
70
|
+
}
|
|
71
|
+
exports.useGetTranslationUrl = useGetTranslationUrl;
|
|
72
|
+
//# 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,wEAAwE;AACxE,IAAK,UAKJ;AALD,WAAK,UAAU;IACX,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,2CAA6B,CAAA;AACjC,CAAC,EALI,UAAU,KAAV,UAAU,QAKd;AAED,SAAS,qCAAqC,CAAC,KAAoB;IAC/D,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,QAAQ,UAAU,EAAE;QAChB,KAAK,UAAU,CAAC,OAAO;YACnB,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,UAAU,CAAC,OAAO;YACnB,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QACnD,KAAK,UAAU,CAAC,YAAY;YACxB,OAAO,CAAC,UAAU,CAAC,YAAY,EAAE,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;QAC5E;YACI,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;KAClC;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,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLanguages = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useLanguages() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.languages;
|
|
8
|
+
}
|
|
9
|
+
exports.useLanguages = useLanguages;
|
|
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,6DAA0D;AAE1D,SAAgB,YAAY;IACxB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,SAAS,CAAC;AAC7B,CAAC;AAJD,oCAIC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNewsroom = void 0;
|
|
4
|
+
const useNewsroomContext_1 = require("./useNewsroomContext");
|
|
5
|
+
function useNewsroom() {
|
|
6
|
+
const context = (0, useNewsroomContext_1.useNewsroomContext)();
|
|
7
|
+
return context.newsroom;
|
|
8
|
+
}
|
|
9
|
+
exports.useNewsroom = useNewsroom;
|
|
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,6DAA0D;AAE1D,SAAgB,WAAW;IACvB,MAAM,OAAO,GAAG,IAAA,uCAAkB,GAAE,CAAC;IAErC,OAAO,OAAO,CAAC,QAAQ,CAAC;AAC5B,CAAC;AAJD,kCAIC"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNewsroomContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const context_1 = require("../context");
|
|
6
|
+
function useNewsroomContext() {
|
|
7
|
+
// TS Compiler is having a hard time figuring this type implicitly, so we have to set it explicitly
|
|
8
|
+
// See https://github.com/microsoft/TypeScript/issues/5711#issuecomment-340283439
|
|
9
|
+
const newsroomContext = (0, react_1.useContext)(context_1.NewsroomContext);
|
|
10
|
+
if (!newsroomContext) {
|
|
11
|
+
throw new Error('No `NewsroomContextProvider` found when calling `useNewsroomContext`');
|
|
12
|
+
}
|
|
13
|
+
return newsroomContext;
|
|
14
|
+
}
|
|
15
|
+
exports.useNewsroomContext = useNewsroomContext;
|
|
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,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"}
|
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
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);
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/newsroom-context/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA2F;AAAlF,0GAAA,eAAe,OAAA;AAAE,kHAAA,uBAAuB,OAAA;AACjD,0CAAwB"}
|
package/build/sentry/client.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSentryClientOptions = void 0;
|
|
4
|
+
const common_1 = require("./common");
|
|
5
|
+
function getSentryClientOptions(dsn, themeName) {
|
|
6
|
+
return (0, common_1.getCommonClientOptions)(dsn, themeName);
|
|
7
|
+
}
|
|
8
|
+
exports.getSentryClientOptions = getSentryClientOptions;
|
|
9
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -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
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCommonClientOptions = void 0;
|
|
4
|
+
function getCommonClientOptions(dsn, themeName) {
|
|
5
|
+
return {
|
|
6
|
+
dsn,
|
|
7
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
8
|
+
tracesSampleRate: 0.02,
|
|
9
|
+
// ...
|
|
10
|
+
// Note: if you want to override the automatic release value, do not set a
|
|
11
|
+
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
|
|
12
|
+
// that it will also get attached to your source maps
|
|
13
|
+
ignoreErrors: [
|
|
14
|
+
// This particular error is coming from Microsoft Outlook SafeLink crawler.
|
|
15
|
+
// It doesn't affect the user experience in any way, but produces a lot of unwanted Sentry events.
|
|
16
|
+
// See https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
|
|
17
|
+
'Object Not Found Matching Id',
|
|
18
|
+
// This error is caused by `beacon.min.js` polyfill in Cloudflare Insights. From what we see, it doesn't affect the user experience.
|
|
19
|
+
'Illegal invocation',
|
|
20
|
+
],
|
|
21
|
+
// Attach theme tag to each event
|
|
22
|
+
initialScope: (scope) => {
|
|
23
|
+
scope.setTags({ prezly_theme: themeName });
|
|
24
|
+
return scope;
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
exports.getCommonClientOptions = getCommonClientOptions;
|
|
29
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/sentry/common.ts"],"names":[],"mappings":"AAEA,
|
|
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/index.js
CHANGED
|
@@ -1,2 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSentryServerOptions = exports.getSentryClientOptions = void 0;
|
|
4
|
+
var client_1 = require("./client");
|
|
5
|
+
Object.defineProperty(exports, "getSentryClientOptions", { enumerable: true, get: function () { return client_1.getSentryClientOptions; } });
|
|
6
|
+
var server_1 = require("./server");
|
|
7
|
+
Object.defineProperty(exports, "getSentryServerOptions", { enumerable: true, get: function () { return server_1.getSentryServerOptions; } });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sentry/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sentry/index.ts"],"names":[],"mappings":";;;AAAA,mCAAkD;AAAzC,gHAAA,sBAAsB,OAAA;AAC/B,mCAAkD;AAAzC,gHAAA,sBAAsB,OAAA"}
|