@vue/runtime-dom 3.4.15 → 3.4.17

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.17
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -410,7 +410,7 @@ var VueRuntimeDOM = (function (exports) {
410
410
  /**
411
411
  * @internal
412
412
  */
413
- this._dirtyLevel = 2;
413
+ this._dirtyLevel = 4;
414
414
  /**
415
415
  * @internal
416
416
  */
@@ -430,26 +430,27 @@ var VueRuntimeDOM = (function (exports) {
430
430
  recordEffectScope(this, scope);
431
431
  }
432
432
  get dirty() {
433
- if (this._dirtyLevel === 1) {
433
+ if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
434
+ this._dirtyLevel = 1;
434
435
  pauseTracking();
435
436
  for (let i = 0; i < this._depsLength; i++) {
436
437
  const dep = this.deps[i];
437
438
  if (dep.computed) {
438
439
  triggerComputed(dep.computed);
439
- if (this._dirtyLevel >= 2) {
440
+ if (this._dirtyLevel >= 4) {
440
441
  break;
441
442
  }
442
443
  }
443
444
  }
444
- if (this._dirtyLevel < 2) {
445
+ if (this._dirtyLevel === 1) {
445
446
  this._dirtyLevel = 0;
446
447
  }
447
448
  resetTracking();
448
449
  }
449
- return this._dirtyLevel >= 2;
450
+ return this._dirtyLevel >= 4;
450
451
  }
451
452
  set dirty(v) {
452
- this._dirtyLevel = v ? 2 : 0;
453
+ this._dirtyLevel = v ? 4 : 0;
453
454
  }
454
455
  run() {
455
456
  this._dirtyLevel = 0;
@@ -489,7 +490,7 @@ var VueRuntimeDOM = (function (exports) {
489
490
  effect2._depsLength = 0;
490
491
  }
491
492
  function postCleanupEffect(effect2) {
492
- if (effect2.deps && effect2.deps.length > effect2._depsLength) {
493
+ if (effect2.deps.length > effect2._depsLength) {
493
494
  for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
494
495
  cleanupDepEffect(effect2.deps[i], effect2);
495
496
  }
@@ -572,29 +573,26 @@ var VueRuntimeDOM = (function (exports) {
572
573
  var _a;
573
574
  pauseScheduling();
574
575
  for (const effect2 of dep.keys()) {
575
- if (effect2._dirtyLevel < dirtyLevel && dep.get(effect2) === effect2._trackId) {
576
- const lastDirtyLevel = effect2._dirtyLevel;
576
+ let tracking;
577
+ if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
578
+ effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
577
579
  effect2._dirtyLevel = dirtyLevel;
578
- if (lastDirtyLevel === 0) {
579
- effect2._shouldSchedule = true;
580
- {
581
- (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
580
+ }
581
+ if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
582
+ {
583
+ (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
584
+ }
585
+ effect2.trigger();
586
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
587
+ effect2._shouldSchedule = false;
588
+ if (effect2.scheduler) {
589
+ queueEffectSchedulers.push(effect2.scheduler);
582
590
  }
583
- effect2.trigger();
584
591
  }
585
592
  }
586
593
  }
587
- scheduleEffects(dep);
588
594
  resetScheduling();
589
595
  }
590
- function scheduleEffects(dep) {
591
- for (const effect2 of dep.keys()) {
592
- if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse) && dep.get(effect2) === effect2._trackId) {
593
- effect2._shouldSchedule = false;
594
- queueEffectSchedulers.push(effect2.scheduler);
595
- }
596
- }
597
- }
598
596
 
599
597
  const createDep = (cleanup, computed) => {
600
598
  const dep = /* @__PURE__ */ new Map();
@@ -677,7 +675,7 @@ var VueRuntimeDOM = (function (exports) {
677
675
  if (dep) {
678
676
  triggerEffects(
679
677
  dep,
680
- 2,
678
+ 4,
681
679
  {
682
680
  target,
683
681
  type,
@@ -1262,7 +1260,9 @@ var VueRuntimeDOM = (function (exports) {
1262
1260
  return raw ? toRaw(raw) : observed;
1263
1261
  }
1264
1262
  function markRaw(value) {
1265
- def(value, "__v_skip", true);
1263
+ if (Object.isExtensible(value)) {
1264
+ def(value, "__v_skip", true);
1265
+ }
1266
1266
  return value;
1267
1267
  }
1268
1268
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
@@ -1276,8 +1276,10 @@ var VueRuntimeDOM = (function (exports) {
1276
1276
  this["__v_isReadonly"] = false;
1277
1277
  this.effect = new ReactiveEffect(
1278
1278
  () => getter(this._value),
1279
- () => triggerRefValue(this, 1),
1280
- () => this.dep && scheduleEffects(this.dep)
1279
+ () => triggerRefValue(
1280
+ this,
1281
+ this.effect._dirtyLevel === 2 ? 2 : 3
1282
+ )
1281
1283
  );
1282
1284
  this.effect.computed = this;
1283
1285
  this.effect.active = this._cacheable = !isSSR;
@@ -1285,14 +1287,12 @@ var VueRuntimeDOM = (function (exports) {
1285
1287
  }
1286
1288
  get value() {
1287
1289
  const self = toRaw(this);
1288
- if (!self._cacheable || self.effect.dirty) {
1289
- if (hasChanged(self._value, self._value = self.effect.run())) {
1290
- triggerRefValue(self, 2);
1291
- }
1290
+ if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1291
+ triggerRefValue(self, 4);
1292
1292
  }
1293
1293
  trackRefValue(self);
1294
- if (self.effect._dirtyLevel >= 1) {
1295
- triggerRefValue(self, 1);
1294
+ if (self.effect._dirtyLevel >= 2) {
1295
+ triggerRefValue(self, 2);
1296
1296
  }
1297
1297
  return self._value;
1298
1298
  }
@@ -1330,14 +1330,15 @@ var VueRuntimeDOM = (function (exports) {
1330
1330
  }
1331
1331
 
1332
1332
  function trackRefValue(ref2) {
1333
+ var _a;
1333
1334
  if (shouldTrack && activeEffect) {
1334
1335
  ref2 = toRaw(ref2);
1335
1336
  trackEffect(
1336
1337
  activeEffect,
1337
- ref2.dep || (ref2.dep = createDep(
1338
+ (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
1338
1339
  () => ref2.dep = void 0,
1339
1340
  ref2 instanceof ComputedRefImpl ? ref2 : void 0
1340
- )),
1341
+ ),
1341
1342
  {
1342
1343
  target: ref2,
1343
1344
  type: "get",
@@ -1346,7 +1347,7 @@ var VueRuntimeDOM = (function (exports) {
1346
1347
  );
1347
1348
  }
1348
1349
  }
1349
- function triggerRefValue(ref2, dirtyLevel = 2, newVal) {
1350
+ function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1350
1351
  ref2 = toRaw(ref2);
1351
1352
  const dep = ref2.dep;
1352
1353
  if (dep) {
@@ -1395,12 +1396,12 @@ var VueRuntimeDOM = (function (exports) {
1395
1396
  if (hasChanged(newVal, this._rawValue)) {
1396
1397
  this._rawValue = newVal;
1397
1398
  this._value = useDirectValue ? newVal : toReactive(newVal);
1398
- triggerRefValue(this, 2, newVal);
1399
+ triggerRefValue(this, 4, newVal);
1399
1400
  }
1400
1401
  }
1401
1402
  }
1402
1403
  function triggerRef(ref2) {
1403
- triggerRefValue(ref2, 2, ref2.value );
1404
+ triggerRefValue(ref2, 4, ref2.value );
1404
1405
  }
1405
1406
  function unref(ref2) {
1406
1407
  return isRef(ref2) ? ref2.value : ref2;
@@ -5425,11 +5426,12 @@ If you want to remount the same app, move your app creation logic into a factory
5425
5426
  return app;
5426
5427
  },
5427
5428
  runWithContext(fn) {
5429
+ const lastApp = currentApp;
5428
5430
  currentApp = app;
5429
5431
  try {
5430
5432
  return fn();
5431
5433
  } finally {
5432
- currentApp = null;
5434
+ currentApp = lastApp;
5433
5435
  }
5434
5436
  }
5435
5437
  };
@@ -6010,10 +6012,9 @@ If you want to remount the same app, move your app creation logic into a factory
6010
6012
  } else {
6011
6013
  const _isString = isString(ref);
6012
6014
  const _isRef = isRef(ref);
6013
- const isVFor = rawRef.f;
6014
6015
  if (_isString || _isRef) {
6015
6016
  const doSet = () => {
6016
- if (isVFor) {
6017
+ if (rawRef.f) {
6017
6018
  const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
6018
6019
  if (isUnmount) {
6019
6020
  isArray(existing) && remove(existing, refValue);
@@ -6046,11 +6047,11 @@ If you want to remount the same app, move your app creation logic into a factory
6046
6047
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6047
6048
  }
6048
6049
  };
6049
- if (isUnmount || isVFor) {
6050
- doSet();
6051
- } else {
6050
+ if (value) {
6052
6051
  doSet.id = -1;
6053
6052
  queuePostRenderEffect(doSet, parentSuspense);
6053
+ } else {
6054
+ doSet();
6054
6055
  }
6055
6056
  } else {
6056
6057
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -6349,7 +6350,7 @@ Server rendered element contains more child nodes than client vdom.`
6349
6350
  if (props) {
6350
6351
  {
6351
6352
  for (const key in props) {
6352
- if (propHasMismatch(el, key, props[key], vnode)) {
6353
+ if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
6353
6354
  hasMismatch = true;
6354
6355
  }
6355
6356
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -6524,7 +6525,8 @@ Server rendered element contains fewer child nodes than client vdom.`
6524
6525
  };
6525
6526
  return [hydrate, hydrateNode];
6526
6527
  }
6527
- function propHasMismatch(el, key, clientValue, vnode) {
6528
+ function propHasMismatch(el, key, clientValue, vnode, instance) {
6529
+ var _a;
6528
6530
  let mismatchType;
6529
6531
  let mismatchKey;
6530
6532
  let actual;
@@ -6547,6 +6549,10 @@ Server rendered element contains fewer child nodes than client vdom.`
6547
6549
  }
6548
6550
  }
6549
6551
  }
6552
+ const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
6553
+ for (const key2 in cssVars) {
6554
+ expectedMap.set(`--${key2}`, String(cssVars[key2]));
6555
+ }
6550
6556
  if (!isMapEqual(actualMap, expectedMap)) {
6551
6557
  mismatchType = mismatchKey = "style";
6552
6558
  }
@@ -9513,7 +9519,7 @@ Component that was made reactive: `,
9513
9519
  return true;
9514
9520
  }
9515
9521
 
9516
- const version = "3.4.15";
9522
+ const version = "3.4.17";
9517
9523
  const warn = warn$1 ;
9518
9524
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9519
9525
  const devtools = devtools$1 ;
@@ -9929,6 +9935,9 @@ Component that was made reactive: `,
9929
9935
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
9930
9936
  ).forEach((node) => setVarsOnNode(node, vars));
9931
9937
  };
9938
+ {
9939
+ instance.getCssVars = () => getter(instance.proxy);
9940
+ }
9932
9941
  const setVars = () => {
9933
9942
  const vars = getter(instance.proxy);
9934
9943
  setVarsOnVNode(instance.subTree, vars);
@@ -10794,9 +10803,6 @@ Component that was made reactive: `,
10794
10803
  );
10795
10804
  return;
10796
10805
  }
10797
- if (isArrayValue && looseEqual(value, oldValue)) {
10798
- return;
10799
- }
10800
10806
  for (let i = 0, l = el.options.length; i < l; i++) {
10801
10807
  const option = el.options[i];
10802
10808
  const optionValue = getValue(option);