@blocklet/pages-kit 0.4.116 → 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.
Files changed (34) hide show
  1. package/lib/cjs/builtin/async/rehype-mermaid.js +26 -0
  2. package/lib/cjs/builtin/markdown/action-button.js +41 -0
  3. package/lib/cjs/builtin/markdown/index.js +13 -0
  4. package/lib/cjs/builtin/markdown/loading-button.js +19 -0
  5. package/lib/cjs/builtin/markdown/markdown-context.js +17 -0
  6. package/lib/cjs/builtin/markdown/markdown-renderer.js +156 -0
  7. package/lib/cjs/tsconfig.tsbuildinfo +1 -1
  8. package/lib/cjs/utils/agent.js +5 -0
  9. package/lib/cjs/utils/builtin.js +1 -0
  10. package/lib/cjs/utils/data-source.js +70 -0
  11. package/lib/cjs/utils/inject-global-components.js +2 -0
  12. package/lib/esm/builtin/async/rehype-mermaid.js +1 -0
  13. package/lib/esm/builtin/markdown/action-button.js +35 -0
  14. package/lib/esm/builtin/markdown/index.js +4 -0
  15. package/lib/esm/builtin/markdown/loading-button.js +17 -0
  16. package/lib/esm/builtin/markdown/markdown-context.js +12 -0
  17. package/lib/esm/builtin/markdown/markdown-renderer.js +128 -0
  18. package/lib/esm/tsconfig.tsbuildinfo +1 -1
  19. package/lib/esm/utils/agent.js +2 -0
  20. package/lib/esm/utils/builtin.js +1 -0
  21. package/lib/esm/utils/data-source.js +67 -0
  22. package/lib/esm/utils/inject-global-components.js +2 -0
  23. package/lib/types/builtin/async/rehype-mermaid.d.ts +2 -0
  24. package/lib/types/builtin/markdown/action-button.d.ts +13 -0
  25. package/lib/types/builtin/markdown/index.d.ts +5 -0
  26. package/lib/types/builtin/markdown/loading-button.d.ts +3 -0
  27. package/lib/types/builtin/markdown/markdown-context.d.ts +16 -0
  28. package/lib/types/builtin/markdown/markdown-renderer.d.ts +12 -0
  29. package/lib/types/tsconfig.tsbuildinfo +1 -1
  30. package/lib/types/types/state.d.ts +36 -1
  31. package/lib/types/utils/agent.d.ts +5 -0
  32. package/lib/types/utils/builtin.d.ts +1 -0
  33. package/lib/types/utils/data-source.d.ts +8 -0
  34. package/package.json +9 -8
@@ -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.116",
3
+ "version": "0.4.118",
4
4
  "description": "Pages Kit components and utils for blocklet(s)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -100,7 +100,7 @@
100
100
  "url": "git+https://github.com/blocklet/pages-kit.git"
101
101
  },
102
102
  "dependencies": {
103
- "@arcblock/did-connect": "^2.12.72",
103
+ "@arcblock/did-connect": "^2.12.74",
104
104
  "@blocklet/ai-kit": "^0.1.72",
105
105
  "@blocklet/js-sdk": "^1.16.41",
106
106
  "@blocklet/sdk": "^1.16.41",
@@ -135,13 +135,14 @@
135
135
  "react-frame-component": "^5.2.7",
136
136
  "react-helmet": "^6.1.0",
137
137
  "react-hook-form": "^7.52.2",
138
- "react-markdown": "^9.0.1",
138
+ "react-markdown": "^10.1.0",
139
139
  "react-promise-suspense": "^0.3.4",
140
140
  "react-scroll-to-bottom": "^4.2.0",
141
141
  "react-share": "^5.1.0",
142
- "react-syntax-highlighter": "^15.5.0",
142
+ "react-syntax-highlighter": "^15.6.1",
143
143
  "react-transition-group": "^4.4.5",
144
144
  "react-wrap-balancer": "^1.1.1",
145
+ "rehype-mermaid": "^3.0.0",
145
146
  "remark-gfm": "^4.0.0",
146
147
  "tinycolor2": "^1.6.0",
147
148
  "typescript": "~5.5.4",
@@ -154,6 +155,7 @@
154
155
  "@blocklet/ai-runtime": "^0.4.80",
155
156
  "@blocklet/js-sdk": "^1.16.33",
156
157
  "@blocklet/sdk": "^1.16.33",
158
+ "@blocklet/uploader": "^0.1.82",
157
159
  "@emotion/cache": "^11.11.0",
158
160
  "@emotion/css": "^11.11.2",
159
161
  "@emotion/react": "^11.11.1",
@@ -162,13 +164,12 @@
162
164
  "@mui/material": "^5.16.14",
163
165
  "axios": "^1.6.5",
164
166
  "react": "^18.2.0",
167
+ "react-best-gradient-color-picker": "^3.0.14",
165
168
  "react-dom": "^18.2.0",
166
- "react-router-dom": "^6.16.0",
167
- "@blocklet/uploader": "^0.1.82",
168
- "react-best-gradient-color-picker": "^3.0.14"
169
+ "react-router-dom": "^6.16.0"
169
170
  },
170
171
  "devDependencies": {
171
- "@arcblock/ux": "^2.12.72",
172
+ "@arcblock/ux": "^2.12.74",
172
173
  "@blocklet/ai-runtime": "^0.4.256",
173
174
  "@blocklet/js-sdk": "^1.16.41",
174
175
  "@blocklet/sdk": "^1.16.41",