@prezly/theme-kit-nextjs 5.0.0-alpha.1 → 5.0.0-alpha.11
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 +8 -7
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js +2 -0
- package/build/adapter-nextjs/api-handlers/fetchGalleries.js.map +1 -1
- package/build/adapter-nextjs/api-handlers/fetchStories.js +2 -0
- package/build/adapter-nextjs/api-handlers/fetchStories.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +2 -0
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/getNewsroomStaticProps.js +2 -0
- package/build/adapter-nextjs/getNewsroomStaticProps.js.map +1 -1
- package/build/adapter-nextjs/processRequest.js +1 -0
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/adapter-nextjs/processStaticRequest.js +2 -0
- package/build/adapter-nextjs/processStaticRequest.js.map +1 -1
- package/build/components-nextjs/StorySeo/StorySeo.js +2 -3
- package/build/components-nextjs/StorySeo/StorySeo.js.map +1 -1
- package/build/data-fetching/NextPrezlyApi.d.ts +1 -1
- package/build/data-fetching/NextPrezlyApi.js +3 -3
- package/build/data-fetching/NextPrezlyApi.js.map +1 -1
- package/build/data-fetching/getNextPrezlyApi.js +3 -4
- package/build/data-fetching/getNextPrezlyApi.js.map +1 -1
- package/build/index.d.ts +0 -2
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/infinite-loading/lib/index.d.ts +1 -0
- package/build/infinite-loading/lib/index.js +6 -0
- package/build/infinite-loading/lib/index.js.map +1 -0
- package/build/infinite-loading/lib/useAsync.d.ts +44 -0
- package/build/infinite-loading/lib/useAsync.js +70 -0
- package/build/infinite-loading/lib/useAsync.js.map +1 -0
- package/build/infinite-loading/lib/useSyncedRef.d.ts +12 -0
- package/build/infinite-loading/lib/useSyncedRef.js +24 -0
- package/build/infinite-loading/lib/useSyncedRef.js.map +1 -0
- package/build/infinite-loading/useInfiniteLoading.js +2 -2
- package/build/infinite-loading/useInfiniteLoading.js.map +1 -1
- package/build/newsroom-context/context.d.ts +1 -1
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/useAlgoliaSettings.d.ts +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +9 -19
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/server.d.ts +2 -0
- package/build/server.js +19 -0
- package/build/server.js.map +1 -0
- package/package.json +16 -6
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ If you want to support multi-language in your theme, you'll need to make additio
|
|
|
73
73
|
|
|
74
74
|
```js
|
|
75
75
|
const { DUMMY_DEFAULT_LOCALE } = require('@prezly/theme-kit-nextjs');
|
|
76
|
-
const locales = require('@prezly/theme-kit-nextjs/
|
|
76
|
+
const locales = require('@prezly/theme-kit-nextjs/localeConfig');
|
|
77
77
|
|
|
78
78
|
module.exports = {
|
|
79
79
|
/* ...your next config... */
|
|
@@ -128,9 +128,10 @@ export default App;
|
|
|
128
128
|
### Page files (Server-side rendering)
|
|
129
129
|
|
|
130
130
|
Every page requires a bit of boilerplate code to set up.
|
|
131
|
+
Note that server-side code should be imported from `@prezly/theme-kit-nextjs/server`. That prevents the server code and dependencies from leaking into the client bundle.
|
|
131
132
|
|
|
132
133
|
```tsx
|
|
133
|
-
import { getNewsroomServerSideProps, processRequest } from '@prezly/theme-kit-nextjs';
|
|
134
|
+
import { getNewsroomServerSideProps, processRequest } from '@prezly/theme-kit-nextjs/server';
|
|
134
135
|
import type { GetServerSideProps } from 'next';
|
|
135
136
|
import type { FunctionComponent } from 'react';
|
|
136
137
|
|
|
@@ -190,7 +191,7 @@ To reduce boilerplate for common scenarios, the library provides a collection of
|
|
|
190
191
|
|
|
191
192
|
Here's an example of `getServerSideProps` function with no custom props:
|
|
192
193
|
```ts
|
|
193
|
-
import { getHomepageServerSideProps } from '@prezly/theme-kit-nextjs';
|
|
194
|
+
import { getHomepageServerSideProps } from '@prezly/theme-kit-nextjs/server';
|
|
194
195
|
|
|
195
196
|
/* ...your page component */
|
|
196
197
|
|
|
@@ -238,7 +239,7 @@ This kit can also help you with building your Sitemap automatically. Here's what
|
|
|
238
239
|
1. Create a sitemap page file: `/pages/sitemap.xml.ts`
|
|
239
240
|
2. Use this code to display the default Sitemap built with your Newsroom stories:
|
|
240
241
|
```ts
|
|
241
|
-
import { getSitemapServerSideProps } from '@prezly/theme-kit-nextjs';
|
|
242
|
+
import { getSitemapServerSideProps } from '@prezly/theme-kit-nextjs/server';
|
|
242
243
|
import type { NextPage } from 'next';
|
|
243
244
|
|
|
244
245
|
const Sitemap: NextPage = () => null;
|
|
@@ -267,7 +268,7 @@ For self-hosted applications, we now provide an option to use SSG in your projec
|
|
|
267
268
|
|
|
268
269
|
The workflow is pretty much the same as with our default SSR approach. You will need to use the new `getNewsroomStaticProps` and `processStaticRequest` methods. Note that `getNewsroomStaticProps` returns its props in the `staticProps` property. The data is still the same as in the SSR methods, so apart from multi-language, this should be a drop-in replacement for your pages.
|
|
269
270
|
```tsx
|
|
270
|
-
import { getNewsroomStaticProps, processStaticRequest } from '@prezly/theme-kit-nextjs';
|
|
271
|
+
import { getNewsroomStaticProps, processStaticRequest } from '@prezly/theme-kit-nextjs/server';
|
|
271
272
|
import type { GetStaticProps } from 'next';
|
|
272
273
|
|
|
273
274
|
/* Your Page component code */
|
|
@@ -289,7 +290,7 @@ export const getStaticProps: GetServerSideProps<Props> = async (context) => {
|
|
|
289
290
|
|
|
290
291
|
We also have added all of the page helpers (except Story Preview) for SSG prop fetching. Here's an example for the Home page:
|
|
291
292
|
```ts
|
|
292
|
-
import { getHomepageStaticProps } from '@prezly/theme-kit-nextjs';
|
|
293
|
+
import { getHomepageStaticProps } from '@prezly/theme-kit-nextjs/server';
|
|
293
294
|
|
|
294
295
|
/* ...your page component */
|
|
295
296
|
|
|
@@ -299,7 +300,7 @@ export const getStaticProps = getHomepageStaticProps({});
|
|
|
299
300
|
|
|
300
301
|
For dynamic pages, like `/story/[slug]`, we also provide `getStaticPaths` helper functions:
|
|
301
302
|
```tsx
|
|
302
|
-
import { getStoryPageStaticPaths, getStoryPageStaticProps } from '@prezly/theme-kit-nextjs';
|
|
303
|
+
import { getStoryPageStaticPaths, getStoryPageStaticProps } from '@prezly/theme-kit-nextjs/server';
|
|
303
304
|
|
|
304
305
|
/* Your Page component code */
|
|
305
306
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchGalleries = void 0;
|
|
4
|
+
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
4
5
|
const data_fetching_1 = require("../../data-fetching");
|
|
5
6
|
async function fetchGalleries(req, res) {
|
|
7
|
+
(0, theme_kit_core_1.assertServerEnv)('fetchGalleries');
|
|
6
8
|
if (req.method !== 'POST') {
|
|
7
9
|
res.status(405);
|
|
8
10
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchGalleries.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/api-handlers/fetchGalleries.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fetchGalleries.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/api-handlers/fetchGalleries.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAGzD,uDAAuD;AAEhD,KAAK,UAAU,cAAc,CAAC,GAAmB,EAAE,GAAoB;IAC1E,IAAA,gCAAe,EAAC,gBAAgB,CAAC,CAAC;IAElC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE;QACvB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO;KACV;IAED,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;IAEpC,IAAI;QACA,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,GAAG,CAAC,CAAC;QAElC,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;QAEjE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC;KACvC;IAAC,OAAO,KAAK,EAAE;QACZ,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACjB,OAAO,EAAG,KAAe,CAAC,OAAO;SACpC,CAAC,CAAC;KACN;AACL,CAAC;AArBD,wCAqBC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.fetchStories = void 0;
|
|
4
|
+
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
4
5
|
const data_fetching_1 = require("../../data-fetching");
|
|
5
6
|
async function fetchStories(req, res) {
|
|
7
|
+
(0, theme_kit_core_1.assertServerEnv)('fetchStories');
|
|
6
8
|
if (req.method !== 'POST') {
|
|
7
9
|
res.status(405);
|
|
8
10
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchStories.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/api-handlers/fetchStories.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"fetchStories.js","sourceRoot":"","sources":["../../../src/adapter-nextjs/api-handlers/fetchStories.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAGzD,uDAAuD;AAEhD,KAAK,UAAU,YAAY,CAAC,GAAmB,EAAE,GAAoB;IACxE,IAAA,gCAAe,EAAC,cAAc,CAAC,CAAC;IAEhC,IAAI,GAAG,CAAC,MAAM,KAAK,MAAM,EAAE;QACvB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChB,OAAO;KACV;IAED,MAAM,EACF,IAAI,EACJ,QAAQ,EACR,oBAAoB,EACpB,QAAQ,EACR,OAAO,EACP,UAAU,EACV,OAAO,EACP,WAAW,GACd,GAAG,GAAG,CAAC,IAAI,CAAC;IAEb,IAAI;QACA,MAAM,GAAG,GAAG,IAAA,gCAAgB,EAAC,GAAG,CAAC,CAAC;QAElC,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC,QAAQ;YAC/B,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;YAC/E,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;gBACX,IAAI;gBACJ,QAAQ;gBACR,OAAO;gBACP,UAAU;gBACV,oBAAoB;gBACpB,OAAO;gBACP,WAAW;aACd,CAAC,CAAC,CAAC;QAEV,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;KACrC;IAAC,OAAO,KAAK,EAAE;QACZ,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACjB,OAAO,EAAG,KAAe,CAAC,OAAO;SACpC,CAAC,CAAC;KACN;AACL,CAAC;AAxCD,oCAwCC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNewsroomServerSideProps = void 0;
|
|
4
|
+
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
4
5
|
const data_fetching_1 = require("../data-fetching");
|
|
5
6
|
/**
|
|
6
7
|
* Use this function in your `getServerSideProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
7
8
|
* See README for usage examples.
|
|
8
9
|
*/
|
|
9
10
|
async function getNewsroomServerSideProps(context, options = {}) {
|
|
11
|
+
(0, theme_kit_core_1.assertServerEnv)('getNewsroomServerSideProps');
|
|
10
12
|
const { req: request, locale } = context;
|
|
11
13
|
const api = (0, data_fetching_1.getNextPrezlyApi)(request);
|
|
12
14
|
const serverSideProps = await api.getNewsroomServerSideProps(request, locale, options.story);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNewsroomServerSideProps.js","sourceRoot":"","sources":["../../src/adapter-nextjs/getNewsroomServerSideProps.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getNewsroomServerSideProps.js","sourceRoot":"","sources":["../../src/adapter-nextjs/getNewsroomServerSideProps.ts"],"names":[],"mappings":";;;AACA,2DAAyD;AAGzD,oDAAoD;AAOpD;;;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,IAAA,gCAAgB,EAAC,OAAO,CAAC,CAAC;IACtC,MAAM,eAAe,GAAG,MAAM,GAAG,CAAC,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAE7F,IAAI,OAAO,CAAC,oBAAoB,EAAE;QAC9B,eAAe,CAAC,oBAAoB,CAAC,QAAQ,GAAG,MAAM,GAAG,CAAC,mBAAmB,EAAE,CAAC;KACnF;IAED,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC;AACpC,CAAC;AAfD,gEAeC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNewsroomStaticProps = void 0;
|
|
4
|
+
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
4
5
|
const data_fetching_1 = require("../data-fetching");
|
|
5
6
|
/**
|
|
6
7
|
* Use this function in your `getNewsroomStaticProps` page methods to retrieve the data necessary for the NewsroomContextProvider and `processRequest` function.
|
|
7
8
|
* See README for usage examples.
|
|
8
9
|
*/
|
|
9
10
|
async function getNewsroomStaticProps(context, options = {}) {
|
|
11
|
+
(0, theme_kit_core_1.assertServerEnv)('getNewsroomStaticProps');
|
|
10
12
|
const { locale } = context;
|
|
11
13
|
const api = (0, data_fetching_1.getNextPrezlyApi)();
|
|
12
14
|
const staticProps = await api.getNewsroomServerSideProps(undefined, locale, options.story);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNewsroomStaticProps.js","sourceRoot":"","sources":["../../src/adapter-nextjs/getNewsroomStaticProps.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"getNewsroomStaticProps.js","sourceRoot":"","sources":["../../src/adapter-nextjs/getNewsroomStaticProps.ts"],"names":[],"mappings":";;;AACA,2DAAyD;AAGzD,oDAAoD;AAOpD;;;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,IAAA,gCAAgB,GAAE,CAAC;IAC/B,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,0BAA0B,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3F,IAAI,OAAO,CAAC,oBAAoB,EAAE;QAC9B,WAAW,CAAC,oBAAoB,CAAC,QAAQ,GAAG,MAAM,GAAG,CAAC,mBAAmB,EAAE,CAAC;KAC/E;IAED,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC;AAfD,wDAeC"}
|
|
@@ -13,6 +13,7 @@ const intl_1 = require("../intl");
|
|
|
13
13
|
* @param canonicalUrl Optional: a canonical URL for the current page without locale part. If provided, locale redirects will be handled by the function.
|
|
14
14
|
*/
|
|
15
15
|
function processRequest(context, props, canonicalUrl) {
|
|
16
|
+
(0, theme_kit_core_1.assertServerEnv)('processRequest');
|
|
16
17
|
const { locale: nextLocale, query } = context;
|
|
17
18
|
const { localeResolved, ...pageProps } = props;
|
|
18
19
|
// If no locale was provided by Next, it most likely means that the theme is not supporting multi-language.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"processRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processRequest.ts"],"names":[],"mappings":";;;AAAA,2DAA8F;AAG9F,kCAAuD;AAGvD;;;;;;;;GAQG;AACH,SAAgB,cAAc,CAC1B,OAAkC,EAClC,KAA8C,EAC9C,YAAqB;IAErB,IAAA,gCAAe,EAAC,gBAAgB,CAAC,CAAC;IAClC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAE9C,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,2GAA2G;IAC3G,uCAAuC;IACvC,IAAI,CAAC,cAAc,IAAI,UAAU,EAAE;QAC/B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC7B;IAED,IAAI,YAAY,EAAE;QACd,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,SAAS,CAAC,oBAAoB,CAAC;QACjE,MAAM,aAAa,GAAG,6BAAY,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC3D,MAAM,kBAAkB,GAAG,IAAA,sCAAqB,EAAC,SAAS,EAAE,aAAa,CAAC,CAAC;QAE3E,MAAM,QAAQ,GAAG,IAAA,mCAA4B,EACzC,kBAAkB,EAClB,UAAU,EACV,YAAY,EACZ,KAAK,CACR,CAAC;QACF,IAAI,QAAQ,EAAE;YACV,OAAO,EAAE,QAAQ,EAAE,CAAC;SACvB;KACJ;IAED,OAAO;QACH,KAAK,EAAE,SAA8B;KACxC,CAAC;AACN,CAAC;AAnCD,wCAmCC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processStaticRequest = void 0;
|
|
4
|
+
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
4
5
|
/**
|
|
5
6
|
* This function combines the props returned from `getNewsroomStaticProps` and your optional custom props for the page.
|
|
6
7
|
* See README for usage examples.
|
|
@@ -10,6 +11,7 @@ exports.processStaticRequest = void 0;
|
|
|
10
11
|
* @param revalidateTimeout Optional: timeout in seconds to use with Next ISR.
|
|
11
12
|
*/
|
|
12
13
|
function processStaticRequest(context, props, revalidateTimeout) {
|
|
14
|
+
(0, theme_kit_core_1.assertServerEnv)('processStaticRequest');
|
|
13
15
|
const { locale: nextLocale } = context;
|
|
14
16
|
const { localeResolved, ...pageProps } = props;
|
|
15
17
|
// If no locale was provided by Next, it most likely means that the theme is not supporting multi-language.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processStaticRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processStaticRequest.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"processStaticRequest.js","sourceRoot":"","sources":["../../src/adapter-nextjs/processStaticRequest.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AAKzD;;;;;;;GAOG;AACH,SAAgB,oBAAoB,CAChC,OAA8B,EAC9B,KAA8C,EAC9C,iBAA0B;IAE1B,IAAA,gCAAe,EAAC,sBAAsB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC;IAEvC,MAAM,EAAE,cAAc,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,2GAA2G;IAC3G,uCAAuC;IACvC,IAAI,CAAC,cAAc,IAAI,UAAU,EAAE;QAC/B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;KAC7B;IAED,OAAO;QACH,KAAK,EAAE,SAA8B;QACrC,UAAU,EAAE,iBAAiB;KAChC,CAAC;AACN,CAAC;AApBD,oDAoBC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.StorySeo = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
6
6
|
const next_seo_1 = require("next-seo");
|
|
7
7
|
/**
|
|
8
8
|
* This components provides additional page attributes for the Story page.
|
|
@@ -17,8 +17,7 @@ function StorySeo({ story, noindex }) {
|
|
|
17
17
|
subtitle ||
|
|
18
18
|
summary;
|
|
19
19
|
const canonical = story.seo_settings.canonical_url || oembed.url;
|
|
20
|
-
|
|
21
|
-
const indexable = newsroom.is_indexable && story.visibility === sdk_1.Story.Visibility.PUBLIC;
|
|
20
|
+
const indexable = newsroom.is_indexable && story.visibility === theme_kit_core_1.Visibility.PUBLIC;
|
|
22
21
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(next_seo_1.NextSeo, { title: seoTitle, description: seoDescription, canonical: canonical, noindex: noindex ?? !indexable, nofollow: noindex ?? !indexable, openGraph: {
|
|
23
22
|
title,
|
|
24
23
|
description: seoDescription,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StorySeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/StorySeo/StorySeo.tsx"],"names":[],"mappings":";;;;AACA,
|
|
1
|
+
{"version":3,"file":"StorySeo.js","sourceRoot":"","sources":["../../../src/components-nextjs/StorySeo/StorySeo.tsx"],"names":[],"mappings":";;;;AACA,2DAAoD;AACpD,uCAAkD;AAmBlD;;;GAGG;AACH,SAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,OAAO,EAAS;I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AG,EAAE,MAAM,CAAC,KAAK;gCACjB,KAAK,EAAE,MAAM,CAAC,eAAe;gCAC7B,MAAM,EAAE,MAAM,CAAC,gBAAgB;6BAClC;yBACJ;qBACJ,CAAC;iBACL,EACD,kBAAkB,EACd,MAAM,CAAC,aAAa;oBAChB,CAAC,CAAC;wBACI,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,qBAAqB,EAAE;wBACxD,EAAE,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,CAAC,aAAa,EAAE;qBAC3D;oBACH,CAAC,CAAC,SAAS,EAEnB,kBAAkB,EAAE;oBAChB;wBACI,GAAG,EAAE,WAAW;wBAChB,IAAI,EAAE,kBAAkB;wBACxB,IAAI,EAAE,GAAG,MAAM,CAAC,GAAG,OAAO;qBAC7B;iBACJ,GACH,EACF,uBAAC,wBAAa,IACV,GAAG,EAAE,MAAM,CAAC,GAAG,EACf,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,EAC1D,aAAa,EAAE,YAAY,IAAI,EAAE,EACjC,YAAY,EAAE,UAAU,EACxB,UAAU,EAAE,CAAC,UAAU,CAAC,EACxB,aAAa,EAAE,QAAQ,CAAC,YAAY,EACpC,aAAa,EAAE,QAAQ,CAAC,aAAa,EACrC,WAAW,EAAE,cAAc,GAC7B,IACH,CACN,CAAC;AACN,CAAC;AAzED,4BAyEC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Story } from '@prezly/sdk';
|
|
3
|
-
import { PrezlyApi } from '@prezly/theme-kit-core';
|
|
3
|
+
import { PrezlyApi } from '@prezly/theme-kit-core/server';
|
|
4
4
|
import type { IncomingMessage } from 'http';
|
|
5
5
|
import type { PageProps, ServerSidePageProps } from '../types';
|
|
6
6
|
export declare class NextPrezlyApi extends PrezlyApi {
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NextPrezlyApi = void 0;
|
|
4
4
|
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
+
const server_1 = require("@prezly/theme-kit-core/server");
|
|
5
6
|
const intl_1 = require("../intl");
|
|
6
|
-
class NextPrezlyApi extends
|
|
7
|
+
class NextPrezlyApi extends server_1.PrezlyApi {
|
|
7
8
|
async getNewsroomServerSideProps(request, nextLocaleIsoCode, story) {
|
|
8
9
|
const [newsroom, languages, categories, themePreset] = await Promise.all([
|
|
9
10
|
this.getNewsroom(),
|
|
@@ -17,10 +18,9 @@ class NextPrezlyApi extends theme_kit_core_1.PrezlyApi {
|
|
|
17
18
|
const defaultLanguage = (0, theme_kit_core_1.getDefaultLanguage)(languages);
|
|
18
19
|
const { code: localeCode } = currentLanguage || defaultLanguage;
|
|
19
20
|
const locale = theme_kit_core_1.LocaleObject.fromAnyCode(localeCode);
|
|
20
|
-
// TODO: if no information given for current language, show boilerplate from default language
|
|
21
21
|
const companyInformation = (0, theme_kit_core_1.getCompanyInformation)(languages, locale);
|
|
22
22
|
const notifications = (0, theme_kit_core_1.getNotifications)(languages, locale);
|
|
23
|
-
const algoliaSettings = (0,
|
|
23
|
+
const algoliaSettings = (0, server_1.getAlgoliaSettings)(request);
|
|
24
24
|
return {
|
|
25
25
|
newsroomContextProps: {
|
|
26
26
|
newsroom,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NextPrezlyApi.js","sourceRoot":"","sources":["../../src/data-fetching/NextPrezlyApi.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"NextPrezlyApi.js","sourceRoot":"","sources":["../../src/data-fetching/NextPrezlyApi.ts"],"names":[],"mappings":";;;AACA,2DAMgC;AAChC,0DAA8E;AAG9E,kCAA2D;AAG3D,MAAa,aAAc,SAAQ,kBAAS;IACxC,KAAK,CAAC,0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it_core_1 = require("@prezly/theme-kit-core");
|
|
5
|
+
const server_1 = require("@prezly/theme-kit-core/server");
|
|
5
6
|
const NextPrezlyApi_1 = require("./NextPrezlyApi");
|
|
6
7
|
function getNextPrezlyApi(req) {
|
|
7
|
-
|
|
8
|
-
throw new Error('"getNextPrezlyApi" should only be used on back-end side.');
|
|
9
|
-
}
|
|
8
|
+
(0, theme_kit_core_1.assertServerEnv)('getNextPrezlyApi');
|
|
10
9
|
// `getEnvVariables` handles both cases for envs parsing - .env and request headers
|
|
11
|
-
const { PREZLY_ACCESS_TOKEN, PREZLY_NEWSROOM_UUID, PREZLY_THEME_UUID } = (0,
|
|
10
|
+
const { PREZLY_ACCESS_TOKEN, PREZLY_NEWSROOM_UUID, PREZLY_THEME_UUID } = (0, server_1.getEnvVariables)(req);
|
|
12
11
|
if (!PREZLY_ACCESS_TOKEN) {
|
|
13
12
|
throw new Error('"PREZLY_ACCESS_TOKEN" is not set in env variables.');
|
|
14
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getNextPrezlyApi.js","sourceRoot":"","sources":["../../src/data-fetching/getNextPrezlyApi.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;
|
|
1
|
+
{"version":3,"file":"getNextPrezlyApi.js","sourceRoot":"","sources":["../../src/data-fetching/getNextPrezlyApi.ts"],"names":[],"mappings":";;;AAAA,2DAAyD;AACzD,0DAAgE;AAGhE,mDAAgD;AAEhD,SAAgB,gBAAgB,CAAC,GAAqB;IAClD,IAAA,gCAAe,EAAC,kBAAkB,CAAC,CAAC;IAEpC,mFAAmF;IACnF,MAAM,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,GAAG,IAAA,wBAAe,EAAC,GAAG,CAAC,CAAC;IAE9F,IAAI,CAAC,mBAAmB,EAAE;QACtB,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;KACzE;IAED,IAAI,CAAC,oBAAoB,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;KAC1E;IAED,OAAO,IAAI,6BAAa,CAAC,mBAAmB,EAAE,oBAAoB,EAAE,iBAAiB,CAAC,CAAC;AAC3F,CAAC;AAfD,4CAeC"}
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -14,9 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./adapter-nextjs"), exports);
|
|
18
17
|
__exportStar(require("./components-nextjs"), exports);
|
|
19
|
-
__exportStar(require("./data-fetching"), exports);
|
|
20
18
|
__exportStar(require("./infinite-loading"), exports);
|
|
21
19
|
__exportStar(require("./intl"), exports);
|
|
22
20
|
__exportStar(require("./newsroom-context"), exports);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,qDAAmC;AACnC,yCAAuB;AACvB,qDAAmC;AACnC,2CAAyB;AACzB,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useAsync } from './useAsync';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useAsync = void 0;
|
|
4
|
+
var useAsync_1 = require("./useAsync");
|
|
5
|
+
Object.defineProperty(exports, "useAsync", { enumerable: true, get: function () { return useAsync_1.useAsync; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/infinite-loading/lib/index.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AAA7B,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code is ported from `@react-hookz/web` package, to avoid importing the whole package in the client bundle.
|
|
3
|
+
* @see https://github.com/react-hookz/web/blob/master/src/useAsync/index.ts
|
|
4
|
+
*/
|
|
5
|
+
export type AsyncStatus = 'loading' | 'success' | 'error' | 'not-executed';
|
|
6
|
+
export type AsyncState<Result> = {
|
|
7
|
+
status: 'not-executed';
|
|
8
|
+
error: undefined;
|
|
9
|
+
result: Result;
|
|
10
|
+
} | {
|
|
11
|
+
status: 'success';
|
|
12
|
+
error: undefined;
|
|
13
|
+
result: Result;
|
|
14
|
+
} | {
|
|
15
|
+
status: 'error';
|
|
16
|
+
error: Error;
|
|
17
|
+
result: Result;
|
|
18
|
+
} | {
|
|
19
|
+
status: AsyncStatus;
|
|
20
|
+
error: Error | undefined;
|
|
21
|
+
result: Result;
|
|
22
|
+
};
|
|
23
|
+
export interface UseAsyncActions<Result, Args extends unknown[] = unknown[]> {
|
|
24
|
+
/**
|
|
25
|
+
* Reset state to initial.
|
|
26
|
+
*/
|
|
27
|
+
reset: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Execute the async function manually.
|
|
30
|
+
*/
|
|
31
|
+
execute: (...args: Args) => Promise<Result>;
|
|
32
|
+
}
|
|
33
|
+
export interface UseAsyncMeta<Result, Args extends unknown[] = unknown[]> {
|
|
34
|
+
/**
|
|
35
|
+
* Latest promise returned from the async function.
|
|
36
|
+
*/
|
|
37
|
+
promise: Promise<Result> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* List of arguments applied to the latest async function invocation.
|
|
40
|
+
*/
|
|
41
|
+
lastArgs: Args | undefined;
|
|
42
|
+
}
|
|
43
|
+
export declare function useAsync<Result, Args extends unknown[] = unknown[]>(asyncFn: (...params: Args) => Promise<Result>, initialValue: Result): [AsyncState<Result>, UseAsyncActions<Result, Args>, UseAsyncMeta<Result, Args>];
|
|
44
|
+
export declare function useAsync<Result, Args extends unknown[] = unknown[]>(asyncFn: (...params: Args) => Promise<Result>, initialValue?: Result): [AsyncState<Result | undefined>, UseAsyncActions<Result, Args>, UseAsyncMeta<Result, Args>];
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code is ported from `@react-hookz/web` package, to avoid importing the whole package in the client bundle.
|
|
4
|
+
* @see https://github.com/react-hookz/web/blob/master/src/useAsync/index.ts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.useAsync = void 0;
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const useSyncedRef_1 = require("./useSyncedRef");
|
|
10
|
+
/**
|
|
11
|
+
* Tracks the result and errors of the provided async function and provides handles to control its execution.
|
|
12
|
+
*
|
|
13
|
+
* @param asyncFn Function that returns a promise.
|
|
14
|
+
* @param initialValue Value that will be set on initialisation before the async function is
|
|
15
|
+
* executed.
|
|
16
|
+
*/
|
|
17
|
+
function useAsync(asyncFn, initialValue) {
|
|
18
|
+
const [state, setState] = (0, react_1.useState)({
|
|
19
|
+
status: 'not-executed',
|
|
20
|
+
error: undefined,
|
|
21
|
+
result: initialValue,
|
|
22
|
+
});
|
|
23
|
+
const promiseRef = (0, react_1.useRef)();
|
|
24
|
+
const argsRef = (0, react_1.useRef)();
|
|
25
|
+
const methods = (0, useSyncedRef_1.useSyncedRef)({
|
|
26
|
+
execute: (...params) => {
|
|
27
|
+
argsRef.current = params;
|
|
28
|
+
const promise = asyncFn(...params);
|
|
29
|
+
promiseRef.current = promise;
|
|
30
|
+
setState((s) => ({ ...s, status: 'loading' }));
|
|
31
|
+
promise.then((result) => {
|
|
32
|
+
// we dont want to handle result/error of non-latest function
|
|
33
|
+
// this approach helps to avoid race conditions
|
|
34
|
+
if (promise === promiseRef.current) {
|
|
35
|
+
setState((s) => ({ ...s, status: 'success', error: undefined, result }));
|
|
36
|
+
}
|
|
37
|
+
}, (error) => {
|
|
38
|
+
// we dont want to handle result/error of non-latest function
|
|
39
|
+
// this approach helps to avoid race conditions
|
|
40
|
+
if (promise === promiseRef.current) {
|
|
41
|
+
setState((s) => ({ ...s, status: 'error', error }));
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
return promise;
|
|
45
|
+
},
|
|
46
|
+
reset: () => {
|
|
47
|
+
setState({
|
|
48
|
+
status: 'not-executed',
|
|
49
|
+
error: undefined,
|
|
50
|
+
result: initialValue,
|
|
51
|
+
});
|
|
52
|
+
promiseRef.current = undefined;
|
|
53
|
+
argsRef.current = undefined;
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
return [
|
|
57
|
+
state,
|
|
58
|
+
(0, react_1.useMemo)(() => ({
|
|
59
|
+
reset: () => {
|
|
60
|
+
methods.current.reset();
|
|
61
|
+
},
|
|
62
|
+
execute: (...params) => methods.current.execute(...params),
|
|
63
|
+
}),
|
|
64
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
|
+
[]),
|
|
66
|
+
{ promise: promiseRef.current, lastArgs: argsRef.current },
|
|
67
|
+
];
|
|
68
|
+
}
|
|
69
|
+
exports.useAsync = useAsync;
|
|
70
|
+
//# sourceMappingURL=useAsync.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAsync.js","sourceRoot":"","sources":["../../../src/infinite-loading/lib/useAsync.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iCAAkD;AAElD,iDAA8C;AAyD9C;;;;;;GAMG;AACH,SAAgB,QAAQ,CACpB,OAA6C,EAC7C,YAAqB;IAErB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EAAiC;QAC/D,MAAM,EAAE,cAAc;QACtB,KAAK,EAA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BAChB,MAAM,EAAE,YAAY;aACvB,CAAC,CAAC;YACH,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;YAC/B,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;QAChC,CAAC;KACJ,CAAC,CAAC;IAEH,OAAO;QACH,KAAK;QACL,IAAA,eAAO,EACH,GAAG,EAAE,CAAC,CAAC;YACH,KAAK,EAAE,GAAG,EAAE;gBACR,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;YAC5B,CAAC;YACD,OAAO,EAAE,CAAC,GAAG,MAAY,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;SACnE,CAAC;QACF,uDAAuD;QACvD,EAAE,CACL;QACD,EAAE,OAAO,EAAE,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAE;KAC7D,CAAC;AACN,CAAC;AAhED,4BAgEC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code is ported from `@react-hookz/web` package, to avoid importing the whole package in the client bundle.
|
|
3
|
+
* @see https://github.com/react-hookz/web/blob/master/src/useSyncedRef/index.ts
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Like `useRef`, but it returns immutable ref that contains actual value.
|
|
7
|
+
*
|
|
8
|
+
* @param value
|
|
9
|
+
*/
|
|
10
|
+
export declare function useSyncedRef<T>(value: T): {
|
|
11
|
+
readonly current: T;
|
|
12
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This code is ported from `@react-hookz/web` package, to avoid importing the whole package in the client bundle.
|
|
4
|
+
* @see https://github.com/react-hookz/web/blob/master/src/useSyncedRef/index.ts
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.useSyncedRef = void 0;
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
/**
|
|
10
|
+
* Like `useRef`, but it returns immutable ref that contains actual value.
|
|
11
|
+
*
|
|
12
|
+
* @param value
|
|
13
|
+
*/
|
|
14
|
+
function useSyncedRef(value) {
|
|
15
|
+
const ref = (0, react_1.useRef)(value);
|
|
16
|
+
ref.current = value;
|
|
17
|
+
return (0, react_1.useMemo)(() => Object.freeze({
|
|
18
|
+
get current() {
|
|
19
|
+
return ref.current;
|
|
20
|
+
},
|
|
21
|
+
}), []);
|
|
22
|
+
}
|
|
23
|
+
exports.useSyncedRef = useSyncedRef;
|
|
24
|
+
//# sourceMappingURL=useSyncedRef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSyncedRef.js","sourceRoot":"","sources":["../../../src/infinite-loading/lib/useSyncedRef.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,iCAAwC;AAExC;;;;GAIG;AACH,SAAgB,YAAY,CAAI,KAAQ;IACpC,MAAM,GAAG,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAC;IAE1B,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC;IAEpB,OAAO,IAAA,eAAO,EACV,GAAG,EAAE,CACD,MAAM,CAAC,MAAM,CAAC;QACV,IAAI,OAAO;YACP,OAAO,GAAG,CAAC,OAAO,CAAC;QACvB,CAAC;KACJ,CAAC,EACN,EAAE,CACL,CAAC;AACN,CAAC;AAdD,oCAcC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useInfiniteLoading = void 0;
|
|
4
|
-
const web_1 = require("@react-hookz/web");
|
|
5
4
|
const react_1 = require("react");
|
|
5
|
+
const lib_1 = require("./lib");
|
|
6
6
|
function useInfiniteLoading({ fetchingFn, initialData, pagination, }) {
|
|
7
7
|
const [data, setData] = (0, react_1.useState)(initialData);
|
|
8
8
|
const [currentPage, setCurrentPage] = (0, react_1.useState)(pagination.currentPage);
|
|
@@ -10,7 +10,7 @@ function useInfiniteLoading({ fetchingFn, initialData, pagination, }) {
|
|
|
10
10
|
const adjustedItemsTotal = withHighlightedStory ? itemsTotal - 1 : itemsTotal;
|
|
11
11
|
const pagesTotal = Math.ceil(adjustedItemsTotal / pageSize);
|
|
12
12
|
const canLoadMore = currentPage < pagesTotal;
|
|
13
|
-
const [{ error, status }, { execute: loadMoreFn }] = (0,
|
|
13
|
+
const [{ error, status }, { execute: loadMoreFn }] = (0, lib_1.useAsync)(async () => {
|
|
14
14
|
const nextPage = currentPage + 1;
|
|
15
15
|
const newData = await fetchingFn(nextPage, pageSize);
|
|
16
16
|
setCurrentPage(nextPage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInfiniteLoading.js","sourceRoot":"","sources":["../../src/infinite-loading/useInfiniteLoading.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"useInfiniteLoading.js","sourceRoot":"","sources":["../../src/infinite-loading/useInfiniteLoading.ts"],"names":[],"mappings":";;;AAAA,iCAAyD;AAEzD,+BAAiC;AAkBjC,SAAgB,kBAAkB,CAAI,EAClC,UAAU,EACV,WAAW,EACX,UAAU,GACE;IACZ,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,IAAA,gBAAQ,EAAM,WAAW,CAAC,CAAC;IACnD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,IAAA,gBAAQ,EAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAEvE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,oBAAoB,EAAE,GAAG,UAAU,CAAC;IAClE,MAAM,kBAAkB,GAAG,oBAAoB,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IAC9E,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,CAAC;IAC5D,MAAM,WAAW,GAAG,WAA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ewsroomContact, NewsroomLanguageSettings, NewsroomThemePreset, Notification } from '@prezly/sdk';
|
|
2
|
-
import type { AlgoliaSettings } from '@prezly/theme-kit-core';
|
|
3
2
|
import { LocaleObject } from '@prezly/theme-kit-core';
|
|
3
|
+
import type { AlgoliaSettings } from '@prezly/theme-kit-core/server';
|
|
4
4
|
import type { PropsWithChildren } from 'react';
|
|
5
5
|
export interface NewsroomContextType {
|
|
6
6
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/newsroom-context/context.tsx"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/newsroom-context/context.tsx"],"names":[],"mappings":";;;;AAUA,2DAAsE;AAGtE,iCAA+C;AAwDlC,QAAA,eAAe,GAAG,IAAA,qBAAa,EAAkC,SAAS,CAAC,CAAC;AAEzF;;;GAGG;AACH,SAAgB,uBAAuB,CAAC,EACpC,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,kBAAkB,EAClB,SAAS,EACT,UAAU,EACV,aAAa,EACb,WAAW,EACX,eAAe,EACf,QAAQ,GAC8B;IACtC,MAAM,MAAM,GAAG,IAAA,eAAO,EAClB,GAAG,EAAE,CAAC,6BAAY,CAAC,WAAW,CAAC,UAAU,IAAI,+BAAc,CAAC,EAC5D,CAAC,UAAU,CAAC,CACf,CAAC;IAEF,OAAO,CACH,uBAAC,uBAAe,CAAC,QAAQ,IACrB,KAAK,EAAE;YACH,UAAU;YACV,QAAQ;YACR,QAAQ;YACR,eAAe;YACf,YAAY;YACZ,kBAAkB;YAClB,SAAS;YACT,MAAM;YACN,aAAa;YACb,WAAW;YACX,eAAe;SAClB,YAEA,QAAQ,GACc,CAC9B,CAAC;AACN,CAAC;AAtCD,0DAsCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function useAlgoliaSettings(): import("@prezly/theme-kit-core").AlgoliaSettings;
|
|
1
|
+
export declare function useAlgoliaSettings(): import("@prezly/theme-kit-core/server").AlgoliaSettings;
|
|
@@ -1,32 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useGetTranslationUrl = void 0;
|
|
4
|
-
const sdk_1 = require("@prezly/sdk");
|
|
5
4
|
const theme_kit_core_1 = require("@prezly/theme-kit-core");
|
|
6
5
|
const router_1 = require("next/router");
|
|
7
6
|
const react_1 = require("react");
|
|
8
7
|
const useCurrentCategory_1 = require("./useCurrentCategory");
|
|
9
8
|
const useCurrentStory_1 = require("./useCurrentStory");
|
|
10
|
-
// Pulled from SDK types to not leak the `@prezly/sdk` dependency into the client bundle
|
|
11
|
-
// It looks like a hack, but the name of enum must be the same as in SDK
|
|
12
|
-
var Visibility;
|
|
13
|
-
(function (Visibility) {
|
|
14
|
-
Visibility["PUBLIC"] = "public";
|
|
15
|
-
Visibility["EMBARGO"] = "embargo";
|
|
16
|
-
Visibility["PRIVATE"] = "private";
|
|
17
|
-
Visibility["CONFIDENTIAL"] = "confidential";
|
|
18
|
-
})(Visibility || (Visibility = {}));
|
|
19
9
|
function getAllowedTranslationVisibilityValues(story) {
|
|
20
10
|
const { visibility } = story;
|
|
21
11
|
switch (visibility) {
|
|
22
|
-
case Visibility.EMBARGO:
|
|
23
|
-
return [Visibility.EMBARGO, Visibility.PUBLIC];
|
|
24
|
-
case Visibility.PRIVATE:
|
|
25
|
-
return [Visibility.PRIVATE, Visibility.PUBLIC];
|
|
26
|
-
case Visibility.CONFIDENTIAL:
|
|
27
|
-
return [Visibility.CONFIDENTIAL, Visibility.PRIVATE, Visibility.PUBLIC];
|
|
12
|
+
case theme_kit_core_1.Visibility.EMBARGO:
|
|
13
|
+
return [theme_kit_core_1.Visibility.EMBARGO, theme_kit_core_1.Visibility.PUBLIC];
|
|
14
|
+
case theme_kit_core_1.Visibility.PRIVATE:
|
|
15
|
+
return [theme_kit_core_1.Visibility.PRIVATE, theme_kit_core_1.Visibility.PUBLIC];
|
|
16
|
+
case theme_kit_core_1.Visibility.CONFIDENTIAL:
|
|
17
|
+
return [theme_kit_core_1.Visibility.CONFIDENTIAL, theme_kit_core_1.Visibility.PRIVATE, theme_kit_core_1.Visibility.PUBLIC];
|
|
28
18
|
default:
|
|
29
|
-
return [Visibility.PUBLIC];
|
|
19
|
+
return [theme_kit_core_1.Visibility.PUBLIC];
|
|
30
20
|
}
|
|
31
21
|
}
|
|
32
22
|
/**
|
|
@@ -48,8 +38,8 @@ function getTranslationUrl(locale, path, currentCategory, currentStory, noFallba
|
|
|
48
38
|
const localeCode = locale.toUnderscoreCode();
|
|
49
39
|
if (currentStory && currentStory.culture.locale !== localeCode) {
|
|
50
40
|
const allowedVisibilityValues = getAllowedTranslationVisibilityValues(currentStory);
|
|
51
|
-
const translatedStory = currentStory.translations.find(({ culture,
|
|
52
|
-
|
|
41
|
+
const translatedStory = currentStory.translations.find(({ culture, status, visibility }) => culture.locale === localeCode &&
|
|
42
|
+
(0, theme_kit_core_1.isStoryPublished)(status) &&
|
|
53
43
|
allowedVisibilityValues.includes(visibility));
|
|
54
44
|
if (translatedStory) {
|
|
55
45
|
return `/${translatedStory.slug}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"useGetTranslationUrl.js","sourceRoot":"","sources":["../../../src/newsroom-context/hooks/useGetTranslationUrl.ts"],"names":[],"mappings":";;;AAEA,2DAKgC;AAChC,wCAAwC;AACxC,iCAAoC;AAEpC,6DAA0D;AAC1D,uDAAoD;AAEpD,SAAS,qCAAqC,CAC1C,KAAwC;IAExC,MAAM,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAE7B,QAAQ,UAAU,EAAE;QAChB,KAAK,2BAAU,CAAC,OAAO;YACnB,OAAO,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,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"}
|
package/build/server.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
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("./adapter-nextjs"), exports);
|
|
18
|
+
__exportStar(require("./data-fetching"), exports);
|
|
19
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,kDAAgC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prezly/theme-kit-nextjs",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.11",
|
|
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",
|
|
@@ -8,6 +8,17 @@
|
|
|
8
8
|
"build",
|
|
9
9
|
"README.md"
|
|
10
10
|
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./build/index.js",
|
|
13
|
+
"./server": "./build/server.js"
|
|
14
|
+
},
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
"*": {
|
|
17
|
+
"server": [
|
|
18
|
+
"build/server.d.ts"
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
11
22
|
"engines": {
|
|
12
23
|
"node": ">= 16.x",
|
|
13
24
|
"npm": ">= 8.x"
|
|
@@ -40,23 +51,22 @@
|
|
|
40
51
|
"test": "jest"
|
|
41
52
|
},
|
|
42
53
|
"peerDependencies": {
|
|
43
|
-
"@prezly/sdk": ">=
|
|
54
|
+
"@prezly/sdk": ">=12 <16",
|
|
44
55
|
"@prezly/theme-kit-core": "^5.0.0-alpha",
|
|
45
56
|
"next": "^12.x || ^13.x",
|
|
46
57
|
"react": "^17.x || ^18.x",
|
|
47
58
|
"react-dom": "^17.x || ^18.x"
|
|
48
59
|
},
|
|
49
60
|
"dependencies": {
|
|
50
|
-
"@react-hookz/web": "^16.0.0",
|
|
51
61
|
"next-seo": "^5.4.0"
|
|
52
62
|
},
|
|
53
63
|
"devDependencies": {
|
|
54
|
-
"@prezly/theme-kit-core": "^5.0.0-alpha.
|
|
55
|
-
"@sentry/nextjs": "7.
|
|
64
|
+
"@prezly/theme-kit-core": "^5.0.0-alpha.9",
|
|
65
|
+
"@sentry/nextjs": "7.50.0"
|
|
56
66
|
},
|
|
57
67
|
"publishConfig": {
|
|
58
68
|
"access": "public"
|
|
59
69
|
},
|
|
60
70
|
"sideEffects": false,
|
|
61
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "7d3d80dc7ffe29c749a9cb671a9ca846e07420e0"
|
|
62
72
|
}
|