@se-studio/core-ui 1.0.90 → 1.0.91
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/CHANGELOG.md +9 -0
- package/README.md +44 -0
- package/dist/components/CmsRoutesLayout.d.ts +16 -0
- package/dist/components/CmsRoutesLayout.d.ts.map +1 -0
- package/dist/components/CmsRoutesLayout.js +17 -0
- package/dist/components/CmsRoutesLayout.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +4 -0
- package/dist/server/index.js.map +1 -0
- package/dist/server/route-handlers.d.ts +72 -0
- package/dist/server/route-handlers.d.ts.map +1 -0
- package/dist/server/route-handlers.js +697 -0
- package/dist/server/route-handlers.js.map +1 -0
- package/dist/server/route-types.d.ts +38 -0
- package/dist/server/route-types.d.ts.map +1 -0
- package/dist/server/route-types.js +4 -0
- package/dist/server/route-types.js.map +1 -0
- package/package.json +8 -3
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -493,6 +493,50 @@ const { getSitemapEntries, ... } = createAppHelpers({
|
|
|
493
493
|
|
|
494
494
|
`additionalSources` are merged into the main sitemap only (not the unindexed sitemap). For custom content from another Contentful table, add async functions that return `SitemapEntry[]`.
|
|
495
495
|
|
|
496
|
+
### `@se-studio/core-ui/server` – Route Handlers Factory
|
|
497
|
+
|
|
498
|
+
The `/server` entry point (server-only) provides `createRouteHandlers`, a factory that centralises all `generate*Page` and `generate*Metadata` functions for CMS-driven Next.js apps.
|
|
499
|
+
|
|
500
|
+
Each app wires it once in `src/lib/route-handlers.ts`:
|
|
501
|
+
|
|
502
|
+
```typescript
|
|
503
|
+
import 'server-only';
|
|
504
|
+
import { createRouteHandlers } from '@se-studio/core-ui/server';
|
|
505
|
+
import BasicLayout from '@/project/BasicLayout';
|
|
506
|
+
import { buildOptions, getBannersWithErrors, getPageWithErrors, ... , projectRendererConfig } from './cms-server';
|
|
507
|
+
import { buildInformation } from './converter-context';
|
|
508
|
+
import { ARTICLES_SLUG, TAGS_SLUG, PEOPLE_SLUG, articlesCustomTypeSlug,
|
|
509
|
+
requireCustomTypeForArticleTypes, enableTag, enablePerson, enableTagsIndex } from './constants';
|
|
510
|
+
|
|
511
|
+
export const {
|
|
512
|
+
generatePage, generatePageMetadata,
|
|
513
|
+
generateArticlePage, generateArticleMetadata,
|
|
514
|
+
generateArticleTypePage, generateArticleTypeMetadata,
|
|
515
|
+
generateArticleTypeTagPage, generateArticleTypeTagMetadata,
|
|
516
|
+
generateArticleTypesIndexPage, generateArticleTypesIndexMetadata,
|
|
517
|
+
generateTagPage, generateTagMetadata,
|
|
518
|
+
generateTagsIndexPage, generateTagsIndexMetadata,
|
|
519
|
+
generatePersonPage, generatePersonMetadata,
|
|
520
|
+
generateTeamIndexPage, generateTeamIndexMetadata,
|
|
521
|
+
generateCustomTypePage, generateCustomTypeMetadata,
|
|
522
|
+
buildLocaleAlternates,
|
|
523
|
+
} = createRouteHandlers({
|
|
524
|
+
rendererConfig: projectRendererConfig,
|
|
525
|
+
buildOptions,
|
|
526
|
+
buildInformation,
|
|
527
|
+
getBannersWithErrors,
|
|
528
|
+
getPageWithErrors,
|
|
529
|
+
// ... remaining fetch helpers
|
|
530
|
+
LayoutComponent: BasicLayout,
|
|
531
|
+
constants: { ARTICLES_SLUG, TAGS_SLUG, PEOPLE_SLUG, articlesCustomTypeSlug,
|
|
532
|
+
requireCustomTypeForArticleTypes, enableTag, enablePerson, enableTagsIndex },
|
|
533
|
+
});
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Route files then import directly from `@/lib/route-handlers`.
|
|
537
|
+
|
|
538
|
+
The `/server` entry also exports `CmsRouteConfig`, `BreadcrumbOptions`, `toBreadcrumbOptions`, and `BasicLayoutProps`. The types (but not `createRouteHandlers`) are also re-exported from the main package entry for client-safe use.
|
|
539
|
+
|
|
496
540
|
## Advanced Usage
|
|
497
541
|
|
|
498
542
|
For advanced CMS infrastructure usage, including:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Default layout for CMS-driven route groups.
|
|
4
|
+
*
|
|
5
|
+
* Sets `dynamicParams = true` so that any path can be rendered on-demand,
|
|
6
|
+
* even if it was not pre-rendered at build time.
|
|
7
|
+
*
|
|
8
|
+
* Re-export this from each app's `app/(cms-routes)/layout.tsx`:
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* export { dynamicParams, CmsRoutesLayout as default } from '@se-studio/core-ui';
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const dynamicParams = true;
|
|
15
|
+
export declare function CmsRoutesLayout({ children }: PropsWithChildren): import("react").ReactNode;
|
|
16
|
+
//# sourceMappingURL=CmsRoutesLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CmsRoutesLayout.d.ts","sourceRoot":"","sources":["../../src/components/CmsRoutesLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,aAAa,OAAO,CAAC;AAElC,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,6BAE9D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default layout for CMS-driven route groups.
|
|
3
|
+
*
|
|
4
|
+
* Sets `dynamicParams = true` so that any path can be rendered on-demand,
|
|
5
|
+
* even if it was not pre-rendered at build time.
|
|
6
|
+
*
|
|
7
|
+
* Re-export this from each app's `app/(cms-routes)/layout.tsx`:
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* export { dynamicParams, CmsRoutesLayout as default } from '@se-studio/core-ui';
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
export const dynamicParams = true;
|
|
14
|
+
export function CmsRoutesLayout({ children }) {
|
|
15
|
+
return children;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=CmsRoutesLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CmsRoutesLayout.js","sourceRoot":"","sources":["../../src/components/CmsRoutesLayout.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,IAAI,CAAC;AAElC,MAAM,UAAU,eAAe,CAAC,EAAE,QAAQ,EAAqB;IAC7D,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export { CmsContent, createEmbeddedContentContext } from './components/CmsConten
|
|
|
53
53
|
export { CmsConversionErrors } from './components/CmsConversionErrors';
|
|
54
54
|
export { CmsEmbeddedContent } from './components/CmsEmbeddedContent';
|
|
55
55
|
export type { EmbeddedExternalComponentMap, EmbeddedExternalComponentRenderer, ExternalComponentMap, ExternalComponentRenderer, ExternalComponentRendererProps, } from './components/CmsExternalComponent';
|
|
56
|
+
export { CmsRoutesLayout, dynamicParams } from './components/CmsRoutesLayout';
|
|
56
57
|
export { ErrorBoundary } from './components/ErrorBoundary';
|
|
57
58
|
export { Preview } from './components/Preview.js';
|
|
58
59
|
export type { StructuredDataProps } from './components/StructuredData';
|
|
@@ -72,6 +73,8 @@ export { default as ResponsiveVisual } from './framework/ResponsiveVisual';
|
|
|
72
73
|
export { useClickTracking } from './hooks/useClickTracking';
|
|
73
74
|
export { onVisibleToUser, useClientOnly, useDocumentVisible, useFirstVisibleCallback, useFirstVisibleToUser, useVisibleToUser, } from './hooks/visibility';
|
|
74
75
|
export { RTF } from './rtf/rtf';
|
|
76
|
+
export type { BasicLayoutProps, BreadcrumbOptions, CmsRouteConfig } from './server/route-types';
|
|
77
|
+
export { toBreadcrumbOptions } from './server/route-types';
|
|
75
78
|
export * from './showcase';
|
|
76
79
|
export type { BreadcrumbLookup, BreadcrumbLookupEntry, BreadcrumbSegment, ResolveBreadcrumbSegmentsOptions, } from './utils/breadcrumbUtils';
|
|
77
80
|
export { normalizeBreadcrumbPath, resolveBreadcrumbSegments, } from './utils/breadcrumbUtils';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAEvF,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,gBAAgB,EAChB,uBAAuB,EACvB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,YAAY,EACZ,gBAAgB,EAChB,qBAAqB,EACrB,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,YAAY,EACV,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,0BAA0B,EAC1B,gBAAgB,EAChB,eAAe,EACf,uBAAuB,GACxB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,M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iC,EACjC,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -48,6 +48,7 @@ export { CmsComponent } from './components/CmsComponent';
|
|
|
48
48
|
export { CmsContent, createEmbeddedContentContext } from './components/CmsContent';
|
|
49
49
|
export { CmsConversionErrors } from './components/CmsConversionErrors';
|
|
50
50
|
export { CmsEmbeddedContent } from './components/CmsEmbeddedContent';
|
|
51
|
+
export { CmsRoutesLayout, dynamicParams } from './components/CmsRoutesLayout';
|
|
51
52
|
// Framework Components
|
|
52
53
|
// Error Handling
|
|
53
54
|
export { ErrorBoundary } from './components/ErrorBoundary';
|
|
@@ -70,6 +71,7 @@ export { default as ResponsiveVisual } from './framework/ResponsiveVisual';
|
|
|
70
71
|
export { useClickTracking } from './hooks/useClickTracking';
|
|
71
72
|
export { onVisibleToUser, useClientOnly, useDocumentVisible, useFirstVisibleCallback, useFirstVisibleToUser, useVisibleToUser, } from './hooks/visibility';
|
|
72
73
|
export { RTF } from './rtf/rtf';
|
|
74
|
+
export { toBreadcrumbOptions } from './server/route-types';
|
|
73
75
|
// CMS Showcase
|
|
74
76
|
export * from './showcase';
|
|
75
77
|
export { normalizeBreadcrumbPath, resolveBreadcrumbSegments, } from './utils/breadcrumbUtils';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":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AE,MAAM,4BAA4B,CAAC;AAChE,wBAAwB;AACxB,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import 'server-only';
|
|
2
|
+
export type { RouteHandlersConfig } from './route-handlers';
|
|
3
|
+
export { createRouteHandlers } from './route-handlers';
|
|
4
|
+
export type { BasicLayoutProps, BreadcrumbOptions, CmsRouteConfig } from './route-types';
|
|
5
|
+
export { toBreadcrumbOptions } from './route-types';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAErB,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** biome-ignore-all lint/suspicious/noExplicitAny: factory uses any for app-specific model types */
|
|
2
|
+
import type { ArticleTypeFetchOptions, CmsResponse, FetchOptions, IContentfulPerson, TagFetchOptions } from '@se-studio/contentful-rest-api';
|
|
3
|
+
import type { IBanner, IBaseArticle, IBaseArticleType, IBaseCustomType, IBasePage, IBaseTag } from '@se-studio/core-data-types';
|
|
4
|
+
import type { ResolvingMetadata } from 'next';
|
|
5
|
+
import type { CmsRendererConfig } from '../CmsRendererConfig';
|
|
6
|
+
import type { IBuildInformation } from '../utils/buildPageMetadata';
|
|
7
|
+
import type { BasicLayoutProps, CmsRouteConfig } from './route-types';
|
|
8
|
+
export interface RouteHandlersConfig<TPage extends IBasePage, TArticle extends IBaseArticle, TArticleType extends IBaseArticleType, TTag extends IBaseTag, TPerson extends IContentfulPerson, TCustomType extends IBaseCustomType> {
|
|
9
|
+
rendererConfig: CmsRendererConfig<any>;
|
|
10
|
+
buildOptions: (options?: Partial<FetchOptions>) => FetchOptions;
|
|
11
|
+
buildInformation: IBuildInformation;
|
|
12
|
+
getBannersWithErrors: (options?: FetchOptions) => Promise<CmsResponse<IBanner[] | null>>;
|
|
13
|
+
getPageWithErrors: (slug: string, options?: FetchOptions) => Promise<CmsResponse<TPage | null>>;
|
|
14
|
+
getArticleWithErrors: (articleTypeSlug: string, slug: string, options?: FetchOptions) => Promise<CmsResponse<TArticle | null>>;
|
|
15
|
+
getArticleTypeWithErrors: (slug: string, options?: Partial<ArticleTypeFetchOptions>) => Promise<CmsResponse<TArticleType | null>>;
|
|
16
|
+
getTagWithErrors: (slug: string, options?: Partial<TagFetchOptions>) => Promise<CmsResponse<TTag | null>>;
|
|
17
|
+
getPersonWithErrors: (slug: string, options?: Partial<FetchOptions> & {
|
|
18
|
+
customType?: string;
|
|
19
|
+
}) => Promise<CmsResponse<TPerson | null>>;
|
|
20
|
+
getCustomTypeWithErrors: (slug: string, options?: FetchOptions) => Promise<CmsResponse<TCustomType | null>>;
|
|
21
|
+
/** Layout component. Uses `model: any` to accommodate apps that extend IBaseModel. */
|
|
22
|
+
LayoutComponent: React.ComponentType<Omit<BasicLayoutProps, 'model'> & {
|
|
23
|
+
model: any;
|
|
24
|
+
}>;
|
|
25
|
+
constants: {
|
|
26
|
+
ARTICLES_SLUG: string;
|
|
27
|
+
TAGS_SLUG: string;
|
|
28
|
+
PEOPLE_SLUG: string;
|
|
29
|
+
/** Custom type slug for articles when using custom type. Undefined when not used. */
|
|
30
|
+
articlesCustomTypeSlug: string | undefined;
|
|
31
|
+
requireCustomTypeForArticleTypes: boolean;
|
|
32
|
+
enableTag: boolean;
|
|
33
|
+
enablePerson: boolean;
|
|
34
|
+
enableTagsIndex: boolean;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Creates all generate*Page and generate*Metadata functions for CMS route handlers.
|
|
39
|
+
* This factory centralises the logic from the per-app `appShared/` directory, accepting
|
|
40
|
+
* app-specific config (layout, fetch helpers, constants) via dependency injection.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* // src/lib/route-handlers.ts
|
|
45
|
+
* import { createRouteHandlers } from '@se-studio/core-ui/server';
|
|
46
|
+
* export const { generatePage, generatePageMetadata, ... } = createRouteHandlers({ ... });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare function createRouteHandlers<TPage extends IBasePage = IBasePage, TArticle extends IBaseArticle = IBaseArticle, TArticleType extends IBaseArticleType = IBaseArticleType, TTag extends IBaseTag = IBaseTag, TPerson extends IContentfulPerson = IContentfulPerson, TCustomType extends IBaseCustomType = IBaseCustomType>(config: RouteHandlersConfig<TPage, TArticle, TArticleType, TTag, TPerson, TCustomType>): {
|
|
50
|
+
buildLocaleAlternates: (path: string, locale: string) => Record<string, string> | undefined;
|
|
51
|
+
generatePage: (slug: string, path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
52
|
+
generatePageMetadata: (slug: string, path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
53
|
+
generateArticlePage: (articleTypeSlug: string, articleSlug: string, path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
54
|
+
generateArticleMetadata: (articleTypeSlug: string, articleSlug: string, path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
55
|
+
generateArticleTypePage: (articleTypeSlug: string, path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
56
|
+
generateArticleTypeMetadata: (articleTypeSlug: string, path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
57
|
+
generateArticleTypeTagPage: (articleTypeSlug: string, tagSlug: string, path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
58
|
+
generateArticleTypeTagMetadata: (articleTypeSlug: string, tagSlug: string, path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
59
|
+
generateArticleTypesIndexPage: (path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
60
|
+
generateArticleTypesIndexMetadata: (path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
61
|
+
generateTagPage: (tagSlug: string, path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
62
|
+
generateTagMetadata: (tagSlug: string, path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
63
|
+
generateTagsIndexPage: (path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
64
|
+
generateTagsIndexMetadata: (path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
65
|
+
generatePersonPage: (personSlug: string, path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
66
|
+
generatePersonMetadata: (personSlug: string, path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
67
|
+
generateTeamIndexPage: (path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
68
|
+
generateTeamIndexMetadata: (path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
69
|
+
generateCustomTypePage: (customTypeSlug: string, path: string, routeConfig: CmsRouteConfig, locale?: string) => Promise<import("react/jsx-runtime").JSX.Element | undefined>;
|
|
70
|
+
generateCustomTypeMetadata: (customTypeSlug: string, path: string, routeConfig: CmsRouteConfig, parent: ResolvingMetadata, locale?: string) => Promise<import("next").Metadata | undefined>;
|
|
71
|
+
};
|
|
72
|
+
//# sourceMappingURL=route-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-handlers.d.ts","sourceRoot":"","sources":["../../src/server/route-handlers.tsx"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,OAAO,KAAK,EACV,uBAAuB,EAEvB,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,eAAe,EAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAEV,OAAO,EACP,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,SAAS,EACT,QAAQ,EACT,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OA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ound } from 'next/navigation';
|
|
3
|
+
import { CmsContent } from '../components/CmsContent';
|
|
4
|
+
import { buildPageMetadata, calculateTitleAndDescription, getLocalizedPath, } from '../utils/buildPageMetadata';
|
|
5
|
+
import { handleCmsError } from '../utils/errorHandling';
|
|
6
|
+
import { toBreadcrumbOptions } from './route-types';
|
|
7
|
+
/**
|
|
8
|
+
* Creates all generate*Page and generate*Metadata functions for CMS route handlers.
|
|
9
|
+
* This factory centralises the logic from the per-app `appShared/` directory, accepting
|
|
10
|
+
* app-specific config (layout, fetch helpers, constants) via dependency injection.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // src/lib/route-handlers.ts
|
|
15
|
+
* import { createRouteHandlers } from '@se-studio/core-ui/server';
|
|
16
|
+
* export const { generatePage, generatePageMetadata, ... } = createRouteHandlers({ ... });
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export function createRouteHandlers(config) {
|
|
20
|
+
const { rendererConfig, buildOptions, buildInformation, getBannersWithErrors, getPageWithErrors, getArticleWithErrors, getArticleTypeWithErrors, getTagWithErrors, getPersonWithErrors, getCustomTypeWithErrors, LayoutComponent, constants, } = config;
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// Locale helpers
|
|
23
|
+
// ============================================================================
|
|
24
|
+
/** Build hreflang alternates for a path and locale. */
|
|
25
|
+
function buildLocaleAlternates(path, locale) {
|
|
26
|
+
const localeConfig = buildInformation.localeConfig;
|
|
27
|
+
if (!localeConfig) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const prefix = `/${locale}`;
|
|
31
|
+
const basePath = locale !== localeConfig.defaultLocale && path.startsWith(prefix)
|
|
32
|
+
? path.slice(prefix.length) || '/'
|
|
33
|
+
: path;
|
|
34
|
+
return Object.fromEntries(localeConfig.locales.map((loc) => [loc, getLocalizedPath(basePath, loc, localeConfig)]));
|
|
35
|
+
}
|
|
36
|
+
// ============================================================================
|
|
37
|
+
// Page
|
|
38
|
+
// ============================================================================
|
|
39
|
+
async function getPageData(slug, locale) {
|
|
40
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
41
|
+
const [pageResponse, bannersResponse] = await Promise.all([
|
|
42
|
+
getPageWithErrors(slug, options),
|
|
43
|
+
getBannersWithErrors(options),
|
|
44
|
+
]);
|
|
45
|
+
return {
|
|
46
|
+
page: pageResponse.data,
|
|
47
|
+
banners: bannersResponse.data,
|
|
48
|
+
errors: [...pageResponse.errors, ...bannersResponse.errors],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
async function generatePageMetadata(slug, path, routeConfig, parent, locale) {
|
|
52
|
+
const errorContext = { type: 'metadata', slug, path };
|
|
53
|
+
try {
|
|
54
|
+
const { page } = await getPageData(slug, locale);
|
|
55
|
+
if (!page) {
|
|
56
|
+
if (routeConfig.throwOnNotFound)
|
|
57
|
+
return notFound();
|
|
58
|
+
return undefined;
|
|
59
|
+
}
|
|
60
|
+
const localeAlternates = locale ? buildLocaleAlternates(path, locale) : undefined;
|
|
61
|
+
return buildPageMetadata(page, path, buildInformation, parent, true, localeAlternates);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
if (routeConfig.throwOnNotFound)
|
|
65
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
66
|
+
return {};
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
async function generatePage(slug, path, routeConfig, locale) {
|
|
70
|
+
const errorContext = { type: 'page', slug, path };
|
|
71
|
+
try {
|
|
72
|
+
const { page, banners, errors } = await getPageData(slug, locale);
|
|
73
|
+
if (!page?.contents?.length) {
|
|
74
|
+
if (routeConfig.throwOnNotFound)
|
|
75
|
+
return notFound();
|
|
76
|
+
return undefined;
|
|
77
|
+
}
|
|
78
|
+
const analyticsContext = {
|
|
79
|
+
slug,
|
|
80
|
+
title: page.title || '',
|
|
81
|
+
type: page.type,
|
|
82
|
+
};
|
|
83
|
+
const breadcrumbOptions = toBreadcrumbOptions(routeConfig);
|
|
84
|
+
return (_jsx(LayoutComponent, { model: page, analyticsContext: analyticsContext, errors: errors, banners: banners, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: breadcrumbOptions, children: _jsx(CmsContent, { contents: page.contents, rendererConfig: rendererConfig, pageContext: { page }, analyticsContext: analyticsContext }) }));
|
|
85
|
+
}
|
|
86
|
+
catch (error) {
|
|
87
|
+
if (routeConfig.throwOnNotFound)
|
|
88
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// ============================================================================
|
|
93
|
+
// Article
|
|
94
|
+
// ============================================================================
|
|
95
|
+
async function getArticleData(articleTypeSlug, slug, locale) {
|
|
96
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
97
|
+
const [articleResponse, bannersResponse] = await Promise.all([
|
|
98
|
+
getArticleWithErrors(articleTypeSlug, slug, options),
|
|
99
|
+
getBannersWithErrors(options),
|
|
100
|
+
]);
|
|
101
|
+
return {
|
|
102
|
+
article: articleResponse.data,
|
|
103
|
+
banners: bannersResponse.data,
|
|
104
|
+
errors: [...articleResponse.errors, ...bannersResponse.errors],
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
async function generateArticleMetadata(articleTypeSlug, articleSlug, path, routeConfig, parent, locale) {
|
|
108
|
+
const errorContext = { type: 'metadata', articleTypeSlug, articleSlug, path };
|
|
109
|
+
try {
|
|
110
|
+
const { article } = await getArticleData(articleTypeSlug, articleSlug, locale);
|
|
111
|
+
if (!article) {
|
|
112
|
+
if (routeConfig.throwOnNotFound)
|
|
113
|
+
return notFound();
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
const localeAlternates = locale ? buildLocaleAlternates(path, locale) : undefined;
|
|
117
|
+
return buildPageMetadata(article, path, buildInformation, parent, true, localeAlternates);
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
if (routeConfig.throwOnNotFound)
|
|
121
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
122
|
+
return {};
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
async function generateArticlePage(articleTypeSlug, articleSlug, path, routeConfig, locale) {
|
|
126
|
+
const errorContext = { type: 'article', articleTypeSlug, articleSlug, path };
|
|
127
|
+
try {
|
|
128
|
+
const { article, banners, errors } = await getArticleData(articleTypeSlug, articleSlug, locale);
|
|
129
|
+
if (!article || article.contentCount === 0 || !article.contents?.length) {
|
|
130
|
+
if (routeConfig.throwOnNotFound)
|
|
131
|
+
return notFound();
|
|
132
|
+
return undefined;
|
|
133
|
+
}
|
|
134
|
+
const analyticsContext = {
|
|
135
|
+
slug: path,
|
|
136
|
+
title: article.title || '',
|
|
137
|
+
type: article.type,
|
|
138
|
+
};
|
|
139
|
+
return (_jsx(LayoutComponent, { model: article, analyticsContext: analyticsContext, errors: errors, banners: banners, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: article.contents, rendererConfig: rendererConfig, pageContext: { article }, analyticsContext: analyticsContext }) }));
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
if (routeConfig.throwOnNotFound)
|
|
143
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
144
|
+
return undefined;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// ============================================================================
|
|
148
|
+
// Article Type
|
|
149
|
+
// ============================================================================
|
|
150
|
+
async function getArticleTypeData(articleTypeSlug, locale) {
|
|
151
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
152
|
+
const [articleTypeResponse, customTypeResponse, bannersResponse] = await Promise.all([
|
|
153
|
+
getArticleTypeWithErrors(articleTypeSlug, {
|
|
154
|
+
...options,
|
|
155
|
+
customType: constants.requireCustomTypeForArticleTypes
|
|
156
|
+
? constants.ARTICLES_SLUG
|
|
157
|
+
: undefined,
|
|
158
|
+
}),
|
|
159
|
+
constants.requireCustomTypeForArticleTypes
|
|
160
|
+
? getCustomTypeWithErrors(constants.ARTICLES_SLUG, options)
|
|
161
|
+
: Promise.resolve({ data: undefined, errors: [] }),
|
|
162
|
+
getBannersWithErrors(options),
|
|
163
|
+
]);
|
|
164
|
+
return {
|
|
165
|
+
articleType: articleTypeResponse.data,
|
|
166
|
+
customType: customTypeResponse.data,
|
|
167
|
+
banners: bannersResponse.data,
|
|
168
|
+
errors: [
|
|
169
|
+
...articleTypeResponse.errors,
|
|
170
|
+
...customTypeResponse.errors,
|
|
171
|
+
...bannersResponse.errors,
|
|
172
|
+
],
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
async function generateArticleTypeMetadata(articleTypeSlug, path, routeConfig, parent, locale) {
|
|
176
|
+
const errorContext = { type: 'metadata', articleTypeSlug, path };
|
|
177
|
+
try {
|
|
178
|
+
const { articleType, customType } = await getArticleTypeData(articleTypeSlug, locale);
|
|
179
|
+
if (!(articleType && (customType || !constants.requireCustomTypeForArticleTypes))) {
|
|
180
|
+
if (routeConfig.throwOnNotFound)
|
|
181
|
+
return notFound();
|
|
182
|
+
return undefined;
|
|
183
|
+
}
|
|
184
|
+
const { title, description } = calculateTitleAndDescription({
|
|
185
|
+
articleType: articleType,
|
|
186
|
+
customType: customType,
|
|
187
|
+
});
|
|
188
|
+
const model = {
|
|
189
|
+
indexed: articleType.indexed && (customType?.indexed ?? true),
|
|
190
|
+
featuredImage: articleType.featuredImage ?? customType?.featuredImage ?? undefined,
|
|
191
|
+
title,
|
|
192
|
+
description,
|
|
193
|
+
};
|
|
194
|
+
const localeAlternates = locale ? buildLocaleAlternates(path, locale) : undefined;
|
|
195
|
+
return buildPageMetadata(model, path, buildInformation, parent, true, localeAlternates);
|
|
196
|
+
}
|
|
197
|
+
catch (error) {
|
|
198
|
+
if (routeConfig.throwOnNotFound)
|
|
199
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
200
|
+
return {};
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
async function generateArticleTypePage(articleTypeSlug, path, routeConfig, locale) {
|
|
204
|
+
const errorContext = { type: 'article-type', articleTypeSlug, path };
|
|
205
|
+
try {
|
|
206
|
+
const { articleType, customType, banners, errors } = await getArticleTypeData(articleTypeSlug, locale);
|
|
207
|
+
if (!(articleType &&
|
|
208
|
+
(customType || !constants.requireCustomTypeForArticleTypes) &&
|
|
209
|
+
articleType.contents?.length)) {
|
|
210
|
+
if (routeConfig.throwOnNotFound)
|
|
211
|
+
return notFound();
|
|
212
|
+
return undefined;
|
|
213
|
+
}
|
|
214
|
+
const analyticsContext = {
|
|
215
|
+
slug: path,
|
|
216
|
+
title: articleType.title,
|
|
217
|
+
type: 'article-type-index',
|
|
218
|
+
};
|
|
219
|
+
return (_jsx(LayoutComponent, { model: articleType, analyticsContext: analyticsContext, errors: errors, banners: banners, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: articleType.contents, rendererConfig: rendererConfig, pageContext: { articleType, customType }, analyticsContext: analyticsContext }) }));
|
|
220
|
+
}
|
|
221
|
+
catch (error) {
|
|
222
|
+
if (routeConfig.throwOnNotFound)
|
|
223
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
224
|
+
return undefined;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
// ============================================================================
|
|
228
|
+
// Article Type Tag
|
|
229
|
+
// ============================================================================
|
|
230
|
+
async function getArticleTypeTagData(articleTypeSlug, tagSlug, locale) {
|
|
231
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
232
|
+
const [articleTypeResponse, tagResponse, articleCustomTypeResponse, tagCustomTypeResponse, bannersResponse,] = await Promise.all([
|
|
233
|
+
getArticleTypeWithErrors(articleTypeSlug, {
|
|
234
|
+
...options,
|
|
235
|
+
customType: constants.articlesCustomTypeSlug,
|
|
236
|
+
}),
|
|
237
|
+
getTagWithErrors(tagSlug, { ...options, customType: constants.TAGS_SLUG }),
|
|
238
|
+
constants.articlesCustomTypeSlug
|
|
239
|
+
? getCustomTypeWithErrors(constants.articlesCustomTypeSlug, options)
|
|
240
|
+
: Promise.resolve({ data: undefined, errors: [] }),
|
|
241
|
+
getCustomTypeWithErrors(constants.TAGS_SLUG, options),
|
|
242
|
+
getBannersWithErrors(options),
|
|
243
|
+
]);
|
|
244
|
+
return {
|
|
245
|
+
articleType: articleTypeResponse.data,
|
|
246
|
+
tag: tagResponse.data,
|
|
247
|
+
articleCustomType: articleCustomTypeResponse.data,
|
|
248
|
+
tagCustomType: tagCustomTypeResponse.data,
|
|
249
|
+
banners: bannersResponse.data,
|
|
250
|
+
errors: [
|
|
251
|
+
...articleTypeResponse.errors,
|
|
252
|
+
...tagResponse.errors,
|
|
253
|
+
...articleCustomTypeResponse.errors,
|
|
254
|
+
...tagCustomTypeResponse.errors,
|
|
255
|
+
...bannersResponse.errors,
|
|
256
|
+
],
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
async function generateArticleTypeTagMetadata(articleTypeSlug, tagSlug, path, routeConfig, parent, locale) {
|
|
260
|
+
const errorContext = { type: 'metadata', articleTypeSlug, tagSlug, path };
|
|
261
|
+
try {
|
|
262
|
+
const { articleType, tag, articleCustomType, tagCustomType } = await getArticleTypeTagData(articleTypeSlug, tagSlug, locale);
|
|
263
|
+
const hasArticleCustomType = constants.articlesCustomTypeSlug ? !!articleCustomType : true;
|
|
264
|
+
if (!(articleType && tag && hasArticleCustomType && tagCustomType)) {
|
|
265
|
+
if (routeConfig.throwOnNotFound)
|
|
266
|
+
return notFound();
|
|
267
|
+
return undefined;
|
|
268
|
+
}
|
|
269
|
+
const { title, description } = calculateTitleAndDescription({
|
|
270
|
+
articleType: articleType,
|
|
271
|
+
tag: tag,
|
|
272
|
+
customType: (articleCustomType ?? tagCustomType),
|
|
273
|
+
});
|
|
274
|
+
const model = {
|
|
275
|
+
indexed: tag.indexed &&
|
|
276
|
+
articleType.indexed &&
|
|
277
|
+
(articleCustomType?.indexed ?? true) &&
|
|
278
|
+
tagCustomType.indexed,
|
|
279
|
+
featuredImage: tag.featuredImage ??
|
|
280
|
+
articleType.featuredImage ??
|
|
281
|
+
tagCustomType.featuredImage ??
|
|
282
|
+
articleCustomType?.featuredImage,
|
|
283
|
+
title,
|
|
284
|
+
description,
|
|
285
|
+
};
|
|
286
|
+
const localeAlternates = locale ? buildLocaleAlternates(path, locale) : undefined;
|
|
287
|
+
return buildPageMetadata(model, path, buildInformation, parent, undefined, localeAlternates);
|
|
288
|
+
}
|
|
289
|
+
catch (error) {
|
|
290
|
+
if (routeConfig.throwOnNotFound)
|
|
291
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
292
|
+
return {};
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
async function generateArticleTypeTagPage(articleTypeSlug, tagSlug, path, routeConfig, locale) {
|
|
296
|
+
const errorContext = { type: 'article-type-tag', articleTypeSlug, tagSlug, path };
|
|
297
|
+
try {
|
|
298
|
+
const { articleType, tag, articleCustomType, tagCustomType, banners, errors } = await getArticleTypeTagData(articleTypeSlug, tagSlug, locale);
|
|
299
|
+
const hasArticleCustomType = constants.articlesCustomTypeSlug ? !!articleCustomType : true;
|
|
300
|
+
if (!(articleType &&
|
|
301
|
+
tag &&
|
|
302
|
+
hasArticleCustomType &&
|
|
303
|
+
tagCustomType &&
|
|
304
|
+
articleType.contents?.length)) {
|
|
305
|
+
if (routeConfig.throwOnNotFound)
|
|
306
|
+
return notFound();
|
|
307
|
+
return undefined;
|
|
308
|
+
}
|
|
309
|
+
const analyticsContext = {
|
|
310
|
+
slug: path,
|
|
311
|
+
title: `${tag.title} ${articleType.title}`,
|
|
312
|
+
type: 'article-type-tag-index',
|
|
313
|
+
};
|
|
314
|
+
return (_jsx(LayoutComponent, { model: articleType, analyticsContext: analyticsContext, errors: errors, banners: banners, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: articleType.contents ??
|
|
315
|
+
tag.contents ??
|
|
316
|
+
articleCustomType?.contents ??
|
|
317
|
+
tagCustomType.contents, rendererConfig: rendererConfig, pageContext: { articleType, tag, customType: articleCustomType ?? tagCustomType }, analyticsContext: analyticsContext }) }));
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
if (routeConfig.throwOnNotFound)
|
|
321
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
322
|
+
return undefined;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
// ============================================================================
|
|
326
|
+
// Article Types Index (uses ARTICLES_SLUG custom type)
|
|
327
|
+
// ============================================================================
|
|
328
|
+
async function getArticleTypesIndexData(locale) {
|
|
329
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
330
|
+
const response = await getCustomTypeWithErrors(constants.ARTICLES_SLUG, options);
|
|
331
|
+
return { customType: response.data, errors: response.errors };
|
|
332
|
+
}
|
|
333
|
+
async function generateArticleTypesIndexMetadata(path, routeConfig, parent, locale) {
|
|
334
|
+
const errorContext = { type: 'metadata', path };
|
|
335
|
+
try {
|
|
336
|
+
const { customType } = await getArticleTypesIndexData(locale);
|
|
337
|
+
if (!customType) {
|
|
338
|
+
if (routeConfig.throwOnNotFound)
|
|
339
|
+
return notFound();
|
|
340
|
+
return undefined;
|
|
341
|
+
}
|
|
342
|
+
const localeAlternates = locale ? buildLocaleAlternates(`${path}/`, locale) : undefined;
|
|
343
|
+
return buildPageMetadata(customType, `${path}/`, buildInformation, parent, undefined, localeAlternates);
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
if (routeConfig.throwOnNotFound)
|
|
347
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
348
|
+
return {};
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
async function generateArticleTypesIndexPage(path, routeConfig, locale) {
|
|
352
|
+
const errorContext = { type: 'customType', path };
|
|
353
|
+
try {
|
|
354
|
+
const { customType, errors } = await getArticleTypesIndexData(locale);
|
|
355
|
+
if (!customType?.contents?.length) {
|
|
356
|
+
if (routeConfig.throwOnNotFound)
|
|
357
|
+
return notFound();
|
|
358
|
+
return undefined;
|
|
359
|
+
}
|
|
360
|
+
const { title, description } = calculateTitleAndDescription({
|
|
361
|
+
customType: customType,
|
|
362
|
+
});
|
|
363
|
+
const analyticsContext = {
|
|
364
|
+
slug: constants.ARTICLES_SLUG,
|
|
365
|
+
title: customType.title,
|
|
366
|
+
type: 'article-types-index',
|
|
367
|
+
};
|
|
368
|
+
const model = { ...customType, title, description };
|
|
369
|
+
return (_jsx(LayoutComponent, { model: model, analyticsContext: analyticsContext, errors: errors, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: customType.contents, rendererConfig: rendererConfig, pageContext: { customType }, analyticsContext: analyticsContext }) }));
|
|
370
|
+
}
|
|
371
|
+
catch (error) {
|
|
372
|
+
if (routeConfig.throwOnNotFound)
|
|
373
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
374
|
+
return undefined;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
// ============================================================================
|
|
378
|
+
// Tag
|
|
379
|
+
// ============================================================================
|
|
380
|
+
async function getTagData(topic, locale) {
|
|
381
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
382
|
+
const [tagResponse, customTypeResponse, bannersResponse] = await Promise.all([
|
|
383
|
+
getTagWithErrors(topic, { ...options, customType: constants.TAGS_SLUG }),
|
|
384
|
+
getCustomTypeWithErrors(constants.TAGS_SLUG, options),
|
|
385
|
+
getBannersWithErrors(options),
|
|
386
|
+
]);
|
|
387
|
+
return {
|
|
388
|
+
tag: tagResponse.data,
|
|
389
|
+
customType: customTypeResponse.data,
|
|
390
|
+
banners: bannersResponse.data,
|
|
391
|
+
errors: [...tagResponse.errors, ...customTypeResponse.errors, ...bannersResponse.errors],
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
async function generateTagMetadata(tagSlug, path, routeConfig, parent, locale) {
|
|
395
|
+
if (!constants.enableTag)
|
|
396
|
+
return {};
|
|
397
|
+
const errorContext = { type: 'metadata', tag: tagSlug, path };
|
|
398
|
+
try {
|
|
399
|
+
const { tag, customType } = await getTagData(tagSlug, locale);
|
|
400
|
+
if (!(tag && customType)) {
|
|
401
|
+
if (routeConfig.throwOnNotFound)
|
|
402
|
+
return notFound();
|
|
403
|
+
return undefined;
|
|
404
|
+
}
|
|
405
|
+
const { title, description } = calculateTitleAndDescription({
|
|
406
|
+
tag: tag,
|
|
407
|
+
customType: customType,
|
|
408
|
+
});
|
|
409
|
+
const model = {
|
|
410
|
+
indexed: tag.indexed && customType.indexed,
|
|
411
|
+
featuredImage: tag.featuredImage ?? customType.featuredImage,
|
|
412
|
+
title,
|
|
413
|
+
description,
|
|
414
|
+
};
|
|
415
|
+
const localeAlternates = locale ? buildLocaleAlternates(path, locale) : undefined;
|
|
416
|
+
return buildPageMetadata(model, path, buildInformation, parent, undefined, localeAlternates);
|
|
417
|
+
}
|
|
418
|
+
catch (error) {
|
|
419
|
+
if (routeConfig.throwOnNotFound)
|
|
420
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
421
|
+
return {};
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
async function generateTagPage(tagSlug, path, routeConfig, locale) {
|
|
425
|
+
if (!constants.enableTag)
|
|
426
|
+
return notFound();
|
|
427
|
+
const errorContext = { type: 'tag', tag: tagSlug, path };
|
|
428
|
+
try {
|
|
429
|
+
const { tag, customType, banners, errors } = await getTagData(tagSlug, locale);
|
|
430
|
+
if (!(tag && customType && tag.contents?.length)) {
|
|
431
|
+
if (routeConfig.throwOnNotFound)
|
|
432
|
+
return notFound();
|
|
433
|
+
return undefined;
|
|
434
|
+
}
|
|
435
|
+
const analyticsContext = {
|
|
436
|
+
slug: path,
|
|
437
|
+
title: tag.title,
|
|
438
|
+
type: 'tag-index',
|
|
439
|
+
};
|
|
440
|
+
return (_jsx(LayoutComponent, { model: tag, analyticsContext: analyticsContext, errors: errors, banners: banners, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: tag.contents, rendererConfig: rendererConfig, pageContext: { tag, customType }, analyticsContext: analyticsContext }) }));
|
|
441
|
+
}
|
|
442
|
+
catch (error) {
|
|
443
|
+
if (routeConfig.throwOnNotFound)
|
|
444
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
445
|
+
return undefined;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
// ============================================================================
|
|
449
|
+
// Tags Index (uses TAGS_SLUG custom type)
|
|
450
|
+
// ============================================================================
|
|
451
|
+
async function getTagsIndexData(locale) {
|
|
452
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
453
|
+
const response = await getCustomTypeWithErrors(constants.TAGS_SLUG, options);
|
|
454
|
+
return { customType: response.data, errors: response.errors };
|
|
455
|
+
}
|
|
456
|
+
async function generateTagsIndexMetadata(path, routeConfig, parent, locale) {
|
|
457
|
+
if (!constants.enableTagsIndex)
|
|
458
|
+
return {};
|
|
459
|
+
const errorContext = { type: 'metadata', path };
|
|
460
|
+
try {
|
|
461
|
+
const { customType } = await getTagsIndexData(locale);
|
|
462
|
+
if (!customType) {
|
|
463
|
+
if (routeConfig.throwOnNotFound)
|
|
464
|
+
return notFound();
|
|
465
|
+
return undefined;
|
|
466
|
+
}
|
|
467
|
+
const localeAlternates = locale ? buildLocaleAlternates(`${path}/`, locale) : undefined;
|
|
468
|
+
return buildPageMetadata(customType, `${path}/`, buildInformation, parent, undefined, localeAlternates);
|
|
469
|
+
}
|
|
470
|
+
catch (error) {
|
|
471
|
+
if (routeConfig.throwOnNotFound)
|
|
472
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
473
|
+
return {};
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
async function generateTagsIndexPage(path, routeConfig, locale) {
|
|
477
|
+
if (!constants.enableTagsIndex)
|
|
478
|
+
return notFound();
|
|
479
|
+
const errorContext = { type: 'customType', path };
|
|
480
|
+
try {
|
|
481
|
+
const { customType, errors } = await getTagsIndexData(locale);
|
|
482
|
+
if (!customType?.contents?.length) {
|
|
483
|
+
if (routeConfig.throwOnNotFound)
|
|
484
|
+
return notFound();
|
|
485
|
+
return undefined;
|
|
486
|
+
}
|
|
487
|
+
const analyticsContext = {
|
|
488
|
+
slug: constants.TAGS_SLUG,
|
|
489
|
+
title: customType.title,
|
|
490
|
+
type: 'tags-index',
|
|
491
|
+
};
|
|
492
|
+
const model = { ...customType };
|
|
493
|
+
return (_jsx(LayoutComponent, { model: model, analyticsContext: analyticsContext, errors: errors, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: customType.contents, rendererConfig: rendererConfig, pageContext: { customType }, analyticsContext: analyticsContext }) }));
|
|
494
|
+
}
|
|
495
|
+
catch (error) {
|
|
496
|
+
if (routeConfig.throwOnNotFound)
|
|
497
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
498
|
+
return undefined;
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
// ============================================================================
|
|
502
|
+
// Person
|
|
503
|
+
// ============================================================================
|
|
504
|
+
async function getPersonData(slug, locale) {
|
|
505
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
506
|
+
const [personResponse, customTypeResponse, bannersResponse] = await Promise.all([
|
|
507
|
+
getPersonWithErrors(slug, { ...options, customType: constants.PEOPLE_SLUG }),
|
|
508
|
+
getCustomTypeWithErrors(constants.PEOPLE_SLUG, options),
|
|
509
|
+
getBannersWithErrors(options),
|
|
510
|
+
]);
|
|
511
|
+
return {
|
|
512
|
+
person: personResponse.data,
|
|
513
|
+
customType: customTypeResponse.data,
|
|
514
|
+
banners: bannersResponse.data,
|
|
515
|
+
errors: [...personResponse.errors, ...customTypeResponse.errors, ...bannersResponse.errors],
|
|
516
|
+
};
|
|
517
|
+
}
|
|
518
|
+
async function generatePersonMetadata(personSlug, path, routeConfig, parent, locale) {
|
|
519
|
+
const errorContext = { type: 'metadata', person: personSlug, path };
|
|
520
|
+
try {
|
|
521
|
+
const { person, customType } = await getPersonData(personSlug, locale);
|
|
522
|
+
if (!(person && customType)) {
|
|
523
|
+
if (routeConfig.throwOnNotFound)
|
|
524
|
+
return notFound();
|
|
525
|
+
return undefined;
|
|
526
|
+
}
|
|
527
|
+
const { title, description } = calculateTitleAndDescription({
|
|
528
|
+
person: person,
|
|
529
|
+
customType: customType,
|
|
530
|
+
});
|
|
531
|
+
const model = {
|
|
532
|
+
indexed: person.indexed && customType.indexed,
|
|
533
|
+
featuredImage: person.featuredImage ?? customType.featuredImage,
|
|
534
|
+
title,
|
|
535
|
+
description,
|
|
536
|
+
};
|
|
537
|
+
const localeAlternates = locale ? buildLocaleAlternates(path, locale) : undefined;
|
|
538
|
+
return buildPageMetadata(model, path, buildInformation, parent, constants.enablePerson, localeAlternates);
|
|
539
|
+
}
|
|
540
|
+
catch (error) {
|
|
541
|
+
if (routeConfig.throwOnNotFound)
|
|
542
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
543
|
+
return {};
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
async function generatePersonPage(personSlug, path, routeConfig, locale) {
|
|
547
|
+
const errorContext = { type: 'person', person: personSlug, path };
|
|
548
|
+
try {
|
|
549
|
+
const { person, customType, banners, errors } = await getPersonData(personSlug, locale);
|
|
550
|
+
if (!(person && customType)) {
|
|
551
|
+
if (routeConfig.throwOnNotFound)
|
|
552
|
+
return notFound();
|
|
553
|
+
return undefined;
|
|
554
|
+
}
|
|
555
|
+
const analyticsContext = {
|
|
556
|
+
slug: path,
|
|
557
|
+
title: person.title,
|
|
558
|
+
type: 'person',
|
|
559
|
+
};
|
|
560
|
+
return (_jsx(LayoutComponent, { model: person, analyticsContext: analyticsContext, errors: errors, banners: banners, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: person.contents, rendererConfig: rendererConfig, pageContext: { person, customType }, analyticsContext: analyticsContext }) }));
|
|
561
|
+
}
|
|
562
|
+
catch (error) {
|
|
563
|
+
if (routeConfig.throwOnNotFound)
|
|
564
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
565
|
+
return undefined;
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
// ============================================================================
|
|
569
|
+
// Team Index (uses PEOPLE_SLUG custom type)
|
|
570
|
+
// ============================================================================
|
|
571
|
+
async function getTeamIndexData(locale) {
|
|
572
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
573
|
+
const response = await getCustomTypeWithErrors(constants.PEOPLE_SLUG, options);
|
|
574
|
+
return { customType: response.data, errors: response.errors };
|
|
575
|
+
}
|
|
576
|
+
async function generateTeamIndexMetadata(path, routeConfig, parent, locale) {
|
|
577
|
+
const errorContext = { type: 'metadata', path };
|
|
578
|
+
try {
|
|
579
|
+
const { customType } = await getTeamIndexData(locale);
|
|
580
|
+
if (!customType) {
|
|
581
|
+
if (routeConfig.throwOnNotFound)
|
|
582
|
+
return notFound();
|
|
583
|
+
return undefined;
|
|
584
|
+
}
|
|
585
|
+
const localeAlternates = locale ? buildLocaleAlternates(`${path}/`, locale) : undefined;
|
|
586
|
+
return buildPageMetadata(customType, `${path}/`, buildInformation, parent, undefined, localeAlternates);
|
|
587
|
+
}
|
|
588
|
+
catch (error) {
|
|
589
|
+
if (routeConfig.throwOnNotFound)
|
|
590
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
591
|
+
return {};
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
async function generateTeamIndexPage(path, routeConfig, locale) {
|
|
595
|
+
const errorContext = { type: 'customType', path };
|
|
596
|
+
try {
|
|
597
|
+
const { customType, errors } = await getTeamIndexData(locale);
|
|
598
|
+
if (!customType?.contents?.length) {
|
|
599
|
+
if (routeConfig.throwOnNotFound)
|
|
600
|
+
return notFound();
|
|
601
|
+
return undefined;
|
|
602
|
+
}
|
|
603
|
+
const analyticsContext = {
|
|
604
|
+
slug: constants.PEOPLE_SLUG,
|
|
605
|
+
title: customType.title,
|
|
606
|
+
type: 'team-index',
|
|
607
|
+
};
|
|
608
|
+
const model = { ...customType };
|
|
609
|
+
return (_jsx(LayoutComponent, { model: model, analyticsContext: analyticsContext, errors: errors, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: customType.contents, rendererConfig: rendererConfig, pageContext: { customType }, analyticsContext: analyticsContext }) }));
|
|
610
|
+
}
|
|
611
|
+
catch (error) {
|
|
612
|
+
if (routeConfig.throwOnNotFound)
|
|
613
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
614
|
+
return undefined;
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
// ============================================================================
|
|
618
|
+
// Custom Type (generic page backed by a custom type slug)
|
|
619
|
+
// ============================================================================
|
|
620
|
+
async function getCustomTypePageData(customTypeSlug, locale) {
|
|
621
|
+
const options = buildOptions(locale ? { locale } : undefined);
|
|
622
|
+
const [customTypeResponse, bannersResponse] = await Promise.all([
|
|
623
|
+
getCustomTypeWithErrors(customTypeSlug, options),
|
|
624
|
+
getBannersWithErrors(options),
|
|
625
|
+
]);
|
|
626
|
+
return {
|
|
627
|
+
customType: customTypeResponse.data,
|
|
628
|
+
banners: bannersResponse.data,
|
|
629
|
+
errors: [...customTypeResponse.errors, ...bannersResponse.errors],
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
async function generateCustomTypeMetadata(customTypeSlug, path, routeConfig, parent, locale) {
|
|
633
|
+
const errorContext = { type: 'metadata', customTypeSlug, path };
|
|
634
|
+
try {
|
|
635
|
+
const { customType } = await getCustomTypePageData(customTypeSlug, locale);
|
|
636
|
+
if (!customType) {
|
|
637
|
+
if (routeConfig.throwOnNotFound)
|
|
638
|
+
return notFound();
|
|
639
|
+
return undefined;
|
|
640
|
+
}
|
|
641
|
+
const localeAlternates = locale ? buildLocaleAlternates(path, locale) : undefined;
|
|
642
|
+
return buildPageMetadata(customType, path, buildInformation, parent, undefined, localeAlternates);
|
|
643
|
+
}
|
|
644
|
+
catch (error) {
|
|
645
|
+
if (routeConfig.throwOnNotFound)
|
|
646
|
+
handleCmsError(error, errorContext, buildInformation);
|
|
647
|
+
return {};
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
async function generateCustomTypePage(customTypeSlug, path, routeConfig, locale) {
|
|
651
|
+
const errorContext = { type: 'customType', customTypeSlug, path };
|
|
652
|
+
try {
|
|
653
|
+
const { customType, banners, errors } = await getCustomTypePageData(customTypeSlug, locale);
|
|
654
|
+
if (!customType) {
|
|
655
|
+
if (routeConfig.throwOnNotFound)
|
|
656
|
+
return notFound();
|
|
657
|
+
return undefined;
|
|
658
|
+
}
|
|
659
|
+
const analyticsContext = {
|
|
660
|
+
slug: path,
|
|
661
|
+
title: customType.title,
|
|
662
|
+
type: 'custom-type-index',
|
|
663
|
+
};
|
|
664
|
+
return (_jsx(LayoutComponent, { model: customType, analyticsContext: analyticsContext, errors: errors, banners: banners, previewHelpers: rendererConfig.previewHelpers, breadcrumbOptions: toBreadcrumbOptions(routeConfig), children: _jsx(CmsContent, { contents: customType.contents, rendererConfig: rendererConfig, pageContext: { customType }, analyticsContext: analyticsContext }) }));
|
|
665
|
+
}
|
|
666
|
+
catch (error) {
|
|
667
|
+
if (routeConfig.throwOnNotFound)
|
|
668
|
+
return handleCmsError(error, errorContext, buildInformation);
|
|
669
|
+
return undefined;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
// ============================================================================
|
|
673
|
+
return {
|
|
674
|
+
buildLocaleAlternates,
|
|
675
|
+
generatePage,
|
|
676
|
+
generatePageMetadata,
|
|
677
|
+
generateArticlePage,
|
|
678
|
+
generateArticleMetadata,
|
|
679
|
+
generateArticleTypePage,
|
|
680
|
+
generateArticleTypeMetadata,
|
|
681
|
+
generateArticleTypeTagPage,
|
|
682
|
+
generateArticleTypeTagMetadata,
|
|
683
|
+
generateArticleTypesIndexPage,
|
|
684
|
+
generateArticleTypesIndexMetadata,
|
|
685
|
+
generateTagPage,
|
|
686
|
+
generateTagMetadata,
|
|
687
|
+
generateTagsIndexPage,
|
|
688
|
+
generateTagsIndexMetadata,
|
|
689
|
+
generatePersonPage,
|
|
690
|
+
generatePersonMetadata,
|
|
691
|
+
generateTeamIndexPage,
|
|
692
|
+
generateTeamIndexMetadata,
|
|
693
|
+
generateCustomTypePage,
|
|
694
|
+
generateCustomTypeMetadata,
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
//# sourceMappingURL=route-handlers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-handlers.js","sourceRoot":"","sources":["../../src/server/route-handlers.tsx"],"names":[],"mappings":";AAmBA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAsDpD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,mBAAmB,CAOjC,MAAsF;IACtF,MAAM,EACJ,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,wBAAwB,EACxB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,SAAS,GACV,GAAG,MAAM,CAAC;IAEX,+EAA+E;IAC/E,iBAAiB;IACjB,+EAA+E;IAE/E,uDAAuD;IACvD,SAAS,qBAAqB,CAAC,IAAY,EAAE,MAAc;QACzD,MAAM,YAAY,GAAG,gBAAgB,CAAC,YAAY,C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,OAAO,CACL,KAAC,eAAe,IACd,KAAK,EAAE,UAAU,EACjB,gBAAgB,EAAE,gBAAgB,EAClC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,CAAC,cAAc,EAC7C,iBAAiB,EAAE,mBAAmB,CAAC,WAAW,CAAC,YAEnD,KAAC,UAAU,IACT,QAAQ,EAAG,UAAkB,CAAC,QAAQ,EACtC,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,EAAE,UAAU,EAAE,EAC3B,gBAAgB,EAAE,gBAAgB,GAClC,GACc,CACnB,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,WAAW,CAAC,eAAe;gBAAE,OAAO,cAAc,CAAC,KAAK,EAAE,YAAY,EAAE,gBAAgB,CAAC,CAAC;YAC9F,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IAED,+EAA+E;IAE/E,OAAO;QACL,qBAAqB;QACrB,YAAY;QACZ,oBAAoB;QACpB,mBAAmB;QACnB,uBAAuB;QACvB,uBAAuB;QACvB,2BAA2B;QAC3B,0BAA0B;QAC1B,8BAA8B;QAC9B,6BAA6B;QAC7B,iCAAiC;QACjC,eAAe;QACf,mBAAmB;QACnB,qBAAqB;QACrB,yBAAyB;QACzB,kBAAkB;QAClB,sBAAsB;QACtB,qBAAqB;QACrB,yBAAyB;QACzB,sBAAsB;QACtB,0BAA0B;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CmsError } from '@se-studio/contentful-rest-api';
|
|
2
|
+
import type { IAnalyticsContext, IBanner, IBaseModel } from '@se-studio/core-data-types';
|
|
3
|
+
import type { ReactNode } from 'react';
|
|
4
|
+
import type { PreviewHelpers } from '../CmsRendererConfig';
|
|
5
|
+
/**
|
|
6
|
+
* Per-route configuration for CMS-driven pages.
|
|
7
|
+
* Passed from page.ts into generate*Metadata and generate*Page.
|
|
8
|
+
*/
|
|
9
|
+
export interface CmsRouteConfig {
|
|
10
|
+
throwOnNotFound: boolean;
|
|
11
|
+
showBreadcrumbs: boolean;
|
|
12
|
+
truncateBreadcrumbs: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Options passed to BasicLayout / Navigation for breadcrumb display.
|
|
16
|
+
* Derived from CmsRouteConfig when calling layout.
|
|
17
|
+
*/
|
|
18
|
+
export interface BreadcrumbOptions {
|
|
19
|
+
show: boolean;
|
|
20
|
+
truncate: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare function toBreadcrumbOptions(config: CmsRouteConfig): BreadcrumbOptions;
|
|
23
|
+
/**
|
|
24
|
+
* Minimum props contract for the app-level BasicLayout component.
|
|
25
|
+
* Apps may extend IBaseModel internally (e.g. with colour or project-specific fields),
|
|
26
|
+
* but the factory only requires the base shape. Use `model: any` in LayoutComponent
|
|
27
|
+
* to avoid contravariance errors when apps use a narrower model type.
|
|
28
|
+
*/
|
|
29
|
+
export interface BasicLayoutProps {
|
|
30
|
+
model: IBaseModel;
|
|
31
|
+
analyticsContext?: IAnalyticsContext;
|
|
32
|
+
errors?: CmsError[];
|
|
33
|
+
banners?: IBanner[] | null;
|
|
34
|
+
previewHelpers: PreviewHelpers;
|
|
35
|
+
breadcrumbOptions?: BreadcrumbOptions;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=route-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-types.d.ts","sourceRoot":"","sources":["../../src/server/route-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,iBAAiB,CAE7E;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,UAAU,CAAC;IAClB,gBAAgB,CAAC,EAAE,iBAAiB,CAAC;IACrC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC;IACpB,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,QAAQ,EAAE,SAAS,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-types.js","sourceRoot":"","sources":["../../src/server/route-types.ts"],"names":[],"mappings":"AAwBA,MAAM,UAAU,mBAAmB,CAAC,MAAsB;IACxD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,eAAe,EAAE,QAAQ,EAAE,MAAM,CAAC,mBAAmB,EAAE,CAAC;AAChF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@se-studio/core-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "Shared React UI component library with Tailwind CSS v4 for SE Studio applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
17
|
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./server": {
|
|
20
|
+
"types": "./dist/server/index.d.ts",
|
|
21
|
+
"import": "./dist/server/index.js"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"files": [
|
|
@@ -50,6 +54,7 @@
|
|
|
50
54
|
},
|
|
51
55
|
"dependencies": {
|
|
52
56
|
"@contentful/live-preview": "^4.9.6",
|
|
57
|
+
"server-only": "0.0.1",
|
|
53
58
|
"@contentful/rich-text-react-renderer": "^16.1.6",
|
|
54
59
|
"@contentful/rich-text-types": "^17.2.5",
|
|
55
60
|
"@extractus/oembed-extractor": "^4.0.9",
|
|
@@ -60,8 +65,8 @@
|
|
|
60
65
|
"html-entities": "^2.6.0",
|
|
61
66
|
"mustache": "4.2.0",
|
|
62
67
|
"tailwind-merge": "^3.5.0",
|
|
63
|
-
"@se-studio/contentful-rest-api": "1.0.
|
|
64
|
-
"@se-studio/core-data-types": "1.0.
|
|
68
|
+
"@se-studio/contentful-rest-api": "1.0.91",
|
|
69
|
+
"@se-studio/core-data-types": "1.0.91"
|
|
65
70
|
},
|
|
66
71
|
"devDependencies": {
|
|
67
72
|
"@biomejs/biome": "^2.4.4",
|