@vue/runtime-dom 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/runtime-dom v3.4.34
2
+ * @vue/runtime-dom 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/runtime-dom v3.4.34
2
+ * @vue/runtime-dom 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/runtime-dom v3.4.34
2
+ * @vue/runtime-dom v3.4.36
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4492,14 +4492,27 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
4492
4492
  if (validatePropName(normalizedKey)) {
4493
4493
  const opt = raw[key];
4494
4494
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
4495
- if (prop) {
4496
- const booleanIndex = getTypeIndex(Boolean, prop.type);
4497
- const stringIndex = getTypeIndex(String, prop.type);
4498
- prop[0 /* shouldCast */] = booleanIndex > -1;
4499
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
4500
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
4501
- needCastKeys.push(normalizedKey);
4495
+ const propType = prop.type;
4496
+ let shouldCast = false;
4497
+ let shouldCastTrue = true;
4498
+ if (isArray(propType)) {
4499
+ for (let index = 0; index < propType.length; ++index) {
4500
+ const type = propType[index];
4501
+ const typeName = isFunction(type) && type.name;
4502
+ if (typeName === "Boolean") {
4503
+ shouldCast = true;
4504
+ break;
4505
+ } else if (typeName === "String") {
4506
+ shouldCastTrue = false;
4507
+ }
4502
4508
  }
4509
+ } else {
4510
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
4511
+ }
4512
+ prop[0 /* shouldCast */] = shouldCast;
4513
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
4514
+ if (shouldCast || hasOwn(prop, "default")) {
4515
+ needCastKeys.push(normalizedKey);
4503
4516
  }
4504
4517
  }
4505
4518
  }
@@ -4530,17 +4543,6 @@ function getType(ctor) {
4530
4543
  }
4531
4544
  return "";
4532
4545
  }
4533
- function isSameType(a, b) {
4534
- return getType(a) === getType(b);
4535
- }
4536
- function getTypeIndex(type, expectedTypes) {
4537
- if (isArray(expectedTypes)) {
4538
- return expectedTypes.findIndex((t) => isSameType(t, type));
4539
- } else if (isFunction(expectedTypes)) {
4540
- return isSameType(expectedTypes, type) ? 0 : -1;
4541
- }
4542
- return -1;
4543
- }
4544
4546
  function validateProps(rawProps, props, instance) {
4545
4547
  const resolvedValues = toRaw(props);
4546
4548
  const options = instance.propsOptions[0];
@@ -4880,15 +4882,11 @@ const TeleportImpl = {
4880
4882
  if (n1 == null) {
4881
4883
  const placeholder = n2.el = createComment("teleport start") ;
4882
4884
  const mainAnchor = n2.anchor = createComment("teleport end") ;
4883
- const target = n2.target = resolveTarget(n2.props, querySelector);
4884
- const targetStart = n2.targetStart = createText("");
4885
- const targetAnchor = n2.targetAnchor = createText("");
4886
4885
  insert(placeholder, container, anchor);
4887
4886
  insert(mainAnchor, container, anchor);
4888
- targetStart[TeleportEndKey] = targetAnchor;
4887
+ const target = n2.target = resolveTarget(n2.props, querySelector);
4888
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
4889
4889
  if (target) {
4890
- insert(targetStart, target);
4891
- insert(targetAnchor, target);
4892
4890
  if (namespace === "svg" || isTargetSVG(target)) {
4893
4891
  namespace = "svg";
4894
4892
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -5060,7 +5058,7 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
5060
5058
  }
5061
5059
  }
5062
5060
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
5063
- o: { nextSibling, parentNode, querySelector }
5061
+ o: { nextSibling, parentNode, querySelector, insert, createText }
5064
5062
  }, hydrateChildren) {
5065
5063
  const target = vnode.target = resolveTarget(
5066
5064
  vnode.props,
@@ -5079,20 +5077,28 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
5079
5077
  slotScopeIds,
5080
5078
  optimized
5081
5079
  );
5082
- vnode.targetAnchor = targetNode;
5080
+ vnode.targetStart = targetNode;
5081
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
5083
5082
  } else {
5084
5083
  vnode.anchor = nextSibling(node);
5085
5084
  let targetAnchor = targetNode;
5086
5085
  while (targetAnchor) {
5087
- targetAnchor = nextSibling(targetAnchor);
5088
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
5089
- vnode.targetAnchor = targetAnchor;
5090
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5091
- break;
5086
+ if (targetAnchor && targetAnchor.nodeType === 8) {
5087
+ if (targetAnchor.data === "teleport start anchor") {
5088
+ vnode.targetStart = targetAnchor;
5089
+ } else if (targetAnchor.data === "teleport anchor") {
5090
+ vnode.targetAnchor = targetAnchor;
5091
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5092
+ break;
5093
+ }
5092
5094
  }
5095
+ targetAnchor = nextSibling(targetAnchor);
5096
+ }
5097
+ if (!vnode.targetAnchor) {
5098
+ prepareAnchor(target, vnode, createText, insert);
5093
5099
  }
5094
5100
  hydrateChildren(
5095
- targetNode,
5101
+ targetNode && nextSibling(targetNode),
5096
5102
  vnode,
5097
5103
  target,
5098
5104
  parentComponent,
@@ -5118,6 +5124,16 @@ function updateCssVars(vnode) {
5118
5124
  ctx.ut();
5119
5125
  }
5120
5126
  }
5127
+ function prepareAnchor(target, vnode, createText, insert) {
5128
+ const targetStart = vnode.targetStart = createText("");
5129
+ const targetAnchor = vnode.targetAnchor = createText("");
5130
+ targetStart[TeleportEndKey] = targetAnchor;
5131
+ if (target) {
5132
+ insert(targetStart, target);
5133
+ insert(targetAnchor, target);
5134
+ }
5135
+ return targetAnchor;
5136
+ }
5121
5137
 
5122
5138
  let hasLoggedMismatchError = false;
5123
5139
  const logMismatchError = () => {
@@ -5401,6 +5417,7 @@ Server rendered element contains more child nodes than client vdom.`
5401
5417
  }
5402
5418
  if (props) {
5403
5419
  {
5420
+ const isCustomElement = el.tagName.includes("-");
5404
5421
  for (const key in props) {
5405
5422
  if (// #11189 skip if this node has directives that have created hooks
5406
5423
  // as it could have mutated the DOM in any possible way
@@ -5408,7 +5425,7 @@ Server rendered element contains more child nodes than client vdom.`
5408
5425
  logMismatchError();
5409
5426
  }
5410
5427
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
5411
- key[0] === ".") {
5428
+ key[0] === "." || isCustomElement) {
5412
5429
  patchProp(el, key, null, props[key], void 0, parentComponent);
5413
5430
  }
5414
5431
  }
@@ -9595,7 +9612,7 @@ function isMemoSame(cached, memo) {
9595
9612
  return true;
9596
9613
  }
9597
9614
 
9598
- const version = "3.4.34";
9615
+ const version = "3.4.36";
9599
9616
  const warn = warn$1 ;
9600
9617
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9601
9618
  const devtools = devtools$1 ;