@blocklet/pages-kit-runtime 0.1.1
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/LICENSE +13 -0
- package/lib/cjs/block-studio/build-lib.js +95 -0
- package/lib/cjs/block-studio/generate-wrapper-code.js +123 -0
- package/lib/cjs/block-studio/init-resource-router.js +166 -0
- package/lib/cjs/block-studio/plugins/_theme.js +7 -0
- package/lib/cjs/block-studio/plugins/index.js +19 -0
- package/lib/cjs/block-studio/plugins/vite-plugin-block-studio.js +176 -0
- package/lib/cjs/block-studio/plugins/vite-plugin-html-transform.js +245 -0
- package/lib/cjs/block-studio/plugins/vite-plugin-remote-script-localizer.js +211 -0
- package/lib/cjs/block-studio/utils.js +53 -0
- package/lib/cjs/client.js +24 -0
- package/lib/cjs/components/create-resource.js +32 -0
- package/lib/cjs/components/index.js +17 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/tsconfig.tsbuildinfo +1 -0
- package/lib/cjs/types/index.js +5 -0
- package/lib/cjs/utils/index.js +1 -0
- package/lib/esm/block-studio/build-lib.js +89 -0
- package/lib/esm/block-studio/generate-wrapper-code.js +87 -0
- package/lib/esm/block-studio/init-resource-router.js +124 -0
- package/lib/esm/block-studio/plugins/_theme.js +4 -0
- package/lib/esm/block-studio/plugins/index.js +3 -0
- package/lib/esm/block-studio/plugins/vite-plugin-block-studio.js +140 -0
- package/lib/esm/block-studio/plugins/vite-plugin-html-transform.js +241 -0
- package/lib/esm/block-studio/plugins/vite-plugin-remote-script-localizer.js +175 -0
- package/lib/esm/block-studio/utils.js +43 -0
- package/lib/esm/client.js +17 -0
- package/lib/esm/components/create-resource.js +29 -0
- package/lib/esm/components/index.js +1 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/tsconfig.tsbuildinfo +1 -0
- package/lib/esm/types/index.js +2 -0
- package/lib/esm/utils/index.js +1 -0
- package/lib/types/block-studio/build-lib.d.ts +3 -0
- package/lib/types/block-studio/generate-wrapper-code.d.ts +5 -0
- package/lib/types/block-studio/init-resource-router.d.ts +5 -0
- package/lib/types/block-studio/plugins/_theme.d.ts +1 -0
- package/lib/types/block-studio/plugins/index.d.ts +3 -0
- package/lib/types/block-studio/plugins/vite-plugin-block-studio.d.ts +6 -0
- package/lib/types/block-studio/plugins/vite-plugin-html-transform.d.ts +5 -0
- package/lib/types/block-studio/plugins/vite-plugin-remote-script-localizer.d.ts +8 -0
- package/lib/types/block-studio/utils.d.ts +14 -0
- package/lib/types/client.d.ts +11 -0
- package/lib/types/components/create-resource.d.ts +7 -0
- package/lib/types/components/index.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/tsconfig.tsbuildinfo +1 -0
- package/lib/types/types/index.d.ts +39 -0
- package/lib/types/utils/index.d.ts +0 -0
- package/package.json +169 -0
- package/tsconfig.json +13 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type StateMode = 'production' | 'draft';
|
|
2
|
+
export declare const STATE_MODES: StateMode[];
|
|
3
|
+
export type PublishMode = 'production';
|
|
4
|
+
export declare const PUBLISH_MODES: PublishMode[];
|
|
5
|
+
export type Page = {
|
|
6
|
+
id: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
publishedAt: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
sections: Record<string, Section>;
|
|
12
|
+
sectionIds: string[];
|
|
13
|
+
locales?: Record<string, {
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
backgroundColor?: string;
|
|
17
|
+
image?: string;
|
|
18
|
+
header?: {
|
|
19
|
+
sticky?: boolean;
|
|
20
|
+
translucent?: boolean;
|
|
21
|
+
hideNavMenus?: boolean;
|
|
22
|
+
translucentTextColor?: string;
|
|
23
|
+
};
|
|
24
|
+
footer?: {
|
|
25
|
+
hidden?: boolean;
|
|
26
|
+
};
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
export interface Section<T = {
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}> {
|
|
33
|
+
id: string;
|
|
34
|
+
component: string;
|
|
35
|
+
config?: T;
|
|
36
|
+
visibility?: 'visible' | 'hidden';
|
|
37
|
+
name?: string;
|
|
38
|
+
locales?: Record<string, T>;
|
|
39
|
+
}
|
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blocklet/pages-kit-runtime",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Pages Kit runtime",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
9
|
+
"homepage": "https://github.com/blocklet/pages-kit#readme",
|
|
10
|
+
"license": "ISC",
|
|
11
|
+
"main": "./lib/cjs/index.js",
|
|
12
|
+
"module": "./lib/esm/index.js",
|
|
13
|
+
"types": "./lib/types/index.d.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"import": "./lib/esm/index.js",
|
|
17
|
+
"require": "./lib/cjs/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./api": {
|
|
20
|
+
"import": "./lib/esm/api/index.js",
|
|
21
|
+
"require": "./lib/cjs/api/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./api/*": {
|
|
24
|
+
"import": "./lib/esm/api/*.js",
|
|
25
|
+
"require": "./lib/cjs/api/*.js"
|
|
26
|
+
},
|
|
27
|
+
"./builtin/*": {
|
|
28
|
+
"import": "./lib/esm/builtin/*.js",
|
|
29
|
+
"require": "./lib/cjs/builtin/*.js"
|
|
30
|
+
},
|
|
31
|
+
"./builtin/async/ai-runtime": {
|
|
32
|
+
"import": "./lib/esm/builtin/async/ai-runtime/index.js",
|
|
33
|
+
"require": "./lib/cjs/builtin/async/ai-runtime/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./components": {
|
|
36
|
+
"import": "./lib/esm/components/index.js",
|
|
37
|
+
"require": "./lib/cjs/components/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./types": {
|
|
40
|
+
"import": "./lib/esm/types/index.js",
|
|
41
|
+
"require": "./lib/cjs/types/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./types/*": {
|
|
44
|
+
"import": "./lib/esm/types/*.js",
|
|
45
|
+
"require": "./lib/cjs/types/*.js"
|
|
46
|
+
},
|
|
47
|
+
"./utils/*": {
|
|
48
|
+
"import": "./lib/esm/utils/*.js",
|
|
49
|
+
"require": "./lib/cjs/utils/*.js"
|
|
50
|
+
},
|
|
51
|
+
"./block-studio/plugins": {
|
|
52
|
+
"import": "./lib/esm/block-studio/plugins/index.js",
|
|
53
|
+
"require": "./lib/cjs/block-studio/plugins/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./block-studio/build-lib": {
|
|
56
|
+
"import": "./lib/esm/block-studio/build-lib.js",
|
|
57
|
+
"require": "./lib/cjs/block-studio/build-lib.js"
|
|
58
|
+
},
|
|
59
|
+
"./block-studio/init-resource-router": {
|
|
60
|
+
"import": "./lib/esm/block-studio/init-resource-router.js",
|
|
61
|
+
"require": "./lib/cjs/block-studio/init-resource-router.js"
|
|
62
|
+
},
|
|
63
|
+
"./block-studio/generate-wrapper-code": {
|
|
64
|
+
"import": "./lib/esm/block-studio/generate-wrapper-code.js",
|
|
65
|
+
"require": "./lib/cjs/block-studio/generate-wrapper-code.js"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"typesVersions": {
|
|
69
|
+
"*": {
|
|
70
|
+
"*": [
|
|
71
|
+
"./lib/types/index.d.ts"
|
|
72
|
+
],
|
|
73
|
+
"api": [
|
|
74
|
+
"./lib/types/api/index.d.ts"
|
|
75
|
+
],
|
|
76
|
+
"api/*": [
|
|
77
|
+
"./lib/types/api/*.d.ts",
|
|
78
|
+
"./lib/types/api/*/index.d.ts"
|
|
79
|
+
],
|
|
80
|
+
"builtin/*": [
|
|
81
|
+
"./lib/types/builtin/*.d.ts",
|
|
82
|
+
"./lib/types/builtin/*/index.d.ts"
|
|
83
|
+
],
|
|
84
|
+
"components": [
|
|
85
|
+
"./lib/types/components/index.d.ts"
|
|
86
|
+
],
|
|
87
|
+
"types": [
|
|
88
|
+
"./lib/types/types/index.d.ts"
|
|
89
|
+
],
|
|
90
|
+
"types/*": [
|
|
91
|
+
"./lib/types/types/*.d.ts"
|
|
92
|
+
],
|
|
93
|
+
"utils/*": [
|
|
94
|
+
"./lib/types/utils/*.d.ts",
|
|
95
|
+
"./lib/types/utils/*/index.d.ts"
|
|
96
|
+
],
|
|
97
|
+
"block-studio/plugins": [
|
|
98
|
+
"./lib/types/block-studio/plugins/index.d.ts",
|
|
99
|
+
"./lib/types/block-studio/plugins/index.d.ts"
|
|
100
|
+
],
|
|
101
|
+
"block-studio/build-lib": [
|
|
102
|
+
"./lib/types/block-studio/build-lib.d.ts",
|
|
103
|
+
"./lib/types/block-studio/build-lib.d.ts"
|
|
104
|
+
],
|
|
105
|
+
"block-studio/init-resource-router": [
|
|
106
|
+
"./lib/types/block-studio/init-resource-router.d.ts",
|
|
107
|
+
"./lib/types/block-studio/init-resource-router.d.ts"
|
|
108
|
+
],
|
|
109
|
+
"block-studio/generate-wrapper-code": [
|
|
110
|
+
"./lib/types/block-studio/generate-wrapper-code.d.ts",
|
|
111
|
+
"./lib/types/block-studio/generate-wrapper-code.d.ts"
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"files": [
|
|
116
|
+
"lib",
|
|
117
|
+
"LICENSE",
|
|
118
|
+
"package.json",
|
|
119
|
+
"README.md",
|
|
120
|
+
"tsconfig.json"
|
|
121
|
+
],
|
|
122
|
+
"repository": {
|
|
123
|
+
"type": "git",
|
|
124
|
+
"url": "git+https://github.com/blocklet/pages-kit.git"
|
|
125
|
+
},
|
|
126
|
+
"dependencies": {
|
|
127
|
+
"@blocklet/ui-react": "^2.11.25",
|
|
128
|
+
"@mdx-js/react": "^3.1.0",
|
|
129
|
+
"ahooks": "^3.8.4",
|
|
130
|
+
"chalk": "^4.1.2",
|
|
131
|
+
"esbuild": "^0.19.12",
|
|
132
|
+
"glob": "^11.0.0",
|
|
133
|
+
"gogocode": "^1.0.55",
|
|
134
|
+
"lodash": "^4.17.21",
|
|
135
|
+
"ufo": "^1.5.4",
|
|
136
|
+
"vite-plugin-react-pages": "^5.0.0",
|
|
137
|
+
"react": "^18.3.1",
|
|
138
|
+
"react-dom": "^18.3.1",
|
|
139
|
+
"react-router-dom": "^6.26.1",
|
|
140
|
+
"typescript": "^5.7.2",
|
|
141
|
+
"axios": "^1.7.4",
|
|
142
|
+
"@blocklet/pages-kit-inner-components": "0.0.1"
|
|
143
|
+
},
|
|
144
|
+
"devDependencies": {
|
|
145
|
+
"@rollup/plugin-typescript": "^11.1.6",
|
|
146
|
+
"@types/react": "^18.3.18",
|
|
147
|
+
"@types/react-dom": "^18.3.5",
|
|
148
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
149
|
+
"npm-run-all": "^4.1.5",
|
|
150
|
+
"rimraf": "^6.0.1",
|
|
151
|
+
"vite-node": "^2.1.8",
|
|
152
|
+
"vite-plugin-require": "^1.2.14",
|
|
153
|
+
"vite-tsconfig-paths": "^4.3.2",
|
|
154
|
+
"zx": "^8.3.0"
|
|
155
|
+
},
|
|
156
|
+
"peerDependencies": {
|
|
157
|
+
"@blocklet/pages-kit-inner-components": "0.0.1"
|
|
158
|
+
},
|
|
159
|
+
"scripts": {
|
|
160
|
+
"lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
|
|
161
|
+
"lint:fix": "npm run lint -- --fix",
|
|
162
|
+
"build": "run-p build:*",
|
|
163
|
+
"build:cjs": "tsc --module commonjs --outDir lib/cjs",
|
|
164
|
+
"build:esm": "tsc --module es2022 --outDir lib/esm",
|
|
165
|
+
"build:types": "tsc --declaration --emitDeclarationOnly --outDir lib/types",
|
|
166
|
+
"dev": "run-p 'build:* -- -w'",
|
|
167
|
+
"clean": "rimraf lib"
|
|
168
|
+
}
|
|
169
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"noEmit": false,
|
|
5
|
+
"outDir": "lib",
|
|
6
|
+
"lib": ["DOM", "ESNext"],
|
|
7
|
+
"paths": {
|
|
8
|
+
// FIXME: Just for local dev, comment next line before publish
|
|
9
|
+
// "@blocklet/ai-runtime/*": ["../../../ai-studio/packages/ai-runtime/src/*"]
|
|
10
|
+
// "@blocklet/ai-kit/*": ["../../../ai-kit/packages/ai-kit/src/*"]
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|