vue 3.4.33 → 3.4.35

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.33
2
+ * vue v3.4.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.33
2
+ * vue v3.4.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4562,14 +4562,27 @@ If you want to remount the same app, move your app creation logic into a factory
4562
4562
  if (validatePropName(normalizedKey)) {
4563
4563
  const opt = raw[key];
4564
4564
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
4565
- if (prop) {
4566
- const booleanIndex = getTypeIndex(Boolean, prop.type);
4567
- const stringIndex = getTypeIndex(String, prop.type);
4568
- prop[0 /* shouldCast */] = booleanIndex > -1;
4569
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
4570
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
4571
- needCastKeys.push(normalizedKey);
4565
+ const propType = prop.type;
4566
+ let shouldCast = false;
4567
+ let shouldCastTrue = true;
4568
+ if (isArray(propType)) {
4569
+ for (let index = 0; index < propType.length; ++index) {
4570
+ const type = propType[index];
4571
+ const typeName = isFunction(type) && type.name;
4572
+ if (typeName === "Boolean") {
4573
+ shouldCast = true;
4574
+ break;
4575
+ } else if (typeName === "String") {
4576
+ shouldCastTrue = false;
4577
+ }
4572
4578
  }
4579
+ } else {
4580
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
4581
+ }
4582
+ prop[0 /* shouldCast */] = shouldCast;
4583
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
4584
+ if (shouldCast || hasOwn(prop, "default")) {
4585
+ needCastKeys.push(normalizedKey);
4573
4586
  }
4574
4587
  }
4575
4588
  }
@@ -4600,17 +4613,6 @@ If you want to remount the same app, move your app creation logic into a factory
4600
4613
  }
4601
4614
  return "";
4602
4615
  }
4603
- function isSameType(a, b) {
4604
- return getType(a) === getType(b);
4605
- }
4606
- function getTypeIndex(type, expectedTypes) {
4607
- if (isArray(expectedTypes)) {
4608
- return expectedTypes.findIndex((t) => isSameType(t, type));
4609
- } else if (isFunction(expectedTypes)) {
4610
- return isSameType(expectedTypes, type) ? 0 : -1;
4611
- }
4612
- return -1;
4613
- }
4614
4616
  function validateProps(rawProps, props, instance) {
4615
4617
  const resolvedValues = toRaw(props);
4616
4618
  const options = instance.propsOptions[0];
@@ -4950,15 +4952,11 @@ If you want to remount the same app, move your app creation logic into a factory
4950
4952
  if (n1 == null) {
4951
4953
  const placeholder = n2.el = createComment("teleport start") ;
4952
4954
  const mainAnchor = n2.anchor = createComment("teleport end") ;
4953
- const target = n2.target = resolveTarget(n2.props, querySelector);
4954
- const targetStart = n2.targetStart = createText("");
4955
- const targetAnchor = n2.targetAnchor = createText("");
4956
4955
  insert(placeholder, container, anchor);
4957
4956
  insert(mainAnchor, container, anchor);
4958
- targetStart[TeleportEndKey] = targetAnchor;
4957
+ const target = n2.target = resolveTarget(n2.props, querySelector);
4958
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
4959
4959
  if (target) {
4960
- insert(targetStart, target);
4961
- insert(targetAnchor, target);
4962
4960
  if (namespace === "svg" || isTargetSVG(target)) {
4963
4961
  namespace = "svg";
4964
4962
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -5130,7 +5128,7 @@ If you want to remount the same app, move your app creation logic into a factory
5130
5128
  }
5131
5129
  }
5132
5130
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
5133
- o: { nextSibling, parentNode, querySelector }
5131
+ o: { nextSibling, parentNode, querySelector, insert, createText }
5134
5132
  }, hydrateChildren) {
5135
5133
  const target = vnode.target = resolveTarget(
5136
5134
  vnode.props,
@@ -5149,20 +5147,28 @@ If you want to remount the same app, move your app creation logic into a factory
5149
5147
  slotScopeIds,
5150
5148
  optimized
5151
5149
  );
5152
- vnode.targetAnchor = targetNode;
5150
+ vnode.targetStart = targetNode;
5151
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
5153
5152
  } else {
5154
5153
  vnode.anchor = nextSibling(node);
5155
5154
  let targetAnchor = targetNode;
5156
5155
  while (targetAnchor) {
5157
- targetAnchor = nextSibling(targetAnchor);
5158
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
5159
- vnode.targetAnchor = targetAnchor;
5160
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5161
- break;
5156
+ if (targetAnchor && targetAnchor.nodeType === 8) {
5157
+ if (targetAnchor.data === "teleport start anchor") {
5158
+ vnode.targetStart = targetAnchor;
5159
+ } else if (targetAnchor.data === "teleport anchor") {
5160
+ vnode.targetAnchor = targetAnchor;
5161
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5162
+ break;
5163
+ }
5162
5164
  }
5165
+ targetAnchor = nextSibling(targetAnchor);
5166
+ }
5167
+ if (!vnode.targetAnchor) {
5168
+ prepareAnchor(target, vnode, createText, insert);
5163
5169
  }
5164
5170
  hydrateChildren(
5165
- targetNode,
5171
+ targetNode && nextSibling(targetNode),
5166
5172
  vnode,
5167
5173
  target,
5168
5174
  parentComponent,
@@ -5188,6 +5194,16 @@ If you want to remount the same app, move your app creation logic into a factory
5188
5194
  ctx.ut();
5189
5195
  }
5190
5196
  }
5197
+ function prepareAnchor(target, vnode, createText, insert) {
5198
+ const targetStart = vnode.targetStart = createText("");
5199
+ const targetAnchor = vnode.targetAnchor = createText("");
5200
+ targetStart[TeleportEndKey] = targetAnchor;
5201
+ if (target) {
5202
+ insert(targetStart, target);
5203
+ insert(targetAnchor, target);
5204
+ }
5205
+ return targetAnchor;
5206
+ }
5191
5207
 
5192
5208
  let hasLoggedMismatchError = false;
5193
5209
  const logMismatchError = () => {
@@ -7569,7 +7585,7 @@ Server rendered element contains fewer child nodes than client vdom.`
7569
7585
  const modifiers = getModelModifiers(props, name);
7570
7586
  const res = customRef((track, trigger) => {
7571
7587
  let localValue;
7572
- let prevSetValue;
7588
+ let prevSetValue = EMPTY_OBJ;
7573
7589
  let prevEmittedValue;
7574
7590
  watchSyncEffect(() => {
7575
7591
  const propValue = props[name];
@@ -7584,7 +7600,7 @@ Server rendered element contains fewer child nodes than client vdom.`
7584
7600
  return options.get ? options.get(localValue) : localValue;
7585
7601
  },
7586
7602
  set(value) {
7587
- if (!hasChanged(value, localValue)) {
7603
+ if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
7588
7604
  return;
7589
7605
  }
7590
7606
  const rawProps = i.vnode.props;
@@ -7595,7 +7611,7 @@ Server rendered element contains fewer child nodes than client vdom.`
7595
7611
  }
7596
7612
  const emittedValue = options.set ? options.set(value) : value;
7597
7613
  i.emit(`update:${name}`, emittedValue);
7598
- if (value !== emittedValue && value !== prevSetValue && emittedValue === prevEmittedValue) {
7614
+ if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
7599
7615
  trigger();
7600
7616
  }
7601
7617
  prevSetValue = value;
@@ -9659,7 +9675,7 @@ Component that was made reactive: `,
9659
9675
  return true;
9660
9676
  }
9661
9677
 
9662
- const version = "3.4.33";
9678
+ const version = "3.4.35";
9663
9679
  const warn = warn$1 ;
9664
9680
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9665
9681
  const devtools = devtools$1 ;