@prezly/theme-kit-nextjs 1.3.3 → 1.3.4-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -11
- package/build/adapter-nextjs/getNewsroomServerSideProps.d.ts +4 -0
- package/build/adapter-nextjs/getNewsroomServerSideProps.js +4 -0
- package/build/adapter-nextjs/getNewsroomServerSideProps.js.map +1 -1
- package/build/adapter-nextjs/processRequest.d.ts +9 -0
- package/build/adapter-nextjs/processRequest.js +9 -0
- package/build/adapter-nextjs/processRequest.js.map +1 -1
- package/build/data-fetching/api/PrezlyApi.d.ts +9 -2
- package/build/data-fetching/api/PrezlyApi.js +13 -2
- package/build/data-fetching/api/PrezlyApi.js.map +1 -1
- package/build/data-fetching/api/getPrezlyApi.js +2 -2
- package/build/data-fetching/api/getPrezlyApi.js.map +1 -1
- package/build/data-fetching/api/languages.d.ts +9 -0
- package/build/data-fetching/api/languages.js +9 -0
- package/build/data-fetching/api/languages.js.map +1 -1
- package/build/data-fetching/getAssetsUrl.d.ts +4 -0
- package/build/data-fetching/getAssetsUrl.js +4 -0
- package/build/data-fetching/getAssetsUrl.js.map +1 -1
- package/build/data-fetching/getUploadcareGroupUrl.d.ts +7 -0
- package/build/data-fetching/getUploadcareGroupUrl.js +7 -0
- package/build/data-fetching/getUploadcareGroupUrl.js.map +1 -1
- package/build/data-fetching/types.d.ts +1 -0
- package/build/intl/lang.d.ts +4 -2
- package/build/intl/lang.js +4 -2
- package/build/intl/lang.js.map +1 -1
- package/build/intl/locale.d.ts +4 -0
- package/build/intl/locale.js +9 -0
- package/build/intl/locale.js.map +1 -1
- package/build/intl/localeConfig.js +6 -2
- package/build/intl/localeConfig.js.map +1 -1
- package/build/intl/localeObject.d.ts +23 -0
- package/build/intl/localeObject.js +23 -0
- package/build/intl/localeObject.js.map +1 -1
- package/build/newsroom-context/context.d.ts +38 -1
- package/build/newsroom-context/context.js +4 -0
- package/build/newsroom-context/context.js.map +1 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js +6 -1
- package/build/newsroom-context/hooks/useGetLinkLocaleSlug.js.map +1 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.d.ts +4 -0
- package/build/newsroom-context/hooks/useGetTranslationUrl.js +10 -1
- package/build/newsroom-context/hooks/useGetTranslationUrl.js.map +1 -1
- package/build/types.d.ts +13 -0
- package/package.json +1 -1
- package/src/adapter-nextjs/getNewsroomServerSideProps.ts +4 -0
- package/src/adapter-nextjs/processRequest.ts +9 -0
- package/src/data-fetching/api/PrezlyApi.ts +16 -2
- package/src/data-fetching/api/getPrezlyApi.ts +2 -2
- package/src/data-fetching/api/languages.ts +9 -0
- package/src/data-fetching/getAssetsUrl.ts +4 -0
- package/src/data-fetching/getUploadcareGroupUrl.ts +7 -0
- package/src/data-fetching/types.ts +1 -0
- package/src/intl/lang.ts +4 -2
- package/src/intl/locale.ts +9 -0
- package/src/intl/localeConfig.js +6 -2
- package/src/intl/localeObject.ts +23 -0
- package/src/newsroom-context/context.tsx +38 -1
- package/src/newsroom-context/hooks/useGetLinkLocaleSlug.ts +6 -1
- package/src/newsroom-context/hooks/useGetTranslationUrl.ts +10 -1
- package/src/types.ts +13 -1
package/src/types.ts
CHANGED
|
@@ -1,22 +1,34 @@
|
|
|
1
|
-
// TODO: Re-arrange the types to make them isolated to respective libs where possible
|
|
2
1
|
import type { CultureRef, ExtraStoryFields, Story } from '@prezly/sdk';
|
|
3
2
|
|
|
4
3
|
import type { NewsroomContextProps } from './newsroom-context';
|
|
5
4
|
|
|
6
5
|
export interface ServerSidePageProps {
|
|
6
|
+
/**
|
|
7
|
+
* Indicates whether the locale requested by the Next application was correctly resolved to an active newsroom locale.
|
|
8
|
+
* This is used by `processRequest` method to redirect to the default locale if the property is `false`.
|
|
9
|
+
*/
|
|
7
10
|
localeResolved: boolean;
|
|
8
11
|
}
|
|
9
12
|
|
|
13
|
+
/**
|
|
14
|
+
* These are the props returned by the `processRequest` method that are meant to be passed to your `_app` to be injected into the `NewsroomContextProvider`.
|
|
15
|
+
*/
|
|
10
16
|
export interface PageProps {
|
|
11
17
|
newsroomContextProps: NewsroomContextProps;
|
|
12
18
|
}
|
|
13
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Categories in Algolia index are stored in a simplified format, with `slug` and `name` properties already saved in the correct locale for the story search result.
|
|
22
|
+
*/
|
|
14
23
|
export interface AlgoliaCategoryRef {
|
|
15
24
|
id: number;
|
|
16
25
|
name: string;
|
|
17
26
|
slug: string;
|
|
18
27
|
}
|
|
19
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Stories in Algolia index are stored in a simplified format, with only minimal subset of fields.
|
|
31
|
+
*/
|
|
20
32
|
export type AlgoliaStory = Pick<Story, 'uuid' | 'slug' | 'title' | 'subtitle'> &
|
|
21
33
|
Pick<ExtraStoryFields, 'thumbnail_image'> & {
|
|
22
34
|
content_text: string;
|