@vue/compat 3.2.41 → 3.2.42

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/dist/vue.cjs.js CHANGED
@@ -98,109 +98,6 @@ function generateCodeFrame(source, start = 0, end = source.length) {
98
98
  return res.join('\n');
99
99
  }
100
100
 
101
- /**
102
- * On the client we only need to offer special cases for boolean attributes that
103
- * have different names from their corresponding dom properties:
104
- * - itemscope -> N/A
105
- * - allowfullscreen -> allowFullscreen
106
- * - formnovalidate -> formNoValidate
107
- * - ismap -> isMap
108
- * - nomodule -> noModule
109
- * - novalidate -> noValidate
110
- * - readonly -> readOnly
111
- */
112
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
113
- const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
114
- /**
115
- * The full list is needed during SSR to produce the correct initial markup.
116
- */
117
- const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
118
- `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
119
- `loop,open,required,reversed,scoped,seamless,` +
120
- `checked,muted,multiple,selected`);
121
- /**
122
- * Boolean attributes should be included if the value is truthy or ''.
123
- * e.g. `<select multiple>` compiles to `{ multiple: '' }`
124
- */
125
- function includeBooleanAttr(value) {
126
- return !!value || value === '';
127
- }
128
- /**
129
- * CSS properties that accept plain numbers
130
- */
131
- const isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +
132
- `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +
133
- `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +
134
- `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
135
- `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
136
- `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
137
- // SVG
138
- `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +
139
- `stroke-miterlimit,stroke-opacity,stroke-width`);
140
- /**
141
- * Known attributes, this is used for stringification of runtime static nodes
142
- * so that we don't stringify bindings that cannot be set from HTML.
143
- * Don't also forget to allow `data-*` and `aria-*`!
144
- * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
145
- */
146
- const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
147
- `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
148
- `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
149
- `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
150
- `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
151
- `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
152
- `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
153
- `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
154
- `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
155
- `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
156
- `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
157
- `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
158
- `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
159
- `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
160
- `value,width,wrap`);
161
- /**
162
- * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
163
- */
164
- const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
165
- `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
166
- `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
167
- `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
168
- `color-interpolation-filters,color-profile,color-rendering,` +
169
- `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
170
- `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
171
- `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
172
- `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
173
- `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
174
- `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
175
- `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
176
- `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
177
- `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
178
- `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
179
- `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
180
- `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
181
- `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
182
- `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
183
- `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
184
- `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
185
- `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
186
- `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
187
- `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
188
- `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
189
- `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
190
- `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
191
- `strikethrough-position,strikethrough-thickness,string,stroke,` +
192
- `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
193
- `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
194
- `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
195
- `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
196
- `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
197
- `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
198
- `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
199
- `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
200
- `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
201
- `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
202
- `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
203
-
204
101
  function normalizeStyle(value) {
205
102
  if (isArray(value)) {
206
103
  const res = {};
@@ -225,10 +122,14 @@ function normalizeStyle(value) {
225
122
  }
226
123
  }
227
124
  const listDelimiterRE = /;(?![^(]*\))/g;
228
- const propertyDelimiterRE = /:(.+)/;
125
+ const propertyDelimiterRE = /:([^]+)/;
126
+ const styleCommentRE = /\/\*.*?\*\//gs;
229
127
  function parseStringStyle(cssText) {
230
128
  const ret = {};
231
- cssText.split(listDelimiterRE).forEach(item => {
129
+ cssText
130
+ .replace(styleCommentRE, '')
131
+ .split(listDelimiterRE)
132
+ .forEach(item => {
232
133
  if (item) {
233
134
  const tmp = item.split(propertyDelimiterRE);
234
135
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -244,8 +145,7 @@ function stringifyStyle(styles) {
244
145
  for (const key in styles) {
245
146
  const value = styles[key];
246
147
  const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
247
- if (isString(value) ||
248
- (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {
148
+ if (isString(value) || typeof value === 'number') {
249
149
  // only render valid values
250
150
  ret += `${normalizedKey}:${value};`;
251
151
  }
@@ -326,6 +226,97 @@ const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
326
226
  */
327
227
  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
328
228
 
229
+ /**
230
+ * On the client we only need to offer special cases for boolean attributes that
231
+ * have different names from their corresponding dom properties:
232
+ * - itemscope -> N/A
233
+ * - allowfullscreen -> allowFullscreen
234
+ * - formnovalidate -> formNoValidate
235
+ * - ismap -> isMap
236
+ * - nomodule -> noModule
237
+ * - novalidate -> noValidate
238
+ * - readonly -> readOnly
239
+ */
240
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
241
+ const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
242
+ /**
243
+ * The full list is needed during SSR to produce the correct initial markup.
244
+ */
245
+ const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
246
+ `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
247
+ `loop,open,required,reversed,scoped,seamless,` +
248
+ `checked,muted,multiple,selected`);
249
+ /**
250
+ * Boolean attributes should be included if the value is truthy or ''.
251
+ * e.g. `<select multiple>` compiles to `{ multiple: '' }`
252
+ */
253
+ function includeBooleanAttr(value) {
254
+ return !!value || value === '';
255
+ }
256
+ /**
257
+ * Known attributes, this is used for stringification of runtime static nodes
258
+ * so that we don't stringify bindings that cannot be set from HTML.
259
+ * Don't also forget to allow `data-*` and `aria-*`!
260
+ * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
261
+ */
262
+ const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
263
+ `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
264
+ `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
265
+ `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
266
+ `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
267
+ `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
268
+ `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
269
+ `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
270
+ `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
271
+ `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
272
+ `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
273
+ `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
274
+ `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
275
+ `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
276
+ `value,width,wrap`);
277
+ /**
278
+ * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
279
+ */
280
+ const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
281
+ `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
282
+ `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
283
+ `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
284
+ `color-interpolation-filters,color-profile,color-rendering,` +
285
+ `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
286
+ `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
287
+ `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
288
+ `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
289
+ `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
290
+ `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
291
+ `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
292
+ `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
293
+ `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
294
+ `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
295
+ `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
296
+ `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
297
+ `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
298
+ `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
299
+ `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
300
+ `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
301
+ `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
302
+ `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
303
+ `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
304
+ `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
305
+ `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
306
+ `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
307
+ `strikethrough-position,strikethrough-thickness,string,stroke,` +
308
+ `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
309
+ `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
310
+ `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
311
+ `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
312
+ `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
313
+ `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
314
+ `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
315
+ `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
316
+ `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
317
+ `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
318
+ `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
319
+
329
320
  const escapeRE = /["'&<>]/;
330
321
  function escapeHtml(string) {
331
322
  const str = '' + string;
@@ -878,8 +869,9 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
878
869
  deps = [...depsMap.values()];
879
870
  }
880
871
  else if (key === 'length' && isArray(target)) {
872
+ const newLength = toNumber(newValue);
881
873
  depsMap.forEach((dep, key) => {
882
- if (key === 'length' || key >= newValue) {
874
+ if (key === 'length' || key >= newLength) {
883
875
  deps.push(dep);
884
876
  }
885
877
  });
@@ -2933,7 +2925,7 @@ function emit$2(instance, event, ...rawArgs) {
2933
2925
  const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
2934
2926
  const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
2935
2927
  if (trim) {
2936
- args = rawArgs.map(a => a.trim());
2928
+ args = rawArgs.map(a => (isString(a) ? a.trim() : a));
2937
2929
  }
2938
2930
  if (number) {
2939
2931
  args = rawArgs.map(toNumber);
@@ -4039,7 +4031,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
4039
4031
  };
4040
4032
  };
4041
4033
  // in SSR there is no need to setup an actual effect, and it should be noop
4042
- // unless it's eager
4034
+ // unless it's eager or sync flush
4035
+ let ssrCleanup;
4043
4036
  if (isInSSRComponentSetup) {
4044
4037
  // we will also not call the invalidate callback (+ runner is not set up)
4045
4038
  onCleanup = NOOP;
@@ -4053,9 +4046,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
4053
4046
  onCleanup
4054
4047
  ]);
4055
4048
  }
4056
- return NOOP;
4049
+ if (flush === 'sync') {
4050
+ const ctx = useSSRContext();
4051
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
4052
+ }
4053
+ else {
4054
+ return NOOP;
4055
+ }
4057
4056
  }
4058
- let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
4057
+ let oldValue = isMultiSource
4058
+ ? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
4059
+ : INITIAL_WATCHER_VALUE;
4059
4060
  const job = () => {
4060
4061
  if (!effect.active) {
4061
4062
  return;
@@ -4077,7 +4078,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
4077
4078
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
4078
4079
  newValue,
4079
4080
  // pass undefined as the old value when it's changed for the first time
4080
- oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
4081
+ oldValue === INITIAL_WATCHER_VALUE ||
4082
+ (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
4083
+ ? undefined
4084
+ : oldValue,
4081
4085
  onCleanup
4082
4086
  ]);
4083
4087
  oldValue = newValue;
@@ -4125,12 +4129,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
4125
4129
  else {
4126
4130
  effect.run();
4127
4131
  }
4128
- return () => {
4132
+ const unwatch = () => {
4129
4133
  effect.stop();
4130
4134
  if (instance && instance.scope) {
4131
4135
  remove(instance.scope.effects, effect);
4132
4136
  }
4133
4137
  };
4138
+ if (ssrCleanup)
4139
+ ssrCleanup.push(unwatch);
4140
+ return unwatch;
4134
4141
  }
4135
4142
  // this.$watch
4136
4143
  function instanceWatch(source, value, options) {
@@ -4312,7 +4319,11 @@ const BaseTransitionImpl = {
4312
4319
  // return placeholder node and queue update when leave finishes
4313
4320
  leavingHooks.afterLeave = () => {
4314
4321
  state.isLeaving = false;
4315
- instance.update();
4322
+ // #6835
4323
+ // it also needs to be updated when active is undefined
4324
+ if (instance.update.active !== false) {
4325
+ instance.update();
4326
+ }
4316
4327
  };
4317
4328
  return emptyPlaceholder(child);
4318
4329
  }
@@ -4841,7 +4852,8 @@ const KeepAliveImpl = {
4841
4852
  : comp);
4842
4853
  const { include, exclude, max } = props;
4843
4854
  if ((include && (!name || !matches(include, name))) ||
4844
- (exclude && name && matches(exclude, name))) {
4855
+ (exclude && name && matches(exclude, name)) ||
4856
+ (hmrDirtyComponents.has(comp))) {
4845
4857
  current = vnode;
4846
4858
  return rawVNode;
4847
4859
  }
@@ -5121,23 +5133,25 @@ function withDirectives(vnode, directives) {
5121
5133
  const bindings = vnode.dirs || (vnode.dirs = []);
5122
5134
  for (let i = 0; i < directives.length; i++) {
5123
5135
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
5124
- if (isFunction(dir)) {
5125
- dir = {
5126
- mounted: dir,
5127
- updated: dir
5128
- };
5129
- }
5130
- if (dir.deep) {
5131
- traverse(value);
5136
+ if (dir) {
5137
+ if (isFunction(dir)) {
5138
+ dir = {
5139
+ mounted: dir,
5140
+ updated: dir
5141
+ };
5142
+ }
5143
+ if (dir.deep) {
5144
+ traverse(value);
5145
+ }
5146
+ bindings.push({
5147
+ dir,
5148
+ instance,
5149
+ value,
5150
+ oldValue: void 0,
5151
+ arg,
5152
+ modifiers
5153
+ });
5132
5154
  }
5133
- bindings.push({
5134
- dir,
5135
- instance,
5136
- value,
5137
- oldValue: void 0,
5138
- arg,
5139
- modifiers
5140
- });
5141
5155
  }
5142
5156
  return vnode;
5143
5157
  }
@@ -6964,7 +6978,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
6964
6978
  if (validatePropName(normalizedKey)) {
6965
6979
  const opt = raw[key];
6966
6980
  const prop = (normalized[normalizedKey] =
6967
- isArray(opt) || isFunction(opt) ? { type: opt } : opt);
6981
+ isArray(opt) || isFunction(opt) ? { type: opt } : { ...opt });
6968
6982
  if (prop) {
6969
6983
  const booleanIndex = getTypeIndex(Boolean, prop.type);
6970
6984
  const stringIndex = getTypeIndex(String, prop.type);
@@ -7334,7 +7348,7 @@ function createCompatVue(createApp, createSingletonApp) {
7334
7348
  return vm;
7335
7349
  }
7336
7350
  }
7337
- Vue.version = `2.6.14-compat:${"3.2.41"}`;
7351
+ Vue.version = `2.6.14-compat:${"3.2.42"}`;
7338
7352
  Vue.config = singletonApp.config;
7339
7353
  Vue.use = (p, ...options) => {
7340
7354
  if (p && isFunction(p.install)) {
@@ -10894,6 +10908,9 @@ function getExposeProxy(instance) {
10894
10908
  else if (key in publicPropertiesMap) {
10895
10909
  return publicPropertiesMap[key](instance);
10896
10910
  }
10911
+ },
10912
+ has(target, key) {
10913
+ return key in target || key in publicPropertiesMap;
10897
10914
  }
10898
10915
  })));
10899
10916
  }
@@ -11347,7 +11364,7 @@ function isMemoSame(cached, memo) {
11347
11364
  }
11348
11365
 
11349
11366
  // Core API ------------------------------------------------------------------
11350
- const version = "3.2.41";
11367
+ const version = "3.2.42";
11351
11368
  const _ssrUtils = {
11352
11369
  createComponentInstance,
11353
11370
  setupComponent,
@@ -11919,7 +11936,7 @@ class VueElement extends BaseClass {
11919
11936
  }
11920
11937
  }).observe(this, { attributes: true });
11921
11938
  const resolve = (def) => {
11922
- const { props, styles } = def;
11939
+ const { props = {}, styles } = def;
11923
11940
  const hasOptions = !isArray(props);
11924
11941
  const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
11925
11942
  // cast Number-type props set before resolve
@@ -11966,10 +11983,11 @@ class VueElement extends BaseClass {
11966
11983
  }
11967
11984
  _setAttr(key) {
11968
11985
  let value = this.getAttribute(key);
11969
- if (this._numberProps && this._numberProps[key]) {
11986
+ const camelKey = camelize(key);
11987
+ if (this._numberProps && this._numberProps[camelKey]) {
11970
11988
  value = toNumber(value);
11971
11989
  }
11972
- this._setProp(camelize(key), value, false);
11990
+ this._setProp(camelKey, value, false);
11973
11991
  }
11974
11992
  /**
11975
11993
  * @internal
@@ -12347,11 +12365,11 @@ function getTransitionInfo(el, expectedType) {
12347
12365
  const styles = window.getComputedStyle(el);
12348
12366
  // JSDOM may return undefined for transition properties
12349
12367
  const getStyleProperties = (key) => (styles[key] || '').split(', ');
12350
- const transitionDelays = getStyleProperties(TRANSITION + 'Delay');
12351
- const transitionDurations = getStyleProperties(TRANSITION + 'Duration');
12368
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
12369
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
12352
12370
  const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
12353
- const animationDelays = getStyleProperties(ANIMATION + 'Delay');
12354
- const animationDurations = getStyleProperties(ANIMATION + 'Duration');
12371
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
12372
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
12355
12373
  const animationTimeout = getTimeout(animationDelays, animationDurations);
12356
12374
  let type = null;
12357
12375
  let timeout = 0;
@@ -12386,7 +12404,7 @@ function getTransitionInfo(el, expectedType) {
12386
12404
  : 0;
12387
12405
  }
12388
12406
  const hasTransform = type === TRANSITION &&
12389
- /\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);
12407
+ /\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
12390
12408
  return {
12391
12409
  type,
12392
12410
  timeout,
@@ -13751,7 +13769,10 @@ function injectProp(node, prop, context) {
13751
13769
  // if doesn't override user provided keys
13752
13770
  const first = props.arguments[0];
13753
13771
  if (!isString(first) && first.type === 15 /* NodeTypes.JS_OBJECT_EXPRESSION */) {
13754
- first.properties.unshift(prop);
13772
+ // #6631
13773
+ if (!hasProp(prop, first)) {
13774
+ first.properties.unshift(prop);
13775
+ }
13755
13776
  }
13756
13777
  else {
13757
13778
  if (props.callee === TO_HANDLERS) {
@@ -13768,14 +13789,7 @@ function injectProp(node, prop, context) {
13768
13789
  !propsWithInjection && (propsWithInjection = props);
13769
13790
  }
13770
13791
  else if (props.type === 15 /* NodeTypes.JS_OBJECT_EXPRESSION */) {
13771
- let alreadyExists = false;
13772
- // check existing key to avoid overriding user provided keys
13773
- if (prop.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
13774
- const propKeyName = prop.key.content;
13775
- alreadyExists = props.properties.some(p => p.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&
13776
- p.key.content === propKeyName);
13777
- }
13778
- if (!alreadyExists) {
13792
+ if (!hasProp(prop, props)) {
13779
13793
  props.properties.unshift(prop);
13780
13794
  }
13781
13795
  propsWithInjection = props;
@@ -13810,6 +13824,16 @@ function injectProp(node, prop, context) {
13810
13824
  }
13811
13825
  }
13812
13826
  }
13827
+ // check existing key to avoid overriding user provided keys
13828
+ function hasProp(prop, props) {
13829
+ let result = false;
13830
+ if (prop.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
13831
+ const propKeyName = prop.key.content;
13832
+ result = props.properties.some(p => p.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&
13833
+ p.key.content === propKeyName);
13834
+ }
13835
+ return result;
13836
+ }
13813
13837
  function toValidAssetId(name, type) {
13814
13838
  // see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character
13815
13839
  return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
@@ -14124,13 +14148,18 @@ function parseChildren(context, mode, ancestors) {
14124
14148
  const next = nodes[i + 1];
14125
14149
  // Remove if:
14126
14150
  // - the whitespace is the first or last node, or:
14127
- // - (condense mode) the whitespace is adjacent to a comment, or:
14151
+ // - (condense mode) the whitespace is between twos comments, or:
14152
+ // - (condense mode) the whitespace is between comment and element, or:
14128
14153
  // - (condense mode) the whitespace is between two elements AND contains newline
14129
14154
  if (!prev ||
14130
14155
  !next ||
14131
14156
  (shouldCondense &&
14132
- (prev.type === 3 /* NodeTypes.COMMENT */ ||
14133
- next.type === 3 /* NodeTypes.COMMENT */ ||
14157
+ ((prev.type === 3 /* NodeTypes.COMMENT */ &&
14158
+ next.type === 3 /* NodeTypes.COMMENT */) ||
14159
+ (prev.type === 3 /* NodeTypes.COMMENT */ &&
14160
+ next.type === 1 /* NodeTypes.ELEMENT */) ||
14161
+ (prev.type === 1 /* NodeTypes.ELEMENT */ &&
14162
+ next.type === 3 /* NodeTypes.COMMENT */) ||
14134
14163
  (prev.type === 1 /* NodeTypes.ELEMENT */ &&
14135
14164
  next.type === 1 /* NodeTypes.ELEMENT */ &&
14136
14165
  /[\r\n]/.test(node.content))))) {
@@ -17792,11 +17821,14 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
17792
17821
  // in inline mode there is no setupState object, so we can't use string
17793
17822
  // keys to set the ref. Instead, we need to transform it to pass the
17794
17823
  // actual ref instead.
17795
- if (value &&
17796
- context.inline &&
17797
- context.bindingMetadata[value.content]) {
17798
- isStatic = false;
17799
- properties.push(createObjectProperty(createSimpleExpression('ref_key', true), createSimpleExpression(value.content, true, value.loc)));
17824
+ if (value && context.inline) {
17825
+ const binding = context.bindingMetadata[value.content];
17826
+ if (binding === "setup-let" /* BindingTypes.SETUP_LET */ ||
17827
+ binding === "setup-ref" /* BindingTypes.SETUP_REF */ ||
17828
+ binding === "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */) {
17829
+ isStatic = false;
17830
+ properties.push(createObjectProperty(createSimpleExpression('ref_key', true), createSimpleExpression(value.content, true, value.loc)));
17831
+ }
17800
17832
  }
17801
17833
  }
17802
17834
  // skip is on <component>, or is="vue:xxx"
@@ -18202,7 +18234,7 @@ function processSlotOutlet(node, context) {
18202
18234
  };
18203
18235
  }
18204
18236
 
18205
- const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
18237
+ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
18206
18238
  const transformOn = (dir, node, context, augmentor) => {
18207
18239
  const { loc, modifiers, arg } = dir;
18208
18240
  if (!dir.exp && !modifiers.length) {
@@ -18216,10 +18248,10 @@ const transformOn = (dir, node, context, augmentor) => {
18216
18248
  if (rawName.startsWith('vue:')) {
18217
18249
  rawName = `vnode-${rawName.slice(4)}`;
18218
18250
  }
18219
- const eventString = node.tagType === 1 /* ElementTypes.COMPONENT */ ||
18251
+ const eventString = node.tagType !== 0 /* ElementTypes.ELEMENT */ ||
18220
18252
  rawName.startsWith('vnode') ||
18221
18253
  !/[A-Z]/.test(rawName)
18222
- ? // for component and vnode lifecycle event listeners, auto convert
18254
+ ? // for non-element and vnode lifecycle event listeners, auto convert
18223
18255
  // it to camelCase. See issue #2249
18224
18256
  toHandlerKey(camelize(rawName))
18225
18257
  : // preserve case for plain element listeners that have uppercase