@vue/compat 3.2.41 → 3.2.43

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.
@@ -25,109 +25,6 @@ const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,p
25
25
  'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
26
26
  const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
27
27
 
28
- /**
29
- * On the client we only need to offer special cases for boolean attributes that
30
- * have different names from their corresponding dom properties:
31
- * - itemscope -> N/A
32
- * - allowfullscreen -> allowFullscreen
33
- * - formnovalidate -> formNoValidate
34
- * - ismap -> isMap
35
- * - nomodule -> noModule
36
- * - novalidate -> noValidate
37
- * - readonly -> readOnly
38
- */
39
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
40
- const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
41
- /**
42
- * The full list is needed during SSR to produce the correct initial markup.
43
- */
44
- const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
45
- `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
46
- `loop,open,required,reversed,scoped,seamless,` +
47
- `checked,muted,multiple,selected`);
48
- /**
49
- * Boolean attributes should be included if the value is truthy or ''.
50
- * e.g. `<select multiple>` compiles to `{ multiple: '' }`
51
- */
52
- function includeBooleanAttr(value) {
53
- return !!value || value === '';
54
- }
55
- /**
56
- * CSS properties that accept plain numbers
57
- */
58
- const isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +
59
- `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +
60
- `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +
61
- `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
62
- `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
63
- `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
64
- // SVG
65
- `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +
66
- `stroke-miterlimit,stroke-opacity,stroke-width`);
67
- /**
68
- * Known attributes, this is used for stringification of runtime static nodes
69
- * so that we don't stringify bindings that cannot be set from HTML.
70
- * Don't also forget to allow `data-*` and `aria-*`!
71
- * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
72
- */
73
- const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
74
- `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
75
- `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
76
- `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
77
- `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
78
- `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
79
- `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
80
- `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
81
- `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
82
- `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
83
- `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
84
- `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
85
- `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
86
- `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
87
- `value,width,wrap`);
88
- /**
89
- * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
90
- */
91
- const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
92
- `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
93
- `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
94
- `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
95
- `color-interpolation-filters,color-profile,color-rendering,` +
96
- `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
97
- `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
98
- `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
99
- `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
100
- `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
101
- `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
102
- `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
103
- `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
104
- `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
105
- `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
106
- `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
107
- `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
108
- `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
109
- `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
110
- `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
111
- `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
112
- `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
113
- `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
114
- `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
115
- `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
116
- `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
117
- `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
118
- `strikethrough-position,strikethrough-thickness,string,stroke,` +
119
- `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
120
- `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
121
- `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
122
- `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
123
- `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
124
- `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
125
- `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
126
- `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
127
- `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
128
- `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
129
- `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
130
-
131
28
  function normalizeStyle(value) {
132
29
  if (isArray(value)) {
133
30
  const res = {};
@@ -152,10 +49,14 @@ function normalizeStyle(value) {
152
49
  }
153
50
  }
154
51
  const listDelimiterRE = /;(?![^(]*\))/g;
155
- const propertyDelimiterRE = /:(.+)/;
52
+ const propertyDelimiterRE = /:([^]+)/;
53
+ const styleCommentRE = /\/\*.*?\*\//gs;
156
54
  function parseStringStyle(cssText) {
157
55
  const ret = {};
158
- cssText.split(listDelimiterRE).forEach(item => {
56
+ cssText
57
+ .replace(styleCommentRE, '')
58
+ .split(listDelimiterRE)
59
+ .forEach(item => {
159
60
  if (item) {
160
61
  const tmp = item.split(propertyDelimiterRE);
161
62
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -171,8 +72,7 @@ function stringifyStyle(styles) {
171
72
  for (const key in styles) {
172
73
  const value = styles[key];
173
74
  const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
174
- if (isString(value) ||
175
- (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {
75
+ if (isString(value) || typeof value === 'number') {
176
76
  // only render valid values
177
77
  ret += `${normalizedKey}:${value};`;
178
78
  }
@@ -253,6 +153,97 @@ const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
253
153
  */
254
154
  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
255
155
 
156
+ /**
157
+ * On the client we only need to offer special cases for boolean attributes that
158
+ * have different names from their corresponding dom properties:
159
+ * - itemscope -> N/A
160
+ * - allowfullscreen -> allowFullscreen
161
+ * - formnovalidate -> formNoValidate
162
+ * - ismap -> isMap
163
+ * - nomodule -> noModule
164
+ * - novalidate -> noValidate
165
+ * - readonly -> readOnly
166
+ */
167
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
168
+ const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
169
+ /**
170
+ * The full list is needed during SSR to produce the correct initial markup.
171
+ */
172
+ const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
173
+ `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
174
+ `loop,open,required,reversed,scoped,seamless,` +
175
+ `checked,muted,multiple,selected`);
176
+ /**
177
+ * Boolean attributes should be included if the value is truthy or ''.
178
+ * e.g. `<select multiple>` compiles to `{ multiple: '' }`
179
+ */
180
+ function includeBooleanAttr(value) {
181
+ return !!value || value === '';
182
+ }
183
+ /**
184
+ * Known attributes, this is used for stringification of runtime static nodes
185
+ * so that we don't stringify bindings that cannot be set from HTML.
186
+ * Don't also forget to allow `data-*` and `aria-*`!
187
+ * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
188
+ */
189
+ const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
190
+ `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
191
+ `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
192
+ `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
193
+ `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
194
+ `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
195
+ `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
196
+ `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
197
+ `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
198
+ `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
199
+ `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
200
+ `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
201
+ `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
202
+ `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
203
+ `value,width,wrap`);
204
+ /**
205
+ * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
206
+ */
207
+ const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
208
+ `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
209
+ `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
210
+ `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
211
+ `color-interpolation-filters,color-profile,color-rendering,` +
212
+ `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
213
+ `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
214
+ `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
215
+ `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
216
+ `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
217
+ `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
218
+ `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
219
+ `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
220
+ `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
221
+ `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
222
+ `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
223
+ `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
224
+ `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
225
+ `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
226
+ `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
227
+ `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
228
+ `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
229
+ `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
230
+ `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
231
+ `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
232
+ `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
233
+ `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
234
+ `strikethrough-position,strikethrough-thickness,string,stroke,` +
235
+ `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
236
+ `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
237
+ `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
238
+ `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
239
+ `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
240
+ `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
241
+ `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
242
+ `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
243
+ `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
244
+ `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
245
+ `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
246
+
256
247
  const escapeRE = /["'&<>]/;
257
248
  function escapeHtml(string) {
258
249
  const str = '' + string;
@@ -785,8 +776,9 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
785
776
  deps = [...depsMap.values()];
786
777
  }
787
778
  else if (key === 'length' && isArray(target)) {
779
+ const newLength = toNumber(newValue);
788
780
  depsMap.forEach((dep, key) => {
789
- if (key === 'length' || key >= newValue) {
781
+ if (key === 'length' || key >= newLength) {
790
782
  deps.push(dep);
791
783
  }
792
784
  });
@@ -1586,112 +1578,8 @@ function computed(getterOrOptions, debugOptions, isSSR = false) {
1586
1578
  return cRef;
1587
1579
  }
1588
1580
 
1589
- const stack = [];
1590
1581
  function warn(msg, ...args) {
1591
- // avoid props formatting or warn handler tracking deps that might be mutated
1592
- // during patch, leading to infinite recursion.
1593
- pauseTracking();
1594
- const instance = stack.length ? stack[stack.length - 1].component : null;
1595
- const appWarnHandler = instance && instance.appContext.config.warnHandler;
1596
- const trace = getComponentTrace();
1597
- if (appWarnHandler) {
1598
- callWithErrorHandling(appWarnHandler, instance, 11 /* ErrorCodes.APP_WARN_HANDLER */, [
1599
- msg + args.join(''),
1600
- instance && instance.proxy,
1601
- trace
1602
- .map(({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`)
1603
- .join('\n'),
1604
- trace
1605
- ]);
1606
- }
1607
- else {
1608
- const warnArgs = [`[Vue warn]: ${msg}`, ...args];
1609
- /* istanbul ignore if */
1610
- if (trace.length &&
1611
- // avoid spamming console during tests
1612
- !false) {
1613
- warnArgs.push(`\n`, ...formatTrace(trace));
1614
- }
1615
- console.warn(...warnArgs);
1616
- }
1617
- resetTracking();
1618
- }
1619
- function getComponentTrace() {
1620
- let currentVNode = stack[stack.length - 1];
1621
- if (!currentVNode) {
1622
- return [];
1623
- }
1624
- // we can't just use the stack because it will be incomplete during updates
1625
- // that did not start from the root. Re-construct the parent chain using
1626
- // instance parent pointers.
1627
- const normalizedStack = [];
1628
- while (currentVNode) {
1629
- const last = normalizedStack[0];
1630
- if (last && last.vnode === currentVNode) {
1631
- last.recurseCount++;
1632
- }
1633
- else {
1634
- normalizedStack.push({
1635
- vnode: currentVNode,
1636
- recurseCount: 0
1637
- });
1638
- }
1639
- const parentInstance = currentVNode.component && currentVNode.component.parent;
1640
- currentVNode = parentInstance && parentInstance.vnode;
1641
- }
1642
- return normalizedStack;
1643
- }
1644
- /* istanbul ignore next */
1645
- function formatTrace(trace) {
1646
- const logs = [];
1647
- trace.forEach((entry, i) => {
1648
- logs.push(...(i === 0 ? [] : [`\n`]), ...formatTraceEntry(entry));
1649
- });
1650
- return logs;
1651
- }
1652
- function formatTraceEntry({ vnode, recurseCount }) {
1653
- const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
1654
- const isRoot = vnode.component ? vnode.component.parent == null : false;
1655
- const open = ` at <${formatComponentName(vnode.component, vnode.type, isRoot)}`;
1656
- const close = `>` + postfix;
1657
- return vnode.props
1658
- ? [open, ...formatProps(vnode.props), close]
1659
- : [open + close];
1660
- }
1661
- /* istanbul ignore next */
1662
- function formatProps(props) {
1663
- const res = [];
1664
- const keys = Object.keys(props);
1665
- keys.slice(0, 3).forEach(key => {
1666
- res.push(...formatProp(key, props[key]));
1667
- });
1668
- if (keys.length > 3) {
1669
- res.push(` ...`);
1670
- }
1671
- return res;
1672
- }
1673
- /* istanbul ignore next */
1674
- function formatProp(key, value, raw) {
1675
- if (isString(value)) {
1676
- value = JSON.stringify(value);
1677
- return raw ? value : [`${key}=${value}`];
1678
- }
1679
- else if (typeof value === 'number' ||
1680
- typeof value === 'boolean' ||
1681
- value == null) {
1682
- return raw ? value : [`${key}=${value}`];
1683
- }
1684
- else if (isRef(value)) {
1685
- value = formatProp(key, toRaw(value.value), true);
1686
- return raw ? value : [`${key}=Ref<`, value, `>`];
1687
- }
1688
- else if (isFunction(value)) {
1689
- return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
1690
- }
1691
- else {
1692
- value = toRaw(value);
1693
- return raw ? value : [`${key}=`, value];
1694
- }
1582
+ return;
1695
1583
  }
1696
1584
 
1697
1585
  function callWithErrorHandling(fn, instance, type, args) {
@@ -2138,7 +2026,7 @@ function emit$1(instance, event, ...rawArgs) {
2138
2026
  const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
2139
2027
  const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
2140
2028
  if (trim) {
2141
- args = rawArgs.map(a => a.trim());
2029
+ args = rawArgs.map(a => (isString(a) ? a.trim() : a));
2142
2030
  }
2143
2031
  if (number) {
2144
2032
  args = rawArgs.map(toNumber);
@@ -3068,7 +2956,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3068
2956
  };
3069
2957
  };
3070
2958
  // in SSR there is no need to setup an actual effect, and it should be noop
3071
- // unless it's eager
2959
+ // unless it's eager or sync flush
2960
+ let ssrCleanup;
3072
2961
  if (isInSSRComponentSetup) {
3073
2962
  // we will also not call the invalidate callback (+ runner is not set up)
3074
2963
  onCleanup = NOOP;
@@ -3082,9 +2971,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3082
2971
  onCleanup
3083
2972
  ]);
3084
2973
  }
3085
- return NOOP;
2974
+ if (flush === 'sync') {
2975
+ const ctx = useSSRContext();
2976
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
2977
+ }
2978
+ else {
2979
+ return NOOP;
2980
+ }
3086
2981
  }
3087
- let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
2982
+ let oldValue = isMultiSource
2983
+ ? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
2984
+ : INITIAL_WATCHER_VALUE;
3088
2985
  const job = () => {
3089
2986
  if (!effect.active) {
3090
2987
  return;
@@ -3106,7 +3003,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3106
3003
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
3107
3004
  newValue,
3108
3005
  // pass undefined as the old value when it's changed for the first time
3109
- oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
3006
+ oldValue === INITIAL_WATCHER_VALUE ||
3007
+ (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
3008
+ ? []
3009
+ : oldValue,
3110
3010
  onCleanup
3111
3011
  ]);
3112
3012
  oldValue = newValue;
@@ -3150,12 +3050,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3150
3050
  else {
3151
3051
  effect.run();
3152
3052
  }
3153
- return () => {
3053
+ const unwatch = () => {
3154
3054
  effect.stop();
3155
3055
  if (instance && instance.scope) {
3156
3056
  remove(instance.scope.effects, effect);
3157
3057
  }
3158
3058
  };
3059
+ if (ssrCleanup)
3060
+ ssrCleanup.push(unwatch);
3061
+ return unwatch;
3159
3062
  }
3160
3063
  // this.$watch
3161
3064
  function instanceWatch(source, value, options) {
@@ -3323,7 +3226,11 @@ const BaseTransitionImpl = {
3323
3226
  // return placeholder node and queue update when leave finishes
3324
3227
  leavingHooks.afterLeave = () => {
3325
3228
  state.isLeaving = false;
3326
- instance.update();
3229
+ // #6835
3230
+ // it also needs to be updated when active is undefined
3231
+ if (instance.update.active !== false) {
3232
+ instance.update();
3233
+ }
3327
3234
  };
3328
3235
  return emptyPlaceholder(child);
3329
3236
  }
@@ -3831,7 +3738,8 @@ const KeepAliveImpl = {
3831
3738
  : comp);
3832
3739
  const { include, exclude, max } = props;
3833
3740
  if ((include && (!name || !matches(include, name))) ||
3834
- (exclude && name && matches(exclude, name))) {
3741
+ (exclude && name && matches(exclude, name)) ||
3742
+ (false )) {
3835
3743
  current = vnode;
3836
3744
  return rawVNode;
3837
3745
  }
@@ -4096,23 +4004,25 @@ function withDirectives(vnode, directives) {
4096
4004
  const bindings = vnode.dirs || (vnode.dirs = []);
4097
4005
  for (let i = 0; i < directives.length; i++) {
4098
4006
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
4099
- if (isFunction(dir)) {
4100
- dir = {
4101
- mounted: dir,
4102
- updated: dir
4103
- };
4104
- }
4105
- if (dir.deep) {
4106
- traverse(value);
4007
+ if (dir) {
4008
+ if (isFunction(dir)) {
4009
+ dir = {
4010
+ mounted: dir,
4011
+ updated: dir
4012
+ };
4013
+ }
4014
+ if (dir.deep) {
4015
+ traverse(value);
4016
+ }
4017
+ bindings.push({
4018
+ dir,
4019
+ instance,
4020
+ value,
4021
+ oldValue: void 0,
4022
+ arg,
4023
+ modifiers
4024
+ });
4107
4025
  }
4108
- bindings.push({
4109
- dir,
4110
- instance,
4111
- value,
4112
- oldValue: void 0,
4113
- arg,
4114
- modifiers
4115
- });
4116
4026
  }
4117
4027
  return vnode;
4118
4028
  }
@@ -5700,7 +5610,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
5700
5610
  if (validatePropName(normalizedKey)) {
5701
5611
  const opt = raw[key];
5702
5612
  const prop = (normalized[normalizedKey] =
5703
- isArray(opt) || isFunction(opt) ? { type: opt } : opt);
5613
+ isArray(opt) || isFunction(opt) ? { type: opt } : { ...opt });
5704
5614
  if (prop) {
5705
5615
  const booleanIndex = getTypeIndex(Boolean, prop.type);
5706
5616
  const stringIndex = getTypeIndex(String, prop.type);
@@ -5893,7 +5803,7 @@ function createCompatVue(createApp, createSingletonApp) {
5893
5803
  return vm;
5894
5804
  }
5895
5805
  }
5896
- Vue.version = `2.6.14-compat:${"3.2.41"}`;
5806
+ Vue.version = `2.6.14-compat:${"3.2.43"}`;
5897
5807
  Vue.config = singletonApp.config;
5898
5808
  Vue.use = (p, ...options) => {
5899
5809
  if (p && isFunction(p.install)) {
@@ -8953,41 +8863,18 @@ function getExposeProxy(instance) {
8953
8863
  else if (key in publicPropertiesMap) {
8954
8864
  return publicPropertiesMap[key](instance);
8955
8865
  }
8866
+ },
8867
+ has(target, key) {
8868
+ return key in target || key in publicPropertiesMap;
8956
8869
  }
8957
8870
  })));
8958
8871
  }
8959
8872
  }
8960
- const classifyRE = /(?:^|[-_])(\w)/g;
8961
- const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g, '');
8962
8873
  function getComponentName(Component, includeInferred = true) {
8963
8874
  return isFunction(Component)
8964
8875
  ? Component.displayName || Component.name
8965
8876
  : Component.name || (includeInferred && Component.__name);
8966
8877
  }
8967
- /* istanbul ignore next */
8968
- function formatComponentName(instance, Component, isRoot = false) {
8969
- let name = getComponentName(Component);
8970
- if (!name && Component.__file) {
8971
- const match = Component.__file.match(/([^/\\]+)\.\w+$/);
8972
- if (match) {
8973
- name = match[1];
8974
- }
8975
- }
8976
- if (!name && instance && instance.parent) {
8977
- // try to infer the name based on reverse resolution
8978
- const inferFromRegistry = (registry) => {
8979
- for (const key in registry) {
8980
- if (registry[key] === Component) {
8981
- return key;
8982
- }
8983
- }
8984
- };
8985
- name =
8986
- inferFromRegistry(instance.components ||
8987
- instance.parent.type.components) || inferFromRegistry(instance.appContext.components);
8988
- }
8989
- return name ? classify(name) : isRoot ? `App` : `Anonymous`;
8990
- }
8991
8878
  function isClassComponent(value) {
8992
8879
  return isFunction(value) && '__vccOpts' in value;
8993
8880
  }
@@ -9156,10 +9043,6 @@ const ssrContextKey = Symbol(``);
9156
9043
  const useSSRContext = () => {
9157
9044
  {
9158
9045
  const ctx = inject(ssrContextKey);
9159
- if (!ctx) {
9160
- warn(`Server rendering context not provided. Make sure to only call ` +
9161
- `useSSRContext() conditionally in the server build.`);
9162
- }
9163
9046
  return ctx;
9164
9047
  }
9165
9048
  };
@@ -9199,7 +9082,7 @@ function isMemoSame(cached, memo) {
9199
9082
  }
9200
9083
 
9201
9084
  // Core API ------------------------------------------------------------------
9202
- const version = "3.2.41";
9085
+ const version = "3.2.43";
9203
9086
  const _ssrUtils = {
9204
9087
  createComponentInstance,
9205
9088
  setupComponent,
@@ -9761,7 +9644,7 @@ class VueElement extends BaseClass {
9761
9644
  }
9762
9645
  }).observe(this, { attributes: true });
9763
9646
  const resolve = (def) => {
9764
- const { props, styles } = def;
9647
+ const { props = {}, styles } = def;
9765
9648
  const hasOptions = !isArray(props);
9766
9649
  const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9767
9650
  // cast Number-type props set before resolve
@@ -9808,10 +9691,11 @@ class VueElement extends BaseClass {
9808
9691
  }
9809
9692
  _setAttr(key) {
9810
9693
  let value = this.getAttribute(key);
9811
- if (this._numberProps && this._numberProps[key]) {
9694
+ const camelKey = camelize(key);
9695
+ if (this._numberProps && this._numberProps[camelKey]) {
9812
9696
  value = toNumber(value);
9813
9697
  }
9814
- this._setProp(camelize(key), value, false);
9698
+ this._setProp(camelKey, value, false);
9815
9699
  }
9816
9700
  /**
9817
9701
  * @internal
@@ -10153,11 +10037,11 @@ function getTransitionInfo(el, expectedType) {
10153
10037
  const styles = window.getComputedStyle(el);
10154
10038
  // JSDOM may return undefined for transition properties
10155
10039
  const getStyleProperties = (key) => (styles[key] || '').split(', ');
10156
- const transitionDelays = getStyleProperties(TRANSITION + 'Delay');
10157
- const transitionDurations = getStyleProperties(TRANSITION + 'Duration');
10040
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
10041
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
10158
10042
  const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
10159
- const animationDelays = getStyleProperties(ANIMATION + 'Delay');
10160
- const animationDurations = getStyleProperties(ANIMATION + 'Duration');
10043
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
10044
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
10161
10045
  const animationTimeout = getTimeout(animationDelays, animationDurations);
10162
10046
  let type = null;
10163
10047
  let timeout = 0;
@@ -10192,7 +10076,7 @@ function getTransitionInfo(el, expectedType) {
10192
10076
  : 0;
10193
10077
  }
10194
10078
  const hasTransform = type === TRANSITION &&
10195
- /\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);
10079
+ /\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
10196
10080
  return {
10197
10081
  type,
10198
10082
  timeout,
@@ -11476,7 +11360,10 @@ function injectProp(node, prop, context) {
11476
11360
  // if doesn't override user provided keys
11477
11361
  const first = props.arguments[0];
11478
11362
  if (!isString(first) && first.type === 15 /* NodeTypes.JS_OBJECT_EXPRESSION */) {
11479
- first.properties.unshift(prop);
11363
+ // #6631
11364
+ if (!hasProp(prop, first)) {
11365
+ first.properties.unshift(prop);
11366
+ }
11480
11367
  }
11481
11368
  else {
11482
11369
  if (props.callee === TO_HANDLERS) {
@@ -11493,14 +11380,7 @@ function injectProp(node, prop, context) {
11493
11380
  !propsWithInjection && (propsWithInjection = props);
11494
11381
  }
11495
11382
  else if (props.type === 15 /* NodeTypes.JS_OBJECT_EXPRESSION */) {
11496
- let alreadyExists = false;
11497
- // check existing key to avoid overriding user provided keys
11498
- if (prop.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
11499
- const propKeyName = prop.key.content;
11500
- alreadyExists = props.properties.some(p => p.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&
11501
- p.key.content === propKeyName);
11502
- }
11503
- if (!alreadyExists) {
11383
+ if (!hasProp(prop, props)) {
11504
11384
  props.properties.unshift(prop);
11505
11385
  }
11506
11386
  propsWithInjection = props;
@@ -11535,6 +11415,16 @@ function injectProp(node, prop, context) {
11535
11415
  }
11536
11416
  }
11537
11417
  }
11418
+ // check existing key to avoid overriding user provided keys
11419
+ function hasProp(prop, props) {
11420
+ let result = false;
11421
+ if (prop.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
11422
+ const propKeyName = prop.key.content;
11423
+ result = props.properties.some(p => p.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&
11424
+ p.key.content === propKeyName);
11425
+ }
11426
+ return result;
11427
+ }
11538
11428
  function toValidAssetId(name, type) {
11539
11429
  // see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character
11540
11430
  return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
@@ -11780,13 +11670,18 @@ function parseChildren(context, mode, ancestors) {
11780
11670
  const next = nodes[i + 1];
11781
11671
  // Remove if:
11782
11672
  // - the whitespace is the first or last node, or:
11783
- // - (condense mode) the whitespace is adjacent to a comment, or:
11673
+ // - (condense mode) the whitespace is between twos comments, or:
11674
+ // - (condense mode) the whitespace is between comment and element, or:
11784
11675
  // - (condense mode) the whitespace is between two elements AND contains newline
11785
11676
  if (!prev ||
11786
11677
  !next ||
11787
11678
  (shouldCondense &&
11788
- (prev.type === 3 /* NodeTypes.COMMENT */ ||
11789
- next.type === 3 /* NodeTypes.COMMENT */ ||
11679
+ ((prev.type === 3 /* NodeTypes.COMMENT */ &&
11680
+ next.type === 3 /* NodeTypes.COMMENT */) ||
11681
+ (prev.type === 3 /* NodeTypes.COMMENT */ &&
11682
+ next.type === 1 /* NodeTypes.ELEMENT */) ||
11683
+ (prev.type === 1 /* NodeTypes.ELEMENT */ &&
11684
+ next.type === 3 /* NodeTypes.COMMENT */) ||
11790
11685
  (prev.type === 1 /* NodeTypes.ELEMENT */ &&
11791
11686
  next.type === 1 /* NodeTypes.ELEMENT */ &&
11792
11687
  /[\r\n]/.test(node.content))))) {
@@ -14384,6 +14279,10 @@ function processIf(node, dir, context, processCodegen) {
14384
14279
  let i = siblings.indexOf(node);
14385
14280
  while (i-- >= -1) {
14386
14281
  const sibling = siblings[i];
14282
+ if (sibling && sibling.type === 3 /* NodeTypes.COMMENT */) {
14283
+ context.removeNode(sibling);
14284
+ continue;
14285
+ }
14387
14286
  if (sibling &&
14388
14287
  sibling.type === 2 /* NodeTypes.TEXT */ &&
14389
14288
  !sibling.content.trim().length) {
@@ -15348,11 +15247,14 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
15348
15247
  // in inline mode there is no setupState object, so we can't use string
15349
15248
  // keys to set the ref. Instead, we need to transform it to pass the
15350
15249
  // actual ref instead.
15351
- if (value &&
15352
- context.inline &&
15353
- context.bindingMetadata[value.content]) {
15354
- isStatic = false;
15355
- properties.push(createObjectProperty(createSimpleExpression('ref_key', true), createSimpleExpression(value.content, true, value.loc)));
15250
+ if (value && context.inline) {
15251
+ const binding = context.bindingMetadata[value.content];
15252
+ if (binding === "setup-let" /* BindingTypes.SETUP_LET */ ||
15253
+ binding === "setup-ref" /* BindingTypes.SETUP_REF */ ||
15254
+ binding === "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */) {
15255
+ isStatic = false;
15256
+ properties.push(createObjectProperty(createSimpleExpression('ref_key', true), createSimpleExpression(value.content, true, value.loc)));
15257
+ }
15356
15258
  }
15357
15259
  }
15358
15260
  // skip is on <component>, or is="vue:xxx"
@@ -15735,7 +15637,7 @@ function processSlotOutlet(node, context) {
15735
15637
  };
15736
15638
  }
15737
15639
 
15738
- const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15640
+ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15739
15641
  const transformOn = (dir, node, context, augmentor) => {
15740
15642
  const { loc, modifiers, arg } = dir;
15741
15643
  if (!dir.exp && !modifiers.length) {
@@ -15749,10 +15651,10 @@ const transformOn = (dir, node, context, augmentor) => {
15749
15651
  if (rawName.startsWith('vue:')) {
15750
15652
  rawName = `vnode-${rawName.slice(4)}`;
15751
15653
  }
15752
- const eventString = node.tagType === 1 /* ElementTypes.COMPONENT */ ||
15654
+ const eventString = node.tagType !== 0 /* ElementTypes.ELEMENT */ ||
15753
15655
  rawName.startsWith('vnode') ||
15754
15656
  !/[A-Z]/.test(rawName)
15755
- ? // for component and vnode lifecycle event listeners, auto convert
15657
+ ? // for non-element and vnode lifecycle event listeners, auto convert
15756
15658
  // it to camelCase. See issue #2249
15757
15659
  toHandlerKey(camelize(rawName))
15758
15660
  : // preserve case for plain element listeners that have uppercase