@vue/language-core 2.2.0 → 2.2.4
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/index.d.ts +0 -1
- package/index.js +1 -2
- package/lib/codegen/codeFeatures.d.ts +83 -0
- package/lib/codegen/codeFeatures.js +71 -0
- package/lib/codegen/globalTypes.d.ts +3 -1
- package/lib/codegen/globalTypes.js +45 -37
- package/lib/codegen/localTypes.d.ts +1 -1
- package/lib/codegen/localTypes.js +4 -4
- package/lib/codegen/script/component.d.ts +1 -1
- package/lib/codegen/script/component.js +15 -11
- package/lib/codegen/script/componentSelf.d.ts +1 -1
- package/lib/codegen/script/componentSelf.js +2 -2
- package/lib/codegen/script/context.d.ts +1 -1
- package/lib/codegen/script/index.d.ts +1 -8
- package/lib/codegen/script/index.js +19 -45
- package/lib/codegen/script/scriptSetup.d.ts +1 -1
- package/lib/codegen/script/scriptSetup.js +78 -79
- package/lib/codegen/script/src.d.ts +2 -2
- package/lib/codegen/script/src.js +37 -38
- package/lib/codegen/script/template.d.ts +2 -3
- package/lib/codegen/script/template.js +12 -79
- package/lib/codegen/style/classProperty.d.ts +2 -0
- package/lib/codegen/style/classProperty.js +31 -0
- package/lib/codegen/style/modules.d.ts +3 -0
- package/lib/codegen/{script/styleModulesType.js → style/modules.js} +15 -15
- package/lib/codegen/style/scopedClasses.d.ts +4 -0
- package/lib/codegen/style/scopedClasses.js +32 -0
- package/lib/codegen/template/context.d.ts +122 -17
- package/lib/codegen/template/context.js +162 -92
- package/lib/codegen/template/element.d.ts +1 -1
- package/lib/codegen/template/element.js +86 -330
- package/lib/codegen/template/elementChildren.js +0 -13
- package/lib/codegen/template/elementDirectives.js +20 -12
- package/lib/codegen/template/elementEvents.d.ts +1 -1
- package/lib/codegen/template/elementEvents.js +15 -11
- package/lib/codegen/template/elementProps.d.ts +2 -1
- package/lib/codegen/template/elementProps.js +31 -33
- package/lib/codegen/template/index.d.ts +1 -0
- package/lib/codegen/template/index.js +53 -33
- package/lib/codegen/template/interpolation.js +13 -9
- package/lib/codegen/template/slotOutlet.js +44 -21
- package/lib/codegen/template/styleScopedClasses.d.ts +3 -0
- package/lib/codegen/template/styleScopedClasses.js +146 -9
- package/lib/codegen/template/templateChild.js +69 -30
- package/lib/codegen/template/vFor.js +2 -2
- package/lib/codegen/template/vIf.js +3 -3
- package/lib/codegen/template/vSlot.d.ts +6 -0
- package/lib/codegen/template/vSlot.js +92 -0
- package/lib/codegen/utils/index.d.ts +13 -2
- package/lib/codegen/utils/index.js +33 -6
- package/lib/parsers/scriptSetupRanges.d.ts +5 -3
- package/lib/parsers/scriptSetupRanges.js +24 -35
- package/lib/parsers/vueCompilerOptions.d.ts +2 -2
- package/lib/plugins/file-md.js +3 -0
- package/lib/plugins/vue-template-inline-ts.js +56 -15
- package/lib/plugins/vue-tsx.d.ts +43 -32
- package/lib/plugins/vue-tsx.js +88 -68
- package/lib/types.d.ts +29 -16
- package/lib/utils/parseSfc.js +41 -16
- package/lib/utils/signals.d.ts +2 -0
- package/lib/utils/signals.js +54 -0
- package/lib/utils/ts.d.ts +14 -2
- package/lib/utils/ts.js +134 -88
- package/lib/virtualFile/computedEmbeddedCodes.d.ts +1 -1
- package/lib/virtualFile/computedEmbeddedCodes.js +14 -24
- package/lib/virtualFile/computedSfc.d.ts +1 -2
- package/lib/virtualFile/computedSfc.js +86 -96
- package/lib/virtualFile/computedVueSfc.d.ts +1 -2
- package/lib/virtualFile/computedVueSfc.js +7 -7
- package/lib/virtualFile/vueFile.d.ts +8 -11
- package/lib/virtualFile/vueFile.js +15 -9
- package/package.json +4 -4
- package/lib/codegen/script/styleModulesType.d.ts +0 -4
|
@@ -4,7 +4,6 @@ exports.generateComponent = generateComponent;
|
|
|
4
4
|
exports.generateElement = generateElement;
|
|
5
5
|
const CompilerDOM = require("@vue/compiler-dom");
|
|
6
6
|
const shared_1 = require("@vue/shared");
|
|
7
|
-
const scriptSetupRanges_1 = require("../../parsers/scriptSetupRanges");
|
|
8
7
|
const shared_2 = require("../../utils/shared");
|
|
9
8
|
const inlayHints_1 = require("../inlayHints");
|
|
10
9
|
const utils_1 = require("../utils");
|
|
@@ -14,11 +13,11 @@ const elementDirectives_1 = require("./elementDirectives");
|
|
|
14
13
|
const elementEvents_1 = require("./elementEvents");
|
|
15
14
|
const elementProps_1 = require("./elementProps");
|
|
16
15
|
const interpolation_1 = require("./interpolation");
|
|
17
|
-
const objectProperty_1 = require("./objectProperty");
|
|
18
16
|
const propertyAccess_1 = require("./propertyAccess");
|
|
19
|
-
const
|
|
17
|
+
const styleScopedClasses_1 = require("./styleScopedClasses");
|
|
18
|
+
const vSlot_1 = require("./vSlot");
|
|
20
19
|
const colonReg = /:/g;
|
|
21
|
-
function* generateComponent(options, ctx, node) {
|
|
20
|
+
function* generateComponent(options, ctx, node, isVForChild) {
|
|
22
21
|
const tagOffsets = [node.loc.start.offset + options.template.content.slice(node.loc.start.offset).indexOf(node.tag)];
|
|
23
22
|
if (!node.isSelfClosing && options.template.lang === 'html') {
|
|
24
23
|
const endTagOffset = node.loc.start.offset + node.loc.source.lastIndexOf(node.tag);
|
|
@@ -29,16 +28,13 @@ function* generateComponent(options, ctx, node) {
|
|
|
29
28
|
const failedPropExps = [];
|
|
30
29
|
const possibleOriginalNames = getPossibleOriginalComponentNames(node.tag, true);
|
|
31
30
|
const matchImportName = possibleOriginalNames.find(name => options.scriptSetupImportComponentNames.has(name));
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const var_componentEvents = ctx.getInternalVariable();
|
|
37
|
-
const var_defineComponentCtx = ctx.getInternalVariable();
|
|
31
|
+
const componentOriginalVar = matchImportName ?? ctx.getInternalVariable();
|
|
32
|
+
const componentFunctionalVar = ctx.getInternalVariable();
|
|
33
|
+
const componentVNodeVar = ctx.getInternalVariable();
|
|
34
|
+
const componentCtxVar = ctx.getInternalVariable();
|
|
38
35
|
const isComponentTag = node.tag.toLowerCase() === 'component';
|
|
39
36
|
ctx.currentComponent = {
|
|
40
|
-
|
|
41
|
-
ctxVar: var_defineComponentCtx,
|
|
37
|
+
ctxVar: componentCtxVar,
|
|
42
38
|
used: false
|
|
43
39
|
};
|
|
44
40
|
let props = node.props;
|
|
@@ -71,14 +67,13 @@ function* generateComponent(options, ctx, node) {
|
|
|
71
67
|
};
|
|
72
68
|
}
|
|
73
69
|
if (matchImportName) {
|
|
74
|
-
//
|
|
75
|
-
yield
|
|
76
|
-
yield `/** @type { [`;
|
|
70
|
+
// navigation support
|
|
71
|
+
yield `/** @type {[`;
|
|
77
72
|
for (const tagOffset of tagOffsets) {
|
|
78
73
|
yield `typeof `;
|
|
79
|
-
if (
|
|
74
|
+
if (componentOriginalVar === node.tag) {
|
|
80
75
|
yield [
|
|
81
|
-
|
|
76
|
+
componentOriginalVar,
|
|
82
77
|
'template',
|
|
83
78
|
tagOffset,
|
|
84
79
|
ctx.codeFeatures.withoutHighlightAndCompletion,
|
|
@@ -96,22 +91,27 @@ function* generateComponent(options, ctx, node) {
|
|
|
96
91
|
}
|
|
97
92
|
yield `, `;
|
|
98
93
|
}
|
|
99
|
-
yield `]
|
|
94
|
+
yield `]} */${utils_1.endOfLine}`;
|
|
100
95
|
}
|
|
101
96
|
else if (dynamicTagInfo) {
|
|
102
|
-
yield `const ${
|
|
103
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, dynamicTagInfo.tag, dynamicTagInfo.offsets[0], dynamicTagInfo.astHolder,
|
|
97
|
+
yield `const ${componentOriginalVar} = (`;
|
|
98
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.all, dynamicTagInfo.tag, dynamicTagInfo.offsets[0], dynamicTagInfo.astHolder, `(`, `)`);
|
|
104
99
|
if (dynamicTagInfo.offsets[1] !== undefined) {
|
|
105
100
|
yield `,`;
|
|
106
|
-
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template',
|
|
107
|
-
...ctx.codeFeatures.all,
|
|
108
|
-
completion: false,
|
|
109
|
-
}, dynamicTagInfo.tag, dynamicTagInfo.offsets[1], dynamicTagInfo.astHolder, '(', ')');
|
|
101
|
+
yield* (0, interpolation_1.generateInterpolation)(options, ctx, 'template', ctx.codeFeatures.withoutCompletion, dynamicTagInfo.tag, dynamicTagInfo.offsets[1], dynamicTagInfo.astHolder, `(`, `)`);
|
|
110
102
|
}
|
|
111
103
|
yield `)${utils_1.endOfLine}`;
|
|
112
104
|
}
|
|
113
105
|
else if (!isComponentTag) {
|
|
114
|
-
yield `const ${
|
|
106
|
+
yield `const ${componentOriginalVar} = ({} as __VLS_WithComponent<'${getCanonicalComponentName(node.tag)}', __VLS_LocalComponents, `;
|
|
107
|
+
if (options.selfComponentName && possibleOriginalNames.includes(options.selfComponentName)) {
|
|
108
|
+
yield `typeof __VLS_self & (new () => { `
|
|
109
|
+
+ (0, shared_2.getSlotsPropertyName)(options.vueCompilerOptions.target)
|
|
110
|
+
+ `: __VLS_Slots }), `;
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
yield `void, `;
|
|
114
|
+
}
|
|
115
115
|
yield getPossibleOriginalComponentNames(node.tag, false)
|
|
116
116
|
.map(name => `'${name}'`)
|
|
117
117
|
.join(`, `);
|
|
@@ -120,8 +120,8 @@ function* generateComponent(options, ctx, node) {
|
|
|
120
120
|
yield `${utils_1.endOfLine}`;
|
|
121
121
|
const camelizedTag = (0, shared_1.camelize)(node.tag);
|
|
122
122
|
if (utils_1.variableNameRegex.test(camelizedTag)) {
|
|
123
|
-
//
|
|
124
|
-
yield `/** @type {
|
|
123
|
+
// navigation support
|
|
124
|
+
yield `/** @type {[`;
|
|
125
125
|
for (const tagOffset of tagOffsets) {
|
|
126
126
|
for (const shouldCapitalize of (node.tag[0] === node.tag[0].toUpperCase() ? [false] : [true, false])) {
|
|
127
127
|
const expectName = shouldCapitalize ? (0, shared_1.capitalize)(camelizedTag) : camelizedTag;
|
|
@@ -135,7 +135,7 @@ function* generateComponent(options, ctx, node) {
|
|
|
135
135
|
yield `, `;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
yield `]
|
|
138
|
+
yield `]} */${utils_1.endOfLine}`;
|
|
139
139
|
// auto import support
|
|
140
140
|
if (options.edited) {
|
|
141
141
|
yield `// @ts-ignore${utils_1.newLine}`; // #2304
|
|
@@ -150,67 +150,67 @@ function* generateComponent(options, ctx, node) {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
else {
|
|
153
|
-
yield `const ${
|
|
153
|
+
yield `const ${componentOriginalVar} = {} as any${utils_1.endOfLine}`;
|
|
154
154
|
}
|
|
155
155
|
yield `// @ts-ignore${utils_1.newLine}`;
|
|
156
|
-
yield `const ${
|
|
157
|
-
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.
|
|
156
|
+
yield `const ${componentFunctionalVar} = __VLS_asFunctionalComponent(${componentOriginalVar}, new ${componentOriginalVar}({${utils_1.newLine}`;
|
|
157
|
+
yield* (0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.checkUnknownProps, false);
|
|
158
158
|
yield `}))${utils_1.endOfLine}`;
|
|
159
159
|
yield `const `;
|
|
160
|
-
yield* (0, utils_1.wrapWith)(node.loc.start.offset, node.loc.end.offset, {
|
|
160
|
+
yield* (0, utils_1.wrapWith)(node.loc.start.offset, node.loc.end.offset, ctx.resolveCodeFeatures({
|
|
161
161
|
verification: {
|
|
162
162
|
shouldReport(_source, code) {
|
|
163
|
+
// https://typescript.tv/errors/#ts6133
|
|
163
164
|
return String(code) !== '6133';
|
|
164
165
|
},
|
|
165
166
|
}
|
|
166
|
-
},
|
|
167
|
-
yield ` = ${
|
|
167
|
+
}), componentVNodeVar);
|
|
168
|
+
yield ` = ${componentFunctionalVar}`;
|
|
168
169
|
yield* generateComponentGeneric(ctx);
|
|
169
170
|
yield `(`;
|
|
170
|
-
yield* (0, utils_1.wrapWith)(tagOffsets[0], tagOffsets[0] + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.
|
|
171
|
-
yield `, ...__VLS_functionalComponentArgsRest(${
|
|
171
|
+
yield* (0, utils_1.wrapWith)(tagOffsets[0], tagOffsets[0] + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, props, options.vueCompilerOptions.checkUnknownProps, true, failedPropExps), `}`);
|
|
172
|
+
yield `, ...__VLS_functionalComponentArgsRest(${componentFunctionalVar}))${utils_1.endOfLine}`;
|
|
172
173
|
yield* generateFailedPropExps(options, ctx, failedPropExps);
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
yield* (0, elementEvents_1.generateElementEvents)(options, ctx, node, componentFunctionalVar, componentVNodeVar, componentCtxVar);
|
|
175
|
+
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
176
|
+
const [refName, offset] = yield* generateElementReference(options, ctx, node);
|
|
177
|
+
const tag = (0, shared_2.hyphenateTag)(node.tag);
|
|
178
|
+
const isRootNode = ctx.singleRootNodes.has(node) && !options.vueCompilerOptions.fallthroughComponentNames.includes(tag);
|
|
175
179
|
if (refName || isRootNode) {
|
|
176
|
-
const
|
|
180
|
+
const componentInstanceVar = ctx.getInternalVariable();
|
|
177
181
|
ctx.currentComponent.used = true;
|
|
178
|
-
yield `var ${
|
|
179
|
-
if (
|
|
180
|
-
&& node.codegenNode.props?.type === CompilerDOM.NodeTypes.JS_OBJECT_EXPRESSION
|
|
181
|
-
&& node.codegenNode.props.properties.some(({ key }) => key.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && key.content === 'ref_for')) {
|
|
182
|
+
yield `var ${componentInstanceVar} = {} as (Parameters<NonNullable<typeof ${componentCtxVar}['expose']>>[0] | null)`;
|
|
183
|
+
if (isVForChild) {
|
|
182
184
|
yield `[]`;
|
|
183
185
|
}
|
|
184
186
|
yield `${utils_1.endOfLine}`;
|
|
185
|
-
if (refName) {
|
|
186
|
-
ctx.templateRefs.set(refName,
|
|
187
|
+
if (refName && offset) {
|
|
188
|
+
ctx.templateRefs.set(refName, {
|
|
189
|
+
typeExp: `typeof ${ctx.getHoistVariable(componentInstanceVar)}`,
|
|
190
|
+
offset
|
|
191
|
+
});
|
|
187
192
|
}
|
|
188
193
|
if (isRootNode) {
|
|
189
|
-
ctx.
|
|
194
|
+
ctx.singleRootElTypes.push(`NonNullable<typeof ${componentInstanceVar}>['$el']`);
|
|
190
195
|
}
|
|
191
196
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
yield `let ${var_componentEvents}!: __VLS_NormalizeEmits<typeof ${var_componentEmit}>${utils_1.endOfLine}`;
|
|
197
|
-
}
|
|
198
|
-
if (options.vueCompilerOptions.fallthroughAttributes
|
|
199
|
-
&& (node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === 'bind' && prop.exp?.loc.source === '$attrs')
|
|
200
|
-
|| node === ctx.singleRootNode)) {
|
|
201
|
-
const varAttrs = ctx.getInternalVariable();
|
|
202
|
-
ctx.inheritedAttrVars.add(varAttrs);
|
|
203
|
-
yield `var ${varAttrs}!: Parameters<typeof ${var_functionalComponent}>[0];\n`;
|
|
197
|
+
if (hasVBindAttrs(options, ctx, node)) {
|
|
198
|
+
const attrsVar = ctx.getInternalVariable();
|
|
199
|
+
yield `let ${attrsVar}!: Parameters<typeof ${componentFunctionalVar}>[0]${utils_1.endOfLine}`;
|
|
200
|
+
ctx.inheritedAttrVars.add(attrsVar);
|
|
204
201
|
}
|
|
202
|
+
(0, styleScopedClasses_1.collectStyleScopedClassReferences)(options, ctx, node);
|
|
205
203
|
const slotDir = node.props.find(p => p.type === CompilerDOM.NodeTypes.DIRECTIVE && p.name === 'slot');
|
|
206
204
|
if (slotDir) {
|
|
207
|
-
yield*
|
|
205
|
+
yield* (0, vSlot_1.generateVSlot)(options, ctx, node, slotDir);
|
|
208
206
|
}
|
|
209
207
|
else {
|
|
208
|
+
// #932: reference for default slot
|
|
209
|
+
yield* (0, vSlot_1.generateImplicitDefaultSlot)(ctx, node);
|
|
210
210
|
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node);
|
|
211
211
|
}
|
|
212
212
|
if (ctx.currentComponent.used) {
|
|
213
|
-
yield `var ${
|
|
213
|
+
yield `var ${componentCtxVar}!: __VLS_PickFunctionalComponentCtx<typeof ${componentOriginalVar}, typeof ${componentVNodeVar}>${utils_1.endOfLine}`;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
function* generateElement(options, ctx, node, isVForChild) {
|
|
@@ -219,39 +219,36 @@ function* generateElement(options, ctx, node, isVForChild) {
|
|
|
219
219
|
? node.loc.start.offset + node.loc.source.lastIndexOf(node.tag)
|
|
220
220
|
: undefined;
|
|
221
221
|
const failedPropExps = [];
|
|
222
|
-
yield `
|
|
222
|
+
yield `__VLS_asFunctionalElement(__VLS_intrinsicElements`;
|
|
223
223
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, node.tag, startTagOffset, ctx.codeFeatures.withoutHighlightAndCompletion);
|
|
224
224
|
if (endTagOffset !== undefined) {
|
|
225
225
|
yield `, __VLS_intrinsicElements`;
|
|
226
226
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, node.tag, endTagOffset, ctx.codeFeatures.withoutHighlightAndCompletion);
|
|
227
227
|
}
|
|
228
228
|
yield `)(`;
|
|
229
|
-
yield* (0, utils_1.wrapWith)(startTagOffset, startTagOffset + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.
|
|
229
|
+
yield* (0, utils_1.wrapWith)(startTagOffset, startTagOffset + node.tag.length, ctx.codeFeatures.verification, `{${utils_1.newLine}`, ...(0, elementProps_1.generateElementProps)(options, ctx, node, node.props, options.vueCompilerOptions.checkUnknownProps, true, failedPropExps), `}`);
|
|
230
230
|
yield `)${utils_1.endOfLine}`;
|
|
231
231
|
yield* generateFailedPropExps(options, ctx, failedPropExps);
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
232
|
+
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
233
|
+
const [refName, offset] = yield* generateElementReference(options, ctx, node);
|
|
234
|
+
if (refName && offset) {
|
|
235
|
+
let typeExp = `__VLS_NativeElements['${node.tag}']`;
|
|
235
236
|
if (isVForChild) {
|
|
236
|
-
|
|
237
|
+
typeExp += `[]`;
|
|
237
238
|
}
|
|
238
|
-
ctx.templateRefs.set(refName,
|
|
239
|
+
ctx.templateRefs.set(refName, {
|
|
240
|
+
typeExp,
|
|
241
|
+
offset
|
|
242
|
+
});
|
|
239
243
|
}
|
|
240
|
-
if (ctx.
|
|
241
|
-
ctx.
|
|
244
|
+
if (ctx.singleRootNodes.has(node)) {
|
|
245
|
+
ctx.singleRootElTypes.push(`__VLS_NativeElements['${node.tag}']`);
|
|
242
246
|
}
|
|
243
|
-
|
|
244
|
-
if (slotDir && ctx.currentComponent) {
|
|
245
|
-
yield* generateComponentSlot(options, ctx, node, slotDir);
|
|
246
|
-
}
|
|
247
|
-
else {
|
|
248
|
-
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node);
|
|
249
|
-
}
|
|
250
|
-
if (options.vueCompilerOptions.fallthroughAttributes
|
|
251
|
-
&& (node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && prop.name === 'bind' && prop.exp?.loc.source === '$attrs')
|
|
252
|
-
|| node === ctx.singleRootNode)) {
|
|
247
|
+
if (hasVBindAttrs(options, ctx, node)) {
|
|
253
248
|
ctx.inheritedAttrVars.add(`__VLS_intrinsicElements.${node.tag}`);
|
|
254
249
|
}
|
|
250
|
+
(0, styleScopedClasses_1.collectStyleScopedClassReferences)(options, ctx, node);
|
|
251
|
+
yield* (0, elementChildren_1.generateElementChildren)(options, ctx, node);
|
|
255
252
|
}
|
|
256
253
|
function* generateFailedPropExps(options, ctx, failedPropExps) {
|
|
257
254
|
for (const failedExp of failedPropExps) {
|
|
@@ -259,34 +256,6 @@ function* generateFailedPropExps(options, ctx, failedPropExps) {
|
|
|
259
256
|
yield utils_1.endOfLine;
|
|
260
257
|
}
|
|
261
258
|
}
|
|
262
|
-
function* generateVScope(options, ctx, node, props) {
|
|
263
|
-
const vScope = props.find(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE && (prop.name === 'scope' || prop.name === 'data'));
|
|
264
|
-
let inScope = false;
|
|
265
|
-
let originalConditionsNum = ctx.blockConditions.length;
|
|
266
|
-
if (vScope?.type === CompilerDOM.NodeTypes.DIRECTIVE && vScope.exp) {
|
|
267
|
-
const scopeVar = ctx.getInternalVariable();
|
|
268
|
-
const condition = `__VLS_withScope(__VLS_ctx, ${scopeVar})`;
|
|
269
|
-
yield `const ${scopeVar} = `;
|
|
270
|
-
yield [
|
|
271
|
-
vScope.exp.loc.source,
|
|
272
|
-
'template',
|
|
273
|
-
vScope.exp.loc.start.offset,
|
|
274
|
-
ctx.codeFeatures.all,
|
|
275
|
-
];
|
|
276
|
-
yield utils_1.endOfLine;
|
|
277
|
-
yield `if (${condition}) {${utils_1.newLine}`;
|
|
278
|
-
ctx.blockConditions.push(condition);
|
|
279
|
-
inScope = true;
|
|
280
|
-
}
|
|
281
|
-
yield* (0, elementDirectives_1.generateElementDirectives)(options, ctx, node);
|
|
282
|
-
const [refName, offset] = yield* generateReferencesForElements(options, ctx, node); // <el ref="foo" />
|
|
283
|
-
yield* generateReferencesForScopedCssClasses(options, ctx, node);
|
|
284
|
-
if (inScope) {
|
|
285
|
-
yield `}${utils_1.newLine}`;
|
|
286
|
-
ctx.blockConditions.length = originalConditionsNum;
|
|
287
|
-
}
|
|
288
|
-
return [refName, offset];
|
|
289
|
-
}
|
|
290
259
|
function getCanonicalComponentName(tagText) {
|
|
291
260
|
return utils_1.variableNameRegex.test(tagText)
|
|
292
261
|
? tagText
|
|
@@ -325,87 +294,16 @@ function* generateComponentGeneric(ctx) {
|
|
|
325
294
|
}
|
|
326
295
|
ctx.lastGenericComment = undefined;
|
|
327
296
|
}
|
|
328
|
-
function*
|
|
329
|
-
yield `{${utils_1.newLine}`;
|
|
330
|
-
if (ctx.currentComponent) {
|
|
331
|
-
ctx.currentComponent.used = true;
|
|
332
|
-
ctx.hasSlotElements.add(ctx.currentComponent.node);
|
|
333
|
-
}
|
|
334
|
-
const slotBlockVars = [];
|
|
335
|
-
yield `const {`;
|
|
336
|
-
if (slotDir?.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION && slotDir.arg.content) {
|
|
337
|
-
yield* (0, objectProperty_1.generateObjectProperty)(options, ctx, slotDir.arg.loc.source, slotDir.arg.loc.start.offset, slotDir.arg.isStatic ? ctx.codeFeatures.withoutHighlight : ctx.codeFeatures.all, slotDir.arg.loc, false, true);
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
yield* (0, utils_1.wrapWith)(slotDir.loc.start.offset, slotDir.loc.start.offset + (slotDir.rawName?.length ?? 0), ctx.codeFeatures.withoutHighlightAndCompletion, `default`);
|
|
341
|
-
}
|
|
342
|
-
yield `: __VLS_thisSlot } = ${ctx.currentComponent.ctxVar}.slots!${utils_1.endOfLine}`;
|
|
343
|
-
if (slotDir?.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
344
|
-
const slotAst = (0, utils_1.createTsAst)(options.ts, slotDir, `(${slotDir.exp.content}) => {}`);
|
|
345
|
-
(0, utils_1.collectVars)(options.ts, slotAst, slotAst, slotBlockVars);
|
|
346
|
-
if (!slotDir.exp.content.includes(':')) {
|
|
347
|
-
yield `const [`;
|
|
348
|
-
yield [
|
|
349
|
-
slotDir.exp.content,
|
|
350
|
-
'template',
|
|
351
|
-
slotDir.exp.loc.start.offset,
|
|
352
|
-
ctx.codeFeatures.all,
|
|
353
|
-
];
|
|
354
|
-
yield `] = __VLS_getSlotParams(__VLS_thisSlot)${utils_1.endOfLine}`;
|
|
355
|
-
}
|
|
356
|
-
else {
|
|
357
|
-
yield `const `;
|
|
358
|
-
yield [
|
|
359
|
-
slotDir.exp.content,
|
|
360
|
-
'template',
|
|
361
|
-
slotDir.exp.loc.start.offset,
|
|
362
|
-
ctx.codeFeatures.all,
|
|
363
|
-
];
|
|
364
|
-
yield ` = __VLS_getSlotParam(__VLS_thisSlot)${utils_1.endOfLine}`;
|
|
365
|
-
}
|
|
366
|
-
}
|
|
367
|
-
for (const varName of slotBlockVars) {
|
|
368
|
-
ctx.addLocalVariable(varName);
|
|
369
|
-
}
|
|
370
|
-
yield* ctx.resetDirectiveComments('end of slot children start');
|
|
371
|
-
let prev;
|
|
372
|
-
for (const childNode of node.children) {
|
|
373
|
-
yield* (0, templateChild_1.generateTemplateChild)(options, ctx, childNode, prev);
|
|
374
|
-
prev = childNode;
|
|
375
|
-
}
|
|
376
|
-
for (const varName of slotBlockVars) {
|
|
377
|
-
ctx.removeLocalVariable(varName);
|
|
378
|
-
}
|
|
379
|
-
let isStatic = true;
|
|
380
|
-
if (slotDir?.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION) {
|
|
381
|
-
isStatic = slotDir.arg.isStatic;
|
|
382
|
-
}
|
|
383
|
-
if (isStatic && slotDir && !slotDir.arg) {
|
|
384
|
-
yield `${ctx.currentComponent.ctxVar}.slots!['`;
|
|
385
|
-
yield [
|
|
386
|
-
'',
|
|
387
|
-
'template',
|
|
388
|
-
slotDir.loc.start.offset + (slotDir.loc.source.startsWith('#')
|
|
389
|
-
? '#'.length : slotDir.loc.source.startsWith('v-slot:')
|
|
390
|
-
? 'v-slot:'.length
|
|
391
|
-
: 0),
|
|
392
|
-
ctx.codeFeatures.completion,
|
|
393
|
-
];
|
|
394
|
-
yield `'/* empty slot name completion */]${utils_1.newLine}`;
|
|
395
|
-
}
|
|
396
|
-
yield* ctx.generateAutoImportCompletion();
|
|
397
|
-
yield `}${utils_1.newLine}`;
|
|
398
|
-
}
|
|
399
|
-
function* generateReferencesForElements(options, ctx, node) {
|
|
297
|
+
function* generateElementReference(options, ctx, node) {
|
|
400
298
|
for (const prop of node.props) {
|
|
401
299
|
if (prop.type === CompilerDOM.NodeTypes.ATTRIBUTE
|
|
402
300
|
&& prop.name === 'ref'
|
|
403
301
|
&& prop.value) {
|
|
404
|
-
const [content, startOffset] = normalizeAttributeValue(prop.value);
|
|
405
|
-
|
|
406
|
-
yield `/** @type {
|
|
302
|
+
const [content, startOffset] = (0, utils_1.normalizeAttributeValue)(prop.value);
|
|
303
|
+
// navigation support for `const foo = ref()`
|
|
304
|
+
yield `/** @type {typeof __VLS_ctx`;
|
|
407
305
|
yield* (0, propertyAccess_1.generatePropertyAccess)(options, ctx, content, startOffset, ctx.codeFeatures.navigation, prop.value.loc);
|
|
408
|
-
yield `
|
|
306
|
+
yield `} */${utils_1.endOfLine}`;
|
|
409
307
|
if (utils_1.variableNameRegex.test(content) && !options.templateRefNames.has(content)) {
|
|
410
308
|
ctx.accessExternalVariable(content, startOffset);
|
|
411
309
|
}
|
|
@@ -414,116 +312,11 @@ function* generateReferencesForElements(options, ctx, node) {
|
|
|
414
312
|
}
|
|
415
313
|
return [];
|
|
416
314
|
}
|
|
417
|
-
function
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
&& prop.name === '
|
|
421
|
-
&& prop.
|
|
422
|
-
if (options.template.lang === 'pug') {
|
|
423
|
-
const getClassOffset = Reflect.get(prop.value.loc.start, 'getClassOffset');
|
|
424
|
-
const content = prop.value.loc.source.slice(1, -1);
|
|
425
|
-
let startOffset = 1;
|
|
426
|
-
for (const className of content.split(' ')) {
|
|
427
|
-
if (className) {
|
|
428
|
-
ctx.scopedClasses.push({
|
|
429
|
-
source: 'template',
|
|
430
|
-
className,
|
|
431
|
-
offset: getClassOffset(startOffset),
|
|
432
|
-
});
|
|
433
|
-
}
|
|
434
|
-
startOffset += className.length + 1;
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
else {
|
|
438
|
-
let isWrapped = false;
|
|
439
|
-
const [content, startOffset] = normalizeAttributeValue(prop.value);
|
|
440
|
-
if (content) {
|
|
441
|
-
const classes = collectClasses(content, startOffset + (isWrapped ? 1 : 0));
|
|
442
|
-
ctx.scopedClasses.push(...classes);
|
|
443
|
-
}
|
|
444
|
-
else {
|
|
445
|
-
ctx.emptyClassOffsets.push(startOffset);
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
else if (prop.type === CompilerDOM.NodeTypes.DIRECTIVE
|
|
450
|
-
&& prop.arg?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION
|
|
451
|
-
&& prop.exp?.type === CompilerDOM.NodeTypes.SIMPLE_EXPRESSION
|
|
452
|
-
&& prop.arg.content === 'class') {
|
|
453
|
-
const content = '`${' + prop.exp.content + '}`';
|
|
454
|
-
const startOffset = prop.exp.loc.start.offset - 3;
|
|
455
|
-
const { ts } = options;
|
|
456
|
-
const ast = ts.createSourceFile('', content, 99);
|
|
457
|
-
const literals = [];
|
|
458
|
-
ts.forEachChild(ast, node => {
|
|
459
|
-
if (!ts.isExpressionStatement(node) ||
|
|
460
|
-
!isTemplateExpression(node.expression)) {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
const expression = node.expression.templateSpans[0].expression;
|
|
464
|
-
if (ts.isStringLiteralLike(expression)) {
|
|
465
|
-
literals.push(expression);
|
|
466
|
-
}
|
|
467
|
-
if (ts.isArrayLiteralExpression(expression)) {
|
|
468
|
-
walkArrayLiteral(expression);
|
|
469
|
-
}
|
|
470
|
-
if (ts.isObjectLiteralExpression(expression)) {
|
|
471
|
-
walkObjectLiteral(expression);
|
|
472
|
-
}
|
|
473
|
-
});
|
|
474
|
-
for (const literal of literals) {
|
|
475
|
-
if (literal.text) {
|
|
476
|
-
const classes = collectClasses(literal.text, literal.end - literal.text.length - 1 + startOffset);
|
|
477
|
-
ctx.scopedClasses.push(...classes);
|
|
478
|
-
}
|
|
479
|
-
else {
|
|
480
|
-
ctx.emptyClassOffsets.push(literal.end - 1 + startOffset);
|
|
481
|
-
}
|
|
482
|
-
}
|
|
483
|
-
function walkArrayLiteral(node) {
|
|
484
|
-
const { elements } = node;
|
|
485
|
-
for (const element of elements) {
|
|
486
|
-
if (ts.isStringLiteralLike(element)) {
|
|
487
|
-
literals.push(element);
|
|
488
|
-
}
|
|
489
|
-
else if (ts.isObjectLiteralExpression(element)) {
|
|
490
|
-
walkObjectLiteral(element);
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function walkObjectLiteral(node) {
|
|
495
|
-
const { properties } = node;
|
|
496
|
-
for (const property of properties) {
|
|
497
|
-
if (ts.isPropertyAssignment(property)) {
|
|
498
|
-
const { name } = property;
|
|
499
|
-
if (ts.isIdentifier(name)) {
|
|
500
|
-
walkIdentifier(name);
|
|
501
|
-
}
|
|
502
|
-
else if (ts.isStringLiteral(name)) {
|
|
503
|
-
literals.push(name);
|
|
504
|
-
}
|
|
505
|
-
else if (ts.isComputedPropertyName(name)) {
|
|
506
|
-
const { expression } = name;
|
|
507
|
-
if (ts.isStringLiteralLike(expression)) {
|
|
508
|
-
literals.push(expression);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
else if (ts.isShorthandPropertyAssignment(property)) {
|
|
513
|
-
walkIdentifier(property.name);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
function walkIdentifier(node) {
|
|
518
|
-
const text = (0, scriptSetupRanges_1.getNodeText)(ts, node, ast);
|
|
519
|
-
ctx.scopedClasses.push({
|
|
520
|
-
source: 'template',
|
|
521
|
-
className: text,
|
|
522
|
-
offset: node.end - text.length + startOffset
|
|
523
|
-
});
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
}
|
|
315
|
+
function hasVBindAttrs(options, ctx, node) {
|
|
316
|
+
return options.vueCompilerOptions.fallthroughAttributes && ((options.inheritAttrs && ctx.singleRootNodes.has(node)) ||
|
|
317
|
+
node.props.some(prop => prop.type === CompilerDOM.NodeTypes.DIRECTIVE
|
|
318
|
+
&& prop.name === 'bind'
|
|
319
|
+
&& prop.exp?.loc.source === '$attrs'));
|
|
527
320
|
}
|
|
528
321
|
function camelizeComponentName(newName) {
|
|
529
322
|
return (0, shared_1.camelize)('-' + newName);
|
|
@@ -531,41 +324,4 @@ function camelizeComponentName(newName) {
|
|
|
531
324
|
function getTagRenameApply(oldName) {
|
|
532
325
|
return oldName === (0, shared_2.hyphenateTag)(oldName) ? shared_2.hyphenateTag : undefined;
|
|
533
326
|
}
|
|
534
|
-
function normalizeAttributeValue(node) {
|
|
535
|
-
let offset = node.loc.start.offset;
|
|
536
|
-
let content = node.loc.source;
|
|
537
|
-
if ((content.startsWith(`'`) && content.endsWith(`'`))
|
|
538
|
-
|| (content.startsWith(`"`) && content.endsWith(`"`))) {
|
|
539
|
-
offset++;
|
|
540
|
-
content = content.slice(1, -1);
|
|
541
|
-
}
|
|
542
|
-
return [content, offset];
|
|
543
|
-
}
|
|
544
|
-
function collectClasses(content, startOffset = 0) {
|
|
545
|
-
const classes = [];
|
|
546
|
-
let currentClassName = '';
|
|
547
|
-
let offset = 0;
|
|
548
|
-
for (const char of (content + ' ')) {
|
|
549
|
-
if (char.trim() === '') {
|
|
550
|
-
if (currentClassName !== '') {
|
|
551
|
-
classes.push({
|
|
552
|
-
source: 'template',
|
|
553
|
-
className: currentClassName,
|
|
554
|
-
offset: offset + startOffset
|
|
555
|
-
});
|
|
556
|
-
offset += currentClassName.length;
|
|
557
|
-
currentClassName = '';
|
|
558
|
-
}
|
|
559
|
-
offset += char.length;
|
|
560
|
-
}
|
|
561
|
-
else {
|
|
562
|
-
currentClassName += char;
|
|
563
|
-
}
|
|
564
|
-
}
|
|
565
|
-
return classes;
|
|
566
|
-
}
|
|
567
|
-
// isTemplateExpression is missing in tsc
|
|
568
|
-
function isTemplateExpression(node) {
|
|
569
|
-
return node.kind === 228;
|
|
570
|
-
}
|
|
571
327
|
//# sourceMappingURL=element.js.map
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateElementChildren = generateElementChildren;
|
|
4
|
-
const CompilerDOM = require("@vue/compiler-dom");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
4
|
const templateChild_1 = require("./templateChild");
|
|
7
5
|
function* generateElementChildren(options, ctx, node) {
|
|
8
6
|
yield* ctx.resetDirectiveComments('end of element children start');
|
|
@@ -12,16 +10,5 @@ function* generateElementChildren(options, ctx, node) {
|
|
|
12
10
|
prev = childNode;
|
|
13
11
|
}
|
|
14
12
|
yield* ctx.generateAutoImportCompletion();
|
|
15
|
-
// fix https://github.com/vuejs/language-tools/issues/932
|
|
16
|
-
if (ctx.currentComponent
|
|
17
|
-
&& !ctx.hasSlotElements.has(node)
|
|
18
|
-
&& node.children.length
|
|
19
|
-
&& node.tagType !== CompilerDOM.ElementTypes.ELEMENT
|
|
20
|
-
&& node.tagType !== CompilerDOM.ElementTypes.TEMPLATE) {
|
|
21
|
-
ctx.currentComponent.used = true;
|
|
22
|
-
yield `${ctx.currentComponent.ctxVar}.slots!.`;
|
|
23
|
-
yield* (0, utils_1.wrapWith)(node.children[0].loc.start.offset, node.children[node.children.length - 1].loc.end.offset, ctx.codeFeatures.navigation, `default`);
|
|
24
|
-
yield utils_1.endOfLine;
|
|
25
|
-
}
|
|
26
13
|
}
|
|
27
14
|
//# sourceMappingURL=elementChildren.js.map
|
|
@@ -5,11 +5,21 @@ exports.generateModifiers = generateModifiers;
|
|
|
5
5
|
const CompilerDOM = require("@vue/compiler-dom");
|
|
6
6
|
const shared_1 = require("@vue/shared");
|
|
7
7
|
const shared_2 = require("../../utils/shared");
|
|
8
|
+
const codeFeatures_1 = require("../codeFeatures");
|
|
8
9
|
const utils_1 = require("../utils");
|
|
9
10
|
const camelized_1 = require("../utils/camelized");
|
|
10
11
|
const stringLiteralKey_1 = require("../utils/stringLiteralKey");
|
|
12
|
+
const elementProps_1 = require("./elementProps");
|
|
11
13
|
const interpolation_1 = require("./interpolation");
|
|
12
14
|
const objectProperty_1 = require("./objectProperty");
|
|
15
|
+
const builtInDirectives = new Set([
|
|
16
|
+
'cloak',
|
|
17
|
+
'html',
|
|
18
|
+
'memo',
|
|
19
|
+
'once',
|
|
20
|
+
'show',
|
|
21
|
+
'text',
|
|
22
|
+
]);
|
|
13
23
|
function* generateElementDirectives(options, ctx, node) {
|
|
14
24
|
for (const prop of node.props) {
|
|
15
25
|
if (prop.type !== CompilerDOM.NodeTypes.DIRECTIVE
|
|
@@ -22,24 +32,22 @@ function* generateElementDirectives(options, ctx, node) {
|
|
|
22
32
|
continue;
|
|
23
33
|
}
|
|
24
34
|
ctx.accessExternalVariable((0, shared_1.camelize)('v-' + prop.name), prop.loc.start.offset);
|
|
25
|
-
yield* (0, utils_1.wrapWith)(prop.loc.start.offset, prop.loc.end.offset, ctx.codeFeatures.verification, `__VLS_asFunctionalDirective(`, ...generateIdentifier(ctx, prop), `)(null!, { ...__VLS_directiveBindingRestFields, `, ...generateArg(options, ctx, prop), ...generateModifiers(options, ctx, prop), ...generateValue(options, ctx, prop), ` }, null!, null!)`);
|
|
35
|
+
yield* (0, utils_1.wrapWith)(prop.loc.start.offset, prop.loc.end.offset, ctx.codeFeatures.verification, `__VLS_asFunctionalDirective(`, ...generateIdentifier(options, ctx, prop), `)(null!, { ...__VLS_directiveBindingRestFields, `, ...generateArg(options, ctx, prop), ...generateModifiers(options, ctx, prop), ...generateValue(options, ctx, prop), ` }, null!, null!)`);
|
|
26
36
|
yield utils_1.endOfLine;
|
|
27
37
|
}
|
|
28
38
|
}
|
|
29
|
-
function* generateIdentifier(ctx, prop) {
|
|
39
|
+
function* generateIdentifier(options, ctx, prop) {
|
|
30
40
|
const rawName = 'v-' + prop.name;
|
|
31
|
-
yield* (0, utils_1.wrapWith)(prop.loc.start.offset, prop.loc.start.offset + rawName.length, ctx.codeFeatures.verification, `__VLS_directives.`, ...(0, camelized_1.generateCamelized)(rawName, prop.loc.start.offset, {
|
|
32
|
-
...
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
isAdditional: true,
|
|
37
|
-
},
|
|
41
|
+
yield* (0, utils_1.wrapWith)(prop.loc.start.offset, prop.loc.start.offset + rawName.length, ctx.codeFeatures.verification, `__VLS_directives.`, ...(0, camelized_1.generateCamelized)(rawName, prop.loc.start.offset, ctx.resolveCodeFeatures({
|
|
42
|
+
...codeFeatures_1.codeFeatures.withoutHighlight,
|
|
43
|
+
// fix https://github.com/vuejs/language-tools/issues/1905
|
|
44
|
+
...codeFeatures_1.codeFeatures.additionalCompletion,
|
|
45
|
+
verification: options.vueCompilerOptions.checkUnknownDirectives && !builtInDirectives.has(prop.name),
|
|
38
46
|
navigation: {
|
|
39
47
|
resolveRenameNewName: shared_1.camelize,
|
|
40
48
|
resolveRenameEditText: getPropRenameApply(prop.name),
|
|
41
49
|
},
|
|
42
|
-
}));
|
|
50
|
+
})));
|
|
43
51
|
}
|
|
44
52
|
function* generateArg(options, ctx, prop) {
|
|
45
53
|
const { arg } = prop;
|
|
@@ -67,7 +75,7 @@ function* generateModifiers(options, ctx, prop, propertyName = 'modifiers') {
|
|
|
67
75
|
yield* (0, utils_1.wrapWith)(startOffset, endOffset, ctx.codeFeatures.verification, propertyName);
|
|
68
76
|
yield `: { `;
|
|
69
77
|
for (const mod of modifiers) {
|
|
70
|
-
yield* (0, objectProperty_1.generateObjectProperty)(options, ctx, mod.content, mod.loc.start.offset, ctx.codeFeatures.
|
|
78
|
+
yield* (0, objectProperty_1.generateObjectProperty)(options, ctx, mod.content, mod.loc.start.offset, ctx.codeFeatures.withoutHighlightAndNavigation);
|
|
71
79
|
yield `: true, `;
|
|
72
80
|
}
|
|
73
81
|
yield `}, `;
|
|
@@ -79,7 +87,7 @@ function* generateValue(options, ctx, prop) {
|
|
|
79
87
|
}
|
|
80
88
|
yield* (0, utils_1.wrapWith)(exp.loc.start.offset, exp.loc.end.offset, ctx.codeFeatures.verification, `value`);
|
|
81
89
|
yield `: `;
|
|
82
|
-
yield* (0,
|
|
90
|
+
yield* (0, elementProps_1.generatePropExp)(options, ctx, prop, exp, ctx.codeFeatures.all);
|
|
83
91
|
}
|
|
84
92
|
function getPropRenameApply(oldName) {
|
|
85
93
|
return oldName === (0, shared_2.hyphenateAttr)(oldName) ? shared_2.hyphenateAttr : undefined;
|