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,294 @@
|
|
|
1
|
+
// Design system token values for smart value completions
|
|
2
|
+
|
|
3
|
+
// Sequence-based design tokens
|
|
4
|
+
// Each type (spacing, typography, timing) has its own base, ratio, and unit
|
|
5
|
+
// Formula: value = base × ratio^index
|
|
6
|
+
// Letter mapping: U(-6) V(-5) W(-4) X(-3) Y(-2) Z(-1) A(0) B(1) C(2) D(3) E(4) F(5) G(6) H(7)
|
|
7
|
+
// Sub-steps (1,2) interpolate between main steps using golden-ratio subdivision
|
|
8
|
+
|
|
9
|
+
export interface SequenceToken {
|
|
10
|
+
label: string
|
|
11
|
+
approxValue: string // includes unit
|
|
12
|
+
index: number
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SequenceConfig {
|
|
16
|
+
type: string
|
|
17
|
+
base: number
|
|
18
|
+
ratio: number
|
|
19
|
+
unit: string
|
|
20
|
+
description: string
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// Default configs per type
|
|
24
|
+
export const SEQUENCE_CONFIGS: Record<string, SequenceConfig> = {
|
|
25
|
+
spacing: { type: 'spacing', base: 16, ratio: 1.618, unit: 'em', description: 'Spacing (golden ratio)' },
|
|
26
|
+
typography: { type: 'font-size', base: 16, ratio: 1.25, unit: 'em', description: 'Typography (major third)' },
|
|
27
|
+
timing: { type: 'timing', base: 150, ratio: 1.333, unit: 'ms', description: 'Timing (perfect fourth)' },
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// Sub-ratio calculation (matches getSubratioDifference in sequence.js)
|
|
31
|
+
function getSubValues(base: number, ratio: number, value: number): number[] {
|
|
32
|
+
const next = value * ratio
|
|
33
|
+
const diff = next - value
|
|
34
|
+
const subRatio = diff / 1.618
|
|
35
|
+
const first = next - subRatio
|
|
36
|
+
const second = value + subRatio
|
|
37
|
+
const middle = (first + second) / 2
|
|
38
|
+
const diffRounded = Math.floor(next) - Math.floor(value)
|
|
39
|
+
return diffRounded > 16 ? [first, middle, second] : [first, second]
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function formatValue(val: number, unit: string): string {
|
|
43
|
+
if (unit === 'ms') return `~${Math.round(val)}ms`
|
|
44
|
+
if (val >= 100) return `~${Math.round(val)}px`
|
|
45
|
+
if (val >= 10) return `~${Math.round(val * 10) / 10}px`
|
|
46
|
+
return `~${Math.round(val * 100) / 100}px`
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Letter map (matches numToLetterMap in sequence.js)
|
|
50
|
+
const NUM_TO_LETTER: Record<number, string> = {
|
|
51
|
+
'-6': 'U', '-5': 'V', '-4': 'W', '-3': 'X', '-2': 'Y', '-1': 'Z',
|
|
52
|
+
0: 'A', 1: 'B', 2: 'C', 3: 'D', 4: 'E', 5: 'F', 6: 'G', 7: 'H',
|
|
53
|
+
} as any
|
|
54
|
+
|
|
55
|
+
function generateTokens(config: SequenceConfig, rangeStart: number, rangeEnd: number): SequenceToken[] {
|
|
56
|
+
const tokens: SequenceToken[] = []
|
|
57
|
+
for (let key = rangeStart; key <= rangeEnd; key++) {
|
|
58
|
+
const letter = (NUM_TO_LETTER as any)[key]
|
|
59
|
+
if (!letter) continue
|
|
60
|
+
const value = config.base * Math.pow(config.ratio, key)
|
|
61
|
+
const approx = key === 0 && config.unit !== 'ms'
|
|
62
|
+
? `${config.base}px`
|
|
63
|
+
: formatValue(value, config.unit)
|
|
64
|
+
tokens.push({ label: letter, approxValue: approx, index: key })
|
|
65
|
+
|
|
66
|
+
// Generate sub-steps
|
|
67
|
+
const subs = getSubValues(config.base, config.ratio, value)
|
|
68
|
+
subs.forEach((sv, i) => {
|
|
69
|
+
tokens.push({
|
|
70
|
+
label: `${letter}${i + 1}`,
|
|
71
|
+
approxValue: formatValue(sv, config.unit),
|
|
72
|
+
index: key + (i + 1) / 10,
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
}
|
|
76
|
+
return tokens
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Pre-generate tokens for each type
|
|
80
|
+
export const SPACING_TOKENS = generateTokens(SEQUENCE_CONFIGS.spacing, -4, 7)
|
|
81
|
+
export const TYPOGRAPHY_TOKENS = generateTokens(SEQUENCE_CONFIGS.typography, -3, 7)
|
|
82
|
+
export const TIMING_TOKENS = generateTokens(SEQUENCE_CONFIGS.timing, -3, 7)
|
|
83
|
+
|
|
84
|
+
export const SPACING_SCALE = SPACING_TOKENS.map(t => t.label)
|
|
85
|
+
export const FONT_SIZE_SCALE = TYPOGRAPHY_TOKENS.map(t => t.label)
|
|
86
|
+
|
|
87
|
+
// Default color tokens with hex values
|
|
88
|
+
export interface ColorToken {
|
|
89
|
+
label: string
|
|
90
|
+
hex: string
|
|
91
|
+
description?: string
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export const COLOR_TOKEN_MAP: ColorToken[] = [
|
|
95
|
+
{ label: 'blue', hex: '#213eb0' },
|
|
96
|
+
{ label: 'green', hex: '#389d34' },
|
|
97
|
+
{ label: 'red', hex: '#e15c55' },
|
|
98
|
+
{ label: 'yellow', hex: '#EDCB38' },
|
|
99
|
+
{ label: 'orange', hex: '#e97c16' },
|
|
100
|
+
{ label: 'transparent', hex: 'rgba(0,0,0,0)' },
|
|
101
|
+
{ label: 'black', hex: '#000000' },
|
|
102
|
+
{ label: 'gray', hex: '#4e4e50' },
|
|
103
|
+
{ label: 'white', hex: '#ffffff' },
|
|
104
|
+
{ label: 'title', hex: '', description: 'Near-black text (light) / near-white text (dark)' },
|
|
105
|
+
{ label: 'caption', hex: '', description: 'Secondary text color, adapts to theme' },
|
|
106
|
+
{ label: 'paragraph', hex: '', description: 'Body text color, adapts to theme' },
|
|
107
|
+
{ label: 'disabled', hex: '', description: 'Muted/disabled text color' },
|
|
108
|
+
{ label: 'line', hex: '', description: 'Border/divider color, adapts to theme' },
|
|
109
|
+
{ label: 'currentColor', hex: '', description: 'Inherits current text color' },
|
|
110
|
+
{ label: 'inherit', hex: '', description: 'Inherits from parent' },
|
|
111
|
+
{ label: 'none', hex: '', description: 'No color' },
|
|
112
|
+
]
|
|
113
|
+
|
|
114
|
+
export const COLOR_TOKENS = COLOR_TOKEN_MAP.map(t => t.label)
|
|
115
|
+
|
|
116
|
+
// Color modifier syntax hints
|
|
117
|
+
export const COLOR_MODIFIERS = [
|
|
118
|
+
{ suffix: '.5', description: '50% opacity (e.g. blue.5)' },
|
|
119
|
+
{ suffix: '+N', description: 'Lighten by N (e.g. gray+16)' },
|
|
120
|
+
{ suffix: '-N', description: 'Darken by N (e.g. gray-26)' },
|
|
121
|
+
{ suffix: '=N', description: 'Set HSL lightness to N (e.g. gray=50)' },
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
// Default gradient tokens
|
|
125
|
+
export const GRADIENT_TOKENS = [
|
|
126
|
+
'gradient-blue-light', 'gradient-blue-dark',
|
|
127
|
+
'gradient-dark', 'gradient-dark-active',
|
|
128
|
+
'gradient-light', 'gradient-light-active',
|
|
129
|
+
'gradient-colorful'
|
|
130
|
+
]
|
|
131
|
+
|
|
132
|
+
// Theme tokens (from default config)
|
|
133
|
+
export const THEME_TOKENS = [
|
|
134
|
+
'document', 'primary', 'secondary', 'tertiary', 'quaternary', 'quinary',
|
|
135
|
+
'alert', 'warning', 'success',
|
|
136
|
+
'field', 'label', 'card', 'dialog',
|
|
137
|
+
'none', 'transparent'
|
|
138
|
+
]
|
|
139
|
+
|
|
140
|
+
// Theme modifiers that can be appended with space
|
|
141
|
+
export const THEME_MODIFIERS = [
|
|
142
|
+
'.color-only', '.inactive', '.gradient',
|
|
143
|
+
'.child', '.secondary', '.helper',
|
|
144
|
+
'.light', '.dark', '.active'
|
|
145
|
+
]
|
|
146
|
+
|
|
147
|
+
// Default icon names (feather icons + custom)
|
|
148
|
+
export const ICON_NAMES = [
|
|
149
|
+
'symbols', 'logo',
|
|
150
|
+
'arrowDownCircle', 'arrowDownLeft', 'arrowDownRight', 'arrowDown',
|
|
151
|
+
'arrowLeftCircle', 'arrowLeft', 'arrowRight', 'arrowRightCircle',
|
|
152
|
+
'arrowUpCircle', 'arrowUpLeft', 'arrowUpRight', 'arrowUp',
|
|
153
|
+
'checkCircle', 'check',
|
|
154
|
+
'chevronDown', 'chevronLeft', 'chevronRight', 'chevronUp',
|
|
155
|
+
'copy', 'eyeOff', 'eye', 'info', 'lock', 'minus',
|
|
156
|
+
'sun', 'moon', 'moreHorizontal', 'moreVertical',
|
|
157
|
+
'send', 'smile', 'search', 'upload', 'video', 'x', 'star', 'plus'
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
// Media query tokens (for @media keys)
|
|
161
|
+
export const MEDIA_TOKENS = [
|
|
162
|
+
'tv',
|
|
163
|
+
'screenL', 'screenL<', 'screenM', 'screenM<', 'screenS', 'screenS<',
|
|
164
|
+
'tabletL', 'tabletL<', 'tabletM', 'tabletM<', 'tabletS', 'tabletS<',
|
|
165
|
+
'mobileL', 'mobileL<', 'mobileM', 'mobileM<',
|
|
166
|
+
'mobileS', 'mobileS<', 'mobileXS', 'mobileXS<',
|
|
167
|
+
'light', 'dark', 'print'
|
|
168
|
+
]
|
|
169
|
+
|
|
170
|
+
// HTML tag names for tag: completions
|
|
171
|
+
export const HTML_TAGS = [
|
|
172
|
+
'div', 'span', 'p', 'a', 'button', 'input', 'textarea', 'select', 'option',
|
|
173
|
+
'form', 'label', 'fieldset', 'legend',
|
|
174
|
+
'h1', 'h2', 'h3', 'h4', 'h5', 'h6',
|
|
175
|
+
'ul', 'ol', 'li', 'dl', 'dt', 'dd',
|
|
176
|
+
'table', 'thead', 'tbody', 'tfoot', 'tr', 'th', 'td',
|
|
177
|
+
'section', 'article', 'aside', 'header', 'footer', 'nav', 'main',
|
|
178
|
+
'figure', 'figcaption', 'blockquote', 'pre', 'code',
|
|
179
|
+
'img', 'picture', 'source', 'video', 'audio', 'canvas',
|
|
180
|
+
'svg', 'path', 'circle', 'rect', 'line', 'g',
|
|
181
|
+
'iframe', 'embed', 'object',
|
|
182
|
+
'details', 'summary', 'dialog', 'menu',
|
|
183
|
+
'hr', 'br', 'wbr',
|
|
184
|
+
'strong', 'em', 'b', 'i', 'u', 's', 'small', 'sub', 'sup', 'mark', 'abbr',
|
|
185
|
+
'time', 'data', 'output', 'progress', 'meter'
|
|
186
|
+
]
|
|
187
|
+
|
|
188
|
+
// CSS property value enums
|
|
189
|
+
export const CSS_VALUE_ENUMS: Record<string, string[]> = {
|
|
190
|
+
display: ['flex', 'grid', 'block', 'inline', 'inline-flex', 'inline-grid', 'inline-block', 'none', 'contents'],
|
|
191
|
+
position: ['relative', 'absolute', 'fixed', 'sticky', 'static'],
|
|
192
|
+
overflow: ['hidden', 'auto', 'scroll', 'visible', 'clip'],
|
|
193
|
+
overflowX: ['hidden', 'auto', 'scroll', 'visible', 'clip'],
|
|
194
|
+
overflowY: ['hidden', 'auto', 'scroll', 'visible', 'clip'],
|
|
195
|
+
visibility: ['visible', 'hidden', 'collapse'],
|
|
196
|
+
flexDirection: ['row', 'column', 'row-reverse', 'column-reverse'],
|
|
197
|
+
flexWrap: ['wrap', 'nowrap', 'wrap-reverse'],
|
|
198
|
+
alignItems: ['center', 'flex-start', 'flex-end', 'stretch', 'baseline'],
|
|
199
|
+
alignContent: ['center', 'flex-start', 'flex-end', 'stretch', 'space-between', 'space-around', 'space-evenly'],
|
|
200
|
+
alignSelf: ['center', 'flex-start', 'flex-end', 'stretch', 'baseline', 'auto'],
|
|
201
|
+
justifyContent: ['center', 'flex-start', 'flex-end', 'space-between', 'space-around', 'space-evenly', 'stretch'],
|
|
202
|
+
justifyItems: ['center', 'start', 'end', 'stretch', 'baseline'],
|
|
203
|
+
justifySelf: ['center', 'start', 'end', 'stretch', 'baseline', 'auto'],
|
|
204
|
+
textAlign: ['left', 'center', 'right', 'justify', 'start', 'end'],
|
|
205
|
+
textDecoration: ['none', 'underline', 'line-through', 'overline'],
|
|
206
|
+
textTransform: ['none', 'uppercase', 'lowercase', 'capitalize'],
|
|
207
|
+
textOverflow: ['ellipsis', 'clip'],
|
|
208
|
+
whiteSpace: ['nowrap', 'pre', 'pre-wrap', 'pre-line', 'normal', 'break-spaces'],
|
|
209
|
+
wordBreak: ['break-word', 'break-all', 'keep-all', 'normal'],
|
|
210
|
+
fontStyle: ['normal', 'italic', 'oblique'],
|
|
211
|
+
fontWeight: ['100', '200', '300', '400', '500', '600', '700', '800', '900', 'normal', 'bold', 'lighter', 'bolder'],
|
|
212
|
+
cursor: ['pointer', 'default', 'move', 'text', 'wait', 'help', 'crosshair', 'not-allowed', 'grab', 'grabbing', 'zoom-in', 'zoom-out', 'col-resize', 'row-resize', 'none'],
|
|
213
|
+
pointerEvents: ['auto', 'none', 'all'],
|
|
214
|
+
userSelect: ['none', 'auto', 'text', 'all', 'contain'],
|
|
215
|
+
objectFit: ['cover', 'contain', 'fill', 'none', 'scale-down'],
|
|
216
|
+
objectPosition: ['center', 'top', 'bottom', 'left', 'right'],
|
|
217
|
+
resize: ['none', 'both', 'horizontal', 'vertical'],
|
|
218
|
+
listStyle: ['none', 'disc', 'circle', 'square', 'decimal'],
|
|
219
|
+
borderStyle: ['solid', 'dashed', 'dotted', 'double', 'none', 'groove', 'ridge', 'inset', 'outset'],
|
|
220
|
+
boxSizing: ['border-box', 'content-box'],
|
|
221
|
+
backgroundSize: ['cover', 'contain', 'auto'],
|
|
222
|
+
backgroundRepeat: ['no-repeat', 'repeat', 'repeat-x', 'repeat-y', 'round', 'space'],
|
|
223
|
+
backgroundPosition: ['center', 'top', 'bottom', 'left', 'right', 'center center', 'top center', 'bottom center'],
|
|
224
|
+
backgroundClip: ['border-box', 'padding-box', 'content-box', 'text'],
|
|
225
|
+
mixBlendMode: ['normal', 'multiply', 'screen', 'overlay', 'darken', 'lighten', 'color-dodge', 'color-burn', 'difference', 'exclusion'],
|
|
226
|
+
isolation: ['auto', 'isolate'],
|
|
227
|
+
appearance: ['none', 'auto'],
|
|
228
|
+
verticalAlign: ['top', 'middle', 'bottom', 'baseline', 'text-top', 'text-bottom'],
|
|
229
|
+
tableLayout: ['auto', 'fixed'],
|
|
230
|
+
willChange: ['auto', 'transform', 'opacity', 'scroll-position'],
|
|
231
|
+
|
|
232
|
+
// DOMQL shorthand values
|
|
233
|
+
flow: ['column', 'row', 'x', 'y', 'column-reverse', 'row-reverse'],
|
|
234
|
+
wrap: ['wrap', 'nowrap', 'wrap-reverse'],
|
|
235
|
+
scope: ['state', 'props'],
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// Properties that accept color values
|
|
239
|
+
export const COLOR_PROPERTIES = new Set([
|
|
240
|
+
'color', 'background', 'backgroundColor', 'borderColor',
|
|
241
|
+
'borderTopColor', 'borderRightColor', 'borderBottomColor', 'borderLeftColor',
|
|
242
|
+
'outlineColor', 'fill', 'stroke', 'caretColor', 'accentColor',
|
|
243
|
+
'textDecorationColor', 'columnRuleColor'
|
|
244
|
+
])
|
|
245
|
+
|
|
246
|
+
// Properties that accept spacing/size tokens
|
|
247
|
+
export const SPACING_PROPERTIES = new Set([
|
|
248
|
+
'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft',
|
|
249
|
+
'paddingInline', 'paddingBlock',
|
|
250
|
+
'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft',
|
|
251
|
+
'marginInline', 'marginBlock',
|
|
252
|
+
'gap', 'rowGap', 'columnGap',
|
|
253
|
+
'top', 'right', 'bottom', 'left', 'inset',
|
|
254
|
+
'width', 'height', 'minWidth', 'maxWidth', 'minHeight', 'maxHeight',
|
|
255
|
+
'flexBasis',
|
|
256
|
+
'borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius',
|
|
257
|
+
'borderBottomLeftRadius', 'borderBottomRightRadius',
|
|
258
|
+
'round', 'boxSize', 'widthRange', 'heightRange',
|
|
259
|
+
'borderWidth', 'outlineOffset', 'outlineWidth'
|
|
260
|
+
])
|
|
261
|
+
|
|
262
|
+
// Properties that accept font size tokens
|
|
263
|
+
export const FONT_SIZE_PROPERTIES = new Set([
|
|
264
|
+
'fontSize', 'lineHeight', 'letterSpacing'
|
|
265
|
+
])
|
|
266
|
+
|
|
267
|
+
// Input type attribute values
|
|
268
|
+
export const INPUT_TYPES = [
|
|
269
|
+
'text', 'password', 'email', 'number', 'tel', 'url', 'search',
|
|
270
|
+
'date', 'time', 'datetime-local', 'month', 'week',
|
|
271
|
+
'color', 'range', 'file', 'hidden',
|
|
272
|
+
'checkbox', 'radio', 'submit', 'reset', 'button', 'image'
|
|
273
|
+
]
|
|
274
|
+
|
|
275
|
+
// Target attribute values
|
|
276
|
+
export const TARGET_VALUES = ['_self', '_blank', '_parent', '_top']
|
|
277
|
+
|
|
278
|
+
// Rel attribute values
|
|
279
|
+
export const REL_VALUES = [
|
|
280
|
+
'noopener', 'noreferrer', 'nofollow', 'external',
|
|
281
|
+
'noopener noreferrer', 'stylesheet', 'icon', 'preload', 'prefetch'
|
|
282
|
+
]
|
|
283
|
+
|
|
284
|
+
// Autocomplete attribute values
|
|
285
|
+
export const AUTOCOMPLETE_VALUES = [
|
|
286
|
+
'off', 'on', 'name', 'email', 'username', 'new-password', 'current-password',
|
|
287
|
+
'tel', 'address-line1', 'address-line2', 'country', 'postal-code'
|
|
288
|
+
]
|
|
289
|
+
|
|
290
|
+
// Boolean-like attribute values
|
|
291
|
+
export const BOOLEAN_VALUES = ['true', 'false']
|
|
292
|
+
|
|
293
|
+
// Loading attribute values
|
|
294
|
+
export const LOADING_VALUES = ['lazy', 'eager']
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
export interface DomqlKeyInfo {
|
|
2
|
+
label: string
|
|
3
|
+
detail: string
|
|
4
|
+
documentation: string
|
|
5
|
+
snippet?: string
|
|
6
|
+
kind: 'property' | 'method' | 'event' | 'component'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const DOMQL_REGISTRY_KEYS: DomqlKeyInfo[] = [
|
|
10
|
+
{
|
|
11
|
+
label: 'extends',
|
|
12
|
+
detail: 'extends: string | object | array',
|
|
13
|
+
documentation:
|
|
14
|
+
'Extend from one or more registered components. String references a component by name from context.components. Array allows multiple extends (first = highest priority).\n\n```js\nextends: "Button"\nextends: ["IconText", "Focusable"]\nextends: ButtonBase\n```',
|
|
15
|
+
snippet: "extends: '${1:ComponentName}'",
|
|
16
|
+
kind: 'property'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'tag',
|
|
20
|
+
detail: 'tag: string',
|
|
21
|
+
documentation:
|
|
22
|
+
'HTML tag name for the element node. Defaults to `div`.\n\n```js\ntag: "section"\ntag: "button"\ntag: "a"\n```',
|
|
23
|
+
snippet: "tag: '${1:div}'",
|
|
24
|
+
kind: 'property'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: 'text',
|
|
28
|
+
detail: 'text: string | function',
|
|
29
|
+
documentation:
|
|
30
|
+
'Text content of the element. Can be a static string or a function returning a string.\n\n```js\ntext: "Hello world"\ntext: ({ props }) => props.label\ntext: ({ state }) => `Count: ${state.count}`\n```',
|
|
31
|
+
snippet: "text: '${1:}'",
|
|
32
|
+
kind: 'property'
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'html',
|
|
36
|
+
detail: 'html: string | function',
|
|
37
|
+
documentation:
|
|
38
|
+
'Raw HTML content. Sets innerHTML. Use sparingly — XSS risk with user data.\n\n```js\nhtml: ({ props }) => props.richContent\nhtml: "<strong>Bold</strong>"\n```',
|
|
39
|
+
snippet: 'html: ${1:},',
|
|
40
|
+
kind: 'property'
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'attr',
|
|
44
|
+
detail: 'attr: object',
|
|
45
|
+
documentation:
|
|
46
|
+
'HTML attributes to set on the DOM node. Values can be static or functions. Returning `null` removes the attribute.\n\n```js\nattr: {\n placeholder: ({ props }) => props.placeholder,\n disabled: ({ props }) => props.disabled || null,\n role: "button",\n "aria-label": ({ props }) => props.label\n}\n```',
|
|
47
|
+
snippet: 'attr: {\n ${1:placeholder}: ${2:},\n},',
|
|
48
|
+
kind: 'property'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: 'state',
|
|
52
|
+
detail: 'state: object | string',
|
|
53
|
+
documentation:
|
|
54
|
+
'Local reactive state for the element. Use `state.update()` to update and trigger re-renders. String value inherits from ancestor state.\n\n```js\nstate: { open: false, count: 0, data: null }\nstate: "~/user" // inherit from root state key\n```',
|
|
55
|
+
snippet: 'state: { ${1:key}: ${2:value} },',
|
|
56
|
+
kind: 'property'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'if',
|
|
60
|
+
detail: 'if: function | boolean',
|
|
61
|
+
documentation:
|
|
62
|
+
'Conditional rendering. Element only renders when this returns truthy.\n\n```js\nif: ({ state }) => state.isVisible\nif: ({ props }) => Boolean(props.show)\nif: (el, state) => state.isAuthenticated\n```',
|
|
63
|
+
snippet: 'if: ({ ${1:state} }) => ${2:condition},',
|
|
64
|
+
kind: 'property'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'define',
|
|
68
|
+
detail: 'define: object',
|
|
69
|
+
documentation:
|
|
70
|
+
'Register custom property transformers. When a matching key appears on an element, this handler runs.\n\n```js\ndefine: {\n isActive: (param, el, state) => {\n if (param) el.node.classList.add("active")\n else el.node.classList.remove("active")\n }\n}\n```',
|
|
71
|
+
snippet: 'define: {\n ${1:propName}: (param, el, state) => {\n ${2:}\n }\n},',
|
|
72
|
+
kind: 'property'
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: 'style',
|
|
76
|
+
detail: 'style: object',
|
|
77
|
+
documentation:
|
|
78
|
+
'Inline styles or emotion CSS-in-JS with nested selectors. Escape hatch for complex selectors.\n\n```js\nstyle: {\n "&:hover [dropdown]": {\n opacity: 1,\n transform: "translate3d(0,0,0)"\n }\n}\n```',
|
|
79
|
+
snippet: 'style: {\n ${1:property}: ${2:value},\n},',
|
|
80
|
+
kind: 'property'
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'data',
|
|
84
|
+
detail: 'data: object',
|
|
85
|
+
documentation:
|
|
86
|
+
'Non-reactive data store. Store mutable references (chart instances, timers) that should NOT trigger re-renders.\n\n```js\ndata: {\n chartInstance: null,\n timer: null\n}\n```',
|
|
87
|
+
snippet: 'data: {\n ${1:key}: ${2:null},\n},',
|
|
88
|
+
kind: 'property'
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'scope',
|
|
92
|
+
detail: 'scope: string | object',
|
|
93
|
+
documentation:
|
|
94
|
+
'Assigns a scope reference. `"state"` makes `element.scope = element.state`. `"props"` makes `element.scope = element.props`.\n\n```js\nscope: "state"\nscope: "props"\nscope: { theme: "dark" }\n```',
|
|
95
|
+
snippet: "scope: '${1:state}',",
|
|
96
|
+
kind: 'property'
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: 'on',
|
|
100
|
+
detail: 'on: object (v2 compat)',
|
|
101
|
+
documentation:
|
|
102
|
+
'**v2 style — prefer top-level `onX` in v3.** Event handlers object.\n\n```js\n// v2\non: { click: fn, render: fn }\n\n// v3 preferred\nonClick: fn\nonRender: fn\n```',
|
|
103
|
+
snippet: 'on: {\n ${1:event}: (event, el, state) => {\n ${2:}\n }\n},',
|
|
104
|
+
kind: 'property'
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: 'props',
|
|
108
|
+
detail: 'props: object',
|
|
109
|
+
documentation:
|
|
110
|
+
'Explicit props object. In v3, props are flattened at element root. Use `props:` only for passing props when instantiating a component.\n\n```js\n// Passing props to an instance\nButton: {\n props: { text: "Submit", disabled: false }\n}\n```',
|
|
111
|
+
snippet: 'props: {\n ${1:key}: ${2:value},\n},',
|
|
112
|
+
kind: 'property'
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: 'childProps',
|
|
116
|
+
detail: 'childProps: object',
|
|
117
|
+
documentation:
|
|
118
|
+
'Props applied to all direct child elements.\n\n```js\nchildProps: { padding: "A", theme: "field" }\n```',
|
|
119
|
+
snippet: 'childProps: {\n ${1:key}: ${2:value},\n},',
|
|
120
|
+
kind: 'property'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: 'childrenAs',
|
|
124
|
+
detail: 'childrenAs: string',
|
|
125
|
+
documentation:
|
|
126
|
+
'Rename the `children` key to a custom name for semantic clarity.\n\n```js\nchildrenAs: "items"\nchildrenAs: "slides"\n```',
|
|
127
|
+
snippet: "childrenAs: '${1:items}',",
|
|
128
|
+
kind: 'property'
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: 'children',
|
|
132
|
+
detail: 'children: array | function',
|
|
133
|
+
documentation:
|
|
134
|
+
'Dynamic child list. Each item becomes a child element using `childExtends` as template.\n\n```js\nchildren: ({ props }) => props.items\nchildren: [{ text: "Item 1" }, { text: "Item 2" }]\n```',
|
|
135
|
+
snippet: 'children: ${1:[]},',
|
|
136
|
+
kind: 'property'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: 'childExtends',
|
|
140
|
+
detail: 'childExtends: string | object | array',
|
|
141
|
+
documentation:
|
|
142
|
+
'Apply an extend to all direct child elements. Accepts string, object, or array of extends.\n\n```js\nchildExtends: "Button"\nchildExtends: ["IconText", "Focusable"]\nchildExtends: { padding: "Z2 C", round: "0" }\n```',
|
|
143
|
+
snippet: "childExtends: '${1:ComponentName}',",
|
|
144
|
+
kind: 'property'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: 'childExtendsRecursive',
|
|
148
|
+
detail: 'childExtendsRecursive: string | object | array',
|
|
149
|
+
documentation:
|
|
150
|
+
'Apply an extend to ALL descendants recursively. Accepts string, object, or array of extends.\n\n```js\nchildExtendsRecursive: "Button"\nchildExtendsRecursive: { fontSize: "A" }\n```',
|
|
151
|
+
snippet: "childExtendsRecursive: '${1:ComponentName}',",
|
|
152
|
+
kind: 'property'
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: 'content',
|
|
156
|
+
detail: 'content: function | object',
|
|
157
|
+
documentation:
|
|
158
|
+
'Single dynamic child element. Rendered as the element\'s sole child.\n\n```js\ncontent: ({ props }) => props.page\ncontent: ({ state }) => state.currentView\n```',
|
|
159
|
+
snippet: 'content: ({ ${1:props} }) => ${2:},',
|
|
160
|
+
kind: 'property'
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
label: 'classlist',
|
|
164
|
+
detail: 'classlist: object | array',
|
|
165
|
+
documentation:
|
|
166
|
+
'CSS class management object. Keys are class names, values are booleans.\n\n```js\nclasslist: { active: true, hidden: false }\n```',
|
|
167
|
+
snippet: 'classlist: { ${1:className}: ${2:true} },',
|
|
168
|
+
kind: 'property'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: 'variables',
|
|
172
|
+
detail: 'variables: object',
|
|
173
|
+
documentation:
|
|
174
|
+
'CSS custom properties (design tokens) scoped to this element.\n\n```js\nvariables: { color: "blue", spacing: "16px" }\n```',
|
|
175
|
+
snippet: 'variables: { ${1:name}: ${2:value} },',
|
|
176
|
+
kind: 'property'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: 'theme',
|
|
180
|
+
detail: 'theme: string',
|
|
181
|
+
documentation:
|
|
182
|
+
'Apply a design system theme token to this element.\n\n```js\ntheme: "dialog"\ntheme: "field"\ntheme: "primary"\ntheme: "quaternary .child"\n```',
|
|
183
|
+
snippet: "theme: '${1:dialog}',",
|
|
184
|
+
kind: 'property'
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
label: 'deps',
|
|
188
|
+
detail: 'deps: object',
|
|
189
|
+
documentation: 'Dependencies injection for the element.',
|
|
190
|
+
snippet: 'deps: { ${1:} },',
|
|
191
|
+
kind: 'property'
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
label: 'key',
|
|
195
|
+
detail: 'key: string',
|
|
196
|
+
documentation: 'Explicit element key (overrides the object property name as key).',
|
|
197
|
+
snippet: "key: '${1:}',",
|
|
198
|
+
kind: 'property'
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
label: 'query',
|
|
202
|
+
detail: 'query: string',
|
|
203
|
+
documentation: 'CSS query selector for targeting DOM elements.',
|
|
204
|
+
snippet: "query: '${1:}',",
|
|
205
|
+
kind: 'property'
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
|
|
209
|
+
export const DOMQL_PSEUDO_SELECTORS: DomqlKeyInfo[] = [
|
|
210
|
+
{
|
|
211
|
+
label: ':hover',
|
|
212
|
+
detail: ':hover: object',
|
|
213
|
+
documentation: 'Styles applied on hover.\n\n```js\n":hover": { opacity: 0.9, transform: "scale(1.015)" }\n```',
|
|
214
|
+
snippet: "':hover': { ${1:opacity}: ${2:0.9} },",
|
|
215
|
+
kind: 'property'
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
label: ':active',
|
|
219
|
+
detail: ':active: object',
|
|
220
|
+
documentation: 'Styles applied when active/pressed.\n\n```js\n":active": { opacity: 1 }\n```',
|
|
221
|
+
snippet: "':active': { ${1:opacity}: ${2:1} },",
|
|
222
|
+
kind: 'property'
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
label: ':focus',
|
|
226
|
+
detail: ':focus: object',
|
|
227
|
+
documentation: 'Styles applied when focused.',
|
|
228
|
+
snippet: "':focus': { ${1:outline}: ${2:'none'} },",
|
|
229
|
+
kind: 'property'
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
label: ':focus-visible',
|
|
233
|
+
detail: ':focus-visible: object',
|
|
234
|
+
documentation: 'Styles applied when focused via keyboard.',
|
|
235
|
+
snippet: "':focus-visible': { ${1:outline}: ${2:'solid, X, blue .3'} },",
|
|
236
|
+
kind: 'property'
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: ':disabled',
|
|
240
|
+
detail: ':disabled: object',
|
|
241
|
+
documentation: 'Styles applied when disabled.',
|
|
242
|
+
snippet: "':disabled': { ${1:opacity}: ${2:0.5} },",
|
|
243
|
+
kind: 'property'
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
label: ':not(:first-child)',
|
|
247
|
+
detail: ':not(:first-child): object',
|
|
248
|
+
documentation: 'Styles for all children except the first.',
|
|
249
|
+
snippet: "':not(:first-child)': { ${1:borderTop}: ${2:'solid, 1px, currentColor'} },",
|
|
250
|
+
kind: 'property'
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
label: ':first-child',
|
|
254
|
+
detail: ':first-child: object',
|
|
255
|
+
documentation: 'Styles for the first child element.',
|
|
256
|
+
snippet: "':first-child': { ${1:} },",
|
|
257
|
+
kind: 'property'
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
label: ':last-child',
|
|
261
|
+
detail: ':last-child: object',
|
|
262
|
+
documentation: 'Styles for the last child element.',
|
|
263
|
+
snippet: "':last-child': { ${1:} },",
|
|
264
|
+
kind: 'property'
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
label: ':before',
|
|
268
|
+
detail: ':before: object',
|
|
269
|
+
documentation:
|
|
270
|
+
'CSS ::before pseudo-element styles.\n\n```js\n":before": { content: "\'\'", display: "block" }\n```',
|
|
271
|
+
snippet: "':before': { ${1:content}: ${2:'\\'\\''} },",
|
|
272
|
+
kind: 'property'
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
label: ':after',
|
|
276
|
+
detail: ':after: object',
|
|
277
|
+
documentation: 'CSS ::after pseudo-element styles.',
|
|
278
|
+
snippet: "':after': { ${1:content}: ${2:'\\'\\''} },",
|
|
279
|
+
kind: 'property'
|
|
280
|
+
}
|
|
281
|
+
]
|
|
282
|
+
|
|
283
|
+
export const DOMQL_MEDIA_QUERIES: DomqlKeyInfo[] = [
|
|
284
|
+
{
|
|
285
|
+
label: '@dark',
|
|
286
|
+
detail: '@dark: object',
|
|
287
|
+
documentation: 'Styles applied in dark color scheme.\n\n```js\n"@dark": { background: "gray1", color: "gray12" }\n```',
|
|
288
|
+
snippet: "'@dark': { ${1:} },",
|
|
289
|
+
kind: 'property'
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
label: '@light',
|
|
293
|
+
detail: '@light: object',
|
|
294
|
+
documentation: 'Styles applied in light color scheme.',
|
|
295
|
+
snippet: "'@light': { ${1:} },",
|
|
296
|
+
kind: 'property'
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
label: '@mobile',
|
|
300
|
+
detail: '@mobile: object',
|
|
301
|
+
documentation: 'Styles applied on mobile breakpoint.',
|
|
302
|
+
snippet: "'@mobile': { ${1:} },",
|
|
303
|
+
kind: 'property'
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
label: '@tablet',
|
|
307
|
+
detail: '@tablet: object',
|
|
308
|
+
documentation: 'Styles applied on tablet breakpoint.',
|
|
309
|
+
snippet: "'@tablet': { ${1:} },",
|
|
310
|
+
kind: 'property'
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
label: '@desktop',
|
|
314
|
+
detail: '@desktop: object',
|
|
315
|
+
documentation: 'Styles applied on desktop breakpoint.',
|
|
316
|
+
snippet: "'@desktop': { ${1:} },",
|
|
317
|
+
kind: 'property'
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
|
|
321
|
+
export const DOMQL_ALL_KEYS = [...DOMQL_REGISTRY_KEYS, ...DOMQL_PSEUDO_SELECTORS, ...DOMQL_MEDIA_QUERIES]
|