vue 3.4.34 → 3.4.36

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.34
2
+ * vue v3.4.36
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.34
2
+ * vue v3.4.36
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 = () => {
@@ -5471,6 +5487,7 @@ Server rendered element contains more child nodes than client vdom.`
5471
5487
  }
5472
5488
  if (props) {
5473
5489
  {
5490
+ const isCustomElement = el.tagName.includes("-");
5474
5491
  for (const key in props) {
5475
5492
  if (// #11189 skip if this node has directives that have created hooks
5476
5493
  // as it could have mutated the DOM in any possible way
@@ -5478,7 +5495,7 @@ Server rendered element contains more child nodes than client vdom.`
5478
5495
  logMismatchError();
5479
5496
  }
5480
5497
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
5481
- key[0] === ".") {
5498
+ key[0] === "." || isCustomElement) {
5482
5499
  patchProp(el, key, null, props[key], void 0, parentComponent);
5483
5500
  }
5484
5501
  }
@@ -9659,7 +9676,7 @@ Component that was made reactive: `,
9659
9676
  return true;
9660
9677
  }
9661
9678
 
9662
- const version = "3.4.34";
9679
+ const version = "3.4.36";
9663
9680
  const warn = warn$1 ;
9664
9681
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9665
9682
  const devtools = devtools$1 ;