@blocklet/component-studio-cli 0.4.134

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 (84) hide show
  1. package/README.md +84 -0
  2. package/dist/cli.d.ts +2 -0
  3. package/dist/cli.js +11 -0
  4. package/dist/commands/add.d.ts +2 -0
  5. package/dist/commands/add.js +140 -0
  6. package/dist/commands/component-studio.d.ts +2 -0
  7. package/dist/commands/component-studio.js +70 -0
  8. package/dist/commands/dev.d.ts +2 -0
  9. package/dist/commands/dev.js +87 -0
  10. package/dist/commands/init.d.ts +2 -0
  11. package/dist/commands/init.js +114 -0
  12. package/dist/commands/migrate.d.ts +2 -0
  13. package/dist/commands/migrate.js +177 -0
  14. package/dist/commands/update.d.ts +2 -0
  15. package/dist/commands/update.js +22 -0
  16. package/dist/utils/display-logo.d.ts +2 -0
  17. package/dist/utils/display-logo.js +24 -0
  18. package/dist/utils/helper.d.ts +97 -0
  19. package/dist/utils/helper.js +479 -0
  20. package/package.json +58 -0
  21. package/templates/add/components/HelloWorld/@metadata.json +433 -0
  22. package/templates/add/components/HelloWorld/@template.json +4 -0
  23. package/templates/add/components/HelloWorld/index.tsx +560 -0
  24. package/templates/add/tools/cursor-rules/.cursor/rules/@metadata-json.mdc +549 -0
  25. package/templates/add/tools/cursor-rules/.cursor/rules/component-studio.mdc +138 -0
  26. package/templates/add/tools/cursor-rules/.cursor/rules/index-tsx.mdc +192 -0
  27. package/templates/add/tools/cursor-rules/@template.json +4 -0
  28. package/templates/init/0-basic/@template.json +4 -0
  29. package/templates/init/0-basic/README.md +30 -0
  30. package/templates/init/0-basic/package.json +26 -0
  31. package/templates/init/0-basic/src/HelloWorld/@metadata.json +433 -0
  32. package/templates/init/0-basic/src/HelloWorld/index.tsx +560 -0
  33. package/templates/init/1-professional/@template.json +4 -0
  34. package/templates/init/1-professional/README.md +75 -0
  35. package/templates/init/1-professional/biome.json +36 -0
  36. package/templates/init/1-professional/global.d.ts +131 -0
  37. package/templates/init/1-professional/package.json +73 -0
  38. package/templates/init/1-professional/scripts/bump-version.mjs +35 -0
  39. package/templates/init/1-professional/src/atoms/AnimationWrapper.tsx +95 -0
  40. package/templates/init/1-professional/src/atoms/ArrayTable.tsx +114 -0
  41. package/templates/init/1-professional/src/atoms/Card.tsx +52 -0
  42. package/templates/init/1-professional/src/atoms/ContentWrapper.tsx +72 -0
  43. package/templates/init/1-professional/src/atoms/CopyrightFooter.tsx +31 -0
  44. package/templates/init/1-professional/src/atoms/DataDisplays.tsx +157 -0
  45. package/templates/init/1-professional/src/atoms/GradientTitle.tsx +64 -0
  46. package/templates/init/1-professional/src/atoms/Logo.tsx +58 -0
  47. package/templates/init/1-professional/src/atoms/index.ts +27 -0
  48. package/templates/init/1-professional/src/components/HelloWorld/@metadata.json +433 -0
  49. package/templates/init/1-professional/src/components/HelloWorld/index.tsx +224 -0
  50. package/templates/init/1-professional/src/type.d.ts +42 -0
  51. package/templates/init/1-professional/src/utils/index.ts +1 -0
  52. package/templates/init/1-professional/tsconfig.json +102 -0
  53. package/templates/init/1-professional/version +1 -0
  54. package/templates/init/2-blank/@template.json +4 -0
  55. package/templates/init/2-blank/README.md +27 -0
  56. package/templates/init/2-blank/package.json +26 -0
  57. package/templates/workspace/.component-studio-runtime/_theme.tsx +4 -0
  58. package/templates/workspace/.editorconfig +23 -0
  59. package/templates/workspace/.env +1 -0
  60. package/templates/workspace/.init-component-studio +0 -0
  61. package/templates/workspace/LICENSE +13 -0
  62. package/templates/workspace/README.md +127 -0
  63. package/templates/workspace/api/dev.ts +21 -0
  64. package/templates/workspace/api/src/index.ts +50 -0
  65. package/templates/workspace/api/src/libs/auth.ts +17 -0
  66. package/templates/workspace/api/src/libs/env.ts +6 -0
  67. package/templates/workspace/api/src/libs/logger.ts +3 -0
  68. package/templates/workspace/api/src/routes/index.ts +12 -0
  69. package/templates/workspace/api/third.d.ts +17 -0
  70. package/templates/workspace/biome.json +36 -0
  71. package/templates/workspace/blocklet.md +8 -0
  72. package/templates/workspace/blocklet.yml +58 -0
  73. package/templates/workspace/index.html +15 -0
  74. package/templates/workspace/logo.png +0 -0
  75. package/templates/workspace/package.json +125 -0
  76. package/templates/workspace/pnpm-workspace.yaml +3 -0
  77. package/templates/workspace/scripts/build-clean.mjs +6 -0
  78. package/templates/workspace/scripts/bump-version.mjs +39 -0
  79. package/templates/workspace/scripts/init-component-studio.mjs +36 -0
  80. package/templates/workspace/tsconfig.api.json +12 -0
  81. package/templates/workspace/tsconfig.json +102 -0
  82. package/templates/workspace/version +1 -0
  83. package/templates/workspace/vite-server.config.ts +39 -0
  84. package/templates/workspace/vite.config.ts +68 -0
@@ -0,0 +1,192 @@
1
+ ---
2
+ description:
3
+ globs:
4
+ alwaysApply: true
5
+ ---
6
+ # index.tsx 文件说明
7
+
8
+ ## 概述
9
+ `index.tsx` 是 Component Studio 中组件的实现文件,负责组件的渲染逻辑和交互行为。它与 `@metadata.json` 紧密配合,共同定义了一个完整的可配置组件。
10
+
11
+ ## 工作原理
12
+ `index.tsx` 与 `@metadata.json` 通过属性映射相互关联:
13
+ - `@metadata.json` 定义组件的可配置属性及其元数据
14
+ - `index.tsx` 使用这些属性进行组件渲染和行为控制
15
+
16
+
17
+ ## 关键部分
18
+
19
+ ### BlockProps 接口
20
+ ```typescript
21
+ export interface BlockProps {
22
+ /** @description id: gs1rn5jmxfvpxptx | type: string | visible: true */
23
+ title?: string;
24
+ /** @description id: 9ajrz12ik7esfk1z | type: string | visible: true */
25
+ description?: string;
26
+ // ...其他属性
27
+ }
28
+ ```
29
+
30
+ 这个接口定义了组件的属性类型,每个属性的注释包含:
31
+ - id 对应的 `@metadata.json` 中的 id
32
+ - key 属性类型
33
+ - visible 可见性
34
+ - 需要保持 `@description` 符号,这是 jsdom 在 ts 类型处理的时候,会被解析到 zod 上 `z.xxx().describe()`
35
+
36
+ #### BlockProps 最佳实践
37
+ - 所有属性默认应设为可选(使用 `?` 标记),以避免类型错误
38
+ - 保持注释格式的统一性,不要删除或修改 `@description` 内容
39
+ - 为复杂类型(如嵌套对象)定义独立的接口或类型,增强代码可读性
40
+ - 当添加新属性时,确保同步添加对应的注释,包含完整的 metadata 信息
41
+ - 使用语义化的属性名称,与 `@metadata.json` 中的 `key` 保持一致
42
+
43
+ ### 组件实现
44
+ ```typescript
45
+ export default function BlockComponent({
46
+ title = 'Hello World',
47
+ logo,
48
+ description,
49
+ // ...其他属性和默认值
50
+ }: BlockProps) {
51
+ // 组件实现逻辑
52
+ }
53
+ ```
54
+
55
+ 组件函数接收 `BlockProps` 定义的属性,并设置与 `@metadata.json` 中匹配的默认值。
56
+
57
+ #### 组件实现最佳实践
58
+ - 为常用属性设置默认值,确保组件在无参数时也能正常渲染
59
+ - 默认值应与 `@metadata.json` 中的 `defaultValue` 保持一致
60
+ - 使用解构赋值接收属性,简化代码结构
61
+ - 对于复杂的逻辑处理,考虑使用 React hooks 拆分功能
62
+ - 实现响应式设计,确保组件在不同尺寸下都能正常显示
63
+ - 添加适当的类型守卫检查复杂属性,防止运行时错误
64
+ - 考虑性能优化,避免不必要的重渲染(如使用 useMemo, useCallback)
65
+
66
+
67
+ ### EditComponent
68
+ ```typescript
69
+ export const EditComponent: React.FC<BlockProps & { onChange?: (value: BlockProps) => void }> = ({
70
+ onChange,
71
+ ...props
72
+ }) => {
73
+ // 自定义编辑界面实现
74
+ }
75
+ ```
76
+
77
+ 这是组件的特殊编辑接口,提供了编辑器中的自定义控件,增强属性编辑体验。
78
+
79
+ #### EditComponent 最佳实践
80
+ - 当在 EditComponent 中为某个属性提供自定义控件时,应在 `@metadata.json` 中将该属性的 `visible` 设置为 `false`
81
+ - 使用 onChange 回调时确保传递完整的 props 对象,避免丢失其他属性值
82
+ - 为复杂编辑界面提供直观的 UI 分组和标签
83
+ - 考虑添加表单验证,确保用户输入的值有效
84
+ - 提供即时反馈,让用户知道其操作已被接收
85
+ - 保持编辑控件的样式与 Component Studio 整体风格一致
86
+ - 并不是所有的 Component 都需要这个自定义空间,尤其是 `type: 'url' | ‘yml’` 情况下,不建议替换
87
+
88
+ ### 样式
89
+ 组件样式在 Component Studio 中通常通过内联样式对象实现,便于与属性值动态绑定。
90
+
91
+ ```typescript
92
+ // 样式对象分离示例
93
+ const cardStyle = {
94
+ padding: '1.5rem',
95
+ borderRadius: '12px',
96
+ background: 'rgba(255, 255, 255, 0.7)',
97
+ boxShadow: '0 10px 30px rgba(0, 0, 0, 0.08)'
98
+ };
99
+
100
+ return <div style={cardStyle}>...</div>;
101
+ ```
102
+
103
+ #### 样式最佳实践
104
+ - **内联样式优先** - 使用内联样式(style对象)便于属性动态控制
105
+ - **样式对象分离** - 对于复杂组件,将样式对象提取到组件函数外,提高可读性
106
+ - **动态样式函数** - 创建函数生成依赖于属性的样式
107
+ ```typescript
108
+ const getTitleStyle = (color) => ({
109
+ color,
110
+ fontSize: '1.5rem',
111
+ fontWeight: 600
112
+ });
113
+ ```
114
+ - **响应式设计** - 使用条件样式或媒体查询实现适配不同设备
115
+ - **过渡动画** - 添加 transition 属性提升用户体验
116
+ - **交互增强** - 为互动元素添加悬停状态
117
+ - **性能优化** - 使用 useMemo 缓存样式对象,避免不必要的重新计算
118
+ ```typescript
119
+ const buttonStyle = useMemo(() => ({
120
+ background: isActive ? activeColor : inactiveColor
121
+ }), [isActive, activeColor, inactiveColor]);
122
+ ```
123
+ - **避免硬编码** - 使用属性传入的样式值,避免硬编码颜色等固定值
124
+ - **主题变量** - 考虑使用 CSS 变量实现主题定制
125
+ - **使用语义化命名** - 如 containerStyle, headerStyle 等增强可读性
126
+
127
+ ## 与 @metadata.json 的关系
128
+
129
+ ### 属性映射
130
+ 每个在 `@metadata.json` 中定义的属性,在 `index.tsx` 中都有对应映射:
131
+
132
+ | @metadata.json | index.tsx |
133
+ |----------------|------------|
134
+ | `properties.[id].data.key` | BlockProps 中的属性名 |
135
+ | `properties.[id].data.type` | TypeScript 类型定义 |
136
+ | `properties.[id].data.locales.[lang].defaultValue` | 组件中的默认值 |
137
+
138
+ ### 类型对应关系
139
+ - `string` → `string`
140
+ - `number` → `number`
141
+ - `boolean` → `boolean`
142
+ - `url` → 自定义对象类型
143
+ - `json` → 自定义对象类型
144
+ - `array` → 数组类型
145
+ - `component` → `any` 或特定组件类型
146
+
147
+ ### 嵌套属性处理
148
+ `@metadata.json` 中的 `subProperties` 在 `index.tsx` 中通过嵌套接口定义映射:
149
+
150
+ ```typescript
151
+ json?: {
152
+ /** @description id: gpy89bsxc6ovvlsp | type: string | visible: true */
153
+ foo?: string;
154
+ /** @description id: 1j34jdhdptp2xm5e | type: string | visible: true */
155
+ bar?: string;
156
+ };
157
+ ```
158
+
159
+ ## 通用最佳实践
160
+ 以下是适用于整个组件开发过程的通用最佳实践:
161
+
162
+ 1. **文件同步** - 修改 `@metadata.json` 或 `index.tsx` 时,确保两者保持同步
163
+ 2. **版本控制** - 为重要更改添加清晰的注释和版本标记
164
+ 3. **组件设计** - 遵循单一职责原则,每个组件只做一件事
165
+ 4. **性能考虑** - 针对大型组件或频繁更新的场景进行性能优化
166
+ 5. **可维护性** - 使用清晰的命名和注释,便于团队成员理解
167
+
168
+ ## 编辑组件示例
169
+ 对于需要特殊编辑体验的属性,可以通过 `EditComponent` 提供自定义编辑界面:
170
+
171
+ ```typescript
172
+ export const EditComponent: React.FC<BlockProps & { onChange?: (value: BlockProps) => void }> = ({
173
+ onChange,
174
+ ...props
175
+ }) => {
176
+ return (
177
+ <div>
178
+ <label>自定义编辑器</label>
179
+ <input
180
+ value={props.someProperty || ''}
181
+ onChange={(e) => onChange?.({...props, someProperty: e.target.value})}
182
+ />
183
+ </div>
184
+ );
185
+ }
186
+ ```
187
+
188
+ ## 组件属性如何生效
189
+ 1. 用户在编辑器中配置属性值
190
+ 2. 值存储到 `@metadata.json` 对应属性的 `defaultValue`
191
+ 3. 运行时,这些值作为 props 传递给 `index.tsx` 中的组件
192
+ 4. 组件根据接收到的 props 和默认值渲染界面
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "Cursor Rules",
3
+ "description": "The cursor rules to improve coding experience in cursor editor"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "name": "Basic Project",
3
+ "description": "A basic component studio project, with a simple `HelloWorld` component example"
4
+ }
@@ -0,0 +1,30 @@
1
+ # Basic Component Studio Project
2
+
3
+ This is a basic component studio project created with Component Studio.
4
+
5
+ ## Project Structure
6
+
7
+ ```
8
+ {your-project-name}/
9
+ ├── src/
10
+ │ ├── HelloWorld # A basic component example
11
+ │ │ ├── index.tsx # Main entry point
12
+ │ │ └── @metadata.json # Component metadata
13
+ │ └── {your-component-name} # Your component name
14
+ | └── index.tsx # Main entry point
15
+ ├── package.json # Project dependencies and scripts
16
+ ├── .gitignore # Git ignore
17
+ └── README.md # README
18
+ ```
19
+
20
+ ## Getting Started
21
+
22
+ Start development server:
23
+
24
+ ```bash
25
+ pnpm run dev
26
+ ```
27
+
28
+ ## License
29
+
30
+ MIT
@@ -0,0 +1,26 @@
1
+ {
2
+ "name": "basic-component-studio-project",
3
+ "version": "0.1.0",
4
+ "description": "A basic component studio project",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "start": "component-studio dev",
9
+ "dev": "component-studio dev",
10
+ "update:deps": "npx -y taze -r -n '/arcblock|ocap|abtnode|blocklet|did-connect|did-comment|nedb/' -w -f && pnpm install && pnpm run deduplicate",
11
+ "deduplicate": "pnpm dedupe"
12
+ },
13
+ "dependencies": {},
14
+ "devDependencies": {
15
+ "@types/react": "^18.2.0",
16
+ "@types/react-dom": "^18.2.0",
17
+ "react": "^18.2.0",
18
+ "react-dom": "^18.2.0",
19
+ "typescript": "^5.0.0"
20
+ },
21
+ "peerDependencies": {
22
+ "react": "^16.8.0 || ^17.0.0 || ^18.0.0",
23
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
24
+ },
25
+ "license": "MIT"
26
+ }
@@ -0,0 +1,433 @@
1
+ {
2
+ "id": "KEHGy3vdflE8JGrV",
3
+ "createdAt": "2025-03-20T16:01:56.655Z",
4
+ "updatedAt": "2025-03-21T01:24:04.008Z",
5
+ "name": "HelloWorld",
6
+ "description": "",
7
+ "properties": {
8
+ "gs1rn5jmxfvpxptx": {
9
+ "index": 0,
10
+ "data": {
11
+ "id": "gs1rn5jmxfvpxptx",
12
+ "key": "title",
13
+ "type": "string",
14
+ "visible": true,
15
+ "locales": {
16
+ "zh": {
17
+ "name": "标题",
18
+ "defaultValue": "Hello World"
19
+ },
20
+ "en": {
21
+ "name": "Title",
22
+ "defaultValue": "Hello World"
23
+ }
24
+ }
25
+ }
26
+ },
27
+ "9ajrz12ik7esfk1z": {
28
+ "index": 1,
29
+ "data": {
30
+ "id": "9ajrz12ik7esfk1z",
31
+ "key": "description",
32
+ "type": "string",
33
+ "visible": true,
34
+ "locales": {
35
+ "zh": {
36
+ "name": "描述",
37
+ "defaultValue": "这是你的创意实验室,在这里可以:\n- 设计和构建各类强大组件\n- 将创意转化为可复用代码\n- 打造专属于您的组件库\n释放你的开发潜能,开始创作吧!"
38
+ },
39
+ "en": {
40
+ "name": "Description",
41
+ "defaultValue": "This is your creative lab, where you can:\n- Design and build powerful components\n- Transform ideas into reusable code\n- Create your own component library\nUnleash your development potential and start creating!"
42
+ }
43
+ }
44
+ }
45
+ },
46
+ "3ckcfvf6b7zyskk8": {
47
+ "index": 2,
48
+ "data": {
49
+ "id": "3ckcfvf6b7zyskk8",
50
+ "key": "logo",
51
+ "type": "url",
52
+ "visible": true,
53
+ "locales": {
54
+ "zh": {
55
+ "defaultValue": {
56
+ "url": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80",
57
+ "mediaKitUrl": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80"
58
+ },
59
+ "name": "Logo"
60
+ },
61
+ "en": {
62
+ "defaultValue": {
63
+ "url": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80",
64
+ "mediaKitUrl": "/.well-known/service/blocklet/logo?imageFilter=convert&f=png&h=80"
65
+ },
66
+ "name": "Logo"
67
+ }
68
+ },
69
+ "subProperties": {
70
+ "ML-CDw7LvtlhM_cl": {
71
+ "index": 0,
72
+ "data": {
73
+ "id": "ML-CDw7LvtlhM_cl",
74
+ "key": "url",
75
+ "locales": {
76
+ "en": {
77
+ "name": "url"
78
+ },
79
+ "zh": {
80
+ "name": "url"
81
+ }
82
+ }
83
+ }
84
+ },
85
+ "K-HYgPHtAsmO_mer": {
86
+ "index": 1,
87
+ "data": {
88
+ "id": "K-HYgPHtAsmO_mer",
89
+ "key": "mediaKitUrl",
90
+ "locales": {
91
+ "en": {
92
+ "name": "mediaKitUrl"
93
+ },
94
+ "zh": {
95
+ "name": "mediaKitUrl"
96
+ }
97
+ }
98
+ }
99
+ },
100
+ "evequmAWgWEWZLex": {
101
+ "index": 2,
102
+ "data": {
103
+ "id": "evequmAWgWEWZLex",
104
+ "key": "width",
105
+ "locales": {
106
+ "en": {
107
+ "name": "width"
108
+ },
109
+ "zh": {
110
+ "name": "width"
111
+ }
112
+ }
113
+ }
114
+ },
115
+ "poeAwflRHJeUmfLa": {
116
+ "index": 3,
117
+ "data": {
118
+ "id": "poeAwflRHJeUmfLa",
119
+ "key": "height",
120
+ "locales": {
121
+ "en": {
122
+ "name": "height"
123
+ },
124
+ "zh": {
125
+ "name": "height"
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ }
132
+ },
133
+ "x3lqht8ikble1itx": {
134
+ "index": 3,
135
+ "data": {
136
+ "id": "x3lqht8ikble1itx",
137
+ "key": "copyright",
138
+ "type": "string",
139
+ "visible": false,
140
+ "locales": {
141
+ "zh": {
142
+ "name": "版权信息",
143
+ "defaultValue": "由 Component Studio 提供支持"
144
+ },
145
+ "en": {
146
+ "name": "Copyright",
147
+ "defaultValue": "Powered by Component Studio"
148
+ }
149
+ }
150
+ }
151
+ },
152
+ "q0ezdj81v0m14y5m": {
153
+ "index": 4,
154
+ "data": {
155
+ "id": "q0ezdj81v0m14y5m",
156
+ "key": "number",
157
+ "type": "number",
158
+ "visible": true,
159
+ "locales": {
160
+ "zh": {
161
+ "name": "整数",
162
+ "defaultValue": 42
163
+ },
164
+ "en": {
165
+ "name": "Integer",
166
+ "defaultValue": 42
167
+ }
168
+ }
169
+ }
170
+ },
171
+ "bl0rimfebwbencoj": {
172
+ "index": 5,
173
+ "data": {
174
+ "id": "bl0rimfebwbencoj",
175
+ "key": "decimal",
176
+ "type": "decimal",
177
+ "visible": true,
178
+ "locales": {
179
+ "zh": {
180
+ "name": "小数",
181
+ "defaultValue": 3.14
182
+ },
183
+ "en": {
184
+ "name": "Decimal",
185
+ "defaultValue": 3.14
186
+ }
187
+ }
188
+ }
189
+ },
190
+ "gioetxz8d13jabz6": {
191
+ "index": 6,
192
+ "data": {
193
+ "id": "gioetxz8d13jabz6",
194
+ "key": "showCopyright",
195
+ "type": "boolean",
196
+ "visible": true,
197
+ "locales": {
198
+ "zh": {
199
+ "name": "是否展示 Copyright",
200
+ "defaultValue": true
201
+ },
202
+ "en": {
203
+ "name": "Show Description",
204
+ "defaultValue": true
205
+ }
206
+ }
207
+ }
208
+ },
209
+ "yi1oj4rq1eziup1d": {
210
+ "index": 7,
211
+ "data": {
212
+ "id": "yi1oj4rq1eziup1d",
213
+ "key": "titleColor",
214
+ "type": "color",
215
+ "visible": true,
216
+ "locales": {
217
+ "zh": {
218
+ "defaultValue": "rgb(45, 36, 45)",
219
+ "name": "标题颜色"
220
+ },
221
+ "en": {
222
+ "defaultValue": "rgb(44, 39, 44)",
223
+ "name": "Title Color"
224
+ }
225
+ }
226
+ }
227
+ },
228
+ "4f49q5uidkcp5ak4": {
229
+ "index": 8,
230
+ "data": {
231
+ "id": "4f49q5uidkcp5ak4",
232
+ "key": "json",
233
+ "type": "json",
234
+ "visible": true,
235
+ "locales": {
236
+ "zh": {
237
+ "name": "JSON 数据",
238
+ "defaultValue": {
239
+ "foo": "-",
240
+ "bar": "-"
241
+ }
242
+ },
243
+ "en": {
244
+ "name": "JSON Data",
245
+ "defaultValue": {
246
+ "foo": "foo",
247
+ "bar": "bar"
248
+ }
249
+ }
250
+ },
251
+ "subProperties": {
252
+ "gpy89bsxc6ovvlsp": {
253
+ "index": 0,
254
+ "data": {
255
+ "id": "gpy89bsxc6ovvlsp",
256
+ "key": "foo",
257
+ "type": "string",
258
+ "visible": true,
259
+ "locales": {
260
+ "zh": {
261
+ "name": "名称",
262
+ "defaultValue": "-"
263
+ },
264
+ "en": {
265
+ "name": "Foo",
266
+ "defaultValue": "foo"
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "1j34jdhdptp2xm5e": {
272
+ "index": 1,
273
+ "data": {
274
+ "id": "1j34jdhdptp2xm5e",
275
+ "key": "bar",
276
+ "type": "string",
277
+ "visible": true,
278
+ "locales": {
279
+ "zh": {
280
+ "name": "属性",
281
+ "defaultValue": "-"
282
+ },
283
+ "en": {
284
+ "name": "Bar",
285
+ "defaultValue": "bar"
286
+ }
287
+ }
288
+ }
289
+ }
290
+ }
291
+ }
292
+ },
293
+ "lbclpm6mxrp10w2k": {
294
+ "index": 9,
295
+ "data": {
296
+ "id": "lbclpm6mxrp10w2k",
297
+ "key": "array",
298
+ "type": "array",
299
+ "visible": true,
300
+ "locales": {
301
+ "zh": {
302
+ "name": "数组数据",
303
+ "defaultValue": [
304
+ {
305
+ "name": "示例用户",
306
+ "bio": "这是一个示例用户"
307
+ }
308
+ ]
309
+ },
310
+ "en": {
311
+ "name": "Array Data",
312
+ "defaultValue": [
313
+ {
314
+ "name": "Example User",
315
+ "bio": "This is an example user"
316
+ }
317
+ ]
318
+ }
319
+ },
320
+ "subProperties": {
321
+ "1c5vl2p9cn9ryvgh": {
322
+ "index": 0,
323
+ "data": {
324
+ "id": "1c5vl2p9cn9ryvgh",
325
+ "key": "name",
326
+ "type": "string",
327
+ "visible": true,
328
+ "locales": {
329
+ "zh": {
330
+ "name": "姓名",
331
+ "defaultValue": ""
332
+ },
333
+ "en": {
334
+ "name": "Name",
335
+ "defaultValue": ""
336
+ }
337
+ }
338
+ }
339
+ },
340
+ "c5whnccwzqqzaa0w": {
341
+ "index": 1,
342
+ "data": {
343
+ "id": "c5whnccwzqqzaa0w",
344
+ "key": "bio",
345
+ "type": "multiline",
346
+ "visible": true,
347
+ "locales": {
348
+ "zh": {
349
+ "name": "简介",
350
+ "defaultValue": ""
351
+ },
352
+ "en": {
353
+ "name": "Bio",
354
+ "defaultValue": ""
355
+ }
356
+ }
357
+ }
358
+ }
359
+ }
360
+ }
361
+ },
362
+ "s0tund4p07bzizgv": {
363
+ "index": 10,
364
+ "data": {
365
+ "id": "s0tund4p07bzizgv",
366
+ "key": "yaml",
367
+ "type": "yaml",
368
+ "visible": true,
369
+ "locales": {
370
+ "zh": {
371
+ "name": "YAML 配置",
372
+ "defaultValue": ""
373
+ },
374
+ "en": {
375
+ "name": "YAML Configuration",
376
+ "defaultValue": "ya: ya\nml: ml\n"
377
+ }
378
+ },
379
+ "subProperties": {
380
+ "1q8tsreh4k2mhbgs": {
381
+ "index": 0,
382
+ "data": {
383
+ "id": "1q8tsreh4k2mhbgs",
384
+ "key": "ya",
385
+ "type": "string",
386
+ "visible": true,
387
+ "locales": {
388
+ "en": {
389
+ "name": "Ya",
390
+ "defaultValue": "ya"
391
+ }
392
+ }
393
+ }
394
+ },
395
+ "09w8sncxwrj6tldi": {
396
+ "index": 1,
397
+ "data": {
398
+ "id": "09w8sncxwrj6tldi",
399
+ "key": "ml",
400
+ "type": "string",
401
+ "visible": true,
402
+ "locales": {
403
+ "en": {
404
+ "name": "Ml",
405
+ "defaultValue": "ml"
406
+ }
407
+ }
408
+ }
409
+ }
410
+ }
411
+ }
412
+ },
413
+ "8e7g6c61pxcy0q4w": {
414
+ "index": 11,
415
+ "data": {
416
+ "id": "8e7g6c61pxcy0q4w",
417
+ "key": "children",
418
+ "type": "component",
419
+ "visible": true,
420
+ "locales": {
421
+ "zh": {
422
+ "name": "子组件",
423
+ "defaultValue": {}
424
+ },
425
+ "en": {
426
+ "name": "Children Components",
427
+ "defaultValue": {}
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ }