@blocklet/pages-kit 0.4.117 → 0.4.118
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/lib/cjs/tsconfig.tsbuildinfo +1 -1
- package/lib/cjs/utils/agent.js +5 -0
- package/lib/cjs/utils/builtin.js +1 -0
- package/lib/cjs/utils/data-source.js +70 -0
- package/lib/cjs/utils/inject-global-components.js +2 -0
- package/lib/esm/tsconfig.tsbuildinfo +1 -1
- package/lib/esm/utils/agent.js +2 -0
- package/lib/esm/utils/builtin.js +1 -0
- package/lib/esm/utils/data-source.js +67 -0
- package/lib/esm/utils/inject-global-components.js +2 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types/state.d.ts +36 -1
- package/lib/types/utils/agent.d.ts +5 -0
- package/lib/types/utils/builtin.d.ts +1 -0
- package/lib/types/utils/data-source.d.ts +8 -0
- package/package.json +1 -1
|
@@ -5,9 +5,42 @@ export type StateMode = 'draft' | 'production';
|
|
|
5
5
|
export interface PageTemplateConfig {
|
|
6
6
|
isTemplate?: boolean;
|
|
7
7
|
displayTemplateId?: string;
|
|
8
|
-
|
|
8
|
+
dataSourceIds?: string[];
|
|
9
|
+
enabledGenerate?: boolean;
|
|
10
|
+
agentId?: string;
|
|
9
11
|
dataSourceParameters?: Record<string, any>;
|
|
10
12
|
}
|
|
13
|
+
export interface RouteDataSource {
|
|
14
|
+
agentId?: string;
|
|
15
|
+
generateOnRender?: boolean;
|
|
16
|
+
dataSourceIds?: string[];
|
|
17
|
+
pathDataMappings?: {
|
|
18
|
+
[actualPath: string]: {
|
|
19
|
+
localesGeneratedAt?: Record<string, string>;
|
|
20
|
+
pageRule?: string;
|
|
21
|
+
dataCache?: Record<string, any>;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export type RouteParam = {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
index: number;
|
|
29
|
+
options?: string[];
|
|
30
|
+
};
|
|
31
|
+
export type PageRoute = {
|
|
32
|
+
id: string;
|
|
33
|
+
createdAt: string;
|
|
34
|
+
updatedAt: string;
|
|
35
|
+
publishedAt: string;
|
|
36
|
+
path: string;
|
|
37
|
+
params?: RouteParam[];
|
|
38
|
+
handler: string;
|
|
39
|
+
isPublic: boolean;
|
|
40
|
+
enabledGenerate?: boolean;
|
|
41
|
+
displayTemplateId?: string;
|
|
42
|
+
dataSource?: RouteDataSource;
|
|
43
|
+
};
|
|
11
44
|
export type Page = {
|
|
12
45
|
id: string;
|
|
13
46
|
createdAt: string;
|
|
@@ -69,6 +102,8 @@ export interface Section<T = {
|
|
|
69
102
|
export type State = {
|
|
70
103
|
pageIds: string[];
|
|
71
104
|
pages: Record<string, Page | undefined>;
|
|
105
|
+
routeIds: string[];
|
|
106
|
+
routes: Record<string, PageRoute | undefined>;
|
|
72
107
|
components: Record<string, {
|
|
73
108
|
index: number;
|
|
74
109
|
data: CustomComponent;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Page, State } from '../types/state';
|
|
2
|
+
export interface PageData {
|
|
3
|
+
title?: string;
|
|
4
|
+
image?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
sectionsData: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export declare function setPageDataSource(page: Page, state: State, locale: string, pageData: PageData): void;
|