@prezly/theme-kit-nextjs 7.1.0 → 8.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/adapters/app-helper/server.cjs +29 -0
- package/build/adapters/app-helper/server.d.ts +9 -0
- package/build/adapters/app-helper/server.mjs +23 -0
- package/build/adapters/client.cjs +27 -0
- package/build/adapters/client.d.ts +2 -0
- package/build/adapters/client.mjs +3 -0
- package/build/adapters/intl/server.cjs +108 -0
- package/build/adapters/intl/server.d.ts +26 -0
- package/build/adapters/intl/server.mjs +100 -0
- package/build/adapters/metadata/lib/generateCategoryPageMetadata.cjs +52 -0
- package/build/adapters/metadata/lib/generateCategoryPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateCategoryPageMetadata.mjs +46 -0
- package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.cjs +44 -0
- package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateMediaGalleryPageMetadata.mjs +38 -0
- package/build/adapters/metadata/lib/generateMediaPageMetadata.cjs +43 -0
- package/build/adapters/metadata/lib/generateMediaPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateMediaPageMetadata.mjs +37 -0
- package/build/adapters/metadata/lib/generateRootMetadata.cjs +51 -0
- package/build/adapters/metadata/lib/generateRootMetadata.d.ts +10 -0
- package/build/adapters/metadata/lib/generateRootMetadata.mjs +45 -0
- package/build/adapters/metadata/lib/generateSearchPageMetadata.cjs +43 -0
- package/build/adapters/metadata/lib/generateSearchPageMetadata.d.ts +12 -0
- package/build/adapters/metadata/lib/generateSearchPageMetadata.mjs +37 -0
- package/build/adapters/metadata/lib/generateStoryPageMetadata.cjs +100 -0
- package/build/adapters/metadata/lib/generateStoryPageMetadata.d.ts +14 -0
- package/build/adapters/metadata/lib/generateStoryPageMetadata.mjs +94 -0
- package/build/adapters/metadata/lib/index.cjs +66 -0
- package/build/adapters/metadata/lib/index.d.ts +8 -0
- package/build/adapters/metadata/lib/index.mjs +7 -0
- package/build/adapters/metadata/lib/types.cjs +1 -0
- package/build/adapters/metadata/lib/types.d.ts +30 -0
- package/build/adapters/metadata/lib/types.mjs +1 -0
- package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.cjs +11 -0
- package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.d.ts +7 -0
- package/build/adapters/metadata/lib/utils/generateAlternateLanguageLinks.mjs +5 -0
- package/build/adapters/metadata/lib/utils/generatePageMetadata.cjs +75 -0
- package/build/adapters/metadata/lib/utils/generatePageMetadata.d.ts +14 -0
- package/build/adapters/metadata/lib/utils/generatePageMetadata.mjs +70 -0
- package/build/adapters/metadata/lib/utils/index.cjs +26 -0
- package/build/adapters/metadata/lib/utils/index.d.ts +3 -0
- package/build/adapters/metadata/lib/utils/index.mjs +3 -0
- package/build/adapters/metadata/lib/utils/mergePageMetadata.cjs +48 -0
- package/build/adapters/metadata/lib/utils/mergePageMetadata.d.ts +2 -0
- package/build/adapters/metadata/lib/utils/mergePageMetadata.mjs +43 -0
- package/build/adapters/metadata/server.cjs +82 -0
- package/build/adapters/metadata/server.d.ts +34 -0
- package/build/adapters/metadata/server.mjs +74 -0
- package/build/adapters/prezly/cache/configure.cjs +38 -0
- package/build/adapters/prezly/cache/configure.d.ts +15 -0
- package/build/adapters/prezly/cache/configure.mjs +33 -0
- package/build/adapters/prezly/cache/index.cjs +19 -0
- package/build/adapters/prezly/cache/index.d.ts +2 -0
- package/build/adapters/prezly/cache/index.mjs +2 -0
- package/build/adapters/prezly/cache/redis.cjs +60 -0
- package/build/adapters/prezly/cache/redis.d.ts +9 -0
- package/build/adapters/prezly/cache/redis.mjs +55 -0
- package/build/adapters/prezly/server.cjs +55 -0
- package/build/adapters/prezly/server.d.ts +48 -0
- package/build/adapters/prezly/server.mjs +51 -0
- package/build/adapters/routing/client.cjs +10 -0
- package/build/adapters/routing/client.d.ts +1 -0
- package/build/adapters/routing/client.mjs +3 -0
- package/build/adapters/routing/lib/RoutingAdapter.client.cjs +55 -0
- package/build/adapters/routing/lib/RoutingAdapter.client.d.ts +39 -0
- package/build/adapters/routing/lib/RoutingAdapter.client.mjs +48 -0
- package/build/adapters/routing/lib/RoutingAdapter.server.cjs +49 -0
- package/build/adapters/routing/lib/RoutingAdapter.server.d.ts +16 -0
- package/build/adapters/routing/lib/RoutingAdapter.server.mjs +45 -0
- package/build/adapters/routing/server.cjs +29 -0
- package/build/adapters/routing/server.d.ts +2 -0
- package/build/adapters/routing/server.mjs +5 -0
- package/build/adapters/server.cjs +71 -0
- package/build/adapters/server.d.ts +6 -0
- package/build/adapters/server.mjs +7 -0
- package/build/adapters/theme-settings/client.cjs +37 -0
- package/build/adapters/theme-settings/client.d.ts +13 -0
- package/build/adapters/theme-settings/client.mjs +30 -0
- package/build/adapters/theme-settings/server.cjs +34 -0
- package/build/adapters/theme-settings/server.d.ts +10 -0
- package/build/adapters/theme-settings/server.mjs +28 -0
- package/build/index.cjs +49 -0
- package/build/index.d.ts +4 -7
- package/build/index.mjs +4 -0
- package/build/middleware/generate-slugs.d.ts +1 -0
- package/build/middleware/index.cjs +10 -0
- package/build/middleware/index.d.ts +1 -0
- package/build/middleware/index.mjs +2 -0
- package/build/middleware/intl-middleware.cjs +113 -0
- package/build/middleware/intl-middleware.d.ts +87 -0
- package/build/middleware/intl-middleware.mjs +107 -0
- package/build/middleware/slugs.cjs +9 -0
- package/build/middleware/slugs.d.ts +1 -0
- package/build/middleware/slugs.mjs +3 -0
- package/build/next-config/index.cjs +63 -0
- package/build/next-config/index.d.ts +9 -0
- package/build/next-config/index.mjs +57 -0
- package/build/playwright/config.cjs +70 -0
- package/build/playwright/config.d.ts +7 -1
- package/build/playwright/config.mjs +66 -0
- package/build/playwright/index.cjs +12 -0
- package/build/playwright/index.d.ts +1 -1
- package/build/playwright/index.mjs +1 -0
- package/build/robots/server.cjs +54 -0
- package/build/robots/server.d.ts +12 -0
- package/build/robots/server.mjs +48 -0
- package/build/sentry/client.cjs +10 -0
- package/build/sentry/client.d.ts +1 -2
- package/build/sentry/client.mjs +4 -0
- package/build/sentry/common.cjs +72 -0
- package/build/sentry/common.d.ts +1 -1
- package/build/sentry/common.mjs +66 -0
- package/build/sentry/index.cjs +19 -0
- package/build/sentry/index.d.ts +2 -2
- package/build/sentry/index.mjs +2 -0
- package/build/sentry/server.cjs +10 -0
- package/build/sentry/server.d.ts +1 -2
- package/build/sentry/server.mjs +4 -0
- package/build/server.cjs +25 -0
- package/build/server.d.ts +2 -2
- package/build/server.mjs +3 -0
- package/package.json +51 -26
- package/build/adapter-nextjs/api-handlers/fetchGalleries.d.ts +0 -2
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +0 -29
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +0 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.d.ts +0 -2
- package/build/adapter-nextjs/api-handlers/fetchStories.js +0 -34
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +0 -1
- package/build/adapter-nextjs/api-handlers/index.d.ts +0 -2
- package/build/adapter-nextjs/api-handlers/index.js +0 -8
- package/build/adapter-nextjs/api-handlers/index.js.map +0 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.d.ts +0 -16
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +0 -18
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +0 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.d.ts +0 -16
- package/build/adapter-nextjs/getNewsroomStaticProps.js +0 -18
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +0 -1
- package/build/adapter-nextjs/index.d.ts +0 -6
- package/build/adapter-nextjs/index.js +0 -23
- package/build/adapter-nextjs/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/category.d.ts +0 -16
- package/build/adapter-nextjs/page-props/category.js +0 -105
- package/build/adapter-nextjs/page-props/category.js.map +0 -1
- package/build/adapter-nextjs/page-props/gallery.d.ts +0 -14
- package/build/adapter-nextjs/page-props/gallery.js +0 -74
- package/build/adapter-nextjs/page-props/gallery.js.map +0 -1
- package/build/adapter-nextjs/page-props/galleryAlbum.d.ts +0 -9
- package/build/adapter-nextjs/page-props/galleryAlbum.js +0 -56
- package/build/adapter-nextjs/page-props/galleryAlbum.js.map +0 -1
- package/build/adapter-nextjs/page-props/home.d.ts +0 -21
- package/build/adapter-nextjs/page-props/home.js +0 -73
- package/build/adapter-nextjs/page-props/home.js.map +0 -1
- package/build/adapter-nextjs/page-props/index.d.ts +0 -8
- package/build/adapter-nextjs/page-props/index.js +0 -42
- package/build/adapter-nextjs/page-props/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/lib/types.d.ts +0 -3
- package/build/adapter-nextjs/page-props/lib/types.js +0 -3
- package/build/adapter-nextjs/page-props/lib/types.js.map +0 -1
- package/build/adapter-nextjs/page-props/search.d.ts +0 -4
- package/build/adapter-nextjs/page-props/search.js +0 -32
- package/build/adapter-nextjs/page-props/search.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.d.ts +0 -22
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js +0 -139
- package/build/adapter-nextjs/page-props/sitemap/SitemapBuilder.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.d.ts +0 -7
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js +0 -55
- package/build/adapter-nextjs/page-props/sitemap/getServerSideProps.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/index.d.ts +0 -3
- package/build/adapter-nextjs/page-props/sitemap/index.js +0 -23
- package/build/adapter-nextjs/page-props/sitemap/index.js.map +0 -1
- package/build/adapter-nextjs/page-props/sitemap/types.d.ts +0 -9
- package/build/adapter-nextjs/page-props/sitemap/types.js +0 -3
- package/build/adapter-nextjs/page-props/sitemap/types.js.map +0 -1
- package/build/adapter-nextjs/page-props/story.d.ts +0 -13
- package/build/adapter-nextjs/page-props/story.js +0 -78
- package/build/adapter-nextjs/page-props/story.js.map +0 -1
- package/build/adapter-nextjs/page-props/storyPreview.d.ts +0 -4
- package/build/adapter-nextjs/page-props/storyPreview.js +0 -28
- package/build/adapter-nextjs/page-props/storyPreview.js.map +0 -1
- package/build/adapter-nextjs/processRequest.d.ts +0 -12
- package/build/adapter-nextjs/processRequest.js +0 -43
- package/build/adapter-nextjs/processRequest.js.map +0 -1
- package/build/adapter-nextjs/processStaticRequest.d.ts +0 -11
- package/build/adapter-nextjs/processStaticRequest.js +0 -28
- package/build/adapter-nextjs/processStaticRequest.js.map +0 -1
- package/build/components-nextjs/PageSeo/PageSeo.d.ts +0 -16
- package/build/components-nextjs/PageSeo/PageSeo.js +0 -87
- package/build/components-nextjs/PageSeo/PageSeo.js.map +0 -1
- package/build/components-nextjs/PageSeo/index.d.ts +0 -1
- package/build/components-nextjs/PageSeo/index.js +0 -6
- package/build/components-nextjs/PageSeo/index.js.map +0 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.d.ts +0 -1
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js +0 -14
- package/build/components-nextjs/PageSeo/lib/getAbsoluteUrl.js.map +0 -1
- package/build/components-nextjs/PageSeo/lib/index.d.ts +0 -1
- package/build/components-nextjs/PageSeo/lib/index.js +0 -6
- package/build/components-nextjs/PageSeo/lib/index.js.map +0 -1
- package/build/components-nextjs/StorySeo/StorySeo.d.ts +0 -11
- package/build/components-nextjs/StorySeo/StorySeo.js +0 -56
- package/build/components-nextjs/StorySeo/StorySeo.js.map +0 -1
- package/build/components-nextjs/StorySeo/index.d.ts +0 -1
- package/build/components-nextjs/StorySeo/index.js +0 -6
- package/build/components-nextjs/StorySeo/index.js.map +0 -1
- package/build/components-nextjs/document.d.ts +0 -5
- package/build/components-nextjs/document.js +0 -48
- package/build/components-nextjs/document.js.map +0 -1
- package/build/components-nextjs/index.d.ts +0 -3
- package/build/components-nextjs/index.js +0 -10
- package/build/components-nextjs/index.js.map +0 -1
- package/build/config.d.ts +0 -17
- package/build/config.js +0 -78
- package/build/config.js.map +0 -1
- package/build/data-fetching/client.d.ts +0 -10
- package/build/data-fetching/client.js +0 -51
- package/build/data-fetching/client.js.map +0 -1
- package/build/data-fetching/index.d.ts +0 -1
- package/build/data-fetching/index.js +0 -28
- package/build/data-fetching/index.js.map +0 -1
- package/build/index.js +0 -24
- package/build/index.js.map +0 -1
- package/build/infinite-loading/index.d.ts +0 -4
- package/build/infinite-loading/index.js +0 -25
- package/build/infinite-loading/index.js.map +0 -1
- package/build/infinite-loading/lib/index.d.ts +0 -1
- package/build/infinite-loading/lib/index.js +0 -6
- package/build/infinite-loading/lib/index.js.map +0 -1
- package/build/infinite-loading/lib/useAsync.d.ts +0 -44
- package/build/infinite-loading/lib/useAsync.js +0 -70
- package/build/infinite-loading/lib/useAsync.js.map +0 -1
- package/build/infinite-loading/lib/useSyncedRef.d.ts +0 -12
- package/build/infinite-loading/lib/useSyncedRef.js +0 -24
- package/build/infinite-loading/lib/useSyncedRef.js.map +0 -1
- package/build/infinite-loading/types.d.ts +0 -9
- package/build/infinite-loading/types.js +0 -3
- package/build/infinite-loading/types.js.map +0 -1
- package/build/infinite-loading/useInfiniteGalleriesLoading.d.ts +0 -13
- package/build/infinite-loading/useInfiniteGalleriesLoading.js +0 -46
- package/build/infinite-loading/useInfiniteGalleriesLoading.js.map +0 -1
- package/build/infinite-loading/useInfiniteLoading.d.ts +0 -16
- package/build/infinite-loading/useInfiniteLoading.js +0 -44
- package/build/infinite-loading/useInfiniteLoading.js.map +0 -1
- package/build/infinite-loading/useInfiniteStoriesLoading.d.ts +0 -13
- package/build/infinite-loading/useInfiniteStoriesLoading.js +0 -62
- package/build/infinite-loading/useInfiniteStoriesLoading.js.map +0 -1
- package/build/intl/index.d.ts +0 -2
- package/build/intl/index.js +0 -19
- package/build/intl/index.js.map +0 -1
- package/build/intl/languages.d.ts +0 -6
- package/build/intl/languages.js +0 -19
- package/build/intl/languages.js.map +0 -1
- package/build/intl/locale.d.ts +0 -5
- package/build/intl/locale.js +0 -31
- package/build/intl/locale.js.map +0 -1
- package/build/newsroom-context/context.d.ts +0 -62
- package/build/newsroom-context/context.js +0 -29
- package/build/newsroom-context/context.js.map +0 -1
- package/build/newsroom-context/hooks/index.d.ts +0 -11
- package/build/newsroom-context/hooks/index.js +0 -28
- package/build/newsroom-context/hooks/index.js.map +0 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.d.ts +0 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.js +0 -10
- package/build/newsroom-context/hooks/useAlgoliaSettings.js.map +0 -1
- package/build/newsroom-context/hooks/useCategories.d.ts +0 -1
- package/build/newsroom-context/hooks/useCategories.js +0 -10
- package/build/newsroom-context/hooks/useCategories.js.map +0 -1
- package/build/newsroom-context/hooks/useCompanyInformation.d.ts +0 -1
- package/build/newsroom-context/hooks/useCompanyInformation.js +0 -10
- package/build/newsroom-context/hooks/useCompanyInformation.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentCategory.d.ts +0 -1
- package/build/newsroom-context/hooks/useCurrentCategory.js +0 -10
- package/build/newsroom-context/hooks/useCurrentCategory.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentLocale.d.ts +0 -1
- package/build/newsroom-context/hooks/useCurrentLocale.js +0 -10
- package/build/newsroom-context/hooks/useCurrentLocale.js.map +0 -1
- package/build/newsroom-context/hooks/useCurrentStory.d.ts +0 -1
- package/build/newsroom-context/hooks/useCurrentStory.js +0 -10
- package/build/newsroom-context/hooks/useCurrentStory.js.map +0 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.d.ts +0 -2
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +0 -29
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +0 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.d.ts +0 -6
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +0 -65
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +0 -1
- package/build/newsroom-context/hooks/useLanguages.d.ts +0 -1
- package/build/newsroom-context/hooks/useLanguages.js +0 -10
- package/build/newsroom-context/hooks/useLanguages.js.map +0 -1
- package/build/newsroom-context/hooks/useNewsroom.d.ts +0 -1
- package/build/newsroom-context/hooks/useNewsroom.js +0 -10
- package/build/newsroom-context/hooks/useNewsroom.js.map +0 -1
- package/build/newsroom-context/hooks/useNewsroomContext.d.ts +0 -2
- package/build/newsroom-context/hooks/useNewsroomContext.js +0 -16
- package/build/newsroom-context/hooks/useNewsroomContext.js.map +0 -1
- package/build/newsroom-context/index.d.ts +0 -2
- package/build/newsroom-context/index.js +0 -22
- package/build/newsroom-context/index.js.map +0 -1
- package/build/playwright/config.js +0 -67
- package/build/playwright/config.js.map +0 -1
- package/build/playwright/index.js +0 -6
- package/build/playwright/index.js.map +0 -1
- package/build/sentry/client.js +0 -9
- package/build/sentry/client.js.map +0 -1
- package/build/sentry/common.js +0 -66
- package/build/sentry/common.js.map +0 -1
- package/build/sentry/index.js +0 -8
- package/build/sentry/index.js.map +0 -1
- package/build/sentry/server.js +0 -9
- package/build/sentry/server.js.map +0 -1
- package/build/server.js +0 -19
- package/build/server.js.map +0 -1
- package/build/types.d.ts +0 -14
- package/build/types.js +0 -3
- package/build/types.js.map +0 -1
- package/build/utils.d.ts +0 -6
- package/build/utils.js +0 -16
- package/build/utils.js.map +0 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildSentryConfig = buildSentryConfig;
|
|
7
|
+
var IGNORED_EVENT_CULPRITS = [
|
|
8
|
+
// This usually means that something happened outside of application code.
|
|
9
|
+
// All instances of errors with this origin that I found usually were caused by referring to variables that couldn't ever exist in our code.
|
|
10
|
+
// Likely misbehaving browser extensions or people playing around in DevTools trying to break the app.
|
|
11
|
+
'<anonymous>', '?(<anonymous>)', 'global code'];
|
|
12
|
+
function shouldStackFrameBeIgnored(frame) {
|
|
13
|
+
var {
|
|
14
|
+
abs_path,
|
|
15
|
+
function: frameFunction
|
|
16
|
+
} = frame;
|
|
17
|
+
if (abs_path && IGNORED_EVENT_CULPRITS.some(ignoredCulprit => abs_path.includes(ignoredCulprit))) {
|
|
18
|
+
return true;
|
|
19
|
+
}
|
|
20
|
+
if (frameFunction && IGNORED_EVENT_CULPRITS.some(ignoredCulprit => frameFunction.includes(ignoredCulprit))) {
|
|
21
|
+
return true;
|
|
22
|
+
}
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
function shouldExceptionBeIgnored(exception) {
|
|
26
|
+
var _stacktrace$frames;
|
|
27
|
+
var {
|
|
28
|
+
stacktrace
|
|
29
|
+
} = exception;
|
|
30
|
+
|
|
31
|
+
// Ignore global code errors that are not related to the application code.
|
|
32
|
+
// See comments in `IGNORED_EVENT_CULPRITS` const for context on each entry
|
|
33
|
+
if (stacktrace && (_stacktrace$frames = stacktrace.frames) !== null && _stacktrace$frames !== void 0 && _stacktrace$frames.some(shouldStackFrameBeIgnored)) {
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
function buildSentryConfig(dsn, themeName) {
|
|
39
|
+
return {
|
|
40
|
+
dsn,
|
|
41
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
42
|
+
tracesSampleRate: 0.02,
|
|
43
|
+
// ...
|
|
44
|
+
// Note: if you want to override the automatic release value, do not set a
|
|
45
|
+
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
|
|
46
|
+
// that it will also get attached to your source maps
|
|
47
|
+
|
|
48
|
+
ignoreErrors: [
|
|
49
|
+
// This particular error is coming from Microsoft Outlook SafeLink crawler.
|
|
50
|
+
// It doesn't affect the user experience in any way, but produces a lot of unwanted Sentry events.
|
|
51
|
+
// See https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
|
|
52
|
+
'Object Not Found Matching Id',
|
|
53
|
+
// This error is caused by `beacon.min.js` polyfill in Cloudflare Insights. From what we see, it doesn't affect the user experience.
|
|
54
|
+
'Illegal invocation'],
|
|
55
|
+
beforeSend: event => {
|
|
56
|
+
var _event$exception;
|
|
57
|
+
if ((_event$exception = event.exception) !== null && _event$exception !== void 0 && (_event$exception = _event$exception.values) !== null && _event$exception !== void 0 && _event$exception.every(shouldExceptionBeIgnored)) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return event;
|
|
61
|
+
},
|
|
62
|
+
// Attach theme tag to each event
|
|
63
|
+
initialScope: scope => {
|
|
64
|
+
if (themeName) {
|
|
65
|
+
scope.setTags({
|
|
66
|
+
prezly_theme: themeName
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
return scope;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
package/build/sentry/common.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { init } from '@sentry/nextjs';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function buildSentryConfig(dsn: string, themeName: string | null): Parameters<typeof init>[0];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
var IGNORED_EVENT_CULPRITS = [
|
|
2
|
+
// This usually means that something happened outside of application code.
|
|
3
|
+
// All instances of errors with this origin that I found usually were caused by referring to variables that couldn't ever exist in our code.
|
|
4
|
+
// Likely misbehaving browser extensions or people playing around in DevTools trying to break the app.
|
|
5
|
+
'<anonymous>', '?(<anonymous>)', 'global code'];
|
|
6
|
+
function shouldStackFrameBeIgnored(frame) {
|
|
7
|
+
var {
|
|
8
|
+
abs_path,
|
|
9
|
+
function: frameFunction
|
|
10
|
+
} = frame;
|
|
11
|
+
if (abs_path && IGNORED_EVENT_CULPRITS.some(ignoredCulprit => abs_path.includes(ignoredCulprit))) {
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
if (frameFunction && IGNORED_EVENT_CULPRITS.some(ignoredCulprit => frameFunction.includes(ignoredCulprit))) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
function shouldExceptionBeIgnored(exception) {
|
|
20
|
+
var _stacktrace$frames;
|
|
21
|
+
var {
|
|
22
|
+
stacktrace
|
|
23
|
+
} = exception;
|
|
24
|
+
|
|
25
|
+
// Ignore global code errors that are not related to the application code.
|
|
26
|
+
// See comments in `IGNORED_EVENT_CULPRITS` const for context on each entry
|
|
27
|
+
if (stacktrace && (_stacktrace$frames = stacktrace.frames) !== null && _stacktrace$frames !== void 0 && _stacktrace$frames.some(shouldStackFrameBeIgnored)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
export function buildSentryConfig(dsn, themeName) {
|
|
33
|
+
return {
|
|
34
|
+
dsn,
|
|
35
|
+
// Adjust this value in production, or use tracesSampler for greater control
|
|
36
|
+
tracesSampleRate: 0.02,
|
|
37
|
+
// ...
|
|
38
|
+
// Note: if you want to override the automatic release value, do not set a
|
|
39
|
+
// `release` value here - use the environment variable `SENTRY_RELEASE`, so
|
|
40
|
+
// that it will also get attached to your source maps
|
|
41
|
+
|
|
42
|
+
ignoreErrors: [
|
|
43
|
+
// This particular error is coming from Microsoft Outlook SafeLink crawler.
|
|
44
|
+
// It doesn't affect the user experience in any way, but produces a lot of unwanted Sentry events.
|
|
45
|
+
// See https://forum.sentry.io/t/unhandledrejection-non-error-promise-rejection-captured-with-value/14062
|
|
46
|
+
'Object Not Found Matching Id',
|
|
47
|
+
// This error is caused by `beacon.min.js` polyfill in Cloudflare Insights. From what we see, it doesn't affect the user experience.
|
|
48
|
+
'Illegal invocation'],
|
|
49
|
+
beforeSend: event => {
|
|
50
|
+
var _event$exception;
|
|
51
|
+
if ((_event$exception = event.exception) !== null && _event$exception !== void 0 && (_event$exception = _event$exception.values) !== null && _event$exception !== void 0 && _event$exception.every(shouldExceptionBeIgnored)) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return event;
|
|
55
|
+
},
|
|
56
|
+
// Attach theme tag to each event
|
|
57
|
+
initialScope: scope => {
|
|
58
|
+
if (themeName) {
|
|
59
|
+
scope.setTags({
|
|
60
|
+
prezly_theme: themeName
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
return scope;
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "buildSentryClientConfig", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _client.buildSentryClientConfig;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "buildSentryServerConfig", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _server.buildSentryServerConfig;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _client = require("./client.cjs");
|
|
19
|
+
var _server = require("./server.cjs");
|
package/build/sentry/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { buildSentryClientConfig } from './client';
|
|
2
|
+
export { buildSentryServerConfig } from './server';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildSentryServerConfig = buildSentryServerConfig;
|
|
7
|
+
var _common = require("./common.cjs");
|
|
8
|
+
function buildSentryServerConfig(dsn, themeName) {
|
|
9
|
+
return (0, _common.buildSentryConfig)(dsn, themeName);
|
|
10
|
+
}
|
package/build/sentry/server.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export declare function getSentryServerOptions(dsn: string, themeName: string | null): Parameters<typeof init>[0];
|
|
1
|
+
export declare function buildSentryServerConfig(dsn: string, themeName: string | null): import("@sentry/types").Options<import("@sentry/types").BaseTransportOptions> | import("@sentry/browser").BrowserOptions | import("@sentry/node").NodeOptions | import("@sentry/vercel-edge").VercelEdgeOptions;
|
package/build/server.cjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _exportNames = {
|
|
7
|
+
Robots: true
|
|
8
|
+
};
|
|
9
|
+
exports.Robots = void 0;
|
|
10
|
+
var _server = require("./adapters/server.cjs");
|
|
11
|
+
Object.keys(_server).forEach(function (key) {
|
|
12
|
+
if (key === "default" || key === "__esModule") return;
|
|
13
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
14
|
+
if (key in exports && exports[key] === _server[key]) return;
|
|
15
|
+
Object.defineProperty(exports, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function get() {
|
|
18
|
+
return _server[key];
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
var _Robots = _interopRequireWildcard(require("./robots/server.cjs"));
|
|
23
|
+
exports.Robots = _Robots;
|
|
24
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
25
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
package/build/server.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './adapters/server';
|
|
2
|
+
export * as Robots from './robots/server';
|
package/build/server.mjs
ADDED
package/package.json
CHANGED
|
@@ -1,30 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/theme-kit-nextjs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "Data layer and utility library for developing Prezly themes with NextJS",
|
|
5
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "build/index.mjs",
|
|
6
7
|
"types": "build/index.d.ts",
|
|
7
8
|
"files": [
|
|
8
9
|
"build",
|
|
9
10
|
"README.md"
|
|
10
11
|
],
|
|
11
12
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./build/index.d.ts",
|
|
15
|
+
"require": "./build/index.cjs",
|
|
16
|
+
"default": "./build/index.mjs"
|
|
17
|
+
},
|
|
18
|
+
"./server": {
|
|
19
|
+
"types": "./build/server.d.ts",
|
|
20
|
+
"require": "./build/server.cjs",
|
|
21
|
+
"default": "./build/server.mjs"
|
|
22
|
+
},
|
|
23
|
+
"./middleware": {
|
|
24
|
+
"types": "./build/middleware/index.d.ts",
|
|
25
|
+
"require": "./build/middleware/index.cjs",
|
|
26
|
+
"default": "./build/middleware/index.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./next-config": {
|
|
29
|
+
"types": "./build/next-config/index.d.ts",
|
|
30
|
+
"require": "./build/next-config/index.cjs",
|
|
31
|
+
"default": "./build/next-config/index.mjs"
|
|
32
|
+
},
|
|
33
|
+
"./sentry": {
|
|
34
|
+
"types": "./build/sentry/index.d.ts",
|
|
35
|
+
"require": "./build/sentry/index.cjs",
|
|
36
|
+
"default": "./build/sentry/index.mjs"
|
|
37
|
+
},
|
|
38
|
+
"./playwright": {
|
|
39
|
+
"types": "./build/playwright/index.d.ts",
|
|
40
|
+
"require": "./build/playwright/index.cjs",
|
|
41
|
+
"default": "./build/playwright/index.mjs"
|
|
28
42
|
}
|
|
29
43
|
},
|
|
30
44
|
"engines": {
|
|
@@ -52,15 +66,22 @@
|
|
|
52
66
|
"homepage": "https://github.com/prezly/theme-kit-js/tree/main/packages/nextjs#readme",
|
|
53
67
|
"scripts": {
|
|
54
68
|
"prebuild": "rimraf build/* *.tsbuildinfo",
|
|
55
|
-
"build": "
|
|
69
|
+
"build": "npm run build:types && npm run build:esm && npm run build:cjs",
|
|
70
|
+
"build:types": "tsc --project .",
|
|
71
|
+
"build:esm": "babel --config-file=../../babel.esm.json src/ --extensions=.ts,.tsx --out-dir=build/ --out-file-extension=.mjs",
|
|
72
|
+
"build:cjs": "babel --config-file=../../babel.cjs.json src/ --extensions=.ts,.tsx --out-dir=build/ --out-file-extension=.cjs",
|
|
56
73
|
"dev": "tsc --watch --preserveWatchOutput --project .",
|
|
57
|
-
"typecheck": "tsc --noEmit --incremental --project .",
|
|
74
|
+
"typecheck": "tsc --noEmit --emitDeclarationOnly false --incremental --project .",
|
|
58
75
|
"lint": "eslint src",
|
|
59
|
-
"test": "
|
|
76
|
+
"test": "npm run test:build",
|
|
77
|
+
"test:build": "npm run test:build:cjs && npm run test:build:esm && npm run test:build:types",
|
|
78
|
+
"test:build:types": "tsc --esModuleInterop --noEmit build/index.d.ts",
|
|
79
|
+
"test:build:esm": "node tests/test-build.mjs",
|
|
80
|
+
"test:build:cjs": "node tests/test-build.cjs"
|
|
60
81
|
},
|
|
61
82
|
"peerDependencies": {
|
|
62
83
|
"@playwright/test": "1.x",
|
|
63
|
-
"@prezly/sdk": "
|
|
84
|
+
"@prezly/sdk": "18.3.0",
|
|
64
85
|
"next": "^12.x || ^13.x || ^14.x",
|
|
65
86
|
"react": "^17.x || ^18.x",
|
|
66
87
|
"react-dom": "^17.x || ^18.x"
|
|
@@ -71,16 +92,20 @@
|
|
|
71
92
|
}
|
|
72
93
|
},
|
|
73
94
|
"dependencies": {
|
|
74
|
-
"@prezly/theme-kit-core": "^
|
|
95
|
+
"@prezly/theme-kit-core": "^8.0.1",
|
|
96
|
+
"@prezly/theme-kit-intl": "^8.0.0",
|
|
97
|
+
"@prezly/theme-kit-react": "^8.0.0",
|
|
98
|
+
"@technically/is-not-undefined": "^1.0.0",
|
|
75
99
|
"@technically/omit-undefined": "^1.0.2",
|
|
76
|
-
"
|
|
100
|
+
"redis": "^4.6.12",
|
|
101
|
+
"url-pattern": "^1.0.3"
|
|
77
102
|
},
|
|
78
103
|
"devDependencies": {
|
|
79
|
-
"@sentry/nextjs": "7.
|
|
104
|
+
"@sentry/nextjs": "7.93.0"
|
|
80
105
|
},
|
|
81
106
|
"publishConfig": {
|
|
82
107
|
"access": "public"
|
|
83
108
|
},
|
|
84
109
|
"sideEffects": false,
|
|
85
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "3068afdd286035a4d0cf106ca25070114a779b25"
|
|
86
111
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchGalleries = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const data_fetching_1 = require("../../data-fetching");
|
|
6
|
-
async function fetchGalleries(req, res) {
|
|
7
|
-
(0, theme_kit_core_1.assertServerEnv)('fetchGalleries');
|
|
8
|
-
if (req.method !== 'POST') {
|
|
9
|
-
res.status(405);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const { page, pageSize, type } = req.body;
|
|
13
|
-
try {
|
|
14
|
-
const api = data_fetching_1.NextContentDelivery.initClient(req);
|
|
15
|
-
const { galleries, pagination } = await api.galleries({
|
|
16
|
-
type,
|
|
17
|
-
limit: pageSize,
|
|
18
|
-
offset: (page - 1) * pageSize,
|
|
19
|
-
});
|
|
20
|
-
res.status(200).json({ galleries, galleriesTotal: pagination.matched_records_number });
|
|
21
|
-
}
|
|
22
|
-
catch (error) {
|
|
23
|
-
res.status(500).send({
|
|
24
|
-
message: error.message,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.fetchGalleries = fetchGalleries;
|
|
29
|
-
//# sourceMappingURL=fetchGalleries.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchGalleries.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/api-handlers/fetchGalleries.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAGzD,uDAA0D;AAEnD,KAAK,UAAU,cAAc,CAAC,GAAmB,EAAE,GAAoB;IAC1E,IAAA,gCAAe,EAAC,gBAAgB,CAAC,CAAC;IAElC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACxB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO;IACX,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;IAE1C,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,mCAAmB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAEhD,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,SAAS,CAAC;YAClD,IAAI;YACJ,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ;SAChC,CAAC,CAAC;QAEH,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC;IAC3F,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACjB,OAAO,EAAG,KAAe,CAAC,OAAO;SACpC,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AAzBD,wCAyBC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchStories = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const data_fetching_1 = require("../../data-fetching");
|
|
6
|
-
async function fetchStories(req, res) {
|
|
7
|
-
(0, theme_kit_core_1.assertServerEnv)('fetchStories');
|
|
8
|
-
if (req.method !== 'POST') {
|
|
9
|
-
res.status(405);
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
const { page, pageSize, withHighlightedStory, category, include, formats, localeCode, filterQuery, } = req.body;
|
|
13
|
-
try {
|
|
14
|
-
const api = data_fetching_1.NextContentDelivery.initClient(req, { formats });
|
|
15
|
-
const { stories, pagination } = await api.stories({
|
|
16
|
-
category,
|
|
17
|
-
offset: (page - 1) * pageSize,
|
|
18
|
-
limit: pageSize,
|
|
19
|
-
locale: localeCode,
|
|
20
|
-
highlighted: withHighlightedStory ? 1 : 0,
|
|
21
|
-
query: filterQuery,
|
|
22
|
-
}, {
|
|
23
|
-
include,
|
|
24
|
-
});
|
|
25
|
-
res.status(200).json({ stories, storiesTotal: pagination.matched_records_number });
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
res.status(500).send({
|
|
29
|
-
message: error.message,
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.fetchStories = fetchStories;
|
|
34
|
-
//# sourceMappingURL=fetchStories.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetchStories.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/api-handlers/fetchStories.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAGzD,uDAA0D;AAEnD,KAAK,UAAU,YAAY,CAAC,GAAmB,EAAE,GAAoB;IACxE,IAAA,gCAAe,EAAC,cAAc,CAAC,CAAC;IAEhC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE,CAAC;QACxB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO;IACX,CAAC;IAED,MAAM,EACF,IAAI,EACJ,QAAQ,EACR,oBAAoB,EACpB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,WAAW,GACd,GAAG,GAAG,CAAC,IAAI,CAAC;IAEb,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,mCAAmB,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QAE7D,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,MAAM,GAAG,CAAC,OAAO,CAC7C;YACI,QAAQ;YACR,MAAM,EAAE,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ;YAC7B,KAAK,EAAE,QAAQ;YACf,MAAM,EAAE,UAAU;YAClB,WAAW,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,KAAK,EAAE,WAAW;SACrB,EACD;YACI,OAAO;SACV,CACJ,CAAC;QAEF,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACvF,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACjB,OAAO,EAAG,KAAe,CAAC,OAAO;SACpC,CAAC,CAAC;IACP,CAAC;AACL,CAAC;AA1CD,oCA0CC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchStories = exports.fetchGalleries = void 0;
|
|
4
|
-
var fetchGalleries_1 = require("./fetchGalleries");
|
|
5
|
-
Object.defineProperty(exports, "fetchGalleries", { enumerable: true, get: function () { return fetchGalleries_1.fetchGalleries; } });
|
|
6
|
-
var fetchStories_1 = require("./fetchStories");
|
|
7
|
-
Object.defineProperty(exports, "fetchStories", { enumerable: true, get: function () { return fetchStories_1.fetchStories; } });
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/api-handlers/index.ts"],"names":[],"mappings":";;;AAAA,mDAAkD;AAAzC,gHAAA,cAAc,OAAA;AACvB,+CAA8C;AAArC,4GAAA,YAAY,OAAA"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Story } from '@prezly/sdk';
|
|
2
|
-
import type { GetServerSidePropsContext } from 'next';
|
|
3
|
-
import { NextContentDelivery } from '../data-fetching';
|
|
4
|
-
interface Options {
|
|
5
|
-
loadHomepageContacts?: boolean;
|
|
6
|
-
story?: Pick<Story, 'culture'>;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Use this function in your `getServerSideProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
10
|
-
* See README for usage examples.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getNewsroomServerSideProps(context: GetServerSidePropsContext, options?: Options): Promise<{
|
|
13
|
-
api: NextContentDelivery.Client;
|
|
14
|
-
serverSideProps: import("..").PageProps & import("..").ServerSidePageProps;
|
|
15
|
-
}>;
|
|
16
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNewsroomServerSideProps = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const data_fetching_1 = require("../data-fetching");
|
|
6
|
-
/**
|
|
7
|
-
* Use this function in your `getServerSideProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
8
|
-
* See README for usage examples.
|
|
9
|
-
*/
|
|
10
|
-
async function getNewsroomServerSideProps(context, options = {}) {
|
|
11
|
-
(0, theme_kit_core_1.assertServerEnv)('getNewsroomServerSideProps');
|
|
12
|
-
const { req: request, locale } = context;
|
|
13
|
-
const api = data_fetching_1.NextContentDelivery.initClient(request);
|
|
14
|
-
const serverSideProps = await api.getNewsroomServerSideProps(locale, options.story, options.loadHomepageContacts);
|
|
15
|
-
return { api, serverSideProps };
|
|
16
|
-
}
|
|
17
|
-
exports.getNewsroomServerSideProps = getNewsroomServerSideProps;
|
|
18
|
-
//# sourceMappingURL=getNewsroomServerSideProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNewsroomServerSideProps.js","sourceRoot":"","sources":["../../src/adapter-nextjs/getNewsroomServerSideProps.ts"],"names":[],"mappings":";;;AACA,2DAAyD;AAGzD,oDAAuD;AAOvD;;;GAGG;AACI,KAAK,UAAU,0BAA0B,CAC5C,OAAkC,EAClC,UAAmB,EAAE;IAErB,IAAA,gCAAe,EAAC,4BAA4B,CAAC,CAAC;IAC9C,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAEzC,MAAM,GAAG,GAAG,mCAAmB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAEpD,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,0BAA0B,CACxD,MAAM,EACN,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,oBAAoB,CAC/B,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC;AACpC,CAAC;AAhBD,gEAgBC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Story } from '@prezly/sdk';
|
|
2
|
-
import type { GetStaticPropsContext } from 'next';
|
|
3
|
-
import { NextContentDelivery } from '../data-fetching';
|
|
4
|
-
interface Options {
|
|
5
|
-
loadHomepageContacts?: boolean;
|
|
6
|
-
story?: Pick<Story, 'culture'>;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Use this function in your `getNewsroomStaticProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
10
|
-
* See README for usage examples.
|
|
11
|
-
*/
|
|
12
|
-
export declare function getNewsroomStaticProps(context: GetStaticPropsContext, options?: Options): Promise<{
|
|
13
|
-
api: NextContentDelivery.Client;
|
|
14
|
-
staticProps: import("..").PageProps & import("..").ServerSidePageProps;
|
|
15
|
-
}>;
|
|
16
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getNewsroomStaticProps = void 0;
|
|
4
|
-
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
-
const data_fetching_1 = require("../data-fetching");
|
|
6
|
-
/**
|
|
7
|
-
* Use this function in your `getNewsroomStaticProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
8
|
-
* See README for usage examples.
|
|
9
|
-
*/
|
|
10
|
-
async function getNewsroomStaticProps(context, options = {}) {
|
|
11
|
-
(0, theme_kit_core_1.assertServerEnv)('getNewsroomStaticProps');
|
|
12
|
-
const { locale } = context;
|
|
13
|
-
const api = data_fetching_1.NextContentDelivery.initClient();
|
|
14
|
-
const staticProps = await api.getNewsroomServerSideProps(locale, options.story, options.loadHomepageContacts);
|
|
15
|
-
return { api, staticProps };
|
|
16
|
-
}
|
|
17
|
-
exports.getNewsroomStaticProps = getNewsroomStaticProps;
|
|
18
|
-
//# sourceMappingURL=getNewsroomStaticProps.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getNewsroomStaticProps.js","sourceRoot":"","sources":["../../src/adapter-nextjs/getNewsroomStaticProps.ts"],"names":[],"mappings":";;;AACA,2DAAyD;AAGzD,oDAAuD;AAOvD;;;GAGG;AACI,KAAK,UAAU,sBAAsB,CACxC,OAA8B,EAC9B,UAAmB,EAAE;IAErB,IAAA,gCAAe,EAAC,wBAAwB,CAAC,CAAC;IAC1C,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE3B,MAAM,GAAG,GAAG,mCAAmB,CAAC,UAAU,EAAE,CAAC;IAC7C,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,0BAA0B,CACpD,MAAM,EACN,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,oBAAoB,CAC/B,CAAC;IAEF,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC;AAfD,wDAeC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
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("./api-handlers"), exports);
|
|
18
|
-
__exportStar(require("./getNewsroomServerSideProps"), exports);
|
|
19
|
-
__exportStar(require("./getNewsroomStaticProps"), exports);
|
|
20
|
-
__exportStar(require("./page-props"), exports);
|
|
21
|
-
__exportStar(require("./processRequest"), exports);
|
|
22
|
-
__exportStar(require("./processStaticRequest"), exports);
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/adapter-nextjs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,+DAA6C;AAC7C,2DAAyC;AACzC,+CAA6B;AAC7B,mDAAiC;AACjC,yDAAuC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Story } from '@prezly/sdk';
|
|
2
|
-
import type { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPathsResult, GetStaticPropsContext, GetStaticPropsResult } from 'next';
|
|
3
|
-
import type { PaginationProps } from '../../infinite-loading/types';
|
|
4
|
-
import type { PropsFunction } from './lib/types';
|
|
5
|
-
export interface CategoryPageProps<Include extends keyof Story.ExtraFields = never> {
|
|
6
|
-
stories: (Story & Pick<Story.ExtraFields, Include>)[];
|
|
7
|
-
pagination: PaginationProps;
|
|
8
|
-
}
|
|
9
|
-
interface Options<Include extends keyof Story.ExtraFields> {
|
|
10
|
-
extraStoryFields?: Include[];
|
|
11
|
-
pageSize?: number;
|
|
12
|
-
}
|
|
13
|
-
export declare function getCategoryPageServerSideProps<CustomProps extends Record<string, any>, Include extends keyof Story.ExtraFields = never>(customProps: CustomProps | PropsFunction<CustomProps>, options?: Options<Include>): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<CategoryPageProps<Include> & CustomProps>>;
|
|
14
|
-
export declare function getCategoryPageStaticProps<CustomProps extends Record<string, any>, Include extends keyof Story.ExtraFields = never>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>, options?: Options<Include>): (context: GetStaticPropsContext) => Promise<GetStaticPropsResult<CategoryPageProps<Include> & CustomProps>>;
|
|
15
|
-
export declare function getCategoryPageStaticPaths(): Promise<GetStaticPathsResult>;
|
|
16
|
-
export {};
|