@prezly/theme-kit-nextjs 6.4.1 → 6.4.2

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.
@@ -1,7 +1,8 @@
1
+ import type { Story } from '@prezly/sdk';
1
2
  import type { GetServerSidePropsContext, GetServerSidePropsResult, GetStaticPropsContext, GetStaticPropsResult } from 'next';
2
3
  import type { PropsFunction } from './lib/types';
3
- export declare function getStoryPageServerSideProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps>): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<CustomProps>>;
4
- export declare function getStoryPageStaticProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>): (context: GetStaticPropsContext) => Promise<GetStaticPropsResult<CustomProps>>;
4
+ export declare function getStoryPageServerSideProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps>, formats?: Story.FormatVersion[]): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<CustomProps>>;
5
+ export declare function getStoryPageStaticProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps, GetStaticPropsContext>, formats?: Story.FormatVersion[]): (context: GetStaticPropsContext) => Promise<GetStaticPropsResult<CustomProps>>;
5
6
  export declare function getStoryPageStaticPaths(options?: {
6
7
  pinning?: boolean;
7
8
  }): Promise<{
@@ -7,11 +7,11 @@ const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
7
7
  const getNewsroomStaticProps_1 = require("../getNewsroomStaticProps");
8
8
  const processRequest_1 = require("../processRequest");
9
9
  const processStaticRequest_1 = require("../processStaticRequest");
10
- function getStoryPageServerSideProps(customProps) {
10
+ function getStoryPageServerSideProps(customProps, formats) {
11
11
  return async function getServerSideProps(context) {
12
12
  const api = (0, data_fetching_1.getNextPrezlyApi)(context.req);
13
13
  const { slug } = context.params;
14
- const story = slug ? await api.getStoryBySlug(slug) : null;
14
+ const story = slug ? await api.getStoryBySlug(slug, formats) : null;
15
15
  if (!story) {
16
16
  return { notFound: true };
17
17
  }
@@ -35,11 +35,11 @@ function getStoryPageServerSideProps(customProps) {
35
35
  };
36
36
  }
37
37
  exports.getStoryPageServerSideProps = getStoryPageServerSideProps;
38
- function getStoryPageStaticProps(customProps) {
38
+ function getStoryPageStaticProps(customProps, formats) {
39
39
  return async function getStaticProps(context) {
40
40
  const api = (0, data_fetching_1.getNextPrezlyApi)();
41
41
  const { slug } = context.params;
42
- const story = slug ? await api.getStoryBySlug(slug) : null;
42
+ const story = slug ? await api.getStoryBySlug(slug, formats) : null;
43
43
  if (!story) {
44
44
  return { notFound: true };
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"story.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/story.ts"],"names":[],"mappings":";;;AAOA,uDAAuD;AACvD,qCAAkD;AAClD,8EAA2E;AAC3E,sEAAmE;AACnE,sDAAmD;AACnD,kEAA+D;AAI/D,SAAgB,2BAA2B,CACvC,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAE1C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA2B,CAAC;QACrD,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC3D,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7B;QAED,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAC3B,IAAI,MAAM,IAAI,MAAM,KAAK,2BAA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AO,WAAiE,CACpE,OAAO,EACP,WAAW,CACd;gBACH,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AA7BD,0DA6BC;AAEM,KAAK,UAAU,uBAAuB,CAAC,UAAiC,EAAE;IAC7E,MAAM,GAAG,GAAG,IAAA,gCAAgB,GAAE,CAAC;IAC/B,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,aAAa,CAAC;QACpC,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,KAAK;KACpC,CAAC,CAAC;IAEH,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IAEhE,OAAO;QACH,KAAK;QACL,QAAQ,EAAE,UAAU;KACvB,CAAC;AACN,CAAC;AAZD,0DAYC"}
@@ -1,3 +1,4 @@
1
+ import type { Story } from '@prezly/sdk';
1
2
  import type { GetServerSidePropsContext, GetServerSidePropsResult } from 'next';
2
3
  import type { PropsFunction } from './lib/types';
3
- export declare function getStoryPreviewPageServerSideProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps>): (context: GetServerSidePropsContext) => Promise<GetServerSidePropsResult<CustomProps>>;
4
+ export declare function getStoryPreviewPageServerSideProps<CustomProps extends Record<string, any>>(customProps: CustomProps | PropsFunction<CustomProps>): (context: GetServerSidePropsContext, formats?: Story.FormatVersion[]) => Promise<GetServerSidePropsResult<CustomProps>>;
@@ -5,10 +5,10 @@ const data_fetching_1 = require("../../data-fetching");
5
5
  const getNewsroomServerSideProps_1 = require("../getNewsroomServerSideProps");
6
6
  const processRequest_1 = require("../processRequest");
7
7
  function getStoryPreviewPageServerSideProps(customProps) {
8
- return async function getServerSideProps(context) {
8
+ return async function getServerSideProps(context, formats) {
9
9
  const api = (0, data_fetching_1.getNextPrezlyApi)(context.req);
10
10
  const { uuid } = context.params;
11
- const story = await api.getStory(uuid);
11
+ const story = await api.getStory(uuid, formats);
12
12
  if (!story) {
13
13
  return { notFound: true };
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":";;;AAEA,uDAAuD;AACvD,8EAA2E;AAC3E,sDAAmD;AAInD,SAAgB,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC;QAElC,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA0B,CAAC;QACpD,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7B;QAED,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjF,eAAe,CAAC,oBAAoB,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1D,OAAO,IAAA,+BAAc,EAAC,OAAO,EAAE;YAC3B,GAAG,eAAe;YAClB,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAA0C,CAAC,OAAO,EAAE,eAAe,CAAC;gBAC7E,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAxBD,gFAwBC"}
1
+ {"version":3,"file":"storyPreview.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/page-props/storyPreview.ts"],"names":[],"mappings":";;;AAGA,uDAAuD;AACvD,8EAA2E;AAC3E,sDAAmD;AAInD,SAAgB,kCAAkC,CAC9C,WAAqD;IAErD,OAAO,KAAK,UAAU,kBAAkB,CACpC,OAAkC,EAClC,OAA+B;QAE/B,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QAC1C,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,MAA0B,CAAC;QACpD,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAChD,IAAI,CAAC,KAAK,EAAE;YACR,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC7B;QAED,MAAM,EAAE,eAAe,EAAE,GAAG,MAAM,IAAA,uDAA0B,EAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAEjF,eAAe,CAAC,oBAAoB,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1D,OAAO,IAAA,+BAAc,EAAC,OAAO,EAAE;YAC3B,GAAG,eAAe;YAClB,GAAG,CAAC,OAAO,WAAW,KAAK,UAAU;gBACjC,CAAC,CAAC,MAAO,WAA0C,CAAC,OAAO,EAAE,eAAe,CAAC;gBAC7E,CAAC,CAAC,WAAW,CAAC;SACrB,CAAC,CAAC;IACP,CAAC,CAAC;AACN,CAAC;AAzBD,gFAyBC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prezly/theme-kit-nextjs",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "Data layer and utility library for developing Prezly themes with NextJS",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -71,15 +71,15 @@
71
71
  }
72
72
  },
73
73
  "dependencies": {
74
- "@prezly/theme-kit-core": "^6.3.1",
74
+ "@prezly/theme-kit-core": "^6.4.2",
75
75
  "next-seo": "^5.4.0"
76
76
  },
77
77
  "devDependencies": {
78
- "@sentry/nextjs": "7.60.0"
78
+ "@sentry/nextjs": "7.61.1"
79
79
  },
80
80
  "publishConfig": {
81
81
  "access": "public"
82
82
  },
83
83
  "sideEffects": false,
84
- "gitHead": "518de0d648084e84d466b3116246816ea9240483"
84
+ "gitHead": "f89456096a4d9b976391d5b48bb0b920dde6a82a"
85
85
  }