@vue/runtime-dom 3.5.22 → 3.5.24

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.5.22
2
+ * @vue/runtime-dom v3.5.24
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -807,6 +807,9 @@ function shouldSetAsProp(el, key, value, isSVG) {
807
807
  if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
808
808
  return false;
809
809
  }
810
+ if (key === "sandbox" && el.tagName === "IFRAME") {
811
+ return false;
812
+ }
810
813
  if (key === "form") {
811
814
  return false;
812
815
  }
@@ -867,6 +870,8 @@ class VueElement extends BaseClass {
867
870
  this._nonce = this._def.nonce;
868
871
  this._connected = false;
869
872
  this._resolved = false;
873
+ this._patching = false;
874
+ this._dirty = false;
870
875
  this._numberProps = null;
871
876
  this._styleChildren = /* @__PURE__ */ new WeakSet();
872
877
  this._ob = null;
@@ -1042,7 +1047,7 @@ class VueElement extends BaseClass {
1042
1047
  return this._getProp(key);
1043
1048
  },
1044
1049
  set(val) {
1045
- this._setProp(key, val, true, true);
1050
+ this._setProp(key, val, true, !this._patching);
1046
1051
  }
1047
1052
  });
1048
1053
  }
@@ -1068,6 +1073,7 @@ class VueElement extends BaseClass {
1068
1073
  */
1069
1074
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
1070
1075
  if (val !== this._props[key]) {
1076
+ this._dirty = true;
1071
1077
  if (val === REMOVAL) {
1072
1078
  delete this._props[key];
1073
1079
  } else {
@@ -1222,10 +1228,14 @@ class VueElement extends BaseClass {
1222
1228
  if (this._teleportTargets) {
1223
1229
  roots.push(...this._teleportTargets);
1224
1230
  }
1225
- return roots.reduce((res, i) => {
1226
- res.push(...Array.from(i.querySelectorAll("slot")));
1227
- return res;
1228
- }, []);
1231
+ const slots = /* @__PURE__ */ new Set();
1232
+ for (const root of roots) {
1233
+ const found = root.querySelectorAll("slot");
1234
+ for (let i = 0; i < found.length; i++) {
1235
+ slots.add(found[i]);
1236
+ }
1237
+ }
1238
+ return Array.from(slots);
1229
1239
  }
1230
1240
  /**
1231
1241
  * @internal
@@ -1233,6 +1243,22 @@ class VueElement extends BaseClass {
1233
1243
  _injectChildStyle(comp) {
1234
1244
  this._applyStyles(comp.styles, comp);
1235
1245
  }
1246
+ /**
1247
+ * @internal
1248
+ */
1249
+ _beginPatch() {
1250
+ this._patching = true;
1251
+ this._dirty = false;
1252
+ }
1253
+ /**
1254
+ * @internal
1255
+ */
1256
+ _endPatch() {
1257
+ this._patching = false;
1258
+ if (this._dirty && this._instance) {
1259
+ this._update();
1260
+ }
1261
+ }
1236
1262
  /**
1237
1263
  * @internal
1238
1264
  */
@@ -1367,10 +1393,10 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1367
1393
  instance
1368
1394
  )
1369
1395
  );
1370
- positionMap.set(
1371
- child,
1372
- child.el.getBoundingClientRect()
1373
- );
1396
+ positionMap.set(child, {
1397
+ left: child.el.offsetLeft,
1398
+ top: child.el.offsetTop
1399
+ });
1374
1400
  }
1375
1401
  }
1376
1402
  }
@@ -1401,7 +1427,10 @@ function callPendingCbs(c) {
1401
1427
  }
1402
1428
  }
1403
1429
  function recordPosition(c) {
1404
- newPositionMap.set(c, c.el.getBoundingClientRect());
1430
+ newPositionMap.set(c, {
1431
+ left: c.el.offsetLeft,
1432
+ top: c.el.offsetTop
1433
+ });
1405
1434
  }
1406
1435
  function applyTranslation(c) {
1407
1436
  const oldPos = positionMap.get(c);
@@ -1447,24 +1476,22 @@ function onCompositionEnd(e) {
1447
1476
  }
1448
1477
  }
1449
1478
  const assignKey = Symbol("_assign");
1479
+ function castValue(value, trim, number) {
1480
+ if (trim) value = value.trim();
1481
+ if (number) value = looseToNumber(value);
1482
+ return value;
1483
+ }
1450
1484
  const vModelText = {
1451
1485
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
1452
1486
  el[assignKey] = getModelAssigner(vnode);
1453
1487
  const castToNumber = number || vnode.props && vnode.props.type === "number";
1454
1488
  addEventListener(el, lazy ? "change" : "input", (e) => {
1455
1489
  if (e.target.composing) return;
1456
- let domValue = el.value;
1457
- if (trim) {
1458
- domValue = domValue.trim();
1459
- }
1460
- if (castToNumber) {
1461
- domValue = looseToNumber(domValue);
1462
- }
1463
- el[assignKey](domValue);
1490
+ el[assignKey](castValue(el.value, trim, castToNumber));
1464
1491
  });
1465
- if (trim) {
1492
+ if (trim || castToNumber) {
1466
1493
  addEventListener(el, "change", () => {
1467
- el.value = el.value.trim();
1494
+ el.value = castValue(el.value, trim, castToNumber);
1468
1495
  });
1469
1496
  }
1470
1497
  if (!lazy) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.22
2
+ * @vue/runtime-dom v3.5.24
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -4124,14 +4124,16 @@ Server rendered element contains more child nodes than client vdom.`
4124
4124
  if (clientText[0] === "\n" && (el.tagName === "PRE" || el.tagName === "TEXTAREA")) {
4125
4125
  clientText = clientText.slice(1);
4126
4126
  }
4127
- if (el.textContent !== clientText) {
4127
+ const { textContent } = el;
4128
+ if (textContent !== clientText && // innerHTML normalize \r\n or \r into a single \n in the DOM
4129
+ textContent !== clientText.replace(/\r\n|\r/g, "\n")) {
4128
4130
  if (!isMismatchAllowed(el, 0 /* TEXT */)) {
4129
4131
  warn$1(
4130
4132
  `Hydration text content mismatch on`,
4131
4133
  el,
4132
4134
  `
4133
- - rendered on server: ${el.textContent}
4134
- - expected on client: ${vnode.children}`
4135
+ - rendered on server: ${textContent}
4136
+ - expected on client: ${clientText}`
4135
4137
  );
4136
4138
  logMismatchError();
4137
4139
  }
@@ -4726,7 +4728,10 @@ Server rendered element contains fewer child nodes than client vdom.`
4726
4728
  error: error.value
4727
4729
  });
4728
4730
  } else if (loadingComponent && !delayed.value) {
4729
- return createVNode(loadingComponent);
4731
+ return createInnerComp(
4732
+ loadingComponent,
4733
+ instance
4734
+ );
4730
4735
  }
4731
4736
  };
4732
4737
  }
@@ -7018,15 +7023,25 @@ If you want to remount the same app, move your app creation logic into a factory
7018
7023
  optimized
7019
7024
  );
7020
7025
  } else {
7021
- patchElement(
7022
- n1,
7023
- n2,
7024
- parentComponent,
7025
- parentSuspense,
7026
- namespace,
7027
- slotScopeIds,
7028
- optimized
7029
- );
7026
+ const customElement = !!(n1.el && n1.el._isVueCE) ? n1.el : null;
7027
+ try {
7028
+ if (customElement) {
7029
+ customElement._beginPatch();
7030
+ }
7031
+ patchElement(
7032
+ n1,
7033
+ n2,
7034
+ parentComponent,
7035
+ parentSuspense,
7036
+ namespace,
7037
+ slotScopeIds,
7038
+ optimized
7039
+ );
7040
+ } finally {
7041
+ if (customElement) {
7042
+ customElement._endPatch();
7043
+ }
7044
+ }
7030
7045
  }
7031
7046
  };
7032
7047
  const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => {
@@ -9240,7 +9255,8 @@ If you want to remount the same app, move your app creation logic into a factory
9240
9255
  pendingId,
9241
9256
  effects,
9242
9257
  parentComponent: parentComponent2,
9243
- container: container2
9258
+ container: container2,
9259
+ isInFallback
9244
9260
  } = suspense;
9245
9261
  let delayEnter = false;
9246
9262
  if (suspense.isHydrating) {
@@ -9257,6 +9273,9 @@ If you want to remount the same app, move your app creation logic into a factory
9257
9273
  0
9258
9274
  );
9259
9275
  queuePostFlushCb(effects);
9276
+ if (isInFallback && vnode2.ssFallback) {
9277
+ vnode2.ssFallback.el = null;
9278
+ }
9260
9279
  }
9261
9280
  };
9262
9281
  }
@@ -9265,6 +9284,9 @@ If you want to remount the same app, move your app creation logic into a factory
9265
9284
  anchor = next(activeBranch);
9266
9285
  }
9267
9286
  unmount(activeBranch, parentComponent2, suspense, true);
9287
+ if (!delayEnter && isInFallback && vnode2.ssFallback) {
9288
+ vnode2.ssFallback.el = null;
9289
+ }
9268
9290
  }
9269
9291
  if (!delayEnter) {
9270
9292
  move(pendingBranch, container2, anchor, 0);
@@ -9383,6 +9405,7 @@ If you want to remount the same app, move your app creation logic into a factory
9383
9405
  optimized2
9384
9406
  );
9385
9407
  if (placeholder) {
9408
+ vnode2.placeholder = null;
9386
9409
  remove(placeholder);
9387
9410
  }
9388
9411
  updateHOCHostEl(instance, vnode2.el);
@@ -10544,7 +10567,7 @@ Component that was made reactive: `,
10544
10567
  return true;
10545
10568
  }
10546
10569
 
10547
- const version = "3.5.22";
10570
+ const version = "3.5.24";
10548
10571
  const warn = warn$1 ;
10549
10572
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10550
10573
  const devtools = devtools$1 ;
@@ -11347,6 +11370,9 @@ Expected function or array of functions, received type ${typeof value}.`
11347
11370
  if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") {
11348
11371
  return false;
11349
11372
  }
11373
+ if (key === "sandbox" && el.tagName === "IFRAME") {
11374
+ return false;
11375
+ }
11350
11376
  if (key === "form") {
11351
11377
  return false;
11352
11378
  }
@@ -11407,6 +11433,8 @@ Expected function or array of functions, received type ${typeof value}.`
11407
11433
  this._nonce = this._def.nonce;
11408
11434
  this._connected = false;
11409
11435
  this._resolved = false;
11436
+ this._patching = false;
11437
+ this._dirty = false;
11410
11438
  this._numberProps = null;
11411
11439
  this._styleChildren = /* @__PURE__ */ new WeakSet();
11412
11440
  this._ob = null;
@@ -11582,7 +11610,7 @@ Expected function or array of functions, received type ${typeof value}.`
11582
11610
  return this._getProp(key);
11583
11611
  },
11584
11612
  set(val) {
11585
- this._setProp(key, val, true, true);
11613
+ this._setProp(key, val, true, !this._patching);
11586
11614
  }
11587
11615
  });
11588
11616
  }
@@ -11608,6 +11636,7 @@ Expected function or array of functions, received type ${typeof value}.`
11608
11636
  */
11609
11637
  _setProp(key, val, shouldReflect = true, shouldUpdate = false) {
11610
11638
  if (val !== this._props[key]) {
11639
+ this._dirty = true;
11611
11640
  if (val === REMOVAL) {
11612
11641
  delete this._props[key];
11613
11642
  } else {
@@ -11762,10 +11791,14 @@ Expected function or array of functions, received type ${typeof value}.`
11762
11791
  if (this._teleportTargets) {
11763
11792
  roots.push(...this._teleportTargets);
11764
11793
  }
11765
- return roots.reduce((res, i) => {
11766
- res.push(...Array.from(i.querySelectorAll("slot")));
11767
- return res;
11768
- }, []);
11794
+ const slots = /* @__PURE__ */ new Set();
11795
+ for (const root of roots) {
11796
+ const found = root.querySelectorAll("slot");
11797
+ for (let i = 0; i < found.length; i++) {
11798
+ slots.add(found[i]);
11799
+ }
11800
+ }
11801
+ return Array.from(slots);
11769
11802
  }
11770
11803
  /**
11771
11804
  * @internal
@@ -11773,6 +11806,22 @@ Expected function or array of functions, received type ${typeof value}.`
11773
11806
  _injectChildStyle(comp) {
11774
11807
  this._applyStyles(comp.styles, comp);
11775
11808
  }
11809
+ /**
11810
+ * @internal
11811
+ */
11812
+ _beginPatch() {
11813
+ this._patching = true;
11814
+ this._dirty = false;
11815
+ }
11816
+ /**
11817
+ * @internal
11818
+ */
11819
+ _endPatch() {
11820
+ this._patching = false;
11821
+ if (this._dirty && this._instance) {
11822
+ this._update();
11823
+ }
11824
+ }
11776
11825
  /**
11777
11826
  * @internal
11778
11827
  */
@@ -11895,10 +11944,10 @@ Expected function or array of functions, received type ${typeof value}.`
11895
11944
  instance
11896
11945
  )
11897
11946
  );
11898
- positionMap.set(
11899
- child,
11900
- child.el.getBoundingClientRect()
11901
- );
11947
+ positionMap.set(child, {
11948
+ left: child.el.offsetLeft,
11949
+ top: child.el.offsetTop
11950
+ });
11902
11951
  }
11903
11952
  }
11904
11953
  }
@@ -11929,7 +11978,10 @@ Expected function or array of functions, received type ${typeof value}.`
11929
11978
  }
11930
11979
  }
11931
11980
  function recordPosition(c) {
11932
- newPositionMap.set(c, c.el.getBoundingClientRect());
11981
+ newPositionMap.set(c, {
11982
+ left: c.el.offsetLeft,
11983
+ top: c.el.offsetTop
11984
+ });
11933
11985
  }
11934
11986
  function applyTranslation(c) {
11935
11987
  const oldPos = positionMap.get(c);
@@ -11975,24 +12027,22 @@ Expected function or array of functions, received type ${typeof value}.`
11975
12027
  }
11976
12028
  }
11977
12029
  const assignKey = Symbol("_assign");
12030
+ function castValue(value, trim, number) {
12031
+ if (trim) value = value.trim();
12032
+ if (number) value = looseToNumber(value);
12033
+ return value;
12034
+ }
11978
12035
  const vModelText = {
11979
12036
  created(el, { modifiers: { lazy, trim, number } }, vnode) {
11980
12037
  el[assignKey] = getModelAssigner(vnode);
11981
12038
  const castToNumber = number || vnode.props && vnode.props.type === "number";
11982
12039
  addEventListener(el, lazy ? "change" : "input", (e) => {
11983
12040
  if (e.target.composing) return;
11984
- let domValue = el.value;
11985
- if (trim) {
11986
- domValue = domValue.trim();
11987
- }
11988
- if (castToNumber) {
11989
- domValue = looseToNumber(domValue);
11990
- }
11991
- el[assignKey](domValue);
12041
+ el[assignKey](castValue(el.value, trim, castToNumber));
11992
12042
  });
11993
- if (trim) {
12043
+ if (trim || castToNumber) {
11994
12044
  addEventListener(el, "change", () => {
11995
- el.value = el.value.trim();
12045
+ el.value = castValue(el.value, trim, castToNumber);
11996
12046
  });
11997
12047
  }
11998
12048
  if (!lazy) {