@next-bricks/vs 1.18.13 → 1.18.14

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.
@@ -8,14 +8,17 @@
8
8
  "properties": [
9
9
  {
10
10
  "name": "name",
11
+ "description": "",
11
12
  "type": "string"
12
13
  },
13
14
  {
14
15
  "name": "label",
16
+ "description": "",
15
17
  "type": "string"
16
18
  },
17
19
  {
18
20
  "name": "value",
21
+ "description": "",
19
22
  "type": "string"
20
23
  },
21
24
  {
@@ -26,20 +29,23 @@
26
29
  },
27
30
  {
28
31
  "name": "theme",
29
- "description": "主题,支持 `\"auto\" | \"vs\" | \"vs-dark\"`",
32
+ "description": "",
30
33
  "default": "\"auto\"",
31
34
  "type": "string"
32
35
  },
33
36
  {
34
37
  "name": "required",
38
+ "description": "",
35
39
  "type": "boolean"
36
40
  },
37
41
  {
38
42
  "name": "readOnly",
43
+ "description": "",
39
44
  "type": "boolean"
40
45
  },
41
46
  {
42
47
  "name": "automaticLayout",
48
+ "description": "",
43
49
  "type": "\"fit-container\" | \"fit-content\" | \"none\""
44
50
  },
45
51
  {
@@ -50,23 +56,25 @@
50
56
  },
51
57
  {
52
58
  "name": "completers",
53
- "description": "仅对 language 为 brick_next_yaml 有效,设置第一层属性名的自动补全。",
59
+ "description": "",
54
60
  "attribute": false,
55
61
  "type": "monaco.languages.CompletionItem[]"
56
62
  },
57
63
  {
58
64
  "name": "advancedCompleters",
59
- "description": "高级自动补全配置。\n- 设置为键值对时,仅对 language 为 brick_next_yaml 有效,设置任意的自动补全;\n- 设置为数组时,当前仅对 language 为 cel 有效。\n未来将统一改为数组格式,废弃键值对格式的配置。",
65
+ "description": "",
60
66
  "attribute": false,
61
67
  "type": "AdvancedCompleterMap | MixedCompleter[]"
62
68
  },
63
69
  {
64
70
  "name": "markers",
71
+ "description": "",
65
72
  "attribute": false,
66
73
  "type": "Marker[]"
67
74
  },
68
75
  {
69
76
  "name": "links",
77
+ "description": "",
70
78
  "attribute": false,
71
79
  "type": "string[]"
72
80
  },
@@ -78,59 +86,63 @@
78
86
  },
79
87
  {
80
88
  "name": "height",
89
+ "description": "",
81
90
  "attribute": false,
82
91
  "type": "string | number"
83
92
  },
84
93
  {
85
94
  "name": "message",
95
+ "description": "",
86
96
  "type": "string"
87
97
  },
88
98
  {
89
99
  "name": "placeholder",
100
+ "description": "",
90
101
  "type": "string"
91
102
  },
92
103
  {
93
104
  "name": "showExpandButton",
94
- "description": "是否展示展开按钮",
105
+ "description": "",
95
106
  "type": "boolean"
96
107
  },
97
108
  {
98
109
  "name": "lineNumbers",
99
- "description": "行数配置",
110
+ "description": "",
100
111
  "type": "monaco.editor.LineNumbersType"
101
112
  },
102
113
  {
103
114
  "name": "tokenConfig",
104
- "description": "自定义高亮配置",
115
+ "description": "",
105
116
  "attribute": false,
106
117
  "type": "TokenConfig"
107
118
  },
108
119
  {
109
120
  "name": "customValidationInBrickNextYaml",
110
- "description": "在 brick_next_yaml 中是否开启语义相关校验",
121
+ "description": "",
111
122
  "default": "false",
112
123
  "type": "boolean"
113
124
  },
114
125
  {
115
126
  "name": "showCopyButton",
116
- "description": "是否展示复制按钮",
127
+ "description": "",
117
128
  "default": "true",
118
129
  "type": "boolean"
119
130
  },
120
131
  {
121
132
  "name": "glyphMargin",
122
- "description": "显示字形边距",
133
+ "description": "",
123
134
  "default": "false",
124
135
  "type": "boolean"
125
136
  },
126
137
  {
127
138
  "name": "extraLibs",
128
- "description": "额外声明的 lib 库",
139
+ "description": "",
129
140
  "attribute": false,
130
141
  "type": "ExtraLib[]"
131
142
  },
132
143
  {
133
144
  "name": "extraMarkers",
145
+ "description": "",
134
146
  "attribute": false,
135
147
  "type": "ExtraMarker[]"
136
148
  },
@@ -142,42 +154,49 @@
142
154
  },
143
155
  {
144
156
  "name": "spellCheck",
145
- "description": "是否启用英语拼写检查",
157
+ "description": "",
146
158
  "default": "true",
147
159
  "type": "boolean"
148
160
  },
149
161
  {
150
162
  "name": "knownWords",
151
- "description": "启用英语拼写检查时,除系统设置的词汇表外,指定其他的已知单词(小写)。",
163
+ "description": "",
152
164
  "attribute": false,
153
165
  "type": "string[]"
154
166
  },
155
167
  {
156
168
  "name": "domLibsEnabled",
157
- "description": "是否启用 DOM 相关接口的自动提示。",
169
+ "description": "",
158
170
  "type": "boolean"
159
171
  },
160
172
  {
161
173
  "name": "uri",
174
+ "description": "",
162
175
  "type": "string"
163
176
  }
164
177
  ],
165
178
  "events": [
166
179
  {
167
180
  "name": "code.change",
181
+ "description": "",
168
182
  "detail": {
183
+ "description": "`string` — 当前编辑器的完整代码文本",
169
184
  "type": "string"
170
185
  }
171
186
  },
172
187
  {
173
188
  "name": "user.input",
189
+ "description": "",
174
190
  "detail": {
191
+ "description": "`any` — 用户输入的内容",
175
192
  "type": "any"
176
193
  }
177
194
  },
178
195
  {
179
196
  "name": "token.click",
197
+ "description": "",
180
198
  "detail": {
199
+ "description": "`string` — 被点击的 token 文本(如 `CTX`、`FN` 等命名空间关键字)",
181
200
  "type": "string"
182
201
  }
183
202
  }
@@ -185,7 +204,7 @@
185
204
  "slots": [],
186
205
  "methods": [],
187
206
  "parts": [],
188
- "description": "构件代码编辑器",
207
+ "description": "",
189
208
  "category": "form-input-advanced"
190
209
  }
191
210
  ],
@@ -52,102 +52,151 @@ export interface Marker {
52
52
  export type TokenConfig = {
53
53
  showDSKey?: boolean;
54
54
  };
55
+ export interface CodeEditorEventsMap {
56
+ "code.change": CustomEvent<string>;
57
+ "user.input": CustomEvent<any>;
58
+ "token.click": CustomEvent<string>;
59
+ }
60
+ export interface CodeEditorEventsMapping {
61
+ onCodeChange: "code.change";
62
+ onUserInput: "user.input";
63
+ onTokenClick: "token.click";
64
+ }
55
65
  /**
56
- * 构件代码编辑器
66
+ * @description 基于 Monaco Editor 的代码编辑器构件,支持多种编程语言(typescript、yaml、brick_next_yaml、cel 等)的语法高亮与自动补全,支持作为表单项使用,支持自动布局、拼写检查、Lint 校验、标记高亮等高级功能。
57
67
  * @category form-input-advanced
58
68
  */
59
69
  export declare class CodeEditor extends FormItemElementBase implements CodeEditorProps {
60
70
  #private;
71
+ /**
72
+ * @description 表单字段名,用于在表单提交时标识该字段。
73
+ */
61
74
  accessor name: string | undefined;
75
+ /**
76
+ * @description 表单字段标签,显示在编辑器上方作为说明文字。
77
+ */
62
78
  accessor label: string | undefined;
79
+ /**
80
+ * @description 编辑器的当前值(代码文本内容)。
81
+ */
63
82
  accessor value: string | undefined;
64
83
  /**
84
+ * @description 编辑器的编程语言,决定语法高亮和自动补全行为,支持 `typescript`、`javascript`、`yaml`、`brick_next_yaml`、`cel`、`cel_yaml`、`cel_str` 等。
65
85
  * @default "plaintext"
66
86
  */
67
87
  accessor language: string | undefined;
68
88
  /**
69
- * 主题,支持 `"auto" | "vs" | "vs-dark"`
70
- *
89
+ * @description 编辑器主题,`auto` 跟随系统主题自动切换,`vs` 为亮色,`vs-dark` 为暗色。
71
90
  * @default "auto"
72
91
  * @group ui
73
92
  */
74
93
  accessor theme: string | undefined;
94
+ /**
95
+ * @description 是否为表单必填项,启用后表单提交时会校验该字段不能为空。
96
+ */
75
97
  accessor required: boolean | undefined;
98
+ /**
99
+ * @description 是否为只读模式,启用后用户无法编辑代码内容。
100
+ */
76
101
  accessor readOnly: boolean | undefined;
102
+ /**
103
+ * @description 自动布局模式:`fit-content` 根据内容高度自动调整编辑器高度(由 `minLines`/`maxLines` 控制范围),`fit-container` 自动填满父容器尺寸,`none` 不自动调整。
104
+ */
77
105
  accessor automaticLayout: "fit-container" | "fit-content" | "none" | undefined;
78
106
  /**
107
+ * @description 编辑器最小行数,与 `automaticLayout: "fit-content"` 配合使用,控制编辑器的最小显示高度。
79
108
  * @default 3
80
109
  */
81
110
  accessor minLines: number | undefined;
82
111
  /**
83
- * 仅对 language 为 brick_next_yaml 有效,设置第一层属性名的自动补全。
112
+ * @description 仅对 language 为 brick_next_yaml 有效,设置第一层属性名的自动补全。
84
113
  */
85
114
  accessor completers: monaco.languages.CompletionItem[] | undefined;
86
115
  /**
87
- * 高级自动补全配置。
88
- * - 设置为键值对时,仅对 language 为 brick_next_yaml 有效,设置任意的自动补全;
89
- * - 设置为数组时,当前仅对 language 为 cel 有效。
90
- * 未来将统一改为数组格式,废弃键值对格式的配置。
116
+ * @description 高级自动补全配置。设置为键值对时仅对 language 为 brick_next_yaml 有效,设置任意路径的自动补全;设置为数组时当前仅对 language 为 cel 等系列语言有效。未来将统一改为数组格式,废弃键值对格式。
91
117
  */
92
118
  accessor advancedCompleters: AdvancedCompleterMap | MixedCompleter[] | undefined;
119
+ /**
120
+ * @description 标记配置,用于在编辑器中对指定 token 进行高亮标注,并可关联错误/警告级别与提示信息,仅对 language 为 brick_next_yaml 有效。
121
+ */
93
122
  accessor markers: Marker[] | undefined;
123
+ /**
124
+ * @description 可点击链接的命名空间列表,在 language 为 brick_next_yaml 时,按住 Ctrl/Cmd 点击这些关键字可触发 `token.click` 事件。
125
+ */
94
126
  accessor links: string[] | undefined;
95
127
  /**
128
+ * @description 编辑器最大行数,与 `automaticLayout: "fit-content"` 配合使用,控制编辑器的最大显示高度(超出后出现滚动条)。
96
129
  * @default Infinity
97
130
  */
98
131
  accessor maxLines: number | undefined;
132
+ /**
133
+ * @description 固定高度(像素或 CSS 字符串),当 `automaticLayout` 不为 `fit-content` 时生效。
134
+ */
99
135
  accessor height: string | number | undefined;
136
+ /**
137
+ * @description 表单字段自定义校验提示信息。
138
+ */
100
139
  accessor message: string | undefined;
140
+ /**
141
+ * @description 编辑器为空时显示的占位提示文字。
142
+ */
101
143
  accessor placeholder: string | undefined;
102
144
  /**
103
- * 是否展示展开按钮
145
+ * @description 是否展示展开/收起按钮,点击后编辑器全屏展开,按 Esc 键收起。
104
146
  */
105
147
  accessor showExpandButton: boolean | undefined;
106
148
  /**
107
- * 行数配置
149
+ * @description 行号显示模式,`on` 显示行号,`off` 隐藏行号,也可传入函数自定义行号格式。
108
150
  */
109
151
  accessor lineNumbers: monaco.editor.LineNumbersType | undefined;
110
152
  /**
111
- * 自定义高亮配置
153
+ * @description 自定义高亮配置,目前支持 `showDSKey` 选项,在 brick_next_yaml 中控制是否对 DS(数据源)相关的 key 进行高亮显示。
112
154
  */
113
155
  accessor tokenConfig: TokenConfig | undefined;
114
156
  /**
115
- * 在 brick_next_yaml 中是否开启语义相关校验
157
+ * @description 在 brick_next_yaml 中是否开启嵌入 JavaScript 的语义相关校验(TypeScript 类型检查)。
116
158
  * @default false
117
159
  */
118
160
  accessor customValidationInBrickNextYaml: boolean | undefined;
119
161
  /**
120
- * 是否展示复制按钮
162
+ * @description 是否展示复制按钮,点击后将编辑器内容复制到剪贴板。
121
163
  * @default true
122
164
  */
123
165
  accessor showCopyButton: boolean | undefined;
124
166
  /**
125
- * 显示字形边距
167
+ * @description 是否显示字形边距(Glyph Margin),启用后在行号左侧留出额外空间,可用于显示调试断点等装饰器。
126
168
  * @default false
127
169
  */
128
170
  accessor glyphMargin: boolean | undefined;
129
171
  /**
130
- * 额外声明的 lib
172
+ * @description 额外声明的 TypeScript/JavaScript lib 库,用于在 javascript/typescript/brick_next_yaml 中提供自定义类型声明和自动补全提示。
131
173
  */
132
174
  accessor extraLibs: ExtraLib[] | undefined;
175
+ /**
176
+ * @description 额外的编辑器标记(Marker),可在指定位置显示错误/警告/信息级别的诊断提示,与 `markers` 不同,支持通过行列坐标精确定位。
177
+ */
133
178
  accessor extraMarkers: ExtraMarker[] | undefined;
134
179
  /**
180
+ * @description 是否将编辑器的悬浮提示(如自动补全下拉框、悬停文档等)渲染到 body 层,避免被父容器 overflow 裁剪。
135
181
  * @default true
136
182
  */
137
183
  accessor fixedOverflowWidgets: boolean | undefined;
138
184
  /**
139
- * 是否启用英语拼写检查
185
+ * @description 是否启用英语拼写检查,启用后会对代码中的英文单词进行拼写校验并标注错误。
140
186
  * @default true
141
187
  */
142
188
  accessor spellCheck: boolean | undefined;
143
189
  /**
144
- * 启用英语拼写检查时,除系统设置的词汇表外,指定其他的已知单词(小写)。
190
+ * @description 启用拼写检查时,在系统词汇表之外额外指定的已知单词列表(全小写),这些单词不会被标记为拼写错误。
145
191
  */
146
192
  accessor knownWords: string[] | undefined;
147
193
  /**
148
- * 是否启用 DOM 相关接口的自动提示。
194
+ * @description 是否启用 DOM 相关接口的 TypeScript 自动提示(lib: ["dom"]),启用后在 javascript/typescript 中可获得浏览器 DOM API 的类型声明。
149
195
  */
150
196
  accessor domLibsEnabled: boolean | undefined;
197
+ /**
198
+ * @description 编辑器模型的 URI 标识符,用于区分同一语言下的不同编辑器实例,影响 TypeScript/JavaScript 语言服务的作用域隔离。
199
+ */
151
200
  accessor uri: string | undefined;
152
201
  connectedCallback(): void;
153
202
  render(): React.JSX.Element;