@blocklet/pages-kit-block-studio 0.0.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.
Files changed (48) hide show
  1. package/LICENSE +13 -0
  2. package/lib/cjs/block-studio/build-lib.js +95 -0
  3. package/lib/cjs/block-studio/generate-wrapper-code.js +126 -0
  4. package/lib/cjs/block-studio/init-resource-router.js +166 -0
  5. package/lib/cjs/block-studio/plugins/_theme.js +7 -0
  6. package/lib/cjs/block-studio/plugins/index.js +19 -0
  7. package/lib/cjs/block-studio/plugins/vite-plugin-block-studio.js +176 -0
  8. package/lib/cjs/block-studio/plugins/vite-plugin-html-transform.js +245 -0
  9. package/lib/cjs/block-studio/plugins/vite-plugin-remote-script-localizer.js +211 -0
  10. package/lib/cjs/block-studio/utils.js +53 -0
  11. package/lib/cjs/components/create-resource.js +32 -0
  12. package/lib/cjs/components/index.js +17 -0
  13. package/lib/cjs/index.js +2 -0
  14. package/lib/cjs/tsconfig.tsbuildinfo +1 -0
  15. package/lib/cjs/types/index.js +5 -0
  16. package/lib/cjs/utils/index.js +1 -0
  17. package/lib/esm/block-studio/build-lib.js +89 -0
  18. package/lib/esm/block-studio/generate-wrapper-code.js +90 -0
  19. package/lib/esm/block-studio/init-resource-router.js +124 -0
  20. package/lib/esm/block-studio/plugins/_theme.js +4 -0
  21. package/lib/esm/block-studio/plugins/index.js +3 -0
  22. package/lib/esm/block-studio/plugins/vite-plugin-block-studio.js +140 -0
  23. package/lib/esm/block-studio/plugins/vite-plugin-html-transform.js +241 -0
  24. package/lib/esm/block-studio/plugins/vite-plugin-remote-script-localizer.js +175 -0
  25. package/lib/esm/block-studio/utils.js +43 -0
  26. package/lib/esm/components/create-resource.js +29 -0
  27. package/lib/esm/components/index.js +1 -0
  28. package/lib/esm/index.js +1 -0
  29. package/lib/esm/tsconfig.tsbuildinfo +1 -0
  30. package/lib/esm/types/index.js +2 -0
  31. package/lib/esm/utils/index.js +1 -0
  32. package/lib/types/block-studio/build-lib.d.ts +3 -0
  33. package/lib/types/block-studio/generate-wrapper-code.d.ts +5 -0
  34. package/lib/types/block-studio/init-resource-router.d.ts +5 -0
  35. package/lib/types/block-studio/plugins/_theme.d.ts +1 -0
  36. package/lib/types/block-studio/plugins/index.d.ts +3 -0
  37. package/lib/types/block-studio/plugins/vite-plugin-block-studio.d.ts +6 -0
  38. package/lib/types/block-studio/plugins/vite-plugin-html-transform.d.ts +5 -0
  39. package/lib/types/block-studio/plugins/vite-plugin-remote-script-localizer.d.ts +8 -0
  40. package/lib/types/block-studio/utils.d.ts +14 -0
  41. package/lib/types/components/create-resource.d.ts +7 -0
  42. package/lib/types/components/index.d.ts +1 -0
  43. package/lib/types/index.d.ts +1 -0
  44. package/lib/types/tsconfig.tsbuildinfo +1 -0
  45. package/lib/types/types/index.d.ts +39 -0
  46. package/lib/types/utils/index.d.ts +0 -0
  47. package/package.json +117 -0
  48. 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,117 @@
1
+ {
2
+ "name": "@blocklet/pages-kit-block-studio",
3
+ "version": "0.0.1",
4
+ "description": "Pages Kit block studio",
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
+ "./components": {
20
+ "import": "./lib/esm/components/index.js",
21
+ "require": "./lib/cjs/components/index.js"
22
+ },
23
+ "./block-studio/plugins": {
24
+ "import": "./lib/esm/block-studio/plugins/index.js",
25
+ "require": "./lib/cjs/block-studio/plugins/index.js"
26
+ },
27
+ "./block-studio/build-lib": {
28
+ "import": "./lib/esm/block-studio/build-lib.js",
29
+ "require": "./lib/cjs/block-studio/build-lib.js"
30
+ },
31
+ "./block-studio/init-resource-router": {
32
+ "import": "./lib/esm/block-studio/init-resource-router.js",
33
+ "require": "./lib/cjs/block-studio/init-resource-router.js"
34
+ },
35
+ "./block-studio/generate-wrapper-code": {
36
+ "import": "./lib/esm/block-studio/generate-wrapper-code.js",
37
+ "require": "./lib/cjs/block-studio/generate-wrapper-code.js"
38
+ }
39
+ },
40
+ "typesVersions": {
41
+ "*": {
42
+ "*": [
43
+ "./lib/types/index.d.ts"
44
+ ],
45
+ "components": [
46
+ "./lib/types/components/index.d.ts"
47
+ ],
48
+ "block-studio/plugins": [
49
+ "./lib/types/block-studio/plugins/index.d.ts",
50
+ "./lib/types/block-studio/plugins/index.d.ts"
51
+ ],
52
+ "block-studio/build-lib": [
53
+ "./lib/types/block-studio/build-lib.d.ts",
54
+ "./lib/types/block-studio/build-lib.d.ts"
55
+ ],
56
+ "block-studio/init-resource-router": [
57
+ "./lib/types/block-studio/init-resource-router.d.ts",
58
+ "./lib/types/block-studio/init-resource-router.d.ts"
59
+ ],
60
+ "block-studio/generate-wrapper-code": [
61
+ "./lib/types/block-studio/generate-wrapper-code.d.ts",
62
+ "./lib/types/block-studio/generate-wrapper-code.d.ts"
63
+ ]
64
+ }
65
+ },
66
+ "files": [
67
+ "lib",
68
+ "LICENSE",
69
+ "package.json",
70
+ "README.md",
71
+ "tsconfig.json"
72
+ ],
73
+ "repository": {
74
+ "type": "git",
75
+ "url": "git+https://github.com/blocklet/pages-kit.git"
76
+ },
77
+ "dependencies": {
78
+ "@blocklet/ui-react": "^2.11.25",
79
+ "@mdx-js/react": "^3.1.0",
80
+ "ahooks": "^3.8.4",
81
+ "chalk": "^4.1.2",
82
+ "esbuild": "^0.19.12",
83
+ "glob": "^11.0.0",
84
+ "gogocode": "^1.0.55",
85
+ "lodash": "^4.17.21",
86
+ "ufo": "^1.5.4",
87
+ "vite-plugin-react-pages": "^5.0.0",
88
+ "react": "^18.3.1",
89
+ "react-dom": "^18.3.1",
90
+ "react-router-dom": "^6.26.1",
91
+ "typescript": "^5.7.2",
92
+ "axios": "^1.7.4"
93
+ },
94
+ "devDependencies": {
95
+ "@rollup/plugin-typescript": "^11.1.6",
96
+ "@types/react": "^18.3.18",
97
+ "@types/react-dom": "^18.3.5",
98
+ "@vitejs/plugin-react": "^4.3.4",
99
+ "npm-run-all": "^4.1.5",
100
+ "rimraf": "^6.0.1",
101
+ "vite-node": "^2.1.8",
102
+ "vite-plugin-require": "^1.2.14",
103
+ "vite-tsconfig-paths": "^4.3.2",
104
+ "zx": "^8.3.0"
105
+ },
106
+ "peerDependencies": {},
107
+ "scripts": {
108
+ "lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
109
+ "lint:fix": "npm run lint -- --fix",
110
+ "build": "run-p build:*",
111
+ "build:cjs": "tsc --module commonjs --outDir lib/cjs",
112
+ "build:esm": "tsc --module es2022 --outDir lib/esm",
113
+ "build:types": "tsc --declaration --emitDeclarationOnly --outDir lib/types",
114
+ "dev": "run-p 'build:* -- -w'",
115
+ "clean": "rimraf lib"
116
+ }
117
+ }
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
+ }