symbols-app-connect 3.2.8
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/README.md +106 -0
- package/eslint.config.js +6 -0
- package/icon.png +0 -0
- package/out/extension.js +2814 -0
- package/package.json +103 -0
- package/src/data/components.ts +182 -0
- package/src/data/cssProperties.ts +187 -0
- package/src/data/designSystemValues.ts +294 -0
- package/src/data/domqlKeys.ts +321 -0
- package/src/data/elementMethods.ts +385 -0
- package/src/data/events.ts +368 -0
- package/src/extension.ts +82 -0
- package/src/providers/completionProvider.ts +595 -0
- package/src/providers/definitionProvider.ts +201 -0
- package/src/providers/hoverProvider.ts +162 -0
- package/src/providers/workspaceScanner.ts +98 -0
- package/symbols-app-connect-3.2.4.vsix +0 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
export interface MethodInfo {
|
|
2
|
+
label: string
|
|
3
|
+
detail: string
|
|
4
|
+
documentation: string
|
|
5
|
+
snippet: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const ELEMENT_METHODS: MethodInfo[] = [
|
|
9
|
+
// Traversal
|
|
10
|
+
{
|
|
11
|
+
label: 'lookup',
|
|
12
|
+
detail: 'lookup(key: string | function): element',
|
|
13
|
+
documentation:
|
|
14
|
+
'Walk up the ancestor chain to find an element by key name or predicate.\n\n```js\nel.lookup("Modal") // find ancestor named Modal\nel.lookup(e => e.props.isRoot) // find by predicate\n```',
|
|
15
|
+
snippet: 'lookup(${1:"key"})'
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
label: 'lookdown',
|
|
19
|
+
detail: 'lookdown(key: string | function): element',
|
|
20
|
+
documentation:
|
|
21
|
+
'Find the first matching descendant by key or predicate.\n\n```js\nel.lookdown("Input") // find first descendant named Input\n```',
|
|
22
|
+
snippet: 'lookdown(${1:"key"})'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
label: 'lookdownAll',
|
|
26
|
+
detail: 'lookdownAll(key: string | function): element[]',
|
|
27
|
+
documentation: 'Find all matching descendants.\n\n```js\nconst buttons = el.lookdownAll("Button")\n```',
|
|
28
|
+
snippet: 'lookdownAll(${1:"key"})'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'nextElement',
|
|
32
|
+
detail: 'nextElement(): element | null',
|
|
33
|
+
documentation: 'Returns the next sibling element in parent\'s children.',
|
|
34
|
+
snippet: 'nextElement()'
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: 'previousElement',
|
|
38
|
+
detail: 'previousElement(): element | null',
|
|
39
|
+
documentation: 'Returns the previous sibling element in parent\'s children.',
|
|
40
|
+
snippet: 'previousElement()'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'getChildren',
|
|
44
|
+
detail: 'getChildren(): element[]',
|
|
45
|
+
documentation: 'Returns all direct child elements as an array.',
|
|
46
|
+
snippet: 'getChildren()'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: 'getPath',
|
|
50
|
+
detail: 'getPath(): string[]',
|
|
51
|
+
documentation: 'Returns the path array from root to this element.',
|
|
52
|
+
snippet: 'getPath()'
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
// State navigation
|
|
56
|
+
{
|
|
57
|
+
label: 'getRootState',
|
|
58
|
+
detail: 'getRootState(key?: string): state',
|
|
59
|
+
documentation:
|
|
60
|
+
'Get the app-level root state, or a specific key from it.\n\n```js\nconst rootState = el.getRootState()\nconst user = el.getRootState("user")\n```',
|
|
61
|
+
snippet: 'getRootState(${1:"key"})'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
label: 'getRoot',
|
|
65
|
+
detail: 'getRoot(key?: string): element',
|
|
66
|
+
documentation: 'Get the root element of the tree, or a specific property from it.',
|
|
67
|
+
snippet: 'getRoot(${1:"key"})'
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
label: 'getRootData',
|
|
71
|
+
detail: 'getRootData(key?: string): any',
|
|
72
|
+
documentation: 'Get data from the root element.',
|
|
73
|
+
snippet: 'getRootData(${1:"key"})'
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
label: 'getRootContext',
|
|
77
|
+
detail: 'getRootContext(key?: string): any',
|
|
78
|
+
documentation: 'Get context from the root.',
|
|
79
|
+
snippet: 'getRootContext(${1:"key"})'
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: 'getContext',
|
|
83
|
+
detail: 'getContext(key: string): any',
|
|
84
|
+
documentation:
|
|
85
|
+
'Get a value from the element\'s context.\n\n```js\nconst router = el.getContext("functions.router")\n```',
|
|
86
|
+
snippet: 'getContext(${1:"key"})'
|
|
87
|
+
},
|
|
88
|
+
|
|
89
|
+
// Updates
|
|
90
|
+
{
|
|
91
|
+
label: 'update',
|
|
92
|
+
detail: 'update(params: object, opts?: object): element',
|
|
93
|
+
documentation:
|
|
94
|
+
'Partially update element properties and trigger re-renders.\n\n```js\nel.update({ text: "New text", color: "primary" })\n```',
|
|
95
|
+
snippet: 'update({ ${1:key}: ${2:value} })'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
label: 'set',
|
|
99
|
+
detail: 'set(params: object, opts?: object): element',
|
|
100
|
+
documentation:
|
|
101
|
+
'Full replacement of element content. Removes existing children and creates new ones.\n\n```js\nel.set({ text: "Replaced content" })\n```',
|
|
102
|
+
snippet: 'set({ ${1:key}: ${2:value} })'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
label: 'setProps',
|
|
106
|
+
detail: 'setProps(params: object, opts?: object): void',
|
|
107
|
+
documentation:
|
|
108
|
+
'Update element props specifically and trigger re-render.\n\n```js\nel.setProps({ disabled: true, color: "error" })\n```',
|
|
109
|
+
snippet: 'setProps({ ${1:key}: ${2:value} })'
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: 'reset',
|
|
113
|
+
detail: 'reset(opts?: object): void',
|
|
114
|
+
documentation: 'Reset element to its original definition.',
|
|
115
|
+
snippet: 'reset()'
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
// DOM
|
|
119
|
+
{
|
|
120
|
+
label: 'setNodeStyles',
|
|
121
|
+
detail: 'setNodeStyles(params: object): void',
|
|
122
|
+
documentation:
|
|
123
|
+
'Apply inline styles directly to the DOM node.\n\n```js\nel.setNodeStyles({ transform: "translateX(100px)", opacity: "0.5" })\n```',
|
|
124
|
+
snippet: 'setNodeStyles({ ${1:transform}: "${2:}" })'
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: 'remove',
|
|
128
|
+
detail: 'remove(opts?: object): void',
|
|
129
|
+
documentation: 'Remove element from DOM and clean up references.',
|
|
130
|
+
snippet: 'remove()'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
label: 'append',
|
|
134
|
+
detail: 'append(el: object, key?: string, opts?: object): element',
|
|
135
|
+
documentation:
|
|
136
|
+
'Append a new child element.\n\n```js\nel.append({ extends: "Button", text: "New" }, "AddButton")\n```',
|
|
137
|
+
snippet: 'append({ ${1:} }, "${2:key}")'
|
|
138
|
+
},
|
|
139
|
+
|
|
140
|
+
// Content
|
|
141
|
+
{
|
|
142
|
+
label: 'updateContent',
|
|
143
|
+
detail: 'updateContent(params: any, opts?: object): void',
|
|
144
|
+
documentation: 'Update the element\'s dynamic content (for elements with `content` prop).',
|
|
145
|
+
snippet: 'updateContent(${1:})'
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: 'removeContent',
|
|
149
|
+
detail: 'removeContent(opts?: object): void',
|
|
150
|
+
documentation: 'Remove the dynamic content child.',
|
|
151
|
+
snippet: 'removeContent()'
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
// Context function calls
|
|
155
|
+
{
|
|
156
|
+
label: 'call',
|
|
157
|
+
detail: 'call(fnKey: string, ...args): any',
|
|
158
|
+
documentation:
|
|
159
|
+
'Call a registered function from context (utils → functions → methods → snippets).\n\n```js\nel.call("exec", props.value, el) // execute dynamic prop\nel.call("fetchData", el.props.id) // call context function\nel.call("router", href, root, {}) // navigate\nel.call("isString", value) // call utility\n```',
|
|
160
|
+
snippet: 'call("${1:fnKey}"${2:, args})'
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
// Debugging
|
|
164
|
+
{
|
|
165
|
+
label: 'keys',
|
|
166
|
+
detail: 'keys(): string[]',
|
|
167
|
+
documentation: 'Returns the element\'s own keys (excluding internals).',
|
|
168
|
+
snippet: 'keys()'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: 'parse',
|
|
172
|
+
detail: 'parse(excl?: string[]): object',
|
|
173
|
+
documentation: 'Serialize element to a plain object.',
|
|
174
|
+
snippet: 'parse()'
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
label: 'parseDeep',
|
|
178
|
+
detail: 'parseDeep(excl?: string[]): object',
|
|
179
|
+
documentation: 'Deep serialize the element tree to a plain object.',
|
|
180
|
+
snippet: 'parseDeep()'
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: 'verbose',
|
|
184
|
+
detail: 'verbose(...args): void',
|
|
185
|
+
documentation: 'Log detailed element information to the console.',
|
|
186
|
+
snippet: 'verbose()'
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
label: 'get',
|
|
190
|
+
detail: 'get(key: string): any',
|
|
191
|
+
documentation: 'Get an element property by key.',
|
|
192
|
+
snippet: 'get("${1:key}")'
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
label: 'getRef',
|
|
196
|
+
detail: 'getRef(key: string): any',
|
|
197
|
+
documentation: 'Get a value from the `__ref` internal reference.',
|
|
198
|
+
snippet: 'getRef("${1:key}")'
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
label: 'spotByPath',
|
|
202
|
+
detail: 'spotByPath(path: string[]): element',
|
|
203
|
+
documentation: 'Traverse element tree to find element at given path array.',
|
|
204
|
+
snippet: 'spotByPath([${1:}])'
|
|
205
|
+
}
|
|
206
|
+
]
|
|
207
|
+
|
|
208
|
+
export const STATE_METHODS: MethodInfo[] = [
|
|
209
|
+
{
|
|
210
|
+
label: 'update',
|
|
211
|
+
detail: 'state.update(obj: object, opts?: object): void',
|
|
212
|
+
documentation:
|
|
213
|
+
'Partially update state values and trigger re-renders for all dependent elements.\n\n```js\nstate.update({ count: state.count + 1 })\nstate.update({ open: !state.open, loading: false })\n```',
|
|
214
|
+
snippet: 'update({ ${1:key}: ${2:value} })'
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
label: 'set',
|
|
218
|
+
detail: 'state.set(val: any, opts?: object): void',
|
|
219
|
+
documentation:
|
|
220
|
+
'Replace the entire state with a new value.\n\n```js\nstate.set({ name: "New", count: 0 })\n```',
|
|
221
|
+
snippet: 'set(${1:value})'
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
label: 'reset',
|
|
225
|
+
detail: 'state.reset(opts?: object): void',
|
|
226
|
+
documentation: 'Reset state to its initial values.',
|
|
227
|
+
snippet: 'reset()'
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
label: 'toggle',
|
|
231
|
+
detail: 'state.toggle(key: string, opts?: object): void',
|
|
232
|
+
documentation:
|
|
233
|
+
'Flip a boolean state property.\n\n```js\nstate.toggle("open") // open: false → true → false\nstate.toggle("active")\n```',
|
|
234
|
+
snippet: 'toggle("${1:key}")'
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
label: 'remove',
|
|
238
|
+
detail: 'state.remove(key?: string, opts?: object): void',
|
|
239
|
+
documentation: 'Remove a property (or the whole state node) from state.',
|
|
240
|
+
snippet: 'remove("${1:key}")'
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: 'add',
|
|
244
|
+
detail: 'state.add(value: any, opts?: object): void',
|
|
245
|
+
documentation: 'Push an item to an array state.\n\n```js\nstate.add({ id: 1, text: "New item" })\n```',
|
|
246
|
+
snippet: 'add(${1:value})'
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
label: 'quietUpdate',
|
|
250
|
+
detail: 'state.quietUpdate(obj: object, opts?: object): void',
|
|
251
|
+
documentation: 'Update state WITHOUT triggering listeners or re-renders. Useful for internal tracking.',
|
|
252
|
+
snippet: 'quietUpdate({ ${1:key}: ${2:value} })'
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: 'quietReplace',
|
|
256
|
+
detail: 'state.quietReplace(obj: object, opts?: object): void',
|
|
257
|
+
documentation: 'Replace state values without triggering listeners.',
|
|
258
|
+
snippet: 'quietReplace({ ${1:key}: ${2:value} })'
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
label: 'replace',
|
|
262
|
+
detail: 'state.replace(obj: object, opts?: object): void',
|
|
263
|
+
documentation: 'Replace state values (triggers listeners).',
|
|
264
|
+
snippet: 'replace({ ${1:key}: ${2:value} })'
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
label: 'apply',
|
|
268
|
+
detail: 'state.apply(func: function, opts?: object): void',
|
|
269
|
+
documentation:
|
|
270
|
+
'Mutate state with a function (for array operations like push).\n\n```js\nstate.apply(s => { s.items.push(newItem) })\n```',
|
|
271
|
+
snippet: 'apply(s => { ${1:} })'
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
label: 'applyFunction',
|
|
275
|
+
detail: 'state.applyFunction(func: function, opts?: object): Promise<void>',
|
|
276
|
+
documentation: 'Async version of apply.',
|
|
277
|
+
snippet: 'applyFunction(async s => { ${1:} })'
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
label: 'setByPath',
|
|
281
|
+
detail: 'state.setByPath(path: string, value: any, opts?: object): void',
|
|
282
|
+
documentation:
|
|
283
|
+
'Set a nested property using dot-path string.\n\n```js\nstate.setByPath("user.profile.name", "Alice")\n```',
|
|
284
|
+
snippet: 'setByPath("${1:path}", ${2:value})'
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
label: 'getByPath',
|
|
288
|
+
detail: 'state.getByPath(path: string, opts?: object): any',
|
|
289
|
+
documentation:
|
|
290
|
+
'Get a nested value by dot-path string.\n\n```js\nconst name = state.getByPath("user.profile.name")\n```',
|
|
291
|
+
snippet: 'getByPath("${1:path}")'
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
label: 'setPathCollection',
|
|
295
|
+
detail: 'state.setPathCollection(changes: object, opts?: object): void',
|
|
296
|
+
documentation: 'Batch update multiple nested paths at once.',
|
|
297
|
+
snippet: 'setPathCollection({ "${1:path}": ${2:value} })'
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
label: 'removeByPath',
|
|
301
|
+
detail: 'state.removeByPath(path: string, opts?: object): void',
|
|
302
|
+
documentation: 'Remove a nested property by dot-path string.',
|
|
303
|
+
snippet: 'removeByPath("${1:path}")'
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
label: 'removePathCollection',
|
|
307
|
+
detail: 'state.removePathCollection(changes: object, opts?: object): void',
|
|
308
|
+
documentation: 'Batch remove multiple nested paths.',
|
|
309
|
+
snippet: 'removePathCollection({ "${1:path}": ${2:true} })'
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
label: 'parse',
|
|
313
|
+
detail: 'state.parse(): object',
|
|
314
|
+
documentation: 'Return state as plain object (strips methods and internal keys).',
|
|
315
|
+
snippet: 'parse()'
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
label: 'clean',
|
|
319
|
+
detail: 'state.clean(opts?: object): void',
|
|
320
|
+
documentation: 'Clear all state properties.',
|
|
321
|
+
snippet: 'clean()'
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
label: 'destroy',
|
|
325
|
+
detail: 'state.destroy(opts?: object): void',
|
|
326
|
+
documentation: 'Destroy state and sever element relationship.',
|
|
327
|
+
snippet: 'destroy()'
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
label: 'parentUpdate',
|
|
331
|
+
detail: 'state.parentUpdate(obj: object, opts?: object): void',
|
|
332
|
+
documentation: 'Update parent element\'s state.',
|
|
333
|
+
snippet: 'parentUpdate({ ${1:key}: ${2:value} })'
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
label: 'rootUpdate',
|
|
337
|
+
detail: 'state.rootUpdate(obj: object, opts?: object): void',
|
|
338
|
+
documentation: 'Update the root application state.',
|
|
339
|
+
snippet: 'rootUpdate({ ${1:key}: ${2:value} })'
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
label: 'keys',
|
|
343
|
+
detail: 'state.keys(): string[]',
|
|
344
|
+
documentation: 'Returns state property keys.',
|
|
345
|
+
snippet: 'keys()'
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
label: 'values',
|
|
349
|
+
detail: 'state.values(): any[]',
|
|
350
|
+
documentation: 'Returns state property values.',
|
|
351
|
+
snippet: 'values()'
|
|
352
|
+
}
|
|
353
|
+
]
|
|
354
|
+
|
|
355
|
+
export const HTML_ATTRIBUTES = [
|
|
356
|
+
// Global
|
|
357
|
+
'id', 'class', 'style', 'title', 'lang', 'dir', 'hidden', 'tabindex', 'contenteditable',
|
|
358
|
+
'draggable', 'spellcheck', 'translate', 'accesskey',
|
|
359
|
+
// Data
|
|
360
|
+
'data-id', 'data-key', 'data-value', 'data-index', 'data-type', 'data-name',
|
|
361
|
+
// Input
|
|
362
|
+
'type', 'name', 'value', 'placeholder', 'required', 'disabled', 'readonly',
|
|
363
|
+
'checked', 'selected', 'multiple', 'min', 'max', 'step', 'maxlength', 'minlength',
|
|
364
|
+
'pattern', 'autocomplete', 'autofocus', 'form', 'formaction', 'formmethod',
|
|
365
|
+
'accept', 'capture',
|
|
366
|
+
// Link/Anchor
|
|
367
|
+
'href', 'target', 'rel', 'download', 'hreflang', 'ping', 'referrerpolicy',
|
|
368
|
+
// Media
|
|
369
|
+
'src', 'alt', 'loading', 'decoding', 'crossorigin', 'usemap',
|
|
370
|
+
'controls', 'autoplay', 'muted', 'loop', 'preload', 'poster',
|
|
371
|
+
'width', 'height',
|
|
372
|
+
// Forms
|
|
373
|
+
'action', 'method', 'enctype', 'novalidate',
|
|
374
|
+
'for', 'colspan', 'rowspan', 'scope',
|
|
375
|
+
// ARIA
|
|
376
|
+
'role', 'aria-label', 'aria-labelledby', 'aria-describedby', 'aria-hidden',
|
|
377
|
+
'aria-expanded', 'aria-selected', 'aria-checked', 'aria-disabled',
|
|
378
|
+
'aria-controls', 'aria-owns', 'aria-live', 'aria-atomic', 'aria-relevant',
|
|
379
|
+
'aria-busy', 'aria-current', 'aria-haspopup', 'aria-modal', 'aria-multiline',
|
|
380
|
+
'aria-multiselectable', 'aria-orientation', 'aria-placeholder',
|
|
381
|
+
'aria-readonly', 'aria-required', 'aria-sort', 'aria-valuemax',
|
|
382
|
+
'aria-valuemin', 'aria-valuenow', 'aria-valuetext',
|
|
383
|
+
// Other
|
|
384
|
+
'tabindex', 'contenteditable', 'autofocus', 'sandbox', 'allow', 'frameborder'
|
|
385
|
+
]
|