@blocklet/pages-kit 0.4.117 → 0.4.119
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/components/CustomComponentRenderer/state.js +34 -4
- 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/cjs/utils/property.js +3 -1
- package/lib/cjs/utils/typescript/builtin-module-transformer.js +39 -17
- package/lib/esm/components/CustomComponentRenderer/state.js +34 -4
- 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/esm/utils/property.js +3 -1
- package/lib/esm/utils/typescript/builtin-module-transformer.js +36 -16
- package/lib/types/tsconfig.tsbuildinfo +1 -1
- package/lib/types/types/core.d.ts +1 -0
- 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/lib/types/utils/property.d.ts +1 -0
- package/lib/types/utils/typescript/builtin-module-transformer.d.ts +2 -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;
|
|
@@ -18,6 +18,7 @@ export declare function mergeComponent({ componentId, getComponent, locale, defa
|
|
|
18
18
|
props: {
|
|
19
19
|
[key: string]: any;
|
|
20
20
|
};
|
|
21
|
+
editComponent?: string;
|
|
21
22
|
} | null;
|
|
22
23
|
export declare const RenderNestedComponent = "__RENDER_NESTED_COMPONENT__";
|
|
23
24
|
export declare function safeJSONParse(value: string | Record<string, any>): any;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SourceFile, TransformerFactory } from 'typescript';
|
|
2
2
|
export declare const isRelativeModule: (moduleSpecifier: string) => boolean;
|
|
3
3
|
export declare const isAsyncModule: (moduleSpecifier: string) => boolean;
|
|
4
|
+
export declare const isBuiltinModule: (moduleSpecifier: string) => boolean;
|
|
4
5
|
export declare const createBuiltinModuleTransformer: (ts: typeof import("typescript")) => TransformerFactory<SourceFile>;
|
|
6
|
+
export declare const createWellKnownChunksTransformer: (ts: typeof import("typescript")) => TransformerFactory<SourceFile>;
|