@vue/runtime-dom 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/runtime-dom v3.4.33
2
+ * @vue/runtime-dom v3.4.35
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4495,14 +4495,27 @@ If you want to remount the same app, move your app creation logic into a factory
4495
4495
  if (validatePropName(normalizedKey)) {
4496
4496
  const opt = raw[key];
4497
4497
  const prop = normalized[normalizedKey] = isArray(opt) || isFunction(opt) ? { type: opt } : extend({}, opt);
4498
- if (prop) {
4499
- const booleanIndex = getTypeIndex(Boolean, prop.type);
4500
- const stringIndex = getTypeIndex(String, prop.type);
4501
- prop[0 /* shouldCast */] = booleanIndex > -1;
4502
- prop[1 /* shouldCastTrue */] = stringIndex < 0 || booleanIndex < stringIndex;
4503
- if (booleanIndex > -1 || hasOwn(prop, "default")) {
4504
- needCastKeys.push(normalizedKey);
4498
+ const propType = prop.type;
4499
+ let shouldCast = false;
4500
+ let shouldCastTrue = true;
4501
+ if (isArray(propType)) {
4502
+ for (let index = 0; index < propType.length; ++index) {
4503
+ const type = propType[index];
4504
+ const typeName = isFunction(type) && type.name;
4505
+ if (typeName === "Boolean") {
4506
+ shouldCast = true;
4507
+ break;
4508
+ } else if (typeName === "String") {
4509
+ shouldCastTrue = false;
4510
+ }
4505
4511
  }
4512
+ } else {
4513
+ shouldCast = isFunction(propType) && propType.name === "Boolean";
4514
+ }
4515
+ prop[0 /* shouldCast */] = shouldCast;
4516
+ prop[1 /* shouldCastTrue */] = shouldCastTrue;
4517
+ if (shouldCast || hasOwn(prop, "default")) {
4518
+ needCastKeys.push(normalizedKey);
4506
4519
  }
4507
4520
  }
4508
4521
  }
@@ -4533,17 +4546,6 @@ If you want to remount the same app, move your app creation logic into a factory
4533
4546
  }
4534
4547
  return "";
4535
4548
  }
4536
- function isSameType(a, b) {
4537
- return getType(a) === getType(b);
4538
- }
4539
- function getTypeIndex(type, expectedTypes) {
4540
- if (isArray(expectedTypes)) {
4541
- return expectedTypes.findIndex((t) => isSameType(t, type));
4542
- } else if (isFunction(expectedTypes)) {
4543
- return isSameType(expectedTypes, type) ? 0 : -1;
4544
- }
4545
- return -1;
4546
- }
4547
4549
  function validateProps(rawProps, props, instance) {
4548
4550
  const resolvedValues = toRaw(props);
4549
4551
  const options = instance.propsOptions[0];
@@ -4883,15 +4885,11 @@ If you want to remount the same app, move your app creation logic into a factory
4883
4885
  if (n1 == null) {
4884
4886
  const placeholder = n2.el = createComment("teleport start") ;
4885
4887
  const mainAnchor = n2.anchor = createComment("teleport end") ;
4886
- const target = n2.target = resolveTarget(n2.props, querySelector);
4887
- const targetStart = n2.targetStart = createText("");
4888
- const targetAnchor = n2.targetAnchor = createText("");
4889
4888
  insert(placeholder, container, anchor);
4890
4889
  insert(mainAnchor, container, anchor);
4891
- targetStart[TeleportEndKey] = targetAnchor;
4890
+ const target = n2.target = resolveTarget(n2.props, querySelector);
4891
+ const targetAnchor = prepareAnchor(target, n2, createText, insert);
4892
4892
  if (target) {
4893
- insert(targetStart, target);
4894
- insert(targetAnchor, target);
4895
4893
  if (namespace === "svg" || isTargetSVG(target)) {
4896
4894
  namespace = "svg";
4897
4895
  } else if (namespace === "mathml" || isTargetMathML(target)) {
@@ -5063,7 +5061,7 @@ If you want to remount the same app, move your app creation logic into a factory
5063
5061
  }
5064
5062
  }
5065
5063
  function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, {
5066
- o: { nextSibling, parentNode, querySelector }
5064
+ o: { nextSibling, parentNode, querySelector, insert, createText }
5067
5065
  }, hydrateChildren) {
5068
5066
  const target = vnode.target = resolveTarget(
5069
5067
  vnode.props,
@@ -5082,20 +5080,28 @@ If you want to remount the same app, move your app creation logic into a factory
5082
5080
  slotScopeIds,
5083
5081
  optimized
5084
5082
  );
5085
- vnode.targetAnchor = targetNode;
5083
+ vnode.targetStart = targetNode;
5084
+ vnode.targetAnchor = targetNode && nextSibling(targetNode);
5086
5085
  } else {
5087
5086
  vnode.anchor = nextSibling(node);
5088
5087
  let targetAnchor = targetNode;
5089
5088
  while (targetAnchor) {
5090
- targetAnchor = nextSibling(targetAnchor);
5091
- if (targetAnchor && targetAnchor.nodeType === 8 && targetAnchor.data === "teleport anchor") {
5092
- vnode.targetAnchor = targetAnchor;
5093
- target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5094
- break;
5089
+ if (targetAnchor && targetAnchor.nodeType === 8) {
5090
+ if (targetAnchor.data === "teleport start anchor") {
5091
+ vnode.targetStart = targetAnchor;
5092
+ } else if (targetAnchor.data === "teleport anchor") {
5093
+ vnode.targetAnchor = targetAnchor;
5094
+ target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
5095
+ break;
5096
+ }
5095
5097
  }
5098
+ targetAnchor = nextSibling(targetAnchor);
5099
+ }
5100
+ if (!vnode.targetAnchor) {
5101
+ prepareAnchor(target, vnode, createText, insert);
5096
5102
  }
5097
5103
  hydrateChildren(
5098
- targetNode,
5104
+ targetNode && nextSibling(targetNode),
5099
5105
  vnode,
5100
5106
  target,
5101
5107
  parentComponent,
@@ -5121,6 +5127,16 @@ If you want to remount the same app, move your app creation logic into a factory
5121
5127
  ctx.ut();
5122
5128
  }
5123
5129
  }
5130
+ function prepareAnchor(target, vnode, createText, insert) {
5131
+ const targetStart = vnode.targetStart = createText("");
5132
+ const targetAnchor = vnode.targetAnchor = createText("");
5133
+ targetStart[TeleportEndKey] = targetAnchor;
5134
+ if (target) {
5135
+ insert(targetStart, target);
5136
+ insert(targetAnchor, target);
5137
+ }
5138
+ return targetAnchor;
5139
+ }
5124
5140
 
5125
5141
  let hasLoggedMismatchError = false;
5126
5142
  const logMismatchError = () => {
@@ -7502,7 +7518,7 @@ Server rendered element contains fewer child nodes than client vdom.`
7502
7518
  const modifiers = getModelModifiers(props, name);
7503
7519
  const res = customRef((track, trigger) => {
7504
7520
  let localValue;
7505
- let prevSetValue;
7521
+ let prevSetValue = EMPTY_OBJ;
7506
7522
  let prevEmittedValue;
7507
7523
  watchSyncEffect(() => {
7508
7524
  const propValue = props[name];
@@ -7517,7 +7533,7 @@ Server rendered element contains fewer child nodes than client vdom.`
7517
7533
  return options.get ? options.get(localValue) : localValue;
7518
7534
  },
7519
7535
  set(value) {
7520
- if (!hasChanged(value, localValue)) {
7536
+ if (!hasChanged(value, localValue) && !(prevSetValue !== EMPTY_OBJ && hasChanged(value, prevSetValue))) {
7521
7537
  return;
7522
7538
  }
7523
7539
  const rawProps = i.vnode.props;
@@ -7528,7 +7544,7 @@ Server rendered element contains fewer child nodes than client vdom.`
7528
7544
  }
7529
7545
  const emittedValue = options.set ? options.set(value) : value;
7530
7546
  i.emit(`update:${name}`, emittedValue);
7531
- if (value !== emittedValue && value !== prevSetValue && emittedValue === prevEmittedValue) {
7547
+ if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) {
7532
7548
  trigger();
7533
7549
  }
7534
7550
  prevSetValue = value;
@@ -9592,7 +9608,7 @@ Component that was made reactive: `,
9592
9608
  return true;
9593
9609
  }
9594
9610
 
9595
- const version = "3.4.33";
9611
+ const version = "3.4.35";
9596
9612
  const warn = warn$1 ;
9597
9613
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9598
9614
  const devtools = devtools$1 ;