@vue/runtime-dom 3.4.15 → 3.4.16

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.15
2
+ * @vue/runtime-dom v3.4.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -377,7 +377,7 @@ const vShow = {
377
377
  }
378
378
  },
379
379
  updated(el, { value, oldValue }, { transition }) {
380
- if (!value === !oldValue)
380
+ if (!value === !oldValue && el.style.display === el[vShowOldKey])
381
381
  return;
382
382
  if (transition) {
383
383
  if (value) {
@@ -445,6 +445,7 @@ function patchStyle(el, prev, next) {
445
445
  }
446
446
  }
447
447
  if (vShowOldKey in el) {
448
+ el[vShowOldKey] = style.display;
448
449
  style.display = currentDisplay;
449
450
  }
450
451
  }
@@ -1242,9 +1243,6 @@ function setSelected(el, value, oldValue, number) {
1242
1243
  );
1243
1244
  return;
1244
1245
  }
1245
- if (isArrayValue && shared.looseEqual(value, oldValue)) {
1246
- return;
1247
- }
1248
1246
  for (let i = 0, l = el.options.length; i < l; i++) {
1249
1247
  const option = el.options[i];
1250
1248
  const optionValue = getValue(option);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.4.15
2
+ * @vue/runtime-dom v3.4.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -374,7 +374,7 @@ const vShow = {
374
374
  }
375
375
  },
376
376
  updated(el, { value, oldValue }, { transition }) {
377
- if (!value === !oldValue)
377
+ if (!value === !oldValue && el.style.display === el[vShowOldKey])
378
378
  return;
379
379
  if (transition) {
380
380
  if (value) {
@@ -439,6 +439,7 @@ function patchStyle(el, prev, next) {
439
439
  }
440
440
  }
441
441
  if (vShowOldKey in el) {
442
+ el[vShowOldKey] = style.display;
442
443
  style.display = currentDisplay;
443
444
  }
444
445
  }
@@ -1195,9 +1196,6 @@ function setSelected(el, value, oldValue, number) {
1195
1196
  if (isMultiple && !isArrayValue && !shared.isSet(value)) {
1196
1197
  return;
1197
1198
  }
1198
- if (isArrayValue && shared.looseEqual(value, oldValue)) {
1199
- return;
1200
- }
1201
1199
  for (let i = 0, l = el.options.length; i < l; i++) {
1202
1200
  const option = el.options[i];
1203
1201
  const optionValue = getValue(option);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.4.15
2
+ * @vue/runtime-dom v3.4.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -407,7 +407,7 @@ class ReactiveEffect {
407
407
  /**
408
408
  * @internal
409
409
  */
410
- this._dirtyLevel = 2;
410
+ this._dirtyLevel = 4;
411
411
  /**
412
412
  * @internal
413
413
  */
@@ -427,26 +427,27 @@ class ReactiveEffect {
427
427
  recordEffectScope(this, scope);
428
428
  }
429
429
  get dirty() {
430
- if (this._dirtyLevel === 1) {
430
+ if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
431
+ this._dirtyLevel = 1;
431
432
  pauseTracking();
432
433
  for (let i = 0; i < this._depsLength; i++) {
433
434
  const dep = this.deps[i];
434
435
  if (dep.computed) {
435
436
  triggerComputed(dep.computed);
436
- if (this._dirtyLevel >= 2) {
437
+ if (this._dirtyLevel >= 4) {
437
438
  break;
438
439
  }
439
440
  }
440
441
  }
441
- if (this._dirtyLevel < 2) {
442
+ if (this._dirtyLevel === 1) {
442
443
  this._dirtyLevel = 0;
443
444
  }
444
445
  resetTracking();
445
446
  }
446
- return this._dirtyLevel >= 2;
447
+ return this._dirtyLevel >= 4;
447
448
  }
448
449
  set dirty(v) {
449
- this._dirtyLevel = v ? 2 : 0;
450
+ this._dirtyLevel = v ? 4 : 0;
450
451
  }
451
452
  run() {
452
453
  this._dirtyLevel = 0;
@@ -486,7 +487,7 @@ function preCleanupEffect(effect2) {
486
487
  effect2._depsLength = 0;
487
488
  }
488
489
  function postCleanupEffect(effect2) {
489
- if (effect2.deps && effect2.deps.length > effect2._depsLength) {
490
+ if (effect2.deps.length > effect2._depsLength) {
490
491
  for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
491
492
  cleanupDepEffect(effect2.deps[i], effect2);
492
493
  }
@@ -569,29 +570,26 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
569
570
  var _a;
570
571
  pauseScheduling();
571
572
  for (const effect2 of dep.keys()) {
572
- if (effect2._dirtyLevel < dirtyLevel && dep.get(effect2) === effect2._trackId) {
573
- const lastDirtyLevel = effect2._dirtyLevel;
573
+ let tracking;
574
+ if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
575
+ effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
574
576
  effect2._dirtyLevel = dirtyLevel;
575
- if (lastDirtyLevel === 0) {
576
- effect2._shouldSchedule = true;
577
- {
578
- (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
577
+ }
578
+ if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
579
+ {
580
+ (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
581
+ }
582
+ effect2.trigger();
583
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
584
+ effect2._shouldSchedule = false;
585
+ if (effect2.scheduler) {
586
+ queueEffectSchedulers.push(effect2.scheduler);
579
587
  }
580
- effect2.trigger();
581
588
  }
582
589
  }
583
590
  }
584
- scheduleEffects(dep);
585
591
  resetScheduling();
586
592
  }
587
- function scheduleEffects(dep) {
588
- for (const effect2 of dep.keys()) {
589
- if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse) && dep.get(effect2) === effect2._trackId) {
590
- effect2._shouldSchedule = false;
591
- queueEffectSchedulers.push(effect2.scheduler);
592
- }
593
- }
594
- }
595
593
 
596
594
  const createDep = (cleanup, computed) => {
597
595
  const dep = /* @__PURE__ */ new Map();
@@ -674,7 +672,7 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
674
672
  if (dep) {
675
673
  triggerEffects(
676
674
  dep,
677
- 2,
675
+ 4,
678
676
  {
679
677
  target,
680
678
  type,
@@ -1259,7 +1257,9 @@ function toRaw(observed) {
1259
1257
  return raw ? toRaw(raw) : observed;
1260
1258
  }
1261
1259
  function markRaw(value) {
1262
- def(value, "__v_skip", true);
1260
+ if (Object.isExtensible(value)) {
1261
+ def(value, "__v_skip", true);
1262
+ }
1263
1263
  return value;
1264
1264
  }
1265
1265
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
@@ -1273,8 +1273,10 @@ class ComputedRefImpl {
1273
1273
  this["__v_isReadonly"] = false;
1274
1274
  this.effect = new ReactiveEffect(
1275
1275
  () => getter(this._value),
1276
- () => triggerRefValue(this, 1),
1277
- () => this.dep && scheduleEffects(this.dep)
1276
+ () => triggerRefValue(
1277
+ this,
1278
+ this.effect._dirtyLevel === 2 ? 2 : 3
1279
+ )
1278
1280
  );
1279
1281
  this.effect.computed = this;
1280
1282
  this.effect.active = this._cacheable = !isSSR;
@@ -1282,14 +1284,12 @@ class ComputedRefImpl {
1282
1284
  }
1283
1285
  get value() {
1284
1286
  const self = toRaw(this);
1285
- if (!self._cacheable || self.effect.dirty) {
1286
- if (hasChanged(self._value, self._value = self.effect.run())) {
1287
- triggerRefValue(self, 2);
1288
- }
1287
+ if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1288
+ triggerRefValue(self, 4);
1289
1289
  }
1290
1290
  trackRefValue(self);
1291
- if (self.effect._dirtyLevel >= 1) {
1292
- triggerRefValue(self, 1);
1291
+ if (self.effect._dirtyLevel >= 2) {
1292
+ triggerRefValue(self, 2);
1293
1293
  }
1294
1294
  return self._value;
1295
1295
  }
@@ -1327,14 +1327,15 @@ function computed$1(getterOrOptions, debugOptions, isSSR = false) {
1327
1327
  }
1328
1328
 
1329
1329
  function trackRefValue(ref2) {
1330
+ var _a;
1330
1331
  if (shouldTrack && activeEffect) {
1331
1332
  ref2 = toRaw(ref2);
1332
1333
  trackEffect(
1333
1334
  activeEffect,
1334
- ref2.dep || (ref2.dep = createDep(
1335
+ (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
1335
1336
  () => ref2.dep = void 0,
1336
1337
  ref2 instanceof ComputedRefImpl ? ref2 : void 0
1337
- )),
1338
+ ),
1338
1339
  {
1339
1340
  target: ref2,
1340
1341
  type: "get",
@@ -1343,7 +1344,7 @@ function trackRefValue(ref2) {
1343
1344
  );
1344
1345
  }
1345
1346
  }
1346
- function triggerRefValue(ref2, dirtyLevel = 2, newVal) {
1347
+ function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1347
1348
  ref2 = toRaw(ref2);
1348
1349
  const dep = ref2.dep;
1349
1350
  if (dep) {
@@ -1392,12 +1393,12 @@ class RefImpl {
1392
1393
  if (hasChanged(newVal, this._rawValue)) {
1393
1394
  this._rawValue = newVal;
1394
1395
  this._value = useDirectValue ? newVal : toReactive(newVal);
1395
- triggerRefValue(this, 2, newVal);
1396
+ triggerRefValue(this, 4, newVal);
1396
1397
  }
1397
1398
  }
1398
1399
  }
1399
1400
  function triggerRef(ref2) {
1400
- triggerRefValue(ref2, 2, ref2.value );
1401
+ triggerRefValue(ref2, 4, ref2.value );
1401
1402
  }
1402
1403
  function unref(ref2) {
1403
1404
  return isRef(ref2) ? ref2.value : ref2;
@@ -5428,11 +5429,12 @@ If you want to remount the same app, move your app creation logic into a factory
5428
5429
  return app;
5429
5430
  },
5430
5431
  runWithContext(fn) {
5432
+ const lastApp = currentApp;
5431
5433
  currentApp = app;
5432
5434
  try {
5433
5435
  return fn();
5434
5436
  } finally {
5435
- currentApp = null;
5437
+ currentApp = lastApp;
5436
5438
  }
5437
5439
  }
5438
5440
  };
@@ -6013,10 +6015,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6013
6015
  } else {
6014
6016
  const _isString = isString(ref);
6015
6017
  const _isRef = isRef(ref);
6016
- const isVFor = rawRef.f;
6017
6018
  if (_isString || _isRef) {
6018
6019
  const doSet = () => {
6019
- if (isVFor) {
6020
+ if (rawRef.f) {
6020
6021
  const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
6021
6022
  if (isUnmount) {
6022
6023
  isArray(existing) && remove(existing, refValue);
@@ -6049,11 +6050,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6049
6050
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6050
6051
  }
6051
6052
  };
6052
- if (isUnmount || isVFor) {
6053
- doSet();
6054
- } else {
6053
+ if (value) {
6055
6054
  doSet.id = -1;
6056
6055
  queuePostRenderEffect(doSet, parentSuspense);
6056
+ } else {
6057
+ doSet();
6057
6058
  }
6058
6059
  } else {
6059
6060
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -6352,7 +6353,7 @@ Server rendered element contains more child nodes than client vdom.`
6352
6353
  if (props) {
6353
6354
  {
6354
6355
  for (const key in props) {
6355
- if (propHasMismatch(el, key, props[key], vnode)) {
6356
+ if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
6356
6357
  hasMismatch = true;
6357
6358
  }
6358
6359
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -6527,7 +6528,8 @@ Server rendered element contains fewer child nodes than client vdom.`
6527
6528
  };
6528
6529
  return [hydrate, hydrateNode];
6529
6530
  }
6530
- function propHasMismatch(el, key, clientValue, vnode) {
6531
+ function propHasMismatch(el, key, clientValue, vnode, instance) {
6532
+ var _a;
6531
6533
  let mismatchType;
6532
6534
  let mismatchKey;
6533
6535
  let actual;
@@ -6550,6 +6552,10 @@ function propHasMismatch(el, key, clientValue, vnode) {
6550
6552
  }
6551
6553
  }
6552
6554
  }
6555
+ const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
6556
+ for (const key2 in cssVars) {
6557
+ expectedMap.set(`--${key2}`, String(cssVars[key2]));
6558
+ }
6553
6559
  if (!isMapEqual(actualMap, expectedMap)) {
6554
6560
  mismatchType = mismatchKey = "style";
6555
6561
  }
@@ -9516,7 +9522,7 @@ function isMemoSame(cached, memo) {
9516
9522
  return true;
9517
9523
  }
9518
9524
 
9519
- const version = "3.4.15";
9525
+ const version = "3.4.16";
9520
9526
  const warn = warn$1 ;
9521
9527
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9522
9528
  const devtools = devtools$1 ;
@@ -9893,7 +9899,7 @@ const vShow = {
9893
9899
  }
9894
9900
  },
9895
9901
  updated(el, { value, oldValue }, { transition }) {
9896
- if (!value === !oldValue)
9902
+ if (!value === !oldValue && el.style.display === el[vShowOldKey])
9897
9903
  return;
9898
9904
  if (transition) {
9899
9905
  if (value) {
@@ -9932,6 +9938,9 @@ function useCssVars(getter) {
9932
9938
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
9933
9939
  ).forEach((node) => setVarsOnNode(node, vars));
9934
9940
  };
9941
+ {
9942
+ instance.getCssVars = () => getter(instance.proxy);
9943
+ }
9935
9944
  const setVars = () => {
9936
9945
  const vars = getter(instance.proxy);
9937
9946
  setVarsOnVNode(instance.subTree, vars);
@@ -10012,6 +10021,7 @@ function patchStyle(el, prev, next) {
10012
10021
  }
10013
10022
  }
10014
10023
  if (vShowOldKey in el) {
10024
+ el[vShowOldKey] = style.display;
10015
10025
  style.display = currentDisplay;
10016
10026
  }
10017
10027
  }
@@ -10809,9 +10819,6 @@ function setSelected(el, value, oldValue, number) {
10809
10819
  );
10810
10820
  return;
10811
10821
  }
10812
- if (isArrayValue && looseEqual(value, oldValue)) {
10813
- return;
10814
- }
10815
10822
  for (let i = 0, l = el.options.length; i < l; i++) {
10816
10823
  const option = el.options[i];
10817
10824
  const optionValue = getValue(option);