@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.
@@ -5,9 +5,42 @@ export type StateMode = 'draft' | 'production';
5
5
  export interface PageTemplateConfig {
6
6
  isTemplate?: boolean;
7
7
  displayTemplateId?: string;
8
- dataSourceId?: string;
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,5 @@
1
+ export declare const PAGE_CONTENT_WRITER_AGENT_ID = "page-content-writer";
2
+ export declare const AGENT_OPTIONS: {
3
+ id: string;
4
+ name: string;
5
+ }[];
@@ -42,4 +42,5 @@ export declare const BuiltinModules: {
42
42
  '@blocklet/pages-kit/builtin/async/ai-runtime': {};
43
43
  '@blocklet/pages-kit/builtin/uploader': {};
44
44
  '@blocklet/pages-kit/builtin/color-picker': {};
45
+ '@blocklet/pages-kit/builtin/markdown/index': {};
45
46
  };
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit",
3
- "version": "0.4.117",
3
+ "version": "0.4.118",
4
4
  "description": "Pages Kit components and utils for blocklet(s)",
5
5
  "publishConfig": {
6
6
  "access": "public"