@blocklet/pages-kit 0.4.83 → 0.4.84

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.
@@ -12,6 +12,7 @@ export type CustomComponent = {
12
12
  } | {
13
13
  type: 'react-component';
14
14
  script?: string;
15
+ chunks?: string[];
15
16
  } | {
16
17
  type: 'component';
17
18
  componentId?: string;
@@ -1 +1,85 @@
1
+ import { CustomComponent } from './core';
2
+ export type PublishMode = 'production';
1
3
  export type StateMode = 'draft' | 'production';
4
+ export interface Page {
5
+ id: string;
6
+ createdAt: string;
7
+ updatedAt: string;
8
+ publishedAt: string;
9
+ isPublic: boolean;
10
+ isTemplate?: boolean;
11
+ slug: string;
12
+ sections: Record<string, Section>;
13
+ sectionIds: string[];
14
+ locales?: Record<string, {
15
+ title?: string;
16
+ description?: string;
17
+ backgroundColor?: string;
18
+ image?: string;
19
+ }>;
20
+ }
21
+ export interface Chunk {
22
+ id: string;
23
+ code?: string;
24
+ }
25
+ export interface Section<T = {
26
+ [key: string]: any;
27
+ }> {
28
+ id: string;
29
+ component: string;
30
+ config?: T;
31
+ name?: string;
32
+ isTemplateSection?: boolean;
33
+ templateDescription?: string;
34
+ llmConfig?: {
35
+ properties: Record<string, {
36
+ key: string;
37
+ isNeedGenerate: boolean;
38
+ displayName?: string;
39
+ describe: string;
40
+ subProperties?: Record<string, {
41
+ key: string;
42
+ isNeedGenerate: boolean;
43
+ describe: string;
44
+ subProperties?: Record<string, any>;
45
+ }>;
46
+ }>;
47
+ };
48
+ visibility?: 'visible' | 'hidden';
49
+ locales?: Record<string, T>;
50
+ }
51
+ export type State = {
52
+ pageIds: string[];
53
+ pages: Record<string, Page | undefined>;
54
+ components: Record<string, {
55
+ index: number;
56
+ data: CustomComponent;
57
+ }>;
58
+ supportedLocales: {
59
+ locale: string;
60
+ name: string;
61
+ isDefault?: boolean;
62
+ }[];
63
+ config: {
64
+ defaultLocale?: string;
65
+ fontFamily?: {
66
+ title?: string;
67
+ description?: string;
68
+ };
69
+ publishedAt?: number;
70
+ };
71
+ resources: {
72
+ pages?: Record<string, {
73
+ blockletId: string;
74
+ page: Page;
75
+ }>;
76
+ components?: Record<string, {
77
+ blockletId: string;
78
+ component: CustomComponent;
79
+ }>;
80
+ };
81
+ chunks?: Record<string, string>;
82
+ };
83
+ export interface SiteStateOptions {
84
+ path: string;
85
+ }
@@ -1,4 +1,5 @@
1
1
  import { CustomComponent } from '../types/core';
2
+ import { State } from '../types/state';
2
3
  export declare function componentUMDName({ componentId }: {
3
4
  componentId: string;
4
5
  }): string;
@@ -26,3 +27,8 @@ export declare function parsePropertyValue(property: NonNullable<CustomComponent
26
27
  defaultLocale?: string;
27
28
  }): any;
28
29
  export declare function assignNullableFields(properties: any, newProperties: any): any;
30
+ export declare function getComponentDependencies({ state, pageIds, componentIds, }: {
31
+ state: State;
32
+ pageIds?: string[];
33
+ componentIds?: string[];
34
+ }): string[];
@@ -0,0 +1,10 @@
1
+ export interface ChunksMap {
2
+ [entryName: string]: string[];
3
+ }
4
+ /**
5
+ * 直接分析文件内容,查找chunks引用
6
+ * @param ts TypeScript命名空间
7
+ * @param fileContent 文件内容
8
+ * @returns 找到的chunks名称数组(只包含basename)
9
+ */
10
+ export declare const analyzeFileChunks: (ts: typeof import("typescript"), fileContent: string) => string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/pages-kit",
3
- "version": "0.4.83",
3
+ "version": "0.4.84",
4
4
  "description": "Pages Kit components and utils for blocklet(s)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -92,7 +92,7 @@
92
92
  "url": "git+https://github.com/blocklet/pages-kit.git"
93
93
  },
94
94
  "dependencies": {
95
- "@arcblock/did-connect": "^2.12.43",
95
+ "@arcblock/did-connect": "^2.12.44",
96
96
  "@blocklet/ai-kit": "^0.1.72",
97
97
  "@blocklet/js-sdk": "^1.16.40",
98
98
  "@blocklet/sdk": "^1.16.40",
@@ -153,7 +153,7 @@
153
153
  "react-router-dom": "^6.16.0"
154
154
  },
155
155
  "devDependencies": {
156
- "@arcblock/ux": "^2.12.43",
156
+ "@arcblock/ux": "^2.12.44",
157
157
  "@blocklet/ai-runtime": "^0.4.254",
158
158
  "@blocklet/js-sdk": "^1.16.40",
159
159
  "@blocklet/sdk": "^1.16.40",